lsc 6 місяців тому
батько
коміт
364dcdd1e3

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.351dca32507901cde1109a9d3b8b8a64.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.32e54c5cbc322d18a05c.js></script><script type=text/javascript src=./static/js/app.5cd68f9b0f9186f563e4.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.b32fabea3fd152b591d810fdaac17588.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.32e54c5cbc322d18a05c.js></script><script type=text/javascript src=./static/js/app.7ac4cdb1c982b06694bb.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/css/app.b32fabea3fd152b591d810fdaac17588.css


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/css/app.b32fabea3fd152b591d810fdaac17588.css.map


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/app.5cd68f9b0f9186f563e4.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/app.5cd68f9b0f9186f563e4.js.map


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/app.7ac4cdb1c982b06694bb.js


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/app.7ac4cdb1c982b06694bb.js.map


Різницю між файлами не показано, бо вона завелика
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 53 - 10
src/components/pages/knowledge/fileBox.vue

@@ -19,11 +19,28 @@
         </el-select> -->
         <selectTag
           v-model="checkFolderid"
-          :options="myFolderArray"
+          :options="myFolderArray2"
           :placeholder="'请选择文件夹'"
           style="width: 250px;"
           @change="serchFile()"
         />
+        <el-select
+          v-if="pid.split('/')[0] == '1'"
+          style="width: 120px;margin-left: 10px"
+          v-loading="!userArray.length"
+          v-model="user"
+          placeholder="拥有者"
+          clearable
+          filterable
+          @change="serchFile2()"
+        >
+          <el-option
+            v-for="(item, index) in userArray"
+            :key="index"
+            :label="item.username"
+            :value="item.userid"
+          ></el-option>
+        </el-select>
       </div>
       <div class="f_box_top_right">
         <div class="input">
@@ -40,7 +57,7 @@
           style="background-color: rgb(51, 112, 255);"
             >刷新</el-button
           >
-          <el-button type="primary" size="small" @click="addImg($event)"
+          <el-button v-if="pid.split('/')[0] == '0'" type="primary" size="small" @click="addImg($event)"
           icon="el-icon-plus"
           style="background-color: rgb(51, 112, 255);"
             >上传文件
@@ -78,6 +95,7 @@
             type="selection"
             width="50px"
             :reserve-selection="true"
+            :selectable="isSelectable"
           ></el-table-column>
           <el-table-column
             prop="name"
@@ -144,7 +162,8 @@
                        @click="extractFile(scope.row)"
                         @mouseover="isHover = true"
                         :disabled="scope.row.ingestionStatus == 'failed'"
-                        @mouseleave="isHover = false">
+                        @mouseleave="isHover = false"
+                        v-if="scope.row.userid == userid">
                         <img 
                         style="width: 14px;"
                         :src="isHover ? tqList2 : tqList" 
@@ -282,10 +301,12 @@ export default {
         this.fileArray = [];
         this.checkArray = [];
         this.fileName = "";
-        this.checkFolderid = [this.moFolderid];
-        // this.getData();
+        this.checkFolderid = [];
+        console.log(this.myFolderArray);
+        this.page = 1
+        this.getData();
       }
