From 9bed16acd67d26f024317c920b5bf39858a7a23a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Sun, 24 Aug 2025 20:24:57 +0800
Subject: [PATCH] =?UTF-8?q?feat(shop):=20=E6=B7=BB=E5=8A=A0=E5=88=86?=
=?UTF-8?q?=E9=94=80=E5=95=86=E7=94=B3=E8=AF=B7=E5=AE=A1=E6=A0=B8=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 新增审核通过、驳回和批量审核通过分销商申请的 API 接口
- 移除无用的网站 ID 相关代码
- 优化导入导出功能
- 修复一些组件中的小问题
---
.env.development | 2 +-
index.html | 68 --
src/api/shop/shopDealerApply/index.ts | 41 +
src/views/cms/cmsAd/components/search.vue | 3 -
.../cms/cmsArticle/components/articleEdit.vue | 1 +
.../cms/cmsArticle/components/search.vue | 1 -
src/views/cms/cmsLink/components/search.vue | 3 -
src/views/cms/cmsModel/components/search.vue | 2 -
src/views/cms/cmsNavigation/index.vue | 1 -
.../cms/cmsWebsiteField/components/search.vue | 113 ++-
src/views/cms/cmsWebsiteField/index.vue | 340 +++----
src/views/cms/dict/index.vue | 1 -
src/views/cms/photo/dict/index.vue | 3 -
src/views/cms/photo/list.vue | 2 -
src/views/shop/dashboard/index.vue | 28 +-
src/views/shop/shopCoupon/index.vue | 2 +-
.../shopDealerApply/components/search.vue | 12 +-
src/views/shop/shopDealerApply/index.vue | 835 +++++++++---------
src/views/shop/shopExpress/index.vue | 12 -
src/views/shop/shopGift/components/search.vue | 2 +-
src/views/shop/shopGift/index.vue | 2 +-
21 files changed, 765 insertions(+), 709 deletions(-)
delete mode 100644 index.html
diff --git a/.env.development b/.env.development
index b8ccd8b..fbcc74b 100644
--- a/.env.development
+++ b/.env.development
@@ -1,5 +1,5 @@
VITE_APP_NAME=后台管理(开发环境)
-#VITE_API_URL=http://127.0.0.1:9200/api
+VITE_API_URL=http://127.0.0.1:9200/api
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
diff --git a/index.html b/index.html
deleted file mode 100644
index 300c7c8..0000000
--- a/index.html
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
- 网宿软件
-
-
-
-
-
-
-
diff --git a/src/api/shop/shopDealerApply/index.ts b/src/api/shop/shopDealerApply/index.ts
index f54d5da..fa899ce 100644
--- a/src/api/shop/shopDealerApply/index.ts
+++ b/src/api/shop/shopDealerApply/index.ts
@@ -103,3 +103,44 @@ export async function getShopDealerApply(id: number) {
}
return Promise.reject(new Error(res.data.message));
}
+
+/**
+ * 审核通过分销商申请
+ */
+export async function approveShopDealerApply(id: number) {
+ const res = await request.put>(
+ `/shop/shop-dealer-apply/${id}/approve`
+ );
+ if (res.data.code === 0) {
+ return res.data.message;
+ }
+ return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 驳回分销商申请
+ */
+export async function rejectShopDealerApply(id: number, data: { rejectReason: string }) {
+ const res = await request.put>(
+ `/shop/shop-dealer-apply/${id}/reject`,
+ data
+ );
+ if (res.data.code === 0) {
+ return res.data.message;
+ }
+ return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 批量审核通过分销商申请
+ */
+export async function batchApproveShopDealerApply(ids: number[]) {
+ const res = await request.put>(
+ '/shop/shop-dealer-apply/batch-approve',
+ { ids }
+ );
+ if (res.data.code === 0) {
+ return res.data.message;
+ }
+ return Promise.reject(new Error(res.data.message));
+}
diff --git a/src/views/cms/cmsAd/components/search.vue b/src/views/cms/cmsAd/components/search.vue
index f2e6177..3bb8202 100644
--- a/src/views/cms/cmsAd/components/search.vue
+++ b/src/views/cms/cmsAd/components/search.vue
@@ -45,9 +45,6 @@
{}
);
- // 网站ID
- const websiteId = localStorage.getItem('WebsiteId')
-
const emit = defineEmits<{
(e: 'search', where?: CmsAdParam): void;
(e: 'add'): void;
diff --git a/src/views/cms/cmsArticle/components/articleEdit.vue b/src/views/cms/cmsArticle/components/articleEdit.vue
index 7588192..191fd5d 100644
--- a/src/views/cms/cmsArticle/components/articleEdit.vue
+++ b/src/views/cms/cmsArticle/components/articleEdit.vue
@@ -12,6 +12,7 @@
@ok="save"
>
+ 打印
保存
();
const articleList = ref([]);
// 是否显示用户导入弹窗
const showImport = ref(false);
-const websiteId = localStorage.getItem('WebsiteId')
// 表单数据
const {where, resetFields} = useSearch({
diff --git a/src/views/cms/cmsLink/components/search.vue b/src/views/cms/cmsLink/components/search.vue
index 849e63c..9ce89db 100644
--- a/src/views/cms/cmsLink/components/search.vue
+++ b/src/views/cms/cmsLink/components/search.vue
@@ -52,9 +52,6 @@
{}
);
- // 网站ID
- const websiteId = localStorage.getItem('WebsiteId')
-
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'add'): void;
diff --git a/src/views/cms/cmsModel/components/search.vue b/src/views/cms/cmsModel/components/search.vue
index 40eb8f2..ad9200f 100644
--- a/src/views/cms/cmsModel/components/search.vue
+++ b/src/views/cms/cmsModel/components/search.vue
@@ -30,8 +30,6 @@
(e: 'batchMove'): void;
}>();
- const websiteId = localStorage.getItem('WebsiteId')
-
// 新增
const add = () => {
emit('add');
diff --git a/src/views/cms/cmsNavigation/index.vue b/src/views/cms/cmsNavigation/index.vue
index 6471a6c..6896427 100644
--- a/src/views/cms/cmsNavigation/index.vue
+++ b/src/views/cms/cmsNavigation/index.vue
@@ -263,7 +263,6 @@ const {push} = useRouter();
// 表格实例
const tableRef = ref | null>(null);
const modelList = ref([])
-const websiteId = localStorage.getItem('WebsiteId')
const currentId = ref();
const modelName = ref();
// 国际化
diff --git a/src/views/cms/cmsWebsiteField/components/search.vue b/src/views/cms/cmsWebsiteField/components/search.vue
index 260c724..584cbf7 100644
--- a/src/views/cms/cmsWebsiteField/components/search.vue
+++ b/src/views/cms/cmsWebsiteField/components/search.vue
@@ -1,15 +1,112 @@
- 添加字段
+
+ 添加字段
+
+ 导出xls
+ 导入xls
+
+
+
diff --git a/src/views/cms/cmsWebsiteField/index.vue b/src/views/cms/cmsWebsiteField/index.vue
index 647d043..b2dec02 100644
--- a/src/views/cms/cmsWebsiteField/index.vue
+++ b/src/views/cms/cmsWebsiteField/index.vue
@@ -1,7 +1,7 @@
$router.go(-1)">
-
+
@@ -17,11 +17,15 @@
class="sys-org-table"
>
-
+
- {{ record.name }}
+
+ {{ record.name }}
+
+
{{ record.comments }}
@@ -37,15 +41,15 @@
{{ record.comments }}
-
+
复制
-
+
编辑
-
+
-
+
-
+
diff --git a/src/views/cms/dict/index.vue b/src/views/cms/dict/index.vue
index 3d5af4e..e4f85e7 100644
--- a/src/views/cms/dict/index.vue
+++ b/src/views/cms/dict/index.vue
@@ -74,7 +74,6 @@
// 表格实例
const tableRef = ref | null>(null);
- const websiteId = localStorage.getItem('WebsiteId')
const dictId = ref(0);
// 表格列配置
diff --git a/src/views/cms/photo/dict/index.vue b/src/views/cms/photo/dict/index.vue
index d4af38d..ddabefb 100644
--- a/src/views/cms/photo/dict/index.vue
+++ b/src/views/cms/photo/dict/index.vue
@@ -53,7 +53,6 @@
import { message, Modal } from 'ant-design-vue/es';
import {
PlusOutlined,
- DeleteOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro/es';
@@ -73,8 +72,6 @@
import { addDict, listDictionaries } from '@/api/system/dict';
import { Dictionary } from '@/api/system/dictionary/model';
- // 网站ID
- const websiteId = localStorage.getItem('WebsiteId')
// 表格实例
const tableRef = ref | null>(null);
const dictId = ref(0);
diff --git a/src/views/cms/photo/list.vue b/src/views/cms/photo/list.vue
index 482a0cd..b85d220 100644
--- a/src/views/cms/photo/list.vue
+++ b/src/views/cms/photo/list.vue
@@ -162,8 +162,6 @@
const current = ref(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
- // 网站ID
- const websiteId = localStorage.getItem('WebsiteId')
// 表格列配置
const columns = ref([
{
diff --git a/src/views/shop/dashboard/index.vue b/src/views/shop/dashboard/index.vue
index e0ad79e..4eb25b6 100644
--- a/src/views/shop/dashboard/index.vue
+++ b/src/views/shop/dashboard/index.vue
@@ -156,6 +156,10 @@
系统日志
+
+
+ 清除缓存
+
系统设置
@@ -178,20 +182,23 @@ import {
SettingOutlined,
AccountBookOutlined,
FileTextOutlined,
+ ClearOutlined,
MoneyCollectOutlined
} from '@ant-design/icons-vue';
+import {message} from 'ant-design-vue/es';
import {openNew} from "@/utils/common";
-import { useSiteStore } from '@/store/modules/site';
-import { useStatisticsStore } from '@/store/modules/statistics';
-import { storeToRefs } from 'pinia';
+import {useSiteStore} from '@/store/modules/site';
+import {useStatisticsStore} from '@/store/modules/statistics';
+import {storeToRefs} from 'pinia';
+import {removeSiteInfoCache} from "@/api/cms/cmsWebsite";
// 使用状态管理
const siteStore = useSiteStore();
const statisticsStore = useStatisticsStore();
// 从 store 中获取响应式数据
-const { siteInfo, loading: siteLoading } = storeToRefs(siteStore);
-const { loading: statisticsLoading } = storeToRefs(statisticsStore);
+const {siteInfo, loading: siteLoading} = storeToRefs(siteStore);
+const {loading: statisticsLoading} = storeToRefs(statisticsStore);
// 系统信息
const systemInfo = ref({
@@ -215,6 +222,17 @@ const totalSales = computed(() => statisticsStore.totalSales);
// 加载状态
const loading = computed(() => siteLoading.value || statisticsLoading.value);
+// 清除缓存
+const clearSiteInfoCache = () => {
+ removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId')).then(
+ (msg) => {
+ if (msg) {
+ message.success(msg);
+ }
+ }
+ );
+};
+
onMounted(async () => {
// 加载网站信息和统计数据
try {
diff --git a/src/views/shop/shopCoupon/index.vue b/src/views/shop/shopCoupon/index.vue
index 556bebc..73d28f6 100644
--- a/src/views/shop/shopCoupon/index.vue
+++ b/src/views/shop/shopCoupon/index.vue
@@ -274,7 +274,7 @@ const loading = ref(false);
const searchForm = reactive({
keywords: '',
name: undefined,
- type: 0
+ type: undefined
});
// 表格数据源
diff --git a/src/views/shop/shopDealerApply/components/search.vue b/src/views/shop/shopDealerApply/components/search.vue
index 1c02d73..3a97655 100644
--- a/src/views/shop/shopDealerApply/components/search.vue
+++ b/src/views/shop/shopDealerApply/components/search.vue
@@ -76,12 +76,12 @@