diff --git a/src/components/echarts/MyEchartMap.vue b/src/components/echarts/MyEchartMap.vue index 64f8f90..ba2c2b6 100644 --- a/src/components/echarts/MyEchartMap.vue +++ b/src/components/echarts/MyEchartMap.vue @@ -29,9 +29,8 @@ const GetEchar = async (name: string) => { let chartDom = document.getElementById('chartMap') myCharts.value?.dispose() myCharts.value = echarts.init(chartDom) - if (name != '中国') { - showCircle.value = true - } + name == '中国' ? (showCircle.value = false) : (showCircle.value = true) + echarts.registerMap(name, await fetchConfig(name)) //注册可用的地图 let option = { title: { @@ -127,7 +126,7 @@ const GetEchar = async (name: string) => { shadowOffsetY: 0, borderWidth: 0 } - }, + } // regions: [ // { // name: '南海诸岛', @@ -161,11 +160,9 @@ const GetEchar = async (name: string) => { } const MapReturn = (name: string) => { - let area = dictData.state.area[0].children + let area = dictData.state.area?.[0]?.children ?? [] let list = {} - let flag = true - for (let i = 0; i < area.length; i++) { if (area[i].name == name) { console.log(11111) diff --git a/src/views/Event-boot/Region/distribution.vue b/src/views/Event-boot/Region/distribution.vue index f82f470..e520d1f 100644 --- a/src/views/Event-boot/Region/distribution.vue +++ b/src/views/Event-boot/Region/distribution.vue @@ -33,27 +33,29 @@ - - - - - - +
+ + > + + + + + +
@@ -63,6 +65,7 @@ import Area from '@/components/form/area/index.vue' import { getAreaLineDetail } from '@/api/Region' import { useDictData } from '@/stores/dictData' +import { defaultAttribute } from '@/components/table/defaultAttribute' import MyEchartMap from '@/components/echarts/MyEchartMap.vue' import MyEchart from '@/components/echarts/MyEchart.vue' import { ref, reactive, onMounted, provide } from 'vue' @@ -247,7 +250,7 @@ const histogram = (res: any) => { : '' // 给X轴加单位 }, tooltip: { - formatter: function (params) { + formatter: function (params: any) { // console.log(params); var tips = '' for (var i = 0; i < params.length; i++) { @@ -269,7 +272,7 @@ const histogram = (res: any) => { : titleA.value == '电网拓扑' ? '(区域)' : '', // 给X轴加单位 - data: distributionData.value.map(item => item.qy) + data: distributionData.value.map((item: any) => item.qy) }, yAxis: { name: '监测点数(个)' // 给X轴加单位 @@ -279,7 +282,7 @@ const histogram = (res: any) => { { // name: '暂降次数', type: 'bar', - data: distributionData.value.map(item => item.jcd), + data: distributionData.value.map((item: any) => item.jcd), barMaxWidth: 30, itemStyle: { normal: { diff --git a/src/views/dashboard/components/Tableabove.vue b/src/views/dashboard/components/Tableabove.vue index be951ac..90647f8 100644 --- a/src/views/dashboard/components/Tableabove.vue +++ b/src/views/dashboard/components/Tableabove.vue @@ -5,59 +5,51 @@ - - - + :formatter="formatter" + > + + - - - + > + + - - - - - - +
+ + + + +
diff --git a/src/views/voltage/sags/operationsManagement/statistics.vue b/src/views/voltage/sags/operationsManagement/statistics.vue index 0d5c33e..0b7e712 100644 --- a/src/views/voltage/sags/operationsManagement/statistics.vue +++ b/src/views/voltage/sags/operationsManagement/statistics.vue @@ -120,48 +120,32 @@ const tableStore = new TableStore({ text: '区域' }, xAxis: { - type: 'category', data: tableStore.table.data.area.areaInfo.map( (item: any) => item.areaName + `(${item.numberOfTerminals})` ) }, - yAxis: { - type: 'value' - }, - options: { - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow', - label: { - color: '#fff', - fontSize: 16 + tooltip: { + formatter: function (params:any) { + var tips = '' + tips += params[0].name + '
' + for (var i = 0; i < params.length; i++) { + if (params[i].value == 3.14159) { + tips += params[i].seriesName + ':暂无数据
' + } else { + tips += params[i].seriesName + ':' + params[i].value + '%
' } - }, - textStyle: { - color: '#fff', - fontStyle: 'normal', - opacity: 0.35, - fontSize: 14 - }, - backgroundColor: 'rgba(0,0,0,0.35)', - formatter: function (params: any) { - var tips = '' - tips += params[0].name + '
' - for (var i = 0; i < params.length; i++) { - if (params[i].value == 3.14159) { - tips += params[i].seriesName + ':暂无数据
' - } else { - tips += params[i].seriesName + ':' + params[i].value + '%
' - } - } - return tips } - }, + return tips + } + }, + yAxis: { name: '%' }, + options: { series: [ { stack: 'one', name: '投运', + barMaxWidth: 30, + barMinHeight: 5, data: tableStore.table.data.area.areaInfo.map((item: any) => item.normalRate), itemStyle: { normal: { @@ -189,6 +173,8 @@ const tableStore = new TableStore({ { name: '热备用', stack: 'one', + barMaxWidth: 30, + barMinHeight: 5, data: tableStore.table.data.area.areaInfo.map((item: any) => item.shutdownRate), type: 'bar', itemStyle: { @@ -216,6 +202,8 @@ const tableStore = new TableStore({ { name: '在线率', stack: 'two', + barMaxWidth: 30, + barMinHeight: 5, data: tableStore.table.data.area.areaInfo.map((item: any) => item.onlineRate), itemStyle: { normal: { @@ -265,47 +253,33 @@ const tableStore = new TableStore({ text: '终端厂家' }, xAxis: { - type: 'category', data: tableStore.table.data.factory.areaInfo.map( (item: any) => item.areaName + `(${item.numberOfTerminals})` ) }, yAxis: { - type: 'value' + name: '%' + }, + tooltip: { + formatter: function (params: any) { + var tips = '' + tips += params[0].name + '
' + for (var i = 0; i < params.length; i++) { + if (params[i].value == 3.14159) { + tips += params[i].seriesName + ':暂无数据
' + } else { + tips += params[i].seriesName + ':' + params[i].value + '%
' + } + } + return tips + } }, options: { - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'shadow', - label: { - color: '#fff', - fontSize: 16 - } - }, - textStyle: { - color: '#fff', - fontStyle: 'normal', - opacity: 0.35, - fontSize: 14 - }, - backgroundColor: 'rgba(0,0,0,0.35)', - formatter: function (params: any) { - var tips = '' - tips += params[0].name + '
' - for (var i = 0; i < params.length; i++) { - if (params[i].value == 3.14159) { - tips += params[i].seriesName + ':暂无数据
' - } else { - tips += params[i].seriesName + ':' + params[i].value + '%
' - } - } - return tips - } - }, series: [ { stack: 'one', + barMaxWidth: 30, + barMinHeight: 5, name: '投运', data: tableStore.table.data.factory.areaInfo.map((item: any) => item.normalRate), itemStyle: { @@ -334,6 +308,8 @@ const tableStore = new TableStore({ { name: '热备用', stack: 'one', + barMaxWidth: 30, + barMinHeight: 5, data: tableStore.table.data.factory.areaInfo.map((item: any) => item.shutdownRate), type: 'bar', itemStyle: { @@ -361,6 +337,8 @@ const tableStore = new TableStore({ { name: '在线率', stack: 'two', + barMaxWidth: 30, + barMinHeight: 5, data: tableStore.table.data.factory.areaInfo.map((item: any) => item.onlineRate), itemStyle: { normal: {