pms换pqs

This commit is contained in:
仲么了
2024-02-28 09:56:29 +08:00
parent 65d65ef4b6
commit 268b8547f2
38 changed files with 13 additions and 13 deletions

View File

@@ -0,0 +1,481 @@
<template>
<div class="flex" style="margin: 15px 0">
<span style="width: 100px; margin-top: 3px">电压等级:</span>
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange"
style="margin-right: 28px"
>
全选
</el-checkbox>
<el-checkbox-group
v-model="checkedVoltage"
@change="handleCheckedVoltageChange"
style="height: 72px; overflow-y: auto"
>
<el-checkbox v-for="(item, index) in grade" :label="item" :key="index">{{ item.name }}</el-checkbox>
</el-checkbox-group>
</div>
<div class="flex" style="margin: 15px 0">
<span style="width: 100px; margin-top: 3px">干扰源类型:</span>
<el-checkbox
:indeterminate="isIndeterminate1"
v-model="checkAll1"
@change="handleCheckAllChange1"
style="margin-right: 28px"
>
全选
</el-checkbox>
<el-checkbox-group
v-model="checkedSource"
@change="handleCheckedSourceChange"
style="height: 72px; overflow-y: auto"
>
<el-checkbox v-for="(item, index) in type" :label="item" :key="index">{{ item.name }}</el-checkbox>
</el-checkbox-group>
</div>
<div class="flex" style="margin: 15px 0">
<span style="width: 100px; line-height: 32px">兼容曲线:</span>
<el-radio-group v-model="radio" @change="radioChange">
<el-radio label="ITIC">ITIC</el-radio>
<el-radio label="F47">F47</el-radio>
</el-radio-group>
</div>
<my-echart class="bars_w" :options="echartList" />
<vxe-table class="dw" :data="TableData" height="50px" v-bind="defaultAttribute">
<vxe-column field="name" title="名称" width="100px"></vxe-column>
<vxe-column field="totalEvents" title="事件总数" width="100px"></vxe-column>
<vxe-column field="tolerable" title="可容忍" width="100px"></vxe-column>
<vxe-column field="Intolerable" title="不可容忍" width="100px"></vxe-column>
</vxe-table>
</template>
<script setup lang="ts">
import { useDictData } from '@/stores/dictData'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { mainHeight } from '@/utils/layout'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { ref, reactive } from 'vue'
const dictData = useDictData()
const isIndeterminate = ref(false)
const isIndeterminate1 = ref(false)
const checkAll = ref(true)
const checkAll1 = ref(true)
const radio = ref('ITIC')
const echartList = ref({})
const ITIC = ref({})
const F47 = ref({})
const pointI: any = ref([])
const pointIun: any = ref([])
const pointF: any = ref([])
const pointFun: any = ref([])
const datalist: any = ref([])
const TableData = ref([
{
name: '事件个数',
totalEvents: '',
tolerable: '',
Intolerable: ''
}
])
const checkedVoltage: any = ref(ref(dictData.getBasicData('Dev_Voltage_Stand')))
const checkedSource: any = ref(dictData.getBasicData('Interference_Source'))
const grade = ref(dictData.getBasicData('Dev_Voltage_Stand'))
const type = ref(dictData.getBasicData('Interference_Source'))
// 电压等级多选
const handleCheckedVoltageChange = (val: any) => {
const checkedCount = val.length
checkAll.value = checkedCount === grade.value.length
isIndeterminate.value = checkedCount > 0 && checkedCount < grade.value.length
}
const handleCheckAllChange = (val: any) => {
checkedVoltage.value = val ? grade.value : []
isIndeterminate.value = false
}
// 干扰源类型多选
const handleCheckAllChange1 = (val: any) => {
checkedSource.value = val ? type.value : []
isIndeterminate.value = false
}
const handleCheckedSourceChange = (val: any) => {
const checkedCount = val.length
checkAll1.value = checkedCount === type.value.length
isIndeterminate1.value = checkedCount > 0 && checkedCount < type.value.length
}
const info = async (list: any) => {
datalist.value = []
list.forEach((item: any) => {
if (item.eventValue < 2 && item.eventValue > 0) {
datalist.value.push(item)
}
})
await gongfunction()
ITIC.value = {
title: {
text: 'ITIC曲线'
},
tooltip: {
formatter: function (a: any) {
if (a[0].value[4] == undefined) {
return
}
let relVal = ''
relVal = "<font style='color:" + "'>供电公司:" + '&nbsp' + '&nbsp' + a[0].value[3] + '</font><br/>'
relVal += "<font style='color:" + "'>变电站:" + '&nbsp' + '&nbsp' + a[0].value[4] + '</font><br/>'
relVal += "<font style='color:" + "'>发生时刻:" + '&nbsp' + '&nbsp' + a[0].value[2] + '</font><br/>'
relVal +=
"<font style='color:" +
"'>持续时间:" +
'&nbsp' +
'&nbsp' +
a[0].value[0].toFixed(3) +
's</font><br/>'
relVal +=
"<font style='color:" + "'>特征幅值:" + '&nbsp' + '&nbsp' + a[0].value[1].toFixed(3) + '%</font>'
return relVal
}
},
legend: {
data: ['上限', '下限', '可容忍事件', '不可容忍事件'],
// selectedMode: false,
left: '10px'
},
color: ['#FF8C00', '#00BFFF', 'green', 'red'],
xAxis: {
type: 'log',
min: '0.001',
max: '1000',
name: 's',
splitLine: { show: false }
},
yAxis: {
type: 'value',
splitNumber: 10,
minInterval: 3,
name: '%'
},
dataZoom: {
type: null,
show: false
},
options: {
series: [
{
name: '上限',
type: 'line',
data: [
[0.001, 200],
[0.003, 140],
[0.003, 120],
[0.5, 120],
[0.5, 110],
[10, 110],
[1000, 110]
],
showSymbol: false,
tooltips: {
show: false
}
},
{
name: '下限',
type: 'line',
data: [
[0.02, 0],
[0.02, 70],
[0.5, 70],
[0.5, 80],
[10, 80],
[10, 90],
[1000, 90]
],
showSymbol: false,
tooltips: {
show: false
}
},
{
name: '可容忍事件',
type: 'scatter',
symbol: 'circle',
data: pointI.value
},
{
name: '不可容忍事件',
type: 'scatter',
symbol: 'circle',
data: pointIun.value
}
]
}
}
F47.value = {
title: {
text: 'F47曲线'
},
tooltip: {
formatter: function (a: any) {
if (a[0].value[4] == undefined) {
return
}
let relVal = ''
relVal = "<font style='color:" + "'>供电公司:" + '&nbsp' + '&nbsp' + a[0].value[3] + '</font><br/>'
relVal += "<font style='color:" + "'>变电站:" + '&nbsp' + '&nbsp' + a[0].value[4] + '</font><br/>'
relVal += "<font style='color:" + "'>发生时刻:" + '&nbsp' + '&nbsp' + a[0].value[2] + '</font><br/>'
relVal +=
"<font style='color:" +
"'>持续时间:" +
'&nbsp' +
'&nbsp' +
a[0].value[0].toFixed(3) +
's</font><br/>'
relVal +=
"<font style='color:" + "'>特征幅值:" + '&nbsp' + '&nbsp' + a[0].value[1].toFixed(3) + '%</font>'
return relVal
}
},
legend: {
data: ['分割线', '可容忍事件', '不可容忍事件'],
// selectedMode: false,
left: '10px'
},
color: ['yellow', 'green', 'red'],
xAxis: {
type: 'log',
min: '0.001',
max: '1000',
name: 's',
splitLine: { show: false }
},
yAxis: {
type: 'value',
splitNumber: 10,
minInterval: 3,
name: '%'
},
dataZoom: {
type: null,
show: false
},
options: {
series: [
{
name: '分割线',
type: 'line',
data: [
[0.05, 0],
[0.05, 50],
[0.2, 50],
[0.2, 70],
[0.5, 70],
[0.5, 80],
[10, 80],
[1000, 80]
],
showSymbol: false,
tooltips: {
show: false
}
},
{
name: '可容忍事件',
type: 'scatter',
symbol: 'circle',
data: pointF.value
},
{
name: '不可容忍事件',
type: 'scatter',
symbol: 'circle',
data: pointFun.value
}
]
}
}
radioChange(radio.value)
}
const radioChange = (e: any) => {
if (e == 'ITIC') {
echartList.value = ITIC.value
TableData.value[0].totalEvents = pointI.value.length + pointIun.value.length
TableData.value[0].tolerable = pointI.value.length
TableData.value[0].Intolerable = pointIun.value.length
} else if (e == 'F47') {
echartList.value = F47.value
TableData.value[0].totalEvents = pointF.value.length + pointFun.value.length
TableData.value[0].tolerable = pointF.value.length
TableData.value[0].Intolerable = pointFun.value.length
}
}
const gongfunction = () => {
var standI = 0
var unstandI = 0
var standF = 0
var unstandF = 0
pointI.value = []
pointIun.value = []
pointF.value = []
pointFun.value = []
var total = 0
total = datalist.value.length
if (total == 0) {
} else {
for (var i = 0; i < datalist.value.length; i++) {
var point = []
var xx = datalist.value[i].persistTime
var yy = datalist.value[i].eventValue * 100
var time = datalist.value[i].time.replace('T', ' ')
var company = datalist.value[i].gdName
var substation = datalist.value[i].subName
var index = datalist.value[i].lineId
var eventId = datalist.value[i].eventId
point = [xx, yy, time, company, substation, index, eventId]
if (xx <= 0.003) {
var line = 0
line = 230 - 30000 * xx
if (yy > line) {
unstandI++
pointIun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
} else {
standI++
pointI.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
}
} else if (xx <= 0.02) {
if (yy > 120) {
unstandI++
pointIun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
} else {
standI++
pointI.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
}
} else if (xx <= 0.5) {
if (yy > 120 || yy < 70) {
unstandI++
pointIun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
} else {
standI++
pointI.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
}
} else if (xx <= 10) {
if (yy > 110 || yy < 80) {
unstandI++
pointIun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
} else {
standI++
pointI.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
}
} else {
if (yy > 110 || yy < 90) {
unstandI++
pointIun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
} else {
standI++
pointI.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
}
}
if (xx < 0.05) {
standF++
pointF.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
} else if (xx < 0.2) {
if (yy > 50) {
standF++
pointF.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
} else {
unstandF++
pointFun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
}
} else if (xx < 0.5) {
if (yy > 70) {
standF++
pointF.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
} else {
unstandF++
pointFun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
}
} else {
if (yy > 80) {
standF++
pointF.value.push({
value: point,
itemStyle: { normal: { color: 'green' } }
})
} else {
unstandF++
pointFun.value.push({
value: point,
itemStyle: { normal: { color: 'red' } }
})
}
}
}
}
}
defineExpose({ checkedVoltage, checkedSource, info })
const layout = mainHeight(390) as any
</script>
<style lang="scss" scoped>
.flex {
display: flex;
}
.bars_w {
height: calc(v-bind('layout.height'));
}
.dw {
position: absolute;
top: 210px;
right: 70px;
}
</style>

