dev_202303
yujialong 2 years ago
parent 048d68dfd6
commit 0da27c54c3
  1. 2
      src/setting.js
  2. 6
      src/store/index.js
  3. 6
      src/utils/api.js
  4. 8
      src/views/course/AddCurriculum.vue
  5. 11
      src/views/match/add/index.vue
  6. 32
      src/views/match/add/set.vue
  7. 6
      src/views/match/add/step1.vue
  8. 125
      src/views/match/add/step2.vue
  9. 25
      src/views/match/add/step3.vue
  10. 81
      src/views/match/list/index.vue
  11. 2
      src/views/match/manage/matchInfo.vue
  12. 186
      src/views/match/manage/matchRank.vue
  13. 17
      src/views/match/manage/matchSignup.vue
  14. 3
      src/views/serve/projectList.vue

@ -11,7 +11,7 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
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.51:9000/'// 榕 host = 'http://192.168.31.51:9000/'// 榕
// host = 'http://192.168.31.116:9000/'// 赓 // host = 'http://192.168.31.116:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'

@ -27,7 +27,8 @@ const store = new Vuex.Store({
columnId: '', columnId: '',
tabId: '1', tabId: '1',
dataPer: [], dataPer: [],
orderParam: null orderParam: null,
competitionCache: null
}, },
actions: { actions: {
setSystemId({ state,commit },systemId) { setSystemId({ state,commit },systemId) {
@ -107,6 +108,9 @@ const store = new Vuex.Store({
setOrderParam: (state, orderParam) => { setOrderParam: (state, orderParam) => {
state.orderParam = orderParam state.orderParam = orderParam
}, },
setCompetitionCache: (state, param) => {
state.competitionCache = param
},
} }
}); });

