diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 8163331c..63e79861 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -141,6 +141,7 @@ PC端可见 移动端可见 多端可见 + 仅内网访问 @@ -305,6 +306,7 @@ PC端可见 移动端可见 多端可见 + 仅内网访问 @@ -488,6 +490,8 @@ export default { refType:'' }, visibleShow:false, + isPermission:false, + dicts:[], extendRefId:'', extendRefType:'', courseTeachers: [], //课程的老师 @@ -527,7 +531,11 @@ export default { dlgShow: false }, rightTypeId: {}, - catalogSortDialogShow: false + catalogSortDialogShow: false, + selectedOrg: { + orgId: null, + name: '' + } }; }, created() { @@ -552,9 +560,15 @@ export default { }, watch: { courseInfo: { - handler(newVal) { - //需要保存 + handler(newVal, oldVal) { + // 需要保存 this.requireSaveCourse = true; + + console.log("--- watch比较 = ", oldVal.orgId, newVal.orgId); + if (newVal.orgId !== oldVal.orgId) { + console.log("--- watch newVal.orgId = ", newVal.orgId); + this.checkOrgPermission(newVal.orgId); + } }, deep: true } @@ -581,6 +595,22 @@ export default { this.loadUserGroup(); }, methods: { + // 检查机构权限 + checkOrgPermission(orgId) { + console.log("--- 监测组织id orgId = ",orgId) + console.log("--- this.isPermission = ",this.isPermission) + console.log("--- device = ",this.courseInfo.device) + if (!orgId) { + this.isPermission = false; + return; + } + this.isPermission = this.dicts.includes(orgId); + this.courseInfo.device = 3; + if(this.isPermission){ + this.courseInfo.device = 4; + } + console.log("--- 监听结束 this.isPermission = ",this.isPermission) + }, // 关键字的更改 changeKeywords(option){ if(option.target.value){ @@ -889,7 +919,8 @@ export default { async getDetail(id) { this.curCourseId = id; this.orgName=''; - let $this = this; + this.isPermission = false; + let $this = this; try { const { result, status } = await apiCourse.detail(id); if (status === 200) { @@ -906,7 +937,10 @@ export default { this.contentInfo.list = result.contents; this.sectionInfo.list = result.sections; this.courseTeachers = result.teachers; //课程的老师信息 - + this.isPermission = result.isPermission; //课程的老师信息 + this.dicts = result.dicts; //课程的老师信息 + console.log("--- 编辑查看 this.isPermission = ",this.isPermission) + console.log("--- 编辑查看 this.dicts = ",this.dicts) if(!this.courseInfo.orgId){ //根据课程创建者获取机构id apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{ diff --git a/src/components/Course/homework.vue b/src/components/Course/homework.vue index 6f3912e9..f5f12a71 100644 --- a/src/components/Course/homework.vue +++ b/src/components/Course/homework.vue @@ -109,7 +109,7 @@ export default { if(res.status==200){ this.info=res.result; //检查是否过期 - if(res.result.deadTime!=''){ + if(res.result.deadTime!='' && res.result.deadTime != null){ var d = new Date(res.result.deadTime); var now=new Date(); if(now.getTime() > d.getTime()){ diff --git a/src/components/VideoPlayer/progress-bar.vue b/src/components/VideoPlayer/progress-bar.vue index 84bc066d..2ca784ae 100644 --- a/src/components/VideoPlayer/progress-bar.vue +++ b/src/components/VideoPlayer/progress-bar.vue @@ -73,7 +73,7 @@ export default { }, methods: { down(e) { - // if(this.isDrag) { + if(!this.isDrag) return; this.$emit("getMouseDownStatus", true); this.is_mousedown_progress = true; // 获取完整进度条的clientX(dom左上角) @@ -87,8 +87,8 @@ export default { var time = localStorage.getItem('videoProgressData'); var arr = time&&JSON.parse(time) || {} //console.log('down arr:',this.isDrag,this.blobId,arr,arr[this.blobId],current) - // 禁止拖动 - if(!this.isDrag && time && arr[this.blobId] < current) return; + // 禁止拖动到未学习区域 + if(time && arr[this.blobId] < current) return; this.$emit("updateProgress", current); // } @@ -124,7 +124,7 @@ export default { // 禁止拖动 if(!this.isDrag && time && arr[this.blobId] < current) return; this.$emit("updateProgress", current); - + this.$emit("getMouseDownStatus", false); } }, }, diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index cc6143a8..7d7632f2 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -22,91 +22,101 @@
-
- - -
-
- -
-
-
- - - -
+
+
+ + +
+
+ +
+
+
+ + + +
+
+
+ + + +
+
-
- - - -
-
-
-
+
- -
-
-
- +
- +
+
+ +
+ {{ toScore(courseInfo.score) }} +
-
-
-
-
{{ contentData.contentName }}
-
- +
+
+
{{ contentData.contentName }}
+
+ +
-
-
-
-
此课程内容无法预览,请联系管理员
-
-
- 此课程内容无法预览,请联系管理员 -
- - -
-
-
-
-
- -
-
-
- -
- -
-
- -
-
- - +
+
+ 十分抱歉,您当前的网络环境不符合观看要求。为了保障案例信息的安全,您需要接入公司内网才能观看。 +
+
+ 重新检测 +
@@ -303,6 +313,17 @@
+ +
{{warnTitle}}
+
+   {{warn}} +
+ + 确 + 定 + +
@@ -369,6 +390,7 @@ }, data() { return { + protocolDialogVisible: false, tentative: false, isContentTypeTwo: null, isContentType: null, @@ -390,6 +412,7 @@ curCFile: { converStatus: 4, }, + Internet: 3,//1是成功 2是是失败 3是检测中 radio: '', interactRuning: false, playerBoxShow: false, @@ -454,6 +477,8 @@ cumulativeDuration:0, //非音频累计时长 maxDuration:0, //非音频最大时长 defaultMaxTime:1800, //非音频默认最大时间 + warn:"测试内容", + warnTitle:"测试标题", } }, mounted() { @@ -1357,7 +1382,8 @@ } } this.courseInfo = rs.result.course; - + this.warn = rs.result.warn; + this.warnTitle = rs.result.warnTitle; if (rs.result.teachers && rs.result.teachers.length > 0) { let userIds = []; let ctoUsers = []; @@ -1386,12 +1412,52 @@ this.totalContent = rs.result.contents.length; //加载学习的数据 this.loadStudyData(rs.result); - + if (rs.result.isPermission){ + // if (true){ + this.getInternet() + console.log('需要内网环境') + } } else { this.$message.error(rs.message); } }); }, + getXmlHttpRequest() { + if (window.XMLHttpRequest) { + return new XMLHttpRequest(); + } + else if (window.ActiveXObject) { + return new ActiveXObject("Microsoft.XMLHTTP"); + } + }, + // 检测是否为内网 + getInternet() { + this.Internet = 3; + let $this = this; + let xmlhttp = this.getXmlHttpRequest(); + let timedOut = false; + let timer = setTimeout(function () { + timedOut = true; + xmlhttp.abort(); + }, 5000); + xmlhttp.open("HEAD", window.location.protocol + "//uapi.boe.com.cn/500.html", true); + xmlhttp.send(); + xmlhttp.onreadystatechange = function () { + if (xmlhttp.readyState == 4) { + if (xmlhttp.status == 200) { + clearTimeout(timer); + $this.Internet = 1; + $this.protocolDialogVisible=true + } else { + clearTimeout(timer); + $this.Internet = 2; + } + } else { + if (timedOut) return;//忽略中止请求 + clearTimeout(timer);//取消等待的超时 + } + } + }, loadStudyData(result) { let $this=this; this.loadScorePraiseAndTrample(); @@ -1724,6 +1790,7 @@ display: flex; justify-content: space-between; .course-player{ //内容播放区域 + background-color: rgb(238, 238, 238); flex:1; min-width: 700px; min-height: 400px; @@ -2368,4 +2435,18 @@ height: 200px; background: url('../../../public/images/couresdetail.png'); } + +.protocol { + .protocol-title { + font-size: 20px; + font-weight: 600; + text-align: center; + margin-bottom: 25px; + } + + .protocol-content { + font-size: 14px; + line-height: 25px; + } +}