From f3074ca6985d20f1dc0a959a846850782233b2dd Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Tue, 27 Jan 2026 13:42:55 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=96=B0=E5=B9=B4=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=90=8E=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 +- .env.production | 3 +- src/api/eventManagement.js | 56 ++ src/layout/Layout.vue | 76 ++- src/router/index.js | 51 ++ src/views/EventManagement/ContentConfiguration.vue | 561 +++++++++++++++++++++ src/views/EventManagement/WinningRecords.vue | 420 +++++++++++++++ 7 files changed, 1156 insertions(+), 14 deletions(-) create mode 100644 src/api/eventManagement.js create mode 100644 src/views/EventManagement/ContentConfiguration.vue create mode 100644 src/views/EventManagement/WinningRecords.vue diff --git a/.env.development b/.env.development index bb39d60..6dcb977 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ VITE_API_BASE_URL = "https://dbqb.legu168.cn/adminApi" -VITE_API_BASE_URL_LINK = "https://dbqb.legu168.cn/hljw/api/haiwai/user/login_jwcode" \ No newline at end of file +VITE_API_BASE_URL_LINK = "https://dbqb.legu168.cn/hljw/api/haiwai/user/login_jwcode" +VITE_API_BASE_URLXXCG=http://39.101.133.168:8828/ \ No newline at end of file diff --git a/.env.production b/.env.production index 8fde434..77606f5 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,3 @@ VITE_API_BASE_URL = "https://dcapi.homilychart.com/prod/deepchart" -VITE_API_BASE_URL_LINK = "https://api.homilychart.com/hljw/api/haiwai/user/login_jwcode" \ No newline at end of file +VITE_API_BASE_URL_LINK = "https://api.homilychart.com/hljw/api/haiwai/user/login_jwcode" +VITE_API_BASE_URLXXCG=https://api.homilychart.com/ \ No newline at end of file diff --git a/src/api/eventManagement.js b/src/api/eventManagement.js new file mode 100644 index 0000000..88ca225 --- /dev/null +++ b/src/api/eventManagement.js @@ -0,0 +1,56 @@ +import request from '../utils/myAxios'; +var base_url = import.meta.env.VITE_API_BASE_URL + +// 获取用户抽奖记录 +export function userLuckyDrawListApi(params) { + return request({ + url: base_url + "/admin/luckyDraw/list", + method: "post", + data: params, + }); +} + +// 导出用户抽奖记录 +export function exportUserLuckyDrawListApi(params) { + return request({ + url: base_url + "/admin/luckyDraw/export/create", + method: "post", + data: params, + }); +} + +// 获取配置列表 +export function getContentListApi(params) { + return request({ + url: base_url + "/admin/luckyDraw/getContentList", + method: "post", + data: params, + }); +} + +// 添加奖品 +export function addDrawConfigApi(params) { + return request({ + url: base_url + "/admin/luckyDraw/addDrawConfig", + method: "post", + data: params, + }); +} + +// 删除奖品 +export function deleteDrawApi(params) { + return request({ + url: base_url + "/admin/luckyDraw/deleteDraw", + method: "post", + data: params, + }); +} + +// 修改奖品状态 +export function changeStatusApi(params) { + return request({ + url: base_url + "/admin/luckyDraw/changeStatus", + method: "post", + data: params, + }); +} \ No newline at end of file diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue index 1f50e2b..487cca6 100644 --- a/src/layout/Layout.vue +++ b/src/layout/Layout.vue @@ -10,7 +10,8 @@ - + + - - - - - {{ childRoute.meta.title }} - + + @@ -110,8 +126,21 @@ const filteredSidebarRoutes = computed(() => { return allParentRoutes .map((parentRoute) => { - const filteredChildren = - parentRoute.children?.filter((childRoute) => { + // 先获取 children,如果为空则设为 [] + const rawChildren = parentRoute.children || []; + + const filteredChildren = rawChildren + .map((childRoute) => { + // 浅拷贝 childRoute,避免直接修改原始路由对象 + const newChild = { ...childRoute }; + if (newChild.children && newChild.children.length > 0) { + newChild.children = newChild.children.filter( + (grandChild) => grandChild.meta?.showSidebar === true + ); + } + return newChild; + }) + .filter((childRoute) => { // 必须标记为显示侧边栏 if (childRoute.meta?.showSidebar !== true) return false; @@ -128,7 +157,7 @@ const filteredSidebarRoutes = computed(() => { // 默认情况(如未登录或无权限字段),根据实际需求处理,这里暂时隐藏 return false; - }) || []; + }); return { ...parentRoute, filteredChildren }; }) .filter((parentRoute) => parentRoute.filteredChildren.length > 0); @@ -143,6 +172,13 @@ const validMenuIndexes = computed(() => { // 收集子菜单 parentRoute.filteredChildren.forEach((childRoute) => { indexes.push(`/${parentRoute.path}/${childRoute.path}`); + // 收集孙子菜单 + if (childRoute.children && childRoute.children.length > 0) { + childRoute.children.forEach((grandChild) => { + // 收集三级菜单路径 (确保拼接正确) + indexes.push(`/${parentRoute.path}/${childRoute.path}/${grandChild.path}`); + }); + } }); }); return indexes; @@ -345,13 +381,29 @@ onMounted(async () => { line-height: 22px; } +.sidebar-grandchild-text { + position: absolute; + left: 78px; + top: 15px; + height: 33px; + overflow: hidden; + color: #03071f; + text-overflow: ellipsis; + white-space: nowrap; + font-family: "PingFang SC", sans-serif; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 22px; +} + /* 子目录选中态样式 */ -.sidebar-child-container.is-active { +.sidebar-child-container.is-active,.sidebar-grandchild-container.is-active { background: #ffffff !important; /* 选中后容器变为白色 */ } /* 选中态文字样式 */ -.sidebar-child-container.is-active .sidebar-child-text { +.sidebar-child-container.is-active .sidebar-child-text,.sidebar-grandchild-container.is-active .sidebar-grandchild-text { color: #ff0000 !important; /* 选中后文字红色 */ font-weight: 500; } diff --git a/src/router/index.js b/src/router/index.js index a496720..47803f3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -75,6 +75,57 @@ const routes = [ meta: { hidden: true } } ] + }, + { + path: 'platformData', + name: 'platformData', + meta: { title: '平台数据管理', icon: "TrendCharts", showSidebar: true, isParentNav: true }, + children: [ + { + path: 'overview', + name: 'overview', + component: () => import('../views/PlatformData/UserOverview.vue'), + meta: { title: '用户数据概览', showSidebar: true } + }, + { + path: 'loginStats', + name: 'loginStats', + component: () => import('../views/PlatformData/UserLoginStats.vue'), + meta: { title: '用户类登录统计', showSidebar: true } + }, + { + path: 'activityStats', + name: 'activityStats', + component: () => import('../views/PlatformData/UserActivityStats.vue'), + meta: { title: '用户活跃度统计', showSidebar: true } + } + ] + }, + { + path: 'EventManagement', + name: 'EventManagement', + meta: { title: '活动管理', icon: "Management", showSidebar: true, isParentNav: true }, + children: [ + { + path: 'NewYearAct', + name: 'NewYearAct', + meta: { title: '新年幸运签', showSidebar: true }, + children: [ + { + path: 'winningRecords', + name: 'winningRecords', + component: () => import('../views/EventManagement/WinningRecords.vue'), + meta: { title: '历史记录', showSidebar: true } + }, + { + path: 'contentConfiguration', + name: 'contentConfiguration', + component: () => import('../views/EventManagement/ContentConfiguration.vue'), + meta: { title: '内容配置', showSidebar: true } + }, + ] + }, + ] } ] } diff --git a/src/views/EventManagement/ContentConfiguration.vue b/src/views/EventManagement/ContentConfiguration.vue new file mode 100644 index 0000000..9e28b0d --- /dev/null +++ b/src/views/EventManagement/ContentConfiguration.vue @@ -0,0 +1,561 @@ + + + + + + + \ No newline at end of file diff --git a/src/views/EventManagement/WinningRecords.vue b/src/views/EventManagement/WinningRecords.vue new file mode 100644 index 0000000..6e316d5 --- /dev/null +++ b/src/views/EventManagement/WinningRecords.vue @@ -0,0 +1,420 @@ + + + + + \ No newline at end of file From 8ec448f5fab347631bcce9790b8c14f8b011eb13 Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Tue, 27 Jan 2026 13:50:45 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=99=84=E5=B8=A6?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 47803f3..796876c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -77,31 +77,6 @@ const routes = [ ] }, { - path: 'platformData', - name: 'platformData', - meta: { title: '平台数据管理', icon: "TrendCharts", showSidebar: true, isParentNav: true }, - children: [ - { - path: 'overview', - name: 'overview', - component: () => import('../views/PlatformData/UserOverview.vue'), - meta: { title: '用户数据概览', showSidebar: true } - }, - { - path: 'loginStats', - name: 'loginStats', - component: () => import('../views/PlatformData/UserLoginStats.vue'), - meta: { title: '用户类登录统计', showSidebar: true } - }, - { - path: 'activityStats', - name: 'activityStats', - component: () => import('../views/PlatformData/UserActivityStats.vue'), - meta: { title: '用户活跃度统计', showSidebar: true } - } - ] - }, - { path: 'EventManagement', name: 'EventManagement', meta: { title: '活动管理', icon: "Management", showSidebar: true, isParentNav: true }, From 49063bb8533a584b59c5fa4b12f3b8a40295b82d Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Tue, 27 Jan 2026 14:51:11 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E7=B1=BB=E5=9E=8B=E5=BC=BA=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/EventManagement/ContentConfiguration.vue | 33 +++++++++++----------- src/views/EventManagement/WinningRecords.vue | 6 ++++ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/views/EventManagement/ContentConfiguration.vue b/src/views/EventManagement/ContentConfiguration.vue index 9e28b0d..dfff270 100644 --- a/src/views/EventManagement/ContentConfiguration.vue +++ b/src/views/EventManagement/ContentConfiguration.vue @@ -38,6 +38,12 @@ header-align="center" /> + { const res = await changeStatusApi({ token: token, id: row.id, - state: row.status, + status: row.status, }); ElMessage.success("状态更新成功"); fetchTableData(); @@ -356,20 +363,16 @@ const submitForm = async () => { img: form.img, }; if ([1, 2, 3].includes(form.type)) { - requestParams.num = form.num; + requestParams.num = parseInt(form.num, 10); } else { requestParams.item_name = form.item_name; } const data = await addDrawConfigApi(requestParams); - if (data.code == 200) { - ElMessage.success("添加成功"); - dialogFormVisible.value = false; - fetchTableData(); - } else { - ElMessage.error(data.msg); - } + ElMessage.success("添加成功"); + dialogFormVisible.value = false; + fetchTableData(); } catch (error) { - console.error("提交表单失败:", error); + } }; @@ -386,12 +389,8 @@ const deleteDraw = async (row) => { id: row.id, }; const data = await deleteDrawApi(requestParams); - if (data.code == 200) { - ElMessage.success("删除成功"); - fetchTableData(); - } else { - ElMessage.error(data.msg); - } + ElMessage.success("删除成功"); + fetchTableData(); } catch (error) { if (error === "cancel") { // 用户点击取消 diff --git a/src/views/EventManagement/WinningRecords.vue b/src/views/EventManagement/WinningRecords.vue index 6e316d5..ac3e01c 100644 --- a/src/views/EventManagement/WinningRecords.vue +++ b/src/views/EventManagement/WinningRecords.vue @@ -95,6 +95,12 @@ header-align="center" /> + Date: Tue, 27 Jan 2026 17:16:01 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8D=A2=E4=B8=BA=E6=AD=A3=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 6dcb977..3efc3c6 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ VITE_API_BASE_URL = "https://dbqb.legu168.cn/adminApi" VITE_API_BASE_URL_LINK = "https://dbqb.legu168.cn/hljw/api/haiwai/user/login_jwcode" -VITE_API_BASE_URLXXCG=http://39.101.133.168:8828/ \ No newline at end of file +VITE_API_BASE_URLXXCG=https://api.homilychart.com/ \ No newline at end of file From 1de5289bd2d27aa872c9db181d73a8c4f2c1bcf6 Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Wed, 28 Jan 2026 09:50:44 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/EventManagement/ContentConfiguration.vue | 2 +- src/views/EventManagement/WinningRecords.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/EventManagement/ContentConfiguration.vue b/src/views/EventManagement/ContentConfiguration.vue index dfff270..8ca096c 100644 --- a/src/views/EventManagement/ContentConfiguration.vue +++ b/src/views/EventManagement/ContentConfiguration.vue @@ -470,7 +470,7 @@ const handleCurrentChange = (val) => { border-radius: 12px !important; overflow: hidden !important; border: 1px solid #e4e7ed !important; - /* height: 700px; */ + height: 750px; } .table-header { diff --git a/src/views/EventManagement/WinningRecords.vue b/src/views/EventManagement/WinningRecords.vue index ac3e01c..3eb712f 100644 --- a/src/views/EventManagement/WinningRecords.vue +++ b/src/views/EventManagement/WinningRecords.vue @@ -26,7 +26,7 @@ :value="region.ID" /> - 类型 + 物品类型 { border-radius: 12px !important; overflow: hidden !important; border: 1px solid #e4e7ed !important; - /* height: 700px; */ + height: 750px; } .table-header { From 99668afa6a6618869dfb331eedf099090e50c1ab Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Wed, 28 Jan 2026 11:09:17 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/EventManagement/ContentConfiguration.vue | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/views/EventManagement/ContentConfiguration.vue b/src/views/EventManagement/ContentConfiguration.vue index 8ca096c..cbf06ab 100644 --- a/src/views/EventManagement/ContentConfiguration.vue +++ b/src/views/EventManagement/ContentConfiguration.vue @@ -99,20 +99,6 @@ :rules="rules" ref="formRef" > - - - - -
(小于等于100%)
+ + + + + { case 3: // 金豆 return { label: "数量", placeholder: "请输入金豆数量", prop: "num" }; default: // 默认情况(未选择或实物) - return { label: "名称", placeholder: "请输入名称", prop: "item_name" }; + return { label: "名称", placeholder: "请输入物品名称", prop: "item_name" }; } }); const handleSuccess = (response, uploadFile) => { @@ -263,7 +263,11 @@ const rules = computed(() => { const baseRules = { stick_type: [{ required: true, message: "请选择类型", trigger: "change" }], type: [{ required: true, message: "请选择类型", trigger: "change" }], - probability: [{ required: true, message: "请输入概率", trigger: "blur" }], + probability: [ + { required: true, message: "请输入概率", trigger: "blur" }, + // 为负数时提示 + { validator: validateNum, trigger: "blur" }, + ], img: [{ required: true, message: "请上传图片", trigger: "change" }], // 上传通常用 change }; if ([1, 2, 3].includes(form.type)) { @@ -363,7 +367,7 @@ const submitForm = async () => { img: form.img, }; if ([1, 2, 3].includes(form.type)) { - requestParams.num = parseInt(form.num, 10); + requestParams.num = parseInt(form.num, 10); } else { requestParams.item_name = form.item_name; } @@ -371,9 +375,7 @@ const submitForm = async () => { ElMessage.success("添加成功"); dialogFormVisible.value = false; fetchTableData(); - } catch (error) { - - } + } catch (error) {} }; const deleteDraw = async (row) => { From f5dd10f53cccf9e020d447ed28f117039ea3d8cf Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Wed, 28 Jan 2026 14:03:09 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E5=BC=80=E5=85=B3=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/EventManagement/ContentConfiguration.vue | 40 +++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/views/EventManagement/ContentConfiguration.vue b/src/views/EventManagement/ContentConfiguration.vue index cbf06ab..fcd1f67 100644 --- a/src/views/EventManagement/ContentConfiguration.vue +++ b/src/views/EventManagement/ContentConfiguration.vue @@ -62,7 +62,7 @@ " active-text="ON" inactive-text="OFF" - @change="changeState(scope.row)" + :before-change="() => beforeChangeState(scope.row)" > @@ -112,6 +112,7 @@ { switch (form.type) { case 1: // Token - return { label: "数量", placeholder: "请输入Token数量", prop: "num" }; + return { label: "数量", placeholder: "请输入Token数量", prop: "num", type: "number" }; case 2: // 金币 - return { label: "数量", placeholder: "请输入金币数量", prop: "num" }; + return { label: "数量", placeholder: "请输入金币数量", prop: "num", type: "number" }; case 3: // 金豆 - return { label: "数量", placeholder: "请输入金豆数量", prop: "num" }; + return { label: "数量", placeholder: "请输入金豆数量", prop: "num", type: "number" }; default: // 默认情况(未选择或实物) - return { label: "名称", placeholder: "请输入物品名称", prop: "item_name" }; + return { label: "名称", placeholder: "请输入物品名称", prop: "item_name", type: "text" }; } }); const handleSuccess = (response, uploadFile) => { @@ -325,18 +326,23 @@ const datatotal = ref(0); const currentPage = ref(1); const pageSize = ref(15); -const changeState = async (row) => { - try { - const res = await changeStatusApi({ - token: token, - id: row.id, - status: row.status, - }); - ElMessage.success("状态更新成功"); - fetchTableData(); - } catch (error) { - // 由响应拦截器处理错误 - } +const beforeChangeState = (row) => { + return new Promise(async (resolve, reject) => { + try { + const targetStatus = row.status === 1 ? 0 : 1; + await changeStatusApi({ + token: token, + id: row.id, + status: targetStatus, + }); + ElMessage.success("状态更新成功"); + resolve(true); + // fetchTableData(); + } catch (error) { + // reject()拒绝操作,switch 组件会自动回滚状态 + reject(new Error("状态更新失败")); + } + }); }; // 重置表单数据 From 0b45e5642e6acf34bf004098c169100e90aba104 Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Thu, 29 Jan 2026 20:55:30 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=BC=BA=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/EventManagement/ContentConfiguration.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/EventManagement/ContentConfiguration.vue b/src/views/EventManagement/ContentConfiguration.vue index fcd1f67..4e4f774 100644 --- a/src/views/EventManagement/ContentConfiguration.vue +++ b/src/views/EventManagement/ContentConfiguration.vue @@ -373,7 +373,7 @@ const submitForm = async () => { img: form.img, }; if ([1, 2, 3].includes(form.type)) { - requestParams.num = parseInt(form.num, 10); + requestParams.num = form.num; } else { requestParams.item_name = form.item_name; } From 1ddd4c64552c2ba2d3cc32fa8bcaaa0a66259f58 Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Thu, 29 Jan 2026 21:32:08 +0800 Subject: [PATCH 9/9] =?UTF-8?q?number=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/EventManagement/ContentConfiguration.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/EventManagement/ContentConfiguration.vue b/src/views/EventManagement/ContentConfiguration.vue index 4e4f774..4e82126 100644 --- a/src/views/EventManagement/ContentConfiguration.vue +++ b/src/views/EventManagement/ContentConfiguration.vue @@ -373,7 +373,7 @@ const submitForm = async () => { img: form.img, }; if ([1, 2, 3].includes(form.type)) { - requestParams.num = form.num; + requestParams.num = Number(form.num); } else { requestParams.item_name = form.item_name; }