Browse Source

loading,timeout修改

S0025136190 7 months ago
parent
commit
df842bccf0

+ 1 - 1
src/apis/api.ts

@@ -7,7 +7,7 @@ import router from '@/router';
 // 创建axios实例
 const axiosInstance = axios.create({
     baseURL: config.baseURL,
-    timeout: 30000,// 请求超时30秒
+    timeout: 600000 * 2,// 请求超时20分钟
 });
 
 // 请求拦截器

+ 5 - 4
src/pages/takai/knowledgeLib/detail/components/InfoModalSetting.tsx

@@ -18,7 +18,7 @@ const InfoModalSetting: React.FC<Props> = (props: Props) => {
         id,
         open,
         onClickConfirm,
-        onClickCancel
+        onClickCancel,
     } = props;
 
     const [form] = Form.useForm();
@@ -80,11 +80,11 @@ const InfoModalSetting: React.FC<Props> = (props: Props) => {
     const handleClickConfirm = () => {
         form.validateFields().then(async (values) => {
             const data = { ...values };
-            console.log(data, 'data');
+            console.log(loading, 'loading');
             await onClickConfirm(props.id, data);
         }).catch((error) => {
             console.error(error);
-        });
+        })
     };
 
     return (
@@ -97,6 +97,7 @@ const InfoModalSetting: React.FC<Props> = (props: Props) => {
             open={open}
             onOk={handleClickConfirm}
             onCancel={onClickCancel}
+            confirmLoading={loading}
         >
             <Spin spinning={loading}>
                 <Form form={form} layout='vertical'>
@@ -113,7 +114,7 @@ const InfoModalSetting: React.FC<Props> = (props: Props) => {
                         >
                             <Option value='0'>按标题段落切片</Option>
                             <Option value='1'>按页切片</Option>
-                            <Option value='2'>按问答对切片</Option>
+                            {/* <Option value='2'>按问答对切片</Option> */}
                             <Option value='3'>自定义切片</Option>
                         </Select>
                     </FormItem>

+ 4 - 1
src/pages/takai/knowledgeLib/detail/store.ts

@@ -21,7 +21,7 @@ const stateGenerator = (): ReadonlyState => ({
         knowledgeId: '',
         embeddingId: '',
         name: '',
-    },
+    }
 });
 
 // 修改状态
@@ -110,6 +110,7 @@ const useKnowledgeLibInfoStore = (): DocumentLibInfoStore => {
         // 修改知识配置
         modifyDocumentSettingLib: async (id: string, data: ModifyDocumentSettingApiParams) => {
             try {
+                actions.setListLoading(true);
                 const res = await apis.modifyTakaiDocumentSettingLibApi(id, data);
                 if (res.data === 1) {
                     // 获取知识列表
@@ -120,6 +121,8 @@ const useKnowledgeLibInfoStore = (): DocumentLibInfoStore => {
                 }
             } catch (error: any) {
                 message.error(error.msg);
+            } finally {
+                actions.setListLoading(false);
             }
         },
 

+ 1 - 1
src/pages/takai/knowledgeLib/slice/index.tsx

@@ -159,7 +159,7 @@ const SliceList: React.FC = () => {
                                     md: 4,
                                     lg: 4,
                                     xl: 6,
-                                    xxl: 3, // 展示的列数
+                                    xxl: 2, // 展示的列数
                                 }}
                                 dataSource={list}
                                 renderItem={(item) => (