liuQiang před 2 roky
rodič
revize
d24800ac1c

+ 7 - 5
src/components/IdentifyFont/IdentifyFont.vue

@@ -9,7 +9,7 @@
             v-if="!showImg"
             class="avatar-uploader"
             :drag="true"
-            action="http://192.168.1.28:8080/api/upload"
+            :action="actionUrl"
             :show-file-list="false"
             :on-success="handleAvatarSuccess"
             :before-upload="beforeUp"
@@ -24,7 +24,7 @@
         <div class="sunmit_btn">
           <el-upload
             class="avatar-uploader"
-            action="http://192.168.1.28:8080/api/upload"
+            :action="actionUrl"
             :show-file-list="false"
             :on-success="handleAvatarSuccess"
             :before-upload="beforeUp"
@@ -38,7 +38,7 @@
           <el-upload
             disabled
             class="avatar-uploader"
-            action="http://192.168.1.28:8080/api/upload"
+            :action="actionUrl"
             :show-file-list="false"
             :on-success="handleAvatarSuccess"
           >
@@ -120,6 +120,7 @@ const isOpen = ref(props.openFile);
 const thisStep = ref("start"); //解析进度 start,loading,end,
 const openFile = ref(false); //控制tree显示
 const treeData = ref(); //树节点数据
+const actionUrl = ref(`${import.meta.env.VITE_APP_BASE_API}/upload`)
 
 const props = defineProps({
   openFile: {
@@ -136,12 +137,13 @@ watch(
 );
 onMounted(async () => {
   let route = useRoute();
+  let docId = route.query.docId;
   let fileId = route.query.fileId;
   let fileType = route.query.fileType;
   console.log("fileId", fileId);
   console.log("fileType", fileType);
   if (fileType === ".png" || fileType === ".jpg") {
-    const imgRes = await preview(fileId);
+    const imgRes = await preview(docId);
     thisStep.value = "loading";
     showImg.value = URL.createObjectURL(imgRes);
     const res = await ocrRemark(fileId);
@@ -204,7 +206,7 @@ const addlibraryImg = async () => {
 const fileChangeMsg = async (val) => {
   console.log("val", toRaw(val));
   const data = toRaw(val);
-  const imgRes = await preview(data.remark);
+  const imgRes = await preview(data.id);
   thisStep.value = "loading";
   showImg.value = URL.createObjectURL(imgRes);
   const res = await ocrRemark(data.remark);

+ 1 - 1
src/layout/indexCommon.vue

@@ -131,7 +131,7 @@
             </el-tabs>
           </div>
           <router-view v-slot="{ Component }" v-if="isAlive">
-            <KeepAlive :exclude="'fileEdit'">
+            <KeepAlive :exclude="['fileEdit','identifyFont']">
               <component :is="Component" />
             </KeepAlive>
           </router-view>

+ 1 - 1
src/router/index.js

@@ -175,7 +175,7 @@ export const constantRoutes = [{
 			},{
 				path: "/identifyFont",
 				component: () => import("@/components/IdentifyFont/IdentifyFont.vue"),
-				name: "iodentifyFont",
+				name: "identifyFont",
 				meta: {
 					title: "图文识别",
 					icon: "department"

+ 8 - 1
src/views/myfile/MyFile.vue

@@ -904,7 +904,8 @@ export default {
                 router.push({
                     path: '/identifyFont',
                     query: {
-                        fileId: copyFileId.value,
+                        docId: copyRow.value.docId,
+                        fileId: copyRow.value.fileId,
                         fileType: copyFileType.value
                     }
                 })
@@ -915,6 +916,12 @@ export default {
                 if (filePreview) {
                      loadingPreview.value = false
                     addTab(clickRow.value);
+                    //    const addData = {
+                    //     path:route.path,
+                    //     name:clickRow.fileName,
+                    //     row:toRaw(clickRow)
+                    // }
+                    // addFolderAdd(addData)
                     onlyView.value = true
                     // editOnline.value = false
                     cliCC.value = false