diff --git a/src/views/Home.vue b/src/views/Home.vue index bed6138..93deec5 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -179,40 +179,49 @@ export default { lcIdList.push(this.multipleSelection[i].lcId) nameList.push(this.multipleSelection[i].name) } - this.$confirm(`此操作将永久删除【${nameList}】判分点, 是否继续?`, "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - center: true - }).then(() => { - if (this.systemId == 11) { - // 交易类 - this.$post(`${this.api.deleteJudgmentPoint}?ids=${lcIdList}`).then(res => { - if (res.status === 200) { - this.$message.success("删除成功"); - this.initData(); - } else { - this.$message.error(res.message); - } - }).catch(err => { - console.log(err); - }); - } else { - // 编程类 - this.$post(`${this.api.bcDeleteJudgmentPoint}?ids=${bcIdList}`).then(res => { - if (res.status === 200) { - this.$message.success("删除成功"); - this.initData(); - } else { - this.$message.error(res.message); - } - }).catch(err => { - console.log(err); - }); - } - }).catch(() => { - this.$message.info("已取消删除"); - }); + if (nameList.length > 0){ + this.$confirm(`此操作将永久删除【${nameList}】判分点, 是否继续?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + center: true + }).then(() => { + if (this.systemId == 11) { + // 交易类 + this.$post(`${this.api.deleteJudgmentPoint}?ids=${lcIdList}`).then(res => { + if (res.status === 200) { + this.$message.success("删除成功"); + this.initData(); + } else { + this.$message.error(res.message); + } + }).catch(err => { + console.log(err); + }); + } else { + // 编程类 + this.$post(`${this.api.bcDeleteJudgmentPoint}?ids=${bcIdList}`).then(res => { + if (res.status === 200) { + this.$message.success("删除成功"); + this.initData(); + } else { + this.$message.error(res.message); + } + }).catch(err => { + console.log(err); + }); + } + }).catch(() => { + this.$message.info("已取消删除"); + }); + }else{ + this.$alert('请选择需要删除的判分点', '提示', { + confirmButtonText: '好的', + callback: action => { + + } + }); + } }, getProgrammingClassData(params) { // 获取编程类判分点列表数据 this.$post(this.api.getBcJudgmentPoint, params).then(res => {