From f5c12be04d304684735e4fdea6c240597c901dc9 Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Mon, 23 Sep 2024 17:03:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E5=85=B3=E7=BD=91=E5=8D=A1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=83=BD=E5=A4=9F=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gatewayinfo/GatewayCardParamsMapper.java | 2 +- .../system/gatewayinfo/GatewayCardForm.vue | 2 -- imt-ui/src/views/system/gatewayinfo/index.vue | 32 +++++++++++++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayCardParamsMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayCardParamsMapper.java index 6cfdccf..b8e3b8e 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayCardParamsMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayCardParamsMapper.java @@ -35,7 +35,7 @@ public interface GatewayCardParamsMapper extends BaseMapperX selectList(String cardId) { return selectList(new LambdaQueryWrapperX() .eqIfPresent(GatewayCardParamsDO::getCardId, cardId) - .orderByAsc(GatewayCardParamsDO::getCreateTime) + .orderByAsc(GatewayCardParamsDO::getChannelName) ); } } \ No newline at end of file diff --git a/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue b/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue index 38b057c..49c4dc0 100644 --- a/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue +++ b/imt-ui/src/views/system/gatewayinfo/GatewayCardForm.vue @@ -199,11 +199,9 @@ export default { components: {}, data() { const checkRepeatName = (rule, value, callback) => { - console.log("需要检查的字段:", value); const repeatName = this.paramsForm.paramsList.filter( (e) => e.channelName == value ); - console.log("结果:", repeatName); if (repeatName.length > 1) { callback(new Error("通道名称不允许重复")); } else { diff --git a/imt-ui/src/views/system/gatewayinfo/index.vue b/imt-ui/src/views/system/gatewayinfo/index.vue index 62f5964..9d52666 100644 --- a/imt-ui/src/views/system/gatewayinfo/index.vue +++ b/imt-ui/src/views/system/gatewayinfo/index.vue @@ -101,6 +101,8 @@ :data="list" :stripe="true" :show-overflow-tooltip="true" + :row-key="rowKey" + :expand-row-keys="expandRowKeys" @expand-change="tableExpandChange" > 采集卡信息修改 + 删除 @@ -366,6 +375,7 @@ export default { ], cardLoading: false, expandGateway: {}, + expandRowKeys: [], }; }, created() { @@ -374,14 +384,21 @@ export default { methods: { tableExpandChange(row, e) { if (e.length != 0) { - console.log("展开数据:", row); - console.log("展开数据e:", e); + // console.log("展开数据:", row); + // console.log("展开数据e:", e); + if (e.length == 2) { + e.shift(); + } this.expandGateway = row; this.cardLoading = true; //加载该网关下的采集卡 this.getCardList(row.gatewayId); + this.expandRowKeys = e.map((item) => item.gatewayId); } }, + rowKey(row) { + return row.gatewayId; + }, async getCardList(id) { try { this.cardQueryParams.gatewayId = id; @@ -398,6 +415,17 @@ export default { openCardForm(id, row) { this.$refs["cardFormRef"].open(id, row, this.expandGateway); }, + async handleCardDelete(row) { + const cardId = row.cardId; + await this.$modal.confirm( + '是否确认删除机床网关信息编号为"' + cardId + '"的数据项?' + ); + try { + await GatewayCardInfoApi.deleteGatewayCardInfo(cardId); + await this.getList(); + this.$modal.msgSuccess("删除成功"); + } catch {} + }, /** 查询列表 */ async getList() { try {