View File

@@ -0,0 +1,121 @@
<template>
<div>
<span style="font-size: 14px; font-weight: bold">
统计区域: 中国 &ensp; 统计时间: {{ Time[0] + '至' + Time[1] }} &ensp; 统计次数: {{ frequency + '次' }}
</span>
<el-tabs tab-position="left" class="demo-tabs" style="margin-top: 10px">
<el-tab-pane label="区域">
<div class="default-main">
<vxe-table :data="areaData" v-bind="defaultAttribute" height="auto" auto-resize>
<vxe-column
v-for="item in tableHeaderAera"
:field="item.prop"
:title="item.label"
:min-width="item.width"
:sortable="item.sortable"
:formatter="formatter"
></vxe-column>
</vxe-table>
</div>
</el-tab-pane>
<el-tab-pane label="电压等级">
<div class="default-main">
<vxe-table :data="levelData" v-bind="defaultAttribute" height="auto" auto-resize>
<vxe-column
v-for="item in tableHeaderLevel"
:field="item.prop"
:title="item.label"
:min-width="item.width"
:sortable="item.sortable"
></vxe-column>
</vxe-table>
</div>
</el-tab-pane>
<el-tab-pane label="月份">
<div class="default-main">
<vxe-table :data="shareData" v-bind="defaultAttribute" height="auto" auto-resize>
<vxe-column field="month" title="月份" min-width="120px" sortable></vxe-column>
<vxe-column field="notAssociated" title="电压暂降次数" sortable></vxe-column>
</vxe-table>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, defineExpose, computed } from 'vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { mainHeight } from '@/utils/layout'
const areaData: any = ref([])
const levelData: any = ref([])
const shareData: any = ref([])
const Time: any = ref([])
const tableHeaderAera = ref<any[]>([
{ prop: 'areaName', label: '区域名称', width: '120px' },
{ prop: 'monitoringPoints', label: '监测点数', sortable: true },
{ prop: 'frequency', label: '电压暂降次数', sortable: true },
{ prop: 'sarfi9', label: 'SARFI-90', sortable: true }
])
const tableHeaderLevel = ref<any[]>([
{ prop: 'voltageLevel', label: '电压等级(kV)', width: '150px' },
{ prop: 'monitoringPoints', label: '监测点数' },
{ prop: 'frequency', label: '电压暂降次数' }
])
const frequency = ref<number>(875)
const info = (list: any, searchBeginTime: any, searchEndTime: any) => {
Time.value = [searchBeginTime, searchEndTime]
frequency.value = list.areaStatistics.frequencySum
areaData.value = [
{
areaName: '总计',
monitoringPoints: list.areaStatistics.monitoringPointSum,
frequency: list.areaStatistics.frequencySum,
sarfi9: '/'
},
...list.areaStatistics.areaCalculation
]
levelData.value = [
{
voltageLevel: '总计',
monitoringPoints: list.voltageStatistics.monitoringPointSum,
frequency: list.voltageStatistics.frequencySum
},
...list.voltageStatistics.voltageLevelCalculation
]
let all = 0
list.monthlyStatistics.monthCalculation.forEach((item: any) => {
all += item.linked + item.notAssociated
})
shareData.value = [
{
month: '总计',
notAssociated: all.toFixed(2)
},
...list.monthlyStatistics.monthCalculation
]
}
const formatter = (row: any) => {
if (row.column.field == 'areaName') {
return (row.cellValue = row.cellValue.replace('\n', ''))
} else {
return row.cellValue
}
}
defineExpose({ info })
const layout = mainHeight(185) as any
const defaultMain = mainHeight(195) as any
</script>
<style lang="scss" scoped>
::v-deep(.el-tabs--left, ) {
height: v-bind('layout.height');
}
.default-main {
height: v-bind('defaultMain.height');
}
</style>

