Compare commits
16 Commits
2025-10
...
ff2b9db7b8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff2b9db7b8 | ||
|
|
289900f9ff | ||
|
|
e87d05c587 | ||
| 46c55d48ec | |||
| b36f765d07 | |||
|
|
0fe2d2b911 | ||
|
|
8c41a8fc77 | ||
|
|
c779bec0cb | ||
|
|
5443996fa9 | ||
|
|
dac950c4c1 | ||
|
|
a19cbf233e | ||
|
|
028fd44490 | ||
|
|
0a52d1afae | ||
|
|
e655611954 | ||
|
|
b982cee382 | ||
|
|
d6336f7ba8 |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
BIN
public/favicon3.ico
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -30,3 +30,18 @@ export const getSubstationSelect = () => {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询变电站详情
|
||||||
|
export const getSubstationSelectLine = (id: string) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getSubstationData',
|
||||||
|
method: 'post',
|
||||||
|
data: [id]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询监测点
|
||||||
|
export const getLineOverLimitData = (id: string) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getLineOverLimitData?id=' + id,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -165,3 +165,12 @@ export function getSupervisionDetailsData(data: any) {
|
|||||||
export function getSupervisionCityDetailsData(data: any) {
|
export function getSupervisionCityDetailsData(data: any) {
|
||||||
return request({ url: '/supervision-boot/gridDiagram/getSupervisionCityDetailsData', method: 'post', data })
|
return request({ url: '/supervision-boot/gridDiagram/getSupervisionCityDetailsData', method: 'post', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//区域污染值统计
|
||||||
|
export function getAreaPollution(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/PollutionSubstation/getAreaPollution', method: 'post', data })
|
||||||
|
}
|
||||||
|
//场站级评估
|
||||||
|
export function downPollutionSubCalc(data: any) {
|
||||||
|
return request({ url: 'harmonic-boot/PollutionSubstation/downPollutionSubCalc', method: 'post', data })
|
||||||
|
}
|
||||||
119
src/api/harmonic-boot/cockpit/cockpit.ts
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 主要监测点列表查询>>分页
|
||||||
|
export function mainLineList(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/mainLine/list',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主要监测点指标越限详情
|
||||||
|
export function statLimitRateDetails(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/mainLine/statLimitRateDetails',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询监测点列表=全部>>不分页
|
||||||
|
export function cslineList(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/csline/list',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监测点详情 趋势图数据
|
||||||
|
export function trendData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/csGroup/trendData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 每日越限占比统计
|
||||||
|
export function totalLimitStatisticsDetails(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/totalLimitStatistics/details',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 总体指标越限统计列表
|
||||||
|
export function totalLimitStatisticsList(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/totalLimitStatistics/list',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 总体指标越限统计数据
|
||||||
|
export function totalLimitStatisticsData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/totalLimitStatistics/data',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 指标越限程度数据
|
||||||
|
export function limitExtentData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/limitRateDetailD/limitExtentData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 指标日趋势图数据
|
||||||
|
export function limitExtentDayData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/limitRateDetailD/limitExtentDayData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 指标越限明细日历数据
|
||||||
|
export function limitCalendarData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/limitRateDetailD/limitCalendarData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//指标拟合图数据
|
||||||
|
export function fittingData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/cs-device-boot/csGroup/fittingData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//指标越限时间概率分布
|
||||||
|
export function limitTimeProbabilityData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/limitRateDetailD/limitTimeProbabilityData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//指标越限程度概率分布
|
||||||
|
export function limitProbabilityData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/harmonic-boot/limitRateDetailD/limitProbabilityData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
// 查询指标
|
// 查询指标
|
||||||
export const queryStatistical = (id: string) => {
|
export const queryStatistical = (id:string) => {
|
||||||
let form = new FormData()
|
let form = new FormData()
|
||||||
form.append('id', id)
|
form.append('id', id)
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -14,13 +14,14 @@ export const queryStatistical = (id: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 绑定指标
|
// 绑定指标
|
||||||
export const addStatistical = (params: any) => {
|
export const addStatistical = (params:any) => {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/system-boot/csstatisticalset/addStatistical',
|
url: '/system-boot/csstatisticalset/addStatistical',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增驾驶舱页面
|
// 新增驾驶舱页面
|
||||||
export const addDashboard = (data: any) => {
|
export const addDashboard = (data: any) => {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -68,3 +69,19 @@ export const queryById = (params: any) => {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 更具id 查询驾驶舱页面
|
||||||
|
export const queryByPagePath = (params: any) => {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/dashboard/queryByPagePath',
|
||||||
|
method: 'post',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 根据用户id查询用户驾驶舱
|
||||||
|
export const getDashboardPageByUserId = (params: any) => {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/dashboard/getDashboardPageByUserId',
|
||||||
|
method: 'post',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,6 +54,24 @@
|
|||||||
<div class="content unicode" style="display: block;">
|
<div class="content unicode" style="display: block;">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">停运事件管理</div>
|
||||||
|
<div class="code-name">&#xe65d;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">在运设备</div>
|
||||||
|
<div class="code-name">&#xe604;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">异常类_14非智能表在运异常</div>
|
||||||
|
<div class="code-name">&#xe666;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<span class="icon iconfont"></span>
|
<span class="icon iconfont"></span>
|
||||||
<div class="name">综合评价</div>
|
<div class="name">综合评价</div>
|
||||||
@@ -234,9 +252,9 @@
|
|||||||
<pre><code class="language-css"
|
<pre><code class="language-css"
|
||||||
>@font-face {
|
>@font-face {
|
||||||
font-family: 'iconfont';
|
font-family: 'iconfont';
|
||||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
src: url('iconfont.woff2?t=1764826411334') format('woff2'),
|
||||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
url('iconfont.woff?t=1764826411334') format('woff'),
|
||||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
url('iconfont.ttf?t=1764826411334') format('truetype');
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||||
@@ -262,6 +280,33 @@
|
|||||||
<div class="content font-class">
|
<div class="content font-class">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-tingyunshijianguanli"></span>
|
||||||
|
<div class="name">
|
||||||
|
停运事件管理
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-tingyunshijianguanli
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-zaiyunshebei"></span>
|
||||||
|
<div class="name">
|
||||||
|
在运设备
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-zaiyunshebei
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-yichanglei_14feizhinengbiaozaiyunyichang"></span>
|
||||||
|
<div class="name">
|
||||||
|
异常类_14非智能表在运异常
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-yichanglei_14feizhinengbiaozaiyunyichang
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<span class="icon iconfont icon-zonghepingjia1"></span>
|
<span class="icon iconfont icon-zonghepingjia1"></span>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -532,6 +577,30 @@
|
|||||||
<div class="content symbol">
|
<div class="content symbol">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-tingyunshijianguanli"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">停运事件管理</div>
|
||||||
|
<div class="code-name">#icon-tingyunshijianguanli</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-zaiyunshebei"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">在运设备</div>
|
||||||
|
<div class="code-name">#icon-zaiyunshebei</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-yichanglei_14feizhinengbiaozaiyunyichang"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">异常类_14非智能表在运异常</div>
|
||||||
|
<div class="code-name">#icon-yichanglei_14feizhinengbiaozaiyunyichang</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<svg class="icon svg-icon" aria-hidden="true">
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-zonghepingjia1"></use>
|
<use xlink:href="#icon-zonghepingjia1"></use>
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 3482754 */
|
font-family: 'iconfont';
|
||||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
src: url('/src/assets/font/iconfont.woff2?t=1764826411334') format('woff2'),
|
||||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
url('/src/assets/font/iconfont.woff?t=1764826411334') format('woff'),
|
||||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
url('/src/assets/font/iconfont.ttf?t=1764826411334') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-family: "iconfont" !important;
|
font-family: "iconfont" !important;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
@@ -13,6 +12,18 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-tingyunshijianguanli:before {
|
||||||
|
content: "\e65d";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-zaiyunshebei:before {
|
||||||
|
content: "\e604";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-yichanglei_14feizhinengbiaozaiyunyichang:before {
|
||||||
|
content: "\e666";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-zonghepingjia1:before {
|
.icon-zonghepingjia1:before {
|
||||||
content: "\e82f";
|
content: "\e82f";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,27 @@
|
|||||||
"css_prefix_text": "icon-",
|
"css_prefix_text": "icon-",
|
||||||
"description": "",
|
"description": "",
|
||||||
"glyphs": [
|
"glyphs": [
|
||||||
|
{
|
||||||
|
"icon_id": "25458995",
|
||||||
|
"name": "停运事件管理",
|
||||||
|
"font_class": "tingyunshijianguanli",
|
||||||
|
"unicode": "e65d",
|
||||||
|
"unicode_decimal": 58973
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "35341056",
|
||||||
|
"name": "在运设备",
|
||||||
|
"font_class": "zaiyunshebei",
|
||||||
|
"unicode": "e604",
|
||||||
|
"unicode_decimal": 58884
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "22630860",
|
||||||
|
"name": "异常类_14非智能表在运异常",
|
||||||
|
"font_class": "yichanglei_14feizhinengbiaozaiyunyichang",
|
||||||
|
"unicode": "e666",
|
||||||
|
"unicode_decimal": 58982
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "32402696",
|
"icon_id": "32402696",
|
||||||
"name": "综合评价",
|
"name": "综合评价",
|
||||||
|
|||||||
BIN
src/assets/img/amplify.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
src/assets/img/lightning.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
src/assets/img/reduce.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
295
src/assets/img/view.vue
Normal file
@@ -0,0 +1,295 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<!-- <div class=" layoutHeader">
|
||||||
|
<div class="title">{{title}}</div>
|
||||||
|
<back-component />
|
||||||
|
</div> -->
|
||||||
|
<TableHeader :showSearch="false">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label="统计时间">
|
||||||
|
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-slot:operation>
|
||||||
|
<back-component />
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<GridLayout
|
||||||
|
v-model:layout="layout"
|
||||||
|
:row-height="rowHeight"
|
||||||
|
:is-resizable="false"
|
||||||
|
:is-draggable="false"
|
||||||
|
:responsive="false"
|
||||||
|
:vertical-compact="false"
|
||||||
|
prevent-collision
|
||||||
|
:col-num="12"
|
||||||
|
>
|
||||||
|
<template #item="{ item }">
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<Icon class="HelpFilled" :name="item.icon" />
|
||||||
|
{{ item.name }}
|
||||||
|
</div>
|
||||||
|
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="zoom(item)" /> -->
|
||||||
|
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="zoom(item)" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<component
|
||||||
|
:is="item.component"
|
||||||
|
v-if="item.component"
|
||||||
|
class="pd10"
|
||||||
|
:key="key"
|
||||||
|
:timeValue="datePickerRef.timeValue"
|
||||||
|
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||||
|
:width="rowWidth * item.w - 30 + 'px'"
|
||||||
|
:timeKey="item.timeKey"
|
||||||
|
/>
|
||||||
|
<div v-else class="pd10">组件加载失败...</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</GridLayout>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive, onMounted, markRaw, onUnmounted, defineAsyncComponent, type Component } from 'vue'
|
||||||
|
import { GridLayout } from 'grid-layout-plus'
|
||||||
|
import { useDebounceFn } from '@vueuse/core'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||||
|
import BackComponent from '@/components/icon/back/index.vue'
|
||||||
|
import { queryById } from '@/api/system-boot/csstatisticalset'
|
||||||
|
import { HelpFilled, FullScreen } from '@element-plus/icons-vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
// defineOptions({
|
||||||
|
// name: 'cockpit/view'
|
||||||
|
// })
|
||||||
|
const { query } = useRoute()
|
||||||
|
// 定义类型
|
||||||
|
interface LayoutItem {
|
||||||
|
x: number
|
||||||
|
y: number
|
||||||
|
w: number
|
||||||
|
h: number
|
||||||
|
i: string | number
|
||||||
|
name: string
|
||||||
|
path: string
|
||||||
|
component?: Component | string
|
||||||
|
loading?: boolean
|
||||||
|
error?: any
|
||||||
|
}
|
||||||
|
const datePickerRef = ref()
|
||||||
|
const title = ref('')
|
||||||
|
const key = ref(0)
|
||||||
|
const img = new URL(`@/assets/img/amplify.png`, import.meta.url)
|
||||||
|
const img1 = new URL(`@/assets/img/reduce.png`, import.meta.url)
|
||||||
|
// 响应式数据
|
||||||
|
const rowHeight = ref(0)
|
||||||
|
const rowWidth = ref(0)
|
||||||
|
const layout: any = ref<LayoutItem[]>([
|
||||||
|
// {
|
||||||
|
// x: 4,
|
||||||
|
// y: 0,
|
||||||
|
// w: 4,
|
||||||
|
// h: 2,
|
||||||
|
// i: '1',
|
||||||
|
// name: '',
|
||||||
|
// path: '/src/views/pqs/runManage/assessment/components/uese/index.vue'
|
||||||
|
// },
|
||||||
|
])
|
||||||
|
const layoutCopy = ref<LayoutItem[]>([])
|
||||||
|
const flag = ref(true)
|
||||||
|
// 组件映射
|
||||||
|
const componentMap = reactive(new Map<string, Component | string>())
|
||||||
|
|
||||||
|
// 获取主内容区域高度
|
||||||
|
const getMainHeight = () => {
|
||||||
|
const elMain = document.querySelector('.el-main')
|
||||||
|
return (elMain?.offsetHeight || 0) - 70
|
||||||
|
}
|
||||||
|
// 获取主内容区域高度
|
||||||
|
const getMainWidth = () => {
|
||||||
|
const elMain = document.querySelector('.el-main')
|
||||||
|
return (elMain?.offsetWidth || 0) - 20
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化行高
|
||||||
|
const initRowHeight = () => {
|
||||||
|
rowHeight.value = Math.max(0, (getMainHeight() - 72) / 6)
|
||||||
|
rowWidth.value = Math.max(0, getMainWidth() / 12)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动态注册组件
|
||||||
|
const registerComponent = (path: string): Component | string | null => {
|
||||||
|
if (!path) return null
|
||||||
|
|
||||||
|
const cacheKey = path
|
||||||
|
|
||||||
|
// 使用缓存的组件
|
||||||
|
if (componentMap.has(cacheKey)) {
|
||||||
|
return componentMap.get(cacheKey)!
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 动态导入组件
|
||||||
|
const modules = import.meta.glob('@/**/*.vue')
|
||||||
|
if (!modules[path]) {
|
||||||
|
console.error(`组件加载失败: ${path}`)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const AsyncComponent = defineAsyncComponent({
|
||||||
|
loader: modules[path],
|
||||||
|
loadingComponent: () => h('div', '加载中...'),
|
||||||
|
errorComponent: ({ error }) => h('div', `加载错误: ${error.message}`),
|
||||||
|
delay: 200,
|
||||||
|
timeout: 10000
|
||||||
|
})
|
||||||
|
|
||||||
|
// 保存到映射中
|
||||||
|
componentMap.set(cacheKey, markRaw(AsyncComponent))
|
||||||
|
return AsyncComponent
|
||||||
|
} catch (error) {
|
||||||
|
console.error('注册组件失败:', error)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 缩放
|
||||||
|
const zoom = (value: any) => {
|
||||||
|
if (flag.value) {
|
||||||
|
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
|
||||||
|
} else {
|
||||||
|
layout.value = layoutCopy.value.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
i: item.i || index, // 确保有唯一标识
|
||||||
|
component: registerComponent(item.path)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
flag.value = !flag.value
|
||||||
|
key.value += 1
|
||||||
|
}
|
||||||
|
// 获取布局数据
|
||||||
|
const fetchLayoutData = async () => {
|
||||||
|
try {
|
||||||
|
const { data } = await queryById({ id: query.id })
|
||||||
|
title.value = data.pageName + '_预览'
|
||||||
|
const parsedLayout = JSON.parse(data.containerConfig || '[]') as LayoutItem[]
|
||||||
|
// 处理布局数据
|
||||||
|
layout.value = parsedLayout.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
i: item.i || index, // 确保有唯一标识
|
||||||
|
component: registerComponent(item.path)
|
||||||
|
}))
|
||||||
|
layoutCopy.value = JSON.parse(JSON.stringify(layout.value))
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取布局数据失败:', error)
|
||||||
|
// 可以添加错误提示逻辑
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算组件高度
|
||||||
|
const seRowHeight = (value: any) => {
|
||||||
|
if (value == 6) return 0
|
||||||
|
if (value == 5) return 12
|
||||||
|
if (value == 4) return 20
|
||||||
|
if (value == 3) return 30
|
||||||
|
if (value == 2) return 40
|
||||||
|
if (value == 1) return 50
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 窗口大小变化处理 - 使用防抖
|
||||||
|
const handleResize = useDebounceFn(() => {
|
||||||
|
initRowHeight()
|
||||||
|
key.value += 1
|
||||||
|
}, 200)
|
||||||
|
|
||||||
|
// 生命周期钩子
|
||||||
|
onMounted(() => {
|
||||||
|
initRowHeight()
|
||||||
|
fetchLayoutData()
|
||||||
|
|
||||||
|
// 添加窗口大小变化监听器
|
||||||
|
window.addEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
// 移除监听器防止内存泄漏
|
||||||
|
window.removeEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.vgl-layout {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item:not(.vgl-item--placeholder)) {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item:hover:not(.vgl-item--placeholder)) {
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item--static) {
|
||||||
|
background-color: #f0f2f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item) {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
font-size: 14px;
|
||||||
|
height: 30px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0px 10px;
|
||||||
|
color: #fff;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.HelpFilled {
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
color: #fff !important;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.layoutHeader {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -18,14 +18,22 @@ import VueOfficeDocx from '@vue-office/docx'
|
|||||||
import VueOfficeExcel from '@vue-office/excel'
|
import VueOfficeExcel from '@vue-office/excel'
|
||||||
//引入VueOfficePdf组件
|
//引入VueOfficePdf组件
|
||||||
import VueOfficePdf from '@vue-office/pdf'
|
import VueOfficePdf from '@vue-office/pdf'
|
||||||
|
import { downloadFile } from '@/api/system-boot/file'
|
||||||
const { push, options, currentRoute } = useRouter()
|
const { push, options, currentRoute } = useRouter()
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
// 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]
|
||||||
|
const url = ref('')
|
||||||
|
const excelOptions = ref({})
|
||||||
|
if(VITE_FLAG){
|
||||||
|
url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||||
|
excelOptions.value = ref({
|
||||||
|
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
//下载
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
|
||||||
console.log("🚀 ~ url:", url)
|
|
||||||
const excelOptions = ref({
|
|
||||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
|
||||||
})
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log()
|
console.log()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,11 +61,11 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, watch, onMounted, onUnmounted, ref, nextTick, getCurrentInstance, toRaw } from 'vue'
|
import { reactive, watch, onMounted, onUnmounted, ref, nextTick, getCurrentInstance, toRaw } from 'vue'
|
||||||
import { getSelectData } from '@/api/common'
|
// import { getSelectData } from '@/api/common'
|
||||||
import { uuid } from '@/utils/random'
|
import { uuid } from '@/utils/random'
|
||||||
import type { ElSelect } from 'element-plus'
|
import type { ElSelect } from 'element-plus'
|
||||||
import { isEmpty } from 'lodash-es'
|
import { isEmpty } from 'lodash-es'
|
||||||
import { getArrayKey } from '@/utils/common'
|
// import { getArrayKey } from '@/utils/common'
|
||||||
|
|
||||||
const selectRef = ref<InstanceType<typeof ElSelect> | undefined>()
|
const selectRef = ref<InstanceType<typeof ElSelect> | undefined>()
|
||||||
type ElSelectProps = Partial<InstanceType<typeof ElSelect>['$props']>
|
type ElSelectProps = Partial<InstanceType<typeof ElSelect>['$props']>
|
||||||
@@ -140,15 +140,15 @@ const onChangeSelect = (val: valType) => {
|
|||||||
let pkArr = props.pk.split('.')
|
let pkArr = props.pk.split('.')
|
||||||
let pk = pkArr[pkArr.length - 1]
|
let pk = pkArr[pkArr.length - 1]
|
||||||
if (typeof val == 'number' || typeof val == 'string') {
|
if (typeof val == 'number' || typeof val == 'string') {
|
||||||
const dataKey = getArrayKey(state.options, pk, val.toString())
|
// const dataKey = getArrayKey(state.options, pk, val.toString())
|
||||||
emits('row', dataKey ? toRaw(state.options[dataKey]) : {})
|
// emits('row', dataKey ? toRaw(state.options[dataKey]) : {})
|
||||||
} else {
|
} else {
|
||||||
const valueArr = []
|
// const valueArr = []
|
||||||
for (const key in val) {
|
// for (const key in val) {
|
||||||
let dataKey = getArrayKey(state.options, pk, val[key].toString())
|
// let dataKey = getArrayKey(state.options, pk, val[key].toString())
|
||||||
if (dataKey) valueArr.push(toRaw(state.options[dataKey]))
|
// if (dataKey) valueArr.push(toRaw(state.options[dataKey]))
|
||||||
}
|
// }
|
||||||
emits('row', valueArr)
|
// emits('row', valueArr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,35 +196,35 @@ const getData = (initValue: valType = '') => {
|
|||||||
state.params.page = state.currentPage
|
state.params.page = state.currentPage
|
||||||
state.params.initKey = props.pk
|
state.params.initKey = props.pk
|
||||||
state.params.initValue = initValue
|
state.params.initValue = initValue
|
||||||
getSelectData(props.remoteUrl, state.keyword, state.params)
|
// getSelectData(props.remoteUrl, state.keyword, state.params)
|
||||||
.then((res) => {
|
// .then((res) => {
|
||||||
let initializeData = true
|
// let initializeData = true
|
||||||
let opts = res.data.options ? res.data.options : res.data.list
|
// let opts = res.data.options ? res.data.options : res.data.list
|
||||||
if (typeof props.labelFormatter == 'function') {
|
// if (typeof props.labelFormatter == 'function') {
|
||||||
for (const key in opts) {
|
// for (const key in opts) {
|
||||||
opts[key][props.field] = props.labelFormatter(opts[key], key)
|
// opts[key][props.field] = props.labelFormatter(opts[key], key)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
state.options = opts
|
// state.options = opts
|
||||||
state.total = res.data.total ?? 0
|
// state.total = res.data.total ?? 0
|
||||||
if (initValue) {
|
// if (initValue) {
|
||||||
// 重新渲染组件,确保在赋值前,opts已加载到-兼容 modelValue 更新
|
// // 重新渲染组件,确保在赋值前,opts已加载到-兼容 modelValue 更新
|
||||||
state.selectKey = uuid()
|
// state.selectKey = uuid()
|
||||||
initializeData = false
|
// initializeData = false
|
||||||
}
|
// }
|
||||||
state.loading = false
|
// state.loading = false
|
||||||
state.initializeData = initializeData
|
// state.initializeData = initializeData
|
||||||
if (state.accidentBlur) {
|
// if (state.accidentBlur) {
|
||||||
nextTick(() => {
|
// nextTick(() => {
|
||||||
const inputEl = selectRef.value?.$el.querySelector('.el-select__tags .el-select__input')
|
// const inputEl = selectRef.value?.$el.querySelector('.el-select__tags .el-select__input')
|
||||||
inputEl && inputEl.focus()
|
// inputEl && inputEl.focus()
|
||||||
state.accidentBlur = false
|
// state.accidentBlur = false
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.catch(() => {
|
// .catch(() => {
|
||||||
state.loading = false
|
// state.loading = false
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSelectCurrentPageChange = (val: number) => {
|
const onSelectCurrentPageChange = (val: number) => {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Array from '@/components/baInput/components/array.vue'
|
|||||||
import RemoteSelect from '@/components/baInput/components/remoteSelect.vue'
|
import RemoteSelect from '@/components/baInput/components/remoteSelect.vue'
|
||||||
import IconSelector from '@/components/baInput/components/iconSelector.vue'
|
import IconSelector from '@/components/baInput/components/iconSelector.vue'
|
||||||
import Editor from '@/components/baInput/components/editor.vue'
|
import Editor from '@/components/baInput/components/editor.vue'
|
||||||
import { getArea } from '@/api/common'
|
// import { getArea } from '@/api/common'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'baInput',
|
name: 'baInput',
|
||||||
|
|||||||
@@ -162,7 +162,7 @@
|
|||||||
<template v-if="listenerForm.event === 'timeout'">
|
<template v-if="listenerForm.event === 'timeout'">
|
||||||
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
||||||
<el-select v-model="listenerForm.eventDefinitionType">
|
<el-select v-model="listenerForm.eventDefinitionType">
|
||||||
<el-option label="日期" value="date" />
|
<el-option label="统计时间" value="date" />
|
||||||
<el-option label="持续时长" value="duration" />
|
<el-option label="持续时长" value="duration" />
|
||||||
<el-option label="循环" value="cycle" />
|
<el-option label="循环" value="cycle" />
|
||||||
<el-option label="无" value="null" />
|
<el-option label="无" value="null" />
|
||||||
|
|||||||
517
src/components/cockpit/dataCleaning/index.vue
Normal file
@@ -0,0 +1,517 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--异常数据清洗 -->
|
||||||
|
<TableHeader
|
||||||
|
:showReset="false"
|
||||||
|
ref="TableHeaderRef"
|
||||||
|
@selectChange="selectChange"
|
||||||
|
datePicker
|
||||||
|
v-if="fullscreen"
|
||||||
|
></TableHeader>
|
||||||
|
<div
|
||||||
|
class="monitoringPoints"
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
>
|
||||||
|
<div style="flex: 1">
|
||||||
|
<div class="title">监测点统计</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">监测点总数</span>
|
||||||
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
|
{{ monitoringPoints.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox mt10">
|
||||||
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
|
<span class="divBox_title">异常测点数</span>
|
||||||
|
<span class="divBox_num" style="color: #ff6600">
|
||||||
|
{{ monitoringPoints.abnormalNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="echartTitle">
|
||||||
|
<div class="title">异常占比</div>
|
||||||
|
<div>
|
||||||
|
{{
|
||||||
|
isNaN((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 100)
|
||||||
|
? 0
|
||||||
|
: Math.floor((monitoringPoints.abnormalNum / monitoringPoints.runNum) * 10000) /
|
||||||
|
100
|
||||||
|
}}%
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 30px">
|
||||||
|
<MyEchart :options="percentage"></MyEchart>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 2" class="ml15">
|
||||||
|
<div class="title">异常指标统计</div>
|
||||||
|
|
||||||
|
<div class="mb5" style="height: 40px">
|
||||||
|
<el-segmented
|
||||||
|
style="height: 100%"
|
||||||
|
v-model="segmented"
|
||||||
|
:options="segmentedList"
|
||||||
|
block
|
||||||
|
@change="change"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="segmentedIcon"
|
||||||
|
:style="{
|
||||||
|
backgroundColor:
|
||||||
|
scope.item.num > 0 ? '#FF9100' : scope.item.num > 99 ? '#ff0000' : '#007D7B'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ scope.item.num > 99 ? '99+' : scope.item.num }}
|
||||||
|
</div>
|
||||||
|
<div>{{ scope.item.label }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-segmented>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<span style="width: 170px; text-align: left">指标名称</span>
|
||||||
|
<span style="flex: 1">合理范围</span>
|
||||||
|
<span style="width: 90px">异常测点数</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 105px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div v-for="o in abnormal.filter(item => item.remark == segmented)" class="abnormal mb10">
|
||||||
|
<span style="width: 170px; height: 24px" class="iconDiv">
|
||||||
|
<div :style="{ backgroundColor: o.ids.length > 0 ? '#FF9100' : '' }"></div>
|
||||||
|
{{ o.targetName }}
|
||||||
|
</span>
|
||||||
|
<span style="flex: 1; text-align: center">
|
||||||
|
<!-- 合理范围: -->
|
||||||
|
<span style="color: #388e3c" class="text">{{ o.rangeDesc }}</span>
|
||||||
|
</span>
|
||||||
|
<span style="width: 90px; text-align: center">
|
||||||
|
<span style="color: #388e3c" :class="` ${o.ids.length > 0 ? 'text-red' : ''}`" class="text">
|
||||||
|
{{ o.ids.length }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const prop = defineProps({
|
||||||
|
w: { type: [String, Number] },
|
||||||
|
h: { type: [String, Number] },
|
||||||
|
width: { type: [String, Number] },
|
||||||
|
height: { type: [String, Number] },
|
||||||
|
timeKey: { type: [String, Number] },
|
||||||
|
timeValue: { type: Object }
|
||||||
|
})
|
||||||
|
|
||||||
|
const headerHeight = ref(57)
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const monitoringPoints = ref({
|
||||||
|
runNum: 0,
|
||||||
|
abnormalNum: 0
|
||||||
|
})
|
||||||
|
const segmented = ref('base')
|
||||||
|
const percentage = ref({})
|
||||||
|
const segmentedList = ref([
|
||||||
|
{
|
||||||
|
label: '基础指标',
|
||||||
|
value: 'base',
|
||||||
|
num: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '稳态指标',
|
||||||
|
value: 'harmonic',
|
||||||
|
num: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '暂态指标',
|
||||||
|
value: 'event',
|
||||||
|
num: 0
|
||||||
|
}
|
||||||
|
])
|
||||||
|
const abnormal: any = ref([])
|
||||||
|
|
||||||
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||||
|
headerHeight.value = height
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算是否全屏展示
|
||||||
|
const fullscreen = computed(() => {
|
||||||
|
const w = Number(prop.w)
|
||||||
|
const h = Number(prop.h)
|
||||||
|
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||||
|
// 执行相应逻辑
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/device-boot/dataVerify/getMonitorVerifyData',
|
||||||
|
method: 'POST',
|
||||||
|
showPage: false,
|
||||||
|
column: [],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
if (prop.timeValue && Array.isArray(prop.timeValue)) {
|
||||||
|
tableStore.table.params.searchBeginTime = prop.timeValue[0]
|
||||||
|
tableStore.table.params.searchEndTime = prop.timeValue[1]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
loadCallback: () => {
|
||||||
|
segmentedList.value[0].num = 0
|
||||||
|
segmentedList.value[1].num = 0
|
||||||
|
segmentedList.value[2].num = 0
|
||||||
|
monitoringPoints.value.runNum = tableStore.table.data.runNum //总数
|
||||||
|
monitoringPoints.value.abnormalNum = tableStore.table.data.abnormalNum //异常测点数
|
||||||
|
abnormal.value = tableStore.table.data.targetList
|
||||||
|
abnormal.value.forEach(item => {
|
||||||
|
const { remark, ids } = item
|
||||||
|
if (remark === 'base') segmentedList.value[0].num += ids.length
|
||||||
|
else if (remark === 'harmonic') segmentedList.value[1].num += ids.length
|
||||||
|
else if (remark === 'event') segmentedList.value[2].num += ids.length
|
||||||
|
})
|
||||||
|
|
||||||
|
echart()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.alarmDayLimit = 5
|
||||||
|
tableStore.table.params.warnDayLimit = 1
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
|
const echart = () => {
|
||||||
|
percentage.value = {
|
||||||
|
color: ['#FF9100'],
|
||||||
|
options: {
|
||||||
|
dataZoom: null,
|
||||||
|
toolbox: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '0%',
|
||||||
|
left: '0%',
|
||||||
|
right: '0%',
|
||||||
|
bottom: '0%'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: false,
|
||||||
|
data: ['']
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
show: false,
|
||||||
|
type: 'value'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '异常总数',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 12,
|
||||||
|
data: [100],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '异常占比',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 13,
|
||||||
|
data: [
|
||||||
|
(monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100 == 0
|
||||||
|
? ''
|
||||||
|
: ((monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100).toFixed(2)
|
||||||
|
],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: '#FF9100' // 0% 处的颜色
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#FF9100' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'pictorialBar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#fff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
symbolRepeat: 50,
|
||||||
|
// symbolMargin: 300,
|
||||||
|
symbol: 'rect',
|
||||||
|
symbolClip: true,
|
||||||
|
symbolSize: [2, 20],
|
||||||
|
symbolPosition: 'start',
|
||||||
|
symbolOffset: [0, 0],
|
||||||
|
data: [100],
|
||||||
|
z: 1,
|
||||||
|
zlevel: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bar',
|
||||||
|
barGap: '-110%',
|
||||||
|
data: [100],
|
||||||
|
barWidth: 18,
|
||||||
|
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: 'transparent',
|
||||||
|
barBorderColor: 'rgb(148,217,249)',
|
||||||
|
barBorderWidth: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
z: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const change = () => {
|
||||||
|
tableStore.table.loading = true
|
||||||
|
setTimeout(() => {
|
||||||
|
tableStore.table.loading = false
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
watch(
|
||||||
|
() => prop.timeKey,
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => prop.timeValue,
|
||||||
|
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
|
.monitoringPoints {
|
||||||
|
display: flex;
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.divBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
&:nth-child(1) {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
background-color: #fff6ed;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
background-color: #e5f8f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.abnormal {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 5px 0px 5px 10px;
|
||||||
|
.iconDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
// font-feature-settings: 'tnum';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.iconFont {
|
||||||
|
font-size: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
position: relative;
|
||||||
|
.form_but {
|
||||||
|
position: absolute;
|
||||||
|
right: -22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
:deep(.table_name) {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
text-underline-offset: 4px;
|
||||||
|
}
|
||||||
|
.echartTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
div:nth-child(2) {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ff6600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-segmented__item-selected, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
:deep(.el-segmented__item, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
:deep(.el-segmented) {
|
||||||
|
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: #ff9100 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmentedIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: calc(50% - 44px);
|
||||||
|
height: 18px !important;
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #ff9100;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
499
src/components/cockpit/integrity/index.vue
Normal file
@@ -0,0 +1,499 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--监测点数据完整性 -->
|
||||||
|
<TableHeader
|
||||||
|
:showReset="false"
|
||||||
|
ref="TableHeaderRef"
|
||||||
|
@selectChange="selectChange"
|
||||||
|
datePicker
|
||||||
|
v-if="fullscreen"
|
||||||
|
></TableHeader>
|
||||||
|
<div
|
||||||
|
class="monitoringPoints"
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
>
|
||||||
|
<div style="flex: 1">
|
||||||
|
<div class="title">监测点统计</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">监测点总数</span>
|
||||||
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
|
{{ monitoringPoints.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox mt10">
|
||||||
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
|
<span class="divBox_title">低于90%监测点数</span>
|
||||||
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
|
{{ monitoringPoints.abnormalNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="echartTitle">
|
||||||
|
<div class="title">总的数据完整性</div>
|
||||||
|
<div>
|
||||||
|
<div>{{ monitoringPoints.totalOnlineRate }}%</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 30px">
|
||||||
|
<MyEchart :options="percentage"></MyEchart>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 2" class="ml15">
|
||||||
|
<div class="title">完整性统计</div>
|
||||||
|
|
||||||
|
<div class="mb5" style="height: 40px">
|
||||||
|
<el-segmented
|
||||||
|
style="height: 100%"
|
||||||
|
v-model="segmented"
|
||||||
|
:props="props"
|
||||||
|
:options="segmentedList"
|
||||||
|
block
|
||||||
|
@change="tableStore.index()"
|
||||||
|
></el-segmented>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<span style="width: 110px; text-align: left">
|
||||||
|
{{
|
||||||
|
segmented == 'Power_Network'
|
||||||
|
? '区域'
|
||||||
|
: segmented == 'Manufacturer'
|
||||||
|
? '终端厂家'
|
||||||
|
: '电网标志'
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span style="width: 90px">监测点总数</span>
|
||||||
|
<span style="flex: 1">低于90%监测点数</span>
|
||||||
|
<span style="width: 80px">完整性(%)</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 105px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div v-for="o in abnormal" class="abnormal mb10">
|
||||||
|
<span style="width: 110px; height: 24px" class="iconDiv">
|
||||||
|
<div :style="{ backgroundColor: o.citTotalOnlineRate < 90 ? '#FF9100' : '' }"></div>
|
||||||
|
{{ o.citName }}
|
||||||
|
</span>
|
||||||
|
<!-- 监测点总数 -->
|
||||||
|
<span style="width: 90px; color: #388e3c" class="text">
|
||||||
|
{{ o.citTotalNum }}
|
||||||
|
</span>
|
||||||
|
<!-- 低于90%监测点数 -->
|
||||||
|
<span style="flex: 1; color: #388e3c" class="text">
|
||||||
|
{{ o.citBelowNum }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style="width: 80px; color: #388e3c"
|
||||||
|
:class="` ${o.citTotalOnlineRate < 90 ? 'text-red' : ''}`"
|
||||||
|
class="text"
|
||||||
|
>
|
||||||
|
{{ o.citTotalOnlineRate }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const prop = defineProps({
|
||||||
|
w: { type: [String, Number] },
|
||||||
|
h: { type: [String, Number] },
|
||||||
|
width: { type: [String, Number] },
|
||||||
|
height: { type: [String, Number] },
|
||||||
|
timeKey: { type: [String, Number] },
|
||||||
|
timeValue: { type: Object }
|
||||||
|
})
|
||||||
|
|
||||||
|
const headerHeight = ref(57)
|
||||||
|
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
|
||||||
|
const monitoringPoints = ref({
|
||||||
|
runNum: 0,
|
||||||
|
abnormalNum: 0,
|
||||||
|
totalOnlineRate: 0
|
||||||
|
})
|
||||||
|
const segmented = ref('Power_Network')
|
||||||
|
const percentage = ref({})
|
||||||
|
const segmentedList = dictData.getBasicData('Statistical_Type', ['Report_Type', 'Voltage_Level', 'Load_Type'])
|
||||||
|
const props = {
|
||||||
|
value: 'code',
|
||||||
|
label: 'name'
|
||||||
|
}
|
||||||
|
const abnormal: any = ref([])
|
||||||
|
|
||||||
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||||
|
headerHeight.value = height
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算是否全屏展示
|
||||||
|
const fullscreen = computed(() => {
|
||||||
|
const w = Number(prop.w)
|
||||||
|
const h = Number(prop.h)
|
||||||
|
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||||
|
// 执行相应逻辑
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/device-boot/LineIntegrityData/data',
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
showPage: false,
|
||||||
|
|
||||||
|
column: [],
|
||||||
|
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
if (prop.timeValue && Array.isArray(prop.timeValue)) {
|
||||||
|
tableStore.table.params.searchBeginTime = prop.timeValue[0]
|
||||||
|
tableStore.table.params.searchEndTime = prop.timeValue[1]
|
||||||
|
}
|
||||||
|
tableStore.table.params.statisticalType = segmentedList.filter(item => item.code === segmented.value)[0]
|
||||||
|
},
|
||||||
|
|
||||||
|
loadCallback: () => {
|
||||||
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
|
const echart = () => {
|
||||||
|
percentage.value = {
|
||||||
|
color: ['#FF9100'],
|
||||||
|
options: {
|
||||||
|
dataZoom: null,
|
||||||
|
toolbox: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '0%',
|
||||||
|
left: '0%',
|
||||||
|
right: '0%',
|
||||||
|
bottom: '0%'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: false,
|
||||||
|
data: ['']
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
show: false,
|
||||||
|
type: 'value'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '异常总数',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 12,
|
||||||
|
data: [100],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '异常占比',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 13,
|
||||||
|
data: [
|
||||||
|
(monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100 == 0
|
||||||
|
? ''
|
||||||
|
: ((monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100).toFixed(2)
|
||||||
|
],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: '#FF9100' // 0% 处的颜色
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#FF9100' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'pictorialBar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#fff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
symbolRepeat: 50,
|
||||||
|
// symbolMargin: 300,
|
||||||
|
symbol: 'rect',
|
||||||
|
symbolClip: true,
|
||||||
|
symbolSize: [2, 20],
|
||||||
|
symbolPosition: 'start',
|
||||||
|
symbolOffset: [0, 0],
|
||||||
|
data: [100],
|
||||||
|
z: 1,
|
||||||
|
zlevel: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bar',
|
||||||
|
barGap: '-110%',
|
||||||
|
data: [100],
|
||||||
|
barWidth: 18,
|
||||||
|
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: 'transparent',
|
||||||
|
barBorderColor: 'rgb(148,217,249)',
|
||||||
|
barBorderWidth: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
z: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
echart()
|
||||||
|
}, 100)
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
watch(
|
||||||
|
() => prop.timeKey,
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => prop.timeValue,
|
||||||
|
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
|
.monitoringPoints {
|
||||||
|
display: flex;
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.divBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
&:nth-child(1) {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
background-color: #fff6ed;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
background-color: #e5f8f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.abnormal {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 5px 0px 5px 10px;
|
||||||
|
.iconDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
// font-feature-settings: 'tnum';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.iconFont {
|
||||||
|
font-size: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
position: relative;
|
||||||
|
.form_but {
|
||||||
|
position: absolute;
|
||||||
|
right: -22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
:deep(.table_name) {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
text-underline-offset: 4px;
|
||||||
|
}
|
||||||
|
.echartTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
div:nth-child(2) {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ff6600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-segmented__item-selected, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
:deep(.el-segmented__item, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
:deep(.el-segmented) {
|
||||||
|
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: #ff9100 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmentedIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
left: 100px;
|
||||||
|
height: 18px !important;
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #ff9100;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
498
src/components/cockpit/onlineRate/index.vue
Normal file
@@ -0,0 +1,498 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--终端在线率 -->
|
||||||
|
<TableHeader
|
||||||
|
:showReset="false"
|
||||||
|
ref="TableHeaderRef"
|
||||||
|
@selectChange="selectChange"
|
||||||
|
datePicker
|
||||||
|
v-if="fullscreen"
|
||||||
|
></TableHeader>
|
||||||
|
<div
|
||||||
|
class="monitoringPoints"
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
>
|
||||||
|
<div style="flex: 1">
|
||||||
|
<div class="title">终端统计</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">终端总数</span>
|
||||||
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
|
{{ monitoringPoints.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox mt10">
|
||||||
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
|
<span class="divBox_title">低于90%终端数</span>
|
||||||
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
|
{{ monitoringPoints.abnormalNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="echartTitle">
|
||||||
|
<div class="title">总的数据在线率</div>
|
||||||
|
<div>{{ monitoringPoints.totalOnlineRate }}%</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 30px">
|
||||||
|
<MyEchart :options="percentage"></MyEchart>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 2" class="ml15">
|
||||||
|
<div class="title">在线率统计</div>
|
||||||
|
|
||||||
|
<div class="mb5" style="height: 40px">
|
||||||
|
<el-segmented
|
||||||
|
style="height: 100%"
|
||||||
|
v-model="segmented"
|
||||||
|
:props="props"
|
||||||
|
:options="segmentedList"
|
||||||
|
block
|
||||||
|
@change="tableStore.index()"
|
||||||
|
></el-segmented>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<span style="width: 110px; text-align: left">
|
||||||
|
{{
|
||||||
|
segmented == 'Power_Network'
|
||||||
|
? '区域'
|
||||||
|
: segmented == 'Manufacturer'
|
||||||
|
? '终端厂家'
|
||||||
|
: '电网标志'
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span style="width: 90px">终端总数</span>
|
||||||
|
<span style="flex: 1">低于90%终端数</span>
|
||||||
|
<span style="width: 80px">在线率(%)</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 105px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div v-for="o in abnormal" class="abnormal mb10">
|
||||||
|
<span style="width: 110px; height: 24px" class="iconDiv">
|
||||||
|
<div :style="{ backgroundColor: o.citTotalOnlineRate < 90 ? '#FF9100' : '' }"></div>
|
||||||
|
{{ o.citName }}
|
||||||
|
</span>
|
||||||
|
<!-- 终端总数 -->
|
||||||
|
<span style="width: 90px; color: #388e3c" class="text">
|
||||||
|
{{ o.citTotalNum }}
|
||||||
|
</span>
|
||||||
|
<!-- 低于90%终端数 -->
|
||||||
|
<span style="flex: 1; color: #388e3c" class="text">
|
||||||
|
{{ o.citBelowNum }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style="width: 80px; color: #388e3c"
|
||||||
|
:class="` ${o.citTotalOnlineRate < 90 ? 'text-red' : ''}`"
|
||||||
|
class="text"
|
||||||
|
>
|
||||||
|
{{ o.citTotalOnlineRate }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const prop = defineProps({
|
||||||
|
w: { type: [String, Number] },
|
||||||
|
h: { type: [String, Number] },
|
||||||
|
width: { type: [String, Number] },
|
||||||
|
height: { type: [String, Number] },
|
||||||
|
timeKey: { type: [String, Number] },
|
||||||
|
timeValue: { type: Object }
|
||||||
|
})
|
||||||
|
|
||||||
|
const headerHeight = ref(57)
|
||||||
|
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
|
||||||
|
const monitoringPoints = ref({
|
||||||
|
runNum: 0,
|
||||||
|
abnormalNum: 0,
|
||||||
|
totalOnlineRate: 0
|
||||||
|
})
|
||||||
|
const segmented = ref('Power_Network')
|
||||||
|
const percentage = ref({})
|
||||||
|
const segmentedList = dictData.getBasicData('Statistical_Type', ['Report_Type', 'Voltage_Level', 'Load_Type'])
|
||||||
|
const props = {
|
||||||
|
value: 'code',
|
||||||
|
label: 'name'
|
||||||
|
}
|
||||||
|
const abnormal: any = ref([])
|
||||||
|
|
||||||
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||||
|
headerHeight.value = height
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算是否全屏展示
|
||||||
|
const fullscreen = computed(() => {
|
||||||
|
const w = Number(prop.w)
|
||||||
|
const h = Number(prop.h)
|
||||||
|
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||||
|
// 执行相应逻辑
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/device-boot/onLineRate/deviceOnlineRateInfo',
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
showPage: false,
|
||||||
|
|
||||||
|
column: [],
|
||||||
|
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
if (prop.timeValue && Array.isArray(prop.timeValue)) {
|
||||||
|
tableStore.table.params.searchBeginTime = prop.timeValue[0]
|
||||||
|
tableStore.table.params.searchEndTime = prop.timeValue[1]
|
||||||
|
}
|
||||||
|
tableStore.table.params.statisticalType = segmentedList.filter(item => item.code === segmented.value)[0]
|
||||||
|
},
|
||||||
|
|
||||||
|
loadCallback: () => {
|
||||||
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
|
const echart = () => {
|
||||||
|
percentage.value = {
|
||||||
|
color: ['#FF9100'],
|
||||||
|
options: {
|
||||||
|
dataZoom: null,
|
||||||
|
toolbox: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '0%',
|
||||||
|
left: '0%',
|
||||||
|
right: '0%',
|
||||||
|
bottom: '0%'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: false,
|
||||||
|
data: ['']
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
show: false,
|
||||||
|
type: 'value'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '异常总数',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 12,
|
||||||
|
data: [100],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '异常占比',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 13,
|
||||||
|
data: [
|
||||||
|
(monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100 == 0
|
||||||
|
? ''
|
||||||
|
: ((monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100).toFixed(2)
|
||||||
|
],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: '#FF9100' // 0% 处的颜色
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#FF9100' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'pictorialBar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#fff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
symbolRepeat: 50,
|
||||||
|
// symbolMargin: 300,
|
||||||
|
symbol: 'rect',
|
||||||
|
symbolClip: true,
|
||||||
|
symbolSize: [2, 20],
|
||||||
|
symbolPosition: 'start',
|
||||||
|
symbolOffset: [0, 0],
|
||||||
|
data: [100],
|
||||||
|
z: 1,
|
||||||
|
zlevel: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bar',
|
||||||
|
barGap: '-110%',
|
||||||
|
data: [100],
|
||||||
|
barWidth: 18,
|
||||||
|
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: 'transparent',
|
||||||
|
barBorderColor: 'rgb(148,217,249)',
|
||||||
|
barBorderWidth: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
z: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
echart()
|
||||||
|
}, 100)
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
watch(
|
||||||
|
() => prop.timeKey,
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => prop.timeValue,
|
||||||
|
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
|
.monitoringPoints {
|
||||||
|
display: flex;
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.divBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
&:nth-child(1) {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
background-color: #fff6ed;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
background-color: #e5f8f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.abnormal {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 5px 0px 5px 10px;
|
||||||
|
.iconDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
// font-feature-settings: 'tnum';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.iconFont {
|
||||||
|
font-size: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
position: relative;
|
||||||
|
.form_but {
|
||||||
|
position: absolute;
|
||||||
|
right: -22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
:deep(.table_name) {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
text-underline-offset: 4px;
|
||||||
|
}
|
||||||
|
.echartTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
div:nth-child(2) {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ff6600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-segmented__item-selected, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
:deep(.el-segmented__item, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
:deep(.el-segmented) {
|
||||||
|
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: #ff9100 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmentedIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
left: 100px;
|
||||||
|
height: 18px !important;
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #ff9100;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
476
src/components/cockpit/terminalEvaluation/index.vue
Normal file
@@ -0,0 +1,476 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--监测点数据完整性 -->
|
||||||
|
<TableHeader
|
||||||
|
:showReset="false"
|
||||||
|
ref="TableHeaderRef"
|
||||||
|
@selectChange="selectChange"
|
||||||
|
datePicker
|
||||||
|
v-if="fullscreen"
|
||||||
|
></TableHeader>
|
||||||
|
<div
|
||||||
|
class="monitoringPoints"
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
>
|
||||||
|
<div style="flex: 1">
|
||||||
|
<div class="title">终端统计</div>
|
||||||
|
<div
|
||||||
|
class="box1"
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 30px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox div1">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">终端总数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #57bc6e">
|
||||||
|
{{ statisticsList.allNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox div2">
|
||||||
|
<span class="iconfont icon-zaiyunshebei" style="color: #67c23a"></span>
|
||||||
|
<span class="divBox_title">在运终端数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #67c23a">
|
||||||
|
{{ statisticsList.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox div3">
|
||||||
|
<span
|
||||||
|
class="iconfont icon-yichanglei_14feizhinengbiaozaiyunyichang"
|
||||||
|
style="color: #ffbf00"
|
||||||
|
></span>
|
||||||
|
<span class="divBox_title">调试终端数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #ffbf00">
|
||||||
|
{{ statisticsList.checkNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox div4">
|
||||||
|
<span class="iconfont icon-tingyunshijianguanli" style="color: #f56c6c"></span>
|
||||||
|
<span class="divBox_title">停运终端数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #f56c6c">
|
||||||
|
{{ statisticsList.stopRunNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 2" class="ml15">
|
||||||
|
<div class="title">完整性统计</div>
|
||||||
|
|
||||||
|
<div class="mb5" style="height: 40px">
|
||||||
|
<el-segmented
|
||||||
|
style="height: 100%"
|
||||||
|
v-model="segmented"
|
||||||
|
:props="props"
|
||||||
|
:options="segmentedList"
|
||||||
|
block
|
||||||
|
@change="tableStore.index()"
|
||||||
|
></el-segmented>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<span style="width: 110px; text-align: left">
|
||||||
|
{{
|
||||||
|
segmented == 'Power_Network'
|
||||||
|
? '区域'
|
||||||
|
: segmented == 'Manufacturer'
|
||||||
|
? '终端厂家'
|
||||||
|
: '电网标志'
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span style="width: 90px">终端总数</span>
|
||||||
|
<span style="flex: 1">完整性(%)</span>
|
||||||
|
<span style="flex: 1">在线率(%)</span>
|
||||||
|
<span style="flex: 1">异常率(%)</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 105px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div v-for="o in abnormal" class="abnormal mb10">
|
||||||
|
<span style="width: 110px; height: 24px" class="iconDiv">
|
||||||
|
<div :style="{ backgroundColor: o.citTotalOnlineRate < 90 ? '#FF9100' : '' }"></div>
|
||||||
|
{{ o.name }}
|
||||||
|
</span>
|
||||||
|
<!-- 终端总数 -->
|
||||||
|
<span style="width: 90px; color: #388e3c" class="text">
|
||||||
|
{{ o.count }}
|
||||||
|
</span>
|
||||||
|
<!-- -->
|
||||||
|
<sp
|
||||||
|
style="flex: 1; color: #388e3c"
|
||||||
|
class="text"
|
||||||
|
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
||||||
|
>
|
||||||
|
{{ o.integrity }}
|
||||||
|
</sp>
|
||||||
|
<span
|
||||||
|
style="flex: 1; color: #388e3c"
|
||||||
|
:class="` ${o.online < 90 ? 'text-red' : ''}`"
|
||||||
|
class="text"
|
||||||
|
>
|
||||||
|
{{ o.online }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style="flex: 1; color: #388e3c"
|
||||||
|
:class="` ${o.qualified > 10 ? 'text-red' : ''}`"
|
||||||
|
class="text"
|
||||||
|
>
|
||||||
|
{{ o.qualified }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const prop = defineProps({
|
||||||
|
w: { type: [String, Number] },
|
||||||
|
h: { type: [String, Number] },
|
||||||
|
width: { type: [String, Number] },
|
||||||
|
height: { type: [String, Number] },
|
||||||
|
timeKey: { type: [String, Number] },
|
||||||
|
timeValue: { type: Object }
|
||||||
|
})
|
||||||
|
|
||||||
|
const headerHeight = ref(57)
|
||||||
|
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
|
||||||
|
const monitoringPoints = ref({
|
||||||
|
runNum: 0,
|
||||||
|
abnormalNum: 0,
|
||||||
|
totalOnlineRate: 0
|
||||||
|
})
|
||||||
|
const segmented = ref('Power_Network')
|
||||||
|
const percentage = ref({})
|
||||||
|
const segmentedList = dictData.getBasicData('Statistical_Type', ['Report_Type', 'Voltage_Level', 'Load_Type'])
|
||||||
|
const props = {
|
||||||
|
value: 'code',
|
||||||
|
label: 'name'
|
||||||
|
}
|
||||||
|
const statisticsList: any = ref({
|
||||||
|
allNum: 0,
|
||||||
|
runNum: 0,
|
||||||
|
checkNum: 0,
|
||||||
|
stopRunNum: 0
|
||||||
|
})
|
||||||
|
const abnormal: any = ref([])
|
||||||
|
|
||||||
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||||
|
headerHeight.value = height
|
||||||
|
}
|
||||||
|
const totalData = ref([])
|
||||||
|
// 计算是否全屏展示
|
||||||
|
const fullscreen = computed(() => {
|
||||||
|
const w = Number(prop.w)
|
||||||
|
const h = Number(prop.h)
|
||||||
|
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||||
|
// 执行相应逻辑
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/device-boot/deviceRunEvaluate/getRunEvaluateInfo',
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
showPage: false,
|
||||||
|
|
||||||
|
column: [],
|
||||||
|
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
if (prop.timeValue && Array.isArray(prop.timeValue)) {
|
||||||
|
tableStore.table.params.searchBeginTime = prop.timeValue[0]
|
||||||
|
tableStore.table.params.searchEndTime = prop.timeValue[1]
|
||||||
|
}
|
||||||
|
tableStore.table.params.statisticalType = segmentedList.filter(item => item.code === segmented.value)[0]
|
||||||
|
},
|
||||||
|
|
||||||
|
loadCallback: () => {
|
||||||
|
totalData.value = Array.from(
|
||||||
|
tableStore.table.data
|
||||||
|
.map((item: any) => item.list)
|
||||||
|
.flat()
|
||||||
|
.reduce((map: any, item: any) => {
|
||||||
|
if (!map.has(item.id)) {
|
||||||
|
map.set(item.id, item)
|
||||||
|
}
|
||||||
|
return map
|
||||||
|
}, new Map())
|
||||||
|
.values()
|
||||||
|
)
|
||||||
|
|
||||||
|
// tableStore.table.data
|
||||||
|
statisticsList.value.allNum = totalData.value.length
|
||||||
|
statisticsList.value.runNum = totalData.value.filter(item => item.runFlag === '运行').length
|
||||||
|
statisticsList.value.checkNum = totalData.value.filter(item => item.runFlag === '调试').length
|
||||||
|
statisticsList.value.stopRunNum = totalData.value.filter(item => item.runFlag === '停运').length
|
||||||
|
|
||||||
|
abnormal.value = tableStore.table.data.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.count != 0
|
||||||
|
} else {
|
||||||
|
return k.name != '上送国网' && k.name != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
watch(
|
||||||
|
() => prop.timeKey,
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => prop.timeValue,
|
||||||
|
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
|
.monitoringPoints {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.abnormal {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 5px 0px 5px 10px;
|
||||||
|
.iconDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
// font-feature-settings: 'tnum';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.iconFont {
|
||||||
|
font-size: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
position: relative;
|
||||||
|
.form_but {
|
||||||
|
position: absolute;
|
||||||
|
right: -22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
:deep(.table_name) {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
text-underline-offset: 4px;
|
||||||
|
}
|
||||||
|
.echartTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
div:nth-child(2) {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ff6600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-segmented__item-selected, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
:deep(.el-segmented__item, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
:deep(.el-segmented) {
|
||||||
|
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: #ff9100 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmentedIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
left: 100px;
|
||||||
|
height: 18px !important;
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #ff9100;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hexagon {
|
||||||
|
position: relative;
|
||||||
|
width: 100px;
|
||||||
|
height: 55px;
|
||||||
|
background-color: #19a094;
|
||||||
|
margin: 50px auto;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #19a094;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #19a094;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.hexagon::before,
|
||||||
|
.hexagon::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 0;
|
||||||
|
border-left: 50px solid transparent;
|
||||||
|
border-right: 50px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hexagon::before {
|
||||||
|
bottom: 98%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hexagon::after {
|
||||||
|
top: 98%;
|
||||||
|
}
|
||||||
|
.hexagon1 {
|
||||||
|
background-color: #2e8b57;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #2e8b57;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #2e8b57;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.hexagon2 {
|
||||||
|
background-color: #ffbf00;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #ffbf00;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #ffbf00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.hexagon3 {
|
||||||
|
background-color: #a52a2a;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #a52a2a;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #a52a2a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
.divBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.div1 {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
.div2 {
|
||||||
|
background-color: #67c23a24;
|
||||||
|
}
|
||||||
|
.div3 {
|
||||||
|
background-color: #ffbf0024;
|
||||||
|
}
|
||||||
|
.div4 {
|
||||||
|
background-color: #f56c6c24;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
450
src/components/cockpit/terminalEvaluation/index1.vue
Normal file
@@ -0,0 +1,450 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--终端运行评价 -->
|
||||||
|
<TableHeader
|
||||||
|
:showReset="false"
|
||||||
|
ref="TableHeaderRef"
|
||||||
|
@selectChange="selectChange"
|
||||||
|
datePicker
|
||||||
|
v-if="fullscreen"
|
||||||
|
></TableHeader>
|
||||||
|
<div
|
||||||
|
class="monitoringPoints"
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
>
|
||||||
|
<div style="flex: 1">
|
||||||
|
<div class="title">终端统计</div>
|
||||||
|
<div style="height: 135px" class="box1">
|
||||||
|
<div class="boxDiv hexagon">
|
||||||
|
<div style="color: #fff">100</div>
|
||||||
|
<div class="mt10 divBot">总数</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxDiv hexagon hexagon1">
|
||||||
|
<div style="color: #fff">50</div>
|
||||||
|
<div class="mt10 divBot">在运</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 135px" class="box1">
|
||||||
|
<div class="boxDiv hexagon hexagon2">
|
||||||
|
<div style="color: #fff">25</div>
|
||||||
|
<div class="mt10 divBot">检修</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxDiv hexagon hexagon3">
|
||||||
|
<div style="color: #fff">25</div>
|
||||||
|
<div class="mt10 divBot">停运</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 2" class="ml15">
|
||||||
|
<div class="title">终端运行评价</div>
|
||||||
|
|
||||||
|
<div class="mb5" style="height: 40px">
|
||||||
|
<el-segmented style="height: 100%" v-model="segmented" :options="segmentedList" block>
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<div>{{ typeof scope.item === 'object' ? scope.item.label : scope.item }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-segmented>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<span style="width: 110px; text-align: left">
|
||||||
|
{{ segmented == 0 ? '区域' : segmented == 1 ? '终端厂家' : '电网标志' }}
|
||||||
|
</span>
|
||||||
|
<span style="flex: 1">在运终端数</span>
|
||||||
|
<span style="width: 80px">评价</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 105px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div v-for="o in abnormal" class="abnormal mb10">
|
||||||
|
<span style="width: 110px; height: 24px" class="iconDiv">
|
||||||
|
<div :style="{ backgroundColor: o.integrity < 90 ? '#FF9100' : '' }"></div>
|
||||||
|
{{ o.targetName }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- 在运终端数 -->
|
||||||
|
<span style="flex: 1; color: #388e3c" class="text">
|
||||||
|
{{ o.rangeDesc }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style="width: 80px; color: #388e3c"
|
||||||
|
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
||||||
|
class="text"
|
||||||
|
>
|
||||||
|
{{ o.integrity }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const prop = defineProps({
|
||||||
|
w: { type: [String, Number] },
|
||||||
|
h: { type: [String, Number] },
|
||||||
|
width: { type: [String, Number] },
|
||||||
|
height: { type: [String, Number] },
|
||||||
|
timeKey: { type: [String, Number] },
|
||||||
|
timeValue: { type: Object }
|
||||||
|
})
|
||||||
|
|
||||||
|
const headerHeight = ref(57)
|
||||||
|
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
|
||||||
|
const monitoringPoints = ref({
|
||||||
|
runNum: 110,
|
||||||
|
abnormalNum: 10
|
||||||
|
})
|
||||||
|
const segmented = ref(0)
|
||||||
|
const percentage = ref({})
|
||||||
|
const segmentedList = ref([
|
||||||
|
{
|
||||||
|
label: '区域',
|
||||||
|
value: 0,
|
||||||
|
num: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '终端厂家',
|
||||||
|
value: 1,
|
||||||
|
num: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '电网标志',
|
||||||
|
value: 2,
|
||||||
|
num: 0
|
||||||
|
}
|
||||||
|
])
|
||||||
|
const abnormal: any = ref([
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: '优秀'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
targetName: '唐山',
|
||||||
|
rangeDesc: 21,
|
||||||
|
length: 21,
|
||||||
|
integrity: 92
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||||
|
headerHeight.value = height
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算是否全屏展示
|
||||||
|
const fullscreen = computed(() => {
|
||||||
|
const w = Number(prop.w)
|
||||||
|
const h = Number(prop.h)
|
||||||
|
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
||||||
|
// 执行相应逻辑
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const value = ref(new Date())
|
||||||
|
|
||||||
|
const list = ref()
|
||||||
|
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/device-boot/deviceRunEvaluate/getRunEvaluateInfo',
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
showPage: false,
|
||||||
|
|
||||||
|
column: [],
|
||||||
|
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
if (prop.timeValue && Array.isArray(prop.timeValue)) {
|
||||||
|
tableStore.table.params.searchBeginTime = prop.timeValue[0]
|
||||||
|
tableStore.table.params.searchEndTime = prop.timeValue[1]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
loadCallback: () => {
|
||||||
|
list.value = tableStore.table.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
watch(
|
||||||
|
() => prop.timeKey,
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => prop.timeValue,
|
||||||
|
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.monitoringPoints {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.abnormal {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 5px 0px 5px 10px;
|
||||||
|
.iconDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
// font-feature-settings: 'tnum';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.iconFont {
|
||||||
|
font-size: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
position: relative;
|
||||||
|
.form_but {
|
||||||
|
position: absolute;
|
||||||
|
right: -22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
:deep(.table_name) {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
text-underline-offset: 4px;
|
||||||
|
}
|
||||||
|
.echartTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
div:nth-child(2) {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ff6600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-segmented__item-selected, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
:deep(.el-segmented__item, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
:deep(.el-segmented) {
|
||||||
|
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: #ff9100 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segmentedIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
left: 100px;
|
||||||
|
height: 18px !important;
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #ff9100;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
.box1 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
.boxDiv {
|
||||||
|
// flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
margin: 0 5px;
|
||||||
|
|
||||||
|
div:nth-child(1) {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 30px;
|
||||||
|
top: -10px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.divBot {
|
||||||
|
font-size: 16px;
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.hexagon {
|
||||||
|
position: relative;
|
||||||
|
width: 100px;
|
||||||
|
height: 55px;
|
||||||
|
background-color: #19a094;
|
||||||
|
margin: 50px auto;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #19a094;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #19a094;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.hexagon::before,
|
||||||
|
.hexagon::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 0;
|
||||||
|
border-left: 50px solid transparent;
|
||||||
|
border-right: 50px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hexagon::before {
|
||||||
|
bottom: 98%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hexagon::after {
|
||||||
|
top: 98%;
|
||||||
|
}
|
||||||
|
.hexagon1 {
|
||||||
|
background-color: #2e8b57;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #2e8b57;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #2e8b57;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.hexagon2 {
|
||||||
|
background-color: #ffbf00;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #ffbf00;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #ffbf00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.hexagon3 {
|
||||||
|
background-color: #a52a2a;
|
||||||
|
&::before {
|
||||||
|
border-bottom: 27.5px solid #a52a2a;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
border-top: 27.5px solid #a52a2a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export let color = [
|
export const color = [
|
||||||
'#07CCCA',
|
'#07CCCA',
|
||||||
'#00BFF5',
|
'#00BFF5',
|
||||||
'#FFBF00',
|
'#FFBF00',
|
||||||
@@ -8,7 +8,10 @@ export let color = [
|
|||||||
'#FF9100',
|
'#FF9100',
|
||||||
'#5B6E96',
|
'#5B6E96',
|
||||||
'#66FFCC',
|
'#66FFCC',
|
||||||
'#B3B'
|
'#B266FF',
|
||||||
|
'#FF6680',
|
||||||
|
'#40A0FF',
|
||||||
|
'#33CC99'
|
||||||
]
|
]
|
||||||
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
||||||
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
||||||
|
|||||||
@@ -1,345 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!-- <MyEChart style="height: 400px;width: 100%" v-for="item in echartsList" :options="item" /> -->
|
|
||||||
<div id="container0" style="height:400px;width:100%;"></div>
|
|
||||||
<div id="container1" style="height:400px;width:100%;"></div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
<script setup lang='ts'>
|
|
||||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
|
||||||
|
|
||||||
import Highcharts from 'highcharts';
|
|
||||||
import { ref, reactive, onUnmounted } from 'vue'
|
|
||||||
const props = defineProps({
|
|
||||||
wp: {
|
|
||||||
type: Object,
|
|
||||||
|
|
||||||
},
|
|
||||||
boxoList: {
|
|
||||||
type: Object,
|
|
||||||
|
|
||||||
},
|
|
||||||
value: {
|
|
||||||
type: Number,
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
|
||||||
// let data = [[-100, -3.41, -3.39, -3.34, 1, 2, 3], [-99.92, -5.19, -5.23, -5.19, 4, 5, 6], [-99.84, -7.28, -7.26, -7.26, 10, 20, 30]]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const echartsList: any = ref([])
|
|
||||||
const SA:any = ref([])
|
|
||||||
const SB:any = ref([])
|
|
||||||
const SC:any = ref([])
|
|
||||||
const info = () => {
|
|
||||||
|
|
||||||
|
|
||||||
let result = props.wp?.listWaveData.map(item => {
|
|
||||||
let A = [[item[0], item[1]], [item[0], item[4]],];
|
|
||||||
let B = [[item[0], item[2]], [item[0], item[5]],]; // 注意:item[7] 会是 undefined,需要确保数据长度或调整索引
|
|
||||||
let C = [[item[0], item[3]], [item[0], item[6]],]; // 根据要求,这里 C 的第二个和第三个子数组的第二个元素取自 subArray[4] 和 subArray[6]
|
|
||||||
|
|
||||||
// 由于 subArray[7] 在原始数据中不存在,我们可以使用 subArray[5] 的下一个有效索引 subArray[6](对于 B 的第三个子数组的第二个元素)
|
|
||||||
|
|
||||||
|
|
||||||
return { A, B, C };
|
|
||||||
}).reduce((acc, { A, B, C }) => {
|
|
||||||
acc.A[0].push(A[0]);
|
|
||||||
acc.A[1].push(A[1]);
|
|
||||||
acc.B[0].push(B[0]);
|
|
||||||
acc.B[1].push(B[1]);
|
|
||||||
acc.C[0].push(C[0]);
|
|
||||||
acc.C[1].push(C[1]);
|
|
||||||
return acc;
|
|
||||||
}, { A: [[],[]], B: [[],[]], C: [[],[]] });
|
|
||||||
|
|
||||||
SA.value = result.A;
|
|
||||||
SB.value = result.B;
|
|
||||||
SC.value = result.C;
|
|
||||||
|
|
||||||
console.log( SA.value );
|
|
||||||
console.log( SB.value );
|
|
||||||
console.log( SC.value);
|
|
||||||
|
|
||||||
let num = (props.wp?.waveTitle.length - 1) / 3
|
|
||||||
|
|
||||||
for (let i = 0; i < num; i++) {
|
|
||||||
// A.value = []
|
|
||||||
// B.value = []
|
|
||||||
// C.value = []
|
|
||||||
// props.wp?.listWaveData.forEach((item: any,) => {
|
|
||||||
// A.value.push([item[0], item[i * 3 + 1]])
|
|
||||||
// B.value.push([item[0], item[i * 3 + 2]])
|
|
||||||
// C.value.push([item[0], item[i * 3 + 3]])
|
|
||||||
// })
|
|
||||||
setTimeout(() => {
|
|
||||||
|
|
||||||
// echartsList.value.push({
|
|
||||||
// title: {
|
|
||||||
// text: i == 0 ? '123' : '',
|
|
||||||
// x: 'center',
|
|
||||||
// },
|
|
||||||
// tooltip: {
|
|
||||||
// axisPointer: {
|
|
||||||
// type: 'cross',
|
|
||||||
// label: {
|
|
||||||
// color: '#fff',
|
|
||||||
// fontSize: 16
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// textStyle: {
|
|
||||||
// color: '#fff',
|
|
||||||
// fontStyle: 'normal',
|
|
||||||
// opacity: 0.35,
|
|
||||||
// fontSize: 14
|
|
||||||
// },
|
|
||||||
// backgroundColor: 'rgba(0,0,0,0.55)',
|
|
||||||
// borderWidth: 0,
|
|
||||||
// },
|
|
||||||
// dataZoom: [
|
|
||||||
// {
|
|
||||||
// type: 'inside',
|
|
||||||
// height: 13,
|
|
||||||
// start: 0,
|
|
||||||
// bottom: '20px',
|
|
||||||
// end: 25
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// start: 0,
|
|
||||||
// height: 13,
|
|
||||||
// bottom: '20px',
|
|
||||||
// end: 25
|
|
||||||
// }
|
|
||||||
// ],
|
|
||||||
// xAxis: {
|
|
||||||
|
|
||||||
// // data: data.filter(item => item.phaseType == 'A').map(item => item.time),
|
|
||||||
// name: '时间',
|
|
||||||
// type: 'value',
|
|
||||||
// axisLine: {
|
|
||||||
// show: true,
|
|
||||||
// onZero: false //-----------重点
|
|
||||||
// },
|
|
||||||
// // splitLine: {
|
|
||||||
// // show: false,
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// },
|
|
||||||
// yAxis: {
|
|
||||||
// type: 'value',
|
|
||||||
// name: name,
|
|
||||||
// // splitLine: {
|
|
||||||
// // show: false,
|
|
||||||
// // }
|
|
||||||
// // max: max,
|
|
||||||
// // min: min
|
|
||||||
|
|
||||||
// },
|
|
||||||
// // legend: {
|
|
||||||
// // data: ['A', 'B', 'C']
|
|
||||||
// // // selectedMode: false,
|
|
||||||
// // },
|
|
||||||
// grid: {
|
|
||||||
// top: '30px',
|
|
||||||
// left: '30px'
|
|
||||||
// },
|
|
||||||
// color: ['#DAA520', '#2E8B57', '#A52a2a'],
|
|
||||||
// series: [
|
|
||||||
// {
|
|
||||||
// name: 'A相',
|
|
||||||
// type: 'line',
|
|
||||||
// smooth: true,
|
|
||||||
// symbol: 'none',
|
|
||||||
// // 开启渐进式渲染
|
|
||||||
// progressive: 2000,
|
|
||||||
// // 渲染阈值,大于此值则启动渐进渲染
|
|
||||||
// progressiveThreshold: 5000,
|
|
||||||
// sampling: 'average',
|
|
||||||
// data: A
|
|
||||||
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: 'B相',
|
|
||||||
// type: 'line',
|
|
||||||
// smooth: true,
|
|
||||||
// symbol: 'none',
|
|
||||||
// // 开启渐进式渲染
|
|
||||||
// progressive: 2000,
|
|
||||||
// // 渲染阈值,大于此值则启动渐进渲染
|
|
||||||
// progressiveThreshold: 5000,
|
|
||||||
// sampling: 'average',
|
|
||||||
// data: B
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: 'C相',
|
|
||||||
// type: 'line',
|
|
||||||
// smooth: true,
|
|
||||||
// symbol: 'none',
|
|
||||||
// // 开启渐进式渲染
|
|
||||||
// progressive: 2000,
|
|
||||||
// // 渲染阈值,大于此值则启动渐进渲染
|
|
||||||
// progressiveThreshold: 5000,
|
|
||||||
// sampling: 'average',
|
|
||||||
// data: C
|
|
||||||
// }
|
|
||||||
// ],
|
|
||||||
// options: {
|
|
||||||
// animation: false,
|
|
||||||
// dataZoom: [{
|
|
||||||
// type: 'inside',
|
|
||||||
// height: 13,
|
|
||||||
// start: 0,
|
|
||||||
// bottom: '20px',
|
|
||||||
// end: 10
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// start: 0,
|
|
||||||
// height: 13,
|
|
||||||
// bottom: '20px',
|
|
||||||
// end: 10
|
|
||||||
// }]
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
Highcharts.chart(`container${i}`, {
|
|
||||||
|
|
||||||
chart: {
|
|
||||||
zooming: {
|
|
||||||
type: 'x'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
title: {
|
|
||||||
text: '123',
|
|
||||||
align: 'left'
|
|
||||||
},
|
|
||||||
|
|
||||||
subtitle: {
|
|
||||||
text: 'Using the Boost module',
|
|
||||||
align: 'left'
|
|
||||||
},
|
|
||||||
|
|
||||||
accessibility: {
|
|
||||||
screenReaderSection: {
|
|
||||||
beforeChartFormat: '<{headingTagName}>' +
|
|
||||||
'{chartTitle}</{headingTagName}><div>{chartSubtitle}</div>' +
|
|
||||||
'<div>{chartLongdesc}</div><div>{xAxisDescription}</div><div>' +
|
|
||||||
'{yAxisDescription}</div>'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
tooltip: {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
xAxis: {
|
|
||||||
type: 'datetime'
|
|
||||||
},
|
|
||||||
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: 'A相',
|
|
||||||
type: 'line',
|
|
||||||
lineWidth: 0.5,
|
|
||||||
data: SA.value[i]
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'B相',
|
|
||||||
type: 'line',
|
|
||||||
lineWidth: 0.5,
|
|
||||||
data: SB.value[i]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'C相',
|
|
||||||
type: 'line',
|
|
||||||
lineWidth: 0.5,
|
|
||||||
data: SC.value[i]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
});
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var init = () => {
|
|
||||||
Highcharts.chart('container', {
|
|
||||||
chart: {
|
|
||||||
type: 'spline'
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
text: 'Snow depth at Vikjafjellet, Norway'
|
|
||||||
},
|
|
||||||
subtitle: {
|
|
||||||
text: 'Irregular time data in Highcharts JS'
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'datetime',
|
|
||||||
dateTimeLabelFormats: {
|
|
||||||
// don't display the year
|
|
||||||
month: '%e. %b',
|
|
||||||
year: '%b'
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
text: 'Date'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
title: {
|
|
||||||
text: 'Snow depth (m)'
|
|
||||||
},
|
|
||||||
min: 0
|
|
||||||
},
|
|
||||||
// tooltip: {
|
|
||||||
// headerFormat: '<b>{series.name}</b><br>',
|
|
||||||
// pointFormat: '{point.x:%e. %b}: {point.y:.2f} m'
|
|
||||||
// },
|
|
||||||
|
|
||||||
plotOptions: {
|
|
||||||
series: {
|
|
||||||
marker: {
|
|
||||||
symbol: 'circle',
|
|
||||||
fillColor: '#FFFFFF',
|
|
||||||
enabled: true,
|
|
||||||
radius: 2.5,
|
|
||||||
lineWidth: 1,
|
|
||||||
lineColor: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
colors: ['#6CF', '#39F', '#06C', '#036', '#000'],
|
|
||||||
|
|
||||||
|
|
||||||
series: [
|
|
||||||
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
info()
|
|
||||||
|
|
||||||
// init();
|
|
||||||
})
|
|
||||||
onUnmounted(() => {
|
|
||||||
SA.value = []
|
|
||||||
SB.value = []
|
|
||||||
SC.value = []
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
@click="backbxlb"
|
@click="backbxlb"
|
||||||
class="el-icon-refresh-right"
|
class="el-icon-refresh-right"
|
||||||
icon="el-icon-CloseBold"
|
icon="el-icon-Back"
|
||||||
style="float: right"
|
style="float: right"
|
||||||
>
|
>
|
||||||
返回
|
返回
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'pinia'
|
import { mapState } from 'pinia'
|
||||||
import { globalStore } from '@/stores/indexs'
|
// import { globalStore } from '@/stores/indexs'
|
||||||
|
|
||||||
const FormContainerTypeEnum = {
|
const FormContainerTypeEnum = {
|
||||||
DRAWER: 'drawer',
|
DRAWER: 'drawer',
|
||||||
@@ -29,7 +29,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(globalStore, ['formStyle']),
|
// ...mapState(globalStore, ['formStyle']),
|
||||||
slotKeys() {
|
slotKeys() {
|
||||||
return Object.keys(this.$slots)
|
return Object.keys(this.$slots)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
label-position="left"
|
label-position="left"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
>
|
>
|
||||||
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 590px">
|
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
||||||
<template #label>
|
<template #label>
|
||||||
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="时间" />
|
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="统计时间" />
|
||||||
<span v-else>时间</span>
|
<span v-else>{{ dateLabel }}</span>
|
||||||
</template>
|
</template>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
ref="datePickerRef"
|
ref="datePickerRef"
|
||||||
@@ -99,6 +99,7 @@ interface Props {
|
|||||||
showReset?: boolean //是否显示重置按钮
|
showReset?: boolean //是否显示重置按钮
|
||||||
showExport?: boolean //导出控制
|
showExport?: boolean //导出控制
|
||||||
showTimeAll?: boolean //控制时间是否显示
|
showTimeAll?: boolean //控制时间是否显示
|
||||||
|
dateLabel?: string //设置时间名称
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
@@ -109,7 +110,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
theCurrentTime: false,
|
theCurrentTime: false,
|
||||||
showReset: true,
|
showReset: true,
|
||||||
showExport: false,
|
showExport: false,
|
||||||
showTimeAll: false
|
showTimeAll: false,
|
||||||
|
dateLabel: '统计日期'
|
||||||
})
|
})
|
||||||
// 动态计算table高度
|
// 动态计算table高度
|
||||||
const resizeObserver = new ResizeObserver(entries => {
|
const resizeObserver = new ResizeObserver(entries => {
|
||||||
@@ -131,7 +133,7 @@ const headerFormSecondStyleClose = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => tableStore.table.params.deptIndex,
|
() => tableStore?.table.params.deptIndex,
|
||||||
newVal => {
|
newVal => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
areaRef.value && areaRef.value.change()
|
areaRef.value && areaRef.value.change()
|
||||||
@@ -172,10 +174,12 @@ onUnmounted(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handlerHeight = () => {
|
const handlerHeight = () => {
|
||||||
tableStore.table.publicHeight + tableHeader.value.offsetHeight + (tableStore.showPage ? 58 : 0) + 20
|
if (tableStore && tableStore.table) {
|
||||||
tableStore.table.height = mainHeight(
|
|
||||||
tableStore.table.publicHeight + tableHeader.value.offsetHeight + (tableStore.showPage ? 58 : 0) + 20
|
tableStore.table.publicHeight + tableHeader.value.offsetHeight + (tableStore.showPage ? 58 : 0) + 20
|
||||||
).height as string
|
tableStore.table.height = mainHeight(
|
||||||
|
tableStore.table.publicHeight + tableHeader.value.offsetHeight + (tableStore.showPage ? 58 : 0) + 20
|
||||||
|
).height as string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const computedSearchRow = () => {
|
const computedSearchRow = () => {
|
||||||
if (!headerForm.value.$el) return
|
if (!headerForm.value.$el) return
|
||||||
|
|||||||
@@ -1,43 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="{ height:props.height?props.height: tableStore.table.height }">
|
<div :style="{ height: typeof props.height === 'string' ? props.height : tableStore.table.height }">
|
||||||
<vxe-table
|
<vxe-table ref="tableRef" height="auto" :key="key" :data="tableStore.table.data"
|
||||||
ref="tableRef"
|
v-loading="tableStore.table.loading" v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
||||||
height="auto"
|
@checkbox-all="selectChangeEvent" @checkbox-change="selectChangeEvent" :showOverflow="showOverflow"
|
||||||
:key="key"
|
@sort-change="handleSortChange">
|
||||||
:data="tableStore.table.data"
|
|
||||||
v-loading="tableStore.table.loading"
|
|
||||||
v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
|
||||||
@checkbox-all="selectChangeEvent"
|
|
||||||
@checkbox-change="selectChangeEvent"
|
|
||||||
:showOverflow="showOverflow"
|
|
||||||
@sort-change="handleSortChange"
|
|
||||||
>
|
|
||||||
<!-- Column 组件内部是 el-table-column -->
|
<!-- Column 组件内部是 el-table-column -->
|
||||||
<template v-if="isGroup">
|
<template v-if="isGroup">
|
||||||
<GroupColumn :column="tableStore.table.column" />
|
<GroupColumn :column="tableStore.table.column" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<Column
|
<Column :attr="item" :key="key + '-column'" v-for="(item, key) in tableStore.table.column"
|
||||||
:attr="item"
|
:tree-node="item.treeNode">
|
||||||
:key="key + '-column'"
|
|
||||||
v-for="(item, key) in tableStore.table.column"
|
|
||||||
:tree-node="item.treeNode"
|
|
||||||
>
|
|
||||||
<!-- tableStore 预设的列 render 方案 -->
|
<!-- tableStore 预设的列 render 方案 -->
|
||||||
<template v-if="item.render" #default="scope">
|
<template v-if="item.render" #default="scope">
|
||||||
<FieldRender
|
<FieldRender :field="item" :row="scope.row" :column="scope.column" :index="scope.rowIndex" :key="key +
|
||||||
:field="item"
|
'-' +
|
||||||
:row="scope.row"
|
item.render +
|
||||||
:column="scope.column"
|
'-' +
|
||||||
:index="scope.rowIndex"
|
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
||||||
:key="
|
" />
|
||||||
key +
|
|
||||||
'-' +
|
|
||||||
item.render +
|
|
||||||
'-' +
|
|
||||||
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
</template>
|
</template>
|
||||||
@@ -46,16 +27,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="tableStore.showPage" class="table-pagination">
|
<div v-if="tableStore.showPage" class="table-pagination">
|
||||||
<el-pagination
|
<el-pagination :currentPage="tableStore.table.params!.pageNum" :page-size="tableStore.table.params!.pageSize"
|
||||||
:currentPage="tableStore.table.params!.pageNum"
|
:page-sizes="pageSizes" background
|
||||||
:page-size="tableStore.table.params!.pageSize"
|
|
||||||
:page-sizes="pageSizes"
|
|
||||||
background
|
|
||||||
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
|
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
|
||||||
:total="tableStore.table.total"
|
:total="tableStore.table.total" @size-change="onTableSizeChange"
|
||||||
@size-change="onTableSizeChange"
|
@current-change="onTableCurrentChange"></el-pagination>
|
||||||
@current-change="onTableCurrentChange"
|
|
||||||
></el-pagination>
|
|
||||||
</div>
|
</div>
|
||||||
<slot name="footer"></slot>
|
<slot name="footer"></slot>
|
||||||
</template>
|
</template>
|
||||||
@@ -80,13 +56,13 @@ const key = ref(0)
|
|||||||
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
|
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
|
||||||
isGroup?: boolean
|
isGroup?: boolean
|
||||||
showOverflow?: boolean
|
showOverflow?: boolean
|
||||||
height?: string | boolean
|
height?: string | number
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
isGroup: false,
|
isGroup: false,
|
||||||
showOverflow: true,
|
showOverflow: true,
|
||||||
height: false
|
height: undefined
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.table.ref = tableRef.value as VxeTableInstance
|
tableStore.table.ref = tableRef.value as VxeTableInstance
|
||||||
|
|||||||
205
src/components/tree/details/monitoringPointDetails.vue
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog draggable v-model="dialogVisible" :title="title" width="1200px">
|
||||||
|
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||||
|
<el-tab-pane label="监测点详情" name="tab1">
|
||||||
|
<el-descriptions :column="3" border label-width="150px">
|
||||||
|
<el-descriptions-item label="项目工程">
|
||||||
|
{{ details.areaName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="项目单位">
|
||||||
|
{{ details.gdName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="所属变电站">
|
||||||
|
{{ details.bdName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压等级">
|
||||||
|
{{ details.scale }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端厂家">
|
||||||
|
{{ details.manufacturer }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端名称">
|
||||||
|
{{ details.devName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="网络参数">
|
||||||
|
{{ details.ip }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点名称">
|
||||||
|
{{ details.lineName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点序号">
|
||||||
|
{{ details.id }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="通讯状态">
|
||||||
|
{{ details.comFlag }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="干扰源类型">
|
||||||
|
{{ details.loadType }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点对象名称">
|
||||||
|
{{ details.objName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="接线方式">
|
||||||
|
{{ details.ptType }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="PT变比">
|
||||||
|
{{ details.pt }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="CT变比">
|
||||||
|
{{ details.ct }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="基准容量(MVA)">
|
||||||
|
{{ details.standardCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="最小短路容量(MVA)">
|
||||||
|
{{ details.shortCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="供电设备容量(MVA)">
|
||||||
|
{{ details.devCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="用户协议容量(MVA)">
|
||||||
|
{{ details.dealCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="监测点限值" name="tab2">
|
||||||
|
<el-descriptions :column="3" border label-width="250px">
|
||||||
|
<el-descriptions-item label="电压偏差上限值(%)">
|
||||||
|
{{ limitValue.voltageDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压偏差下限值(%)">
|
||||||
|
{{ limitValue.uvoltageDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="频率偏差限值(Hz)">
|
||||||
|
{{ limitValue.freqDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="三相电压不平衡度限值(%)">
|
||||||
|
{{ limitValue.ubalance }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="负序电流限值(A)">
|
||||||
|
{{ limitValue.ineg }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="长时闪变限值(%)">
|
||||||
|
{{ limitValue.flicker }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压总畸变率限值(%)">
|
||||||
|
{{ limitValue.uaberrance }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="奇次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.oddHarm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="偶次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.evenHarm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="3次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm3 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="4次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm4 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="5次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm5 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="6次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm6 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="7次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm7 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="8次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm8 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="9次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm9 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="10次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm10 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="11次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm11 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="12次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm12 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="13次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm13 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="14次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm14 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="15次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm15 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="16次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm16 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="17次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm17 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="18次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm18 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="19次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm19 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="20次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm20 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="21次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm21 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="22次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm22 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="23次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm23 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="24次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm24 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="25次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm25 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="0.5-1.5次间谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.inUharm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="2.5-15.5次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.inUharm16 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { getLineOverLimitData, getLineDetailData } from '@/api/device-boot/line'
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('')
|
||||||
|
const activeName = ref('tab1')
|
||||||
|
const details: any = ref([])
|
||||||
|
const limitValue: any = ref([])
|
||||||
|
const open = (data: any) => {
|
||||||
|
details.value = []
|
||||||
|
limitValue.value = []
|
||||||
|
activeName.value = 'tab1'
|
||||||
|
title.value = data.name.replace(/([^)]*)/g, '') + '_详情'
|
||||||
|
|
||||||
|
getLineDetailData(data.id).then(res => {
|
||||||
|
details.value = res.data
|
||||||
|
|
||||||
|
})
|
||||||
|
getLineOverLimitData(data.id).then(res => {
|
||||||
|
limitValue.value = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
const handleClick = (tab: any, event: Event) => {}
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-upload-list__item) {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
34
src/components/tree/details/substationDetails.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog draggable v-model="dialogVisible" :title="title" width="500px">
|
||||||
|
<el-descriptions class="margin-top" :column="1" border label-width="150px">
|
||||||
|
<el-descriptions-item label="变电站名称">{{ list[0]?.srbName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压等级">{{ list[0]?.scale }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="经度">{{ list[0]?.coordY }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="纬度">{{ list[0]?.coordX }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { getSubstationSelectLine } from '@/api/device-boot/line'
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('')
|
||||||
|
const list: any = ref([])
|
||||||
|
const open = (data: any) => {
|
||||||
|
list.value = []
|
||||||
|
title.value = data.name.replace(/([^)]*)/g, '') + '_详情'
|
||||||
|
|
||||||
|
getSubstationSelectLine(data.id).then(res => {
|
||||||
|
list.value = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-upload-list__item) {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,32 +1,84 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
||||||
<Icon v-show="menuCollapse" @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
<Icon
|
||||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 mt20 menu-collapse"
|
v-show="menuCollapse"
|
||||||
style="cursor: pointer" />
|
@click="onMenuCollapse"
|
||||||
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
|
size="18"
|
||||||
|
class="fold ml10 mt20 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
/>
|
||||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
<div style="display: flex; align-items: center" class="mb10">
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
<el-input v-model="filterText" placeholder="请输入内容" clearable maxlength="10" show-word-limit @input="change">
|
<el-input
|
||||||
|
v-model="filterText"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
clearable
|
||||||
|
maxlength="10"
|
||||||
|
show-word-limit
|
||||||
|
@input="change"
|
||||||
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
<Icon
|
||||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse"
|
@click="onMenuCollapse"
|
||||||
style="cursor: pointer" v-if="props.canExpand" />
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
<el-button icon="el-icon-Plus" v-if="props.addTree" type="primary" class="ml10"
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
@click="onAddTree">新增</el-button>
|
size="18"
|
||||||
|
class="fold ml10 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
v-if="props.canExpand"
|
||||||
|
/>
|
||||||
|
<el-button icon="el-icon-Plus" v-if="props.addTree" type="primary" class="ml10" @click="onAddTree">
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-tree style="flex: 1; overflow: auto" ref="treeRef" :props="defaultProps" highlight-current
|
<el-tree
|
||||||
:filter-node-method="filterNode" node-key="id" v-bind="$attrs">
|
style="flex: 1; overflow: auto"
|
||||||
|
ref="treeRef"
|
||||||
|
:props="defaultProps"
|
||||||
|
highlight-current
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
node-key="id"
|
||||||
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
<template #default="{ node, data }">
|
<template #default="{ node, data }">
|
||||||
<span class="custom-tree-node">
|
<span class="custom-tree-node">
|
||||||
<Icon :name="data.icon" style="font-size: 16px" :style="{ color: data.color }"
|
<Icon
|
||||||
v-if="data.icon" />
|
:name="data.icon"
|
||||||
<span style="margin-left: 4px">{{ node.label }}</span>
|
style="font-size: 16px"
|
||||||
|
:style="{ color: data.color }"
|
||||||
|
v-if="data.icon"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-tooltip
|
||||||
|
class="box-item"
|
||||||
|
effect="customized"
|
||||||
|
placement="bottom-start"
|
||||||
|
:offset="0"
|
||||||
|
v-if=" data.level == 6"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
<el-button type="primary" plain @click="viewDetails(data)">
|
||||||
|
{{ data.level == 3 ? '变电站详情' : '监测点详情' }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||||
|
</el-tooltip>
|
||||||
|
<span v-else style="margin-left: 4px">{{ node.label }}</span>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 变电站详情 -->
|
||||||
|
<SubstationDetails ref="SubstationRef"/>
|
||||||
|
<!-- 监测点详情 -->
|
||||||
|
<MonitoringPointDetails ref="MonitoringPointRef"/>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -35,6 +87,9 @@ import useCurrentInstance from '@/utils/useCurrentInstance'
|
|||||||
import { ElTree } from 'element-plus'
|
import { ElTree } from 'element-plus'
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import MonitoringPointDetails from './details/monitoringPointDetails.vue'
|
||||||
|
import SubstationDetails from './details/substationDetails.vue'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'govern/tree'
|
name: 'govern/tree'
|
||||||
})
|
})
|
||||||
@@ -52,22 +107,25 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
})
|
})
|
||||||
const { proxy } = useCurrentInstance()
|
const { proxy } = useCurrentInstance()
|
||||||
const menuCollapse = ref(false)
|
const menuCollapse = ref(false)
|
||||||
|
const MonitoringPointRef = ref()
|
||||||
|
const SubstationRef = ref()
|
||||||
const filterText = ref('')
|
const filterText = ref('')
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
label: 'name',
|
label: 'name',
|
||||||
value: 'id'
|
value: 'id'
|
||||||
}
|
}
|
||||||
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g;
|
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g
|
||||||
const change=(val) => {
|
const change = val => {
|
||||||
|
|
||||||
|
|
||||||
if (specialCharsPattern.test(val)) {
|
if (specialCharsPattern.test(val)) {
|
||||||
ElMessage.warning('禁止输入特殊字符!')
|
ElMessage.warning('禁止输入特殊字符!')
|
||||||
filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
filterText.value = val.replace(
|
||||||
console.log("🚀 ~ change ~ filterText.value:", filterText.value)
|
/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g,
|
||||||
|
''
|
||||||
|
)
|
||||||
|
console.log('🚀 ~ change ~ filterText.value:', filterText.value)
|
||||||
|
|
||||||
treeRef.value!.filter(filterText.value)
|
treeRef.value!.filter(filterText.value)
|
||||||
}else{
|
} else {
|
||||||
treeRef.value!.filter(filterText.value)
|
treeRef.value!.filter(filterText.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,18 +146,30 @@ const onMenuCollapse = () => {
|
|||||||
menuCollapse.value = !menuCollapse.value
|
menuCollapse.value = !menuCollapse.value
|
||||||
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||||
}
|
}
|
||||||
|
// 查看详情
|
||||||
|
const viewDetails = (data: any) => {
|
||||||
|
console.log("🚀 ~ viewDetails ~ data:", data)
|
||||||
|
if (data.level == 3) {
|
||||||
|
// 变电站详情
|
||||||
|
// substationDetails
|
||||||
|
SubstationRef.value.open(data)
|
||||||
|
} else {
|
||||||
|
// 监测点详情
|
||||||
|
MonitoringPointRef.value.open(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// proxy.eventBus.emit('viewDetails', data)
|
||||||
|
}
|
||||||
const filterNode = (value: string, data: any, node: any) => {
|
const filterNode = (value: string, data: any, node: any) => {
|
||||||
if (!value) return true
|
if (!value) return true
|
||||||
// return data.name.includes(value)
|
// return data.name.includes(value)
|
||||||
if (data.name) {
|
if (data.name) {
|
||||||
|
|
||||||
return chooseNode(value, data, node)
|
return chooseNode(value, data, node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||||
const chooseNode = (value: string, data: any, node: any) => {
|
const chooseNode = (value: string, data: any, node: any) => {
|
||||||
|
|
||||||
if (data.name.indexOf(value) !== -1) {
|
if (data.name.indexOf(value) !== -1) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -160,3 +230,16 @@ defineExpose({ treeRef })
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style>
|
||||||
|
.el-popper.is-customized {
|
||||||
|
/* Set padding to ensure the height is 32px */
|
||||||
|
padding: 0;
|
||||||
|
background: var(--el-color-primary-light-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-popper.is-customized .el-popper__arrow::before {
|
||||||
|
background: var(--el-color-primary-light-3);
|
||||||
|
right: 0;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
30
src/main.ts
@@ -35,21 +35,21 @@ const setupAll = async () => {
|
|||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
//开启离线地图
|
//开启离线地图
|
||||||
app.use(BaiduMapOffline, {
|
// app.use(BaiduMapOffline, {
|
||||||
offline: true,
|
// offline: true,
|
||||||
offlineConfig: {
|
// offlineConfig: {
|
||||||
imgext: '.png',
|
// imgext: '.png',
|
||||||
customstyle: '',
|
// customstyle: '',
|
||||||
tiles_dir: '',
|
// tiles_dir: '',
|
||||||
tiles_hybrid: '',
|
// tiles_hybrid: '',
|
||||||
tiles_self: '',
|
// tiles_self: '',
|
||||||
tiles_v_dir: '',
|
// tiles_v_dir: '',
|
||||||
tiles_satellite_dir: '',
|
// tiles_satellite_dir: '',
|
||||||
tiles_road_dir: '',
|
// tiles_road_dir: '',
|
||||||
tiles_v_road_dir: '',
|
// tiles_v_road_dir: '',
|
||||||
home: './plugin/offline/'
|
// home: './plugin/offline/'
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
app.use(BaiduMap, {
|
app.use(BaiduMap, {
|
||||||
// ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
// ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
||||||
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN',
|
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN',
|
||||||
|
|||||||
34
src/stores/timeCache.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
// src/stores/timeCache.ts
|
||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||||
|
|
||||||
|
// 时间组件的缓存值 用于驾驶舱放大的时候和内部的时间组件同步
|
||||||
|
interface TimeCacheState {
|
||||||
|
cache: Map<string, {
|
||||||
|
interval: number | undefined // 时间组件的月份、年份、时间、时间格式的缓存值
|
||||||
|
timeValue: any // 时间组件的值
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useTimeCacheStore = defineStore('timeCache', {
|
||||||
|
state: (): TimeCacheState => ({
|
||||||
|
cache: new Map()
|
||||||
|
}),
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
setCache(routePath: string, interval: number | undefined, timeValue: any) {
|
||||||
|
this.cache.set(routePath, {
|
||||||
|
interval,
|
||||||
|
timeValue
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getCache(routePath: string) {
|
||||||
|
return this.cache.get(routePath)
|
||||||
|
},
|
||||||
|
|
||||||
|
hasCache(routePath: string) {
|
||||||
|
return this.cache.has(routePath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -8,29 +8,31 @@ $primary-light: #3f6ad8;
|
|||||||
// --ba-background
|
// --ba-background
|
||||||
$bg-color: () !default;
|
$bg-color: () !default;
|
||||||
$bg-color: map.merge(
|
$bg-color: map.merge(
|
||||||
(
|
(
|
||||||
'': #edf0f3,
|
'': #edf0f3,
|
||||||
'overlay': #ffffff,
|
'overlay': #ffffff
|
||||||
),
|
),
|
||||||
$bg-color
|
$bg-color
|
||||||
);
|
);
|
||||||
|
|
||||||
// --ba-border-color
|
// --ba-border-color
|
||||||
$border-color: () !default;
|
$border-color: () !default;
|
||||||
$border-color: map.merge(
|
$border-color: map.merge(
|
||||||
(
|
(
|
||||||
'': #f6f6f6,
|
'': #f6f6f6
|
||||||
),
|
),
|
||||||
$border-color
|
$border-color
|
||||||
);
|
);
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
@include set-css-var-value('main-space', $main-space);
|
@include set-css-var-value('main-space', $main-space);
|
||||||
@include set-css-var-value('color-primary-light', $primary-light);
|
@include set-css-var-value('color-primary-light', $primary-light);
|
||||||
@include set-component-css-var('bg-color', $bg-color);
|
@include set-component-css-var('bg-color', $bg-color);
|
||||||
@include set-component-css-var('border-color', $border-color);
|
@include set-component-css-var('border-color', $border-color);
|
||||||
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
--vxe-ui-table-row-current-background-color: var(--el-color-primary-light-8);
|
||||||
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
--vxe-ui-table-row-hover-current-background-color: var(--el-color-primary-light-8);
|
||||||
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
||||||
// --vxe-table-row-hover-striped-background-color: var(--el-color-primary-light-9);
|
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
||||||
|
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
||||||
|
// --vxe-table-row-hover-striped-background-color: var(--el-color-primary-light-9);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.vxe-header--row {
|
.vxe-header--row {
|
||||||
background: var(--vxe-table-header-background-color);
|
background: var(--vxe-table-header-background-color);
|
||||||
color: var(--vxe-table-header-font-color);
|
color: var(--vxe-table-header-font-color);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is--checked.vxe-checkbox,
|
.is--checked.vxe-checkbox,
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,
|
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,
|
||||||
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,
|
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,
|
||||||
.vxe-table--render-default .is--checked.vxe-cell--radio .vxe-radio--icon {
|
.vxe-table--render-default .is--checked.vxe-cell--radio .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-3);
|
color: var(--el-color-primary-light-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,
|
.vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,
|
||||||
@@ -38,40 +38,41 @@
|
|||||||
.vxe-export--panel-column-option:not(.is--disabled):hover .vxe-radio--icon,
|
.vxe-export--panel-column-option:not(.is--disabled):hover .vxe-radio--icon,
|
||||||
.vxe-table--filter-option:not(.is--disabled):hover .vxe-radio--icon,
|
.vxe-table--filter-option:not(.is--disabled):hover .vxe-radio--icon,
|
||||||
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-5);
|
color: var(--el-color-primary-light-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--tooltip-wrapper {
|
.vxe-table--tooltip-wrapper {
|
||||||
z-index: 10000 !important;
|
z-index: 10000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is--disabled {
|
.is--disabled {
|
||||||
background-color: var(--vxe-input-disabled-color);
|
background-color: var(--vxe-input-disabled-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-modal--wrapper {
|
.vxe-modal--wrapper {
|
||||||
z-index: 5000 !important;
|
z-index: 5000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(even) {
|
.vxe-table--body .vxe-body--row:nth-child(even) {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
||||||
width: 10px !important;
|
width: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter:after,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter:after,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter:after {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter:after {
|
||||||
background-color: #000 !important;
|
background-color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter:before,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter:before,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter:before {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter:before {
|
||||||
background-color: #000 !important;
|
background-color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useCache, CACHE_KEY } from '@/hooks/web/useCache'
|
import { useCache, CACHE_KEY } from '@/hooks/web/useCache'
|
||||||
import { TokenType } from '@/api/login/types'
|
|
||||||
import { decrypt, encrypt } from '@/utils/jsencrypt'
|
import { decrypt, encrypt } from '@/utils/jsencrypt'
|
||||||
|
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
@@ -19,7 +18,7 @@ export const getRefreshToken = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设置token
|
// 设置token
|
||||||
export const setToken = (token: TokenType) => {
|
export const setToken = (token: any) => {
|
||||||
wsCache.set(RefreshTokenKey, token.refreshToken)
|
wsCache.set(RefreshTokenKey, token.refreshToken)
|
||||||
wsCache.set(AccessTokenKey, token.accessToken)
|
wsCache.set(AccessTokenKey, token.accessToken)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,3 +157,146 @@ export const exportCSV = (title: object, data: any, filename: string) => {
|
|||||||
// 释放URL对象
|
// 释放URL对象
|
||||||
URL.revokeObjectURL(link.href)
|
URL.revokeObjectURL(link.href)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 补全时间序列数据中缺失的条目
|
||||||
|
* @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...]
|
||||||
|
* @returns 补全后的数据,缺失条目数值为 null
|
||||||
|
*/
|
||||||
|
export const completeTimeSeries = (rawData: string[][]): (string | null)[][] => {
|
||||||
|
// 步骤1:校验原始数据并解析时间
|
||||||
|
if (rawData.length < 2) {
|
||||||
|
console.warn('数据量不足2条,无法计算时间间隔,直接返回原始数据')
|
||||||
|
return rawData.map(item => [...item])
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析所有时间为Date对象,过滤无效时间并按时间排序
|
||||||
|
const validData = rawData
|
||||||
|
.map(item => {
|
||||||
|
// 确保至少有时间和数值字段
|
||||||
|
if (!item[0]) {
|
||||||
|
return { time: new Date(0), item, isValid: false }
|
||||||
|
}
|
||||||
|
const time = new Date(item[0])
|
||||||
|
return { time, item, isValid: !isNaN(time.getTime()) }
|
||||||
|
})
|
||||||
|
.filter(data => data.isValid)
|
||||||
|
.sort((a, b) => a.time.getTime() - b.time.getTime()) // 确保数据按时间排序
|
||||||
|
.map(data => data.item)
|
||||||
|
|
||||||
|
if (validData.length < 2) {
|
||||||
|
throw new Error('有效时间数据不足2条,无法继续处理')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 步骤2:计算时间间隔(分析前几条数据确定最可能的间隔)
|
||||||
|
const intervals: number[] = []
|
||||||
|
// 分析前10条数据来确定间隔,避免单一间隔出错
|
||||||
|
const analyzeCount = Math.min(10, validData.length - 1)
|
||||||
|
for (let i = 0; i < analyzeCount; i++) {
|
||||||
|
const currentTime = new Date(validData[i][0]!).getTime()
|
||||||
|
const nextTime = new Date(validData[i + 1][0]!).getTime()
|
||||||
|
const interval = nextTime - currentTime
|
||||||
|
if (interval > 0) {
|
||||||
|
intervals.push(interval)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取最常见的间隔作为标准间隔
|
||||||
|
const timeInterval = getMostFrequentValue(intervals)
|
||||||
|
if (timeInterval <= 0) {
|
||||||
|
throw new Error('无法确定有效的时间间隔')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 步骤3:生成完整的时间序列范围(从第一条到最后一条)
|
||||||
|
const startTime = new Date(validData[0][0]!).getTime()
|
||||||
|
const endTime = new Date(validData[validData.length - 1][0]!).getTime()
|
||||||
|
const completeTimes: Date[] = []
|
||||||
|
|
||||||
|
// 生成从 startTime 到 endTime 的所有间隔时间点
|
||||||
|
for (let time = startTime; time <= endTime; time += timeInterval) {
|
||||||
|
completeTimes.push(new Date(time))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 步骤4:将原始数据转为时间映射表,使用精确的时间字符串匹配
|
||||||
|
const timeDataMap = new Map<string, (string | undefined)[]>()
|
||||||
|
validData.forEach(item => {
|
||||||
|
// 使用原始时间字符串作为键,避免格式转换导致的匹配问题
|
||||||
|
if (item[0]) {
|
||||||
|
timeDataMap.set(item[0], item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 提取模板数据(从第一条有效数据中提取单位和类型,处理可能的缺失)
|
||||||
|
const template = validData[0]
|
||||||
|
|
||||||
|
// 步骤5:对比补全数据,缺失条目数值为 null
|
||||||
|
const completedData = completeTimes.map(time => {
|
||||||
|
// 保持与原始数据相同的时间格式
|
||||||
|
const timeStr = formatTime(time)
|
||||||
|
const existingItem = timeDataMap.get(timeStr)
|
||||||
|
|
||||||
|
if (existingItem) {
|
||||||
|
// 存在该时间,返回原始数据
|
||||||
|
return [...existingItem]
|
||||||
|
} else {
|
||||||
|
// 缺失该时间,数值设为 null,其他字段沿用第一个有效数据的格式
|
||||||
|
// 处理可能缺失的单位和类型字段
|
||||||
|
const result: (string | null | undefined)[] = [timeStr, '/']
|
||||||
|
// 仅在原始数据有单位字段时才添加
|
||||||
|
if (template.length > 2) {
|
||||||
|
result.push(template[2])
|
||||||
|
}
|
||||||
|
// 仅在原始数据有类型字段时才添加
|
||||||
|
if (template.length > 3) {
|
||||||
|
result.push(template[3])
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return completedData
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化时间为 "YYYY-MM-DD HH:mm:ss" 格式
|
||||||
|
* @param date 日期对象
|
||||||
|
* @returns 格式化后的时间字符串
|
||||||
|
*/
|
||||||
|
function formatTime(date: Date): string {
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0')
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||||
|
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数组中出现频率最高的值
|
||||||
|
* @param arr 数字数组
|
||||||
|
* @returns 出现频率最高的值
|
||||||
|
*/
|
||||||
|
function getMostFrequentValue(arr: number[]): number {
|
||||||
|
if (arr.length === 0) return 0
|
||||||
|
|
||||||
|
const frequencyMap = new Map<number, number>()
|
||||||
|
arr.forEach(num => {
|
||||||
|
frequencyMap.set(num, (frequencyMap.get(num) || 0) + 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
let maxFrequency = 0
|
||||||
|
let mostFrequent = arr[0]
|
||||||
|
|
||||||
|
frequencyMap.forEach((frequency, num) => {
|
||||||
|
if (frequency > maxFrequency) {
|
||||||
|
maxFrequency = frequency
|
||||||
|
mostFrequent = num
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return mostFrequent
|
||||||
|
}
|
||||||
|
|||||||
@@ -362,3 +362,4 @@ export function getTimeOfTheMonth(key: string): [string, string] {
|
|||||||
throw new Error('Invalid key')
|
throw new Error('Invalid key')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const bubble: {
|
|||||||
ctx: {},
|
ctx: {},
|
||||||
circles: [],
|
circles: [],
|
||||||
animate: true,
|
animate: true,
|
||||||
requestId: null,
|
requestId: null
|
||||||
}
|
}
|
||||||
|
|
||||||
export const init = function (): void {
|
export const init = function (): void {
|
||||||
@@ -76,7 +76,7 @@ class Circle {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.pos = {
|
this.pos = {
|
||||||
x: Math.random() * bubble.width,
|
x: Math.random() * bubble.width,
|
||||||
y: bubble.height + Math.random() * 100,
|
y: bubble.height + Math.random() * 100
|
||||||
}
|
}
|
||||||
this.alpha = 0.1 + Math.random() * 0.3
|
this.alpha = 0.1 + Math.random() * 0.3
|
||||||
this.scale = 0.1 + Math.random() * 0.3
|
this.scale = 0.1 + Math.random() * 0.3
|
||||||
@@ -84,6 +84,16 @@ class Circle {
|
|||||||
this.draw = function () {
|
this.draw = function () {
|
||||||
this.pos.y -= this.velocity
|
this.pos.y -= this.velocity
|
||||||
this.alpha -= 0.0005
|
this.alpha -= 0.0005
|
||||||
|
// 当气泡超出顶部或透明度为 0 时,重置位置和属性
|
||||||
|
if (this.pos.y < -10 || this.alpha < 0) {
|
||||||
|
this.pos = {
|
||||||
|
x: Math.random() * bubble.width,
|
||||||
|
y: bubble.height + Math.random() * 100
|
||||||
|
}
|
||||||
|
this.alpha = 0.1 + Math.random() * 0.35
|
||||||
|
this.scale = 0.1 + Math.random() * 0.35
|
||||||
|
this.velocity = Math.random()
|
||||||
|
}
|
||||||
bubble.ctx.beginPath()
|
bubble.ctx.beginPath()
|
||||||
bubble.ctx.arc(this.pos.x, this.pos.y, this.scale * 10, 0, 2 * Math.PI, false)
|
bubble.ctx.arc(this.pos.x, this.pos.y, this.scale * 10, 0, 2 * Math.PI, false)
|
||||||
bubble.ctx.fillStyle = 'rgba(255,255,255,' + this.alpha + ')'
|
bubble.ctx.fillStyle = 'rgba(255,255,255,' + this.alpha + ')'
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import { useNavTabs } from '@/stores/navTabs'
|
|||||||
import { closeShade } from '@/utils/pageShade'
|
import { closeShade } from '@/utils/pageShade'
|
||||||
import { adminBaseRoute } from '@/router/static'
|
import { adminBaseRoute } from '@/router/static'
|
||||||
import { compact, isEmpty, reverse } from 'lodash-es'
|
import { compact, isEmpty, reverse } from 'lodash-es'
|
||||||
|
import { getRouteMenu, dictDataCache } from '@/api/auth'
|
||||||
import { isAdminApp } from '@/utils/common'
|
import { isAdminApp } from '@/utils/common'
|
||||||
|
import { adminBaseRoutePath } from '@/router/static'
|
||||||
|
const route:any = useRouter()
|
||||||
/**
|
/**
|
||||||
* 导航失败有错误消息的路由push
|
* 导航失败有错误消息的路由push
|
||||||
* @param to — 导航位置,同 router.push
|
* @param to — 导航位置,同 router.push
|
||||||
@@ -293,3 +295,37 @@ const getParentNames = (name: string) => {
|
|||||||
}
|
}
|
||||||
return reverse(parentNames)
|
return reverse(parentNames)
|
||||||
}
|
}
|
||||||
|
// 刷新菜单
|
||||||
|
export const getMenu = () => {
|
||||||
|
getRouteMenu().then((res: any) => {
|
||||||
|
const handlerMenu = (data: any) => {
|
||||||
|
data.forEach((item: any) => {
|
||||||
|
item.routePath =
|
||||||
|
item.routePath[0] == '/' ? item.routePath.substring(1, item.routePath.length) : item.routePath
|
||||||
|
item.path = item.routePath
|
||||||
|
item.name = item.routePath
|
||||||
|
item.keepalive = item.routePath
|
||||||
|
item.component = item.routeName
|
||||||
|
? item.routeName.indexOf('/src/views/') > -1
|
||||||
|
? item.routeName
|
||||||
|
: `/src/views/${item.routeName}/index.vue`
|
||||||
|
: ''
|
||||||
|
item.type = item.children && item.children.length > 0 ? 'menu_dir' : 'menu'
|
||||||
|
item.menu_type = item.children && item.children.length > 0 ? null : 'tab'
|
||||||
|
if (item.children) {
|
||||||
|
handlerMenu(item.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
handlerMenu(res.data)
|
||||||
|
handleAdminRoute(res.data)
|
||||||
|
if (route?.params.to) {
|
||||||
|
const lastRoute = JSON.parse(route.params.to as string)
|
||||||
|
if (lastRoute.path != adminBaseRoutePath) {
|
||||||
|
let query = !isEmpty(lastRoute.query) ? lastRoute.query : {}
|
||||||
|
routePush({ path: lastRoute.path, query: query })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ const options1 = [
|
|||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const heightB = mainHeight(448)
|
const heightB = mainHeight(448)
|
||||||
const heightA = mainHeight(180)
|
const heightA = mainHeight(180)
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const detailRef = ref()
|
const detailRef = ref()
|
||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
@@ -493,35 +493,35 @@ const tableStore = new TableStore({
|
|||||||
{
|
{
|
||||||
label: '0%~10%',
|
label: '0%~10%',
|
||||||
quantity: res.minsNum0,
|
quantity: res.minsNum0,
|
||||||
percentage: res.proportion0.toFixed(2) + '%',
|
percentage: res.proportion0.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot0,
|
crossTheLine: res.isOrNot0,
|
||||||
value: '0%~10%'
|
value: '0%~10%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '10%~20%',
|
label: '10%~20%',
|
||||||
quantity: res.minsNum1,
|
quantity: res.minsNum1,
|
||||||
percentage: res.proportion1.toFixed(2) + '%',
|
percentage: res.proportion1.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot1,
|
crossTheLine: res.isOrNot1,
|
||||||
value: '10%~10%'
|
value: '10%~10%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '20%~30%',
|
label: '20%~30%',
|
||||||
quantity: res.minsNum2,
|
quantity: res.minsNum2,
|
||||||
percentage: res.proportion2.toFixed(2) + '%',
|
percentage: res.proportion2.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot2,
|
crossTheLine: res.isOrNot2,
|
||||||
value: '10%~30%'
|
value: '10%~30%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '30%~40%',
|
label: '30%~40%',
|
||||||
quantity: res.minsNum3,
|
quantity: res.minsNum3,
|
||||||
percentage: res.proportion3.toFixed(2) + '%',
|
percentage: res.proportion3.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot3,
|
crossTheLine: res.isOrNot3,
|
||||||
value: '30%~40%'
|
value: '30%~40%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '40%~50%',
|
label: '40%~50%',
|
||||||
quantity: res.minsNum4,
|
quantity: res.minsNum4,
|
||||||
percentage: res.proportion4.toFixed(2) + '%',
|
percentage: res.proportion4.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot4,
|
crossTheLine: res.isOrNot4,
|
||||||
value: '40%~50%'
|
value: '40%~50%'
|
||||||
}
|
}
|
||||||
@@ -530,35 +530,35 @@ const tableStore = new TableStore({
|
|||||||
{
|
{
|
||||||
label: '50%~60%',
|
label: '50%~60%',
|
||||||
quantity: res.minsNum5,
|
quantity: res.minsNum5,
|
||||||
percentage: res.proportion5.toFixed(2) + '%',
|
percentage: res.proportion5.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot5,
|
crossTheLine: res.isOrNot5,
|
||||||
value: '50%~60%'
|
value: '50%~60%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '60%~70%',
|
label: '60%~70%',
|
||||||
quantity: res.minsNum6,
|
quantity: res.minsNum6,
|
||||||
percentage: res.proportion6.toFixed(2) + '%',
|
percentage: res.proportion6.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot6,
|
crossTheLine: res.isOrNot6,
|
||||||
value: '60%~70%'
|
value: '60%~70%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '70%~80%',
|
label: '70%~80%',
|
||||||
quantity: res.minsNum7,
|
quantity: res.minsNum7,
|
||||||
percentage: res.proportion7.toFixed(2) + '%',
|
percentage: res.proportion7.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot7,
|
crossTheLine: res.isOrNot7,
|
||||||
value: '70%~80%'
|
value: '70%~80%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '80%~90%',
|
label: '80%~90%',
|
||||||
quantity: res.minsNum8,
|
quantity: res.minsNum8,
|
||||||
percentage: res.proportion8.toFixed(2) + '%',
|
percentage: res.proportion8.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot8,
|
crossTheLine: res.isOrNot8,
|
||||||
value: '80%~90%'
|
value: '80%~90%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '90%~100%',
|
label: '90%~100%',
|
||||||
quantity: res.minsNum9,
|
quantity: res.minsNum9,
|
||||||
percentage: res.proportion9.toFixed(2) + '%',
|
percentage: res.proportion9.toFixed(2) + '%',
|
||||||
crossTheLine: res.isOrNot9,
|
crossTheLine: res.isOrNot9,
|
||||||
value: '90%~100%'
|
value: '90%~100%'
|
||||||
}
|
}
|
||||||
@@ -589,7 +589,7 @@ const tableStore = new TableStore({
|
|||||||
lineHeight: 8,
|
lineHeight: 8,
|
||||||
minMargin: 10,
|
minMargin: 10,
|
||||||
formatter: function (e) {
|
formatter: function (e) {
|
||||||
return '{name|' + e.name + '}{percent|' + e.data.percentage+ '}'
|
return '{name|' + e.name + '}{percent|' + e.data.percentage + '}'
|
||||||
},
|
},
|
||||||
rich: {
|
rich: {
|
||||||
name: {
|
name: {
|
||||||
@@ -781,7 +781,7 @@ provide('tableStore', tableStore)
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ const options1 = [
|
|||||||
]
|
]
|
||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const heightB = mainHeight(445)
|
const heightB = mainHeight(445)
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const detailRef = ref()
|
const detailRef = ref()
|
||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
@@ -797,7 +797,7 @@ provide('tableStore', tableStore)
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const prop = defineProps({
|
|||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const fontdveoption = dictData.getBasicData('Dev_Ops')
|
const fontdveoption = dictData.getBasicData('Dev_Ops')
|
||||||
|
|
||||||
const tableStore = new TableStore({
|
const tableStore:any = new TableStore({
|
||||||
url: '/device-boot/pqsTerminalLogs/getList',
|
url: '/device-boot/pqsTerminalLogs/getList',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<pane style="background: #fff">
|
<pane style="background: #fff">
|
||||||
<TableHeader :showSearch="false" v-show="props.rowList.id == undefined">
|
<TableHeader :showSearch="false" v-show="props.rowList.id == undefined">
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="时间">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -205,7 +205,7 @@ const props = defineProps(['rowList'])
|
|||||||
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
||||||
const currentLod = ref(false)
|
const currentLod = ref(false)
|
||||||
const monitoringPoint = useMonitoringPoint()
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
const height = mainHeight(80).height
|
const height = mainHeight(80).height
|
||||||
|
|||||||
@@ -579,7 +579,7 @@ const addMenu = () => {}
|
|||||||
:deep(.default) {
|
:deep(.default) {
|
||||||
display: flex;
|
display: flex;
|
||||||
.row--current {
|
.row--current {
|
||||||
background-color: var(--el-color-primary-light-8) !important;
|
// background-color: var(--el-color-primary-light-8) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.custom-tree-node {
|
.custom-tree-node {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="tableStore.table.params.filterName"
|
v-model="tableStore.table.params.filterName"
|
||||||
@keyup="searchEvent"
|
@keyup="searchEvent"
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="tableStore.table.params.filterName"
|
v-model="tableStore.table.params.filterName"
|
||||||
@keyup="searchEvent"
|
@keyup="searchEvent"
|
||||||
|
|||||||
@@ -54,14 +54,17 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="right: 500px; position: absolute; overflow: hidden">
|
<el-form-item style="right: 500px; position: absolute; overflow: hidden">
|
||||||
<LocationInformation style="width: 16px; margin-right: 8px; color: var(--el-color-primary)" />
|
<LocationInformation
|
||||||
<span style="font-size: 16px; font-weight: bold; color: var(--el-color-primary)">当前操作节点:</span>
|
style="width: 16px; margin-right: 8px; color: var(--el-color-primary)"
|
||||||
|
/>
|
||||||
|
<span style="font-size: 16px; font-weight: bold; color: var(--el-color-primary)">
|
||||||
|
当前操作节点:
|
||||||
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="right: 0; position: absolute; overflow: hidden">
|
<el-form-item style="right: 0; position: absolute; overflow: hidden">
|
||||||
<div class="title" :class="titleList.length > 5 ? 'titleScroll' : ''">
|
<div class="title" :class="titleList.length > 5 ? 'titleScroll' : ''">
|
||||||
<span v-for="(item, index) in titleList">{{ index == 0 ? '' : ' > ' }}{{ item }}</span>
|
<span v-for="(item, index) in titleList">{{ index == 0 ? '' : ' > ' }}{{ item }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div id="scrollBox" :style="{ height: Height.height }" style="overflow-y: auto">
|
<div id="scrollBox" :style="{ height: Height.height }" style="overflow-y: auto">
|
||||||
@@ -1691,7 +1694,7 @@ import { useDictData } from '@/stores/dictData'
|
|||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { getYwZtSubstation } from '@/api/device-boot/device'
|
import { getYwZtSubstation } from '@/api/device-boot/device'
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const TerminalRef = ref()
|
const TerminalRef = ref()
|
||||||
const pageHeight = mainHeight(20)
|
const pageHeight = mainHeight(20)
|
||||||
const Height = mainHeight(100)
|
const Height = mainHeight(100)
|
||||||
@@ -2024,12 +2027,12 @@ const latff: any = ref((rule: any, value: any, callback: any) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const plevel = ref(0)
|
const plevel = ref(0)
|
||||||
const nodeDataList=ref()
|
const nodeDataList = ref()
|
||||||
const nodeEventList=ref()
|
const nodeEventList = ref()
|
||||||
const nodeLevel1=ref(0)
|
const nodeLevel1 = ref(0)
|
||||||
const nodeClick = (e: anyObj, data: any) => {
|
const nodeClick = (e: anyObj, data: any) => {
|
||||||
nodeDataList.value = data
|
nodeDataList.value = data
|
||||||
nodeEventList.value = e
|
nodeEventList.value = e
|
||||||
plevel.value = data.data.plevel
|
plevel.value = data.data.plevel
|
||||||
treeClickCount.value++
|
treeClickCount.value++
|
||||||
if (treeClickCount.value > 2) return
|
if (treeClickCount.value > 2) return
|
||||||
@@ -2338,7 +2341,9 @@ const next = async () => {
|
|||||||
break
|
break
|
||||||
case 600:
|
case 600:
|
||||||
addLine()
|
addLine()
|
||||||
selectChanged(AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[busBarIndex.value].scale)
|
selectChanged(
|
||||||
|
AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[busBarIndex.value].scale
|
||||||
|
)
|
||||||
nextfalg.value = false
|
nextfalg.value = false
|
||||||
break
|
break
|
||||||
case 700:
|
case 700:
|
||||||
@@ -2355,8 +2360,7 @@ const black = () => {
|
|||||||
busBarIndex.value = '0'
|
busBarIndex.value = '0'
|
||||||
deviceIndex.value = '0'
|
deviceIndex.value = '0'
|
||||||
lineIndex.value = '0'
|
lineIndex.value = '0'
|
||||||
nodeClick(nodeEventList.value,nodeDataList.value)
|
nodeClick(nodeEventList.value, nodeDataList.value)
|
||||||
|
|
||||||
}
|
}
|
||||||
// 确认提交
|
// 确认提交
|
||||||
const onsubmit = () => {
|
const onsubmit = () => {
|
||||||
@@ -3073,7 +3077,7 @@ const setDown = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
if (VITE_FLAG) {
|
if (VITE_FLAG) {
|
||||||
getYwZtSubstation({ orgId: '' }).then(res => {
|
getYwZtSubstation({ orgId: '' }).then(res => {
|
||||||
|
|||||||
161
src/views/pqs/cockpit/homePage/components/routingConfig.vue
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog v-model="dialogVisible" title="设置" width="600">
|
||||||
|
<div style="display: flex; justify-content: end" class="mb10">
|
||||||
|
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
|
||||||
|
</div>
|
||||||
|
<div style="height: calc(100vh / 2); max-height: 400px">
|
||||||
|
<vxe-table
|
||||||
|
border
|
||||||
|
ref="tableRef"
|
||||||
|
:data="pageList.filter((item: any) => item.pagePath != 'dashboard/index')"
|
||||||
|
align="center"
|
||||||
|
height="auto"
|
||||||
|
v-bind="defaultAttribute"
|
||||||
|
>
|
||||||
|
<vxe-column field="pageName" title="菜单名称"></vxe-column>
|
||||||
|
|
||||||
|
<vxe-column field="icon" title="图标" width="80">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<Icon class="ba-icon-dark" :name="row.icon || ''" />
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="startTime" title="是否激活">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-switch
|
||||||
|
v-model="row.state"
|
||||||
|
inline-prompt
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
active-text="已激活"
|
||||||
|
inactive-text="未激活"
|
||||||
|
:before-change="() => beforeChange(row)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="startTime" title="操作">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="primary" link @click="edit(row)">编辑</el-button>
|
||||||
|
|
||||||
|
<el-button type="danger" link @click="deletes(row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import { getDashboardPageByUserId, deleteDashboard, activatePage } from '@/api/system-boot/csstatisticalset'
|
||||||
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
|
import { getMenu } from '@/utils/router'
|
||||||
|
|
||||||
|
const { push } = useRouter()
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const route = useRouter()
|
||||||
|
const adminInfo = useAdminInfo()
|
||||||
|
const pageList: any = ref([])
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
init()
|
||||||
|
}
|
||||||
|
const init = () => {
|
||||||
|
getDashboardPageByUserId({ id: adminInfo.id, state: false }).then(res => {
|
||||||
|
pageList.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
push(`/admin/cockpit/popup?path=${String(getNextPagePath(pageList.value))}`)
|
||||||
|
}
|
||||||
|
// 修改
|
||||||
|
const edit = (row: any) => {
|
||||||
|
push(`/admin/cockpit/popup?id=${row?.id}&&path=${row.pagePath}`)
|
||||||
|
}
|
||||||
|
// 激活
|
||||||
|
const beforeChange = (row: any): Promise<boolean> => {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
// setTimeout(() => {
|
||||||
|
// loading1.value = false
|
||||||
|
// ElMessage.success('Switch success')
|
||||||
|
// return resolve(true)
|
||||||
|
// }, 1000)
|
||||||
|
ElMessageBox.confirm('此操作将激活该页面, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
activatePage({ id: row.id, state: row.state == 0 ? 1 : 0 }).then((res: any) => {
|
||||||
|
if (res.code == 'A0000') {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '操作成功!'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
init()
|
||||||
|
resolve(true)
|
||||||
|
getMenu()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除
|
||||||
|
const deletes = (row: any) => {
|
||||||
|
ElMessageBox.confirm('此操作将永久删除该菜单, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deleteDashboard({ id: row.id }).then((res: any) => {
|
||||||
|
if (res.code == 'A0000') {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除页面成功!'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
init()
|
||||||
|
getMenu()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function getNextPagePath(pages: any) {
|
||||||
|
// 提取所有pagePath中的数字部分
|
||||||
|
const numbers = pages.map((page: any) => {
|
||||||
|
const match = page.pagePath.match(/dashboard\/index(\d*)$/)
|
||||||
|
if (match && match[1]) {
|
||||||
|
return parseInt(match[1], 10)
|
||||||
|
}
|
||||||
|
return 0 // 没有数字时视为0
|
||||||
|
})
|
||||||
|
|
||||||
|
// 找到最大数字并加1
|
||||||
|
const maxNum = Math.max(...numbers)
|
||||||
|
const nextNum = maxNum + 1
|
||||||
|
|
||||||
|
// 生成下一个pagePath
|
||||||
|
return `dashboard/index${nextNum}`
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -1,71 +1,108 @@
|
|||||||
<template>
|
<template>
|
||||||
<GridLayout
|
<div class="default-main">
|
||||||
class="default-main"
|
<TableHeader :showSearch="false" v-show="flag">
|
||||||
v-model:layout="layout"
|
<template v-slot:select>
|
||||||
:row-height="rowHeight"
|
<el-form-item label="统计时间">
|
||||||
:is-resizable="false"
|
<DatePicker
|
||||||
:is-draggable="false"
|
ref="datePickerRef"
|
||||||
:responsive="false"
|
:nextFlag="false"
|
||||||
:vertical-compact="false"
|
:theCurrentTime="true"
|
||||||
prevent-collision
|
@change="handleDatePickerChange"
|
||||||
:col-num="12"
|
></DatePicker>
|
||||||
>
|
</el-form-item>
|
||||||
<template #item="{ item }">
|
</template>
|
||||||
<div class="box">
|
<template v-slot:operation>
|
||||||
<div class="title">
|
<el-button type="primary" icon="el-icon-Edit" @click="editd">编辑</el-button>
|
||||||
<div style="display: flex; align-items: center">
|
<!-- <el-button type="primary" icon="el-icon-Tools" @click="settings">设置</el-button> -->
|
||||||
<Icon class="HelpFilled" :name="item.icon" />
|
</template>
|
||||||
{{ item.name }}
|
</TableHeader>
|
||||||
|
|
||||||
|
<GridLayout
|
||||||
|
v-model:layout="layout"
|
||||||
|
:row-height="rowHeight"
|
||||||
|
:is-resizable="false"
|
||||||
|
:is-draggable="false"
|
||||||
|
:responsive="false"
|
||||||
|
:vertical-compact="false"
|
||||||
|
prevent-collision
|
||||||
|
:col-num="12"
|
||||||
|
>
|
||||||
|
<template #item="{ item }">
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<Icon class="HelpFilled" :name="(item as LayoutItem).icon" />
|
||||||
|
{{ (item as LayoutItem).name }}
|
||||||
|
</div>
|
||||||
|
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="zoom(item)" /> -->
|
||||||
|
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="zoom(item)" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<component
|
||||||
|
:is="(item as LayoutItem).component"
|
||||||
|
v-if="(item as LayoutItem).component"
|
||||||
|
class="pd10"
|
||||||
|
:key="key"
|
||||||
|
:timeValue="datePickerRef?.timeValue || 3"
|
||||||
|
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||||
|
:width="rowWidth * item.w - 30 + 'px'"
|
||||||
|
:timeKey="(item as LayoutItem).timeKey"
|
||||||
|
:interval="datePickerRef?.interval"
|
||||||
|
:w="item.w"
|
||||||
|
:h="item.h"
|
||||||
|
/>
|
||||||
|
<div v-else class="pd10">组件加载失败...</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="zoom(item)" /> -->
|
|
||||||
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="zoom(item)" />
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
</template>
|
||||||
<component
|
</GridLayout>
|
||||||
:is="item.component"
|
<!-- 设置 -->
|
||||||
v-if="item.component"
|
<RoutingConfig ref="RoutingConfigRef" />
|
||||||
class="pd10"
|
</div>
|
||||||
:key="key"
|
|
||||||
:height="rowHeight * item.h - (item.h == 6 ? -20 : item.h == 2 ? 20 : 5) + 'px'"
|
|
||||||
:width="rowWidth * item.w - 5 + 'px'"
|
|
||||||
:timeKey="item.timeKey"
|
|
||||||
/>
|
|
||||||
<div v-else class="pd10">组件加载失败...</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</GridLayout>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, markRaw, onUnmounted, defineAsyncComponent, type Component } from 'vue'
|
import { ref, reactive, onMounted, markRaw, onUnmounted, computed, defineAsyncComponent, type Component } from 'vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { GridLayout } from 'grid-layout-plus'
|
import { GridLayout } from 'grid-layout-plus'
|
||||||
|
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
import { useDebounceFn } from '@vueuse/core'
|
||||||
import { queryActivatePage } from '@/api/system-boot/csstatisticalset'
|
import { queryActivatePage, queryByPagePath } from '@/api/system-boot/csstatisticalset'
|
||||||
import { HelpFilled, FullScreen } from '@element-plus/icons-vue'
|
import RoutingConfig from '@/views/pqs/cockpit/homePage/components/routingConfig.vue'
|
||||||
// defineOptions({
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
// name: 'cockpit/homePage'
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||||
// })
|
const { push } = useRouter()
|
||||||
|
const datePickerRef = ref()
|
||||||
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const timeCacheStore = useTimeCacheStore()
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
// name: 'dashboard/index'
|
||||||
|
})
|
||||||
// 定义类型
|
// 定义类型
|
||||||
interface LayoutItem {
|
interface LayoutItem {
|
||||||
x: number
|
x: number
|
||||||
y: number
|
y: number
|
||||||
w: number
|
w: number
|
||||||
h: number
|
h: number
|
||||||
|
timeKey: number | string
|
||||||
i: string | number
|
i: string | number
|
||||||
name: string
|
name: string
|
||||||
path: string
|
path: string
|
||||||
|
icon?: string // 新增 icon 可选字段
|
||||||
component?: Component | string
|
component?: Component | string
|
||||||
loading?: boolean
|
loading?: boolean
|
||||||
error?: any
|
error?: any
|
||||||
}
|
}
|
||||||
|
const RoutingConfigRef = ref()
|
||||||
const key = ref(0)
|
const key = ref(0)
|
||||||
const img = new URL(`@/assets/imgs/amplify.png`, import.meta.url)
|
const img = new URL(`@/assets/img/amplify.png`, import.meta.url).href
|
||||||
const img1 = new URL(`@/assets/imgs/reduce.png`, import.meta.url)
|
const img1 = new URL(`@/assets/img/reduce.png`, import.meta.url).href
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const rowHeight = ref(0)
|
const rowHeight = ref(0)
|
||||||
const rowWidth = ref(0)
|
const rowWidth = ref(0)
|
||||||
const layout = ref<LayoutItem[]>([
|
const layout: any = ref([
|
||||||
// {
|
// {
|
||||||
// x: 4,
|
// x: 4,
|
||||||
// y: 0,
|
// y: 0,
|
||||||
@@ -76,11 +113,11 @@ const layout = ref<LayoutItem[]>([
|
|||||||
// path: '/src/views/pqs/runManage/assessment/components/uese/index.vue'
|
// path: '/src/views/pqs/runManage/assessment/components/uese/index.vue'
|
||||||
// },
|
// },
|
||||||
])
|
])
|
||||||
const layoutCopy = ref<LayoutItem[]>([])
|
const layoutCopy: any = ref([])
|
||||||
const flag = ref(true)
|
const flag = ref(true)
|
||||||
// 组件映射
|
// 组件映射
|
||||||
const componentMap = reactive(new Map<string, Component | string>())
|
const componentMap = reactive(new Map<string, Component | string>())
|
||||||
|
const dataList: any = ref({})
|
||||||
// 获取主内容区域高度
|
// 获取主内容区域高度
|
||||||
const getMainHeight = () => {
|
const getMainHeight = () => {
|
||||||
const elMain = document.querySelector('.el-main')
|
const elMain = document.querySelector('.el-main')
|
||||||
@@ -94,7 +131,7 @@ const getMainWidth = () => {
|
|||||||
|
|
||||||
// 初始化行高
|
// 初始化行高
|
||||||
const initRowHeight = () => {
|
const initRowHeight = () => {
|
||||||
rowHeight.value = Math.max(0, (getMainHeight() - 20) / 6)
|
rowHeight.value = Math.max(0, (getMainHeight() - 77 + (flag.value ? 0 : 56)) / 6)
|
||||||
rowWidth.value = Math.max(0, getMainWidth() / 12)
|
rowWidth.value = Math.max(0, getMainWidth() / 12)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +148,7 @@ const registerComponent = (path: string): Component | string | null => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// 动态导入组件
|
// 动态导入组件
|
||||||
const modules = import.meta.glob('@/views/**/*.vue')
|
const modules = import.meta.glob('@/**/*.vue')
|
||||||
if (!modules[path]) {
|
if (!modules[path]) {
|
||||||
console.error(`组件加载失败: ${path}`)
|
console.error(`组件加载失败: ${path}`)
|
||||||
return null
|
return null
|
||||||
@@ -138,20 +175,54 @@ const zoom = (value: any) => {
|
|||||||
if (flag.value) {
|
if (flag.value) {
|
||||||
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
|
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
|
||||||
} else {
|
} else {
|
||||||
layout.value = layoutCopy.value.map((item, index) => ({
|
layout.value = layoutCopy.value.map((item: any, index: number) => ({
|
||||||
...item,
|
...item,
|
||||||
i: item.i || index, // 确保有唯一标识
|
i: item.i || index, // 确保有唯一标识
|
||||||
component: registerComponent(item.path)
|
component: registerComponent(item.path)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
console.log('🚀 ~ zoom ~ layout.value:', layout.value)
|
||||||
|
|
||||||
flag.value = !flag.value
|
flag.value = !flag.value
|
||||||
|
|
||||||
|
initRowHeight()
|
||||||
key.value += 1
|
key.value += 1
|
||||||
}
|
}
|
||||||
|
// 计算组件高度
|
||||||
|
const seRowHeight = (value: any) => {
|
||||||
|
if (value == 6) return 0
|
||||||
|
if (value == 5) return 12
|
||||||
|
if (value == 4) return 20
|
||||||
|
if (value == 3) return 30
|
||||||
|
if (value == 2) return 40
|
||||||
|
if (value == 1) return 50
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// 获取布局数据
|
// 获取布局数据
|
||||||
const fetchLayoutData = async () => {
|
const fetchLayoutData = async () => {
|
||||||
try {
|
try {
|
||||||
const { data } = await queryActivatePage()
|
// const { data } = await queryByPagePath({ pagePath: router.currentRoute.value.name })
|
||||||
const parsedLayout = JSON.parse(data.containerConfig || '[]') as LayoutItem[]
|
// dataList.value = data
|
||||||
|
dataList.value = {
|
||||||
|
createBy: 'e6a67ccbe789493687766c4304fcb228',
|
||||||
|
createTime: '2025-11-26 08:43:56',
|
||||||
|
updateBy: 'e6a67ccbe789493687766c4304fcb228',
|
||||||
|
updateTime: '2025-11-26 08:43:56',
|
||||||
|
id: 'e8218545cc11e32d5d6b87c92fdd0fbc',
|
||||||
|
pageName: '测试',
|
||||||
|
thumbnail: '',
|
||||||
|
remark: '',
|
||||||
|
containerConfig:
|
||||||
|
'[{"x":0,"y":0,"w":6,"h":3,"i":0.9274640143002512,"name":"终端在线率","path":"/src/components/cockpit/onlineRate/index.vue","icon":"local-审计列表","timeKey":"3","moved":false},{"x":6,"y":0,"w":6,"h":3,"i":0.9154814002445102,"name":"监测点数据完整性","path":"/src/components/cockpit/integrity/index.vue","icon":"local-告警中心","timeKey":"3","moved":false},{"x":0,"y":3,"w":6,"h":3,"i":0.6560899767923003,"name":"终端运行评价","path":"/src/components/cockpit/terminalEvaluation/index.vue","icon":"local-稳态指标超标明细","timeKey":"3","moved":false},{"x":6,"y":3,"w":6,"h":3,"i":0.5812302648025226,"name":"异常数据清洗","path":"/src/components/cockpit/dataCleaning/index.vue","icon":"local-区域暂态评估","timeKey":"3","moved":false}]',
|
||||||
|
sort: 100,
|
||||||
|
state: 1,
|
||||||
|
pagePath: 'dashboard/index6',
|
||||||
|
pathName: null,
|
||||||
|
routeName: '/src/views/pqs/cockpit/homePage/index.vue',
|
||||||
|
icon: ''
|
||||||
|
}
|
||||||
|
const parsedLayout = JSON.parse(dataList.value.containerConfig || '[]') as LayoutItem[]
|
||||||
// 处理布局数据
|
// 处理布局数据
|
||||||
layout.value = parsedLayout.map((item, index) => ({
|
layout.value = parsedLayout.map((item, index) => ({
|
||||||
...item,
|
...item,
|
||||||
@@ -159,6 +230,7 @@ const fetchLayoutData = async () => {
|
|||||||
component: registerComponent(item.path)
|
component: registerComponent(item.path)
|
||||||
}))
|
}))
|
||||||
layoutCopy.value = JSON.parse(JSON.stringify(layout.value))
|
layoutCopy.value = JSON.parse(JSON.stringify(layout.value))
|
||||||
|
initRowHeight()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取布局数据失败:', error)
|
console.error('获取布局数据失败:', error)
|
||||||
// 可以添加错误提示逻辑
|
// 可以添加错误提示逻辑
|
||||||
@@ -168,12 +240,33 @@ const fetchLayoutData = async () => {
|
|||||||
// 窗口大小变化处理 - 使用防抖
|
// 窗口大小变化处理 - 使用防抖
|
||||||
const handleResize = useDebounceFn(() => {
|
const handleResize = useDebounceFn(() => {
|
||||||
initRowHeight()
|
initRowHeight()
|
||||||
key.value += 1
|
// key.value += 1
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
const editd = (e: any) => {
|
||||||
|
if (dataList.value?.id) {
|
||||||
|
push(`/admin/cockpit/popup?id=${dataList.value?.id}&&path=${String(router.currentRoute.value.name)}`)
|
||||||
|
} else {
|
||||||
|
push(`/admin/cockpit/popup?path=${String(router.currentRoute.value.name)}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 设置
|
||||||
|
const settings = () => {
|
||||||
|
RoutingConfigRef.value.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理 DatePicker 值变化事件
|
||||||
|
const handleDatePickerChange = (value: any) => {
|
||||||
|
// 将值缓存到 timeCache
|
||||||
|
if (value) {
|
||||||
|
timeCacheStore.setCache(route.path, value.interval, value.timeValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initRowHeight()
|
// initRowHeight()
|
||||||
fetchLayoutData()
|
fetchLayoutData()
|
||||||
|
|
||||||
// 添加窗口大小变化监听器
|
// 添加窗口大小变化监听器
|
||||||
|
|||||||
459
src/views/pqs/cockpit/realTimeData/iframeDia.vue
Normal file
@@ -0,0 +1,459 @@
|
|||||||
|
<template>
|
||||||
|
<div class="container">
|
||||||
|
<!-- 使用 v-for 遍历四个角落 -->
|
||||||
|
<div v-for="corner in corners" v-show="corner.show" :key="corner.id" :class="['corner', corner.className]">
|
||||||
|
<div class="content">
|
||||||
|
<div class="title" style="display: flex">
|
||||||
|
<img src="@/assets/img/lightning.png" class="title_img" />
|
||||||
|
<span>{{ corner.title }}</span>
|
||||||
|
</div>
|
||||||
|
<vxe-table
|
||||||
|
:data="corner.data"
|
||||||
|
size="small"
|
||||||
|
border
|
||||||
|
show-header
|
||||||
|
:header-cell-style="{ textAlign: 'center' }"
|
||||||
|
:cell-style="{ textAlign: 'center' }"
|
||||||
|
height="200"
|
||||||
|
style="padding: 5px;"
|
||||||
|
>
|
||||||
|
<vxe-column field="name" title="名称"></vxe-column>
|
||||||
|
<vxe-column field="a" title="A" width="40"></vxe-column>
|
||||||
|
<vxe-column field="b" title="B" width="40"></vxe-column>
|
||||||
|
<vxe-column field="c" title="C" width="40"></vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
<span class="close-btn" @click="closeCorner(corner.id)">
|
||||||
|
<Close />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, onBeforeUnmount, nextTick, reactive } from 'vue'
|
||||||
|
// import { clickImage } from "@/api/manage_wx";
|
||||||
|
import { Close } from '@element-plus/icons-vue'
|
||||||
|
import socketClient from '@/utils/webSocketClient'
|
||||||
|
|
||||||
|
//开始创建webSocket客户端
|
||||||
|
const dataSocket = reactive({
|
||||||
|
socketServe: socketClient.Instance
|
||||||
|
})
|
||||||
|
// 定义四个角落的数据
|
||||||
|
const corners = ref([
|
||||||
|
{
|
||||||
|
id: 'topLeft',
|
||||||
|
title: '左上',
|
||||||
|
className: 'top-left',
|
||||||
|
show: false,
|
||||||
|
data: [
|
||||||
|
{ name: '电压', a: 1098, b: 2080, c: 3006 },
|
||||||
|
{ name: '电流', a: 15, b: 25, c: 35 },
|
||||||
|
{ name: '电压畸变率', a: 12, b: 22, c: 32 },
|
||||||
|
{ name: '电流畸变率', a: 18, b: 28, c: 38 },
|
||||||
|
{ name: '电压偏值', a: 12, b: 22, c: 32 },
|
||||||
|
{ name: '电压不平衡', a: 18, b: 28, c: 38 }
|
||||||
|
] as any[],
|
||||||
|
elementId: '', // 记录该角落对应的元素ID
|
||||||
|
raceLists: [] as any[] // 为每个角落添加独立的跑马灯数据存储
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'topRight',
|
||||||
|
title: '右上',
|
||||||
|
className: 'top-right',
|
||||||
|
show: false,
|
||||||
|
data: [] as any[],
|
||||||
|
elementId: '',
|
||||||
|
raceLists: [] as any[] // 为每个角落添加独立的跑马灯数据存储
|
||||||
|
}
|
||||||
|
// {
|
||||||
|
// id: "bottomLeft",
|
||||||
|
// title: "左下",
|
||||||
|
// className: "bottom-left",
|
||||||
|
// show: false,
|
||||||
|
// data: [] as { label: string; value: string }[],
|
||||||
|
// elementId: "",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "bottomRight",
|
||||||
|
// title: "右下",
|
||||||
|
// className: "bottom-right",
|
||||||
|
// show: false,
|
||||||
|
// data: [] as { label: string; value: string }[],
|
||||||
|
// elementId: "",
|
||||||
|
// },
|
||||||
|
])
|
||||||
|
|
||||||
|
interface DataTableItem {
|
||||||
|
name: string
|
||||||
|
a: number
|
||||||
|
b: number
|
||||||
|
c: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableData = ref<DataTableItem[]>([
|
||||||
|
{ name: '电压', a: 1098, b: 2080, c: 3006 },
|
||||||
|
{ name: '电流', a: 15, b: 25, c: 35 },
|
||||||
|
{ name: '电压畸变率', a: 12, b: 22, c: 32 },
|
||||||
|
{ name: '电流畸变率', a: 18, b: 28, c: 38 },
|
||||||
|
{ name: '电压偏值', a: 12, b: 22, c: 32 },
|
||||||
|
{ name: '电压不平衡', a: 18, b: 28, c: 38 }
|
||||||
|
])
|
||||||
|
|
||||||
|
const steadyStateList = ref([])
|
||||||
|
|
||||||
|
const selectedId = ref('')
|
||||||
|
|
||||||
|
// 内部响应式数据
|
||||||
|
const eventList = ref<any[]>([])
|
||||||
|
|
||||||
|
// const handleClickImage = async (elementId: string) => {
|
||||||
|
// // 检查 elementId 是否有值,没有值则直接返回空数组
|
||||||
|
// if (!elementId) {
|
||||||
|
// eventList.value = [];
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// try {
|
||||||
|
// // 发送点击图片请求
|
||||||
|
// const res = await clickImage({ lineId: elementId });
|
||||||
|
|
||||||
|
// // 确保返回的数据是数组格式,并且过滤掉 null/undefined 元素
|
||||||
|
// let dataToStore: any[] = [];
|
||||||
|
|
||||||
|
// if (Array.isArray(res.data)) {
|
||||||
|
// dataToStore = res.data.filter(
|
||||||
|
// (item:any) => item !== null && item !== undefined
|
||||||
|
// );
|
||||||
|
// } else if (res.data && Array.isArray(res.data.records)) {
|
||||||
|
// dataToStore = res.data.records.filter(
|
||||||
|
// (item:any) => item !== null && item !== undefined
|
||||||
|
// );
|
||||||
|
// } else if (res.data) {
|
||||||
|
// // 如果是单个对象且不为 null
|
||||||
|
// if (res.data !== null && res.data !== undefined) {
|
||||||
|
// dataToStore = [res.data];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// eventList.value = dataToStore;
|
||||||
|
// } catch (error) {
|
||||||
|
// console.error("调用 clickImage 接口出错:", error);
|
||||||
|
// // 出错时设置为空数组,避免后续处理出错
|
||||||
|
// eventList.value = [];
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
|
// 记录显示顺序,用于循环替换
|
||||||
|
const displayOrder = ref<number[]>([])
|
||||||
|
|
||||||
|
// 更新指定角落数据的函数
|
||||||
|
const updateCornerData = (cornerIndex: number, dataItem: any, elementId: string) => {
|
||||||
|
// 更新标题为 objName
|
||||||
|
if (dataItem.objName) {
|
||||||
|
corners.value[cornerIndex].title = dataItem.objName
|
||||||
|
} else {
|
||||||
|
corners.value[cornerIndex].title = dataItem.stationName
|
||||||
|
}
|
||||||
|
|
||||||
|
// 格式化数据
|
||||||
|
corners.value[cornerIndex].data = [
|
||||||
|
{ label: '监测点', value: dataItem.lineName },
|
||||||
|
// {
|
||||||
|
// label: "暂降次数",
|
||||||
|
// value: dataItem.eventIds.length,
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
label: '暂降次数',
|
||||||
|
value: ``
|
||||||
|
},
|
||||||
|
// { label: "稳态指标", value: "Ua:65.5 Ub:65.02 Uc:65.27 Uac:112.85 Uab:112.67 Ubc:112.85" },
|
||||||
|
{
|
||||||
|
label: '稳态指标',
|
||||||
|
value: ``
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// 记录该角落对应的元素ID
|
||||||
|
corners.value[cornerIndex].elementId = elementId
|
||||||
|
corners.value[cornerIndex].show = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示下一个角落的函数
|
||||||
|
const showNextCorner = (elementId: string) => {
|
||||||
|
// 检查该元素ID是否已经显示过
|
||||||
|
const existingCornerIndex = corners.value.findIndex(corner => corner.elementId === elementId && corner.show)
|
||||||
|
|
||||||
|
if (existingCornerIndex !== -1) {
|
||||||
|
// 如果该元素已经显示过,不更新数据
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确保 eventList.value 是数组并且过滤掉 null/undefined 元素
|
||||||
|
if (!Array.isArray(eventList.value)) {
|
||||||
|
console.warn('eventList.value 不是数组格式:', eventList.value)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤掉 null 和 undefined 元素,然后查找匹配项
|
||||||
|
const validItems = eventList.value.filter(item => item !== null && item !== undefined)
|
||||||
|
const dataItem = validItems.find(item => item.lineId === elementId)
|
||||||
|
|
||||||
|
// 如果没有找到匹配的数据项,则不更新数据
|
||||||
|
if (!dataItem) {
|
||||||
|
console.warn('未找到匹配的数据项:', elementId)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查找一个未显示的角落
|
||||||
|
const availableCornerIndex = corners.value.findIndex(corner => !corner.show)
|
||||||
|
|
||||||
|
if (availableCornerIndex !== -1) {
|
||||||
|
// 有空闲角落,显示在该角落
|
||||||
|
updateCornerData(availableCornerIndex, dataItem, elementId)
|
||||||
|
// 将事件数据存储到该角落
|
||||||
|
corners.value[availableCornerIndex].raceLists = dataItem.eventList || []
|
||||||
|
// 记录显示顺序
|
||||||
|
displayOrder.value.push(availableCornerIndex)
|
||||||
|
} else {
|
||||||
|
// 没有空闲角落,按顺序替换角落
|
||||||
|
// 获取需要替换的角落索引(循环替换)
|
||||||
|
const replaceIndex = displayOrder.value.shift() || 0
|
||||||
|
updateCornerData(replaceIndex, dataItem, elementId)
|
||||||
|
// 将事件数据存储到该角落
|
||||||
|
corners.value[replaceIndex].raceLists = dataItem.eventList || []
|
||||||
|
// 将替换的索引重新加入队列末尾
|
||||||
|
displayOrder.value.push(replaceIndex)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭指定角落的函数
|
||||||
|
const closeCorner = (id: string) => {
|
||||||
|
const cornerIndex = corners.value.findIndex(c => c.id === id)
|
||||||
|
if (cornerIndex !== -1) {
|
||||||
|
corners.value[cornerIndex].show = false
|
||||||
|
corners.value[cornerIndex].elementId = '' // 清空元素ID记录
|
||||||
|
|
||||||
|
// 从显示顺序中移除该角落索引
|
||||||
|
const orderIndex = displayOrder.value.indexOf(cornerIndex)
|
||||||
|
if (orderIndex !== -1) {
|
||||||
|
displayOrder.value.splice(orderIndex, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
send()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭所有角落的函数
|
||||||
|
const closeAllCorners = () => {
|
||||||
|
corners.value.forEach(corner => {
|
||||||
|
corner.show = false
|
||||||
|
corner.elementId = ''
|
||||||
|
})
|
||||||
|
displayOrder.value = []
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组件挂载后初始化监听器
|
||||||
|
onMounted(() => {
|
||||||
|
init()
|
||||||
|
// 初始化时不显示任何内容
|
||||||
|
})
|
||||||
|
|
||||||
|
// 连接webSocket客户端
|
||||||
|
const init = () => {
|
||||||
|
if (!dataSocket.socketServe) {
|
||||||
|
console.error('WebSocket 客户端实例不存在')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dataSocket.socketServe.connect(new Date().getTime())
|
||||||
|
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||||
|
if (res.type == 1) {
|
||||||
|
//稳态指标数据
|
||||||
|
let steadyState = JSON.parse(res.message)
|
||||||
|
|
||||||
|
// console.log(steadyState, "8990hhhhh");
|
||||||
|
if (steadyState == null || steadyState.length == 0) return
|
||||||
|
steadyStateList.value = steadyState
|
||||||
|
corners.value.forEach((corner, index) => {
|
||||||
|
let str = ``
|
||||||
|
steadyState
|
||||||
|
.filter((item: any) => item.lineId == corner.elementId)
|
||||||
|
.forEach((item: any) => {
|
||||||
|
if (item.value == 3.1415926) {
|
||||||
|
str += `<div>${item.statisticalName}:/</div>`
|
||||||
|
} else {
|
||||||
|
str += `<div>${item.statisticalName}:${item.value}${item.unit}</div>`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
corner.data.length > 0
|
||||||
|
? (corner.data[2].value = `<div style="max-height: 100px;overflow-y: auto;">${str} </div>`)
|
||||||
|
: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const time = ref(null)
|
||||||
|
// 推送消息
|
||||||
|
const send = () => {
|
||||||
|
dataSocket.socketServe.send({
|
||||||
|
pageId: selectedId.value,
|
||||||
|
lineIdList: corners.value.filter(item => item.show == true).map(corner => corner.elementId)
|
||||||
|
})
|
||||||
|
if (time.value) {
|
||||||
|
clearTimeout(time.value)
|
||||||
|
}
|
||||||
|
if (corners.value.filter(item => item.show == true).map(corner => corner.elementId).length == 0) return
|
||||||
|
time.value = setInterval(() => {
|
||||||
|
dataSocket.socketServe.send({
|
||||||
|
pageId: selectedId.value,
|
||||||
|
lineIdList: corners.value.filter(item => item.show == true).map(corner => corner.elementId)
|
||||||
|
})
|
||||||
|
}, 1000 * 60)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听来自 iframe 的消息
|
||||||
|
window.addEventListener('message', async function (event) {
|
||||||
|
// 安全起见,可以验证消息来源(origin)
|
||||||
|
// if (event.origin !== 'https://trusted-origin.com') return;
|
||||||
|
|
||||||
|
// 处理从 iframe 发送过来的消息
|
||||||
|
if (event.data.action === 'coreClick') {
|
||||||
|
const clickedElementId = event.data.coreId
|
||||||
|
selectedId.value = event.data.selectedId
|
||||||
|
|
||||||
|
// 调用接口获取最新数据
|
||||||
|
// await handleClickImage(clickedElementId);
|
||||||
|
|
||||||
|
// 根据接收到的元素LineId显示对应数据
|
||||||
|
await showNextCorner(clickedElementId)
|
||||||
|
|
||||||
|
await send()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 页面卸载时清除定时器
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
clearTimeout(time.value)
|
||||||
|
dataSocket.socketServe?.closeWs()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.corner {
|
||||||
|
width: 240px;
|
||||||
|
/* height: 135px; */
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
color: #000;
|
||||||
|
/* font-weight: bold; */
|
||||||
|
/* 添加弹出动画 */
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.3);
|
||||||
|
transition: all 0.4s ease-out;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 显示状态的样式 */
|
||||||
|
.corner:not([style*='display: none']):not([style*='display:none']) {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-left {
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-right {
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-left {
|
||||||
|
top: 170px;
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-right {
|
||||||
|
top: 170px;
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 16px;
|
||||||
|
// text-align: center;
|
||||||
|
padding: 5px;
|
||||||
|
color: #fff;
|
||||||
|
border-bottom: 1px solid #444;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
border-radius: 8px 8px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title_img {
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-item {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
/* font-weight: bold; */
|
||||||
|
width: 55px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 关闭按钮样式 */
|
||||||
|
.close-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
width: 14px;
|
||||||
|
color: white;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indicator {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table th,
|
||||||
|
.table td {
|
||||||
|
border: 1px solid #000;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
244
src/views/pqs/cockpit/realTimeData/index.vue
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main" :style="{ padding: prop.height ? '0px !important' : '10px' }">
|
||||||
|
<!-- 实时数据 -->
|
||||||
|
<!-- 添加加载事件监听 -->
|
||||||
|
<div class="dataBox" :style="{ height: prop.height || pageHeight.height }" >
|
||||||
|
<div
|
||||||
|
class="iframe-container"
|
||||||
|
:style="{
|
||||||
|
boxShadow: `var(--el-box-shadow-light)`
|
||||||
|
}"
|
||||||
|
style="position: relative;"
|
||||||
|
>
|
||||||
|
<iframe
|
||||||
|
:src="iframeSrc"
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
frameborder="0"
|
||||||
|
scrolling="no"
|
||||||
|
id="iframeLeft"
|
||||||
|
@load="onIframeLoad"
|
||||||
|
></iframe>
|
||||||
|
<IframeDia
|
||||||
|
style="position: absolute; top: 0px; right: 0px; left: 0px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-card class="bottom-container " style="min-height: 230px;">
|
||||||
|
<div class="buttonBox">
|
||||||
|
<el-button type="primary" icon="el-icon-Aim">复位</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="tableBox">
|
||||||
|
<Table ref="tableRef" height="100%"></Table>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watch, onMounted, onUnmounted, provide } from 'vue'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import IframeDia from './iframeDia.vue'
|
||||||
|
// import { getActive } from "@/api/manage_wx/index";
|
||||||
|
|
||||||
|
// const props = defineProps<{
|
||||||
|
// project: { id: string; name: string } | null
|
||||||
|
// }>()
|
||||||
|
|
||||||
|
const prop = defineProps({
|
||||||
|
width: { type: [String, Number]},
|
||||||
|
height: { type: [String, Number]},
|
||||||
|
timeKey: { type: [String, Number]},
|
||||||
|
timeValue: { type: Object }
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
showPage: false,
|
||||||
|
|
||||||
|
column: [
|
||||||
|
{
|
||||||
|
field: 'index',
|
||||||
|
title: '序号',
|
||||||
|
width: '80',
|
||||||
|
formatter: (row: any) => {
|
||||||
|
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '时间',
|
||||||
|
field: 'whetherToGovern',
|
||||||
|
minWidth: '70'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '监测点名',
|
||||||
|
field: 'name',
|
||||||
|
minWidth: '90'
|
||||||
|
|
||||||
|
// render: 'customTemplate',
|
||||||
|
// customTemplate: (row: any) => {
|
||||||
|
// return `<span style='cursor: pointer;text-decoration: underline;'>${row.name}</span>`
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
|
||||||
|
{ title: '事件描述', field: 'question', minWidth: '200' }
|
||||||
|
],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
// tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||||
|
// tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
tableStore.table.data = [
|
||||||
|
{
|
||||||
|
name: '10kV1#电动机',
|
||||||
|
type: '电动机',
|
||||||
|
whetherToGovern: '2025-01-01 15:00:00',
|
||||||
|
question: '3次谐波电压、5次谐波电流、电压不平衡度超标'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '10kV2#(治理后)',
|
||||||
|
type: '电焊机',
|
||||||
|
whetherToGovern: '2025-05-01 16:00:00',
|
||||||
|
question: '所有指标均合格'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '380V电焊机(治理前)',
|
||||||
|
type: '电焊机',
|
||||||
|
whetherToGovern: '2025-06-01 15:00:00',
|
||||||
|
question: '5次谐波电流、电压不平衡度超标'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '380V水泵机',
|
||||||
|
type: '电动机',
|
||||||
|
whetherToGovern: '2025-08-01 15:00:00',
|
||||||
|
question: '所有指标均合格'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const tableRef = ref()
|
||||||
|
provide('tableRef', tableRef)
|
||||||
|
const pageHeight = mainHeight(40)
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
const iframeSrc = ref('')
|
||||||
|
|
||||||
|
// 监听 props 变化
|
||||||
|
// watch(
|
||||||
|
// () => props.project,
|
||||||
|
// newVal => {
|
||||||
|
// if (newVal && newVal.id && newVal.name) {
|
||||||
|
// // window.location.origin
|
||||||
|
// // iframeSrc.value =
|
||||||
|
// // "http://192.168.1.179:4001" +
|
||||||
|
// // `/zutai/?id=${newVal.id}&&name=${encodeURIComponent(
|
||||||
|
// // newVal.name
|
||||||
|
// // )}&&preview=true&&display=true&&graphicDisplay=wx#/preview`;
|
||||||
|
// iframeSrc.value =
|
||||||
|
// 'http://192.168.1.179:4001' +
|
||||||
|
// `/zutai/?id=4b4f7f4260198776594f5f9d93a532e8&&name=stt&&preview=true&&display=true#/preview_YPT`
|
||||||
|
|
||||||
|
// // console.log("更新 iframeSrc:", iframeSrc.value);
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// { immediate: true, deep: true }
|
||||||
|
// )
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
iframeSrc.value =
|
||||||
|
'http://192.168.1.179:4001' +
|
||||||
|
`/zutai/?id=4b4f7f4260198776594f5f9d93a532e8&&name=stt&&preview=true#/preview_YPT`
|
||||||
|
|
||||||
|
tableStore.index()
|
||||||
|
|
||||||
|
// 监听来自 eventStatistics 组件的消息
|
||||||
|
window.addEventListener('message', handleMessage)
|
||||||
|
|
||||||
|
// getActive({}).then((res: any) => {
|
||||||
|
// if (res.code == "A0000") {
|
||||||
|
// // window.location.origin
|
||||||
|
// iframeSrc.value =
|
||||||
|
// "http://192.168.1.179:4001" +
|
||||||
|
// `/zutai/?id=${res.data.id}&&name=${encodeURIComponent(
|
||||||
|
// res.data.name
|
||||||
|
// )}&&preview=true&&display=true&&graphicDisplay=wx#/preview`;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
// 清理事件监听器
|
||||||
|
window.removeEventListener('message', handleMessage)
|
||||||
|
})
|
||||||
|
|
||||||
|
// iframe 加载完成回调 添加加载事件监听
|
||||||
|
const onIframeLoad = () => {
|
||||||
|
// console.log("iframe 加载完成");
|
||||||
|
// 通知 securityDetail.vue 组件 iframe 已加载完成
|
||||||
|
window.postMessage(
|
||||||
|
{
|
||||||
|
type: 'IFRAME_LOADED',
|
||||||
|
data: { loaded: true }
|
||||||
|
},
|
||||||
|
'*'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理来自 eventStatistics 组件的消息
|
||||||
|
const handleMessage = (event: MessageEvent) => {
|
||||||
|
// 验证消息来源(在生产环境中应该验证 origin)
|
||||||
|
// if (event.origin !== 'trusted-origin') return;
|
||||||
|
|
||||||
|
const { type, payload } = event.data
|
||||||
|
|
||||||
|
if (type === 'SEND_KEYS_TO_IFRAME') {
|
||||||
|
// 将数据转发给 iframe
|
||||||
|
sendKeysToIframe(payload)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向 iframe 发送 keyList 数据
|
||||||
|
const sendKeysToIframe = (keyList: string[]) => {
|
||||||
|
const iframe = document.getElementById('iframeLeft') as HTMLIFrameElement
|
||||||
|
if (iframe && iframe.contentWindow) {
|
||||||
|
iframe.contentWindow.postMessage(
|
||||||
|
{
|
||||||
|
type: 'ANALYSIS_KEYS',
|
||||||
|
payload: keyList
|
||||||
|
},
|
||||||
|
'*'
|
||||||
|
) // 在生产环境中应该指定具体的域名而不是 '*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dataBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iframe-container {
|
||||||
|
flex: 3.5;
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
display: flex;
|
||||||
|
padding: 10px;
|
||||||
|
height: 100%;
|
||||||
|
.buttonBox {
|
||||||
|
display: flex;
|
||||||
|
width: 150px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.tableBox {
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,29 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="pd10">
|
<div class="pd10">
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-form ref="formRef" inline :rules="rules" :model="form" label-width="120px" class="form-four">
|
<el-form ref="formRef" inline :rules="rules" :model="form" label-width="auto" class="form-four">
|
||||||
<el-form-item label="页面名称:" prop="pageName">
|
<el-form-item label="页面名称" prop="pageName">
|
||||||
<el-input
|
<el-input
|
||||||
|
style="width: 100%"
|
||||||
maxlength="32"
|
maxlength="32"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
v-model.trim="form.pageName"
|
v-model.trim="form.pageName"
|
||||||
placeholder="请输入页面名称"
|
placeholder="请输入页面名称"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="图标">
|
||||||
<el-form-item label="页面排序:" prop="sort">
|
<IconSelector v-model.trim="form.icon" style="width: 80%" placeholder="请选择图标" />
|
||||||
<el-input
|
|
||||||
maxlength="32"
|
|
||||||
show-word-limit-number
|
|
||||||
v-model.trim.number="form.sort"
|
|
||||||
:min="0"
|
|
||||||
:step="1"
|
|
||||||
step-strictly
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="页面排序" prop="sort">
|
||||||
|
<el-input-number style="width: 100%" v-model.trim="form.sort" :min="0" :max="10000" :step="1" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="绑定页面">
|
||||||
|
<el-select v-model="form.pagePath" filterable placeholder="请选择绑定页面" style="width: 100%" clearable>
|
||||||
|
<el-option v-for="item in pageList" :key="item.path" :label="item.name" :value="item.path" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
<el-form-item label="备注:" class="top">
|
<el-form-item label="备注" class="top">
|
||||||
<el-input
|
<el-input
|
||||||
maxlength="300"
|
maxlength="300"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
@@ -87,6 +87,7 @@
|
|||||||
<template #item="{ item }">
|
<template #item="{ item }">
|
||||||
<div class="imgBox">
|
<div class="imgBox">
|
||||||
<div class="textName">{{ item.name }}</div>
|
<div class="textName">{{ item.name }}</div>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
:src="getImg(item.path)"
|
:src="getImg(item.path)"
|
||||||
:style="{
|
:style="{
|
||||||
@@ -106,6 +107,7 @@
|
|||||||
'px'
|
'px'
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<CloseBold class="remove" @click="removeItem(item.i)" />
|
<CloseBold class="remove" @click="removeItem(item.i)" />
|
||||||
</div>
|
</div>
|
||||||
<!-- <span class="text">{{ `${item?.name}` }}</span>
|
<!-- <span class="text">{{ `${item?.name}` }}</span>
|
||||||
@@ -118,11 +120,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import BackComponent from '@/components/icon/back/index.vue'
|
import BackComponent from '@/components/icon/back/index.vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import type { CollapseIconPositionType } from 'element-plus'
|
import type { CollapseIconPositionType } from 'element-plus'
|
||||||
|
import IconSelector from '@/components/baInput/components/iconSelector.vue'
|
||||||
import { componentTree } from '@/api/user-boot/user'
|
import { componentTree } from '@/api/user-boot/user'
|
||||||
import { GridLayout, GridItem } from 'grid-layout-plus'
|
import { GridLayout, GridItem } from 'grid-layout-plus'
|
||||||
import { throttle } from 'lodash-es'
|
import { throttle } from 'lodash-es'
|
||||||
@@ -130,11 +133,18 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import { Tools, CloseBold } from '@element-plus/icons-vue'
|
import { Tools, CloseBold } from '@element-plus/icons-vue'
|
||||||
import { addDashboard, updateDashboard, queryById } from '@/api/system-boot/csstatisticalset'
|
import { addDashboard, updateDashboard, queryById } from '@/api/system-boot/csstatisticalset'
|
||||||
import html2canvas from 'html2canvas'
|
import html2canvas from 'html2canvas'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
import { getMenu } from '@/utils/router'
|
||||||
|
// defineOptions({
|
||||||
|
// name: 'cockpit/popup'
|
||||||
|
// })
|
||||||
const { go } = useRouter()
|
const { go } = useRouter()
|
||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
const height = mainHeight(108)
|
const height = mainHeight(108)
|
||||||
const indicatorHeight = mainHeight(128)
|
const indicatorHeight = mainHeight(128)
|
||||||
const rowHeight = ref(0)
|
const rowHeight = ref(0)
|
||||||
|
const pageList: any = ref([])
|
||||||
const GridHeight = ref(0)
|
const GridHeight = ref(0)
|
||||||
const position = ref<CollapseIconPositionType>('left')
|
const position = ref<CollapseIconPositionType>('left')
|
||||||
const form: any = reactive({
|
const form: any = reactive({
|
||||||
@@ -143,7 +153,11 @@ const form: any = reactive({
|
|||||||
containerConfig: [],
|
containerConfig: [],
|
||||||
sort: '100',
|
sort: '100',
|
||||||
id: '',
|
id: '',
|
||||||
remark: ''
|
|
||||||
|
icon: '',
|
||||||
|
pagePath: '',
|
||||||
|
remark: '',
|
||||||
|
routeName: '/src/views/pqs/cockpit/homePage/index.vue'
|
||||||
})
|
})
|
||||||
const activeNames = ref([])
|
const activeNames = ref([])
|
||||||
const activeNames1 = ref([])
|
const activeNames1 = ref([])
|
||||||
@@ -167,6 +181,13 @@ const layout: any = ref([
|
|||||||
const treeComponents: any = ref([]) //组件树
|
const treeComponents: any = ref([]) //组件树
|
||||||
const treeComponentsCopy: any = ref([]) //组件树
|
const treeComponentsCopy: any = ref([]) //组件树
|
||||||
const info = () => {
|
const info = () => {
|
||||||
|
pageList.value = router
|
||||||
|
.getRoutes()
|
||||||
|
.filter(item => item?.meta?.component == '/src/views/pqs/cockpit/homePage/index.vue')
|
||||||
|
.map(item => {
|
||||||
|
return { name: item?.meta?.title, path: item?.meta?.path }
|
||||||
|
})
|
||||||
|
|
||||||
activeNames.value = []
|
activeNames.value = []
|
||||||
activeNames1.value = []
|
activeNames1.value = []
|
||||||
componentTree().then(res => {
|
componentTree().then(res => {
|
||||||
@@ -184,10 +205,14 @@ const info = () => {
|
|||||||
queryById({ id: query.id }).then(res => {
|
queryById({ id: query.id }).then(res => {
|
||||||
layout.value = JSON.parse(res.data.containerConfig)
|
layout.value = JSON.parse(res.data.containerConfig)
|
||||||
form.pageName = res.data.pageName
|
form.pageName = res.data.pageName
|
||||||
|
form.pagePath = query.path || res.data.pagePath
|
||||||
form.sort = res.data.sort
|
form.sort = res.data.sort
|
||||||
form.remark = res.data.remark
|
form.remark = res.data.remark
|
||||||
form.id = res.data.id
|
form.id = res.data.id
|
||||||
|
form.icon = res.data.icon
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
form.pagePath = query.path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +311,6 @@ const drag = throttle(row => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function dragEnd(row: any) {
|
function dragEnd(row: any) {
|
||||||
console.log('🚀 ~ drag ~ row:', row)
|
|
||||||
const parentRect = wrapper.value?.getBoundingClientRect()
|
const parentRect = wrapper.value?.getBoundingClientRect()
|
||||||
|
|
||||||
if (!parentRect || !gridLayout.value) return
|
if (!parentRect || !gridLayout.value) return
|
||||||
@@ -309,7 +333,7 @@ function dragEnd(row: any) {
|
|||||||
y: dragItem.y,
|
y: dragItem.y,
|
||||||
w: dragItem.w,
|
w: dragItem.w,
|
||||||
h: dragItem.h,
|
h: dragItem.h,
|
||||||
i: dragItem.i,
|
i: Math.random(), //dragItem.i,
|
||||||
name: row.name,
|
name: row.name,
|
||||||
path: row.path,
|
path: row.path,
|
||||||
icon: row.icon,
|
icon: row.icon,
|
||||||
@@ -327,18 +351,19 @@ const onSubmit = () => {
|
|||||||
if (layout.value.length == 0) {
|
if (layout.value.length == 0) {
|
||||||
return ElMessage.warning('页面设计不能为空!')
|
return ElMessage.warning('页面设计不能为空!')
|
||||||
}
|
}
|
||||||
const maxValue = Math.max(...layout.value.map(item => item.y + item.h))
|
// const maxValue = Math.max(...layout.value.map(item => item.y + item.h))
|
||||||
if (maxValue > 6) {
|
// if (maxValue > 6) {
|
||||||
return ElMessage.warning('组件不能超出当前容器!')
|
// return ElMessage.warning('组件不能超出当前容器!')
|
||||||
}
|
// }
|
||||||
|
|
||||||
formRef.value.validate(async (valid: boolean) => {
|
formRef.value.validate(async (valid: boolean) => {
|
||||||
let url = ''
|
let url = ''
|
||||||
await html2canvas(document.querySelector('.GridLayout'), {
|
// await html2canvas(document.querySelector('.GridLayout'), {
|
||||||
useCORS: true
|
// useCORS: true
|
||||||
}).then(canvas => {
|
// }).then(canvas => {
|
||||||
url = canvas.toDataURL('image/png')
|
// url = canvas.toDataURL('image/png')
|
||||||
})
|
// })
|
||||||
|
form.pagePath = form.pagePath || ''
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.id == '') {
|
if (form.id == '') {
|
||||||
@@ -346,6 +371,7 @@ const onSubmit = () => {
|
|||||||
(res: any) => {
|
(res: any) => {
|
||||||
ElMessage.success('新增页面成功!')
|
ElMessage.success('新增页面成功!')
|
||||||
go(-1)
|
go(-1)
|
||||||
|
getMenu()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@@ -353,6 +379,7 @@ const onSubmit = () => {
|
|||||||
(res: any) => {
|
(res: any) => {
|
||||||
ElMessage.success('修改页面成功!')
|
ElMessage.success('修改页面成功!')
|
||||||
go(-1)
|
go(-1)
|
||||||
|
getMenu()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -362,6 +389,7 @@ const onSubmit = () => {
|
|||||||
const getImg = throttle((path: string) => {
|
const getImg = throttle((path: string) => {
|
||||||
if (path != undefined) return treeComponentsCopy.value.filter(item => item.path == path)[0]?.image
|
if (path != undefined) return treeComponentsCopy.value.filter(item => item.path == path)[0]?.image
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
info()
|
info()
|
||||||
|
|
||||||
@@ -436,7 +464,9 @@ onBeforeUnmount(() => {
|
|||||||
.vgl-layout {
|
.vgl-layout {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
:deep(.el-input-group) {
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
.remove {
|
.remove {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
@@ -462,4 +492,7 @@ onBeforeUnmount(() => {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
:deep(.el-form--inline .el-form-item) {
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<div class=" layoutHeader">
|
<!-- <div class=" layoutHeader">
|
||||||
<div class="title">{{title}}</div>
|
<div class="title">{{title}}</div>
|
||||||
<back-component />
|
<back-component />
|
||||||
</div>
|
</div> -->
|
||||||
|
<TableHeader :showSearch="false">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label="统计时间">
|
||||||
|
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-slot:operation>
|
||||||
|
<back-component />
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
<GridLayout
|
<GridLayout
|
||||||
v-model:layout="layout"
|
v-model:layout="layout"
|
||||||
:row-height="rowHeight"
|
:row-height="rowHeight"
|
||||||
@@ -30,8 +40,9 @@
|
|||||||
v-if="item.component"
|
v-if="item.component"
|
||||||
class="pd10"
|
class="pd10"
|
||||||
:key="key"
|
:key="key"
|
||||||
:height="rowHeight * item.h - (item.h == 6 ? -20 : item.h == 2 ? 20 : 5) + 'px'"
|
:timeValue="datePickerRef.timeValue"
|
||||||
:width="rowWidth * item.w - 5 + 'px'"
|
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||||
|
:width="rowWidth * item.w - 30 + 'px'"
|
||||||
:timeKey="item.timeKey"
|
:timeKey="item.timeKey"
|
||||||
/>
|
/>
|
||||||
<div v-else class="pd10">组件加载失败...</div>
|
<div v-else class="pd10">组件加载失败...</div>
|
||||||
@@ -47,11 +58,14 @@ import { ref, reactive, onMounted, markRaw, onUnmounted, defineAsyncComponent, t
|
|||||||
import { GridLayout } from 'grid-layout-plus'
|
import { GridLayout } from 'grid-layout-plus'
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
import { useDebounceFn } from '@vueuse/core'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||||
import BackComponent from '@/components/icon/back/index.vue'
|
import BackComponent from '@/components/icon/back/index.vue'
|
||||||
import { queryById } from '@/api/system-boot/csstatisticalset'
|
import { queryById } from '@/api/system-boot/csstatisticalset'
|
||||||
import { HelpFilled, FullScreen } from '@element-plus/icons-vue'
|
import { HelpFilled, FullScreen } from '@element-plus/icons-vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
// defineOptions({
|
// defineOptions({
|
||||||
// name: 'cockpit/homePage'
|
// name: 'cockpit/view'
|
||||||
// })
|
// })
|
||||||
const { query } = useRoute()
|
const { query } = useRoute()
|
||||||
// 定义类型
|
// 定义类型
|
||||||
@@ -67,14 +81,15 @@ interface LayoutItem {
|
|||||||
loading?: boolean
|
loading?: boolean
|
||||||
error?: any
|
error?: any
|
||||||
}
|
}
|
||||||
|
const datePickerRef = ref()
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const key = ref(0)
|
const key = ref(0)
|
||||||
const img = new URL(`@/assets/imgs/amplify.png`, import.meta.url)
|
const img = new URL(`@/assets/img/amplify.png`, import.meta.url)
|
||||||
const img1 = new URL(`@/assets/imgs/reduce.png`, import.meta.url)
|
const img1 = new URL(`@/assets/img/reduce.png`, import.meta.url)
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const rowHeight = ref(0)
|
const rowHeight = ref(0)
|
||||||
const rowWidth = ref(0)
|
const rowWidth = ref(0)
|
||||||
const layout = ref<LayoutItem[]>([
|
const layout: any = ref<LayoutItem[]>([
|
||||||
// {
|
// {
|
||||||
// x: 4,
|
// x: 4,
|
||||||
// y: 0,
|
// y: 0,
|
||||||
@@ -120,7 +135,7 @@ const registerComponent = (path: string): Component | string | null => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// 动态导入组件
|
// 动态导入组件
|
||||||
const modules = import.meta.glob('@/views/**/*.vue')
|
const modules = import.meta.glob('@/**/*.vue')
|
||||||
if (!modules[path]) {
|
if (!modules[path]) {
|
||||||
console.error(`组件加载失败: ${path}`)
|
console.error(`组件加载失败: ${path}`)
|
||||||
return null
|
return null
|
||||||
@@ -160,7 +175,7 @@ const zoom = (value: any) => {
|
|||||||
const fetchLayoutData = async () => {
|
const fetchLayoutData = async () => {
|
||||||
try {
|
try {
|
||||||
const { data } = await queryById({ id: query.id })
|
const { data } = await queryById({ id: query.id })
|
||||||
title.value = data.pageName+'_预览'
|
title.value = data.pageName + '_预览'
|
||||||
const parsedLayout = JSON.parse(data.containerConfig || '[]') as LayoutItem[]
|
const parsedLayout = JSON.parse(data.containerConfig || '[]') as LayoutItem[]
|
||||||
// 处理布局数据
|
// 处理布局数据
|
||||||
layout.value = parsedLayout.map((item, index) => ({
|
layout.value = parsedLayout.map((item, index) => ({
|
||||||
@@ -174,6 +189,16 @@ const fetchLayoutData = async () => {
|
|||||||
// 可以添加错误提示逻辑
|
// 可以添加错误提示逻辑
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 计算组件高度
|
||||||
|
const seRowHeight = (value: any) => {
|
||||||
|
if (value == 6) return 0
|
||||||
|
if (value == 5) return 12
|
||||||
|
if (value == 4) return 20
|
||||||
|
if (value == 3) return 30
|
||||||
|
if (value == 2) return 40
|
||||||
|
if (value == 1) return 50
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// 窗口大小变化处理 - 使用防抖
|
// 窗口大小变化处理 - 使用防抖
|
||||||
const handleResize = useDebounceFn(() => {
|
const handleResize = useDebounceFn(() => {
|
||||||
@@ -231,8 +256,10 @@ onUnmounted(() => {
|
|||||||
:deep(.vgl-item) {
|
:deep(.vgl-item) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
border-bottom: 1px solid #000;
|
border-bottom: 1px solid #000;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -245,6 +272,7 @@ onUnmounted(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.HelpFilled {
|
.HelpFilled {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
@@ -252,13 +280,15 @@ onUnmounted(() => {
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.layoutHeader{
|
|
||||||
|
.layoutHeader {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
.title{
|
|
||||||
|
.title {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,10 @@
|
|||||||
>
|
>
|
||||||
{{ item.pageName }}
|
{{ item.pageName }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<div style="display: flex; justify-content: end">
|
<div style="display: flex; justify-content: end">
|
||||||
<el-button
|
<!-- <el-button
|
||||||
class="color"
|
class="color"
|
||||||
icon="el-icon-Position"
|
icon="el-icon-Position"
|
||||||
style="padding: 3px 0"
|
style="padding: 3px 0"
|
||||||
@@ -41,7 +43,7 @@
|
|||||||
@click="activation(item)"
|
@click="activation(item)"
|
||||||
>
|
>
|
||||||
激活
|
激活
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button
|
<el-button
|
||||||
class="color"
|
class="color"
|
||||||
icon="el-icon-View"
|
icon="el-icon-View"
|
||||||
|
|||||||
@@ -3,10 +3,15 @@
|
|||||||
<!-- 算法库 -->
|
<!-- 算法库 -->
|
||||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||||
<pane :size="size">
|
<pane :size="size">
|
||||||
<algorithmTree ref="treeRef" :default-expand-all="false"
|
<algorithmTree
|
||||||
|
ref="treeRef"
|
||||||
|
:default-expand-all="false"
|
||||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||||
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
|
:current-node-key="monitoringPoint.state.lineId"
|
||||||
@init="handleNodeClick" @onAddTree="onAddTree"></algorithmTree>
|
@node-click="handleNodeClick"
|
||||||
|
@init="handleNodeClick"
|
||||||
|
@onAddTree="onAddTree"
|
||||||
|
></algorithmTree>
|
||||||
</pane>
|
</pane>
|
||||||
<pane style="background: #fff" :style="height">
|
<pane style="background: #fff" :style="height">
|
||||||
<div class="boxTop">
|
<div class="boxTop">
|
||||||
@@ -16,9 +21,7 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="information">
|
<div v-if="information">
|
||||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser">
|
<el-button icon="el-icon-Plus" type="primary" @click="addUser">新增</el-button>
|
||||||
新增
|
|
||||||
</el-button>
|
|
||||||
<el-button icon="el-icon-Edit" type="primary" @click="revise">修改</el-button>
|
<el-button icon="el-icon-Edit" type="primary" @click="revise">修改</el-button>
|
||||||
<el-button icon="el-icon-Delete" type="primary" @click="deletes">删除</el-button>
|
<el-button icon="el-icon-Delete" type="primary" @click="deletes">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -35,12 +38,12 @@
|
|||||||
row.period == 0
|
row.period == 0
|
||||||
? '日'
|
? '日'
|
||||||
: row.period == 1
|
: row.period == 1
|
||||||
? '月'
|
? '月'
|
||||||
: row.period == 2
|
: row.period == 2
|
||||||
? '季'
|
? '季'
|
||||||
: row.period == 3
|
: row.period == 3
|
||||||
? '年'
|
? '年'
|
||||||
: ''
|
: ''
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
@@ -55,10 +58,8 @@
|
|||||||
</vxe-column> -->
|
</vxe-column> -->
|
||||||
<vxe-column field="definition" title="定义">
|
<vxe-column field="definition" title="定义">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
||||||
<el-button type="primary" link @click="view(row)">查看</el-button>
|
<el-button type="primary" link @click="view(row)">查看</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<!-- <vxe-column title="操作" width="150px">
|
<!-- <vxe-column title="操作" width="150px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
@@ -78,19 +79,28 @@
|
|||||||
<!-- 树弹框 -->
|
<!-- 树弹框 -->
|
||||||
<addTree ref="addTreeRef" @getTree="treeRef.loadData(dotList.id)" />
|
<addTree ref="addTreeRef" @getTree="treeRef.loadData(dotList.id)" />
|
||||||
<!-- 弹框 -->
|
<!-- 弹框 -->
|
||||||
<PopupEdit ref="popupEditRef" v-if="popupEditFlag"
|
<PopupEdit
|
||||||
@getTree="treeRef.loadData(dotList.id), (popupEditFlag = false)" />
|
ref="popupEditRef"
|
||||||
|
v-if="popupEditFlag"
|
||||||
|
@getTree="treeRef.loadData(dotList.id), (popupEditFlag = false)"
|
||||||
|
/>
|
||||||
<!-- 定义 -->
|
<!-- 定义 -->
|
||||||
<el-dialog draggable v-model="viewFlag" title="定义" width="60%">
|
<el-dialog draggable v-model="viewFlag" title="定义" width="60%">
|
||||||
<div style="min-height: 300px; max-height: 55vh;">
|
<div style="min-height: 300px; max-height: 55vh">
|
||||||
<div class="editor" ref="editorRef" v-html="summary" />
|
<div class="editor" ref="editorRef" v-html="summary" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 删除 -->
|
<!-- 删除 -->
|
||||||
<el-dialog draggable v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
<el-dialog draggable v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
||||||
<el-tree-select v-model="TreeValue" :data="TreeData" filterable check-strictly :props="defaultProps"
|
<el-tree-select
|
||||||
default-expand-all :render-after-expand="false" />
|
v-model="TreeValue"
|
||||||
|
:data="TreeData"
|
||||||
|
filterable
|
||||||
|
check-strictly
|
||||||
|
:props="defaultProps"
|
||||||
|
default-expand-all
|
||||||
|
:render-after-expand="false"
|
||||||
|
/>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
@@ -115,8 +125,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import { deleteyById } from '@/api/supervision-boot/database/index'
|
import { deleteyById } from '@/api/supervision-boot/database/index'
|
||||||
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import katex from "katex";
|
import katex from 'katex'
|
||||||
import "katex/dist/katex.css";
|
import 'katex/dist/katex.css'
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'database/algorithm'
|
name: 'database/algorithm'
|
||||||
@@ -124,7 +134,7 @@ defineOptions({
|
|||||||
const monitoringPoint = useMonitoringPoint()
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const heightTab = mainHeight(82)
|
const heightTab = mainHeight(82)
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const addTreeRef = ref()
|
const addTreeRef = ref()
|
||||||
const editorRef = ref()
|
const editorRef = ref()
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
@@ -207,37 +217,32 @@ const revise = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
// tableStore.index()
|
// tableStore.index()
|
||||||
})
|
})
|
||||||
|
|
||||||
const view = (row: any) => {
|
const view = (row: any) => {
|
||||||
|
|
||||||
viewFlag.value = true
|
viewFlag.value = true
|
||||||
summary.value = row.definition
|
summary.value = row.definition
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
const spans = document.querySelectorAll('span[data-value]')
|
||||||
const spans = document.querySelectorAll('span[data-value]');
|
|
||||||
// 遍历每个 span 标签
|
// 遍历每个 span 标签
|
||||||
spans.forEach(function (span) {
|
spans.forEach(function (span) {
|
||||||
|
|
||||||
let val = katex.renderToString(span.getAttribute('data-value'), {
|
let val = katex.renderToString(span.getAttribute('data-value'), {
|
||||||
throwOnError: false,
|
throwOnError: false
|
||||||
})
|
})
|
||||||
// var newDiv = document.createElement('div');
|
// var newDiv = document.createElement('div');
|
||||||
var newDiv = span
|
var newDiv = span
|
||||||
newDiv.innerHTML = val;
|
newDiv.innerHTML = val
|
||||||
|
|
||||||
span.parentNode.replaceChild(newDiv, span);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
span.parentNode.replaceChild(newDiv, span)
|
||||||
|
})
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
if (data.pid != '0') {
|
if (data.pid != '0') {
|
||||||
dotList.value = data
|
dotList.value = data
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
//引入相关样式
|
//引入相关样式
|
||||||
import '@vue-office/excel/lib/index.css'
|
import '@vue-office/excel/lib/index.css'
|
||||||
//引入VueOfficeDocx组件
|
//引入VueOfficeDocx组件
|
||||||
import VueOfficeDocx from '@vue-office/docx'
|
import VueOfficeDocx from '@vue-office/docx'
|
||||||
import VueOfficeExcel from '@vue-office/excel'
|
import VueOfficeExcel from '@vue-office/excel'
|
||||||
//引入VueOfficePdf组件
|
//引入VueOfficePdf组件
|
||||||
import VueOfficePdf from '@vue-office/pdf'
|
import VueOfficePdf from '@vue-office/pdf'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
@@ -52,12 +52,18 @@ const num = ref(0)
|
|||||||
const url = ref('')
|
const url = ref('')
|
||||||
const excelOptions = ref({})
|
const excelOptions = ref({})
|
||||||
const information = adminInfo.roleCode.includes('information_info')
|
const information = adminInfo.roleCode.includes('information_info')
|
||||||
|
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
const open = (row: any) => {
|
const open = (row: any) => {
|
||||||
// console.log('🚀 ~ open ~ row:', row)
|
// console.log('🚀 ~ open ~ row:', row)
|
||||||
// url.value = row
|
// url.value = row
|
||||||
drawer.value = true
|
drawer.value = true
|
||||||
url.value = `/api-docx/excelreport` + row
|
if(VITE_FLAG){
|
||||||
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
|
url.value = `/api-docx/excelreport` + row
|
||||||
|
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
// getFileNameAndFilePath({ filePath: row }).then(res => {
|
// getFileNameAndFilePath({ filePath: row }).then(res => {
|
||||||
// url.value = res.data.url
|
// url.value = res.data.url
|
||||||
// })
|
// })
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div >
|
||||||
<TableHeader ref="TableHeaderRef">
|
<TableHeader ref="TableHeaderRef">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="名称">
|
<el-form-item label="名称">
|
||||||
@@ -26,6 +26,7 @@ const tableStore = new TableStore({
|
|||||||
url: '/supervision-boot/libModel/pageLibModelQuery',
|
url: '/supervision-boot/libModel/pageLibModelQuery',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
showPage: true, // 确保启用分页
|
showPage: true, // 确保启用分页
|
||||||
|
publicHeight: 60,
|
||||||
column: [
|
column: [
|
||||||
{
|
{
|
||||||
title: '典型设备',
|
title: '典型设备',
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="名称">
|
<el-form-item label="名称">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" clearable
|
<el-input
|
||||||
placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
|
v-model="tableStore.table.params.searchValue"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入搜索名称"
|
||||||
|
maxlength="32"
|
||||||
|
show-word-limit
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef" isGroup/>
|
<Table ref="tableRef" isGroup />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
@@ -23,7 +27,8 @@ const tableRef = ref()
|
|||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/supervision-boot/libModel/pageLibModelQuery',
|
url: '/supervision-boot/libModel/pageLibModelQuery',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
publicHeight: 60,
|
||||||
|
column: [
|
||||||
{
|
{
|
||||||
title: '谐波源',
|
title: '谐波源',
|
||||||
children: [
|
children: [
|
||||||
@@ -32,12 +37,14 @@ const tableStore = new TableStore({
|
|||||||
title: '序号',
|
title: '序号',
|
||||||
width: '80',
|
width: '80',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
return (
|
||||||
|
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||||
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ field: 'name', title: '名称',minWidth: 200 },
|
{ field: 'name', title: '名称', minWidth: 200 },
|
||||||
{ field: 'voltage', title: '电压等级',minWidth: 200 },
|
{ field: 'voltage', title: '电压等级', minWidth: 200 },
|
||||||
{ field: 'capacity', title: '容量',minWidth: 200 }
|
{ field: 'capacity', title: '容量', minWidth: 200 }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -50,13 +57,13 @@ const tableStore = new TableStore({
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// 在请求发送前处理参数
|
// 在请求发送前处理参数
|
||||||
beforeSearchFun: () => {
|
beforeSearchFun: () => {
|
||||||
tableStore.table.params.pageSize = 100
|
tableStore.table.params.pageSize = 100
|
||||||
},
|
},
|
||||||
resetCallback: () => {
|
resetCallback: () => {
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
tableStore.table.params.type = 1
|
tableStore.table.params.type = 1
|
||||||
@@ -70,5 +77,4 @@ const queryData = () => {
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
queryData
|
queryData
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ defineOptions({
|
|||||||
const excelOptions = ref({})
|
const excelOptions = ref({})
|
||||||
const monitoringPoint = useMonitoringPoint()
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
const addTreeRef = ref()
|
const addTreeRef = ref()
|
||||||
const url = ref('')
|
const url = ref('')
|
||||||
@@ -73,10 +73,12 @@ const information = adminInfo.roleCode.includes('information_info')
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
console.log("🚀 ~ handleNodeClick ~ data:", data)
|
console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||||
dotList.value = data
|
dotList.value = data
|
||||||
@@ -86,8 +88,13 @@ const handleNodeClick = (data: any, node: any) => {
|
|||||||
flag.value = true
|
flag.value = true
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
url.value = `/api-docx/excelreport` + data.url
|
if(VITE_FLAG){
|
||||||
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
url.value = `/api-docx/excelreport` + data.url
|
||||||
|
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
|
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
|
||||||
// url.value = res.data.url
|
// url.value = res.data.url
|
||||||
// })
|
// })
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div v-show="view">
|
<div v-show="view">
|
||||||
<TableHeader datePicker area showExport>
|
<TableHeader datePicker area showExport>
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入关键字筛选" />
|
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入关键字筛选" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="统计类型:">
|
<el-form-item label="统计类型:">
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ const tableStore = new TableStore({
|
|||||||
// treeData = tree2List(tableStore.table.data)
|
// treeData = tree2List(tableStore.table.data)
|
||||||
// tableStore.table.data = JSON.parse(JSON.stringify(treeData))
|
// tableStore.table.data = JSON.parse(JSON.stringify(treeData))
|
||||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||||
console.log('tableStore.table.params---2', tableStore.table.params)
|
|
||||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ const dotList: any = ref({})
|
|||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const heightB = mainHeight(70)
|
const heightB = mainHeight(70)
|
||||||
const harmonic = harmonicOptions.slice(1)
|
const harmonic = harmonicOptions.slice(1)
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const showTabs = ref(false)
|
const showTabs = ref(false)
|
||||||
const loadDataOptions: any = ref([])
|
const loadDataOptions: any = ref([])
|
||||||
const form: any = reactive({
|
const form: any = reactive({
|
||||||
@@ -571,7 +571,7 @@ const group = (chart: any, myChartDom: any) => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
userDataList({
|
userDataList({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
|||||||
@@ -0,0 +1,408 @@
|
|||||||
|
<template>
|
||||||
|
<div class="tab-content">
|
||||||
|
<TableHeader datePicker ref="tableHeaderRef" @selectChange="handleSelectChange" >
|
||||||
|
<template #select>
|
||||||
|
<el-form-item label="区域">
|
||||||
|
<el-cascader
|
||||||
|
v-bind="$attrs"
|
||||||
|
:options="areOptions"
|
||||||
|
:props="cascaderProps"
|
||||||
|
v-model="selectedArea"
|
||||||
|
@change="handleFilterChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="统计类型">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.statisticalType"
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择统计类型"
|
||||||
|
@change="handleStatisticalTypeChange"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电网标志">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.powerFlag"
|
||||||
|
placeholder="请选择电网标志"
|
||||||
|
@change="handleFilterChange"
|
||||||
|
>
|
||||||
|
<el-option label="全部" value="0"></el-option>
|
||||||
|
<el-option label="电网侧" value="1"></el-option>
|
||||||
|
<el-option label="非电网侧" value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="筛选数据">
|
||||||
|
<el-input
|
||||||
|
v-model="searchKeyword"
|
||||||
|
placeholder="请输入变电站/终端/监测点"
|
||||||
|
clearable
|
||||||
|
@input="handleFilterChange"
|
||||||
|
:show-word-limit=true
|
||||||
|
:maxlength="32"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template #operation>
|
||||||
|
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
|
||||||
|
<div v-loading="tableStore.table.loading" class="main-container">
|
||||||
|
<vxe-table
|
||||||
|
class="full-height-table"
|
||||||
|
ref="tableRef"
|
||||||
|
auto-resize
|
||||||
|
:data="tableStore.table.data"
|
||||||
|
v-bind="defaultAttribute"
|
||||||
|
:height="tableHeight"
|
||||||
|
resizable
|
||||||
|
show-overflow
|
||||||
|
>
|
||||||
|
<vxe-column title="序号" width="80" type="seq" align="center"></vxe-column>
|
||||||
|
<vxe-column field="gdName" title="供电公司" align="center" min-width="120" ></vxe-column>
|
||||||
|
<vxe-column field="subStationName" :show-overflow="true" title="变电站" align="center" min-width="150"></vxe-column>
|
||||||
|
<vxe-column field="devName" title="终端名称" align="center" min-width="120"></vxe-column>
|
||||||
|
<!-- <vxe-column field="devType" title="终端型号" align="center" min-width="150"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="loginTime" title="投运时间" align="center" min-width="120"></vxe-column> -->
|
||||||
|
<vxe-column field="lineName" title="监测点名称" align="center" min-width="150" :formatter="formatMonitorId"></vxe-column>
|
||||||
|
<!-- <vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="lineVoltage" title="监测点电压等级" align="center" min-width="120"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="objName" title="监测对象名称" align="center" min-width="150" :formatter="formatMonitorId"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="interval" title="统计间隔" align="center" min-width="100" :formatter="formatMonitorId"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="onlineRate" title="在线率(%)" align="center" min-width="100"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="integrity" title="完整率(%)" align="center" min-width="100"></vxe-column> -->
|
||||||
|
<vxe-column field="harmonicValue" :title="harmonicValueTitle" align="center" min-width="120"></vxe-column>
|
||||||
|
<!-- <vxe-column field="upCounts" title="暂升次数(次)" align="center" min-width="100"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="downCounts" title="电压暂降(次)" align="center" min-width="100"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="breakCounts" title="短时中断(次)" align="center" min-width="100"></vxe-column> -->
|
||||||
|
<!-- <vxe-column field="monitorId" title="一类监测点" align="center" min-width="120" :formatter="formatMonitorId"></vxe-column> -->
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pagination-container">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="tableStore.table.params.pageNum"
|
||||||
|
:page-size="tableStore.table.params.pageSize"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
background
|
||||||
|
layout="sizes, total, prev, pager, next, jumper"
|
||||||
|
:total="tableStore.table.total"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
class="custom-pagination"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, onBeforeUnmount, computed, watch } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { debounce } from 'lodash-es'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
active: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['initialized'])
|
||||||
|
|
||||||
|
const dictData = useDictData()
|
||||||
|
const options = dictData.getBasicData('Pollution_Calc')
|
||||||
|
const tableHeight = ref(500)
|
||||||
|
const tableRef = ref()
|
||||||
|
const tableHeaderRef = ref()
|
||||||
|
|
||||||
|
const selectedArea = ref()
|
||||||
|
const areOptions: any = dictData.state.area
|
||||||
|
const allData = ref<PollutionItem[]>([])
|
||||||
|
const searchKeyword = ref('')
|
||||||
|
const harmonicValueTitle = ref('谐波电压污染值')
|
||||||
|
|
||||||
|
const cascaderProps = {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id',
|
||||||
|
checkStrictly: true,
|
||||||
|
emitPath: false
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PollutionItem {
|
||||||
|
gdName?: string
|
||||||
|
subStationName?: string
|
||||||
|
devName?: string
|
||||||
|
lineName?: string
|
||||||
|
powerFlag?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatMonitorId = (row: any) => {
|
||||||
|
return row.cellValue || '/'
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelectChange = (isExpanded: boolean) => {
|
||||||
|
if (isExpanded) {
|
||||||
|
tableHeight.value = tableHeight.value - 55
|
||||||
|
} else {
|
||||||
|
tableHeight.value = tableHeight.value + 55
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const calculateTableHeight = () => {
|
||||||
|
const windowHeight = window.innerHeight
|
||||||
|
const headerHeight = 160
|
||||||
|
const paginationHeight = 120
|
||||||
|
const padding = 30
|
||||||
|
const calculatedHeight = windowHeight - headerHeight - paginationHeight - padding
|
||||||
|
tableHeight.value = Math.max(calculatedHeight, 300)
|
||||||
|
}
|
||||||
|
|
||||||
|
const debouncedCalculateTableHeight = debounce(() => {
|
||||||
|
calculateTableHeight()
|
||||||
|
}, 300)
|
||||||
|
|
||||||
|
const filteredData = computed(() => {
|
||||||
|
let result = [...allData.value]
|
||||||
|
|
||||||
|
if (selectedArea.value) {
|
||||||
|
let areaName = ''
|
||||||
|
let areaLevel = -1
|
||||||
|
const findAreaName = (areas: any[]) => {
|
||||||
|
for (const area of areas) {
|
||||||
|
if (area.id === selectedArea.value) {
|
||||||
|
areaName = area.name
|
||||||
|
areaLevel = area.level !== undefined ? area.level : -1
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if (area.children && area.children.length > 0) {
|
||||||
|
findAreaName(area.children)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
findAreaName(areOptions)
|
||||||
|
|
||||||
|
if (areaName && areaLevel > 1) {
|
||||||
|
result = result.filter(item => item.gdName && item.gdName.includes(areaName))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tableStore.table.params.powerFlag === '1') {
|
||||||
|
result = result.filter(item => item.powerFlag && !item.powerFlag.includes('非'))
|
||||||
|
} else if (tableStore.table.params.powerFlag === '2') {
|
||||||
|
result = result.filter(item => item.powerFlag && item.powerFlag.includes('非'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (searchKeyword.value) {
|
||||||
|
const keyword = searchKeyword.value.toLowerCase()
|
||||||
|
result = result.filter(item =>
|
||||||
|
(item.subStationName && item.subStationName.toLowerCase().includes(keyword)) ||
|
||||||
|
(item.devName && item.devName.toLowerCase().includes(keyword)) ||
|
||||||
|
(item.lineName && item.lineName.toLowerCase().includes(keyword))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
const currentPageData = computed(() => {
|
||||||
|
const pageSize = tableStore.table.params.pageSize
|
||||||
|
const pageNum = tableStore.table.params.pageNum
|
||||||
|
const start = (pageNum - 1) * pageSize
|
||||||
|
const end = start + pageSize
|
||||||
|
return filteredData.value.slice(start, end)
|
||||||
|
})
|
||||||
|
|
||||||
|
const updateTotal = computed(() => {
|
||||||
|
return filteredData.value.length
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/harmonic-boot/PollutionSubstation/downPollutionLineCalc',
|
||||||
|
method: 'POST',
|
||||||
|
column: [],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
delete tableStore.table.params.deptIndex
|
||||||
|
delete tableStore.table.params.interval
|
||||||
|
delete tableStore.table.params.searchEndTime
|
||||||
|
delete tableStore.table.params.searchBeginTime
|
||||||
|
delete tableStore.table.params.timeFlag
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
allData.value = tableStore.table.data || []
|
||||||
|
tableStore.table.total = updateTotal.value
|
||||||
|
tableStore.table.data = currentPageData.value
|
||||||
|
},
|
||||||
|
resetCallback: () => {
|
||||||
|
clearQueryParams()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => areOptions,
|
||||||
|
(newOptions) => {
|
||||||
|
if (newOptions && newOptions.length > 0) {
|
||||||
|
selectedArea.value = newOptions[0].id
|
||||||
|
tableStore.table.params.id = newOptions[0].id
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => options,
|
||||||
|
(newOptions) => {
|
||||||
|
if (newOptions && newOptions.length > 0) {
|
||||||
|
if (!tableStore.table.params.statisticalType) {
|
||||||
|
tableStore.table.params.statisticalType = newOptions[0]
|
||||||
|
tableStore.table.params.ids = [newOptions[0].id]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
tableStore.table.params.powerFlag = "0"
|
||||||
|
tableStore.table.params.isUpToGrid = 0
|
||||||
|
tableStore.table.params.type = 1
|
||||||
|
|
||||||
|
const handleStatisticalTypeChange = (newVal: { id: any }) => {
|
||||||
|
if (newVal) {
|
||||||
|
tableStore.table.params.statisticalType = newVal
|
||||||
|
tableStore.table.params.ids = [newVal.id]
|
||||||
|
if (newVal.name) {
|
||||||
|
harmonicValueTitle.value = newVal.name + '污染值'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 重新调用接口
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleFilterChange = () => {
|
||||||
|
tableStore.table.params.pageNum = 1
|
||||||
|
tableStore.table.data = currentPageData.value
|
||||||
|
tableStore.table.total = updateTotal.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSizeChange = (val: number) => {
|
||||||
|
tableStore.table.params.pageSize = val
|
||||||
|
tableStore.table.params.pageNum = 1
|
||||||
|
tableStore.table.data = currentPageData.value
|
||||||
|
tableStore.table.total = updateTotal.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCurrentChange = (val: number) => {
|
||||||
|
tableStore.table.params.pageNum = val
|
||||||
|
tableStore.table.data = currentPageData.value
|
||||||
|
tableStore.table.total = updateTotal.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const exportEvent = () => {
|
||||||
|
const allFilteredData = filteredData.value
|
||||||
|
tableRef.value.exportData({
|
||||||
|
filename: '监测点评估-污染值报告',
|
||||||
|
sheetName: 'Sheet1',
|
||||||
|
type: 'xlsx',
|
||||||
|
useStyle: true,
|
||||||
|
data: allFilteredData,
|
||||||
|
columnFilterMethod: function (column, $columnIndex) {
|
||||||
|
return !(column.$columnIndex === 0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (props.active) {
|
||||||
|
tableStore.index()
|
||||||
|
emit('initialized', 'pollutionReport')
|
||||||
|
}
|
||||||
|
calculateTableHeight()
|
||||||
|
window.addEventListener('resize', debouncedCalculateTableHeight)
|
||||||
|
})
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
window.removeEventListener('resize', debouncedCalculateTableHeight)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const clearQueryParams = () => {
|
||||||
|
// 将区域恢复成第一层
|
||||||
|
if (areOptions && areOptions.length > 0) {
|
||||||
|
selectedArea.value = areOptions[0].id
|
||||||
|
tableStore.table.params.id = areOptions[0].id
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空搜索关键词
|
||||||
|
searchKeyword.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
refresh: () => {
|
||||||
|
// 清空查询参数
|
||||||
|
clearQueryParams()
|
||||||
|
tableHeaderRef.value.setTheDate(3)
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.pagination-container {
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
border-top: none;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination) {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__sizes) {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__total) {
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__jump) {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 响应式处理 */
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
:deep(.custom-pagination) {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__total) {
|
||||||
|
margin-right: 0;
|
||||||
|
order: 1;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__sizes) {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .btn-prev),
|
||||||
|
:deep(.custom-pagination .el-pager),
|
||||||
|
:deep(.custom-pagination .btn-next),
|
||||||
|
:deep(.custom-pagination .el-pagination__jump) {
|
||||||
|
order: 3;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,520 @@
|
|||||||
|
<template>
|
||||||
|
<div class="tab-content">
|
||||||
|
<TableHeader datePicker ref="tableHeaderRef" @selectChange="handleSelectChange">
|
||||||
|
<template #select>
|
||||||
|
<el-form-item label="区域">
|
||||||
|
<el-cascader
|
||||||
|
v-bind="$attrs"
|
||||||
|
:options="areOptions"
|
||||||
|
:props="cascaderProps"
|
||||||
|
v-model="selectedArea"
|
||||||
|
@change="handleFilterChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="统计类型">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.statisticalType"
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择统计类型"
|
||||||
|
@change="handleStatisticalTypeChange"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电网标志">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.powerFlag"
|
||||||
|
placeholder="请选择电网标志"
|
||||||
|
@change="handleFilterChange"
|
||||||
|
>
|
||||||
|
<el-option label="全部" value="0"></el-option>
|
||||||
|
<el-option label="电网侧" value="1"></el-option>
|
||||||
|
<el-option label="非电网侧" value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="筛选数据">
|
||||||
|
<el-input
|
||||||
|
v-model="searchKeyword"
|
||||||
|
placeholder="请输入变电站"
|
||||||
|
clearable
|
||||||
|
@input="handleFilterChange"
|
||||||
|
:show-word-limit=true
|
||||||
|
:maxlength="32"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template #operation>
|
||||||
|
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
|
||||||
|
<div v-loading="tableStore.table.loading" class="main-container">
|
||||||
|
<vxe-table
|
||||||
|
class="full-height-table"
|
||||||
|
ref="tableRef"
|
||||||
|
auto-resize
|
||||||
|
:data="tableStore.table.data"
|
||||||
|
v-bind="defaultAttribute"
|
||||||
|
:height="tableHeight"
|
||||||
|
resizable
|
||||||
|
show-overflow
|
||||||
|
>
|
||||||
|
<vxe-column title="序号" width="80" type="seq" align="center"></vxe-column>
|
||||||
|
<vxe-column field="gdName" title="供电公司" align="center" min-width="120" ></vxe-column>
|
||||||
|
<vxe-column field="subStationName" :show-overflow="true" title="变电站" align="center" min-width="150"></vxe-column>
|
||||||
|
<vxe-column field="subVStationValue" :title="harmonicValueTitle" align="center" min-width="150"></vxe-column>
|
||||||
|
<vxe-column field="subVoltage" title="变电站电压等级" align="center" min-width="150"></vxe-column>
|
||||||
|
<vxe-column title="操作" width="150" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button size="small" type="primary" @click="showDetailDialog(row)">监测点详情</el-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pagination-container">
|
||||||
|
<el-pagination
|
||||||
|
:current-page="tableStore.table.params.pageNum"
|
||||||
|
:page-size="tableStore.table.params.pageSize"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
background
|
||||||
|
layout="sizes, total, prev, pager, next, jumper"
|
||||||
|
:total="tableStore.table.total"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
class="custom-pagination"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加弹窗 -->
|
||||||
|
<el-dialog draggable
|
||||||
|
v-model="detailDialogVisible"
|
||||||
|
:title="detailDialogTitle"
|
||||||
|
width="1000px"
|
||||||
|
|
||||||
|
>
|
||||||
|
<div v-loading="detailLoading">
|
||||||
|
<div style="margin-bottom: 10px; text-align: right;">
|
||||||
|
<el-button icon="el-icon-Download" type="primary" @click="exportDetailEvent">导出</el-button>
|
||||||
|
</div>
|
||||||
|
<vxe-table
|
||||||
|
ref="detailTableRef"
|
||||||
|
:data="detailData"
|
||||||
|
auto-resize
|
||||||
|
v-bind="defaultAttribute"
|
||||||
|
resizable
|
||||||
|
show-overflow
|
||||||
|
height="400px"
|
||||||
|
>
|
||||||
|
<vxe-column title="序号" width="60" type="seq" align="center"></vxe-column>
|
||||||
|
|
||||||
|
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||||
|
<vxe-column field="devName" title="终端名称" align="center" min-width="120"></vxe-column>
|
||||||
|
<vxe-column field="devType" title="终端型号" align="center" min-width="100"></vxe-column>
|
||||||
|
<vxe-column field="manufacturer" title="终端厂家" align="center" min-width="120"></vxe-column>
|
||||||
|
<vxe-column field="loginTime" title="投运时间" align="center" min-width="120"></vxe-column>
|
||||||
|
<vxe-column field="interval" title="统计间隔" align="center" min-width="100"></vxe-column>
|
||||||
|
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column>
|
||||||
|
<vxe-column field="vharmonicValue" title="监测点污染值" align="center" min-width="120"></vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import { ref, onMounted, provide, onBeforeUnmount, computed, watch } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { debounce } from 'lodash-es'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
active: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['initialized'])
|
||||||
|
|
||||||
|
const dictData = useDictData()
|
||||||
|
const options = dictData.getBasicData('Pollution_Calc')
|
||||||
|
const tableHeight = ref(500)
|
||||||
|
const tableRef = ref()
|
||||||
|
const tableHeaderRef = ref()
|
||||||
|
const detailTableRef = ref()
|
||||||
|
const selectedArea = ref()
|
||||||
|
const areOptions: any = dictData.state.area
|
||||||
|
const allData = ref<PollutionItem[]>([])
|
||||||
|
const searchKeyword = ref('')
|
||||||
|
const harmonicValueTitle = ref('电站谐波电压污染值')
|
||||||
|
const detailDialogVisible = ref(false)
|
||||||
|
const detailDialogTitle = ref('')
|
||||||
|
const detailLoading = ref(false)
|
||||||
|
const detailData = ref<PollutionItem[]>([])
|
||||||
|
const originalTableData = ref<any[]>([])
|
||||||
|
|
||||||
|
// 方法
|
||||||
|
const showDetailDialog = (row) => {
|
||||||
|
detailDialogTitle.value = `${row.subStationName} - 监测点详情`
|
||||||
|
loadDetailData(row)
|
||||||
|
detailDialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const loadDetailData = async (row) => {
|
||||||
|
detailLoading.value = true
|
||||||
|
try {
|
||||||
|
// 从原始数据中查找该变电站的详细信息
|
||||||
|
const originalItem = originalTableData.value.find(
|
||||||
|
item => item.subStationName === row.subStationName
|
||||||
|
)
|
||||||
|
|
||||||
|
if (originalItem && originalItem.powerFlagPollutionList) {
|
||||||
|
const detailList: PollutionItem[] = []
|
||||||
|
originalItem.powerFlagPollutionList.forEach((point: any) => {
|
||||||
|
detailList.push({
|
||||||
|
|
||||||
|
lineName: processNullValue(point.lineName),
|
||||||
|
devName: processNullValue(point.devName),
|
||||||
|
devType: processNullValue(point.devType),
|
||||||
|
manufacturer: processNullValue(point.manufacturer),
|
||||||
|
loginTime: processNullValue(point.loginTime),
|
||||||
|
interval: processNullValue(point.interval),
|
||||||
|
powerFlag: processNullValue(point.powerFlag),
|
||||||
|
vharmonicValue: processNullValue(point.vharmonicValue)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
detailData.value = detailList
|
||||||
|
} else {
|
||||||
|
detailData.value = []
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载详情数据失败:', error)
|
||||||
|
detailData.value = []
|
||||||
|
} finally {
|
||||||
|
detailLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const cascaderProps = {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id',
|
||||||
|
checkStrictly: true,
|
||||||
|
emitPath: false
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PollutionItem {
|
||||||
|
gdName?: string
|
||||||
|
subStationName?: string
|
||||||
|
subVStationValue?: string
|
||||||
|
subVoltage?: string
|
||||||
|
devName?: string
|
||||||
|
lineName?: string
|
||||||
|
powerFlag?: string
|
||||||
|
devType?: string
|
||||||
|
manufacturer?: string
|
||||||
|
loginTime?: string
|
||||||
|
interval?: string
|
||||||
|
vharmonicValue?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSelectChange = (isExpanded: boolean) => {
|
||||||
|
if (isExpanded) {
|
||||||
|
tableHeight.value = tableHeight.value - 55
|
||||||
|
} else {
|
||||||
|
tableHeight.value = tableHeight.value + 55
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const calculateTableHeight = () => {
|
||||||
|
const windowHeight = window.innerHeight
|
||||||
|
const headerHeight = 160
|
||||||
|
const paginationHeight = 120
|
||||||
|
const padding = 30
|
||||||
|
const calculatedHeight = windowHeight - headerHeight - paginationHeight - padding
|
||||||
|
tableHeight.value = Math.max(calculatedHeight, 300)
|
||||||
|
}
|
||||||
|
|
||||||
|
const debouncedCalculateTableHeight = debounce(() => {
|
||||||
|
calculateTableHeight()
|
||||||
|
}, 300)
|
||||||
|
|
||||||
|
const filteredData = computed(() => {
|
||||||
|
let result = [...allData.value]
|
||||||
|
|
||||||
|
if (selectedArea.value) {
|
||||||
|
let areaName = ''
|
||||||
|
let areaLevel = -1
|
||||||
|
const findAreaName = (areas: any[]) => {
|
||||||
|
for (const area of areas) {
|
||||||
|
if (area.id === selectedArea.value) {
|
||||||
|
areaName = area.name
|
||||||
|
areaLevel = area.level !== undefined ? area.level : -1
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if (area.children && area.children.length > 0) {
|
||||||
|
findAreaName(area.children)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
findAreaName(areOptions)
|
||||||
|
|
||||||
|
if (areaName && areaLevel > 1) {
|
||||||
|
result = result.filter(item => item.gdName && item.gdName.includes(areaName))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tableStore.table.params.powerFlag === '1') {
|
||||||
|
result = result.filter(item => item.powerFlag && !item.powerFlag.includes('非'))
|
||||||
|
} else if (tableStore.table.params.powerFlag === '2') {
|
||||||
|
result = result.filter(item => item.powerFlag && item.powerFlag.includes('非'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (searchKeyword.value) {
|
||||||
|
const keyword = searchKeyword.value.toLowerCase()
|
||||||
|
result = result.filter(item =>
|
||||||
|
(item.subStationName && item.subStationName.toLowerCase().includes(keyword)) ||
|
||||||
|
(item.devName && item.devName.toLowerCase().includes(keyword)) ||
|
||||||
|
(item.lineName && item.lineName.toLowerCase().includes(keyword))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
const currentPageData = computed(() => {
|
||||||
|
const pageSize = tableStore.table.params.pageSize
|
||||||
|
const pageNum = tableStore.table.params.pageNum
|
||||||
|
const start = (pageNum - 1) * pageSize
|
||||||
|
const end = start + pageSize
|
||||||
|
return filteredData.value.slice(start, end)
|
||||||
|
})
|
||||||
|
|
||||||
|
const updateTotal = computed(() => {
|
||||||
|
return filteredData.value.length
|
||||||
|
})
|
||||||
|
|
||||||
|
const processNullValue = (value: any) => {
|
||||||
|
return value === null || value === undefined || value === '' || value === 'null'? '/' : value
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/harmonic-boot/PollutionSubstation/downPollutionSubCalc',
|
||||||
|
method: 'POST',
|
||||||
|
column: [],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
delete tableStore.table.params.deptIndex
|
||||||
|
delete tableStore.table.params.interval
|
||||||
|
delete tableStore.table.params.searchEndTime
|
||||||
|
delete tableStore.table.params.searchBeginTime
|
||||||
|
delete tableStore.table.params.timeFlag
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
// 保存原始数据以便后续查询
|
||||||
|
originalTableData.value = [...(tableStore.table.data || [])]
|
||||||
|
|
||||||
|
const expandedData: PollutionItem[] = [];
|
||||||
|
|
||||||
|
(tableStore.table.data || []).forEach((item: any) => {
|
||||||
|
expandedData.push({
|
||||||
|
gdName: processNullValue(item.gdName),
|
||||||
|
subStationName: processNullValue(item.subStationName),
|
||||||
|
subVStationValue: processNullValue(item.subVStationValue),
|
||||||
|
subVoltage: processNullValue(item.subVoltage)
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
allData.value = expandedData;
|
||||||
|
tableStore.table.total = updateTotal.value;
|
||||||
|
tableStore.table.data = currentPageData.value;
|
||||||
|
},
|
||||||
|
resetCallback: () => {
|
||||||
|
clearQueryParams()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => areOptions,
|
||||||
|
(newOptions) => {
|
||||||
|
if (newOptions && newOptions.length > 0) {
|
||||||
|
selectedArea.value = newOptions[0].id
|
||||||
|
tableStore.table.params.id = newOptions[0].id
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => options,
|
||||||
|
(newOptions) => {
|
||||||
|
if (newOptions && newOptions.length > 0) {
|
||||||
|
if (!tableStore.table.params.statisticalType) {
|
||||||
|
tableStore.table.params.statisticalType = newOptions[0]
|
||||||
|
tableStore.table.params.ids = [newOptions[0].id]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
|
||||||
|
tableStore.table.params.powerFlag = "0"
|
||||||
|
tableStore.table.params.isUpToGrid = 0
|
||||||
|
tableStore.table.params.type = 1
|
||||||
|
|
||||||
|
const handleStatisticalTypeChange = (newVal: { id: any }) => {
|
||||||
|
if (newVal) {
|
||||||
|
tableStore.table.params.statisticalType = newVal
|
||||||
|
tableStore.table.params.ids = [newVal.id]
|
||||||
|
if (newVal.name) {
|
||||||
|
harmonicValueTitle.value = '电站' + newVal.name + '污染值'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 重新调用接口
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleFilterChange = () => {
|
||||||
|
tableStore.table.params.pageNum = 1
|
||||||
|
tableStore.table.data = currentPageData.value
|
||||||
|
tableStore.table.total = updateTotal.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSizeChange = (val: number) => {
|
||||||
|
tableStore.table.params.pageSize = val
|
||||||
|
tableStore.table.params.pageNum = 1
|
||||||
|
tableStore.table.data = currentPageData.value
|
||||||
|
tableStore.table.total = updateTotal.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCurrentChange = (val: number) => {
|
||||||
|
tableStore.table.params.pageNum = val
|
||||||
|
tableStore.table.data = currentPageData.value
|
||||||
|
tableStore.table.total = updateTotal.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const exportEvent = () => {
|
||||||
|
const allFilteredData = filteredData.value
|
||||||
|
tableRef.value.exportData({
|
||||||
|
filename: '场站级评估-污染值报告',
|
||||||
|
sheetName: 'Sheet1',
|
||||||
|
type: 'xlsx',
|
||||||
|
useStyle: true,
|
||||||
|
data: allFilteredData,
|
||||||
|
columnFilterMethod: function (column: any) {
|
||||||
|
return !(
|
||||||
|
column.column.title === '操作'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出详情数据的方法
|
||||||
|
const exportDetailEvent = () => {
|
||||||
|
detailTableRef.value.exportData({
|
||||||
|
filename: detailDialogTitle.value,
|
||||||
|
sheetName: 'Sheet1',
|
||||||
|
type: 'xlsx',
|
||||||
|
useStyle: true,
|
||||||
|
data: detailData.value,
|
||||||
|
columnFilterMethod({ column }) {
|
||||||
|
// 导出所有列,包括隐藏列
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (props.active) {
|
||||||
|
tableStore.index()
|
||||||
|
emit('initialized', 'pollutionReport')
|
||||||
|
}
|
||||||
|
calculateTableHeight()
|
||||||
|
window.addEventListener('resize', debouncedCalculateTableHeight)
|
||||||
|
})
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
window.removeEventListener('resize', debouncedCalculateTableHeight)
|
||||||
|
})
|
||||||
|
|
||||||
|
const clearQueryParams = () => {
|
||||||
|
// 将区域恢复成第一层
|
||||||
|
if (areOptions && areOptions.length > 0) {
|
||||||
|
selectedArea.value = areOptions[0].id
|
||||||
|
tableStore.table.params.id = areOptions[0].id
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空搜索关键词
|
||||||
|
searchKeyword.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
refresh: () => {
|
||||||
|
clearQueryParams()
|
||||||
|
tableHeaderRef.value.setTheDate(3)
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.pagination-container {
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
border-top: none;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 0 0 5px 0;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination) {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__sizes) {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__total) {
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__jump) {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 响应式处理 */
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
:deep(.custom-pagination) {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__total) {
|
||||||
|
margin-right: 0;
|
||||||
|
order: 1;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .el-pagination__sizes) {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-pagination .btn-prev),
|
||||||
|
:deep(.custom-pagination .el-pager),
|
||||||
|
:deep(.custom-pagination .btn-next),
|
||||||
|
:deep(.custom-pagination .el-pagination__jump) {
|
||||||
|
order: 3;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,493 +1,49 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<TableHeader datePicker ref="TableHeaderRef" @selectChange="handleTableHeaderSelectChange">
|
<el-tabs v-model="activeTab" type="border-card" @tab-change="handleTabChange">
|
||||||
<template #select>
|
<el-tab-pane label="监测点评估" name="pollutionReport">
|
||||||
|
<MonitoringPointTab
|
||||||
|
ref="monitoringPointTabRef"
|
||||||
|
:active="activeTab === 'pollutionReport'"
|
||||||
|
|
||||||
<el-form-item label="区域">
|
/>
|
||||||
<el-cascader
|
</el-tab-pane>
|
||||||
v-bind="$attrs"
|
|
||||||
:options="areOptions"
|
|
||||||
:props="cascaderProps"
|
|
||||||
v-model="selectedArea"
|
|
||||||
@change="handleFilterChange"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="统计类型">
|
|
||||||
<el-select
|
|
||||||
v-model="tableStore.table.params.statisticalType"
|
|
||||||
value-key="id"
|
|
||||||
placeholder="请选择统计类型"
|
|
||||||
@change="handleStatisticalTypeChange"
|
|
||||||
>
|
|
||||||
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="电网标志">
|
|
||||||
<el-select
|
|
||||||
v-model="tableStore.table.params.powerFlag"
|
|
||||||
placeholder="请选择电网标志"
|
|
||||||
@change="handleFilterChange"
|
|
||||||
>
|
|
||||||
<el-option label="全部" value="0"></el-option>
|
|
||||||
<el-option label="电网侧" value="1"></el-option>
|
|
||||||
<el-option label="非电网侧" value="2"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="筛选">
|
|
||||||
<el-input
|
|
||||||
v-model="searchKeyword"
|
|
||||||
placeholder="请输入变电站/终端/监测点"
|
|
||||||
clearable
|
|
||||||
@input="handleFilterChange"
|
|
||||||
:show-word-limit=true
|
|
||||||
:maxlength="32"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
<template #operation>
|
|
||||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
|
|
||||||
</template>
|
|
||||||
</TableHeader>
|
|
||||||
|
|
||||||
<div v-loading="tableStore.table.loading" class="main-container">
|
<el-tab-pane label="场站级评估" name="anotherReport">
|
||||||
<vxe-table
|
<SubstationTab
|
||||||
class="full-height-table"
|
ref="substationTabRef"
|
||||||
ref="positioningtableRef"
|
:active="activeTab === 'anotherReport'"
|
||||||
auto-resize
|
|
||||||
:data="tableStore.table.data"
|
/>
|
||||||
v-bind="defaultAttribute"
|
</el-tab-pane>
|
||||||
:height="tableHeight"
|
</el-tabs>
|
||||||
resizable
|
</div>
|
||||||
show-overflow
|
|
||||||
>
|
|
||||||
<vxe-column title="序号" width="80" type="seq" align="center"></vxe-column>
|
|
||||||
<vxe-column field="gdName" title="供电公司" align="center" min-width="120"></vxe-column>
|
|
||||||
<vxe-column field="subStationName" :show-overflow="true" title="变电站" align="center" min-width="150" ></vxe-column>
|
|
||||||
<vxe-column field="devName" title="终端名称" align="center" min-width="120"></vxe-column>
|
|
||||||
<vxe-column field="devType" title="终端型号" align="center" min-width="150" ></vxe-column>
|
|
||||||
<vxe-column field="loginTime" title="投运时间" align="center" min-width="120"></vxe-column>
|
|
||||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="150"></vxe-column>
|
|
||||||
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column>
|
|
||||||
<vxe-column field="lineVoltage" title="监测点电压等级" align="center" min-width="120"></vxe-column>
|
|
||||||
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></vxe-column>
|
|
||||||
<vxe-column field="objName" title="监测对象名称" align="center" min-width="150"></vxe-column>
|
|
||||||
<vxe-column field="interval" title="统计间隔" align="center" min-width="100"></vxe-column>
|
|
||||||
<vxe-column field="onlineRate" title="在线率(%)" align="center" min-width="100"></vxe-column>
|
|
||||||
<vxe-column field="integrity" title="完整率(%)" align="center" min-width="100"></vxe-column>
|
|
||||||
<vxe-column field="harmonicValue" :title="harmonicValueTitle" align="center" min-width="120"></vxe-column>
|
|
||||||
<vxe-column field="upCounts" title="暂升次数(次)" align="center" min-width="100"></vxe-column>
|
|
||||||
<vxe-column field="downCounts" title="电压暂降(次)" align="center" min-width="100"></vxe-column>
|
|
||||||
<vxe-column field="breakCounts" title="短时中断(次)" align="center" min-width="100"></vxe-column>
|
|
||||||
<vxe-column field="monitorId" title="一类监测点" align="center" min-width="120" :formatter="formatMonitorId"></vxe-column>
|
|
||||||
</vxe-table>
|
|
||||||
</div>
|
|
||||||
<!-- 修改分页控件 -->
|
|
||||||
<div class="pagination-container">
|
|
||||||
<el-pagination
|
|
||||||
:current-page="tableStore.table.params.pageNum"
|
|
||||||
:page-size="tableStore.table.params.pageSize"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
background
|
|
||||||
layout="sizes, total, prev, pager, next, jumper"
|
|
||||||
:total="tableStore.table.total"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
></el-pagination>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, onBeforeUnmount, computed, reactive, watch } from 'vue'
|
import { ref } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import MonitoringPointTab from './MonitoringPointTab.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import SubstationTab from './SubstationTab.vue'
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
|
||||||
import { useDictData } from '@/stores/dictData'
|
|
||||||
import { debounce } from 'lodash-es'
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'harmonic-boot/qydetailedAnalysis/pollutionReport'
|
name: 'harmonic-boot/qydetailedAnalysis/pollutionReport'
|
||||||
})
|
})
|
||||||
|
|
||||||
const dictData = useDictData()
|
const activeTab = ref('pollutionReport')
|
||||||
const options = dictData.getBasicData('Pollution_Calc')
|
const monitoringPointTabRef = ref()
|
||||||
const tableHeight = ref(500) // 默认高度
|
const substationTabRef = ref()
|
||||||
const positioningtableRef = ref()
|
|
||||||
// 添加区域选择的响应式变量
|
|
||||||
const selectedArea = ref()
|
|
||||||
const areOptions:any = dictData.state.area
|
|
||||||
const allData = ref<PollutionItem[]>([])
|
|
||||||
const TableHeaderRef = ref()
|
|
||||||
// 添加响应式标题变量
|
|
||||||
const harmonicValueTitle = ref('谐波电压污染值')
|
|
||||||
const searchKeyword = ref('')
|
|
||||||
|
|
||||||
const cascaderProps = {
|
|
||||||
label: 'name',
|
|
||||||
value: 'id',
|
|
||||||
checkStrictly: true,
|
|
||||||
emitPath: false
|
|
||||||
}
|
|
||||||
|
|
||||||
// 存储所有数据
|
const handleTabChange = (tabName: string) => {
|
||||||
interface PollutionItem {
|
if (tabName === 'pollutionReport' && monitoringPointTabRef.value) {
|
||||||
gdName?: string
|
|
||||||
subStationName?: string
|
|
||||||
devName?: string
|
|
||||||
lineName?: string
|
|
||||||
powerFlag?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
// 格式化一类监测点字段
|
monitoringPointTabRef.value.refresh()
|
||||||
const formatMonitorId = (row: any) => {
|
} else if (tabName === 'anotherReport' && substationTabRef.value) {
|
||||||
return row.row.monitorId || '/'
|
substationTabRef.value.refresh()
|
||||||
}
|
|
||||||
|
|
||||||
// 处理 TableHeader 展开/收起事件
|
|
||||||
const handleTableHeaderSelectChange = (isExpanded: boolean) => {
|
|
||||||
if(isExpanded){
|
|
||||||
tableHeight.value = tableHeight.value - 55
|
|
||||||
}else{
|
|
||||||
tableHeight.value = tableHeight.value + 55
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const calculateTableHeight = () => {
|
|
||||||
const windowHeight = window.innerHeight
|
|
||||||
const headerHeight = 120
|
|
||||||
const paginationHeight = 80 // 增加分页控件高度预留
|
|
||||||
const padding = 30 // 增加padding避免被遮挡
|
|
||||||
const calculatedHeight = windowHeight - headerHeight - paginationHeight - padding
|
|
||||||
tableHeight.value = Math.max(calculatedHeight, 300)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 防抖处理窗口大小变化
|
|
||||||
const debouncedCalculateTableHeight = debounce(() => {
|
|
||||||
calculateTableHeight()
|
|
||||||
}, 300)
|
|
||||||
|
|
||||||
// 计算过滤后的数据
|
|
||||||
const filteredData = computed(() => {
|
|
||||||
let result = [...allData.value]
|
|
||||||
|
|
||||||
// 区域过滤
|
|
||||||
if (selectedArea.value) {
|
|
||||||
// 查找匹配的区域名称
|
|
||||||
let areaName = ''
|
|
||||||
let areaLevel = -1
|
|
||||||
const findAreaName = (areas: any[]) => {
|
|
||||||
for (const area of areas) {
|
|
||||||
|
|
||||||
if (area.id === selectedArea.value) {
|
|
||||||
areaName = area.name
|
|
||||||
areaLevel = area.level !== undefined ? area.level : -1
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if (area.children && area.children.length > 0) {
|
|
||||||
findAreaName(area.children)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
findAreaName(areOptions)
|
|
||||||
|
|
||||||
// 根据区域名称过滤数据,但只有当层级大于1时才过滤
|
|
||||||
if (areaName && areaLevel > 1) {
|
|
||||||
result = result.filter(item => item.gdName && item.gdName.includes(areaName))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 电网标志过滤
|
|
||||||
if (tableStore.table.params.powerFlag === '1') {
|
|
||||||
// 电网侧
|
|
||||||
result = result.filter(item => item.powerFlag && !item.powerFlag.includes('非'))
|
|
||||||
} else if (tableStore.table.params.powerFlag === '2') {
|
|
||||||
// 非电网侧
|
|
||||||
result = result.filter(item => item.powerFlag && item.powerFlag.includes('非'))
|
|
||||||
}
|
|
||||||
// '0' 表示全部,不过滤
|
|
||||||
|
|
||||||
// 统一搜索过滤
|
|
||||||
if (searchKeyword.value) {
|
|
||||||
const keyword = searchKeyword.value.toLowerCase()
|
|
||||||
result = result.filter(item =>
|
|
||||||
(item.subStationName && item.subStationName.toLowerCase().includes(keyword)) ||
|
|
||||||
(item.devName && item.devName.toLowerCase().includes(keyword)) ||
|
|
||||||
(item.lineName && item.lineName.toLowerCase().includes(keyword))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
|
|
||||||
// 计算当前页数据
|
|
||||||
const currentPageData = computed(() => {
|
|
||||||
const pageSize = tableStore.table.params.pageSize
|
|
||||||
const pageNum = tableStore.table.params.pageNum
|
|
||||||
const start = (pageNum - 1) * pageSize
|
|
||||||
const end = start + pageSize
|
|
||||||
return filteredData.value.slice(start, end)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 更新总条数
|
|
||||||
const updateTotal = computed(() => {
|
|
||||||
return filteredData.value.length
|
|
||||||
})
|
|
||||||
|
|
||||||
const tableStore = new TableStore({
|
|
||||||
url: '/harmonic-boot/PollutionSubstation/downPollutionLineCalc',
|
|
||||||
method: 'POST',
|
|
||||||
column: [],
|
|
||||||
beforeSearchFun: () => {
|
|
||||||
//delete tableStore.table.params.statisticalType
|
|
||||||
delete tableStore.table.params.deptIndex
|
|
||||||
delete tableStore.table.params.interval
|
|
||||||
delete tableStore.table.params.searchEndTime
|
|
||||||
delete tableStore.table.params.searchBeginTime
|
|
||||||
delete tableStore.table.params.timeFlag
|
|
||||||
},
|
|
||||||
loadCallback: () => {
|
|
||||||
// 将所有数据存储到 allData 中
|
|
||||||
allData.value = tableStore.table.data || []
|
|
||||||
// 更新总条数
|
|
||||||
tableStore.table.total = updateTotal.value
|
|
||||||
// 更新当前页数据
|
|
||||||
tableStore.table.data = currentPageData.value
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
provide('tableStore', tableStore)
|
|
||||||
|
|
||||||
// 监听区域选项变化,设置默认值
|
|
||||||
watch(
|
|
||||||
() => areOptions,
|
|
||||||
(newOptions) => {
|
|
||||||
if (newOptions && newOptions.length > 0) {
|
|
||||||
// 设置默认选中第一项
|
|
||||||
selectedArea.value = newOptions[0].id
|
|
||||||
tableStore.table.params.id = newOptions[0].id
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
// 初始化统计类型
|
|
||||||
watch(
|
|
||||||
() => options,
|
|
||||||
(newOptions) => {
|
|
||||||
if (newOptions && newOptions.length > 0) {
|
|
||||||
// 检查是否已经设置了统计类型
|
|
||||||
if (!tableStore.table.params.statisticalType) {
|
|
||||||
tableStore.table.params.statisticalType = newOptions[0]
|
|
||||||
tableStore.table.params.ids = [newOptions[0].id]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
tableStore.table.params.powerFlag = "0"
|
|
||||||
tableStore.table.params.isUpToGrid = 0
|
|
||||||
tableStore.table.params.type = 1
|
|
||||||
|
|
||||||
// 监听统计类型变化,同步更新ids
|
|
||||||
const handleStatisticalTypeChange = (newVal: { id: any }) => {
|
|
||||||
console.log("统计类型变化", newVal)
|
|
||||||
if (newVal) {
|
|
||||||
tableStore.table.params.ids = [newVal.id]
|
|
||||||
// 根据统计类型动态更新标题
|
|
||||||
if (newVal.name) {
|
|
||||||
harmonicValueTitle.value = newVal.name + '污染值'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 重新调用接口
|
|
||||||
tableStore.index()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理过滤条件变化
|
|
||||||
const handleFilterChange = () => {
|
|
||||||
// 重置分页到第一页
|
|
||||||
tableStore.table.params.pageNum = 1
|
|
||||||
// 更新数据和总条数
|
|
||||||
tableStore.table.data = currentPageData.value
|
|
||||||
tableStore.table.total = updateTotal.value
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分页事件处理
|
|
||||||
const handleSizeChange = (val: number) => {
|
|
||||||
tableStore.table.params.pageSize = val
|
|
||||||
tableStore.table.params.pageNum = 1
|
|
||||||
tableStore.table.data = currentPageData.value
|
|
||||||
tableStore.table.total = updateTotal.value
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleCurrentChange = (val: number) => {
|
|
||||||
tableStore.table.params.pageNum = val
|
|
||||||
tableStore.table.data = currentPageData.value
|
|
||||||
tableStore.table.total = updateTotal.value
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出
|
|
||||||
const exportEvent = () => {
|
|
||||||
// 获取当前过滤后的所有数据
|
|
||||||
const allFilteredData = filteredData.value;
|
|
||||||
|
|
||||||
// 使用 vxe-table 的导出功能
|
|
||||||
positioningtableRef.value.exportData({
|
|
||||||
filename: '污染值报告',
|
|
||||||
sheetName: 'Sheet1',
|
|
||||||
type: 'xlsx',
|
|
||||||
useStyle: true,
|
|
||||||
data: allFilteredData,
|
|
||||||
columnFilterMethod: function (column, $columnIndex) {
|
|
||||||
return !(column.$columnIndex === 0)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
tableStore.index()
|
|
||||||
|
|
||||||
|
|
||||||
calculateTableHeight()
|
|
||||||
window.addEventListener('resize', debouncedCalculateTableHeight)
|
|
||||||
})
|
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
|
||||||
window.removeEventListener('resize', debouncedCalculateTableHeight)
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.default-main {
|
|
||||||
height: calc(100vh - 20px); /* 减去一些边距避免被任务栏遮挡 */
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-container {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.full-height-table {
|
|
||||||
flex: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep .vxe-table {
|
|
||||||
height: 100% !important;
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep .vxe-table--body-wrapper {
|
|
||||||
overflow: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagination-container {
|
|
||||||
flex: 0 0 auto; /* 不伸缩,保持固定高度 */
|
|
||||||
display: flex;
|
|
||||||
justify-content: center; /* 居中对齐 */
|
|
||||||
align-items: center;
|
|
||||||
min-height: 60px;
|
|
||||||
padding: 10px 20px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-top: 1px solid #ebeef5;
|
|
||||||
z-index: 100; /* 提高层级确保可见 */
|
|
||||||
position: relative; /* 确保定位上下文 */
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep .el-pagination {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.el-pagination__sizes {
|
|
||||||
.el-select {
|
|
||||||
min-width: 100px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-pagination__total {
|
|
||||||
margin-right: auto; /* 关键:将总共条数推到左侧 */
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 将除了 sizes 和 total 之外的所有元素都推到最右边 */
|
|
||||||
.btn-prev,
|
|
||||||
.btn-pager,
|
|
||||||
.btn-next,
|
|
||||||
.el-pagination__jump {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-prev {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-next {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-pagination__jump {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-pagination__editor {
|
|
||||||
width: 50px;
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 响应式处理 */
|
|
||||||
@media screen and (max-width: 768px) {
|
|
||||||
.pagination-container {
|
|
||||||
padding: 8px 10px;
|
|
||||||
min-height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep .el-pagination {
|
|
||||||
.el-pagination__sizes {
|
|
||||||
.el-select {
|
|
||||||
min-width: 80px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-pagination__total {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-pagination__jump {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 480px) {
|
|
||||||
:deep .el-pagination {
|
|
||||||
.el-pagination__sizes {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-pagination__total {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-pager {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-pagination__jump {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -109,7 +109,7 @@ const tableStore = new TableStore({
|
|||||||
{ field: 'name', title: '电网拓扑', minWidth: '150' },
|
{ field: 'name', title: '电网拓扑', minWidth: '150' },
|
||||||
{
|
{
|
||||||
field: 'onlineMonitorNumber',
|
field: 'onlineMonitorNumber',
|
||||||
title: '在线监测点数量(个)',
|
title: '在运监测点数(个)',
|
||||||
minWidth: '100px',
|
minWidth: '100px',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return row.cellValue == -1 ? '/' : row.cellValue
|
return row.cellValue == -1 ? '/' : row.cellValue
|
||||||
|
|||||||
377
src/views/pqs/harmonicMonitoring/embed/dataOverview_JB/index.vue
Normal file
@@ -0,0 +1,377 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader :showSearch="false" v-show="flag">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label="统计时间">
|
||||||
|
<DatePicker
|
||||||
|
ref="datePickerRef"
|
||||||
|
:nextFlag="false"
|
||||||
|
:theCurrentTime="true"
|
||||||
|
@change="handleDatePickerChange"
|
||||||
|
></DatePicker>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template v-slot:operation></template>
|
||||||
|
</TableHeader>
|
||||||
|
|
||||||
|
<GridLayout
|
||||||
|
v-model:layout="layout"
|
||||||
|
:row-height="rowHeight"
|
||||||
|
:is-resizable="false"
|
||||||
|
:is-draggable="false"
|
||||||
|
:responsive="false"
|
||||||
|
:vertical-compact="false"
|
||||||
|
prevent-collision
|
||||||
|
:col-num="12"
|
||||||
|
>
|
||||||
|
<template #item="{ item }">
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<Icon class="HelpFilled" :name="(item as LayoutItem).icon" />
|
||||||
|
{{ (item as LayoutItem).name }}
|
||||||
|
</div>
|
||||||
|
<!-- <img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="zoom(item)" /> -->
|
||||||
|
<el-tooltip effect="dark" content="查看详情" placement="top">
|
||||||
|
<View style="cursor: pointer; height: 16px" @click="jump(item)" />
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<component
|
||||||
|
:is="(item as LayoutItem).component"
|
||||||
|
v-if="(item as LayoutItem).component"
|
||||||
|
class="pd10"
|
||||||
|
:key="key"
|
||||||
|
:timeValue="datePickerRef?.timeValue || 3"
|
||||||
|
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||||
|
:width="rowWidth * item.w - 30 + 'px'"
|
||||||
|
:timeKey="(item as LayoutItem).timeKey"
|
||||||
|
:interval="datePickerRef?.interval"
|
||||||
|
:w="item.w"
|
||||||
|
:h="item.h"
|
||||||
|
/>
|
||||||
|
<div v-else class="pd10">组件加载失败...</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</GridLayout>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive, onMounted, markRaw, onUnmounted, computed, defineAsyncComponent, type Component } from 'vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { GridLayout } from 'grid-layout-plus'
|
||||||
|
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||||
|
import { useDebounceFn } from '@vueuse/core'
|
||||||
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
import { View } from '@element-plus/icons-vue'
|
||||||
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||||
|
import { adminBaseRoutePath } from '@/router/static'
|
||||||
|
const { push } = useRouter()
|
||||||
|
const datePickerRef = ref()
|
||||||
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const timeCacheStore = useTimeCacheStore()
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'harmonic-boot/preview'
|
||||||
|
})
|
||||||
|
// 定义类型
|
||||||
|
interface LayoutItem {
|
||||||
|
x: number
|
||||||
|
y: number
|
||||||
|
w: number
|
||||||
|
h: number
|
||||||
|
timeKey: number | string
|
||||||
|
i: string | number
|
||||||
|
name: string
|
||||||
|
path: string
|
||||||
|
icon?: string // 新增 icon 可选字段
|
||||||
|
component?: Component | string
|
||||||
|
loading?: boolean
|
||||||
|
error?: any
|
||||||
|
}
|
||||||
|
const key = ref(0)
|
||||||
|
const img = new URL(`@/assets/img/amplify.png`, import.meta.url).href
|
||||||
|
const img1 = new URL(`@/assets/img/reduce.png`, import.meta.url).href
|
||||||
|
// 响应式数据
|
||||||
|
const rowHeight = ref(0)
|
||||||
|
const rowWidth = ref(0)
|
||||||
|
const layout: any = ref([
|
||||||
|
// {
|
||||||
|
// x: 4,
|
||||||
|
// y: 0,
|
||||||
|
// w: 4,
|
||||||
|
// h: 2,
|
||||||
|
// i: '1',
|
||||||
|
// name: '',
|
||||||
|
// path: '/src/views/pqs/runManage/assessment/components/uese/index.vue'
|
||||||
|
// },
|
||||||
|
])
|
||||||
|
const layoutCopy: any = ref([])
|
||||||
|
const flag = ref(true)
|
||||||
|
// 组件映射
|
||||||
|
const componentMap = reactive(new Map<string, Component | string>())
|
||||||
|
const dataList: any = ref({})
|
||||||
|
// 获取主内容区域高度
|
||||||
|
const getMainHeight = () => {
|
||||||
|
const elMain = document.querySelector('.el-main')
|
||||||
|
return (elMain?.offsetHeight || 0) - 70
|
||||||
|
}
|
||||||
|
// 获取主内容区域高度
|
||||||
|
const getMainWidth = () => {
|
||||||
|
const elMain = document.querySelector('.el-main')
|
||||||
|
return (elMain?.offsetWidth || 0) - 20
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化行高
|
||||||
|
const initRowHeight = () => {
|
||||||
|
rowHeight.value = Math.max(0, (getMainHeight() - 77 + (flag.value ? 0 : 56)) / 6)
|
||||||
|
rowWidth.value = Math.max(0, getMainWidth() / 12)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动态注册组件
|
||||||
|
const registerComponent = (path: string): Component | string | null => {
|
||||||
|
if (!path) return null
|
||||||
|
|
||||||
|
const cacheKey = path
|
||||||
|
|
||||||
|
// 使用缓存的组件
|
||||||
|
if (componentMap.has(cacheKey)) {
|
||||||
|
return componentMap.get(cacheKey)!
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 动态导入组件
|
||||||
|
const modules = import.meta.glob('@/**/*.vue')
|
||||||
|
if (!modules[path]) {
|
||||||
|
console.error(`组件加载失败: ${path}`)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const AsyncComponent = defineAsyncComponent({
|
||||||
|
loader: modules[path],
|
||||||
|
loadingComponent: () => h('div', '加载中...'),
|
||||||
|
errorComponent: ({ error }) => h('div', `加载错误: ${error.message}`),
|
||||||
|
delay: 200,
|
||||||
|
timeout: 10000
|
||||||
|
})
|
||||||
|
|
||||||
|
// 保存到映射中
|
||||||
|
componentMap.set(cacheKey, markRaw(AsyncComponent))
|
||||||
|
return AsyncComponent
|
||||||
|
} catch (error) {
|
||||||
|
console.error('注册组件失败:', error)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 缩放
|
||||||
|
const zoom = (value: any) => {
|
||||||
|
if (flag.value) {
|
||||||
|
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
|
||||||
|
} else {
|
||||||
|
layout.value = layoutCopy.value.map((item: any, index: number) => ({
|
||||||
|
...item,
|
||||||
|
i: item.i || index, // 确保有唯一标识
|
||||||
|
component: registerComponent(item.path)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
flag.value = !flag.value
|
||||||
|
|
||||||
|
initRowHeight()
|
||||||
|
key.value += 1
|
||||||
|
}
|
||||||
|
// 跳转
|
||||||
|
const jump = (item: any) => {
|
||||||
|
if (item.routerPath) {
|
||||||
|
push(adminBaseRoutePath + item.routerPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算组件高度
|
||||||
|
const seRowHeight = (value: any) => {
|
||||||
|
if (value == 6) return 0
|
||||||
|
if (value == 5) return 12
|
||||||
|
if (value == 4) return 20
|
||||||
|
if (value == 3) return 30
|
||||||
|
if (value == 2) return 40
|
||||||
|
if (value == 1) return 50
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
// 获取布局数据
|
||||||
|
const fetchLayoutData = async () => {
|
||||||
|
try {
|
||||||
|
// const { data } = await queryByPagePath({ pagePath: router.currentRoute.value.name })
|
||||||
|
// dataList.value = data
|
||||||
|
dataList.value = {
|
||||||
|
createBy: 'e6a67ccbe789493687766c4304fcb228',
|
||||||
|
createTime: '2025-11-26 08:43:56',
|
||||||
|
updateBy: 'e6a67ccbe789493687766c4304fcb228',
|
||||||
|
updateTime: '2025-11-26 08:43:56',
|
||||||
|
id: 'e8218545cc11e32d5d6b87c92fdd0fbc',
|
||||||
|
pageName: '测试',
|
||||||
|
thumbnail: '',
|
||||||
|
remark: '',
|
||||||
|
containerConfig: [
|
||||||
|
{
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
w: 6,
|
||||||
|
h: 3,
|
||||||
|
i: 0.9274640143002512,
|
||||||
|
name: '终端运行评价',
|
||||||
|
path: '/src/components/cockpit/terminalEvaluation/index.vue',
|
||||||
|
icon: 'local-审计列表',
|
||||||
|
timeKey: '3',
|
||||||
|
routerPath: '/runManage/runEvaluate',
|
||||||
|
moved: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x: 6,
|
||||||
|
y: 0,
|
||||||
|
w: 6,
|
||||||
|
h: 3,
|
||||||
|
i: 0.9154814002445102,
|
||||||
|
name: '终端在线率',
|
||||||
|
path: '/src/components/cockpit/onlineRate/index.vue',
|
||||||
|
icon: 'local-告警中心',
|
||||||
|
timeKey: '3',
|
||||||
|
routerPath: '/harmonic-boot/area/OnlineRate',
|
||||||
|
moved: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x: 0,
|
||||||
|
y: 3,
|
||||||
|
w: 6,
|
||||||
|
h: 3,
|
||||||
|
i: 0.6560899767923003,
|
||||||
|
name: '监测点数据完整性',
|
||||||
|
path: '/src/components/cockpit/integrity/index.vue',
|
||||||
|
icon: 'local-稳态指标超标明细',
|
||||||
|
timeKey: '3',
|
||||||
|
routerPath: '/harmonic-boot/harmonic/getIntegrityData',
|
||||||
|
moved: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x: 6,
|
||||||
|
y: 3,
|
||||||
|
w: 6,
|
||||||
|
h: 3,
|
||||||
|
i: 0.5812302648025226,
|
||||||
|
name: '异常数据清洗',
|
||||||
|
path: '/src/components/cockpit/dataCleaning/index.vue',
|
||||||
|
icon: 'local-区域暂态评估',
|
||||||
|
timeKey: '3',
|
||||||
|
routerPath: '/runManage/cleaning',
|
||||||
|
moved: false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
sort: 100,
|
||||||
|
state: 1,
|
||||||
|
pagePath: 'dashboard/index6',
|
||||||
|
pathName: null,
|
||||||
|
routeName: '/src/views/pqs/cockpit/homePage/index.vue',
|
||||||
|
icon: ''
|
||||||
|
}
|
||||||
|
const parsedLayout = (dataList.value.containerConfig || '[]') as LayoutItem[]
|
||||||
|
// 处理布局数据
|
||||||
|
layout.value = parsedLayout.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
i: item.i || index, // 确保有唯一标识
|
||||||
|
component: registerComponent(item.path)
|
||||||
|
}))
|
||||||
|
layoutCopy.value = JSON.parse(JSON.stringify(layout.value))
|
||||||
|
initRowHeight()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取布局数据失败:', error)
|
||||||
|
// 可以添加错误提示逻辑
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 窗口大小变化处理 - 使用防抖
|
||||||
|
const handleResize = useDebounceFn(() => {
|
||||||
|
initRowHeight()
|
||||||
|
// key.value += 1
|
||||||
|
}, 200)
|
||||||
|
|
||||||
|
// 处理 DatePicker 值变化事件
|
||||||
|
const handleDatePickerChange = (value: any) => {
|
||||||
|
// 将值缓存到 timeCache
|
||||||
|
if (value) {
|
||||||
|
timeCacheStore.setCache(route.path, value.interval, value.timeValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生命周期钩子
|
||||||
|
onMounted(() => {
|
||||||
|
// initRowHeight()
|
||||||
|
fetchLayoutData()
|
||||||
|
|
||||||
|
// 添加窗口大小变化监听器
|
||||||
|
window.addEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
// 移除监听器防止内存泄漏
|
||||||
|
window.removeEventListener('resize', handleResize)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.vgl-layout {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item:not(.vgl-item--placeholder)) {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item:hover:not(.vgl-item--placeholder)) {
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item--static) {
|
||||||
|
background-color: #f0f2f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.vgl-item) {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
overflow: hidden;
|
||||||
|
.title {
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
font-size: 14px;
|
||||||
|
height: 30px;
|
||||||
|
font-weight: 600;
|
||||||
|
padding: 0px 10px;
|
||||||
|
color: #fff;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.HelpFilled {
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
color: #fff !important;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -125,7 +125,7 @@ const tableStore = new TableStore({
|
|||||||
var tips = ''
|
var tips = ''
|
||||||
|
|
||||||
for (var i = 0; i < params.length; i++) {
|
for (var i = 0; i < params.length; i++) {
|
||||||
if (params[i].value == 1) {
|
if (params[i].value == 3.14159) {
|
||||||
tips += params[i].name + '</br>'
|
tips += params[i].name + '</br>'
|
||||||
tips += '完整性:暂无数据'
|
tips += '完整性:暂无数据'
|
||||||
} else {
|
} else {
|
||||||
@@ -161,7 +161,21 @@ const tableStore = new TableStore({
|
|||||||
|
|
||||||
// 定制显示(按顺序)
|
// 定制显示(按顺序)
|
||||||
color: function (params: any) {
|
color: function (params: any) {
|
||||||
if (params.value >= 90) {
|
if (params.value ==3.14159) {
|
||||||
|
return new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#ccc'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
} else if (params.value >= 90) {
|
||||||
return new echarts.graphic.LinearGradient(
|
return new echarts.graphic.LinearGradient(
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
@@ -203,20 +217,6 @@ const tableStore = new TableStore({
|
|||||||
],
|
],
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
} else if (params.value > 0 && params.value <= 1) {
|
|
||||||
return new echarts.graphic.LinearGradient(
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
[
|
|
||||||
{
|
|
||||||
offset: 1,
|
|
||||||
color: '#ccc'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<TableHeader area datePicker ref="TableHeaderRef">
|
<TableHeader area datePicker ref="TableHeaderRef">
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="tableStore.table.params.filterName"
|
v-model="tableStore.table.params.filterName"
|
||||||
@keyup="searchEvent"
|
@keyup="searchEvent"
|
||||||
@@ -100,7 +100,7 @@ import TableStore from '@/utils/tableStore'
|
|||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { exportModelJB } from '@/api/harmonic-boot/harmonic.ts'
|
import { exportModelJB } from '@/api/harmonic-boot/harmonic'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils'
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
|
|||||||
@@ -0,0 +1,291 @@
|
|||||||
|
<template>
|
||||||
|
<TableHeader area datePicker ref="TableHeaderRef">
|
||||||
|
<template #select>
|
||||||
|
<el-form-item label="统计类型:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.statisticalType"
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择统计类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in classificationData"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电压等级:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.scale"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
clearable
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择电压等级"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in voltageleveloption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="终端厂家:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.manufacturer"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
clearable
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择终端厂家"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in terminaloption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="干扰源类型:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.loadType"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
clearable
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择干扰源类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in interfereoption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<my-echart class="mt10" :style="`height: calc(${tableStore.table.height} - 75px)`" :options="options" />
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import * as echarts from 'echarts/core'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const options = ref({})
|
||||||
|
|
||||||
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
|
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||||
|
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||||
|
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||||
|
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/device-boot/LineIntegrityData/getIntegrityIcon',
|
||||||
|
|
||||||
|
showPage: false,
|
||||||
|
method: 'POST',
|
||||||
|
column: [],
|
||||||
|
|
||||||
|
loadCallback: () => {
|
||||||
|
// tableStore.table.data.type
|
||||||
|
let code = tableStore.table.params.statisticalType.code
|
||||||
|
let title = '',
|
||||||
|
titleX = ''
|
||||||
|
if (code == 'Power_Network') {
|
||||||
|
title = '区域'
|
||||||
|
titleX = '区域'
|
||||||
|
} else if (code == 'Manufacturer') {
|
||||||
|
title = '终端厂家'
|
||||||
|
titleX = '终端\n厂家'
|
||||||
|
} else if (code == 'Voltage_Level') {
|
||||||
|
title = '电压等级'
|
||||||
|
titleX = '电压\n等级'
|
||||||
|
} else if (code == 'Load_Type') {
|
||||||
|
title = '干扰源类型'
|
||||||
|
titleX = '干扰\n源类型'
|
||||||
|
} else if (code == 'Report_Type') {
|
||||||
|
title = '上报类型'
|
||||||
|
titleX = '上报\n类型'
|
||||||
|
}
|
||||||
|
options.value = {
|
||||||
|
title: {
|
||||||
|
text: title
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
formatter: function (params: any) {
|
||||||
|
var tips = ''
|
||||||
|
|
||||||
|
for (var i = 0; i < params.length; i++) {
|
||||||
|
if (params[i].value == 3.14159) {
|
||||||
|
tips += params[i].name + '</br>'
|
||||||
|
tips += '完整性:暂无数据'
|
||||||
|
} else {
|
||||||
|
tips += params[i].name + '</br>'
|
||||||
|
tips += '完整性:' + params[i].value.toFixed(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tips
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '50px',
|
||||||
|
right: '80px'
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
name: titleX,
|
||||||
|
data: tableStore.table.data.map((item: any) => item.type)
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: '%',
|
||||||
|
max: 100
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '完整性',
|
||||||
|
type: 'bar',
|
||||||
|
data: tableStore.table.data.map((item: any) => item.single),
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
// 随机显示
|
||||||
|
//color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
|
||||||
|
|
||||||
|
// 定制显示(按顺序)
|
||||||
|
color: function (params: any) {
|
||||||
|
if (params.value ==3.14159) {
|
||||||
|
return new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#ccc'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
} else if (params.value >= 90) {
|
||||||
|
return new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#339966'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
} else if (params.value >= 60 && params.value <= 90) {
|
||||||
|
return new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#FFCC33'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
} else if (params.value <= 60 && params.value > 1) {
|
||||||
|
return new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#A52a2a'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
markLine: {
|
||||||
|
silent: false,
|
||||||
|
symbol: 'circle',
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
yAxis: 100,
|
||||||
|
lineStyle: {
|
||||||
|
color: '#339966'
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
//position: "middle",
|
||||||
|
formatter: '{b}',
|
||||||
|
textStyle: {
|
||||||
|
color: '#339966'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
yAxis: 90,
|
||||||
|
lineStyle: {
|
||||||
|
color: '#FFCC33'
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
// position: "middle",
|
||||||
|
formatter: '{b}',
|
||||||
|
textStyle: {
|
||||||
|
color: '#FFCC33'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
yAxis: 60,
|
||||||
|
lineStyle: {
|
||||||
|
color: '#A52a2a'
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
//position: "middle",
|
||||||
|
formatter: '{b}',
|
||||||
|
textStyle: {
|
||||||
|
color: '#A52a2a'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
tableStore.table.params.statisticalType = classificationData.filter(item => item.name == '电网拓扑')[0]
|
||||||
|
tableStore.table.params.monitorFlag = 2
|
||||||
|
tableStore.table.params.powerFlag = 2
|
||||||
|
tableStore.table.params.serverName = 'harmonicBoot'
|
||||||
|
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -0,0 +1,314 @@
|
|||||||
|
<template>
|
||||||
|
<TableHeader area datePicker ref="TableHeaderRef">
|
||||||
|
<template #select>
|
||||||
|
<el-form-item label="筛选数据">
|
||||||
|
<el-input
|
||||||
|
v-model="tableStore.table.params.filterName"
|
||||||
|
@keyup="searchEvent"
|
||||||
|
placeholder="输入关键字筛选"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="统计类型:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.statisticalType"
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择统计类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in classificationData"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="电压等级:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.scale"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
clearable
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择电压等级"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in voltageleveloption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="终端厂家:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.manufacturer"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
clearable
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择终端厂家"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in terminaloption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="干扰源类型:">
|
||||||
|
<el-select
|
||||||
|
v-model="tableStore.table.params.loadType"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
clearable
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择干扰源类型"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in interfereoption"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template #operation>
|
||||||
|
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button> -->
|
||||||
|
<el-button icon="el-icon-Download" :loading="loading" @click="exportEvent" type="primary">
|
||||||
|
下载报告
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<Table
|
||||||
|
ref="tableRef"
|
||||||
|
:radio-config="{
|
||||||
|
labelField: 'name',
|
||||||
|
highlight: true,
|
||||||
|
visibleMethod: row => row.row.level == 6
|
||||||
|
}"
|
||||||
|
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||||
|
:scroll-y="{ enabled: true }"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive } from 'vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { exportModelJB } from '@/api/harmonic-boot/harmonic.ts'
|
||||||
|
import { debounce } from 'lodash-es'
|
||||||
|
import XEUtils from 'xe-utils'
|
||||||
|
const dictData = useDictData()
|
||||||
|
const tableRef = ref()
|
||||||
|
const treeDataCopy: any = ref([])
|
||||||
|
const treeData: any = ref([])
|
||||||
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
|
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||||
|
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||||
|
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||||
|
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/device-boot/LineIntegrityData/getLineIntegrityData',
|
||||||
|
publicHeight: 65,
|
||||||
|
showPage: false,
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
// { width: '60', title: '111', },
|
||||||
|
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
|
||||||
|
{
|
||||||
|
field: 'ip',
|
||||||
|
title: '网络参数',
|
||||||
|
formatter: ({ row }: any) => {
|
||||||
|
return row.ip || '/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'deviceName',
|
||||||
|
title: '终端名称',
|
||||||
|
formatter: ({ row }: any) => {
|
||||||
|
return row.deviceName || '/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'manufacturer',
|
||||||
|
title: '厂家',
|
||||||
|
formatter: ({ row }: any) => {
|
||||||
|
return row.manufacturer || '/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'comFlag',
|
||||||
|
title: '通讯状态',
|
||||||
|
render: 'tag',
|
||||||
|
custom: {
|
||||||
|
0: 'danger',
|
||||||
|
1: 'success',
|
||||||
|
3: 'info'
|
||||||
|
},
|
||||||
|
replaceValue: {
|
||||||
|
0: '中断',
|
||||||
|
1: '正常',
|
||||||
|
3: '/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: '最新数据时间',
|
||||||
|
formatter: ({ row }: any) => {
|
||||||
|
return row.updateTime || '/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'integrityData',
|
||||||
|
title: '完整性(%)',
|
||||||
|
formatter: ({ row }: any) => {
|
||||||
|
return row.integrityData == 3.14159 ? '暂无数据' : row.integrityData.toFixed(2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'assess',
|
||||||
|
title: '评估',
|
||||||
|
render: 'tag',
|
||||||
|
custom: {
|
||||||
|
0: 'info',
|
||||||
|
1: 'danger',
|
||||||
|
2: 'warning',
|
||||||
|
3: 'success'
|
||||||
|
},
|
||||||
|
replaceValue: {
|
||||||
|
0: '暂无数据',
|
||||||
|
1: '不合格',
|
||||||
|
2: '合格',
|
||||||
|
3: '优秀'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
tableStore.options.column[0].title = tableStore.table.params.statisticalType.name
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
tableRef.value.getRef().setAllTreeExpand(true)
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||||
|
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||||
|
tableStore.table.data = treeData.value
|
||||||
|
tableStore.table.params.filterName = ''
|
||||||
|
searchEvent()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
tableStore.table.params.statisticalType = classificationData.filter(item => item.name == '电网拓扑')[0]
|
||||||
|
tableStore.table.params.monitorFlag = 2
|
||||||
|
tableStore.table.params.powerFlag = 2
|
||||||
|
tableStore.table.params.serverName = 'harmonicBoot'
|
||||||
|
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
const tree2List = (list: any, id: any) => {
|
||||||
|
//存储结果的数组
|
||||||
|
let arr: any = []
|
||||||
|
// 遍历 tree 数组
|
||||||
|
list.forEach((item: any) => {
|
||||||
|
item.uPid = id
|
||||||
|
item.uId = Math.random() * 1000
|
||||||
|
item.comFlag = item.comFlag == null ? 3 : item.comFlag
|
||||||
|
item.assess = item.integrityData == 3.14159 ? 0 : item.integrityData < 60 ? 1 : item.integrityData < 90 ? 2 : 3
|
||||||
|
// 判断item是否存在children
|
||||||
|
if (!item.children) return arr.push(item)
|
||||||
|
// 函数递归,对children数组进行tree2List的转换
|
||||||
|
const children = tree2List(item.children, item.uId)
|
||||||
|
// 删除item的children属性
|
||||||
|
delete item.children
|
||||||
|
// 把item和children数组添加至结果数组
|
||||||
|
//..children: 意思是把children数组展开
|
||||||
|
arr.push(item, ...children)
|
||||||
|
})
|
||||||
|
// 返回结果数组
|
||||||
|
return arr
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
const searchEvent = debounce(() => {
|
||||||
|
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
||||||
|
|
||||||
|
if (filterVal) {
|
||||||
|
const options = { children: 'children' }
|
||||||
|
const searchProps = ['name']
|
||||||
|
|
||||||
|
const rest = XEUtils.searchTree(
|
||||||
|
treeDataCopy.value,
|
||||||
|
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||||
|
options
|
||||||
|
)
|
||||||
|
console.log('🚀 ~ searchEvent ~ rest:', rest)
|
||||||
|
|
||||||
|
tableStore.table.data = rest
|
||||||
|
|
||||||
|
// 搜索之后默认展开所有子节点
|
||||||
|
} else {
|
||||||
|
tableStore.table.data = treeDataCopy.value
|
||||||
|
}
|
||||||
|
nextTick(() => {
|
||||||
|
const $table = tableRef.value.getRef()
|
||||||
|
if ($table) {
|
||||||
|
$table.setAllTreeExpand(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
const exportEvent = () => {
|
||||||
|
let line = tableRef.value.getRef().getRadioRecord()
|
||||||
|
if (!line) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'warning',
|
||||||
|
|
||||||
|
message: '请选择要导出的数据'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loading.value = true
|
||||||
|
let form = new FormData()
|
||||||
|
form.append('isUrl', false)
|
||||||
|
form.append('lineIndex', line.id)
|
||||||
|
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||||
|
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||||
|
form.append('type', 0)
|
||||||
|
form.append('name', line.name)
|
||||||
|
ElMessage({
|
||||||
|
message: '下载报告中,请稍等.....',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
exportModelJB(form)
|
||||||
|
.then(async res => {
|
||||||
|
let blob = new Blob([res], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||||
|
})
|
||||||
|
|
||||||
|
const url = window.URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a') // 创建a标签
|
||||||
|
link.href = url
|
||||||
|
link.download =
|
||||||
|
line.name +
|
||||||
|
TableHeaderRef.value.datePickerRef.timeValue[0] +
|
||||||
|
'_' +
|
||||||
|
TableHeaderRef.value.datePickerRef.timeValue[1] // 设置下载的文件名
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click() //执行下载
|
||||||
|
document.body.removeChild(link)
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
660
src/views/pqs/harmonicMonitoring/embed/lntegruty/index_JB.vue
Normal file
@@ -0,0 +1,660 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader date-picker ref="TableHeaderRef">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label="运行状态">
|
||||||
|
<el-select v-model="tableStore.table.params.lineRunFlag" clearable placeholder="请选择运行状态">
|
||||||
|
<el-option
|
||||||
|
v-for="item in runFlagList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="筛选数据">
|
||||||
|
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:operation>
|
||||||
|
<el-button type="primary" icon="el-icon-Download" @click="onExport">导出</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<div class="card-list pt10" v-loading="tableStore.table.loading">
|
||||||
|
<div class="monitoringPoints">
|
||||||
|
<el-card style="height: 200px">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>监测点统计</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">监测点总数</span>
|
||||||
|
<span
|
||||||
|
class="divBox_num text-style"
|
||||||
|
style="color: #57bc6e"
|
||||||
|
@click="totalTable(100001, '')"
|
||||||
|
>
|
||||||
|
{{ monitoringPoints.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox" style="width: 200px">
|
||||||
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
|
<span class="divBox_title">低于90%监测点数</span>
|
||||||
|
<span
|
||||||
|
class="divBox_num text-style"
|
||||||
|
style="color: #57bc6e"
|
||||||
|
@click="totalTable(90, '低于90%监测点_')"
|
||||||
|
>
|
||||||
|
{{ monitoringPoints.abnormalNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="echartTitle">
|
||||||
|
<div>总的数据完整性</div>
|
||||||
|
<div>
|
||||||
|
{{ monitoringPoints.totalOnlineRate > 100 ? 100 : monitoringPoints.totalOnlineRate }}%
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 30px">
|
||||||
|
<MyEchart :options="percentage"></MyEchart>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="mt10">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>完整性统计</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="mb5" style="height: 40px">
|
||||||
|
<el-segmented
|
||||||
|
style="height: 100%"
|
||||||
|
v-model="segmented"
|
||||||
|
:props="props"
|
||||||
|
:options="segmentedList"
|
||||||
|
block
|
||||||
|
@change="tableStore.index()"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<div>{{ scope.item.name }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-segmented>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<span style="width: 110px; text-align: left">
|
||||||
|
{{
|
||||||
|
segmented == 'Power_Network'
|
||||||
|
? '区域'
|
||||||
|
: segmented == 'Manufacturer'
|
||||||
|
? '终端厂家'
|
||||||
|
: '电网标志'
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span style="width: 90px">监测点总数</span>
|
||||||
|
<span style="flex: 1">低于90%监测点数</span>
|
||||||
|
<span style="width: 80px">完整性(%)</span>
|
||||||
|
</div>
|
||||||
|
<div :style="indicatorHeight" style="overflow-y: auto">
|
||||||
|
<div v-for="o in abnormal" class="abnormal mb10">
|
||||||
|
<span style="width: 110px; height: 24px" class="iconDiv">
|
||||||
|
<div :style="{ backgroundColor: o.citTotalOnlineRate < 90 ? '#FF9100' : '' }"></div>
|
||||||
|
{{ o.citName }}
|
||||||
|
</span>
|
||||||
|
<!-- 监测点总数 -->
|
||||||
|
<span
|
||||||
|
style="width: 90px; color: #388e3c"
|
||||||
|
class="text text-style"
|
||||||
|
@click="renderTable(o.detailList, 100001, o.citName + '_')"
|
||||||
|
>
|
||||||
|
{{ o.citTotalNum }}
|
||||||
|
</span>
|
||||||
|
<!-- 低于90%监测点数 -->
|
||||||
|
<span
|
||||||
|
style="flex: 1; color: #388e3c"
|
||||||
|
class="text text-style"
|
||||||
|
@click="renderTable(o.detailList, 90, o.citName + '_低于90%监测点_')"
|
||||||
|
>
|
||||||
|
{{ o.citBelowNum }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style="width: 80px; color: #388e3c"
|
||||||
|
:class="` ${o.citTotalOnlineRate < 90 ? 'text-red' : ''}`"
|
||||||
|
class="text"
|
||||||
|
>
|
||||||
|
{{ o.citTotalOnlineRate }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
<el-card class="detail ml10" :style="pageHeight">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>{{ title }}完整性详情</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!--表格-->
|
||||||
|
|
||||||
|
<div :style="{ height: tableStore.table.height }" v-loading="loading">
|
||||||
|
<vxe-table
|
||||||
|
height="auto"
|
||||||
|
:data="dataList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||||
|
v-bind="defaultAttribute"
|
||||||
|
ref="tableRef"
|
||||||
|
:scroll-y="{ enabled: true }"
|
||||||
|
>
|
||||||
|
<vxe-column type="seq" title="序号" width="80px">
|
||||||
|
<template #default="{ rowIndex }">
|
||||||
|
<span>
|
||||||
|
{{
|
||||||
|
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize +
|
||||||
|
rowIndex +
|
||||||
|
1
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="cit" title="所在地市" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="company" title="供电公司" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="subStation" title="变电站" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="manufacturer" title="终端厂家" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="deviceName" title="终端名称" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="130px"></vxe-column>
|
||||||
|
<vxe-column
|
||||||
|
field="lineName"
|
||||||
|
title="监测点名称"
|
||||||
|
:formatter="formatter"
|
||||||
|
minWidth="110px"
|
||||||
|
></vxe-column>
|
||||||
|
<vxe-column field="runFlag" title="运行状态" width="90px">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tag
|
||||||
|
:type="
|
||||||
|
row.runFlag == '运行'
|
||||||
|
? 'success'
|
||||||
|
: row.runFlag == '停运'
|
||||||
|
? 'danger'
|
||||||
|
: row.runFlag == '检修'
|
||||||
|
? 'warning'
|
||||||
|
: row.runFlag == '调试'
|
||||||
|
? 'warning'
|
||||||
|
: 'danger'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ row.runFlag }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="latestTime" title="最新数据时间" width="150px"></vxe-column>
|
||||||
|
<vxe-column field="integrity" title="完整性(%)" width="90px"></vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
<div class="table-pagination">
|
||||||
|
<el-pagination
|
||||||
|
v-model:currentPage="pageNum"
|
||||||
|
v-model:page-size="pageSize"
|
||||||
|
:page-sizes="[10, 20, 50, 100, 200]"
|
||||||
|
background
|
||||||
|
layout="sizes,total, ->, prev, pager, next, jumper"
|
||||||
|
:total="dataList.length"
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { onMounted, provide, ref } from 'vue'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import { getMonitorVerifyDay } from '@/api/device-boot/dataVerify'
|
||||||
|
defineOptions({
|
||||||
|
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||||
|
})
|
||||||
|
|
||||||
|
const dictData = useDictData()
|
||||||
|
//字典获取监督对象类型
|
||||||
|
const pageHeight = mainHeight(97)
|
||||||
|
const indicatorHeight = mainHeight(447)
|
||||||
|
const monitoringPoints = ref({
|
||||||
|
runNum: 0,
|
||||||
|
abnormalNum: 0,
|
||||||
|
totalOnlineRate: 0
|
||||||
|
})
|
||||||
|
const pageSize = ref(20)
|
||||||
|
const pageNum = ref(1)
|
||||||
|
const title = ref('')
|
||||||
|
const loading = ref(false)
|
||||||
|
const dataList = ref([])
|
||||||
|
const tableRef = ref()
|
||||||
|
const percentage = ref({})
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const abnormal: any = ref([])
|
||||||
|
const totalData: any = ref([])
|
||||||
|
//定义监测点运行状态下拉框数据
|
||||||
|
const runFlagList = [
|
||||||
|
{ id: 0, name: '运行' },
|
||||||
|
{ id: 1, name: '检修' },
|
||||||
|
{ id: 2, name: '停运' },
|
||||||
|
{ id: 3, name: '调试' },
|
||||||
|
{ id: 4, name: '退运' }
|
||||||
|
]
|
||||||
|
|
||||||
|
const segmented = ref('Power_Network')
|
||||||
|
|
||||||
|
const segmentedList = dictData.getBasicData('Statistical_Type', ['Report_Type', 'Voltage_Level', 'Load_Type'])
|
||||||
|
const props = {
|
||||||
|
value: 'code',
|
||||||
|
label: 'name'
|
||||||
|
}
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/device-boot/LineIntegrityData/data',
|
||||||
|
method: 'POST',
|
||||||
|
showPage: false,
|
||||||
|
publicHeight: 145,
|
||||||
|
column: [],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
tableStore.table.params.statisticalType = segmentedList.filter(item => item.code === segmented.value)[0]
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 合并子集数据 并去重
|
||||||
|
totalData.value = Array.from(
|
||||||
|
tableStore.table.data.citDetailList
|
||||||
|
.map((item: any) => item.detailList)
|
||||||
|
.flat()
|
||||||
|
.reduce((map: any, item: any) => {
|
||||||
|
if (!map.has(item.lineId)) {
|
||||||
|
map.set(item.lineId, item)
|
||||||
|
}
|
||||||
|
return map
|
||||||
|
}, new Map())
|
||||||
|
.values()
|
||||||
|
)
|
||||||
|
totalTable(100001, '')
|
||||||
|
echart()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const echart = () => {
|
||||||
|
percentage.value = {
|
||||||
|
color: ['#FF9100'],
|
||||||
|
options: {
|
||||||
|
dataZoom: null,
|
||||||
|
toolbox: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '0%',
|
||||||
|
left: '0%',
|
||||||
|
right: '0%',
|
||||||
|
bottom: '0%'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: false,
|
||||||
|
data: ['']
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
show: false,
|
||||||
|
type: 'value'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '异常总数',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 12,
|
||||||
|
data: [100],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '异常占比',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 13,
|
||||||
|
data: [
|
||||||
|
monitoringPoints.value.totalOnlineRate == 0
|
||||||
|
? ''
|
||||||
|
: monitoringPoints.value.totalOnlineRate > 100
|
||||||
|
? 100
|
||||||
|
: monitoringPoints.value.totalOnlineRate
|
||||||
|
],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: '#FF9100' // 0% 处的颜色
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#FF9100' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'pictorialBar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#fff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
symbolRepeat: 50,
|
||||||
|
// symbolMargin: 300,
|
||||||
|
symbol: 'rect',
|
||||||
|
symbolClip: true,
|
||||||
|
symbolSize: [2, 20],
|
||||||
|
symbolPosition: 'start',
|
||||||
|
symbolOffset: [0, 0],
|
||||||
|
data: [100],
|
||||||
|
z: 1,
|
||||||
|
zlevel: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bar',
|
||||||
|
barGap: '-110%',
|
||||||
|
data: [100],
|
||||||
|
barWidth: 18,
|
||||||
|
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: 'transparent',
|
||||||
|
barBorderColor: 'rgb(148,217,249)',
|
||||||
|
barBorderWidth: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
z: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
|
tableStore.table.params.searchValue = ''
|
||||||
|
|
||||||
|
const formatter = (row: any) => {
|
||||||
|
return row.cellValue || '/'
|
||||||
|
}
|
||||||
|
// 渲染总表格
|
||||||
|
const totalTable = (num: number, t: string) => {
|
||||||
|
title.value = t
|
||||||
|
loading.value = true
|
||||||
|
pageNum.value = 1
|
||||||
|
dataList.value = []
|
||||||
|
dataList.value = totalData.value.filter((item: any) => {
|
||||||
|
return item.integrity < num
|
||||||
|
})
|
||||||
|
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
// 渲染表格
|
||||||
|
const renderTable = (list: any, num: number, t: string) => {
|
||||||
|
title.value = t
|
||||||
|
loading.value = true
|
||||||
|
pageNum.value = 1
|
||||||
|
dataList.value = []
|
||||||
|
dataList.value = list.filter((item: any) => {
|
||||||
|
return item.integrity < num
|
||||||
|
})
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
// 导出
|
||||||
|
const onExport = () => {
|
||||||
|
tableRef.value?.exportData({
|
||||||
|
filename: title.value + '完整性详情', // 文件名字
|
||||||
|
sheetName: 'Sheet1',
|
||||||
|
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||||
|
useStyle: true,
|
||||||
|
data: dataList.value, // 数据源 // 过滤那个字段导出
|
||||||
|
columnFilterMethod: function (column: any) {
|
||||||
|
return !(
|
||||||
|
column.column.title === undefined ||
|
||||||
|
column.column.title === '序号' ||
|
||||||
|
column.column.title === '操作'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
// TableHeaderRef.value.setDatePicker([
|
||||||
|
// { label: '年份', value: 1 },
|
||||||
|
// { label: '季度', value: 2 },
|
||||||
|
// { label: '月份', value: 3 }
|
||||||
|
// ])
|
||||||
|
|
||||||
|
// 加载数据
|
||||||
|
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
|
||||||
|
tableStore.table.params.name = ''
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
|
.card-list {
|
||||||
|
display: flex;
|
||||||
|
.monitoringPoints {
|
||||||
|
width: 440px;
|
||||||
|
position: relative;
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.divBox {
|
||||||
|
width: 200px;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
&:nth-child(1) {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
background-color: #fff6ed;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
background-color: #e5f8f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.abnormal {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 5px 0px 5px 10px;
|
||||||
|
.iconDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
// font-feature-settings: 'tnum';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.iconFont {
|
||||||
|
font-size: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
position: relative;
|
||||||
|
.form_but {
|
||||||
|
position: absolute;
|
||||||
|
right: -22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
:deep(.table_name) {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
text-underline-offset: 4px;
|
||||||
|
}
|
||||||
|
.echartTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
div:nth-child(2) {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ff6600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-segmented__item-selected, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
:deep(.el-segmented__item, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
:deep(.el-segmented) {
|
||||||
|
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: #ff9100 !important;
|
||||||
|
}
|
||||||
|
.text-style {
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.segmentedIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
left: 100px;
|
||||||
|
height: 18px !important;
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #ff9100;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
.table-pagination {
|
||||||
|
height: 58px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
background-color: var(--ba-bg-color-overlay);
|
||||||
|
padding: 13px 15px;
|
||||||
|
border-left: 1px solid #e4e7e9;
|
||||||
|
border-right: 1px solid #e4e7e9;
|
||||||
|
border-bottom: 1px solid #e4e7e9;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -125,7 +125,7 @@ const tableStore = new TableStore({
|
|||||||
var tips = ''
|
var tips = ''
|
||||||
|
|
||||||
for (var i = 0; i < params.length; i++) {
|
for (var i = 0; i < params.length; i++) {
|
||||||
if (params[i].value == 1) {
|
if (params[i].value == 3.14159) {
|
||||||
tips += params[i].name + '</br>'
|
tips += params[i].name + '</br>'
|
||||||
tips += '在线率:暂无数据'
|
tips += '在线率:暂无数据'
|
||||||
} else {
|
} else {
|
||||||
@@ -161,7 +161,21 @@ const tableStore = new TableStore({
|
|||||||
|
|
||||||
// 定制显示(按顺序)
|
// 定制显示(按顺序)
|
||||||
color: function (params: any) {
|
color: function (params: any) {
|
||||||
if (params.value >= 90) {
|
if (params.value == 3.14159) {
|
||||||
|
return new echarts.graphic.LinearGradient(
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#ccc'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
false
|
||||||
|
)
|
||||||
|
} else if (params.value >= 90) {
|
||||||
return new echarts.graphic.LinearGradient(
|
return new echarts.graphic.LinearGradient(
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
@@ -203,20 +217,6 @@ const tableStore = new TableStore({
|
|||||||
],
|
],
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
} else if (params.value > 0 && params.value <= 1) {
|
|
||||||
return new echarts.graphic.LinearGradient(
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
[
|
|
||||||
{
|
|
||||||
offset: 1,
|
|
||||||
color: '#ccc'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
false
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<TableHeader area datePicker ref="TableHeaderRef">
|
<TableHeader area datePicker ref="TableHeaderRef">
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.filterName" @keyup="searchEvent" placeholder="输入关键字筛选" />
|
<el-input v-model="tableStore.table.params.filterName" @keyup="searchEvent" placeholder="输入关键字筛选" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="统计类型:">
|
<el-form-item label="统计类型:">
|
||||||
|
|||||||
651
src/views/pqs/harmonicMonitoring/embed/onlinerate/index_JB.vue
Normal file
@@ -0,0 +1,651 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader date-picker ref="TableHeaderRef">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label="运行状态">
|
||||||
|
<el-select v-model="tableStore.table.params.lineRunFlag" clearable placeholder="请选择运行状态">
|
||||||
|
<el-option
|
||||||
|
v-for="item in runFlagList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="筛选数据">
|
||||||
|
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入终端名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:operation>
|
||||||
|
<el-button type="primary" icon="el-icon-Download" @click="onExport">导出</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<div class="card-list pt10" v-loading="tableStore.table.loading">
|
||||||
|
<div class="monitoringPoints">
|
||||||
|
<el-card style="height: 200px">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>终端统计</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">终端总数</span>
|
||||||
|
<span
|
||||||
|
class="divBox_num text-style"
|
||||||
|
style="color: #57bc6e"
|
||||||
|
@click="totalTable(100001, '')"
|
||||||
|
>
|
||||||
|
{{ monitoringPoints.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox" style="width: 200px">
|
||||||
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
|
<span class="divBox_title">低于90%终端数</span>
|
||||||
|
<span
|
||||||
|
class="divBox_num text-style"
|
||||||
|
style="color: #57bc6e"
|
||||||
|
@click="totalTable(90, '低于90%终端_')"
|
||||||
|
>
|
||||||
|
{{ monitoringPoints.abnormalNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="echartTitle">
|
||||||
|
<div>总的数据在线率</div>
|
||||||
|
<div>{{ monitoringPoints.totalOnlineRate }}%</div>
|
||||||
|
</div>
|
||||||
|
<div style="height: 30px">
|
||||||
|
<MyEchart :options="percentage"></MyEchart>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="mt10">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>在线率统计</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div class="mb5" style="height: 40px">
|
||||||
|
<el-segmented
|
||||||
|
style="height: 100%"
|
||||||
|
v-model="segmented"
|
||||||
|
:props="props"
|
||||||
|
:options="segmentedList"
|
||||||
|
block
|
||||||
|
@change="tableStore.index()"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<div>{{ scope.item.name }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-segmented>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<span style="width: 110px; text-align: left">
|
||||||
|
{{
|
||||||
|
segmented == 'Power_Network'
|
||||||
|
? '区域'
|
||||||
|
: segmented == 'Manufacturer'
|
||||||
|
? '终端厂家'
|
||||||
|
: '电网标志'
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
<span style="width: 90px">终端总数</span>
|
||||||
|
<span style="flex: 1">低于90%终端数</span>
|
||||||
|
<span style="width: 80px">在线率(%)</span>
|
||||||
|
</div>
|
||||||
|
<div :style="indicatorHeight" style="overflow-y: auto">
|
||||||
|
<div v-for="o in abnormal" class="abnormal mb10">
|
||||||
|
<span style="width: 110px; height: 24px" class="iconDiv">
|
||||||
|
<div :style="{ backgroundColor: o.citTotalOnlineRate < 90 ? '#FF9100' : '' }"></div>
|
||||||
|
{{ o.citName }}
|
||||||
|
</span>
|
||||||
|
<!-- 终端总数 -->
|
||||||
|
<span
|
||||||
|
style="width: 90px; color: #388e3c"
|
||||||
|
class="text text-style"
|
||||||
|
@click="renderTable(o.detailList, 100001, o.citName + '_')"
|
||||||
|
>
|
||||||
|
{{ o.citTotalNum }}
|
||||||
|
</span>
|
||||||
|
<!-- 低于90%终端数 -->
|
||||||
|
<span
|
||||||
|
style="flex: 1; color: #388e3c"
|
||||||
|
class="text text-style"
|
||||||
|
@click="renderTable(o.detailList, 90, o.citName + '_低于90%终端_')"
|
||||||
|
>
|
||||||
|
{{ o.citBelowNum }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
style="width: 80px; color: #388e3c"
|
||||||
|
:class="` ${o.citTotalOnlineRate < 90 ? 'text-red' : ''}`"
|
||||||
|
class="text"
|
||||||
|
>
|
||||||
|
{{ o.citTotalOnlineRate }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
<el-card class="detail ml10" :style="pageHeight">
|
||||||
|
<template #header>
|
||||||
|
<div class="card-header">
|
||||||
|
<span>{{ title }}在线率详情</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!--表格-->
|
||||||
|
|
||||||
|
<div :style="{ height: tableStore.table.height }" v-loading="loading">
|
||||||
|
<vxe-table
|
||||||
|
height="auto"
|
||||||
|
:data="dataList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||||
|
v-bind="defaultAttribute"
|
||||||
|
ref="tableRef"
|
||||||
|
:scroll-y="{ enabled: true }"
|
||||||
|
>
|
||||||
|
<vxe-column type="seq" title="序号" width="80px">
|
||||||
|
<template #default="{ rowIndex }">
|
||||||
|
<span>
|
||||||
|
{{
|
||||||
|
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize +
|
||||||
|
rowIndex +
|
||||||
|
1
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="cit" title="所在地市" width="110px"></vxe-column>
|
||||||
|
<vxe-column field="company" title="供电公司" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="subStation" title="变电站" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="manufacturer" title="终端厂家" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="deviceName" title="终端名称" minWidth="110px"></vxe-column>
|
||||||
|
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="130px"></vxe-column>
|
||||||
|
<vxe-column field="runFlag" title="运行状态" width="90px">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tag
|
||||||
|
:type="
|
||||||
|
row.runFlag == '运行'
|
||||||
|
? 'success'
|
||||||
|
: row.runFlag == '停运'
|
||||||
|
? 'danger'
|
||||||
|
: row.runFlag == '检修'
|
||||||
|
? 'warning'
|
||||||
|
: row.runFlag == '调试'
|
||||||
|
? 'warning'
|
||||||
|
: 'danger'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ row.runFlag }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="onlineRate" title="在线率(%)" width="90px"></vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
<div class="table-pagination">
|
||||||
|
<el-pagination
|
||||||
|
v-model:currentPage="pageNum"
|
||||||
|
v-model:page-size="pageSize"
|
||||||
|
:page-sizes="[10, 20, 50, 100, 200]"
|
||||||
|
background
|
||||||
|
layout="sizes,total, ->, prev, pager, next, jumper"
|
||||||
|
:total="dataList.length"
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
// import '@/assets/font/iconfont.css'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { onMounted, provide, ref } from 'vue'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import { getMonitorVerifyDay } from '@/api/device-boot/dataVerify'
|
||||||
|
defineOptions({
|
||||||
|
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||||
|
})
|
||||||
|
|
||||||
|
const dictData = useDictData()
|
||||||
|
//字典获取监督对象类型
|
||||||
|
const pageHeight = mainHeight(97)
|
||||||
|
const indicatorHeight = mainHeight(447)
|
||||||
|
const monitoringPoints = ref({
|
||||||
|
runNum: 0,
|
||||||
|
abnormalNum: 0,
|
||||||
|
totalOnlineRate: 0
|
||||||
|
})
|
||||||
|
const pageSize = ref(20)
|
||||||
|
const pageNum = ref(1)
|
||||||
|
const title = ref('')
|
||||||
|
const loading = ref(false)
|
||||||
|
const dataList = ref([])
|
||||||
|
const tableRef = ref()
|
||||||
|
const percentage = ref({})
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const abnormal: any = ref([])
|
||||||
|
const totalData: any = ref([])
|
||||||
|
//定义终端运行状态下拉框数据
|
||||||
|
const runFlagList = [
|
||||||
|
{ id: 0, name: '运行' },
|
||||||
|
{ id: 1, name: '检修' },
|
||||||
|
{ id: 2, name: '停运' },
|
||||||
|
{ id: 3, name: '调试' },
|
||||||
|
{ id: 4, name: '退运' }
|
||||||
|
]
|
||||||
|
// Statistical_Type
|
||||||
|
|
||||||
|
const segmented = ref('Power_Network')
|
||||||
|
|
||||||
|
const segmentedList = dictData.getBasicData('Statistical_Type', ['Report_Type', 'Voltage_Level', 'Load_Type'])
|
||||||
|
const props = {
|
||||||
|
value: 'code',
|
||||||
|
label: 'name'
|
||||||
|
}
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/device-boot/onLineRate/deviceOnlineRateInfo',
|
||||||
|
method: 'POST',
|
||||||
|
showPage: false,
|
||||||
|
publicHeight: 145,
|
||||||
|
column: [],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
tableStore.table.params.statisticalType = segmentedList.filter(item => item.code === segmented.value)[0]
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(123, tableStore.table.params.statisticalType.name)
|
||||||
|
|
||||||
|
// 合并子集数据 并去重
|
||||||
|
totalData.value = Array.from(
|
||||||
|
tableStore.table.data.citDetailList
|
||||||
|
|
||||||
|
.map((item: any) => item.detailList)
|
||||||
|
.flat()
|
||||||
|
.reduce((map: any, item: any) => {
|
||||||
|
if (!map.has(item.deviceId)) {
|
||||||
|
map.set(item.deviceId, item)
|
||||||
|
}
|
||||||
|
return map
|
||||||
|
}, new Map())
|
||||||
|
.values()
|
||||||
|
)
|
||||||
|
|
||||||
|
totalTable(100001, '')
|
||||||
|
echart()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const echart = () => {
|
||||||
|
percentage.value = {
|
||||||
|
color: ['#FF9100'],
|
||||||
|
options: {
|
||||||
|
dataZoom: null,
|
||||||
|
toolbox: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '0%',
|
||||||
|
left: '0%',
|
||||||
|
right: '0%',
|
||||||
|
bottom: '0%'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
show: false,
|
||||||
|
data: ['']
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
show: false,
|
||||||
|
type: 'value'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '异常总数',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 12,
|
||||||
|
data: [100],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '异常占比',
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 13,
|
||||||
|
data: [monitoringPoints.value.totalOnlineRate == 0 ? '' : monitoringPoints.value.totalOnlineRate],
|
||||||
|
z: 0,
|
||||||
|
zlevel: 0,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 1,
|
||||||
|
y2: 0,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: '#FF9100' // 0% 处的颜色
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#FF9100' // 100% 处的颜色
|
||||||
|
}
|
||||||
|
],
|
||||||
|
global: false // 缺省为 false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'pictorialBar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#fff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
symbolRepeat: 50,
|
||||||
|
// symbolMargin: 300,
|
||||||
|
symbol: 'rect',
|
||||||
|
symbolClip: true,
|
||||||
|
symbolSize: [2, 20],
|
||||||
|
symbolPosition: 'start',
|
||||||
|
symbolOffset: [0, 0],
|
||||||
|
data: [100],
|
||||||
|
z: 1,
|
||||||
|
zlevel: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
type: 'bar',
|
||||||
|
barGap: '-110%',
|
||||||
|
data: [100],
|
||||||
|
barWidth: 18,
|
||||||
|
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: 'transparent',
|
||||||
|
barBorderColor: 'rgb(148,217,249)',
|
||||||
|
barBorderWidth: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
z: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
|
tableStore.table.params.searchValue = ''
|
||||||
|
|
||||||
|
const formatter = (row: any) => {
|
||||||
|
return row.cellValue || '/'
|
||||||
|
}
|
||||||
|
// 渲染总表格
|
||||||
|
const totalTable = (num: number, t: string) => {
|
||||||
|
title.value = t
|
||||||
|
loading.value = true
|
||||||
|
pageNum.value = 1
|
||||||
|
dataList.value = []
|
||||||
|
dataList.value = totalData.value.filter((item: any) => {
|
||||||
|
return item.onlineRate < num
|
||||||
|
})
|
||||||
|
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
// 渲染表格
|
||||||
|
const renderTable = (list: any, num: number, t: string) => {
|
||||||
|
title.value = t
|
||||||
|
loading.value = true
|
||||||
|
pageNum.value = 1
|
||||||
|
dataList.value = []
|
||||||
|
dataList.value = list.filter((item: any) => {
|
||||||
|
return item.onlineRate < num
|
||||||
|
})
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
// 导出
|
||||||
|
const onExport = () => {
|
||||||
|
tableRef.value?.exportData({
|
||||||
|
filename: title.value + '在线率详情', // 文件名字
|
||||||
|
sheetName: 'Sheet1',
|
||||||
|
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||||
|
useStyle: true,
|
||||||
|
data: dataList.value, // 数据源 // 过滤那个字段导出
|
||||||
|
columnFilterMethod: function (column: any) {
|
||||||
|
return !(
|
||||||
|
column.column.title === undefined ||
|
||||||
|
column.column.title === '序号' ||
|
||||||
|
column.column.title === '操作'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
// TableHeaderRef.value.setDatePicker([
|
||||||
|
// { label: '年份', value: 1 },
|
||||||
|
// { label: '季度', value: 2 },
|
||||||
|
// { label: '月份', value: 3 }
|
||||||
|
// ])
|
||||||
|
|
||||||
|
// 加载数据
|
||||||
|
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
|
||||||
|
tableStore.table.params.name = ''
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
|
.card-list {
|
||||||
|
display: flex;
|
||||||
|
.monitoringPoints {
|
||||||
|
width: 440px;
|
||||||
|
position: relative;
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.divBox {
|
||||||
|
width: 200px;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
&:nth-child(1) {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
background-color: #fff6ed;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
background-color: #e5f8f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.abnormal {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #f3f6f9;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 5px 0px 5px 10px;
|
||||||
|
.iconDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div {
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
// font-feature-settings: 'tnum';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 10px;
|
||||||
|
span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.iconFont {
|
||||||
|
font-size: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
position: relative;
|
||||||
|
.form_but {
|
||||||
|
position: absolute;
|
||||||
|
right: -22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
:deep(.table_name) {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
text-underline-offset: 4px;
|
||||||
|
}
|
||||||
|
.echartTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
div:nth-child(2) {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #ff6600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-segmented__item-selected, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
:deep(.el-segmented__item, ) {
|
||||||
|
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
:deep(.el-segmented) {
|
||||||
|
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||||
|
}
|
||||||
|
.text-red {
|
||||||
|
color: #ff9100 !important;
|
||||||
|
}
|
||||||
|
.text-style {
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.segmentedIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
left: 100px;
|
||||||
|
height: 18px !important;
|
||||||
|
line-height: 19px;
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
background: #ff9100;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
.table-pagination {
|
||||||
|
height: 58px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
background-color: var(--ba-bg-color-overlay);
|
||||||
|
padding: 13px 15px;
|
||||||
|
border-left: 1px solid #e4e7e9;
|
||||||
|
border-right: 1px solid #e4e7e9;
|
||||||
|
border-bottom: 1px solid #e4e7e9;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<el-form-item label="多监测点">
|
<el-form-item label="多监测点">
|
||||||
<el-checkbox v-model="checked" @change="checkChange" />
|
<el-checkbox v-model="checked" @change="checkChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef" ></DatePicker>
|
<DatePicker ref="datePickerRef" ></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="指标类型:">
|
<el-form-item label="指标类型:">
|
||||||
|
|||||||
@@ -44,6 +44,9 @@
|
|||||||
<el-tab-pane label="实时数据" name="7" lazy v-if="!isReload && !VITE_FLAG">
|
<el-tab-pane label="实时数据" name="7" lazy v-if="!isReload && !VITE_FLAG">
|
||||||
<Shishishuju v-if="activeName == '7'" />
|
<Shishishuju v-if="activeName == '7'" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="统计报表" name="8" lazy v-if="!isReload && VITE_FLAG">
|
||||||
|
<StatisticalReport v-if="activeName == '8'" />
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<!-- <div
|
<!-- <div
|
||||||
class="monitoring-point"
|
class="monitoring-point"
|
||||||
@@ -70,6 +73,7 @@ import Xiebopingpu from './xiebopingpu/index.vue'
|
|||||||
import Gaojingshujutongji from './gaojingshujutongji/index.vue'
|
import Gaojingshujutongji from './gaojingshujutongji/index.vue'
|
||||||
import Yunxingzhuangtai from './yunxingzhuangtai/index.vue'
|
import Yunxingzhuangtai from './yunxingzhuangtai/index.vue'
|
||||||
import Shishishuju from './shishishuju/index.vue'
|
import Shishishuju from './shishishuju/index.vue'
|
||||||
|
import StatisticalReport from './statisticalReport/index.vue'
|
||||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
@@ -79,14 +83,14 @@ defineOptions({
|
|||||||
|
|
||||||
const monitoringPoint = useMonitoringPoint()
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const pointTree = ref()
|
const pointTree = ref()
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const isReload = ref(false)
|
const isReload = ref(false)
|
||||||
const height = mainHeight(40)
|
const height = mainHeight(40)
|
||||||
const activeName = ref('2')
|
const activeName = ref('2')
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
|
|||||||
@@ -652,7 +652,7 @@ const initRadioCharts = () => {
|
|||||||
echartsData1.value.options.series[i].center = ['50%', '50%']
|
echartsData1.value.options.series[i].center = ['50%', '50%']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const initEcharts = (color: string, key: number) => {
|
const initEcharts = (color: string, key: number, name: string) => {
|
||||||
return {
|
return {
|
||||||
options: {
|
options: {
|
||||||
tooltip: {},
|
tooltip: {},
|
||||||
@@ -731,7 +731,7 @@ const initEcharts = (color: string, key: number) => {
|
|||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
value: 0,
|
value: 0,
|
||||||
name: 'A相',
|
name: name,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: color
|
color: color
|
||||||
}
|
}
|
||||||
@@ -744,14 +744,14 @@ const initEcharts = (color: string, key: number) => {
|
|||||||
}
|
}
|
||||||
//渲染echarts
|
//渲染echarts
|
||||||
const init = () => {
|
const init = () => {
|
||||||
const url = (localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/')
|
const url = localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/'
|
||||||
echartsDataV1.value = initEcharts('#DAA520', 0)
|
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
||||||
echartsDataV2.value = initEcharts('#2E8B57', 0)
|
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
||||||
echartsDataV3.value = initEcharts('#A52a2a', 0)
|
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
||||||
|
|
||||||
echartsDataA1.value = initEcharts('#DAA520', 1)
|
echartsDataA1.value = initEcharts('#DAA520', 1, 'A相')
|
||||||
echartsDataA2.value = initEcharts('#2E8B57', 1)
|
echartsDataA2.value = initEcharts('#2E8B57', 1, 'B相')
|
||||||
echartsDataA3.value = initEcharts('#A52a2a', 1)
|
echartsDataA3.value = initEcharts('#A52a2a', 1, 'C相')
|
||||||
|
|
||||||
if (!dataSocket.socketServe) {
|
if (!dataSocket.socketServe) {
|
||||||
console.error('WebSocket 客户端实例不存在')
|
console.error('WebSocket 客户端实例不存在')
|
||||||
@@ -764,9 +764,7 @@ const url = (localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/ap
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
let pids = monitoringPoint.state.pid.split(',')
|
let pids = monitoringPoint.state.pid.split(',')
|
||||||
dataSocket.socketServe.connect(
|
dataSocket.socketServe.connect(`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`)
|
||||||
`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`
|
|
||||||
)
|
|
||||||
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||||
txtContent.value = res.value
|
txtContent.value = res.value
|
||||||
let data = JSON.parse(res.value)
|
let data = JSON.parse(res.value)
|
||||||
|
|||||||
@@ -0,0 +1,184 @@
|
|||||||
|
<template>
|
||||||
|
<div class="" :style="height">
|
||||||
|
<TableHeader ref="TableHeaderRef" datePicker @selectChange="selectChange">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label="模板策略">
|
||||||
|
<el-select v-model="Template" @change="changetype" placeholder="请选择模版" value-key="id">
|
||||||
|
<el-option
|
||||||
|
v-for="item in templatePolicy"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="报表类型">
|
||||||
|
<el-input readonly type="text" value="分析报表"></el-input>
|
||||||
|
<!-- <el-select-->
|
||||||
|
<!-- :disabled="true"-->
|
||||||
|
<!-- v-model="reportForm"-->
|
||||||
|
<!-- :popper-append-to-body="false"-->
|
||||||
|
<!-- placeholder="请选择报表类型"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <el-option-->
|
||||||
|
<!-- v-for="item in reportFormList"-->
|
||||||
|
<!-- :key="item.value"-->
|
||||||
|
<!-- :label="item.label"-->
|
||||||
|
<!-- :value="item.value"-->
|
||||||
|
<!-- ></el-option>-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
<template #operation>
|
||||||
|
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
|
||||||
|
<el-button icon="el-icon-Download" :loading="loading" @click="exportReport" type="primary">
|
||||||
|
下载报告
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<div class="box">
|
||||||
|
<div id="luckysheet" :style="`height: calc(${tableStore.table.height} )`"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref, provide } from 'vue'
|
||||||
|
import 'splitpanes/dist/splitpanes.css'
|
||||||
|
import { Splitpanes, Pane } from 'splitpanes'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { exportModelJB } from '@/api/harmonic-boot/harmonic'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel'
|
||||||
|
import { exportExcel } from '@/views/system/reportForms/export.js'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||||
|
defineOptions({
|
||||||
|
name: 'harmonic-boot/xieboReport'
|
||||||
|
})
|
||||||
|
const monitoringPoint = useMonitoringPoint()
|
||||||
|
const showTree = ref(false)
|
||||||
|
const height = mainHeight(20)
|
||||||
|
const size = ref(23)
|
||||||
|
const dictData = useDictData()
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const dotList: any = ref({})
|
||||||
|
const Template: any = ref({})
|
||||||
|
const reportForm: any = ref('')
|
||||||
|
|
||||||
|
const templatePolicy: any = ref([])
|
||||||
|
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/harmonic-boot/customReport/getCustomReport',
|
||||||
|
method: 'POST',
|
||||||
|
column: [],
|
||||||
|
publicHeight: 30,
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
tableStore.table.params.tempId = Template.value.id
|
||||||
|
tableStore.table.params.lineId = monitoringPoint.state.lineId
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
tableStore.table.data.forEach((item: any) => {
|
||||||
|
item.data1 ? (item.data = JSON.parse(item.data1)) : ''
|
||||||
|
item.celldata.forEach((k: any) => {
|
||||||
|
item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v) : ''
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(tableStore.table.data)
|
||||||
|
setTimeout(() => {
|
||||||
|
luckysheet.create({
|
||||||
|
container: 'luckysheet',
|
||||||
|
title: '', // 表 头名
|
||||||
|
lang: 'zh', // 中文
|
||||||
|
showtoolbar: false, // 是否显示工具栏
|
||||||
|
showinfobar: false, // 是否显示顶部信息栏
|
||||||
|
showsheetbar: true, // 是否显示底部sheet按钮
|
||||||
|
allowEdit: false, // 禁止所有编辑操作(必填)
|
||||||
|
data: tableStore.table.data
|
||||||
|
})
|
||||||
|
}, 10)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const loading = ref(false)
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
|
if (dom) {
|
||||||
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getTemplateByDept({ id: dictData.state.area[0].id })
|
||||||
|
.then((res: any) => {
|
||||||
|
templatePolicy.value = res.data
|
||||||
|
Template.value = res.data[0]
|
||||||
|
reportForm.value = res.data[0]?.reportForm
|
||||||
|
showTree.value = true
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
.catch((err: any) => {
|
||||||
|
showTree.value = true
|
||||||
|
})
|
||||||
|
const changetype = (val: any) => {
|
||||||
|
reportForm.value = val.reportForm
|
||||||
|
}
|
||||||
|
const selectChange = () => {
|
||||||
|
console.log('🚀 ~ selectChange ~ tableStore.table.data.lnegth :', tableStore.table.data.length)
|
||||||
|
if (tableStore.table.data.length != 0) {
|
||||||
|
setTimeout(() => {
|
||||||
|
luckysheet && luckysheet?.resize()
|
||||||
|
}, 10)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const exportEvent = () => {
|
||||||
|
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
|
||||||
|
}
|
||||||
|
const exportReport = () => {
|
||||||
|
loading.value = true
|
||||||
|
let form = new FormData()
|
||||||
|
form.append('isUrl', false)
|
||||||
|
form.append('lineIndex', dotList.value.id)
|
||||||
|
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||||
|
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||||
|
form.append('type', 0)
|
||||||
|
form.append('name', dotList.value.name)
|
||||||
|
ElMessage({
|
||||||
|
message: '下载报告中,请稍等.....',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
exportModelJB(form)
|
||||||
|
.then(async res => {
|
||||||
|
let blob = new Blob([res], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||||
|
})
|
||||||
|
|
||||||
|
const url = window.URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a') // 创建a标签
|
||||||
|
link.href = url
|
||||||
|
link.download =
|
||||||
|
dotList.value.name +
|
||||||
|
TableHeaderRef.value.datePickerRef.timeValue[0] +
|
||||||
|
'_' +
|
||||||
|
TableHeaderRef.value.datePickerRef.timeValue[1] // 设置下载的文件名
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click() //执行下载
|
||||||
|
document.body.removeChild(link)
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.splitpanes.default-theme .splitpanes__pane {
|
||||||
|
background: #eaeef1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<el-form-item label="多监测点">
|
<el-form-item label="多监测点">
|
||||||
<el-checkbox v-model="checked" @change="checkChange" />
|
<el-checkbox v-model="checked" @change="checkChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef" :theCurrentTime="true"></DatePicker>
|
<DatePicker ref="datePickerRef" :theCurrentTime="true"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="指标类型:">
|
<el-form-item label="指标类型:">
|
||||||
@@ -67,7 +67,13 @@
|
|||||||
<!-- <el-form :inline="true">
|
<!-- <el-form :inline="true">
|
||||||
|
|
||||||
</el-form> -->
|
</el-form> -->
|
||||||
<div id="canvas" class="mt10" :style="height1" style="overflow-y: auto;overflow-x: hidden" v-loading="loading">
|
<div
|
||||||
|
id="canvas"
|
||||||
|
class="mt10"
|
||||||
|
:style="height1"
|
||||||
|
style="overflow-y: auto; overflow-x: hidden"
|
||||||
|
v-loading="loading"
|
||||||
|
>
|
||||||
<my-echart
|
<my-echart
|
||||||
:options="item.option"
|
:options="item.option"
|
||||||
v-for="item in list"
|
v-for="item in list"
|
||||||
@@ -98,7 +104,7 @@ import TableStore from '@/utils/tableStore'
|
|||||||
import waveForm from '@/components/echarts/waveForm.vue'
|
import waveForm from '@/components/echarts/waveForm.vue'
|
||||||
import html2canvas from 'html2canvas'
|
import html2canvas from 'html2canvas'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { yMethod } from '@/utils/echartMethod'
|
import { yMethod, completeTimeSeries } from '@/utils/echartMethod'
|
||||||
import * as echarts from 'echarts' // 全引入
|
import * as echarts from 'echarts' // 全引入
|
||||||
import { min } from 'xe-utils'
|
import { min } from 'xe-utils'
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
@@ -1520,22 +1526,42 @@ const getEcharts = () => {
|
|||||||
let str = (params[i].value[1] * 1).toString()
|
let str = (params[i].value[1] * 1).toString()
|
||||||
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
||||||
let str1 = str.replace(reg, '$1,')
|
let str1 = str.replace(reg, '$1,')
|
||||||
tips += params[i].marker + params[i].seriesName.replace('(kV)', '') + ':' + str1 + 'kV<br/>'
|
tips +=
|
||||||
|
params[i].marker +
|
||||||
|
params[i].seriesName.replace('(kV)', '') +
|
||||||
|
':' +
|
||||||
|
(Number.isNaN(Number(str1)) ? '/' : str1) +
|
||||||
|
'kV<br/>'
|
||||||
} else if (params[i].seriesName == '零序电压(V)' || params[i].seriesName == '负序电压(V)') {
|
} else if (params[i].seriesName == '零序电压(V)' || params[i].seriesName == '负序电压(V)') {
|
||||||
let str = (params[i].value[1] * 1).toString()
|
let str = (params[i].value[1] * 1).toString()
|
||||||
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
||||||
let str1 = str.replace(reg, '$1,')
|
let str1 = str.replace(reg, '$1,')
|
||||||
tips += params[i].marker + params[i].seriesName.replace('(V)', '') + ':' + str1 + 'V<br/>'
|
tips +=
|
||||||
|
params[i].marker +
|
||||||
|
params[i].seriesName.replace('(V)', '') +
|
||||||
|
':' +
|
||||||
|
(Number.isNaN(Number(str1)) ? '/' : str1) +
|
||||||
|
'V<br/>'
|
||||||
} else if (params[i].seriesName !== '正序电压(kV)') {
|
} else if (params[i].seriesName !== '正序电压(kV)') {
|
||||||
let str = (params[i].value[1] * 1).toString()
|
let str = (params[i].value[1] * 1).toString()
|
||||||
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
||||||
let str1 = str.replace(reg, '$1,')
|
let str1 = str.replace(reg, '$1,')
|
||||||
tips += params[i].marker + params[i].seriesName + ':' + str1 + '<br/>'
|
tips +=
|
||||||
|
params[i].marker +
|
||||||
|
params[i].seriesName +
|
||||||
|
':' +
|
||||||
|
(Number.isNaN(Number(str1)) ? '/' : str1) +
|
||||||
|
'<br/>'
|
||||||
} else {
|
} else {
|
||||||
let str = (params[i].value[2] * 1).toString()
|
let str = (params[i].value[2] * 1).toString()
|
||||||
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
||||||
let str1 = str.replace(reg, '$1,')
|
let str1 = str.replace(reg, '$1,')
|
||||||
tips += params[i].marker + params[i].seriesName + ':' + str1 + '<br/>'
|
tips +=
|
||||||
|
params[i].marker +
|
||||||
|
params[i].seriesName +
|
||||||
|
':' +
|
||||||
|
(Number.isNaN(Number(str1)) ? '/' : str1) +
|
||||||
|
'<br/>'
|
||||||
|
|
||||||
let str2 = (params[i].value[3] * 1).toString()
|
let str2 = (params[i].value[3] * 1).toString()
|
||||||
let reg2 = str2.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
let reg2 = str2.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
|
||||||
@@ -1543,7 +1569,12 @@ const getEcharts = () => {
|
|||||||
// if(params[i].seriesName){
|
// if(params[i].seriesName){
|
||||||
|
|
||||||
// }
|
// }
|
||||||
tips += params[i].marker + params[i].seriesName + ':' + str12 + '<br/>'
|
tips +=
|
||||||
|
params[i].marker +
|
||||||
|
params[i].seriesName +
|
||||||
|
':' +
|
||||||
|
(Number.isNaN(Number(str2)) ? '/' : str2) +
|
||||||
|
'<br/>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<el-form-item label="多监测点">
|
<el-form-item label="多监测点">
|
||||||
<el-checkbox v-model="checked" @change="checkChange" />
|
<el-checkbox v-model="checked" @change="checkChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="指标类型:">
|
<el-form-item label="指标类型:">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div style="display: flex; flex-direction: column; height: 100%">
|
<div style="display: flex; flex-direction: column; height: 100%">
|
||||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="对比">
|
<el-form-item label="对比">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="display: flex; flex-direction: column; height: 100%">
|
<div style="display: flex; flex-direction: column; height: 100%">
|
||||||
<el-form :inline="true">
|
<el-form :inline="true">
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div style="display: flex; flex-direction: column; height: 100%">
|
<div style="display: flex; flex-direction: column; height: 100%">
|
||||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="指标">
|
<el-form-item label="指标">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div style="display: flex; flex-direction: column; height: 100%">
|
<div style="display: flex; flex-direction: column; height: 100%">
|
||||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="对比">
|
<el-form-item label="对比">
|
||||||
|
|||||||
@@ -41,6 +41,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
|
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
|
||||||
|
<el-button icon="el-icon-Download" :loading="loading" @click="exportReport" type="primary">
|
||||||
|
下载报告
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -58,16 +61,17 @@ import TableStore from '@/utils/tableStore'
|
|||||||
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { exportModelJB } from '@/api/harmonic-boot/harmonic'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel'
|
import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel'
|
||||||
import { exportExcel } from '@/views/system/reportForms/export.js'
|
import { exportExcel } from '@/views/system/reportForms/export.js'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'harmonic-boot/xieboReport'
|
name: 'harmonic-boot/xieboReport'
|
||||||
})
|
})
|
||||||
const showTree = ref(false)
|
const showTree = ref(false)
|
||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
@@ -113,17 +117,19 @@ const tableStore = new TableStore({
|
|||||||
showtoolbar: false, // 是否显示工具栏
|
showtoolbar: false, // 是否显示工具栏
|
||||||
showinfobar: false, // 是否显示顶部信息栏
|
showinfobar: false, // 是否显示顶部信息栏
|
||||||
showsheetbar: true, // 是否显示底部sheet按钮
|
showsheetbar: true, // 是否显示底部sheet按钮
|
||||||
|
allowEdit: false, // 禁止所有编辑操作(必填)
|
||||||
data: tableStore.table.data
|
data: tableStore.table.data
|
||||||
})
|
})
|
||||||
}, 10)
|
}, 10)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const loading = ref(false)
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
getTemplateByDept({ id: dictData.state.area[0].id })
|
getTemplateByDept({ id: dictData.state.area[0].id })
|
||||||
@@ -158,6 +164,42 @@ const handleNodeClick = (data: any, node: any) => {
|
|||||||
const exportEvent = () => {
|
const exportEvent = () => {
|
||||||
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
|
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
|
||||||
}
|
}
|
||||||
|
const exportReport = () => {
|
||||||
|
loading.value = true
|
||||||
|
let form = new FormData()
|
||||||
|
form.append('isUrl', false)
|
||||||
|
form.append('lineIndex', dotList.value.id)
|
||||||
|
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||||
|
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||||
|
form.append('type', 0)
|
||||||
|
form.append('name', dotList.value.name)
|
||||||
|
ElMessage({
|
||||||
|
message: '下载报告中,请稍等.....',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
exportModelJB(form)
|
||||||
|
.then(async res => {
|
||||||
|
let blob = new Blob([res], {
|
||||||
|
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||||
|
})
|
||||||
|
|
||||||
|
const url = window.URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a') // 创建a标签
|
||||||
|
link.href = url
|
||||||
|
link.download =
|
||||||
|
dotList.value.name +
|
||||||
|
TableHeaderRef.value.datePickerRef.timeValue[0] +
|
||||||
|
'_' +
|
||||||
|
TableHeaderRef.value.datePickerRef.timeValue[1] // 设置下载的文件名
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click() //执行下载
|
||||||
|
document.body.removeChild(link)
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.splitpanes.default-theme .splitpanes__pane {
|
.splitpanes.default-theme .splitpanes__pane {
|
||||||
|
|||||||
@@ -1,36 +1,58 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='default-main' :style='height'>
|
<div class="default-main" :style="height">
|
||||||
<splitpanes style='height: 100%' class='default-theme' id='navigation-splitpanes'>
|
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||||
<pane :size='size'>
|
<pane :size="size">
|
||||||
<PointTree :default-expand-all='false' @node-click='handleNodeClick' @init='handleNodeClick'>
|
<PointTree
|
||||||
</PointTree>
|
:default-expand-all="false"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
@init="handleNodeClick"
|
||||||
|
></PointTree>
|
||||||
</pane>
|
</pane>
|
||||||
<pane style='background: #fff' :style='height'>
|
<pane style="background: #fff" :style="height">
|
||||||
<TableHeader ref='TableHeaderRef' datePicker :show-search='false'>
|
<TableHeader ref="TableHeaderRef" datePicker :show-search="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label='客户名称'>
|
<el-form-item label="客户名称">
|
||||||
<el-input v-model='tableStore.table.params.crmName' maxlength='32' show-word-limit clearable
|
<el-input
|
||||||
placeholder='请输入客户名称' />
|
v-model="tableStore.table.params.crmName"
|
||||||
|
maxlength="32"
|
||||||
|
show-word-limit
|
||||||
|
clearable
|
||||||
|
placeholder="请输入客户名称"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='报表编号'>
|
<el-form-item label="报表编号">
|
||||||
<el-input v-model='tableStore.table.params.reportNumber' clearable
|
<el-input
|
||||||
placeholder='请输入报表编号' maxlength='12' show-word-limit />
|
v-model="tableStore.table.params.reportNumber"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入报表编号"
|
||||||
|
maxlength="12"
|
||||||
|
show-word-limit
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-upload :show-file-list='false' ref='uploadRef' action='' accept='.png,.jpg'
|
<el-upload
|
||||||
:on-change='choose' :auto-upload='false'>
|
:show-file-list="false"
|
||||||
|
ref="uploadRef"
|
||||||
|
action=""
|
||||||
|
accept=".png,.jpg"
|
||||||
|
:on-change="choose"
|
||||||
|
:auto-upload="false"
|
||||||
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-button icon='el-icon-Upload' type='primary' class='mr10 ml10'>上传接线图</el-button>
|
<el-button icon="el-icon-Upload" type="primary" class="mr10 ml10">上传接线图</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button icon='el-icon-Download' type='primary' @click='exportEvent'>生成</el-button>
|
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<div class='box'>
|
<div class="box">
|
||||||
<div id='luckysheet'>
|
<div id="luckysheet">
|
||||||
<img width='100%' :style='`height: calc(${tableStore.table.height} + 40px)`'
|
<img
|
||||||
src='@/assets/img/jss.png' />
|
width="100%"
|
||||||
|
:style="`height: calc(${tableStore.table.height} + 40px)`"
|
||||||
|
src="@/assets/img/jss.png"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</pane>
|
</pane>
|
||||||
@@ -38,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, provide } from 'vue'
|
import { onMounted, ref, provide } from 'vue'
|
||||||
import 'splitpanes/dist/splitpanes.css'
|
import 'splitpanes/dist/splitpanes.css'
|
||||||
import { Splitpanes, Pane } from 'splitpanes'
|
import { Splitpanes, Pane } from 'splitpanes'
|
||||||
@@ -55,7 +77,7 @@ defineOptions({
|
|||||||
// name: 'harmonic-boot/report/word'
|
// name: 'harmonic-boot/report/word'
|
||||||
})
|
})
|
||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const size = ref(0)
|
const size = ref(23)
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
@@ -66,24 +88,19 @@ const tableStore = new TableStore({
|
|||||||
url: '',
|
url: '',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [],
|
column: [],
|
||||||
beforeSearchFun: () => {
|
beforeSearchFun: () => {},
|
||||||
},
|
loadCallback: () => {}
|
||||||
loadCallback: () => {
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
|
|
||||||
|
|
||||||
if (dom) {
|
if (dom) {
|
||||||
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
dotList.value = data
|
dotList.value = data
|
||||||
}
|
}
|
||||||
@@ -117,12 +134,15 @@ const exportEvent = () => {
|
|||||||
form.append('file', uploadList.value?.raw || '')
|
form.append('file', uploadList.value?.raw || '')
|
||||||
// 特殊字符正则表达式
|
// 特殊字符正则表达式
|
||||||
const specialCharRegex = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/
|
const specialCharRegex = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/
|
||||||
if (specialCharRegex.test(tableStore.table.params.crmName) || specialCharRegex.test(tableStore.table.params.reportNumber)) {
|
if (
|
||||||
|
specialCharRegex.test(tableStore.table.params.crmName) ||
|
||||||
|
specialCharRegex.test(tableStore.table.params.reportNumber)
|
||||||
|
) {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: '包含特殊字符,请注意修改!'
|
message: '包含特殊字符,请注意修改!'
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
ElMessage('生成报告中...')
|
ElMessage('生成报告中...')
|
||||||
exportModel(form).then((res: any) => {
|
exportModel(form).then((res: any) => {
|
||||||
let blob = new Blob([res], {
|
let blob = new Blob([res], {
|
||||||
@@ -138,10 +158,9 @@ const exportEvent = () => {
|
|||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
.splitpanes.default-theme .splitpanes__pane {
|
.splitpanes.default-theme .splitpanes__pane {
|
||||||
background: #eaeef1;
|
background: #eaeef1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="365px" :data="tableData">
|
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="365px" :data="tableData">
|
||||||
<vxe-column field="deptName" title="区域" />
|
<vxe-column field="deptName" title="区域" />
|
||||||
<vxe-column sortable field="onlineNum" title="在线监测点数量(个)" />
|
<vxe-column sortable field="onlineNum" title="在运监测点数(个)" />
|
||||||
<vxe-column sortable field="overNum" title="超标监测点数量(个)" />
|
<vxe-column sortable field="overNum" title="超标监测点数量(个)" />
|
||||||
<vxe-column sortable field="overRatio" title="超标监测点占比(%)" />
|
<vxe-column sortable field="overRatio" title="超标监测点占比(%)" />
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ const url: any = [
|
|||||||
new URL(`@/assets/img/SB.png`, import.meta.url)
|
new URL(`@/assets/img/SB.png`, import.meta.url)
|
||||||
]
|
]
|
||||||
const tableData: any = ref([])
|
const tableData: any = ref([])
|
||||||
const title = ['电压偏差(超标)', '频率偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
|
const title = ['频率偏差(超标)', '电压偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
|
||||||
|
|
||||||
const echart = (row: any) => {
|
const echart = (row: any) => {
|
||||||
let maxList: any = []
|
let maxList: any = []
|
||||||
|
|||||||
@@ -6,20 +6,21 @@
|
|||||||
<div class="title">
|
<div class="title">
|
||||||
<span>
|
<span>
|
||||||
稳态综合评估
|
稳态综合评估
|
||||||
<el-popover placement="right" :width="150" trigger="hover">
|
<el-popover placement="right" :width="190" trigger="hover">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<WarningFilled class="WarningFilled" />
|
<WarningFilled class="WarningFilled" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<span style="color: #00b07d">优质:(4.5 , 5]</span>
|
<span style="color: #00B07D">无污染:0</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #2b7fd3">良好:(4 , 4.5]</span>
|
<span style="color: #3399ff">轻微污染:(0 , 100]</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #ffcc33">合格:(3 , 4]</span>
|
<span style="color: #ffcc33">轻度污染:(100 , 1000]</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #97017e">较差:(2 , 3]</span>
|
<span style="color: #ff9900">中度污染:(1000 , 10000]</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #A52a2a">极差:[1 , 2]</span>
|
<span style="color: #A52a2a">重度污染:(10000</span>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</span>
|
</span>
|
||||||
@@ -53,7 +54,6 @@
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ assessList.score == 3.14159 ? '/' : assessList.score }}
|
{{ assessList.score == 3.14159 ? '/' : assessList.score }}
|
||||||
<!-- {{ assessList.level }} -->
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="evaluate">
|
<div class="evaluate">
|
||||||
@@ -318,7 +318,7 @@ const options = ref([
|
|||||||
|
|
||||||
])
|
])
|
||||||
const technology: any = ref({})
|
const technology: any = ref({})
|
||||||
const harmonicType = ref('0')
|
const harmonicType = ref('6')
|
||||||
const transientNum = ref([0, 0])
|
const transientNum = ref([0, 0])
|
||||||
const options1: any = dictData.getBasicData('Event_Statis').filter(item => {
|
const options1: any = dictData.getBasicData('Event_Statis').filter(item => {
|
||||||
if (item.code == 'Voltage_Dip' || item.code == 'Voltage_Rise' || item.code == 'Short_Interruptions') {
|
if (item.code == 'Voltage_Dip' || item.code == 'Voltage_Rise' || item.code == 'Short_Interruptions') {
|
||||||
|
|||||||
@@ -13,8 +13,10 @@
|
|||||||
<div v-for="(item, i) in list" class="cardBox" :style="i == 1 ? 'flex:1.3' : ''">
|
<div v-for="(item, i) in list" class="cardBox" :style="i == 1 ? 'flex:1.3' : ''">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<span style="cursor: pointer" @click="GridDiagram(i)">{{ item.title }}:</span>
|
<span style="cursor: pointer" @click="GridDiagram(i)">{{ item.title }}:</span>
|
||||||
<span :style="`color: ${item.color[0]}; cursor:pointer`"
|
<span
|
||||||
@click="LookMap(item.list[4].numOneList, item.list[4].numTwoList, 0)">
|
:style="`color: ${item.color[0]}; cursor:pointer`"
|
||||||
|
@click="LookMap(item.list[4].numOneList, item.list[4].numTwoList, 0)"
|
||||||
|
>
|
||||||
{{ item.list[4].numOne }}
|
{{ item.list[4].numOne }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -23,8 +25,10 @@
|
|||||||
<!-- 监测规模 列表 -->
|
<!-- 监测规模 列表 -->
|
||||||
<div>
|
<div>
|
||||||
<div class="vcl mt5">
|
<div class="vcl mt5">
|
||||||
<p v-for="(item, i) in vList"
|
<p
|
||||||
:style="i == 0 ? 'width: 60px' : i == 5 ? 'width: 32px' : 'flex:1'">
|
v-for="(item, i) in vList"
|
||||||
|
:style="i == 0 ? 'width: 60px' : i == 5 ? 'width: 32px' : 'flex:1'"
|
||||||
|
>
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,17 +71,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div :style="`height:calc(${boxHeight.height} + 20px);overflow-y: auto;`">
|
<div :style="`height:calc(${boxHeight.height} + 20px);overflow-y: auto;`">
|
||||||
<div v-for="item in countList">
|
<div v-for="item in countList">
|
||||||
<div class="title mt5" style="font-weight: 500">
|
<!-- <div class="title mt5" style="font-weight: 500">
|
||||||
<img src="@/assets/img/TJ.png" />
|
<img src="@/assets/img/TJ.png" />
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</div>
|
</div> -->
|
||||||
<div class="card-Box" :style="`height:calc((${boxHeight.height} - 50px )/ 3);`"
|
<div
|
||||||
v-for="val in item.children">
|
class="card-Box mt10"
|
||||||
|
:style="`height:calc((${boxHeight.height} - 20px )/ 2);`"
|
||||||
|
v-for="val in item.children"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
<span class="vol">{{ val.title }}</span>
|
<span class="vol">{{ val.title }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="num">
|
<div class="num num1">
|
||||||
<div @click="LookMap(val.numList, [], 0)">
|
<div @click="LookMap(val.numList, [], 0)">
|
||||||
投运:
|
投运:
|
||||||
<span>{{ val.num }}</span>
|
<span>{{ val.num }}</span>
|
||||||
@@ -90,6 +97,10 @@
|
|||||||
数据完整性:
|
数据完整性:
|
||||||
<span style="color: #2b7fd3; cursor: text">{{ val.integrityRate }}%</span>
|
<span style="color: #2b7fd3; cursor: text">{{ val.integrityRate }}%</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
在线率:
|
||||||
|
<span style="color: #2b7fd3; cursor: text">{{ val.integrityRate }}%</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -119,7 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ item.title[2] }}:
|
{{ item.title[2] }}:
|
||||||
<span style="color: #A52a2a" @click="LookMap([], item.lineListTwo, 1)">
|
<span style="color: #a52a2a" @click="LookMap([], item.lineListTwo, 1)">
|
||||||
{{ item.lineNumTwo || 0 }}
|
{{ item.lineNumTwo || 0 }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -129,8 +140,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img class="imgL" :style="show ? 'transform: rotate(0deg);' : 'transform: rotate(180deg);'"
|
<img
|
||||||
@click="show = !show" src="@/assets/img/QH.png" />
|
class="imgL"
|
||||||
|
:style="show ? 'transform: rotate(0deg);' : 'transform: rotate(180deg);'"
|
||||||
|
@click="show = !show"
|
||||||
|
src="@/assets/img/QH.png"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 变电站详情 -->
|
<!-- 变电站详情 -->
|
||||||
<stand ref="standRef" />
|
<stand ref="standRef" />
|
||||||
@@ -286,11 +301,11 @@ const countList: any = ref([
|
|||||||
},
|
},
|
||||||
{ title: '非电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0 }
|
{ title: '非电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0 }
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '上送网公司',
|
|
||||||
children: [{ title: '电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0 }]
|
|
||||||
}
|
}
|
||||||
|
// {
|
||||||
|
// title: '上送网公司',
|
||||||
|
// children: [{ title: '电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0 }]
|
||||||
|
// }
|
||||||
])
|
])
|
||||||
const linList: any = ref([
|
const linList: any = ref([
|
||||||
{
|
{
|
||||||
@@ -307,7 +322,7 @@ const linList: any = ref([
|
|||||||
title: ['电能质量指标', '未超标', '超标']
|
title: ['电能质量指标', '未超标', '超标']
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
const vList = ['', '500kV', '220kV', '110kV', '35kV',]
|
const vList = ['', '500kV', '220kV', '110kV', '35kV']
|
||||||
const formRow: any = ref({})
|
const formRow: any = ref({})
|
||||||
const height = mainHeight(30)
|
const height = mainHeight(30)
|
||||||
const boxHeight = mainHeight(290, 2)
|
const boxHeight = mainHeight(290, 2)
|
||||||
@@ -368,7 +383,7 @@ const info = async (row: any) => {
|
|||||||
getGridDiagramStatistics(form).then(res => {
|
getGridDiagramStatistics(form).then(res => {
|
||||||
countList.value[0].children[0] = { title: '电网侧监测点', ...res.data.data[0] }
|
countList.value[0].children[0] = { title: '电网侧监测点', ...res.data.data[0] }
|
||||||
countList.value[0].children[1] = { title: '非电网侧监测点', ...res.data.data[1] }
|
countList.value[0].children[1] = { title: '非电网侧监测点', ...res.data.data[1] }
|
||||||
countList.value[1].children[0] = { title: '电网侧监测点', ...res.data.gwData[0] }
|
// countList.value[1].children[0] = { title: '电网侧监测点', ...res.data.gwData[0] }
|
||||||
})
|
})
|
||||||
// 监测运行统计
|
// 监测运行统计
|
||||||
getGridDiagramRunData(form).then(res => {
|
getGridDiagramRunData(form).then(res => {
|
||||||
@@ -392,7 +407,7 @@ const LookMap = (coutList: object, alarmList: object, key?: any) => {
|
|||||||
const GridDiagram = (k: any) => {
|
const GridDiagram = (k: any) => {
|
||||||
emit('GridDiagram', k, 3)
|
emit('GridDiagram', k, 3)
|
||||||
}
|
}
|
||||||
onMounted(() => { })
|
onMounted(() => {})
|
||||||
defineExpose({ info, show })
|
defineExpose({ info, show })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -536,6 +551,18 @@ defineExpose({ info, show })
|
|||||||
font-weight: 550;
|
font-weight: 550;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.num1 {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
gap: 8px;
|
||||||
|
div {
|
||||||
|
display: flex;
|
||||||
|
padding-left: 20px;
|
||||||
|
span {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.BoxA {
|
.BoxA {
|
||||||
|
|||||||
@@ -1,137 +1,54 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 综合评估详情 -->
|
<!-- 综合评估详情 -->
|
||||||
<el-dialog draggable title="综合评估统计" v-model="dialogVisible" width="1400px">
|
<el-dialog draggable title="区域污染值统计" v-model="dialogVisible" width="1400px">
|
||||||
<div>
|
<div style="display: flex">
|
||||||
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="300px" :data="tableData">
|
<div style="width: 400px">
|
||||||
<vxe-column field="deptName" title="地市" />
|
<vxe-table
|
||||||
<vxe-column field="assessLevel" title="综合评估结论">
|
v-bind="defaultAttribute"
|
||||||
<template #default="scope">
|
ref="tableRef"
|
||||||
<!-- class="conclusion"
|
@current-change="currentChangeEvent"
|
||||||
:class="
|
height="240px"
|
||||||
scope.row.assessLevel == '特质'
|
:row-config="{ isCurrent: true, isHover: true }"
|
||||||
? 'background1'
|
:data="tableData"
|
||||||
: scope.row.assessLevel == '较差'
|
>
|
||||||
? 'background2'
|
<vxe-column field="deptName" title="地市" />
|
||||||
: scope.row.assessLevel == '极差'
|
<vxe-column field="score" title="污染值" sortable>
|
||||||
? 'background3'
|
|
||||||
: ''
|
|
||||||
" -->
|
|
||||||
<span>
|
|
||||||
{{ scope.row.assessData }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
<vxe-column field="qualifyData" title="指标合格率(%)" />
|
|
||||||
|
|
||||||
<!-- <vxe-colgroup title="评估结论">
|
|
||||||
<vxe-column field="vdevAssessLevel" title="电压偏差">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span
|
||||||
class="conclusion"
|
:style="{
|
||||||
:class="
|
color: setColor(scope.row.score)
|
||||||
scope.row.vdevAssessLevel == '特质'
|
}"
|
||||||
? 'background1'
|
|
||||||
: scope.row.vdevAssessLevel == '较差'
|
|
||||||
? 'background2'
|
|
||||||
: scope.row.vdevAssessLevel == '极差'
|
|
||||||
? 'background3'
|
|
||||||
: ''
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{ scope.row.vdevAssessLevel }}
|
{{ scope.row.score }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
|
</vxe-table>
|
||||||
<vxe-column field="freqAssessLevel" title="频率偏差">
|
</div>
|
||||||
|
<div class="ml10" style="width: 990px">
|
||||||
|
<vxe-table v-bind="defaultAttribute" v-loading="loadingTab" ref="vxeRef" height="240px" :data="subdata">
|
||||||
|
<vxe-column type="seq" width="70"></vxe-column>
|
||||||
|
<vxe-column field="devName" title="终端名称"></vxe-column>
|
||||||
|
<vxe-column field="lineName" title="监测点名称" />
|
||||||
|
<vxe-column field="powerFlag" title="电网标志" />
|
||||||
|
<vxe-column field="devType" title="终端型号"></vxe-column>
|
||||||
|
<vxe-column field="manufacturer" title="终端厂家"></vxe-column>
|
||||||
|
<vxe-column field="vharmonicValue" title="污染值" sortable>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span
|
<span
|
||||||
class="conclusion"
|
:style="{
|
||||||
:class="
|
color: setColor(scope.row.vharmonicValue)
|
||||||
scope.row.freqAssessLevel == '特质'
|
}"
|
||||||
? 'background1'
|
|
||||||
: scope.row.freqAssessLevel == '较差'
|
|
||||||
? 'background2'
|
|
||||||
: scope.row.freqAssessLevel == '极差'
|
|
||||||
? 'background3'
|
|
||||||
: ''
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{ scope.row.freqAssessLevel }}
|
{{ scope.row.vharmonicValue }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
|
</vxe-table>
|
||||||
<vxe-column field="harmAssessLevel" title="电压总谐波畸变率">
|
</div>
|
||||||
<template #default="scope">
|
|
||||||
<span
|
|
||||||
class="conclusion"
|
|
||||||
:class="
|
|
||||||
scope.row.harmAssessLevel == '特质'
|
|
||||||
? 'background1'
|
|
||||||
: scope.row.harmAssessLevel == '较差'
|
|
||||||
? 'background2'
|
|
||||||
: scope.row.harmAssessLevel == '极差'
|
|
||||||
? 'background3'
|
|
||||||
: ''
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ scope.row.harmAssessLevel }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
|
|
||||||
<vxe-column field="flickerAssessLevel" title="电压闪变">
|
|
||||||
<template #default="scope">
|
|
||||||
<span
|
|
||||||
class="conclusion"
|
|
||||||
:class="
|
|
||||||
scope.row.flickerAssessLevel == '特质'
|
|
||||||
? 'background1'
|
|
||||||
: scope.row.flickerAssessLevel == '较差'
|
|
||||||
? 'background2'
|
|
||||||
: scope.row.flickerAssessLevel == '极差'
|
|
||||||
? 'background3'
|
|
||||||
: ''
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ scope.row.flickerAssessLevel }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
|
|
||||||
<vxe-column field="unbalanceAssessLevel" title="三相电压不平衡度">
|
|
||||||
<template #default="scope">
|
|
||||||
<span
|
|
||||||
class="conclusion"
|
|
||||||
:class="
|
|
||||||
scope.row.unbalanceAssessLevel == '特质'
|
|
||||||
? 'background1'
|
|
||||||
: scope.row.unbalanceAssessLevel == '较差'
|
|
||||||
? 'background2'
|
|
||||||
: scope.row.unbalanceAssessLevel == '极差'
|
|
||||||
? 'background3'
|
|
||||||
: ''
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ scope.row.unbalanceAssessLevel }}
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
</vxe-colgroup> -->
|
|
||||||
</vxe-table>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 300px; margin-top: 10px; position: relative" v-loading="loading">
|
<div style="height: 300px; margin-top: 10px; position: relative" v-loading="loading">
|
||||||
<!-- <el-select
|
<!-- <div style="position: absolute; width: 100px; top: 0px; right: 0px; z-index: 1">
|
||||||
v-model="time"
|
|
||||||
size="small"
|
|
||||||
|
|
||||||
@change="analysis"
|
|
||||||
>
|
|
||||||
<el-option label="年" value="1" />
|
|
||||||
<el-option label="月" value="3" />
|
|
||||||
</el-select> -->
|
|
||||||
<div style="position: absolute; width: 100px; top: 0px; right: 0px; z-index: 1">
|
|
||||||
<el-radio-group v-model="city" size="small" @change="analysis">
|
<el-radio-group v-model="city" size="small" @change="analysis">
|
||||||
<el-radio-button label="0">省</el-radio-button>
|
<el-radio-button label="0">省</el-radio-button>
|
||||||
<el-radio-button label="1">市</el-radio-button>
|
<el-radio-button label="1">市</el-radio-button>
|
||||||
@@ -140,133 +57,119 @@
|
|||||||
<el-radio-button label="1">年</el-radio-button>
|
<el-radio-button label="1">年</el-radio-button>
|
||||||
<el-radio-button label="3">月</el-radio-button>
|
<el-radio-button label="3">月</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<MyEChart style="height: 300px" :options="picEChart" />
|
<MyEChart style="height: 300px" :options="picEChart" />
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import { getAssessDetail, getAssessTrend } from '@/api/device-boot/panorama'
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { getAssessDetail, getAssessTrend, downPollutionSubCalc } from '@/api/device-boot/panorama'
|
||||||
|
const dictData = useDictData()
|
||||||
const dialogVisible: any = ref(false)
|
const dialogVisible: any = ref(false)
|
||||||
const rowList: any = ref({})
|
const rowList: any = ref({})
|
||||||
const type = ref('1')
|
const type = ref('1')
|
||||||
const city = ref('0')
|
const city = ref('0')
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const tableData: any = ref([])
|
const tableData: any = ref([])
|
||||||
|
const subdata: any = ref([])
|
||||||
const picEChart = ref()
|
const picEChart = ref()
|
||||||
const open = async (row: any) => {
|
const tableRef = ref()
|
||||||
getAssessDetail(row).then(res => {
|
const loadingTab = ref(false)
|
||||||
tableData.value = res.data
|
const PollutionList = dictData.getBasicData('Pollution_Calc').filter(item => item.name == '谐波电压')
|
||||||
|
|
||||||
|
const open = async (row: any, list: any) => {
|
||||||
|
console.log('🚀 ~ open ~ list:', list)
|
||||||
|
// getAssessDetail(row).then(res => {
|
||||||
|
tableData.value = list
|
||||||
|
subdata.value = tableData.value[0]?.powerFlagPollutionList || []
|
||||||
|
nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
tableRef.value?.setCurrentRow(tableData.value[0])
|
||||||
|
}, 0)
|
||||||
})
|
})
|
||||||
|
// })
|
||||||
rowList.value = row
|
rowList.value = row
|
||||||
analysis()
|
analysis()
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
const currentChangeEvent = async () => {
|
||||||
|
loadingTab.value = true
|
||||||
|
setTimeout(() => {
|
||||||
|
subdata.value = tableRef.value.getCurrentRecord()?.powerFlagPollutionList || []
|
||||||
|
loadingTab.value = false
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
const analysis = () => {
|
const analysis = () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
let time = rowList.value.searchBeginTime.slice(0, 4) + `-01-01`
|
let time = rowList.value.searchBeginTime.slice(0, 4) + `-01-01`
|
||||||
getAssessTrend({ ...rowList.value, searchBeginTime: time, type: type.value, areaType: city.value }).then(res => {
|
downPollutionSubCalc({ ...rowList.value, ids: [PollutionList[0].id] }).then(res => {
|
||||||
|
const first10Items = res.data.slice(0, 10)
|
||||||
picEChart.value = {
|
picEChart.value = {
|
||||||
title: {
|
title: {
|
||||||
text: '各地市综合评估趋势对比'
|
text: '污染值排名前十变电站'
|
||||||
|
},
|
||||||
|
|
||||||
|
xAxis: {
|
||||||
|
name: '',
|
||||||
|
data: first10Items.map((item: any) => item.subStationName),
|
||||||
|
axisLabel: {
|
||||||
|
rotate: 30, // 核心:倾斜 45 度(推荐 30/45/60,角度太大易读性差)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
bottom: 10
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
right: 120,
|
show: false
|
||||||
top: 20
|
|
||||||
},
|
},
|
||||||
// tooltip: {
|
|
||||||
// formatter: function (params: any) {
|
|
||||||
// // console.log(123, params)
|
|
||||||
|
|
||||||
// var tips = ''
|
|
||||||
|
|
||||||
// for (var i = 0; i < params.length; i++) {
|
|
||||||
// console.log('🚀 ~ getAssessTrend ~ params[i].value:', params[i].value)
|
|
||||||
|
|
||||||
// tips +=
|
|
||||||
// params[i].seriesName +
|
|
||||||
// ':' +
|
|
||||||
// `<span style="color:${
|
|
||||||
// params[i].value > 4.5
|
|
||||||
// ? ''
|
|
||||||
// : params[i].value > 4
|
|
||||||
// ? ''
|
|
||||||
// : params[i].value > 3
|
|
||||||
// ? ''
|
|
||||||
// : params[i].value > 2
|
|
||||||
// ? '#97017e'
|
|
||||||
// : params[i].value > 0
|
|
||||||
// ? '#A52a2a'
|
|
||||||
// : ''
|
|
||||||
// }">
|
|
||||||
// ${
|
|
||||||
// params[i].value > 4.5
|
|
||||||
// ? '优质'
|
|
||||||
// : params[i].value > 4
|
|
||||||
// ? '良好'
|
|
||||||
// : params[i].value > 3
|
|
||||||
// ? '一般'
|
|
||||||
// : params[i].value > 2
|
|
||||||
// ? '较差'
|
|
||||||
// : params[i].value > 0
|
|
||||||
// ? '极差'
|
|
||||||
// : ''
|
|
||||||
// }
|
|
||||||
// </span>` +
|
|
||||||
// '</br>'
|
|
||||||
// }
|
|
||||||
// return tips
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
xAxis: {
|
|
||||||
name: '时间',
|
|
||||||
data: res.data[0].children.map((item: any) => item.dataTime)
|
|
||||||
},
|
|
||||||
|
|
||||||
grid: {
|
|
||||||
bottom: '10px',
|
|
||||||
top: '60px'
|
|
||||||
},
|
|
||||||
|
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: ''
|
name: ''
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
dataZoom: false,
|
dataZoom: false,
|
||||||
series: []
|
series: [
|
||||||
|
{
|
||||||
|
// name: time[i],
|
||||||
|
name: '污染值',
|
||||||
|
type: 'bar',
|
||||||
|
data: first10Items.map((item: any) => item.subVStationValue),
|
||||||
|
itemStyle: {
|
||||||
|
color: function (params) {
|
||||||
|
// params.value 是当前柱子的数值
|
||||||
|
const value = params.value
|
||||||
|
return setColor(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let list: any = []
|
|
||||||
let time: any = []
|
|
||||||
let mun: any = []
|
|
||||||
res.data.forEach((item: any, num: any) => {
|
|
||||||
time.push(item.deptName)
|
|
||||||
list.push([])
|
|
||||||
item.children.forEach((val: any, i: any) => {
|
|
||||||
mun.push(val.score == 3.14159 ? null : val.score)
|
|
||||||
list[num].push(val.score == 3.14159 ? null : val.score)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
list.forEach((item: any, i: any) => {
|
|
||||||
picEChart.value.options.series.push({
|
|
||||||
name: time[i],
|
|
||||||
type: 'line',
|
|
||||||
data: item
|
|
||||||
})
|
|
||||||
})
|
|
||||||
picEChart.value.yAxis.min = Math.min(...mun) < 1 ? 0 : (Math.min(...mun) - 0.5).toFixed(2)
|
|
||||||
picEChart.value.yAxis.max = Math.max(...mun) > 4.5 ? 5 : (Math.max(...mun) + 0.5).toFixed(2)
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const setColor = val => {
|
||||||
|
return val == 3.14159
|
||||||
|
? ''
|
||||||
|
: val > 10000
|
||||||
|
? '#A52a2a'
|
||||||
|
: val > 1000
|
||||||
|
? '#ff9900'
|
||||||
|
: val > 100
|
||||||
|
? '#ffcc33'
|
||||||
|
: val > 0
|
||||||
|
? '#3399ff'
|
||||||
|
: val == 0
|
||||||
|
? '#00B07D'
|
||||||
|
: ''
|
||||||
|
}
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -290,7 +193,7 @@ defineExpose({ open })
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.background3 {
|
.background3 {
|
||||||
background-color: #A52a2a;
|
background-color: #a52a2a;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
:deep(.el-select) {
|
:deep(.el-select) {
|
||||||
|
|||||||
@@ -20,20 +20,20 @@
|
|||||||
<div class="title">
|
<div class="title">
|
||||||
<span>
|
<span>
|
||||||
污染告警
|
污染告警
|
||||||
<el-popover placement="right" :width="170" trigger="hover">
|
<el-popover placement="right" :width="190" trigger="hover">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<WarningFilled class="WarningFilled" />
|
<WarningFilled class="WarningFilled" />
|
||||||
</template>
|
</template>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<span style="color: #00b07d">无污染:(0 , 1]</span>
|
<span style="color: #00B07D">无污染:0</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #3399ff">轻微污染:(1 , 1.2]</span>
|
<span style="color: #3399ff">轻微污染:(0 , 100]</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #ffcc33">轻度污染:(1.2 , 1.6]</span>
|
<span style="color: #ffcc33">轻度污染:(100 , 1000]</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #ff9900">中度污染:(1.6 , 2]</span>
|
<span style="color: #ff9900">中度污染:(1000 , 10000]</span>
|
||||||
<br />
|
<br />
|
||||||
<span style="color: #A52a2a">重度污染:(2 , +∞)</span>
|
<span style="color: #A52a2a">重度污染:(10000</span>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</span>
|
</span>
|
||||||
@@ -49,11 +49,11 @@
|
|||||||
<el-radio-button v-for="item in options" :label="item.id">{{ item.name }}</el-radio-button>
|
<el-radio-button v-for="item in options" :label="item.id">{{ item.name }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- :style="i == 3 ? `margin-left: 20%;` : ``" -->
|
||||||
<div class="pie">
|
<div class="pie">
|
||||||
<MyEChart
|
<MyEChart
|
||||||
v-for="(item, i) in picEChart"
|
v-for="(item, i) in picEChart"
|
||||||
:style="i == 3 ? `margin-left: 20%;` : ``"
|
|
||||||
class="MyEChart"
|
class="MyEChart"
|
||||||
:options="item"
|
:options="item"
|
||||||
/>
|
/>
|
||||||
@@ -72,6 +72,7 @@
|
|||||||
<vxe-column field="num3" sortable title="轻度污染数量" :formatter="formatter" />
|
<vxe-column field="num3" sortable title="轻度污染数量" :formatter="formatter" />
|
||||||
<vxe-column field="num4" sortable title="中度污染数量" :formatter="formatter" />
|
<vxe-column field="num4" sortable title="中度污染数量" :formatter="formatter" />
|
||||||
<vxe-column field="num5" sortable title="重度污染数量" :formatter="formatter" />
|
<vxe-column field="num5" sortable title="重度污染数量" :formatter="formatter" />
|
||||||
|
<vxe-column field="num6" sortable title="暂无数据数量" :formatter="formatter" />
|
||||||
</vxe-table>
|
</vxe-table>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -88,11 +89,12 @@ const dictData = useDictData()
|
|||||||
const dialogVisible: any = ref(false)
|
const dialogVisible: any = ref(false)
|
||||||
const time = ref('1')
|
const time = ref('1')
|
||||||
const Voltage = dictData.getBasicData('Dev_Voltage_Stand')
|
const Voltage = dictData.getBasicData('Dev_Voltage_Stand')
|
||||||
const options: any = dictData.getBasicData('Pollution_Statis').filter(item => {
|
const options: any = dictData.getBasicData('Pollution_Calc')
|
||||||
if (item.code == 'V_Harmonic' || item.code == 'I_All') {
|
// .filter(item => {
|
||||||
return item
|
// if (item.code == 'V_Harmonic' || item.code == 'I_All') {
|
||||||
}
|
// return item
|
||||||
})
|
// }
|
||||||
|
// })
|
||||||
const contaminate = ref(options[0].id)
|
const contaminate = ref(options[0].id)
|
||||||
const rowList: any = ref({})
|
const rowList: any = ref({})
|
||||||
const trendEChart: any = ref({})
|
const trendEChart: any = ref({})
|
||||||
@@ -119,57 +121,223 @@ const open = async (row: any) => {
|
|||||||
}
|
}
|
||||||
const contaminateC = () => {
|
const contaminateC = () => {
|
||||||
// rowList.value.deviceInfoParam.ids=[contaminate.value]
|
// rowList.value.deviceInfoParam.ids=[contaminate.value]
|
||||||
getPollutionAlarmData({ ...rowList.value, ids: [contaminate.value] }).then(res => {
|
// getPollutionAlarmData({ ...rowList.value, ids: [contaminate.value] }).then(res => {
|
||||||
let data = []
|
// let data = []
|
||||||
|
|
||||||
let a1 = 0
|
// let a1 = 0
|
||||||
let a2 = 0
|
// let a2 = 0
|
||||||
let a3 = 0
|
// let a3 = 0
|
||||||
let a4 = 0
|
// let a4 = 0
|
||||||
let a5 = 0
|
// let a5 = 0
|
||||||
if (rowList.value.isUpToGrid == 0) {
|
// if (rowList.value.isUpToGrid == 0) {
|
||||||
data = res.data.info
|
// data = res.data.info
|
||||||
} else {
|
// } else {
|
||||||
data = res.data.gwInfo
|
// data = res.data.gwInfo
|
||||||
}
|
// }
|
||||||
for (let i = 0; i < data.length; i++) {
|
// for (let i = 0; i < data.length; i++) {
|
||||||
if (data[i] >= 2) {
|
// if (data[i] >= 2) {
|
||||||
++a5
|
// ++a5
|
||||||
} else if (data[i] >= 1.6 && data[i] < 2) {
|
// } else if (data[i] >= 1.6 && data[i] < 2) {
|
||||||
++a4
|
// ++a4
|
||||||
} else if (data[i] >= 1.2 && data[i] < 1.6) {
|
// } else if (data[i] >= 1.2 && data[i] < 1.6) {
|
||||||
++a3
|
// ++a3
|
||||||
} else if (data[i] >= 1 && data[i] < 1.2) {
|
// } else if (data[i] >= 1 && data[i] < 1.2) {
|
||||||
++a2
|
// ++a2
|
||||||
} else if (data[i] >= 0 && data[i] < 1) {
|
// } else if (data[i] >= 0 && data[i] < 1) {
|
||||||
++a1
|
// ++a1
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// let list = [
|
||||||
|
// {
|
||||||
|
// value: ((a1 / data.length || 0) * 100).toFixed(2),
|
||||||
|
// name: `无污染:${a1}座`
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: ((a2 / data.length || 0) * 100).toFixed(2),
|
||||||
|
// name: `轻微污染::${a2}座`
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: ((a3 / data.length || 0) * 100).toFixed(2),
|
||||||
|
// name: `轻度污染:${a3}座`
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: ((a4 / data.length || 0) * 100).toFixed(2),
|
||||||
|
// name: `中度污染:${a4}座`
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: ((a5 / data.length || 0) * 100).toFixed(2),
|
||||||
|
// name: `重度污染:${a5}座`
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// const color = ['#00B07D', '#3399ff', '#ffcc33', '#ff9900', '#A52a2a']
|
||||||
|
|
||||||
|
// list.forEach((item, i) => {
|
||||||
|
// picEChart.value[i] = {
|
||||||
|
// legend: {
|
||||||
|
// type: 'scroll',
|
||||||
|
// orient: 'vertical',
|
||||||
|
// left: 10,
|
||||||
|
// top: '10%'
|
||||||
|
// },
|
||||||
|
// xAxis: {
|
||||||
|
// show: false
|
||||||
|
// },
|
||||||
|
// yAxis: {
|
||||||
|
// show: false
|
||||||
|
// },
|
||||||
|
// options: {
|
||||||
|
// toolbox:null,
|
||||||
|
// dataZoom: null,
|
||||||
|
// series: [
|
||||||
|
// {
|
||||||
|
// type: 'gauge',
|
||||||
|
// startAngle: 180,
|
||||||
|
// center: ['50%', '80%'],
|
||||||
|
// radius: '135%',
|
||||||
|
// endAngle: 0,
|
||||||
|
// min: 0,
|
||||||
|
// max: 100,
|
||||||
|
// progress: {
|
||||||
|
// show: true,
|
||||||
|
// width: 15,
|
||||||
|
// itemStyle: {
|
||||||
|
// color: color[i]
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// pointer: {
|
||||||
|
// show: false
|
||||||
|
// },
|
||||||
|
// axisLine: {
|
||||||
|
// lineStyle: {
|
||||||
|
// width: 15,
|
||||||
|
// color: [[1, '#f4f4f4']]
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// axisTick: {
|
||||||
|
// show: false
|
||||||
|
// },
|
||||||
|
// splitLine: {
|
||||||
|
// show: false
|
||||||
|
// },
|
||||||
|
// axisLabel: {
|
||||||
|
// show: false
|
||||||
|
// // distance: 5,
|
||||||
|
// // color: '#666',
|
||||||
|
// // fontSize: 12,
|
||||||
|
// // formatter: function (value: any) {
|
||||||
|
// // if (value === 0 || value === 100) {
|
||||||
|
// // return value + '%'
|
||||||
|
// // }
|
||||||
|
// // }
|
||||||
|
// },
|
||||||
|
// anchor: {
|
||||||
|
// show: false,
|
||||||
|
// showAbove: false,
|
||||||
|
// size: 25,
|
||||||
|
// itemStyle: {
|
||||||
|
// borderWidth: 60
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// title: {
|
||||||
|
// show: true,
|
||||||
|
// offsetCenter: [0, '20%'],
|
||||||
|
// fontSize: 14
|
||||||
|
// },
|
||||||
|
// detail: {
|
||||||
|
// valueAnimation: true,
|
||||||
|
// fontSize: 14,
|
||||||
|
// lineHeight: 20,
|
||||||
|
// color: color[i],
|
||||||
|
// fontWeight: 'bold',
|
||||||
|
// offsetCenter: [0, '-20%'],
|
||||||
|
// formatter: function (value: any) {
|
||||||
|
// return '{a|占比} ' + '\n' + value + '{a|%}'
|
||||||
|
// },
|
||||||
|
// rich: {
|
||||||
|
// a: {
|
||||||
|
// color: '#333',
|
||||||
|
// fontSize: 16,
|
||||||
|
// lineHeight: 30
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// data: [item]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
getPollutionAlarmList({ ...rowList.value, ids: [contaminate.value] }).then(res => {
|
||||||
|
tableData.value = res.data.map((item: any) => {
|
||||||
|
return {
|
||||||
|
name: item[0],
|
||||||
|
num: item[1],
|
||||||
|
num1: item[2],
|
||||||
|
num2: item[3],
|
||||||
|
num3: item[4],
|
||||||
|
num4: item[5],
|
||||||
|
num5: item[6],
|
||||||
|
num6: item[7]
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
// console.log('🚀 ~ getPollutionAlarmData ~ a1 / data.length:', a1 / data.length)
|
console.log(123, tableData.value)
|
||||||
|
|
||||||
|
let data = []
|
||||||
|
let a1 = tableData.value.reduce((t, item) => t + (item.num1 - 0 || 0), 0)
|
||||||
|
let a2 = tableData.value.reduce((t, item) => t + (item.num2 - 0 || 0), 0)
|
||||||
|
let a3 = tableData.value.reduce((t, item) => t + (item.num3 - 0 || 0), 0)
|
||||||
|
let a4 = tableData.value.reduce((t, item) => t + (item.num4 - 0 || 0), 0)
|
||||||
|
let a5 = tableData.value.reduce((t, item) => t + (item.num5 - 0 || 0), 0)
|
||||||
|
let a6 = tableData.value.reduce((t, item) => t + (item.num6 - 0 || 0), 0)
|
||||||
|
let total = a1 + a2 + a3 + a4 + a5 + a6
|
||||||
|
// if (rowList.value.isUpToGrid == 0) {
|
||||||
|
// data = res.data.info
|
||||||
|
// } else {
|
||||||
|
// data = res.data.gwInfo
|
||||||
|
// }
|
||||||
|
// for (let i = 0; i < data.length; i++) {
|
||||||
|
// if (data[i] >= 2) {
|
||||||
|
// ++a5
|
||||||
|
// } else if (data[i] >= 1.6 && data[i] < 2) {
|
||||||
|
// ++a4
|
||||||
|
// } else if (data[i] >= 1.2 && data[i] < 1.6) {
|
||||||
|
// ++a3
|
||||||
|
// } else if (data[i] >= 1 && data[i] < 1.2) {
|
||||||
|
// ++a2
|
||||||
|
// } else if (data[i] >= 0 && data[i] < 1) {
|
||||||
|
// ++a1
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
let list = [
|
let list = [
|
||||||
{
|
{
|
||||||
value: ((a1 / data.length || 0) * 100).toFixed(2),
|
value: ((a1 / total || 0) * 100).toFixed(2),
|
||||||
name: `无污染:${a1}座`
|
name: `无污染:${a1}座`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: ((a2 / data.length || 0) * 100).toFixed(2),
|
value: ((a2 / total || 0) * 100).toFixed(2),
|
||||||
name: `轻微污染::${a2}座`
|
name: `轻微污染::${a2}座`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: ((a3 / data.length || 0) * 100).toFixed(2),
|
value: ((a3 / total || 0) * 100).toFixed(2),
|
||||||
name: `轻度污染:${a3}座`
|
name: `轻度污染:${a3}座`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: ((a4 / data.length || 0) * 100).toFixed(2),
|
value: ((a4 / total || 0) * 100).toFixed(2),
|
||||||
name: `中度污染:${a4}座`
|
name: `中度污染:${a4}座`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: ((a5 / data.length || 0) * 100).toFixed(2),
|
value: ((a5 / total || 0) * 100).toFixed(2),
|
||||||
name: `重度污染:${a5}座`
|
name: `重度污染:${a5}座`
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
value: ((a6 / total || 0) * 100).toFixed(2),
|
||||||
|
name: `暂无数据:${a6}座`
|
||||||
|
},
|
||||||
]
|
]
|
||||||
const color = ['#00B07D', '#3399ff', '#ffcc33', '#ff9900', '#A52a2a']
|
const color = ['#00B07D', '#3399ff', '#ffcc33', '#ff9900', '#A52a2a','#ccc']
|
||||||
|
|
||||||
list.forEach((item, i) => {
|
list.forEach((item, i) => {
|
||||||
picEChart.value[i] = {
|
picEChart.value[i] = {
|
||||||
@@ -186,7 +354,7 @@ const contaminateC = () => {
|
|||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
toolbox:null,
|
toolbox: null,
|
||||||
dataZoom: null,
|
dataZoom: null,
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
@@ -268,19 +436,6 @@ const contaminateC = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
getPollutionAlarmList({ ...rowList.value, ids: [contaminate.value] }).then(res => {
|
|
||||||
tableData.value = res.data.map((item: any) => {
|
|
||||||
return {
|
|
||||||
name: item[0],
|
|
||||||
num: item[1],
|
|
||||||
num1: item[2],
|
|
||||||
num2: item[3],
|
|
||||||
num3: item[4],
|
|
||||||
num4: item[5],
|
|
||||||
num5: item[6]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const analysis = (e: any) => {
|
const analysis = (e: any) => {
|
||||||
let time = rowList.value.searchBeginTime?.slice(0, 4) + `-01-01`
|
let time = rowList.value.searchBeginTime?.slice(0, 4) + `-01-01`
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="365px" :data="tableData">
|
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="365px" :data="tableData">
|
||||||
<vxe-column field="deptName" title="区域" />
|
<vxe-column field="deptName" title="区域" />
|
||||||
<vxe-column sortable field="onlineNum" title="在线监测点数量(个)" />
|
<vxe-column sortable field="onlineNum" title="在运监测点数(个)" />
|
||||||
<vxe-column sortable field="overNum" title="超标监测点数量(个)" />
|
<vxe-column sortable field="overNum" title="超标监测点数量(个)" />
|
||||||
<vxe-column sortable field="overRatio" title="超标监测点占比(%)" />
|
<vxe-column sortable field="overRatio" title="超标监测点占比(%)" />
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ const url: any = [
|
|||||||
new URL(`@/assets/img/SB.png`, import.meta.url)
|
new URL(`@/assets/img/SB.png`, import.meta.url)
|
||||||
]
|
]
|
||||||
const tableData: any = ref([])
|
const tableData: any = ref([])
|
||||||
const title = ['电压偏差(超标)', '频率偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
|
const title = ['频率偏差(超标)', '电压偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
|
||||||
|
|
||||||
const echart = (row: any) => {
|
const echart = (row: any) => {
|
||||||
let maxList: any = []
|
let maxList: any = []
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
<span style="font-size: 16px">{{ dropList.lineName }}详情 </span>
|
<span style="font-size: 16px">{{ dropList.lineName }}详情 </span>
|
||||||
<span style="font-weight: 500">最新数据时间:</span>
|
<span style="font-weight: 500">最新数据时间:</span>
|
||||||
<span style="color: var(--color-primary-default)">{{ dropList.updateTime }}</span>
|
<span style="color: var(--color-primary-default)">{{ dropList.updateTime }}</span>
|
||||||
|
<span style="font-weight: 500" class="ml20">统计日期:</span>
|
||||||
|
<span style="color: var(--color-primary-default)">
|
||||||
|
{{ getTimeOfTheMonth('3')[0] + '至' + getTimeOfTheMonth('3')[1] }}
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-page-header>
|
</el-page-header>
|
||||||
<el-row :gutter="20" class="mt10" :style="`height:${rowHeight}`">
|
<el-row :gutter="20" class="mt10" :style="`height:${rowHeight}`">
|
||||||
@@ -38,16 +42,24 @@
|
|||||||
</h3>
|
</h3>
|
||||||
<el-descriptions title="" border :column="2" size="small">
|
<el-descriptions title="" border :column="2" size="small">
|
||||||
<el-descriptions-item width="140px" label="告警原因">
|
<el-descriptions-item width="140px" label="告警原因">
|
||||||
<span style="font-weight: 550"
|
<span
|
||||||
:style="TargetData.info == 0 ? 'color: #0e8780;' : TargetData.info == 3 ? 'color: #000' : 'color: #ff0000;'">
|
style="font-weight: 550"
|
||||||
|
:style="
|
||||||
|
TargetData.info == 0
|
||||||
|
? 'color: #0e8780;'
|
||||||
|
: TargetData.info == 3
|
||||||
|
? 'color: #000'
|
||||||
|
: 'color: #ff0000;'
|
||||||
|
"
|
||||||
|
>
|
||||||
{{
|
{{
|
||||||
TargetData.info == 1
|
TargetData.info == 1
|
||||||
? '超标告警'
|
? '超标告警'
|
||||||
: TargetData.info == 2
|
: TargetData.info == 2
|
||||||
? '完整性告警'
|
? '完整性告警'
|
||||||
: TargetData.info == 0
|
: TargetData.info == 0
|
||||||
? '无告警'
|
? '无告警'
|
||||||
: '暂无数据'
|
: '暂无数据'
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@@ -73,8 +85,11 @@
|
|||||||
</h3>
|
</h3>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="ComCharts" @click="Integrity" />
|
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="ComCharts" @click="Integrity" />
|
||||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="onLineCharts"
|
<MyEChart
|
||||||
@click="OnlineRate" />
|
:style="`height: calc(${rowHeight} - 31px)`"
|
||||||
|
:options="onLineCharts"
|
||||||
|
@click="OnlineRate"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -93,14 +108,18 @@
|
|||||||
<el-col :span="12" style="display: flex">
|
<el-col :span="12" style="display: flex">
|
||||||
<div>
|
<div>
|
||||||
综合评估得分:
|
综合评估得分:
|
||||||
<span class="conclusion" :class="dropList.assessData == '特质'
|
<span
|
||||||
? 'background1'
|
class="conclusion"
|
||||||
: dropList.assessData == '较差'
|
:class="
|
||||||
? 'background2'
|
dropList.assessData == '特质'
|
||||||
: dropList.assessData == '极差'
|
? 'background1'
|
||||||
|
: dropList.assessData == '较差'
|
||||||
|
? 'background2'
|
||||||
|
: dropList.assessData == '极差'
|
||||||
? 'background3'
|
? 'background3'
|
||||||
: ''
|
: ''
|
||||||
">
|
"
|
||||||
|
>
|
||||||
{{ dropList.assessData }}
|
{{ dropList.assessData }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -114,14 +133,18 @@
|
|||||||
<el-col :span="10" style="display: flex; align-items: center">
|
<el-col :span="10" style="display: flex; align-items: center">
|
||||||
<div style="width: 100%">
|
<div style="width: 100%">
|
||||||
评估得分:
|
评估得分:
|
||||||
<span class="conclusion" :class="item.avg == '特质'
|
<span
|
||||||
? 'background1'
|
class="conclusion"
|
||||||
: item.avg == '较差'
|
:class="
|
||||||
? 'background2'
|
item.avg == '特质'
|
||||||
: item.avg == '极差'
|
? 'background1'
|
||||||
|
: item.avg == '较差'
|
||||||
|
? 'background2'
|
||||||
|
: item.avg == '极差'
|
||||||
? 'background3'
|
? 'background3'
|
||||||
: ''
|
: ''
|
||||||
">
|
"
|
||||||
|
>
|
||||||
{{ item.avg }}
|
{{ item.avg }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -167,6 +190,7 @@ import DatePicker from '@/components/form/datePicker/index.vue'
|
|||||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||||
import echarts from '@/components/echarts/echarts'
|
import echarts from '@/components/echarts/echarts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
import { getLineDetailData } from '@/api/advance-boot/bearingCapacity'
|
import { getLineDetailData } from '@/api/advance-boot/bearingCapacity'
|
||||||
import {
|
import {
|
||||||
@@ -522,7 +546,7 @@ const open = async (id: string) => {
|
|||||||
if (res.data[k] != '/') {
|
if (res.data[k] != '/') {
|
||||||
judgment = false
|
judgment = false
|
||||||
}
|
}
|
||||||
flag += (res.data[k] == '/' ? 0 : res.data[k])
|
flag += res.data[k] == '/' ? 0 : res.data[k]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -633,7 +657,7 @@ const echart = (row: any) => {
|
|||||||
},
|
},
|
||||||
indicator: indicator
|
indicator: indicator
|
||||||
},
|
},
|
||||||
|
color: color,
|
||||||
series: []
|
series: []
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,13 +666,17 @@ const echart = (row: any) => {
|
|||||||
name: item.time,
|
name: item.time,
|
||||||
type: 'radar',
|
type: 'radar',
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
|
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
normal: {
|
opacity: 0.6, // 调整透明度,避免重叠遮挡
|
||||||
color: '#2a9fe069'
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
}
|
{ offset: 0, color: `${color[i]}50` },
|
||||||
|
{ offset: 1, color: `${color[i]}50` } // 渐变透明
|
||||||
|
])
|
||||||
},
|
},
|
||||||
itemStyle: {
|
lineStyle: {
|
||||||
color: '#2a9fe0'
|
color: color[i],
|
||||||
|
width: 2
|
||||||
},
|
},
|
||||||
data: [item.ratioList]
|
data: [item.ratioList]
|
||||||
})
|
})
|
||||||
@@ -736,7 +764,7 @@ defineExpose({ open })
|
|||||||
}
|
}
|
||||||
|
|
||||||
.background3 {
|
.background3 {
|
||||||
background-color: #A52a2a;
|
background-color: #a52a2a;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||