Skip to content

Commit

Permalink
#532 作业编排关系图优化,按状态分类
Browse files Browse the repository at this point in the history
  • Loading branch information
allen8203 committed Dec 17, 2018
1 parent 18950c2 commit 1eb573b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,6 @@ export default {
},
},
computed: {
existJobTypes() {
const existJobArray = [];
this.arrangeLayoutInfo.levels.forEach((ele) => {
ele.forEach((ele2) => {
existJobArray.push(ele2.type);
});
});
return Array.from(new Set(existJobArray));
},
optionInfo() {
const resultInfo = {
links: [],
Expand All @@ -118,7 +109,7 @@ export default {
this.arrangeLayoutInfo.levels.forEach((ele) => {
const levelItem = ele.map((obj) => {
const rObj = { ...obj };
rObj.category = this.$map.jobTypeMap[obj.type];
rObj.category = this.$map.jobStatusMap[obj.jobStatus];
return rObj;
});
relateDatas.push(levelItem);
Expand All @@ -140,11 +131,19 @@ export default {
}
return rObj;
});
resultInfo.categories = this.existJobTypes.map((obj) => {
const rObj = {};
rObj.name = this.$map.jobTypeMap[obj];
return rObj;
});
resultInfo.categories = [{
name: this.$map.jobStatusMap.READY,
itemStyle: { color: '#487bb0' },
}, {
name: this.$map.jobStatusMap.RUNNING,
itemStyle: { color: '#23ad07' },
}, {
name: this.$map.jobStatusMap.STOPPING,
itemStyle: { color: '#E6A23C' },
}, {
name: this.$map.jobStatusMap.STOPPED,
itemStyle: { color: '#808080' },
}];
return resultInfo;
},
},
Expand Down
8 changes: 1 addition & 7 deletions saturn-console-web/src/pages/job_list/job_overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</el-table-column>
<el-table-column label="状态" prop="status" width="90px">
<template slot-scope="scope">
<el-tag :type="statusTag[scope.row.status]" close-transition>{{translateStatus[scope.row.status]}}</el-tag>
<el-tag :type="statusTag[scope.row.status]" close-transition>{{$map.jobStatusMap[scope.row.status]}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="description" show-overflow-tooltip label="描述">
Expand Down Expand Up @@ -184,12 +184,6 @@ export default {
STOPPING: 'warning',
STOPPED: '',
},
translateStatus: {
READY: '已就绪',
RUNNING: '运行中',
STOPPING: '停止中',
STOPPED: '已停止',
},
multipleSelection: [],
};
},
Expand Down
6 changes: 6 additions & 0 deletions saturn-console-web/src/utils/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ export default {
PASSIVE_JAVA_JOB: 'JAVA被动',
PASSIVE_SHELL_JOB: 'SHELL被动',
},
jobStatusMap: {
READY: '已就绪',
RUNNING: '运行中',
STOPPING: '停止中',
STOPPED: '已停止',
},
};

0 comments on commit 1eb573b

Please sign in to comment.