element 二次确认框,内容自定义处理
上代码:
async inspectionTypeOff(row) {console.log(row.id);let taskArray = await this.getTaskList(row.id); // 查询关联的任务console.log("taskArray", taskArray);let messageTip =taskArray.length > 0? `<div><p>确认禁用巡检项(巡检项名称:${row.name})吗?</p><p style='color: #E6A23C'><i class='el-icon-warning'></i>该巡检项已被定时任务${taskArray.join("、")}关联,禁用后将同步更新任务中该巡检项状态,同时任务中不执行该巡检项</p></div>`: `<p>确认禁用巡检项(巡检项名称:${row.name})吗?</p>`;this.$alert(messageTip, "禁用巡检项", {dangerouslyUseHTMLString: true,confirmButtonText: "确定",cancelButtonText: "取消",}).then(() => {requestMethod.inspectionOff("put", row.id).then((res) => {if (res.status) {// 按照左侧数据筛选,重新获取列表数据this.$message.success(res.message || "操作成功");this.getDataList("", "", "", this.categoryId, true);}});}).catch(() => {this.$message({type: "info",message: "已取消禁用",});});},