Quellcode durchsuchen

更新了 一些前端样式

Ryuiso vor 6 Monaten
Ursprung
Commit
f65208ddd9

+ 5 - 5
src/pages/layout/components/Nav.tsx

@@ -6,7 +6,7 @@ import {
   FileSearchOutlined,
   MenuFoldOutlined,
   MenuUnfoldOutlined,
-  StepForwardOutlined
+  CheckSquareOutlined
 } from '@ant-design/icons';
 import router from '@/router';
 import { JSX } from 'react/jsx-runtime';
@@ -47,7 +47,7 @@ const Nav : React.FC<Props> = ( props : Props ) => {
     {
       key: '/deepseek/questionAnswer',
       icon: <RobotOutlined />,
-      label: 'DeepSeek问答应用',
+      label: '问答广场',
       onClick: () => {
         router.navigate( { pathname: '/deepseek/questionAnswer' } )
       }
@@ -55,7 +55,7 @@ const Nav : React.FC<Props> = ( props : Props ) => {
     {
       key: '/deepseek/knowledgeLib',
       icon: <ReadOutlined />,
-      label: 'DeepSeek知识库',
+      label: '知识库',
       onClick: () => {
         router.navigate( { pathname: '/deepseek/knowledgeLib' } )
       }
@@ -63,14 +63,14 @@ const Nav : React.FC<Props> = ( props : Props ) => {
     {
       key: '/deepseek/dataExport',
       icon: <FileSearchOutlined />,
-      label: 'DeepSeek数据导出',
+      label: '数据导出',
       onClick: () => {
         router.navigate( { pathname: '/deepseek/dataExport' } )
       }
     },
     {
       key: '/deepseek/audit',
-      icon: <StepForwardOutlined />,
+      icon: <CheckSquareOutlined />,
       label: '应用审核',
       onClick: () => {
         router.navigate( { pathname: '/deepseek/audit' } )

+ 65 - 59
src/pages/layout/style.less

@@ -17,27 +17,27 @@
     top: 0;
     left: 0;
     z-index: 1000;
-    
-    
+
+
     &-nav {
         display: flex;
         align-items: center;
         gap: 40px;
         margin-left: 40px;
-        
+
         &-item {
             color: #666;
             font-weight: 500;
             position: relative;
             transition: color 0.3s;
-            
+
             &:hover {
                 color: @primary-color;
             }
-            
+
             &.active {
                 color: @primary-color;
-                
+
                 &::after {
                     content: '';
                     position: absolute;
@@ -50,30 +50,30 @@
             }
         }
     }
-    
+
     &-logo {
         display: flex;
         align-items: center;
         cursor: pointer;
         margin-right: 40px;
-        
+
         &-picture {
             width: 30px;
             height: 30px;
             margin-right: 10px;
         }
-        
+
         &-text {
             font-size: 16px;
             font-weight: 500;
         }
     }
-    
+
     &-operation {
         display: flex;
         align-items: center;
         cursor: pointer;
-        
+
         &-picture {
             width: 30px;
             height: 30px;
@@ -85,13 +85,13 @@
             margin-right: 10px;
             color: #FFFFFF;
         }
-        
+
         &-name {
             font-weight: 500;
             color: @primary-color;
             margin-right: 10px;
         }
-        
+
         &-down {
             color: @primary-color !important;
         }
@@ -109,24 +109,29 @@
     left: 0;
     z-index: 999;
     
+    
     .ant-menu {
         background-color: transparent !important;
+        overflow-x: hidden;
+        overflow-y: auto;
+        
         &-item {
             transition: font-weight 0.2s ease;
-            &-selected {
-                font-weight: 600;
-                color: @primary-color;
+            
+            &-selected, &-active {
+                font-weight: 600 !important;
+                color: @primary-color !important;
             }
         }
     }
-    
+
     &-menu {
         width: 100%;
         height: calc(100vh - 100px);
         overflow-x: hidden;
         overflow-y: auto;
     }
-    
+
     &-bottom {
         width: 100%;
         height: 50px;
@@ -137,12 +142,11 @@
 }
 
 
-
 .main-content {
     height: calc(100vh - 48px);
     overflow: auto;  // 添加滚动条height: ;
     position: relative;
-    
+
     .breadcrumb {
         width: 100%;
         height: 50px;
@@ -159,7 +163,7 @@
                 }
             }
         }
-        
+
     }
 }
 
@@ -176,7 +180,7 @@
     height: 480px;
     display: flex;
     flex-direction: column;
-    
+
     .ant-card-cover {
         display: flex;
         justify-content: center;
@@ -184,26 +188,26 @@
         background: #f0f5ff;
         flex: 0 0 auto;
     }
-    
+
     .ant-card-body {
         display: flex;
         flex-direction: column;
         height: 100%;
         padding-bottom: 0;
     }
-    
+
     .logo-container {
         display: flex;
         justify-content: center;
         align-items: center;
         width: 100%;
     }
-    
+
     .option-icon {
         font-size: 64px;
         color: #1890ff;
     }
-    
+
     .ant-card-meta {
         text-align: center;
         margin-bottom: 0;
@@ -211,19 +215,19 @@
         display: flex;
         flex-direction: column;
         justify-content: center;
-        
+
         &-title {
             font-size: 18px;
             font-weight: 500;
             margin-bottom: 8px;
         }
-        
+
         &-description {
             color: #666;
             padding: 0 16px;
         }
     }
-    
+
     .select-button {
         margin: 24px 0;
         height: 48px;
@@ -231,40 +235,42 @@
         font-size: 16px;
         flex: 0 0 auto;
     }
-    
+
     &:hover {
         transform: translateY(-5px);
         box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08);
     }
 }
 
-.deepseek {
-    .ant-card-cover {
-        background: #f0f5ff;
-    }
-    
-    .option-icon {
-        color: #1890ff;
-    }
-    
-    .select-button {
-        background: #1890ff;
-        border-color: #1890ff;
-    }
-}
-
-.zhipu {
-    .ant-card-cover {
-        background: #f9f0ff;
-    }
-    
-    .option-icon {
-        color: #722ed1;
-    }
-    
-    .select-button {
-        background: #722ed1;
-        border-color: #722ed1;
-    }
-}
+//.deepseek {
+//    .ant-card-cover {
+//        background: #f0f5ff;
+//    }
+//
+//    .option-icon {
+//        color: #1890ff;
+//    }
+//
+//    .select-button {
+//        background: #1890ff;
+//        border-color: #1890ff;
+//    }
+//
+//}
+//
+//.zhipu {
+//    .ant-card-cover {
+//        background: #f9f0ff;
+//    }
+//
+//    .option-icon {
+//        color: #722ed1;
+//    }
+//
+//    .select-button {
+//        background: #722ed1;
+//        border-color: #722ed1;
+//    }
+//
+//}
 

+ 2 - 2
src/pages/questionAnswer/list/style.less

@@ -8,7 +8,7 @@
 
 .applicationList {
   width: 100%;
-  min-height: 640px;
+  min-height: 600px;
 }
 
 .card{
@@ -25,7 +25,7 @@
 
 .desc {
   height: 40px;
-  overflow: auto;
+  overflow: hidden;
   font-weight: 300; /* 细体字 */
   line-height: 20px;
   transition: all 0.3s;

+ 418 - 408
src/pages/takai/knowledgeLib/detail/index.tsx

@@ -2,7 +2,17 @@ import * as React from 'react';
 import { generatePath, useParams } from 'react-router-dom';
 import { observer } from 'mobx-react';
 
-import { Button, Table, TableColumnsType, Modal, TablePaginationConfig, Upload, UploadProps, message, Spin } from 'antd';
+import {
+  Button,
+  Table,
+  TableColumnsType,
+  Modal,
+  TablePaginationConfig,
+  Upload,
+  UploadProps,
+  message,
+  Spin
+} from 'antd';
 import { EditOutlined, DeleteOutlined, InboxOutlined, PlusOutlined, ArrowLeftOutlined } from '@ant-design/icons';
 import InfoModal from './components/InfoModal';
 import InfoModalSetting from './components/InfoModalSetting';
@@ -16,419 +26,419 @@ import './style.less';
 
 const { Dragger } = Upload;
 
-const KnowledgeLibInfo: React.FC = () => {
-
-    const {
-        state,
-        init,
-        onClickModify,
-        onClickDelete,
-        onChangePagination,
-        onClickDocumentDetail,
-        infoModalOnClickConfirm,
-        infoModalOnClickCancel,
-        infoModalSettingOnClickConfirm,
-        infoModalSettingOnClickCancel,
-        onClickSettings,
-        reset
-    } = store;
-    const {
-        knowledge_id,
-        listLoading,
-        page,
-        list,
-        infoModalOpen,
-        infoModalId,
-        infoModalSettingOpen,
-        infoModalSettingId,
-        knowledgeDetail,
-    } = state;
-
-    const [uploadLoading, setUploadLoading] = React.useState(false);
-
-    const params = useParams();
-
-    const [fileList, setFileList] = React.useState<any[]>([]);
-    const [uploading, setUploading] = React.useState(false);
-
-    const [sListFlag, setSListFlag] = React.useState<boolean>();
-    const [cUpdateFlag, setCUpdateFlag] = React.useState<boolean>();
-    const [detailFlag, setDetailFlag] = React.useState<boolean>();
-    const [deleteFlag, setDeleteFlag] = React.useState<boolean>();
-    const [createFlag, setCreateFlag] = React.useState<boolean>();
-
-    const props: UploadProps = {
-        name: 'files',
-        multiple: true,
-        action: '/api/deepseek/api/uploadDocument/' + params.knowledgeId,
-
-        beforeUpload(file, fileList) {
-            setUploadLoading(true);
-            // const allowedExtensions = ['md', 'txt', 'pdf', 'jpg', 'png', 'jpeg', 'docx', 'xlsx', 'pptx', 'eml', 'csv', 'tar', 'gz', 'bz2', 'zip', 'rar', 'jar'];
-
-            const allowedExtensions = ['txt', 'pdf', 'jpg', 'png', 'jpeg', 'doc', 'docx', 'ppt', 'pptx'];
-
-            // 检查文件类型
-            for (const file of fileList) {
-                const fileExt = file.name.split('.').pop()?.toLowerCase();
-                if (!fileExt || !allowedExtensions.includes(fileExt)) {
-                    message.error(`不支持 ${fileExt} 格式的文件上传`);
-                    setUploadLoading(false);
-                    return Upload.LIST_IGNORE;
-                }
-            }
-
-            // 检查文件大小
-            let totalSize = 0;
-            for (const file of fileList) {
-                const fileExt = file.name.split('.').pop()?.toLowerCase();
-                const fileSizeMB = file.size / 1024 / 1024;
-
-                if (fileSizeMB > 30) {
-                    message.error('单个文件不能大于30M');
-                    setUploadLoading(false);
-                    return Upload.LIST_IGNORE;
-                }
-
-                if (['jpg', 'png', 'jpeg'].includes(fileExt!) && fileSizeMB > 5) {
-                    message.error('单张图片不能大于5M');
-                    setUploadLoading(false);
-                    return Upload.LIST_IGNORE;
-                }
-
-                totalSize += fileSizeMB;
-            }
-
-            if (totalSize > 125) {
-                message.error('文件总大小超过125M');
-                setUploadLoading(false);
-                return Upload.LIST_IGNORE;
-            }
-
-        },
-        onChange(info) {
-            const { status } = info.file;
-
-            if (status !== 'uploading') {
-                console.log(status, 'status--uploading');
-            }
-            if (status === 'done') {
-                console.log(status, 'status--done');
-                console.info(info.file.response, 'info.file.response.data');
-                if (info.file.response.code === 200 && info.file.response.data === 1) {
-                    message.success(`${info.file.name} file uploaded successfully.`);
-                    init(params.knowledgeId);
-                }
-                setUploadLoading(false);
-            } else if (status === 'error') {
-                console.log(status, 'status--error');
-                message.error(`${info.file.name} file upload failed.`);
-                setUploadLoading(false);
-            }
-        },
-        onDrop(e) {
-            console.log('Dropped files', e.dataTransfer.files);
-        },
-    };
-
-    const handleUpload = async () => {
-        if (fileList.length === 0) return;
-
-        setUploading(true);
-        const formData = new FormData();
-
-        // 添加所有文件
-        fileList.forEach(file => {
-            if (file.originFileObj) {
-                formData.append('files', file.originFileObj);
-            }
-        });
-
-        try {
-            const res = await axios.post('/api/deepseek/api/uploadDocument/' + params.knowledgeId, formData, {
-                headers: { 'Content-Type': 'multipart/form-data' }
-            });
-
-            message.success(`${fileList.length}个文件上传成功`);
-            setFileList([]);
-        } catch (err) {
-            message.error('上传失败');
-        } finally {
-            setUploading(false);
+const KnowledgeLibInfo : React.FC = () => {
+  
+  const {
+    state,
+    init,
+    onClickModify,
+    onClickDelete,
+    onChangePagination,
+    onClickDocumentDetail,
+    infoModalOnClickConfirm,
+    infoModalOnClickCancel,
+    infoModalSettingOnClickConfirm,
+    infoModalSettingOnClickCancel,
+    onClickSettings,
+    reset
+  } = store;
+  const {
+    knowledge_id,
+    listLoading,
+    page,
+    list,
+    infoModalOpen,
+    infoModalId,
+    infoModalSettingOpen,
+    infoModalSettingId,
+    knowledgeDetail,
+  } = state;
+  
+  const [ uploadLoading, setUploadLoading ] = React.useState( false );
+  
+  const params = useParams();
+  
+  const [ fileList, setFileList ] = React.useState<any[]>( [] );
+  const [ uploading, setUploading ] = React.useState( false );
+  
+  const [ sListFlag, setSListFlag ] = React.useState<boolean>();
+  const [ cUpdateFlag, setCUpdateFlag ] = React.useState<boolean>();
+  const [ detailFlag, setDetailFlag ] = React.useState<boolean>();
+  const [ deleteFlag, setDeleteFlag ] = React.useState<boolean>();
+  const [ createFlag, setCreateFlag ] = React.useState<boolean>();
+  
+  const props : UploadProps = {
+    name: 'files',
+    multiple: true,
+    action: '/api/deepseek/api/uploadDocument/' + params.knowledgeId,
+    
+    beforeUpload( file, fileList ) {
+      setUploadLoading( true );
+      // const allowedExtensions = ['md', 'txt', 'pdf', 'jpg', 'png', 'jpeg', 'docx', 'xlsx', 'pptx', 'eml', 'csv', 'tar', 'gz', 'bz2', 'zip', 'rar', 'jar'];
+      
+      const allowedExtensions = [ 'txt', 'pdf', 'jpg', 'png', 'jpeg', 'doc', 'docx', 'ppt', 'pptx' ];
+      
+      // 检查文件类型
+      for ( const file of fileList ) {
+        const fileExt = file.name.split( '.' ).pop()?.toLowerCase();
+        if ( !fileExt || !allowedExtensions.includes( fileExt ) ) {
+          message.error( `不支持 ${ fileExt } 格式的文件上传` );
+          setUploadLoading( false );
+          return Upload.LIST_IGNORE;
         }
-    };
-
-    React.useEffect(() => {
-        init(params.knowledgeId);
-        const cList = LocalStorage.getStatusFlag('deepseek:slice:list');
-        setSListFlag(cList);
-        const cDetail = LocalStorage.getStatusFlag('deepseek:config:update');
-        setCUpdateFlag(cDetail);
-        const detail = LocalStorage.getStatusFlag('deepseek:document:detail');
-        setDetailFlag(detail);
-        const deleteF = LocalStorage.getStatusFlag('deepseek:document:delete');
-        setDeleteFlag(deleteF);
-        const createF = LocalStorage.getStatusFlag('deepseek:document:create');
-        setCreateFlag(createF);
-        return () => reset();
-    }, []);
-
-    const columns: TableColumnsType<Record> = [
-        {
-            title: '序号',
-            dataIndex: 'index',
-            width: 80,
-            render: (text, record, index) => {
-                return index + 1;
-            }
-        },
-        {
-            title: '文件名',
-            dataIndex: 'name',
-            width: 300,
-            render: (text, record) => {
-                return (
-                    `${text}`
-                )
-            }
-        },
-        {
-            title: '文件大小',
-            dataIndex: 'length',
-            width: 100,
-            render: (text) => {
-                if (text) {
-                    const size = (text / 1024 / 1024).toFixed(2);
-                    return `${size} M`;
-                } else {
-                    return '--'
-                }
-            }
-        },
-        {
-            title: '字符数量',
-            dataIndex: 'wordNum',
-            width: 100,
-            render: (text) => {
-                if (text) {
-                    return `${text}`;
-                } else {
-                    return '--'
-                }
-            }
-        },
-        {
-            title: '分段',
-            dataIndex: 'sliceTotal',
-            width: 100,
-            render: (text) => {
-                if (text) {
-                    return `${text}`;
-                } else {
-                    return '--';
-                }
-            }
-        },
-        {
-            title: '上传时间',
-            dataIndex: 'createTime',
-            width: 180,
-            render: (text) => {
-                if (text) {
-                    return dayjs(text).format('YYYY-MM-DD HH:mm:ss');
-                } else {
-                    return '--';
-                }
-            }
-        },
-        {
-            title: '更新时间',
-            dataIndex: 'updateTime',
-            width: 180,
-            render: (text) => {
-                if (text) {
-                    return dayjs(text).format('YYYY-MM-DD HH:mm:ss');
-                } else {
-                    return '--';
-                }
-            }
-        },
-        {
-            title: '操作',
-            dataIndex: 'operation',
-            width: 180,
-            fixed: 'right',
-            render: (text, record) => {
-                return (
-                    <>
-                        {createFlag &&
-                            <a
-                                style={{ marginRight: 16 }}
-                                onClick={() => {
-                                    const path = generatePath('/deepseek/knowledgeLib/:knowledgeId/slice/:documentId/:embeddingId', {
-                                        knowledgeId: params.knowledgeId as string,
-                                        documentId: record.documentId,
-                                        embeddingId: state.knowledgeDetail.embeddingId,
-                                    });
-                                    router.navigate({ pathname: path });
-                                }}
-                            >
-                                切片
-                            </a>
-                        }
-                        {
-                            cUpdateFlag &&
-                            <a
-                                style={{ marginRight: 16 }}
-                                onClick={() => {
-                                    onClickSettings(record.documentId);
-                                }}
-                            >
-                                配置
-                            </a>
-                        }
-                        {
-                            cUpdateFlag &&
-                            <a
-                                style={{ marginRight: 16 }}
-                                onClick={() => {
-                                    onClickModify(record.documentId);
-                                }}>
-                                <EditOutlined />
-                            </a>
-                        }
-                        {
-                            deleteFlag &&
-                            <a
-                                className='text-error'
-                                onClick={() => {
-                                    Modal.confirm({
-                                        title: '删除',
-                                        content: `确定删除知识文件:${record.name}吗?`,
-                                        okType: 'danger',
-                                        onOk: async () => {
-                                            const userInfo = LocalStorage.getUserInfo();
-                                            await onClickDelete(record.documentId);
-                                        }
-                                    });
-                                }}
-                            >
-                                <DeleteOutlined />
-                            </a>
-                        }
-                    </>
-                )
-            }
+      }
+      
+      // 检查文件大小
+      let totalSize = 0;
+      for ( const file of fileList ) {
+        const fileExt = file.name.split( '.' ).pop()?.toLowerCase();
+        const fileSizeMB = file.size / 1024 / 1024;
+        
+        if ( fileSizeMB > 30 ) {
+          message.error( '单个文件不能大于30M' );
+          setUploadLoading( false );
+          return Upload.LIST_IGNORE;
         }
-    ];
-
-    const paginationConfig: TablePaginationConfig = {
-        // 显示数据总量
-        showTotal: (total: number) => {
-            return `共 ${total} 条`;
-        },
-        // 展示分页条数切换
-        showSizeChanger: true,
-        // 指定每页显示条数
-        pageSizeOptions: ['10', '20', '50', '100'],
-        // 快速跳转至某页
-        showQuickJumper: true,
-        current: page.page,
-        pageSize: page.size,
-        total: page.total,
-        onChange: async (page, pageSize) => {
-            await onChangePagination(page, pageSize);
-        },
-    };
-
-    return (
-        <div className='knowledgeLibInfo'>
-            <Spin spinning={uploadLoading || listLoading}>
+        
+        if ( [ 'jpg', 'png', 'jpeg' ].includes( fileExt! ) && fileSizeMB > 5 ) {
+          message.error( '单张图片不能大于5M' );
+          setUploadLoading( false );
+          return Upload.LIST_IGNORE;
+        }
+        
+        totalSize += fileSizeMB;
+      }
+      
+      if ( totalSize > 125 ) {
+        message.error( '文件总大小超过125M' );
+        setUploadLoading( false );
+        return Upload.LIST_IGNORE;
+      }
+      
+    },
+    onChange( info ) {
+      const { status } = info.file;
+      
+      if ( status !== 'uploading' ) {
+        console.log( status, 'status--uploading' );
+      }
+      if ( status === 'done' ) {
+        console.log( status, 'status--done' );
+        console.info( info.file.response, 'info.file.response.data' );
+        if ( info.file.response.code === 200 && info.file.response.data === 1 ) {
+          message.success( `${ info.file.name } file uploaded successfully.` );
+          init( params.knowledgeId );
+        }
+        setUploadLoading( false );
+      } else if ( status === 'error' ) {
+        console.log( status, 'status--error' );
+        message.error( `${ info.file.name } file upload failed.` );
+        setUploadLoading( false );
+      }
+    },
+    onDrop( e ) {
+      console.log( 'Dropped files', e.dataTransfer.files );
+    },
+  };
+  
+  const handleUpload = async () => {
+    if ( fileList.length === 0 ) return;
+    
+    setUploading( true );
+    const formData = new FormData();
+    
+    // 添加所有文件
+    fileList.forEach( file => {
+      if ( file.originFileObj ) {
+        formData.append( 'files', file.originFileObj );
+      }
+    } );
+    
+    try {
+      const res = await axios.post( '/api/deepseek/api/uploadDocument/' + params.knowledgeId, formData, {
+        headers: { 'Content-Type': 'multipart/form-data' }
+      } );
+      
+      message.success( `${ fileList.length }个文件上传成功` );
+      setFileList( [] );
+    } catch ( err ) {
+      message.error( '上传失败' );
+    } finally {
+      setUploading( false );
+    }
+  };
+  
+  React.useEffect( () => {
+    init( params.knowledgeId );
+    const cList = LocalStorage.getStatusFlag( 'deepseek:slice:list' );
+    setSListFlag( cList );
+    const cDetail = LocalStorage.getStatusFlag( 'deepseek:config:update' );
+    setCUpdateFlag( cDetail );
+    const detail = LocalStorage.getStatusFlag( 'deepseek:document:detail' );
+    setDetailFlag( detail );
+    const deleteF = LocalStorage.getStatusFlag( 'deepseek:document:delete' );
+    setDeleteFlag( deleteF );
+    const createF = LocalStorage.getStatusFlag( 'deepseek:document:create' );
+    setCreateFlag( createF );
+    return () => reset();
+  }, [] );
+  
+  const columns : TableColumnsType<Record> = [
+    {
+      title: '序号',
+      dataIndex: 'index',
+      width: 80,
+      render: ( text, record, index ) => {
+        return index + 1;
+      }
+    },
+    {
+      title: '文件名',
+      dataIndex: 'name',
+      width: 300,
+      render: ( text, record ) => {
+        return (
+            `${ text }`
+        )
+      }
+    },
+    {
+      title: '文件大小',
+      dataIndex: 'length',
+      width: 100,
+      render: ( text ) => {
+        if ( text ) {
+          const size = ( text / 1024 / 1024 ).toFixed( 2 );
+          return `${ size } M`;
+        } else {
+          return '--'
+        }
+      }
+    },
+    {
+      title: '字符数量',
+      dataIndex: 'wordNum',
+      width: 100,
+      render: ( text ) => {
+        if ( text ) {
+          return `${ text }`;
+        } else {
+          return '--'
+        }
+      }
+    },
+    {
+      title: '分段',
+      dataIndex: 'sliceTotal',
+      width: 100,
+      render: ( text ) => {
+        if ( text ) {
+          return `${ text }`;
+        } else {
+          return '--';
+        }
+      }
+    },
+    {
+      title: '上传时间',
+      dataIndex: 'createTime',
+      width: 180,
+      render: ( text ) => {
+        if ( text ) {
+          return dayjs( text ).format( 'YYYY-MM-DD HH:mm:ss' );
+        } else {
+          return '--';
+        }
+      }
+    },
+    {
+      title: '更新时间',
+      dataIndex: 'updateTime',
+      width: 180,
+      render: ( text ) => {
+        if ( text ) {
+          return dayjs( text ).format( 'YYYY-MM-DD HH:mm:ss' );
+        } else {
+          return '--';
+        }
+      }
+    },
+    {
+      title: '操作',
+      dataIndex: 'operation',
+      width: 180,
+      fixed: 'right',
+      render: ( text, record ) => {
+        return (
+            <>
+              { createFlag &&
+                  <a
+                      style={ { marginRight: 16 } }
+                      onClick={ () => {
+                        const path = generatePath( '/deepseek/knowledgeLib/:knowledgeId/slice/:documentId/:embeddingId', {
+                          knowledgeId: params.knowledgeId as string,
+                          documentId: record.documentId,
+                          embeddingId: state.knowledgeDetail.embeddingId,
+                        } );
+                        router.navigate( { pathname: path } );
+                      } }
+                  >
+                    切片
+                  </a>
+              }
+              {
+                  cUpdateFlag &&
+                  <a
+                      style={ { marginRight: 16 } }
+                      onClick={ () => {
+                        onClickSettings( record.documentId );
+                      } }
+                  >
+                    配置
+                  </a>
+              }
+              {
+                  cUpdateFlag &&
+                  <a
+                      style={ { marginRight: 16 } }
+                      onClick={ () => {
+                        onClickModify( record.documentId );
+                      } }>
+                    <EditOutlined />
+                  </a>
+              }
+              {
+                  deleteFlag &&
+                  <a
+                      className='text-error'
+                      onClick={ () => {
+                        Modal.confirm( {
+                          title: '删除',
+                          content: `确定删除知识文件:${ record.name }吗?`,
+                          okType: 'danger',
+                          onOk: async () => {
+                            const userInfo = LocalStorage.getUserInfo();
+                            await onClickDelete( record.documentId );
+                          }
+                        } );
+                      } }
+                  >
+                    <DeleteOutlined />
+                  </a>
+              }
+            </>
+        )
+      }
+    }
+  ];
+  
+  const paginationConfig : TablePaginationConfig = {
+    // 显示数据总量
+    showTotal: ( total : number ) => {
+      return `共 ${ total } 条`;
+    },
+    // 展示分页条数切换
+    showSizeChanger: true,
+    // 指定每页显示条数
+    pageSizeOptions: [ '10', '20', '50', '100' ],
+    // 快速跳转至某页
+    showQuickJumper: true,
+    current: page.page,
+    pageSize: page.size,
+    total: page.total,
+    onChange: async ( page, pageSize ) => {
+      await onChangePagination( page, pageSize );
+    },
+  };
+  
+  return (
+      <div className='knowledgeLibInfo'>
+        <Spin spinning={ uploadLoading || listLoading }>
+          {
+              page.total === 0 &&
+              <div className='knowledgeLibInfo-operation'>
+                <div>
+                  <Button
+                      type='primary'
+                      icon={ <ArrowLeftOutlined /> }
+                      onClick={ () => {
+                        router.navigate( { pathname: '/deepseek/knowledgeLib' } );
+                      } }
+                  >
+                    返回
+                  </Button>
+                </div>
                 {
-                    page.total === 0 &&
-                    <div className='knowledgeLibInfo-operation'>
-                        <div>
-                            <Button
-                                type='primary'
-                                icon={<ArrowLeftOutlined />}
-                                onClick={() => {
-                                    router.navigate({ pathname: '/deepseek/knowledgeLib' });
-                                }}
-                            >
-                                返回
-                            </Button>
-                        </div>
-                        {
-                            createFlag &&
-                            <div style={{ marginTop: 20, width: '100%', height: '200px' }}>
-                                <Dragger {...props}>
-                                    <p className="ant-upload-drag-icon">
-                                        <InboxOutlined />
-                                    </p>
-                                    <p >
-                                        点击上传,或拖放文件到此处
-                                    </p >
-                                    <p className="ant-upload-hint">
-                                        支持文件格式md,txt,pdf,jpg,png,jpeg,docx,xlsx,
-                                        pptx,eml,csv,单个文档小雨30M,单张图片小于5M,文件总
-                                        大小不得超过125M.
-                                    </p>
-                                </Dragger>
-                            </div>
-                        }
+                    createFlag &&
+                    <div style={ { marginTop: 20, width: '100%', height: '200px' } }>
+                      <Dragger { ...props }>
+                        <p className="ant-upload-drag-icon">
+                          <InboxOutlined />
+                        </p>
+                        <p>
+                          点击上传,或拖放文件到此处
+                        </p>
+                        <p className="ant-upload-hint">
+                          支持文件格式md,txt,pdf,jpg,png,jpeg,docx,xlsx,
+                          pptx,eml,csv,单个文档 ≤ 30M,单张图片 ≤ 5M,文件总
+                          大小不得超过125M.
+                        </p>
+                      </Dragger>
                     </div>
                 }
+              </div>
+          }
+          {
+              page.total > 0 &&
+              <>
+                <div className='knowledgeLibInfo-operation'>
+                  <Button
+                      style={ { marginRight: 16 } }
+                      type='primary'
+                      icon={ <ArrowLeftOutlined /> } onClick={ () => {
+                    router.navigate( { pathname: '/deepseek/knowledgeLib' } );
+                  } }>
+                    返回
+                  </Button>
+                  {
+                      createFlag &&
+                      <Upload { ...props }>
+                        <Button type='primary' icon={ <PlusOutlined /> }>上传知识文件</Button>
+                      </Upload>
+                  }
+                </div>
+                <Table
+                    scroll={ { x: 'max-content' } }
+                    rowKey={ ( record ) => record.documentId }
+                    loading={ listLoading }
+                    columns={ columns }
+                    dataSource={ list }
+                    pagination={ paginationConfig }
+                />
                 {
-                    page.total > 0 &&
-                    <>
-                        <div className='knowledgeLibInfo-operation'>
-                            <Button
-                                style={{ marginRight: 16 }}
-                                type='primary'
-                                icon={<ArrowLeftOutlined />} onClick={() => {
-                                    router.navigate({ pathname: '/deepseek/knowledgeLib' });
-                                }}>
-                                返回
-                            </Button>
-                            {
-                                createFlag &&
-                                <Upload {...props}>
-                                    <Button type='primary' icon={<PlusOutlined />}>上传知识文件</Button>
-                                </Upload>
-                            }
-                        </div>
-                        <Table
-                            scroll={{ x: 'max-content' }}
-                            rowKey={(record) => record.documentId}
-                            loading={listLoading}
-                            columns={columns}
-                            dataSource={list}
-                            pagination={paginationConfig}
-                        />
-                        {
-                            infoModalOpen &&
-                            <InfoModal
-                                id={infoModalId}
-                                open={infoModalOpen}
-                                onClickConfirm={infoModalOnClickConfirm}
-                                onClickCancel={infoModalOnClickCancel}
-                            />
-                        }
-
-                        {
-                            infoModalSettingOpen &&
-                            <InfoModalSetting
-                                id={infoModalSettingId}
-                                open={infoModalSettingOpen}
-                                onClickConfirm={infoModalSettingOnClickConfirm}
-                                onClickCancel={infoModalSettingOnClickCancel}
-                            />
-                        }
-                    </>
+                    infoModalOpen &&
+                    <InfoModal
+                        id={ infoModalId }
+                        open={ infoModalOpen }
+                        onClickConfirm={ infoModalOnClickConfirm }
+                        onClickCancel={ infoModalOnClickCancel }
+                    />
+                }
+                
+                {
+                    infoModalSettingOpen &&
+                    <InfoModalSetting
+                        id={ infoModalSettingId }
+                        open={ infoModalSettingOpen }
+                        onClickConfirm={ infoModalSettingOnClickConfirm }
+                        onClickCancel={ infoModalSettingOnClickCancel }
+                    />
                 }
-            </Spin>
-        </div>
-    );
+              </>
+          }
+        </Spin>
+      </div>
+  );
 };
 
-export default observer(KnowledgeLibInfo);
+export default observer( KnowledgeLibInfo );

+ 140 - 89
src/pages/takai/questionAnswer/list/index.tsx

@@ -14,9 +14,19 @@ import {
   Tooltip,
   Select,
   Form,
-  Space
+  Space,
+  Row,
+  Col
 } from 'antd';
-import { PlusOutlined, FileOutlined, SettingOutlined, DeleteOutlined, StepForwardOutlined } from '@ant-design/icons';
+import {
+  PlusOutlined,
+  FileOutlined,
+  SettingOutlined,
+  DeleteOutlined,
+  StepForwardOutlined,
+  SearchOutlined,
+  ReloadOutlined
+} from '@ant-design/icons';
 import { apis } from '@/apis';
 import './style.less';
 import { PaginationConfig } from 'antd/es/pagination';
@@ -379,14 +389,24 @@ const QuestionAnswerList : React.FC = () => {
   
   return (
       <div>
-        <div>
-          <Form form={ form } layout='inline' colon={ false }>
-            <div style={ { display: 'flex', alignItems: 'center', position: 'relative' } }>
+        
+        <div style={ { padding: '16px 20px' , display: 'flex' } }>
+          <Form
+              form={ form }
+              layout='inline'
+              colon={ false }
+              style={{ flex: 1 }}
+          >
+            <div>
               {/* 主选择器 */ }
-              <FormItem label="应用类型" name="typeId" style={ { marginBottom: 0 } }>
+              <FormItem
+                  // label="应用类型"
+                  name="typeId"
+                  style={ { marginBottom: 0 } }
+              >
                 <Select
                     ref={ selectRef }
-                    style={ { width: 200 } }
+                    // style={ { width: 200 } }
                     placeholder="请选择应用类型"
                     onChange={ handleAppTypeChange }
                     value={ selectedType }
@@ -402,21 +422,7 @@ const QuestionAnswerList : React.FC = () => {
               
               {/* 子选项面板 */ }
               { showSubPanel && selectedType === 41 && (
-                  // <div
-                  //     style={{
-                  //         position: 'absolute',
-                  //         left: '68%',
-                  //         top: 35,
-                  //         marginLeft: 10,
-                  //         padding: 12,
-                  //         background: '#fff',
-                  //         border: '1px solid #d9d9d9',
-                  //         borderRadius: 4,
-                  //         boxShadow: '0 2px 8px rgba(0,0,0,0.15)',
-                  //         zIndex: 1000,
-                  //         width: 200
-                  //     }}
-                  // >
+                  
                   <FormItem
                       label='类型'
                       name='proTypeId'
@@ -425,7 +431,7 @@ const QuestionAnswerList : React.FC = () => {
                     <Select
                         placeholder='请选择'
                         allowClear
-                        style={ { width: 200 } }
+                        // style={ { width: 200 } }
                         // onChange={handleAppProTypeChange}
                     >
                       {
@@ -437,8 +443,6 @@ const QuestionAnswerList : React.FC = () => {
                       }
                     </Select>
                   </FormItem>
-                  
-                  // </div>
               ) }
             </div>
             
@@ -451,11 +455,11 @@ const QuestionAnswerList : React.FC = () => {
                         } */ }
             
             <FormItem
-                label='项目'
+                // label='项目'
                 name='projectId'
             >
               <Select
-                  style={ { width: '200px' } }
+                  // style={ { width: '200px' } }
                   placeholder='请选择项目'
                   allowClear
               >
@@ -471,56 +475,76 @@ const QuestionAnswerList : React.FC = () => {
             
             
             <FormItem>
-              <Button
-                  style={ { marginRight: 16 } }
-                  type='primary'
-                  onClick={ handleClickSearch }
-              >
-                查询
-              </Button>
-              <Button onClick={ handleClickReset }>
-                重置
-              </Button>
+              <Space size={ 12 }>
+                <Button
+                    // style={ { marginRight: 16 } }
+                    type='primary'
+                    onClick={ handleClickSearch }
+                    icon={ <SearchOutlined /> }
+                >
+                  查询
+                </Button>
+                <Button
+                    icon={ <ReloadOutlined /> }
+                    onClick={ handleClickReset }>
+                  重置
+                </Button>
+              </Space>
+            
             </FormItem>
+            
+            {
+                createFlag && (
+                    
+                    <div style={ { marginLeft: 'auto' } }>
+                      <Button type='primary'
+                              icon={ <PlusOutlined /> }
+                              onClick={ () => {
+                                router.navigate( { pathname: '/deepseek/questionAnswer/create' } );
+                              } }>创建问答应用</Button>
+                    </div>
+                )
+            }
+          
           </Form>
         </div>
         {
           list.length
               ?
               <div className='questionAnswerList'>
-                <div style={ { overflow: 'auto' } }>
-                  <Flex gap="middle" wrap>
-                    <Layout style={ layoutStyle }>
-                      <Sider width="25%" style={ siderStyle }>
-                        <FileOutlined />
-                      </Sider>
-                      <Layout>
-                        <Header style={ headerStyle }>问答应用总数</Header>
-                        <Content style={ contentStyle }>{ appCount }个</Content>
-                      </Layout>
-                    </Layout>
-                    <Layout style={ layoutStyle }>
-                      <Sider width="25%" style={ siderStyle }>
-                        <FileOutlined />
-                      </Sider>
-                      <Layout>
-                        <Header style={ headerStyle }>知识库总数</Header>
-                        <Content style={ contentStyle }>{ knowCount } 个</Content>
-                      </Layout>
-                    </Layout>
-                  </Flex>
-                </div>
-                <div style={ { display: 'flex', justifyContent: 'space-between', padding: '16px 20px' } }>
-                  <div>所有问答应用</div>
-                  {
-                      createFlag &&
-                      <Button type='primary'
-                              icon={ <PlusOutlined /> }
-                              onClick={ () => {
-                                router.navigate( { pathname: '/deepseek/questionAnswer/create' } );
-                              } }>创建问答应用</Button>
-                  }
-                </div>
+                {/*<div style={ { overflow: 'auto' } }>*/ }
+                {/*  <Flex gap="middle" wrap>*/ }
+                {/*    <Layout style={ layoutStyle }>*/ }
+                {/*      <Sider width="25%" style={ siderStyle }>*/ }
+                {/*        <FileOutlined />*/ }
+                {/*      </Sider>*/ }
+                {/*      <Layout>*/ }
+                {/*        <Header style={ headerStyle }>问答应用总数</Header>*/ }
+                {/*        <Content style={ contentStyle }>{ appCount }个</Content>*/ }
+                {/*      </Layout>*/ }
+                {/*    </Layout>*/ }
+                {/*    <Layout style={ layoutStyle }>*/ }
+                {/*      <Sider width="25%" style={ siderStyle }>*/ }
+                {/*        <FileOutlined />*/ }
+                {/*      </Sider>*/ }
+                {/*      <Layout>*/ }
+                {/*        <Header style={ headerStyle }>知识库总数</Header>*/ }
+                {/*        <Content style={ contentStyle }>{ knowCount } 个</Content>*/ }
+                {/*      </Layout>*/ }
+                {/*    </Layout>*/ }
+                {/*  </Flex>*/ }
+                {/*</div>*/ }
+                {/*<div style={ { display: 'flex', justifyContent: 'space-between', padding: '16px 20px' } }>*/ }
+                {/*  <div>所有问答应用</div>*/ }
+                {/*  /!*{*!/*/ }
+                {/*  /!*    createFlag &&*!/*/ }
+                {/*  /!*    <Button type='primary'*!/*/ }
+                {/*  /!*            icon={ <PlusOutlined /> }*!/*/ }
+                {/*  /!*            onClick={ () => {*!/*/ }
+                {/*  /!*              router.navigate( { pathname: '/deepseek/questionAnswer/create' } );*!/*/ }
+                {/*  /!*            } }>创建问答应用</Button>*!/*/ }
+                {/*  /!*}*!/*/ }
+                {/*</div>*/ }
                 <div className='applicationList'>
                   <List grid={ {
                     gutter: 16,
@@ -549,9 +573,9 @@ const QuestionAnswerList : React.FC = () => {
                                           src={ IconSvg }
                                       />
                                     </div>
-                                    {/*<div style={ { overflow: 'auto' } }>*/}
-                                    {/*  { item.name }*/}
-                                    {/*</div>*/}
+                                    {/*<div style={ { overflow: 'auto' } }>*/ }
+                                    {/*  { item.name }*/ }
+                                    {/*</div>*/ }
                                     
                                     <div style={ {
                                       display: 'flex',
@@ -572,21 +596,27 @@ const QuestionAnswerList : React.FC = () => {
                                           margin: 0
                                         } }>ID:{ item.appId }</span>
                                         <Divider type="vertical" style={ { color: '999', margin: 0, height: 12 } } />
-                                        {/*<span style={ { color: '#999', fontSize: 12 } }>创建者  { item.createBy }</span>*/ }
+                                        <span style={ { color: '#999', fontSize: 12 } }>
+                                          {
+                                            item.projectName && item.projectName.length > 8 ?
+                                                `${item.projectName.substring(0, 8)}...` :
+                                                item.projectName
+                                          }
+                                        </span>
                                       </Space>
                                     </div>
-                                    
+                                  
                                   </div>
                                   <div>
                                     <>
-                                      { item.projectName }
+                                      {/*{ item.projectName } 移动599 line*/}
                                       {
                                           ( item.status !== null && item.status !== '3' ) &&
                                           < Tag style={ {
-                                            marginLeft: 16,
+                                            // marginLeft: 16,
                                             width: 65,
                                             color: '#fff',
-                                            height: 25,
+                                            height: 24,
                                             backgroundColor: item.status === '1' ? '#D26900' : item.status === '2' ? '#408080' : item.auditStatus === '4' ? '#CE0000' : item.status === '5' ? '#5151A2' : ''
                                           } }>
                                             { item.status === '1' ? '待审核' : item.status === '2' ? '审核中' : item.auditStatus === '4' ? '审核拒绝' : item.status === '5' ? '待提交' : '未知' }
@@ -606,20 +636,40 @@ const QuestionAnswerList : React.FC = () => {
                                     </>
                                   </div>
                                 </div>
-                                <Divider plain></Divider>
+                                <Divider plain style={{ margin: '16px 0'}}></Divider>
                                 <div className='desc'>
                                   {
-                                    item.desc !== '' && item.desc !== null && item.desc.length > 35 ? item.desc.substring( 0, 35 ) + '......' : item.desc
+                                    item.desc !== '' && item.desc !== null && item.desc.length > 40 ? item.desc.substring( 0, 40 ) + '......' : item.desc
                                   }
                                 </div>
-                                <div style={ { display: 'flex', justifyContent: 'space-between', overflow: 'auto' } }>
+                                <div style={ {
+                                  display: 'flex',
+                                  justifyContent: 'space-between',
+                                  alignItems: 'center'
+                                }}>
+                                  <span style={ {
+                                    color: '#999',
+                                    fontSize: 12,
+                                    margin: 0
+                                  } }>创建时间: { item.createItme }</span>
+                                </div>
+                                <div style={ {
+                                  display: 'flex',
+                                  justifyContent: 'space-between',
+                                  alignItems: 'flex-end',
+                                  overflow: 'auto',
+                                  // paddingTop: 16,
+                                  // height: '100%'
+                                } }>
                                   <div style={ { overflow: 'auto' } }>
                                     {
                                         ( item.status === '5' || item.status === '4' || item.status === '3' || item.status === '' || item.status === null ) &&
                                         <>
                                           {
                                               updateFlag &&
-                                              <a style={ { marginRight: 16 } } onClick={ () => {
+                                              <a
+                                                  style={ { marginRight: 16 } }
+                                                  onClick={ () => {
                                                 router.navigate( { pathname: '/deepseek/questionAnswer/modify' }, { state: { id: item.appId } } );
                                               } }>
                                                 <SettingOutlined /> 编辑
@@ -631,7 +681,7 @@ const QuestionAnswerList : React.FC = () => {
                                               <a className='text-error' onClick={ () => {
                                                 Modal.confirm( {
                                                   title: '删除',
-                                                  content: `确定删除应用名称: ` + item.name + ` 吗?`,
+                                                  content: `确定删除应用: ` + item.name + ` 吗?`,
                                                   okType: 'danger',
                                                   onOk: async () => {
                                                     await delApplication( item.appId.toString() );
@@ -650,7 +700,7 @@ const QuestionAnswerList : React.FC = () => {
                                         <a style={ { marginLeft: 16 } } onClick={ () => {
                                           Modal.confirm( {
                                             title: '提交审核',
-                                            content: `确认提交审核应用名称: ` + item.name + `吗?`,
+                                            content: `确认提交审核应用: ` + item.name + `吗?`,
                                             okType: 'danger',
                                             onOk: async () => {
                                               const userInfo = LocalStorage.getUserInfo();
@@ -667,11 +717,12 @@ const QuestionAnswerList : React.FC = () => {
                                   <div>
                                     <Tag
                                         style={ {
-                                          padding: '4px 8px',
-                                          fontSize: 14,
-                                          fontWeight: 'bold',
-                                          background: '#f0f0f0',
-                                          border: '1px solid #d9d9d9'
+                                          // padding: '4px 8px',
+                                          marginRight: 0,
+                                          fontSize: 12,
+                                          fontWeight: 600,
+                                          background: '#f8f8f8',
+                                          // border: '1px solid #d9d9d9'
                                         } }
                                     >
                                       {

+ 26 - 5
src/pages/takai/questionAnswer/list/style.less

@@ -8,7 +8,7 @@
 
 .applicationList {
   width: 100%;
-  height: 640px;
+  min-height: 600px;
   //padding-top: 10px;
 }
 
@@ -25,15 +25,36 @@
 }
 
 .desc {
-  height: 40px;
-  overflow: auto;
+  height: 56px;
+  overflow: hidden;
   font-weight: 300; /* 细体字 */
   line-height: 20px;
   transition: all 0.3s;
-  margin-bottom: 16px;
+  //margin-bottom: 16px;
 }
 
 .info-head {
   width: 100%;
   height: 35%;
-}
+}
+
+.ant-select-selector {
+  border-radius: 4px !important;
+  background: #fff !important;
+  height: 32px !important;
+  
+  //.ant-select-selection-item {
+  //  //margin-right: 8px !important;
+  //}
+}
+
+.ant-select-dropdown {
+  .ant-select-item-option-selected {
+    background-color: @primary-color !important;
+    color: #fff !important;
+  }
+  
+  .ant-select-item-option-active {
+    background-color: rgba(0, 123, 255, 0.1);
+  }
+}

+ 1 - 1
src/style/global.less

@@ -90,4 +90,4 @@ ul li {
 
 .ant-form-item {
     margin-bottom: 16px !important;
-}
+}