lsc 7 kuukautta sitten
vanhempi
commit
b4594a0007

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.10b1325ca71de72387e77771ef8a1346.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.02f1ec51c3a8a4f98a8c.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.a2d31bec6551a16553cf4f6fc26e8621.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.94035dc080f8765ee4ad.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.10b1325ca71de72387e77771ef8a1346.css.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.a2d31bec6551a16553cf4f6fc26e8621.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/css/app.a2d31bec6551a16553cf4f6fc26e8621.css.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.02f1ec51c3a8a4f98a8c.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.02f1ec51c3a8a4f98a8c.js.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.94035dc080f8765ee4ad.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/app.94035dc080f8765ee4ad.js.map


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 10 - 1
src/components/pages/knowledge/components/relateFiles.vue

@@ -12,6 +12,7 @@
           <div class="f_box_top_title">我的文件</div>
         </div>
         <div class="f_box_top_right">
+          <span v-if="checkArray.length" style="margin-right: 10px;color: #b0b0b0;font-size: 14px;">已选文件{{checkArray.length}}个</span>
           <el-button type="primary" size="small" @click="serchFile"
             >刷新</el-button
           >
@@ -130,9 +131,10 @@
           </el-table>
         </div>
         <el-pagination
+          class="pageBox"
           style="margin-top: 10px"
           background
-          layout="prev, pager, next"
+          layout="total, prev, pager, next"
           :page-size="limit"
           :total="total"
           @current-change="handleCurrentChange"
@@ -743,4 +745,11 @@ export default {
   white-space: nowrap;
   text-overflow: ellipsis;
 }
+
+.pageBox{
+  display: flex;
+}
+.pageBox >>> .el-pagination__total{
+  margin-right: auto;
+}
 </style>

+ 151 - 0
src/components/pages/knowledge/components/selectTag3.vue

@@ -0,0 +1,151 @@
+<template>
+  <main>
+    <el-select
+      ref="select"
+      v-model="values"
+      multiple
+      style="width:100%"
+      :placeholder="placeholder"
+      @change="handleChange"
+      @remove-tag="removeTag"
+    >
+      <el-option
+        v-for="item in options"
+        :key="item.folderid"
+        :disabled="disabled && item.id === Number(judgingCondition)"
+        :label="item.name"
+        :value="item.folderid"
+      />
+    </el-select>
+  </main>
+</template>
+<script>
+export default {
+  name: 'select-tags',
+  props: {
+    // 选项
+    options: {
+      type: Array,
+      default: () => []
+    },
+    // 选中的值
+    value: {
+      type: Array,
+      default: () => []
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      default: '请选择'
+    },
+    // 是否禁用
+    disabled: {
+      type: Boolean,
+      default: false
+    },
+    // 判断条件
+    judgingCondition: {
+      type: String | Number,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      observer: null,
+      hideDom: null
+    };
+  },
+  computed: {
+    /**
+     * @description 获取当前选中的值
+    */
+    values: {
+      get() {
+        return this.value;
+      },
+      set(val) {
+        this.$emit('input', val);
+      }
+    }
+  },
+  mounted() {
+    this.mutationObserver();
+  },
+  beforeDestroy() {
+    this.observer.disconnect();
+  },
+  methods: {
+    /**
+     * @description 监听tag变化
+     */
+    mutationObserver() {
+      const tagLIstDom = this.$refs.select.$el.querySelector('.el-select__tags');
+      const tagSpanDom = this.$refs.select.$el.querySelector('.el-select__tags > span');
+
+      // 创建隐藏的计数节点
+      this.hideDom = document.createElement('span');
+      this.hideDom.classList.add('count-node');
+      tagSpanDom.append(this.hideDom);
+
+      const config = { childList: true };
+
+      const callback = mutationsList => {
+        mutationsList.forEach(item => {
+          if (item.type === 'childList') {
+            const tagList = item.target.childNodes;
+            let tagWidth = 0;
+            let tagNum = 0;
+            let availableTagWidth = 0;
+
+            for (let i = 0; i < tagList.length; i++) {
+              const e = tagList[i];
+              if (tagWidth > tagLIstDom.offsetWidth) {
+                e.style.display = 'none';
+              } else {
+                e.style.display = 'inline-block';
+              }
+              tagWidth += e.offsetWidth + 5;
+
+              if (tagWidth > tagLIstDom.offsetWidth) {
+                e.style.display = 'none';
+              } else {
+                e.style.display = 'inline-block';
+              }
+
+              if (e.style.display !== 'none') {
+                tagNum++;
+                this.hideDom.style.display = 'none';
+                const margin = tagNum === 1 ? 0 : 7;
+                availableTagWidth += e.offsetWidth + margin;
+              } else {
+                this.hideDom.style.display = 'inline-block';
+                this.hideDom.style.left = `${availableTagWidth}px`;
+                this.hideDom.innerHTML = `+${tagList.length - tagNum}`;
+              }
+            }
+          }
+        });
+      };
+
+      this.observer = new MutationObserver(callback);
+      this.observer.observe(tagSpanDom, config);
+    },
+    /**
+     * @description 选择框改变
+     */
+    handleChange() {
+      this.$emit('change', this.value);
+    },
+    /**
+     *
+     * @param val 当前角色绑定的分校不允许删除
+     */
+    removeTag(val) {
+      this.$emit('remove-tag', val);
+    }
+  }
+};
+</script>
+<style scoped>
+
+</style>

