联调 有功功率分析页面
This commit is contained in:
26
src/api/harmonic-boot/newEnergyAnalysis.ts
Normal file
26
src/api/harmonic-boot/newEnergyAnalysis.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 根据监测点ID获取有功功率趋势
|
||||||
|
export function getDataByLineId(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/powerStatistics/getDataByLineId',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 根据监测点ID、有功功率趋势区间字段、时间获取该有功功率趋势下指标越限列表
|
||||||
|
export function getTargetLimitById(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/powerStatistics/getTargetLimitById',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 点击越限列表时间查询指标的详细数据
|
||||||
|
export function getTargetByTime(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/powerStatistics/getTargetByTime',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -21,8 +21,8 @@ import VueOfficeExcel from '@vue-office/excel'
|
|||||||
import VueOfficePdf from '@vue-office/pdf'
|
import VueOfficePdf from '@vue-office/pdf'
|
||||||
const { push, options, currentRoute } = useRouter()
|
const { push, options, currentRoute } = useRouter()
|
||||||
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
||||||
// http://192.168.1.22:9009/excelreport/onlineReport/%E7%94%B5%E8%83%BD%5B%E5%91%8A%5D2024%E5%B9%B41%E5%8F%B7-%E5%BC%A0%E5%AE%B6%E5%8F%A3%E5%9C%B0%E5%B8%82%20%E7%94%B5%E8%83%BD%E8%B4%A8%E9%87%8F%E6%8A%80%E6%9C%AF%E7%9B%91%E7%9D%A3%E5%91%8A%E8%AD%A6%E5%8D%95.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240807%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240807T021320Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=0173318ad09fa6cc9067123b6997f423c692c820ef9e185ca7dda300e5f7853c
|
const url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||||
const url = '/api-docx/excelreport' + cuwrrentRoute.value.href?.split('?')[1]
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log()
|
console.log()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -214,12 +214,15 @@ const map = (res: any) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data: res.map((item: any) => {
|
data:
|
||||||
return {
|
res.length == 0
|
||||||
...item,
|
? []
|
||||||
value: [item.lng, item.lat, item.lowPressure]
|
: res.map((item: any) => {
|
||||||
}
|
return {
|
||||||
}),
|
...item,
|
||||||
|
value: [item.lng, item.lat, item.lowPressure || 0]
|
||||||
|
}
|
||||||
|
}),
|
||||||
// data:[],
|
// data:[],
|
||||||
barSize: 1,
|
barSize: 1,
|
||||||
minHeight: 1,
|
minHeight: 1,
|
||||||
@@ -244,12 +247,15 @@ const map = (res: any) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data: res.map((item: any) => {
|
data:
|
||||||
return {
|
res.length == 0
|
||||||
...item,
|
? []
|
||||||
value: [item.lng - 0.07, item.lat, item.highPressure]
|
: res.map((item: any) => {
|
||||||
}
|
return {
|
||||||
}),
|
...item,
|
||||||
|
value: [item.lng - 0.07, item.lat, item.highPressure || 0]
|
||||||
|
}
|
||||||
|
}),
|
||||||
// [
|
// [
|
||||||
|
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<span class="text-large font-600 mr-3">{{ props.timePopUpBox.num }}</span>
|
<span class="text-large font-600 mr-3">{{ props.timePopUpBox.num }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio-group v-model="radio2">
|
<el-radio-group v-model="radio2" @change="tableStore.index()">
|
||||||
<el-radio-button label="基础数据" value="1" />
|
<el-radio-button label="基础数据" value="1" />
|
||||||
<el-radio-button label="谐波电压" value="2" />
|
<el-radio-button label="谐波电压" value="2" />
|
||||||
<el-radio-button label="谐波电流" value="3" />
|
<el-radio-button label="谐波电流" value="3" />
|
||||||
@@ -43,8 +43,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
})
|
})
|
||||||
const popupEditRef = ref()
|
const popupEditRef = ref()
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/user-boot/function/getRouteMenu',
|
url: '/harmonic-boot/powerStatistics/getTargetByTime',
|
||||||
method: 'GET',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '指标', field: 'name' },
|
{ title: '指标', field: 'name' },
|
||||||
{
|
{
|
||||||
@@ -84,6 +84,13 @@ const tableStore = new TableStore({
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
tableStore.table.params.field = props.timePopUpBox.field
|
||||||
|
tableStore.table.params.lineId = props.timePopUpBox.lineId
|
||||||
|
tableStore.table.params.searchBeginTime = props.timePopUpBox.time
|
||||||
|
tableStore.table.params.searchEndTime = props.timePopUpBox.time
|
||||||
|
tableStore.table.params.statisticalId = radio2.value
|
||||||
|
},
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
tableStore.table.data = [
|
tableStore.table.data = [
|
||||||
{ name: '电压偏差(%)', num: 0.0 },
|
{ name: '电压偏差(%)', num: 0.0 },
|
||||||
|
|||||||
@@ -55,23 +55,23 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-card class="cardBox">
|
<el-card class="cardBox">
|
||||||
<div class="mb5" style="display: flex; justify-content: space-between">
|
<div class="mb5" style="display: flex; justify-content: space-between">
|
||||||
<h3>有功功率趋势分析</h3>
|
<h3>功率区间</h3>
|
||||||
<div>
|
<div>
|
||||||
<span>图例: </span>
|
<span>稳态越限图例: </span>
|
||||||
<span style="color: red">稳态越限 </span>
|
<span style="color: red">越限 </span>
|
||||||
<span style="color: green">合格</span>
|
<span style="color: green">合格</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-card class="card-top">
|
<el-card class="card-top">
|
||||||
<div
|
<div
|
||||||
v-for="item in powerList1"
|
v-for="(item, index) in powerList1"
|
||||||
class="pd10"
|
class="pd10"
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
:class="flag == item.label ? 'hoverBox' : ''"
|
:class="flag == item.label ? 'hoverBox' : ''"
|
||||||
@click="handleClick(item.label)"
|
@click="analyseList(item.label, index)"
|
||||||
>
|
>
|
||||||
<div style="font-size: 24px; font-weight: 700">
|
<div style="font-size: 24px; font-weight: 700">
|
||||||
<span :style="{ color: item.crossTheLine === '越限' ? 'red' : 'green' }">
|
<span :style="{ color: item.crossTheLine > 0 ? 'red' : 'green' }">
|
||||||
{{ item.quantity }}
|
{{ item.quantity }}
|
||||||
</span>
|
</span>
|
||||||
<span style="font-size: 14px; font-weight: 500">个</span>
|
<span style="font-size: 14px; font-weight: 500">个</span>
|
||||||
@@ -84,14 +84,14 @@
|
|||||||
|
|
||||||
<el-card class="card-top mt15">
|
<el-card class="card-top mt15">
|
||||||
<div
|
<div
|
||||||
v-for="item in powerList2"
|
v-for="(item, index) in powerList2"
|
||||||
class="pd10"
|
class="pd10"
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
:class="flag == item.label ? 'hoverBox' : ''"
|
:class="flag == item.label ? 'hoverBox' : ''"
|
||||||
@click="handleClick(item.label)"
|
@click="analyseList(item.label, index + 5)"
|
||||||
>
|
>
|
||||||
<div style="font-size: 24px; font-weight: 700">
|
<div style="font-size: 24px; font-weight: 700">
|
||||||
<span :style="{ color: item.crossTheLine === '越限' ? 'red' : 'green' }">
|
<span :style="{ color: item.crossTheLine == '1' ? 'red' : 'green' }">
|
||||||
{{ item.quantity }}
|
{{ item.quantity }}
|
||||||
</span>
|
</span>
|
||||||
<span style="font-size: 14px; font-weight: 500">个</span>
|
<span style="font-size: 14px; font-weight: 500">个</span>
|
||||||
@@ -104,33 +104,115 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<el-card class="echart">
|
<el-card class="echart">
|
||||||
<my-echart :options="options" style="height: 198px" />
|
<my-echart :options="options" style="height: 238px" />
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="container mt10 ml10">
|
<div class="container mt10 ml10">
|
||||||
<el-card class="box">
|
<el-card class="box">
|
||||||
<div :style="heightB" style="overflow-y: auto">
|
<h3>功率区间稳态越限详情</h3>
|
||||||
|
<div :style="`height:calc(${heightB.height} - 25px)`" style="overflow-y: auto">
|
||||||
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="auto" :data="tableData">
|
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="auto" :data="tableData">
|
||||||
<vxe-column field="num" title="时间" min-width="100px">
|
<vxe-column field="num" title="时间" min-width="100px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" @click="timeClick(row)">{{ row.num }}</el-link>
|
<el-link
|
||||||
</template>
|
type="primary"
|
||||||
</vxe-column>
|
:underline="false"
|
||||||
<vxe-column field="num1" title="电压偏差(%)" />
|
class="percentage"
|
||||||
<vxe-column field="num2" title="谐波电压(%)" />
|
@click="timeClick(row)"
|
||||||
<vxe-column field="num3" title="谐波电流(%)" />
|
>
|
||||||
<vxe-column field="num4" title="三相电压不平衡度(%)" />
|
{{ row.time }}
|
||||||
<vxe-column field="num5" title="电压波动(%)" />
|
|
||||||
<vxe-column field="num6" title="闪变(%)" />
|
|
||||||
<vxe-column field="num7" title="间谐波电压含有率(%)" />
|
|
||||||
<vxe-column field="num8" title="流不平衡度" />
|
|
||||||
<vxe-column field="crossTheLine" title="越限情况">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-link :type="row.crossTheLine === '越限' ? 'danger' : 'success'">
|
|
||||||
<span @click="detailClick(row)">{{ row.crossTheLine }}</span>
|
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
|
<vxe-column field="voltageOffset" title="电压偏差(%)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.voltageOffset == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.voltageOffset == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="vtimes" title="谐波电压(%)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.vtimes == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.vtimes == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="itimes" title="谐波电流(%)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.itimes == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.itimes == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="ubalance" title="三相电压不平衡度(%)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.ubalance == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.ubalance == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="voltageFluctuation" title="电压波动(%)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.voltageFluctuation == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.voltageFluctuation == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="flicker" title="闪变(%)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.flicker == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.flicker == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="interHarmonic" title="间谐波电压含有率(%)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.interHarmonic == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.interHarmonic == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="sequenceCurrentUnbalance" title="电流不平衡度">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-link
|
||||||
|
:type="row.sequenceCurrentUnbalance == '1' ? 'danger' : 'success'"
|
||||||
|
class="percentage"
|
||||||
|
@click="timeClick(row)"
|
||||||
|
>
|
||||||
|
{{ row.sequenceCurrentUnbalance == '1' ? '越限' : '合格' }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
|
||||||
<vxe-column field="num3" title="操作">
|
<vxe-column field="num3" title="操作">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button type="primary" link @click="addTo(row)">添加</el-button>
|
<el-button type="primary" link @click="addTo(row)">添加</el-button>
|
||||||
@@ -144,28 +226,18 @@
|
|||||||
<div :style="heightB" style="overflow-y: auto">
|
<div :style="heightB" style="overflow-y: auto">
|
||||||
<div style="display: flex; justify-content: space-between">
|
<div style="display: flex; justify-content: space-between">
|
||||||
<span style="font-size: 16px; font-weight: 700">报告参数</span>
|
<span style="font-size: 16px; font-weight: 700">报告参数</span>
|
||||||
<el-radio-group v-model="radio2" size="small">
|
<el-button icon="el-icon-Download" size="small" type="primary">生成报表</el-button>
|
||||||
<el-radio-button label="统计结果" value="1" />
|
|
||||||
<el-radio-button label="原始数据" value="2" />
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-tree style="max-width: 600px" :data="dataSource" node-key="id" default-expand-all>
|
<el-tree style="max-width: 600px" :data="dataSource" node-key="id" default-expand-all>
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
<span class="custom-tree-node">
|
<span class="custom-tree-node">
|
||||||
<span>{{ node.label }}</span>
|
<span style="color: var(--el-color-primary)">{{ data.time }}</span>
|
||||||
<!-- <span>
|
<Close
|
||||||
<a style="margin-left: 8px" @click="remove(node, data)">删除</a>
|
|
||||||
</span> -->
|
|
||||||
<el-button
|
|
||||||
v-if="data.level != 0"
|
v-if="data.level != 0"
|
||||||
style="margin-left: 10px"
|
style="margin-left: 5px; height: 14px"
|
||||||
type="danger"
|
|
||||||
link
|
|
||||||
@click="remove(node, data)"
|
@click="remove(node, data)"
|
||||||
>
|
/>
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
@@ -177,10 +249,10 @@
|
|||||||
</splitpanes>
|
</splitpanes>
|
||||||
<!-- 时间弹框 -->
|
<!-- 时间弹框 -->
|
||||||
<timePopUpBox
|
<timePopUpBox
|
||||||
|
v-if="timePopUpBox"
|
||||||
ref="timePopUpBoxRef"
|
ref="timePopUpBoxRef"
|
||||||
:timePopUpBox="timePopUpBox"
|
:timePopUpBox="timePopUpBox"
|
||||||
@close="timePopUpBox = null"
|
@close="timePopUpBox = null"
|
||||||
v-if="timePopUpBox"
|
|
||||||
/>
|
/>
|
||||||
<!-- 越限详情 -->
|
<!-- 越限详情 -->
|
||||||
<detail ref="detailRef" />
|
<detail ref="detailRef" />
|
||||||
@@ -199,7 +271,9 @@ import { mainHeight } from '@/utils/layout'
|
|||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
import TimePopUpBox from './components/timePopUpBox.vue'
|
import TimePopUpBox from './components/timePopUpBox.vue'
|
||||||
|
import { getDataByLineId, getTargetLimitById, getTargetByTime } from '@/api/harmonic-boot/newEnergyAnalysis'
|
||||||
import detail from './components/detail.vue'
|
import detail from './components/detail.vue'
|
||||||
|
import { Close } from '@element-plus/icons-vue'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'newEnergy/newEnergyAnalysis'
|
name: 'newEnergy/newEnergyAnalysis'
|
||||||
})
|
})
|
||||||
@@ -212,42 +286,42 @@ const size = ref(0)
|
|||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const detailRef = ref()
|
const detailRef = ref()
|
||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
const power = ref([])
|
|
||||||
const timePopUpBoxRef = ref()
|
const timePopUpBoxRef = ref()
|
||||||
const index = ref([])
|
const index = ref(0)
|
||||||
|
|
||||||
const powerList1: any = ref([
|
const powerList1: any = ref([
|
||||||
{
|
{
|
||||||
label: '0%~10%',
|
label: '0%~10%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '越限',
|
crossTheLine: '越限',
|
||||||
value: '0%~10%'
|
value: '0%~10%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '10%~20%',
|
label: '10%~20%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '合格',
|
crossTheLine: '合格',
|
||||||
value: '10%~10%'
|
value: '10%~10%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '20%~30%',
|
label: '20%~30%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '合格',
|
crossTheLine: '合格',
|
||||||
value: '10%~30%'
|
value: '10%~30%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '30%~40%',
|
label: '30%~40%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '合格',
|
crossTheLine: '合格',
|
||||||
value: '30%~40%'
|
value: '30%~40%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '40%~50%',
|
label: '40%~50%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '合格',
|
crossTheLine: '合格',
|
||||||
value: '40%~50%'
|
value: '40%~50%'
|
||||||
@@ -256,28 +330,28 @@ const powerList1: any = ref([
|
|||||||
const powerList2: any = ref([
|
const powerList2: any = ref([
|
||||||
{
|
{
|
||||||
label: '50%~60%',
|
label: '50%~60%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '合格',
|
crossTheLine: '合格',
|
||||||
value: '50%~60%'
|
value: '50%~60%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '60%~70%',
|
label: '60%~70%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '合格',
|
crossTheLine: '合格',
|
||||||
value: '60%~70%'
|
value: '60%~70%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '70%~80%',
|
label: '70%~80%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '合格',
|
crossTheLine: '合格',
|
||||||
value: '70%~80%'
|
value: '70%~80%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '80%~90%',
|
label: '80%~90%',
|
||||||
quantity: '20',
|
quantity: '0',
|
||||||
percentage: '10%',
|
percentage: '10%',
|
||||||
crossTheLine: '越限',
|
crossTheLine: '越限',
|
||||||
value: '80%~90%'
|
value: '80%~90%'
|
||||||
@@ -291,92 +365,88 @@ const powerList2: any = ref([
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
const tableData: any = ref([
|
const tableData: any = ref([])
|
||||||
{
|
const dataSource: any = ref([
|
||||||
num: '2023-08-08 09:00:00',
|
|
||||||
num1: '0',
|
|
||||||
num2: '1',
|
|
||||||
num3: '3',
|
|
||||||
num4: '2',
|
|
||||||
num5: '1',
|
|
||||||
num6: '1',
|
|
||||||
num7: '1',
|
|
||||||
num8: '0',
|
|
||||||
crossTheLine: '越限'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
const dataSource = ref([
|
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '0%~10%',
|
time: '0%~10%',
|
||||||
children: [
|
children: []
|
||||||
{
|
|
||||||
id: 11,
|
|
||||||
label: '测试',
|
|
||||||
children: []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '10%~20%',
|
time: '10%~20%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '20%~30%',
|
time: '20%~30%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '30%~40%',
|
time: '30%~40%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '40%~50%',
|
time: '40%~50%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 6,
|
id: 6,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '50%~60%',
|
time: '50%~60%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 7,
|
id: 7,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '60%~70%',
|
time: '60%~70%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 8,
|
id: 8,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '70%~80%',
|
time: '70%~80%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 9,
|
id: 9,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '80%~90%',
|
time: '80%~90%',
|
||||||
children: []
|
children: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
level: 0,
|
level: 0,
|
||||||
label: '90%~100%',
|
time: '90%~100%',
|
||||||
children: []
|
children: []
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
// 添加树
|
// 添加树
|
||||||
const addTo = row => {
|
const addTo = (row: any) => {
|
||||||
console.log('🚀 ~ addTo ~ row:', row)
|
// console.log("🚀 ~ addTo ~ uniqueObjectsByJSON([...dataSource.value[index.value].children, row]):", uniqueObjectsByJSON([...dataSource.value[index.value].children, row])[0].time)
|
||||||
|
let list = JSON.parse(JSON.stringify(dataSource.value[index.value].children))
|
||||||
|
dataSource.value[index.value].children = uniqueObjectsByJSON([...list, row])
|
||||||
}
|
}
|
||||||
|
// 树去重
|
||||||
|
const uniqueObjectsByJSON = (arr: any) => {
|
||||||
|
const seen = new Set()
|
||||||
|
return arr.filter((item: any) => {
|
||||||
|
const str = JSON.stringify(item)
|
||||||
|
if (!seen.has(str)) {
|
||||||
|
seen.add(str)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 树删除
|
// 树删除
|
||||||
const remove = (node: any, data: any) => {
|
const remove = (node: any, data: any) => {
|
||||||
const parent = node.parent
|
const parent = node.parent
|
||||||
@@ -395,17 +465,182 @@ const tableStore = new TableStore({
|
|||||||
loadCallback: () => {}
|
loadCallback: () => {}
|
||||||
})
|
})
|
||||||
// 卡片点击变色
|
// 卡片点击变色
|
||||||
const handleClick = (e: string) => {
|
|
||||||
flag.value = e
|
|
||||||
}
|
|
||||||
// 点击时间
|
// 点击时间
|
||||||
const timeClick = (row: any) => {
|
const timeClick = (row: any) => {
|
||||||
timePopUpBox.value = row
|
let data = {
|
||||||
|
...row,
|
||||||
|
field: index.value,
|
||||||
|
lineId: dotList.value.id
|
||||||
|
}
|
||||||
|
timePopUpBox.value = data
|
||||||
}
|
}
|
||||||
// 点击越限
|
// 点击越限
|
||||||
const detailClick = (row: any) => {
|
const detailClick = (row: any) => {
|
||||||
detailRef.value.open()
|
detailRef.value.open()
|
||||||
}
|
}
|
||||||
|
// 获取有功功率趋势分析数据
|
||||||
|
const analyse = (e: any) => {
|
||||||
|
getDataByLineId({
|
||||||
|
lineId: e.id,
|
||||||
|
searchBeginTime: TableHeaderRef.value.datePickerRef.timeValue[0],
|
||||||
|
searchEndTime: TableHeaderRef.value.datePickerRef.timeValue[1]
|
||||||
|
}).then(res => {
|
||||||
|
let mun =
|
||||||
|
res.data.minsNum1 +
|
||||||
|
res.data.minsNum2 +
|
||||||
|
res.data.minsNum3 +
|
||||||
|
res.data.minsNum4 +
|
||||||
|
res.data.minsNum5 +
|
||||||
|
res.data.minsNum6 +
|
||||||
|
res.data.minsNum7 +
|
||||||
|
res.data.minsNum8 +
|
||||||
|
res.data.minsNum9
|
||||||
|
powerList1.value = [
|
||||||
|
{
|
||||||
|
label: '0%~10%',
|
||||||
|
quantity: res.data.minsNum0,
|
||||||
|
percentage: ((res.data.minsNum0 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot0,
|
||||||
|
value: '0%~10%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '10%~20%',
|
||||||
|
quantity: res.data.minsNum1,
|
||||||
|
percentage: ((res.data.minsNum1 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot1,
|
||||||
|
value: '10%~10%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '20%~30%',
|
||||||
|
quantity: res.data.minsNum2,
|
||||||
|
percentage: ((res.data.minsNum2 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot2,
|
||||||
|
value: '10%~30%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '30%~40%',
|
||||||
|
quantity: res.data.minsNum3,
|
||||||
|
percentage: ((res.data.minsNum3 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot3,
|
||||||
|
value: '30%~40%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '40%~50%',
|
||||||
|
quantity: res.data.minsNum4,
|
||||||
|
percentage: ((res.data.minsNum4 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot4,
|
||||||
|
value: '40%~50%'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
powerList2.value = [
|
||||||
|
{
|
||||||
|
label: '50%~60%',
|
||||||
|
quantity: res.data.minsNum5,
|
||||||
|
percentage: ((res.data.minsNum5 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot5,
|
||||||
|
value: '50%~60%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '60%~70%',
|
||||||
|
quantity: res.data.minsNum6,
|
||||||
|
percentage: ((res.data.minsNum6 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot6,
|
||||||
|
value: '60%~70%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '70%~80%',
|
||||||
|
quantity: res.data.minsNum7,
|
||||||
|
percentage: ((res.data.minsNum7 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot7,
|
||||||
|
value: '70%~80%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '80%~90%',
|
||||||
|
quantity: res.data.minsNum8,
|
||||||
|
percentage: ((res.data.minsNum8 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot8,
|
||||||
|
value: '80%~90%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '90%~100%',
|
||||||
|
quantity: res.data.minsNum9,
|
||||||
|
percentage: ((res.data.minsNum9 / mun) * 100).toFixed(2) + '%',
|
||||||
|
crossTheLine: res.data.isOrNot9,
|
||||||
|
value: '90%~100%'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
options.value = {
|
||||||
|
title: {
|
||||||
|
text: '有功率区间占比',
|
||||||
|
left: '10px'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
tooltip: {},
|
||||||
|
xAxis: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
dataZoom: { show: false },
|
||||||
|
|
||||||
|
options: {
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
type: 'pie',
|
||||||
|
center: ['50%', '60%'],
|
||||||
|
selectedOffset: 30,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
color: '#96A2B5',
|
||||||
|
lineHeight: 8,
|
||||||
|
minMargin: 10,
|
||||||
|
formatter: function (e) {
|
||||||
|
return '{name|' + e.name + '}{percent|' + e.data.percentage + '}'
|
||||||
|
},
|
||||||
|
rich: {
|
||||||
|
name: {
|
||||||
|
fontSize: 12
|
||||||
|
},
|
||||||
|
|
||||||
|
percent: {
|
||||||
|
fontSize: 14,
|
||||||
|
color: '#000',
|
||||||
|
padding: [0, 0, 0, 5]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: [
|
||||||
|
...powerList1.value.map(item => {
|
||||||
|
return { value: item.quantity, name: item.label, percentage: item.percentage }
|
||||||
|
}),
|
||||||
|
...powerList2.value.map(item => {
|
||||||
|
return { value: item.quantity, name: item.label, percentage: item.percentage }
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 功率列表
|
||||||
|
const analyseList = (e: string, i: number) => {
|
||||||
|
flag.value = e
|
||||||
|
index.value = i
|
||||||
|
getTargetLimitById({
|
||||||
|
lineId: dotList.value.id,
|
||||||
|
searchBeginTime: TableHeaderRef.value.datePickerRef.timeValue[0],
|
||||||
|
searchEndTime: TableHeaderRef.value.datePickerRef.timeValue[1],
|
||||||
|
statisticalId: i
|
||||||
|
}).then(res => {
|
||||||
|
tableData.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -413,65 +648,18 @@ onMounted(() => {
|
|||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||||
}
|
}
|
||||||
options.value = {
|
})
|
||||||
title: {
|
let control = ref(true)
|
||||||
text: '占比',
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
left: '10px'
|
console.log('🚀 ~ handleNodeClick ~ data:', data)
|
||||||
},
|
if (data.level == 6) {
|
||||||
legend: {
|
dotList.value = data
|
||||||
show: false
|
analyse(data)
|
||||||
},
|
if (control.value) {
|
||||||
tooltip: {},
|
analyseList('0%~10%', 0)
|
||||||
xAxis: {
|
control.value = false
|
||||||
show: false
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
dataZoom: { show: false },
|
|
||||||
|
|
||||||
options: {
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
type: 'pie',
|
|
||||||
center: ['50%', '50%'],
|
|
||||||
selectedOffset: 30,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
color: '#96A2B5',
|
|
||||||
lineHeight: 8,
|
|
||||||
minMargin: 10,
|
|
||||||
formatter: function (e) {
|
|
||||||
return '{name|' + e.name + '}{percent|' + e.data.percentage + '}'
|
|
||||||
},
|
|
||||||
rich: {
|
|
||||||
name: {
|
|
||||||
fontSize: 12
|
|
||||||
},
|
|
||||||
|
|
||||||
percent: {
|
|
||||||
fontSize: 14,
|
|
||||||
color: '#000',
|
|
||||||
padding: [0, 0, 0, 5]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data: [
|
|
||||||
...powerList1.value.map(item => {
|
|
||||||
return { value: item.quantity, name: item.label, percentage: item.percentage }
|
|
||||||
}),
|
|
||||||
...powerList2.value.map(item => {
|
|
||||||
return { value: item.quantity, name: item.label, percentage: item.percentage }
|
|
||||||
})
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
|
||||||
dotList.value = data
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -521,4 +709,8 @@ const handleNodeClick = (data: any, node: any) => {
|
|||||||
background-color: var(--el-color-primary-light-5);
|
background-color: var(--el-color-primary-light-5);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
.percentage {
|
||||||
|
text-decoration: underline;
|
||||||
|
text-underline-offset: 0.1em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user