mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-05-07 00:04:41 +08:00
fix(首页): 样式优化
This commit is contained in:
@@ -17,9 +17,6 @@
|
|||||||
import {
|
import {
|
||||||
loadBMap
|
loadBMap
|
||||||
} from '@/utils/map.js'
|
} from '@/utils/map.js'
|
||||||
//安装的是echarts完整包,里面包含百度地图扩展,路径为 echarts/extension/bmap/bmap.js,将其引入
|
|
||||||
//ECharts的百度地图扩展,可以在百度地图上展现点图,线图,热力图等可视化
|
|
||||||
require('echarts/extension/bmap/bmap')
|
|
||||||
import {
|
import {
|
||||||
listAllDeviceShort,
|
listAllDeviceShort,
|
||||||
} from "@/api/iot/device";
|
} from "@/api/iot/device";
|
||||||
@@ -66,8 +63,10 @@ export default {
|
|||||||
/**加载地图*/
|
/**加载地图*/
|
||||||
loadMap() {
|
loadMap() {
|
||||||
loadBMap().then(() => {
|
loadBMap().then(() => {
|
||||||
|
import('echarts/extension/bmap/bmap').then(() => {
|
||||||
this.getmap();
|
this.getmap();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 地图 */
|
/** 地图 */
|
||||||
|
|||||||
@@ -240,9 +240,6 @@ import { getDeviceStatistic } from '@/api/iot/device';
|
|||||||
import { listNotice, getNotice } from '@/api/system/notice';
|
import { listNotice, getNotice } from '@/api/system/notice';
|
||||||
import CountTo from 'vue-count-to';
|
import CountTo from 'vue-count-to';
|
||||||
import { loadBMap } from '@/utils/map.js';
|
import { loadBMap } from '@/utils/map.js';
|
||||||
//安装的是echarts完整包,里面包含百度地图扩展,路径为 echarts/extension/bmap/bmap.js,将其引入
|
|
||||||
//ECharts的百度地图扩展,可以在百度地图上展现点图,线图,热力图等可视化
|
|
||||||
require('echarts/extension/bmap/bmap');
|
|
||||||
import { getServer } from '@/api/monitor/server';
|
import { getServer } from '@/api/monitor/server';
|
||||||
import { listAllDeviceShort } from '@/api/iot/device';
|
import { listAllDeviceShort } from '@/api/iot/device';
|
||||||
|
|
||||||
@@ -303,6 +300,12 @@ export default {
|
|||||||
this.getNoticeList();
|
this.getNoticeList();
|
||||||
this.getDeviceStatistic();
|
this.getDeviceStatistic();
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.draawPieCpu();
|
||||||
|
window.addEventListener('resize', this.handleResize); // 监听窗口大小变化以重新渲染饼图
|
||||||
|
});
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
if (this.$store.state.user.roles.indexOf('tenant') === -1 && this.$store.state.user.roles.indexOf('general') === -1) {
|
if (this.$store.state.user.roles.indexOf('tenant') === -1 && this.$store.state.user.roles.indexOf('general') === -1) {
|
||||||
@@ -357,10 +360,25 @@ export default {
|
|||||||
/**加载地图*/
|
/**加载地图*/
|
||||||
loadMap() {
|
loadMap() {
|
||||||
loadBMap().then(() => {
|
loadBMap().then(() => {
|
||||||
|
import('echarts/extension/bmap/bmap').then(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.getmap(); // 里面有 setOption
|
this.getmap();
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleResize() {
|
||||||
|
// 在大小变化时重新渲染图表
|
||||||
|
if (this.bMapChart) {
|
||||||
|
this.bMapChart.resize();
|
||||||
|
}
|
||||||
|
if (this.gMapChart) {
|
||||||
|
this.gMapChart.resize();
|
||||||
|
}
|
||||||
|
if (this.pieCpuChart) {
|
||||||
|
this.pieCpuChart.resize();
|
||||||
|
this.updateRadius();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 查询服务器信息 */
|
/** 查询服务器信息 */
|
||||||
getServer() {
|
getServer() {
|
||||||
|
|||||||
Reference in New Issue
Block a user