From 2e39479b36c2edc86dbb778af612fc460c2cfa46 Mon Sep 17 00:00:00 2001 From: zhangrui Date: Thu, 16 Apr 2026 11:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E7=89=8C=E6=B4=BB=E5=8A=A8=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E7=B1=BB=E5=9E=8B=E4=B8=8D=E8=83=BD=E5=88=A0=E9=99=A4?= =?UTF-8?q?=EF=BC=88val=EF=BC=9Acode=EF=BC=89,=E5=A4=9A=E4=B8=AA=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E7=94=A8=E8=8B=B1=E6=96=87=E9=80=97=E5=8F=B7=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/commons/CommonController.java | 7 ++++++ .../zhgh/activity/trainSingUp/type/index.html | 25 +++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/budwk/app/web/controllers/open/commons/CommonController.java b/src/main/java/com/budwk/app/web/controllers/open/commons/CommonController.java index a603a62..e9b9f67 100644 --- a/src/main/java/com/budwk/app/web/controllers/open/commons/CommonController.java +++ b/src/main/java/com/budwk/app/web/controllers/open/commons/CommonController.java @@ -172,4 +172,11 @@ public class CommonController { return Result.success(count > 0); } + @At + @SaCheckLogin + @ApiOperation("系统配置") + public Result getConfigKeyObj(String key) { + return Result.success().addData(sysDictService.dao().fetch(Sys_config.class, Cnd.where("configKey", "=", key))); + } + } diff --git a/src/main/resources/views/platform/zhgh/activity/trainSingUp/type/index.html b/src/main/resources/views/platform/zhgh/activity/trainSingUp/type/index.html index 0e63808..45cf81a 100644 --- a/src/main/resources/views/platform/zhgh/activity/trainSingUp/type/index.html +++ b/src/main/resources/views/platform/zhgh/activity/trainSingUp/type/index.html @@ -240,7 +240,8 @@ layout("/layouts/platform.html"){ fileType: [{ required: true, message: "请选择文件类型", trigger: ["blur"] }], fileNumber: [{ required: true, message: "请输入文件个数", trigger: ["blur", "change"] }] }, - choose: {} + choose: {}, + dictControlTypeCannotDeleteCodeList: [] } }, methods: { @@ -296,7 +297,7 @@ layout("/layouts/platform.html"){ } else if (type == "edit") { this.openEdit(data) } else if (type == "delete") { - this.doDelete(data.id) + this.doDelete(data) } else if (type == "bottom") { this.rowChange(data, true) } @@ -386,14 +387,18 @@ layout("/layouts/platform.html"){ } }) }, - doDelete(id) { + doDelete(data) { + if(this.dictControlTypeCannotDeleteCodeList.includes(data.code)){ + this.$message.warning("类型编码:" + data.code + ", 已配置不能删除!"); + return ; + } this.$confirm("此操作将删除类型,确认删除吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }) .then(() => { - this.$axios.post(loc() + "/doDelete", { id: id }).then((res) => { + this.$axios.post(loc() + "/doDelete", { id: data.id }).then((res) => { if (res.code === 0) { this.doSearch() this.$message.success(res.msg) @@ -409,10 +414,20 @@ layout("/layouts/platform.html"){ async getEnumOptions() { const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: "ColumnFormTypeEnum" }) return resp.data - } + }, + async getConfigKeyObj() { + //该参数控制哪些类型不能删除(val: code) + const resp = await this.$axios.post("/open/common/getConfigKeyObj", { key: "dictControlTypeCannotDeleteCodeList" }) + if(resp.data?.configValue){ + this.dictControlTypeCannotDeleteCodeList = resp.data.configValue.split(","); + } else { + return "暂无配置提示内容"; + } + } }, async created() { await this.getColTypeOptions() + await this.getConfigKeyObj() this.columnFormTypeList = await this.getEnumOptions() this.pageData() }