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