From 1eb573b0a8874c9566a86d05f84a7ced41104f08 Mon Sep 17 00:00:00 2001
From: gier123 <782830164@qq.com>
Date: Mon, 17 Dec 2018 16:41:48 +0800
Subject: [PATCH] =?UTF-8?q?#532=20=E4=BD=9C=E4=B8=9A=E7=BC=96=E6=8E=92?=
=?UTF-8?q?=E5=85=B3=E7=B3=BB=E5=9B=BE=E4=BC=98=E5=8C=96=EF=BC=8C=E6=8C=89?=
=?UTF-8?q?=E7=8A=B6=E6=80=81=E5=88=86=E7=B1=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/dialog/arrange_layout_dialog.vue | 29 +++++++++----------
.../src/pages/job_list/job_overview.vue | 8 +----
saturn-console-web/src/utils/map.js | 6 ++++
3 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/saturn-console-web/src/components/common/dialog/arrange_layout_dialog.vue b/saturn-console-web/src/components/common/dialog/arrange_layout_dialog.vue
index dfa811ef5..a0948550e 100644
--- a/saturn-console-web/src/components/common/dialog/arrange_layout_dialog.vue
+++ b/saturn-console-web/src/components/common/dialog/arrange_layout_dialog.vue
@@ -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: [],
@@ -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);
@@ -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;
},
},
diff --git a/saturn-console-web/src/pages/job_list/job_overview.vue b/saturn-console-web/src/pages/job_list/job_overview.vue
index 95013048a..2a1b2ef3b 100644
--- a/saturn-console-web/src/pages/job_list/job_overview.vue
+++ b/saturn-console-web/src/pages/job_list/job_overview.vue
@@ -84,7 +84,7 @@
- {{translateStatus[scope.row.status]}}
+ {{$map.jobStatusMap[scope.row.status]}}
@@ -184,12 +184,6 @@ export default {
STOPPING: 'warning',
STOPPED: '',
},
- translateStatus: {
- READY: '已就绪',
- RUNNING: '运行中',
- STOPPING: '停止中',
- STOPPED: '已停止',
- },
multipleSelection: [],
};
},
diff --git a/saturn-console-web/src/utils/map.js b/saturn-console-web/src/utils/map.js
index 393aca48f..97ef3ac8f 100644
--- a/saturn-console-web/src/utils/map.js
+++ b/saturn-console-web/src/utils/map.js
@@ -19,4 +19,10 @@ export default {
PASSIVE_JAVA_JOB: 'JAVA被动',
PASSIVE_SHELL_JOB: 'SHELL被动',
},
+ jobStatusMap: {
+ READY: '已就绪',
+ RUNNING: '运行中',
+ STOPPING: '停止中',
+ STOPPED: '已停止',
+ },
};