From e2f588ed9ae890b7f921d1fb0ae629cddc6c192c Mon Sep 17 00:00:00 2001 From: dzq Date: Fri, 9 May 2025 10:54:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=95=86=E5=BA=97=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=BA=97=E7=AE=A1=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=8F=8A=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E5=92=8C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在`smart-cabinet`接口中增加`shopId`字段,以支持商店配置 - 新增`shop.ts`接口文件,提供商店的增删改查功能 - 新增`ShopConfigModal.vue`组件,用于配置商店与智能柜的关联 - 新增`shop-form-modal.vue`组件,用于商店的新增和编辑 - 新增`shop/index.vue`页面,提供商店的列表展示和管理功能 --- src/api/cabinet/smart-cabinet.ts | 3 + src/api/shop/shop.ts | 49 +++++ src/views/cabinet/shop/index.vue | 174 ++++++++++++++++++ src/views/cabinet/shop/shop-form-modal.vue | 88 +++++++++ .../cabinet/smart-cabinet/ShopConfigModal.vue | 89 +++++++++ src/views/cabinet/smart-cabinet/index.vue | 11 ++ 6 files changed, 414 insertions(+) create mode 100644 src/api/shop/shop.ts create mode 100644 src/views/cabinet/shop/index.vue create mode 100644 src/views/cabinet/shop/shop-form-modal.vue create mode 100644 src/views/cabinet/smart-cabinet/ShopConfigModal.vue diff --git a/src/api/cabinet/smart-cabinet.ts b/src/api/cabinet/smart-cabinet.ts index 806cc1a..0ded6fa 100644 --- a/src/api/cabinet/smart-cabinet.ts +++ b/src/api/cabinet/smart-cabinet.ts @@ -12,6 +12,7 @@ export interface SmartCabinetDTO { cabinetName: string; cabinetType: number; mqttServerId?: number; + shopId?: number; templateNo: string; lockControlNo: number; location: number; @@ -22,6 +23,7 @@ export interface AddSmartCabinetCommand { cabinetName: string; cabinetType: number; mqttServerId?: number; + shopId?: number; templateNo: string; lockControlNo: number; location: number; @@ -32,6 +34,7 @@ export interface UpdateSmartCabinetCommand { cabinetName?: string; cabinetType?: number; mqttServerId?: number; + shopId?: number; templateNo?: string; lockControlNo?: number; location?: number; diff --git a/src/api/shop/shop.ts b/src/api/shop/shop.ts new file mode 100644 index 0000000..c2c655b --- /dev/null +++ b/src/api/shop/shop.ts @@ -0,0 +1,49 @@ +import { http } from '@/utils/http'; + +/** 商店分页查询参数 */ +export interface ShopQuery extends BasePageQuery { + shopName?: string; +} + +/** 商店DTO */ +export interface ShopDTO { + shopId: number; + shopName: string; +} + +/** 新增商店命令 */ +export interface AddShopCommand { + shopName: string; +} + +/** 更新商店命令 */ +export interface UpdateShopCommand { + shopId: number; + shopName: string; +} + +/** 获取商店列表 */ +export const getShopList = (params?: ShopQuery) => { + return http.request>>('get', '/shop/shops', { + params + }); +}; + +/** 新增商店 */ +export const addShop = (data: AddShopCommand) => { + return http.request>('post', '/shop/shops', { + data + }); +}; + +/** 修改商店 */ +export const updateShop = (id: number, data: UpdateShopCommand) => { + return http.request>('put', `/shop/shops/${id}`, { + data + }); +}; + +/** 删除商店 */ +export const deleteShop = (ids: string) => { + return http.request>('delete', `/shop/shops/${ids}`); +}; \ No newline at end of file diff --git a/src/views/cabinet/shop/index.vue b/src/views/cabinet/shop/index.vue new file mode 100644 index 0000000..9a225d9 --- /dev/null +++ b/src/views/cabinet/shop/index.vue @@ -0,0 +1,174 @@ + + + \ No newline at end of file diff --git a/src/views/cabinet/shop/shop-form-modal.vue b/src/views/cabinet/shop/shop-form-modal.vue new file mode 100644 index 0000000..1d634a3 --- /dev/null +++ b/src/views/cabinet/shop/shop-form-modal.vue @@ -0,0 +1,88 @@ + + + \ No newline at end of file diff --git a/src/views/cabinet/smart-cabinet/ShopConfigModal.vue b/src/views/cabinet/smart-cabinet/ShopConfigModal.vue new file mode 100644 index 0000000..d01ccca --- /dev/null +++ b/src/views/cabinet/smart-cabinet/ShopConfigModal.vue @@ -0,0 +1,89 @@ + + + \ No newline at end of file diff --git a/src/views/cabinet/smart-cabinet/index.vue b/src/views/cabinet/smart-cabinet/index.vue index 1a35b81..78d5847 100644 --- a/src/views/cabinet/smart-cabinet/index.vue +++ b/src/views/cabinet/smart-cabinet/index.vue @@ -15,6 +15,7 @@ import router from "@/router"; import { deleteSmartCabinet } from "@/api/cabinet/smart-cabinet"; import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; import GatewayConfigModal from "./GatewayConfigModal.vue"; +import ShopConfigModal from "./ShopConfigModal.vue"; defineOptions({ name: "SmartCabinet" @@ -41,6 +42,7 @@ const multipleSelection = ref([]); const editVisible = ref(false); const currentRow = ref(); const gatewayConfigVisible = ref(false); +const shopConfigVisible = ref(false); const currentCabinetId = ref(); const getList = async () => { @@ -138,6 +140,11 @@ const handleGatewayConfig = (row: SmartCabinetDTO) => { gatewayConfigVisible.value = true; }; +const handleShopConfig = (row: SmartCabinetDTO) => { + currentCabinetId.value = row.cabinetId; + shopConfigVisible.value = true; +}; + getList(); @@ -200,6 +207,9 @@ getList(); @click="handleGatewayConfig(row)"> 配置网关 + + 配置商店 + \ No newline at end of file