View File

@@ -0,0 +1,144 @@
<template>
<span style="color: red; font-size: 12px">:暂降类型仅统计暂降原因为短路故障事件</span>
<div class="statistics-main">
<template v-if="flag">
<div>
<my-echart :options="descent" />
</div>
<div>
<vxe-table height="auto" auto-resize :data="descentData" v-bind="defaultAttribute">
<vxe-column field="name" title="暂降原因"></vxe-column>
<vxe-column field="value" title="暂降次数"></vxe-column>
</vxe-table>
</div>
<div>
<my-echart :options="resemble" />
</div>
<div>
<vxe-table height="auto" auto-resize :data="resembleData" v-bind="defaultAttribute">
<vxe-column field="name" title="暂降原因"></vxe-column>
<vxe-column field="value" title="暂降次数"></vxe-column>
</vxe-table>
</div>
</template>
</div>
</template>
<script setup lang="ts">
import { ref, reactive } from 'vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { mainHeight } from '@/utils/layout'
const descent = ref({})
const descentData = ref([])
const resemble = ref({})
const resembleData = ref([])
const flag = ref(true)
const info = (res: any) => {
flag.value = false
descentData.value = res.reason
resembleData.value = res.type
descent.value = {
title: {
text: '暂降原因'
},
legend: {
type: 'scroll',
orient: 'vertical',
left: 10,
top: '5%',
tooltip: {
show: true
}
},
xAxis: {
show: false
},
yAxis: {
show: false
},
dataZoom: { show: false },
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} (次)'
},
options: {
series: [
{
name: '暂降原因',
type: 'pie',
center: ['50%', '50%'],
selectedOffset: 30,
clockwise: true,
label: {
show: false,
position: 'outside',
textStyle: {
//数值样式
}
},
data: res.reason?.filter((item: any) => item.name != '总计')
}
]
}
}
resemble.value = {
title: {
text: '暂降类型'
},
legend: {
type: 'scroll',
orient: 'vertical',
left: 10,
top: '5%'
},
tooltip: {
formatter: '{a} <br/>{b} : {c} (次)',
confine: true
},
xAxis: {
show: false
},
yAxis: {
show: false
},
dataZoom: { show: false },
options: {
series: [
{
name: '暂降类型',
type: 'pie',
center: ['50%', '50%'],
selectedOffset: 30,
clockwise: true,
label: {
show: false,
position: 'outside'
},
data: res.type?.filter((item: any) => item.name != '总计')
}
]
}
}
flag.value = true
}
defineExpose({ info })
const layout = mainHeight(175) as any
</script>
<style lang="scss" scoped>
.statistics-main {
box-sizing: border-box;
height: v-bind('layout.height');
padding: 0 10px 10px;
display: grid;
grid-template-columns: 1fr 600px;
grid-template-rows: 1fr 1fr;
grid-gap: 10px;
}
</style>

View File

