From f3074ca6985d20f1dc0a959a846850782233b2dd Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Tue, 27 Jan 2026 13:42:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=B9=B4=E6=B4=BB=E5=8A=A8=E5=90=8E?= =?UTF-8?q?=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