mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-05 20:00:25 +08:00
实现批量删除网站功能
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user