Browse Source
* fix: the data analysis state count interface, projectId change to projectCode * fix: the data analysis state count interface, projectId change to projectCode * fix checkstyle * fix checkstyle * fix: the process state count page use "projectCode" * fix: English comments * fix: the user definition count interface, projectId change to projectCode * fix comment * fix: the command state count interface, projectId change to projectCode Co-authored-by: wen-hemin <wenhemin@apache.com>2.0.7-release
6 changed files with 28 additions and 115 deletions
@ -1,94 +0,0 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
<template> |
||||
<div class="command-state-count-model"> |
||||
<div v-show="!msg"> |
||||
<div class="data-area" v-spin="isSpin"> |
||||
<div id="command-state-bar" style="height:500px"></div> |
||||
</div> |
||||
</div> |
||||
<div v-show="msg"> |
||||
<m-no-data :msg="msg" v-if="msg" :height="530"></m-no-data> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import _ from 'lodash' |
||||
import { mapActions } from 'vuex' |
||||
import { simple } from './chartConfig' |
||||
import Chart from '@/module/ana-charts' |
||||
import mNoData from '@/module/components/noData/noData' |
||||
|
||||
export default { |
||||
name: 'command-state-count', |
||||
data () { |
||||
return { |
||||
isSpin: true, |
||||
msg: '' |
||||
} |
||||
}, |
||||
props: { |
||||
searchParams: Object |
||||
}, |
||||
methods: { |
||||
...mapActions('projects', ['getCommandStateCount']), |
||||
_handleCommandState (res) { |
||||
let data = [] |
||||
_.forEach(res.data, (v, i) => { |
||||
let key = _.keys(v) |
||||
if (key[0] === 'errorCount') { |
||||
data.push({ typeName: `${this.$t('Error command count')}`, key: v.commandState, value: v.errorCount }) |
||||
} |
||||
}) |
||||
_.forEach(res.data, (v, i) => { |
||||
let key = _.keys(v) |
||||
if (key[1] === 'normalCount') { |
||||
data.push({ typeName: `${this.$t('Normal command count')}`, key: v.commandState, value: v.normalCount }) |
||||
} |
||||
}) |
||||
const myChart = Chart.bar('#command-state-bar', data, { |
||||
title: '' |
||||
}) |
||||
myChart.echart.setOption(simple) |
||||
} |
||||
}, |
||||
created () { |
||||
|
||||
}, |
||||
watch: { |
||||
searchParams: { |
||||
deep: true, |
||||
immediate: true, |
||||
handler (o) { |
||||
this.isSpin = true |
||||
this.getCommandStateCount(o).then(res => { |
||||
this._handleCommandState(res) |
||||
this.isSpin = false |
||||
}).catch(e => { |
||||
this.msg = e.msg || 'error' |
||||
this.isSpin = false |
||||
}) |
||||
} |
||||
} |
||||
}, |
||||
mounted () { |
||||
|
||||
}, |
||||
computed: {}, |
||||
components: { mNoData } |
||||
} |
||||
</script> |
Loading…
Reference in new issue