feat(智能柜): 新增商店名称字段并优化配置刷新逻辑
在智能柜DTO中新增`shopName`字段,用于显示柜体归属商店名称。同时,在商店配置和网关配置模态框中添加`refresh`事件,确保配置成功后刷新列表数据
This commit is contained in:
parent
5eb7ae6f00
commit
b9bd840bea
|
@ -13,6 +13,7 @@ export interface SmartCabinetDTO {
|
||||||
cabinetType: number;
|
cabinetType: number;
|
||||||
mqttServerId?: number;
|
mqttServerId?: number;
|
||||||
shopId?: number;
|
shopId?: number;
|
||||||
|
shopName?: string;
|
||||||
templateNo: string;
|
templateNo: string;
|
||||||
lockControlNo: number;
|
lockControlNo: number;
|
||||||
location: number;
|
location: number;
|
||||||
|
|
|
@ -28,7 +28,7 @@ const props = defineProps<{
|
||||||
cabinetId: number;
|
cabinetId: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue', 'refresh']);
|
||||||
|
|
||||||
const visible = ref(props.modelValue);
|
const visible = ref(props.modelValue);
|
||||||
const mqttList = ref<MqttServerDTO[]>([]);
|
const mqttList = ref<MqttServerDTO[]>([]);
|
||||||
|
@ -83,6 +83,7 @@ const handleConfig = async (row: MqttServerDTO) => {
|
||||||
});
|
});
|
||||||
ElMessage.success('配置成功');
|
ElMessage.success('配置成功');
|
||||||
emit('update:modelValue', false);
|
emit('update:modelValue', false);
|
||||||
|
emit('refresh');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('配置失败', error);
|
console.error('配置失败', error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ const props = defineProps<{
|
||||||
cabinetId: number;
|
cabinetId: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue', 'refresh']);
|
||||||
|
|
||||||
const visible = ref(props.modelValue);
|
const visible = ref(props.modelValue);
|
||||||
const shopList = ref<ShopDTO[]>([]);
|
const shopList = ref<ShopDTO[]>([]);
|
||||||
|
@ -82,6 +82,7 @@ const handleConfig = async (row: ShopDTO) => {
|
||||||
});
|
});
|
||||||
ElMessage.success('配置成功');
|
ElMessage.success('配置成功');
|
||||||
emit('update:modelValue', false);
|
emit('update:modelValue', false);
|
||||||
|
emit('refresh');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('配置失败', error);
|
console.error('配置失败', error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ const pagination = ref({
|
||||||
});
|
});
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const dataList = ref([]);
|
const dataList = ref<SmartCabinetDTO[]>([]);
|
||||||
const multipleSelection = ref<number[]>([]);
|
const multipleSelection = ref<number[]>([]);
|
||||||
const editVisible = ref(false);
|
const editVisible = ref(false);
|
||||||
const currentRow = ref<SmartCabinetDTO>();
|
const currentRow = ref<SmartCabinetDTO>();
|
||||||
|
@ -185,6 +185,7 @@ getList();
|
||||||
@selection-change="handleSelectionChange" border>
|
@selection-change="handleSelectionChange" border>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column label="柜体名称" prop="cabinetName" />
|
<el-table-column label="柜体名称" prop="cabinetName" />
|
||||||
|
<el-table-column label="归属商店" prop="shopName" width="120" />
|
||||||
<el-table-column label="柜体类型" prop="cabinetType" width="120">
|
<el-table-column label="柜体类型" prop="cabinetType" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.cabinetType === 0 ? '主柜' : '副柜' }}
|
{{ row.cabinetType === 0 ? '主柜' : '副柜' }}
|
||||||
|
@ -225,7 +226,7 @@ getList();
|
||||||
</PureTableBar>
|
</PureTableBar>
|
||||||
<smart-cabinet-form-modal v-model:visible="modalVisible" @refresh="getList" />
|
<smart-cabinet-form-modal v-model:visible="modalVisible" @refresh="getList" />
|
||||||
<smart-cabinet-edit-modal v-model:visible="editVisible" :row="currentRow" @refresh="getList" />
|
<smart-cabinet-edit-modal v-model:visible="editVisible" :row="currentRow" @refresh="getList" />
|
||||||
<GatewayConfigModal v-model="gatewayConfigVisible" :cabinet-id="currentCabinetId" />
|
<GatewayConfigModal v-model="gatewayConfigVisible" :cabinet-id="currentCabinetId" @refresh="getList" />
|
||||||
<ShopConfigModal v-model="shopConfigVisible" :cabinet-id="currentCabinetId" />
|
<ShopConfigModal v-model="shopConfigVisible" :cabinet-id="currentCabinetId" @refresh="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
Loading…
Reference in New Issue