@@ -0,0 +1,293 @@
<template>
<div>
<my-echart class="bars_w" :options="areaStatistics" />
<div class="separate">
<my-echart class="bars_w" :options="voltageStatistics" />
<my-echart class="bars_w" :options="monthlyStatistics" />
</div>
</div>
</template>
<script setup lang="ts">
import MyEchart from '@/components/echarts/MyEchart.vue'
import { reactive, ref, defineExpose } from 'vue'
import { mainHeight } from '@/utils/layout'
let areaStatistics = ref({})
let voltageStatistics = ref({})
let monthlyStatistics = ref({})
const Processing = (list: any) => {
// 区域
let echartsndArr: string[] = []
let echartsArr: string[] = []
list.areaCalculation.forEach((item: any) => {
echartsndArr.push(item.areaName)
if (item.frequency == 0) {
item.frequency = 1.1
} else if (item.frequency == 1) {
item.frequency = 1.3
}
echartsArr.push(item.frequency)
})
areaStatistics.value = {
title: {
text: '区域'
},
tooltip: {
formatter: function (params: any) {
let html = '区域:' + params[0].name
params.forEach((item: any) => {
if (item.value == 1.1) {
html += `<br/>${item.seriesName}: ${0}`
} else if (item.value == 1.3) {
html += `<br/>${item.seriesName}: ${1}`
} else {
html += `<br/>${item.seriesName}: ${item.value}`
}
})
return html
}
},
legend: {
data: ['暂降次数']
},
xAxis: {
name: '区域', // 给X轴加单位
data: echartsndArr
},
yAxis: {
name: '次数' // 给X轴加单位
},
options: {
series: [
{
barMinHeight: 5,
barMaxWidth: 30,
itemStyle: {
normal: {
//这里是颜色
color: function (params: any) {
if (params.data == 1.1) {
return '#B3B3B3'
} else {
return '#07CCCA '
}
}
}
},
name: '暂降次数',
type: 'bar',
data: echartsArr
}
]
}
}
}
// 电压等级
const Grade = (list: any) => {
let echartsndArr: string[] = []
let echartsArr: string[] = []
list.voltageLevelCalculation.forEach((item: any) => {
echartsndArr.push(item.voltageLevel)
if (item.frequency == 0) {
item.frequency = 1.1
} else if (item.frequency == 1) {
item.frequency = 1.3
}
echartsArr.push(item.frequency)
})
voltageStatistics.value = {
title: {
text: '电压等级'
},
tooltip: {
formatter: function (params: any) {
let html = '电压等级:' + params[0].name
params.forEach((item: any) => {
if (item.value == 1.1) {
html += `<br/>${item.seriesName}: ${0}`
} else if (item.value == 1.3) {
html += `<br/>${item.seriesName}: ${1}`
} else {
html += `<br/>${item.seriesName}: ${item.value}`
}
})
return html
}
},
legend: {
data: ['暂降次数']
},
xAxis: {
name: '电压等级',
data: echartsndArr
},
yAxis: {
name: '次数' // 给X轴加单位
},
options: {
series: [
{
barMaxWidth: 30,
barMinHeight: 5,
itemStyle: {
normal: {
//这里是颜色
color: function (params: any) {
if (params.data == 1.1) {
return '#B3B3B3'
} else {
return '#07CCCA '
}
}
}
// color: echartsColor.FigureColor[0],
},
name: '暂降次数',
type: 'bar',
data: echartsArr
}
]
}
}
}
//时间
const Relation = (list: any, interval: number) => {
let echartsndArr: string[] = []
let echartsArr: string[] = []
let echartswArr: string[] = []
list.monthCalculation.forEach((item: any, i: number) => {
if (i != 0) {
item.month = item.month.slice(5)
} else if (i == 0) {
let date = item.month.slice(5)
// let t = item.month.slice(0, 4);
// item.month = date + "\n" + "(" + t + ")";
item.month = date
}
echartsndArr.push(item.month)
// if (item.linked == 0 || item.notAssociated == 0) {
// item.linked = 3.14159;
// item.notAssociated = 3.14159;
// }
if (item.linked == 0) {
item.linked = 1.1
} else if (item.linked == 1) {
item.linked = 1.3
}
echartsArr.push(item.linked)
if (item.notAssociated == 0) {
item.notAssociated = 1.1
} else if (item.notAssociated == 1) {
item.notAssociated = 1.3
}
echartswArr.push(item.notAssociated)
})
monthlyStatistics.value = {
title: {
text: '时间'
},
tooltip: {
formatter: function (params: any) {
let html = '时间:' + params[0].name
params.forEach((item: any) => {
if (item.value == 1.1) {
html += `<br/>${item.seriesName}: ${0}`
} else if (item.value == 1.3) {
html += `<br/>${item.seriesName}: ${1}`
} else {
html += `<br/>${item.seriesName}: ${item.value}`
}
})
return html
}
},
legend: {
data: ['未关联暂降次数', '已关联处理事件']
},
color: ['#07CCCA', '#Ff6600'],
xAxis: {
name: '月份', // 给X轴加单位
data: echartsndArr
},
yAxis: {
name: '次数' // 给X轴加单位
},
options: {
series: [
{
name: '未关联暂降次数',
type: 'bar',
barMaxWidth: 30,
barMinHeight: 5,
data: echartswArr,
itemStyle: {
normal: {
label: {
// show: true, //数字开启显示
textStyle: {
//数值样式
color: '#fff',
fontSize: 14,
fontWeight: 600
}
},
color: function (params: any) {
if (params.data == 1.1) {
return '#B3B3B3'
} else {
return '#07CCCA '
}
}
}
}
},
{
name: '已关联处理事件',
type: 'bar',
barMaxWidth: 30,
data: echartsArr,
itemStyle: {
normal: {
label: {
// show: true, //数字开启显示
textStyle: {
//数值样式
color: '#fff',
fontSize: 14,
fontWeight: 600
}
},
color: function (params: any) {
if (params.data == 1.1) {
return '#B3B3B3'
} else {
return '#Ff6600'
}
}
}
}
}
]
}
}
}
// Processing()
defineExpose({ Processing, Grade, Relation })
const layout = mainHeight(150) as any
</script>
<style lang="scss" scoped>
.bars_w {
width: 100%;
height: calc(v-bind('layout.height') / 2);
}
.separate {
display: flex;
}
</style>

View File

