实现批量删除网站功能

This commit is contained in:
GoEdgeLab
2024-01-11 18:40:29 +08:00
parent 2989c5bbcd
commit 8ff13c9117
7 changed files with 107 additions and 4 deletions

View File

@@ -55,4 +55,54 @@ Tea.context(function () {
this.showLatest = function () {
this.latestVisible = !this.latestVisible
}
/**
* 全选
*/
this.checkedServerIds = []
this.changeAllChecked = function (checked) {
for (let checkbox of this.$refs.serverCheckboxes) {
if (checked) {
checkbox.check()
} else {
checkbox.uncheck()
}
}
this.updateCheckedServers()
}
this.changeServerChecked = function () {
this.updateCheckedServers()
}
this.updateCheckedServers = function () {
let serverIds = []
for (let checkbox of this.$refs.serverCheckboxes) {
if (checkbox.isChecked()) {
serverIds.push(checkbox.vValue)
}
}
this.checkedServerIds = serverIds
}
this.resetCheckedServers = function () {
this.$refs.allCheckedCheckboxes.uncheck()
for (let checkbox of this.$refs.serverCheckboxes) {
checkbox.uncheck()
}
this.updateCheckedServers()
}
this.deleteServers = function () {
let that = this
teaweb.confirm("确定要删除所选的" + (this.checkedServerIds.length) + "个网站吗?", function () {
that.$post(".deleteServers")
.params({
serverIds: this.checkedServerIds
})
.success(function () {
teaweb.reload()
})
})
}
})