diff --git a/src/api/contest.js b/src/api/contest.js index 7b703a883..10aaa2467 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -325,7 +325,7 @@ export function publishContextSence(data) { */ export function getTaskTree(paperId, moduleId) { return request({ - url: `/api/exercise/race/paper/page/${paperId}/module/${moduleId}/task`, + url: `/api/exercise/race/paper/${paperId}/module/${moduleId}/task`, method: 'get' }); } diff --git a/src/views/contest/contestDetail.vue b/src/views/contest/contestDetail.vue index ea53db89e..702981fe7 100644 --- a/src/views/contest/contestDetail.vue +++ b/src/views/contest/contestDetail.vue @@ -3,7 +3,7 @@
-
{{ data.groupName||data.name }}
+
{{ data.name }}
@@ -23,7 +23,7 @@
- +
{{ nowData.name }}
@@ -90,109 +90,31 @@ export default { hasDeviceManage: false, 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() { // 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 => { - + 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('加载数据失败!')); }, methods: { + handleData(data, index) { + data.forEach((elem, i) => { + elem.index = index + '_' + i; + if (elem.children) { + this.handleData(elem.children, index + 1); + } + }); + }, handleChange(data, node) { node.isCurrent = false; this.$set(node, 'isCurrent', false); @@ -200,7 +122,7 @@ export default { }, eachTask(list, data) { data.forEach(ele => { - if (ele.isTask) { + if (ele.nodeType === 'TASK') { list.push(ele); } if (ele.children) { @@ -231,6 +153,12 @@ export default { diff --git a/src/views/contest/scoreRule.vue b/src/views/contest/scoreRule.vue index aa4a3f42d..55e0efe71 100644 --- a/src/views/contest/scoreRule.vue +++ b/src/views/contest/scoreRule.vue @@ -1,10 +1,14 @@