Branch_d40a2540 V2.3.1
yujialong 1 year ago
parent 055566f7d9
commit 3ebf81ed6c
  1. 1
      src/api/index.js
  2. 4
      src/layouts/header/index.vue
  3. 116
      src/pages/achievement/list/index.vue
  4. 22
      src/pages/achievement/teach/index.vue
  5. 2
      src/pages/assessment/list/index.vue
  6. 9
      src/pages/expSystem/list/index.vue
  7. 466
      src/pages/match/add/step3.vue
  8. 2
      src/pages/station/list/index.vue
  9. 13
      src/pages/station/preview/index.vue

@ -411,6 +411,7 @@ export default {
listMarketing: `nakadai/nakadai/mall/marketing/promotion/pagingQueryList`, listMarketing: `nakadai/nakadai/mall/marketing/promotion/pagingQueryList`,
// 实验系统管理 // 实验系统管理
getSystemByCustomers: `nakadai/nakadai/customer/getSystemByCustomers`,
getAllService: `nakadai/nakadai/serviceConfiguration/getAllService`, getAllService: `nakadai/nakadai/serviceConfiguration/getAllService`,
schoolModelClassification: `nakadai/nakadai/model/reference/schoolModelClassification`, schoolModelClassification: `nakadai/nakadai/model/reference/schoolModelClassification`,
saveAcademyModelDemo: `nakadai/nakadai/model/reference/demo/saveAcademyModelDemo`, saveAcademyModelDemo: `nakadai/nakadai/model/reference/demo/saveAcademyModelDemo`,

@ -153,8 +153,8 @@ export default {
}, },
initSocket ({ id, account }) { initSocket ({ id, account }) {
// socket // socket
// this.socket = new WebSocket(`ws://${Setting.isDev ? '192.168.31.51' : location.host}:9100/nakadai/websocket/${id}/${account}`) this.socket = new WebSocket(`wss://${Setting.isDev ? '192.168.31.51' : location.host}/nakadai/websocket/${id}/${account}`)
this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`) // this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`)
// socket // socket
this.socket.onopen = this.open; this.socket.onopen = this.open;
// socket // socket

@ -5,11 +5,14 @@
<ul class="filter"> <ul class="filter">
<li v-if="projectPermissions"> <li v-if="projectPermissions">
<label>时间</label> <label>时间</label>
<el-radio-group v-model="month" @change="initData"> <el-radio-group v-model="month"
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio> @change="initData">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker <el-date-picker v-model="date"
v-model="date"
@blur='pickerInput' @blur='pickerInput'
align="right" align="right"
unlink-panels unlink-panels
@ -24,15 +27,19 @@
</li> </li>
<li> <li>
<label>实验项目分类</label> <label>实验项目分类</label>
<el-radio-group v-model="projectPermissions" @change="perChange"> <el-radio-group v-model="projectPermissions"
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{ item.name }}</el-radio> @change="perChange">
<el-radio v-for="(item,index) in projectType"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
</li> </li>
<li v-show="projectPermissions === 1"> <li v-show="projectPermissions === 1">
<label>班级</label> <label>班级</label>
<el-select v-model="classId" @change="classChange"> <el-select v-model="classId"
<el-option @change="classChange">
v-for="item in classList" <el-option v-for="item in classList"
:key="item.id" :key="item.id"
:label="item.className" :label="item.className"
:value="item.id"> :value="item.id">
@ -41,10 +48,11 @@
</li> </li>
<li> <li>
<label>课程</label> <label>课程</label>
<el-select v-model="curriculumId" @change="curriculumChange"> <el-select v-model="curriculumId"
<el-option label="不限" value=""></el-option> @change="curriculumChange">
<el-option <el-option label="不限"
v-for="item in curriculumList" value=""></el-option>
<el-option v-for="item in curriculumList"
:key="item.cid" :key="item.cid"
:label="item.curriculumName" :label="item.curriculumName"
:value="item.cid"> :value="item.cid">
@ -52,50 +60,98 @@
</el-select> </el-select>
</li> </li>
<li> <li>
<el-input placeholder="请输入考核或项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input placeholder="请输入考核或项目名称"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</li> </li>
</ul> </ul>
</div> </div>
<div class="tool mul"> <div class="tool mul">
<ul class="filter"></ul> <ul class="filter"></ul>
<div style="margin-bottom: 24px"> <div style="margin-bottom: 24px">
<el-button v-auth type="primary" @click="delAllData">批量删除</el-button> <el-button v-auth
type="primary"
@click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table :data="listData"
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column> class="table"
<el-table-column type="index" width="60" label="序号" align="center"> ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"
:selectable="disabledSelection"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<template v-if="projectPermissions == 1"> <template v-if="projectPermissions == 1">
<el-table-column prop="className" label="班级" align="center" width="140"></el-table-column> <el-table-column prop="className"
<el-table-column prop="experimentalName" label="考核名称" align="center"> label="班级"
align="center"
width="140"></el-table-column>
<el-table-column prop="experimentalName"
label="考核名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="mul-ellipsis2">{{ scope.row.experimentalName }}</span> <span class="mul-ellipsis2">{{ scope.row.experimentalName }}</span>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName"
<el-table-column prop="projectPermissions" label="分类" align="center" width="100"> label="项目名称"
align="center"></el-table-column>
<el-table-column prop="projectPermissions"
label="分类"
align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ projectPermissions ? '考核' : '练习' }} {{ projectPermissions ? '考核' : '练习' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="experimentalNumber" label="成绩报告数量" align="center" :width="projectPermissions ? 120 : 230"></el-table-column> <el-table-column prop="experimentalNumber"
<el-table-column prop="createTime" label="创建时间" align="center" :width="projectPermissions ? 160 : 230"> label="成绩报告数量"
align="center"
:width="projectPermissions ? 120 : 230"></el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center"
:width="projectPermissions ? 160 : 230">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" :width="projectPermissions ? 150 : 230"> <el-table-column label="操作"
align="center"
:width="projectPermissions ? 150 : 230">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'练习成绩管理'" type="text" @click="entry(scope.row)">成绩管理</el-button> <el-button v-auth="'练习成绩管理'"
<el-button v-auth type="text" v-if="scope.row.canDel" @click="handleDelete(scope.row)" >删除</el-button> type="text"
<el-button v-auth type="text" v-else style='color:#999' >删除</el-button> @click="entry(scope.row)">成绩管理</el-button>
<el-button v-auth
type="text"
v-if="scope.row.canDel"
@click="handleDelete(scope.row)">删除</el-button>
<el-button v-auth
type="text"
v-else
style='color:#999'>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"></el-pagination>
</div> </div>
</div> </div>
</template> </template>
@ -282,7 +338,7 @@ export default {
}, },
// //
entry (row) { entry (row) {
this.$router.push(`teach?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}`) this.$router.push(`teach?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}`)
}, },
handleDelete (row) { // handleDelete (row) { //
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {

@ -48,11 +48,11 @@
<div class="wrong"> <div class="wrong">
<div class="line"> <div class="line">
<span class="jud-name">错误率最高{{ max.judgmentName }}</span> <span class="jud-name">错误率最高{{ max.judgmentName }}</span>
<span>参加考试{{ max.peopleNum }}&emsp;&emsp;{{ max.errorTotal }}人做错错误率{{ max.errorRate }}%</span> <span>参加考试{{ permissions ? max.peopleNum : peopleNum }}&emsp;&emsp;{{ permissions ? `${max.errorTotal}人做错,` : '' }}错误率{{ max.errorRate }}%</span>
</div> </div>
<div class="line"> <div class="line">
<span class="jud-name">错误率最低{{ min.judgmentName }}</span> <span class="jud-name">错误率最低{{ min.judgmentName }}</span>
<span>参加考试{{ min.peopleNum }}&emsp;&emsp;{{ min.errorTotal }}人做错错误率{{ min.errorRate }}%</span> <span>参加考试{{ permissions ? min.peopleNum : peopleNum }}&emsp;&emsp;{{ permissions ? `${min.errorTotal}人做错,` : '' }}错误率{{ min.errorRate }}%</span>
</div> </div>
</div> </div>
<div class="chart" <div class="chart"
@ -285,10 +285,6 @@ export default {
id: '0', id: '0',
name: '成绩报告' name: '成绩报告'
}, },
{
id: '1',
name: '活跃度'
},
], ],
activations: [], activations: [],
multipleSelectionActivation: [], multipleSelectionActivation: [],
@ -306,7 +302,13 @@ export default {
} }
}, },
mounted () { mounted () {
this.permissions && this.getSpliceClass() // //
this.permissions ?
this.getSpliceClass() :
this.tabs.push({
id: '1',
name: '活跃度'
})
this.getData() this.getData()
}, },
methods: { methods: {
@ -347,8 +349,8 @@ export default {
this.maxScore = res.maxScore this.maxScore = res.maxScore
this.minScore = res.minScore this.minScore = res.minScore
this.errorAnalysis = res.errorAnalysis this.errorAnalysis = res.errorAnalysis
this.max = res.highestErrorRate this.max = res.highestErrorRate || {}
this.min = res.minimumErrorRate this.min = res.minimumErrorRate || {}
this.handlePage() this.handlePage()
this.getChart() this.getChart()
this.errorChart() this.errorChart()
@ -529,7 +531,7 @@ export default {
data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100'] data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
}, },
yAxis: { yAxis: {
name: "人数", name: this.permissions ? "人数" : '成绩报告数量',
type: "value", type: "value",
interval: 1 interval: 1
}, },

@ -57,7 +57,7 @@
value=""></el-option> value=""></el-option>
<el-option v-for="item in curriculumList" <el-option v-for="item in curriculumList"
:key="item.cid" :key="item.cid"
:label="item.curriculumName" :label="item.goodsName"
:value="item.cid"></el-option> :value="item.cid"></el-option>
</el-select> </el-select>
</li> </li>

@ -79,7 +79,6 @@ import Setting from "@/setting";
export default { export default {
data () { data () {
return { return {
systemAttribution: "",
systemType: "", systemType: "",
systemSearch: "", systemSearch: "",
searchTimer: null, searchTimer: null,
@ -129,16 +128,14 @@ export default {
}, },
getData () { getData () {
let data = { let data = {
belong: this.systemAttribution,
type: this.systemType, type: this.systemType,
systemName: this.systemSearch, systemName: this.systemSearch,
pageNum: this.pageNo, pageNum: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
supplierId: ''
}; };
this.$post(this.api.getAllService, data).then(res => { this.$post(this.api.getSystemByCustomers, data).then(({ data }) => {
this.systemData = res.serviceList.records; this.systemData = data.records;
this.totals = res.serviceList.total; this.totals = data.total;
}).catch(res => { }).catch(res => {
}); });
}, },

@ -1,29 +1,20 @@
<template> <template>
<div> <div>
<div v-show="!setVisible" <el-card shadow="hover"
class="page"> class="m-b-20">
<div class="page-content"> <div>
<div class="p-title">比赛内容设置</div> <p class="m-b-20">比赛名称</p>
<el-form label-width="170px" {{ form.stageName }}
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>
</div> </div>
<el-form-item class="req" </el-card>
prop="time" <el-card shadow="hover"
label="比赛时间"> class="m-b-20">
<span v-if="item.method !== 2 && item.startTime">{{ item.startTime + ' ' + item.endTime }}</span> <div>
<div style="display: flex;align-items: center;" <p class="m-b-20">比赛时间</p>
v-if="item.method === 2"> <div class="date-inputs">
<el-date-picker v-model="item.time" 起止时间
<div style="display: inline-flex;align-items: center;">
<el-date-picker v-model="form.time"
type="datetimerange" type="datetimerange"
range-separator="~" range-separator="~"
start-placeholder="开始日期" start-placeholder="开始日期"
@ -32,127 +23,124 @@
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange"> @change="timeChange">
</el-date-picker> </el-date-picker>
<el-alert style="width: auto;padding: 0px 16px;margin-left: 10px;" <el-alert style="width: auto;padding: 4px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" :title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error" type="error"
:closable="false" :closable="false"
effect="dark"> effect="dark">
</el-alert> </el-alert>
</div> </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>
<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>
</template>
<template v-else>
<el-form-item class="req"
prop="cid"
label="课程系统">
{{ item.systemName }}
</el-form-item>
<el-form-item class="req"
prop="assessmentId"
label="已选择考核">
{{ item.projectName }}
</el-form-item>
<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>
</div> </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>
</div> </div>
</el-form-item> </el-card>
</template> <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-option>
</el-select>
</div>
</div> </div>
</el-form> </el-card>
<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>
</div> </div>
<el-button style="margin-left: 5px"
type="primary"
round
@click="toProject">自定义实验项目</el-button>
</div> </div>
</div>
<!-- 实训项目表格 -->
<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>
</template>
</el-table-column>
<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">
<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 label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showProject(scope.row)">查看</el-button>
</template>
</el-table-column> -->
</el-table>
<div class="pagination">
<el-pagination background
:page-size="pageSize"
@current-change="handleCurrentChange"
layout="total,prev, pager, next"
:total="total"></el-pagination>
</div>
</el-card>
<set v-if="setVisible" <div style="text-align: center">
:form.sync="form[curStep]" <el-button @click="back">返回</el-button>
:step1.sync="step1" <el-button type="primary"
@hideSet="hideSet" /> @click="save">保存</el-button>
</div>
</div> </div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import set from './set' import { Loading } from 'element-ui'
export default { export default {
props: ['setupId', 'competitionId', 'editing'], props: ['form', 'step1'],
data () { data () {
return { return {
id: this.$route.query.id, loadIns: null,
updateTime: 0, curriculumList: [],
step1: this.$parent.$refs.step1.form, keyword: '',
cache: this.$store.state.match.cache, projects: [],
nums: ['一', '二', '三'], page: 1,
methods: [ pageSize: 5,
{ total: 0,
id: 0, sysId: '',
name: '实操' permissionsKeys: ['练习', '考核', '竞赛'],
}, timeInvalid: false
{
id: 1,
name: '理论'
},
{
id: 2,
name: '线下'
}
],
originForm: {
cid: '',
mallId: '',
contentDescription: '',
endTime: '',
scoreRule: '',
stageId: '',
startTime: '',
systemId: '',
offlineAddress: '',
offlineButton: 0,
onlineAddress: '',
onlineButton: 0,
time: []
},
form: [],
setVisible: false,
curStep: 0,
pass: 0
}; };
}, },
components: {
set
},
watch: { watch: {
// , // ,
form: { form: {
@ -161,55 +149,70 @@ export default {
}, },
deep: true deep: true
}, },
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
}, },
mounted () { mounted () {
this.handleForm() this.getCourse()
}, },
methods: { methods: {
// //
resumeData () { getCourse () {
if (this.cache) { this.loadIns = Loading.service()
this.curStep = this.cache.curStep this.$get(this.api.curriculumList).then(({ data }) => {
if (this.cache.form) this.form = this.cache.form const list = data
this.setVisible = true this.curriculumList = data
this.$store.commit('match/setCache', null) if (!this.form.cid && list.length) this.form.cid = list[0].cid
} this.courseChange()
}).catch(err => {
this.loadIns.close()
});
}, },
// form //
handleForm () { courseChange (val) {
// id const { systemId } = this.curriculumList.find(e => e.cid == this.form.cid)
this.$post(`${this.api.queryCompetitionStageBySetupId}?setupId=${this.setupId}`).then(res => { this.sysId = systemId
res.competitionStages.map(e => { if (val) this.loadIns = Loading.service()
const form = e.competitionContent || JSON.parse(JSON.stringify(this.originForm)) this.getProject()
if (form.startTime) { },
form.time = [form.startTime, form.endTime] //
} else { getProject () {
form.time = [] this.$post(this.api.getProjectAssessmentByCompetition, {
} pageNum: this.page,
form.offlineButton = !!form.offlineButton pageSize: this.pageSize,
form.onlineButton = !!form.onlineButton cid: this.form.cid,
form.method = e.method projectName: this.keyword,
form.stageId = e.stageId systemId: this.sysId,
form.stageName = e.stageName permissions: 2
this.form.push(form) }).then(({ data }) => {
}) this.projects = data.records
this.resumeData() this.total = data.total
this.$nextTick(() => { this.loadIns.close()
this.updateTime = 0 }).catch(err => {
}) this.loadIns.close()
}).catch(res => { }) });
}, },
// initData () {
toSet (i) { this.page = 1;
this.curStep = i this.getProject();
this.$parent.showBtns = false
this.setVisible = true
}, },
// handleCurrentChange (val) {
hideSet (form) { this.page = val;
if (form) this.form[this.curStep] = form this.getProject();
this.setVisible = false },
this.$parent.showBtns = true //
toProject () {
const { form, curStep } = this.$parent
form[curStep] = this.form
this.$store.commit('match/setCache', {
form,
curStep
})
this.$router.push(`/project/list?show=1`)
}, },
// //
timeChange (val) { timeChange (val) {
@ -217,8 +220,12 @@ 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)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) {
const { form, curStep } = this this.timeInvalid = true
return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
}
this.timeInvalid = false
const { form, curStep } = this.$parent
for (const i in form) { for (const i in form) {
// //
if (i !== curStep) { if (i !== curStep) {
@ -232,124 +239,29 @@ export default {
} }
} }
}, },
//
publish () {
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => { }).catch(err => { })
},
// //
save (status, next = 0, releaseType, cb) { save () {
const { form } = this const { form } = this
if (!form.length) { if (!form.time.length) return util.warningMsg('请选择比赛时间')
this.$parent.hideLoad()
util.successMsg('保存成功')
this.$emit('next', next)
return
}
//
if (status) {
let invalid = 0
const { playStartTime, playEndTime } = this.step1 const { playStartTime, playEndTime } = this.step1
for (const e of form) { if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (!e.time.length) { if (!form.cid) return util.warningMsg('请选择课程')
invalid = 1 if (!form.projectId) return util.warningMsg('请选择项目')
util.errorMsg('请选择比赛时间') const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId)
break if (systemId) form.systemId = systemId
} if (projectName) form.projectName = projectName
if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) { if (systemName) form.systemName = systemName
invalid = 1 form.startTime = form.time[0]
util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') form.endTime = form.time[1]
break this.$emit('hideSet', this.form)
}
e.startTime = e.time[0]
e.endTime = e.time[1]
if (e.method !== 2 && !e.cid) {
invalid = 1
util.errorMsg('请选择课程')
break
}
if (e.method === 2) { // 线
if (!e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
invalid = 1
util.errorMsg('请输入评分规则')
break
}
} else {
if (e.onlineButton && !e.onlineAddress) {
invalid = 1
util.errorMsg('请输入线上地点')
break
}
if (e.offlineButton && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入线下地点')
break
}
if (!e.onlineAddress && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
}
}
if (invalid) return
}
//
for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0
}
this.$parent.showLoad()
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
competitionContents: form
}).then(res => {
this.$parent.hideLoad()
//
status && this.publish(status)
util.successMsg((status ? '发布' : '保存') + '成功')
this.$emit('next', next, cb)
}).catch(err => {
this.$parent.hideLoad()
})
}, },
//
back () {
this.$emit('hideSet')
}
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.step {
padding-bottom: 10px;
background-color: #f9f9f9;
.title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
margin-bottom: 10px;
background-color: #ededed;
}
}
.line {
margin-bottom: 10px;
}
/deep/.req {
.el-form-item__label {
&:before {
content: '*';
margin-right: 5px;
font-size: 18px;
vertical-align: middle;
color: #f00;
}
}
}
</style> </style>

@ -91,7 +91,7 @@ export default {
}); });
}, },
goPreview (item) { goPreview (item) {
this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.curriculumName}&mallId=${item.mallId || ''}&admin=1`); this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}&admin=1`);
}, },
// tab // tab
tabChange (item) { tabChange (item) {

@ -250,7 +250,8 @@
<div class="action"> <div class="action">
<i class="icon el-icon-chat-dot-square" <i class="icon el-icon-chat-dot-square"
@click="showReplay(item)"></i> @click="showReplay(item)"></i>
<i v-if="deleteIdentity || item.currentAccountId == item.createAccountId" <!-- 当前用户是管理员 || 该条评论是学生发的没有createRoleName即是学生 || 当前用户的account==该条评论的创建人accountId -->
<i v-if="item.currentRoleName.includes('管理员') || !item.createRoleName || item.currentAccountId == item.createAccountId"
class="icon el-icon-delete" class="icon el-icon-delete"
@click="delComment(item)"></i> @click="delComment(item)"></i>
@ -292,7 +293,7 @@
<div class="texts"> <div class="texts">
<div class="name">{{reply.createUsername}}</div> <div class="name">{{reply.createUsername}}</div>
<div class="flex m-v-8"> <div class="flex m-v-8">
<template> <template v-if="reply.level !== 2">
回复 回复
<span class="reply-name">@{{ reply.replyUsername }}</span> <span class="reply-name">@{{ reply.replyUsername }}</span>
</template> </template>
@ -303,7 +304,8 @@
<div class="action"> <div class="action">
<i class="icon el-icon-chat-dot-square" <i class="icon el-icon-chat-dot-square"
@click="showReplay(reply)"></i> @click="showReplay(reply)"></i>
<i v-if="deleteIdentity || reply.currentAccountId == reply.createAccountId" <!-- 当前用户是管理员 || 该条评论是学生发的没有createRoleName即是学生 || 当前用户的account==该条评论的创建人accountId -->
<i v-if="reply.currentRoleName.includes('管理员') || !reply.createRoleName || reply.currentAccountId == reply.createAccountId"
class="icon el-icon-delete" class="icon el-icon-delete"
@click="delComment(reply)"></i> @click="delComment(reply)"></i>
<!-- <div class="like-wrap" <!-- <div class="like-wrap"
@ -563,7 +565,7 @@ export default {
}, },
// 使 // 使
addRecord () { addRecord () {
this.$post(`${this.api.recordRecentUsage}?cid=${this.courseId}`).then(res => { }).catch(res => { }) this.$post(`${this.api.recordRecentUsage}?mallId=${this.mallId}`).then(res => { }).catch(res => { })
}, },
// //
getStatus () { getStatus () {
@ -951,6 +953,7 @@ export default {
util.cookies.set('systemId', id) util.cookies.set('systemId', id)
util.cookies.set('fromManager', 1) util.cookies.set('fromManager', 1)
util.cookies.set('isSubmit', '', -1) util.cookies.set('isSubmit', '', -1)
util.cookies.set('language', '', -1)
// 8pythoncookiesystemId // 8pythoncookiesystemId
location.href = process.env.NODE_ENV === 'development' ? location.href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8085/#/` : `http://${location.hostname}:8085/#/` :
@ -967,6 +970,8 @@ export default {
if (systemId == 11) { if (systemId == 11) {
// //
sessionStorage.removeItem('projectId')
sessionStorage.removeItem('submited')
location.href = `${Setting.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&test=true&manager=1` location.href = `${Setting.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&test=true&manager=1`
} else if (systemId == 12) { } else if (systemId == 12) {
// //

Loading…
Cancel
Save