Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
31f1192de0
@ -325,7 +325,7 @@ export function publishContextSence(data) {
|
|||||||
*/
|
*/
|
||||||
export function getTaskTree(paperId, moduleId) {
|
export function getTaskTree(paperId, moduleId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/exercise/race/paper/page/${paperId}/module/${moduleId}/task`,
|
url: `/api/exercise/race/paper/${paperId}/module/${moduleId}/task`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -230,6 +230,7 @@ const ContestSeasonManage = () => import('@/views/contestDataManage/contestSeaso
|
|||||||
const ContestScoreEdit = () => import('@/views/contestDataManage/contestTaskScoreManage/edit');
|
const ContestScoreEdit = () => import('@/views/contestDataManage/contestTaskScoreManage/edit');
|
||||||
const ContestList = () => import('@/views/contest/contestList');
|
const ContestList = () => import('@/views/contest/contestList');
|
||||||
const ContestDetail = () => import('@/views/contest/contestDetail');
|
const ContestDetail = () => import('@/views/contest/contestDetail');
|
||||||
|
const ScoringSettlement = () => import('@/views/contest/ScoringSettlement');
|
||||||
|
|
||||||
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
|
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
|
||||||
// import { getSessionStorage } from '@/utils/auth';
|
// import { getSessionStorage } from '@/utils/auth';
|
||||||
@ -690,6 +691,11 @@ export const publicAsyncRoute = [
|
|||||||
path: 'detail',
|
path: 'detail',
|
||||||
component: ContestDetail,
|
component: ContestDetail,
|
||||||
hidden: true
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'scoringSettlement',
|
||||||
|
component: ScoringSettlement,
|
||||||
|
hidden: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
13
src/views/contest/ScoringSettlement.vue
Normal file
13
src/views/contest/ScoringSettlement.vue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<div>打分结算</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ScoringSettlement'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -3,7 +3,7 @@
|
|||||||
<el-col :span="5" class="container-left">
|
<el-col :span="5" class="container-left">
|
||||||
<el-tree
|
<el-tree
|
||||||
:data="taskData"
|
:data="taskData"
|
||||||
node-key="name"
|
node-key="index"
|
||||||
current-node-key
|
current-node-key
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
default-expand-all
|
default-expand-all
|
||||||
@ -12,7 +12,7 @@
|
|||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
>
|
>
|
||||||
<div slot-scope="{ node, data }" class="custom-tree-node">
|
<div slot-scope="{ node, data }" class="custom-tree-node">
|
||||||
<div :style="{ color: nowData.name === data.name? '#8f079d': '#fff' }">{{ data.groupName||data.name }}</div>
|
<div :style="{ color: nowData.name === data.name && nowData.id === data.id? '#8f079d': '#fff' }">{{ data.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="19" class="container-right">
|
<el-col :span="19" class="container-right">
|
||||||
<el-card class="box-card" style="color: #fff;background-color: transparent;height: 100%">
|
<el-card class="box-card">
|
||||||
<div slot="header" style="text-align: center">
|
<div slot="header" style="text-align: center">
|
||||||
<span style="font-size: 28px;">{{ nowData.name }}</span>
|
<span style="font-size: 28px;">{{ nowData.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -42,8 +42,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: center;margin-top: 15px;">
|
<div style="text-align: center;margin-top: 15px;">
|
||||||
<el-button v-show="nowData.ruleId" type="primary">评分表</el-button>
|
<el-button v-show="nowData.ruleId" type="primary" @click="showScoreRule">评分表</el-button>
|
||||||
<el-button v-show="nowData.sceneId" type="primary">开始任务</el-button>
|
<el-button v-show="nowData.sceneId" v-loading="loading" type="primary" @click="startTask">开始任务</el-button>
|
||||||
<el-button type="primary" :disabled="nowKey === taskList.length-1" @click="nextTask">下一任务</el-button>
|
<el-button type="primary" :disabled="nowKey === taskList.length-1" @click="nextTask">下一任务</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -53,7 +53,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getTaskTree } from '@/api/contest';
|
import { getTaskTree, getContextSenceDetail} from '@/api/contest';
|
||||||
|
import { createSimulationNoFunction } from '@/api/simulation';
|
||||||
|
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||||
import ScoreRule from './scoreRule';
|
import ScoreRule from './scoreRule';
|
||||||
export default {
|
export default {
|
||||||
name: 'ContestDetail',
|
name: 'ContestDetail',
|
||||||
@ -62,6 +64,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading: false,
|
||||||
nowKey: 0,
|
nowKey: 0,
|
||||||
taskList: [],
|
taskList: [],
|
||||||
taskData: [],
|
taskData: [],
|
||||||
@ -74,124 +77,50 @@ export default {
|
|||||||
funcitonData: {
|
funcitonData: {
|
||||||
type: 'METRO',
|
type: 'METRO',
|
||||||
itemMap: {
|
itemMap: {
|
||||||
DEFAULT_MEMBER: ''
|
|
||||||
},
|
},
|
||||||
domConfig: {
|
domConfig: {
|
||||||
singleMember: false,
|
singleMember: false,
|
||||||
singleClient: false,
|
singleClient: false,
|
||||||
client: 'dispatchWork',
|
client: '',
|
||||||
hasTraining: false,
|
hasTraining: true,
|
||||||
|
trainingType: 'SCENE',
|
||||||
hasExam: false,
|
hasExam: false,
|
||||||
trainingDesign: true,
|
trainingDesign: false,
|
||||||
hasLpf: false,
|
hasLpf: false,
|
||||||
hasVoice: true,
|
hasVoice: true,
|
||||||
joint: false,
|
joint: false,
|
||||||
hasDeviceManage: false,
|
hasDeviceManage: false,
|
||||||
hasMemberManage: true
|
hasMemberManage: true
|
||||||
}
|
}
|
||||||
},
|
|
||||||
resp: {
|
|
||||||
customModuleId: 2,
|
|
||||||
child: [
|
|
||||||
{
|
|
||||||
id: 0,
|
|
||||||
name: '车站行车作业',
|
|
||||||
desc: '',
|
|
||||||
content: '',
|
|
||||||
standards: '',
|
|
||||||
sceneId: 0,
|
|
||||||
ruleId: 0,
|
|
||||||
parentId: 0,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
id: 45,
|
|
||||||
name: '正常行车组织工作',
|
|
||||||
desc: '利用智慧城轨运营模拟训练平台ATS系统,加载既定的列车运行图,选取某时刻(9:00)开始模拟列车运行。',
|
|
||||||
content: '1,组织管辖车站范围内图定列车按计划运行\n2,控制权交接',
|
|
||||||
standards: '。。',
|
|
||||||
sceneId: 0,
|
|
||||||
ruleId: 0,
|
|
||||||
parentId: 0,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
id: 46,
|
|
||||||
name: '组织管辖车站范围内图定列车按计划运行',
|
|
||||||
desc: '核对运行计划。',
|
|
||||||
content: '行调与车站值班员确认本站站台及相邻区间列车状态。',
|
|
||||||
standards: '车站值班员手指口呼确认本站站台及相邻区间列车占用状态并与行调核对车次及位置正确、用语标准。',
|
|
||||||
sceneId: 0,
|
|
||||||
ruleId: 0,
|
|
||||||
parentId: 45,
|
|
||||||
isTask: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 47,
|
|
||||||
name: '控制权交接',
|
|
||||||
desc: '控制权交接操作。',
|
|
||||||
content: '行调与车站值班员确认ATS站中控状态并进行控制权转换操作。',
|
|
||||||
standards: '车站值班员手指口呼确认本站ATS站中控状态并进行控制权转换操作,正常完成控制权转换。按标准用语汇报。',
|
|
||||||
sceneId: 0,
|
|
||||||
ruleId: 0,
|
|
||||||
parentId: 45,
|
|
||||||
isTask: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
isTask: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 35,
|
|
||||||
name: '运营工作准备',
|
|
||||||
desc: '利用智慧城轨运营模拟训练平台ATS系统,加载既定的列车运行图,选取运营开始前30分钟,开始运营前检查工作。',
|
|
||||||
content: '1,人员准备\n2,检查ATS设备\n3,检查IBP\n4,站台门检查',
|
|
||||||
standards: '。。',
|
|
||||||
sceneId: 0,
|
|
||||||
ruleId: 0,
|
|
||||||
parentId: 0,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
id: 41,
|
|
||||||
name: '人员准备',
|
|
||||||
desc: '检查人员工作状态',
|
|
||||||
content: '检查运营前人员形象礼仪及精神状态。',
|
|
||||||
standards: '运营前人员形象礼仪及精神状态符合企业服务标准要求。',
|
|
||||||
sceneId: 0,
|
|
||||||
ruleId: 0,
|
|
||||||
parentId: 35,
|
|
||||||
isTask: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 42,
|
|
||||||
name: '检查本地ATS设备',
|
|
||||||
desc: '检查车站ATS状态。',
|
|
||||||
content: '检查车站ATS工作站中的所有道岔、信号机、计轴区段状态。',
|
|
||||||
standards: '手指口呼确认道岔、信号机、计轴状态等设备状态是否全部正常。',
|
|
||||||
sceneId: 0,
|
|
||||||
ruleId: 0,
|
|
||||||
parentId: 35,
|
|
||||||
isTask: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
isTask: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
isTask: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.taskData = JSON.parse(this.resp);
|
// this.taskData = JSON.parse(this.resp);
|
||||||
this.taskData = this.resp.child;
|
getTaskTree(this.$route.query.paperId, this.$route.query.moduleId).then(resp => {
|
||||||
|
const data = resp.data.child;
|
||||||
|
this.handleData(data, 1);
|
||||||
|
this.taskData = data;
|
||||||
this.taskList = [];
|
this.taskList = [];
|
||||||
this.eachTask(this.taskList, this.taskData);
|
this.eachTask(this.taskList, this.taskData);
|
||||||
this.nowKey = 0;
|
if (this.$route.query.nowKey && this.$route.query.nowKey >= this.taskList.length) {
|
||||||
|
this.nowKey = this.taskList.length - 1 || 0;
|
||||||
|
} else {
|
||||||
|
this.nowKey = this.$route.query.nowKey || 0;
|
||||||
|
}
|
||||||
this.nowData = this.taskList[this.nowKey];
|
this.nowData = this.taskList[this.nowKey];
|
||||||
getTaskTree(this.$route.query.paperId, this.$route.query.moduleId).then(resp => {
|
// console.log(this.taskData, this.taskList, this.nowData, '===', data);
|
||||||
|
|
||||||
}).catch(() => this.$message.error('加载数据失败!'));
|
}).catch(() => this.$message.error('加载数据失败!'));
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleData(data, index) {
|
||||||
|
data.forEach((elem, i) => {
|
||||||
|
elem.index = index + '_' + i;
|
||||||
|
if (elem.children) {
|
||||||
|
this.handleData(elem.children, index + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
handleChange(data, node) {
|
handleChange(data, node) {
|
||||||
node.isCurrent = false;
|
node.isCurrent = false;
|
||||||
this.$set(node, 'isCurrent', false);
|
this.$set(node, 'isCurrent', false);
|
||||||
@ -199,7 +128,7 @@ export default {
|
|||||||
},
|
},
|
||||||
eachTask(list, data) {
|
eachTask(list, data) {
|
||||||
data.forEach(ele => {
|
data.forEach(ele => {
|
||||||
if (ele.isTask) {
|
if (ele.nodeType === 'TASK') {
|
||||||
list.push(ele);
|
list.push(ele);
|
||||||
}
|
}
|
||||||
if (ele.children) {
|
if (ele.children) {
|
||||||
@ -211,17 +140,64 @@ export default {
|
|||||||
this.nowKey++;
|
this.nowKey++;
|
||||||
this.nowData = this.taskList[this.nowKey];
|
this.nowData = this.taskList[this.nowKey];
|
||||||
},
|
},
|
||||||
|
startTask() {
|
||||||
|
this.loading = true;
|
||||||
|
try {
|
||||||
|
getContextSenceDetail(this.nowData.sceneId).then(resp => {
|
||||||
|
getPublishMapInfo(resp.data.mapid).then(resp1 => {
|
||||||
|
createSimulationNoFunction(resp.data.mapid, this.funcitonData).then(resp2 => {
|
||||||
|
const query = {
|
||||||
|
lineCode: resp1.data.lineCode,
|
||||||
|
mapId: resp.data.mapid,
|
||||||
|
group: resp2.data,
|
||||||
|
simType: 'METRO',
|
||||||
|
project: 'dsxl',
|
||||||
|
paperId: this.$route.query.paperId,
|
||||||
|
moduleId: this.$route.query.moduleId,
|
||||||
|
nowKey: this.nowKey
|
||||||
|
};
|
||||||
|
this.$router.push({ path: '/display/demon', query: query });
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error('创建仿真失败!');
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showScoreRule() {
|
||||||
|
this.$refs.scoreRule.doShow(this.nowData.ruleId);
|
||||||
|
},
|
||||||
goBack() {
|
goBack() {
|
||||||
|
this.$confirm('是否确认返回,返回将放弃改模块测试?', this.$t('tip.hint'), {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
this.$router.push('/contest/list');
|
this.$router.push('/contest/list');
|
||||||
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$router.push('/contest/list');
|
this.$confirm('是否确认提交?', this.$t('tip.hint'), {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$router.push('/contest/scoringSettlement');
|
||||||
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.box-card {
|
||||||
|
color: #fff;
|
||||||
|
background-color: transparent;
|
||||||
|
height: 100%;
|
||||||
|
border: 1px solid #01468B;
|
||||||
|
}
|
||||||
.container {
|
.container {
|
||||||
background: linear-gradient(to bottom, #01468B, #00172E);
|
background: linear-gradient(to bottom, #01468B, #00172E);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -232,7 +208,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.container-right{
|
.container-right{
|
||||||
background: #00172E;
|
background: #00172E;
|
||||||
border: solid 1px #01468B;
|
border: 1px solid #01468B;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
@ -243,12 +219,15 @@ export default {
|
|||||||
width: 20.9%;
|
width: 20.9%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-top: 2px solid #01468B;
|
border-top: 1px solid #01468B;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
/deep/.el-tree-node__content{
|
/deep/.el-tree-node__content{
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
|
/deep/.el-card__header{
|
||||||
|
border-bottom: 1px solid #01468B;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,47 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="trainingPlatform" :style="'padding-left:'+(widthLeft)+'px'">
|
<div class="contestPlatform" :style="'padding-left:'+(widthLeft)+'px'">
|
||||||
<div class="trainingPubMapList" :style="{width: widthLeft+'px'}">
|
<div class="contestPaperList" :style="{width: widthLeft+'px'}">
|
||||||
<paper-list ref="paperList" @changeModuleData="changeModuleData" />
|
<paper-list ref="paperList" @changeModuleData="changeModuleData" />
|
||||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="module-box">
|
||||||
<div style="height: 50px;text-align: center;line-height: 50px;font-size: 26px;font-weight: bolder;">{{ paperName }}</div>
|
<div style="height: 50px;text-align: center;line-height: 50px;font-size: 26px;font-weight: bolder;color: #fff;">{{ paperName }}</div>
|
||||||
<el-tabs v-model="activeModuleName" class="tabs-box" type="border-card" @tab-click="handleTabClick">
|
<el-tabs v-model="activeModuleName" class="tabs-box" type="border-card">
|
||||||
|
<el-tab-pane label="详情" name="detail">
|
||||||
|
<div class="tabs-module">
|
||||||
<template v-for="(mod, modIndex) in moduleList">
|
<template v-for="(mod, modIndex) in moduleList">
|
||||||
<el-tab-pane :key="modIndex" :label="mod.moduleName" :name="mod.customModuleId+''">
|
<el-card :key="modIndex" class="tabs-module-card">
|
||||||
<el-card style="padding:10px">
|
<div style="margin-bottom:10px;font-size: 20px;height: 30px;text-align: center;line-height: 30px;">{{ mod.moduleName }}</div>
|
||||||
<div>考试时间:{{ mod.duration }}分钟</div>
|
<div style="margin-bottom:10px">考试时间:{{ mod.duration }}分钟</div>
|
||||||
</el-card>
|
<div style="margin-bottom:50px"> 任务目录:
|
||||||
<el-card style="margin-top: 10px;">
|
|
||||||
<div style="padding:10px"> 任务目录:</div>
|
|
||||||
<el-tree
|
<el-tree
|
||||||
:data="taskTreeDatas"
|
:data="moduleTreeDatas[modIndex].children"
|
||||||
|
current-node-key
|
||||||
node-key="id"
|
node-key="id"
|
||||||
|
:props="defaultProps"
|
||||||
default-expand-all
|
default-expand-all
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
|
:highlight-current="false"
|
||||||
|
style="background: transparent;color: #fff;"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="tabs-module-card-button">
|
||||||
|
<div style="display: flex; justify-content: center;margin-top: 10px;">
|
||||||
|
<el-button type="primary" size="medium" @click="showScoreRule(mod.moduleScoreRuleId)">评分表</el-button>
|
||||||
|
<el-button type="primary" size="medium" @click="beginExercise(mod.customModuleId)">开始训练</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top: 10px;">
|
|
||||||
<div style="padding:10px"> 评分规则:</div>
|
|
||||||
<el-table
|
|
||||||
:data="ruleData"
|
|
||||||
border
|
|
||||||
show-summary
|
|
||||||
:summary-method="getSummaries"
|
|
||||||
style="width: 100%;margin-top: 10px;"
|
|
||||||
>
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<el-table-column label="描述" prop="text" />
|
|
||||||
<el-table-column label="作业程序" prop="worker" />
|
|
||||||
<el-table-column label="分值" prop="score" width="50" />
|
|
||||||
<el-table-column label="评分标准" prop="criteria" />
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
<el-button type="primary" size="medium" style="margin-top: 10px;" @click="beginExercise(mod.customModuleId)">开始训练</el-button>
|
|
||||||
</el-tab-pane>
|
|
||||||
</template>
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
<score-rule ref="scoreRule" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -49,25 +44,30 @@
|
|||||||
<script>
|
<script>
|
||||||
import paperList from './paperList';
|
import paperList from './paperList';
|
||||||
import drapLeft from '@/views/components/drapLeft/index';
|
import drapLeft from '@/views/components/drapLeft/index';
|
||||||
|
import ScoreRule from './scoreRule';
|
||||||
import { getPaperDetail, getContextScoreDetail} from '@/api/contest';
|
import { getPaperDetail, getContextScoreDetail} from '@/api/contest';
|
||||||
let id = 1;
|
let id = 1;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TrainingPlatform',
|
name: 'ContestList',
|
||||||
components: {
|
components: {
|
||||||
paperList,
|
paperList,
|
||||||
drapLeft
|
drapLeft,
|
||||||
|
ScoreRule
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
widthLeft: 380,
|
widthLeft: 380,
|
||||||
paperName:'试卷',
|
paperName:'试卷',
|
||||||
paperId:'',
|
paperId:'',
|
||||||
activeModuleName:'',
|
activeModuleName:'detail',
|
||||||
moduleList:[],
|
moduleList:[],
|
||||||
moduleTreeDatas:[],
|
moduleTreeDatas:[],
|
||||||
taskTreeDatas:[],
|
taskTreeDatas:[],
|
||||||
ruleData:[]
|
ruleData:[],
|
||||||
|
defaultProps: {
|
||||||
|
disabled: true
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -84,7 +84,6 @@ export default {
|
|||||||
this.paperId = paper.id;
|
this.paperId = paper.id;
|
||||||
getPaperDetail(paper.id).then((res) => {
|
getPaperDetail(paper.id).then((res) => {
|
||||||
this.moduleList = res.data.moduleVo.modules;
|
this.moduleList = res.data.moduleVo.modules;
|
||||||
this.activeModuleName = this.moduleList[0].customModuleId + '';
|
|
||||||
this.moduleTreeDatas = this.moduleList.map(moduleItem=>{
|
this.moduleTreeDatas = this.moduleList.map(moduleItem=>{
|
||||||
let children = [];
|
let children = [];
|
||||||
if (moduleItem.group.length) {
|
if (moduleItem.group.length) {
|
||||||
@ -108,41 +107,12 @@ export default {
|
|||||||
this.$message.error(error.message);
|
this.$message.error(error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleTabClick(tab) {
|
showScoreRule(moduleScoreRuleId) {
|
||||||
const moduleItem = this.moduleTreeDatas.find((item)=>item.customModuleId == tab.name);
|
this.$refs.scoreRule.doShow(moduleScoreRuleId);
|
||||||
this.taskTreeDatas = moduleItem.children;
|
|
||||||
getContextScoreDetail(moduleItem.moduleScoreRuleId).then(res => {
|
|
||||||
this.ruleData = res.data.rule ? res.data.rule.units : [];
|
|
||||||
}).catch(() => { this.ruleData = []; });
|
|
||||||
},
|
},
|
||||||
beginExercise(moduleId) {
|
beginExercise(moduleId) {
|
||||||
this.$router.push({path: '/contest/detail', query:{paperId:this.paperId, moduleId }});
|
this.$router.push({path: '/contest/detail', query:{paperId:this.paperId, moduleId }});
|
||||||
},
|
},
|
||||||
getSummaries(param) {
|
|
||||||
const { columns, data } = param;
|
|
||||||
const sums = [];
|
|
||||||
columns.forEach((column, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
sums[index] = '总分';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (index === 3) {
|
|
||||||
const values = data.map(item => Number(item[column.property]));
|
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
|
||||||
const value = Number(curr);
|
|
||||||
if (!isNaN(value)) {
|
|
||||||
return prev + curr;
|
|
||||||
} else {
|
|
||||||
return prev;
|
|
||||||
}
|
|
||||||
}, 0);
|
|
||||||
sums[index] += '';
|
|
||||||
} else {
|
|
||||||
sums[index] = '/';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return sums;
|
|
||||||
},
|
|
||||||
transformTree(data) {
|
transformTree(data) {
|
||||||
const result = {label:data.name, children:[], id:id++, type:'taskCatalog' };
|
const result = {label:data.name, children:[], id:id++, type:'taskCatalog' };
|
||||||
if (data.group.length) {
|
if (data.group.length) {
|
||||||
@ -157,19 +127,23 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.trainingPlatform {
|
.contestPlatform {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
.contestPaperList {
|
||||||
.trainingPubMapList {
|
|
||||||
position:absolute;
|
position:absolute;
|
||||||
left:0;
|
left:0;
|
||||||
top:0;
|
top:0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #00172E;
|
background: #00172E;
|
||||||
}
|
}
|
||||||
|
.module-box{
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
background: #00172E;
|
||||||
.tabs-box{
|
.tabs-box{
|
||||||
height: calc(100% - 30px);
|
height: calc(100% - 30px);
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
@ -183,6 +157,55 @@ export default {
|
|||||||
}
|
}
|
||||||
&::-webkit-scrollbar-track{
|
&::-webkit-scrollbar-track{
|
||||||
background: #06284a;
|
background: #06284a;
|
||||||
|
}
|
||||||
|
.tabs-module{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
color: #fff;
|
||||||
|
.tabs-module-card{
|
||||||
|
position: relative;
|
||||||
|
width:49%;
|
||||||
|
margin-top: 10px;
|
||||||
|
padding:10px;
|
||||||
|
background: transparent;
|
||||||
|
color: #fff;
|
||||||
|
.tabs-module-card-button{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-card{
|
||||||
|
border: solid 1px #01468B;
|
||||||
|
}
|
||||||
|
/deep/{
|
||||||
|
.el-tree-node__content{
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
.el-tabs__nav-scroll{
|
||||||
|
background: #00172E;
|
||||||
|
}
|
||||||
|
.el-tabs--border-card>.el-tabs__header .el-tabs__item{
|
||||||
|
color: #fff;
|
||||||
|
border: solid 1px #01468B;
|
||||||
|
}
|
||||||
|
.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{
|
||||||
|
background: #01468B;
|
||||||
|
}
|
||||||
|
.el-tabs--border-card{
|
||||||
|
border: solid 1px #01468B;
|
||||||
|
}
|
||||||
|
.el-table th.el-table__cell{
|
||||||
|
background-color: #01468B;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.el-table--border, .el-table--group{
|
||||||
|
border-width: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
<div id="trainingMapTree" class="left-paper-list">
|
<div id="trainingMapTree" class="left-paper-list">
|
||||||
<div class="paperListName">
|
<div class="paperListName">
|
||||||
<el-form :inline="true" :model="formModel" class="demo-form-inline">
|
<el-form :inline="true" :model="formModel" class="demo-form-inline">
|
||||||
<el-form-item label="组别" :label-style="{ color: 'red' }">
|
<el-form-item label="组别">
|
||||||
<el-select v-model="formModel.group" placeholder="请选择" clearable>
|
<el-select v-model="formModel.group" placeholder="请选择" clearable style="width: 120px;" @change="queryPaper">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in groupOption"
|
v-for="item in groupOption"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@ -14,7 +14,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="赛季">
|
<el-form-item label="赛季">
|
||||||
<el-select v-model="formModel.seasonId" placeholder="请选择" clearable>
|
<el-select v-model="formModel.seasonId" placeholder="请选择" clearable style="width: 120px;" @change="filterPaper">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in seasonOptions"
|
v-for="item in seasonOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@ -22,9 +22,6 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" size="medium" @click="queryPaper">查询</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -35,7 +32,7 @@
|
|||||||
active-text-color="#ffd04b"
|
active-text-color="#ffd04b"
|
||||||
>
|
>
|
||||||
<template v-for="(paper,paperIndex) in paperList">
|
<template v-for="(paper,paperIndex) in paperList">
|
||||||
<el-menu-item :key="paperIndex" :index="paper.id+''" @click="showPaperDetail(paper)">
|
<el-menu-item v-show="!formModel.seasonId||paper.seasonId==formModel.seasonId" :key="paperIndex" :index="paper.id+''" @click="showPaperDetail(paper)">
|
||||||
{{ paper.name }}
|
{{ paper.name }}
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</template>
|
</template>
|
||||||
@ -46,7 +43,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { queryContestSeasonPaged, getPaperList} from '@/api/contest';
|
import { queryContestSeasonPaged, getPaperList} from '@/api/contest';
|
||||||
export default {
|
export default {
|
||||||
name: 'DemonList',
|
name: 'PaperList',
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -70,21 +67,34 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
queryContestSeasonPaged({pageSize:999}).then((res) => {
|
|
||||||
this.seasonOptions = res.data.list;
|
|
||||||
});
|
|
||||||
getPaperList({ group:'GZ', pageSize:999}).then((res) => {
|
getPaperList({ group:'GZ', pageSize:999}).then((res) => {
|
||||||
this.paperList = res.data.list;
|
this.paperList = res.data.list;
|
||||||
this.defaultIndex = this.paperList[0].id + '';
|
this.defaultIndex = this.paperList[0].id + '';
|
||||||
this.$emit('changeModuleData', this.paperList[0]);
|
this.$emit('changeModuleData', this.paperList[0]);
|
||||||
});
|
});
|
||||||
|
this.querySeason();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
queryPaper() {
|
queryPaper() {
|
||||||
const data = Object.assign({pageSize:999}, this.formModel);
|
getPaperList({ group:this.formModel.group, pageSize:999}).then((res) => {
|
||||||
getPaperList(data).then((res) => {
|
|
||||||
this.paperList = res.data.list;
|
this.paperList = res.data.list;
|
||||||
});
|
});
|
||||||
|
this.querySeason();
|
||||||
|
},
|
||||||
|
querySeason() {
|
||||||
|
queryContestSeasonPaged({pageSize:999, group:this.formModel.group }).then((res) => {
|
||||||
|
this.seasonOptions = res.data.list;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
filterPaper() {
|
||||||
|
if (this.formModel.seasonId) {
|
||||||
|
const paper = this.paperList.find(paper=>paper.seasonId == this.formModel.seasonId);
|
||||||
|
this.defaultIndex = paper.id + '';
|
||||||
|
this.$emit('changeModuleData', paper);
|
||||||
|
} else {
|
||||||
|
this.defaultIndex = this.paperList[0].id + '';
|
||||||
|
this.$emit('changeModuleData', this.paperList[0]);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
showPaperDetail(paper) {
|
showPaperDetail(paper) {
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-dialogDrag title="评分表" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
<el-dialog v-dialogDrag title="评分表" :visible.sync="dialogVisible" width="800px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||||
<el-table
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="loading"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
border
|
||||||
show-summary
|
show-summary
|
||||||
|
default-expand-all
|
||||||
|
row-key="id"
|
||||||
:summary-method="getSummaries"
|
:summary-method="getSummaries"
|
||||||
|
:tree-props="{children: 'children'}"
|
||||||
style="width: 100%;margin-top: 10px;"
|
style="width: 100%;margin-top: 10px;"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="描述" prop="text" />
|
<el-table-column label="描述" prop="name" />
|
||||||
<el-table-column label="作业程序" prop="worker" />
|
|
||||||
<el-table-column label="分值" prop="score" width="50" />
|
|
||||||
<el-table-column label="评分标准" prop="criteria" />
|
<el-table-column label="评分标准" prop="criteria" />
|
||||||
|
<el-table-column label="分值" prop="score" width="50" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@ -23,39 +27,34 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
dialogVisible: false
|
dialogVisible: false,
|
||||||
|
loading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doShow(index, row) {
|
doShow(id) {
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
getContextScoreDetail(this.$route.query.id).then(resp => {
|
this.loading = true;
|
||||||
|
getContextScoreDetail(id).then(resp => {
|
||||||
this.tableData = resp.data.rule ? resp.data.rule.units : [];
|
this.tableData = resp.data.rule ? resp.data.rule.units : [];
|
||||||
}).catch(() => { this.$message.error('初始化数据失败!'); });
|
this.loading = false;
|
||||||
|
}).catch(() => { this.$message.error('初始化数据失败!'); this.loading = false; this.tableData = []; });
|
||||||
},
|
},
|
||||||
getSummaries(param) {
|
handleClose() {
|
||||||
const { columns, data } = param;
|
this.dialogVisible = false;
|
||||||
const sums = [];
|
},
|
||||||
columns.forEach((column, index) => {
|
handleSummaries(data, sums) {
|
||||||
if (index === 0) {
|
data.forEach(item => {
|
||||||
sums[index] = '总分';
|
sums[3] += Number(item.score);
|
||||||
return;
|
if (item.children && item.children.length) {
|
||||||
}
|
this.handleSummaries(item.children, sums);
|
||||||
if (index === 3) {
|
|
||||||
const values = data.map(item => Number(item[column.property]));
|
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
|
||||||
const value = Number(curr);
|
|
||||||
if (!isNaN(value)) {
|
|
||||||
return prev + curr;
|
|
||||||
} else {
|
|
||||||
return prev;
|
|
||||||
}
|
|
||||||
}, 0);
|
|
||||||
sums[index] += '';
|
|
||||||
} else {
|
|
||||||
sums[index] = '/';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
getSummaries(param) {
|
||||||
|
const { data } = param;
|
||||||
|
const sums = ['总分', '/', '/', 0, '/'];
|
||||||
|
this.handleSummaries(data, sums);
|
||||||
return sums;
|
return sums;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,16 +7,6 @@
|
|||||||
<el-form-item label="试卷描述:" prop="desc">
|
<el-form-item label="试卷描述:" prop="desc">
|
||||||
<el-input v-model="formModel.desc" type="textarea" style="width:350px;" />
|
<el-input v-model="formModel.desc" type="textarea" style="width:350px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="组别:" prop="group">
|
|
||||||
<el-select v-model="formModel.group" placeholder="请选择" style="width:350px;">
|
|
||||||
<el-option
|
|
||||||
v-for="item in groupOption"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="所属赛季:" prop="seasonId">
|
<el-form-item label="所属赛季:" prop="seasonId">
|
||||||
<el-select v-model="formModel.seasonId" placeholder="请选择" style="width:350px;">
|
<el-select v-model="formModel.seasonId" placeholder="请选择" style="width:350px;">
|
||||||
<el-option
|
<el-option
|
||||||
@ -45,17 +35,9 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
name: '', // 试卷名称
|
name: '', // 试卷名称
|
||||||
desc: '', // 任务描述
|
desc: '', // 任务描述
|
||||||
seasonId: '', // 所属赛季id
|
seasonId: '' // 所属赛季id
|
||||||
group:'' // 高职和中职
|
|
||||||
},
|
},
|
||||||
seasonOptions:[],
|
seasonOptions:[],
|
||||||
groupOption:[{
|
|
||||||
value: 'ZZ',
|
|
||||||
label: '中职'
|
|
||||||
}, {
|
|
||||||
value: 'GZ',
|
|
||||||
label: '高职'
|
|
||||||
}],
|
|
||||||
loading: false
|
loading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -68,9 +50,6 @@ export default {
|
|||||||
desc: [
|
desc: [
|
||||||
{ required: true, message: '请输入试卷描述', trigger: 'blur' }
|
{ required: true, message: '请输入试卷描述', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
group: [
|
|
||||||
{ required: true, message: '请选择试卷所属赛季', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
seasonId: [
|
seasonId: [
|
||||||
{ required: true, message: '请选择试卷所属赛季', trigger: 'blur' }
|
{ required: true, message: '请选择试卷所属赛季', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
@ -83,7 +62,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
doShow(row) {
|
doShow(row) {
|
||||||
queryContestSeasonPaged().then((res) => {
|
queryContestSeasonPaged({pageSize:999}).then((res) => {
|
||||||
this.seasonOptions = res.data.list;
|
this.seasonOptions = res.data.list;
|
||||||
});
|
});
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
@ -92,13 +71,11 @@ export default {
|
|||||||
this.formModel.name = row.name;
|
this.formModel.name = row.name;
|
||||||
this.formModel.desc = row.desc;
|
this.formModel.desc = row.desc;
|
||||||
this.formModel.seasonId = row.seasonId;
|
this.formModel.seasonId = row.seasonId;
|
||||||
this.formModel.group = row.group;
|
|
||||||
} else {
|
} else {
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
group:'',
|
|
||||||
seasonId: ''
|
seasonId: ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ export default {
|
|||||||
doShow(type, data, isAdd) {
|
doShow(type, data, isAdd) {
|
||||||
this.isAdd = isAdd;
|
this.isAdd = isAdd;
|
||||||
if (type == 'module') {
|
if (type == 'module') {
|
||||||
queryContextScorePaged().then((res) => {
|
queryContextScorePaged({pageSize:999}).then((res) => {
|
||||||
this.bindRuleOptions = res.data.list;
|
this.bindRuleOptions = res.data.list;
|
||||||
});
|
});
|
||||||
this.editType = 'module';
|
this.editType = 'module';
|
||||||
|
@ -51,10 +51,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
doShow(row) {
|
doShow(row) {
|
||||||
queryContextScorePaged().then((res) => {
|
queryContextScorePaged({pageSize:999}).then((res) => {
|
||||||
this.bindRuleOptions = res.data.list;
|
this.bindRuleOptions = res.data.list;
|
||||||
});
|
});
|
||||||
queryContestSencePaged().then((res) => {
|
queryContestSencePaged({pageSize:999}).then((res) => {
|
||||||
this.bindSceneOptions = res.data.list;
|
this.bindSceneOptions = res.data.list;
|
||||||
});
|
});
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
|
@ -91,9 +91,6 @@ export default {
|
|||||||
this.$message.error(error.message);
|
this.$message.error(error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryChildrenTask() {
|
|
||||||
console.log(111);
|
|
||||||
},
|
|
||||||
creatTask() {
|
creatTask() {
|
||||||
this.$refs.addEditTask.doShow();
|
this.$refs.addEditTask.doShow();
|
||||||
},
|
},
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
|||||||
deleteContextScore(row.id).then(resp => {
|
deleteContextScore(row.id).then(resp => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(`删除删除竞赛评分规则失败: ${error.message}`);
|
this.$message.error(`删除竞赛评分规则失败: ${error.message}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="130px">
|
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="130px">
|
||||||
<el-form-item label="单元描述:" prop="text">
|
<el-form-item label="项目:" prop="name">
|
||||||
<el-input v-model="formModel.text" style="width: 200px;" />
|
<el-input v-model="formModel.name" autosize type="textarea" style="width: 200px;" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="作业程序:" prop="worker">
|
|
||||||
<el-input v-model="formModel.worker" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="作业程序:" prop="content">-->
|
||||||
|
<!-- <el-input v-model="formModel.content" style="width: 200px;" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
<!-- <el-form-item label="场景步骤ID:" prop="sceneStepId">-->
|
<!-- <el-form-item label="场景步骤ID:" prop="sceneStepId">-->
|
||||||
<!-- <el-input v-model="formModel.sceneStepId" style="width: 200px;" />-->
|
<!-- <el-input v-model="formModel.sceneStepId" style="width: 200px;" />-->
|
||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="评分标准:" prop="criteria">
|
||||||
|
<el-input v-model="formModel.criteria" autosize type="textarea" style="width: 200px;" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="单元分值:" prop="score">
|
<el-form-item label="单元分值:" prop="score">
|
||||||
<el-input-number v-model="formModel.score" style="width: 200px;" :min="0" />
|
<el-input-number v-model="formModel.score" style="width: 200px;" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="评分标准:" prop="criteria">
|
|
||||||
<el-input v-model="formModel.criteria" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||||
@ -30,27 +31,21 @@ export default {
|
|||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
formModel: {
|
formModel: {
|
||||||
text: '',
|
id: '',
|
||||||
worker: '',
|
name: '',
|
||||||
score: 0,
|
score: 0,
|
||||||
criteria: '',
|
criteria: '',
|
||||||
sceneStepId: ''
|
children: []
|
||||||
},
|
},
|
||||||
index: -1,
|
loading: false,
|
||||||
loading: false
|
type: 'edit'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rules() {
|
rules() {
|
||||||
const crules = {
|
const crules = {
|
||||||
text: [
|
name: [
|
||||||
{ required: true, message: '请输入单元描述', trigger: 'blur' }
|
{ required: true, message: '请输入项目', trigger: 'blur' }
|
||||||
],
|
|
||||||
worker: [
|
|
||||||
{ required: true, message: '请输入作业程序', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
criteria: [
|
|
||||||
{ required: true, message: '请输入评分标准', trigger: 'blur' }
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return crules;
|
return crules;
|
||||||
@ -60,26 +55,26 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
doShow(index, row) {
|
doShow(row, type) {
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
|
this.type = type;
|
||||||
if (row) {
|
if (row) {
|
||||||
this.index = index;
|
this.formModel.id = row.id;
|
||||||
this.formModel.text = row.text;
|
this.formModel.name = row.name;
|
||||||
this.formModel.worker = row.worker;
|
|
||||||
this.formModel.score = row.score;
|
this.formModel.score = row.score;
|
||||||
this.formModel.criteria = row.criteria;
|
this.formModel.criteria = row.criteria;
|
||||||
this.formModel.sceneStepId = row.sceneStepId;
|
this.formModel.children = row.children;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
|
this.type = 'edit';
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
text: '',
|
id: '',
|
||||||
worker: '',
|
name: '',
|
||||||
score: 0,
|
score: 0,
|
||||||
criteria: '',
|
criteria: '',
|
||||||
sceneStepId: ''
|
children: []
|
||||||
};
|
};
|
||||||
this.index = -1;
|
|
||||||
this.$refs.ruleForm.resetFields();
|
this.$refs.ruleForm.resetFields();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -89,7 +84,13 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const data = Object.assign({}, this.formModel);
|
const data = Object.assign({}, this.formModel);
|
||||||
this.$emit('addData', this.index, data);
|
if (this.type === 'edit') {
|
||||||
|
this.$emit('editData', data);
|
||||||
|
} else if (this.type === 'add') {
|
||||||
|
this.$emit('addData', data);
|
||||||
|
} else {
|
||||||
|
this.$emit('charuData', data);
|
||||||
|
}
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -12,24 +12,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
|
ref="table"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
border
|
||||||
show-summary
|
show-summary
|
||||||
|
default-expand-all
|
||||||
|
row-key="id"
|
||||||
:summary-method="getSummaries"
|
:summary-method="getSummaries"
|
||||||
|
:tree-props="{children: 'children'}"
|
||||||
style="width: 100%;margin-top: 10px;"
|
style="width: 100%;margin-top: 10px;"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="描述" prop="text" />
|
<el-table-column label="项目" prop="name" />
|
||||||
<el-table-column label="作业程序" prop="worker" />
|
|
||||||
<el-table-column label="分值" prop="score" width="50" />
|
|
||||||
<el-table-column label="评分标准" prop="criteria" />
|
<el-table-column label="评分标准" prop="criteria" />
|
||||||
<!-- <el-table-column label="场景步骤ID" prop="sceneStepId" width="100">-->
|
<el-table-column label="分值" prop="score" width="50">
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <span>{{ scope.row.sceneStepId === 0? '': scope.row.sceneStepId }}</span>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<el-table-column label="操作" width="150">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.score === 0? '': scope.row.score }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="场景步骤ID" prop="sceneStepId" width="100">-->
|
||||||
|
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
<el-table-column label="操作" width="250">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="handleCharu(scope.$index,scope.row)"
|
||||||
|
>插入</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleEdit(scope.$index,scope.row)"
|
@click="handleEdit(scope.$index,scope.row)"
|
||||||
@ -37,13 +46,13 @@
|
|||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.$index, scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
<detail-add ref="detailAdd" @addData="addData" />
|
<detail-add ref="detailAdd" @addData="addData" @editData="editData" @charuData="charuData" />
|
||||||
<import-scene ref="importScene" @importData="importData" />
|
<import-scene ref="importScene" @importData="importData" />
|
||||||
<select-scene ref="selectScene" @selectSceneId="selectSceneId" />
|
<select-scene ref="selectScene" @selectSceneId="selectSceneId" />
|
||||||
</div>
|
</div>
|
||||||
@ -63,16 +72,27 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData:[]
|
tableData:[],
|
||||||
|
chaData: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleData(list, index) {
|
||||||
|
list.forEach((elem, i) => {
|
||||||
|
elem.id = index + '_' + i;
|
||||||
|
if (elem.children && elem.children.length) {
|
||||||
|
this.handleData(elem.children, elem.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
getData() {
|
getData() {
|
||||||
getContextScoreDetail(this.$route.query.id).then(resp => {
|
getContextScoreDetail(this.$route.query.id).then(resp => {
|
||||||
this.tableData = resp.data.rule ? resp.data.rule.units : [];
|
const data = resp.data.rule ? resp.data.rule.units : [];
|
||||||
|
this.handleData(data, '1');
|
||||||
|
this.tableData = data;
|
||||||
}).catch(() => { this.$message.error('初始化数据失败!'); });
|
}).catch(() => { this.$message.error('初始化数据失败!'); });
|
||||||
},
|
},
|
||||||
goBack() {
|
goBack() {
|
||||||
@ -84,8 +104,28 @@ export default {
|
|||||||
.then(() => { this.$message.success('保存评分规则单元成功!'); })
|
.then(() => { this.$message.success('保存评分规则单元成功!'); })
|
||||||
.catch(() => { this.$message.error('保存评分规则单元失败!'); });
|
.catch(() => { this.$message.error('保存评分规则单元失败!'); });
|
||||||
},
|
},
|
||||||
|
deleteTreeData(id, list) {
|
||||||
|
list.find((ele, i) => {
|
||||||
|
if (id === ele.id) {
|
||||||
|
list.splice(i, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (ele.children && ele.children.length) {
|
||||||
|
this.deleteTreeData(id, ele.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(data) {
|
||||||
|
this.deleteTreeData(data.id, this.tableData);
|
||||||
|
this.handleData(this.tableData, '1');
|
||||||
|
this.tableData = [...this.tableData];
|
||||||
|
},
|
||||||
|
handleCharu(index, data) {
|
||||||
|
this.chaData = data;
|
||||||
|
this.$refs.detailAdd.doShow('', 'charu');
|
||||||
|
},
|
||||||
handleEdit(index, data) {
|
handleEdit(index, data) {
|
||||||
this.$refs.detailAdd.doShow(index, data);
|
this.$refs.detailAdd.doShow(data, 'edit');
|
||||||
},
|
},
|
||||||
doClear() {
|
doClear() {
|
||||||
this.tableData = [];
|
this.tableData = [];
|
||||||
@ -102,38 +142,48 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
doAdd() {
|
doAdd() {
|
||||||
this.$refs.detailAdd.doShow();
|
this.$refs.detailAdd.doShow('', 'add');
|
||||||
},
|
},
|
||||||
addData(index, data) {
|
handleEditData(data, list) {
|
||||||
if (index > -1) {
|
list.find((ele, i) => {
|
||||||
this.$set(this.tableData, index, data);
|
if (data.id === ele.id) {
|
||||||
} else {
|
Object.assign(ele, data);
|
||||||
this.tableData.push(data);
|
return true;
|
||||||
}
|
}
|
||||||
},
|
if (ele.children && ele.children.length) {
|
||||||
getSummaries(param) {
|
this.handleEditData(data, ele.children);
|
||||||
const { columns, data } = param;
|
|
||||||
const sums = [];
|
|
||||||
columns.forEach((column, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
sums[index] = '总分';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (index === 3) {
|
|
||||||
const values = data.map(item => Number(item[column.property]));
|
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
|
||||||
const value = Number(curr);
|
|
||||||
if (!isNaN(value)) {
|
|
||||||
return prev + curr;
|
|
||||||
} else {
|
|
||||||
return prev;
|
|
||||||
}
|
|
||||||
}, 0);
|
|
||||||
sums[index] += '';
|
|
||||||
} else {
|
|
||||||
sums[index] = '/';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
editData(data) {
|
||||||
|
this.handleEditData(data, this.tableData);
|
||||||
|
this.tableData = [...this.tableData];
|
||||||
|
},
|
||||||
|
addData(data) {
|
||||||
|
this.tableData.push(data);
|
||||||
|
this.handleData(this.tableData, '1');
|
||||||
|
},
|
||||||
|
charuData(data) {
|
||||||
|
if ( this.chaData.children) {
|
||||||
|
this.chaData.children.push(data);
|
||||||
|
} else {
|
||||||
|
this.$set(this.chaData, 'children', [data]);
|
||||||
|
}
|
||||||
|
this.handleData(this.tableData, '1');
|
||||||
|
this.tableData = [...this.tableData];
|
||||||
|
},
|
||||||
|
handleSummaries(data, sums) {
|
||||||
|
data.forEach(item => {
|
||||||
|
sums[3] += Number(item.score);
|
||||||
|
if (item.children && item.children.length) {
|
||||||
|
this.handleSummaries(item.children, sums);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getSummaries(param) {
|
||||||
|
const { data } = param;
|
||||||
|
const sums = ['总分', '/', '/', 0, '/'];
|
||||||
|
this.handleSummaries(data, sums);
|
||||||
return sums;
|
return sums;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,6 +232,9 @@ export default {
|
|||||||
}
|
}
|
||||||
} else if (this.projectDevice) {
|
} else if (this.projectDevice) {
|
||||||
this.logout();
|
this.logout();
|
||||||
|
} else if (this.$route.query.nowKey) {
|
||||||
|
const query = { paperId: this.$route.query.paperId, moduleId: this.$route.query.moduleId, nowKey: +this.$route.query.nowKey + 1 };
|
||||||
|
this.$router.replace({ path:'/contest/detail', query });
|
||||||
} else {
|
} else {
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||||
|
// this.loadTraining({ id: 12483 });
|
||||||
|
},
|
||||||
'$store.state.trainingNew.trainingDetail': function(val) {
|
'$store.state.trainingNew.trainingDetail': function(val) {
|
||||||
this.initAdjacentTraining();
|
this.initAdjacentTraining();
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user