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 @@ diff --git a/src/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage.vue b/src/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage.vue index c2bf6d560..2e556f22d 100644 --- a/src/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage.vue +++ b/src/views/contestDataManage/contestTaskScoreManage/ContestTaskScoreManage.vue @@ -95,7 +95,7 @@ export default { deleteContextScore(row.id).then(resp => { this.reloadTable(); }).catch(error => { - this.$message.error(`删除删除竞赛评分规则失败: ${error.message}`); + this.$message.error(`删除竞赛评分规则失败: ${error.message}`); }); }); } diff --git a/src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue b/src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue index 71484ef01..8f180318b 100644 --- a/src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue +++ b/src/views/contestDataManage/contestTaskScoreManage/detailAdd.vue @@ -1,11 +1,11 @@ - - + + - - + + @@ -30,8 +30,8 @@ export default { return { dialogVisible: false, formModel: { - text: '', - worker: '', + name: '', + content: '', score: 0, criteria: '', sceneStepId: '', @@ -45,10 +45,10 @@ export default { computed: { rules() { const crules = { - text: [ + name: [ { required: true, message: '请输入单元描述', trigger: 'blur' } ], - worker: [ + content: [ { required: true, message: '请输入作业程序', trigger: 'blur' } ], criteria: [ @@ -67,8 +67,8 @@ export default { this.type = type; this.index = index; if (row) { - this.formModel.text = row.text; - this.formModel.worker = row.worker; + this.formModel.name = row.name; + this.formModel.content = row.content; this.formModel.score = row.score; this.formModel.criteria = row.criteria; this.formModel.sceneStepId = row.sceneStepId; @@ -78,8 +78,8 @@ export default { handleClose() { this.type = 'edit'; this.formModel = { - text: '', - worker: '', + name: '', + content: '', score: 0, criteria: '', sceneStepId: '', diff --git a/src/views/contestDataManage/contestTaskScoreManage/edit.vue b/src/views/contestDataManage/contestTaskScoreManage/edit.vue index f250d911b..dfaa7c397 100644 --- a/src/views/contestDataManage/contestTaskScoreManage/edit.vue +++ b/src/views/contestDataManage/contestTaskScoreManage/edit.vue @@ -16,14 +16,15 @@ :data="tableData" border show-summary - row-key="text" + default-expand-all + row-key="name" :summary-method="getSummaries" :tree-props="{children: 'children'}" style="width: 100%;margin-top: 10px;" > - - + + @@ -82,23 +83,6 @@ export default { getContextScoreDetail(this.$route.query.id).then(resp => { this.tableData = resp.data.rule ? resp.data.rule.units : []; }).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() { this.$router.go(-1);