添加离线地图

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

@@ -52,6 +52,7 @@ import { useMonitoringPoint } from '@/stores/monitoringPoint'
import { indexOptions, harmonicOptions, inharmonicOptions } from '@/utils/dictionary'
import { getHistoryResult } from '@/api/harmonic-boot/harmonic'
import { mainHeight } from '@/utils/layout'
import { yMethod } from '@/utils/echartMethod'
const datePickerRef = ref()
const monitoringPoint = useMonitoringPoint()
const checked = ref(monitoringPoint.state.showCheckBox)
@@ -125,8 +126,9 @@ const init = () => {
const shujuchuli = (res: any) => {
let shujuData = res.data
shujuData.forEach((item: any, i: number) => {
let [min, max] = yMethod([ ...(item.value.map(arr => arr.slice(1)).flat()),item.topLimit,,item.lowerLimit])
//判断是否存在暂降点
if (item.eventDetail !== null || item.eventDetail.length === 0) {
//向项别中添加暂降点
let chufa = []
@@ -145,8 +147,8 @@ const shujuchuli = (res: any) => {
let cvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
item.maxValue = max
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -211,8 +213,8 @@ const shujuchuli = (res: any) => {
let gvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
item.maxValue = max
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -285,7 +287,7 @@ const shujuchuli = (res: any) => {
let bvalue = []
let cvalue = []
let topLimit = []
item.maxValue = item.topLimit
item.maxValue = max
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -347,7 +349,7 @@ const shujuchuli = (res: any) => {
if (item.phaiscType.length == 3) {
let gvalue = []
let topLimit = []
item.maxValue = item.topLimit
item.maxValue = max
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -413,7 +415,7 @@ const shujuchuli = (res: any) => {
let bvalue = []
let cvalue = []
let lowerLimit = []
item.minValue = item.lowerLimit
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -470,7 +472,7 @@ const shujuchuli = (res: any) => {
if (item.phaiscType.length == 3) {
let gvalue = []
let lowerLimit = []
item.minValue = item.lowerLimit
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -661,8 +663,8 @@ const shujuchuli = (res: any) => {
let cvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
item.maxValue = max
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -715,8 +717,8 @@ const shujuchuli = (res: any) => {
let gvalue = []
let topLimit = []
let lowerLimit = []
item.maxValue = item.topLimit
item.minValue = item.lowerLimit
item.maxValue = max
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -778,7 +780,7 @@ const shujuchuli = (res: any) => {
let bvalue = []
let cvalue = []
let topLimit = []
item.maxValue = item.topLimit
item.maxValue = max
// item.minValue=item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
@@ -829,7 +831,7 @@ const shujuchuli = (res: any) => {
if (item.phaiscType.length == 2) {
let gvalue = []
let topLimit = []
item.maxValue = item.topLimit
item.maxValue = max
// item.minValue=item.lowerLimit
//判断数据是否存在
if (item.value !== null) {
@@ -890,7 +892,7 @@ const shujuchuli = (res: any) => {
let cvalue = []
let lowerLimit = []
// item.maxValue=item.topLimit
item.minValue = item.lowerLimit
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -941,7 +943,7 @@ const shujuchuli = (res: any) => {
let gvalue = []
let lowerLimit = []
// item.maxValue=item.topLimit
item.minValue = item.lowerLimit
item.minValue = min
//判断数据是否存在
if (item.value !== null) {
for (let j = 0; j < item.value.length; j++) {
@@ -1298,6 +1300,8 @@ const rendering = () => {
getEcharts()
}
const getEcharts = () => {
console.log("🚀 ~ list.value.forEach ~ list.value:", list.value)
list.value.forEach((item: any, i: number) => {
item.option = {
backgroundColor: '#fff',
@@ -1436,6 +1440,7 @@ const getEcharts = () => {
type: 'value',
min: item.minValue,
max: item.maxValue,
name: item.valueName,
axisLabel: {
interval: 0,

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],
}
}),
}
]
}
}
})
}
}