dev_review
yujialong 1 year ago
parent a6cec79bdc
commit 2f2e521494
  1. 2
      src/libs/util.js
  2. 3
      src/setting.js
  3. 72
      src/views/Home.vue
  4. 128
      src/views/course/contentSettings.vue
  5. 56
      src/views/match/add/step3.vue
  6. 3
      src/views/match/manage/matchArch.vue
  7. 34
      src/views/match/manage/matchArchList.vue
  8. 44
      src/views/match/manage/matchInfo.vue

@ -109,7 +109,7 @@ const util = {
return fileName.substring(fileName.lastIndexOf('.') + 1)
},
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
downloadFile(fileName,url) {
downloadFile(fileName, url) {
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = 'blob'

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

@ -1,34 +1,60 @@
<template>
<div class="wrapper">
<v-head></v-head>
<v-sidebar></v-sidebar>
<div class="content-box" >
<div class="content">
<transition name="move" mode="out-in">
<!-- <keep-alive> -->
<router-view></router-view>
<!-- </keep-alive> -->
</transition>
<el-backtop target=".content"></el-backtop>
</div>
</div>
<div class="wrapper">
<v-head></v-head>
<v-sidebar></v-sidebar>
<div class="content-box">
<div class="content">
<transition name="move"
mode="out-in">
<!-- <keep-alive> -->
<router-view></router-view>
<!-- </keep-alive> -->
</transition>
<el-backtop target=".content"></el-backtop>
</div>
</div>
</div>
</template>
<script>
import vHead from '../components/Header.vue';
import vSidebar from '../components/Sidebar.vue';
import Setting from "@/setting";
import util from "@/libs/util";
export default {
data() {
return {
tagsList: [],
};
},
components: {
vHead,
vSidebar,
},
created() {
data () {
return {
tagsList: [],
};
},
components: {
vHead,
vSidebar,
},
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>

@ -544,74 +544,74 @@ export default {
},
//
handleRequest (data) {
console.log(33, Util.isVideo(this.fileType))
//
if (Util.isVideo(this.fileType)) {
// console.log(33, Util.isVideo(this.fileType))
// //
// if (Util.isVideo(this.fileType)) {
console.log("🚀 ~ file: contentSettings.vue:587 ~ handleRequest ~ AliyunUpload:", AliyunUpload)
var uploader = new AliyunUpload.Vod({
// userID使访https://account.console.aliyun.com/ID
userId: "1686385620732064",
// 1 MB100 KB100*1024
partSize: 1048576,
// 5
parallel: 5,
// 3
retryCount: 3,
// 2
retryDuration: 2,
//
'onUploadstarted': function (uploadInfo) {
console.log("🚀 ~ file: contentSettings.vue:567 ~ handleRequest ~ uploadInfo:", uploadInfo)
debugger
},
//
'onUploadSucceed': function (uploadInfo) {
console.log("🚀 ~ file: contentSettings.vue:571 ~ handleRequest ~ uploadInfo:", uploadInfo)
},
//
'onUploadFailed': function (uploadInfo, code, message) {
console.log("🚀 ~ file: contentSettings.vue:576 ~ handleRequest ~ uploadInfo, code, message:", uploadInfo, code, message)
},
//
'onUploadProgress': function (uploadInfo, totalSize, loadedPercent) {
console.log("🚀 ~ file: contentSettings.vue:578 ~ handleRequest ~ uploadInfo, totalSize, loadedPercent:", uploadInfo, totalSize, loadedPercent)
},
// STS token
'onUploadTokenExpired': function (uploadInfo) {
},
//
'onUploadEnd': function (uploadInfo) {
}
});
// console.log("🚀 ~ file: contentSettings.vue:587 ~ handleRequest ~ AliyunUpload:", AliyunUpload)
// var uploader = new AliyunUpload.Vod({
// // userID使访https://account.console.aliyun.com/ID
// userId: "1686385620732064",
// // 1 MB100 KB100*1024
// partSize: 1048576,
// // 5
// parallel: 5,
// // 3
// retryCount: 3,
// // 2
// retryDuration: 2,
// //
// 'onUploadstarted': function (uploadInfo) {
// console.log("🚀 ~ file: contentSettings.vue:567 ~ handleRequest ~ uploadInfo:", uploadInfo)
// debugger
// },
// //
// 'onUploadSucceed': function (uploadInfo) {
// console.log("🚀 ~ file: contentSettings.vue:571 ~ handleRequest ~ uploadInfo:", uploadInfo)
// },
// //
// 'onUploadFailed': function (uploadInfo, code, message) {
// console.log("🚀 ~ file: contentSettings.vue:576 ~ handleRequest ~ uploadInfo, code, message:", uploadInfo, code, message)
// },
// //
// 'onUploadProgress': function (uploadInfo, totalSize, loadedPercent) {
// console.log("🚀 ~ file: contentSettings.vue:578 ~ handleRequest ~ uploadInfo, totalSize, loadedPercent:", uploadInfo, totalSize, loadedPercent)
// },
// // STS token
// 'onUploadTokenExpired': function (uploadInfo) {
// },
// //
// 'onUploadEnd': function (uploadInfo) {
// }
// });
} else {
const param = new FormData()
param.append('file', data.file)
const config = {
timeout: 10000000000,
headers: {
'Accept': '*/*',
'Content-Type': 'multipart/form-data'
},
//
onUploadProgress: progressEvent => {
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent)
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per
}
// } else {
const param = new FormData()
param.append('file', data.file)
const config = {
timeout: 10000000000,
headers: {
'Accept': '*/*',
'Content-Type': 'multipart/form-data'
},
//
onUploadProgress: progressEvent => {
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent)
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per
}
axios.post(this.api.fileupload, param, config).then(res => {
this.progressPercent = 100
this.showProgress = false
const { fileId, fileType, fileUrl, ossFileName } = res.data.data.filesResult
this.uploading = false
this.fileId = fileId
this.fileType = fileType
this.fileUrl = fileUrl
this.fileName = ossFileName
})
}
axios.post(this.api.fileupload, param, config).then(res => {
this.progressPercent = 100
this.showProgress = false
const { fileId, fileType, fileUrl, ossFileName } = res.data.data.filesResult
this.uploading = false
this.fileId = fileId
this.fileType = fileType
this.fileUrl = fileUrl
this.fileName = ossFileName
})
// }
},
uploadError (err, file, fileList) {
this.$message({

@ -60,8 +60,7 @@
:label="1"></el-radio>
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles">
<el-upload accept=".jpg,.png,.jpeg,.gif"
:on-remove="(file, fileList) => handleRemove(file, fileList, item)"
<el-upload :on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-error="uploadError"
:on-success="res => uploadSuccess(res, item)"
:before-remove="beforeRemove"
@ -70,15 +69,18 @@
:file-list="item.competitionStageContentSetting.fileList"
name="file">
<el-button size="small"
type="primary">上传试卷</el-button>
type="primary">上传文件</el-button>
</el-upload>
<span style="margin: 0 10px 0 30px;">说明</span>
<el-input maxlength="1000"
placeholder="请输入内容"
v-model="item.competitionStageContentSetting.stageExplain"
style="width: calc(80% - 216px);"></el-input>
</template>
</div>
<div style="display: flex;align-items: flex-start;margin-top: 10px">
<span style="margin: 0 10px 0 30px;">说明</span>
<el-input maxlength="1000"
placeholder="请输入内容"
type="textarea"
v-model="item.competitionStageContentSetting.stageExplain"
style="width: calc(80% - 216px);"></el-input>
</div>
</el-form-item>
<el-form-item class="req"
label="比赛内容">
@ -233,11 +235,17 @@ export default {
fileList: []
}
}
//
if (form.competitionStageContentSetting.fileUrl) {
form.competitionStageContentSetting.fileList = [{
name: form.competitionStageContentSetting.fileName,
url: form.competitionStageContentSetting.fileUrl,
}]
const urls = form.competitionStageContentSetting.fileUrl.split('|')
const names = form.competitionStageContentSetting.fileName.split('|')
form.competitionStageContentSetting.fileList = []
urls.map((n, i) => {
form.competitionStageContentSetting.fileList.push({
name: names[i],
url: n
})
})
}
form.competitionStageContentSetting.competitionId = this.id
form.competitionStageContentSetting.stageId = e.stageId
@ -312,17 +320,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
}]
})
},
//
publish () {
@ -375,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
@ -404,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'], {

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

@ -59,7 +59,8 @@
</div>
<div v-else>
<el-button type="primary"
@click="exportData1">批量导出</el-button>
:loading="loading"
@click="exportData1">{{ loading ? '正在导出' : '批量导出' }}</el-button>
</div>
</div>
<template v-if="!active">
@ -177,7 +178,7 @@
<el-table-column prop="fileSize"
label="文件大小"
align="center"></el-table-column>
<el-table-column prop="fileFormat"
<el-table-column prop="fileType"
label="文件类型"
align="center"></el-table-column>
<el-table-column prop="fileFormat"
@ -189,13 +190,14 @@
align="center">
</el-table-column>
<el-table-column label="操作"
align="center"
width="160">
<template slot-scope="scope">
<el-button v-if="!isCompress(scope.row.fileFormat)"
type="text"
@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>
</template>
</el-table-column>
@ -294,7 +296,8 @@ export default {
},
statData: {},
tabs: ['成绩列表', '文件列表'],
active: 0
active: 0,
loading: false
};
},
watch: {
@ -319,6 +322,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 => { })
@ -376,12 +395,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) { //
@ -536,7 +556,9 @@ export default {
},
//
exportFile (item) {
item.loading = true
util.downloadFile(item.userName + '-' + item.fileName, item.filePath)
item.loading = false
},
}
};

@ -578,33 +578,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=truestagesparticipantAccountIdsaccountId
if (teamLimit) {
const chooses = []
let ids = []
// accountId
stages.map(e => {
let 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=truestagesparticipantAccountIdsaccountId
if (teamLimit) {
const chooses = []
let ids = []
// accountId
stages.map(e => {
let 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
}
},
//

Loading…
Cancel
Save