perf: overview-top取消切换,柱体限制最大宽度30

This commit is contained in:
chenjinsong
2020-05-11 17:17:24 +08:00
parent 64f244aa7a
commit 23754651f7
3 changed files with 13 additions and 31 deletions

View File

@@ -276,9 +276,9 @@ const en = {
alertRule:'Alert rule', alertRule:'Alert rule',
ruleNum:'Rule num', ruleNum:'Rule num',
alertNum:'Alert num', alertNum:'Alert num',
alertRuleTopN: 'Top alert message', alertRuleTopN: 'Top10 alert message',
assetTopN: 'Top alert message by Asset', assetTopN: 'Top10 alert message by Asset',
moduleTopN: 'Top alert message by Module', moduleTopN: 'Top10 alert message by Module',
top:'Top', top:'Top',
chart:{ chart:{
chartTitle:'Alert Trend' chartTitle:'Alert Trend'

View File

@@ -1,20 +0,0 @@
<template>
<div>
<div>
<iframe src="http://192.168.40.247:3000/" class="dashboard"></iframe>
</div>
</div>
</template>
<script>
export default {
name: "dashboard"
}
</script>
<style scoped>
.dashboard{
height: calc(90vh);
width: calc(100%);
}
</style>

View File

@@ -136,12 +136,12 @@
<div class="content-col-box"> <div class="content-col-box">
<div class="content-col-title"> <div class="content-col-title">
<span>{{$t("dashboard.overview.alert.alertRuleTopN")}}</span> <span>{{$t("dashboard.overview.alert.alertRuleTopN")}}</span>
<el-dropdown trigger="hover" :show-timeout="0" size="small"> <!--<el-dropdown trigger="hover" :show-timeout="0" size="small">
<span>Top&nbsp;{{topFilter.rule}}<i class="el-icon-arrow-down el-icon--right"></i></span> <span>Top&nbsp;{{topFilter.rule}}<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i></span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item,index) in topFilter.optionals" :key="index" @click.native="topNChange('rule', item)">{{item}}</el-dropdown-item> <el-dropdown-item v-for="(item,index) in topFilter.optionals" :key="index" @click.native="topNChange('rule', item)">{{item}}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>-->
</div> </div>
<div class="content-col-content"> <div class="content-col-content">
<chart-box axis-tooltip="y" chart-type="bar" ref="ruleMessage" :tooltip-formatter="simpleFormatter" :show-toolbox="false" name="ruleMessage" @is-loading="(isLoading)=>{this.ruleMessageLoading = isLoading}"></chart-box> <chart-box axis-tooltip="y" chart-type="bar" ref="ruleMessage" :tooltip-formatter="simpleFormatter" :show-toolbox="false" name="ruleMessage" @is-loading="(isLoading)=>{this.ruleMessageLoading = isLoading}"></chart-box>
@@ -164,18 +164,18 @@
</transition> </transition>
</span> </span>
</span> </span>
<el-dropdown trigger="hover" v-if="alertMessageShow == 'asset'" :show-timeout="0" size="small"> <!--<el-dropdown trigger="hover" v-if="alertMessageShow == 'asset'" :show-timeout="0" size="small">
<span>Top&nbsp;{{topFilter.asset}}<i class="el-icon-arrow-down el-icon--right"></i></span> <span>Top&nbsp;{{topFilter.asset}}<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i></span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item,index) in topFilter.optionals" :key="index" @click.native="topNChange('asset', item)">{{item}}</el-dropdown-item> <el-dropdown-item v-for="(item,index) in topFilter.optionals" :key="index" @click.native="topNChange('asset', item)">{{item}}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-dropdown trigger="hover" v-if="alertMessageShow == 'module'" :show-timeout="0" size="small"> <el-dropdown trigger="hover" v-if="alertMessageShow == 'module'" :show-timeout="0" size="small">
<span>Top&nbsp;{{topFilter.module}}<i class="el-icon-arrow-down el-icon--right"></i></span> <span>Top&nbsp;{{topFilter.module}}<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i></span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item,index) in topFilter.optionals" :key="index" @click.native="topNChange('module', item)">{{item}}</el-dropdown-item> <el-dropdown-item v-for="(item,index) in topFilter.optionals" :key="index" @click.native="topNChange('module', item)">{{item}}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>-->
</div> </div>
<div class="content-col-content"> <div class="content-col-content">
<chart-box axis-tooltip="y" v-show="alertMessageShow == 'asset'" :tooltip-formatter="simpleFormatter" chart-type="bar" ref="assetMessage" name="assetMessage" :show-toolbox="false" @is-loading="(isLoading)=>{this.assetMessageLoading = isLoading}"></chart-box> <chart-box axis-tooltip="y" v-show="alertMessageShow == 'asset'" :tooltip-formatter="simpleFormatter" chart-type="bar" ref="assetMessage" name="assetMessage" :show-toolbox="false" @is-loading="(isLoading)=>{this.assetMessageLoading = isLoading}"></chart-box>
@@ -793,6 +793,7 @@
name: 'alertStatByRule', name: 'alertStatByRule',
data: seriesData, data: seriesData,
type: 'bar', type: 'bar',
barMaxWidth: 30,
category: categoryData, //自定义用来判断N/A是否显示 category: categoryData, //自定义用来判断N/A是否显示
}; };
this.$refs.ruleMessage.modifyOption('yAxis', 'data', categoryData); this.$refs.ruleMessage.modifyOption('yAxis', 'data', categoryData);
@@ -817,6 +818,7 @@
name: 'alertStatByAsset', name: 'alertStatByAsset',
data: seriesData, data: seriesData,
type: 'bar', type: 'bar',
barMaxWidth: 30,
category: categoryData category: categoryData
}; };
this.$refs.assetMessage.modifyOption('yAxis', 'data', categoryData); this.$refs.assetMessage.modifyOption('yAxis', 'data', categoryData);
@@ -841,6 +843,7 @@
name: 'alertStatByModule', name: 'alertStatByModule',
data: seriesData, data: seriesData,
type: 'bar', type: 'bar',
barMaxWidth: 30,
category: categoryData category: categoryData
}; };
this.$refs.moduleMessage.modifyOption('yAxis', 'data', categoryData); this.$refs.moduleMessage.modifyOption('yAxis', 'data', categoryData);
@@ -852,7 +855,6 @@
getDcTrafficData() { getDcTrafficData() {
this.$get('idc/trafficSetting', {pageSize: -1}).then(response => { this.$get('idc/trafficSetting', {pageSize: -1}).then(response => {
if (response.code === 200) { if (response.code === 200) {
console.info(response.data.list)
this.trafficData = this.convertTrafficData(response.data.list); this.trafficData = this.convertTrafficData(response.data.list);
//console.info(this.trafficData) //console.info(this.trafficData)