From b9bd840bea218d4f4dcd43fc072c7a3bb617cb8a Mon Sep 17 00:00:00 2001 From: dzq Date: Tue, 13 May 2025 17:06:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=99=BA=E8=83=BD=E6=9F=9C):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=95=86=E5=BA=97=E5=90=8D=E7=A7=B0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在智能柜DTO中新增`shopName`字段,用于显示柜体归属商店名称。同时,在商店配置和网关配置模态框中添加`refresh`事件,确保配置成功后刷新列表数据 --- src/api/cabinet/smart-cabinet.ts | 1 + src/views/cabinet/smart-cabinet/GatewayConfigModal.vue | 3 ++- src/views/cabinet/smart-cabinet/ShopConfigModal.vue | 3 ++- src/views/cabinet/smart-cabinet/index.vue | 7 ++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/api/cabinet/smart-cabinet.ts b/src/api/cabinet/smart-cabinet.ts index 0ded6fa..d2dbc4f 100644 --- a/src/api/cabinet/smart-cabinet.ts +++ b/src/api/cabinet/smart-cabinet.ts @@ -13,6 +13,7 @@ export interface SmartCabinetDTO { cabinetType: number; mqttServerId?: number; shopId?: number; + shopName?: string; templateNo: string; lockControlNo: number; location: number; diff --git a/src/views/cabinet/smart-cabinet/GatewayConfigModal.vue b/src/views/cabinet/smart-cabinet/GatewayConfigModal.vue index 8fbb8e6..aa353ea 100644 --- a/src/views/cabinet/smart-cabinet/GatewayConfigModal.vue +++ b/src/views/cabinet/smart-cabinet/GatewayConfigModal.vue @@ -28,7 +28,7 @@ const props = defineProps<{ cabinetId: number; }>(); -const emit = defineEmits(['update:modelValue']); +const emit = defineEmits(['update:modelValue', 'refresh']); const visible = ref(props.modelValue); const mqttList = ref([]); @@ -83,6 +83,7 @@ const handleConfig = async (row: MqttServerDTO) => { }); ElMessage.success('配置成功'); emit('update:modelValue', false); + emit('refresh'); } catch (error) { console.error('配置失败', error); } diff --git a/src/views/cabinet/smart-cabinet/ShopConfigModal.vue b/src/views/cabinet/smart-cabinet/ShopConfigModal.vue index d01ccca..06ed08b 100644 --- a/src/views/cabinet/smart-cabinet/ShopConfigModal.vue +++ b/src/views/cabinet/smart-cabinet/ShopConfigModal.vue @@ -27,7 +27,7 @@ const props = defineProps<{ cabinetId: number; }>(); -const emit = defineEmits(['update:modelValue']); +const emit = defineEmits(['update:modelValue', 'refresh']); const visible = ref(props.modelValue); const shopList = ref([]); @@ -82,6 +82,7 @@ const handleConfig = async (row: ShopDTO) => { }); ElMessage.success('配置成功'); emit('update:modelValue', false); + emit('refresh'); } catch (error) { console.error('配置失败', error); } diff --git a/src/views/cabinet/smart-cabinet/index.vue b/src/views/cabinet/smart-cabinet/index.vue index 14e4b70..0e020b5 100644 --- a/src/views/cabinet/smart-cabinet/index.vue +++ b/src/views/cabinet/smart-cabinet/index.vue @@ -37,7 +37,7 @@ const pagination = ref({ }); const loading = ref(false); -const dataList = ref([]); +const dataList = ref([]); const multipleSelection = ref([]); const editVisible = ref(false); const currentRow = ref(); @@ -185,6 +185,7 @@ getList(); @selection-change="handleSelectionChange" border> + \ No newline at end of file