diff --git a/src/api/index.js b/src/api/index.js index 6c6798d..dd8fdfe 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -242,6 +242,7 @@ export default { addCompetitionStageRankingTime: `competition/competitionReleaseTime/addCompetitionStageRankingTime`, cancelCompetitionStageRankingTime: `competition/competitionReleaseTime/cancelCompetitionStageRankingTime`, getCompetitionStageRankingTime: `competition/competitionReleaseTime/getCompetitionStageRankingTime`, + frontOfficeCompetitionRanking: `competition/competition/rank/frontOfficeCompetitionRanking`, gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`, rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`, rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`, diff --git a/src/pages/achievement/show/index.vue b/src/pages/achievement/show/index.vue index e948d08..03b04ff 100644 --- a/src/pages/achievement/show/index.vue +++ b/src/pages/achievement/show/index.vue @@ -1,244 +1,320 @@ @@ -246,22 +322,24 @@ export default { .wrap { padding: 12px 300px 20px; } -code, kbd, samp{ - font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; +code, +kbd, +samp { + font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; word-wrap: break-word; white-space: pre-wrap; } -/deep/ pre{ - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ - word-break:break-all; - overflow:hidden; +/deep/ pre { + white-space: pre-wrap; /* css-3 */ + white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ + white-space: pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ + word-break: break-all; + overflow: hidden; font-size: 12px; - font-weight:400; - font-family:'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif + font-weight: 400; + font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; } .content { padding: 16px 40px; @@ -277,7 +355,7 @@ code, kbd, samp{ } .info { padding: 20px 16px; - border: 1px solid #E1E6F2; + border: 1px solid #e1e6f2; } .l-title { display: flex; @@ -311,7 +389,7 @@ code, kbd, samp{ span { min-width: 150px; padding: 0 10px 3px; - border-bottom: 1px solid #E1E6F2; + border-bottom: 1px solid #e1e6f2; } /deep/.el-input { width: 174px; @@ -320,7 +398,7 @@ code, kbd, samp{ .score-wrap { position: relative; min-width: 150px; - border-bottom: 1px solid #E1E6F2; + border-bottom: 1px solid #e1e6f2; em { position: absolute; top: -12px; @@ -328,7 +406,7 @@ code, kbd, samp{ font-family: din; font-size: 30px; font-weight: 600; - color: #0B1D30; + color: #0b1d30; } img { position: absolute; @@ -336,16 +414,17 @@ code, kbd, samp{ left: 0; } } - /deep/.el-textarea .el-textarea__inner, .pre-wrap { + /deep/.el-textarea .el-textarea__inner, + .pre-wrap { min-height: 72px; padding: 10px 16px; font-size: 14px; color: #333; &.edit { - color: #ABB3C6; - border: 1px solid #CACFDB; + color: #abb3c6; + border: 1px solid #cacfdb; border-radius: 4px; - background-color: #F6F7F9; + background-color: #f6f7f9; } } /deep/ .table th { @@ -357,7 +436,7 @@ code, kbd, samp{ } } .result-pic { - margin: 10px 0; + margin: 10px 0; } @media (max-width: 1650px) { .wrap { diff --git a/src/pages/achievement/teach/index.vue b/src/pages/achievement/teach/index.vue index e10d25f..6243c38 100644 --- a/src/pages/achievement/teach/index.vue +++ b/src/pages/achievement/teach/index.vue @@ -358,7 +358,7 @@ export default { // 考核和练习调不同接口 const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}`) this.activations = message.records - this.total = message.total + this.totalActivation = message.total }, initData () { this.$refs.table.clearSelection(); diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue index 1aff188..3c5e881 100644 --- a/src/pages/assessment/list/index.vue +++ b/src/pages/assessment/list/index.vue @@ -448,7 +448,7 @@ export default { this.$post(`${this.api.collectPaper}?id=${row.id}`).then(async res => { util.successMsg("提前结束成功!"); this.getData(); - // await this.$post(`${this.api.refreshPageNotification}?content=3-${row.id}`) + await this.$post(`${this.api.refreshPageNotification}?content=3-${row.id}`) }).catch(err => { console.log(err); }); diff --git a/src/pages/expSystem/backstage/model.vue b/src/pages/expSystem/backstage/model.vue index 46948b2..59d13c1 100644 --- a/src/pages/expSystem/backstage/model.vue +++ b/src/pages/expSystem/backstage/model.vue @@ -56,7 +56,7 @@ -
- -
-

比赛名称

- {{ form.stageName }} -
-
- -
-

比赛时间

-
- 起止时间: -
- - - - -
-
+
+ +
+

比赛名称

+ {{ form.stageName }} +
+
+ +
+

比赛时间

+
+ 起止时间: +
+ + + +
- - +
+
+
+ +
+

课程

+
+ + + + +
+
+
+ +
+ 实训项目 +
-

课程

-
- - - - -
-
- - -
- 实训项目 -
-
- -
- 自定义实验项目 -
+
- - - - - - - - - - - - - - + + + + + + + + + + + + + - - -
- -
- 返回 - 保存 + + + + +
+ 返回 + 保存
+
\ No newline at end of file diff --git a/src/pages/match/add/step3.vue b/src/pages/match/add/step3.vue index ba73ef6..7506d06 100644 --- a/src/pages/match/add/step3.vue +++ b/src/pages/match/add/step3.vue @@ -1,319 +1,355 @@ \ No newline at end of file diff --git a/src/pages/match/manage/index.vue b/src/pages/match/manage/index.vue index 9a4420f..3fff8f0 100644 --- a/src/pages/match/manage/index.vue +++ b/src/pages/match/manage/index.vue @@ -1,22 +1,30 @@ @@ -29,132 +37,133 @@ import notice from "./notice"; import MatchSignup from "./matchSignup"; import { mapState } from "vuex"; export default { - name: "matchManage", - data() { - return { - name: this.$route.query.name, - active: this.$route.query.tab || "tab1", - tabs: { - tab1: "大赛详情", - tab2: "大赛成绩管理", - tab3: "竞赛进展", - tab4: "公告通知", - tab5: "报名人员" - }, - }; - }, - components: { - MatchDetail, - MatchArch, - MatchProgress, - notice, - MatchSignup - }, - computed: { - ...mapState("user", [ - 'page' - ]), - ...mapState('auth', [ - 'btns' - ]) - }, - mounted() { - Setting.dynamicRoute && this.initTabs() - }, - beforeRouteLeave(to, from, next) { - const { detail } = this.$refs - if (detail) { - const step = detail.$refs['step' + detail.step] - if (detail.step < 4 && step && step.updateTime) { - this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示.......', { - type: 'warning' - }).then(() => { - detail.save(1,to.path,next) - }).catch(() => { - next() - }) - } else { + name: "matchManage", + data () { + return { + name: this.$route.query.name, + active: this.$route.query.tab || "tab1", + tabs: { + tab1: "大赛详情", + tab2: "大赛成绩管理", + tab3: "竞赛进展", + tab4: "公告通知", + tab5: "报名人员" + }, + pass: 0 + }; + }, + components: { + MatchDetail, + MatchArch, + MatchProgress, + notice, + MatchSignup + }, + computed: { + ...mapState("user", [ + 'page' + ]), + ...mapState('auth', [ + 'btns' + ]) + }, + mounted () { + Setting.dynamicRoute && this.initTabs() + }, + beforeRouteLeave (to, from, next) { + const { detail } = this.$refs + if (detail) { + const step = detail.$refs['step' + detail.step] + if (detail.step < 4 && step && step.updateTime && !step.pass && !this.pass) { + this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示.......', { + type: 'warning' + }).then(() => { + detail.save(1, to.path, next) + }).catch(() => { next() - } + }) } else { next() } - }, - methods: { - initTabs() { - const { btns } = this - console.log("🚀 ~ file: index.vue:67 ~ initTabs ~ btns", btns) - const tab1 = btns.includes('/match/list:管理:大赛详情') - const tab2 = btns.includes('/match/list:管理:大赛成绩管理') - const tab3 = btns.includes('/match/list:管理:竞赛进展') - const tab4 = btns.includes('/match/list:管理:公告通知') - const tab5 = btns.includes('/match/list:管理:报名人员') + } else { + next() + } + }, + methods: { + initTabs () { + const { btns } = this + console.log("🚀 ~ file: index.vue:67 ~ initTabs ~ btns", btns) + const tab1 = btns.includes('/match/list:管理:大赛详情') + const tab2 = btns.includes('/match/list:管理:大赛成绩管理') + const tab3 = btns.includes('/match/list:管理:竞赛进展') + const tab4 = btns.includes('/match/list:管理:公告通知') + const tab5 = btns.includes('/match/list:管理:报名人员') - tab1 || this.$delete(this.tabs, 'tab1') - tab2 || this.$delete(this.tabs, 'tab2') - tab3 || this.$delete(this.tabs, 'tab3') - tab4 || this.$delete(this.tabs, 'tab4') - tab5 || this.$delete(this.tabs, 'tab5') - const type = this.$route.query.tab - const keys = Object.keys(this.tabs) - this.active = keys.includes(type) ? type : keys[0] - }, - // 移除成绩管理 - hideArch() { - this.$delete(this.tabs, 'tab2') - }, - back() { - this.handleSave(0) && this.backPage() - }, - // 判断是否需要confirm - handleSave(i) { - // 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 - if (this.active === 'tab1') { - const { detail } = this.$refs - if (detail) { - const step = detail.$refs['step' + detail.step] - if (detail.step < 4 && step && step.updateTime) { - this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { - type: 'warning' - }).then(() => { - detail.save(1, 1) - this.backOrTab(i) - }).catch(() => { - this.backOrTab(i) - }) - } else { - this.backOrTab(i) - } - } else { + tab1 || this.$delete(this.tabs, 'tab1') + tab2 || this.$delete(this.tabs, 'tab2') + tab3 || this.$delete(this.tabs, 'tab3') + tab4 || this.$delete(this.tabs, 'tab4') + tab5 || this.$delete(this.tabs, 'tab5') + const type = this.$route.query.tab + const keys = Object.keys(this.tabs) + this.active = keys.includes(type) ? type : keys[0] + }, + // 移除成绩管理 + hideArch () { + this.$delete(this.tabs, 'tab2') + }, + back () { + this.handleSave(0) && this.backPage() + }, + // 判断是否需要confirm + handleSave (i) { + // 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 + if (this.active === 'tab1') { + const { detail } = this.$refs + if (detail) { + const step = detail.$refs['step' + detail.step] + if (detail.step < 4 && step && step.updateTime) { + this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { + type: 'warning' + }).then(() => { + detail.save(1, 1) + this.backOrTab(i) + }).catch(() => { this.backOrTab(i) - } - return false + }) } else { - return true + this.backOrTab(i) } - }, - // 返回列表 - backPage(){ - console.log(444, this.$store.state) - this.$router.push(`/match?page=${this.$store.state.match.page}`) - }, - // tab切换 - tabSwitch(i) { - this.active = i - this.$router.push(`/match/manage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) - }, - // 判断返回还是tab - backOrTab(i) { - i ? this.tabSwitch(i) : this.backPage() - }, - // tab回调 - tabChange(i) { - this.handleSave(i) && this.tabSwitch(i) + } else { + this.backOrTab(i) } + return false + } else { + return true + } + }, + // 返回列表 + backPage () { + console.log(444, this.$store.state) + this.pass = 1 + this.$router.push(`/match?page=${this.$store.state.match.page}`) + }, + // tab切换 + tabSwitch (i) { + this.active = i + this.$router.push(`/match/manage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) + }, + // 判断返回还是tab + backOrTab (i) { + i ? this.tabSwitch(i) : this.backPage() + }, + // tab回调 + tabChange (i) { + this.handleSave(i) && this.tabSwitch(i) } + } }; \ No newline at end of file diff --git a/src/pages/match/manage/matchRank.vue b/src/pages/match/manage/matchRank.vue index 47d9ef8..d95a633 100644 --- a/src/pages/match/manage/matchRank.vue +++ b/src/pages/match/manage/matchRank.vue @@ -356,7 +356,7 @@ export default { publicationType: this.type, locationStageId: this.stageId, stageIds: ids.splice(0, ids.length - 1) - }).then(({ page, publishStatus }) => { + }).then(({ page, publishStatus, total }) => { this.published = publishStatus this.list = page this.total = total @@ -392,12 +392,7 @@ export default { // 排序类型切换回调 typeChange (val) { this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { }).catch(res => { }) - - // this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { - // if (whetherToPublish && !val) this.sourceType = '0' this.getRank() - // this.published = whetherToPublish - // }).catch(res => {}) }, initData () { this.page = 1 @@ -498,12 +493,10 @@ export default { }, // 发布排名 publishSubmit () { - const { startTime, endTime } = this.grades[this.index] - if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') if (this.type) { // 手动发布 this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => { - this.getData() - util.successMsg('发布成功!') + // this.getData() + // util.successMsg('发布成功!') }).catch(res => { }) } else { let data = [] // 手动上传后发布排名,数据直接取批量上传后返回的data @@ -529,30 +522,15 @@ export default { const ids = this.grades.map(e => e.stageId) ids.pop() // 发布前校验 - // this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { this.$post(this.api.publishRanking, data).then(res => { this.uploadData = [] - this.getData() - util.successMsg('发布成功!') + // this.getData() + // util.successMsg('发布成功!') }).catch(res => { }) - // }).catch(res => {}) } }, // 发布排名确认 publish () { - // 如果已发布,并且上次发布的类型跟这次发布的类型不一致,则要提示确认 - // if (this.published && this.sourceType != this.type) { - // this.$confirm(this.sourceType == 1 && !this.type ? - // '手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' : - // '默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', { - // type: 'success' - // }).then(() => { - // this.publishSubmit() - // }).catch(() => {}) - // } else { - // this.publishSubmit() - // } - this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { whetherToPublish ? this.$confirm('排名已经发布,是否直接覆盖?', '提示', { @@ -562,7 +540,6 @@ export default { }).catch(() => { }) : this.publishSubmit() }).catch(res => { }) - // this.publishSubmit() }, // 获取定时发布排名 async getPublishTime () { @@ -584,13 +561,18 @@ export default { }, // 定时发布排名 async publishTimeSubmit () { - this.$post(this.api.addCompetitionStageRankingTime, { + const { startTime, endTime } = this.grades[this.index] + if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') + + this.publishSubmit() + await this.$post(this.api.addCompetitionStageRankingTime, { competitionId: this.id, isOverallRanking: this.active ? 0 : 1, publicationType: this.type, stageId: this.active || this.stageId, releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) }) + util.successMsg('发布成功') this.getData() this.uploaded = 0 @@ -608,7 +590,7 @@ export default { // 如果是取消发布,则直接调取消发布的接口 if (publish) { // 如果是手动发布,并且没有上传排名,则提示 - if (this.type && !this.uploaded) { + if (this.type && !this.uploaded && !this.list.length) { return util.errorMsg('请先上传数据!') } else { this.publishTime = new Date() @@ -618,9 +600,9 @@ export default { try { // 取消定时发布的接口跟取消普通发布的接口不一样 // if (this.timeId) { - await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`) + // await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`) // } else { - await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`) + await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}`) // } this.publishTime = '' this.sourceType = ''