Commit 969040e8 authored by 张海景's avatar 张海景

update:修改表格组件的问题

parent 6cf496fb
...@@ -823,12 +823,12 @@ export default { ...@@ -823,12 +823,12 @@ export default {
this.currentRow = {}; this.currentRow = {};
}, },
cellClick(row, index, column) { cellClick(row, index, column) {
this.isDisable = true; // this.isDisable = true;
setTimeout(() => { // setTimeout(() => {
this.isDisable = false; // this.isDisable = false;
console.log(row, index, 'rows'); console.log(row, index, 'rows cellClick');
this.$emit('cellClick', row, index, column); this.$emit('cellClick', row, index, column);
}, 500); // }, 500);
}, },
toggleRowSelection(row) { toggleRowSelection(row) {
// console.log(row, 'rows99') // console.log(row, 'rows99')
...@@ -854,6 +854,18 @@ export default { ...@@ -854,6 +854,18 @@ export default {
}); });
this.$emit('toggleRowSelection', true, this.selectArr); this.$emit('toggleRowSelection', true, this.selectArr);
} }
if (this.selectArr.length === this.transData.length) {
this.indeterminate = false;
this.checkedAll = true;
} else {
this.indeterminate = true;
this.checkedAll = false;
}
if (!this.selectArr.length) {
this.checkedAll = false;
this.indeterminate = false;
}
}, },
handleRadio(event) { handleRadio(event) {
const items = this.data.find((v) => v[this.rowKey] == event.target.value); const items = this.data.find((v) => v[this.rowKey] == event.target.value);
...@@ -862,16 +874,16 @@ export default { ...@@ -862,16 +874,16 @@ export default {
this.$emit('toggleRowSelection', true, this.selectArr); this.$emit('toggleRowSelection', true, this.selectArr);
}, },
rowClick(row, index) { rowClick(row, index) {
this.isDisable = true; // this.isDisable = true;
setTimeout(() => { // setTimeout(() => {
this.isDisable = false; // this.isDisable = false;
if (this.highlight) { if (this.highlight) {
this.currentRowIndex = index; this.currentRowIndex = index;
this.currentRow = row; this.currentRow = row;
this.$emit('currentChange', row, index); this.$emit('currentChange', row, index);
} }
this.$emit('rowClick', row, index); this.$emit('rowClick', row, index);
}, 500); // }, 500);
}, },
checkboxSelectedAll(e) { checkboxSelectedAll(e) {
this.indeterminate = false; this.indeterminate = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment