|
@@ -291,6 +291,7 @@ import selectTeachingClassDialog from '../dialog/selectTeachingClassDialog.vue'
|
|
|
// import { dataType } from 'element-plus/es/components/table-v2/src/common';
|
|
// import { dataType } from 'element-plus/es/components/table-v2/src/common';
|
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
|
import { openCourseIframe } from '@/composables/useCourseIframe'
|
|
import { openCourseIframe } from '@/composables/useCourseIframe'
|
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
|
|
|
const lang = inject('lang')
|
|
const lang = inject('lang')
|
|
|
|
|
|
|
@@ -430,6 +431,23 @@ const getImageUrl = (url) => {
|
|
|
return new URL(url, import.meta.url).href
|
|
return new URL(url, import.meta.url).href
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const checkClass = async () => {
|
|
|
|
|
+ if(user.user.org == '16ace517-b5c7-4168-a9bb-a9e0035df840'){
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ userid: user.user.userid,
|
|
|
|
|
+ };
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await axios.get('https://pbl.cocorobo.cn/api/pbl/checkClass', params)
|
|
|
|
|
+ let data = res.data[0][0]
|
|
|
|
|
+ return data
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return 2
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 新课备课 获取id
|
|
// 新课备课 获取id
|
|
|
const getCourseid = (id) => {
|
|
const getCourseid = (id) => {
|
|
|
// 会返回复制得课程
|
|
// 会返回复制得课程
|
|
@@ -438,13 +456,21 @@ const getCourseid = (id) => {
|
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
withCredentials: true
|
|
withCredentials: true
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then(async res => {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
console.log(res.data[0]);
|
|
console.log(res.data[0]);
|
|
|
// console.log(res.data[0][0].courseId);
|
|
// console.log(res.data[0][0].courseId);
|
|
|
if (res.data[0].length > 0) {
|
|
if (res.data[0].length > 0) {
|
|
|
DialogRef.value.getClasslist(res.data[0][0])
|
|
DialogRef.value.getClasslist(res.data[0][0])
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ let classResult = await checkClass()
|
|
|
|
|
+ if(classResult == 1){
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ message: lang.ssCreateCourseLimit,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
getCourseid2(id, "studyDetail")
|
|
getCourseid2(id, "studyDetail")
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -477,7 +503,7 @@ const openCourseDetail = (id) => {
|
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
|
withCredentials: true
|
|
withCredentials: true
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then(async res => {
|
|
|
console.log('openCourseDetail',res)
|
|
console.log('openCourseDetail',res)
|
|
|
if (res.data[0].length > 0) {
|
|
if (res.data[0].length > 0) {
|
|
|
return getCourseUrl(res.data[0][0])
|
|
return getCourseUrl(res.data[0][0])
|
|
@@ -500,6 +526,14 @@ const openCourseDetail = (id) => {
|
|
|
// top.U.MD.D.I.openInApplication("studyDetail", res.value[0][0].courseId, 2, user.user.type);
|
|
// 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('setUrl',{url:url2,title:'课程详情',id:new Date().getTime()})
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ let classResult = await checkClass()
|
|
|
|
|
+ if(classResult == 1){
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ message: lang.ssCreateCourseLimit,
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
updateCourseId(id, "studyDetail")
|
|
updateCourseId(id, "studyDetail")
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|