yujialong 1 year ago
parent c1c21d2d48
commit 3bb334508c
  1. 13
      src/pages/expSystem/list/index.vue
  2. 213
      src/pages/match/add/step2.vue
  3. 208
      src/pages/product/list/index.vue
  4. 2
      src/pages/station/preview/index.vue

@ -23,6 +23,11 @@
clearable></el-input> clearable></el-input>
</li> </li>
</ul> </ul>
<div>
<el-button v-if="isDev"
type="primary"
@click="toSand">进入沙盘系统</el-button>
</div>
</div> </div>
<el-table :data="systemData" <el-table :data="systemData"
@ -76,9 +81,13 @@
<script> <script>
import Setting from "@/setting"; import Setting from "@/setting";
import util from "@/libs/util";
import Cookie from 'js-cookie'
export default { export default {
data () { data () {
return { return {
isDev: Setting.isDev,
token: util.local.get(Setting.tokenKey),
systemType: "", systemType: "",
systemSearch: "", systemSearch: "",
searchTimer: null, searchTimer: null,
@ -151,6 +160,10 @@ export default {
toBackstage (row) { toBackstage (row) {
this.$router.push(`backstage?systemId=${row.systemId}&show=1&name=${row.systemName}`) this.$router.push(`backstage?systemId=${row.systemId}&show=1&name=${row.systemName}`)
}, },
toSand () {
Cookie.set('sand-token', this.token)
window.open(`http://192.168.31.125:9520/#/product/index`)
}
} }
}; };
</script> </script>

@ -3,103 +3,163 @@
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<div class="p-title">赛程与规则设置</div> <div class="p-title">赛程与规则设置</div>
<el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small" :disabled="!editing && id"> <el-form :model="form"
:rules="validRules"
label-width="170px"
label-suffix=":"
size="small"
:disabled="!editing && id">
<el-form-item label="竞赛类型"> <el-form-item label="竞赛类型">
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">如需修改请返回上一步</span> {{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">如需修改请返回上一步</span>
</el-form-item> </el-form-item>
<el-form-item prop="rule" label="赛制"> <el-form-item prop="rule"
<el-radio v-for="(rule, i) in rules" :key="i" v-model="form.rule" :label="rule.id">{{ rule.name }}</el-radio> label="赛制">
<el-radio v-for="(rule, i) in rules"
:key="i"
v-model="form.rule"
:label="rule.id">{{ rule.name }}</el-radio>
<p class="tips">积分赛包含多个竞赛阶段每个阶段的成绩都包含在最终总成绩里最后一轮结束后总成绩排名靠前的参赛者得到获奖资格</p> <p class="tips">积分赛包含多个竞赛阶段每个阶段的成绩都包含在最终总成绩里最后一轮结束后总成绩排名靠前的参赛者得到获奖资格</p>
<p class="tips">淘汰赛包含多个竞赛阶段每个阶段结束后之后只有部分参赛者能晋级下一阶段晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格</p> <p class="tips">淘汰赛包含多个竞赛阶段每个阶段结束后之后只有部分参赛者能晋级下一阶段晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格</p>
<p class="tips">单项赛仅包含一个竞赛阶段单项的成绩排名即为最终排名排名靠前的参赛者得到获奖资格</p> <p class="tips">单项赛仅包含一个竞赛阶段单项的成绩排名即为最终排名排名靠前的参赛者得到获奖资格</p>
<p class="tips">系统默认排名规则优先按分数排名分数高则排名靠前分数相同则按用时排名用时短则排名靠前</p> <p class="tips">系统默认排名规则优先按分数排名分数高则排名靠前分数相同则按用时排名用时短则排名靠前</p>
</el-form-item> </el-form-item>
<template v-if="form.rule !== 2"> <template v-if="form.rule !== 2">
<el-form-item prop="stageNum" label="阶段数量"> <el-form-item prop="stageNum"
label="阶段数量">
<div class="input-center"> <div class="input-center">
<el-select v-model="form.stageNum" @change="stageChange"> <el-select v-model="form.stageNum"
<el-option v-for="i in 10" :key="i" :label="i" :value="i"></el-option> @change="stageChange">
<el-option v-for="i in 10"
:key="i"
:label="i"
:value="i"></el-option>
</el-select> </el-select>
</div> </div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="tips"> <div v-if="step1.completeCompetitionSetup.competitionType"
class="tips">
(团队赛是否限制队内每个成员只能参加一个阶段赛项 (团队赛是否限制队内每个成员只能参加一个阶段赛项
<el-radio v-model="form.teamLimit" :label="1"></el-radio> <el-radio v-model="form.teamLimit"
<el-radio v-model="form.teamLimit" :label="0"></el-radio> :label="1"></el-radio>
<el-radio v-model="form.teamLimit"
:label="0"></el-radio>
) )
</div> </div>
</el-form-item> </el-form-item>
<el-form-item v-if="!form.rule" prop="resultCalculationMethod" label="总成绩计算方式"> <el-form-item v-if="!form.rule"
<el-radio v-model="form.resultCalculationMethod" :label="0">各阶段成绩加权求和</el-radio> prop="resultCalculationMethod"
<el-radio v-model="form.resultCalculationMethod" :label="1">各阶段成绩直接求和</el-radio> label="总成绩计算方式">
<el-radio v-model="form.resultCalculationMethod" :label="2">各阶段成绩取平均值</el-radio> <el-radio v-model="form.resultCalculationMethod"
:label="0">各阶段成绩加权求和</el-radio>
<el-radio v-model="form.resultCalculationMethod"
:label="1">各阶段成绩直接求和</el-radio>
<el-radio v-model="form.resultCalculationMethod"
:label="2">各阶段成绩取平均值</el-radio>
<p class="tips">若选择加权求和则需要设置每个阶段成绩所占权重且权重总和须为100%</p> <p class="tips">若选择加权求和则需要设置每个阶段成绩所占权重且权重总和须为100%</p>
</el-form-item> </el-form-item>
<el-form-item prop="stageNum" label="阶段设置"> <el-form-item prop="stageNum"
<div v-for="(item, i) in form.competitionStageList" :key="i" class="step-set"> label="阶段设置">
<div v-for="(item, i) in form.competitionStageList"
:key="i"
class="step-set">
<div class="line"> <div class="line">
{{ serials[i] }}阶段 <el-input v-model="item.stageName" clearable placeholder="请输入阶段名称,如“初赛”" style="width: 200px"></el-input> {{ serials[i] }}阶段 <el-input v-model="item.stageName"
clearable
placeholder="请输入阶段名称,如“初赛”"
style="width: 200px"></el-input>
</div> </div>
<div class="line"> <div class="line">
<span class="req">*</span> <span class="req">*</span>
比赛方式 比赛方式
<el-radio v-for="(method, i) in methods" :key="i" v-model="item.method" :label="method.id">{{ method.name }}</el-radio> <el-radio v-for="(method, i) in methods"
:key="i"
v-model="item.method"
:label="method.id">{{ method.name }}</el-radio>
</div> </div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> <div v-if="step1.completeCompetitionSetup.competitionType"
class="line">
<span class="req">*</span> <span class="req">*</span>
团队参赛人数限制 团队参赛人数限制
<el-radio v-model="item.teamNumLimitOpt" :label="0">不限制</el-radio> <el-radio v-model="item.teamNumLimitOpt"
<el-radio v-model="item.teamNumLimitOpt" :label="1">自定义</el-radio> :label="0">不限制</el-radio>
<el-input v-model.number="item.teamNumLimit" type="number" style="width: 150px;" :disabled="item.teamNumLimitOpt === 0"></el-input> <el-radio v-model="item.teamNumLimitOpt"
:label="1">自定义</el-radio>
<el-input v-model.number="item.teamNumLimit"
type="number"
style="width: 150px;"
:disabled="item.teamNumLimitOpt === 0"></el-input>
<span class="tips">可限制本阶段单个团队的出战人数</span> <span class="tips">可限制本阶段单个团队的出战人数</span>
</div> </div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> <div v-if="step1.completeCompetitionSetup.competitionType"
class="line">
<span class="req">*</span> <span class="req">*</span>
团队成绩计算方式 团队成绩计算方式
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="item.teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio> <el-radio v-for="(j, i) in teamCalculationMethods"
:key="i"
v-model="item.teamCalculationMethod"
:label="j.id">{{ j.name }}</el-radio>
<span class="tips">可设置本阶段的团队取分规则</span> <span class="tips">可设置本阶段的团队取分规则</span>
</div> </div>
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" class="line" style="display: flex;"> <div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1"
class="line"
style="display: flex;">
<p> <p>
<span class="req">*</span>晋级规则 <span class="req">*</span>晋级规则
</p> </p>
<div> <div>
<div class="line"> <div class="line">
本阶段成绩排名前 本阶段成绩排名前
<el-input v-model.number="item.peopleLimit" type="number" style="width: 100px"></el-input> <el-input v-model.number="item.peopleLimit"
type="number"
style="width: 100px"></el-input>
可晋级下一阶段比赛 可晋级下一阶段比赛
</div> </div>
<div class="line"> <div class="line">
本阶段成绩排名前 本阶段成绩排名前
<el-input v-model.number="item.percentageLimit" type="number" style="width: 100px"></el-input> <el-input v-model.number="item.percentageLimit"
type="number"
style="width: 100px"></el-input>
%可晋级下一阶段比赛 %可晋级下一阶段比赛
</div> </div>
<div> <div>
本阶段成绩 本阶段成绩
<el-select v-model="item.operator" style="width: 80px;margin-right: 10px"> <el-select v-model="item.operator"
<el-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option> style="width: 80px;margin-right: 10px">
<el-option v-for="i in operators"
:key="i"
:label="i"
:value="i"></el-option>
</el-select> </el-select>
<el-input v-model="item.score" type="number" style="width: 100px"></el-input> <el-input v-model="item.score"
type="number"
style="width: 100px"></el-input>
可晋级下一阶段比赛 可晋级下一阶段比赛
</div> </div>
</div> </div>
</div> </div>
<div v-if="!form.rule" class="line"> <div v-if="!form.rule"
class="line">
<span class="req">*</span> <span class="req">*</span>
占总成绩权重 占总成绩权重
<el-input v-model.number="item.pointWeight" type="number" :disabled="form.resultCalculationMethod != 0" style="width: 150px;"></el-input> % <el-input v-model.number="item.pointWeight"
type="number"
:disabled="form.resultCalculationMethod != 0"
style="width: 150px;"></el-input> %
</div> </div>
<div class="line"> <div class="line">
<span class="req">*</span>
成绩公布时间 成绩公布时间
阶段比赛结束后 阶段比赛结束后
<el-input v-model.number="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input> <el-input v-model.number="item.resultAnnouncementTime"
type="number"
style="width: 120px"></el-input>
小时公布阶段比赛成绩 小时公布阶段比赛成绩
</div> </div>
<div class="line"> <div v-if="item.resultAnnouncementTime != 0"
<span class="req">*</span> class="line">
是否公布成绩详情 是否公布成绩详情
<el-radio v-model="item.resultsDetails" :label="0"></el-radio> <el-radio v-model="item.resultsDetails"
<el-radio v-model="item.resultsDetails" :label="1"></el-radio> :label="0"></el-radio>
<el-radio v-model="item.resultsDetails"
:label="1"></el-radio>
<p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p> <p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p>
<p class="tips">若选择则不公布成绩详情参赛者只能知晓自己的分数及排名不能查看得分详情</p> <p class="tips">若选择则不公布成绩详情参赛者只能知晓自己的分数及排名不能查看得分详情</p>
</div> </div>
@ -107,29 +167,43 @@
</el-form-item> </el-form-item>
</template> </template>
<template v-else> <template v-else>
<el-form-item prop="stageNum" label="规则设置"> <el-form-item prop="stageNum"
label="规则设置">
<div class="step-set"> <div class="step-set">
<div class="line"> <div class="line">
<span class="req">*</span> <span class="req">*</span>
比赛方式 比赛方式
<el-radio v-for="(method, i) in methods" :key="i" v-model="form.competitionStageList[0].method" :label="method.id">{{ method.name }}</el-radio> <el-radio v-for="(method, i) in methods"
:key="i"
v-model="form.competitionStageList[0].method"
:label="method.id">{{ method.name }}</el-radio>
</div> </div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> <div v-if="step1.completeCompetitionSetup.competitionType"
class="line">
<span class="req">*</span> <span class="req">*</span>
团队成绩计算方式 团队成绩计算方式
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="form.competitionStageList[0].teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio> <el-radio v-for="(j, i) in teamCalculationMethods"
:key="i"
v-model="form.competitionStageList[0].teamCalculationMethod"
:label="j.id">{{ j.name }}</el-radio>
<span class="tips">可设置本阶段的团队取分规则</span> <span class="tips">可设置本阶段的团队取分规则</span>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="rule" 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>
小时公布阶段比赛成绩 小时公布阶段比赛成绩
</el-form-item> </el-form-item>
<el-form-item prop="resultsDetails" label="是否公布成绩详情"> <el-form-item prop="resultsDetails"
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="0"></el-radio> label="是否公布成绩详情">
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="1"></el-radio> <el-radio v-model="form.competitionStageList[0].resultsDetails"
:label="0"></el-radio>
<el-radio v-model="form.competitionStageList[0].resultsDetails"
:label="1"></el-radio>
<p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p> <p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p>
<p class="tips">若选择则不公布成绩详情参赛者只能知晓自己的分数及排名不能查看得分详情</p> <p class="tips">若选择则不公布成绩详情参赛者只能知晓自己的分数及排名不能查看得分详情</p>
</el-form-item> </el-form-item>
@ -146,7 +220,7 @@ import quill from "@/components/quill";
import Const from '@/const/match' import Const from '@/const/match'
export default { export default {
props: ['setupId', 'editing'], props: ['setupId', 'editing'],
data() { data () {
return { return {
id: this.$route.query.id, id: this.$route.query.id,
updateTime: 0, updateTime: 0,
@ -172,7 +246,7 @@ export default {
teamNumLimit: '', teamNumLimit: '',
teamNumLimitOpt: 0, teamNumLimitOpt: 0,
resultAnnouncementTime: '', resultAnnouncementTime: '',
resultsDetails: 0, resultsDetails: '',
}, },
{ {
method: 0, method: 0,
@ -188,7 +262,7 @@ export default {
teamNumLimit: '', teamNumLimit: '',
teamNumLimitOpt: 0, teamNumLimitOpt: 0,
resultAnnouncementTime: '', resultAnnouncementTime: '',
resultsDetails: 0, resultsDetails: '',
}, },
{ {
method: 0, method: 0,
@ -204,7 +278,7 @@ export default {
teamNumLimit: '', teamNumLimit: '',
teamNumLimitOpt: 0, teamNumLimitOpt: 0,
resultAnnouncementTime: '', resultAnnouncementTime: '',
resultsDetails: 0, resultsDetails: '',
} }
] ]
}, },
@ -235,19 +309,19 @@ export default {
watch: { watch: {
// , // ,
form: { form: {
handler(){ handler () {
this.updateTime++ this.updateTime++
}, },
deep:true deep: true
}, },
}, },
mounted() { mounted () {
this.ruleForm = JSON.parse(JSON.stringify(this.form.competitionStageList[0])) this.ruleForm = JSON.parse(JSON.stringify(this.form.competitionStageList[0]))
this.id && this.getData() this.id && this.getData()
this.step1 || this.getStep1() // this.step1 || this.getStep1() //
}, },
methods: { methods: {
getData() { getData () {
this.$get(this.api.getCompetitionRule, { this.$get(this.api.getCompetitionRule, {
competitionId: this.id competitionId: this.id
}).then(res => { }).then(res => {
@ -268,18 +342,18 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.updateTime = 0 this.updateTime = 0
}) })
}).catch(res => {}) }).catch(res => { })
}, },
// //
getStep1() { getStep1 () {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.step1 = competition this.step1 = competition
const { minTeamSize, maxTeamSize, competitionType } = this.step1.completeCompetitionSetup const { minTeamSize, maxTeamSize, competitionType } = this.step1.completeCompetitionSetup
competitionType && minTeamSize !== '' && maxTeamSize !== '' && minTeamSize == maxTeamSize && this.teamCalculationMethods.pop() // competitionType && minTeamSize !== '' && maxTeamSize !== '' && minTeamSize == maxTeamSize && this.teamCalculationMethods.pop() //
}).catch(err => {}) }).catch(err => { })
}, },
// //
stageChange(val) { stageChange (val) {
const stages = this.form.competitionStageList const stages = this.form.competitionStageList
const { ruleId } = this.form const { ruleId } = this.form
if (stages.length < val) { if (stages.length < val) {
@ -295,7 +369,7 @@ export default {
} }
}, },
// //
save(status, next = 0,releaseType,cb) { save (status, next = 0, releaseType, cb) {
let { form } = this let { form } = this
const { rule } = form const { rule } = form
let invalid = 0 let invalid = 0
@ -307,10 +381,7 @@ export default {
if (form.rule === 2) { // if (form.rule === 2) { //
const e = stages[0] const e = stages[0]
e.stageName = step1.name e.stageName = step1.name
if (!e.resultsDetails) { if (e.resultsDetails === 0 && e.resultAnnouncementTime !== '') {
if (e.resultAnnouncementTime === '') {
return util.errorMsg('请填写成绩公布时间')
}
if (e.resultAnnouncementTime < 0) { if (e.resultAnnouncementTime < 0) {
return util.errorMsg('成绩公布时间不得小于0') return util.errorMsg('成绩公布时间不得小于0')
} }
@ -363,12 +434,7 @@ export default {
break break
} }
} }
if (!e.resultsDetails) { if (e.resultsDetails === 0 && e.resultAnnouncementTime !== '') {
if (e.resultAnnouncementTime === '') {
invalid = 1
util.errorMsg('请填写成绩公布时间')
break
}
if (e.resultAnnouncementTime < 0) { if (e.resultAnnouncementTime < 0) {
invalid = 1 invalid = 1
util.errorMsg('成绩公布时间不得小于0') util.errorMsg('成绩公布时间不得小于0')
@ -396,7 +462,7 @@ export default {
this.$post(this.api.editCompetitionRule, form).then(res => { this.$post(this.api.editCompetitionRule, form).then(res => {
this.$parent.hideLoad() this.$parent.hideLoad()
util.successMsg("修改成功"); util.successMsg("修改成功");
this.$emit('next', next,cb) this.$emit('next', next, cb)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() this.$parent.hideLoad()
}) })
@ -405,7 +471,7 @@ export default {
this.$post(this.api.addCompetitionRule, form).then(res => { this.$post(this.api.addCompetitionRule, form).then(res => {
this.$parent.hideLoad() this.$parent.hideLoad()
util.successMsg("创建成功"); util.successMsg("创建成功");
this.$emit('next', next,cb) this.$emit('next', next, cb)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() this.$parent.hideLoad()
}) })
@ -418,7 +484,8 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
/deep/ .d-inline-block { /deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select, .el-input { .el-select,
.el-input {
width: 100%; width: 100%;
} }
} }
@ -437,7 +504,7 @@ export default {
.remove { .remove {
width: 16px; width: 16px;
height: 16px; height: 16px;
background: url("../../../assets/img/close.png") 0 0/cover no-repeat; background: url('../../../assets/img/close.png') 0 0 / cover no-repeat;
cursor: pointer; cursor: pointer;
} }
} }

@ -46,29 +46,44 @@
</div> </div>
</div> </div>
<div class="filter"> <div class="filter">
<dl v-if="curTab == 1"> <template v-if="curTab == 1">
<dt>学科专业</dt> <dl>
<dt>学科类别</dt>
<div class="vals"> <div class="vals">
<dd :class="{active: categoryId === ''}" <dd :class="{active: categoryId === ''}"
@click="catetoryClick('')">全部</dd> @click="categoryClick({id: ''}, 1)">全部</dd>
<dd :class="{active: categoryId === 1}" <dd :class="{active: categoryId === 1}"
style="margin-right: 20px" style="margin-right: 20px"
@click="catetoryClick(1)">不限</dd> @click="categoryClick({id: 1}, 1)">不限</dd>
<div v-for="(item, i) in category" <dd v-for="(item, i) in category"
:key="i" :key="i"
:class="['category-item', {active: item.disciplineId == categoryId}]"> :class="{active: categoryId === item.id}"
<span class="name" @click="categoryClick(item, 1)">{{ item.name }}</dd>
@click="nameClick(item, i)">{{ item.val.length ? item.name : item.categoryName }}</span>
<el-cascader :class="{active: item.disciplineId == categoryId}"
:ref="'category' + i"
v-model="item.val"
:options="item.list"
:props="{ checkStrictly: true }"
placeholder=""
@change="id => categoryChange(id, item, i)"></el-cascader>
</div> </div>
</dl>
<dl v-if="categoryId && categoryId !== 1">
<dt>专业类</dt>
<div class="vals">
<dd :class="{active: professionalCategoryId === ''}"
@click="categoryClick({id: ''}, 2)">全部</dd>
<dd v-for="(item, i) in professionalClasses"
:key="i"
:class="{active: professionalCategoryId === item.id}"
@click="categoryClick(item, 2)">{{ item.name }}</dd>
</div> </div>
</dl> </dl>
<dl v-if="professionalCategoryId && professionalCategoryId !== 1">
<dt>专业</dt>
<div class="vals">
<dd :class="{active: professionalId === ''}"
@click="categoryClick({id: ''}, 3)">全部</dd>
<dd v-for="(item, i) in professionals"
:key="i"
:class="{active: professionalId === item.id}"
@click="categoryClick(item, 3)">{{ item.name }}</dd>
</div>
</dl>
</template>
<dl v-if="curTab == 3"> <dl v-if="curTab == 3">
<dt>产品标签</dt> <dt>产品标签</dt>
<div class="vals"> <div class="vals">
@ -220,62 +235,9 @@ export default {
professionalCategoryId: '', professionalCategoryId: '',
professionalId: '', professionalId: '',
category: [], category: [],
// professionalClasses: [],
props: { professionals: [],
checkStrictly: true,
lazy: true,
lazyLoad (node, resolve) {
const { level, value } = node
//
if (!level) {
that.$get(that.api.courseDiscipline).then(({ list }) => {
list = list.slice(1).filter(e => e.level > 1)
list.map(e => {
e.value = e.disciplineId
e.label = e.disciplineName
e.children = []
})
that.category = [list[0].disciplineId]
resolve(list)
}).catch(err => { })
} else if (level === 1) {
//
that.$get(that.api.courseProfessionalClass, {
disciplineId: value
}).then(({ list }) => {
list = list.filter(e => e.level > 1)
list.map(e => {
e.value = e.professionalClassId
e.label = e.professionalClassName
e.children = []
})
resolve(list)
}).catch(err => { })
} else if (level === 2) {
//
that.$get(that.api.courseProfessional, {
professionalClassId: value
}).then(({ list }) => {
list = list.filter(e => e.level > 1)
list.map(e => {
e.value = e.professionalId
e.label = e.professionalName
e.leaf = true
})
resolve(list)
}).catch(err => { })
} else {
resolve([])
}
}
},
labels: [], labels: [],
subjectList: [], //
professionalClassList: [], //
professionalList: [], //
categoryName: '',
professionalCategoryName: '',
professionalName: '',
classifications: [], classifications: [],
status: [ status: [
{ {
@ -379,109 +341,41 @@ export default {
async getSubject () { async getSubject () {
// //
this.$get(this.api.subjectCategoryCited).then(({ list }) => { this.$get(this.api.subjectCategoryCited).then(({ list }) => {
const result = []
const promises = []
list = list.filter(e => e.disciplineId != 1) list = list.filter(e => e.disciplineId != 1)
list.map((e, i) => { list.map((e, i) => {
e.id = e.disciplineId
e.name = e.disciplineName
// //
e.professionalClasses.map(e => { e.professionalClasses.map(e => {
e.value = e.professionalClassId e.id = e.professionalClassId
e.label = e.professionalClassName e.name = e.professionalClassName
// //
e.professionals.map(e => { e.professionals.map(e => {
e.value = e.professionalId e.id = e.professionalId
e.label = e.professionalName e.name = e.professionalName
}) })
e.children = e.professionals e.children = e.professionals
}) })
result.push({ e.children = e.professionalClasses
val: [],
disciplineId: e.disciplineId,
name: e.disciplineName,
categoryName: e.disciplineName,
list: e.professionalClasses
})
})
Promise.all(promises).then(_ => {
console.log("🚀 ~ file: index.vue:378 ~ this.$get ~ result:", result)
this.category = result
}) })
this.category = list
}).catch(err => { }) }).catch(err => { })
}, },
nameClick (item, i) { //
this.categoryId = item.disciplineId categoryClick (item, i) {
const { id, children } = item
this[i === 1 ? 'categoryId' : i === 2 ? 'professionalCategoryId' : 'professionalId'] = id
//
if (i === 1) {
this.professionalCategoryId = '' this.professionalCategoryId = ''
this.professionalId = '' this.professionalId = ''
this.$refs['category' + i][0].toggleDropDownVisible() if (children) this.professionalClasses = children
this.clearCategory() this.professionals = []
this.initData() } else if (i === 2) { //
}, this.professionalId = ''
// if (children) this.professionals = children
clearCategory () {
const list = this.category
list.map(e => {
e.val = []
})
},
categoryChange (val, item, i) {
const name = this.$refs['category' + i][0].getCheckedNodes()[0].pathLabels
console.log("🚀 ~ file: index.vue:431 ~ categoryChange ~ val, item:", val, item, name)
item.name = item.categoryName + '/' + name.join('/')
this.clearCategory()
item.val = val
this.categoryId = item.disciplineId
this.professionalCategoryId = val[0] || ''
this.professionalId = val[1] || ''
this.initData()
},
// name
handleCategoryName () {
if (this.subjectList.length) {
const id = this.categoryId
const list = this.subjectList
if (list.length) {
if (id === '' || id === 1) {
this.categoryName = list[0].disciplineName
} else {
const item = list.find(e => e.disciplineId == id)
this.categoryName = item ? item.disciplineName : ''
}
}
}
if (this.professionalClassList.length) {
const id = this.professionalCategoryId
const list = this.professionalClassList
if (list.length) {
if (id === '' || id === 1) {
this.professionalCategoryName = list[0].professionalClassName
} else {
const item = list.find(e => e.professionalClassId == id)
this.professionalCategoryName = item ? item.professionalClassName : ''
}
}
}
if (this.professionalList.length) {
const id = this.professionalId
const list = this.professionalList
if (list.length) {
if (id === '' || id === 1) {
this.professionalName = list[0].professionalName
} else {
const item = list.find(e => e.professionalId == id)
this.professionalName = item ? item.professionalName : ''
}
}
} }
},
//
catetoryClick (id) {
this.categoryId = id
this.professionalCategoryId = id
this.professionalId = id
this.clearCategory()
this.initData() this.initData()
}, },
// //

@ -602,7 +602,7 @@ export default {
}, },
// //
async getMaximumScore () { async getMaximumScore () {
let { message } = await this.$post(`${this.api.maximumPracticeScoreList}?projectId=${this.archProject}&pageNum=1&pageSize=1000`); let { message } = await this.$post(`${this.api.maximumPracticeScoreList}?projectId=${this.archProject}&pageNum=1&pageSize=1000&mallId=${this.mallId}&cid=${this.courseId}`);
const list = message.records const list = message.records
list.forEach(e => { list.forEach(e => {
if (!e.userAvatars) e.userAvatars = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png' if (!e.userAvatars) e.userAvatars = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'

Loading…
Cancel
Save