Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21ac0611cd | ||
|
|
ff841cfa93 | ||
|
|
01cc29c8b2 | ||
|
|
a324f7afcf | ||
|
|
4272f7756e | ||
|
|
070e404bbb | ||
| ed60e2b7f3 | |||
| 7785d4f708 | |||
| 0c64711dd8 | |||
|
|
d85dba8bf8 | ||
|
|
56b8158f4a | ||
| 765507398e | |||
| 9224ea17b8 | |||
| dc08f7d1ac | |||
| 1652b5faf8 | |||
|
|
fae2a7d735 | ||
|
|
bf3a99cbf3 | ||
|
|
2e7c0b7f44 | ||
|
|
98e0f9de02 | ||
|
|
21756e05d4 | ||
|
|
abfdf29a38 | ||
|
|
120892808b | ||
|
|
0f5cb1d3c5 | ||
| dbaa42ff7e |
6
.env.LN
Normal file
6
.env.LN
Normal file
@@ -0,0 +1,6 @@
|
||||
# 辽宁嵌入
|
||||
NODE_ENV = LN
|
||||
VITE_NAME="LN"
|
||||
# 电网一张图 地图图层
|
||||
VITE_NARIMAP=null
|
||||
VITE_NRGISCOMMON=null
|
||||
6
.env.LNqr
Normal file
6
.env.LNqr
Normal file
@@ -0,0 +1,6 @@
|
||||
# 辽宁嵌入
|
||||
NODE_ENV = LNqr
|
||||
VITE_NAME="LNqr"
|
||||
# 电网一张图 地图图层
|
||||
VITE_NARIMAP=null
|
||||
VITE_NRGISCOMMON=null
|
||||
156
README.md
156
README.md
@@ -1,78 +1,78 @@
|
||||
#### 介绍
|
||||
|
||||
```
|
||||
Vue 3 + TypeScript + Vite这个模板可以帮助您开始使用Vue 3和TypeScript在Vite中进行开发。该模板使用了Vue 3的<script setup>单文件组件,请查看script setup文档了解更多信息。
|
||||
```
|
||||
|
||||
#### 安装依赖&运行项目
|
||||
|
||||
> node version:^18.17.0 || >=20.5.0"
|
||||
|
||||
```shell
|
||||
#项目使用pnpm包管理器
|
||||
npm i pnpm -g
|
||||
|
||||
#安装依赖
|
||||
pnpm i
|
||||
|
||||
#运行项目
|
||||
npm run dev
|
||||
|
||||
#冀北现场启动命令 区分是否加载现场电网一张图内网api
|
||||
npm run dev:jibei
|
||||
|
||||
#去除后台所有模块名 如除/xxxx-boot
|
||||
npm run dev:removeMode
|
||||
|
||||
|
||||
|
||||
#因海南和冀北技术监督不同 通过修改文件的方式来区分
|
||||
#海南打包 需要吧pqs目录下supervise_hn 文件夹改成supervise 原文件改成supervise_jb
|
||||
#冀北打包 需要吧pqs目录下supervise_jb 文件夹改成supervise 原文件改成supervise_hn
|
||||
```
|
||||
|
||||
#### 页面编写-示例
|
||||
|
||||
```
|
||||
基础页面写法请查看`src/template`下的readme.md
|
||||
```
|
||||
|
||||
#### 开发规范
|
||||
|
||||
> 初衷:养成合理的习惯,精力留在技术调研、业务开发中。
|
||||
>
|
||||
> 常见点如下描述,更多的规范待前端开发人员有时间后,慢慢丰富。
|
||||
|
||||
- 命名风格:所有的包(文件夹)、文件名以小驼峰的风格命名,比如 xxxAaa,禁止 XxxAaa 或者 xxx-aaa。
|
||||
- 命名语义:禁止中文命名或拼音,英文命名借用下工具,稍微准确一点,不要与实际业务相差太远。
|
||||
- 功能组件创建风格:以**功能名称**命名文件夹,每个功能下以**index.vue**作为该功能的组件入口。正确示例参考:/src/views/auth/menu/index.vue。
|
||||
|
||||

|
||||
|
||||
- todo...:待后续补充。
|
||||
|
||||
#### 开发助手
|
||||
|
||||
##### 1、表格系列
|
||||
|
||||
- 页面表格以及表格页面按钮的弹出等功能参考:/views/pqs/voltageSags/sagGovern/index.vue
|
||||
- 表格中需要替换数据:
|
||||
|
||||
```js
|
||||
// 通过formatter函数返回实际需要返回的值
|
||||
{
|
||||
title: '数据来源', field: 'dataSource', minWidth: '130',
|
||||
formatter: (row: any) => {
|
||||
return row.dataSource == 0 ? '离线导入' : '监测点同步'
|
||||
}
|
||||
}****
|
||||
```
|
||||
|
||||
##### 2、样式系列
|
||||
|
||||
- 获取当前主体的高度:import { mainHeight } from '@/utils/layout'
|
||||
- 弹框内输入框长度设置 1 行 1 个 class="form-one" 1 行 2 个 class="form-two"
|
||||
|
||||
#### 依赖变更记录
|
||||
|
||||
- 2024-04-25 新增 vform3,by 洪圣文,用于页面表单设计保存为 json,命令:pnpm i vform3-builds
|
||||
#### 介绍
|
||||
|
||||
```
|
||||
Vue 3 + TypeScript + Vite这个模板可以帮助您开始使用Vue 3和TypeScript在Vite中进行开发。该模板使用了Vue 3的<script setup>单文件组件,请查看script setup文档了解更多信息。
|
||||
```
|
||||
|
||||
#### 安装依赖&运行项目
|
||||
|
||||
> node version:^18.17.0 || >=20.5.0"
|
||||
|
||||
```shell
|
||||
#项目使用pnpm包管理器
|
||||
npm i pnpm -g
|
||||
|
||||
#安装依赖
|
||||
pnpm i
|
||||
|
||||
#运行项目
|
||||
npm run dev
|
||||
|
||||
#jb现场启动命令 区分是否加载现场电网一张图内网api
|
||||
npm run dev:jibei
|
||||
|
||||
#去除后台所有模块名 如除/xxxx-boot
|
||||
npm run dev:removeMode
|
||||
|
||||
|
||||
|
||||
#因海南和jb技术监督不同 通过修改文件的方式来区分
|
||||
#海南打包 需要吧pqs目录下supervise_hn 文件夹改成supervise 原文件改成supervise_jb
|
||||
#jb打包 需要吧pqs目录下supervise_jb 文件夹改成supervise 原文件改成supervise_hn
|
||||
```
|
||||
|
||||
#### 页面编写-示例
|
||||
|
||||
```
|
||||
基础页面写法请查看`src/template`下的readme.md
|
||||
```
|
||||
|
||||
#### 开发规范
|
||||
|
||||
> 初衷:养成合理的习惯,精力留在技术调研、业务开发中。
|
||||
>
|
||||
> 常见点如下描述,更多的规范待前端开发人员有时间后,慢慢丰富。
|
||||
|
||||
- 命名风格:所有的包(文件夹)、文件名以小驼峰的风格命名,比如 xxxAaa,禁止 XxxAaa 或者 xxx-aaa。
|
||||
- 命名语义:禁止中文命名或拼音,英文命名借用下工具,稍微准确一点,不要与实际业务相差太远。
|
||||
- 功能组件创建风格:以**功能名称**命名文件夹,每个功能下以**index.vue**作为该功能的组件入口。正确示例参考:/src/views/auth/menu/index.vue。
|
||||
|
||||