-    }
+    },
   },
   data() {
     return {
@@ -318,7 +339,9 @@ export default {
       limit: 10,
       total: 0,
       page: 1,
-      checkFolderid: []
+      checkFolderid: [],
+      user: "",
+      userArray: [],
     };
   },
   computed: {
@@ -359,7 +382,14 @@ export default {
           return item;
         }
       };
-    }
+    },
+    myFolderArray2() {
+      if (this.user) {
+        return this.myFolderArray.filter(e => e.userid == this.user);
+      } else {
+        return this.myFolderArray;
+      }
+    },
   },
   methods: {
     handleCurrentChange(val) {
@@ -367,6 +397,7 @@ export default {
       this.getData();
     },
     getData() {
+      let type = this.pid.split("/");
       this.isLoading = true;
       let params = {
         uid: this.userid,
@@ -375,14 +406,18 @@ export default {
         page: this.page,
         num: this.limit
       };
+      if(type[0] == '1'){
+        params.userid = this.user
+      }
       this.ajax
-        .post(this.$store.state.fileApi + "getFile", [params])
+        .post(this.$store.state.fileApi + (type[0] == '0' ? "getFile" : "getFileOpen"), [params])
         .then(res => {
           this.isLoading = false;
           console.log(res.data);
           this.total = res.data.result.length ? res.data.result[0].num : 0;
           this.fileArray = res.data.result;
-          this.$parent.$refs.folder.getData();
+          this.userArray = res.data.user
+          // this.$parent.$refs.folder.getData();
         })
         .catch(err => {
           this.isLoading = false;
@@ -418,6 +453,11 @@ export default {
       this.page = 1;
       this.getData();
     },
+    serchFile2() {
+      this.checkFolderid = ""
+      this.page = 1;
+      this.getData();
+    },
     async beforeUpload(event) {
       let file = "";
       let cfindex2 = 0;
@@ -620,6 +660,9 @@ export default {
       } catch (err) {
         console.error(err);
       }
+    },
+    isSelectable(row) {
+      return row.userid == this.userid;
     }
   },
   mounted() {

+ 29 - 9
src/components/pages/knowledge/folder.vue

@@ -44,6 +44,7 @@
           ></el-option>
         </el-select>
         <el-select
+          v-if="pid.split('/')[0] == '0'"
           style="width: 100px;"
           v-loading="tagLoading3"
           v-model="check3"
@@ -59,6 +60,23 @@
             :value="item.name"
           ></el-option>
         </el-select>
+        <el-select
+          v-if="pid.split('/')[0] == '1'"
+          style="width: 120px;"
+          v-loading="isLoading"
+          v-model="user"
+          placeholder="拥有者"
+          clearable
+          filterable
+          @change="serchFile()"
+        >
+          <el-option
+            v-for="(item, index) in userArray"
+            :key="index"
+            :label="item.username"
+            :value="item.userid"
+          ></el-option>
+        </el-select>
       </div>
       <div class="f_box_top_right">
         <div>
@@ -541,6 +559,8 @@ export default {
       check2: [],
       check3: [],
       stype2: 1,
+      userArray: [],
+      user: [],
     };
   },
   computed: {
@@ -573,9 +593,9 @@ export default {
         if (juri == 1) {
           return "私有";
         } else if (juri == 2) {
-          return "组织";
+          return "组织";
         } else if (juri == 3) {
-          return "全部";
+          return "公开";
         }
       };
     },
@@ -628,22 +648,19 @@ export default {
     },
     getData() {
       let type = this.pid.split("/");
-      let id = "";
-      if (type[0] == "0") {
-        id = this.userid;
-      }
+      let id = this.userid;      
       this.isLoading = true;
       let params = {
         uid: id,
         n: this.fileName.trim(),
         sub: this.check1,
         class: this.check2,
-        tag: this.check3,
+        tag: type[0] == "0" ? this.check3 : this.user,
         page: this.page,
         num: 10
       };
       this.ajax
-        .post(this.$store.state.fileApi + "getFolderPage3", [params])
+        .post(this.$store.state.fileApi + (type[0] == "0" ? "getFolderPage3" : "getFolderPageOpen"), [params])
         .then(res => {
           this.isLoading = false;
           this.total = res.data[0].length ? res.data[0][0].num : 0;
@@ -655,6 +672,9 @@ export default {
             this.folderDescription = "该文件夹为系统创设,将自动关联您所有上传的文件";
             this.createFolder(1);
           }
+          if(res.data[2].length != 0){
+            this.userArray = res.data[2]
+          }
           this.$parent.getData();
           this.$forceUpdate();
         })
@@ -788,7 +808,7 @@ export default {
       this.$emit("checkType", array.join("/"), folderid);
     },
     isSelectable(row) {
-      return row.isMo == "2";
+      return row.isMo == "2" && row.userid == this.userid;
     }
   },
   mounted() {

+ 4 - 4
src/components/pages/knowledge/folderDetail.vue

@@ -33,7 +33,7 @@
             <img style="height: 14px; margin-right: 8px;" src="../../../assets/copyFlieG2.svg" alt="">
             复制
            </div>
-           <div v-if="userid == data.userid && data.isMo == '2'"  @click="deleteFile(pid.split('/')[1])"">
+           <div v-if="userid == data.userid && data.isMo == '2'"  @click="deleteFile(pid.split('/')[1])">
             <img style="width: 16px;margin-right: 8px;transform: scale(.9);" src="../../../assets/delFlieG.svg" alt="">
             删除
            </div>
@@ -95,7 +95,7 @@
               </div>
               <div v-if="data.juri == 3">
                 <img src="../../../assets/siyou2.svg" alt="">
-                <span>全部</span>
+                <span>公开</span>
               </div>
             </div>
         </div>
@@ -182,8 +182,8 @@
               <div class="tag_check">
                 <el-radio-group  v-model="fileDetail.juri" >
                   <el-radio label="1">私有</el-radio>
-                  <el-radio label="2">组织</el-radio>
-                  <el-radio label="3">全部</el-radio>
+                  <el-radio label="2">组织</el-radio>
+                  <el-radio label="3">公开</el-radio>
                 </el-radio-group>
               </div>
           </div>

+ 4 - 4
src/components/pages/knowledge/folderFileBox.vue

@@ -25,7 +25,7 @@
           <img style="vertical-align: middle;transform: scale(1.1);padding-bottom: 2px;box-sizing: border-box;" src="../../../assets/shuax.svg" alt="">
           刷新</el-button
         >
-        <el-button type="primary" icon="el-icon-plus" size="small" @click="addImg($event)"
+        <el-button v-if="userid == data.userid" type="primary" icon="el-icon-plus" size="small" @click="addImg($event)"
           >上传文件
           <input
             type="file"
@@ -44,12 +44,12 @@
           关联文件</el-button
         >
 
-        <el-button type="primary"  v-if="checkArray.length" size="small" @click="batchRemove"
+        <el-button type="primary"  v-if="checkArray.length && userid == data.userid " size="small" @click="batchRemove"
           >
           <img style="vertical-align: middle;padding-bottom: 3px;" src="../../../assets/yichuBtn.svg" alt="">
           移除</el-button
         >
-        <el-button type="danger" style="background: #F56C6C;" v-if="checkArray.length" size="small" @click="batchDelete"
+        <el-button type="danger" style="background: #F56C6C;" v-if="checkArray.length && userid == data.userid " size="small" @click="batchDelete"
           >
           <img style="vertical-align: middle;padding-bottom: 3px;" src="../../../assets/delBtn.svg" alt="">
           删除</el-button
@@ -440,7 +440,7 @@ export default {
         num: this.limit
       };
       this.ajax
-        .post(this.$store.state.fileApi + "getFile", [params])
+        .post(this.$store.state.fileApi + "getFileD", [params])
         .then(res => {
           this.isLoading = false;
           console.log(res.data);

+ 10 - 4
src/components/pages/knowledge/index.vue

@@ -48,10 +48,10 @@
       </div>
 
 
-      <folder :userid="userid" :typeArray="typeArray" :pid="pid" @checkType="checkType" v-if="pid.split('/').length == 1 && barNam ==0" ref="folder"></folder>
+      <folder :userid="userid" :typeArray="typeArray" :pid="pid" @checkType="checkType" v-show="pid.split('/').length == 1 && barNam ==0" ref="folder"></folder>
       
       
-      <fileBox :userid="userid" :typeArray="typeArray" :pid="pid" :type='type' ref="fileBox" v-if="pid.split('/').length == 1 && moFolderid && barNam ==1" :moFolderid="moFolderid" :myFolderArray="myFolderArray">
+      <fileBox :userid="userid" :typeArray="typeArray" :pid="pid" :type='type' ref="fileBox" v-show="pid.split('/').length == 1 && moFolderid && barNam ==1" :moFolderid="moFolderid" :myFolderArray="myFolderArray">
       </fileBox>
 
 
@@ -93,7 +93,7 @@ export default {
       isLoading: false,
       typeArray: [
         { name: '我的文件夹',child: [], id: '0', open:true },
-        // { name: '共享文件夹',child: [], id: '1' }
+        { name: '共享文件夹',child: [], id: '1' }
       ],
       actionType: '',
       renameType: '',
@@ -157,9 +157,14 @@ export default {
           this.isLoading = false;
           let data = res.data[0]
           let data2 = res.data[1]
+          let data3 = res.data[2]
           this.typeArray[0].child = data
           this.moFolderid = res.data[1][0].folderid;
-          this.myFolderArray = data
+          if(this.pid.split('/')[0] == '0'){
+            this.myFolderArray = data
+          }else {
+            this.myFolderArray = data3
+          }
           // this.$refs['fileBox'].getData()
           // console.log(this.$refs['fileBox']);
         })
@@ -185,6 +190,7 @@ export default {
       }
       this.pid = pid;
       this.folderid = folderid;
+      this.getData()
       this.$forceUpdate()
     },
     checkType2(is, pid) {

Деякі файли не було показано, через те що забагато файлів було змінено