From 39f8bd9830cfc801e31be3f15c9cbb1ffa7ce447 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Sat, 10 Dec 2022 14:49:53 +0800 Subject: [PATCH 1/3] =?UTF-8?q?--=20=E6=96=B0=E5=BB=BA=E5=AD=A6=E5=91=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ThirdApi.js | 8 + src/api/index1.js | 32 +- src/api/method.js | 40 +-- src/api/request.js | 169 ++++++++++ src/components/student/Student.vue | 481 +++++++++++++++++++++++++++++ 5 files changed, 696 insertions(+), 34 deletions(-) create mode 100644 src/api/ThirdApi.js create mode 100644 src/api/request.js create mode 100644 src/components/student/Student.vue diff --git a/src/api/ThirdApi.js b/src/api/ThirdApi.js new file mode 100644 index 00000000..ae3a197a --- /dev/null +++ b/src/api/ThirdApi.js @@ -0,0 +1,8 @@ +export const BASE = 'https://pre.boe.com' +export const BASE_DEV = 'https://u-pre.boe.com' + +export const USER_LIST = '/userbasic/user/list post' +export const ORG_LIST = '/userbasic/org/list post' +export const ORG_CHILD_LIST = '/userbasic/org/info post' + +export const AUDIENCE_LIST = '/userbasic/audience/list post' \ No newline at end of file diff --git a/src/api/index1.js b/src/api/index1.js index d6390d53..ade98239 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -44,7 +44,7 @@ import qs from "qs"; //上传文件 export const uploadFile = (obj) => - http.post("/test/testRequest", qs.stringify({ obj })); + http.post("/test/testRequest", qs.stringify({obj})); // 接口-请求 @@ -56,7 +56,7 @@ export const getLearnPath = (obj) => http.post("/admin/router/list", obj); export const handleLearnPath = (obj) => http.post("/admin/router/handle", obj); //获取路径图统计数据 export const getLearnCount = (routerId) => - http.get("/admin/router/getCount", { params: { routerId: routerId } }); + http.get("/admin/router/getCount", {params: {routerId: routerId}}); //新建或编辑关卡 export const editChapter = (obj) => http.post("/admin/router/editChapter", obj); @@ -66,20 +66,20 @@ export const setConfig = (obj) => http.post("/admin/router/setConfig", obj); export const getStudent = (obj) => http.post("/admin/router/studentList", obj); //获取路径图详情-包含关卡及任务列表 export const getRouterDetail = (routerId) => - http.get("/admin/router/detail", { - params: { - routerId: routerId, - }, - }); + http.get("/admin/router/detail", { + params: { + routerId: routerId, + }, + }); //添加学员 export const addStudent = (obj) => http.post("/admin/router/addStudent", obj); //删除学员 export const delStudent = (obj) => - http.post("/admin/router/deleteStudent", obj); + http.post("/admin/router/deleteStudent", obj); // 获取学员路径图进度明细 export const stuProgress = (obj) => - http.post("/admin/router/studentProcess", obj); + http.post("/admin/router/studentProcess", obj); //编辑学习路径基本信息 export const editLearnInfo = (obj) => http.post('/admin/router/editInfo', obj) @@ -92,7 +92,6 @@ export const billboard = (obj) => http.post("/admin/project/billboard", obj); //项目基础信息----------------------------------- - //课程---------------------------------------------- // //提交审核 @@ -121,7 +120,7 @@ export const optionAuthPerm = (obj) => http.post('/admin/AuthPerm/optionAuthPerm //获取学员列表 export const getStuList = (obj) => http.post('/admin/orgStruct/getStudentRef', obj) //获取用户登录 -export const getUser = () => http.post('/admin/CheckUser/login', { withCredentials: true }) +export const getUser = () => http.post('/admin/CheckUser/login', {withCredentials: true}) //公共信息--------------------------------------------------- //添加项目学员 @@ -131,14 +130,15 @@ export const addStudentCourse = (obj) => http.post("/admin/offcourse/addStudent" // 获取组织结构树 export const orgtree = () => http.get("/org/tree"); +export const saveStu = obj => http.post("/admin/student/addStudent", obj); //获取积分列表 export const noticeList = (projectId) => - http.post( - `/admin/project/noticeList?projectId=` + - projectId + - `` - ); + http.post( + `/admin/project/noticeList?projectId=` + + projectId + + `` + ); // 测试方法 // import * as api from '../../api/index' diff --git a/src/api/method.js b/src/api/method.js index 8571f54e..a10dafa0 100644 --- a/src/api/method.js +++ b/src/api/method.js @@ -1,4 +1,5 @@ import * as api from './index1' + function formatNumber(n) { n = n.toString(); return n[1] ? n : "0" + n; @@ -192,31 +193,33 @@ const setCookie = (name, value, perpetual) => { //先写一个方法 function getCookie(name) { + return document.cookie?.split(";").find(e => e.includes(name)).replace(`${name}=`,'') || '' //1.获取cookie字符串 - var cookies = document.cookie; - //通过;来分割字符串 - var cookie = cookies.split("; "); - // console.log('cookie', cookie) - //遍历,使键值对匹配上 - for (var i = 0; i < cookie.length; i++) { - var arr = cookie[i].split("token="); - // console.log('arr', arr) - console.log('name', name) - // if (arr[0] == name) { - // console.log('arr[1]', arr[1]) - // return arr[1]; - // } - // console.log('arr[1]', arr[1]) - return arr[1] - } - return ""; + // const cookies = document.cookie; + // console.log('cookies',cookies) + // //通过;来分割字符串 + // const cookie = cookies.split(";"); + // // console.log('cookie', cookie) + // //遍历,使键值对匹配上 + // for (var i = 0; i < cookie.length; i++) { + // var arr = cookie[i].split("token="); + // // console.log('arr', arr) + // console.log('name', name) + // // if (arr[0] == name) { + // // console.log('arr[1]', arr[1]) + // // return arr[1]; + // // } + // // console.log('arr[1]', arr[1]) + // return arr[1] + // } + // return ""; } //滚动加载信息 const scrollLoad = (e) => { // console.log("滚动", e, b); - const { target } = e; + const {target} = e; const scrllHeight = target.scrollHeight - target.scrollTop; const clientHeight = target.clientHeight; // console.log("scrllHeight", scrllHeight, clientHeight); @@ -226,6 +229,7 @@ const scrollLoad = (e) => { return 2 } }; + //添加归属权 function changeOwnership(classify, selectProjectId, selectPeopleArr) { let obj = { diff --git a/src/api/request.js b/src/api/request.js new file mode 100644 index 00000000..818d666e --- /dev/null +++ b/src/api/request.js @@ -0,0 +1,169 @@ +import {reactive, ref, toRefs, watch} from "vue"; +import axios from 'axios'; +import {getCookie} from "@/api/method"; + + +export function useBoeApiPage(_url, params = {}, config = { + init: true, + result: res => res.result, + totalPage: res => res.result.totalPage, + total: res => res.result.totalElement +}) { + + const state = reactive({ + data: [], + loading: false, + page: 1, + pageSize: 10, + totalPage: 0, + total: 0 + }) + + function fetch() { + console.log('params', params) + state.loading = true + return request(_url, params).then(r => { + state.data = config.result(r) + state.totalPage = config.totalPage(r) + state.total = config.total(r) + state.loading = false + state.page = params.page + }) + } + + config.init && fetch() + return { + ...toRefs(state), + fetch, + }; +} + +export function useBoeApi(_url, params = {}, config = { + init: true, + result: res => res.result, +}) { + + const state = reactive({ + data: [], + loading: false, + }) + watch(() => params, () => { + fetch() + }) + + function fetch() { + state.loading = true + return request(_url, params).then(r => { + state.data = config.result(r) + state.loading = false + }) + } + + config.init && fetch() + return { + ...toRefs(state), + fetch, + }; +} + +export function usePage(_url, params = {}, init = true) { + + const state = reactive({ + data: [], + loading: false + }) + + watch(params, () => { + fetch() + }) + + function fetch() { + state.loading = true + return request(_url, params).then(r => { + console.log('fetch') + console.log(r) + state.data = r.result + state.loading = false + }) + } + + init && fetch() + return { + ...toRefs(state), + fetch, + }; +} + +export function useRequest(_url, params = {}, init = true) { + + const data = ref({}) + const loading = ref(false) + + watch(params, () => { + fetchData() + }) + + function fetchData() { + loading.value = true + request(_url, params).then(r => { + data.value = r + loading.value = false + }) + } + + init && fetchData() + return { + data, + loading, + fetchData, + }; +} + +export async function request(_url, params) { + const s = _url.split(' ') + let url = s[0] + const method = s[1] || '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 || {} : {} + console.log('token', getCookie('token')) + return axios({ + url, + method, + headers: { + token: getCookie('token'), + ...method !== 'get' ? {'Content-Type': 'application/json'} : {} + }, + baseURL: '', + ...method !== 'get' ? {data: JSON.stringify(body)} : {} + }).then(resp => resp.data).then(response => { + console.log(response) + // if (response.status !== 200 && response.code !== 0) { + // if (response.code === 3 || response.code === 4 || response.code === 100) { +// router.push({path: '/login'}) +// return +// } else { +// response.showMsg && notification.open({ +// message: response.showMsg, +// duration: 2, +// }); +// return +// } +// } + return response + }).catch(e => { + console.log(2222) + console.log(e) + // router.push({path: '/login'}) + }) +} \ No newline at end of file diff --git a/src/components/student/Student.vue b/src/components/student/Student.vue new file mode 100644 index 00000000..38dbd4ad --- /dev/null +++ b/src/components/student/Student.vue @@ -0,0 +1,481 @@ + + + \ No newline at end of file From 0ec71a065ff24965ce10f56e5f7533984c03c6c5 Mon Sep 17 00:00:00 2001 From: lixg Date: Sat, 10 Dec 2022 15:22:03 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E9=9D=A2=E6=8E=88?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 42 +++++++++++------- src/api/config.js | 4 +- src/components/drawers/AddFaceteach.vue | 46 ++++++++++++-------- src/components/drawers/AddOnline.vue | 37 +++++++++------- src/components/project/ProjectManager.vue | 2 +- src/views/courselibrary/CoursewareManage.vue | 41 +++++++++++++---- src/views/learningpath/LearningPath.vue | 1 + 7 files changed, 112 insertions(+), 61 deletions(-) diff --git a/public/index.html b/public/index.html index 3e5a1396..5182965d 100644 --- a/public/index.html +++ b/public/index.html @@ -1,17 +1,29 @@ + - - - - - - <%= htmlWebpackPlugin.options.title %> - - - -
- - - + + + + + + + 京东方大学堂 + + + + +
+ + + + \ No newline at end of file diff --git a/src/api/config.js b/src/api/config.js index af18a217..160018ed 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-11-21 14:32:52 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2022-12-09 18:11:04 + * @LastEditTime: 2022-12-10 10:37:11 * @FilePath: /fe-manage/src/api/config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -56,7 +56,7 @@ http.interceptors.response.use( return response; } else { if (code === 1000) { - window.open("https://u-pre.boe.com/web/", '_self'); + // window.open("https://u-pre.boe.com/web/", '_self'); // window.open("http://111.231.196.214:12013/manage/login", '_self'); } console.log("api %o", msg); diff --git a/src/components/drawers/AddFaceteach.vue b/src/components/drawers/AddFaceteach.vue index ef068b98..e931e191 100644 --- a/src/components/drawers/AddFaceteach.vue +++ b/src/components/drawers/AddFaceteach.vue @@ -29,13 +29,16 @@ 课程名称: -
+
+
+ {{ courseName.length }}/20 +
@@ -95,7 +98,7 @@
授课教师: -
+
- --> + -->
@@ -358,7 +361,9 @@
- {{testName}} + {{ + testName + }}
@@ -405,8 +410,8 @@ import ProjectManager from "@/components/project/ProjectManagerNew"; import { detail } from "../../api/indexCourse"; import { queryAppraiseDetailById } from "../../api/indexInvist"; -import {queryWorkDetailById} from "@/api/indexWork"; -import {queryExaminationDetailById} from "@/api/indexExam"; +import { queryWorkDetailById } from "@/api/indexWork"; +import { queryExaminationDetailById } from "@/api/indexExam"; export default { name: "AddFaceteach", components: { @@ -609,19 +614,22 @@ export default { state.EditWorkId = result.homeWorkId; state.assessmentId = result.evaluateId; state.needEval = result.evaluateId; - detail({offcourseId:result.offcourseId}).then((res)=>{ - state.chooseCourseName =res.data.data.name; - + detail({ offcourseId: result.offcourseId }).then((res) => { + state.chooseCourseName = res.data.data.name; }); - queryAppraiseDetailById({assessmentId:result.evaluateId}).then((res)=>{ - state.assessmentName =res.data.data.assessmentName; - }); - queryWorkDetailById({workId:result.homeWorkId}).then((res)=>{ + queryAppraiseDetailById({ assessmentId: result.evaluateId }).then( + (res) => { + state.assessmentName = res.data.data.assessmentName; + } + ); + queryWorkDetailById({ workId: result.homeWorkId }).then((res) => { state.workName = res.data.data.workName; }); - queryExaminationDetailById({ examinationId: result.testId }).then((res)=>{ - state.testName = res.data.data.examinationName; - }); + queryExaminationDetailById({ examinationId: result.testId }).then( + (res) => { + state.testName = res.data.data.examinationName; + } + ); console.log("state=======", state); }); }; @@ -730,7 +738,7 @@ export default { await ProjectEditTask(editObj) .then(() => { console.log("props.EditFaceId", props.EditFaceId); - // message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`); + // message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`); }) .catch(() => { //message.error(`${props.EditFaceId ? "编辑" : "新增"}阶段任务失败`); diff --git a/src/components/drawers/AddOnline.vue b/src/components/drawers/AddOnline.vue index a52a58bd..2d0a86b2 100644 --- a/src/components/drawers/AddOnline.vue +++ b/src/components/drawers/AddOnline.vue @@ -31,7 +31,8 @@ /> -
+ +
@@ -98,7 +99,7 @@
{ - console.log(res) - console.log("模板项目中是否包含此在线课了", res); + }) + .then((res) => { + console.log(res); + console.log("模板项目中是否包含此在线课了", res); if (res.data.data.length) { let strdata = res.data.data; let tipStr = ""; @@ -599,21 +601,26 @@ export default { type: 1, }) .then((res) => { - console.log('新增或者编辑在线课',res) + console.log("新增或者编辑在线课", res); message.destroy(); - message.success(`${props.edit ? "编辑" : "新增"}模板库任务成功`); + message.success( + `${props.edit ? "编辑" : "新增"}模板库任务成功` + ); ctx.emit("changeData", false); closeDrawer(); }) .catch(() => { message.destroy(); - message.error(`${props.edit ? "编辑" : "新增"}模板库任务失败`); + message.error( + `${props.edit ? "编辑" : "新增"}模板库任务失败` + ); }); - }) + }); } - }).catch(err=>{ - console.log(err) - }) + }) + .catch((err) => { + console.log(err); + }); } //if(state.addOnlineList.Target==undefined){ // closeDrawer(); diff --git a/src/components/project/ProjectManager.vue b/src/components/project/ProjectManager.vue index af03202f..543e1b9c 100644 --- a/src/components/project/ProjectManager.vue +++ b/src/components/project/ProjectManager.vue @@ -69,7 +69,7 @@ export default { onMounted(() => { console.log("onMounted"); - init() + init(); }); function getMember() { diff --git a/src/views/courselibrary/CoursewareManage.vue b/src/views/courselibrary/CoursewareManage.vue index a708bb63..6fb2e08f 100644 --- a/src/views/courselibrary/CoursewareManage.vue +++ b/src/views/courselibrary/CoursewareManage.vue @@ -630,7 +630,17 @@ {{ item.name }}
-->
- {{ item.slice(item.lastIndexOf('/')+1) }} + {{ item.slice(item.lastIndexOf("/") + 1) }}
-
-
- - - - 是否BOEU实施
-
+
+
+
同步学习记录
+
+
+ 同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程) +
+
+
+
+
项目说明
+
+
+ +
+
@@ -569,7 +525,7 @@ export default { } .active { - border: 1px solid rgba(78, 166, 255, 1); + border: 2px solid rgba(78, 166, 255, 1); } .content { diff --git a/src/views/projectcenter/ProjectManage.vue b/src/views/projectcenter/ProjectManage.vue index 2b732e4a..9e9901f5 100644 --- a/src/views/projectcenter/ProjectManage.vue +++ b/src/views/projectcenter/ProjectManage.vue @@ -1304,7 +1304,7 @@ export default { title: "项目名称", dataIndex: "name", key: "name", - width: 280, + width: 480, // align: "center", ellipsis: true, // scopedSlots: { customRender: "action" }, //引入的插槽 @@ -1316,8 +1316,9 @@ export default { { title: "项目经理", dataIndex: "manager", + ellipsis: true, key: "manager", - width: 100, + width: 300, align: "center", }, { @@ -1394,7 +1395,7 @@ export default { dataIndex: "operation", key: "operation", width: 300, - align: "center", + align: "right", fixed: "right", customRender: (value) => { // console.log("value", value.record.type, value.record.status);