Compare commits
67 Commits
2025-11
...
e65df4daad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e65df4daad | ||
|
|
136248eec2 | ||
|
|
bfafb6dc5b | ||
|
|
0b91027da4 | ||
|
|
22aeb0bf4c | ||
|
|
87bc9d9017 | ||
|
|
43d4d37cd0 | ||
|
|
ad1528e53b | ||
|
|
c1e36440e7 | ||
|
|
16f5213d7a | ||
|
|
ab891e6125 | ||
|
|
36c8ab87a2 | ||
|
|
6c3037f19b | ||
|
|
54517c0d5f | ||
|
|
715cdb892f | ||
|
|
953b96fe05 | ||
|
|
cb19fef4c6 | ||
|
|
98c887b79d | ||
|
|
fd09e24cf0 | ||
|
|
2a11891988 | ||
|
|
e7d90c3a73 | ||
|
|
72b1f39814 | ||
|
|
38028b5cb0 | ||
|
|
409999b37b | ||
|
|
0fc7b528d4 | ||
|
|
06764c073a | ||
|
|
26ff8087c6 | ||
|
|
83e57c92b4 | ||
|
|
a9245abb5c | ||
|
|
7a7c584217 | ||
|
|
bf3d033f39 | ||
|
|
42ce7aec5a | ||
|
|
17589e30da | ||
|
|
eb38fdd601 | ||
|
|
454d612a32 | ||
|
|
4dde761784 | ||
| 5f4f75d9dd | |||
|
|
cf7e5fa991 | ||
|
|
4f0dc512e2 | ||
|
|
a77b153ac8 | ||
|
|
dbb6a9f72b | ||
| 9567fe1295 | |||
|
|
a52021572a | ||
| d69a6e1e5d | |||
| a67535abbf | |||
|
|
dffc735edb | ||
|
|
38806367b4 | ||
|
|
6f770aa91d | ||
| dc32cc3bb7 | |||
|
|
d64d18f330 | ||
|
|
909f43e257 | ||
| 92aa66436e | |||
| 264f33302f | |||
|
|
7b9f5302d0 | ||
|
|
72d836020b | ||
|
|
67efef738a | ||
| 6918611d06 | |||
| 9f5b2ecc46 | |||
|
|
d30b8247cf | ||
| 0b61c4b7ba | |||
|
|
ff2b9db7b8 | ||
|
|
289900f9ff | ||
|
|
e87d05c587 | ||
| 46c55d48ec | |||
| b36f765d07 | |||
|
|
0fe2d2b911 | ||
|
|
8c41a8fc77 |
5
.env.hainan
Normal file
5
.env.hainan
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
NODE_ENV = hainan
|
||||||
|
VITE_NAME="hainan"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
6
.env.qujing
Normal file
6
.env.qujing
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 云南曲靖
|
||||||
|
NODE_ENV = qujing
|
||||||
|
VITE_NAME="qujing"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
8813
package-lock.json
generated
Normal file
8813
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,9 +6,13 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --mode dev",
|
"dev": "vite --mode dev",
|
||||||
"dev:jibei": "vite --mode jibei",
|
"dev:jibei": "vite --mode jibei",
|
||||||
|
"dev:hainan": "vite --mode hainan",
|
||||||
|
"dev:qujing": "vite --mode qujing",
|
||||||
"dev:removeMode": "vite --mode removeMode",
|
"dev:removeMode": "vite --mode removeMode",
|
||||||
"build": "vite build --mode dev",
|
"build": "vite build --mode dev",
|
||||||
"build:jibei": "vite build --mode jibei",
|
"build:jibei": "vite build --mode jibei",
|
||||||
|
"build:hainan": "vite build --mode hainan",
|
||||||
|
"build:qujing": "vite build --mode qujing",
|
||||||
"build:removeMode": "vite build --mode removeMode",
|
"build:removeMode": "vite build --mode removeMode",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
@@ -19,7 +23,7 @@
|
|||||||
"@form-create/element-ui": "^3.1.24",
|
"@form-create/element-ui": "^3.1.24",
|
||||||
"@fortawesome/fontawesome-free": "^6.5.1",
|
"@fortawesome/fontawesome-free": "^6.5.1",
|
||||||
"@kjgl77/datav-vue3": "^1.7.4",
|
"@kjgl77/datav-vue3": "^1.7.4",
|
||||||
"@vue-office/docx": "^1.6.2",
|
"@vue-office/docx": "^1.6.3",
|
||||||
"@vue-office/excel": "^1.7.8",
|
"@vue-office/excel": "^1.7.8",
|
||||||
"@vue-office/pdf": "^2.0.2",
|
"@vue-office/pdf": "^2.0.2",
|
||||||
"@vueuse/core": "^10.7.0",
|
"@vueuse/core": "^10.7.0",
|
||||||
|
|||||||
BIN
public/favicon4.ico
Normal file
BIN
public/favicon4.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -134,6 +134,22 @@ export function selectUserList(data: any) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//获取用户
|
||||||
|
export function selectUserAssessMentList(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/supervision-boot/userReport/selectUserAssessMentList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//绑定用户
|
||||||
|
export function bindAssessmentId(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/supervision-boot/userReport/bindAssessmentId',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
//查询列表
|
//查询列表
|
||||||
export function getStatusManageList(data: any) {
|
export function getStatusManageList(data: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
|
|||||||
@@ -1,32 +1,47 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
import { DEVICE_BOOT } from '@/utils/constantRequest'
|
import { DEVICE_BOOT } from '@/utils/constantRequest'
|
||||||
|
|
||||||
const MAPPING_PATH = DEVICE_BOOT + '/line'
|
const MAPPING_PATH = DEVICE_BOOT + '/line'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询终端详细信息
|
* 查询终端详细信息
|
||||||
*/
|
*/
|
||||||
export const getDeviceDetailData = (id: string) => {
|
export const getDeviceDetailData = (id: string) => {
|
||||||
return request({
|
return request({
|
||||||
url: MAPPING_PATH + '/getDeviceDetailData?id=' + id,
|
url: MAPPING_PATH + '/getDeviceDetailData?id=' + id,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询监测点详细信息
|
* 查询监测点详细信息
|
||||||
*/
|
*/
|
||||||
export const getLineDetailData = (id: string) => {
|
export const getLineDetailData = (id: string) => {
|
||||||
return request({
|
return request({
|
||||||
url: MAPPING_PATH + '/getLineDetailData?id=' + id,
|
url: MAPPING_PATH + '/getLineDetailData?id=' + id,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSubstationSelect = () => {
|
export const getSubstationSelect = () => {
|
||||||
return request({
|
return request({
|
||||||
url: 'device-boot/substation/getSubstationSelect',
|
url: 'device-boot/substation/getSubstationSelect',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询变电站详情
|
||||||
|
export const getSubstationSelectLine = (id: string) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getSubstationData',
|
||||||
|
method: 'post',
|
||||||
|
data: [id]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询监测点
|
||||||
|
export const getLineOverLimitData = (id: string) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getLineOverLimitData?id=' + id,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -165,3 +165,20 @@ export function getSupervisionDetailsData(data: any) {
|
|||||||
export function getSupervisionCityDetailsData(data: any) {
|
export function getSupervisionCityDetailsData(data: any) {
|
||||||
return request({ url: '/supervision-boot/gridDiagram/getSupervisionCityDetailsData', method: 'post', data })
|
return request({ url: '/supervision-boot/gridDiagram/getSupervisionCityDetailsData', method: 'post', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//区域污染值统计
|
||||||
|
export function getAreaPollution(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/PollutionSubstation/getAreaPollution', method: 'post', data })
|
||||||
|
}
|
||||||
|
//场站级评估
|
||||||
|
export function downPollutionSubCalc(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/PollutionSubstation/downPollutionSubCalc', method: 'post', data })
|
||||||
|
}
|
||||||
|
//监测点评价
|
||||||
|
export function limitTableDetail(data: any) {
|
||||||
|
return request({ url: '/device-boot/dataVerify/limitTableDetail', method: 'post', data })
|
||||||
|
}
|
||||||
|
//重要及敏感用户详情
|
||||||
|
export function downPollutionSensitiveUser(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/PollutionSubstation/downPollutionSensitiveUser', method: 'post', data })
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export function getUndocumentednonlinearData() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//获取入网评估报告审核数据
|
//获取系统接入方案审核数据
|
||||||
export function getReportreviewData() {
|
export function getReportreviewData() {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/Process-supervision/Reportreview/getReportreview',
|
url: '/Process-supervision/Reportreview/getReportreview',
|
||||||
|
|||||||
@@ -1,10 +1,18 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
|
||||||
export function exportModel(data: any) {
|
export function exportModel(data: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/harmonic-boot/exportmodel/exportModel',
|
url: '/harmonic-boot/exportmodel/exportModel',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function areaHarmonicReport(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/harmonic-boot/areaHarmonicReport/areaHarmonicReport',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
const SYSTEM_PREFIX = '/system-boot'
|
const SYSTEM_PREFIX = '/system-boot'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7,8 +7,20 @@ const SYSTEM_PREFIX = '/system-boot'
|
|||||||
* @param file
|
* @param file
|
||||||
*/
|
*/
|
||||||
export const uploadFile = (file: any, path: string) => {
|
export const uploadFile = (file: any, path: string) => {
|
||||||
|
const regex = /\[|\]/g
|
||||||
|
// 替换规则:[ 换成 (,] 换成 )
|
||||||
|
|
||||||
|
const newFile = new File(
|
||||||
|
[file], // 原文件的二进制内容
|
||||||
|
file.name.replace(regex, match => (match === '[' ? '(' : ')')), // 新的文件名
|
||||||
|
{
|
||||||
|
type: file.type, // 复用原文件的MIME类型
|
||||||
|
lastModified: file.lastModified // 复用最后修改时间
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
let form = new FormData()
|
let form = new FormData()
|
||||||
form.append('file', file)
|
form.append('file', newFile)
|
||||||
form.append('path', path)
|
form.append('path', path)
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: SYSTEM_PREFIX + '/file/upload',
|
url: SYSTEM_PREFIX + '/file/upload',
|
||||||
@@ -17,6 +29,11 @@ export const uploadFile = (file: any, path: string) => {
|
|||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data'
|
||||||
},
|
},
|
||||||
data: form
|
data: form
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == `A0000`) {
|
||||||
|
ElMessage.success('上传成功!')
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +67,7 @@ export const downloadFile = (filePath: any) => {
|
|||||||
/**
|
/**
|
||||||
* 获取文件的短期url展示
|
* 获取文件的短期url展示
|
||||||
*/
|
*/
|
||||||
export const getFileUrl = (params:any) => {
|
export const getFileUrl = (params: any) => {
|
||||||
let form = new FormData()
|
let form = new FormData()
|
||||||
// form.append('filePath', filePath)
|
// form.append('filePath', filePath)
|
||||||
return createAxios({
|
return createAxios({
|
||||||
|
|||||||
@@ -54,6 +54,54 @@
|
|||||||
<div class="content unicode" style="display: block;">
|
<div class="content unicode" style="display: block;">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">253_ipower</div>
|
||||||
|
<div class="code-name">&#xe782;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">电压</div>
|
||||||
|
<div class="code-name">&#xe665;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">三相电压幅值不平衡</div>
|
||||||
|
<div class="code-name">&#xe758;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">电压总谐波畸变率</div>
|
||||||
|
<div class="code-name">&#xe61e;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">闪变</div>
|
||||||
|
<div class="code-name">&#xe612;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">停运事件管理</div>
|
||||||
|
<div class="code-name">&#xe65d;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">在运设备</div>
|
||||||
|
<div class="code-name">&#xe604;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">异常类_14非智能表在运异常</div>
|
||||||
|
<div class="code-name">&#xe666;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<span class="icon iconfont"></span>
|
<span class="icon iconfont"></span>
|
||||||
<div class="name">综合评价</div>
|
<div class="name">综合评价</div>
|
||||||
@@ -234,9 +282,9 @@
|
|||||||
<pre><code class="language-css"
|
<pre><code class="language-css"
|
||||||
>@font-face {
|
>@font-face {
|
||||||
font-family: 'iconfont';
|
font-family: 'iconfont';
|
||||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
src: url('iconfont.woff2?t=1765612648830') format('woff2'),
|
||||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
url('iconfont.woff?t=1765612648830') format('woff'),
|
||||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
url('iconfont.ttf?t=1765612648830') format('truetype');
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||||
@@ -262,6 +310,78 @@
|
|||||||
<div class="content font-class">
|
<div class="content font-class">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-a-253_ipower"></span>
|
||||||
|
<div class="name">
|
||||||
|
253_ipower
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-a-253_ipower
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-dianya"></span>
|
||||||
|
<div class="name">
|
||||||
|
电压
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-dianya
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-sanxiangdianyafuzhibupingheng"></span>
|
||||||
|
<div class="name">
|
||||||
|
三相电压幅值不平衡
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-sanxiangdianyafuzhibupingheng
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-dianyazongxiebojibianshuai"></span>
|
||||||
|
<div class="name">
|
||||||
|
电压总谐波畸变率
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-dianyazongxiebojibianshuai
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-shanbian"></span>
|
||||||
|
<div class="name">
|
||||||
|
闪变
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-shanbian
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-tingyunshijianguanli"></span>
|
||||||
|
<div class="name">
|
||||||
|
停运事件管理
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-tingyunshijianguanli
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-zaiyunshebei"></span>
|
||||||
|
<div class="name">
|
||||||
|
在运设备
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-zaiyunshebei
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-yichanglei_14feizhinengbiaozaiyunyichang"></span>
|
||||||
|
<div class="name">
|
||||||
|
异常类_14非智能表在运异常
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-yichanglei_14feizhinengbiaozaiyunyichang
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<span class="icon iconfont icon-zonghepingjia1"></span>
|
<span class="icon iconfont icon-zonghepingjia1"></span>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -532,6 +652,70 @@
|
|||||||
<div class="content symbol">
|
<div class="content symbol">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-a-253_ipower"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">253_ipower</div>
|
||||||
|
<div class="code-name">#icon-a-253_ipower</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-dianya"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">电压</div>
|
||||||
|
<div class="code-name">#icon-dianya</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-sanxiangdianyafuzhibupingheng"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">三相电压幅值不平衡</div>
|
||||||
|
<div class="code-name">#icon-sanxiangdianyafuzhibupingheng</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-dianyazongxiebojibianshuai"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">电压总谐波畸变率</div>
|
||||||
|
<div class="code-name">#icon-dianyazongxiebojibianshuai</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-shanbian"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">闪变</div>
|
||||||
|
<div class="code-name">#icon-shanbian</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-tingyunshijianguanli"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">停运事件管理</div>
|
||||||
|
<div class="code-name">#icon-tingyunshijianguanli</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-zaiyunshebei"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">在运设备</div>
|
||||||
|
<div class="code-name">#icon-zaiyunshebei</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-yichanglei_14feizhinengbiaozaiyunyichang"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">异常类_14非智能表在运异常</div>
|
||||||
|
<div class="code-name">#icon-yichanglei_14feizhinengbiaozaiyunyichang</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<svg class="icon svg-icon" aria-hidden="true">
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-zonghepingjia1"></use>
|
<use xlink:href="#icon-zonghepingjia1"></use>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 3482754 */
|
font-family: "iconfont"; /* Project id 3482754 */
|
||||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
src: url('iconfont.woff2?t=1765612648830') format('woff2'),
|
||||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
url('iconfont.woff?t=1765612648830') format('woff'),
|
||||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
url('iconfont.ttf?t=1765612648830') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
@@ -13,6 +13,38 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-a-253_ipower:before {
|
||||||
|
content: "\e782";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-dianya:before {
|
||||||
|
content: "\e665";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-sanxiangdianyafuzhibupingheng:before {
|
||||||
|
content: "\e758";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-dianyazongxiebojibianshuai:before {
|
||||||
|
content: "\e61e";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-shanbian:before {
|
||||||
|
content: "\e612";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-tingyunshijianguanli:before {
|
||||||
|
content: "\e65d";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-zaiyunshebei:before {
|
||||||
|
content: "\e604";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-yichanglei_14feizhinengbiaozaiyunyichang:before {
|
||||||
|
content: "\e666";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-zonghepingjia1:before {
|
.icon-zonghepingjia1:before {
|
||||||
content: "\e82f";
|
content: "\e82f";
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -5,6 +5,62 @@
|
|||||||
"css_prefix_text": "icon-",
|
"css_prefix_text": "icon-",
|
||||||
"description": "",
|
"description": "",
|
||||||
"glyphs": [
|
"glyphs": [
|
||||||
|
{
|
||||||
|
"icon_id": "33424624",
|
||||||
|
"name": "253_ipower",
|
||||||
|
"font_class": "a-253_ipower",
|
||||||
|
"unicode": "e782",
|
||||||
|
"unicode_decimal": 59266
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "12331657",
|
||||||
|
"name": "电压",
|
||||||
|
"font_class": "dianya",
|
||||||
|
"unicode": "e665",
|
||||||
|
"unicode_decimal": 58981
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "33073330",
|
||||||
|
"name": "三相电压幅值不平衡",
|
||||||
|
"font_class": "sanxiangdianyafuzhibupingheng",
|
||||||
|
"unicode": "e758",
|
||||||
|
"unicode_decimal": 59224
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "37400988",
|
||||||
|
"name": "电压总谐波畸变率",
|
||||||
|
"font_class": "dianyazongxiebojibianshuai",
|
||||||
|
"unicode": "e61e",
|
||||||
|
"unicode_decimal": 58910
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "43700638",
|
||||||
|
"name": "闪变",
|
||||||
|
"font_class": "shanbian",
|
||||||
|
"unicode": "e612",
|
||||||
|
"unicode_decimal": 58898
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "25458995",
|
||||||
|
"name": "停运事件管理",
|
||||||
|
"font_class": "tingyunshijianguanli",
|
||||||
|
"unicode": "e65d",
|
||||||
|
"unicode_decimal": 58973
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "35341056",
|
||||||
|
"name": "在运设备",
|
||||||
|
"font_class": "zaiyunshebei",
|
||||||
|
"unicode": "e604",
|
||||||
|
"unicode_decimal": 58884
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "22630860",
|
||||||
|
"name": "异常类_14非智能表在运异常",
|
||||||
|
"font_class": "yichanglei_14feizhinengbiaozaiyunyichang",
|
||||||
|
"unicode": "e666",
|
||||||
|
"unicode_decimal": 58982
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "32402696",
|
"icon_id": "32402696",
|
||||||
"name": "综合评价",
|
"name": "综合评价",
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/assets/img/inlogo.png
Normal file
BIN
src/assets/img/inlogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/img/region.png
Normal file
BIN
src/assets/img/region.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 263 KiB |
@@ -6,7 +6,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<TableHeader :showSearch="false">
|
<TableHeader :showSearch="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export function upper(str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function makeOptionsRule(t, to, userOptions) {
|
export function makeOptionsRule(t, to, userOptions) {
|
||||||
console.log(userOptions[0])
|
//console.log(userOptions[0])
|
||||||
const options = [
|
const options = [
|
||||||
{ label: t('props.optionsType.struct'), value: 0 },
|
{ label: t('props.optionsType.struct'), value: 0 },
|
||||||
{ label: t('props.optionsType.json'), value: 1 },
|
{ label: t('props.optionsType.json'), value: 1 },
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="overflow: auto; height: 100vh">
|
<div style="overflow: auto; height: 100vh">
|
||||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url" :options="excelOptions" />
|
<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" /> -->
|
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url" /> -->
|
||||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
<iframe v-if="urlKey.includes('.pdf')||urlKey.includes('.txt')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||||
<img v-if="url.includes('.png') || url.includes('.jpg') || url.includes('.gif') || url.includes('.bmp')"
|
<img
|
||||||
:src="url" />
|
v-if="
|
||||||
|
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
|
||||||
|
"
|
||||||
|
:src="url"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -18,15 +26,34 @@ import VueOfficeDocx from '@vue-office/docx'
|
|||||||
import VueOfficeExcel from '@vue-office/excel'
|
import VueOfficeExcel from '@vue-office/excel'
|
||||||
//引入VueOfficePdf组件
|
//引入VueOfficePdf组件
|
||||||
import VueOfficePdf from '@vue-office/pdf'
|
import VueOfficePdf from '@vue-office/pdf'
|
||||||
const { push, options, currentRoute } = useRouter()
|
import { downloadFile } from '@/api/system-boot/file'
|
||||||
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
import { previewFile } from '@/utils/fileDownLoad'
|
||||||
|
|
||||||
|
const { push, options, currentRoute } = useRouter()
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
|
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
||||||
|
const url = ref('')
|
||||||
|
const excelOptions = ref({})
|
||||||
|
const urlKey = currentRoute.value?.href?.split('?')[1]
|
||||||
|
|
||||||
|
if (VITE_FLAG) {
|
||||||
|
url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||||
|
excelOptions.value = ref({
|
||||||
|
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
setTimeout(async () => {
|
||||||
|
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||||
|
url.value = previewUrl
|
||||||
|
excelOptions.value = ref({
|
||||||
|
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||||
|
})
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
const url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
|
||||||
console.log("🚀 ~ url:", url)
|
|
||||||
const excelOptions = ref({
|
|
||||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
|
||||||
})
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 从路由参数获取文件路径
|
||||||
|
|
||||||
console.log()
|
console.log()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ const processSave = async () => {
|
|||||||
// return result.value || ' '
|
// return result.value || ' '
|
||||||
// }
|
// }
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
console.log(props, 'propspropspropsprops')
|
//console.log(props, 'propspropspropsprops')
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initBpmnModeler()
|
initBpmnModeler()
|
||||||
|
|||||||
@@ -279,6 +279,27 @@ const getResultCss = (status) => {
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getTaskNameItemType = (itemStatus: any) => {
|
||||||
|
if (itemStatus === 1) {
|
||||||
|
return '审批中'
|
||||||
|
}else if (itemStatus === 2) {
|
||||||
|
return '审批通过'
|
||||||
|
}else if (itemStatus === 3) {
|
||||||
|
return '审批不通过'
|
||||||
|
}else if (itemStatus === 4) {
|
||||||
|
return '已取消'
|
||||||
|
}else if (itemStatus === 5) {
|
||||||
|
return '退回'
|
||||||
|
} else if (itemStatus === 6) {
|
||||||
|
return '委派'
|
||||||
|
} else if (itemStatus === 7) {
|
||||||
|
return '审批通过中'
|
||||||
|
} else if (itemStatus === 0) {
|
||||||
|
return '待审批'
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
const getActivityOutgoing = (activity) => {
|
const getActivityOutgoing = (activity) => {
|
||||||
// 如果有 outgoing,则直接使用它
|
// 如果有 outgoing,则直接使用它
|
||||||
if (activity.outgoing && activity.outgoing.length > 0) {
|
if (activity.outgoing && activity.outgoing.length > 0) {
|
||||||
@@ -316,7 +337,9 @@ const elementHover = (element) => {
|
|||||||
!overlays.value && (overlays.value = bpmnModeler.get('overlays'))
|
!overlays.value && (overlays.value = bpmnModeler.get('overlays'))
|
||||||
// 展示信息
|
// 展示信息
|
||||||
// console.log(activityLists.value, 'activityLists.value')
|
// console.log(activityLists.value, 'activityLists.value')
|
||||||
// console.log(element.value, 'element.value')
|
if (element.value.type === 'bpmn:SequenceFlow') {
|
||||||
|
return
|
||||||
|
}
|
||||||
const activity = activityLists.value.find((m) => m.key === element.value.id)
|
const activity = activityLists.value.find((m) => m.key === element.value.id)
|
||||||
// console.log(activity, 'activityactivityactivityactivity')
|
// console.log(activity, 'activityactivityactivityactivity')
|
||||||
if (!activity) {
|
if (!activity) {
|
||||||
@@ -330,22 +353,22 @@ const elementHover = (element) => {
|
|||||||
if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
|
if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
|
||||||
html = `<p>发起人:${processInstance.value.startUser.name}</p>
|
html = `<p>发起人:${processInstance.value.startUser.name}</p>
|
||||||
<p>部门:${processInstance.value.startUser.deptName}</p>
|
<p>部门:${processInstance.value.startUser.deptName}</p>
|
||||||
<p>创建时间:${formatDate(processInstance.value.createTime)}`
|
<p>创建时间:${formatDate(processInstance.value.startTime)}`
|
||||||
} else if (element.value.type === 'bpmn:UserTask') {
|
} else if (element.value.type === 'bpmn:UserTask') {
|
||||||
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
||||||
if (!task) {
|
if (!task) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
// let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||||
let dataResult = ''
|
// let dataResult = ''
|
||||||
optionData.forEach((element) => {
|
// optionData.forEach((element) => {
|
||||||
if (element.value == task.status) {
|
// if (element.value == task.status) {
|
||||||
dataResult = element.label
|
// dataResult = element.label
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
html = `<p>审批人:${task.assigneeUser.name}</p>
|
html = `<p>审批人:${task.assigneeUser.name}</p>
|
||||||
<p>部门:${task.assigneeUser.deptName}</p>
|
<p>部门:${task.assigneeUser.deptName}</p>
|
||||||
<p>结果:${dataResult}</p>
|
<p>结果:${getTaskNameItemType(task.status)}</p>
|
||||||
<p>创建时间:${formatDate(task.createTime)}</p>`
|
<p>创建时间:${formatDate(task.createTime)}</p>`
|
||||||
// html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
// html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||||
// <p>部门:${task.assigneeUser.deptName}</p>
|
// <p>部门:${task.assigneeUser.deptName}</p>
|
||||||
@@ -368,20 +391,20 @@ const elementHover = (element) => {
|
|||||||
html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
|
html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
|
||||||
}
|
}
|
||||||
} else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
|
} else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
|
||||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
// let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||||
let dataResult = ''
|
// let dataResult = ''
|
||||||
optionData.forEach((element) => {
|
// optionData.forEach((element) => {
|
||||||
if (element.value == processInstance.value.status) {
|
// if (element.value == processInstance.value.status) {
|
||||||
dataResult = element.label
|
// dataResult = element.label
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
html = `<p>结果:${dataResult}</p>`
|
// html = `<p>结果:${dataResult}</p>`
|
||||||
// html = `<p>结果:${getIntDictOptions(
|
// html = `<p>结果:${getIntDictOptions(
|
||||||
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
||||||
// processInstance.value.status
|
// processInstance.value.status
|
||||||
// )}</p>`
|
// )}</p>`
|
||||||
if (processInstance.value.endTime) {
|
if (processInstance.value.endTime) {
|
||||||
html += `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
html = `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
|
elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
|
||||||
@@ -660,7 +683,7 @@ watch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
.element-overlays {
|
.element-overlays {
|
||||||
width: 200px;
|
width: 250px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
color: #fafafa;
|
color: #fafafa;
|
||||||
background: rgb(0 0 0 / 60%);
|
background: rgb(0 0 0 / 60%);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const addTask = (event, options: any = {}) => {
|
|||||||
const ElementFactory = bpmnInstances().elementFactory
|
const ElementFactory = bpmnInstances().elementFactory
|
||||||
const create = bpmnInstances().modeler.get('create')
|
const create = bpmnInstances().modeler.get('create')
|
||||||
|
|
||||||
console.log(ElementFactory, create)
|
//console.log(ElementFactory, create)
|
||||||
|
|
||||||
const shape = ElementFactory.createShape(assign({ type: 'bpmn:UserTask' }, options))
|
const shape = ElementFactory.createShape(assign({ type: 'bpmn:UserTask' }, options))
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ const addTask = (event, options: any = {}) => {
|
|||||||
shape.businessObject.di.isExpanded = options.isExpanded
|
shape.businessObject.di.isExpanded = options.isExpanded
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(event, 'event')
|
//console.log(event, 'event')
|
||||||
console.log(shape, 'shape')
|
//console.log(shape, 'shape')
|
||||||
create.start(event, shape)
|
create.start(event, shape)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ const unwatchBpmn = watch(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('props.bpmnModeler 有值了!!!')
|
//console.log('props.bpmnModeler 有值了!!!')
|
||||||
const w = window as any
|
const w = window as any
|
||||||
w.bpmnInstances = {
|
w.bpmnInstances = {
|
||||||
modeler: props.bpmnModeler,
|
modeler: props.bpmnModeler,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ onBeforeUnmount(() => {
|
|||||||
watch(
|
watch(
|
||||||
() => props.businessObject,
|
() => props.businessObject,
|
||||||
(val) => {
|
(val) => {
|
||||||
console.log(val, 'val')
|
//console.log(val, 'val')
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetFlowCondition()
|
resetFlowCondition()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,491 +1,491 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="panel-tab__content">
|
<div class="panel-tab__content">
|
||||||
<el-table :data="elementListenersList" size="small" border>
|
<el-table :data="elementListenersList" size="small" border>
|
||||||
<el-table-column label="序号" width="80px" type="index" />
|
<el-table-column label="序号" width="80px" type="index" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="事件类型"
|
label="事件类型"
|
||||||
min-width="80px"
|
min-width="80px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => listenerEventTypeObject[row.event]"
|
:formatter="(row) => listenerEventTypeObject[row.event]"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="事件id" min-width="80px" prop="id" show-overflow-tooltip />
|
<el-table-column label="事件id" min-width="80px" prop="id" show-overflow-tooltip />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="监听器类型"
|
label="监听器类型"
|
||||||
min-width="80px"
|
min-width="80px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => listenerTypeObject[row.listenerType]"
|
:formatter="(row) => listenerTypeObject[row.listenerType]"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="90px">
|
<el-table-column label="操作" width="90px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" link @click="openListenerForm(scope.row, scope.$index)"
|
<el-button size="small" link @click="openListenerForm(scope.row, scope.$index)"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
style="color: #ff4d4f"
|
style="color: #ff4d4f"
|
||||||
@click="removeListener(scope.row, scope.$index)"
|
@click="removeListener(scope.row, scope.$index)"
|
||||||
>移除</el-button
|
>移除</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="element-drawer__button">
|
<div class="element-drawer__button">
|
||||||
<XButton
|
<XButton
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
preIcon="ep:plus"
|
preIcon="ep:plus"
|
||||||
title="添加监听器"
|
title="添加监听器"
|
||||||
@click="openListenerForm(null)"
|
@click="openListenerForm(null)"
|
||||||
/>
|
/>
|
||||||
<XButton
|
<XButton
|
||||||
type="success"
|
type="success"
|
||||||
preIcon="ep:select"
|
preIcon="ep:select"
|
||||||
title="选择监听器"
|
title="选择监听器"
|
||||||
size="small"
|
size="small"
|
||||||
@click="openProcessListenerDialog"
|
@click="openProcessListenerDialog"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 监听器 编辑/创建 部分 -->
|
<!-- 监听器 编辑/创建 部分 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
v-model="listenerFormModelVisible"
|
v-model="listenerFormModelVisible"
|
||||||
title="任务监听器"
|
title="任务监听器"
|
||||||
:size="`${width}px`"
|
:size="`${width}px`"
|
||||||
append-to-body
|
append-to-body
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<el-form size="small" :model="listenerForm" label-width="96px" ref="listenerFormRef">
|
<el-form size="small" :model="listenerForm" label-width="96px" ref="listenerFormRef">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="事件类型"
|
label="事件类型"
|
||||||
prop="event"
|
prop="event"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerForm.event">
|
<el-select v-model="listenerForm.event">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="i in Object.keys(listenerEventTypeObject)"
|
v-for="i in Object.keys(listenerEventTypeObject)"
|
||||||
:key="i"
|
:key="i"
|
||||||
:label="listenerEventTypeObject[i]"
|
:label="listenerEventTypeObject[i]"
|
||||||
:value="i"
|
:value="i"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="监听器ID"
|
label="监听器ID"
|
||||||
prop="id"
|
prop="id"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.id" clearable />
|
<el-input v-model="listenerForm.id" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="监听器类型"
|
label="监听器类型"
|
||||||
prop="listenerType"
|
prop="listenerType"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerForm.listenerType">
|
<el-select v-model="listenerForm.listenerType">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="i in Object.keys(listenerTypeObject)"
|
v-for="i in Object.keys(listenerTypeObject)"
|
||||||
:key="i"
|
:key="i"
|
||||||
:label="listenerTypeObject[i]"
|
:label="listenerTypeObject[i]"
|
||||||
:value="i"
|
:value="i"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.listenerType === 'classListener'"
|
v-if="listenerForm.listenerType === 'classListener'"
|
||||||
label="Java类"
|
label="Java类"
|
||||||
prop="class"
|
prop="class"
|
||||||
key="listener-class"
|
key="listener-class"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.class" clearable />
|
<el-input v-model="listenerForm.class" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.listenerType === 'expressionListener'"
|
v-if="listenerForm.listenerType === 'expressionListener'"
|
||||||
label="表达式"
|
label="表达式"
|
||||||
prop="expression"
|
prop="expression"
|
||||||
key="listener-expression"
|
key="listener-expression"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.expression" clearable />
|
<el-input v-model="listenerForm.expression" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.listenerType === 'delegateExpressionListener'"
|
v-if="listenerForm.listenerType === 'delegateExpressionListener'"
|
||||||
label="代理表达式"
|
label="代理表达式"
|
||||||
prop="delegateExpression"
|
prop="delegateExpression"
|
||||||
key="listener-delegate"
|
key="listener-delegate"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.delegateExpression" clearable />
|
<el-input v-model="listenerForm.delegateExpression" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<template v-if="listenerForm.listenerType === 'scriptListener'">
|
<template v-if="listenerForm.listenerType === 'scriptListener'">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="脚本格式"
|
label="脚本格式"
|
||||||
prop="scriptFormat"
|
prop="scriptFormat"
|
||||||
key="listener-script-format"
|
key="listener-script-format"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本格式' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本格式' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.scriptFormat" clearable />
|
<el-input v-model="listenerForm.scriptFormat" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="脚本类型"
|
label="脚本类型"
|
||||||
prop="scriptType"
|
prop="scriptType"
|
||||||
key="listener-script-type"
|
key="listener-script-type"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择脚本类型' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择脚本类型' }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerForm.scriptType">
|
<el-select v-model="listenerForm.scriptType">
|
||||||
<el-option label="内联脚本" value="inlineScript" />
|
<el-option label="内联脚本" value="inlineScript" />
|
||||||
<el-option label="外部脚本" value="externalScript" />
|
<el-option label="外部脚本" value="externalScript" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.scriptType === 'inlineScript'"
|
v-if="listenerForm.scriptType === 'inlineScript'"
|
||||||
label="脚本内容"
|
label="脚本内容"
|
||||||
prop="value"
|
prop="value"
|
||||||
key="listener-script"
|
key="listener-script"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本内容' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本内容' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.value" clearable />
|
<el-input v-model="listenerForm.value" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.scriptType === 'externalScript'"
|
v-if="listenerForm.scriptType === 'externalScript'"
|
||||||
label="资源地址"
|
label="资源地址"
|
||||||
prop="resource"
|
prop="resource"
|
||||||
key="listener-resource"
|
key="listener-resource"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写资源地址' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写资源地址' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.resource" clearable />
|
<el-input v-model="listenerForm.resource" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="listenerForm.event === 'timeout'">
|
<template v-if="listenerForm.event === 'timeout'">
|
||||||
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
||||||
<el-select v-model="listenerForm.eventDefinitionType">
|
<el-select v-model="listenerForm.eventDefinitionType">
|
||||||
<el-option label="日期" value="date" />
|
<el-option label="统计时间" value="date" />
|
||||||
<el-option label="持续时长" value="duration" />
|
<el-option label="持续时长" value="duration" />
|
||||||
<el-option label="循环" value="cycle" />
|
<el-option label="循环" value="cycle" />
|
||||||
<el-option label="无" value="null" />
|
<el-option label="无" value="null" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="!!listenerForm.eventDefinitionType && listenerForm.eventDefinitionType !== 'null'"
|
v-if="!!listenerForm.eventDefinitionType && listenerForm.eventDefinitionType !== 'null'"
|
||||||
label="定时器"
|
label="定时器"
|
||||||
prop="eventTimeDefinitions"
|
prop="eventTimeDefinitions"
|
||||||
key="eventTimeDefinitions"
|
key="eventTimeDefinitions"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写定时器配置' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写定时器配置' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.eventTimeDefinitions" clearable />
|
<el-input v-model="listenerForm.eventTimeDefinitions" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<p class="listener-filed__title">
|
<p class="listener-filed__title">
|
||||||
<span><Icon icon="ep:menu" />注入字段:</span>
|
<span><Icon icon="ep:menu" />注入字段:</span>
|
||||||
<el-button size="small" type="primary" @click="openListenerFieldForm(null)"
|
<el-button size="small" type="primary" @click="openListenerFieldForm(null)"
|
||||||
>添加字段</el-button
|
>添加字段</el-button
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<el-table
|
<el-table
|
||||||
:data="fieldsListOfListener"
|
:data="fieldsListOfListener"
|
||||||
size="small"
|
size="small"
|
||||||
max-height="240"
|
max-height="240"
|
||||||
fit
|
fit
|
||||||
border
|
border
|
||||||
style="flex: none"
|
style="flex: none"
|
||||||
>
|
>
|
||||||
<el-table-column label="序号" width="80px" type="index" />
|
<el-table-column label="序号" width="80px" type="index" />
|
||||||
<el-table-column label="字段名称" min-width="100px" prop="name" />
|
<el-table-column label="字段名称" min-width="100px" prop="name" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="字段类型"
|
label="字段类型"
|
||||||
min-width="80px"
|
min-width="80px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => fieldTypeObject[row.fieldType]"
|
:formatter="(row) => fieldTypeObject[row.fieldType]"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="字段值/表达式"
|
label="字段值/表达式"
|
||||||
min-width="100px"
|
min-width="100px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => row.string || row.expression"
|
:formatter="(row) => row.string || row.expression"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="100px">
|
<el-table-column label="操作" width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" link @click="openListenerFieldForm(scope.row, scope.$index)"
|
<el-button size="small" link @click="openListenerFieldForm(scope.row, scope.$index)"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
style="color: #ff4d4f"
|
style="color: #ff4d4f"
|
||||||
@click="removeListenerField(scope.row, scope.$index)"
|
@click="removeListenerField(scope.row, scope.$index)"
|
||||||
>移除</el-button
|
>移除</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div class="element-drawer__button">
|
<div class="element-drawer__button">
|
||||||
<el-button size="small" @click="listenerFormModelVisible = false">取 消</el-button>
|
<el-button size="small" @click="listenerFormModelVisible = false">取 消</el-button>
|
||||||
<el-button size="small" type="primary" @click="saveListenerConfig">保 存</el-button>
|
<el-button size="small" type="primary" @click="saveListenerConfig">保 存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<!-- 注入西段 编辑/创建 部分 -->
|
<!-- 注入西段 编辑/创建 部分 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="字段配置"
|
title="字段配置"
|
||||||
v-model="listenerFieldFormModelVisible"
|
v-model="listenerFieldFormModelVisible"
|
||||||
width="600px"
|
width="600px"
|
||||||
append-to-body
|
append-to-body
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
:model="listenerFieldForm"
|
:model="listenerFieldForm"
|
||||||
size="small"
|
size="small"
|
||||||
label-width="96px"
|
label-width="96px"
|
||||||
ref="listenerFieldFormRef"
|
ref="listenerFieldFormRef"
|
||||||
style="height: 136px"
|
style="height: 136px"
|
||||||
>
|
>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="字段名称:"
|
label="字段名称:"
|
||||||
prop="name"
|
prop="name"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerFieldForm.name" clearable />
|
<el-input v-model="listenerFieldForm.name" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="字段类型:"
|
label="字段类型:"
|
||||||
prop="fieldType"
|
prop="fieldType"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerFieldForm.fieldType">
|
<el-select v-model="listenerFieldForm.fieldType">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="i in Object.keys(fieldTypeObject)"
|
v-for="i in Object.keys(fieldTypeObject)"
|
||||||
:key="i"
|
:key="i"
|
||||||
:label="fieldTypeObject[i]"
|
:label="fieldTypeObject[i]"
|
||||||
:value="i"
|
:value="i"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerFieldForm.fieldType === 'string'"
|
v-if="listenerFieldForm.fieldType === 'string'"
|
||||||
label="字段值:"
|
label="字段值:"
|
||||||
prop="string"
|
prop="string"
|
||||||
key="field-string"
|
key="field-string"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerFieldForm.string" clearable />
|
<el-input v-model="listenerFieldForm.string" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerFieldForm.fieldType === 'expression'"
|
v-if="listenerFieldForm.fieldType === 'expression'"
|
||||||
label="表达式:"
|
label="表达式:"
|
||||||
prop="expression"
|
prop="expression"
|
||||||
key="field-expression"
|
key="field-expression"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerFieldForm.expression" clearable />
|
<el-input v-model="listenerFieldForm.expression" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button size="small" @click="listenerFieldFormModelVisible = false">取 消</el-button>
|
<el-button size="small" @click="listenerFieldFormModelVisible = false">取 消</el-button>
|
||||||
<el-button size="small" type="primary" @click="saveListenerFiled">确 定</el-button>
|
<el-button size="small" type="primary" @click="saveListenerFiled">确 定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 选择弹窗 -->
|
<!-- 选择弹窗 -->
|
||||||
<ProcessListenerDialog ref="processListenerDialogRef" @select="selectProcessListener" />
|
<ProcessListenerDialog ref="processListenerDialogRef" @select="selectProcessListener" />
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
import { createListenerObject, updateElementExtensions } from '../../utils'
|
import { createListenerObject, updateElementExtensions } from '../../utils'
|
||||||
import {
|
import {
|
||||||
initListenerForm,
|
initListenerForm,
|
||||||
initListenerType,
|
initListenerType,
|
||||||
eventType,
|
eventType,
|
||||||
listenerType,
|
listenerType,
|
||||||
fieldType,
|
fieldType,
|
||||||
initListenerForm2
|
initListenerForm2
|
||||||
} from './utilSelf'
|
} from './utilSelf'
|
||||||
import ProcessListenerDialog from '@/components/bpmnProcessDesigner/package/penal/listeners/ProcessListenerDialog.vue'
|
import ProcessListenerDialog from '@/components/bpmnProcessDesigner/package/penal/listeners/ProcessListenerDialog.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'UserTaskListeners' })
|
defineOptions({ name: 'UserTaskListeners' })
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: String,
|
id: String,
|
||||||
type: String
|
type: String
|
||||||
})
|
})
|
||||||
const prefix = inject('prefix')
|
const prefix = inject('prefix')
|
||||||
const width = inject('width')
|
const width = inject('width')
|
||||||
const elementListenersList = ref<any[]>([])
|
const elementListenersList = ref<any[]>([])
|
||||||
const listenerEventTypeObject = ref(eventType)
|
const listenerEventTypeObject = ref(eventType)
|
||||||
const listenerTypeObject = ref(listenerType)
|
const listenerTypeObject = ref(listenerType)
|
||||||
const listenerFormModelVisible = ref(false)
|
const listenerFormModelVisible = ref(false)
|
||||||
const listenerForm = ref<any>({})
|
const listenerForm = ref<any>({})
|
||||||
const fieldTypeObject = ref(fieldType)
|
const fieldTypeObject = ref(fieldType)
|
||||||
const fieldsListOfListener = ref<any[]>([])
|
const fieldsListOfListener = ref<any[]>([])
|
||||||
const listenerFieldFormModelVisible = ref(false) // 监听器 注入字段表单弹窗 显示状态
|
const listenerFieldFormModelVisible = ref(false) // 监听器 注入字段表单弹窗 显示状态
|
||||||
const editingListenerIndex = ref(-1) // 监听器所在下标,-1 为新增
|
const editingListenerIndex = ref(-1) // 监听器所在下标,-1 为新增
|
||||||
const editingListenerFieldIndex = ref(-1) // 字段所在下标,-1 为新增
|
const editingListenerFieldIndex = ref(-1) // 字段所在下标,-1 为新增
|
||||||
const listenerFieldForm = ref<any>({}) // 监听器 注入字段 详情表单
|
const listenerFieldForm = ref<any>({}) // 监听器 注入字段 详情表单
|
||||||
const bpmnElement = ref()
|
const bpmnElement = ref()
|
||||||
const bpmnElementListeners = ref()
|
const bpmnElementListeners = ref()
|
||||||
const otherExtensionList = ref()
|
const otherExtensionList = ref()
|
||||||
const listenerFormRef = ref()
|
const listenerFormRef = ref()
|
||||||
const listenerFieldFormRef = ref()
|
const listenerFieldFormRef = ref()
|
||||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||||
|
|
||||||
const resetListenersList = () => {
|
const resetListenersList = () => {
|
||||||
// console.log(
|
// console.log(
|
||||||
// bpmnInstances().bpmnElement,
|
// bpmnInstances().bpmnElement,
|
||||||
// 'window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement'
|
// 'window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement'
|
||||||
// )
|
// )
|
||||||
bpmnElement.value = bpmnInstances().bpmnElement
|
bpmnElement.value = bpmnInstances().bpmnElement
|
||||||
otherExtensionList.value = []
|
otherExtensionList.value = []
|
||||||
bpmnElementListeners.value =
|
bpmnElementListeners.value =
|
||||||
bpmnElement.value.businessObject?.extensionElements?.values.filter(
|
bpmnElement.value.businessObject?.extensionElements?.values.filter(
|
||||||
(ex) => ex.$type === `${prefix}:TaskListener`
|
(ex) => ex.$type === `${prefix}:TaskListener`
|
||||||
) ?? []
|
) ?? []
|
||||||
elementListenersList.value = bpmnElementListeners.value.map((listener) =>
|
elementListenersList.value = bpmnElementListeners.value.map((listener) =>
|
||||||
initListenerType(listener)
|
initListenerType(listener)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const openListenerForm = (listener, index?) => {
|
const openListenerForm = (listener, index?) => {
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listenerForm.value = initListenerForm(listener)
|
listenerForm.value = initListenerForm(listener)
|
||||||
editingListenerIndex.value = index
|
editingListenerIndex.value = index
|
||||||
} else {
|
} else {
|
||||||
listenerForm.value = {}
|
listenerForm.value = {}
|
||||||
editingListenerIndex.value = -1 // 标记为新增
|
editingListenerIndex.value = -1 // 标记为新增
|
||||||
}
|
}
|
||||||
if (listener && listener.fields) {
|
if (listener && listener.fields) {
|
||||||
fieldsListOfListener.value = listener.fields.map((field) => ({
|
fieldsListOfListener.value = listener.fields.map((field) => ({
|
||||||
...field,
|
...field,
|
||||||
fieldType: field.string ? 'string' : 'expression'
|
fieldType: field.string ? 'string' : 'expression'
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
fieldsListOfListener.value = []
|
fieldsListOfListener.value = []
|
||||||
listenerForm.value['fields'] = []
|
listenerForm.value['fields'] = []
|
||||||
}
|
}
|
||||||
// 打开侧边栏并清楚验证状态
|
// 打开侧边栏并清楚验证状态
|
||||||
listenerFormModelVisible.value = true
|
listenerFormModelVisible.value = true
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (listenerFormRef.value) listenerFormRef.value.clearValidate()
|
if (listenerFormRef.value) listenerFormRef.value.clearValidate()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 移除监听器
|
// 移除监听器
|
||||||
const removeListener = (listener, index?) => {
|
const removeListener = (listener, index?) => {
|
||||||
console.log(listener, 'listener')
|
//console.log(listener, 'listener')
|
||||||
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
||||||
confirmButtonText: '确 认',
|
confirmButtonText: '确 认',
|
||||||
cancelButtonText: '取 消'
|
cancelButtonText: '取 消'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
bpmnElementListeners.value.splice(index, 1)
|
bpmnElementListeners.value.splice(index, 1)
|
||||||
elementListenersList.value.splice(index, 1)
|
elementListenersList.value.splice(index, 1)
|
||||||
updateElementExtensions(
|
updateElementExtensions(
|
||||||
bpmnElement.value,
|
bpmnElement.value,
|
||||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.catch(() => console.info('操作取消'))
|
.catch(() => console.info('操作取消'))
|
||||||
}
|
}
|
||||||
// 保存监听器
|
// 保存监听器
|
||||||
const saveListenerConfig = async () => {
|
const saveListenerConfig = async () => {
|
||||||
let validateStatus = await listenerFormRef.value.validate()
|
let validateStatus = await listenerFormRef.value.validate()
|
||||||
if (!validateStatus) return // 验证不通过直接返回
|
if (!validateStatus) return // 验证不通过直接返回
|
||||||
const listenerObject = createListenerObject(listenerForm.value, true, prefix)
|
const listenerObject = createListenerObject(listenerForm.value, true, prefix)
|
||||||
if (editingListenerIndex.value === -1) {
|
if (editingListenerIndex.value === -1) {
|
||||||
bpmnElementListeners.value.push(listenerObject)
|
bpmnElementListeners.value.push(listenerObject)
|
||||||
elementListenersList.value.push(listenerForm.value)
|
elementListenersList.value.push(listenerForm.value)
|
||||||
} else {
|
} else {
|
||||||
bpmnElementListeners.value.splice(editingListenerIndex.value, 1, listenerObject)
|
bpmnElementListeners.value.splice(editingListenerIndex.value, 1, listenerObject)
|
||||||
elementListenersList.value.splice(editingListenerIndex.value, 1, listenerForm.value)
|
elementListenersList.value.splice(editingListenerIndex.value, 1, listenerForm.value)
|
||||||
}
|
}
|
||||||
// 保存其他配置
|
// 保存其他配置
|
||||||
otherExtensionList.value =
|
otherExtensionList.value =
|
||||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||||
) ?? []
|
) ?? []
|
||||||
updateElementExtensions(
|
updateElementExtensions(
|
||||||
bpmnElement.value,
|
bpmnElement.value,
|
||||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||||
)
|
)
|
||||||
// 4. 隐藏侧边栏
|
// 4. 隐藏侧边栏
|
||||||
listenerFormModelVisible.value = false
|
listenerFormModelVisible.value = false
|
||||||
listenerForm.value = {}
|
listenerForm.value = {}
|
||||||
}
|
}
|
||||||
// 打开监听器字段编辑弹窗
|
// 打开监听器字段编辑弹窗
|
||||||
const openListenerFieldForm = (field, index?) => {
|
const openListenerFieldForm = (field, index?) => {
|
||||||
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
|
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
|
||||||
editingListenerFieldIndex.value = field ? index : -1
|
editingListenerFieldIndex.value = field ? index : -1
|
||||||
listenerFieldFormModelVisible.value = true
|
listenerFieldFormModelVisible.value = true
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (listenerFieldFormRef.value) listenerFieldFormRef.value.clearValidate()
|
if (listenerFieldFormRef.value) listenerFieldFormRef.value.clearValidate()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 保存监听器注入字段
|
// 保存监听器注入字段
|
||||||
const saveListenerFiled = async () => {
|
const saveListenerFiled = async () => {
|
||||||
let validateStatus = await listenerFieldFormRef.value.validate()
|
let validateStatus = await listenerFieldFormRef.value.validate()
|
||||||
if (!validateStatus) return // 验证不通过直接返回
|
if (!validateStatus) return // 验证不通过直接返回
|
||||||
if (editingListenerFieldIndex.value === -1) {
|
if (editingListenerFieldIndex.value === -1) {
|
||||||
fieldsListOfListener.value.push(listenerFieldForm.value)
|
fieldsListOfListener.value.push(listenerFieldForm.value)
|
||||||
listenerForm.value.fields.push(listenerFieldForm.value)
|
listenerForm.value.fields.push(listenerFieldForm.value)
|
||||||
} else {
|
} else {
|
||||||
fieldsListOfListener.value.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
fieldsListOfListener.value.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||||
listenerForm.value.fields.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
listenerForm.value.fields.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||||
}
|
}
|
||||||
listenerFieldFormModelVisible.value = false
|
listenerFieldFormModelVisible.value = false
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
listenerFieldForm.value = {}
|
listenerFieldForm.value = {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 移除监听器字段
|
// 移除监听器字段
|
||||||
const removeListenerField = (field, index) => {
|
const removeListenerField = (field, index) => {
|
||||||
console.log(field, 'field')
|
console.log(field, 'field')
|
||||||
ElMessageBox.confirm('确认移除该字段吗?', '提示', {
|
ElMessageBox.confirm('确认移除该字段吗?', '提示', {
|
||||||
confirmButtonText: '确 认',
|
confirmButtonText: '确 认',
|
||||||
cancelButtonText: '取 消'
|
cancelButtonText: '取 消'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fieldsListOfListener.value.splice(index, 1)
|
fieldsListOfListener.value.splice(index, 1)
|
||||||
listenerForm.value.fields.splice(index, 1)
|
listenerForm.value.fields.splice(index, 1)
|
||||||
})
|
})
|
||||||
.catch(() => console.info('操作取消'))
|
.catch(() => console.info('操作取消'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开监听器弹窗
|
// 打开监听器弹窗
|
||||||
const processListenerDialogRef = ref()
|
const processListenerDialogRef = ref()
|
||||||
const openProcessListenerDialog = async () => {
|
const openProcessListenerDialog = async () => {
|
||||||
processListenerDialogRef.value.open('task')
|
processListenerDialogRef.value.open('task')
|
||||||
}
|
}
|
||||||
const selectProcessListener = (listener) => {
|
const selectProcessListener = (listener) => {
|
||||||
const listenerForm = initListenerForm2(listener)
|
const listenerForm = initListenerForm2(listener)
|
||||||
const listenerObject = createListenerObject(listenerForm, true, prefix)
|
const listenerObject = createListenerObject(listenerForm, true, prefix)
|
||||||
bpmnElementListeners.value.push(listenerObject)
|
bpmnElementListeners.value.push(listenerObject)
|
||||||
elementListenersList.value.push(listenerForm)
|
elementListenersList.value.push(listenerForm)
|
||||||
|
|
||||||
// 保存其他配置
|
// 保存其他配置
|
||||||
otherExtensionList.value =
|
otherExtensionList.value =
|
||||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||||
) ?? []
|
) ?? []
|
||||||
updateElementExtensions(
|
updateElementExtensions(
|
||||||
bpmnElement.value,
|
bpmnElement.value,
|
||||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.id,
|
() => props.id,
|
||||||
(val) => {
|
(val) => {
|
||||||
val &&
|
val &&
|
||||||
val.length &&
|
val.length &&
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetListenersList()
|
resetListenersList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function initListenerForm(listener) {
|
|||||||
self.eventDefinitionType = key.replace('time', '').toLowerCase()
|
self.eventDefinitionType = key.replace('time', '').toLowerCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(k)
|
//console.log(k)
|
||||||
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body
|
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const modelConfig = computed(() => {
|
|||||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||||
|
|
||||||
const initDataList = () => {
|
const initDataList = () => {
|
||||||
console.log(window, 'window')
|
//console.log(window, 'window')
|
||||||
rootElements.value = bpmnInstances().modeler.getDefinitions().rootElements
|
rootElements.value = bpmnInstances().modeler.getDefinitions().rootElements
|
||||||
messageIdMap.value = {}
|
messageIdMap.value = {}
|
||||||
signalIdMap.value = {}
|
signalIdMap.value = {}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ function xml2json(xml) {
|
|||||||
|
|
||||||
function xmlObj2json(xml) {
|
function xmlObj2json(xml) {
|
||||||
const xmlObj = xmlStr2XmlObj(xml)
|
const xmlObj = xmlStr2XmlObj(xml)
|
||||||
console.log(xmlObj)
|
// console.log(xmlObj)
|
||||||
let jsonObj = {}
|
let jsonObj = {}
|
||||||
if (xmlObj.childNodes.length > 0) {
|
if (xmlObj.childNodes.length > 0) {
|
||||||
jsonObj = xml2json(xmlObj)
|
jsonObj = xml2json(xmlObj)
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ const tableStore: any = new TableStore({
|
|||||||
tableStore.table.params.deptId = dictData.state.area[0].id
|
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||||
tableStore.table.params.alarmDayLimit = 5
|
tableStore.table.params.alarmDayLimit = 5
|
||||||
tableStore.table.params.warnDayLimit = 1
|
tableStore.table.params.warnDayLimit = 1
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
const echart = () => {
|
const echart = () => {
|
||||||
percentage.value = {
|
percentage.value = {
|
||||||
color: ['#FF9100'],
|
color: ['#FF9100'],
|
||||||
@@ -364,6 +365,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
.statistics {
|
.statistics {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="divBox mt10">
|
<div class="divBox mt10">
|
||||||
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
<span class="divBox_title">低于90%监测点数</span>
|
<span class="divBox_title">低于90%监测点数</span>
|
||||||
<span class="divBox_num" style="color: #ff6600">
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
{{ monitoringPoints.abnormalNum }}
|
{{ monitoringPoints.abnormalNum }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
{{ o.citTotalNum }}
|
{{ o.citTotalNum }}
|
||||||
</span>
|
</span>
|
||||||
<!-- 低于90%监测点数 -->
|
<!-- 低于90%监测点数 -->
|
||||||
<span style="flex: 1; color: #ff9100" class="text">
|
<span style="flex: 1; color: #388e3c" class="text">
|
||||||
{{ o.citBelowNum }}
|
{{ o.citBelowNum }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
@@ -179,10 +179,17 @@ const tableStore: any = new TableStore({
|
|||||||
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
abnormal.value = tableStore.table.data.citDetailList
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
const echart = () => {
|
const echart = () => {
|
||||||
percentage.value = {
|
percentage.value = {
|
||||||
color: ['#FF9100'],
|
color: ['#FF9100'],
|
||||||
@@ -216,7 +223,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -233,7 +240,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -242,7 +249,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -263,11 +270,11 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: '#FF9100' // 0% 处的颜色
|
color: '#57bc6e ' // 0% 处的颜色
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#FF9100' // 100% 处的颜色
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -340,6 +347,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
.statistics {
|
.statistics {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="divBox mt10">
|
<div class="divBox mt10">
|
||||||
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
<span class="divBox_title">低于90%终端数</span>
|
<span class="divBox_title">低于90%终端数</span>
|
||||||
<span class="divBox_num" style="color: #ff6600">
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
{{ monitoringPoints.abnormalNum }}
|
{{ monitoringPoints.abnormalNum }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
{{ o.citTotalNum }}
|
{{ o.citTotalNum }}
|
||||||
</span>
|
</span>
|
||||||
<!-- 低于90%终端数 -->
|
<!-- 低于90%终端数 -->
|
||||||
<span style="flex: 1; color: #ff9100" class="text">
|
<span style="flex: 1; color: #388e3c" class="text">
|
||||||
{{ o.citBelowNum }}
|
{{ o.citBelowNum }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
@@ -177,10 +177,18 @@ const tableStore: any = new TableStore({
|
|||||||
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
abnormal.value = tableStore.table.data.citDetailList
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
const echart = () => {
|
const echart = () => {
|
||||||
percentage.value = {
|
percentage.value = {
|
||||||
color: ['#FF9100'],
|
color: ['#FF9100'],
|
||||||
@@ -214,7 +222,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -231,7 +239,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -240,7 +248,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -261,11 +269,11 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: '#FF9100' // 0% 处的颜色
|
color: '#57bc6e' // 0% 处的颜色
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#FF9100' // 100% 处的颜色
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -338,6 +346,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
.statistics {
|
.statistics {
|
||||||
|
|||||||
@@ -18,29 +18,53 @@
|
|||||||
>
|
>
|
||||||
<div style="flex: 1">
|
<div style="flex: 1">
|
||||||
<div class="title">终端统计</div>
|
<div class="title">终端统计</div>
|
||||||
<div style="height: 135px" class="box1">
|
<div
|
||||||
<div class="boxDiv hexagon">
|
class="box1"
|
||||||
<div style="color: #fff">{{ statisticsList.allNum }}</div>
|
:style="{
|
||||||
<div class="mt10 divBot">总数</div>
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 30px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox div1">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">终端总数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #57bc6e">
|
||||||
|
{{ statisticsList.allNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox div2">
|
||||||
|
<span class="iconfont icon-zaiyunshebei" style="color: #67c23a"></span>
|
||||||
|
<span class="divBox_title">在运终端数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #67c23a">
|
||||||
|
{{ statisticsList.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="boxDiv hexagon hexagon1">
|
|
||||||
<div style="color: #fff">{{ statisticsList.runNum }}</div>
|
<div class="statistics">
|
||||||
<div class="mt10 divBot">在运</div>
|
<div class="divBox div3">
|
||||||
</div>
|
<span
|
||||||
</div>
|
class="iconfont icon-yichanglei_14feizhinengbiaozaiyunyichang"
|
||||||
<div style="height: 135px" class="box1">
|
style="color: #ffbf00"
|
||||||
<div class="boxDiv hexagon hexagon2">
|
></span>
|
||||||
<div style="color: #fff">{{ statisticsList.checkNum }}</div>
|
<span class="divBox_title">调试终端数</span>
|
||||||
<div class="mt10 divBot">调试</div>
|
<span class="divBox_num text-style" style="color: #ffbf00">
|
||||||
</div>
|
{{ statisticsList.checkNum }}
|
||||||
<div class="boxDiv hexagon hexagon3">
|
</span>
|
||||||
<div style="color: #fff">{{ statisticsList.stopRunNum }}</div>
|
</div>
|
||||||
<div class="mt10 divBot">停运</div>
|
<div class="divBox div4">
|
||||||
|
<span class="iconfont icon-tingyunshijianguanli" style="color: #f56c6c"></span>
|
||||||
|
<span class="divBox_title">停运终端数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #f56c6c">
|
||||||
|
{{ statisticsList.stopRunNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 2" class="ml15">
|
<div style="flex: 2" class="ml15">
|
||||||
<div class="title">完整性统计</div>
|
<div class="title">终端运行统计</div>
|
||||||
|
|
||||||
<div class="mb5" style="height: 40px">
|
<div class="mb5" style="height: 40px">
|
||||||
<el-segmented
|
<el-segmented
|
||||||
@@ -65,7 +89,7 @@
|
|||||||
<span style="width: 90px">终端总数</span>
|
<span style="width: 90px">终端总数</span>
|
||||||
<span style="flex: 1">完整性(%)</span>
|
<span style="flex: 1">完整性(%)</span>
|
||||||
<span style="flex: 1">在线率(%)</span>
|
<span style="flex: 1">在线率(%)</span>
|
||||||
<span style="flex: 1">合格率(%)</span>
|
<span style="flex: 1">异常率(%)</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
:style="{
|
:style="{
|
||||||
@@ -84,7 +108,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<sp
|
<sp
|
||||||
style="flex: 1; color: #ff9100"
|
style="flex: 1; color: #388e3c"
|
||||||
class="text"
|
class="text"
|
||||||
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
||||||
>
|
>
|
||||||
@@ -99,7 +123,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
style="flex: 1; color: #388e3c"
|
style="flex: 1; color: #388e3c"
|
||||||
:class="` ${o.qualified < 90 ? 'text-red' : ''}`"
|
:class="` ${o.qualified > 10 ? 'text-red' : ''}`"
|
||||||
class="text"
|
class="text"
|
||||||
>
|
>
|
||||||
{{ o.qualified }}
|
{{ o.qualified }}
|
||||||
@@ -205,11 +229,17 @@ const tableStore: any = new TableStore({
|
|||||||
statisticsList.value.checkNum = totalData.value.filter(item => item.runFlag === '调试').length
|
statisticsList.value.checkNum = totalData.value.filter(item => item.runFlag === '调试').length
|
||||||
statisticsList.value.stopRunNum = totalData.value.filter(item => item.runFlag === '停运').length
|
statisticsList.value.stopRunNum = totalData.value.filter(item => item.runFlag === '停运').length
|
||||||
|
|
||||||
abnormal.value = tableStore.table.data
|
abnormal.value = tableStore.table.data.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.count != 0
|
||||||
|
} else {
|
||||||
|
return k.name != '上送国网' && k.name != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -234,6 +264,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
@@ -344,32 +375,7 @@ watch(
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
.box1 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-around;
|
|
||||||
.boxDiv {
|
|
||||||
// flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
margin: 0 5px;
|
|
||||||
|
|
||||||
div:nth-child(1) {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 30px;
|
|
||||||
top: -10px;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
.divBot {
|
|
||||||
font-size: 16px;
|
|
||||||
position: absolute;
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.hexagon {
|
.hexagon {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
@@ -427,4 +433,44 @@ watch(
|
|||||||
border-top: 27.5px solid #a52a2a;
|
border-top: 27.5px solid #a52a2a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
.divBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.div1 {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
.div2 {
|
||||||
|
background-color: #67c23a24;
|
||||||
|
}
|
||||||
|
.div3 {
|
||||||
|
background-color: #ffbf0024;
|
||||||
|
}
|
||||||
|
.div4 {
|
||||||
|
background-color: #f56c6c24;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { color, gradeColor3 } from './color'
|
|||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
// import { nextTick } from 'process'
|
// import { nextTick } from 'process'
|
||||||
const emit = defineEmits(['triggerPoint', 'group'])
|
const emit = defineEmits(['triggerPoint', 'group', 'echartClick'])
|
||||||
color[0] = config.layout.elementUiPrimary[0]
|
color[0] = config.layout.elementUiPrimary[0]
|
||||||
const chartRef = ref<HTMLDivElement>()
|
const chartRef = ref<HTMLDivElement>()
|
||||||
|
|
||||||
@@ -70,6 +70,8 @@ const initChart = () => {
|
|||||||
const value =
|
const value =
|
||||||
item.value === 3.14159 || item.value === 0.14159
|
item.value === 3.14159 || item.value === 0.14159
|
||||||
? '暂无数据'
|
? '暂无数据'
|
||||||
|
: item.value === 0.14158
|
||||||
|
? 0
|
||||||
: Math.round(item.value * 100) / 100 // 处理特殊值
|
: Math.round(item.value * 100) / 100 // 处理特殊值
|
||||||
tips += `<div style=" display: flex;justify-content: space-between;">
|
tips += `<div style=" display: flex;justify-content: space-between;">
|
||||||
<span>${item.marker}
|
<span>${item.marker}
|
||||||
@@ -153,6 +155,8 @@ const initChart = () => {
|
|||||||
chart.on('click', function (params) {
|
chart.on('click', function (params) {
|
||||||
if (params.seriesName == '暂态触发点') {
|
if (params.seriesName == '暂态触发点') {
|
||||||
emit('triggerPoint', params.data)
|
emit('triggerPoint', params.data)
|
||||||
|
} else {
|
||||||
|
emit('echartClick', params)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeUnmount, ref, watch, onMounted, defineEmits } from 'vue'
|
import { onBeforeUnmount, ref, watch, onMounted, } from 'vue'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import 'echarts-gl'
|
import 'echarts-gl'
|
||||||
import 'echarts-liquidfill'
|
import 'echarts-liquidfill'
|
||||||
@@ -19,14 +19,22 @@ const myCharts = ref()
|
|||||||
const showCircle = ref(false)
|
const showCircle = ref(false)
|
||||||
|
|
||||||
const fetchConfig = async (name: string) => {
|
const fetchConfig = async (name: string) => {
|
||||||
const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
|
try {
|
||||||
return res.default
|
// 处理城市名称(去掉末尾的"市")并尝试导入对应文件
|
||||||
|
const res = await import(`../../assets/map/${name.replace(/市$/, '')}.json`)
|
||||||
|
return res.default
|
||||||
|
} catch (error) {
|
||||||
|
const chinaRes = await import(`../../assets/map/中国.json`) // 请确认中国文件的实际命名
|
||||||
|
return chinaRes.default
|
||||||
|
}
|
||||||
|
// const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
|
||||||
|
// return res.default
|
||||||
// GetEchar(res.default)
|
// GetEchar(res.default)
|
||||||
}
|
}
|
||||||
// fetchConfig()
|
// fetchConfig()
|
||||||
|
|
||||||
const emit = defineEmits(['getRegionByRegion', 'eliminate', 'clickMap'])
|
const emit = defineEmits(['getRegionByRegion', 'eliminate', 'clickMap'])
|
||||||
onMounted(() => { })
|
onMounted(() => {})
|
||||||
|
|
||||||
const GetEchar = async (name: string) => {
|
const GetEchar = async (name: string) => {
|
||||||
let chartDom = document.getElementById('chartMap')
|
let chartDom = document.getElementById('chartMap')
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
export let color = [
|
export const color = [
|
||||||
'#07CCCA',
|
'#07CCCA',
|
||||||
'#00BFF5',
|
'#00BFF5',
|
||||||
'#FFBF00',
|
'#FFBF00',
|
||||||
'#77DA63',
|
'#77DA63',
|
||||||
'#D5FF6B',
|
'#D5FF6B',
|
||||||
'#Ff6600',
|
'#Ff6600',
|
||||||
'#FF9100',
|
'#FF9100',
|
||||||
'#5B6E96',
|
'#5B6E96',
|
||||||
'#66FFCC',
|
'#66FFCC',
|
||||||
'#B3B'
|
'#B266FF',
|
||||||
]
|
'#FF6680',
|
||||||
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
'#40A0FF',
|
||||||
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
'#33CC99'
|
||||||
|
]
|
||||||
|
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
||||||
|
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ const timeChange = (e: number) => {
|
|||||||
|
|
||||||
// 当前
|
// 当前
|
||||||
const nowTime = () => {
|
const nowTime = () => {
|
||||||
console.log(interval.value, '000000000')
|
//console.log(interval.value, '000000000')
|
||||||
timeChange(interval.value)
|
timeChange(interval.value)
|
||||||
}
|
}
|
||||||
// 上一个
|
// 上一个
|
||||||
@@ -312,7 +312,7 @@ const next = () => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
month = month + 3
|
month = month + 3
|
||||||
console.log('🚀 ~ next ~ presentM:', presentM, month)
|
// console.log('🚀 ~ next ~ presentM:', presentM, month)
|
||||||
|
|
||||||
// 季度进位后,超过当前月份是不科学的
|
// 季度进位后,超过当前月份是不科学的
|
||||||
if (year == presentY && !props.nextFlag) {
|
if (year == presentY && !props.nextFlag) {
|
||||||
@@ -327,7 +327,7 @@ const next = () => {
|
|||||||
endTime = year + '-0' + presentM + '-' + presentD
|
endTime = year + '-0' + presentM + '-' + presentD
|
||||||
}
|
}
|
||||||
} else if (presentM > 3 && presentM < 7) {
|
} else if (presentM > 3 && presentM < 7) {
|
||||||
console.log(123123)
|
// console.log(123123)
|
||||||
// 第二季度
|
// 第二季度
|
||||||
startTime = year + '-04-01'
|
startTime = year + '-04-01'
|
||||||
if (presentD < 10) {
|
if (presentD < 10) {
|
||||||
@@ -380,7 +380,7 @@ const next = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(startTime, endTime)
|
// console.log(startTime, endTime)
|
||||||
} else if (interval.value == 5) {
|
} else if (interval.value == 5) {
|
||||||
} else if (interval.value == 4) {
|
} else if (interval.value == 4) {
|
||||||
//根据开始时间推
|
//根据开始时间推
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export const defaultAttribute: VxeTableProps = {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
headerCellClassName: 'table-header-cell',
|
headerCellClassName: 'table-header-cell',
|
||||||
border: true,
|
border: true,
|
||||||
|
stripe: true,
|
||||||
size: 'small',
|
size: 'small',
|
||||||
columnConfig: { resizable: true },
|
columnConfig: { resizable: true },
|
||||||
rowConfig: { isCurrent: true, isHover: true },
|
rowConfig: { isCurrent: true, isHover: true },
|
||||||
@@ -13,6 +13,7 @@ export const defaultAttribute: VxeTableProps = {
|
|||||||
treeConfig: {
|
treeConfig: {
|
||||||
reserve: true
|
reserve: true
|
||||||
},
|
},
|
||||||
|
showOverflow: true,
|
||||||
showOverflow: true
|
showFooter:true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
>
|
>
|
||||||
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
||||||
<template #label>
|
<template #label>
|
||||||
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="时间" />
|
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="统计时间" />
|
||||||
<span v-else>{{ dateLabel }}</span>
|
<span v-else>{{ dateLabel }}</span>
|
||||||
</template>
|
</template>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="区域" v-if="area">
|
<el-form-item label="区域" v-if="area">
|
||||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" />
|
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<slot name="select"></slot>
|
<slot name="select"></slot>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
@click="onExport"
|
@click="onExport"
|
||||||
v-if="showExport"
|
v-if="showExport"
|
||||||
:loading="tableStore.table.loading"
|
:loading="tableStore.table.exportLoading"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-Download"
|
icon="el-icon-Download"
|
||||||
>
|
>
|
||||||
@@ -81,7 +81,7 @@ import { mainHeight } from '@/utils/layout'
|
|||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
const emit = defineEmits(['selectChange'])
|
const emit = defineEmits(['selectChange','areaChange'])
|
||||||
const tableStore = inject('tableStore') as TableStore
|
const tableStore = inject('tableStore') as TableStore
|
||||||
const tableHeader = ref()
|
const tableHeader = ref()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
@@ -111,7 +111,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
showReset: true,
|
showReset: true,
|
||||||
showExport: false,
|
showExport: false,
|
||||||
showTimeAll: false,
|
showTimeAll: false,
|
||||||
dateLabel: '时间'
|
dateLabel: '统计日期'
|
||||||
})
|
})
|
||||||
// 动态计算table高度
|
// 动态计算table高度
|
||||||
const resizeObserver = new ResizeObserver(entries => {
|
const resizeObserver = new ResizeObserver(entries => {
|
||||||
@@ -132,11 +132,17 @@ const headerFormSecondStyleClose = {
|
|||||||
padding: '0'
|
padding: '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onAreaChange = (data) => {
|
||||||
|
|
||||||
|
emit('areaChange', {label: data.label})
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => tableStore?.table.params.deptIndex,
|
() => tableStore?.table.params.deptIndex,
|
||||||
newVal => {
|
newVal => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
areaRef.value && areaRef.value.change()
|
areaRef.value && areaRef.value.change()
|
||||||
|
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -182,7 +188,7 @@ const handlerHeight = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const computedSearchRow = () => {
|
const computedSearchRow = () => {
|
||||||
if (!headerForm.value.$el) return
|
if (!headerForm.value?.$el) return
|
||||||
// 清空headerFormSecond.value.$el下的元素
|
// 清空headerFormSecond.value.$el下的元素
|
||||||
while (headerFormSecond.value.$el.firstChild) {
|
while (headerFormSecond.value.$el.firstChild) {
|
||||||
headerForm.value.$el.appendChild(headerFormSecond.value.$el.firstChild)
|
headerForm.value.$el.appendChild(headerFormSecond.value.$el.firstChild)
|
||||||
@@ -231,6 +237,26 @@ const setDatePicker = (list: any) => {
|
|||||||
const onResetForm = () => {
|
const onResetForm = () => {
|
||||||
//时间重置成默认值
|
//时间重置成默认值
|
||||||
datePickerRef.value?.setTheDate(3)
|
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.datePicker && timeAll.value) {
|
||||||
|
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||||
|
tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1]
|
||||||
|
tableStore.table.params.startTime = datePickerRef.value.timeValue[0]
|
||||||
|
tableStore.table.params.endTime = datePickerRef.value.timeValue[1]
|
||||||
|
tableStore.table.params.timeFlag = datePickerRef.value.timeFlag
|
||||||
|
tableStore.table.params.interval = datePickerRef.value.interval
|
||||||
|
}
|
||||||
|
|
||||||
tableStore.onTableAction('reset', {})
|
tableStore.onTableAction('reset', {})
|
||||||
}
|
}
|
||||||
const setTheDate = (val: any) => {
|
const setTheDate = (val: any) => {
|
||||||
@@ -238,7 +264,7 @@ const setTheDate = (val: any) => {
|
|||||||
}
|
}
|
||||||
// 导出
|
// 导出
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
console.log('导出')
|
|
||||||
tableStore.onTableAction('export', { showAllFlag: true })
|
tableStore.onTableAction('export', { showAllFlag: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
187
src/components/tree/allocation.vue
Normal file
187
src/components/tree/allocation.vue
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
||||||
|
<div class="mt15 mr10" style="display: flex; justify-content: end">
|
||||||
|
<el-button type="primary" icon="el-icon-Select" @click="save" :loading="loading">保存</el-button>
|
||||||
|
</div>
|
||||||
|
<Icon
|
||||||
|
v-show="menuCollapse"
|
||||||
|
@click="onMenuCollapse"
|
||||||
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
|
size="18"
|
||||||
|
class="fold ml10 mt20 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
/>
|
||||||
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
|
<el-input maxlength="32" show-word-limit v-model.trim="filterText" placeholder="请输入内容" clearable>
|
||||||
|
<template #prefix>
|
||||||
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
<el-tooltip placement="bottom" :hide-after="0" v-if="props.showPush">
|
||||||
|
<template #content>
|
||||||
|
<span>台账推送</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<Icon
|
||||||
|
name="el-icon-Promotion"
|
||||||
|
size="20"
|
||||||
|
class="fold ml10 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
:style="{ color: config.getColorVal('elementUiPrimary') }"
|
||||||
|
@click="onAdd"
|
||||||
|
/>
|
||||||
|
</el-tooltip>
|
||||||
|
<!-- <Icon @click='onMenuCollapse' :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'" v-else
|
||||||
|
:class="menuCollapse ? 'unfold' : ''" size='18' class='fold ml10 menu-collapse'
|
||||||
|
style='cursor: pointer' v-if='props.canExpand' /> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-tree
|
||||||
|
:style="{ height: 'calc(100vh - 235px)' }"
|
||||||
|
style="overflow: auto"
|
||||||
|
ref="treeRef"
|
||||||
|
:props="defaultProps"
|
||||||
|
highlight-current
|
||||||
|
:default-expand-all="false"
|
||||||
|
@check-change="checkTreeNodeChange"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
node-key="id"
|
||||||
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span class="custom-tree-node">
|
||||||
|
<Icon
|
||||||
|
:name="data.icon"
|
||||||
|
style="font-size: 16px"
|
||||||
|
:style="{ color: data.color }"
|
||||||
|
v-if="data.icon"
|
||||||
|
/>
|
||||||
|
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||||
|
import { ElTree } from 'element-plus'
|
||||||
|
import { emit } from 'process'
|
||||||
|
import { ref, watch } from 'vue'
|
||||||
|
import { t } from 'vxe-table'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'govern/tree'
|
||||||
|
})
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
width?: string
|
||||||
|
canExpand?: boolean
|
||||||
|
showPush?: boolean
|
||||||
|
}
|
||||||
|
const loading = ref(false)
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
width: '280px',
|
||||||
|
canExpand: true,
|
||||||
|
showPush: false
|
||||||
|
})
|
||||||
|
const config = useConfig()
|
||||||
|
const { proxy } = useCurrentInstance()
|
||||||
|
const menuCollapse = ref(false)
|
||||||
|
const filterText = ref('')
|
||||||
|
const defaultProps = {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id'
|
||||||
|
}
|
||||||
|
const emit = defineEmits(['checkTreeNodeChange', 'onAdd', 'checkChange'])
|
||||||
|
watch(filterText, val => {
|
||||||
|
treeRef.value!.filter(val)
|
||||||
|
})
|
||||||
|
const onMenuCollapse = () => {
|
||||||
|
menuCollapse.value = !menuCollapse.value
|
||||||
|
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||||
|
}
|
||||||
|
const save = () => {
|
||||||
|
loading.value = true
|
||||||
|
emit('checkChange')
|
||||||
|
}
|
||||||
|
const filterNode = (value: string, data: any, node: any) => {
|
||||||
|
console.log(value, data, node, 'filterNode')
|
||||||
|
if (!value) return true
|
||||||
|
// return data.name.includes(value)
|
||||||
|
if (data.name) {
|
||||||
|
return chooseNode(value, data, node)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||||
|
const chooseNode = (value: string, data: any, node: any) => {
|
||||||
|
if (data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const level = node.level
|
||||||
|
// 如果传入的节点本身就是一级节点就不用校验了
|
||||||
|
if (level === 1) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 先取当前节点的父节点
|
||||||
|
let parentData = node.parent
|
||||||
|
// 遍历当前节点的父节点
|
||||||
|
let index = 0
|
||||||
|
while (index < level - 1) {
|
||||||
|
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||||
|
if (parentData.data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 否则的话再往上一层做匹配
|
||||||
|
parentData = parentData.parent
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
// 没匹配到返回false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const checkTreeNodeChange = () => {
|
||||||
|
// console.log(treeRef.value?.getCheckedNodes(), "ikkkkkiisiiisis");
|
||||||
|
emit('checkTreeNodeChange', treeRef.value?.getCheckedNodes())
|
||||||
|
}
|
||||||
|
|
||||||
|
const onAdd = () => {
|
||||||
|
emit('onAdd')
|
||||||
|
}
|
||||||
|
|
||||||
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||||
|
defineExpose({ treeRef, loading })
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cn-tree {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
:deep(.el-tree) {
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||||
|
background-color: var(--el-color-primary-light-7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-collapse {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-tree-node {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
205
src/components/tree/details/monitoringPointDetails.vue
Normal file
205
src/components/tree/details/monitoringPointDetails.vue
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog draggable v-model="dialogVisible" :title="title" width="1200px">
|
||||||
|
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||||
|
<el-tab-pane label="监测点详情" name="tab1">
|
||||||
|
<el-descriptions :column="3" border label-width="150px">
|
||||||
|
<el-descriptions-item label="项目工程">
|
||||||
|
{{ details.areaName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="项目单位">
|
||||||
|
{{ details.gdName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="所属变电站">
|
||||||
|
{{ details.bdName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压等级">
|
||||||
|
{{ details.scale }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端厂家">
|
||||||
|
{{ details.manufacturer }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端名称">
|
||||||
|
{{ details.devName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="网络参数">
|
||||||
|
{{ details.ip }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点名称">
|
||||||
|
{{ details.lineName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点序号">
|
||||||
|
{{ details.id }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="通讯状态">
|
||||||
|
{{ details.comFlag }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="干扰源类型">
|
||||||
|
{{ details.loadType }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点对象名称">
|
||||||
|
{{ details.objName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="接线方式">
|
||||||
|
{{ details.ptType }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="PT变比">
|
||||||
|
{{ details.pt }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="CT变比">
|
||||||
|
{{ details.ct }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="基准容量(MVA)">
|
||||||
|
{{ details.standardCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="最小短路容量(MVA)">
|
||||||
|
{{ details.shortCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="供电设备容量(MVA)">
|
||||||
|
{{ details.devCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="用户协议容量(MVA)">
|
||||||
|
{{ details.dealCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="监测点限值" name="tab2">
|
||||||
|
<el-descriptions :column="3" border label-width="250px">
|
||||||
|
<el-descriptions-item label="电压偏差上限值(%)">
|
||||||
|
{{ limitValue.voltageDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压偏差下限值(%)">
|
||||||
|
{{ limitValue.uvoltageDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="频率偏差限值(Hz)">
|
||||||
|
{{ limitValue.freqDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="三相电压不平衡度限值(%)">
|
||||||
|
{{ limitValue.ubalance }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="负序电流限值(A)">
|
||||||
|
{{ limitValue.ineg }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="长时闪变限值(%)">
|
||||||
|
{{ limitValue.flicker }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压总畸变率限值(%)">
|
||||||
|
{{ limitValue.uaberrance }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="奇次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.oddHarm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="偶次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.evenHarm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="3次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm3 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="4次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm4 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="5次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm5 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="6次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm6 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="7次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm7 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="8次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm8 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="9次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm9 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="10次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm10 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="11次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm11 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="12次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm12 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="13次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm13 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="14次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm14 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="15次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm15 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="16次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm16 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="17次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm17 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="18次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm18 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="19次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm19 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="20次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm20 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="21次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm21 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="22次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm22 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="23次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm23 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="24次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm24 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="25次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm25 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="0.5-1.5次间谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.inUharm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="2.5-15.5次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.inUharm16 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { getLineOverLimitData, getLineDetailData } from '@/api/device-boot/line'
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('')
|
||||||
|
const activeName = ref('tab1')
|
||||||
|
const details: any = ref([])
|
||||||
|
const limitValue: any = ref([])
|
||||||
|
const open = (data: any) => {
|
||||||
|
details.value = []
|
||||||
|
limitValue.value = []
|
||||||
|
activeName.value = 'tab1'
|
||||||
|
title.value = data.name.replace(/([^)]*)/g, '') + '_详情'
|
||||||
|
|
||||||
|
getLineDetailData(data.id).then(res => {
|
||||||
|
details.value = res.data
|
||||||
|
|
||||||
|
})
|
||||||
|
getLineOverLimitData(data.id).then(res => {
|
||||||
|
limitValue.value = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
const handleClick = (tab: any, event: Event) => {}
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-upload-list__item) {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
34
src/components/tree/details/substationDetails.vue
Normal file
34
src/components/tree/details/substationDetails.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog draggable v-model="dialogVisible" :title="title" width="500px">
|
||||||
|
<el-descriptions class="margin-top" :column="1" border label-width="150px">
|
||||||
|
<el-descriptions-item label="变电站名称">{{ list[0]?.srbName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压等级">{{ list[0]?.scale }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="经度">{{ list[0]?.coordY }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="纬度">{{ list[0]?.coordX }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { getSubstationSelectLine } from '@/api/device-boot/line'
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('')
|
||||||
|
const list: any = ref([])
|
||||||
|
const open = (data: any) => {
|
||||||
|
list.value = []
|
||||||
|
title.value = data.name.replace(/([^)]*)/g, '') + '_详情'
|
||||||
|
|
||||||
|
getSubstationSelectLine(data.id).then(res => {
|
||||||
|
list.value = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-upload-list__item) {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,162 +1,272 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
||||||
<Icon v-show="menuCollapse" @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
<Icon
|
||||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 mt20 menu-collapse"
|
v-show="menuCollapse"
|
||||||
style="cursor: pointer" />
|
@click="onMenuCollapse"
|
||||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
<div style="display: flex; align-items: center" class="mb10">
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
<el-input v-model="filterText" placeholder="请输入内容" clearable maxlength="10" show-word-limit @input="change">
|
size="18"
|
||||||
<template #prefix>
|
class="fold ml10 mt20 menu-collapse"
|
||||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
style="cursor: pointer"
|
||||||
</template>
|
/>
|
||||||
</el-input>
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
<Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse"
|
<el-input
|
||||||
style="cursor: pointer" v-if="props.canExpand" />
|
v-model="filterText"
|
||||||
<el-button icon="el-icon-Plus" v-if="props.addTree" type="primary" class="ml10"
|
placeholder="请输入内容"
|
||||||
@click="onAddTree">新增</el-button>
|
clearable
|
||||||
</div>
|
maxlength="10"
|
||||||
<el-tree style="flex: 1; overflow: auto" ref="treeRef" :props="defaultProps" highlight-current
|
show-word-limit
|
||||||
:filter-node-method="filterNode" node-key="id" v-bind="$attrs">
|
@input="change"
|
||||||
<template #default="{ node, data }">
|
>
|
||||||
<span class="custom-tree-node">
|
<template #prefix>
|
||||||
<Icon :name="data.icon" style="font-size: 16px" :style="{ color: data.color }"
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
v-if="data.icon" />
|
</template>
|
||||||
<span style="margin-left: 4px">{{ node.label }}</span>
|
</el-input>
|
||||||
</span>
|
<Icon
|
||||||
</template>
|
@click="onMenuCollapse"
|
||||||
</el-tree>
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
</div>
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
</div>
|
size="18"
|
||||||
</template>
|
class="fold ml10 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
<script lang="ts" setup>
|
v-if="props.canExpand"
|
||||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
/>
|
||||||
import { ElTree } from 'element-plus'
|
<el-button icon="el-icon-Plus" v-if="props.addTree" type="primary" class="ml10" @click="onAddTree">
|
||||||
import { ref, watch } from 'vue'
|
新增
|
||||||
import { ElMessage } from 'element-plus'
|
</el-button>
|
||||||
defineOptions({
|
</div>
|
||||||
name: 'govern/tree'
|
<el-tree
|
||||||
})
|
style="flex: 1; overflow: auto"
|
||||||
const emit = defineEmits(['onAddTree'])
|
ref="treeRef"
|
||||||
interface Props {
|
:props="defaultProps"
|
||||||
width?: string
|
highlight-current
|
||||||
canExpand?: boolean
|
:filter-node-method="filterNode"
|
||||||
addTree?: boolean
|
node-key="id"
|
||||||
}
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
<template #default="{ node, data }">
|
||||||
width: '280px',
|
<span class="custom-tree-node">
|
||||||
canExpand: true,
|
<Icon
|
||||||
addTree: false
|
:name="data.icon"
|
||||||
})
|
style="font-size: 16px"
|
||||||
const { proxy } = useCurrentInstance()
|
:style="{ color: data.color }"
|
||||||
const menuCollapse = ref(false)
|
v-if="data.icon"
|
||||||
const filterText = ref('')
|
/>
|
||||||
const defaultProps = {
|
|
||||||
label: 'name',
|
<el-tooltip
|
||||||
value: 'id'
|
class="box-item"
|
||||||
}
|
effect="customized"
|
||||||
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g;
|
placement="bottom-start"
|
||||||
const change=(val) => {
|
:offset="0"
|
||||||
|
v-if="data.level == 6"
|
||||||
|
>
|
||||||
if (specialCharsPattern.test(val)) {
|
<template #content>
|
||||||
ElMessage.warning('禁止输入特殊字符!')
|
<el-button type="primary" plain @click="viewDetails(data)">
|
||||||
filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
{{ data.level == 3 ? '变电站详情' : '监测点详情' }}
|
||||||
console.log("🚀 ~ change ~ filterText.value:", filterText.value)
|
</el-button>
|
||||||
|
</template>
|
||||||
treeRef.value!.filter(filterText.value)
|
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||||
}else{
|
</el-tooltip>
|
||||||
treeRef.value!.filter(filterText.value)
|
<span v-else style="margin-left: 4px">{{ node.label }}</span>
|
||||||
}
|
</span>
|
||||||
}
|
</template>
|
||||||
// watch(filterText, val => {
|
</el-tree>
|
||||||
|
</div>
|
||||||
// console.log("🚀 ~ val:", specialCharsPattern.test(val))
|
<!-- 变电站详情 -->
|
||||||
// if (specialCharsPattern.test(val)) {
|
<SubstationDetails ref="SubstationRef" />
|
||||||
// ElMessage.warning('禁止输入特殊字符!')
|
<!-- 监测点详情 -->
|
||||||
// filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
<MonitoringPointDetails ref="MonitoringPointRef" />
|
||||||
// console.log("🚀 ~ filterText.value:", filterText.value)
|
</div>
|
||||||
// treeRef.value!.filter(filterText.value)
|
</template>
|
||||||
// }else{
|
|
||||||
// treeRef.value!.filter(filterText.value)
|
<script lang="ts" setup>
|
||||||
// }
|
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||||
|
import { ElTree } from 'element-plus'
|
||||||
// })
|
import { ref, watch, onMounted, nextTick } from 'vue'
|
||||||
const onMenuCollapse = () => {
|
import { ElMessage } from 'element-plus'
|
||||||
menuCollapse.value = !menuCollapse.value
|
import MonitoringPointDetails from './details/monitoringPointDetails.vue'
|
||||||
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
import SubstationDetails from './details/substationDetails.vue'
|
||||||
}
|
|
||||||
const filterNode = (value: string, data: any, node: any) => {
|
defineOptions({
|
||||||
if (!value) return true
|
name: 'govern/tree'
|
||||||
// return data.name.includes(value)
|
})
|
||||||
if (data.name) {
|
const emit = defineEmits(['onAddTree'])
|
||||||
|
interface Props {
|
||||||
return chooseNode(value, data, node)
|
width?: string
|
||||||
}
|
canExpand?: boolean
|
||||||
}
|
addTree?: boolean
|
||||||
|
}
|
||||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
|
||||||
const chooseNode = (value: string, data: any, node: any) => {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
width: '280px',
|
||||||
if (data.name.indexOf(value) !== -1) {
|
canExpand: true,
|
||||||
return true
|
addTree: false
|
||||||
}
|
})
|
||||||
const level = node.level
|
const { proxy } = useCurrentInstance()
|
||||||
// 如果传入的节点本身就是一级节点就不用校验了
|
const menuCollapse = ref(false)
|
||||||
if (level === 1) {
|
const MonitoringPointRef = ref()
|
||||||
return false
|
const SubstationRef = ref()
|
||||||
}
|
const filterText = ref('')
|
||||||
// 先取当前节点的父节点
|
const treeRef = ref()
|
||||||
let parentData = node.parent
|
const defaultProps = {
|
||||||
// 遍历当前节点的父节点
|
label: 'name',
|
||||||
let index = 0
|
value: 'id'
|
||||||
while (index < level - 1) {
|
}
|
||||||
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g
|
||||||
if (parentData.data.name.indexOf(value) !== -1) {
|
const change = val => {
|
||||||
return true
|
if (specialCharsPattern.test(val)) {
|
||||||
}
|
ElMessage.warning('禁止输入特殊字符!')
|
||||||
// 否则的话再往上一层做匹配
|
filterText.value = val.replace(
|
||||||
parentData = parentData.parent
|
/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g,
|
||||||
index++
|
''
|
||||||
}
|
)
|
||||||
// 没匹配到返回false
|
console.log('🚀 ~ change ~ filterText.value:', filterText.value)
|
||||||
return false
|
|
||||||
}
|
treeRef.value!.filter(filterText.value)
|
||||||
// 添加树
|
} else {
|
||||||
const onAddTree = () => {
|
treeRef.value!.filter(filterText.value)
|
||||||
emit('onAddTree')
|
}
|
||||||
}
|
}
|
||||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
// watch(filterText, val => {
|
||||||
defineExpose({ treeRef })
|
|
||||||
</script>
|
// console.log("🚀 ~ val:", specialCharsPattern.test(val))
|
||||||
|
// if (specialCharsPattern.test(val)) {
|
||||||
<style lang="scss" scoped>
|
// ElMessage.warning('禁止输入特殊字符!')
|
||||||
.cn-tree {
|
// filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
||||||
flex-shrink: 0;
|
// console.log("🚀 ~ filterText.value:", filterText.value)
|
||||||
display: flex;
|
// treeRef.value!.filter(filterText.value)
|
||||||
flex-direction: column;
|
// }else{
|
||||||
box-sizing: border-box;
|
// treeRef.value!.filter(filterText.value)
|
||||||
padding: 10px;
|
// }
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
// })
|
||||||
|
const onMenuCollapse = () => {
|
||||||
:deep(.el-tree) {
|
menuCollapse.value = !menuCollapse.value
|
||||||
border: 1px solid var(--el-border-color);
|
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||||
}
|
}
|
||||||
|
// 查看详情
|
||||||
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
const viewDetails = (data: any) => {
|
||||||
background-color: var(--el-color-primary-light-7);
|
// console.log('🚀 ~ viewDetails ~ data:', data)
|
||||||
}
|
if (data.level == 3) {
|
||||||
|
// 变电站详情
|
||||||
.menu-collapse {
|
// substationDetails
|
||||||
color: var(--el-color-primary);
|
SubstationRef.value.open(data)
|
||||||
}
|
} else {
|
||||||
}
|
// 监测点详情
|
||||||
|
MonitoringPointRef.value.open(data)
|
||||||
.custom-tree-node {
|
}
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
// proxy.eventBus.emit('viewDetails', data)
|
||||||
}
|
}
|
||||||
</style>
|
const filterNode = (value: string, data: any, node: any) => {
|
||||||
|
if (!value) return true
|
||||||
|
// return data.name.includes(value)
|
||||||
|
if (data.name) {
|
||||||
|
return chooseNode(value, data, node)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||||
|
const chooseNode = (value: string, data: any, node: any) => {
|
||||||
|
if (data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const level = node.level
|
||||||
|
// 如果传入的节点本身就是一级节点就不用校验了
|
||||||
|
if (level === 1) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 先取当前节点的父节点
|
||||||
|
let parentData = node.parent
|
||||||
|
// 遍历当前节点的父节点
|
||||||
|
let index = 0
|
||||||
|
while (index < level - 1) {
|
||||||
|
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||||
|
if (parentData.data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 否则的话再往上一层做匹配
|
||||||
|
parentData = parentData.parent
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
// 没匹配到返回false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
// 等待树渲染完成
|
||||||
|
await nextTick()
|
||||||
|
// 可以等待更长时间确保树完全展开
|
||||||
|
})
|
||||||
|
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// console.log("🚀 ~ scrollToNode ~ id:", id)
|
||||||
|
if (!treeRef.value) return
|
||||||
|
|
||||||
|
// 获取目标节点的元素
|
||||||
|
const targetNode = treeRef.value.getNode(id)
|
||||||
|
if (!targetNode) return
|
||||||
|
|
||||||
|
// 获取节点的DOM元素
|
||||||
|
const nodeElement = document.querySelector(`[data-key="${id}"]`)
|
||||||
|
if (nodeElement) {
|
||||||
|
// 滚动到节点位置
|
||||||
|
nodeElement.scrollIntoView({
|
||||||
|
behavior: 'smooth', // 平滑滚动
|
||||||
|
block: 'center', // 垂直方向居中
|
||||||
|
inline: 'nearest' // 水平方向最近
|
||||||
|
})
|
||||||
|
|
||||||
|
// 如果需要高亮当前节点
|
||||||
|
treeRef.value.setCurrentKey(id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 添加树
|
||||||
|
const onAddTree = () => {
|
||||||
|
emit('onAddTree')
|
||||||
|
}
|
||||||
|
defineExpose({ treeRef, scrollToNode })
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cn-tree {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
:deep(.el-tree) {
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||||
|
background-color: var(--el-color-primary-light-7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-collapse {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-tree-node {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.el-popper.is-customized {
|
||||||
|
/* Set padding to ensure the height is 32px */
|
||||||
|
padding: 0;
|
||||||
|
background: var(--el-color-primary-light-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-popper.is-customized .el-popper__arrow::before {
|
||||||
|
background: var(--el-color-primary-light-3);
|
||||||
|
right: 0;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,88 +1,105 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="point-tree">
|
<div class="point-tree">
|
||||||
<div style="flex: 1; overflow: hidden">
|
<div style="flex: 1; overflow: hidden">
|
||||||
<Tree
|
<Tree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
:data="tree"
|
:data="tree"
|
||||||
:canExpand="false"
|
:canExpand="false"
|
||||||
style="width: 100%; height: 100%"
|
style="width: 100%; height: 100%"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
default-expand-all
|
default-expand-all
|
||||||
|
@onAddTree="onAddTree"
|
||||||
@onAddTree="onAddTree"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
|
||||||
|
<script lang="ts" setup>
|
||||||
<script lang="ts" setup>
|
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||||
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
import Tree from '../index.vue'
|
||||||
import Tree from '../index.vue'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useConfig } from '@/stores/config'
|
||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
import { useConfig } from '@/stores/config'
|
defineOptions({
|
||||||
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
name: 'pms/pointTree'
|
||||||
defineOptions({
|
})
|
||||||
name: 'pms/pointTree'
|
const emit = defineEmits(['init', 'onAddTree'])
|
||||||
})
|
const attrs = useAttrs()
|
||||||
const emit = defineEmits(['init', 'onAddTree'])
|
const adminInfo = useAdminInfo()
|
||||||
const attrs = useAttrs()
|
const dictData = useDictData()
|
||||||
const adminInfo = useAdminInfo()
|
const config = useConfig()
|
||||||
const dictData = useDictData()
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
const config = useConfig()
|
const tree = ref()
|
||||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
const treeRef = ref()
|
||||||
const tree = ref()
|
|
||||||
const treeRef = ref()
|
const loadData = (id?: any) => {
|
||||||
|
// console.log('🚀 ~ loadData ~ id:', id)
|
||||||
const loadData = (id?: any) => {
|
let nodeKey = ''
|
||||||
console.log('🚀 ~ loadData ~ id:', id)
|
queryAllAlgorithmLibrary().then(res => {
|
||||||
let nodeKey = ''
|
res.data.forEach((item: any) => {
|
||||||
queryAllAlgorithmLibrary().then(res => {
|
item.icon = 'el-icon-FolderOpened'
|
||||||
res.data.forEach((item: any) => {
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
item.icon = 'el-icon-FolderOpened'
|
item.children.forEach((item2: any) => {
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
item2.icon = 'el-icon-Document'
|
||||||
item.children.forEach((item2: any) => {
|
item2.color = config.getColorVal('elementUiPrimary')
|
||||||
item2.icon = 'el-icon-Document'
|
item2.childrens = item2.children
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
item2.children = []
|
||||||
item2.childrens = item2.children
|
if (item2.id == id) {
|
||||||
item2.children = []
|
emit('init', item2)
|
||||||
if (item2.id == id) {
|
}
|
||||||
emit('init', item2)
|
})
|
||||||
}
|
})
|
||||||
})
|
|
||||||
})
|
nodeKey = res.data[0].children[0].id
|
||||||
|
|
||||||
nodeKey = res.data[0].children[0].id
|
tree.value = res.data
|
||||||
|
if (id) {
|
||||||
tree.value = res.data
|
setTimeout(() => {
|
||||||
if (id) {
|
treeRef.value.treeRef.setCurrentKey(id)
|
||||||
setTimeout(() => {
|
}, 10)
|
||||||
treeRef.value.treeRef.setCurrentKey(id)
|
} else {
|
||||||
}, 10)
|
setTimeout(() => {
|
||||||
} else {
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
setTimeout(() => {
|
emit('init', res.data[0].children[0])
|
||||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
}, 10)
|
||||||
emit('init', res.data[0].children[0])
|
}
|
||||||
}, 10)
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
const onAddTree = () => {
|
||||||
|
emit('onAddTree')
|
||||||
const onAddTree = () => {
|
}
|
||||||
emit('onAddTree')
|
const setKey = (id: string) => {
|
||||||
}
|
treeRef.value.treeRef.setCurrentKey(id)
|
||||||
loadData()
|
return findNodeById(tree.value, id)
|
||||||
defineExpose({ loadData })
|
}
|
||||||
</script>
|
const findNodeById = (tree1: any, targetId: any) => {
|
||||||
<style lang="scss">
|
for (const node of tree1) {
|
||||||
.point-tree {
|
// 1. 当前节点匹配ID,直接返回该节点
|
||||||
height: 100%;
|
if (node.id === targetId) {
|
||||||
width: 100%;
|
return node
|
||||||
display: flex;
|
}
|
||||||
flex-direction: column;
|
// 2. 当前节点有子节点,递归查找子节点
|
||||||
background: #fff;
|
if (node.children && node.children.length > 0) {
|
||||||
border: 1px solid var(--el-border-color);
|
const result: any = findNodeById(node.children, targetId)
|
||||||
}
|
// 子节点中找到结果,立即返回(终止递归)
|
||||||
</style>
|
if (result) return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 3. 遍历完未找到,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
loadData()
|
||||||
|
defineExpose({ loadData, setKey })
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.point-tree {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
150
src/components/tree/pqs/areaTree.vue
Normal file
150
src/components/tree/pqs/areaTree.vue
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<div class="point-tree">
|
||||||
|
<div style="flex: 1; overflow: hidden">
|
||||||
|
<Tree ref="treeRef" :data="tree" style="width: 100%; height: 100%" :canExpand="false" v-bind="$attrs" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||||
|
import Tree from '../index.vue'
|
||||||
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
import { getAreaList } from '@/api/common'
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
|
defineOptions({
|
||||||
|
name: 'pms/pointTree'
|
||||||
|
})
|
||||||
|
interface Props {
|
||||||
|
showSelect?: boolean
|
||||||
|
}
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
showSelect: true
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['init'])
|
||||||
|
const attrs = useAttrs()
|
||||||
|
const adminInfo = useAdminInfo()
|
||||||
|
const dictData = useDictData()
|
||||||
|
const config = useConfig()
|
||||||
|
const tree = ref()
|
||||||
|
const treeRef = ref()
|
||||||
|
|
||||||
|
const loadData = () => {
|
||||||
|
let nodeKey = ''
|
||||||
|
getAreaList().then(res => {
|
||||||
|
processTreeData(res.data, res.data[0].level)
|
||||||
|
let firstLevel6Node = getDeepestFirstChildData(res.data)
|
||||||
|
|
||||||
|
nodeKey = firstLevel6Node.id
|
||||||
|
emit('init', firstLevel6Node)
|
||||||
|
|
||||||
|
tree.value = res.data
|
||||||
|
if (nodeKey) {
|
||||||
|
nextTick(() => {
|
||||||
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
|
|
||||||
|
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// 树滚动
|
||||||
|
treeRef.value.scrollToNode(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
item.alias = alias + `${item.name}`
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归获取树形结构中一直向下的第一个children的最后一组有效数据
|
||||||
|
* @param {Array} treeData - 原始递归树形数据
|
||||||
|
* @returns {Object|null} 路径最后一组有效数据,无有效数据时返回null
|
||||||
|
*/
|
||||||
|
function getDeepestFirstChildData(treeData) {
|
||||||
|
// 递归辅助函数:逐层查找第一个children
|
||||||
|
function findDeepestNode(currentNode) {
|
||||||
|
// 检查当前节点是否有有效的children数组
|
||||||
|
if (currentNode && Array.isArray(currentNode.children) && currentNode.children.length > 0) {
|
||||||
|
// 有下一级children,继续递归查找下一级第一个元素
|
||||||
|
return findDeepestNode(currentNode.children[0])
|
||||||
|
}
|
||||||
|
// 没有下一级children,返回当前节点(递归终止)
|
||||||
|
return currentNode
|
||||||
|
}
|
||||||
|
|
||||||
|
// 边界处理:原始数据非数组/空数组时返回null
|
||||||
|
if (!Array.isArray(treeData) || treeData.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从根节点第一个元素开始递归查找
|
||||||
|
return findDeepestNode(treeData[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ treeRef, scrollToNode, tree })
|
||||||
|
loadData()
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.point-tree {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,12 +11,9 @@ import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
|||||||
import Tree from '../index.vue'
|
import Tree from '../index.vue'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
import {
|
import { getTree } from '@/api/advance-boot/assess'
|
||||||
getTree
|
|
||||||
} from '@/api/advance-boot/assess'
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'pms/pointTree'
|
name: 'pms/pointTree'
|
||||||
@@ -46,25 +43,24 @@ const formData = ref({
|
|||||||
scale: null
|
scale: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 添加数据转换函数
|
// 添加数据转换函数
|
||||||
const transformTreeData = (data: any[]) => {
|
const transformTreeData = (data: any[]) => {
|
||||||
if (!data || !Array.isArray(data)) return [];
|
if (!data || !Array.isArray(data)) return []
|
||||||
return data.map(item => {
|
return data.map(item => {
|
||||||
// 创建新对象,确保不修改原始数据
|
// 创建新对象,确保不修改原始数据
|
||||||
const newItem: any = {
|
const newItem: any = {
|
||||||
name: item.treeName ,
|
name: item.treeName,
|
||||||
id: item.treeId ,
|
id: item.treeId,
|
||||||
children: []
|
children: []
|
||||||
};
|
}
|
||||||
|
|
||||||
// 递归处理子节点
|
// 递归处理子节点
|
||||||
if (item.children && Array.isArray(item.children)) {
|
if (item.children && Array.isArray(item.children)) {
|
||||||
newItem.children = transformTreeData(item.children);
|
newItem.children = transformTreeData(item.children)
|
||||||
}
|
}
|
||||||
return newItem;
|
return newItem
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const loadData = () => {
|
const loadData = () => {
|
||||||
let obj = classificationData.find(function (i) {
|
let obj = classificationData.find(function (i) {
|
||||||
@@ -73,19 +69,22 @@ const loadData = () => {
|
|||||||
let form = JSON.parse(JSON.stringify(formData.value))
|
let form = JSON.parse(JSON.stringify(formData.value))
|
||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTree({}).then(res => {
|
getTree({}).then(res => {
|
||||||
// 转换数据结构为指定格式
|
// 转换数据结构为指定格式
|
||||||
const transformedData = transformTreeData(res.data);
|
const transformedData = transformTreeData(res.data)
|
||||||
|
|
||||||
// 确保有数据再进行处理
|
// 确保有数据再进行处理
|
||||||
if (transformedData && transformedData.length > 0 &&
|
if (
|
||||||
transformedData[0].children && transformedData[0].children.length > 0) {
|
transformedData &&
|
||||||
|
transformedData.length > 0 &&
|
||||||
|
transformedData[0].children &&
|
||||||
|
transformedData[0].children.length > 0
|
||||||
|
) {
|
||||||
nodeKey = transformedData[0].children[0].id
|
nodeKey = transformedData[0].children[0].id
|
||||||
emit('init', transformedData[0].children[0])
|
emit('init', transformedData[0].children[0])
|
||||||
|
|
||||||
tree.value = transformedData
|
tree.value = transformedData
|
||||||
|
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
@@ -94,7 +93,15 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// 树滚动
|
||||||
|
treeRef.value.scrollToNode(id)
|
||||||
|
}
|
||||||
loadData()
|
loadData()
|
||||||
|
defineExpose({
|
||||||
|
tree,
|
||||||
|
scrollToNode
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.point-tree {
|
.point-tree {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const adminInfo = useAdminInfo()
|
|||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
const tree = ref()
|
const tree = ref()
|
||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@@ -54,6 +55,9 @@ const loadData = () => {
|
|||||||
}) || { code: '' }
|
}) || { code: '' }
|
||||||
let form = JSON.parse(JSON.stringify(formData.value))
|
let form = JSON.parse(JSON.stringify(formData.value))
|
||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
|
if (VITE_FLAG && form.statisticalType.code == 'Power_Network') {
|
||||||
|
form.statisticalType.deptName = 'qujing'
|
||||||
|
}
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTerminalTreeForFive(form).then(res => {
|
getTerminalTreeForFive(form).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@@ -67,56 +71,62 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
res.data.forEach((item: any) => {
|
// if (VITE_FLAG) {
|
||||||
item.icon = 'el-icon-HomeFilled'
|
processTreeData(res.data)
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||||
item.children.forEach((item2: any) => {
|
|
||||||
item2.icon = 'el-icon-CollectionTag'
|
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item2.children.forEach((item3: any) => {
|
|
||||||
item3.icon = 'el-icon-Flag'
|
|
||||||
item3.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item3.children.forEach((item4: any) => {
|
|
||||||
item4.icon = 'el-icon-OfficeBuilding'
|
|
||||||
item4.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item4.children.forEach((item5: anyObj) => {
|
|
||||||
if (item5.level == 7) {
|
|
||||||
item5.icon = 'el-icon-DataAnalysis'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item5.children.forEach((item6: anyObj) => {
|
|
||||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
|
||||||
item6.pid = item4.id
|
|
||||||
item6.icon = 'fa-solid fa-location-dot'
|
|
||||||
item6.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item6.comFlag == 0) {
|
|
||||||
item6.color = 'red !important'
|
|
||||||
} else if (item6.comFlag == 1) {
|
|
||||||
item6.color = '#00f93b !important'
|
|
||||||
} else if (item6.comFlag == 2) {
|
|
||||||
item6.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
|
||||||
item5.pid = item4.id
|
|
||||||
item5.icon = 'fa-solid fa-location-dot'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item5.comFlag == 0) {
|
|
||||||
item5.color = 'red !important'
|
|
||||||
} else if (item5.comFlag == 1) {
|
|
||||||
item5.color = '#00f93b !important'
|
|
||||||
} else if (item5.comFlag == 2) {
|
|
||||||
item5.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
nodeKey = firstLevel6Node.id
|
||||||
emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
emit('init', firstLevel6Node)
|
||||||
|
// res.data.forEach((item: any) => {
|
||||||
|
// item.icon = 'el-icon-HomeFilled'
|
||||||
|
// item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item.children.forEach((item2: any) => {
|
||||||
|
// item2.icon = 'el-icon-CollectionTag'
|
||||||
|
// item2.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item2.children.forEach((item3: any) => {
|
||||||
|
// item3.icon = 'el-icon-Flag'
|
||||||
|
// item3.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item3.children.forEach((item4: any) => {
|
||||||
|
// item4.icon = 'el-icon-OfficeBuilding'
|
||||||
|
// item4.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item4.children.forEach((item5: anyObj) => {
|
||||||
|
// if (item5.level == 7) {
|
||||||
|
// item5.icon = 'el-icon-DataAnalysis'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item5.children.forEach((item6: anyObj) => {
|
||||||
|
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||||
|
// item6.pid = item4.id
|
||||||
|
// item6.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item6.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item6.comFlag == 0) {
|
||||||
|
// item6.color = 'red !important'
|
||||||
|
// } else if (item6.comFlag == 1) {
|
||||||
|
// item6.color = '#00f93b !important'
|
||||||
|
// } else if (item6.comFlag == 2) {
|
||||||
|
// item6.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||||
|
// item5.pid = item4.id
|
||||||
|
// item5.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item5.comFlag == 0) {
|
||||||
|
// item5.color = 'red !important'
|
||||||
|
// } else if (item5.comFlag == 1) {
|
||||||
|
// item5.color = '#00f93b !important'
|
||||||
|
// } else if (item5.comFlag == 2) {
|
||||||
|
// item5.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
||||||
|
// emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
@@ -127,9 +137,113 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const setKey = (key: string) => {
|
const setKey = (key: string) => {
|
||||||
treeRef.value.treeRef.setCurrentKey(key)
|
treeRef.value.treeRef.setCurrentKey(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1) {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||||
|
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||||
|
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||||
|
*/
|
||||||
|
function findFirstLevel6Node(tree: any) {
|
||||||
|
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||||
|
if (Array.isArray(tree)) {
|
||||||
|
for (const rootNode of tree) {
|
||||||
|
const result = traverse(rootNode)
|
||||||
|
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||||
|
if (result) return result
|
||||||
|
}
|
||||||
|
// 所有根节点遍历完未找到
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
// 入参是单个节点,直接递归遍历
|
||||||
|
return traverse(tree)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核心递归遍历函数
|
||||||
|
function traverse(node) {
|
||||||
|
// 终止条件1:节点不存在,返回null
|
||||||
|
if (!node) return null
|
||||||
|
|
||||||
|
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||||
|
if (node.level === 6) {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// 终止条件3:节点无children,返回null
|
||||||
|
if (!node.children || node.children.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按顺序遍历当前节点的子节点
|
||||||
|
for (const child of node.children) {
|
||||||
|
const foundNode = traverse(child)
|
||||||
|
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||||
|
if (foundNode) {
|
||||||
|
return foundNode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前节点及所有子节点都无匹配,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ setKey })
|
defineExpose({ setKey })
|
||||||
loadData()
|
loadData()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import { useDictData } from '@/stores/dictData'
|
|||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'pms/pointTree'
|
name: 'pms/pointTree'
|
||||||
})
|
})
|
||||||
@@ -61,6 +62,9 @@ const loadData = () => {
|
|||||||
}) || { code: '' }
|
}) || { code: '' }
|
||||||
let form = JSON.parse(JSON.stringify(formData.value))
|
let form = JSON.parse(JSON.stringify(formData.value))
|
||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
|
if (VITE_FLAG && form.statisticalType.code == 'Power_Network') {
|
||||||
|
form.statisticalType.deptName = 'qujing'
|
||||||
|
}
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTerminalTreeForFive(form).then(res => {
|
getTerminalTreeForFive(form).then(res => {
|
||||||
//console.log('---',res)
|
//console.log('---',res)
|
||||||
@@ -74,72 +78,190 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
res.data.forEach((item: any) => {
|
// if (VITE_FLAG) {
|
||||||
item.icon = 'el-icon-HomeFilled'
|
processTreeData(res.data)
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||||
item.children.forEach((item2: any) => {
|
|
||||||
item2.icon = 'el-icon-CollectionTag'
|
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item2.children.forEach((item3: any) => {
|
|
||||||
item3.icon = 'el-icon-Flag'
|
|
||||||
item3.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item3.children.forEach((item4: any) => {
|
|
||||||
item4.icon = 'el-icon-OfficeBuilding'
|
|
||||||
item4.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item4.children.forEach((item5: anyObj) => {
|
|
||||||
if (item5.level == 7) {
|
|
||||||
item5.icon = 'el-icon-DataAnalysis'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item5.children.forEach((item6: anyObj) => {
|
|
||||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
|
||||||
item6.pid = item4.id
|
|
||||||
item6.icon = 'fa-solid fa-location-dot'
|
|
||||||
item6.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item6.comFlag == 0) {
|
|
||||||
item6.color = 'red !important'
|
|
||||||
} else if (item6.comFlag == 1) {
|
|
||||||
item6.color = '#00f93b !important'
|
|
||||||
} else if (item6.comFlag == 2) {
|
|
||||||
item6.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
|
||||||
item5.pid = item4.id
|
|
||||||
item5.icon = 'fa-solid fa-location-dot'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item5.comFlag == 0) {
|
|
||||||
item5.color = 'red !important'
|
|
||||||
} else if (item5.comFlag == 1) {
|
|
||||||
item5.color = '#00f93b !important'
|
|
||||||
} else if (item5.comFlag == 2) {
|
|
||||||
item5.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
nodeKey =
|
nodeKey = firstLevel6Node.id
|
||||||
res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
emit('init', firstLevel6Node)
|
||||||
res.data[0].children[0].children[0].children[0].children[0]?.id
|
// } else {
|
||||||
emit(
|
// // 正常树处理
|
||||||
'init',
|
// res.data.forEach((item: any) => {
|
||||||
res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
// item.icon = 'el-icon-HomeFilled'
|
||||||
res.data[0].children[0].children[0].children[0].children[0]
|
// item.color = config.getColorVal('elementUiPrimary')
|
||||||
)
|
// item.children.forEach((item2: any) => {
|
||||||
|
// item2.icon = 'el-icon-CollectionTag'
|
||||||
|
// item2.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item2.children.forEach((item3: any) => {
|
||||||
|
// item3.icon = 'el-icon-Flag'
|
||||||
|
// item3.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item3.children.forEach((item4: any) => {
|
||||||
|
// item4.icon = 'el-icon-OfficeBuilding'
|
||||||
|
// item4.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item4.children.forEach((item5: anyObj) => {
|
||||||
|
// if (item5.level == 7) {
|
||||||
|
// item5.icon = 'el-icon-DataAnalysis'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item5.children.forEach((item6: anyObj) => {
|
||||||
|
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||||
|
// item6.pid = item4.id
|
||||||
|
// item6.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item6.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item6.comFlag == 0) {
|
||||||
|
// item6.color = 'red !important'
|
||||||
|
// } else if (item6.comFlag == 1) {
|
||||||
|
// item6.color = '#00f93b !important'
|
||||||
|
// } else if (item6.comFlag == 2) {
|
||||||
|
// item6.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||||
|
// item5.pid = item4.id
|
||||||
|
// item5.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item5.comFlag == 0) {
|
||||||
|
// item5.color = 'red !important'
|
||||||
|
// } else if (item5.comFlag == 1) {
|
||||||
|
// item5.color = '#00f93b !important'
|
||||||
|
// } else if (item5.comFlag == 2) {
|
||||||
|
// item5.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// nodeKey =
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]?.id
|
||||||
|
// emit(
|
||||||
|
// 'init',
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
|
|
||||||
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// 树滚动
|
||||||
|
treeRef.value.scrollToNode(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
item.alias = alias + `${item.name}`
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||||
|
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||||
|
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||||
|
*/
|
||||||
|
function findFirstLevel6Node(tree: any) {
|
||||||
|
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||||
|
if (Array.isArray(tree)) {
|
||||||
|
for (const rootNode of tree) {
|
||||||
|
const result = traverse(rootNode)
|
||||||
|
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||||
|
if (result) return result
|
||||||
|
}
|
||||||
|
// 所有根节点遍历完未找到
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
// 入参是单个节点,直接递归遍历
|
||||||
|
return traverse(tree)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核心递归遍历函数
|
||||||
|
function traverse(node) {
|
||||||
|
// 终止条件1:节点不存在,返回null
|
||||||
|
if (!node) return null
|
||||||
|
|
||||||
|
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||||
|
if (node.level === 6) {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// 终止条件3:节点无children,返回null
|
||||||
|
if (!node.children || node.children.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按顺序遍历当前节点的子节点
|
||||||
|
for (const child of node.children) {
|
||||||
|
const foundNode = traverse(child)
|
||||||
|
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||||
|
if (foundNode) {
|
||||||
|
return foundNode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前节点及所有子节点都无匹配,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ treeRef, scrollToNode, tree })
|
||||||
loadData()
|
loadData()
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const tree = ref()
|
|||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
|
|
||||||
const loadData = (id?: any) => {
|
const loadData = (id?: any) => {
|
||||||
console.log('🚀 ~ loadData ~ id:', id)
|
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
queryAll().then(res => {
|
queryAll().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const init = async () => {
|
|||||||
// 设置消息接收回调
|
// 设置消息接收回调
|
||||||
mqttClient.onMessage((topic, message) => {
|
mqttClient.onMessage((topic, message) => {
|
||||||
const msg = JSON.parse(message.toString())
|
const msg = JSON.parse(message.toString())
|
||||||
console.log('🚀 ~ init ~ msg:', msg)
|
// console.log('🚀 ~ init ~ msg:', msg)
|
||||||
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||||
drawer.value = true
|
drawer.value = true
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-logo">
|
<div class="layout-logo">
|
||||||
<img v-if="!config.layout.menuCollapse" class="logo-img" :src="getTheme.logoUrl" />
|
<img v-if="!config.layout.menuCollapse && getTheme && getTheme.logoUrl" class="logo-img" :src="getTheme.logoUrl" />
|
||||||
<!-- <div-->
|
<!-- <div-->
|
||||||
<!-- v-if="!config.layout.menuCollapse"-->
|
<!-- v-if="!config.layout.menuCollapse"-->
|
||||||
<!-- :style="{ color: config.getColorVal('menuActiveColor') }"-->
|
<!-- :style="{ color: config.getColorVal('menuActiveColor') }"-->
|
||||||
@@ -28,7 +28,9 @@ import { Session } from '@/utils/storage'
|
|||||||
import { setNavTabsWidth } from '@/utils/layout'
|
import { setNavTabsWidth } from '@/utils/layout'
|
||||||
|
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
|
const getTheme = window.localStorage.getItem('getTheme')
|
||||||
|
? JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||||
|
: null
|
||||||
const onMenuCollapse = function () {
|
const onMenuCollapse = function () {
|
||||||
if (config.layout.shrink && !config.layout.menuCollapse) {
|
if (config.layout.shrink && !config.layout.menuCollapse) {
|
||||||
closeShade()
|
closeShade()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span class="nav-bar-title">
|
<span class="nav-bar-title">
|
||||||
{{ getTheme.name }}
|
{{ getTheme?.name || '' }}
|
||||||
<span style="font-size: 14px">({{ Version || 'v1.0.0' }})</span>
|
<span style="font-size: 14px">({{ Version || 'v1.0.0' }})</span>
|
||||||
<!-- <span style="font-size: 14px;" v-if="Version?.versionName">
|
<!-- <span style="font-size: 14px;" v-if="Version?.versionName">
|
||||||
({{ Version?.versionName }})
|
({{ Version?.versionName }})
|
||||||
@@ -28,8 +28,10 @@ import { getLastData } from '@/api/systerm'
|
|||||||
|
|
||||||
const Version: any = ref(null)
|
const Version: any = ref(null)
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
|
const getTheme = window.localStorage.getItem('getTheme')
|
||||||
|
? JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||||
|
: { name: '' }
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'hainan'
|
||||||
const onMenuCollapse = () => {
|
const onMenuCollapse = () => {
|
||||||
showShade('ba-aside-menu-shade', () => {
|
showShade('ba-aside-menu-shade', () => {
|
||||||
config.setLayout('menuCollapse', true)
|
config.setLayout('menuCollapse', true)
|
||||||
@@ -37,10 +39,13 @@ const onMenuCollapse = () => {
|
|||||||
config.setLayout('menuCollapse', false)
|
config.setLayout('menuCollapse', false)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getLastData({ versionType: 'WEB' }).then(res => {
|
if(!VITE_FLAG){
|
||||||
Version.value = res.data.versionName
|
getLastData({ versionType: 'WEB' }).then(res => {
|
||||||
})
|
Version.value = res.data.versionName
|
||||||
document.title = getTheme.name
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
document.title = getTheme?.name || ''
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const emit = defineEmits(['update:modelValue'])
|
|||||||
const dialogVisible = computed({
|
const dialogVisible = computed({
|
||||||
get: () => props.modelValue,
|
get: () => props.modelValue,
|
||||||
set: (val) => {
|
set: (val) => {
|
||||||
console.log('set: ', val)
|
|
||||||
emit('update:modelValue', val)
|
emit('update:modelValue', val)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
33
src/main.ts
33
src/main.ts
@@ -16,12 +16,14 @@ import '@/assets/font/iconfont.css'
|
|||||||
import { ElDialog } from 'element-plus'
|
import { ElDialog } from 'element-plus'
|
||||||
import BaiduMap from 'vue-baidu-map-3x'
|
import BaiduMap from 'vue-baidu-map-3x'
|
||||||
import BaiduMapOffline from 'vue-baidu-map-offline'
|
import BaiduMapOffline from 'vue-baidu-map-offline'
|
||||||
|
|
||||||
import ExcelJS from 'exceljs'
|
import ExcelJS from 'exceljs'
|
||||||
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
|
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
|
||||||
// 方式1:NPM 安装,注入 ExcelJS 对象
|
// 方式1:NPM 安装,注入 ExcelJS 对象
|
||||||
VXETable.use(VXETablePluginExportXLSX, {
|
VXETable.use(VXETablePluginExportXLSX, {
|
||||||
ExcelJS
|
ExcelJS
|
||||||
})
|
})
|
||||||
|
// 全局注册 tooltip 组件
|
||||||
window.XEUtils = XEUtils
|
window.XEUtils = XEUtils
|
||||||
|
|
||||||
// 初始化多语言
|
// 初始化多语言
|
||||||
@@ -35,21 +37,21 @@ const setupAll = async () => {
|
|||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
//开启离线地图
|
//开启离线地图
|
||||||
// app.use(BaiduMapOffline, {
|
app.use(BaiduMapOffline, {
|
||||||
// offline: true,
|
offline: true,
|
||||||
// offlineConfig: {
|
offlineConfig: {
|
||||||
// imgext: '.png',
|
imgext: '.png',
|
||||||
// customstyle: '',
|
customstyle: '',
|
||||||
// tiles_dir: '',
|
tiles_dir: '',
|
||||||
// tiles_hybrid: '',
|
tiles_hybrid: '',
|
||||||
// tiles_self: '',
|
tiles_self: '',
|
||||||
// tiles_v_dir: '',
|
tiles_v_dir: '',
|
||||||
// tiles_satellite_dir: '',
|
tiles_satellite_dir: '',
|
||||||
// tiles_road_dir: '',
|
tiles_road_dir: '',
|
||||||
// tiles_v_road_dir: '',
|
tiles_v_road_dir: '',
|
||||||
// home: './plugin/offline/'
|
home: './plugin/offline/'
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
app.use(BaiduMap, {
|
app.use(BaiduMap, {
|
||||||
// ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
// ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
||||||
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN',
|
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN',
|
||||||
@@ -61,6 +63,7 @@ const setupAll = async () => {
|
|||||||
app.use(pinia)
|
app.use(pinia)
|
||||||
app.use(ElementPlus)
|
app.use(ElementPlus)
|
||||||
app.use(VXETable)
|
app.use(VXETable)
|
||||||
|
|
||||||
;(app._context.components.ElDialog as typeof ElDialog).props.closeOnClickModal.default = false
|
;(app._context.components.ElDialog as typeof ElDialog).props.closeOnClickModal.default = false
|
||||||
registerIcons(app) // icons
|
registerIcons(app) // icons
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDictByType(type: string) {
|
getDictByType(type: string) {
|
||||||
|
console.log("🚀 ~ type:", type)
|
||||||
if (!this.isSetDict) {
|
if (!this.isSetDict) {
|
||||||
this.setDictMap()
|
this.setDictMap()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,16 +25,18 @@ export const useMonitoringPoint = defineStore(
|
|||||||
val: any
|
val: any
|
||||||
) => {
|
) => {
|
||||||
state[key] = val
|
state[key] = val
|
||||||
|
|
||||||
}
|
}
|
||||||
const setShowCheckBox = (val: boolean) => {
|
const setShowCheckBox = (val: boolean) => {
|
||||||
if (val && state.lineIds.length === 0) {
|
if (val && state.lineIds.length === 0) {
|
||||||
state.lineIds = [state.lineId]
|
state.lineIds = [state.lineId]
|
||||||
console.log('====================================')
|
// console.log('====================================')
|
||||||
console.log(state.lineIds)
|
// console.log(state.lineIds)
|
||||||
console.log('====================================')
|
// console.log('====================================')
|
||||||
}
|
}
|
||||||
state.showCheckBox = val
|
state.showCheckBox = val
|
||||||
}
|
}
|
||||||
|
|
||||||
return { state, setValue, setShowCheckBox }
|
return { state, setValue, setShowCheckBox }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -373,3 +373,4 @@ body,
|
|||||||
.w-e-scroll {
|
.w-e-scroll {
|
||||||
min-height: 200px !important;
|
min-height: 200px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,3 +268,8 @@
|
|||||||
.el-drawer__body {
|
.el-drawer__body {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aLoad{
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -8,29 +8,31 @@ $primary-light: #3f6ad8;
|
|||||||
// --ba-background
|
// --ba-background
|
||||||
$bg-color: () !default;
|
$bg-color: () !default;
|
||||||
$bg-color: map.merge(
|
$bg-color: map.merge(
|
||||||
(
|
(
|
||||||
'': #edf0f3,
|
'': #edf0f3,
|
||||||
'overlay': #ffffff,
|
'overlay': #ffffff
|
||||||
),
|
),
|
||||||
$bg-color
|
$bg-color
|
||||||
);
|
);
|
||||||
|
|
||||||
// --ba-border-color
|
// --ba-border-color
|
||||||
$border-color: () !default;
|
$border-color: () !default;
|
||||||
$border-color: map.merge(
|
$border-color: map.merge(
|
||||||
(
|
(
|
||||||
'': #f6f6f6,
|
'': #f6f6f6
|
||||||
),
|
),
|
||||||
$border-color
|
$border-color
|
||||||
);
|
);
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
@include set-css-var-value('main-space', $main-space);
|
@include set-css-var-value('main-space', $main-space);
|
||||||
@include set-css-var-value('color-primary-light', $primary-light);
|
@include set-css-var-value('color-primary-light', $primary-light);
|
||||||
@include set-component-css-var('bg-color', $bg-color);
|
@include set-component-css-var('bg-color', $bg-color);
|
||||||
@include set-component-css-var('border-color', $border-color);
|
@include set-component-css-var('border-color', $border-color);
|
||||||
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
--vxe-ui-table-row-current-background-color: var(--el-color-primary-light-8);
|
||||||
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
--vxe-ui-table-row-hover-current-background-color: var(--el-color-primary-light-8);
|
||||||
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
||||||
// --vxe-table-row-hover-striped-background-color: var(--el-color-primary-light-9);
|
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
||||||
|
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
||||||
|
// --vxe-table-row-hover-striped-background-color: var(--el-color-primary-light-9);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.vxe-header--row {
|
.vxe-header--row {
|
||||||
background: var(--vxe-table-header-background-color);
|
background: var(--vxe-table-header-background-color);
|
||||||
color: var(--vxe-table-header-font-color);
|
color: var(--vxe-table-header-font-color);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is--checked.vxe-checkbox,
|
.is--checked.vxe-checkbox,
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,
|
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,
|
||||||
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,
|
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,
|
||||||
.vxe-table--render-default .is--checked.vxe-cell--radio .vxe-radio--icon {
|
.vxe-table--render-default .is--checked.vxe-cell--radio .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-3);
|
color: var(--el-color-primary-light-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,
|
.vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,
|
||||||
@@ -38,40 +38,41 @@
|
|||||||
.vxe-export--panel-column-option:not(.is--disabled):hover .vxe-radio--icon,
|
.vxe-export--panel-column-option:not(.is--disabled):hover .vxe-radio--icon,
|
||||||
.vxe-table--filter-option:not(.is--disabled):hover .vxe-radio--icon,
|
.vxe-table--filter-option:not(.is--disabled):hover .vxe-radio--icon,
|
||||||
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-5);
|
color: var(--el-color-primary-light-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--tooltip-wrapper {
|
.vxe-table--tooltip-wrapper {
|
||||||
z-index: 10000 !important;
|
z-index: 10000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is--disabled {
|
.is--disabled {
|
||||||
background-color: var(--vxe-input-disabled-color);
|
background-color: var(--vxe-input-disabled-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-modal--wrapper {
|
.vxe-modal--wrapper {
|
||||||
z-index: 5000 !important;
|
z-index: 5000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(even) {
|
.vxe-table--body .vxe-body--row:nth-child(even) {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
||||||
width: 10px !important;
|
width: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter:after,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter:after,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter:after {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter:after {
|
||||||
background-color: #000 !important;
|
background-color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter:before,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter:before,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter:before {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter:before {
|
||||||
background-color: #000 !important;
|
background-color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,10 @@
|
|||||||
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-5);
|
color: var(--el-color-primary-light-5);
|
||||||
}
|
}
|
||||||
|
.vxe-table--render-default .vxe-body--row.row--current,
|
||||||
|
.vxe-table--render-default .vxe-body--row.row--current:hover {
|
||||||
|
background-color: var(--el-color-primary-light-8);
|
||||||
|
}
|
||||||
// .vxe-table--render-default .is--disabled.vxe-cell--checkbox .vxe-checkbox--icon{
|
// .vxe-table--render-default .is--disabled.vxe-cell--checkbox .vxe-checkbox--icon{
|
||||||
// color: #fff0;
|
// color: #fff0;
|
||||||
// }
|
// }
|
||||||
@@ -77,14 +80,14 @@
|
|||||||
.vxe-modal--wrapper {
|
.vxe-modal--wrapper {
|
||||||
z-index: 5000 !important;
|
z-index: 5000 !important;
|
||||||
}
|
}
|
||||||
.vxe-table--body .vxe-body--row:nth-child(even) {
|
// .vxe-table--body .vxe-body--row:nth-child(even) {
|
||||||
background-color: #f9f9f9;
|
// background-color: #f9f9f9;
|
||||||
// background-color: var(--el-color-primary-light-9);
|
// // background-color: var(--el-color-primary-light-9);
|
||||||
}
|
// }
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
// .vxe-table--body .vxe-body--row:nth-child(odd) {
|
||||||
background-color: #ffffff;
|
// background-color: #ffffff;
|
||||||
}
|
// }
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
||||||
width: 10px !important;
|
width: 10px !important;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ export const getIntDictOptions = (dictType: string): NumberDictDataType[] => {
|
|||||||
value: parseInt(dict.value + '')
|
value: parseInt(dict.value + '')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
console.log("🚀 ~ getIntDictOptions ~ dictOption:", dictOption)
|
||||||
return dictOption
|
return dictOption
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
91
src/utils/fileDownLoad.ts
Normal file
91
src/utils/fileDownLoad.ts
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import { downloadFile } from '@/api/system-boot/file'
|
||||||
|
|
||||||
|
const sanitizeUrl = (url: string): string => {
|
||||||
|
return url.replace(/\[/g, '(').replace(/\]/g, ')')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载文件
|
||||||
|
export const download = (urls: string) => {
|
||||||
|
//console.log('下载', urls)
|
||||||
|
|
||||||
|
downloadFile({ filePath: urls })
|
||||||
|
.then((res: any) => {
|
||||||
|
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||||
|
const getFileType = (url: string) => {
|
||||||
|
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||||
|
const mimeMap: Record<string, string> = {
|
||||||
|
pdf: 'application/pdf',
|
||||||
|
zip: 'application/zip',
|
||||||
|
doc: 'application/msword',
|
||||||
|
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
xls: 'application/vnd.ms-excel',
|
||||||
|
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
png: 'image/png',
|
||||||
|
jpeg: 'image/jpeg',
|
||||||
|
jpg: 'image/jpg'
|
||||||
|
}
|
||||||
|
return mimeMap[ext] || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob([res], { type: getFileType(urls) })
|
||||||
|
|
||||||
|
// 2. 提取文件名并保留原生后缀(核心修复点)
|
||||||
|
const fileName = urls.split('/').at(-1) || '下载文件' // 先提取URL最后一段(文件名)
|
||||||
|
|
||||||
|
// 3. 创建下载链接
|
||||||
|
const url = window.URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = url
|
||||||
|
link.download = fileName // 直接使用原文件名(保留后缀)
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
|
||||||
|
// 4. 清理资源(优化)
|
||||||
|
link.remove()
|
||||||
|
window.URL.revokeObjectURL(url) // 释放blob URL
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error('下载失败:', err)
|
||||||
|
// 可添加错误提示(如Toast)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function removeLastDotSuffix(str: string) {
|
||||||
|
// 找到最后一个 . 的位置
|
||||||
|
const lastDotIndex = str.lastIndexOf('.')
|
||||||
|
// 如果存在 .,截取到 . 之前的部分;否则返回原字符串
|
||||||
|
return lastDotIndex !== -1 ? str.slice(0, lastDotIndex) : str
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预览文件
|
||||||
|
export const previewFile = async (urls: any) => {
|
||||||
|
//console.log('预览', urls)
|
||||||
|
let url = ''
|
||||||
|
await downloadFile({ filePath: decodeURI(urls) })
|
||||||
|
.then((res: any) => {
|
||||||
|
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||||
|
const getFileType = (url: string) => {
|
||||||
|
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||||
|
const mimeMap: Record<string, string> = {
|
||||||
|
pdf: 'application/pdf',
|
||||||
|
zip: 'application/zip',
|
||||||
|
doc: 'application/msword',
|
||||||
|
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
xls: 'application/vnd.ms-excel',
|
||||||
|
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
png: 'image/png',
|
||||||
|
jpeg: 'image/jpeg',
|
||||||
|
jpg: 'image/jpg'
|
||||||
|
}
|
||||||
|
return mimeMap[ext] || ''
|
||||||
|
}
|
||||||
|
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
||||||
|
// 3. 创建下载链接
|
||||||
|
url = window.URL.createObjectURL(blob)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error('下载失败:', err)
|
||||||
|
// 可添加错误提示(如Toast)
|
||||||
|
})
|
||||||
|
//console.log('url', url)
|
||||||
|
return url
|
||||||
|
}
|
||||||
@@ -362,3 +362,4 @@ export function getTimeOfTheMonth(key: string): [string, string] {
|
|||||||
throw new Error('Invalid key')
|
throw new Error('Invalid key')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,326 +1,327 @@
|
|||||||
import type { AxiosRequestConfig, Method } from 'axios'
|
import type { AxiosRequestConfig, Method } from 'axios'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
||||||
import { refreshToken } from '@/api/user-boot/user'
|
import { refreshToken } from '@/api/user-boot/user'
|
||||||
import router from '@/router/index'
|
import router from '@/router/index'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { debounce } from 'lodash-es';
|
import { debounce } from 'lodash-es'
|
||||||
let loginExpireTimer:any = null
|
let loginExpireTimer: any = null
|
||||||
window.requests = []
|
window.requests = []
|
||||||
window.tokenRefreshing = false
|
window.tokenRefreshing = false
|
||||||
const pendingMap = new Map()
|
const pendingMap = new Map()
|
||||||
const loadingInstance: LoadingInstance = {
|
const loadingInstance: LoadingInstance = {
|
||||||
target: null,
|
target: null,
|
||||||
count: 0
|
count: 0
|
||||||
}
|
}
|
||||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'removeMode'
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'removeMode'
|
||||||
// console.log('🚀 ~ import.meta.env.VITE_NAME:', import.meta.env.VITE_NAME)
|
// console.log('🚀 ~ import.meta.env.VITE_NAME:', import.meta.env.VITE_NAME)
|
||||||
/**
|
/**
|
||||||
* 根据运行环境获取基础请求URL
|
* 根据运行环境获取基础请求URL
|
||||||
*/
|
*/
|
||||||
export const getUrl = (): string => {
|
export const getUrl = (): string => {
|
||||||
return '/api'
|
return '/api'
|
||||||
}
|
}
|
||||||
function removeBeforeSecondSlash(str: string) {
|
function removeBeforeSecondSlash(str: string) {
|
||||||
// 找到第一个斜杠的位置
|
// 找到第一个斜杠的位置
|
||||||
const firstSlashIndex = str.indexOf('/')
|
const firstSlashIndex = str.indexOf('/')
|
||||||
if (firstSlashIndex === -1) {
|
if (firstSlashIndex === -1) {
|
||||||
// 如果没有斜杠,返回原字符串
|
// 如果没有斜杠,返回原字符串
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
// 从第一个斜杠之后开始找第二个斜杠
|
// 从第一个斜杠之后开始找第二个斜杠
|
||||||
const secondSlashIndex = str.indexOf('/', firstSlashIndex + 1)
|
const secondSlashIndex = str.indexOf('/', firstSlashIndex + 1)
|
||||||
if (secondSlashIndex === -1) {
|
if (secondSlashIndex === -1) {
|
||||||
// 如果只有一个斜杠,返回原字符串
|
// 如果只有一个斜杠,返回原字符串
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
// 返回第二个斜杠及之后的内容
|
// 返回第二个斜杠及之后的内容
|
||||||
return str.substring(secondSlashIndex)
|
return str.substring(secondSlashIndex)
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 创建`Axios`
|
* 创建`Axios`
|
||||||
* 默认开启`reductDataFormat(简洁响应)`,返回类型为`ApiPromise`
|
* 默认开启`reductDataFormat(简洁响应)`,返回类型为`ApiPromise`
|
||||||
* 关闭`reductDataFormat`,返回类型则为`AxiosPromise`
|
* 关闭`reductDataFormat`,返回类型则为`AxiosPromise`
|
||||||
*/
|
*/
|
||||||
function createAxios<Data = any, T = ApiPromise<Data>>(
|
function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||||
axiosConfig: AxiosRequestConfig,
|
axiosConfig: AxiosRequestConfig,
|
||||||
options: Options = {},
|
options: Options = {},
|
||||||
loading: LoadingOptions = {}
|
loading: LoadingOptions = {}
|
||||||
): T {
|
): T {
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
|
|
||||||
const Axios = axios.create({
|
const Axios = axios.create({
|
||||||
baseURL: getUrl(),
|
baseURL: getUrl(),
|
||||||
timeout: 1000 * 60 * 5,
|
timeout: 1000 * 60 * 5,
|
||||||
headers: {},
|
headers: {},
|
||||||
responseType: 'json'
|
responseType: 'json'
|
||||||
})
|
})
|
||||||
|
|
||||||
options = Object.assign(
|
options = Object.assign(
|
||||||
{
|
{
|
||||||
CancelDuplicateRequest: true, // 是否开启取消重复请求, 默认为 true
|
CancelDuplicateRequest: true, // 是否开启取消重复请求, 默认为 true
|
||||||
loading: false, // 是否开启loading层效果, 默认为false
|
loading: false, // 是否开启loading层效果, 默认为false
|
||||||
reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true
|
reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true
|
||||||
showErrorMessage: true, // 是否开启接口错误信息展示,默认为true
|
showErrorMessage: true, // 是否开启接口错误信息展示,默认为true
|
||||||
showCodeMessage: true, // 是否开启code不为1时的信息提示, 默认为true
|
showCodeMessage: true, // 是否开启code不为1时的信息提示, 默认为true
|
||||||
showSuccessMessage: false, // 是否开启code为1时的信息提示, 默认为false
|
showSuccessMessage: false, // 是否开启code为1时的信息提示, 默认为false
|
||||||
anotherToken: '' // 当前请求使用另外的用户token
|
anotherToken: '' // 当前请求使用另外的用户token
|
||||||
},
|
},
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
|
|
||||||
// 请求拦截
|
// 请求拦截
|
||||||
Axios.interceptors.request.use(
|
Axios.interceptors.request.use(
|
||||||
async (config: any) => {
|
async (config: any) => {
|
||||||
//嵌入去除所有请求头
|
//嵌入去除所有请求头
|
||||||
if (VITE_FLAG) {
|
if (VITE_FLAG) {
|
||||||
config.url = await removeBeforeSecondSlash(config.url)
|
config.url = await removeBeforeSecondSlash(config.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消重复请求
|
// 取消重复请求
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
config.url == '/system-boot/file/upload' ||
|
config.url == '/system-boot/file/upload' ||
|
||||||
config.url == '/harmonic-boot/grid/getAssessOverview' ||
|
config.url == '/harmonic-boot/grid/getAssessOverview' ||
|
||||||
config.url == '/system-boot/file/getFileVO' ||
|
config.url == '/system-boot/file/getFileVO' ||
|
||||||
config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData'
|
config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData' ||
|
||||||
)
|
config.url == '/supervision-boot/userReport/bindAssessmentId'
|
||||||
)
|
)
|
||||||
removePending(config)
|
)
|
||||||
|
removePending(config)
|
||||||
options.CancelDuplicateRequest && addPending(config)
|
|
||||||
// 创建loading实例
|
options.CancelDuplicateRequest && addPending(config)
|
||||||
if (options.loading) {
|
// 创建loading实例
|
||||||
loadingInstance.count++
|
if (options.loading) {
|
||||||
if (loadingInstance.count === 1) {
|
loadingInstance.count++
|
||||||
loadingInstance.target = ElLoading.service(loading)
|
if (loadingInstance.count === 1) {
|
||||||
}
|
loadingInstance.target = ElLoading.service(loading)
|
||||||
}
|
}
|
||||||
// 自动携带token
|
}
|
||||||
if (config.headers) {
|
// 自动携带token
|
||||||
const token = adminInfo.getToken()
|
if (config.headers) {
|
||||||
if (token) {
|
const token = adminInfo.getToken()
|
||||||
;(config.headers as anyObj).Authorization = token
|
if (token) {
|
||||||
} else {
|
;(config.headers as anyObj).Authorization = token
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
} else {
|
||||||
}
|
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
||||||
}
|
}
|
||||||
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
}
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
||||||
}
|
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
||||||
|
}
|
||||||
return config
|
|
||||||
},
|
return config
|
||||||
error => {
|
},
|
||||||
return Promise.reject(error)
|
error => {
|
||||||
}
|
return Promise.reject(error)
|
||||||
)
|
}
|
||||||
|
)
|
||||||
// 响应拦截
|
|
||||||
Axios.interceptors.response.use(
|
// 响应拦截
|
||||||
response => {
|
Axios.interceptors.response.use(
|
||||||
removePending(response.config)
|
response => {
|
||||||
options.loading && closeLoading(options) // 关闭loading
|
removePending(response.config)
|
||||||
|
options.loading && closeLoading(options) // 关闭loading
|
||||||
if (
|
|
||||||
response.data.code === 'A0000' ||
|
if (
|
||||||
response.data.type === 'application/json' ||
|
response.data.code === 'A0000' ||
|
||||||
Array.isArray(response.data) ||
|
response.data.type === 'application/json' ||
|
||||||
response.data.size ||
|
Array.isArray(response.data) ||
|
||||||
response.config.url == '/harmonic-boot/exportmodel/exportModelJB' ||
|
response.data.size ||
|
||||||
response.config.url == '/system-boot/file/download' ||
|
response.config.url == '/harmonic-boot/exportmodel/exportModelJB' ||
|
||||||
response.config.url == '/harmonic-boot/powerStatistics/exportExcelListTemplate' ||
|
response.config.url == '/system-boot/file/download' ||
|
||||||
response.config.url == '/harmonic-boot/powerStatistics/exportExcelRangTemplate'
|
response.config.url == '/harmonic-boot/powerStatistics/exportExcelListTemplate' ||
|
||||||
// ||
|
response.config.url == '/harmonic-boot/powerStatistics/exportExcelRangTemplate'
|
||||||
// response.data.type === 'application/octet-stream' ||
|
// ||
|
||||||
// response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
// response.data.type === 'application/octet-stream' ||
|
||||||
) {
|
// response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
return options.reductDataFormat ? response.data : response
|
) {
|
||||||
} else if (response.data.code == 'A0202') {
|
return options.reductDataFormat ? response.data : response
|
||||||
if (!window.tokenRefreshing) {
|
} else if (response.data.code == 'A0202') {
|
||||||
window.tokenRefreshing = true
|
if (!window.tokenRefreshing) {
|
||||||
|
window.tokenRefreshing = true
|
||||||
return refreshToken()
|
|
||||||
.then(res => {
|
return refreshToken()
|
||||||
adminInfo.setToken(res.data.access_token, 'auth')
|
.then(res => {
|
||||||
window.requests.forEach(cb => cb(res.data.access_token))
|
adminInfo.setToken(res.data.access_token, 'auth')
|
||||||
window.requests = []
|
window.requests.forEach(cb => cb(res.data.access_token))
|
||||||
|
window.requests = []
|
||||||
return Axios(response.config)
|
|
||||||
})
|
return Axios(response.config)
|
||||||
.catch(err => {
|
})
|
||||||
adminInfo.removeToken()
|
.catch(err => {
|
||||||
router.push({ name: 'login' })
|
adminInfo.removeToken()
|
||||||
return Promise.reject(err)
|
router.push({ name: 'login' })
|
||||||
})
|
return Promise.reject(err)
|
||||||
.finally(() => {
|
})
|
||||||
window.tokenRefreshing = false
|
.finally(() => {
|
||||||
})
|
window.tokenRefreshing = false
|
||||||
} else {
|
})
|
||||||
return new Promise(resolve => {
|
} else {
|
||||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
return new Promise(resolve => {
|
||||||
window.requests.push((token: string) => {
|
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||||
response.headers.Authorization = `${token}`
|
window.requests.push((token: string) => {
|
||||||
resolve(Axios(response.config))
|
response.headers.Authorization = `${token}`
|
||||||
})
|
resolve(Axios(response.config))
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
} else if (response.data.code == 'A0024' || response.data.code == 'null') {
|
}
|
||||||
// // 登录失效
|
} else if (response.data.code == 'A0024' || response.data.code == 'null') {
|
||||||
// 清除上一次的定时器
|
// // 登录失效
|
||||||
if (loginExpireTimer) {
|
// 清除上一次的定时器
|
||||||
clearTimeout(loginExpireTimer)
|
if (loginExpireTimer) {
|
||||||
}
|
clearTimeout(loginExpireTimer)
|
||||||
loginExpireTimer = setTimeout(() => {
|
}
|
||||||
ElNotification({
|
loginExpireTimer = setTimeout(() => {
|
||||||
type: 'error',
|
ElNotification({
|
||||||
message: response.data.message
|
type: 'error',
|
||||||
})
|
message: response.data.message
|
||||||
adminInfo.removeToken()
|
})
|
||||||
router.push({ name: 'login' })
|
adminInfo.removeToken()
|
||||||
loginExpireTimer = null // 执行后清空定时器
|
router.push({ name: 'login' })
|
||||||
}, 100) // 可根据实际情况调整延迟时间
|
loginExpireTimer = null // 执行后清空定时器
|
||||||
return Promise.reject(response.data)
|
}, 100) // 可根据实际情况调整延迟时间
|
||||||
} else {
|
return Promise.reject(response.data)
|
||||||
if (options.showCodeMessage) {
|
} else {
|
||||||
ElNotification({
|
if (options.showCodeMessage) {
|
||||||
type: 'error',
|
ElNotification({
|
||||||
message: response.data.message || '未知错误'
|
type: 'error',
|
||||||
})
|
message: response.data.message || '未知错误'
|
||||||
}
|
})
|
||||||
return Promise.reject(response.data)
|
}
|
||||||
}
|
return Promise.reject(response.data)
|
||||||
},
|
}
|
||||||
error => {
|
},
|
||||||
error.config && removePending(error.config)
|
error => {
|
||||||
options.loading && closeLoading(options) // 关闭loading
|
error.config && removePending(error.config)
|
||||||
return Promise.reject(error) // 错误继续返回给到具体页面
|
options.loading && closeLoading(options) // 关闭loading
|
||||||
}
|
return Promise.reject(error) // 错误继续返回给到具体页面
|
||||||
)
|
}
|
||||||
return Axios(axiosConfig) as T
|
)
|
||||||
}
|
return Axios(axiosConfig) as T
|
||||||
|
}
|
||||||
export default createAxios
|
|
||||||
|
export default createAxios
|
||||||
/**
|
|
||||||
* 关闭Loading层实例
|
/**
|
||||||
*/
|
* 关闭Loading层实例
|
||||||
function closeLoading(options: Options) {
|
*/
|
||||||
if (options.loading && loadingInstance.count > 0) loadingInstance.count--
|
function closeLoading(options: Options) {
|
||||||
if (loadingInstance.count === 0) {
|
if (options.loading && loadingInstance.count > 0) loadingInstance.count--
|
||||||
loadingInstance.target.close()
|
if (loadingInstance.count === 0) {
|
||||||
loadingInstance.target = null
|
loadingInstance.target.close()
|
||||||
}
|
loadingInstance.target = null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 储存每个请求的唯一cancel回调, 以此为标识
|
/**
|
||||||
*/
|
* 储存每个请求的唯一cancel回调, 以此为标识
|
||||||
function addPending(config: AxiosRequestConfig) {
|
*/
|
||||||
const pendingKey = getPendingKey(config)
|
function addPending(config: AxiosRequestConfig) {
|
||||||
config.cancelToken =
|
const pendingKey = getPendingKey(config)
|
||||||
config.cancelToken ||
|
config.cancelToken =
|
||||||
new axios.CancelToken(cancel => {
|
config.cancelToken ||
|
||||||
if (!pendingMap.has(pendingKey)) {
|
new axios.CancelToken(cancel => {
|
||||||
pendingMap.set(pendingKey, cancel)
|
if (!pendingMap.has(pendingKey)) {
|
||||||
}
|
pendingMap.set(pendingKey, cancel)
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 删除重复的请求
|
/**
|
||||||
*/
|
* 删除重复的请求
|
||||||
function removePending(config: AxiosRequestConfig) {
|
*/
|
||||||
const pendingKey = getPendingKey(config)
|
function removePending(config: AxiosRequestConfig) {
|
||||||
if (pendingMap.has(pendingKey)) {
|
const pendingKey = getPendingKey(config)
|
||||||
const cancelToken = pendingMap.get(pendingKey)
|
if (pendingMap.has(pendingKey)) {
|
||||||
cancelToken(pendingKey)
|
const cancelToken = pendingMap.get(pendingKey)
|
||||||
pendingMap.delete(pendingKey)
|
cancelToken(pendingKey)
|
||||||
}
|
pendingMap.delete(pendingKey)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 生成每个请求的唯一key
|
/**
|
||||||
*/
|
* 生成每个请求的唯一key
|
||||||
function getPendingKey(config: AxiosRequestConfig) {
|
*/
|
||||||
let { data } = config
|
function getPendingKey(config: AxiosRequestConfig) {
|
||||||
const { url, method, params, headers } = config
|
let { data } = config
|
||||||
if (typeof data === 'string') data = JSON.parse(data) // response里面返回的config.data是个字符串对象
|
const { url, method, params, headers } = config
|
||||||
return [
|
if (typeof data === 'string') data = JSON.parse(data) // response里面返回的config.data是个字符串对象
|
||||||
url,
|
return [
|
||||||
method,
|
url,
|
||||||
headers && (headers as anyObj).Authorization ? (headers as anyObj).Authorization : '',
|
method,
|
||||||
headers && (headers as anyObj)['ba-user-token'] ? (headers as anyObj)['ba-user-token'] : '',
|
headers && (headers as anyObj).Authorization ? (headers as anyObj).Authorization : '',
|
||||||
JSON.stringify(params),
|
headers && (headers as anyObj)['ba-user-token'] ? (headers as anyObj)['ba-user-token'] : '',
|
||||||
JSON.stringify(data)
|
JSON.stringify(params),
|
||||||
].join('&')
|
JSON.stringify(data)
|
||||||
}
|
].join('&')
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 根据请求方法组装请求数据/参数
|
/**
|
||||||
*/
|
* 根据请求方法组装请求数据/参数
|
||||||
export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) {
|
*/
|
||||||
if (method == 'GET') {
|
export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) {
|
||||||
return {
|
if (method == 'GET') {
|
||||||
params: data
|
return {
|
||||||
}
|
params: data
|
||||||
} else if (method == 'POST') {
|
}
|
||||||
if (paramsPOST) {
|
} else if (method == 'POST') {
|
||||||
return { params: data }
|
if (paramsPOST) {
|
||||||
} else {
|
return { params: data }
|
||||||
return { data: data }
|
} else {
|
||||||
}
|
return { data: data }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 适配器, 用于适配不同的请求方式
|
}
|
||||||
export function baseRequest(url, value = {}, method = 'post', options = {}) {
|
// 适配器, 用于适配不同的请求方式
|
||||||
url = sysConfig.API_URL + url
|
export function baseRequest(url, value = {}, method = 'post', options = {}) {
|
||||||
if (method === 'post') {
|
url = sysConfig.API_URL + url
|
||||||
return service.post(url, value, options)
|
if (method === 'post') {
|
||||||
} else if (method === 'get') {
|
return service.post(url, value, options)
|
||||||
return service.get(url, { params: value, ...options })
|
} else if (method === 'get') {
|
||||||
} else if (method === 'formdata') {
|
return service.get(url, { params: value, ...options })
|
||||||
// form-data表单提交的方式
|
} else if (method === 'formdata') {
|
||||||
return service.post(url, qs.stringify(value), {
|
// form-data表单提交的方式
|
||||||
headers: {
|
return service.post(url, qs.stringify(value), {
|
||||||
'Content-Type': 'multipart/form-data'
|
headers: {
|
||||||
},
|
'Content-Type': 'multipart/form-data'
|
||||||
...options
|
},
|
||||||
})
|
...options
|
||||||
} else {
|
})
|
||||||
// 其他请求方式,例如:put、delete
|
} else {
|
||||||
return service({
|
// 其他请求方式,例如:put、delete
|
||||||
method: method,
|
return service({
|
||||||
url: url,
|
method: method,
|
||||||
data: value,
|
url: url,
|
||||||
...options
|
data: value,
|
||||||
})
|
...options
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
// 模块内的请求, 会自动加上模块的前缀
|
}
|
||||||
export const moduleRequest =
|
// 模块内的请求, 会自动加上模块的前缀
|
||||||
moduleUrl =>
|
export const moduleRequest =
|
||||||
(url, ...arg) => {
|
moduleUrl =>
|
||||||
return baseRequest(moduleUrl + url, ...arg)
|
(url, ...arg) => {
|
||||||
}
|
return baseRequest(moduleUrl + url, ...arg)
|
||||||
|
}
|
||||||
interface LoadingInstance {
|
|
||||||
target: any
|
interface LoadingInstance {
|
||||||
count: number
|
target: any
|
||||||
}
|
count: number
|
||||||
|
}
|
||||||
interface Options {
|
|
||||||
// 是否开启取消重复请求, 默认为 true
|
interface Options {
|
||||||
CancelDuplicateRequest?: boolean
|
// 是否开启取消重复请求, 默认为 true
|
||||||
// 是否开启loading层效果, 默认为false
|
CancelDuplicateRequest?: boolean
|
||||||
loading?: boolean
|
// 是否开启loading层效果, 默认为false
|
||||||
// 是否开启简洁的数据结构响应, 默认为true
|
loading?: boolean
|
||||||
reductDataFormat?: boolean
|
// 是否开启简洁的数据结构响应, 默认为true
|
||||||
// 是否开启code不为A0000时的信息提示, 默认为true
|
reductDataFormat?: boolean
|
||||||
showCodeMessage?: boolean
|
// 是否开启code不为A0000时的信息提示, 默认为true
|
||||||
// 是否开启code为0时的信息提示, 默认为false
|
showCodeMessage?: boolean
|
||||||
showSuccessMessage?: boolean
|
// 是否开启code为0时的信息提示, 默认为false
|
||||||
// 当前请求使用另外的用户token
|
showSuccessMessage?: boolean
|
||||||
anotherToken?: string
|
// 当前请求使用另外的用户token
|
||||||
}
|
anotherToken?: string
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ interface TableStoreParams {
|
|||||||
publicHeight?: number //计算高度
|
publicHeight?: number //计算高度
|
||||||
resetCallback?: () => void // 重置
|
resetCallback?: () => void // 重置
|
||||||
loadCallback?: () => void // 接口调用后的回调
|
loadCallback?: () => void // 接口调用后的回调
|
||||||
exportProcessingData?:() => void //导出处理数据
|
exportProcessingData?: () => void //导出处理数据
|
||||||
beforeSearchFun?: () => void // 接口调用前的回调
|
beforeSearchFun?: () => void // 接口调用前的回调
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,8 +45,9 @@ export default class TableStore {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
},
|
},
|
||||||
filename:null,
|
filename: null,
|
||||||
loading: true,
|
loading: true,
|
||||||
|
exportLoading: false,
|
||||||
column: [],
|
column: [],
|
||||||
loadCallback: null,
|
loadCallback: null,
|
||||||
exportProcessingData: null,
|
exportProcessingData: null,
|
||||||
@@ -65,7 +66,7 @@ export default class TableStore {
|
|||||||
this.table.filename = options.filename || null
|
this.table.filename = options.filename || null
|
||||||
this.table.column = options.column
|
this.table.column = options.column
|
||||||
this.showPage = options.showPage !== false
|
this.showPage = options.showPage !== false
|
||||||
|
|
||||||
this.table.publicHeight = options.publicHeight || 0
|
this.table.publicHeight = options.publicHeight || 0
|
||||||
this.table.resetCallback = options.resetCallback || null
|
this.table.resetCallback = options.resetCallback || null
|
||||||
this.table.loadCallback = options.loadCallback || null
|
this.table.loadCallback = options.loadCallback || null
|
||||||
@@ -84,13 +85,11 @@ export default class TableStore {
|
|||||||
this.initData = JSON.parse(JSON.stringify(this.table.params))
|
this.initData = JSON.parse(JSON.stringify(this.table.params))
|
||||||
}
|
}
|
||||||
if (!this.timeAll) {
|
if (!this.timeAll) {
|
||||||
delete this.table.params.startTime;
|
delete this.table.params.startTime
|
||||||
delete this.table.params.endTime;
|
delete this.table.params.endTime
|
||||||
delete this.table.params.searchBeginTime;
|
delete this.table.params.searchBeginTime
|
||||||
delete this.table.params.searchEndTime;
|
delete this.table.params.searchEndTime
|
||||||
delete this.table.params.timeFlag;
|
delete this.table.params.timeFlag
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
createAxios(
|
createAxios(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@@ -134,6 +133,7 @@ export default class TableStore {
|
|||||||
[
|
[
|
||||||
'search',
|
'search',
|
||||||
() => {
|
() => {
|
||||||
|
|
||||||
this.table.params.pageNum = 1
|
this.table.params.pageNum = 1
|
||||||
this.index()
|
this.index()
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,9 @@ export default class TableStore {
|
|||||||
[
|
[
|
||||||
'export',
|
'export',
|
||||||
() => {
|
() => {
|
||||||
|
this.table.exportLoading = true
|
||||||
// this.index()
|
// this.index()
|
||||||
|
//console.log('export')
|
||||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||||
createAxios(
|
createAxios(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@@ -211,11 +213,17 @@ export default class TableStore {
|
|||||||
},
|
},
|
||||||
requestPayload(this.method, params, this.paramsPOST)
|
requestPayload(this.method, params, this.paramsPOST)
|
||||||
)
|
)
|
||||||
).then(res => {
|
)
|
||||||
this.table.allData = filtration(res.data.records || res.data)
|
.then(res => {
|
||||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
this.table.allData = filtration(res.data.records || res.data)
|
||||||
this.table.allFlag = data.showAllFlag || true
|
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||||
})
|
this.table.allFlag = data.showAllFlag || true
|
||||||
|
this.table.exportLoading = false
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.table.exportLoading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -146,7 +146,7 @@ const tableStore: any = new TableStore({
|
|||||||
{ field: 'describe', title: '事件描述' },
|
{ field: 'describe', title: '事件描述' },
|
||||||
{ field: 'type', title: '事件类型', sortable: true },
|
{ field: 'type', title: '事件类型', sortable: true },
|
||||||
{ field: 'result', title: '操作结果', sortable: true },
|
{ field: 'result', title: '操作结果', sortable: true },
|
||||||
{ field: 'ip', title: '操作IP' },
|
{ field: 'ip', title: '操作IP' ,width:'120px'},
|
||||||
{ field: 'level', title: '事件等级', sortable: true }
|
{ field: 'level', title: '事件等级', sortable: true }
|
||||||
],
|
],
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const tableStore: any = new TableStore({
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ field: 'userName', title: '登录用户' },
|
{ field: 'userName', title: '登录用户' },
|
||||||
{ field: 'ip', title: '登录ip' },
|
{ field: 'ip', title: '登录ip' ,width:'120px'},
|
||||||
{ field: 'time', title: '登录时间' }
|
{ field: 'time', title: '登录时间' }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ const selChange = async (e: any) => {
|
|||||||
}
|
}
|
||||||
// 导出
|
// 导出
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
console.log("🚀 ~ onExport ~ document.getElementById('exportId'):", document.getElementById('exportId'))
|
// console.log("🚀 ~ onExport ~ document.getElementById('exportId'):", document.getElementById('exportId'))
|
||||||
|
|
||||||
// 转换成canvas
|
// 转换成canvas
|
||||||
html2canvas(document.getElementById('exportId'), {
|
html2canvas(document.getElementById('exportId'), {
|
||||||
@@ -459,7 +459,7 @@ const onExport = () => {
|
|||||||
logging: false, // 关闭日志
|
logging: false, // 关闭日志
|
||||||
scale: 2 // 提高缩放比例以获得更清晰的截图
|
scale: 2 // 提高缩放比例以获得更清晰的截图
|
||||||
}).then(function (canvas) {
|
}).then(function (canvas) {
|
||||||
console.log('🚀 ~ onExport ~ canvas:', canvas)
|
// console.log('🚀 ~ onExport ~ canvas:', canvas)
|
||||||
// 创建a标签,实现下载
|
// 创建a标签,实现下载
|
||||||
let creatIMg = document.createElement('a')
|
let creatIMg = document.createElement('a')
|
||||||
creatIMg.download = '光伏电站承载能力评估结果.png' // 设置下载的文件名,
|
creatIMg.download = '光伏电站承载能力评估结果.png' // 设置下载的文件名,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<pane style="background: #fff">
|
<pane style="background: #fff">
|
||||||
<TableHeader :showSearch="false" v-show="props.rowList.id == undefined">
|
<TableHeader :showSearch="false" v-show="props.rowList.id == undefined">
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="时间">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -205,7 +205,7 @@ const props = defineProps(['rowList'])
|
|||||||
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
||||||
const currentLod = ref(false)
|
const currentLod = ref(false)
|
||||||
const monitoringPoint = useMonitoringPoint()
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const size = ref(0)
|
const size = ref(19)
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
const height = mainHeight(80).height
|
const height = mainHeight(80).height
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ const info = () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
console.log('🚀 ~ queyDetail ~ photovoltaicData.value:', photovoltaicData.value)
|
// console.log('🚀 ~ queyDetail ~ photovoltaicData.value:', photovoltaicData.value)
|
||||||
})
|
})
|
||||||
// 电弧炉
|
// 电弧炉
|
||||||
queyDetailDhl().then(res => {
|
queyDetailDhl().then(res => {
|
||||||
|
|||||||
@@ -56,8 +56,10 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="区域" prop="regionList">
|
<el-form-item label="区域" prop="regionList">
|
||||||
<el-cascader v-model="form.regionList" style="width: 100%" :props="props" :options="areaList" />
|
<!-- <el-cascader v-model="form.regionList" style="width: 100%" :props="props" :options="areaList" /> -->
|
||||||
|
<el-cascader v-model="form.regionList" :props="props" :options="areaList" style="width: 100%" placeholder="请选择区域" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="详细地址:" prop="area">
|
<el-form-item label="详细地址:" prop="area">
|
||||||
<el-input
|
<el-input
|
||||||
clearable
|
clearable
|
||||||
@@ -93,6 +95,8 @@ import { mainHeight } from '@/utils/layout'
|
|||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import equipment from './equipment.vue'
|
import equipment from './equipment.vue'
|
||||||
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
||||||
|
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'estimate/photovoltaic'
|
name: 'estimate/photovoltaic'
|
||||||
})
|
})
|
||||||
@@ -104,7 +108,8 @@ const disabled = ref(false)
|
|||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const equipmentRef = ref()
|
const equipmentRef = ref()
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const areaList: any = dictData.areaSelect()
|
//const areaList: any = dictData.areaSelect()
|
||||||
|
const areaList = ref([])
|
||||||
const userShow: any = ref('Power_Station_Users')
|
const userShow: any = ref('Power_Station_Users')
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
@@ -263,14 +268,20 @@ tableStore.table.params.userType = ''
|
|||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
const useChange = (e: string) => {
|
const useChange = (e: string) => {
|
||||||
userShow.value = uesrList.filter(item => item.id == e)[0].code
|
userShow.value = uesrList.filter(item => item.id == e)[0].code
|
||||||
}
|
}
|
||||||
// 新增
|
// 新增
|
||||||
const add = () => {
|
const add = async () => {
|
||||||
disabled.value = false
|
disabled.value = false
|
||||||
title.value = '新增承载能力待评估用户'
|
title.value = '新增承载能力待评估用户'
|
||||||
|
|
||||||
|
await getAreaDept().then(res => {
|
||||||
|
areaList.value = JSON.parse(JSON.stringify(res.data))
|
||||||
|
})
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
// 保存
|
// 保存
|
||||||
|
|||||||
@@ -218,6 +218,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import { ElButton } from 'element-plus'
|
import { ElButton } from 'element-plus'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import Bind from './bind.vue'
|
import Bind from './bind.vue'
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'hainan'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'BusinessAdministrator/TerminalManagement/FrontManagement'
|
name: 'BusinessAdministrator/TerminalManagement/FrontManagement'
|
||||||
})
|
})
|
||||||
@@ -270,7 +271,7 @@ const tableStore = new TableStore({
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '名称', field: 'name' },
|
{ title: '名称', field: 'name' },
|
||||||
{ title: 'IP', field: 'ip' },
|
{ title: 'IP', field: 'ip' ,width:'120px' },
|
||||||
{
|
{
|
||||||
title: '等级',
|
title: '等级',
|
||||||
field: 'nodeGrade',
|
field: 'nodeGrade',
|
||||||
@@ -338,6 +339,9 @@ const tableStore = new TableStore({
|
|||||||
type: 'warning',
|
type: 'warning',
|
||||||
icon: 'el-icon-Delete',
|
icon: 'el-icon-Delete',
|
||||||
render: 'confirmButton',
|
render: 'confirmButton',
|
||||||
|
disabled: row => {
|
||||||
|
return VITE_FLAG
|
||||||
|
},
|
||||||
popconfirm: {
|
popconfirm: {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -426,7 +430,7 @@ const currentChangeEvent = () => {
|
|||||||
|
|
||||||
// 重启进程
|
// 重启进程
|
||||||
const restart = (data: any) => {
|
const restart = (data: any) => {
|
||||||
console.log('🚀 ~ restart ~ data:', data)
|
// console.log('🚀 ~ restart ~ data:', data)
|
||||||
askRestartProcess({
|
askRestartProcess({
|
||||||
deviceRebootType: data.processNo,
|
deviceRebootType: data.processNo,
|
||||||
nodeId: nodeId.value,
|
nodeId: nodeId.value,
|
||||||
@@ -579,7 +583,7 @@ const addMenu = () => {}
|
|||||||
:deep(.default) {
|
:deep(.default) {
|
||||||
display: flex;
|
display: flex;
|
||||||
.row--current {
|
.row--current {
|
||||||
background-color: var(--el-color-primary-light-8) !important;
|
// background-color: var(--el-color-primary-light-8) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.custom-tree-node {
|
.custom-tree-node {
|
||||||
|
|||||||
@@ -1,355 +1,355 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main" style="position: relative">
|
<div class="default-main" style="position: relative">
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="终端型号">
|
<el-form-item label="终端型号">
|
||||||
<el-select v-model="tableStore.table.params.teriminal" clearable placeholder="请选择终端型号">
|
<el-select v-model="tableStore.table.params.teriminal" clearable placeholder="请选择终端型号">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminaloption"
|
v-for="item in teriminaloption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="终端状态">
|
<el-form-item label="终端状态">
|
||||||
<el-select v-model="tableStore.table.params.teriminalstatus" clearable placeholder="请选择终端状态">
|
<el-select v-model="tableStore.table.params.teriminalstatus" clearable placeholder="请选择终端状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminalstatusoption"
|
v-for="item in teriminalstatusoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通讯状态">
|
<el-form-item label="通讯状态">
|
||||||
<el-select v-model="tableStore.table.params.state" clearable placeholder="请选择通讯状态">
|
<el-select v-model="tableStore.table.params.state" clearable placeholder="请选择通讯状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in stateoption"
|
v-for="item in stateoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="程序版本">
|
<el-form-item label="程序版本">
|
||||||
<el-select v-model="tableStore.table.params.program" clearable placeholder="请选择程序版本">
|
<el-select v-model="tableStore.table.params.program" clearable placeholder="请选择程序版本">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in programoption"
|
v-for="item in programoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="tableStore.table.params.filterName"
|
v-model="tableStore.table.params.filterName"
|
||||||
@keyup="searchEvent"
|
@keyup="searchEvent"
|
||||||
placeholder="输入关键字筛选"
|
placeholder="输入关键字筛选"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button icon="el-icon-Download" @click="add">导出</el-button>
|
<el-button icon="el-icon-Download" @click="add">导出</el-button>
|
||||||
<el-button icon="el-icon-Check" @click="add">批量升级</el-button>
|
<el-button icon="el-icon-Check" @click="add">批量升级</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||||
<vxe-table
|
<vxe-table
|
||||||
v-loading="tableStore.table.loading"
|
v-loading="tableStore.table.loading"
|
||||||
height="auto"
|
height="auto"
|
||||||
auto-resize
|
auto-resize
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
v-bind="defaultAttribute"
|
v-bind="defaultAttribute"
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
show-overflow
|
show-overflow
|
||||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||||
:scroll-y="{ enabled: true }"
|
:scroll-y="{ enabled: true }"
|
||||||
>
|
>
|
||||||
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
||||||
<vxe-column field="devType" title="终端型号" :formatter="formFilter"></vxe-column>
|
<vxe-column field="devType" title="终端型号" :formatter="formFilter"></vxe-column>
|
||||||
<vxe-column field="versionName" title="版本号"></vxe-column>
|
<vxe-column field="versionName" title="版本号"></vxe-column>
|
||||||
<vxe-column field="protocol" title="协议版本"></vxe-column>
|
<vxe-column field="protocol" title="协议版本"></vxe-column>
|
||||||
<vxe-column field="versionDate" title="版本日期"></vxe-column>
|
<vxe-column field="versionDate" title="版本日期"></vxe-column>
|
||||||
<vxe-column field="runFlag" title="终端状态">
|
<vxe-column field="runFlag" title="终端状态">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.runFlag === 0" style="color: #fff; background: #0099cc" size="small">
|
<el-tag v-if="row.runFlag === 0" style="color: #fff; background: #0099cc" size="small">
|
||||||
投运
|
投运
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag v-if="row.runFlag === 1" style="color: #fff; background: #996600" size="small">
|
<el-tag v-if="row.runFlag === 1" style="color: #fff; background: #996600" size="small">
|
||||||
检修
|
检修
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag v-if="row.runFlag === 2" style="color: #fff; background: #A52a2a" size="small">
|
<el-tag v-if="row.runFlag === 2" style="color: #fff; background: #A52a2a" size="small">
|
||||||
停运
|
停运
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="comFlag" title="通讯状态">
|
<vxe-column field="comFlag" title="通讯状态">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.comFlag === 0" style="color: #fff; background: #A52a2a" size="small">
|
<el-tag v-if="row.comFlag === 0" style="color: #fff; background: #A52a2a" size="small">
|
||||||
中断
|
中断
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-tag v-if="row.comFlag === 1" style="color: #fff; background: #2e8b57" size="small">
|
<el-tag v-if="row.comFlag === 1" style="color: #fff; background: #2e8b57" size="small">
|
||||||
正常
|
正常
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="updateBy" title="升级人员">
|
<vxe-column field="updateBy" title="升级人员">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row.updateBy == null || row.updateBy == '/'">--</span>
|
<span v-if="row.updateBy == null || row.updateBy == '/'">--</span>
|
||||||
<span v-else>{{ row.updateBy }}</span>
|
<span v-else>{{ row.updateBy }}</span>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="updateTime" title="最新升级时间"></vxe-column>
|
<vxe-column field="updateTime" title="最新升级时间"></vxe-column>
|
||||||
<vxe-column title="操作" min-width="100">
|
<vxe-column title="操作" min-width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button>
|
<el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="row.level == 4"
|
v-if="row.level == 4"
|
||||||
:disabled="row.state == 1 ? true : false"
|
:disabled="row.state == 1 ? true : false"
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
@click="queryview(row)"
|
@click="queryview(row)"
|
||||||
>
|
>
|
||||||
日志查看
|
日志查看
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
</vxe-table>
|
</vxe-table>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
draggable
|
draggable
|
||||||
v-model="dialogVisible"
|
v-model="dialogVisible"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:title="protitle + '#终端升级日志查看'"
|
:title="protitle + '#终端升级日志查看'"
|
||||||
width="70%"
|
width="70%"
|
||||||
>
|
>
|
||||||
<div :style="{ height: dialogHeight.height }">
|
<div :style="{ height: dialogHeight.height }">
|
||||||
<vxe-table height="auto" auto-resize :data="logtableData" v-bind="defaultAttribute">
|
<vxe-table height="auto" auto-resize :data="logtableData" v-bind="defaultAttribute">
|
||||||
<vxe-column field="devTypeName" align="center" title="终端序号"></vxe-column>
|
<vxe-column field="devTypeName" align="center" title="终端序号"></vxe-column>
|
||||||
<vxe-column field="versionId" align="center" title="版本序号"></vxe-column>
|
<vxe-column field="versionId" align="center" title="版本序号"></vxe-column>
|
||||||
<vxe-column field="flag" align="center" title="版本状态" width="100">
|
<vxe-column field="flag" align="center" title="版本状态" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.flag == true" style="color: #fff; background: #fc0">前期版本</el-tag>
|
<el-tag v-if="row.flag == true" style="color: #fff; background: #fc0">前期版本</el-tag>
|
||||||
<el-tag v-if="row.flag == false" style="color: #fff; background: #0c0">当前版本</el-tag>
|
<el-tag v-if="row.flag == false" style="color: #fff; background: #0c0">当前版本</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="result" align="center" title="升级结果" width="100">
|
<vxe-column field="result" align="center" title="升级结果" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.result == false" style="color: #fff; background: #f30">升级失败</el-tag>
|
<el-tag v-if="row.result == false" style="color: #fff; background: #f30">升级失败</el-tag>
|
||||||
<el-tag v-if="row.result == true" style="color: #fff; background: #093">升级成功</el-tag>
|
<el-tag v-if="row.result == true" style="color: #fff; background: #093">升级成功</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="state" align="center" title="状态" width="100">
|
<vxe-column field="state" align="center" title="状态" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.state == false" style="color: #fff; background: #f30">删除</el-tag>
|
<el-tag v-if="row.state == false" style="color: #fff; background: #f30">删除</el-tag>
|
||||||
<el-tag v-if="row.state == true" style="color: #fff; background: #093">正常</el-tag>
|
<el-tag v-if="row.state == true" style="color: #fff; background: #093">正常</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="createBy" align="center" title="创建用户"></vxe-column>
|
<vxe-column field="createBy" align="center" title="创建用户"></vxe-column>
|
||||||
<vxe-column field="createTime" align="center" title="创建时间"></vxe-column>
|
<vxe-column field="createTime" align="center" title="创建时间"></vxe-column>
|
||||||
<vxe-column field="updateTime" align="center" title="升级时间"></vxe-column>
|
<vxe-column field="updateTime" align="center" title="升级时间"></vxe-column>
|
||||||
<vxe-column field="updateBy" align="center" title="升级人员"></vxe-column>
|
<vxe-column field="updateBy" align="center" title="升级人员"></vxe-column>
|
||||||
</vxe-table>
|
</vxe-table>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 升级 -->
|
<!-- 升级 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
draggable
|
draggable
|
||||||
v-model="prodialogVisible"
|
v-model="prodialogVisible"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:title="protitle + '#终端程序升级'"
|
:title="protitle + '#终端程序升级'"
|
||||||
width="40%"
|
width="40%"
|
||||||
>
|
>
|
||||||
<el-col v-for="(item, index) in percentageoption" :key="index">
|
<el-col v-for="(item, index) in percentageoption" :key="index">
|
||||||
<span style="font-size: 14px; font-weight: bold">{{ item.name }}</span>
|
<span style="font-size: 14px; font-weight: bold">{{ item.name }}</span>
|
||||||
:
|
:
|
||||||
<el-progress
|
<el-progress
|
||||||
:text-inside="true"
|
:text-inside="true"
|
||||||
:stroke-width="24"
|
:stroke-width="24"
|
||||||
:percentage="item.percentage"
|
:percentage="item.percentage"
|
||||||
:status="item.status"
|
:status="item.status"
|
||||||
:format="format"
|
:format="format"
|
||||||
></el-progress>
|
></el-progress>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { getTerminalUpLog } from '@/api/device-boot/Business'
|
import { getTerminalUpLog } from '@/api/device-boot/Business'
|
||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils'
|
||||||
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'BusinessAdministrator/TerminalManagement/ProgramManagement'
|
name: 'BusinessAdministrator/TerminalManagement/ProgramManagement'
|
||||||
})
|
})
|
||||||
|
|
||||||
const pageHeight = mainHeight(83)
|
const pageHeight = mainHeight(83)
|
||||||
const dialogHeight = mainHeight(300)
|
const dialogHeight = mainHeight(300)
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const teriminaloption: any = ref([])
|
const teriminaloption: any = ref([])
|
||||||
const teriminalstatusoption = ref([
|
const teriminalstatusoption = ref([
|
||||||
{ name: '全部', id: '' },
|
{ name: '全部', id: '' },
|
||||||
{ name: '投运', id: 0 },
|
{ name: '投运', id: 0 },
|
||||||
{ name: '检修', id: 1 },
|
{ name: '检修', id: 1 },
|
||||||
{ name: '停运', id: 2 }
|
{ name: '停运', id: 2 }
|
||||||
])
|
])
|
||||||
const stateoption = ref([
|
const stateoption = ref([
|
||||||
{ name: '全部', id: '' },
|
{ name: '全部', id: '' },
|
||||||
{ name: '正常', id: 1 },
|
{ name: '正常', id: 1 },
|
||||||
{ name: '中断', id: 0 }
|
{ name: '中断', id: 0 }
|
||||||
])
|
])
|
||||||
const prodialogVisible = ref(false)
|
const prodialogVisible = ref(false)
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const protitle = ref('')
|
const protitle = ref('')
|
||||||
const treeData: any = ref([])
|
const treeData: any = ref([])
|
||||||
const treeDataCopy: any = ref([])
|
const treeDataCopy: any = ref([])
|
||||||
//进度条对象
|
//进度条对象
|
||||||
const percentageoption = ref([
|
const percentageoption = ref([
|
||||||
{
|
{
|
||||||
name: '1号测试终端',
|
name: '1号测试终端',
|
||||||
status: 'exception',
|
status: 'exception',
|
||||||
percentage: 20
|
percentage: 20
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '2号测试终端',
|
name: '2号测试终端',
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
percentage: 50
|
percentage: 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '3号测试终端',
|
name: '3号测试终端',
|
||||||
status: 'success',
|
status: 'success',
|
||||||
percentage: 90
|
percentage: 90
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
const programoption: any = ref([])
|
const programoption: any = ref([])
|
||||||
const logtableData: any = ref([])
|
const logtableData: any = ref([])
|
||||||
const tableRef = ref()
|
const tableRef = ref()
|
||||||
const status = ref('')
|
const status = ref('')
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/device-boot/version/getTerminalVersionList',
|
url: '/device-boot/version/getTerminalVersionList',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [],
|
column: [],
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
// tableStore.table.data.forEach((item: any) => {
|
// tableStore.table.data.forEach((item: any) => {
|
||||||
// if (item.children.length > 0) {
|
// if (item.children.length > 0) {
|
||||||
// item.id = item.children[0].pid
|
// item.id = item.children[0].pid
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||||
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tableRef.value.setAllTreeExpand(true)
|
tableRef.value.setAllTreeExpand(true)
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.teriminal = ''
|
tableStore.table.params.teriminal = ''
|
||||||
tableStore.table.params.state = ''
|
tableStore.table.params.state = ''
|
||||||
tableStore.table.params.program = ''
|
tableStore.table.params.program = ''
|
||||||
tableStore.table.params.searchEvent = ''
|
tableStore.table.params.searchEvent = ''
|
||||||
tableStore.table.params.filterName = ''
|
tableStore.table.params.filterName = ''
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
const tree2List = (list: any, id: any) => {
|
const tree2List = (list: any, id: any) => {
|
||||||
//存储结果的数组
|
//存储结果的数组
|
||||||
let arr: any = []
|
let arr: any = []
|
||||||
// 遍历 tree 数组
|
// 遍历 tree 数组
|
||||||
list.forEach((item: any) => {
|
list.forEach((item: any) => {
|
||||||
item.uPid = id
|
item.uPid = id
|
||||||
item.uId = Math.random() * 1000
|
item.uId = Math.random() * 1000
|
||||||
|
|
||||||
// 判断item是否存在children
|
// 判断item是否存在children
|
||||||
if (!item.children) return arr.push(item)
|
if (!item.children) return arr.push(item)
|
||||||
// 函数递归,对children数组进行tree2List的转换
|
// 函数递归,对children数组进行tree2List的转换
|
||||||
const children = tree2List(item.children, item.uId)
|
const children = tree2List(item.children, item.uId)
|
||||||
// 删除item的children属性
|
// 删除item的children属性
|
||||||
delete item.children
|
delete item.children
|
||||||
// 把item和children数组添加至结果数组
|
// 把item和children数组添加至结果数组
|
||||||
//..children: 意思是把children数组展开
|
//..children: 意思是把children数组展开
|
||||||
arr.push(item, ...children)
|
arr.push(item, ...children)
|
||||||
})
|
})
|
||||||
// 返回结果数组
|
// 返回结果数组
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
tableStore.table.params.searchState = 0
|
tableStore.table.params.searchState = 0
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDevTypeList().then(res => {
|
getDevTypeList().then(res => {
|
||||||
teriminaloption.value = res.data
|
teriminaloption.value = res.data
|
||||||
})
|
})
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
const add = () => {}
|
const add = () => {}
|
||||||
const updateprogram = (row: any) => {
|
const updateprogram = (row: any) => {
|
||||||
protitle.value = row.name
|
protitle.value = row.name
|
||||||
prodialogVisible.value = true
|
prodialogVisible.value = true
|
||||||
}
|
}
|
||||||
const queryview = (row: any) => {
|
const queryview = (row: any) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
protitle.value = row.name
|
protitle.value = row.name
|
||||||
let data = {
|
let data = {
|
||||||
id: row.id
|
id: row.id
|
||||||
}
|
}
|
||||||
getTerminalUpLog(data).then((res: any) => {
|
getTerminalUpLog(data).then((res: any) => {
|
||||||
logtableData.value = res.data
|
logtableData.value = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const format = (percentage: any) => {
|
const format = (percentage: any) => {
|
||||||
if (percentage <= 100 && percentage >= 90) {
|
if (percentage <= 100 && percentage >= 90) {
|
||||||
status.value = 'success'
|
status.value = 'success'
|
||||||
return percentage === 100 ? '升级成功' : `${percentage}%`
|
return percentage === 100 ? '升级成功' : `${percentage}%`
|
||||||
} else if (percentage > 0 && percentage < 50) {
|
} else if (percentage > 0 && percentage < 50) {
|
||||||
status.value = 'exception'
|
status.value = 'exception'
|
||||||
return percentage <= 20 ? '升级失败' + percentage + '%' : `${percentage}%`
|
return percentage <= 20 ? '升级失败' + percentage + '%' : `${percentage}%`
|
||||||
} else if (percentage > 0 && percentage <= 50) {
|
} else if (percentage > 0 && percentage <= 50) {
|
||||||
status.value = 'warning'
|
status.value = 'warning'
|
||||||
return percentage <= 50 ? '升级中断' : `${percentage}%`
|
return percentage <= 50 ? '升级中断' : `${percentage}%`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const formFilter = (row: any) => {
|
const formFilter = (row: any) => {
|
||||||
let title = '/'
|
let title = '/'
|
||||||
if (row.cellValue != null) {
|
if (row.cellValue != null) {
|
||||||
teriminaloption.value.forEach((item: any) => {
|
teriminaloption.value.forEach((item: any) => {
|
||||||
if (item.id == row.cellValue) {
|
if (item.id == row.cellValue) {
|
||||||
title = item.name
|
title = item.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return title
|
return title
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格过滤
|
// 表格过滤
|
||||||
const searchEvent = debounce(e => {
|
const searchEvent = debounce(e => {
|
||||||
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
||||||
if (filterVal) {
|
if (filterVal) {
|
||||||
const options = { children: 'children' }
|
const options = { children: 'children' }
|
||||||
const searchProps = ['name']
|
const searchProps = ['name']
|
||||||
const rest = XEUtils.searchTree(
|
const rest = XEUtils.searchTree(
|
||||||
treeDataCopy,
|
treeDataCopy,
|
||||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
|
|
||||||
treeData.value = rest
|
treeData.value = rest
|
||||||
|
|
||||||
// 搜索之后默认展开所有子节点
|
// 搜索之后默认展开所有子节点
|
||||||
} else {
|
} else {
|
||||||
treeData.value = treeDataCopy
|
treeData.value = treeDataCopy
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const $table = tableRef.value
|
const $table = tableRef.value
|
||||||
if ($table) {
|
if ($table) {
|
||||||
$table.setAllTreeExpand(true)
|
$table.setAllTreeExpand(true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 300)
|
}, 300)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const dialogVisible = ref(false)
|
|||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
|
|
||||||
const open = (e: any) => {
|
const open = (e: any) => {
|
||||||
console.log("🚀 ~ open ~ e:", e)
|
//console.log("🚀 ~ open ~ e:", e)
|
||||||
echartsXq.value = {
|
echartsXq.value = {
|
||||||
title: {
|
title: {
|
||||||
text: e.name + '性能详情'
|
text: e.name + '性能详情'
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
:checkbox-config="{ labelField: 'name' }"
|
:checkbox-config="{ labelField: 'name' }"
|
||||||
>
|
>
|
||||||
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
||||||
<vxe-column field="ip" title="网络参数"></vxe-column>
|
<vxe-column field="ip" title="网络参数" width="120px"></vxe-column>
|
||||||
<vxe-column field="runFlag" title="终端状态" v-if="key == 0">
|
<vxe-column field="runFlag" title="终端状态" v-if="key == 0">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.runFlag === 0" type="success" size="small">投运</el-tag>
|
<el-tag v-if="row.runFlag === 0" type="success" size="small">投运</el-tag>
|
||||||
|
|||||||
@@ -1,282 +1,282 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main" style="position: relative">
|
<div class="default-main" style="position: relative">
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="终端型号">
|
<el-form-item label="终端型号">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="tableStore.table.params.devType"
|
v-model="tableStore.table.params.devType"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
placeholder="请选择终端型号"
|
placeholder="请选择终端型号"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminaloption"
|
v-for="item in teriminaloption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="终端状态">
|
<el-form-item label="终端状态">
|
||||||
<el-select v-model="tableStore.table.params.runFlag" clearable placeholder="请选择终端状态">
|
<el-select v-model="tableStore.table.params.runFlag" clearable placeholder="请选择终端状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminalstatusoption"
|
v-for="item in teriminalstatusoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通讯状态">
|
<el-form-item label="通讯状态">
|
||||||
<el-select v-model="tableStore.table.params.comFlag" clearable placeholder="请选择通讯状态">
|
<el-select v-model="tableStore.table.params.comFlag" clearable placeholder="请选择通讯状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in stateoption"
|
v-for="item in stateoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="tableStore.table.params.filterName"
|
v-model="tableStore.table.params.filterName"
|
||||||
@keyup="searchEvent"
|
@keyup="searchEvent"
|
||||||
clearable
|
clearable
|
||||||
placeholder="输入关键字筛选"
|
placeholder="输入关键字筛选"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button type="primary" icon="el-icon-DataLine" @click="manage('终端状态管理', 0)">
|
<el-button type="primary" icon="el-icon-DataLine" @click="manage('终端状态管理', 0)">
|
||||||
终端状态管理
|
终端状态管理
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button type="primary" icon="el-icon-Operation" @click="manage('流量套餐配置', 1)">
|
<!-- <el-button type="primary" icon="el-icon-Operation" @click="manage('流量套餐配置', 1)">
|
||||||
流量套餐配置
|
流量套餐配置
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<!-- <el-button type="primary" icon="el-icon-Menu" @click="manage('流量策略配置', 2)">
|
<!-- <el-button type="primary" icon="el-icon-Menu" @click="manage('流量策略配置', 2)">
|
||||||
流量策略配置
|
流量策略配置
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" icon="el-icon-Histogram" @click="liultjData">流量统计</el-button> -->
|
<el-button type="primary" icon="el-icon-Histogram" @click="liultjData">流量统计</el-button> -->
|
||||||
<!-- <el-button type="primary" icon="el-icon-Setting" @click="resect">重启前置程序</el-button> -->
|
<!-- <el-button type="primary" icon="el-icon-Setting" @click="resect">重启前置程序</el-button> -->
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||||
<vxe-table
|
<vxe-table
|
||||||
v-loading="tableStore.table.loading"
|
v-loading="tableStore.table.loading"
|
||||||
height="auto"
|
height="auto"
|
||||||
auto-resize
|
auto-resize
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
v-bind="defaultAttribute"
|
v-bind="defaultAttribute"
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
show-overflow
|
show-overflow
|
||||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||||
:scroll-y="{ enabled: true }"
|
:scroll-y="{ enabled: true }"
|
||||||
:checkbox-config="{ labelField: 'name' }"
|
:checkbox-config="{ labelField: 'name' }"
|
||||||
>
|
>
|
||||||
<vxe-column
|
<vxe-column
|
||||||
field="name"
|
field="name"
|
||||||
align="left"
|
align="left"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
title="电网拓扑"
|
title="电网拓扑"
|
||||||
min-width="200"
|
min-width="200"
|
||||||
tree-node
|
tree-node
|
||||||
></vxe-column>
|
></vxe-column>
|
||||||
<vxe-column field="devType" title="终端型号">
|
<vxe-column field="devType" title="终端型号">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ teriminaloption.find((item: any) => item.id === row.devType)?.name }}
|
{{ teriminaloption.find((item: any) => item.id === row.devType)?.name }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="version" title="版本信息"></vxe-column>
|
<vxe-column field="version" title="版本信息"></vxe-column>
|
||||||
<vxe-column field="ip" title="网络参数"></vxe-column>
|
<vxe-column field="ip" title="网络参数" width="120px"></vxe-column>
|
||||||
|
|
||||||
<vxe-column field="runFlag" title="终端状态">
|
<vxe-column field="runFlag" title="终端状态">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.runFlag === 0" type="success" :disable-transitions="true" size="small">投运</el-tag>
|
<el-tag v-if="row.runFlag === 0" type="success" :disable-transitions="true" size="small">投运</el-tag>
|
||||||
<el-tag v-if="row.runFlag === 1" type="warning" :disable-transitions="true" size="small">检修</el-tag>
|
<el-tag v-if="row.runFlag === 1" type="warning" :disable-transitions="true" size="small">检修</el-tag>
|
||||||
<el-tag v-if="row.runFlag === 2" type="danger" :disable-transitions="true" size="small">停运</el-tag>
|
<el-tag v-if="row.runFlag === 2" type="danger" :disable-transitions="true" size="small">停运</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="comFlag" title="通讯状态">
|
<vxe-column field="comFlag" title="通讯状态">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.comFlag === 0" type="danger" :disable-transitions="true" size="small">中断</el-tag>
|
<el-tag v-if="row.comFlag === 0" type="danger" :disable-transitions="true" size="small">中断</el-tag>
|
||||||
<el-tag v-if="row.comFlag === 1" type="success" :disable-transitions="true" size="small">正常</el-tag>
|
<el-tag v-if="row.comFlag === 1" type="success" :disable-transitions="true" size="small">正常</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column title="操作" width="160">
|
<vxe-column title="操作" width="160">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<!-- <el-button v-if="row.level === 4" type="primary" size="small" link @click="uesdealia(row)">
|
<!-- <el-button v-if="row.level === 4" type="primary" size="small" link @click="uesdealia(row)">
|
||||||
终端详情
|
终端详情
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<el-button v-if="row.level === 4" type="primary" size="small" link @click="log(row)">
|
<el-button v-if="row.level === 4" type="primary" size="small" link @click="log(row)">
|
||||||
查看日志
|
查看日志
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
</vxe-table>
|
</vxe-table>
|
||||||
</div>
|
</div>
|
||||||
<!-- 终端详情 -->
|
<!-- 终端详情 -->
|
||||||
<detail ref="detailRef" />
|
<detail ref="detailRef" />
|
||||||
<!-- 配置 -->
|
<!-- 配置 -->
|
||||||
<disposition ref="dispositionRef" @onSubmit="tableStore.index()" />
|
<disposition ref="dispositionRef" @onSubmit="tableStore.index()" />
|
||||||
<!-- 日志 -->
|
<!-- 日志 -->
|
||||||
<Log ref="logRef" v-if="logFlag" @close="logFlag = false" />
|
<Log ref="logRef" v-if="logFlag" @close="logFlag = false" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, nextTick, reactive } from 'vue'
|
import { ref, onMounted, provide, nextTick, reactive } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
|
|
||||||
import disposition from './components/disposition.vue'
|
import disposition from './components/disposition.vue'
|
||||||
import detail from './components/detail.vue'
|
import detail from './components/detail.vue'
|
||||||
import Log from './components/log.vue'
|
import Log from './components/log.vue'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'BusinessAdministrator/TerminalManagement/TerminalManagement'
|
name: 'BusinessAdministrator/TerminalManagement/TerminalManagement'
|
||||||
})
|
})
|
||||||
const dispositionRef = ref()
|
const dispositionRef = ref()
|
||||||
const detailRef = ref()
|
const detailRef = ref()
|
||||||
const logRef = ref()
|
const logRef = ref()
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const logFlag = ref(false)
|
const logFlag = ref(false)
|
||||||
const teriminaloption: any = ref([])
|
const teriminaloption: any = ref([])
|
||||||
|
|
||||||
const teriminalstatusoption = ref([
|
const teriminalstatusoption = ref([
|
||||||
{ name: '全部', id: '' },
|
{ name: '全部', id: '' },
|
||||||
{ name: '投运', id: 0 },
|
{ name: '投运', id: 0 },
|
||||||
{ name: '检修', id: 1 },
|
{ name: '检修', id: 1 },
|
||||||
{ name: '停运', id: 2 }
|
{ name: '停运', id: 2 }
|
||||||
])
|
])
|
||||||
const stateoption = ref([
|
const stateoption = ref([
|
||||||
{ name: '全部', id: '' },
|
{ name: '全部', id: '' },
|
||||||
{ name: '正常', id: 1 },
|
{ name: '正常', id: 1 },
|
||||||
{ name: '中断', id: 0 }
|
{ name: '中断', id: 0 }
|
||||||
])
|
])
|
||||||
const treeData: any = ref([])
|
const treeData: any = ref([])
|
||||||
const treeDataCopy: any = ref([])
|
const treeDataCopy: any = ref([])
|
||||||
|
|
||||||
const tableRef = ref()
|
const tableRef = ref()
|
||||||
|
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/device-boot/maintain/getTerminalMainList',
|
url: '/device-boot/maintain/getTerminalMainList',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [],
|
column: [],
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||||
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tableRef.value.setAllTreeExpand(true)
|
tableRef.value.setAllTreeExpand(true)
|
||||||
}, 0)
|
}, 0)
|
||||||
searchEvent()
|
searchEvent()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.devType = ''
|
tableStore.table.params.devType = ''
|
||||||
tableStore.table.params.runFlag = ''
|
tableStore.table.params.runFlag = ''
|
||||||
tableStore.table.params.comFlag = ''
|
tableStore.table.params.comFlag = ''
|
||||||
tableStore.table.params.filterName = ''
|
tableStore.table.params.filterName = ''
|
||||||
// 处理大数据卡顿
|
// 处理大数据卡顿
|
||||||
const tree2List = (list: any, id: any) => {
|
const tree2List = (list: any, id: any) => {
|
||||||
//存储结果的数组
|
//存储结果的数组
|
||||||
let arr: any = []
|
let arr: any = []
|
||||||
// 遍历 tree 数组
|
// 遍历 tree 数组
|
||||||
list.forEach((item: any) => {
|
list.forEach((item: any) => {
|
||||||
item.uPid = id
|
item.uPid = id
|
||||||
item.uId = Math.random() * 1000
|
item.uId = Math.random() * 1000
|
||||||
|
|
||||||
// 判断item是否存在children
|
// 判断item是否存在children
|
||||||
if (!item.children) return arr.push(item)
|
if (!item.children) return arr.push(item)
|
||||||
// 函数递归,对children数组进行tree2List的转换
|
// 函数递归,对children数组进行tree2List的转换
|
||||||
const children = tree2List(item.children, item.uId)
|
const children = tree2List(item.children, item.uId)
|
||||||
// 删除item的children属性
|
// 删除item的children属性
|
||||||
delete item.children
|
delete item.children
|
||||||
// 把item和children数组添加至结果数组
|
// 把item和children数组添加至结果数组
|
||||||
//..children: 意思是把children数组展开
|
//..children: 意思是把children数组展开
|
||||||
arr.push(item, ...children)
|
arr.push(item, ...children)
|
||||||
})
|
})
|
||||||
// 返回结果数组
|
// 返回结果数组
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
tableStore.table.params.searchState = 0
|
tableStore.table.params.searchState = 0
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDevTypeList().then(res => {
|
getDevTypeList().then(res => {
|
||||||
teriminaloption.value = res.data
|
teriminaloption.value = res.data
|
||||||
})
|
})
|
||||||
|
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 终端状态管理
|
// 终端状态管理
|
||||||
const manage = (name: string, key: number) => {
|
const manage = (name: string, key: number) => {
|
||||||
const $table = tableRef.value
|
const $table = tableRef.value
|
||||||
if ($table) {
|
if ($table) {
|
||||||
const selectRecords = $table
|
const selectRecords = $table
|
||||||
.getCheckboxRecords()
|
.getCheckboxRecords()
|
||||||
.filter((item: any) => item.level == 4)
|
.filter((item: any) => item.level == 4)
|
||||||
.map(item => item.id)
|
.map(item => item.id)
|
||||||
console.log('🚀 ~ deviceData ~ selectRecords:', selectRecords)
|
//console.log('🚀 ~ deviceData ~ selectRecords:', selectRecords)
|
||||||
if (selectRecords.length == 0) {
|
if (selectRecords.length == 0) {
|
||||||
return ElMessage({
|
return ElMessage({
|
||||||
message: '请至少选择一台装置',
|
message: '请至少选择一台装置',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
dispositionRef.value.open({
|
dispositionRef.value.open({
|
||||||
title: name,
|
title: name,
|
||||||
id: selectRecords,
|
id: selectRecords,
|
||||||
key: key
|
key: key
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 流量统计
|
// 流量统计
|
||||||
const liultjData = () => {}
|
const liultjData = () => {}
|
||||||
// 重启前置程序
|
// 重启前置程序
|
||||||
const resect = () => {}
|
const resect = () => {}
|
||||||
|
|
||||||
// 终端详情
|
// 终端详情
|
||||||
const uesdealia = (row: any) => {
|
const uesdealia = (row: any) => {
|
||||||
detailRef.value.open(row)
|
detailRef.value.open(row)
|
||||||
}
|
}
|
||||||
// 流量详情
|
// 流量详情
|
||||||
const log = (row: any) => {
|
const log = (row: any) => {
|
||||||
logFlag.value = true
|
logFlag.value = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
logRef.value.open(row)
|
logRef.value.open(row)
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格过滤
|
// 表格过滤
|
||||||
const searchEvent = debounce(() => {
|
const searchEvent = debounce(() => {
|
||||||
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
||||||
if (filterVal) {
|
if (filterVal) {
|
||||||
const options = { children: 'children' }
|
const options = { children: 'children' }
|
||||||
const searchProps = ['name']
|
const searchProps = ['name']
|
||||||
const rest = XEUtils.searchTree(
|
const rest = XEUtils.searchTree(
|
||||||
treeDataCopy.value,
|
treeDataCopy.value,
|
||||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
treeData.value = rest
|
treeData.value = rest
|
||||||
|
|
||||||
// 搜索之后默认展开所有子节点
|
// 搜索之后默认展开所有子节点
|
||||||
} else {
|
} else {
|
||||||
treeData.value = treeDataCopy.value
|
treeData.value = treeDataCopy.value
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const $table = tableRef.value
|
const $table = tableRef.value
|
||||||
if ($table) {
|
if ($table) {
|
||||||
$table.setAllTreeExpand(true)
|
$table.setAllTreeExpand(true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -54,14 +54,17 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="right: 500px; position: absolute; overflow: hidden">
|
<el-form-item style="right: 500px; position: absolute; overflow: hidden">
|
||||||
<LocationInformation style="width: 16px; margin-right: 8px; color: var(--el-color-primary)" />
|
<LocationInformation
|
||||||
<span style="font-size: 16px; font-weight: bold; color: var(--el-color-primary)">当前操作节点:</span>
|
style="width: 16px; margin-right: 8px; color: var(--el-color-primary)"
|
||||||
|
/>
|
||||||
|
<span style="font-size: 16px; font-weight: bold; color: var(--el-color-primary)">
|
||||||
|
当前操作节点:
|
||||||
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="right: 0; position: absolute; overflow: hidden">
|
<el-form-item style="right: 0; position: absolute; overflow: hidden">
|
||||||
<div class="title" :class="titleList.length > 5 ? 'titleScroll' : ''">
|
<div class="title" :class="titleList.length > 5 ? 'titleScroll' : ''">
|
||||||
<span v-for="(item, index) in titleList">{{ index == 0 ? '' : ' > ' }}{{ item }}</span>
|
<span v-for="(item, index) in titleList">{{ index == 0 ? '' : ' > ' }}{{ item }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div id="scrollBox" :style="{ height: Height.height }" style="overflow-y: auto">
|
<div id="scrollBox" :style="{ height: Height.height }" style="overflow-y: auto">
|
||||||
@@ -1691,7 +1694,7 @@ import { useDictData } from '@/stores/dictData'
|
|||||||
import { ref, reactive, onMounted } from 'vue'
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { getYwZtSubstation } from '@/api/device-boot/device'
|
import { getYwZtSubstation } from '@/api/device-boot/device'
|
||||||
const size = ref(0)
|
const size = ref(19)
|
||||||
const TerminalRef = ref()
|
const TerminalRef = ref()
|
||||||
const pageHeight = mainHeight(20)
|
const pageHeight = mainHeight(20)
|
||||||
const Height = mainHeight(100)
|
const Height = mainHeight(100)
|
||||||
@@ -2024,12 +2027,12 @@ const latff: any = ref((rule: any, value: any, callback: any) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const plevel = ref(0)
|
const plevel = ref(0)
|
||||||
const nodeDataList=ref()
|
const nodeDataList = ref()
|
||||||
const nodeEventList=ref()
|
const nodeEventList = ref()
|
||||||
const nodeLevel1=ref(0)
|
const nodeLevel1 = ref(0)
|
||||||
const nodeClick = (e: anyObj, data: any) => {
|
const nodeClick = (e: anyObj, data: any) => {
|
||||||
nodeDataList.value = data
|
nodeDataList.value = data
|
||||||
nodeEventList.value = e
|
nodeEventList.value = e
|
||||||
plevel.value = data.data.plevel
|
plevel.value = data.data.plevel
|
||||||
treeClickCount.value++
|
treeClickCount.value++
|
||||||
if (treeClickCount.value > 2) return
|
if (treeClickCount.value > 2) return
|
||||||
@@ -2310,7 +2313,7 @@ const remove = () => {
|
|||||||
const next = async () => {
|
const next = async () => {
|
||||||
await mainForm.value.validate((valid: any) => {
|
await mainForm.value.validate((valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('🚀 ~ awaitmainForm.value.validate ~ nodeLevel.value:', nodeLevel.value)
|
// console.log('🚀 ~ awaitmainForm.value.validate ~ nodeLevel.value:', nodeLevel.value)
|
||||||
|
|
||||||
switch (nodeLevel.value) {
|
switch (nodeLevel.value) {
|
||||||
case 100:
|
case 100:
|
||||||
@@ -2338,7 +2341,9 @@ const next = async () => {
|
|||||||
break
|
break
|
||||||
case 600:
|
case 600:
|
||||||
addLine()
|
addLine()
|
||||||
selectChanged(AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[busBarIndex.value].scale)
|
selectChanged(
|
||||||
|
AddProjectBO.value.deviceParam[deviceIndex.value].subVoltageParam[busBarIndex.value].scale
|
||||||
|
)
|
||||||
nextfalg.value = false
|
nextfalg.value = false
|
||||||
break
|
break
|
||||||
case 700:
|
case 700:
|
||||||
@@ -2355,8 +2360,7 @@ const black = () => {
|
|||||||
busBarIndex.value = '0'
|
busBarIndex.value = '0'
|
||||||
deviceIndex.value = '0'
|
deviceIndex.value = '0'
|
||||||
lineIndex.value = '0'
|
lineIndex.value = '0'
|
||||||
nodeClick(nodeEventList.value,nodeDataList.value)
|
nodeClick(nodeEventList.value, nodeDataList.value)
|
||||||
|
|
||||||
}
|
}
|
||||||
// 确认提交
|
// 确认提交
|
||||||
const onsubmit = () => {
|
const onsubmit = () => {
|
||||||
@@ -3073,7 +3077,7 @@ const setDown = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
if (dom) {
|
if (dom) {
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
}
|
}
|
||||||
if (VITE_FLAG) {
|
if (VITE_FLAG) {
|
||||||
getYwZtSubstation({ orgId: '' }).then(res => {
|
getYwZtSubstation({ orgId: '' }).then(res => {
|
||||||
|
|||||||
@@ -1059,7 +1059,7 @@ const filterUsers = (arr: any) => {
|
|||||||
userTypeList.value = userTypeList.value.filter(item => !arr.includes(item.value))
|
userTypeList.value = userTypeList.value.filter(item => !arr.includes(item.value))
|
||||||
}
|
}
|
||||||
const setcontroFlag = () => {
|
const setcontroFlag = () => {
|
||||||
console.log(12333)
|
|
||||||
|
|
||||||
controFlag.value = true
|
controFlag.value = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
|
<div v-if="detailLoading" class="loading">
|
||||||
|
<el-spin description="加载中..." />
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
<el-descriptions :column="2" border>
|
<el-descriptions :column="2" border>
|
||||||
<el-descriptions-item label="所在地市">
|
<el-descriptions-item label="所在地市">
|
||||||
{{ detailData.city }}
|
{{ detailData.city }}
|
||||||
@@ -110,10 +114,7 @@
|
|||||||
>
|
>
|
||||||
{{ proviteData.agreementCapacity }}
|
{{ proviteData.agreementCapacity }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item
|
<el-descriptions-item label="装机容量(MW)">
|
||||||
label="装机容量(MW)"
|
|
||||||
|
|
||||||
>
|
|
||||||
{{ proviteData?.ratePower }}
|
{{ proviteData?.ratePower }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item
|
<el-descriptions-item
|
||||||
@@ -211,6 +212,7 @@
|
|||||||
}}
|
}}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -381,7 +383,7 @@ const preview = (val: any, url: any) => {
|
|||||||
}
|
}
|
||||||
//预测评估报告
|
//预测评估报告
|
||||||
if (val == 'predictionEvaluationReport') {
|
if (val == 'predictionEvaluationReport') {
|
||||||
console.log(url, '9999999')
|
|
||||||
predictionEvaluationReportRef?.value.open(url)
|
predictionEvaluationReportRef?.value.open(url)
|
||||||
}
|
}
|
||||||
//预测评估评审意见报告
|
//预测评估评审意见报告
|
||||||
@@ -485,7 +487,7 @@ const getProviteData = async () => {
|
|||||||
getFileNamePath(proviteData.value.additionalAttachments, 'additionalAttachments')
|
getFileNamePath(proviteData.value.additionalAttachments, 'additionalAttachments')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 入网评估报告
|
// 系统接入方案
|
||||||
if (detailData.value.netInReport.length > 0) {
|
if (detailData.value.netInReport.length > 0) {
|
||||||
netInReportList.value = []
|
netInReportList.value = []
|
||||||
detailData.value.netInReport.forEach((item: any) => {
|
detailData.value.netInReport.forEach((item: any) => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<TableHeader :showSearch="false" v-show="flag">
|
<TableHeader :showSearch="false" v-show="flag">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker
|
<DatePicker
|
||||||
ref="datePickerRef"
|
ref="datePickerRef"
|
||||||
:nextFlag="false"
|
:nextFlag="false"
|
||||||
@@ -181,7 +181,7 @@ const zoom = (value: any) => {
|
|||||||
component: registerComponent(item.path)
|
component: registerComponent(item.path)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
console.log('🚀 ~ zoom ~ layout.value:', layout.value)
|
// console.log('🚀 ~ zoom ~ layout.value:', layout.value)
|
||||||
|
|
||||||
flag.value = !flag.value
|
flag.value = !flag.value
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<TableHeader :showSearch="false">
|
<TableHeader :showSearch="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const tableStore = new TableStore({
|
|||||||
{ title: '事件描述', field: 'describe', align: 'center', showOverflow: true,minWidth: 200 },
|
{ title: '事件描述', field: 'describe', align: 'center', showOverflow: true,minWidth: 200 },
|
||||||
{ title: '事件类型', field: 'type', align: 'center', width: 160 },
|
{ title: '事件类型', field: 'type', align: 'center', width: 160 },
|
||||||
{ title: '操作结果', field: 'type', align: 'center', width: 100 },
|
{ title: '操作结果', field: 'type', align: 'center', width: 100 },
|
||||||
{ title: '操作IP', field: 'ip', align: 'center', width: 160 },
|
{ title: '操作IP', field: 'ip', align: 'center', width: 120 },
|
||||||
{ title: '事件等级', field: 'level', align: 'center', width: 100 }
|
{ title: '事件等级', field: 'level', align: 'center', width: 100 }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,96 +1,96 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="700px">
|
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="700px">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef">
|
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef">
|
||||||
<el-form-item label="上级名称">
|
<el-form-item label="上级名称">
|
||||||
<!-- <el-input v-model="form.pid" placeholder="上级名称" /> -->
|
<!-- <el-input v-model="form.pid" placeholder="上级名称" /> -->
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="form.pid"
|
v-model="form.pid"
|
||||||
:data="dataTree"
|
:data="dataTree"
|
||||||
check-strictly
|
check-strictly
|
||||||
clearable
|
clearable
|
||||||
default-expand-all
|
default-expand-all
|
||||||
:render-after-expand="false"
|
:render-after-expand="false"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="名称" />
|
<el-input v-model="form.name" placeholder="名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submit">确认</el-button>
|
<el-button type="primary" @click="submit">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, inject } from 'vue'
|
import { ref, inject } from 'vue'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { queryAllAlgorithmLibrary, addAlgorithm } from '@/api/supervision-boot/database/index'
|
import { queryAllAlgorithmLibrary, addAlgorithm } from '@/api/supervision-boot/database/index'
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const emit = defineEmits(['getTree'])
|
const emit = defineEmits(['getTree'])
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
// 注意不要和表单ref的命名冲突
|
// 注意不要和表单ref的命名冲突
|
||||||
const form = reactive<anyObj>({
|
const form = reactive<anyObj>({
|
||||||
name: '',
|
name: '',
|
||||||
pid: ''
|
pid: ''
|
||||||
})
|
})
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
value: 'id'
|
value: 'id'
|
||||||
}
|
}
|
||||||
const rules = {
|
const rules = {
|
||||||
name: [{ required: true, message: '请输入名称', trigger: 'blur' }]
|
name: [{ required: true, message: '请输入名称', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
const dataTree = ref([])
|
const dataTree = ref([])
|
||||||
const open = (text: string, data?: anyObj) => {
|
const open = (text: string, data?: anyObj) => {
|
||||||
getTheTree()
|
getTheTree()
|
||||||
title.value = text
|
title.value = text
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
if (data) {
|
if (data) {
|
||||||
// 表单赋值
|
// 表单赋值
|
||||||
for (let key in form) {
|
for (let key in form) {
|
||||||
form[key] = data[key]
|
form[key] = data[key]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 在此处恢复默认表单
|
// 在此处恢复默认表单
|
||||||
for (let key in form) {
|
for (let key in form) {
|
||||||
form[key] = ''
|
form[key] = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getTheTree = () => {
|
const getTheTree = () => {
|
||||||
queryAllAlgorithmLibrary().then(res => {
|
queryAllAlgorithmLibrary().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
item.children.forEach((item2: any) => {
|
item.children.forEach((item2: any) => {
|
||||||
item2.childrens = item2.children
|
item2.childrens = item2.children
|
||||||
item2.children = []
|
item2.children = []
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
dataTree.value = res.data
|
dataTree.value = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
formRef.value.validate(async (valid: boolean) => {
|
formRef.value.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
addAlgorithm({
|
addAlgorithm({
|
||||||
pid: form.pid.length == 0 ? '' : form.pid,
|
pid: form.pid.length == 0 ? '' : form.pid,
|
||||||
name: form.name
|
name: form.name
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
ElMessage.success('新增成功')
|
ElMessage.success('新增成功')
|
||||||
emit('getTree')
|
emit('getTree')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,190 +1,190 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="1200px">
|
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="1200px">
|
||||||
|
|
||||||
<el-form :model="form" label-width="120px" class="form-two" :rules="rules" ref="formRef">
|
<el-form :model="form" label-width="120px" class="form-two" :rules="rules" ref="formRef">
|
||||||
<el-form-item :label="title == '修改算法' ? '选择修改的数据' : '选择父级'" :prop="title == '修改算法' ? 'pid' : ''">
|
<el-form-item :label="title == '修改算法' ? '选择修改的数据' : '选择父级'" :prop="title == '修改算法' ? 'pid' : ''">
|
||||||
<el-tree-select v-model="form.pid" :data="dataTree" check-strictly clearable filterable
|
<el-tree-select v-model="form.pid" :data="dataTree" check-strictly clearable filterable
|
||||||
@node-click="changeTree" default-expand-all :render-after-expand="false" :props="defaultProps"
|
@node-click="changeTree" default-expand-all :render-after-expand="false" :props="defaultProps"
|
||||||
@clear="TreeList = {}" />
|
@clear="TreeList = {}" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="名称" prop="name" v-if="title == '修改算法' ? TreeList.level != 4 : TreeList.level != 3">
|
<el-form-item label="名称" prop="name" v-if="title == '修改算法' ? TreeList.level != 4 : TreeList.level != 3">
|
||||||
<el-input v-model="form.name" placeholder="名称" clearable maxlength="32" show-word-limit @input="handleInput('name', $event)"/>
|
<el-input v-model="form.name" placeholder="名称" clearable maxlength="32" show-word-limit @input="handleInput('name', $event)"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <div v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3"> -->
|
<!-- <div v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3"> -->
|
||||||
<el-form-item label="算法名称" prop="name" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
<el-form-item label="算法名称" prop="name" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
||||||
<el-input v-model="form.name" placeholder="请输入算法名称" clearable maxlength="32" show-word-limit @input="handleInput('name', $event)"/>
|
<el-input v-model="form.name" placeholder="请输入算法名称" clearable maxlength="32" show-word-limit @input="handleInput('name', $event)"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="计算周期" prop="period" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
<el-form-item label="计算周期" prop="period" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
||||||
<el-select v-model="form.period" placeholder="请选择计算周期" clearable>
|
<el-select v-model="form.period" placeholder="请选择计算周期" clearable>
|
||||||
<el-option v-for="item in cycle" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in cycle" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数据来源" prop="source" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
<el-form-item label="数据来源" prop="source" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
||||||
<el-input v-model="form.source" placeholder="请输入数据来源" clearable maxlength="32" show-word-limit @input="handleInput('source', $event)"/>
|
<el-input v-model="form.source" placeholder="请输入数据来源" clearable maxlength="32" show-word-limit @input="handleInput('source', $event)"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="定义" prop="definition" style="width: 100%;" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
<!-- <el-form-item label="定义" prop="definition" style="width: 100%;" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
||||||
|
|
||||||
<editor v-model="form.definition" />
|
<editor v-model="form.definition" />
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="display: flex" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
<div style="display: flex" v-if="title == '修改算法' ? TreeList.level == 4 : TreeList.level == 3">
|
||||||
<div style="width: 140px;margin-right: -20px;text-align: center;flex-shrink: 0;">定义</div>
|
<div style="width: 140px;margin-right: -20px;text-align: center;flex-shrink: 0;">定义</div>
|
||||||
<editor v-model="form.definition" />
|
<editor v-model="form.definition" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submit" v-loading="loading">确认</el-button>
|
<el-button type="primary" @click="submit" v-loading="loading">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, nextTick } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { queryAllAlgorithmLibrary, addAlgorithm, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
import { queryAllAlgorithmLibrary, addAlgorithm, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
import editor from '@/components/wangEditor/index.vue'
|
import editor from '@/components/wangEditor/index.vue'
|
||||||
const emit = defineEmits(['getTree'])
|
const emit = defineEmits(['getTree'])
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const dataTree = ref([])
|
const dataTree = ref([])
|
||||||
const key = ref(0)
|
const key = ref(0)
|
||||||
const TreeList: any = ref({})
|
const TreeList: any = ref({})
|
||||||
const List = ref({})
|
const List = ref({})
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
value: 'id'
|
value: 'id'
|
||||||
}
|
}
|
||||||
// 注意不要和表单ref的命名冲突
|
// 注意不要和表单ref的命名冲突
|
||||||
const form = reactive<anyObj>({
|
const form = reactive<anyObj>({
|
||||||
name: '',
|
name: '',
|
||||||
period: '',
|
period: '',
|
||||||
definition: '',
|
definition: '',
|
||||||
source: '',
|
source: '',
|
||||||
pid: ''
|
pid: ''
|
||||||
})
|
})
|
||||||
const rules = {
|
const rules = {
|
||||||
name: [{ required: true, message: '请输入算法名称', trigger: 'blur' }],
|
name: [{ required: true, message: '请输入算法名称', trigger: 'blur' }],
|
||||||
period: [{ required: true, message: '请选择计算周期', trigger: 'change' }],
|
period: [{ required: true, message: '请选择计算周期', trigger: 'change' }],
|
||||||
pid: [{ required: true, message: '请选择数据', trigger: 'change' }],
|
pid: [{ required: true, message: '请选择数据', trigger: 'change' }],
|
||||||
definition: [{ required: true, message: '请输入定义', trigger: 'blur' }],
|
definition: [{ required: true, message: '请输入定义', trigger: 'blur' }],
|
||||||
source: [{ required: true, message: '请输入数据来源', trigger: 'blur' }]
|
source: [{ required: true, message: '请输入数据来源', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
const cycle = [
|
const cycle = [
|
||||||
{ value: '0', label: '日' },
|
{ value: '0', label: '日' },
|
||||||
{ value: '1', label: '月' },
|
{ value: '1', label: '月' },
|
||||||
{ value: '2', label: '季' },
|
{ value: '2', label: '季' },
|
||||||
{ value: '3', label: '年' }
|
{ value: '3', label: '年' }
|
||||||
]
|
]
|
||||||
const changeTree = (row: any) => {
|
const changeTree = (row: any) => {
|
||||||
console.log("🚀 ~ changeTree ~ row:", row)
|
// console.log("🚀 ~ changeTree ~ row:", row)
|
||||||
TreeList.value = row
|
TreeList.value = row
|
||||||
if (title.value == '修改算法') {
|
if (title.value == '修改算法') {
|
||||||
if (row.level != 4) {
|
if (row.level != 4) {
|
||||||
form.name = row.name
|
form.name = row.name
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (let key in form) {
|
for (let key in form) {
|
||||||
form[key] = row[key]
|
form[key] = row[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
form.id = row.id
|
form.id = row.id
|
||||||
key.value += 1
|
key.value += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const open = (row: any) => {
|
const open = (row: any) => {
|
||||||
title.value = row.title
|
title.value = row.title
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
List.value = row.row
|
List.value = row.row
|
||||||
getTheTree()
|
getTheTree()
|
||||||
// 在此处恢复默认表单
|
// 在此处恢复默认表单
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
for (let key in form) {
|
for (let key in form) {
|
||||||
form[key] = ''
|
form[key] = ''
|
||||||
}
|
}
|
||||||
if (row.title == '修改算法') {
|
if (row.title == '修改算法') {
|
||||||
|
|
||||||
form.pid = row.row.id
|
form.pid = row.row.id
|
||||||
TreeList.value = row.row
|
TreeList.value = row.row
|
||||||
changeTree(row.row)
|
changeTree(row.row)
|
||||||
|
|
||||||
// row.row
|
// row.row
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
formRef.value.validate(async (valid: boolean) => {
|
formRef.value.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (title.value == '新增算法') {
|
if (title.value == '新增算法') {
|
||||||
let forms: any = {}
|
let forms: any = {}
|
||||||
if (TreeList.value.level == 3) {
|
if (TreeList.value.level == 3) {
|
||||||
forms = form
|
forms = form
|
||||||
} else {
|
} else {
|
||||||
forms.name = form.name
|
forms.name = form.name
|
||||||
forms.pid = form.pid
|
forms.pid = form.pid
|
||||||
}
|
}
|
||||||
await addAlgorithm(forms).then(res => {
|
await addAlgorithm(forms).then(res => {
|
||||||
ElMessage.success('新增成功')
|
ElMessage.success('新增成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('getTree')
|
emit('getTree')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let forms: any = {}
|
let forms: any = {}
|
||||||
if (TreeList.value.level == 4) {
|
if (TreeList.value.level == 4) {
|
||||||
forms = JSON.parse(JSON.stringify(form))
|
forms = JSON.parse(JSON.stringify(form))
|
||||||
} else {
|
} else {
|
||||||
forms.name = form.name
|
forms.name = form.name
|
||||||
forms.id = form.id
|
forms.id = form.id
|
||||||
}
|
}
|
||||||
forms.pid = null
|
forms.pid = null
|
||||||
await updateAlgorithmLibrary(forms).then(res => {
|
await updateAlgorithmLibrary(forms).then(res => {
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('getTree')
|
emit('getTree')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
await setTimeout(() => {
|
await setTimeout(() => {
|
||||||
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
const getTheTree = () => {
|
const getTheTree = () => {
|
||||||
queryAllAlgorithmLibrary().then(res => {
|
queryAllAlgorithmLibrary().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
item.children.forEach((item2: any) => {
|
item.children.forEach((item2: any) => {
|
||||||
item2.children.forEach((item3: any) => {
|
item2.children.forEach((item3: any) => {
|
||||||
if (title.value != '修改算法') {
|
if (title.value != '修改算法') {
|
||||||
item3.childrens = item3.children
|
item3.childrens = item3.children
|
||||||
item3.children = []
|
item3.children = []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
dataTree.value = res.data
|
dataTree.value = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleInput = (field: string, value: string) => {
|
const handleInput = (field: string, value: string) => {
|
||||||
// 过滤空格
|
// 过滤空格
|
||||||
const filteredValue = value.replace(/\s/g, '')
|
const filteredValue = value.replace(/\s/g, '')
|
||||||
if (filteredValue !== value) {
|
if (filteredValue !== value) {
|
||||||
form[field] = filteredValue
|
form[field] = filteredValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,341 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main" :style="height">
|
<div class="default-main">
|
||||||
<!-- 算法库 -->
|
<el-tabs v-model="activeName" type="border-card">
|
||||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
<el-tab-pane label="总览" name="1" v-if="tabList.includes('1')">
|
||||||
<pane :size="size">
|
<overview v-if="activeName == '1'" @algorithm="algorithm" />
|
||||||
<algorithmTree ref="treeRef" :default-expand-all="false"
|
</el-tab-pane>
|
||||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
<el-tab-pane label="算法库" name="2" v-if="tabList.includes('2')">
|
||||||
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
|
<list v-if="activeName == '2'" ref="listRef" />
|
||||||
@init="handleNodeClick" @onAddTree="onAddTree"></algorithmTree>
|
</el-tab-pane>
|
||||||
</pane>
|
</el-tabs>
|
||||||
<pane style="background: #fff" :style="height">
|
</div>
|
||||||
<div class="boxTop">
|
</template>
|
||||||
<div>
|
|
||||||
<el-radio-group v-model="radio">
|
<script setup lang="ts">
|
||||||
<el-radio-button v-for="(item, i) in dotList?.childrens" :label="item.name" :value="i" />
|
import { nextTick, ref, provide, onMounted } from 'vue'
|
||||||
</el-radio-group>
|
import { mainHeight } from '@/utils/layout'
|
||||||
</div>
|
import overview from './overview.vue'
|
||||||
<div v-if="information">
|
import list from './list.vue'
|
||||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser">
|
import { useRoute } from 'vue-router'
|
||||||
新增
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
</el-button>
|
const route = useRoute()
|
||||||
<el-button icon="el-icon-Edit" type="primary" @click="revise">修改</el-button>
|
const Undocumented = ref()
|
||||||
<el-button icon="el-icon-Delete" type="primary" @click="deletes">删除</el-button>
|
const InterferenceUserTable = ref()
|
||||||
</div>
|
defineOptions({
|
||||||
</div>
|
name: 'supervision/interferencemanagement '
|
||||||
|
})
|
||||||
<div :style="heightTab">
|
const activeName = ref('1')
|
||||||
<vxe-table height="auto" v-bind="defaultAttribute" :data="dotList?.childrens[radio]?.children">
|
const id = ref('')
|
||||||
<vxe-column field="name" title="算法名称"></vxe-column>
|
const key = ref('')
|
||||||
<vxe-column field="createTime" title="创建时间"></vxe-column>
|
const listRef = ref()
|
||||||
|
const tabList = ref(['1', '2'])
|
||||||
<vxe-column field="period" title="计算周期">
|
onMounted(() => {
|
||||||
<template #default="{ row }">
|
let key = window.location.href.split('?')[0].slice(-1)
|
||||||
{{
|
const isNumber = /^\d$/.test(key)
|
||||||
row.period == 0
|
if (isNumber) {
|
||||||
? '日'
|
tabList.value = [key]
|
||||||
: row.period == 1
|
activeName.value = key
|
||||||
? '月'
|
}
|
||||||
: row.period == 2
|
})
|
||||||
? '季'
|
const algorithm = (val: any) => {
|
||||||
: row.period == 3
|
activeName.value = '2'
|
||||||
? '年'
|
setTimeout(() => {
|
||||||
: ''
|
listRef.value.getList(val)
|
||||||
}}
|
}, 100)
|
||||||
</template>
|
}
|
||||||
</vxe-column>
|
const layout = mainHeight(63) as any
|
||||||
<vxe-column field="source" title="数据来源"></vxe-column>
|
</script>
|
||||||
<!-- <vxe-column field="useFLag" title="是否启用">
|
|
||||||
<template #default="{ row }">
|
<style lang="scss" scoped>
|
||||||
<el-tag :type="row.useFLag === 1 ? 'success' : 'info'" effect="dark"
|
.bars_w {
|
||||||
style="cursor: pointer" @click="change(row)">
|
width: 100%;
|
||||||
{{ row.useFLag === 1 ? '是' : '否' }}
|
height: 500px;
|
||||||
</el-tag>
|
}
|
||||||
</template>
|
|
||||||
</vxe-column> -->
|
:deep(.el-tabs__content) {
|
||||||
<vxe-column field="definition" title="定义">
|
height: v-bind('layout.height');
|
||||||
<template #default="{ row }">
|
overflow-y: auto;
|
||||||
|
}
|
||||||
<el-button type="primary" link @click="view(row)">查看</el-button>
|
</style>
|
||||||
</template>
|
|
||||||
|
|
||||||
</vxe-column>
|
|
||||||
<!-- <vxe-column title="操作" width="150px">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-button type="primary" link @click="edit(row)">修改</el-button>
|
|
||||||
<el-button type="danger" link @click="del(row)">删除</el-button>
|
|
||||||
<el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="del(row)">
|
|
||||||
<template #reference>
|
|
||||||
<el-button type="danger" link>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-popconfirm>
|
|
||||||
</template>
|
|
||||||
</vxe-column> -->
|
|
||||||
</vxe-table>
|
|
||||||
</div>
|
|
||||||
</pane>
|
|
||||||
</splitpanes>
|
|
||||||
<!-- 树弹框 -->
|
|
||||||
<addTree ref="addTreeRef" @getTree="treeRef.loadData(dotList.id)" />
|
|
||||||
<!-- 弹框 -->
|
|
||||||
<PopupEdit ref="popupEditRef" v-if="popupEditFlag"
|
|
||||||
@getTree="treeRef.loadData(dotList.id), (popupEditFlag = false)" />
|
|
||||||
<!-- 定义 -->
|
|
||||||
<el-dialog draggable v-model="viewFlag" title="定义" width="60%">
|
|
||||||
<div style="min-height: 300px; max-height: 55vh;">
|
|
||||||
<div class="editor" ref="editorRef" v-html="summary" />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
<!-- 删除 -->
|
|
||||||
<el-dialog draggable v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
|
||||||
<el-tree-select v-model="TreeValue" :data="TreeData" filterable check-strictly :props="defaultProps"
|
|
||||||
default-expand-all :render-after-expand="false" />
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
|
||||||
<el-button type="primary" @click="del">删除</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { onMounted, ref, provide } from 'vue'
|
|
||||||
import 'splitpanes/dist/splitpanes.css'
|
|
||||||
import { Splitpanes, Pane } from 'splitpanes'
|
|
||||||
import algorithmTree from '@/components/tree/pqs/algorithmTree.vue'
|
|
||||||
import { mainHeight } from '@/utils/layout'
|
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
|
||||||
import { getLineExport, getList, selectReleation } from '@/api/event-boot/report'
|
|
||||||
import addTree from './components/addTree.vue'
|
|
||||||
import PopupEdit from './components/form.vue'
|
|
||||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
||||||
import { deleteyById } from '@/api/supervision-boot/database/index'
|
|
||||||
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
|
||||||
import katex from "katex";
|
|
||||||
import "katex/dist/katex.css";
|
|
||||||
const adminInfo = useAdminInfo()
|
|
||||||
defineOptions({
|
|
||||||
name: 'database/algorithm'
|
|
||||||
})
|
|
||||||
const monitoringPoint = useMonitoringPoint()
|
|
||||||
const height = mainHeight(20)
|
|
||||||
const heightTab = mainHeight(82)
|
|
||||||
const size = ref(0)
|
|
||||||
const addTreeRef = ref()
|
|
||||||
const editorRef = ref()
|
|
||||||
const dialogVisible = ref(false)
|
|
||||||
const viewFlag = ref(false)
|
|
||||||
const popupEditFlag = ref(false)
|
|
||||||
const treeRef = ref()
|
|
||||||
const summary = ref('')
|
|
||||||
const popupEditRef = ref()
|
|
||||||
const TreeData = ref([])
|
|
||||||
const TreeValue = ref([])
|
|
||||||
const information = adminInfo.roleCode.includes('information_info')
|
|
||||||
|
|
||||||
const defaultProps = {
|
|
||||||
label: 'name',
|
|
||||||
value: 'id'
|
|
||||||
}
|
|
||||||
const dotList: any = ref()
|
|
||||||
|
|
||||||
const templatePolicy: any = ref([])
|
|
||||||
// const tableStore = new TableStore({
|
|
||||||
// url: '/supervision-boot/libalgorithm/queryAllAlgorithmLibrary',
|
|
||||||
// method: 'GET',
|
|
||||||
// column: [
|
|
||||||
// { title: '算法名称', field: 'name' },
|
|
||||||
// {
|
|
||||||
// title: '定义',
|
|
||||||
// field: 'name1'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '计算公式',
|
|
||||||
// field: 'name2'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '计算周期',
|
|
||||||
// field: 'name3'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '数据来源',
|
|
||||||
// field: 'name4'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: '是否启用',
|
|
||||||
// field: 'name5',
|
|
||||||
// render: 'tag',
|
|
||||||
// effect: 'dark',
|
|
||||||
// custom: {
|
|
||||||
// 0: 'info',
|
|
||||||
// 1: 'success'
|
|
||||||
// },
|
|
||||||
// replaceValue: {
|
|
||||||
// 0: '否',
|
|
||||||
// 1: '是'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ],
|
|
||||||
// loadCallback: () => {}
|
|
||||||
// })
|
|
||||||
const radio = ref(0)
|
|
||||||
|
|
||||||
// 新增弹框
|
|
||||||
const addUser = () => {
|
|
||||||
popupEditFlag.value = true
|
|
||||||
setTimeout(() => {
|
|
||||||
popupEditRef.value.open({
|
|
||||||
title: '新增算法'
|
|
||||||
})
|
|
||||||
}, 100)
|
|
||||||
}
|
|
||||||
// 修改弹框
|
|
||||||
const revise = () => {
|
|
||||||
popupEditFlag.value = true
|
|
||||||
setTimeout(() => {
|
|
||||||
popupEditRef.value.open({
|
|
||||||
title: '修改算法',
|
|
||||||
row: dotList.value
|
|
||||||
})
|
|
||||||
}, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
|
||||||
if (dom) {
|
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
|
||||||
}
|
|
||||||
// tableStore.index()
|
|
||||||
})
|
|
||||||
|
|
||||||
const view = (row: any) => {
|
|
||||||
|
|
||||||
viewFlag.value = true
|
|
||||||
summary.value = row.definition
|
|
||||||
setTimeout(() => {
|
|
||||||
|
|
||||||
const spans = document.querySelectorAll('span[data-value]');
|
|
||||||
// 遍历每个 span 标签
|
|
||||||
spans.forEach(function (span) {
|
|
||||||
|
|
||||||
let val = katex.renderToString(span.getAttribute('data-value'), {
|
|
||||||
throwOnError: false,
|
|
||||||
})
|
|
||||||
// var newDiv = document.createElement('div');
|
|
||||||
var newDiv = span
|
|
||||||
newDiv.innerHTML = val;
|
|
||||||
|
|
||||||
span.parentNode.replaceChild(newDiv, span);
|
|
||||||
});
|
|
||||||
|
|
||||||
}, 100)
|
|
||||||
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
|
||||||
if (data.pid != '0') {
|
|
||||||
dotList.value = data
|
|
||||||
radio.value = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const onAddTree = () => {
|
|
||||||
addTreeRef.value.open('新增')
|
|
||||||
}
|
|
||||||
const deletes = () => {
|
|
||||||
TreeValue.value = []
|
|
||||||
queryAllAlgorithmLibrary().then(res => {
|
|
||||||
TreeData.value = res.data
|
|
||||||
})
|
|
||||||
dialogVisible.value = true
|
|
||||||
}
|
|
||||||
// 删除
|
|
||||||
const del = () => {
|
|
||||||
if (TreeValue.value.length == 0) {
|
|
||||||
return ElMessage.warning('请选择数据')
|
|
||||||
}
|
|
||||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
deleteyById({ id: TreeValue.value }).then(res => {
|
|
||||||
ElMessage.success('删除成功')
|
|
||||||
dialogVisible.value = false
|
|
||||||
treeRef.value.loadData()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// if (TreeValue.value.length > 0) {
|
|
||||||
// ElMessage.warning('请选择数据')
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
// 启用
|
|
||||||
const change = (row: any) => {
|
|
||||||
console.log('🚀 ~ change ~ row:', row)
|
|
||||||
ElMessageBox.confirm(`请确认是否${row.useFLag == 0 ? '启用' : '关闭'}算法?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
updateAlgorithmLibrary({ ...row, useFLag: row.useFLag == 0 ? 1 : 0 }).then(res => {
|
|
||||||
ElMessage.success(row.useFLag == 0 ? '启用' : '关闭' + '成功')
|
|
||||||
treeRef.value.loadData(dotList.value.id)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
.splitpanes.default-theme .splitpanes__pane {
|
|
||||||
background: #eaeef1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid-content {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-divider--horizontal {
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mTop {
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boxTop {
|
|
||||||
height: 52px;
|
|
||||||
padding: 10px 10px 10px 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor {
|
|
||||||
table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
th,
|
|
||||||
td {
|
|
||||||
border: 1px solid black;
|
|
||||||
padding: 8px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
359
src/views/pqs/database/algorithm/list.vue
Normal file
359
src/views/pqs/database/algorithm/list.vue
Normal file
@@ -0,0 +1,359 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main" :style="height">
|
||||||
|
<!-- 算法库 -->
|
||||||
|
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||||
|
<pane :size="size">
|
||||||
|
<algorithmTree
|
||||||
|
ref="treeRef"
|
||||||
|
:default-expand-all="false"
|
||||||
|
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||||
|
:current-node-key="monitoringPoint.state.lineId"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
@init="handleNodeClick"
|
||||||
|
@onAddTree="onAddTree"
|
||||||
|
></algorithmTree>
|
||||||
|
</pane>
|
||||||
|
<pane style="background: #fff; width: 100%" :style="height">
|
||||||
|
<div class="boxTop">
|
||||||
|
<div>
|
||||||
|
<el-radio-group v-model="radio">
|
||||||
|
<el-radio-button v-for="(item, i) in dotList?.childrens" :label="item.name" :value="i" />
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
<div v-if="information">
|
||||||
|
<el-button icon="el-icon-Plus" type="primary" @click="addUser">新增</el-button>
|
||||||
|
<el-button icon="el-icon-Edit" type="primary" @click="revise">修改</el-button>
|
||||||
|
<el-button icon="el-icon-Delete" type="primary" @click="deletes">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div :style="heightTab">
|
||||||
|
<vxe-table height="auto" v-bind="defaultAttribute" :data="dotList?.childrens[radio]?.children">
|
||||||
|
<vxe-column field="name" title="算法名称"></vxe-column>
|
||||||
|
<vxe-column field="createTime" title="创建时间"></vxe-column>
|
||||||
|
|
||||||
|
<vxe-column field="period" title="计算周期">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{
|
||||||
|
row.period == 0
|
||||||
|
? '日'
|
||||||
|
: row.period == 1
|
||||||
|
? '月'
|
||||||
|
: row.period == 2
|
||||||
|
? '季'
|
||||||
|
: row.period == 3
|
||||||
|
? '年'
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="source" title="数据来源"></vxe-column>
|
||||||
|
<!-- <vxe-column field="useFLag" title="是否启用">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tag :type="row.useFLag === 1 ? 'success' : 'info'" effect="dark"
|
||||||
|
style="cursor: pointer" @click="change(row)">
|
||||||
|
{{ row.useFLag === 1 ? '是' : '否' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</vxe-column> -->
|
||||||
|
<vxe-column field="definition" title="定义">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="primary" link @click="view(row)">查看</el-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<!-- <vxe-column title="操作" width="150px">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="primary" link @click="edit(row)">修改</el-button>
|
||||||
|
<el-button type="danger" link @click="del(row)">删除</el-button>
|
||||||
|
<el-popconfirm title="确定删除吗?" confirm-button-type='danger' @confirm="del(row)">
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="danger" link>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</vxe-column> -->
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
</pane>
|
||||||
|
</splitpanes>
|
||||||
|
<!-- 树弹框 -->
|
||||||
|
<addTree ref="addTreeRef" @getTree="treeRef.loadData(dotList.id)" />
|
||||||
|
<!-- 弹框 -->
|
||||||
|
<PopupEdit
|
||||||
|
ref="popupEditRef"
|
||||||
|
v-if="popupEditFlag"
|
||||||
|
@getTree="treeRef.loadData(dotList.id), (popupEditFlag = false)"
|
||||||
|
/>
|
||||||
|
<!-- 定义 -->
|
||||||
|
<el-dialog draggable v-model="viewFlag" title="定义" width="60%">
|
||||||
|
<div style="min-height: 300px; max-height: 55vh">
|
||||||
|
<div class="editor" ref="editorRef" v-html="summary" />
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 删除 -->
|
||||||
|
<el-dialog draggable v-model="dialogVisible" title="请选择需要删除的数据" width="400">
|
||||||
|
<el-tree-select
|
||||||
|
v-model="TreeValue"
|
||||||
|
:data="TreeData"
|
||||||
|
filterable
|
||||||
|
check-strictly
|
||||||
|
:props="defaultProps"
|
||||||
|
default-expand-all
|
||||||
|
:render-after-expand="false"
|
||||||
|
/>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="del">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref, provide, nextTick } from 'vue'
|
||||||
|
import 'splitpanes/dist/splitpanes.css'
|
||||||
|
import { Splitpanes, Pane } from 'splitpanes'
|
||||||
|
import algorithmTree from '@/components/tree/pqs/algorithmTree.vue'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
import { getLineExport, selectReleation } from '@/api/event-boot/report'
|
||||||
|
import addTree from './components/addTree.vue'
|
||||||
|
import PopupEdit from './components/form.vue'
|
||||||
|
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { deleteyById } from '@/api/supervision-boot/database/index'
|
||||||
|
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import katex from 'katex'
|
||||||
|
import 'katex/dist/katex.css'
|
||||||
|
const adminInfo = useAdminInfo()
|
||||||
|
defineOptions({
|
||||||
|
name: 'database/algorithm'
|
||||||
|
})
|
||||||
|
const monitoringPoint = useMonitoringPoint()
|
||||||
|
const height = mainHeight(20)
|
||||||
|
const heightTab = mainHeight(82)
|
||||||
|
const size = ref(19)
|
||||||
|
const addTreeRef = ref()
|
||||||
|
const editorRef = ref()
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const viewFlag = ref(false)
|
||||||
|
const popupEditFlag = ref(false)
|
||||||
|
const treeRef = ref()
|
||||||
|
const summary = ref('')
|
||||||
|
const popupEditRef = ref()
|
||||||
|
const TreeData = ref([])
|
||||||
|
const TreeValue = ref([])
|
||||||
|
const information = adminInfo.roleCode.includes('information_info')
|
||||||
|
|
||||||
|
const defaultProps = {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id'
|
||||||
|
}
|
||||||
|
const dotList: any = ref()
|
||||||
|
|
||||||
|
const templatePolicy: any = ref([])
|
||||||
|
// const tableStore = new TableStore({
|
||||||
|
// url: '/supervision-boot/libalgorithm/queryAllAlgorithmLibrary',
|
||||||
|
// method: 'GET',
|
||||||
|
// column: [
|
||||||
|
// { title: '算法名称', field: 'name' },
|
||||||
|
// {
|
||||||
|
// title: '定义',
|
||||||
|
// field: 'name1'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '计算公式',
|
||||||
|
// field: 'name2'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '计算周期',
|
||||||
|
// field: 'name3'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '数据来源',
|
||||||
|
// field: 'name4'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '是否启用',
|
||||||
|
// field: 'name5',
|
||||||
|
// render: 'tag',
|
||||||
|
// effect: 'dark',
|
||||||
|
// custom: {
|
||||||
|
// 0: 'info',
|
||||||
|
// 1: 'success'
|
||||||
|
// },
|
||||||
|
// replaceValue: {
|
||||||
|
// 0: '否',
|
||||||
|
// 1: '是'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
// loadCallback: () => {}
|
||||||
|
// })
|
||||||
|
const radio = ref(0)
|
||||||
|
|
||||||
|
// 新增弹框
|
||||||
|
const addUser = () => {
|
||||||
|
popupEditFlag.value = true
|
||||||
|
setTimeout(() => {
|
||||||
|
popupEditRef.value.open({
|
||||||
|
title: '新增算法'
|
||||||
|
})
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
// 修改弹框
|
||||||
|
const revise = () => {
|
||||||
|
popupEditFlag.value = true
|
||||||
|
setTimeout(() => {
|
||||||
|
popupEditRef.value.open({
|
||||||
|
title: '修改算法',
|
||||||
|
row: dotList.value
|
||||||
|
})
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
|
if (dom) {
|
||||||
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
|
}
|
||||||
|
// tableStore.index()
|
||||||
|
})
|
||||||
|
|
||||||
|
const view = (row: any) => {
|
||||||
|
viewFlag.value = true
|
||||||
|
summary.value = row.definition
|
||||||
|
setTimeout(() => {
|
||||||
|
const spans = document.querySelectorAll('span[data-value]')
|
||||||
|
// 遍历每个 span 标签
|
||||||
|
spans.forEach(function (span) {
|
||||||
|
let val = katex.renderToString(span.getAttribute('data-value'), {
|
||||||
|
throwOnError: false
|
||||||
|
})
|
||||||
|
// var newDiv = document.createElement('div');
|
||||||
|
var newDiv = span
|
||||||
|
newDiv.innerHTML = val
|
||||||
|
|
||||||
|
span.parentNode.replaceChild(newDiv, span)
|
||||||
|
})
|
||||||
|
}, 100)
|
||||||
|
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
|
if (data.pid != '0') {
|
||||||
|
dotList.value = data
|
||||||
|
radio.value = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const onAddTree = () => {
|
||||||
|
addTreeRef.value.open('新增')
|
||||||
|
}
|
||||||
|
const deletes = () => {
|
||||||
|
TreeValue.value = []
|
||||||
|
queryAllAlgorithmLibrary().then(res => {
|
||||||
|
TreeData.value = res.data
|
||||||
|
})
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
// 删除
|
||||||
|
const del = () => {
|
||||||
|
if (TreeValue.value.length == 0) {
|
||||||
|
return ElMessage.warning('请选择数据')
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
deleteyById({ id: TreeValue.value }).then(res => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
dialogVisible.value = false
|
||||||
|
treeRef.value.loadData()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// if (TreeValue.value.length > 0) {
|
||||||
|
// ElMessage.warning('请选择数据')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
// 启用
|
||||||
|
const change = (row: any) => {
|
||||||
|
console.log('🚀 ~ change ~ row:', row)
|
||||||
|
ElMessageBox.confirm(`请确认是否${row.useFLag == 0 ? '启用' : '关闭'}算法?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
updateAlgorithmLibrary({ ...row, useFLag: row.useFLag == 0 ? 1 : 0 }).then(res => {
|
||||||
|
ElMessage.success(row.useFLag == 0 ? '启用' : '关闭' + '成功')
|
||||||
|
treeRef.value.loadData(dotList.value.id)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const getList = (val: any) => {
|
||||||
|
setTimeout(async () => {
|
||||||
|
dotList.value = await treeRef.value.setKey(val.data.pid)
|
||||||
|
await dotList.value?.childrens.forEach((item: any, i: number) => {
|
||||||
|
if (item.id == val.data.id) {
|
||||||
|
radio.value = i
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
getList
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.splitpanes.default-theme .splitpanes__pane {
|
||||||
|
background: #eaeef1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-content {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-divider--horizontal {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mTop {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxTop {
|
||||||
|
height: 52px;
|
||||||
|
padding: 10px 10px 10px 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor {
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 8px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
196
src/views/pqs/database/algorithm/overview.vue
Normal file
196
src/views/pqs/database/algorithm/overview.vue
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main pt50" :style="height">
|
||||||
|
<!-- 算法库 -->
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
<MyEchart :options="echartList" style="width: 100%" :style="height" @echart-click="echartClick"></MyEchart>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref, provide } from 'vue'
|
||||||
|
import 'splitpanes/dist/splitpanes.css'
|
||||||
|
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { queryAllAlgorithmLibrary, updateAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import 'katex/dist/katex.css'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
const router = useRouter()
|
||||||
|
const config = useConfig()
|
||||||
|
const adminInfo = useAdminInfo()
|
||||||
|
defineOptions({
|
||||||
|
name: 'database/algorithm'
|
||||||
|
})
|
||||||
|
const emits = defineEmits(['algorithm'])
|
||||||
|
const height = mainHeight(20)
|
||||||
|
const size = ref(19)
|
||||||
|
|
||||||
|
const popupEditFlag = ref(false)
|
||||||
|
|
||||||
|
const popupEditRef = ref()
|
||||||
|
const TreeList: any = ref([])
|
||||||
|
|
||||||
|
const echartList = ref({})
|
||||||
|
|
||||||
|
const dotList: any = ref()
|
||||||
|
|
||||||
|
const radio = ref(0)
|
||||||
|
|
||||||
|
// 新增弹框
|
||||||
|
const addUser = () => {
|
||||||
|
popupEditFlag.value = true
|
||||||
|
setTimeout(() => {
|
||||||
|
popupEditRef.value.open({
|
||||||
|
title: '新增算法'
|
||||||
|
})
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
|
if (dom) {
|
||||||
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
|
}
|
||||||
|
info()
|
||||||
|
// tableStore.index()
|
||||||
|
})
|
||||||
|
|
||||||
|
const info = () => {
|
||||||
|
queryAllAlgorithmLibrary().then(async res => {
|
||||||
|
TreeList.value = await setTreeAllNodeExpand([
|
||||||
|
{
|
||||||
|
name: '算法库',
|
||||||
|
level: 0,
|
||||||
|
children: res.data
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
echartList.value = {
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
type: 'tree',
|
||||||
|
data: TreeList.value,
|
||||||
|
top: '20',
|
||||||
|
bottom: '40',
|
||||||
|
left: '20',
|
||||||
|
symbolSize: 7,
|
||||||
|
label: {
|
||||||
|
position: 'left',
|
||||||
|
verticalAlign: 'middle',
|
||||||
|
align: 'left',
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: 600,
|
||||||
|
backgroundColor: config.layout.elementUiPrimary[0],
|
||||||
|
color: '#fff',
|
||||||
|
borderRadius: 5,
|
||||||
|
formatter: function (params) {
|
||||||
|
return [`{name|${params.data.name}}`]
|
||||||
|
},
|
||||||
|
rich: {
|
||||||
|
name: {
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: 'bold',
|
||||||
|
padding: [10, 10]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
leaves: {
|
||||||
|
label: {
|
||||||
|
position: 'left',
|
||||||
|
verticalAlign: 'middle',
|
||||||
|
fontWeight: 600,
|
||||||
|
align: 'left'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
edgeShape: 'polyline', // 折线连接线
|
||||||
|
roam: true, // 可移动,可缩放
|
||||||
|
expandAndCollapse: false,
|
||||||
|
animationDuration: 550,
|
||||||
|
animationDurationUpdate: 750
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 点击echart
|
||||||
|
const echartClick = (params: any) => {
|
||||||
|
if(params.data.level == 3){
|
||||||
|
emits('algorithm', params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const setTreeAllNodeExpand = (treeData: any) => {
|
||||||
|
if (!treeData) return []
|
||||||
|
// 兼容单对象/数组两种树数据格式
|
||||||
|
const data = Array.isArray(treeData) ? treeData : [treeData]
|
||||||
|
return data.map(node => {
|
||||||
|
// 深拷贝节点,彻底隔离原数据
|
||||||
|
const newNode = {
|
||||||
|
...node,
|
||||||
|
collapsed: node.level <= 2 ? false : true // 强制添加展开属性
|
||||||
|
}
|
||||||
|
// 递归处理子节点
|
||||||
|
if (node.children && node.children.length > 0) {
|
||||||
|
newNode.children = setTreeAllNodeExpand(node.children)
|
||||||
|
}
|
||||||
|
return newNode
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.splitpanes.default-theme .splitpanes__pane {
|
||||||
|
background: #eaeef1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-content {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-divider--horizontal {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mTop {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxTop {
|
||||||
|
height: 52px;
|
||||||
|
padding: 10px 10px 10px 0;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor {
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
border: 1px solid black;
|
||||||
|
padding: 8px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -50,6 +50,7 @@ import { ref, reactive } from 'vue'
|
|||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||||
import { Download, View } from '@element-plus/icons-vue'
|
import { Download, View } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const tableData: any = ref({
|
const tableData: any = ref({
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<el-drawer v-model="drawer" size="60%">
|
<el-drawer v-model="drawer" size="60%">
|
||||||
<div class="box mt20">
|
<div class="box mt20">
|
||||||
<el-upload :show-file-list="false" action="" :auto-upload="false" class="ml10" :on-change="choose"
|
<el-upload :show-file-list="false" action="" :auto-upload="false" class="ml10" :on-change="choose"
|
||||||
v-if="information">
|
v-if="information" >
|
||||||
<el-button icon="el-icon-Top" type="primary">上传常见治理措施</el-button>
|
<el-button icon="el-icon-Top" type="primary">上传常见治理措施</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-button icon="el-icon-Download" type="primary" class="ml10" @click="downloadTheReport">
|
<el-button icon="el-icon-Download" type="primary" class="ml10" @click="downloadTheReport">
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
<el-collapse-item title="国家电网有限公司企业标准" name="2">
|
<el-collapse-item title="国家电网有限公司企业标准" name="2">
|
||||||
<!-- <el-empty description="暂无数据" class="custom-empty iframe" /> -->
|
<!-- <el-empty description="暂无数据" class="custom-empty iframe" /> -->
|
||||||
<div :style="`overflow: auto;`" class="iframe">
|
<div :style="`overflow: auto;`" class="iframe">
|
||||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url"
|
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.includes('.xlsx')" :src="url"
|
||||||
:options="excelOptions" />
|
:options="excelOptions" />
|
||||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url" /> -->
|
<!-- <vue-office-pdf v-if="urlKey.includes('.pdf')" :src="url" /> -->
|
||||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||||
<img v-if="
|
<img v-if="
|
||||||
url.includes('.png') ||
|
urlKey.includes('.png') ||
|
||||||
url.includes('.jpg') ||
|
urlKey.includes('.jpg') ||
|
||||||
url.includes('.gif') ||
|
urlKey.includes('.gif') ||
|
||||||
url.includes('.bmp')
|
urlKey.includes('.bmp')
|
||||||
" :src="url" />
|
" :src="url" />
|
||||||
</div>
|
</div>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
//引入相关样式
|
//引入相关样式
|
||||||
import '@vue-office/excel/lib/index.css'
|
import '@vue-office/excel/lib/index.css'
|
||||||
//引入VueOfficeDocx组件
|
//引入VueOfficeDocx组件
|
||||||
import VueOfficeDocx from '@vue-office/docx'
|
import VueOfficeDocx from '@vue-office/docx'
|
||||||
import VueOfficeExcel from '@vue-office/excel'
|
import VueOfficeExcel from '@vue-office/excel'
|
||||||
//引入VueOfficePdf组件
|
//引入VueOfficePdf组件
|
||||||
import VueOfficePdf from '@vue-office/pdf'
|
import VueOfficePdf from '@vue-office/pdf'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
@@ -45,6 +45,7 @@ import { useAdminInfo } from '@/stores/adminInfo'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { uploadFile, getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
import { uploadFile, getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||||
import { addStandardCase, queryStandardCase } from '@/api/supervision-boot/database/index'
|
import { addStandardCase, queryStandardCase } from '@/api/supervision-boot/database/index'
|
||||||
|
import { previewFile } from '@/utils/fileDownLoad'
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
const drawer = ref(false)
|
const drawer = ref(false)
|
||||||
const activeName = ref('2')
|
const activeName = ref('2')
|
||||||
@@ -52,12 +53,15 @@ const num = ref(0)
|
|||||||
const url = ref('')
|
const url = ref('')
|
||||||
const excelOptions = ref({})
|
const excelOptions = ref({})
|
||||||
const information = adminInfo.roleCode.includes('information_info')
|
const information = adminInfo.roleCode.includes('information_info')
|
||||||
const open = (row: any) => {
|
|
||||||
// console.log('🚀 ~ open ~ row:', row)
|
|
||||||
// url.value = row
|
const urlKey=ref('')
|
||||||
|
const open = async (row: any) => {
|
||||||
drawer.value = true
|
drawer.value = true
|
||||||
url.value = `/api-docx/excelreport` + row
|
urlKey.value=row
|
||||||
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
|
const previewUrl = await previewFile(row);
|
||||||
|
url.value = previewUrl;
|
||||||
|
|
||||||
// getFileNameAndFilePath({ filePath: row }).then(res => {
|
// getFileNameAndFilePath({ filePath: row }).then(res => {
|
||||||
// url.value = res.data.url
|
// url.value = res.data.url
|
||||||
// })
|
// })
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div >
|
||||||
<TableHeader ref="TableHeaderRef">
|
<TableHeader ref="TableHeaderRef">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="名称">
|
<el-form-item label="名称">
|
||||||
@@ -26,6 +26,7 @@ const tableStore = new TableStore({
|
|||||||
url: '/supervision-boot/libModel/pageLibModelQuery',
|
url: '/supervision-boot/libModel/pageLibModelQuery',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
showPage: true, // 确保启用分页
|
showPage: true, // 确保启用分页
|
||||||
|
publicHeight: 60,
|
||||||
column: [
|
column: [
|
||||||
{
|
{
|
||||||
title: '典型设备',
|
title: '典型设备',
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="名称">
|
<el-form-item label="名称">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" clearable
|
<el-input
|
||||||
placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
|
v-model="tableStore.table.params.searchValue"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入搜索名称"
|
||||||
|
maxlength="32"
|
||||||
|
show-word-limit
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef" isGroup/>
|
<Table ref="tableRef" isGroup />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
@@ -23,7 +27,8 @@ const tableRef = ref()
|
|||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/supervision-boot/libModel/pageLibModelQuery',
|
url: '/supervision-boot/libModel/pageLibModelQuery',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
publicHeight: 60,
|
||||||
|
column: [
|
||||||
{
|
{
|
||||||
title: '谐波源',
|
title: '谐波源',
|
||||||
children: [
|
children: [
|
||||||
@@ -32,12 +37,14 @@ const tableStore = new TableStore({
|
|||||||
title: '序号',
|
title: '序号',
|
||||||
width: '80',
|
width: '80',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
return (
|
||||||
|
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||||
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ field: 'name', title: '名称',minWidth: 200 },
|
{ field: 'name', title: '名称', minWidth: 200 },
|
||||||
{ field: 'voltage', title: '电压等级',minWidth: 200 },
|
{ field: 'voltage', title: '电压等级', minWidth: 200 },
|
||||||
{ field: 'capacity', title: '容量',minWidth: 200 }
|
{ field: 'capacity', title: '容量', minWidth: 200 }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -50,13 +57,13 @@ const tableStore = new TableStore({
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// 在请求发送前处理参数
|
// 在请求发送前处理参数
|
||||||
beforeSearchFun: () => {
|
beforeSearchFun: () => {
|
||||||
tableStore.table.params.pageSize = 100
|
tableStore.table.params.pageSize = 100
|
||||||
},
|
},
|
||||||
resetCallback: () => {
|
resetCallback: () => {
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
tableStore.table.params.type = 1
|
tableStore.table.params.type = 1
|
||||||
@@ -70,5 +77,4 @@ const queryData = () => {
|
|||||||
defineExpose({
|
defineExpose({
|
||||||
queryData
|
queryData
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,212 +1,222 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main" :style="height">
|
<div class="default-main" :style="height">
|
||||||
<!-- 标准库 -->
|
<!-- 标准库 -->
|
||||||
|
|
||||||
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
|
||||||
<pane :size="size">
|
<pane :size="size">
|
||||||
<standardTree ref="treeRef"
|
<standardTree ref="treeRef"
|
||||||
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
:default-expanded-keys="monitoringPoint.state.lineId ? [monitoringPoint.state.lineId] : []"
|
||||||
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
|
:current-node-key="monitoringPoint.state.lineId" @node-click="handleNodeClick"
|
||||||
@init="handleNodeClick"></standardTree>
|
@init="handleNodeClick"></standardTree>
|
||||||
</pane>
|
</pane>
|
||||||
<pane style="background: #fff" :style="height">
|
<pane style="background: #fff" :style="height">
|
||||||
<div class="pd10" style="display: flex; justify-content: end">
|
<div class="pd10" style="display: flex; justify-content: end">
|
||||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
|
<el-button icon="el-icon-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-Edit" type="primary" @click="editUser" v-if="information">修改</el-button>
|
||||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven"
|
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven"
|
||||||
v-if="information">删除</el-button>
|
v-if="information">删除</el-button>
|
||||||
<el-button icon="el-icon-Download" type="primary" @click="download" v-if="flag">下载</el-button>
|
<el-button icon="el-icon-Download" type="primary" @click="download" v-if="flag">下载</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty"
|
<el-empty v-if="url.length == 0" description="暂无数据" class="custom-empty"
|
||||||
:style="`height: calc(${height.height} - 60px);`" />
|
:style="`height: calc(${height.height} - 60px);`" />
|
||||||
<div :style="`height: calc(${height.height} - 60px);overflow: auto;`" v-else>
|
<div :style="`height: calc(${height.height} - 60px);overflow: auto;`" v-else>
|
||||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url"
|
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.includes('.xlsx')" :src="url"
|
||||||
:options="excelOptions" />
|
:options="excelOptions" />
|
||||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
|
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url"/> -->
|
||||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||||
<img v-if="
|
<img v-if="
|
||||||
url.includes('.png') || url.includes('.jpg') || url.includes('.gif') || url.includes('.bmp')
|
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
|
||||||
" :src="url" />
|
" :src="url" />
|
||||||
</div>
|
</div>
|
||||||
</pane>
|
</pane>
|
||||||
</splitpanes>
|
</splitpanes>
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
|
|
||||||
<addTree ref="addTreeRef" @onSubmit="treeRef.loadData(dotList.id)"></addTree>
|
<addTree ref="addTreeRef" @onSubmit="treeRef.loadData(dotList.id)"></addTree>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, provide } from 'vue'
|
import { onMounted, ref, provide } from 'vue'
|
||||||
import 'splitpanes/dist/splitpanes.css'
|
import 'splitpanes/dist/splitpanes.css'
|
||||||
import { Splitpanes, Pane } from 'splitpanes'
|
import { Splitpanes, Pane } from 'splitpanes'
|
||||||
import standardTree from '@/components/tree/pqs/standardTree.vue'
|
import standardTree from '@/components/tree/pqs/standardTree.vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import addTree from './components/addTree.vue'
|
import addTree from './components/addTree.vue'
|
||||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
import { getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||||
|
|
||||||
//引入相关样式
|
//引入相关样式
|
||||||
import '@vue-office/excel/lib/index.css'
|
import '@vue-office/excel/lib/index.css'
|
||||||
//引入VueOfficeDocx组件
|
//引入VueOfficeDocx组件
|
||||||
import VueOfficeDocx from '@vue-office/docx'
|
import VueOfficeDocx from '@vue-office/docx'
|
||||||
import VueOfficeExcel from '@vue-office/excel'
|
import VueOfficeExcel from '@vue-office/excel'
|
||||||
//引入VueOfficePdf组件
|
//引入VueOfficePdf组件
|
||||||
import VueOfficePdf from '@vue-office/pdf'
|
import VueOfficePdf from '@vue-office/pdf'
|
||||||
import { deleteyLibstandard } from '@/api/supervision-boot/database/index'
|
import { deleteyLibstandard } from '@/api/supervision-boot/database/index'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
const adminInfo = useAdminInfo()
|
import {previewFile } from '@/utils/fileDownLoad'
|
||||||
defineOptions({
|
const adminInfo = useAdminInfo()
|
||||||
name: 'database/standard'
|
defineOptions({
|
||||||
})
|
name: 'database/standard'
|
||||||
const excelOptions = ref({})
|
})
|
||||||
const monitoringPoint = useMonitoringPoint()
|
const excelOptions = ref({})
|
||||||
const height = mainHeight(20)
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const size = ref(0)
|
const height = mainHeight(20)
|
||||||
const treeRef = ref()
|
const size = ref(19)
|
||||||
const addTreeRef = ref()
|
const treeRef = ref()
|
||||||
const url = ref('')
|
const addTreeRef = ref()
|
||||||
const dotList: any = ref({})
|
const url = ref('')
|
||||||
const flag: any = ref(false)
|
const dotList: any = ref({})
|
||||||
const information = adminInfo.roleCode.includes('information_info')
|
const flag: any = ref(false)
|
||||||
onMounted(() => {
|
const information = adminInfo.roleCode.includes('information_info')
|
||||||
const dom = document.getElementById('navigation-splitpanes')
|
onMounted(() => {
|
||||||
if (dom) {
|
const dom = document.getElementById('navigation-splitpanes')
|
||||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
if (dom) {
|
||||||
}
|
size.value = Math.round((180 / dom.offsetHeight) * 120)
|
||||||
})
|
}
|
||||||
|
})
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
|
||||||
console.log("🚀 ~ handleNodeClick ~ data:", data)
|
const urlKey=ref('')
|
||||||
dotList.value = data
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
url.value = ''
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
flag.value = false
|
// console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||||
if (data?.url != null && data?.url != '') {
|
dotList.value = data
|
||||||
flag.value = true
|
url.value = ''
|
||||||
|
flag.value = false
|
||||||
setTimeout(() => {
|
if (data?.url != null && data?.url != '') {
|
||||||
url.value = `/api-docx/excelreport` + data.url
|
flag.value = true
|
||||||
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
urlKey.value = data.url
|
||||||
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
|
console.log('urlKey.value',urlKey.value)
|
||||||
// url.value = res.data.url
|
setTimeout(async () => {
|
||||||
// })
|
if(VITE_FLAG){
|
||||||
}, 100)
|
url.value = `/api-docx/excelreport` + data.url
|
||||||
}
|
excelOptions.value = { xls: data.url.split('.')[1] == 'xls' ? true : false }
|
||||||
}
|
}else{
|
||||||
// 删除
|
const previewUrl = await previewFile(data.url);
|
||||||
const deleteEven = () => {
|
url.value = previewUrl;
|
||||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
}
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
// getFileNameAndFilePath({ filePath: data.url }).then(res => {
|
||||||
type: 'warning'
|
// url.value = res.data.url
|
||||||
}).then(() => {
|
// })
|
||||||
deleteyLibstandard({ id: dotList.value.id }).then(() => {
|
}, 100)
|
||||||
ElMessage({
|
}
|
||||||
type: 'success',
|
}
|
||||||
message: '删除成功!'
|
// 删除
|
||||||
})
|
const deleteEven = () => {
|
||||||
setTimeout(() => {
|
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||||
treeRef.value.loadData()
|
confirmButtonText: '确定',
|
||||||
}, 100)
|
cancelButtonText: '取消',
|
||||||
})
|
type: 'warning'
|
||||||
})
|
}).then(() => {
|
||||||
}
|
deleteyLibstandard({ id: dotList.value.id }).then(() => {
|
||||||
const addUser = () => {
|
ElMessage({
|
||||||
addTreeRef.value.open('新增')
|
type: 'success',
|
||||||
}
|
message: '删除成功!'
|
||||||
const editUser = () => {
|
})
|
||||||
addTreeRef.value.open('修改', dotList.value)
|
setTimeout(() => {
|
||||||
}
|
treeRef.value.loadData()
|
||||||
// 下载
|
}, 100)
|
||||||
const download = () => {
|
})
|
||||||
let url = dotList.value.url
|
})
|
||||||
let urls = url
|
}
|
||||||
let name = url.match(/\/([^/]+)\.(\w+)$/)[1]
|
const addUser = () => {
|
||||||
downloadFile({ filePath: url }).then((res: any) => {
|
addTreeRef.value.open('新增')
|
||||||
let blob = new Blob([res], {
|
}
|
||||||
type: urls.includes('.pdf')
|
const editUser = () => {
|
||||||
? 'application/pdf'
|
addTreeRef.value.open('修改', dotList.value)
|
||||||
: urls.includes('.docx')
|
}
|
||||||
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
// 下载
|
||||||
: urls.includes('.xls')
|
const download = () => {
|
||||||
? 'application/vnd.ms-excel'
|
let url = dotList.value.url
|
||||||
: urls.includes('.xlsx')
|
let urls = url
|
||||||
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
let name = url.match(/\/([^/]+)\.(\w+)$/)[1]
|
||||||
: urls.includes('.png')
|
downloadFile({ filePath: url }).then((res: any) => {
|
||||||
? 'image/png'
|
let blob = new Blob([res], {
|
||||||
: urls.includes('.jpeg')
|
type: urls.includes('.pdf')
|
||||||
? 'image/jpeg'
|
? 'application/pdf'
|
||||||
: urls.includes('.jpg')
|
: urls.includes('.docx')
|
||||||
? 'image/jpg'
|
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||||
: ''
|
: urls.includes('.xls')
|
||||||
})
|
? 'application/vnd.ms-excel'
|
||||||
const url = window.URL.createObjectURL(blob)
|
: urls.includes('.xlsx')
|
||||||
const link = document.createElement('a')
|
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
link.href = url
|
: urls.includes('.png')
|
||||||
link.download = name
|
? 'image/png'
|
||||||
document.body.appendChild(link)
|
: urls.includes('.jpeg')
|
||||||
link.click()
|
? 'image/jpeg'
|
||||||
link.remove()
|
: urls.includes('.jpg')
|
||||||
})
|
? 'image/jpg'
|
||||||
}
|
: ''
|
||||||
</script>
|
})
|
||||||
<style lang="scss" scoped>
|
const url = window.URL.createObjectURL(blob)
|
||||||
.splitpanes.default-theme .splitpanes__pane {
|
const link = document.createElement('a')
|
||||||
background: #eaeef1;
|
link.href = url
|
||||||
}
|
link.download = name
|
||||||
|
document.body.appendChild(link)
|
||||||
.grid-content {
|
link.click()
|
||||||
text-align: center;
|
link.remove()
|
||||||
}
|
})
|
||||||
|
}
|
||||||
.divBox {
|
</script>
|
||||||
width: 250px;
|
<style lang="scss" scoped>
|
||||||
height: 31px;
|
.splitpanes.default-theme .splitpanes__pane {
|
||||||
margin: auto;
|
background: #eaeef1;
|
||||||
line-height: 32px;
|
}
|
||||||
border: 1px solid #c9c9c9;
|
|
||||||
|
.grid-content {
|
||||||
&:hover {
|
text-align: center;
|
||||||
border: 1px solid #002255;
|
}
|
||||||
}
|
|
||||||
}
|
.divBox {
|
||||||
|
width: 250px;
|
||||||
.box {
|
height: 31px;
|
||||||
padding: 10px;
|
margin: auto;
|
||||||
// margin-top: 10px;
|
line-height: 32px;
|
||||||
overflow-y: auto;
|
border: 1px solid #c9c9c9;
|
||||||
font-size: 15px;
|
|
||||||
}
|
&:hover {
|
||||||
|
border: 1px solid #002255;
|
||||||
.el-divider--horizontal {
|
}
|
||||||
margin: 10px 0;
|
}
|
||||||
}
|
|
||||||
|
.box {
|
||||||
.mTop {
|
padding: 10px;
|
||||||
margin-top: 5px;
|
// margin-top: 10px;
|
||||||
margin-bottom: 5px;
|
overflow-y: auto;
|
||||||
}
|
font-size: 15px;
|
||||||
|
}
|
||||||
/* 自定义 el-empty 的样式 */
|
|
||||||
:deep(.custom-empty) {
|
.el-divider--horizontal {
|
||||||
display: flex;
|
margin: 10px 0;
|
||||||
justify-content: center;
|
}
|
||||||
align-items: center;
|
|
||||||
height: 100%;
|
.mTop {
|
||||||
/* 调整高度 */
|
margin-top: 5px;
|
||||||
padding: 20px;
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
/* 调整内边距 */
|
|
||||||
.el-empty__image {
|
/* 自定义 el-empty 的样式 */
|
||||||
display: none;
|
:deep(.custom-empty) {
|
||||||
/* 隐藏默认图片 */
|
display: flex;
|
||||||
}
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
.el-empty__description {
|
height: 100%;
|
||||||
font-size: 14px;
|
/* 调整高度 */
|
||||||
/* 调整字体大小 */
|
padding: 20px;
|
||||||
color: var(--vxe-font-color);
|
|
||||||
}
|
/* 调整内边距 */
|
||||||
}
|
.el-empty__image {
|
||||||
</style>
|
display: none;
|
||||||
|
/* 隐藏默认图片 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-empty__description {
|
||||||
|
font-size: 14px;
|
||||||
|
/* 调整字体大小 */
|
||||||
|
color: var(--vxe-font-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ defineOptions({
|
|||||||
})
|
})
|
||||||
const information = adminInfo.roleCode.includes('information_info')
|
const information = adminInfo.roleCode.includes('information_info')
|
||||||
const popupEditRef = ref()
|
const popupEditRef = ref()
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
|
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
@@ -59,6 +59,9 @@ const tableStore = new TableStore({
|
|||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-Plus',
|
icon: 'el-icon-Plus',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
|
// disabled: row => {
|
||||||
|
// return !VITE_FLAG
|
||||||
|
// },
|
||||||
click: row => {
|
click: row => {
|
||||||
window.open(window.location.origin + '/#/previewFile?' + row.url)
|
window.open(window.location.origin + '/#/previewFile?' + row.url)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,282 +1,282 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<div v-show="view">
|
<div v-show="view">
|
||||||
<TableHeader datePicker area showExport>
|
<TableHeader datePicker area showExport>
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入关键字筛选" />
|
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入关键字筛选" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="统计类型:">
|
<el-form-item label="统计类型:">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="tableStore.table.params.statisticalType"
|
v-model="tableStore.table.params.statisticalType"
|
||||||
value-key="id"
|
value-key="id"
|
||||||
placeholder="请选择统计类型"
|
placeholder="请选择统计类型"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in classificationData"
|
v-for="item in classificationData"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item"
|
:value="item"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="电压等级:">
|
<el-form-item label="电压等级:">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="tableStore.table.params.scale"
|
v-model="tableStore.table.params.scale"
|
||||||
multiple
|
multiple
|
||||||
collapse-tags
|
collapse-tags
|
||||||
clearable
|
clearable
|
||||||
value-key="id"
|
value-key="id"
|
||||||
placeholder="请选择电压等级"
|
placeholder="请选择电压等级"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in voltageleveloption"
|
v-for="item in voltageleveloption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item"
|
:value="item"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="终端厂家:">
|
<el-form-item label="终端厂家:">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="tableStore.table.params.manufacturer"
|
v-model="tableStore.table.params.manufacturer"
|
||||||
multiple
|
multiple
|
||||||
collapse-tags
|
collapse-tags
|
||||||
clearable
|
clearable
|
||||||
value-key="id"
|
value-key="id"
|
||||||
placeholder="请选择终端厂家"
|
placeholder="请选择终端厂家"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in terminaloption"
|
v-for="item in terminaloption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item"
|
:value="item"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="干扰源类型:">
|
<el-form-item label="干扰源类型:">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="tableStore.table.params.loadType"
|
v-model="tableStore.table.params.loadType"
|
||||||
multiple
|
multiple
|
||||||
collapse-tags
|
collapse-tags
|
||||||
clearable
|
clearable
|
||||||
value-key="id"
|
value-key="id"
|
||||||
placeholder="请选择干扰源类型"
|
placeholder="请选择干扰源类型"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in interfereoption"
|
v-for="item in interfereoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item"
|
:value="item"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button :icon="Download" type="primary" @click="download">下载波形</el-button>
|
<el-button :icon="Download" type="primary" @click="download">下载波形</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef" :checkboxConfig="checkboxConfig" />
|
<Table ref="tableRef" :checkboxConfig="checkboxConfig" />
|
||||||
</div>
|
</div>
|
||||||
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||||
<waveForm ref="waveFormRef" senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" />
|
<waveForm ref="waveFormRef" senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide } from 'vue'
|
import { ref, onMounted, provide } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import { Download } from '@element-plus/icons-vue'
|
import { Download } from '@element-plus/icons-vue'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import waveForm from '@/components/echarts/waveForm.vue'
|
import waveForm from '@/components/echarts/waveForm.vue'
|
||||||
import { getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
import { getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||||
import { VxeTablePropTypes } from 'vxe-table'
|
import { VxeTablePropTypes } from 'vxe-table'
|
||||||
import { downloadWaveFile } from '@/api/event-boot/transient'
|
import { downloadWaveFile } from '@/api/event-boot/transient'
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'harmonic-boot/area/TransientEventList'
|
name: 'harmonic-boot/area/TransientEventList'
|
||||||
})
|
})
|
||||||
const pageHeight = mainHeight(20)
|
const pageHeight = mainHeight(20)
|
||||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||||
const eventList = dictData.getBasicData('Event_Statis')
|
const eventList = dictData.getBasicData('Event_Statis')
|
||||||
const view = ref(true)
|
const view = ref(true)
|
||||||
const view2 = ref(false)
|
const view2 = ref(false)
|
||||||
const waveFormRef = ref()
|
const waveFormRef = ref()
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/event-boot/transient/getTransientValue',
|
url: '/event-boot/transient/getTransientValue',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ width: '60', type: 'checkbox' },
|
{ width: '60', type: 'checkbox' },
|
||||||
{
|
{
|
||||||
field: 'index',
|
field: 'index',
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: '60',
|
width: '60',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ field: 'startTime', title: '暂降发生时刻', minWidth: '180' },
|
{ field: 'startTime', title: '暂降发生时刻', minWidth: '180' },
|
||||||
{ field: 'lineName', title: '监测点名称', minWidth: '180' },
|
{ field: 'lineName', title: '监测点名称', minWidth: '180' },
|
||||||
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
{ field: 'gdName', title: '供电公司', minWidth: '120' },
|
||||||
{ field: 'subName', title: '变电站', minWidth: '150' },
|
{ field: 'subName', title: '变电站', minWidth: '150' },
|
||||||
{ field: 'ip', title: '网络参数', minWidth: '110' },
|
{ field: 'ip', title: '网络参数' ,width:'120px' },
|
||||||
{ field: 'scale', title: '电压等级', minWidth: '110' },
|
{ field: 'scale', title: '电压等级', minWidth: '110' },
|
||||||
// {
|
// {
|
||||||
// field: 'advanceType',
|
// field: 'advanceType',
|
||||||
// title: '暂降类型',
|
// title: '暂降类型',
|
||||||
// minWidth: '90',
|
// minWidth: '90',
|
||||||
// formatter: (row: any) => {
|
// formatter: (row: any) => {
|
||||||
// return row.cellValue || '其他'
|
// return row.cellValue || '其他'
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
field: 'advanceReason',
|
field: 'advanceReason',
|
||||||
title: '暂降原因',
|
title: '暂降原因',
|
||||||
minWidth: '90',
|
minWidth: '90',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return row.cellValue || '其他'
|
return row.cellValue || '其他'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'eventType',
|
field: 'eventType',
|
||||||
title: '暂态统计类型',
|
title: '暂态统计类型',
|
||||||
minWidth: '120',
|
minWidth: '120',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return eventList.filter(item => item.id === row.cellValue)[0]?.name
|
return eventList.filter(item => item.id === row.cellValue)[0]?.name
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// field: 'severity', title: '严重度', minWidth: "80", formatter: (row: any) => {
|
// field: 'severity', title: '严重度', minWidth: "80", formatter: (row: any) => {
|
||||||
// return row.cellValue.toFixed(2)
|
// return row.cellValue.toFixed(2)
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
field: 'featureAmplitude',
|
field: 'featureAmplitude',
|
||||||
title: '暂降幅值(%)',
|
title: '暂降幅值(%)',
|
||||||
minWidth: '110',
|
minWidth: '110',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return (row.cellValue * 100).toFixed(2)
|
return (row.cellValue * 100).toFixed(2)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'eventDescribe',
|
field: 'eventDescribe',
|
||||||
title: '暂降深度(%)',
|
title: '暂降深度(%)',
|
||||||
minWidth: '110',
|
minWidth: '110',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
let data: any = (100 - row.row.featureAmplitude * 100).toFixed(2)
|
let data: any = (100 - row.row.featureAmplitude * 100).toFixed(2)
|
||||||
|
|
||||||
return data >= 0 ? data : '/'
|
return data >= 0 ? data : '/'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: '120',
|
width: '120',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '波形分析',
|
title: '波形分析',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.fileFlag == 0
|
return row.fileFlag == 0
|
||||||
},
|
},
|
||||||
icon: 'el-icon-Plus',
|
icon: 'el-icon-Plus',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
click: async row => {
|
click: async row => {
|
||||||
view.value = false
|
view.value = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
waveFormRef.value.open(row)
|
waveFormRef.value.open(row)
|
||||||
}, 100)
|
}, 100)
|
||||||
// row.loading = true
|
// row.loading = true
|
||||||
// boxoList.value = row
|
// boxoList.value = row
|
||||||
// await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
|
// await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
|
||||||
// .then(res => {
|
// .then(res => {
|
||||||
// row.loading = false
|
// row.loading = false
|
||||||
// if (res != undefined) {
|
// if (res != undefined) {
|
||||||
// wp.value = res.data
|
// wp.value = res.data
|
||||||
// view.value = false
|
// view.value = false
|
||||||
// view2.value = true
|
// view2.value = true
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// .catch(() => {
|
// .catch(() => {
|
||||||
// row.loading = false
|
// row.loading = false
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '暂无波形',
|
title: '暂无波形',
|
||||||
type: '',
|
type: '',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.fileFlag != 0
|
return row.fileFlag != 0
|
||||||
},
|
},
|
||||||
icon: 'el-icon-Plus',
|
icon: 'el-icon-Plus',
|
||||||
render: 'basicButton'
|
render: 'basicButton'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
loadCallback: () => {}
|
loadCallback: () => {}
|
||||||
})
|
})
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
tableStore.table.params.statisticalType = classificationData.filter(item => item.name == '电网拓扑')[0]
|
tableStore.table.params.statisticalType = classificationData.filter(item => item.name == '电网拓扑')[0]
|
||||||
tableStore.table.params.scale = []
|
tableStore.table.params.scale = []
|
||||||
tableStore.table.params.manufacturer = []
|
tableStore.table.params.manufacturer = []
|
||||||
tableStore.table.params.loadType = []
|
tableStore.table.params.loadType = []
|
||||||
|
|
||||||
tableStore.table.params.monitorFlag = 2
|
tableStore.table.params.monitorFlag = 2
|
||||||
tableStore.table.params.powerFlag = 2
|
tableStore.table.params.powerFlag = 2
|
||||||
tableStore.table.params.statFlag = true
|
tableStore.table.params.statFlag = true
|
||||||
tableStore.table.params.isType = 0
|
tableStore.table.params.isType = 0
|
||||||
const boxoList = ref({})
|
const boxoList = ref({})
|
||||||
const wp = ref({})
|
const wp = ref({})
|
||||||
|
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig<any>>({
|
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig<any>>({
|
||||||
checkMethod: ({ row }) => {
|
checkMethod: ({ row }) => {
|
||||||
return row.fileFlag === 1
|
return row.fileFlag === 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const backbxlb = () => {
|
const backbxlb = () => {
|
||||||
view.value = true
|
view.value = true
|
||||||
view2.value = false
|
view2.value = false
|
||||||
}
|
}
|
||||||
// 下载波形
|
// 下载波形
|
||||||
const download = () => {
|
const download = () => {
|
||||||
if (!tableStore.table.selection.length) {
|
if (!tableStore.table.selection.length) {
|
||||||
ElMessage.warning('请选择数据')
|
ElMessage.warning('请选择数据')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
downloadWaveFile({
|
downloadWaveFile({
|
||||||
lineId: tableStore.table.selection.map((item: any) => item.eventId)
|
lineId: tableStore.table.selection.map((item: any) => item.eventId)
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
if (res.type == 'application/json') {
|
if (res.type == 'application/json') {
|
||||||
ElMessage.warning('暂无可下载的波形文件!')
|
ElMessage.warning('暂无可下载的波形文件!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessage.info('下载中......')
|
ElMessage.info('下载中......')
|
||||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||||
const url = window.URL.createObjectURL(blob)
|
const url = window.URL.createObjectURL(blob)
|
||||||
const link = document.createElement('a') // 创建a标签
|
const link = document.createElement('a') // 创建a标签
|
||||||
link.href = url
|
link.href = url
|
||||||
link.download = '波形分析下载' // 设置下载的文件名
|
link.download = '波形分析下载' // 设置下载的文件名
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click() //执行下载
|
link.click() //执行下载
|
||||||
document.body.removeChild(link) //释放标签
|
document.body.removeChild(link) //释放标签
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user