去掉定时器等

dev_2022-06-14
yujialong 3 years ago
parent dd68df3faa
commit 64dd3eac9b
  1. 86
      src/api/index.js
  2. 16
      src/layouts/navbar/index.vue
  3. 20
      src/libs/util.js
  4. 23
      src/pages/account/login/index.vue
  5. 6
      src/pages/index/list/index.vue
  6. 18
      src/pages/match/details/index.vue
  7. 8
      src/pages/match/list/index.vue
  8. 2
      src/pages/match/noticeDetail/index.vue
  9. 5
      src/pages/station/preview/index.vue
  10. 49
      src/pages/touristMatch/list/index.vue
  11. 25
      src/setting.js
  12. 6
      src/store/modules/match.js

@ -1,24 +1,24 @@
import Setting from "@/setting";
const host = Setting.apiBaseURL;
const uploadURL = "http://121.37.12.51:9000/";
const uploadURL = location.origin + '/'
export default {
logins: `users/users/user/login`,
verification: `${host}users/users/user/captcha`,// 验证码图片
logoDetail: `occupationlab/sys/logo/detail`, //查看系统设置信息
logoDetail: `occupationlab/occupationlab/sys/logo/detail`, //查看系统设置信息
isClient: `${host}users/users/user/isClient`,
sendPhoneVerificationCode: `users/users/user/sendPhoneVerificationCode`,
getToken: `users/users/user/getToken`,
getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`,
unbindAccounts: `users/users/user/unbindAccounts`,
platformLogList: `nakadai/log/platformLogList`,
logNotification: `nakadai/log/logNotification`,
platformLogList: `nakadai/nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`,
//实验台
curriculumDetail: `nakadai/nakadai/curriculum/curriculumDetail`, // 课程详情
curriculumChapter: `nakadai/curriculum/chapter/queryChaptersAndSubsections`, // 根据课程id查询章节小节,树状结构
curriculumGetSubsection: `nakadai/curriculum/subsection/getSubsection`, // 根据小节id获取预览文件地址
curriculumChapter: `nakadai/nakadai/curriculum/chapter/queryChaptersAndSubsections`, // 根据课程id查询章节小节,树状结构
curriculumGetSubsection: `nakadai/nakadai/curriculum/subsection/getSubsection`, // 根据小节id获取预览文件地址
// 能力测评
canExperiment: `occupationlab/occupationlab/evaluationrecord/can_experiment`, // 查询是否能够开启实验
@ -34,52 +34,52 @@ export default {
// 实验记录
schoolCourse: `nakadai/nakadai/curriculum/schoolCourse`, // 获取学校购买订单后的课程
experimentOverview: `occupationlab/achievement/experimentOverview`, //实验概览
queryAssessmentByStudent: `occupationlab/achievement/queryAssessmentByStudent`, //学生端考核成绩
queryPracticeByStudent: `occupationlab/achievement/queryPracticeByStudent`, //学生端练习成绩
exportAssessmentByStudent: `occupationlab/achievement/exportAssessmentByStudent`, // 批量导出考核成绩
exportPracticeByStudent: `${host}occupationlab/achievement/exportPracticeByStudent`, // 批量导出练习成绩
practiceByStudentDetail: `occupationlab/achievement/practiceByStudentDetail`, // 学生端练习实验情况
exportPracticeByStudentDetail: `${host}occupationlab/achievement/exportPracticeByStudentDetail`, // 导出学生端练习实验情况
reportDetail: `occupationlab/achievement/reportDetail`, // 成绩报告详情
updateReport: `occupationlab/achievement/updateReport`, // 更新成绩报告
experimentOverview: `occupationlab/occupationlab/achievement/experimentOverview`, //实验概览
queryAssessmentByStudent: `occupationlab/occupationlab/achievement/queryAssessmentByStudent`, //学生端考核成绩
queryPracticeByStudent: `occupationlab/occupationlab/achievement/queryPracticeByStudent`, //学生端练习成绩
exportAssessmentByStudent: `occupationlab/occupationlab/achievement/exportAssessmentByStudent`, // 批量导出考核成绩
exportPracticeByStudent: `${host}occupationlab/occupationlab/achievement/exportPracticeByStudent`, // 批量导出练习成绩
practiceByStudentDetail: `occupationlab/occupationlab/achievement/practiceByStudentDetail`, // 学生端练习实验情况
exportPracticeByStudentDetail: `${host}occupationlab/occupationlab/achievement/exportPracticeByStudentDetail`, // 导出学生端练习实验情况
reportDetail: `occupationlab/occupationlab/achievement/reportDetail`, // 成绩报告详情
updateReport: `occupationlab/occupationlab/achievement/updateReport`, // 更新成绩报告
schoolCourseByAchievement: `nakadai/nakadai/curriculum/schoolCourseByAchievement`, // 获取学校购买订单后的课程
exportLabReport: `occupationlab/achievement/exportLabReport`,
exportBankExperimentReport: `occupationlab/achievement/exportBankExperimentReport`,
queryBcJudgmentPointByBcId: 'judgment/bcJudgmentPoint/queryBcJudgmentPointByBcId',
editExperimentalData: 'occupationlab/experimentalReport/editExperimentalData',
exportLabReport: `occupationlab/occupationlab/achievement/exportLabReport`,
exportBankExperimentReport: `occupationlab/occupationlab/achievement/exportBankExperimentReport`,
queryBcJudgmentPointByBcId: 'judgment/judgment/bcJudgmentPoint/queryBcJudgmentPointByBcId',
editExperimentalData: 'occupationlab/occupationlab/experimentalReport/editExperimentalData',
// 考核列表
pageStuAssessment: `occupationlab/assessment/pageStuAssessment`, // 学生端——学生考核列表
getPythonSysByStuAccountId: `occupationlab/assessment/getPythonSysByStuAccountId`, // 学生端——课程名称
myClassByStudent: `occupationlab/achievement/myClassByStudent`, // 学生端:我的班级
getStudentInfoByAccountId: `occupationlab/architecture/getStudentInfoByAccountId`, // 查看学生信息
enterExam: `occupationlab/assessment/enterExam`, // 学生端——进入考试
collectPaper: `occupationlab/assessment/collectPaper`, // 自动结束考试
pageStuAssessment: `occupationlab/occupationlab/assessment/pageStuAssessment`, // 学生端——学生考核列表
getPythonSysByStuAccountId: `occupationlab/occupationlab/assessment/getPythonSysByStuAccountId`, // 学生端——课程名称
myClassByStudent: `occupationlab/occupationlab/achievement/myClassByStudent`, // 学生端:我的班级
getStudentInfoByAccountId: `occupationlab/occupationlab/architecture/getStudentInfoByAccountId`, // 查看学生信息
enterExam: `occupationlab/occupationlab/assessment/enterExam`, // 学生端——进入考试
collectPaper: `occupationlab/occupationlab/assessment/collectPaper`, // 自动结束考试
// 课程学习
queryGlClassification: `occupationlab/management/edu/courseClassification/queryGlClassification`, // 查询课程分类
queryCourseByCondition: `occupationlab/management/edu/course/queryCourseByCondition`, // 课程列表分页条件查询
getCourseById: `occupationlab/management/edu/course/getCourse`, // 根据id查询课程
queryChaptersAndSubsections: `occupationlab/management/edu/courseChapter/queryChaptersAndSubsections`, // 根据课程id查询章节小节,树状结构
getSubsection: `occupationlab/management/edu/courseSubsection/getSubsection`, // 根据小节id获取预览文件地址
queryGlClassification: `occupationlab/occupationlab/management/edu/courseClassification/queryGlClassification`, // 查询课程分类
queryCourseByCondition: `occupationlab/occupationlab/management/edu/course/queryCourseByCondition`, // 课程列表分页条件查询
getCourseById: `occupationlab/occupationlab/management/edu/course/getCourse`, // 根据id查询课程
queryChaptersAndSubsections: `occupationlab/occupationlab/management/edu/courseChapter/queryChaptersAndSubsections`, // 根据课程id查询章节小节,树状结构
getSubsection: `occupationlab/occupationlab/management/edu/courseSubsection/getSubsection`, // 根据小节id获取预览文件地址
// 资讯
queryAllColumns: `occupationlab/enterprise/information/column/queryAllColumns`, // 栏目树
queryArticleByCondition: `occupationlab/enterprise/information/article/queryArticleByCondition`, // 文章列表分页条件查询
getArticle: `occupationlab/enterprise/information/article/getArticle`, // 根据id查询文章
firstLevelColumn: `occupationlab/enterprise/information/column/firstLevelColumn`,
secondaryColumnsByFirst: `occupationlab/enterprise/information/column/secondaryColumnsByFirst`,
queryAllColumns: `occupationlab/occupationlab/enterprise/information/column/queryAllColumns`, // 栏目树
queryArticleByCondition: `occupationlab/occupationlab/enterprise/information/article/queryArticleByCondition`, // 文章列表分页条件查询
getArticle: `occupationlab/occupationlab/enterprise/information/article/getArticle`, // 根据id查询文章
firstLevelColumn: `occupationlab/occupationlab/enterprise/information/column/firstLevelColumn`,
secondaryColumnsByFirst: `occupationlab/occupationlab/enterprise/information/column/secondaryColumnsByFirst`,
// 线上赛事
contestPageConditionQueryByOccupationlabStu: `occupationlab/enterprise/match/contest/contestPageConditionQueryByOccupationlabStu`,
contestPageConditionQueryByOccupationlab: `occupationlab/enterprise/match/contest/onlineCompetitionByStudent`,
listOfRegisteredEvents: `occupationlab/enterprise/match/contest/listOfRegisteredEvents`,
addApplicant: `occupationlab/enterprise/match/applicant/addApplicant`, // 添加报名人员
getContestProgress: `occupationlab/enterprise/match/contest-progress/getContestProgress`, // 根据赛事id查询竞赛进展
getContest: `occupationlab/enterprise/match/contest/getContest`, // 根据id查询赛事
queryAnnouncementByContestId: `occupationlab/contest/announcement/queryAnnouncementByContestId`,
queryAnnouncementDetails: `occupationlab/contest/announcement/queryAnnouncementDetails`,
contestPageConditionQueryByOccupationlabStu: `occupationlab/occupationlab/enterprise/match/contest/contestPageConditionQueryByOccupationlabStu`,
contestPageConditionQueryByOccupationlab: `occupationlab/occupationlab/enterprise/match/contest/onlineCompetitionByStudent`,
listOfRegisteredEvents: `occupationlab/occupationlab/enterprise/match/contest/listOfRegisteredEvents`,
addApplicant: `occupationlab/occupationlab/enterprise/match/applicant/addApplicant`, // 添加报名人员
getContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/getContestProgress`, // 根据赛事id查询竞赛进展
getContest: `occupationlab/occupationlab/enterprise/match/contest/getContest`, // 根据id查询赛事
queryAnnouncementByContestId: `occupationlab/occupationlab/contest/announcement/queryAnnouncementByContestId`,
queryAnnouncementDetails: `occupationlab/occupationlab/contest/announcement/queryAnnouncementDetails`,
// 阿里云文件/视频管理
fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件

@ -56,6 +56,10 @@ export default {
index: "/index/list",
title: "首页"
},
{
index: "/touristMatch/list",
title: "大赛资讯"
},
{
index: 'data',
title: "数据科研"
@ -72,14 +76,10 @@ export default {
index: "/log/list",
title: "更新日志"
},
{
index: "/touristMatch/list",
title: "大赛资讯"
},
{
index: "trial",
title: "试用申请"
}
// {
// index: "trial",
// title: ""
// }
],
menus: [],
columns: [], //

@ -7,6 +7,13 @@ import api from "@/api";
import Setting from "@/setting";
let logout = false;
// 文件后缀集合
const exts = {
video: 'mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv',
audio: 'mp3,aac,ape,flac,wav,wma,amr,mid',
img: 'jpg,jpeg,png,gif,svg,psd',
doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx'
}
const util = {
cookies,
local: _local,
@ -66,24 +73,29 @@ const util = {
},
// 传入文件后缀判断是否是视频
isVideo(ext) {
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return true;
if (exts.video.includes(ext)) return true;
return false;
},
// 传入文件后缀判断是否是音频
isAudio(ext) {
if ("mp3,aac,ape,flac,wav,wma,amr,mid".includes(ext)) return true;
if (exts.audio.includes(ext)) return true;
return false;
},
// 传入文件后缀判断是否是图片
isImg(ext) {
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return true;
if (exts.img.includes(ext)) return true;
return false;
},
// 传入文件后缀判断是否是pdf以外的文档
isDoc(ext) {
if (!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && ext != "pdf") return true;
if (exts.doc.includes(ext)) return true;
return false;
},
// 判断是否能够预览
canPreview(ext) {
if (!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && !util.isDoc(ext)) return false
return true
},
// 循环去除html标签
removeHtmlTag(list, attr) {
list.map(n => {

@ -71,7 +71,7 @@
</el-form-item>
</template>
<div class="bottom">
<el-link :underline="false" type="primary" @click="toTrial">申请试用</el-link>
<!-- <el-link :underline="false" type="primary" @click="toTrial">申请试用</el-link> -->
<el-checkbox v-show="!form.distinguish" v-model="setDefault">设置为默认学校</el-checkbox>
</div>
<el-button class="submit" type="primary" @click="submit">登录</el-button>
@ -241,18 +241,12 @@ export default {
},
//
getSchool() {
// const schoolList = util.local.get('schoolList')
// if (schoolList && schoolList.length) {
// this.setSchool(schoolList)
// } else {
this.$get(this.api.querySchool, {
provinceId: '',
cityId: ''
}).then(({ list }) => {
this.setSchool(list)
// util.local.set('schoolList', list)
}).catch(res => {})
// }
this.$get(this.api.querySchool, {
provinceId: '',
cityId: ''
}).then(({ list }) => {
this.setSchool(list)
}).catch(res => {})
},
getVerImg() { //
this.form.random = Math.floor(Math.random() * 999999999);
@ -623,7 +617,8 @@ export default {
}
.bottom {
display: flex;
justify-content: space-between;
// justify-content: space-between;
justify-content: flex-end;
}
.el-select {
width: 100%;

@ -210,7 +210,7 @@
<img class="icon" src="@/assets/img/index/sug.png" alt="">
</div>
<div class="text">
<p class="title" @click="toTrial">咨询建议与反馈</p>
<p class="title" @click="toQues">咨询建议与反馈</p>
<p class="des">您的每一条建议声音我们都认真对待</p>
</div>
</div>
@ -246,8 +246,8 @@ export default {
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
},
//
toTrial() {
//
toQues() {
window.open('https://www.wjx.cn/vm/wB0RcMm.aspx')
},
}

@ -27,7 +27,8 @@
<h6 class="p-title">附件下载</h6>
<ul class="files">
<li v-for="(item, i) in form.contestAnnexList" :key="i">
<el-link class="m-r-10" type="primary" @click="preview(item)">{{ item.fileName }}</el-link>
<el-link v-if="item.canPreview" class="m-r-10" type="primary" @click="preview(item)">{{ item.fileName }}</el-link>
<span v-else class="fileName">{{ item.fileName }}</span>
<el-link type="primary" :underline="false" @click="download(item)">下载</el-link>
</li>
</ul>
@ -199,6 +200,13 @@ export default {
methods: {
getData() { //
this.$post(`${this.api.getContest}?contestId=${this.id}`).then(({ contest }) => {
const list = contest.contestAnnexList
if (list) {
list.map(e => {
const { filePath } = e
e.canPreview = util.canPreview(filePath.substr(filePath.lastIndexOf('.') + 1))
})
}
this.form = contest
this.$refs.breadcrumb.update('全部赛事/' + contest.name)
}).catch(err => {})
@ -220,7 +228,7 @@ export default {
preview(item) {
const { filePath } = item
const suffix = filePath.substr(filePath.lastIndexOf('.') + 1)
window.open((util.isDoc(suffix) || suffix === 'pdf' ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
window.open((util.isDoc(suffix) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
},
//
download(item) {
@ -340,7 +348,7 @@ export default {
}
.texts{
margin: 20px 0 50px;
font-size: 16px;
font-size: 14px;
line-height: 1.6;
text-indent: 2em;
overflow: hidden;
@ -513,6 +521,10 @@ export default {
align-items: center;
margin: 10px 0;
}
.fileName {
margin-right: 10px;
font-size: 12px;
}
}
.notice-list {
text-align: left;

@ -297,10 +297,10 @@ export default {
getData() {
this.loadIns = Loading.service()
this.getList()
if (!Setting.isDev) {
clearInterval(this.timer)
this.timer = setInterval(this.getList, 1000)
}
// if (!Setting.isDev) {
// clearInterval(this.timer)
// this.timer = setInterval(this.getList, 1000)
// }
},
initData() {
this.page = 1

@ -151,7 +151,7 @@ export default {
.content{
margin-bottom: 20px;
line-height: 1.8;
font-size: 16px;
font-size: 14px;
text-indent: 2em;
/deep/img{
display: block;

@ -301,9 +301,12 @@ export default {
util.cookies.set("courseId", this.courseId);
util.cookies.set("curriculumName", escape(this.curriculumName));
util.cookies.set("systemId", id);
// 8pythoncookiesystemId
location.href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8080/#/` :
`${location.origin}/pyTrials` // 8pythoncookiesystemId
Setting.isPro ?
'https://www.occupationlab.com/pyTrials' :
`${location.origin}/pyTrials`
}
}
}

@ -54,7 +54,7 @@
<div class="list">
<template v-if="listData.length">
<ul>
<li v-for="(item,index) in listData" :key="index" @click="toDetail(item)">
<li v-for="(item,index) in listData" :key="index" :id="item.id" @click="toDetail(item)">
<div class="left">
<div class="cover">
<img :src="item.coverUrl || 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20220623/png/1539857403162943488.png'" alt="">
@ -128,7 +128,7 @@
</template>
<script>
import { mapMutations } from "vuex";
import { mapState, mapMutations } from "vuex";
import { Loading } from "element-ui";
import Setting from "@/setting"
import util from "@/libs/util"
@ -162,11 +162,11 @@ export default {
provinceId: '',
cityId: '',
sequence: 1,
competitionScope: '', // (0: 1: 2.)
competitionScope: '不限', // (0: 1: 2.)
},
scopes: [
{
id: '',
id: '不限',
name: '不限'
},
{
@ -202,6 +202,11 @@ export default {
timerList: [],
};
},
computed: {
...mapState('match', [
'toMatch'
])
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
@ -227,20 +232,19 @@ export default {
const data = {
pageNum: this.page,
pageSize: this.pageSize,
competitionScope: scope,
platformSource: 1, // (01)
cityId: scope === 2 ? (form.cityId || null) : null, // id
provinceId: scope === 2 ? (form.provinceId || null) : null,
sequence: form.sequence || null,
keyWord: this.keyword
}
if (scope) data.competitionScope = scope
this.$post(this.api.contestPageConditionQueryByOccupationlabStu, data).then(({ data }) => {
this.listData = data.records
this.totals = data.total
const { records } = data
const second = 1000;
const minute = second * 60;
const hour = minute * 60;
this.listData.forEach((n, k) => {
records.forEach((n, k) => {
//
let now = new Date().getTime();
let signUpStartTime = new Date(this.core.dateCompatible(n.signUpStartTime)).getTime(); //
@ -282,7 +286,17 @@ export default {
} else {
n.ranges = n.range
}
});
})
this.listData = records
this.totals = data.total
// toMatchidscrollIntoView
if (this.toMatch) {
this.$nextTick(() => {
document.getElementById(this.toMatch).scrollIntoView()
this.SET_SOURCE('')
})
}
this.loadIns.close()
}).catch(res => {
this.loadIns.close()
@ -291,10 +305,10 @@ export default {
getData() {
this.loadIns = Loading.service()
this.getList()
if (!Setting.isDev) {
clearInterval(this.timer)
this.timer = setInterval(this.getList, 1000)
}
// if (!Setting.isDev) {
// clearInterval(this.timer)
// this.timer = setInterval(this.getList, 1000)
// }
},
initData() {
this.page = 1
@ -341,7 +355,10 @@ export default {
this.getData();
},
signup(item) {
//
this.SET_SOURCE(item.id)
this.$router.push('/login')
return
// status=2
if (item.status == 2) {
if (util.local.get(Setting.tokenKey)) {
this.$post(this.api.addApplicant, {
@ -354,8 +371,8 @@ export default {
this.$confirm('请先登录,是否直接前往登录?', "提示", {
type: 'success'
}).then(() => {
this.SET_SOURCE()
this.$router.push('/login')
this.SET_SOURCE(item.id)
this.$router.push('/login')
}).catch(() => {})
}
}

@ -5,33 +5,23 @@ const url = location.host;
const isDev = process.env.NODE_ENV === "development"; // 开发环境
const isHh = url.includes("10.196.131.73"); //是否河海版本
const isCH = url.includes("124.71.12.62"); //是否巢湖版本
const isBeta = url.includes("120.78.198.231"); //是否职站测试
const isPro = url.includes("occupationlab.com"); //是否职站生产
const isTest = url.includes('121.37.12.51'); //是否中台测试服
let systemPath = `${location.origin}/banksystem`
let host = `${location.origin}:9000/`
let title = '职站'
let host = `${location.origin}/`
let uploadURL = `https://121.37.12.51/`
let title = (isHh || isCH) ? '学生端' : '职站'
if (isHh) {
// 河海
host = "http://10.196.131.73/";
title = "学生端";
} else if (isCH) {
// 巢湖
host = "http://124.71.12.62/";
title = "学生端";
} else if (isBeta) {
// 职站测试
host = "http://120.78.198.231/";
} else if (isPro) {
if (isPro) {
// 职站生产
uploadURL = `https://www.huorantech.cn/`
systemPath = `https://www.huorantech.cn/banksystem`
} else if (isDev) {
// 本地
systemPath = `http://${location.hostname}:8093/#/`
host = "http://121.37.12.51:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕
host = "http://121.37.12.51/"; // 中台测试服
host = "http://192.168.31.151:9000/"; // 榕
// host = "http://192.168.31.137:9000/"; // 赓
}
@ -44,6 +34,7 @@ const Setting = {
routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址
uploadURL, // 阿里云oss域名
systemPath, // 子系统地址前缀
autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒

@ -4,11 +4,11 @@
export default {
namespaced: true,
state: {
toMatch: false
toMatch: ''
},
mutations: {
SET_SOURCE: state => {
state.toMatch = true
SET_SOURCE: (state, id) => {
state.toMatch = id
}
},
actions: {

Loading…
Cancel
Save