+ 26 - 7
src/components/pages/knowledge/fileBox.vue

@@ -5,6 +5,7 @@
         <div class="f_box_top_title">所有文件</div>
       </div>
       <div class="f_box_top_right">
+        <span v-if="checkArray.length" style="margin-right: 10px;color: #b0b0b0;font-size: 14px;">已选文件{{checkArray.length}}个</span>
         <el-button type="primary" size="small" @click="serchFile"
           >刷新</el-button
         >
@@ -24,7 +25,7 @@
     </div>
     <div class="f_box_top">
       <div class="f_box_top_left">
-        <el-select v-model="checkFolderid" filterable @change="serchFile">
+        <!-- <el-select v-model="checkFolderid" filterable multiple @change="serchFile">
           <el-option
             v-for="item in myFolderArray"
             :key="item.folderid"
@@ -32,7 +33,14 @@
             :value="item.folderid"
           >
           </el-option>
-        </el-select>
+        </el-select> -->
+        <selectTag
+          v-model="checkFolderid"
+          :options="myFolderArray"
+          :placeholder="'前选择文件夹'"
+          style="width: 250px;"
+          @change="serchFile()"
+        />
       </div>
       <div class="f_box_top_right">
         <div class="input">
@@ -138,9 +146,10 @@
         </el-table>
       </div>
       <el-pagination
+        class="pageBox"
         style="margin-top: 10px"
         background
-        layout="prev, pager, next"
+        layout="total,prev, pager, next"
         :page-size="limit"
         :total="total"
         @current-change="handleCurrentChange"
@@ -171,6 +180,7 @@ import videoImg from "../../../assets/icon/sourceFile/video.png";
 import otherImg from "../../../assets/icon/sourceFile/other.png";
 import checkImg from "../../../assets/icon/sourceFile/check.png";
 import checkIsImg from "../../../assets/icon/sourceFile/check_is.png";
+import selectTag from "./components/selectTag3.vue";
 
 import wVideo from "../test/file/wVideo.vue";
 import wpdf from "../test/file/wPdf2.vue";
