From 52f8cbff4a73585c462d0679fbf5ea6d4dc3d45f Mon Sep 17 00:00:00 2001 From: dzq Date: Mon, 23 Jun 2025 17:43:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(shop):=20=E6=B7=BB=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E5=BA=97=E5=88=97=E8=A1=A8API=E5=92=8C=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在shop模块中添加getShopListApi方法用于获取商店列表 - 在智能柜页面中增加商店选择功能 - 新增审批中心页面,包含申请类型展示和导航功能 --- src/api/shop/shop.ts | 7 + .../cabinet/smart-cabinet-card/index.vue | 22 +- src/views/shop/approvalCenter/index.vue | 307 ++++++++++++++++++ 3 files changed, 331 insertions(+), 5 deletions(-) create mode 100644 src/views/shop/approvalCenter/index.vue diff --git a/src/api/shop/shop.ts b/src/api/shop/shop.ts index 3c9e644..95c428c 100644 --- a/src/api/shop/shop.ts +++ b/src/api/shop/shop.ts @@ -98,6 +98,13 @@ export const getShopList = (params?: ShopQuery) => { }); }; +/** 获取商店列表 */ +export const getShopListApi = (params?: ShopQuery) => { + return http.request>('get', '/shop/shops/list', { + params + }); +}; + /** 获取商店详情 */ export const getShopById = (id: number) => { return http.request>('get', `/shop/shops/${id}`); diff --git a/src/views/cabinet/smart-cabinet-card/index.vue b/src/views/cabinet/smart-cabinet-card/index.vue index a98b5ac..1ff7b59 100644 --- a/src/views/cabinet/smart-cabinet-card/index.vue +++ b/src/views/cabinet/smart-cabinet-card/index.vue @@ -6,6 +6,7 @@ import { type PaginationProps } from "@pureadmin/table"; import { CommonUtils } from "@/utils/common"; import { useRouter } from "vue-router"; import { CabinetImgMap } from "@/utils/cabinetImgMap"; +import { getShopListApi, type ShopDTO } from "@/api/shop/shop"; import Search from "@iconify-icons/ep/search"; import Refresh from "@iconify-icons/ep/refresh"; @@ -27,11 +28,13 @@ const formRef = ref(); const modalVisible = ref(false); const searchFormParams = ref({ cabinetName: "", - cabinetType: null + cabinetType: null, + shopId: null }); const pageLoading = ref(false); const dataList = ref([]); +const shopList = ref([]); const pagination = ref({ total: 0, pageSize: 12, @@ -59,6 +62,15 @@ async function getList() { } } +async function getShopList() { + try { + const { data } = await getShopListApi(); + shopList.value = data; + } catch (error) { + console.error("获取店铺列表失败", error); + } +} + const resetForm = formEl => { if (!formEl) return; formEl.resetFields(); @@ -86,6 +98,7 @@ const handleViewDetail = (row: SmartCabinetDTO) => { onMounted(() => { getList(); + getShopList(); }); @@ -98,10 +111,9 @@ onMounted(() => { - - - - + + + diff --git a/src/views/shop/approvalCenter/index.vue b/src/views/shop/approvalCenter/index.vue new file mode 100644 index 0000000..e8cd5ce --- /dev/null +++ b/src/views/shop/approvalCenter/index.vue @@ -0,0 +1,307 @@ + + + + + + + \ No newline at end of file