diff --git a/src/setting.js b/src/setting.js index 783f5be..45e82cc 100644 --- a/src/setting.js +++ b/src/setting.js @@ -14,7 +14,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.51:9000/' } else if (isPro) { jumpPath = 'https://judgment.huorantech.cn/' } diff --git a/src/views/match/add/step1.vue b/src/views/match/add/step1.vue index 11cbca4..041a3d6 100644 --- a/src/views/match/add/step1.vue +++ b/src/views/match/add/step1.vue @@ -677,8 +677,9 @@ export default { if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1 } this.$parent.showLoad() - delete form.publishStatus - if (status === 1) form.publishStatus = 1 + // delete form.publishStatus + // if (status === 1) form.publishStatus = 1 + form.publishStatus = status form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) // 保存则禁用,发布则启用 form.releaseType = releaseType form.id = this.$route.query.id diff --git a/src/views/match/add/step2.vue b/src/views/match/add/step2.vue index 9395836..5984e22 100644 --- a/src/views/match/add/step2.vue +++ b/src/views/match/add/step2.vue @@ -464,9 +464,6 @@ export default { } else { // 保存草稿的情况下,只保存输入了阶段名称的阶段 form.competitionStageList = form.competitionStageList.filter(e => e.stageName) } - for (const e of form.competitionStageList) { - if (!e.teamNumLimit) e.customNumber = 0 - } this.$parent.showLoad() if (form.ruleId) { this.$post(this.api.editCompetitionRule, form).then(res => { diff --git a/src/views/match/manage/matchSignup.vue b/src/views/match/manage/matchSignup.vue index 7f94217..6830ec3 100644 --- a/src/views/match/manage/matchSignup.vue +++ b/src/views/match/manage/matchSignup.vue @@ -30,7 +30,11 @@ @click="autoAllocation">自动分配阶段成员 导入 + @click="batchImport"> + + {{ uploading ? '正在' : '' }}导入 +
+ + 取消上传 + 后台上传 + @@ -412,6 +431,8 @@ export default { headers: { token: sessionStorage.getItem("token") }, + uploading: false, + isBackstage: 0, }; }, watch: { @@ -496,9 +517,8 @@ export default { // 批量导入 batchImport () { + this.isBackstage = 0 this.importVisible = true - this.uploadList = [] - this.uploadFaild = false }, // 模板下载 download () { @@ -521,6 +541,7 @@ export default { }).catch(res => { }) }, uploadSuccess ({ data, status }) { + this.uploading = false this.uploadFaild = false this.uploadTips = '' if (status === 200) { @@ -539,12 +560,17 @@ export default { } }, uploadError (err, file, fileList) { + console.log("🚀 ~ uploadError ~ err:", err) + this.uploading = false this.$message({ message: "上传出错,请重试!", type: "error", center: true }) }, + beforeUpload (file) { + this.uploading = true + }, beforeRemove (file, fileList) { return this.$confirm(`确定移除 ${file.name}?`) }, @@ -553,14 +579,19 @@ export default { this.uploadFaild = false }, cancelUpload () { - this.$refs.upload.abort() - this.init() - this.importVisible = false - this.keyWord = '' + if (!this.isBackstage) { + this.uploadList = [] + this.$refs.upload.abort() + this.uploading = false + this.init() + this.importVisible = false + this.keyWord = '' + } }, - uploadSure () { + // 后台上传 + backstageUpload () { + this.isBackstage = 1 this.importVisible = false - this.keyWord = '' }, // 新增 add () { @@ -589,6 +620,10 @@ export default { }).catch(res => { }); }).catch(() => { }); }, + // 学校选择回调 + schoolChange () { + if (!this.form.studentAffiliatedInstitutionId) this.form.studentAffiliatedInstitutionId = this.form.schoolId + }, // 学号输入完回调。学校和学号都输入完后,调这个接口查询是否有存在的学生,如果有,才能继续输入,如果不能,不让添加 workNumberChange () { const { form } = this @@ -833,4 +868,11 @@ export default { font-size: 12px; color: #e90000; } +/deep/.import-file { + .el-progress__text, + .el-progress, + .el-upload-list__item-status-label { + display: none !important; + } +} \ No newline at end of file diff --git a/src/views/theoreticalCourse/preview/index.vue b/src/views/theoreticalCourse/preview/index.vue index 667b1aa..1a65825 100644 --- a/src/views/theoreticalCourse/preview/index.vue +++ b/src/views/theoreticalCourse/preview/index.vue @@ -1,76 +1,111 @@