From 6ebd83edbc33919e9a1753f6a3e3b02111fa8984 Mon Sep 17 00:00:00 2001 From: Timi Date: Thu, 13 Aug 2026 17:36:59 +0800 Subject: [PATCH] add tag --- src/api/TagAPI.ts | 51 ++++ src/components/TagSelector.vue | 269 +++++++++++++++++ src/pages/customer/CustomerDetail.vue | 65 +++- .../component/CustomerEventStructureChart.vue | 95 +++++- .../customer/component/CustomerTagCard.vue | 110 +++++++ .../component/StoreEventStructureChart.vue | 86 +++++- src/pages/tabs/SettingTab.vue | 6 + src/pages/tag/TagList.vue | 280 ++++++++++++++++++ src/router/routes/managementRoutes.ts | 15 + src/types/Tag.ts | 18 ++ src/utils/permission.ts | 7 + 11 files changed, 975 insertions(+), 27 deletions(-) create mode 100644 src/api/TagAPI.ts create mode 100644 src/components/TagSelector.vue create mode 100644 src/pages/customer/component/CustomerTagCard.vue create mode 100644 src/pages/tag/TagList.vue create mode 100644 src/types/Tag.ts diff --git a/src/api/TagAPI.ts b/src/api/TagAPI.ts new file mode 100644 index 0000000..bf200fa --- /dev/null +++ b/src/api/TagAPI.ts @@ -0,0 +1,51 @@ +import { axios, type Page, type PageResult } from "timi-web"; +import type { Tag, TagApply, TagBizType } from "@/types/Tag"; + +const BASE_URI = "/gao/tag"; + +async function list(page: Page): Promise> { + return await axios.post(`${BASE_URI}/list`, page); +} + +async function detail(id: string): Promise { + return await axios.post(`${BASE_URI}/detail`, undefined, { + params: { id } + }); +} + +async function create(tag: Tag): Promise { + return await axios.post(`${BASE_URI}/create`, tag); +} + +async function update(tag: Tag): Promise { + return await axios.post(`${BASE_URI}/update`, tag); +} + +async function remove(id: string): Promise { + return await axios.post(`${BASE_URI}/delete`, undefined, { + params: { id } + }); +} + +async function listByBizType(bizType: TagBizType, bizId: string): Promise { + return await axios.get(`${BASE_URI}/list/biz/id`, { + params: { + bizType, + bizId + } + }); +} + +async function apply(req: TagApply): Promise { + return await axios.post(`${BASE_URI}/apply`, req); +} + +export default { + list, + detail, + create, + update, + remove, + listByBizType, + apply +}; diff --git a/src/components/TagSelector.vue b/src/components/TagSelector.vue new file mode 100644 index 0000000..4c890bd --- /dev/null +++ b/src/components/TagSelector.vue @@ -0,0 +1,269 @@ + + + + + diff --git a/src/pages/customer/CustomerDetail.vue b/src/pages/customer/CustomerDetail.vue index c8d06c7..4a695c5 100644 --- a/src/pages/customer/CustomerDetail.vue +++ b/src/pages/customer/CustomerDetail.vue @@ -23,6 +23,12 @@ +