From 3186dafffba1dc2a3ec71008a16b4394a9cbb612 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 6 Dec 2023 17:14:02 +0800 Subject: [PATCH] fix --- src/api/index.js | 3 +- src/layouts/home/index.vue | 2 +- src/libs/util.js | 19 ------------ src/pages/course/preview/index.vue | 1 - src/pages/match/add/step1.vue | 7 ++--- src/pages/match/add/step2.vue | 4 +-- src/pages/match/add/step3.vue | 38 +++++++++++++++++++----- src/pages/match/manage/matchArchList.vue | 4 +-- src/pages/match/manage/matchRank.vue | 35 ++++++++++++++++++++-- src/pages/station/preview/index.vue | 1 - src/plugins/requests/index.js | 1 - src/setting.js | 2 +- 12 files changed, 73 insertions(+), 44 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 1e26727..6de14de 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -4,8 +4,6 @@ const uploadURL = Setting.upload.apiURL; const host2 = 'http://121.37.12.51/' export default { - queryToken: `liuwanr/userInfo/queryToken`, - logins: `users/users/user/login`, //登录 verification: `${host}users/users/user/captcha`,// 验证码图片 isClient: `users/users/user/isClient`,// 是否为客户 @@ -13,6 +11,7 @@ export default { getSchoolIdByToken : `users/users/data/user/getSchoolIdByToken`, deleteProfile : `users/users/userInfo/deleteProfile`, refreshPageNotification : `nakadai/message/refreshPageNotification`, + getCurrentTime : `competition/competition/management/getCurrentTime`, getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证 diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue index 0c3886b..baaecbf 100644 --- a/src/layouts/home/index.vue +++ b/src/layouts/home/index.vue @@ -144,7 +144,7 @@ export default { setInterval(() => { if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) { - util.errorMsg("由于您已经有一个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。"); + util.errorMsg("由于您已经有三个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。"); setTimeout(this.logout, 1500); } }, 1000); diff --git a/src/libs/util.js b/src/libs/util.js index 05cbc69..d2f4b33 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -172,25 +172,6 @@ const util = { Message.closeAll(); return Message.error({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); }, - // 登录互踢 - getToken() { - if (process.env.NODE_ENV != "production") { - if (store.state.user.dataTime && !logout) { - axios.get(`${api.queryToken}?token=${_local.get(Setting.tokenKey)}`).then(res => { - if (store.state.user.dataTime && (res.data.message != store.state.user.dataTime)) { - logout || Message.error("您已在另一台设备登录,本次登录已下线!"); - logout = true; - setTimeout(() => { - _local.remove(Setting.storeKey); - _local.remove(Setting.tokenKey); - location.reload(); - }, 1500); - } - }).catch(err => { - }); - } - } - }, debounce(fn, delay) { // 防抖 let timeout = null; return function() { diff --git a/src/pages/course/preview/index.vue b/src/pages/course/preview/index.vue index 38c9905..90f7ef8 100644 --- a/src/pages/course/preview/index.vue +++ b/src/pages/course/preview/index.vue @@ -121,7 +121,6 @@ export default { data () { return { id: this.$route.query.id, - video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4", videoSrc: "", videoList: [], courseName: "", diff --git a/src/pages/match/add/step1.vue b/src/pages/match/add/step1.vue index 0e77f9d..fa18321 100644 --- a/src/pages/match/add/step1.vue +++ b/src/pages/match/add/step1.vue @@ -659,7 +659,7 @@ export default { * releaseType 发布类型(0发布信息,1完整比赛) * */ save (status, next = 0, releaseType = 0, cb) { - const { form } = this + const form = JSON.parse(JSON.stringify(this.form)) form.sponsor = this.sponsorList.filter(d => d).join(); form.undertaker = this.undertakerList.filter(d => d).join(); if (!form.name) return util.warningMsg("请填写竞赛名称"); @@ -700,12 +700,11 @@ export default { form.releaseType = releaseType form.id = this.$route.query.id - this.updateTime = 0 if (form.id) { this.$post(this.api.editCompetition, form).then(res => { - this.updateTime = 0 this.$parent.hideLoad() - util.successMsg("修改成功"); + this.updateTime && util.successMsg("修改成功"); + this.updateTime = 0 this.$emit('next', next, cb) }).catch(err => { this.$parent.hideLoad() diff --git a/src/pages/match/add/step2.vue b/src/pages/match/add/step2.vue index 1f41212..113a76d 100644 --- a/src/pages/match/add/step2.vue +++ b/src/pages/match/add/step2.vue @@ -458,12 +458,12 @@ export default { if (!e.teamNumLimitOpt) e.teamNumLimit = 0 } this.$parent.showLoad() - this.updateTime = 0 this.pass = 1 if (form.ruleId) { this.$post(this.api.editCompetitionRule, form).then(res => { this.$parent.hideLoad() - util.successMsg("修改成功"); + this.updateTime && util.successMsg("修改成功"); + this.updateTime = 0 this.$emit('next', next, cb) }).catch(err => { this.$parent.hideLoad() diff --git a/src/pages/match/add/step3.vue b/src/pages/match/add/step3.vue index 8bd8e18..b703a38 100644 --- a/src/pages/match/add/step3.vue +++ b/src/pages/match/add/step3.vue @@ -60,22 +60,27 @@ :label="1">是 +
+ 说明 + +
@@ -314,13 +319,19 @@ export default { center: true }) }, + downloadFile () { + // const { name, url } = this.fileList[0] + // util.downloadFile(name, url) + }, + handlePreview (file) { + window.open((util.isDoc(util.getFileExt(file.name)) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + file.url) + }, beforeRemove (file, fileList) { return this.$confirm(`确定移除 ${file.name}?`); }, handleRemove (file, fileList, item) { Oss.del(file.url) - const i = item.competitionStageContentSetting.fileList.findIndex(e => e.url === file.url) - item.competitionStageContentSetting.fileList.splice(i, 1) + item.competitionStageContentSetting.fileList = fileList }, // 自定义上传 async handleRequest ({ file }, item) { @@ -460,4 +471,15 @@ export default { } } } +/deep/.file-upload { + width: 500px; + .download { + position: absolute; + bottom: -63px; + right: 0; + font-size: 12px; + color: #007eff; + cursor: pointer; + } +} \ No newline at end of file diff --git a/src/pages/match/manage/matchArchList.vue b/src/pages/match/manage/matchArchList.vue index 978776b..eb9281b 100644 --- a/src/pages/match/manage/matchArchList.vue +++ b/src/pages/match/manage/matchArchList.vue @@ -384,7 +384,7 @@ export default { pageNum: 1, pageSize: 10000, competitionId: this.id, - isNakadai: 0, + isNakadai: 1, stageId: this.stageId, }, { headers: this.headers, @@ -492,7 +492,7 @@ export default { yAxis: { name: "人数", type: "value", - interval: 1 + interval: 10 }, series: [{ data, diff --git a/src/pages/match/manage/matchRank.vue b/src/pages/match/manage/matchRank.vue index f4ffaaa..876c7cd 100644 --- a/src/pages/match/manage/matchRank.vue +++ b/src/pages/match/manage/matchRank.vue @@ -512,12 +512,43 @@ export default { }, // 导出(有勾选:就导勾选中的;没有勾选:就导全部) - exportData () { + async exportData () { + this.loading = true let { list } = this if (this.multipleSelection.length) { list = this.multipleSelection + } else { + // 没勾选的情况:先查询所有数据,pageSize传10000,再导出全部 + + // 手动上传的排名接口 + if (this.type) { + const res = await this.$post(this.api.manuallyUploadedRankings, { + pageNum: 1, + pageSize: 10000, + competitionId: this.id, + isOverallRanking: this.active ? 0 : 1, + stageId: this.active || this.stageId + }) + list = res.message.records + } else { // 默认排名接口 + if (!this.active) { + // 总分排名 + const ids = this.grades.map(e => e.stageId) + const res = await this.$post(this.api.overallStandingsInThePointsRace, { + pageNum: 1, + pageSize: 10000, + competitionId: this.id, + publicationType: this.type, + locationStageId: this.stageId, + stageIds: ids.splice(0, ids.length - 1) + }) + list = res.page + } else { // 阶段排名 + const res = await this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=1&pageSize=10000&publicationType=${this.type}`) + list = res.page + } + } } - this.loading = true list.forEach((e, i) => { e.serialNumber = i + 1 if (e.leaderName) e.userName = e.leaderName diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index ff7e2e5..48d4064 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -456,7 +456,6 @@ export default { section: this.$route.query.section, fromAdmin: this.$route.query.admin, // 是否从产品中心or实验台进来 type: 1, - video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4", chapterList: [], // 章节列表 progressList: [], coverUrl: "", // 课程封面 diff --git a/src/plugins/requests/index.js b/src/plugins/requests/index.js index ba9b134..caac512 100644 --- a/src/plugins/requests/index.js +++ b/src/plugins/requests/index.js @@ -13,7 +13,6 @@ service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8" // 请求拦截器 service.interceptors.request.use(config => { - util.getToken(); let token = util.local.get(Setting.tokenKey); if (token) config.headers.token = token; return config; diff --git a/src/setting.js b/src/setting.js index cfe673b..c0b1bc6 100644 --- a/src/setting.js +++ b/src/setting.js @@ -48,7 +48,7 @@ const Setting = { showProgressBar: true, // 页面切换时,是否显示模拟的进度条 apiBaseURL: host, // 接口请求地址 jumpPath, // 判分点系统前缀 - autoLogoutTime: 1000 * 60 * 60, // 长时间未操作,自动退出登录时间 + autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间 projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice