提交 963b442a authored 作者: 王鹏飞's avatar 王鹏飞

chore: 适配saas-x

上级 3e0d30c4
...@@ -4,6 +4,34 @@ const appConfigList = [ ...@@ -4,6 +4,34 @@ const appConfigList = [
logo: 'https://zws-imgs-pub.ezijing.com/pc/base/ezijing-logo.svg', logo: 'https://zws-imgs-pub.ezijing.com/pc/base/ezijing-logo.svg',
hosts: ['saas-lab'] hosts: ['saas-lab']
}, },
{
title: '1+X实训平台(中级)',
logo: 'https://zws-imgs-pub.ezijing.com/pc/base/ezijing-logo.svg',
hosts: ['saas-x'],
studentMenus: [
{ name: '首页', path: '/' },
{ name: '我的实验', path: '/student/lab' },
{ name: '理论学习', path: 'https://saas-learn.ezijing.com' },
{ name: '我的大赛', path: '/student/contest' },
{ name: '大赛成绩查询', path: '/student/contest/score' }
],
adminMenus: [
{ name: '首页', path: '/' },
{
name: '我的实验',
path: '/admin/lab',
tag: ['v1-backend-experiment', 'v1-teacher'],
children: [
{ name: '实验管理', path: '/admin/lab/experiment', tag: 'v1-backend-experiment' },
{ name: '案例原文管理', path: '/admin/lab/case', tag: 'teacher-experiment-cases' },
{ name: '实验指导书管理', path: '/admin/lab/book', tag: 'v1-teacher-book' },
{ name: '实验操作视频管理', path: '/admin/lab/video', tag: 'v1-teacher-video' },
{ name: '实验讨论交流', path: '/admin/lab/discuss', tag: 'v1-teacher-discussion' },
{ name: '实验成绩管理', path: '/admin/lab/score', tag: 'v1-teacher-record' }
]
}
]
},
{ {
system: 'game', system: 'game',
title: '商业数据分析竞赛平台', title: '商业数据分析竞赛平台',
...@@ -14,11 +42,6 @@ const appConfigList = [ ...@@ -14,11 +42,6 @@ const appConfigList = [
title: '数字营销实验室', title: '数字营销实验室',
logo: 'https://zws-imgs-pub.ezijing.com/pc/base/ezijing-logo.svg', logo: 'https://zws-imgs-pub.ezijing.com/pc/base/ezijing-logo.svg',
hosts: ['saas-dml-web'] hosts: ['saas-dml-web']
},
{
title: '2023年全国大学生商业数据分析与应用大赛',
logo: 'https://zws-imgs-pub.ezijing.com/pc/base/ezijing-logo.svg',
hosts: ['dasai']
} }
] ]
......
import type { IMenuItem } from '@/types' import type { IMenuItem } from '@/types'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import { useAppConfig } from '@/composables/useAppConfig'
interface State { interface State {
studentMenus: IMenuItem[] studentMenus: IMenuItem[]
...@@ -9,137 +10,62 @@ interface State { ...@@ -9,137 +10,62 @@ interface State {
// 学生菜单 // 学生菜单
const studentMenus: IMenuItem[] = [ const studentMenus: IMenuItem[] = [
{ { name: '首页', path: '/' },
name: '首页', { name: '我的实验', path: '/student/lab' },
path: '/' { name: '理论学习', path: 'https://saas-learn.ezijing.com' },
}, { name: '我的大赛', path: '/student/contest' },
{ { name: '大赛成绩查询', path: '/student/contest/score' }
name: '我的实验',
path: '/student/lab'
},
{
name: '理论学习',
path: 'https://saas-learn.ezijing.com'
},
{
name: '我的大赛',
path: '/student/contest'
},
{
name: '大赛成绩查询',
path: '/student/contest/score'
}
] ]
// 管理员菜单 // 管理员菜单
const adminMenus: IMenuItem[] = [ const adminMenus: IMenuItem[] = [
{ { name: '首页', path: '/' },
name: '首页',
path: '/'
},
{ {
name: '我的实验', name: '我的实验',
path: '/admin/lab', path: '/admin/lab',
tag: ['v1-backend-experiment', 'v1-teacher'], tag: ['v1-backend-experiment', 'v1-teacher'],
children: [ children: [
{ { name: '实验管理', path: '/admin/lab/experiment', tag: 'v1-backend-experiment' },
name: '实验管理', { name: '案例原文管理', path: '/admin/lab/case', tag: 'teacher-experiment-cases' },
path: '/admin/lab/experiment', { name: '实验指导书管理', path: '/admin/lab/book', tag: 'v1-teacher-book' },
tag: 'v1-backend-experiment' { name: '实验操作视频管理', path: '/admin/lab/video', tag: 'v1-teacher-video' },
}, { name: '实验讨论交流', path: '/admin/lab/discuss', tag: 'v1-teacher-discussion' },
{ { name: '实验成绩管理', path: '/admin/lab/score', tag: 'v1-teacher-record' }
name: '案例原文管理',
path: '/admin/lab/case',
tag: 'teacher-experiment-cases'
},
{
name: '实验指导书管理',
path: '/admin/lab/book',
tag: 'v1-teacher-book'
},
{
name: '实验操作视频管理',
path: '/admin/lab/video',
tag: 'v1-teacher-video'
},
{
name: '实验讨论交流',
path: '/admin/lab/discuss',
tag: 'v1-teacher-discussion'
},
{
name: '实验成绩管理',
path: '/admin/lab/score',
tag: 'v1-teacher-record'
}
] ]
}, },
{ {
name: '技能大赛', name: '技能大赛',
path: '/admin/contest', path: '/admin/contest',
children: [ children: [
{ { name: '赛项管理', path: '/admin/contest/items', tag: 'competition' },
name: '赛项管理', { name: '参赛选手管理', path: '/admin/contest/contestants', tag: 'competition-competitor' },
path: '/admin/contest/items', { name: '评分专家管理', path: '/admin/contest/experts', tag: 'expert' },
tag: 'competition' { name: '大赛训练答疑', path: '/admin/contest/discuss', tag: 'v1-teacher-train-discussion' },
}, { name: '大赛评分', path: '/admin/contest/check', tag: 'v1-expert-check' },
{ { name: '大赛发布成绩', path: '/admin/contest/score', tag: 'v1-expert-score' }
name: '参赛选手管理',
path: '/admin/contest/contestants',
tag: 'competition-competitor'
},
{
name: '评分专家管理',
path: '/admin/contest/experts',
tag: 'expert'
},
{
name: '大赛训练答疑',
path: '/admin/contest/discuss',
tag: 'v1-teacher-train-discussion'
},
{
name: '大赛评分',
path: '/admin/contest/check',
tag: 'v1-expert-check'
},
{
name: '大赛发布成绩',
path: '/admin/contest/score',
tag: 'v1-expert-score'
}
] ]
}, },
{ {
name: '成绩分析', name: '成绩分析',
path: '/admin/contest/analyze', path: '/admin/contest/analyze',
children: [ children: [
{ { name: '赛项成绩画像', path: '/admin/contest/analyze/score' },
name: '赛项成绩画像', { name: '学生个人成绩画像', path: '/admin/contest/analyze/student' }
path: '/admin/contest/analyze/score'
},
{
name: '学生个人成绩画像',
path: '/admin/contest/analyze/student'
}
] ]
} }
] ]
const appConfig = useAppConfig()
export const useMenuStore = defineStore({ export const useMenuStore = defineStore({
id: 'menu', id: 'menu',
state: (): State => ({ state: (): State => ({ studentMenus, adminMenus }),
studentMenus,
adminMenus
}),
getters: { getters: {
menus: state => { menus: state => {
const userStore = useUserStore() const userStore = useUserStore()
if (userStore.role?.id === 1) { if (userStore.role?.id === 1) {
return state.studentMenus return appConfig.studentMenus || state.studentMenus
} else { } else {
return state.adminMenus return appConfig.adminMenus || state.adminMenus
} }
} }
}, }
actions: {}
}) })
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论