优化首页echart代码
This commit is contained in:
@@ -34,7 +34,12 @@ echarts.use([
|
|||||||
/**用户性别字典 */
|
/**用户性别字典 */
|
||||||
let indexColor = ref<DictType[]>([
|
let indexColor = ref<DictType[]>([
|
||||||
{ label: 'normal', value: 'normal', elTagType: '', elTagClass: '#91cc75' },
|
{ label: 'normal', value: 'normal', elTagType: '', elTagClass: '#91cc75' },
|
||||||
{ label: 'abnormal', value: 'abnormal', elTagType: '', elTagClass: '#ee6666' },
|
{
|
||||||
|
label: 'abnormal',
|
||||||
|
value: 'abnormal',
|
||||||
|
elTagType: '',
|
||||||
|
elTagClass: '#ee6666',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**表格字段列 */
|
/**表格字段列 */
|
||||||
@@ -166,9 +171,16 @@ function fnGetList(one: boolean) {
|
|||||||
errorNum++;
|
errorNum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echarts.init(document.getElementById('echarts-records')).clear();
|
|
||||||
var chartDom = document.getElementById('echarts-records');
|
var chartDom: any = document.getElementById('echarts-records');
|
||||||
var myChart = echarts.init(chartDom);
|
var existingChart = echarts.getInstanceByDom(chartDom);
|
||||||
|
var myChart: any;
|
||||||
|
if (existingChart) {
|
||||||
|
myChart = existingChart;
|
||||||
|
myChart.clear(); // 清空图表,重新设置数据
|
||||||
|
} else {
|
||||||
|
myChart = echarts.init(chartDom);
|
||||||
|
}
|
||||||
|
|
||||||
var option = {
|
var option = {
|
||||||
title: {
|
title: {
|
||||||
@@ -221,10 +233,16 @@ function fnGetList(one: boolean) {
|
|||||||
/**點擊網元名 */
|
/**點擊網元名 */
|
||||||
function init(e: any) {
|
function init(e: any) {
|
||||||
let realData = toRaw(e);
|
let realData = toRaw(e);
|
||||||
var chartDom = document.getElementById('echarts-records');
|
|
||||||
var myChart = echarts.init(chartDom);
|
|
||||||
myChart.clear(); //怕遗留以前得元素
|
|
||||||
|
|
||||||
|
var chartDom: any = document.getElementById('echarts-records');
|
||||||
|
var existingChart = echarts.getInstanceByDom(chartDom);
|
||||||
|
var myChart: any;
|
||||||
|
if (existingChart) {
|
||||||
|
myChart = existingChart;
|
||||||
|
myChart.clear(); // 清空图表,重新设置数据
|
||||||
|
} else {
|
||||||
|
myChart = echarts.init(chartDom);
|
||||||
|
}
|
||||||
let cpuUsage = realData.cpuUsage;
|
let cpuUsage = realData.cpuUsage;
|
||||||
let memUsage = realData.memUsage;
|
let memUsage = realData.memUsage;
|
||||||
var nfMenUsage =
|
var nfMenUsage =
|
||||||
|
|||||||
Reference in New Issue
Block a user