@ -337,7 +337,7 @@ export default {
disableContests: `competition/competition/registration/disableContests`, disableContests: `competition/competition/registration/disableContests`,
disableRegistration: `competition/competition/registration/disableRegistration`, disableRegistration: `competition/competition/registration/disableRegistration`,
excelExport: `${host}competition/competition/registration/excelExport`, excelExport: `${host}competition/competition/registration/excelExport`,
exportDataInBatches: `competition/competition/registration/exportDataInBatches`, exportDataInBatches: `${host}competition/competition/registration/exportDataInBatches`,
queryRegistrationByCondition: `competition/competition/registration/queryRegistrationByCondition`, queryRegistrationByCondition: `competition/competition/registration/queryRegistrationByCondition`,
searchTeam: `competition/competition/team/searchTeam`, searchTeam: `competition/competition/team/searchTeam`,
joinCompetitionTeam: `competition/competition/team/joinCompetitionTeam`, joinCompetitionTeam: `competition/competition/team/joinCompetitionTeam`,
@ -383,6 +383,10 @@ export default {
queryPublicationSource: `competition/competition/rank/queryPublicationSource`, queryPublicationSource: `competition/competition/rank/queryPublicationSource`,
releaseVerification: `competition/competition/rank/releaseVerification`, releaseVerification: `competition/competition/rank/releaseVerification`,
totalRankingScoreDetails: `competition/competition/rank/totalRankingScoreDetails`, totalRankingScoreDetails: `competition/competition/rank/totalRankingScoreDetails`,
batchRelease: `competition/competition/rank/batchRelease`,
manuallyUploadedRankings: `competition/competition/rank/manuallyUploadedRankings`,
toggleTheSortingMode: `competition/competition/rank/toggleTheSortingMode`,
selectTheLastSortStatus: `competition/competition/rank/selectTheLastSortStatus`,
gradeImport: `http://121.37.12.51/template/赛事成绩导入模板.xlsx`, gradeImport: `http://121.37.12.51/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `http://121.37.12.51/template/赛事排名导入模板(团队赛).xlsx`, rankImportTeam: `http://121.37.12.51/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `http://121.37.12.51/template/赛事排名导入模板(个人赛).xlsx`, rankImportPerson: `http://121.37.12.51/template/赛事排名导入模板(个人赛).xlsx`,

@ -583,6 +583,12 @@ export default {
if (!systemsAll.find(n => n.systemId == e.systemId)) e.disabled = true if (!systemsAll.find(n => n.systemId == e.systemId)) e.disabled = true
}) })
this.assessmentData = aList this.assessmentData = aList
const cList = data.competitionConfig
cList.map(e => {
if (!systemsAll.find(n => n.systemId == e.systemId)) e.disabled = true
})
this.matches = cList
}); });
}).catch(err => { }).catch(err => {
}); });
@ -704,7 +710,7 @@ export default {
this.configVisible = true; this.configVisible = true;
this.pageNo = 1; this.pageNo = 1;
this.getConfig(); this.getConfig();
this.checkeds = JSON.parse(JSON.stringify(type ? this.assessmentData : this.practiceData)) this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData))
}, },
// //
getConfig() { getConfig() {

@ -73,6 +73,7 @@ export default {
data() { data() {
return { return {
id: this.$route.query.id || '', id: this.$route.query.id || '',
cache: this.$store.state.competitionCache,
publishStatus: 0, publishStatus: 0,
competitionId: '', competitionId: '',
step: 1, step: 1,
@ -93,9 +94,17 @@ export default {
step4 step4
}, },
mounted() { mounted() {
}, },
methods: { methods: {
//
resumeData() {
if (this.cache) {
this.step = 3
this.editing = true
this.showBtns = false
}
},
// loading // loading
showLoad() { showLoad() {
this.loadIns = Loading.service() this.loadIns = Loading.service()

@ -55,7 +55,7 @@
<div> <div>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input> <el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</div> </div>
<el-button style="margin-left: 5px" type="primary" round>自定义实验项目</el-button> <el-button style="margin-left: 5px" type="primary" round @click="toProject">自定义实验项目</el-button>
</div> </div>
</div> </div>
<!-- 实训项目表格 --> <!-- 实训项目表格 -->
@ -104,10 +104,12 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import { Loading } from 'element-ui'
export default { export default {
props: ['form', 'step1'], props: ['form', 'step1'],
data() { data() {
return { return {
loadIns: null,
curriculumList: [], curriculumList: [],
keyword: '', keyword: '',
projects: [], projects: [],
@ -140,6 +142,7 @@ export default {
methods: { methods: {
// //
getCourse() { getCourse() {
this.loadIns = Loading.service()
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.$post(this.api.curriculumList, { this.$post(this.api.curriculumList, {
isShelves: 1, isShelves: 1,
@ -149,15 +152,18 @@ export default {
}).then(({ page }) => { }).then(({ page }) => {
const list = page.records const list = page.records
this.curriculumList = page.records this.curriculumList = page.records
if (list.length) this.form.cid = list[0].cid if (!this.form.cid && list.length) this.form.cid = list[0].cid
this.courseChange() this.courseChange()
}).catch(err => {}); }).catch(err => {
this.loadIns.close()
});
}, },
// //
courseChange() { courseChange(val) {
const { sysId, sysName } = this.curriculumList.find(e => e.cid == this.form.cid) const { sysId, sysName } = this.curriculumList.find(e => e.cid == this.form.cid)
this.form.sysName = sysName this.form.sysName = sysName
this.sysId = sysId this.sysId = sysId
if (val) this.loadIns = Loading.service()
this.getProject() this.getProject()
}, },
// //
@ -172,7 +178,10 @@ export default {
}).then(({ data }) => { }).then(({ data }) => {
this.projects = data.records this.projects = data.records
this.total = data.total this.total = data.total
}).catch(err => {}); this.loadIns.close()
}).catch(err => {
this.loadIns.close()
});
}, },
initData() { initData() {
this.page = 1; this.page = 1;
@ -182,6 +191,17 @@ export default {
this.page = val; this.page = val;
this.getProject(); this.getProject();
}, },
//
toProject() {
this.$store.commit('setCompetitionCache', {
form: this.form,
curStep: this.$parent.curStep
})
const item = this.curriculumList.find(e => e.cid == this.form.cid) || {} // id
let systemId = item.sysId || '1'
systemId = systemId.split(',')[0] // id
this.$router.push(`/projectList?systemId=${systemId}&show=1&name=${item.sysName.split(',')[0]}`)
},
// //
timeChange(val) { timeChange(val) {
if (val.length) { if (val.length) {
@ -215,6 +235,8 @@ export default {
if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (!form.cid) return util.warningMsg('请选择课程') if (!form.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目') if (!form.projectId) return util.warningMsg('请选择项目')
const cur = this.curriculumList.find(e => e.cid == form.cid)
if (cur) form.systemName = cur.sysName
const { systemId, projectName } = this.projects.find(e => e.projectId == form.projectId) const { systemId, projectName } = this.projects.find(e => e.projectId == form.projectId)
if (systemId) form.systemId = systemId if (systemId) form.systemId = systemId
if (projectName) form.projectName = projectName if (projectName) form.projectName = projectName

@ -246,7 +246,7 @@ export default {
fileList: [], fileList: [],
pickerOptions: { pickerOptions: {
disabledDate: time => { disabledDate: time => {
return time.getTime() < new Date().getTime() - 86400000; return this.$route.query.id ? false : time.getTime() < new Date().getTime() - 86400000
} }
}, },
rangeVisible: false, rangeVisible: false,
@ -414,11 +414,13 @@ export default {
if (rangeName) { if (rangeName) {
const range = [] const range = []
rangeName.map(e => { rangeName.map(e => {
range.push(e.type ? (e.cityName || e.provinceName) : e.schoolName) const name = e.type ? (e.cityName || e.provinceName) : e.schoolName
range.push(name)
}) })
this.rangeName = range.join(',') this.rangeName = range.join(',')
} }
this.form = competition this.form = competition
this.$parent.resumeData()
this.$nextTick(() => { this.$nextTick(() => {
this.updateTime = 0 this.updateTime = 0
}) })

@ -122,7 +122,7 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="resultAnnouncementTime" label="成绩公布时间"> <el-form-item prop="rule" label="成绩公布时间">
阶段比赛结束后 阶段比赛结束后
<el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input> <el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input>
小时公布阶段比赛成绩 小时公布阶段比赛成绩
@ -302,70 +302,87 @@ export default {
const { step1 } = this const { step1 } = this
// //
if (next === 2) { if (next === 2) {
const stages = form.competitionStageList let stages = form.competitionStageList
for (const i in stages) { if (form.rule === 2) { //
const e = stages[i] const e = stages[0]
if (rule !== 2 && !e.stageName) {
invalid = 1
util.errorMsg('请输入阶段名称')
break
}
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
// rule: 012
//
if (!rule) {
//
if (form.resultCalculationMethod == 0 && e.pointWeight === '') {
invalid = 1
util.errorMsg('请输入权重')
break
}
pointWeight += e.pointWeight //
} else if (rule === 1) { //
// ()
if (i != stages.length - 1 && e.peopleLimit === '' && e.percentageLimit === '' && e.score === '') {
invalid = 1
util.errorMsg('请至少填写一条晋级规则')
break
}
if (e.score !== '') e.scoreLimit = e.operator + e.score
}
if (rule !== 2 && competitionType && e.teamNumLimitOpt) {
if (e.teamNumLimit === '') {
invalid = 1
util.errorMsg('请输入团队参数人数限制')
break
} else if (e.teamNumLimit < 0) {
invalid = 1
util.errorMsg('团队参数人数不得小于0')
break
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) {
invalid = 1
util.errorMsg('团队参数人数不得大于团队人数上限')
break
}
}
if (!e.resultsDetails) { if (!e.resultsDetails) {
if (e.resultAnnouncementTime === '') { if (e.resultAnnouncementTime === '') {
invalid = 1 return util.errorMsg('请填写成绩公布时间')
util.errorMsg('请填写成绩公布时间')
break
} }
if (e.resultAnnouncementTime < 0) { if (e.resultAnnouncementTime < 0) {
invalid = 1 return util.errorMsg('成绩公布时间不得小于0')
util.errorMsg('成绩公布时间不得小于0')
break
} }
if (e.resultAnnouncementTime % 1) { if (e.resultAnnouncementTime % 1) {
return util.errorMsg('成绩公布时间须为整数')
}
e.resultAnnouncementTime = +e.resultAnnouncementTime
}
form.competitionStageList = stages.slice(0, 1) //
} else { //
for (const i in stages) {
const e = stages[i]
if (rule !== 2 && !e.stageName) {
invalid = 1 invalid = 1
util.errorMsg('成绩公布时间须为整数') util.errorMsg('请输入阶段名称')
break break
} }
e.resultAnnouncementTime = +e.resultAnnouncementTime const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
// rule: 012
//
if (!rule) {
//
if (form.resultCalculationMethod == 0 && e.pointWeight === '') {
invalid = 1
util.errorMsg('请输入权重')
break
}
pointWeight += e.pointWeight //
} else if (rule === 1) { //
// ()
if (i != stages.length - 1 && e.peopleLimit === '' && e.percentageLimit === '' && e.score === '') {
invalid = 1
util.errorMsg('请至少填写一条晋级规则')
break
}
if (e.score !== '') e.scoreLimit = e.operator + e.score
}
if (rule !== 2 && competitionType && e.teamNumLimitOpt) {
if (e.teamNumLimit === '') {
invalid = 1
util.errorMsg('请输入团队参数人数限制')
break
} else if (e.teamNumLimit < 0) {
invalid = 1
util.errorMsg('团队参数人数不得小于0')
break
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) {
invalid = 1
util.errorMsg('团队参数人数不得大于团队人数上限')
break
}
}
if (!e.resultsDetails) {
if (e.resultAnnouncementTime === '') {
invalid = 1
util.errorMsg('请填写成绩公布时间')
break
}
if (e.resultAnnouncementTime < 0) {
invalid = 1
util.errorMsg('成绩公布时间不得小于0')
break
}
if (e.resultAnnouncementTime % 1) {
invalid = 1
util.errorMsg('成绩公布时间须为整数')
break
}
e.resultAnnouncementTime = +e.resultAnnouncementTime
}
} }
if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
} }
if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
} else { // 稿 } else { // 稿
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) form.competitionStageList = form.competitionStageList.filter(e => e.stageName)
} }

@ -79,6 +79,7 @@ export default {
id: this.$route.query.id, id: this.$route.query.id,
updateTime: 0, updateTime: 0,
step1: this.$parent.$refs.step1.form, step1: this.$parent.$refs.step1.form,
cache: this.$store.state.competitionCache,
nums: ['一', '二', '三'], nums: ['一', '二', '三'],
methods: [ methods: [
{ {
@ -111,7 +112,6 @@ export default {
form: [], form: [],
setVisible: false, setVisible: false,
curStep: 0, curStep: 0,
timeInvalid: false
}; };
}, },
components: { components: {
@ -130,6 +130,15 @@ export default {
this.handleForm() this.handleForm()
}, },
methods: { methods: {
//
resumeData() {
if (this.cache) {
this.curStep = this.cache.curStep
if (this.cache.form) this.form[this.curStep] = this.cache.form
this.setVisible = true
this.$store.commit('setCompetitionCache', null)
}
},
// form // form
handleForm() { handleForm() {
// id // id
@ -148,6 +157,7 @@ export default {
form.stageName = e.stageName form.stageName = e.stageName
this.form.push(form) this.form.push(form)
}) })
this.resumeData()
this.$nextTick(() => { this.$nextTick(() => {
this.updateTime = 0 this.updateTime = 0
}) })
@ -171,11 +181,7 @@ export default {
const startTime = new Date(val[0]) const startTime = new Date(val[0])
const endTime = new Date(val[1]) const endTime = new Date(val[1])
const { playStartTime, playEndTime } = this.step1 const { playStartTime, playEndTime } = this.step1
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) { if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
this.timeInvalid = true
return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
}
this.timeInvalid = false
const { form, curStep } = this const { form, curStep } = this
for (const i in form) { for (const i in form) {
// //
@ -206,13 +212,18 @@ export default {
// //
if (status) { if (status) {
let invalid = 0 let invalid = 0
if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') const { playStartTime, playEndTime } = this.step1
for (const e of form) { for (const e of form) {
if (!e.time.length) { if (!e.time.length) {
invalid = 1 invalid = 1
util.errorMsg('请选择比赛时间') util.errorMsg('请选择比赛时间')
break break
} }
if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) {
invalid = 1
util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
break
}
e.startTime = e.time[0] e.startTime = e.time[0]
e.endTime = e.time[1] e.endTime = e.time[1]
if (e.method !== 2 && !e.cid) { if (e.method !== 2 && !e.cid) {

@ -130,6 +130,7 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from "@/setting"; import Setting from "@/setting";
import { Loading } from 'element-ui'
export default { export default {
name: "match", name: "match",
data() { data() {
@ -250,48 +251,52 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
const load = Loading.service()
const { form } = this const { form } = this
this.$post(this.api.CompetitionPageConditionQueryByNakadai, { this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
competitionScope: form.competitionScope === '' ? null : form.competitionScope, competitionScope: form.competitionScope === '' ? null : form.competitionScope,
endTime: form.endTime || null, endTime: form.endTime || null,
keyWord: this.keyword || null, keyWord: this.keyword || null,
platformSource: form.platformSource === '' ? null : form.platformSource, platformSource: form.platformSource === '' ? null : form.platformSource,
startTime: form.startTime || null, startTime: form.startTime || null,
}).then(({ data }) => { }).then(({ data }) => {
const list = data.records load.close()
// const list = data.records
this.timer = setInterval(() => { //
const now = new Date() this.timer = setInterval(() => {
list.map(e => { const now = new Date()
if (!e.playingStages) { list.map(e => {
this.$set(e, 'playingStages', []) if (!e.playingStages) {
} else { this.$set(e, 'playingStages', [])
e.playingStages = [] } else {
} e.playingStages = []
// }
if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) { //
// if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) {
if (e.competitionStageList) { //
for (const n of e.competitionStageList) { if (e.competitionStageList) {
// for (const n of e.competitionStageList) {
if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) { //
e.playingStages.push(n) if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) {
} e.playingStages.push(n)
} }
} }
} }
}) }
}, 1000) })
this.matchData = list }, 1000)
this.total = data.total this.matchData = list
this.$refs.table.clearSelection() this.total = data.total
if (!this.matchData.length && this.total) { this.$refs.table.clearSelection()
this.page-- if (!this.matchData.length && this.total) {
this.getData() this.page--
} this.getData()
}).catch(res => {}) }
}).catch(res => {
load.close()
})
}, },
getData() { getData() {
this.getList() this.getList()

@ -54,7 +54,7 @@
<tr> <tr>
<th width="130">指导老师</th> <th width="130">指导老师</th>
<td> <td>
<div class="plus"> <div v-if="status < 5" class="plus">
<i class="el-icon-circle-plus-outline icon" @click="addAdvisor"></i> <i class="el-icon-circle-plus-outline icon" @click="addAdvisor"></i>
</div> </div>
<div v-for="(item, i) in info.teamInstructors" :key="i" class="line"> <div v-for="(item, i) in info.teamInstructors" :key="i" class="line">

@ -20,8 +20,9 @@
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button> <el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button>
</div> </div>
<div> <div>
<el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button> <!-- <el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button> -->
<el-button v-if="published && ((!type && sourceType === '0') || (type && sourceType == 1))" type="primary" @click="cancelPublish(0)">取消发布</el-button> <el-button v-if="!published" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-else type="primary" @click="cancelPublish(0)">取消发布</el-button>
</div> </div>
</div> </div>
<el-table :data="list" class="table" ref="table" stripe header-align="center"> <el-table :data="list" class="table" ref="table" stripe header-align="center">
@ -204,33 +205,58 @@ export default {
// //
getData() { getData() {
// //
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => { // this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => {
const ids = this.grades.map(e => e.stageId) // const ids = this.grades.map(e => e.stageId)
ids.pop() // ids.pop()
// >(:(1,0)) // // >(:(1,0))
whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => { // whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
this.sourceType = source // this.sourceType = source
this.type = source == 1 ? 1 : 0 // this.type = source == 1 ? 1 : 0
}).catch(res => {}) // }).catch(res => {})
this.published = whetherToPublish // this.published = whetherToPublish
this.getRank(whetherToPublish) // this.getRank(whetherToPublish)
// }).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 }) => {
// const ids = this.grades.map(e => e.stageId)
// ids.pop()
// // >(:(1,0))
// whetherToPublish ?
// this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
// this.sourceType = source
// this.type = source == 1 ? 1 : 0
// this.getRank(whetherToPublish)
// }).catch(res => {}) :
// this.getRank()
// this.published = whetherToPublish
// }).catch(res => {})
this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
this.sourceType = source
this.type = source == 1 ? 1 : 0
this.getRank()
}).catch(res => {}) }).catch(res => {})
}, },
// //
getRank(whetherToPublish) { getRank() {
// //
if (whetherToPublish) { if (this.type) {
this.$post(this.api.manuallyRankTheUploadList, { this.$post(this.api.manuallyUploadedRankings, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
competitionId: this.id, competitionId: this.id,
isOverallRanking: this.active ? 0 : 1, isOverallRanking: this.active ? 0 : 1,
stageId: this.active || '' stageId: this.active || this.stageId
}).then(({ message }) => { }).then(({ message, publishStatus }) => {
// isRelease 01
this.published = publishStatus
this.sourceType = message.total ? message.records[0].isRelease : 0
this.list = message.records this.list = message.records
this.total = message.total this.total = message.total
}).catch(res => {}) }).catch(res => {})
} else { // } else { //
if (!this.active) { if (!this.active) {
// //
const ids = this.grades.map(e => e.stageId) const ids = this.grades.map(e => e.stageId)
@ -238,13 +264,16 @@ export default {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
competitionId: this.id, competitionId: this.id,
publicationType: this.type,
stageIds: ids.splice(0, ids.length - 1) stageIds: ids.splice(0, ids.length - 1)
}).then(({ page }) => { }).then(({ page, publishStatus }) => {
this.published = publishStatus
this.list = page this.list = page
this.total = total this.total = total
}).catch(res => {}) }).catch(res => {})
} else { // } else { //
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(({ page, total }) => { this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}`).then(({ page, total, publishStatus }) => {
this.published = publishStatus
this.list = page this.list = page
this.total = total this.total = total
}).catch(res => {}) }).catch(res => {})
@ -270,7 +299,14 @@ export default {
}, },
// //
typeChange(val) { typeChange(val) {
this.getRank(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() { initData() {
this.page = 1 this.page = 1
@ -278,6 +314,7 @@ export default {
}, },
// tab // tab
tabChange(i) { tabChange(i) {
this.type = 0
this.active = i this.active = i
this.initData() this.initData()
}, },
@ -370,47 +407,68 @@ export default {
}, },
// //
publishSubmit() { publishSubmit() {
let data = this.uploadData // data if (this.type) { //
if (!this.type) { // this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => {
//
const { list, id } = this
const isOverall = this.active ? 0 : 1
if (list.length) {
const isPerson = this.competitionType == 0
list.map(e => {
e.competitionId = id
e.isOverallRanking = isOverall
// if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull
})
data = list
}
}
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() this.getData()
util.successMsg('发布成功!') util.successMsg('发布成功!')
}).catch(res => {}) }).catch(res => {})
}).catch(res => {}) } else {
let data = [] // data
if (!this.type) { //
//
const { list, id } = this
const isOverall = this.active ? 0 : 1
if (list.length) {
const isPerson = this.competitionType == 0
list.map(e => {
e.competitionId = id
e.isOverallRanking = isOverall
// if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull
})
data = list
}
}
data.forEach(e => {
e.publicationType = this.type
})
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('发布成功!')
}).catch(res => {})
// }).catch(res => {})
}
}, },
// //
publish() { publish() {
// //
if (this.published && this.sourceType != this.type) { // if (this.published && this.sourceType != this.type) {
this.$confirm(this.sourceType == 1 && !this.type ? // this.$confirm(this.sourceType == 1 && !this.type ?
'手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' : // '' :
'默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', { // '', '', {
type: 'success' // type: 'success'
}).then(() => { // }).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('排名已经发布,是否直接覆盖?', '提示', {
type: 'success'
}).then(() => {
this.publishSubmit()
}).catch(() => {}) :
this.publishSubmit() this.publishSubmit()
}).catch(() => {}) }).catch(res => {})
} else { // this.publishSubmit()
this.publishSubmit()
}
}, },
// //
cancelPublish(publish) { cancelPublish(publish) {
@ -423,16 +481,19 @@ export default {
// //
// //
if (publish) { if (publish) {
this.$post(this.api.deleteLastPublication, { // this.type ?
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
stageIds: this.active ? [this.active] : stageIds
}).then(res => {
this.publish() this.publish()
}).catch(res => {}) // this.$post(this.api.deleteLastPublication, {
// competitionId: this.id,
// isOverallRanking: this.active ? 0 : 1,
// stageIds: this.active ? [this.active] : stageIds
// }).then(res => {
// this.publish()
// }).catch(res => {})
} else { } else {
this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => { this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => {
this.sourceType = '' this.sourceType = ''
this.type = 0
this.getData() this.getData()
util.successMsg('取消发布成功!') util.successMsg('取消发布成功!')
}).catch(res => {}) }).catch(res => {})
@ -493,7 +554,8 @@ export default {
}, },
uploadSure() { uploadSure() {
this.importVisible = false this.importVisible = false
this.list = this.uploadData // this.list = this.uploadData
this.getRank()
this.uploadData.length && util.successMsg('请检查数据后,点击发布排名以发布数据!') this.uploadData.length && util.successMsg('请检查数据后,点击发布排名以发布数据!')
} }
} }

@ -41,7 +41,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <el-button type="text" @click="edit(scope.row)">编辑</el-button>
<template v-if="info.releaseType"> <template v-if="info.releaseType">
<el-button type="text" @click="info(scope.row)">参赛信息与成绩</el-button> <el-button type="text" @click="toInfo(scope.row)">参赛信息与成绩</el-button>
<el-switch <el-switch
v-model="scope.row.isDisable" v-model="scope.row.isDisable"
:active-text="scope.row.isDisable ? '关' : '开'" :active-text="scope.row.isDisable ? '关' : '开'"
@ -64,7 +64,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="80px" style='margin-right: 10px;'> <el-form ref="form" :model="form" :rules="rules" label-width="80px" style='margin-right: 10px;'>
<el-form-item prop="schoolId" label="院校"> <el-form-item prop="schoolId" label="院校">
<el-select v-model="form.schoolId" filterable style="width: 100%"> <el-select v-model="form.schoolId" filterable style="width: 100%">
<el-option v-for="(item, i) in clients" :key="i" :label="item.customerName" :value="item.schoolId"></el-option> <el-option v-for="(item, i) in clients" :key="i" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="workNumber" label="学生学号"> <el-form-item prop="workNumber" label="学生学号">
@ -399,14 +399,9 @@ export default {
}, },
// //
getClient() { getClient() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理') this.$get(this.api.querySchoolData).then(({ list }) => {
this.$post(this.api.queryCustomer,{ this.clients = list
page: 1, }).catch(res => {})
size: 1000,
supplierId: (sid && !sid.all) ? sid.supplierId : ''
}).then(res => {
this.clients = res.message.list
}).catch(res => {})
}, },
// //
getTeam() { getTeam() {
@ -431,7 +426,7 @@ export default {
}).catch(res => {}) }).catch(res => {})
}, },
// //
info(row) { toInfo(row) {
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`) this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
}, },
exportAll() { exportAll() {

@ -375,7 +375,8 @@ export default {
}); });
}, },
goBack() { // goBack() { //
this.$router.push(`/configure`) // this.$router.push(`/configure`)
this.$router.back()
} }
} }
}; };

Loading…
Cancel
Save