From b3690d03935394a2c264911ad3ea66339634843b Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Tue, 21 Nov 2023 10:22:56 +0800
Subject: [PATCH] fix
---
src/layouts/home/index.vue | 2 +-
src/pages/match/add/step3.vue | 41 +++++++++++++---------
src/pages/match/manage/matchArch.vue | 3 ++
src/pages/match/manage/matchArchList.vue | 30 +++++++++++++---
src/pages/match/manage/matchInfo.vue | 44 ++++++++++--------------
src/pages/station/preview/index.vue | 2 +-
src/setting.js | 2 +-
7 files changed, 74 insertions(+), 50 deletions(-)
diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue
index 9308a20..0c3886b 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/pages/match/add/step3.vue b/src/pages/match/add/step3.vue
index 699aa24..4881567 100644
--- a/src/pages/match/add/step3.vue
+++ b/src/pages/match/add/step3.vue
@@ -60,8 +60,7 @@
:label="1">是
- {
+ form.competitionStageContentSetting.fileList.push({
+ name: names[i],
+ url: n
+ })
+ })
}
form.competitionStageContentSetting.competitionId = this.id
form.competitionStageContentSetting.stageId = e.stageId
@@ -314,17 +319,15 @@ export default {
return this.$confirm(`确定移除 ${file.name}?`);
},
handleRemove (file, fileList, item) {
- item.fileName = ''
- item.fileUrl = ''
+ const i = item.competitionStageContentSetting.fileList.findIndex(e => e.url === file.url)
+ item.competitionStageContentSetting.fileList.splice(i, 1)
},
uploadSuccess (res, item) {
const { originalFileName, fileUrl } = res.filesResult
- item.competitionStageContentSetting.fileUrl = fileUrl
- item.competitionStageContentSetting.fileName = originalFileName
- item.competitionStageContentSetting.fileList = [{
+ item.competitionStageContentSetting.fileList.push({
name: originalFileName,
url: fileUrl
- }]
+ })
},
// 发布赛事
@@ -378,11 +381,11 @@ export default {
util.errorMsg('请输入评分规则')
break
}
- if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) {
- invalid = 1
- util.errorMsg('请输入说明')
- break
- }
+ // if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) {
+ // invalid = 1
+ // util.errorMsg('请输入说明')
+ // break
+ // }
} else {
if (e.onlineButton && !e.onlineAddress) {
invalid = 1
@@ -407,6 +410,10 @@ export default {
for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0
+ if (e.competitionStageContentSetting && e.competitionStageContentSetting.fileList && e.competitionStageContentSetting.fileList.length) {
+ e.competitionStageContentSetting.fileName = e.competitionStageContentSetting.fileList.map(n => n.name).join('|')
+ e.competitionStageContentSetting.fileUrl = e.competitionStageContentSetting.fileList.map(n => n.url).join('|')
+ }
}
this.$parent.showLoad()
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
diff --git a/src/pages/match/manage/matchArch.vue b/src/pages/match/manage/matchArch.vue
index 136896a..ac64ebc 100644
--- a/src/pages/match/manage/matchArch.vue
+++ b/src/pages/match/manage/matchArch.vue
@@ -16,6 +16,9 @@
{{ scope.$index + 1 }}
+
diff --git a/src/pages/match/manage/matchArchList.vue b/src/pages/match/manage/matchArchList.vue
index 310facd..f356459 100644
--- a/src/pages/match/manage/matchArchList.vue
+++ b/src/pages/match/manage/matchArchList.vue
@@ -59,7 +59,8 @@
批量导出
+ :loading="loading"
+ @click="exportData1">{{ loading ? '正在导出' : '批量导出' }}
@@ -176,7 +177,7 @@
-
预览文件
- 导出文件
@@ -293,7 +295,8 @@ export default {
},
statData: {},
tabs: ['成绩列表', '文件列表'],
- active: 0
+ active: 0,
+ loading: false
};
},
watch: {
@@ -318,6 +321,22 @@ export default {
stageId: this.stageId,
keyWord: this.keyword,
}).then(({ data }) => {
+ data.records.forEach(e => {
+ e.fileType = '其他'
+ if (util.isVideo(e.fileFormat)) {
+ e.fileType = '视频'
+ } else if (util.isAudio(e.fileFormat)) {
+ e.fileType = '音频'
+ } else if (util.isImg(e.fileFormat)) {
+ e.fileType = '图片'
+ } else if (util.isDoc(e.fileFormat)) {
+ e.fileType = '文档'
+ } else if (util.isCompress(e.fileFormat)) {
+ e.fileType = '压缩包'
+ } else if (e.fileType === 'pdf') {
+ e.fileType = 'pdf'
+ }
+ })
this.list1 = data.records
this.total1 = data.total
}).catch(res => { })
@@ -375,12 +394,13 @@ export default {
stageId: this.stageId,
}
if (ids) data.ids = ids
+ this.loading = true
axios.post(this.api.derive, data, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
- console.log("🚀 ~ file: matchArchList.vue:378 ~ exportData1 ~ res:", res)
util.downloadFileDirect(`批量导出.zip`, new Blob([res.data]))
+ this.loading = false
}).catch(res => { })
},
handleDelete (row) { // 删除
diff --git a/src/pages/match/manage/matchInfo.vue b/src/pages/match/manage/matchInfo.vue
index 0cdd5ec..1e02155 100644
--- a/src/pages/match/manage/matchInfo.vue
+++ b/src/pages/match/manage/matchInfo.vue
@@ -579,33 +579,27 @@ export default {
selectPar (row) {
const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
if (item) {
- // 该阶段已经开始比赛则不能修改
- const now = new Date()
- if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) {
- return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!')
+ const { teamLimit, stages, teamDetail } = this.info
+ // teamLimit=true,则每个成员只能参加一个阶段的比赛,要获取stages里返回的所有participantAccountIds(参赛人员的accountId),然后不显示这些参赛人员
+ if (teamLimit) {
+ const chooses = []
+ let ids = []
+ // 获取已经允许参赛的人员accountId
+ stages.map(e => {
+ const id = e.participantAccountIds
+ if (e.stageId != row.stageId && id) ids.push(...id.split(',').map(n => +n))
+ })
+ ids = [...new Set(ids)]
+ teamDetail.map(e => {
+ ids.includes(e.accountId) || chooses.push(e) // 没有参赛的人员则显示出来
+ })
+ this.chooses = chooses
} else {
- const { teamLimit, stages, teamDetail } = this.info
- // teamLimit=true,则每个成员只能参加一个阶段的比赛,要获取stages里返回的所有participantAccountIds(参赛人员的accountId),然后不显示这些参赛人员
- if (teamLimit) {
- const chooses = []
- let ids = []
- // 获取已经允许参赛的人员accountId
- stages.map(e => {
- const id = e.participantAccountIds
- if (e.stageId != row.stageId && id) ids.push(...id.split(',').map(n => +n))
- })
- ids = [...new Set(ids)]
- teamDetail.map(e => {
- ids.includes(e.accountId) || chooses.push(e) // 没有参赛的人员则显示出来
- })
- this.chooses = chooses
- } else {
- this.chooses = this.info.teamDetail
- }
- this.curRow = row
- this.checkedMembers = []
- this.chooseVisible = true
+ this.chooses = this.info.teamDetail
}
+ this.curRow = row
+ this.checkedMembers = []
+ this.chooseVisible = true
}
},
// 选择参赛人员提交
diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue
index 9d8c446..f394b4e 100644
--- a/src/pages/station/preview/index.vue
+++ b/src/pages/station/preview/index.vue
@@ -943,7 +943,7 @@ export default {
util.cookies.set('token', token)
util.cookies.set('mallId', this.mallId)
util.cookies.set('courseId', this.courseId)
- util.cookies.set('curriculumName', escape(this.curriculumName))
+ util.cookies.set('curriculumName', encodeURIComponent(this.curriculumName))
util.cookies.set('systemId', id)
util.cookies.set('fromManager', 1)
util.cookies.set('isSubmit', '', -1)
diff --git a/src/setting.js b/src/setting.js
index ed645f0..cfe673b 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -48,7 +48,7 @@ const Setting = {
showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址
jumpPath, // 判分点系统前缀
- autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间
+ autoLogoutTime: 1000 * 60 * 60, // 长时间未操作,自动退出登录时间
projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice