diff --git a/package-lock.json b/package-lock.json index 1215e5f..dbe18b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15015,7 +15015,6 @@ "integrity": "sha512-yl+5qhpjd8e1G4cMXfORkkBlvtPCIgmRf3IYCWYDKIQ7m+PPa5iTm4feiNmCMD6yGqQWMhhK/7M3oWGL9boKwg==", "dev": true, "requires": { - "@babel/core": "^7.12.16", "@babel/helper-compilation-targets": "^7.12.16", "@babel/helper-module-imports": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.12.13", @@ -15028,7 +15027,6 @@ "@vue/babel-plugin-jsx": "^1.0.3", "@vue/babel-preset-jsx": "^1.1.2", "babel-plugin-dynamic-import-node": "^2.3.3", - "core-js": "^3.8.3", "core-js-compat": "^3.8.3", "semver": "^7.3.4" }, @@ -15888,9 +15886,7 @@ "resolved": "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "dev": true, - "requires": { - "ajv": "^8.0.0" - } + "requires": {} }, "ansi-escapes": { "version": "3.2.0", diff --git a/src/api/CONST.js b/src/api/CONST.js index 2a64484..4e3eeb3 100644 --- a/src/api/CONST.js +++ b/src/api/CONST.js @@ -1,6 +1,7 @@ export const PROJECT = 1; export const ROUTER = 2; export const COURSE = 3; +export const GROWTH = 4; export const TASK_TYPES = { typeName: { diff --git a/src/api/api.js b/src/api/api.js index 5b0d2a1..abc343f 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -132,3 +132,13 @@ export const EditVoteInvolvedAndBrowse = `/vote/editVoteInvolvedAndBrowse post` export const ROUTER_DETAIL_CHAPTER_LIST = `/stu/router/chapterPcList` + +/**专业力必修模块 */ +let baseUrl = "/growth" +// let baseUrl = "" +//查询专业力必修详情 +export const PROFESSIONAL_STUDENT_DETAIL = id => `${baseUrl}/professional/student/studentGrowthDetail/${id}` +//查询专业力必修详情 +export const PROFESSIONAL_STUDENT_TASKLIST = `${baseUrl}/professional/student/studentTaskList` +//记录当前学习任务 +export const PROFESSIONAL_STUDENT_LEARN = `${baseUrl}/professional/student/learnCourse` \ No newline at end of file diff --git a/src/api/useCommon.js b/src/api/useCommon.js index da581cd..5438eef 100644 --- a/src/api/useCommon.js +++ b/src/api/useCommon.js @@ -1,24 +1,25 @@ -import {useRoute, useRouter} from "vue-router/dist/vue-router"; -import {useStore} from "vuex"; -import {TASK_TYPES} from "@/api/CONST"; -import {computed, watchEffect} from "vue"; +import { useRoute, useRouter } from "vue-router/dist/vue-router"; +import { useStore } from "vuex"; +import { TASK_TYPES } from "@/api/CONST"; +import { computed, watchEffect } from "vue"; export function useTaskPage() { const router = useRouter() - const {query: {id: taskId, type, infoId}} = useRoute() - const {state, dispatch} = useStore() - const info = computed(() => type == 1 ? state.projectInfo : state.routerInfo) - - const taskList = computed(() => type == 1 ? info.value.stageProcessList.flatMap(t => t.taskProcessList.map(s => ({ - ...s, - stageId: t.id, - stageName: t.name - }))) : info.value.taskBoList) + const { query: { id: taskId, type, infoId } } = useRoute() + const { state, dispatch } = useStore() + const info = computed(() => type == 1 ? state.projectInfo : type == 2 ? state.routerInfo : state.growthInfo) + const taskList = computed(() => { + return type == 1 ? info.value.stageProcessList.flatMap(t => t.taskProcessList.map(s => ({ + ...s, + stageId: t.id, + stageName: t.name + }))) : type == 2 ? info.value.taskBoList : [] + }) const index = computed(() => taskList.value?.findIndex(t => t.id == taskId)) const hasPrev = computed(() => index.value - 1 > 0) - const hasNext = computed(() => taskList.value.length > index.value) + const hasNext = computed(() => index.value !== -1 && taskList.value?.length > index.value) - type == 1 ? dispatch('getProjectInfo', {projectId: infoId}) : dispatch('getRouterInfo', {routerId: infoId}) + type == 1 ? dispatch('getProjectInfo', { projectId: infoId }) : type == 2 ? dispatch('getRouterInfo', { routerId: infoId }) : dispatch('getGrowthInfo', { routerId: infoId }) function nextPage() { toPage(taskList.value[index.value + 1]) @@ -49,5 +50,5 @@ export function useTaskPage() { } } - return {hasPrev, hasNext, nextPage, prevPage} + return { hasPrev, hasNext, nextPage, prevPage } } \ No newline at end of file diff --git a/src/assets/image/growth/growth-icon1.png b/src/assets/image/growth/growth-icon1.png new file mode 100644 index 0000000..44c8a83 Binary files /dev/null and b/src/assets/image/growth/growth-icon1.png differ diff --git a/src/assets/image/growth/growth-icon2.png b/src/assets/image/growth/growth-icon2.png new file mode 100644 index 0000000..365428f Binary files /dev/null and b/src/assets/image/growth/growth-icon2.png differ diff --git a/src/assets/image/growth/growth-icon3.png b/src/assets/image/growth/growth-icon3.png new file mode 100644 index 0000000..003c295 Binary files /dev/null and b/src/assets/image/growth/growth-icon3.png differ diff --git a/src/assets/image/growth/growth-icon4.png b/src/assets/image/growth/growth-icon4.png new file mode 100644 index 0000000..9d8f3fe Binary files /dev/null and b/src/assets/image/growth/growth-icon4.png differ diff --git a/src/assets/image/growth/rocket.png b/src/assets/image/growth/rocket.png new file mode 100644 index 0000000..5283172 Binary files /dev/null and b/src/assets/image/growth/rocket.png differ diff --git a/src/main.js b/src/main.js index dbfa833..075cd29 100644 --- a/src/main.js +++ b/src/main.js @@ -15,9 +15,13 @@ import 'element-plus/dist/index.css' import zhCn from 'element-plus/es/locale/lang/zh-cn' import "@/assets/scss/common.scss" import "@/assets/scss/iconfont.css" - +import * as ElementPlusIconsVue from '@element-plus/icons-vue' const app = createApp(App) app.use(store).use(router).mount('#app') app.use(ElementPlus, { locale: zhCn, -}) \ No newline at end of file +}) + +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component) + } \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 9d26444..108974c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,14 +1,15 @@ -import {createStore} from "vuex"; -import {PROJECT_PROCESS, ROUTER_PROCESS} from "@/api/api"; -import {request} from "@/api/request"; -import {TASK_TYPES} from "@/api/CONST"; +import { createStore } from "vuex"; +import { PROJECT_PROCESS, ROUTER_PROCESS, PROFESSIONAL_STUDENT_DETAIL } from "@/api/api"; +import { request } from "@/api/request"; +import { TASK_TYPES } from "@/api/CONST"; export default createStore({ state: { userInfo: {}, projectInfo: {}, projectError: {}, - routerInfo: {} + routerInfo: {}, + growthInfo: {} }, getters: {}, mutations: { @@ -18,7 +19,11 @@ export default createStore({ SET_PROJECT_INFO(state, info) { state.projectInfo = info; }, - SET_PROJECT_ERROR(state,error){ + + SET_GROWTH_INFO(state, info) { + state.growthInfo = info; + }, + SET_PROJECT_ERROR(state, error) { state.projectError = error; }, INIT_PROJECT_INFO(state) { @@ -31,7 +36,7 @@ export default createStore({ } if (state.projectInfo.unlockMode === 1) { state.projectInfo.stageProcessList.forEach((t) => { - if(t.studyModel == 1){ + if (t.studyModel == 1) { state.projectInfo.stageProcessList?.forEach((t1) => { t1.statusName = "已完成"; const stageState = t1.taskProcessList?.some((s) => { @@ -44,7 +49,7 @@ export default createStore({ return stageState; }); } - else{ + else { t.statusName = "进行中"; t.taskProcessList?.forEach((s) => s.statusName = (s.status === 1) ? "已完成" : s.status === 2 ? (s.statusName = "进行中") : TASK_TYPES.toName[s.type]); t.taskProcessList?.every((s) => s.status === 1) && (t.statusName = "已完成"); @@ -52,31 +57,31 @@ export default createStore({ }); return; } - state.projectInfo.stageProcessList.forEach((item,i)=>{ - if(item.studyModel == 1){ + state.projectInfo.stageProcessList.forEach((item, i) => { + if (item.studyModel == 1) { state.projectInfo.stageProcessList?.some((t) => { t.statusName = "已完成"; const stageState = t.taskProcessList?.some((s) => { s.unlock = true; s.statusName = "已完成"; - s.status !== 1 && (s.statusName = s.status==2? '进行中' : TASK_TYPES.toName[s.type]) + s.status !== 1 && (s.statusName = s.status == 2 ? '进行中' : TASK_TYPES.toName[s.type]) return state.projectInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag) }); stageState && (t.statusName = "进行中"); return stageState; }); - }else{ - if(i == 0){ + } else { + if (i == 0) { item.statusName = "进行中"; item.taskProcessList?.forEach((s) => s.statusName = (s.status === 1) ? "已完成" : s.status === 2 ? (s.statusName = "进行中") : TASK_TYPES.toName[s.type]); item.taskProcessList?.every((s) => s.status === 1) && (item.statusName = "已完成"); } - if(i > 0){ - if(state.projectInfo.stageProcessList[i-1].statusName == "已完成"){ + if (i > 0) { + if (state.projectInfo.stageProcessList[i - 1].statusName == "已完成") { item.statusName = "进行中"; item.taskProcessList?.forEach((s) => s.statusName = (s.status === 1) ? "已完成" : s.status === 2 ? (s.statusName = "进行中") : TASK_TYPES.toName[s.type]); item.taskProcessList?.every((s) => s.status === 1) && (item.statusName = "已完成"); - }else{ + } else { item.statusName = "未解锁"; } } @@ -117,6 +122,11 @@ export default createStore({ content.commit("INIT_PROJECT_INFO"); }); }, + getGrowthInfo(content, { routerId }) { + request(PROFESSIONAL_STUDENT_DETAIL(routerId)).then(res => { + content.commit("SET_GROWTH_INFO", res.data); + }) + }, getRouterInfo(content, { routerId, chapterId }) { request(ROUTER_PROCESS, chapterId ? { routerId, type: 2, chapterId } : { routerId, type: 2 }).then(res => { content.commit("SET_ROUTER_INFO", res.data); diff --git a/src/views/growth/growthList.vue b/src/views/growth/growthList.vue new file mode 100644 index 0000000..b05a377 --- /dev/null +++ b/src/views/growth/growthList.vue @@ -0,0 +1,1134 @@ + + + + + {{ data?.growthName }} + + 简介:{{ data.description }} + + + + + + 必修 + + + + 选修 + + + + + + + + + + + + + + + + + + {{ value.taskName }} + + + + 必修 + + + 选修 + + + {{ TASK_TYPES.typeName[value.courseType] || "" }} + + + + 当前进度 + + + + + + {{ parseInt(value.progress) }}% + + + + + + + {{TASK_TYPES.toName[value.courseType]}} + + + + + 已完成 + + + + + 进行中 + + + + + 未解锁 + + + + + + + + + + + + + + + + + 个人信息 + + + + + + + + + {{ userInfo?.realName }} + + + {{ userInfo?.bandDesc }} + + + + + + + 学习进度 + + + + + 上次学到:{{ data?.lastLearned }} + + 继续学习 + + + + + + 总进度 + + + + + + {{ totalProgress }}% + + + + + + + 必修进度 + + + + + + {{ requiredProgress }}% + + + + + + + 选修进度 + + + + + + {{ electiveProgress }}% + + + + + + + + + + + + + + {{ dialogVisibleTip }} + + + 取消 + 确定 + + + + + + + 开课列表 + + + X + + + + + + {{ item }} + + + 去上课 + + + + + + + + + diff --git a/src/views/growth/growthRoadmap.vue b/src/views/growth/growthRoadmap.vue new file mode 100644 index 0000000..5fbf546 --- /dev/null +++ b/src/views/growth/growthRoadmap.vue @@ -0,0 +1,390 @@ + + + + + + {{ data?.growthName }} + + 简介:{{ data.description }} + + + + + + 必修 + + + + 选修 + + + + + + + + + + + + + + + + + + + + + + {{ item.taskName }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.taskName }} + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vite.config.js b/vite.config.js index 22d158f..66e8d59 100644 --- a/vite.config.js +++ b/vite.config.js @@ -37,6 +37,11 @@ export default defineConfig(({ command, mode }) => }, server: { proxy: { + "/professional": { + // target: 'http://192.168.16.195:32002', + target: 'http://192.168.150.97:32002', + changeOrigin: true, + }, '/file/upload': { target: loadEnv(mode, process.cwd()).VITE_PROXY_URL, changeOrigin: true,