大赛训练产品调整暂提

This commit is contained in:
fan 2024-03-01 13:53:07 +08:00
parent 126507f87f
commit 8b92ce23e4
6 changed files with 54 additions and 135 deletions

View File

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

View File

@ -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? '#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>
@ -90,109 +90,31 @@ export default {
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系统加载既定的列车运行图选取某时刻900开始模拟列车运行。',
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;
this.taskList = [];
this.eachTask(this.taskList, this.taskData);
this.nowKey = 0;
this.nowData = this.taskList[this.nowKey];
getTaskTree(this.$route.query.paperId, this.$route.query.moduleId).then(resp => { 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.eachTask(this.taskList, this.taskData);
this.nowKey = 0;
this.nowData = this.taskList[this.nowKey];
// 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);
@ -200,7 +122,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) {
@ -231,6 +153,12 @@ export default {
</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%;
@ -241,7 +169,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;
} }
@ -252,12 +180,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>

View File

@ -1,10 +1,14 @@
<template> <template>
<el-dialog v-dialogDrag v-loading="loading" title="评分表" :visible.sync="dialogVisible" width="800px" :before-close="handleClose" center :close-on-click-modal="false"> <el-dialog v-dialogDrag v-loading="loading" title="评分表" :visible.sync="dialogVisible" width="800px" :before-close="handleClose" center :close-on-click-modal="false">
<el-table <el-table
ref="table"
:data="tableData" :data="tableData"
border border
show-summary show-summary
default-expand-all
row-key="name"
: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" />

View File

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

View File

@ -1,11 +1,11 @@
<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" style="width: 200px;" />
</el-form-item> </el-form-item>
<el-form-item label="作业程序:" prop="worker"> <el-form-item label="作业程序:" prop="content">
<el-input v-model="formModel.worker" style="width: 200px;" /> <el-input v-model="formModel.content" style="width: 200px;" />
</el-form-item> </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;" />-->
@ -30,8 +30,8 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
formModel: { formModel: {
text: '', name: '',
worker: '', content: '',
score: 0, score: 0,
criteria: '', criteria: '',
sceneStepId: '', sceneStepId: '',
@ -45,10 +45,10 @@ export default {
computed: { computed: {
rules() { rules() {
const crules = { const crules = {
text: [ name: [
{ required: true, message: '请输入单元描述', trigger: 'blur' } { required: true, message: '请输入单元描述', trigger: 'blur' }
], ],
worker: [ content: [
{ required: true, message: '请输入作业程序', trigger: 'blur' } { required: true, message: '请输入作业程序', trigger: 'blur' }
], ],
criteria: [ criteria: [
@ -67,8 +67,8 @@ export default {
this.type = type; this.type = type;
this.index = index; this.index = index;
if (row) { if (row) {
this.formModel.text = row.text; this.formModel.name = row.name;
this.formModel.worker = row.worker; this.formModel.content = row.content;
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.sceneStepId = row.sceneStepId;
@ -78,8 +78,8 @@ export default {
handleClose() { handleClose() {
this.type = 'edit'; this.type = 'edit';
this.formModel = { this.formModel = {
text: '', name: '',
worker: '', content: '',
score: 0, score: 0,
criteria: '', criteria: '',
sceneStepId: '', sceneStepId: '',

View File

@ -16,14 +16,15 @@
:data="tableData" :data="tableData"
border border
show-summary show-summary
row-key="text" default-expand-all
row-key="name"
:summary-method="getSummaries" :summary-method="getSummaries"
:tree-props="{children: 'children'}" :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="content" />
<el-table-column label="分值" prop="score" width="50" /> <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="场景步骤ID" prop="sceneStepId" width="100">-->
@ -82,23 +83,6 @@ export default {
getContextScoreDetail(this.$route.query.id).then(resp => { getContextScoreDetail(this.$route.query.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('初始化数据失败!'); }); }).catch(() => { this.$message.error('初始化数据失败!'); });
this.tableData = [{
text: 'w',
worker: 'w',
score: 1,
criteria: 'w',
sceneStepId: 'w',
children: [
{
text: 'q',
worker: 'q',
score: 2,
criteria: 'q',
sceneStepId: 'q',
children: []
}
]
}];
}, },
goBack() { goBack() {
this.$router.go(-1); this.$router.go(-1);