Browse Source

单文档

yinbangzhong 2 năm trước cách đây
mục cha
commit
1c180d70f0

+ 6 - 6
config/vite.config.dev.ts

@@ -14,8 +14,8 @@ export default mergeConfig(
       proxy: {
       proxy: {
         '/base': {
         '/base': {
           // target: 'http://aiotlink.com:8189',
           // target: 'http://aiotlink.com:8189',
-          target: 'http://192.168.20.116:8089',
-          // target: 'http://192.168.20.158:8089',
+          //target: 'http://192.168.20.116:8089',
+          target: 'http://192.168.20.158:8089',
           changeOrigin: true,
           changeOrigin: true,
           ws: true,
           ws: true,
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
@@ -24,16 +24,16 @@ export default mergeConfig(
         },
         },
         '/api': {
         '/api': {
           // target: 'http://aiotlink.com:8189',
           // target: 'http://aiotlink.com:8189',
-          target: 'http://192.168.20.116:8089',
-          // target: 'http://192.168.20.158:8089',
+          //target: 'http://192.168.20.116:8089',
+          target: 'http://192.168.20.158:8089',
           changeOrigin: true,
           changeOrigin: true,
           ws: true,
           ws: true,
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
         },
         },
         '/api/v1': {
         '/api/v1': {
           // target: 'http://aiotlink.com:8189',
           // target: 'http://aiotlink.com:8189',
-          target: 'http://192.168.20.116:8089',
-          // target: 'http://192.168.20.158:8089',
+          //target: 'http://192.168.20.116:8089',
+          target: 'http://192.168.20.158:8089',
           changeOrigin: true,
           changeOrigin: true,
           ws: true,
           ws: true,
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),

+ 0 - 7
package.json

@@ -26,20 +26,14 @@
   },
   },
   "dependencies": {
   "dependencies": {
     "@arco-design/web-vue": "^2.44.7",
     "@arco-design/web-vue": "^2.44.7",
-    "@codemirror/lang-javascript": "^6.2.2",
-    "@codemirror/theme-one-dark": "^6.1.2",
-    "@codemirror/view": "^6.33.0",
     "@microsoft/fetch-event-source": "^2.0.1",
     "@microsoft/fetch-event-source": "^2.0.1",
     "@vue-office/docx": "^1.6.2",
     "@vue-office/docx": "^1.6.2",
     "@vue-office/excel": "^1.7.11",
     "@vue-office/excel": "^1.7.11",
     "@vueuse/core": "^9.3.0",
     "@vueuse/core": "^9.3.0",
     "arco-design-pro-vue": "^2.7.3",
     "arco-design-pro-vue": "^2.7.3",
     "axios": "^0.24.0",
     "axios": "^0.24.0",
-    "codemirror": "^5.65.17",
-    "codemirror-editor-vue3": "^2.7.0",
     "d3": "^4.12.0",
     "d3": "^4.12.0",
     "dayjs": "^1.11.5",
     "dayjs": "^1.11.5",
-    "dimple": "github:PMSI-AlignAlytics/dimple#2.3.0",
     "docx-preview": "^0.1.8",
     "docx-preview": "^0.1.8",
     "echarts": "^5.4.0",
     "echarts": "^5.4.0",
     "eventsource-parser": "^2.0.1",
     "eventsource-parser": "^2.0.1",
@@ -64,7 +58,6 @@
     "v-viewer": "^3.0.11",
     "v-viewer": "^3.0.11",
     "vue": "^3.2.40",
     "vue": "^3.2.40",
     "vue-clipboard3": "^2.0.0",
     "vue-clipboard3": "^2.0.0",
-    "vue-codemirror": "^6.1.1",
     "vue-echarts": "^6.2.3",
     "vue-echarts": "^6.2.3",
     "vue-i18n": "^9.2.2",
     "vue-i18n": "^9.2.2",
     "vue-router": "^4.0.14"
     "vue-router": "^4.0.14"

+ 18 - 0
src/api/session.ts

@@ -63,6 +63,24 @@ export function uploadWithoutKb(params) {
   return axios.post('/api/v1/document/upload_without_kb', params, config);
   return axios.post('/api/v1/document/upload_without_kb', params, config);
 }
 }
 
 
+
+export function upload_and_parse(params) {
+  const config = {
+    headers: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+      // token: token,
+    },
+  };
+  return axios.post('/api/v1/document/upload_and_parse', params, config);
+}
+
+
+export function getDocumentStatus(doc_ids) {
+  let params = { "doc_ids": doc_ids };
+  return axios.post("/api/v1/document/infos", params);
+}
+
+
 // 获取解析方法列表
 // 获取解析方法列表
 export function getParseMethodsListApi() {
 export function getParseMethodsListApi() {
   return axios.get<ISessionListResult>('/api/v1/user/parse-methods');
   return axios.get<ISessionListResult>('/api/v1/user/parse-methods');

+ 2 - 2
src/router/index.ts

@@ -9,8 +9,8 @@ import createRouteGuard from './guard';
 NProgress.configure({ showSpinner: false }); // NProgress Configuration
 NProgress.configure({ showSpinner: false }); // NProgress Configuration
 
 
 const router = createRouter({
 const router = createRouter({
-  history: createWebHistory(),
-  // history: createWebHashHistory(),
+  //history: createWebHistory(),
+  history: createWebHashHistory(),
   routes: [
   routes: [
     {
     {
       path: '/',
       path: '/',

+ 53 - 51
src/views/sessionManager/components/updataFile.vue

@@ -26,47 +26,47 @@
         style="
         style="
           width: 100%;
           width: 100%;
           margin-top: 10px;
           margin-top: 10px;
-          display: flex;
           justify-content: space-between;
           justify-content: space-between;
+          text-align: right;
         "
         "
         class="upload-wrap"
         class="upload-wrap"
       >
       >
-        <div>
-          <span>解析方法: </span>
-          <a-radio-group
-            v-model="parser_id"
-            style="width: 400px"
-            @change="parserChange"
-          >
-            <a-popover v-for="item in filterData" :key="item.value">
-              <a-radio :value="item.value" style="margin-right: 10px">{{
-                item.name
-              }}</a-radio>
+<!--        <div>-->
+<!--          <span>解析方法: </span>-->
+<!--          <a-radio-group-->
+<!--            v-model="parser_id"-->
+<!--            style="width: 400px"-->
+<!--            @change="parserChange"-->
+<!--          >-->
+<!--            <a-popover v-for="item in filterData" :key="item.value">-->
+<!--              <a-radio :value="item.value" style="margin-right: 10px">{{-->
+<!--                item.name-->
+<!--              }}</a-radio>-->
 
 
-              <template #content>
-                <p>{{ item.parser_config_str }}</p>
-              </template>
-            </a-popover>
-          </a-radio-group>
-        </div>
-        <a-select
-          :style="{ width: '100px', margin: '0 10px' }"
-          :default-value="['通用', '多模态']"
-          v-model="parser_configs"
-          multiple
-          size="small"
-        >
-          <a-option v-for="item in parser_ids" :key="item.value">{{
-            item.name
-          }}</a-option>
-        </a-select>
-        <p class="config-text">更多配置</p>
+<!--              <template #content>-->
+<!--                <p>{{ item.parser_config_str }}</p>-->
+<!--              </template>-->
+<!--            </a-popover>-->
+<!--          </a-radio-group>-->
+<!--        </div>-->
+<!--        <a-select-->
+<!--          :style="{ width: '100px', margin: '0 10px' }"-->
+<!--          :default-value="['通用', '多模态']"-->
+<!--          v-model="parser_configs"-->
+<!--          multiple-->
+<!--          size="small"-->
+<!--        >-->
+<!--          <a-option v-for="item in parser_ids" :key="item.value">{{-->
+<!--            item.name-->
+<!--          }}</a-option>-->
+<!--        </a-select>-->
+<!--        <p class="config-text">更多配置</p>-->
         <a-button
         <a-button
           :loading="onFileSelectedLoading"
           :loading="onFileSelectedLoading"
           @click="upDataFile"
           @click="upDataFile"
           type="primary"
           type="primary"
           size="mini"
           size="mini"
-          style="border-radius: 24px"
+          style="border-radius: 24px;"
         >
         >
           <span style="font-size: 12px"> 上传 </span>
           <span style="font-size: 12px"> 上传 </span>
         </a-button>
         </a-button>
@@ -91,8 +91,8 @@
     getParseMethodsListApi,
     getParseMethodsListApi,
     getSessionDetailsApi,
     getSessionDetailsApi,
     uploadWithoutKb,
     uploadWithoutKb,
-    uploadAndParse,
-  } from '@/api/session';
+    uploadAndParse, upload_and_parse, getDocumentStatus
+  } from "@/api/session";
 
 
   const visible = ref(false);
   const visible = ref(false);
   const loading = ref(false);
   const loading = ref(false);
@@ -288,7 +288,7 @@
     });
     });
     return type;
     return type;
   };
   };
-
+  let status_timer;
   const upDataFile = async () => {
   const upDataFile = async () => {
     if (!activeSessionId.value) {
     if (!activeSessionId.value) {
       //新建会话
       //新建会话
@@ -337,31 +337,33 @@
       }
       }
     }
     }
     console.log(formData, 'formData');
     console.log(formData, 'formData');
-    // uploadAndParse(formData).then((res) => {
-    //   debugger;
-    //   onFileSelectedLoading.value = false;
-    //   if (res.code == 200) {
-    //     cancel();
-    //     // uploaditemList.value = [];
-    //     emit('selectFileCallback', uploaditemList.value);
-    //     Message.success('上传成功');
-    //   } else {
-    //     Message.error('上传失败');
-    //   }
-    // });
-    uploadWithoutKb(formData).then((res) => {
+    upload_and_parse(formData).then((res) => {
       onFileSelectedLoading.value = false;
       onFileSelectedLoading.value = false;
-      if (res.code == 200) {
+      if (res.code == 0) {
+        //上传成功
+        Message.success("上传成功");
         cancel();
         cancel();
-        // uploaditemList.value = [];
-        emit('selectFileCallback', uploaditemList.value);
-        Message.success('上传成功');
+        emit("selectFileCallback", uploaditemList.value,activeSessionId.value);
       } else {
       } else {
         Message.error('上传失败');
         Message.error('上传失败');
       }
       }
     });
     });
   };
   };
 
 
+
+  const checkStatus = async (doc_ids) => {
+    let res = await getDocumentStatus(doc_ids);
+    if (res.code == 200 && res.data.status == "success") {
+      //上传成功
+      Message.success("上传成功");
+      cancel();
+      emit("selectFileCallback", uploaditemList.value);
+      if (status_timer) {
+        clearTimeout(status_timer!);
+      }
+    }
+  };
+
   const cancel = () => {
   const cancel = () => {
     if (!onFileSelectedLoading.value) {
     if (!onFileSelectedLoading.value) {
       visible.value = false;
       visible.value = false;

+ 2 - 1
src/views/sessionManager/index.vue

@@ -773,8 +773,9 @@
     // formRef.value.resetFields();
     // formRef.value.resetFields();
   };
   };
 
 
-  const selectFileCallback = (data) => {
+  const selectFileCallback = (data,conversation_id) => {
     uploaditemList.value = [...uploaditemList.value, ...data];
     uploaditemList.value = [...uploaditemList.value, ...data];
+    activeSessionId.value = conversation_id;
   };
   };
 
 
   //上传
   //上传

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 337 - 209
yarn.lock


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác