Commit 593aaaed by 姜雷

修改运营商区域的多选模式下全选规则

parent 46f8ac51
......@@ -83,21 +83,23 @@ export default {
methods: {
changeHandle(val) {
if (val) {
if (this.selectedAll) {
if (val && val.length && val.indexOf(-1) > -1) {
if (val.length === this.dashboardArea.length) {
this.selectedAll = false;
this.$emit('input', val.filter(id => id !== -1));
} else {
this.$emit('input', []);
}
this.selectedAll = false;
} else {
if (val && val.length && val.indexOf(-1) > -1) {
this.selectedAll = true;
this.$emit('input', [
...this.dashboardArea.map(item => item.id),
-1,
]);
}
} else {
if (this.selectedAll) {
this.selectedAll = false;
this.$emit('input', []);
} else if (val.length === this.dashboardArea.length) {
this.selectedAll = true;
this.$emit('input', [...val, -1]);
} else {
this.$emit('input', val);
}
......
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