瀏覽代碼

模板预览放大缩小,搜索加载状态,目录重命名

liuQiang 1 年之前
父節點
當前提交
f369df4e5c

+ 14 - 2
src/layout/NewIndex.vue

@@ -12,6 +12,8 @@
       :allData="allData"
       :hightDataTotal="hightDataTotal"
       :allDataTotal="allDataTotal"
+      :allSearching="allSearching"
+      :highSearching="highSearching"
       @changeSearch="changeSearch"
       @openMaxmin="openMaxmin"
     ></DefaultPage>
@@ -46,6 +48,8 @@ const hightData = ref([]); // 高级搜索数据
 const allData = ref([]); // 全域搜索数据
 const hightDataTotal = ref(); // 高级搜索数据总数
 const allDataTotal = ref(); // 全域搜索数据总数
+const allSearching = ref(false);
+const highSearching = ref(false);
 
 // 将标签信息保存到本地
 const openMaxmin = (title, path) => {
@@ -237,12 +241,15 @@ onUnmounted(() => {
   clearInterval();
 });
 const changeSearch = async (val, text) => {
+  
   searchText.value = text;
   if (val) {
     if (searchText.value.length < 2) {
       ElMessage({ message: "请输入至少两位关键字", type: "info" });
       return;
     }
+    allSearching.value = true;
+    highSearching.value = true;
     showSearch.value = val;
     const query = {
       keyword: searchText.value,
@@ -259,16 +266,18 @@ const changeSearch = async (val, text) => {
     //高级搜索
     searchAll(query).then((res) => {
       // console.log("hightData", res);
-      if (res.data) {
+        allSearching.value = false;
+      // if (res.data) {
         hightData.value = res.data;
         hightDataTotal.value = res.total;
-      }
+      // }
     });
 
     // 全域搜索
     flieSearch(allQuery).then((res2) => {
       allData.value = res2.rows;
       allDataTotal.value = res2.total;
+      highSearching.value = false;
       // console.log("allData", res2);
     });
   }
@@ -299,4 +308,7 @@ const changeSearch = async (val, text) => {
   // border: 1px solid #000;
   background-color: #b5d2ea;
 }
+:deep(.is-message-box){
+  z-index: 99999999 !important;
+}
 </style>

+ 117 - 73
src/layout/components/DefaultPage/DefaultPage.vue

@@ -47,65 +47,72 @@
     </div>
     <div v-if="isSearch" class="searchBtm">
       <div class="highSearch">
-        <div class="title">共查询到{{ props.hightDataTotal }}个相关结果</div>
-        <div class="list">
-          <div class="oneBox" v-for="item in hightData" :key="item.id" @click="toFile(item.content.docInfo)">
-            <span class="fileName">{{ item.content.docInfo.fileName }}</span>
-            <div class="flieTime">
-              <span>创建时间:</span>
-              <span>{{ item.content.docInfo.createTime }}</span>
-              <div class="position">
-                <span>文件位置:</span>
-                <span>{{ item.content.docInfo.dir.dirPath }}</span>
+        <div v-loading="highLoading" v-if="highLoading" class="lodingBox"></div>
+        <div v-else>
+          <div class="title">共查询到{{ props.hightDataTotal }}个相关结果</div>
+          <div class="list">
+            <div
+              class="oneBox"
+              v-for="item in hightData"
+              :key="item.id"
+              @click="toFile(item.content.docInfo)"
+            >
+              <span class="fileName">{{ item.content.docInfo.fileName }}</span>
+              <div class="flieTime">
+                <span>创建时间:</span>
+                <span>{{ item.content.docInfo.createTime }}</span>
+                <div class="position">
+                  <span>文件位置:</span>
+                  <span>{{ item.content.docInfo.dir.dirPath }}</span>
+                </div>
               </div>
+              <div
+                class="flieContent"
+                v-for="par in item.highlightFields.content"
+                :key="par"
+                v-html="par"
+              ></div>
             </div>
-            <div
-              class="flieContent"
-              v-for="par in item.highlightFields.content"
-              :key="par"
-              v-html="par"
-            ></div>
           </div>
         </div>
       </div>
       <div class="allSearch">
-        <div class="title"><span>文件名匹配结果</span></div>
-        <div class="num">共查询到{{ props.allDataTotal }}个相关结果</div>
-        <el-table
-          :data="allData"
-          style="width: 100%"
-          ref="container"
-          height="584"
-          scrollbar-always-on
-          @row-click="toFile"
-        >
-          <el-table-column type="index" width="70" />
-          <el-table-column label="名称" width="200">
-            <template #default="scope">
-              <div class="flie_name">
-                <img
-                  class="table_icon"
-                  :src="setIcon(scope.row.fileType)"
-                  alt=""
-                  style=""
-                />
-                <span v-html="scope.row.fileName"></span>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column
-            prop="dir.dirPath"
-            label="所属空间"
-            width="210"
-          />
-          <el-table-column prop="fileType" label="类型" width="100" />
-          <el-table-column prop="createTime" label="时间" width="200" />
-          <el-table-column prop="fileSize" label="大小" width="100">
-            <template #default="scope">
-              <div>{{ formatFileSize(scope.row.fileSize) }}</div>
-            </template>
-          </el-table-column>
-        </el-table>
+        <div v-loading="allLoading" v-if="allLoading" class="lodingBox"></div>
+        <div v-else>
+          <div class="title"><span>文件名匹配结果</span></div>
+          <div class="num">共查询到{{ props.allDataTotal }}个相关结果</div>
+          <el-table
+            :data="allData"
+            style="width: 100%"
+            ref="container"
+            height="584"
+            scrollbar-always-on
+            @row-click="toFile"
+          >
+            <el-table-column type="index" width="70" />
+            <el-table-column label="名称" width="200">
+              <template #default="scope">
+                <div class="flie_name">
+                  <img
+                    class="table_icon"
+                    :src="setIcon(scope.row.fileType)"
+                    alt=""
+                    style=""
+                  />
+                  <span v-html="scope.row.fileName"></span>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="dir.dirPath" label="所属空间" width="210" />
+            <el-table-column prop="fileType" label="类型" width="100" />
+            <el-table-column prop="createTime" label="时间" width="200" />
+            <el-table-column prop="fileSize" label="大小" width="100">
+              <template #default="scope">
+                <div>{{ formatFileSize(scope.row.fileSize) }}</div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
       </div>
     </div>
     <div v-else class="btmBox">
@@ -260,7 +267,9 @@ const isSearch = ref(props.showSearch);
 const searchText = ref(); // 搜索内容
 const hightData = ref([]); // 高级搜索数据
 const allData = ref([]); // 全域搜索数据
-const canSearch = ref(true)
+const canSearch = ref(true);
+const allLoading = ref(false);
+const highLoading= ref(false);
 
 const emit = defineEmits(["openMaxmin", "changeSearch"]);
 const props = defineProps({
@@ -284,18 +293,26 @@ const props = defineProps({
     type: Number,
     default: 0,
   },
+  highSearching: {
+    type: Boolean,
+    default: false,
+  },
+  allSearching: {
+    type: Boolean,
+    default: false,
+  },
 });
 //搜索事件
 const searchBtn = () => {
   // console.log("searchText", searchText.value);
-    if(!canSearch.value){
-      return
-    }else{
-      canSearch.value = false
-      setTimeout(() => {
-        canSearch.value = true
-      }, 3000);
-    }
+  if (!canSearch.value) {
+    return;
+  } else {
+    canSearch.value = false;
+    setTimeout(() => {
+      canSearch.value = true;
+    }, 3000);
+  }
   if (!searchText.value) {
     ElMessage({
       message: "请输入关键字",
@@ -303,21 +320,19 @@ const searchBtn = () => {
     });
     return;
   }
-bus.emit('test',1,1)
   emit("changeSearch", true, searchText.value);
 };
 // 获取数据
 const getList = async () => {
   const resN = await listRecent({ isFolder: "N" });
-  console.log('resN',resN);
   if (resN.code === 200) {
     tableFileData.value.length = resN.rows.length;
     for (let index = 0; index < resN.rows.length; index++) {
-       getInfo(resN.rows[index].relaId).then(async(res) => {
+      getInfo(resN.rows[index].relaId).then(async (res) => {
         //  tableFileData.value.push(res.data);
-         tableFileData.value.splice(index,1,res.data);
-         index++
-      })
+        tableFileData.value.splice(index, 1, res.data);
+        index++;
+      });
     }
     // console.log('tableFileData',tableFileData.value);
     // 将tableFileData里的数据按照createTime排序
@@ -490,10 +505,13 @@ const closeOpenScanMove = () => {
 //粘贴文件上传
 const copyFile = (event) => {
   const items = (event.clipboardData || window.clipboardData).items;
-  console.log('event',event);
+  console.log("event", event);
   let file = null;
   if (!items || items.length === 0) {
-    ElMessage({ message: "请选当前浏览器不支持本地或请打开图片再复制择文件", type: "error" })
+    ElMessage({
+      message: "请选当前浏览器不支持本地或请打开图片再复制择文件",
+      type: "error",
+    });
     return;
   }
   // // 搜索剪切板items
@@ -548,6 +566,26 @@ watch(
     deep: true,
   }
 );
+watch(
+  () => props.highSearching,
+  (newValue, oldValue) => {
+    highLoading.value = newValue;
+  },
+  {
+    immediate: true,
+    deep: true,
+  }
+);
+watch(
+  () => props.allSearching,
+  (newValue, oldValue) => {
+    allLoading.value = newValue;
+  },
+  {
+    immediate: true,
+    deep: true,
+  }
+);
 onMounted(() => {
   getList();
   getSpaceList();
@@ -917,6 +955,12 @@ onMounted(() => {
     }
   }
 }
+.lodingBox {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  z-index: 10000000;
+}
 .checkScan {
   background-color: #f5f7f9;
 }
@@ -936,9 +980,9 @@ onMounted(() => {
 :deep(em) {
   background: #fff0ba !important;
 }
-.hoverColor{
-  &:hover{
-    background-color: #236EC3;
+.hoverColor {
+  &:hover {
+    background-color: #236ec3;
   }
 }
 </style>

+ 11 - 0
src/layout/components/TopMenu/TopMenu.vue

@@ -224,6 +224,7 @@ function logout() {
     confirmButtonText: "确定",
     cancelButtonText: "取消",
     type: "warning",
+    customStyle: { zIndex: 9999999 },
   })
     .then(() => {
       sessionStorage.clear();
@@ -233,6 +234,13 @@ function logout() {
       });
     })
     .catch(() => {});
+      var el=document.querySelector('.is-message-box');
+      
+      if(el){ 
+        el.style.zIndex = "888888"
+        // console.log('el',el);
+        // console.log('el',el.style.zIndex);
+      }
 }
 //获取扫描仪列表
 const scannerFile = async () => {
@@ -454,5 +462,8 @@ onMounted(() => {
 .hand{
   cursor: pointer;
 }
+:deep(.el-overlay){
+  z-index: 99999999 !important;
+}
 // 底部标签样式
 </style>

+ 6 - 7
src/views/biz/template/index.vue

@@ -415,9 +415,8 @@ function handleOpen(row) {
 // 控制iframe大小
   const iframeSize = () => {
   // console.log('执行ifSize',par);
-  const outIframe = document.getElementById("iframeHis");
-  const inIframe =
-      outIframe.contentDocument.getElementsByTagName("iframe")[0];
+  const tagIfarme = document.querySelector("#iframeHis");
+  let inIframe = tagIfarme.contentDocument.getElementsByTagName("iframe")[0];
   if(inIframe==null){
       // console.log('没有inF');
       setTimeout(() => {
@@ -432,10 +431,10 @@ function handleOpen(row) {
   //     800 + "px";
   // inIframe.style.width = outIframe.style.width =
   //     1200 + "px";
-    inIframe.style.height = outIframe.style.height =
-    outIframe.parentElement.offsetHeight - 40 + "px";
-  inIframe.style.width = outIframe.style.width =
-    outIframe.parentElement.offsetWidth  - 80+ "px";
+    inIframe.style.height = tagIfarme.style.height =
+        tagIfarme.parentElement.offsetHeight - 40 + "px";
+         inIframe.style.width = tagIfarme.style.width =
+        tagIfarme.parentElement.offsetWidth  - 80+ "px";
   }
   const closeHis = ()=>{
     showPreview.value = false

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

@@ -1801,7 +1801,7 @@ export default {
                     //     fileName:nameForm.value.name
                     // })
                     fileNameChange.value = false
-                    // refreshFile()
+                    refreshFile()
                 }
             })
         }
@@ -1834,8 +1834,8 @@ export default {
         function getCollects(data) {
             collects.value = data
         }
-        function getRename(data) {
-            rename.value = data
+        function getRename() {
+            rename.value = false
         }
         function getSpaceC(data) {
             spaces.value = data

+ 2 - 5
src/views/department/modalComponebts/FolderReName.vue

@@ -43,7 +43,6 @@ export default {
         let reid = props.selectedBox
         let reSet = props.copyFolderName
         let folderName = ref(false)
-        const upFirstFolderData = inject("upFirstFolderData");
         let newName = ref('')
         function inlineList() {
             folderName.value = result
@@ -64,9 +63,8 @@ export default {
                         message: '重命名成功',
                         type: "success"
                     })
-                    upFirstFolderData({dirId:reid,dirName:newName.value})
                     folderName.value = false
-                    emit("getRename", folderName.value)
+                    emit("getRename")
                 }
             })
         }
@@ -78,8 +76,7 @@ export default {
             newName,
             inlineList,
             backToFile: to,
-            sureFolderName:editName,
-            upFirstFolderData
+            sureFolderName:editName
         }
     }
 }

+ 9 - 12
src/views/myfile/MyFile.vue

@@ -881,10 +881,8 @@ export default {
         }
         // 控制iframe大小
         const iframeSize = () => {
-        // console.log('执行ifSize',par);
-        const outIframe = document.getElementById("iframeHis");
-        const inIframe =
-            outIframe.contentDocument.getElementsByTagName("iframe")[0];
+        const tagIfarme = document.querySelector(`#iframeHis1`);
+        let inIframe = tagIfarme.contentDocument.getElementsByTagName("iframe")[0];
         if(inIframe==null){
             // console.log('没有inF');
             setTimeout(() => {
@@ -893,12 +891,11 @@ export default {
             }, 200);
             return
         }
-        // console.log('outIframe', outIframe);
         // console.error(outIframe.parentElement);
-        inIframe.style.height = outIframe.style.height =
-        outIframe.parentElement.offsetHeight - 40 + "px";
-         inIframe.style.width = outIframe.style.width =
-        outIframe.parentElement.offsetWidth  - 80+ "px";
+        inIframe.style.height = tagIfarme.style.height =
+        tagIfarme.parentElement.offsetHeight - 40 + "px";
+         inIframe.style.width = tagIfarme.style.width =
+        tagIfarme.parentElement.offsetWidth  - 80+ "px";
         }
         const closeHis = ()=>{
             // hisIfarmeData.value = {}
@@ -2026,7 +2023,7 @@ export default {
                     //     fileName:nameForm.value.name
                     // })
                     // fileNameChange.value = false
-                    // refreshFile()
+                    refreshFile()
                 }
             })
         }
@@ -2059,8 +2056,8 @@ export default {
         function getCollects(data) {
             collects.value = data
         }
-        function getRename(data) {
-            rename.value = data
+        function getRename() {
+            rename.value = false
         }
         function getSpaceC(data) {
             spaces.value = data

+ 2 - 5
src/views/myfile/modalComponebts/FolderReName.vue

@@ -43,7 +43,6 @@ export default {
         let reid = props.selectedBox
         let reSet = props.copyFolderName
         let folderName = ref(false)
-        const upFirstFolderData = inject("upFirstFolderData");
         let newName = ref('')
         function inlineList() {
             folderName.value = result
@@ -64,9 +63,8 @@ export default {
                         message: '重命名成功',
                         type: "success"
                     })
-                    upFirstFolderData({dirId:reid,dirName:newName.value})
                     folderName.value = false
-                    emit("getRename", folderName.value)
+                    emit("getRename")
                 }
             })
         }
@@ -78,8 +76,7 @@ export default {
             newName,
             inlineList,
             backToFile: to,
-            sureFolderName:editName,
-            upFirstFolderData
+            sureFolderName:editName
         }
     }
 }

+ 3 - 3
src/views/publicment/MyFile.vue

@@ -1774,7 +1774,7 @@ export default {
                     //     fileName:nameForm.value.name
                     // })
                     fileNameChange.value = false
-                    // refreshFile()
+                    refreshFile()
                 }
             })
         }
@@ -1807,8 +1807,8 @@ export default {
         function getCollects(data) {
             collects.value = data
         }
-        function getRename(data) {
-            rename.value = data
+        function getRename() {
+            rename.value = false
         }
         function getSpaceC(data) {
             spaces.value = data

+ 2 - 5
src/views/publicment/modalComponebts/FolderReName.vue

@@ -43,7 +43,6 @@ export default {
         let reid = props.selectedBox
         let reSet = props.copyFolderName
         let folderName = ref(false)
-        const upFirstFolderData = inject("upFirstFolderData");
         let newName = ref('')
         function inlineList() {
             folderName.value = result
@@ -64,9 +63,8 @@ export default {
                         message: '重命名成功',
                         type: "success"
                     })
-                    upFirstFolderData({dirId:reid,dirName:newName.value})
                     folderName.value = false
-                    emit("getRename", folderName.value)
+                    emit("getRename")
                 }
             })
         }
@@ -78,8 +76,7 @@ export default {
             newName,
             inlineList,
             backToFile: to,
-            sureFolderName:editName,
-            upFirstFolderData
+            sureFolderName:editName
         }
     }
 }