[update] 修改bug79075

This commit is contained in:
lideqin
2023-12-06 09:55:04 +08:00
parent 67f1cc2700
commit 5587c57df2
3 changed files with 26 additions and 2 deletions
+1
View File
@@ -170,6 +170,7 @@ module.exports = {
addATable: '请添加一个表格', addATable: '请添加一个表格',
select: '选择', select: '选择',
attach: '附件', attach: '附件',
checkedAll: '全选',
// 树右键 // 树右键
treeRight: { treeRight: {
addFolder: 'Create New Folder', addFolder: 'Create New Folder',
+1
View File
@@ -173,6 +173,7 @@ module.exports = {
addATable: '请添加一个表格', addATable: '请添加一个表格',
select: '选择', select: '选择',
attach: '附件', attach: '附件',
checkedAll: '全选',
// 树右键 // 树右键
treeRight: { treeRight: {
addFolder: '新增文件夹', addFolder: '新增文件夹',
@@ -10,8 +10,11 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<template v-if="model && Object.keys(model).length > 0"> <template v-if="model && Object.keys(model).length > 0">
<a-checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange">
{{ $t('checkedAll') }}
</a-checkbox>
<div class="content-wrapper" ref="contentWrapper" @scroll="contentWrapperScroll"> <div class="content-wrapper" ref="contentWrapper" @scroll="contentWrapperScroll">
<a-checkbox-group @change="onCheckChange"> <a-checkbox-group v-model="checkedArr" @change="onCheckChange">
<template v-for="(item, key) in model"> <template v-for="(item, key) in model">
<p :key="key" class="time-p">{{ isCurrentDate(key) ? '最近' : key }}</p> <p :key="key" class="time-p">{{ isCurrentDate(key) ? '最近' : key }}</p>
<div v-for="arrItem in item" :key="arrItem.id" class="search-value-div"> <div v-for="arrItem in item" :key="arrItem.id" class="search-value-div">
@@ -55,6 +58,8 @@ export default {
width: 500, width: 500,
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
indeterminate: false,
checkAll: false,
model: {}, model: {},
page: { page: {
pageNo: 1, pageNo: 1,
@@ -70,7 +75,7 @@ export default {
open () { open () {
this.page = { this.page = {
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 20,
total: 0, total: 0,
pages: 0 pages: 0
} }
@@ -116,6 +121,7 @@ export default {
} }
this.page.pages = res.result.pages this.page.pages = res.result.pages
this.page.total = res.result.total this.page.total = res.result.total
this.indeterminate = !!this.checkedArr.length && this.checkedArr.length < this.dataList.length
for (const item of res.result.records) { for (const item of res.result.records) {
const modelKeys = Object.keys(this.model) const modelKeys = Object.keys(this.model)
if (!modelKeys.includes(item.createTime)) { if (!modelKeys.includes(item.createTime)) {
@@ -131,7 +137,17 @@ export default {
}, },
// 多选变化 // 多选变化
onCheckChange (checkedValue) { onCheckChange (checkedValue) {
console.log(checkedValue)
this.checkedArr = checkedValue this.checkedArr = checkedValue
this.indeterminate = !!checkedValue.length && checkedValue.length < this.dataList.length
this.checkAll = checkedValue.length === this.dataList.length
},
// 全选变化
onCheckAllChange (e) {
console.log(e)
this.checkedArr = e.target.checked ? this.dataList.map(item => item.id) : []
this.indeterminate = false
this.checkAll = e.target.checked
}, },
// 删除 // 删除
handleDelete (id) { handleDelete (id) {
@@ -145,6 +161,8 @@ export default {
this.model = {} this.model = {}
this.dataList = [] this.dataList = []
this.initData(1) this.initData(1)
this.indeterminate = !!this.checkedArr.length && this.checkedArr.length < this.dataList.length
this.checkAll = this.checkedArr.length === this.dataList.length
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
@@ -159,6 +177,8 @@ export default {
this.model = {} this.model = {}
this.dataList = [] this.dataList = []
this.initData(1) this.initData(1)
this.indeterminate = !!this.checkedArr.length && this.checkedArr.length < this.dataList.length
this.checkAll = this.checkedArr.length > 0 && this.checkedArr.length === this.dataList.length
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
@@ -170,6 +190,8 @@ export default {
this.model = {} this.model = {}
this.dataList = [] this.dataList = []
this.checkedArr = [] this.checkedArr = []
this.indeterminate = false
this.checkAll = false
} }
} }
} }