Sfoglia il codice sorgente

feat: 附件删除和上传添加配置hiddenSysFile

johnsen 4 mesi fa
parent
commit
970a3c2f87

+ 11 - 0
src/assets/styles/personalized/index.scss

@@ -11,3 +11,14 @@
     }
   }
 }
+
+.el-table__row {
+  .el-selector__tags {
+    width: 100% !important;
+  }
+  .el-selector__readonly-text {
+    input {
+      padding: 0 !important;
+    }
+  }
+}

+ 37 - 23
src/views/platform/file/attachment/list.vue

@@ -76,23 +76,6 @@ export default {
   },
   mixins: [FixHeight],
   data() {
-    const extType = [
-      'txt',
-      'pdf',
-      'doc',
-      'docx',
-      'xls',
-      'xlsx',
-      'ppt',
-      'pptx',
-      'wps',
-      'jpg',
-      'jpeg',
-      'png',
-      'gif',
-      'mp3',
-      'mp4'
-    ]
     return {
       dialogFormVisible: false, // 弹窗
       modifyNameVisible: false,
@@ -114,8 +97,32 @@ export default {
 
       listData: [],
       pagination: {},
-      sorts: {},
-      listConfig: {
+      sorts: {}
+    }
+  },
+  computed: {
+    setting() {
+      return this.$store.getters.setting
+    },
+    listConfig() {
+      const extType = [
+        'txt',
+        'pdf',
+        'doc',
+        'docx',
+        'xls',
+        'xlsx',
+        'ppt',
+        'pptx',
+        'wps',
+        'jpg',
+        'jpeg',
+        'png',
+        'gif',
+        'mp3',
+        'mp4'
+      ]
+      return {
         toolbars: [
           {
             key: 'search'
@@ -123,7 +130,8 @@ export default {
           {
             key: 'upLoad',
             label: '上传',
-            icon: 'ibps-icon-upload'
+            icon: 'ibps-icon-upload',
+            visible: !this.setting.hiddenSysFile
           },
           {
             key: 'downloadZip',
@@ -131,7 +139,8 @@ export default {
             icon: 'ibps-icon-download'
           },
           {
-            key: 'remove'
+            key: 'remove',
+            visible: !this.setting.hiddenSysFile
           }
         ],
         searchForm: {
@@ -188,7 +197,8 @@ export default {
               icon: 'ibps-icon-download'
             },
             {
-              key: 'remove'
+              key: 'remove',
+              visible: !this.setting.hiddenSysFile
             }
           ]
         }
@@ -292,7 +302,11 @@ export default {
               newTab.document.write('<style>body { margin: 0px; }</style>')
               newTab.document.head.appendChild(link)
               newTab.document.write(
-                `<iframe src="${this.$baseUrl}lib/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(url)}&hasRole=${hasRole}" style="width:100%; height:100%;" frameborder="0";>`
+                `<iframe src="${
+                  this.$baseUrl
+                }lib/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(
+                  url
+                )}&hasRole=${hasRole}" style="width:100%; height:100%;" frameborder="0";>`
               )
             })
           } else {