dev_review
yujialong 1 year ago
parent a6cec79bdc
commit 2f2e521494
  1. 3
      src/setting.js
  2. 28
      src/views/Home.vue
  3. 82
      src/views/course/contentSettings.vue
  4. 48
      src/views/match/add/step3.vue
  5. 3
      src/views/match/manage/matchArch.vue
  6. 34
      src/views/match/manage/matchArchList.vue
  7. 6
      src/views/match/manage/matchInfo.vue

@ -13,7 +13,7 @@ if (isDev) {
sandPath = `http://${location.hostname}:9520` sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.217:9000/'// 榕 // host = 'http://192.168.31.217:9000/'// 榕
// host = 'http://192.168.31.51:9000/'// 赓 // host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
@ -26,6 +26,7 @@ const Setting = {
* */ * */
platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人 platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人
platformSource: 0, // 平台来源(0中台,1职站) platformSource: 0, // 平台来源(0中台,1职站)
autoLogoutTime: 1000 * 60 * 60, // 长时间未操作,自动退出登录时间
jumpPath, // 判分点系统跳转路径前缀 jumpPath, // 判分点系统跳转路径前缀
sandPath, // 沙盘地址 sandPath, // 沙盘地址
apiBaseURL: host, // 请求路径前缀 apiBaseURL: host, // 请求路径前缀

@ -4,7 +4,8 @@
<v-sidebar></v-sidebar> <v-sidebar></v-sidebar>
<div class="content-box"> <div class="content-box">
<div class="content"> <div class="content">
<transition name="move" mode="out-in"> <transition name="move"
mode="out-in">
<!-- <keep-alive> --> <!-- <keep-alive> -->
<router-view></router-view> <router-view></router-view>
<!-- </keep-alive> --> <!-- </keep-alive> -->
@ -18,6 +19,8 @@
<script> <script>
import vHead from '../components/Header.vue'; import vHead from '../components/Header.vue';
import vSidebar from '../components/Sidebar.vue'; import vSidebar from '../components/Sidebar.vue';
import Setting from "@/setting";
import util from "@/libs/util";
export default { export default {
data () { data () {
return { return {
@ -29,6 +32,29 @@ export default {
vSidebar, vSidebar,
}, },
created () { created () {
this.autoLogout()
},
methods: {
// ,退
autoLogout () {
let lastTime = new Date().getTime();
document.onmousedown = () => {
lastTime = new Date().getTime();
};
const timer = setInterval(() => {
if (sessionStorage.getItem('token') && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) {
clearInterval(timer)
util.errorMsg("由于您已经有一个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。");
setTimeout(() => {
localStorage.removeItem('ms_username');
localStorage.removeItem('token');
sessionStorage.clear()
location.reload()
}, 1500);
}
}, 1000);
}
} }
}; };
</script> </script>

@ -544,48 +544,48 @@ export default {
}, },
// //
handleRequest (data) { handleRequest (data) {
console.log(33, Util.isVideo(this.fileType)) // console.log(33, Util.isVideo(this.fileType))
// // //
if (Util.isVideo(this.fileType)) { // if (Util.isVideo(this.fileType)) {
console.log("🚀 ~ file: contentSettings.vue:587 ~ handleRequest ~ AliyunUpload:", AliyunUpload) // console.log("🚀 ~ file: contentSettings.vue:587 ~ handleRequest ~ AliyunUpload:", AliyunUpload)
var uploader = new AliyunUpload.Vod({ // var uploader = new AliyunUpload.Vod({
// userID使访https://account.console.aliyun.com/ID // // userID使访https://account.console.aliyun.com/ID
userId: "1686385620732064", // userId: "1686385620732064",
// 1 MB100 KB100*1024 // // 1 MB100 KB100*1024
partSize: 1048576, // partSize: 1048576,
// 5 // // 5
parallel: 5, // parallel: 5,
// 3 // // 3
retryCount: 3, // retryCount: 3,
// 2 // // 2
retryDuration: 2, // retryDuration: 2,
// // //
'onUploadstarted': function (uploadInfo) { // 'onUploadstarted': function (uploadInfo) {
console.log("🚀 ~ file: contentSettings.vue:567 ~ handleRequest ~ uploadInfo:", uploadInfo) // console.log("🚀 ~ file: contentSettings.vue:567 ~ handleRequest ~ uploadInfo:", uploadInfo)
debugger // debugger
}, // },
// // //
'onUploadSucceed': function (uploadInfo) { // 'onUploadSucceed': function (uploadInfo) {
console.log("🚀 ~ file: contentSettings.vue:571 ~ handleRequest ~ uploadInfo:", uploadInfo) // console.log("🚀 ~ file: contentSettings.vue:571 ~ handleRequest ~ uploadInfo:", uploadInfo)
}, // },
// // //
'onUploadFailed': function (uploadInfo, code, message) { // 'onUploadFailed': function (uploadInfo, code, message) {
console.log("🚀 ~ file: contentSettings.vue:576 ~ handleRequest ~ uploadInfo, code, message:", uploadInfo, code, message) // console.log("🚀 ~ file: contentSettings.vue:576 ~ handleRequest ~ uploadInfo, code, message:", uploadInfo, code, message)
}, // },
// // //
'onUploadProgress': function (uploadInfo, totalSize, loadedPercent) { // 'onUploadProgress': function (uploadInfo, totalSize, loadedPercent) {
console.log("🚀 ~ file: contentSettings.vue:578 ~ handleRequest ~ uploadInfo, totalSize, loadedPercent:", uploadInfo, totalSize, loadedPercent) // console.log("🚀 ~ file: contentSettings.vue:578 ~ handleRequest ~ uploadInfo, totalSize, loadedPercent:", uploadInfo, totalSize, loadedPercent)
}, // },
// STS token // // STS token
'onUploadTokenExpired': function (uploadInfo) { // 'onUploadTokenExpired': function (uploadInfo) {
}, // },
// // //
'onUploadEnd': function (uploadInfo) { // 'onUploadEnd': function (uploadInfo) {
} // }
}); // });
} else { // } else {
const param = new FormData() const param = new FormData()
param.append('file', data.file) param.append('file', data.file)
const config = { const config = {
@ -611,7 +611,7 @@ export default {
this.fileUrl = fileUrl this.fileUrl = fileUrl
this.fileName = ossFileName this.fileName = ossFileName
}) })
} // }
}, },
uploadError (err, file, fileList) { uploadError (err, file, fileList) {
this.$message({ this.$message({

@ -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"
@ -70,14 +69,17 @@
:file-list="item.competitionStageContentSetting.fileList" :file-list="item.competitionStageContentSetting.fileList"
name="file"> name="file">
<el-button size="small" <el-button size="small"
type="primary">上传试卷</el-button> type="primary">上传文件</el-button>
</el-upload> </el-upload>
</template>
</div>
<div style="display: flex;align-items: flex-start;margin-top: 10px">
<span style="margin: 0 10px 0 30px;">说明</span> <span style="margin: 0 10px 0 30px;">说明</span>
<el-input maxlength="1000" <el-input maxlength="1000"
placeholder="请输入内容" placeholder="请输入内容"
type="textarea"
v-model="item.competitionStageContentSetting.stageExplain" v-model="item.competitionStageContentSetting.stageExplain"
style="width: calc(80% - 216px);"></el-input> style="width: calc(80% - 216px);"></el-input>
</template>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item class="req" <el-form-item class="req"
@ -233,11 +235,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
@ -312,17 +320,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
}] })
}, },
// //
publish () { publish () {
@ -375,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
@ -404,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">
@ -177,7 +178,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"
@ -189,13 +190,14 @@
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作"
align="center"
width="160"> width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<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"
:loading="scope.row.loading"
@click="exportFile(scope.row)">导出文件</el-button> @click="exportFile(scope.row)">导出文件</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -294,7 +296,8 @@ export default {
}, },
statData: {}, statData: {},
tabs: ['成绩列表', '文件列表'], tabs: ['成绩列表', '文件列表'],
active: 0 active: 0,
loading: false
}; };
}, },
watch: { watch: {
@ -319,6 +322,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 => { })
@ -376,12 +395,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) { //
@ -536,7 +556,9 @@ export default {
}, },
// //
exportFile (item) { exportFile (item) {
item.loading = true
util.downloadFile(item.userName + '-' + item.fileName, item.filePath) util.downloadFile(item.userName + '-' + item.fileName, item.filePath)
item.loading = false
}, },
} }
}; };

@ -578,11 +578,6 @@ 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 now = new Date()
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) {
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!')
} else {
const { teamLimit, stages, teamDetail } = this.info const { teamLimit, stages, teamDetail } = this.info
// teamLimit=truestagesparticipantAccountIdsaccountId // teamLimit=truestagesparticipantAccountIdsaccountId
if (teamLimit) { if (teamLimit) {
@ -605,7 +600,6 @@ export default {
this.checkedMembers = [] this.checkedMembers = []
this.chooseVisible = true this.chooseVisible = true
} }
}
}, },
// //
chooseSubmit () { chooseSubmit () {

Loading…
Cancel
Save