@@ -0,0 +1,316 @@
<template>
<div class="default-main">
<TableHeader area ref="header">
<template v-slot:select>
<!-- <el-form-item label="区域">
<Area ref="area" v-model="tableStore.table.params.deptIndex" />
</el-form-item> -->
<el-form-item label="统计类型">
<el-select
v-model="tableStore.table.params.statisticalType"
value-key="id"
placeholder="请选择统计类型"
size="large"
>
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item" />
</el-select>
</el-form-item>
</template>
</TableHeader>
<div v-loading="tableStore.table.loading" class="pr10">
<el-row>
<el-col :span="12">
<MyEchartMap
ref="EchartMap"
:options="echartMapList"
class="map"
@eliminate="eliminate"
@getRegionByRegion="getRegionByRegion"
/>
</el-col>
<el-col :span="12">
<my-echart class="tall" :options="echartList" />
<div class="tall">
<vxe-table height="auto" auto-resize :data="distributionData" v-bind="defaultAttribute">
>
<vxe-column
field="qy"
:title="
titleA == '电压等级'
? '电压等级'
: titleA == '终端厂家'
? '终端厂家'
: titleA == '干扰源类型'
? '干扰源类型'
: titleA == '电网拓扑'
? '区域'
: ''
"
show-overflow-tooltip
></vxe-column>
<vxe-column field="jcd" title="监测点数(个数)"></vxe-column>
<vxe-column field="zc" title="通讯正常(个数)" sortable></vxe-column>
<vxe-column field="zd" title="通讯中断(个数)" sortable></vxe-column>
</vxe-table>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup lang="ts">
import TableHeader from '@/components/table/header/index.vue'
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 TableStore from '@/utils/tableStore'
import { ref, onMounted, provide } from 'vue'
import { mainHeight } from '@/utils/layout'
defineOptions({
name: 'Region/distribution'
})
const EchartMap = ref()
const dictData = useDictData()
const options = dictData.getBasicData('Statistical_Type', ['Report_Type'])
const echartMapList:any = ref({})
const echartList = ref({})
const titleA = ref('')
const header = ref()
const distributionData: any = ref([])
const tableStore = new TableStore({
url: '/event-boot/area/getAreaLineDetail',
method: 'POST',
column: [],
loadCallback: () => {
titleA.value = tableStore.table.params.statisticalType.name
header.value.areaRef.change()
// 处理地图数据
map(tableStore.table.data)
tabulation(tableStore.table.data)
histogram(tableStore.table.data)
EchartMap.value.GetEchar(header.value.areaRef.areaName)
}
})
provide('tableStore', tableStore)
// tableStore.table.params.deptIndex = dictData.state.area[0].id
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Report_Type'])[0]
tableStore.table.params.monitorFlag = 2
tableStore.table.params.powerFlag = 2
tableStore.table.params.serverName = 'event-boot'
// 地图点击事件
const getRegionByRegion = (list: any) => {
tableStore.table.params.deptIndex = list.id
tableStore.onTableAction('search', {})
}
// 消除点
const eliminate = (name: string) => {
echartMapList.value.options.series = []
EchartMap.value.GetEchar(name)
}
// 地图数处理
const map = (res: any) => {
echartMapList.value = {
name: '',
title: {
text: '监测网分布' //+ "(" + _this.titles + ")",
},
tooltip: {
formatter: function (params: any) {
//console.log(params)
var tips = ''
if (params.value == 0) {
tips = "<font style='color: #000'>暂无数据</font><br/>"
} else {
tips +=
"<font style='color: #000'> " +
params.name +
'</font><br/>区域暂降评估' +
"<font style='color: #000'>:" +
params.value +
'</font><br/>'
}
return tips
}
},
color: ['green', 'red'],
legend: {
data: [
{
name: '正常'
},
{
name: '中断'
}
]
},
options: {
series: []
}
}
let mapList:any = [[], [], []]
if (res.substationDetailVOList != null) {
res.substationDetailVOList.forEach((item: any) => {
if (item.color == 'green') {
mapList[0].push(item)
} else if (item.color == 'red') {
mapList[1].push(item)
}
})
}
mapList.forEach((item:any, ind:number) => {
echartMapList.value.options.series.push({
type: 'scatter',
mapName: 'china',
name: ind == 0 ? '正常' : ind == 1 ? '中断' : '变电站',
coordinateSystem: 'geo',
geoIndex: 0,
animation: false, //坐标点是否显示动画
roam: true,
symbol: 'pin',
symbolSize: function () {
//坐标点大小
return 30
},
label: {
normal: {
show: false
},
emphasis: {
show: false
}
},
data: item.map(function (itemOpt: any) {
// console.log(itemOpt);
return {
name: itemOpt.srbName,
value: [
parseFloat(itemOpt.coordY), //经度
parseFloat(itemOpt.coordX) //维度
],
itemStyle: {
//地图区域的多边形
normal: {
color: itemOpt.color, //坐标点颜色
shadowBlur: 0, // 图形阴影的模糊大小
shadowOffsetX: 0 // 阴影水平方向上的偏移距离。
}
},
tooltip: {
//仅在 options中最外层的 tooltip.trigger 为 'item'时有效
position: 'bottom', //提示框位置,仅在 options中最外层的 tooltip.trigger 为 'item'时有效
formatter: function (params: any, ticket: any, callback: any) {
var strHtml = '<div>变电站:' + itemOpt.subName + '<br/>' + '监测点:' + itemOpt.srbName
strHtml += '</div>'
return strHtml
}
}
}
})
})
})
}
// 表格数据处理
const tabulation = (res: any) => {
distributionData.value = []
for (var i = 0; i < res.areaValue.length; i++) {
distributionData.value.push({
qy: res.areaValue[i][0],
jcd: res.areaValue[i][1],
zc: res.areaValue[i][2],
zd: res.areaValue[i][3]
})
}
}
// 柱状图数据处理
const histogram = (res: any) => {
echartList.value = {
title: {
text:
titleA.value == '电压等级'
? '电压等级'
: titleA.value == '终端厂家'
? '终端厂家'
: titleA.value == '干扰源类型'
? '干扰源类型'
: titleA.value == '电网拓扑'
? header.value.areaRef.areaName
: '' // 给X轴加单位
},
tooltip: {
formatter: function (params: any) {
// console.log(params);
var tips = ''
for (var i = 0; i < params.length; i++) {
tips += params[i].name + '</br/>'
tips += '监测点数' + ':' + '&nbsp' + '&nbsp' + params[i].value + '</br/>'
}
return tips
}
},
xAxis: {
name:
titleA.value == '电压等级'
? '(电压\n等级)'
: titleA.value == '终端厂家'
? '(终端\n厂家)'
: titleA.value == '干扰源类型'
? '(干扰\n源类型)'
: titleA.value == '电网拓扑'
? '(区域)'
: '', // 给X轴加单位
data: distributionData.value.map((item: any) => item.qy)
},
yAxis: {
name: '监测点数(个)' // 给X轴加单位
},
options: {
series: [
{
// name: '暂降次数',
type: 'bar',
data: distributionData.value.map((item: any) => item.jcd),
barMaxWidth: 30,
itemStyle: {
normal: {
color: '#07CCCA'
}
},
label: {
show: true,
position: 'top',
textStyle: {
//数值样式
color: '#000'
},
fontSize: 12
}
}
]
}
}
}
onMounted(() => {
tableStore.index()
})
const layout = mainHeight(83) as any
const layout1 = mainHeight(93) as any
</script>
<style lang="scss" scoped>
.map {
height: v-bind('layout.height');
}
.tall {
height: calc(v-bind('layout1.height') / 2);
}
</style>

View File

