Compare commits
24 Commits
2025-11
...
d69a6e1e5d
| Author | SHA1 | Date | |
|---|---|---|---|
| d69a6e1e5d | |||
| a67535abbf | |||
|
|
dffc735edb | ||
|
|
38806367b4 | ||
|
|
6f770aa91d | ||
| dc32cc3bb7 | |||
|
|
d64d18f330 | ||
|
|
909f43e257 | ||
| 92aa66436e | |||
| 264f33302f | |||
|
|
7b9f5302d0 | ||
|
|
72d836020b | ||
|
|
67efef738a | ||
| 6918611d06 | |||
| 9f5b2ecc46 | |||
|
|
d30b8247cf | ||
| 0b61c4b7ba | |||
|
|
ff2b9db7b8 | ||
|
|
289900f9ff | ||
|
|
e87d05c587 | ||
| 46c55d48ec | |||
| b36f765d07 | |||
|
|
0fe2d2b911 | ||
|
|
8c41a8fc77 |
BIN
public/favicon4.ico
Normal file
BIN
public/favicon4.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -1,32 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { DEVICE_BOOT } from '@/utils/constantRequest'
|
||||
|
||||
const MAPPING_PATH = DEVICE_BOOT + '/line'
|
||||
|
||||
/**
|
||||
* 查询终端详细信息
|
||||
*/
|
||||
export const getDeviceDetailData = (id: string) => {
|
||||
return request({
|
||||
url: MAPPING_PATH + '/getDeviceDetailData?id=' + id,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询监测点详细信息
|
||||
*/
|
||||
export const getLineDetailData = (id: string) => {
|
||||
return request({
|
||||
url: MAPPING_PATH + '/getLineDetailData?id=' + id,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
export const getSubstationSelect = () => {
|
||||
return request({
|
||||
url: 'device-boot/substation/getSubstationSelect',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { DEVICE_BOOT } from '@/utils/constantRequest'
|
||||
|
||||
const MAPPING_PATH = DEVICE_BOOT + '/line'
|
||||
|
||||
/**
|
||||
* 查询终端详细信息
|
||||
*/
|
||||
export const getDeviceDetailData = (id: string) => {
|
||||
return request({
|
||||
url: MAPPING_PATH + '/getDeviceDetailData?id=' + id,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询监测点详细信息
|
||||
*/
|
||||
export const getLineDetailData = (id: string) => {
|
||||
return request({
|
||||
url: MAPPING_PATH + '/getLineDetailData?id=' + id,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
export const getSubstationSelect = () => {
|
||||
return request({
|
||||
url: 'device-boot/substation/getSubstationSelect',
|
||||
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,20 @@ export function getSupervisionDetailsData(data: any) {
|
||||
export function getSupervisionCityDetailsData(data: any) {
|
||||
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 })
|
||||
}
|
||||
//监测点评价
|
||||
export function limitTableDetail(data: any) {
|
||||
return request({ url: '/device-boot/dataVerify/limitTableDetail', method: 'post', data })
|
||||
}
|
||||
//重要及敏感用户详情
|
||||
export function downPollutionSensitiveUser(data: any) {
|
||||
return request({ url: '/harmonic-boot/PollutionSubstation/downPollutionSensitiveUser', method: 'post', data })
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export function getUndocumentednonlinearData() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//获取入网评估报告审核数据
|
||||
//获取系统接入方案审核数据
|
||||
export function getReportreviewData() {
|
||||
return createAxios({
|
||||
url: '/Process-supervision/Reportreview/getReportreview',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
import { ElMessage } from 'element-plus'
|
||||
const SYSTEM_PREFIX = '/system-boot'
|
||||
|
||||
/**
|
||||
@@ -17,6 +17,11 @@ export const uploadFile = (file: any, path: string) => {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: form
|
||||
}).then(res => {
|
||||
if (res.code == `A0000`) {
|
||||
ElMessage.success('上传成功!')
|
||||
return res
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -50,7 +55,7 @@ export const downloadFile = (filePath: any) => {
|
||||
/**
|
||||
* 获取文件的短期url展示
|
||||
*/
|
||||
export const getFileUrl = (params:any) => {
|
||||
export const getFileUrl = (params: any) => {
|
||||
let form = new FormData()
|
||||
// form.append('filePath', filePath)
|
||||
return createAxios({
|
||||
|
||||
@@ -54,6 +54,54 @@
|
||||
<div class="content unicode" style="display: block;">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">253_ipower</div>
|
||||
<div class="code-name">&#xe782;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">电压</div>
|
||||
<div class="code-name">&#xe665;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">三相电压幅值不平衡</div>
|
||||
<div class="code-name">&#xe758;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">电压总谐波畸变率</div>
|
||||
<div class="code-name">&#xe61e;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">闪变</div>
|
||||
<div class="code-name">&#xe612;</div>
|
||||
</li>
|
||||
|
||||
<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">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">综合评价</div>
|
||||
@@ -234,9 +282,9 @@
|
||||
<pre><code class="language-css"
|
||||
>@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
||||
src: url('iconfont.woff2?t=1765612648830') format('woff2'),
|
||||
url('iconfont.woff?t=1765612648830') format('woff'),
|
||||
url('iconfont.ttf?t=1765612648830') format('truetype');
|
||||
}
|
||||
</code></pre>
|
||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||
@@ -262,6 +310,78 @@
|
||||
<div class="content font-class">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-a-253_ipower"></span>
|
||||
<div class="name">
|
||||
253_ipower
|
||||
</div>
|
||||
<div class="code-name">.icon-a-253_ipower
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-dianya"></span>
|
||||
<div class="name">
|
||||
电压
|
||||
</div>
|
||||
<div class="code-name">.icon-dianya
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-sanxiangdianyafuzhibupingheng"></span>
|
||||
<div class="name">
|
||||
三相电压幅值不平衡
|
||||
</div>
|
||||
<div class="code-name">.icon-sanxiangdianyafuzhibupingheng
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-dianyazongxiebojibianshuai"></span>
|
||||
<div class="name">
|
||||
电压总谐波畸变率
|
||||
</div>
|
||||
<div class="code-name">.icon-dianyazongxiebojibianshuai
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-shanbian"></span>
|
||||
<div class="name">
|
||||
闪变
|
||||
</div>
|
||||
<div class="code-name">.icon-shanbian
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<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">
|
||||
<span class="icon iconfont icon-zonghepingjia1"></span>
|
||||
<div class="name">
|
||||
@@ -532,6 +652,70 @@
|
||||
<div class="content symbol">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-a-253_ipower"></use>
|
||||
</svg>
|
||||
<div class="name">253_ipower</div>
|
||||
<div class="code-name">#icon-a-253_ipower</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-dianya"></use>
|
||||
</svg>
|
||||
<div class="name">电压</div>
|
||||
<div class="code-name">#icon-dianya</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-sanxiangdianyafuzhibupingheng"></use>
|
||||
</svg>
|
||||
<div class="name">三相电压幅值不平衡</div>
|
||||
<div class="code-name">#icon-sanxiangdianyafuzhibupingheng</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-dianyazongxiebojibianshuai"></use>
|
||||
</svg>
|
||||
<div class="name">电压总谐波畸变率</div>
|
||||
<div class="code-name">#icon-dianyazongxiebojibianshuai</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-shanbian"></use>
|
||||
</svg>
|
||||
<div class="name">闪变</div>
|
||||
<div class="code-name">#icon-shanbian</div>
|
||||
</li>
|
||||
|
||||
<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">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-zonghepingjia1"></use>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 3482754 */
|
||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
||||
src: url('iconfont.woff2?t=1765612648830') format('woff2'),
|
||||
url('iconfont.woff?t=1765612648830') format('woff'),
|
||||
url('iconfont.ttf?t=1765612648830') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@@ -13,6 +13,38 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-a-253_ipower:before {
|
||||
content: "\e782";
|
||||
}
|
||||
|
||||
.icon-dianya:before {
|
||||
content: "\e665";
|
||||
}
|
||||
|
||||
.icon-sanxiangdianyafuzhibupingheng:before {
|
||||
content: "\e758";
|
||||
}
|
||||
|
||||
.icon-dianyazongxiebojibianshuai:before {
|
||||
content: "\e61e";
|
||||
}
|
||||
|
||||
.icon-shanbian:before {
|
||||
content: "\e612";
|
||||
}
|
||||
|
||||
.icon-tingyunshijianguanli:before {
|
||||
content: "\e65d";
|
||||
}
|
||||
|
||||
.icon-zaiyunshebei:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
||||
.icon-yichanglei_14feizhinengbiaozaiyunyichang:before {
|
||||
content: "\e666";
|
||||
}
|
||||
|
||||
.icon-zonghepingjia1:before {
|
||||
content: "\e82f";
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,6 +5,62 @@
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "33424624",
|
||||
"name": "253_ipower",
|
||||
"font_class": "a-253_ipower",
|
||||
"unicode": "e782",
|
||||
"unicode_decimal": 59266
|
||||
},
|
||||
{
|
||||
"icon_id": "12331657",
|
||||
"name": "电压",
|
||||
"font_class": "dianya",
|
||||
"unicode": "e665",
|
||||
"unicode_decimal": 58981
|
||||
},
|
||||
{
|
||||
"icon_id": "33073330",
|
||||
"name": "三相电压幅值不平衡",
|
||||
"font_class": "sanxiangdianyafuzhibupingheng",
|
||||
"unicode": "e758",
|
||||
"unicode_decimal": 59224
|
||||
},
|
||||
{
|
||||
"icon_id": "37400988",
|
||||
"name": "电压总谐波畸变率",
|
||||
"font_class": "dianyazongxiebojibianshuai",
|
||||
"unicode": "e61e",
|
||||
"unicode_decimal": 58910
|
||||
},
|
||||
{
|
||||
"icon_id": "43700638",
|
||||
"name": "闪变",
|
||||
"font_class": "shanbian",
|
||||
"unicode": "e612",
|
||||
"unicode_decimal": 58898
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"name": "综合评价",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/assets/img/inlogo.png
Normal file
BIN
src/assets/img/inlogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -6,7 +6,7 @@
|
||||
</div> -->
|
||||
<TableHeader :showSearch="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -18,14 +18,22 @@ import VueOfficeDocx from '@vue-office/docx'
|
||||
import VueOfficeExcel from '@vue-office/excel'
|
||||
//引入VueOfficePdf组件
|
||||
import VueOfficePdf from '@vue-office/pdf'
|
||||
import { downloadFile } from '@/api/system-boot/file'
|
||||
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 = 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(() => {
|
||||
console.log()
|
||||
})
|
||||
|
||||
@@ -279,6 +279,27 @@ const getResultCss = (status) => {
|
||||
return ''
|
||||
}
|
||||
|
||||
const getTaskNameItemType = (itemStatus: any) => {
|
||||
if (itemStatus === 1) {
|
||||
return '审批中'
|
||||
}else if (itemStatus === 2) {
|
||||
return '审批通过'
|
||||
}else if (itemStatus === 3) {
|
||||
return '审批不通过'
|
||||
}else if (itemStatus === 4) {
|
||||
return '已取消'
|
||||
}else if (itemStatus === 5) {
|
||||
return '退回'
|
||||
} else if (itemStatus === 6) {
|
||||
return '委派'
|
||||
} else if (itemStatus === 7) {
|
||||
return '审批通过中'
|
||||
} else if (itemStatus === 0) {
|
||||
return '待审批'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
const getActivityOutgoing = (activity) => {
|
||||
// 如果有 outgoing,则直接使用它
|
||||
if (activity.outgoing && activity.outgoing.length > 0) {
|
||||
@@ -316,7 +337,9 @@ const elementHover = (element) => {
|
||||
!overlays.value && (overlays.value = bpmnModeler.get('overlays'))
|
||||
// 展示信息
|
||||
// console.log(activityLists.value, 'activityLists.value')
|
||||
// console.log(element.value, 'element.value')
|
||||
if (element.value.type === 'bpmn:SequenceFlow') {
|
||||
return
|
||||
}
|
||||
const activity = activityLists.value.find((m) => m.key === element.value.id)
|
||||
// console.log(activity, 'activityactivityactivityactivity')
|
||||
if (!activity) {
|
||||
@@ -330,22 +353,22 @@ const elementHover = (element) => {
|
||||
if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
|
||||
html = `<p>发起人:${processInstance.value.startUser.name}</p>
|
||||
<p>部门:${processInstance.value.startUser.deptName}</p>
|
||||
<p>创建时间:${formatDate(processInstance.value.createTime)}`
|
||||
<p>创建时间:${formatDate(processInstance.value.startTime)}`
|
||||
} else if (element.value.type === 'bpmn:UserTask') {
|
||||
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
||||
if (!task) {
|
||||
return
|
||||
}
|
||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
let dataResult = ''
|
||||
optionData.forEach((element) => {
|
||||
if (element.value == task.status) {
|
||||
dataResult = element.label
|
||||
}
|
||||
})
|
||||
// let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
// let dataResult = ''
|
||||
// optionData.forEach((element) => {
|
||||
// if (element.value == task.status) {
|
||||
// dataResult = element.label
|
||||
// }
|
||||
// })
|
||||
html = `<p>审批人:${task.assigneeUser.name}</p>
|
||||
<p>部门:${task.assigneeUser.deptName}</p>
|
||||
<p>结果:${dataResult}</p>
|
||||
<p>结果:${getTaskNameItemType(task.status)}</p>
|
||||
<p>创建时间:${formatDate(task.createTime)}</p>`
|
||||
// html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||
// <p>部门:${task.assigneeUser.deptName}</p>
|
||||
@@ -368,20 +391,20 @@ const elementHover = (element) => {
|
||||
html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
|
||||
}
|
||||
} else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
|
||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
let dataResult = ''
|
||||
optionData.forEach((element) => {
|
||||
if (element.value == processInstance.value.status) {
|
||||
dataResult = element.label
|
||||
}
|
||||
})
|
||||
html = `<p>结果:${dataResult}</p>`
|
||||
// let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||
// let dataResult = ''
|
||||
// optionData.forEach((element) => {
|
||||
// if (element.value == processInstance.value.status) {
|
||||
// dataResult = element.label
|
||||
// }
|
||||
// })
|
||||
// html = `<p>结果:${dataResult}</p>`
|
||||
// html = `<p>结果:${getIntDictOptions(
|
||||
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
||||
// processInstance.value.status
|
||||
// )}</p>`
|
||||
if (processInstance.value.endTime) {
|
||||
html += `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
||||
html = `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
||||
}
|
||||
}
|
||||
elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
|
||||
@@ -660,7 +683,7 @@ watch(
|
||||
}
|
||||
|
||||
.element-overlays {
|
||||
width: 200px;
|
||||
width: 250px;
|
||||
padding: 8px;
|
||||
color: #fafafa;
|
||||
background: rgb(0 0 0 / 60%);
|
||||
|
||||
@@ -1,491 +1,491 @@
|
||||
<template>
|
||||
<div class="panel-tab__content">
|
||||
<el-table :data="elementListenersList" size="small" border>
|
||||
<el-table-column label="序号" width="80px" type="index" />
|
||||
<el-table-column
|
||||
label="事件类型"
|
||||
min-width="80px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => listenerEventTypeObject[row.event]"
|
||||
/>
|
||||
<el-table-column label="事件id" min-width="80px" prop="id" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="监听器类型"
|
||||
min-width="80px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => listenerTypeObject[row.listenerType]"
|
||||
/>
|
||||
<el-table-column label="操作" width="90px">
|
||||
<template #default="scope">
|
||||
<el-button size="small" link @click="openListenerForm(scope.row, scope.$index)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-divider direction="vertical" />
|
||||
<el-button
|
||||
size="small"
|
||||
link
|
||||
style="color: #ff4d4f"
|
||||
@click="removeListener(scope.row, scope.$index)"
|
||||
>移除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="element-drawer__button">
|
||||
<XButton
|
||||
size="small"
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
title="添加监听器"
|
||||
@click="openListenerForm(null)"
|
||||
/>
|
||||
<XButton
|
||||
type="success"
|
||||
preIcon="ep:select"
|
||||
title="选择监听器"
|
||||
size="small"
|
||||
@click="openProcessListenerDialog"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 监听器 编辑/创建 部分 -->
|
||||
<el-drawer
|
||||
v-model="listenerFormModelVisible"
|
||||
title="任务监听器"
|
||||
:size="`${width}px`"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form size="small" :model="listenerForm" label-width="96px" ref="listenerFormRef">
|
||||
<el-form-item
|
||||
label="事件类型"
|
||||
prop="event"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-select v-model="listenerForm.event">
|
||||
<el-option
|
||||
v-for="i in Object.keys(listenerEventTypeObject)"
|
||||
:key="i"
|
||||
:label="listenerEventTypeObject[i]"
|
||||
:value="i"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="监听器ID"
|
||||
prop="id"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.id" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="监听器类型"
|
||||
prop="listenerType"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-select v-model="listenerForm.listenerType">
|
||||
<el-option
|
||||
v-for="i in Object.keys(listenerTypeObject)"
|
||||
:key="i"
|
||||
:label="listenerTypeObject[i]"
|
||||
:value="i"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.listenerType === 'classListener'"
|
||||
label="Java类"
|
||||
prop="class"
|
||||
key="listener-class"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.class" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.listenerType === 'expressionListener'"
|
||||
label="表达式"
|
||||
prop="expression"
|
||||
key="listener-expression"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.expression" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.listenerType === 'delegateExpressionListener'"
|
||||
label="代理表达式"
|
||||
prop="delegateExpression"
|
||||
key="listener-delegate"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.delegateExpression" clearable />
|
||||
</el-form-item>
|
||||
<template v-if="listenerForm.listenerType === 'scriptListener'">
|
||||
<el-form-item
|
||||
label="脚本格式"
|
||||
prop="scriptFormat"
|
||||
key="listener-script-format"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本格式' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.scriptFormat" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="脚本类型"
|
||||
prop="scriptType"
|
||||
key="listener-script-type"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择脚本类型' }"
|
||||
>
|
||||
<el-select v-model="listenerForm.scriptType">
|
||||
<el-option label="内联脚本" value="inlineScript" />
|
||||
<el-option label="外部脚本" value="externalScript" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.scriptType === 'inlineScript'"
|
||||
label="脚本内容"
|
||||
prop="value"
|
||||
key="listener-script"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本内容' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.value" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.scriptType === 'externalScript'"
|
||||
label="资源地址"
|
||||
prop="resource"
|
||||
key="listener-resource"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写资源地址' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.resource" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="listenerForm.event === 'timeout'">
|
||||
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
||||
<el-select v-model="listenerForm.eventDefinitionType">
|
||||
<el-option label="日期" value="date" />
|
||||
<el-option label="持续时长" value="duration" />
|
||||
<el-option label="循环" value="cycle" />
|
||||
<el-option label="无" value="null" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="!!listenerForm.eventDefinitionType && listenerForm.eventDefinitionType !== 'null'"
|
||||
label="定时器"
|
||||
prop="eventTimeDefinitions"
|
||||
key="eventTimeDefinitions"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写定时器配置' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.eventTimeDefinitions" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
|
||||
<el-divider />
|
||||
<p class="listener-filed__title">
|
||||
<span><Icon icon="ep:menu" />注入字段:</span>
|
||||
<el-button size="small" type="primary" @click="openListenerFieldForm(null)"
|
||||
>添加字段</el-button
|
||||
>
|
||||
</p>
|
||||
<el-table
|
||||
:data="fieldsListOfListener"
|
||||
size="small"
|
||||
max-height="240"
|
||||
fit
|
||||
border
|
||||
style="flex: none"
|
||||
>
|
||||
<el-table-column label="序号" width="80px" type="index" />
|
||||
<el-table-column label="字段名称" min-width="100px" prop="name" />
|
||||
<el-table-column
|
||||
label="字段类型"
|
||||
min-width="80px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => fieldTypeObject[row.fieldType]"
|
||||
/>
|
||||
<el-table-column
|
||||
label="字段值/表达式"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => row.string || row.expression"
|
||||
/>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="scope">
|
||||
<el-button size="small" link @click="openListenerFieldForm(scope.row, scope.$index)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-divider direction="vertical" />
|
||||
<el-button
|
||||
size="small"
|
||||
link
|
||||
style="color: #ff4d4f"
|
||||
@click="removeListenerField(scope.row, scope.$index)"
|
||||
>移除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="element-drawer__button">
|
||||
<el-button size="small" @click="listenerFormModelVisible = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" @click="saveListenerConfig">保 存</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<!-- 注入西段 编辑/创建 部分 -->
|
||||
<el-dialog
|
||||
title="字段配置"
|
||||
v-model="listenerFieldFormModelVisible"
|
||||
width="600px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form
|
||||
:model="listenerFieldForm"
|
||||
size="small"
|
||||
label-width="96px"
|
||||
ref="listenerFieldFormRef"
|
||||
style="height: 136px"
|
||||
>
|
||||
<el-form-item
|
||||
label="字段名称:"
|
||||
prop="name"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerFieldForm.name" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="字段类型:"
|
||||
prop="fieldType"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-select v-model="listenerFieldForm.fieldType">
|
||||
<el-option
|
||||
v-for="i in Object.keys(fieldTypeObject)"
|
||||
:key="i"
|
||||
:label="fieldTypeObject[i]"
|
||||
:value="i"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerFieldForm.fieldType === 'string'"
|
||||
label="字段值:"
|
||||
prop="string"
|
||||
key="field-string"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerFieldForm.string" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerFieldForm.fieldType === 'expression'"
|
||||
label="表达式:"
|
||||
prop="expression"
|
||||
key="field-expression"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerFieldForm.expression" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button size="small" @click="listenerFieldFormModelVisible = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" @click="saveListenerFiled">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<!-- 选择弹窗 -->
|
||||
<ProcessListenerDialog ref="processListenerDialogRef" @select="selectProcessListener" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { createListenerObject, updateElementExtensions } from '../../utils'
|
||||
import {
|
||||
initListenerForm,
|
||||
initListenerType,
|
||||
eventType,
|
||||
listenerType,
|
||||
fieldType,
|
||||
initListenerForm2
|
||||
} from './utilSelf'
|
||||
import ProcessListenerDialog from '@/components/bpmnProcessDesigner/package/penal/listeners/ProcessListenerDialog.vue'
|
||||
|
||||
defineOptions({ name: 'UserTaskListeners' })
|
||||
|
||||
const props = defineProps({
|
||||
id: String,
|
||||
type: String
|
||||
})
|
||||
const prefix = inject('prefix')
|
||||
const width = inject('width')
|
||||
const elementListenersList = ref<any[]>([])
|
||||
const listenerEventTypeObject = ref(eventType)
|
||||
const listenerTypeObject = ref(listenerType)
|
||||
const listenerFormModelVisible = ref(false)
|
||||
const listenerForm = ref<any>({})
|
||||
const fieldTypeObject = ref(fieldType)
|
||||
const fieldsListOfListener = ref<any[]>([])
|
||||
const listenerFieldFormModelVisible = ref(false) // 监听器 注入字段表单弹窗 显示状态
|
||||
const editingListenerIndex = ref(-1) // 监听器所在下标,-1 为新增
|
||||
const editingListenerFieldIndex = ref(-1) // 字段所在下标,-1 为新增
|
||||
const listenerFieldForm = ref<any>({}) // 监听器 注入字段 详情表单
|
||||
const bpmnElement = ref()
|
||||
const bpmnElementListeners = ref()
|
||||
const otherExtensionList = ref()
|
||||
const listenerFormRef = ref()
|
||||
const listenerFieldFormRef = ref()
|
||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||
|
||||
const resetListenersList = () => {
|
||||
// console.log(
|
||||
// bpmnInstances().bpmnElement,
|
||||
// 'window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement'
|
||||
// )
|
||||
bpmnElement.value = bpmnInstances().bpmnElement
|
||||
otherExtensionList.value = []
|
||||
bpmnElementListeners.value =
|
||||
bpmnElement.value.businessObject?.extensionElements?.values.filter(
|
||||
(ex) => ex.$type === `${prefix}:TaskListener`
|
||||
) ?? []
|
||||
elementListenersList.value = bpmnElementListeners.value.map((listener) =>
|
||||
initListenerType(listener)
|
||||
)
|
||||
}
|
||||
const openListenerForm = (listener, index?) => {
|
||||
if (listener) {
|
||||
listenerForm.value = initListenerForm(listener)
|
||||
editingListenerIndex.value = index
|
||||
} else {
|
||||
listenerForm.value = {}
|
||||
editingListenerIndex.value = -1 // 标记为新增
|
||||
}
|
||||
if (listener && listener.fields) {
|
||||
fieldsListOfListener.value = listener.fields.map((field) => ({
|
||||
...field,
|
||||
fieldType: field.string ? 'string' : 'expression'
|
||||
}))
|
||||
} else {
|
||||
fieldsListOfListener.value = []
|
||||
listenerForm.value['fields'] = []
|
||||
}
|
||||
// 打开侧边栏并清楚验证状态
|
||||
listenerFormModelVisible.value = true
|
||||
nextTick(() => {
|
||||
if (listenerFormRef.value) listenerFormRef.value.clearValidate()
|
||||
})
|
||||
}
|
||||
// 移除监听器
|
||||
const removeListener = (listener, index?) => {
|
||||
console.log(listener, 'listener')
|
||||
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
||||
confirmButtonText: '确 认',
|
||||
cancelButtonText: '取 消'
|
||||
})
|
||||
.then(() => {
|
||||
bpmnElementListeners.value.splice(index, 1)
|
||||
elementListenersList.value.splice(index, 1)
|
||||
updateElementExtensions(
|
||||
bpmnElement.value,
|
||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||
)
|
||||
})
|
||||
.catch(() => console.info('操作取消'))
|
||||
}
|
||||
// 保存监听器
|
||||
const saveListenerConfig = async () => {
|
||||
let validateStatus = await listenerFormRef.value.validate()
|
||||
if (!validateStatus) return // 验证不通过直接返回
|
||||
const listenerObject = createListenerObject(listenerForm.value, true, prefix)
|
||||
if (editingListenerIndex.value === -1) {
|
||||
bpmnElementListeners.value.push(listenerObject)
|
||||
elementListenersList.value.push(listenerForm.value)
|
||||
} else {
|
||||
bpmnElementListeners.value.splice(editingListenerIndex.value, 1, listenerObject)
|
||||
elementListenersList.value.splice(editingListenerIndex.value, 1, listenerForm.value)
|
||||
}
|
||||
// 保存其他配置
|
||||
otherExtensionList.value =
|
||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||
) ?? []
|
||||
updateElementExtensions(
|
||||
bpmnElement.value,
|
||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||
)
|
||||
// 4. 隐藏侧边栏
|
||||
listenerFormModelVisible.value = false
|
||||
listenerForm.value = {}
|
||||
}
|
||||
// 打开监听器字段编辑弹窗
|
||||
const openListenerFieldForm = (field, index?) => {
|
||||
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
|
||||
editingListenerFieldIndex.value = field ? index : -1
|
||||
listenerFieldFormModelVisible.value = true
|
||||
nextTick(() => {
|
||||
if (listenerFieldFormRef.value) listenerFieldFormRef.value.clearValidate()
|
||||
})
|
||||
}
|
||||
// 保存监听器注入字段
|
||||
const saveListenerFiled = async () => {
|
||||
let validateStatus = await listenerFieldFormRef.value.validate()
|
||||
if (!validateStatus) return // 验证不通过直接返回
|
||||
if (editingListenerFieldIndex.value === -1) {
|
||||
fieldsListOfListener.value.push(listenerFieldForm.value)
|
||||
listenerForm.value.fields.push(listenerFieldForm.value)
|
||||
} else {
|
||||
fieldsListOfListener.value.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||
listenerForm.value.fields.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||
}
|
||||
listenerFieldFormModelVisible.value = false
|
||||
nextTick(() => {
|
||||
listenerFieldForm.value = {}
|
||||
})
|
||||
}
|
||||
// 移除监听器字段
|
||||
const removeListenerField = (field, index) => {
|
||||
console.log(field, 'field')
|
||||
ElMessageBox.confirm('确认移除该字段吗?', '提示', {
|
||||
confirmButtonText: '确 认',
|
||||
cancelButtonText: '取 消'
|
||||
})
|
||||
.then(() => {
|
||||
fieldsListOfListener.value.splice(index, 1)
|
||||
listenerForm.value.fields.splice(index, 1)
|
||||
})
|
||||
.catch(() => console.info('操作取消'))
|
||||
}
|
||||
|
||||
// 打开监听器弹窗
|
||||
const processListenerDialogRef = ref()
|
||||
const openProcessListenerDialog = async () => {
|
||||
processListenerDialogRef.value.open('task')
|
||||
}
|
||||
const selectProcessListener = (listener) => {
|
||||
const listenerForm = initListenerForm2(listener)
|
||||
const listenerObject = createListenerObject(listenerForm, true, prefix)
|
||||
bpmnElementListeners.value.push(listenerObject)
|
||||
elementListenersList.value.push(listenerForm)
|
||||
|
||||
// 保存其他配置
|
||||
otherExtensionList.value =
|
||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||
) ?? []
|
||||
updateElementExtensions(
|
||||
bpmnElement.value,
|
||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||
)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.id,
|
||||
(val) => {
|
||||
val &&
|
||||
val.length &&
|
||||
nextTick(() => {
|
||||
resetListenersList()
|
||||
})
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
<template>
|
||||
<div class="panel-tab__content">
|
||||
<el-table :data="elementListenersList" size="small" border>
|
||||
<el-table-column label="序号" width="80px" type="index" />
|
||||
<el-table-column
|
||||
label="事件类型"
|
||||
min-width="80px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => listenerEventTypeObject[row.event]"
|
||||
/>
|
||||
<el-table-column label="事件id" min-width="80px" prop="id" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="监听器类型"
|
||||
min-width="80px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => listenerTypeObject[row.listenerType]"
|
||||
/>
|
||||
<el-table-column label="操作" width="90px">
|
||||
<template #default="scope">
|
||||
<el-button size="small" link @click="openListenerForm(scope.row, scope.$index)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-divider direction="vertical" />
|
||||
<el-button
|
||||
size="small"
|
||||
link
|
||||
style="color: #ff4d4f"
|
||||
@click="removeListener(scope.row, scope.$index)"
|
||||
>移除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="element-drawer__button">
|
||||
<XButton
|
||||
size="small"
|
||||
type="primary"
|
||||
preIcon="ep:plus"
|
||||
title="添加监听器"
|
||||
@click="openListenerForm(null)"
|
||||
/>
|
||||
<XButton
|
||||
type="success"
|
||||
preIcon="ep:select"
|
||||
title="选择监听器"
|
||||
size="small"
|
||||
@click="openProcessListenerDialog"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 监听器 编辑/创建 部分 -->
|
||||
<el-drawer
|
||||
v-model="listenerFormModelVisible"
|
||||
title="任务监听器"
|
||||
:size="`${width}px`"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form size="small" :model="listenerForm" label-width="96px" ref="listenerFormRef">
|
||||
<el-form-item
|
||||
label="事件类型"
|
||||
prop="event"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-select v-model="listenerForm.event">
|
||||
<el-option
|
||||
v-for="i in Object.keys(listenerEventTypeObject)"
|
||||
:key="i"
|
||||
:label="listenerEventTypeObject[i]"
|
||||
:value="i"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="监听器ID"
|
||||
prop="id"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.id" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="监听器类型"
|
||||
prop="listenerType"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-select v-model="listenerForm.listenerType">
|
||||
<el-option
|
||||
v-for="i in Object.keys(listenerTypeObject)"
|
||||
:key="i"
|
||||
:label="listenerTypeObject[i]"
|
||||
:value="i"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.listenerType === 'classListener'"
|
||||
label="Java类"
|
||||
prop="class"
|
||||
key="listener-class"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.class" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.listenerType === 'expressionListener'"
|
||||
label="表达式"
|
||||
prop="expression"
|
||||
key="listener-expression"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.expression" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.listenerType === 'delegateExpressionListener'"
|
||||
label="代理表达式"
|
||||
prop="delegateExpression"
|
||||
key="listener-delegate"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerForm.delegateExpression" clearable />
|
||||
</el-form-item>
|
||||
<template v-if="listenerForm.listenerType === 'scriptListener'">
|
||||
<el-form-item
|
||||
label="脚本格式"
|
||||
prop="scriptFormat"
|
||||
key="listener-script-format"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本格式' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.scriptFormat" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="脚本类型"
|
||||
prop="scriptType"
|
||||
key="listener-script-type"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择脚本类型' }"
|
||||
>
|
||||
<el-select v-model="listenerForm.scriptType">
|
||||
<el-option label="内联脚本" value="inlineScript" />
|
||||
<el-option label="外部脚本" value="externalScript" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.scriptType === 'inlineScript'"
|
||||
label="脚本内容"
|
||||
prop="value"
|
||||
key="listener-script"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本内容' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.value" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerForm.scriptType === 'externalScript'"
|
||||
label="资源地址"
|
||||
prop="resource"
|
||||
key="listener-resource"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写资源地址' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.resource" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="listenerForm.event === 'timeout'">
|
||||
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
||||
<el-select v-model="listenerForm.eventDefinitionType">
|
||||
<el-option label="统计时间" value="date" />
|
||||
<el-option label="持续时长" value="duration" />
|
||||
<el-option label="循环" value="cycle" />
|
||||
<el-option label="无" value="null" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="!!listenerForm.eventDefinitionType && listenerForm.eventDefinitionType !== 'null'"
|
||||
label="定时器"
|
||||
prop="eventTimeDefinitions"
|
||||
key="eventTimeDefinitions"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写定时器配置' }"
|
||||
>
|
||||
<el-input v-model="listenerForm.eventTimeDefinitions" clearable />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
|
||||
<el-divider />
|
||||
<p class="listener-filed__title">
|
||||
<span><Icon icon="ep:menu" />注入字段:</span>
|
||||
<el-button size="small" type="primary" @click="openListenerFieldForm(null)"
|
||||
>添加字段</el-button
|
||||
>
|
||||
</p>
|
||||
<el-table
|
||||
:data="fieldsListOfListener"
|
||||
size="small"
|
||||
max-height="240"
|
||||
fit
|
||||
border
|
||||
style="flex: none"
|
||||
>
|
||||
<el-table-column label="序号" width="80px" type="index" />
|
||||
<el-table-column label="字段名称" min-width="100px" prop="name" />
|
||||
<el-table-column
|
||||
label="字段类型"
|
||||
min-width="80px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => fieldTypeObject[row.fieldType]"
|
||||
/>
|
||||
<el-table-column
|
||||
label="字段值/表达式"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
:formatter="(row) => row.string || row.expression"
|
||||
/>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="scope">
|
||||
<el-button size="small" link @click="openListenerFieldForm(scope.row, scope.$index)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-divider direction="vertical" />
|
||||
<el-button
|
||||
size="small"
|
||||
link
|
||||
style="color: #ff4d4f"
|
||||
@click="removeListenerField(scope.row, scope.$index)"
|
||||
>移除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="element-drawer__button">
|
||||
<el-button size="small" @click="listenerFormModelVisible = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" @click="saveListenerConfig">保 存</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<!-- 注入西段 编辑/创建 部分 -->
|
||||
<el-dialog
|
||||
title="字段配置"
|
||||
v-model="listenerFieldFormModelVisible"
|
||||
width="600px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form
|
||||
:model="listenerFieldForm"
|
||||
size="small"
|
||||
label-width="96px"
|
||||
ref="listenerFieldFormRef"
|
||||
style="height: 136px"
|
||||
>
|
||||
<el-form-item
|
||||
label="字段名称:"
|
||||
prop="name"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerFieldForm.name" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="字段类型:"
|
||||
prop="fieldType"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-select v-model="listenerFieldForm.fieldType">
|
||||
<el-option
|
||||
v-for="i in Object.keys(fieldTypeObject)"
|
||||
:key="i"
|
||||
:label="fieldTypeObject[i]"
|
||||
:value="i"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerFieldForm.fieldType === 'string'"
|
||||
label="字段值:"
|
||||
prop="string"
|
||||
key="field-string"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerFieldForm.string" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="listenerFieldForm.fieldType === 'expression'"
|
||||
label="表达式:"
|
||||
prop="expression"
|
||||
key="field-expression"
|
||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||
>
|
||||
<el-input v-model="listenerFieldForm.expression" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button size="small" @click="listenerFieldFormModelVisible = false">取 消</el-button>
|
||||
<el-button size="small" type="primary" @click="saveListenerFiled">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<!-- 选择弹窗 -->
|
||||
<ProcessListenerDialog ref="processListenerDialogRef" @select="selectProcessListener" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { createListenerObject, updateElementExtensions } from '../../utils'
|
||||
import {
|
||||
initListenerForm,
|
||||
initListenerType,
|
||||
eventType,
|
||||
listenerType,
|
||||
fieldType,
|
||||
initListenerForm2
|
||||
} from './utilSelf'
|
||||
import ProcessListenerDialog from '@/components/bpmnProcessDesigner/package/penal/listeners/ProcessListenerDialog.vue'
|
||||
|
||||
defineOptions({ name: 'UserTaskListeners' })
|
||||
|
||||
const props = defineProps({
|
||||
id: String,
|
||||
type: String
|
||||
})
|
||||
const prefix = inject('prefix')
|
||||
const width = inject('width')
|
||||
const elementListenersList = ref<any[]>([])
|
||||
const listenerEventTypeObject = ref(eventType)
|
||||
const listenerTypeObject = ref(listenerType)
|
||||
const listenerFormModelVisible = ref(false)
|
||||
const listenerForm = ref<any>({})
|
||||
const fieldTypeObject = ref(fieldType)
|
||||
const fieldsListOfListener = ref<any[]>([])
|
||||
const listenerFieldFormModelVisible = ref(false) // 监听器 注入字段表单弹窗 显示状态
|
||||
const editingListenerIndex = ref(-1) // 监听器所在下标,-1 为新增
|
||||
const editingListenerFieldIndex = ref(-1) // 字段所在下标,-1 为新增
|
||||
const listenerFieldForm = ref<any>({}) // 监听器 注入字段 详情表单
|
||||
const bpmnElement = ref()
|
||||
const bpmnElementListeners = ref()
|
||||
const otherExtensionList = ref()
|
||||
const listenerFormRef = ref()
|
||||
const listenerFieldFormRef = ref()
|
||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||
|
||||
const resetListenersList = () => {
|
||||
// console.log(
|
||||
// bpmnInstances().bpmnElement,
|
||||
// 'window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement'
|
||||
// )
|
||||
bpmnElement.value = bpmnInstances().bpmnElement
|
||||
otherExtensionList.value = []
|
||||
bpmnElementListeners.value =
|
||||
bpmnElement.value.businessObject?.extensionElements?.values.filter(
|
||||
(ex) => ex.$type === `${prefix}:TaskListener`
|
||||
) ?? []
|
||||
elementListenersList.value = bpmnElementListeners.value.map((listener) =>
|
||||
initListenerType(listener)
|
||||
)
|
||||
}
|
||||
const openListenerForm = (listener, index?) => {
|
||||
if (listener) {
|
||||
listenerForm.value = initListenerForm(listener)
|
||||
editingListenerIndex.value = index
|
||||
} else {
|
||||
listenerForm.value = {}
|
||||
editingListenerIndex.value = -1 // 标记为新增
|
||||
}
|
||||
if (listener && listener.fields) {
|
||||
fieldsListOfListener.value = listener.fields.map((field) => ({
|
||||
...field,
|
||||
fieldType: field.string ? 'string' : 'expression'
|
||||
}))
|
||||
} else {
|
||||
fieldsListOfListener.value = []
|
||||
listenerForm.value['fields'] = []
|
||||
}
|
||||
// 打开侧边栏并清楚验证状态
|
||||
listenerFormModelVisible.value = true
|
||||
nextTick(() => {
|
||||
if (listenerFormRef.value) listenerFormRef.value.clearValidate()
|
||||
})
|
||||
}
|
||||
// 移除监听器
|
||||
const removeListener = (listener, index?) => {
|
||||
console.log(listener, 'listener')
|
||||
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
||||
confirmButtonText: '确 认',
|
||||
cancelButtonText: '取 消'
|
||||
})
|
||||
.then(() => {
|
||||
bpmnElementListeners.value.splice(index, 1)
|
||||
elementListenersList.value.splice(index, 1)
|
||||
updateElementExtensions(
|
||||
bpmnElement.value,
|
||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||
)
|
||||
})
|
||||
.catch(() => console.info('操作取消'))
|
||||
}
|
||||
// 保存监听器
|
||||
const saveListenerConfig = async () => {
|
||||
let validateStatus = await listenerFormRef.value.validate()
|
||||
if (!validateStatus) return // 验证不通过直接返回
|
||||
const listenerObject = createListenerObject(listenerForm.value, true, prefix)
|
||||
if (editingListenerIndex.value === -1) {
|
||||
bpmnElementListeners.value.push(listenerObject)
|
||||
elementListenersList.value.push(listenerForm.value)
|
||||
} else {
|
||||
bpmnElementListeners.value.splice(editingListenerIndex.value, 1, listenerObject)
|
||||
elementListenersList.value.splice(editingListenerIndex.value, 1, listenerForm.value)
|
||||
}
|
||||
// 保存其他配置
|
||||
otherExtensionList.value =
|
||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||
) ?? []
|
||||
updateElementExtensions(
|
||||
bpmnElement.value,
|
||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||
)
|
||||
// 4. 隐藏侧边栏
|
||||
listenerFormModelVisible.value = false
|
||||
listenerForm.value = {}
|
||||
}
|
||||
// 打开监听器字段编辑弹窗
|
||||
const openListenerFieldForm = (field, index?) => {
|
||||
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
|
||||
editingListenerFieldIndex.value = field ? index : -1
|
||||
listenerFieldFormModelVisible.value = true
|
||||
nextTick(() => {
|
||||
if (listenerFieldFormRef.value) listenerFieldFormRef.value.clearValidate()
|
||||
})
|
||||
}
|
||||
// 保存监听器注入字段
|
||||
const saveListenerFiled = async () => {
|
||||
let validateStatus = await listenerFieldFormRef.value.validate()
|
||||
if (!validateStatus) return // 验证不通过直接返回
|
||||
if (editingListenerFieldIndex.value === -1) {
|
||||
fieldsListOfListener.value.push(listenerFieldForm.value)
|
||||
listenerForm.value.fields.push(listenerFieldForm.value)
|
||||
} else {
|
||||
fieldsListOfListener.value.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||
listenerForm.value.fields.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||
}
|
||||
listenerFieldFormModelVisible.value = false
|
||||
nextTick(() => {
|
||||
listenerFieldForm.value = {}
|
||||
})
|
||||
}
|
||||
// 移除监听器字段
|
||||
const removeListenerField = (field, index) => {
|
||||
console.log(field, 'field')
|
||||
ElMessageBox.confirm('确认移除该字段吗?', '提示', {
|
||||
confirmButtonText: '确 认',
|
||||
cancelButtonText: '取 消'
|
||||
})
|
||||
.then(() => {
|
||||
fieldsListOfListener.value.splice(index, 1)
|
||||
listenerForm.value.fields.splice(index, 1)
|
||||
})
|
||||
.catch(() => console.info('操作取消'))
|
||||
}
|
||||
|
||||
// 打开监听器弹窗
|
||||
const processListenerDialogRef = ref()
|
||||
const openProcessListenerDialog = async () => {
|
||||
processListenerDialogRef.value.open('task')
|
||||
}
|
||||
const selectProcessListener = (listener) => {
|
||||
const listenerForm = initListenerForm2(listener)
|
||||
const listenerObject = createListenerObject(listenerForm, true, prefix)
|
||||
bpmnElementListeners.value.push(listenerObject)
|
||||
elementListenersList.value.push(listenerForm)
|
||||
|
||||
// 保存其他配置
|
||||
otherExtensionList.value =
|
||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||
) ?? []
|
||||
updateElementExtensions(
|
||||
bpmnElement.value,
|
||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||
)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.id,
|
||||
(val) => {
|
||||
val &&
|
||||
val.length &&
|
||||
nextTick(() => {
|
||||
resetListenersList()
|
||||
})
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -204,6 +204,7 @@ const tableStore: any = new TableStore({
|
||||
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'],
|
||||
@@ -364,6 +365,7 @@ watch(
|
||||
)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
.monitoringPoints {
|
||||
display: flex;
|
||||
.statistics {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<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: #ff6600">
|
||||
<span class="divBox_num" style="color: #57bc6e">
|
||||
{{ monitoringPoints.abnormalNum }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -90,7 +90,7 @@
|
||||
{{ o.citTotalNum }}
|
||||
</span>
|
||||
<!-- 低于90%监测点数 -->
|
||||
<span style="flex: 1; color: #ff9100" class="text">
|
||||
<span style="flex: 1; color: #388e3c" class="text">
|
||||
{{ o.citBelowNum }}
|
||||
</span>
|
||||
<span
|
||||
@@ -179,10 +179,17 @@ const tableStore: any = new TableStore({
|
||||
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
|
||||
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'],
|
||||
@@ -340,6 +347,7 @@ watch(
|
||||
)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
.monitoringPoints {
|
||||
display: flex;
|
||||
.statistics {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<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: #ff6600">
|
||||
<span class="divBox_num" style="color: #57bc6e">
|
||||
{{ monitoringPoints.abnormalNum }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -88,7 +88,7 @@
|
||||
{{ o.citTotalNum }}
|
||||
</span>
|
||||
<!-- 低于90%终端数 -->
|
||||
<span style="flex: 1; color: #ff9100" class="text">
|
||||
<span style="flex: 1; color: #388e3c" class="text">
|
||||
{{ o.citBelowNum }}
|
||||
</span>
|
||||
<span
|
||||
@@ -177,10 +177,18 @@ const tableStore: any = new TableStore({
|
||||
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
|
||||
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'],
|
||||
@@ -338,6 +346,7 @@ watch(
|
||||
)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
.monitoringPoints {
|
||||
display: flex;
|
||||
.statistics {
|
||||
|
||||
@@ -18,29 +18,53 @@
|
||||
>
|
||||
<div style="flex: 1">
|
||||
<div class="title">终端统计</div>
|
||||
<div style="height: 135px" class="box1">
|
||||
<div class="boxDiv hexagon">
|
||||
<div style="color: #fff">{{ statisticsList.allNum }}</div>
|
||||
<div class="mt10 divBot">总数</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="boxDiv hexagon hexagon1">
|
||||
<div style="color: #fff">{{ statisticsList.runNum }}</div>
|
||||
<div class="mt10 divBot">在运</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 135px" class="box1">
|
||||
<div class="boxDiv hexagon hexagon2">
|
||||
<div style="color: #fff">{{ statisticsList.checkNum }}</div>
|
||||
<div class="mt10 divBot">调试</div>
|
||||
</div>
|
||||
<div class="boxDiv hexagon hexagon3">
|
||||
<div style="color: #fff">{{ statisticsList.stopRunNum }}</div>
|
||||
<div class="mt10 divBot">停运</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="title">终端运行统计</div>
|
||||
|
||||
<div class="mb5" style="height: 40px">
|
||||
<el-segmented
|
||||
@@ -65,7 +89,7 @@
|
||||
<span style="width: 90px">终端总数</span>
|
||||
<span style="flex: 1">完整性(%)</span>
|
||||
<span style="flex: 1">在线率(%)</span>
|
||||
<span style="flex: 1">合格率(%)</span>
|
||||
<span style="flex: 1">异常率(%)</span>
|
||||
</div>
|
||||
<div
|
||||
:style="{
|
||||
@@ -84,7 +108,7 @@
|
||||
</span>
|
||||
<!-- -->
|
||||
<sp
|
||||
style="flex: 1; color: #ff9100"
|
||||
style="flex: 1; color: #388e3c"
|
||||
class="text"
|
||||
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
||||
>
|
||||
@@ -99,7 +123,7 @@
|
||||
</span>
|
||||
<span
|
||||
style="flex: 1; color: #388e3c"
|
||||
:class="` ${o.qualified < 90 ? 'text-red' : ''}`"
|
||||
:class="` ${o.qualified > 10 ? 'text-red' : ''}`"
|
||||
class="text"
|
||||
>
|
||||
{{ o.qualified }}
|
||||
@@ -205,11 +229,17 @@ const tableStore: any = new TableStore({
|
||||
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
|
||||
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(() => {
|
||||
@@ -234,6 +264,7 @@ watch(
|
||||
)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
.monitoringPoints {
|
||||
display: flex;
|
||||
}
|
||||
@@ -344,32 +375,7 @@ watch(
|
||||
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;
|
||||
@@ -427,4 +433,44 @@ watch(
|
||||
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>
|
||||
|
||||
@@ -15,7 +15,7 @@ import { color, gradeColor3 } from './color'
|
||||
import { useConfig } from '@/stores/config'
|
||||
const config = useConfig()
|
||||
// import { nextTick } from 'process'
|
||||
const emit = defineEmits(['triggerPoint', 'group'])
|
||||
const emit = defineEmits(['triggerPoint', 'group', 'echartClick'])
|
||||
color[0] = config.layout.elementUiPrimary[0]
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
|
||||
@@ -153,6 +153,9 @@ const initChart = () => {
|
||||
chart.on('click', function (params) {
|
||||
if (params.seriesName == '暂态触发点') {
|
||||
emit('triggerPoint', params.data)
|
||||
} else {
|
||||
|
||||
emit('echartClick', params)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
export let color = [
|
||||
'#07CCCA',
|
||||
'#00BFF5',
|
||||
'#FFBF00',
|
||||
'#77DA63',
|
||||
'#D5FF6B',
|
||||
'#Ff6600',
|
||||
'#FF9100',
|
||||
'#5B6E96',
|
||||
'#66FFCC',
|
||||
'#B3B'
|
||||
]
|
||||
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
||||
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
||||
export const color = [
|
||||
'#07CCCA',
|
||||
'#00BFF5',
|
||||
'#FFBF00',
|
||||
'#77DA63',
|
||||
'#D5FF6B',
|
||||
'#Ff6600',
|
||||
'#FF9100',
|
||||
'#5B6E96',
|
||||
'#66FFCC',
|
||||
'#B266FF',
|
||||
'#FF6680',
|
||||
'#40A0FF',
|
||||
'#33CC99'
|
||||
]
|
||||
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
||||
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
||||
|
||||
@@ -4,7 +4,7 @@ export const defaultAttribute: VxeTableProps = {
|
||||
align: 'center',
|
||||
headerCellClassName: 'table-header-cell',
|
||||
border: true,
|
||||
|
||||
stripe: true,
|
||||
size: 'small',
|
||||
columnConfig: { resizable: true },
|
||||
rowConfig: { isCurrent: true, isHover: true },
|
||||
@@ -13,6 +13,7 @@ export const defaultAttribute: VxeTableProps = {
|
||||
treeConfig: {
|
||||
reserve: true
|
||||
},
|
||||
|
||||
showOverflow: true
|
||||
showOverflow: true,
|
||||
showFooter:true
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
>
|
||||
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
||||
<template #label>
|
||||
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="时间" />
|
||||
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="统计时间" />
|
||||
<span v-else>{{ dateLabel }}</span>
|
||||
</template>
|
||||
<DatePicker
|
||||
@@ -111,7 +111,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
showReset: true,
|
||||
showExport: false,
|
||||
showTimeAll: false,
|
||||
dateLabel: '时间'
|
||||
dateLabel: '统计日期'
|
||||
})
|
||||
// 动态计算table高度
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
@@ -182,7 +182,7 @@ const handlerHeight = () => {
|
||||
}
|
||||
}
|
||||
const computedSearchRow = () => {
|
||||
if (!headerForm.value.$el) return
|
||||
if (!headerForm.value?.$el) return
|
||||
// 清空headerFormSecond.value.$el下的元素
|
||||
while (headerFormSecond.value.$el.firstChild) {
|
||||
headerForm.value.$el.appendChild(headerFormSecond.value.$el.firstChild)
|
||||
@@ -231,6 +231,16 @@ const setDatePicker = (list: any) => {
|
||||
const onResetForm = () => {
|
||||
//时间重置成默认值
|
||||
datePickerRef.value?.setTheDate(3)
|
||||
|
||||
if (props.datePicker && timeAll.value) {
|
||||
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
tableStore.table.params.startTime = datePickerRef.value.timeValue[0]
|
||||
tableStore.table.params.endTime = datePickerRef.value.timeValue[1]
|
||||
tableStore.table.params.timeFlag = datePickerRef.value.timeFlag
|
||||
tableStore.table.params.interval = datePickerRef.value.interval
|
||||
}
|
||||
|
||||
tableStore.onTableAction('reset', {})
|
||||
}
|
||||
const setTheDate = (val: any) => {
|
||||
@@ -238,7 +248,7 @@ const setTheDate = (val: any) => {
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
console.log('导出')
|
||||
|
||||
tableStore.onTableAction('export', { showAllFlag: true })
|
||||
}
|
||||
|
||||
|
||||
205
src/components/tree/details/monitoringPointDetails.vue
Normal file
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
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,162 +1,272 @@
|
||||
<template>
|
||||
<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'"
|
||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 mt20 menu-collapse"
|
||||
style="cursor: pointer" />
|
||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||
<div style="display: flex; align-items: center" class="mb10">
|
||||
<el-input v-model="filterText" placeholder="请输入内容" clearable maxlength="10" show-word-limit @input="change">
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
</el-input>
|
||||
<Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||
:class="menuCollapse ? 'unfold' : ''" 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>
|
||||
<el-tree 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 }">
|
||||
<span class="custom-tree-node">
|
||||
<Icon :name="data.icon" style="font-size: 16px" :style="{ color: data.color }"
|
||||
v-if="data.icon" />
|
||||
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||
import { ElTree } from 'element-plus'
|
||||
import { ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'govern/tree'
|
||||
})
|
||||
const emit = defineEmits(['onAddTree'])
|
||||
interface Props {
|
||||
width?: string
|
||||
canExpand?: boolean
|
||||
addTree?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
width: '280px',
|
||||
canExpand: true,
|
||||
addTree: false
|
||||
})
|
||||
const { proxy } = useCurrentInstance()
|
||||
const menuCollapse = ref(false)
|
||||
const filterText = ref('')
|
||||
const defaultProps = {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g;
|
||||
const change=(val) => {
|
||||
|
||||
|
||||
if (specialCharsPattern.test(val)) {
|
||||
ElMessage.warning('禁止输入特殊字符!')
|
||||
filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
||||
console.log("🚀 ~ change ~ filterText.value:", filterText.value)
|
||||
|
||||
treeRef.value!.filter(filterText.value)
|
||||
}else{
|
||||
treeRef.value!.filter(filterText.value)
|
||||
}
|
||||
}
|
||||
// watch(filterText, val => {
|
||||
|
||||
// console.log("🚀 ~ val:", specialCharsPattern.test(val))
|
||||
// if (specialCharsPattern.test(val)) {
|
||||
// ElMessage.warning('禁止输入特殊字符!')
|
||||
// filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
||||
// console.log("🚀 ~ filterText.value:", filterText.value)
|
||||
// treeRef.value!.filter(filterText.value)
|
||||
// }else{
|
||||
// treeRef.value!.filter(filterText.value)
|
||||
// }
|
||||
|
||||
// })
|
||||
const onMenuCollapse = () => {
|
||||
menuCollapse.value = !menuCollapse.value
|
||||
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||
}
|
||||
const filterNode = (value: string, data: any, node: any) => {
|
||||
if (!value) return true
|
||||
// return data.name.includes(value)
|
||||
if (data.name) {
|
||||
|
||||
return chooseNode(value, data, node)
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||
const chooseNode = (value: string, data: any, node: any) => {
|
||||
|
||||
if (data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
const level = node.level
|
||||
// 如果传入的节点本身就是一级节点就不用校验了
|
||||
if (level === 1) {
|
||||
return false
|
||||
}
|
||||
// 先取当前节点的父节点
|
||||
let parentData = node.parent
|
||||
// 遍历当前节点的父节点
|
||||
let index = 0
|
||||
while (index < level - 1) {
|
||||
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||
if (parentData.data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
// 否则的话再往上一层做匹配
|
||||
parentData = parentData.parent
|
||||
index++
|
||||
}
|
||||
// 没匹配到返回false
|
||||
return false
|
||||
}
|
||||
// 添加树
|
||||
const onAddTree = () => {
|
||||
emit('onAddTree')
|
||||
}
|
||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||
defineExpose({ treeRef })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cn-tree {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-tree) {
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
|
||||
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||
background-color: var(--el-color-primary-light-7);
|
||||
}
|
||||
|
||||
.menu-collapse {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<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'"
|
||||
:class="menuCollapse ? 'unfold' : ''"
|
||||
size="18"
|
||||
class="fold ml10 mt20 menu-collapse"
|
||||
style="cursor: pointer"
|
||||
/>
|
||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||
<div style="display: flex; align-items: center" class="mb10">
|
||||
<el-input
|
||||
v-model="filterText"
|
||||
placeholder="请输入内容"
|
||||
clearable
|
||||
maxlength="10"
|
||||
show-word-limit
|
||||
@input="change"
|
||||
>
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
</el-input>
|
||||
<Icon
|
||||
@click="onMenuCollapse"
|
||||
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||
:class="menuCollapse ? 'unfold' : ''"
|
||||
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>
|
||||
<el-tree
|
||||
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 }">
|
||||
<span class="custom-tree-node">
|
||||
<Icon
|
||||
:name="data.icon"
|
||||
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>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
<!-- 变电站详情 -->
|
||||
<SubstationDetails ref="SubstationRef" />
|
||||
<!-- 监测点详情 -->
|
||||
<MonitoringPointDetails ref="MonitoringPointRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||
import { ElTree } from 'element-plus'
|
||||
import { ref, watch, onMounted, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import MonitoringPointDetails from './details/monitoringPointDetails.vue'
|
||||
import SubstationDetails from './details/substationDetails.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/tree'
|
||||
})
|
||||
const emit = defineEmits(['onAddTree'])
|
||||
interface Props {
|
||||
width?: string
|
||||
canExpand?: boolean
|
||||
addTree?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
width: '280px',
|
||||
canExpand: true,
|
||||
addTree: false
|
||||
})
|
||||
const { proxy } = useCurrentInstance()
|
||||
const menuCollapse = ref(false)
|
||||
const MonitoringPointRef = ref()
|
||||
const SubstationRef = ref()
|
||||
const filterText = ref('')
|
||||
const treeRef = ref()
|
||||
const defaultProps = {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g
|
||||
const change = val => {
|
||||
if (specialCharsPattern.test(val)) {
|
||||
ElMessage.warning('禁止输入特殊字符!')
|
||||
filterText.value = val.replace(
|
||||
/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g,
|
||||
''
|
||||
)
|
||||
console.log('🚀 ~ change ~ filterText.value:', filterText.value)
|
||||
|
||||
treeRef.value!.filter(filterText.value)
|
||||
} else {
|
||||
treeRef.value!.filter(filterText.value)
|
||||
}
|
||||
}
|
||||
// watch(filterText, val => {
|
||||
|
||||
// console.log("🚀 ~ val:", specialCharsPattern.test(val))
|
||||
// if (specialCharsPattern.test(val)) {
|
||||
// ElMessage.warning('禁止输入特殊字符!')
|
||||
// filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
||||
// console.log("🚀 ~ filterText.value:", filterText.value)
|
||||
// treeRef.value!.filter(filterText.value)
|
||||
// }else{
|
||||
// treeRef.value!.filter(filterText.value)
|
||||
// }
|
||||
|
||||
// })
|
||||
const onMenuCollapse = () => {
|
||||
menuCollapse.value = !menuCollapse.value
|
||||
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) => {
|
||||
if (!value) return true
|
||||
// return data.name.includes(value)
|
||||
if (data.name) {
|
||||
return chooseNode(value, data, node)
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||
const chooseNode = (value: string, data: any, node: any) => {
|
||||
if (data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
const level = node.level
|
||||
// 如果传入的节点本身就是一级节点就不用校验了
|
||||
if (level === 1) {
|
||||
return false
|
||||
}
|
||||
// 先取当前节点的父节点
|
||||
let parentData = node.parent
|
||||
// 遍历当前节点的父节点
|
||||
let index = 0
|
||||
while (index < level - 1) {
|
||||
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||
if (parentData.data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
// 否则的话再往上一层做匹配
|
||||
parentData = parentData.parent
|
||||
index++
|
||||
}
|
||||
// 没匹配到返回false
|
||||
return false
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
// 等待树渲染完成
|
||||
await nextTick()
|
||||
// 可以等待更长时间确保树完全展开
|
||||
})
|
||||
|
||||
const scrollToNode = (id: string) => {
|
||||
console.log("🚀 ~ scrollToNode ~ id:", id)
|
||||
if (!treeRef.value) return
|
||||
|
||||
// 获取目标节点的元素
|
||||
const targetNode = treeRef.value.getNode(id)
|
||||
if (!targetNode) return
|
||||
|
||||
// 获取节点的DOM元素
|
||||
const nodeElement = document.querySelector(`[data-key="${id}"]`)
|
||||
if (nodeElement) {
|
||||
// 滚动到节点位置
|
||||
nodeElement.scrollIntoView({
|
||||
behavior: 'smooth', // 平滑滚动
|
||||
block: 'center', // 垂直方向居中
|
||||
inline: 'nearest' // 水平方向最近
|
||||
})
|
||||
|
||||
// 如果需要高亮当前节点
|
||||
treeRef.value.setCurrentKey(id)
|
||||
}
|
||||
}
|
||||
// 添加树
|
||||
const onAddTree = () => {
|
||||
emit('onAddTree')
|
||||
}
|
||||
defineExpose({ treeRef, scrollToNode })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cn-tree {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-tree) {
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
|
||||
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||
background-color: var(--el-color-primary-light-7);
|
||||
}
|
||||
|
||||
.menu-collapse {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</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>
|
||||
|
||||
@@ -14,9 +14,7 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { defineProps } from 'vue'
|
||||
import {
|
||||
getTree
|
||||
} from '@/api/advance-boot/assess'
|
||||
import { getTree } from '@/api/advance-boot/assess'
|
||||
|
||||
defineOptions({
|
||||
name: 'pms/pointTree'
|
||||
@@ -46,25 +44,24 @@ const formData = ref({
|
||||
scale: null
|
||||
})
|
||||
|
||||
|
||||
// 添加数据转换函数
|
||||
const transformTreeData = (data: any[]) => {
|
||||
if (!data || !Array.isArray(data)) return [];
|
||||
if (!data || !Array.isArray(data)) return []
|
||||
return data.map(item => {
|
||||
// 创建新对象,确保不修改原始数据
|
||||
const newItem: any = {
|
||||
name: item.treeName ,
|
||||
id: item.treeId ,
|
||||
name: item.treeName,
|
||||
id: item.treeId,
|
||||
children: []
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// 递归处理子节点
|
||||
if (item.children && Array.isArray(item.children)) {
|
||||
newItem.children = transformTreeData(item.children);
|
||||
newItem.children = transformTreeData(item.children)
|
||||
}
|
||||
return newItem;
|
||||
});
|
||||
};
|
||||
return newItem
|
||||
})
|
||||
}
|
||||
|
||||
const loadData = () => {
|
||||
let obj = classificationData.find(function (i) {
|
||||
@@ -73,19 +70,22 @@ const loadData = () => {
|
||||
let form = JSON.parse(JSON.stringify(formData.value))
|
||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||
let nodeKey = ''
|
||||
getTree({}).then(res => {
|
||||
// 转换数据结构为指定格式
|
||||
const transformedData = transformTreeData(res.data);
|
||||
|
||||
// 确保有数据再进行处理
|
||||
if (transformedData && transformedData.length > 0 &&
|
||||
transformedData[0].children && transformedData[0].children.length > 0) {
|
||||
|
||||
getTree({}).then(res => {
|
||||
// 转换数据结构为指定格式
|
||||
const transformedData = transformTreeData(res.data)
|
||||
|
||||
// 确保有数据再进行处理
|
||||
if (
|
||||
transformedData &&
|
||||
transformedData.length > 0 &&
|
||||
transformedData[0].children &&
|
||||
transformedData[0].children.length > 0
|
||||
) {
|
||||
nodeKey = transformedData[0].children[0].id
|
||||
emit('init', transformedData[0].children[0])
|
||||
|
||||
tree.value = transformedData
|
||||
|
||||
|
||||
if (nodeKey) {
|
||||
nextTick(() => {
|
||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||
@@ -94,7 +94,15 @@ const loadData = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const scrollToNode = (id: string) => {
|
||||
// 树滚动
|
||||
treeRef.value.scrollToNode(id)
|
||||
}
|
||||
loadData()
|
||||
defineExpose({
|
||||
tree,
|
||||
scrollToNode
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.point-tree {
|
||||
|
||||
@@ -135,11 +135,17 @@ const loadData = () => {
|
||||
if (nodeKey) {
|
||||
nextTick(() => {
|
||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||
|
||||
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const scrollToNode = (id: string) => {
|
||||
// 树滚动
|
||||
treeRef.value.scrollToNode(id)
|
||||
}
|
||||
defineExpose({ treeRef, scrollToNode, tree })
|
||||
loadData()
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
33
src/main.ts
33
src/main.ts
@@ -16,12 +16,14 @@ import '@/assets/font/iconfont.css'
|
||||
import { ElDialog } from 'element-plus'
|
||||
import BaiduMap from 'vue-baidu-map-3x'
|
||||
import BaiduMapOffline from 'vue-baidu-map-offline'
|
||||
|
||||
import ExcelJS from 'exceljs'
|
||||
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
|
||||
// 方式1:NPM 安装,注入 ExcelJS 对象
|
||||
VXETable.use(VXETablePluginExportXLSX, {
|
||||
ExcelJS
|
||||
})
|
||||
// 全局注册 tooltip 组件
|
||||
window.XEUtils = XEUtils
|
||||
|
||||
// 初始化多语言
|
||||
@@ -35,21 +37,21 @@ const setupAll = async () => {
|
||||
const app = createApp(App)
|
||||
|
||||
//开启离线地图
|
||||
// app.use(BaiduMapOffline, {
|
||||
// offline: true,
|
||||
// offlineConfig: {
|
||||
// imgext: '.png',
|
||||
// customstyle: '',
|
||||
// tiles_dir: '',
|
||||
// tiles_hybrid: '',
|
||||
// tiles_self: '',
|
||||
// tiles_v_dir: '',
|
||||
// tiles_satellite_dir: '',
|
||||
// tiles_road_dir: '',
|
||||
// tiles_v_road_dir: '',
|
||||
// home: './plugin/offline/'
|
||||
// }
|
||||
// })
|
||||
app.use(BaiduMapOffline, {
|
||||
offline: true,
|
||||
offlineConfig: {
|
||||
imgext: '.png',
|
||||
customstyle: '',
|
||||
tiles_dir: '',
|
||||
tiles_hybrid: '',
|
||||
tiles_self: '',
|
||||
tiles_v_dir: '',
|
||||
tiles_satellite_dir: '',
|
||||
tiles_road_dir: '',
|
||||
tiles_v_road_dir: '',
|
||||
home: './plugin/offline/'
|
||||
}
|
||||
})
|
||||
app.use(BaiduMap, {
|
||||
// ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
||||
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN',
|
||||
@@ -61,6 +63,7 @@ const setupAll = async () => {
|
||||
app.use(pinia)
|
||||
app.use(ElementPlus)
|
||||
app.use(VXETable)
|
||||
|
||||
;(app._context.components.ElDialog as typeof ElDialog).props.closeOnClickModal.default = false
|
||||
registerIcons(app) // icons
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ export const useDictStore = defineStore('dict', {
|
||||
}
|
||||
},
|
||||
getDictByType(type: string) {
|
||||
console.log("🚀 ~ type:", type)
|
||||
if (!this.isSetDict) {
|
||||
this.setDictMap()
|
||||
}
|
||||
|
||||
@@ -373,3 +373,4 @@ body,
|
||||
.w-e-scroll {
|
||||
min-height: 200px !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -268,3 +268,8 @@
|
||||
.el-drawer__body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.aLoad{
|
||||
color: var(--el-color-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -8,29 +8,31 @@ $primary-light: #3f6ad8;
|
||||
// --ba-background
|
||||
$bg-color: () !default;
|
||||
$bg-color: map.merge(
|
||||
(
|
||||
'': #edf0f3,
|
||||
'overlay': #ffffff,
|
||||
),
|
||||
$bg-color
|
||||
(
|
||||
'': #edf0f3,
|
||||
'overlay': #ffffff
|
||||
),
|
||||
$bg-color
|
||||
);
|
||||
|
||||
// --ba-border-color
|
||||
$border-color: () !default;
|
||||
$border-color: map.merge(
|
||||
(
|
||||
'': #f6f6f6,
|
||||
),
|
||||
$border-color
|
||||
(
|
||||
'': #f6f6f6
|
||||
),
|
||||
$border-color
|
||||
);
|
||||
|
||||
:root {
|
||||
@include set-css-var-value('main-space', $main-space);
|
||||
@include set-css-var-value('color-primary-light', $primary-light);
|
||||
@include set-component-css-var('bg-color', $bg-color);
|
||||
@include set-component-css-var('border-color', $border-color);
|
||||
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
||||
// --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);
|
||||
@include set-css-var-value('main-space', $main-space);
|
||||
@include set-css-var-value('color-primary-light', $primary-light);
|
||||
@include set-component-css-var('bg-color', $bg-color);
|
||||
@include set-component-css-var('border-color', $border-color);
|
||||
--vxe-ui-table-row-current-background-color: var(--el-color-primary-light-8);
|
||||
--vxe-ui-table-row-hover-current-background-color: var(--el-color-primary-light-8);
|
||||
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
||||
// --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 {
|
||||
background: var(--vxe-table-header-background-color);
|
||||
color: var(--vxe-table-header-font-color);
|
||||
font-size: 14px;
|
||||
background: var(--vxe-table-header-background-color);
|
||||
color: var(--vxe-table-header-font-color);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.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-checkbox--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,
|
||||
@@ -38,40 +38,41 @@
|
||||
.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--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 {
|
||||
z-index: 10000 !important;
|
||||
z-index: 10000 !important;
|
||||
}
|
||||
|
||||
.is--disabled {
|
||||
background-color: var(--vxe-input-disabled-color);
|
||||
background-color: var(--vxe-input-disabled-color);
|
||||
}
|
||||
|
||||
.vxe-modal--wrapper {
|
||||
z-index: 5000 !important;
|
||||
z-index: 5000 !important;
|
||||
}
|
||||
|
||||
.vxe-table--body .vxe-body--row:nth-child(even) {
|
||||
background-color: #f9f9f9;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.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 {
|
||||
width: 10px !important;
|
||||
width: 10px !important;
|
||||
}
|
||||
|
||||
.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 {
|
||||
background-color: #000 !important;
|
||||
background-color: #000 !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,10 @@
|
||||
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
||||
color: var(--el-color-primary-light-5);
|
||||
}
|
||||
|
||||
.vxe-table--render-default .vxe-body--row.row--current,
|
||||
.vxe-table--render-default .vxe-body--row.row--current:hover {
|
||||
background-color: var(--el-color-primary-light-8);
|
||||
}
|
||||
// .vxe-table--render-default .is--disabled.vxe-cell--checkbox .vxe-checkbox--icon{
|
||||
// color: #fff0;
|
||||
// }
|
||||
@@ -77,14 +80,14 @@
|
||||
.vxe-modal--wrapper {
|
||||
z-index: 5000 !important;
|
||||
}
|
||||
.vxe-table--body .vxe-body--row:nth-child(even) {
|
||||
background-color: #f9f9f9;
|
||||
// background-color: var(--el-color-primary-light-9);
|
||||
}
|
||||
// .vxe-table--body .vxe-body--row:nth-child(even) {
|
||||
// background-color: #f9f9f9;
|
||||
// // background-color: var(--el-color-primary-light-9);
|
||||
// }
|
||||
|
||||
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
// .vxe-table--body .vxe-body--row:nth-child(odd) {
|
||||
// background-color: #ffffff;
|
||||
// }
|
||||
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
||||
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
||||
width: 10px !important;
|
||||
|
||||
@@ -40,6 +40,7 @@ export const getIntDictOptions = (dictType: string): NumberDictDataType[] => {
|
||||
value: parseInt(dict.value + '')
|
||||
})
|
||||
})
|
||||
console.log("🚀 ~ getIntDictOptions ~ dictOption:", dictOption)
|
||||
return dictOption
|
||||
}
|
||||
|
||||
|
||||
42
src/utils/fileDownLoad.ts
Normal file
42
src/utils/fileDownLoad.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { downloadFile } from '@/api/system-boot/file'
|
||||
// 下载文件
|
||||
export const download = (urls: string) => {
|
||||
console.log("🚀 ~ download ~ urls:", urls)
|
||||
downloadFile({ filePath: urls }).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: urls.includes('.pdf')
|
||||
? 'application/pdf'
|
||||
: urls.includes('.zip')
|
||||
? 'application/zip'
|
||||
: urls.includes('.doc')
|
||||
? 'application/msword'
|
||||
: urls.includes('.docx')
|
||||
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
: urls.includes('.xls')
|
||||
? 'application/vnd.ms-excel'
|
||||
: urls.includes('.xlsx')
|
||||
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
: urls.includes('.png')
|
||||
? 'image/png'
|
||||
: urls.includes('.jpeg')
|
||||
? 'image/jpeg'
|
||||
: urls.includes('.jpg')
|
||||
? 'image/jpg'
|
||||
: ''
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
let name = removeLastDotSuffix(urls.split('/')[2])
|
||||
link.href = url
|
||||
link.download = name
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
}
|
||||
function removeLastDotSuffix(str: string) {
|
||||
// 找到最后一个 . 的位置
|
||||
const lastDotIndex = str.lastIndexOf('.')
|
||||
// 如果存在 .,截取到 . 之前的部分;否则返回原字符串
|
||||
return lastDotIndex !== -1 ? str.slice(0, lastDotIndex) : str
|
||||
}
|
||||
@@ -362,3 +362,4 @@ export function getTimeOfTheMonth(key: string): [string, string] {
|
||||
throw new Error('Invalid key')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ export default class TableStore {
|
||||
* @param data 携带数据
|
||||
*/
|
||||
onTableAction = (event: string, data: anyObj) => {
|
||||
|
||||
const actionFun = new Map([
|
||||
[
|
||||
'search',
|
||||
@@ -202,6 +203,7 @@ export default class TableStore {
|
||||
'export',
|
||||
() => {
|
||||
// this.index()
|
||||
console.log('export')
|
||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||
createAxios(
|
||||
Object.assign(
|
||||
@@ -213,6 +215,7 @@ export default class TableStore {
|
||||
)
|
||||
).then(res => {
|
||||
this.table.allData = filtration(res.data.records || res.data)
|
||||
console.log('11111',this.table.allData)
|
||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||
this.table.allFlag = data.showAllFlag || true
|
||||
})
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -146,7 +146,7 @@ const tableStore: any = new TableStore({
|
||||
{ field: 'describe', title: '事件描述' },
|
||||
{ field: 'type', title: '事件类型', sortable: true },
|
||||
{ field: 'result', title: '操作结果', sortable: true },
|
||||
{ field: 'ip', title: '操作IP' },
|
||||
{ field: 'ip', title: '操作IP' ,width:'120px'},
|
||||
{ field: 'level', title: '事件等级', sortable: true }
|
||||
],
|
||||
loadCallback: () => {
|
||||
|
||||
@@ -26,7 +26,7 @@ const tableStore: any = new TableStore({
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ field: 'userName', title: '登录用户' },
|
||||
{ field: 'ip', title: '登录ip' },
|
||||
{ field: 'ip', title: '登录ip' ,width:'120px'},
|
||||
{ field: 'time', title: '登录时间' }
|
||||
]
|
||||
})
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<pane style="background: #fff">
|
||||
<TableHeader :showSearch="false" v-show="props.rowList.id == undefined">
|
||||
<template #select>
|
||||
<el-form-item label="时间">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -205,7 +205,7 @@ const props = defineProps(['rowList'])
|
||||
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
||||
const currentLod = ref(false)
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const size = ref(0)
|
||||
const size = ref(23)
|
||||
const dictData = useDictData()
|
||||
const datePickerRef = ref()
|
||||
const height = mainHeight(80).height
|
||||
|
||||
@@ -270,7 +270,7 @@ const tableStore = new TableStore({
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '名称', field: 'name' },
|
||||
{ title: 'IP', field: 'ip' },
|
||||
{ title: 'IP', field: 'ip' ,width:'120px' },
|
||||
{
|
||||
title: '等级',
|
||||
field: 'nodeGrade',
|
||||
@@ -332,29 +332,29 @@ const tableStore = new TableStore({
|
||||
formData.value = JSON.parse(JSON.stringify(row))
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '重启',
|
||||
type: 'warning',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'warning',
|
||||
title: '确定重启吗?'
|
||||
},
|
||||
click: row => {
|
||||
askRestartProcess({
|
||||
deviceRebootType: null,
|
||||
nodeId: row.id,
|
||||
processNo: 1
|
||||
}).then(res => {
|
||||
ElMessage.success('重启成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
},
|
||||
// {
|
||||
// name: 'edit',
|
||||
// title: '重启',
|
||||
// type: 'warning',
|
||||
// icon: 'el-icon-Delete',
|
||||
// render: 'confirmButton',
|
||||
// popconfirm: {
|
||||
// confirmButtonText: '确认',
|
||||
// cancelButtonText: '取消',
|
||||
// confirmButtonType: 'warning',
|
||||
// title: '确定重启吗?'
|
||||
// },
|
||||
// click: row => {
|
||||
// askRestartProcess({
|
||||
// deviceRebootType: null,
|
||||
// nodeId: row.id,
|
||||
// processNo: 1
|
||||
// }).then(res => {
|
||||
// ElMessage.success('重启成功')
|
||||
// tableStore.index()
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
|
||||
{
|
||||
name: 'del',
|
||||
@@ -579,7 +579,7 @@ const addMenu = () => {}
|
||||
:deep(.default) {
|
||||
display: flex;
|
||||
.row--current {
|
||||
background-color: var(--el-color-primary-light-8) !important;
|
||||
// background-color: var(--el-color-primary-light-8) !important;
|
||||
}
|
||||
}
|
||||
.custom-tree-node {
|
||||
|
||||
@@ -1,355 +1,355 @@
|
||||
<template>
|
||||
<div class="default-main" style="position: relative">
|
||||
<TableHeader>
|
||||
<template #select>
|
||||
<el-form-item label="终端型号">
|
||||
<el-select v-model="tableStore.table.params.teriminal" clearable placeholder="请选择终端型号">
|
||||
<el-option
|
||||
v-for="item in teriminaloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端状态">
|
||||
<el-select v-model="tableStore.table.params.teriminalstatus" clearable placeholder="请选择终端状态">
|
||||
<el-option
|
||||
v-for="item in teriminalstatusoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯状态">
|
||||
<el-select v-model="tableStore.table.params.state" clearable placeholder="请选择通讯状态">
|
||||
<el-option
|
||||
v-for="item in stateoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="程序版本">
|
||||
<el-select v-model="tableStore.table.params.program" clearable placeholder="请选择程序版本">
|
||||
<el-option
|
||||
v-for="item in programoption"
|
||||
: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.filterName"
|
||||
@keyup="searchEvent"
|
||||
placeholder="输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" @click="add">导出</el-button>
|
||||
<el-button icon="el-icon-Check" @click="add">批量升级</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||
<vxe-table
|
||||
v-loading="tableStore.table.loading"
|
||||
height="auto"
|
||||
auto-resize
|
||||
ref="tableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="treeData"
|
||||
show-overflow
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
>
|
||||
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
||||
<vxe-column field="devType" title="终端型号" :formatter="formFilter"></vxe-column>
|
||||
<vxe-column field="versionName" title="版本号"></vxe-column>
|
||||
<vxe-column field="protocol" title="协议版本"></vxe-column>
|
||||
<vxe-column field="versionDate" title="版本日期"></vxe-column>
|
||||
<vxe-column field="runFlag" title="终端状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.runFlag === 0" style="color: #fff; background: #0099cc" size="small">
|
||||
投运
|
||||
</el-tag>
|
||||
<el-tag v-if="row.runFlag === 1" style="color: #fff; background: #996600" size="small">
|
||||
检修
|
||||
</el-tag>
|
||||
<el-tag v-if="row.runFlag === 2" style="color: #fff; background: #A52a2a" size="small">
|
||||
停运
|
||||
</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="comFlag" title="通讯状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.comFlag === 0" style="color: #fff; background: #A52a2a" size="small">
|
||||
中断
|
||||
</el-tag>
|
||||
<el-tag v-if="row.comFlag === 1" style="color: #fff; background: #2e8b57" size="small">
|
||||
正常
|
||||
</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="updateBy" title="升级人员">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.updateBy == null || row.updateBy == '/'">--</span>
|
||||
<span v-else>{{ row.updateBy }}</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="updateTime" title="最新升级时间"></vxe-column>
|
||||
<vxe-column title="操作" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button>
|
||||
<el-button
|
||||
v-if="row.level == 4"
|
||||
:disabled="row.state == 1 ? true : false"
|
||||
size="small"
|
||||
link
|
||||
@click="queryview(row)"
|
||||
>
|
||||
日志查看
|
||||
</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:title="protitle + '#终端升级日志查看'"
|
||||
width="70%"
|
||||
>
|
||||
<div :style="{ height: dialogHeight.height }">
|
||||
<vxe-table height="auto" auto-resize :data="logtableData" v-bind="defaultAttribute">
|
||||
<vxe-column field="devTypeName" align="center" title="终端序号"></vxe-column>
|
||||
<vxe-column field="versionId" align="center" title="版本序号"></vxe-column>
|
||||
<vxe-column field="flag" align="center" title="版本状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.flag == true" style="color: #fff; background: #fc0">前期版本</el-tag>
|
||||
<el-tag v-if="row.flag == false" style="color: #fff; background: #0c0">当前版本</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="result" align="center" title="升级结果" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.result == false" style="color: #fff; background: #f30">升级失败</el-tag>
|
||||
<el-tag v-if="row.result == true" style="color: #fff; background: #093">升级成功</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="state" align="center" title="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.state == false" style="color: #fff; background: #f30">删除</el-tag>
|
||||
<el-tag v-if="row.state == true" style="color: #fff; background: #093">正常</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="createBy" align="center" title="创建用户"></vxe-column>
|
||||
<vxe-column field="createTime" align="center" title="创建时间"></vxe-column>
|
||||
<vxe-column field="updateTime" align="center" title="升级时间"></vxe-column>
|
||||
<vxe-column field="updateBy" align="center" title="升级人员"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 升级 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="prodialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:title="protitle + '#终端程序升级'"
|
||||
width="40%"
|
||||
>
|
||||
<el-col v-for="(item, index) in percentageoption" :key="index">
|
||||
<span style="font-size: 14px; font-weight: bold">{{ item.name }}</span>
|
||||
:
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="item.percentage"
|
||||
:status="item.status"
|
||||
:format="format"
|
||||
></el-progress>
|
||||
</el-col>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { getTerminalUpLog } from '@/api/device-boot/Business'
|
||||
import XEUtils from 'xe-utils'
|
||||
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
defineOptions({
|
||||
name: 'BusinessAdministrator/TerminalManagement/ProgramManagement'
|
||||
})
|
||||
|
||||
const pageHeight = mainHeight(83)
|
||||
const dialogHeight = mainHeight(300)
|
||||
const dictData = useDictData()
|
||||
const teriminaloption: any = ref([])
|
||||
const teriminalstatusoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '投运', id: 0 },
|
||||
{ name: '检修', id: 1 },
|
||||
{ name: '停运', id: 2 }
|
||||
])
|
||||
const stateoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '正常', id: 1 },
|
||||
{ name: '中断', id: 0 }
|
||||
])
|
||||
const prodialogVisible = ref(false)
|
||||
const dialogVisible = ref(false)
|
||||
const protitle = ref('')
|
||||
const treeData: any = ref([])
|
||||
const treeDataCopy: any = ref([])
|
||||
//进度条对象
|
||||
const percentageoption = ref([
|
||||
{
|
||||
name: '1号测试终端',
|
||||
status: 'exception',
|
||||
percentage: 20
|
||||
},
|
||||
{
|
||||
name: '2号测试终端',
|
||||
status: 'warning',
|
||||
percentage: 50
|
||||
},
|
||||
{
|
||||
name: '3号测试终端',
|
||||
status: 'success',
|
||||
percentage: 90
|
||||
}
|
||||
])
|
||||
const programoption: any = ref([])
|
||||
const logtableData: any = ref([])
|
||||
const tableRef = ref()
|
||||
const status = ref('')
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/version/getTerminalVersionList',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data.forEach((item: any) => {
|
||||
// if (item.children.length > 0) {
|
||||
// item.id = item.children[0].pid
|
||||
// }
|
||||
// })
|
||||
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||
setTimeout(() => {
|
||||
tableRef.value.setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
tableStore.table.params.teriminal = ''
|
||||
tableStore.table.params.state = ''
|
||||
tableStore.table.params.program = ''
|
||||
tableStore.table.params.searchEvent = ''
|
||||
tableStore.table.params.filterName = ''
|
||||
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是否存在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
|
||||
}
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.searchState = 0
|
||||
onMounted(() => {
|
||||
getDevTypeList().then(res => {
|
||||
teriminaloption.value = res.data
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
const add = () => {}
|
||||
const updateprogram = (row: any) => {
|
||||
protitle.value = row.name
|
||||
prodialogVisible.value = true
|
||||
}
|
||||
const queryview = (row: any) => {
|
||||
dialogVisible.value = true
|
||||
protitle.value = row.name
|
||||
let data = {
|
||||
id: row.id
|
||||
}
|
||||
getTerminalUpLog(data).then((res: any) => {
|
||||
logtableData.value = res.data
|
||||
})
|
||||
}
|
||||
const format = (percentage: any) => {
|
||||
if (percentage <= 100 && percentage >= 90) {
|
||||
status.value = 'success'
|
||||
return percentage === 100 ? '升级成功' : `${percentage}%`
|
||||
} else if (percentage > 0 && percentage < 50) {
|
||||
status.value = 'exception'
|
||||
return percentage <= 20 ? '升级失败' + percentage + '%' : `${percentage}%`
|
||||
} else if (percentage > 0 && percentage <= 50) {
|
||||
status.value = 'warning'
|
||||
return percentage <= 50 ? '升级中断' : `${percentage}%`
|
||||
}
|
||||
}
|
||||
const formFilter = (row: any) => {
|
||||
let title = '/'
|
||||
if (row.cellValue != null) {
|
||||
teriminaloption.value.forEach((item: any) => {
|
||||
if (item.id == row.cellValue) {
|
||||
title = item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
// 表格过滤
|
||||
const searchEvent = debounce(e => {
|
||||
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
||||
if (filterVal) {
|
||||
const options = { children: 'children' }
|
||||
const searchProps = ['name']
|
||||
const rest = XEUtils.searchTree(
|
||||
treeDataCopy,
|
||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||
options
|
||||
)
|
||||
|
||||
treeData.value = rest
|
||||
|
||||
// 搜索之后默认展开所有子节点
|
||||
} else {
|
||||
treeData.value = treeDataCopy
|
||||
}
|
||||
nextTick(() => {
|
||||
const $table = tableRef.value
|
||||
if ($table) {
|
||||
$table.setAllTreeExpand(true)
|
||||
}
|
||||
})
|
||||
}, 300)
|
||||
</script>
|
||||
<template>
|
||||
<div class="default-main" style="position: relative">
|
||||
<TableHeader>
|
||||
<template #select>
|
||||
<el-form-item label="终端型号">
|
||||
<el-select v-model="tableStore.table.params.teriminal" clearable placeholder="请选择终端型号">
|
||||
<el-option
|
||||
v-for="item in teriminaloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端状态">
|
||||
<el-select v-model="tableStore.table.params.teriminalstatus" clearable placeholder="请选择终端状态">
|
||||
<el-option
|
||||
v-for="item in teriminalstatusoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯状态">
|
||||
<el-select v-model="tableStore.table.params.state" clearable placeholder="请选择通讯状态">
|
||||
<el-option
|
||||
v-for="item in stateoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="程序版本">
|
||||
<el-select v-model="tableStore.table.params.program" clearable placeholder="请选择程序版本">
|
||||
<el-option
|
||||
v-for="item in programoption"
|
||||
: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.filterName"
|
||||
@keyup="searchEvent"
|
||||
placeholder="输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" @click="add">导出</el-button>
|
||||
<el-button icon="el-icon-Check" @click="add">批量升级</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||
<vxe-table
|
||||
v-loading="tableStore.table.loading"
|
||||
height="auto"
|
||||
auto-resize
|
||||
ref="tableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="treeData"
|
||||
show-overflow
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
>
|
||||
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
||||
<vxe-column field="devType" title="终端型号" :formatter="formFilter"></vxe-column>
|
||||
<vxe-column field="versionName" title="版本号"></vxe-column>
|
||||
<vxe-column field="protocol" title="协议版本"></vxe-column>
|
||||
<vxe-column field="versionDate" title="版本日期"></vxe-column>
|
||||
<vxe-column field="runFlag" title="终端状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.runFlag === 0" style="color: #fff; background: #0099cc" size="small">
|
||||
投运
|
||||
</el-tag>
|
||||
<el-tag v-if="row.runFlag === 1" style="color: #fff; background: #996600" size="small">
|
||||
检修
|
||||
</el-tag>
|
||||
<el-tag v-if="row.runFlag === 2" style="color: #fff; background: #A52a2a" size="small">
|
||||
停运
|
||||
</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="comFlag" title="通讯状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.comFlag === 0" style="color: #fff; background: #A52a2a" size="small">
|
||||
中断
|
||||
</el-tag>
|
||||
<el-tag v-if="row.comFlag === 1" style="color: #fff; background: #2e8b57" size="small">
|
||||
正常
|
||||
</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="updateBy" title="升级人员">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.updateBy == null || row.updateBy == '/'">--</span>
|
||||
<span v-else>{{ row.updateBy }}</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="updateTime" title="最新升级时间"></vxe-column>
|
||||
<vxe-column title="操作" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button>
|
||||
<el-button
|
||||
v-if="row.level == 4"
|
||||
:disabled="row.state == 1 ? true : false"
|
||||
size="small"
|
||||
link
|
||||
@click="queryview(row)"
|
||||
>
|
||||
日志查看
|
||||
</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:title="protitle + '#终端升级日志查看'"
|
||||
width="70%"
|
||||
>
|
||||
<div :style="{ height: dialogHeight.height }">
|
||||
<vxe-table height="auto" auto-resize :data="logtableData" v-bind="defaultAttribute">
|
||||
<vxe-column field="devTypeName" align="center" title="终端序号"></vxe-column>
|
||||
<vxe-column field="versionId" align="center" title="版本序号"></vxe-column>
|
||||
<vxe-column field="flag" align="center" title="版本状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.flag == true" style="color: #fff; background: #fc0">前期版本</el-tag>
|
||||
<el-tag v-if="row.flag == false" style="color: #fff; background: #0c0">当前版本</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="result" align="center" title="升级结果" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.result == false" style="color: #fff; background: #f30">升级失败</el-tag>
|
||||
<el-tag v-if="row.result == true" style="color: #fff; background: #093">升级成功</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="state" align="center" title="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.state == false" style="color: #fff; background: #f30">删除</el-tag>
|
||||
<el-tag v-if="row.state == true" style="color: #fff; background: #093">正常</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="createBy" align="center" title="创建用户"></vxe-column>
|
||||
<vxe-column field="createTime" align="center" title="创建时间"></vxe-column>
|
||||
<vxe-column field="updateTime" align="center" title="升级时间"></vxe-column>
|
||||
<vxe-column field="updateBy" align="center" title="升级人员"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 升级 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="prodialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:title="protitle + '#终端程序升级'"
|
||||
width="40%"
|
||||
>
|
||||
<el-col v-for="(item, index) in percentageoption" :key="index">
|
||||
<span style="font-size: 14px; font-weight: bold">{{ item.name }}</span>
|
||||
:
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="item.percentage"
|
||||
:status="item.status"
|
||||
:format="format"
|
||||
></el-progress>
|
||||
</el-col>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { getTerminalUpLog } from '@/api/device-boot/Business'
|
||||
import XEUtils from 'xe-utils'
|
||||
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
defineOptions({
|
||||
name: 'BusinessAdministrator/TerminalManagement/ProgramManagement'
|
||||
})
|
||||
|
||||
const pageHeight = mainHeight(83)
|
||||
const dialogHeight = mainHeight(300)
|
||||
const dictData = useDictData()
|
||||
const teriminaloption: any = ref([])
|
||||
const teriminalstatusoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '投运', id: 0 },
|
||||
{ name: '检修', id: 1 },
|
||||
{ name: '停运', id: 2 }
|
||||
])
|
||||
const stateoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '正常', id: 1 },
|
||||
{ name: '中断', id: 0 }
|
||||
])
|
||||
const prodialogVisible = ref(false)
|
||||
const dialogVisible = ref(false)
|
||||
const protitle = ref('')
|
||||
const treeData: any = ref([])
|
||||
const treeDataCopy: any = ref([])
|
||||
//进度条对象
|
||||
const percentageoption = ref([
|
||||
{
|
||||
name: '1号测试终端',
|
||||
status: 'exception',
|
||||
percentage: 20
|
||||
},
|
||||
{
|
||||
name: '2号测试终端',
|
||||
status: 'warning',
|
||||
percentage: 50
|
||||
},
|
||||
{
|
||||
name: '3号测试终端',
|
||||
status: 'success',
|
||||
percentage: 90
|
||||
}
|
||||
])
|
||||
const programoption: any = ref([])
|
||||
const logtableData: any = ref([])
|
||||
const tableRef = ref()
|
||||
const status = ref('')
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/version/getTerminalVersionList',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data.forEach((item: any) => {
|
||||
// if (item.children.length > 0) {
|
||||
// item.id = item.children[0].pid
|
||||
// }
|
||||
// })
|
||||
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||
setTimeout(() => {
|
||||
tableRef.value.setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
tableStore.table.params.teriminal = ''
|
||||
tableStore.table.params.state = ''
|
||||
tableStore.table.params.program = ''
|
||||
tableStore.table.params.searchEvent = ''
|
||||
tableStore.table.params.filterName = ''
|
||||
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是否存在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
|
||||
}
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.searchState = 0
|
||||
onMounted(() => {
|
||||
getDevTypeList().then(res => {
|
||||
teriminaloption.value = res.data
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
const add = () => {}
|
||||
const updateprogram = (row: any) => {
|
||||
protitle.value = row.name
|
||||
prodialogVisible.value = true
|
||||
}
|
||||
const queryview = (row: any) => {
|
||||
dialogVisible.value = true
|
||||
protitle.value = row.name
|
||||
let data = {
|
||||
id: row.id
|
||||
}
|
||||
getTerminalUpLog(data).then((res: any) => {
|
||||
logtableData.value = res.data
|
||||
})
|
||||
}
|
||||
const format = (percentage: any) => {
|
||||
if (percentage <= 100 && percentage >= 90) {
|
||||
status.value = 'success'
|
||||
return percentage === 100 ? '升级成功' : `${percentage}%`
|
||||
} else if (percentage > 0 && percentage < 50) {
|
||||
status.value = 'exception'
|
||||
return percentage <= 20 ? '升级失败' + percentage + '%' : `${percentage}%`
|
||||
} else if (percentage > 0 && percentage <= 50) {
|
||||
status.value = 'warning'
|
||||
return percentage <= 50 ? '升级中断' : `${percentage}%`
|
||||
}
|
||||
}
|
||||
const formFilter = (row: any) => {
|
||||
let title = '/'
|
||||
if (row.cellValue != null) {
|
||||
teriminaloption.value.forEach((item: any) => {
|
||||
if (item.id == row.cellValue) {
|
||||
title = item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
// 表格过滤
|
||||
const searchEvent = debounce(e => {
|
||||
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
||||
if (filterVal) {
|
||||
const options = { children: 'children' }
|
||||
const searchProps = ['name']
|
||||
const rest = XEUtils.searchTree(
|
||||
treeDataCopy,
|
||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||
options
|
||||
)
|
||||
|
||||
treeData.value = rest
|
||||
|
||||
// 搜索之后默认展开所有子节点
|
||||
} else {
|
||||
treeData.value = treeDataCopy
|
||||
}
|
||||
nextTick(() => {
|
||||
const $table = tableRef.value
|
||||
if ($table) {
|
||||
$table.setAllTreeExpand(true)
|
||||
}
|
||||
})
|
||||
}, 300)
|
||||
</script>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
:checkbox-config="{ labelField: 'name' }"
|
||||
>
|
||||
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
||||
<vxe-column field="ip" title="网络参数"></vxe-column>
|
||||
<vxe-column field="ip" title="网络参数" width="120px"></vxe-column>
|
||||
<vxe-column field="runFlag" title="终端状态" v-if="key == 0">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.runFlag === 0" type="success" size="small">投运</el-tag>
|
||||
|
||||
@@ -1,282 +1,282 @@
|
||||
<template>
|
||||
<div class="default-main" style="position: relative">
|
||||
<TableHeader>
|
||||
<template #select>
|
||||
<el-form-item label="终端型号">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.devType"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择终端型号"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in teriminaloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端状态">
|
||||
<el-select v-model="tableStore.table.params.runFlag" clearable placeholder="请选择终端状态">
|
||||
<el-option
|
||||
v-for="item in teriminalstatusoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯状态">
|
||||
<el-select v-model="tableStore.table.params.comFlag" clearable placeholder="请选择通讯状态">
|
||||
<el-option
|
||||
v-for="item in stateoption"
|
||||
: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.filterName"
|
||||
@keyup="searchEvent"
|
||||
clearable
|
||||
placeholder="输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-DataLine" @click="manage('终端状态管理', 0)">
|
||||
终端状态管理
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" icon="el-icon-Operation" @click="manage('流量套餐配置', 1)">
|
||||
流量套餐配置
|
||||
</el-button> -->
|
||||
<!-- <el-button type="primary" icon="el-icon-Menu" @click="manage('流量策略配置', 2)">
|
||||
流量策略配置
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-Histogram" @click="liultjData">流量统计</el-button> -->
|
||||
<!-- <el-button type="primary" icon="el-icon-Setting" @click="resect">重启前置程序</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||
<vxe-table
|
||||
v-loading="tableStore.table.loading"
|
||||
height="auto"
|
||||
auto-resize
|
||||
ref="tableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="treeData"
|
||||
show-overflow
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
:checkbox-config="{ labelField: 'name' }"
|
||||
>
|
||||
<vxe-column
|
||||
field="name"
|
||||
align="left"
|
||||
type="checkbox"
|
||||
title="电网拓扑"
|
||||
min-width="200"
|
||||
tree-node
|
||||
></vxe-column>
|
||||
<vxe-column field="devType" title="终端型号">
|
||||
<template #default="{ row }">
|
||||
{{ teriminaloption.find((item: any) => item.id === row.devType)?.name }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="version" title="版本信息"></vxe-column>
|
||||
<vxe-column field="ip" title="网络参数"></vxe-column>
|
||||
|
||||
<vxe-column field="runFlag" title="终端状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.runFlag === 0" type="success" :disable-transitions="true" size="small">投运</el-tag>
|
||||
<el-tag v-if="row.runFlag === 1" type="warning" :disable-transitions="true" size="small">检修</el-tag>
|
||||
<el-tag v-if="row.runFlag === 2" type="danger" :disable-transitions="true" size="small">停运</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="comFlag" title="通讯状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.comFlag === 0" type="danger" :disable-transitions="true" size="small">中断</el-tag>
|
||||
<el-tag v-if="row.comFlag === 1" type="success" :disable-transitions="true" size="small">正常</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="操作" width="160">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button v-if="row.level === 4" type="primary" size="small" link @click="uesdealia(row)">
|
||||
终端详情
|
||||
</el-button> -->
|
||||
<el-button v-if="row.level === 4" type="primary" size="small" link @click="log(row)">
|
||||
查看日志
|
||||
</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<!-- 终端详情 -->
|
||||
<detail ref="detailRef" />
|
||||
<!-- 配置 -->
|
||||
<disposition ref="dispositionRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 日志 -->
|
||||
<Log ref="logRef" v-if="logFlag" @close="logFlag = false" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick, reactive } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
||||
import XEUtils from 'xe-utils'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
import disposition from './components/disposition.vue'
|
||||
import detail from './components/detail.vue'
|
||||
import Log from './components/log.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
|
||||
defineOptions({
|
||||
name: 'BusinessAdministrator/TerminalManagement/TerminalManagement'
|
||||
})
|
||||
const dispositionRef = ref()
|
||||
const detailRef = ref()
|
||||
const logRef = ref()
|
||||
const dictData = useDictData()
|
||||
const logFlag = ref(false)
|
||||
const teriminaloption: any = ref([])
|
||||
|
||||
const teriminalstatusoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '投运', id: 0 },
|
||||
{ name: '检修', id: 1 },
|
||||
{ name: '停运', id: 2 }
|
||||
])
|
||||
const stateoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '正常', id: 1 },
|
||||
{ name: '中断', id: 0 }
|
||||
])
|
||||
const treeData: any = ref([])
|
||||
const treeDataCopy: any = ref([])
|
||||
|
||||
const tableRef = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/maintain/getTerminalMainList',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
loadCallback: () => {
|
||||
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||
setTimeout(() => {
|
||||
tableRef.value.setAllTreeExpand(true)
|
||||
}, 0)
|
||||
searchEvent()
|
||||
}
|
||||
})
|
||||
tableStore.table.params.devType = ''
|
||||
tableStore.table.params.runFlag = ''
|
||||
tableStore.table.params.comFlag = ''
|
||||
tableStore.table.params.filterName = ''
|
||||
// 处理大数据卡顿
|
||||
const tree2List = (list: any, id: any) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
|
||||
// 判断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
|
||||
}
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.searchState = 0
|
||||
onMounted(() => {
|
||||
getDevTypeList().then(res => {
|
||||
teriminaloption.value = res.data
|
||||
})
|
||||
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
// 终端状态管理
|
||||
const manage = (name: string, key: number) => {
|
||||
const $table = tableRef.value
|
||||
if ($table) {
|
||||
const selectRecords = $table
|
||||
.getCheckboxRecords()
|
||||
.filter((item: any) => item.level == 4)
|
||||
.map(item => item.id)
|
||||
console.log('🚀 ~ deviceData ~ selectRecords:', selectRecords)
|
||||
if (selectRecords.length == 0) {
|
||||
return ElMessage({
|
||||
message: '请至少选择一台装置',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
dispositionRef.value.open({
|
||||
title: name,
|
||||
id: selectRecords,
|
||||
key: key
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 流量统计
|
||||
const liultjData = () => {}
|
||||
// 重启前置程序
|
||||
const resect = () => {}
|
||||
|
||||
// 终端详情
|
||||
const uesdealia = (row: any) => {
|
||||
detailRef.value.open(row)
|
||||
}
|
||||
// 流量详情
|
||||
const log = (row: any) => {
|
||||
logFlag.value = true
|
||||
setTimeout(() => {
|
||||
logRef.value.open(row)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
// 表格过滤
|
||||
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
|
||||
)
|
||||
treeData.value = rest
|
||||
|
||||
// 搜索之后默认展开所有子节点
|
||||
} else {
|
||||
treeData.value = treeDataCopy.value
|
||||
}
|
||||
nextTick(() => {
|
||||
const $table = tableRef.value
|
||||
if ($table) {
|
||||
$table.setAllTreeExpand(true)
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
</script>
|
||||
<template>
|
||||
<div class="default-main" style="position: relative">
|
||||
<TableHeader>
|
||||
<template #select>
|
||||
<el-form-item label="终端型号">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.devType"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择终端型号"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in teriminaloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端状态">
|
||||
<el-select v-model="tableStore.table.params.runFlag" clearable placeholder="请选择终端状态">
|
||||
<el-option
|
||||
v-for="item in teriminalstatusoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯状态">
|
||||
<el-select v-model="tableStore.table.params.comFlag" clearable placeholder="请选择通讯状态">
|
||||
<el-option
|
||||
v-for="item in stateoption"
|
||||
: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.filterName"
|
||||
@keyup="searchEvent"
|
||||
clearable
|
||||
placeholder="输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-DataLine" @click="manage('终端状态管理', 0)">
|
||||
终端状态管理
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" icon="el-icon-Operation" @click="manage('流量套餐配置', 1)">
|
||||
流量套餐配置
|
||||
</el-button> -->
|
||||
<!-- <el-button type="primary" icon="el-icon-Menu" @click="manage('流量策略配置', 2)">
|
||||
流量策略配置
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-Histogram" @click="liultjData">流量统计</el-button> -->
|
||||
<!-- <el-button type="primary" icon="el-icon-Setting" @click="resect">重启前置程序</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||
<vxe-table
|
||||
v-loading="tableStore.table.loading"
|
||||
height="auto"
|
||||
auto-resize
|
||||
ref="tableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="treeData"
|
||||
show-overflow
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
:checkbox-config="{ labelField: 'name' }"
|
||||
>
|
||||
<vxe-column
|
||||
field="name"
|
||||
align="left"
|
||||
type="checkbox"
|
||||
title="电网拓扑"
|
||||
min-width="200"
|
||||
tree-node
|
||||
></vxe-column>
|
||||
<vxe-column field="devType" title="终端型号">
|
||||
<template #default="{ row }">
|
||||
{{ teriminaloption.find((item: any) => item.id === row.devType)?.name }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="version" title="版本信息"></vxe-column>
|
||||
<vxe-column field="ip" title="网络参数" width="120px"></vxe-column>
|
||||
|
||||
<vxe-column field="runFlag" title="终端状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.runFlag === 0" type="success" :disable-transitions="true" size="small">投运</el-tag>
|
||||
<el-tag v-if="row.runFlag === 1" type="warning" :disable-transitions="true" size="small">检修</el-tag>
|
||||
<el-tag v-if="row.runFlag === 2" type="danger" :disable-transitions="true" size="small">停运</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="comFlag" title="通讯状态">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.comFlag === 0" type="danger" :disable-transitions="true" size="small">中断</el-tag>
|
||||
<el-tag v-if="row.comFlag === 1" type="success" :disable-transitions="true" size="small">正常</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="操作" width="160">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button v-if="row.level === 4" type="primary" size="small" link @click="uesdealia(row)">
|
||||
终端详情
|
||||
</el-button> -->
|
||||
<el-button v-if="row.level === 4" type="primary" size="small" link @click="log(row)">
|
||||
查看日志
|
||||
</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<!-- 终端详情 -->
|
||||
<detail ref="detailRef" />
|
||||
<!-- 配置 -->
|
||||
<disposition ref="dispositionRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 日志 -->
|
||||
<Log ref="logRef" v-if="logFlag" @close="logFlag = false" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick, reactive } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
||||
import XEUtils from 'xe-utils'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
import disposition from './components/disposition.vue'
|
||||
import detail from './components/detail.vue'
|
||||
import Log from './components/log.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
|
||||
defineOptions({
|
||||
name: 'BusinessAdministrator/TerminalManagement/TerminalManagement'
|
||||
})
|
||||
const dispositionRef = ref()
|
||||
const detailRef = ref()
|
||||
const logRef = ref()
|
||||
const dictData = useDictData()
|
||||
const logFlag = ref(false)
|
||||
const teriminaloption: any = ref([])
|
||||
|
||||
const teriminalstatusoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '投运', id: 0 },
|
||||
{ name: '检修', id: 1 },
|
||||
{ name: '停运', id: 2 }
|
||||
])
|
||||
const stateoption = ref([
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '正常', id: 1 },
|
||||
{ name: '中断', id: 0 }
|
||||
])
|
||||
const treeData: any = ref([])
|
||||
const treeDataCopy: any = ref([])
|
||||
|
||||
const tableRef = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/maintain/getTerminalMainList',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
loadCallback: () => {
|
||||
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||
setTimeout(() => {
|
||||
tableRef.value.setAllTreeExpand(true)
|
||||
}, 0)
|
||||
searchEvent()
|
||||
}
|
||||
})
|
||||
tableStore.table.params.devType = ''
|
||||
tableStore.table.params.runFlag = ''
|
||||
tableStore.table.params.comFlag = ''
|
||||
tableStore.table.params.filterName = ''
|
||||
// 处理大数据卡顿
|
||||
const tree2List = (list: any, id: any) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
|
||||
// 判断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
|
||||
}
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.searchState = 0
|
||||
onMounted(() => {
|
||||
getDevTypeList().then(res => {
|
||||
teriminaloption.value = res.data
|
||||
})
|
||||
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
// 终端状态管理
|
||||
const manage = (name: string, key: number) => {
|
||||
const $table = tableRef.value
|
||||
if ($table) {
|
||||
const selectRecords = $table
|
||||
.getCheckboxRecords()
|
||||
.filter((item: any) => item.level == 4)
|
||||
.map(item => item.id)
|
||||
console.log('🚀 ~ deviceData ~ selectRecords:', selectRecords)
|
||||
if (selectRecords.length == 0) {
|
||||
return ElMessage({
|
||||
message: '请至少选择一台装置',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
dispositionRef.value.open({
|
||||
title: name,
|
||||
id: selectRecords,
|
||||
key: key
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 流量统计
|
||||
const liultjData = () => {}
|
||||
// 重启前置程序
|
||||
const resect = () => {}
|
||||
|
||||
// 终端详情
|
||||
const uesdealia = (row: any) => {
|
||||
detailRef.value.open(row)
|
||||
}
|
||||
// 流量详情
|
||||
const log = (row: any) => {
|
||||
logFlag.value = true
|
||||
setTimeout(() => {
|
||||
logRef.value.open(row)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
// 表格过滤
|
||||
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
|
||||
)
|
||||
treeData.value = rest
|
||||
|
||||
// 搜索之后默认展开所有子节点
|
||||
} else {
|
||||
treeData.value = treeDataCopy.value
|
||||
}
|
||||
nextTick(() => {
|
||||
const $table = tableRef.value
|
||||
if ($table) {
|
||||
$table.setAllTreeExpand(true)
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
</script>
|
||||
|
||||
@@ -54,14 +54,17 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="right: 500px; position: absolute; overflow: hidden">
|
||||
<LocationInformation 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>
|
||||
<LocationInformation
|
||||
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 style="right: 0; position: absolute; overflow: hidden">
|
||||
<div class="title" :class="titleList.length > 5 ? 'titleScroll' : ''">
|
||||
<span v-for="(item, index) in titleList">{{ index == 0 ? '' : ' > ' }}{{ item }}</span>
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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 { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getYwZtSubstation } from '@/api/device-boot/device'
|
||||
const size = ref(0)
|
||||
const size = ref(23)
|
||||
const TerminalRef = ref()
|
||||
const pageHeight = mainHeight(20)
|
||||
const Height = mainHeight(100)
|
||||
@@ -2024,12 +2027,12 @@ const latff: any = ref((rule: any, value: any, callback: any) => {
|
||||
}
|
||||
})
|
||||
const plevel = ref(0)
|
||||
const nodeDataList=ref()
|
||||
const nodeEventList=ref()
|
||||
const nodeLevel1=ref(0)
|
||||
const nodeDataList = ref()
|
||||
const nodeEventList = ref()
|
||||
const nodeLevel1 = ref(0)
|
||||
const nodeClick = (e: anyObj, data: any) => {
|
||||
nodeDataList.value = data
|
||||
nodeEventList.value = e
|
||||
nodeDataList.value = data
|
||||
nodeEventList.value = e
|
||||
plevel.value = data.data.plevel
|
||||
treeClickCount.value++
|
||||
if (treeClickCount.value > 2) return
|
||||
@@ -2338,7 +2341,9 @@ const next = async () => {
|
||||
break
|
||||
case 600:
|
||||
addLine()
|
||||
selectChanged(AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[busBarIndex.value].scale)
|
||||
selectChanged(
|
||||
AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[busBarIndex.value].scale
|
||||
)
|
||||
nextfalg.value = false
|
||||
break
|
||||
case 700:
|
||||
@@ -2355,8 +2360,7 @@ const black = () => {
|
||||
busBarIndex.value = '0'
|
||||
deviceIndex.value = '0'
|
||||
lineIndex.value = '0'
|
||||
nodeClick(nodeEventList.value,nodeDataList.value)
|
||||
|
||||
nodeClick(nodeEventList.value, nodeDataList.value)
|
||||
}
|
||||
// 确认提交
|
||||
const onsubmit = () => {
|
||||
@@ -3073,7 +3077,7 @@ const setDown = () => {
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||
}
|
||||
if (VITE_FLAG) {
|
||||
getYwZtSubstation({ orgId: '' }).then(res => {
|
||||
|
||||
@@ -110,10 +110,7 @@
|
||||
>
|
||||
{{ proviteData.agreementCapacity }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="装机容量(MW)"
|
||||
|
||||
>
|
||||
<el-descriptions-item label="装机容量(MW)">
|
||||
{{ proviteData?.ratePower }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
@@ -485,7 +482,7 @@ const getProviteData = async () => {
|
||||
getFileNamePath(proviteData.value.additionalAttachments, 'additionalAttachments')
|
||||
}
|
||||
|
||||
// 入网评估报告
|
||||
// 系统接入方案
|
||||
if (detailData.value.netInReport.length > 0) {
|
||||
netInReportList.value = []
|
||||
detailData.value.netInReport.forEach((item: any) => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="default-main">
|
||||
<TableHeader :showSearch="false" v-show="flag">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker
|
||||
ref="datePickerRef"
|
||||
:nextFlag="false"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div> -->
|
||||
<TableHeader :showSearch="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -39,7 +39,7 @@ const tableStore = new TableStore({
|
||||
{ title: '事件描述', field: 'describe', align: 'center', showOverflow: true,minWidth: 200 },
|
||||
{ title: '事件类型', field: 'type', align: 'center', width: 160 },
|
||||
{ title: '操作结果', field: 'type', align: 'center', width: 100 },
|
||||
{ title: '操作IP', field: 'ip', align: 'center', width: 160 },
|
||||
{ title: '操作IP', field: 'ip', align: 'center', width: 120 },
|
||||
{ title: '事件等级', field: 'level', align: 'center', width: 100 }
|
||||
]
|
||||
})
|
||||
|
||||
@@ -1,341 +1,346 @@
|
||||
<template>
|
||||
<div class="default-main" :style="height">
|
||||
<!-- 算法库 -->
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<algorithmTree ref="treeRef" :default-expand-all="false"
|
||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
|
||||
@init="handleNodeClick" @onAddTree="onAddTree"></algorithmTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<div class="boxTop">
|
||||
<div>
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio-button v-for="(item, i) in dotList?.childrens" :label="item.name" :value="i" />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div v-if="information">
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser">
|
||||
新增
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :style="heightTab">
|
||||
<vxe-table height="auto" v-bind="defaultAttribute" :data="dotList?.childrens[radio]?.children">
|
||||
<vxe-column field="name" title="算法名称"></vxe-column>
|
||||
<vxe-column field="createTime" title="创建时间"></vxe-column>
|
||||
|
||||
<vxe-column field="period" title="计算周期">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.period == 0
|
||||
? '日'
|
||||
: row.period == 1
|
||||
? '月'
|
||||
: row.period == 2
|
||||
? '季'
|
||||
: row.period == 3
|
||||
? '年'
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="source" title="数据来源"></vxe-column>
|
||||
<!-- <vxe-column field="useFLag" title="是否启用">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.useFLag === 1 ? 'success' : 'info'" effect="dark"
|
||||
style="cursor: pointer" @click="change(row)">
|
||||
{{ row.useFLag === 1 ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</vxe-column> -->
|
||||
<vxe-column field="definition" title="定义">
|
||||
<template #default="{ row }">
|
||||
|
||||
<el-button type="primary" link @click="view(row)">查看</el-button>
|
||||
</template>
|
||||
|
||||
</vxe-column>
|
||||
<!-- <vxe-column title="操作" width="150px">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="edit(row)">修改</el-button>
|
||||
<el-button type="danger" link @click="del(row)">删除</el-button>
|
||||
<el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="del(row)">
|
||||
<template #reference>
|
||||
<el-button type="danger" link>删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</vxe-column> -->
|
||||
</vxe-table>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
<!-- 树弹框 -->
|
||||
<addTree ref="addTreeRef" @getTree="treeRef.loadData(dotList.id)" />
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit ref="popupEditRef" v-if="popupEditFlag"
|
||||
@getTree="treeRef.loadData(dotList.id), (popupEditFlag = false)" />
|
||||
<!-- 定义 -->
|
||||
<el-dialog draggable v-model="viewFlag" title="定义" width="60%">
|
||||
<div style="min-height: 300px; max-height: 55vh;">
|
||||
<div class="editor" ref="editorRef" v-html="summary" />
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 删除 -->
|
||||
<el-dialog draggable v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
||||
<el-tree-select v-model="TreeValue" :data="TreeData" filterable check-strictly :props="defaultProps"
|
||||
default-expand-all :render-after-expand="false" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="del">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import algorithmTree from '@/components/tree/pqs/algorithmTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { getLineExport, getList, selectReleation } from '@/api/event-boot/report'
|
||||
import addTree from './components/addTree.vue'
|
||||
import PopupEdit from './components/form.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { deleteyById } from '@/api/supervision-boot/database/index'
|
||||
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import katex from "katex";
|
||||
import "katex/dist/katex.css";
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/algorithm'
|
||||
})
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(20)
|
||||
const heightTab = mainHeight(82)
|
||||
const size = ref(0)
|
||||
const addTreeRef = ref()
|
||||
const editorRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const viewFlag = ref(false)
|
||||
const popupEditFlag = ref(false)
|
||||
const treeRef = ref()
|
||||
const summary = ref('')
|
||||
const popupEditRef = ref()
|
||||
const TreeData = ref([])
|
||||
const TreeValue = ref([])
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
|
||||
const defaultProps = {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
const dotList: any = ref()
|
||||
|
||||
const templatePolicy: any = ref([])
|
||||
// const tableStore = new TableStore({
|
||||
// url: '/supervision-boot/libalgorithm/queryAllAlgorithmLibrary',
|
||||
// method: 'GET',
|
||||
// column: [
|
||||
// { title: '算法名称', field: 'name' },
|
||||
// {
|
||||
// title: '定义',
|
||||
// field: 'name1'
|
||||
// },
|
||||
// {
|
||||
// title: '计算公式',
|
||||
// field: 'name2'
|
||||
// },
|
||||
// {
|
||||
// title: '计算周期',
|
||||
// field: 'name3'
|
||||
// },
|
||||
// {
|
||||
// title: '数据来源',
|
||||
// field: 'name4'
|
||||
// },
|
||||
// {
|
||||
// title: '是否启用',
|
||||
// field: 'name5',
|
||||
// render: 'tag',
|
||||
// effect: 'dark',
|
||||
// custom: {
|
||||
// 0: 'info',
|
||||
// 1: 'success'
|
||||
// },
|
||||
// replaceValue: {
|
||||
// 0: '否',
|
||||
// 1: '是'
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// loadCallback: () => {}
|
||||
// })
|
||||
const radio = ref(0)
|
||||
|
||||
// 新增弹框
|
||||
const addUser = () => {
|
||||
popupEditFlag.value = true
|
||||
setTimeout(() => {
|
||||
popupEditRef.value.open({
|
||||
title: '新增算法'
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
// 修改弹框
|
||||
const revise = () => {
|
||||
popupEditFlag.value = true
|
||||
setTimeout(() => {
|
||||
popupEditRef.value.open({
|
||||
title: '修改算法',
|
||||
row: dotList.value
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
// tableStore.index()
|
||||
})
|
||||
|
||||
const view = (row: any) => {
|
||||
|
||||
viewFlag.value = true
|
||||
summary.value = row.definition
|
||||
setTimeout(() => {
|
||||
|
||||
const spans = document.querySelectorAll('span[data-value]');
|
||||
// 遍历每个 span 标签
|
||||
spans.forEach(function (span) {
|
||||
|
||||
let val = katex.renderToString(span.getAttribute('data-value'), {
|
||||
throwOnError: false,
|
||||
})
|
||||
// var newDiv = document.createElement('div');
|
||||
var newDiv = span
|
||||
newDiv.innerHTML = val;
|
||||
|
||||
span.parentNode.replaceChild(newDiv, span);
|
||||
});
|
||||
|
||||
}, 100)
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
if (data.pid != '0') {
|
||||
dotList.value = data
|
||||
radio.value = 0
|
||||
}
|
||||
}
|
||||
const onAddTree = () => {
|
||||
addTreeRef.value.open('新增')
|
||||
}
|
||||
const deletes = () => {
|
||||
TreeValue.value = []
|
||||
queryAllAlgorithmLibrary().then(res => {
|
||||
TreeData.value = res.data
|
||||
})
|
||||
dialogVisible.value = true
|
||||
}
|
||||
// 删除
|
||||
const del = () => {
|
||||
if (TreeValue.value.length == 0) {
|
||||
return ElMessage.warning('请选择数据')
|
||||
}
|
||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteyById({ id: TreeValue.value }).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
dialogVisible.value = false
|
||||
treeRef.value.loadData()
|
||||
})
|
||||
})
|
||||
|
||||
// if (TreeValue.value.length > 0) {
|
||||
// ElMessage.warning('请选择数据')
|
||||
// return
|
||||
// }
|
||||
}
|
||||
// 启用
|
||||
const change = (row: any) => {
|
||||
console.log('🚀 ~ change ~ row:', row)
|
||||
ElMessageBox.confirm(`请确认是否${row.useFLag == 0 ? '启用' : '关闭'}算法?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
updateAlgorithmLibrary({ ...row, useFLag: row.useFLag == 0 ? 1 : 0 }).then(res => {
|
||||
ElMessage.success(row.useFLag == 0 ? '启用' : '关闭' + '成功')
|
||||
treeRef.value.loadData(dotList.value.id)
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.mTop {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.boxTop {
|
||||
height: 52px;
|
||||
padding: 10px 10px 10px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.editor {
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main" :style="height">
|
||||
<!-- 算法库 -->
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<algorithmTree
|
||||
ref="treeRef"
|
||||
:default-expand-all="false"
|
||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||
:current-node-key="monitoringPoint.state.lineId"
|
||||
@node-click="handleNodeClick"
|
||||
@init="handleNodeClick"
|
||||
@onAddTree="onAddTree"
|
||||
></algorithmTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<div class="boxTop">
|
||||
<div>
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio-button v-for="(item, i) in dotList?.childrens" :label="item.name" :value="i" />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div v-if="information">
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser">新增</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :style="heightTab">
|
||||
<vxe-table height="auto" v-bind="defaultAttribute" :data="dotList?.childrens[radio]?.children">
|
||||
<vxe-column field="name" title="算法名称"></vxe-column>
|
||||
<vxe-column field="createTime" title="创建时间"></vxe-column>
|
||||
|
||||
<vxe-column field="period" title="计算周期">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.period == 0
|
||||
? '日'
|
||||
: row.period == 1
|
||||
? '月'
|
||||
: row.period == 2
|
||||
? '季'
|
||||
: row.period == 3
|
||||
? '年'
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="source" title="数据来源"></vxe-column>
|
||||
<!-- <vxe-column field="useFLag" title="是否启用">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.useFLag === 1 ? 'success' : 'info'" effect="dark"
|
||||
style="cursor: pointer" @click="change(row)">
|
||||
{{ row.useFLag === 1 ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</vxe-column> -->
|
||||
<vxe-column field="definition" title="定义">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="view(row)">查看</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<!-- <vxe-column title="操作" width="150px">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="edit(row)">修改</el-button>
|
||||
<el-button type="danger" link @click="del(row)">删除</el-button>
|
||||
<el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="del(row)">
|
||||
<template #reference>
|
||||
<el-button type="danger" link>删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</vxe-column> -->
|
||||
</vxe-table>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
<!-- 树弹框 -->
|
||||
<addTree ref="addTreeRef" @getTree="treeRef.loadData(dotList.id)" />
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit
|
||||
ref="popupEditRef"
|
||||
v-if="popupEditFlag"
|
||||
@getTree="treeRef.loadData(dotList.id), (popupEditFlag = false)"
|
||||
/>
|
||||
<!-- 定义 -->
|
||||
<el-dialog draggable v-model="viewFlag" title="定义" width="60%">
|
||||
<div style="min-height: 300px; max-height: 55vh">
|
||||
<div class="editor" ref="editorRef" v-html="summary" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 删除 -->
|
||||
<el-dialog draggable v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
||||
<el-tree-select
|
||||
v-model="TreeValue"
|
||||
:data="TreeData"
|
||||
filterable
|
||||
check-strictly
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
:render-after-expand="false"
|
||||
/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="del">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import algorithmTree from '@/components/tree/pqs/algorithmTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { getLineExport, getList, selectReleation } from '@/api/event-boot/report'
|
||||
import addTree from './components/addTree.vue'
|
||||
import PopupEdit from './components/form.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { deleteyById } from '@/api/supervision-boot/database/index'
|
||||
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import katex from 'katex'
|
||||
import 'katex/dist/katex.css'
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/algorithm'
|
||||
})
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(20)
|
||||
const heightTab = mainHeight(82)
|
||||
const size = ref(23)
|
||||
const addTreeRef = ref()
|
||||
const editorRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const viewFlag = ref(false)
|
||||
const popupEditFlag = ref(false)
|
||||
const treeRef = ref()
|
||||
const summary = ref('')
|
||||
const popupEditRef = ref()
|
||||
const TreeData = ref([])
|
||||
const TreeValue = ref([])
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
|
||||
const defaultProps = {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
const dotList: any = ref()
|
||||
|
||||
const templatePolicy: any = ref([])
|
||||
// const tableStore = new TableStore({
|
||||
// url: '/supervision-boot/libalgorithm/queryAllAlgorithmLibrary',
|
||||
// method: 'GET',
|
||||
// column: [
|
||||
// { title: '算法名称', field: 'name' },
|
||||
// {
|
||||
// title: '定义',
|
||||
// field: 'name1'
|
||||
// },
|
||||
// {
|
||||
// title: '计算公式',
|
||||
// field: 'name2'
|
||||
// },
|
||||
// {
|
||||
// title: '计算周期',
|
||||
// field: 'name3'
|
||||
// },
|
||||
// {
|
||||
// title: '数据来源',
|
||||
// field: 'name4'
|
||||
// },
|
||||
// {
|
||||
// title: '是否启用',
|
||||
// field: 'name5',
|
||||
// render: 'tag',
|
||||
// effect: 'dark',
|
||||
// custom: {
|
||||
// 0: 'info',
|
||||
// 1: 'success'
|
||||
// },
|
||||
// replaceValue: {
|
||||
// 0: '否',
|
||||
// 1: '是'
|
||||
// }
|
||||
// }
|
||||
// ],
|
||||
// loadCallback: () => {}
|
||||
// })
|
||||
const radio = ref(0)
|
||||
|
||||
// 新增弹框
|
||||
const addUser = () => {
|
||||
popupEditFlag.value = true
|
||||
setTimeout(() => {
|
||||
popupEditRef.value.open({
|
||||
title: '新增算法'
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
// 修改弹框
|
||||
const revise = () => {
|
||||
popupEditFlag.value = true
|
||||
setTimeout(() => {
|
||||
popupEditRef.value.open({
|
||||
title: '修改算法',
|
||||
row: dotList.value
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||
}
|
||||
// tableStore.index()
|
||||
})
|
||||
|
||||
const view = (row: any) => {
|
||||
viewFlag.value = true
|
||||
summary.value = row.definition
|
||||
setTimeout(() => {
|
||||
const spans = document.querySelectorAll('span[data-value]')
|
||||
// 遍历每个 span 标签
|
||||
spans.forEach(function (span) {
|
||||
let val = katex.renderToString(span.getAttribute('data-value'), {
|
||||
throwOnError: false
|
||||
})
|
||||
// var newDiv = document.createElement('div');
|
||||
var newDiv = span
|
||||
newDiv.innerHTML = val
|
||||
|
||||
span.parentNode.replaceChild(newDiv, span)
|
||||
})
|
||||
}, 100)
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
if (data.pid != '0') {
|
||||
dotList.value = data
|
||||
radio.value = 0
|
||||
}
|
||||
}
|
||||
const onAddTree = () => {
|
||||
addTreeRef.value.open('新增')
|
||||
}
|
||||
const deletes = () => {
|
||||
TreeValue.value = []
|
||||
queryAllAlgorithmLibrary().then(res => {
|
||||
TreeData.value = res.data
|
||||
})
|
||||
dialogVisible.value = true
|
||||
}
|
||||
// 删除
|
||||
const del = () => {
|
||||
if (TreeValue.value.length == 0) {
|
||||
return ElMessage.warning('请选择数据')
|
||||
}
|
||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteyById({ id: TreeValue.value }).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
dialogVisible.value = false
|
||||
treeRef.value.loadData()
|
||||
})
|
||||
})
|
||||
|
||||
// if (TreeValue.value.length > 0) {
|
||||
// ElMessage.warning('请选择数据')
|
||||
// return
|
||||
// }
|
||||
}
|
||||
// 启用
|
||||
const change = (row: any) => {
|
||||
console.log('🚀 ~ change ~ row:', row)
|
||||
ElMessageBox.confirm(`请确认是否${row.useFLag == 0 ? '启用' : '关闭'}算法?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
updateAlgorithmLibrary({ ...row, useFLag: row.useFLag == 0 ? 1 : 0 }).then(res => {
|
||||
ElMessage.success(row.useFLag == 0 ? '启用' : '关闭' + '成功')
|
||||
treeRef.value.loadData(dotList.value.id)
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.mTop {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.boxTop {
|
||||
height: 52px;
|
||||
padding: 10px 10px 10px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.editor {
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div style="display: flex;align-items: center;">
|
||||
<div>{{ item.name }}</div>
|
||||
|
||||
<el-icon class="elView" v-if="item.name" @click="view(item)">
|
||||
<el-icon class="elView" v-if="item.name && VITE_FLAG" @click="view(item)">
|
||||
<View />
|
||||
</el-icon>
|
||||
<el-icon class="elView" v-if="item.name" @click="download(item)">
|
||||
@@ -50,6 +50,7 @@ import { ref, reactive } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||
import { Download, View } from '@element-plus/icons-vue'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const dialogVisible = ref(false)
|
||||
const tableData: any = ref({
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
//引入相关样式
|
||||
import '@vue-office/excel/lib/index.css'
|
||||
//引入VueOfficeDocx组件
|
||||
import VueOfficeDocx from '@vue-office/docx'
|
||||
import VueOfficeExcel from '@vue-office/excel'
|
||||
import VueOfficeDocx from '@vue-office/docx'
|
||||
import VueOfficeExcel from '@vue-office/excel'
|
||||
//引入VueOfficePdf组件
|
||||
import VueOfficePdf from '@vue-office/pdf'
|
||||
import { ref, reactive } from 'vue'
|
||||
@@ -52,12 +52,18 @@ const num = ref(0)
|
||||
const url = ref('')
|
||||
const excelOptions = ref({})
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const open = (row: any) => {
|
||||
// console.log('🚀 ~ open ~ row:', row)
|
||||
// url.value = row
|
||||
drawer.value = true
|
||||
url.value = `/api-docx/excelreport` + row
|
||||
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
|
||||
if(VITE_FLAG){
|
||||
url.value = `/api-docx/excelreport` + row
|
||||
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
|
||||
}else{
|
||||
|
||||
}
|
||||
// getFileNameAndFilePath({ filePath: row }).then(res => {
|
||||
// url.value = res.data.url
|
||||
// })
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div >
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="名称">
|
||||
@@ -26,6 +26,7 @@ const tableStore = new TableStore({
|
||||
url: '/supervision-boot/libModel/pageLibModelQuery',
|
||||
method: 'POST',
|
||||
showPage: true, // 确保启用分页
|
||||
publicHeight: 60,
|
||||
column: [
|
||||
{
|
||||
title: '典型设备',
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div>
|
||||
<TableHeader>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable
|
||||
placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="请输入搜索名称"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" isGroup/>
|
||||
<Table ref="tableRef" isGroup />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="tsx">
|
||||
@@ -23,7 +27,8 @@ const tableRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/libModel/pageLibModelQuery',
|
||||
method: 'POST',
|
||||
column: [
|
||||
publicHeight: 60,
|
||||
column: [
|
||||
{
|
||||
title: '谐波源',
|
||||
children: [
|
||||
@@ -32,12 +37,14 @@ const tableStore = new TableStore({
|
||||
title: '序号',
|
||||
width: '80',
|
||||
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: 'voltage', title: '电压等级',minWidth: 200 },
|
||||
{ field: 'capacity', title: '容量',minWidth: 200 }
|
||||
{ field: 'name', title: '名称', minWidth: 200 },
|
||||
{ field: 'voltage', title: '电压等级', minWidth: 200 },
|
||||
{ field: 'capacity', title: '容量', minWidth: 200 }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -50,13 +57,13 @@ const tableStore = new TableStore({
|
||||
}))
|
||||
}
|
||||
],
|
||||
// 在请求发送前处理参数
|
||||
// 在请求发送前处理参数
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.pageSize = 100
|
||||
tableStore.table.params.pageSize = 100
|
||||
},
|
||||
resetCallback: () => {
|
||||
resetCallback: () => {
|
||||
tableStore.table.params.searchValue = ''
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.type = 1
|
||||
@@ -70,5 +77,4 @@ const queryData = () => {
|
||||
defineExpose({
|
||||
queryData
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1,212 +1,219 @@
|
||||
<template>
|
||||
<div class="default-main" :style="height">
|
||||
<!-- 标准库 -->
|
||||
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<standardTree ref="treeRef"
|
||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
|
||||
@init="handleNodeClick"></standardTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<div class="pd10" style="display: flex; justify-content: end">
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
|
||||
<el-button icon="el-icon-Edit" type="primary" @click="editUser" v-if="information">修改</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven"
|
||||
v-if="information">删除</el-button>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="download" v-if="flag">下载</el-button>
|
||||
</div>
|
||||
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty"
|
||||
:style="`height: calc(${height.height} - 60px);`" />
|
||||
<div :style="`height: calc(${height.height} - 60px);overflow: auto;`" v-else>
|
||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url"
|
||||
:options="excelOptions" />
|
||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
|
||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<img v-if="
|
||||
url.includes('.png') || url.includes('.jpg') || url.includes('.gif') || url.includes('.bmp')
|
||||
" :src="url" />
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
<!-- 新增 -->
|
||||
|
||||
<addTree ref="addTreeRef" @onSubmit="treeRef.loadData(dotList.id)"></addTree>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import standardTree from '@/components/tree/pqs/standardTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import addTree from './components/addTree.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||
|
||||
//引入相关样式
|
||||
import '@vue-office/excel/lib/index.css'
|
||||
//引入VueOfficeDocx组件
|
||||
import VueOfficeDocx from '@vue-office/docx'
|
||||
import VueOfficeExcel from '@vue-office/excel'
|
||||
//引入VueOfficePdf组件
|
||||
import VueOfficePdf from '@vue-office/pdf'
|
||||
import { deleteyLibstandard } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/standard'
|
||||
})
|
||||
const excelOptions = ref({})
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const treeRef = ref()
|
||||
const addTreeRef = ref()
|
||||
const url = ref('')
|
||||
const dotList: any = ref({})
|
||||
const flag: any = ref(false)
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
})
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||
dotList.value = data
|
||||
url.value = ''
|
||||
flag.value = false
|
||||
if (data?.url != null && data?.url != '') {
|
||||
flag.value = true
|
||||
|
||||
setTimeout(() => {
|
||||
url.value = `/api-docx/excelreport` + data.url
|
||||
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
||||
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
|
||||
// url.value = res.data.url
|
||||
// })
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
const deleteEven = () => {
|
||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteyLibstandard({ id: dotList.value.id }).then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
setTimeout(() => {
|
||||
treeRef.value.loadData()
|
||||
}, 100)
|
||||
})
|
||||
})
|
||||
}
|
||||
const addUser = () => {
|
||||
addTreeRef.value.open('新增')
|
||||
}
|
||||
const editUser = () => {
|
||||
addTreeRef.value.open('修改', dotList.value)
|
||||
}
|
||||
// 下载
|
||||
const download = () => {
|
||||
let url = dotList.value.url
|
||||
let urls = url
|
||||
let name = url.match(/\/([^/]+)\.(\w+)$/)[1]
|
||||
downloadFile({ filePath: url }).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: urls.includes('.pdf')
|
||||
? 'application/pdf'
|
||||
: urls.includes('.docx')
|
||||
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
: urls.includes('.xls')
|
||||
? 'application/vnd.ms-excel'
|
||||
: urls.includes('.xlsx')
|
||||
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
: urls.includes('.png')
|
||||
? 'image/png'
|
||||
: urls.includes('.jpeg')
|
||||
? 'image/jpeg'
|
||||
: urls.includes('.jpg')
|
||||
? 'image/jpg'
|
||||
: ''
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = name
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.divBox {
|
||||
width: 250px;
|
||||
height: 31px;
|
||||
margin: auto;
|
||||
line-height: 32px;
|
||||
border: 1px solid #c9c9c9;
|
||||
|
||||
&:hover {
|
||||
border: 1px solid #002255;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 10px;
|
||||
// margin-top: 10px;
|
||||
overflow-y: auto;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.mTop {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* 自定义 el-empty 的样式 */
|
||||
:deep(.custom-empty) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
/* 调整高度 */
|
||||
padding: 20px;
|
||||
|
||||
/* 调整内边距 */
|
||||
.el-empty__image {
|
||||
display: none;
|
||||
/* 隐藏默认图片 */
|
||||
}
|
||||
|
||||
.el-empty__description {
|
||||
font-size: 14px;
|
||||
/* 调整字体大小 */
|
||||
color: var(--vxe-font-color);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main" :style="height">
|
||||
<!-- 标准库 -->
|
||||
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<standardTree ref="treeRef"
|
||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
|
||||
@init="handleNodeClick"></standardTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<div class="pd10" style="display: flex; justify-content: end">
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
|
||||
<el-button icon="el-icon-Edit" type="primary" @click="editUser" v-if="information">修改</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven"
|
||||
v-if="information">删除</el-button>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="download" v-if="flag">下载</el-button>
|
||||
</div>
|
||||
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty"
|
||||
:style="`height: calc(${height.height} - 60px);`" />
|
||||
<div :style="`height: calc(${height.height} - 60px);overflow: auto;`" v-else>
|
||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url"
|
||||
:options="excelOptions" />
|
||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
|
||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<img v-if="
|
||||
url.includes('.png') || url.includes('.jpg') || url.includes('.gif') || url.includes('.bmp')
|
||||
" :src="url" />
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
<!-- 新增 -->
|
||||
|
||||
<addTree ref="addTreeRef" @onSubmit="treeRef.loadData(dotList.id)"></addTree>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import standardTree from '@/components/tree/pqs/standardTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import addTree from './components/addTree.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||
|
||||
//引入相关样式
|
||||
import '@vue-office/excel/lib/index.css'
|
||||
//引入VueOfficeDocx组件
|
||||
import VueOfficeDocx from '@vue-office/docx'
|
||||
import VueOfficeExcel from '@vue-office/excel'
|
||||
//引入VueOfficePdf组件
|
||||
import VueOfficePdf from '@vue-office/pdf'
|
||||
import { deleteyLibstandard } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/standard'
|
||||
})
|
||||
const excelOptions = ref({})
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(20)
|
||||
const size = ref(23)
|
||||
const treeRef = ref()
|
||||
const addTreeRef = ref()
|
||||
const url = ref('')
|
||||
const dotList: any = ref({})
|
||||
const flag: any = ref(false)
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||
dotList.value = data
|
||||
url.value = ''
|
||||
flag.value = false
|
||||
if (data?.url != null && data?.url != '') {
|
||||
flag.value = true
|
||||
|
||||
setTimeout(() => {
|
||||
if(VITE_FLAG){
|
||||
url.value = `/api-docx/excelreport` + data.url
|
||||
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
|
||||
// url.value = res.data.url
|
||||
// })
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
const deleteEven = () => {
|
||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteyLibstandard({ id: dotList.value.id }).then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
setTimeout(() => {
|
||||
treeRef.value.loadData()
|
||||
}, 100)
|
||||
})
|
||||
})
|
||||
}
|
||||
const addUser = () => {
|
||||
addTreeRef.value.open('新增')
|
||||
}
|
||||
const editUser = () => {
|
||||
addTreeRef.value.open('修改', dotList.value)
|
||||
}
|
||||
// 下载
|
||||
const download = () => {
|
||||
let url = dotList.value.url
|
||||
let urls = url
|
||||
let name = url.match(/\/([^/]+)\.(\w+)$/)[1]
|
||||
downloadFile({ filePath: url }).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: urls.includes('.pdf')
|
||||
? 'application/pdf'
|
||||
: urls.includes('.docx')
|
||||
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
: urls.includes('.xls')
|
||||
? 'application/vnd.ms-excel'
|
||||
: urls.includes('.xlsx')
|
||||
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
: urls.includes('.png')
|
||||
? 'image/png'
|
||||
: urls.includes('.jpeg')
|
||||
? 'image/jpeg'
|
||||
: urls.includes('.jpg')
|
||||
? 'image/jpg'
|
||||
: ''
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = name
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.divBox {
|
||||
width: 250px;
|
||||
height: 31px;
|
||||
margin: auto;
|
||||
line-height: 32px;
|
||||
border: 1px solid #c9c9c9;
|
||||
|
||||
&:hover {
|
||||
border: 1px solid #002255;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 10px;
|
||||
// margin-top: 10px;
|
||||
overflow-y: auto;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.mTop {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* 自定义 el-empty 的样式 */
|
||||
:deep(.custom-empty) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
/* 调整高度 */
|
||||
padding: 20px;
|
||||
|
||||
/* 调整内边距 */
|
||||
.el-empty__image {
|
||||
display: none;
|
||||
/* 隐藏默认图片 */
|
||||
}
|
||||
|
||||
.el-empty__description {
|
||||
font-size: 14px;
|
||||
/* 调整字体大小 */
|
||||
color: var(--vxe-font-color);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,282 +1,282 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div v-show="view">
|
||||
<TableHeader datePicker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="筛选">
|
||||
<el-input v-model="tableStore.table.params.searchValue" 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 v-slot:operation>
|
||||
<el-button :icon="Download" type="primary" @click="download">下载波形</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :checkboxConfig="checkboxConfig" />
|
||||
</div>
|
||||
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||
<waveForm ref="waveFormRef" senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { Download } from '@element-plus/icons-vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import waveForm from '@/components/echarts/waveForm.vue'
|
||||
import { getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { VxeTablePropTypes } from 'vxe-table'
|
||||
import { downloadWaveFile } from '@/api/event-boot/transient'
|
||||
const dictData = useDictData()
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/TransientEventList'
|
||||
})
|
||||
const pageHeight = mainHeight(20)
|
||||
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 eventList = dictData.getBasicData('Event_Statis')
|
||||
const view = ref(true)
|
||||
const view2 = ref(false)
|
||||
const waveFormRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/event-boot/transient/getTransientValue',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ width: '60', type: 'checkbox' },
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '60',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: '180' },
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: '180' },
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '150' },
|
||||
{ field: 'ip', title: '网络参数', minWidth: '110' },
|
||||
{ field: 'scale', title: '电压等级', minWidth: '110' },
|
||||
// {
|
||||
// field: 'advanceType',
|
||||
// title: '暂降类型',
|
||||
// minWidth: '90',
|
||||
// formatter: (row: any) => {
|
||||
// return row.cellValue || '其他'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'advanceReason',
|
||||
title: '暂降原因',
|
||||
minWidth: '90',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '其他'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'eventType',
|
||||
title: '暂态统计类型',
|
||||
minWidth: '120',
|
||||
formatter: (row: any) => {
|
||||
return eventList.filter(item => item.id === row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'severity', title: '严重度', minWidth: "80", formatter: (row: any) => {
|
||||
// return row.cellValue.toFixed(2)
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降幅值(%)',
|
||||
minWidth: '110',
|
||||
formatter: (row: any) => {
|
||||
return (row.cellValue * 100).toFixed(2)
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'eventDescribe',
|
||||
title: '暂降深度(%)',
|
||||
minWidth: '110',
|
||||
formatter: (row: any) => {
|
||||
let data: any = (100 - row.row.featureAmplitude * 100).toFixed(2)
|
||||
|
||||
return data >= 0 ? data : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
width: '120',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '波形分析',
|
||||
type: 'primary',
|
||||
disabled: row => {
|
||||
return row.fileFlag == 0
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: async row => {
|
||||
view.value = false
|
||||
setTimeout(() => {
|
||||
waveFormRef.value.open(row)
|
||||
}, 100)
|
||||
// row.loading = true
|
||||
// boxoList.value = row
|
||||
// await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
|
||||
// .then(res => {
|
||||
// row.loading = false
|
||||
// if (res != undefined) {
|
||||
// wp.value = res.data
|
||||
// view.value = false
|
||||
// view2.value = true
|
||||
// }
|
||||
// })
|
||||
// .catch(() => {
|
||||
// row.loading = false
|
||||
// })
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '暂无波形',
|
||||
type: '',
|
||||
disabled: row => {
|
||||
return row.fileFlag != 0
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {}
|
||||
})
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.statisticalType = classificationData.filter(item => item.name == '电网拓扑')[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
|
||||
tableStore.table.params.monitorFlag = 2
|
||||
tableStore.table.params.powerFlag = 2
|
||||
tableStore.table.params.statFlag = true
|
||||
tableStore.table.params.isType = 0
|
||||
const boxoList = ref({})
|
||||
const wp = ref({})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig<any>>({
|
||||
checkMethod: ({ row }) => {
|
||||
return row.fileFlag === 1
|
||||
}
|
||||
})
|
||||
const backbxlb = () => {
|
||||
view.value = true
|
||||
view2.value = false
|
||||
}
|
||||
// 下载波形
|
||||
const download = () => {
|
||||
if (!tableStore.table.selection.length) {
|
||||
ElMessage.warning('请选择数据')
|
||||
return
|
||||
}
|
||||
downloadWaveFile({
|
||||
lineId: tableStore.table.selection.map((item: any) => item.eventId)
|
||||
}).then((res: any) => {
|
||||
if (res.type == 'application/json') {
|
||||
ElMessage.warning('暂无可下载的波形文件!')
|
||||
return
|
||||
}
|
||||
ElMessage.info('下载中......')
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '波形分析下载' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div v-show="view">
|
||||
<TableHeader datePicker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" 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 v-slot:operation>
|
||||
<el-button :icon="Download" type="primary" @click="download">下载波形</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :checkboxConfig="checkboxConfig" />
|
||||
</div>
|
||||
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||
<waveForm ref="waveFormRef" senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { Download } from '@element-plus/icons-vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import waveForm from '@/components/echarts/waveForm.vue'
|
||||
import { getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { VxeTablePropTypes } from 'vxe-table'
|
||||
import { downloadWaveFile } from '@/api/event-boot/transient'
|
||||
const dictData = useDictData()
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/TransientEventList'
|
||||
})
|
||||
const pageHeight = mainHeight(20)
|
||||
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 eventList = dictData.getBasicData('Event_Statis')
|
||||
const view = ref(true)
|
||||
const view2 = ref(false)
|
||||
const waveFormRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/event-boot/transient/getTransientValue',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ width: '60', type: 'checkbox' },
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '60',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: '180' },
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: '180' },
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '150' },
|
||||
{ field: 'ip', title: '网络参数' ,width:'120px' },
|
||||
{ field: 'scale', title: '电压等级', minWidth: '110' },
|
||||
// {
|
||||
// field: 'advanceType',
|
||||
// title: '暂降类型',
|
||||
// minWidth: '90',
|
||||
// formatter: (row: any) => {
|
||||
// return row.cellValue || '其他'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'advanceReason',
|
||||
title: '暂降原因',
|
||||
minWidth: '90',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '其他'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'eventType',
|
||||
title: '暂态统计类型',
|
||||
minWidth: '120',
|
||||
formatter: (row: any) => {
|
||||
return eventList.filter(item => item.id === row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'severity', title: '严重度', minWidth: "80", formatter: (row: any) => {
|
||||
// return row.cellValue.toFixed(2)
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降幅值(%)',
|
||||
minWidth: '110',
|
||||
formatter: (row: any) => {
|
||||
return (row.cellValue * 100).toFixed(2)
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'eventDescribe',
|
||||
title: '暂降深度(%)',
|
||||
minWidth: '110',
|
||||
formatter: (row: any) => {
|
||||
let data: any = (100 - row.row.featureAmplitude * 100).toFixed(2)
|
||||
|
||||
return data >= 0 ? data : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
width: '120',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '波形分析',
|
||||
type: 'primary',
|
||||
disabled: row => {
|
||||
return row.fileFlag == 0
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: async row => {
|
||||
view.value = false
|
||||
setTimeout(() => {
|
||||
waveFormRef.value.open(row)
|
||||
}, 100)
|
||||
// row.loading = true
|
||||
// boxoList.value = row
|
||||
// await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
|
||||
// .then(res => {
|
||||
// row.loading = false
|
||||
// if (res != undefined) {
|
||||
// wp.value = res.data
|
||||
// view.value = false
|
||||
// view2.value = true
|
||||
// }
|
||||
// })
|
||||
// .catch(() => {
|
||||
// row.loading = false
|
||||
// })
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '暂无波形',
|
||||
type: '',
|
||||
disabled: row => {
|
||||
return row.fileFlag != 0
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {}
|
||||
})
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.statisticalType = classificationData.filter(item => item.name == '电网拓扑')[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
|
||||
tableStore.table.params.monitorFlag = 2
|
||||
tableStore.table.params.powerFlag = 2
|
||||
tableStore.table.params.statFlag = true
|
||||
tableStore.table.params.isType = 0
|
||||
const boxoList = ref({})
|
||||
const wp = ref({})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig<any>>({
|
||||
checkMethod: ({ row }) => {
|
||||
return row.fileFlag === 1
|
||||
}
|
||||
})
|
||||
const backbxlb = () => {
|
||||
view.value = true
|
||||
view2.value = false
|
||||
}
|
||||
// 下载波形
|
||||
const download = () => {
|
||||
if (!tableStore.table.selection.length) {
|
||||
ElMessage.warning('请选择数据')
|
||||
return
|
||||
}
|
||||
downloadWaveFile({
|
||||
lineId: tableStore.table.selection.map((item: any) => item.eventId)
|
||||
}).then((res: any) => {
|
||||
if (res.type == 'application/json') {
|
||||
ElMessage.warning('暂无可下载的波形文件!')
|
||||
return
|
||||
}
|
||||
ElMessage.info('下载中......')
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '波形分析下载' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -194,7 +194,7 @@ const tableStore = new TableStore({
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'ip',
|
||||
align: 'center',
|
||||
align: 'center',width:'120px',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ const tableStore = new TableStore({
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'ip',
|
||||
align: 'center',
|
||||
align: 'center' ,width:'120px',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
贡献度计算
|
||||
<div style="font-size: 14px; font-weight: 500">
|
||||
<!-- {{ dotList.alias || '' }} -->
|
||||
<span class="monitoring-point">当前位置:{{ dotList.alias || '' }}</span>
|
||||
<span class="monitoring-point1">当前位置:{{ dotList.alias || '' }}</span>
|
||||
<back-component />
|
||||
</div>
|
||||
</div>
|
||||
@@ -194,7 +194,7 @@ const dotList: any = ref({})
|
||||
const height = mainHeight(20)
|
||||
const heightB = mainHeight(70)
|
||||
const harmonic = harmonicOptions.slice(1)
|
||||
const size = ref(0)
|
||||
const size = ref(23)
|
||||
const showTabs = ref(false)
|
||||
const loadDataOptions: any = ref([])
|
||||
const form: any = reactive({
|
||||
@@ -571,7 +571,7 @@ const group = (chart: any, myChartDom: any) => {
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||
}
|
||||
userDataList({
|
||||
pageNum: 1,
|
||||
@@ -598,7 +598,7 @@ onMounted(() => {
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
.monitoring-point {
|
||||
.monitoring-point1 {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--el-color-primary);
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<!-- 模版 -->
|
||||
<TableHeader datePicker showExport :showReset="false" ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<!-- <el-form-item label="关键字">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-CreditCard"
|
||||
@@ -41,7 +41,7 @@ const tableStore = new TableStore({
|
||||
{ title: '供电公司', field: 'gdName' },
|
||||
{ title: '变电站', field: 'subName' },
|
||||
{ title: '终端名称', field: 'devName' },
|
||||
{ title: 'IP', field: 'ip' },
|
||||
{ title: 'IP', field: 'ip' ,width:'120px' },
|
||||
{ title: '监测点名称', field: 'lineName' },
|
||||
{ title: '类型', field: 'dataType' },
|
||||
{ title: '谐波次数', field: 'dataTimes' },
|
||||
|
||||
@@ -1,408 +0,0 @@
|
||||
<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>
|
||||
@@ -1,517 +0,0 @@
|
||||
<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
|
||||
v-model="detailDialogVisible"
|
||||
:title="detailDialogTitle"
|
||||
|
||||
>
|
||||
<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
|
||||
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>
|
||||
@@ -0,0 +1,430 @@
|
||||
<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, 200]"
|
||||
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 }) => {
|
||||
console.log('🚀 ~ handleStatisticalTypeChange ~ newVal:', newVal)
|
||||
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: (name?: any) => {
|
||||
// 清空查询参数
|
||||
clearQueryParams()
|
||||
tableHeaderRef.value.setTheDate(3)
|
||||
if (name) {
|
||||
searchKeyword.value = name
|
||||
}
|
||||
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,510 @@
|
||||
<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="请选择统计类型"
|
||||
>
|
||||
<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" link @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, 200]"
|
||||
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 title="序号" width="60" type="seq" align="center"></vxe-column>
|
||||
<vxe-column field="subName" title="变电站名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="objName" title="监测对象名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></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 = originalItem.powerFlagPollutionList //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
|
||||
tableStore.table.params.ids = [tableStore.table.params.statisticalType.id]
|
||||
},
|
||||
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)
|
||||
})
|
||||
})
|
||||
harmonicValueTitle.value = tableStore.table.params.statisticalType.name + '污染值'
|
||||
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]
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
tableStore.table.params.powerFlag = '0'
|
||||
tableStore.table.params.isUpToGrid = 0
|
||||
tableStore.table.params.type = 1
|
||||
|
||||
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: (statisticalType?: string) => {
|
||||
tableStore.table.params.statisticalType = options.filter(item => item.id == statisticalType)[0] || options[0]
|
||||
|
||||
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,173 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader datePicker area ref="TableHeaderRef" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
>
|
||||
<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="请选择电网标志">
|
||||
<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="tableStore.table.params.searchValue"
|
||||
placeholder="请输入变电站/终端/监测点"
|
||||
clearable
|
||||
:show-word-limit="true"
|
||||
:maxlength="32"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template #operation>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary">导出</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 添加弹窗 -->
|
||||
<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="subName" title="变电站名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="objName" title="监测对象名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></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, nextTick, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
||||
//
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const detailDialogTitle = ref('')
|
||||
const detailData = ref([])
|
||||
const dictData = useDictData()
|
||||
const detailTableRef = ref()
|
||||
const lineList = dictData.getBasicData('Line_Type')
|
||||
const options = dictData.getBasicData('Pollution_Calc')
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/getAreaPollution',
|
||||
publicHeight: 65,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '区域级评估',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'deptName',
|
||||
title: '区域',
|
||||
minWidth: 100
|
||||
},
|
||||
|
||||
{
|
||||
field: 'score',
|
||||
title: '污染值',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '监测点污染详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
|
||||
click: row => {
|
||||
detailDialogTitle.value = row.deptName + '监测点污染详情'
|
||||
detailLoading.value = true
|
||||
detailData.value = row.powerFlagPollutionList
|
||||
detailDialogVisible.value = true
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.id = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.ids = [tableStore.table.params.statisticalType?.id]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.column[2].title = tableStore.table.params.statisticalType.name + '污染值'
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.statisticalType = options[0]
|
||||
tableStore.table.params.searchState = '0'
|
||||
tableStore.table.params.lineRunFlag = 0
|
||||
|
||||
// 导出详情数据的方法
|
||||
const exportDetailEvent = () => {
|
||||
detailTableRef.value.exportData({
|
||||
filename: detailDialogTitle.value,
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: detailData.value,
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const setSearchValue = (val: string) => {
|
||||
tableStore.table.params.searchValue = val
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
setSearchValue
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader datePicker area ref="TableHeaderRef" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
>
|
||||
<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-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
:show-word-limit="true"
|
||||
:maxlength="32"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template #operation>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary">导出</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 添加弹窗 -->
|
||||
<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="subName" title="变电站名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="objName" title="监测对象名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></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, nextTick, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
||||
//
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const detailDialogTitle = ref('')
|
||||
const detailData = ref([])
|
||||
const dictData = useDictData()
|
||||
const detailTableRef = ref()
|
||||
const lineList = dictData.getBasicData('Line_Type')
|
||||
const options = dictData.getBasicData('Pollution_Calc')
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/downPollutionSensitiveUser',
|
||||
publicHeight: 65,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '敏感及重要用户评估',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'gdName',
|
||||
title: '供电公司',
|
||||
width: 150
|
||||
},
|
||||
|
||||
{ field: 'subStationName', title: '变电站', minWidth: 150 },
|
||||
{ field: 'projectName', title: '项目名称', minWidth: 150 },
|
||||
{
|
||||
field: 'subValue',
|
||||
title: '污染值',
|
||||
width: 150,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == null ? '暂未安装监测点' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '监测点污染详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.subValue == null
|
||||
},
|
||||
click: row => {
|
||||
detailDialogTitle.value = '监测点污染详情'
|
||||
console.log('🚀 ~ row:', row)
|
||||
detailLoading.value = true
|
||||
detailData.value = row.powerFlagPollutionList
|
||||
detailDialogVisible.value = true
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.deptId = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.ids = [tableStore.table.params.statisticalType?.id]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.column[4].title = tableStore.table.params.statisticalType.name + '污染值'
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.statisticalType = options[0]
|
||||
tableStore.table.params.powerFlag = 0
|
||||
tableStore.table.params.isUpToGrid = 0
|
||||
// 导出详情数据的方法
|
||||
const exportDetailEvent = () => {
|
||||
detailTableRef.value.exportData({
|
||||
filename: detailDialogTitle.value,
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: detailData.value,
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const setSearchValue = (val: string) => {
|
||||
tableStore.table.params.searchValue = val
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
setSearchValue
|
||||
})
|
||||
</script>
|
||||
@@ -1,30 +1,31 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="监测点评估" name="pollutionReport">
|
||||
<MonitoringPointTab
|
||||
ref="monitoringPointTabRef"
|
||||
:active="activeTab === 'pollutionReport'"
|
||||
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="场站级评估" name="anotherReport">
|
||||
<SubstationTab
|
||||
ref="substationTabRef"
|
||||
:active="activeTab === 'anotherReport'"
|
||||
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div class="default-main">
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="监测点评估" name="pollutionReport">
|
||||
<MonitoringPointTab ref="monitoringPointTabRef" :active="activeTab === 'pollutionReport'" />
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="场站级评估" name="anotherReport">
|
||||
<SubstationTab ref="substationTabRef" :active="activeTab === 'anotherReport'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="区域级评估" name="3">
|
||||
<regionalAssessment v-if="activeTab == '3'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="敏感及重要用户评估" name="4">
|
||||
<userEvaluation ref="userEvaluationRef" v-if="activeTab == '4'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import MonitoringPointTab from './MonitoringPointTab.vue'
|
||||
import SubstationTab from './SubstationTab.vue'
|
||||
|
||||
import MonitoringPointTab from './components/MonitoringPointTab.vue'
|
||||
import SubstationTab from './components/SubstationTab.vue'
|
||||
import regionalAssessment from './components/regionalAssessment.vue'
|
||||
import userEvaluation from './components/userEvaluation.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/qydetailedAnalysis/pollutionReport'
|
||||
})
|
||||
@@ -32,18 +33,38 @@ defineOptions({
|
||||
const activeTab = ref('pollutionReport')
|
||||
const monitoringPointTabRef = ref()
|
||||
const substationTabRef = ref()
|
||||
|
||||
|
||||
const userEvaluationRef = ref()
|
||||
const handleTabChange = (tabName: string) => {
|
||||
if (tabName === 'pollutionReport' && monitoringPointTabRef.value) {
|
||||
|
||||
monitoringPointTabRef.value.refresh()
|
||||
monitoringPointTabRef.value.refresh()
|
||||
} else if (tabName === 'anotherReport' && substationTabRef.value) {
|
||||
substationTabRef.value.refresh()
|
||||
substationTabRef.value.refresh()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
if (route.fullPath.includes('harmonic-boot/qydetailedAnalysis/pollutionReport')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
activeTab.value = 'pollutionReport'
|
||||
setTimeout(() => {
|
||||
monitoringPointTabRef.value.refresh((route.query.name as string) || 'null')
|
||||
}, 500)
|
||||
} else if (type == '2') {
|
||||
activeTab.value = 'anotherReport'
|
||||
setTimeout(() => {
|
||||
substationTabRef.value.refresh((route.query.statisticalType as string) || 'null')
|
||||
}, 500)
|
||||
} else if (type == '4') {
|
||||
activeTab.value = '4'
|
||||
setTimeout(() => {
|
||||
userEvaluationRef.value.setSearchValue((route.query.name as string) || '')
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'name', title: '电网拓扑', minWidth: '150' },
|
||||
{
|
||||
field: 'onlineMonitorNumber',
|
||||
title: '在线监测点数量(个)',
|
||||
title: '在运监测点数(个)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="default-main">
|
||||
<TableHeader :showSearch="false" v-show="flag">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker
|
||||
ref="datePickerRef"
|
||||
:nextFlag="false"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<TableHeader area datePicker ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="筛选">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.filterName"
|
||||
@keyup="searchEvent"
|
||||
@@ -123,7 +123,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
|
||||
{
|
||||
field: 'ip',
|
||||
title: '网络参数',
|
||||
title: '网络参数' ,width:'120px',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.ip || '/'
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<TableHeader area datePicker ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="筛选">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.filterName"
|
||||
@keyup="searchEvent"
|
||||
@@ -123,7 +123,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
|
||||
{
|
||||
field: 'ip',
|
||||
title: '网络参数',
|
||||
title: '网络参数' ,width:'120px',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.ip || '/'
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker ref="TableHeaderRef" :dateLabel="`数据统计时间`">
|
||||
<TableHeader date-picker ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="运行状态">
|
||||
<el-select v-model="tableStore.table.params.lineRunFlag" clearable placeholder="请选择运行状态">
|
||||
@@ -12,8 +12,8 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选">
|
||||
<el-input v-model="tableStore.table.params.filterName" placeholder="输入关键字筛选" />
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<span class="divBox_title">低于90%监测点数</span>
|
||||
<span
|
||||
class="divBox_num text-style"
|
||||
style="color: #ff6600"
|
||||
style="color: #57bc6e"
|
||||
@click="totalTable(90, '低于90%监测点_')"
|
||||
>
|
||||
{{ monitoringPoints.abnormalNum }}
|
||||
@@ -56,7 +56,9 @@
|
||||
</div>
|
||||
<div class="echartTitle">
|
||||
<div>总的数据完整性</div>
|
||||
<div>{{ monitoringPoints.totalOnlineRate }}%</div>
|
||||
<div>
|
||||
{{ monitoringPoints.totalOnlineRate > 100 ? 100 : monitoringPoints.totalOnlineRate }}%
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 30px">
|
||||
<MyEchart :options="percentage"></MyEchart>
|
||||
@@ -115,7 +117,7 @@
|
||||
</span>
|
||||
<!-- 低于90%监测点数 -->
|
||||
<span
|
||||
style="flex: 1; color: #ff9100"
|
||||
style="flex: 1; color: #388e3c"
|
||||
class="text text-style"
|
||||
@click="renderTable(o.detailList, 90, o.citName + '_低于90%监测点_')"
|
||||
>
|
||||
@@ -152,21 +154,22 @@
|
||||
<vxe-column type="seq" title="序号" width="80px">
|
||||
<template #default="{ rowIndex }">
|
||||
<span>
|
||||
{{
|
||||
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize +
|
||||
rowIndex +
|
||||
1
|
||||
}}
|
||||
{{ (pageNum - 1) * pageSize + rowIndex + 1 }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="cit" title="所在地市" width="110px"></vxe-column>
|
||||
<vxe-column field="company" title="供电公司"></vxe-column>
|
||||
<vxe-column field="subStation" title="变电站"></vxe-column>
|
||||
<vxe-column field="manufacturer" title="终端厂家"></vxe-column>
|
||||
<vxe-column field="deviceName" title="终端名称"></vxe-column>
|
||||
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="130px"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" :formatter="formatter"></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="120px"></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
|
||||
@@ -209,7 +212,7 @@
|
||||
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 { onMounted, provide, ref, watch } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
@@ -218,7 +221,8 @@ import { getMonitorVerifyDay } from '@/api/device-boot/dataVerify'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
const pageHeight = mainHeight(97)
|
||||
@@ -267,7 +271,13 @@ const tableStore = new TableStore({
|
||||
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
|
||||
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
|
||||
@@ -348,7 +358,13 @@ const echart = () => {
|
||||
name: '异常占比',
|
||||
type: 'bar',
|
||||
barWidth: 13,
|
||||
data: [monitoringPoints.value.totalOnlineRate == 0 ? '' : monitoringPoints.value.totalOnlineRate],
|
||||
data: [
|
||||
monitoringPoints.value.totalOnlineRate == 0
|
||||
? ''
|
||||
: monitoringPoints.value.totalOnlineRate > 100
|
||||
? 100
|
||||
: monitoringPoints.value.totalOnlineRate
|
||||
],
|
||||
z: 0,
|
||||
zlevel: 0,
|
||||
itemStyle: {
|
||||
@@ -413,7 +429,8 @@ const echart = () => {
|
||||
}
|
||||
}
|
||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||
tableStore.table.params.lineRunFlag = ''
|
||||
tableStore.table.params.lineRunFlag = 0
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
const formatter = (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
@@ -470,10 +487,28 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
if (route.fullPath.includes('harmonic-boot/harmonic/getIntegrityData')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
setTimeout(() => {
|
||||
tableStore.table.params.searchValue = (route.query.name as string) || ''
|
||||
tableStore.index()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
.card-list {
|
||||
display: flex;
|
||||
.monitoringPoints {
|
||||
|
||||
@@ -1,216 +1,216 @@
|
||||
<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>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }" :key="num" />
|
||||
</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 TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { debounce } from 'lodash-es'
|
||||
import XEUtils from 'xe-utils'
|
||||
const dictData = useDictData()
|
||||
const tableRef = ref()
|
||||
const num = ref(0)
|
||||
|
||||
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 treeDataCopy: any = ref([])
|
||||
const treeData: any = ref([])
|
||||
const TableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/terminalOnlineRateData/getOnlineRateData',
|
||||
publicHeight: 65,
|
||||
showPage: false,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ field: 'name', title: '电网拓扑', width: 350, align: 'left', treeNode: true },
|
||||
{
|
||||
field: 'ip',
|
||||
title: '网络参数',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.ip || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dataName',
|
||||
title: '终端名称',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.dataName || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
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: '/'
|
||||
}
|
||||
// formatter: ({ row }: any) => {
|
||||
// return row.comFlag || '/'
|
||||
// }
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '最新数据时间',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.updateTime || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'onlineRate',
|
||||
title: '在线率(%)',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.onlineRate == 3.14159 ? '暂无数据' : row.onlineRate.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()
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
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.onlineRate == 3.14159 ? 0 : item.onlineRate < 60 ? 1 : item.onlineRate < 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
|
||||
}
|
||||
// 表格过滤
|
||||
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)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<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>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }" :key="num" />
|
||||
</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 TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { debounce } from 'lodash-es'
|
||||
import XEUtils from 'xe-utils'
|
||||
const dictData = useDictData()
|
||||
const tableRef = ref()
|
||||
const num = ref(0)
|
||||
|
||||
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 treeDataCopy: any = ref([])
|
||||
const treeData: any = ref([])
|
||||
const TableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/terminalOnlineRateData/getOnlineRateData',
|
||||
publicHeight: 65,
|
||||
showPage: false,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ field: 'name', title: '电网拓扑', width: 350, align: 'left', treeNode: true },
|
||||
{
|
||||
field: 'ip',
|
||||
title: '网络参数' ,width:'120px',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.ip || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dataName',
|
||||
title: '终端名称',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.dataName || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
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: '/'
|
||||
}
|
||||
// formatter: ({ row }: any) => {
|
||||
// return row.comFlag || '/'
|
||||
// }
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '最新数据时间',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.updateTime || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'onlineRate',
|
||||
title: '在线率(%)',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.onlineRate == 3.14159 ? '暂无数据' : row.onlineRate.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()
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
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.onlineRate == 3.14159 ? 0 : item.onlineRate < 60 ? 1 : item.onlineRate < 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
|
||||
}
|
||||
// 表格过滤
|
||||
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)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker ref="TableHeaderRef" :dateLabel="`数据统计时间`">
|
||||
<TableHeader date-picker ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="运行状态">
|
||||
<el-select v-model="tableStore.table.params.lineRunFlag" clearable placeholder="请选择运行状态">
|
||||
@@ -12,8 +12,8 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选">
|
||||
<el-input v-model="tableStore.table.params.filterName" placeholder="输入关键字筛选" />
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入终端名称" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -34,7 +34,11 @@
|
||||
<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, '')">
|
||||
<span
|
||||
class="divBox_num text-style"
|
||||
style="color: #57bc6e"
|
||||
@click="totalTable(100001, '')"
|
||||
>
|
||||
{{ monitoringPoints.runNum }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -43,7 +47,7 @@
|
||||
<span class="divBox_title">低于90%终端数</span>
|
||||
<span
|
||||
class="divBox_num text-style"
|
||||
style="color: #ff6600"
|
||||
style="color: #57bc6e"
|
||||
@click="totalTable(90, '低于90%终端_')"
|
||||
>
|
||||
{{ monitoringPoints.abnormalNum }}
|
||||
@@ -111,7 +115,7 @@
|
||||
</span>
|
||||
<!-- 低于90%终端数 -->
|
||||
<span
|
||||
style="flex: 1; color: #ff9100"
|
||||
style="flex: 1; color: #388e3c"
|
||||
class="text text-style"
|
||||
@click="renderTable(o.detailList, 90, o.citName + '_低于90%终端_')"
|
||||
>
|
||||
@@ -148,20 +152,16 @@
|
||||
<vxe-column type="seq" title="序号" width="80px">
|
||||
<template #default="{ rowIndex }">
|
||||
<span>
|
||||
{{
|
||||
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize +
|
||||
rowIndex +
|
||||
1
|
||||
}}
|
||||
{{ (pageNum - 1) * pageSize + rowIndex + 1 }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="cit" title="所在地市" width="110px"></vxe-column>
|
||||
<vxe-column field="company" title="供电公司"></vxe-column>
|
||||
<vxe-column field="subStation" title="变电站"></vxe-column>
|
||||
<vxe-column field="manufacturer" title="终端厂家"></vxe-column>
|
||||
<vxe-column field="deviceName" title="终端名称"></vxe-column>
|
||||
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="130px"></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="120px"></vxe-column>
|
||||
<vxe-column field="runFlag" title="运行状态" width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
@@ -200,6 +200,7 @@
|
||||
</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'
|
||||
@@ -212,7 +213,8 @@ import { getMonitorVerifyDay } from '@/api/device-boot/dataVerify'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
const pageHeight = mainHeight(97)
|
||||
@@ -262,10 +264,19 @@ const tableStore = new TableStore({
|
||||
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
|
||||
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) => {
|
||||
@@ -409,7 +420,8 @@ const echart = () => {
|
||||
}
|
||||
}
|
||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||
tableStore.table.params.lineRunFlag = ''
|
||||
tableStore.table.params.lineRunFlag = 0
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
const formatter = (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
@@ -465,11 +477,28 @@ onMounted(() => {
|
||||
|
||||
tableStore.index()
|
||||
})
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
if (route.fullPath.includes('harmonic-boot/area/OnlineRate')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
setTimeout(() => {
|
||||
tableStore.table.params.searchValue = (route.query.name as string) || ''
|
||||
tableStore.index()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
.card-list {
|
||||
display: flex;
|
||||
.monitoringPoints {
|
||||
|
||||
@@ -1,430 +1,430 @@
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%; position: relative">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="多监测点">
|
||||
<el-checkbox v-model="checked" @change="checkChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<DatePicker ref="datePickerRef" ></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标类型:">
|
||||
<el-select
|
||||
v-model="formData.condition"
|
||||
multiple
|
||||
collapse-tags
|
||||
:multiple-limit="5"
|
||||
filterable
|
||||
placeholder="请选择指标"
|
||||
@change="conditionChange"
|
||||
>
|
||||
<el-option-group v-for="group in indexOptions" :key="group.label" :label="group.label">
|
||||
<el-option
|
||||
v-for="item in group.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="谐波次数:" v-if="showXieBoCiShu">
|
||||
<el-select style="width: 100%" v-model="formData.harmonic" placeholder="请选择谐波">
|
||||
<el-option
|
||||
v-for="item in harmonicOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showJianXieBoCiShu" label="间谐波次数:">
|
||||
<el-select style="width: 100%" v-model="formData.inHarmonic" placeholder="请选择间谐波">
|
||||
<el-option
|
||||
v-for="item in inharmonicOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="flex: 1; overflow: hidden" class="mt10" v-loading="loading">
|
||||
<vxe-table height="auto" v-bind="defaultAttribute" :data="tableData">
|
||||
<vxe-column field="subName" title="变电站" min-width="120px"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" min-width="120px"></vxe-column>
|
||||
<vxe-column field="targetName" title="指标类型" min-width="120px"></vxe-column>
|
||||
<vxe-column field="phaseType" title="相别" min-width="100px"></vxe-column>
|
||||
<vxe-column field="scale" title="电压等级" min-width="100px"></vxe-column>
|
||||
<vxe-column field="timeId" title="时间" min-width="130px"></vxe-column>
|
||||
<vxe-column field="unit" title="单位" min-width="100px"></vxe-column>
|
||||
<vxe-column field="maxData" title="最大值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 3, '最大值')"
|
||||
:style="{ color: scope.row.statisticalType === 3 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.maxData }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="minData" title="最小值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 2, '最小值')"
|
||||
:style="{ color: scope.row.statisticalType === 2 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.minData }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="avgData" title="平均值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 1, '平均值')"
|
||||
:style="{ color: scope.row.statisticalType === 1 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.avgData }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="cp95Data" title="CP95值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 4, 'CP95值')"
|
||||
:style="{ color: scope.row.statisticalType === 4 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.cp95Data }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
<SecondSheet v-if="options" style="background: #fff; z-index: 10">
|
||||
<el-button
|
||||
style="position: absolute; right: 0; top: 0; cursor: pointer; z-index: 3"
|
||||
icon="el-icon-Back"
|
||||
size="small"
|
||||
@click="close"
|
||||
>
|
||||
返回
|
||||
</el-button>
|
||||
<MyEChart :options="options"></MyEChart>
|
||||
</SecondSheet>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import { Close } from '@element-plus/icons-vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { indexOptions, harmonicOptions, inharmonicOptions } from '@/utils/dictionary'
|
||||
import { getHistoryTableData, getHistoryLineData } from '@/api/harmonic-boot/normLimit'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import SecondSheet from '@/components/secondSheet/index.vue'
|
||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const checked = ref(monitoringPoint.state.showCheckBox)
|
||||
const formData = reactive<{
|
||||
lineId: string[]
|
||||
searchBeginTime: string
|
||||
searchEndTime: string
|
||||
condition: string[]
|
||||
harmonic: number
|
||||
inHarmonic: number
|
||||
}>({
|
||||
lineId: [],
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
condition: ['10', '11', '12'],
|
||||
harmonic: 2,
|
||||
inHarmonic: 1
|
||||
})
|
||||
const tableData = ref([])
|
||||
const showXieBoCiShu = ref(false)
|
||||
const showJianXieBoCiShu = ref(false)
|
||||
const options = ref<any>(null)
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
formData.lineId = checked.value ? monitoringPoint.state.lineIds : [monitoringPoint.state.lineId]
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getHistoryTableData(formData).then((res: any) => {
|
||||
tableData.value = res.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
maxData: item.maxData.toFixed(2),
|
||||
minData: item.minData.toFixed(2),
|
||||
avgData: item.avgData.toFixed(2),
|
||||
cp95Data: item.cp95Data.toFixed(2)
|
||||
}
|
||||
})
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
const checkChange = () => {
|
||||
if (checked.value) {
|
||||
monitoringPoint.setShowCheckBox(true)
|
||||
} else {
|
||||
monitoringPoint.setShowCheckBox(false)
|
||||
init()
|
||||
}
|
||||
}
|
||||
const close = () => {
|
||||
console.log('====================================')
|
||||
console.log(2123123)
|
||||
console.log('====================================')
|
||||
options.value = null
|
||||
}
|
||||
const showCharts = (row: any, valueType: number, name: string) => {
|
||||
getHistoryLineData({
|
||||
lineId: row.lineId,
|
||||
number: row.number,
|
||||
phaseType: row.phaseType,
|
||||
searchTime: row.timeId,
|
||||
targetCode: row.targetCode,
|
||||
valueType
|
||||
}).then(res => {
|
||||
options.value = {
|
||||
title: {
|
||||
text: row.subName + ' ' + row.lineName + ' ' + row.targetName + ' ' + row.phaseType + '相' + name
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
name: '时间',
|
||||
data: res.data[0]?.value.map((item: any[]) => item[0])
|
||||
},
|
||||
yAxis: {
|
||||
name: '%',
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: name,
|
||||
data: res.data[0]?.value.map((item: any[]) => item[1]),
|
||||
type: 'line'
|
||||
}
|
||||
],
|
||||
options: {
|
||||
grid: {
|
||||
top: '50px',
|
||||
left: '40px',
|
||||
right: '60px',
|
||||
bottom: '10px',
|
||||
containLabel: true
|
||||
},
|
||||
dataZoom: null
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
const conditionChange = () => {
|
||||
//判断一个指标时
|
||||
if (formData.condition.length == 1) {
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断2个指标时
|
||||
if (formData.condition.length == 2) {
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
(formData.condition.includes('45') && formData.condition.includes('46')) ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断3个指标时
|
||||
if (formData.condition.length == 3) {
|
||||
if (
|
||||
(formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')) &&
|
||||
(formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49'))
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断4个指标时
|
||||
if (formData.condition.length == 4) {
|
||||
if (
|
||||
(formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')) &&
|
||||
(formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49'))
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断5个指标时
|
||||
if (formData.condition.length == 5) {
|
||||
if (
|
||||
(formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')) &&
|
||||
(formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49'))
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断无指标时
|
||||
if (formData.condition.length == 0) {
|
||||
showJianXieBoCiShu.value = false
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style></style>
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%; position: relative">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="多监测点">
|
||||
<el-checkbox v-model="checked" @change="checkChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef" ></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标类型:">
|
||||
<el-select
|
||||
v-model="formData.condition"
|
||||
multiple
|
||||
collapse-tags
|
||||
:multiple-limit="5"
|
||||
filterable
|
||||
placeholder="请选择指标"
|
||||
@change="conditionChange"
|
||||
>
|
||||
<el-option-group v-for="group in indexOptions" :key="group.label" :label="group.label">
|
||||
<el-option
|
||||
v-for="item in group.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="谐波次数:" v-if="showXieBoCiShu">
|
||||
<el-select style="width: 100%" v-model="formData.harmonic" placeholder="请选择谐波">
|
||||
<el-option
|
||||
v-for="item in harmonicOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showJianXieBoCiShu" label="间谐波次数:">
|
||||
<el-select style="width: 100%" v-model="formData.inHarmonic" placeholder="请选择间谐波">
|
||||
<el-option
|
||||
v-for="item in inharmonicOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="flex: 1; overflow: hidden" class="mt10" v-loading="loading">
|
||||
<vxe-table height="auto" v-bind="defaultAttribute" :data="tableData">
|
||||
<vxe-column field="subName" title="变电站" min-width="120px"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" min-width="120px"></vxe-column>
|
||||
<vxe-column field="targetName" title="指标类型" min-width="120px"></vxe-column>
|
||||
<vxe-column field="phaseType" title="相别" min-width="100px"></vxe-column>
|
||||
<vxe-column field="scale" title="电压等级" min-width="100px"></vxe-column>
|
||||
<vxe-column field="timeId" title="时间" min-width="130px"></vxe-column>
|
||||
<vxe-column field="unit" title="单位" min-width="100px"></vxe-column>
|
||||
<vxe-column field="maxData" title="最大值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 3, '最大值')"
|
||||
:style="{ color: scope.row.statisticalType === 3 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.maxData }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="minData" title="最小值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 2, '最小值')"
|
||||
:style="{ color: scope.row.statisticalType === 2 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.minData }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="avgData" title="平均值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 1, '平均值')"
|
||||
:style="{ color: scope.row.statisticalType === 1 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.avgData }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="cp95Data" title="CP95值(%)" min-width="100px">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@click="showCharts(scope.row, 4, 'CP95值')"
|
||||
:style="{ color: scope.row.statisticalType === 4 ? '#A52a2a' : '#07d75a' }"
|
||||
type="text"
|
||||
size="small"
|
||||
>
|
||||
{{ scope.row.cp95Data }}
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.statisticalType === 3.14159">/</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
<SecondSheet v-if="options" style="background: #fff; z-index: 10">
|
||||
<el-button
|
||||
style="position: absolute; right: 0; top: 0; cursor: pointer; z-index: 3"
|
||||
icon="el-icon-Back"
|
||||
size="small"
|
||||
@click="close"
|
||||
>
|
||||
返回
|
||||
</el-button>
|
||||
<MyEChart :options="options"></MyEChart>
|
||||
</SecondSheet>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import { Close } from '@element-plus/icons-vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { indexOptions, harmonicOptions, inharmonicOptions } from '@/utils/dictionary'
|
||||
import { getHistoryTableData, getHistoryLineData } from '@/api/harmonic-boot/normLimit'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import SecondSheet from '@/components/secondSheet/index.vue'
|
||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const checked = ref(monitoringPoint.state.showCheckBox)
|
||||
const formData = reactive<{
|
||||
lineId: string[]
|
||||
searchBeginTime: string
|
||||
searchEndTime: string
|
||||
condition: string[]
|
||||
harmonic: number
|
||||
inHarmonic: number
|
||||
}>({
|
||||
lineId: [],
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
condition: ['10', '11', '12'],
|
||||
harmonic: 2,
|
||||
inHarmonic: 1
|
||||
})
|
||||
const tableData = ref([])
|
||||
const showXieBoCiShu = ref(false)
|
||||
const showJianXieBoCiShu = ref(false)
|
||||
const options = ref<any>(null)
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
formData.lineId = checked.value ? monitoringPoint.state.lineIds : [monitoringPoint.state.lineId]
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getHistoryTableData(formData).then((res: any) => {
|
||||
tableData.value = res.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
maxData: item.maxData.toFixed(2),
|
||||
minData: item.minData.toFixed(2),
|
||||
avgData: item.avgData.toFixed(2),
|
||||
cp95Data: item.cp95Data.toFixed(2)
|
||||
}
|
||||
})
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
const checkChange = () => {
|
||||
if (checked.value) {
|
||||
monitoringPoint.setShowCheckBox(true)
|
||||
} else {
|
||||
monitoringPoint.setShowCheckBox(false)
|
||||
init()
|
||||
}
|
||||
}
|
||||
const close = () => {
|
||||
console.log('====================================')
|
||||
console.log(2123123)
|
||||
console.log('====================================')
|
||||
options.value = null
|
||||
}
|
||||
const showCharts = (row: any, valueType: number, name: string) => {
|
||||
getHistoryLineData({
|
||||
lineId: row.lineId,
|
||||
number: row.number,
|
||||
phaseType: row.phaseType,
|
||||
searchTime: row.timeId,
|
||||
targetCode: row.targetCode,
|
||||
valueType
|
||||
}).then(res => {
|
||||
options.value = {
|
||||
title: {
|
||||
text: row.subName + ' ' + row.lineName + ' ' + row.targetName + ' ' + row.phaseType + '相' + name
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
name: '时间',
|
||||
data: res.data[0]?.value.map((item: any[]) => item[0])
|
||||
},
|
||||
yAxis: {
|
||||
name: '%',
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: name,
|
||||
data: res.data[0]?.value.map((item: any[]) => item[1]),
|
||||
type: 'line'
|
||||
}
|
||||
],
|
||||
options: {
|
||||
grid: {
|
||||
top: '50px',
|
||||
left: '40px',
|
||||
right: '60px',
|
||||
bottom: '10px',
|
||||
containLabel: true
|
||||
},
|
||||
dataZoom: null
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
const conditionChange = () => {
|
||||
//判断一个指标时
|
||||
if (formData.condition.length == 1) {
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断2个指标时
|
||||
if (formData.condition.length == 2) {
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
(formData.condition.includes('45') && formData.condition.includes('46')) ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断3个指标时
|
||||
if (formData.condition.length == 3) {
|
||||
if (
|
||||
(formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')) &&
|
||||
(formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49'))
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断4个指标时
|
||||
if (formData.condition.length == 4) {
|
||||
if (
|
||||
(formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')) &&
|
||||
(formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49'))
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断5个指标时
|
||||
if (formData.condition.length == 5) {
|
||||
if (
|
||||
(formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')) &&
|
||||
(formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49'))
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('46') ||
|
||||
// formData.condition.includes('47') ||
|
||||
// formData.condition.includes('48') ||
|
||||
formData.condition.includes('49')
|
||||
) {
|
||||
showJianXieBoCiShu.value = true
|
||||
} else {
|
||||
showJianXieBoCiShu.value = false
|
||||
}
|
||||
if (
|
||||
formData.condition.includes('40') ||
|
||||
formData.condition.includes('43') ||
|
||||
formData.condition.includes('44') ||
|
||||
formData.condition.includes('45')
|
||||
) {
|
||||
showXieBoCiShu.value = true
|
||||
} else {
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
//判断无指标时
|
||||
if (formData.condition.length == 0) {
|
||||
showJianXieBoCiShu.value = false
|
||||
showXieBoCiShu.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader datePicker ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="超标指标">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.targetId"
|
||||
clearable
|
||||
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="请选择超标指标"
|
||||
>
|
||||
<el-option v-for="item in exceeded" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
const dictData = useDictData()
|
||||
const exceeded = dictData.getBasicData('Steady_Statis')
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/onlineMonitor/overLimitDetail',
|
||||
publicHeight: 80,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '监测点台账',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 70,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'time',
|
||||
title: '日期',
|
||||
width: '140px'
|
||||
},
|
||||
{
|
||||
field: 'overLimitInfo',
|
||||
title: '越限详情'
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.lineId = monitoringPoint.state.lineId
|
||||
}
|
||||
})
|
||||
tableStore.table.params.targetId = exceeded.filter(item => item.code == 'Total_Indicator')[0].id
|
||||
? exceeded.filter(item => item.code == 'Total_Indicator')[0].id
|
||||
: ''
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
</script>
|
||||
<style></style>
|
||||
@@ -41,11 +41,11 @@
|
||||
<el-tab-pane label="监测点运行状态" name="6" lazy v-if="!isReload">
|
||||
<Yunxingzhuangtai v-if="activeName == '6'" />
|
||||
</el-tab-pane>
|
||||
<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'" />
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="统计报表" name="8" lazy v-if="!isReload && VITE_FLAG">
|
||||
<StatisticalReport v-if="activeName == '8'" />
|
||||
<StatisticalReport v-if="activeName == '8'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- <div
|
||||
@@ -64,33 +64,35 @@ import { defineOptions, watch, onMounted, ref, nextTick } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import Wentaizonghepinggu from './wentaizonghepinggu/index.vue'
|
||||
import Wentaizhibiaohegelv from './wentaizhibiaohegelv/index.vue'
|
||||
import Wentaishujufenxi from './wentaishujufenxi/index.vue'
|
||||
import Xiebopingpu from './xiebopingpu/index.vue'
|
||||
import Gaojingshujutongji from './gaojingshujutongji/index.vue'
|
||||
import Gaojingshujutongji from './gaojingshujutongji/index_JB.vue'
|
||||
import Yunxingzhuangtai from './yunxingzhuangtai/index.vue'
|
||||
import Shishishuju from './shishishuju/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import StatisticalReport from './statisticalReport/index.vue'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
import router from '@/router'
|
||||
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { id } from 'element-plus/es/locale'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/monitor/online'
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const pointTree = ref()
|
||||
const size = ref(0)
|
||||
const size = ref(23)
|
||||
const isReload = ref(false)
|
||||
const height = mainHeight(40)
|
||||
const activeName = ref('2')
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||
}
|
||||
})
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
@@ -121,7 +123,9 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
watch(
|
||||
() => monitoringPoint.state.lineId,
|
||||
() => {
|
||||
return monitoringPoint.state.lineId
|
||||
},
|
||||
() => {
|
||||
// 刷新页面
|
||||
isReload.value = true
|
||||
@@ -130,6 +134,49 @@ watch(
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
if (route.fullPath.includes('harmonic-boot/monitor/online')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
let lineId = (route.query.id as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
monitoringPoint.setValue('lineId', lineId)
|
||||
//
|
||||
// pointTree.value.tree
|
||||
activeName.value = type
|
||||
setTimeout(() => {
|
||||
pointTree.value.scrollToNode(lineId)
|
||||
|
||||
monitoringPoint.setValue('lineName', findNodeByTreeId(pointTree.value.tree, lineId).alias)
|
||||
}, 500)
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
// 递归函数(同上)
|
||||
const findNodeByTreeId = (treeData: any, id: any) => {
|
||||
for (const node of treeData) {
|
||||
if (node.id == id) return node
|
||||
if (node.children && Array.isArray(node.children) && node.children.length) {
|
||||
const found: any = findNodeByTreeId(node.children, id)
|
||||
if (found) return found
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
// 调用示例
|
||||
const getTargetNode = () => {
|
||||
const targetId = '9b7adecf588b4110acb7018f297592a7'
|
||||
const node = findNodeByTreeId(treeData.value, targetId)
|
||||
console.log('Vue中找到的节点:', node)
|
||||
}
|
||||
const changeTab = (e: string) => {
|
||||
activeName.value = e
|
||||
}
|
||||
|
||||
@@ -1,46 +1,44 @@
|
||||
<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>
|
||||
|
||||
<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">
|
||||
@@ -63,7 +61,7 @@ defineOptions({
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const showTree = ref(false)
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const size = ref(23)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
@@ -79,7 +77,7 @@ const tableStore = new TableStore({
|
||||
publicHeight: 30,
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.tempId = Template.value.id
|
||||
tableStore.table.params.lineId =monitoringPoint.state.lineId
|
||||
tableStore.table.params.lineId = monitoringPoint.state.lineId
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
@@ -109,7 +107,7 @@ provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
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 })
|
||||
@@ -135,21 +133,18 @@ const selectChange = () => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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('lineIndex', monitoringPoint.state.lineId)
|
||||
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)
|
||||
form.append('name', monitoringPoint.state.lineName.split('>').pop())
|
||||
ElMessage({
|
||||
message: '下载报告中,请稍等.....',
|
||||
duration: 1000
|
||||
@@ -164,7 +159,7 @@ const exportReport = () => {
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download =
|
||||
dotList.value.name +
|
||||
monitoringPoint.state.lineName.split('>').pop() +
|
||||
TableHeaderRef.value.datePickerRef.timeValue[0] +
|
||||
'_' +
|
||||
TableHeaderRef.value.datePickerRef.timeValue[1] // 设置下载的文件名
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<el-form-item label="多监测点">
|
||||
<el-checkbox v-model="checked" @change="checkChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef" :theCurrentTime="true"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标类型:">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,315 +1,315 @@
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="对比">
|
||||
<el-select v-model="searchType" clearable placeholder="可选择同比、环比">
|
||||
<el-option
|
||||
v-for="item in searchTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div style="flex: 1" class="mt10" v-loading="loading">
|
||||
<my-echart :options="options" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { getSteadyData } from '@/api/harmonic-boot/pollution'
|
||||
import { gradeColor3 } from '@/components/echarts/color'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: []
|
||||
})
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
periodBeginTime: '',
|
||||
periodEndTime: ''
|
||||
})
|
||||
const options = ref({})
|
||||
const searchType = ref('')
|
||||
const searchTypeOptions = [
|
||||
{
|
||||
label: '同比',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '环比',
|
||||
value: '2'
|
||||
}
|
||||
]
|
||||
const gradeNames = ['优质', '良好', '一般', '较差', '极差']
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
formData.id = monitoringPoint.state.lineId
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
if (searchType.value == '1') {
|
||||
;[formData.periodBeginTime, formData.periodEndTime] = datePickerRef.value.getYearOnYear(
|
||||
formData.searchBeginTime,
|
||||
formData.searchEndTime
|
||||
)
|
||||
} else if (searchType.value == '2') {
|
||||
;[formData.periodBeginTime, formData.periodEndTime] = datePickerRef.value.getMonthOnMonth(
|
||||
formData.searchBeginTime,
|
||||
formData.searchEndTime
|
||||
)
|
||||
} else {
|
||||
formData.periodBeginTime = ''
|
||||
formData.periodEndTime = ''
|
||||
}
|
||||
getSteadyData(formData).then((res: any) => {
|
||||
const { steadyInfoData, steadyInfoList } = res.data
|
||||
let yData = [],
|
||||
yData2 = []
|
||||
for (let i = 0; i < steadyInfoList.length; i++) {
|
||||
// if (steadyInfoList[i] == 3.1415) {
|
||||
// steadyInfoList[i] = 1
|
||||
// yData.push(steadyInfoList[i])
|
||||
// } else if (steadyInfoList[i] == 3.14159) {
|
||||
// steadyInfoList[i] = 1
|
||||
// yData.push(steadyInfoList[i])
|
||||
// } else if (steadyInfoList[i] !== 3.14159) {
|
||||
yData.push(steadyInfoList[i])
|
||||
// }
|
||||
}
|
||||
for (let i = 0; i < steadyInfoData.length; i++) {
|
||||
yData2.push(steadyInfoData[i])
|
||||
// if (steadyInfoData[i] == 3.14159) {
|
||||
// steadyInfoData[i] = 0
|
||||
// yData2.push(steadyInfoData[i])
|
||||
// } else if (steadyInfoData[i] == 3.14159) {
|
||||
// steadyInfoData[i] = 0
|
||||
// yData2.push(steadyInfoData[i])
|
||||
// } else if (steadyInfoData[i] !== 3.14159) {
|
||||
// yData2.push(steadyInfoData[i])
|
||||
// }
|
||||
}
|
||||
let series: any[] = [
|
||||
{
|
||||
name: formData.searchBeginTime + '至' + formData.searchEndTime,
|
||||
type: 'bar',
|
||||
barMaxWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
distance: 2,
|
||||
color: '#fff',
|
||||
fontWeight: 'bolder'
|
||||
},
|
||||
data: yData,
|
||||
markLine: {
|
||||
silent: false,
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
name: '',
|
||||
yAxis: 100,
|
||||
lineStyle: {
|
||||
color: gradeColor3[0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
formatter: '优质',
|
||||
color: gradeColor3[0]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 90,
|
||||
lineStyle: {
|
||||
color: gradeColor3[1]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
color: gradeColor3[1],
|
||||
formatter: '良好'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 60,
|
||||
lineStyle: {
|
||||
color: gradeColor3[2]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
color: gradeColor3[2],
|
||||
formatter: '合格'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
itemStyle: {
|
||||
color: (params: any) => {
|
||||
if (params.value > 90) {
|
||||
return gradeColor3[0]
|
||||
} else if (params.value > 60) {
|
||||
return gradeColor3[1]
|
||||
} else if (params.value == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return gradeColor3[2]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
if (searchType.value) {
|
||||
series.push({
|
||||
name: formData.periodBeginTime + '至' + formData.periodEndTime,
|
||||
type: 'bar',
|
||||
barMaxWidth: 30,
|
||||
// label: {
|
||||
// show: true,
|
||||
// position: 'top',
|
||||
// distance: 2,
|
||||
// color: '#fff',
|
||||
// fontWeight: 'bolder'
|
||||
// },
|
||||
data: yData2,
|
||||
itemStyle: {
|
||||
color: (params: any) => {
|
||||
if (params.value > 90) {
|
||||
return gradeColor3[0]
|
||||
} else if (params.value > 60) {
|
||||
return gradeColor3[1]
|
||||
} else if (params.value == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return gradeColor3[2]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
options.value = {
|
||||
title: {
|
||||
text: '稳态指标合格率'
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
formatter: function (params: any) {
|
||||
//console.log(params)
|
||||
let msg = ''
|
||||
msg += params[0].name + '<br/>'
|
||||
for (let i in params) {
|
||||
if (params[i].data == 3.14159) {
|
||||
msg +=params[i].marker+ params[i].seriesName + ': 暂无数据<br/>'
|
||||
} else {
|
||||
msg += params[i].marker+ params[i].seriesName + ': ' + params[i].data + '<br/>'
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
name: '指标类型',
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 1
|
||||
},
|
||||
symbol: ['none', 'arrow']
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontFamily: 'dinproRegular'
|
||||
}
|
||||
},
|
||||
data: [
|
||||
'频率偏差',
|
||||
'闪变',
|
||||
'三相电压不平衡',
|
||||
'谐波电压',
|
||||
'谐波电流',
|
||||
'电压偏差',
|
||||
'负序电流',
|
||||
'间谐波电压含有率'
|
||||
]
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
name: '%',
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 100,
|
||||
position: 'left',
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 1
|
||||
},
|
||||
symbol: ['none', 'arrow']
|
||||
}
|
||||
},
|
||||
{
|
||||
position: 'left',
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow']
|
||||
},
|
||||
splitLine: {
|
||||
//分割线配置
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
series
|
||||
}
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<style></style>
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="对比">
|
||||
<el-select v-model="searchType" clearable placeholder="可选择同比、环比">
|
||||
<el-option
|
||||
v-for="item in searchTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div style="flex: 1" class="mt10" v-loading="loading">
|
||||
<my-echart :options="options" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { getSteadyData } from '@/api/harmonic-boot/pollution'
|
||||
import { gradeColor3 } from '@/components/echarts/color'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: []
|
||||
})
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
periodBeginTime: '',
|
||||
periodEndTime: ''
|
||||
})
|
||||
const options = ref({})
|
||||
const searchType = ref('')
|
||||
const searchTypeOptions = [
|
||||
{
|
||||
label: '同比',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '环比',
|
||||
value: '2'
|
||||
}
|
||||
]
|
||||
const gradeNames = ['优质', '良好', '一般', '较差', '极差']
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
formData.id = monitoringPoint.state.lineId
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
if (searchType.value == '1') {
|
||||
;[formData.periodBeginTime, formData.periodEndTime] = datePickerRef.value.getYearOnYear(
|
||||
formData.searchBeginTime,
|
||||
formData.searchEndTime
|
||||
)
|
||||
} else if (searchType.value == '2') {
|
||||
;[formData.periodBeginTime, formData.periodEndTime] = datePickerRef.value.getMonthOnMonth(
|
||||
formData.searchBeginTime,
|
||||
formData.searchEndTime
|
||||
)
|
||||
} else {
|
||||
formData.periodBeginTime = ''
|
||||
formData.periodEndTime = ''
|
||||
}
|
||||
getSteadyData(formData).then((res: any) => {
|
||||
const { steadyInfoData, steadyInfoList } = res.data
|
||||
let yData = [],
|
||||
yData2 = []
|
||||
for (let i = 0; i < steadyInfoList.length; i++) {
|
||||
// if (steadyInfoList[i] == 3.1415) {
|
||||
// steadyInfoList[i] = 1
|
||||
// yData.push(steadyInfoList[i])
|
||||
// } else if (steadyInfoList[i] == 3.14159) {
|
||||
// steadyInfoList[i] = 1
|
||||
// yData.push(steadyInfoList[i])
|
||||
// } else if (steadyInfoList[i] !== 3.14159) {
|
||||
yData.push(steadyInfoList[i])
|
||||
// }
|
||||
}
|
||||
for (let i = 0; i < steadyInfoData.length; i++) {
|
||||
yData2.push(steadyInfoData[i])
|
||||
// if (steadyInfoData[i] == 3.14159) {
|
||||
// steadyInfoData[i] = 0
|
||||
// yData2.push(steadyInfoData[i])
|
||||
// } else if (steadyInfoData[i] == 3.14159) {
|
||||
// steadyInfoData[i] = 0
|
||||
// yData2.push(steadyInfoData[i])
|
||||
// } else if (steadyInfoData[i] !== 3.14159) {
|
||||
// yData2.push(steadyInfoData[i])
|
||||
// }
|
||||
}
|
||||
let series: any[] = [
|
||||
{
|
||||
name: formData.searchBeginTime + '至' + formData.searchEndTime,
|
||||
type: 'bar',
|
||||
barMaxWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
distance: 2,
|
||||
color: '#fff',
|
||||
fontWeight: 'bolder'
|
||||
},
|
||||
data: yData,
|
||||
markLine: {
|
||||
silent: false,
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
name: '',
|
||||
yAxis: 100,
|
||||
lineStyle: {
|
||||
color: gradeColor3[0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
formatter: '优质',
|
||||
color: gradeColor3[0]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 90,
|
||||
lineStyle: {
|
||||
color: gradeColor3[1]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
color: gradeColor3[1],
|
||||
formatter: '良好'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 60,
|
||||
lineStyle: {
|
||||
color: gradeColor3[2]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
color: gradeColor3[2],
|
||||
formatter: '合格'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
itemStyle: {
|
||||
color: (params: any) => {
|
||||
if (params.value > 90) {
|
||||
return gradeColor3[0]
|
||||
} else if (params.value > 60) {
|
||||
return gradeColor3[1]
|
||||
} else if (params.value == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return gradeColor3[2]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
if (searchType.value) {
|
||||
series.push({
|
||||
name: formData.periodBeginTime + '至' + formData.periodEndTime,
|
||||
type: 'bar',
|
||||
barMaxWidth: 30,
|
||||
// label: {
|
||||
// show: true,
|
||||
// position: 'top',
|
||||
// distance: 2,
|
||||
// color: '#fff',
|
||||
// fontWeight: 'bolder'
|
||||
// },
|
||||
data: yData2,
|
||||
itemStyle: {
|
||||
color: (params: any) => {
|
||||
if (params.value > 90) {
|
||||
return gradeColor3[0]
|
||||
} else if (params.value > 60) {
|
||||
return gradeColor3[1]
|
||||
} else if (params.value == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return gradeColor3[2]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
options.value = {
|
||||
title: {
|
||||
text: '稳态指标合格率'
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
formatter: function (params: any) {
|
||||
//console.log(params)
|
||||
let msg = ''
|
||||
msg += params[0].name + '<br/>'
|
||||
for (let i in params) {
|
||||
if (params[i].data == 3.14159) {
|
||||
msg +=params[i].marker+ params[i].seriesName + ': 暂无数据<br/>'
|
||||
} else {
|
||||
msg += params[i].marker+ params[i].seriesName + ': ' + params[i].data + '<br/>'
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
name: '指标类型',
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 1
|
||||
},
|
||||
symbol: ['none', 'arrow']
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontFamily: 'dinproRegular'
|
||||
}
|
||||
},
|
||||
data: [
|
||||
'频率偏差',
|
||||
'闪变',
|
||||
'三相电压不平衡',
|
||||
'谐波电压',
|
||||
'谐波电流',
|
||||
'电压偏差',
|
||||
'负序电流',
|
||||
'间谐波电压含有率'
|
||||
]
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
name: '%',
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 100,
|
||||
position: 'left',
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 1
|
||||
},
|
||||
symbol: ['none', 'arrow']
|
||||
}
|
||||
},
|
||||
{
|
||||
position: 'left',
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow']
|
||||
},
|
||||
splitLine: {
|
||||
//分割线配置
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
series
|
||||
}
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@@ -1,212 +1,212 @@
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="日期">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="flex: 1" class="mt10">
|
||||
<my-echart :options="options" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { getQualityAssessData } from '@/api/harmonic-boot/asses'
|
||||
import { gradeColor5 } from '@/components/echarts/color'
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
periodBeginTime: '',
|
||||
periodEndTime: ''
|
||||
})
|
||||
const options = ref({})
|
||||
const gradeNames = ['优质', '良好', '一般', '较差', '极差']
|
||||
const grade = gradeColor5.map((item, index) => {
|
||||
return {
|
||||
name: gradeNames[index],
|
||||
color: item
|
||||
}
|
||||
})
|
||||
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
if (!monitoringPoint.state.lineId) {
|
||||
return
|
||||
}
|
||||
formData.id = monitoringPoint.state.lineId
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getQualityAssessData(formData).then((res: any) => {
|
||||
let data = res.data.syn[0]
|
||||
if (data == 3.14159) {
|
||||
data = 0.25
|
||||
} else if (data == 3.1415) {
|
||||
data = 0.15
|
||||
}
|
||||
options.value = {
|
||||
title: {
|
||||
text: '稳态综合评估',
|
||||
x: 'center',
|
||||
y: '0%'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
borderColor: '#fff',
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
formatter: function (params: any) {
|
||||
if (params.value >= 5) {
|
||||
return params.name + ' : ' + '优质'
|
||||
} else if (params.value > 4 && params.value <= 5) {
|
||||
return params.name + ' : ' + '良好'
|
||||
} else if (params.value > 3 && params.value <= 4) {
|
||||
return params.name + ' : ' + '合格'
|
||||
} else if (params.value > 2 && params.value <= 3) {
|
||||
return params.name + ' : ' + '较差'
|
||||
} else if (params.value <= 2 && params.value >= 1) {
|
||||
return params.name + ' : ' + '极差'
|
||||
} else if (params.value >= 0.25 && params.value < 1) {
|
||||
return params.name + ' : ' + '暂无数据'
|
||||
} else if (params.value <= 0.15 && params.value >= 0) {
|
||||
return params.name + ' : ' + '/'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
name: '指标',
|
||||
type: 'category',
|
||||
data: ['稳态综合评估'],
|
||||
axisLabel: {
|
||||
margin: 10
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
symbol: ['none', 'arrow']
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: {
|
||||
name: '等级',
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 5,
|
||||
axisLabel: {
|
||||
show: true,
|
||||
// 这里重新定义就可以
|
||||
formatter: function (value: number) {
|
||||
var texts = []
|
||||
if (value === 1) {
|
||||
texts.push('1级')
|
||||
} else if (value === 2) {
|
||||
texts.push('2级')
|
||||
} else if (value === 3) {
|
||||
texts.push('3级')
|
||||
} else if (value === 4) {
|
||||
texts.push('4级')
|
||||
} else if (value === 5) {
|
||||
texts.push('5级')
|
||||
}
|
||||
return texts
|
||||
}
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow']
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '综合评估',
|
||||
type: 'bar',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
distance: 2,
|
||||
color: '#fff',
|
||||
fontWeight: 'bolder'
|
||||
},
|
||||
barWidth: '45',
|
||||
data: [
|
||||
{
|
||||
value: data
|
||||
}
|
||||
],
|
||||
markLine: {
|
||||
silent: false,
|
||||
symbol: 'circle',
|
||||
data: grade.map((item, index) => {
|
||||
return {
|
||||
yAxis: grade.length - index,
|
||||
name: item.name,
|
||||
lineStyle: {
|
||||
color: item.color
|
||||
},
|
||||
label: {
|
||||
color: item.color,
|
||||
formatter: item.name
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
itemStyle: {
|
||||
color: (params: any) => {
|
||||
if (params.value > 5) {
|
||||
return gradeColor5[0]
|
||||
} else if (params.value > 4) {
|
||||
return gradeColor5[1]
|
||||
} else if (params.value > 3) {
|
||||
return gradeColor5[2]
|
||||
} else if (params.value > 2) {
|
||||
return gradeColor5[3]
|
||||
} else {
|
||||
return gradeColor5[4]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
options: {
|
||||
dataZoom: null
|
||||
}
|
||||
}
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<style></style>
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="flex: 1" class="mt10">
|
||||
<my-echart :options="options" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { getQualityAssessData } from '@/api/harmonic-boot/asses'
|
||||
import { gradeColor5 } from '@/components/echarts/color'
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
periodBeginTime: '',
|
||||
periodEndTime: ''
|
||||
})
|
||||
const options = ref({})
|
||||
const gradeNames = ['优质', '良好', '一般', '较差', '极差']
|
||||
const grade = gradeColor5.map((item, index) => {
|
||||
return {
|
||||
name: gradeNames[index],
|
||||
color: item
|
||||
}
|
||||
})
|
||||
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
if (!monitoringPoint.state.lineId) {
|
||||
return
|
||||
}
|
||||
formData.id = monitoringPoint.state.lineId
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getQualityAssessData(formData).then((res: any) => {
|
||||
let data = res.data.syn[0]
|
||||
if (data == 3.14159) {
|
||||
data = 0.25
|
||||
} else if (data == 3.1415) {
|
||||
data = 0.15
|
||||
}
|
||||
options.value = {
|
||||
title: {
|
||||
text: '稳态综合评估',
|
||||
x: 'center',
|
||||
y: '0%'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
borderColor: '#fff',
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
formatter: function (params: any) {
|
||||
if (params.value >= 5) {
|
||||
return params.name + ' : ' + '优质'
|
||||
} else if (params.value > 4 && params.value <= 5) {
|
||||
return params.name + ' : ' + '良好'
|
||||
} else if (params.value > 3 && params.value <= 4) {
|
||||
return params.name + ' : ' + '合格'
|
||||
} else if (params.value > 2 && params.value <= 3) {
|
||||
return params.name + ' : ' + '较差'
|
||||
} else if (params.value <= 2 && params.value >= 1) {
|
||||
return params.name + ' : ' + '极差'
|
||||
} else if (params.value >= 0.25 && params.value < 1) {
|
||||
return params.name + ' : ' + '暂无数据'
|
||||
} else if (params.value <= 0.15 && params.value >= 0) {
|
||||
return params.name + ' : ' + '/'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
name: '指标',
|
||||
type: 'category',
|
||||
data: ['稳态综合评估'],
|
||||
axisLabel: {
|
||||
margin: 10
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
symbol: ['none', 'arrow']
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: {
|
||||
name: '等级',
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 5,
|
||||
axisLabel: {
|
||||
show: true,
|
||||
// 这里重新定义就可以
|
||||
formatter: function (value: number) {
|
||||
var texts = []
|
||||
if (value === 1) {
|
||||
texts.push('1级')
|
||||
} else if (value === 2) {
|
||||
texts.push('2级')
|
||||
} else if (value === 3) {
|
||||
texts.push('3级')
|
||||
} else if (value === 4) {
|
||||
texts.push('4级')
|
||||
} else if (value === 5) {
|
||||
texts.push('5级')
|
||||
}
|
||||
return texts
|
||||
}
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
symbol: ['none', 'arrow']
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '综合评估',
|
||||
type: 'bar',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
distance: 2,
|
||||
color: '#fff',
|
||||
fontWeight: 'bolder'
|
||||
},
|
||||
barWidth: '45',
|
||||
data: [
|
||||
{
|
||||
value: data
|
||||
}
|
||||
],
|
||||
markLine: {
|
||||
silent: false,
|
||||
symbol: 'circle',
|
||||
data: grade.map((item, index) => {
|
||||
return {
|
||||
yAxis: grade.length - index,
|
||||
name: item.name,
|
||||
lineStyle: {
|
||||
color: item.color
|
||||
},
|
||||
label: {
|
||||
color: item.color,
|
||||
formatter: item.name
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
itemStyle: {
|
||||
color: (params: any) => {
|
||||
if (params.value > 5) {
|
||||
return gradeColor5[0]
|
||||
} else if (params.value > 4) {
|
||||
return gradeColor5[1]
|
||||
} else if (params.value > 3) {
|
||||
return gradeColor5[2]
|
||||
} else if (params.value > 2) {
|
||||
return gradeColor5[3]
|
||||
} else {
|
||||
return gradeColor5[4]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
options: {
|
||||
dataZoom: null
|
||||
}
|
||||
}
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@@ -1,136 +1,136 @@
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标">
|
||||
<el-radio-group v-model="formData.harmState">
|
||||
<el-radio-button :label="0">谐波电压含有率</el-radio-button>
|
||||
<el-radio-button :label="1">谐波电流幅值</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<vxe-table :data="analysisData" v-bind="defaultAttribute">
|
||||
<vxe-column field="name" title="指标" width="140px"></vxe-column>
|
||||
<vxe-column
|
||||
:field="index.toString()"
|
||||
:title="item + 1 + '次'"
|
||||
v-for="(item, index) in 49"
|
||||
width="80px"
|
||||
></vxe-column>
|
||||
</vxe-table>
|
||||
<div style="flex: 1" class="mt10" v-loading="loading">
|
||||
<my-echart :options="options" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { getHarmInHarmData } from '@/api/harmonic-boot/inHarm'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: []
|
||||
})
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const formData = reactive({
|
||||
id: monitoringPoint.state.lineId,
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
harmState: 0
|
||||
})
|
||||
const analysisData = ref<any>([])
|
||||
const options = ref({})
|
||||
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
formData.id = monitoringPoint.state.lineId
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getHarmInHarmData(formData).then((res: any) => {
|
||||
let xName = ''
|
||||
analysisData.value = []
|
||||
if (formData.harmState === 1) {
|
||||
xName = 'A'
|
||||
analysisData.value.push(
|
||||
{
|
||||
name: '谐波电流幅值(A)',
|
||||
originData: res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? 0.14159 : Math.floor(item * 1000) / 1000
|
||||
),
|
||||
...res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? '/' : Math.floor(item * 1000) / 1000
|
||||
)
|
||||
},
|
||||
{
|
||||
name: '国标限值(A)',
|
||||
originData: res.data.harmInOverLimit,
|
||||
...res.data.harmInOverLimit
|
||||
}
|
||||
)
|
||||
} else {
|
||||
xName = '%'
|
||||
analysisData.value.push(
|
||||
{
|
||||
name: '谐波电压含有率(%)',
|
||||
originData: res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? 0.14159 : Math.floor(item * 1000) / 1000
|
||||
),
|
||||
...res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? '/' : Math.floor(item * 1000) / 1000
|
||||
)
|
||||
},
|
||||
{
|
||||
name: '国标限值(%)',
|
||||
originData: res.data.harmInOverLimit,
|
||||
...res.data.harmInOverLimit
|
||||
}
|
||||
)
|
||||
}
|
||||
options.value = {
|
||||
xAxis: {
|
||||
name: '次数',
|
||||
type: 'category',
|
||||
data: Array.from({ length: 49 }, (_, i) => `${i + 2}次`)
|
||||
},
|
||||
yAxis: {
|
||||
name: xName,
|
||||
type: 'value'
|
||||
},
|
||||
color: ['#2E8B57', '#DAA520'],
|
||||
series: analysisData.value.map((item: any) => {
|
||||
return {
|
||||
name: item.name,
|
||||
data: item.originData,
|
||||
type: 'bar'
|
||||
}
|
||||
}),
|
||||
options: {
|
||||
// dataZoom: null
|
||||
}
|
||||
}
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="指标">
|
||||
<el-radio-group v-model="formData.harmState">
|
||||
<el-radio-button :label="0">谐波电压含有率</el-radio-button>
|
||||
<el-radio-button :label="1">谐波电流幅值</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" @click="init" icon="el-icon-Search">查询</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<vxe-table :data="analysisData" v-bind="defaultAttribute">
|
||||
<vxe-column field="name" title="指标" width="140px"></vxe-column>
|
||||
<vxe-column
|
||||
:field="index.toString()"
|
||||
:title="item + 1 + '次'"
|
||||
v-for="(item, index) in 49"
|
||||
width="80px"
|
||||
></vxe-column>
|
||||
</vxe-table>
|
||||
<div style="flex: 1" class="mt10" v-loading="loading">
|
||||
<my-echart :options="options" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { getHarmInHarmData } from '@/api/harmonic-boot/inHarm'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: []
|
||||
})
|
||||
const datePickerRef = ref()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const loading = ref(true)
|
||||
const formData = reactive({
|
||||
id: monitoringPoint.state.lineId,
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
harmState: 0
|
||||
})
|
||||
const analysisData = ref<any>([])
|
||||
const options = ref({})
|
||||
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
formData.id = monitoringPoint.state.lineId
|
||||
formData.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
formData.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
getHarmInHarmData(formData).then((res: any) => {
|
||||
let xName = ''
|
||||
analysisData.value = []
|
||||
if (formData.harmState === 1) {
|
||||
xName = 'A'
|
||||
analysisData.value.push(
|
||||
{
|
||||
name: '谐波电流幅值(A)',
|
||||
originData: res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? 0.14159 : Math.floor(item * 1000) / 1000
|
||||
),
|
||||
...res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? '/' : Math.floor(item * 1000) / 1000
|
||||
)
|
||||
},
|
||||
{
|
||||
name: '国标限值(A)',
|
||||
originData: res.data.harmInOverLimit,
|
||||
...res.data.harmInOverLimit
|
||||
}
|
||||
)
|
||||
} else {
|
||||
xName = '%'
|
||||
analysisData.value.push(
|
||||
{
|
||||
name: '谐波电压含有率(%)',
|
||||
originData: res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? 0.14159 : Math.floor(item * 1000) / 1000
|
||||
),
|
||||
...res.data.harmInHarmValue.map((item: number) =>
|
||||
item == null || item == 3.14159 ? '/' : Math.floor(item * 1000) / 1000
|
||||
)
|
||||
},
|
||||
{
|
||||
name: '国标限值(%)',
|
||||
originData: res.data.harmInOverLimit,
|
||||
...res.data.harmInOverLimit
|
||||
}
|
||||
)
|
||||
}
|
||||
options.value = {
|
||||
xAxis: {
|
||||
name: '次数',
|
||||
type: 'category',
|
||||
data: Array.from({ length: 49 }, (_, i) => `${i + 2}次`)
|
||||
},
|
||||
yAxis: {
|
||||
name: xName,
|
||||
type: 'value'
|
||||
},
|
||||
color: ['#2E8B57', '#DAA520'],
|
||||
series: analysisData.value.map((item: any) => {
|
||||
return {
|
||||
name: item.name,
|
||||
data: item.originData,
|
||||
type: 'bar'
|
||||
}
|
||||
}),
|
||||
options: {
|
||||
// dataZoom: null
|
||||
}
|
||||
}
|
||||
nextTick(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div style="display: flex; flex-direction: column; height: 100%">
|
||||
<TableHeader ref="TableHeaderRef" :showSearch="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<el-form-item label="统计时间">
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="对比">
|
||||
|
||||
@@ -71,7 +71,7 @@ defineOptions({
|
||||
})
|
||||
const showTree = ref(false)
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const size = ref(23)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
@@ -129,7 +129,7 @@ provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
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 })
|
||||
@@ -165,7 +165,6 @@ const exportEvent = () => {
|
||||
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
|
||||
}
|
||||
const exportReport = () => {
|
||||
|
||||
loading.value = true
|
||||
let form = new FormData()
|
||||
form.append('isUrl', false)
|
||||
|
||||
@@ -1,152 +1,171 @@
|
||||
<template>
|
||||
<div class='default-main' :style='height'>
|
||||
<splitpanes style='height: 100%' class='default-theme' id='navigation-splitpanes'>
|
||||
<pane :size='size'>
|
||||
<PointTree :default-expand-all='false' @node-click='handleNodeClick' @init='handleNodeClick'>
|
||||
</PointTree>
|
||||
</pane>
|
||||
<pane style='background: #fff' :style='height'>
|
||||
<TableHeader ref='TableHeaderRef' datePicker :show-search='false'>
|
||||
<template v-slot:select>
|
||||
<el-form-item label='客户名称'>
|
||||
<el-input v-model='tableStore.table.params.crmName' maxlength='32' show-word-limit clearable
|
||||
placeholder='请输入客户名称' />
|
||||
</el-form-item>
|
||||
<el-form-item label='报表编号'>
|
||||
<el-input v-model='tableStore.table.params.reportNumber' clearable
|
||||
placeholder='请输入报表编号' maxlength='12' show-word-limit />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload :show-file-list='false' ref='uploadRef' action='' accept='.png,.jpg'
|
||||
:on-change='choose' :auto-upload='false'>
|
||||
<template #trigger>
|
||||
<el-button icon='el-icon-Upload' type='primary' class='mr10 ml10'>上传接线图</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button icon='el-icon-Download' type='primary' @click='exportEvent'>生成</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div class='box'>
|
||||
<div id='luckysheet'>
|
||||
<img width='100%' :style='`height: calc(${tableStore.table.height} + 40px)`'
|
||||
src='@/assets/img/jss.png' />
|
||||
</div>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</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 { mainHeight } from '@/utils/layout'
|
||||
import { exportModel } from '@/api/process-boot/reportForms'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
|
||||
defineOptions({
|
||||
// name: 'harmonic-boot/report/word'
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
const Template: any = ref({})
|
||||
const uploadList: any = ref([])
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
},
|
||||
loadCallback: () => {
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
|
||||
|
||||
if (dom) {
|
||||
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
dotList.value = data
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
const isJPG = files.raw.type === 'image/jpg'
|
||||
const isPNG = files.raw.type === 'image/png'
|
||||
if (!isJPG && !isPNG) {
|
||||
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
uploadList.value = files
|
||||
ElMessage.success('上传成功')
|
||||
}
|
||||
// 生成
|
||||
const exportEvent = () => {
|
||||
if (dotList.value.level != 6) {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
|
||||
let form = new FormData()
|
||||
form.append('lineIndex', dotList.value.id)
|
||||
form.append('name', dotList.value.name)
|
||||
form.append('crmName', tableStore.table.params.crmName || '')
|
||||
form.append('reportNumber', tableStore.table.params.reportNumber || '')
|
||||
form.append('type', '0')
|
||||
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||
console.log('🚀 ~ exportEvent ~ uploadList.value:', uploadList.value?.raw)
|
||||
form.append('file', uploadList.value?.raw || '')
|
||||
// 特殊字符正则表达式
|
||||
const specialCharRegex = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/
|
||||
if (specialCharRegex.test(tableStore.table.params.crmName) || specialCharRegex.test(tableStore.table.params.reportNumber)) {
|
||||
ElNotification({
|
||||
type: 'error',
|
||||
message: '包含特殊字符,请注意修改!'
|
||||
})
|
||||
}else{
|
||||
ElMessage('生成报告中...')
|
||||
exportModel(form).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = dotList.value.name // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main" :style="height">
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<PointTree
|
||||
:default-expand-all="false"
|
||||
@node-click="handleNodeClick"
|
||||
@init="handleNodeClick"
|
||||
></PointTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" datePicker :show-search="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="客户名称">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.crmName"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
clearable
|
||||
placeholder="请输入客户名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报表编号">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.reportNumber"
|
||||
clearable
|
||||
placeholder="请输入报表编号"
|
||||
maxlength="12"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload
|
||||
:show-file-list="false"
|
||||
ref="uploadRef"
|
||||
action=""
|
||||
accept=".png,.jpg"
|
||||
:on-change="choose"
|
||||
:auto-upload="false"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button icon="el-icon-Upload" type="primary" class="mr10 ml10">上传接线图</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div class="box">
|
||||
<div id="luckysheet">
|
||||
<img
|
||||
width="100%"
|
||||
:style="`height: calc(${tableStore.table.height} + 40px)`"
|
||||
src="@/assets/img/jss.png"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</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 { mainHeight } from '@/utils/layout'
|
||||
import { exportModel } from '@/api/process-boot/reportForms'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
|
||||
defineOptions({
|
||||
// name: 'harmonic-boot/report/word'
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const size = ref(23)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
const Template: any = ref({})
|
||||
const uploadList: any = ref([])
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||
}
|
||||
})
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
dotList.value = data
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
const isJPG = files.raw.type === 'image/jpg'
|
||||
const isPNG = files.raw.type === 'image/png'
|
||||
if (!isJPG && !isPNG) {
|
||||
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
uploadList.value = files
|
||||
ElMessage.success('上传成功')
|
||||
}
|
||||
// 生成
|
||||
const exportEvent = () => {
|
||||
if (dotList.value.level != 6) {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
|
||||
let form = new FormData()
|
||||
form.append('lineIndex', dotList.value.id)
|
||||
form.append('name', dotList.value.name)
|
||||
form.append('crmName', tableStore.table.params.crmName || '')
|
||||
form.append('reportNumber', tableStore.table.params.reportNumber || '')
|
||||
form.append('type', '0')
|
||||
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||
console.log('🚀 ~ exportEvent ~ uploadList.value:', uploadList.value?.raw)
|
||||
form.append('file', uploadList.value?.raw || '')
|
||||
// 特殊字符正则表达式
|
||||
const specialCharRegex = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/
|
||||
if (
|
||||
specialCharRegex.test(tableStore.table.params.crmName) ||
|
||||
specialCharRegex.test(tableStore.table.params.reportNumber)
|
||||
) {
|
||||
ElNotification({
|
||||
type: 'error',
|
||||
message: '包含特殊字符,请注意修改!'
|
||||
})
|
||||
} else {
|
||||
ElMessage('生成报告中...')
|
||||
exportModel(form).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = dotList.value.name // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -113,7 +113,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'businessType', title: '行业类型' , minWidth: 100},
|
||||
|
||||
{ field: 'devName', title: '终端名称', minWidth: 80 },
|
||||
{ field: 'ip', title: '网络参数' , minWidth: 100},
|
||||
{ field: 'ip', title: '网络参数' ,width:'120px'},
|
||||
|
||||
// { field: 'comFlag', title: '通讯状态' , minWidth: 100},
|
||||
{
|
||||
|
||||
@@ -154,7 +154,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'manufacturer', title: '厂家', minWidth: 100 },
|
||||
|
||||
{ field: 'devName', title: '终端名称', minWidth: 80 },
|
||||
{ field: 'ip', title: '网络参数', minWidth: 100 },
|
||||
{ field: 'ip', title: '网络参数' ,width:'120px' },
|
||||
{ field: 'loginTime', title: '投运时间', minWidth: 100 },
|
||||
{ field: 'devType', title: '终端型号', minWidth: 100 },
|
||||
{ field: 'port', title: '端口', minWidth: 100 },
|
||||
|
||||
@@ -85,7 +85,7 @@ const options: any = dictData.getBasicData('Pollution_Statis').filter(item => {
|
||||
return item
|
||||
}
|
||||
})
|
||||
const contaminate = ref(options[0].id)
|
||||
const contaminate = ref(options[0]?.id)
|
||||
const rowList: any = ref({})
|
||||
const trendEChart: any = ref({})
|
||||
const tableData: any = ref([])
|
||||
|
||||
@@ -1,343 +1,343 @@
|
||||
<!-- 稳态 -->
|
||||
<template>
|
||||
<!-- 终端 -->
|
||||
<el-dialog draggable title="稳态电能质量水平评估统计" v-model="dialogVisible" width="1400px">
|
||||
<el-row style="height: 300px" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="title">
|
||||
<span>稳态电能质量水平评估</span>
|
||||
</div>
|
||||
<div class="boxSteps">
|
||||
<el-steps>
|
||||
<template v-for="(item, i) in Voltage">
|
||||
<el-step
|
||||
:class="active == i ? 'highlight' : ''"
|
||||
:title="item.name"
|
||||
@click="handleClick(i)"
|
||||
></el-step>
|
||||
</template>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div v-for="(item, i) in evaluationData" class="evaluationData">
|
||||
<el-row style="width: 100%">
|
||||
<el-col :span="12" style="display: flex">
|
||||
<img :src="url[i]" />
|
||||
<span>{{ item.targetName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12" style="display: flex">
|
||||
<div style="width: 150px">
|
||||
均值:
|
||||
<span style="color: #339966">{{ item.avg == 3.14159 ? '--' : item.avg }}</span>
|
||||
</div>
|
||||
<div>
|
||||
标准差:
|
||||
<span style="color: #ff9900">{{ item.avg == 3.14159 ? '--' : item.sd }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="title">
|
||||
<span>稳态电能质量超标占比环比变化</span>
|
||||
</div>
|
||||
<div class="pie">
|
||||
<div style="height: 250px; width: 100%" ref="chartRef"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div>
|
||||
<div class="title">
|
||||
<span>区域稳态电能质量水平评估</span>
|
||||
</div>
|
||||
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="365px" :data="tableData">
|
||||
<vxe-column field="deptName" title="区域" />
|
||||
<vxe-column sortable field="onlineNum" title="在线监测点数量(个)" />
|
||||
<vxe-column sortable field="overNum" title="超标监测点数量(个)" />
|
||||
<vxe-column sortable field="overRatio" title="超标监测点占比(%)" />
|
||||
|
||||
<vxe-colgroup :title="item" v-for="(item, i) in title">
|
||||
<vxe-column title="监测点数 " field="overNum">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.list == null ? '' : scope.row.list[i].overNum }}</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="天数" field="overDay">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.list == null ? '' : scope.row.list[i].overDay }}</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-colgroup>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick } from 'vue'
|
||||
import echarts from '@/components/echarts/echarts'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { color } from '@/components/echarts/color'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { getEvaluationData, evaluationDetail, evaluationRatio } from '@/api/device-boot/panorama'
|
||||
const dialogVisible: any = ref(false)
|
||||
const rowList = ref({})
|
||||
const active: any = ref(1)
|
||||
const evaluationData: any = ref([])
|
||||
|
||||
const dictData = useDictData()
|
||||
const Voltage: any = dictData.getBasicData('Dev_Voltage_Stand').filter(item => {
|
||||
if (item.code == '35kV' || item.code == '500kV' || item.code == '220kV' || item.code == '110kV') {
|
||||
return item
|
||||
}
|
||||
})
|
||||
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
const url: any = [
|
||||
new URL(`@/assets/img/PLPC.png`, import.meta.url),
|
||||
new URL(`@/assets/img/DYPC.png`, import.meta.url),
|
||||
new URL(`@/assets/img/JBL.png`, import.meta.url),
|
||||
new URL(`@/assets/img/SXDY.png`, import.meta.url),
|
||||
new URL(`@/assets/img/SB.png`, import.meta.url)
|
||||
]
|
||||
const tableData: any = ref([])
|
||||
const title = ['电压偏差(超标)', '频率偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
|
||||
|
||||
const echart = (row: any) => {
|
||||
let maxList: any = []
|
||||
row.forEach((item: any) => {
|
||||
maxList.push(...(item.ratioList || [0]))
|
||||
})
|
||||
let max = Math.max(...maxList) > 50 ? 100 : 50
|
||||
|
||||
let chart = echarts.init(chartRef.value as HTMLDivElement)
|
||||
|
||||
let dataname = [
|
||||
'频率偏差(Hz)',
|
||||
'电压偏差(%)',
|
||||
'电压总谐波畸变率(%)',
|
||||
'三相电压不平衡度(%)',
|
||||
'闪变',
|
||||
'谐波电压(%)',
|
||||
'谐波电流(%)',
|
||||
'间谐波电压(%)',
|
||||
'负序电流(A)'
|
||||
]
|
||||
// let datamax = [100, 100, 100, 100, 100, 100]
|
||||
let indicator = []
|
||||
for (let i = 0; i < dataname.length; i++) {
|
||||
indicator.push({
|
||||
name: dataname[i],
|
||||
max: max
|
||||
})
|
||||
}
|
||||
|
||||
let option: any = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
position: 'bottom'
|
||||
},
|
||||
legend: {
|
||||
data: row.map((item: any) => item.time),
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
icon: 'roundRect',
|
||||
right: '20',
|
||||
|
||||
itemGap: 10,
|
||||
itemWidth: 16,
|
||||
itemHeight: 16,
|
||||
textStyle: {
|
||||
fontSize: '15',
|
||||
color: '#656565'
|
||||
}
|
||||
},
|
||||
radar: {
|
||||
center: ['50%', '60%'],
|
||||
radius: '60%',
|
||||
startAngle: 90,
|
||||
splitNumber: 5,
|
||||
splitArea: {
|
||||
areaStyle: {
|
||||
color: ['#FFFFFF', '#F5F9FF'].reverse()
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#D2E4F8'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#D2E4F8'
|
||||
}
|
||||
},
|
||||
name: {
|
||||
formatter: '{value}',
|
||||
textStyle: {
|
||||
color: '#656565',
|
||||
fontSize: 15
|
||||
}
|
||||
},
|
||||
indicator: indicator
|
||||
},
|
||||
|
||||
series: []
|
||||
}
|
||||
|
||||
row.forEach((item: any, i: any) => {
|
||||
option.series.push({
|
||||
name: item.time,
|
||||
type: 'radar',
|
||||
symbol: 'none',
|
||||
areaStyle: {
|
||||
normal: {
|
||||
color: color[i + 1]
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: color[i + 1]
|
||||
},
|
||||
data: [item.ratioList]
|
||||
})
|
||||
})
|
||||
|
||||
chart.setOption(option)
|
||||
}
|
||||
|
||||
const open = async (row: any) => {
|
||||
rowList.value = row
|
||||
dialogVisible.value = true
|
||||
// 稳态电能质量水平评估
|
||||
handleClick(0)
|
||||
//环比
|
||||
evaluationRatio(row).then(res => {
|
||||
echart(res.data)
|
||||
})
|
||||
// 稳态电能质量水平评估详细列表
|
||||
evaluationDetail(row).then(res => {
|
||||
tableData.value = res.data
|
||||
})
|
||||
}
|
||||
// 点击电压等级
|
||||
const handleClick = (i: any) => {
|
||||
active.value = i
|
||||
getEvaluationData({
|
||||
...rowList.value,
|
||||
voltageLevel: Voltage[i].id
|
||||
}).then(res => {
|
||||
evaluationData.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-select) {
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 10px;
|
||||
|
||||
span {
|
||||
font-weight: 550;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.pie {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.evaluationData {
|
||||
height: 33px;
|
||||
margin: 8px 30px;
|
||||
width: 100%;
|
||||
box-shadow: 1px 1px 1px 1px #e8e3e3;
|
||||
display: flex;
|
||||
font-size: 18px;
|
||||
line-height: 35px;
|
||||
|
||||
img {
|
||||
height: 25px;
|
||||
width: 25px;
|
||||
margin: 4px 20px 0px 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-steps {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
:deep(.el-step__icon) {
|
||||
border: none;
|
||||
background: #ccc;
|
||||
margin-top: 5px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
:deep(.el-step__icon-inner) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.boxSteps) {
|
||||
border-radius: 50px;
|
||||
width: 60%;
|
||||
height: 25px;
|
||||
margin: auto;
|
||||
margin-top: 30px;
|
||||
|
||||
.el-step__title {
|
||||
line-height: 18px;
|
||||
font-size: 16px;
|
||||
margin-left: -10px;
|
||||
font-weight: 500;
|
||||
color: #000 !important;
|
||||
position: relative;
|
||||
top: -50px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.highlight) {
|
||||
.el-step__icon {
|
||||
background: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-step__title {
|
||||
font-weight: 700 !important;
|
||||
color: var(--el-color-primary) !important;
|
||||
}
|
||||
|
||||
// .is-wait {
|
||||
// color: var(--el-color-primary) !important;
|
||||
// }
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
max-height: none !important;
|
||||
}
|
||||
</style>
|
||||
<!-- 稳态 -->
|
||||
<template>
|
||||
<!-- 终端 -->
|
||||
<el-dialog draggable title="稳态电能质量水平评估统计" v-model="dialogVisible" width="1400px">
|
||||
<el-row style="height: 300px" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="title">
|
||||
<span>稳态电能质量水平评估</span>
|
||||
</div>
|
||||
<div class="boxSteps">
|
||||
<el-steps>
|
||||
<template v-for="(item, i) in Voltage">
|
||||
<el-step
|
||||
:class="active == i ? 'highlight' : ''"
|
||||
:title="item.name"
|
||||
@click="handleClick(i)"
|
||||
></el-step>
|
||||
</template>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div v-for="(item, i) in evaluationData" class="evaluationData">
|
||||
<el-row style="width: 100%">
|
||||
<el-col :span="12" style="display: flex">
|
||||
<img :src="url[i]" />
|
||||
<span>{{ item.targetName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12" style="display: flex">
|
||||
<div style="width: 150px">
|
||||
均值:
|
||||
<span style="color: #339966">{{ item.avg == 3.14159 ? '--' : item.avg }}</span>
|
||||
</div>
|
||||
<div>
|
||||
标准差:
|
||||
<span style="color: #ff9900">{{ item.avg == 3.14159 ? '--' : item.sd }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="title">
|
||||
<span>稳态电能质量超标占比环比变化</span>
|
||||
</div>
|
||||
<div class="pie">
|
||||
<div style="height: 250px; width: 100%" ref="chartRef"></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div>
|
||||
<div class="title">
|
||||
<span>区域稳态电能质量水平评估</span>
|
||||
</div>
|
||||
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="365px" :data="tableData">
|
||||
<vxe-column field="deptName" title="区域" />
|
||||
<vxe-column sortable field="onlineNum" title="在运监测点数(个)" />
|
||||
<vxe-column sortable field="overNum" title="超标监测点数量(个)" />
|
||||
<vxe-column sortable field="overRatio" title="超标监测点占比(%)" />
|
||||
|
||||
<vxe-colgroup :title="item" v-for="(item, i) in title">
|
||||
<vxe-column title="监测点数 " field="overNum">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.list == null ? '' : scope.row.list[i].overNum }}</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="天数" field="overDay">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.list == null ? '' : scope.row.list[i].overDay }}</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-colgroup>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick } from 'vue'
|
||||
import echarts from '@/components/echarts/echarts'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { color } from '@/components/echarts/color'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { getEvaluationData, evaluationDetail, evaluationRatio } from '@/api/device-boot/panorama'
|
||||
const dialogVisible: any = ref(false)
|
||||
const rowList = ref({})
|
||||
const active: any = ref(1)
|
||||
const evaluationData: any = ref([])
|
||||
|
||||
const dictData = useDictData()
|
||||
const Voltage: any = dictData.getBasicData('Dev_Voltage_Stand').filter(item => {
|
||||
if (item.code == '35kV' || item.code == '500kV' || item.code == '220kV' || item.code == '110kV') {
|
||||
return item
|
||||
}
|
||||
})
|
||||
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
const url: any = [
|
||||
new URL(`@/assets/img/PLPC.png`, import.meta.url),
|
||||
new URL(`@/assets/img/DYPC.png`, import.meta.url),
|
||||
new URL(`@/assets/img/JBL.png`, import.meta.url),
|
||||
new URL(`@/assets/img/SXDY.png`, import.meta.url),
|
||||
new URL(`@/assets/img/SB.png`, import.meta.url)
|
||||
]
|
||||
const tableData: any = ref([])
|
||||
const title = ['频率偏差(超标)', '电压偏差(超标)', '电压总谐波畸变率(超标)', '闪变(超标)', '三相电压不平衡度(超标)']
|
||||
|
||||
const echart = (row: any) => {
|
||||
let maxList: any = []
|
||||
row.forEach((item: any) => {
|
||||
maxList.push(...(item.ratioList || [0]))
|
||||
})
|
||||
let max = Math.max(...maxList) > 50 ? 100 : 50
|
||||
|
||||
let chart = echarts.init(chartRef.value as HTMLDivElement)
|
||||
|
||||
let dataname = [
|
||||
'频率偏差(Hz)',
|
||||
'电压偏差(%)',
|
||||
'电压总谐波畸变率(%)',
|
||||
'三相电压不平衡度(%)',
|
||||
'闪变',
|
||||
'谐波电压(%)',
|
||||
'谐波电流(%)',
|
||||
'间谐波电压(%)',
|
||||
'负序电流(A)'
|
||||
]
|
||||
// let datamax = [100, 100, 100, 100, 100, 100]
|
||||
let indicator = []
|
||||
for (let i = 0; i < dataname.length; i++) {
|
||||
indicator.push({
|
||||
name: dataname[i],
|
||||
max: max
|
||||
})
|
||||
}
|
||||
|
||||
let option: any = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
position: 'bottom'
|
||||
},
|
||||
legend: {
|
||||
data: row.map((item: any) => item.time),
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
icon: 'roundRect',
|
||||
right: '20',
|
||||
|
||||
itemGap: 10,
|
||||
itemWidth: 16,
|
||||
itemHeight: 16,
|
||||
textStyle: {
|
||||
fontSize: '15',
|
||||
color: '#656565'
|
||||
}
|
||||
},
|
||||
radar: {
|
||||
center: ['50%', '60%'],
|
||||
radius: '60%',
|
||||
startAngle: 90,
|
||||
splitNumber: 5,
|
||||
splitArea: {
|
||||
areaStyle: {
|
||||
color: ['#FFFFFF', '#F5F9FF'].reverse()
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#D2E4F8'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#D2E4F8'
|
||||
}
|
||||
},
|
||||
name: {
|
||||
formatter: '{value}',
|
||||
textStyle: {
|
||||
color: '#656565',
|
||||
fontSize: 15
|
||||
}
|
||||
},
|
||||
indicator: indicator
|
||||
},
|
||||
|
||||
series: []
|
||||
}
|
||||
|
||||
row.forEach((item: any, i: any) => {
|
||||
option.series.push({
|
||||
name: item.time,
|
||||
type: 'radar',
|
||||
symbol: 'none',
|
||||
areaStyle: {
|
||||
normal: {
|
||||
color: color[i + 1]
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: color[i + 1]
|
||||
},
|
||||
data: [item.ratioList]
|
||||
})
|
||||
})
|
||||
|
||||
chart.setOption(option)
|
||||
}
|
||||
|
||||
const open = async (row: any) => {
|
||||
rowList.value = row
|
||||
dialogVisible.value = true
|
||||
// 稳态电能质量水平评估
|
||||
handleClick(0)
|
||||
//环比
|
||||
evaluationRatio(row).then(res => {
|
||||
echart(res.data)
|
||||
})
|
||||
// 稳态电能质量水平评估详细列表
|
||||
evaluationDetail(row).then(res => {
|
||||
tableData.value = res.data
|
||||
})
|
||||
}
|
||||
// 点击电压等级
|
||||
const handleClick = (i: any) => {
|
||||
active.value = i
|
||||
getEvaluationData({
|
||||
...rowList.value,
|
||||
voltageLevel: Voltage[i].id
|
||||
}).then(res => {
|
||||
evaluationData.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-select) {
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 10px;
|
||||
|
||||
span {
|
||||
font-weight: 550;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.pie {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.evaluationData {
|
||||
height: 33px;
|
||||
margin: 8px 30px;
|
||||
width: 100%;
|
||||
box-shadow: 1px 1px 1px 1px #e8e3e3;
|
||||
display: flex;
|
||||
font-size: 18px;
|
||||
line-height: 35px;
|
||||
|
||||
img {
|
||||
height: 25px;
|
||||
width: 25px;
|
||||
margin: 4px 20px 0px 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-steps {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
:deep(.el-step__icon) {
|
||||
border: none;
|
||||
background: #ccc;
|
||||
margin-top: 5px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
:deep(.el-step__icon-inner) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:deep(.boxSteps) {
|
||||
border-radius: 50px;
|
||||
width: 60%;
|
||||
height: 25px;
|
||||
margin: auto;
|
||||
margin-top: 30px;
|
||||
|
||||
.el-step__title {
|
||||
line-height: 18px;
|
||||
font-size: 16px;
|
||||
margin-left: -10px;
|
||||
font-weight: 500;
|
||||
color: #000 !important;
|
||||
position: relative;
|
||||
top: -50px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.highlight) {
|
||||
.el-step__icon {
|
||||
background: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.el-step__title {
|
||||
font-weight: 700 !important;
|
||||
color: var(--el-color-primary) !important;
|
||||
}
|
||||
|
||||
// .is-wait {
|
||||
// color: var(--el-color-primary) !important;
|
||||
// }
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
max-height: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,20 +6,21 @@
|
||||
<div class="title">
|
||||
<span>
|
||||
稳态综合评估
|
||||
<el-popover placement="right" :width="150" trigger="hover">
|
||||
<el-popover placement="right" :width="190" trigger="hover">
|
||||
<template #reference>
|
||||
<WarningFilled class="WarningFilled" />
|
||||
</template>
|
||||
|
||||
<div class="text">
|
||||
<span style="color: #00b07d">优质:(4.5 , 5]</span>
|
||||
<span style="color: #00B07D">无污染:0</span>
|
||||
<br />
|
||||
<span style="color: #2b7fd3">良好:(4 , 4.5]</span>
|
||||
<span style="color: #3399ff">轻微污染:(0 , 100]</span>
|
||||
<br />
|
||||
<span style="color: #ffcc33">合格:(3 , 4]</span>
|
||||
<span style="color: #ffcc33">轻度污染:(100 , 1000]</span>
|
||||
<br />
|
||||
<span style="color: #97017e">较差:(2 , 3]</span>
|
||||
<span style="color: #ff9900">中度污染:(1000 , 10000]</span>
|
||||
<br />
|
||||
<span style="color: #A52a2a">极差:[1 , 2]</span>
|
||||
<span style="color: #A52a2a">重度污染:(10000</span>
|
||||
</div>
|
||||
</el-popover>
|
||||
</span>
|
||||
@@ -53,7 +54,6 @@
|
||||
}"
|
||||
>
|
||||
{{ assessList.score == 3.14159 ? '/' : assessList.score }}
|
||||
<!-- {{ assessList.level }} -->
|
||||
</span>
|
||||
</div>
|
||||
<div class="evaluate">
|
||||
@@ -318,7 +318,7 @@ const options = ref([
|
||||
|
||||
])
|
||||
const technology: any = ref({})
|
||||
const harmonicType = ref('0')
|
||||
const harmonicType = ref('6')
|
||||
const transientNum = ref([0, 0])
|
||||
const options1: any = dictData.getBasicData('Event_Statis').filter(item => {
|
||||
if (item.code == 'Voltage_Dip' || item.code == 'Voltage_Rise' || item.code == 'Short_Interruptions') {
|
||||
|
||||
@@ -10,15 +10,19 @@
|
||||
<div class="boxSteps">
|
||||
<el-steps>
|
||||
<template v-for="(item, i) in Voltage">
|
||||
<el-step :class="active == i ? 'highlight' : ''" :title="item.name"
|
||||
@click="handleClick(i)"></el-step>
|
||||
<el-step
|
||||
:class="active == i ? 'highlight' : ''"
|
||||
:title="item.name"
|
||||
@click="handleClick(i)"
|
||||
></el-step>
|
||||
</template>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div v-for="(item, i) in evaluationData" class="evaluationData">
|
||||
<el-row style="width: 100%">
|
||||
<el-col :span="12" style="display: flex">
|
||||
<img :src="url[i]" />
|
||||
<!-- <img :src="url[i]" /> -->
|
||||
<span :class="`iconfont ${url[i]} icoColor`"></span>
|
||||
<span>{{ item.targetName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12" style="display: flex">
|
||||
@@ -66,11 +70,11 @@ const Voltage: any = dictData.getBasicData('Dev_Voltage_Stand').filter(item => {
|
||||
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
const url: any = [
|
||||
new URL(`@/assets/img/PLPC.png`, import.meta.url),
|
||||
new URL(`@/assets/img/DYPC.png`, import.meta.url),
|
||||
new URL(`@/assets/img/JBL.png`, import.meta.url),
|
||||
new URL(`@/assets/img/SXDY.png`, import.meta.url),
|
||||
new URL(`@/assets/img/SB.png`, import.meta.url)
|
||||
'icon-frequency',
|
||||
'icon-dianya',
|
||||
'icon-dianyazongxiebojibianshuai',
|
||||
'icon-sanxiangdianyafuzhibupingheng',
|
||||
'icon-a-253_ipower'
|
||||
]
|
||||
const tableData: any = ref([])
|
||||
|
||||
@@ -199,6 +203,7 @@ const handleClick = (i: any) => {
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
:deep(.el-select) {
|
||||
min-width: 80px;
|
||||
}
|
||||
@@ -283,4 +288,9 @@ defineExpose({ open })
|
||||
// color: var(--el-color-primary) !important;
|
||||
// }
|
||||
}
|
||||
.icoColor {
|
||||
color: var(--el-color-primary);
|
||||
margin: 0 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
<div v-for="(item, i) in list" class="cardBox" :style="i == 1 ? 'flex:1.3' : ''">
|
||||
<div class="card">
|
||||
<span style="cursor: pointer" @click="GridDiagram(i)">{{ item.title }}:</span>
|
||||
<span :style="`color: ${item.color[0]}; cursor:pointer`"
|
||||
@click="LookMap(item.list[4].numOneList, item.list[4].numTwoList, 0)">
|
||||
<span
|
||||
:style="`color: ${item.color[0]}; cursor:pointer`"
|
||||
@click="LookMap(item.list[4].numOneList, item.list[4].numTwoList, 0)"
|
||||
>
|
||||
{{ item.list[4].numOne }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -23,8 +25,10 @@
|
||||
<!-- 监测规模 列表 -->
|
||||
<div>
|
||||
<div class="vcl mt5">
|
||||
<p v-for="(item, i) in vList"
|
||||
:style="i == 0 ? 'width: 60px' : i == 5 ? 'width: 32px' : 'flex:1'">
|
||||
<p
|
||||
v-for="(item, i) in vList"
|
||||
:style="i == 0 ? 'width: 60px' : i == 5 ? 'width: 32px' : 'flex:1'"
|
||||
>
|
||||
{{ item }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -57,10 +61,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 监测点指标统计 -->
|
||||
<!-- 资产性质 -->
|
||||
<div :style="`height:calc(${boxHeight.height} + 50px)`">
|
||||
<div class="title">
|
||||
<span>监测点指标统计</span>
|
||||
<span>资产性质</span>
|
||||
</div>
|
||||
<div style="display: flex" class="mt2">
|
||||
<img src="@/assets/img/FGX.png" />
|
||||
@@ -68,16 +72,19 @@
|
||||
<div :style="`height:calc(${boxHeight.height} + 20px);overflow-y: auto;`">
|
||||
<div v-for="item in countList">
|
||||
<div class="title mt5" style="font-weight: 500">
|
||||
<img src="@/assets/img/TJ.png" />
|
||||
{{ item.title }}
|
||||
<!-- <img src="@/assets/img/TJ.png" />
|
||||
{{ item.title }} -->
|
||||
</div>
|
||||
<div class="card-Box" :style="`height:calc((${boxHeight.height} - 50px )/ 3);`"
|
||||
v-for="val in item.children">
|
||||
<div
|
||||
class="card-Box mt10"
|
||||
:style="`height:calc((${boxHeight.height} - 20px )/ 2);`"
|
||||
v-for="val in item.children"
|
||||
>
|
||||
<div>
|
||||
<span class="line"></span>
|
||||
<span class="vol">{{ val.title }}</span>
|
||||
</div>
|
||||
<div class="num">
|
||||
<div class="num num1">
|
||||
<div @click="LookMap(val.numList, [], 0)">
|
||||
投运:
|
||||
<span>{{ val.num }}</span>
|
||||
@@ -88,29 +95,44 @@
|
||||
</div>
|
||||
<div>
|
||||
数据完整性:
|
||||
<span style="color: #2b7fd3; cursor: text">{{ val.integrityRate }}%</span>
|
||||
<span style="color: #2b7fd3; cursor: text">{{ val.integrityRate || 0 }}%</span>
|
||||
</div>
|
||||
<div>
|
||||
在线率:
|
||||
<span style="color: #2dcd28; cursor: text">{{ val.onLineRate || 0 }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 监测点指标统计 -->
|
||||
<!-- 资产性质 -->
|
||||
<div :style="`height:calc(${boxHeight.height} - 55px)`">
|
||||
<div class="title">
|
||||
<span>监测运行统计</span>
|
||||
<div class="titleNum">
|
||||
( 合格:
|
||||
<span class="mr10" style="color: #2dcd28" @click="LookMap(linList[0].lineListOne, [], 0)">
|
||||
{{ linList[0].lineNumOne || 0 }}
|
||||
</span>
|
||||
告警:
|
||||
<span style="color: #a52a2a" @click="LookMap(linList[0].lineListOne, [], 0)">
|
||||
{{ linList[0].lineNumTwo || 0 }}
|
||||
</span>
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex" class="mt2">
|
||||
<img src="@/assets/img/FGX.png" />
|
||||
</div>
|
||||
|
||||
<div :style="`height:calc(${boxHeight.height} - 100px);overflow-y: auto;`" class="BoxA mt10">
|
||||
<div class="card-Box" v-for="item in linList">
|
||||
<div>
|
||||
<span class="line"></span>
|
||||
<span class="vol">{{ item.title[0] }}</span>
|
||||
</div>
|
||||
<div class="num">
|
||||
<div class="card-Box" v-for="item in linList.slice(1)">
|
||||
<div class="num num2">
|
||||
<div style="text-align: left">
|
||||
<span class="line"></span>
|
||||
<i class="vol">{{ item.title[0] }}</i>
|
||||
</div>
|
||||
<div>
|
||||
{{ item.title[1] }}:
|
||||
<span style="color: #2dcd28" @click="LookMap(item.lineListOne, [], 0)">
|
||||
@@ -119,7 +141,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{{ item.title[2] }}:
|
||||
<span style="color: #A52a2a" @click="LookMap([], item.lineListTwo, 1)">
|
||||
<span style="color: #a52a2a" @click="LookMap([], item.lineListTwo, 1)">
|
||||
{{ item.lineNumTwo || 0 }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -129,8 +151,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<img class="imgL" :style="show ? 'transform: rotate(0deg);' : 'transform: rotate(180deg);'"
|
||||
@click="show = !show" src="@/assets/img/QH.png" />
|
||||
<img
|
||||
class="imgL"
|
||||
:style="show ? 'transform: rotate(0deg);' : 'transform: rotate(180deg);'"
|
||||
@click="show = !show"
|
||||
src="@/assets/img/QH.png"
|
||||
/>
|
||||
|
||||
<!-- 变电站详情 -->
|
||||
<stand ref="standRef" />
|
||||
@@ -282,15 +308,16 @@ const countList: any = ref([
|
||||
title: '电网侧监测点',
|
||||
num: 0,
|
||||
onLineNum: 0,
|
||||
integrityRate: 0
|
||||
integrityRate: 0,
|
||||
onLineRate: 0
|
||||
},
|
||||
{ title: '非电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0 }
|
||||
{ title: '非电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0, onLineRate: 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '上送网公司',
|
||||
children: [{ title: '电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0 }]
|
||||
}
|
||||
// {
|
||||
// title: '上送网公司',
|
||||
// children: [{ title: '电网侧监测点', num: 0, onLineNum: 0, integrityRate: 0 }]
|
||||
// }
|
||||
])
|
||||
const linList: any = ref([
|
||||
{
|
||||
@@ -307,7 +334,7 @@ const linList: any = ref([
|
||||
title: ['电能质量指标', '未超标', '超标']
|
||||
}
|
||||
])
|
||||
const vList = ['', '500kV', '220kV', '110kV', '35kV',]
|
||||
const vList = ['', '500kV', '220kV', '110kV', '35kV']
|
||||
const formRow: any = ref({})
|
||||
const height = mainHeight(30)
|
||||
const boxHeight = mainHeight(290, 2)
|
||||
@@ -364,11 +391,11 @@ const info = async (row: any) => {
|
||||
numOneList: []
|
||||
})
|
||||
})
|
||||
// 监测点指标统计
|
||||
// 资产性质
|
||||
getGridDiagramStatistics(form).then(res => {
|
||||
countList.value[0].children[0] = { title: '电网侧监测点', ...res.data.data[0] }
|
||||
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 => {
|
||||
@@ -392,7 +419,7 @@ const LookMap = (coutList: object, alarmList: object, key?: any) => {
|
||||
const GridDiagram = (k: any) => {
|
||||
emit('GridDiagram', k, 3)
|
||||
}
|
||||
onMounted(() => { })
|
||||
onMounted(() => {})
|
||||
defineExpose({ info, show })
|
||||
</script>
|
||||
|
||||
@@ -504,13 +531,13 @@ defineExpose({ info, show })
|
||||
// grid-template-rows: 1fr 1fr;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
justify-content: space-around;
|
||||
// align-items: center;
|
||||
margin: 0 5px 5px;
|
||||
padding: 10px;
|
||||
background-color: #edededc0;
|
||||
border-radius: 10px;
|
||||
min-height: 60px;
|
||||
min-height: 40px;
|
||||
max-height: 120px;
|
||||
|
||||
.line {
|
||||
@@ -536,12 +563,28 @@ defineExpose({ info, show })
|
||||
font-weight: 550;
|
||||
}
|
||||
}
|
||||
.num1 {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: auto auto;
|
||||
gap: 15px;
|
||||
div {
|
||||
display: flex;
|
||||
padding-left: 20px;
|
||||
span {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.num2 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr !important;
|
||||
}
|
||||
}
|
||||
|
||||
.BoxA {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: 1fr 1fr 1fr;
|
||||
|
||||
// grid-template-rows: 80px;
|
||||
.num {
|
||||
@@ -592,4 +635,13 @@ defineExpose({ info, show })
|
||||
:deep(.el-dialog__body) {
|
||||
max-height: none !important;
|
||||
}
|
||||
.titleNum {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
margin-left: 5px;
|
||||
span {
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user