ソースを参照

完成了分组文档模块初步搭建,文档管理下的个人文档的上传模块的标签去重和限制数量

yxc 2 年 前
コミット
76286a6bd8

+ 12 - 6
src/router/index.js

@@ -105,8 +105,14 @@ export const constantRoutes = [{
         component: () => import('@/views1/Retrieval/List/ListView.vue')
       },
       {
-        path: "/home/file",
-        component: () => import('@/views1/File/FileView.vue')
+        path: "/home/file/",
+        component: () => import('@/views1/File/FileView.vue'),
+        children: [
+          {
+          path: 'Storage',
+          component: () => import('@/views1/File/Storage/StorageView.vue'),
+        },
+      ]
       },
       {
         path: "/home/file/part",
@@ -141,12 +147,12 @@ export const constantRoutes = [{
         component: () => import('@/views1/Personal/PersonalView.vue'),
         children: [
           {
-          path: 'Storages',
-          component: () => import('@/views1/Personal/Storages/StoragesView.vue'),
+          path: 'Storagespace',
+          component: () => import('@/views1/Personal/Storagespace/StoragespaceView.vue'),
         },
         {
-          path: 'GroupSpace/space/:groupId(\\d+)',
-          component: () => import('@/views1/Personal/Storages/GroupSpace.vue'),
+          path: 'Groupspace/space/:groupId(\\d+)',
+          component: () => import('@/views1/Personal/Storagespace/Groupspace.vue'),
         },
         {
           path: 'Partspace',

+ 28 - 11
src/views1/File/Individual/IndividualView.vue

@@ -547,27 +547,34 @@ export default {
     },
 
     showInput() {
-      this.inputVisible = true;
-      this.$nextTick((_) => {
+      if(this.dynamicTags.length>=5){
+        this.inputVisible = false;
+        alert("标签数不允许超过五个")
+      }else{
+        this.inputVisible = true;
+        this.$nextTick((_) => {
         this.$refs.saveTagInput.$refs.input.focus();
       });
+      }
+
     },
     //固定的标签
     handleInputConfirm1(tag) {
-      this.dynamicTags.push(
-        // {
-        //   tagId:tag.id,
-        //   tagName:tag.name,
+      if(this.dynamicTags.indexOf(tag.tagName)==-1){
+        this.dynamicTags.push(
         tag.tagName
-        // }
       );
       this.form.tagList.push({
         tagId: tag.tagId,
         tagName: tag.tagName,
       });
-      if(this.dynamicTags.length>3){
-        alert(111)
+      }
+
+      if(this.dynamicTags.length>5){
+        alert("标签数不允许超过五个")
+        this.dynamicTags.pop()
       };
+    
     },
     //自定义标签
     handleInputConfirm() {
@@ -580,9 +587,15 @@ export default {
       // this.form.tagList.push({
       //   tagName:inputValue,
       // });
-      //查询输入的标签是否存在
+      //查询输入的标签在固定标签里是否存在
       var Newtags = this.tags.find((value) => value.tagName == inputValue);
       // console.log(a);
+    if(this.dynamicTags.indexOf(inputValue)!=-1){
+      this.dynamicTags.pop()
+      this.form.tagList.pop()
+    }
+
+
 
       if (inputValue) {
         this.dynamicTags.push(inputValue);
@@ -600,6 +613,10 @@ export default {
         });
       }
       // console.log(this.form);
+      if(this.dynamicTags.length>5){
+        alert("标签数不允许超过五个")
+        this.dynamicTags.pop()
+      };
     },
 
     /** 转换目录信息数据结构 */
@@ -791,7 +808,7 @@ export default {
       });
    
       // console.log(this.dynamicTags.length);
-      // console.log(this.form);
+      console.log(this.form);
       // console.log(this.dynamicTags);
      
     },

+ 11 - 0
src/views1/File/Storage/StorageView.vue

@@ -0,0 +1,11 @@
+<template>
+<h1>分组文档</h1>
+</template>
+
+<script>
+
+</script>
+
+<style scoped lang='scss'>
+
+</style>

+ 2 - 1
src/views1/HomeView.vue

@@ -55,6 +55,7 @@
             </template>
             <el-menu-item index="/home/file/part" >部门文档</el-menu-item>
             <el-menu-item index="/home/file/publi" >公共文档</el-menu-item>
+            <el-menu-item index="/home/file/Storage" >分组文档</el-menu-item>
             <el-menu-item index="/home/file/individual" >个人文档</el-menu-item>
             <el-menu-item index="/home/file/set" >文档设置</el-menu-item>
             <el-menu-item index="/home/file/level" >文档级别</el-menu-item>
@@ -77,7 +78,7 @@
             <el-menu-item index="/home/personal/Publispace"
               >公共存储空间</el-menu-item
             >
-            <el-menu-item index="/home/personal/Storages"
+            <el-menu-item index="/home/personal/Storagespace"
               >分组存储空间</el-menu-item
             >
             <el-menu-item index="/home/personal/space"

+ 4 - 75
src/views1/Personal/Publispace/PublispaceView.vue

@@ -73,21 +73,9 @@
     delDir,
     addDir,
     updateDir,
-    deptList
+    publicList
   } from "@/api/doc/dir";
 
-  import {
-    getDeptSpace
-  } from "@/api/doc/space";
-
-  import {
-    listExpand,
-    getExpand,
-    delExpand,
-    addExpand,
-    updateExpand
-  } from "@/api/doc/expand";
-
   import Treeselect from "@riophae/vue-treeselect";
   import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
@@ -137,47 +125,19 @@
             message: "上级目录不能为空",
             trigger: "blur"
           }],
-        },
-        // 表单校验
-        rulesSpace: {
-          expandCap: [{
-            required: true,
-            message: "扩容容量不能为空",
-            trigger: "blur"
-          }],
-          remark: [{
-            required: true,
-            message: "申请理由不能为空",
-            trigger: "blur"
-          }],
-        },
-        percentage:0
+        }
       };
     },
     created() {
       this.getList();
-      // this.spaceInfo();
     },
     methods: {
-      /** 查询个人空间相关信息 */
-      spaceInfo() {
-        this.loading = true;
-        getDeptSpace().then(response => {
-          this.spaceData = response.data;
-          this.loading = false;
-        });
-      },
       /** 查询目录信息列表 */
       getList() {
         this.loading = true;
-        deptList().then(response => {
+        publicList().then(response => {
           this.dirList = this.handleTree(response.data, "dirId");
           this.loading = false;
-          getDeptSpace().then(response => {
-            this.spaceData = response.data;
-            this.loading = false;
-            return this.percentage =(this.spaceData.usedCap/this.spaceData.spaceCap)*100;
-          });
         });
       },
       /** 转换目录信息数据结构 */
@@ -238,26 +198,7 @@
         }
         this.open = true;
         this.title = "添加目录信息";
-        deptList().then(response => {
-          this.form.spaceId = response.data[0].spaceId;
-          this.dirOptions = this.handleTree(response.data, "dirId");
-        });
-      },
-      /** 扩容申请 */
-      handleExpand(row) {
-        this.formSpace.currentCap = this.spaceData.spaceCap;
-        this.formSpace.spaceId = this.spaceData.spaceId;
-        this.formSpace.spaceName = this.spaceData.spaceName;
-        this.reset();
-        // this.getTreeselect();
-        if (row != null && row.dirId) {
-          this.form.parentId = row.dirId;
-          // } else {
-          // 	this.form.parentId = 0;
-        }
-        this.openSpace = true;
-        this.title = "扩容申请";
-        deptList().then(response => {
+        publicList().then(response => {
           this.form.spaceId = response.data[0].spaceId;
           this.dirOptions = this.handleTree(response.data, "dirId");
         });
@@ -305,18 +246,6 @@
           }
         });
       },
-      /** 提交按钮 */
-      submitFormSpace() {
-        console.log(this.formSpace);
-        this.$refs["formSpace"].validate(valid => {
-          if (valid) {
-            addExpand(this.formSpace).then(response => {
-              this.$modal.msgSuccess("扩容申请提交成功");
-              this.openSpace = false;
-            });
-          }
-        });
-      },
       /** 删除按钮操作 */
       handleDelete(row) {
         this.$modal.confirm('是否确认删除目录信息编号为"' + row.dirId + '"的数据项?').then(function() {

+ 1 - 5
src/views1/Personal/Storages/GroupSpace.vue → src/views1/Personal/Storagespace/Groupspace.vue

@@ -301,7 +301,7 @@ export default {
      // 返回按钮
      handleClose() {
           const obj = {
-            path: "/home/personal/Storages"
+            path: "/home/personal/Storagespace"
           };
           this.$tab.closeOpenPage(obj);
         },
@@ -692,8 +692,4 @@ export default {
   border: none;
   color: #1890ff;
 }
-//重置按钮
-::v-deep .el-button + .el-button {
-    color: #1890ff;
-}
 </style>

+ 4 - 0
src/views1/Personal/Storages/StoragesView.vue → src/views1/Personal/Storagespace/StoragespaceView.vue

@@ -242,6 +242,10 @@
 // ::v-deep .el-form-item--small .el-form-item__content {
 //   width: calc(100vw * (220 / 1920));
 // }
+//重置按钮
+::v-deep .el-button + .el-button {
+    color: #1890ff;
+}
 
   </style>