@@ -0,0 +1,63 @@
<template>
<div class="default-main">
<TableHeader date-picker area></TableHeader>
<el-tabs v-model="activeName" type="border-card" v-loading="tableStore.table.loading">
<el-tab-pane label="图形" name="1">
<Echart ref="echarts" />
</el-tab-pane>
<el-tab-pane label="表格" name="2"><Tableabove ref="table" /></el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="ts">
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import Echart from './components/echart.vue'
import Tableabove from './components/Tableabove.vue'
import TableStore from '@/utils/tableStore'
import { onMounted, reactive, ref, provide } from 'vue'
import { mainHeight } from '@/utils/layout'
defineOptions({
name: 'Region/overview'
})
const activeName = ref('1')
const echarts = ref()
const Picker = ref()
const table = ref()
const dictData = useDictData()
const tableStore = new TableStore({
url: '/event-boot/areaStatistics/getAreaCalculation',
method: 'POST',
column: [],
loadCallback: () => {
table.value.info(tableStore.table.data,tableStore.table.params.searchBeginTime,tableStore.table.params.searchEndTime)
echarts.value.Processing(tableStore.table.data.areaStatistics)
echarts.value.Grade(tableStore.table.data.voltageStatistics)
echarts.value.Relation(JSON.parse(JSON.stringify(tableStore.table.data.monthlyStatistics)))
}
})
provide('tableStore', tableStore)
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Load_Type'])[3]
tableStore.table.params.monitorFlag = 2
tableStore.table.params.powerFlag = 2
tableStore.table.params.serverName = 'event-boot'
onMounted(() => {
tableStore.index()
})
const layout = mainHeight(123) as any
</script>
<style lang="scss" scoped>
.bars_w {
width: 100%;
height: 500px;
}
::v-deep(.el-tabs__content) {
height: v-bind('layout.height');
overflow-y: auto;
}
</style>

View File

@@ -0,0 +1,79 @@
<template>
<div class="default-main">
<TableHeader date-picker area>
<template v-slot:select></template>
</TableHeader>
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" v-loading="tableStore.table.loading">
<el-tab-pane label="暂降原因及类型统计" name="1">
<TypeStatistics ref="Statistics" />
</el-tab-pane>
<el-tab-pane label="电压容忍度曲线兼容性统计" name="2">
<Compatibility ref="compatibility" />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="ts">
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import TableStore from '@/utils/tableStore'
import { onMounted, reactive, ref, provide } from 'vue'
import TypeStatistics from './components/TypeStatistics.vue'
import Compatibility from './components/Compatibility.vue'
import { mainHeight } from '@/utils/layout'
defineOptions({
name: 'Region/overview'
})
const activeName = ref('1')
const Statistics = ref()
const compatibility = ref()
const dictData = useDictData()
const tableStore = new TableStore({
url: '/event-boot/areaAnalysis/getEventReason',
method: 'POST',
column: [],
loadCallback: () => {
if (activeName.value == '1') {
Statistics.value.info(tableStore.table.data)
} else {
compatibility.value.info(tableStore.table.data.voltageToleranceCurveDataList)
}
}
})
provide('tableStore', tableStore)
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Load_Type'])[3]
tableStore.table.params.monitorFlag = 2
tableStore.table.params.powerFlag = 2
tableStore.table.params.serverName = 'event-boot'
onMounted(() => {
tableStore.index()
})
const handleClick = async (e: any) => {
if (e.paneName == '1') {
tableStore.table.params.scale = null
tableStore.table.params.loadType = null
tableStore.url = '/event-boot/areaAnalysis/getEventReason'
} else {
tableStore.table.params.scale = compatibility.value.checkedVoltage
tableStore.table.params.loadType = compatibility.value.checkedSource
tableStore.url = '/event-boot/areaAnalysis/getVoltageToleranceCurve'
}
await tableStore.onTableAction('search', {})
}
const layout = mainHeight(123) as any
</script>
<style lang="scss" scoped>
.bars_w {
width: 100%;
height: 500px;
}
::v-deep(.el-tabs__content) {
height: v-bind('layout.height');
overflow-y: auto;
}
</style>

View File

