diff --git a/.env b/.env index db809cc..4dbec28 100644 --- a/.env +++ b/.env @@ -2,7 +2,8 @@ VITE_BASE=/fe-student-h5 VITE_BASE_API= VITE_OUTPUT_DIR=./dist VITE_BASE_LOGIN_URL=//u-pre.boe.com/m/loginuser?returnUrl= -VITE_PROXY_URL=http://43.143.139.204/manageApi +# VITE_PROXY_URL=http://43.143.139.204/manageApi +VITE_PROXY_URL=https://u-pre.boe.com/manageApi # 在线 VITE_BOE_ONLINE_CLASS_URL=//u-pre.boe.com/mobile/pages/study/courseStudy?id= diff --git a/package-lock.json b/package-lock.json index a840f86..37ef660 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14860,7 +14860,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", @@ -14873,7 +14872,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" }, @@ -15733,9 +15731,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 80a15b5..56456dc 100644 --- a/src/api/CONST.js +++ b/src/api/CONST.js @@ -9,6 +9,7 @@ export const PROJECT = 1; export const ROUTER = 2; export const COURSE = 3; +export const GROWTH = 4 export const TASK_TYPES = { typeName: { 1: "在线", diff --git a/src/api/api.js b/src/api/api.js index 9898423..a37ae8a 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -94,4 +94,16 @@ export const QueryEvaluationTaskStatusOne = `/evaluation/queryEvaluationTaskStat export const EditVoteInvolvedAndBrowse = `/vote/editVoteInvolvedAndBrowse post` export const NO_COMMIT = `/voteSubmit/vote/nocommit post` //任务是否删除 -export const checkStudentExist = `/admin/taskmanage/checkStudentExist post` \ No newline at end of file +export const checkStudentExist = `/admin/taskmanage/checkStudentExist post` + + + +/**专业力必修模块 */ +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/growthRequest.js b/src/api/growthRequest.js new file mode 100644 index 0000000..e823494 --- /dev/null +++ b/src/api/growthRequest.js @@ -0,0 +1,160 @@ +import router from "@/router"; +import {reactive, ref, toRefs, watch} from "vue"; +import axios from 'axios'; +import {getCookie} from "@/api/utils"; +import JSONBigInt from 'json-bigint'; +import {ElMessage} from "element-plus"; + +const JSONBigIntStr = JSONBigInt({storeAsString: true}); + +export function usePage(_url, param, callback) { + + const state = reactive({ + data: {}, + loading: false, + total: 0, + size: 10, + current: 1, + params: {pageNo: 1, pageSize: 10, ...param} + }) + + watch(param, () => { + state.params = {...state.params, ...param} + fetchData() + }) + + function fetchData() { + state.loading = true + request(_url, state.params).then(r => { + state.params.pageNo === 1 ? (state.data = (r.data.records || r.data.rows)) : (state.data = [...state.data, ...(r.data.records || r.data.rows)]) + state.size = r.data.size + state.total = r.data.total + state.current = r.data.current + state.loading = false + callback && callback(r) + }) + } + + fetchData() + return { + ...toRefs(state), + fetchData, + }; +} + +export function useRequest(_url, params = {}, callback) { + + const state = reactive({ + data: {}, + loading: false, + + }) + + watch(params, () => { + fetchData() + }) + + function fetchData() { + state.loading = true + request(_url, params).then(r => { + state.data = r.data + state.loading = false + callback&&callback(r) + }) + } + + fetchData() + return { + ...toRefs(state), + fetchData, + }; +} + +export async function growthRequest(_url, params) { + const s = _url.split(' ') + let url = s[0] + const method = s[1]?.toLowerCase() || 'get' + if (method === 'get') { + let paramsArray = []; + //拼接参数 + if (params) { + Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key])) + if (url.search(/\?/) === -1) { + url += '?' + paramsArray.join('&') + } else { + url += '&' + paramsArray.join('&') + } + } + } + const body = method !== 'get' ? params || {} : {} + return axios({ + url, + method, + headers: { + 'token': getCookie('token'), + ...method !== 'get' ? {'Content-Type': 'application/json'} : {} + }, + ...method !== 'get' ? {data: JSON.stringify(body)} : {} + }).then(resp => resp.data).then(response => { + if (response.code !== 200 && response.code !== 0) { + if (response.code === 1000) (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL, '_top') + + else if (response.code === 2001) router.push({path: '/FaceTeachSignUp', query: {courseId: router.currentRoute.value.query.courseId,type:3}}) + + else if (response.code === 2002) router.push({path: '/FaceTeachNoCommon', query: {courseId: router.currentRoute.value.query.courseId,type:3}}) + else if (response.code === 9000) ElMessage.warning("该数据已经被删除或停用,请联系管理员"); + + // if (import.meta.env.DEV && response.code === 1000) { + // router.push({path: '/login'}) + // } else { + // window.open() + // response.showMsg && notification.open({ + // message: response.showMsg, + // duration: 2, + // }); + // } + } + return response + }) +} + +export async function boeRequest(_url, params) { + const s = _url.split(' ') + let url = s[0] + const method = s[1]?.toLowerCase() || 'get' + if (method === 'get') { + let paramsArray = []; + //拼接参数 + if (params) { + Object.keys(params).forEach(key => paramsArray.push(key + '=' + params[key])) + if (url.search(/\?/) === -1) { + url += '?' + paramsArray.join('&') + } else { + url += '&' + paramsArray.join('&') + } + } + } + const body = method !== 'get' ? params || {} : {} + return fetch(url, { + method, + headers: { + token: getCookie('token'), + ...method !== 'get' ? {'Content-Type': 'application/json'} : {} + }, + ...method !== 'get' ? {body: JSON.stringify(body)} : {} + }).then(res => { + return res.text() + }).then(res => { + return JSONBigIntStr.parse(res) + }) +} + +const httpupload = axios.create({ + baseURL: process.env.VUE_APP_BASE_API, + timeout: 1000 * 15, + headers: { "Content-Type": "multipart/form-data" }, +}); + +export const fileUp = (data) => httpupload.post( import.meta.env.VITE_BASE_API+"/file/upload", data, { + headers: { "Content-Type": "multipart/form-data" }, +}); \ 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 8f659eb..b3df2e9 100644 --- a/src/main.js +++ b/src/main.js @@ -6,8 +6,16 @@ import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' import zhCn from 'element-plus/es/locale/lang/zh-cn' import "@/assets/scss/common.scss" +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 9111ef0..99d9196 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -7,7 +7,7 @@ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import { createStore } from 'vuex' -import { PROJECT_PROCESS, ROUTER_PROCESS } from "@/api/api"; +import { PROJECT_PROCESS, ROUTER_PROCESS,PROFESSIONAL_STUDENT_DETAIL } from "@/api/api"; import { request } from "@/api/request"; import { TASK_TYPES } from "@/api/CONST"; @@ -15,12 +15,16 @@ export default createStore({ state: { userInfo: {}, projectInfo: {}, - routerInfo: {} + routerInfo: {}, + growthInfo:{} }, getters: { }, mutations: { + SET_GROWTH_INFO(state, info) { + state.growthInfo = info; + }, SET_USER(state, userInfo) { state.userInfo = userInfo }, @@ -121,6 +125,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, { routerId, chapterId }).then(res => { content.commit('SET_ROUTER_INFO', res.data) diff --git a/src/views/growth/growthDetails.vue b/src/views/growth/growthDetails.vue new file mode 100644 index 0000000..3188fc7 --- /dev/null +++ b/src/views/growth/growthDetails.vue @@ -0,0 +1,764 @@ + + + + + + + 必修 + + + + 选修 + + + + + + + + + + + + + + 未开始 + 已完成 + 进行中 + + + + + + + + + + + + + + 【{{ TASK_TYPES.typeName[item.courseType] || "" }}】 + {{ item.taskName }} + + + + + + + + + {{ item.progress }}% + + + + + + + + + + {{ TASK_TYPES.toName[item.courseType] }} + + + + + 已完成 + + + + + 进行中 + + + + + 继续学习 + + + + + 未解锁 + + + + + + + + + + + + + + + + + + + + + {{ item }} + + + 去上课 + + + + + + + + + + diff --git a/src/views/growth/growthPath.vue b/src/views/growth/growthPath.vue new file mode 100644 index 0000000..564e5c2 --- /dev/null +++ b/src/views/growth/growthPath.vue @@ -0,0 +1,589 @@ + + + + + + + 必修 + + + + 选修 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ + `${item.taskName}${ + item.completionStatus === "10" ? "(未解锁)" : "" + }` + }} + + + + + + + + + + {{ item.taskName }} + + + + + + + + + + + + + + + + + + + + {{ item }} + + + 去上课 + + + + + + + + + + diff --git a/vite.config.js b/vite.config.js index 39f4c2d..956d935 100644 --- a/vite.config.js +++ b/vite.config.js @@ -17,7 +17,7 @@ const path = require("path"); export default defineConfig(({ command, mode }) => ({ - host: "192.158.3.51", + // host: "192.158.3.51", base: loadEnv(mode, process.cwd()).VITE_BASE, build: { outDir: loadEnv(mode, process.cwd()).VITE_OUTPUT_DIR, @@ -41,8 +41,13 @@ export default defineConfig(({ command, mode }) => ] }, server: { - host: "192.168.3.51", + // host: "192.168.3.51", proxy: { + "/professional": { + // target: 'http://192.168.237.141:32002', + target: 'http://192.168.150.97:32002', + changeOrigin: true, + }, "/file/upload": { target: loadEnv(mode, process.cwd()).VITE_PROXY_URL, changeOrigin: true,