添加离线地图

This commit is contained in:
GGJ
2024-12-16 20:57:17 +08:00
parent 0cd5598e8c
commit ccd07ed110
93 changed files with 20430 additions and 126 deletions

View File

@@ -36,7 +36,7 @@ import TableStore from '@/utils/tableStore'
import { ref, onMounted, provide } from 'vue'
import { mainHeight } from '@/utils/layout'
import * as echarts from 'echarts/core'
import { getEnterpriseSteadyQualify, getSteadyQualifyCensus, IntegrityIcon } from '@/api/harmonic-boot/monitoring';
import { getEnterpriseSteadyQualify, getSteadyQualifyCensus, IntegrityIcon, getTHDistortionCensus } from '@/api/harmonic-boot/monitoring';
defineOptions({
name: 'harmonic-boot/views'
})
@@ -171,8 +171,8 @@ const tableStore = new TableStore({
method: 'POST',
column: [],
beforeSearchFun: () => { },
loadCallback: () => {
console.log("🚀 ~ type:", type)
loadCallback: async () => {
mapName.value = header.value.areaRef.areaName
if (type == 1) {
tableStore.table.params.statisticalType = {}
@@ -384,8 +384,7 @@ const tableStore = new TableStore({
} else {
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Report_Type'])[0]
// 合格率
getSteadyQualifyCensus(tableStore.table.params).then(res => {
await getSteadyQualifyCensus(tableStore.table.params).then(res => {
listcard.value[0] = {
title: {
text: '合格率'
@@ -419,15 +418,17 @@ const tableStore = new TableStore({
},
grid: {
left: '60px',
}, tooltip: {
},
tooltip: {
formatter: function (params) {
var tips = ''
tips += params[0].name + '</br/>'
for (var i = 0; i < params.length; i++) {
if (params[i].value == 3.14159) {
tips += params[i].seriesName + ':暂无数据<br/>'
tips += params[i].seriesName + '暂无数据<br/>'
} else {
tips += params[i].seriesName + ':' + params[i].value + '<br/>'
tips += params[i].seriesName + '' + params[i].value + '<br/>'
}
}
return tips
@@ -553,9 +554,20 @@ const tableStore = new TableStore({
mapList.value[0] = {
tooltip: {
formatter: function (params) {
var tips = params.name + '</br/>'
if (params.value == 3.14159) {
tips += '合格率:暂无数据<br/>'
} else {
tips += '合格率:' + (params.data == undefined ? '-' : params.value) + '<br/>'
}
return tips
}
},
visualMap: {
min: 0,
max: 2,
left: 25,
bottom: 40,
pieces: [
@@ -570,6 +582,7 @@ const tableStore = new TableStore({
label: '60%≤在线率<90%',
color: '#FFCC33'
},
{
gt: 0,
lt: 60,
@@ -577,21 +590,18 @@ const tableStore = new TableStore({
color: '#CC0000'
},
{
gt: 3.14159,
lt: 3.14159,
value: 3.14159,
label: '无数据',
color: '#ccc'
}
],
},
options: {
series: [
{
type: "map",
geoIndex: 0,
data: res.data.type.map((item: any, i: any) => {
return {
@@ -611,7 +621,8 @@ const tableStore = new TableStore({
EchartMap.value.GetEchar(header.value.areaRef.areaName)
})
IntegrityIcon(tableStore.table.params).then(res => {
// 完整性
await IntegrityIcon(tableStore.table.params).then(res => {
listcard.value[1] = {
title: {
@@ -631,15 +642,15 @@ const tableStore = new TableStore({
},
tooltip: {
formatter: function (params) {
var tips = ''
var tips = ''
for (var i = 0; i < params.length; i++) {
if (params[i].value == 3.14159) {
tips += params[i].name + '</br>'
tips += '数据完整性:暂无数据'
tips += '数据完整性暂无数据'
} else {
tips += params[i].name + '</br>'
tips += '数据完整性:' + params[i].value
tips += '数据完整性' + params[i].value
}
}
return tips
@@ -696,6 +707,18 @@ const tableStore = new TableStore({
mapList.value[1] = {
tooltip: {
formatter: function (params) {
var tips = params.name + '<br/>'
if (params.value == 3.14159) {
tips += '完整性' + ':暂无数据<br/>'
} else {
tips += '完整性' + '' + (params.data == undefined ? '-' : params.value) + '<br/>'
}
return tips
}
},
visualMap: {
min: 0,
max: 2,
@@ -720,8 +743,8 @@ const tableStore = new TableStore({
color: '#CC0000'
},
{
gt: 3.14159,
lt: 3.14159,
value: 3.14159,
label: '无数据',
color: '#ccc'
}
@@ -750,6 +773,211 @@ const tableStore = new TableStore({
})
// 畸变率
await getTHDistortionCensus(tableStore.table.params).then(res => {
listcard.value[2] = {
title: {
text: '畸变率'
},
legend: {
show: false
},
xAxis: {
type: 'value',
name: '%',
min: 0,
// max: 100,
axisLine: {
show: true,
},
},
tooltip: {
formatter: function (params) {
var tips = ''
for (var i = 0; i < params.length; i++) {
if (params[i].value == 0.314159) {
tips += params[i].name + '</br>'
tips += '畸变率:暂无数据'
} else {
tips += params[i].name + '</br>'
tips += '畸变率:' + params[i].value
}
}
return tips
}
},
yAxis: {
type: 'category',
name: '区域',// 给X轴加单位
data: res.data.type.map((item: any) => item.split('\n')[0]),
splitLine: {
show: false
},
axisLabel: {
show: true,
},
axisTick: {
alignWithLabel: false
},
},
grid: {
left: '60px',
},
dataZoom: [
{
type: 'inside',
orient: 'vertical',
left: '30px',
start: 0,
width: '13px',
end: 100
},
{
orient: 'vertical',
start: 0,
width: '13px',
left: '30px',
end: 100
}
],
options: {
series: [
{
name: '畸变率',
type: 'bar',
itemStyle: {
normal: {
// 随机显示
color: function (params) {
if (params.value == 0.314159) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[
{
offset: 1,
color: '#cccccc'
}
],
false
)
} else if (params.value > 2) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[{ offset: 1, color: '#CC0000' }],
false
)
} else if (params.value <= 2) {
return new echarts.graphic.LinearGradient(
0,
1,
0,
0,
[{ offset: 1, color: '#07CCCA' }],
false
)
}
}
}
},
markLine: {
silent: false,
symbol: 'circle',
data: [
{
name: '',
xAxis: 2,
lineStyle: {
color: '#07CCCA'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#07CCCA'
}
}
}
]
},
data: res.data.single.map(item => item == 3.14159 ? 0.314159 : item),
}
]
}
}
mapList.value[2] = {
tooltip: {
formatter: function (params) {
var tips = params.name + '<br/>'
if (params.value == 0.314159) {
tips += '完整性' + ':暂无数据<br/>'
} else {
tips += '完整性' + '' + (params.data == undefined ? '-' : params.value) + '<br/>'
}
return tips
}
},
visualMap: {
min: 0,
max: 2,
left: 25,
bottom: 40,
pieces: [
{
gt: 0,
lt: 2,
label: '畸变率<=2%',
color: '#07CCCA'
},
{
gt: 2,
lt: 100,
label: '畸变率>2%',
color: '#CC0000'
},
{
value: 3.14159,
label: '无数据',
color: '#ccc'
}
],
},
options: {
series: [
{
type: "map",
geoIndex: 0,
data: res.data.type.map((item: any, i: any) => {
return {
name: item.split('\n')[0],
value: res.data.single[i] == 3.14159 ? 0.314159 : res.data.single[i],
}
}),
}
]
}
}
})
}
}