|
||||
|
||||
- todo...:待后续补充。
|
||||
|
||||
#### 开发助手
|
||||
|
||||
##### 1、表格系列
|
||||
|
||||
- 页面表格以及表格页面按钮的弹出等功能参考:/views/pqs/voltageSags/sagGovern/index.vue
|
||||
- 表格中需要替换数据:
|
||||
|
||||
```js
|
||||
// 通过formatter函数返回实际需要返回的值
|
||||
{
|
||||
title: '数据来源', field: 'dataSource', minWidth: '130',
|
||||
formatter: (row: any) => {
|
||||
return row.dataSource == 0 ? '离线导入' : '监测点同步'
|
||||
}
|
||||
}****
|
||||
```
|
||||
|
||||
##### 2、样式系列
|
||||
|
||||
- 获取当前主体的高度:import { mainHeight } from '@/utils/layout'
|
||||
- 弹框内输入框长度设置 1 行 1 个 class="form-one" 1 行 2 个 class="form-two"
|
||||
|
||||
#### 依赖变更记录
|
||||
|
||||
- 2024-04-25 新增 vform3,by 洪圣文,用于页面表单设计保存为 json,命令:pnpm i vform3-builds
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<script src="/static/luckysheet/plugin.js"></script>
|
||||
<script src="/static/luckysheet/luckysheet.umd.js"></script>
|
||||
|
||||
<!-- 冀北地图 -->
|
||||
<!-- jb地图 -->
|
||||
<!--引入样式文件-->
|
||||
<script src="%VITE_NARIMAP%"></script>
|
||||
<!-- <script src="%VITE_NRGISCOMMON%"></script> -->
|
||||
|
||||
@@ -8,11 +8,15 @@
|
||||
"dev:jibei": "vite --mode jibei",
|
||||
"dev:hainan": "vite --mode hainan",
|
||||
"dev:qujing": "vite --mode qujing",
|
||||
"dev:LN": "vite --mode LN",
|
||||
"dev:LNqr": "vite --mode LNqr",
|
||||
"dev:removeMode": "vite --mode removeMode",
|
||||
"build": "vite build --mode dev",
|
||||
"build:jibei": "vite build --mode jibei",
|
||||
"build:hainan": "vite build --mode hainan",
|
||||
"build:qujing": "vite build --mode qujing",
|
||||
"build:LN": "vite build --mode LN",
|
||||
"build:LNqr": "vite build --mode LNqr",
|
||||
"build:removeMode": "vite build --mode removeMode",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
|
||||
@@ -4747,10 +4747,11 @@ window.BMAP_AUTHENTIC_KEY = ''
|
||||
c.Nm
|
||||
? c.Nm.sa(b)
|
||||
: ((c.Nm = new U(b, {
|
||||
icon: new qc(G.qa + 'blank.gif', {
|
||||
width: 1,
|
||||
height: 1
|
||||
}),
|
||||
// icon: new qc(G.qa + 'blank.gif', {
|
||||
// width: 1,
|
||||
// height: 1
|
||||
// }),
|
||||
icon: '',
|
||||
offset: new O(0, 0),
|
||||
clickable: t
|
||||
})),
|
||||
@@ -5886,7 +5887,7 @@ window.BMAP_AUTHENTIC_KEY = ''
|
||||
Qc.prototype.co = function () {
|
||||
this.Gb.src =
|
||||
0 < z.ca.ia && 6 >= z.ca.ia && this.GJ
|
||||
? G.qa + 'blank.gif'
|
||||
? '' //G.qa + 'blank.gif'
|
||||
: '' !== this.src && this.Gb.src == this.src
|
||||
? this.src + '&t = ' + Date.now()
|
||||
: this.src
|
||||
|
||||
16
src/App.vue
16
src/App.vue
@@ -9,14 +9,20 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import useSetTheme from '@/utils/setTheme'
|
||||
import { onMounted } from 'vue'
|
||||
useSetTheme()
|
||||
onMounted(async () => {
|
||||
const fetchMqttUrl = async () => {
|
||||
const response = await fetch('/')
|
||||
const WebSocketUrl:any = response.headers.get('X-WebSocket-Url')
|
||||
const WebSocketUrl2:any = response.headers.get('X-WebSocket-Url2')
|
||||
const MqttUrl:any = response.headers.get('X-MqttUrl-Url')
|
||||
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
||||
const WebSocketUrl: any = response.headers.get('X-WebSocket-Url')
|
||||
const WebSocketUrl2: any = response.headers.get('X-WebSocket-Url2')
|
||||
const WebSocketUrl3: any = response.headers.get('X-WebSocket-Url3')
|
||||
const MqttUrl: any = response.headers.get('X-MqttUrl-Url')
|
||||
localStorage.setItem('WebSocketUrl', WebSocketUrl)
|
||||
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
||||
localStorage.setItem('WebSocketUrl3', WebSocketUrl3)
|
||||
localStorage.setItem('MqttUrl', MqttUrl)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchMqttUrl()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ import request from '@/utils/request'
|
||||
export function getSubLineGiveAnAlarm(data: any) {
|
||||
return request({ url: '/harmonic-boot/gridDiagram/getSubLineGiveAnAlarm', method: 'post', data })
|
||||
}
|
||||
|
||||
export function getAreaObjAlarm(data: any) {
|
||||
return request({ url: '/harmonic-boot/gridDiagram/getAreaObjAlarm', method: 'post', data })
|
||||
}
|
||||
// 变电站详细列表
|
||||
export function getPollutionAlarmPageData(data: any) {
|
||||
return request({ url: '/harmonic-boot/gridDiagram/getPollutionAlarmPageData', method: 'post', data })
|
||||
|
||||
@@ -1,215 +1,250 @@
|
||||
import request from '@/utils/request'
|
||||
import { LoginData } from '@/api/types'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { sm3Digest } from '@/assets/commjs/sm3.js'
|
||||
import { sm2, encrypt } from '@/assets/commjs/sm2.js'
|
||||
|
||||
// 获取公钥
|
||||
export function gongkey(params?: any) {
|
||||
if (!params) {
|
||||
const adminInfo = useAdminInfo()
|
||||
params = {
|
||||
loginName: encrypt(adminInfo.$state.loginName)
|
||||
}
|
||||
}
|
||||
return request({
|
||||
url: '/user-boot/user/generateSm2Key',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export async function pwdSm3(pwd: any, loginName?: string) {
|
||||
let publicKey = await gongkey(
|
||||
loginName
|
||||
? {
|
||||
loginName: encrypt(loginName)
|
||||
}
|
||||
: false
|
||||
)
|
||||
let sm3Pwd = sm3Digest(pwd) //SM3加密
|
||||
return sm2(sm3Pwd + '|' + pwd, publicKey.data, 0)
|
||||
}
|
||||
|
||||
//登录获取token
|
||||
export async function login(params: any) {
|
||||
if (params.refresh_token == undefined) {
|
||||
params.password = await pwdSm3(params.password, params.username)
|
||||
}
|
||||
params.username = encrypt(params.username)
|
||||
return request({
|
||||
url: '/pqs-auth/oauth/token',
|
||||
method: 'post',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
//获取用户信息
|
||||
export function getUserById() {
|
||||
const adminInfo = useAdminInfo()
|
||||
return request({
|
||||
url: '/user-boot/user/getUserById?id=' + adminInfo.userIndex,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新token
|
||||
// 导出一个名为refreshToken的函数,该函数返回一个Promise对象
|
||||
export function refreshToken(): Promise<any> {
|
||||
// 调用useAdminInfo函数获取管理员信息,并将其赋值给adminInfo变量
|
||||
const adminInfo = useAdminInfo()
|
||||
// 调用login函数,传入一个对象作为参数,该对象包含grant_type、refresh_token和username三个属性
|
||||
// grant_type设置为'refresh_token',表示使用刷新令牌的方式获取新的访问令牌
|
||||
// refresh_token使用adminInfo中的refresh_token属性
|
||||
// username使用adminInfo中的loginName属性
|
||||
// 返回login函数的调用结果,即一个Promise对象
|
||||
return login({
|
||||
grant_type: 'refresh_token',
|
||||
refresh_token: adminInfo.refresh_token,
|
||||
username: adminInfo.loginName
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取营销用户列表
|
||||
* @returns {AxiosPromise}
|
||||
*/
|
||||
export const getMarketList = () => {
|
||||
return request({
|
||||
url: '/user-boot/user/getMarketList',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function add(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export async function passwordConfirm(pwd: string) {
|
||||
return request({
|
||||
url: '/user-boot/user/passwordConfirm?password=' + (await pwdSm3(pwd)),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function deluser(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/delete',
|
||||
method: 'delete',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export function activateUser(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/activateUser',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export async function updatePassword(params: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/updatePassword',
|
||||
method: 'put',
|
||||
params: {
|
||||
id: params.id,
|
||||
newPassword: await pwdSm3(params.newPassword)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export async function updateFirstPassword(params: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/updateFirstPassword',
|
||||
method: 'put',
|
||||
data: {
|
||||
name: encrypt(params.name),
|
||||
password: await pwdSm3(params.password, params.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function checkUser(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/check',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function existMonitorDeptTree() {
|
||||
return request({
|
||||
url: '/user-boot/dept/existMonitorDeptTree',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
// 获取用户
|
||||
export function getUserByRoleType(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/getUserByRoleType?roleType=' + data,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取部门下所有用户
|
||||
export function listAllUserByDeptId(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/listAllUserByDeptId?deptId=' + data,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id获取所有用户信息
|
||||
export function getUserListByIds(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/getUserListByIds',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有用户不包括管理员
|
||||
*/
|
||||
export const getUserSimpleList = () => {
|
||||
return request({
|
||||
url: '/user-boot/user/simpleList',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有用户包括管理员
|
||||
*/
|
||||
export const getAllUserSimpleList = () => {
|
||||
return request({
|
||||
url: '/user-boot/user/getAllUserSimpleList',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
export const getSysConfig = () => {
|
||||
return request({
|
||||
url: '/system-boot/config/getSysConfig',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 驾驶舱组件配置
|
||||
export const componentTree = () => {
|
||||
return request({
|
||||
url: '/user-boot/component/componentTree',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
import { LoginData } from '@/api/types'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { sm3Digest } from '@/assets/commjs/sm3.js'
|
||||
import { sm2, encrypt } from '@/assets/commjs/sm2.js'
|
||||
|
||||
// 获取公钥
|
||||
export function gongkey(params?: any) {
|
||||
if (!params) {
|
||||
const adminInfo = useAdminInfo()
|
||||
params = {
|
||||
loginName: encrypt(adminInfo.$state.loginName)
|
||||
}
|
||||
}
|
||||
return request({
|
||||
url: '/user-boot/user/generateSm2Key',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export async function pwdSm3(pwd: any, loginName?: string) {
|
||||
let publicKey = await gongkey(
|
||||
loginName
|
||||
? {
|
||||
loginName: encrypt(loginName)
|
||||
}
|
||||
: false
|
||||
)
|
||||
let sm3Pwd = sm3Digest(pwd) //SM3加密
|
||||
return sm2(sm3Pwd + '|' + pwd, publicKey.data, 0)
|
||||
}
|
||||
|
||||
//登录获取token
|
||||
export async function login(params: any) {
|
||||
if (params.refresh_token == undefined) {
|
||||
params.password = await pwdSm3(params.password, params.username)
|
||||
}
|
||||
params.username = encrypt(params.username)
|
||||
return request({
|
||||
url: '/pqs-auth/oauth/token',
|
||||
method: 'post',
|
||||
params
|
||||
})
|
||||
}
|
||||
//辽宁嵌入登录获取token
|
||||
export async function loginLNqr(data: any) {
|
||||
return request({
|
||||
url: '/pqs-auth/oauth/lnLogin',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export async function lnRefreshToken(data: any) {
|
||||
return request({
|
||||
url: '/pqs-auth/oauth/lnRefreshToken',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export async function logout() {
|
||||
return request({
|
||||
url: '/pqs-auth/oauth/logout',
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//获取用户信息
|
||||
export function getUserById() {
|
||||
const adminInfo = useAdminInfo()
|
||||
return request({
|
||||
url: '/user-boot/user/getUserById?id=' + adminInfo.userIndex,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 刷新token
|
||||
// 导出一个名为refreshToken的函数,该函数返回一个Promise对象
|
||||
export function refreshToken(): Promise<any> {
|
||||
// 调用useAdminInfo函数获取管理员信息,并将其赋值给adminInfo变量
|
||||
const adminInfo = useAdminInfo()
|
||||
// 调用login函数,传入一个对象作为参数,该对象包含grant_type、refresh_token和username三个属性
|
||||
// grant_type设置为'refresh_token',表示使用刷新令牌的方式获取新的访问令牌
|
||||
// refresh_token使用adminInfo中的refresh_token属性
|
||||
// username使用adminInfo中的loginName属性
|
||||
// 返回login函数的调用结果,即一个Promise对象
|
||||
return login({
|
||||
grant_type: 'refresh_token',
|
||||
refresh_token: adminInfo.refresh_token,
|
||||
username: adminInfo.loginName
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function lnRefreshTokenTo(): Promise<any> {
|
||||
// 调用useAdminInfo函数获取管理员信息,并将其赋值给adminInfo变量
|
||||
const adminInfo = useAdminInfo()
|
||||
return lnRefreshToken({
|
||||
refreshToken: adminInfo.refresh_token,
|
||||
clientId: "njcn",
|
||||
clientSecret:"njcnpqs"
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取营销用户列表
|
||||
* @returns {AxiosPromise}
|
||||
*/
|
||||
export const getMarketList = () => {
|
||||
return request({
|
||||
url: '/user-boot/user/getMarketList',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function add(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export async function passwordConfirm(pwd: string) {
|
||||
return request({
|
||||
url: '/user-boot/user/passwordConfirm?password=' + (await pwdSm3(pwd)),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function deluser(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/delete',
|
||||
method: 'delete',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export function activateUser(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/activateUser',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export async function updatePassword(params: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/updatePassword',
|
||||
method: 'put',
|
||||
params: {
|
||||
id: params.id,
|
||||
newPassword: await pwdSm3(params.newPassword)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export async function updateFirstPassword(params: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/updateFirstPassword',
|
||||
method: 'put',
|
||||
data: {
|
||||
name: encrypt(params.name),
|
||||
password: await pwdSm3(params.password, params.name)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function checkUser(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/check',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function existMonitorDeptTree() {
|
||||
return request({
|
||||
url: '/user-boot/dept/existMonitorDeptTree',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
// 获取用户
|
||||
export function getUserByRoleType(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/getUserByRoleType?roleType=' + data,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取部门下所有用户
|
||||
export function listAllUserByDeptId(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/listAllUserByDeptId?deptId=' + data,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id获取所有用户信息
|
||||
export function getUserListByIds(data: any) {
|
||||
return request({
|
||||
url: '/user-boot/user/getUserListByIds',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有用户不包括管理员
|
||||
*/
|
||||
export const getUserSimpleList = () => {
|
||||
return request({
|
||||
url: '/user-boot/user/simpleList',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有用户包括管理员
|
||||
*/
|
||||
export const getAllUserSimpleList = () => {
|
||||
return request({
|
||||
url: '/user-boot/user/getAllUserSimpleList',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
export const getSysConfig = () => {
|
||||
return request({
|
||||
url: '/system-boot/config/getSysConfig',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 驾驶舱组件配置
|
||||
export const componentTree = () => {
|
||||
return request({
|
||||
url: '/user-boot/component/componentTree',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
BIN
src/assets/imgs/m0.png
Normal file
BIN
src/assets/imgs/m0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/assets/imgs/m1.png
Normal file
BIN
src/assets/imgs/m1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/assets/imgs/m2.png
Normal file
BIN
src/assets/imgs/m2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src/assets/imgs/m3.png
Normal file
BIN
src/assets/imgs/m3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/imgs/m4.png
Normal file
BIN
src/assets/imgs/m4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
@@ -30,7 +30,7 @@ import { downloadFile } from '@/api/system-boot/file'
|
||||
import { previewFile } from '@/utils/fileDownLoad'
|
||||
|
||||
const { push, options, currentRoute } = useRouter()
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const VITE_FLAG = false//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({})
|
||||
|
||||
@@ -126,7 +126,8 @@ const prop = defineProps({
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: [String, Number] },
|
||||
timeValue: { type: Object }
|
||||
timeValue: { type: Object },
|
||||
searchKey: { type: [String, Number] }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
@@ -347,22 +348,22 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
() => prop.searchKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue,
|
||||
// watch(
|
||||
// () => prop.timeValue,
|
||||
|
||||
val => {
|
||||
tableStore.index()
|
||||
},
|
||||
// val => {
|
||||
// tableStore.index()
|
||||
// },
|
||||
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
// {
|
||||
// deep: true
|
||||
// }
|
||||
// )
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
|
||||
@@ -122,7 +122,8 @@ const prop = defineProps({
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: [String, Number] },
|
||||
timeValue: { type: Object }
|
||||
timeValue: { type: Object },
|
||||
searchKey: { type: [String, Number] }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
@@ -183,7 +184,7 @@ const tableStore: any = new TableStore({
|
||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||
return k.citTotalNum != 0
|
||||
} else {
|
||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||
return !k.citName.includes('上送')
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -329,22 +330,22 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
() => prop.searchKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue,
|
||||
// watch(
|
||||
// () => prop.timeValue,
|
||||
|
||||
val => {
|
||||
tableStore.index()
|
||||
},
|
||||
// val => {
|
||||
// tableStore.index()
|
||||
// },
|
||||
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
// {
|
||||
// deep: true
|
||||
// }
|
||||
// )
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
v-if="fullscreen"
|
||||
></TableHeader>
|
||||
>
|
||||
</TableHeader>
|
||||
<div
|
||||
class="monitoringPoints"
|
||||
:style="{
|
||||
@@ -120,7 +121,8 @@ const prop = defineProps({
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: [String, Number] },
|
||||
timeValue: { type: Object }
|
||||
timeValue: { type: Object },
|
||||
searchKey: { type: [String, Number] }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
@@ -181,7 +183,7 @@ const tableStore: any = new TableStore({
|
||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||
return k.citTotalNum != 0
|
||||
} else {
|
||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||
return !k.citName.includes('上送')
|
||||
}
|
||||
})
|
||||
|
||||
@@ -328,22 +330,22 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
() => prop.searchKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue,
|
||||
// watch(
|
||||
// () => prop.timeValue,
|
||||
|
||||
val => {
|
||||
tableStore.index()
|
||||
},
|
||||
// val => {
|
||||
// tableStore.index()
|
||||
// },
|
||||
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
// {
|
||||
// deep: true
|
||||
// }
|
||||
// )
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
|
||||
@@ -150,7 +150,8 @@ const prop = defineProps({
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: [String, Number] },
|
||||
timeValue: { type: Object }
|
||||
timeValue: { type: Object },
|
||||
searchKey: { type: [String, Number] }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
@@ -233,7 +234,7 @@ const tableStore: any = new TableStore({
|
||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||
return k.count != 0
|
||||
} else {
|
||||
return k.name != '上送国网' && k.name != '非上送国网'
|
||||
return !k.name.includes('上送')
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -246,22 +247,28 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
() => prop.searchKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue,
|
||||
// watch(
|
||||
// () => prop.timeKey,
|
||||
// val => {
|
||||
// tableStore.index()
|
||||
// }
|
||||
// )
|
||||
// watch(
|
||||
// () => prop.timeValue,
|
||||
|
||||
val => {
|
||||
tableStore.index()
|
||||
},
|
||||
// val => {
|
||||
// tableStore.index()
|
||||
// },
|
||||
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
// {
|
||||
// deep: true
|
||||
// }
|
||||
// )
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/assets/font/iconfont.css';
|
||||
|
||||
322
src/components/echarts/rmsWorker.js
Normal file
322
src/components/echarts/rmsWorker.js
Normal file
@@ -0,0 +1,322 @@
|
||||
// 辅助函数
|
||||
const getMax = (temp, tempA, tempB, tempC) => {
|
||||
temp = temp > tempA ? temp : tempA
|
||||
temp = temp > tempB ? temp : tempB
|
||||
if (tempC !== undefined) {
|
||||
temp = temp > tempC ? temp : tempC
|
||||
}
|
||||
return temp
|
||||
}
|
||||
|
||||
const getMaxTwo = (temp, tempA, tempB) => {
|
||||
temp = temp > tempA ? temp : tempA
|
||||
temp = temp > tempB ? temp : tempB
|
||||
return temp
|
||||
}
|
||||
|
||||
const getMin = (temp, tempA, tempB, tempC) => {
|
||||
temp = temp < tempA ? temp : tempA
|
||||
temp = temp < tempB ? temp : tempB
|
||||
if (tempC !== undefined) {
|
||||
temp = temp < tempC ? temp : tempC
|
||||
}
|
||||
return temp
|
||||
}
|
||||
|
||||
const getMinOpen = (temp, tempA, tempB) => {
|
||||
temp = temp < tempA ? temp : tempA
|
||||
temp = temp < tempB ? temp : tempB
|
||||
return temp
|
||||
}
|
||||
|
||||
// 数据处理函数
|
||||
const fliteWaveData = (wp, step, iphasicValue, isOpen) => {
|
||||
const rmsData = wp.listRmsData
|
||||
const pt = Number(wp.pt) / 1000
|
||||
const ct = Number(wp.ct)
|
||||
const titleList = wp.waveTitle
|
||||
let xishu = pt
|
||||
let aTitle = '',
|
||||
bTitle = '',
|
||||
cTitle = '',
|
||||
unit = '电压'
|
||||
let rmsvFirstX = 0,
|
||||
rmsvFirstY = 0,
|
||||
rmsvSecondX = 0,
|
||||
rmsvSecondY = 0,
|
||||
firstZhou = 'a',
|
||||
secondeZhou = 'a'
|
||||
let ifmax = 0,
|
||||
ifmin = 0,
|
||||
ismax = 0,
|
||||
ismin = 0,
|
||||
rfmax = 0,
|
||||
rfmin = 0,
|
||||
rsmax = 0,
|
||||
rsmin = 0
|
||||
|
||||
const shunshiFA = []
|
||||
const shunshiFB = []
|
||||
const shunshiFC = []
|
||||
const shunshiSA = []
|
||||
const shunshiSB = []
|
||||
const shunshiSC = []
|
||||
const rmsFA = []
|
||||
const rmsFB = []
|
||||
const rmsFC = []
|
||||
const rmsSA = []
|
||||
const rmsSB = []
|
||||
const rmsSC = []
|
||||
|
||||
if (titleList[iphasicValue * step + 1]?.substring(0, 1) !== 'U') {
|
||||
xishu = ct
|
||||
unit = '电流'
|
||||
}
|
||||
|
||||
for (let i = 1; i <= iphasicValue; i++) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
aTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 2:
|
||||
bTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 3:
|
||||
cTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (rmsData[0] && rmsData[0][iphasicValue * step + 1] !== undefined) {
|
||||
rfmax = rmsData[0][iphasicValue * step + 1] * xishu
|
||||
rfmin = rmsData[0][iphasicValue * step + 1] * xishu
|
||||
rmsvFirstY = rmsData[0][iphasicValue * step + 1] * xishu
|
||||
rmsvFirstX = rmsData[0][0]
|
||||
rsmax = rmsData[0][iphasicValue * step + 1]
|
||||
rsmin = rmsData[0][iphasicValue * step + 1]
|
||||
rmsvSecondY = rmsData[0][iphasicValue * step + 1]
|
||||
rmsvSecondX = rmsData[0][0]
|
||||
}
|
||||
|
||||
for (let rms = 0; rms < rmsData.length; rms++) {
|
||||
if (!rmsData[rms] || rmsData[rms][iphasicValue * step + 1] === undefined) {
|
||||
break
|
||||
}
|
||||
|
||||
switch (iphasicValue) {
|
||||
case 1:
|
||||
const rmsFirstA = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||
rmsFA.push([rmsData[rms][0], rmsFirstA])
|
||||
rfmax = rfmax > rmsFirstA ? rfmax : rmsFirstA
|
||||
rfmin = rfmin < rmsFirstA ? rfmin : rmsFirstA
|
||||
if (rfmin < rmsvFirstY) {
|
||||
rmsvFirstY = rfmin
|
||||
firstZhou = 'a'
|
||||
rmsvFirstX = rmsData[rms][0]
|
||||
}
|
||||
|
||||
const rmsSecondA = rmsData[rms][iphasicValue * step + 1]
|
||||
rmsSA.push([rmsData[rms][0], rmsSecondA])
|
||||
rsmax = rsmax > rmsSecondA ? rsmax : rmsSecondA
|
||||
rsmin = rsmin < rmsSecondA ? rsmin : rmsSecondA
|
||||
if (rsmin < rmsvSecondY) {
|
||||
rmsvSecondY = rsmin
|
||||
secondeZhou = 'a'
|
||||
rmsvSecondX = rmsData[rms][0]
|
||||
}
|
||||
break
|
||||
case 2:
|
||||
const rmsFirstA2 = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||
const rmsFirstB2 = rmsData[rms][iphasicValue * step + 2] * xishu
|
||||
rmsFA.push([rmsData[rms][0], rmsFirstA2])
|
||||
rmsFB.push([rmsData[rms][0], rmsFirstB2])
|
||||
rfmax = getMaxTwo(rfmax, rmsFirstA2, rmsFirstB2)
|
||||
rfmin = getMinOpen(rfmin, rmsFirstA2, rmsFirstB2)
|
||||
if (rfmin < rmsvFirstY) {
|
||||
rmsvFirstY = rfmin
|
||||
if (rfmin === rmsFirstA2) {
|
||||
firstZhou = 'a'
|
||||
} else if (rfmin === rmsFirstB2) {
|
||||
firstZhou = 'b'
|
||||
}
|
||||
rmsvFirstX = rmsData[rms][0]
|
||||
}
|
||||
|
||||
const rmsSecondA2 = rmsData[rms][iphasicValue * step + 1]
|
||||
const rmsSecondB2 = rmsData[rms][iphasicValue * step + 2]
|
||||
rmsSA.push([rmsData[rms][0], rmsSecondA2])
|
||||
rmsSB.push([rmsData[rms][0], rmsSecondB2])
|
||||
rsmax = getMaxTwo(rsmax, rmsSecondA2, rmsSecondB2)
|
||||
rsmin = getMinOpen(rsmin, rmsSecondA2, rmsSecondB2)
|
||||
if (rsmin < rmsvSecondY) {
|
||||
rmsvSecondY = rsmin
|
||||
if (rsmin === rmsSecondA2) {
|
||||
secondeZhou = 'a'
|
||||
} else if (rsmin === rmsSecondB2) {
|
||||
secondeZhou = 'b'
|
||||
}
|
||||
rmsvSecondX = rmsData[rms][0]
|
||||
}
|
||||
break
|
||||
case 3:
|
||||
const rmsFirstA3 = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||
const rmsFirstB3 = rmsData[rms][iphasicValue * step + 2] * xishu
|
||||
const rmsFirstC3 = rmsData[rms][iphasicValue * step + 3] * xishu
|
||||
rmsFA.push([rmsData[rms][0], rmsFirstA3])
|
||||
rmsFB.push([rmsData[rms][0], rmsFirstB3])
|
||||
rmsFC.push([rmsData[rms][0], rmsFirstC3])
|
||||
rfmax = getMax(rfmax, rmsFirstA3, rmsFirstB3, rmsFirstC3)
|
||||
rfmin = isOpen
|
||||
? getMinOpen(rfmin, rmsFirstA3, rmsFirstC3)
|
||||
: getMin(rfmin, rmsFirstA3, rmsFirstB3, rmsFirstC3)
|
||||
if (rfmin < rmsvFirstY) {
|
||||
rmsvFirstY = rfmin
|
||||
if (rfmin === rmsFirstA3) {
|
||||
firstZhou = 'a'
|
||||
} else if (rfmin === rmsFirstB3) {
|
||||
firstZhou = 'b'
|
||||
} else {
|
||||
firstZhou = 'c'
|
||||
}
|
||||
rmsvFirstX = rmsData[rms][0]
|
||||
}
|
||||
|
||||
const rmsSecondA3 = rmsData[rms][iphasicValue * step + 1]
|
||||
const rmsSecondB3 = rmsData[rms][iphasicValue * step + 2]
|
||||
const rmsSecondC3 = rmsData[rms][iphasicValue * step + 3]
|
||||
rmsSA.push([rmsData[rms][0], rmsSecondA3])
|
||||
rmsSB.push([rmsData[rms][0], rmsSecondB3])
|
||||
rmsSC.push([rmsData[rms][0], rmsSecondC3])
|
||||
rsmax = getMax(rsmax, rmsSecondA3, rmsSecondB3, rmsSecondC3)
|
||||
rsmin = isOpen
|
||||
? getMinOpen(rsmin, rmsSecondA3, rmsSecondC3)
|
||||
: getMin(rsmin, rmsSecondA3, rmsSecondB3, rmsSecondC3)
|
||||
if (rsmin < rmsvSecondY) {
|
||||
rmsvSecondY = rsmin
|
||||
if (rsmin === rmsSecondA3) {
|
||||
secondeZhou = 'a'
|
||||
} else if (rsmin === rmsSecondB3) {
|
||||
secondeZhou = 'b'
|
||||
} else {
|
||||
secondeZhou = 'c'
|
||||
}
|
||||
rmsvSecondX = rmsData[rms][0]
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const instantF = { max: ifmax, min: ifmin }
|
||||
const instantS = { max: ismax, min: ismin }
|
||||
const RMSF = { max: rfmax, min: rfmin }
|
||||
const RMSS = { max: rsmax, min: rsmin }
|
||||
const RMSFMinDetail = { rmsvFirstX, rmsvFirstY, firstZhou }
|
||||
const RMSSMinDetail = { rmsvSecondX, rmsvSecondY, secondeZhou }
|
||||
const shunshiF = { shunshiFA, shunshiFB, shunshiFC }
|
||||
const shunshiS = { shunshiSA, shunshiSB, shunshiSC }
|
||||
const RMSFWave = { rmsFA, rmsFB, rmsFC }
|
||||
const RMSSWave = { rmsSA, rmsSB, rmsSC }
|
||||
const title = { aTitle, bTitle, cTitle, unit }
|
||||
|
||||
return {
|
||||
instantF,
|
||||
instantS,
|
||||
RMSF,
|
||||
RMSS,
|
||||
RMSFMinDetail,
|
||||
RMSSMinDetail,
|
||||
shunshiF,
|
||||
shunshiS,
|
||||
RMSFWave,
|
||||
RMSSWave,
|
||||
title,
|
||||
unit
|
||||
}
|
||||
}
|
||||
|
||||
// 监听消息
|
||||
self.onmessage = function (e) {
|
||||
const { wp, isOpen, value, boxoList, requestId } = e.data
|
||||
|
||||
try {
|
||||
const iphasicValue = wp.iphasic || 1
|
||||
|
||||
const picCounts = (wp.waveTitle.length - 1) / iphasicValue
|
||||
const waveDatas = []
|
||||
|
||||
for (let i = 0; i < picCounts; i++) {
|
||||
const data = fliteWaveData(wp, i, iphasicValue, isOpen, boxoList)
|
||||
waveDatas.push(data)
|
||||
}
|
||||
// 处理标题
|
||||
let titles = ''
|
||||
if (boxoList.systemType == 'pms') {
|
||||
titles =
|
||||
'变电站名称:' +
|
||||
boxoList.powerStationName +
|
||||
' 监测点名称:' +
|
||||
boxoList.measurementPointName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'ZL') {
|
||||
titles =
|
||||
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||
' 监测点名称:' +
|
||||
boxoList.equipmentName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
boxoList.evtParamVVaDepth +
|
||||
'% 持续时间:' +
|
||||
boxoList.evtParamTm +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'YPT') {
|
||||
titles =
|
||||
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.persistTime +
|
||||
's'
|
||||
} else {
|
||||
titles =
|
||||
' 变电站名称:' +
|
||||
boxoList.subName +
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
}
|
||||
// 发送处理结果回主线程
|
||||
self.postMessage({
|
||||
requestId,
|
||||
titles: titles,
|
||||
success: true,
|
||||
waveDatas,
|
||||
time: wp.time,
|
||||
type: wp.waveType,
|
||||
severity: wp.yzd,
|
||||
iphasic: iphasicValue
|
||||
})
|
||||
} catch (error) {
|
||||
self.postMessage({
|
||||
requestId,
|
||||
success: false,
|
||||
error: error.message
|
||||
})
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
207
src/components/echarts/shuWorker.js
Normal file
207
src/components/echarts/shuWorker.js
Normal file
@@ -0,0 +1,207 @@
|
||||
// waveData.worker.js
|
||||
self.addEventListener('message', function (e) {
|
||||
const { wp, value, iphasic, isOpen, boxoList, requestId } = e.data
|
||||
|
||||
// 处理波形数据的函数
|
||||
const fliteWaveData = (wp, step) => {
|
||||
// 将原有的fliteWaveData函数实现复制到这里
|
||||
const shunData = wp.listWaveData
|
||||
const pt = Number(wp.pt) / 1000
|
||||
const ct = Number(wp.ct)
|
||||
const titleList = wp.waveTitle
|
||||
let xishu = pt
|
||||
let aTitle = '',
|
||||
bTitle = '',
|
||||
cTitle = '',
|
||||
unit = '电压'
|
||||
let ifmax = 0,
|
||||
ifmin = 0,
|
||||
ismax = 0,
|
||||
ismin = 0
|
||||
|
||||
const shunshiFA = []
|
||||
const shunshiFB = []
|
||||
const shunshiFC = []
|
||||
const shunshiSA = []
|
||||
const shunshiSB = []
|
||||
const shunshiSC = []
|
||||
|
||||
if (shunData.length > 0) {
|
||||
if (titleList[iphasic * step + 1]?.substring(0, 1) !== 'U') {
|
||||
xishu = ct
|
||||
unit = '电流'
|
||||
}
|
||||
|
||||
for (let i = 1; i <= iphasic; i++) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
aTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 2:
|
||||
bTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 3:
|
||||
cTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (shunData[0][iphasic * step + 1] !== undefined) {
|
||||
ifmax = shunData[0][iphasic * step + 1] * xishu
|
||||
ifmin = shunData[0][iphasic * step + 1] * xishu
|
||||
ismax = shunData[0][iphasic * step + 1]
|
||||
ismin = shunData[0][iphasic * step + 1]
|
||||
}
|
||||
|
||||
for (let shun = 0; shun < shunData.length; shun++) {
|
||||
if (shunData[shun][iphasic * step + 1] === undefined) {
|
||||
break
|
||||
}
|
||||
|
||||
switch (iphasic) {
|
||||
case 1:
|
||||
const shunFirstA = shunData[shun][iphasic * step + 1] * xishu
|
||||
shunshiFA.push([shunData[shun][0], shunFirstA])
|
||||
ifmax = Math.max(ifmax, shunFirstA)
|
||||
ifmin = Math.min(ifmin, shunFirstA)
|
||||
|
||||
const shunSecondA = shunData[shun][iphasic * step + 1]
|
||||
shunshiSA.push([shunData[shun][0], shunSecondA])
|
||||
ismax = Math.max(ismax, shunSecondA)
|
||||
ismin = Math.min(ismin, shunSecondA)
|
||||
break
|
||||
case 2:
|
||||
const shunFirstA2 = shunData[shun][iphasic * step + 1] * xishu
|
||||
const shunFirstB2 = shunData[shun][iphasic * step + 2] * xishu
|
||||
shunshiFA.push([shunData[shun][0], shunFirstA2])
|
||||
shunshiFB.push([shunData[shun][0], shunFirstB2])
|
||||
ifmax = Math.max(ifmax, shunFirstA2, shunFirstB2)
|
||||
ifmin = Math.min(ifmin, shunFirstA2, shunFirstB2)
|
||||
|
||||
const shunSecondA2 = shunData[shun][iphasic * step + 1]
|
||||
const shunSecondB2 = shunData[shun][iphasic * step + 2]
|
||||
shunshiSA.push([shunData[shun][0], shunSecondA2])
|
||||
shunshiSB.push([shunData[shun][0], shunSecondB2])
|
||||
ismax = Math.max(ismax, shunSecondA2, shunSecondB2)
|
||||
ismin = Math.min(ismin, shunSecondA2, shunSecondB2)
|
||||
break
|
||||
case 3:
|
||||
const shunFirstA3 = shunData[shun][iphasic * step + 1] * xishu
|
||||
const shunFirstB3 = shunData[shun][iphasic * step + 2] * xishu
|
||||
const shunFirstC3 = shunData[shun][iphasic * step + 3] * xishu
|
||||
shunshiFA.push([shunData[shun][0], shunFirstA3])
|
||||
shunshiFB.push([shunData[shun][0], shunFirstB3])
|
||||
shunshiFC.push([shunData[shun][0], shunFirstC3])
|
||||
ifmax = Math.max(ifmax, shunFirstA3, shunFirstB3, shunFirstC3)
|
||||
ifmin = isOpen
|
||||
? Math.min(ifmin, shunFirstA3, shunFirstC3)
|
||||
: Math.min(ifmin, shunFirstA3, shunFirstB3, shunFirstC3)
|
||||
|
||||
const shunSecondA3 = shunData[shun][iphasic * step + 1]
|
||||
const shunSecondB3 = shunData[shun][iphasic * step + 2]
|
||||
const shunSecondC3 = shunData[shun][iphasic * step + 3]
|
||||
shunshiSA.push([shunData[shun][0], shunSecondA3])
|
||||
shunshiSB.push([shunData[shun][0], shunSecondB3])
|
||||
shunshiSC.push([shunData[shun][0], shunSecondC3])
|
||||
ismax = Math.max(ismax, shunSecondA3, shunSecondB3, shunSecondC3)
|
||||
ismin = isOpen
|
||||
? Math.min(ismin, shunSecondA3, shunSecondC3)
|
||||
: Math.min(ismin, shunSecondA3, shunSecondB3, shunSecondC3)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const instantF = { max: ifmax, min: ifmin }
|
||||
const instantS = { max: ismax, min: ismin }
|
||||
const shunshiF = { shunshiFA, shunshiFB, shunshiFC }
|
||||
const shunshiS = { shunshiSA, shunshiSB, shunshiSC }
|
||||
const title = { aTitle, bTitle, cTitle, unit }
|
||||
|
||||
return { instantF, instantS, shunshiF, shunshiS, title, unit }
|
||||
}
|
||||
|
||||
// 处理标题
|
||||
let titles = ''
|
||||
if (boxoList.systemType == 'pms') {
|
||||
titles =
|
||||
'变电站名称:' +
|
||||
boxoList.powerStationName +
|
||||
' 监测点名称:' +
|
||||
boxoList.measurementPointName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'ZL') {
|
||||
titles =
|
||||
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||
' 监测点名称:' +
|
||||
boxoList.equipmentName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
boxoList.evtParamVVaDepth +
|
||||
'% 持续时间:' +
|
||||
boxoList.evtParamTm +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'YPT') {
|
||||
titles =
|
||||
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.persistTime +
|
||||
's'
|
||||
} else {
|
||||
titles =
|
||||
'变电站名称:' +
|
||||
boxoList.subName +
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
}
|
||||
|
||||
const iphasicValue = wp.iphasic || 1
|
||||
const picCounts = (wp.waveTitle.length - 1) / iphasicValue
|
||||
const waveDatas = []
|
||||
|
||||
for (let i = 0; i < picCounts; i++) {
|
||||
const data = fliteWaveData(wp, i)
|
||||
waveDatas.push(data)
|
||||
}
|
||||
|
||||
const time = wp.time
|
||||
const type = wp.waveType
|
||||
let severity = wp.yzd
|
||||
|
||||
if (severity < 0) {
|
||||
severity = '/'
|
||||
type = '/'
|
||||
}
|
||||
|
||||
// 将处理结果发送回主线程
|
||||
self.postMessage({
|
||||
requestId,
|
||||
success: true,
|
||||
waveDatas,
|
||||
time,
|
||||
type,
|
||||
severity,
|
||||
titles,
|
||||
iphasic: iphasicValue
|
||||
})
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
<div v-if="view2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<span style="font-size: 14px; line-height: 30px">值类型选择:</span>
|
||||
<!-- <span style="font-size: 14px; line-height: 30px">值类型选择:</span>
|
||||
<el-select
|
||||
style="min-width: 200px; width: 200px"
|
||||
@change="changeView"
|
||||
@@ -15,7 +15,11 @@
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<el-radio-group v-model.trim="value" @change="changeView">
|
||||
<el-radio-button label="一次值" :value="1" />
|
||||
<el-radio-button label="二次值" :value="2" />
|
||||
</el-radio-group>
|
||||
<!-- <el-button v-if="view2 && senior" class="ml10" type="primary" @click="AdvancedAnalytics">
|
||||
高级分析
|
||||
</el-button> -->
|
||||
@@ -24,37 +28,18 @@
|
||||
<el-button @click="backbxlb" icon="el-icon-Back" style="float: right">返回</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-loading="loading" style="height: calc(100vh - 190px)">
|
||||
<el-tabs v-if="view4" class="default-main" v-model="bxactiveName" @tab-click="bxhandleClick">
|
||||
<el-tab-pane
|
||||
label="瞬时波形"
|
||||
name="ssbx"
|
||||
class="boxbx pt10 pb10"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'"
|
||||
>
|
||||
<shushiboxi
|
||||
ref="shushiboxiRef"
|
||||
v-if="bxactiveName == 'ssbx' && showBoxi"
|
||||
:value="value"
|
||||
:parentHeight="parentHeight"
|
||||
:boxoList="boxoList"
|
||||
:wp="wp"
|
||||
></shushiboxi>
|
||||
<div v-loading="loading" style="height: calc(100vh - 190px)" class="mt10">
|
||||
<el-tabs v-if="view4" type="border-card" v-model="bxactiveName"
|
||||
@tab-click="bxhandleClick">
|
||||
<el-tab-pane label="瞬时波形" name="ssbx" class="boxbx pt10 pb10"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<shushiboxi ref="shushiboxiRef" v-if="bxactiveName == 'ssbx' && showBoxi" :value="value"
|
||||
:parentHeight="parentHeight" :boxoList="boxoList" :wp="wp"></shushiboxi>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
label="RMS波形"
|
||||
class="boxbx pt10 pb10"
|
||||
name="rmsbx"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'"
|
||||
>
|
||||
<rmsboxi
|
||||
ref="rmsboxiRef"
|
||||
v-if="bxactiveName == 'rmsbx' && showBoxi"
|
||||
:value="value"
|
||||
:parentHeight="parentHeight"
|
||||
:boxoList="boxoList"
|
||||
:wp="wp"
|
||||
></rmsboxi>
|
||||
<el-tab-pane label="RMS波形" class="boxbx pt10 pb10" name="rmsbx"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<rmsboxi ref="rmsboxiRef" v-if="bxactiveName == 'rmsbx' && showBoxi" :value="value"
|
||||
:parentHeight="parentHeight" :boxoList="boxoList" :wp="wp"></rmsboxi>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-empty v-else description="暂无数据" style="height: calc(100vh - 190px)" />
|
||||
@@ -100,7 +85,7 @@ const options = ref([
|
||||
}
|
||||
])
|
||||
const shushiboxiRef = ref()
|
||||
const bxecharts = ref(mainHeight(95).height as any)
|
||||
const bxecharts = ref(mainHeight(145).height as any)
|
||||
const view2 = ref(true)
|
||||
const boxoList: any = ref(null)
|
||||
const wp = ref(null)
|
||||
@@ -128,9 +113,6 @@ const open = async (row: any) => {
|
||||
})
|
||||
}
|
||||
const bxhandleClick = (tab: any) => {
|
||||
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
||||
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
|
||||
|
||||
loading.value = true
|
||||
if (tab.name == 'ssbx') {
|
||||
bxactiveName.value = 'ssbx'
|
||||
@@ -145,8 +127,7 @@ const bxhandleClick = (tab: any) => {
|
||||
const backbxlb = () => {
|
||||
boxoList.value = null
|
||||
wp.value = null
|
||||
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
||||
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
|
||||
|
||||
|
||||
emit('backbxlb')
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<template>
|
||||
<div style="width: 540px">
|
||||
<div :style="{ width: isMinuteData ? '750px' : '610px' }">
|
||||
<el-select v-model="interval" style="min-width: 90px; width: 90px; margin-right: 10px" @change="timeChange">
|
||||
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
|
||||
<el-date-picker
|
||||
v-model="timeValue"
|
||||
type="daterange"
|
||||
:type="pickerType"
|
||||
:disabled="disabledPicker"
|
||||
:disabled-date="isFutureDate"
|
||||
style="width: 220px; margin-right: 10px"
|
||||
:style="{ width: isMinuteData ? '360px' : '220px', marginRight: '10px' }"
|
||||
unlink-panels
|
||||
:clearable="false"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
:shortcuts="shortcuts"
|
||||
:start-placeholder="isMinuteData ? '开始时间' : '开始日期'"
|
||||
:end-placeholder="isMinuteData ? '结束时间' : '结束日期'"
|
||||
:value-format="pickerValueFormat"
|
||||
:shortcuts="isMinuteData ? undefined : shortcuts"
|
||||
/>
|
||||
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
|
||||
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
|
||||
@@ -26,18 +26,41 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { DArrowLeft, VideoPause, DArrowRight } from '@element-plus/icons-vue'
|
||||
import { ref, onMounted, nextTick, watch } from 'vue'
|
||||
import { ref, onMounted, computed, watch } from 'vue'
|
||||
|
||||
interface Props {
|
||||
nextFlag?: boolean
|
||||
theCurrentTime?: boolean
|
||||
isStatisticData?: number | string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
nextFlag: false,
|
||||
theCurrentTime: false
|
||||
theCurrentTime: false,
|
||||
isStatisticData: 1
|
||||
})
|
||||
|
||||
const isMinuteData = computed(() => Number(props.isStatisticData) === 0)
|
||||
const pickerType = computed(() => (isMinuteData.value ? 'datetimerange' : 'daterange'))
|
||||
const pickerValueFormat = computed(() => (isMinuteData.value ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'))
|
||||
|
||||
const toDatePart = (value: string) => (value?.includes(' ') ? value.split(' ')[0] : value)
|
||||
|
||||
const toMinuteStart = (date: string) => `${toDatePart(date)} 00:00:00`
|
||||
|
||||
const toMinuteEnd = (date: string) => `${toDatePart(date)} 23:59:59`
|
||||
|
||||
const normalizeRange = (start: string, end: string) => {
|
||||
if (!isMinuteData.value) {
|
||||
return [toDatePart(start), toDatePart(end)]
|
||||
}
|
||||
return [toMinuteStart(start), toMinuteEnd(end)]
|
||||
}
|
||||
|
||||
const setRangeValue = (start: string, end: string) => {
|
||||
timeValue.value = normalizeRange(start, end)
|
||||
}
|
||||
|
||||
const interval = ref(3)
|
||||
const timeFlag = ref(1)
|
||||
const count = ref(0)
|
||||
@@ -95,13 +118,13 @@ const timeChange = (e: number) => {
|
||||
if (e == 1) {
|
||||
disabledPicker.value = true
|
||||
|
||||
timeValue.value = [setTime(1), setTime()]
|
||||
setRangeValue(setTime(1), setTime())
|
||||
} else if (e == 2) {
|
||||
disabledPicker.value = true
|
||||
timeValue.value = [setTime(2), setTime()]
|
||||
setRangeValue(setTime(2), setTime())
|
||||
} else if (e == 3) {
|
||||
disabledPicker.value = true
|
||||
timeValue.value = [setTime(3), setTime()]
|
||||
setRangeValue(setTime(3), setTime())
|
||||
} else if (e == 4) {
|
||||
let year = parseInt(setTime().substring(0, 4))
|
||||
let month = parseInt(setTime().substring(5, 7))
|
||||
@@ -111,12 +134,12 @@ const timeChange = (e: number) => {
|
||||
var dayOfWeek = start.getDay() == 0 ? 7 : start.getDay() - 1 // 如果为周日,则置为7天
|
||||
|
||||
disabledPicker.value = true
|
||||
timeValue.value = [setTime(0, dayOfWeek), setTime(0, -6 + dayOfWeek)]
|
||||
setRangeValue(setTime(0, dayOfWeek), setTime(0, -6 + dayOfWeek))
|
||||
} else if (e == 5) {
|
||||
disabledPicker.value = false
|
||||
backDisabled.value = true
|
||||
preDisabled.value = props.nextFlag ? false : true
|
||||
timeValue.value = [setTime(), setTime()]
|
||||
setRangeValue(setTime(), setTime())
|
||||
}
|
||||
if (e == 1 || e == 2) {
|
||||
timeFlag.value = 0
|
||||
@@ -186,7 +209,7 @@ const preClick = () => {
|
||||
startTime = year + '-01-01'
|
||||
endTime = year + '-12-31'
|
||||
}
|
||||
timeValue.value = [startTime, endTime]
|
||||
setRangeValue(startTime, endTime)
|
||||
|
||||
// 判断向后键的状态
|
||||
// var temp = NowgetEndTime()
|
||||
@@ -415,16 +438,27 @@ const next = () => {
|
||||
}
|
||||
if (!props.nextFlag) {
|
||||
if (
|
||||
new Date(endTime + ' 00:00:00').getTime() >=
|
||||
new Date(toDatePart(endTime) + ' 00:00:00').getTime() >=
|
||||
new Date(window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd ') + ' 00:00:00').getTime()
|
||||
) {
|
||||
preDisabled.value = props.nextFlag ? false : true
|
||||
}
|
||||
}
|
||||
|
||||
timeValue.value = [startTime, endTime]
|
||||
setRangeValue(startTime, endTime)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.isStatisticData,
|
||||
() => {
|
||||
if (timeValue.value?.length === 2) {
|
||||
setRangeValue(timeValue.value[0], timeValue.value[1])
|
||||
} else {
|
||||
timeChange(interval.value)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const setTime = (flag = 0, e = 0) => {
|
||||
let dd = window.XEUtils.toDateString(new Date().getTime() - e * 3600 * 1000 * 24, 'dd')
|
||||
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
<template>
|
||||
<div ref="tableHeader" class="cn-table-header">
|
||||
<div class="table-header ba-scroll-style">
|
||||
<el-form
|
||||
style="flex: 1; height: 32px; display: flex; flex-wrap: wrap"
|
||||
ref="headerForm"
|
||||
@submit.prevent=""
|
||||
@keyup.enter="onComSearch"
|
||||
label-position="left"
|
||||
:inline="true"
|
||||
>
|
||||
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
||||
<el-form style="flex: 1; height: 32px; display: flex; flex-wrap: wrap" ref="headerForm" @submit.prevent=""
|
||||
@keyup.enter="onComSearch" label-position="left" :inline="true">
|
||||
<el-form-item v-if="datePicker" style="grid-column: span 2; "
|
||||
:style="{ maxWidth: isStatisticData == 0 ? '750px' : '610px' }">
|
||||
<template #label>
|
||||
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="统计时间" />
|
||||
<span v-else>{{ dateLabel }}</span>
|
||||
</template>
|
||||
<DatePicker
|
||||
ref="datePickerRef"
|
||||
v-if="timeAll"
|
||||
:nextFlag="nextFlag"
|
||||
:theCurrentTime="theCurrentTime"
|
||||
></DatePicker>
|
||||
<DatePicker ref="datePickerRef" v-if="timeAll" :nextFlag="nextFlag" :theCurrentTime="theCurrentTime"
|
||||
:isStatisticData="isStatisticData"></DatePicker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="区域" v-if="area">
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange"
|
||||
style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<slot name="select"></slot>
|
||||
</el-form>
|
||||
@@ -32,43 +24,24 @@
|
||||
<Icon size="14" name="el-icon-ArrowUp" style="color: #fff" v-if="showSelect" />
|
||||
<Icon size="14" name="el-icon-ArrowDown" style="color: #fff" v-else />
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="onComSearch"
|
||||
v-if="showSearch"
|
||||
:loading="tableStore.table.loading"
|
||||
type="primary"
|
||||
:icon="Search"
|
||||
>
|
||||
<el-button @click="onComSearch" v-if="showSearch" :loading="tableStore.table.loading" type="primary"
|
||||
:icon="Search">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="onResetForm"
|
||||
v-if="showSearch && showReset"
|
||||
:loading="tableStore.table.loading"
|
||||
:icon="RefreshLeft"
|
||||
>
|
||||
<el-button @click="onResetForm" v-if="showSearch && showReset" :loading="tableStore.table.loading"
|
||||
:icon="RefreshLeft">
|
||||
重置
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="onExport"
|
||||
v-if="showExport"
|
||||
:loading="tableStore.table.exportLoading"
|
||||
type="primary"
|
||||
icon="el-icon-Download"
|
||||
>
|
||||
<el-button @click="onExport" v-if="showExport" :loading="tableStore.table.exportLoading" type="primary"
|
||||
icon="el-icon-Download">
|
||||
导出
|
||||
</el-button>
|
||||
</template>
|
||||
<slot name="operation"></slot>
|
||||
</div>
|
||||
<el-form
|
||||
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
||||
ref="headerFormSecond"
|
||||
@submit.prevent=""
|
||||
@keyup.enter="onComSearch"
|
||||
label-position="left"
|
||||
:inline="true"
|
||||
></el-form>
|
||||
<el-form :style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
||||
ref="headerFormSecond" @submit.prevent="" @keyup.enter="onComSearch" label-position="left"
|
||||
:inline="true"></el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -81,7 +54,7 @@ import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||
import { defineProps } from 'vue'
|
||||
const emit = defineEmits(['selectChange','areaChange'])
|
||||
const emit = defineEmits(['selectChange', 'areaChange'])
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const tableHeader = ref()
|
||||
const datePickerRef = ref()
|
||||
@@ -100,6 +73,7 @@ interface Props {
|
||||
showExport?: boolean //导出控制
|
||||
showTimeAll?: boolean //控制时间是否显示
|
||||
dateLabel?: string //设置时间名称
|
||||
isStatisticData?: number | string // 0分钟数据 1统计数据
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -111,7 +85,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
showReset: true,
|
||||
showExport: false,
|
||||
showTimeAll: false,
|
||||
dateLabel: '统计日期'
|
||||
dateLabel: '统计日期',
|
||||
isStatisticData: 1
|
||||
})
|
||||
// 动态计算table高度
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
@@ -132,9 +107,8 @@ const headerFormSecondStyleClose = {
|
||||
padding: '0'
|
||||
}
|
||||
|
||||
const onAreaChange = (data) => {
|
||||
|
||||
emit('areaChange', {label: data.label})
|
||||
const onAreaChange = data => {
|
||||
emit('areaChange', { label: data.label })
|
||||
}
|
||||
|
||||
watch(
|
||||
@@ -142,7 +116,6 @@ watch(
|
||||
newVal => {
|
||||
setTimeout(() => {
|
||||
areaRef.value && areaRef.value.change()
|
||||
|
||||
}, 0)
|
||||
}
|
||||
)
|
||||
@@ -238,14 +211,14 @@ const onResetForm = () => {
|
||||
//时间重置成默认值
|
||||
datePickerRef.value?.setTheDate(3)
|
||||
|
||||
if(props.showTimeAll){
|
||||
timeAll.value = false
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.startTime
|
||||
delete tableStore.table.params.endTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
delete tableStore.table.params.interval
|
||||
if (props.showTimeAll) {
|
||||
timeAll.value = false
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.startTime
|
||||
delete tableStore.table.params.endTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
delete tableStore.table.params.interval
|
||||
}
|
||||
|
||||
if (props.datePicker && timeAll.value) {
|
||||
@@ -264,7 +237,6 @@ const setTheDate = (val: any) => {
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
|
||||
tableStore.onTableAction('export', { showAllFlag: true })
|
||||
}
|
||||
|
||||
@@ -300,6 +272,7 @@ defineExpose({
|
||||
padding: 13px 15px;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
|
||||
.table-header-operate-text {
|
||||
margin-left: 6px;
|
||||
}
|
||||
@@ -327,7 +300,7 @@ defineExpose({
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.mlr-12 + .el-button {
|
||||
.mlr-12+.el-button {
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
@@ -362,7 +335,7 @@ defineExpose({
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.el-button + .el-button {
|
||||
.el-button+.el-button {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -373,6 +346,7 @@ defineExpose({
|
||||
|
||||
html.dark {
|
||||
.table-search-button-group {
|
||||
|
||||
button:focus,
|
||||
button:active {
|
||||
background-color: var(--el-color-info-dark-2);
|
||||
|
||||
@@ -1,24 +1,44 @@
|
||||
<template>
|
||||
<div :style="{ height: typeof props.height === 'string' ? props.height : tableStore.table.height }">
|
||||
<vxe-table ref="tableRef" height="auto" :key="key" :data="tableStore.table.data"
|
||||
v-loading="tableStore.table.loading" v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
||||
@checkbox-all="selectChangeEvent" @checkbox-change="selectChangeEvent" :showOverflow="showOverflow"
|
||||
@sort-change="handleSortChange">
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
height="auto"
|
||||
:key="key"
|
||||
:data="tableStore.table.data"
|
||||
v-loading="tableStore.table.loading"
|
||||
v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
||||
@checkbox-all="selectChangeEvent"
|
||||
@checkbox-change="selectChangeEvent"
|
||||
:showOverflow="showOverflow"
|
||||
|
||||
>
|
||||
<!-- @sort-change="handleSortChange" -->
|
||||
<!-- Column 组件内部是 el-table-column -->
|
||||
<template v-if="isGroup">
|
||||
<GroupColumn :column="tableStore.table.column" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<Column :attr="item" :key="key + '-column'" v-for="(item, key) in tableStore.table.column"
|
||||
:tree-node="item.treeNode">
|
||||
<Column
|
||||
:attr="item"
|
||||
:key="key + '-column'"
|
||||
v-for="(item, key) in tableStore.table.column"
|
||||
:tree-node="item.treeNode"
|
||||
>
|
||||
<!-- tableStore 预设的列 render 方案 -->
|
||||
<template v-if="item.render" #default="scope">
|
||||
<FieldRender :field="item" :row="scope.row" :column="scope.column" :index="scope.rowIndex" :key="key +
|
||||
'-' +
|
||||
item.render +
|
||||
'-' +
|
||||
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
||||
" />
|
||||
<FieldRender
|
||||
:field="item"
|
||||
:row="scope.row"
|
||||
:column="scope.column"
|
||||
:index="scope.rowIndex"
|
||||
:key="
|
||||
key +
|
||||
'-' +
|
||||
item.render +
|
||||
'-' +
|
||||
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</Column>
|
||||
</template>
|
||||
@@ -27,11 +47,16 @@
|
||||
</div>
|
||||
|
||||
<div v-if="tableStore.showPage" class="table-pagination">
|
||||
<el-pagination :currentPage="tableStore.table.params!.pageNum" :page-size="tableStore.table.params!.pageSize"
|
||||
:page-sizes="pageSizes" background
|
||||
<el-pagination
|
||||
:currentPage="tableStore.table.params!.pageNum"
|
||||
:page-size="tableStore.table.params!.pageSize"
|
||||
:page-sizes="pageSizes"
|
||||
background
|
||||
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
|
||||
:total="tableStore.table.total" @size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"></el-pagination>
|
||||
:total="tableStore.table.total"
|
||||
@size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<slot name="footer"></slot>
|
||||
</template>
|
||||
|
||||
@@ -28,66 +28,66 @@ const info = (id: any) => {
|
||||
expanded.value = [id]
|
||||
getTerminalTree().then(res => {
|
||||
// let arr: any[] = []
|
||||
if (VITE_FLAG) {
|
||||
res.data.forEach((item: any) => {
|
||||
item.icon = 'el-icon-Menu'
|
||||
item.plevel = item.level
|
||||
item.level = 0
|
||||
item.children.forEach((item2: any) => {
|
||||
item2.icon = 'el-icon-HomeFilled'
|
||||
// if (VITE_FLAG) {
|
||||
// res.data.forEach((item: any) => {
|
||||
// item.icon = 'el-icon-Menu'
|
||||
// item.plevel = item.level
|
||||
// item.level = 0
|
||||
// item.children.forEach((item2: any) => {
|
||||
// item2.icon = 'el-icon-HomeFilled'
|
||||
|
||||
item2.plevel = item2.level
|
||||
item2.level = 100
|
||||
expanded.value.push(item2.id)
|
||||
item2.children.forEach((item3: any) => {
|
||||
item3.icon = 'el-icon-CollectionTag'
|
||||
item3.plevel = item3.level
|
||||
item3.level = 200
|
||||
item3.children.forEach((item4: any) => {
|
||||
item4.icon = 'el-icon-Flag'
|
||||
item4.plevel = item4.level
|
||||
item4.level = 300
|
||||
// arr.push(item4)
|
||||
item4.children.forEach((item5: any) => {
|
||||
item5.icon = 'el-icon-OfficeBuilding'
|
||||
item5.plevel = item5.level
|
||||
item5.level = 300
|
||||
// item5.id = item4.id
|
||||
item5.children.forEach((item6: any) => {
|
||||
item6.icon = 'el-icon-HelpFilled'
|
||||
item6.plevel = 4
|
||||
if (item6.name == '电网侧' && item6.children.length == 0) {
|
||||
item6.level = 400
|
||||
} else {
|
||||
item6.level = 400
|
||||
}
|
||||
item6.children.forEach((item7: any) => {
|
||||
item7.icon = 'el-icon-Film'
|
||||
item7.plevel = item7.level
|
||||
item7.level = 400
|
||||
item7.children.forEach((item8: any) => {
|
||||
item8.icon = 'el-icon-Collection'
|
||||
item8.plevel = item8.level
|
||||
item8.level = 500
|
||||
item8.children.forEach((item9: any) => {
|
||||
item9.icon = 'el-icon-Share'
|
||||
item9.plevel = item9.level
|
||||
item9.level = 600
|
||||
item9.children.forEach((item10: any) => {
|
||||
item10.icon = 'el-icon-Location'
|
||||
item10.plevel = item10.level
|
||||
item10.level = 700
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// item2.plevel = item2.level
|
||||
// item2.level = 100
|
||||
// expanded.value.push(item2.id)
|
||||
// item2.children.forEach((item3: any) => {
|
||||
// item3.icon = 'el-icon-CollectionTag'
|
||||
// item3.plevel = item3.level
|
||||
// item3.level = 200
|
||||
// item3.children.forEach((item4: any) => {
|
||||
// item4.icon = 'el-icon-Flag'
|
||||
// item4.plevel = item4.level
|
||||
// item4.level = 300
|
||||
// // arr.push(item4)
|
||||
// item4.children.forEach((item5: any) => {
|
||||
// item5.icon = 'el-icon-OfficeBuilding'
|
||||
// item5.plevel = item5.level
|
||||
// item5.level = 300
|
||||
// // item5.id = item4.id
|
||||
// item5.children.forEach((item6: any) => {
|
||||
// item6.icon = 'el-icon-HelpFilled'
|
||||
// item6.plevel = 4
|
||||
// if (item6.name == '电网侧' && item6.children.length == 0) {
|
||||
// item6.level = 400
|
||||
// } else {
|
||||
// item6.level = 400
|
||||
// }
|
||||
// item6.children.forEach((item7: any) => {
|
||||
// item7.icon = 'el-icon-Film'
|
||||
// item7.plevel = item7.level
|
||||
// item7.level = 400
|
||||
// item7.children.forEach((item8: any) => {
|
||||
// item8.icon = 'el-icon-Collection'
|
||||
// item8.plevel = item8.level
|
||||
// item8.level = 500
|
||||
// item8.children.forEach((item9: any) => {
|
||||
// item9.icon = 'el-icon-Share'
|
||||
// item9.plevel = item9.level
|
||||
// item9.level = 600
|
||||
// item9.children.forEach((item10: any) => {
|
||||
// item10.icon = 'el-icon-Location'
|
||||
// item10.plevel = item10.level
|
||||
// item10.level = 700
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// } else {
|
||||
res.data.forEach((item: any) => {
|
||||
item.icon = 'el-icon-Menu'
|
||||
item.plevel = item.level
|
||||
@@ -129,7 +129,7 @@ const info = (id: any) => {
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
// }
|
||||
|
||||
tree.value = res.data
|
||||
|
||||
|
||||
@@ -11,25 +11,25 @@
|
||||
:data="eventList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||
>
|
||||
<!-- <vxe-column type="seq" width="70px" title="序号"></vxe-column> -->
|
||||
<vxe-column field="time" width="180px" sortable title="发生时刻"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点"></vxe-column>
|
||||
<vxe-column field="powerCompany" title="变电站" width="100px"></vxe-column>
|
||||
<vxe-column field="powerCompany" title="供电公司" width="100px"></vxe-column>
|
||||
<vxe-column field="persistTime" width="120px" sortable title="持续时间(s)">
|
||||
<template #default="{ row }">
|
||||
{{ Math.floor(row.persistTime * 1000) / 1000 }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="time" width="180px" sortable title="暂降发生时刻"></vxe-column>
|
||||
<vxe-column field="eventValue" width="160px" sortable title="暂降(骤升)幅值(%)">
|
||||
<template #default="{ row }">
|
||||
{{ Math.floor(row.eventValue * 10000) / 100 }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="persistTime" width="120px" sortable title="持续时间(s)">
|
||||
<template #default="{ row }">
|
||||
{{ Math.floor(row.persistTime * 1000) / 1000 }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="eventType" width="100px" title="触发类型">
|
||||
<template #default="{ row }">
|
||||
{{ event.filter(item => item.id == row.eventType)[0]?.name || '/' }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="powerCompany" title="变电站" width="100px"></vxe-column>
|
||||
<vxe-column field="powerCompany" title="供电公司" width="100px"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点"></vxe-column>
|
||||
</vxe-table>
|
||||
<div class="table-pagination mt10">
|
||||
<el-pagination
|
||||
@@ -50,7 +50,8 @@ import { ref, reactive, onMounted } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import MQTT from '@/utils/mqtt'
|
||||
// import MQTT from '@/utils/mqtt'
|
||||
import socketClient from '@/utils/webSocketClient'
|
||||
const dictData = useDictData()
|
||||
const event = dictData.getBasicData('Event_Statis')
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
@@ -68,37 +69,71 @@ const handleClose = (done: any) => {
|
||||
drawer.value = false
|
||||
done()
|
||||
}
|
||||
const init = async () => {
|
||||
const mqttClient = new MQTT('/sendEvent')
|
||||
// 设置消息接收回调
|
||||
try {
|
||||
await mqttClient.init()
|
||||
const dataSocket = reactive({
|
||||
socketServe: socketClient.Instance
|
||||
})
|
||||
// const init = async () => {
|
||||
// const mqttClient = new MQTT('/sendEvent')
|
||||
// // 设置消息接收回调
|
||||
// try {
|
||||
// await mqttClient.init()
|
||||
|
||||
// 订阅主题
|
||||
await mqttClient.subscribe()
|
||||
// 设置消息接收回调
|
||||
mqttClient.onMessage((topic, message) => {
|
||||
const msg = JSON.parse(message.toString())
|
||||
// console.log('🚀 ~ init ~ msg:', msg)
|
||||
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||
drawer.value = true
|
||||
isLoading.value = true
|
||||
eventList.value.unshift(msg)
|
||||
setTimeout(() => {
|
||||
isLoading.value = false
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
// console.error('MQTT 初始化失败:', error)
|
||||
}
|
||||
// // 订阅主题
|
||||
// await mqttClient.subscribe()
|
||||
// // 设置消息接收回调
|
||||
// mqttClient.onMessage((topic, message) => {
|
||||
// const msg = JSON.parse(message.toString())
|
||||
// // console.log('🚀 ~ init ~ msg:', msg)
|
||||
// if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||
// drawer.value = true
|
||||
// isLoading.value = true
|
||||
// eventList.value.unshift(msg)
|
||||
// setTimeout(() => {
|
||||
// isLoading.value = false
|
||||
// }, 500)
|
||||
// }
|
||||
// })
|
||||
// } catch (error) {
|
||||
// // console.error('MQTT 初始化失败:', error)
|
||||
// }
|
||||
// }
|
||||
const socket = async () => {
|
||||
const url = localStorage.getItem('WebSocketUrl3') || 'null' //'ws://192.168.2.130:10203/event/'
|
||||
|
||||
// const url = 'ws://192.168.1.68:10203/event/'
|
||||
|
||||
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||
|
||||
await dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||
if (res.deptList.includes(adminInfo.$state.deptId)) {
|
||||
drawer.value = true
|
||||
isLoading.value = true
|
||||
eventList.value.unshift(res)
|
||||
setTimeout(() => {
|
||||
isLoading.value = false
|
||||
}, 500)
|
||||
}
|
||||
// logList.value.push({
|
||||
// type: res.code == 500 ? 'error' : '',
|
||||
// time: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
|
||||
// name: res.message
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
dataSocket.socketServe?.closeWs()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// startMqtt('/sendEvent', (topic, message) => {
|
||||
// const msg = JSON.parse(message.toString())
|
||||
// console.log(msg)
|
||||
// })
|
||||
init()
|
||||
|
||||
setTimeout(() => {
|
||||
socket()
|
||||
}, 3000)
|
||||
})
|
||||
defineExpose({
|
||||
open,
|
||||
|
||||
@@ -8,41 +8,14 @@
|
||||
name="el-icon-BellFilled"
|
||||
size="18"
|
||||
/>
|
||||
<span class="nav-menu-text" v-if="globalPopUpRef?.eventList.length != 0">
|
||||
{{ (globalPopUpRef?.eventList.length>99? '99+':globalPopUpRef?.eventList.length) || 0 }}
|
||||
<span class="nav-menu-text" v-if="globalPopUpRef?.eventList?.length > 0">
|
||||
{{ globalPopUpRef.eventList.length > 99 ? '99+' : globalPopUpRef.eventList.length }}
|
||||
</span>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip effect="dark" content="截图" placement="bottom">
|
||||
<div @click="savePng" class="nav-menu-item">
|
||||
<Icon
|
||||
:color="configStore.getColorVal('headerBarTabColor')"
|
||||
class="nav-menu-icon"
|
||||
name="el-icon-Camera"
|
||||
size="18"
|
||||
/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" :content="state.isFullScreen ? '缩小' : '放大'" placement="bottom">
|
||||
<div @click="onFullScreen" class="nav-menu-item" :class="state.isFullScreen ? 'hover' : ''">
|
||||
<Icon
|
||||
:color="configStore.getColorVal('headerBarTabColor')"
|
||||
class="nav-menu-icon"
|
||||
v-if="state.isFullScreen"
|
||||
name="fa-solid fa-compress"
|
||||
size="18"
|
||||
/>
|
||||
<Icon
|
||||
:color="configStore.getColorVal('headerBarTabColor')"
|
||||
class="nav-menu-icon"
|
||||
v-else
|
||||
name="fa-solid fa-expand"
|
||||
size="18"
|
||||
/>
|
||||
</div>
|
||||
</el-tooltip> -->
|
||||
|
||||
<el-dropdown style="height: 100%" @command="handleCommand">
|
||||
<div class="admin-info" :class="state.currentNavMenu == 'adminInfo' ? 'hover' : ''">
|
||||
<div class="admin-info" :class="state.currentNavMenu === 'adminInfo' ? 'hover' : ''">
|
||||
<el-avatar :size="25" fit="fill">
|
||||
<img src="@/assets/avatar.png" alt="" />
|
||||
</el-avatar>
|
||||
@@ -51,105 +24,114 @@
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="adminInfo">个人资料</el-dropdown-item>
|
||||
<el-dropdown-item command="changePwd">修改密码</el-dropdown-item>
|
||||
<el-dropdown-item command="layout">退出登录</el-dropdown-item>
|
||||
<el-dropdown-item command="changePwd" v-if="!IS_LNQR">修改密码</el-dropdown-item>
|
||||
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<!-- <div @click="configStore.setLayout('showDrawer', true)" class="nav-menu-item">
|
||||
<Icon
|
||||
:color="configStore.getColorVal('headerBarTabColor')"
|
||||
class="nav-menu-icon"
|
||||
name="fa fa-cogs"
|
||||
size="18"
|
||||
/>
|
||||
</div> -->
|
||||
|
||||
<Config />
|
||||
<PopupPwd ref="popupPwd" />
|
||||
<AdminInfo ref="popupAdminInfo" />
|
||||
<!-- <TerminalVue /> -->
|
||||
<!-- 全局暂降事件 -->
|
||||
<globalPopUp ref="globalPopUpRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue'
|
||||
import screenfull from 'screenfull'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import Config from './config.vue'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import router from '@/router'
|
||||
import globalPopUp from './globalPopUp.vue'
|
||||
import { routePush } from '@/utils/router'
|
||||
import html2canvas from 'html2canvas'
|
||||
import { useNavTabs } from '@/stores/navTabs'
|
||||
import { logout } from '@/api/user-boot/user'
|
||||
import Config from './config.vue'
|
||||
import PopupPwd from './popup/password.vue'
|
||||
import AdminInfo from './popup/adminInfo.vue'
|
||||
import { useNavTabs } from '@/stores/navTabs'
|
||||
const { replace } = useRouter()
|
||||
// 环境标识
|
||||
const IS_LNQR = import.meta.env.VITE_NAME === 'LNqr'
|
||||
|
||||
const adminInfo = useAdminInfo()
|
||||
const navTabs = useNavTabs()
|
||||
const configStore = useConfig()
|
||||
|
||||
// 引用
|
||||
const popupPwd = ref()
|
||||
const popupAdminInfo = ref()
|
||||
const state = reactive({
|
||||
isFullScreen: false,
|
||||
currentNavMenu: '',
|
||||
showLayoutDrawer: false,
|
||||
showAdminInfoPopover: false
|
||||
})
|
||||
const globalPopUpRef = ref()
|
||||
const savePng = () => {
|
||||
html2canvas(document.body, {
|
||||
scale: 1,
|
||||
useCORS: true
|
||||
}).then(function (canvas) {
|
||||
var link = document.createElement('a')
|
||||
link.href = canvas.toDataURL('image/png')
|
||||
link.download = 'screenshot.png'
|
||||
link.click()
|
||||
})
|
||||
}
|
||||
const onFullScreen = () => {
|
||||
if (!screenfull.isEnabled) {
|
||||
ElMessage.warning('layouts.Full screen is not supported')
|
||||
return false
|
||||
|
||||
// 状态
|
||||
const state = reactive({
|
||||
currentNavMenu: ''
|
||||
})
|
||||
|
||||
// 打开暂降事件
|
||||
const temporaryLandingEvent = () => {
|
||||
if (globalPopUpRef.value) {
|
||||
globalPopUpRef.value.open()
|
||||
}
|
||||
screenfull.toggle()
|
||||
screenfull.onchange(() => {
|
||||
state.isFullScreen = screenfull.isFullscreen
|
||||
})
|
||||
}
|
||||
|
||||
const handleCommand = async(key: string) => {
|
||||
console.log(key)
|
||||
// 下拉菜单命令
|
||||
const handleCommand = async (key: string) => {
|
||||
switch (key) {
|
||||
case 'adminInfo':
|
||||
popupAdminInfo.value.open()
|
||||
popupAdminInfo.value?.open()
|
||||
break
|
||||
case 'changePwd':
|
||||
popupPwd.value.open()
|
||||
popupPwd.value?.open()
|
||||
break
|
||||
case 'layout':
|
||||
await window.location.reload()
|
||||
setTimeout(() => {
|
||||
navTabs.closeTabs()
|
||||
window.localStorage.clear()
|
||||
adminInfo.reset()
|
||||
router.push({ name: 'login' })
|
||||
}, 0)
|
||||
// navTabs.closeTabs()
|
||||
// window.localStorage.clear()
|
||||
// adminInfo.reset()
|
||||
// router.push({ name: 'login' })
|
||||
break
|
||||
default:
|
||||
case 'logout':
|
||||
await handleLogout()
|
||||
break
|
||||
}
|
||||
}
|
||||
const temporaryLandingEvent = () => {
|
||||
globalPopUpRef.value.open()
|
||||
|
||||
// 统一登出逻辑
|
||||
const handleLogout = async () => {
|
||||
try {
|
||||
// 1. 调用后端登出接口
|
||||
await logout()
|
||||
console.log('✅ 后端登出成功')
|
||||
} catch (err) {
|
||||
console.error('❌ 登出接口异常', err)
|
||||
} finally {
|
||||
// 2. 清理本地所有数据
|
||||
clearLocalData()
|
||||
|
||||
// 3. LNqr 环境跳 CAS 登出
|
||||
if (IS_LNQR) {
|
||||
redirectToCasLogout()
|
||||
} else {
|
||||
// 普通环境直接跳登录页
|
||||
replace('/login')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 清理本地数据
|
||||
const clearLocalData = () => {
|
||||
// 清空 localStorage
|
||||
window.localStorage.clear()
|
||||
|
||||
// 清空用户状态
|
||||
adminInfo.reset()
|
||||
|
||||
// 清空标签页
|
||||
navTabs.closeTabs()
|
||||
|
||||
console.log('✅ 本地数据已全部清空')
|
||||
}
|
||||
|
||||
// CAS 登出跳转
|
||||
const redirectToCasLogout = () => {
|
||||
const casLogoutUrl =
|
||||
'http://privilege-epri.dcloud.ln.dc.sgcc.com.cn/cas/logout?service=http://privilege-epri.dcloud.ln.dc.sgcc.com.cn/cas/login?service=http://PQMonitoring.dcloud.ln.dc.sgcc.com.cn'
|
||||
window.location.href = casLogoutUrl
|
||||
// 清 Cookie
|
||||
document.cookie.split(';').forEach(cookie => {
|
||||
const name = cookie.split('=')[0].trim()
|
||||
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -163,7 +145,6 @@ const temporaryLandingEvent = () => {
|
||||
height: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// height: 100%;
|
||||
margin-left: auto;
|
||||
background-color: v-bind('configStore.getColorVal("headerBarBackground")');
|
||||
|
||||
@@ -219,37 +200,15 @@ const temporaryLandingEvent = () => {
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu-box :deep(.el-dropdown-menu__item) {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.admin-info-base {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
padding-top: 10px;
|
||||
|
||||
.admin-info-other {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 10px 0;
|
||||
|
||||
.admin-info-name {
|
||||
font-size: var(--el-font-size-large);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.admin-info-footer {
|
||||
padding: 10px 0;
|
||||
margin: 0 -12px -12px -12px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.pt2 {
|
||||
padding-top: 2px;
|
||||
.nav-menu-text {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 20px;
|
||||
font-size: 12px;
|
||||
background: #ff0000;
|
||||
color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 0 3px;
|
||||
}
|
||||
|
||||
@keyframes twinkle {
|
||||
@@ -263,15 +222,4 @@ const temporaryLandingEvent = () => {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
.nav-menu-text {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 20px;
|
||||
font-size: 12px;
|
||||
display: inline-block;
|
||||
background-color: #ff0000;
|
||||
color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 0 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -404,6 +404,11 @@ body,
|
||||
.el-select__wrapper {
|
||||
height: 32px !important;
|
||||
}
|
||||
.BMap_center,
|
||||
.BMap_top,
|
||||
.BMap_bottom {
|
||||
background-color: #fff;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'AlimamaFangYuanTiVF';
|
||||
src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'),
|
||||
|
||||
59
src/utils/chartAxisHelper.ts
Normal file
59
src/utils/chartAxisHelper.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
const AXIS_DECIMALS = 2
|
||||
|
||||
export function roundAxisValue(val: number, decimals = AXIS_DECIMALS): number {
|
||||
if (!Number.isFinite(val)) return 0
|
||||
const factor = 10 ** decimals
|
||||
return Math.round(val * factor) / factor
|
||||
}
|
||||
|
||||
/** Y 轴刻度:最多 2 位小数,末尾 0 去掉(如 1.00 → 1,0.10 → 0.1) */
|
||||
export function formatAxisLabel(value: number): string {
|
||||
if (!Number.isFinite(value)) return '0'
|
||||
return String(Number(roundAxisValue(value).toFixed(AXIS_DECIMALS)))
|
||||
}
|
||||
|
||||
/** 瞬间波形 Y 轴范围 */
|
||||
export function calcShuYAxisRange(dataMin: number, dataMax: number): { min: number; max: number } {
|
||||
const min = Number(dataMin)
|
||||
const max = Number(dataMax)
|
||||
if (!Number.isFinite(min) || !Number.isFinite(max)) {
|
||||
return { min: 0, max: 1 }
|
||||
}
|
||||
|
||||
let axisMax = max * 1.1
|
||||
let axisMin = min > 0 ? min - min * 0.1 : min * 1.1
|
||||
|
||||
if (axisMax <= axisMin) {
|
||||
const pad = Math.abs(max) * 0.1 || 0.01
|
||||
axisMax = max + pad
|
||||
axisMin = min - pad
|
||||
}
|
||||
|
||||
return {
|
||||
min: roundAxisValue(axisMin),
|
||||
max: roundAxisValue(axisMax)
|
||||
}
|
||||
}
|
||||
|
||||
/** RMS 波形 Y 轴范围 */
|
||||
export function calcRmsYAxisRange(dataMin: number, dataMax: number): { min: number; max: number } {
|
||||
const min = Number(dataMin)
|
||||
const max = Number(dataMax)
|
||||
if (!Number.isFinite(min) || !Number.isFinite(max)) {
|
||||
return { min: 0, max: 1 }
|
||||
}
|
||||
|
||||
let axisMax = max * 1.06 * 1.1
|
||||
let axisMin = min - min * 0.2
|
||||
|
||||
if (axisMax <= axisMin) {
|
||||
const pad = Math.abs(max - min) * 0.1 || Math.abs(max) * 0.1 || 0.01
|
||||
axisMax = max + pad
|
||||
axisMin = min - pad
|
||||
}
|
||||
|
||||
return {
|
||||
min: roundAxisValue(axisMin),
|
||||
max: roundAxisValue(axisMax)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
// 高级算法
|
||||
export const ADVANCE_BOOT = '/advance-boot'
|
||||
|
||||
//技术监督
|
||||
export const PROCESS_BOOT = '/process-boot'
|
||||
|
||||
//工作流模块
|
||||
export const BPM_BOOT = '/bpm-boot'
|
||||
|
||||
//冀北技术监督
|
||||
export const SUPERVISION_BOOT = '/supervision-boot'
|
||||
|
||||
//终端模块
|
||||
// 高级算法
|
||||
export const ADVANCE_BOOT = '/advance-boot'
|
||||
|
||||
//技术监督
|
||||
export const PROCESS_BOOT = '/process-boot'
|
||||
|
||||
//工作流模块
|
||||
export const BPM_BOOT = '/bpm-boot'
|
||||
|
||||
//网公司技术监督
|
||||
export const SUPERVISION_BOOT = '/supervision-boot'
|
||||
|
||||
//终端模块
|
||||
export const DEVICE_BOOT = '/device-boot'
|
||||
@@ -11,6 +11,7 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
} else if (value > -1 && value < 0 && isMin == false) {
|
||||
return 0
|
||||
}
|
||||
|
||||
let base
|
||||
if (Math.abs(o) >= 100) {
|
||||
base = 100
|
||||
@@ -19,8 +20,11 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
} else if (Math.abs(o) >= 1) {
|
||||
base = 1
|
||||
} else {
|
||||
base = 0.1
|
||||
const multiple = 1 / 0.1
|
||||
|
||||
base = Math.ceil(Math.abs(o) * multiple) / multiple
|
||||
}
|
||||
|
||||
let calculatedValue
|
||||
if (isMin) {
|
||||
if (value < 0) {
|
||||
@@ -35,98 +39,37 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
calculatedValue = value + num * value
|
||||
}
|
||||
}
|
||||
|
||||
if (base === 0.1) {
|
||||
return parseFloat(calculatedValue.toFixed(1))
|
||||
// return parseFloat(calculatedValue.toFixed(1))
|
||||
return Math.ceil(calculatedValue * 10) / 10
|
||||
} else if (isMin) {
|
||||
return Math.floor(calculatedValue / base) * base
|
||||
} else {
|
||||
return Math.ceil(calculatedValue / base) * base
|
||||
}
|
||||
}
|
||||
|
||||
// 处理y轴最大最小值
|
||||
export const yMethod = (arr: any) => {
|
||||
let num = 0.1
|
||||
let num = 0.2
|
||||
let numList = dataProcessing(arr)
|
||||
let maxValue = 0
|
||||
let minValue = 0
|
||||
let max = 0
|
||||
let min = 0
|
||||
maxValue = Math.max(...numList)
|
||||
minValue = Math.min(...numList)
|
||||
const o = maxValue - minValue
|
||||
if (Math.abs(o) >= 300) {
|
||||
num = 0.02
|
||||
if (numList.length === 0) {
|
||||
return [0, 0]
|
||||
}
|
||||
const maxValue = Math.max(...numList)
|
||||
const minValue = Math.min(...numList)
|
||||
let min = 0
|
||||
let max = 0
|
||||
|
||||
min = calculateValue(o, minValue, num, true)
|
||||
max = calculateValue(o, maxValue, num, false)
|
||||
// if (-100 >= minValue) {
|
||||
// min = Math.floor((minValue + num * minValue) / 100) * 100
|
||||
// } else if (-10 >= minValue && minValue > -100) {
|
||||
// min = Math.floor((minValue + num * minValue) / 10) * 10
|
||||
// } else if (-1 >= minValue && minValue > -10) {
|
||||
// min = Math.floor(minValue + num * minValue)
|
||||
// } else if (0 > minValue && minValue > -1) {
|
||||
// min = parseFloat((minValue + num * minValue).toFixed(1))
|
||||
// } else if (minValue == 0) {
|
||||
// min = 0
|
||||
// } else if (0 < minValue && minValue < 1) {
|
||||
// min = parseFloat((minValue - num * minValue).toFixed(1))
|
||||
// } else if (1 <= minValue && minValue < 10) {
|
||||
// min = Math.floor(minValue - num * minValue)
|
||||
// } else if (10 <= minValue && minValue < 100) {
|
||||
// min = Math.floor((minValue - num * minValue) / 10) * 10
|
||||
// } else if (100 <= minValue) {
|
||||
// min = Math.floor((minValue - num * minValue) / 100) * 100
|
||||
// }
|
||||
|
||||
// if (-100 >= maxValue) {
|
||||
// max = Math.ceil((maxValue - num * maxValue) / 100) * 100
|
||||
// } else if (-10 >= maxValue && maxValue > -100) {
|
||||
// max = Math.ceil((maxValue - num * maxValue) / 10) * 10
|
||||
// } else if (-1 >= maxValue && maxValue > -10) {
|
||||
// max = Math.ceil(maxValue - num * maxValue)
|
||||
// } else if (0 > maxValue && maxValue > -1) {
|
||||
// max = parseFloat((maxValue - num * maxValue).toFixed(1))
|
||||
// } else if (maxValue == 0) {
|
||||
// max = 0
|
||||
// } else if (0 < maxValue && maxValue < 1) {
|
||||
// max = parseFloat((maxValue + num * maxValue).toFixed(1))
|
||||
// } else if (1 <= maxValue && maxValue < 10) {
|
||||
// max = Math.ceil(maxValue + num * maxValue)
|
||||
// } else if (10 <= maxValue && maxValue < 100) {
|
||||
// max = Math.ceil((maxValue + num * maxValue) / 10) * 10
|
||||
// } else if (100 <= maxValue) {
|
||||
// max = Math.ceil((maxValue + num * maxValue) / 100) * 100
|
||||
// }
|
||||
|
||||
// if (maxValue > 1000 || minValue < -1000) {
|
||||
// max = Math.ceil(maxValue / 100) * 100
|
||||
// if (minValue == 0) {
|
||||
// min = 0
|
||||
// } else {
|
||||
// min = Math.floor(minValue / 100) * 100
|
||||
// }
|
||||
// } else if (maxValue < 60 && minValue > 40) {
|
||||
// max = 60
|
||||
// min = 40
|
||||
// } else if (maxValue == minValue && maxValue < 10 && minValue > 0) {
|
||||
// max = Math.ceil(maxValue / 10) * 10
|
||||
// min = Math.floor(minValue / 10) * 10
|
||||
// } else if (maxValue == minValue && maxValue != 0 && minValue != 0) {
|
||||
// max = Math.ceil(maxValue / 10 + 1) * 10
|
||||
// min = Math.floor(minValue / 10 - 1) * 10
|
||||
// } else {
|
||||
// max = Math.ceil(maxValue / 10) * 10
|
||||
// min = Math.floor(minValue / 10) * 10
|
||||
// }
|
||||
|
||||
// if (maxValue > 0 && maxValue < 1) {
|
||||
// max = 1
|
||||
// } else if (max == 0 && minValue > -1 && minValue < 0) {
|
||||
// min = -1
|
||||
// }
|
||||
// 一正一负时各自按绝对值范围计算,不用 max - min 作为跨度
|
||||
if (maxValue > 0 && minValue < 0) {
|
||||
min = calculateValue(Math.abs(minValue), minValue, num, true)
|
||||
max = calculateValue(Math.abs(maxValue), maxValue, num, false)
|
||||
} else {
|
||||
const o = maxValue - minValue === 0 ? maxValue : maxValue - minValue
|
||||
min = calculateValue(o, minValue, num, true)
|
||||
max = calculateValue(o, maxValue, num, false)
|
||||
}
|
||||
|
||||
return [min, max]
|
||||
}
|
||||
@@ -158,8 +101,6 @@ export const exportCSV = (title: object, data: any, filename: string) => {
|
||||
URL.revokeObjectURL(link.href)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 补全时间序列数据中缺失的条目
|
||||
* @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...]
|
||||
|
||||
@@ -27,8 +27,8 @@ class MQTT {
|
||||
clean: true,
|
||||
connectTimeout: 30 * 1000,
|
||||
clientId: `mqttjs_${Math.random().toString(16).substr(2, 8)}`,
|
||||
username: 't_user',
|
||||
password: 'njcnpqs',
|
||||
username: '',
|
||||
password: '',
|
||||
reconnectPeriod: 1000, // 默认1秒重试一次
|
||||
maxReconnectTimes: 3 // 默认最大重连5次
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import type { AxiosRequestConfig, Method } from 'axios'
|
||||
import axios from 'axios'
|
||||
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
||||
import { refreshToken } from '@/api/user-boot/user'
|
||||
import { lnRefreshToken, lnRefreshTokenTo, refreshToken } from '@/api/user-boot/user'
|
||||
import router from '@/router/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { debounce } from 'lodash-es'
|
||||
const IS_LN_VERSION = import.meta.env.VITE_NAME === 'LNqr'
|
||||
let loginExpireTimer: any = null
|
||||
window.requests = []
|
||||
window.tokenRefreshing = false
|
||||
@@ -107,7 +108,12 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||
config.headers.Authorization = 'Basic bmpjbjpuamNucHFz'
|
||||
}
|
||||
}
|
||||
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
||||
if (
|
||||
config.url == '/user-boot/user/generateSm2Key' ||
|
||||
config.url == '/pqs-auth/oauth/token' ||
|
||||
config.url == '/pqs-auth/oauth/lnLogin' ||
|
||||
config.url == '/pqs-auth/oauth/lnRefreshToken'
|
||||
) {
|
||||
config.headers.Authorization = 'Basic bmpjbjpuamNucHFz'
|
||||
}
|
||||
|
||||
@@ -142,24 +148,46 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||
if (!window.tokenRefreshing) {
|
||||
window.tokenRefreshing = true
|
||||
|
||||
return refreshToken()
|
||||
.then(res => {
|
||||
adminInfo.setToken(res.data.access_token, 'auth')
|
||||
adminInfo.setToken(res.data.refresh_token, 'refresh')
|
||||
window.requests.forEach(cb => cb(res.data.access_token))
|
||||
window.requests = []
|
||||
if (IS_LN_VERSION) {
|
||||
//辽宁版本
|
||||
return lnRefreshTokenTo()
|
||||
.then(res => {
|
||||
adminInfo.setToken(res.data.access_token, 'auth')
|
||||
adminInfo.setToken(res.data.refresh_token, 'refresh')
|
||||
window.requests.forEach(cb => cb(res.data.access_token))
|
||||
window.requests = []
|
||||
|
||||
return Axios(response.config)
|
||||
})
|
||||
.catch(err => {
|
||||
window.location.reload()
|
||||
adminInfo.removeToken()
|
||||
router.push({ name: 'login' })
|
||||
return Promise.reject(err)
|
||||
})
|
||||
.finally(() => {
|
||||
window.tokenRefreshing = false
|
||||
})
|
||||
return Axios(response.config)
|
||||
})
|
||||
.catch(err => {
|
||||
// refresh_token + CAS 都过期 → 重新走CAS登录
|
||||
window.location.href = '/api/pqs-auth/oauth/lnCheck'
|
||||
return Promise.reject(err)
|
||||
})
|
||||
.finally(() => {
|
||||
window.tokenRefreshing = false
|
||||
})
|
||||
} else {
|
||||
//通用版本
|
||||
return refreshToken()
|
||||
.then(res => {
|
||||
adminInfo.setToken(res.data.access_token, 'auth')
|
||||
adminInfo.setToken(res.data.refresh_token, 'refresh')
|
||||
window.requests.forEach(cb => cb(res.data.access_token))
|
||||
window.requests = []
|
||||
|
||||
return Axios(response.config)
|
||||
})
|
||||
.catch(err => {
|
||||
window.location.reload()
|
||||
adminInfo.removeToken()
|
||||
router.push({ name: 'login' })
|
||||
return Promise.reject(err)
|
||||
})
|
||||
.finally(() => {
|
||||
window.tokenRefreshing = false
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return new Promise(resolve => {
|
||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||
@@ -184,6 +212,13 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||
router.push({ name: 'login' })
|
||||
loginExpireTimer = null // 执行后清空定时器
|
||||
}, 100) // 可根据实际情况调整延迟时间
|
||||
return Promise.reject(response.data)
|
||||
} else if (response.data.code == 'A0121') {
|
||||
//统一认证过期
|
||||
const casLogoutUrl =
|
||||
'http://privilege-epri.dcloud.ln.dc.sgcc.com.cn/cas/login?service=http://PQMonitoring.dcloud.ln.dc.sgcc.com.cn'
|
||||
window.location.href = casLogoutUrl
|
||||
|
||||
return Promise.reject(response.data)
|
||||
} else {
|
||||
if (options.showCodeMessage) {
|
||||
|
||||
@@ -1,400 +1,432 @@
|
||||
interface TreeHelperConfig {
|
||||
id: string
|
||||
children: string
|
||||
pid: string
|
||||
}
|
||||
|
||||
const DEFAULT_CONFIG: TreeHelperConfig = {
|
||||
id: 'id',
|
||||
children: 'children',
|
||||
pid: 'pid'
|
||||
}
|
||||
export const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
isLeaf: 'leaf',
|
||||
emitPath: false // 用于 cascader 组件:在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
}
|
||||
|
||||
const getConfig = (config: Partial<TreeHelperConfig>) => Object.assign({}, DEFAULT_CONFIG, config)
|
||||
|
||||
// tree from list
|
||||
export const listToTree = <T = any>(list: any[], config: Partial<TreeHelperConfig> = {}): T[] => {
|
||||
const conf = getConfig(config) as TreeHelperConfig
|
||||
const nodeMap = new Map()
|
||||
const result: T[] = []
|
||||
const { id, children, pid } = conf
|
||||
|
||||
for (const node of list) {
|
||||
node[children] = node[children] || []
|
||||
nodeMap.set(node[id], node)
|
||||
}
|
||||
for (const node of list) {
|
||||
const parent = nodeMap.get(node[pid])
|
||||
;(parent ? parent.children : result).push(node)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const treeToList = <T = any>(tree: any, config: Partial<TreeHelperConfig> = {}): T => {
|
||||
config = getConfig(config)
|
||||
const { children } = config
|
||||
const result: any = [...tree]
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
if (!result[i][children!]) continue
|
||||
result.splice(i + 1, 0, ...result[i][children!])
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const findNode = <T = any>(
|
||||
tree: any,
|
||||
func: Fn,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T | null => {
|
||||
config = getConfig(config)
|
||||
const { children } = config
|
||||
const list = [...tree]
|
||||
for (const node of list) {
|
||||
if (func(node)) return node
|
||||
node[children!] && list.push(...node[children!])
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export const findNodeAll = <T = any>(
|
||||
tree: any,
|
||||
func: Fn,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T[] => {
|
||||
config = getConfig(config)
|
||||
const { children } = config
|
||||
const list = [...tree]
|
||||
const result: T[] = []
|
||||
for (const node of list) {
|
||||
func(node) && result.push(node)
|
||||
node[children!] && list.push(...node[children!])
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const findPath = <T = any>(
|
||||
tree: any,
|
||||
func: Fn,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T | T[] | null => {
|
||||
config = getConfig(config)
|
||||
const path: T[] = []
|
||||
const list = [...tree]
|
||||
const visitedSet = new Set()
|
||||
const { children } = config
|
||||
while (list.length) {
|
||||
const node = list[0]
|
||||
if (visitedSet.has(node)) {
|
||||
path.pop()
|
||||
list.shift()
|
||||
} else {
|
||||
visitedSet.add(node)
|
||||
node[children!] && list.unshift(...node[children!])
|
||||
path.push(node)
|
||||
if (func(node)) {
|
||||
return path
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export const findPathAll = (tree: any, func: Fn, config: Partial<TreeHelperConfig> = {}) => {
|
||||
config = getConfig(config)
|
||||
const path: any[] = []
|
||||
const list = [...tree]
|
||||
const result: any[] = []
|
||||
const visitedSet = new Set(),
|
||||
{ children } = config
|
||||
while (list.length) {
|
||||
const node = list[0]
|
||||
if (visitedSet.has(node)) {
|
||||
path.pop()
|
||||
list.shift()
|
||||
} else {
|
||||
visitedSet.add(node)
|
||||
node[children!] && list.unshift(...node[children!])
|
||||
path.push(node)
|
||||
func(node) && result.push([...path])
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const filter = <T = any>(
|
||||
tree: T[],
|
||||
func: (n: T) => boolean,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T[] => {
|
||||
config = getConfig(config)
|
||||
const children = config.children as string
|
||||
|
||||
function listFilter(list: T[]) {
|
||||
return list
|
||||
.map((node: any) => ({ ...node }))
|
||||
.filter((node) => {
|
||||
node[children] = node[children] && listFilter(node[children])
|
||||
return func(node) || (node[children] && node[children].length)
|
||||
})
|
||||
}
|
||||
|
||||
return listFilter(tree)
|
||||
}
|
||||
|
||||
export const forEach = <T = any>(
|
||||
tree: T[],
|
||||
func: (n: T) => any,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): void => {
|
||||
config = getConfig(config)
|
||||
const list: any[] = [...tree]
|
||||
const { children } = config
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
// func 返回true就终止遍历,避免大量节点场景下无意义循环,引起浏览器卡顿
|
||||
if (func(list[i])) {
|
||||
return
|
||||
}
|
||||
children && list[i][children] && list.splice(i + 1, 0, ...list[i][children])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Extract tree specified structure
|
||||
*/
|
||||
export const treeMap = <T = any>(
|
||||
treeData: T[],
|
||||
opt: { children?: string; conversion: Fn }
|
||||
): T[] => {
|
||||
return treeData.map((item) => treeMapEach(item, opt))
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Extract tree specified structure
|
||||
*/
|
||||
export const treeMapEach = (
|
||||
data: any,
|
||||
{ children = 'children', conversion }: { children?: string; conversion: Fn }
|
||||
) => {
|
||||
const haveChildren = Array.isArray(data[children]) && data[children].length > 0
|
||||
const conversionData = conversion(data) || {}
|
||||
if (haveChildren) {
|
||||
return {
|
||||
...conversionData,
|
||||
[children]: data[children].map((i: number) =>
|
||||
treeMapEach(i, {
|
||||
children,
|
||||
conversion
|
||||
})
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
...conversionData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归遍历树结构
|
||||
* @param treeDatas 树
|
||||
* @param callBack 回调
|
||||
* @param parentNode 父节点
|
||||
*/
|
||||
export const eachTree = (treeDatas: any[], callBack: Fn, parentNode = {}) => {
|
||||
treeDatas.forEach((element) => {
|
||||
const newNode = callBack(element, parentNode) || element
|
||||
if (element.children) {
|
||||
eachTree(element.children, callBack, newNode)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造树型结构数据
|
||||
* @param {*} data 数据源
|
||||
* @param {*} id id字段 默认 'id'
|
||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||
* @param {*} children 孩子节点字段 默认 'children'
|
||||
*/
|
||||
export const handleTree = (data: any[], id?: string, parentId?: string, children?: string) => {
|
||||
if (!Array.isArray(data)) {
|
||||
console.warn('data must be an array')
|
||||
return []
|
||||
}
|
||||
const config = {
|
||||
id: id || 'id',
|
||||
parentId: parentId || 'parentId',
|
||||
childrenList: children || 'children'
|
||||
}
|
||||
|
||||
const childrenListMap = {}
|
||||
const nodeIds = {}
|
||||
const tree: any[] = []
|
||||
|
||||
for (const d of data) {
|
||||
const parentId = d[config.parentId]
|
||||
if (childrenListMap[parentId] == null) {
|
||||
childrenListMap[parentId] = []
|
||||
}
|
||||
nodeIds[d[config.id]] = d
|
||||
childrenListMap[parentId].push(d)
|
||||
}
|
||||
|
||||
for (const d of data) {
|
||||
const parentId = d[config.parentId]
|
||||
if (nodeIds[parentId] == null) {
|
||||
tree.push(d)
|
||||
}
|
||||
}
|
||||
|
||||
for (const t of tree) {
|
||||
adaptToChildrenList(t)
|
||||
}
|
||||
|
||||
function adaptToChildrenList(o) {
|
||||
if (childrenListMap[o[config.id]] !== null) {
|
||||
o[config.childrenList] = childrenListMap[o[config.id]]
|
||||
}
|
||||
if (o[config.childrenList]) {
|
||||
for (const c of o[config.childrenList]) {
|
||||
adaptToChildrenList(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tree
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造树型结构数据
|
||||
* @param {*} data 数据源
|
||||
* @param {*} id id字段 默认 'id'
|
||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||
* @param {*} children 孩子节点字段 默认 'children'
|
||||
* @param {*} rootId 根Id 默认 0
|
||||
*/
|
||||
// @ts-ignore
|
||||
export const handleTree2 = (data, id, parentId, children, rootId) => {
|
||||
id = id || 'id'
|
||||
parentId = parentId || 'parentId'
|
||||
// children = children || 'children'
|
||||
rootId =
|
||||
rootId ||
|
||||
Math.min(
|
||||
...data.map((item) => {
|
||||
return item[parentId]
|
||||
})
|
||||
) ||
|
||||
0
|
||||
// 对源数据深度克隆
|
||||
const cloneData = JSON.parse(JSON.stringify(data))
|
||||
// 循环所有项
|
||||
const treeData = cloneData.filter((father) => {
|
||||
const branchArr = cloneData.filter((child) => {
|
||||
// 返回每一项的子级数组
|
||||
return father[id] === child[parentId]
|
||||
})
|
||||
branchArr.length > 0 ? (father.children = branchArr) : ''
|
||||
// 返回第一层
|
||||
return father[parentId] === rootId
|
||||
})
|
||||
return treeData !== '' ? treeData : data
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验选中的节点,是否为指定 level
|
||||
*
|
||||
* @param tree 要操作的树结构数据
|
||||
* @param nodeId 需要判断在什么层级的数据
|
||||
* @param level 检查的级别, 默认检查到二级
|
||||
* @return true 是;false 否
|
||||
*/
|
||||
export const checkSelectedNode = (tree: any[], nodeId: any, level = 2): boolean => {
|
||||
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
||||
console.warn('tree must be an array')
|
||||
return false
|
||||
}
|
||||
|
||||
// 校验是否是一级节点
|
||||
if (tree.some((item) => item.id === nodeId)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 递归计数
|
||||
let count = 1
|
||||
|
||||
// 深层次校验
|
||||
function performAThoroughValidation(arr: any[]): boolean {
|
||||
count += 1
|
||||
for (const item of arr) {
|
||||
if (item.id === nodeId) {
|
||||
return true
|
||||
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
for (const item of tree) {
|
||||
count = 1
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
// 找到后对比是否是期望的层级
|
||||
if (count >= level) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点的完整结构
|
||||
* @param tree 树数据
|
||||
* @param nodeId 节点 id
|
||||
*/
|
||||
export const treeToString = (tree: any[], nodeId) => {
|
||||
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
||||
console.warn('tree must be an array')
|
||||
return ''
|
||||
}
|
||||
// 校验是否是一级节点
|
||||
const node = tree.find((item) => item.id === nodeId)
|
||||
if (typeof node !== 'undefined') {
|
||||
return node.name
|
||||
}
|
||||
let str = ''
|
||||
|
||||
function performAThoroughValidation(arr) {
|
||||
for (const item of arr) {
|
||||
if (item.id === nodeId) {
|
||||
str += ` / ${item.name}`
|
||||
return true
|
||||
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
||||
str += ` / ${item.name}`
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
for (const item of tree) {
|
||||
str = `${item.name}`
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return str
|
||||
}
|
||||
interface TreeHelperConfig {
|
||||
id: string
|
||||
children: string
|
||||
pid: string
|
||||
}
|
||||
|
||||
const DEFAULT_CONFIG: TreeHelperConfig = {
|
||||
id: 'id',
|
||||
children: 'children',
|
||||
pid: 'pid'
|
||||
}
|
||||
export const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
isLeaf: 'leaf',
|
||||
emitPath: false // 用于 cascader 组件:在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
}
|
||||
|
||||
const getConfig = (config: Partial<TreeHelperConfig>) => Object.assign({}, DEFAULT_CONFIG, config)
|
||||
|
||||
// tree from list
|
||||
export const listToTree = <T = any>(list: any[], config: Partial<TreeHelperConfig> = {}): T[] => {
|
||||
const conf = getConfig(config) as TreeHelperConfig
|
||||
const nodeMap = new Map()
|
||||
const result: T[] = []
|
||||
const { id, children, pid } = conf
|
||||
|
||||
for (const node of list) {
|
||||
node[children] = node[children] || []
|
||||
nodeMap.set(node[id], node)
|
||||
}
|
||||
for (const node of list) {
|
||||
const parent = nodeMap.get(node[pid])
|
||||
;(parent ? parent.children : result).push(node)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const treeToList = <T = any>(tree: any, config: Partial<TreeHelperConfig> = {}): T => {
|
||||
config = getConfig(config)
|
||||
const { children } = config
|
||||
const result: any = [...tree]
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
if (!result[i][children!]) continue
|
||||
result.splice(i + 1, 0, ...result[i][children!])
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const findNode = <T = any>(
|
||||
tree: any,
|
||||
func: Fn,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T | null => {
|
||||
config = getConfig(config)
|
||||
const { children } = config
|
||||
const list = [...tree]
|
||||
for (const node of list) {
|
||||
if (func(node)) return node
|
||||
node[children!] && list.push(...node[children!])
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export const findNodeAll = <T = any>(
|
||||
tree: any,
|
||||
func: Fn,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T[] => {
|
||||
config = getConfig(config)
|
||||
const { children } = config
|
||||
const list = [...tree]
|
||||
const result: T[] = []
|
||||
for (const node of list) {
|
||||
func(node) && result.push(node)
|
||||
node[children!] && list.push(...node[children!])
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const findPath = <T = any>(
|
||||
tree: any,
|
||||
func: Fn,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T | T[] | null => {
|
||||
config = getConfig(config)
|
||||
const path: T[] = []
|
||||
const list = [...tree]
|
||||
const visitedSet = new Set()
|
||||
const { children } = config
|
||||
while (list.length) {
|
||||
const node = list[0]
|
||||
if (visitedSet.has(node)) {
|
||||
path.pop()
|
||||
list.shift()
|
||||
} else {
|
||||
visitedSet.add(node)
|
||||
node[children!] && list.unshift(...node[children!])
|
||||
path.push(node)
|
||||
if (func(node)) {
|
||||
return path
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export const findPathAll = (tree: any, func: Fn, config: Partial<TreeHelperConfig> = {}) => {
|
||||
config = getConfig(config)
|
||||
const path: any[] = []
|
||||
const list = [...tree]
|
||||
const result: any[] = []
|
||||
const visitedSet = new Set(),
|
||||
{ children } = config
|
||||
while (list.length) {
|
||||
const node = list[0]
|
||||
if (visitedSet.has(node)) {
|
||||
path.pop()
|
||||
list.shift()
|
||||
} else {
|
||||
visitedSet.add(node)
|
||||
node[children!] && list.unshift(...node[children!])
|
||||
path.push(node)
|
||||
func(node) && result.push([...path])
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export const filter = <T = any>(
|
||||
tree: T[],
|
||||
func: (n: T) => boolean,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T[] => {
|
||||
config = getConfig(config)
|
||||
const children = config.children as string
|
||||
|
||||
function listFilter(list: T[]) {
|
||||
return list
|
||||
.map((node: any) => ({ ...node }))
|
||||
.filter((node) => {
|
||||
node[children] = node[children] && listFilter(node[children])
|
||||
return func(node) || (node[children] && node[children].length)
|
||||
})
|
||||
}
|
||||
|
||||
return listFilter(tree)
|
||||
}
|
||||
export const filterTree = <T = any>(
|
||||
tree: T[],
|
||||
func: (n: T) => boolean,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): T[] => {
|
||||
config = getConfig(config)
|
||||
const children = config.children as string
|
||||
|
||||
function listFilter(list: T[]) {
|
||||
return list
|
||||
.map((node: any) => ({ ...node }))
|
||||
.filter((node) => {
|
||||
// 1. 如果当前节点匹配 → 直接保留【所有子节点】,不再过滤下级
|
||||
if (func(node)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 2. 如果当前节点不匹配,递归过滤子节点
|
||||
if (node[children]) {
|
||||
const filteredChildren = listFilter(node[children]);
|
||||
if (filteredChildren.length > 0) {
|
||||
node[children] = filteredChildren;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 都不匹配,过滤掉
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
return listFilter(tree)
|
||||
}
|
||||
export const forEach = <T = any>(
|
||||
tree: T[],
|
||||
func: (n: T) => any,
|
||||
config: Partial<TreeHelperConfig> = {}
|
||||
): void => {
|
||||
config = getConfig(config)
|
||||
const list: any[] = [...tree]
|
||||
const { children } = config
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
// func 返回true就终止遍历,避免大量节点场景下无意义循环,引起浏览器卡顿
|
||||
if (func(list[i])) {
|
||||
return
|
||||
}
|
||||
children && list[i][children] && list.splice(i + 1, 0, ...list[i][children])
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Extract tree specified structure
|
||||
*/
|
||||
export const treeMap = <T = any>(
|
||||
treeData: T[],
|
||||
opt: { children?: string; conversion: Fn }
|
||||
): T[] => {
|
||||
return treeData.map((item) => treeMapEach(item, opt))
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Extract tree specified structure
|
||||
*/
|
||||
export const treeMapEach = (
|
||||
data: any,
|
||||
{ children = 'children', conversion }: { children?: string; conversion: Fn }
|
||||
) => {
|
||||
const haveChildren = Array.isArray(data[children]) && data[children].length > 0
|
||||
const conversionData = conversion(data) || {}
|
||||
if (haveChildren) {
|
||||
return {
|
||||
...conversionData,
|
||||
[children]: data[children].map((i: number) =>
|
||||
treeMapEach(i, {
|
||||
children,
|
||||
conversion
|
||||
})
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
...conversionData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归遍历树结构
|
||||
* @param treeDatas 树
|
||||
* @param callBack 回调
|
||||
* @param parentNode 父节点
|
||||
*/
|
||||
export const eachTree = (treeDatas: any[], callBack: Fn, parentNode = {}) => {
|
||||
treeDatas.forEach((element) => {
|
||||
const newNode = callBack(element, parentNode) || element
|
||||
if (element.children) {
|
||||
eachTree(element.children, callBack, newNode)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造树型结构数据
|
||||
* @param {*} data 数据源
|
||||
* @param {*} id id字段 默认 'id'
|
||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||
* @param {*} children 孩子节点字段 默认 'children'
|
||||
*/
|
||||
export const handleTree = (data: any[], id?: string, parentId?: string, children?: string) => {
|
||||
if (!Array.isArray(data)) {
|
||||
console.warn('data must be an array')
|
||||
return []
|
||||
}
|
||||
const config = {
|
||||
id: id || 'id',
|
||||
parentId: parentId || 'parentId',
|
||||
childrenList: children || 'children'
|
||||
}
|
||||
|
||||
const childrenListMap = {}
|
||||
const nodeIds = {}
|
||||
const tree: any[] = []
|
||||
|
||||
for (const d of data) {
|
||||
const parentId = d[config.parentId]
|
||||
if (childrenListMap[parentId] == null) {
|
||||
childrenListMap[parentId] = []
|
||||
}
|
||||
nodeIds[d[config.id]] = d
|
||||
childrenListMap[parentId].push(d)
|
||||
}
|
||||
|
||||
for (const d of data) {
|
||||
const parentId = d[config.parentId]
|
||||
if (nodeIds[parentId] == null) {
|
||||
tree.push(d)
|
||||
}
|
||||
}
|
||||
|
||||
for (const t of tree) {
|
||||
adaptToChildrenList(t)
|
||||
}
|
||||
|
||||
function adaptToChildrenList(o) {
|
||||
if (childrenListMap[o[config.id]] !== null) {
|
||||
o[config.childrenList] = childrenListMap[o[config.id]]
|
||||
}
|
||||
if (o[config.childrenList]) {
|
||||
for (const c of o[config.childrenList]) {
|
||||
adaptToChildrenList(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tree
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造树型结构数据
|
||||
* @param {*} data 数据源
|
||||
* @param {*} id id字段 默认 'id'
|
||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||
* @param {*} children 孩子节点字段 默认 'children'
|
||||
* @param {*} rootId 根Id 默认 0
|
||||
*/
|
||||
// @ts-ignore
|
||||
export const handleTree2 = (data, id, parentId, children, rootId) => {
|
||||
id = id || 'id'
|
||||
parentId = parentId || 'parentId'
|
||||
// children = children || 'children'
|
||||
rootId =
|
||||
rootId ||
|
||||
Math.min(
|
||||
...data.map((item) => {
|
||||
return item[parentId]
|
||||
})
|
||||
) ||
|
||||
0
|
||||
// 对源数据深度克隆
|
||||
const cloneData = JSON.parse(JSON.stringify(data))
|
||||
// 循环所有项
|
||||
const treeData = cloneData.filter((father) => {
|
||||
const branchArr = cloneData.filter((child) => {
|
||||
// 返回每一项的子级数组
|
||||
return father[id] === child[parentId]
|
||||
})
|
||||
branchArr.length > 0 ? (father.children = branchArr) : ''
|
||||
// 返回第一层
|
||||
return father[parentId] === rootId
|
||||
})
|
||||
return treeData !== '' ? treeData : data
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验选中的节点,是否为指定 level
|
||||
*
|
||||
* @param tree 要操作的树结构数据
|
||||
* @param nodeId 需要判断在什么层级的数据
|
||||
* @param level 检查的级别, 默认检查到二级
|
||||
* @return true 是;false 否
|
||||
*/
|
||||
export const checkSelectedNode = (tree: any[], nodeId: any, level = 2): boolean => {
|
||||
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
||||
console.warn('tree must be an array')
|
||||
return false
|
||||
}
|
||||
|
||||
// 校验是否是一级节点
|
||||
if (tree.some((item) => item.id === nodeId)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 递归计数
|
||||
let count = 1
|
||||
|
||||
// 深层次校验
|
||||
function performAThoroughValidation(arr: any[]): boolean {
|
||||
count += 1
|
||||
for (const item of arr) {
|
||||
if (item.id === nodeId) {
|
||||
return true
|
||||
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
for (const item of tree) {
|
||||
count = 1
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
// 找到后对比是否是期望的层级
|
||||
if (count >= level) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点的完整结构
|
||||
* @param tree 树数据
|
||||
* @param nodeId 节点 id
|
||||
*/
|
||||
export const treeToString = (tree: any[], nodeId) => {
|
||||
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
||||
console.warn('tree must be an array')
|
||||
return ''
|
||||
}
|
||||
// 校验是否是一级节点
|
||||
const node = tree.find((item) => item.id === nodeId)
|
||||
if (typeof node !== 'undefined') {
|
||||
return node.name
|
||||
}
|
||||
let str = ''
|
||||
|
||||
function performAThoroughValidation(arr) {
|
||||
for (const item of arr) {
|
||||
if (item.id === nodeId) {
|
||||
str += ` / ${item.name}`
|
||||
return true
|
||||
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
||||
str += ` / ${item.name}`
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
for (const item of tree) {
|
||||
str = `${item.name}`
|
||||
if (performAThoroughValidation(item.children)) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
42
src/utils/waveCache.ts
Normal file
42
src/utils/waveCache.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
const MAX_CACHE_SIZE = 30
|
||||
|
||||
const cache = new Map<string, unknown>()
|
||||
|
||||
function dataFingerprint(data: unknown[][] | undefined): string {
|
||||
if (!data?.length) return '0'
|
||||
const first = data[0]
|
||||
const last = data[data.length - 1]
|
||||
return `${data.length}:${first?.[0]}:${last?.[0]}`
|
||||
}
|
||||
|
||||
export function buildWaveCacheKey(
|
||||
type: 'shu' | 'rms',
|
||||
wp: Record<string, any> | undefined,
|
||||
value: number,
|
||||
isOpen: boolean,
|
||||
boxoList: Record<string, any>
|
||||
): string {
|
||||
if (!wp) return ''
|
||||
const waveFp =
|
||||
type === 'shu' ? dataFingerprint(wp.listWaveData) : dataFingerprint(wp.listRmsData)
|
||||
const boxoFp = boxoList?.startTime ?? boxoList?.lineName ?? boxoList?.equipmentName ?? ''
|
||||
return `${type}|${wp.time}|${wp.waveType}|${wp.iphasic}|${value}|${isOpen}|${waveFp}|${boxoFp}`
|
||||
}
|
||||
|
||||
export function getWaveCache<T>(key: string): T | null {
|
||||
if (!key || !cache.has(key)) return null
|
||||
const value = cache.get(key) as T
|
||||
cache.delete(key)
|
||||
cache.set(key, value)
|
||||
return value
|
||||
}
|
||||
|
||||
export function setWaveCache(key: string, value: unknown): void {
|
||||
if (!key) return
|
||||
if (cache.has(key)) cache.delete(key)
|
||||
cache.set(key, value)
|
||||
while (cache.size > MAX_CACHE_SIZE) {
|
||||
const oldest = cache.keys().next().value
|
||||
if (oldest !== undefined) cache.delete(oldest)
|
||||
}
|
||||
}
|
||||
96
src/utils/waveWorkerPool.ts
Normal file
96
src/utils/waveWorkerPool.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
import { toRaw } from 'vue'
|
||||
|
||||
type WorkerMessageHandler = (data: any) => void
|
||||
|
||||
let shuWorker: Worker | null = null
|
||||
let rmsWorker: Worker | null = null
|
||||
|
||||
/** 递归剥离 Vue 响应式代理,得到可 structuredClone 的纯对象 */
|
||||
export function toPlainDeep<T>(value: T): T {
|
||||
const raw = toRaw(value as object) as T
|
||||
if (Array.isArray(raw)) {
|
||||
return raw.map(item => toPlainDeep(item)) as T
|
||||
}
|
||||
if (raw !== null && typeof raw === 'object') {
|
||||
const out: Record<string, unknown> = {}
|
||||
for (const [key, val] of Object.entries(raw)) {
|
||||
out[key] = toPlainDeep(val)
|
||||
}
|
||||
return out as T
|
||||
}
|
||||
return raw
|
||||
}
|
||||
|
||||
const BOXO_LIST_KEYS = [
|
||||
'systemType',
|
||||
'powerStationName',
|
||||
'measurementPointName',
|
||||
'startTime',
|
||||
'featureAmplitude',
|
||||
'duration',
|
||||
'engineeringName',
|
||||
'equipmentName',
|
||||
'evtParamVVaDepth',
|
||||
'evtParamTm',
|
||||
'lineName',
|
||||
'persistTime',
|
||||
'subName'
|
||||
] as const
|
||||
|
||||
export function buildWorkerPayload(
|
||||
type: 'shu' | 'rms',
|
||||
wp: Record<string, any>,
|
||||
boxoList: Record<string, any>,
|
||||
extras: { requestId: number; value: number; isOpen: boolean; iphasic?: number }
|
||||
) {
|
||||
const plainWp = toPlainDeep(wp)
|
||||
const wpPayload: Record<string, unknown> = {
|
||||
pt: plainWp.pt,
|
||||
ct: plainWp.ct,
|
||||
waveTitle: plainWp.waveTitle,
|
||||
iphasic: plainWp.iphasic,
|
||||
time: plainWp.time,
|
||||
waveType: plainWp.waveType,
|
||||
yzd: plainWp.yzd
|
||||
}
|
||||
if (type === 'shu') {
|
||||
wpPayload.listWaveData = plainWp.listWaveData
|
||||
} else {
|
||||
wpPayload.listRmsData = plainWp.listRmsData
|
||||
}
|
||||
|
||||
const plainBoxo: Record<string, unknown> = {}
|
||||
const rawBoxo = toPlainDeep(boxoList)
|
||||
for (const key of BOXO_LIST_KEYS) {
|
||||
if (rawBoxo[key] !== undefined) {
|
||||
plainBoxo[key] = rawBoxo[key]
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
requestId: extras.requestId,
|
||||
value: extras.value,
|
||||
isOpen: extras.isOpen,
|
||||
iphasic: extras.iphasic,
|
||||
wp: wpPayload,
|
||||
boxoList: plainBoxo
|
||||
}
|
||||
}
|
||||
|
||||
export function getShuWorker(onMessage: WorkerMessageHandler): Worker {
|
||||
if (!shuWorker) {
|
||||
shuWorker = new Worker(new URL('../components/echarts/shuWorker.js', import.meta.url))
|
||||
}
|
||||
shuWorker.onmessage = e => onMessage(e.data)
|
||||
shuWorker.onerror = error => console.error('Shu worker error:', error)
|
||||
return shuWorker
|
||||
}
|
||||
|
||||
export function getRmsWorker(onMessage: WorkerMessageHandler): Worker {
|
||||
if (!rmsWorker) {
|
||||
rmsWorker = new Worker(new URL('../components/echarts/rmsWorker.js', import.meta.url))
|
||||
}
|
||||
rmsWorker.onmessage = e => onMessage(e.data)
|
||||
rmsWorker.onerror = error => console.error('Rms worker error:', error)
|
||||
return rmsWorker
|
||||
}
|
||||
@@ -43,13 +43,11 @@ export default class SocketService {
|
||||
console.log('您的浏览器不支持WebSocket')
|
||||
return
|
||||
}
|
||||
|
||||
console.log("🚀 ~ SocketService ~ connect ~ url:", url)
|
||||
if (url === null || (typeof url === 'string' && url.includes('null'))) return;
|
||||
|
||||
setTimeout(() => {
|
||||
// ws://192.168.1.69:10407/mgtt
|
||||
// const url =
|
||||
// (localStorage.getItem('WebSocketUrl') == 'null'
|
||||
// ? 'ws://192.168.1.130:10405'
|
||||
// : localStorage.getItem('WebSocketUrl')) + id
|
||||
this.ws = new WebSocket(url)
|
||||
|
||||
this.ws.onopen = () => this.handleOpen()
|
||||
@@ -58,10 +56,9 @@ export default class SocketService {
|
||||
this.ws.onmessage = event => this.handleMessage(event)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
// 处理连接成功事件
|
||||
private handleOpen(): void {
|
||||
ElMessage.success('webSocket连接服务端成功了')
|
||||
// ElMessage.success('webSocket连接服务端成功了')
|
||||
console.log('连接服务端成功了')
|
||||
this.connected = true
|
||||
this.connectRetryCount = 0
|
||||
@@ -90,7 +87,7 @@ export default class SocketService {
|
||||
|
||||
if (event.data == '连接成功') {
|
||||
this.sendHeartbeat()
|
||||
} else if (event.data == 'connect') {
|
||||
} else if (event.data == 'over') {
|
||||
} else if (event.data.length > 10) {
|
||||
let message: MessageType
|
||||
try {
|
||||
@@ -104,7 +101,7 @@ export default class SocketService {
|
||||
|
||||
// 通过接受服务端发送的type字段来回调函数
|
||||
|
||||
if ((message.key || message.code) && this.callBackMapping['message']) {
|
||||
if ((message.key || message.code || message.time) && this.callBackMapping['message']) {
|
||||
this.callBackMapping['message']!(message)
|
||||
} else {
|
||||
console.log('抛弃====>')
|
||||
@@ -112,6 +109,8 @@ export default class SocketService {
|
||||
// 丢弃或继续写你的逻辑
|
||||
}
|
||||
} else {
|
||||
this.callBackMapping['message']!({ Flag: false })
|
||||
if(event.data == 'connect')return
|
||||
ElMessage.error(event.data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,423 +1,423 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader datePicker theCurrentTime area ref="header">
|
||||
<!-- <template v-slot:select>
|
||||
|
||||
</template> -->
|
||||
</TableHeader>
|
||||
<div v-loading="tableStore.table.loading">
|
||||
<el-row :gutter="10" class="pd10">
|
||||
<el-col :span="11" style="position: relative">
|
||||
<el-card>
|
||||
<el-radio-group
|
||||
v-model="tableStore.table.params.type"
|
||||
class="group"
|
||||
@change="tableStore.index()"
|
||||
>
|
||||
<el-radio-button label="风电场" value="1" />
|
||||
<el-radio-button label="光伏电站" value="2" />
|
||||
</el-radio-group>
|
||||
<MyEchartMap
|
||||
ref="EchartMap"
|
||||
:options="echartMapList"
|
||||
class="map"
|
||||
@eliminate="eliminate"
|
||||
@getRegionByRegion="getRegionByRegion"
|
||||
@clickMap="clickMap"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>暂降列表</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- <h3 class="mb10">暂降列表</h3> -->
|
||||
<div class="tall1">
|
||||
<vxe-table
|
||||
height="auto"
|
||||
auto-resize
|
||||
:data="distributionData"
|
||||
v-loading="loading"
|
||||
v-bind="defaultAttribute"
|
||||
>
|
||||
<vxe-column
|
||||
field="newStationName"
|
||||
title="新能源站名称"
|
||||
min-width="150px"
|
||||
show-overflow-tooltip
|
||||
></vxe-column>
|
||||
<vxe-column field="startTime" title="暂降发生时刻" min-width="150px"></vxe-column>
|
||||
<vxe-column
|
||||
field="featureAmplitude"
|
||||
title="暂降(骤升)幅值(%)"
|
||||
sortable
|
||||
min-width="150px"
|
||||
></vxe-column>
|
||||
<vxe-column
|
||||
field="advanceReason"
|
||||
title="暂降原因"
|
||||
sortable
|
||||
:formatter="formFilter"
|
||||
min-width="100px"
|
||||
></vxe-column>
|
||||
<vxe-column field="severity" title="严重度" min-width="100px" sortable></vxe-column>
|
||||
<vxe-column title="操作" width="80px">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="row.wavePath != null"
|
||||
size="small"
|
||||
link
|
||||
@click="boxi(row)"
|
||||
>
|
||||
查看波形
|
||||
</el-button>
|
||||
<el-button v-else disabled size="small" link>暂无波形</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>暂降波形</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="tall" v-loading="loading1">
|
||||
<!-- <h3 class="mb10">暂降波形</h3> -->
|
||||
<div v-if="wp != null">
|
||||
<rmsboxi :value="1" :height="height" :boxoList="boxoList" :wp="wp" />
|
||||
</div>
|
||||
<el-empty v-else description="暂无数据" class="custom-empty" />
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import MyEchartMap from '@/components/echarts/MyEchartMap.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { voltageRideThroughEventQueryPage } from '@/api/event-boot/highAndLowPressure'
|
||||
import { getMonitorEventAnalyseWave, getTransientDetailById } from '@/api/event-boot/transient'
|
||||
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { FormItem } from 'vxe-table'
|
||||
defineOptions({
|
||||
name: 'newEnergy/highAndLowPressure'
|
||||
})
|
||||
const EchartMap = ref()
|
||||
const dictData = useDictData()
|
||||
const reason = dictData.getBasicData('Event_Reason')
|
||||
const triggerType = dictData.getBasicData('Event_Statis')
|
||||
const echartMapList: any = ref({})
|
||||
const header = ref()
|
||||
const distributionData: any = ref([])
|
||||
const loading = ref(false)
|
||||
const loading1 = ref(false)
|
||||
const boxoList = ref(null)
|
||||
const wp = ref(null)
|
||||
const tableStore = new TableStore({
|
||||
url: '/event-boot/voltageRideThrough/view',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.areaId = tableStore.table.params.deptIndex
|
||||
},
|
||||
loadCallback: () => {
|
||||
// 处理地图数据
|
||||
map(tableStore.table.data)
|
||||
// tabulation(tableStore.table.data)
|
||||
EchartMap.value.GetEchar(header.value.areaRef.areaName)
|
||||
if (tableStore.table.data.length > 0) {
|
||||
tabulation({ data: tableStore.table.data[0], seriesName: '高压' })
|
||||
}
|
||||
}
|
||||
})
|
||||
const height = mainHeight(200, 2).height
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.type = '1'
|
||||
|
||||
// 地图点击事件
|
||||
const getRegionByRegion = (list: any) => {
|
||||
tableStore.table.params.deptIndex = list.id
|
||||
tableStore.onTableAction('search', {})
|
||||
}
|
||||
// 消除点
|
||||
const eliminate = (name: string) => {
|
||||
echartMapList.value.options.series = []
|
||||
EchartMap.value.GetEchar(name)
|
||||
}
|
||||
|
||||
// 地图数处理
|
||||
const map = (res: any) => {
|
||||
echartMapList.value = {
|
||||
title: {
|
||||
text: '高/低电压穿越'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function (params) {
|
||||
if (params.seriesType == 'bar3D') {
|
||||
return [params.seriesName, params.name + ':' + params.value[2] + (params.value[3] || '')].join(
|
||||
'<br />'
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
legend: {
|
||||
selectedMode: false
|
||||
},
|
||||
geo3D: {
|
||||
show: true,
|
||||
// name: '浙江',
|
||||
itemStyle: {
|
||||
color: getComputedStyle(document.documentElement).getPropertyValue('--el-color-primary-light-3'),
|
||||
borderWidth: 1,
|
||||
borderColor: '#fff'
|
||||
},
|
||||
emphasis: {
|
||||
label: { show: true, fontSize: 16 },
|
||||
itemStyle: {
|
||||
color: getComputedStyle(document.documentElement).getPropertyValue('--el-color-primary-light-7')
|
||||
}
|
||||
},
|
||||
viewControl: {
|
||||
alpha: 60,
|
||||
distance: 120,
|
||||
panMouseButton: 'right', //平移操作使用的鼠标按键
|
||||
rotateMouseButton: 'left' //旋转操作使用的鼠标按键
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
color: '#000',
|
||||
fontSize: 14,
|
||||
distance: 0,
|
||||
textStyle: {
|
||||
color: '#000',
|
||||
backgroundColor: '#000'
|
||||
}
|
||||
},
|
||||
|
||||
data: [
|
||||
{ name: '低压', field: 'lowPressure', unit: '次' },
|
||||
{ name: '高压', field: 'highPressure', unit: '次' }
|
||||
]
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
name: '低压',
|
||||
type: 'bar3D',
|
||||
coordinateSystem: 'geo3D',
|
||||
shading: 'lambert',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
formatter: params => {
|
||||
return params.value[2]
|
||||
}
|
||||
},
|
||||
|
||||
data:
|
||||
res.length == 0
|
||||
? []
|
||||
: res.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
value: [item.lng, item.lat, item.lowPressure || 0]
|
||||
}
|
||||
}),
|
||||
// data:[],
|
||||
barSize: 1,
|
||||
minHeight: 1,
|
||||
itemStyle: {
|
||||
color: '#77DA63'
|
||||
},
|
||||
emphasis: {
|
||||
label: { show: true }
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '高压',
|
||||
type: 'bar3D',
|
||||
coordinateSystem: 'geo3D',
|
||||
shading: 'lambert',
|
||||
label: {
|
||||
show: true,
|
||||
// position: 'top',
|
||||
formatter: params => {
|
||||
return params.value[2]
|
||||
}
|
||||
},
|
||||
|
||||
data:
|
||||
res.length == 0
|
||||
? []
|
||||
: res.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
value: [item.lng - 0.1, item.lat, item.highPressure || 0]
|
||||
}
|
||||
}),
|
||||
// [
|
||||
|
||||
// {
|
||||
// adcode: 330400,
|
||||
// name: '大连',
|
||||
|
||||
// wcs: 10,
|
||||
// mbs: 40,
|
||||
// wcl: 100,
|
||||
// value: [121.67391, 38.947468, 40, '']
|
||||
// }
|
||||
// ],
|
||||
barSize: 1,
|
||||
minHeight: 1,
|
||||
itemStyle: {
|
||||
color: '#FFBF00'
|
||||
},
|
||||
emphasis: {
|
||||
label: { show: true }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 点击地图
|
||||
const clickMap = (e: any) => {
|
||||
tabulation(e)
|
||||
}
|
||||
// 表格数据处理
|
||||
const tabulation = (e: any) => {
|
||||
console.log()
|
||||
|
||||
loading.value = true
|
||||
voltageRideThroughEventQueryPage({
|
||||
...tableStore.table.params,
|
||||
areaId: e.data.id,
|
||||
frequencyType:
|
||||
e.seriesName == '高压'
|
||||
? triggerType.filter(item => item.code == 'Voltage_Rise')[0].id
|
||||
: triggerType.filter(item => item.code == 'Voltage_Dip')[0].id
|
||||
})
|
||||
.then(res => {
|
||||
distributionData.value = res.data
|
||||
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
if (res.data[i].wavePath != null) {
|
||||
boxi(res.data[i])
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// res.data.forEach((item: any) => {
|
||||
// if (item.wavePath != null) {
|
||||
// boxi(item)
|
||||
// return
|
||||
// }
|
||||
// })
|
||||
// 。wavePath
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const formFilter = (row: any) => {
|
||||
if (row.column.property == 'advanceReason') {
|
||||
let title = ''
|
||||
reason.forEach(item => {
|
||||
if (item.id == row.row.advanceReason) {
|
||||
title = item.name
|
||||
} else if (row.row.advanceReason == null || row.row.advanceReason == '') {
|
||||
title = '/'
|
||||
}
|
||||
})
|
||||
return title
|
||||
} else {
|
||||
return row.row[row.column.property]
|
||||
}
|
||||
}
|
||||
// 查看波形数据
|
||||
const boxi = async (row: any) => {
|
||||
loading1.value = true
|
||||
wp.value = null
|
||||
await getTransientDetailById({
|
||||
eventId: row.eventId,
|
||||
sysType: 0,
|
||||
smallType: 0
|
||||
}).then(res => {
|
||||
boxoList.value = res.data
|
||||
})
|
||||
|
||||
await getMonitorEventAnalyseWave({
|
||||
id: row.eventId,
|
||||
systemType: 0,
|
||||
type: 0
|
||||
}).then(res => {
|
||||
if (res != undefined) {
|
||||
wp.value = res.data
|
||||
}
|
||||
loading1.value = false
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const layout = mainHeight(83) as any
|
||||
const layout1 = mainHeight(93) as any
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.map {
|
||||
height: calc(v-bind('layout1.height') - 30px);
|
||||
}
|
||||
.tall {
|
||||
height: calc((v-bind('layout1.height') - 100px) / 2);
|
||||
}
|
||||
.tall1 {
|
||||
height: calc((v-bind('layout1.height') - 100px) / 2 - 50px);
|
||||
}
|
||||
|
||||
.group {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 20px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 10px;
|
||||
}
|
||||
/* 自定义 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">
|
||||
<TableHeader datePicker theCurrentTime area ref="header">
|
||||
<!-- <template v-slot:select>
|
||||
|
||||
</template> -->
|
||||
</TableHeader>
|
||||
<div v-loading="tableStore.table.loading">
|
||||
<el-row :gutter="10" class="pd10">
|
||||
<el-col :span="11" style="position: relative">
|
||||
<el-card>
|
||||
<el-radio-group
|
||||
v-model="tableStore.table.params.type"
|
||||
class="group"
|
||||
@change="tableStore.index()"
|
||||
>
|
||||
<el-radio-button label="风电场" value="1" />
|
||||
<el-radio-button label="光伏电站" value="2" />
|
||||
</el-radio-group>
|
||||
<MyEchartMap
|
||||
ref="EchartMap"
|
||||
:options="echartMapList"
|
||||
class="map"
|
||||
@eliminate="eliminate"
|
||||
@getRegionByRegion="getRegionByRegion"
|
||||
@clickMap="clickMap"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="13">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>暂降列表</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- <h3 class="mb10">暂降列表</h3> -->
|
||||
<div class="tall1">
|
||||
<vxe-table
|
||||
height="auto"
|
||||
auto-resize
|
||||
:data="distributionData"
|
||||
v-loading="loading"
|
||||
v-bind="defaultAttribute"
|
||||
>
|
||||
<vxe-column
|
||||
field="newStationName"
|
||||
title="新能源站名称"
|
||||
min-width="150px"
|
||||
show-overflow-tooltip
|
||||
></vxe-column>
|
||||
<vxe-column field="startTime" title="暂降发生时刻" min-width="180px" sortable></vxe-column>
|
||||
<vxe-column
|
||||
field="featureAmplitude"
|
||||
title="暂降(骤升)幅值(%)"
|
||||
sortable
|
||||
min-width="160px"
|
||||
></vxe-column>
|
||||
<vxe-column
|
||||
field="advanceReason"
|
||||
title="暂降原因"
|
||||
sortable
|
||||
:formatter="formFilter"
|
||||
min-width="100px"
|
||||
></vxe-column>
|
||||
<vxe-column field="severity" title="严重度" min-width="100px" sortable></vxe-column>
|
||||
<vxe-column title="操作" width="80px">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="row.wavePath != null"
|
||||
size="small"
|
||||
link
|
||||
@click="boxi(row)"
|
||||
>
|
||||
查看波形
|
||||
</el-button>
|
||||
<el-button v-else disabled size="small" link>暂无波形</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>暂降波形</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="tall" v-loading="loading1">
|
||||
<!-- <h3 class="mb10">暂降波形</h3> -->
|
||||
<div v-if="wp != null">
|
||||
<rmsboxi :value="1" :height="height" :boxoList="boxoList" :wp="wp" />
|
||||
</div>
|
||||
<el-empty v-else description="暂无数据" class="custom-empty" />
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import MyEchartMap from '@/components/echarts/MyEchartMap.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { voltageRideThroughEventQueryPage } from '@/api/event-boot/highAndLowPressure'
|
||||
import { getMonitorEventAnalyseWave, getTransientDetailById } from '@/api/event-boot/transient'
|
||||
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { FormItem } from 'vxe-table'
|
||||
defineOptions({
|
||||
name: 'newEnergy/highAndLowPressure'
|
||||
})
|
||||
const EchartMap = ref()
|
||||
const dictData = useDictData()
|
||||
const reason = dictData.getBasicData('Event_Reason')
|
||||
const triggerType = dictData.getBasicData('Event_Statis')
|
||||
const echartMapList: any = ref({})
|
||||
const header = ref()
|
||||
const distributionData: any = ref([])
|
||||
const loading = ref(false)
|
||||
const loading1 = ref(false)
|
||||
const boxoList = ref(null)
|
||||
const wp = ref(null)
|
||||
const tableStore = new TableStore({
|
||||
url: '/event-boot/voltageRideThrough/view',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.areaId = tableStore.table.params.deptIndex
|
||||
},
|
||||
loadCallback: () => {
|
||||
// 处理地图数据
|
||||
map(tableStore.table.data)
|
||||
// tabulation(tableStore.table.data)
|
||||
EchartMap.value.GetEchar(header.value.areaRef.areaName)
|
||||
if (tableStore.table.data.length > 0) {
|
||||
tabulation({ data: tableStore.table.data[0], seriesName: '高压' })
|
||||
}
|
||||
}
|
||||
})
|
||||
const height = mainHeight(200, 2).height
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.type = '1'
|
||||
|
||||
// 地图点击事件
|
||||
const getRegionByRegion = (list: any) => {
|
||||
tableStore.table.params.deptIndex = list.id
|
||||
tableStore.onTableAction('search', {})
|
||||
}
|
||||
// 消除点
|
||||
const eliminate = (name: string) => {
|
||||
echartMapList.value.options.series = []
|
||||
EchartMap.value.GetEchar(name)
|
||||
}
|
||||
|
||||
// 地图数处理
|
||||
const map = (res: any) => {
|
||||
echartMapList.value = {
|
||||
title: {
|
||||
text: '高/低电压穿越'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function (params) {
|
||||
if (params.seriesType == 'bar3D') {
|
||||
return [params.seriesName, params.name + ':' + params.value[2] + (params.value[3] || '')].join(
|
||||
'<br />'
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
legend: {
|
||||
selectedMode: false
|
||||
},
|
||||
geo3D: {
|
||||
show: true,
|
||||
// name: '浙江',
|
||||
itemStyle: {
|
||||
color: getComputedStyle(document.documentElement).getPropertyValue('--el-color-primary-light-3'),
|
||||
borderWidth: 1,
|
||||
borderColor: '#fff'
|
||||
},
|
||||
emphasis: {
|
||||
label: { show: true, fontSize: 16 },
|
||||
itemStyle: {
|
||||
color: getComputedStyle(document.documentElement).getPropertyValue('--el-color-primary-light-7')
|
||||
}
|
||||
},
|
||||
viewControl: {
|
||||
alpha: 60,
|
||||
distance: 120,
|
||||
panMouseButton: 'right', //平移操作使用的鼠标按键
|
||||
rotateMouseButton: 'left' //旋转操作使用的鼠标按键
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
color: '#000',
|
||||
fontSize: 14,
|
||||
distance: 0,
|
||||
textStyle: {
|
||||
color: '#000',
|
||||
backgroundColor: '#000'
|
||||
}
|
||||
},
|
||||
|
||||
data: [
|
||||
{ name: '低压', field: 'lowPressure', unit: '次' },
|
||||
{ name: '高压', field: 'highPressure', unit: '次' }
|
||||
]
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
name: '低压',
|
||||
type: 'bar3D',
|
||||
coordinateSystem: 'geo3D',
|
||||
shading: 'lambert',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
formatter: params => {
|
||||
return params.value[2]
|
||||
}
|
||||
},
|
||||
|
||||
data:
|
||||
res.length == 0
|
||||
? []
|
||||
: res.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
value: [item.lng, item.lat, item.lowPressure || 0]
|
||||
}
|
||||
}),
|
||||
// data:[],
|
||||
barSize: 1,
|
||||
minHeight: 1,
|
||||
itemStyle: {
|
||||
color: '#77DA63'
|
||||
},
|
||||
emphasis: {
|
||||
label: { show: true }
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '高压',
|
||||
type: 'bar3D',
|
||||
coordinateSystem: 'geo3D',
|
||||
shading: 'lambert',
|
||||
label: {
|
||||
show: true,
|
||||
// position: 'top',
|
||||
formatter: params => {
|
||||
return params.value[2]
|
||||
}
|
||||
},
|
||||
|
||||
data:
|
||||
res.length == 0
|
||||
? []
|
||||
: res.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
value: [item.lng - 0.1, item.lat, item.highPressure || 0]
|
||||
}
|
||||
}),
|
||||
// [
|
||||
|
||||
// {
|
||||
// adcode: 330400,
|
||||
// name: '大连',
|
||||
|
||||
// wcs: 10,
|
||||
// mbs: 40,
|
||||
// wcl: 100,
|
||||
// value: [121.67391, 38.947468, 40, '']
|
||||
// }
|
||||
// ],
|
||||
barSize: 1,
|
||||
minHeight: 1,
|
||||
itemStyle: {
|
||||
color: '#FFBF00'
|
||||
},
|
||||
emphasis: {
|
||||
label: { show: true }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 点击地图
|
||||
const clickMap = (e: any) => {
|
||||
tabulation(e)
|
||||
}
|
||||
// 表格数据处理
|
||||
const tabulation = (e: any) => {
|
||||
console.log()
|
||||
|
||||
loading.value = true
|
||||
voltageRideThroughEventQueryPage({
|
||||
...tableStore.table.params,
|
||||
areaId: e.data.id,
|
||||
frequencyType:
|
||||
e.seriesName == '高压'
|
||||
? triggerType.filter(item => item.code == 'Voltage_Rise')[0].id
|
||||
: triggerType.filter(item => item.code == 'Voltage_Dip')[0].id
|
||||
})
|
||||
.then(res => {
|
||||
distributionData.value = res.data
|
||||
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
if (res.data[i].wavePath != null) {
|
||||
boxi(res.data[i])
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// res.data.forEach((item: any) => {
|
||||
// if (item.wavePath != null) {
|
||||
// boxi(item)
|
||||
// return
|
||||
// }
|
||||
// })
|
||||
// 。wavePath
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const formFilter = (row: any) => {
|
||||
if (row.column.property == 'advanceReason') {
|
||||
let title = ''
|
||||
reason.forEach(item => {
|
||||
if (item.id == row.row.advanceReason) {
|
||||
title = item.name
|
||||
} else if (row.row.advanceReason == null || row.row.advanceReason == '') {
|
||||
title = '/'
|
||||
}
|
||||
})
|
||||
return title
|
||||
} else {
|
||||
return row.row[row.column.property]
|
||||
}
|
||||
}
|
||||
// 查看波形数据
|
||||
const boxi = async (row: any) => {
|
||||
loading1.value = true
|
||||
wp.value = null
|
||||
await getTransientDetailById({
|
||||
eventId: row.eventId,
|
||||
sysType: 0,
|
||||
smallType: 0
|
||||
}).then(res => {
|
||||
boxoList.value = res.data
|
||||
})
|
||||
|
||||
await getMonitorEventAnalyseWave({
|
||||
id: row.eventId,
|
||||
systemType: 0,
|
||||
type: 0
|
||||
}).then(res => {
|
||||
if (res != undefined) {
|
||||
wp.value = res.data
|
||||
}
|
||||
loading1.value = false
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const layout = mainHeight(83) as any
|
||||
const layout1 = mainHeight(93) as any
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.map {
|
||||
height: calc(v-bind('layout1.height') - 30px);
|
||||
}
|
||||
.tall {
|
||||
height: calc((v-bind('layout1.height') - 100px) / 2);
|
||||
}
|
||||
.tall1 {
|
||||
height: calc((v-bind('layout1.height') - 100px) / 2 - 50px);
|
||||
}
|
||||
|
||||
.group {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 20px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 10px;
|
||||
}
|
||||
/* 自定义 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>
|
||||
|
||||
@@ -90,7 +90,6 @@ const loading = ref(false)
|
||||
const statistics = ref()
|
||||
|
||||
const flg = ref(true)
|
||||
const showMqtt = ref(false)
|
||||
const zoom = ref('') //图表焦点校验
|
||||
|
||||
const resultList = ref([
|
||||
|
||||
@@ -1107,7 +1107,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
class="form-item"
|
||||
label="测量点性质:"
|
||||
label="电网标志:"
|
||||
:prop="
|
||||
'deviceParam.' +
|
||||
[deviceIndex] +
|
||||
@@ -1119,14 +1119,14 @@
|
||||
"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择测量点性质',
|
||||
message: '请选择电网标志',
|
||||
trigger: 'blur'
|
||||
}"
|
||||
>
|
||||
<el-select
|
||||
filterable
|
||||
v-model="lineItem.powerFlag"
|
||||
placeholder="请选择测量点性质"
|
||||
placeholder="请选择电网标志"
|
||||
:disabled="pageStatus == 1"
|
||||
@change="lineItem.objId = ''"
|
||||
>
|
||||
@@ -1140,14 +1140,15 @@
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
class="form-item"
|
||||
label="用户名称:"
|
||||
label="监测对象名称:"
|
||||
v-if="lineItem.powerFlag == 1"
|
||||
>
|
||||
<el-select
|
||||
filterable
|
||||
v-model="lineItem.objId"
|
||||
placeholder="请选择用户名称"
|
||||
placeholder="请选择对象名称"
|
||||
:disabled="pageStatus == 1"
|
||||
@change="(val) => handleSelect(lineItem, val)"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
@@ -1355,7 +1356,7 @@
|
||||
lIndex +
|
||||
'.bigObjType'
|
||||
"
|
||||
:rules="{ required: true, message: '请选择对象大类', trigger: 'blur' }"
|
||||
|
||||
>
|
||||
<el-select
|
||||
filterable
|
||||
@@ -1384,7 +1385,7 @@
|
||||
lIndex +
|
||||
'.smallObjType'
|
||||
"
|
||||
:rules="{ required: true, message: '请选择对象小类', trigger: 'blur' }"
|
||||
|
||||
>
|
||||
<el-select
|
||||
filterable
|
||||
@@ -2202,6 +2203,22 @@ const category = () => {
|
||||
bigList.value = convertToTree(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
//用户对象chage事件
|
||||
const handleSelect = (item, selectedId) => {
|
||||
// 清空选择
|
||||
if (!selectedId) {
|
||||
item.projectName = ''
|
||||
return
|
||||
}
|
||||
// 过滤当前下拉数据源
|
||||
|
||||
const options = newStationIdArr.value.find(i => i.id === selectedId)
|
||||
if (options) {
|
||||
item.objName = options.projectName
|
||||
}
|
||||
}
|
||||
|
||||
// 组装用户大小类
|
||||
const convertToTree = (data: any) => {
|
||||
const nodeMap: any = {}
|
||||
@@ -2911,7 +2928,7 @@ const selectChanged = async (value: any) => {
|
||||
capacity = 750
|
||||
break
|
||||
case '35':
|
||||
capacity = 259
|
||||
capacity = 250
|
||||
break
|
||||
case '10':
|
||||
capacity = 100
|
||||
@@ -2931,9 +2948,9 @@ const selectChanged = async (value: any) => {
|
||||
case '750':
|
||||
capacity = 7000
|
||||
break
|
||||
case '800':
|
||||
capacity = 7000
|
||||
break
|
||||
// case '800':
|
||||
// capacity = 7000
|
||||
// break
|
||||
case '1000':
|
||||
capacity = 9000
|
||||
break
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="default-main">
|
||||
<TableHeader :showReset="false" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
|
||||
@@ -504,14 +504,16 @@ const maintenance = (val: any) => {
|
||||
id: val.tfIndex,
|
||||
subId: val.subIndex
|
||||
}).then(res => {
|
||||
|
||||
bind.value = res.data.bind
|
||||
treeMenuLeftData.value = res.data.upNode
|
||||
treeMenuRightData.value = res.data.downNode
|
||||
|
||||
setDisabled(treeMenuRightData.value)
|
||||
setDisabled(treeMenuLeftData.value)
|
||||
isLoading3.value = false
|
||||
if (treeMenuLeftData.value && treeMenuLeftData.value.length > 0) {
|
||||
treeMenuLeftData.value[0].children?.forEach(item => {
|
||||
/* treeMenuLeftData.value[0].children?.forEach(item => {
|
||||
item.children?.forEach(item1 => {
|
||||
item1.children?.forEach(item2 => {
|
||||
item2.children?.forEach(item3 => {
|
||||
@@ -523,21 +525,25 @@ const maintenance = (val: any) => {
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})*/
|
||||
menuTreeLeft.value?.setCheckedKeys([bind.value[0]])
|
||||
maintenanceData.upNode = bind.value[0]
|
||||
bindLevel.value = 5
|
||||
}
|
||||
if (treeMenuRightData.value && treeMenuRightData.value.length > 0) {
|
||||
treeMenuRightData.value[0].children?.forEach(item => {
|
||||
/* treeMenuRightData.value[0].children?.forEach(item => {
|
||||
item.children?.forEach(item1 => {
|
||||
item1.children?.forEach(item2 => {
|
||||
item2.children?.forEach(item3 => {
|
||||
if (item3.level != null) {
|
||||
menuTreeRight.value?.setCheckedKeys([item3.id])
|
||||
maintenanceData.downNode = item3.id
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})*/
|
||||
menuTreeRight.value?.setCheckedKeys([bind.value[1]])
|
||||
maintenanceData.downNode = bind.value[1]
|
||||
}
|
||||
nodemaintenanceInformation.value = true
|
||||
})
|
||||
|
||||
@@ -694,7 +694,7 @@ const rules = ref({
|
||||
reporter: [{ required: true, message: '请输入填报人', trigger: 'blur' }],
|
||||
reportDate: [{ required: true, message: '请选择填报日期', trigger: 'change' }],
|
||||
orgId: [{ required: true, message: '请选择填报部门', trigger: 'change' }],
|
||||
stationId: [{ required: true, message: '请选择所属电站', trigger: 'change' }],
|
||||
//stationId: [{ required: true, message: '请选择所属电站', trigger: 'change' }],
|
||||
expectedProductionDate: [{ required: true, message: '请选择工程预期投产日期', trigger: 'change' }],
|
||||
userType: [{ required: true, message: '清选择用户性质', trigger: 'change' }],
|
||||
city: [{ required: true, message: '请选择所在地市', trigger: 'change' }],
|
||||
|
||||
@@ -89,7 +89,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{ field: 'city', title: '所在地市', minWidth: 80 },
|
||||
{ field: 'substation', title: '厂站名称', minWidth: 100 },
|
||||
/* { field: 'substation', title: '厂站名称', minWidth: 100 },*/
|
||||
{ field: 'projectName', title: '项目名称', minWidth: 170 },
|
||||
{
|
||||
field: 'userType',
|
||||
@@ -103,6 +103,7 @@ const tableStore = new TableStore({
|
||||
|
||||
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
|
||||
{ field: 'ratePower', title: '装机容量(MW)', minWidth: 130 },
|
||||
{ field: 'stationId', title: '所属电站', minWidth: 130 },
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建人',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<el-collapse v-model="activeName" accordion>
|
||||
<!-- <el-collapse-item title="典型电能质量干扰源" name="1"></el-collapse-item> -->
|
||||
<el-collapse-item title="国家电网有限公司企业标准" name="2">
|
||||
<el-collapse-item title="电网有限公司企业标准" name="2">
|
||||
<!-- <el-empty description="暂无数据" class="custom-empty iframe" /> -->
|
||||
<div :style="`overflow: auto;`" class="iframe">
|
||||
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 案例库 -->
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="名称">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@@ -2,32 +2,39 @@
|
||||
<div class="default-main" :style="height">
|
||||
<!-- 标准库 -->
|
||||
|
||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||
<splitpanes
|
||||
style="height: 100%"
|
||||
class="default-theme"
|
||||
id="navigation-splitpanes"
|
||||
@resize="onPaneResize"
|
||||
@resized="onPaneResized"
|
||||
>
|
||||
<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">
|
||||
<pane style="background: #fff" class="standard-pane">
|
||||
<div class="pd10 standard-pane__toolbar" 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="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.includes('.xlsx')" :src="url"
|
||||
:options="excelOptions" />
|
||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
|
||||
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<img v-if="
|
||||
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
|
||||
" :src="url" />
|
||||
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty standard-pane__content" />
|
||||
<div v-else class="standard-pane__content">
|
||||
<div v-show="!isPaneResizing" class="standard-preview">
|
||||
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.includes('.xlsx')" :src="url"
|
||||
:options="excelOptions" />
|
||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
|
||||
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 100%"></iframe>
|
||||
<img v-if="
|
||||
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
|
||||
" :src="url" />
|
||||
</div>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
@@ -70,7 +77,16 @@ const addTreeRef = ref()
|
||||
const url = ref('')
|
||||
const dotList: any = ref({})
|
||||
const flag: any = ref(false)
|
||||
const isPaneResizing = ref(false)
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
const onPaneResize = () => {
|
||||
isPaneResizing.value = true
|
||||
}
|
||||
const onPaneResized = () => {
|
||||
requestAnimationFrame(() => {
|
||||
isPaneResizing.value = false
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
@@ -79,7 +95,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
const urlKey=ref('')
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const VITE_FLAG = false//import.meta.env.VITE_NAME == 'jibei'
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
// console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||
dotList.value = data
|
||||
@@ -166,6 +182,36 @@ const download = () => {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
:deep(.splitpanes__pane) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.standard-pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.standard-pane__toolbar {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.standard-pane__content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.standard-preview {
|
||||
height: 99%;
|
||||
min-height: 99%;
|
||||
}
|
||||
|
||||
:deep(.splitpanes--dragging) .standard-preview {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 模版 -->
|
||||
<TableHeader ref="TableHeaderRef" >
|
||||
<template #select>
|
||||
<el-form-item label="名称">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable
|
||||
placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,274 +1,289 @@
|
||||
<template>
|
||||
<div class="default-main online">
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker area ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<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
|
||||
placeholder="请选择电压等级"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<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.powerFlag"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择电网标识"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerFlagList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.algoDescribe"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
: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
|
||||
placeholder="请选择干扰源类型"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in interfereoption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="online_main">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
||||
<el-tab-pane :name="0" :lazy="true" label="稳态指标符合性占比表格">
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
v-if="activeName == 0"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="1" :lazy="true" label="稳态指标符合性占比图">
|
||||
<charts v-if="activeName == 1" ref="chartsRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/SteadyState'
|
||||
})
|
||||
const tableRef = ref()
|
||||
const onlineChartsRef = ref()
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||
//字典获取监督对象类型
|
||||
const powerFlagList = dictData.getBasicData('power_flag')
|
||||
//调用区域接口获取区域
|
||||
const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
await getAreaDept().then(res => {
|
||||
var data = res.data
|
||||
data.forEach(element => {
|
||||
idArr.value.push(element.id)
|
||||
})
|
||||
treeData.value = JSON.parse(JSON.stringify(res.data))
|
||||
})
|
||||
}
|
||||
getTreeData()
|
||||
|
||||
const chartsRef = ref()
|
||||
const handleClick = (tab: any, e: any) => {
|
||||
// console.log(tab,e,"??????????");
|
||||
// if(activeName.value===1){
|
||||
tableStore.index()
|
||||
// }
|
||||
}
|
||||
|
||||
// const datePickerRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
publicHeight: 60,
|
||||
showPage: false,
|
||||
url: '/harmonic-boot/steadyExceedRate/getSteadyExceedRateData',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '',
|
||||
field: 'name',
|
||||
align: 'left',
|
||||
treeNode: true,
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
title: '电压等级',
|
||||
field: 'voltageLevel',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '厂家',
|
||||
field: 'factoryName',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'networkParam',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '符合性占比(%)',
|
||||
field: 'steadyExceedRate',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.powerFlag = 2
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
|
||||
// 判断item是否存在children
|
||||
if (!item.children) return arr.push(item)
|
||||
// 函数递归,对children数组进行tree2List的转换
|
||||
const children = tree2List(item.children, item.uId)
|
||||
// 删除item的children属性
|
||||
delete item.children
|
||||
// 把item和children数组添加至结果数组
|
||||
//..children: 意思是把children数组展开
|
||||
arr.push(item, ...children)
|
||||
})
|
||||
// 返回结果数组
|
||||
return arr
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// .online {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// .online_header {
|
||||
// width: 100%;
|
||||
// max-height: 140px;
|
||||
// padding: 10px;
|
||||
// box-sizing: border-box;
|
||||
// }
|
||||
// .online_main {
|
||||
// padding: 0 10px;
|
||||
// }
|
||||
// }
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main online">
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker area ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<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
|
||||
placeholder="请选择电压等级"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<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.powerFlag"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择电网标识"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerFlagList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.algoDescribe"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
: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
|
||||
placeholder="请选择干扰源类型"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in interfereoption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="online_main">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
||||
<el-tab-pane :name="0" :lazy="true" label="稳态指标符合性占比表格">
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
v-if="activeName == 0"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="1" :lazy="true" label="稳态指标符合性占比图">
|
||||
<charts v-if="activeName == 1" ref="chartsRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/SteadyState'
|
||||
})
|
||||
const tableRef = ref()
|
||||
const onlineChartsRef = ref()
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||
//字典获取监督对象类型
|
||||
const powerFlagList = dictData.getBasicData('power_flag')
|
||||
//调用区域接口获取区域
|
||||
const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
await getAreaDept().then(res => {
|
||||
var data = res.data
|
||||
data.forEach(element => {
|
||||
idArr.value.push(element.id)
|
||||
})
|
||||
treeData.value = JSON.parse(JSON.stringify(res.data))
|
||||
})
|
||||
}
|
||||
getTreeData()
|
||||
|
||||
const chartsRef = ref()
|
||||
const handleClick = (tab: any, e: any) => {
|
||||
// console.log(tab,e,"??????????");
|
||||
// if(activeName.value===1){
|
||||
tableStore.index()
|
||||
// }
|
||||
}
|
||||
|
||||
// const datePickerRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
publicHeight: 60,
|
||||
showPage: false,
|
||||
url: '/harmonic-boot/steadyExceedRate/getSteadyExceedRateData',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '',
|
||||
field: 'name',
|
||||
align: 'left',
|
||||
treeNode: true,
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
title: '电压等级',
|
||||
field: 'voltageLevel',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '厂家',
|
||||
field: 'factoryName',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'networkParam',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '符合性占比(%)',
|
||||
field: 'steadyExceedRate',
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.powerFlag = 2
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
|
||||
// 判断item是否存在children
|
||||
if (!item.children) return arr.push(item)
|
||||
// 函数递归,对children数组进行tree2List的转换
|
||||
const children = tree2List(item.children, item.uId)
|
||||
// 删除item的children属性
|
||||
delete item.children
|
||||
// 把item和children数组添加至结果数组
|
||||
//..children: 意思是把children数组展开
|
||||
arr.push(item, ...children)
|
||||
})
|
||||
// 返回结果数组
|
||||
return arr
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// .online {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// .online_header {
|
||||
// width: 100%;
|
||||
// max-height: 140px;
|
||||
// padding: 10px;
|
||||
// box-sizing: border-box;
|
||||
// }
|
||||
// .online_main {
|
||||
// padding: 0 10px;
|
||||
// }
|
||||
// }
|
||||
</style>
|
||||
|
||||
@@ -4,9 +4,15 @@
|
||||
<TableHeader datePicker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入关键字筛选" clearable maxlength="32" show-word-limit/>
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="输入关键字筛选"
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
@@ -21,7 +27,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
multiple
|
||||
@@ -38,7 +44,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
@@ -55,7 +61,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-form-item label="干扰源类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
multiple
|
||||
@@ -127,7 +133,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: '180' },
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '150' },
|
||||
{ field: 'ip', title: '网络参数' ,width:'120px' },
|
||||
{ field: 'ip', title: '网络参数', width: '120px' },
|
||||
{ field: 'scale', title: '电压等级', minWidth: '110' },
|
||||
{
|
||||
field: 'advanceType',
|
||||
@@ -137,7 +143,7 @@ const tableStore = new TableStore({
|
||||
return row.cellValue || '其他'
|
||||
}
|
||||
},
|
||||
{
|
||||
{
|
||||
field: 'eventType',
|
||||
title: '触发类型',
|
||||
minWidth: '120',
|
||||
@@ -153,7 +159,7 @@ const tableStore = new TableStore({
|
||||
return row.cellValue || '其他'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// {
|
||||
// field: 'severity', title: '严重度', minWidth: "80", formatter: (row: any) => {
|
||||
// return row.cellValue.toFixed(2)
|
||||
@@ -180,7 +186,8 @@ const tableStore = new TableStore({
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
||||
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
width: '120',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
@@ -278,6 +285,7 @@ const download = () => {
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
ElMessage.success('波形下载成功')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<template>
|
||||
<div class="default-main online">
|
||||
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-form-item label="统计类型">
|
||||
<el-select v-model="formData.statisticalType" placeholder="请选择统计类型" value-key="id"
|
||||
style="width: 100%">
|
||||
<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-form-item label="区域选择">
|
||||
<!-- <el-select ref="select1" v-model="deptName" placeholder="请选择所属部门区域" style="width: 100%">
|
||||
<el-option :value="formData.deptIndex" style="height: auto"> -->
|
||||
<!-- {{ formData.deptIndex }} -->
|
||||
@@ -33,29 +34,38 @@
|
||||
<!-- </el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select v-model="formData.scale" multiple collapse-tags clearable placeholder="请选择电压等级"
|
||||
style="width: 100%" value-key="id">
|
||||
<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-form-item label="终端厂家">
|
||||
<el-select v-model="formData.manufacturer" multiple collapse-tags clearable
|
||||
placeholder="请选择终端厂家" style="width: 100%" value-key="id">
|
||||
<el-option v-for="(item, index) in terminaloption" :key="index" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-form-item label="干扰源类型">
|
||||
<el-select v-model="formData.loadType" multiple collapse-tags clearable placeholder="请选择干扰源类型"
|
||||
style="width: 100%" value-key="id">
|
||||
<el-option v-for="(item, index) in interfereoption" :key="index" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选:">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字"></el-input>
|
||||
<el-form-item label="通讯状态">
|
||||
<el-select v-model="tableStore.table.params.comFlagStatus" clearable placeholder="请选择通讯状态"
|
||||
style="width: 100%">
|
||||
<el-option label="正常" value="1" />
|
||||
<el-option label="中断" value="0" />
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable
|
||||
placeholder="请输入关键字"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
@@ -77,9 +87,10 @@
|
||||
</div>
|
||||
<el-dialog v-model="timePopUp" draggable title="补招" width="500">
|
||||
补招时间:
|
||||
<el-date-picker v-model="timeData" type="datetimerange" format="YYYY-MM-DD HH:mm:00"
|
||||
value-format="YYYY-MM-DD HH:mm:00" range-separator="至" date-format="YYYY-MM-DD" time-format="HH:mm:00"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 400px" :disabledDate="disabledDate" />
|
||||
<el-date-picker v-model="timeData" type="datetimerange" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" range-separator="至" date-format="YYYY-MM-DD" time-format="HH:mm:ss"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" style="width: 400px" :disabledDate="disabledDate"
|
||||
:default-time="defaultTimeRange" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="timePopUp = false">取消</el-button>
|
||||
@@ -139,6 +150,10 @@ const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Ty
|
||||
const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const timeData = ref([])
|
||||
const defaultTimeRange: [Date, Date] = [
|
||||
new Date(2000, 0, 1, 0, 0, 0),
|
||||
new Date(2000, 0, 1, 23, 59, 59)
|
||||
]
|
||||
const logList: any = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
@@ -198,7 +213,7 @@ const tableStore = new TableStore({
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'ip',
|
||||
align: 'center',width:'120px',
|
||||
align: 'center', width: '120px',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
@@ -288,7 +303,7 @@ const tableStore = new TableStore({
|
||||
// tableStore.table.params.searchEndTime = tableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(filterTreeByKeyword( tableStore.table.data,tableStore.table.params.searchValue), Math.random() * 1000)
|
||||
tableStore.table.data = tree2List(filterTreeByKeyword(tableStore.table.data, tableStore.table.params.searchValue), Math.random() * 1000)
|
||||
tableStore.table.column[0].title = formData.value.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
@@ -313,6 +328,7 @@ tableStore.table.params.statisticalType = []
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.comFlagStatus = ''
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
@@ -353,65 +369,65 @@ const tree2List = (list: any, id?: string) => {
|
||||
* @returns {Array} 筛选后的嵌套树形数据,保持原层级
|
||||
*/
|
||||
function filterTreeByKeyword(treeData, keyword) {
|
||||
// 关键词为空,直接返回原树(深拷贝,避免修改原数据)
|
||||
if (!keyword || keyword.trim() === '') {
|
||||
return JSON.parse(JSON.stringify(treeData));
|
||||
}
|
||||
const targetKey = keyword.trim();
|
||||
// 存储需要保留的节点ID(匹配节点+所有上级+所有下级)
|
||||
const keepIdSet = new Set();
|
||||
// 关键词为空,直接返回原树(深拷贝,避免修改原数据)
|
||||
if (!keyword || keyword.trim() === '') {
|
||||
return JSON.parse(JSON.stringify(treeData));
|
||||
}
|
||||
const targetKey = keyword.trim();
|
||||
// 存储需要保留的节点ID(匹配节点+所有上级+所有下级)
|
||||
const keepIdSet = new Set();
|
||||
|
||||
// 第一步:递归遍历树形,标记所有需要保留的节点ID
|
||||
const markKeepNodes = (node, parentNodes = []) => {
|
||||
// 1. 若当前节点名称包含关键词,标记自身+所有上级+所有下级
|
||||
const isMatch = node.name && node.name.includes(targetKey);
|
||||
if (isMatch) {
|
||||
// 标记自身
|
||||
keepIdSet.add(node.id);
|
||||
// 标记所有上级父节点
|
||||
parentNodes.forEach(pNode => keepIdSet.add(pNode.id));
|
||||
// 标记所有下级子节点(递归)
|
||||
const markChildren = (childNode) => {
|
||||
keepIdSet.add(childNode.id);
|
||||
if (childNode.children && childNode.children.length) {
|
||||
childNode.children.forEach(markChildren);
|
||||
// 第一步:递归遍历树形,标记所有需要保留的节点ID
|
||||
const markKeepNodes = (node, parentNodes = []) => {
|
||||
// 1. 若当前节点名称包含关键词,标记自身+所有上级+所有下级
|
||||
const isMatch = node.name && node.name.includes(targetKey);
|
||||
if (isMatch) {
|
||||
// 标记自身
|
||||
keepIdSet.add(node.id);
|
||||
// 标记所有上级父节点
|
||||
parentNodes.forEach(pNode => keepIdSet.add(pNode.id));
|
||||
// 标记所有下级子节点(递归)
|
||||
const markChildren = (childNode) => {
|
||||
keepIdSet.add(childNode.id);
|
||||
if (childNode.children && childNode.children.length) {
|
||||
childNode.children.forEach(markChildren);
|
||||
}
|
||||
};
|
||||
if (node.children && node.children.length) {
|
||||
node.children.forEach(markChildren);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (node.children && node.children.length) {
|
||||
node.children.forEach(markChildren);
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 递归遍历子节点,传递当前节点的上级链(parentNodes + 当前节点)
|
||||
if (node.children && node.children.length) {
|
||||
node.children.forEach(child => markKeepNodes(child, [...parentNodes, node]));
|
||||
}
|
||||
};
|
||||
// 2. 递归遍历子节点,传递当前节点的上级链(parentNodes + 当前节点)
|
||||
if (node.children && node.children.length) {
|
||||
node.children.forEach(child => markKeepNodes(child, [...parentNodes, node]));
|
||||
}
|
||||
};
|
||||
|
||||
// 遍历根节点,开始标记
|
||||
treeData.forEach(rootNode => markKeepNodes(rootNode));
|
||||
// 遍历根节点,开始标记
|
||||
treeData.forEach(rootNode => markKeepNodes(rootNode));
|
||||
|
||||
// 第二步:递归重构树形,只保留标记过的节点,保持层级
|
||||
const rebuildTree = (node) => {
|
||||
// 若当前节点无需保留,直接返回null
|
||||
if (!keepIdSet.has(node.id)) {
|
||||
return null;
|
||||
}
|
||||
// 深拷贝当前节点,避免修改原数据
|
||||
const newNode = { ...node };
|
||||
// 递归处理子节点,过滤掉无需保留的,只保留有效子节点
|
||||
if (newNode.children && newNode.children.length) {
|
||||
const newChildren = newNode.children.map(child => rebuildTree(child)).filter(Boolean);
|
||||
newNode.children = newChildren;
|
||||
} else {
|
||||
newNode.children = [];
|
||||
}
|
||||
return newNode;
|
||||
};
|
||||
// 第二步:递归重构树形,只保留标记过的节点,保持层级
|
||||
const rebuildTree = (node) => {
|
||||
// 若当前节点无需保留,直接返回null
|
||||
if (!keepIdSet.has(node.id)) {
|
||||
return null;
|
||||
}
|
||||
// 深拷贝当前节点,避免修改原数据
|
||||
const newNode = { ...node };
|
||||
// 递归处理子节点,过滤掉无需保留的,只保留有效子节点
|
||||
if (newNode.children && newNode.children.length) {
|
||||
const newChildren = newNode.children.map(child => rebuildTree(child)).filter(Boolean);
|
||||
newNode.children = newChildren;
|
||||
} else {
|
||||
newNode.children = [];
|
||||
}
|
||||
return newNode;
|
||||
};
|
||||
|
||||
// 重构根节点,过滤掉null的根节点
|
||||
const filteredTree = treeData.map(rootNode => rebuildTree(rootNode)).filter(Boolean);
|
||||
return filteredTree;
|
||||
// 重构根节点,过滤掉null的根节点
|
||||
const filteredTree = treeData.map(rootNode => rebuildTree(rootNode)).filter(Boolean);
|
||||
return filteredTree;
|
||||
}
|
||||
|
||||
|
||||
@@ -429,7 +445,7 @@ const makeUp = () => {
|
||||
.getCheckboxRecords()
|
||||
.filter((item: any) => item.level == '6') || []
|
||||
|
||||
|
||||
|
||||
|
||||
if (list.length == 0) {
|
||||
return ElMessage({
|
||||
@@ -468,24 +484,29 @@ const makeUpSubmit = () => {
|
||||
reCallStartTime: timeData.value[0]
|
||||
}
|
||||
|
||||
socket(form)
|
||||
timePopUp.value = false
|
||||
logPopUp.value = true
|
||||
setTimeout(() => {
|
||||
socket(form)
|
||||
timePopUp.value = false
|
||||
logPopUp.value = true
|
||||
}, 500)
|
||||
}
|
||||
const socket = async (form: any) => {
|
||||
const url = (localStorage.getItem('WebSocketUrl2') || 'ws://192.168.1.67:10405/api/recell/')
|
||||
const url = (localStorage.getItem('WebSocketUrl2') || 'null')//'ws://192.168.1.68:10405/api/recell/')
|
||||
logList.value = []
|
||||
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||
await dataSocket.socketServe.send(form)
|
||||
setTimeout(() => {
|
||||
dataSocket.socketServe.send(form)
|
||||
}, 500)
|
||||
logList.value.push({
|
||||
type: '',
|
||||
time: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
|
||||
time: formatDate(new Date(), 'YYYY-MM-DD HH:mm:ss'),
|
||||
name: '开始补召,请稍等...',
|
||||
})
|
||||
await dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||
if (res.code == undefined) return
|
||||
logList.value.push({
|
||||
type: res.code == 500 ? 'error' : '',
|
||||
time: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
|
||||
time: formatDate(new Date(), 'YYYY-MM-DD HH:mm:ss'),
|
||||
name: res.message
|
||||
})
|
||||
|
||||
|
||||
@@ -1,259 +1,275 @@
|
||||
<template>
|
||||
<div class="default-main online">
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker area ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<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
|
||||
placeholder="请选择电压等级"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<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
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
: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
|
||||
placeholder="请选择干扰源类型"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in interfereoption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||
<el-option
|
||||
v-for="item in sign"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.algoDescribe"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="online_main">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
||||
<el-tab-pane :name="0" :lazy="true" label="谐波畸变率统计表">
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
v-if="activeName == 0"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="1" :lazy="true" label="谐波畸变率统计图">
|
||||
<charts v-if="activeName == 1" ref="chartsRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/harmonicDistortionRate'
|
||||
})
|
||||
const tableRef = ref()
|
||||
const onlineChartsRef = ref()
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||
//调用区域接口获取区域
|
||||
const sign = dictData.getBasicData('power_flag')
|
||||
const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
await getAreaDept().then(res => {
|
||||
var data = res.data
|
||||
data.forEach(element => {
|
||||
idArr.value.push(element.id)
|
||||
})
|
||||
treeData.value = JSON.parse(JSON.stringify(res.data))
|
||||
})
|
||||
}
|
||||
getTreeData()
|
||||
|
||||
const chartsRef = ref()
|
||||
const handleClick = (tab: any, e: any) => {
|
||||
// console.log(tab,e,"??????????");
|
||||
// if(activeName.value===1){
|
||||
tableStore.index()
|
||||
// }
|
||||
}
|
||||
|
||||
// const datePickerRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
publicHeight: 60,
|
||||
showPage: false,
|
||||
url: '/harmonic-boot/tHDistortion/getTHDistortionData',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '',
|
||||
field: 'name',
|
||||
align: 'left',
|
||||
treeNode: true,
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
title: '电压等级',
|
||||
field: 'voltageLevel',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'networkParam',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '总谐波畸变率(%)',
|
||||
field: 'distortion',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
|
||||
// 判断item是否存在children
|
||||
if (!item.children) return arr.push(item)
|
||||
// 函数递归,对children数组进行tree2List的转换
|
||||
const children = tree2List(item.children, item.uId)
|
||||
// 删除item的children属性
|
||||
delete item.children
|
||||
// 把item和children数组添加至结果数组
|
||||
//..children: 意思是把children数组展开
|
||||
arr.push(item, ...children)
|
||||
})
|
||||
// 返回结果数组
|
||||
return arr
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// .online {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// .online_header {
|
||||
// width: 100%;
|
||||
// max-height: 140px;
|
||||
// padding: 10px;
|
||||
// box-sizing: border-box;
|
||||
// }
|
||||
// .online_main {
|
||||
// padding: 0 10px;
|
||||
// }
|
||||
// }
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main online">
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker area ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<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
|
||||
placeholder="请选择电压等级"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<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
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
: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
|
||||
placeholder="请选择干扰源类型"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in interfereoption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||
<el-option
|
||||
v-for="item in sign"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.algoDescribe"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="online_main">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
||||
<el-tab-pane :name="0" :lazy="true" label="谐波畸变率统计表">
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
v-if="activeName == 0"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="1" :lazy="true" label="谐波畸变率统计图">
|
||||
<charts v-if="activeName == 1" ref="chartsRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/harmonicDistortionRate'
|
||||
})
|
||||
const tableRef = ref()
|
||||
const onlineChartsRef = ref()
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||
//调用区域接口获取区域
|
||||
const sign = dictData.getBasicData('power_flag')
|
||||
const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
await getAreaDept().then(res => {
|
||||
var data = res.data
|
||||
data.forEach(element => {
|
||||
idArr.value.push(element.id)
|
||||
})
|
||||
treeData.value = JSON.parse(JSON.stringify(res.data))
|
||||
})
|
||||
}
|
||||
getTreeData()
|
||||
|
||||
const chartsRef = ref()
|
||||
const handleClick = (tab: any, e: any) => {
|
||||
// console.log(tab,e,"??????????");
|
||||
// if(activeName.value===1){
|
||||
tableStore.index()
|
||||
// }
|
||||
}
|
||||
|
||||
// const datePickerRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
publicHeight: 60,
|
||||
showPage: false,
|
||||
url: '/harmonic-boot/tHDistortion/getTHDistortionData',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '',
|
||||
field: 'name',
|
||||
align: 'left',
|
||||
treeNode: true,
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
title: '电压等级',
|
||||
field: 'voltageLevel',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'networkParam',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '总谐波畸变率(%)',
|
||||
field: 'distortion',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
// 筛选条件:name 包含关键词
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
|
||||
// 判断item是否存在children
|
||||
if (!item.children) return arr.push(item)
|
||||
// 函数递归,对children数组进行tree2List的转换
|
||||
const children = tree2List(item.children, item.uId)
|
||||
// 删除item的children属性
|
||||
delete item.children
|
||||
// 把item和children数组添加至结果数组
|
||||
//..children: 意思是把children数组展开
|
||||
arr.push(item, ...children)
|
||||
})
|
||||
// 返回结果数组
|
||||
return arr
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// .online {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// .online_header {
|
||||
// width: 100%;
|
||||
// max-height: 140px;
|
||||
// padding: 10px;
|
||||
// box-sizing: border-box;
|
||||
// }
|
||||
// .online_main {
|
||||
// padding: 0 10px;
|
||||
// }
|
||||
// }
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:" v-if="false">
|
||||
<el-form-item label="统计类型" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
@@ -18,7 +18,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:" v-if="false">
|
||||
<el-form-item label="电压等级" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
multiple
|
||||
@@ -36,7 +36,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:" v-if="false">
|
||||
<el-form-item label="终端厂家" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
@@ -55,7 +55,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-form-item label="干扰源类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
multiple
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="formData.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
@@ -18,7 +18,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域选择:">
|
||||
<el-form-item label="区域选择">
|
||||
<!-- <el-select ref="select1" v-model="deptName" placeholder="请选择所属部门区域" style="width: 100%">
|
||||
<el-option :value="formData.deptIndex" style="height: auto"> -->
|
||||
<!-- {{ formData.deptIndex }} -->
|
||||
@@ -48,7 +48,7 @@
|
||||
<!-- </el-option>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select
|
||||
v-model="formData.scale"
|
||||
multiple
|
||||
@@ -66,7 +66,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select
|
||||
v-model="formData.manufacturer"
|
||||
multiple
|
||||
@@ -84,7 +84,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-form-item label="干扰源类型">
|
||||
<el-select
|
||||
v-model="formData.loadType"
|
||||
multiple
|
||||
@@ -102,7 +102,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选:">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
|
||||
@@ -1,305 +1,305 @@
|
||||
<template>
|
||||
<div class="charts" style="position: relative; width: 100%">
|
||||
<div style="position: absolute; right: 60px; top: 5px; font-weight: bold">
|
||||
<el-tag
|
||||
style="
|
||||
background: #A52a2a;
|
||||
width: 30px;
|
||||
height: 15px;
|
||||
border: 1px solid #A52a2a;
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
"
|
||||
></el-tag>
|
||||
<span style="color: #A52a2a; font-weight: 400; float: left">  在线率<60%   </span>
|
||||
<el-tag
|
||||
size="small"
|
||||
style="
|
||||
background: #ffcc33;
|
||||
width: 30px;
|
||||
height: 15px;
|
||||
border: 1px solid #ffcc33;
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
"
|
||||
></el-tag>
|
||||
<span style="color: #ffcc33; font-weight: 400; float: left">  60%≤在线率<90%   </span>
|
||||
<el-tag
|
||||
style="
|
||||
background: #339966;
|
||||
width: 30px;
|
||||
height: 15px;
|
||||
border: 1px solid #339966;
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
"
|
||||
></el-tag>
|
||||
<span style="color: #339966; font-weight: 400; float: left">  在线率≥90%</span>
|
||||
</div>
|
||||
<my-echart
|
||||
v-loading="loading"
|
||||
class="mt10"
|
||||
:style="`height: calc(${tableStore.table.height} - 135px)`"
|
||||
:options="options"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import * as echarts from 'echarts/core'
|
||||
const dictData = useDictData()
|
||||
const options = ref({})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
const tableStoreParams: any = ref({})
|
||||
const loading = ref(false)
|
||||
const getTableStoreParams = async (val: any) => {
|
||||
tableStoreParams.value = val
|
||||
loading.value = true
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
}, 1500)
|
||||
}
|
||||
const itemStyle = {
|
||||
normal: {
|
||||
// 随机显示
|
||||
//color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
|
||||
|
||||
// 定制显示(按顺序)
|
||||
color: function (params) {
|
||||
if (params.value >= 90) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#339966'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value >= 60 && params.value <= 90) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FFCC33'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value <= 60 && params.value !== 3.14159) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#A52a2a'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value == 3.14159) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#cccccc'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/steadyQualify/getSteadyQualifyCensus',
|
||||
showPage: false,
|
||||
method: 'POST',
|
||||
// publicHeight: 10,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params = tableStoreParams.value
|
||||
},
|
||||
loadCallback: () => {
|
||||
let code = tableStore.table.params.statisticalType.code
|
||||
let title = '',
|
||||
titleX = ''
|
||||
if (code == 'Power_Network') {
|
||||
title = '区域'
|
||||
titleX = '区域'
|
||||
} else if (code == 'Manufacturer') {
|
||||
title = '终端厂家'
|
||||
titleX = '终端\n厂家'
|
||||
} else if (code == 'Voltage_Level') {
|
||||
title = '电压等级'
|
||||
titleX = '电压\n等级'
|
||||
} else if (code == 'Load_Type') {
|
||||
title = '干扰源类型'
|
||||
titleX = '干扰\n源类型'
|
||||
} else if (code == 'Report_Type') {
|
||||
title = '上报类型'
|
||||
titleX = '上报\n类型'
|
||||
}
|
||||
options.value = {
|
||||
title: {
|
||||
text: title
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
|
||||
formatter: function (params: any) {
|
||||
let tips = `<strong>${params[0]?.name}</strong></br>` // 标题加粗
|
||||
params.forEach((item: any) => {
|
||||
const value = item.value === 3.14159 ? '暂无数据' : item.value // 处理特殊值
|
||||
tips += `<div style=" display: flex;justify-content: space-between;">
|
||||
<span>${item.marker}
|
||||
${item.seriesName}:
|
||||
</span> ${value}
|
||||
</div>` // 统一格式
|
||||
})
|
||||
return tips
|
||||
}
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
name: titleX,
|
||||
data: tableStore.table.data.type
|
||||
},
|
||||
yAxis: {
|
||||
name: '%',
|
||||
max: 100
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '频率偏差',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.freqOffset,
|
||||
markLine: {
|
||||
silent: false,
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
name: '',
|
||||
yAxis: 100,
|
||||
lineStyle: {
|
||||
color: '#339966'
|
||||
},
|
||||
label: {
|
||||
// position: "middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#339966'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 90,
|
||||
lineStyle: {
|
||||
color: '#FFCC33'
|
||||
},
|
||||
label: {
|
||||
// position: "middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#FFCC33'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 60,
|
||||
lineStyle: {
|
||||
color: '#A52a2a'
|
||||
},
|
||||
label: {
|
||||
// position: "middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#A52a2a'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '闪变',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.flicker
|
||||
},
|
||||
{
|
||||
name: '三相电压不平衡',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.voltageUnbalance
|
||||
},
|
||||
{
|
||||
name: '谐波电压',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.harmonicVoltage
|
||||
},
|
||||
{
|
||||
name: '电压偏差',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.voltageOffset
|
||||
},
|
||||
{
|
||||
name: '谐波电流',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.harmonicCurrent
|
||||
},
|
||||
{
|
||||
name: '负序电流',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.negativeCurrent
|
||||
},
|
||||
{
|
||||
name: '间谐波电压含有率',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.interHarmonic
|
||||
}
|
||||
]
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {})
|
||||
defineExpose({ getTableStoreParams })
|
||||
</script>
|
||||
<style scoped lang="scss"></style>
|
||||
<template>
|
||||
<div class="charts" style="position: relative; width: 100%">
|
||||
<div style="position: absolute; right: 60px; top: 5px; font-weight: bold">
|
||||
<el-tag
|
||||
style="
|
||||
background: #A52a2a;
|
||||
width: 30px;
|
||||
height: 15px;
|
||||
border: 1px solid #A52a2a;
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
"
|
||||
></el-tag>
|
||||
<span style="color: #A52a2a; font-weight: 400; float: left">  合格率<60%   </span>
|
||||
<el-tag
|
||||
size="small"
|
||||
style="
|
||||
background: #ffcc33;
|
||||
width: 30px;
|
||||
height: 15px;
|
||||
border: 1px solid #ffcc33;
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
"
|
||||
></el-tag>
|
||||
<span style="color: #ffcc33; font-weight: 400; float: left">  60%≤合格率<90%   </span>
|
||||
<el-tag
|
||||
style="
|
||||
background: #339966;
|
||||
width: 30px;
|
||||
height: 15px;
|
||||
border: 1px solid #339966;
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
"
|
||||
></el-tag>
|
||||
<span style="color: #339966; font-weight: 400; float: left">  合格率≥90%</span>
|
||||
</div>
|
||||
<my-echart
|
||||
v-loading="loading"
|
||||
class="mt10"
|
||||
:style="`height: calc(${tableStore.table.height} - 135px)`"
|
||||
:options="options"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import * as echarts from 'echarts/core'
|
||||
const dictData = useDictData()
|
||||
const options = ref({})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
const tableStoreParams: any = ref({})
|
||||
const loading = ref(false)
|
||||
const getTableStoreParams = async (val: any) => {
|
||||
tableStoreParams.value = val
|
||||
loading.value = true
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
}, 1500)
|
||||
}
|
||||
const itemStyle = {
|
||||
normal: {
|
||||
// 随机显示
|
||||
//color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
|
||||
|
||||
// 定制显示(按顺序)
|
||||
color: function (params) {
|
||||
if (params.value >= 90) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#339966'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value >= 60 && params.value <= 90) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FFCC33'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value <= 60 && params.value !== 3.14159) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#A52a2a'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value == 3.14159) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#cccccc'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/steadyQualify/getSteadyQualifyCensus',
|
||||
showPage: false,
|
||||
method: 'POST',
|
||||
// publicHeight: 10,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params = tableStoreParams.value
|
||||
},
|
||||
loadCallback: () => {
|
||||
let code = tableStore.table.params.statisticalType.code
|
||||
let title = '',
|
||||
titleX = ''
|
||||
if (code == 'Power_Network') {
|
||||
title = '区域'
|
||||
titleX = '区域'
|
||||
} else if (code == 'Manufacturer') {
|
||||
title = '终端厂家'
|
||||
titleX = '终端\n厂家'
|
||||
} else if (code == 'Voltage_Level') {
|
||||
title = '电压等级'
|
||||
titleX = '电压\n等级'
|
||||
} else if (code == 'Load_Type') {
|
||||
title = '干扰源类型'
|
||||
titleX = '干扰\n源类型'
|
||||
} else if (code == 'Report_Type') {
|
||||
title = '上报类型'
|
||||
titleX = '上报\n类型'
|
||||
}
|
||||
options.value = {
|
||||
title: {
|
||||
text: title
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
|
||||
formatter: function (params: any) {
|
||||
let tips = `<strong>${params[0]?.name}</strong></br>` // 标题加粗
|
||||
params.forEach((item: any) => {
|
||||
const value = item.value === 3.14159 ? '暂无数据' : item.value // 处理特殊值
|
||||
tips += `<div style=" display: flex;justify-content: space-between;">
|
||||
<span>${item.marker}
|
||||
${item.seriesName}:
|
||||
</span> ${value}
|
||||
</div>` // 统一格式
|
||||
})
|
||||
return tips
|
||||
}
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
name: titleX,
|
||||
data: tableStore.table.data.type
|
||||
},
|
||||
yAxis: {
|
||||
name: '%',
|
||||
max: 100
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '频率偏差',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.freqOffset,
|
||||
markLine: {
|
||||
silent: false,
|
||||
symbol: 'circle',
|
||||
data: [
|
||||
{
|
||||
name: '',
|
||||
yAxis: 100,
|
||||
lineStyle: {
|
||||
color: '#339966'
|
||||
},
|
||||
label: {
|
||||
// position: "middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#339966'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 90,
|
||||
lineStyle: {
|
||||
color: '#FFCC33'
|
||||
},
|
||||
label: {
|
||||
// position: "middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#FFCC33'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
yAxis: 60,
|
||||
lineStyle: {
|
||||
color: '#A52a2a'
|
||||
},
|
||||
label: {
|
||||
// position: "middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#A52a2a'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '闪变',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.flicker
|
||||
},
|
||||
{
|
||||
name: '三相电压不平衡',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.voltageUnbalance
|
||||
},
|
||||
{
|
||||
name: '谐波电压',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.harmonicVoltage
|
||||
},
|
||||
{
|
||||
name: '电压偏差',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.voltageOffset
|
||||
},
|
||||
{
|
||||
name: '谐波电流',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.harmonicCurrent
|
||||
},
|
||||
{
|
||||
name: '负序电流',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.negativeCurrent
|
||||
},
|
||||
{
|
||||
name: '间谐波电压含有率',
|
||||
type: 'bar',
|
||||
itemStyle: itemStyle,
|
||||
data: tableStore.table.data.interHarmonic
|
||||
}
|
||||
]
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {})
|
||||
defineExpose({ getTableStoreParams })
|
||||
</script>
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker area ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
@@ -19,7 +19,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
multiple
|
||||
@@ -37,7 +37,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
@@ -55,7 +55,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-form-item label="干扰源类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
multiple
|
||||
@@ -83,6 +83,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
@@ -113,6 +121,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/qualifiedRate'
|
||||
})
|
||||
@@ -272,7 +281,13 @@ const tableStore = new TableStore({
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
// 筛选条件:name 包含关键词
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
@@ -288,6 +303,7 @@ tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
// const tree2List = (list: any, pid?: string) => {
|
||||
// //存储结果的数组
|
||||
|
||||
@@ -1,365 +1,379 @@
|
||||
<template>
|
||||
<div class="default-main online">
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker area ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<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.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="online_main">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
||||
<el-tab-pane :name="0" :lazy="true" label="终端状态统计表">
|
||||
<div class="table_legend">
|
||||
<ul>
|
||||
<li>
|
||||
<p style="background: #339966">
|
||||
<svg
|
||||
t="1722910570852"
|
||||
class="icon"
|
||||
viewBox="0 0 1336 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="6243"
|
||||
width="16"
|
||||
height="16"
|
||||
>
|
||||
<path
|
||||
d="M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024"
|
||||
fill="#ffffff"
|
||||
p-id="6244"
|
||||
></path>
|
||||
</svg>
|
||||
</p>
|
||||
<span style="color: #339966">投运状态</span>
|
||||
</li>
|
||||
<li>
|
||||
<p style="background: #ffcc33">
|
||||
<svg
|
||||
t="1722910570852"
|
||||
class="icon"
|
||||
viewBox="0 0 1336 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="6243"
|
||||
width="16"
|
||||
height="16"
|
||||
>
|
||||
<path
|
||||
d="M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024"
|
||||
fill="#ffffff"
|
||||
p-id="6244"
|
||||
></path>
|
||||
</svg>
|
||||
</p>
|
||||
<span style="color: #ffcc33">检修状态</span>
|
||||
</li>
|
||||
<li>
|
||||
<p style="background: #A52a2a">
|
||||
<svg
|
||||
t="1722910570852"
|
||||
class="icon"
|
||||
viewBox="0 0 1336 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="6243"
|
||||
width="16"
|
||||
height="16"
|
||||
>
|
||||
<path
|
||||
d="M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024"
|
||||
fill="#ffffff"
|
||||
p-id="6244"
|
||||
></path>
|
||||
</svg>
|
||||
</p>
|
||||
<span style="color: #A52a2a">停运状态</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
v-if="activeName == 0"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="1" :lazy="true" label="终端状态统计图">
|
||||
<charts v-if="activeName == 1" ref="chartsRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/terminalonlinerate'
|
||||
})
|
||||
const tableRef = ref()
|
||||
const chartsRef = ref()
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type', 'Voltage_Level', 'Load_Type'])
|
||||
//调用区域接口获取区域
|
||||
const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
await getAreaDept().then(res => {
|
||||
var data = res.data
|
||||
data.forEach(element => {
|
||||
idArr.value.push(element.id)
|
||||
})
|
||||
treeData.value = JSON.parse(JSON.stringify(res.data))
|
||||
})
|
||||
}
|
||||
getTreeData()
|
||||
|
||||
const formData = ref({
|
||||
statisticalType: classificationData[0], //统计类型
|
||||
deptIndex: treeData.value[0]?.id, //区域选择
|
||||
scale: voltageleveloption, //电压等级
|
||||
manufacturer: terminaloption, //终端厂家
|
||||
loadType: interfereoption //干扰源类型
|
||||
// searchBeginTime: '',
|
||||
// searchEndTime: ''
|
||||
})
|
||||
formData.value.deptIndex = treeData.value[0]?.id
|
||||
const defaultProps = ref({
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
emitPath: false,
|
||||
expandTrigger: 'click' as const
|
||||
})
|
||||
const handleClick = (tab: any, e: any) => {
|
||||
// if(activeName.value===1){
|
||||
tableStore.index()
|
||||
// }
|
||||
}
|
||||
|
||||
// const datePickerRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
publicHeight: 100,
|
||||
showPage: false,
|
||||
url: '/harmonic-boot/terminal/getTerminalData',
|
||||
method: 'POST',
|
||||
|
||||
column: [
|
||||
{
|
||||
title: formData.value.statisticalType.name,
|
||||
field: 'name',
|
||||
align: 'left',
|
||||
width: 350,
|
||||
treeNode: true
|
||||
},
|
||||
{
|
||||
title: '终端个数(台)',
|
||||
field: 'number',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 0 ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '投运(台)',
|
||||
field: 'runFlag',
|
||||
type: 'html',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 0
|
||||
? '/'
|
||||
: row.cellValue !== 0 && row.row.level !== 4
|
||||
? row.cellValue
|
||||
: row.cellValue !== 0 && row.row.level == 4 && row.row.reaFlag == 0 && row.row.stopFlag == 0
|
||||
? "<p class='table_icon' style='width: 18px;height: 18px;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: #339966'><svg t='1722910570852' class='icon' viewBox='0 0 1336 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6243' width='16' height='16'><path d='M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024' fill='#ffffff' p-id='6244'></path></svg> </p>"
|
||||
: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '检修(台)',
|
||||
field: 'reaFlag',
|
||||
type: 'html',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 0
|
||||
? '/'
|
||||
: row.cellValue !== 0 && row.row.level !== 4
|
||||
? row.cellValue
|
||||
: row.cellValue !== 0 && row.row.level == 4 && row.row.runFlag == 0 && row.row.stopFlag == 0
|
||||
? "<p class='table_icon' style='width: 18px;height: 18px;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: #ffcc33'><svg t='1722910570852' class='icon' viewBox='0 0 1336 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6243' width='16' height='16'><path d='M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024' fill='#ffffff' p-id='6244'></path></svg> </p>"
|
||||
: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '停运(台)',
|
||||
field: 'stopFlag',
|
||||
type: 'html',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 0
|
||||
? '/'
|
||||
: row.cellValue !== 0 && row.row.level !== 4
|
||||
? row.cellValue
|
||||
: row.cellValue !== 0 && row.row.level == 4 && row.row.runFlag == 0 && row.row.reaFlag == 0
|
||||
? "<p class='table_icon' style='width: 18px;height: 18px;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: #A52a2a'><svg t='1722910570852' class='icon' viewBox='0 0 1336 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6243' width='16' height='16'><path d='M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024' fill='#ffffff' p-id='6244'></path></svg> </p>"
|
||||
: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '在线率(%)',
|
||||
field: 'onlineRateData',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue.toFixed(2)
|
||||
}
|
||||
}
|
||||
],
|
||||
// beforeSearchFun: () => {
|
||||
// tableStore.table.params.deptIndex = formData.value.deptIndex
|
||||
// tableStore.table.params.statisticalType = formData.value.statisticalType
|
||||
// tableStore.table.params.scale = formData.value.scale
|
||||
// tableStore.table.params.manufacturer = formData.value.manufacturer
|
||||
// tableStore.table.params.loadType = formData.value.loadType
|
||||
// tableStore.table.params.serverName = 'harmonicBoot'
|
||||
// // delete tableStore.table.params.timeFlag
|
||||
// // delete tableStore.table.params.startTime
|
||||
// // delete tableStore.table.params.endTime
|
||||
// // delete tableStore.table.params.pageNum
|
||||
// // delete tableStore.table.params.pageSize
|
||||
// // tableStore.table.params.searchBeginTime = tableHeaderRef.value.datePickerRef.timeValue[0]
|
||||
// // tableStore.table.params.searchEndTime = tableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
// },
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.column[0].title = formData.value.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
tableStore.table.params.deptIndex = treeData.value[0]?.id
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = voltageleveloption
|
||||
tableStore.table.params.manufacturer = terminaloption
|
||||
tableStore.table.params.loadType = interfereoption
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
|
||||
// 判断item是否存在children
|
||||
if (!item.children) return arr.push(item)
|
||||
// 函数递归,对children数组进行tree2List的转换
|
||||
const children = tree2List(item.children, item.uId)
|
||||
// 删除item的children属性
|
||||
delete item.children
|
||||
// 把item和children数组添加至结果数组
|
||||
//..children: 意思是把children数组展开
|
||||
arr.push(item, ...children)
|
||||
})
|
||||
// 返回结果数组
|
||||
return arr
|
||||
}
|
||||
|
||||
onMounted(() => {})
|
||||
|
||||
watch(
|
||||
() => treeData.value,
|
||||
(val, oldVal) => {
|
||||
if (val && val.length != 0) {
|
||||
formData.value.deptIndex = val[0].id
|
||||
tableStore.index()
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.table_legend {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
ul {
|
||||
width: 280px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
li {
|
||||
flex: 1;
|
||||
list-style-type: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
p {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main online">
|
||||
<div class="online_header">
|
||||
<TableHeader date-picker area ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<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.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
placeholder="请输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="online_main">
|
||||
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
|
||||
<el-tab-pane :name="0" :lazy="true" label="终端状态统计表">
|
||||
<div class="table_legend">
|
||||
<ul>
|
||||
<li>
|
||||
<p style="background: #339966">
|
||||
<svg
|
||||
t="1722910570852"
|
||||
class="icon"
|
||||
viewBox="0 0 1336 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="6243"
|
||||
width="16"
|
||||
height="16"
|
||||
>
|
||||
<path
|
||||
d="M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024"
|
||||
fill="#ffffff"
|
||||
p-id="6244"
|
||||
></path>
|
||||
</svg>
|
||||
</p>
|
||||
<span style="color: #339966">投运状态</span>
|
||||
</li>
|
||||
<li>
|
||||
<p style="background: #ffcc33">
|
||||
<svg
|
||||
t="1722910570852"
|
||||
class="icon"
|
||||
viewBox="0 0 1336 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="6243"
|
||||
width="16"
|
||||
height="16"
|
||||
>
|
||||
<path
|
||||
d="M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024"
|
||||
fill="#ffffff"
|
||||
p-id="6244"
|
||||
></path>
|
||||
</svg>
|
||||
</p>
|
||||
<span style="color: #ffcc33">检修状态</span>
|
||||
</li>
|
||||
<li>
|
||||
<p style="background: #a52a2a">
|
||||
<svg
|
||||
t="1722910570852"
|
||||
class="icon"
|
||||
viewBox="0 0 1336 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="6243"
|
||||
width="16"
|
||||
height="16"
|
||||
>
|
||||
<path
|
||||
d="M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024"
|
||||
fill="#ffffff"
|
||||
p-id="6244"
|
||||
></path>
|
||||
</svg>
|
||||
</p>
|
||||
<span style="color: #a52a2a">停运状态</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
v-if="activeName == 0"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :name="1" :lazy="true" label="终端状态统计图">
|
||||
<charts v-if="activeName == 1" ref="chartsRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import charts from './components/charts.vue'
|
||||
import { filterTree } from '@/utils/tree'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/terminalonlinerate'
|
||||
})
|
||||
const tableRef = ref()
|
||||
const chartsRef = ref()
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type', 'Voltage_Level', 'Load_Type'])
|
||||
//调用区域接口获取区域
|
||||
const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
await getAreaDept().then(res => {
|
||||
var data = res.data
|
||||
data.forEach(element => {
|
||||
idArr.value.push(element.id)
|
||||
})
|
||||
treeData.value = JSON.parse(JSON.stringify(res.data))
|
||||
})
|
||||
}
|
||||
getTreeData()
|
||||
|
||||
const formData = ref({
|
||||
statisticalType: classificationData[0], //统计类型
|
||||
deptIndex: treeData.value[0]?.id, //区域选择
|
||||
scale: voltageleveloption, //电压等级
|
||||
manufacturer: terminaloption, //终端厂家
|
||||
loadType: interfereoption //干扰源类型
|
||||
// searchBeginTime: '',
|
||||
// searchEndTime: ''
|
||||
})
|
||||
formData.value.deptIndex = treeData.value[0]?.id
|
||||
const defaultProps = ref({
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
emitPath: false,
|
||||
expandTrigger: 'click' as const
|
||||
})
|
||||
const handleClick = (tab: any, e: any) => {
|
||||
// if(activeName.value===1){
|
||||
tableStore.index()
|
||||
// }
|
||||
}
|
||||
|
||||
// const datePickerRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
publicHeight: 100,
|
||||
showPage: false,
|
||||
url: '/harmonic-boot/terminal/getTerminalData',
|
||||
method: 'POST',
|
||||
|
||||
column: [
|
||||
{
|
||||
title: formData.value.statisticalType.name,
|
||||
field: 'name',
|
||||
align: 'left',
|
||||
width: 350,
|
||||
treeNode: true
|
||||
},
|
||||
{
|
||||
title: '终端个数(台)',
|
||||
field: 'number',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 0 ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '投运(台)',
|
||||
field: 'runFlag',
|
||||
type: 'html',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 0
|
||||
? '/'
|
||||
: row.cellValue !== 0 && row.row.level !== 4
|
||||
? row.cellValue
|
||||
: row.cellValue !== 0 && row.row.level == 4 && row.row.reaFlag == 0 && row.row.stopFlag == 0
|
||||
? "<p class='table_icon' style='width: 18px;height: 18px;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: #339966'><svg t='1722910570852' class='icon' viewBox='0 0 1336 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6243' width='16' height='16'><path d='M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024' fill='#ffffff' p-id='6244'></path></svg> </p>"
|
||||
: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '检修(台)',
|
||||
field: 'reaFlag',
|
||||
type: 'html',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 0
|
||||
? '/'
|
||||
: row.cellValue !== 0 && row.row.level !== 4
|
||||
? row.cellValue
|
||||
: row.cellValue !== 0 && row.row.level == 4 && row.row.runFlag == 0 && row.row.stopFlag == 0
|
||||
? "<p class='table_icon' style='width: 18px;height: 18px;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: #ffcc33'><svg t='1722910570852' class='icon' viewBox='0 0 1336 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6243' width='16' height='16'><path d='M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024' fill='#ffffff' p-id='6244'></path></svg> </p>"
|
||||
: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '停运(台)',
|
||||
field: 'stopFlag',
|
||||
type: 'html',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 0
|
||||
? '/'
|
||||
: row.cellValue !== 0 && row.row.level !== 4
|
||||
? row.cellValue
|
||||
: row.cellValue !== 0 && row.row.level == 4 && row.row.runFlag == 0 && row.row.reaFlag == 0
|
||||
? "<p class='table_icon' style='width: 18px;height: 18px;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: #A52a2a'><svg t='1722910570852' class='icon' viewBox='0 0 1336 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6243' width='16' height='16'><path d='M49.588224 883.816448M1139.531776 883.816448M86.939648 862.977024M538.459136 960.381952c109.876224-153.544704 223.55968-289.842176 308.03968-385.787904 49.87392-56.639488 96.715776-108.155904 141.549568-154.500096 40.576-41.945088 80.805888-80.405504 119.478272-116.59264 65.92-61.693952 142.984192-130.034688 191.446016-159.30368l-61.891584-82.050048c-89.732096 56.139776-176.10752 116.103168-242.799616 162.18112-38.863872 26.855424-74.928128 52.667392-108.915712 77.252608-33.668096 24.356864-68.429824 51.106816-105.081856 79.166464-63.633408 48.712704-145.388544 114.194432-224.555008 181.860352L357.07904 374.989824 123.885568 558.770176 538.459136 960.381952zM1335.92064 862.977024' fill='#ffffff' p-id='6244'></path></svg> </p>"
|
||||
: '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '在线率(%)',
|
||||
field: 'onlineRateData',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue.toFixed(2)
|
||||
}
|
||||
}
|
||||
],
|
||||
// beforeSearchFun: () => {
|
||||
// tableStore.table.params.deptIndex = formData.value.deptIndex
|
||||
// tableStore.table.params.statisticalType = formData.value.statisticalType
|
||||
// tableStore.table.params.scale = formData.value.scale
|
||||
// tableStore.table.params.manufacturer = formData.value.manufacturer
|
||||
// tableStore.table.params.loadType = formData.value.loadType
|
||||
// tableStore.table.params.serverName = 'harmonicBoot'
|
||||
// // delete tableStore.table.params.timeFlag
|
||||
// // delete tableStore.table.params.startTime
|
||||
// // delete tableStore.table.params.endTime
|
||||
// // delete tableStore.table.params.pageNum
|
||||
// // delete tableStore.table.params.pageSize
|
||||
// // tableStore.table.params.searchBeginTime = tableHeaderRef.value.datePickerRef.timeValue[0]
|
||||
// // tableStore.table.params.searchEndTime = tableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
// },
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(
|
||||
filterTree(tableStore.table.data, node => {
|
||||
return node.name.includes(tableStore.table.params.searchValue)
|
||||
}),
|
||||
Math.random() * 1000
|
||||
)
|
||||
tableStore.table.column[0].title = formData.value.statisticalType.name
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
}, 0)
|
||||
}
|
||||
})
|
||||
tableStore.table.params.deptIndex = treeData.value[0]?.id
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = voltageleveloption
|
||||
tableStore.table.params.manufacturer = terminaloption
|
||||
tableStore.table.params.loadType = interfereoption
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
const tree2List = (list: any, id?: string) => {
|
||||
//存储结果的数组
|
||||
let arr: any = []
|
||||
// 遍历 tree 数组
|
||||
list.forEach((item: any) => {
|
||||
item.uPid = id
|
||||
item.uId = Math.random() * 1000
|
||||
item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
|
||||
// 判断item是否存在children
|
||||
if (!item.children) return arr.push(item)
|
||||
// 函数递归,对children数组进行tree2List的转换
|
||||
const children = tree2List(item.children, item.uId)
|
||||
// 删除item的children属性
|
||||
delete item.children
|
||||
// 把item和children数组添加至结果数组
|
||||
//..children: 意思是把children数组展开
|
||||
arr.push(item, ...children)
|
||||
})
|
||||
// 返回结果数组
|
||||
return arr
|
||||
}
|
||||
|
||||
onMounted(() => {})
|
||||
|
||||
watch(
|
||||
() => treeData.value,
|
||||
(val, oldVal) => {
|
||||
if (val && val.length != 0) {
|
||||
formData.value.deptIndex = val[0].id
|
||||
tableStore.index()
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.table_legend {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
ul {
|
||||
width: 280px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
li {
|
||||
flex: 1;
|
||||
list-style-type: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
p {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,21 +9,21 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择电压等级" value-key="id">
|
||||
<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-form-item label="终端厂家">
|
||||
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
|
||||
clearable placeholder="请选择终端厂家" value-key="id">
|
||||
<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-form-item label="干扰源类型">
|
||||
<el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择干扰源类型" value-key="id">
|
||||
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<TableHeader :showReset="false" ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<el-dialog v-model="dialogVisible" draggable title="完整性不足详情" width="1000">
|
||||
<TableHeader :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>
|
||||
</template>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 模版 -->
|
||||
<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> -->
|
||||
</template>
|
||||
|
||||
@@ -9,26 +9,31 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择电压等级" value-key="id">
|
||||
<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-form-item label="终端厂家">
|
||||
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
|
||||
clearable placeholder="请选择终端厂家" value-key="id">
|
||||
<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-form-item label="干扰源类型">
|
||||
<el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择干扰源类型" value-key="id">
|
||||
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable style="width: 240px;"
|
||||
placeholder="请输入变电站、监测点、监测对象" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -68,14 +73,14 @@ const tableStore = new TableStore({
|
||||
{ field: 'lineScale', title: '电压等级', minWidth: "120px", },
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: "150px", },
|
||||
{ field: 'loadType', title: '干扰源类型', minWidth: "150px", },
|
||||
{ field: 'lineObjectName', title: '监测点对象名称', minWidth: "150px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
{ field: 'lineObjectName', title: '监测点对象名称', minWidth: "180px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
{ field: 'overDay', title: '超标天数', minWidth: "80px", },
|
||||
{ field: 'freqOverDay', title: '频率偏差超标天数', minWidth: "100px", },
|
||||
{ field: 'volDevOverDay', title: '电压偏差超标天数', minWidth: "100px", },
|
||||
{ field: 'volDisOverDay', title: '电压总畸变率超标天数', minWidth: "100px", },
|
||||
{ field: 'volContainOverDay', title: '谐波电压含有率超标天数', minWidth: "110px", },
|
||||
{ field: 'harmVolOverDay', title: '谐波电压超标天数', minWidth: "100px", },
|
||||
{ field: 'harmCurOverDay', title: '谐波电流超标天数', minWidth: "100px", },
|
||||
{ field: 'freqOverDay', title: '频率偏差', minWidth: "100px", },
|
||||
{ field: 'volDevOverDay', title: '电压偏差', minWidth: "100px", },
|
||||
{ field: 'volDisOverDay', title: '电压总畸变率', minWidth: "100px", },
|
||||
{ field: 'volContainOverDay', title: '谐波电压含有率', minWidth: "100px", },
|
||||
{ field: 'harmVolOverDay', title: '谐波电压', minWidth: "100px", },
|
||||
{ field: 'harmCurOverDay', title: '谐波电流', minWidth: "100px", },
|
||||
{
|
||||
title: '各次谐波电压含有率超标天数',
|
||||
children: [
|
||||
@@ -104,10 +109,11 @@ const tableStore = new TableStore({
|
||||
|
||||
],
|
||||
},
|
||||
{ field: 'threeUnbalance', title: '三相电压不平衡度超标天数', minWidth: "110px", },
|
||||
{ field: 'negativeOverDay', title: '负序电流超标天数', minWidth: "100px", },
|
||||
{ field: 'flickerOverDay', title: '闪变超标天数', minWidth: "100px", },
|
||||
{ field: 'monitorNumber', title: '监测点编号', minWidth: "180px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
{ field: 'intHarmOverDay', title: '间谐波电压含有率', minWidth: "100px", },
|
||||
{ field: 'threeUnbalance', title: '三相电压不平衡度', minWidth: "100px", },
|
||||
{ field: 'negativeOverDay', title: '负序电流', minWidth: "100px", },
|
||||
{ field: 'flickerOverDay', title: '闪变', minWidth: "100px", },
|
||||
{ field: 'monitorNumber', title: '监测点编号', minWidth: "100px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
|
||||
|
||||
|
||||
|
||||
@@ -125,6 +131,7 @@ tableStore.table.params.monitorFlag = 2
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.searchValue = ''
|
||||
const wp = ref({})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="default-main">
|
||||
<TableHeader datePicker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
@@ -16,7 +16,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
filterable
|
||||
@@ -34,7 +34,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
filterable
|
||||
@@ -52,7 +52,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-form-item label="干扰源类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
filterable
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" icon="el-icon-Search" @click="Search">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-Download" @click="exportTemplate">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
@@ -51,6 +52,7 @@
|
||||
:interval="datePickerRef?.interval"
|
||||
:w="item.w"
|
||||
:h="item.h"
|
||||
:searchKey="searchKey"
|
||||
/>
|
||||
<div v-else class="pd10">组件加载失败...</div>
|
||||
</div>
|
||||
@@ -114,6 +116,7 @@ const layout: any = ref([
|
||||
// path: '/src/views/pqs/runManage/assessment/components/uese/index.vue'
|
||||
// },
|
||||
])
|
||||
const searchKey = ref(0)
|
||||
const layoutCopy: any = ref([])
|
||||
const flag = ref(true)
|
||||
// 组件映射
|
||||
@@ -293,6 +296,10 @@ const fetchLayoutData = async () => {
|
||||
// 可以添加错误提示逻辑
|
||||
}
|
||||
}
|
||||
const Search = () => {
|
||||
searchKey.value += 1
|
||||
}
|
||||
|
||||
// 导出
|
||||
const exportTemplate = () => {
|
||||
console.log(123)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" />
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable style="width: 240px;" placeholder="请输入变电站、监测点、监测对象" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -162,14 +162,15 @@
|
||||
<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="deviceName" title="终端名称" minWidth="130px"></vxe-column>
|
||||
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="120px"></vxe-column>
|
||||
<vxe-column
|
||||
field="lineName"
|
||||
title="监测点名称"
|
||||
:formatter="formatter"
|
||||
minWidth="110px"
|
||||
minWidth="130px"
|
||||
></vxe-column>
|
||||
<vxe-column v-if="VITE_FLAG" field="objName" title="监测对象" minWidth="130px"></vxe-column>
|
||||
<vxe-column field="runFlag" title="运行状态" width="90px">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
@@ -222,6 +223,7 @@ defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
import { useRoute } from 'vue-router'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME != 'jibei'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
@@ -275,7 +277,7 @@ const tableStore = new TableStore({
|
||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||
return k.citTotalNum != 0
|
||||
} else {
|
||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||
return !k.citName.includes('上送')
|
||||
}
|
||||
})
|
||||
// 合并子集数据 并去重
|
||||
|
||||
@@ -160,8 +160,9 @@
|
||||
<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="deviceName" title="终端名称" minWidth="130px"></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
|
||||
@@ -214,6 +215,7 @@ defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
import { useRoute } from 'vue-router'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME != 'jibei'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
@@ -268,7 +270,7 @@ const tableStore = new TableStore({
|
||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||
return k.citTotalNum != 0
|
||||
} else {
|
||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||
return !k.citName.includes('上送')
|
||||
}
|
||||
})
|
||||
// console.log(123, tableStore.table.params.statisticalType.name)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<el-tab-pane label="稳态指标合格率" name="2" lazy v-if="!isReload">
|
||||
<Wentaizhibiaohegelv v-if="activeName == '2'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="稳态数据分析" name="3" lazy v-if="!isReload">
|
||||
<el-tab-pane label="稳态数据分析" name="3" lazy v-if="!isReload && !IS_LNQR">
|
||||
<Wentaishujufenxi v-if="activeName == '3'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="谐波频谱" name="4" lazy v-if="!isReload">
|
||||
@@ -41,7 +41,7 @@
|
||||
<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 && !VITE_FLAG1">
|
||||
<el-tab-pane label="实时数据" name="7" lazy v-if="!isReload && !VITE_FLAG1 && !IS_LNQR">
|
||||
<Shishishuju v-if="activeName == '7'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="统计报表" name="8" lazy v-if="!isReload && VITE_FLAG">
|
||||
@@ -77,6 +77,8 @@ import { useRoute } from 'vue-router'
|
||||
import StatisticalReport from './statisticalReport/index.vue'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const VITE_FLAG1 = import.meta.env.VITE_NAME == 'hainan'
|
||||
// 环境标识
|
||||
const IS_LNQR = import.meta.env.VITE_NAME === 'LNqr'
|
||||
import router from '@/router'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { id } from 'element-plus/es/locale'
|
||||
|
||||
@@ -744,16 +744,6 @@ const initEcharts = (color: string, key: number, name: string) => {
|
||||
}
|
||||
//渲染echarts
|
||||
const init = () => {
|
||||
loading.value = true
|
||||
const url = localStorage.getItem('WebSocketUrl') || 'ws://192.168.1.68:10407/api/pushMessage/'
|
||||
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
||||
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
||||
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
||||
|
||||
echartsDataA1.value = initEcharts('#DAA520', 1, 'A相')
|
||||
echartsDataA2.value = initEcharts('#2E8B57', 1, 'B相')
|
||||
echartsDataA3.value = initEcharts('#A52a2a', 1, 'C相')
|
||||
|
||||
if (!dataSocket.socketServe) {
|
||||
console.error('WebSocket 客户端实例不存在')
|
||||
return
|
||||
@@ -765,9 +755,22 @@ const init = () => {
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
loading.value = true
|
||||
const url = localStorage.getItem('WebSocketUrl') || 'null' //'ws://192.168.1.68:10407/api/pushMessage/'
|
||||
echartsDataV1.value = initEcharts('#DAA520', 0, 'A相')
|
||||
echartsDataV2.value = initEcharts('#2E8B57', 0, 'B相')
|
||||
echartsDataV3.value = initEcharts('#A52a2a', 0, 'C相')
|
||||
|
||||
echartsDataA1.value = initEcharts('#DAA520', 1, 'A相')
|
||||
echartsDataA2.value = initEcharts('#2E8B57', 1, 'B相')
|
||||
echartsDataA3.value = initEcharts('#A52a2a', 1, 'C相')
|
||||
|
||||
let pids = monitoringPoint.state.pid.split(',')
|
||||
dataSocket.socketServe.connect(`${url}${adminInfo.id},${monitoringPoint.state.lineId},${pids[pids.length - 2]}`)
|
||||
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||
if (res.Flag === false) {
|
||||
return (loading.value = false)
|
||||
}
|
||||
txtContent.value = res.value
|
||||
let data = JSON.parse(res.value)
|
||||
time.value = data.TIME - 0
|
||||
@@ -779,12 +782,12 @@ const init = () => {
|
||||
iRmsA: data.I.A?.IRMS, //A相电流
|
||||
iRmsB: data.I.B?.IRMS, //B相电流
|
||||
iRmsC: data.I.C?.IRMS, //C相电流
|
||||
v1AngA: data.V.A?.VFUND_ANGLE, //A相基波电压相位
|
||||
v1AngB: data.V.B?.VFUND_ANGLE, //B相基波电压相位
|
||||
v1AngC: data.V.C?.VFUND_ANGLE, //C相基波电压相位
|
||||
i1AngA: data.I.A?.I_ANGLE, //A相基波电流相位
|
||||
i1AngB: data.I.B?.I_ANGLE, //B相基波电流相位
|
||||
i1AngC: data.I.C?.I_ANGLE, //C相基波电流相位
|
||||
v1AngA: steAngle(data.V.A?.VFUND_ANGLE), //A相基波电压相位
|
||||
v1AngB: steAngle(data.V.B?.VFUND_ANGLE), //B相基波电压相位
|
||||
v1AngC: steAngle(data.V.C?.VFUND_ANGLE), //C相基波电压相位
|
||||
i1AngA: steAngle(data.I.A?.I_ANGLE), //A相基波电流相位
|
||||
i1AngB: steAngle(data.I.B?.I_ANGLE), //B相基波电流相位
|
||||
i1AngC: steAngle(data.I.C?.I_ANGLE), //C相基波电流相位
|
||||
freq: data.V.T?.FREQ, //频率
|
||||
freqDev: data.V.T?.DELTA_FREQ, //频率偏差
|
||||
vUnbalance: data.V.T?.V_UNBAN, //电压不平衡度
|
||||
@@ -950,6 +953,20 @@ const setRealData = () => {
|
||||
]
|
||||
pieChart6.value.initChart()
|
||||
}
|
||||
const steAngle = (phase: any) => {
|
||||
// 空值判断
|
||||
if (phase === null || phase === undefined) {
|
||||
return null
|
||||
}
|
||||
let normalizedPhase = phase % 360
|
||||
if (normalizedPhase > 180) {
|
||||
normalizedPhase -= 360
|
||||
} else if (normalizedPhase < -180) {
|
||||
normalizedPhase += 360
|
||||
}
|
||||
|
||||
return normalizedPhase
|
||||
}
|
||||
defineExpose({ setRealData })
|
||||
onMounted(() => {
|
||||
init()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
placeholder="筛选数据"
|
||||
placeholder="请输入关键字"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
@@ -11,11 +11,12 @@
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" datePicker :show-search="false">
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent" :loading="loading">
|
||||
<el-button icon="el-icon-Download" type="primary" @click="openDialog" :loading="loading">
|
||||
生成
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div class="box">
|
||||
<div id="luckysheet">
|
||||
<img
|
||||
@@ -25,13 +26,46 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 电压等级选择弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
title="选择电压等级"
|
||||
width="420px"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form label-width="100px" style="padding:10px 0;">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select
|
||||
v-model="voltageLevel"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
value-key="id"
|
||||
placeholder="请选择电压等级"
|
||||
style="width: 260px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmExport" :loading="loading">确定并生成</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import { onMounted, ref, provide, watch } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
@@ -40,8 +74,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { areaHarmonicReport } from '@/api/process-boot/reportForms'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
defineOptions({
|
||||
@@ -53,7 +86,11 @@ const loading = ref(false)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
const Template: any = ref({})
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand') || []
|
||||
const voltageLevel: any = ref([])
|
||||
|
||||
// 弹窗状态
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
@@ -64,9 +101,15 @@ const tableStore = new TableStore({
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
// 弹窗打开时默认全选所有电压等级
|
||||
watch(dialogVisible, (val) => {
|
||||
if (val && voltageleveloption.length) {
|
||||
voltageLevel.value = [...voltageleveloption]
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||
}
|
||||
@@ -76,45 +119,62 @@ const handleNodeClick = (data: any, node: any) => {
|
||||
dotList.value = data
|
||||
}
|
||||
|
||||
// 生成
|
||||
const exportEvent = () => {
|
||||
// 打开弹窗
|
||||
const openDialog = () => {
|
||||
if (!dotList.value?.id) {
|
||||
ElMessage.warning('请先在左侧选择站点/区域')
|
||||
return
|
||||
}
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// 确认生成
|
||||
const confirmExport = async () => {
|
||||
loading.value = true
|
||||
ElMessage('生成报告中...')
|
||||
areaHarmonicReport({
|
||||
deptId: dotList.value.id,
|
||||
areaReportFlag: 1,
|
||||
startTime: TableHeaderRef.value.datePickerRef.timeValue[0],
|
||||
endTime: TableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
})
|
||||
.then((res: any) => {
|
||||
if (res == undefined) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
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 + '区域稳态报告' + dayjs().format('YYYYMMDD') // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
loading.value = false
|
||||
try {
|
||||
// 选中数据转为id数组,空数组代表导出全部
|
||||
const voltageIds = voltageLevel.value.map((item: any) => item.id)
|
||||
const res: any = await areaHarmonicReport({
|
||||
deptId: dotList.value.id,
|
||||
areaReportFlag: 1,
|
||||
startTime: TableHeaderRef.value.datePickerRef.timeValue[0],
|
||||
endTime: TableHeaderRef.value.datePickerRef.timeValue[1],
|
||||
voltageIds
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
if (!res) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
|
||||
const blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = dotList.value.name + '区域稳态报告' + dayjs().format('YYYYMMDD')
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
URL.revokeObjectURL(url)
|
||||
|
||||
ElMessage.success('生成成功')
|
||||
dialogVisible.value = false
|
||||
} catch (e) {
|
||||
ElMessage.error('生成失败,请重试')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,14 @@
|
||||
></PointTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" datePicker @selectChange="selectChange">
|
||||
<TableHeader ref="TableHeaderRef" datePicker :isStatisticData="isStatisticData" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
<el-form-item >
|
||||
<el-radio-group v-model="isStatisticData" @change="onStatisticDataChange">
|
||||
<el-radio-button value="1">统计数据</el-radio-button>
|
||||
<el-radio-button value="0">分钟数据</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板策略">
|
||||
<el-select v-model="Template" @change="changetype" placeholder="请选择模版" value-key="id">
|
||||
<el-option
|
||||
@@ -22,22 +28,10 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报表类型">
|
||||
<!-- <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>
|
||||
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
|
||||
@@ -85,6 +79,7 @@ const dotList: any = ref({})
|
||||
const Template: any = ref({})
|
||||
const reportForm: any = ref('')
|
||||
const name = ref('')
|
||||
const isStatisticData = ref('1')
|
||||
const templatePolicy: any = ref([])
|
||||
const reportFormList: any = ref([
|
||||
{
|
||||
@@ -108,6 +103,11 @@ const tableStore = new TableStore({
|
||||
tableStore.table.params.tempId = Template.value.id
|
||||
tableStore.table.params.lineId = dotList.value.id
|
||||
name.value = dotList.value.name
|
||||
if (Number(isStatisticData.value) === 0) {
|
||||
tableStore.table.params.isStatisticData = 0
|
||||
} else {
|
||||
delete tableStore.table.params.isStatisticData
|
||||
}
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
@@ -160,6 +160,12 @@ getTemplateByDept({ id: dictData.state.area[0].id })
|
||||
const changetype = (val: any) => {
|
||||
reportForm.value = val.reportForm
|
||||
}
|
||||
const onStatisticDataChange = () => {
|
||||
TableHeaderRef.value?.setTheDate(3)
|
||||
if (dotList.value?.id) {
|
||||
// tableStore.index()
|
||||
}
|
||||
}
|
||||
const selectChange = () => {
|
||||
//console.log('🚀 ~ selectChange ~ tableStore.table.data.lnegth :', tableStore.table.data.length)
|
||||
if (tableStore.table.data.length != 0) {
|
||||
|
||||
@@ -3,101 +3,47 @@
|
||||
<TableHeader area ref="TableHeaderRef" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="运行状态">
|
||||
<el-select
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
v-model="tableStore.table.params.runFlag" clearable placeholder="请选择运行状态">
|
||||
<el-option
|
||||
v-for="item in runFlagList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据筛选">
|
||||
<el-input
|
||||
style="width: 240px"
|
||||
placeholder="电站名称,终端编号,监测点名称、电压等级、终端厂家、干扰源类型"
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯状态:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.comFlag"
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择通讯状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in communicationstatus"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-select filterable multiple collapse-tags v-model="tableStore.table.params.runFlag" clearable
|
||||
placeholder="请选择运行状态">
|
||||
<el-option v-for="item in runFlagList" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择电压等级"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-form-item label="通讯状态">
|
||||
<el-select v-model="tableStore.table.params.comFlag" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择通讯状态">
|
||||
<el-option v-for="item in communicationstatus" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择终端厂家"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in terminaloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
|
||||
<el-form-item label="电压等级">
|
||||
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择电压等级" value-key="id">
|
||||
<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.loadType"
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择干扰源类型"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in interfereoption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
|
||||
clearable placeholder="请选择终端厂家" value-key="id">
|
||||
<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" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择干扰源类型" value-key="id">
|
||||
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据筛选">
|
||||
<el-input style="width: 240px" placeholder="电站名称,终端编号,监测点名称、电压等级、终端厂家、干扰源类型"
|
||||
v-model="tableStore.table.params.searchValue" clearable maxlength="32"
|
||||
show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template #operation>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<TableHeader area>
|
||||
<template #select>
|
||||
<el-form-item label="监测点性质:">
|
||||
<el-form-item label="监测点性质">
|
||||
<el-select v-model="tableStore.table.params.powerFlag" filterable collapse-tags
|
||||
placeholder="请选择监测点性质">
|
||||
<el-option v-for="item in terminalstatus" :key="item.value" :label="item.label"
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择电压等级" value-key="id">
|
||||
<el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name" :value="item">
|
||||
@@ -19,14 +19,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
|
||||
clearable placeholder="请选择终端厂家" value-key="id">
|
||||
<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-form-item label="干扰源类型">
|
||||
<el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
|
||||
placeholder="请选择干扰源类型" value-key="id">
|
||||
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
|
||||
|
||||
<el-form-item label="上报类型:">
|
||||
<el-form-item label="上报类型">
|
||||
<el-select v-model="tableStore.table.params.monitorFlag"
|
||||
placeholder="请选择上报类型">
|
||||
<el-option v-for="item in communicationstatus" :key="item.value" :label="item.label"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
filterable
|
||||
@@ -29,10 +29,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据筛选">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入市公司、变电站、用户" />
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="输入市公司、变电站、用户"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通讯状态:">
|
||||
<el-form-item label="通讯状态">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.comF"
|
||||
filterable
|
||||
@@ -49,7 +53,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端状态:">
|
||||
<el-form-item label="终端状态">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.runF"
|
||||
filterable
|
||||
@@ -66,7 +70,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-form-item label="干扰源类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
filterable
|
||||
@@ -84,7 +88,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电压等级:">
|
||||
<el-form-item label="电压等级">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
filterable
|
||||
@@ -102,8 +106,6 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
@@ -115,6 +117,10 @@ 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'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/run/terminalmessage'
|
||||
})
|
||||
|
||||
const dictData = useDictData()
|
||||
|
||||
const view = ref(true)
|
||||
@@ -159,7 +165,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'manufacturer', title: '厂家', minWidth: 100 },
|
||||
|
||||
{ field: 'devName', title: '终端名称', minWidth: 100 },
|
||||
{ field: 'ip', title: '网络参数' ,width:110 },
|
||||
{ field: 'ip', title: '网络参数', width: 110 },
|
||||
{ field: 'loginTime', title: '投运时间', minWidth: 90 },
|
||||
{ field: 'devType', title: '终端型号', minWidth: 100 },
|
||||
{ field: 'port', title: '端口', minWidth: 60 },
|
||||
@@ -186,8 +192,7 @@ const tableStore = new TableStore({
|
||||
正常: 'success',
|
||||
中断: 'danger'
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
@@ -199,11 +204,11 @@ const tableStore = new TableStore({
|
||||
|
||||
tableStore.table.params.runFlag = []
|
||||
if (tableStore.table.params.runF != null && tableStore.table.params.runF != '') {
|
||||
tableStore.table.params.runFlag = [tableStore.table.params.runF]
|
||||
tableStore.table.params.runFlag = tableStore.table.params.runF
|
||||
}
|
||||
tableStore.table.params.comFlag = []
|
||||
if (tableStore.table.params.comF != null&&tableStore.table.params.comF != '') {
|
||||
tableStore.table.params.comFlag = [tableStore.table.params.comF]
|
||||
if (tableStore.table.params.comF != null && tableStore.table.params.comF != '') {
|
||||
tableStore.table.params.comFlag = tableStore.table.params.comF
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -220,7 +225,6 @@ tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,28 +3,38 @@
|
||||
<DatePicker ref="datePickerRef" style="display: none" theCurrentTime />
|
||||
<el-page-header :icon="ArrowLeft" @back="emit('back')">
|
||||
<template #content>
|
||||
<span style="font-size: 16px">{{ dropList.lineName }}详情 </span>
|
||||
<span style="font-weight: 500">最新数据时间:</span>
|
||||
<span style="color: var(--color-primary-default)">{{ dropList.updateTime }}</span>
|
||||
<span style="">{{ dropList.gdName }}_{{ dropList.bdName }}_{{ dropList.lineName }}</span>
|
||||
<span style="font-weight: 500" class="ml20">最新数据时间:</span>
|
||||
<span style="color: var(--el-color-primary)">{{ dropList.updateTime }}</span>
|
||||
<span style="font-weight: 500" class="ml20">统计日期:</span>
|
||||
<span style="color: var(--el-color-primary)">
|
||||
{{ getTimeOfTheMonth('3')[0] + '至' + getTimeOfTheMonth('3')[1] }}
|
||||
</span>
|
||||
</template>
|
||||
</el-page-header>
|
||||
<el-row :gutter="20" class="mt10" :style="`height:${rowHeight}`">
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<h3 class="mb10 iconBox " >
|
||||
<span></span>
|
||||
台账信息
|
||||
</h3>
|
||||
<el-descriptions title="" border :column="2">
|
||||
<el-descriptions-item label="监测点名称" width="140px">
|
||||
<el-descriptions title="" label-width="100px" border :column="2" size="small">
|
||||
<el-descriptions-item label="变电站名称">
|
||||
{{ dropList.bdName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="监测点名称">
|
||||
{{ dropList.lineName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="监测对象名称">
|
||||
{{ dropList.objName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属厂家">{{ dropList.manufacturer }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电压等级">{{ dropList.scale }}</el-descriptions-item>
|
||||
<el-descriptions-item label="投运日期">{{ dropList.loginTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="PT">{{ dropList.pt }}</el-descriptions-item>
|
||||
<el-descriptions-item label="CT">{{ dropList.ct }}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="PT">{{ dropList.pt }}</el-descriptions-item>
|
||||
<el-descriptions-item label="CT">{{ dropList.ct }}</el-descriptions-item> -->
|
||||
<el-descriptions-item label="干扰源类型">{{ dropList.loadType }}</el-descriptions-item>
|
||||
<el-descriptions-item label="通讯状态" width="140px">
|
||||
<el-descriptions-item label="通讯状态">
|
||||
<el-tag size="small" :type="dropList.comFlag == '正常' ? 'success' : 'danger'" effect="dark">
|
||||
{{ dropList.comFlag }}
|
||||
</el-tag>
|
||||
@@ -32,22 +42,33 @@
|
||||
</el-descriptions>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<h3
|
||||
class="mb10 iconBox "
|
||||
|
||||
>
|
||||
<span></span>
|
||||
告警明细 (天)
|
||||
告警天数
|
||||
</h3>
|
||||
<el-descriptions title="" border :column="2" size="small">
|
||||
<el-descriptions-item width="140px" label="告警原因">
|
||||
<span style="font-weight: 550"
|
||||
:style="TargetData.info == 0 ? 'color: #0e8780;' : TargetData.info == 3 ? 'color: #000' : 'color: #ff0000;'">
|
||||
<span
|
||||
style="font-weight: 550"
|
||||
:style="
|
||||
TargetData.info == 0
|
||||
? 'color: #0e8780;'
|
||||
: TargetData.info == 3
|
||||
? 'color: #000'
|
||||
: 'color: #ff0000;'
|
||||
"
|
||||
>
|
||||
{{
|
||||
TargetData.info == 1
|
||||
? '超标告警'
|
||||
: TargetData.info == 2
|
||||
? '完整性告警'
|
||||
: TargetData.info == 0
|
||||
? '无告警'
|
||||
: '暂无数据'
|
||||
? '完整性告警'
|
||||
: TargetData.info == 0
|
||||
? '无告警'
|
||||
: '暂无数据'
|
||||
}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
@@ -72,72 +93,27 @@
|
||||
数据质量
|
||||
</h3>
|
||||
<div style="display: flex">
|
||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="ComCharts" @click="Integrity" />
|
||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="onLineCharts"
|
||||
@click="OnlineRate" />
|
||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="ComCharts" />
|
||||
<MyEChart
|
||||
:style="`height: calc(${rowHeight} - 31px)`"
|
||||
:options="onLineCharts"
|
||||
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" class="mt10" :style="`height:${rowHeight}`">
|
||||
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
监测点总体评价结论
|
||||
</h3>
|
||||
|
||||
<div class="evaluationData">
|
||||
<el-row style="width: 96%" class="row pb5">
|
||||
<el-col :span="12" style="display: flex">
|
||||
<span>{{ dropList.lineName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12" style="display: flex">
|
||||
<div>
|
||||
综合评估得分:
|
||||
<span class="conclusion" :class="dropList.assessData == '特质'
|
||||
? 'background1'
|
||||
: dropList.assessData == '较差'
|
||||
? 'background2'
|
||||
: dropList.assessData == '极差'
|
||||
? 'background3'
|
||||
: ''
|
||||
">
|
||||
{{ dropList.assessData }}
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="width: 96%" v-for="(item, i) in evaluationData" class="row pb4 pt3">
|
||||
<el-col :span="14" style="display: flex; align-items: center">
|
||||
<img :src="url[i]" />
|
||||
<span style="line-height: 20px">{{ item.targetName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="10" style="display: flex; align-items: center">
|
||||
<div style="width: 100%">
|
||||
评估得分:
|
||||
<span class="conclusion" :class="item.avg == '特质'
|
||||
? 'background1'
|
||||
: item.avg == '较差'
|
||||
? 'background2'
|
||||
: item.avg == '极差'
|
||||
? 'background3'
|
||||
: ''
|
||||
">
|
||||
{{ item.avg }}
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<h3 class="mb10 iconBox ">
|
||||
<span></span>
|
||||
稳态指标合格率
|
||||
</h3>
|
||||
<div :style="`height: calc(${rowHeight} - 31px)`" ref="chartRef"></div>
|
||||
|
||||
<div :style="`height: calc(${rowHeight} - 31px); `" ref="chartRef"></div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<h3 class="mb10 iconBox" >
|
||||
<span></span>
|
||||
暂态事件统计
|
||||
</h3>
|
||||
@@ -167,6 +143,7 @@ import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||
import echarts from '@/components/echarts/echarts'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
const router = useRouter()
|
||||
import { getLineDetailData } from '@/api/advance-boot/bearingCapacity'
|
||||
import {
|
||||
@@ -175,14 +152,14 @@ import {
|
||||
lineQualifiedDetail,
|
||||
getLineAssess,
|
||||
getEventDetailByLineId,
|
||||
getGridDiagramTargetData
|
||||
getGridDiagramTargetData,
|
||||
|
||||
} from '@/api/device-boot/panorama'
|
||||
import { formatter } from 'element-plus'
|
||||
|
||||
const loading=ref(false)
|
||||
const emit = defineEmits(['back'])
|
||||
const dropList: any = ref({})
|
||||
const TargetData: any = ref({})
|
||||
const evaluationData: any = ref([])
|
||||
const incidentCharts: any = ref({})
|
||||
const ComCharts: any = ref({})
|
||||
const onLineCharts: any = ref({})
|
||||
@@ -362,42 +339,8 @@ const open = async (id: string) => {
|
||||
}
|
||||
}
|
||||
})
|
||||
loading.value = true
|
||||
|
||||
// 监测点总体评价结论
|
||||
getLineAssess({
|
||||
lineId: id,
|
||||
startTime: datePickerRef.value.timeValue[0],
|
||||
endTime: datePickerRef.value.timeValue[1]
|
||||
}).then((res: any) => {
|
||||
dropList.value.assessData = res.data.assessLevel
|
||||
evaluationData.value = [
|
||||
{
|
||||
targetName: '频率偏差(Hz)',
|
||||
avg: res.data.freqAssessLevel,
|
||||
sd: res.data.freqQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '电压偏差(%)',
|
||||
avg: res.data.vdevAssessLevel,
|
||||
sd: res.data.vdevQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '电压总谐波畸变率(%)',
|
||||
avg: res.data.harmAssessLevel,
|
||||
sd: res.data.harmQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '三相电压不平衡度(%)',
|
||||
avg: res.data.unbalanceAssessLevel,
|
||||
sd: res.data.unbalanceQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '闪变',
|
||||
avg: res.data.flickerAssessLevel,
|
||||
sd: res.data.flickerQualifyData
|
||||
}
|
||||
]
|
||||
})
|
||||
// 稳态指标合格率
|
||||
|
||||
lineQualifiedDetail({
|
||||
@@ -522,7 +465,7 @@ const open = async (id: string) => {
|
||||
if (res.data[k] != '/') {
|
||||
judgment = false
|
||||
}
|
||||
flag += (res.data[k] == '/' ? 0 : res.data[k])
|
||||
flag += res.data[k] == '/' ? 0 : res.data[k]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -633,7 +576,7 @@ const echart = (row: any) => {
|
||||
},
|
||||
indicator: indicator
|
||||
},
|
||||
|
||||
color: color,
|
||||
series: []
|
||||
}
|
||||
|
||||
@@ -642,32 +585,25 @@ const echart = (row: any) => {
|
||||
name: item.time,
|
||||
type: 'radar',
|
||||
symbol: 'none',
|
||||
|
||||
areaStyle: {
|
||||
normal: {
|
||||
color: '#2a9fe069'
|
||||
}
|
||||
opacity: 0.6, // 调整透明度,避免重叠遮挡
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: `${color[i]}50` },
|
||||
{ offset: 1, color: `${color[i]}50` } // 渐变透明
|
||||
])
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#2a9fe0'
|
||||
lineStyle: {
|
||||
color: color[i],
|
||||
width: 2
|
||||
},
|
||||
data: [item.ratioList]
|
||||
})
|
||||
})
|
||||
// console.log("🚀 ~ echart ~ option:", option)
|
||||
|
||||
chart.setOption(option)
|
||||
}
|
||||
// 跳转
|
||||
const Integrity = () => {
|
||||
router.push({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
}
|
||||
const OnlineRate = () => {
|
||||
router.push({
|
||||
name: 'harmonic-boot/area/OnlineRate'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
// open('4c87b7dff2281254fc55c25a4da31506')
|
||||
@@ -708,7 +644,7 @@ defineExpose({ open })
|
||||
|
||||
.iconBox {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
@@ -737,7 +673,16 @@ defineExpose({ open })
|
||||
}
|
||||
|
||||
.background3 {
|
||||
background-color: #A52a2a;
|
||||
background-color: #a52a2a;
|
||||
color: #fff;
|
||||
}
|
||||
:deep(.el-table--small .el-table__cell) {
|
||||
padding: 2px 0 !important;
|
||||
}
|
||||
.text-style {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
text-decoration-color: var(--el-color-primary);
|
||||
text-underline-offset: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
743
src/views/pqs/panorama/components/line/info1.vue
Normal file
743
src/views/pqs/panorama/components/line/info1.vue
Normal file
@@ -0,0 +1,743 @@
|
||||
<template>
|
||||
<div class="default-main lineInfo" :style="height">
|
||||
<DatePicker ref="datePickerRef" style="display: none" theCurrentTime />
|
||||
<el-page-header :icon="ArrowLeft" @back="emit('back')">
|
||||
<template #content>
|
||||
<span style="font-size: 16px">{{ dropList.objName ? dropList.objName + '_' : '' }}{{ dropList.lineName }}详情 </span>
|
||||
<span style="font-weight: 500">最新数据时间:</span>
|
||||
<span style="color: var(--color-primary-default)">{{ dropList.updateTime }}</span>
|
||||
</template>
|
||||
</el-page-header>
|
||||
<el-row :gutter="20" class="mt10" :style="`height:${rowHeight}`">
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
台账信息
|
||||
</h3>
|
||||
<el-descriptions title="" border :column="2">
|
||||
<el-descriptions-item label="监测点名称" width="140px">
|
||||
{{ dropList.lineName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属厂家">{{ dropList.manufacturer }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电压等级">{{ dropList.scale }}</el-descriptions-item>
|
||||
<el-descriptions-item label="投运日期">{{ dropList.loginTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="PT">{{ dropList.pt }}</el-descriptions-item>
|
||||
<el-descriptions-item label="CT">{{ dropList.ct }}</el-descriptions-item>
|
||||
<el-descriptions-item label="干扰源类型">{{ dropList.loadType }}</el-descriptions-item>
|
||||
<el-descriptions-item label="通讯状态" width="140px">
|
||||
<el-tag size="small" :type="dropList.comFlag == '正常' ? 'success' : 'danger'" effect="dark">
|
||||
{{ dropList.comFlag }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
告警明细 (天)
|
||||
</h3>
|
||||
<el-descriptions title="" border :column="2" size="small">
|
||||
<el-descriptions-item width="140px" label="告警原因">
|
||||
<span style="font-weight: 550"
|
||||
:style="TargetData.info == 0 ? 'color: #0e8780;' : TargetData.info == 3 ? 'color: #000' : 'color: #ff0000;'">
|
||||
{{
|
||||
TargetData.info == 1
|
||||
? '超标告警'
|
||||
: TargetData.info == 2
|
||||
? '完整性告警'
|
||||
: TargetData.info == 0
|
||||
? '无告警'
|
||||
: '暂无数据'
|
||||
}}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="频率偏差">{{ TargetData.freqDevOvertime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电压偏差">{{ TargetData.voltageDevOvertime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="谐波电流">{{ TargetData.iharmOvertime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负序电流">{{ TargetData.inegOvertime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="间谐波电压">{{ TargetData.inuharmOvertime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电压总谐波畸变率">
|
||||
{{ TargetData.uaberranceOvertime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="闪变">{{ TargetData.flickerOvertime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="谐波电压">{{ TargetData.uharmOvertime }}</el-descriptions-item>
|
||||
<el-descriptions-item width="140px" label="三相电压不平衡度">
|
||||
{{ TargetData.ubalanceOvertime }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
数据质量
|
||||
</h3>
|
||||
<div style="display: flex">
|
||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="ComCharts" @click="Integrity" />
|
||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="onLineCharts"
|
||||
@click="OnlineRate" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" class="mt10" :style="`height:${rowHeight}`">
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
监测点总体评价结论
|
||||
</h3>
|
||||
|
||||
<div class="evaluationData">
|
||||
<el-row style="width: 96%" class="row pb5">
|
||||
<el-col :span="12" style="display: flex">
|
||||
<span>{{ dropList.lineName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="12" style="display: flex">
|
||||
<div>
|
||||
综合评估得分:
|
||||
<span class="conclusion" :class="dropList.assessData == '特质'
|
||||
? 'background1'
|
||||
: dropList.assessData == '较差'
|
||||
? 'background2'
|
||||
: dropList.assessData == '极差'
|
||||
? 'background3'
|
||||
: ''
|
||||
">
|
||||
{{ dropList.assessData }}
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="width: 96%" v-for="(item, i) in evaluationData" class="row pb4 pt3">
|
||||
<el-col :span="14" style="display: flex; align-items: center">
|
||||
<img :src="url[i]" />
|
||||
<span style="line-height: 20px">{{ item.targetName }}</span>
|
||||
</el-col>
|
||||
<el-col :span="10" style="display: flex; align-items: center">
|
||||
<div style="width: 100%">
|
||||
评估得分:
|
||||
<span class="conclusion" :class="item.avg == '特质'
|
||||
? 'background1'
|
||||
: item.avg == '较差'
|
||||
? 'background2'
|
||||
: item.avg == '极差'
|
||||
? 'background3'
|
||||
: ''
|
||||
">
|
||||
{{ item.avg }}
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
稳态指标合格率
|
||||
</h3>
|
||||
<div :style="`height: calc(${rowHeight} - 31px)`" ref="chartRef"></div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
暂态事件统计
|
||||
</h3>
|
||||
|
||||
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="incidentCharts" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" class="mt10" :style="`height:${rowHeight}`">
|
||||
<el-col :span="24">
|
||||
<h3 class="mb10 iconBox">
|
||||
<span></span>
|
||||
历史趋势图
|
||||
</h3>
|
||||
<history :lineId="lineId" ref="historyRef" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref, provide } from 'vue'
|
||||
import { ArrowLeft } from '@element-plus/icons-vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import history from './history.vue'
|
||||
import { color } from '@/components/echarts/color'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||
import echarts from '@/components/echarts/echarts'
|
||||
import { useRouter } from 'vue-router'
|
||||
const router = useRouter()
|
||||
import { getLineDetailData } from '@/api/advance-boot/bearingCapacity'
|
||||
import {
|
||||
getTotalIntegrityByLineIds,
|
||||
getTotalOnlineRates,
|
||||
lineQualifiedDetail,
|
||||
getLineAssess,
|
||||
getEventDetailByLineId,
|
||||
getGridDiagramTargetData
|
||||
} from '@/api/device-boot/panorama'
|
||||
import { formatter } from 'element-plus'
|
||||
|
||||
const emit = defineEmits(['back'])
|
||||
const dropList: any = ref({})
|
||||
const TargetData: any = ref({})
|
||||
const evaluationData: any = ref([])
|
||||
const incidentCharts: any = ref({})
|
||||
const ComCharts: any = ref({})
|
||||
const onLineCharts: any = ref({})
|
||||
const datePickerRef = ref()
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
const historyRef = ref()
|
||||
const IntegrityNum = ref(0)
|
||||
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 lineId: any = ref('')
|
||||
const height = mainHeight(20)
|
||||
const rowHeight = mainHeight(190, 3).height
|
||||
|
||||
// 查询
|
||||
const open = async (id: string) => {
|
||||
let form = {
|
||||
comFlag: 1,
|
||||
endTime: datePickerRef.value.timeValue[1],
|
||||
lineIds: [id],
|
||||
|
||||
ids: [id],
|
||||
searchValue: '',
|
||||
startTime: datePickerRef.value.timeValue[0]
|
||||
}
|
||||
lineId.value = id
|
||||
const { data } = await getLineDetailData({ id: id })
|
||||
dropList.value = data
|
||||
// 运行状态
|
||||
|
||||
// 完整性
|
||||
getTotalIntegrityByLineIds(form).then((res: any) => {
|
||||
let num = (res.data || 0) / 100
|
||||
IntegrityNum.value = res.data
|
||||
ComCharts.value = {
|
||||
title: {
|
||||
text: '完整性',
|
||||
bottom: '10%',
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
show: false
|
||||
},
|
||||
yAxis: {
|
||||
show: false
|
||||
},
|
||||
|
||||
options: {
|
||||
dataZoom: null,
|
||||
series: [
|
||||
{
|
||||
//第二个球的填充
|
||||
type: 'liquidFill',
|
||||
radius: '65%',
|
||||
center: ['50%', '40%'], //中心点
|
||||
color: [
|
||||
{
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#2aa1e3'
|
||||
}
|
||||
],
|
||||
globalCoord: false
|
||||
}
|
||||
],
|
||||
data: [num, num], // data个数代表波浪数
|
||||
backgroundStyle: {
|
||||
borderWidth: 1,
|
||||
color: '#f7f8fc'
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
formatter: () => {
|
||||
return (num * 100).toFixed(2) + '%'
|
||||
},
|
||||
textStyle: {
|
||||
fontSize: 20,
|
||||
color: '#000'
|
||||
}
|
||||
}
|
||||
},
|
||||
outline: {
|
||||
// show: false
|
||||
borderDistance: 0,
|
||||
itemStyle: {
|
||||
borderWidth: 2,
|
||||
borderColor: '#fff'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
// 稳态指标合格率
|
||||
})
|
||||
// 在线率
|
||||
getTotalOnlineRates({ ...form, id: dropList.value.devId, ids: [dropList.value.devId] }).then((res: any) => {
|
||||
let num = (res.data || 0) / 100
|
||||
onLineCharts.value = {
|
||||
title: {
|
||||
text: '在线率',
|
||||
bottom: '10%',
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
show: false
|
||||
},
|
||||
yAxis: {
|
||||
show: false
|
||||
},
|
||||
|
||||
options: {
|
||||
dataZoom: null,
|
||||
series: [
|
||||
{
|
||||
//第二个球的填充
|
||||
type: 'liquidFill',
|
||||
radius: '65%',
|
||||
center: ['50%', '40%'], //中心点
|
||||
color: [
|
||||
{
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#67c23a'
|
||||
}
|
||||
],
|
||||
globalCoord: false
|
||||
}
|
||||
],
|
||||
data: [num, num], // data个数代表波浪数
|
||||
backgroundStyle: {
|
||||
color: '#f7f8fc'
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
formatter: () => {
|
||||
return (num * 100).toFixed(2) + '%'
|
||||
},
|
||||
textStyle: {
|
||||
fontSize: 20,
|
||||
color: '#000'
|
||||
}
|
||||
}
|
||||
},
|
||||
outline: {
|
||||
// show: false
|
||||
borderDistance: 0,
|
||||
itemStyle: {
|
||||
borderWidth: 2,
|
||||
borderColor: '#fff'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 监测点总体评价结论
|
||||
getLineAssess({
|
||||
lineId: id,
|
||||
startTime: datePickerRef.value.timeValue[0],
|
||||
endTime: datePickerRef.value.timeValue[1]
|
||||
}).then((res: any) => {
|
||||
dropList.value.assessData = res.data.assessLevel
|
||||
evaluationData.value = [
|
||||
{
|
||||
targetName: '频率偏差(Hz)',
|
||||
avg: res.data.freqAssessLevel,
|
||||
sd: res.data.freqQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '电压偏差(%)',
|
||||
avg: res.data.vdevAssessLevel,
|
||||
sd: res.data.vdevQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '电压总谐波畸变率(%)',
|
||||
avg: res.data.harmAssessLevel,
|
||||
sd: res.data.harmQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '三相电压不平衡度(%)',
|
||||
avg: res.data.unbalanceAssessLevel,
|
||||
sd: res.data.unbalanceQualifyData
|
||||
},
|
||||
{
|
||||
targetName: '闪变',
|
||||
avg: res.data.flickerAssessLevel,
|
||||
sd: res.data.flickerQualifyData
|
||||
}
|
||||
]
|
||||
})
|
||||
// 稳态指标合格率
|
||||
|
||||
lineQualifiedDetail({
|
||||
lineId: id,
|
||||
startTime: datePickerRef.value.timeValue[0],
|
||||
endTime: datePickerRef.value.timeValue[1]
|
||||
}).then(res => {
|
||||
echart([
|
||||
{
|
||||
time: datePickerRef.value.timeValue[0].substring(0, 7),
|
||||
targetList: [
|
||||
'频率偏差(Hz)',
|
||||
'电压偏差(%)',
|
||||
'电压总谐波畸变率(%)',
|
||||
'三相电压不平衡度(%)',
|
||||
'闪变',
|
||||
'谐波电压(%)',
|
||||
'谐波电流(%)',
|
||||
'间谐波电压(%)',
|
||||
'负序电流(A)'
|
||||
],
|
||||
ratioList: [
|
||||
res.data.freqDev == 3.14159 ? null : res.data.freqDev,
|
||||
res.data.vdev == 3.14159 ? null : res.data.vdev,
|
||||
res.data.vthd == 3.14159 ? null : res.data.vthd,
|
||||
res.data.ubalance == 3.14159 ? null : res.data.ubalance,
|
||||
res.data.plt == 3.14159 ? null : res.data.plt,
|
||||
|
||||
res.data.uharm == 3.14159 ? null : res.data.uharm,
|
||||
res.data.iharm == 3.14159 ? null : res.data.iharm,
|
||||
res.data.inuHarm == 3.14159 ? null : res.data.inuHarm,
|
||||
res.data.ineg == 3.14159 ? null : res.data.ineg
|
||||
]
|
||||
}
|
||||
])
|
||||
})
|
||||
|
||||
// 暂态事件统计
|
||||
getEventDetailByLineId({
|
||||
id: id,
|
||||
startTime: datePickerRef.value.timeValue[0],
|
||||
endTime: datePickerRef.value.timeValue[1],
|
||||
type: datePickerRef.value.interval
|
||||
}).then((res: any) => {
|
||||
let data = [
|
||||
{
|
||||
name: '电压暂升',
|
||||
value: res.data?.swellTimes || 0
|
||||
},
|
||||
{
|
||||
name: '电压暂降',
|
||||
value: res.data?.sagTimes || 0
|
||||
},
|
||||
{
|
||||
name: '电压中断',
|
||||
value: res.data?.interruptTimes || 0
|
||||
}
|
||||
]
|
||||
incidentCharts.value = {
|
||||
title: {
|
||||
text: '总数:' + (data[0].value + data[1].value + data[2].value),
|
||||
left: '40%',
|
||||
top: '45%',
|
||||
textStyle: {
|
||||
// fontWeight: 600,
|
||||
fontSize: 12
|
||||
}
|
||||
// subtext: '总数',
|
||||
// subtextStyle: {
|
||||
// fontWeight: 550,
|
||||
// fontSize: 14
|
||||
// }
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
top: 'center',
|
||||
right: '10%',
|
||||
formatter: function (e: any) {
|
||||
return e + ' ' + data.filter(item => item.name == e)[0].value + '条'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
show: false
|
||||
},
|
||||
yAxis: {
|
||||
show: false
|
||||
},
|
||||
options: {
|
||||
dataZoom: null,
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
center: ['45%', '50%'],
|
||||
radius: ['60%', '80%'],
|
||||
label: {
|
||||
show: false,
|
||||
position: 'outside',
|
||||
textStyle: {
|
||||
//数值样式
|
||||
}
|
||||
},
|
||||
|
||||
data: data
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 告警明细
|
||||
getGridDiagramTargetData({ ...form, id: id, type: 3 }).then(res => {
|
||||
TargetData.value = res.data
|
||||
let num = 0
|
||||
let flag = 0
|
||||
let judgment = true
|
||||
for (let k in res.data) {
|
||||
if (k != 'lineId') {
|
||||
if (res.data[k] != '/') {
|
||||
judgment = false
|
||||
}
|
||||
flag += (res.data[k] == '/' ? 0 : res.data[k])
|
||||
}
|
||||
}
|
||||
|
||||
if (IntegrityNum.value == 0) {
|
||||
num = 2 //完整性告警
|
||||
} else {
|
||||
if (flag > 0) {
|
||||
num = 1 //超标告警
|
||||
} else {
|
||||
num = 0 //无告警
|
||||
}
|
||||
if (judgment) {
|
||||
num = 3
|
||||
}
|
||||
}
|
||||
|
||||
TargetData.value.info = num
|
||||
})
|
||||
}
|
||||
const echart = (row: any) => {
|
||||
let chart = echarts.init(chartRef.value as HTMLDivElement)
|
||||
|
||||
let dataname = [
|
||||
'频率偏差(Hz)',
|
||||
'电压偏差(%)',
|
||||
'电压总谐波畸变率(%)',
|
||||
'三相电压不平衡度(%)',
|
||||
'闪变',
|
||||
'谐波电压(%)',
|
||||
'谐波电流(%)',
|
||||
'间谐波电压(%)',
|
||||
'负序电流(A)'
|
||||
]
|
||||
let datamax = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
|
||||
let indicator = []
|
||||
for (let i = 0; i < dataname.length; i++) {
|
||||
indicator.push({
|
||||
name: dataname[i],
|
||||
max: datamax[i]
|
||||
})
|
||||
}
|
||||
|
||||
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
|
||||
},
|
||||
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%', '50%'],
|
||||
radius: '65%',
|
||||
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: '#2a9fe069'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#2a9fe0'
|
||||
},
|
||||
data: [item.ratioList]
|
||||
})
|
||||
})
|
||||
// console.log("🚀 ~ echart ~ option:", option)
|
||||
|
||||
chart.setOption(option)
|
||||
}
|
||||
// 跳转
|
||||
const Integrity = () => {
|
||||
router.push({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
}
|
||||
const OnlineRate = () => {
|
||||
router.push({
|
||||
name: 'harmonic-boot/area/OnlineRate'
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// open('4c87b7dff2281254fc55c25a4da31506')
|
||||
})
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.lineInfo {
|
||||
padding: 0 10px 10px 10px;
|
||||
}
|
||||
|
||||
:deep(.el-page-header__header) {
|
||||
height: 45px;
|
||||
border-bottom: 1px solid #f1eded;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions__header) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.evaluationData {
|
||||
display: grid;
|
||||
grid-template-rows: repeat(5, auto);
|
||||
height: 87%;
|
||||
|
||||
.row {
|
||||
margin: 4px 2% 0;
|
||||
width: 100%;
|
||||
box-shadow: 1px 1px 1px 1px #e8e3e3;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 6%;
|
||||
margin: 0px 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.iconBox {
|
||||
display: flex;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 18px;
|
||||
background: var(--el-color-primary);
|
||||
margin-right: 5px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.conclusion {
|
||||
display: inline-block;
|
||||
padding: 2px 5px;
|
||||
height: 20px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.background1 {
|
||||
background-color: #339966;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.background2 {
|
||||
background-color: #97017e;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.background3 {
|
||||
background-color: #A52a2a;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -7,7 +7,7 @@
|
||||
v-model.trim="inputQuery"
|
||||
style="height: 46px; width: 334px"
|
||||
@keyup.enter="DeviceQ"
|
||||
placeholder="请输入终端名称"
|
||||
placeholder="请输入监测点相关信息"
|
||||
>
|
||||
<template #prefix>
|
||||
<div class="Icon"></div>
|
||||
@@ -37,7 +37,7 @@
|
||||
@click="flyTo(k)"
|
||||
>
|
||||
<p>{{ k.psrName }}</p>
|
||||
<p>{{ k.vlevelName }}|{{ k.maintOrgName }}</p>
|
||||
<p>{{ k.vlevelName }} | {{ k.maintOrgName }} {{ k.objName ? `| ${k.objName}` : '' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
@@ -484,6 +484,9 @@ const lookPoint = (e: any) => {
|
||||
emit('show', true)
|
||||
}
|
||||
// 搜索
|
||||
const matchLineItem = (item: any, regex: RegExp) =>
|
||||
regex.test(item.lineName) || (item.objName && regex.test(item.objName))
|
||||
|
||||
const DeviceQ = () => {
|
||||
showCollapse.value = true
|
||||
if (inputQuery.value.length == 0) return
|
||||
@@ -491,13 +494,14 @@ const DeviceQ = () => {
|
||||
let list = []
|
||||
let regex = new RegExp(inputQuery.value, 'i')
|
||||
let data = areaLineInfo.value
|
||||
.filter((item: any) => regex.test(item.lineName))
|
||||
.filter((item: any) => matchLineItem(item, regex))
|
||||
.map((item: any) => {
|
||||
return {
|
||||
psrName: item.lineName,
|
||||
vlevelName: item.voltageScale,
|
||||
maintOrgName: item.gdName,
|
||||
coordinate: [item.lng, item.lat]
|
||||
coordinate: [item.lng, item.lat],
|
||||
objName: item.objName
|
||||
}
|
||||
})
|
||||
// data.replace(//s/g,',')
|
||||
@@ -522,7 +526,7 @@ const flyTo = (e: any, zoom?: number) => {
|
||||
zoomMap.value = zoom
|
||||
} else {
|
||||
zoomMap.value = 15
|
||||
let data = areaLineInfo.value.filter((item: any) => regex.test(item.lineName))[0]
|
||||
let data = areaLineInfo.value.filter((item: any) => matchLineItem(item, regex))[0]
|
||||
if (data) {
|
||||
markerClick(data)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -302,7 +302,7 @@ const list: any = ref([
|
||||
])
|
||||
const countList: any = ref([
|
||||
{
|
||||
title: '冀北',
|
||||
title: '网公司',
|
||||
children: [
|
||||
{
|
||||
title: '电网侧监测点',
|
||||
|
||||
@@ -142,14 +142,14 @@ narimap.publicKey = 'JBb74325ae94dc49358b7d699660b692'
|
||||
|
||||
narimap.Require(
|
||||
[
|
||||
'PSRMap',
|
||||
'ManageGrid',
|
||||
'Components.Query',
|
||||
'Components.DeviceCard',
|
||||
'Popup',
|
||||
'Components.MapSelector',
|
||||
'Components.RegionSelector',
|
||||
'Marker'
|
||||
'PSRMap',//pwgdgeomapsdk
|
||||
'ManageGrid',// pwmagdmapsdk
|
||||
'Components.Query',// EquipSearchCBB
|
||||
'Components.DeviceCard',//EquipOverviewCBB、EquipDetailCBB
|
||||
'Popup', //mapsdk
|
||||
'Components.MapSelector',//MapThemeSwitchCBB
|
||||
'Components.RegionSelector',//OrgSelectorCBB
|
||||
'Marker' //mapsdk
|
||||
],
|
||||
// ['PSRMap', 'Components.Query', 'Marker'],
|
||||
() => {
|
||||
|
||||
@@ -314,7 +314,7 @@ const list: any = ref([
|
||||
])
|
||||
const countList: any = ref([
|
||||
{
|
||||
title: '冀北',
|
||||
title: '网公司',
|
||||
children: [
|
||||
{
|
||||
title: '电网侧监测点',
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select v-model="tableStore.table.params.manufacturer" clearable placeholder="请选择终端厂家">
|
||||
<el-option
|
||||
v-for="item in terminaloption"
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:">
|
||||
<el-form-item label="终端厂家">
|
||||
<el-select v-model="tableStore.table.params.manufacturer" clearable placeholder="请选择终端厂家">
|
||||
<el-option
|
||||
v-for="item in terminaloption"
|
||||
|
||||
@@ -4,12 +4,8 @@
|
||||
<template v-slot:select>
|
||||
<el-form-item label="运行状态">
|
||||
<el-select v-model="tableStore.table.params.lineRunFlag" clearable placeholder="请选择运行状态">
|
||||
<el-option
|
||||
v-for="item in runFlagList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-option v-for="item in runFlagList" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
@@ -40,14 +36,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<div class="mb5" style="height: 40px">
|
||||
<el-segmented
|
||||
style="height: 100%"
|
||||
v-model="segmented"
|
||||
:props="props"
|
||||
:options="segmentedList"
|
||||
block
|
||||
@change="tableStore.index()"
|
||||
>
|
||||
<el-segmented style="height: 100%" v-model="segmented" :props="props" :options="segmentedList"
|
||||
block @change="tableStore.index()">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<div>{{ scope.item.name }}</div>
|
||||
@@ -61,8 +51,8 @@
|
||||
segmented == 'Power_Network'
|
||||
? '区域'
|
||||
: segmented == 'Manufacturer'
|
||||
? '终端厂家'
|
||||
: '电网标志'
|
||||
? '终端厂家'
|
||||
: '电网标志'
|
||||
}}
|
||||
</span>
|
||||
<span style="width: 90px">终端总数</span>
|
||||
@@ -77,33 +67,21 @@
|
||||
{{ o.name }}
|
||||
</span>
|
||||
<!-- 终端总数 -->
|
||||
<span
|
||||
style="width: 90px; color: #388e3c"
|
||||
class="text text-style"
|
||||
@click="renderTable(o.list, o.name + '_')"
|
||||
>
|
||||
<span style="width: 90px; color: #388e3c" class="text text-style"
|
||||
@click="renderTable(o.list, o.name + '_')">
|
||||
{{ o.count }}
|
||||
</span>
|
||||
<!-- -->
|
||||
<span
|
||||
style="flex: 1; color: #388e3c"
|
||||
class="text"
|
||||
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
||||
>
|
||||
<span style="flex: 1; color: #388e3c" class="text"
|
||||
:class="` ${o.integrity < 90 ? 'text-red' : ''}`">
|
||||
{{ o.integrity }}
|
||||
</span>
|
||||
<span
|
||||
style="width: 80px; color: #388e3c"
|
||||
:class="` ${o.online < 90 ? 'text-red' : ''}`"
|
||||
class="text"
|
||||
>
|
||||
<span style="width: 80px; color: #388e3c" :class="` ${o.online < 90 ? 'text-red' : ''}`"
|
||||
class="text">
|
||||
{{ o.online }}
|
||||
</span>
|
||||
<span
|
||||
style="width: 80px; color: #388e3c"
|
||||
:class="` ${o.qualified > 10 ? 'text-red' : ''}`"
|
||||
class="text"
|
||||
>
|
||||
<span style="width: 80px; color: #388e3c" :class="` ${o.qualified > 10 ? 'text-red' : ''}`"
|
||||
class="text">
|
||||
{{ o.qualified }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -120,13 +98,8 @@
|
||||
<!--表格-->
|
||||
|
||||
<div :style="{ height: tableStore.table.height }" v-loading="loading">
|
||||
<vxe-table
|
||||
height="auto"
|
||||
:data="dataList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||
v-bind="defaultAttribute"
|
||||
ref="tableRef"
|
||||
:scroll-y="{ enabled: true }"
|
||||
>
|
||||
<vxe-table height="auto" :data="dataList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||
v-bind="defaultAttribute" ref="tableRef" :scroll-y="{ enabled: true }">
|
||||
<vxe-column type="seq" title="序号" width="80px">
|
||||
<template #default="{ rowIndex }">
|
||||
<span>
|
||||
@@ -146,19 +119,16 @@
|
||||
<vxe-column field="ip" title="终端IP" :formatter="formatter" width="120px"></vxe-column>
|
||||
<vxe-column field="runFlag" title="运行状态" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
:type="
|
||||
row.runFlag == '运行'
|
||||
? 'success'
|
||||
: row.runFlag == '停运'
|
||||
<el-tag :type="row.runFlag == '运行'
|
||||
? 'success'
|
||||
: row.runFlag == '停运'
|
||||
? 'danger'
|
||||
: row.runFlag == '检修'
|
||||
? 'warning'
|
||||
: row.runFlag == '调试'
|
||||
? 'warning'
|
||||
: 'danger'
|
||||
"
|
||||
>
|
||||
? 'warning'
|
||||
: row.runFlag == '调试'
|
||||
? 'warning'
|
||||
: 'danger'
|
||||
">
|
||||
{{ row.runFlag }}
|
||||
</el-tag>
|
||||
</template>
|
||||
@@ -169,14 +139,9 @@
|
||||
</vxe-table>
|
||||
</div>
|
||||
<div class="table-pagination">
|
||||
<el-pagination
|
||||
v-model:currentPage="pageNum"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200]"
|
||||
background
|
||||
layout="sizes,total, ->, prev, pager, next, jumper"
|
||||
:total="dataList.length"
|
||||
></el-pagination>
|
||||
<el-pagination v-model:currentPage="pageNum" v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200]" background
|
||||
layout="sizes,total, ->, prev, pager, next, jumper" :total="dataList.length"></el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -187,7 +152,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, nextTick } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
@@ -273,7 +238,7 @@ const tableStore = new TableStore({
|
||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||
return k.count != 0
|
||||
} else {
|
||||
return k.name != '上送国网' && k.name != '非上送国网'
|
||||
return !k.name.includes('上送')
|
||||
}
|
||||
})
|
||||
// 合并子集数据 并去重
|
||||
@@ -465,15 +430,9 @@ const onExport = () => {
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
// TableHeaderRef.value.setDatePicker([
|
||||
// { label: '年份', value: 1 },
|
||||
// { label: '季度', value: 2 },
|
||||
// { label: '月份', value: 3 }
|
||||
// ])
|
||||
|
||||
// 加载数据
|
||||
|
||||
tableStore.index()
|
||||
nextTick(() => {
|
||||
TableHeaderRef.value?.onComSearch()
|
||||
})
|
||||
})
|
||||
|
||||
tableStore.table.params.name = ''
|
||||
@@ -482,14 +441,17 @@ provide('tableStore', tableStore)
|
||||
<style lang="scss" scoped>
|
||||
.card-list {
|
||||
display: flex;
|
||||
|
||||
.monitoringPoints {
|
||||
width: 460px;
|
||||
position: relative;
|
||||
|
||||
.statistics {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.divBox {
|
||||
width: 215x;
|
||||
height: 70px;
|
||||
@@ -500,33 +462,41 @@ provide('tableStore', tableStore)
|
||||
font-size: 40px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.divBox_title {
|
||||
font-weight: 550;
|
||||
}
|
||||
|
||||
.divBox_num {
|
||||
font-size: 20px;
|
||||
font-weight: 550;
|
||||
margin-left: auto;
|
||||
font-family: AlimamaDongFangDaKai;
|
||||
}
|
||||
|
||||
align-items: center;
|
||||
// text-align: center;
|
||||
border-radius: 5px;
|
||||
|
||||
&:nth-child(1) {
|
||||
background-color: #eef8f0;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
background-color: #fff6ed;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
background-color: #e5f8f6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.abnormal {
|
||||
width: 100%;
|
||||
background-color: #f3f6f9;
|
||||
@@ -535,9 +505,11 @@ provide('tableStore', tableStore)
|
||||
// justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 5px 0px 5px 10px;
|
||||
|
||||
.iconDiv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
div {
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
@@ -545,6 +517,7 @@ provide('tableStore', tableStore)
|
||||
background-color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
@@ -555,6 +528,7 @@ provide('tableStore', tableStore)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
text-align: center;
|
||||
@@ -562,40 +536,50 @@ provide('tableStore', tableStore)
|
||||
font-weight: 700;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
padding: 10px;
|
||||
|
||||
span {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.iconFont {
|
||||
font-size: 18px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.form {
|
||||
position: relative;
|
||||
|
||||
.form_but {
|
||||
position: absolute;
|
||||
right: -22px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
:deep(.table_name) {
|
||||
color: var(--el-color-primary);
|
||||
cursor: pointer;
|
||||
text-underline-offset: 4px;
|
||||
}
|
||||
|
||||
.echartTitle {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
|
||||
div:nth-child(2) {
|
||||
font-size: 16px;
|
||||
color: #ff6600;
|
||||
@@ -605,20 +589,25 @@ provide('tableStore', tableStore)
|
||||
:deep(.el-segmented__item-selected, ) {
|
||||
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||
}
|
||||
|
||||
:deep(.el-segmented__item, ) {
|
||||
clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
:deep(.el-segmented) {
|
||||
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||
}
|
||||
|
||||
.text-red {
|
||||
color: #ff9100 !important;
|
||||
}
|
||||
|
||||
.text-style {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.segmentedIcon {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
@@ -631,6 +620,7 @@ provide('tableStore', tableStore)
|
||||
color: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.table-pagination {
|
||||
height: 58px;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -13,7 +13,13 @@
|
||||
<Area v-model="form.deptId" @change="changeArea" />
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="计划名称:" prop="planName">
|
||||
<el-input v-model="form.planName" placeholder="请输入计划名称" clearable maxlength="32" show-word-limit></el-input>
|
||||
<el-input
|
||||
v-model="form.planName"
|
||||
placeholder="请输入计划名称"
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="监督类型:" prop="supvType">
|
||||
<el-select v-model="form.supvType" placeholder="请选择监督类型" style="width: 100%" @change="++key">
|
||||
@@ -26,7 +32,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="监督对象名称:" prop="supvObjectName">
|
||||
<el-input v-model="form.supvObjectName" placeholder="请输入监督对象名称" clearable maxlength="32" show-word-limit></el-input>
|
||||
<el-input
|
||||
v-model="form.supvObjectName"
|
||||
placeholder="请输入监督对象名称"
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="计划开始时间:" prop="planStartTime">
|
||||
<el-date-picker
|
||||
@@ -336,7 +348,12 @@ const changeArea = () => {
|
||||
treeList.value.forEach((item: any) => {
|
||||
if (item.id == form.value.deptId) {
|
||||
list.push(item)
|
||||
if (item.id != treeListCgy.value[0].id && item.name != '冀北电力有限公司' && item.name != '超高压') {
|
||||
if (
|
||||
item.id != treeListCgy.value[0].id &&
|
||||
!item.name.includes('电力有限公司') &&
|
||||
|
||||
item.name != '超高压'
|
||||
) {
|
||||
list.push(...treeListCgy.value)
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="触发类型:">
|
||||
<el-form-item label="触发类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.waveType"
|
||||
placeholder="请选择触发类型"
|
||||
@@ -36,7 +36,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有波形:">
|
||||
<el-form-item label="是否有波形">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.fileFlag"
|
||||
placeholder="请选择是否存在波形"
|
||||
@@ -51,7 +51,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="暂态持续时间(s):">
|
||||
<el-form-item label="暂态持续时间(s)">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.persistMin"
|
||||
placeholder="请输入X秒"
|
||||
@@ -69,7 +69,7 @@
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="事件严重度:">
|
||||
<el-form-item label="事件严重度">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.severityMin"
|
||||
placeholder="请输入正负数"
|
||||
@@ -94,7 +94,7 @@
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="暂态原因:">
|
||||
<el-form-item label="暂态原因">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.eventReason"
|
||||
placeholder="请选择暂态原因"
|
||||
@@ -111,7 +111,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="暂态核实原因:">
|
||||
<el-form-item label="暂态核实原因">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.verifyReason"
|
||||
placeholder="请选择暂态核实原因"
|
||||
@@ -128,7 +128,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="变电站(监测点):">
|
||||
<el-form-item label="变电站(监测点)">
|
||||
<el-cascader
|
||||
v-model="tableStore.table.params.lineIds"
|
||||
:options="options"
|
||||
@@ -217,33 +217,17 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: '200' },
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '100' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '200' },
|
||||
{ field: 'ip', title: '网络参数', width: '120px' },
|
||||
{ field: 'lineName', title: '监测点', minWidth: '100' },
|
||||
{ field: 'scale', title: '电压等级(kV)', minWidth: '120' },
|
||||
{
|
||||
field: 'verifyReason',
|
||||
title: '暂态核实原因',
|
||||
minWidth: '120',
|
||||
formatter: function (row) {
|
||||
return verifyReasonList.filter(item => item.id == row.cellValue)[0]?.name || '/' //row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'verifyReasonDetail', title: '暂降核实原因详情', minWidth: '200', formatter: function (row) {
|
||||
// return row.cellValue ? row.cellValue : '/'
|
||||
// }
|
||||
// },
|
||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: '200', sortable: true },
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
minWidth: '130',
|
||||
minWidth: '160',
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
return Math.floor(row.cellValue * 10000) / 100
|
||||
}
|
||||
},
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: 120, sortable: true },
|
||||
{
|
||||
field: 'eventType',
|
||||
title: '触发类型',
|
||||
@@ -253,17 +237,32 @@ const tableStore = new TableStore({
|
||||
return triggeroptions.filter(item => item.id == row.eventType)[0]?.name
|
||||
}
|
||||
},
|
||||
// { field: 'advanceType', title: '触发类型', minWidth: '100', },
|
||||
{ field: 'advanceReason', title: '暂态原因', minWidth: '100' },
|
||||
{
|
||||
field: 'depth',
|
||||
title: '暂降深度(%)',
|
||||
minWidth: '100',
|
||||
minWidth: 120,
|
||||
|
||||
formatter: ({ row }: any) =>
|
||||
row.featureAmplitude < 1 ? 100 - (row.featureAmplitude * 100).toFixed(0) : '/'
|
||||
},
|
||||
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
||||
{ field: 'advanceReason', title: '暂态原因', minWidth: '100' },
|
||||
{
|
||||
field: 'verifyReason',
|
||||
title: '暂态核实原因',
|
||||
minWidth: '120',
|
||||
formatter: function (row) {
|
||||
return verifyReasonList.filter(item => item.id == row.cellValue)[0]?.name || '/' //row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '100' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '200' },
|
||||
{ field: 'lineName', title: '监测点', minWidth: '100' },
|
||||
{ field: 'ip', title: '网络参数', width: '120px' },
|
||||
{ field: 'scale', title: '电压等级(kV)', minWidth: '130', sortable: true },
|
||||
|
||||
// { field: 'advanceType', title: '触发类型', minWidth: '100', },
|
||||
|
||||
{
|
||||
field: 'severity',
|
||||
title: '严重度',
|
||||
@@ -272,10 +271,11 @@ const tableStore = new TableStore({
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
width: '150',
|
||||
render: 'buttons',
|
||||
|
||||
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
@@ -424,6 +424,7 @@ const download = () => {
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
ElMessage.success('波形下载成功')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<div v-show="view">
|
||||
<TableHeader datePicker :showReset="false" showExport ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<!-- <el-form-item label="筛选数据">-->
|
||||
<!-- <el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入关键字筛选" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="筛选数据">-->
|
||||
<!-- <el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入关键字筛选" />-->
|
||||
<!-- </el-form-item>-->
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Tickets" type="primary" @click="analysis1">分析记录管理</el-button>
|
||||
@@ -29,7 +29,7 @@
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
<el-pagination
|
||||
<el-pagination
|
||||
class="mt10"
|
||||
:currentPage="form.pageNum"
|
||||
:page-size="form.pageSize"
|
||||
@@ -39,7 +39,7 @@
|
||||
:total="total"
|
||||
@size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"
|
||||
></el-pagination>
|
||||
></el-pagination>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||
@@ -70,7 +70,7 @@ const loading = ref(false)
|
||||
const view = ref(true)
|
||||
const view2 = ref(false)
|
||||
const TableHeaderRef = ref()
|
||||
const waveFormRef = ref()
|
||||
const waveFormRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/advance-boot/process/querySagEventsPage',
|
||||
method: 'POST',
|
||||
@@ -83,19 +83,23 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'startTime', title: '发生时间' },
|
||||
{ field: 'duration', title: '持续时间(s)' },
|
||||
{ field: 'startTime', title: '暂降发生时刻', sortable: true, minWidth: 200 },
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(骤升)幅值(%)'
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
sortable: true,
|
||||
minWidth: 160
|
||||
},
|
||||
{ field: 'gdName', title: '供电公司' },
|
||||
{ field: 'subName', title: '变电站' },
|
||||
{ field: 'lineName', title: '监测点' },
|
||||
{ field: 'duration', title: '持续时间(s)', sortable: true, minWidth: 120 },
|
||||
{ field: 'gdName', title: '供电公司', minWidth: 140 },
|
||||
{ field: 'subName', title: '变电站', minWidth: 140 },
|
||||
{ field: 'lineName', title: '监测点', minWidth: 140 },
|
||||
|
||||
{
|
||||
field: 'dealFlag',
|
||||
title: '暂降特征幅值计算',
|
||||
render: 'tag',
|
||||
minWidth: 160,
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'success',
|
||||
@@ -115,6 +119,7 @@ const tableStore = new TableStore({
|
||||
field: 'fileFlag',
|
||||
title: '录波文件',
|
||||
render: 'tag',
|
||||
minWidth: 140,
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'success'
|
||||
@@ -125,7 +130,8 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
width: '120',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
@@ -140,9 +146,9 @@ const tableStore = new TableStore({
|
||||
render: 'basicButton',
|
||||
click: async row => {
|
||||
view.value = false
|
||||
setTimeout(() => {
|
||||
waveFormRef.value.open(row)
|
||||
},100)
|
||||
setTimeout(() => {
|
||||
waveFormRef.value.open(row)
|
||||
}, 100)
|
||||
// row.loading = true
|
||||
// boxoList.value = row
|
||||
// await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
|
||||
@@ -173,7 +179,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => { }
|
||||
loadCallback: () => {}
|
||||
})
|
||||
tableStore.table.params.searchValue = ''
|
||||
const bxactiveName = ref('ssbx')
|
||||
@@ -190,25 +196,21 @@ provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
TableHeaderRef.value.setTheDate(1)
|
||||
nextTick(() => {
|
||||
|
||||
// tableStore.index()
|
||||
TableHeaderRef.value.onComSearch()
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
// 分页
|
||||
const onTableSizeChange = (val: number) => {
|
||||
form.value.pageSize = val
|
||||
form.value.pageNum = 1 // 改变每页条数时回到第一页
|
||||
loadAnalysisData() // 重新加载数据
|
||||
|
||||
form.value.pageSize = val
|
||||
form.value.pageNum = 1 // 改变每页条数时回到第一页
|
||||
loadAnalysisData() // 重新加载数据
|
||||
}
|
||||
|
||||
const onTableCurrentChange = (val: number) => {
|
||||
form.value.pageNum = val
|
||||
loadAnalysisData() // 重新加载数据
|
||||
|
||||
loadAnalysisData() // 重新加载数据
|
||||
}
|
||||
|
||||
// 封装数据加载逻辑
|
||||
@@ -230,13 +232,12 @@ const loadAnalysisData = async () => {
|
||||
|
||||
//分析记录管理
|
||||
const analysis1 = async () => {
|
||||
// 初始化分页参数
|
||||
// 初始化分页参数
|
||||
form.value.pageNum = 1
|
||||
await loadAnalysisData()
|
||||
dialogAnalysis.value = true
|
||||
}
|
||||
|
||||
|
||||
// 启动关联分析
|
||||
const firing = () => {
|
||||
processEvents({
|
||||
@@ -257,7 +258,7 @@ const details = (row: any) => {
|
||||
type: 'success',
|
||||
message: res.message
|
||||
})
|
||||
// 重新加载当前页的数据
|
||||
// 重新加载当前页的数据
|
||||
loadAnalysisData()
|
||||
})
|
||||
}
|
||||
@@ -266,6 +267,4 @@ const backbxlb = () => {
|
||||
view.value = true
|
||||
view2.value = false
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -2,8 +2,14 @@
|
||||
<div class="default-main">
|
||||
<TableHeader datePicker ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入事件关联分析描述" maxlength="32" show-word-limit/>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="输入事件关联分析描述"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
@@ -35,25 +41,18 @@
|
||||
</vxe-table-column>
|
||||
<vxe-table-column
|
||||
field="startTime"
|
||||
title="发生时间"
|
||||
title="暂降发生时刻"
|
||||
align="center"
|
||||
sortable
|
||||
width="200"
|
||||
:show-overflow="true"
|
||||
></vxe-table-column>
|
||||
<vxe-table-column field="gdName" title="供电公司" align="center"></vxe-table-column>
|
||||
<vxe-table-column
|
||||
field="subName"
|
||||
:show-overflow="true"
|
||||
title="变电站"
|
||||
align="center"
|
||||
></vxe-table-column>
|
||||
<vxe-table-column field="lineName" title="监测点" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="voltageId" title="电压等级(kV)" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="featureAmplitude" title="暂降(骤升)幅值(%)" align="center" width="140">
|
||||
<vxe-table-column field="featureAmplitude" title="暂降(骤升)幅值(%)" sortable align="center" width="160">
|
||||
<template #default="{ row }">
|
||||
<span>{{ (row.featureAmplitude * 100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</vxe-table-column>
|
||||
<vxe-table-column field="duration" title="持续时间(s)" align="center" width="120"></vxe-table-column>
|
||||
<vxe-table-column field="duration" title="持续时间(s)" sortable align="center" width="120"></vxe-table-column>
|
||||
<vxe-table-column
|
||||
field="advanceType"
|
||||
title="触发类型"
|
||||
@@ -68,6 +67,15 @@
|
||||
width="120"
|
||||
:formatter="formFilter"
|
||||
></vxe-table-column>
|
||||
<vxe-table-column field="gdName" title="供电公司" align="center"></vxe-table-column>
|
||||
<vxe-table-column
|
||||
field="subName"
|
||||
:show-overflow="true"
|
||||
title="变电站"
|
||||
align="center"
|
||||
></vxe-table-column>
|
||||
<vxe-table-column field="lineName" title="监测点" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="voltageId" title="电压等级(kV)" align="center"></vxe-table-column>
|
||||
</vxe-table>
|
||||
<el-pagination
|
||||
class="mt10"
|
||||
@@ -131,7 +139,8 @@ const tableStore = new TableStore({
|
||||
title: '事件关联分析描述'
|
||||
},
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
width: '200',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
@@ -176,7 +185,6 @@ const bxcontrast = () => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 波形分析
|
||||
const source = () => {
|
||||
queryEventDetailByAssId(form.value).then(res => {
|
||||
@@ -245,14 +253,14 @@ const exportEvent = () => {
|
||||
}
|
||||
// 导出波形分析
|
||||
const positioningexport = () => {
|
||||
const selectedRecords = positioningtableRef.value.getCheckboxRecords();
|
||||
|
||||
const selectedRecords = positioningtableRef.value.getCheckboxRecords()
|
||||
|
||||
if (selectedRecords.length === 0) {
|
||||
ElMessage({
|
||||
message: '请先选择要导出的数据!',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
positioningtableRef.value.exportData({
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div v-show="view">
|
||||
<TableHeader datePicker ref="TableHeaderRef" >
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="输入事件关联分析描述"
|
||||
maxlength="32" show-word-limit />
|
||||
</el-form-item>
|
||||
@@ -27,22 +27,23 @@
|
||||
<span>{{ (form.pageNum - 1) * form.pageSize + row.rowIndex + 1 }}</span>
|
||||
</template>
|
||||
</vxe-table-column>
|
||||
<vxe-table-column field="startTime" title="发生时间" align="center"
|
||||
<vxe-table-column field="startTime" title="暂降发生时刻" align="center" sortable width="200"
|
||||
:show-overflow="true"></vxe-table-column>
|
||||
<vxe-table-column field="gdName" title="供电公司" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="subName" :show-overflow="true" title="变电站" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="lineName" title="监测点" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="voltageId" title="电压等级(kV)" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="featureAmplitude" title="暂降(骤升)幅值(%)" align="center" width="140">
|
||||
<vxe-table-column field="featureAmplitude" title="暂降(骤升)幅值(%)" sortable align="center" width="160">
|
||||
<template #default="{ row }">
|
||||
<span>{{ (row.featureAmplitude * 100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</vxe-table-column>
|
||||
<vxe-table-column field="duration" title="持续时间(s)" align="center" width="120"></vxe-table-column>
|
||||
<vxe-table-column field="duration" title="持续时间(s)" align="center" sortable width="120"></vxe-table-column>
|
||||
<vxe-table-column field="advanceType" title="触发类型" align="center" width="120"
|
||||
:formatter="formFilter"></vxe-table-column>
|
||||
<vxe-table-column field="advanceReason" title="暂降原因" align="center" width="120"
|
||||
:formatter="formFilter"></vxe-table-column>
|
||||
<vxe-table-column field="gdName" title="供电公司" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="subName" :show-overflow="true" title="变电站" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="lineName" title="监测点" align="center"></vxe-table-column>
|
||||
<vxe-table-column field="voltageId" title="电压等级(kV)" align="center"></vxe-table-column>
|
||||
|
||||
</vxe-table>
|
||||
<el-pagination class="mt10" :currentPage="form.pageNum" :page-size="form.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]" background :layout="'sizes,total, ->, prev, pager, next, jumper'"
|
||||
|
||||
@@ -56,37 +56,40 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '变电站名称', field: 'subName', minWidth: '140' },
|
||||
{ title: '监测点名称', field: 'lineName', minWidth: '130' },
|
||||
{ title: '网络参数', field: 'ip', width: '120px' },
|
||||
{ title: '电压等级(kV)', field: 'voltageScale', width: '120' },
|
||||
{ title: '暂降发生时刻', field: 'startTime', width: '200' },
|
||||
// { title: '触发类型', field: 'advanceType', minWidth: '130' },
|
||||
{ title: '暂降原因', field: 'advanceReason', minWidth: '130' },
|
||||
{
|
||||
title: '触发类型',
|
||||
field: 'eventType',
|
||||
minWidth: '80',
|
||||
formatter: (row: any) => {
|
||||
return eventTypeOptions.find(item => item.id === row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
{ title: '暂降发生时刻', field: 'startTime', width: '200', sortable: true, },
|
||||
{
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
field: 'featureAmplitude',
|
||||
minWidth: '140',
|
||||
|
||||
minWidth: '160',
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
return Math.floor(row.cellValue * 10000) / 100
|
||||
}
|
||||
},
|
||||
{ title: '持续时间(s)', field: 'duration', minWidth: '100' },
|
||||
{ title: '持续时间(s)', field: 'duration', minWidth: '120' , sortable: true, },
|
||||
{
|
||||
title: '触发类型',
|
||||
field: 'eventType',
|
||||
minWidth: '100',
|
||||
formatter: (row: any) => {
|
||||
return eventTypeOptions.find(item => item.id === row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
{ title: '暂降原因', field: 'advanceReason', minWidth: '130' },
|
||||
{ title: '变电站名称', field: 'subName', minWidth: '140' },
|
||||
{ title: '监测点名称', field: 'lineName', minWidth: '130' },
|
||||
{ title: '网络参数', field: 'ip', width: '120px' },
|
||||
{ title: '电压等级(kV)', field: 'voltageScale', width: '120' },
|
||||
|
||||
// { title: '触发类型', field: 'advanceType', minWidth: '130' },
|
||||
|
||||
// { title: '严重度', field: 'severity', minWidth: '80' },
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
|
||||
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
@@ -127,7 +130,6 @@ const tableStore = new TableStore({
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.lineId = monitoringPoint.state.lineId
|
||||
|
||||
},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
@@ -174,6 +176,7 @@ const download = () => {
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
ElMessage.success('波形下载成功')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
></bm-marker>
|
||||
</template>
|
||||
<!-- 点 -->
|
||||
<BmlMarkerClusterer maxZoom="12">
|
||||
<BmlMarkerClusterer maxZoom="12" :styles="styles">
|
||||
<bm-marker
|
||||
:position="path"
|
||||
v-for="path in areaLineInfo"
|
||||
@@ -163,6 +163,44 @@ const areaLineInfo = ref<any>([])
|
||||
const siteList = ref<any>([])
|
||||
const polyline = ref<any>([])
|
||||
const lineId = ref('')
|
||||
const imageUrl = new URL('@/assets/imgs/m0.png', import.meta.url).href
|
||||
const imageUrl1 = new URL('@/assets/imgs/m1.png', import.meta.url).href
|
||||
const imageUrl2 = new URL('@/assets/imgs/m3.png', import.meta.url).href
|
||||
const imageUrl3 = new URL('@/assets/imgs/m4.png', import.meta.url).href
|
||||
const styles = [
|
||||
{
|
||||
url: imageUrl,
|
||||
size: {
|
||||
width: 53,
|
||||
height: 52
|
||||
},
|
||||
opt_textSize: 10
|
||||
},
|
||||
{
|
||||
url: imageUrl1,
|
||||
size: {
|
||||
width: 56,
|
||||
height: 55
|
||||
},
|
||||
opt_textSize: 12
|
||||
},
|
||||
{
|
||||
url: imageUrl2,
|
||||
size: {
|
||||
width: 78,
|
||||
height: 77
|
||||
},
|
||||
opt_textSize: 14
|
||||
},
|
||||
{
|
||||
url: imageUrl3,
|
||||
size: {
|
||||
width: 90,
|
||||
height: 89
|
||||
},
|
||||
opt_textSize: 14
|
||||
},
|
||||
]
|
||||
const handler = async ({ BMap, map }: any) => {
|
||||
let data = props.mapList
|
||||
let r = 0.0035
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
></bm-marker>
|
||||
</template>
|
||||
<!-- 点 -->
|
||||
<BmlMarkerClusterer maxZoom="12">
|
||||
<BmlMarkerClusterer maxZoom="12" :styles="styles">
|
||||
<bm-marker
|
||||
:position="path"
|
||||
v-for="path in areaLineInfo"
|
||||
@@ -196,13 +196,51 @@ const areaLineInfo = ref<any>([])
|
||||
const siteList = ref<any>([])
|
||||
const polyline = ref<any>([])
|
||||
const lineId = ref('')
|
||||
const imageUrl = new URL('@/assets/imgs/m0.png', import.meta.url).href
|
||||
const imageUrl1 = new URL('@/assets/imgs/m1.png', import.meta.url).href
|
||||
const imageUrl2 = new URL('@/assets/imgs/m3.png', import.meta.url).href
|
||||
const imageUrl3 = new URL('@/assets/imgs/m4.png', import.meta.url).href
|
||||
const styles = [
|
||||
{
|
||||
url: imageUrl,
|
||||
size: {
|
||||
width: 53,
|
||||
height: 52
|
||||
},
|
||||
opt_textSize: 10
|
||||
},
|
||||
{
|
||||
url: imageUrl1,
|
||||
size: {
|
||||
width: 56,
|
||||
height: 55
|
||||
},
|
||||
opt_textSize: 12
|
||||
},
|
||||
{
|
||||
url: imageUrl2,
|
||||
size: {
|
||||
width: 78,
|
||||
height: 77
|
||||
},
|
||||
opt_textSize: 14
|
||||
},
|
||||
{
|
||||
url: imageUrl3,
|
||||
size: {
|
||||
width: 90,
|
||||
height: 89
|
||||
},
|
||||
opt_textSize: 14
|
||||
},
|
||||
]
|
||||
const handler = async ({ BMap, map }: any) => {
|
||||
params.value.deptIndex = adminInfo.$state.deptId
|
||||
params.value.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||
params.value.searchEndTime = datePickerRef.value.timeValue[1]
|
||||
let { data } = await getAreaLineInfo(params.value)
|
||||
let r = 0.0035
|
||||
let list = data.filter((item: any) => item.lng != 0)
|
||||
let list = data//.filter((item: any) => item.lng != 0)
|
||||
list.forEach((item: any) => {
|
||||
// 变电站图标
|
||||
item.icon = {
|
||||
|
||||
@@ -3,21 +3,21 @@
|
||||
<div style="height: 40vh">
|
||||
<vxe-table v-loading="loading" height="auto" auto-resize :data="tableData" v-bind="defaultAttribute">
|
||||
<vxe-column type="seq" title="序号" width="80px"></vxe-column>
|
||||
<vxe-column field="startTime" title="发生时间" width="180"></vxe-column>
|
||||
<vxe-column field="duration" title="持续时间(s)" width="100"></vxe-column>
|
||||
<vxe-column field="gdName" title="供电公司" min-width="150"></vxe-column>
|
||||
<vxe-column field="subName" title="变电站" min-width="150"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点" min-width="150"></vxe-column>
|
||||
<vxe-column field="startTime" title="暂降发生时刻" width="200" sortable></vxe-column>
|
||||
<vxe-column field="featureAmplitude" title="暂降(骤升)幅值(%)" width="160" sortable>
|
||||
<template #default="{ row }">
|
||||
{{ (row.featureAmplitude * 100).toFixed(2) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="duration" title="持续时间(s)" width="120" sortable></vxe-column>
|
||||
<vxe-column field="advanceType" title="触发类型" width="100">
|
||||
<template #default="{ row }">
|
||||
{{ type.find(item => item.id === row.advanceType)?.name }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="featureAmplitude" title="暂降(骤升)幅值(%)" width="150">
|
||||
<template #default="{ row }">
|
||||
{{ (row.featureAmplitude * 100).toFixed(2) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="gdName" title="供电公司" min-width="140"></vxe-column>
|
||||
<vxe-column field="subName" title="变电站" min-width="140"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" min-width="140"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@@ -23,14 +23,15 @@
|
||||
<div style="flex: 1; overflow: hidden">
|
||||
<vxe-table height="auto" auto-resize :data="tableData" v-bind="defaultAttribute">
|
||||
<vxe-column type="seq" title="序号" width="70px"></vxe-column>
|
||||
<vxe-column field="startTime" title="发生时刻" width="200"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点" width="120"></vxe-column>
|
||||
<vxe-column field="featureAmplitude" title="暂降(骤升)幅值(%)">
|
||||
<vxe-column field="startTime" title="暂降发生时刻" width="200" sortable></vxe-column>
|
||||
<vxe-column field="featureAmplitude" title="暂降(骤升)幅值(%)" width="160" sortable>
|
||||
<template #default="{ row }">
|
||||
{{ (row.featureAmplitude * 100).toFixed(2) }}
|
||||
{{ row.featureAmplitude.toFixed(2) }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="duration" title="持续时间(s)"></vxe-column>
|
||||
<vxe-column field="duration" title="持续时间(s)" sortable width="120"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点" width="120"></vxe-column>
|
||||
|
||||
</vxe-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker area >
|
||||
<TableHeader date-picker area>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-radio-group v-model="tableStore.table.params.comFlag">
|
||||
@@ -48,10 +48,12 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent" :loading="loading">导出</el-button>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent" :loading="loading">
|
||||
报告生成
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<Table ref="tableRef" :checkboxConfig="checkboxConfig" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="tsx">
|
||||
@@ -64,7 +66,7 @@ import { getEventReport } from '@/api/event-boot/report'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
defineOptions({
|
||||
name: 'Operationmanagement/terminalmanagement'
|
||||
name: 'TransientReport/eventreports'
|
||||
})
|
||||
const dictData = useDictData()
|
||||
const triggerType = dictData.getBasicData('Event_Statis')
|
||||
@@ -82,6 +84,7 @@ const tableStore = new TableStore({
|
||||
url: '/event-boot/report/getEventReport',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ width: '60', type: 'checkbox' },
|
||||
{
|
||||
title: '序号',
|
||||
|
||||
@@ -93,19 +96,34 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'startTime',
|
||||
title: '发生时刻',
|
||||
title: '暂降发生时刻',
|
||||
width: '180',
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue.replace('T', ' ') : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '120' },
|
||||
{ field: 'ip', title: '网络参数', width: '120px' },
|
||||
{ field: 'lineName', title: '监测点', minWidth: '120' },
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
width: '160',
|
||||
sortable: true,
|
||||
formatter: (row: any) => {
|
||||
// return (row.cellValue * 100).toFixed(0)
|
||||
|
||||
return Math.floor(row.cellValue * 10000) / 100
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'duration',
|
||||
title: '持续时间(s)',
|
||||
width: '120',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'eventType',
|
||||
title: '触发类型',minWidth: '100' ,
|
||||
title: '触发类型',
|
||||
minWidth: '100',
|
||||
formatter: (row: any) => {
|
||||
return triggerType.filter(item => item.id === row.cellValue)[0].name
|
||||
}
|
||||
@@ -113,33 +131,30 @@ const tableStore = new TableStore({
|
||||
{
|
||||
field: 'advanceType',
|
||||
title: '暂态类型',
|
||||
minWidth: '100'
|
||||
minWidth: '100',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'advanceReason',
|
||||
title: '暂态原因',
|
||||
minWidth: '100'
|
||||
minWidth: '100',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
||||
{ field: 'subName', title: '变电站', minWidth: '120' },
|
||||
{ field: 'lineName', title: '监测点', minWidth: '120' },
|
||||
{ field: 'ip', title: '网络参数', width: '120px' },
|
||||
|
||||
{
|
||||
field: 'voltageScale',
|
||||
title: '电压等级',
|
||||
minWidth: '100'
|
||||
},
|
||||
{
|
||||
field: 'featureAmplitude',
|
||||
title: '暂降(骤升)幅值(%)',
|
||||
width: '140',
|
||||
formatter: (row: any) => {
|
||||
// return (row.cellValue * 100).toFixed(0)
|
||||
|
||||
return Math.floor(row.cellValue * 10000) / 100
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'duration',
|
||||
title: '持续时间(s)',
|
||||
width: '100'
|
||||
}
|
||||
|
||||
// { field: 'severity', title: '严重度' }
|
||||
]
|
||||
})
|
||||
@@ -156,7 +171,11 @@ tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Typ
|
||||
'Voltage_Level',
|
||||
'Load_Type'
|
||||
])[0]
|
||||
|
||||
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig<any>>({
|
||||
checkMethod: ({ row }) => {
|
||||
return row.fileFlag === 1
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
@@ -178,15 +197,17 @@ const exportEvent = () => {
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
|
||||
|
||||
const ids = tableStore.table.data.map((item: any) => item.eventId);
|
||||
if (!tableStore.table.selection.length) {
|
||||
ElMessage.warning('请选择数据')
|
||||
return
|
||||
}
|
||||
const ids = tableStore.table.selection.map((item: any) => item.eventId)
|
||||
loading.value = true
|
||||
|
||||
ElMessage('生成报告中,请稍等!')
|
||||
getEventReport(ids)
|
||||
.then((res: any) => {
|
||||
if (res == undefined) {
|
||||
if (res == undefined) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
@@ -197,14 +218,14 @@ const exportEvent = () => {
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '事件报告' // 设置下载的文件名
|
||||
link.download = '事件报告' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
loading.value = false
|
||||
}) .catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user