|
|
@@ -47,7 +47,7 @@
|
|
|
<!-- v-if="isupdateCourse" -->
|
|
|
<!-- v-if="isupdateCourse && item.courseType == '1'" -->
|
|
|
<el-popover v-if="isupdateCourse" placement="bottom" :width="210"
|
|
|
- trigger="click" show-after="500" @hide="checked1 = false">
|
|
|
+ trigger="click" :show-after="500" @hide="checked1 = false">
|
|
|
<template #reference>
|
|
|
<img :src="DownloadImg" v-if="item.json.courseType == '2'" alt="">
|
|
|
<img :src="DownloadImg" v-else alt="" @click="getDate(item.json.dataId)">
|
|
|
@@ -116,7 +116,7 @@
|
|
|
</el-tooltip>
|
|
|
|
|
|
<el-popover v-if="isupdateCourse" placement="bottom" :width="210"
|
|
|
- trigger="click" show-after="500" @hide="checked1 = false">
|
|
|
+ trigger="click" :show-after="500" @hide="checked1 = false">
|
|
|
<template #reference>
|
|
|
<img :src="DownloadImg" v-if="item.courseType == '2'" alt="">
|
|
|
<img :src="DownloadImg" v-else alt="" @click="getDate(item.dataId)">
|
|
|
@@ -413,16 +413,16 @@ const clickmod = val => {
|
|
|
currentAI6Data.value = AI6Data.value[val]
|
|
|
}
|
|
|
}
|
|
|
-const SwitchCourseType = (val) => {
|
|
|
- courseTypeShow.value = val
|
|
|
- if (val) {
|
|
|
- courseData.value = courseDataJson.new
|
|
|
- volumes.value = true
|
|
|
- } else {
|
|
|
- courseData.value = courseDataJson.old
|
|
|
- }
|
|
|
- currentData.value = courseData.value[selectGrand.value]
|
|
|
-}
|
|
|
+// const SwitchCourseType = (val) => {
|
|
|
+// courseTypeShow.value = val
|
|
|
+// if (val) {
|
|
|
+// courseData.value = courseDataJson.new
|
|
|
+// volumes.value = true
|
|
|
+// } else {
|
|
|
+// courseData.value = courseDataJson.old
|
|
|
+// }
|
|
|
+// currentData.value = courseData.value[selectGrand.value]
|
|
|
+// }
|
|
|
const getImageUrl = (url) => {
|
|
|
return new URL(url, import.meta.url).href
|
|
|
}
|
|
|
@@ -470,10 +470,13 @@ const getCourseid2 = (id, type) => {
|
|
|
|
|
|
const openCourseDetail = (id) => {
|
|
|
console.log(user.user)
|
|
|
- // 会返回复制得课程
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
|
- console.log(res)
|
|
|
- if (res.value[0].length > 0) {
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz', {id: id +','+ user.user.userid}, {
|
|
|
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
+ withCredentials: true
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log('openCourseDetail',res)
|
|
|
+ if (res.data[0].length > 0) {
|
|
|
// let isSave = res.value[0].filter(x => {
|
|
|
// return x.courseId == id
|
|
|
// })
|
|
|
@@ -488,13 +491,42 @@ const openCourseDetail = (id) => {
|
|
|
}
|
|
|
// https://pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?userid=0c3735c9-a2ef-11ef-9b30-005056b86db5&oid=414f2361-ad04-11ed-b13d-005056b86db5&org=0fec3a8a-ad04-11ed-b13d-005056b86db5&courseId=91886917-2f3b-11f1-bcd9-005056924926&tType=1&cid=&screenType=2
|
|
|
|
|
|
- let url2 = `${url}/pbl-student-table/dist/#/courseDetail?userid=${user.user.userid}&oid=${user.user.organizeid}&org=${user.user.org}&courseId=${res.value[0][0].courseId}&tType=1&cid=&screenType=2`
|
|
|
+ let url2 = `${url}/pbl-student-table/dist/#/courseDetail?userid=${user.user.userid}&oid=${user.user.organizeid}&org=${user.user.org}&courseId=${res.data[0][0].courseId}&tType=1&cid=&screenType=2`
|
|
|
+ console.log(url2, "url2")
|
|
|
// top.U.MD.D.I.openInApplication("studyDetail", res.value[0][0].courseId, 2, user.user.type);
|
|
|
top.U.MD.D.I.openInApplication('setUrl',{url:url2,title:'课程详情',id:new Date().getTime()})
|
|
|
} else {
|
|
|
updateCourseId(id, "studyDetail")
|
|
|
}
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ // 会返回复制得课程
|
|
|
+ // top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
|
+ // console.log(res)
|
|
|
+ // if (res.value[0].length > 0) {
|
|
|
+ // // let isSave = res.value[0].filter(x => {
|
|
|
+ // // return x.courseId == id
|
|
|
+ // // })
|
|
|
+ // //这个是打开指定的课程接口
|
|
|
+ // let url = '';
|
|
|
+ // if (lang.lang == 'hk') {
|
|
|
+ // url = "https://pbl.cocorobo.hk"
|
|
|
+ // }else if (lang.lang == 'en') {
|
|
|
+ // url = "https://pbl.cocorobo.com"
|
|
|
+ // }else{
|
|
|
+ // url = "https://pbl.cocorobo.cn"
|
|
|
+ // }
|
|
|
+ // // https://pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?userid=0c3735c9-a2ef-11ef-9b30-005056b86db5&oid=414f2361-ad04-11ed-b13d-005056b86db5&org=0fec3a8a-ad04-11ed-b13d-005056b86db5&courseId=91886917-2f3b-11f1-bcd9-005056924926&tType=1&cid=&screenType=2
|
|
|
+
|
|
|
+ // let url2 = `${url}/pbl-student-table/dist/#/courseDetail?userid=${user.user.userid}&oid=${user.user.organizeid}&org=${user.user.org}&courseId=${res.value[0][0].courseId}&tType=1&cid=&screenType=2`
|
|
|
+ // // top.U.MD.D.I.openInApplication("studyDetail", res.value[0][0].courseId, 2, user.user.type);
|
|
|
+ // top.U.MD.D.I.openInApplication('setUrl',{url:url2,title:'课程详情',id:new Date().getTime()})
|
|
|
+ // } else {
|
|
|
+ // updateCourseId(id, "studyDetail")
|
|
|
+ // }
|
|
|
+ // }, [], { "type": "POST", "withCredentials": true });
|
|
|
|
|
|
}
|
|
|
const getTimeCourse = (id, item) => {
|
|
|
@@ -503,9 +535,20 @@ const getTimeCourse = (id, item) => {
|
|
|
}
|
|
|
try {
|
|
|
setIntervalNum.value = setInterval(() => {
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/addOperationTimeT", [user.user.userid, id, '5', 30], function (res) {
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/pbl/addOperationTimeT', {userid: user.user.userid, id: id, type: '5', time: 30}, {
|
|
|
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
+ withCredentials: true
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
console.log(res, "22222222222222222");
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ // top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/addOperationTimeT", [user.user.userid, id, '5', 30], function (res) {
|
|
|
+ // console.log(res, "22222222222222222");
|
|
|
+ // }, [], { "type": "POST", "withCredentials": true });
|
|
|
+
|
|
|
}, 30000)
|
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
|
@@ -542,28 +585,34 @@ const getTimeCourse = (id, item) => {
|
|
|
})
|
|
|
}, interValtTime);
|
|
|
}
|
|
|
-const updateCourse = (id, item) => {
|
|
|
- // 会返回courseId和state 两个参数 然后打开
|
|
|
- getTimeCourse(id, item)
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
|
- console.log(res)
|
|
|
- if (res.value[0].length > 0) {
|
|
|
- // let isSave = res.value[0].filter(x => {
|
|
|
- // return x.courseId == id
|
|
|
- // })
|
|
|
- top.U.MD.D.I.openInApplication('openCourseNewUpdate', res.value[0][0].courseId); //这个是打开指定的课程接口
|
|
|
- } else {
|
|
|
- updateCourseId(id, "openCourseNewUpdate")
|
|
|
- }
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
-}
|
|
|
+// const updateCourse = (id, item) => {
|
|
|
+// // 会返回courseId和state 两个参数 然后打开
|
|
|
+// getTimeCourse(id, item)
|
|
|
+// top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
|
+// console.log(res)
|
|
|
+// if (res.value[0].length > 0) {
|
|
|
+// // let isSave = res.value[0].filter(x => {
|
|
|
+// // return x.courseId == id
|
|
|
+// // })
|
|
|
+// top.U.MD.D.I.openInApplication('openCourseNewUpdate', res.value[0][0].courseId); //这个是打开指定的课程接口
|
|
|
+// } else {
|
|
|
+// updateCourseId(id, "openCourseNewUpdate")
|
|
|
+// }
|
|
|
+// }, [], { "type": "POST", "withCredentials": true });
|
|
|
+// }
|
|
|
|
|
|
const updateCourseId = (id, type) => {
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/copyCourseSz", [id, user.user.userid], function (res) {
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/pbl/copyCourseSz', {id: id +','+ user.user.userid}, {
|
|
|
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
+ withCredentials: true
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+
|
|
|
+ // top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/copyCourseSz", [id, user.user.userid], function (res) {
|
|
|
console.log(res)
|
|
|
- if (res.value[0][0].courseId != "") {
|
|
|
+ if (res.data[0][0].courseId != "") {
|
|
|
if (type == "openCourseNewUpdate") {
|
|
|
- top.U.MD.D.I.openInApplication("openCourseNewUpdate", res.value[0][0].courseId)
|
|
|
+ top.U.MD.D.I.openInApplication("openCourseNewUpdate", res.data[0][0].courseId)
|
|
|
} else {
|
|
|
let url = '';
|
|
|
if (lang.lang == 'hk') {
|
|
|
@@ -575,39 +624,50 @@ const updateCourseId = (id, type) => {
|
|
|
}
|
|
|
// https://pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?userid=0c3735c9-a2ef-11ef-9b30-005056b86db5&oid=414f2361-ad04-11ed-b13d-005056b86db5&org=0fec3a8a-ad04-11ed-b13d-005056b86db5&courseId=91886917-2f3b-11f1-bcd9-005056924926&tType=1&cid=&screenType=2
|
|
|
|
|
|
- let url2 = `${url}/pbl-student-table/dist/#/courseDetail?userid=${user.user.userid}&oid=${user.user.organizeid}&org=${user.user.org}&courseId=${res.value[0][0].courseId}&tType=1&cid=&screenType=2`
|
|
|
+ let url2 = `${url}/pbl-student-table/dist/#/courseDetail?userid=${user.user.userid}&oid=${user.user.organizeid}&org=${user.user.org}&courseId=${res.data[0][0].courseId}&tType=1&cid=&screenType=2`
|
|
|
// top.U.MD.D.I.openInApplication("studyDetail", res.value[0][0].courseId, 2, user.user.type);
|
|
|
top.U.MD.D.I.openInApplication('setUrl',{url:url2,title:'课程详情',id:new Date().getTime()})
|
|
|
// top.U.MD.D.I.openInApplication("studyDetail", res.value[0][0].courseId, 3, user.user.type);
|
|
|
}
|
|
|
}
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-const ReductionCourse = id => {
|
|
|
- // updateReductionId.value = id
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
|
- console.log(res)
|
|
|
- if (res.value[0].length > 0) {
|
|
|
- // let isSave = res.value[0].filter(x => {
|
|
|
- // return x.courseId == id
|
|
|
- // })
|
|
|
- dialogVisible.value = true
|
|
|
- updateReductionId.value = res.value[0][0].courseId
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- message: '该课程就是最初课程,不能还原',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- }
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
-}
|
|
|
+// const ReductionCourse = id => {
|
|
|
+// // updateReductionId.value = id
|
|
|
+// top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/getcopyCourseByUseridSz", [id, user.user.userid], function (res) {
|
|
|
+// console.log(res)
|
|
|
+// if (res.value[0].length > 0) {
|
|
|
+// // let isSave = res.value[0].filter(x => {
|
|
|
+// // return x.courseId == id
|
|
|
+// // })
|
|
|
+// dialogVisible.value = true
|
|
|
+// updateReductionId.value = res.value[0][0].courseId
|
|
|
+// } else {
|
|
|
+// ElMessage({
|
|
|
+// message: '该课程就是最初课程,不能还原',
|
|
|
+// type: 'warning',
|
|
|
+// })
|
|
|
+// }
|
|
|
+// }, [], { "type": "POST", "withCredentials": true });
|
|
|
+// }
|
|
|
|
|
|
const updateReduction = () => {
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/revertCourseSz", [updateReductionId.value], function (res) {
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/pbl/revertCourseSz', {id: updateReductionId.value}, {
|
|
|
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
+ withCredentials: true
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
console.log(res, "还原")
|
|
|
dialogVisible.value = false
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err, "还原")
|
|
|
+ dialogVisible.value = false
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const getDate = async (id) => {
|
|
|
@@ -615,14 +675,19 @@ const getDate = async (id) => {
|
|
|
let dataList = [];
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/selectCourseDetailSz", [id], function (res) {
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/pbl/selectCourseDetailSz', {id: id}, {
|
|
|
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
+ withCredentials: true
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
console.log(res);
|
|
|
- if (!res || !res.value || res.value[0].length === 0 || res.value[0][0].chapters.length === 0) {
|
|
|
+ console.log(res);
|
|
|
+ if (!res || !res.data || res.data[0].length === 0 || res.data[0][0].chapters.length === 0) {
|
|
|
reject(new Error("Invalid response or no chapters found"));
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const datachapters = JSON.parse(res.value[0][0].chapters);
|
|
|
+ const datachapters = JSON.parse(res.data[0][0].chapters);
|
|
|
|
|
|
for (let i = 0; i < datachapters.length; i++) {
|
|
|
const data = datachapters[i];
|
|
|
@@ -640,7 +705,10 @@ const getDate = async (id) => {
|
|
|
}
|
|
|
|
|
|
resolve(dataList);
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error("Error fetching data:", err);
|
|
|
+ });
|
|
|
})
|
|
|
.then((dataList) => {
|
|
|
getUpdateCourse(dataList, id);
|
|
|
@@ -708,9 +776,16 @@ const checkedAll = (id) => {
|
|
|
const downloadOne = async (url, fileName) => {
|
|
|
try {
|
|
|
console.log("urls", [user.user.userid, getUpdateCourseId.value, '4', 1])
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/addOperationTimeT", [user.user.userid, getUpdateCourseId.value, '4', 1], function (res) {
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/pbl/addOperationTimeT', {userid: user.user.userid, id: getUpdateCourseId.value, type: '4', time: 1}, {
|
|
|
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
+ withCredentials: true
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
console.log(res, '11111111111')
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error("Error fetching data:", err);
|
|
|
+ });
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
|
@@ -770,9 +845,16 @@ const DownloadProcessing = async () => {
|
|
|
|
|
|
try {
|
|
|
console.log("urls", [user.user.userid, getUpdateCourseId.value, '4', urls.length])
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/addOperationTimeT", [user.user.userid, getUpdateCourseId.value, '4', urls.length], function (res) {
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/pbl/addOperationTimeT', {userid: user.user.userid, id: getUpdateCourseId.value, type: '4', time: urls.length}, {
|
|
|
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
+ withCredentials: true
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
console.log(res, '11111111111')
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error("Error fetching data:", err);
|
|
|
+ });
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|