@@ -184,7 +194,8 @@ export default {
     wVideo,
     wpdf,
     wOffice,
-    checkDialog
+    checkDialog,
+    selectTag
   },
   props: {
     userid: {
@@ -214,7 +225,7 @@ export default {
         this.fileArray = [];
         this.checkArray = [];
         this.fileName = "";
-        this.checkFolderid = this.moFolderid;
+        this.checkFolderid = [this.moFolderid];
         // this.getData();
       }
     }
@@ -244,7 +255,7 @@ export default {
       limit: 10,
       total: 0,
       page: 1,
-      checkFolderid: ""
+      checkFolderid: []
     };
   },
   computed: {
@@ -296,7 +307,7 @@ export default {
       this.isLoading = true;
       let params = {
         uid: this.userid,
-        folderid: this.checkFolderid,
+        folderid: this.checkFolderid.join(","),
         n: this.fileName.trim(),
         page: this.page,
         num: this.limit
@@ -936,4 +947,12 @@ export default {
   white-space: nowrap;
   text-overflow: ellipsis;
 }
+
+
+.pageBox{
+  display: flex;
+}
+.pageBox >>> .el-pagination__total{
+  margin-right: auto;
+}
 </style>

+ 34 - 4
src/components/pages/knowledge/folder.vue

@@ -7,6 +7,7 @@
         </div>
       </div>
       <div class="f_box_top_right">
+        <span v-if="checkArray.length" style="margin-right: 10px;color: #b0b0b0;font-size: 14px;">已选文件夹{{checkArray.length}}个</span>
         <el-button type="primary" size="small" @click="openAdd"
           >新建文件夹</el-button>
         <el-button type="danger" size="small" @click="deleteFolder"
@@ -34,7 +35,7 @@
           ></el-option>
         </el-select>
         <el-select
-          style="width: 100px;"
+          style="margin-right: 10px; width: 100px;"
           v-loading="tagLoading2"
           v-model="check2"
           placeholder="年级"
@@ -49,6 +50,22 @@
             :value="item.id"
           ></el-option>
         </el-select>
+        <el-select
+          style="width: 100px;"
+          v-loading="tagLoading3"
+          v-model="check3"
+          placeholder="自定义"
+          clearable
+          filterable
+          @change="serchFile()"
+        >
+          <el-option
+            v-for="(item, index) in tagData3"
+            :key="index"
+            :label="item.name"
+            :value="item.name"
+          ></el-option>
+        </el-select>
       </div>
       <div class="f_box_top_right">
         <div class="input">
@@ -153,9 +170,10 @@
         </el-table>
       </div>
       <el-pagination
+        class="pageBox"
         style="margin-top: 10px;"
         background
-        layout="prev, pager, next"
+        layout="total, prev, pager, next"
         :page-size="10"
         :total="total"
         @current-change="handleCurrentChange"
@@ -279,6 +297,7 @@ export default {
         this.getData();
         this.getTagArray(1);
         this.getTagArray(2);
+        this.getTagArray(3);
       }
     }
   },
@@ -310,10 +329,13 @@ export default {
       total: 0,
       tagLoading1: false,
       tagLoading2: false,
+      tagLoading3: false,
       tagData1: [],
       tagData2: [],
+      tagData3: [],
       check1: [],
-      check2: []
+      check2: [],
+      check3: []
     };
   },
   computed: {
@@ -396,11 +418,12 @@ export default {
         n: this.fileName.trim(),
         sub: this.check1,
         class: this.check2,
+        tag: this.check3,
         page: this.page,
         num: 10
       };
       this.ajax
-        .post(this.$store.state.fileApi + "getFolderPage", [params])
+        .post(this.$store.state.fileApi + "getFolderPage3", [params])
         .then(res => {
           this.isLoading = false;
           this.total = res.data[0].length ? res.data[0][0].num : 0;
@@ -961,4 +984,11 @@ export default {
 .list_file_box {
   width: 100%;
 }
+
+.pageBox{
+  display: flex;
+}
+.pageBox >>> .el-pagination__total{
+  margin-right: auto;
+}
 </style>

+ 10 - 1
src/components/pages/knowledge/folderFileBox.vue

@@ -5,6 +5,7 @@
         <div class="f_box_top_title">文件</div>
       </div>
       <div class="f_box_top_right">
+        <span v-if="checkArray.length" style="margin-right: 10px;color: #b0b0b0;font-size: 14px;">已选文件{{checkArray.length}}个</span>
         <el-button type="primary" size="small" @click="serchFile"
           >刷新</el-button
         >
@@ -164,9 +165,10 @@
         </el-table>
       </div>
       <el-pagination
+        class="pageBox"
         style="margin-top: 10px"
         background
-        layout="prev, pager, next"
+        layout="total, prev, pager, next"
         :page-size="limit"
         :total="total"
         @current-change="handleCurrentChange"
@@ -1034,4 +1036,11 @@ export default {
   white-space: nowrap;
   text-overflow: ellipsis;
 }
+
+.pageBox{
+  display: flex;
+}
+.pageBox >>> .el-pagination__total{
+  margin-right: auto;
+}
 </style>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä