ソースを参照

Merge branch 'liuqiang' into v3

liuQiang 1 年間 前
コミット
9c73ddc533

+ 47 - 12
src/components/IdentifyFont/IdentifyFont.vue

@@ -104,10 +104,15 @@
     :fileUserTreeData="treeData"
     @fileChangeMsg="fileChangeMsg"
   ></PicTree>
+  <div
+    v-loading.fullscreen="loadingPreview"
+    v-if="loadingPreview"
+    class="lodingBox"
+  ></div>
 </template>
   
   <script setup>
-import { onMounted, ref, toRaw, watch } from "vue";
+import { onMounted, ref, toRaw, watch, inject } from "vue";
 import { ElMessage } from "element-plus";
 import Clipboard from "clipboard";
 import Loading from "@/components/Loading/Loading.vue";
@@ -120,7 +125,12 @@ 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 actionUrl = ref(
+  `${window.location.origin}${import.meta.env.VITE_APP_BASE_API}/upload`
+);
+// const actionUrl = ref(`${window.location.origin}/upload`);
+const loadingPreview = ref(true);
+const addFolderAdd = inject("addFolderAdd");
 
 const props = defineProps({
   openFile: {
@@ -140,11 +150,20 @@ onMounted(async () => {
   let docId = route.query.docId;
   let fileId = route.query.fileId;
   let fileType = route.query.fileType;
+  const JparData = history.state.clickRowId;
+  const parData = JSON.parse(JparData);
+  console.log("parData", parData);
+  if (JparData) {
+    docId = parData.docId;
+    fileId = parData.fileId;
+    fileType = parData.fileType;
+  }
   console.log("fileId", fileId);
   console.log("fileType", fileType);
-  if (fileType === ".png" || fileType === ".jpg") {
+  if (fileType === ".png" || fileType === ".jpg"|| fileType === ".JPG"|| fileType === ".PNG") {
     const imgRes = await preview(docId);
     thisStep.value = "loading";
+    loadingPreview.value = false;
     showImg.value = URL.createObjectURL(imgRes);
     const res = await ocrRemark(fileId);
     // ocrRemark(fileId).then((res)=>{
@@ -154,6 +173,8 @@ onMounted(async () => {
     // })
     thisStep.value = "end";
     textData.value = res.msg;
+  } else {
+    loadingPreview.value = false;
   }
 });
 const handleAvatarSuccess = (msg, file) => {
@@ -223,9 +244,17 @@ const reClick = () => {
 </script>
   
   <style lang="scss" scoped>
+.lodingBox {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100vh;
+  height: 100vh;
+  z-index: 10000000;
+}
 .container {
   width: 100%;
-  height: 100%;
+  height: 87vh;
   background-color: #fff;
   display: flex;
   align-items: center;
@@ -243,6 +272,7 @@ const reClick = () => {
     align-items: center;
     margin-right: 48px;
     .boder_box {
+      width: 100%;
       border: 1px solid #c1cce3;
     }
     .title {
@@ -256,14 +286,16 @@ const reClick = () => {
     }
     .img_show {
       width: 100%;
-      height: 100%;
+      height: calc(100% - 40px);
       display: flex;
       align-items: center;
       justify-content: center;
       img {
         width: 100%;
-        // max-height: 100%;
+        max-height: 100%;
+        // opacity: 0;
         // object-fit:cover; // 保持原比例缩小
+        object-fit: contain; // 保持原比例缩小
       }
     }
     .upimg_box {
@@ -293,6 +325,7 @@ const reClick = () => {
     flex-direction: column;
     align-items: center;
     .boder_box {
+      width: 100%;
       border: 1px solid #c1cce3;
     }
     .title {
@@ -325,7 +358,7 @@ const reClick = () => {
       text-align: center;
     }
     .text_box {
-      padding:16px ;
+      padding: 16px;
       font-size: 14px;
       font-weight: 500;
       color: #000000;
@@ -337,14 +370,14 @@ const reClick = () => {
     align-items: center;
     // justify-content: center;
     flex-direction: column;
-    .text_box{
+    .text_box {
       width: 100%;
       margin-top: 20px;
-      color: #06286C;
+      color: #06286c;
       display: flex;
       justify-content: center;
       align-items: center;
-      span{
+      span {
         margin-right: 15px;
       }
     }
@@ -358,10 +391,11 @@ const reClick = () => {
       display: flex;
       align-items: center;
       justify-content: center;
-      padding:0 15px;
+      padding: 0 15px;
       img {
         width: 100%;
-        // height: 100%;
+        height: 100%;
+        object-fit: contain; // 保持原比例缩小
       }
       .light {
         width: calc(100% - 30px);
@@ -390,6 +424,7 @@ const reClick = () => {
   .end_box {
     display: flex;
     justify-content: center;
+    width: 100%;
   }
 }
 :deep(.el-dialog__header) {

+ 4 - 4
src/components/ImgPreview/ImgPreview.vue

@@ -70,12 +70,12 @@ watch(
     // console.log(111);
     showImageViewer.value = newValue;
     if(newValue == false){
-      console.log('watch',video.value);
+      // console.log('watch',video.value);
     }
   },
   () => props.previewData,
   (newValue) => {
-    console.log("previewData", newValue);
+    // console.log("previewData", newValue);
     // showImageViewer.value = newValue;
   }
 );
@@ -115,10 +115,10 @@ const canSeeImg = (copyFileType)=>{
   }
 }
 onMounted(()=>{
-  console.log('audio',audio.value);
+  // console.log('audio',audio.value);
 })
 onDeactivated(()=>{
-  console.log('audio',audio.value);
+  // console.log('audio',audio.value);
 })
 </script>
 

+ 15 - 0
src/layout/indexCommon.vue

@@ -547,6 +547,21 @@ const clickTab = (item) => {
         }
         return
       }
+      // 去文字识别单独判断
+      if (toFileData.value.name == "文字识别" || toFileData.value.label == "文字识别") {
+        // console.log("clickRowId.value", JSON.stringify(toRaw(toFileData.value).clickRowId));
+        editableTabsValue.value = toFileData.value.path
+        isAlive.value = true
+        console.log('route', route.path);
+          router.push({
+            name: toFileData.value.path,
+            state: {
+              // row: JSON.stringify(toRaw(toFileData.value.clickRowId)),
+              clickRowId: JSON.stringify(toRaw(toFileData.value).clickRowId),
+            },
+          });
+        return
+      }
       editableTabsValue.value = toFileData.value.path
       router.push({
         path: toFileData.value.path,

+ 3 - 1
src/views/department/MyFile.vue

@@ -253,7 +253,7 @@
                                 <template #title>
                                    <span class="file-title">文件</span>
                                 </template>
-                                <el-table v-el-table-infinite-scroll="setScroll" :infinite-scroll-distance="10" :infinite-scroll-disabled="tableBeEnd" v-if="fileGrid" height="38vh" :data="fileList" :scrollbar-always-on="true" style="width: 100%"
+                                <el-table v-el-table-infinite-scroll="setScroll" :infinite-scroll-distance="30" :infinite-scroll-disabled="tableBeEnd" v-if="fileGrid" height="38vh" :data="fileList" :scrollbar-always-on="true" style="width: 100%"
                                     @row-contextmenu="handleRowClick" @selection-change="handleSelectionChange"
                                     @row-click="mouseClick" :default-sort="{ prop: 'createTime', order: 'descending' }">
                                     <el-table-column type="selection" width="55" />
@@ -1283,11 +1283,13 @@ export default {
             }
             // console.log('thisFolderRole',thisFolderRole.value);
             if(thisFolderRole.value.roles){
+                // 加密登记
                 // console.log('thisFolderRole',thisFolderRole.value);
                 arr = rightMenuRole(toRaw(thisFolderRole.value),arr)
             }
             // console.log('thisRole.value',thisRole.value);
             if(thisRole.value.length){
+                //权限
                 arr = publicRightMenuRole(toRaw(thisRole.value),arr)
             }
             if(thisFolder.value.dirType == '1' && !isDept.value){

+ 24 - 10
src/views/myfile/MyFile.vue

@@ -271,7 +271,7 @@
                                     <template #title>
                                        <span class="file-title">文件</span>
                                     </template>
-                                    <el-table v-el-table-infinite-scroll="setScroll" :infinite-scroll-distance="10"
+                                    <el-table v-el-table-infinite-scroll="setScroll" :infinite-scroll-distance="30"
                                         :infinite-scroll-disabled="tableBeEnd" v-if="fileGrid" height="38vh"
                                         :data="fileList" :scrollbar-always-on="true" style="width: 100%;"
                                         @row-contextmenu="handleRowClick" @selection-change="handleSelectionChange"
@@ -714,6 +714,7 @@ export default {
                             for (var i = 1; i <= x; i++) {
                                 obj.pageNum = i
                                 myfile.getById(userMe[0].dirId - 0, obj).then(res => {
+                                    console.log('topallfn');
                                     fileList.value = fileList.value.concat(res.rows)
                                     const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
                                         .map(docId => fileList.value.find(item => item.docId === docId));
@@ -984,14 +985,24 @@ export default {
                 // selectedIndex.value = selectedIndex.value + 1
             }
             if (row.name === '文字识别') {
-                router.push({
-                    path: '/identifyFont',
-                    query: {
-                        docId: copyRow.value.docId,
-                        fileId: copyRow.value.fileId,
-                        fileType: copyFileType.value
+                // router.push({
+                //     path: '/identifyFont',
+                //     query: {
+                //         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
+                        }
                     }
-                })
+                    addFolderAdd(itemData)
             }
             if (row.name === '预览') {
                 loadingPreview.value = true
@@ -1308,14 +1319,16 @@ export default {
                 folderList.value = res.data
                 if (res.data.length === 0) {
                     myfile.getById(query).then(res => {
+                        console.log('res = ',res);
                         if (res.code === 200) {
                             tableTotal.value = res.total
                             if (res.rows.length < res.total) {
                                 //第一次拿到的数据少于总数开启下拉事件
                                 tableBeEnd.value = false
                             }
-                            fileList.value = res.rows
+                            fileList.value = JSON.parse(JSON.stringify(res.rows))
                         }
+                    console.log('folderClickshijian1',tableTotal.value,tableBeEnd.value);
                     })
                 } else {
                     myfile.getById(query).then(res => {
@@ -1327,6 +1340,7 @@ export default {
                             }
                             fileList.value = JSON.parse(JSON.stringify(res.rows))
                         }
+                        console.log('folderClickshijian2',tableTotal.value,tableBeEnd.value);
                     })
                 }
             })
@@ -1432,7 +1446,7 @@ export default {
         const filterMouseCli = () => {
             const canPreviewArray = ['.doc', '.wps', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.pdf', '.rtf', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp', '.pot', '.potm', '.potx', '.pps', '.ppsm', '.ppsx', '.ppt', '.pptm', '.pptx']
             const typeArr = ['.png', '.jpg', '.jpeg', '.JPG', '.mp3', '.mp4']
-            const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG']
+            const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG','.PNG']
             const canEditArr = ['.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp', '.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.rtf', '.txt', '.djvu', '.xps', '.wps', '.pptx']
             let arr = []
             if (!(typeArr.includes(copyFileType.value) || canPreviewArray.includes(copyFileType.value))) {