liyangzheng 1 жил өмнө
parent
commit
83ca8a4272

+ 2 - 2
src/layout/indexCommon.vue

@@ -10,7 +10,7 @@
             <el-input v-model="searchText" maxlength="32" class="w-50 m-2" size="small"
               placeholder="搜索文件" clearable @keyup.enter="toSearch">
             </el-input>
-            <el-icon style="position: absolute;top: 15px;left: 1200px;z-index: 1;color: white;" @click="toSearch">
+            <el-icon style="position: absolute;top: 15px;left: calc(100% - 40px);z-index: 1;color: white;" @click="toSearch">
               <Search />
             </el-icon>
           </div>
@@ -944,7 +944,7 @@ watch(() => editableTabsValue.value, (newValue, oldValue) => {
   }
 
   .search {
-
+    position: relative;
     .w-50,
     :deep .el-input {
       width: 400px;

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

@@ -2037,6 +2037,7 @@ p {
 
 .el-dropdown-link {
     color: white;
+    cursor: pointer;
 }
 
 .breadBox {

+ 3 - 3
src/views/department/components/createTasnsfer.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="transBox" v-if="open">
     <div class="allBag">
-      <el-input style="width: 220px; margin-left: 18px; margin-top: 5px" v-model="allBag" placeholder="搜索"></el-input>
+      <el-input style="width: calc(100% - 30px); margin-left: 18px; margin-top: 5px" v-model="allBag" placeholder="搜索"></el-input>
       <div class="allLog">
         <el-tree ref="treeRef" :filter-node-method="filterNode" :data="allTreeData" :props="allTreeProps" show-checkbox
           node-key="id" :default-expanded-keys="openTree" @check-change="allTreeChange" :default-checked-keys="backScreen"
@@ -187,7 +187,7 @@ onMounted(async () => {
   justify-content: space-between;
   align-items: center;
   text-align: start;
-  width: 230px;
+  width: calc(100% - 20px);
   margin: 0 auto;
 }
 
@@ -205,7 +205,7 @@ onMounted(async () => {
 }
 
 .allLog {
-  width: 245px;
+  width: calc(100% - 50px);
   height: 330px;
   margin: 5px auto;
   /* border: 1px solid red; */

+ 4 - 2
src/views/publicment/MyFile.vue

@@ -24,7 +24,7 @@
                     <!-- v-for盒子 -->
                     <div style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;align-content: flex-start;overflow-y: auto;">
                         <template v-for="(item, index) in fileMenu" :key="index">
-                            <div class="setBox" @click="changeFile(item, index)">
+                            <div class="setBox" >
                                 <el-dropdown trigger="click" class="selectChe">
                                     <span class="el-dropdown-link">
                                         ...
@@ -37,7 +37,7 @@
                                         </el-dropdown-menu>
                                     </template>
                                 </el-dropdown>
-                            <div class="left_fileBox">
+                            <div class="left_fileBox" @click="changeFile(item, index)">
                                 <el-tooltip
                                     class="box-item tool-tip"
                                     effect="dark"
@@ -1967,6 +1967,7 @@ p {
     position: relative;
     .left_fileBox{
         position: relative;
+        margin-top: 10px;
         .levelImg{
             width: 32px;
             height: 32px;
@@ -2055,6 +2056,7 @@ p {
 
 .el-dropdown-link {
     color: white;
+    cursor: pointer;
 }
 
 .breadBox {

+ 92 - 36
src/views/publicment/modalComponebts/Transfer.vue

@@ -2,30 +2,33 @@
     <div>
         <!-- 穿梭框 -->
         <div>
-            <el-dialog v-model="transferModals" title="分享"  :close-on-click-modal="false">
+            <el-dialog v-model="transferModals" title="分享" width="40%" :close-on-click-modal="false">
                 <div class="transBox">
                     <div class="allBag">
-                        <el-input style="width: 220px;margin-left: 18px;margin-top:5px" v-model="allBag"
-                            placeholder="搜索"></el-input>
+                        <div style="position: relative;">
+                            <el-input style="width: 220px;margin-left: 18px;margin-top:5px" v-model="allBag"
+                                 placeholder="搜索"></el-input>
+                        </div>
                         <div class="allLog">
-                            <el-tree ref="treeRef" :data="allTreeData" :props="allTreeProps" show-checkbox node-key="id"
-                                :default-expanded-keys="openTree" @check-change="allTreeChange"
-                                :default-checked-keys="backScreen" :check-strictly="false" />
+                            <el-tree :filter-node-method="filterNode" v-if="have" ref="treeRef" :data="allTreeData"
+                                :props="allTreeProps" show-checkbox node-key="id" :default-expanded-keys="openTree"
+                                @check-change="allTreeChange" :default-checked-keys="backScreen" :check-strictly="false" />
+                            <span v-else>暂无数据</span>
                         </div>
                     </div>
                     <div class="needBag">
                         <div style="border-bottom: 1px solid gray;" class="needBag_top">
                             <span>已选择{{ chooseTagData.length }}人</span>
-                            <span style="color: red;font-size: 14px;float: right;">清空</span>
+                            <span style="color: red;font-size: 14px;float: right;cursor: pointer;"
+                                @click="cleanPeople">清空</span>
                         </div>
                         <div class="needLog">
-                              <el-scrollbar height="349px">
-                                    <el-tag v-for="(item, index) in chooseTagData" :key="index" class="tagtag"
-                                    :closable="lastPeople" @close="handleClose(item)">
+                            <el-scrollbar height="349px">
+                                <el-tag v-for="(item, index) in chooseTagData" :key="index" class="tagtag" :closable="true"
+                                    @close="handleClose(item)">
                                     {{ item.userName ? item.userName : item.name }}
-                                    </el-tag>
-                              </el-scrollbar>
-
+                                </el-tag>
+                            </el-scrollbar>
                         </div>
                     </div>
                 </div>
@@ -43,7 +46,7 @@
 </template>
 
 <script>
-import { ref, onMounted, toRef } from 'vue';
+import { ref, onMounted, toRef, watch } from 'vue';
 import userTree from '../../../api/user/userTree';
 import fileShare from '../../../api/fileShare/fileShare';
 import fileCount from '../../../api/fileCount/fileCount'
@@ -52,15 +55,15 @@ export default {
     props: {
         thanks: {
             type: Boolean,
-            // required: true
+            required: true
         },
         clickRowId: {
             type: Number,
-            // required: true
+            required: true
         },
         workOrEdit: {
             type: Number,
-            // required: true
+            required: true
         },
         isNewMenu: {
             type: Boolean,
@@ -81,12 +84,15 @@ export default {
             disabled: false,
             id: "id"
         }
+        let treeRef = ref(null)
         let openTree = ref([])
         let chooseTagData = ref([])
         let allBag = ref('')
         let needTagData = ref([])
         let backScreen = ref([])
         let lastPeople = ref(false)
+        let allCancel = ref(false)
+        let have = ref(true)
         function allTeam() {
             if (result) {
                 transferModals.value = result
@@ -94,6 +100,7 @@ export default {
         }
         // 分享穿梭框
         function allTreeChange(e) {
+            // console.log('触发了change事件'+ 1++);
             const id = e.id;
             const label = e.label;
             const disabled = e.disabled;
@@ -104,15 +111,15 @@ export default {
                 chooseTagData.value.splice(existingIndex, 1);
             } else {
                 // 选择操作,将数据添加到 needTagData 中
-                chooseTagData.value.push({ userId: id, userName: label ,disabled:disabled});
+                chooseTagData.value.push({ userId: id, userName: label, disabled: disabled });
             }
             if (chooseTagData.value.length === 1) {
                 lastPeople.value = true
             } else {
                 lastPeople.value = false
             }
-            chooseTagData.value = chooseTagData.value.filter(item=>!item.disabled)
-            console.log('chooseTagData',chooseTagData.value);
+            chooseTagData.value = chooseTagData.value.filter(item => !item.disabled)
+            // console.log('chooseTagData初始数组',chooseTagData.value);
         }
         // 确认分享
         function sureShare() {
@@ -166,9 +173,7 @@ export default {
         }
         // 获取用户树
         function getAllUser() {
-            console.log('feeh',feeh);
             userTree.getUserTree({}).then(res => {
-                console.log('userTree',res);
                 allTreeData.value = [res]
                 userTree.getUserTree({}).then(res => {
                     allTreeData.value = [res];
@@ -196,11 +201,8 @@ export default {
                     })
                 })
             }
-            if(feeh === 0){
-                 fileCount.getActor(dees).then(res => {
-                    // 去除数组内部的重复元素
-                    // const uniqueRes = Array.from(new Set(res.map(item => item.userName))).map(id => res.find(item => item.userName === id));
-                    // 现在的 uniqueRes 数组不包含重复元素
+            if (feeh === 0) {
+                fileCount.getActor(dees).then(res => {
                     chooseTagData.value = res;
                     backScreen.value = chooseTagData.value.map(item => {
                         return item.userId
@@ -213,17 +215,57 @@ export default {
             }
 
         }
+        function cleanPeople() {
+            treeRef.value.setCheckedKeys([]);
+            chooseTagData.value = [];
+            setTimeout(() => {
+                antherClean()
+            })
+        }
+        function antherClean() {
+            treeRef.value.setCheckedKeys([]);
+            chooseTagData.value = [];
+        }
+        function searchInTreeData(treeData, searchValue) {
+            const foundItems = [];
+            function traverseTree(node) {
+                if (node.label.includes(searchValue)) {
+                    foundItems.push(node);
+                }
+                if (node.children) {
+                    node.children.forEach(childNode => traverseTree(childNode));
+                }
+            }
+            treeData.forEach(node => traverseTree(node));
+            return foundItems;
+        }
+        watch(()=>allBag.value,(val)=>{
+            treeRef.value?.filter(val)
+        })
+        function filterNode(value, data) {
+            if (!value) return true
+            return data.label.includes(value)
+        }
         function getBack() {
             transferModals.value = false
             emit("getCback", transferModals.value)
         }
         function handleClose(tag) {
             chooseTagData.value.splice(chooseTagData.value.indexOf(tag), 1);
-            // 从标签中获取 userId
-            // const userId = tag.userId;
-            // 从 chooseTagData 中筛选出不包含当前 userId 的标签
-            // chooseTagData.value = chooseTagData.value.filter(item => item.userId !== userId)
-
+            let result = chooseTagData.value.map((item) => {
+                return item.userId
+            })
+            treeRef.value.setCheckedKeys(result);
+            setTimeout(() => {
+                antherClose(tag)
+            }, 10)
+        }
+        function antherClose(tag) {
+            chooseTagData.value.splice(chooseTagData.value.indexOf(tag), 1);
+            let result = chooseTagData.value.map((item) => {
+                return item.userId
+            })
+            treeRef.value.setCheckedKeys(result);
         }
         onMounted(() => {
             allTeam()
@@ -248,6 +290,10 @@ export default {
             lastPeople,
             feeh,
             backToFather: getBack,
+            cleanPeople,
+            treeRef,
+            have,
+            filterNode,
         }
     }
 }
@@ -275,14 +321,16 @@ export default {
 
 .allBag {
     width: 255px;
-    height: 380px;
+    height: 400px;
     border: 1px solid green;
+    overflow-y: auto;
 }
 
 .needBag {
     width: 255px;
-    height: 380px;
+    height: 400px;
     border: 1px solid green;
+    overflow-y: auto;
 }
 
 .allLog {
@@ -291,16 +339,20 @@ export default {
     margin: 5px auto;
     /* border: 1px solid red; */
     overflow-y: auto;
+    text-align: center;
 }
-.needBag_top{
+
+.needBag_top {
     padding: 0 10px;
     height: 30px;
     display: flex;
     align-items: center;
     justify-content: space-between;
 }
-.needLog{
+
+.needLog {
     height: 100%;
+    overflow-y: auto;
 }
 
 :deep(.el-tag__content) {
@@ -310,4 +362,8 @@ export default {
 :deep(.el-icon el-tag__close) {
     display: block;
 }
+
+:deep(.el-scrollbar__wrap .el-scrollbar__wrap--hidden-default) {
+    height: 346px !important;
+}
 </style>

+ 41 - 59
src/views/search/index.vue

@@ -13,6 +13,7 @@
       <div class="searchFor">
         <div class="search_title">搜索范围:</div>
         <el-tabs v-model="searchFor" class="demo-tabs" @tab-change="changeSearchFor">
+          <el-tab-pane label="全部" name=""></el-tab-pane>
           <el-tab-pane label="公共" name="1"></el-tab-pane>
           <el-tab-pane label="部门" name="2"></el-tab-pane>
           <el-tab-pane label="个人" name="3"></el-tab-pane>
@@ -46,11 +47,11 @@
     <!-- 文件列表 -->
     <div class="fileList">
       <div>
-        <div v-if="isList" style="height: calc(98vh - 420px);overflow-y: auto;">
+        <div v-if="isList" style="height: calc(98vh - 320px);overflow-y: auto;">
           <!-- 表格 -->
-          <el-table :data="tableData" style="width: 100%;height:calc(98vh - 620px);" ref="container"
+          <el-table :data="tableData" style="width: 100%;height:calc(98vh - 220px);" ref="container"
             @scroll="handleScroll">
-            <el-table-column fixed label="名称" width="300">
+            <el-table-column label="名称" width="400">
               <template #default="scope">
                 <div class="flie_name">
                   <img class="table_icon" :src="setIcon(scope.row.fileType)" alt="" style="" />
@@ -58,10 +59,10 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column prop="space.spaceName" label="所属空间" width="180" />
-            <el-table-column prop="createTime" label="时间" width="200" header-align="left" />
-            <el-table-column prop="fileType" label="类型" width="100" />
-            <el-table-column prop="fileSize" label="大小" width="100">
+            <el-table-column prop="space.spaceName" label="所属空间" width="300" />
+            <el-table-column prop="createTime" label="时间" width="200"  />
+            <el-table-column prop="fileType" label="类型" width="200" />
+            <el-table-column prop="fileSize" label="大小" width="200">
               <template #default="scope">
                 <div>{{ formatFileSize(scope.row.fileSize) }}</div>
               </template>
@@ -137,15 +138,28 @@ const reload = inject("reload");
 
 const tableData = ref([]);
 // 切换搜索范围
-const changeSearchFor = (name) => {
-  // console.log('searchFor',searchFor.value);
+const changeSearchFor = async(name) => {
   const typeArr = setType(searchType.value);
   let baseDataObj = toRaw(baseData.value);
-  // console.log("tableData", tableData.tableData);
-  tableData.value = toRaw(baseDataObj).filter(
-    (item) => item.space.spaceType == name && typeArr.includes(item.fileType)
-  );
-  //  console.log('tableData',tableData.value);
+  var fileTypes = ''
+  if (name == 'all') {
+    fileTypes = ''
+  } else if(name == '1') {
+    fileTypes = 1
+    // tableData.value = toRaw(baseDataObj).filter(
+    //   (item) => item.space.spaceType == name && typeArr.includes(item.fileType)
+    // );
+  }else if(name == '2'){
+    fileTypes = 2
+  }else if(name == '3'){
+    fileTypes = 3
+  }
+  let res = await flieSearch({
+    keyword:searchText.value,
+    type:fileTypes
+  })
+  console.log(res.rows,'filter');
+  tableData.value = res.rows
 };
 // 切换搜索分类
 const changeSearchType = (name) => {
@@ -158,10 +172,10 @@ const changeSearchType = (name) => {
     const typeArr = setType(name);
     console.log(typeArr, '类型');
     tableData.value = toRaw(baseDataObj).filter((item) => {
-      console.log(item,'遍历');
+      console.log(item, '遍历');
       return typeArr.includes(item.fileType) && item.space.spaceType === searchFor.value;
     });
-    console.log(tableData.value,'数组');
+    console.log(tableData.value, '数组');
   }
 };
 const changeShow = () => {
@@ -294,7 +308,7 @@ async function handleScroll(e) {
   const tableContainer = e.target;
   const scrollPosition = tableContainer.scrollTop + tableContainer.clientHeight;
   const contentHeight = tableContainer.scrollHeight;
-  console.log(scrollPosition,contentHeight,'对比');
+  console.log(scrollPosition, contentHeight, '对比');
   if (scrollPosition + 0.40005 >= contentHeight) {
     numnum++
     const query = {
@@ -305,7 +319,7 @@ async function handleScroll(e) {
       pageNum: numnum,
     };
     const res = await flieSearch(query);
-    tableData.value = [...tableData.value,...res.rows]
+    tableData.value = [...tableData.value, ...res.rows]
   }
 }
 onMounted(() => {
@@ -491,14 +505,6 @@ watch(() => history, (newValue, oldValue) => {
   font-weight: 400 !important;
 }
 
-::v-deep .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
-  padding-left: 0 !important;
-}
-
-::v-deep .el-tabs--top .el-tabs__item.is-top:last-child {
-  padding-right: 0 !important;
-}
-
 // tag选中颜色
 ::v-deep .el-tabs__item.is-active {
   color: #2e6bc8 !important;
@@ -573,35 +579,9 @@ watch(() => history, (newValue, oldValue) => {
   font-family: Inter-Medium;
   font-size: 14px;
   color: #505870;
-  text-align: right;
-
-  &:nth-child(1) {
-    text-align: left;
-  }
+  // text-align: right;
 }
 
-// ::v-deep .el-table__body tbody [class*="column_2"] {
-//   text-align: right;
-// }
-// ::v-deep .el-table__body tbody [class*="column_3"] {
-//   text-align: right;
-// }
-// ::v-deep .el-table__body tbody [class*="column_4"] {
-//   text-align: right;
-// }
-// ::v-deep .el-table__body tbody [class*="column_6"] {
-//   text-align: right;
-// }
-// ::v-deep .el-table__body tbody [class*="column_7"] {
-//   text-align: right;
-// }
-::v-deep .el-table__body tbody [class*="column_"] {
-  text-align: right;
-
-  &:nth-child(4n + 1) {
-    text-align: left;
-  }
-}
 
 //平铺
 .tile_box {
@@ -653,10 +633,12 @@ watch(() => history, (newValue, oldValue) => {
   margin-left: 25px;
   font-size: 14px;
 }
-:deep(.cell){
-  text-align: center;
-}
-:deep(.el-table td.el-table__cell div){
-  text-align: center;
-}
+
+// :deep(.cell) {
+//   text-align: center;
+// }
+
+// :deep(.el-table td.el-table__cell div) {
+//   text-align: center;
+// }
 </style>

+ 2 - 2
vite.config.js

@@ -42,8 +42,8 @@ export default defineConfig(({
 					// target: 'http://192.168.1.28:8080/',
 					// target: 'http://192.168.1.11:8080/',
 					// target: 'http://localhost:8080/',
-					target:'http://192.168.1.28:8080/',
-					// target:'http://8.142.173.95:19527',
+					// target:'http://192.168.1.28:8080/',
+					target:'http://8.142.173.95:19527',
 					changeOrigin: true,
 					rewrite: (p) => p.replace(/^\/dev-api/, '')
 				},