fixed: 修复删除alert-message时报错的问题

This commit is contained in:
陈劲松
2020-04-09 16:48:23 +08:00
parent f56dec7a01
commit 4aac1a7c20
2 changed files with 12 additions and 6 deletions

View File

@@ -183,7 +183,7 @@
}, },
importBox: {show: false, title:this.$t('overall.exportExcel')}, importBox: {show: false, title:this.$t('overall.exportExcel')},
deleteBox: {show: false, ids: [], remark: ''}, deleteBox: {show: false, ids: "", remark: '', state: 2},
tableTitle: [ tableTitle: [
{ {
@@ -329,6 +329,7 @@
this.$put("alert/message", this.deleteBox).then(res => { this.$put("alert/message", this.deleteBox).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.deleteBox.show = false;
this.getAlertList(); this.getAlertList();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
@@ -336,10 +337,12 @@
}) })
}, },
selectChange(s) { selectChange(s) {
this.deleteBox.ids = []; let ids = [];
this.deleteBox.ids = "";
s.forEach(item => { s.forEach(item => {
this.deleteBox.ids.push(item.id); ids.push(item.id);
}); });
this.deleteBox.ids = ids.join(",");
}, },
exportCur:function(){ exportCur:function(){
this.exportExcel(this.searchLabel); this.exportExcel(this.searchLabel);

View File

@@ -196,7 +196,7 @@
//导出相关 //导出相关
importBox: {show: false, title:this.$t('overall.exportExcel')}, importBox: {show: false, title:this.$t('overall.exportExcel')},
deleteBox: {show: false, ids: [], remark: ''}, deleteBox: {show: false, ids: "", remark: '', state: 2},
tableId: 'alertListTable', //需要分页的table的id用于记录每页数量 tableId: 'alertListTable', //需要分页的table的id用于记录每页数量
showTopBtn: false, showTopBtn: false,
@@ -398,6 +398,7 @@
this.$put("alert/message", this.deleteBox).then(res => { this.$put("alert/message", this.deleteBox).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")}); this.$message({duration: 2000, type: 'success', message: this.$t("tip.deleteSuccess")});
this.deleteBox.show = false;
this.getAlertList(); this.getAlertList();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
@@ -405,10 +406,12 @@
}) })
}, },
selectChange(s) { selectChange(s) {
this.deleteBox.ids = []; let ids = [];
this.deleteBox.ids = "";
s.forEach(item => { s.forEach(item => {
this.deleteBox.ids.push(item.id); ids.push(item.id);
}); });
this.deleteBox.ids = ids.join(",");
}, },
showExportDialog() { showExportDialog() {
this.importBox.show = true; this.importBox.show = true;