|
@@ -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:'提示',
|