@@ -0,0 +1,352 @@
<template>
<div class="default-main">
<TableHeader area date-picker ref="header" />
<div v-loading="tableStore.table.loading" class="pr10">
<el-row>
<el-col :span="12">
<MyEchartMap
ref="EchartMap"
:options="echartMapList"
class="map"
@eliminate="eliminate"
@getRegionByRegion="getRegionByRegion"
/>
</el-col>
<el-col :span="12">
<my-echart class="tall" :options="echartList" />
<div class="tall">
<vxe-table height="auto" auto-resize :data="distributionData" v-bind="defaultAttribute">
>
<vxe-column field="areaName" title=" 区域" show-overflow-tooltip></vxe-column>
<vxe-column field="ci" title="区域暂降评估">
<template #default="{ row }">
{{ row.ci == 0.05 ? '暂无数据' : row.ci.toFixed(2) }}
</template>
</vxe-column>
<vxe-column sortable field="isCount" title="等级">
<template #default="{ row }">
<span v-if="row.ci == 0.05">暂无等级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 0.2 && row.ci < 0.4">1级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 0.4 && row.ci < 0.8">2级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 0.8 && row.ci < 1.2">3级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 1.2">4级</span>
</template>
</vxe-column>
</vxe-table>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup lang="ts">
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import MyEchartMap from '@/components/echarts/MyEchartMap.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import TableStore from '@/utils/tableStore'
import { ref, onMounted, provide } from 'vue'
import { mainHeight } from '@/utils/layout'
import { defaultAttribute } from '@/components/table/defaultAttribute'
defineOptions({
name: 'Region/distribution'
})
const EchartMap = ref()
const dictData = useDictData()
const echartMapList: any = ref({})
const echartList = ref({})
const header = ref()
const distributionData: any = ref([])
const list: any = ref([])
const geoCoordMap: any = ref([])
const tableStore = new TableStore({
url: '/event-boot/area/getEventHeatMap',
method: 'POST',
column: [],
beforeSearchFun: () => {},
loadCallback: () => {
header.value.areaRef.change()
// 处理地图数据
tableStore.table.data.eventHeatMapValue.forEach(val => {
val.forEach(item => {
list.value.push(item)
geoCoordMap.value.push([item.lng, item.lat, item.tail])
})
})
map(tableStore.table.data)
// tabulation(tableStore.table.data)
// histogram(tableStore.table.data)
EchartMap.value.GetEchar(header.value.areaRef.areaName)
}
})
tableStore.table.params.monitorFlag = 2
tableStore.table.params.powerFlag = 1
tableStore.table.params.reportFlag = 3
tableStore.table.params.statFlag = true
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Load_Type'])[3]
provide('tableStore', tableStore)
// 地图点击事件
const getRegionByRegion = (list: any) => {
tableStore.table.params.deptIndex = list.id
tableStore.onTableAction('search', {})
}
// 消除点
const eliminate = (name: string) => {
echartMapList.value.options.series = []
EchartMap.value.GetEchar(name)
}
// 地图数处理
const map = (res: any) => {
let areaData: any = []
if (geoCoordMap.value.lengt > 0) {
geoCoordMap.value.map(item => {
areaData.push(...new Array(3).fill(item))
})
}
let maxNum = 0
let minNum = 0
let num: any = []
if (areaData.length > 0) {
areaData.forEach(item => {
num.push(item[2])
})
for (let i = 0; i < num.length; i++) {
if (num[i] > maxNum) {
maxNum = num[i]
} else if (num[i] < minNum) {
minNum = num[i]
}
}
}
echartMapList.value = {
name: '',
title: {
text: '区域暂降热力图分布'
},
visualMap: {
left: 26,
bottom: 40,
show: true,
color: ['#ff0000', '#37b70c'],
min: minNum,
max: maxNum,
calculable: true,
textStyle: {
color: '#000',
fontSize: 12
}
},
options: {
series: [
{
mapType: 'nanshan',
top: 'center',
left: 'center',
width: '65%',
height: '95%',
name: 'AQI',
type: 'heatmap',
coordinateSystem: 'geo',
blurSize: 40,
data: areaData
// 鼠标移入
}
]
}
}
}
// 表格数据处理
const tabulation = (res: any) => {
distributionData.value = res
distributionData.value.forEach((item: any) => {
if (item.ci == 0) {
item.ci = 0.05
}
})
}
// 柱状图数据处理
const histogram = (res: any) => {
echartList.value = {
title: {
text: header.value.areaRef.areaName
},
tooltip: {
formatter: function (params: any) {
var tips = ''
for (var i = 0; i < params.length; i++) {
if (params[i].value == 0.05) {
tips += params[i].name + '</br>'
tips += '评估值:0'
} else {
tips += params[i].name + '</br>'
tips += '评估值:' + params[i].value
}
}
return tips
}
},
xAxis: {
name: '(区域)',
data: res.map((item: any) => item.areaName)
},
yAxis: {
name: ' 等级',
min: 0,
max: 2,
// minInterval: 0.2,
axisLabel: {
fontSize: 14,
// interval: 4,
formatter: function (value: any) {
var texts = ''
if (value === 0.4) {
texts = '1级'
} else if (value === 0.8) {
texts = '2级'
} else if (value === 1.2) {
texts = '3级'
} else if (value === 2) {
texts = '4级'
}
return texts
}
}
},
options: {
series: [
//
{
name: '',
data: res.map((item: any) => {
if (item.ci == 0) {
return (item.ci = 0.05)
}
return item.ci.toFixed(2)
}),
barMaxWidth: 30,
barMinHeight: 1,
type: 'bar',
itemStyle: {
normal: {
color: function (params: any) {
if (params.value > 2 && params.value !== 0.05) {
return '#339966'
} else if (0.8 < params.value && params.value <= 1.2 && params.value !== 0.05) {
return '#3399FF'
} else if (0.4 < params.value && params.value <= 0.8 && params.value !== 0.05) {
return '#FF9900'
} else if (0 < params.value && params.value <= 0.4 && params.value !== 0.05) {
return '#CC0000'
} else if (params.value == 0.05) {
return '#CC0000'
}
}
}
},
markLine: {
silent: false,
symbol: 'circle',
lineStyle: {
color: 'red',
width: 1
},
emphasis: {
lineStyle: {
width: 1
}
},
data: [
{
name: '',
yAxis: 0.4,
lineStyle: {
color: '#CC0000'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#CC0000'
}
}
},
{
name: '',
yAxis: 0.8,
lineStyle: {
color: '#FF9900'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#FF9900'
}
}
},
{
name: '',
yAxis: 1.2,
lineStyle: {
color: '#3399FF'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#3399FF'
}
}
},
{
name: '',
yAxis: 2,
lineStyle: {
color: '#339966'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#339966'
}
}
}
]
}
}
]
}
}
}
onMounted(() => {
setTimeout(() => {
tableStore.index()
}, 10)
})
const layout = mainHeight(83) as any
const layout1 = mainHeight(93) as any
</script>
<style lang="scss" scoped>
.map {
height: v-bind('layout.height');
}
.tall {
height: calc(v-bind('layout1.height') / 2);
}
</style>

View File

