完成赛事接入理论

dev_202412
yujialong 2 months ago
parent a352c30a98
commit fd1c5ef8be
  1. 1
      src/pages/lesson/list/index.vue
  2. 137
      src/pages/match/add/set.vue
  3. 21
      src/pages/match/add/step3.vue

@ -173,6 +173,7 @@ export default {
methods: { methods: {
// //
getData () { getData () {
this.loading = true
this.$post(this.api.curriculumList, { this.$post(this.api.curriculumList, {
...this.form, ...this.form,
pageNum: this.page, pageNum: this.page,

@ -29,28 +29,30 @@
<!-- 理论系统选择试卷库非理论则选择系统 --> <!-- 理论系统选择试卷库非理论则选择系统 -->
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<el-radio-group class="m-b-20" v-model="courseSystem"> <el-radio-group class="m-b-20" v-model="courseSystem" @change="courseSystemChange">
<el-radio :label="0">从课程中选择</el-radio> <el-radio :label="0">从课程中选择</el-radio>
<el-radio :label="1">从系统中选择</el-radio> <el-radio :label="1">从系统中选择</el-radio>
</el-radio-group> </el-radio-group>
<div class="inline-input"> <div class="inline-input">
<!-- 理论 && 选择课程 --> <!-- 选择系统 -->
<el-select v-if="isTheory && !courseSystem" v-model="libraryId" placeholder="请选择试卷库" @change="getProject"> <el-select v-if="courseSystem" v-model="systemId" placeholder="请选择系统" @change="getProject">
<el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId"> <el-option v-for="(item, i) in services" :key="i" :label="item.systemName" :value="item.systemId">
</el-option> </el-option>
</el-select> </el-select>
<!-- 实训 && 选择课程 --> <template v-else>
<el-cascader v-else-if="!isTheory && !courseSystem" ref="cur" v-model="mallIds" :options="curs" <!-- 理论 && 选择课程 -->
:props="{ checkStrictly: true, value: 'id' }" popper-class="course-cas" @expand-change="curChange" <el-select v-if="isTheory && !courseSystem" v-model="libraryId" placeholder="请选择试卷库" @change="getProject">
@change="curChange"></el-cascader> <el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId">
</el-option>
</el-select>
<!-- 实训 && 选择系统 --> <!-- 实训 && 选择课程 -->
<el-select v-else-if="!isTheory && courseSystem" v-model="systemId" placeholder="请选择系统" @change="getProject"> <el-cascader v-else-if="!isTheory && !courseSystem" ref="cur" v-model="mallIds" :options="curs"
<el-option v-for="(item, i) in services" :key="i" :label="item.systemName" :value="item.systemId"> :props="{ checkStrictly: true, value: 'id' }" popper-class="course-cas" @expand-change="curChange"
</el-option> @change="curChange"></el-cascader>
</el-select> </template>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -67,7 +69,7 @@
</div> </div>
<p v-if="form.paperName" style="margin-bottom: 20px"> <p v-if="form.paperName" style="margin-bottom: 20px">
已选试卷{{ form.paperName }} 已选试卷{{ form.paperName }}
<el-button type="primary" size="mini" @click="previewPaper(form)">预览</el-button> <!-- <el-button type="primary" size="mini" @click="previewPaper(form)">预览</el-button> -->
</p> </p>
<el-table :data="projects" class="table" header-align="center"> <el-table :data="projects" class="table" header-align="center">
<el-table-column width="60" label="选择" align="center"> <el-table-column width="60" label="选择" align="center">
@ -96,7 +98,7 @@
<el-table-column prop="createUser" label="最近编辑人" align="center" width="110"></el-table-column> <el-table-column prop="createUser" label="最近编辑人" align="center" width="110"></el-table-column>
<el-table-column label="操作" align="center" width="80"> <el-table-column label="操作" align="center" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="previewPaper(scope.row)">预览</el-button> <!-- <el-button type="text" @click="previewPaper(scope.row)">预览</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -202,12 +204,11 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData()
}, 500); }, 500)
} }
}, },
mounted () { mounted () {
// this.getCourse()
this.getSystem() this.getSystem()
// this.isTheory ? this.getLibrary() : this.getCourse() // this.isTheory ? this.getLibrary() : this.getCourse()
}, },
@ -237,11 +238,23 @@ export default {
}, },
// //
async getSystem () { async getSystem () {
const { data } = await this.$get(this.api.getSystemListOfMall) const { data } = await this.$get(this.api.getSystemListOfMall, {
type: this.isTheory ? 3 : 1
})
this.services = data this.services = data
this.systemId = data[0].systemId if (data.length) {
this.loadIns = Loading.service() this.systemId = this.form.systemId || data[0].systemId
this.getProject() this.getProject()
this.loadIns = Loading.service()
}
},
//
courseSystemChange (val) {
if (val) {
this.getSystem()
} else {
this.isTheory ? this.getLibrary() : this.getCourse()
}
}, },
// //
curChange (val) { curChange (val) {
@ -280,27 +293,32 @@ export default {
// //
async getProject () { async getProject () {
try { try {
// //
if (this.isTheory) { if (this.courseSystem) {
const res = await this.$post(this.api.examPaperList, { const { data } = await this.$get(this.api.getProjectListOfSystem, {
pageNum: this.page, systemId: this.systemId
pageSize: this.pageSize,
type: 1,
keyWord: this.keyword,
libraryId: this.libraryId,
isDisable: 0,
status: 1
}) })
this.projects = res.pageList.records if (this.isTheory) {
this.total = res.pageList.total data.forEach(e => {
} else { // e.name = e.projectName
//
if (this.courseSystem) {
const res = await this.$get(this.api.getProjectListOfSystem, {
systemId: this.systemId
}) })
this.projects = res.data }
} else { this.projects = data
} else {
//
if (this.isTheory) {
const res = await this.$post(this.api.examPaperList, {
pageNum: this.page,
pageSize: this.pageSize,
type: 1,
keyWord: this.keyword,
libraryId: this.libraryId,
isDisable: 0,
status: 1
})
this.projects = res.pageList.records
this.total = res.pageList.total
} else { //
const { data } = await this.$post(this.api.getProjectAssessmentByCompetition, { const { data } = await this.$post(this.api.getProjectAssessmentByCompetition, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -362,34 +380,61 @@ export default {
} }
} }
}, },
//
previewPaper (row) {
this.$parent.previewPaper(row)
},
//
paperChange (id) {
const item = this.projects.find(e => e.paperId === id)
if (item) this.form.paperName = item.name
},
// //
save () { save () {
const { form } = this const { form, courseSystem } = this
if (!form.time.length) return Util.warningMsg('请选择比赛时间') if (!form.time.length) return Util.warningMsg('请选择比赛时间')
const { playStartTime, playEndTime } = this.step1 const { playStartTime, playEndTime } = this.step1
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 (this.isTheory) { if (this.isTheory) {
if (!this.libraryId) return Util.warningMsg('请选择试卷库') // if (!this.libraryId) return Util.warningMsg('')
if (!form.paperId) return Util.warningMsg('请选择试卷') if (!form.paperId) return Util.warningMsg('请选择试卷')
form.libraryId = this.libraryId form.libraryId = courseSystem ? '' : this.libraryId
form.systemId = courseSystem ? this.systemId : ''
const curPaper = this.projects.find(e => e.paperId === form.paperId) const curPaper = this.projects.find(e => e.paperId === form.paperId)
if (curPaper) form.paperName = curPaper.name if (curPaper) form.paperName = curPaper.name
} else { } else {
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 { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId) const { systemId, systemName, 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
if (systemName) form.systemName = systemName if (systemName) form.systemName = systemName
} }
console.log(11, form) if (courseSystem) {
form.mallId = ''
form.cid = ''
}
form.startTime = form.time[0] form.startTime = form.time[0]
form.endTime = form.time[1] form.endTime = form.time[1]
this.handlePaper()
this.$emit('hideSet', this.form) this.$emit('hideSet', this.form)
}, },
//
async handlePaper () {
const { form } = this
// id
if (this.isTheory && form.paperName !== form.originPaperName) {
const res = await this.$post(this.api.copyExamPaper, {
associatedID: form.stageId,
paperId: form.paperId,
typeId: 1
})
if (res.examPaper) form.paperId = res.examPaper.paperId
}
},
// //
back () { back () {
this.$emit('update:form', this.$parent.curOriginForm) this.$emit('update:form', this.$parent.curOriginForm)

@ -72,8 +72,8 @@
<div class="flex"> <div class="flex">
{{ item.paperName }}&emsp; {{ item.paperName }}&emsp;
<el-form> <el-form>
<el-button v-if="item.paperName" type="primary" size="mini" :disabled="false" <!-- <el-button v-if="item.paperName" type="primary" size="mini" :disabled="false"
@click="previewPaper(item)">预览</el-button> @click="previewPaper(item)">预览</el-button> -->
</el-form> </el-form>
</div> </div>
</el-form-item> </el-form-item>
@ -99,7 +99,7 @@
<el-dialog title="提示" :visible.sync="tipsVisible" width="500px" :close-on-click-modal="false" <el-dialog title="提示" :visible.sync="tipsVisible" width="500px" :close-on-click-modal="false"
custom-class="tips-dia"> custom-class="tips-dia">
<p style="font-size: 17px;text-align: center;color: #9076ff;">编辑发布成功</p> <p style="font-size: 17px;text-align: center;color: #062c87;">编辑发布成功</p>
<p style="margin: 5px 0px 10px;line-height: 1.6"> <p style="margin: 5px 0px 10px;line-height: 1.6">
温馨提示报名结束后更改报名时间或赛程规则不影响已分配的阶段参赛人员且后续添加的人员不会自动分配如需重新自动分配所有团队请到报名列表执行全员重新分配操作 温馨提示报名结束后更改报名时间或赛程规则不影响已分配的阶段参赛人员且后续添加的人员不会自动分配如需重新自动分配所有团队请到报名列表执行全员重新分配操作
</p> </p>
@ -152,11 +152,13 @@ export default {
stageId: '', stageId: '',
startTime: '', startTime: '',
systemId: '', systemId: '',
paperId: '',
paperName: '',
offlineAddress: '', offlineAddress: '',
offlineButton: 0, offlineButton: 0,
onlineAddress: '', onlineAddress: '',
onlineButton: 0, onlineButton: 0,
time: [] time: [],
}, },
form: [], form: [],
setVisible: false, setVisible: false,
@ -237,6 +239,7 @@ export default {
form.method = e.method form.method = e.method
form.stageId = e.stageId form.stageId = e.stageId
form.stageName = e.stageName form.stageName = e.stageName
if (form.paperName) form.originPaperName = form.paperName //
this.form.push(form) this.form.push(form)
}) })
this.resumeData() this.resumeData()
@ -419,11 +422,17 @@ export default {
} }
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 === 0 && !e.projectId) {
invalid = 1 invalid = 1
Util.errorMsg('请选择课程') Util.errorMsg('请选择项目')
break break
} }
if (e.method === 1 && !e.paperId) {
invalid = 1
Util.errorMsg('请选择试卷')
break
}
if (e.method === 2) { // 线 if (e.method === 2) { // 线
if (!e.offlineAddress) { if (!e.offlineAddress) {
invalid = 1 invalid = 1

Loading…
Cancel
Save