Browse Source

素材发布调整

qymljy 1 year ago
parent
commit
c9bbdf6119

+ 2 - 2
src/HManagement/archvies_mag/index.vue

@@ -66,7 +66,7 @@ export default {
       this.$refs.list.restChecked()
       this.folderChecked([])
     },
-    
+
     // 监听文件选择
     folderChecked (arr) {
       this.checklist = arr
@@ -99,4 +99,4 @@ export default {
 
 </script>
 <style>
-</style>
+</style>

+ 3 - 3
src/HManagement/archvies_mag/modules/download.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-button icon="el-icon-download" size="small" @click="clickDownload">下 载</el-button>
+  <el-button icon="el-icon-download" size="small" @click="clickDownload" v-show="checklist.length === 1">下 载</el-button>
 </template>
 
 <script>
@@ -31,7 +31,7 @@ export default {
       })
       window.open(res.url, '_self');
     },
-    
+
     // 一般附件下载
     dowFile (url) {
       window.open(url, '_self');
@@ -41,4 +41,4 @@ export default {
 
 </script>
 <style>
-</style>
+</style>

+ 29 - 10
src/HManagement/archvies_mag/modules/list.vue

@@ -5,6 +5,7 @@
         <slot name="upload"></slot>
         <slot name="add"></slot>
         <slot name="btngroup"></slot>
+        <el-button style="margin-left: 10px" :type="checkArray.length == list.length ? '' : 'primary'" size="small" @click="selectAll">{{checkArray.length == list.length ? '取消全选':'全选'}}</el-button>
       </div>
       <div class="flex-align-center">
         <el-input size="small" style="width:160px;margin-right:16px" prefix-icon="el-icon-search"
@@ -123,7 +124,8 @@ export default {
         filename: '文件',
         id: null,
       }],
-      seeFileData:''
+      seeFileData:'',
+      checkArray:[]
     }
   },
   methods: {
@@ -148,11 +150,15 @@ export default {
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
+      this.checkArray = []
+      this.$emit('folderChecked', this.checkArray)
       this.params.content.pageSize = val
       this.queryAttachment(this.params.content.parentid)
     },
     handleCurrentChange(val) {
       // console.log(`当前页: ${val}`);
+      this.checkArray = []
+      this.$emit('folderChecked', this.checkArray)
       this.params.content.pageNumber = val
       this.queryAttachment(this.params.content.parentid)
     },
@@ -160,17 +166,32 @@ export default {
       this.$emit('onNameChange', folder)
     },
     onChange(folder) {
-      let checkArray = []
+      this.checkArray = []
       this.list.forEach((e, index) => {
         if (e.ischeck === true) {
-          checkArray.push(e)
+          this.checkArray.push(e)
         }
       })
-      this.$emit('folderChecked', checkArray)
+      this.$emit('folderChecked', this.checkArray)
     },
     onSelect(folder){
-      /*this.list[folder.rowindex -1].ischeck = this.list[folder.rowindex -1].ischeck == true ? false : true*/
      /* this.list[folder.rowindex -1].ischeck = true*/
+      this.list[folder.rowindex -1].ischeck = this.list[folder.rowindex -1].ischeck == true ? false : true
+      this.onChange()
+     /* this.list[folder.rowindex -1].ischeck = true*/
+    },
+    /*全选*/
+    selectAll(){
+      if (this.list.length == this.checkArray.length){
+        this.list.forEach(item=>{
+          item.ischeck = false
+        })
+      }else {
+        this.list.forEach(item=>{
+          item.ischeck = true
+        })
+      }
+      this.onChange()
     },
     folderDblclick(folder){
       this.seeFileData = folder
@@ -178,11 +199,9 @@ export default {
           || folder.postfix == 'gif' || folder.postfix == 'GIG' || folder.postfix == 'WEBP' || folder.postfix == 'webp' || folder.postfix == 'svg' || folder.postfix == 'SVG'
           || folder.postfix == 'TIFF' || folder.postfix == 'tiff' || folder.postfix == 'MP4' || folder.postfix == 'mp4' || folder.postfix == 'ogg' || folder.postfix == 'webm' ){
         this.$refs.seeFile.dialogVisible = true
-      }else if (folder.postfix == 'doc' || folder.postfix == 'docx' || folder.postfix == 'DOC' || folder.postfix == 'DOCX' || folder.postfix == 'XLS' || folder.postfix == 'XLSX'
-          || folder.postfix == 'xls' || folder.postfix == 'xlsx' || folder.postfix == 'ppt' || folder.postfix == 'pptx'
-          || folder.postfix == 'PPT' || folder.postfix == 'PPTX'  || folder.postfix == 'PDF' || folder.postfix == 'pdf'){
-     /*   window.open(folder.url)*/
-        window.open(folder.url, '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes')
+      }else if (folder.postfix == 'PDF' || folder.postfix == 'pdf'){
+        window.open(folder.url,'_blank')
+        /*window.open(folder.url, '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes')*/
       }else {
         this.$notify({
           title:'提示',