Browse Source

文字识别

liuQiang 1 year ago
parent
commit
2c9ed02097

+ 8 - 3
src/components/IdentifyFont/IdentifyFont.vue

@@ -154,6 +154,8 @@ onMounted(async () => {
   // console.log('textData.value',textData.value);
   const cTextData = sessionStorage.getItem('textData')
   const imgStr = sessionStorage.getItem('showImg')
+  const ocrJSONData = sessionStorage.getItem('ocrData')
+  const ocrData = ocrJSONData?JSON.parse(ocrJSONData):''
   const cImg = imgStr?JSON.parse(imgStr):''
   // console.log('cTextData',cTextData);
   // console.log('cImg',cImg);
@@ -166,9 +168,12 @@ onMounted(async () => {
     return
   }
   let route = useRoute();
-  let docId = route.query.docId;
-  let fileId = route.query.fileId;
-  let fileType = route.query.fileType;
+  // let docId = route.query.docId;
+  // let fileId = route.query.fileId;
+  // let fileType = route.query.fileType;
+   let docId = ocrData.docId;
+  let fileId = ocrData.fileId;
+  let fileType = ocrData.fileType;
   const JparData = history.state.clickRowId;
   const parData =JparData? JSON.parse(JparData):'';
   // console.log("parData", parData);

+ 8 - 7
src/views/department/MyFile.vue

@@ -1289,16 +1289,17 @@ export default {
             if (row.name === '文字识别') {
                 const itemData = {
                         name: '文字识别',
-                        path: 'identifyFont',
-                        clickRowId: {
-                            docId: copyRow.value.docId,
-                            fileId: copyRow.value.fileId,
-                            fileType: copyFileType.value
-                        }
+                        path: `/identifyFont`
+                    }
+                    const ocrData = {
+                        docId: copyRow.value.docId,
+                        fileId: copyRow.value.fileId,
+                        fileType: copyFileType.value
                     }
+                    window.parent.$setOpenTab(itemData)
+                    sessionStorage.setItem('ocrData',JSON.stringify(ocrData))
                     sessionStorage.setItem('textData','')
                     sessionStorage.setItem('showImg','')
-                    addFolderAdd(itemData)
             }
             if (row.name === '打开') {
                 loadingPreview.value = true

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

@@ -1393,18 +1393,29 @@ export default {
                 collects.value = true
             }
             if (row.name === '文字识别') {
-                 const itemData = {
+                //  const itemData = {
+                //         name: '文字识别',
+                //         path: 'identifyFont',
+                //         clickRowId: {
+                //             docId: copyRow.value.docId,
+                //             fileId: copyRow.value.fileId,
+                //             fileType: copyFileType.value
+                //         }
+                //     }
+                    const itemData = {
                         name: '文字识别',
-                        path: 'identifyFont',
-                        clickRowId: {
-                            docId: copyRow.value.docId,
-                            fileId: copyRow.value.fileId,
-                            fileType: copyFileType.value
-                        }
+                        path: `/identifyFont`
+                    }
+                    const ocrData = {
+                        docId: copyRow.value.docId,
+                        fileId: copyRow.value.fileId,
+                        fileType: copyFileType.value
                     }
+                    window.parent.$setOpenTab(itemData)
+                    sessionStorage.setItem('ocrData',JSON.stringify(ocrData))
                     sessionStorage.setItem('textData','')
                     sessionStorage.setItem('showImg','')
-                    addFolderAdd(itemData)
+                    // addFolderAdd(itemData)
             }
             if (row.name === '打开') {
                 // console.log('yulanData',thisFolder.value);

+ 8 - 7
src/views/publicment/MyFile.vue

@@ -1269,16 +1269,17 @@ export default {
             if (row.name === '文字识别') {
                 const itemData = {
                         name: '文字识别',
-                        path: 'identifyFont',
-                        clickRowId: {
-                            docId: copyRow.value.docId,
-                            fileId: copyRow.value.fileId,
-                            fileType: copyFileType.value
-                        }
+                        path: `/identifyFont`
+                    }
+                    const ocrData = {
+                        docId: copyRow.value.docId,
+                        fileId: copyRow.value.fileId,
+                        fileType: copyFileType.value
                     }
+                    window.parent.$setOpenTab(itemData)
+                    sessionStorage.setItem('ocrData',JSON.stringify(ocrData))
                     sessionStorage.setItem('textData','')
                     sessionStorage.setItem('showImg','')
-                    addFolderAdd(itemData)
             }
             if (row.name === '打开') {
                 loadingPreview.value = true