|
|
@@ -277,7 +277,7 @@
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { addOp3 } from '@/mixins/mixin'
|
|
|
-import { ref, onMounted, watch, watchEffect, inject } from 'vue';
|
|
|
+import { ref, onMounted, watchEffect, inject } from 'vue';
|
|
|
import { userCurrentRole, userInfoStore, userCurrent,pageGotype } from '../../stores/counter'
|
|
|
// import JSZip from 'jszip';
|
|
|
// import { saveAs } from 'file-saver';
|
|
|
@@ -595,79 +595,65 @@ const getCourseUrl = (item) => {
|
|
|
|
|
|
openCourseIframe(url2)
|
|
|
}
|
|
|
-const getTimeCourse = (id, item) => {
|
|
|
- // 用户信息未就绪时不执行,由下方 watch 在就绪后触发
|
|
|
- if (!user.user?.userid) return
|
|
|
+// const getTimeCourse = (id, item) => {
|
|
|
+// if (!user.user?.userid) return
|
|
|
|
|
|
- if (setIntervalNum.value) {
|
|
|
- clearInterval(setIntervalNum.value)
|
|
|
- }
|
|
|
- try {
|
|
|
- setIntervalNum.value = setInterval(() => {
|
|
|
- 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)
|
|
|
- }
|
|
|
- let area = ''
|
|
|
- const schoolDest = user.user.schooldest || ''
|
|
|
- try {
|
|
|
- area = areaJson.value.find(a => schoolDest.includes(a.code) || schoolDest.includes(a.name));
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
-
|
|
|
- let dest = area ? area.name : '未知';
|
|
|
- console.log('dest',dest);
|
|
|
- const middleTime = Math.random() * 2 + 6;
|
|
|
- const interValtTime = Math.floor(middleTime * 60) * 1000 + 30000;
|
|
|
- console.log('user.user2',user.user);
|
|
|
- const params = {
|
|
|
- serverName: "深教AI6",
|
|
|
- dataType: 0,
|
|
|
- teacherName: user.user.name,
|
|
|
- teacherAccount: "",
|
|
|
- eduId: user.user.eduid || user.user.sessionid,
|
|
|
- schoolName: user.user.schoolName,
|
|
|
- schoolType: "",
|
|
|
- area: dest,
|
|
|
- coursePackageName: "AI课程",
|
|
|
- courseId: id,
|
|
|
- courseName: item?.title || 'AI课程',
|
|
|
- courseGrade: selectGrand.value,
|
|
|
- courseTime: Math.round(middleTime),
|
|
|
- startTime: new Date().toLocaleString().replace(/\//g, "-"),
|
|
|
- endTime: "",
|
|
|
- }
|
|
|
- console.log('paramsbeg',params);
|
|
|
- setTimeout(() => {
|
|
|
- params.endTime = new Date().toLocaleString().replace(/\//g, "-")
|
|
|
- console.log(params, interValtTime)
|
|
|
- axios.post("//pbl.cocorobo.cn/api/szdjg/sync/class", JSON.stringify(params), {
|
|
|
- headers: {
|
|
|
- 'Content-Type': 'application/json'
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- }, interValtTime);
|
|
|
-}
|
|
|
+// if (setIntervalNum.value) {
|
|
|
+// clearInterval(setIntervalNum.value)
|
|
|
+// }
|
|
|
+// try {
|
|
|
+// setIntervalNum.value = setInterval(() => {
|
|
|
+// 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)
|
|
|
+// }
|
|
|
+// let area = ''
|
|
|
+// const schoolDest = user.user.schooldest || ''
|
|
|
+// try {
|
|
|
+// area = areaJson.value.find(a => schoolDest.includes(a.code) || schoolDest.includes(a.name));
|
|
|
+// } catch (e) {
|
|
|
+// console.log(e)
|
|
|
+// }
|
|
|
|
|
|
-// 等 App.vue 异步写入 user 后再上报,避免首次打开拿不到 user.user
|
|
|
-const hasInitTimeCourse = ref(false)
|
|
|
-watch(
|
|
|
- () => user.user,
|
|
|
- (val) => {
|
|
|
- if (hasInitTimeCourse.value) return
|
|
|
- if (!val?.userid) return
|
|
|
- hasInitTimeCourse.value = true
|
|
|
- // getTimeCourse(1, { title: 'AI课程' })
|
|
|
- },
|
|
|
- { immediate: true, deep: true }
|
|
|
-)
|
|
|
+// let dest = area ? area.name : '未知';
|
|
|
+// console.log('dest',dest);
|
|
|
+// const middleTime = Math.random() * 2 + 6;
|
|
|
+// const interValtTime = Math.floor(middleTime * 60) * 1000 + 30000;
|
|
|
+// console.log('user.user2',user.user);
|
|
|
+// const params = {
|
|
|
+// serverName: "深教AI6",
|
|
|
+// dataType: 0,
|
|
|
+// teacherName: user.user.name,
|
|
|
+// teacherAccount: "",
|
|
|
+// eduId: user.user.eduid || user.user.sessionid,
|
|
|
+// schoolName: user.user.schoolName,
|
|
|
+// schoolType: "",
|
|
|
+// area: dest,
|
|
|
+// coursePackageName: "AI课程",
|
|
|
+// courseId: id,
|
|
|
+// courseName: item?.title || 'AI课程',
|
|
|
+// courseGrade: selectGrand.value,
|
|
|
+// courseTime: Math.round(middleTime),
|
|
|
+// startTime: new Date().toLocaleString().replace(/\//g, "-"),
|
|
|
+// endTime: "",
|
|
|
+// }
|
|
|
+// console.log('paramsbeg',params);
|
|
|
+// setTimeout(() => {
|
|
|
+// params.endTime = new Date().toLocaleString().replace(/\//g, "-")
|
|
|
+// console.log(params, interValtTime)
|
|
|
+// axios.post("//pbl.cocorobo.cn/api/szdjg/sync/class", JSON.stringify(params), {
|
|
|
+// headers: {
|
|
|
+// 'Content-Type': 'application/json'
|
|
|
+// }
|
|
|
+// }).then(res => {
|
|
|
+// console.log(res)
|
|
|
+// })
|
|
|
+// }, interValtTime);
|
|
|
+// }
|
|
|
|
|
|
const updateCourseId = (id, type) => {
|
|
|
axios.post('https://pbl.cocorobo.cn/api/pbl/copyCourseSz', {id: id +','+ user.user.userid}, {
|