diff --git a/src/views/gameswitch/index.vue b/src/views/gameswitch/index.vue
index 2126b75..9e63585 100644
--- a/src/views/gameswitch/index.vue
+++ b/src/views/gameswitch/index.vue
@@ -99,6 +99,13 @@
+
+ 全选
+
{{ server.label }}
@@ -174,6 +181,8 @@ export default {
audit_is_open: 0,
serverList: []
},
+ isInterminate: false,
+ checkAll: false,
dialogFormVisible: false,
dialogStatus: '',
listLoading: true,
@@ -208,6 +217,9 @@ export default {
this.dialogStatus = 'update'
this.dialogTitle = '编辑'
this.dialogFormVisible = true
+ const checkedcount = this.form.serverList.length
+ this.checkAll = this.servers.length === checkedcount
+ this.isInterminate = checkedcount > 0 && checkedcount < this.servers.length
this.$nextTick(() => {
this.$refs['form'].clearValidate()
})
@@ -316,8 +328,19 @@ export default {
}
})
},
- handleCheckServersChange() {
- return
+ handleCheckServersChange(value) {
+ const checkedCount = value.length
+ this.checkAll = checkedCount > 0 && checkedCount === this.form.serverList.length
+ this.isInterminate = checkedCount > 0 && checkedCount < this.servers.length
+ },
+ CheckAllChange(value) {
+ this.form.serverList = []
+ if (value) {
+ this.servers.forEach((item, index) => {
+ this.form.serverList.push(item.key)
+ })
+ }
+ this.isInterminate = false
}
}
}