Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98e0f9de02 | ||
|
|
21756e05d4 | ||
|
|
abfdf29a38 | ||
|
|
120892808b | ||
|
|
0f5cb1d3c5 | ||
| dbaa42ff7e | |||
|
|
48472bdb85 | ||
|
|
fafc5f82c4 | ||
| 93ee7e4034 | |||
|
|
7d2ce51510 | ||
|
|
9202da17f1 | ||
|
|
30eddd0572 | ||
|
|
15bd1ac6d2 | ||
|
|
f5c76c1b7a | ||
|
|
b25515b5db | ||
|
|
bfa061fb03 | ||
|
|
15e3d4aec8 | ||
|
|
59489aaafa | ||
|
|
5d0421dd40 | ||
|
|
6d7ef7cf5d | ||
|
|
8d9ccf97a7 | ||
|
|
7188e3e681 | ||
|
|
a9fc77eb8b | ||
|
|
87af11288d | ||
|
|
0763187744 | ||
|
|
ae641604ba | ||
|
|
564e6ef4ab | ||
|
|
c84c5dae3b | ||
|
|
c902dabb73 | ||
|
|
8d1497032f | ||
|
|
6aeac753ef | ||
|
|
56d65a6c17 | ||
|
|
8b356c87a3 | ||
|
|
c0feeaee7b | ||
|
|
6a112c8ae2 | ||
|
|
a19952b771 | ||
|
|
0b76347853 | ||
|
|
379951699d | ||
|
|
003737cf52 | ||
|
|
20e6d3719a | ||
|
|
77617412dd | ||
|
|
68ea43c42b | ||
|
|
e65df4daad | ||
|
|
136248eec2 | ||
|
|
bfafb6dc5b | ||
|
|
0b91027da4 | ||
|
|
22aeb0bf4c | ||
|
|
87bc9d9017 | ||
|
|
43d4d37cd0 | ||
|
|
ad1528e53b | ||
|
|
c1e36440e7 | ||
|
|
16f5213d7a | ||
|
|
ab891e6125 | ||
|
|
36c8ab87a2 | ||
|
|
6c3037f19b | ||
|
|
54517c0d5f | ||
|
|
715cdb892f | ||
|
|
953b96fe05 | ||
|
|
cb19fef4c6 | ||
|
|
98c887b79d |
6
.env.qujing
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 云南曲靖
|
||||||
|
NODE_ENV = qujing
|
||||||
|
VITE_NAME="qujing"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
@@ -18,7 +18,7 @@ pnpm i
|
|||||||
#运行项目
|
#运行项目
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
#冀北现场启动命令 区分是否加载现场电网一张图内网api
|
#jb现场启动命令 区分是否加载现场电网一张图内网api
|
||||||
npm run dev:jibei
|
npm run dev:jibei
|
||||||
|
|
||||||
#去除后台所有模块名 如除/xxxx-boot
|
#去除后台所有模块名 如除/xxxx-boot
|
||||||
@@ -26,9 +26,9 @@ npm run dev:removeMode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#因海南和冀北技术监督不同 通过修改文件的方式来区分
|
#因海南和jb技术监督不同 通过修改文件的方式来区分
|
||||||
#海南打包 需要吧pqs目录下supervise_hn 文件夹改成supervise 原文件改成supervise_jb
|
#海南打包 需要吧pqs目录下supervise_hn 文件夹改成supervise 原文件改成supervise_jb
|
||||||
#冀北打包 需要吧pqs目录下supervise_jb 文件夹改成supervise 原文件改成supervise_hn
|
#jb打包 需要吧pqs目录下supervise_jb 文件夹改成supervise 原文件改成supervise_hn
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 页面编写-示例
|
#### 页面编写-示例
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<script src="/static/luckysheet/plugin.js"></script>
|
<script src="/static/luckysheet/plugin.js"></script>
|
||||||
<script src="/static/luckysheet/luckysheet.umd.js"></script>
|
<script src="/static/luckysheet/luckysheet.umd.js"></script>
|
||||||
|
|
||||||
<!-- 冀北地图 -->
|
<!-- jb地图 -->
|
||||||
<!--引入样式文件-->
|
<!--引入样式文件-->
|
||||||
<script src="%VITE_NARIMAP%"></script>
|
<script src="%VITE_NARIMAP%"></script>
|
||||||
<!-- <script src="%VITE_NRGISCOMMON%"></script> -->
|
<!-- <script src="%VITE_NRGISCOMMON%"></script> -->
|
||||||
|
|||||||
@@ -7,10 +7,12 @@
|
|||||||
"dev": "vite --mode dev",
|
"dev": "vite --mode dev",
|
||||||
"dev:jibei": "vite --mode jibei",
|
"dev:jibei": "vite --mode jibei",
|
||||||
"dev:hainan": "vite --mode hainan",
|
"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: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"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1504,7 +1504,7 @@ window.BMAP_AUTHENTIC_KEY = "Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK";
|
|||||||
for (d in b) c = c + "&" + d + "=" + encodeURIComponent(b[d]);
|
for (d in b) c = c + "&" + d + "=" + encodeURIComponent(b[d]);
|
||||||
var e = function (a) {
|
var e = function (a) {
|
||||||
a && (rb = o, setTimeout(function () {
|
a && (rb = o, setTimeout(function () {
|
||||||
sb.src = B.oc + "images/blank.gif?" + a.src
|
// sb.src = B.oc + "images/blank.gif?" + a.src
|
||||||
}, 50))
|
}, 50))
|
||||||
},
|
},
|
||||||
f = function () {
|
f = function () {
|
||||||
|
|||||||
@@ -1536,7 +1536,7 @@ window.BMAP_AUTHENTIC_KEY = ''
|
|||||||
a &&
|
a &&
|
||||||
((ob = q),
|
((ob = q),
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
pb.src = B.Wc + 'images/blank.gif?' + a.src
|
// pb.src = B.Wc + 'images/blank.gif?' + a.src
|
||||||
}, 50))
|
}, 50))
|
||||||
},
|
},
|
||||||
g = function () {
|
g = function () {
|
||||||
|
|||||||
@@ -13,9 +13,11 @@ onMounted(async () => {
|
|||||||
const response = await fetch('/')
|
const response = await fetch('/')
|
||||||
const WebSocketUrl:any = response.headers.get('X-WebSocket-Url')
|
const WebSocketUrl:any = response.headers.get('X-WebSocket-Url')
|
||||||
const WebSocketUrl2:any = response.headers.get('X-WebSocket-Url2')
|
const WebSocketUrl2:any = response.headers.get('X-WebSocket-Url2')
|
||||||
|
const WebSocketUrl3:any = response.headers.get('X-WebSocket-Url3')
|
||||||
const MqttUrl:any = response.headers.get('X-MqttUrl-Url')
|
const MqttUrl:any = response.headers.get('X-MqttUrl-Url')
|
||||||
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
|
||||||
localStorage.setItem('WebSocketUrl', WebSocketUrl)
|
localStorage.setItem('WebSocketUrl', WebSocketUrl)
|
||||||
|
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
||||||
|
localStorage.setItem('WebSocketUrl3', WebSocketUrl3)
|
||||||
localStorage.setItem('MqttUrl', MqttUrl)
|
localStorage.setItem('MqttUrl', MqttUrl)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
// 密码规则修改
|
// 密码规则修改
|
||||||
export function ruleUpdate(data) {
|
export function ruleUpdate(data) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -24,3 +25,77 @@ export function unlockRoot(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据客户端名查询信息
|
||||||
|
export function getClientInfoByPath() {
|
||||||
|
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/authClient/getAuthClientByName/njcn',
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//客户端会话配置更新
|
||||||
|
export function updateClientSessionConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/authClient/sessionConfigUpdate',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取用户配置
|
||||||
|
export function getUserConfig() {
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/password/getUserStrategyList',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询系统列表
|
||||||
|
export function getSystemList() {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/getSysConfigData',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//激活系统配置
|
||||||
|
export function activeSystemConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/updateSysConfig',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除系统配置
|
||||||
|
export function deleteSystemConfig( data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/removeSysConfigById',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增系统配置
|
||||||
|
export function addSystemConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/addSysConfig',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改系统配置
|
||||||
|
export function updateSystemConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/updateSysConfig',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -129,7 +129,7 @@ export function queryAllByType(params: any) {
|
|||||||
//获取用户
|
//获取用户
|
||||||
export function selectUserList(data: any) {
|
export function selectUserList(data: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/supervision-boot/userReport/selectUserList',
|
url: '/device-boot/userReport/selectUserList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -206,3 +206,11 @@ export function exportTerminalBase() {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//一键分配终端
|
||||||
|
export function allotTerminal(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/device-boot/nodeDevice/oneKeyDistribution',
|
||||||
|
method: 'post',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,3 +45,13 @@ export const getLineOverLimitData = (id: string) => {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//导出数据总览
|
||||||
|
export function dataVerifyExcel(params: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/dataVerify/dataVerifyExcel',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -32,3 +32,12 @@ export function getDevTypeList() {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const getDeviceTypeList = (params: any) => {
|
||||||
|
return createAxios({
|
||||||
|
url: '/device-boot/devType/pageDevTypeList',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
103
src/api/device-boot/sensitiveLoadMange.ts
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 新增敏感用户
|
||||||
|
export function saveUser(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqSensitiveUser/save',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改敏感用户
|
||||||
|
export function updateUser(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqSensitiveUser/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除敏感用户
|
||||||
|
export function deleteUser(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqSensitiveUser/delete',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干扰源接入功能删除流程
|
||||||
|
*/
|
||||||
|
export const deleteUserReport = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/deleteUserReport',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 提交表单数据
|
||||||
|
*/
|
||||||
|
export const submitFormData = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 根据id获取用户档案录入的详细数据
|
||||||
|
export const getById = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/getById',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交表单数据
|
||||||
|
*/
|
||||||
|
export const addEditor = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReportRenewal/addEditor',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据id获取用户档案录入的详细数据
|
||||||
|
export const getByDeptDevLine = (params: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getByDeptDevLine',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据id获取用户档案录入的详细数据
|
||||||
|
*/
|
||||||
|
export const getUserReportUpdateById = (id: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReportRenewal/getUserReportUpdateById?businessId='+id,
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据id获取用户档案录入的详细数据
|
||||||
|
export const getUserReportById = (id: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/getUserReportById?id='+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 根据id查询文件信息集合
|
||||||
|
export const getFileById = (params: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/fileUrl/getFileById',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,13 +1,36 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
|
|
||||||
//事件报告
|
//事件报告
|
||||||
|
// export function getEventReport(data) {
|
||||||
|
// return createAxios({
|
||||||
|
// url: '/event-boot/report/getEventReport',
|
||||||
|
// method: 'post',
|
||||||
|
// data
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
export function getEventReport(data) {
|
export function getEventReport(data) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/event-boot/report/getEventReport',
|
url: '/event-boot/report/createEventReport',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data,
|
||||||
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 生成报告
|
// 生成报告
|
||||||
export function getAreaReport(data) {
|
export function getAreaReport(data) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -15,8 +38,39 @@ export function getAreaReport(data) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data,
|
data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
async function readJsonBlob(blob) {
|
||||||
|
try {
|
||||||
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
|
const jsonStr = await blob.text()
|
||||||
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
|
const jsonData = JSON.parse(jsonStr)
|
||||||
|
// 3. 拿到数据,后续随便用
|
||||||
|
return {
|
||||||
|
code: true,
|
||||||
|
data: jsonData
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
code: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//查询所有模板
|
//查询所有模板
|
||||||
export function getList(data) {
|
export function getList(data) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -38,6 +92,17 @@ export function getLineExport(data) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function getVoltage(data: any) {
|
export function getVoltage(data: any) {
|
||||||
|
|||||||
@@ -20,6 +20,14 @@ export function getAreaDept() {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 承载能力评估去除前缀
|
||||||
|
export function getAreaDeptRemoveMode(params) {
|
||||||
|
return request({
|
||||||
|
url: '/user-boot/dept/loginDeptTree',
|
||||||
|
method: 'GET',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
||||||
export function getOnlineRateDataCensus(data:any) {
|
export function getOnlineRateDataCensus(data:any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/device-boot/terminalOnlineRateData/getOnlineRateDataCensus',
|
url: '/device-boot/terminalOnlineRateData/getOnlineRateDataCensus',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
export function getHistoryResult(data: any) {
|
export function getHistoryResult(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/harmonic-boot/harmonic/getHistoryResult',
|
url: '/harmonic-boot/harmonic/getHistoryResult',
|
||||||
@@ -14,5 +14,35 @@ export function exportModelJB(data: any) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
data: data
|
data: data
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
async function readJsonBlob(blob) {
|
||||||
|
try {
|
||||||
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
|
const jsonStr = await blob.text()
|
||||||
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
|
const jsonData = JSON.parse(jsonStr)
|
||||||
|
// 3. 拿到数据,后续随便用
|
||||||
|
return {
|
||||||
|
code: true,
|
||||||
|
data: jsonData
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
code: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
|
|
||||||
export function exportModel(data: any) {
|
export function exportModel(data: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -6,5 +7,54 @@ export function exportModel(data: any) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function areaHarmonicReport(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/harmonic-boot/areaHarmonicReport/areaHarmonicReport',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
async function readJsonBlob(blob) {
|
||||||
|
try {
|
||||||
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
|
const jsonStr = await blob.text()
|
||||||
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
|
const jsonData = JSON.parse(jsonStr)
|
||||||
|
// 3. 拿到数据,后续随便用
|
||||||
|
return {
|
||||||
|
code: true,
|
||||||
|
data: jsonData
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
code: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
42
src/api/system-boot/MonitoringPoint.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
//查询所有模板
|
||||||
|
export function getList(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/getList",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//字典树
|
||||||
|
export function getDictTree(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/DictTree",
|
||||||
|
method: "post",
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//新增模板
|
||||||
|
export function addData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/add",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//修改模板
|
||||||
|
export function updateData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/update",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//删除模板
|
||||||
|
export function deleteData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/delete",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
43
src/api/system-boot/ReportTemplate.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//获取字典树数据
|
||||||
|
export function getDictTree(data) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/DictTree",
|
||||||
|
method: "post",
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询字典列表
|
||||||
|
export function getReportDictList(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/getReportDictList",
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//新增字典表
|
||||||
|
export function addDict(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/addDict",
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//更新字典表
|
||||||
|
export function updateDict(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/updateDict",
|
||||||
|
method: "put",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//删除字典表
|
||||||
|
export function deleteDict(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/deleteDict",
|
||||||
|
method: "delete",
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
}
|
||||||
37
src/api/system-boot/area.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
//区域树形表格接口
|
||||||
|
export function areaTree(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/areaTree',
|
||||||
|
method: 'post',
|
||||||
|
params: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function areaAdd(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function areaDelete(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/delete',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function update(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function selectPid(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/selectPid',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ export const uploadFile = (file: any, path: string) => {
|
|||||||
data: form
|
data: form
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == `A0000`) {
|
if (res.code == `A0000`) {
|
||||||
ElMessage.success('上传成功!')
|
ElMessage.success('文件上传成功!')
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
BIN
src/assets/img/region.png
Normal file
|
After Width: | Height: | Size: 243 KiB |
BIN
src/assets/imgs/m0.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/assets/imgs/m1.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/assets/imgs/m2.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src/assets/imgs/m3.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/imgs/m4.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
src/assets/logo/海南.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/assets/logo/灿能.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/logo/电网.png
Normal file
|
After Width: | Height: | Size: 249 KiB |
BIN
src/assets/logo/电网1.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -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 },
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ if (VITE_FLAG) {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
|
|
||||||
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||||
url.value = previewUrl
|
url.value = previewUrl
|
||||||
excelOptions.value = ref({
|
excelOptions.value = ref({
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ const openListenerForm = (listener, index?) => {
|
|||||||
}
|
}
|
||||||
// 移除监听器
|
// 移除监听器
|
||||||
const removeListener = (listener, index?) => {
|
const removeListener = (listener, index?) => {
|
||||||
console.log(listener, 'listener')
|
//console.log(listener, 'listener')
|
||||||
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
||||||
confirmButtonText: '确 认',
|
confirmButtonText: '确 认',
|
||||||
cancelButtonText: '取 消'
|
cancelButtonText: '取 消'
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ const tableStore: any = new TableStore({
|
|||||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
return k.citTotalNum != 0
|
return k.citTotalNum != 0
|
||||||
} else {
|
} else {
|
||||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
return !k.citName.includes('上送')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -240,7 +240,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -249,7 +249,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -270,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
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ const tableStore: any = new TableStore({
|
|||||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
return k.citTotalNum != 0
|
return k.citTotalNum != 0
|
||||||
} else {
|
} else {
|
||||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
return !k.citName.includes('上送')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -239,7 +239,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -248,7 +248,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -269,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
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ const tableStore: any = new TableStore({
|
|||||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
return k.count != 0
|
return k.count != 0
|
||||||
} else {
|
} else {
|
||||||
return k.name != '上送国网' && k.name != '非上送国网'
|
return !k.citName.includes('上送')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const config = useConfig()
|
|||||||
// import { nextTick } from 'process'
|
// import { nextTick } from 'process'
|
||||||
const emit = defineEmits(['triggerPoint', 'group', 'echartClick'])
|
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>()
|
||||||
|
|
||||||
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
|
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
|
||||||
@@ -70,6 +71,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}
|
||||||
@@ -154,7 +157,6 @@ const initChart = () => {
|
|||||||
if (params.seriesName == '暂态触发点') {
|
if (params.seriesName == '暂态触发点') {
|
||||||
emit('triggerPoint', params.data)
|
emit('triggerPoint', params.data)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
emit('echartClick', params)
|
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,21 @@ 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(() => { })
|
|
||||||
|
|
||||||
const GetEchar = async (name: string) => {
|
const GetEchar = async (name: string) => {
|
||||||
let chartDom = document.getElementById('chartMap')
|
let chartDom = document.getElementById('chartMap')
|
||||||
@@ -36,6 +43,7 @@ const GetEchar = async (name: string) => {
|
|||||||
name == dictData.state.area?.[0].name ? (showCircle.value = false) : (showCircle.value = true)
|
name == dictData.state.area?.[0].name ? (showCircle.value = false) : (showCircle.value = true)
|
||||||
|
|
||||||
echarts.registerMap(name, await fetchConfig(name)) //注册可用的地图
|
echarts.registerMap(name, await fetchConfig(name)) //注册可用的地图
|
||||||
|
|
||||||
let option = {
|
let option = {
|
||||||
title: {
|
title: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
@@ -91,6 +99,7 @@ const GetEchar = async (name: string) => {
|
|||||||
// top: 10,
|
// top: 10,
|
||||||
// bottom: 0,
|
// bottom: 0,
|
||||||
roam: true,
|
roam: true,
|
||||||
|
|
||||||
label: {
|
label: {
|
||||||
normal: {
|
normal: {
|
||||||
show: true,
|
show: true,
|
||||||
@@ -170,6 +179,7 @@ const GetEchar = async (name: string) => {
|
|||||||
}, 0)
|
}, 0)
|
||||||
window.addEventListener('resize', resizeHandler)
|
window.addEventListener('resize', resizeHandler)
|
||||||
const flag1 = ref(true)
|
const flag1 = ref(true)
|
||||||
|
|
||||||
// 点击事件
|
// 点击事件
|
||||||
myCharts.value.off('click')
|
myCharts.value.off('click')
|
||||||
myCharts.value.on('click', (e: any) => {
|
myCharts.value.on('click', (e: any) => {
|
||||||
|
|||||||
@@ -6,29 +6,40 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="暂态波形上送" :style="'height:' + vhh">
|
<el-tab-pane label="暂态波形上送" :style="'height:' + vhh">
|
||||||
<el-table stripe :data="Data" :height="height" border style="width: 100%"
|
<vxe-table
|
||||||
header-cell-class-name="table_header">
|
stripe
|
||||||
<el-table-column align="center" prop="number" label="事件段"></el-table-column>
|
:data="Data"
|
||||||
<el-table-column align="center" prop="number" label="波形起始点相位(°)">
|
:height="height"
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
border
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
style="width: 100%"
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
header-cell-class-name="table_header"
|
||||||
</el-table-column>
|
>
|
||||||
<el-table-column align="center" prop="number" label="跳变段电压变化率(V/ms)">
|
<vxe-column align="center" field="number" title="事件段"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
<vxe-colgroup align="center" field="number1" title="波形起始点相位(°)">
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
<vxe-column align="center" field="number2" title="A相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
<vxe-column align="center" field="number3" title="B相"></vxe-column>
|
||||||
</el-table-column>
|
<vxe-column align="center" field="number4" title="C相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="相位跳变(°)">
|
</vxe-colgroup>
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
<vxe-colgroup align="center" field="number" title="跳变段电压变化率(V/ms)">
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
<vxe-column align="center" field="number5" title="A相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
<vxe-column align="center" field="number6" title="B相"></vxe-column>
|
||||||
</el-table-column>
|
<vxe-column align="center" field="number7" title="C相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="总分段数目"></el-table-column>
|
</vxe-colgroup>
|
||||||
<el-table-column align="center" prop="number" label="三相电压不平衡度(%)" width="180"></el-table-column>
|
<vxe-colgroup align="center" field="number" title="相位跳变(°)">
|
||||||
<el-table-column align="center" prop="number" label="暂降类型"></el-table-column>
|
<vxe-column align="center" field="number8" title="A相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="暂降原因"></el-table-column>
|
<vxe-column align="center" field="number9" title="B相"></vxe-column>
|
||||||
</el-table>
|
<vxe-column align="center" field="number10" title="C相"></vxe-column>
|
||||||
|
</vxe-colgroup>
|
||||||
|
<vxe-column align="center" field="number11" title="总分段数目"></vxe-column>
|
||||||
|
<vxe-column
|
||||||
|
align="center"
|
||||||
|
field="number12"
|
||||||
|
title="三相电压不平衡度(%)"
|
||||||
|
width="180"
|
||||||
|
></vxe-column>
|
||||||
|
<vxe-column align="center" field="number13" title="触发类型"></vxe-column>
|
||||||
|
<vxe-column align="center" field="number14" title="暂降原因"></vxe-column>
|
||||||
|
</vxe-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
@@ -73,7 +84,25 @@ export default {
|
|||||||
subName: '',
|
subName: '',
|
||||||
waveDatas: [],
|
waveDatas: [],
|
||||||
|
|
||||||
Data: [],
|
Data: [
|
||||||
|
{
|
||||||
|
number: 1,
|
||||||
|
number1: 0,
|
||||||
|
number2: 0,
|
||||||
|
number3: 0,
|
||||||
|
number4: 0,
|
||||||
|
number5: 0,
|
||||||
|
number6: 0,
|
||||||
|
number7: 0,
|
||||||
|
number8: 0,
|
||||||
|
number9: 0,
|
||||||
|
number10: 0,
|
||||||
|
number11: 1,
|
||||||
|
number12: 0,
|
||||||
|
number13: '其他',
|
||||||
|
number14: '其他'
|
||||||
|
}
|
||||||
|
],
|
||||||
height: null,
|
height: null,
|
||||||
vhh: null,
|
vhh: null,
|
||||||
ptpass: '',
|
ptpass: '',
|
||||||
@@ -88,7 +117,7 @@ export default {
|
|||||||
zoom: ''
|
zoom: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() { },
|
created() {},
|
||||||
watch: {
|
watch: {
|
||||||
value: function (a, b) {
|
value: function (a, b) {
|
||||||
if (a == 2) {
|
if (a == 2) {
|
||||||
@@ -116,10 +145,10 @@ export default {
|
|||||||
this.zoom = 1 / document.body.style.zoom
|
this.zoom = 1 / document.body.style.zoom
|
||||||
if (this.flag) {
|
if (this.flag) {
|
||||||
// console.log(123);
|
// console.log(123);
|
||||||
this.vh = mainHeight(250).height
|
this.vh = mainHeight(280).height
|
||||||
} else {
|
} else {
|
||||||
// console.log(3333);
|
// console.log(3333);
|
||||||
this.vh = mainHeight(270).height
|
this.vh = mainHeight(305).height
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
query() {
|
query() {
|
||||||
@@ -197,6 +226,8 @@ export default {
|
|||||||
'#FF9999'
|
'#FF9999'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
console.log('🚀 ~ this.boxoList:', this.boxoList)
|
||||||
|
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
top: '10px',
|
top: '10px',
|
||||||
@@ -239,7 +270,7 @@ export default {
|
|||||||
|
|
||||||
title: {
|
title: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.measurementPointName,
|
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.pt,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
@@ -378,6 +409,33 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
|
{
|
||||||
|
name: '跳变期',
|
||||||
|
type: 'line',
|
||||||
|
data: [],
|
||||||
|
showSymbol: true, // 强制显示标记
|
||||||
|
symbol: 'rect', // 标记形状为方块
|
||||||
|
symbolSize: 10, // 方块大小
|
||||||
|
itemStyle: {
|
||||||
|
color: '#888888', // 方块颜色为灰色
|
||||||
|
borderWidth: 0
|
||||||
|
},
|
||||||
|
|
||||||
|
markArea: {
|
||||||
|
silent: true, // 不响应交互
|
||||||
|
itemStyle: { color: '#ccc' },
|
||||||
|
data: [
|
||||||
|
[
|
||||||
|
{ xAxis: '0' }, // 第一个跳变期起始
|
||||||
|
{ xAxis: '5' } // 第一个跳变期结束
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{ xAxis: '210' }, // 第二个跳变期起始
|
||||||
|
{ xAxis: '220' } // 第二个跳变期结束
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'A相',
|
name: 'A相',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
|||||||
1498
src/components/echarts/gaoji.js
Normal file
@@ -972,7 +972,7 @@ export default {
|
|||||||
align: "left",
|
align: "left",
|
||||||
},
|
},
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: "0.8rem",
|
fontSize: "16",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -983,7 +983,7 @@ export default {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
itemDistance: 5,
|
itemDistance: 5,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: "0.7rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
rich: {
|
rich: {
|
||||||
a: {
|
a: {
|
||||||
@@ -1019,14 +1019,14 @@ export default {
|
|||||||
title: {
|
title: {
|
||||||
text: "ms",
|
text: "ms",
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
},
|
},
|
||||||
enabled: true,
|
enabled: true,
|
||||||
align: "high",
|
align: "high",
|
||||||
},
|
},
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
@@ -1046,7 +1046,7 @@ export default {
|
|||||||
onZero: false, //-----------重点
|
onZero: false, //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
// interval: 50,
|
// interval: 50,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
@@ -1077,7 +1077,7 @@ export default {
|
|||||||
// min: min.toFixed(2),
|
// min: min.toFixed(2),
|
||||||
opposite: false,
|
opposite: false,
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
},
|
},
|
||||||
//minInterval: 1,
|
//minInterval: 1,
|
||||||
@@ -1090,7 +1090,7 @@ export default {
|
|||||||
onZero: false, //-----------重点
|
onZero: false, //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
return (value - 0).toFixed(2);
|
return (value - 0).toFixed(2);
|
||||||
@@ -1395,7 +1395,7 @@ export default {
|
|||||||
left: "center",
|
left: "center",
|
||||||
text: titlename,
|
text: titlename,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: "0.8rem",
|
fontSize: "16",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1406,7 +1406,7 @@ export default {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
itemDistance: 5,
|
itemDistance: 5,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: "0.7rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
rich: {
|
rich: {
|
||||||
a: {
|
a: {
|
||||||
@@ -1437,7 +1437,7 @@ export default {
|
|||||||
title: {
|
title: {
|
||||||
text: "ms",
|
text: "ms",
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
},
|
},
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -1449,7 +1449,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false,
|
show: false,
|
||||||
@@ -1464,7 +1464,7 @@ export default {
|
|||||||
onZero: false, //-----------重点
|
onZero: false, //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
// interval: 50,
|
// interval: 50,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
@@ -1498,7 +1498,7 @@ export default {
|
|||||||
// formatter: "{value}",
|
// formatter: "{value}",
|
||||||
// },
|
// },
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
},
|
},
|
||||||
//minInterval: 1,
|
//minInterval: 1,
|
||||||
@@ -1511,7 +1511,7 @@ export default {
|
|||||||
onZero: false, //-----------重点
|
onZero: false, //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: "0.6rem",
|
fontSize: "12",
|
||||||
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
color: _this.DColor ? "#fff" : echartsColor.WordColor,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
return (value - 0).toFixed(2);
|
return (value - 0).toFixed(2);
|
||||||
|
|||||||
@@ -634,7 +634,7 @@ export default {
|
|||||||
left: 'center',
|
left: 'center',
|
||||||
text: title,
|
text: title,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: '0.8rem',
|
fontSize: '16',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -645,7 +645,7 @@ export default {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
itemDistance: 5,
|
itemDistance: 5,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
rich: {
|
rich: {
|
||||||
a: {
|
a: {
|
||||||
@@ -681,7 +681,7 @@ export default {
|
|||||||
title: {
|
title: {
|
||||||
text: 'ms',
|
text: 'ms',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
},
|
},
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -691,7 +691,7 @@ export default {
|
|||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: '0.6rem'
|
fontSize: '12'
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
alignWithLabel: true
|
alignWithLabel: true
|
||||||
@@ -703,7 +703,7 @@ export default {
|
|||||||
onZero: false //-----------重点
|
onZero: false //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
if (_this.valA != (value - 0).toFixed(0)) {
|
if (_this.valA != (value - 0).toFixed(0)) {
|
||||||
@@ -732,7 +732,7 @@ export default {
|
|||||||
min: min.toFixed(2) > 0 ? min.toFixed(2) - min.toFixed(2) * 0.1 : min.toFixed(2) * 1.1,
|
min: min.toFixed(2) > 0 ? min.toFixed(2) - min.toFixed(2) * 0.1 : min.toFixed(2) * 1.1,
|
||||||
opposite: false,
|
opposite: false,
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
},
|
},
|
||||||
//minInterval: 1,
|
//minInterval: 1,
|
||||||
@@ -745,7 +745,7 @@ export default {
|
|||||||
onZero: false //-----------重点
|
onZero: false //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
return (value - 0).toFixed(2)
|
return (value - 0).toFixed(2)
|
||||||
@@ -1000,7 +1000,7 @@ export default {
|
|||||||
left: 'center',
|
left: 'center',
|
||||||
text: titlename,
|
text: titlename,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: '0.8rem',
|
fontSize: '16',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1011,7 +1011,7 @@ export default {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
itemDistance: 5,
|
itemDistance: 5,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
rich: {
|
rich: {
|
||||||
a: {
|
a: {
|
||||||
@@ -1042,7 +1042,7 @@ export default {
|
|||||||
title: {
|
title: {
|
||||||
text: 'ms',
|
text: 'ms',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
},
|
},
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -1061,10 +1061,10 @@ export default {
|
|||||||
onZero: false //-----------重点
|
onZero: false //-----------重点
|
||||||
},
|
},
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: '0.6rem'
|
fontSize: '12'
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
if (_this.valB != (value - 0).toFixed(0)) {
|
if (_this.valB != (value - 0).toFixed(0)) {
|
||||||
@@ -1095,7 +1095,7 @@ export default {
|
|||||||
// formatter: "{value}",
|
// formatter: "{value}",
|
||||||
// },
|
// },
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
},
|
},
|
||||||
//minInterval: 1,
|
//minInterval: 1,
|
||||||
@@ -1108,7 +1108,7 @@ export default {
|
|||||||
onZero: false //-----------重点
|
onZero: false //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: '0.6rem',
|
fontSize: '12',
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
formatter: function (value, index) {
|
formatter: function (value, index) {
|
||||||
return (value - 0).toFixed(2)
|
return (value - 0).toFixed(2)
|
||||||
|
|||||||
@@ -16,18 +16,12 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<!-- <el-button v-if="view2 && senior" class="ml10" type="primary"
|
<!-- <el-button v-if="view2 && senior" class="ml10" type="primary" @click="AdvancedAnalytics">
|
||||||
@click="AdvancedAnalytics">高级分析</el-button> -->
|
高级分析
|
||||||
|
</el-button> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-button
|
<el-button @click="backbxlb" icon="el-icon-Back" style="float: right">返回</el-button>
|
||||||
@click="backbxlb"
|
|
||||||
class="el-icon-refresh-right"
|
|
||||||
icon="el-icon-Back"
|
|
||||||
style="float: right"
|
|
||||||
>
|
|
||||||
返回
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div v-loading="loading" style="height: calc(100vh - 190px)">
|
<div v-loading="loading" style="height: calc(100vh - 190px)">
|
||||||
@@ -108,12 +102,12 @@ const options = ref([
|
|||||||
const shushiboxiRef = ref()
|
const shushiboxiRef = ref()
|
||||||
const bxecharts = ref(mainHeight(95).height as any)
|
const bxecharts = ref(mainHeight(95).height as any)
|
||||||
const view2 = ref(true)
|
const view2 = ref(true)
|
||||||
const boxoList = ref(null)
|
const boxoList: any = ref(null)
|
||||||
const wp = ref(null)
|
const wp = ref(null)
|
||||||
const showBoxi = ref(true)
|
const showBoxi = ref(true)
|
||||||
const view3 = ref(false)
|
const view3 = ref(false)
|
||||||
const view4 = ref(false)
|
const view4 = ref(false)
|
||||||
const GJList = ref([])
|
const GJList = ref({})
|
||||||
|
|
||||||
const open = async (row: any) => {
|
const open = async (row: any) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -122,6 +116,7 @@ const open = async (row: any) => {
|
|||||||
row.loading = false
|
row.loading = false
|
||||||
if (res != undefined) {
|
if (res != undefined) {
|
||||||
boxoList.value = row
|
boxoList.value = row
|
||||||
|
boxoList.value.pt = res.data.pt
|
||||||
wp.value = res.data
|
wp.value = res.data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
view4.value = true
|
view4.value = true
|
||||||
@@ -129,6 +124,7 @@ const open = async (row: any) => {
|
|||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
backbxlb()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const bxhandleClick = (tab: any) => {
|
const bxhandleClick = (tab: any) => {
|
||||||
@@ -168,10 +164,13 @@ const AdvancedAnalytics = () => {
|
|||||||
analysis({
|
analysis({
|
||||||
eventIndex: boxoList.value.eventId
|
eventIndex: boxoList.value.eventId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
GJList.value = res.data
|
// GJList.value = res.data
|
||||||
view3.value = true
|
// view3.value = true
|
||||||
view2.value = false
|
// view2.value = false
|
||||||
})
|
})
|
||||||
|
GJList.value = {}
|
||||||
|
view3.value = true
|
||||||
|
view2.value = false
|
||||||
}
|
}
|
||||||
const changeView = () => {
|
const changeView = () => {
|
||||||
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
||||||
|
|||||||
@@ -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) {
|
||||||
//根据开始时间推
|
//根据开始时间推
|
||||||
|
|||||||
@@ -1,29 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div ref="tableHeader" class="cn-table-header">
|
<div ref="tableHeader" class="cn-table-header">
|
||||||
<div class="table-header ba-scroll-style">
|
<div class="table-header ba-scroll-style">
|
||||||
<el-form
|
<el-form style="flex: 1; height: 32px; display: flex; flex-wrap: wrap" ref="headerForm" @submit.prevent=""
|
||||||
style="flex: 1; height: 32px; display: flex; flex-wrap: wrap"
|
@keyup.enter="onComSearch" label-position="left" :inline="true">
|
||||||
ref="headerForm"
|
|
||||||
@submit.prevent=""
|
|
||||||
@keyup.enter="onComSearch"
|
|
||||||
label-position="left"
|
|
||||||
:inline="true"
|
|
||||||
>
|
|
||||||
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
<el-form-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 ref="datePickerRef" v-if="timeAll" :nextFlag="nextFlag"
|
||||||
ref="datePickerRef"
|
:theCurrentTime="theCurrentTime"></DatePicker>
|
||||||
v-if="timeAll"
|
|
||||||
:nextFlag="nextFlag"
|
|
||||||
:theCurrentTime="theCurrentTime"
|
|
||||||
></DatePicker>
|
|
||||||
</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"
|
||||||
|
style="width: 200px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<slot name="select"></slot>
|
<slot name="select"></slot>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -32,43 +23,24 @@
|
|||||||
<Icon size="14" name="el-icon-ArrowUp" style="color: #fff" v-if="showSelect" />
|
<Icon size="14" name="el-icon-ArrowUp" style="color: #fff" v-if="showSelect" />
|
||||||
<Icon size="14" name="el-icon-ArrowDown" style="color: #fff" v-else />
|
<Icon size="14" name="el-icon-ArrowDown" style="color: #fff" v-else />
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button @click="onComSearch" v-if="showSearch" :loading="tableStore.table.loading" type="primary"
|
||||||
@click="onComSearch"
|
:icon="Search">
|
||||||
v-if="showSearch"
|
|
||||||
:loading="tableStore.table.loading"
|
|
||||||
type="primary"
|
|
||||||
:icon="Search"
|
|
||||||
>
|
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button @click="onResetForm" v-if="showSearch && showReset" :loading="tableStore.table.loading"
|
||||||
@click="onResetForm"
|
:icon="RefreshLeft">
|
||||||
v-if="showSearch && showReset"
|
|
||||||
:loading="tableStore.table.loading"
|
|
||||||
:icon="RefreshLeft"
|
|
||||||
>
|
|
||||||
重置
|
重置
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button @click="onExport" v-if="showExport" :loading="tableStore.table.exportLoading" type="primary"
|
||||||
@click="onExport"
|
icon="el-icon-Download">
|
||||||
v-if="showExport"
|
|
||||||
:loading="tableStore.table.loading"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-Download"
|
|
||||||
>
|
|
||||||
导出
|
导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<slot name="operation"></slot>
|
<slot name="operation"></slot>
|
||||||
</div>
|
</div>
|
||||||
<el-form
|
<el-form :style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
||||||
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
ref="headerFormSecond" @submit.prevent="" @keyup.enter="onComSearch" label-position="left"
|
||||||
ref="headerFormSecond"
|
:inline="true"></el-form>
|
||||||
@submit.prevent=""
|
|
||||||
@keyup.enter="onComSearch"
|
|
||||||
label-position="left"
|
|
||||||
:inline="true"
|
|
||||||
></el-form>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -81,7 +53,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()
|
||||||
@@ -132,6 +104,10 @@ 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 => {
|
||||||
@@ -232,14 +208,14 @@ const onResetForm = () => {
|
|||||||
//时间重置成默认值
|
//时间重置成默认值
|
||||||
datePickerRef.value?.setTheDate(3)
|
datePickerRef.value?.setTheDate(3)
|
||||||
|
|
||||||
if(props.showTimeAll){
|
if (props.showTimeAll) {
|
||||||
timeAll.value = false
|
timeAll.value = false
|
||||||
delete tableStore.table.params.searchBeginTime
|
delete tableStore.table.params.searchBeginTime
|
||||||
delete tableStore.table.params.searchEndTime
|
delete tableStore.table.params.searchEndTime
|
||||||
delete tableStore.table.params.startTime
|
delete tableStore.table.params.startTime
|
||||||
delete tableStore.table.params.endTime
|
delete tableStore.table.params.endTime
|
||||||
delete tableStore.table.params.timeFlag
|
delete tableStore.table.params.timeFlag
|
||||||
delete tableStore.table.params.interval
|
delete tableStore.table.params.interval
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.datePicker && timeAll.value) {
|
if (props.datePicker && timeAll.value) {
|
||||||
@@ -258,7 +234,6 @@ const setTheDate = (val: any) => {
|
|||||||
}
|
}
|
||||||
// 导出
|
// 导出
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
console.log('222')
|
|
||||||
tableStore.onTableAction('export', { showAllFlag: true })
|
tableStore.onTableAction('export', { showAllFlag: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,6 +269,7 @@ defineExpose({
|
|||||||
padding: 13px 15px;
|
padding: 13px 15px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.table-header-operate-text {
|
.table-header-operate-text {
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
@@ -321,7 +297,7 @@ defineExpose({
|
|||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mlr-12 + .el-button {
|
.mlr-12+.el-button {
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +332,7 @@ defineExpose({
|
|||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button + .el-button {
|
.el-button+.el-button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,6 +343,7 @@ defineExpose({
|
|||||||
|
|
||||||
html.dark {
|
html.dark {
|
||||||
.table-search-button-group {
|
.table-search-button-group {
|
||||||
|
|
||||||
button:focus,
|
button:focus,
|
||||||
button:active {
|
button:active {
|
||||||
background-color: var(--el-color-info-dark-2);
|
background-color: var(--el-color-info-dark-2);
|
||||||
|
|||||||
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>
|
||||||
@@ -147,7 +147,7 @@ const onMenuCollapse = () => {
|
|||||||
}
|
}
|
||||||
// 查看详情
|
// 查看详情
|
||||||
const viewDetails = (data: any) => {
|
const viewDetails = (data: any) => {
|
||||||
console.log('🚀 ~ viewDetails ~ data:', data)
|
// console.log('🚀 ~ viewDetails ~ data:', data)
|
||||||
if (data.level == 3) {
|
if (data.level == 3) {
|
||||||
// 变电站详情
|
// 变电站详情
|
||||||
// substationDetails
|
// substationDetails
|
||||||
@@ -201,7 +201,7 @@ onMounted(async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const scrollToNode = (id: string) => {
|
const scrollToNode = (id: string) => {
|
||||||
console.log("🚀 ~ scrollToNode ~ id:", id)
|
// console.log("🚀 ~ scrollToNode ~ id:", id)
|
||||||
if (!treeRef.value) return
|
if (!treeRef.value) return
|
||||||
|
|
||||||
// 获取目标节点的元素
|
// 获取目标节点的元素
|
||||||
|
|||||||
@@ -28,66 +28,66 @@ const info = (id: any) => {
|
|||||||
expanded.value = [id]
|
expanded.value = [id]
|
||||||
getTerminalTree().then(res => {
|
getTerminalTree().then(res => {
|
||||||
// let arr: any[] = []
|
// let arr: any[] = []
|
||||||
if (VITE_FLAG) {
|
// if (VITE_FLAG) {
|
||||||
res.data.forEach((item: any) => {
|
// res.data.forEach((item: any) => {
|
||||||
item.icon = 'el-icon-Menu'
|
// item.icon = 'el-icon-Menu'
|
||||||
item.plevel = item.level
|
// item.plevel = item.level
|
||||||
item.level = 0
|
// item.level = 0
|
||||||
item.children.forEach((item2: any) => {
|
// item.children.forEach((item2: any) => {
|
||||||
item2.icon = 'el-icon-HomeFilled'
|
// item2.icon = 'el-icon-HomeFilled'
|
||||||
|
|
||||||
item2.plevel = item2.level
|
// item2.plevel = item2.level
|
||||||
item2.level = 100
|
// item2.level = 100
|
||||||
expanded.value.push(item2.id)
|
// expanded.value.push(item2.id)
|
||||||
item2.children.forEach((item3: any) => {
|
// item2.children.forEach((item3: any) => {
|
||||||
item3.icon = 'el-icon-CollectionTag'
|
// item3.icon = 'el-icon-CollectionTag'
|
||||||
item3.plevel = item3.level
|
// item3.plevel = item3.level
|
||||||
item3.level = 200
|
// item3.level = 200
|
||||||
item3.children.forEach((item4: any) => {
|
// item3.children.forEach((item4: any) => {
|
||||||
item4.icon = 'el-icon-Flag'
|
// item4.icon = 'el-icon-Flag'
|
||||||
item4.plevel = item4.level
|
// item4.plevel = item4.level
|
||||||
item4.level = 300
|
// item4.level = 300
|
||||||
// arr.push(item4)
|
// // arr.push(item4)
|
||||||
item4.children.forEach((item5: any) => {
|
// item4.children.forEach((item5: any) => {
|
||||||
item5.icon = 'el-icon-OfficeBuilding'
|
// item5.icon = 'el-icon-OfficeBuilding'
|
||||||
item5.plevel = item5.level
|
// item5.plevel = item5.level
|
||||||
item5.level = 300
|
// item5.level = 300
|
||||||
// item5.id = item4.id
|
// // item5.id = item4.id
|
||||||
item5.children.forEach((item6: any) => {
|
// item5.children.forEach((item6: any) => {
|
||||||
item6.icon = 'el-icon-HelpFilled'
|
// item6.icon = 'el-icon-HelpFilled'
|
||||||
item6.plevel = 4
|
// item6.plevel = 4
|
||||||
if (item6.name == '电网侧' && item6.children.length == 0) {
|
// if (item6.name == '电网侧' && item6.children.length == 0) {
|
||||||
item6.level = 400
|
// item6.level = 400
|
||||||
} else {
|
// } else {
|
||||||
item6.level = 400
|
// item6.level = 400
|
||||||
}
|
// }
|
||||||
item6.children.forEach((item7: any) => {
|
// item6.children.forEach((item7: any) => {
|
||||||
item7.icon = 'el-icon-Film'
|
// item7.icon = 'el-icon-Film'
|
||||||
item7.plevel = item7.level
|
// item7.plevel = item7.level
|
||||||
item7.level = 400
|
// item7.level = 400
|
||||||
item7.children.forEach((item8: any) => {
|
// item7.children.forEach((item8: any) => {
|
||||||
item8.icon = 'el-icon-Collection'
|
// item8.icon = 'el-icon-Collection'
|
||||||
item8.plevel = item8.level
|
// item8.plevel = item8.level
|
||||||
item8.level = 500
|
// item8.level = 500
|
||||||
item8.children.forEach((item9: any) => {
|
// item8.children.forEach((item9: any) => {
|
||||||
item9.icon = 'el-icon-Share'
|
// item9.icon = 'el-icon-Share'
|
||||||
item9.plevel = item9.level
|
// item9.plevel = item9.level
|
||||||
item9.level = 600
|
// item9.level = 600
|
||||||
item9.children.forEach((item10: any) => {
|
// item9.children.forEach((item10: any) => {
|
||||||
item10.icon = 'el-icon-Location'
|
// item10.icon = 'el-icon-Location'
|
||||||
item10.plevel = item10.level
|
// item10.plevel = item10.level
|
||||||
item10.level = 700
|
// item10.level = 700
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
item.icon = 'el-icon-Menu'
|
item.icon = 'el-icon-Menu'
|
||||||
item.plevel = item.level
|
item.plevel = item.level
|
||||||
@@ -129,7 +129,7 @@ const info = (id: any) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
// }
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ 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 { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -35,7 +34,7 @@ const tree = ref()
|
|||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
|
|
||||||
const loadData = (id?: any) => {
|
const loadData = (id?: any) => {
|
||||||
console.log('🚀 ~ loadData ~ id:', id)
|
// console.log('🚀 ~ loadData ~ id:', id)
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
queryAllAlgorithmLibrary().then(res => {
|
queryAllAlgorithmLibrary().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
|
|||||||
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,7 +11,6 @@ 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 { getTree } from '@/api/advance-boot/assess'
|
import { getTree } from '@/api/advance-boot/assess'
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
/>
|
/>
|
||||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
<div style="display: flex; align-items: center" class="mb10">
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
<el-input v-model="filterText" placeholder="请输入内容" clearable>
|
<el-input v-model="filterText" placeholder="请输入内容" maxlength="10" show-word-limit clearable>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -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,62 +78,71 @@ 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) {
|
||||||
@@ -145,6 +158,109 @@ const scrollToNode = (id: string) => {
|
|||||||
// 树滚动
|
// 树滚动
|
||||||
treeRef.value.scrollToNode(id)
|
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 })
|
defineExpose({ treeRef, scrollToNode, tree })
|
||||||
loadData()
|
loadData()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
{{ Math.floor(row.eventValue * 10000) / 100 }}
|
{{ Math.floor(row.eventValue * 10000) / 100 }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="eventType" width="100px" title="暂降类型">
|
<vxe-column field="eventType" width="100px" title="触发类型">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ event.filter(item => item.id == row.eventType)[0]?.name || '/' }}
|
{{ event.filter(item => item.id == row.eventType)[0]?.name || '/' }}
|
||||||
</template>
|
</template>
|
||||||
@@ -50,7 +50,8 @@ import { ref, reactive, onMounted } from 'vue'
|
|||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import MQTT from '@/utils/mqtt'
|
// import MQTT from '@/utils/mqtt'
|
||||||
|
import socketClient from '@/utils/webSocketClient'
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const event = dictData.getBasicData('Event_Statis')
|
const event = dictData.getBasicData('Event_Statis')
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
@@ -68,37 +69,72 @@ const handleClose = (done: any) => {
|
|||||||
drawer.value = false
|
drawer.value = false
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
const init = async () => {
|
const dataSocket = reactive({
|
||||||
const mqttClient = new MQTT('/sendEvent')
|
socketServe: socketClient.Instance
|
||||||
// 设置消息接收回调
|
})
|
||||||
try {
|
// const init = async () => {
|
||||||
await mqttClient.init()
|
// const mqttClient = new MQTT('/sendEvent')
|
||||||
|
// // 设置消息接收回调
|
||||||
|
// try {
|
||||||
|
// await mqttClient.init()
|
||||||
|
|
||||||
// 订阅主题
|
// // 订阅主题
|
||||||
await mqttClient.subscribe()
|
// await mqttClient.subscribe()
|
||||||
// 设置消息接收回调
|
// // 设置消息接收回调
|
||||||
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
|
||||||
eventList.value.unshift(msg)
|
// eventList.value.unshift(msg)
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
isLoading.value = false
|
// isLoading.value = false
|
||||||
}, 500)
|
// }, 500)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.error('MQTT 初始化失败:', error)
|
// // console.error('MQTT 初始化失败:', error)
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
const socket = async () => {
|
||||||
|
const url = localStorage.getItem('WebSocketUrl3') || 'null' //'ws://192.168.2.130:10203/event/'
|
||||||
|
|
||||||
|
|
||||||
|
// const url = 'ws://192.168.1.68:10203/event/'
|
||||||
|
|
||||||
|
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||||
|
|
||||||
|
await dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||||
|
if (res.deptList.includes(adminInfo.$state.deptId)) {
|
||||||
|
drawer.value = true
|
||||||
|
isLoading.value = true
|
||||||
|
eventList.value.unshift(res)
|
||||||
|
setTimeout(() => {
|
||||||
|
isLoading.value = false
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
// logList.value.push({
|
||||||
|
// type: res.code == 500 ? 'error' : '',
|
||||||
|
// time: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
|
||||||
|
// name: res.message
|
||||||
|
// })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
dataSocket.socketServe?.closeWs()
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// startMqtt('/sendEvent', (topic, message) => {
|
// startMqtt('/sendEvent', (topic, message) => {
|
||||||
// const msg = JSON.parse(message.toString())
|
// const msg = JSON.parse(message.toString())
|
||||||
// console.log(msg)
|
// console.log(msg)
|
||||||
// })
|
// })
|
||||||
init()
|
|
||||||
|
setTimeout(() => {
|
||||||
|
socket()
|
||||||
|
}, 3000)
|
||||||
})
|
})
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ const onFullScreen = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCommand = (key: string) => {
|
const handleCommand = async(key: string) => {
|
||||||
console.log(key)
|
console.log(key)
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'adminInfo':
|
case 'adminInfo':
|
||||||
@@ -132,10 +132,17 @@ const handleCommand = (key: string) => {
|
|||||||
popupPwd.value.open()
|
popupPwd.value.open()
|
||||||
break
|
break
|
||||||
case 'layout':
|
case 'layout':
|
||||||
navTabs.closeTabs()
|
await window.location.reload()
|
||||||
window.localStorage.clear()
|
setTimeout(() => {
|
||||||
adminInfo.reset()
|
navTabs.closeTabs()
|
||||||
router.push({ name: 'login' })
|
window.localStorage.clear()
|
||||||
|
adminInfo.reset()
|
||||||
|
router.push({ name: 'login' })
|
||||||
|
}, 0)
|
||||||
|
// navTabs.closeTabs()
|
||||||
|
// window.localStorage.clear()
|
||||||
|
// adminInfo.reset()
|
||||||
|
// router.push({ name: 'login' })
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ import { ElMessage } from 'element-plus'
|
|||||||
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
||||||
import { validatePwd } from '@/utils/common'
|
import { validatePwd } from '@/utils/common'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import router from '@/router'
|
||||||
|
import { useNavTabs } from '@/stores/navTabs'
|
||||||
|
const navTabs = useNavTabs()
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const title = ref('修改密码')
|
const title = ref('修改密码')
|
||||||
@@ -97,8 +99,14 @@ const submit = () => {
|
|||||||
id: adminInfo.$state.userIndex,
|
id: adminInfo.$state.userIndex,
|
||||||
newPassword: form.newPwd
|
newPassword: form.newPwd
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
ElMessage.success('密码修改成功')
|
ElMessage.success('密码修改成功,请重新登录!')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
setTimeout(() => {
|
||||||
|
navTabs.closeTabs()
|
||||||
|
window.localStorage.clear()
|
||||||
|
adminInfo.reset()
|
||||||
|
router.push({ name: 'login' })
|
||||||
|
}, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
const token = adminInfo.getToken()
|
const token = adminInfo.getToken()
|
||||||
// token 不存在
|
// token 不存在
|
||||||
if (token === null || token === '') {
|
if (token === null || token === '') {
|
||||||
ElMessage.error('您还没有登录,请先登录')
|
// ElMessage.error('您还没有登录,请先登录')
|
||||||
next('/login')
|
next('/login')
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export const useConfig = defineStore(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getColorVal = function (name: keyof Layout): string {
|
const getColorVal = function (name: keyof Layout): string {
|
||||||
const colors = layout[name] as string[]
|
const colors = layout[name] as string[] || ['#082E6C', '#0e8780']
|
||||||
if (layout.isDark) {
|
if (layout.isDark) {
|
||||||
return colors[1]
|
return colors[1]
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -29,12 +29,10 @@ export const useMonitoringPoint = defineStore(
|
|||||||
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(state.lineIds)
|
|
||||||
console.log('====================================')
|
|
||||||
}
|
}
|
||||||
state.showCheckBox = val
|
state.showCheckBox = val
|
||||||
}
|
}
|
||||||
|
|
||||||
return { state, setValue, setShowCheckBox }
|
return { state, setValue, setShowCheckBox }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -404,6 +404,11 @@ body,
|
|||||||
.el-select__wrapper {
|
.el-select__wrapper {
|
||||||
height: 32px !important;
|
height: 32px !important;
|
||||||
}
|
}
|
||||||
|
.BMap_center,
|
||||||
|
.BMap_top,
|
||||||
|
.BMap_bottom {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'AlimamaFangYuanTiVF';
|
font-family: 'AlimamaFangYuanTiVF';
|
||||||
src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'),
|
src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'),
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
fixed: 'right',
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const PROCESS_BOOT = '/process-boot'
|
|||||||
//工作流模块
|
//工作流模块
|
||||||
export const BPM_BOOT = '/bpm-boot'
|
export const BPM_BOOT = '/bpm-boot'
|
||||||
|
|
||||||
//冀北技术监督
|
//网公司技术监督
|
||||||
export const SUPERVISION_BOOT = '/supervision-boot'
|
export const SUPERVISION_BOOT = '/supervision-boot'
|
||||||
|
|
||||||
//终端模块
|
//终端模块
|
||||||
|
|||||||
@@ -220,6 +220,57 @@ export const harmonicOptions = [
|
|||||||
{ label: '49次', value: 49 },
|
{ label: '49次', value: 49 },
|
||||||
{ label: '50次', value: 50 }
|
{ label: '50次', value: 50 }
|
||||||
]
|
]
|
||||||
|
export const harmonicOptions1 = [
|
||||||
|
{ label: '2次', value: 2 },
|
||||||
|
{ label: '3次', value: 3 },
|
||||||
|
{ label: '4次', value: 4 },
|
||||||
|
{ label: '5次', value: 5 },
|
||||||
|
{ label: '6次', value: 6 },
|
||||||
|
{ label: '7次', value: 7 },
|
||||||
|
{ label: '8次', value: 8 },
|
||||||
|
{ label: '9次', value: 9 },
|
||||||
|
{ label: '10次', value: 10 },
|
||||||
|
{ label: '11次', value: 11 },
|
||||||
|
{ label: '12次', value: 12 },
|
||||||
|
{ label: '13次', value: 13 },
|
||||||
|
{ label: '14次', value: 14 },
|
||||||
|
{ label: '15次', value: 15 },
|
||||||
|
{ label: '16次', value: 16 },
|
||||||
|
{ label: '17次', value: 17 },
|
||||||
|
{ label: '18次', value: 18 },
|
||||||
|
{ label: '19次', value: 19 },
|
||||||
|
{ label: '20次', value: 20 },
|
||||||
|
{ label: '21次', value: 21 },
|
||||||
|
{ label: '22次', value: 22 },
|
||||||
|
{ label: '23次', value: 23 },
|
||||||
|
{ label: '24次', value: 24 },
|
||||||
|
{ label: '25次', value: 25 },
|
||||||
|
{ label: '26次', value: 26 },
|
||||||
|
{ label: '27次', value: 27 },
|
||||||
|
{ label: '28次', value: 28 },
|
||||||
|
{ label: '29次', value: 29 },
|
||||||
|
{ label: '30次', value: 30 },
|
||||||
|
{ label: '31次', value: 31 },
|
||||||
|
{ label: '32次', value: 32 },
|
||||||
|
{ label: '33次', value: 33 },
|
||||||
|
{ label: '34次', value: 34 },
|
||||||
|
{ label: '35次', value: 35 },
|
||||||
|
{ label: '36次', value: 36 },
|
||||||
|
{ label: '37次', value: 37 },
|
||||||
|
{ label: '38次', value: 38 },
|
||||||
|
{ label: '39次', value: 39 },
|
||||||
|
{ label: '40次', value: 40 },
|
||||||
|
{ label: '41次', value: 41 },
|
||||||
|
{ label: '42次', value: 42 },
|
||||||
|
{ label: '43次', value: 43 },
|
||||||
|
{ label: '44次', value: 44 },
|
||||||
|
{ label: '45次', value: 45 },
|
||||||
|
{ label: '46次', value: 46 },
|
||||||
|
{ label: '47次', value: 47 },
|
||||||
|
{ label: '48次', value: 48 },
|
||||||
|
{ label: '49次', value: 49 },
|
||||||
|
{ label: '50次', value: 50 }
|
||||||
|
]
|
||||||
//简谐波次数
|
//简谐波次数
|
||||||
export const inharmonicOptions = [
|
export const inharmonicOptions = [
|
||||||
{ label: '0.5次', value: 1 },
|
{ label: '0.5次', value: 1 },
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
|||||||
} else if (value > -1 && value < 0 && isMin == false) {
|
} else if (value > -1 && value < 0 && isMin == false) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
let base
|
let base
|
||||||
if (Math.abs(o) >= 100) {
|
if (Math.abs(o) >= 100) {
|
||||||
base = 100
|
base = 100
|
||||||
@@ -19,8 +20,11 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
|||||||
} else if (Math.abs(o) >= 1) {
|
} else if (Math.abs(o) >= 1) {
|
||||||
base = 1
|
base = 1
|
||||||
} else {
|
} else {
|
||||||
base = 0.1
|
const multiple = 1 / 0.1
|
||||||
|
|
||||||
|
base = Math.ceil(Math.abs(o) * multiple) / multiple
|
||||||
}
|
}
|
||||||
|
|
||||||
let calculatedValue
|
let calculatedValue
|
||||||
if (isMin) {
|
if (isMin) {
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
@@ -35,18 +39,19 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
|||||||
calculatedValue = value + num * value
|
calculatedValue = value + num * value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (base === 0.1) {
|
if (base === 0.1) {
|
||||||
return parseFloat(calculatedValue.toFixed(1))
|
// return parseFloat(calculatedValue.toFixed(1))
|
||||||
|
return Math.ceil(calculatedValue * 10) / 10
|
||||||
} else if (isMin) {
|
} else if (isMin) {
|
||||||
return Math.floor(calculatedValue / base) * base
|
return Math.floor(calculatedValue / base) * base
|
||||||
} else {
|
} else {
|
||||||
return Math.ceil(calculatedValue / base) * base
|
return Math.ceil(calculatedValue / base) * base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理y轴最大最小值
|
// 处理y轴最大最小值
|
||||||
export const yMethod = (arr: any) => {
|
export const yMethod = (arr: any) => {
|
||||||
let num = 0.1
|
let num = 0.2
|
||||||
let numList = dataProcessing(arr)
|
let numList = dataProcessing(arr)
|
||||||
let maxValue = 0
|
let maxValue = 0
|
||||||
let minValue = 0
|
let minValue = 0
|
||||||
@@ -54,12 +59,9 @@ export const yMethod = (arr: any) => {
|
|||||||
let min = 0
|
let min = 0
|
||||||
maxValue = Math.max(...numList)
|
maxValue = Math.max(...numList)
|
||||||
minValue = Math.min(...numList)
|
minValue = Math.min(...numList)
|
||||||
const o = maxValue - minValue
|
const o = maxValue - minValue == 0 ? maxValue : maxValue - minValue
|
||||||
if (Math.abs(o) >= 300) {
|
|
||||||
num = 0.02
|
|
||||||
}
|
|
||||||
|
|
||||||
min = calculateValue(o, minValue, num, true)
|
min = calculateValue(o, minValue, num, true)
|
||||||
|
|
||||||
max = calculateValue(o, maxValue, num, false)
|
max = calculateValue(o, maxValue, num, false)
|
||||||
// if (-100 >= minValue) {
|
// if (-100 >= minValue) {
|
||||||
// min = Math.floor((minValue + num * minValue) / 100) * 100
|
// min = Math.floor((minValue + num * minValue) / 100) * 100
|
||||||
@@ -158,8 +160,6 @@ export const exportCSV = (title: object, data: any, filename: string) => {
|
|||||||
URL.revokeObjectURL(link.href)
|
URL.revokeObjectURL(link.href)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补全时间序列数据中缺失的条目
|
* 补全时间序列数据中缺失的条目
|
||||||
* @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...]
|
* @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...]
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import { downloadFile } from '@/api/system-boot/file'
|
import { downloadFile } from '@/api/system-boot/file'
|
||||||
|
|
||||||
|
const sanitizeUrl = (url: string): string => {
|
||||||
|
return url.replace(/\[/g, '(').replace(/\]/g, ')')
|
||||||
|
}
|
||||||
|
|
||||||
// 下载文件
|
// 下载文件
|
||||||
export const download = (urls: string) => {
|
export const download = (urls: string) => {
|
||||||
//console.log('下载', urls)
|
//console.log('下载', urls)
|
||||||
@@ -55,10 +60,8 @@ function removeLastDotSuffix(str: string) {
|
|||||||
export const previewFile = async (urls: any) => {
|
export const previewFile = async (urls: any) => {
|
||||||
//console.log('预览', urls)
|
//console.log('预览', urls)
|
||||||
let url = ''
|
let url = ''
|
||||||
//console.log('urls', decodeURI(urls))
|
|
||||||
await downloadFile({ filePath: decodeURI(urls) })
|
await downloadFile({ filePath: decodeURI(urls) })
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
|
|
||||||
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||||
const getFileType = (url: string) => {
|
const getFileType = (url: string) => {
|
||||||
const ext = url.split('.').pop()?.toLowerCase() || ''
|
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||||
@@ -75,10 +78,7 @@ export const previewFile = async (urls: any) => {
|
|||||||
}
|
}
|
||||||
return mimeMap[ext] || ''
|
return mimeMap[ext] || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
||||||
|
|
||||||
|
|
||||||
// 3. 创建下载链接
|
// 3. 创建下载链接
|
||||||
url = window.URL.createObjectURL(blob)
|
url = window.URL.createObjectURL(blob)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ class MQTT {
|
|||||||
clean: true,
|
clean: true,
|
||||||
connectTimeout: 30 * 1000,
|
connectTimeout: 30 * 1000,
|
||||||
clientId: `mqttjs_${Math.random().toString(16).substr(2, 8)}`,
|
clientId: `mqttjs_${Math.random().toString(16).substr(2, 8)}`,
|
||||||
username: 't_user',
|
username: '',
|
||||||
password: 'njcnpqs',
|
password: '',
|
||||||
reconnectPeriod: 1000, // 默认1秒重试一次
|
reconnectPeriod: 1000, // 默认1秒重试一次
|
||||||
maxReconnectTimes: 3 // 默认最大重连5次
|
maxReconnectTimes: 3 // 默认最大重连5次
|
||||||
}
|
}
|
||||||
@@ -50,12 +50,16 @@ class MQTT {
|
|||||||
if (this.client) {
|
if (this.client) {
|
||||||
throw new Error('MQTT 客户端已初始化')
|
throw new Error('MQTT 客户端已初始化')
|
||||||
}
|
}
|
||||||
|
const mqttUrl = localStorage.getItem('MqttUrl')
|
||||||
|
console.log('MQTT URL:', mqttUrl)
|
||||||
|
if (!mqttUrl || mqttUrl === 'null') {
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const mqttUrl =
|
// const mqttUrl =
|
||||||
localStorage.getItem('MqttUrl') == 'null'
|
// localStorage.getItem('MqttUrl') == 'null'
|
||||||
? 'ws://192.168.1.68:8083/mqtt'
|
// ? 'ws://192.168.1.68:8083/mqtt'
|
||||||
: localStorage.getItem('MqttUrl')
|
// : localStorage.getItem('MqttUrl')
|
||||||
|
|
||||||
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
||||||
this.setupEventListeners()
|
this.setupEventListeners()
|
||||||
@@ -77,12 +81,12 @@ class MQTT {
|
|||||||
|
|
||||||
this.client?.on('error', error => {
|
this.client?.on('error', error => {
|
||||||
clearTimeout(timeout)
|
clearTimeout(timeout)
|
||||||
console.error('MQTT 连接错误:', error)
|
console.log('MQTT 连接错误:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('初始化 MQTT 失败:', error)
|
// console.log('初始化 MQTT 失败:', error)
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +135,7 @@ class MQTT {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.client?.subscribe(this.topic, { qos: this.defaultOptions.qos, ...subscribeOptions }, error => {
|
this.client?.subscribe(this.topic, { qos: this.defaultOptions.qos, ...subscribeOptions }, error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('订阅失败:', error)
|
console.log('订阅失败:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
} else {
|
} else {
|
||||||
console.log('订阅成功')
|
console.log('订阅成功')
|
||||||
@@ -153,7 +157,7 @@ class MQTT {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.client?.unsubscribe(this.topic, error => {
|
this.client?.unsubscribe(this.topic, error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('取消订阅失败:', error)
|
console.log('取消订阅失败:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
} else {
|
} else {
|
||||||
console.log('取消订阅成功')
|
console.log('取消订阅成功')
|
||||||
@@ -188,7 +192,7 @@ class MQTT {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.client?.publish(this.topic, message, { qos: this.defaultOptions.qos, ...options }, error => {
|
this.client?.publish(this.topic, message, { qos: this.defaultOptions.qos, ...options }, error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('消息发布失败:', error)
|
console.log('消息发布失败:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
} else {
|
} else {
|
||||||
console.log('消息发布成功')
|
console.log('消息发布成功')
|
||||||
|
|||||||
@@ -104,11 +104,11 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
|||||||
if (token) {
|
if (token) {
|
||||||
;(config.headers as anyObj).Authorization = token
|
;(config.headers as anyObj).Authorization = token
|
||||||
} else {
|
} else {
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
config.headers.Authorization = 'Basic bmpjbjpuamNucHFz'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
config.headers.Authorization = 'Basic bmpjbjpuamNucHFz'
|
||||||
}
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
@@ -145,12 +145,14 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
|||||||
return refreshToken()
|
return refreshToken()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
adminInfo.setToken(res.data.access_token, 'auth')
|
adminInfo.setToken(res.data.access_token, 'auth')
|
||||||
|
adminInfo.setToken(res.data.refresh_token, 'refresh')
|
||||||
window.requests.forEach(cb => cb(res.data.access_token))
|
window.requests.forEach(cb => cb(res.data.access_token))
|
||||||
window.requests = []
|
window.requests = []
|
||||||
|
|
||||||
return Axios(response.config)
|
return Axios(response.config)
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
window.location.reload()
|
||||||
adminInfo.removeToken()
|
adminInfo.removeToken()
|
||||||
router.push({ name: 'login' })
|
router.push({ name: 'login' })
|
||||||
return Promise.reject(err)
|
return Promise.reject(err)
|
||||||
|
|||||||
@@ -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,
|
||||||
@@ -76,6 +77,7 @@ export default class TableStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
index() {
|
index() {
|
||||||
|
|
||||||
this.table.beforeSearchFun && this.table.beforeSearchFun()
|
this.table.beforeSearchFun && this.table.beforeSearchFun()
|
||||||
this.table.data = []
|
this.table.data = []
|
||||||
this.table.loading = true
|
this.table.loading = true
|
||||||
@@ -84,13 +86,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(
|
||||||
@@ -98,10 +98,12 @@ export default class TableStore {
|
|||||||
url: this.url,
|
url: this.url,
|
||||||
method: this.method
|
method: this.method
|
||||||
},
|
},
|
||||||
|
|
||||||
requestPayload(this.method, this.table.params, this.paramsPOST)
|
requestPayload(this.method, this.table.params, this.paramsPOST)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
|
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.table.data = res.data.records || res.data
|
this.table.data = res.data.records || res.data
|
||||||
this.table.total = res.data?.total || res.data.length || 0
|
this.table.total = res.data?.total || res.data.length || 0
|
||||||
@@ -135,8 +137,10 @@ export default class TableStore {
|
|||||||
[
|
[
|
||||||
'search',
|
'search',
|
||||||
() => {
|
() => {
|
||||||
|
|
||||||
this.table.params.pageNum = 1
|
this.table.params.pageNum = 1
|
||||||
this.index()
|
this.index()
|
||||||
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -202,8 +206,10 @@ 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(
|
||||||
@@ -213,12 +219,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 => {
|
||||||
console.log('11111',this.table)
|
this.table.allData = filtration(res.data.records || res.data)
|
||||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||||
this.table.allFlag = data.showAllFlag || true
|
this.table.allFlag = data.showAllFlag || true
|
||||||
})
|
this.table.exportLoading = false
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.table.exportLoading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -147,7 +147,39 @@ export const filter = <T = any>(
|
|||||||
|
|
||||||
return listFilter(tree)
|
return listFilter(tree)
|
||||||
}
|
}
|
||||||
|
export const filterTree = <T = any>(
|
||||||
|
tree: T[],
|
||||||
|
func: (n: T) => boolean,
|
||||||
|
config: Partial<TreeHelperConfig> = {}
|
||||||
|
): T[] => {
|
||||||
|
config = getConfig(config)
|
||||||
|
const children = config.children as string
|
||||||
|
|
||||||
|
function listFilter(list: T[]) {
|
||||||
|
return list
|
||||||
|
.map((node: any) => ({ ...node }))
|
||||||
|
.filter((node) => {
|
||||||
|
// 1. 如果当前节点匹配 → 直接保留【所有子节点】,不再过滤下级
|
||||||
|
if (func(node)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 如果当前节点不匹配,递归过滤子节点
|
||||||
|
if (node[children]) {
|
||||||
|
const filteredChildren = listFilter(node[children]);
|
||||||
|
if (filteredChildren.length > 0) {
|
||||||
|
node[children] = filteredChildren;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 都不匹配,过滤掉
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return listFilter(tree)
|
||||||
|
}
|
||||||
export const forEach = <T = any>(
|
export const forEach = <T = any>(
|
||||||
tree: T[],
|
tree: T[],
|
||||||
func: (n: T) => any,
|
func: (n: T) => any,
|
||||||
|
|||||||
@@ -44,12 +44,10 @@ export default class SocketService {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("🚀 ~ SocketService ~ connect ~ url:", url)
|
||||||
|
if (url === null || (typeof url === 'string' && url.includes('null'))) return;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// ws://192.168.1.69:10407/mgtt
|
|
||||||
// const url =
|
|
||||||
// (localStorage.getItem('WebSocketUrl') == 'null'
|
|
||||||
// ? 'ws://192.168.1.130:10405'
|
|
||||||
// : localStorage.getItem('WebSocketUrl')) + id
|
|
||||||
this.ws = new WebSocket(url)
|
this.ws = new WebSocket(url)
|
||||||
|
|
||||||
this.ws.onopen = () => this.handleOpen()
|
this.ws.onopen = () => this.handleOpen()
|
||||||
@@ -58,7 +56,6 @@ export default class SocketService {
|
|||||||
this.ws.onmessage = event => this.handleMessage(event)
|
this.ws.onmessage = event => this.handleMessage(event)
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理连接成功事件
|
// 处理连接成功事件
|
||||||
private handleOpen(): void {
|
private handleOpen(): void {
|
||||||
ElMessage.success('webSocket连接服务端成功了')
|
ElMessage.success('webSocket连接服务端成功了')
|
||||||
@@ -90,7 +87,7 @@ export default class SocketService {
|
|||||||
|
|
||||||
if (event.data == '连接成功') {
|
if (event.data == '连接成功') {
|
||||||
this.sendHeartbeat()
|
this.sendHeartbeat()
|
||||||
} else if (event.data == 'connect') {
|
} else if (event.data == 'over') {
|
||||||
} else if (event.data.length > 10) {
|
} else if (event.data.length > 10) {
|
||||||
let message: MessageType
|
let message: MessageType
|
||||||
try {
|
try {
|
||||||
@@ -104,7 +101,7 @@ export default class SocketService {
|
|||||||
|
|
||||||
// 通过接受服务端发送的type字段来回调函数
|
// 通过接受服务端发送的type字段来回调函数
|
||||||
|
|
||||||
if ((message.key || message.code) && this.callBackMapping['message']) {
|
if ((message.key || message.code || message.time) && this.callBackMapping['message']) {
|
||||||
this.callBackMapping['message']!(message)
|
this.callBackMapping['message']!(message)
|
||||||
} else {
|
} else {
|
||||||
console.log('抛弃====>')
|
console.log('抛弃====>')
|
||||||
@@ -112,6 +109,7 @@ export default class SocketService {
|
|||||||
// 丢弃或继续写你的逻辑
|
// 丢弃或继续写你的逻辑
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
this.callBackMapping['message']!({ Flag: false })
|
||||||
ElMessage.error(event.data)
|
ElMessage.error(event.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ const options1 = [
|
|||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const heightB = mainHeight(448)
|
const heightB = mainHeight(448)
|
||||||
const heightA = mainHeight(180)
|
const heightA = mainHeight(180)
|
||||||
const size = ref(23)
|
const size = ref(19)
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const detailRef = ref()
|
const detailRef = ref()
|
||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
@@ -786,7 +786,7 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
console.log('🚀 ~ handleNodeClick ~ data:', data)
|
//console.log('🚀 ~ handleNodeClick ~ data:', data)
|
||||||
if (data.level == 6) {
|
if (data.level == 6) {
|
||||||
dotList.value = data
|
dotList.value = data
|
||||||
// dotList.value.id = '6469e77fda42db12c7ca6620a092f03c1'
|
// dotList.value.id = '6469e77fda42db12c7ca6620a092f03c1'
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ const options1 = [
|
|||||||
]
|
]
|
||||||
const height = mainHeight(20)
|
const height = mainHeight(20)
|
||||||
const heightB = mainHeight(445)
|
const heightB = mainHeight(445)
|
||||||
const size = ref(23)
|
const size = ref(19)
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const detailRef = ref()
|
const detailRef = ref()
|
||||||
const dotList: any = ref({})
|
const dotList: any = ref({})
|
||||||
@@ -757,7 +757,7 @@ const timeClick = (row: any) => {
|
|||||||
}
|
}
|
||||||
// 点击越限
|
// 点击越限
|
||||||
const detailClick = (row: any, title: string, key: string) => {
|
const detailClick = (row: any, title: string, key: string) => {
|
||||||
console.log('🚀 ~ detailClick ~ row:', row)
|
// console.log('🚀 ~ detailClick ~ row:', row)
|
||||||
detailRef.value.open({
|
detailRef.value.open({
|
||||||
row: row,
|
row: row,
|
||||||
title: title,
|
title: title,
|
||||||
@@ -802,7 +802,7 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handleNodeClick = (data: any, node: any) => {
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
console.log('🚀 ~ handleNodeClick ~ data:', data)
|
// console.log('🚀 ~ handleNodeClick ~ data:', data)
|
||||||
if (data.level == 6) {
|
if (data.level == 6) {
|
||||||
dotList.value = data
|
dotList.value = data
|
||||||
// dotList.value.id = '6469e77fda42db12c7ca6620a092f03c1'
|
// dotList.value.id = '6469e77fda42db12c7ca6620a092f03c1'
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ const tableStore = new TableStore({
|
|||||||
{ field: 'longitude', title: '经度' },
|
{ field: 'longitude', title: '经度' },
|
||||||
{ field: 'latitude', title: '纬度' },
|
{ field: 'latitude', title: '纬度' },
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
fixed: 'right',
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ const tableStore = new TableStore({
|
|||||||
echarts.value.Grade(tableStore.table.data.voltageStatistics)
|
echarts.value.Grade(tableStore.table.data.voltageStatistics)
|
||||||
echarts.value.Relation(tableStore.table.data.monthlyStatistics)
|
echarts.value.Relation(tableStore.table.data.monthlyStatistics)
|
||||||
table.value.info(tableStore.table.data)
|
table.value.info(tableStore.table.data)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ const loading = ref(false)
|
|||||||
const statistics = ref()
|
const statistics = ref()
|
||||||
|
|
||||||
const flg = ref(true)
|
const flg = ref(true)
|
||||||
const showMqtt = ref(false)
|
|
||||||
const zoom = ref('') //图表焦点校验
|
const zoom = ref('') //图表焦点校验
|
||||||
|
|
||||||
const resultList = ref([
|
const resultList = ref([
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<TableHeader datePicker :showReset="false" showExport ref="TableHeaderRef">
|
<TableHeader datePicker :showReset="false" showExport ref="TableHeaderRef">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="筛选数据">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.loginName" placeholder="请输入"></el-input>
|
<el-input v-model="tableStore.table.params.loginName" placeholder="请输入" clearable maxlength="32" show-word-limit></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
|
|||||||
@@ -289,17 +289,20 @@ const equipment = (row: any) => {}
|
|||||||
const assess = () => {
|
const assess = () => {
|
||||||
// vxeRef.value.getRadioRecord()
|
// vxeRef.value.getRadioRecord()
|
||||||
|
|
||||||
if (equipmentList.value.length == null) {
|
if (equipmentList.value.length == 0) {
|
||||||
return ElMessage.warning('请选择用户')
|
return ElMessage.warning('请选择有终端设备的用户')
|
||||||
}
|
}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
formRef.value.validate((valid: any) => {
|
formRef.value.validate((valid: any) => {
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
form.value.devList = equipmentList.value
|
form.value.devList = equipmentList.value
|
||||||
carryCapacityEvaluate(form.value).then(res => {
|
carryCapacityEvaluate(form.value).then(res => {
|
||||||
rendering(res.data)
|
rendering(res.data)
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -450,7 +453,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 +462,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' // 设置下载的文件名,
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ import TableHeader from '@/components/table/header/index.vue'
|
|||||||
import MyEChart from '@/components/echarts/MyEchart.vue'
|
import MyEChart from '@/components/echarts/MyEchart.vue'
|
||||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import { harmonicOptions } from '@/utils/dictionary'
|
import { harmonicOptions1 } from '@/utils/dictionary'
|
||||||
import { Select } from '@element-plus/icons-vue'
|
import { Select } from '@element-plus/icons-vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import {
|
import {
|
||||||
@@ -202,10 +202,10 @@ import html2canvas from 'html2canvas'
|
|||||||
import { yMethod } from '@/utils/echartMethod'
|
import { yMethod } from '@/utils/echartMethod'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
const props = defineProps(['rowList'])
|
const props = defineProps(['rowList'])
|
||||||
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
const harmonic = harmonicOptions1.filter(item => item.value < 26)
|
||||||
const currentLod = ref(false)
|
const currentLod = ref(false)
|
||||||
const monitoringPoint = useMonitoringPoint()
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const size = ref(23)
|
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
|
||||||
@@ -734,6 +734,7 @@ const choose = (e: any) => {
|
|||||||
|
|
||||||
uploadExcel(e.raw, form).then(res => {
|
uploadExcel(e.raw, form).then(res => {
|
||||||
ElMessage.success('导入成功')
|
ElMessage.success('导入成功')
|
||||||
|
onSubmit()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const tabChange = (e: any) => {
|
const tabChange = (e: any) => {
|
||||||
@@ -843,7 +844,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
.btnBox {
|
.btnBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.vxe-table--header thead tr:first-of-type th:first-of-type) {
|
:deep(.vxe-table--header thead tr:first-of-type th:first-of-type) {
|
||||||
|
|||||||
@@ -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 => {
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ const tableStore: any = new TableStore({
|
|||||||
{ field: 'evaluateDate', title: '评估日期' },
|
{ field: 'evaluateDate', title: '评估日期' },
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
buttons: [
|
buttons: [
|
||||||
@@ -157,7 +157,7 @@ const tableStore: any = new TableStore({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'del',
|
name: 'del',
|
||||||
text: '禁止接入',
|
text: '删除',
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
icon: 'el-icon-Delete',
|
icon: 'el-icon-Delete',
|
||||||
render: 'confirmButton',
|
render: 'confirmButton',
|
||||||
@@ -165,11 +165,11 @@ const tableStore: any = new TableStore({
|
|||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
confirmButtonType: 'danger',
|
confirmButtonType: 'danger',
|
||||||
title: '确定禁止接入?'
|
title: '确定删除?'
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
remove({ ids: row.id }).then(() => {
|
remove({ ids: row.id }).then(() => {
|
||||||
ElMessage.success('禁止接入成功')
|
ElMessage.success('删除成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ defineExpose({ open })
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.formBox{
|
.formBox{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -57,7 +57,13 @@
|
|||||||
|
|
||||||
<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-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">
|
||||||
@@ -95,7 +101,7 @@ 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'
|
import { getAreaDept, getAreaDeptRemoveMode } from '@/api/harmonic-boot/area'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'estimate/photovoltaic'
|
name: 'estimate/photovoltaic'
|
||||||
@@ -108,8 +114,9 @@ const disabled = ref(false)
|
|||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const equipmentRef = ref()
|
const equipmentRef = ref()
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'removeMode'
|
||||||
//const areaList: any = dictData.areaSelect()
|
//const areaList: any = dictData.areaSelect()
|
||||||
const areaList = ref([])
|
const areaList: any = ref([])
|
||||||
const userShow: any = ref('Power_Station_Users')
|
const userShow: any = ref('Power_Station_Users')
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
@@ -188,6 +195,7 @@ const tableStore: any = new TableStore({
|
|||||||
{ field: 'createTime', title: '创建日期' },
|
{ field: 'createTime', title: '创建日期' },
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
fixed: 'right',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
buttons: [
|
buttons: [
|
||||||
@@ -258,9 +266,7 @@ const tableStore: any = new TableStore({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
loadCallback: () => {
|
loadCallback: () => {}
|
||||||
console.log(tableStore.table.data)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
tableStore.table.params.userType = ''
|
tableStore.table.params.userType = ''
|
||||||
@@ -268,8 +274,6 @@ 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
|
||||||
@@ -278,10 +282,14 @@ const useChange = (e: string) => {
|
|||||||
const add = async () => {
|
const add = async () => {
|
||||||
disabled.value = false
|
disabled.value = false
|
||||||
title.value = '新增承载能力待评估用户'
|
title.value = '新增承载能力待评估用户'
|
||||||
|
if (VITE_FLAG) {
|
||||||
|
areaList.value = dictData.state.areaTree
|
||||||
|
} else {
|
||||||
|
await getAreaDept().then(res => {
|
||||||
|
areaList.value = JSON.parse(JSON.stringify(res.data))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
await getAreaDept().then(res => {
|
|
||||||
areaList.value = JSON.parse(JSON.stringify(res.data))
|
|
||||||
})
|
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
// 保存
|
// 保存
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="筛选数据">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
|
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable maxlength="32" show-word-limit/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
<TableHeader datePicker showExport :showReset="false">
|
<TableHeader datePicker showExport :showReset="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="筛选数据">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
|
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable maxlength="32" show-word-limit/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
|
|
||||||
<div :key="key">
|
<div :key="key">
|
||||||
<Table ref="tableRef" :height="'49vh'"></Table>
|
<Table ref="tableRef" :height="'calc(50vh - 100px)'"></Table>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -31,10 +31,12 @@ const dialogVisible = ref(false)
|
|||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/system-boot/frontLog/queryLogCHild',
|
url: '/system-boot/frontLog/queryLogCHild',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
filename: '前置交互日志详情',
|
||||||
column: [
|
column: [
|
||||||
{
|
{
|
||||||
field: 'index',
|
field: 'index',
|
||||||
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
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<TableHeader datePicker showExport>
|
<TableHeader datePicker showExport>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="筛选数据">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
|
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable maxlength="32" show-word-limit/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
@@ -77,7 +77,7 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
buttons: [
|
buttons: [
|
||||||
|
|||||||
@@ -40,7 +40,14 @@
|
|||||||
></Table>
|
></Table>
|
||||||
</div>
|
</div>
|
||||||
<div class="pd10" style="width: 400px" v-loading="loading">
|
<div class="pd10" style="width: 400px" v-loading="loading">
|
||||||
<el-input v-model="filterText" placeholder="请输入内容" clearable show-word-limit @input="change">
|
<el-input
|
||||||
|
v-model="filterText"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
clearable
|
||||||
|
maxlength="32"
|
||||||
|
show-word-limit
|
||||||
|
@input="change"
|
||||||
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
</template>
|
</template>
|
||||||
@@ -83,7 +90,7 @@
|
|||||||
v-else
|
v-else
|
||||||
class="box-item"
|
class="box-item"
|
||||||
title="确定重启吗?"
|
title="确定重启吗?"
|
||||||
placement="bottom"
|
placement="left"
|
||||||
@confirm="restart(data)"
|
@confirm="restart(data)"
|
||||||
>
|
>
|
||||||
<template #actions="{ confirm, cancel }">
|
<template #actions="{ confirm, cancel }">
|
||||||
@@ -141,7 +148,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="最大终端数:" prop="nodeDevNum" class="top">
|
<el-form-item label="最大终端数:" prop="nodeDevNum" class="top">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formData.nodeDevNum"
|
v-model.trim.number="formData.nodeDevNum"
|
||||||
onkeyup="value = value.replace(/[^0-9]/g,'')"
|
onkeyup="value = value.replace(/[^0-9]/g,'')"
|
||||||
maxlength="5"
|
maxlength="5"
|
||||||
placeholder="请输入最大终端数"
|
placeholder="请输入最大终端数"
|
||||||
@@ -149,7 +156,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="最大进程数:" prop="maxProcessNum" class="top">
|
<el-form-item label="最大进程数:" prop="maxProcessNum" class="top">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formData.maxProcessNum"
|
v-model.trim.number="formData.maxProcessNum"
|
||||||
onkeyup="value = value.replace(/[^0-9]/g,'')"
|
onkeyup="value = value.replace(/[^0-9]/g,'')"
|
||||||
maxlength="5"
|
maxlength="5"
|
||||||
placeholder="请根据监测点规模填写合适进程数(1个进程最大可承载200个监测点)"
|
placeholder="请根据监测点规模填写合适进程数(1个进程最大可承载200个监测点)"
|
||||||
@@ -209,7 +216,8 @@ import {
|
|||||||
updateNode,
|
updateNode,
|
||||||
nodeDeviceTree,
|
nodeDeviceTree,
|
||||||
updateDeviceProcess,
|
updateDeviceProcess,
|
||||||
askRestartProcess
|
askRestartProcess,
|
||||||
|
allotTerminal
|
||||||
} from '@/api/device-boot/Business'
|
} from '@/api/device-boot/Business'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
@@ -240,6 +248,7 @@ const tableRef = ref()
|
|||||||
const processNo = ref('')
|
const processNo = ref('')
|
||||||
const ruleFormRef = ref()
|
const ruleFormRef = ref()
|
||||||
const dataSource: any = ref([])
|
const dataSource: any = ref([])
|
||||||
|
const deviceInfoList: any = ref([])
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
children: 'deviceInfoList',
|
children: 'deviceInfoList',
|
||||||
label: 'name'
|
label: 'name'
|
||||||
@@ -271,7 +280,7 @@ const tableStore = new TableStore({
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '名称', field: 'name' },
|
{ title: '名称', field: 'name' },
|
||||||
{ title: 'IP', field: 'ip' ,width:'120px' },
|
{ title: 'IP', field: 'ip', width: '120px' },
|
||||||
{
|
{
|
||||||
title: '等级',
|
title: '等级',
|
||||||
field: 'nodeGrade',
|
field: 'nodeGrade',
|
||||||
@@ -288,7 +297,7 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '最大监测点数量',
|
title: '最大终端数量',
|
||||||
field: 'nodeDevNum'
|
field: 'nodeDevNum'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -316,6 +325,7 @@ const tableStore = new TableStore({
|
|||||||
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
fixed: 'right',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
@@ -350,7 +360,7 @@ const tableStore = new TableStore({
|
|||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
askRestartProcess({
|
askRestartProcess({
|
||||||
deviceRebootType: null,
|
deviceRebootType: 1,
|
||||||
nodeId: row.id,
|
nodeId: row.id,
|
||||||
processNo: 1
|
processNo: 1
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -373,11 +383,41 @@ const tableStore = new TableStore({
|
|||||||
title: '确定删除吗?'
|
title: '确定删除吗?'
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
|
if (hasDevices.value) {
|
||||||
|
ElMessage.warning('此前置机绑定了设备,无法删除!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
delNode(row.id).then(res => {
|
delNode(row.id).then(res => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success('删除成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '分配终端',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'InfoFilled',
|
||||||
|
render: 'confirmButton',
|
||||||
|
popconfirm: {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmButtonType: 'primary',
|
||||||
|
title: '确定分配终端吗?'
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
// if (!hasDevices.value) {
|
||||||
|
// ElMessage.warning('此前置机下无设备,无法分配终端!')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
allotTerminal({
|
||||||
|
nodeId: row.id
|
||||||
|
}).then(res => {
|
||||||
|
ElMessage.success(res.message)
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -395,12 +435,14 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const nodeId = ref('')
|
const nodeId = ref('')
|
||||||
// 点击行
|
const hasDevices = ref(false)
|
||||||
|
/// 点击行
|
||||||
const currentChangeEvent = () => {
|
const currentChangeEvent = () => {
|
||||||
// 确保 tableRef 和当前记录存在
|
// 确保 tableRef 和当前记录存在
|
||||||
if (!tableRef.value || !tableRef.value.getRef().getCurrentRecord()) {
|
if (!tableRef.value || !tableRef.value.getRef().getCurrentRecord()) {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
dataSource.value = []
|
dataSource.value = []
|
||||||
|
hasDevices.value = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,15 +455,26 @@ const currentChangeEvent = () => {
|
|||||||
nodeId.value = tableRef.value.getRef().getCurrentRecord().id
|
nodeId.value = tableRef.value.getRef().getCurrentRecord().id
|
||||||
// 检查返回的数据是否存在且不为空
|
// 检查返回的数据是否存在且不为空
|
||||||
if (res.data && res.data.processDeviceList) {
|
if (res.data && res.data.processDeviceList) {
|
||||||
dataSource.value = res.data.processDeviceList.filter(item => (item.name = item.processNo + ''))
|
// 检查是否有设备绑定
|
||||||
|
const hasAnyDevices = res.data.processDeviceList.some(
|
||||||
|
item => item.deviceInfoList && item.deviceInfoList.length > 0
|
||||||
|
)
|
||||||
|
hasDevices.value = hasAnyDevices
|
||||||
|
|
||||||
|
dataSource.value = res.data.processDeviceList.filter(item => {
|
||||||
|
item.name = item.processNo + ''
|
||||||
|
return true // 保持原有的过滤逻辑
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
dataSource.value = []
|
dataSource.value = []
|
||||||
|
hasDevices.value = false
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// 添加错误处理,确保 loading 状态也能关闭
|
// 添加错误处理,确保 loading 状态也能关闭
|
||||||
dataSource.value = []
|
dataSource.value = []
|
||||||
|
hasDevices.value = false
|
||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -430,11 +483,11 @@ 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: null,
|
||||||
nodeId: nodeId.value,
|
nodeId: nodeId.value,
|
||||||
processNo: 2
|
processNo: data.processNo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
ElMessage.success('重启成功')
|
ElMessage.success('重启成功')
|
||||||
currentChangeEvent()
|
currentChangeEvent()
|
||||||
@@ -472,7 +525,7 @@ const filterNode = (value: string, data: any, node: any) => {
|
|||||||
|
|
||||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||||
const chooseNode = (value: string, data: any, node: any) => {
|
const chooseNode = (value: string, data: any, node: any) => {
|
||||||
if (data.name.indexOf(value) !== -1) {
|
if ((data.subName + data.name).indexOf(value) !== -1) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
const level = node.level
|
const level = node.level
|
||||||
@@ -583,7 +636,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 {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<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.devType" clearable placeholder="请选择终端型号">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminaloption"
|
v-for="item in teriminaloption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
</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.runFlag" clearable placeholder="请选择终端状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminalstatusoption"
|
v-for="item in teriminalstatusoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</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.comFlag" clearable placeholder="请选择通讯状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in stateoption"
|
v-for="item in stateoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
></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"
|
||||||
@@ -41,19 +41,21 @@
|
|||||||
: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"
|
||||||
|
maxlength="32"
|
||||||
|
show-word-limit
|
||||||
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
|
||||||
@@ -104,7 +106,7 @@
|
|||||||
<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"
|
||||||
@@ -250,8 +252,9 @@ const tableStore = new TableStore({
|
|||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.teriminal = ''
|
tableStore.table.params.devType = ''
|
||||||
tableStore.table.params.state = ''
|
tableStore.table.params.runFlag = ''
|
||||||
|
tableStore.table.params.comFlag = ''
|
||||||
tableStore.table.params.program = ''
|
tableStore.table.params.program = ''
|
||||||
tableStore.table.params.searchEvent = ''
|
tableStore.table.params.searchEvent = ''
|
||||||
tableStore.table.params.filterName = ''
|
tableStore.table.params.filterName = ''
|
||||||
|
|||||||
@@ -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 + '性能详情'
|
||||||
|
|||||||