From b13aabe5b57cf2188618badcabd46972ffb04d27 Mon Sep 17 00:00:00 2001 From: gongzijian Date: Wed, 24 Apr 2019 11:36:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=A2=9E=E5=8A=A0=E9=98=9F?= =?UTF-8?q?=E5=88=97=E7=BB=9F=E8=AE=A1=E5=91=BD=E4=BB=A4=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- escheduler-ui/.env | 2 +- .../pages/dag/_source/formModel/tasks/sql.vue | 10 +++ .../pages/index/_source/chartConfig.js | 34 +++++++- .../pages/index/_source/projectChart.vue | 81 ++++++++++--------- 4 files changed, 87 insertions(+), 40 deletions(-) diff --git a/escheduler-ui/.env b/escheduler-ui/.env index d4dcd9f473..52ce563e9b 100644 --- a/escheduler-ui/.env +++ b/escheduler-ui/.env @@ -1,6 +1,6 @@ # 后端接口地址 -API_BASE = http://192.168.220.154:12345 +API_BASE = http://192.168.220.247:12345 # 本地开发如需ip访问项目把"#"号去掉 #DEV_HOST = 192.168.xx.xx diff --git a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue index dcbf9928dc..5d85089720 100644 --- a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue +++ b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue @@ -236,6 +236,12 @@ editor.setValue(this.sql) return editor + }, + _getReceiver () { + this.store.dispatch('dag/getReceiver', { processDefinitionId: this.item.id }).then(res => { + this.receivers = res.receivers && res.receivers.split(',') || [] + this.receiversCc = res.receiversCc && res.receiversCc.split(',') || [] + }) } }, watch: { @@ -280,6 +286,10 @@ this.receivers = o.params.receivers && o.params.receivers.split(',') || [] this.receiversCc = o.params.receiversCc && o.params.receiversCc.split(',') || [] } + // + if (this.router.history.current.name === 'definition-create') { + this._getReceiver() + } }, mounted () { setTimeout(() => { diff --git a/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js b/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js index 7ce8b8fb82..ef30ad9a0b 100644 --- a/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js +++ b/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/chartConfig.js @@ -15,6 +15,9 @@ * limitations under the License. */ +import _ from 'lodash' +import { tasksState } from '@/conf/home/pages/dag/_source/config' + let pie = { series: [ { @@ -63,4 +66,33 @@ let bar = { }] } -export { pie, bar } +let simple = { + xAxis: { + splitLine: { + show: false + }, + axisLabel: { + interval: 0, + showMaxLabel: true, + formatter (v) { + return tasksState[v].desc + } + } + }, + tooltip: { + formatter (data) { + let str = '' + _.map(data, (v, i) => { + if (i === 0) { + str += `${tasksState[v.name].desc}
` + } + str += `
${v.seriesName} : ${v.data}
` + }) + return str + } + } + + +} + +export { pie, bar, simple } diff --git a/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue b/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue index b37e22fd63..4479a9a77e 100644 --- a/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue +++ b/escheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue @@ -73,34 +73,7 @@
-
- 命令状态统计 -
-
-
-
-
-
-
- - - - - - - - - - - -
{{$t('#')}}{{$t('Number')}}{{$t('State')}}
{{$index+1}} - - {{item.value}} - - {{item.key}}
-
-
-
+
@@ -108,19 +81,19 @@
-
+
- - + + - + - +
{{$t('#')}}{{$t('Number')}}{{$t('State')}}等待执行任务等待Kill任务
{{$index+1}}{{item.value}}{{item.value}} {{item.key}}
@@ -129,6 +102,16 @@
+
+
+
+ 命令状态统计 +
+
+
+
+
+
@@ -150,7 +133,7 @@ import _ from 'lodash' import dayjs from 'dayjs' import { mapActions } from 'vuex' - import { pie, bar } from './chartConfig' + import { pie, bar, simple } from './chartConfig' import Chart from '~/@analysys/ana-charts' import mSpin from '@/module/components/spin/spin' import mNoData from '@/module/components/noData/noData' @@ -166,6 +149,7 @@ processStateList: [], defineUserList: [], commandStateList: [], + queueList: [], searchParams: { projectId: this.id, startDate: '', @@ -203,7 +187,6 @@ } }) }, - _handleTaskCtatus (res) { let data = res.data.taskCountDtos this.taskCtatusList = _.map(data, v => { @@ -263,10 +246,32 @@ } }, _handleCommandState (res) { - + let data = [] + _.forEach(res.data, (v, i) => { + let key = _.keys(v) + if (key[0] === 'errorCount') { + data.push({ typeName: '错误指令数', key: v.commandState, value: v.errorCount }) + } + }) + _.forEach(res.data, (v, i) => { + let key = _.keys(v) + if (key[1] === 'normalCount') { + data.push({ typeName: '正常指令数', key: v.commandState, value: v.normalCount }) + } + }) + const myChart = Chart.bar('#command-state-bar', data, { + title: '' + }) + myChart.echart.setOption(simple) + }, + _handleQueue (res) { + _.forEach(res.data, (v, k) => this.queueList.push({ + key: k === 'taskQueue' ? '等待执行任务' : '等待kill任务', + value: v + })) + const myChart = Chart.pie('#queue-pie', this.queueList, { title: '' }) + myChart.echart.setOption(pie) }, - _handleQueue () {}, - _getData (is = true) { this.isLoading = true let ioList = [