Commit 6f012d2c by 姜雷

修改限定运营商的区域选择组件

parent 99c60db1
......@@ -37,24 +37,34 @@ export default {
default: true,
},
},
data() {
return {
selectedAll: false,
};
},
mixins: [areaMixin],
methods: {
changeHandle(val) {
if (val) {
if (val && val.length && val.indexOf(-1) > -1) {
if (val.length === this.dashboardArea.length + 1) {
if (val.length === this.dashboardArea.length) {
this.selectedAll = false;
this.$emit('input', val.filter(id => id !== -1));
} else {
this.selectedAll = true;
this.$emit('input', [
...this.dashboardArea.map(item => item.id),
-1,
]);
}
} else {
if (this.selectedAll) {
this.selectedAll = false;
this.$emit('input', []);
return;
} else {
this.$emit('input', this.dashboardArea.map(item => item.id));
return;
this.$emit('input', val);
}
}
// if (this.multiple && val.length == 0) {
// this.$emit('input', this.dashboardArea.map(item => item.id));
// } else {
this.$emit('input', val);
// }
} else {
this.$emit('input', null);
}
......
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