From c179ffad7b20a204ba119dccb6b3e55e6378c315 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 15 Mar 2024 10:57:36 +0800 Subject: [PATCH] fix --- public/index.html | 2 +- src/api/index.js | 1 + src/layouts/header/index.vue | 9 +++- src/pages/ass/list/index.vue | 71 +++++++++++-------------------- src/pages/index/list/index.vue | 4 +- src/pages/match/details/index.vue | 6 +-- src/pages/match/list/index.vue | 6 +-- src/setting.js | 2 +- src/styles/layout/index.scss | 18 ++++---- 9 files changed, 53 insertions(+), 66 deletions(-) diff --git a/public/index.html b/public/index.html index 0b1b861..c917c20 100644 --- a/public/index.html +++ b/public/index.html @@ -9,7 +9,7 @@ content="职站是一款辅助院校教师开展虚拟仿真实验教学的智能云实践平台。平台采用了大数据,云计算等技术,为学校搭建信息化平台提供了基础,可助力院校实现教学智能化升级。职站平台设计遵循着极简、高效的理念,可帮助老师轻松开展实验教学,并支持自定义发布考核和练习,智能统计和检验学生的日常实训练习效果;老师还可以通过可视化图表报告直观查看学生实训成绩,评估教学成果。" /> <meta name="baidu-site-verification" content="code-TRfXe8xIkJ" /> - <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> + <meta name="viewport" content="width=device-width, user-scalable=yes, shrink-to-fit=no" /> <link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css" /> <title>职站——为院校打造一站式虚拟仿真实训教学数智云平台</title> <script> diff --git a/src/api/index.js b/src/api/index.js index eb9c892..7211ada 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -20,6 +20,7 @@ export default { refreshPageNotification : `nakadai/message/refreshPageNotification`, getUserInfo : `users/users/userInfo/getUserInfo`, getCurrentTime : `competition/competition/management/getCurrentTime`, + heartbeatDetection : `nakadai/message/heartbeatDetection`, // 阿里云文件/视频管理 getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证 diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index dc525ef..b68018c 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -128,6 +128,7 @@ export default { this.$once('hook:beforeDestroy', function () { clearInterval(this.noticeTimer) }) + this.heartbeatDetection() }, methods: { ...mapMutations("user", [ @@ -180,7 +181,7 @@ export default { initSocket ({ id, account }) { // 实例化socket this.socket = new WebSocket(`${Setting.isTest ? 'ws' : 'wss'}://${Setting.isDev ? '121.37.12.51' : location.host}/nakadai/websocket/${id}/${account}`) - // this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`) + // this.socket = new WebSocket(`ws://192.168.31.51:9100/nakadai/websocket/${id}/${account}`) // 监听socket连接 this.socket.onopen = this.open; // 监听socket错误信息 @@ -188,6 +189,12 @@ export default { // 监听socket消息 this.socket.onmessage = this.getMessage; }, + // 心跳检测 + heartbeatDetection () { + setInterval(async () => { + await this.$get(this.api.heartbeatDetection) + }, 58 * 1000) + }, // 获取消息 diff --git a/src/pages/ass/list/index.vue b/src/pages/ass/list/index.vue index 808fd8f..cf823d8 100644 --- a/src/pages/ass/list/index.vue +++ b/src/pages/ass/list/index.vue @@ -146,7 +146,7 @@ <el-button v-if="scope.row.status == 2 && scope.row.stuState == 0" type="text" disabled>未参加</el-button> - <el-button v-if="(scope.row.status == 2 && scope.row.stuState == 1) || (scope.row.status == 2 && scope.row.stuState == 2 && scope.row.reportId == null)" + <el-button v-if="(scope.row.status == 2 && scope.row.stuState == 1) || (scope.row.status == 2 && scope.row.stuState == 2 && !scope.row.reportId)" type="text" disabled> 未提交 @@ -270,8 +270,6 @@ export default { assessmentId: '', classId: '', stopTime: '', - sss: 1, - datassdata: 0, }; }, computed: { @@ -313,7 +311,6 @@ export default { // 页面离开的时候销毁手机和邮箱验证码定时器 this.$once("hook:beforeDestroy", function () { - this.sss = 0 clearInterval(this.ticker); this.ticker = null; }); @@ -322,11 +319,11 @@ export default { this.getClassData(); }, methods: { - timeFilter (countDown) { - if (countDown.countDown > 0) { - let h = Math.floor(countDown.countDown / (60 * 60)); - let m = Math.floor(countDown.countDown % (60 * 60) / 60); - let s = Math.floor(countDown.countDown % (60 * 60) % 60); + timeFilter (row) { + if (row.countDown > 0) { + let h = Math.floor(row.countDown / (60 * 60)); + let m = Math.floor(row.countDown % (60 * 60) / 60); + let s = Math.floor(row.countDown % (60 * 60) % 60); return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`; } else { return "00:00:00"; @@ -335,35 +332,24 @@ export default { beginTimer () { clearInterval(this.ticker) this.ticker = setInterval(() => { - if (this.sss == 0) { - this.ticker = null; - clearInterval(this.ticker); - } else { - for (let i = 0; i < this.listData.length; i++) { - const item = this.listData[i]; - if (item.countDown > 0) { - item.countDown--; - } else { - if (item.status == 0 && item.type == 2) { // 待开始-定时发布 - item.status = 1; - item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000; - } else if (item.status == 1) { - // item.status = 2; - } + for (let i = 0; i < this.listData.length; i++) { + const item = this.listData[i]; + if (item.countDown > 0) { + item.countDown--; + } else { + if (item.status == 0 && item.type == 2) { // 待开始-定时发布 + item.status = 1; + item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000; + } else if (item.status == 1) { + // item.status = 2; } - this.$set(this.listData, i, item); } - + this.$set(this.listData, i, item); } }, 1000); }, getData () { this.listLoading = true; - this.sss = 0 - this.listData.splice(0); - if (this.ticker) { - clearInterval(this.ticker); - } let data = { ...this.form, pageNum: this.page, @@ -371,47 +357,39 @@ export default { }; this.$post(this.api.pageStuAssessment, data).then(res => { this.listData = res.list; - for (var i = 0; i < this.listData.length; i++) { - if (this.listData[i].reportId == undefined) { - this.listData[i].reportId = null - } - } this.totals = res.total; this.listData.forEach(i => { + let countDown = 0 if (i.status == 2) { // 已结束 - i.countDown = 0; + countDown = 0; } else { if (i.type == 2) { // 定时发布 if (i.status == 0) { // 待开始 - i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 + countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 } else if (i.status == 1) { // 进行中 - i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; + countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; } } else if (i.type == 1) { // 手动发布 if (i.status == 0) { // 待开始 - i.countDown = 0; + countDown = 0; } else if (i.status == 1) { // 进行中 - i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; + countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; } } } + this.$set(i, 'countDown', countDown) }); - this.sss = 1; - // if(this.datassdata == 0){ - // this.datassdata = this.datassdata+1 this.beginTimer() - // } this.listLoading = false; }).catch(err => { this.listLoading = false; }); }, initData () { - this.sss = 0 this.page = 1; this.getData(); }, @@ -429,7 +407,6 @@ export default { }, handleCurrentChange (val) { // 切换页码 this.page = val; - this.sss = 0 this.getData(); }, entry (row) { // 进入考核 diff --git a/src/pages/index/list/index.vue b/src/pages/index/list/index.vue index d25753a..11d51c5 100644 --- a/src/pages/index/list/index.vue +++ b/src/pages/index/list/index.vue @@ -391,7 +391,9 @@ export default { } }, mounted () { - new WOW().init() + new WOW({ + mobile: false + }).init() }, methods: { toPart (i) { diff --git a/src/pages/match/details/index.vue b/src/pages/match/details/index.vue index 1e5fad5..1c2fc49 100644 --- a/src/pages/match/details/index.vue +++ b/src/pages/match/details/index.vue @@ -1704,9 +1704,9 @@ export default { // 进入子系统 toSub () { const { form } = this - const { systemId, systemName, projectId, cid, stageId, startTime, endTime, mallId } = this.curStage + const { systemId, systemName, projectId, cid, stageId, startTime, endTime, mallId, resultAnnouncementTime } = this.curStage const competitionId = form.id - const teamId = form.competitionRegistration.teamId + const teamId = form.competitionRegistration.teamId || '' let token = Util.local.get(Setting.tokenKey); if (systemId == 11) { // 银行系统 @@ -1716,7 +1716,7 @@ export default { window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${cid}&projectId=${projectId}&token=${token}&userId=${this.userId}&classId=1&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&startTime=${startTime}&endTime=${endTime}&mallId=${mallId}${Setting.isTest ? '&beta=1' : ''}`); } else if (systemId == 19) { // 沙盘 - location.href = `${Setting.sandPath}/#/?curriculumName=${systemName}&token=${token}&cid=${cid}&mallId=${mallId}&systemId=${systemId}&projectId=${projectId}&assessmentId=&classId=&startTime=&stopTime=${endTime}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&userId=${this.userId}&account=${this.account}&referrer=${encodeURIComponent(location.href)}` + location.href = `${Setting.sandPath}/#/?curriculumName=${systemName}&token=${token}&cid=${cid}&mallId=${mallId}&systemId=${systemId}&projectId=${projectId}&assessmentId=&classId=&startTime=&stopTime=${endTime}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&resultAnnouncementTime=${resultAnnouncementTime || ''}&userId=${this.userId}&account=${this.account}&referrer=${encodeURIComponent(location.href)}` } else { // python系统 this.toPython(this.curProject) diff --git a/src/pages/match/list/index.vue b/src/pages/match/list/index.vue index a88bb7e..e3ae50e 100644 --- a/src/pages/match/list/index.vue +++ b/src/pages/match/list/index.vue @@ -1037,9 +1037,9 @@ export default { // 进入子系统 toSub () { const form = this.curItem - const { systemId, systemName, projectId, cid, stageId, startTime, endTime, mallId } = form.curStage + const { systemId, systemName, projectId, cid, stageId, startTime, endTime, mallId, resultAnnouncementTime } = form.curStage const competitionId = form.id - const teamId = form.teamId + const teamId = form.teamId || '' let token = Util.local.get(Setting.tokenKey); if (systemId == 11) { // 银行系统 @@ -1049,7 +1049,7 @@ export default { window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${cid}&projectId=${projectId}&token=${token}&userId=${this.userId}&classId=1&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&startTime=${startTime}&endTime=${endTime}&mallId=${mallId}${Setting.isTest ? '&beta=1' : ''}`); } else if (systemId == 19) { // 沙盘 - location.href = `${Setting.sandPath}/#/?curriculumName=${systemName}&token=${token}&cid=${cid}&mallId=${mallId}&systemId=${systemId}&projectId=${projectId}&assessmentId=&classId=&startTime=&stopTime=${endTime}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&userId=${this.userId}&account=${this.account}&referrer=${encodeURIComponent(location.href)}` + location.href = `${Setting.sandPath}/#/?curriculumName=${systemName}&token=${token}&cid=${cid}&mallId=${mallId}&systemId=${systemId}&projectId=${projectId}&assessmentId=&classId=&startTime=&stopTime=${endTime}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&resultAnnouncementTime=${resultAnnouncementTime || ''}&userId=${this.userId}&account=${this.account}&referrer=${encodeURIComponent(location.href)}` } else { // python系统 this.toPython() diff --git a/src/setting.js b/src/setting.js index 78844f6..d7bbc5b 100644 --- a/src/setting.js +++ b/src/setting.js @@ -35,7 +35,7 @@ if (isPro) { uploadURL = `http://121.37.12.51/` host = "http://121.37.12.51/"; // 测试服 // host = 'https://www.occupationlab.com/' // 正式服 - host = "http://192.168.31.217:9000/"; + host = "http://192.168.31.51:9000/"; } else if (isSq) { zcPath = `10.20.100.204:8883` } diff --git a/src/styles/layout/index.scss b/src/styles/layout/index.scss index da98533..bb4d395 100644 --- a/src/styles/layout/index.scss +++ b/src/styles/layout/index.scss @@ -1,17 +1,17 @@ -@import "lib/var"; -@import "var"; +@import 'lib/var'; +@import 'var'; html, body, #app, .wrapper { - width: 100%; - height: 100%; + width: 100%; + height: 100%; } body { - min-width: 1280px; - font-family: PingFangSC-Regular, PingFang SC; - font-size: 14px; - background: rgba(0, 0, 0, 0.02); -} \ No newline at end of file + min-width: 1280px; + font-family: PingFangSC-Regular, PingFang SC; + font-size: 14px; + background: rgba(0, 0, 0, 0.02); +}