|
|
@ -2,23 +2,14 @@
|
|
|
|
<block-box :title="title">
|
|
|
|
<block-box :title="title">
|
|
|
|
<template #extra>
|
|
|
|
<template #extra>
|
|
|
|
<el-radio-group v-model="tabActive" size="small" @change="handleTabChange">
|
|
|
|
<el-radio-group v-model="tabActive" size="small" @change="handleTabChange">
|
|
|
|
<el-radio-button
|
|
|
|
<el-radio-button v-for="{ tab, key } in config" :label="tab" :value="key" />
|
|
|
|
v-for="{ tab, key } in config"
|
|
|
|
|
|
|
|
:label="tab"
|
|
|
|
|
|
|
|
:value="key"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
</el-radio-group>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<echarts-plus
|
|
|
|
<echarts-plus :options="getTopOptions(
|
|
|
|
:options="
|
|
|
|
currentConfig.find((item) => item.key === tabActive)?.data || [],
|
|
|
|
getTopOptions(
|
|
|
|
)
|
|
|
|
currentConfig.find((item) => item.key === tabActive)?.data || [],
|
|
|
|
" :onClick="handleClick" style="min-height: 250px; height: 100%" />
|
|
|
|
)
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
:onClick="handleClick"
|
|
|
|
|
|
|
|
style="min-height: 250px; height: 100%"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</block-box>
|
|
|
|
</block-box>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
@ -28,6 +19,7 @@ import { onMounted, ref } from 'vue';
|
|
|
|
import EchartsPlus from '@/components/Echarts-plus.vue';
|
|
|
|
import EchartsPlus from '@/components/Echarts-plus.vue';
|
|
|
|
import cardApi from '~/vgpu/api/card';
|
|
|
|
import cardApi from '~/vgpu/api/card';
|
|
|
|
import { cloneDeep } from 'lodash';
|
|
|
|
import { cloneDeep } from 'lodash';
|
|
|
|
|
|
|
|
import { formatSmartPercentage } from '@/utils';
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
const props = defineProps({
|
|
|
|
title: String,
|
|
|
|
title: String,
|
|
|
@ -60,13 +52,14 @@ const getTopOptions = () => {
|
|
|
|
type: 'shadow',
|
|
|
|
type: 'shadow',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
formatter: function (params) {
|
|
|
|
formatter: function (params) {
|
|
|
|
// console.log(params, 'params')
|
|
|
|
|
|
|
|
var res = params[0].name + '<br/>';
|
|
|
|
var res = params[0].name + '<br/>';
|
|
|
|
for (var i = 0; i < params.length; i++) {
|
|
|
|
for (var i = 0; i < params.length; i++) {
|
|
|
|
|
|
|
|
console.log(params[i].value, formatSmartPercentage(params[i].value), 'params')
|
|
|
|
|
|
|
|
|
|
|
|
res +=
|
|
|
|
res +=
|
|
|
|
params[i].marker +
|
|
|
|
params[i].marker +
|
|
|
|
params[i].seriesName +
|
|
|
|
params[i].seriesName +
|
|
|
|
(+params[i].value).toFixed(0) +
|
|
|
|
formatSmartPercentage(params[i].value) +
|
|
|
|
`${config.unit || '%'}<br/>`;
|
|
|
|
`${config.unit || '%'}<br/>`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|