yujialong 1 year ago
parent cdf6d1de36
commit b3690d0393
  1. 2
      src/layouts/home/index.vue
  2. 41
      src/pages/match/add/step3.vue
  3. 3
      src/pages/match/manage/matchArch.vue
  4. 30
      src/pages/match/manage/matchArchList.vue
  5. 44
      src/pages/match/manage/matchInfo.vue
  6. 2
      src/pages/station/preview/index.vue
  7. 2
      src/setting.js

@ -144,7 +144,7 @@ export default {
setInterval(() => { setInterval(() => {
if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) { if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) {
util.errorMsg("用户登录过期,请重新登录"); util.errorMsg("由于您已经有一个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。");
setTimeout(this.logout, 1500); setTimeout(this.logout, 1500);
} }
}, 1000); }, 1000);

@ -60,8 +60,7 @@
:label="1"></el-radio> :label="1"></el-radio>
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles"> <template v-if="item.competitionStageContentSetting.whetherToUploadFiles">
<el-upload accept=".jpg,.png,.jpeg,.gif" <el-upload :on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-error="uploadError" :on-error="uploadError"
:on-success="res => uploadSuccess(res, item)" :on-success="res => uploadSuccess(res, item)"
:before-remove="beforeRemove" :before-remove="beforeRemove"
@ -235,11 +234,17 @@ export default {
fileList: [] fileList: []
} }
} }
//
if (form.competitionStageContentSetting.fileUrl) { if (form.competitionStageContentSetting.fileUrl) {
form.competitionStageContentSetting.fileList = [{ const urls = form.competitionStageContentSetting.fileUrl.split('|')
name: form.competitionStageContentSetting.fileName, const names = form.competitionStageContentSetting.fileName.split('|')
url: form.competitionStageContentSetting.fileUrl, form.competitionStageContentSetting.fileList = []
}] urls.map((n, i) => {
form.competitionStageContentSetting.fileList.push({
name: names[i],
url: n
})
})
} }
form.competitionStageContentSetting.competitionId = this.id form.competitionStageContentSetting.competitionId = this.id
form.competitionStageContentSetting.stageId = e.stageId form.competitionStageContentSetting.stageId = e.stageId
@ -314,17 +319,15 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove (file, fileList, item) { handleRemove (file, fileList, item) {
item.fileName = '' const i = item.competitionStageContentSetting.fileList.findIndex(e => e.url === file.url)
item.fileUrl = '' item.competitionStageContentSetting.fileList.splice(i, 1)
}, },
uploadSuccess (res, item) { uploadSuccess (res, item) {
const { originalFileName, fileUrl } = res.filesResult const { originalFileName, fileUrl } = res.filesResult
item.competitionStageContentSetting.fileUrl = fileUrl item.competitionStageContentSetting.fileList.push({
item.competitionStageContentSetting.fileName = originalFileName
item.competitionStageContentSetting.fileList = [{
name: originalFileName, name: originalFileName,
url: fileUrl url: fileUrl
}] })
}, },
// //
@ -378,11 +381,11 @@ export default {
util.errorMsg('请输入评分规则') util.errorMsg('请输入评分规则')
break break
} }
if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) { // if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) {
invalid = 1 // invalid = 1
util.errorMsg('请输入说明') // util.errorMsg('')
break // break
} // }
} else { } else {
if (e.onlineButton && !e.onlineAddress) { if (e.onlineButton && !e.onlineAddress) {
invalid = 1 invalid = 1
@ -407,6 +410,10 @@ export default {
for (const e of form) { for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0 e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 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.$parent.showLoad()
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], { this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {

@ -16,6 +16,9 @@
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="stageName"
label="阶段名称"
align="center"></el-table-column>
<el-table-column prop="methodName" <el-table-column prop="methodName"
label="比赛方式" label="比赛方式"
align="center"></el-table-column> align="center"></el-table-column>

@ -59,7 +59,8 @@
</div> </div>
<div v-else> <div v-else>
<el-button type="primary" <el-button type="primary"
@click="exportData1">批量导出</el-button> :loading="loading"
@click="exportData1">{{ loading ? '正在导出' : '批量导出' }}</el-button>
</div> </div>
</div> </div>
<template v-if="!active"> <template v-if="!active">
@ -176,7 +177,7 @@
<el-table-column prop="fileSize" <el-table-column prop="fileSize"
label="文件大小" label="文件大小"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="fileFormat" <el-table-column prop="fileType"
label="文件类型" label="文件类型"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="fileFormat" <el-table-column prop="fileFormat"
@ -194,7 +195,8 @@
<el-button v-if="!isCompress(scope.row.fileFormat)" <el-button v-if="!isCompress(scope.row.fileFormat)"
type="text" type="text"
@click="preview(scope.row)">预览文件</el-button> @click="preview(scope.row)">预览文件</el-button>
<el-button type="text" <el-button type="primary"
size="mini"
@click="exportFile(scope.row)">导出文件</el-button> @click="exportFile(scope.row)">导出文件</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -293,7 +295,8 @@ export default {
}, },
statData: {}, statData: {},
tabs: ['成绩列表', '文件列表'], tabs: ['成绩列表', '文件列表'],
active: 0 active: 0,
loading: false
}; };
}, },
watch: { watch: {
@ -318,6 +321,22 @@ export default {
stageId: this.stageId, stageId: this.stageId,
keyWord: this.keyword, keyWord: this.keyword,
}).then(({ data }) => { }).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.list1 = data.records
this.total1 = data.total this.total1 = data.total
}).catch(res => { }) }).catch(res => { })
@ -375,12 +394,13 @@ export default {
stageId: this.stageId, stageId: this.stageId,
} }
if (ids) data.ids = ids if (ids) data.ids = ids
this.loading = true
axios.post(this.api.derive, data, { axios.post(this.api.derive, data, {
headers: this.headers, headers: this.headers,
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
console.log("🚀 ~ file: matchArchList.vue:378 ~ exportData1 ~ res:", res)
util.downloadFileDirect(`批量导出.zip`, new Blob([res.data])) util.downloadFileDirect(`批量导出.zip`, new Blob([res.data]))
this.loading = false
}).catch(res => { }) }).catch(res => { })
}, },
handleDelete (row) { // handleDelete (row) { //

@ -579,33 +579,27 @@ export default {
selectPar (row) { selectPar (row) {
const item = this.form.competitionStage.find(e => e.stageId == row.stageId) const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
if (item) { if (item) {
// const { teamLimit, stages, teamDetail } = this.info
const now = new Date() // teamLimit=truestagesparticipantAccountIdsaccountId
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) { if (teamLimit) {
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!') 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 { } else {
const { teamLimit, stages, teamDetail } = this.info this.chooses = this.info.teamDetail
// teamLimit=truestagesparticipantAccountIdsaccountId
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.curRow = row
this.checkedMembers = []
this.chooseVisible = true
} }
}, },
// //

@ -943,7 +943,7 @@ export default {
util.cookies.set('token', token) util.cookies.set('token', token)
util.cookies.set('mallId', this.mallId) util.cookies.set('mallId', this.mallId)
util.cookies.set('courseId', this.courseId) 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('systemId', id)
util.cookies.set('fromManager', 1) util.cookies.set('fromManager', 1)
util.cookies.set('isSubmit', '', -1) util.cookies.set('isSubmit', '', -1)

@ -48,7 +48,7 @@ const Setting = {
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址 apiBaseURL: host, // 接口请求地址
jumpPath, // 判分点系统前缀 jumpPath, // 判分点系统前缀
autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间 autoLogoutTime: 1000 * 60 * 60, // 长时间未操作,自动退出登录时间
projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

Loading…
Cancel
Save