Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
fd09e24cf0 | ||
|
|
2a11891988 | ||
|
|
e7d90c3a73 | ||
|
|
72b1f39814 | ||
|
|
38028b5cb0 | ||
|
|
409999b37b | ||
|
|
0fc7b528d4 | ||
|
|
06764c073a | ||
|
|
26ff8087c6 | ||
|
|
83e57c92b4 | ||
|
|
a9245abb5c | ||
|
|
7a7c584217 | ||
|
|
bf3d033f39 | ||
|
|
42ce7aec5a | ||
|
|
17589e30da | ||
|
|
eb38fdd601 | ||
|
|
454d612a32 | ||
|
|
4dde761784 | ||
| 5f4f75d9dd | |||
|
|
cf7e5fa991 | ||
|
|
4f0dc512e2 | ||
|
|
a77b153ac8 | ||
|
|
dbb6a9f72b | ||
| 9567fe1295 | |||
|
|
a52021572a | ||
| d69a6e1e5d | |||
| a67535abbf | |||
|
|
dffc735edb | ||
|
|
38806367b4 | ||
|
|
6f770aa91d | ||
| dc32cc3bb7 | |||
|
|
d64d18f330 | ||
|
|
909f43e257 | ||
| 92aa66436e | |||
| 264f33302f | |||
|
|
7b9f5302d0 | ||
|
|
72d836020b | ||
|
|
67efef738a | ||
| 6918611d06 | |||
| 9f5b2ecc46 | |||
|
|
d30b8247cf | ||
| 0b61c4b7ba | |||
|
|
ff2b9db7b8 | ||
|
|
289900f9ff | ||
|
|
e87d05c587 | ||
| 46c55d48ec | |||
| b36f765d07 | |||
|
|
0fe2d2b911 | ||
|
|
8c41a8fc77 |
5
.env.hainan
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
NODE_ENV = hainan
|
||||||
|
VITE_NAME="hainan"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
6
.env.qujing
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 云南曲靖
|
||||||
|
NODE_ENV = qujing
|
||||||
|
VITE_NAME="qujing"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
8813
package-lock.json
generated
Normal file
@@ -6,9 +6,13 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --mode dev",
|
"dev": "vite --mode dev",
|
||||||
"dev:jibei": "vite --mode jibei",
|
"dev:jibei": "vite --mode jibei",
|
||||||
|
"dev:hainan": "vite --mode hainan",
|
||||||
|
"dev:qujing": "vite --mode qujing",
|
||||||
"dev:removeMode": "vite --mode removeMode",
|
"dev:removeMode": "vite --mode removeMode",
|
||||||
"build": "vite build --mode dev",
|
"build": "vite build --mode dev",
|
||||||
"build:jibei": "vite build --mode jibei",
|
"build:jibei": "vite build --mode jibei",
|
||||||
|
"build:hainan": "vite build --mode hainan",
|
||||||
|
"build:qujing": "vite build --mode qujing",
|
||||||
"build:removeMode": "vite build --mode removeMode",
|
"build:removeMode": "vite build --mode removeMode",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
@@ -19,7 +23,7 @@
|
|||||||
"@form-create/element-ui": "^3.1.24",
|
"@form-create/element-ui": "^3.1.24",
|
||||||
"@fortawesome/fontawesome-free": "^6.5.1",
|
"@fortawesome/fontawesome-free": "^6.5.1",
|
||||||
"@kjgl77/datav-vue3": "^1.7.4",
|
"@kjgl77/datav-vue3": "^1.7.4",
|
||||||
"@vue-office/docx": "^1.6.2",
|
"@vue-office/docx": "^1.6.3",
|
||||||
"@vue-office/excel": "^1.7.8",
|
"@vue-office/excel": "^1.7.8",
|
||||||
"@vue-office/pdf": "^2.0.2",
|
"@vue-office/pdf": "^2.0.2",
|
||||||
"@vueuse/core": "^10.7.0",
|
"@vueuse/core": "^10.7.0",
|
||||||
|
|||||||
BIN
public/favicon4.ico
Normal file
|
After Width: | Height: | Size: 19 KiB |
@@ -134,6 +134,22 @@ export function selectUserList(data: any) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//获取用户
|
||||||
|
export function selectUserAssessMentList(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/supervision-boot/userReport/selectUserAssessMentList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//绑定用户
|
||||||
|
export function bindAssessmentId(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/supervision-boot/userReport/bindAssessmentId',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
//查询列表
|
//查询列表
|
||||||
export function getStatusManageList(data: any) {
|
export function getStatusManageList(data: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -190,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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,32 +1,47 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
import { DEVICE_BOOT } from '@/utils/constantRequest'
|
import { DEVICE_BOOT } from '@/utils/constantRequest'
|
||||||
|
|
||||||
const MAPPING_PATH = DEVICE_BOOT + '/line'
|
const MAPPING_PATH = DEVICE_BOOT + '/line'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询终端详细信息
|
* 查询终端详细信息
|
||||||
*/
|
*/
|
||||||
export const getDeviceDetailData = (id: string) => {
|
export const getDeviceDetailData = (id: string) => {
|
||||||
return request({
|
return request({
|
||||||
url: MAPPING_PATH + '/getDeviceDetailData?id=' + id,
|
url: MAPPING_PATH + '/getDeviceDetailData?id=' + id,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询监测点详细信息
|
* 查询监测点详细信息
|
||||||
*/
|
*/
|
||||||
export const getLineDetailData = (id: string) => {
|
export const getLineDetailData = (id: string) => {
|
||||||
return request({
|
return request({
|
||||||
url: MAPPING_PATH + '/getLineDetailData?id=' + id,
|
url: MAPPING_PATH + '/getLineDetailData?id=' + id,
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSubstationSelect = () => {
|
export const getSubstationSelect = () => {
|
||||||
return request({
|
return request({
|
||||||
url: 'device-boot/substation/getSubstationSelect',
|
url: 'device-boot/substation/getSubstationSelect',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询变电站详情
|
||||||
|
export const getSubstationSelectLine = (id: string) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getSubstationData',
|
||||||
|
method: 'post',
|
||||||
|
data: [id]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 查询监测点
|
||||||
|
export const getLineOverLimitData = (id: string) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getLineOverLimitData?id=' + id,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -165,3 +165,20 @@ export function getSupervisionDetailsData(data: any) {
|
|||||||
export function getSupervisionCityDetailsData(data: any) {
|
export function getSupervisionCityDetailsData(data: any) {
|
||||||
return request({ url: '/supervision-boot/gridDiagram/getSupervisionCityDetailsData', method: 'post', data })
|
return request({ url: '/supervision-boot/gridDiagram/getSupervisionCityDetailsData', method: 'post', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//区域污染值统计
|
||||||
|
export function getAreaPollution(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/PollutionSubstation/getAreaPollution', method: 'post', data })
|
||||||
|
}
|
||||||
|
//场站级评估
|
||||||
|
export function downPollutionSubCalc(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/PollutionSubstation/downPollutionSubCalc', method: 'post', data })
|
||||||
|
}
|
||||||
|
//监测点评价
|
||||||
|
export function limitTableDetail(data: any) {
|
||||||
|
return request({ url: '/device-boot/dataVerify/limitTableDetail', method: 'post', data })
|
||||||
|
}
|
||||||
|
//重要及敏感用户详情
|
||||||
|
export function downPollutionSensitiveUser(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/PollutionSubstation/downPollutionSensitiveUser', method: 'post', data })
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,72 +1,115 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
//事件报告
|
|
||||||
export function getEventReport(data) {
|
//事件报告
|
||||||
return createAxios({
|
export function getEventReport(data) {
|
||||||
url: '/event-boot/report/getEventReport',
|
return createAxios({
|
||||||
method: 'post',
|
url: '/event-boot/report/getEventReport',
|
||||||
data
|
method: 'post',
|
||||||
})
|
data
|
||||||
}
|
})
|
||||||
// 生成报告
|
}
|
||||||
export function getAreaReport(data) {
|
// 生成报告
|
||||||
return createAxios({
|
export function getAreaReport(data) {
|
||||||
url: '/event-boot/report/getAreaReport',
|
return createAxios({
|
||||||
method: 'post',
|
url: '/event-boot/report/getAreaReport',
|
||||||
data,
|
method: 'post',
|
||||||
responseType: 'blob'
|
data,
|
||||||
})
|
responseType: 'blob'
|
||||||
}
|
}).then(async res => {
|
||||||
//查询所有模板
|
let load: any = await readJsonBlob(res)
|
||||||
export function getList(data) {
|
if (load.code) {
|
||||||
return createAxios({
|
if (load.data.code == 'A0011') {
|
||||||
url: '/system-boot/EventTemplate/getList',
|
ElMessage.warning('下载失败!')
|
||||||
method: 'post',
|
} else {
|
||||||
data
|
ElMessage.warning(load.data.message)
|
||||||
})
|
}
|
||||||
}
|
} else {
|
||||||
export function selectReleation(data) {
|
return res
|
||||||
return createAxios({
|
}
|
||||||
url: '/system-boot/EventTemplate/selectReleation',
|
})
|
||||||
method: 'post',
|
}
|
||||||
params: data
|
async function readJsonBlob(blob) {
|
||||||
})
|
try {
|
||||||
}
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
export function getLineExport(data) {
|
const jsonStr = await blob.text()
|
||||||
return createAxios({
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
url: '/event-boot/report/getLineExport',
|
const jsonData = JSON.parse(jsonStr)
|
||||||
method: 'post',
|
// 3. 拿到数据,后续随便用
|
||||||
data: data,
|
return {
|
||||||
responseType: 'blob'
|
code: true,
|
||||||
})
|
data: jsonData
|
||||||
}
|
}
|
||||||
export function getVoltage(data: any) {
|
} catch (err) {
|
||||||
return createAxios({
|
return {
|
||||||
url: '/event-boot/report/getVoltage',
|
code: false,
|
||||||
method: 'post',
|
data: {}
|
||||||
data
|
}
|
||||||
})
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
}
|
}
|
||||||
export function getGeneralSituation(data: any) {
|
}
|
||||||
return createAxios({
|
|
||||||
url: '/event-boot/report/getGeneralSituation',
|
//查询所有模板
|
||||||
method: 'post',
|
export function getList(data) {
|
||||||
data
|
return createAxios({
|
||||||
})
|
url: '/system-boot/EventTemplate/getList',
|
||||||
}
|
method: 'post',
|
||||||
export function getTransientValue(data: any) {
|
data
|
||||||
return createAxios({
|
})
|
||||||
url: '/event-boot/transient/getTransientValue',
|
}
|
||||||
method: 'post',
|
export function selectReleation(data) {
|
||||||
data
|
return createAxios({
|
||||||
})
|
url: '/system-boot/EventTemplate/selectReleation',
|
||||||
}
|
method: 'post',
|
||||||
// 周报导出
|
params: data
|
||||||
export function getExport(data: any) {
|
})
|
||||||
return createAxios({
|
}
|
||||||
url: '/event-boot/report/getExport',
|
export function getLineExport(data) {
|
||||||
method: 'post',
|
return createAxios({
|
||||||
data,
|
url: '/event-boot/report/getLineExport',
|
||||||
responseType: 'blob'
|
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 getVoltage(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/report/getVoltage',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getGeneralSituation(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/report/getGeneralSituation',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getTransientValue(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/transient/getTransientValue',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 周报导出
|
||||||
|
export function getExport(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/report/getExport',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,48 @@
|
|||||||
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',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// word报告
|
// word报告
|
||||||
export function exportModelJB(data: any) {
|
export function exportModelJB(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/harmonic-boot/exportmodel/exportModelJB',
|
url: '/harmonic-boot/exportmodel/exportModelJB',
|
||||||
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export function getUndocumentednonlinearData() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//获取入网评估报告审核数据
|
//获取系统接入方案审核数据
|
||||||
export function getReportreviewData() {
|
export function getReportreviewData() {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/Process-supervision/Reportreview/getReportreview',
|
url: '/Process-supervision/Reportreview/getReportreview',
|
||||||
|
|||||||
@@ -1,10 +1,60 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
export function exportModel(data: any) {
|
|
||||||
return createAxios({
|
export function exportModel(data: any) {
|
||||||
url: '/harmonic-boot/exportmodel/exportModel',
|
return createAxios({
|
||||||
method: 'post',
|
url: '/harmonic-boot/exportmodel/exportModel',
|
||||||
data: data,
|
method: 'post',
|
||||||
responseType: 'blob'
|
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 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
const SYSTEM_PREFIX = '/system-boot'
|
const SYSTEM_PREFIX = '/system-boot'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -7,8 +7,20 @@ const SYSTEM_PREFIX = '/system-boot'
|
|||||||
* @param file
|
* @param file
|
||||||
*/
|
*/
|
||||||
export const uploadFile = (file: any, path: string) => {
|
export const uploadFile = (file: any, path: string) => {
|
||||||
|
const regex = /\[|\]/g
|
||||||
|
// 替换规则:[ 换成 (,] 换成 )
|
||||||
|
|
||||||
|
const newFile = new File(
|
||||||
|
[file], // 原文件的二进制内容
|
||||||
|
file.name.replace(regex, match => (match === '[' ? '(' : ')')), // 新的文件名
|
||||||
|
{
|
||||||
|
type: file.type, // 复用原文件的MIME类型
|
||||||
|
lastModified: file.lastModified // 复用最后修改时间
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
let form = new FormData()
|
let form = new FormData()
|
||||||
form.append('file', file)
|
form.append('file', newFile)
|
||||||
form.append('path', path)
|
form.append('path', path)
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: SYSTEM_PREFIX + '/file/upload',
|
url: SYSTEM_PREFIX + '/file/upload',
|
||||||
@@ -17,6 +29,11 @@ export const uploadFile = (file: any, path: string) => {
|
|||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data'
|
||||||
},
|
},
|
||||||
data: form
|
data: form
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == `A0000`) {
|
||||||
|
ElMessage.success('文件上传成功!')
|
||||||
|
return res
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +67,7 @@ export const downloadFile = (filePath: any) => {
|
|||||||
/**
|
/**
|
||||||
* 获取文件的短期url展示
|
* 获取文件的短期url展示
|
||||||
*/
|
*/
|
||||||
export const getFileUrl = (params:any) => {
|
export const getFileUrl = (params: any) => {
|
||||||
let form = new FormData()
|
let form = new FormData()
|
||||||
// form.append('filePath', filePath)
|
// form.append('filePath', filePath)
|
||||||
return createAxios({
|
return createAxios({
|
||||||
|
|||||||
@@ -54,6 +54,54 @@
|
|||||||
<div class="content unicode" style="display: block;">
|
<div class="content unicode" style="display: block;">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">253_ipower</div>
|
||||||
|
<div class="code-name">&#xe782;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">电压</div>
|
||||||
|
<div class="code-name">&#xe665;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">三相电压幅值不平衡</div>
|
||||||
|
<div class="code-name">&#xe758;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">电压总谐波畸变率</div>
|
||||||
|
<div class="code-name">&#xe61e;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">闪变</div>
|
||||||
|
<div class="code-name">&#xe612;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">停运事件管理</div>
|
||||||
|
<div class="code-name">&#xe65d;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">在运设备</div>
|
||||||
|
<div class="code-name">&#xe604;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont"></span>
|
||||||
|
<div class="name">异常类_14非智能表在运异常</div>
|
||||||
|
<div class="code-name">&#xe666;</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<span class="icon iconfont"></span>
|
<span class="icon iconfont"></span>
|
||||||
<div class="name">综合评价</div>
|
<div class="name">综合评价</div>
|
||||||
@@ -234,9 +282,9 @@
|
|||||||
<pre><code class="language-css"
|
<pre><code class="language-css"
|
||||||
>@font-face {
|
>@font-face {
|
||||||
font-family: 'iconfont';
|
font-family: 'iconfont';
|
||||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
src: url('iconfont.woff2?t=1765612648830') format('woff2'),
|
||||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
url('iconfont.woff?t=1765612648830') format('woff'),
|
||||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
url('iconfont.ttf?t=1765612648830') format('truetype');
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||||
@@ -262,6 +310,78 @@
|
|||||||
<div class="content font-class">
|
<div class="content font-class">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-a-253_ipower"></span>
|
||||||
|
<div class="name">
|
||||||
|
253_ipower
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-a-253_ipower
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-dianya"></span>
|
||||||
|
<div class="name">
|
||||||
|
电压
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-dianya
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-sanxiangdianyafuzhibupingheng"></span>
|
||||||
|
<div class="name">
|
||||||
|
三相电压幅值不平衡
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-sanxiangdianyafuzhibupingheng
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-dianyazongxiebojibianshuai"></span>
|
||||||
|
<div class="name">
|
||||||
|
电压总谐波畸变率
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-dianyazongxiebojibianshuai
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-shanbian"></span>
|
||||||
|
<div class="name">
|
||||||
|
闪变
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-shanbian
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-tingyunshijianguanli"></span>
|
||||||
|
<div class="name">
|
||||||
|
停运事件管理
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-tingyunshijianguanli
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-zaiyunshebei"></span>
|
||||||
|
<div class="name">
|
||||||
|
在运设备
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-zaiyunshebei
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<span class="icon iconfont icon-yichanglei_14feizhinengbiaozaiyunyichang"></span>
|
||||||
|
<div class="name">
|
||||||
|
异常类_14非智能表在运异常
|
||||||
|
</div>
|
||||||
|
<div class="code-name">.icon-yichanglei_14feizhinengbiaozaiyunyichang
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<span class="icon iconfont icon-zonghepingjia1"></span>
|
<span class="icon iconfont icon-zonghepingjia1"></span>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -532,6 +652,70 @@
|
|||||||
<div class="content symbol">
|
<div class="content symbol">
|
||||||
<ul class="icon_lists dib-box">
|
<ul class="icon_lists dib-box">
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-a-253_ipower"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">253_ipower</div>
|
||||||
|
<div class="code-name">#icon-a-253_ipower</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-dianya"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">电压</div>
|
||||||
|
<div class="code-name">#icon-dianya</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-sanxiangdianyafuzhibupingheng"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">三相电压幅值不平衡</div>
|
||||||
|
<div class="code-name">#icon-sanxiangdianyafuzhibupingheng</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-dianyazongxiebojibianshuai"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">电压总谐波畸变率</div>
|
||||||
|
<div class="code-name">#icon-dianyazongxiebojibianshuai</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-shanbian"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">闪变</div>
|
||||||
|
<div class="code-name">#icon-shanbian</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-tingyunshijianguanli"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">停运事件管理</div>
|
||||||
|
<div class="code-name">#icon-tingyunshijianguanli</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-zaiyunshebei"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">在运设备</div>
|
||||||
|
<div class="code-name">#icon-zaiyunshebei</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="dib">
|
||||||
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-yichanglei_14feizhinengbiaozaiyunyichang"></use>
|
||||||
|
</svg>
|
||||||
|
<div class="name">异常类_14非智能表在运异常</div>
|
||||||
|
<div class="code-name">#icon-yichanglei_14feizhinengbiaozaiyunyichang</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="dib">
|
<li class="dib">
|
||||||
<svg class="icon svg-icon" aria-hidden="true">
|
<svg class="icon svg-icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-zonghepingjia1"></use>
|
<use xlink:href="#icon-zonghepingjia1"></use>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 3482754 */
|
font-family: "iconfont"; /* Project id 3482754 */
|
||||||
src: url('iconfont.woff2?t=1744179175277') format('woff2'),
|
src: url('iconfont.woff2?t=1765612648830') format('woff2'),
|
||||||
url('iconfont.woff?t=1744179175277') format('woff'),
|
url('iconfont.woff?t=1765612648830') format('woff'),
|
||||||
url('iconfont.ttf?t=1744179175277') format('truetype');
|
url('iconfont.ttf?t=1765612648830') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
@@ -13,6 +13,38 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-a-253_ipower:before {
|
||||||
|
content: "\e782";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-dianya:before {
|
||||||
|
content: "\e665";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-sanxiangdianyafuzhibupingheng:before {
|
||||||
|
content: "\e758";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-dianyazongxiebojibianshuai:before {
|
||||||
|
content: "\e61e";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-shanbian:before {
|
||||||
|
content: "\e612";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-tingyunshijianguanli:before {
|
||||||
|
content: "\e65d";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-zaiyunshebei:before {
|
||||||
|
content: "\e604";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-yichanglei_14feizhinengbiaozaiyunyichang:before {
|
||||||
|
content: "\e666";
|
||||||
|
}
|
||||||
|
|
||||||
.icon-zonghepingjia1:before {
|
.icon-zonghepingjia1:before {
|
||||||
content: "\e82f";
|
content: "\e82f";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,62 @@
|
|||||||
"css_prefix_text": "icon-",
|
"css_prefix_text": "icon-",
|
||||||
"description": "",
|
"description": "",
|
||||||
"glyphs": [
|
"glyphs": [
|
||||||
|
{
|
||||||
|
"icon_id": "33424624",
|
||||||
|
"name": "253_ipower",
|
||||||
|
"font_class": "a-253_ipower",
|
||||||
|
"unicode": "e782",
|
||||||
|
"unicode_decimal": 59266
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "12331657",
|
||||||
|
"name": "电压",
|
||||||
|
"font_class": "dianya",
|
||||||
|
"unicode": "e665",
|
||||||
|
"unicode_decimal": 58981
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "33073330",
|
||||||
|
"name": "三相电压幅值不平衡",
|
||||||
|
"font_class": "sanxiangdianyafuzhibupingheng",
|
||||||
|
"unicode": "e758",
|
||||||
|
"unicode_decimal": 59224
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "37400988",
|
||||||
|
"name": "电压总谐波畸变率",
|
||||||
|
"font_class": "dianyazongxiebojibianshuai",
|
||||||
|
"unicode": "e61e",
|
||||||
|
"unicode_decimal": 58910
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "43700638",
|
||||||
|
"name": "闪变",
|
||||||
|
"font_class": "shanbian",
|
||||||
|
"unicode": "e612",
|
||||||
|
"unicode_decimal": 58898
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "25458995",
|
||||||
|
"name": "停运事件管理",
|
||||||
|
"font_class": "tingyunshijianguanli",
|
||||||
|
"unicode": "e65d",
|
||||||
|
"unicode_decimal": 58973
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "35341056",
|
||||||
|
"name": "在运设备",
|
||||||
|
"font_class": "zaiyunshebei",
|
||||||
|
"unicode": "e604",
|
||||||
|
"unicode_decimal": 58884
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "22630860",
|
||||||
|
"name": "异常类_14非智能表在运异常",
|
||||||
|
"font_class": "yichanglei_14feizhinengbiaozaiyunyichang",
|
||||||
|
"unicode": "e666",
|
||||||
|
"unicode_decimal": 58982
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "32402696",
|
"icon_id": "32402696",
|
||||||
"name": "综合评价",
|
"name": "综合评价",
|
||||||
|
|||||||
BIN
src/assets/img/inlogo.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/img/region.png
Normal file
|
After Width: | Height: | Size: 243 KiB |
@@ -6,7 +6,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<TableHeader :showSearch="false">
|
<TableHeader :showSearch="false">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="日期">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
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 },
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="overflow: auto; height: 100vh">
|
<div style="overflow: auto; height: 100vh">
|
||||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url" :options="excelOptions" />
|
<vue-office-excel
|
||||||
|
v-if="urlKey.includes('.xls') || urlKey.includes('.xlsx')"
|
||||||
|
:src="url"
|
||||||
|
:options="excelOptions"
|
||||||
|
/>
|
||||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url" /> -->
|
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url" /> -->
|
||||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
<iframe v-if="urlKey.includes('.pdf')||urlKey.includes('.txt')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||||
<img v-if="url.includes('.png') || url.includes('.jpg') || url.includes('.gif') || url.includes('.bmp')"
|
<img
|
||||||
:src="url" />
|
v-if="
|
||||||
|
urlKey.includes('.png') || urlKey.includes('.jpg') || urlKey.includes('.gif') || urlKey.includes('.bmp')
|
||||||
|
"
|
||||||
|
:src="url"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -18,15 +26,34 @@ import VueOfficeDocx from '@vue-office/docx'
|
|||||||
import VueOfficeExcel from '@vue-office/excel'
|
import VueOfficeExcel from '@vue-office/excel'
|
||||||
//引入VueOfficePdf组件
|
//引入VueOfficePdf组件
|
||||||
import VueOfficePdf from '@vue-office/pdf'
|
import VueOfficePdf from '@vue-office/pdf'
|
||||||
const { push, options, currentRoute } = useRouter()
|
import { downloadFile } from '@/api/system-boot/file'
|
||||||
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
import { previewFile } from '@/utils/fileDownLoad'
|
||||||
|
|
||||||
|
const { push, options, currentRoute } = useRouter()
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||||
|
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
||||||
|
const url = ref('')
|
||||||
|
const excelOptions = ref({})
|
||||||
|
const urlKey = currentRoute.value?.href?.split('?')[1]
|
||||||
|
|
||||||
|
if (VITE_FLAG) {
|
||||||
|
url.value = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||||
|
excelOptions.value = ref({
|
||||||
|
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
setTimeout(async () => {
|
||||||
|
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||||
|
url.value = previewUrl
|
||||||
|
excelOptions.value = ref({
|
||||||
|
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||||
|
})
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
const url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
|
||||||
console.log("🚀 ~ url:", url)
|
|
||||||
const excelOptions = ref({
|
|
||||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
|
||||||
})
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 从路由参数获取文件路径
|
||||||
|
|
||||||
console.log()
|
console.log()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ const processSave = async () => {
|
|||||||
// return result.value || ' '
|
// return result.value || ' '
|
||||||
// }
|
// }
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
console.log(props, 'propspropspropsprops')
|
//console.log(props, 'propspropspropsprops')
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initBpmnModeler()
|
initBpmnModeler()
|
||||||
|
|||||||
@@ -279,6 +279,27 @@ const getResultCss = (status) => {
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getTaskNameItemType = (itemStatus: any) => {
|
||||||
|
if (itemStatus === 1) {
|
||||||
|
return '审批中'
|
||||||
|
}else if (itemStatus === 2) {
|
||||||
|
return '审批通过'
|
||||||
|
}else if (itemStatus === 3) {
|
||||||
|
return '审批不通过'
|
||||||
|
}else if (itemStatus === 4) {
|
||||||
|
return '已取消'
|
||||||
|
}else if (itemStatus === 5) {
|
||||||
|
return '退回'
|
||||||
|
} else if (itemStatus === 6) {
|
||||||
|
return '委派'
|
||||||
|
} else if (itemStatus === 7) {
|
||||||
|
return '审批通过中'
|
||||||
|
} else if (itemStatus === 0) {
|
||||||
|
return '待审批'
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
const getActivityOutgoing = (activity) => {
|
const getActivityOutgoing = (activity) => {
|
||||||
// 如果有 outgoing,则直接使用它
|
// 如果有 outgoing,则直接使用它
|
||||||
if (activity.outgoing && activity.outgoing.length > 0) {
|
if (activity.outgoing && activity.outgoing.length > 0) {
|
||||||
@@ -316,7 +337,9 @@ const elementHover = (element) => {
|
|||||||
!overlays.value && (overlays.value = bpmnModeler.get('overlays'))
|
!overlays.value && (overlays.value = bpmnModeler.get('overlays'))
|
||||||
// 展示信息
|
// 展示信息
|
||||||
// console.log(activityLists.value, 'activityLists.value')
|
// console.log(activityLists.value, 'activityLists.value')
|
||||||
// console.log(element.value, 'element.value')
|
if (element.value.type === 'bpmn:SequenceFlow') {
|
||||||
|
return
|
||||||
|
}
|
||||||
const activity = activityLists.value.find((m) => m.key === element.value.id)
|
const activity = activityLists.value.find((m) => m.key === element.value.id)
|
||||||
// console.log(activity, 'activityactivityactivityactivity')
|
// console.log(activity, 'activityactivityactivityactivity')
|
||||||
if (!activity) {
|
if (!activity) {
|
||||||
@@ -330,22 +353,22 @@ const elementHover = (element) => {
|
|||||||
if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
|
if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
|
||||||
html = `<p>发起人:${processInstance.value.startUser.name}</p>
|
html = `<p>发起人:${processInstance.value.startUser.name}</p>
|
||||||
<p>部门:${processInstance.value.startUser.deptName}</p>
|
<p>部门:${processInstance.value.startUser.deptName}</p>
|
||||||
<p>创建时间:${formatDate(processInstance.value.createTime)}`
|
<p>创建时间:${formatDate(processInstance.value.startTime)}`
|
||||||
} else if (element.value.type === 'bpmn:UserTask') {
|
} else if (element.value.type === 'bpmn:UserTask') {
|
||||||
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
|
||||||
if (!task) {
|
if (!task) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
// let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||||
let dataResult = ''
|
// let dataResult = ''
|
||||||
optionData.forEach((element) => {
|
// optionData.forEach((element) => {
|
||||||
if (element.value == task.status) {
|
// if (element.value == task.status) {
|
||||||
dataResult = element.label
|
// dataResult = element.label
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
html = `<p>审批人:${task.assigneeUser.name}</p>
|
html = `<p>审批人:${task.assigneeUser.name}</p>
|
||||||
<p>部门:${task.assigneeUser.deptName}</p>
|
<p>部门:${task.assigneeUser.deptName}</p>
|
||||||
<p>结果:${dataResult}</p>
|
<p>结果:${getTaskNameItemType(task.status)}</p>
|
||||||
<p>创建时间:${formatDate(task.createTime)}</p>`
|
<p>创建时间:${formatDate(task.createTime)}</p>`
|
||||||
// html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
// html = `<p>审批人:${task.assigneeUser.nickname}</p>
|
||||||
// <p>部门:${task.assigneeUser.deptName}</p>
|
// <p>部门:${task.assigneeUser.deptName}</p>
|
||||||
@@ -368,20 +391,20 @@ const elementHover = (element) => {
|
|||||||
html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
|
html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
|
||||||
}
|
}
|
||||||
} else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
|
} else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
|
||||||
let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
// let optionData = getIntDictOptions(DICT_TYPE.BPM_TASK_STATUS)
|
||||||
let dataResult = ''
|
// let dataResult = ''
|
||||||
optionData.forEach((element) => {
|
// optionData.forEach((element) => {
|
||||||
if (element.value == processInstance.value.status) {
|
// if (element.value == processInstance.value.status) {
|
||||||
dataResult = element.label
|
// dataResult = element.label
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
html = `<p>结果:${dataResult}</p>`
|
// html = `<p>结果:${dataResult}</p>`
|
||||||
// html = `<p>结果:${getIntDictOptions(
|
// html = `<p>结果:${getIntDictOptions(
|
||||||
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
// DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
||||||
// processInstance.value.status
|
// processInstance.value.status
|
||||||
// )}</p>`
|
// )}</p>`
|
||||||
if (processInstance.value.endTime) {
|
if (processInstance.value.endTime) {
|
||||||
html += `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
html = `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
|
elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
|
||||||
@@ -660,7 +683,7 @@ watch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
.element-overlays {
|
.element-overlays {
|
||||||
width: 200px;
|
width: 250px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
color: #fafafa;
|
color: #fafafa;
|
||||||
background: rgb(0 0 0 / 60%);
|
background: rgb(0 0 0 / 60%);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const addTask = (event, options: any = {}) => {
|
|||||||
const ElementFactory = bpmnInstances().elementFactory
|
const ElementFactory = bpmnInstances().elementFactory
|
||||||
const create = bpmnInstances().modeler.get('create')
|
const create = bpmnInstances().modeler.get('create')
|
||||||
|
|
||||||
console.log(ElementFactory, create)
|
//console.log(ElementFactory, create)
|
||||||
|
|
||||||
const shape = ElementFactory.createShape(assign({ type: 'bpmn:UserTask' }, options))
|
const shape = ElementFactory.createShape(assign({ type: 'bpmn:UserTask' }, options))
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ const addTask = (event, options: any = {}) => {
|
|||||||
shape.businessObject.di.isExpanded = options.isExpanded
|
shape.businessObject.di.isExpanded = options.isExpanded
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(event, 'event')
|
//console.log(event, 'event')
|
||||||
console.log(shape, 'shape')
|
//console.log(shape, 'shape')
|
||||||
create.start(event, shape)
|
create.start(event, shape)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ const unwatchBpmn = watch(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('props.bpmnModeler 有值了!!!')
|
//console.log('props.bpmnModeler 有值了!!!')
|
||||||
const w = window as any
|
const w = window as any
|
||||||
w.bpmnInstances = {
|
w.bpmnInstances = {
|
||||||
modeler: props.bpmnModeler,
|
modeler: props.bpmnModeler,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ onBeforeUnmount(() => {
|
|||||||
watch(
|
watch(
|
||||||
() => props.businessObject,
|
() => props.businessObject,
|
||||||
(val) => {
|
(val) => {
|
||||||
console.log(val, 'val')
|
//console.log(val, 'val')
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetFlowCondition()
|
resetFlowCondition()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,491 +1,491 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="panel-tab__content">
|
<div class="panel-tab__content">
|
||||||
<el-table :data="elementListenersList" size="small" border>
|
<el-table :data="elementListenersList" size="small" border>
|
||||||
<el-table-column label="序号" width="80px" type="index" />
|
<el-table-column label="序号" width="80px" type="index" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="事件类型"
|
label="事件类型"
|
||||||
min-width="80px"
|
min-width="80px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => listenerEventTypeObject[row.event]"
|
:formatter="(row) => listenerEventTypeObject[row.event]"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="事件id" min-width="80px" prop="id" show-overflow-tooltip />
|
<el-table-column label="事件id" min-width="80px" prop="id" show-overflow-tooltip />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="监听器类型"
|
label="监听器类型"
|
||||||
min-width="80px"
|
min-width="80px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => listenerTypeObject[row.listenerType]"
|
:formatter="(row) => listenerTypeObject[row.listenerType]"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="90px">
|
<el-table-column label="操作" width="90px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" link @click="openListenerForm(scope.row, scope.$index)"
|
<el-button size="small" link @click="openListenerForm(scope.row, scope.$index)"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
style="color: #ff4d4f"
|
style="color: #ff4d4f"
|
||||||
@click="removeListener(scope.row, scope.$index)"
|
@click="removeListener(scope.row, scope.$index)"
|
||||||
>移除</el-button
|
>移除</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="element-drawer__button">
|
<div class="element-drawer__button">
|
||||||
<XButton
|
<XButton
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
preIcon="ep:plus"
|
preIcon="ep:plus"
|
||||||
title="添加监听器"
|
title="添加监听器"
|
||||||
@click="openListenerForm(null)"
|
@click="openListenerForm(null)"
|
||||||
/>
|
/>
|
||||||
<XButton
|
<XButton
|
||||||
type="success"
|
type="success"
|
||||||
preIcon="ep:select"
|
preIcon="ep:select"
|
||||||
title="选择监听器"
|
title="选择监听器"
|
||||||
size="small"
|
size="small"
|
||||||
@click="openProcessListenerDialog"
|
@click="openProcessListenerDialog"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 监听器 编辑/创建 部分 -->
|
<!-- 监听器 编辑/创建 部分 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
v-model="listenerFormModelVisible"
|
v-model="listenerFormModelVisible"
|
||||||
title="任务监听器"
|
title="任务监听器"
|
||||||
:size="`${width}px`"
|
:size="`${width}px`"
|
||||||
append-to-body
|
append-to-body
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<el-form size="small" :model="listenerForm" label-width="96px" ref="listenerFormRef">
|
<el-form size="small" :model="listenerForm" label-width="96px" ref="listenerFormRef">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="事件类型"
|
label="事件类型"
|
||||||
prop="event"
|
prop="event"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerForm.event">
|
<el-select v-model="listenerForm.event">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="i in Object.keys(listenerEventTypeObject)"
|
v-for="i in Object.keys(listenerEventTypeObject)"
|
||||||
:key="i"
|
:key="i"
|
||||||
:label="listenerEventTypeObject[i]"
|
:label="listenerEventTypeObject[i]"
|
||||||
:value="i"
|
:value="i"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="监听器ID"
|
label="监听器ID"
|
||||||
prop="id"
|
prop="id"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.id" clearable />
|
<el-input v-model="listenerForm.id" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="监听器类型"
|
label="监听器类型"
|
||||||
prop="listenerType"
|
prop="listenerType"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerForm.listenerType">
|
<el-select v-model="listenerForm.listenerType">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="i in Object.keys(listenerTypeObject)"
|
v-for="i in Object.keys(listenerTypeObject)"
|
||||||
:key="i"
|
:key="i"
|
||||||
:label="listenerTypeObject[i]"
|
:label="listenerTypeObject[i]"
|
||||||
:value="i"
|
:value="i"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.listenerType === 'classListener'"
|
v-if="listenerForm.listenerType === 'classListener'"
|
||||||
label="Java类"
|
label="Java类"
|
||||||
prop="class"
|
prop="class"
|
||||||
key="listener-class"
|
key="listener-class"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.class" clearable />
|
<el-input v-model="listenerForm.class" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.listenerType === 'expressionListener'"
|
v-if="listenerForm.listenerType === 'expressionListener'"
|
||||||
label="表达式"
|
label="表达式"
|
||||||
prop="expression"
|
prop="expression"
|
||||||
key="listener-expression"
|
key="listener-expression"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.expression" clearable />
|
<el-input v-model="listenerForm.expression" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.listenerType === 'delegateExpressionListener'"
|
v-if="listenerForm.listenerType === 'delegateExpressionListener'"
|
||||||
label="代理表达式"
|
label="代理表达式"
|
||||||
prop="delegateExpression"
|
prop="delegateExpression"
|
||||||
key="listener-delegate"
|
key="listener-delegate"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.delegateExpression" clearable />
|
<el-input v-model="listenerForm.delegateExpression" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<template v-if="listenerForm.listenerType === 'scriptListener'">
|
<template v-if="listenerForm.listenerType === 'scriptListener'">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="脚本格式"
|
label="脚本格式"
|
||||||
prop="scriptFormat"
|
prop="scriptFormat"
|
||||||
key="listener-script-format"
|
key="listener-script-format"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本格式' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本格式' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.scriptFormat" clearable />
|
<el-input v-model="listenerForm.scriptFormat" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="脚本类型"
|
label="脚本类型"
|
||||||
prop="scriptType"
|
prop="scriptType"
|
||||||
key="listener-script-type"
|
key="listener-script-type"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择脚本类型' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请选择脚本类型' }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerForm.scriptType">
|
<el-select v-model="listenerForm.scriptType">
|
||||||
<el-option label="内联脚本" value="inlineScript" />
|
<el-option label="内联脚本" value="inlineScript" />
|
||||||
<el-option label="外部脚本" value="externalScript" />
|
<el-option label="外部脚本" value="externalScript" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.scriptType === 'inlineScript'"
|
v-if="listenerForm.scriptType === 'inlineScript'"
|
||||||
label="脚本内容"
|
label="脚本内容"
|
||||||
prop="value"
|
prop="value"
|
||||||
key="listener-script"
|
key="listener-script"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本内容' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写脚本内容' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.value" clearable />
|
<el-input v-model="listenerForm.value" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerForm.scriptType === 'externalScript'"
|
v-if="listenerForm.scriptType === 'externalScript'"
|
||||||
label="资源地址"
|
label="资源地址"
|
||||||
prop="resource"
|
prop="resource"
|
||||||
key="listener-resource"
|
key="listener-resource"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写资源地址' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写资源地址' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.resource" clearable />
|
<el-input v-model="listenerForm.resource" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="listenerForm.event === 'timeout'">
|
<template v-if="listenerForm.event === 'timeout'">
|
||||||
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
<el-form-item label="定时器类型" prop="eventDefinitionType" key="eventDefinitionType">
|
||||||
<el-select v-model="listenerForm.eventDefinitionType">
|
<el-select v-model="listenerForm.eventDefinitionType">
|
||||||
<el-option label="日期" value="date" />
|
<el-option label="统计时间" value="date" />
|
||||||
<el-option label="持续时长" value="duration" />
|
<el-option label="持续时长" value="duration" />
|
||||||
<el-option label="循环" value="cycle" />
|
<el-option label="循环" value="cycle" />
|
||||||
<el-option label="无" value="null" />
|
<el-option label="无" value="null" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="!!listenerForm.eventDefinitionType && listenerForm.eventDefinitionType !== 'null'"
|
v-if="!!listenerForm.eventDefinitionType && listenerForm.eventDefinitionType !== 'null'"
|
||||||
label="定时器"
|
label="定时器"
|
||||||
prop="eventTimeDefinitions"
|
prop="eventTimeDefinitions"
|
||||||
key="eventTimeDefinitions"
|
key="eventTimeDefinitions"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写定时器配置' }"
|
:rules="{ required: true, trigger: ['blur', 'change'], message: '请填写定时器配置' }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerForm.eventTimeDefinitions" clearable />
|
<el-input v-model="listenerForm.eventTimeDefinitions" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<p class="listener-filed__title">
|
<p class="listener-filed__title">
|
||||||
<span><Icon icon="ep:menu" />注入字段:</span>
|
<span><Icon icon="ep:menu" />注入字段:</span>
|
||||||
<el-button size="small" type="primary" @click="openListenerFieldForm(null)"
|
<el-button size="small" type="primary" @click="openListenerFieldForm(null)"
|
||||||
>添加字段</el-button
|
>添加字段</el-button
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<el-table
|
<el-table
|
||||||
:data="fieldsListOfListener"
|
:data="fieldsListOfListener"
|
||||||
size="small"
|
size="small"
|
||||||
max-height="240"
|
max-height="240"
|
||||||
fit
|
fit
|
||||||
border
|
border
|
||||||
style="flex: none"
|
style="flex: none"
|
||||||
>
|
>
|
||||||
<el-table-column label="序号" width="80px" type="index" />
|
<el-table-column label="序号" width="80px" type="index" />
|
||||||
<el-table-column label="字段名称" min-width="100px" prop="name" />
|
<el-table-column label="字段名称" min-width="100px" prop="name" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="字段类型"
|
label="字段类型"
|
||||||
min-width="80px"
|
min-width="80px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => fieldTypeObject[row.fieldType]"
|
:formatter="(row) => fieldTypeObject[row.fieldType]"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="字段值/表达式"
|
label="字段值/表达式"
|
||||||
min-width="100px"
|
min-width="100px"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
:formatter="(row) => row.string || row.expression"
|
:formatter="(row) => row.string || row.expression"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="100px">
|
<el-table-column label="操作" width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" link @click="openListenerFieldForm(scope.row, scope.$index)"
|
<el-button size="small" link @click="openListenerFieldForm(scope.row, scope.$index)"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
link
|
link
|
||||||
style="color: #ff4d4f"
|
style="color: #ff4d4f"
|
||||||
@click="removeListenerField(scope.row, scope.$index)"
|
@click="removeListenerField(scope.row, scope.$index)"
|
||||||
>移除</el-button
|
>移除</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div class="element-drawer__button">
|
<div class="element-drawer__button">
|
||||||
<el-button size="small" @click="listenerFormModelVisible = false">取 消</el-button>
|
<el-button size="small" @click="listenerFormModelVisible = false">取 消</el-button>
|
||||||
<el-button size="small" type="primary" @click="saveListenerConfig">保 存</el-button>
|
<el-button size="small" type="primary" @click="saveListenerConfig">保 存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<!-- 注入西段 编辑/创建 部分 -->
|
<!-- 注入西段 编辑/创建 部分 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="字段配置"
|
title="字段配置"
|
||||||
v-model="listenerFieldFormModelVisible"
|
v-model="listenerFieldFormModelVisible"
|
||||||
width="600px"
|
width="600px"
|
||||||
append-to-body
|
append-to-body
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<el-form
|
<el-form
|
||||||
:model="listenerFieldForm"
|
:model="listenerFieldForm"
|
||||||
size="small"
|
size="small"
|
||||||
label-width="96px"
|
label-width="96px"
|
||||||
ref="listenerFieldFormRef"
|
ref="listenerFieldFormRef"
|
||||||
style="height: 136px"
|
style="height: 136px"
|
||||||
>
|
>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="字段名称:"
|
label="字段名称:"
|
||||||
prop="name"
|
prop="name"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerFieldForm.name" clearable />
|
<el-input v-model="listenerFieldForm.name" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="字段类型:"
|
label="字段类型:"
|
||||||
prop="fieldType"
|
prop="fieldType"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-select v-model="listenerFieldForm.fieldType">
|
<el-select v-model="listenerFieldForm.fieldType">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="i in Object.keys(fieldTypeObject)"
|
v-for="i in Object.keys(fieldTypeObject)"
|
||||||
:key="i"
|
:key="i"
|
||||||
:label="fieldTypeObject[i]"
|
:label="fieldTypeObject[i]"
|
||||||
:value="i"
|
:value="i"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerFieldForm.fieldType === 'string'"
|
v-if="listenerFieldForm.fieldType === 'string'"
|
||||||
label="字段值:"
|
label="字段值:"
|
||||||
prop="string"
|
prop="string"
|
||||||
key="field-string"
|
key="field-string"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerFieldForm.string" clearable />
|
<el-input v-model="listenerFieldForm.string" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="listenerFieldForm.fieldType === 'expression'"
|
v-if="listenerFieldForm.fieldType === 'expression'"
|
||||||
label="表达式:"
|
label="表达式:"
|
||||||
prop="expression"
|
prop="expression"
|
||||||
key="field-expression"
|
key="field-expression"
|
||||||
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
:rules="{ required: true, trigger: ['blur', 'change'] }"
|
||||||
>
|
>
|
||||||
<el-input v-model="listenerFieldForm.expression" clearable />
|
<el-input v-model="listenerFieldForm.expression" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button size="small" @click="listenerFieldFormModelVisible = false">取 消</el-button>
|
<el-button size="small" @click="listenerFieldFormModelVisible = false">取 消</el-button>
|
||||||
<el-button size="small" type="primary" @click="saveListenerFiled">确 定</el-button>
|
<el-button size="small" type="primary" @click="saveListenerFiled">确 定</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 选择弹窗 -->
|
<!-- 选择弹窗 -->
|
||||||
<ProcessListenerDialog ref="processListenerDialogRef" @select="selectProcessListener" />
|
<ProcessListenerDialog ref="processListenerDialogRef" @select="selectProcessListener" />
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
import { createListenerObject, updateElementExtensions } from '../../utils'
|
import { createListenerObject, updateElementExtensions } from '../../utils'
|
||||||
import {
|
import {
|
||||||
initListenerForm,
|
initListenerForm,
|
||||||
initListenerType,
|
initListenerType,
|
||||||
eventType,
|
eventType,
|
||||||
listenerType,
|
listenerType,
|
||||||
fieldType,
|
fieldType,
|
||||||
initListenerForm2
|
initListenerForm2
|
||||||
} from './utilSelf'
|
} from './utilSelf'
|
||||||
import ProcessListenerDialog from '@/components/bpmnProcessDesigner/package/penal/listeners/ProcessListenerDialog.vue'
|
import ProcessListenerDialog from '@/components/bpmnProcessDesigner/package/penal/listeners/ProcessListenerDialog.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'UserTaskListeners' })
|
defineOptions({ name: 'UserTaskListeners' })
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: String,
|
id: String,
|
||||||
type: String
|
type: String
|
||||||
})
|
})
|
||||||
const prefix = inject('prefix')
|
const prefix = inject('prefix')
|
||||||
const width = inject('width')
|
const width = inject('width')
|
||||||
const elementListenersList = ref<any[]>([])
|
const elementListenersList = ref<any[]>([])
|
||||||
const listenerEventTypeObject = ref(eventType)
|
const listenerEventTypeObject = ref(eventType)
|
||||||
const listenerTypeObject = ref(listenerType)
|
const listenerTypeObject = ref(listenerType)
|
||||||
const listenerFormModelVisible = ref(false)
|
const listenerFormModelVisible = ref(false)
|
||||||
const listenerForm = ref<any>({})
|
const listenerForm = ref<any>({})
|
||||||
const fieldTypeObject = ref(fieldType)
|
const fieldTypeObject = ref(fieldType)
|
||||||
const fieldsListOfListener = ref<any[]>([])
|
const fieldsListOfListener = ref<any[]>([])
|
||||||
const listenerFieldFormModelVisible = ref(false) // 监听器 注入字段表单弹窗 显示状态
|
const listenerFieldFormModelVisible = ref(false) // 监听器 注入字段表单弹窗 显示状态
|
||||||
const editingListenerIndex = ref(-1) // 监听器所在下标,-1 为新增
|
const editingListenerIndex = ref(-1) // 监听器所在下标,-1 为新增
|
||||||
const editingListenerFieldIndex = ref(-1) // 字段所在下标,-1 为新增
|
const editingListenerFieldIndex = ref(-1) // 字段所在下标,-1 为新增
|
||||||
const listenerFieldForm = ref<any>({}) // 监听器 注入字段 详情表单
|
const listenerFieldForm = ref<any>({}) // 监听器 注入字段 详情表单
|
||||||
const bpmnElement = ref()
|
const bpmnElement = ref()
|
||||||
const bpmnElementListeners = ref()
|
const bpmnElementListeners = ref()
|
||||||
const otherExtensionList = ref()
|
const otherExtensionList = ref()
|
||||||
const listenerFormRef = ref()
|
const listenerFormRef = ref()
|
||||||
const listenerFieldFormRef = ref()
|
const listenerFieldFormRef = ref()
|
||||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||||
|
|
||||||
const resetListenersList = () => {
|
const resetListenersList = () => {
|
||||||
// console.log(
|
// console.log(
|
||||||
// bpmnInstances().bpmnElement,
|
// bpmnInstances().bpmnElement,
|
||||||
// 'window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement'
|
// 'window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement'
|
||||||
// )
|
// )
|
||||||
bpmnElement.value = bpmnInstances().bpmnElement
|
bpmnElement.value = bpmnInstances().bpmnElement
|
||||||
otherExtensionList.value = []
|
otherExtensionList.value = []
|
||||||
bpmnElementListeners.value =
|
bpmnElementListeners.value =
|
||||||
bpmnElement.value.businessObject?.extensionElements?.values.filter(
|
bpmnElement.value.businessObject?.extensionElements?.values.filter(
|
||||||
(ex) => ex.$type === `${prefix}:TaskListener`
|
(ex) => ex.$type === `${prefix}:TaskListener`
|
||||||
) ?? []
|
) ?? []
|
||||||
elementListenersList.value = bpmnElementListeners.value.map((listener) =>
|
elementListenersList.value = bpmnElementListeners.value.map((listener) =>
|
||||||
initListenerType(listener)
|
initListenerType(listener)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const openListenerForm = (listener, index?) => {
|
const openListenerForm = (listener, index?) => {
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listenerForm.value = initListenerForm(listener)
|
listenerForm.value = initListenerForm(listener)
|
||||||
editingListenerIndex.value = index
|
editingListenerIndex.value = index
|
||||||
} else {
|
} else {
|
||||||
listenerForm.value = {}
|
listenerForm.value = {}
|
||||||
editingListenerIndex.value = -1 // 标记为新增
|
editingListenerIndex.value = -1 // 标记为新增
|
||||||
}
|
}
|
||||||
if (listener && listener.fields) {
|
if (listener && listener.fields) {
|
||||||
fieldsListOfListener.value = listener.fields.map((field) => ({
|
fieldsListOfListener.value = listener.fields.map((field) => ({
|
||||||
...field,
|
...field,
|
||||||
fieldType: field.string ? 'string' : 'expression'
|
fieldType: field.string ? 'string' : 'expression'
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
fieldsListOfListener.value = []
|
fieldsListOfListener.value = []
|
||||||
listenerForm.value['fields'] = []
|
listenerForm.value['fields'] = []
|
||||||
}
|
}
|
||||||
// 打开侧边栏并清楚验证状态
|
// 打开侧边栏并清楚验证状态
|
||||||
listenerFormModelVisible.value = true
|
listenerFormModelVisible.value = true
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (listenerFormRef.value) listenerFormRef.value.clearValidate()
|
if (listenerFormRef.value) listenerFormRef.value.clearValidate()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 移除监听器
|
// 移除监听器
|
||||||
const removeListener = (listener, index?) => {
|
const removeListener = (listener, index?) => {
|
||||||
console.log(listener, 'listener')
|
//console.log(listener, 'listener')
|
||||||
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
||||||
confirmButtonText: '确 认',
|
confirmButtonText: '确 认',
|
||||||
cancelButtonText: '取 消'
|
cancelButtonText: '取 消'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
bpmnElementListeners.value.splice(index, 1)
|
bpmnElementListeners.value.splice(index, 1)
|
||||||
elementListenersList.value.splice(index, 1)
|
elementListenersList.value.splice(index, 1)
|
||||||
updateElementExtensions(
|
updateElementExtensions(
|
||||||
bpmnElement.value,
|
bpmnElement.value,
|
||||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.catch(() => console.info('操作取消'))
|
.catch(() => console.info('操作取消'))
|
||||||
}
|
}
|
||||||
// 保存监听器
|
// 保存监听器
|
||||||
const saveListenerConfig = async () => {
|
const saveListenerConfig = async () => {
|
||||||
let validateStatus = await listenerFormRef.value.validate()
|
let validateStatus = await listenerFormRef.value.validate()
|
||||||
if (!validateStatus) return // 验证不通过直接返回
|
if (!validateStatus) return // 验证不通过直接返回
|
||||||
const listenerObject = createListenerObject(listenerForm.value, true, prefix)
|
const listenerObject = createListenerObject(listenerForm.value, true, prefix)
|
||||||
if (editingListenerIndex.value === -1) {
|
if (editingListenerIndex.value === -1) {
|
||||||
bpmnElementListeners.value.push(listenerObject)
|
bpmnElementListeners.value.push(listenerObject)
|
||||||
elementListenersList.value.push(listenerForm.value)
|
elementListenersList.value.push(listenerForm.value)
|
||||||
} else {
|
} else {
|
||||||
bpmnElementListeners.value.splice(editingListenerIndex.value, 1, listenerObject)
|
bpmnElementListeners.value.splice(editingListenerIndex.value, 1, listenerObject)
|
||||||
elementListenersList.value.splice(editingListenerIndex.value, 1, listenerForm.value)
|
elementListenersList.value.splice(editingListenerIndex.value, 1, listenerForm.value)
|
||||||
}
|
}
|
||||||
// 保存其他配置
|
// 保存其他配置
|
||||||
otherExtensionList.value =
|
otherExtensionList.value =
|
||||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||||
) ?? []
|
) ?? []
|
||||||
updateElementExtensions(
|
updateElementExtensions(
|
||||||
bpmnElement.value,
|
bpmnElement.value,
|
||||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||||
)
|
)
|
||||||
// 4. 隐藏侧边栏
|
// 4. 隐藏侧边栏
|
||||||
listenerFormModelVisible.value = false
|
listenerFormModelVisible.value = false
|
||||||
listenerForm.value = {}
|
listenerForm.value = {}
|
||||||
}
|
}
|
||||||
// 打开监听器字段编辑弹窗
|
// 打开监听器字段编辑弹窗
|
||||||
const openListenerFieldForm = (field, index?) => {
|
const openListenerFieldForm = (field, index?) => {
|
||||||
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
|
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
|
||||||
editingListenerFieldIndex.value = field ? index : -1
|
editingListenerFieldIndex.value = field ? index : -1
|
||||||
listenerFieldFormModelVisible.value = true
|
listenerFieldFormModelVisible.value = true
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (listenerFieldFormRef.value) listenerFieldFormRef.value.clearValidate()
|
if (listenerFieldFormRef.value) listenerFieldFormRef.value.clearValidate()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 保存监听器注入字段
|
// 保存监听器注入字段
|
||||||
const saveListenerFiled = async () => {
|
const saveListenerFiled = async () => {
|
||||||
let validateStatus = await listenerFieldFormRef.value.validate()
|
let validateStatus = await listenerFieldFormRef.value.validate()
|
||||||
if (!validateStatus) return // 验证不通过直接返回
|
if (!validateStatus) return // 验证不通过直接返回
|
||||||
if (editingListenerFieldIndex.value === -1) {
|
if (editingListenerFieldIndex.value === -1) {
|
||||||
fieldsListOfListener.value.push(listenerFieldForm.value)
|
fieldsListOfListener.value.push(listenerFieldForm.value)
|
||||||
listenerForm.value.fields.push(listenerFieldForm.value)
|
listenerForm.value.fields.push(listenerFieldForm.value)
|
||||||
} else {
|
} else {
|
||||||
fieldsListOfListener.value.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
fieldsListOfListener.value.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||||
listenerForm.value.fields.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
listenerForm.value.fields.splice(editingListenerFieldIndex.value, 1, listenerFieldForm.value)
|
||||||
}
|
}
|
||||||
listenerFieldFormModelVisible.value = false
|
listenerFieldFormModelVisible.value = false
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
listenerFieldForm.value = {}
|
listenerFieldForm.value = {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 移除监听器字段
|
// 移除监听器字段
|
||||||
const removeListenerField = (field, index) => {
|
const removeListenerField = (field, index) => {
|
||||||
console.log(field, 'field')
|
console.log(field, 'field')
|
||||||
ElMessageBox.confirm('确认移除该字段吗?', '提示', {
|
ElMessageBox.confirm('确认移除该字段吗?', '提示', {
|
||||||
confirmButtonText: '确 认',
|
confirmButtonText: '确 认',
|
||||||
cancelButtonText: '取 消'
|
cancelButtonText: '取 消'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fieldsListOfListener.value.splice(index, 1)
|
fieldsListOfListener.value.splice(index, 1)
|
||||||
listenerForm.value.fields.splice(index, 1)
|
listenerForm.value.fields.splice(index, 1)
|
||||||
})
|
})
|
||||||
.catch(() => console.info('操作取消'))
|
.catch(() => console.info('操作取消'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开监听器弹窗
|
// 打开监听器弹窗
|
||||||
const processListenerDialogRef = ref()
|
const processListenerDialogRef = ref()
|
||||||
const openProcessListenerDialog = async () => {
|
const openProcessListenerDialog = async () => {
|
||||||
processListenerDialogRef.value.open('task')
|
processListenerDialogRef.value.open('task')
|
||||||
}
|
}
|
||||||
const selectProcessListener = (listener) => {
|
const selectProcessListener = (listener) => {
|
||||||
const listenerForm = initListenerForm2(listener)
|
const listenerForm = initListenerForm2(listener)
|
||||||
const listenerObject = createListenerObject(listenerForm, true, prefix)
|
const listenerObject = createListenerObject(listenerForm, true, prefix)
|
||||||
bpmnElementListeners.value.push(listenerObject)
|
bpmnElementListeners.value.push(listenerObject)
|
||||||
elementListenersList.value.push(listenerForm)
|
elementListenersList.value.push(listenerForm)
|
||||||
|
|
||||||
// 保存其他配置
|
// 保存其他配置
|
||||||
otherExtensionList.value =
|
otherExtensionList.value =
|
||||||
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
bpmnElement.value.businessObject?.extensionElements?.values?.filter(
|
||||||
(ex) => ex.$type !== `${prefix}:TaskListener`
|
(ex) => ex.$type !== `${prefix}:TaskListener`
|
||||||
) ?? []
|
) ?? []
|
||||||
updateElementExtensions(
|
updateElementExtensions(
|
||||||
bpmnElement.value,
|
bpmnElement.value,
|
||||||
otherExtensionList.value.concat(bpmnElementListeners.value)
|
otherExtensionList.value.concat(bpmnElementListeners.value)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.id,
|
() => props.id,
|
||||||
(val) => {
|
(val) => {
|
||||||
val &&
|
val &&
|
||||||
val.length &&
|
val.length &&
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetListenersList()
|
resetListenersList()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function initListenerForm(listener) {
|
|||||||
self.eventDefinitionType = key.replace('time', '').toLowerCase()
|
self.eventDefinitionType = key.replace('time', '').toLowerCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(k)
|
//console.log(k)
|
||||||
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body
|
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const modelConfig = computed(() => {
|
|||||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||||
|
|
||||||
const initDataList = () => {
|
const initDataList = () => {
|
||||||
console.log(window, 'window')
|
//console.log(window, 'window')
|
||||||
rootElements.value = bpmnInstances().modeler.getDefinitions().rootElements
|
rootElements.value = bpmnInstances().modeler.getDefinitions().rootElements
|
||||||
messageIdMap.value = {}
|
messageIdMap.value = {}
|
||||||
signalIdMap.value = {}
|
signalIdMap.value = {}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ function xml2json(xml) {
|
|||||||
|
|
||||||
function xmlObj2json(xml) {
|
function xmlObj2json(xml) {
|
||||||
const xmlObj = xmlStr2XmlObj(xml)
|
const xmlObj = xmlStr2XmlObj(xml)
|
||||||
console.log(xmlObj)
|
// console.log(xmlObj)
|
||||||
let jsonObj = {}
|
let jsonObj = {}
|
||||||
if (xmlObj.childNodes.length > 0) {
|
if (xmlObj.childNodes.length > 0) {
|
||||||
jsonObj = xml2json(xmlObj)
|
jsonObj = xml2json(xmlObj)
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ const tableStore: any = new TableStore({
|
|||||||
tableStore.table.params.deptId = dictData.state.area[0].id
|
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||||
tableStore.table.params.alarmDayLimit = 5
|
tableStore.table.params.alarmDayLimit = 5
|
||||||
tableStore.table.params.warnDayLimit = 1
|
tableStore.table.params.warnDayLimit = 1
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
const echart = () => {
|
const echart = () => {
|
||||||
percentage.value = {
|
percentage.value = {
|
||||||
color: ['#FF9100'],
|
color: ['#FF9100'],
|
||||||
@@ -364,6 +365,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
.statistics {
|
.statistics {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="divBox mt10">
|
<div class="divBox mt10">
|
||||||
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
<span class="divBox_title">低于90%监测点数</span>
|
<span class="divBox_title">低于90%监测点数</span>
|
||||||
<span class="divBox_num" style="color: #ff6600">
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
{{ monitoringPoints.abnormalNum }}
|
{{ monitoringPoints.abnormalNum }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
{{ o.citTotalNum }}
|
{{ o.citTotalNum }}
|
||||||
</span>
|
</span>
|
||||||
<!-- 低于90%监测点数 -->
|
<!-- 低于90%监测点数 -->
|
||||||
<span style="flex: 1; color: #ff9100" class="text">
|
<span style="flex: 1; color: #388e3c" class="text">
|
||||||
{{ o.citBelowNum }}
|
{{ o.citBelowNum }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
@@ -179,10 +179,17 @@ const tableStore: any = new TableStore({
|
|||||||
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
abnormal.value = tableStore.table.data.citDetailList
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
const echart = () => {
|
const echart = () => {
|
||||||
percentage.value = {
|
percentage.value = {
|
||||||
color: ['#FF9100'],
|
color: ['#FF9100'],
|
||||||
@@ -216,7 +223,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -233,7 +240,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -242,7 +249,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -263,11 +270,11 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: '#FF9100' // 0% 处的颜色
|
color: '#57bc6e ' // 0% 处的颜色
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#FF9100' // 100% 处的颜色
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -340,6 +347,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
.statistics {
|
.statistics {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="divBox mt10">
|
<div class="divBox mt10">
|
||||||
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
<span class="iconfont icon-igw-f-warning-data" style="color: #ff6600"></span>
|
||||||
<span class="divBox_title">低于90%终端数</span>
|
<span class="divBox_title">低于90%终端数</span>
|
||||||
<span class="divBox_num" style="color: #ff6600">
|
<span class="divBox_num" style="color: #57bc6e">
|
||||||
{{ monitoringPoints.abnormalNum }}
|
{{ monitoringPoints.abnormalNum }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
{{ o.citTotalNum }}
|
{{ o.citTotalNum }}
|
||||||
</span>
|
</span>
|
||||||
<!-- 低于90%终端数 -->
|
<!-- 低于90%终端数 -->
|
||||||
<span style="flex: 1; color: #ff9100" class="text">
|
<span style="flex: 1; color: #388e3c" class="text">
|
||||||
{{ o.citBelowNum }}
|
{{ o.citBelowNum }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
@@ -177,10 +177,18 @@ const tableStore: any = new TableStore({
|
|||||||
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
monitoringPoints.value.runNum = tableStore.table.data.totalNum
|
||||||
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
monitoringPoints.value.abnormalNum = tableStore.table.data.belowNum
|
||||||
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
monitoringPoints.value.totalOnlineRate = tableStore.table.data.totalOnlineRate - 0
|
||||||
abnormal.value = tableStore.table.data.citDetailList
|
abnormal.value = tableStore.table.data.citDetailList.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.citTotalNum != 0
|
||||||
|
} else {
|
||||||
|
return k.citName != '上送国网' && k.citName != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
const echart = () => {
|
const echart = () => {
|
||||||
percentage.value = {
|
percentage.value = {
|
||||||
color: ['#FF9100'],
|
color: ['#FF9100'],
|
||||||
@@ -214,7 +222,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -231,7 +239,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -240,7 +248,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -261,11 +269,11 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: '#FF9100' // 0% 处的颜色
|
color: '#57bc6e' // 0% 处的颜色
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#FF9100' // 100% 处的颜色
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -338,6 +346,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
.statistics {
|
.statistics {
|
||||||
|
|||||||
@@ -18,29 +18,53 @@
|
|||||||
>
|
>
|
||||||
<div style="flex: 1">
|
<div style="flex: 1">
|
||||||
<div class="title">终端统计</div>
|
<div class="title">终端统计</div>
|
||||||
<div style="height: 135px" class="box1">
|
<div
|
||||||
<div class="boxDiv hexagon">
|
class="box1"
|
||||||
<div style="color: #fff">{{ statisticsList.allNum }}</div>
|
:style="{
|
||||||
<div class="mt10 divBot">总数</div>
|
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px - 30px )`,
|
||||||
|
overflow: 'auto'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div class="statistics">
|
||||||
|
<div class="divBox div1">
|
||||||
|
<span class="iconfont icon-qiyezongshu" style="color: #57bc6e"></span>
|
||||||
|
<span class="divBox_title">终端总数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #57bc6e">
|
||||||
|
{{ statisticsList.allNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="divBox div2">
|
||||||
|
<span class="iconfont icon-zaiyunshebei" style="color: #67c23a"></span>
|
||||||
|
<span class="divBox_title">在运终端数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #67c23a">
|
||||||
|
{{ statisticsList.runNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="boxDiv hexagon hexagon1">
|
|
||||||
<div style="color: #fff">{{ statisticsList.runNum }}</div>
|
<div class="statistics">
|
||||||
<div class="mt10 divBot">在运</div>
|
<div class="divBox div3">
|
||||||
</div>
|
<span
|
||||||
</div>
|
class="iconfont icon-yichanglei_14feizhinengbiaozaiyunyichang"
|
||||||
<div style="height: 135px" class="box1">
|
style="color: #ffbf00"
|
||||||
<div class="boxDiv hexagon hexagon2">
|
></span>
|
||||||
<div style="color: #fff">{{ statisticsList.checkNum }}</div>
|
<span class="divBox_title">调试终端数</span>
|
||||||
<div class="mt10 divBot">调试</div>
|
<span class="divBox_num text-style" style="color: #ffbf00">
|
||||||
</div>
|
{{ statisticsList.checkNum }}
|
||||||
<div class="boxDiv hexagon hexagon3">
|
</span>
|
||||||
<div style="color: #fff">{{ statisticsList.stopRunNum }}</div>
|
</div>
|
||||||
<div class="mt10 divBot">停运</div>
|
<div class="divBox div4">
|
||||||
|
<span class="iconfont icon-tingyunshijianguanli" style="color: #f56c6c"></span>
|
||||||
|
<span class="divBox_title">停运终端数</span>
|
||||||
|
<span class="divBox_num text-style" style="color: #f56c6c">
|
||||||
|
{{ statisticsList.stopRunNum }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 2" class="ml15">
|
<div style="flex: 2" class="ml15">
|
||||||
<div class="title">完整性统计</div>
|
<div class="title">终端运行统计</div>
|
||||||
|
|
||||||
<div class="mb5" style="height: 40px">
|
<div class="mb5" style="height: 40px">
|
||||||
<el-segmented
|
<el-segmented
|
||||||
@@ -65,7 +89,7 @@
|
|||||||
<span style="width: 90px">终端总数</span>
|
<span style="width: 90px">终端总数</span>
|
||||||
<span style="flex: 1">完整性(%)</span>
|
<span style="flex: 1">完整性(%)</span>
|
||||||
<span style="flex: 1">在线率(%)</span>
|
<span style="flex: 1">在线率(%)</span>
|
||||||
<span style="flex: 1">合格率(%)</span>
|
<span style="flex: 1">异常率(%)</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
:style="{
|
:style="{
|
||||||
@@ -84,7 +108,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<sp
|
<sp
|
||||||
style="flex: 1; color: #ff9100"
|
style="flex: 1; color: #388e3c"
|
||||||
class="text"
|
class="text"
|
||||||
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
:class="` ${o.integrity < 90 ? 'text-red' : ''}`"
|
||||||
>
|
>
|
||||||
@@ -99,7 +123,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
style="flex: 1; color: #388e3c"
|
style="flex: 1; color: #388e3c"
|
||||||
:class="` ${o.qualified < 90 ? 'text-red' : ''}`"
|
:class="` ${o.qualified > 10 ? 'text-red' : ''}`"
|
||||||
class="text"
|
class="text"
|
||||||
>
|
>
|
||||||
{{ o.qualified }}
|
{{ o.qualified }}
|
||||||
@@ -205,11 +229,17 @@ const tableStore: any = new TableStore({
|
|||||||
statisticsList.value.checkNum = totalData.value.filter(item => item.runFlag === '调试').length
|
statisticsList.value.checkNum = totalData.value.filter(item => item.runFlag === '调试').length
|
||||||
statisticsList.value.stopRunNum = totalData.value.filter(item => item.runFlag === '停运').length
|
statisticsList.value.stopRunNum = totalData.value.filter(item => item.runFlag === '停运').length
|
||||||
|
|
||||||
abnormal.value = tableStore.table.data
|
abnormal.value = tableStore.table.data.filter((k: any) => {
|
||||||
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
|
return k.count != 0
|
||||||
|
} else {
|
||||||
|
return k.name != '上送国网' && k.name != '非上送国网'
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.lineRunFlag = 0
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -234,6 +264,7 @@ watch(
|
|||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@import '@/assets/font/iconfont.css';
|
||||||
.monitoringPoints {
|
.monitoringPoints {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
@@ -344,32 +375,7 @@ watch(
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
.box1 {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-around;
|
|
||||||
.boxDiv {
|
|
||||||
// flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
margin: 0 5px;
|
|
||||||
|
|
||||||
div:nth-child(1) {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 30px;
|
|
||||||
top: -10px;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
.divBot {
|
|
||||||
font-size: 16px;
|
|
||||||
position: absolute;
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.hexagon {
|
.hexagon {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
@@ -427,4 +433,44 @@ watch(
|
|||||||
border-top: 27.5px solid #a52a2a;
|
border-top: 27.5px solid #a52a2a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.statistics {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
.divBox {
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.iconfont {
|
||||||
|
font-size: 40px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.divBox_title {
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
.divBox_num {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-left: auto;
|
||||||
|
font-family: AlimamaDongFangDaKai;
|
||||||
|
}
|
||||||
|
align-items: center;
|
||||||
|
// text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.div1 {
|
||||||
|
background-color: #eef8f0;
|
||||||
|
}
|
||||||
|
.div2 {
|
||||||
|
background-color: #67c23a24;
|
||||||
|
}
|
||||||
|
.div3 {
|
||||||
|
background-color: #ffbf0024;
|
||||||
|
}
|
||||||
|
.div4 {
|
||||||
|
background-color: #f56c6c24;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -15,8 +15,9 @@ import { color, gradeColor3 } from './color'
|
|||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
// import { nextTick } from 'process'
|
// import { nextTick } from 'process'
|
||||||
const emit = defineEmits(['triggerPoint', 'group'])
|
const emit = defineEmits(['triggerPoint', 'group', 'echartClick'])
|
||||||
color[0] = config.layout.elementUiPrimary[0]
|
color[0] = config.layout.elementUiPrimary[0]
|
||||||
|
|
||||||
const chartRef = ref<HTMLDivElement>()
|
const chartRef = ref<HTMLDivElement>()
|
||||||
|
|
||||||
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}
|
||||||
@@ -153,6 +156,8 @@ const initChart = () => {
|
|||||||
chart.on('click', function (params) {
|
chart.on('click', function (params) {
|
||||||
if (params.seriesName == '暂态触发点') {
|
if (params.seriesName == '暂态触发点') {
|
||||||
emit('triggerPoint', params.data)
|
emit('triggerPoint', params.data)
|
||||||
|
} else {
|
||||||
|
emit('echartClick', params)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeUnmount, ref, watch, onMounted, defineEmits } from 'vue'
|
import { onBeforeUnmount, ref, watch, onMounted, } from 'vue'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import 'echarts-gl'
|
import 'echarts-gl'
|
||||||
import 'echarts-liquidfill'
|
import 'echarts-liquidfill'
|
||||||
@@ -19,14 +19,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) => {
|
||||||
|
|||||||
@@ -1,441 +1,441 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div>
|
<div>
|
||||||
<div id="boxi" :style="`height:${vh};overflow: hidden;`">
|
<div id="boxi" :style="`height:${vh};overflow: hidden;`">
|
||||||
<div class="bx" id="wave"></div>
|
<div class="bx" id="wave"></div>
|
||||||
</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%"
|
<el-table stripe :data="Data" :height="height" border style="width: 100%"
|
||||||
header-cell-class-name="table_header">
|
header-cell-class-name="table_header">
|
||||||
<el-table-column align="center" prop="number" label="事件段"></el-table-column>
|
<el-table-column align="center" prop="number" label="事件段"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="波形起始点相位(°)">
|
<el-table-column align="center" prop="number" label="波形起始点相位(°)">
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="跳变段电压变化率(V/ms)">
|
<el-table-column align="center" prop="number" label="跳变段电压变化率(V/ms)">
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="相位跳变(°)">
|
<el-table-column align="center" prop="number" label="相位跳变(°)">
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="总分段数目"></el-table-column>
|
<el-table-column align="center" prop="number" label="总分段数目"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="三相电压不平衡度(%)" width="180"></el-table-column>
|
<el-table-column align="center" prop="number" label="三相电压不平衡度(%)" width="180"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="暂降类型"></el-table-column>
|
<el-table-column align="center" prop="number" label="触发类型"></el-table-column>
|
||||||
<el-table-column align="center" prop="number" label="暂降原因"></el-table-column>
|
<el-table-column align="center" prop="number" label="暂降原因"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import url from '@/assets/img/point.png'
|
import url from '@/assets/img/point.png'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
flag: {
|
flag: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
DColor: {
|
DColor: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
boxoList: {
|
boxoList: {
|
||||||
type: [Object, Array]
|
type: [Object, Array]
|
||||||
},
|
},
|
||||||
GJList: {
|
GJList: {
|
||||||
type: [Object, Array]
|
type: [Object, Array]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
|
|
||||||
valA: 0,
|
valA: 0,
|
||||||
isOpen: false,
|
isOpen: false,
|
||||||
time: '',
|
time: '',
|
||||||
type: '',
|
type: '',
|
||||||
severity: '',
|
severity: '',
|
||||||
iphasic: '',
|
iphasic: '',
|
||||||
eventValue: '',
|
eventValue: '',
|
||||||
persistTime: '',
|
persistTime: '',
|
||||||
lineName: '',
|
lineName: '',
|
||||||
subName: '',
|
subName: '',
|
||||||
waveDatas: [],
|
waveDatas: [],
|
||||||
|
|
||||||
Data: [],
|
Data: [],
|
||||||
height: null,
|
height: null,
|
||||||
vhh: null,
|
vhh: null,
|
||||||
ptpass: '',
|
ptpass: '',
|
||||||
waveHeight: undefined,
|
waveHeight: undefined,
|
||||||
$wave: undefined,
|
$wave: undefined,
|
||||||
color: '#006565',
|
color: '#006565',
|
||||||
charts: {},
|
charts: {},
|
||||||
arrpoints: [],
|
arrpoints: [],
|
||||||
titles: '',
|
titles: '',
|
||||||
vh: null,
|
vh: null,
|
||||||
vw: null,
|
vw: null,
|
||||||
zoom: ''
|
zoom: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() { },
|
created() { },
|
||||||
watch: {
|
watch: {
|
||||||
value: function (a, b) {
|
value: function (a, b) {
|
||||||
if (a == 2) {
|
if (a == 2) {
|
||||||
// $("#wave1").remove();
|
// $("#wave1").remove();
|
||||||
this.initWaves()
|
this.initWaves()
|
||||||
} else {
|
} else {
|
||||||
$('#wave1').remove()
|
$('#wave1').remove()
|
||||||
this.initWaves()
|
this.initWaves()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setHeight()
|
this.setHeight()
|
||||||
window.addEventListener('resize', this.setHeight)
|
window.addEventListener('resize', this.setHeight)
|
||||||
this.$wave = $('#wave').eq(0)
|
this.$wave = $('#wave').eq(0)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.query()
|
this.query()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
window.removeEventListener('resize', this.setHeight)
|
window.removeEventListener('resize', this.setHeight)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setHeight() {
|
setHeight() {
|
||||||
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(250).height
|
||||||
} else {
|
} else {
|
||||||
// console.log(3333);
|
// console.log(3333);
|
||||||
this.vh = mainHeight(270).height
|
this.vh = mainHeight(270).height
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
query() {
|
query() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.initWave()
|
this.initWave()
|
||||||
},
|
},
|
||||||
|
|
||||||
//开始画图
|
//开始画图
|
||||||
initWave() {
|
initWave() {
|
||||||
//清除之前增加的div
|
//清除之前增加的div
|
||||||
// $("#wave ~ .bx1").remove();
|
// $("#wave ~ .bx1").remove();
|
||||||
$('div.bx1').remove()
|
$('div.bx1').remove()
|
||||||
//设置暂降触发点的位置 一次值与二次值Y轴不同(不是计算出来的)
|
//设置暂降触发点的位置 一次值与二次值Y轴不同(不是计算出来的)
|
||||||
// var height = $(window).height() - 90;
|
// var height = $(window).height() - 90;
|
||||||
var picHeight
|
var picHeight
|
||||||
var show = true
|
var show = true
|
||||||
|
|
||||||
//var v = $("#interval").val();
|
//var v = $("#interval").val();
|
||||||
var isvisible = false
|
var isvisible = false
|
||||||
|
|
||||||
picHeight = this.vh
|
picHeight = this.vh
|
||||||
// this.$wave.css('height', picHeight)
|
// this.$wave.css('height', picHeight)
|
||||||
// this.$wave.css('width', '100%')
|
// this.$wave.css('width', '100%')
|
||||||
$('#wave').css('height', picHeight)
|
$('#wave').css('height', picHeight)
|
||||||
$('#wave').css('width', this.vw)
|
$('#wave').css('width', this.vw)
|
||||||
|
|
||||||
var adata = []
|
var adata = []
|
||||||
var bdata = []
|
var bdata = []
|
||||||
var cdata = []
|
var cdata = []
|
||||||
var max = 0
|
var max = 0
|
||||||
var min = 0
|
var min = 0
|
||||||
//绘制横向第一个波形图
|
//绘制横向第一个波形图
|
||||||
this.GJList.smp_x.forEach((item, ind) => {
|
this.GJList.smp_x.forEach((item, ind) => {
|
||||||
if (this.GJList.smp_a[ind] > max) {
|
if (this.GJList.smp_a[ind] > max) {
|
||||||
max = this.GJList.smp_a[ind]
|
max = this.GJList.smp_a[ind]
|
||||||
} else if (this.GJList.smp_a[ind] < min) {
|
} else if (this.GJList.smp_a[ind] < min) {
|
||||||
min = this.GJList.smp_a[ind]
|
min = this.GJList.smp_a[ind]
|
||||||
}
|
}
|
||||||
if (this.GJList.smp_b[ind] > max) {
|
if (this.GJList.smp_b[ind] > max) {
|
||||||
max = this.GJList.smp_b[ind]
|
max = this.GJList.smp_b[ind]
|
||||||
} else if (this.GJList.smp_b[ind] < min) {
|
} else if (this.GJList.smp_b[ind] < min) {
|
||||||
min = this.GJList.smp_b[ind]
|
min = this.GJList.smp_b[ind]
|
||||||
}
|
}
|
||||||
if (this.GJList.smp_c[ind] > max) {
|
if (this.GJList.smp_c[ind] > max) {
|
||||||
max = this.GJList.smp_c[ind]
|
max = this.GJList.smp_c[ind]
|
||||||
} else if (this.GJList.smp_c[ind] < min) {
|
} else if (this.GJList.smp_c[ind] < min) {
|
||||||
min = this.GJList.smp_c[ind]
|
min = this.GJList.smp_c[ind]
|
||||||
}
|
}
|
||||||
|
|
||||||
adata.push([item, this.GJList.smp_a[ind]])
|
adata.push([item, this.GJList.smp_a[ind]])
|
||||||
bdata.push([item, this.GJList.smp_b[ind]])
|
bdata.push([item, this.GJList.smp_b[ind]])
|
||||||
cdata.push([item, this.GJList.smp_c[ind]])
|
cdata.push([item, this.GJList.smp_c[ind]])
|
||||||
})
|
})
|
||||||
//绘制瞬时波形图
|
//绘制瞬时波形图
|
||||||
// const echarts = require('echarts')
|
// const echarts = require('echarts')
|
||||||
let wave = document.getElementById('wave')
|
let wave = document.getElementById('wave')
|
||||||
let _this = this
|
let _this = this
|
||||||
var myChartes = echarts.init(wave)
|
var myChartes = echarts.init(wave)
|
||||||
let echartsColor = {
|
let echartsColor = {
|
||||||
WordColor: '#000',
|
WordColor: '#000',
|
||||||
thread: '#000000',
|
thread: '#000000',
|
||||||
FigureColor: [
|
FigureColor: [
|
||||||
'#07CCCA ',
|
'#07CCCA ',
|
||||||
'#00BFF5',
|
'#00BFF5',
|
||||||
'#FFBF00',
|
'#FFBF00',
|
||||||
'#77DA63',
|
'#77DA63',
|
||||||
'#D5FF6B',
|
'#D5FF6B',
|
||||||
'#Ff6600',
|
'#Ff6600',
|
||||||
'#FF9100',
|
'#FF9100',
|
||||||
'#5B6E96',
|
'#5B6E96',
|
||||||
'#66FFCC',
|
'#66FFCC',
|
||||||
'#B3B3B3',
|
'#B3B3B3',
|
||||||
'#FF00FF',
|
'#FF00FF',
|
||||||
'#CC00FF',
|
'#CC00FF',
|
||||||
'#FF9999'
|
'#FF9999'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
top: '10px',
|
top: '10px',
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
borderColor: 'grey',
|
borderColor: 'grey',
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
style: {
|
style: {
|
||||||
color: '#000',
|
color: '#000',
|
||||||
fontSize: '15px',
|
fontSize: '15px',
|
||||||
padding: 10
|
padding: 10
|
||||||
},
|
},
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
// console.log(params)
|
// console.log(params)
|
||||||
var tips = ''
|
var tips = ''
|
||||||
tips += '时刻:' + params[0].data[0] + '</br/>'
|
tips += '时刻:' + params[0].data[0] + '</br/>'
|
||||||
|
|
||||||
for (var i = 0; i < params.length; i++) {
|
for (var i = 0; i < params.length; i++) {
|
||||||
if (params[i].seriesName != '暂降触发点') {
|
if (params[i].seriesName != '暂降触发点') {
|
||||||
tips += params[i].seriesName + ':' + params[i].value[1] + '<br/>'
|
tips += params[i].seriesName + ':' + params[i].value[1] + '<br/>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tips
|
return tips
|
||||||
},
|
},
|
||||||
// axisPointer: {
|
// axisPointer: {
|
||||||
// type: "cross",
|
// type: "cross",
|
||||||
// label: {
|
// label: {
|
||||||
// color: "#fff",
|
// color: "#fff",
|
||||||
// fontSize: 16,
|
// fontSize: 16,
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontStyle: 'normal',
|
fontStyle: 'normal',
|
||||||
opacity: 0.35,
|
opacity: 0.35,
|
||||||
fontSize: 14
|
fontSize: 14
|
||||||
},
|
},
|
||||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||||
borderWidth: 0
|
borderWidth: 0
|
||||||
},
|
},
|
||||||
|
|
||||||
title: {
|
title: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.measurementPointName,
|
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.measurementPointName,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
left: '5%',
|
left: '5%',
|
||||||
top: '20',
|
top: '20',
|
||||||
verticalAlign: 'top',
|
verticalAlign: 'top',
|
||||||
enabled: true,
|
enabled: true,
|
||||||
itemDistance: 5,
|
itemDistance: 5,
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
rich: {
|
rich: {
|
||||||
a: {
|
a: {
|
||||||
verticalAlign: 'middle'
|
verticalAlign: 'middle'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
padding: [2, 0, 0, 0] //[上、右、下、左]
|
padding: [2, 0, 0, 0] //[上、右、下、左]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toolbox: {
|
toolbox: {
|
||||||
show: false,
|
show: false,
|
||||||
feature: {
|
feature: {
|
||||||
//restore: {},
|
//restore: {},
|
||||||
saveAsImage: {
|
saveAsImage: {
|
||||||
iconStyle: {
|
iconStyle: {
|
||||||
borderColor: _this.DColor ? '#fff' : echartsColor.WordColor
|
borderColor: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: '时刻',
|
name: '时刻',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
min: this.GJList.smp_x[0],
|
min: this.GJList.smp_x[0],
|
||||||
max: this.GJList.smp_x[this.GJList.smp_x.length - 1] + 1,
|
max: this.GJList.smp_x[this.GJList.smp_x.length - 1] + 1,
|
||||||
title: {
|
title: {
|
||||||
text: 'ms',
|
text: 'ms',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
},
|
},
|
||||||
enabled: true,
|
enabled: true,
|
||||||
align: 'high'
|
align: 'high'
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
alignWithLabel: true
|
alignWithLabel: true
|
||||||
},
|
},
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||||
},
|
},
|
||||||
onZero: false //-----------重点
|
onZero: false //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
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)) {
|
||||||
_this.valA = (value - 0).toFixed(0)
|
_this.valA = (value - 0).toFixed(0)
|
||||||
return (value - 0).toFixed(0)
|
return (value - 0).toFixed(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//rotate:39
|
//rotate:39
|
||||||
}
|
}
|
||||||
// data: this.syncExtremes,
|
// data: this.syncExtremes,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: 'kV',
|
name: 'kV',
|
||||||
title: {
|
title: {
|
||||||
align: 'high',
|
align: 'high',
|
||||||
offset: 0,
|
offset: 0,
|
||||||
text: 'kV',
|
text: 'kV',
|
||||||
rotation: 0,
|
rotation: 0,
|
||||||
y: -10
|
y: -10
|
||||||
},
|
},
|
||||||
|
|
||||||
boundaryGap: [0, '100%'],
|
boundaryGap: [0, '100%'],
|
||||||
showLastLabel: true,
|
showLastLabel: true,
|
||||||
max: (max + 10).toFixed(2),
|
max: (max + 10).toFixed(2),
|
||||||
min: (min - 10).toFixed(2),
|
min: (min - 10).toFixed(2),
|
||||||
opposite: false,
|
opposite: false,
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
},
|
},
|
||||||
//minInterval: 1,
|
//minInterval: 1,
|
||||||
type: 'value',
|
type: 'value',
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||||
},
|
},
|
||||||
onZero: false //-----------重点
|
onZero: false //-----------重点
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
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)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
// 使用深浅的间隔色
|
// 使用深浅的间隔色
|
||||||
color: [_this.DColor ? '#fff' : echartsColor.thread],
|
color: [_this.DColor ? '#fff' : echartsColor.thread],
|
||||||
type: 'dashed',
|
type: 'dashed',
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '1%',
|
left: '1%',
|
||||||
right: '40px',
|
right: '40px',
|
||||||
bottom: '40px',
|
bottom: '40px',
|
||||||
top: '55px',
|
top: '55px',
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
dataZoom: [
|
dataZoom: [
|
||||||
{
|
{
|
||||||
type: 'inside',
|
type: 'inside',
|
||||||
height: 13,
|
height: 13,
|
||||||
start: 0,
|
start: 0,
|
||||||
bottom: '20px',
|
bottom: '20px',
|
||||||
end: 100
|
end: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: 0,
|
start: 0,
|
||||||
height: 13,
|
height: 13,
|
||||||
bottom: '20px',
|
bottom: '20px',
|
||||||
end: 100
|
end: 100
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'A相',
|
name: 'A相',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: true,
|
smooth: true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'lttb',
|
sampling: 'lttb',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#DAA520'
|
color: '#DAA520'
|
||||||
},
|
},
|
||||||
data: adata
|
data: adata
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'B相',
|
name: 'B相',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: true,
|
smooth: true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'lttb',
|
sampling: 'lttb',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#2E8B57'
|
color: '#2E8B57'
|
||||||
},
|
},
|
||||||
data: bdata
|
data: bdata
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'C相',
|
name: 'C相',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: true,
|
smooth: true,
|
||||||
symbol: 'none',
|
symbol: 'none',
|
||||||
sampling: 'lttb',
|
sampling: 'lttb',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#A52a2a'
|
color: '#A52a2a'
|
||||||
},
|
},
|
||||||
data: cdata
|
data: cdata
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '暂降触发点',
|
name: '暂降触发点',
|
||||||
type: 'scatter',
|
type: 'scatter',
|
||||||
symbol: 'image://' + url,
|
symbol: 'image://' + url,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
width: 16,
|
width: 16,
|
||||||
height: 16
|
height: 16
|
||||||
},
|
},
|
||||||
data: [[0, min]]
|
data: [[0, min]]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
myChartes.setOption(option)
|
myChartes.setOption(option)
|
||||||
// window.echartsArr.push(myChartes)
|
// window.echartsArr.push(myChartes)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
myChartes.resize()
|
myChartes.resize()
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}, 400)
|
}, 400)
|
||||||
|
|
||||||
//第一个波形图数据绘制完毕后,绘制后续的波形图
|
//第一个波形图数据绘制完毕后,绘制后续的波形图
|
||||||
|
|
||||||
// let waveDatasTemp = waveDatas.slice(1);
|
// let waveDatasTemp = waveDatas.slice(1);
|
||||||
// waveDatasTemp.reverse();
|
// waveDatasTemp.reverse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
export let color = [
|
export const color = [
|
||||||
'#07CCCA',
|
'#07CCCA',
|
||||||
'#00BFF5',
|
'#00BFF5',
|
||||||
'#FFBF00',
|
'#FFBF00',
|
||||||
'#77DA63',
|
'#77DA63',
|
||||||
'#D5FF6B',
|
'#D5FF6B',
|
||||||
'#Ff6600',
|
'#Ff6600',
|
||||||
'#FF9100',
|
'#FF9100',
|
||||||
'#5B6E96',
|
'#5B6E96',
|
||||||
'#66FFCC',
|
'#66FFCC',
|
||||||
'#B3B'
|
'#B266FF',
|
||||||
]
|
'#FF6680',
|
||||||
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
'#40A0FF',
|
||||||
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
'#33CC99'
|
||||||
|
]
|
||||||
|
export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a']
|
||||||
|
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900', '#996600', '#A52a2a']
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ const timeChange = (e: number) => {
|
|||||||
|
|
||||||
// 当前
|
// 当前
|
||||||
const nowTime = () => {
|
const nowTime = () => {
|
||||||
console.log(interval.value, '000000000')
|
//console.log(interval.value, '000000000')
|
||||||
timeChange(interval.value)
|
timeChange(interval.value)
|
||||||
}
|
}
|
||||||
// 上一个
|
// 上一个
|
||||||
@@ -312,7 +312,7 @@ const next = () => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
month = month + 3
|
month = month + 3
|
||||||
console.log('🚀 ~ next ~ presentM:', presentM, month)
|
// console.log('🚀 ~ next ~ presentM:', presentM, month)
|
||||||
|
|
||||||
// 季度进位后,超过当前月份是不科学的
|
// 季度进位后,超过当前月份是不科学的
|
||||||
if (year == presentY && !props.nextFlag) {
|
if (year == presentY && !props.nextFlag) {
|
||||||
@@ -327,7 +327,7 @@ const next = () => {
|
|||||||
endTime = year + '-0' + presentM + '-' + presentD
|
endTime = year + '-0' + presentM + '-' + presentD
|
||||||
}
|
}
|
||||||
} else if (presentM > 3 && presentM < 7) {
|
} else if (presentM > 3 && presentM < 7) {
|
||||||
console.log(123123)
|
// console.log(123123)
|
||||||
// 第二季度
|
// 第二季度
|
||||||
startTime = year + '-04-01'
|
startTime = year + '-04-01'
|
||||||
if (presentD < 10) {
|
if (presentD < 10) {
|
||||||
@@ -380,7 +380,7 @@ const next = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(startTime, endTime)
|
// console.log(startTime, endTime)
|
||||||
} else if (interval.value == 5) {
|
} else if (interval.value == 5) {
|
||||||
} else if (interval.value == 4) {
|
} else if (interval.value == 4) {
|
||||||
//根据开始时间推
|
//根据开始时间推
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export const defaultAttribute: VxeTableProps = {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
headerCellClassName: 'table-header-cell',
|
headerCellClassName: 'table-header-cell',
|
||||||
border: true,
|
border: true,
|
||||||
|
stripe: true,
|
||||||
size: 'small',
|
size: 'small',
|
||||||
columnConfig: { resizable: true },
|
columnConfig: { resizable: true },
|
||||||
rowConfig: { isCurrent: true, isHover: true },
|
rowConfig: { isCurrent: true, isHover: true },
|
||||||
@@ -13,6 +13,7 @@ export const defaultAttribute: VxeTableProps = {
|
|||||||
treeConfig: {
|
treeConfig: {
|
||||||
reserve: true
|
reserve: true
|
||||||
},
|
},
|
||||||
|
showOverflow: true,
|
||||||
showOverflow: true
|
showFooter:true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
>
|
>
|
||||||
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
||||||
<template #label>
|
<template #label>
|
||||||
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="时间" />
|
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="统计时间" />
|
||||||
<span v-else>{{ dateLabel }}</span>
|
<span v-else>{{ dateLabel }}</span>
|
||||||
</template>
|
</template>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="区域" v-if="area">
|
<el-form-item label="区域" v-if="area">
|
||||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" />
|
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<slot name="select"></slot>
|
<slot name="select"></slot>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
@click="onExport"
|
@click="onExport"
|
||||||
v-if="showExport"
|
v-if="showExport"
|
||||||
:loading="tableStore.table.loading"
|
:loading="tableStore.table.exportLoading"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-Download"
|
icon="el-icon-Download"
|
||||||
>
|
>
|
||||||
@@ -81,7 +81,7 @@ import { mainHeight } from '@/utils/layout'
|
|||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
const emit = defineEmits(['selectChange'])
|
const emit = defineEmits(['selectChange','areaChange'])
|
||||||
const tableStore = inject('tableStore') as TableStore
|
const tableStore = inject('tableStore') as TableStore
|
||||||
const tableHeader = ref()
|
const tableHeader = ref()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
@@ -111,7 +111,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
showReset: true,
|
showReset: true,
|
||||||
showExport: false,
|
showExport: false,
|
||||||
showTimeAll: false,
|
showTimeAll: false,
|
||||||
dateLabel: '时间'
|
dateLabel: '统计日期'
|
||||||
})
|
})
|
||||||
// 动态计算table高度
|
// 动态计算table高度
|
||||||
const resizeObserver = new ResizeObserver(entries => {
|
const resizeObserver = new ResizeObserver(entries => {
|
||||||
@@ -132,11 +132,17 @@ const headerFormSecondStyleClose = {
|
|||||||
padding: '0'
|
padding: '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onAreaChange = (data) => {
|
||||||
|
|
||||||
|
emit('areaChange', {label: data.label})
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => tableStore?.table.params.deptIndex,
|
() => tableStore?.table.params.deptIndex,
|
||||||
newVal => {
|
newVal => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
areaRef.value && areaRef.value.change()
|
areaRef.value && areaRef.value.change()
|
||||||
|
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -182,7 +188,7 @@ const handlerHeight = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const computedSearchRow = () => {
|
const computedSearchRow = () => {
|
||||||
if (!headerForm.value.$el) return
|
if (!headerForm.value?.$el) return
|
||||||
// 清空headerFormSecond.value.$el下的元素
|
// 清空headerFormSecond.value.$el下的元素
|
||||||
while (headerFormSecond.value.$el.firstChild) {
|
while (headerFormSecond.value.$el.firstChild) {
|
||||||
headerForm.value.$el.appendChild(headerFormSecond.value.$el.firstChild)
|
headerForm.value.$el.appendChild(headerFormSecond.value.$el.firstChild)
|
||||||
@@ -231,6 +237,26 @@ const setDatePicker = (list: any) => {
|
|||||||
const onResetForm = () => {
|
const onResetForm = () => {
|
||||||
//时间重置成默认值
|
//时间重置成默认值
|
||||||
datePickerRef.value?.setTheDate(3)
|
datePickerRef.value?.setTheDate(3)
|
||||||
|
|
||||||
|
if(props.showTimeAll){
|
||||||
|
timeAll.value = false
|
||||||
|
delete tableStore.table.params.searchBeginTime
|
||||||
|
delete tableStore.table.params.searchEndTime
|
||||||
|
delete tableStore.table.params.startTime
|
||||||
|
delete tableStore.table.params.endTime
|
||||||
|
delete tableStore.table.params.timeFlag
|
||||||
|
delete tableStore.table.params.interval
|
||||||
|
}
|
||||||
|
|
||||||
|
if (props.datePicker && timeAll.value) {
|
||||||
|
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||||
|
tableStore.table.params.searchEndTime = datePickerRef.value.timeValue[1]
|
||||||
|
tableStore.table.params.startTime = datePickerRef.value.timeValue[0]
|
||||||
|
tableStore.table.params.endTime = datePickerRef.value.timeValue[1]
|
||||||
|
tableStore.table.params.timeFlag = datePickerRef.value.timeFlag
|
||||||
|
tableStore.table.params.interval = datePickerRef.value.interval
|
||||||
|
}
|
||||||
|
|
||||||
tableStore.onTableAction('reset', {})
|
tableStore.onTableAction('reset', {})
|
||||||
}
|
}
|
||||||
const setTheDate = (val: any) => {
|
const setTheDate = (val: any) => {
|
||||||
@@ -238,7 +264,7 @@ const setTheDate = (val: any) => {
|
|||||||
}
|
}
|
||||||
// 导出
|
// 导出
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
console.log('导出')
|
|
||||||
tableStore.onTableAction('export', { showAllFlag: true })
|
tableStore.onTableAction('export', { showAllFlag: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
187
src/components/tree/allocation.vue
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
||||||
|
<div class="mt15 mr10" style="display: flex; justify-content: end">
|
||||||
|
<el-button type="primary" icon="el-icon-Select" @click="save" :loading="loading">保存</el-button>
|
||||||
|
</div>
|
||||||
|
<Icon
|
||||||
|
v-show="menuCollapse"
|
||||||
|
@click="onMenuCollapse"
|
||||||
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
|
size="18"
|
||||||
|
class="fold ml10 mt20 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
/>
|
||||||
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
|
<el-input maxlength="32" show-word-limit v-model.trim="filterText" placeholder="请输入内容" clearable>
|
||||||
|
<template #prefix>
|
||||||
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
<el-tooltip placement="bottom" :hide-after="0" v-if="props.showPush">
|
||||||
|
<template #content>
|
||||||
|
<span>台账推送</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<Icon
|
||||||
|
name="el-icon-Promotion"
|
||||||
|
size="20"
|
||||||
|
class="fold ml10 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
:style="{ color: config.getColorVal('elementUiPrimary') }"
|
||||||
|
@click="onAdd"
|
||||||
|
/>
|
||||||
|
</el-tooltip>
|
||||||
|
<!-- <Icon @click='onMenuCollapse' :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'" v-else
|
||||||
|
:class="menuCollapse ? 'unfold' : ''" size='18' class='fold ml10 menu-collapse'
|
||||||
|
style='cursor: pointer' v-if='props.canExpand' /> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-tree
|
||||||
|
:style="{ height: 'calc(100vh - 235px)' }"
|
||||||
|
style="overflow: auto"
|
||||||
|
ref="treeRef"
|
||||||
|
:props="defaultProps"
|
||||||
|
highlight-current
|
||||||
|
:default-expand-all="false"
|
||||||
|
@check-change="checkTreeNodeChange"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
node-key="id"
|
||||||
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span class="custom-tree-node">
|
||||||
|
<Icon
|
||||||
|
:name="data.icon"
|
||||||
|
style="font-size: 16px"
|
||||||
|
:style="{ color: data.color }"
|
||||||
|
v-if="data.icon"
|
||||||
|
/>
|
||||||
|
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||||
|
import { ElTree } from 'element-plus'
|
||||||
|
import { emit } from 'process'
|
||||||
|
import { ref, watch } from 'vue'
|
||||||
|
import { t } from 'vxe-table'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'govern/tree'
|
||||||
|
})
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
width?: string
|
||||||
|
canExpand?: boolean
|
||||||
|
showPush?: boolean
|
||||||
|
}
|
||||||
|
const loading = ref(false)
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
width: '280px',
|
||||||
|
canExpand: true,
|
||||||
|
showPush: false
|
||||||
|
})
|
||||||
|
const config = useConfig()
|
||||||
|
const { proxy } = useCurrentInstance()
|
||||||
|
const menuCollapse = ref(false)
|
||||||
|
const filterText = ref('')
|
||||||
|
const defaultProps = {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id'
|
||||||
|
}
|
||||||
|
const emit = defineEmits(['checkTreeNodeChange', 'onAdd', 'checkChange'])
|
||||||
|
watch(filterText, val => {
|
||||||
|
treeRef.value!.filter(val)
|
||||||
|
})
|
||||||
|
const onMenuCollapse = () => {
|
||||||
|
menuCollapse.value = !menuCollapse.value
|
||||||
|
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||||
|
}
|
||||||
|
const save = () => {
|
||||||
|
loading.value = true
|
||||||
|
emit('checkChange')
|
||||||
|
}
|
||||||
|
const filterNode = (value: string, data: any, node: any) => {
|
||||||
|
console.log(value, data, node, 'filterNode')
|
||||||
|
if (!value) return true
|
||||||
|
// return data.name.includes(value)
|
||||||
|
if (data.name) {
|
||||||
|
return chooseNode(value, data, node)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||||
|
const chooseNode = (value: string, data: any, node: any) => {
|
||||||
|
if (data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const level = node.level
|
||||||
|
// 如果传入的节点本身就是一级节点就不用校验了
|
||||||
|
if (level === 1) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 先取当前节点的父节点
|
||||||
|
let parentData = node.parent
|
||||||
|
// 遍历当前节点的父节点
|
||||||
|
let index = 0
|
||||||
|
while (index < level - 1) {
|
||||||
|
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||||
|
if (parentData.data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 否则的话再往上一层做匹配
|
||||||
|
parentData = parentData.parent
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
// 没匹配到返回false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const checkTreeNodeChange = () => {
|
||||||
|
// console.log(treeRef.value?.getCheckedNodes(), "ikkkkkiisiiisis");
|
||||||
|
emit('checkTreeNodeChange', treeRef.value?.getCheckedNodes())
|
||||||
|
}
|
||||||
|
|
||||||
|
const onAdd = () => {
|
||||||
|
emit('onAdd')
|
||||||
|
}
|
||||||
|
|
||||||
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||||
|
defineExpose({ treeRef, loading })
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cn-tree {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
:deep(.el-tree) {
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||||
|
background-color: var(--el-color-primary-light-7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-collapse {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-tree-node {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
205
src/components/tree/details/monitoringPointDetails.vue
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog draggable v-model="dialogVisible" :title="title" width="1200px">
|
||||||
|
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||||
|
<el-tab-pane label="监测点详情" name="tab1">
|
||||||
|
<el-descriptions :column="3" border label-width="150px">
|
||||||
|
<el-descriptions-item label="项目工程">
|
||||||
|
{{ details.areaName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="项目单位">
|
||||||
|
{{ details.gdName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="所属变电站">
|
||||||
|
{{ details.bdName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压等级">
|
||||||
|
{{ details.scale }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端厂家">
|
||||||
|
{{ details.manufacturer }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端名称">
|
||||||
|
{{ details.devName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="网络参数">
|
||||||
|
{{ details.ip }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点名称">
|
||||||
|
{{ details.lineName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点序号">
|
||||||
|
{{ details.id }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="通讯状态">
|
||||||
|
{{ details.comFlag }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="干扰源类型">
|
||||||
|
{{ details.loadType }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="监测点对象名称">
|
||||||
|
{{ details.objName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="接线方式">
|
||||||
|
{{ details.ptType }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="PT变比">
|
||||||
|
{{ details.pt }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="CT变比">
|
||||||
|
{{ details.ct }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="基准容量(MVA)">
|
||||||
|
{{ details.standardCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="最小短路容量(MVA)">
|
||||||
|
{{ details.shortCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="供电设备容量(MVA)">
|
||||||
|
{{ details.devCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="用户协议容量(MVA)">
|
||||||
|
{{ details.dealCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="监测点限值" name="tab2">
|
||||||
|
<el-descriptions :column="3" border label-width="250px">
|
||||||
|
<el-descriptions-item label="电压偏差上限值(%)">
|
||||||
|
{{ limitValue.voltageDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压偏差下限值(%)">
|
||||||
|
{{ limitValue.uvoltageDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="频率偏差限值(Hz)">
|
||||||
|
{{ limitValue.freqDev }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="三相电压不平衡度限值(%)">
|
||||||
|
{{ limitValue.ubalance }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="负序电流限值(A)">
|
||||||
|
{{ limitValue.ineg }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="长时闪变限值(%)">
|
||||||
|
{{ limitValue.flicker }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压总畸变率限值(%)">
|
||||||
|
{{ limitValue.uaberrance }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="奇次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.oddHarm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="偶次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.evenHarm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="3次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm3 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="4次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm4 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="5次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm5 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="6次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm6 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="7次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm7 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="8次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm8 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="9次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm9 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="10次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm10 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="11次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm11 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="12次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm12 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="13次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm13 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="14次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm14 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="15次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm15 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="16次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm16 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="17次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm17 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="18次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm18 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="19次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm19 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="20次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm20 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="21次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm21 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="22次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm22 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="23次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm23 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="24次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm24 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="25次谐波电流幅值限值(A)">
|
||||||
|
{{ limitValue.iharm25 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="0.5-1.5次间谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.inUharm }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="2.5-15.5次谐波电压含有率限值(%)">
|
||||||
|
{{ limitValue.inUharm16 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { getLineOverLimitData, getLineDetailData } from '@/api/device-boot/line'
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('')
|
||||||
|
const activeName = ref('tab1')
|
||||||
|
const details: any = ref([])
|
||||||
|
const limitValue: any = ref([])
|
||||||
|
const open = (data: any) => {
|
||||||
|
details.value = []
|
||||||
|
limitValue.value = []
|
||||||
|
activeName.value = 'tab1'
|
||||||
|
title.value = data.name.replace(/([^)]*)/g, '') + '_详情'
|
||||||
|
|
||||||
|
getLineDetailData(data.id).then(res => {
|
||||||
|
details.value = res.data
|
||||||
|
|
||||||
|
})
|
||||||
|
getLineOverLimitData(data.id).then(res => {
|
||||||
|
limitValue.value = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
const handleClick = (tab: any, event: Event) => {}
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-upload-list__item) {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
34
src/components/tree/details/substationDetails.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog draggable v-model="dialogVisible" :title="title" width="500px">
|
||||||
|
<el-descriptions class="margin-top" :column="1" border label-width="150px">
|
||||||
|
<el-descriptions-item label="变电站名称">{{ list[0]?.srbName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压等级">{{ list[0]?.scale }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="经度">{{ list[0]?.coordY }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="纬度">{{ list[0]?.coordX }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, inject } from 'vue'
|
||||||
|
import { getSubstationSelectLine } from '@/api/device-boot/line'
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const title = ref('')
|
||||||
|
const list: any = ref([])
|
||||||
|
const open = (data: any) => {
|
||||||
|
list.value = []
|
||||||
|
title.value = data.name.replace(/([^)]*)/g, '') + '_详情'
|
||||||
|
|
||||||
|
getSubstationSelectLine(data.id).then(res => {
|
||||||
|
list.value = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-upload-list__item) {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,162 +1,272 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
||||||
<Icon v-show="menuCollapse" @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
<Icon
|
||||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 mt20 menu-collapse"
|
v-show="menuCollapse"
|
||||||
style="cursor: pointer" />
|
@click="onMenuCollapse"
|
||||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
<div style="display: flex; align-items: center" class="mb10">
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
<el-input v-model="filterText" placeholder="请输入内容" clearable maxlength="10" show-word-limit @input="change">
|
size="18"
|
||||||
<template #prefix>
|
class="fold ml10 mt20 menu-collapse"
|
||||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
style="cursor: pointer"
|
||||||
</template>
|
/>
|
||||||
</el-input>
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
<Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse"
|
<el-input
|
||||||
style="cursor: pointer" v-if="props.canExpand" />
|
v-model="filterText"
|
||||||
<el-button icon="el-icon-Plus" v-if="props.addTree" type="primary" class="ml10"
|
placeholder="请输入内容"
|
||||||
@click="onAddTree">新增</el-button>
|
clearable
|
||||||
</div>
|
maxlength="10"
|
||||||
<el-tree style="flex: 1; overflow: auto" ref="treeRef" :props="defaultProps" highlight-current
|
show-word-limit
|
||||||
:filter-node-method="filterNode" node-key="id" v-bind="$attrs">
|
@input="change"
|
||||||
<template #default="{ node, data }">
|
>
|
||||||
<span class="custom-tree-node">
|
<template #prefix>
|
||||||
<Icon :name="data.icon" style="font-size: 16px" :style="{ color: data.color }"
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
v-if="data.icon" />
|
</template>
|
||||||
<span style="margin-left: 4px">{{ node.label }}</span>
|
</el-input>
|
||||||
</span>
|
<Icon
|
||||||
</template>
|
@click="onMenuCollapse"
|
||||||
</el-tree>
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
</div>
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
</div>
|
size="18"
|
||||||
</template>
|
class="fold ml10 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
<script lang="ts" setup>
|
v-if="props.canExpand"
|
||||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
/>
|
||||||
import { ElTree } from 'element-plus'
|
<el-button icon="el-icon-Plus" v-if="props.addTree" type="primary" class="ml10" @click="onAddTree">
|
||||||
import { ref, watch } from 'vue'
|
新增
|
||||||
import { ElMessage } from 'element-plus'
|
</el-button>
|
||||||
defineOptions({
|
</div>
|
||||||
name: 'govern/tree'
|
<el-tree
|
||||||
})
|
style="flex: 1; overflow: auto"
|
||||||
const emit = defineEmits(['onAddTree'])
|
ref="treeRef"
|
||||||
interface Props {
|
:props="defaultProps"
|
||||||
width?: string
|
highlight-current
|
||||||
canExpand?: boolean
|
:filter-node-method="filterNode"
|
||||||
addTree?: boolean
|
node-key="id"
|
||||||
}
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
<template #default="{ node, data }">
|
||||||
width: '280px',
|
<span class="custom-tree-node">
|
||||||
canExpand: true,
|
<Icon
|
||||||
addTree: false
|
:name="data.icon"
|
||||||
})
|
style="font-size: 16px"
|
||||||
const { proxy } = useCurrentInstance()
|
:style="{ color: data.color }"
|
||||||
const menuCollapse = ref(false)
|
v-if="data.icon"
|
||||||
const filterText = ref('')
|
/>
|
||||||
const defaultProps = {
|
|
||||||
label: 'name',
|
<el-tooltip
|
||||||
value: 'id'
|
class="box-item"
|
||||||
}
|
effect="customized"
|
||||||
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g;
|
placement="bottom-start"
|
||||||
const change=(val) => {
|
:offset="0"
|
||||||
|
v-if="data.level == 6"
|
||||||
|
>
|
||||||
if (specialCharsPattern.test(val)) {
|
<template #content>
|
||||||
ElMessage.warning('禁止输入特殊字符!')
|
<el-button type="primary" plain @click="viewDetails(data)">
|
||||||
filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
{{ data.level == 3 ? '变电站详情' : '监测点详情' }}
|
||||||
console.log("🚀 ~ change ~ filterText.value:", filterText.value)
|
</el-button>
|
||||||
|
</template>
|
||||||
treeRef.value!.filter(filterText.value)
|
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||||
}else{
|
</el-tooltip>
|
||||||
treeRef.value!.filter(filterText.value)
|
<span v-else style="margin-left: 4px">{{ node.label }}</span>
|
||||||
}
|
</span>
|
||||||
}
|
</template>
|
||||||
// watch(filterText, val => {
|
</el-tree>
|
||||||
|
</div>
|
||||||
// console.log("🚀 ~ val:", specialCharsPattern.test(val))
|
<!-- 变电站详情 -->
|
||||||
// if (specialCharsPattern.test(val)) {
|
<SubstationDetails ref="SubstationRef" />
|
||||||
// ElMessage.warning('禁止输入特殊字符!')
|
<!-- 监测点详情 -->
|
||||||
// filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
<MonitoringPointDetails ref="MonitoringPointRef" />
|
||||||
// console.log("🚀 ~ filterText.value:", filterText.value)
|
</div>
|
||||||
// treeRef.value!.filter(filterText.value)
|
</template>
|
||||||
// }else{
|
|
||||||
// treeRef.value!.filter(filterText.value)
|
<script lang="ts" setup>
|
||||||
// }
|
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||||
|
import { ElTree } from 'element-plus'
|
||||||
// })
|
import { ref, watch, onMounted, nextTick } from 'vue'
|
||||||
const onMenuCollapse = () => {
|
import { ElMessage } from 'element-plus'
|
||||||
menuCollapse.value = !menuCollapse.value
|
import MonitoringPointDetails from './details/monitoringPointDetails.vue'
|
||||||
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
import SubstationDetails from './details/substationDetails.vue'
|
||||||
}
|
|
||||||
const filterNode = (value: string, data: any, node: any) => {
|
defineOptions({
|
||||||
if (!value) return true
|
name: 'govern/tree'
|
||||||
// return data.name.includes(value)
|
})
|
||||||
if (data.name) {
|
const emit = defineEmits(['onAddTree'])
|
||||||
|
interface Props {
|
||||||
return chooseNode(value, data, node)
|
width?: string
|
||||||
}
|
canExpand?: boolean
|
||||||
}
|
addTree?: boolean
|
||||||
|
}
|
||||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
|
||||||
const chooseNode = (value: string, data: any, node: any) => {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
width: '280px',
|
||||||
if (data.name.indexOf(value) !== -1) {
|
canExpand: true,
|
||||||
return true
|
addTree: false
|
||||||
}
|
})
|
||||||
const level = node.level
|
const { proxy } = useCurrentInstance()
|
||||||
// 如果传入的节点本身就是一级节点就不用校验了
|
const menuCollapse = ref(false)
|
||||||
if (level === 1) {
|
const MonitoringPointRef = ref()
|
||||||
return false
|
const SubstationRef = ref()
|
||||||
}
|
const filterText = ref('')
|
||||||
// 先取当前节点的父节点
|
const treeRef = ref()
|
||||||
let parentData = node.parent
|
const defaultProps = {
|
||||||
// 遍历当前节点的父节点
|
label: 'name',
|
||||||
let index = 0
|
value: 'id'
|
||||||
while (index < level - 1) {
|
}
|
||||||
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
const specialCharsPattern = /[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g
|
||||||
if (parentData.data.name.indexOf(value) !== -1) {
|
const change = val => {
|
||||||
return true
|
if (specialCharsPattern.test(val)) {
|
||||||
}
|
ElMessage.warning('禁止输入特殊字符!')
|
||||||
// 否则的话再往上一层做匹配
|
filterText.value = val.replace(
|
||||||
parentData = parentData.parent
|
/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g,
|
||||||
index++
|
''
|
||||||
}
|
)
|
||||||
// 没匹配到返回false
|
console.log('🚀 ~ change ~ filterText.value:', filterText.value)
|
||||||
return false
|
|
||||||
}
|
treeRef.value!.filter(filterText.value)
|
||||||
// 添加树
|
} else {
|
||||||
const onAddTree = () => {
|
treeRef.value!.filter(filterText.value)
|
||||||
emit('onAddTree')
|
}
|
||||||
}
|
}
|
||||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
// watch(filterText, val => {
|
||||||
defineExpose({ treeRef })
|
|
||||||
</script>
|
// console.log("🚀 ~ val:", specialCharsPattern.test(val))
|
||||||
|
// if (specialCharsPattern.test(val)) {
|
||||||
<style lang="scss" scoped>
|
// ElMessage.warning('禁止输入特殊字符!')
|
||||||
.cn-tree {
|
// filterText.value = val.replace(/[`~!@$%^&*\-+=<>?:"{}|,.\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、~]/g, "")
|
||||||
flex-shrink: 0;
|
// console.log("🚀 ~ filterText.value:", filterText.value)
|
||||||
display: flex;
|
// treeRef.value!.filter(filterText.value)
|
||||||
flex-direction: column;
|
// }else{
|
||||||
box-sizing: border-box;
|
// treeRef.value!.filter(filterText.value)
|
||||||
padding: 10px;
|
// }
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
// })
|
||||||
|
const onMenuCollapse = () => {
|
||||||
:deep(.el-tree) {
|
menuCollapse.value = !menuCollapse.value
|
||||||
border: 1px solid var(--el-border-color);
|
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||||
}
|
}
|
||||||
|
// 查看详情
|
||||||
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
const viewDetails = (data: any) => {
|
||||||
background-color: var(--el-color-primary-light-7);
|
// console.log('🚀 ~ viewDetails ~ data:', data)
|
||||||
}
|
if (data.level == 3) {
|
||||||
|
// 变电站详情
|
||||||
.menu-collapse {
|
// substationDetails
|
||||||
color: var(--el-color-primary);
|
SubstationRef.value.open(data)
|
||||||
}
|
} else {
|
||||||
}
|
// 监测点详情
|
||||||
|
MonitoringPointRef.value.open(data)
|
||||||
.custom-tree-node {
|
}
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
// proxy.eventBus.emit('viewDetails', data)
|
||||||
}
|
}
|
||||||
</style>
|
const filterNode = (value: string, data: any, node: any) => {
|
||||||
|
if (!value) return true
|
||||||
|
// return data.name.includes(value)
|
||||||
|
if (data.name) {
|
||||||
|
return chooseNode(value, data, node)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||||
|
const chooseNode = (value: string, data: any, node: any) => {
|
||||||
|
if (data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const level = node.level
|
||||||
|
// 如果传入的节点本身就是一级节点就不用校验了
|
||||||
|
if (level === 1) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 先取当前节点的父节点
|
||||||
|
let parentData = node.parent
|
||||||
|
// 遍历当前节点的父节点
|
||||||
|
let index = 0
|
||||||
|
while (index < level - 1) {
|
||||||
|
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||||
|
if (parentData.data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 否则的话再往上一层做匹配
|
||||||
|
parentData = parentData.parent
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
// 没匹配到返回false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
// 等待树渲染完成
|
||||||
|
await nextTick()
|
||||||
|
// 可以等待更长时间确保树完全展开
|
||||||
|
})
|
||||||
|
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// console.log("🚀 ~ scrollToNode ~ id:", id)
|
||||||
|
if (!treeRef.value) return
|
||||||
|
|
||||||
|
// 获取目标节点的元素
|
||||||
|
const targetNode = treeRef.value.getNode(id)
|
||||||
|
if (!targetNode) return
|
||||||
|
|
||||||
|
// 获取节点的DOM元素
|
||||||
|
const nodeElement = document.querySelector(`[data-key="${id}"]`)
|
||||||
|
if (nodeElement) {
|
||||||
|
// 滚动到节点位置
|
||||||
|
nodeElement.scrollIntoView({
|
||||||
|
behavior: 'smooth', // 平滑滚动
|
||||||
|
block: 'center', // 垂直方向居中
|
||||||
|
inline: 'nearest' // 水平方向最近
|
||||||
|
})
|
||||||
|
|
||||||
|
// 如果需要高亮当前节点
|
||||||
|
treeRef.value.setCurrentKey(id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 添加树
|
||||||
|
const onAddTree = () => {
|
||||||
|
emit('onAddTree')
|
||||||
|
}
|
||||||
|
defineExpose({ treeRef, scrollToNode })
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cn-tree {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
:deep(.el-tree) {
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||||
|
background-color: var(--el-color-primary-light-7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-collapse {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-tree-node {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.el-popper.is-customized {
|
||||||
|
/* Set padding to ensure the height is 32px */
|
||||||
|
padding: 0;
|
||||||
|
background: var(--el-color-primary-light-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-popper.is-customized .el-popper__arrow::before {
|
||||||
|
background: var(--el-color-primary-light-3);
|
||||||
|
right: 0;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,88 +1,105 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="point-tree">
|
<div class="point-tree">
|
||||||
<div style="flex: 1; overflow: hidden">
|
<div style="flex: 1; overflow: hidden">
|
||||||
<Tree
|
<Tree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
:data="tree"
|
:data="tree"
|
||||||
:canExpand="false"
|
:canExpand="false"
|
||||||
style="width: 100%; height: 100%"
|
style="width: 100%; height: 100%"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
default-expand-all
|
default-expand-all
|
||||||
|
@onAddTree="onAddTree"
|
||||||
@onAddTree="onAddTree"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
|
||||||
|
<script lang="ts" setup>
|
||||||
<script lang="ts" setup>
|
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||||
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
import Tree from '../index.vue'
|
||||||
import Tree from '../index.vue'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useConfig } from '@/stores/config'
|
||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
import { useConfig } from '@/stores/config'
|
defineOptions({
|
||||||
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
name: 'pms/pointTree'
|
||||||
defineOptions({
|
})
|
||||||
name: 'pms/pointTree'
|
const emit = defineEmits(['init', 'onAddTree'])
|
||||||
})
|
const attrs = useAttrs()
|
||||||
const emit = defineEmits(['init', 'onAddTree'])
|
const adminInfo = useAdminInfo()
|
||||||
const attrs = useAttrs()
|
const dictData = useDictData()
|
||||||
const adminInfo = useAdminInfo()
|
const config = useConfig()
|
||||||
const dictData = useDictData()
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
const config = useConfig()
|
const tree = ref()
|
||||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
const treeRef = ref()
|
||||||
const tree = ref()
|
|
||||||
const treeRef = ref()
|
const loadData = (id?: any) => {
|
||||||
|
// console.log('🚀 ~ loadData ~ id:', id)
|
||||||
const loadData = (id?: any) => {
|
let nodeKey = ''
|
||||||
console.log('🚀 ~ loadData ~ id:', id)
|
queryAllAlgorithmLibrary().then(res => {
|
||||||
let nodeKey = ''
|
res.data.forEach((item: any) => {
|
||||||
queryAllAlgorithmLibrary().then(res => {
|
item.icon = 'el-icon-FolderOpened'
|
||||||
res.data.forEach((item: any) => {
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
item.icon = 'el-icon-FolderOpened'
|
item.children.forEach((item2: any) => {
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
item2.icon = 'el-icon-Document'
|
||||||
item.children.forEach((item2: any) => {
|
item2.color = config.getColorVal('elementUiPrimary')
|
||||||
item2.icon = 'el-icon-Document'
|
item2.childrens = item2.children
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
item2.children = []
|
||||||
item2.childrens = item2.children
|
if (item2.id == id) {
|
||||||
item2.children = []
|
emit('init', item2)
|
||||||
if (item2.id == id) {
|
}
|
||||||
emit('init', item2)
|
})
|
||||||
}
|
})
|
||||||
})
|
|
||||||
})
|
nodeKey = res.data[0].children[0].id
|
||||||
|
|
||||||
nodeKey = res.data[0].children[0].id
|
tree.value = res.data
|
||||||
|
if (id) {
|
||||||
tree.value = res.data
|
setTimeout(() => {
|
||||||
if (id) {
|
treeRef.value.treeRef.setCurrentKey(id)
|
||||||
setTimeout(() => {
|
}, 10)
|
||||||
treeRef.value.treeRef.setCurrentKey(id)
|
} else {
|
||||||
}, 10)
|
setTimeout(() => {
|
||||||
} else {
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
setTimeout(() => {
|
emit('init', res.data[0].children[0])
|
||||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
}, 10)
|
||||||
emit('init', res.data[0].children[0])
|
}
|
||||||
}, 10)
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
const onAddTree = () => {
|
||||||
|
emit('onAddTree')
|
||||||
const onAddTree = () => {
|
}
|
||||||
emit('onAddTree')
|
const setKey = (id: string) => {
|
||||||
}
|
treeRef.value.treeRef.setCurrentKey(id)
|
||||||
loadData()
|
return findNodeById(tree.value, id)
|
||||||
defineExpose({ loadData })
|
}
|
||||||
</script>
|
const findNodeById = (tree1: any, targetId: any) => {
|
||||||
<style lang="scss">
|
for (const node of tree1) {
|
||||||
.point-tree {
|
// 1. 当前节点匹配ID,直接返回该节点
|
||||||
height: 100%;
|
if (node.id === targetId) {
|
||||||
width: 100%;
|
return node
|
||||||
display: flex;
|
}
|
||||||
flex-direction: column;
|
// 2. 当前节点有子节点,递归查找子节点
|
||||||
background: #fff;
|
if (node.children && node.children.length > 0) {
|
||||||
border: 1px solid var(--el-border-color);
|
const result: any = findNodeById(node.children, targetId)
|
||||||
}
|
// 子节点中找到结果,立即返回(终止递归)
|
||||||
</style>
|
if (result) return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 3. 遍历完未找到,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
loadData()
|
||||||
|
defineExpose({ loadData, setKey })
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.point-tree {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
150
src/components/tree/pqs/areaTree.vue
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<div class="point-tree">
|
||||||
|
<div style="flex: 1; overflow: hidden">
|
||||||
|
<Tree ref="treeRef" :data="tree" style="width: 100%; height: 100%" :canExpand="false" v-bind="$attrs" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||||
|
import Tree from '../index.vue'
|
||||||
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
import { getAreaList } from '@/api/common'
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
|
defineOptions({
|
||||||
|
name: 'pms/pointTree'
|
||||||
|
})
|
||||||
|
interface Props {
|
||||||
|
showSelect?: boolean
|
||||||
|
}
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
showSelect: true
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['init'])
|
||||||
|
const attrs = useAttrs()
|
||||||
|
const adminInfo = useAdminInfo()
|
||||||
|
const dictData = useDictData()
|
||||||
|
const config = useConfig()
|
||||||
|
const tree = ref()
|
||||||
|
const treeRef = ref()
|
||||||
|
|
||||||
|
const loadData = () => {
|
||||||
|
let nodeKey = ''
|
||||||
|
getAreaList().then(res => {
|
||||||
|
processTreeData(res.data, res.data[0].level)
|
||||||
|
let firstLevel6Node = getDeepestFirstChildData(res.data)
|
||||||
|
|
||||||
|
nodeKey = firstLevel6Node.id
|
||||||
|
emit('init', firstLevel6Node)
|
||||||
|
|
||||||
|
tree.value = res.data
|
||||||
|
if (nodeKey) {
|
||||||
|
nextTick(() => {
|
||||||
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
|
|
||||||
|
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// 树滚动
|
||||||
|
treeRef.value.scrollToNode(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
item.alias = alias + `${item.name}`
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归获取树形结构中一直向下的第一个children的最后一组有效数据
|
||||||
|
* @param {Array} treeData - 原始递归树形数据
|
||||||
|
* @returns {Object|null} 路径最后一组有效数据,无有效数据时返回null
|
||||||
|
*/
|
||||||
|
function getDeepestFirstChildData(treeData) {
|
||||||
|
// 递归辅助函数:逐层查找第一个children
|
||||||
|
function findDeepestNode(currentNode) {
|
||||||
|
// 检查当前节点是否有有效的children数组
|
||||||
|
if (currentNode && Array.isArray(currentNode.children) && currentNode.children.length > 0) {
|
||||||
|
// 有下一级children,继续递归查找下一级第一个元素
|
||||||
|
return findDeepestNode(currentNode.children[0])
|
||||||
|
}
|
||||||
|
// 没有下一级children,返回当前节点(递归终止)
|
||||||
|
return currentNode
|
||||||
|
}
|
||||||
|
|
||||||
|
// 边界处理:原始数据非数组/空数组时返回null
|
||||||
|
if (!Array.isArray(treeData) || treeData.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从根节点第一个元素开始递归查找
|
||||||
|
return findDeepestNode(treeData[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ treeRef, scrollToNode, tree })
|
||||||
|
loadData()
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.point-tree {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,12 +11,9 @@ import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
|||||||
import Tree from '../index.vue'
|
import Tree from '../index.vue'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
import {
|
import { getTree } from '@/api/advance-boot/assess'
|
||||||
getTree
|
|
||||||
} from '@/api/advance-boot/assess'
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'pms/pointTree'
|
name: 'pms/pointTree'
|
||||||
@@ -46,25 +43,24 @@ const formData = ref({
|
|||||||
scale: null
|
scale: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 添加数据转换函数
|
// 添加数据转换函数
|
||||||
const transformTreeData = (data: any[]) => {
|
const transformTreeData = (data: any[]) => {
|
||||||
if (!data || !Array.isArray(data)) return [];
|
if (!data || !Array.isArray(data)) return []
|
||||||
return data.map(item => {
|
return data.map(item => {
|
||||||
// 创建新对象,确保不修改原始数据
|
// 创建新对象,确保不修改原始数据
|
||||||
const newItem: any = {
|
const newItem: any = {
|
||||||
name: item.treeName ,
|
name: item.treeName,
|
||||||
id: item.treeId ,
|
id: item.treeId,
|
||||||
children: []
|
children: []
|
||||||
};
|
}
|
||||||
|
|
||||||
// 递归处理子节点
|
// 递归处理子节点
|
||||||
if (item.children && Array.isArray(item.children)) {
|
if (item.children && Array.isArray(item.children)) {
|
||||||
newItem.children = transformTreeData(item.children);
|
newItem.children = transformTreeData(item.children)
|
||||||
}
|
}
|
||||||
return newItem;
|
return newItem
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const loadData = () => {
|
const loadData = () => {
|
||||||
let obj = classificationData.find(function (i) {
|
let obj = classificationData.find(function (i) {
|
||||||
@@ -73,19 +69,22 @@ const loadData = () => {
|
|||||||
let form = JSON.parse(JSON.stringify(formData.value))
|
let form = JSON.parse(JSON.stringify(formData.value))
|
||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTree({}).then(res => {
|
getTree({}).then(res => {
|
||||||
// 转换数据结构为指定格式
|
// 转换数据结构为指定格式
|
||||||
const transformedData = transformTreeData(res.data);
|
const transformedData = transformTreeData(res.data)
|
||||||
|
|
||||||
// 确保有数据再进行处理
|
// 确保有数据再进行处理
|
||||||
if (transformedData && transformedData.length > 0 &&
|
if (
|
||||||
transformedData[0].children && transformedData[0].children.length > 0) {
|
transformedData &&
|
||||||
|
transformedData.length > 0 &&
|
||||||
|
transformedData[0].children &&
|
||||||
|
transformedData[0].children.length > 0
|
||||||
|
) {
|
||||||
nodeKey = transformedData[0].children[0].id
|
nodeKey = transformedData[0].children[0].id
|
||||||
emit('init', transformedData[0].children[0])
|
emit('init', transformedData[0].children[0])
|
||||||
|
|
||||||
tree.value = transformedData
|
tree.value = transformedData
|
||||||
|
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
@@ -94,7 +93,15 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// 树滚动
|
||||||
|
treeRef.value.scrollToNode(id)
|
||||||
|
}
|
||||||
loadData()
|
loadData()
|
||||||
|
defineExpose({
|
||||||
|
tree,
|
||||||
|
scrollToNode
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.point-tree {
|
.point-tree {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const adminInfo = useAdminInfo()
|
|||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
const tree = ref()
|
const tree = ref()
|
||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@@ -54,6 +55,9 @@ const loadData = () => {
|
|||||||
}) || { code: '' }
|
}) || { code: '' }
|
||||||
let form = JSON.parse(JSON.stringify(formData.value))
|
let form = JSON.parse(JSON.stringify(formData.value))
|
||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
|
if (VITE_FLAG && form.statisticalType.code == 'Power_Network') {
|
||||||
|
form.statisticalType.deptName = 'qujing'
|
||||||
|
}
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTerminalTreeForFive(form).then(res => {
|
getTerminalTreeForFive(form).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@@ -67,56 +71,62 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
res.data.forEach((item: any) => {
|
// if (VITE_FLAG) {
|
||||||
item.icon = 'el-icon-HomeFilled'
|
processTreeData(res.data)
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||||
item.children.forEach((item2: any) => {
|
|
||||||
item2.icon = 'el-icon-CollectionTag'
|
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item2.children.forEach((item3: any) => {
|
|
||||||
item3.icon = 'el-icon-Flag'
|
|
||||||
item3.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item3.children.forEach((item4: any) => {
|
|
||||||
item4.icon = 'el-icon-OfficeBuilding'
|
|
||||||
item4.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item4.children.forEach((item5: anyObj) => {
|
|
||||||
if (item5.level == 7) {
|
|
||||||
item5.icon = 'el-icon-DataAnalysis'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item5.children.forEach((item6: anyObj) => {
|
|
||||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
|
||||||
item6.pid = item4.id
|
|
||||||
item6.icon = 'fa-solid fa-location-dot'
|
|
||||||
item6.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item6.comFlag == 0) {
|
|
||||||
item6.color = 'red !important'
|
|
||||||
} else if (item6.comFlag == 1) {
|
|
||||||
item6.color = '#00f93b !important'
|
|
||||||
} else if (item6.comFlag == 2) {
|
|
||||||
item6.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
|
||||||
item5.pid = item4.id
|
|
||||||
item5.icon = 'fa-solid fa-location-dot'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item5.comFlag == 0) {
|
|
||||||
item5.color = 'red !important'
|
|
||||||
} else if (item5.comFlag == 1) {
|
|
||||||
item5.color = '#00f93b !important'
|
|
||||||
} else if (item5.comFlag == 2) {
|
|
||||||
item5.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
nodeKey = firstLevel6Node.id
|
||||||
emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
emit('init', firstLevel6Node)
|
||||||
|
// res.data.forEach((item: any) => {
|
||||||
|
// item.icon = 'el-icon-HomeFilled'
|
||||||
|
// item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item.children.forEach((item2: any) => {
|
||||||
|
// item2.icon = 'el-icon-CollectionTag'
|
||||||
|
// item2.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item2.children.forEach((item3: any) => {
|
||||||
|
// item3.icon = 'el-icon-Flag'
|
||||||
|
// item3.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item3.children.forEach((item4: any) => {
|
||||||
|
// item4.icon = 'el-icon-OfficeBuilding'
|
||||||
|
// item4.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item4.children.forEach((item5: anyObj) => {
|
||||||
|
// if (item5.level == 7) {
|
||||||
|
// item5.icon = 'el-icon-DataAnalysis'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item5.children.forEach((item6: anyObj) => {
|
||||||
|
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||||
|
// item6.pid = item4.id
|
||||||
|
// item6.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item6.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item6.comFlag == 0) {
|
||||||
|
// item6.color = 'red !important'
|
||||||
|
// } else if (item6.comFlag == 1) {
|
||||||
|
// item6.color = '#00f93b !important'
|
||||||
|
// } else if (item6.comFlag == 2) {
|
||||||
|
// item6.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||||
|
// item5.pid = item4.id
|
||||||
|
// item5.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item5.comFlag == 0) {
|
||||||
|
// item5.color = 'red !important'
|
||||||
|
// } else if (item5.comFlag == 1) {
|
||||||
|
// item5.color = '#00f93b !important'
|
||||||
|
// } else if (item5.comFlag == 2) {
|
||||||
|
// item5.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
||||||
|
// emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
@@ -127,9 +137,113 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const setKey = (key: string) => {
|
const setKey = (key: string) => {
|
||||||
treeRef.value.treeRef.setCurrentKey(key)
|
treeRef.value.treeRef.setCurrentKey(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1) {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||||
|
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||||
|
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||||
|
*/
|
||||||
|
function findFirstLevel6Node(tree: any) {
|
||||||
|
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||||
|
if (Array.isArray(tree)) {
|
||||||
|
for (const rootNode of tree) {
|
||||||
|
const result = traverse(rootNode)
|
||||||
|
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||||
|
if (result) return result
|
||||||
|
}
|
||||||
|
// 所有根节点遍历完未找到
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
// 入参是单个节点,直接递归遍历
|
||||||
|
return traverse(tree)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核心递归遍历函数
|
||||||
|
function traverse(node) {
|
||||||
|
// 终止条件1:节点不存在,返回null
|
||||||
|
if (!node) return null
|
||||||
|
|
||||||
|
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||||
|
if (node.level === 6) {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// 终止条件3:节点无children,返回null
|
||||||
|
if (!node.children || node.children.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按顺序遍历当前节点的子节点
|
||||||
|
for (const child of node.children) {
|
||||||
|
const foundNode = traverse(child)
|
||||||
|
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||||
|
if (foundNode) {
|
||||||
|
return foundNode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前节点及所有子节点都无匹配,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ setKey })
|
defineExpose({ setKey })
|
||||||
loadData()
|
loadData()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -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,72 +78,190 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
res.data.forEach((item: any) => {
|
// if (VITE_FLAG) {
|
||||||
item.icon = 'el-icon-HomeFilled'
|
processTreeData(res.data)
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||||
item.children.forEach((item2: any) => {
|
|
||||||
item2.icon = 'el-icon-CollectionTag'
|
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item2.children.forEach((item3: any) => {
|
|
||||||
item3.icon = 'el-icon-Flag'
|
|
||||||
item3.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item3.children.forEach((item4: any) => {
|
|
||||||
item4.icon = 'el-icon-OfficeBuilding'
|
|
||||||
item4.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item4.children.forEach((item5: anyObj) => {
|
|
||||||
if (item5.level == 7) {
|
|
||||||
item5.icon = 'el-icon-DataAnalysis'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item5.children.forEach((item6: anyObj) => {
|
|
||||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
|
||||||
item6.pid = item4.id
|
|
||||||
item6.icon = 'fa-solid fa-location-dot'
|
|
||||||
item6.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item6.comFlag == 0) {
|
|
||||||
item6.color = 'red !important'
|
|
||||||
} else if (item6.comFlag == 1) {
|
|
||||||
item6.color = '#00f93b !important'
|
|
||||||
} else if (item6.comFlag == 2) {
|
|
||||||
item6.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
|
||||||
item5.pid = item4.id
|
|
||||||
item5.icon = 'fa-solid fa-location-dot'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item5.comFlag == 0) {
|
|
||||||
item5.color = 'red !important'
|
|
||||||
} else if (item5.comFlag == 1) {
|
|
||||||
item5.color = '#00f93b !important'
|
|
||||||
} else if (item5.comFlag == 2) {
|
|
||||||
item5.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
nodeKey =
|
nodeKey = firstLevel6Node.id
|
||||||
res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
emit('init', firstLevel6Node)
|
||||||
res.data[0].children[0].children[0].children[0].children[0]?.id
|
// } else {
|
||||||
emit(
|
// // 正常树处理
|
||||||
'init',
|
// res.data.forEach((item: any) => {
|
||||||
res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
// item.icon = 'el-icon-HomeFilled'
|
||||||
res.data[0].children[0].children[0].children[0].children[0]
|
// item.color = config.getColorVal('elementUiPrimary')
|
||||||
)
|
// item.children.forEach((item2: any) => {
|
||||||
|
// item2.icon = 'el-icon-CollectionTag'
|
||||||
|
// item2.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item2.children.forEach((item3: any) => {
|
||||||
|
// item3.icon = 'el-icon-Flag'
|
||||||
|
// item3.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item3.children.forEach((item4: any) => {
|
||||||
|
// item4.icon = 'el-icon-OfficeBuilding'
|
||||||
|
// item4.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item4.children.forEach((item5: anyObj) => {
|
||||||
|
// if (item5.level == 7) {
|
||||||
|
// item5.icon = 'el-icon-DataAnalysis'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item5.children.forEach((item6: anyObj) => {
|
||||||
|
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||||
|
// item6.pid = item4.id
|
||||||
|
// item6.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item6.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item6.comFlag == 0) {
|
||||||
|
// item6.color = 'red !important'
|
||||||
|
// } else if (item6.comFlag == 1) {
|
||||||
|
// item6.color = '#00f93b !important'
|
||||||
|
// } else if (item6.comFlag == 2) {
|
||||||
|
// item6.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||||
|
// item5.pid = item4.id
|
||||||
|
// item5.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item5.comFlag == 0) {
|
||||||
|
// item5.color = 'red !important'
|
||||||
|
// } else if (item5.comFlag == 1) {
|
||||||
|
// item5.color = '#00f93b !important'
|
||||||
|
// } else if (item5.comFlag == 2) {
|
||||||
|
// item5.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// nodeKey =
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]?.id
|
||||||
|
// emit(
|
||||||
|
// 'init',
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
|
|
||||||
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// 树滚动
|
||||||
|
treeRef.value.scrollToNode(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
item.alias = alias + `${item.name}`
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||||
|
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||||
|
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||||
|
*/
|
||||||
|
function findFirstLevel6Node(tree: any) {
|
||||||
|
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||||
|
if (Array.isArray(tree)) {
|
||||||
|
for (const rootNode of tree) {
|
||||||
|
const result = traverse(rootNode)
|
||||||
|
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||||
|
if (result) return result
|
||||||
|
}
|
||||||
|
// 所有根节点遍历完未找到
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
// 入参是单个节点,直接递归遍历
|
||||||
|
return traverse(tree)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核心递归遍历函数
|
||||||
|
function traverse(node) {
|
||||||
|
// 终止条件1:节点不存在,返回null
|
||||||
|
if (!node) return null
|
||||||
|
|
||||||
|
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||||
|
if (node.level === 6) {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// 终止条件3:节点无children,返回null
|
||||||
|
if (!node.children || node.children.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按顺序遍历当前节点的子节点
|
||||||
|
for (const child of node.children) {
|
||||||
|
const foundNode = traverse(child)
|
||||||
|
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||||
|
if (foundNode) {
|
||||||
|
return foundNode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前节点及所有子节点都无匹配,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ treeRef, scrollToNode, tree })
|
||||||
loadData()
|
loadData()
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const tree = ref()
|
|||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
|
|
||||||
const loadData = (id?: any) => {
|
const loadData = (id?: any) => {
|
||||||
console.log('🚀 ~ loadData ~ id:', id)
|
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
queryAll().then(res => {
|
queryAll().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -79,7 +79,7 @@ const init = async () => {
|
|||||||
// 设置消息接收回调
|
// 设置消息接收回调
|
||||||
mqttClient.onMessage((topic, message) => {
|
mqttClient.onMessage((topic, message) => {
|
||||||
const msg = JSON.parse(message.toString())
|
const msg = JSON.parse(message.toString())
|
||||||
console.log('🚀 ~ init ~ msg:', msg)
|
// console.log('🚀 ~ init ~ msg:', msg)
|
||||||
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||||
drawer.value = true
|
drawer.value = true
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-logo">
|
<div class="layout-logo">
|
||||||
<img v-if="!config.layout.menuCollapse" class="logo-img" :src="getTheme.logoUrl" />
|
<img v-if="!config.layout.menuCollapse && getTheme && getTheme.logoUrl" class="logo-img" :src="getTheme.logoUrl" />
|
||||||
<!-- <div-->
|
<!-- <div-->
|
||||||
<!-- v-if="!config.layout.menuCollapse"-->
|
<!-- v-if="!config.layout.menuCollapse"-->
|
||||||
<!-- :style="{ color: config.getColorVal('menuActiveColor') }"-->
|
<!-- :style="{ color: config.getColorVal('menuActiveColor') }"-->
|
||||||
@@ -28,7 +28,9 @@ import { Session } from '@/utils/storage'
|
|||||||
import { setNavTabsWidth } from '@/utils/layout'
|
import { setNavTabsWidth } from '@/utils/layout'
|
||||||
|
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
|
const getTheme = window.localStorage.getItem('getTheme')
|
||||||
|
? JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||||
|
: null
|
||||||
const onMenuCollapse = function () {
|
const onMenuCollapse = function () {
|
||||||
if (config.layout.shrink && !config.layout.menuCollapse) {
|
if (config.layout.shrink && !config.layout.menuCollapse) {
|
||||||
closeShade()
|
closeShade()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span class="nav-bar-title">
|
<span class="nav-bar-title">
|
||||||
{{ getTheme.name }}
|
{{ getTheme?.name || '' }}
|
||||||
<span style="font-size: 14px">({{ Version || 'v1.0.0' }})</span>
|
<span style="font-size: 14px">({{ Version || 'v1.0.0' }})</span>
|
||||||
<!-- <span style="font-size: 14px;" v-if="Version?.versionName">
|
<!-- <span style="font-size: 14px;" v-if="Version?.versionName">
|
||||||
({{ Version?.versionName }})
|
({{ Version?.versionName }})
|
||||||
@@ -28,8 +28,10 @@ import { getLastData } from '@/api/systerm'
|
|||||||
|
|
||||||
const Version: any = ref(null)
|
const Version: any = ref(null)
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
|
const getTheme = window.localStorage.getItem('getTheme')
|
||||||
|
? JSON.parse(window.localStorage.getItem('getTheme') as string)
|
||||||
|
: { name: '' }
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'hainan'
|
||||||
const onMenuCollapse = () => {
|
const onMenuCollapse = () => {
|
||||||
showShade('ba-aside-menu-shade', () => {
|
showShade('ba-aside-menu-shade', () => {
|
||||||
config.setLayout('menuCollapse', true)
|
config.setLayout('menuCollapse', true)
|
||||||
@@ -37,10 +39,13 @@ const onMenuCollapse = () => {
|
|||||||
config.setLayout('menuCollapse', false)
|
config.setLayout('menuCollapse', false)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getLastData({ versionType: 'WEB' }).then(res => {
|
if(!VITE_FLAG){
|
||||||
Version.value = res.data.versionName
|
getLastData({ versionType: 'WEB' }).then(res => {
|
||||||
})
|
Version.value = res.data.versionName
|
||||||
document.title = getTheme.name
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
document.title = getTheme?.name || ''
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,109 +1,117 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog draggable width="500px" v-model="dialogVisible" :title="title">
|
<el-dialog draggable width="500px" v-model="dialogVisible" :title="title">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||||
<el-form-item label="校验密码:" prop="password">
|
<el-form-item label="校验密码:" prop="password">
|
||||||
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="新密码:" prop="newPwd" style="margin-top: 20px">
|
<el-form-item label="新密码:" prop="newPwd" style="margin-top: 20px">
|
||||||
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="确认密码:" prop="confirmPwd" style="margin-top: 20px">
|
<el-form-item label="确认密码:" prop="confirmPwd" style="margin-top: 20px">
|
||||||
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
|
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submit">确认</el-button>
|
<el-button type="primary" @click="submit">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, inject } from 'vue'
|
import { ref, inject } from 'vue'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { 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'
|
||||||
const adminInfo = useAdminInfo()
|
import { useNavTabs } from '@/stores/navTabs'
|
||||||
const dialogVisible = ref(false)
|
const navTabs = useNavTabs()
|
||||||
const title = ref('修改密码')
|
const adminInfo = useAdminInfo()
|
||||||
const formRef = ref()
|
const dialogVisible = ref(false)
|
||||||
// 注意不要和表单ref的命名冲突
|
const title = ref('修改密码')
|
||||||
const form = reactive({
|
const formRef = ref()
|
||||||
password: '',
|
// 注意不要和表单ref的命名冲突
|
||||||
newPwd: '',
|
const form = reactive({
|
||||||
confirmPwd: ''
|
password: '',
|
||||||
})
|
newPwd: '',
|
||||||
const rules = {
|
confirmPwd: ''
|
||||||
password: [
|
})
|
||||||
{ required: true, message: '请输入校验密码', trigger: 'blur' },
|
const rules = {
|
||||||
{
|
password: [
|
||||||
min: 6,
|
{ required: true, message: '请输入校验密码', trigger: 'blur' },
|
||||||
max: 12,
|
{
|
||||||
message: '长度在 6 到 12 个字符',
|
min: 6,
|
||||||
trigger: 'blur'
|
max: 12,
|
||||||
}
|
message: '长度在 6 到 12 个字符',
|
||||||
],
|
trigger: 'blur'
|
||||||
newPwd: [
|
}
|
||||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
],
|
||||||
{
|
newPwd: [
|
||||||
min: 6,
|
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||||
max: 12,
|
{
|
||||||
message: '长度在 6 到 12 个字符',
|
min: 6,
|
||||||
trigger: 'blur'
|
max: 12,
|
||||||
},
|
message: '长度在 6 到 12 个字符',
|
||||||
{ validator: validatePwd, trigger: 'blur' }
|
trigger: 'blur'
|
||||||
],
|
},
|
||||||
confirmPwd: [
|
{ validator: validatePwd, trigger: 'blur' }
|
||||||
{ required: true, message: '请确认密码', trigger: 'blur' },
|
],
|
||||||
{
|
confirmPwd: [
|
||||||
min: 6,
|
{ required: true, message: '请确认密码', trigger: 'blur' },
|
||||||
max: 12,
|
{
|
||||||
message: '长度在 6 到 12 个字符',
|
min: 6,
|
||||||
trigger: 'blur'
|
max: 12,
|
||||||
},
|
message: '长度在 6 到 12 个字符',
|
||||||
{
|
trigger: 'blur'
|
||||||
validator: (rule: any, value: string, callback: any) => {
|
},
|
||||||
if (value === '') {
|
{
|
||||||
callback(new Error('请再次输入密码'))
|
validator: (rule: any, value: string, callback: any) => {
|
||||||
} else if (value !== form.newPwd) {
|
if (value === '') {
|
||||||
callback(new Error('两次输入密码不一致!'))
|
callback(new Error('请再次输入密码'))
|
||||||
} else {
|
} else if (value !== form.newPwd) {
|
||||||
callback()
|
callback(new Error('两次输入密码不一致!'))
|
||||||
}
|
} else {
|
||||||
},
|
callback()
|
||||||
trigger: 'blur',
|
}
|
||||||
required: true
|
},
|
||||||
}
|
trigger: 'blur',
|
||||||
]
|
required: true
|
||||||
}
|
}
|
||||||
|
]
|
||||||
const open = () => {
|
}
|
||||||
dialogVisible.value = true
|
|
||||||
form.password = ''
|
const open = () => {
|
||||||
form.newPwd = ''
|
dialogVisible.value = true
|
||||||
form.confirmPwd = ''
|
form.password = ''
|
||||||
}
|
form.newPwd = ''
|
||||||
const submit = () => {
|
form.confirmPwd = ''
|
||||||
formRef.value.validate(async (valid: boolean) => {
|
}
|
||||||
if (valid) {
|
const submit = () => {
|
||||||
passwordConfirm(form.password).then(res => {
|
formRef.value.validate(async (valid: boolean) => {
|
||||||
updatePassword({
|
if (valid) {
|
||||||
id: adminInfo.$state.userIndex,
|
passwordConfirm(form.password).then(res => {
|
||||||
newPassword: form.newPwd
|
updatePassword({
|
||||||
}).then((res: any) => {
|
id: adminInfo.$state.userIndex,
|
||||||
ElMessage.success('密码修改成功')
|
newPassword: form.newPwd
|
||||||
dialogVisible.value = false
|
}).then((res: any) => {
|
||||||
})
|
ElMessage.success('密码修改成功,请重新登录!')
|
||||||
})
|
dialogVisible.value = false
|
||||||
}
|
setTimeout(() => {
|
||||||
})
|
navTabs.closeTabs()
|
||||||
}
|
window.localStorage.clear()
|
||||||
|
adminInfo.reset()
|
||||||
defineExpose({ open })
|
router.push({ name: 'login' })
|
||||||
</script>
|
}, 0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const emit = defineEmits(['update:modelValue'])
|
|||||||
const dialogVisible = computed({
|
const dialogVisible = computed({
|
||||||
get: () => props.modelValue,
|
get: () => props.modelValue,
|
||||||
set: (val) => {
|
set: (val) => {
|
||||||
console.log('set: ', val)
|
|
||||||
emit('update:modelValue', val)
|
emit('update:modelValue', val)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
33
src/main.ts
@@ -16,12 +16,14 @@ import '@/assets/font/iconfont.css'
|
|||||||
import { ElDialog } from 'element-plus'
|
import { ElDialog } from 'element-plus'
|
||||||
import BaiduMap from 'vue-baidu-map-3x'
|
import BaiduMap from 'vue-baidu-map-3x'
|
||||||
import BaiduMapOffline from 'vue-baidu-map-offline'
|
import BaiduMapOffline from 'vue-baidu-map-offline'
|
||||||
|
|
||||||
import ExcelJS from 'exceljs'
|
import ExcelJS from 'exceljs'
|
||||||
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
|
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
|
||||||
// 方式1:NPM 安装,注入 ExcelJS 对象
|
// 方式1:NPM 安装,注入 ExcelJS 对象
|
||||||
VXETable.use(VXETablePluginExportXLSX, {
|
VXETable.use(VXETablePluginExportXLSX, {
|
||||||
ExcelJS
|
ExcelJS
|
||||||
})
|
})
|
||||||
|
// 全局注册 tooltip 组件
|
||||||
window.XEUtils = XEUtils
|
window.XEUtils = XEUtils
|
||||||
|
|
||||||
// 初始化多语言
|
// 初始化多语言
|
||||||
@@ -35,21 +37,21 @@ const setupAll = async () => {
|
|||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
//开启离线地图
|
//开启离线地图
|
||||||
// app.use(BaiduMapOffline, {
|
app.use(BaiduMapOffline, {
|
||||||
// offline: true,
|
offline: true,
|
||||||
// offlineConfig: {
|
offlineConfig: {
|
||||||
// imgext: '.png',
|
imgext: '.png',
|
||||||
// customstyle: '',
|
customstyle: '',
|
||||||
// tiles_dir: '',
|
tiles_dir: '',
|
||||||
// tiles_hybrid: '',
|
tiles_hybrid: '',
|
||||||
// tiles_self: '',
|
tiles_self: '',
|
||||||
// tiles_v_dir: '',
|
tiles_v_dir: '',
|
||||||
// tiles_satellite_dir: '',
|
tiles_satellite_dir: '',
|
||||||
// tiles_road_dir: '',
|
tiles_road_dir: '',
|
||||||
// tiles_v_road_dir: '',
|
tiles_v_road_dir: '',
|
||||||
// home: './plugin/offline/'
|
home: './plugin/offline/'
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
app.use(BaiduMap, {
|
app.use(BaiduMap, {
|
||||||
// ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
// ak: 'Yp57V71dkOPiXjiN8VdcFRsVELzlVNKK',
|
||||||
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN',
|
ak: 'RpQi6WNFZ9tseKzhdwOQsXwFsoVntnsN',
|
||||||
@@ -61,6 +63,7 @@ const setupAll = async () => {
|
|||||||
app.use(pinia)
|
app.use(pinia)
|
||||||
app.use(ElementPlus)
|
app.use(ElementPlus)
|
||||||
app.use(VXETable)
|
app.use(VXETable)
|
||||||
|
|
||||||
;(app._context.components.ElDialog as typeof ElDialog).props.closeOnClickModal.default = false
|
;(app._context.components.ElDialog as typeof ElDialog).props.closeOnClickModal.default = false
|
||||||
registerIcons(app) // icons
|
registerIcons(app) // icons
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||||
import staticRoutes from '@/router/static'
|
import staticRoutes from '@/router/static'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import NProgress from 'nprogress'
|
import NProgress from 'nprogress'
|
||||||
import { loading } from '@/utils/loading'
|
import { loading } from '@/utils/loading'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes: staticRoutes
|
routes: staticRoutes
|
||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
if (!window.existLoading) {
|
if (!window.existLoading) {
|
||||||
loading.show()
|
loading.show()
|
||||||
window.existLoading = true
|
window.existLoading = true
|
||||||
}
|
}
|
||||||
if (to.path == '/login' || to.path == '/404') {
|
if (to.path == '/login' || to.path == '/404') {
|
||||||
// 登录或者注册才可以往下进行
|
// 登录或者注册才可以往下进行
|
||||||
next()
|
next()
|
||||||
} else if (to.path == '/admin/center/homePage') {
|
} else if (to.path == '/admin/center/homePage') {
|
||||||
window.open(window.location.origin + '/homePage/#/')
|
window.open(window.location.origin + '/homePage/#/')
|
||||||
} else {
|
} else {
|
||||||
// 获取 token
|
// 获取 token
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// next()
|
// next()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 路由加载后
|
// 路由加载后
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
if (window.existLoading) {
|
if (window.existLoading) {
|
||||||
loading.hide()
|
loading.hide()
|
||||||
}
|
}
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
})
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
@@ -1,246 +1,246 @@
|
|||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { STORE_CONFIG } from '@/stores/constant/cacheKey'
|
import { STORE_CONFIG } from '@/stores/constant/cacheKey'
|
||||||
import type { Layout } from '@/stores/interface'
|
import type { Layout } from '@/stores/interface'
|
||||||
|
|
||||||
export const useConfig = defineStore(
|
export const useConfig = defineStore(
|
||||||
'config',
|
'config',
|
||||||
() => {
|
() => {
|
||||||
const layout: Layout = reactive({
|
const layout: Layout = reactive({
|
||||||
/* 全局 */
|
/* 全局 */
|
||||||
showDrawer: false,
|
showDrawer: false,
|
||||||
// 是否收缩布局(小屏终端)
|
// 是否收缩布局(小屏终端)
|
||||||
shrink: false,
|
shrink: false,
|
||||||
// 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
// 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||||
layoutMode: 'Classic',
|
layoutMode: 'Classic',
|
||||||
// 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
// 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||||
mainAnimation: 'slide-right',
|
mainAnimation: 'slide-right',
|
||||||
// 是否暗黑模式
|
// 是否暗黑模式
|
||||||
isDark: false,
|
isDark: false,
|
||||||
elementUiPrimary: ['#002B6A', '#002B6A'],
|
elementUiPrimary: ['#002B6A', '#002B6A'],
|
||||||
tableHeaderBackground: ['#F3F6F9', '#F3F6F9'],
|
tableHeaderBackground: ['#F3F6F9', '#F3F6F9'],
|
||||||
tableHeaderColor: ['#111', '#fff'],
|
tableHeaderColor: ['#111', '#fff'],
|
||||||
tableCurrent: ['#F3F6F9', '#F3F6F9'],
|
tableCurrent: ['#F3F6F9', '#F3F6F9'],
|
||||||
/* 侧边菜单 */
|
/* 侧边菜单 */
|
||||||
// 侧边菜单背景色
|
// 侧边菜单背景色
|
||||||
menuBackground: ['#002B6A', '#1d1e1f'],
|
menuBackground: ['#002B6A', '#1d1e1f'],
|
||||||
// 侧边菜单文字颜色
|
// 侧边菜单文字颜色
|
||||||
menuColor: ['#FFFFFF', '#CFD3DC'],
|
menuColor: ['#FFFFFF', '#CFD3DC'],
|
||||||
// 侧边菜单激活项背景色
|
// 侧边菜单激活项背景色
|
||||||
menuActiveBackground: ['#002255', '#1d1e1f'],
|
menuActiveBackground: ['#002255', '#1d1e1f'],
|
||||||
// 侧边菜单激活项文字色
|
// 侧边菜单激活项文字色
|
||||||
menuActiveColor: ['#409eff', '#3375b9'],
|
menuActiveColor: ['#409eff', '#3375b9'],
|
||||||
// 侧边菜单顶栏背景色
|
// 侧边菜单顶栏背景色
|
||||||
menuTopBarBackground: ['#002B6A', '#1d1e1f'],
|
menuTopBarBackground: ['#002B6A', '#1d1e1f'],
|
||||||
// 侧边菜单宽度(展开时),单位px
|
// 侧边菜单宽度(展开时),单位px
|
||||||
menuWidth: 260,
|
menuWidth: 260,
|
||||||
// 侧边菜单项默认图标
|
// 侧边菜单项默认图标
|
||||||
menuDefaultIcon: 'fa fa-circle-o',
|
menuDefaultIcon: 'fa fa-circle-o',
|
||||||
// 是否水平折叠收起菜单
|
// 是否水平折叠收起菜单
|
||||||
menuCollapse: false,
|
menuCollapse: false,
|
||||||
// 是否只保持一个子菜单的展开(手风琴)
|
// 是否只保持一个子菜单的展开(手风琴)
|
||||||
menuUniqueOpened: false,
|
menuUniqueOpened: false,
|
||||||
// 显示菜单栏顶栏(LOGO)
|
// 显示菜单栏顶栏(LOGO)
|
||||||
menuShowTopBar: true,
|
menuShowTopBar: true,
|
||||||
|
|
||||||
/* 顶栏 */
|
/* 顶栏 */
|
||||||
// 顶栏文字色
|
// 顶栏文字色
|
||||||
headerBarTabColor: ['#FFFFFF', '#CFD3DC'],
|
headerBarTabColor: ['#FFFFFF', '#CFD3DC'],
|
||||||
// // 顶栏激活项背景色
|
// // 顶栏激活项背景色
|
||||||
headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||||
// 顶栏激活项文字色
|
// 顶栏激活项文字色
|
||||||
headerBarTabActiveColor: ['#000000', '#409EFF'],
|
headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||||
// 顶栏背景色
|
// 顶栏背景色
|
||||||
headerBarBackground: ['#002B6A', '#1d1e1f'],
|
headerBarBackground: ['#002B6A', '#1d1e1f'],
|
||||||
// 顶栏悬停时背景色
|
// 顶栏悬停时背景色
|
||||||
headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||||
})
|
})
|
||||||
|
|
||||||
const lang = reactive({
|
const lang = reactive({
|
||||||
// 默认语言,可选值<zh-cn|en>
|
// 默认语言,可选值<zh-cn|en>
|
||||||
defaultLang: 'zh-cn',
|
defaultLang: 'zh-cn',
|
||||||
// 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
// 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||||
fallbackLang: 'zh-cn',
|
fallbackLang: 'zh-cn',
|
||||||
// 支持的语言列表
|
// 支持的语言列表
|
||||||
langArray: [
|
langArray: [
|
||||||
{ name: 'zh-cn', value: '中文简体' },
|
{ name: 'zh-cn', value: '中文简体' },
|
||||||
{ name: 'en', value: 'English' }
|
{ name: 'en', value: 'English' }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
function menuWidth() {
|
function menuWidth() {
|
||||||
if (layout.shrink) {
|
if (layout.shrink) {
|
||||||
return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||||
}
|
}
|
||||||
// 菜单是否折叠
|
// 菜单是否折叠
|
||||||
return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLang(val: string) {
|
function setLang(val: string) {
|
||||||
lang.defaultLang = val
|
lang.defaultLang = val
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSetLayoutColor(data = layout.layoutMode) {
|
function onSetLayoutColor(data = layout.layoutMode) {
|
||||||
// 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
// 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||||
const tempValue = layout.isDark
|
const tempValue = layout.isDark
|
||||||
? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||||
: { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
: { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||||
if (
|
if (
|
||||||
data == 'Classic' &&
|
data == 'Classic' &&
|
||||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||||
) {
|
) {
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||||
} else if (
|
} else if (
|
||||||
data == 'Default' &&
|
data == 'Default' &&
|
||||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||||
) {
|
) {
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLayoutMode(data: string) {
|
function setLayoutMode(data: string) {
|
||||||
layout.layoutMode = data
|
layout.layoutMode = data
|
||||||
onSetLayoutColor(data)
|
onSetLayoutColor(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
const setLayout = (name: keyof Layout, value: any) => {
|
const setLayout = (name: keyof Layout, value: any) => {
|
||||||
layout[name] = value as never
|
layout[name] = value as never
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
return colors[0]
|
return colors[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||||
},
|
},
|
||||||
// () => {
|
// () => {
|
||||||
//
|
//
|
||||||
// console.log('🚀 ~ subject:', subject)
|
// console.log('🚀 ~ subject:', subject)
|
||||||
// const layout: Layout = reactive({
|
// const layout: Layout = reactive({
|
||||||
// /* 全局 */
|
// /* 全局 */
|
||||||
// showDrawer: false,
|
// showDrawer: false,
|
||||||
// // 是否收缩布局(小屏终端)
|
// // 是否收缩布局(小屏终端)
|
||||||
// shrink: false,
|
// shrink: false,
|
||||||
// // 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
// // 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||||
// layoutMode: 'Classic',
|
// layoutMode: 'Classic',
|
||||||
// // 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
// // 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||||
// mainAnimation: subject.mainAnimation,
|
// mainAnimation: subject.mainAnimation,
|
||||||
// // 是否暗黑模式
|
// // 是否暗黑模式
|
||||||
// isDark: false,
|
// isDark: false,
|
||||||
// elementUiPrimary: JSON.parse(subject.elementUiPrimary),
|
// elementUiPrimary: JSON.parse(subject.elementUiPrimary),
|
||||||
// tableHeaderBackground: JSON.parse(subject.tableHeaderBackground),
|
// tableHeaderBackground: JSON.parse(subject.tableHeaderBackground),
|
||||||
// tableHeaderColor:JSON.parse(subject.tableHeaderColor),
|
// tableHeaderColor:JSON.parse(subject.tableHeaderColor),
|
||||||
// tableCurrent: JSON.parse(subject.tableCurrent),
|
// tableCurrent: JSON.parse(subject.tableCurrent),
|
||||||
// /* 侧边菜单 */
|
// /* 侧边菜单 */
|
||||||
// // 侧边菜单背景色
|
// // 侧边菜单背景色
|
||||||
// menuBackground: JSON.parse(subject.menuBackground),
|
// menuBackground: JSON.parse(subject.menuBackground),
|
||||||
// // 侧边菜单文字颜色
|
// // 侧边菜单文字颜色
|
||||||
// menuColor:JSON.parse(subject.menuColor),
|
// menuColor:JSON.parse(subject.menuColor),
|
||||||
// // 侧边菜单激活项背景色
|
// // 侧边菜单激活项背景色
|
||||||
// menuActiveBackground:JSON.parse(subject.menuActiveBackground),
|
// menuActiveBackground:JSON.parse(subject.menuActiveBackground),
|
||||||
// // 侧边菜单激活项文字色
|
// // 侧边菜单激活项文字色
|
||||||
// menuActiveColor:JSON.parse(subject.menuActiveColor),
|
// menuActiveColor:JSON.parse(subject.menuActiveColor),
|
||||||
// // 侧边菜单顶栏背景色
|
// // 侧边菜单顶栏背景色
|
||||||
// menuTopBarBackground: JSON.parse(subject.menuTopBarBackground),
|
// menuTopBarBackground: JSON.parse(subject.menuTopBarBackground),
|
||||||
// // 侧边菜单宽度(展开时),单位px
|
// // 侧边菜单宽度(展开时),单位px
|
||||||
// menuWidth: 260,
|
// menuWidth: 260,
|
||||||
// // 侧边菜单项默认图标
|
// // 侧边菜单项默认图标
|
||||||
// menuDefaultIcon: 'fa fa-circle-o',
|
// menuDefaultIcon: 'fa fa-circle-o',
|
||||||
// // 是否水平折叠收起菜单
|
// // 是否水平折叠收起菜单
|
||||||
// menuCollapse: false,
|
// menuCollapse: false,
|
||||||
// // 是否只保持一个子菜单的展开(手风琴)
|
// // 是否只保持一个子菜单的展开(手风琴)
|
||||||
// menuUniqueOpened: false,
|
// menuUniqueOpened: false,
|
||||||
// // 显示菜单栏顶栏(LOGO)
|
// // 显示菜单栏顶栏(LOGO)
|
||||||
// menuShowTopBar: true,
|
// menuShowTopBar: true,
|
||||||
|
|
||||||
// /* 顶栏 */
|
// /* 顶栏 */
|
||||||
// // 顶栏文字色
|
// // 顶栏文字色
|
||||||
// headerBarTabColor:JSON.parse(subject.headerBarTabColor),
|
// headerBarTabColor:JSON.parse(subject.headerBarTabColor),
|
||||||
// // // 顶栏激活项背景色
|
// // // 顶栏激活项背景色
|
||||||
// headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
// headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||||
// // 顶栏激活项文字色
|
// // 顶栏激活项文字色
|
||||||
// headerBarTabActiveColor: ['#000000', '#409EFF'],
|
// headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||||
// // 顶栏背景色
|
// // 顶栏背景色
|
||||||
// headerBarBackground: JSON.parse(subject.headerBarBackground),
|
// headerBarBackground: JSON.parse(subject.headerBarBackground),
|
||||||
// // 顶栏悬停时背景色
|
// // 顶栏悬停时背景色
|
||||||
// headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
// headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||||
// })
|
// })
|
||||||
// // console.log(123, window.localStorage.getItem('getTheme'))
|
// // console.log(123, window.localStorage.getItem('getTheme'))
|
||||||
|
|
||||||
// const lang = reactive({
|
// const lang = reactive({
|
||||||
// // 默认语言,可选值<zh-cn|en>
|
// // 默认语言,可选值<zh-cn|en>
|
||||||
// defaultLang: 'zh-cn',
|
// defaultLang: 'zh-cn',
|
||||||
// // 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
// // 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||||
// fallbackLang: 'zh-cn',
|
// fallbackLang: 'zh-cn',
|
||||||
// // 支持的语言列表
|
// // 支持的语言列表
|
||||||
// langArray: [
|
// langArray: [
|
||||||
// { name: 'zh-cn', value: '中文简体' },
|
// { name: 'zh-cn', value: '中文简体' },
|
||||||
// { name: 'en', value: 'English' }
|
// { name: 'en', value: 'English' }
|
||||||
// ]
|
// ]
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// function menuWidth() {
|
// function menuWidth() {
|
||||||
// if (layout.shrink) {
|
// if (layout.shrink) {
|
||||||
// return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
// return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||||
// }
|
// }
|
||||||
// // 菜单是否折叠
|
// // 菜单是否折叠
|
||||||
// return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
// return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// function setLang(val: string) {
|
// function setLang(val: string) {
|
||||||
// lang.defaultLang = val
|
// lang.defaultLang = val
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// function onSetLayoutColor(data = layout.layoutMode) {
|
// function onSetLayoutColor(data = layout.layoutMode) {
|
||||||
// // 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
// // 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||||
// const tempValue = layout.isDark
|
// const tempValue = layout.isDark
|
||||||
// ? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
// ? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||||
// : { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
// : { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||||
// if (
|
// if (
|
||||||
// data == 'Classic' &&
|
// data == 'Classic' &&
|
||||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||||
// ) {
|
// ) {
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||||
// } else if (
|
// } else if (
|
||||||
// data == 'Default' &&
|
// data == 'Default' &&
|
||||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||||
// ) {
|
// ) {
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// function setLayoutMode(data: string) {
|
// function setLayoutMode(data: string) {
|
||||||
// layout.layoutMode = data
|
// layout.layoutMode = data
|
||||||
// onSetLayoutColor(data)
|
// onSetLayoutColor(data)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// const setLayout = (name: keyof Layout, value: any) => {
|
// const setLayout = (name: keyof Layout, value: any) => {
|
||||||
// layout[name] = value as never
|
// layout[name] = value as never
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 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[]
|
||||||
// if (layout.isDark) {
|
// if (layout.isDark) {
|
||||||
// return colors[1]
|
// return colors[1]
|
||||||
// } else {
|
// } else {
|
||||||
// return colors[0]
|
// return colors[0]
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
// return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
persist: {
|
persist: {
|
||||||
key: STORE_CONFIG
|
key: STORE_CONFIG
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDictByType(type: string) {
|
getDictByType(type: string) {
|
||||||
|
console.log("🚀 ~ type:", type)
|
||||||
if (!this.isSetDict) {
|
if (!this.isSetDict) {
|
||||||
this.setDictMap()
|
this.setDictMap()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -373,3 +373,4 @@ body,
|
|||||||
.w-e-scroll {
|
.w-e-scroll {
|
||||||
min-height: 200px !important;
|
min-height: 200px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,3 +268,8 @@
|
|||||||
.el-drawer__body {
|
.el-drawer__body {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aLoad{
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@@ -8,29 +8,31 @@ $primary-light: #3f6ad8;
|
|||||||
// --ba-background
|
// --ba-background
|
||||||
$bg-color: () !default;
|
$bg-color: () !default;
|
||||||
$bg-color: map.merge(
|
$bg-color: map.merge(
|
||||||
(
|
(
|
||||||
'': #edf0f3,
|
'': #edf0f3,
|
||||||
'overlay': #ffffff,
|
'overlay': #ffffff
|
||||||
),
|
),
|
||||||
$bg-color
|
$bg-color
|
||||||
);
|
);
|
||||||
|
|
||||||
// --ba-border-color
|
// --ba-border-color
|
||||||
$border-color: () !default;
|
$border-color: () !default;
|
||||||
$border-color: map.merge(
|
$border-color: map.merge(
|
||||||
(
|
(
|
||||||
'': #f6f6f6,
|
'': #f6f6f6
|
||||||
),
|
),
|
||||||
$border-color
|
$border-color
|
||||||
);
|
);
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
@include set-css-var-value('main-space', $main-space);
|
@include set-css-var-value('main-space', $main-space);
|
||||||
@include set-css-var-value('color-primary-light', $primary-light);
|
@include set-css-var-value('color-primary-light', $primary-light);
|
||||||
@include set-component-css-var('bg-color', $bg-color);
|
@include set-component-css-var('bg-color', $bg-color);
|
||||||
@include set-component-css-var('border-color', $border-color);
|
@include set-component-css-var('border-color', $border-color);
|
||||||
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
--vxe-ui-table-row-current-background-color: var(--el-color-primary-light-8);
|
||||||
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
--vxe-ui-table-row-hover-current-background-color: var(--el-color-primary-light-8);
|
||||||
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
||||||
// --vxe-table-row-hover-striped-background-color: var(--el-color-primary-light-9);
|
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
||||||
|
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
||||||
|
// --vxe-table-row-hover-striped-background-color: var(--el-color-primary-light-9);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.vxe-header--row {
|
.vxe-header--row {
|
||||||
background: var(--vxe-table-header-background-color);
|
background: var(--vxe-table-header-background-color);
|
||||||
color: var(--vxe-table-header-font-color);
|
color: var(--vxe-table-header-font-color);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is--checked.vxe-checkbox,
|
.is--checked.vxe-checkbox,
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,
|
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,
|
||||||
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,
|
.vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,
|
||||||
.vxe-table--render-default .is--checked.vxe-cell--radio .vxe-radio--icon {
|
.vxe-table--render-default .is--checked.vxe-cell--radio .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-3);
|
color: var(--el-color-primary-light-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,
|
.vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,
|
||||||
@@ -38,40 +38,41 @@
|
|||||||
.vxe-export--panel-column-option:not(.is--disabled):hover .vxe-radio--icon,
|
.vxe-export--panel-column-option:not(.is--disabled):hover .vxe-radio--icon,
|
||||||
.vxe-table--filter-option:not(.is--disabled):hover .vxe-radio--icon,
|
.vxe-table--filter-option:not(.is--disabled):hover .vxe-radio--icon,
|
||||||
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-5);
|
color: var(--el-color-primary-light-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--tooltip-wrapper {
|
.vxe-table--tooltip-wrapper {
|
||||||
z-index: 10000 !important;
|
z-index: 10000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is--disabled {
|
.is--disabled {
|
||||||
background-color: var(--vxe-input-disabled-color);
|
background-color: var(--vxe-input-disabled-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-modal--wrapper {
|
.vxe-modal--wrapper {
|
||||||
z-index: 5000 !important;
|
z-index: 5000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(even) {
|
.vxe-table--body .vxe-body--row:nth-child(even) {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
||||||
width: 10px !important;
|
width: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter:after,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter:after,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter:after {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter:after {
|
||||||
background-color: #000 !important;
|
background-color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter:before,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter:before,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter:before {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter:before {
|
||||||
background-color: #000 !important;
|
background-color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,10 @@
|
|||||||
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
.vxe-table--render-default .vxe-cell--radio:not(.is--disabled):hover .vxe-radio--icon {
|
||||||
color: var(--el-color-primary-light-5);
|
color: var(--el-color-primary-light-5);
|
||||||
}
|
}
|
||||||
|
.vxe-table--render-default .vxe-body--row.row--current,
|
||||||
|
.vxe-table--render-default .vxe-body--row.row--current:hover {
|
||||||
|
background-color: var(--el-color-primary-light-8);
|
||||||
|
}
|
||||||
// .vxe-table--render-default .is--disabled.vxe-cell--checkbox .vxe-checkbox--icon{
|
// .vxe-table--render-default .is--disabled.vxe-cell--checkbox .vxe-checkbox--icon{
|
||||||
// color: #fff0;
|
// color: #fff0;
|
||||||
// }
|
// }
|
||||||
@@ -77,14 +80,14 @@
|
|||||||
.vxe-modal--wrapper {
|
.vxe-modal--wrapper {
|
||||||
z-index: 5000 !important;
|
z-index: 5000 !important;
|
||||||
}
|
}
|
||||||
.vxe-table--body .vxe-body--row:nth-child(even) {
|
// .vxe-table--body .vxe-body--row:nth-child(even) {
|
||||||
background-color: #f9f9f9;
|
// background-color: #f9f9f9;
|
||||||
// background-color: var(--el-color-primary-light-9);
|
// // background-color: var(--el-color-primary-light-9);
|
||||||
}
|
// }
|
||||||
|
|
||||||
.vxe-table--body .vxe-body--row:nth-child(odd) {
|
// .vxe-table--body .vxe-body--row:nth-child(odd) {
|
||||||
background-color: #ffffff;
|
// background-color: #ffffff;
|
||||||
}
|
// }
|
||||||
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
.default-theme.splitpanes--vertical > .splitpanes__splitter,
|
||||||
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
.default-theme .splitpanes--vertical > .splitpanes__splitter {
|
||||||
width: 10px !important;
|
width: 10px !important;
|
||||||
|
|||||||
@@ -1,176 +1,176 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='default-main'>
|
<div class='default-main'>
|
||||||
<!-- 表头 -->
|
<!-- 表头 -->
|
||||||
<!-- date-picker 时间组件 area区域组件-->
|
<!-- date-picker 时间组件 area区域组件-->
|
||||||
<TableHeader date-picker area>
|
<TableHeader date-picker area>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label='关键词:'>
|
<el-form-item label='关键词:'>
|
||||||
<el-input
|
<el-input
|
||||||
style='width: 240px'
|
style='width: 240px'
|
||||||
v-model='tableStore.table.params.searchValue'
|
v-model='tableStore.table.params.searchValue'
|
||||||
clearable
|
clearable
|
||||||
placeholder='仅根据用户名/登录名'
|
placeholder='仅根据用户名/登录名'
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<Table ref='tableRef' />
|
<Table ref='tableRef' />
|
||||||
<!-- 弹框 -->
|
<!-- 弹框 -->
|
||||||
<PopupEdit ref='popupEdit' />
|
<PopupEdit ref='popupEdit' />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import { ref, onMounted, provide, defineOptions } from 'vue'
|
import { ref, onMounted, provide, defineOptions } from 'vue'
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import PopupEdit from './dialog.vue'
|
import PopupEdit from './dialog.vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
|
||||||
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'auth/userlist'
|
name: 'auth/userlist'
|
||||||
})
|
})
|
||||||
const popupEdit = ref()
|
const popupEdit = ref()
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
||||||
// publicHeight: 60,
|
// publicHeight: 60,
|
||||||
url: '/user-boot/user/list',
|
url: '/user-boot/user/list',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '用户名称', field: 'name', minWidth: '130' },
|
{ title: '用户名称', field: 'name', minWidth: '130' },
|
||||||
{ title: '登录名', field: 'loginName', minWidth: '130' },
|
{ title: '登录名', field: 'loginName', minWidth: '130' },
|
||||||
{ title: '角色', field: 'roleName', minWidth: '130' },
|
{ title: '角色', field: 'roleName', minWidth: '130' },
|
||||||
{ title: '部门', field: 'deptName', minWidth: '200' },
|
{ title: '部门', field: 'deptName', minWidth: '200' },
|
||||||
{ title: '电话', field: 'phoneShow', minWidth: '100' },
|
{ title: '电话', field: 'phoneShow', minWidth: '100' },
|
||||||
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
|
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
|
||||||
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
|
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
|
||||||
{ title: '类型', field: 'casualUserName', minWidth: '80' },
|
{ title: '类型', field: 'casualUserName', minWidth: '80' },
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
field: 'state',
|
field: 'state',
|
||||||
width: '100',
|
width: '100',
|
||||||
render: 'tag',
|
render: 'tag',
|
||||||
custom: {
|
custom: {
|
||||||
0: 'danger',
|
0: 'danger',
|
||||||
1: 'success',
|
1: 'success',
|
||||||
2: 'warning',
|
2: 'warning',
|
||||||
3: 'warning',
|
3: 'warning',
|
||||||
4: 'info',
|
4: 'info',
|
||||||
5: 'danger'
|
5: 'danger'
|
||||||
},
|
},
|
||||||
replaceValue: {
|
replaceValue: {
|
||||||
0: '注销',
|
0: '注销',
|
||||||
1: '正常',
|
1: '正常',
|
||||||
2: '锁定',
|
2: '锁定',
|
||||||
3: '待审核',
|
3: '待审核',
|
||||||
4: '休眠',
|
4: '休眠',
|
||||||
5: '密码过期'
|
5: '密码过期'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
fixed: 'right',
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '编辑',
|
title: '编辑',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-EditPen',
|
icon: 'el-icon-EditPen',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1
|
return row.state !== 1
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '修改密码',
|
title: '修改密码',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-Lock',
|
icon: 'el-icon-Lock',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1
|
return row.state !== 1
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
inputType: 'password'
|
inputType: 'password'
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '激活',
|
title: '激活',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-Open',
|
icon: 'el-icon-Open',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '注销',
|
title: '注销',
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
icon: 'el-icon-SwitchButton',
|
icon: 'el-icon-SwitchButton',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1 && row.state !== 3
|
return row.state !== 1 && row.state !== 3
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
tableStore.table.data.forEach((item: any) => {
|
tableStore.table.data.forEach((item: any) => {
|
||||||
item.deptName = item.deptName || '/'
|
item.deptName = item.deptName || '/'
|
||||||
item.phoneShow = item.phone || '/'
|
item.phoneShow = item.phone || '/'
|
||||||
item.roleName = item.role.length ? item.role : '/'
|
item.roleName = item.role.length ? item.role : '/'
|
||||||
switch (item.casualUser) {
|
switch (item.casualUser) {
|
||||||
case 0:
|
case 0:
|
||||||
item.casualUserName = '临时用户'
|
item.casualUserName = '临时用户'
|
||||||
break
|
break
|
||||||
case 1:
|
case 1:
|
||||||
item.casualUserName = '长期用户'
|
item.casualUserName = '长期用户'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
item.casualUserName = '/'
|
item.casualUserName = '/'
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 注入到子组件
|
// 注入到子组件
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
// 默认参数 参数多的话可以使用Object.assign方法
|
// 默认参数 参数多的话可以使用Object.assign方法
|
||||||
tableStore.table.params.searchState = 1
|
tableStore.table.params.searchState = 1
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
tableStore.table.params.casualUser = -1
|
tableStore.table.params.casualUser = -1
|
||||||
tableStore.table.params.orderBy = ''
|
tableStore.table.params.orderBy = ''
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 加载数据
|
// 加载数据
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 弹框
|
// 弹框
|
||||||
const addUser = () => {
|
const addUser = () => {
|
||||||
popupEdit.value.open('新增用户')
|
popupEdit.value.open('新增用户')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ export const getIntDictOptions = (dictType: string): NumberDictDataType[] => {
|
|||||||
value: parseInt(dict.value + '')
|
value: parseInt(dict.value + '')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
console.log("🚀 ~ getIntDictOptions ~ dictOption:", dictOption)
|
||||||
return dictOption
|
return dictOption
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
91
src/utils/fileDownLoad.ts
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import { downloadFile } from '@/api/system-boot/file'
|
||||||
|
|
||||||
|
const sanitizeUrl = (url: string): string => {
|
||||||
|
return url.replace(/\[/g, '(').replace(/\]/g, ')')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载文件
|
||||||
|
export const download = (urls: string) => {
|
||||||
|
//console.log('下载', urls)
|
||||||
|
|
||||||
|
downloadFile({ filePath: urls })
|
||||||
|
.then((res: any) => {
|
||||||
|
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||||
|
const getFileType = (url: string) => {
|
||||||
|
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||||
|
const mimeMap: Record<string, string> = {
|
||||||
|
pdf: 'application/pdf',
|
||||||
|
zip: 'application/zip',
|
||||||
|
doc: 'application/msword',
|
||||||
|
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
xls: 'application/vnd.ms-excel',
|
||||||
|
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
png: 'image/png',
|
||||||
|
jpeg: 'image/jpeg',
|
||||||
|
jpg: 'image/jpg'
|
||||||
|
}
|
||||||
|
return mimeMap[ext] || ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob([res], { type: getFileType(urls) })
|
||||||
|
|
||||||
|
// 2. 提取文件名并保留原生后缀(核心修复点)
|
||||||
|
const fileName = urls.split('/').at(-1) || '下载文件' // 先提取URL最后一段(文件名)
|
||||||
|
|
||||||
|
// 3. 创建下载链接
|
||||||
|
const url = window.URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = url
|
||||||
|
link.download = fileName // 直接使用原文件名(保留后缀)
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
|
||||||
|
// 4. 清理资源(优化)
|
||||||
|
link.remove()
|
||||||
|
window.URL.revokeObjectURL(url) // 释放blob URL
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error('下载失败:', err)
|
||||||
|
// 可添加错误提示(如Toast)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function removeLastDotSuffix(str: string) {
|
||||||
|
// 找到最后一个 . 的位置
|
||||||
|
const lastDotIndex = str.lastIndexOf('.')
|
||||||
|
// 如果存在 .,截取到 . 之前的部分;否则返回原字符串
|
||||||
|
return lastDotIndex !== -1 ? str.slice(0, lastDotIndex) : str
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预览文件
|
||||||
|
export const previewFile = async (urls: any) => {
|
||||||
|
//console.log('预览', urls)
|
||||||
|
let url = ''
|
||||||
|
await downloadFile({ filePath: decodeURI(urls) })
|
||||||
|
.then((res: any) => {
|
||||||
|
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||||
|
const getFileType = (url: string) => {
|
||||||
|
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||||
|
const mimeMap: Record<string, string> = {
|
||||||
|
pdf: 'application/pdf',
|
||||||
|
zip: 'application/zip',
|
||||||
|
doc: 'application/msword',
|
||||||
|
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
xls: 'application/vnd.ms-excel',
|
||||||
|
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
png: 'image/png',
|
||||||
|
jpeg: 'image/jpeg',
|
||||||
|
jpg: 'image/jpg'
|
||||||
|
}
|
||||||
|
return mimeMap[ext] || ''
|
||||||
|
}
|
||||||
|
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
||||||
|
// 3. 创建下载链接
|
||||||
|
url = window.URL.createObjectURL(blob)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error('下载失败:', err)
|
||||||
|
// 可添加错误提示(如Toast)
|
||||||
|
})
|
||||||
|
//console.log('url', url)
|
||||||
|
return url
|
||||||
|
}
|
||||||
@@ -362,3 +362,4 @@ export function getTimeOfTheMonth(key: string): [string, string] {
|
|||||||
throw new Error('Invalid key')
|
throw new Error('Invalid key')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,11 +52,12 @@ class MQTT {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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')
|
||||||
|
const mqttUrl = localStorage.getItem('MqttUrl')
|
||||||
|
if (mqttUrl == 'null' || mqttUrl == null) return
|
||||||
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
||||||
this.setupEventListeners()
|
this.setupEventListeners()
|
||||||
|
|
||||||
|
|||||||
@@ -1,326 +1,327 @@
|
|||||||
import type { AxiosRequestConfig, Method } from 'axios'
|
import type { AxiosRequestConfig, Method } from 'axios'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
||||||
import { refreshToken } from '@/api/user-boot/user'
|
import { refreshToken } from '@/api/user-boot/user'
|
||||||
import router from '@/router/index'
|
import router from '@/router/index'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { debounce } from 'lodash-es';
|
import { debounce } from 'lodash-es'
|
||||||
let loginExpireTimer:any = null
|
let loginExpireTimer: any = null
|
||||||
window.requests = []
|
window.requests = []
|
||||||
window.tokenRefreshing = false
|
window.tokenRefreshing = false
|
||||||
const pendingMap = new Map()
|
const pendingMap = new Map()
|
||||||
const loadingInstance: LoadingInstance = {
|
const loadingInstance: LoadingInstance = {
|
||||||
target: null,
|
target: null,
|
||||||
count: 0
|
count: 0
|
||||||
}
|
}
|
||||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'removeMode'
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'removeMode'
|
||||||
// console.log('🚀 ~ import.meta.env.VITE_NAME:', import.meta.env.VITE_NAME)
|
// console.log('🚀 ~ import.meta.env.VITE_NAME:', import.meta.env.VITE_NAME)
|
||||||
/**
|
/**
|
||||||
* 根据运行环境获取基础请求URL
|
* 根据运行环境获取基础请求URL
|
||||||
*/
|
*/
|
||||||
export const getUrl = (): string => {
|
export const getUrl = (): string => {
|
||||||
return '/api'
|
return '/api'
|
||||||
}
|
}
|
||||||
function removeBeforeSecondSlash(str: string) {
|
function removeBeforeSecondSlash(str: string) {
|
||||||
// 找到第一个斜杠的位置
|
// 找到第一个斜杠的位置
|
||||||
const firstSlashIndex = str.indexOf('/')
|
const firstSlashIndex = str.indexOf('/')
|
||||||
if (firstSlashIndex === -1) {
|
if (firstSlashIndex === -1) {
|
||||||
// 如果没有斜杠,返回原字符串
|
// 如果没有斜杠,返回原字符串
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
// 从第一个斜杠之后开始找第二个斜杠
|
// 从第一个斜杠之后开始找第二个斜杠
|
||||||
const secondSlashIndex = str.indexOf('/', firstSlashIndex + 1)
|
const secondSlashIndex = str.indexOf('/', firstSlashIndex + 1)
|
||||||
if (secondSlashIndex === -1) {
|
if (secondSlashIndex === -1) {
|
||||||
// 如果只有一个斜杠,返回原字符串
|
// 如果只有一个斜杠,返回原字符串
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
// 返回第二个斜杠及之后的内容
|
// 返回第二个斜杠及之后的内容
|
||||||
return str.substring(secondSlashIndex)
|
return str.substring(secondSlashIndex)
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 创建`Axios`
|
* 创建`Axios`
|
||||||
* 默认开启`reductDataFormat(简洁响应)`,返回类型为`ApiPromise`
|
* 默认开启`reductDataFormat(简洁响应)`,返回类型为`ApiPromise`
|
||||||
* 关闭`reductDataFormat`,返回类型则为`AxiosPromise`
|
* 关闭`reductDataFormat`,返回类型则为`AxiosPromise`
|
||||||
*/
|
*/
|
||||||
function createAxios<Data = any, T = ApiPromise<Data>>(
|
function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||||
axiosConfig: AxiosRequestConfig,
|
axiosConfig: AxiosRequestConfig,
|
||||||
options: Options = {},
|
options: Options = {},
|
||||||
loading: LoadingOptions = {}
|
loading: LoadingOptions = {}
|
||||||
): T {
|
): T {
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
|
|
||||||
const Axios = axios.create({
|
const Axios = axios.create({
|
||||||
baseURL: getUrl(),
|
baseURL: getUrl(),
|
||||||
timeout: 1000 * 60 * 5,
|
timeout: 1000 * 60 * 5,
|
||||||
headers: {},
|
headers: {},
|
||||||
responseType: 'json'
|
responseType: 'json'
|
||||||
})
|
})
|
||||||
|
|
||||||
options = Object.assign(
|
options = Object.assign(
|
||||||
{
|
{
|
||||||
CancelDuplicateRequest: true, // 是否开启取消重复请求, 默认为 true
|
CancelDuplicateRequest: true, // 是否开启取消重复请求, 默认为 true
|
||||||
loading: false, // 是否开启loading层效果, 默认为false
|
loading: false, // 是否开启loading层效果, 默认为false
|
||||||
reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true
|
reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true
|
||||||
showErrorMessage: true, // 是否开启接口错误信息展示,默认为true
|
showErrorMessage: true, // 是否开启接口错误信息展示,默认为true
|
||||||
showCodeMessage: true, // 是否开启code不为1时的信息提示, 默认为true
|
showCodeMessage: true, // 是否开启code不为1时的信息提示, 默认为true
|
||||||
showSuccessMessage: false, // 是否开启code为1时的信息提示, 默认为false
|
showSuccessMessage: false, // 是否开启code为1时的信息提示, 默认为false
|
||||||
anotherToken: '' // 当前请求使用另外的用户token
|
anotherToken: '' // 当前请求使用另外的用户token
|
||||||
},
|
},
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
|
|
||||||
// 请求拦截
|
// 请求拦截
|
||||||
Axios.interceptors.request.use(
|
Axios.interceptors.request.use(
|
||||||
async (config: any) => {
|
async (config: any) => {
|
||||||
//嵌入去除所有请求头
|
//嵌入去除所有请求头
|
||||||
if (VITE_FLAG) {
|
if (VITE_FLAG) {
|
||||||
config.url = await removeBeforeSecondSlash(config.url)
|
config.url = await removeBeforeSecondSlash(config.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消重复请求
|
// 取消重复请求
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
config.url == '/system-boot/file/upload' ||
|
config.url == '/system-boot/file/upload' ||
|
||||||
config.url == '/harmonic-boot/grid/getAssessOverview' ||
|
config.url == '/harmonic-boot/grid/getAssessOverview' ||
|
||||||
config.url == '/system-boot/file/getFileVO' ||
|
config.url == '/system-boot/file/getFileVO' ||
|
||||||
config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData'
|
config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData' ||
|
||||||
)
|
config.url == '/supervision-boot/userReport/bindAssessmentId'
|
||||||
)
|
)
|
||||||
removePending(config)
|
)
|
||||||
|
removePending(config)
|
||||||
options.CancelDuplicateRequest && addPending(config)
|
|
||||||
// 创建loading实例
|
options.CancelDuplicateRequest && addPending(config)
|
||||||
if (options.loading) {
|
// 创建loading实例
|
||||||
loadingInstance.count++
|
if (options.loading) {
|
||||||
if (loadingInstance.count === 1) {
|
loadingInstance.count++
|
||||||
loadingInstance.target = ElLoading.service(loading)
|
if (loadingInstance.count === 1) {
|
||||||
}
|
loadingInstance.target = ElLoading.service(loading)
|
||||||
}
|
}
|
||||||
// 自动携带token
|
}
|
||||||
if (config.headers) {
|
// 自动携带token
|
||||||
const token = adminInfo.getToken()
|
if (config.headers) {
|
||||||
if (token) {
|
const token = adminInfo.getToken()
|
||||||
;(config.headers as anyObj).Authorization = token
|
if (token) {
|
||||||
} else {
|
;(config.headers as anyObj).Authorization = token
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
} else {
|
||||||
}
|
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
||||||
}
|
}
|
||||||
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
}
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
||||||
}
|
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
||||||
|
}
|
||||||
return config
|
|
||||||
},
|
return config
|
||||||
error => {
|
},
|
||||||
return Promise.reject(error)
|
error => {
|
||||||
}
|
return Promise.reject(error)
|
||||||
)
|
}
|
||||||
|
)
|
||||||
// 响应拦截
|
|
||||||
Axios.interceptors.response.use(
|
// 响应拦截
|
||||||
response => {
|
Axios.interceptors.response.use(
|
||||||
removePending(response.config)
|
response => {
|
||||||
options.loading && closeLoading(options) // 关闭loading
|
removePending(response.config)
|
||||||
|
options.loading && closeLoading(options) // 关闭loading
|
||||||
if (
|
|
||||||
response.data.code === 'A0000' ||
|
if (
|
||||||
response.data.type === 'application/json' ||
|
response.data.code === 'A0000' ||
|
||||||
Array.isArray(response.data) ||
|
response.data.type === 'application/json' ||
|
||||||
response.data.size ||
|
Array.isArray(response.data) ||
|
||||||
response.config.url == '/harmonic-boot/exportmodel/exportModelJB' ||
|
response.data.size ||
|
||||||
response.config.url == '/system-boot/file/download' ||
|
response.config.url == '/harmonic-boot/exportmodel/exportModelJB' ||
|
||||||
response.config.url == '/harmonic-boot/powerStatistics/exportExcelListTemplate' ||
|
response.config.url == '/system-boot/file/download' ||
|
||||||
response.config.url == '/harmonic-boot/powerStatistics/exportExcelRangTemplate'
|
response.config.url == '/harmonic-boot/powerStatistics/exportExcelListTemplate' ||
|
||||||
// ||
|
response.config.url == '/harmonic-boot/powerStatistics/exportExcelRangTemplate'
|
||||||
// response.data.type === 'application/octet-stream' ||
|
// ||
|
||||||
// response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
// response.data.type === 'application/octet-stream' ||
|
||||||
) {
|
// response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
return options.reductDataFormat ? response.data : response
|
) {
|
||||||
} else if (response.data.code == 'A0202') {
|
return options.reductDataFormat ? response.data : response
|
||||||
if (!window.tokenRefreshing) {
|
} else if (response.data.code == 'A0202') {
|
||||||
window.tokenRefreshing = true
|
if (!window.tokenRefreshing) {
|
||||||
|
window.tokenRefreshing = true
|
||||||
return refreshToken()
|
|
||||||
.then(res => {
|
return refreshToken()
|
||||||
adminInfo.setToken(res.data.access_token, 'auth')
|
.then(res => {
|
||||||
window.requests.forEach(cb => cb(res.data.access_token))
|
adminInfo.setToken(res.data.access_token, 'auth')
|
||||||
window.requests = []
|
window.requests.forEach(cb => cb(res.data.access_token))
|
||||||
|
window.requests = []
|
||||||
return Axios(response.config)
|
|
||||||
})
|
return Axios(response.config)
|
||||||
.catch(err => {
|
})
|
||||||
adminInfo.removeToken()
|
.catch(err => {
|
||||||
router.push({ name: 'login' })
|
adminInfo.removeToken()
|
||||||
return Promise.reject(err)
|
router.push({ name: 'login' })
|
||||||
})
|
return Promise.reject(err)
|
||||||
.finally(() => {
|
})
|
||||||
window.tokenRefreshing = false
|
.finally(() => {
|
||||||
})
|
window.tokenRefreshing = false
|
||||||
} else {
|
})
|
||||||
return new Promise(resolve => {
|
} else {
|
||||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
return new Promise(resolve => {
|
||||||
window.requests.push((token: string) => {
|
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||||
response.headers.Authorization = `${token}`
|
window.requests.push((token: string) => {
|
||||||
resolve(Axios(response.config))
|
response.headers.Authorization = `${token}`
|
||||||
})
|
resolve(Axios(response.config))
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
} else if (response.data.code == 'A0024' || response.data.code == 'null') {
|
}
|
||||||
// // 登录失效
|
} else if (response.data.code == 'A0024' || response.data.code == 'null') {
|
||||||
// 清除上一次的定时器
|
// // 登录失效
|
||||||
if (loginExpireTimer) {
|
// 清除上一次的定时器
|
||||||
clearTimeout(loginExpireTimer)
|
if (loginExpireTimer) {
|
||||||
}
|
clearTimeout(loginExpireTimer)
|
||||||
loginExpireTimer = setTimeout(() => {
|
}
|
||||||
ElNotification({
|
loginExpireTimer = setTimeout(() => {
|
||||||
type: 'error',
|
ElNotification({
|
||||||
message: response.data.message
|
type: 'error',
|
||||||
})
|
message: response.data.message
|
||||||
adminInfo.removeToken()
|
})
|
||||||
router.push({ name: 'login' })
|
adminInfo.removeToken()
|
||||||
loginExpireTimer = null // 执行后清空定时器
|
router.push({ name: 'login' })
|
||||||
}, 100) // 可根据实际情况调整延迟时间
|
loginExpireTimer = null // 执行后清空定时器
|
||||||
return Promise.reject(response.data)
|
}, 100) // 可根据实际情况调整延迟时间
|
||||||
} else {
|
return Promise.reject(response.data)
|
||||||
if (options.showCodeMessage) {
|
} else {
|
||||||
ElNotification({
|
if (options.showCodeMessage) {
|
||||||
type: 'error',
|
ElNotification({
|
||||||
message: response.data.message || '未知错误'
|
type: 'error',
|
||||||
})
|
message: response.data.message || '未知错误'
|
||||||
}
|
})
|
||||||
return Promise.reject(response.data)
|
}
|
||||||
}
|
return Promise.reject(response.data)
|
||||||
},
|
}
|
||||||
error => {
|
},
|
||||||
error.config && removePending(error.config)
|
error => {
|
||||||
options.loading && closeLoading(options) // 关闭loading
|
error.config && removePending(error.config)
|
||||||
return Promise.reject(error) // 错误继续返回给到具体页面
|
options.loading && closeLoading(options) // 关闭loading
|
||||||
}
|
return Promise.reject(error) // 错误继续返回给到具体页面
|
||||||
)
|
}
|
||||||
return Axios(axiosConfig) as T
|
)
|
||||||
}
|
return Axios(axiosConfig) as T
|
||||||
|
}
|
||||||
export default createAxios
|
|
||||||
|
export default createAxios
|
||||||
/**
|
|
||||||
* 关闭Loading层实例
|
/**
|
||||||
*/
|
* 关闭Loading层实例
|
||||||
function closeLoading(options: Options) {
|
*/
|
||||||
if (options.loading && loadingInstance.count > 0) loadingInstance.count--
|
function closeLoading(options: Options) {
|
||||||
if (loadingInstance.count === 0) {
|
if (options.loading && loadingInstance.count > 0) loadingInstance.count--
|
||||||
loadingInstance.target.close()
|
if (loadingInstance.count === 0) {
|
||||||
loadingInstance.target = null
|
loadingInstance.target.close()
|
||||||
}
|
loadingInstance.target = null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 储存每个请求的唯一cancel回调, 以此为标识
|
/**
|
||||||
*/
|
* 储存每个请求的唯一cancel回调, 以此为标识
|
||||||
function addPending(config: AxiosRequestConfig) {
|
*/
|
||||||
const pendingKey = getPendingKey(config)
|
function addPending(config: AxiosRequestConfig) {
|
||||||
config.cancelToken =
|
const pendingKey = getPendingKey(config)
|
||||||
config.cancelToken ||
|
config.cancelToken =
|
||||||
new axios.CancelToken(cancel => {
|
config.cancelToken ||
|
||||||
if (!pendingMap.has(pendingKey)) {
|
new axios.CancelToken(cancel => {
|
||||||
pendingMap.set(pendingKey, cancel)
|
if (!pendingMap.has(pendingKey)) {
|
||||||
}
|
pendingMap.set(pendingKey, cancel)
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 删除重复的请求
|
/**
|
||||||
*/
|
* 删除重复的请求
|
||||||
function removePending(config: AxiosRequestConfig) {
|
*/
|
||||||
const pendingKey = getPendingKey(config)
|
function removePending(config: AxiosRequestConfig) {
|
||||||
if (pendingMap.has(pendingKey)) {
|
const pendingKey = getPendingKey(config)
|
||||||
const cancelToken = pendingMap.get(pendingKey)
|
if (pendingMap.has(pendingKey)) {
|
||||||
cancelToken(pendingKey)
|
const cancelToken = pendingMap.get(pendingKey)
|
||||||
pendingMap.delete(pendingKey)
|
cancelToken(pendingKey)
|
||||||
}
|
pendingMap.delete(pendingKey)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 生成每个请求的唯一key
|
/**
|
||||||
*/
|
* 生成每个请求的唯一key
|
||||||
function getPendingKey(config: AxiosRequestConfig) {
|
*/
|
||||||
let { data } = config
|
function getPendingKey(config: AxiosRequestConfig) {
|
||||||
const { url, method, params, headers } = config
|
let { data } = config
|
||||||
if (typeof data === 'string') data = JSON.parse(data) // response里面返回的config.data是个字符串对象
|
const { url, method, params, headers } = config
|
||||||
return [
|
if (typeof data === 'string') data = JSON.parse(data) // response里面返回的config.data是个字符串对象
|
||||||
url,
|
return [
|
||||||
method,
|
url,
|
||||||
headers && (headers as anyObj).Authorization ? (headers as anyObj).Authorization : '',
|
method,
|
||||||
headers && (headers as anyObj)['ba-user-token'] ? (headers as anyObj)['ba-user-token'] : '',
|
headers && (headers as anyObj).Authorization ? (headers as anyObj).Authorization : '',
|
||||||
JSON.stringify(params),
|
headers && (headers as anyObj)['ba-user-token'] ? (headers as anyObj)['ba-user-token'] : '',
|
||||||
JSON.stringify(data)
|
JSON.stringify(params),
|
||||||
].join('&')
|
JSON.stringify(data)
|
||||||
}
|
].join('&')
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 根据请求方法组装请求数据/参数
|
/**
|
||||||
*/
|
* 根据请求方法组装请求数据/参数
|
||||||
export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) {
|
*/
|
||||||
if (method == 'GET') {
|
export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) {
|
||||||
return {
|
if (method == 'GET') {
|
||||||
params: data
|
return {
|
||||||
}
|
params: data
|
||||||
} else if (method == 'POST') {
|
}
|
||||||
if (paramsPOST) {
|
} else if (method == 'POST') {
|
||||||
return { params: data }
|
if (paramsPOST) {
|
||||||
} else {
|
return { params: data }
|
||||||
return { data: data }
|
} else {
|
||||||
}
|
return { data: data }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 适配器, 用于适配不同的请求方式
|
}
|
||||||
export function baseRequest(url, value = {}, method = 'post', options = {}) {
|
// 适配器, 用于适配不同的请求方式
|
||||||
url = sysConfig.API_URL + url
|
export function baseRequest(url, value = {}, method = 'post', options = {}) {
|
||||||
if (method === 'post') {
|
url = sysConfig.API_URL + url
|
||||||
return service.post(url, value, options)
|
if (method === 'post') {
|
||||||
} else if (method === 'get') {
|
return service.post(url, value, options)
|
||||||
return service.get(url, { params: value, ...options })
|
} else if (method === 'get') {
|
||||||
} else if (method === 'formdata') {
|
return service.get(url, { params: value, ...options })
|
||||||
// form-data表单提交的方式
|
} else if (method === 'formdata') {
|
||||||
return service.post(url, qs.stringify(value), {
|
// form-data表单提交的方式
|
||||||
headers: {
|
return service.post(url, qs.stringify(value), {
|
||||||
'Content-Type': 'multipart/form-data'
|
headers: {
|
||||||
},
|
'Content-Type': 'multipart/form-data'
|
||||||
...options
|
},
|
||||||
})
|
...options
|
||||||
} else {
|
})
|
||||||
// 其他请求方式,例如:put、delete
|
} else {
|
||||||
return service({
|
// 其他请求方式,例如:put、delete
|
||||||
method: method,
|
return service({
|
||||||
url: url,
|
method: method,
|
||||||
data: value,
|
url: url,
|
||||||
...options
|
data: value,
|
||||||
})
|
...options
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
// 模块内的请求, 会自动加上模块的前缀
|
}
|
||||||
export const moduleRequest =
|
// 模块内的请求, 会自动加上模块的前缀
|
||||||
moduleUrl =>
|
export const moduleRequest =
|
||||||
(url, ...arg) => {
|
moduleUrl =>
|
||||||
return baseRequest(moduleUrl + url, ...arg)
|
(url, ...arg) => {
|
||||||
}
|
return baseRequest(moduleUrl + url, ...arg)
|
||||||
|
}
|
||||||
interface LoadingInstance {
|
|
||||||
target: any
|
interface LoadingInstance {
|
||||||
count: number
|
target: any
|
||||||
}
|
count: number
|
||||||
|
}
|
||||||
interface Options {
|
|
||||||
// 是否开启取消重复请求, 默认为 true
|
interface Options {
|
||||||
CancelDuplicateRequest?: boolean
|
// 是否开启取消重复请求, 默认为 true
|
||||||
// 是否开启loading层效果, 默认为false
|
CancelDuplicateRequest?: boolean
|
||||||
loading?: boolean
|
// 是否开启loading层效果, 默认为false
|
||||||
// 是否开启简洁的数据结构响应, 默认为true
|
loading?: boolean
|
||||||
reductDataFormat?: boolean
|
// 是否开启简洁的数据结构响应, 默认为true
|
||||||
// 是否开启code不为A0000时的信息提示, 默认为true
|
reductDataFormat?: boolean
|
||||||
showCodeMessage?: boolean
|
// 是否开启code不为A0000时的信息提示, 默认为true
|
||||||
// 是否开启code为0时的信息提示, 默认为false
|
showCodeMessage?: boolean
|
||||||
showSuccessMessage?: boolean
|
// 是否开启code为0时的信息提示, 默认为false
|
||||||
// 当前请求使用另外的用户token
|
showSuccessMessage?: boolean
|
||||||
anotherToken?: string
|
// 当前请求使用另外的用户token
|
||||||
}
|
anotherToken?: string
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ interface TableStoreParams {
|
|||||||
publicHeight?: number //计算高度
|
publicHeight?: number //计算高度
|
||||||
resetCallback?: () => void // 重置
|
resetCallback?: () => void // 重置
|
||||||
loadCallback?: () => void // 接口调用后的回调
|
loadCallback?: () => void // 接口调用后的回调
|
||||||
exportProcessingData?:() => void //导出处理数据
|
exportProcessingData?: () => void //导出处理数据
|
||||||
beforeSearchFun?: () => void // 接口调用前的回调
|
beforeSearchFun?: () => void // 接口调用前的回调
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,8 +45,9 @@ export default class TableStore {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
},
|
},
|
||||||
filename:null,
|
filename: null,
|
||||||
loading: true,
|
loading: true,
|
||||||
|
exportLoading: false,
|
||||||
column: [],
|
column: [],
|
||||||
loadCallback: null,
|
loadCallback: null,
|
||||||
exportProcessingData: null,
|
exportProcessingData: null,
|
||||||
@@ -65,7 +66,7 @@ export default class TableStore {
|
|||||||
this.table.filename = options.filename || null
|
this.table.filename = options.filename || null
|
||||||
this.table.column = options.column
|
this.table.column = options.column
|
||||||
this.showPage = options.showPage !== false
|
this.showPage = options.showPage !== false
|
||||||
|
|
||||||
this.table.publicHeight = options.publicHeight || 0
|
this.table.publicHeight = options.publicHeight || 0
|
||||||
this.table.resetCallback = options.resetCallback || null
|
this.table.resetCallback = options.resetCallback || null
|
||||||
this.table.loadCallback = options.loadCallback || null
|
this.table.loadCallback = options.loadCallback || null
|
||||||
@@ -84,13 +85,11 @@ export default class TableStore {
|
|||||||
this.initData = JSON.parse(JSON.stringify(this.table.params))
|
this.initData = JSON.parse(JSON.stringify(this.table.params))
|
||||||
}
|
}
|
||||||
if (!this.timeAll) {
|
if (!this.timeAll) {
|
||||||
delete this.table.params.startTime;
|
delete this.table.params.startTime
|
||||||
delete this.table.params.endTime;
|
delete this.table.params.endTime
|
||||||
delete this.table.params.searchBeginTime;
|
delete this.table.params.searchBeginTime
|
||||||
delete this.table.params.searchEndTime;
|
delete this.table.params.searchEndTime
|
||||||
delete this.table.params.timeFlag;
|
delete this.table.params.timeFlag
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
createAxios(
|
createAxios(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@@ -134,6 +133,7 @@ export default class TableStore {
|
|||||||
[
|
[
|
||||||
'search',
|
'search',
|
||||||
() => {
|
() => {
|
||||||
|
|
||||||
this.table.params.pageNum = 1
|
this.table.params.pageNum = 1
|
||||||
this.index()
|
this.index()
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,9 @@ export default class TableStore {
|
|||||||
[
|
[
|
||||||
'export',
|
'export',
|
||||||
() => {
|
() => {
|
||||||
|
this.table.exportLoading = true
|
||||||
// this.index()
|
// this.index()
|
||||||
|
//console.log('export')
|
||||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||||
createAxios(
|
createAxios(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@@ -211,11 +213,17 @@ export default class TableStore {
|
|||||||
},
|
},
|
||||||
requestPayload(this.method, params, this.paramsPOST)
|
requestPayload(this.method, params, this.paramsPOST)
|
||||||
)
|
)
|
||||||
).then(res => {
|
)
|
||||||
this.table.allData = filtration(res.data.records || res.data)
|
.then(res => {
|
||||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
this.table.allData = filtration(res.data.records || res.data)
|
||||||
this.table.allFlag = data.showAllFlag || true
|
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||||
})
|
this.table.allFlag = data.showAllFlag || true
|
||||||
|
this.table.exportLoading = false
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.table.exportLoading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,125 +1,125 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<TableHeader ref="TableHeaderRef">
|
<TableHeader ref="TableHeaderRef">
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="新能源场站名称">
|
<el-form-item label="新能源场站名称">
|
||||||
<el-input v-model="tableStore.table.params.name" clearable placeholder="输入关键字筛选" />
|
<el-input v-model="tableStore.table.params.name" clearable placeholder="输入关键字筛选" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
|
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef" />
|
<Table ref="tableRef" />
|
||||||
<!--弹框-->
|
<!--弹框-->
|
||||||
<addForm ref="addFormRef" @onSubmit="tableStore.index()" />
|
<addForm ref="addFormRef" @onSubmit="tableStore.index()" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import addForm from './components/addForm.vue'
|
import addForm from './components/addForm.vue'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { delNewStation } from '@/api/device-boot/newEnergy'
|
import { delNewStation } from '@/api/device-boot/newEnergy'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'newEnergy/newEnergyLedger'
|
name: 'newEnergy/newEnergyLedger'
|
||||||
})
|
})
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
//获取登陆用户姓名和部门
|
//获取登陆用户姓名和部门
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
const newEnergy = dictData.getBasicData('new_station_type')
|
const newEnergy = dictData.getBasicData('new_station_type')
|
||||||
const scaleList = dictData.getBasicData('Dev_Voltage_Stand')
|
const scaleList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||||
const tableRef = ref()
|
const tableRef = ref()
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const addFormRef = ref()
|
const addFormRef = ref()
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/device-boot/newStation/queryPage',
|
url: '/device-boot/newStation/queryPage',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: '80',
|
width: '80',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ field: 'name', title: '新能源场站名称' },
|
{ field: 'name', title: '新能源场站名称' },
|
||||||
{
|
{
|
||||||
field: 'stationType',
|
field: 'stationType',
|
||||||
title: '新能源场站类型',
|
title: '新能源场站类型',
|
||||||
|
|
||||||
formatter: (row: any) => newEnergy.filter(item => item.id == row.cellValue)[0]?.name
|
formatter: (row: any) => newEnergy.filter(item => item.id == row.cellValue)[0]?.name
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'scale',
|
field: 'scale',
|
||||||
title: '电压等级',
|
title: '电压等级',
|
||||||
|
|
||||||
formatter: (row: any) => scaleList.filter(item => item.id == row.cellValue)[0]?.name
|
formatter: (row: any) => scaleList.filter(item => item.id == row.cellValue)[0]?.name
|
||||||
},
|
},
|
||||||
{ field: 'ratedPower', title: '额定有功功率(kW)' },
|
{ field: 'ratedPower', title: '额定有功功率(kW)' },
|
||||||
{ 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',
|
||||||
title: '修改',
|
title: '修改',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-edit',
|
icon: 'el-icon-edit',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
click: row => {
|
click: row => {
|
||||||
addFormRef.value.open({
|
addFormRef.value.open({
|
||||||
title: '修改',
|
title: '修改',
|
||||||
row: row
|
row: row
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
title: '删除',
|
title: '删除',
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
icon: 'el-icon-Delete',
|
icon: 'el-icon-Delete',
|
||||||
render: 'confirmButton',
|
render: 'confirmButton',
|
||||||
popconfirm: {
|
popconfirm: {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
confirmButtonType: 'danger',
|
confirmButtonType: 'danger',
|
||||||
title: '确定删除该数据吗?'
|
title: '确定删除该数据吗?'
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
delNewStation({ ids: row.id }).then(() => {
|
delNewStation({ ids: row.id }).then(() => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success('删除成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
beforeSearchFun: () => {
|
beforeSearchFun: () => {
|
||||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||||
},
|
},
|
||||||
loadCallback: () => {}
|
loadCallback: () => {}
|
||||||
})
|
})
|
||||||
tableStore.table.params.name = ''
|
tableStore.table.params.name = ''
|
||||||
const add = () => {
|
const add = () => {
|
||||||
addFormRef.value.open({
|
addFormRef.value.open({
|
||||||
title: '新增'
|
title: '新增'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ const tableStore: any = new TableStore({
|
|||||||
{ field: 'describe', title: '事件描述' },
|
{ field: 'describe', title: '事件描述' },
|
||||||
{ field: 'type', title: '事件类型', sortable: true },
|
{ field: 'type', title: '事件类型', sortable: true },
|
||||||
{ field: 'result', title: '操作结果', sortable: true },
|
{ field: 'result', title: '操作结果', sortable: true },
|
||||||
{ field: 'ip', title: '操作IP' },
|
{ field: 'ip', title: '操作IP' ,width:'120px'},
|
||||||
{ field: 'level', title: '事件等级', sortable: true }
|
{ field: 'level', title: '事件等级', sortable: true }
|
||||||
],
|
],
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -26,7 +26,7 @@ const tableStore: any = new TableStore({
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ field: 'userName', title: '登录用户' },
|
{ field: 'userName', title: '登录用户' },
|
||||||
{ field: 'ip', title: '登录ip' },
|
{ field: 'ip', title: '登录ip' ,width:'120px'},
|
||||||
{ field: 'time', title: '登录时间' }
|
{ field: 'time', title: '登录时间' }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -288,18 +288,21 @@ 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' // 设置下载的文件名,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<pane style="background: #fff">
|
<pane style="background: #fff">
|
||||||
<TableHeader :showSearch="false" v-show="props.rowList.id == undefined">
|
<TableHeader :showSearch="false" v-show="props.rowList.id == undefined">
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="时间">
|
<el-form-item label="统计时间">
|
||||||
<DatePicker ref="datePickerRef"></DatePicker>
|
<DatePicker ref="datePickerRef"></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -205,7 +205,7 @@ const props = defineProps(['rowList'])
|
|||||||
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
||||||
const currentLod = ref(false)
|
const currentLod = ref(false)
|
||||||
const monitoringPoint = useMonitoringPoint()
|
const monitoringPoint = useMonitoringPoint()
|
||||||
const size = ref(0)
|
const size = ref(19)
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
const height = mainHeight(80).height
|
const height = mainHeight(80).height
|
||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -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: [
|
||||||
|
|||||||
@@ -56,8 +56,10 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="区域" prop="regionList">
|
<el-form-item label="区域" prop="regionList">
|
||||||
<el-cascader v-model="form.regionList" style="width: 100%" :props="props" :options="areaList" />
|
<!-- <el-cascader v-model="form.regionList" style="width: 100%" :props="props" :options="areaList" /> -->
|
||||||
|
<el-cascader v-model="form.regionList" :props="props" :options="areaList" style="width: 100%" placeholder="请选择区域" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="详细地址:" prop="area">
|
<el-form-item label="详细地址:" prop="area">
|
||||||
<el-input
|
<el-input
|
||||||
clearable
|
clearable
|
||||||
@@ -93,6 +95,8 @@ import { mainHeight } from '@/utils/layout'
|
|||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import equipment from './equipment.vue'
|
import equipment from './equipment.vue'
|
||||||
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
||||||
|
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'estimate/photovoltaic'
|
name: 'estimate/photovoltaic'
|
||||||
})
|
})
|
||||||
@@ -104,7 +108,8 @@ const disabled = ref(false)
|
|||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
const equipmentRef = ref()
|
const equipmentRef = ref()
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const areaList: any = dictData.areaSelect()
|
//const areaList: any = dictData.areaSelect()
|
||||||
|
const areaList = ref([])
|
||||||
const userShow: any = ref('Power_Station_Users')
|
const userShow: any = ref('Power_Station_Users')
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
@@ -182,7 +187,7 @@ const tableStore: any = new TableStore({
|
|||||||
{ field: 'createBy', title: '创建者' },
|
{ field: 'createBy', title: '创建者' },
|
||||||
{ field: 'createTime', title: '创建日期' },
|
{ field: 'createTime', title: '创建日期' },
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
buttons: [
|
buttons: [
|
||||||
@@ -254,7 +259,7 @@ const tableStore: any = new TableStore({
|
|||||||
],
|
],
|
||||||
|
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
console.log(tableStore.table.data)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -263,14 +268,20 @@ tableStore.table.params.userType = ''
|
|||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
const useChange = (e: string) => {
|
const useChange = (e: string) => {
|
||||||
userShow.value = uesrList.filter(item => item.id == e)[0].code
|
userShow.value = uesrList.filter(item => item.id == e)[0].code
|
||||||
}
|
}
|
||||||
// 新增
|
// 新增
|
||||||
const add = () => {
|
const add = async () => {
|
||||||
disabled.value = false
|
disabled.value = false
|
||||||
title.value = '新增承载能力待评估用户'
|
title.value = '新增承载能力待评估用户'
|
||||||
|
|
||||||
|
await getAreaDept().then(res => {
|
||||||
|
areaList.value = JSON.parse(JSON.stringify(res.data))
|
||||||
|
})
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
// 保存
|
// 保存
|
||||||
|
|||||||
@@ -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,7 @@
|
|||||||
></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 +83,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 }">
|
||||||
@@ -139,9 +139,9 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</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 +149,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 +209,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'
|
||||||
@@ -218,6 +219,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import { ElButton } from 'element-plus'
|
import { ElButton } from 'element-plus'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import Bind from './bind.vue'
|
import Bind from './bind.vue'
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'hainan'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'BusinessAdministrator/TerminalManagement/FrontManagement'
|
name: 'BusinessAdministrator/TerminalManagement/FrontManagement'
|
||||||
})
|
})
|
||||||
@@ -239,6 +241,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'
|
||||||
@@ -270,7 +273,7 @@ const tableStore = new TableStore({
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '名称', field: 'name' },
|
{ title: '名称', field: 'name' },
|
||||||
{ title: 'IP', field: 'ip' },
|
{ title: 'IP', field: 'ip' ,width:'120px' },
|
||||||
{
|
{
|
||||||
title: '等级',
|
title: '等级',
|
||||||
field: 'nodeGrade',
|
field: 'nodeGrade',
|
||||||
@@ -287,7 +290,7 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '最大监测点数量',
|
title: '最大终端数量',
|
||||||
field: 'nodeDevNum'
|
field: 'nodeDevNum'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -314,7 +317,7 @@ const tableStore = new TableStore({
|
|||||||
{ title: '描述', field: 'remark' },
|
{ title: '描述', field: 'remark' },
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
@@ -338,6 +341,9 @@ const tableStore = new TableStore({
|
|||||||
type: 'warning',
|
type: 'warning',
|
||||||
icon: 'el-icon-Delete',
|
icon: 'el-icon-Delete',
|
||||||
render: 'confirmButton',
|
render: 'confirmButton',
|
||||||
|
disabled: row => {
|
||||||
|
return VITE_FLAG
|
||||||
|
},
|
||||||
popconfirm: {
|
popconfirm: {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -346,7 +352,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 => {
|
||||||
@@ -369,12 +375,42 @@ 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()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -391,12 +427,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,15 +447,27 @@ 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
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -426,11 +476,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()
|
||||||
@@ -579,7 +629,7 @@ const addMenu = () => {}
|
|||||||
:deep(.default) {
|
:deep(.default) {
|
||||||
display: flex;
|
display: flex;
|
||||||
.row--current {
|
.row--current {
|
||||||
background-color: var(--el-color-primary-light-8) !important;
|
// background-color: var(--el-color-primary-light-8) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.custom-tree-node {
|
.custom-tree-node {
|
||||||
|
|||||||
@@ -1,355 +1,358 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main" style="position: relative">
|
<div class="default-main" style="position: relative">
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template #select>
|
<template #select>
|
||||||
<el-form-item label="终端型号">
|
<el-form-item label="终端型号">
|
||||||
<el-select v-model="tableStore.table.params.teriminal" clearable placeholder="请选择终端型号">
|
<el-select v-model="tableStore.table.params.teriminal" clearable placeholder="请选择终端型号">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminaloption"
|
v-for="item in teriminaloption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="终端状态">
|
<el-form-item label="终端状态">
|
||||||
<el-select v-model="tableStore.table.params.teriminalstatus" clearable placeholder="请选择终端状态">
|
<el-select v-model="tableStore.table.params.teriminalstatus" clearable placeholder="请选择终端状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in teriminalstatusoption"
|
v-for="item in teriminalstatusoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通讯状态">
|
<el-form-item label="通讯状态">
|
||||||
<el-select v-model="tableStore.table.params.state" clearable placeholder="请选择通讯状态">
|
<el-select v-model="tableStore.table.params.state" clearable placeholder="请选择通讯状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in stateoption"
|
v-for="item in stateoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="程序版本">
|
<!-- <el-form-item label="程序版本">
|
||||||
<el-select v-model="tableStore.table.params.program" clearable placeholder="请选择程序版本">
|
<el-select v-model="tableStore.table.params.program" clearable placeholder="请选择程序版本">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in programoption"
|
v-for="item in programoption"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="筛选">
|
<el-form-item label="筛选数据">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="tableStore.table.params.filterName"
|
v-model="tableStore.table.params.filterName"
|
||||||
@keyup="searchEvent"
|
@keyup="searchEvent"
|
||||||
placeholder="输入关键字筛选"
|
maxlength="32"
|
||||||
/>
|
show-word-limit
|
||||||
</el-form-item>
|
placeholder="输入关键字筛选"
|
||||||
</template>
|
/>
|
||||||
<template #operation>
|
</el-form-item>
|
||||||
<el-button icon="el-icon-Download" @click="add">导出</el-button>
|
</template>
|
||||||
<el-button icon="el-icon-Check" @click="add">批量升级</el-button>
|
<!-- <template #operation>
|
||||||
</template>
|
<el-button icon="el-icon-Download" @click="add">导出</el-button>
|
||||||
</TableHeader>
|
<el-button icon="el-icon-Check" @click="add">批量升级</el-button>
|
||||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
</template> -->
|
||||||
<vxe-table
|
</TableHeader>
|
||||||
v-loading="tableStore.table.loading"
|
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||||
height="auto"
|
<vxe-table
|
||||||
auto-resize
|
v-loading="tableStore.table.loading"
|
||||||
ref="tableRef"
|
height="auto"
|
||||||
v-bind="defaultAttribute"
|
auto-resize
|
||||||
:data="treeData"
|
ref="tableRef"
|
||||||
show-overflow
|
v-bind="defaultAttribute"
|
||||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
:data="treeData"
|
||||||
:scroll-y="{ enabled: true }"
|
show-overflow
|
||||||
>
|
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||||
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
:scroll-y="{ enabled: true }"
|
||||||
<vxe-column field="devType" title="终端型号" :formatter="formFilter"></vxe-column>
|
>
|
||||||
<vxe-column field="versionName" title="版本号"></vxe-column>
|
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
||||||
<vxe-column field="protocol" title="协议版本"></vxe-column>
|
<vxe-column field="devType" title="终端型号" :formatter="formFilter"></vxe-column>
|
||||||
<vxe-column field="versionDate" title="版本日期"></vxe-column>
|
<vxe-column field="versionName" title="版本号"></vxe-column>
|
||||||
<vxe-column field="runFlag" title="终端状态">
|
<vxe-column field="protocol" title="协议版本"></vxe-column>
|
||||||
<template #default="{ row }">
|
<vxe-column field="versionDate" title="版本日期"></vxe-column>
|
||||||
<el-tag v-if="row.runFlag === 0" style="color: #fff; background: #0099cc" size="small">
|
<vxe-column field="runFlag" title="终端状态">
|
||||||
投运
|
<template #default="{ row }">
|
||||||
</el-tag>
|
<el-tag v-if="row.runFlag === 0" style="color: #fff; background: #0099cc" size="small">
|
||||||
<el-tag v-if="row.runFlag === 1" style="color: #fff; background: #996600" size="small">
|
投运
|
||||||
检修
|
</el-tag>
|
||||||
</el-tag>
|
<el-tag v-if="row.runFlag === 1" style="color: #fff; background: #996600" size="small">
|
||||||
<el-tag v-if="row.runFlag === 2" style="color: #fff; background: #A52a2a" size="small">
|
检修
|
||||||
停运
|
</el-tag>
|
||||||
</el-tag>
|
<el-tag v-if="row.runFlag === 2" style="color: #fff; background: #A52a2a" size="small">
|
||||||
</template>
|
停运
|
||||||
</vxe-column>
|
</el-tag>
|
||||||
<vxe-column field="comFlag" title="通讯状态">
|
</template>
|
||||||
<template #default="{ row }">
|
</vxe-column>
|
||||||
<el-tag v-if="row.comFlag === 0" style="color: #fff; background: #A52a2a" size="small">
|
<vxe-column field="comFlag" title="通讯状态">
|
||||||
中断
|
<template #default="{ row }">
|
||||||
</el-tag>
|
<el-tag v-if="row.comFlag === 0" style="color: #fff; background: #A52a2a" size="small">
|
||||||
<el-tag v-if="row.comFlag === 1" style="color: #fff; background: #2e8b57" size="small">
|
中断
|
||||||
正常
|
</el-tag>
|
||||||
</el-tag>
|
<el-tag v-if="row.comFlag === 1" style="color: #fff; background: #2e8b57" size="small">
|
||||||
</template>
|
正常
|
||||||
</vxe-column>
|
</el-tag>
|
||||||
<vxe-column field="updateBy" title="升级人员">
|
</template>
|
||||||
<template #default="{ row }">
|
</vxe-column>
|
||||||
<span v-if="row.updateBy == null || row.updateBy == '/'">--</span>
|
<vxe-column field="updateBy" title="升级人员">
|
||||||
<span v-else>{{ row.updateBy }}</span>
|
<template #default="{ row }">
|
||||||
</template>
|
<span v-if="row.updateBy == null || row.updateBy == '/'">--</span>
|
||||||
</vxe-column>
|
<span v-else>{{ row.updateBy }}</span>
|
||||||
<vxe-column field="updateTime" title="最新升级时间"></vxe-column>
|
</template>
|
||||||
<vxe-column title="操作" min-width="100">
|
</vxe-column>
|
||||||
<template #default="{ row }">
|
<vxe-column field="updateTime" title="最新升级时间"></vxe-column>
|
||||||
<el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button>
|
<vxe-column title="操作" min-width="100">
|
||||||
<el-button
|
<template #default="{ row }">
|
||||||
v-if="row.level == 4"
|
<!-- <el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button> -->
|
||||||
:disabled="row.state == 1 ? true : false"
|
<el-button
|
||||||
size="small"
|
v-if="row.level == 4"
|
||||||
link
|
:disabled="row.state == 1 ? true : false"
|
||||||
@click="queryview(row)"
|
size="small"
|
||||||
>
|
link
|
||||||
日志查看
|
@click="queryview(row)"
|
||||||
</el-button>
|
>
|
||||||
</template>
|
日志查看
|
||||||
</vxe-column>
|
</el-button>
|
||||||
</vxe-table>
|
</template>
|
||||||
</div>
|
</vxe-column>
|
||||||
<el-dialog
|
</vxe-table>
|
||||||
draggable
|
</div>
|
||||||
v-model="dialogVisible"
|
<el-dialog
|
||||||
:close-on-click-modal="false"
|
draggable
|
||||||
:title="protitle + '#终端升级日志查看'"
|
v-model="dialogVisible"
|
||||||
width="70%"
|
:close-on-click-modal="false"
|
||||||
>
|
:title="protitle + '#终端升级日志查看'"
|
||||||
<div :style="{ height: dialogHeight.height }">
|
width="70%"
|
||||||
<vxe-table height="auto" auto-resize :data="logtableData" v-bind="defaultAttribute">
|
>
|
||||||
<vxe-column field="devTypeName" align="center" title="终端序号"></vxe-column>
|
<div :style="{ height: dialogHeight.height }">
|
||||||
<vxe-column field="versionId" align="center" title="版本序号"></vxe-column>
|
<vxe-table height="auto" auto-resize :data="logtableData" v-bind="defaultAttribute">
|
||||||
<vxe-column field="flag" align="center" title="版本状态" width="100">
|
<vxe-column field="devTypeName" align="center" title="终端序号"></vxe-column>
|
||||||
<template #default="{ row }">
|
<vxe-column field="versionId" align="center" title="版本序号"></vxe-column>
|
||||||
<el-tag v-if="row.flag == true" style="color: #fff; background: #fc0">前期版本</el-tag>
|
<vxe-column field="flag" align="center" title="版本状态" width="100">
|
||||||
<el-tag v-if="row.flag == false" style="color: #fff; background: #0c0">当前版本</el-tag>
|
<template #default="{ row }">
|
||||||
</template>
|
<el-tag v-if="row.flag == true" style="color: #fff; background: #fc0">前期版本</el-tag>
|
||||||
</vxe-column>
|
<el-tag v-if="row.flag == false" style="color: #fff; background: #0c0">当前版本</el-tag>
|
||||||
<vxe-column field="result" align="center" title="升级结果" width="100">
|
</template>
|
||||||
<template #default="{ row }">
|
</vxe-column>
|
||||||
<el-tag v-if="row.result == false" style="color: #fff; background: #f30">升级失败</el-tag>
|
<vxe-column field="result" align="center" title="升级结果" width="100">
|
||||||
<el-tag v-if="row.result == true" style="color: #fff; background: #093">升级成功</el-tag>
|
<template #default="{ row }">
|
||||||
</template>
|
<el-tag v-if="row.result == false" style="color: #fff; background: #f30">升级失败</el-tag>
|
||||||
</vxe-column>
|
<el-tag v-if="row.result == true" style="color: #fff; background: #093">升级成功</el-tag>
|
||||||
<vxe-column field="state" align="center" title="状态" width="100">
|
</template>
|
||||||
<template #default="{ row }">
|
</vxe-column>
|
||||||
<el-tag v-if="row.state == false" style="color: #fff; background: #f30">删除</el-tag>
|
<vxe-column field="state" align="center" title="状态" width="100">
|
||||||
<el-tag v-if="row.state == true" style="color: #fff; background: #093">正常</el-tag>
|
<template #default="{ row }">
|
||||||
</template>
|
<el-tag v-if="row.state == false" style="color: #fff; background: #f30">删除</el-tag>
|
||||||
</vxe-column>
|
<el-tag v-if="row.state == true" style="color: #fff; background: #093">正常</el-tag>
|
||||||
<vxe-column field="createBy" align="center" title="创建用户"></vxe-column>
|
</template>
|
||||||
<vxe-column field="createTime" align="center" title="创建时间"></vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="updateTime" align="center" title="升级时间"></vxe-column>
|
<vxe-column field="createBy" align="center" title="创建用户"></vxe-column>
|
||||||
<vxe-column field="updateBy" align="center" title="升级人员"></vxe-column>
|
<vxe-column field="createTime" align="center" title="创建时间"></vxe-column>
|
||||||
</vxe-table>
|
<vxe-column field="updateTime" align="center" title="升级时间"></vxe-column>
|
||||||
</div>
|
<vxe-column field="updateBy" align="center" title="升级人员"></vxe-column>
|
||||||
</el-dialog>
|
</vxe-table>
|
||||||
<!-- 升级 -->
|
</div>
|
||||||
<el-dialog
|
</el-dialog>
|
||||||
draggable
|
<!-- 升级 -->
|
||||||
v-model="prodialogVisible"
|
<el-dialog
|
||||||
:close-on-click-modal="false"
|
draggable
|
||||||
:title="protitle + '#终端程序升级'"
|
v-model="prodialogVisible"
|
||||||
width="40%"
|
:close-on-click-modal="false"
|
||||||
>
|
:title="protitle + '#终端程序升级'"
|
||||||
<el-col v-for="(item, index) in percentageoption" :key="index">
|
width="40%"
|
||||||
<span style="font-size: 14px; font-weight: bold">{{ item.name }}</span>
|
>
|
||||||
:
|
<el-col v-for="(item, index) in percentageoption" :key="index">
|
||||||
<el-progress
|
<span style="font-size: 14px; font-weight: bold">{{ item.name }}</span>
|
||||||
:text-inside="true"
|
:
|
||||||
:stroke-width="24"
|
<el-progress
|
||||||
:percentage="item.percentage"
|
:text-inside="true"
|
||||||
:status="item.status"
|
:stroke-width="24"
|
||||||
:format="format"
|
:percentage="item.percentage"
|
||||||
></el-progress>
|
:status="item.status"
|
||||||
</el-col>
|
:format="format"
|
||||||
</el-dialog>
|
></el-progress>
|
||||||
</div>
|
</el-col>
|
||||||
</template>
|
</el-dialog>
|
||||||
<script setup lang="ts">
|
</div>
|
||||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
</template>
|
||||||
import TableStore from '@/utils/tableStore'
|
<script setup lang="ts">
|
||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableStore from '@/utils/tableStore'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import { getTerminalUpLog } from '@/api/device-boot/Business'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import XEUtils from 'xe-utils'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
import { getTerminalUpLog } from '@/api/device-boot/Business'
|
||||||
import { debounce } from 'lodash-es'
|
import XEUtils from 'xe-utils'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { getDevTypeList } from '@/api/device-boot/modelManage'
|
||||||
defineOptions({
|
import { debounce } from 'lodash-es'
|
||||||
name: 'BusinessAdministrator/TerminalManagement/ProgramManagement'
|
import { useDictData } from '@/stores/dictData'
|
||||||
})
|
defineOptions({
|
||||||
|
name: 'BusinessAdministrator/TerminalManagement/ProgramManagement'
|
||||||
const pageHeight = mainHeight(83)
|
})
|
||||||
const dialogHeight = mainHeight(300)
|
|
||||||
const dictData = useDictData()
|
const pageHeight = mainHeight(83)
|
||||||
const teriminaloption: any = ref([])
|
const dialogHeight = mainHeight(300)
|
||||||
const teriminalstatusoption = ref([
|
const dictData = useDictData()
|
||||||
{ name: '全部', id: '' },
|
const teriminaloption: any = ref([])
|
||||||
{ name: '投运', id: 0 },
|
const teriminalstatusoption = ref([
|
||||||
{ name: '检修', id: 1 },
|
{ name: '全部', id: '' },
|
||||||
{ name: '停运', id: 2 }
|
{ name: '投运', id: 0 },
|
||||||
])
|
{ name: '检修', id: 1 },
|
||||||
const stateoption = ref([
|
{ name: '停运', id: 2 }
|
||||||
{ name: '全部', id: '' },
|
])
|
||||||
{ name: '正常', id: 1 },
|
const stateoption = ref([
|
||||||
{ name: '中断', id: 0 }
|
{ name: '全部', id: '' },
|
||||||
])
|
{ name: '正常', id: 1 },
|
||||||
const prodialogVisible = ref(false)
|
{ name: '中断', id: 0 }
|
||||||
const dialogVisible = ref(false)
|
])
|
||||||
const protitle = ref('')
|
const prodialogVisible = ref(false)
|
||||||
const treeData: any = ref([])
|
const dialogVisible = ref(false)
|
||||||
const treeDataCopy: any = ref([])
|
const protitle = ref('')
|
||||||
//进度条对象
|
const treeData: any = ref([])
|
||||||
const percentageoption = ref([
|
const treeDataCopy: any = ref([])
|
||||||
{
|
//进度条对象
|
||||||
name: '1号测试终端',
|
const percentageoption = ref([
|
||||||
status: 'exception',
|
{
|
||||||
percentage: 20
|
name: '1号测试终端',
|
||||||
},
|
status: 'exception',
|
||||||
{
|
percentage: 20
|
||||||
name: '2号测试终端',
|
},
|
||||||
status: 'warning',
|
{
|
||||||
percentage: 50
|
name: '2号测试终端',
|
||||||
},
|
status: 'warning',
|
||||||
{
|
percentage: 50
|
||||||
name: '3号测试终端',
|
},
|
||||||
status: 'success',
|
{
|
||||||
percentage: 90
|
name: '3号测试终端',
|
||||||
}
|
status: 'success',
|
||||||
])
|
percentage: 90
|
||||||
const programoption: any = ref([])
|
}
|
||||||
const logtableData: any = ref([])
|
])
|
||||||
const tableRef = ref()
|
const programoption: any = ref([])
|
||||||
const status = ref('')
|
const logtableData: any = ref([])
|
||||||
const tableStore = new TableStore({
|
const tableRef = ref()
|
||||||
url: '/device-boot/version/getTerminalVersionList',
|
const status = ref('')
|
||||||
method: 'POST',
|
const tableStore = new TableStore({
|
||||||
column: [],
|
url: '/device-boot/version/getTerminalVersionList',
|
||||||
loadCallback: () => {
|
method: 'POST',
|
||||||
// tableStore.table.data.forEach((item: any) => {
|
column: [],
|
||||||
// if (item.children.length > 0) {
|
loadCallback: () => {
|
||||||
// item.id = item.children[0].pid
|
// tableStore.table.data.forEach((item: any) => {
|
||||||
// }
|
// if (item.children.length > 0) {
|
||||||
// })
|
// item.id = item.children[0].pid
|
||||||
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
// }
|
||||||
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
// })
|
||||||
setTimeout(() => {
|
treeData.value = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||||
tableRef.value.setAllTreeExpand(true)
|
treeDataCopy.value = JSON.parse(JSON.stringify(treeData.value))
|
||||||
}, 0)
|
setTimeout(() => {
|
||||||
}
|
tableRef.value.setAllTreeExpand(true)
|
||||||
})
|
}, 0)
|
||||||
tableStore.table.params.teriminal = ''
|
}
|
||||||
tableStore.table.params.state = ''
|
})
|
||||||
tableStore.table.params.program = ''
|
tableStore.table.params.teriminal = ''
|
||||||
tableStore.table.params.searchEvent = ''
|
tableStore.table.params.teriminalstatus = ''
|
||||||
tableStore.table.params.filterName = ''
|
tableStore.table.params.state = ''
|
||||||
provide('tableStore', tableStore)
|
tableStore.table.params.program = ''
|
||||||
|
tableStore.table.params.searchEvent = ''
|
||||||
const tree2List = (list: any, id: any) => {
|
tableStore.table.params.filterName = ''
|
||||||
//存储结果的数组
|
provide('tableStore', tableStore)
|
||||||
let arr: any = []
|
|
||||||
// 遍历 tree 数组
|
const tree2List = (list: any, id: any) => {
|
||||||
list.forEach((item: any) => {
|
//存储结果的数组
|
||||||
item.uPid = id
|
let arr: any = []
|
||||||
item.uId = Math.random() * 1000
|
// 遍历 tree 数组
|
||||||
|
list.forEach((item: any) => {
|
||||||
// 判断item是否存在children
|
item.uPid = id
|
||||||
if (!item.children) return arr.push(item)
|
item.uId = Math.random() * 1000
|
||||||
// 函数递归,对children数组进行tree2List的转换
|
|
||||||
const children = tree2List(item.children, item.uId)
|
// 判断item是否存在children
|
||||||
// 删除item的children属性
|
if (!item.children) return arr.push(item)
|
||||||
delete item.children
|
// 函数递归,对children数组进行tree2List的转换
|
||||||
// 把item和children数组添加至结果数组
|
const children = tree2List(item.children, item.uId)
|
||||||
//..children: 意思是把children数组展开
|
// 删除item的children属性
|
||||||
arr.push(item, ...children)
|
delete item.children
|
||||||
})
|
// 把item和children数组添加至结果数组
|
||||||
// 返回结果数组
|
//..children: 意思是把children数组展开
|
||||||
return arr
|
arr.push(item, ...children)
|
||||||
}
|
})
|
||||||
|
// 返回结果数组
|
||||||
tableStore.table.params.searchValue = ''
|
return arr
|
||||||
tableStore.table.params.searchState = 0
|
}
|
||||||
onMounted(() => {
|
|
||||||
getDevTypeList().then(res => {
|
tableStore.table.params.searchValue = ''
|
||||||
teriminaloption.value = res.data
|
tableStore.table.params.searchState = 0
|
||||||
})
|
onMounted(() => {
|
||||||
tableStore.index()
|
getDevTypeList().then(res => {
|
||||||
})
|
teriminaloption.value = res.data
|
||||||
const add = () => {}
|
})
|
||||||
const updateprogram = (row: any) => {
|
tableStore.index()
|
||||||
protitle.value = row.name
|
})
|
||||||
prodialogVisible.value = true
|
const add = () => {}
|
||||||
}
|
const updateprogram = (row: any) => {
|
||||||
const queryview = (row: any) => {
|
protitle.value = row.name
|
||||||
dialogVisible.value = true
|
prodialogVisible.value = true
|
||||||
protitle.value = row.name
|
}
|
||||||
let data = {
|
const queryview = (row: any) => {
|
||||||
id: row.id
|
dialogVisible.value = true
|
||||||
}
|
protitle.value = row.name
|
||||||
getTerminalUpLog(data).then((res: any) => {
|
let data = {
|
||||||
logtableData.value = res.data
|
id: row.id
|
||||||
})
|
}
|
||||||
}
|
getTerminalUpLog(data).then((res: any) => {
|
||||||
const format = (percentage: any) => {
|
logtableData.value = res.data
|
||||||
if (percentage <= 100 && percentage >= 90) {
|
})
|
||||||
status.value = 'success'
|
}
|
||||||
return percentage === 100 ? '升级成功' : `${percentage}%`
|
const format = (percentage: any) => {
|
||||||
} else if (percentage > 0 && percentage < 50) {
|
if (percentage <= 100 && percentage >= 90) {
|
||||||
status.value = 'exception'
|
status.value = 'success'
|
||||||
return percentage <= 20 ? '升级失败' + percentage + '%' : `${percentage}%`
|
return percentage === 100 ? '升级成功' : `${percentage}%`
|
||||||
} else if (percentage > 0 && percentage <= 50) {
|
} else if (percentage > 0 && percentage < 50) {
|
||||||
status.value = 'warning'
|
status.value = 'exception'
|
||||||
return percentage <= 50 ? '升级中断' : `${percentage}%`
|
return percentage <= 20 ? '升级失败' + percentage + '%' : `${percentage}%`
|
||||||
}
|
} else if (percentage > 0 && percentage <= 50) {
|
||||||
}
|
status.value = 'warning'
|
||||||
const formFilter = (row: any) => {
|
return percentage <= 50 ? '升级中断' : `${percentage}%`
|
||||||
let title = '/'
|
}
|
||||||
if (row.cellValue != null) {
|
}
|
||||||
teriminaloption.value.forEach((item: any) => {
|
const formFilter = (row: any) => {
|
||||||
if (item.id == row.cellValue) {
|
let title = '/'
|
||||||
title = item.name
|
if (row.cellValue != null) {
|
||||||
}
|
teriminaloption.value.forEach((item: any) => {
|
||||||
})
|
if (item.id == row.cellValue) {
|
||||||
}
|
title = item.name
|
||||||
|
}
|
||||||
return title
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格过滤
|
return title
|
||||||
const searchEvent = debounce(e => {
|
}
|
||||||
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
|
||||||
if (filterVal) {
|
// 表格过滤
|
||||||
const options = { children: 'children' }
|
const searchEvent = debounce(e => {
|
||||||
const searchProps = ['name']
|
const filterVal = XEUtils.toValueString(tableStore.table.params.filterName).trim().toLowerCase()
|
||||||
const rest = XEUtils.searchTree(
|
if (filterVal) {
|
||||||
treeDataCopy,
|
const options = { children: 'children' }
|
||||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
const searchProps = ['name']
|
||||||
options
|
const rest = XEUtils.searchTree(
|
||||||
)
|
treeDataCopy,
|
||||||
|
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||||
treeData.value = rest
|
options
|
||||||
|
)
|
||||||
// 搜索之后默认展开所有子节点
|
|
||||||
} else {
|
treeData.value = rest
|
||||||
treeData.value = treeDataCopy
|
|
||||||
}
|
// 搜索之后默认展开所有子节点
|
||||||
nextTick(() => {
|
} else {
|
||||||
const $table = tableRef.value
|
treeData.value = treeDataCopy
|
||||||
if ($table) {
|
}
|
||||||
$table.setAllTreeExpand(true)
|
nextTick(() => {
|
||||||
}
|
const $table = tableRef.value
|
||||||
})
|
if ($table) {
|
||||||
}, 300)
|
$table.setAllTreeExpand(true)
|
||||||
</script>
|
}
|
||||||
|
})
|
||||||
|
}, 300)
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const dialogVisible = ref(false)
|
|||||||
const tableData = ref([])
|
const tableData = ref([])
|
||||||
|
|
||||||
const open = (e: any) => {
|
const open = (e: any) => {
|
||||||
console.log("🚀 ~ open ~ e:", e)
|
//console.log("🚀 ~ open ~ e:", e)
|
||||||
echartsXq.value = {
|
echartsXq.value = {
|
||||||
title: {
|
title: {
|
||||||
text: e.name + '性能详情'
|
text: e.name + '性能详情'
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
:checkbox-config="{ labelField: 'name' }"
|
:checkbox-config="{ labelField: 'name' }"
|
||||||
>
|
>
|
||||||
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
<vxe-column field="name" align="left" title="电网拓扑" min-width="200" tree-node></vxe-column>
|
||||||
<vxe-column field="ip" title="网络参数"></vxe-column>
|
<vxe-column field="ip" title="网络参数" width="120px"></vxe-column>
|
||||||
<vxe-column field="runFlag" title="终端状态" v-if="key == 0">
|
<vxe-column field="runFlag" title="终端状态" v-if="key == 0">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.runFlag === 0" type="success" size="small">投运</el-tag>
|
<el-tag v-if="row.runFlag === 0" type="success" size="small">投运</el-tag>
|
||||||
|
|||||||