@@ -0,0 +1,397 @@
<template>
<div class="default-main">
<TableHeader area date-picker ref="header" />
<div v-loading="tableStore.table.loading" class="pr10">
<el-row>
<el-col :span="12">
<MyEchartMap
ref="EchartMap"
:options="echartMapList"
class="map"
@eliminate="eliminate"
@getRegionByRegion="getRegionByRegion"
/>
</el-col>
<el-col :span="12">
<my-echart class="tall" :options="echartList" />
<div class="tall">
<vxe-table height="auto" auto-resize :data="distributionData" v-bind="defaultAttribute">
>
<vxe-column field="areaName" title=" 区域" show-overflow-tooltip></vxe-column>
<vxe-column field="ci" title="区域暂降评估">
<template #default="{ row }">
{{ row.ci == 0.05 ? '暂无数据' : row.ci.toFixed(2) }}
</template>
</vxe-column>
<vxe-column sortable field="isCount" title="等级">
<template #default="{ row }">
<span v-if="row.ci == 0.05">暂无等级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 0.2 && row.ci < 0.4">1级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 0.4 && row.ci < 0.8">2级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 0.8 && row.ci < 1.2">3级</span>
<span v-if="row.ci !== 0.05 && row.ci >= 1.2">4级</span>
</template>
</vxe-column>
</vxe-table>
</div>
</el-col>
</el-row>
</div>
<div class="dw">
<el-popover placement="left" :width="600" trigger="hover">
<template #reference>
<span class="level">详细区域暂降评估等级</span>
</template>
<vxe-table :data="areaData1" v-bind="defaultAttribute">
<vxe-column title="等级" field="level" min-width="90"></vxe-column>
<vxe-column title="1级" field="one" min-width="80"></vxe-column>
<vxe-column title="2级" field="two" min-width="90"></vxe-column>
<vxe-column title="3级" field="three" min-width="90"></vxe-column>
<vxe-column title="4级" field="four" min-width="90"></vxe-column>
</vxe-table>
</el-popover>
</div>
</div>
</template>
<script setup lang="ts">
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import MyEchartMap from '@/components/echarts/MyEchartMap.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import TableStore from '@/utils/tableStore'
import { ref, onMounted, provide } from 'vue'
import { mainHeight } from '@/utils/layout'
import { defaultAttribute } from '@/components/table/defaultAttribute'
defineOptions({
name: 'Region/distribution'
})
const EchartMap = ref()
const dictData = useDictData()
const echartMapList: any = ref({})
const echartList = ref({})
const header = ref()
const distributionData: any = ref([])
const areaData1: any = ref([
{
level: '相对得分',
one: '[0,0.4]',
two: '(0.4,0.8)',
three: '(0.8,1.2)',
four: '(1.2,+∞)'
}
])
const tableStore = new TableStore({
url: '/advance-boot/balance/getBalanceInfo',
method: 'POST',
column: [],
beforeSearchFun: () => {
tableStore.table.params.deptId = tableStore.table.params.deptIndex
},
loadCallback: () => {
header.value.areaRef.change()
// 处理地图数据
map(tableStore.table.data)
tabulation(tableStore.table.data)
histogram(tableStore.table.data)
EchartMap.value.GetEchar(header.value.areaRef.areaName)
}
})
provide('tableStore', tableStore)
tableStore.table.params.loadType = null
tableStore.table.params.deptId = dictData.state.area[0].id
// 地图点击事件
const getRegionByRegion = (list: any) => {
tableStore.table.params.deptIndex = list.id
tableStore.onTableAction('search', {})
}
// 消除点
const eliminate = (name: string) => {
echartMapList.value.options.series = []
EchartMap.value.GetEchar(name)
}
// 地图数处理
const map = (res: any) => {
let list: any = []
res.forEach((item: any) => {
list.push({
name: item.areaName,
value: item.ci
})
})
echartMapList.value = {
name: '',
title: {
text: '区域暂降评估'
},
visualMap: {
min: 0,
max: 2,
left: 26,
bottom: 20,
showLabel: !0,
pieces: [
{
gt: -2,
lte: -1,
label: '无数据'
},
{
gte: 0,
lte: 0.4,
label: '1级--相对得分 [0,0.4]'
},
{
gt: 0.4,
lte: 0.9,
label: '2级--得分 (0.4,0.8]'
},
{
gt: 0.9,
lte: 1.2,
label: '3级--相对得分 (0.8,1.2]'
},
{
gt: 1.2,
label: '4级--相对得分 (1.2,+∞]'
}
],
inRange: {
color: ['#ccc', '#CC0000', '#FF9900', '#3399CC', '#339966']
}
},
options: {
series: [
{
// type: "scatter",
type: 'map',
mapName: name,
coordinateSystem: 'geo',
geoIndex: 0,
animation: false, //坐标点是否显示动画
roam: true,
selectedMode: 'false', //是否允许选中多个区域
symbol: 'pin',
rippleEffect: {
brushType: 'fill' // stroke|fill
},
label: {
normal: {
show: false
},
emphasis: {
label: {
show: true
}
}
},
data: list
}
]
}
}
}
// 表格数据处理
const tabulation = (res: any) => {
distributionData.value = res
distributionData.value.forEach((item: any) => {
if (item.ci == 0) {
item.ci = 0.05
}
})
}
// 柱状图数据处理
const histogram = (res: any) => {
echartList.value = {
title: {
text: header.value.areaRef.areaName
},
tooltip: {
formatter: function (params: any) {
var tips = ''
for (var i = 0; i < params.length; i++) {
if (params[i].value == 0.05) {
tips += params[i].name + '</br>'
tips += '评估值:0'
} else {
tips += params[i].name + '</br>'
tips += '评估值:' + params[i].value
}
}
return tips
}
},
xAxis: {
name: '(区域)',
data: res.map((item: any) => item.areaName)
},
yAxis: {
name: ' 等级',
min: 0,
max: 2,
// minInterval: 0.2,
axisLabel: {
fontSize: 14,
// interval: 4,
formatter: function (value: any) {
var texts = ''
if (value === 0.4) {
texts = '1级'
} else if (value === 0.8) {
texts = '2级'
} else if (value === 1.2) {
texts = '3级'
} else if (value === 2) {
texts = '4级'
}
return texts
}
}
},
options: {
series: [
//
{
name: '',
data: res.map((item: any) => {
if (item.ci == 0) {
return (item.ci = 0.05)
}
return item.ci.toFixed(2)
}),
barMaxWidth: 30,
barMinHeight: 1,
type: 'bar',
itemStyle: {
normal: {
color: function (params: any) {
if (params.value > 2 && params.value !== 0.05) {
return '#339966'
} else if (0.8 < params.value && params.value <= 1.2 && params.value !== 0.05) {
return '#3399FF'
} else if (0.4 < params.value && params.value <= 0.8 && params.value !== 0.05) {
return '#FF9900'
} else if (0 < params.value && params.value <= 0.4 && params.value !== 0.05) {
return '#CC0000'
} else if (params.value == 0.05) {
return '#CC0000'
}
}
}
},
markLine: {
silent: false,
symbol: 'circle',
lineStyle: {
color: 'red',
width: 1
},
emphasis: {
lineStyle: {
width: 1
}
},
data: [
{
name: '',
yAxis: 0.4,
lineStyle: {
color: '#CC0000'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#CC0000'
}
}
},
{
name: '',
yAxis: 0.8,
lineStyle: {
color: '#FF9900'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#FF9900'
}
}
},
{
name: '',
yAxis: 1.2,
lineStyle: {
color: '#3399FF'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#3399FF'
}
}
},
{
name: '',
yAxis: 2,
lineStyle: {
color: '#339966'
},
label: {
// position: "middle",
formatter: '{b}',
textStyle: {
color: '#339966'
}
}
}
]
}
}
]
}
}
}
onMounted(() => {
setTimeout(() => {
tableStore.index()
}, 10)
})
const layout = mainHeight(83) as any
const layout1 = mainHeight(93) as any
</script>
<style lang="scss" scoped>
.map {
height: v-bind('layout.height');
}
.tall {
height: calc(v-bind('layout1.height') / 2);
}
.dw {
position: absolute;
top: 50px;
right: 50px;
width: 200px;
z-index: 2;
.level {
color: red;
cursor: pointer;
}
}
</style>