修复bug

This commit is contained in:
宋伟佳
2021-07-14 17:15:50 +08:00
parent 9b02ed06a5
commit 8b4e61300d
9 changed files with 60 additions and 49 deletions
@@ -295,19 +295,18 @@ export default {
},
// 批量删除
deleteSarAccess(flag, id) {
if (flag === "delOne") {
if (flag === 'delOne') {
this.selectedList = [];
this.selectedList[0] = id;
}
if (!this.selectedList.length) {
this.$message.warning("请选择要删除的数据");
if (this.selectedList.length === 0) {
this.$message.warning('请选择要删除的数据')
} else {
this.$confirm("确认删除选中数据?", "确认删除", {
confirmButtonText: "确定",
cancelButtonText: "取消",
confirmButtonClass: "common-button-primary",
roundButton: false,
type: "warning"
this.$confirm('确定删除这些数据?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const URL = `sarLawsDetailedList/sar-laws-detailed-list/deleteListAll?idList=${this.selectedList.join(',')}`
this.$http.postDelete(URL, {}, res => {
@@ -317,7 +316,8 @@ export default {
}, e => {
});
}).catch(() => {
});
})
}
},
// 表格选择框
@@ -300,31 +300,31 @@ export default {
name: "OtherAddEit"
});
},
// 删除
//批量删除
deleteSarAccess(flag, id) {
if (flag === "delOne") {
if (flag === 'delOne') {
this.selectedList = [];
this.selectedList[0] = id;
}
if (this.selectedList.length === 0) {
this.$message.warning("请选择要删除的数据");
this.$message.warning('请选择要删除的数据')
} else {
this.$confirm("确认删除这些数据?", "提示", {
confirmButtonText: "确认",
confirmButtonClass: "common-button-primary",
cancelButtonText: "取消",
type: "warning"
this.$confirm('确定删除这些数据?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const URL = `sarLawsDetailedList/sar-laws-detailed-list/deleteListAll?idList=${this.selectedList.join(",")}`;
const URL = `sarLawsDetailedList/sar-laws-detailed-list/deleteListAll?idList=${this.selectedList.join(',')}`
this.$http.postDelete(URL, {}, res => {
this.searchSarAccess();
this.selectedList = [];
this.$message.success("删除成功");
this.$message.success('删除成功')
}, e => {
});
}).catch(() => {
});
})
}
},
// 表格选择框
@@ -309,7 +309,7 @@ export default {
this.selectedList = [];
this.selectedList[0] = id;
}
if (this.selectedList === 0) {
if (this.selectedList.length === 0) {
this.$message.warning('请选择要删除的数据')
} else {
this.$confirm('确定删除这些数据?', '提示', {
@@ -329,7 +329,6 @@ export default {
})
}
},
// 表格选择框
selectOne(data) {