实验报告、赛事

Branch_d40a2540
yujialong 1 year ago
parent 559a044844
commit 055566f7d9
  1. 1
      src/api/index.js
  2. 201
      src/pages/achievement/show/index.vue
  3. 2
      src/pages/achievement/teach/index.vue
  4. 2
      src/pages/assessment/list/index.vue
  5. 2
      src/pages/expSystem/backstage/model.vue
  6. 122
      src/pages/match/add/set.vue
  7. 108
      src/pages/match/add/step3.vue
  8. 47
      src/pages/match/manage/index.vue
  9. 46
      src/pages/match/manage/matchRank.vue

@ -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`,

@ -1,111 +1,157 @@
<template>
<div class="wrap">
<el-card shadow="hover" class="m-b-20">
<el-page-header @back="$router.back()" content="查看报告"></el-page-header>
<el-card shadow="hover"
class="m-b-20">
<el-page-header @back="$router.back()"
content="查看报告"></el-page-header>
</el-card>
<div class="content">
<div class="text-right">
<el-button type="primary" @click="exportPage">导出报告</el-button>
<el-button type="primary"
@click="exportPage">导出报告</el-button>
</div>
<h6 class="r-title">标准实验报告</h6>
<div class="info">
<h6 class="l-title">
<img src="@/assets/img/info1.png" alt="">
<img src="@/assets/img/info1.png"
alt="">
基本信息
</h6>
<ul :class="['info-list', {edit: editing}]">
<li>
<label>学生姓名</label>
<el-input v-if="editing" v-model="infoData.userName" disabled></el-input>
<el-input v-if="editing"
v-model="infoData.userName"
disabled></el-input>
<span v-else>{{ infoData.userName }}</span>
</li>
<li>
<label>学生学号</label>
<el-input v-if="editing" v-model="infoData.workNumber" disabled></el-input>
<el-input v-if="editing"
v-model="infoData.workNumber"
disabled></el-input>
<span v-else>{{ infoData.workNumber }}</span>
</li>
<li>
<label>实验时间</label>
<el-input v-if="editing" v-model="infoData.submitTime" disabled></el-input>
<el-input v-if="editing"
v-model="infoData.submitTime"
disabled></el-input>
<span v-else>{{ infoData.submitTime }}</span>
</li>
<li>
<label>实验成绩</label>
<el-input v-if="editing" v-model="infoData.score" disabled></el-input>
<div v-else class="score-wrap">
<el-input v-if="editing"
v-model="infoData.score"
disabled></el-input>
<div v-else
class="score-wrap">
<em>{{ infoData.score }}</em>
<img src="@/assets/img/point.png" alt="">
<img src="@/assets/img/point.png"
alt="">
</div>
</li>
<li>
<label>学生班级</label>
<el-input v-if="editing" v-model="infoData.workNumber"></el-input>
<el-input v-if="editing"
v-model="infoData.workNumber"></el-input>
<span v-else>{{ infoData.workNumber }}</span>
</li>
<li>
<label>指导老师</label>
<el-input v-if="editing" v-model="infoData.instructor"></el-input>
<el-input v-if="editing"
v-model="infoData.instructor"></el-input>
<span v-else>{{ infoData.instructor }}</span>
</li>
<li>
<label>实验学时</label>
<el-input v-if="editing" v-model="infoData.period"></el-input>
<el-input v-if="editing"
v-model="infoData.period"></el-input>
<span v-else>{{ infoData.period }}</span>
</li>
</ul>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report2.png" alt="">
<img src="@/assets/img/report2.png"
alt="">
实验项目名称
</h6>
<el-input v-if="editing" v-model="form.projectName" type="textarea"></el-input>
<div v-else class="pre-wrap" v-html="form.projectName"></div>
<el-input v-if="editing"
v-model="form.projectName"
type="textarea"></el-input>
<div v-else
class="pre-wrap"
v-html="form.projectName"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report3.png" alt="">
<img src="@/assets/img/report3.png"
alt="">
实验目的
</h6>
<div :class="['pre-wrap', {edit: editing}]" v-html="form.purpose"></div>
<div :class="['pre-wrap', {edit: editing}]"
v-html="form.purpose"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report4.png" alt="">
<img src="@/assets/img/report4.png"
alt="">
实验数据
</h6>
<el-table :data="expData" class="table" border stripe header-align="center">
<el-table-column type="index" label="序号" align="center" width="60">
<el-table :data="expData"
class="table"
border
stripe
header-align="center">
<el-table-column type="index"
label="序号"
align="center"
width="60">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="judgmentName" label="判分点" width="270" align="center"></el-table-column>
<el-table-column v-if='project' prop="judgmentName" label="考核点" align="center" width="150">
<el-table-column prop="judgmentName"
label="判分点"
width="270"
align="center"></el-table-column>
<el-table-column v-if='project'
prop="judgmentName"
label="考核点"
align="center"
width="150">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span>
<span>{{index+1}}. </span>{{item.name}}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleAnswer" label="参考答案" style='word-wrap: break-word'>
<el-table-column prop="ruleAnswer"
label="参考答案"
style='word-wrap: break-word'>
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span>
<span>{{index+1}}. </span>{{item.ruleAnswer}}
</span>
</div>
</div>
<div v-else v-html="scope.row.referenceAnswer"></div>
<div v-else
v-html="scope.row.referenceAnswer"></div>
</template>
</el-table-column>
<el-table-column prop="userAnswer" label="学生答案">
<el-table-column prop="userAnswer"
label="学生答案">
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span v-if='item.userAnswer'>
<span>{{index+1}}. </span>{{item.userAnswer}}
</span>
@ -114,22 +160,49 @@
</span>
</div>
</div>
<div v-else v-html='scope.row.answer' style='white-space: pre-wrap'></div>
<div v-else
v-html='scope.row.answer'
style='white-space: pre-wrap'></div>
</template>
</el-table-column>
<el-table-column prop="runResult"
label="学生运行结果"
align="center">
<template slot-scope="scope">
<div class="m-b-20"
v-html='scope.row.runResult'
style='white-space: pre-wrap'></div>
<template v-if="scope.row.runThePictureList">
<img v-for="(img, i) in scope.row.runThePictureList" :key="i" width="200" class="result-pic" :src="img" alt="">
<img v-for="(img, i) in scope.row.runThePictureList"
:key="i"
width="200"
class="result-pic"
:src="img"
alt="">
</template>
</template>
</el-table-column>
<el-table-column prop="score" label="得分" width="80" align="center"></el-table-column>
<el-table-column prop="score"
label="得分"
width="80"
align="center"></el-table-column>
</el-table>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report5.png" alt="">
<img src="@/assets/img/report5.png"
alt="">
实验总结与体会
</h6>
<quill v-if="editing" :border="true" v-model="form.summarize" :minHeight="150" :height="150" :index="1" />
<div v-else class="pre-wrap" v-html="form.summarize"></div>
<quill v-if="editing"
:border="true"
v-model="form.summarize"
:minHeight="150"
:height="150"
:index="1" />
<div v-else
class="pre-wrap"
v-html="form.summarize"></div>
</div>
</div>
</div>
@ -139,7 +212,7 @@
<script>
import util from "@/libs/util";
export default {
data() {
data () {
return {
reportId: this.$route.query.reportId,
title: "实验报告",
@ -155,15 +228,15 @@ export default {
editing: false,
loadIns: null,
loading: false,
project:false,
project: false,
userScores: []
};
},
mounted() {
mounted () {
this.getData()
},
methods: {
getData() { //
getData () { //
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => {
this.form = report
this.expData = userScores
@ -187,14 +260,14 @@ export default {
this.$post(this.api.editExperimentalData, {
reportId,
data: JSON.stringify(userScores)
}).then(res => {}).catch(err => {})
}).then(res => { }).catch(err => { })
} else {
this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data))
}
}).catch(res => {})
}).catch(res => { })
},
//
handleList(list) {
handleList (list) {
this.project = list.find(e => e.lcRuleRecords) // lcRuleRecords
if (this.project) {
list.map(e => {
@ -210,12 +283,15 @@ export default {
} else { // pythonuserScores
list.forEach(e => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
if (item) {
if (item.runThePictureList) e.runThePictureList = item.runThePictureList
if (item.runResult) e.runResult = item.runResult
}
})
}
this.expData = list
},
exportPage() {
exportPage () {
const form = Object.assign(this.form, this.infoData)
const list = JSON.parse(JSON.stringify(this.expData))
list.map((e, i) => {
@ -235,8 +311,8 @@ export default {
experimentalData: list
}).then(res => {
console.log(res)
util.downloadFileDirect(`实验报告.docx`,new Blob([res]))
}).catch(res => {})
util.downloadFileDirect(`实验报告.docx`, new Blob([res]))
}).catch(res => { })
},
}
};
@ -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{
/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;
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 {

@ -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();

@ -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);
});

@ -56,7 +56,7 @@
<el-table-column label="状态"
align="center">
<template slot-scope="scope">
{{ scope.row.isOpen ? '禁用' : '启用' }}
{{ scope.row.isOpen || scope.row.ztOpen ? '禁用' : '启用' }}
</template>
</el-table-column>
<el-table-column label="操作"

@ -1,19 +1,20 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<el-card shadow="hover"
class="m-b-20">
<div>
<p class="m-b-20">比赛名称</p>
{{ form.stageName }}
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<el-card shadow="hover"
class="m-b-20">
<div>
<p class="m-b-20">比赛时间</p>
<div class="date-inputs">
起止时间
<div style="display: inline-flex;align-items: center;">
<el-date-picker
v-model="form.time"
<el-date-picker v-model="form.time"
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
@ -22,8 +23,7 @@
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
</el-date-picker>
<el-alert
style="width: auto;padding: 4px 16px;margin-left: 10px;"
<el-alert style="width: auto;padding: 4px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
@ -33,50 +33,73 @@
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<el-card shadow="hover"
class="mgr20 m-b-20">
<div>
<p class="m-b-20">课程</p>
<div class="inline-input">
<el-select v-model="form.cid" @change="courseChange">
<el-option
v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid">
<el-select v-model="form.cid"
@change="courseChange">
<el-option v-for="item in curriculumList"
:key="item.associatedProduct"
:label="item.productName"
:value="item.associatedProduct
">
</el-option>
</el-select>
</div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<el-card shadow="hover"
class="m-b-20">
<div class="flex-between m-b-20">
<span>实训项目</span>
<div style="display: inline-flex;">
<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>
<el-button style="margin-left: 5px" type="primary" round @click="toProject">自定义实验项目</el-button>
<el-button style="margin-left: 5px"
type="primary"
round
@click="toProject">自定义实验项目</el-button>
</div>
</div>
<!-- 实训项目表格 -->
<el-table :data="projects" class="table" stripe header-align="center">
<el-table-column width="60" label="选择" align="center">
<el-table :data="projects"
class="table"
stripe
header-align="center">
<el-table-column width="60"
label="选择"
align="center">
<template slot-scope="scope">
<el-radio v-model="form.projectId" :label="scope.row.projectId">&nbsp;</el-radio>
<el-radio v-model="form.projectId"
:label="scope.row.projectId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="auth" label="项目权限" align="center">
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="auth"
label="项目权限"
align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="founder" label="创建人" align="center">
<el-table-column prop="founder"
label="创建人"
align="center">
<template slot-scope="scope">
{{ scope.row.founder ? '老师创建' : '系统内置' }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center"></el-table-column>
<!-- <el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showProject(scope.row)">查看</el-button>
@ -84,19 +107,18 @@
</el-table-column> -->
</el-table>
<div class="pagination">
<el-pagination
background
<el-pagination background
:page-size="pageSize"
@current-change="handleCurrentChange"
layout="total,prev, pager, next"
:total="total"
></el-pagination>
:total="total"></el-pagination>
</div>
</el-card>
<div style="text-align: center">
<el-button @click="back">返回</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary"
@click="save">保存</el-button>
</div>
</div>
</template>
@ -106,7 +128,7 @@ import util from "@/libs/util";
import { Loading } from 'element-ui'
export default {
props: ['form', 'step1'],
data() {
data () {
return {
loadIns: null,
curriculumList: [],
@ -123,43 +145,49 @@ export default {
watch: {
// ,
form: {
handler(){
handler () {
this.updateTime++
},
deep:true
deep: true
},
keyword: function(val) {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
mounted () {
this.getCourse()
},
methods: {
//
getCourse() {
getCourse () {
this.loadIns = Loading.service()
this.$get(this.api.curriculumList).then(({ data }) => {
const list = data
this.curriculumList = data
if (!this.form.cid && list.length) this.form.cid = list[0].cid
this.$post(this.api.listOfGoods, {
hotTag: 1,
isShelves: 0,
sort: 0,
pageNum: 1,
pageSize: 1000
}).then(({ page }) => {
const list = page.records
this.curriculumList = list
if (!this.form.cid && list.length) this.form.cid = list[0].associatedProduct
this.courseChange()
}).catch(err => {
this.loadIns.close()
});
},
//
courseChange(val) {
courseChange (val) {
const { systemId } = this.curriculumList.find(e => e.cid == this.form.cid)
this.sysId = systemId
if (val) this.loadIns = Loading.service()
this.getProject()
},
//
getProject() {
getProject () {
this.$post(this.api.getProjectAssessmentByCompetition, {
pageNum: this.page,
pageSize: this.pageSize,
@ -175,26 +203,27 @@ export default {
this.loadIns.close()
});
},
initData() {
initData () {
this.page = 1;
this.getProject();
},
handleCurrentChange(val) {
handleCurrentChange (val) {
this.page = val;
this.getProject();
},
//
toProject() {
toProject () {
const { form, curStep } = this.$parent
form[curStep] = this.form
this.$store.commit('match/setCache', {
form,
curStep
})
this.$parent.pass = 1
this.$router.push(`/project/list?show=1`)
},
//
timeChange(val) {
timeChange (val) {
if (val.length) {
const startTime = new Date(val[0])
const endTime = new Date(val[1])
@ -219,7 +248,7 @@ export default {
}
},
//
save() {
save () {
const { form } = this
if (!form.time.length) return util.warningMsg('请选择比赛时间')
const { playStartTime, playEndTime } = this.step1
@ -235,7 +264,7 @@ export default {
this.$emit('hideSet', this.form)
},
//
back() {
back () {
this.$emit('hideSet')
}
}
@ -243,5 +272,4 @@ export default {
</script>
<style scoped lang="scss">
</style>

@ -1,19 +1,29 @@
<template>
<div>
<div v-show="!setVisible" class="page">
<div v-show="!setVisible"
class="page">
<div class="page-content">
<div class="p-title">比赛内容设置</div>
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!editing && id">
<div v-for="(item, i) in form" :key="i" class="step">
<el-form label-width="170px"
label-suffix=":"
size="small"
:disabled="!editing && id">
<div v-for="(item, i) in form"
:key="i"
class="step">
<div class="title">
<span>{{ item.stageName }}{{ nums[i] }}阶段 | {{ methods.find(e => e.id === item.method).name }} </span>
<el-button v-if="item.method !== 2" type="primary" @click="toSet(i)">设置</el-button>
<el-button v-if="item.method !== 2"
type="primary"
@click="toSet(i)">设置</el-button>
</div>
<el-form-item class="req" prop="time" label="比赛时间">
<el-form-item class="req"
prop="time"
label="比赛时间">
<span v-if="item.method !== 2 && item.startTime">{{ item.startTime + ' ' + item.endTime }}</span>
<div style="display: flex;align-items: center;" v-if="item.method === 2">
<el-date-picker
v-model="item.time"
<div style="display: flex;align-items: center;"
v-if="item.method === 2">
<el-date-picker v-model="item.time"
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
@ -22,8 +32,7 @@
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
</el-date-picker>
<el-alert
style="width: auto;padding: 0px 16px;margin-left: 10px;"
<el-alert style="width: auto;padding: 0px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
@ -32,31 +41,53 @@
</div>
</el-form-item>
<template v-if="item.method === 2">
<el-form-item class="req" label="比赛地点">
<el-input v-model="item.offlineAddress" style="width: 80%"></el-input>
<el-form-item class="req"
label="比赛地点">
<el-input v-model="item.offlineAddress"
style="width: 80%"></el-input>
</el-form-item>
<el-form-item class="req" label="比赛内容">
<el-input v-model="item.contentDescription" type="textarea" style="width: 80%"></el-input>
<el-form-item class="req"
label="比赛内容">
<el-input v-model="item.contentDescription"
type="textarea"
style="width: 80%"></el-input>
</el-form-item>
<el-form-item class="req" label="评分规则">
<el-input v-model="item.scoreRule" type="textarea" style="width: 80%"></el-input>
<el-form-item class="req"
label="评分规则">
<el-input v-model="item.scoreRule"
type="textarea"
style="width: 80%"></el-input>
</el-form-item>
</template>
<template v-else>
<el-form-item class="req" prop="cid" label="课程系统">
<el-form-item class="req"
prop="cid"
label="课程系统">
{{ item.systemName }}
</el-form-item>
<el-form-item class="req" prop="assessmentId" label="已选择考核">
<el-form-item class="req"
prop="assessmentId"
label="已选择考核">
{{ item.projectName }}
</el-form-item>
<el-form-item class="req" prop="resultAnnouncementTime" label="比赛地点">
<el-form-item class="req"
prop="resultAnnouncementTime"
label="比赛地点">
<div class="line">
<el-checkbox v-model="item.onlineButton">线上</el-checkbox>
<el-input v-model="item.onlineAddress" clearable placeholder="请输入比赛网址" :disabled="!item.onlineButton" style="width: 400px;margin-left: 10px"></el-input>
<el-input v-model="item.onlineAddress"
clearable
placeholder="请输入比赛网址"
:disabled="!item.onlineButton"
style="width: 400px;margin-left: 10px"></el-input>
</div>
<div class="line">
<el-checkbox v-model="item.offlineButton">线下</el-checkbox>
<el-input v-model="item.offlineAddress" clearable placeholder="请输入地址" :disabled="!item.offlineButton" style="width: 400px;margin-left: 10px"></el-input>
<el-input v-model="item.offlineAddress"
clearable
placeholder="请输入地址"
:disabled="!item.offlineButton"
style="width: 400px;margin-left: 10px"></el-input>
</div>
</el-form-item>
</template>
@ -65,7 +96,10 @@
</div>
</div>
<set v-if="setVisible" :form.sync="form[curStep]" :step1.sync="step1" @hideSet="hideSet" />
<set v-if="setVisible"
:form.sync="form[curStep]"
:step1.sync="step1"
@hideSet="hideSet" />
</div>
</template>
@ -74,7 +108,7 @@ import util from "@/libs/util";
import set from './set'
export default {
props: ['setupId', 'competitionId', 'editing'],
data() {
data () {
return {
id: this.$route.query.id,
updateTime: 0,
@ -97,6 +131,7 @@ export default {
],
originForm: {
cid: '',
mallId: '',
contentDescription: '',
endTime: '',
scoreRule: '',
@ -112,6 +147,7 @@ export default {
form: [],
setVisible: false,
curStep: 0,
pass: 0
};
},
components: {
@ -120,18 +156,18 @@ export default {
watch: {
// ,
form: {
handler(){
handler () {
this.updateTime++
},
deep:true
deep: true
},
},
mounted() {
mounted () {
this.handleForm()
},
methods: {
//
resumeData() {
resumeData () {
if (this.cache) {
this.curStep = this.cache.curStep
if (this.cache.form) this.form = this.cache.form
@ -140,7 +176,7 @@ export default {
}
},
// form
handleForm() {
handleForm () {
// id
this.$post(`${this.api.queryCompetitionStageBySetupId}?setupId=${this.setupId}`).then(res => {
res.competitionStages.map(e => {
@ -161,22 +197,22 @@ export default {
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(res => {})
}).catch(res => { })
},
//
toSet(i) {
toSet (i) {
this.curStep = i
this.$parent.showBtns = false
this.setVisible = true
},
//
hideSet(form) {
hideSet (form) {
if (form) this.form[this.curStep] = form
this.setVisible = false
this.$parent.showBtns = true
},
//
timeChange(val) {
timeChange (val) {
if (val.length) {
const startTime = new Date(val[0])
const endTime = new Date(val[1])
@ -197,11 +233,11 @@ export default {
}
},
//
publish() {
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => {}).catch(err => {})
publish () {
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => { }).catch(err => { })
},
//
save(status, next = 0,releaseType,cb) {
save (status, next = 0, releaseType, cb) {
const { form } = this
if (!form.length) {
this.$parent.hideLoad()
@ -280,7 +316,7 @@ export default {
//
status && this.publish(status)
util.successMsg((status ? '发布' : '保存') + '成功')
this.$emit('next', next,cb)
this.$emit('next', next, cb)
}).catch(err => {
this.$parent.hideLoad()
})

@ -1,16 +1,24 @@
<template>
<!-- 赛事管理 -->
<div>
<el-card shadow="hover" class="m-b-20">
<el-card shadow="hover"
class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" :content="name + '/管理'"></el-page-header>
<el-page-header @back="back"
:content="name + '/管理'"></el-page-header>
</div>
</el-card>
<div class="page" style="margin-bottom: 24px">
<div class="page"
style="margin-bottom: 24px">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
<a class="item"
v-for="(item,index) in tabs"
:key="index"
:class="{active: index == active}"
@click="tabChange(index)">{{ item }}</a>
</div>
<MatchDetail v-if="active == 'tab1'" ref="detail" />
<MatchDetail v-if="active == 'tab1'"
ref="detail" />
<MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" />
<notice v-else-if="active == 'tab4'" />
@ -30,7 +38,7 @@ import MatchSignup from "./matchSignup";
import { mapState } from "vuex";
export default {
name: "matchManage",
data() {
data () {
return {
name: this.$route.query.name,
active: this.$route.query.tab || "tab1",
@ -41,6 +49,7 @@ export default {
tab4: "公告通知",
tab5: "报名人员"
},
pass: 0
};
},
components: {
@ -58,18 +67,18 @@ export default {
'btns'
])
},
mounted() {
mounted () {
Setting.dynamicRoute && this.initTabs()
},
beforeRouteLeave(to, from, next) {
beforeRouteLeave (to, from, next) {
const { detail } = this.$refs
if (detail) {
const step = detail.$refs['step' + detail.step]
if (detail.step < 4 && step && step.updateTime) {
if (detail.step < 4 && step && step.updateTime && !step.pass && !this.pass) {
this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示.......', {
type: 'warning'
}).then(() => {
detail.save(1,to.path,next)
detail.save(1, to.path, next)
}).catch(() => {
next()
})
@ -81,7 +90,7 @@ export default {
}
},
methods: {
initTabs() {
initTabs () {
const { btns } = this
console.log("🚀 ~ file: index.vue:67 ~ initTabs ~ btns", btns)
const tab1 = btns.includes('/match/list:管理:大赛详情')
@ -100,14 +109,14 @@ export default {
this.active = keys.includes(type) ? type : keys[0]
},
//
hideArch() {
hideArch () {
this.$delete(this.tabs, 'tab2')
},
back() {
back () {
this.handleSave(0) && this.backPage()
},
// confirm
handleSave(i) {
handleSave (i) {
//
if (this.active === 'tab1') {
const { detail } = this.$refs
@ -134,21 +143,22 @@ export default {
}
},
//
backPage(){
backPage () {
console.log(444, this.$store.state)
this.pass = 1
this.$router.push(`/match?page=${this.$store.state.match.page}`)
},
// tab
tabSwitch(i) {
tabSwitch (i) {
this.active = i
this.$router.push(`/match/manage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`)
},
// tab
backOrTab(i) {
backOrTab (i) {
i ? this.tabSwitch(i) : this.backPage()
},
// tab
tabChange(i) {
tabChange (i) {
this.handleSave(i) && this.tabSwitch(i)
}
}
@ -156,5 +166,4 @@ export default {
</script>
<style scoped>
</style>

@ -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 = ''

Loading…
Cancel
Save