Compare commits
126 Commits
25971e5239
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e4db9d4cd | ||
|
|
67e2fa57d0 | ||
|
|
ad1fc11e61 | ||
|
|
6824864db2 | ||
|
|
37ed693cea | ||
|
|
0419af8e50 | ||
|
|
5268b93dd0 | ||
|
|
4e6bd55089 | ||
|
|
4e0db29ab1 | ||
|
|
9b0fd76f48 | ||
|
|
f92b07c555 | ||
|
|
a77db278ac | ||
|
|
51a0ae49a9 | ||
|
|
814e9917d6 | ||
|
|
21f1c41196 | ||
|
|
c188446e76 | ||
|
|
e2a5d084a5 | ||
|
|
4ae27a9d6d | ||
|
|
7783569f91 | ||
|
|
f1ac67070f | ||
|
|
77a9a2adfc | ||
|
|
accc1f30f6 | ||
|
|
94649b3348 | ||
|
|
e3de350dc5 | ||
|
|
4963dd495a | ||
|
|
40fa6eba20 | ||
|
|
f32934e0e6 | ||
|
|
460962cead | ||
|
|
fa75fc2923 | ||
|
|
f953b560c7 | ||
|
|
8f3426eb1f | ||
|
|
c2a2a4afd6 | ||
|
|
d2357d4ad2 | ||
|
|
1b23355134 | ||
|
|
ce9caa8729 | ||
|
|
2d0349c1b6 | ||
|
|
8355fc6aed | ||
|
|
23bc2d8f05 | ||
|
|
43caddffa3 | ||
|
|
3accaf3079 | ||
|
|
5687367602 | ||
|
|
b8ee530557 | ||
|
|
0518127792 | ||
|
|
5db43cd4b1 | ||
|
|
bf0657cbbc | ||
|
|
bcb1535d4d | ||
|
|
aa07112605 | ||
|
|
c09bea9e04 | ||
|
|
22cd6088a3 | ||
|
|
faf7ba98a6 | ||
|
|
b90f70c72d | ||
|
|
d38b426527 | ||
|
|
79a246cd87 | ||
|
|
58ee36c6a5 | ||
|
|
515dcfe76c | ||
|
|
031fab286b | ||
|
|
58bc269940 | ||
|
|
80182cdc6f | ||
|
|
8ce2968bee | ||
|
|
1a146afcd7 | ||
|
|
800ec7f0cf | ||
|
|
e824f4823a | ||
|
|
2476d2401e | ||
|
|
f043b6dc1a | ||
|
|
09bf34700a | ||
|
|
f32673c92a | ||
|
|
2c7b5a8583 | ||
|
|
3745d91a9d | ||
|
|
9117a6e3c6 | ||
|
|
e759f443d3 | ||
|
|
af3f9fe607 | ||
|
|
d97e97f51c | ||
|
|
5e1a628d53 | ||
|
|
acc5e93731 | ||
|
|
93586255fc | ||
|
|
cf51ba9ff0 | ||
|
|
67d9aaf958 | ||
|
|
f1439e0464 | ||
|
|
29c88b56dc | ||
|
|
0c71b2ac32 | ||
|
|
f916721b6a | ||
|
|
f2d02ff7f5 | ||
|
|
2de28c0067 | ||
|
|
09326b287e | ||
|
|
d365932648 | ||
|
|
925c9c6f15 | ||
|
|
b0df1157ad | ||
|
|
d450383cfd | ||
|
|
e603ba9f8c | ||
|
|
704f735744 | ||
|
|
0249ccac48 | ||
|
|
e49e34df6d | ||
|
|
042798c6a7 | ||
|
|
3827490cd1 | ||
|
|
da7cb2cb90 | ||
|
|
36e182a99a | ||
|
|
05e0287407 | ||
|
|
7a68a4114b | ||
|
|
ddc8f81196 | ||
|
|
5bed340320 | ||
|
|
2048da5e52 | ||
|
|
4184d35854 | ||
|
|
59b56d4a19 | ||
|
|
0a6bd2e453 | ||
|
|
60e9685b7e | ||
|
|
d8433d8d9c | ||
|
|
0f090666e9 | ||
|
|
1d849bcff9 | ||
|
|
e9b09e2193 | ||
|
|
f66dd649c7 | ||
|
|
af05b9c810 | ||
|
|
0af955d05c | ||
|
|
49dcf440ff | ||
|
|
d6bfd8b958 | ||
|
|
ea6aed9b99 | ||
|
|
cd565c03ca | ||
|
|
f82ef923ae | ||
|
|
4c2ed4aade | ||
|
|
8cd3e14922 | ||
|
|
5580d0618e | ||
|
|
c1ebcfed6f | ||
|
|
6303bd1e2c | ||
|
|
d9efb37083 | ||
|
|
e271a3be06 | ||
|
|
078488a842 | ||
|
|
384ea90acd |
@@ -6,8 +6,10 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev:zl": "vite --mode zl",
|
||||
"dev:ypt": "vite --mode ypt",
|
||||
"build": "vite build",
|
||||
"build:zl": "vite build --mode zl",
|
||||
"build:ypt": "vite build --mode ypt",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
28
src/api/cs-device-boot/sensitiveLoadMange.ts
Normal file
28
src/api/cs-device-boot/sensitiveLoadMange.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 新增敏感用户
|
||||
export function saveUser(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/save',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改敏感用户
|
||||
export function updateUser(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除敏感用户
|
||||
export function deleteUser(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/delete',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -53,3 +53,25 @@ export const removeMarketData = (data: any) => {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户未绑定的在运的便携式设备
|
||||
*/
|
||||
export const queryRunPortableDevByUseId = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/EquipmentDelivery/getRunPortableDev',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户未绑定的工程信息
|
||||
*/
|
||||
export const queryUnlinkEngineeringByUseId = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-device-boot/engineering/getUnlinkedEngineering',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
@@ -20,3 +20,12 @@ export function getFileZip(params: any) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function exportModel(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/exportmodel/exportModel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -25,3 +25,12 @@ export function offlineDataUploadMakeUp(data: any) {
|
||||
data
|
||||
})
|
||||
}
|
||||
//设备补召操作
|
||||
// 根据id集合获取敏感负荷用户列表
|
||||
export function getListByIds() {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/getListByIds',
|
||||
method: 'POST',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
29
src/api/cs-system-boot/official.ts
Normal file
29
src/api/cs-system-boot/official.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// * 根据用户id查询工程和便携式设备
|
||||
export const queryDevByUseId = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-system-boot/wlUser/selectDevByUserId',
|
||||
method: 'POST',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// * 用户绑定工程和便携式设备
|
||||
export const add = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-system-boot/wlUser/addUserDev',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 用户取消绑定工程和便携式设备
|
||||
*/
|
||||
export const removeUserDev = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/cs-system-boot/wlUser/deleteUserDev',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -1,10 +1,273 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 主要监测点列表查询
|
||||
// 主要监测点列表查询>>分页
|
||||
export function mainLineList(data: any) {
|
||||
return request({
|
||||
url: '/harmonic-boot/mainLine/list',
|
||||
url: '/cs-harmonic-boot/mainLine/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 主要监测点指标越限详情
|
||||
export function statLimitRateDetails(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/mainLine/statLimitRateDetails',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询监测点列表=全部>>不分页
|
||||
export function cslineList(data: any) {
|
||||
return request({
|
||||
url: '/cs-device-boot/csline/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 监测点详情 趋势图数据
|
||||
export function trendData(data: any) {
|
||||
return request({
|
||||
url: '/cs-device-boot/csGroup/trendData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 每日越限占比统计
|
||||
export function totalLimitStatisticsDetails(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/totalLimitStatistics/details',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 总体指标越限统计列表
|
||||
export function totalLimitStatisticsList(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/totalLimitStatistics/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 总体指标越限统计数据
|
||||
export function totalLimitStatisticsData(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/totalLimitStatistics/data',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 指标越限程度数据
|
||||
export function limitExtentData(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitExtentData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 指标日趋势图数据
|
||||
export function limitExtentDayData(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitExtentDayData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 指标越限明细日历数据
|
||||
export function limitCalendarData(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitCalendarData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//指标拟合图数据
|
||||
export function fittingData(data: any) {
|
||||
return request({
|
||||
url: '/cs-device-boot/csGroup/fittingData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//指标越限时间概率分布
|
||||
export function limitTimeProbabilityData(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitTimeProbabilityData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//指标越限程度概率分布
|
||||
export function limitProbabilityData(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitProbabilityData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 电网侧指标越限统计列表
|
||||
export function gridSideLimitStatisticsList(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/gridSideLimitStatistics/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 电网侧指标越限统计数据
|
||||
export function gridSideLimitStatisticsData(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/gridSideLimitStatistics/data',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 敏感负荷用户监测点列表
|
||||
export function governLineList(data: any) {
|
||||
return request({
|
||||
url: '/cs-device-boot/csline/getSensitiveUserLineList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id集合获取敏感负荷用户列表
|
||||
export function getListByIds(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/getListByIds',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 上传治理报告
|
||||
export function uploadReport(data: any) {
|
||||
return request({
|
||||
url: '/cs-device-boot/csline/uploadReport',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取治理报告链接
|
||||
export function getReportUrl(data: any) {
|
||||
return request({
|
||||
url: '/cs-device-boot/csline/getReportUrl',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询监测对象电网侧和负载侧监测点指标趋势对比数据
|
||||
export function sensitiveUserTrendData(data: any) {
|
||||
return request({
|
||||
url: '/cs-device-boot/csGroup/sensitiveUserTrendData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取敏感负荷用户列表
|
||||
export function getList(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/getList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// F47曲线
|
||||
export function f47Curve(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/csevent/f47Curve',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取电压暂态表及密度坐标图
|
||||
export function getEventCoords(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/csevent/getEventCoords',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 日历暂降事件详情
|
||||
export function getEventDate(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/csevent/getEventDate',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 暂降类型分类统计Echart
|
||||
export function netEventEcharts(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/csevent/netEventEcharts',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 暂降类型分类统计表格
|
||||
export function netEventTable(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/csevent/netEventTable',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 分页查询暂降事件
|
||||
export function pageEvent(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/event/pageEvent',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 暂态事件波形分析
|
||||
export function analyseWave(data: any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/event/analyseWave',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 暂态监测点下拉框接口
|
||||
export function getSimpleLine() {
|
||||
return request({
|
||||
url: '/cs-device-boot/csline/getSimpleLine',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getLineExport(data:any) {
|
||||
return request({
|
||||
url: '/cs-harmonic-boot/eventReport/getLineExport',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,14 +3,15 @@ import createAxios from '@/utils/request'
|
||||
// 获取参数指标
|
||||
export function getIndex() {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/reportChooseTree',
|
||||
// url: '/harmonic-boot/customReport/reportChooseTree',
|
||||
url: '/cs-harmonic-boot/customReport/reportChooseTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//、查询数据激活报表模板
|
||||
export function updateTemplateActive(data) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/updateTemplateActive',
|
||||
url: '/cs-harmonic-boot/customReport/updateTemplateActive',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -19,7 +20,8 @@ export function updateTemplateActive(data) {
|
||||
//获取报表模板 //部门树查询
|
||||
export function getTemplateList(data:any) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/getTemplateList',
|
||||
// url: '/harmonic-boot/customReport/getTemplateList',
|
||||
url: '/cs-harmonic-boot/customReport/getTemplateList',
|
||||
// url:'/api3/harmonic-boot/customReport/getTemplateList',
|
||||
method: 'post',
|
||||
data
|
||||
@@ -28,7 +30,7 @@ export function getTemplateList(data:any) {
|
||||
//删除报表模板
|
||||
export function delTemplate(data:any) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/delTemplate',
|
||||
url: '/cs-harmonic-boot/customReport/delTemplate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -37,7 +39,7 @@ export function delTemplate(data:any) {
|
||||
//修改获取数据
|
||||
export function getCustomReportTemplateById(params) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/getCustomReportTemplateById',
|
||||
url: '/cs-harmonic-boot/customReport/getCustomReportTemplateById',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
@@ -46,7 +48,7 @@ export function getCustomReportTemplateById(params) {
|
||||
//修改获取数据
|
||||
export function viewCustomReportTemplateById(params) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/viewCustomReportTemplateById',
|
||||
url: '/cs-harmonic-boot/customReport/viewCustomReportTemplateById',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
@@ -54,16 +56,17 @@ export function viewCustomReportTemplateById(params) {
|
||||
//修改模板
|
||||
export function dateTemplateup(data) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/updateTemplate',
|
||||
url: '/cs-harmonic-boot/customReport/updateTemplate',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//新增报表模板
|
||||
export function addTemplate(data) {
|
||||
export function addTemplate(data:any) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/addTemplate',
|
||||
// url: '/harmonic-boot/customReport/addTemplate',
|
||||
url: '/cs-harmonic-boot/customReport/addTemplate',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -71,7 +74,7 @@ export function addTemplate(data) {
|
||||
//模板对应指标替换
|
||||
export function getCustomReport(data: any) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/getCustomReport',
|
||||
url: '/cs-harmonic-boot/customReport/getCustomReport',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
@@ -79,7 +82,7 @@ export function getCustomReport(data: any) {
|
||||
//绑定模板
|
||||
export function updateBindTemplate(data) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/updateBindTemplate',
|
||||
url: '/cs-harmonic-boot/customReport/updateBindTemplate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -87,7 +90,7 @@ export function updateBindTemplate(data) {
|
||||
//根据模板ID查询数据
|
||||
export function getDataByTempId(params) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/getDataByTempId',
|
||||
url: '/cs-harmonic-boot/customReport/getDataByTempId',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
@@ -95,7 +98,7 @@ export function getDataByTempId(params) {
|
||||
//根据部门查询模板
|
||||
export function getTemplateByDept(params) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/getTemplateByDept',
|
||||
url: '/cs-harmonic-boot/customReport/getTemplateByDept',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
@@ -144,7 +147,7 @@ export function updateFile(data) {
|
||||
//合格率报告
|
||||
export function pageTable(data) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/qualifiedReport/pageTable',
|
||||
url: '/cs-harmonic-boot/qualifiedReport/pageTable',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -152,14 +155,16 @@ export function pageTable(data) {
|
||||
//合格率报告
|
||||
export function targetLimitChooseTree() {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/targetLimitChooseTree',
|
||||
// url: '/harmonic-boot/customReport/targetLimitChooseTree',
|
||||
url: '/cs-harmonic-boot/customReport/targetLimitChooseTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//监测点指标
|
||||
export function terminalChooseTree() {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/customReport/terminalChooseTree',
|
||||
// url: '/harmonic-boot/customReport/terminalChooseTree',
|
||||
url: '/cs-harmonic-boot/customReport/terminalChooseTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -116,3 +116,11 @@ export const start = (params: any) => {
|
||||
params
|
||||
})
|
||||
}
|
||||
// 查询监测对象类型
|
||||
export const getDicDataByTypeCode = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/dictData/getDicDataByTypeCode',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -88,8 +88,9 @@ export const updateStatistical = (data: any) => {
|
||||
// 单位绑定
|
||||
export function codeDicTree(data: any) {
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree/codeDicTree',
|
||||
method: 'get',
|
||||
// url: '/system-boot/dictTree/codeDicTree',
|
||||
url: '/system-boot/dictTree/queryByCodeList',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
11
src/api/user-boot/official.ts
Normal file
11
src/api/user-boot/official.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from '@/utils/request'
|
||||
/**
|
||||
* 获取移动端、便携式正式用户列表
|
||||
* @returns {AxiosPromise}
|
||||
*/
|
||||
export const getFormalUserList = () => {
|
||||
return request({
|
||||
url: '/user-boot/user/getFormalUserList',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
BIN
src/assets/img/jss.png
Normal file
BIN
src/assets/img/jss.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 124 KiB |
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--F47曲线 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<TableHeader ref="TableHeaderRef" :showReset="false" :timeKeyList="prop.timeKey" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<el-descriptions class="mt2" direction="vertical" :column="4" border>
|
||||
<el-descriptions-item align="center" label="名称">{{ data.name }}</el-descriptions-item>
|
||||
<el-descriptions-item align="center" label="事件总数">{{ data.gs }}</el-descriptions-item>
|
||||
@@ -9,15 +9,23 @@
|
||||
<el-descriptions-item align="center" label="不可容忍">{{ data.bkrr }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<my-echart
|
||||
v-loading="tableStore.table.loading"
|
||||
ref="chartRef"
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} - 80px - ${headerHeight}px + ${fullscreen ? 0 : 56}px)` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} - 80px - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
||||
}"
|
||||
@chart-click="handleChartClick"
|
||||
/>
|
||||
<el-dialog v-model="isWaveCharts" draggable title="瞬时/RMS波形" append-to-body width="70%">
|
||||
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false" :wp="wp" />
|
||||
<el-dialog v-model="isWaveCharts" v-if="isWaveCharts" draggable :title="dialogTitle" append-to-body width="70%">
|
||||
<waveFormAnalysis
|
||||
v-loading="loading"
|
||||
ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false"
|
||||
:wp="wp"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -25,35 +33,34 @@
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue';
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const dialogTitle = ref('波形分析')
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +76,7 @@ const fullscreen = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const echartList = ref({})
|
||||
const echartList = ref()
|
||||
|
||||
const chartRef = ref()
|
||||
// 波形
|
||||
@@ -79,7 +86,10 @@ const loading = ref(false)
|
||||
|
||||
const wp = ref({})
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const boxoList: any = ref({})
|
||||
|
||||
const waveFormAnalysisRef: any = ref(null)
|
||||
|
||||
const data = reactive({
|
||||
name: '事件个数',
|
||||
gs: 0,
|
||||
@@ -87,46 +97,25 @@ const data = reactive({
|
||||
bkrr: 0
|
||||
})
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/csevent/f47Curve',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
let res = {
|
||||
data: { totalNumberOfEvents: 0, voltageToleranceCurveDataList: [] }
|
||||
}
|
||||
|
||||
const gongData = gongfunction(res.data.voltageToleranceCurveDataList)
|
||||
data.gs = res.data.voltageToleranceCurveDataList.length
|
||||
const gongData = gongfunction(tableStore.table.data)
|
||||
data.gs = tableStore.table.data.length
|
||||
data.krr = gongData.pointI.length
|
||||
data.bkrr = gongData.pointIun.length
|
||||
console.log(gongData)
|
||||
echartList.value = {
|
||||
// backgroundColor: "#f9f9f9", //地图背景色深蓝
|
||||
title: {
|
||||
text: `F47曲线`
|
||||
},
|
||||
legend: {
|
||||
// data: ['上限', '下限', '可容忍事件', '不可容忍事件'],
|
||||
data: ['可容忍事件', '不可容忍事件'],
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
@@ -208,11 +197,11 @@ const tableStore: any = new TableStore({
|
||||
type: 'scatter',
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
// data: gongData.pointF,
|
||||
data: [
|
||||
[0.2, 10, '2023-01-01 10:00:00'],
|
||||
[0.4, 50, '2023-01-01 11:00:00']
|
||||
],
|
||||
data: gongData.pointF,
|
||||
// data: [
|
||||
// [0.2, 10, '2023-01-01 10:00:00'],
|
||||
// [0.4, 50, '2023-01-01 11:00:00']
|
||||
// ],
|
||||
legendSymbol: 'circle',
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
@@ -237,7 +226,7 @@ const tableStore: any = new TableStore({
|
||||
{
|
||||
name: '不可容忍事件',
|
||||
type: 'scatter',
|
||||
symbol: 'rect',
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
data: gongData.pointFun,
|
||||
legendSymbol: 'rect'
|
||||
@@ -252,6 +241,25 @@ const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
function gongfunction(arr: any) {
|
||||
let standI = 0
|
||||
let unstandI = 0
|
||||
@@ -271,8 +279,9 @@ function gongfunction(arr: any) {
|
||||
let yy = arr[i].eventValue
|
||||
let time = arr[i].time
|
||||
let eventId = arr[i].eventId
|
||||
let lineName = arr[i].lineName
|
||||
// let index =arr[i].eventDetailIndex;
|
||||
point = [xx, yy, time, eventId]
|
||||
point = [xx, yy, time, eventId, lineName]
|
||||
|
||||
if (xx <= 0.003) {
|
||||
let line = 0
|
||||
@@ -419,22 +428,55 @@ onMounted(() => {
|
||||
|
||||
// 点击事件处理函数
|
||||
const handleChartClick = (params: any) => {
|
||||
|
||||
if (params.seriesName === '可容忍事件') {
|
||||
// 处理可容忍事件点击
|
||||
ElMessage.info(`点击了可容忍事件: 持续时间${params.value[0]}s, 幅值${params.value[1].toFixed(2)}%`)
|
||||
dialogTitle.value = '可容忍事件波形分析'
|
||||
handleTolerableEventClick(params)
|
||||
} else if (params.seriesName === '不可容忍事件') {
|
||||
dialogTitle.value = '不可容忍事件波形分析'
|
||||
// 处理不可容忍事件点击
|
||||
ElMessage.info(`点击了不可容忍事件: 持续时间${params.value[0]}s, 幅值${params.value[1].toFixed(2)}%`)
|
||||
handleIntolerableEventClick(params)
|
||||
// ElMessage.info(`点击了不可容忍事件: 持续时间${params.value[0]}s, 幅值${params.value[1].toFixed(2)}%`)
|
||||
handleTolerableEventClick(params)
|
||||
}
|
||||
}
|
||||
|
||||
// 可容忍事件点击处理函数
|
||||
const handleTolerableEventClick = (params: any) => {
|
||||
console.log('可容忍事件详情:', params)
|
||||
const handleTolerableEventClick = async (row: any) => {
|
||||
loading.value = true
|
||||
nextTick(() => {
|
||||
if (waveFormAnalysisRef.value) {
|
||||
//waveFormAnalysisRef.value.setHeight(false, 360)
|
||||
// waveFormAnalysisRef.value.setHeight(999, 130, 1.6666666)
|
||||
}
|
||||
})
|
||||
const messageInstance = ElMessage.info(`正在加载,请稍等...`)
|
||||
await analyseWave(row.value[3]) //eventId
|
||||
.then(res => {
|
||||
row.loading1 = false
|
||||
if (res != undefined) {
|
||||
boxoList.value = {
|
||||
persistTime: row.value[0], //持续时间
|
||||
featureAmplitude: (row.value[1] / 100).toFixed(2), //残余电压
|
||||
startTime: row.value[2], //时间
|
||||
lineName: row.value[4] //监测点名称
|
||||
}
|
||||
boxoList.value.systemType = 'YPT'
|
||||
wp.value = res.data
|
||||
}
|
||||
|
||||
isWaveCharts.value = true
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
messageInstance.close()
|
||||
row.loading1 = false
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
nextTick(() => {
|
||||
waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(999, 130, 1.6666666)
|
||||
waveFormAnalysisRef.value && waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
|
||||
})
|
||||
}
|
||||
|
||||
// 不可容忍事件点击处理函数
|
||||
@@ -449,12 +491,17 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
// 当外部时间值变化时,更新表格的时间参数
|
||||
if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) {
|
||||
tableStore.table.params.searchBeginTime = newVal[0]
|
||||
tableStore.table.params.searchEndTime = newVal[1]
|
||||
tableStore.index()
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,44 +1,50 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂降方向统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart class="tall" :options="echartList" :style="{ width: prop.width, height: `calc(${prop.height} )` }" />
|
||||
<TableHeader
|
||||
ref="TableHeaderRef"
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
:timeKeyList="prop.timeKey"
|
||||
v-if="fullscreen"
|
||||
></TableHeader>
|
||||
<my-echart
|
||||
v-loading="tableStore.table.loading"
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} )` }"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,17 +60,42 @@ const fullscreen = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: '来自电网',
|
||||
value: 4
|
||||
const echartList = ref({})
|
||||
|
||||
// const data = [
|
||||
// {
|
||||
// name: '来自电网',
|
||||
// value: 4
|
||||
// },
|
||||
// {
|
||||
// name: '来自负荷',
|
||||
// value: 41
|
||||
// }
|
||||
// ]
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-harmonic-boot/csevent/getEventDirectionData',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
setTime()
|
||||
},
|
||||
{
|
||||
name: '来自负荷',
|
||||
value: 41
|
||||
loadCallback: () => {
|
||||
if (!tableStore.table.data || !Array.isArray(tableStore.table.data)) {
|
||||
return []
|
||||
}
|
||||
]
|
||||
const echartList = ref({
|
||||
const chartData = ref(
|
||||
tableStore.table.data.map((item: any) => ({
|
||||
name: item.source === 'load' ? '来自负荷' : '来自电网',
|
||||
value: item.times
|
||||
}))
|
||||
)
|
||||
|
||||
const total = chartData.value.reduce((sum: any, item: any) => sum + item.value, 0)
|
||||
|
||||
echartList.value = {
|
||||
title: {},
|
||||
|
||||
tooltip: {
|
||||
@@ -72,10 +103,11 @@ const echartList = ref({
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
top: 'center',
|
||||
right: '5%',
|
||||
formatter: function (e: any) {
|
||||
return e + ' ' + data.filter(item => item.name == e)[0].value + '次'
|
||||
top: '50',
|
||||
right: '10',
|
||||
formatter: function (name: string) {
|
||||
const item = chartData.value.find((i: any) => i.name === name)
|
||||
return item ? `${name} ${item.value}次` : name
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
@@ -97,7 +129,7 @@ const echartList = ref({
|
||||
left: 'center'
|
||||
},
|
||||
{
|
||||
text: data[0].value + data[1].value + '次',
|
||||
text: total + '次',
|
||||
left: 'center',
|
||||
top: 'center'
|
||||
}
|
||||
@@ -115,37 +147,12 @@ const echartList = ref({
|
||||
}
|
||||
},
|
||||
name: '事件统计',
|
||||
data: data
|
||||
data: chartData.value
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
@@ -153,10 +160,28 @@ provide('tableRef', tableRef)
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name') {
|
||||
console.log(row)
|
||||
OverLimitDetailsRef.value.open(row)
|
||||
}
|
||||
}
|
||||
@@ -171,12 +196,12 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<!-- 指标日趋势图 -->
|
||||
<el-dialog draggable title="指标日趋势图" v-model="dialogVisible" append-to-body width="70%">
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
style="width: 98%; height: 320px"
|
||||
/>
|
||||
<el-dialog draggable :title="dialogTitle" v-model="dialogVisible" append-to-body width="70%">
|
||||
<div :style="pageHeight">
|
||||
<my-echart class="tall" :options="echartList" style="width: 100%" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -13,77 +11,134 @@
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { limitExtentDayData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { yMethod } from '@/utils/echartMethod'
|
||||
const prop = defineProps({
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const pageHeight = mainHeight(0, 2)
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
|
||||
const dialogTitle = ref('')
|
||||
|
||||
const config = useConfig()
|
||||
|
||||
const echartList = ref({
|
||||
const dialogText = ref('')
|
||||
|
||||
const echartList = ref()
|
||||
|
||||
const init = () => {
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: '指标日趋势图',
|
||||
text: dialogText.value
|
||||
},
|
||||
legend: {
|
||||
itemWidth: 20,
|
||||
itemHeight: 20,
|
||||
itemStyle: { opacity: 0 }, //去圆点
|
||||
right: 70
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: (params: any) => {
|
||||
if (!params || params.length === 0) return ''
|
||||
|
||||
// 使用第一个项目的轴标签作为时间标题
|
||||
let tooltipText = params[0].axisValueLabel + '<br/>'
|
||||
|
||||
// 遍历所有项目并累加到tooltipText中
|
||||
params.forEach((item: any) => {
|
||||
// 将数值格式化为保留两位小数
|
||||
const formattedValue = Math.round(item.value[1] * 100) / 100
|
||||
tooltipText += `${item.marker} ${item.seriesName}: ${formattedValue}<br/>`
|
||||
})
|
||||
|
||||
return tooltipText
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [
|
||||
'00:00', '01:00', '02:00', '03:00', '04:00', '05:00',
|
||||
'06:00', '07:00', '08:00', '09:00', '10:00', '11:00',
|
||||
'12:00', '13:00', '14:00', '15:00', '16:00', '17:00',
|
||||
'18:00', '19:00', '20:00', '21:00', '22:00', '23:00'
|
||||
],
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
interval: 1
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '数值'
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px',
|
||||
containLabel: true
|
||||
},
|
||||
|
||||
yAxis: {},
|
||||
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
name: '指标值',
|
||||
series: []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const initData = async (row: any) => {
|
||||
limitExtentDayData({ code: row.code, lineId: row.lineId, time: row.time }).then(res => {
|
||||
if (res.data && res.data.length > 0) {
|
||||
// 重新初始化图表
|
||||
init()
|
||||
let [min, max] = yMethod(res.data.map((item: any) => item.value.split(',')).flat())
|
||||
|
||||
// 从第一条数据中提取时间作为x轴数据
|
||||
const firstItem = res.data[0]
|
||||
const xAxisData = firstItem.time.split(',')
|
||||
|
||||
// 定义相位颜色映射
|
||||
const phaseColors: any = {
|
||||
A: '#DAA520',
|
||||
B: '#2E8B57',
|
||||
C: '#A52a2a'
|
||||
}
|
||||
|
||||
// 处理每条相位数据
|
||||
const seriesData = res.data.map((item: any) => {
|
||||
const values = xAxisData.map((time: string, index: number) => {
|
||||
// 将传入的日期与时间拼接成完整的时间字符串
|
||||
const fullTime = `${row.time} ${time}`
|
||||
const value = parseFloat(item.value.split(',')[index]) || 0
|
||||
return [fullTime, value]
|
||||
})
|
||||
|
||||
return {
|
||||
name: `${item.phasic}相`,
|
||||
type: 'line',
|
||||
showSymbol: true,
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
10, 12, 15, 18, 22, 28,
|
||||
35, 45, 60, 75, 88, 95,
|
||||
100, 98, 90, 80, 70, 60,
|
||||
50, 40, 30, 25, 20, 15
|
||||
],
|
||||
data: values,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: config.layout.elementUiPrimary[0]
|
||||
}
|
||||
},
|
||||
areaStyle: {
|
||||
opacity: 0.3
|
||||
// 根据相位设置对应颜色
|
||||
color: phaseColors[item.phasic] || config.layout.elementUiPrimary[0]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
echartList.value.yAxis.max = max
|
||||
echartList.value.yAxis.min = min
|
||||
// 更新图表配置
|
||||
echartList.value.options.series = seriesData
|
||||
// 注意:使用时间轴时不需要设置 xAxis.data
|
||||
}
|
||||
})
|
||||
}
|
||||
onMounted(() => {})
|
||||
|
||||
const open = async (row: any) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = row.name + '日趋势图'
|
||||
dialogText.value = `监测点名称:${row.lineName}_越限时间:${row.time}_指标名称:${row.name}`
|
||||
nextTick(() => {
|
||||
initData(row)
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--指标越限程度 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<TableHeader
|
||||
ref="TableHeaderRef"
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
:timeKeyList="prop.timeKey"
|
||||
v-if="fullscreen"
|
||||
></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 )` }"
|
||||
/>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} / 2 - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`" isGroup></Table>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} / 2 - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`"
|
||||
isGroup
|
||||
></Table>
|
||||
<!-- 指标日趋势图 -->
|
||||
<DailyTrendChart ref="dailyTrendChartRef" />
|
||||
<DailyTrendChart v-if="dialogTrendChart" ref="dailyTrendChartRef" @close="dialogTrendChart = false" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -20,31 +32,31 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import DailyTrendChart from '@/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const dialogTrendChart = ref(false)
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
// 计算是否全屏展示
|
||||
@@ -59,49 +71,11 @@ const fullscreen = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '指标越限严重度'
|
||||
},
|
||||
const echartList = ref()
|
||||
|
||||
xAxis: {
|
||||
// name: '(区域)',
|
||||
data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
},
|
||||
|
||||
yAxis: {
|
||||
name: '%', // 给X轴加单位
|
||||
interval: 20
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: [0, 7.5, 36, 0, 80],
|
||||
barMaxWidth: 30
|
||||
|
||||
// label: {
|
||||
// show: true,
|
||||
// position: 'top',
|
||||
// textStyle: {
|
||||
// //数值样式
|
||||
// color: '#000'
|
||||
// },
|
||||
// fontSize: 12
|
||||
// }
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const dailyTrendChartRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitExtentData',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
@@ -123,95 +97,106 @@ const tableStore: any = new TableStore({
|
||||
|
||||
{
|
||||
title: '越限最大值',
|
||||
field: 'type',
|
||||
minWidth: '60',
|
||||
field: 'maxValue',
|
||||
minWidth: '70',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type}</span>`
|
||||
const extentValue =
|
||||
row.maxValue !== null && row.maxValue !== undefined && row.maxValue !== ''
|
||||
? Math.floor(row.maxValue * 100) / 100
|
||||
: '/'
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${extentValue}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '国标限值',
|
||||
field: 'type1',
|
||||
field: 'internationalValue',
|
||||
minWidth: '60'
|
||||
},
|
||||
{
|
||||
title: '越限程度(%)',
|
||||
field: 'type2',
|
||||
minWidth: '60'
|
||||
field: 'extent',
|
||||
minWidth: '70',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
// 保留两个小数
|
||||
const extentValue =
|
||||
row.extent !== null && row.extent !== undefined && row.extent !== ''
|
||||
? Math.floor(row.extent * 100) / 100
|
||||
: '/'
|
||||
return `<span>${extentValue}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '发生日期',
|
||||
field: 'type3',
|
||||
minWidth: '100'
|
||||
title: '越限时间',
|
||||
field: 'time',
|
||||
minWidth: '60',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
if (row.time !== null && row.time !== undefined && row.time !== '') {
|
||||
return `<span>${row.time}</span>`
|
||||
} else {
|
||||
return `<span>/</span>`
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '越限最高监测点',
|
||||
field: 'type4',
|
||||
minWidth: '90'
|
||||
field: 'lineName',
|
||||
minWidth: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
if (row.lineName !== null && row.lineName !== undefined && row.lineName !== '') {
|
||||
return `<span>${row.lineName}</span>`
|
||||
} else {
|
||||
return `<span>/</span>`
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '闪变',
|
||||
type: '0.0',
|
||||
type1: '2.0',
|
||||
type2: '0.0',
|
||||
type3: '/',
|
||||
type4: '/'
|
||||
// 定义 x 轴标签顺序
|
||||
const xAxisLabels = ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
|
||||
// 根据指标名称顺序提取对应的 extent 数据
|
||||
const chartData = xAxisLabels.map(label => {
|
||||
// 在表格数据中查找对应指标名称的数据项
|
||||
const item = tableStore.table.data.find((row: any) => row.name === label)
|
||||
// 如果找到对应项,则返回 extent 值,否则返回 0,并保留两位小数
|
||||
const extentValue = item ? item.extent || 0 : 0
|
||||
return Math.round(extentValue * 100) / 100
|
||||
})
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: '指标越限严重度'
|
||||
},
|
||||
{
|
||||
name: '谐波电压',
|
||||
type: '1.72',
|
||||
type1: '1.6',
|
||||
type2: '7.5',
|
||||
type3: '2025-03-09',
|
||||
type4: '10kV1#电动机'
|
||||
|
||||
xAxis: {
|
||||
data: xAxisLabels
|
||||
},
|
||||
{
|
||||
name: '谐波电流',
|
||||
type: '27.2',
|
||||
type1: '20.0',
|
||||
type2: '36.0',
|
||||
type3: '2025-03-16',
|
||||
type4: '380V电焊机(治理前)'
|
||||
|
||||
yAxis: {
|
||||
name: '%' // 给X轴加单位
|
||||
// interval: 20
|
||||
},
|
||||
{
|
||||
name: '电压偏差',
|
||||
type: '0.0',
|
||||
type1: '2.0',
|
||||
type2: '0.0',
|
||||
type3: '/',
|
||||
type4: '/'
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
name: '三相不平衡',
|
||||
type: '3.6',
|
||||
type1: '2.0',
|
||||
type2: '80.0',
|
||||
type3: '2025-03-01',
|
||||
type4: '380V电焊机(治理前)'
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: chartData,
|
||||
barMaxWidth: 30
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -222,9 +207,30 @@ provide('tableStore', tableStore)
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name') {
|
||||
console.log(row)
|
||||
dialogTrendChart.value = true
|
||||
if (column.field == 'maxValue' && row.lineId) {
|
||||
nextTick(() => {
|
||||
dailyTrendChartRef.value.open(row)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,12 +244,12 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,21 +1,16 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--治理效果报表 -->
|
||||
<TableHeader :showReset="false" datePicker @selectChange="selectChange" v-if="fullscreen">
|
||||
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" ref="TableHeaderRef" datePicker @selectChange="selectChange" v-if="fullscreen">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="治理对象">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.power"
|
||||
placeholder="请选择治理对象"
|
||||
clearable
|
||||
style="width: 130px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-form-item label="报表模板">
|
||||
<el-select filterable v-model="tableStore.table.params.tempId" placeholder="请选择报表模板" clearable>
|
||||
<el-option v-for="item in templateList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="监测对象">
|
||||
<el-select filterable v-model="tableStore.table.params.sensitiveUserId" placeholder="请选择监测对象" clearable>
|
||||
<el-option v-for="item in idList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -35,95 +30,71 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h, computed } from 'vue'
|
||||
import { ref, onMounted, provide, reactive, watch, h, computed, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { exportExcel } from '@/views/govern/reportForms/export.js'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import Json from './index.json'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { getTemplateList } from '@/api/harmonic-boot/luckyexcel'
|
||||
import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
const config = useConfig()
|
||||
const powerList: any = ref([
|
||||
{
|
||||
label: '1#变压器',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '2#变压器',
|
||||
value: '2'
|
||||
}
|
||||
])
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {}
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
tableStore.table.params.power = '1'
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
// 报表模板列表
|
||||
const templateList = ref()
|
||||
|
||||
// 监测对象
|
||||
const idList = ref()
|
||||
|
||||
// 监测对象
|
||||
const initListByIds = () => {
|
||||
getListByIds({}).then((res: any) => {
|
||||
if (res.data.length > 0) {
|
||||
idList.value = res.data
|
||||
|
||||
if (!tableStore.table.params.sensitiveUserId && idList.value?.length > 0) {
|
||||
tableStore.table.params.sensitiveUserId = idList.value[0].id
|
||||
}
|
||||
templateListData()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const templateListData = () => {
|
||||
getTemplateList({}).then(res => {
|
||||
templateList.value = res.data
|
||||
if (!tableStore.table.params.tempId && templateList.value?.length > 0) {
|
||||
tableStore.table.params.tempId = templateList.value[0].id
|
||||
}
|
||||
nextTick(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
}
|
||||
// 下载表格
|
||||
const downloadExcel = () => {
|
||||
exportExcel(luckysheet.getAllSheets(), '治理效果报表')
|
||||
}
|
||||
onMounted(() => {
|
||||
luckysheet.create({
|
||||
container: 'luckysheet',
|
||||
title: '', // 表 头名
|
||||
lang: 'zh', // 中文
|
||||
showtoolbar: false, // 是否显示工具栏
|
||||
showinfobar: false, // 是否显示顶部信息栏
|
||||
showsheetbar: true, // 是否显示底部sheet按钮
|
||||
allowEdit: false, // 禁止所有编辑操作(必填)
|
||||
data: Json
|
||||
})
|
||||
|
||||
tableStore.index()
|
||||
onMounted(() => {
|
||||
initListByIds()
|
||||
})
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +109,60 @@ const fullscreen = computed(() => {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-harmonic-boot/customReport/getSensitiveUserReport',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
exportName: '治理效果报表',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
setTime()
|
||||
if (!tableStore.table.params.sensitiveUserId && idList.value?.length > 0) {
|
||||
tableStore.table.params.sensitiveUserId = idList.value[0].id
|
||||
}
|
||||
if (!tableStore.table.params.tempId && templateList.value?.length > 0) {
|
||||
tableStore.table.params.tempId = templateList.value[0].id
|
||||
}
|
||||
},
|
||||
loadCallback: () => {
|
||||
luckysheet.create({
|
||||
container: 'luckysheet',
|
||||
title: '', // 表 头名
|
||||
lang: 'zh', // 中文
|
||||
showtoolbar: false, // 是否显示工具栏
|
||||
showinfobar: false, // 是否显示顶部信息栏
|
||||
showsheetbar: true, // 是否显示底部sheet按钮
|
||||
allowEdit: false, // 禁止所有编辑操作(必填)
|
||||
data: tableStore.table.data
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
@@ -145,19 +170,17 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-select) {
|
||||
min-width: 80px;
|
||||
}
|
||||
// :deep(.el-select) {
|
||||
// min-width: 80px;
|
||||
// }
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,708 @@
|
||||
<template>
|
||||
<el-dialog draggable title="趋势图" v-model="dialogVisible" append-to-body width="70%">
|
||||
<!-- 总体指标占比详情谐波含有率 -->
|
||||
<div>
|
||||
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
<el-form-item>
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计指标" label-width="80px">
|
||||
<el-select
|
||||
multiple
|
||||
:multiple-limit="2"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
v-model="searchForm.index"
|
||||
placeholder="请选择统计指标"
|
||||
@change="onIndexChange($event)"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indexOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.dataLevel" @change="init()">
|
||||
<el-radio-button label="一次值" value="Primary" />
|
||||
<el-radio-button label="二次值" value="Secondary" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
style="min-width: 120px !important"
|
||||
placeholder="请选择"
|
||||
v-model="searchForm.valueType"
|
||||
filterable
|
||||
>
|
||||
<el-option value="max" label="最大值"></el-option>
|
||||
<el-option value="min" label="最小值"></el-option>
|
||||
<el-option value="avg" label="平均值"></el-option>
|
||||
<el-option value="cp95" label="cp95"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div
|
||||
class="history_count"
|
||||
v-for="(item, index) in countData"
|
||||
:key="index"
|
||||
v-show="item.countOptions.length != 0"
|
||||
>
|
||||
<span class="mr12">
|
||||
{{ item.name.includes('次数') ? item.name : item.name + '谐波次数' }}
|
||||
</span>
|
||||
<el-select
|
||||
v-model="item.count"
|
||||
@change="onCountChange($event, index)"
|
||||
placeholder="请选择谐波次数"
|
||||
style="width: 100px"
|
||||
class="mr20"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="vv in item.countOptions"
|
||||
:key="vv"
|
||||
:label="vv"
|
||||
:value="vv"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
|
||||
<el-button :type="timeControl ? 'primary' : ''" icon="el-icon-Sort" @click="setTimeControl">
|
||||
缺失数据
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="history_chart" :style="pageHeight" v-loading="loading">
|
||||
<MyEchart
|
||||
ref="historyChart"
|
||||
:options="echartsData"
|
||||
v-if="showEchart"
|
||||
/>
|
||||
<el-empty :style="pageHeight" v-else description="暂无数据" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { queryStatistical } from '@/api/system-boot/csstatisticalset'
|
||||
import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { trendData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { color } from '@/components/echarts/color'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const dictData = useDictData()
|
||||
defineOptions({
|
||||
// name: 'govern/device/control'
|
||||
})
|
||||
const props = defineProps({
|
||||
TrendList: {
|
||||
type: Array
|
||||
}
|
||||
})
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
// console.log("🚀 ~ props:", props.TrendList)
|
||||
const showEchart = ref(true)
|
||||
const num = ref(0)
|
||||
const timeControl = ref(false)
|
||||
//值类型
|
||||
const pageHeight = ref(mainHeight(57 * 1.6, 1.6))
|
||||
const loading = ref(true)
|
||||
const searchForm: any = ref({})
|
||||
const tableHeaderRef = ref()
|
||||
const typeOptions = [
|
||||
{
|
||||
name: '平均值',
|
||||
id: 'avg'
|
||||
},
|
||||
{
|
||||
name: '最大值',
|
||||
id: 'max'
|
||||
},
|
||||
{
|
||||
name: '最小值',
|
||||
id: 'min'
|
||||
},
|
||||
{
|
||||
name: 'CP95值',
|
||||
id: 'cp95'
|
||||
}
|
||||
]
|
||||
searchForm.value = {
|
||||
index: [],
|
||||
type: typeOptions[0].id,
|
||||
count: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
dataLevel: 'Primary',
|
||||
valueType: 'avg'
|
||||
}
|
||||
//统计指标
|
||||
const indexOptions: any = ref([])
|
||||
//谐波次数
|
||||
const countOptions: any = ref([])
|
||||
// Harmonic_Type
|
||||
// portable-harmonic
|
||||
const legendDictList: any = ref([])
|
||||
|
||||
const initCode = (field: string, title: string) => {
|
||||
queryByCode('steady_state_limit_trend').then(res => {
|
||||
queryCsDictTree(res.data.id).then(item => {
|
||||
//排序
|
||||
indexOptions.value = item.data.sort((a: any, b: any) => {
|
||||
return a.sort - b.sort
|
||||
})
|
||||
const titleMap: Record<string, number> = {
|
||||
flickerOvertime: 0,
|
||||
uaberranceOvertime: 3,
|
||||
ubalanceOvertime: 4,
|
||||
freqDevOvertime: 5
|
||||
}
|
||||
|
||||
let defaultIndex = 0 // 默认值
|
||||
|
||||
if (field in titleMap) {
|
||||
defaultIndex = titleMap[field]
|
||||
} else if (field.includes('uharm')) {
|
||||
defaultIndex = 1
|
||||
} else if (field.includes('iharm')) {
|
||||
defaultIndex = 2
|
||||
}
|
||||
|
||||
searchForm.value.index[0] = indexOptions.value[defaultIndex].id
|
||||
})
|
||||
queryStatistical(res.data.id).then(vv => {
|
||||
legendDictList.value = vv.data
|
||||
indexOptions.value.map((item: any, index: any) => {
|
||||
if (!countDataCopy.value[index]) {
|
||||
countDataCopy.value[index] = {
|
||||
index: item.id,
|
||||
countOptions: [],
|
||||
count: [],
|
||||
name: indexOptions.value.find((vv: any) => {
|
||||
return vv.id == item.id
|
||||
})?.name
|
||||
}
|
||||
}
|
||||
legendDictList.value?.selectedList?.map((vv: any, vvs: any) => {
|
||||
//查找相等的指标
|
||||
if (item.id == vv.dataType) {
|
||||
vv.eleEpdPqdVOS.map((kk: any, kks: any) => {
|
||||
if (kk.harmStart && kk.harmEnd) {
|
||||
range(0, 0, 0)
|
||||
|
||||
if (kk.showName == '间谐波电压含有率') {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
||||
(item: any) => {
|
||||
return item - 0.5
|
||||
}
|
||||
)
|
||||
} else {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
}
|
||||
if (title && countDataCopy.value[index].countOptions.includes(Number(title))) {
|
||||
countDataCopy.value[index].count = Number(title)
|
||||
} else if (title && countDataCopy.value[index].countOptions.includes(title)) {
|
||||
countDataCopy.value[index].count = title
|
||||
} else if (
|
||||
!countDataCopy.value[index].count ||
|
||||
countDataCopy.value[index].count.length == 0
|
||||
) {
|
||||
// 只有当count为空时才设置默认值
|
||||
countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
nextTick(() => {
|
||||
formatCountOptions()
|
||||
})
|
||||
init()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const chartsList = ref<any>([])
|
||||
const chartTitle: any = ref('')
|
||||
const echartsData = ref<any>(null)
|
||||
//加载echarts图表
|
||||
//历史趋势数据
|
||||
const historyDataList: any = ref([])
|
||||
const range = (start: any, end: any, step: any) => {
|
||||
return Array.from({ length: (end - start) / step + 1 }, (_, i) => start + i * step)
|
||||
}
|
||||
//获取请求趋势数据参数
|
||||
const trendRequestData = ref()
|
||||
const getTrendRequest = (val: any) => {
|
||||
trendRequestData.value = val
|
||||
// init()
|
||||
}
|
||||
//初始化趋势图
|
||||
const headerRef = ref()
|
||||
const datePickerRef = ref()
|
||||
const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
|
||||
const init = async () => {
|
||||
loading.value = true
|
||||
// 选择指标的时候切换legend内容和data数据
|
||||
let list: any = []
|
||||
legendDictList.value?.selectedList?.map((item: any) => {
|
||||
searchForm.value.index.map((vv: any) => {
|
||||
if (item.dataType == vv) {
|
||||
list.push(item.eleEpdPqdVOS)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//颜色数组
|
||||
const colorList = color
|
||||
//选择的指标使用方法处理
|
||||
formatCountOptions()
|
||||
//查询历史趋势
|
||||
historyDataList.value = []
|
||||
chartTitle.value = ''
|
||||
|
||||
searchForm.value.index.map((item: any, indexs: any) => {
|
||||
indexOptions.value.map((vv: any) => {
|
||||
if (vv.id == item) {
|
||||
chartTitle.value += indexs == searchForm.value.index.length - 1 ? vv.name : vv.name + '/'
|
||||
}
|
||||
})
|
||||
})
|
||||
let lists: any = []
|
||||
let frequencys: any = null
|
||||
countData.value.map((item: any, index: any) => {
|
||||
if (item.name.includes('谐波含有率')) {
|
||||
frequencys = item.count
|
||||
} else {
|
||||
frequencys = ''
|
||||
}
|
||||
lists[index] = {
|
||||
statisticalId: item.index,
|
||||
frequency: frequencys !== null && frequencys !== undefined ? String(frequencys) : ''
|
||||
}
|
||||
})
|
||||
let obj = {
|
||||
//...trendRequestData.value,
|
||||
lineId: trendRequestData.value.lineId,
|
||||
list: lists,
|
||||
dataLevel: searchForm.value.dataLevel,
|
||||
valueType: searchForm.value.valueType,
|
||||
searchBeginTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
||||
searchEndTime: datePickerRef.value && datePickerRef.value.timeValue[1]
|
||||
}
|
||||
if (searchForm.value.index.length == 0) {
|
||||
ElMessage.warning('请选择统计指标')
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
if (obj.list.length != 0) {
|
||||
try {
|
||||
showEchart.value = true
|
||||
await trendData(obj)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
if (res.data.length == 0) {
|
||||
loading.value = false
|
||||
showEchart.value = false
|
||||
return
|
||||
}
|
||||
historyDataList.value = res.data
|
||||
chartsList.value = JSON.parse(JSON.stringify(res.data))
|
||||
loading.value = false
|
||||
setEchart()
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
loading.value = false
|
||||
})
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
const setEchart = () => {
|
||||
loading.value = true
|
||||
echartsData.value = {}
|
||||
//icon图标替换legend图例
|
||||
|
||||
// y轴单位数组
|
||||
let unitList: any = []
|
||||
|
||||
let groupedData = chartsList.value.reduce((acc: any, item: any) => {
|
||||
let key = ''
|
||||
if (item.phase == null) {
|
||||
key = item.unit
|
||||
} else {
|
||||
key = item.anotherName
|
||||
}
|
||||
|
||||
if (!acc[key]) {
|
||||
acc[key] = []
|
||||
}
|
||||
acc[key].push(item)
|
||||
return acc
|
||||
}, {})
|
||||
let result = Object.values(groupedData)
|
||||
if (chartsList.value.length > 0) {
|
||||
unitList = result.map((item: any) => {
|
||||
return item[0].unit
|
||||
})
|
||||
}
|
||||
|
||||
echartsData.value = {
|
||||
legend: {
|
||||
itemWidth: 20,
|
||||
itemHeight: 20,
|
||||
itemStyle: { opacity: 0 }, //去圆点
|
||||
type: 'scroll', // 开启滚动分页
|
||||
// orient: 'vertical', // 垂直排列
|
||||
top: 5,
|
||||
right: 70
|
||||
// width: 550,
|
||||
// height: 50
|
||||
},
|
||||
grid: {
|
||||
top: '80px'
|
||||
},
|
||||
tooltip: {
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
formatter(params: any) {
|
||||
const xname = params[0].value[0]
|
||||
let str = `${xname}<br>`
|
||||
params.forEach((el: any, index: any) => {
|
||||
let marker = ''
|
||||
|
||||
if (el.value[3] == 'dashed') {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
marker += `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
|
||||
}
|
||||
} else {
|
||||
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
|
||||
}
|
||||
let unit = el.value[2] ? el.value[2] : ''
|
||||
str += `${marker}${el.seriesName.split('(')[0]}:${el.value[1]}${unit}
|
||||
<br>`
|
||||
})
|
||||
return str
|
||||
}
|
||||
},
|
||||
color: ['#DAA520', '#2E8B57', '#A52a2a', ...color],
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: [{}],
|
||||
toolbox: {
|
||||
featureProps: {
|
||||
myTool1: {
|
||||
show: true,
|
||||
title: '下载csv',
|
||||
icon: 'path://M588.8 551.253333V512H352v39.253333h236.373333z m0 78.933334v-39.253334H352v39.253334h236.373333z m136.533333 78.933333V334.933333l-157.866666-157.866666H273.066667A59.306667 59.306667 0 0 0 213.333333 236.373333v551.253334a59.306667 59.306667 0 0 0 59.306667 59.306666h274.773333v42.666667H853.333333v-180.48zM568.746667 234.666667l100.266666 100.693333h-81.066666a20.053333 20.053333 0 0 1-19.626667-20.053333z m-20.48 573.013333H273.066667a19.2 19.2 0 0 1-17.493334-19.626667V236.373333a19.2 19.2 0 0 1 19.626667-19.626666h256v98.133333a58.88 58.88 0 0 0 58.88 59.306667h96.426667v334.933333h-98.133334v-39.68H352v39.68h196.266667z m100.266666 23.04a37.973333 37.973333 0 0 1-32 15.786667 38.826667 38.826667 0 0 1-32.426666-15.786667 53.76 53.76 0 0 1-10.24-32.853333 42.666667 42.666667 0 0 1 42.666666-47.786667 35.84 35.84 0 0 1 37.546667 29.866667h-12.8a23.893333 23.893333 0 0 0-24.746667-19.2c-17.066667 0-29.013333 14.08-29.013333 35.84s11.52 37.546667 28.586667 37.546666a26.453333 26.453333 0 0 0 26.453333-25.6h12.8a39.253333 39.253333 0 0 1-7.253333 22.186667z m59.733334 15.786667a35.84 35.84 0 0 1-40.106667-34.56H682.666667a23.893333 23.893333 0 0 0 26.88 23.04c12.8 0 22.613333-6.4 22.613333-15.786667s-4.266667-11.52-14.506667-13.653333l-21.333333-5.12c-17.066667-4.266667-24.32-11.52-24.32-23.893334s12.8-26.453333 34.133333-26.453333a31.573333 31.573333 0 0 1 35.413334 30.293333h-13.653334a19.626667 19.626667 0 0 0-22.613333-18.773333c-12.8 0-20.48 5.12-20.48 12.8s5.12 11.093333 17.066667 13.653333l14.933333 2.986667a42.666667 42.666667 0 0 1 20.906667 8.96 23.893333 23.893333 0 0 1 7.68 17.92c-0.426667 17.066667-14.506667 28.16-37.12 28.16z m88.746666 0h-14.506666l-32.426667-92.16h14.08l19.626667 59.733333 6.4 20.053333c0-9.386667 3.413333-12.8 5.546666-20.053333l19.2-59.733333h14.08z',
|
||||
onclick: e => {
|
||||
// console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data))
|
||||
|
||||
let list = echartsData.value.options.series?.map((item: any) => item.data)
|
||||
let dataList = list[0]?.map((item: any, index: any) => {
|
||||
let value = [item[0], item[1]]
|
||||
list.forEach((item1: any, index1: any) => {
|
||||
if (index1 > 0) {
|
||||
value.push(item1 && item1[index] ? item1[index][1] : null)
|
||||
}
|
||||
})
|
||||
|
||||
return value
|
||||
})
|
||||
exportCSV(
|
||||
echartsData.value.options.series.map((item: any) => item.name),
|
||||
dataList,
|
||||
'监测点指标趋势.csv'
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
options: {
|
||||
series: []
|
||||
}
|
||||
}
|
||||
// console.log("🚀 ~ unitList.forEach ~ unitList:", unitList)
|
||||
|
||||
if (chartsList.value.length > 0) {
|
||||
let yData: any = []
|
||||
echartsData.value.yAxis = []
|
||||
let setList = [...new Set(unitList)]
|
||||
|
||||
setList.forEach((item: any, index: any) => {
|
||||
if (index > 2) {
|
||||
echartsData.value.grid.right = (index - 1) * 80
|
||||
}
|
||||
yData.push([])
|
||||
let right = {
|
||||
position: 'right',
|
||||
offset: (index - 1) * 80
|
||||
}
|
||||
// console.log("🚀 ~ unitList.forEach ~ right.index:", index)
|
||||
echartsData.value.yAxis.push({
|
||||
name: item,
|
||||
yAxisIndex: index,
|
||||
splitNumber: 5,
|
||||
minInterval: 1,
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
...(index > 0 ? right : null)
|
||||
})
|
||||
})
|
||||
// console.log("🚀 ~ result.forEach ~ result:", result)
|
||||
// '电压负序分量', '电压正序分量', '电压零序分量'
|
||||
let ABCName = [
|
||||
...new Set(
|
||||
chartsList.value.map((item: any) => {
|
||||
return item.anotherName == '电压负序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName == '电压正序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName == '电压零序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName
|
||||
})
|
||||
)
|
||||
]
|
||||
// console.log("🚀 ~ .then ~ ABCName:", ABCName)
|
||||
result.forEach((item: any, index: any) => {
|
||||
let yMethodList: any = []
|
||||
|
||||
let ABCList = Object.values(
|
||||
item.reduce((acc, item) => {
|
||||
let key = ''
|
||||
if (item.phase == null) {
|
||||
key = item.anotherName
|
||||
} else {
|
||||
key = item.phase
|
||||
}
|
||||
|
||||
if (!acc[key]) {
|
||||
acc[key] = []
|
||||
}
|
||||
acc[key].push(item)
|
||||
return acc
|
||||
}, {})
|
||||
)
|
||||
// console.log("🚀 ~ ABCList.forEach ~ ABCList:", ABCList)
|
||||
|
||||
ABCList.forEach((kk: any) => {
|
||||
let colorName = kk[0].phase?.charAt(0).toUpperCase()
|
||||
let lineS = ABCName.findIndex(
|
||||
item =>
|
||||
item ===
|
||||
(kk[0].anotherName == '电压负序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName == '电压正序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName == '电压零序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName)
|
||||
)
|
||||
|
||||
let seriesList: any = []
|
||||
kk.forEach((cc: any) => {
|
||||
if (cc.statisticalData !== null) {
|
||||
yData[setList.indexOf(kk[0].unit)].push(cc.statisticalData?.toFixed(2))
|
||||
}
|
||||
|
||||
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
|
||||
})
|
||||
// console.log(kk);
|
||||
|
||||
echartsData.value.options.series.push({
|
||||
name: kk[0].phase ? kk[0].phase + '相' + kk[0].anotherName : kk[0].anotherName,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
color:
|
||||
colorName == 'A' ? '#DAA520' : colorName == 'B' ? '#2E8B57' : colorName == 'C' ? '#A52a2a' : '',
|
||||
symbol: 'none',
|
||||
// data: seriesList,
|
||||
data: timeControl.value ? completeTimeSeries(seriesList) : seriesList,
|
||||
lineStyle: lineStyle[lineS],
|
||||
yAxisIndex: setList.indexOf(kk[0].unit)
|
||||
})
|
||||
})
|
||||
})
|
||||
yData.forEach((item: any, index: any) => {
|
||||
let [min, max] = yMethod(item)
|
||||
echartsData.value.yAxis[index].min = min
|
||||
echartsData.value.yAxis[index].max = max
|
||||
})
|
||||
// console.log("🚀 ~ result.forEach ~ echartsData.value:", echartsData.value)
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
const setTimeControl = () => {
|
||||
timeControl.value = !timeControl.value
|
||||
setEchart()
|
||||
}
|
||||
|
||||
const selectChange = (flag: boolean, height: any) => {
|
||||
pageHeight.value = mainHeight(height * 1.6, 1.6)
|
||||
}
|
||||
//导出
|
||||
const historyChart = ref()
|
||||
|
||||
const countData: any = ref([])
|
||||
const countDataCopy: any = ref([])
|
||||
|
||||
//根据选择的指标处理谐波次数
|
||||
const formatCountOptions = () => {
|
||||
countData.value = []
|
||||
if (searchForm.value.index.length != 0) {
|
||||
searchForm.value.index.forEach((item: any, index: any) => {
|
||||
countDataCopy.value.forEach((vv: any, vvs: any) => {
|
||||
if (vv.index == item) {
|
||||
countData.value.push(vv)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
countData.value.map((item: any, key: any) => {
|
||||
if (item.name == '谐波电流有效值') {
|
||||
item.name = '谐波电流次数'
|
||||
} else if (item.name == '谐波电压含有率') {
|
||||
item.name = '谐波电压次数'
|
||||
} else if (item.name == '间谐波电压含有率') {
|
||||
item.name = '间谐波电压次数'
|
||||
}
|
||||
})
|
||||
}
|
||||
// setTimeout(() => {
|
||||
// tableHeaderRef.value.computedSearchRow()
|
||||
// }, 500)
|
||||
}
|
||||
// 判断下拉框是否存在
|
||||
const onCountChange = (val: any, index: any) => {
|
||||
if (val.length == 0) {
|
||||
countData.value[index].count = countData.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
const flag = ref(true)
|
||||
const onIndexChange = (val: any) => {
|
||||
num.value += 1
|
||||
let pp: any = []
|
||||
indexOptions.value.forEach((item: any) => {
|
||||
const filteredResult = val.filter(vv => item.id == vv)
|
||||
if (filteredResult.length > 0) {
|
||||
pp.push(filteredResult[0])
|
||||
}
|
||||
})
|
||||
searchForm.value.index = pp
|
||||
flag.value = true
|
||||
formatCountOptions()
|
||||
}
|
||||
watch(
|
||||
() => searchForm.value.index,
|
||||
(val: any, oldval: any) => {},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
|
||||
const openDialog = async (row: any, field: any, title: any) => {
|
||||
dialogVisible.value = true
|
||||
trendRequestData.value = row
|
||||
|
||||
nextTick(() => {
|
||||
// 默认当天
|
||||
datePickerRef.value.setInterval(5)
|
||||
datePickerRef.value.timeValue = [row.time, row.time]
|
||||
initCode(field, title)
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ getTrendRequest, openDialog })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.history_header {
|
||||
display: flex;
|
||||
|
||||
// flex-wrap: wrap;
|
||||
#history_select {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
// justify-content: flex-start;
|
||||
// overflow-x: auto;
|
||||
height: auto;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.el-form-item {
|
||||
flex: none !important;
|
||||
// max-width: 380px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
// #history_select::-webkit-scrollbar {
|
||||
// width: 0 !important;
|
||||
// display: none !important;
|
||||
// }
|
||||
|
||||
.history_searchBtn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.history_chart {
|
||||
width: 100%;
|
||||
|
||||
// flex: 1;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.history_count {
|
||||
.el-select {
|
||||
min-width: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 指标越限详情 -->
|
||||
<el-dialog draggable title="指标越限详情" v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.lineId"
|
||||
placeholder="请选择监测点"
|
||||
style="width: 150px"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="height"></Table>
|
||||
</el-dialog>
|
||||
<!-- 谐波电流、谐波电压占有率 -->
|
||||
<HarmonicRatio ref="harmonicRatioRef" v-if="dialogFlag" @close="onHarmonicRatioClose" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide,nextTick } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import HarmonicRatio from '@/components/cockpit/gridSideStatistics/components/harmonicRatio.vue'
|
||||
import { cslineList } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
const harmonicRatioRef: any = ref(null)
|
||||
|
||||
const options = ref()
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const tableHeaderRef = ref()
|
||||
const dialogFlag = ref(false)
|
||||
const loop50 = (key: string) => {
|
||||
let list: any[] = []
|
||||
for (let i = 2; i < 26; i++) {
|
||||
list.push({
|
||||
title: i + '次',
|
||||
field: key + i + 'Overtime',
|
||||
width: '60',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
|
||||
}
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-harmonic-boot/totalLimitStatistics/details',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
exportName: '每日越限占比统计',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
field: 'time',
|
||||
width: '150',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'lineName',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '闪变越限(%)',
|
||||
field: 'flickerOvertime',
|
||||
width: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电压越限(%)',
|
||||
children: loop50('uharm')
|
||||
},
|
||||
{
|
||||
title: '谐波电流越限(%)',
|
||||
children: loop50('iharm')
|
||||
},
|
||||
{
|
||||
title: '三相不平衡度越限(%)',
|
||||
field: 'ubalanceOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压偏差越限(%)',
|
||||
field: 'voltageDevOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.uaberranceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '频率偏差越限(%)',
|
||||
field: 'freqDevOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.freqDevOvertime}</span>`
|
||||
}
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
},
|
||||
loadCallback: () => {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.sortBy = ''
|
||||
tableStore.table.params.orderBy = ''
|
||||
const open = async (row: any,searchBeginTime:any,searchEndTime:any) => {
|
||||
dialogVisible.value = true
|
||||
initCSlineList()
|
||||
tableStore.table.params.lineId = row.lineId
|
||||
|
||||
nextTick(() => {
|
||||
tableHeaderRef.value.setTimeInterval([searchBeginTime, searchEndTime])
|
||||
tableStore.table.params.searchBeginTime =searchBeginTime
|
||||
tableStore.table.params.searchEndTime = searchEndTime
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name' && column.field != 'time') {
|
||||
dialogFlag.value = true
|
||||
dialogVisible.value = false
|
||||
nextTick(() => {
|
||||
harmonicRatioRef.value.openDialog(row,column.field,column.title.replace(/次/g, ""))
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 谐波弹窗关闭时的回调
|
||||
const onHarmonicRatioClose = () => {
|
||||
dialogFlag.value = false
|
||||
// 重新打开指标越限详情弹窗
|
||||
nextTick(() => {
|
||||
dialogVisible.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const initCSlineList = async () => {
|
||||
const res = await cslineList({})
|
||||
options.value = res.data
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,19 +1,25 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--电网侧指标越限统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<TableHeader
|
||||
:showReset="false"
|
||||
ref="TableHeaderRef"
|
||||
@selectChange="selectChange"
|
||||
datePicker :timeKeyList="prop.timeKey"
|
||||
v-if="fullscreen"
|
||||
></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`
|
||||
height: `calc(${prop.height} / 2 )`
|
||||
}"
|
||||
/>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`"
|
||||
:height="`calc(${prop.height} / 2 - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`"
|
||||
isGroup
|
||||
></Table>
|
||||
<!-- 指标越限详情 -->
|
||||
@@ -24,35 +30,35 @@
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import OverLimitDetails from '@/components/cockpit/listOfMainMonitoringPoints/components/overLimitDetails.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import OverLimitDetails from '@/components/cockpit/gridSideStatistics/components/overLimitDetails.vue'
|
||||
import { gridSideLimitStatisticsData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const echartList = ref({})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +73,14 @@ const fullscreen = computed(() => {
|
||||
return false
|
||||
}
|
||||
})
|
||||
const echartList = ref({
|
||||
|
||||
const initEcharts = () => {
|
||||
gridSideLimitStatisticsData({
|
||||
searchBeginTime: tableStore.table.params.searchBeginTime,
|
||||
searchEndTime: tableStore.table.params.searchEndTime
|
||||
}).then((res: any) => {
|
||||
const dataArray = [res.data.flicker, res.data.uharm, res.data.iharm, res.data.voltageDev, res.data.ubalance]
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: '指标越限占比'
|
||||
},
|
||||
@@ -91,7 +104,7 @@ const echartList = ref({
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: [0, 45, 22, 0, 70],
|
||||
data: dataArray,
|
||||
barMaxWidth: 30
|
||||
|
||||
// label: {
|
||||
@@ -106,10 +119,13 @@ const echartList = ref({
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/gridSideLimitStatistics/list',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
@@ -125,7 +141,7 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'name',
|
||||
field: 'lineName',
|
||||
minWidth: '90'
|
||||
},
|
||||
{
|
||||
@@ -133,82 +149,58 @@ const tableStore: any = new TableStore({
|
||||
children: [
|
||||
{
|
||||
title: '闪变',
|
||||
field: 'type',
|
||||
field: 'flicker',
|
||||
minWidth: '70',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flicker}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电压',
|
||||
field: 'type1',
|
||||
field: 'uharm',
|
||||
minWidth: '80',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type1}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.uharm}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电流',
|
||||
field: 'type2',
|
||||
field: 'iharm',
|
||||
minWidth: '80',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type2}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.iharm}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压偏差',
|
||||
field: 'type3',
|
||||
field: 'voltageDev',
|
||||
minWidth: '80',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type3}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.voltageDev}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '三相不平衡',
|
||||
field: 'type4',
|
||||
field: 'ubalance',
|
||||
minWidth: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type4}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalance}</span>`
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '1#变压器电网侧',
|
||||
type: '0',
|
||||
type1: '45',
|
||||
type2: '22',
|
||||
type3: '0',
|
||||
type4: '70'
|
||||
}
|
||||
]
|
||||
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
initEcharts()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -220,27 +212,50 @@ provide('tableStore', tableStore)
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name') {
|
||||
console.log(row)
|
||||
OverLimitDetailsRef.value.open(row)
|
||||
OverLimitDetailsRef.value.open(
|
||||
row,
|
||||
tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
||||
tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
initEcharts()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,26 +1,38 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--指标越限明细 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<el-calendar v-model="value" :style="{ height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`, overflow: 'auto' }">
|
||||
<TableHeader
|
||||
:showReset="false"
|
||||
ref="TableHeaderRef"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
v-if="fullscreen"
|
||||
:timeKeyList="prop.timeKey"
|
||||
></TableHeader>
|
||||
<el-calendar
|
||||
v-model="value"
|
||||
:style="{
|
||||
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`,
|
||||
overflow: 'auto'
|
||||
}"
|
||||
v-loading="tableStore.table.loading"
|
||||
>
|
||||
<template #date-cell="{ data }">
|
||||
<div style="height: 100%; padding: 8px" :style="{ background: setBackground(data.day) }">
|
||||
<div
|
||||
style="padding: 8px"
|
||||
:style="{
|
||||
background: setBackground(data.day),
|
||||
height: `calc((${prop.height} - 100px - ${headerHeight}px + ${fullscreen ? 0 : 56}px) / 5 )`
|
||||
}"
|
||||
>
|
||||
<p :class="data.isSelected ? 'is-selected' : ''">
|
||||
{{ data.day.split('-').slice(2).join('-') }}
|
||||
</p>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
placement="top"
|
||||
:hide-after="0"
|
||||
v-if="list?.filter(item => item.time == data.day)[0]?.text || false"
|
||||
>
|
||||
<el-tooltip effect="dark" placement="top" :hide-after="0" v-if="getTextForDate(data.day)">
|
||||
<template #content>
|
||||
<span v-html="list?.filter(item => item.time == data.day)[0]?.text || ''"></span>
|
||||
<span v-html="getTextForDate(data.day)"></span>
|
||||
</template>
|
||||
<div
|
||||
:style="{ height: `calc(${prop.height} / 5 - 47px)`, overflow: 'auto' }"
|
||||
v-html="list?.filter(item => item.time == data.day)[0]?.text || ''"
|
||||
></div>
|
||||
<div class="details" v-html="fullscreen ? getTextForDate(data.day) : '有越限'"></div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
@@ -31,25 +43,24 @@
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { dayjs } from 'element-plus'
|
||||
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const list = ref()
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
dayjs.en.weekStart = 1 //设置日历的周起始日为星期一
|
||||
const value = ref(new Date())
|
||||
@@ -57,11 +68,10 @@ const value = ref(new Date())
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,132 +87,116 @@ const fullscreen = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const list = ref([
|
||||
{
|
||||
time: '2025-11-01',
|
||||
key: 81,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-10-31',
|
||||
key: 81,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-11-08',
|
||||
key: 20,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-11-16',
|
||||
key: 20,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-11-23',
|
||||
key: 20,
|
||||
text: '3次谐波越限<br/>5次谐波越限<br/>三相不平衡越限'
|
||||
},
|
||||
{
|
||||
time: '2025-11-04',
|
||||
key: 0,
|
||||
text: ''
|
||||
},
|
||||
{
|
||||
time: '2025-10-05',
|
||||
key: 0,
|
||||
text: ''
|
||||
}
|
||||
])
|
||||
const getTextForDate = (date: string) => {
|
||||
const item = list.value?.find((item: any) => item.time === date)
|
||||
return item ? item.text : ''
|
||||
}
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitCalendarData',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
value.value = tableStore.table.params.searchBeginTime
|
||||
if (tableStore.table.data && tableStore.table.data.length > 0) {
|
||||
list.value = tableStore.table.data.map((item: any) => {
|
||||
// 将 items 数组转换为带换行的文本
|
||||
const text = item.items && item.items.length > 0 ? item.items.join('<br/>') : ''
|
||||
|
||||
return {
|
||||
time: item.time,
|
||||
key: item.status || 0,
|
||||
text: text
|
||||
}
|
||||
})
|
||||
} else {
|
||||
list.value = []
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref([])
|
||||
|
||||
const setBackground = (value: string) => {
|
||||
let data = []
|
||||
data = list.value?.filter(item => item.time == value)
|
||||
const data = list.value?.find((item: any) => item.time === value)
|
||||
|
||||
if (data && data?.length > 0) {
|
||||
if (data[0].key < 10) {
|
||||
if (data) {
|
||||
// 根据 status 值返回对应的颜色
|
||||
switch (data.key) {
|
||||
case 0: // 无越限
|
||||
return '#33996690'
|
||||
} else if (data[0].key < 80) {
|
||||
case 1: // 一般越限
|
||||
return '#FFCC3390'
|
||||
} else if (data[0].key <= 100) {
|
||||
case 2: // 严重越限
|
||||
return '#Ff660090'
|
||||
default:
|
||||
return '#fff' // 默认白色背景
|
||||
}
|
||||
}
|
||||
|
||||
return '#fff'
|
||||
return '#fff' // 默认白色背景
|
||||
}
|
||||
|
||||
provide('tableRef', tableRef)
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-calendar) {
|
||||
.el-calendar__header {
|
||||
.el-calendar__button-group {
|
||||
display: none;
|
||||
}
|
||||
.el-calendar__body {
|
||||
padding: 0px !important;
|
||||
height: 100%;
|
||||
height: calc(100% - 46px);
|
||||
.el-calendar-table {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.el-calendar-day {
|
||||
// height: calc(912px / 5 );
|
||||
height: 100%;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
.details {
|
||||
height: calc(100% - 20px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
.el-calendar-table__row {
|
||||
.next {
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--指标越限概率分布 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen">
|
||||
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" ref="TableHeaderRef" @selectChange="selectChange" datePicker v-if="fullscreen">
|
||||
<template v-slot:select>
|
||||
<el-form-item>
|
||||
<el-select size="small" v-model="tableStore.table.params.searchValue">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-form-item label="监测点">
|
||||
<el-select size="small" filterable v-model="tableStore.table.params.lineId">
|
||||
<el-option
|
||||
v-for="item in lineList"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div v-loading="tableStore.table.loading">
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
@@ -27,45 +33,41 @@
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { limitProbabilityData, cslineList } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const options = [
|
||||
{
|
||||
value: '1',
|
||||
label: '35V进线'
|
||||
}
|
||||
]
|
||||
// const options = ref(JSON.parse(window.localStorage.getItem('lineIdList') || '[]'))
|
||||
|
||||
const lineList = ref()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,143 +83,68 @@ const fullscreen = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
// const echartList = ref({
|
||||
// options: {
|
||||
// xAxis: null,
|
||||
// yAxis: null,
|
||||
// dataZoom: null,
|
||||
// backgroundColor: '#fff',
|
||||
// tooltip: {
|
||||
// // trigger: 'axis'
|
||||
// textStyle: {
|
||||
// color: '#fff',
|
||||
// fontStyle: 'normal',
|
||||
// opacity: 0.35,
|
||||
// fontSize: 14
|
||||
// },
|
||||
// backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
// borderWidth: 0,
|
||||
// formatter: function (params: any) {
|
||||
// console.log(params)
|
||||
// var tips = ''
|
||||
// for (var i = 0; i < params.length; i++) {
|
||||
// tips += params[i].name + '</br/>'
|
||||
// tips += '监测点数' + ':' + ' ' + ' ' + params[i].value + '</br/>'
|
||||
// }
|
||||
// return tips
|
||||
// }
|
||||
// },
|
||||
// title: {
|
||||
// text: '指标越限概率分布',
|
||||
// x: 'center'
|
||||
// },
|
||||
const echartList = ref()
|
||||
|
||||
// visualMap: {
|
||||
// max: 20,
|
||||
// show: false,
|
||||
// inRange: {
|
||||
// color: ['#313695', '#00BB00', '#ff8000', '#a50026']
|
||||
// }
|
||||
// },
|
||||
// xAxis3D: {
|
||||
// type: 'category',
|
||||
// name: '指标越限',
|
||||
// data: ['0-10', '10-20', '20-30', '30-40', '40-50'],
|
||||
// axisLine: {
|
||||
// lineStyle: {
|
||||
// color: '#111'
|
||||
// }
|
||||
// },
|
||||
// axisLabel: {
|
||||
// color: '#111'
|
||||
// }
|
||||
// },
|
||||
// yAxis3D: {
|
||||
// type: 'category',
|
||||
// name: '指标类型',
|
||||
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡'],
|
||||
// nameTextStyle: {
|
||||
// color: '#111'
|
||||
// },
|
||||
// axisLine: {
|
||||
// show: true,
|
||||
// lineStyle: {
|
||||
// color: '#111'
|
||||
// }
|
||||
// },
|
||||
// axisLabel: {
|
||||
// color: '#111'
|
||||
// },
|
||||
// splitLine: {
|
||||
// lineStyle: {
|
||||
// // 使用深浅的间隔色
|
||||
// color: ['#111'],
|
||||
// type: 'dashed',
|
||||
// opacity: 0.5
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// zAxis3D: {
|
||||
// type: 'value',
|
||||
// splitNumber: 10,
|
||||
// minInterval: 10,
|
||||
// name: '越限占比'
|
||||
// },
|
||||
// grid3D: {
|
||||
// viewControl: {
|
||||
// projection: 'perspective',
|
||||
// distance: 250
|
||||
// },
|
||||
// boxWidth: 200,
|
||||
// boxDepth: 80,
|
||||
// light: {
|
||||
// main: {
|
||||
// intensity: 1.2
|
||||
// },
|
||||
// ambient: {
|
||||
// intensity: 0.3
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// series: [
|
||||
// {
|
||||
// type: 'bar3D',
|
||||
// data: [
|
||||
// [0, 0, 1],
|
||||
// [0, 1, 1],
|
||||
// [0.2, 1]
|
||||
// ],
|
||||
// shading: 'realistic',
|
||||
// label: {
|
||||
// show: false,
|
||||
// textStyle: {
|
||||
// fontSize: 16,
|
||||
// borderWidth: 1
|
||||
// }
|
||||
// },
|
||||
const echartList1 = ref()
|
||||
|
||||
// itemStyle: {
|
||||
// opacity: 1
|
||||
// },
|
||||
// emphasis: {
|
||||
// label: {
|
||||
// textStyle: {
|
||||
// fontSize: 20,
|
||||
// color: '#900'
|
||||
// }
|
||||
// },
|
||||
// itemStyle: {
|
||||
// color: '#900'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// })
|
||||
const probabilityData = ref()
|
||||
|
||||
var yAxisData=['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
const initLineList = async () => {
|
||||
cslineList({}).then(res => {
|
||||
lineList.value = res.data
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
|
||||
const echartList = ref({
|
||||
// 越限程度概率分布
|
||||
const initProbabilityData = () => {
|
||||
// 只有当 lineList 已加载且有数据时才设置默认 lineId
|
||||
if (!tableStore.table.params.lineId && lineList.value && lineList.value.length > 0) {
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
}
|
||||
const params = {
|
||||
searchBeginTime: tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
||||
searchEndTime: tableStore.table.params.searchEndTime || prop.timeValue?.[1],
|
||||
lineId: tableStore.table.params.lineId
|
||||
}
|
||||
limitProbabilityData(params).then((res: any) => {
|
||||
probabilityData.value = res.data
|
||||
|
||||
// 处理接口返回的数据,转换为图表所需格式
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
// 定义指标类型顺序
|
||||
const indicatorOrder = ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相电压不平衡度', '频率偏差']
|
||||
// 按照指定顺序排序数据
|
||||
const sortedData = [...res.data].sort((a, b) => {
|
||||
return indicatorOrder.indexOf(a.indexName) - indicatorOrder.indexOf(b.indexName)
|
||||
})
|
||||
|
||||
// 构造 series 数据
|
||||
const seriesData: any = []
|
||||
let maxValue: any = 0 // 用于存储数据中的最大值
|
||||
// 遍历每个越限程度区间(0-20%, 20-40%, 40-60%, 60-80%, 80-100%)
|
||||
for (let xIndex = 0; xIndex < 5; xIndex++) {
|
||||
// 遍历每个指标类型
|
||||
sortedData.forEach((item, yIndex) => {
|
||||
// 从 extentGrades 中获取对应区间的值
|
||||
const extentGrade = item.extentGrades[xIndex]
|
||||
const value = extentGrade ? (Object.values(extentGrade)[0] as number) : 0
|
||||
seriesData.push([xIndex, yIndex, value])
|
||||
|
||||
// 更新最大值
|
||||
if (value > maxValue) {
|
||||
maxValue = value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 计算 z 轴最大值(最大值加 5)
|
||||
const zAxisMax = Math.ceil(maxValue) + 5
|
||||
// 构造 yAxis 数据(指标类型名称)
|
||||
const yAxisData = sortedData.map(item => item.indexName)
|
||||
|
||||
echartList.value = {
|
||||
options: {
|
||||
backgroundColor: '#fff',
|
||||
tooltip: {
|
||||
@@ -230,14 +157,11 @@ const echartList = ref({
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
formatter: function (params: any) {
|
||||
console.log(params, '33344')
|
||||
var yIndex = params.value[1]; //获取y轴索引
|
||||
var yIndex = params.value[1] //获取y轴索引
|
||||
var tips = ''
|
||||
// tips += '指标类型: ' + params.name + '</br>'
|
||||
tips += '指标类型: ' + yAxisData[yIndex] + '</br>'
|
||||
tips += '越限程度: ' + params.seriesName + '</br>'
|
||||
// tips += '越限占比: ' + params.value + '%</br>'
|
||||
tips += '越限占比: ' + params.value[2] + '%</br>'
|
||||
tips += '越限次数: ' + params.value[2] + '</br>'
|
||||
return tips
|
||||
}
|
||||
},
|
||||
@@ -249,71 +173,36 @@ const echartList = ref({
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
// 移除或隐藏 visualMap 组件
|
||||
visualMap: {
|
||||
max: 100,
|
||||
show: true,
|
||||
show: false, // 设置为 false 隐藏右侧颜色条
|
||||
min: 0,
|
||||
// max: 100,
|
||||
max: zAxisMax, // 使用计算出的最大值加5
|
||||
inRange: {
|
||||
color: [
|
||||
'#313695',
|
||||
'#4575b4',
|
||||
'#74add1',
|
||||
'#abd9e9',
|
||||
'#e0f3f8',
|
||||
'#ffffbf',
|
||||
'#fee090',
|
||||
'#fdae61',
|
||||
'#f46d43',
|
||||
'#d73027',
|
||||
'#a50026'
|
||||
]
|
||||
color: ['#313695', '#00BB00', '#ff8000', '#d73027', '#a50026']
|
||||
}
|
||||
// calculable: true,
|
||||
// orient: 'horizontal',
|
||||
// left: 'center',
|
||||
// bottom: '5%'
|
||||
},
|
||||
// 添加 legend 配置并设置为不显示
|
||||
legend: {
|
||||
show: false // 隐藏图例
|
||||
},
|
||||
xAxis3D: {
|
||||
type: 'category',
|
||||
name: '越限程度',
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
data: ['0-20%', '20-40%', '40-60%', '60-80%', '80-100%'],
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111',
|
||||
margin: 15
|
||||
},
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
nameGap: 50,
|
||||
data: ['0-20%', '20-40%', '40-60%', '60-80%', '80-100%']
|
||||
},
|
||||
yAxis3D: {
|
||||
type: 'category',
|
||||
name: '指标类型',
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡'],
|
||||
data:yAxisData,
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111',
|
||||
margin: 15
|
||||
},
|
||||
nameGap: 50,
|
||||
data: yAxisData,
|
||||
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: ['#111'],
|
||||
type: 'dashed',
|
||||
opacity: 0.5
|
||||
}
|
||||
@@ -321,22 +210,12 @@ const echartList = ref({
|
||||
},
|
||||
zAxis3D: {
|
||||
type: 'value',
|
||||
name: '越限占比(%)',
|
||||
name: '越限次数',
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111'
|
||||
},
|
||||
min: 0,
|
||||
max: 100
|
||||
minInterval: 10
|
||||
|
||||
// max: 100
|
||||
},
|
||||
grid3D: {
|
||||
viewControl: {
|
||||
@@ -361,14 +240,7 @@ const echartList = ref({
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '0-20%',
|
||||
data: [
|
||||
// [xIndex, yIndex, value]
|
||||
[0, 0, 5], // 闪变 - 0-20%
|
||||
[0, 1, 10], // 谐波电压 - 0-20%
|
||||
[0, 2, 8], // 谐波电流 - 0-20%
|
||||
[0, 3, 15], // 电压偏差 - 0-20%
|
||||
[0, 4, 12] // 三相不平衡 - 0-20%
|
||||
],
|
||||
data: seriesData.filter((item: any) => item[0] === 0),
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
@@ -392,18 +264,7 @@ const echartList = ref({
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '20-40%',
|
||||
// data: chartData.map(function (item) {
|
||||
// return {
|
||||
// value: [item[1], item[0], item[2]]
|
||||
// };
|
||||
// }),
|
||||
data: [
|
||||
[1, 0, 10], // 闪变 - 20-40%
|
||||
[1, 1, 20], // 谐波电压 - 20-40%
|
||||
[1, 2, 15], // 谐波电流 - 20-40%
|
||||
[1, 3, 25], // 电压偏差 - 20-40%
|
||||
[1, 4, 18] // 三相不平衡 - 20-40%
|
||||
],
|
||||
data: seriesData.filter((item: any) => item[0] === 1),
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
@@ -427,13 +288,7 @@ const echartList = ref({
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '40-60%',
|
||||
data: [
|
||||
[2, 0, 15], // 闪变 - 40-60%
|
||||
[2, 1, 25], // 谐波电压 - 40-60%
|
||||
[2, 2, 30], // 谐波电流 - 40-60%
|
||||
[2, 3, 35], // 电压偏差 - 40-60%
|
||||
[2, 4, 28] // 三相不平衡 - 40-60%
|
||||
],
|
||||
data: seriesData.filter((item: any) => item[0] === 2),
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
@@ -457,13 +312,7 @@ const echartList = ref({
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '60-80%',
|
||||
data: [
|
||||
[3, 0, 20], // 闪变 - 60-80%
|
||||
[3, 1, 30], // 谐波电压 - 60-80%
|
||||
[3, 2, 35], // 谐波电流 - 60-80%
|
||||
[3, 3, 40], // 电压偏差 - 60-80%
|
||||
[3, 4, 35] // 三相不平衡 - 60-80%
|
||||
],
|
||||
data: seriesData.filter((item: any) => item[0] === 3),
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
@@ -487,13 +336,7 @@ const echartList = ref({
|
||||
{
|
||||
type: 'bar3D',
|
||||
name: '80-100%',
|
||||
data: [
|
||||
[4, 0, 25], // 闪变 - 80-100%
|
||||
[4, 1, 35], // 谐波电压 - 80-100%
|
||||
[4, 2, 40], // 谐波电流 - 80-100%
|
||||
[4, 3, 45], // 电压偏差 - 80-100%
|
||||
[4, 4, 42] // 三相不平衡 - 80-100%
|
||||
],
|
||||
data: seriesData.filter((item: any) => item[0] === 4),
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false
|
||||
@@ -516,234 +359,88 @@ const echartList = ref({
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const echartList1 = ref({
|
||||
title: {
|
||||
text: '越限时间概率分布'
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
// name: '时间',
|
||||
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
yAxis: {
|
||||
name: '次' // 给X轴加单位
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
name: '闪变',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 10],
|
||||
['2025-10-16 07:15:00', 10],
|
||||
['2025-10-16 07:30:00', 10],
|
||||
['2025-10-16 07:45:00', 10],
|
||||
['2025-10-16 08:00:00', 30],
|
||||
['2025-10-16 08:15:00', 50],
|
||||
['2025-10-16 08:30:00', 60],
|
||||
['2025-10-16 08:45:00', 70],
|
||||
['2025-10-16 09:00:00', 100],
|
||||
['2025-10-16 09:15:00', 120],
|
||||
['2025-10-16 09:30:00', 130],
|
||||
['2025-10-16 09:45:00', 140],
|
||||
['2025-10-16 10:00:00', 160],
|
||||
['2025-10-16 10:15:00', 160],
|
||||
['2025-10-16 10:30:00', 130],
|
||||
['2025-10-16 10:45:00', 120],
|
||||
['2025-10-16 11:00:00', 140],
|
||||
['2025-10-16 11:15:00', 80],
|
||||
['2025-10-16 11:30:00', 70],
|
||||
['2025-10-16 11:45:00', 90],
|
||||
['2025-10-16 12:00:00', 60],
|
||||
['2025-10-16 12:15:00', 60],
|
||||
['2025-10-16 12:30:00', 60],
|
||||
['2025-10-16 12:45:00', 60]
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
name: '谐波电压',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 1],
|
||||
['2025-10-16 07:15:00', 1],
|
||||
['2025-10-16 07:30:00', 1],
|
||||
['2025-10-16 07:45:00', 1],
|
||||
['2025-10-16 08:00:00', 3],
|
||||
['2025-10-16 08:15:00', 5],
|
||||
['2025-10-16 08:30:00', 6],
|
||||
['2025-10-16 08:45:00', 7],
|
||||
['2025-10-16 09:00:00', 10],
|
||||
['2025-10-16 09:15:00', 12],
|
||||
['2025-10-16 09:30:00', 13],
|
||||
['2025-10-16 09:45:00', 14],
|
||||
['2025-10-16 10:00:00', 16],
|
||||
['2025-10-16 10:15:00', 16],
|
||||
['2025-10-16 10:30:00', 13],
|
||||
['2025-10-16 10:45:00', 12],
|
||||
['2025-10-16 11:00:00', 14],
|
||||
['2025-10-16 11:15:00', 8],
|
||||
['2025-10-16 11:30:00', 7],
|
||||
['2025-10-16 11:45:00', 9],
|
||||
['2025-10-16 12:00:00', 6],
|
||||
['2025-10-16 12:15:00', 6],
|
||||
['2025-10-16 12:30:00', 6],
|
||||
['2025-10-16 12:45:00', 6]
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
name: '谐波电流',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 19],
|
||||
['2025-10-16 07:15:00', 19],
|
||||
['2025-10-16 07:30:00', 19],
|
||||
['2025-10-16 07:45:00', 19],
|
||||
['2025-10-16 08:00:00', 39],
|
||||
['2025-10-16 08:15:00', 59],
|
||||
['2025-10-16 08:30:00', 69],
|
||||
['2025-10-16 08:45:00', 79],
|
||||
['2025-10-16 09:00:00', 109],
|
||||
['2025-10-16 09:15:00', 129],
|
||||
['2025-10-16 09:30:00', 139],
|
||||
['2025-10-16 09:45:00', 149],
|
||||
['2025-10-16 10:00:00', 169],
|
||||
['2025-10-16 10:15:00', 169],
|
||||
['2025-10-16 10:30:00', 139],
|
||||
['2025-10-16 10:45:00', 129],
|
||||
['2025-10-16 11:00:00', 149],
|
||||
['2025-10-16 11:15:00', 89],
|
||||
['2025-10-16 11:30:00', 79],
|
||||
['2025-10-16 11:45:00', 99],
|
||||
['2025-10-16 12:00:00', 69],
|
||||
['2025-10-16 12:15:00', 69],
|
||||
['2025-10-16 12:30:00', 69],
|
||||
['2025-10-16 12:45:00', 69]
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
name: '电压偏差',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 12],
|
||||
['2025-10-16 07:15:00', 12],
|
||||
['2025-10-16 07:30:00', 12],
|
||||
['2025-10-16 07:45:00', 12],
|
||||
['2025-10-16 08:00:00', 32],
|
||||
['2025-10-16 08:15:00', 52],
|
||||
['2025-10-16 08:30:00', 62],
|
||||
['2025-10-16 08:45:00', 72],
|
||||
['2025-10-16 09:00:00', 112],
|
||||
['2025-10-16 09:15:00', 122],
|
||||
['2025-10-16 09:30:00', 122],
|
||||
['2025-10-16 09:45:00', 152],
|
||||
['2025-10-16 10:00:00', 122],
|
||||
['2025-10-16 10:15:00', 112],
|
||||
['2025-10-16 10:30:00', 132],
|
||||
['2025-10-16 10:45:00', 122],
|
||||
['2025-10-16 11:00:00', 142],
|
||||
['2025-10-16 11:15:00', 82],
|
||||
['2025-10-16 11:30:00', 72],
|
||||
['2025-10-16 11:45:00', 92],
|
||||
['2025-10-16 12:00:00', 62],
|
||||
['2025-10-16 12:15:00', 62],
|
||||
['2025-10-16 12:30:00', 62],
|
||||
['2025-10-16 12:45:00', 62]
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
name: '三相不平衡',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 10],
|
||||
['2025-10-16 07:15:00', 10],
|
||||
['2025-10-16 07:30:00', 10],
|
||||
['2025-10-16 07:45:00', 10],
|
||||
['2025-10-16 08:00:00', 30],
|
||||
['2025-10-16 08:15:00', 50],
|
||||
['2025-10-16 08:30:00', 60],
|
||||
['2025-10-16 08:45:00', 70],
|
||||
['2025-10-16 09:00:00', 100],
|
||||
['2025-10-16 09:15:00', 120],
|
||||
['2025-10-16 09:30:00', 130],
|
||||
['2025-10-16 09:45:00', 140],
|
||||
['2025-10-16 10:00:00', 160],
|
||||
['2025-10-16 10:15:00', 160],
|
||||
['2025-10-16 10:30:00', 130],
|
||||
['2025-10-16 10:45:00', 120],
|
||||
['2025-10-16 11:00:00', 140],
|
||||
['2025-10-16 11:15:00', 80],
|
||||
['2025-10-16 11:30:00', 70],
|
||||
['2025-10-16 11:45:00', 90],
|
||||
['2025-10-16 12:00:00', 60],
|
||||
['2025-10-16 12:15:00', 60],
|
||||
['2025-10-16 12:30:00', 60],
|
||||
['2025-10-16 12:45:00', 60]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/limitRateDetailD/limitTimeProbabilityData',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
setTime()
|
||||
// 只有当 lineList 已加载且有数据时才设置默认 lineId
|
||||
if (!tableStore.table.params.lineId && lineList.value && lineList.value.length > 0) {
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
// 处理返回的数据,将其转换为图表所需格式
|
||||
const indexNames: any = [...new Set(tableStore.table.data.map((item: any) => item.indexName))]
|
||||
const timePeriods = [...new Set(tableStore.table.data.map((item: any) => item.timePeriod))]
|
||||
|
||||
// 构建系列数据
|
||||
const seriesData = indexNames.map((indexName: string) => {
|
||||
const dataIndex = tableStore.table.data.filter((item: any) => item.indexName === indexName)
|
||||
return {
|
||||
name: indexName,
|
||||
type: 'line',
|
||||
symbol: 'none',
|
||||
data: dataIndex.map((item: any) => [item.timePeriod, item.times])
|
||||
}
|
||||
})
|
||||
|
||||
echartList1.value = {
|
||||
title: {
|
||||
text: '越限时间概率分布'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: indexNames
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
name: '时间段',
|
||||
data: timePeriods
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
// name: '次数'
|
||||
},
|
||||
series: seriesData
|
||||
}
|
||||
initProbabilityData()
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
tableStore.table.params.searchValue = '1'
|
||||
provide('tableRef', tableRef)
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
initLineList()
|
||||
})
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
@@ -751,12 +448,12 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,709 @@
|
||||
<template>
|
||||
<el-dialog draggable title="趋势图" v-model="dialogVisible" append-to-body width="70%">
|
||||
<!-- 总体指标占比详情谐波含有率 -->
|
||||
<div>
|
||||
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
<el-form-item>
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计指标" label-width="80px">
|
||||
<el-select
|
||||
multiple
|
||||
:multiple-limit="2"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
v-model="searchForm.index"
|
||||
placeholder="请选择统计指标"
|
||||
@change="onIndexChange($event)"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indexOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.dataLevel" @change="init()">
|
||||
<el-radio-button label="一次值" value="Primary" />
|
||||
<el-radio-button label="二次值" value="Secondary" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
style="min-width: 120px !important"
|
||||
placeholder="请选择"
|
||||
v-model="searchForm.valueType"
|
||||
filterable
|
||||
>
|
||||
<el-option value="max" label="最大值"></el-option>
|
||||
<el-option value="min" label="最小值"></el-option>
|
||||
<el-option value="avg" label="平均值"></el-option>
|
||||
<el-option value="cp95" label="cp95"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div
|
||||
class="history_count"
|
||||
v-for="(item, index) in countData"
|
||||
:key="index"
|
||||
v-show="item.countOptions.length != 0"
|
||||
>
|
||||
<span class="mr12">
|
||||
{{ item.name.includes('次数') ? item.name : item.name + '谐波次数' }}
|
||||
</span>
|
||||
<el-select
|
||||
v-model="item.count"
|
||||
@change="onCountChange($event, index)"
|
||||
placeholder="请选择谐波次数"
|
||||
style="width: 100px"
|
||||
class="mr20"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="vv in item.countOptions"
|
||||
:key="vv"
|
||||
:label="vv"
|
||||
:value="vv"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
|
||||
<el-button :type="timeControl ? 'primary' : ''" icon="el-icon-Sort" @click="setTimeControl">
|
||||
缺失数据
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="history_chart" :style="pageHeight" v-loading="loading">
|
||||
<MyEchart
|
||||
ref="historyChart"
|
||||
:options="echartsData"
|
||||
v-if="showEchart"
|
||||
/>
|
||||
<el-empty :style="pageHeight" v-else description="暂无数据" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { queryStatistical } from '@/api/system-boot/csstatisticalset'
|
||||
import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { trendData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { color } from '@/components/echarts/color'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const dictData = useDictData()
|
||||
defineOptions({
|
||||
// name: 'govern/device/control'
|
||||
})
|
||||
const props = defineProps({
|
||||
TrendList: {
|
||||
type: Array
|
||||
}
|
||||
})
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
// console.log("🚀 ~ props:", props.TrendList)
|
||||
const showEchart = ref(true)
|
||||
const num = ref(0)
|
||||
const timeControl = ref(false)
|
||||
//值类型
|
||||
const pageHeight = ref(mainHeight(57 * 1.6, 1.6))
|
||||
const loading = ref(true)
|
||||
const searchForm: any = ref({})
|
||||
const tableHeaderRef = ref()
|
||||
const typeOptions = [
|
||||
{
|
||||
name: '平均值',
|
||||
id: 'avg'
|
||||
},
|
||||
{
|
||||
name: '最大值',
|
||||
id: 'max'
|
||||
},
|
||||
{
|
||||
name: '最小值',
|
||||
id: 'min'
|
||||
},
|
||||
{
|
||||
name: 'CP95值',
|
||||
id: 'cp95'
|
||||
}
|
||||
]
|
||||
searchForm.value = {
|
||||
index: [],
|
||||
type: typeOptions[0].id,
|
||||
count: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
dataLevel: 'Primary',
|
||||
valueType: 'avg'
|
||||
}
|
||||
//统计指标
|
||||
const indexOptions: any = ref([])
|
||||
//谐波次数
|
||||
const countOptions: any = ref([])
|
||||
// Harmonic_Type
|
||||
// portable-harmonic
|
||||
const legendDictList: any = ref([])
|
||||
|
||||
const initCode = (field: string, title: string) => {
|
||||
queryByCode('steady_state_limit_trend').then(res => {
|
||||
queryCsDictTree(res.data.id).then(item => {
|
||||
//排序
|
||||
indexOptions.value = item.data.sort((a: any, b: any) => {
|
||||
return a.sort - b.sort
|
||||
})
|
||||
const titleMap: Record<string, number> = {
|
||||
flickerOvertime: 0,
|
||||
uaberranceOvertime: 3,
|
||||
ubalanceOvertime: 4,
|
||||
freqDevOvertime: 5
|
||||
}
|
||||
|
||||
let defaultIndex = 0 // 默认值
|
||||
|
||||
if (field in titleMap) {
|
||||
defaultIndex = titleMap[field]
|
||||
} else if (field.includes('uharm')) {
|
||||
defaultIndex = 1
|
||||
} else if (field.includes('iharm')) {
|
||||
defaultIndex = 2
|
||||
}
|
||||
|
||||
searchForm.value.index[0] = indexOptions.value[defaultIndex].id
|
||||
})
|
||||
queryStatistical(res.data.id).then(vv => {
|
||||
legendDictList.value = vv.data
|
||||
indexOptions.value.map((item: any, index: any) => {
|
||||
if (!countDataCopy.value[index]) {
|
||||
countDataCopy.value[index] = {
|
||||
index: item.id,
|
||||
countOptions: [],
|
||||
count: [],
|
||||
name: indexOptions.value.find((vv: any) => {
|
||||
return vv.id == item.id
|
||||
})?.name
|
||||
}
|
||||
}
|
||||
legendDictList.value?.selectedList?.map((vv: any, vvs: any) => {
|
||||
//查找相等的指标
|
||||
if (item.id == vv.dataType) {
|
||||
vv.eleEpdPqdVOS.map((kk: any, kks: any) => {
|
||||
if (kk.harmStart && kk.harmEnd) {
|
||||
range(0, 0, 0)
|
||||
|
||||
if (kk.showName == '间谐波电压含有率') {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
||||
(item: any) => {
|
||||
return item - 0.5
|
||||
}
|
||||
)
|
||||
} else {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
}
|
||||
if (title && countDataCopy.value[index].countOptions.includes(Number(title))) {
|
||||
countDataCopy.value[index].count = Number(title)
|
||||
} else if (title && countDataCopy.value[index].countOptions.includes(title)) {
|
||||
countDataCopy.value[index].count = title
|
||||
} else if (
|
||||
!countDataCopy.value[index].count ||
|
||||
countDataCopy.value[index].count.length == 0
|
||||
) {
|
||||
// 只有当count为空时才设置默认值
|
||||
countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
nextTick(() => {
|
||||
formatCountOptions()
|
||||
})
|
||||
init()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const chartsList = ref<any>([])
|
||||
const chartTitle: any = ref('')
|
||||
const echartsData = ref<any>(null)
|
||||
//加载echarts图表
|
||||
//历史趋势数据
|
||||
const historyDataList: any = ref([])
|
||||
const range = (start: any, end: any, step: any) => {
|
||||
return Array.from({ length: (end - start) / step + 1 }, (_, i) => start + i * step)
|
||||
}
|
||||
//获取请求趋势数据参数
|
||||
const trendRequestData = ref()
|
||||
const getTrendRequest = (val: any) => {
|
||||
trendRequestData.value = val
|
||||
// init()
|
||||
}
|
||||
//初始化趋势图
|
||||
const headerRef = ref()
|
||||
const datePickerRef = ref()
|
||||
const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
|
||||
const init = async () => {
|
||||
loading.value = true
|
||||
// 选择指标的时候切换legend内容和data数据
|
||||
let list: any = []
|
||||
legendDictList.value?.selectedList?.map((item: any) => {
|
||||
searchForm.value.index.map((vv: any) => {
|
||||
if (item.dataType == vv) {
|
||||
list.push(item.eleEpdPqdVOS)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//颜色数组
|
||||
const colorList = color
|
||||
//选择的指标使用方法处理
|
||||
formatCountOptions()
|
||||
//查询历史趋势
|
||||
historyDataList.value = []
|
||||
chartTitle.value = ''
|
||||
|
||||
searchForm.value.index.map((item: any, indexs: any) => {
|
||||
indexOptions.value.map((vv: any) => {
|
||||
if (vv.id == item) {
|
||||
chartTitle.value += indexs == searchForm.value.index.length - 1 ? vv.name : vv.name + '/'
|
||||
}
|
||||
})
|
||||
})
|
||||
let lists: any = []
|
||||
let frequencys: any = null
|
||||
countData.value.map((item: any, index: any) => {
|
||||
if (item.name.includes('谐波含有率')) {
|
||||
frequencys = item.count
|
||||
} else {
|
||||
frequencys = ''
|
||||
}
|
||||
lists[index] = {
|
||||
statisticalId: item.index,
|
||||
frequency: frequencys !== null && frequencys !== undefined ? String(frequencys) : ''
|
||||
}
|
||||
})
|
||||
let obj = {
|
||||
//...trendRequestData.value,
|
||||
lineId: trendRequestData.value.lineId,
|
||||
list: lists,
|
||||
dataLevel: searchForm.value.dataLevel,
|
||||
valueType: searchForm.value.valueType,
|
||||
searchBeginTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
||||
searchEndTime: datePickerRef.value && datePickerRef.value.timeValue[1]
|
||||
}
|
||||
if (searchForm.value.index.length == 0) {
|
||||
ElMessage.warning('请选择统计指标')
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
if (obj.list.length != 0) {
|
||||
try {
|
||||
showEchart.value = true
|
||||
await trendData(obj)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
if (res.data.length == 0) {
|
||||
loading.value = false
|
||||
showEchart.value = false
|
||||
return
|
||||
}
|
||||
historyDataList.value = res.data
|
||||
chartsList.value = JSON.parse(JSON.stringify(res.data))
|
||||
loading.value = false
|
||||
setEchart()
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
loading.value = false
|
||||
})
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
const setEchart = () => {
|
||||
loading.value = true
|
||||
echartsData.value = {}
|
||||
//icon图标替换legend图例
|
||||
|
||||
// y轴单位数组
|
||||
let unitList: any = []
|
||||
|
||||
let groupedData = chartsList.value.reduce((acc: any, item: any) => {
|
||||
let key = ''
|
||||
if (item.phase == null) {
|
||||
key = item.unit
|
||||
} else {
|
||||
key = item.anotherName
|
||||
}
|
||||
|
||||
if (!acc[key]) {
|
||||
acc[key] = []
|
||||
}
|
||||
acc[key].push(item)
|
||||
return acc
|
||||
}, {})
|
||||
let result = Object.values(groupedData)
|
||||
if (chartsList.value.length > 0) {
|
||||
unitList = result.map((item: any) => {
|
||||
return item[0].unit
|
||||
})
|
||||
}
|
||||
|
||||
echartsData.value = {
|
||||
legend: {
|
||||
itemWidth: 20,
|
||||
itemHeight: 20,
|
||||
itemStyle: { opacity: 0 }, //去圆点
|
||||
type: 'scroll', // 开启滚动分页
|
||||
// orient: 'vertical', // 垂直排列
|
||||
top: 5,
|
||||
right: 70
|
||||
// width: 550,
|
||||
// height: 50
|
||||
},
|
||||
grid: {
|
||||
top: '80px'
|
||||
},
|
||||
tooltip: {
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
formatter(params: any) {
|
||||
const xname = params[0].value[0]
|
||||
let str = `${xname}<br>`
|
||||
params.forEach((el: any, index: any) => {
|
||||
let marker = ''
|
||||
|
||||
if (el.value[3] == 'dashed') {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
marker += `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
|
||||
}
|
||||
} else {
|
||||
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
|
||||
}
|
||||
let unit = el.value[2] ? el.value[2] : ''
|
||||
str += `${marker}${el.seriesName.split('(')[0]}:${el.value[1]}${unit}
|
||||
<br>`
|
||||
})
|
||||
return str
|
||||
}
|
||||
},
|
||||
color: ['#DAA520', '#2E8B57', '#A52a2a', ...color],
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: [{}],
|
||||
toolbox: {
|
||||
featureProps: {
|
||||
myTool1: {
|
||||
show: true,
|
||||
title: '下载csv',
|
||||
icon: 'path://M588.8 551.253333V512H352v39.253333h236.373333z m0 78.933334v-39.253334H352v39.253334h236.373333z m136.533333 78.933333V334.933333l-157.866666-157.866666H273.066667A59.306667 59.306667 0 0 0 213.333333 236.373333v551.253334a59.306667 59.306667 0 0 0 59.306667 59.306666h274.773333v42.666667H853.333333v-180.48zM568.746667 234.666667l100.266666 100.693333h-81.066666a20.053333 20.053333 0 0 1-19.626667-20.053333z m-20.48 573.013333H273.066667a19.2 19.2 0 0 1-17.493334-19.626667V236.373333a19.2 19.2 0 0 1 19.626667-19.626666h256v98.133333a58.88 58.88 0 0 0 58.88 59.306667h96.426667v334.933333h-98.133334v-39.68H352v39.68h196.266667z m100.266666 23.04a37.973333 37.973333 0 0 1-32 15.786667 38.826667 38.826667 0 0 1-32.426666-15.786667 53.76 53.76 0 0 1-10.24-32.853333 42.666667 42.666667 0 0 1 42.666666-47.786667 35.84 35.84 0 0 1 37.546667 29.866667h-12.8a23.893333 23.893333 0 0 0-24.746667-19.2c-17.066667 0-29.013333 14.08-29.013333 35.84s11.52 37.546667 28.586667 37.546666a26.453333 26.453333 0 0 0 26.453333-25.6h12.8a39.253333 39.253333 0 0 1-7.253333 22.186667z m59.733334 15.786667a35.84 35.84 0 0 1-40.106667-34.56H682.666667a23.893333 23.893333 0 0 0 26.88 23.04c12.8 0 22.613333-6.4 22.613333-15.786667s-4.266667-11.52-14.506667-13.653333l-21.333333-5.12c-17.066667-4.266667-24.32-11.52-24.32-23.893334s12.8-26.453333 34.133333-26.453333a31.573333 31.573333 0 0 1 35.413334 30.293333h-13.653334a19.626667 19.626667 0 0 0-22.613333-18.773333c-12.8 0-20.48 5.12-20.48 12.8s5.12 11.093333 17.066667 13.653333l14.933333 2.986667a42.666667 42.666667 0 0 1 20.906667 8.96 23.893333 23.893333 0 0 1 7.68 17.92c-0.426667 17.066667-14.506667 28.16-37.12 28.16z m88.746666 0h-14.506666l-32.426667-92.16h14.08l19.626667 59.733333 6.4 20.053333c0-9.386667 3.413333-12.8 5.546666-20.053333l19.2-59.733333h14.08z',
|
||||
onclick: e => {
|
||||
// console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data))
|
||||
|
||||
let list = echartsData.value.options.series?.map((item: any) => item.data)
|
||||
let dataList = list[0]?.map((item: any, index: any) => {
|
||||
let value = [item[0], item[1]]
|
||||
list.forEach((item1: any, index1: any) => {
|
||||
if (index1 > 0) {
|
||||
value.push(item1 && item1[index] ? item1[index][1] : null)
|
||||
}
|
||||
})
|
||||
|
||||
return value
|
||||
})
|
||||
exportCSV(
|
||||
echartsData.value.options.series.map((item: any) => item.name),
|
||||
dataList,
|
||||
'历史趋势.csv'
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
options: {
|
||||
series: []
|
||||
}
|
||||
}
|
||||
// console.log("🚀 ~ unitList.forEach ~ unitList:", unitList)
|
||||
|
||||
if (chartsList.value.length > 0) {
|
||||
let yData: any = []
|
||||
echartsData.value.yAxis = []
|
||||
let setList = [...new Set(unitList)]
|
||||
|
||||
setList.forEach((item: any, index: any) => {
|
||||
if (index > 2) {
|
||||
echartsData.value.grid.right = (index - 1) * 80
|
||||
}
|
||||
yData.push([])
|
||||
let right = {
|
||||
position: 'right',
|
||||
offset: (index - 1) * 80
|
||||
}
|
||||
// console.log("🚀 ~ unitList.forEach ~ right.index:", index)
|
||||
echartsData.value.yAxis.push({
|
||||
name: item,
|
||||
yAxisIndex: index,
|
||||
splitNumber: 5,
|
||||
minInterval: 1,
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
...(index > 0 ? right : null)
|
||||
})
|
||||
})
|
||||
// console.log("🚀 ~ result.forEach ~ result:", result)
|
||||
// '电压负序分量', '电压正序分量', '电压零序分量'
|
||||
let ABCName = [
|
||||
...new Set(
|
||||
chartsList.value.map((item: any) => {
|
||||
return item.anotherName == '电压负序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName == '电压正序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName == '电压零序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName
|
||||
})
|
||||
)
|
||||
]
|
||||
// console.log("🚀 ~ .then ~ ABCName:", ABCName)
|
||||
result.forEach((item: any, index: any) => {
|
||||
let yMethodList: any = []
|
||||
|
||||
let ABCList = Object.values(
|
||||
item.reduce((acc, item) => {
|
||||
let key = ''
|
||||
if (item.phase == null) {
|
||||
key = item.anotherName
|
||||
} else {
|
||||
key = item.phase
|
||||
}
|
||||
|
||||
if (!acc[key]) {
|
||||
acc[key] = []
|
||||
}
|
||||
acc[key].push(item)
|
||||
return acc
|
||||
}, {})
|
||||
)
|
||||
// console.log("🚀 ~ ABCList.forEach ~ ABCList:", ABCList)
|
||||
|
||||
ABCList.forEach((kk: any) => {
|
||||
let colorName = kk[0].phase?.charAt(0).toUpperCase()
|
||||
let lineS = ABCName.findIndex(
|
||||
item =>
|
||||
item ===
|
||||
(kk[0].anotherName == '电压负序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName == '电压正序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName == '电压零序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName)
|
||||
)
|
||||
|
||||
let seriesList: any = []
|
||||
kk.forEach((cc: any) => {
|
||||
if (cc.statisticalData !== null) {
|
||||
yData[setList.indexOf(kk[0].unit)].push(cc.statisticalData?.toFixed(2))
|
||||
}
|
||||
|
||||
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
|
||||
})
|
||||
// console.log(kk);
|
||||
|
||||
echartsData.value.options.series.push({
|
||||
name: kk[0].phase ? kk[0].phase + '相' + kk[0].anotherName : kk[0].anotherName,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
color:
|
||||
colorName == 'A' ? '#DAA520' : colorName == 'B' ? '#2E8B57' : colorName == 'C' ? '#A52a2a' : '',
|
||||
symbol: 'none',
|
||||
// data: seriesList,
|
||||
data: timeControl.value ? completeTimeSeries(seriesList) : seriesList,
|
||||
lineStyle: lineStyle[lineS],
|
||||
yAxisIndex: setList.indexOf(kk[0].unit)
|
||||
})
|
||||
})
|
||||
})
|
||||
yData.forEach((item: any, index: any) => {
|
||||
let [min, max] = yMethod(item)
|
||||
echartsData.value.yAxis[index].min = min
|
||||
echartsData.value.yAxis[index].max = max
|
||||
})
|
||||
// console.log("🚀 ~ result.forEach ~ echartsData.value:", echartsData.value)
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
const setTimeControl = () => {
|
||||
timeControl.value = !timeControl.value
|
||||
setEchart()
|
||||
}
|
||||
|
||||
const selectChange = (flag: boolean, height: any) => {
|
||||
|
||||
pageHeight.value = mainHeight(height * 1.6, 1.6)
|
||||
}
|
||||
//导出
|
||||
const historyChart = ref()
|
||||
|
||||
const countData: any = ref([])
|
||||
const countDataCopy: any = ref([])
|
||||
|
||||
//根据选择的指标处理谐波次数
|
||||
const formatCountOptions = () => {
|
||||
countData.value = []
|
||||
if (searchForm.value.index.length != 0) {
|
||||
searchForm.value.index.forEach((item: any, index: any) => {
|
||||
countDataCopy.value.forEach((vv: any, vvs: any) => {
|
||||
if (vv.index == item) {
|
||||
countData.value.push(vv)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
countData.value.map((item: any, key: any) => {
|
||||
if (item.name == '谐波电流有效值') {
|
||||
item.name = '谐波电流次数'
|
||||
} else if (item.name == '谐波电压含有率') {
|
||||
item.name = '谐波电压次数'
|
||||
} else if (item.name == '间谐波电压含有率') {
|
||||
item.name = '间谐波电压次数'
|
||||
}
|
||||
})
|
||||
}
|
||||
// setTimeout(() => {
|
||||
// tableHeaderRef.value.computedSearchRow()
|
||||
// }, 500)
|
||||
}
|
||||
// 判断下拉框是否存在
|
||||
const onCountChange = (val: any, index: any) => {
|
||||
if (val.length == 0) {
|
||||
countData.value[index].count = countData.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
const flag = ref(true)
|
||||
const onIndexChange = (val: any) => {
|
||||
num.value += 1
|
||||
let pp: any = []
|
||||
indexOptions.value.forEach((item: any) => {
|
||||
const filteredResult = val.filter(vv => item.id == vv)
|
||||
if (filteredResult.length > 0) {
|
||||
pp.push(filteredResult[0])
|
||||
}
|
||||
})
|
||||
searchForm.value.index = pp
|
||||
flag.value = true
|
||||
formatCountOptions()
|
||||
}
|
||||
watch(
|
||||
() => searchForm.value.index,
|
||||
(val: any, oldval: any) => {},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
|
||||
const openDialog = async (row: any, field: any, title: any) => {
|
||||
dialogVisible.value = true
|
||||
trendRequestData.value = row
|
||||
|
||||
nextTick(() => {
|
||||
// 默认当天
|
||||
datePickerRef.value.setInterval(5)
|
||||
datePickerRef.value.timeValue = [row.time, row.time]
|
||||
initCode(field, title)
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ getTrendRequest, openDialog })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.history_header {
|
||||
display: flex;
|
||||
|
||||
// flex-wrap: wrap;
|
||||
#history_select {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
// justify-content: flex-start;
|
||||
// overflow-x: auto;
|
||||
height: auto;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.el-form-item {
|
||||
flex: none !important;
|
||||
// max-width: 380px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
// #history_select::-webkit-scrollbar {
|
||||
// width: 0 !important;
|
||||
// display: none !important;
|
||||
// }
|
||||
|
||||
.history_searchBtn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.history_chart {
|
||||
width: 100%;
|
||||
|
||||
// flex: 1;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.history_count {
|
||||
.el-select {
|
||||
min-width: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,20 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 综合评估详情 -->
|
||||
<el-dialog draggable title="指标合格率统计" v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false">
|
||||
<!-- 指标越限详情 -->
|
||||
<el-dialog draggable title="指标越限详情" v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点名称">
|
||||
<el-form-item label="监测点">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请选择监测点名称"
|
||||
v-model="tableStore.table.params.lineId"
|
||||
placeholder="请选择监测点"
|
||||
style="width: 150px"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -23,43 +24,47 @@
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="height"></Table>
|
||||
</el-dialog>
|
||||
<!-- 谐波电流、谐波电压占有率 -->
|
||||
<HarmonicRatio ref="harmonicRatioRef" />
|
||||
<HarmonicRatio
|
||||
ref="harmonicRatioRef"
|
||||
@close="onHarmonicRatioClose"
|
||||
v-if="dialogFlag"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide } from 'vue'
|
||||
import { ref, provide,nextTick } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import HarmonicRatio from '@/components/cockpit/listOfMainMonitoringPoints/components/harmonicRatio.vue'
|
||||
import HarmonicRatio from '@/components/cockpit/indicatorFittingChart/components/harmonicRatio.vue'
|
||||
import { cslineList } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
const harmonicRatioRef: any = ref(null)
|
||||
const options = [
|
||||
{
|
||||
value: '35kV进线',
|
||||
label: '35kV进线'
|
||||
}
|
||||
]
|
||||
|
||||
const dialogFlag = ref(false)
|
||||
|
||||
const options = ref()
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const tableHeaderRef = ref()
|
||||
const loop50 = (key: string) => {
|
||||
let list: any[] = []
|
||||
for (let i = 2; i < 51; i++) {
|
||||
for (let i = 2; i < 26; i++) {
|
||||
list.push({
|
||||
title: i + '次',
|
||||
// field: key + i,
|
||||
field: 'flicker',
|
||||
width: '80',
|
||||
// render: 'customTemplate',
|
||||
// customTemplate: (row: any) => {
|
||||
// return `<span style='cursor: pointer;text-decoration: underline;'>${row.flicker}</span>`
|
||||
// }
|
||||
field: key + i + 'Overtime',
|
||||
width: '60',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
|
||||
}
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
url: '/cs-harmonic-boot/mainLine/statLimitRateDetails',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
@@ -76,82 +81,110 @@ const tableStore: any = new TableStore({
|
||||
{
|
||||
title: '日期',
|
||||
field: 'time',
|
||||
width: '150'
|
||||
width: '150',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'name',
|
||||
field: 'lineName',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '闪变越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '80',
|
||||
// render: 'customTemplate',
|
||||
// customTemplate: (row: any) => {
|
||||
// return `<span style='cursor: pointer;text-decoration: underline;'>${row.flicker}</span>`
|
||||
// }
|
||||
field: 'flickerOvertime',
|
||||
width: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电压越限(分钟)',
|
||||
children: loop50('voltage')
|
||||
children: loop50('uharm')
|
||||
},
|
||||
{
|
||||
title: '谐波电流越限(分钟)',
|
||||
children: loop50('harmonicCurrent')
|
||||
children: loop50('iharm')
|
||||
},
|
||||
{
|
||||
title: '三相不平衡度越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'ubalanceOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压偏差越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'uaberranceOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.uaberranceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '频率偏差越限(分钟)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'freqDevOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.freqDevOvertime}</span>`
|
||||
}
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {},
|
||||
beforeSearchFun: () => {
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
const open = async (row: any) => {
|
||||
tableStore.table.params.sortBy = ''
|
||||
tableStore.table.params.orderBy = ''
|
||||
const open = async (row: any,searchBeginTime:any,searchEndTime:any) => {
|
||||
dialogVisible.value = true
|
||||
initCSlineList()
|
||||
tableStore.table.params.lineId = row.lineId
|
||||
|
||||
nextTick(() => {
|
||||
tableHeaderRef.value.setTimeInterval([searchBeginTime, searchEndTime])
|
||||
tableStore.table.params.searchBeginTime =searchBeginTime
|
||||
tableStore.table.params.searchEndTime = searchEndTime
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name' && column.field != 'time') {
|
||||
harmonicRatioRef.value.openDialog(row)
|
||||
dialogFlag.value = true
|
||||
dialogVisible.value = false
|
||||
nextTick(() => {
|
||||
harmonicRatioRef.value.openDialog(row,column.field,column.title.replace(/次/g, ""))
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 谐波弹窗关闭时的回调
|
||||
const onHarmonicRatioClose = () => {
|
||||
dialogFlag.value = false
|
||||
// 重新打开指标越限详情弹窗
|
||||
nextTick(() => {
|
||||
dialogVisible.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const initCSlineList = async () => {
|
||||
const res = await cslineList({})
|
||||
options.value = res.data
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--主要监测点列表 -->
|
||||
<TableHeader
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
v-if="fullscreen"
|
||||
datePicker
|
||||
:initialInterval="getInitialInterval()"
|
||||
:initialTimeValue="getInitialTimeValue()"
|
||||
>
|
||||
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" @selectChange="selectChange" v-if="fullscreen" datePicker ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="tableStore.table.params.keywords" clearable placeholder="请输关键字" />
|
||||
@@ -18,29 +11,30 @@
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`"
|
||||
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? -58 : 56}px )`"
|
||||
></Table>
|
||||
<!-- 指标越限详情 -->
|
||||
<OverLimitDetails ref="OverLimitDetailsRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
import OverLimitDetails from '@/components/cockpit/indicatorFittingChart/components/overLimitDetails.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
const OverLimitDetailsRef = ref()
|
||||
const headerHeight = ref(57)
|
||||
@@ -48,16 +42,7 @@ const headerHeight = ref(57)
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
}
|
||||
}
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
@@ -71,11 +56,20 @@ const fullscreen = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/harmonic-boot/mainLine/list',
|
||||
url: '/cs-harmonic-boot/mainLine/list',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
showPage: fullscreen.value ? true : false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [
|
||||
{
|
||||
@@ -107,24 +101,10 @@ const tableStore: any = new TableStore({
|
||||
minWidth: '70'
|
||||
},
|
||||
|
||||
{ title: '主要存在的电能质量问题', field: 'problems', minWidth: '150' }
|
||||
{ title: '主要存在的电能质量问题', field: 'problems', minWidth: '150', showOverflow: true }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
@@ -139,49 +119,45 @@ provide('tableStore', tableStore)
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field == 'lineName') {
|
||||
console.log(row)
|
||||
OverLimitDetailsRef.value.open(row)
|
||||
OverLimitDetailsRef.value.open(
|
||||
row,
|
||||
tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
||||
tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取缓存的初始值
|
||||
const getInitialInterval = (): 3 => {
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path);
|
||||
if (cached && cached.interval !== undefined) {
|
||||
return cached.interval as 3; // 强制断言为 3 或根据实际类型调整
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
// TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
// TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
return 3; // 明确返回字面量类型 3
|
||||
};
|
||||
// 外部总的时间值
|
||||
const getInitialTimeValue = () => {
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
return cached.timeValue
|
||||
}
|
||||
}
|
||||
return prop.timeValue // 使用传入的默认值
|
||||
}
|
||||
|
||||
// 在组件挂载时设置缓存值到 DatePicker
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
const prop = defineProps({
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
width: { type: [String, Number]},
|
||||
height: { type: [String, Number]},
|
||||
timeKey: { type: [String, Number]},
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
|
||||
@@ -1,55 +1,78 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--指标拟合图 -->
|
||||
<TableHeader :showReset="false" datePicker @selectChange="selectChange" v-if="fullscreen">
|
||||
<TableHeader
|
||||
datePicker
|
||||
@selectChange="selectChange"
|
||||
v-if="fullscreen"
|
||||
ref="TableHeaderRef"
|
||||
:timeKeyList="prop.timeKey"
|
||||
>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点">
|
||||
<el-select filterable v-model="tableStore.table.params.lineId" placeholder="请选择监测点" clearable>
|
||||
<el-option
|
||||
v-for="item in lineList"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户功率">
|
||||
<el-select
|
||||
filterable
|
||||
v-model="tableStore.table.params.power"
|
||||
placeholder="请选择用户功率"
|
||||
clearable
|
||||
style="width: 130px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item in powerList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
style="min-width: 120px !important"
|
||||
placeholder="请选择"
|
||||
v-model="tableStore.table.params.valueType"
|
||||
filterable
|
||||
>
|
||||
<el-option value="max" label="最大值"></el-option>
|
||||
<el-option value="min" label="最小值"></el-option>
|
||||
<el-option value="avg" label="平均值"></el-option>
|
||||
<el-option value="cp95" label="cp95"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电能质量指标">
|
||||
<el-select
|
||||
filterable
|
||||
v-model="tableStore.table.params.indicator"
|
||||
placeholder="请选择电能质量指标"
|
||||
clearable
|
||||
style="width: 130px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indicatorList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item in indicatorList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="越限情况">
|
||||
<el-form-item>
|
||||
<div v-if="shouldShowHarmonicCount()" style="display: flex; color: var(--el-text-color-regular)">
|
||||
<span style="width: 160px">{{ getHarmonicTypeName() }}谐波次数</span>
|
||||
<el-select
|
||||
v-model="tableStore.table.params.exceedingTheLimit"
|
||||
placeholder="请选择越限情况"
|
||||
clearable
|
||||
style="width: 90px"
|
||||
v-model="tableStore.table.params.harmonicCount"
|
||||
placeholder="请选择谐波次数"
|
||||
style="min-width: 80px !important"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in exceedingTheLimitList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
v-for="num in harmonicCountOptions"
|
||||
:key="num"
|
||||
:label="num"
|
||||
:value="num"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div v-loading="tableStore.table.loading">
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
@@ -59,43 +82,39 @@
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h, computed } from 'vue'
|
||||
import { ref, onMounted, provide, reactive, watch, h, computed, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { cslineList, fittingData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const config = useConfig()
|
||||
const powerList: any = ref([
|
||||
{
|
||||
label: '三相总有功功率',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '三相总无功功率',
|
||||
value: '2'
|
||||
}
|
||||
])
|
||||
|
||||
const lineList: any = ref()
|
||||
|
||||
const powerList: any = ref()
|
||||
|
||||
const chartsList = ref<any>([])
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
@@ -117,29 +136,62 @@ const exceedingTheLimitList: any = ref([
|
||||
value: '0'
|
||||
}
|
||||
])
|
||||
const indicatorList: any = ref([
|
||||
{
|
||||
label: '谐波电压总畸变率',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '各次谐波电压',
|
||||
value: '2'
|
||||
},
|
||||
{
|
||||
label: '各次谐波电压',
|
||||
value: '3'
|
||||
},
|
||||
{
|
||||
label: '三相电压不平衡',
|
||||
value: '4'
|
||||
}
|
||||
])
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '谐波电压总畸变率越限与功率负荷曲线拟合图'
|
||||
},
|
||||
|
||||
const indicatorList = ref()
|
||||
|
||||
const initLineList = async () => {
|
||||
cslineList({}).then(res => {
|
||||
lineList.value = res.data
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
})
|
||||
}
|
||||
|
||||
const echartList = ref()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
const setEchart = () => {
|
||||
// 获取当前选择的功率和指标名称
|
||||
const powerName = powerList.value?.find((item: any) => item.id === tableStore.table.params.power)?.name || '功率'
|
||||
const indicatorName =
|
||||
indicatorList.value?.find((item: any) => item.id === tableStore.table.params.indicator)?.name || '电能质量指标'
|
||||
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: `${indicatorName}与${powerName}负荷曲线拟合图`
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: function (params: any) {
|
||||
let result = params[0].name
|
||||
params.forEach((item: any) => {
|
||||
if (item.seriesName === indicatorName) {
|
||||
// 对于电能质量指标,格式化Y轴值显示
|
||||
let valueText = ''
|
||||
if (item.value[1] == 0) {
|
||||
valueText = '不越限'
|
||||
} else if (item.value[1] == 1) {
|
||||
valueText = '越限'
|
||||
} else {
|
||||
valueText = item.value[1]
|
||||
}
|
||||
result += `<br/>${item.marker}${item.seriesName}: ${valueText}`
|
||||
} else {
|
||||
// 对于功率数据,正常显示数值
|
||||
result += `<br/>${item.marker}${item.seriesName}: ${item.value[1]}`
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
@@ -150,8 +202,25 @@ const echartList = ref({
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
yAxis: [{}, {}],
|
||||
yAxis: [
|
||||
{},
|
||||
indicatorName
|
||||
? {
|
||||
min: 0,
|
||||
max: 1,
|
||||
axisLabel: {
|
||||
formatter: function (value: number) {
|
||||
if (value === 0) {
|
||||
return '不越限'
|
||||
} else if (value === 1) {
|
||||
return '越限'
|
||||
}
|
||||
return value
|
||||
}
|
||||
}
|
||||
}
|
||||
: {}
|
||||
],
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
@@ -159,38 +228,11 @@ const echartList = ref({
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '有功功率',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 10],
|
||||
['2025-10-16 07:15:00', 10],
|
||||
['2025-10-16 07:30:00', 10],
|
||||
['2025-10-16 07:45:00', 10],
|
||||
['2025-10-16 08:00:00', 30],
|
||||
['2025-10-16 08:15:00', 50],
|
||||
['2025-10-16 08:30:00', 60],
|
||||
['2025-10-16 08:45:00', 70],
|
||||
['2025-10-16 09:00:00', 100],
|
||||
['2025-10-16 09:15:00', 120],
|
||||
['2025-10-16 09:30:00', 130],
|
||||
['2025-10-16 09:45:00', 140],
|
||||
['2025-10-16 10:00:00', 160],
|
||||
['2025-10-16 10:15:00', 160],
|
||||
['2025-10-16 10:30:00', 130],
|
||||
['2025-10-16 10:45:00', 120],
|
||||
['2025-10-16 11:00:00', 140],
|
||||
['2025-10-16 11:15:00', 80],
|
||||
['2025-10-16 11:30:00', 70],
|
||||
['2025-10-16 11:45:00', 90],
|
||||
['2025-10-16 12:00:00', 60],
|
||||
['2025-10-16 12:15:00', 60],
|
||||
['2025-10-16 12:30:00', 60],
|
||||
['2025-10-16 12:45:00', 60]
|
||||
],
|
||||
name: powerName, // 动态设置功率名称
|
||||
data: [],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
//这里是颜色
|
||||
color: function (params: any) {
|
||||
if (params.value[1] == 0 || params.value[1] == 3.14159) {
|
||||
return '#ccc'
|
||||
@@ -203,105 +245,236 @@ const echartList = ref({
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
name: '谐波总畸变率',
|
||||
name: indicatorName, // 动态设置指标名称
|
||||
type: 'line',
|
||||
step: 'end',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 0],
|
||||
['2025-10-16 07:15:00', 0],
|
||||
['2025-10-16 07:30:00', 0],
|
||||
['2025-10-16 07:45:00', 0],
|
||||
['2025-10-16 08:00:00', 0],
|
||||
['2025-10-16 08:15:00', 0.1],
|
||||
['2025-10-16 08:30:00', 0.1],
|
||||
['2025-10-16 08:45:00', 0.1],
|
||||
['2025-10-16 09:00:00', 1],
|
||||
['2025-10-16 09:15:00', 1],
|
||||
['2025-10-16 09:30:00', 1],
|
||||
['2025-10-16 09:45:00', 1],
|
||||
['2025-10-16 10:00:00', 0.8],
|
||||
['2025-10-16 10:15:00', 0.8],
|
||||
['2025-10-16 10:30:00', 0.8],
|
||||
['2025-10-16 10:45:00', 0.8],
|
||||
['2025-10-16 11:00:00', 0.8],
|
||||
['2025-10-16 11:15:00', 0.1],
|
||||
['2025-10-16 11:30:00', 0.1],
|
||||
['2025-10-16 11:45:00', 0.1],
|
||||
['2025-10-16 12:00:00', 0],
|
||||
['2025-10-16 12:15:00', 0],
|
||||
['2025-10-16 12:30:00', 0],
|
||||
['2025-10-16 12:45:00', 0]
|
||||
],
|
||||
// smooth: true,
|
||||
data: [],
|
||||
yAxisIndex: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const headerHeight = ref(57)
|
||||
const selectChange = (showSelect: any, height: any) => {
|
||||
headerHeight.value = height
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
}
|
||||
|
||||
try {
|
||||
// 用户功率数据和电能质量数据
|
||||
let powerData: any[] = []
|
||||
let qualityData: any[] = []
|
||||
|
||||
chartsList.value.forEach((item: any) => {
|
||||
// 根据统计项ID判断是功率数据还是电能质量数据
|
||||
if (item.statisticalIndex === tableStore.table.params.power) {
|
||||
powerData.push(item)
|
||||
} else if (item.statisticalIndex === tableStore.table.params.indicator) {
|
||||
qualityData.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
// 处理功率数据
|
||||
const processedPowerData = powerData.map((item: any) => {
|
||||
return [
|
||||
item.time,
|
||||
item.statisticalData !== null && item.statisticalData !== undefined
|
||||
? parseFloat(item.statisticalData.toFixed(2))
|
||||
: null
|
||||
]
|
||||
})
|
||||
|
||||
// 处理电能质量数据
|
||||
const processedQualityData = qualityData.map((item: any) => {
|
||||
return [
|
||||
item.time,
|
||||
item.statisticalData !== null && item.statisticalData !== undefined
|
||||
? parseFloat(item.statisticalData.toFixed(2))
|
||||
: null
|
||||
]
|
||||
})
|
||||
|
||||
// 检查是否有有效数据
|
||||
const hasPowerData = processedPowerData.length > 0 && processedPowerData.some(item => item[1] !== null)
|
||||
const hasQualityData = processedQualityData.length > 0 && processedQualityData.some(item => item[1] !== null)
|
||||
|
||||
// 更新图表配置
|
||||
echartList.value.options.series[0].data = processedPowerData
|
||||
echartList.value.options.series[1].data = processedQualityData
|
||||
} catch (error) {
|
||||
console.error('处理图表数据时出错:', error)
|
||||
}
|
||||
}
|
||||
|
||||
const initCode = () => {
|
||||
queryByCode('steady_state_limit_fitting').then(res => {
|
||||
queryCsDictTree(res.data.id).then(item => {
|
||||
powerList.value = item.data.filter((item: any) => {
|
||||
return item.name == '三相总无功功率' || item.name == '三相总有功功率'
|
||||
})
|
||||
|
||||
indicatorList.value = item.data.filter((item: any) => {
|
||||
return item.name != '三相总无功功率' && item.name != '三相总有功功率'
|
||||
})
|
||||
|
||||
tableStore.table.params.power = powerList.value[0].id
|
||||
tableStore.table.params.indicator = indicatorList.value[0].id
|
||||
nextTick(() => {
|
||||
// setTime()
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-device-boot/csGroup/fittingData',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
setTime()
|
||||
// 只有当 lineList 已加载且有数据时才设置默认 lineId
|
||||
if (!tableStore.table.params.lineId && lineList.value && lineList.value.length > 0) {
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
// 构建请求参数 lists
|
||||
let lists: any = []
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 处理用户功率指标
|
||||
const selectedPower = powerList.value?.find((item: any) => item.id === tableStore.table.params.power)
|
||||
if (selectedPower) {
|
||||
lists.push({
|
||||
statisticalId: tableStore.table.params.power,
|
||||
valueType: tableStore.table.params.valueType
|
||||
})
|
||||
}
|
||||
|
||||
// 处理电能质量指标
|
||||
const selectedIndicator = indicatorList.value?.find(
|
||||
(item: any) => item.id === tableStore.table.params.indicator
|
||||
)
|
||||
if (selectedIndicator) {
|
||||
let frequencys = ''
|
||||
if (selectedIndicator.name.includes('谐波含有率')) {
|
||||
frequencys = tableStore.table.params.harmonicCount
|
||||
}
|
||||
|
||||
lists.push({
|
||||
statisticalId: tableStore.table.params.indicator,
|
||||
frequency: frequencys !== null && frequencys !== undefined ? String(frequencys) : ''
|
||||
})
|
||||
}
|
||||
|
||||
// 将 lists 添加到请求参数中
|
||||
tableStore.table.params.list = lists
|
||||
tableStore.table.params.dataLevel = 'Primary'
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
// 数据加载完成后的处理
|
||||
if (tableStore.table.data) {
|
||||
chartsList.value = JSON.parse(JSON.stringify(tableStore.table.data))
|
||||
setEchart()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
tableStore.table.params.power = '1'
|
||||
tableStore.table.params.indicator = '1'
|
||||
tableStore.table.params.exceedingTheLimit = '1'
|
||||
tableStore.table.params.valueType = 'avg'
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
// 添加谐波次数选项(2-50)
|
||||
const harmonicCountOptions = ref(Array.from({ length: 49 }, (_, i) => i + 2))
|
||||
|
||||
// 判断是否应该显示谐波次数选择框
|
||||
const shouldShowHarmonicCount = () => {
|
||||
if (!tableStore.table.params.indicator || !indicatorList.value) return false
|
||||
|
||||
const currentIndicator = indicatorList.value.find((item: any) => item.id === tableStore.table.params.indicator)
|
||||
|
||||
return (
|
||||
currentIndicator &&
|
||||
(currentIndicator.name.includes('电压谐波含有率') || currentIndicator.name.includes('电流谐波含有率'))
|
||||
)
|
||||
}
|
||||
|
||||
// 获取谐波类型名称
|
||||
const getHarmonicTypeName = () => {
|
||||
const currentIndicator = indicatorList.value.find((item: any) => item.id === tableStore.table.params.indicator)
|
||||
|
||||
if (currentIndicator) {
|
||||
if (currentIndicator.name.includes('电压谐波含有率')) {
|
||||
return '电压'
|
||||
} else if (currentIndicator.name.includes('电流谐波含有率')) {
|
||||
return '电流'
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
// 监听指标变化,当指标变化时重置谐波次数
|
||||
watch(
|
||||
() => tableStore.table.params.indicator,
|
||||
newVal => {
|
||||
if (shouldShowHarmonicCount()) {
|
||||
// 如果之前没有设置过谐波次数,则默认设置为2
|
||||
if (!tableStore.table.params.harmonicCount) {
|
||||
tableStore.table.params.harmonicCount = 2
|
||||
}
|
||||
} else {
|
||||
// 如果不是谐波含有率指标,则清除谐波次数设置
|
||||
tableStore.table.params.harmonicCount = ''
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
initLineList().then(() => {
|
||||
initCode()
|
||||
})
|
||||
})
|
||||
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-select) {
|
||||
min-width: 80px;
|
||||
}
|
||||
// :deep(.el-select) {
|
||||
// min-width: 80px;
|
||||
// }
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 指标越限详情 -->
|
||||
<el-dialog draggable title="指标越限详情" v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.lineId"
|
||||
placeholder="请选择监测点"
|
||||
style="width: 150px"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="height"></Table>
|
||||
</el-dialog>
|
||||
<!-- 谐波电流、谐波电压占有率 -->
|
||||
<HarmonicRatio ref="harmonicRatioRef" v-if="dialogFlag" @close="onHarmonicRatioClose" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide,nextTick } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import HarmonicRatio from '@/components/cockpit/gridSideStatistics/components/harmonicRatio.vue'
|
||||
import { cslineList } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
const harmonicRatioRef: any = ref(null)
|
||||
|
||||
const options = ref()
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const tableHeaderRef = ref()
|
||||
const dialogFlag = ref(false)
|
||||
const loop50 = (key: string) => {
|
||||
let list: any[] = []
|
||||
for (let i = 2; i < 26; i++) {
|
||||
list.push({
|
||||
title: i + '次',
|
||||
field: key + i + 'Overtime',
|
||||
width: '60',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
|
||||
}
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-harmonic-boot/totalLimitStatistics/details',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
exportName: '每日越限占比统计',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
field: 'time',
|
||||
width: '150',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'lineName',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '闪变越限(%)',
|
||||
field: 'flickerOvertime',
|
||||
width: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电压越限(%)',
|
||||
children: loop50('uharm')
|
||||
},
|
||||
{
|
||||
title: '谐波电流越限(%)',
|
||||
children: loop50('iharm')
|
||||
},
|
||||
{
|
||||
title: '三相不平衡度越限(%)',
|
||||
field: 'ubalanceOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压偏差越限(%)',
|
||||
field: 'voltageDevOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.uaberranceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '频率偏差越限(%)',
|
||||
field: 'freqDevOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.freqDevOvertime}</span>`
|
||||
}
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
},
|
||||
loadCallback: () => {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.sortBy = ''
|
||||
tableStore.table.params.orderBy = ''
|
||||
const open = async (row: any,searchBeginTime:any,searchEndTime:any) => {
|
||||
dialogVisible.value = true
|
||||
initCSlineList()
|
||||
tableStore.table.params.lineId = row.lineId
|
||||
|
||||
nextTick(() => {
|
||||
tableHeaderRef.value.setTimeInterval([searchBeginTime, searchEndTime])
|
||||
tableStore.table.params.searchBeginTime =searchBeginTime
|
||||
tableStore.table.params.searchEndTime = searchEndTime
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name' && column.field != 'time') {
|
||||
dialogFlag.value = true
|
||||
dialogVisible.value = false
|
||||
nextTick(() => {
|
||||
harmonicRatioRef.value.openDialog(row,column.field,column.title.replace(/次/g, ""))
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 谐波弹窗关闭时的回调
|
||||
const onHarmonicRatioClose = () => {
|
||||
dialogFlag.value = false
|
||||
// 重新打开指标越限详情弹窗
|
||||
nextTick(() => {
|
||||
dialogVisible.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const initCSlineList = async () => {
|
||||
const res = await cslineList({})
|
||||
options.value = res.data
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,46 +1,86 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--监测点列表 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`"></Table>
|
||||
<!-- 监测点列表 -->
|
||||
<TableHeader
|
||||
ref="TableHeaderRef"
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
v-if="fullscreen" :timeKeyList="prop.timeKey"
|
||||
></TableHeader>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? -58 : 56}px )`"
|
||||
></Table>
|
||||
<!-- 指标越限详情 -->
|
||||
<OverLimitDetails ref="OverLimitDetailsRef" />
|
||||
|
||||
<!-- 上传对话框 -->
|
||||
<el-dialog v-model="uploadDialogVisible" title="上传报告" width="500px" @closed="handleDialogClosed">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
:auto-upload="true"
|
||||
:on-change="handleChange"
|
||||
:before-upload="beforeUpload"
|
||||
:http-request="handleUpload"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
:file-list="fileList"
|
||||
>
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">只能上传Word或PDF文件,且不超过10MB</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="uploadDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="uploadDialogVisible = false">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { ElTag } from 'element-plus'
|
||||
import OverLimitDetails from '@/components/cockpit/listOfMainMonitoringPoints/components/overLimitDetails.vue'
|
||||
import OverLimitDetails from '@/components/cockpit/monitoringPointList/components/overLimitDetails.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { uploadReport, getReportUrl } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
// 上传相关
|
||||
const uploadDialogVisible = ref(false)
|
||||
const currentUploadRow = ref<any>(null)
|
||||
const uploadRef = ref()
|
||||
const fileList = ref([])
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,11 +98,10 @@ const fullscreen = computed(() => {
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
url: '/cs-device-boot/csline/getSensitiveUserLineList',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
showPage: fullscreen.value ? true : false,
|
||||
exportName: '监测点列表',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
@@ -73,120 +112,224 @@ const tableStore: any = new TableStore({
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '治理对象名称',
|
||||
field: 'name',
|
||||
minWidth: '80'
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
minWidth: '120',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.lineName}</span>`
|
||||
}
|
||||
},
|
||||
{ title: '监测类型', field: 'position', minWidth: '80' },
|
||||
{
|
||||
title: '监测点状态',
|
||||
field: 'runStatus',
|
||||
minWidth: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='color: ${row.runStatus === '中断' ? '#FF0000' : ''}'>${row.runStatus}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '治理对象',
|
||||
field: 'sensitiveUser',
|
||||
minWidth: '90'
|
||||
},
|
||||
|
||||
{
|
||||
title: '电压等级',
|
||||
field: 'type',
|
||||
minWidth: '70'
|
||||
field: 'volGrade',
|
||||
minWidth: '80'
|
||||
},
|
||||
{
|
||||
title: '治理设备详情',
|
||||
field: 'type1',
|
||||
minWidth: '70'
|
||||
title: '是否治理',
|
||||
field: 'govern',
|
||||
minWidth: '80'
|
||||
},
|
||||
|
||||
{
|
||||
title: '治理前报告',
|
||||
field: 'type2',
|
||||
minWidth: '80',
|
||||
title: '最新数据时间',
|
||||
field: 'latestTime',
|
||||
minWidth: '140',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;' onclick="handleReportClick('${row.name}')">${row.type2}</span>`
|
||||
if (row.latestTime) {
|
||||
return `<span>${row.latestTime}</span>`
|
||||
} else {
|
||||
return `<span>/</span>`
|
||||
}
|
||||
}
|
||||
},
|
||||
{ title: '监测点名称', field: 'type3', minWidth: '70' },
|
||||
{ title: '监测类型', field: 'type4', minWidth: '60' },
|
||||
{
|
||||
title: '监测点状态',
|
||||
field: 'type5',
|
||||
minWidth: '60',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='color: ${row.type5 === '中断' ? '#FF0000' : ''}'>${row.type5}</span>`
|
||||
title: '操作',
|
||||
minWidth: 80,
|
||||
// fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '上传报告',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-upload',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
uploadReportRow(row)
|
||||
},
|
||||
disabled: row => {
|
||||
return row.reportFilePath
|
||||
}
|
||||
},
|
||||
{ title: '最新数据时间', field: 'type6', minWidth: '140' }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '下载报告',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
downloadTheReport(row.lineId)
|
||||
},
|
||||
disabled: row => {
|
||||
return row.reportFilePath == null || row.reportFilePath.length == 0
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '重新上传',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-upload',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
uploadReportRow(row)
|
||||
},
|
||||
disabled: row => {
|
||||
return row.reportFilePath == null || row.reportFilePath.length == 0
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '1#变压器',
|
||||
type: '0.38kV',
|
||||
type1: '250A APF',
|
||||
type2: '报告.doc',
|
||||
type3: '1#变压器 电网侧',
|
||||
type4: '电网侧',
|
||||
type5: '运行',
|
||||
type6: '2025-04-11 18:16:00'
|
||||
},
|
||||
{
|
||||
name: '1#变压器',
|
||||
type: '0.38kV',
|
||||
type1: '250A APF',
|
||||
type2: '报告.doc',
|
||||
type3: '1#变压器 负载侧',
|
||||
type4: '负载侧',
|
||||
type5: '运行',
|
||||
type6: '2025-04-11 18:16:00'
|
||||
},
|
||||
{
|
||||
name: '2#变压器',
|
||||
type: '0.38kV',
|
||||
type1: '100A SVG',
|
||||
type2: '/',
|
||||
type3: '1#变压器 电网侧',
|
||||
type4: '电网侧',
|
||||
type5: '运行',
|
||||
type6: '2025-04-11 18:16:00'
|
||||
},
|
||||
{
|
||||
name: '2#变压器',
|
||||
type: '0.38kV',
|
||||
type1: '100A SVG',
|
||||
type2: '/',
|
||||
type3: '1#变压器 负载侧',
|
||||
type4: '负载侧',
|
||||
type5: '中断',
|
||||
type6: '2025-04-11 18:16:00'
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
tableStore.table.params.type = ''
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.keywords = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field == 'name') {
|
||||
console.log(row)
|
||||
OverLimitDetailsRef.value.open(row)
|
||||
if (column.field == 'lineName') {
|
||||
OverLimitDetailsRef.value.open(
|
||||
row,
|
||||
tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
||||
tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 下载报告
|
||||
const downloadTheReport = (lineId: string) => {
|
||||
getReportUrl({ lineId: lineId }).then((res: any) => {
|
||||
const link = document.createElement('a')
|
||||
link.href = res.data
|
||||
link.download = '治理报告'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
|
||||
// 上传报告
|
||||
const uploadReportRow = (row: any) => {
|
||||
currentUploadRow.value = row
|
||||
// 打开弹窗前清空文件列表
|
||||
fileList.value = []
|
||||
uploadDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 处理弹窗关闭事件
|
||||
const handleDialogClosed = () => {
|
||||
// 清空文件列表
|
||||
fileList.value = []
|
||||
}
|
||||
|
||||
// 处理文件超出限制
|
||||
const handleExceed = (files: any, fileList: any) => {
|
||||
ElMessage.warning('只能上传一个文件,请先删除已选择的文件')
|
||||
}
|
||||
|
||||
// 文件变更处理函数
|
||||
const handleChange = (file: any, fileList: any) => {
|
||||
// 在这里直接处理文件上传逻辑
|
||||
beforeUpload(file.raw) // 注意使用 file.raw 获取原始文件对象
|
||||
}
|
||||
|
||||
// 处理上传前检查
|
||||
const beforeUpload = (file: any) => {
|
||||
const isWord =
|
||||
file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ||
|
||||
file.type === 'application/msword' ||
|
||||
file.name.endsWith('.doc') ||
|
||||
file.name.endsWith('.docx')
|
||||
|
||||
const isPDF = file.type === 'application/pdf' || file.name.endsWith('.pdf')
|
||||
|
||||
const isValidType = isWord || isPDF
|
||||
const isLt10M = file.size / 1024 / 1024 < 10
|
||||
|
||||
if (!isValidType) {
|
||||
ElMessage.error('上传文件只能是 Word 文档(.doc/.docx) 或 PDF 文件(.pdf)!')
|
||||
return false
|
||||
}
|
||||
if (!isLt10M) {
|
||||
ElMessage.error('上传文件大小不能超过 10MB!')
|
||||
return false
|
||||
}
|
||||
|
||||
// 校验通过后允许上传,交由 http-request 处理
|
||||
return true
|
||||
}
|
||||
|
||||
const handleUpload = async (options: any) => {
|
||||
const { file } = options
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
formData.append('lineId', currentUploadRow.value?.lineId || currentUploadRow.value?.id || '')
|
||||
|
||||
try {
|
||||
const result = await uploadReport(formData)
|
||||
ElMessage.success('上传成功')
|
||||
uploadDialogVisible.value = false
|
||||
tableStore.index()
|
||||
return Promise.resolve(result)
|
||||
} catch (error: any) {
|
||||
ElMessage.error('上传失败: ' + (error.message || '未知错误'))
|
||||
return Promise.reject(error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,39 +343,13 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const handleReportClick = (id: string) => {
|
||||
const row = tableStore.table.data.find((item: any) => item.id === id)
|
||||
if (row && row.type2 !== '/') {
|
||||
// 示例:触发下载逻辑(根据你注释掉的代码)
|
||||
// getFileZip({ eventId: id }).then(res => {
|
||||
// let blob = new Blob([res], { type: 'application/zip' })
|
||||
// const url = window.URL.createObjectURL(blob)
|
||||
// const link = document.createElement('a')
|
||||
// link.href = url
|
||||
// link.download = row.wavePath?.split('/')[2] || '报告文件.zip'
|
||||
// link.click()
|
||||
// })
|
||||
console.log('点击了报告:', row.type2)
|
||||
} else {
|
||||
ElMessage.warning('暂无报告可下载')
|
||||
}
|
||||
}
|
||||
|
||||
// 挂载到 window 供 HTML 调用
|
||||
window.handleReportClick = handleReportClick
|
||||
|
||||
// 组件销毁时清理全局方法
|
||||
onBeforeUnmount(() => {
|
||||
delete window.handleReportClick
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -0,0 +1,708 @@
|
||||
<template>
|
||||
<el-dialog draggable title="趋势图" v-model="dialogVisible" append-to-body width="70%">
|
||||
<!-- 总体指标占比详情谐波含有率 -->
|
||||
<div>
|
||||
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
<el-form-item>
|
||||
<DatePicker ref="datePickerRef"></DatePicker>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计指标" label-width="80px">
|
||||
<el-select
|
||||
multiple
|
||||
:multiple-limit="2"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
v-model="searchForm.index"
|
||||
placeholder="请选择统计指标"
|
||||
@change="onIndexChange($event)"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indexOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.dataLevel" @change="init()">
|
||||
<el-radio-button label="一次值" value="Primary" />
|
||||
<el-radio-button label="二次值" value="Secondary" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
style="min-width: 120px !important"
|
||||
placeholder="请选择"
|
||||
v-model="searchForm.valueType"
|
||||
filterable
|
||||
>
|
||||
<el-option value="max" label="最大值"></el-option>
|
||||
<el-option value="min" label="最小值"></el-option>
|
||||
<el-option value="avg" label="平均值"></el-option>
|
||||
<el-option value="cp95" label="cp95"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div
|
||||
class="history_count"
|
||||
v-for="(item, index) in countData"
|
||||
:key="index"
|
||||
v-show="item.countOptions.length != 0"
|
||||
>
|
||||
<span class="mr12">
|
||||
{{ item.name.includes('次数') ? item.name : item.name + '谐波次数' }}
|
||||
</span>
|
||||
<el-select
|
||||
v-model="item.count"
|
||||
@change="onCountChange($event, index)"
|
||||
placeholder="请选择谐波次数"
|
||||
style="width: 100px"
|
||||
class="mr20"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="vv in item.countOptions"
|
||||
:key="vv"
|
||||
:label="vv"
|
||||
:value="vv"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
|
||||
<el-button :type="timeControl ? 'primary' : ''" icon="el-icon-Sort" @click="setTimeControl">
|
||||
缺失数据
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
<div class="history_chart" :style="pageHeight" v-loading="loading">
|
||||
<MyEchart
|
||||
ref="historyChart"
|
||||
:options="echartsData"
|
||||
v-if="showEchart"
|
||||
/>
|
||||
<el-empty :style="pageHeight" v-else description="暂无数据" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { queryStatistical } from '@/api/system-boot/csstatisticalset'
|
||||
import { yMethod, exportCSV, completeTimeSeries } from '@/utils/echartMethod'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { trendData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { color } from '@/components/echarts/color'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const dictData = useDictData()
|
||||
defineOptions({
|
||||
// name: 'govern/device/control'
|
||||
})
|
||||
const props = defineProps({
|
||||
TrendList: {
|
||||
type: Array
|
||||
}
|
||||
})
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
// console.log("🚀 ~ props:", props.TrendList)
|
||||
const showEchart = ref(true)
|
||||
const num = ref(0)
|
||||
const timeControl = ref(false)
|
||||
//值类型
|
||||
const pageHeight = ref(mainHeight(57 * 1.6, 1.6))
|
||||
const loading = ref(true)
|
||||
const searchForm: any = ref({})
|
||||
const tableHeaderRef = ref()
|
||||
const typeOptions = [
|
||||
{
|
||||
name: '平均值',
|
||||
id: 'avg'
|
||||
},
|
||||
{
|
||||
name: '最大值',
|
||||
id: 'max'
|
||||
},
|
||||
{
|
||||
name: '最小值',
|
||||
id: 'min'
|
||||
},
|
||||
{
|
||||
name: 'CP95值',
|
||||
id: 'cp95'
|
||||
}
|
||||
]
|
||||
searchForm.value = {
|
||||
index: [],
|
||||
type: typeOptions[0].id,
|
||||
count: '',
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
dataLevel: 'Primary',
|
||||
valueType: 'avg'
|
||||
}
|
||||
//统计指标
|
||||
const indexOptions: any = ref([])
|
||||
//谐波次数
|
||||
const countOptions: any = ref([])
|
||||
// Harmonic_Type
|
||||
// portable-harmonic
|
||||
const legendDictList: any = ref([])
|
||||
|
||||
const initCode = (field: string, title: string) => {
|
||||
queryByCode('steady_state_limit_trend').then(res => {
|
||||
queryCsDictTree(res.data.id).then(item => {
|
||||
//排序
|
||||
indexOptions.value = item.data.sort((a: any, b: any) => {
|
||||
return a.sort - b.sort
|
||||
})
|
||||
const titleMap: Record<string, number> = {
|
||||
flickerOvertime: 0,
|
||||
uaberranceOvertime: 3,
|
||||
ubalanceOvertime: 4,
|
||||
freqDevOvertime: 5
|
||||
}
|
||||
|
||||
let defaultIndex = 0 // 默认值
|
||||
|
||||
if (field in titleMap) {
|
||||
defaultIndex = titleMap[field]
|
||||
} else if (field.includes('uharm')) {
|
||||
defaultIndex = 1
|
||||
} else if (field.includes('iharm')) {
|
||||
defaultIndex = 2
|
||||
}
|
||||
|
||||
searchForm.value.index[0] = indexOptions.value[defaultIndex].id
|
||||
})
|
||||
queryStatistical(res.data.id).then(vv => {
|
||||
legendDictList.value = vv.data
|
||||
indexOptions.value.map((item: any, index: any) => {
|
||||
if (!countDataCopy.value[index]) {
|
||||
countDataCopy.value[index] = {
|
||||
index: item.id,
|
||||
countOptions: [],
|
||||
count: [],
|
||||
name: indexOptions.value.find((vv: any) => {
|
||||
return vv.id == item.id
|
||||
})?.name
|
||||
}
|
||||
}
|
||||
legendDictList.value?.selectedList?.map((vv: any, vvs: any) => {
|
||||
//查找相等的指标
|
||||
if (item.id == vv.dataType) {
|
||||
vv.eleEpdPqdVOS.map((kk: any, kks: any) => {
|
||||
if (kk.harmStart && kk.harmEnd) {
|
||||
range(0, 0, 0)
|
||||
|
||||
if (kk.showName == '间谐波电压含有率') {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map(
|
||||
(item: any) => {
|
||||
return item - 0.5
|
||||
}
|
||||
)
|
||||
} else {
|
||||
countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1)
|
||||
}
|
||||
if (title && countDataCopy.value[index].countOptions.includes(Number(title))) {
|
||||
countDataCopy.value[index].count = Number(title)
|
||||
} else if (title && countDataCopy.value[index].countOptions.includes(title)) {
|
||||
countDataCopy.value[index].count = title
|
||||
} else if (
|
||||
!countDataCopy.value[index].count ||
|
||||
countDataCopy.value[index].count.length == 0
|
||||
) {
|
||||
// 只有当count为空时才设置默认值
|
||||
countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
nextTick(() => {
|
||||
formatCountOptions()
|
||||
})
|
||||
init()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const chartsList = ref<any>([])
|
||||
const chartTitle: any = ref('')
|
||||
const echartsData = ref<any>(null)
|
||||
//加载echarts图表
|
||||
//历史趋势数据
|
||||
const historyDataList: any = ref([])
|
||||
const range = (start: any, end: any, step: any) => {
|
||||
return Array.from({ length: (end - start) / step + 1 }, (_, i) => start + i * step)
|
||||
}
|
||||
//获取请求趋势数据参数
|
||||
const trendRequestData = ref()
|
||||
const getTrendRequest = (val: any) => {
|
||||
trendRequestData.value = val
|
||||
// init()
|
||||
}
|
||||
//初始化趋势图
|
||||
const headerRef = ref()
|
||||
const datePickerRef = ref()
|
||||
const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
|
||||
const init = async () => {
|
||||
loading.value = true
|
||||
// 选择指标的时候切换legend内容和data数据
|
||||
let list: any = []
|
||||
legendDictList.value?.selectedList?.map((item: any) => {
|
||||
searchForm.value.index.map((vv: any) => {
|
||||
if (item.dataType == vv) {
|
||||
list.push(item.eleEpdPqdVOS)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//颜色数组
|
||||
const colorList = color
|
||||
//选择的指标使用方法处理
|
||||
formatCountOptions()
|
||||
//查询历史趋势
|
||||
historyDataList.value = []
|
||||
chartTitle.value = ''
|
||||
|
||||
searchForm.value.index.map((item: any, indexs: any) => {
|
||||
indexOptions.value.map((vv: any) => {
|
||||
if (vv.id == item) {
|
||||
chartTitle.value += indexs == searchForm.value.index.length - 1 ? vv.name : vv.name + '/'
|
||||
}
|
||||
})
|
||||
})
|
||||
let lists: any = []
|
||||
let frequencys: any = null
|
||||
countData.value.map((item: any, index: any) => {
|
||||
if (item.name.includes('谐波含有率')) {
|
||||
frequencys = item.count
|
||||
} else {
|
||||
frequencys = ''
|
||||
}
|
||||
lists[index] = {
|
||||
statisticalId: item.index,
|
||||
frequency: frequencys !== null && frequencys !== undefined ? String(frequencys) : ''
|
||||
}
|
||||
})
|
||||
let obj = {
|
||||
//...trendRequestData.value,
|
||||
lineId: trendRequestData.value.lineId,
|
||||
list: lists,
|
||||
dataLevel: searchForm.value.dataLevel,
|
||||
valueType: searchForm.value.valueType,
|
||||
searchBeginTime: datePickerRef.value && datePickerRef.value.timeValue[0],
|
||||
searchEndTime: datePickerRef.value && datePickerRef.value.timeValue[1]
|
||||
}
|
||||
if (searchForm.value.index.length == 0) {
|
||||
ElMessage.warning('请选择统计指标')
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
if (obj.list.length != 0) {
|
||||
try {
|
||||
showEchart.value = true
|
||||
await trendData(obj)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
if (res.data.length == 0) {
|
||||
loading.value = false
|
||||
showEchart.value = false
|
||||
return
|
||||
}
|
||||
historyDataList.value = res.data
|
||||
chartsList.value = JSON.parse(JSON.stringify(res.data))
|
||||
loading.value = false
|
||||
setEchart()
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
loading.value = false
|
||||
})
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
const setEchart = () => {
|
||||
loading.value = true
|
||||
echartsData.value = {}
|
||||
//icon图标替换legend图例
|
||||
|
||||
// y轴单位数组
|
||||
let unitList: any = []
|
||||
|
||||
let groupedData = chartsList.value.reduce((acc: any, item: any) => {
|
||||
let key = ''
|
||||
if (item.phase == null) {
|
||||
key = item.unit
|
||||
} else {
|
||||
key = item.anotherName
|
||||
}
|
||||
|
||||
if (!acc[key]) {
|
||||
acc[key] = []
|
||||
}
|
||||
acc[key].push(item)
|
||||
return acc
|
||||
}, {})
|
||||
let result = Object.values(groupedData)
|
||||
if (chartsList.value.length > 0) {
|
||||
unitList = result.map((item: any) => {
|
||||
return item[0].unit
|
||||
})
|
||||
}
|
||||
|
||||
echartsData.value = {
|
||||
legend: {
|
||||
itemWidth: 20,
|
||||
itemHeight: 20,
|
||||
itemStyle: { opacity: 0 }, //去圆点
|
||||
type: 'scroll', // 开启滚动分页
|
||||
// orient: 'vertical', // 垂直排列
|
||||
top: 5,
|
||||
right: 70
|
||||
// width: 550,
|
||||
// height: 50
|
||||
},
|
||||
grid: {
|
||||
top: '80px'
|
||||
},
|
||||
tooltip: {
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
formatter(params: any) {
|
||||
const xname = params[0].value[0]
|
||||
let str = `${xname}<br>`
|
||||
params.forEach((el: any, index: any) => {
|
||||
let marker = ''
|
||||
|
||||
if (el.value[3] == 'dashed') {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
marker += `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
|
||||
}
|
||||
} else {
|
||||
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
|
||||
}
|
||||
let unit = el.value[2] ? el.value[2] : ''
|
||||
str += `${marker}${el.seriesName.split('(')[0]}:${el.value[1]}${unit}
|
||||
<br>`
|
||||
})
|
||||
return str
|
||||
}
|
||||
},
|
||||
color: ['#DAA520', '#2E8B57', '#A52a2a', ...color],
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: [{}],
|
||||
toolbox: {
|
||||
featureProps: {
|
||||
myTool1: {
|
||||
show: true,
|
||||
title: '下载csv',
|
||||
icon: 'path://M588.8 551.253333V512H352v39.253333h236.373333z m0 78.933334v-39.253334H352v39.253334h236.373333z m136.533333 78.933333V334.933333l-157.866666-157.866666H273.066667A59.306667 59.306667 0 0 0 213.333333 236.373333v551.253334a59.306667 59.306667 0 0 0 59.306667 59.306666h274.773333v42.666667H853.333333v-180.48zM568.746667 234.666667l100.266666 100.693333h-81.066666a20.053333 20.053333 0 0 1-19.626667-20.053333z m-20.48 573.013333H273.066667a19.2 19.2 0 0 1-17.493334-19.626667V236.373333a19.2 19.2 0 0 1 19.626667-19.626666h256v98.133333a58.88 58.88 0 0 0 58.88 59.306667h96.426667v334.933333h-98.133334v-39.68H352v39.68h196.266667z m100.266666 23.04a37.973333 37.973333 0 0 1-32 15.786667 38.826667 38.826667 0 0 1-32.426666-15.786667 53.76 53.76 0 0 1-10.24-32.853333 42.666667 42.666667 0 0 1 42.666666-47.786667 35.84 35.84 0 0 1 37.546667 29.866667h-12.8a23.893333 23.893333 0 0 0-24.746667-19.2c-17.066667 0-29.013333 14.08-29.013333 35.84s11.52 37.546667 28.586667 37.546666a26.453333 26.453333 0 0 0 26.453333-25.6h12.8a39.253333 39.253333 0 0 1-7.253333 22.186667z m59.733334 15.786667a35.84 35.84 0 0 1-40.106667-34.56H682.666667a23.893333 23.893333 0 0 0 26.88 23.04c12.8 0 22.613333-6.4 22.613333-15.786667s-4.266667-11.52-14.506667-13.653333l-21.333333-5.12c-17.066667-4.266667-24.32-11.52-24.32-23.893334s12.8-26.453333 34.133333-26.453333a31.573333 31.573333 0 0 1 35.413334 30.293333h-13.653334a19.626667 19.626667 0 0 0-22.613333-18.773333c-12.8 0-20.48 5.12-20.48 12.8s5.12 11.093333 17.066667 13.653333l14.933333 2.986667a42.666667 42.666667 0 0 1 20.906667 8.96 23.893333 23.893333 0 0 1 7.68 17.92c-0.426667 17.066667-14.506667 28.16-37.12 28.16z m88.746666 0h-14.506666l-32.426667-92.16h14.08l19.626667 59.733333 6.4 20.053333c0-9.386667 3.413333-12.8 5.546666-20.053333l19.2-59.733333h14.08z',
|
||||
onclick: e => {
|
||||
// console.log("🚀 ~ init ~ echartsData.value:", echartsData.value.options.series.map(item => item.data))
|
||||
|
||||
let list = echartsData.value.options.series?.map((item: any) => item.data)
|
||||
let dataList = list[0]?.map((item: any, index: any) => {
|
||||
let value = [item[0], item[1]]
|
||||
list.forEach((item1: any, index1: any) => {
|
||||
if (index1 > 0) {
|
||||
value.push(item1 && item1[index] ? item1[index][1] : null)
|
||||
}
|
||||
})
|
||||
|
||||
return value
|
||||
})
|
||||
exportCSV(
|
||||
echartsData.value.options.series.map((item: any) => item.name),
|
||||
dataList,
|
||||
'监测点指标趋势.csv'
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
options: {
|
||||
series: []
|
||||
}
|
||||
}
|
||||
// console.log("🚀 ~ unitList.forEach ~ unitList:", unitList)
|
||||
|
||||
if (chartsList.value.length > 0) {
|
||||
let yData: any = []
|
||||
echartsData.value.yAxis = []
|
||||
let setList = [...new Set(unitList)]
|
||||
|
||||
setList.forEach((item: any, index: any) => {
|
||||
if (index > 2) {
|
||||
echartsData.value.grid.right = (index - 1) * 80
|
||||
}
|
||||
yData.push([])
|
||||
let right = {
|
||||
position: 'right',
|
||||
offset: (index - 1) * 80
|
||||
}
|
||||
// console.log("🚀 ~ unitList.forEach ~ right.index:", index)
|
||||
echartsData.value.yAxis.push({
|
||||
name: item,
|
||||
yAxisIndex: index,
|
||||
splitNumber: 5,
|
||||
minInterval: 1,
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
...(index > 0 ? right : null)
|
||||
})
|
||||
})
|
||||
// console.log("🚀 ~ result.forEach ~ result:", result)
|
||||
// '电压负序分量', '电压正序分量', '电压零序分量'
|
||||
let ABCName = [
|
||||
...new Set(
|
||||
chartsList.value.map((item: any) => {
|
||||
return item.anotherName == '电压负序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName == '电压正序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName == '电压零序分量'
|
||||
? '电压不平衡'
|
||||
: item.anotherName
|
||||
})
|
||||
)
|
||||
]
|
||||
// console.log("🚀 ~ .then ~ ABCName:", ABCName)
|
||||
result.forEach((item: any, index: any) => {
|
||||
let yMethodList: any = []
|
||||
|
||||
let ABCList = Object.values(
|
||||
item.reduce((acc, item) => {
|
||||
let key = ''
|
||||
if (item.phase == null) {
|
||||
key = item.anotherName
|
||||
} else {
|
||||
key = item.phase
|
||||
}
|
||||
|
||||
if (!acc[key]) {
|
||||
acc[key] = []
|
||||
}
|
||||
acc[key].push(item)
|
||||
return acc
|
||||
}, {})
|
||||
)
|
||||
// console.log("🚀 ~ ABCList.forEach ~ ABCList:", ABCList)
|
||||
|
||||
ABCList.forEach((kk: any) => {
|
||||
let colorName = kk[0].phase?.charAt(0).toUpperCase()
|
||||
let lineS = ABCName.findIndex(
|
||||
item =>
|
||||
item ===
|
||||
(kk[0].anotherName == '电压负序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName == '电压正序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName == '电压零序分量'
|
||||
? '电压不平衡'
|
||||
: kk[0].anotherName)
|
||||
)
|
||||
|
||||
let seriesList: any = []
|
||||
kk.forEach((cc: any) => {
|
||||
if (cc.statisticalData !== null) {
|
||||
yData[setList.indexOf(kk[0].unit)].push(cc.statisticalData?.toFixed(2))
|
||||
}
|
||||
|
||||
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
|
||||
})
|
||||
// console.log(kk);
|
||||
|
||||
echartsData.value.options.series.push({
|
||||
name: kk[0].phase ? kk[0].phase + '相' + kk[0].anotherName : kk[0].anotherName,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
color:
|
||||
colorName == 'A' ? '#DAA520' : colorName == 'B' ? '#2E8B57' : colorName == 'C' ? '#A52a2a' : '',
|
||||
symbol: 'none',
|
||||
// data: seriesList,
|
||||
data: timeControl.value ? completeTimeSeries(seriesList) : seriesList,
|
||||
lineStyle: lineStyle[lineS],
|
||||
yAxisIndex: setList.indexOf(kk[0].unit)
|
||||
})
|
||||
})
|
||||
})
|
||||
yData.forEach((item: any, index: any) => {
|
||||
let [min, max] = yMethod(item)
|
||||
echartsData.value.yAxis[index].min = min
|
||||
echartsData.value.yAxis[index].max = max
|
||||
})
|
||||
// console.log("🚀 ~ result.forEach ~ echartsData.value:", echartsData.value)
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
const setTimeControl = () => {
|
||||
timeControl.value = !timeControl.value
|
||||
setEchart()
|
||||
}
|
||||
|
||||
const selectChange = (flag: boolean, height: any) => {
|
||||
pageHeight.value = mainHeight(height * 1.6, 1.6)
|
||||
}
|
||||
//导出
|
||||
const historyChart = ref()
|
||||
|
||||
const countData: any = ref([])
|
||||
const countDataCopy: any = ref([])
|
||||
|
||||
//根据选择的指标处理谐波次数
|
||||
const formatCountOptions = () => {
|
||||
countData.value = []
|
||||
if (searchForm.value.index.length != 0) {
|
||||
searchForm.value.index.forEach((item: any, index: any) => {
|
||||
countDataCopy.value.forEach((vv: any, vvs: any) => {
|
||||
if (vv.index == item) {
|
||||
countData.value.push(vv)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
countData.value.map((item: any, key: any) => {
|
||||
if (item.name == '谐波电流有效值') {
|
||||
item.name = '谐波电流次数'
|
||||
} else if (item.name == '谐波电压含有率') {
|
||||
item.name = '谐波电压次数'
|
||||
} else if (item.name == '间谐波电压含有率') {
|
||||
item.name = '间谐波电压次数'
|
||||
}
|
||||
})
|
||||
}
|
||||
// setTimeout(() => {
|
||||
// tableHeaderRef.value.computedSearchRow()
|
||||
// }, 500)
|
||||
}
|
||||
// 判断下拉框是否存在
|
||||
const onCountChange = (val: any, index: any) => {
|
||||
if (val.length == 0) {
|
||||
countData.value[index].count = countData.value[index].countOptions[0]
|
||||
}
|
||||
}
|
||||
const flag = ref(true)
|
||||
const onIndexChange = (val: any) => {
|
||||
num.value += 1
|
||||
let pp: any = []
|
||||
indexOptions.value.forEach((item: any) => {
|
||||
const filteredResult = val.filter(vv => item.id == vv)
|
||||
if (filteredResult.length > 0) {
|
||||
pp.push(filteredResult[0])
|
||||
}
|
||||
})
|
||||
searchForm.value.index = pp
|
||||
flag.value = true
|
||||
formatCountOptions()
|
||||
}
|
||||
watch(
|
||||
() => searchForm.value.index,
|
||||
(val: any, oldval: any) => {},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
|
||||
const openDialog = async (row: any, field: any, title: any) => {
|
||||
dialogVisible.value = true
|
||||
trendRequestData.value = row
|
||||
|
||||
nextTick(() => {
|
||||
// 默认当天
|
||||
datePickerRef.value.setInterval(5)
|
||||
datePickerRef.value.timeValue = [row.time, row.time]
|
||||
initCode(field, title)
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ getTrendRequest, openDialog })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.history_header {
|
||||
display: flex;
|
||||
|
||||
// flex-wrap: wrap;
|
||||
#history_select {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
// justify-content: flex-start;
|
||||
// overflow-x: auto;
|
||||
height: auto;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.el-form-item {
|
||||
flex: none !important;
|
||||
// max-width: 380px;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
// #history_select::-webkit-scrollbar {
|
||||
// width: 0 !important;
|
||||
// display: none !important;
|
||||
// }
|
||||
|
||||
.history_searchBtn {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.history_chart {
|
||||
width: 100%;
|
||||
|
||||
// flex: 1;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.history_count {
|
||||
.el-select {
|
||||
min-width: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 指标越限详情 -->
|
||||
<el-dialog draggable title="指标越限详情" v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.lineId"
|
||||
placeholder="请选择监测点"
|
||||
style="width: 150px"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="height"></Table>
|
||||
</el-dialog>
|
||||
<!-- 谐波电流、谐波电压占有率 -->
|
||||
<HarmonicRatio ref="harmonicRatioRef" v-if="dialogFlag" @close="onHarmonicRatioClose" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, provide,nextTick } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import HarmonicRatio from '@/components/cockpit/overLimitStatistics/components/harmonicRatio.vue'
|
||||
import { cslineList } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
const harmonicRatioRef: any = ref(null)
|
||||
|
||||
const options = ref()
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const tableHeaderRef = ref()
|
||||
const dialogFlag = ref(false)
|
||||
const loop50 = (key: string) => {
|
||||
let list: any[] = []
|
||||
for (let i = 2; i < 26; i++) {
|
||||
list.push({
|
||||
title: i + '次',
|
||||
field: key + i + 'Overtime',
|
||||
width: '60',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
|
||||
}
|
||||
})
|
||||
}
|
||||
return list
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-harmonic-boot/totalLimitStatistics/details',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
exportName: '每日越限占比统计',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
field: 'time',
|
||||
width: '150',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'lineName',
|
||||
width: '150'
|
||||
},
|
||||
{
|
||||
title: '闪变越限(%)',
|
||||
field: 'flickerOvertime',
|
||||
width: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电压越限(%)',
|
||||
children: loop50('uharm')
|
||||
},
|
||||
{
|
||||
title: '谐波电流越限(%)',
|
||||
children: loop50('iharm')
|
||||
},
|
||||
{
|
||||
title: '三相不平衡度越限(%)',
|
||||
field: 'ubalanceOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压偏差越限(%)',
|
||||
field: 'voltageDevOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.uaberranceOvertime}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '频率偏差越限(%)',
|
||||
field: 'freqDevOvertime',
|
||||
width: '100',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.freqDevOvertime}</span>`
|
||||
}
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
},
|
||||
loadCallback: () => {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.sortBy = ''
|
||||
tableStore.table.params.orderBy = ''
|
||||
const open = async (row: any,searchBeginTime:any,searchEndTime:any) => {
|
||||
dialogVisible.value = true
|
||||
initCSlineList()
|
||||
tableStore.table.params.lineId = row.lineId
|
||||
|
||||
nextTick(() => {
|
||||
tableHeaderRef.value.setTimeInterval([searchBeginTime, searchEndTime])
|
||||
tableStore.table.params.searchBeginTime =searchBeginTime
|
||||
tableStore.table.params.searchEndTime = searchEndTime
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name' && column.field != 'time') {
|
||||
dialogFlag.value = true
|
||||
dialogVisible.value = false
|
||||
nextTick(() => {
|
||||
harmonicRatioRef.value.openDialog(row,column.field,column.title.replace(/次/g, ""))
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 谐波弹窗关闭时的回调
|
||||
const onHarmonicRatioClose = () => {
|
||||
dialogFlag.value = false
|
||||
// 重新打开指标越限详情弹窗
|
||||
nextTick(() => {
|
||||
dialogVisible.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const initCSlineList = async () => {
|
||||
const res = await cslineList({})
|
||||
options.value = res.data
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,7 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--总体指标越限统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<TableHeader
|
||||
:showReset="false"
|
||||
ref="TableHeaderRef"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
v-if="fullscreen" :timeKeyList="prop.timeKey"
|
||||
></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
@@ -26,33 +32,35 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import OverLimitDetails from '@/components/cockpit/listOfMainMonitoringPoints/components/overLimitDetails.vue'
|
||||
import OverLimitDetails from '@/components/cockpit/overLimitStatistics/components/overLimitDetails.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { totalLimitStatisticsData } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const echartList = ref({})
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +75,14 @@ const fullscreen = computed(() => {
|
||||
return false
|
||||
}
|
||||
})
|
||||
const echartList = ref({
|
||||
|
||||
const initEcharts = () => {
|
||||
totalLimitStatisticsData({
|
||||
searchBeginTime: tableStore.table.params.searchBeginTime,
|
||||
searchEndTime: tableStore.table.params.searchEndTime
|
||||
}).then((res: any) => {
|
||||
const dataArray = [res.data.flicker, res.data.uharm, res.data.iharm, res.data.voltageDev, res.data.ubalance]
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: '指标越限占比'
|
||||
},
|
||||
@@ -91,7 +106,7 @@ const echartList = ref({
|
||||
// name: '暂降次数',
|
||||
type: 'bar',
|
||||
name: '越限占比',
|
||||
data: [0, 45, 22, 0, 70],
|
||||
data: dataArray,
|
||||
barMaxWidth: 30
|
||||
|
||||
// label: {
|
||||
@@ -106,10 +121,13 @@ const echartList = ref({
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/totalLimitStatistics/list',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
@@ -125,7 +143,7 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
field: 'name',
|
||||
field: 'lineName',
|
||||
minWidth: '90'
|
||||
},
|
||||
{
|
||||
@@ -133,82 +151,58 @@ const tableStore: any = new TableStore({
|
||||
children: [
|
||||
{
|
||||
title: '闪变',
|
||||
field: 'type',
|
||||
field: 'flicker',
|
||||
minWidth: '70',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flicker}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电压',
|
||||
field: 'type1',
|
||||
field: 'uharm',
|
||||
minWidth: '80',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type1}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.uharm}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '谐波电流',
|
||||
field: 'type2',
|
||||
field: 'iharm',
|
||||
minWidth: '80',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type2}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.iharm}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压偏差',
|
||||
field: 'type3',
|
||||
field: 'voltageDev',
|
||||
minWidth: '80',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type3}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.voltageDev}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '三相不平衡',
|
||||
field: 'type4',
|
||||
field: 'ubalance',
|
||||
minWidth: '90',
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type4}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalance}</span>`
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '10kV1#电动机',
|
||||
type: '0',
|
||||
type1: '45',
|
||||
type2: '22',
|
||||
type3: '0',
|
||||
type4: '70'
|
||||
}
|
||||
]
|
||||
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
initEcharts()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -220,27 +214,51 @@ provide('tableStore', tableStore)
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name') {
|
||||
console.log(row)
|
||||
OverLimitDetailsRef.value.open(row)
|
||||
OverLimitDetailsRef.value.open(
|
||||
row,
|
||||
tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
||||
tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
initEcharts()
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,41 +1,53 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--敏感负荷列表 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" :height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`" isGroup></Table>
|
||||
<TableHeader
|
||||
ref="TableHeaderRef"
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
v-if="fullscreen" :timeKeyList="prop.timeKey"
|
||||
></TableHeader>
|
||||
<Table
|
||||
ref="tableRef"
|
||||
@cell-click="cellClickEvent"
|
||||
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? -58 : 56}px )`"
|
||||
isGroup
|
||||
></Table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const dictData = useDictData()
|
||||
const sensitiveUserType = dictData.getBasicData('Sensitive_User_Type')
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,14 +63,11 @@ const fullscreen = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const OverLimitDetailsRef = ref()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/getList',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
|
||||
showPage: fullscreen.value ? true : false,
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
@@ -76,53 +85,28 @@ const tableStore: any = new TableStore({
|
||||
|
||||
{
|
||||
title: '敏感负荷类型',
|
||||
field: 'type',
|
||||
minWidth: '70'
|
||||
field: 'loadType',
|
||||
minWidth: '70',
|
||||
formatter: row => {
|
||||
return sensitiveUserType.filter(item => item.id == row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '是否监测',
|
||||
field: 'type1',
|
||||
field: 'isMonitor',
|
||||
minWidth: '80'
|
||||
},
|
||||
{
|
||||
title: '是否治理',
|
||||
field: 'type2',
|
||||
field: 'isGovern',
|
||||
minWidth: '80'
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '10kV1#变压器',
|
||||
type: '机房',
|
||||
type1: '是',
|
||||
type2: '100A APF'
|
||||
},
|
||||
{
|
||||
name: '380kV1#母线',
|
||||
type: 'PLC',
|
||||
type1: '是',
|
||||
type2: 'UPS'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
loadCallback: () => {}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
@@ -138,6 +122,25 @@ const cellClickEvent = ({ row, column }: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
@@ -150,15 +153,13 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 暂态事件列表 -->
|
||||
<el-dialog draggable title="暂态事件列表" v-model="dialogVisible" append-to-body width="70%">
|
||||
<!-- <TableHeader datePicker showExport :showReset="false">
|
||||
<!-- 暂态事件详情 -->
|
||||
<el-dialog draggable title="暂态事件详情 " v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点名称">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请选择监测点名称"
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-form-item label="监测点">
|
||||
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
@@ -19,8 +15,25 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader> -->
|
||||
<Table ref="tableRef" isGroup :height="height"></Table>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" isGroup :height="heightRef"></Table>
|
||||
</el-dialog>
|
||||
<!-- 查看波形 -->
|
||||
<el-dialog
|
||||
v-model="isWaveCharts"
|
||||
draggable
|
||||
title="波形分析"
|
||||
append-to-body
|
||||
v-if="isWaveCharts"
|
||||
width="70%"
|
||||
@close="handleHideCharts"
|
||||
>
|
||||
<waveFormAnalysis
|
||||
v-loading="loading"
|
||||
ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="handleHideCharts"
|
||||
:wp="wp"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -30,21 +43,36 @@ import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import { getSimpleLine } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
const harmonicRatioRef: any = ref(null)
|
||||
const options = [
|
||||
{
|
||||
value: '35kV进线',
|
||||
label: '35kV进线'
|
||||
}
|
||||
]
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const waveFormAnalysisRef: any = ref(null)
|
||||
// 波形
|
||||
const isWaveCharts = ref(false)
|
||||
const loading = ref(false)
|
||||
const wp = ref({})
|
||||
const boxoList: any = ref({})
|
||||
|
||||
const tableHeaderRef = ref()
|
||||
|
||||
const options = ref()
|
||||
const heightRef = ref(mainHeight(168, 2.1).height)
|
||||
const selectChange = (flag: boolean, h: any) => {
|
||||
heightRef.value = mainHeight(h, 2.1).height
|
||||
}
|
||||
|
||||
const getSimpleLineList = async () => {
|
||||
const res = await getSimpleLine()
|
||||
options.value = res.data
|
||||
}
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
url: '/cs-harmonic-boot/event/pageEvent',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
showPage: true,
|
||||
exportName: '暂态事件详情',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
@@ -56,76 +84,142 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
{
|
||||
title: '暂态时间',
|
||||
field: 'time',
|
||||
field: 'startTime',
|
||||
minWidth: '180'
|
||||
},
|
||||
{
|
||||
title: '测点名称',
|
||||
field: 'name',
|
||||
width: '150'
|
||||
field: 'lineName',
|
||||
minWidth: '150'
|
||||
},
|
||||
{
|
||||
title: '暂态类型',
|
||||
field: 'flicker',
|
||||
width: '100',
|
||||
field: 'tag',
|
||||
minWidth: '100'
|
||||
},
|
||||
{
|
||||
title: '特征幅值(%)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'amplitude',
|
||||
minWidth: '100'
|
||||
},
|
||||
{
|
||||
title: '暂降深度(%)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'depth',
|
||||
minWidth: '100',
|
||||
formatter: (row: any) => {
|
||||
// 当暂态类型不是电压暂升时,计算暂降深度 = 100 - 特征幅值
|
||||
if (row.row.tag !== '电压暂升') {
|
||||
const amplitude = parseFloat(row.row.amplitude)
|
||||
if (!isNaN(amplitude)) {
|
||||
return 100 - amplitude
|
||||
}
|
||||
return '-'
|
||||
} else {
|
||||
// 电压暂升时不显示暂降深度
|
||||
return '/'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '持续时间(S)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'persistTime',
|
||||
minWidth: '100'
|
||||
},
|
||||
{
|
||||
title: '严重度',
|
||||
field: 'flicker',
|
||||
width: '80'
|
||||
},
|
||||
],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
field: 'severity',
|
||||
minWidth: '80'
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
title: '波形',
|
||||
minWidth: '100',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
text: '波形分析',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !row.wavePath
|
||||
},
|
||||
|
||||
click: async row => {
|
||||
row.loading1 = true
|
||||
loading.value = true
|
||||
isWaveCharts.value = true
|
||||
dialogVisible.value = false
|
||||
// 在打开弹窗时立即设置高度
|
||||
nextTick(() => {
|
||||
if (waveFormAnalysisRef.value) {
|
||||
// waveFormAnalysisRef.value.setHeight(false, 360)
|
||||
waveFormAnalysisRef.value.setHeight(999, 130, 1.6666666)
|
||||
}
|
||||
})
|
||||
await analyseWave(row.id)
|
||||
.then(res => {
|
||||
row.loading1 = false
|
||||
if (res != undefined) {
|
||||
boxoList.value = row
|
||||
// boxoList.value = {
|
||||
// ...row,
|
||||
// duration: row.persistTime // 将 persistTime 值赋给 duration
|
||||
// }
|
||||
boxoList.value.featureAmplitude =
|
||||
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
||||
boxoList.value.systemType = 'YPT'
|
||||
wp.value = res.data
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
row.loading1 = false
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
nextTick(() => {
|
||||
waveFormAnalysisRef.value &&
|
||||
waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
name: 'edit',
|
||||
text: '暂无波形',
|
||||
type: 'info',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !!row.wavePath
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const open = async (row: any) => {
|
||||
const open = async (time: any) => {
|
||||
dialogVisible.value = true
|
||||
getSimpleLineList()
|
||||
tableStore.table.params.lineId = ''
|
||||
nextTick(() => {
|
||||
tableHeaderRef.value.setInterval(5)
|
||||
tableHeaderRef.value.setTimeInterval([time, time])
|
||||
tableStore.table.params.searchBeginTime = time
|
||||
tableStore.table.params.searchEndTime = time
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name') {
|
||||
harmonicRatioRef.value.openDialog(row)
|
||||
}
|
||||
const handleHideCharts = () => {
|
||||
isWaveCharts.value = false
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,35 +1,57 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂态事件明细 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<el-calendar v-model="value" :style="{ height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`, overflow: 'auto' }">
|
||||
<TableHeader
|
||||
:showReset="false"
|
||||
ref="TableHeaderRef"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
v-if="fullscreen"
|
||||
:timeKeyList="prop.timeKey"
|
||||
></TableHeader>
|
||||
<el-calendar
|
||||
v-model="value"
|
||||
:style="{
|
||||
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px )`,
|
||||
overflow: 'auto'
|
||||
}"
|
||||
v-loading="tableStore.table.loading"
|
||||
>
|
||||
<template #date-cell="{ data }">
|
||||
<div style="height: 100%; padding: 8px" :style="{ background: setBackground(data.day) }">
|
||||
<div
|
||||
style="padding: 8px"
|
||||
:style="{
|
||||
background: setBackground(data.day),
|
||||
height: `calc((${prop.height} - 100px - ${headerHeight}px + ${fullscreen ? 0 : 56}px) / 5 )`
|
||||
}"
|
||||
>
|
||||
<p :class="data.isSelected ? 'is-selected' : ''">
|
||||
{{ data.day.split('-').slice(2).join('-') }}
|
||||
</p>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
placement="top"
|
||||
:hide-after="0"
|
||||
v-if="list?.filter(item => item.time == data.day)[0]?.type || false"
|
||||
>
|
||||
<el-tooltip effect="dark" placement="top" :hide-after="0" v-if="hasEventData(data.day)">
|
||||
<template #content>
|
||||
<!-- <span v-html="list?.filter(item => item.time == data.day)[0]?.type || ''"></span> -->
|
||||
<div v-for="item in list?.filter(item => item.time == data.day)">
|
||||
<div>电压暂降:{{ item.type || '' }}</div>
|
||||
<div>电压中断:{{ item.type1 || '' }}</div>
|
||||
<div>电压暂升:{{ item.type2 || '' }}</div>
|
||||
<div v-for="item in list?.filter((item:any) => item.name == data.day)">
|
||||
<div>电压暂降:{{ item.eventDown || 0 }}</div>
|
||||
<div>电压中断:{{ item.eventOff || 0 }}</div>
|
||||
<div>电压暂升:{{ item.eventUp || 0 }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<div
|
||||
style="text-decoration: underline"
|
||||
:style="{ height: `calc(${prop.height} / 5 - 47px)`, overflow: 'auto' }"
|
||||
v-for="item in list?.filter(item => item.time == data.day)"
|
||||
class="details"
|
||||
v-for="item in list?.filter((item:any) => item.name == data.day)"
|
||||
@click="descentClick(item)"
|
||||
>
|
||||
<div @click="descentClick">电压暂降:{{ item.type || '' }}</div>
|
||||
<div>电压中断:{{ item.type1 || '' }}</div>
|
||||
<div>电压暂升:{{ item.type2 || '' }}</div>
|
||||
<!-- <div>电压暂降:{{ item.eventDown || 0 }}</div>
|
||||
<div>电压中断:{{ item.eventOff || 0 }}</div>
|
||||
<div>电压暂升:{{ item.eventUp || 0 }}</div> -->
|
||||
<template v-if="fullscreen">
|
||||
<div>电压暂降:{{ item.eventDown || 0 }}</div>
|
||||
<div>电压中断:{{ item.eventOff || 0 }}</div>
|
||||
<div>电压暂升:{{ item.eventUp || 0 }}</div>
|
||||
</template>
|
||||
<template v-else>暂态事件</template>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
@@ -40,37 +62,41 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { dayjs } from 'element-plus'
|
||||
import TransientList from './components/transientList.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const hasEventData = (day: string) => {
|
||||
const item = list.value?.find((item: any) => item.name == day)
|
||||
if (!item) return false
|
||||
|
||||
return (item.eventDown || item.eventOff || item.eventUp) > 0
|
||||
}
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,88 +116,32 @@ dayjs.en.weekStart = 1 //设置日历的周起始日为星期一
|
||||
const value = ref(new Date())
|
||||
|
||||
const transientListRef = ref()
|
||||
const list = ref([
|
||||
{
|
||||
time: '2025-10-01',
|
||||
key: 81,
|
||||
type: 1,
|
||||
type1: 1,
|
||||
type2: 1
|
||||
},
|
||||
{
|
||||
time: '2025-10-31',
|
||||
key: 81,
|
||||
type: 1,
|
||||
type1: 1,
|
||||
type2: 1
|
||||
},
|
||||
{
|
||||
time: '2025-10-08',
|
||||
key: 20,
|
||||
type: 1,
|
||||
type1: 1,
|
||||
type2: 1
|
||||
},
|
||||
{
|
||||
time: '2025-10-16',
|
||||
key: 20,
|
||||
type: 1,
|
||||
type1: 1,
|
||||
type2: 1
|
||||
},
|
||||
{
|
||||
time: '2025-10-23',
|
||||
key: 20,
|
||||
type: 1,
|
||||
type1: 1,
|
||||
type2: 1
|
||||
},
|
||||
{
|
||||
time: '2025-10-04',
|
||||
key: 0
|
||||
},
|
||||
{
|
||||
time: '2025-10-05',
|
||||
key: 0
|
||||
}
|
||||
])
|
||||
const list = ref()
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/csevent/getEventDate',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
|
||||
column: [],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
value.value = tableStore.table.params.searchBeginTime
|
||||
list.value = tableStore.table.data
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref([])
|
||||
|
||||
const setBackground = (value: string) => {
|
||||
let data = []
|
||||
data = list.value?.filter(item => item.time == value)
|
||||
data = list.value?.filter((item: any) => item.name == value)
|
||||
|
||||
if (data && data?.length > 0) {
|
||||
if (data[0].key > 0) {
|
||||
if (data[0].eventDown > 0 || data[0].eventOff > 0 || data[0].eventUp > 0) {
|
||||
return '#Ff660090'
|
||||
}
|
||||
}
|
||||
@@ -179,52 +149,69 @@ const setBackground = (value: string) => {
|
||||
return '#fff'
|
||||
}
|
||||
|
||||
provide('tableRef', tableRef)
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
// 电压暂降点击事件
|
||||
const descentClick = () => {
|
||||
transientListRef.value.open()
|
||||
const descentClick = (item: any) => {
|
||||
transientListRef.value.open(item.name)
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-calendar) {
|
||||
.el-calendar__header {
|
||||
.el-calendar__button-group {
|
||||
display: none;
|
||||
}
|
||||
.el-calendar__body {
|
||||
padding: 0px !important;
|
||||
height: 100%;
|
||||
height: calc(100% - 46px);
|
||||
.el-calendar-table {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.el-calendar-day {
|
||||
// height: calc(912px / 5 );
|
||||
height: 100%;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
.details {
|
||||
height: calc(100% - 20px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
.el-calendar-table__row {
|
||||
.next {
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂态事件概率分布 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<TableHeader ref="TableHeaderRef" :timeKeyList="prop.timeKey" :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`
|
||||
}"
|
||||
/>
|
||||
<my-echart
|
||||
class="mt10"
|
||||
:options="echartList1"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -18,34 +24,31 @@
|
||||
import { ref, onMounted, provide, reactive, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,48 +66,66 @@ const fullscreen = computed(() => {
|
||||
|
||||
const config = useConfig()
|
||||
|
||||
const echartList = ref({
|
||||
options: {
|
||||
xAxis: null,
|
||||
yAxis: null,
|
||||
dataZoom: null,
|
||||
backgroundColor: '#fff',
|
||||
tooltip: {
|
||||
// trigger: 'axis'
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
formatter: function (params: any) {
|
||||
console.log(params)
|
||||
var tips = ''
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
tips += params[i].name + '</br/>'
|
||||
tips += '监测点数' + ':' + ' ' + ' ' + params[i].value + '</br/>'
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: '暂态事件概率分布',
|
||||
x: 'center'
|
||||
},
|
||||
const echartList = ref({})
|
||||
|
||||
visualMap: {
|
||||
max: 20,
|
||||
show: false,
|
||||
inRange: {
|
||||
color: ['#313695', '#00BB00', '#ff8000', '#a50026']
|
||||
}
|
||||
const echartList1 = ref({})
|
||||
|
||||
|
||||
const processDataForChart = (rawData: any[]) => {
|
||||
// 将后端返回的扁平数据转换为 ECharts 需要的三维坐标格式 [x, y, z]
|
||||
const chartData = rawData.map(item => [item.x, item.y, item.z])
|
||||
|
||||
return chartData
|
||||
}
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-harmonic-boot/csevent/getEventCoords',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
setTime()
|
||||
},
|
||||
xAxis3D: {
|
||||
type: 'category',
|
||||
name: '特征幅值',
|
||||
data: [
|
||||
loadCallback: () => {
|
||||
const processedData = processDataForChart(tableStore.table.data.innerList || [])
|
||||
const trendList = tableStore.table.data.trendList || []
|
||||
const xlist = tableStore.table.data.xlist || []
|
||||
|
||||
// 处理趋势图数据
|
||||
const seriesData = trendList.map((item: any) => {
|
||||
// 根据接口返回的name字段确定系列名称和颜色
|
||||
let name = ''
|
||||
let color = ''
|
||||
|
||||
switch (item.name) {
|
||||
case 'Evt_Sys_DipStr':
|
||||
name = '电压暂降'
|
||||
color = '#FFBF00'
|
||||
break
|
||||
case 'Evt_Sys_IntrStr':
|
||||
name = '电压中断'
|
||||
color = '#FF9100'
|
||||
break
|
||||
case 'Evt_Sys_SwlStr':
|
||||
name = '电压暂升'
|
||||
color = config.layout.elementUiPrimary[0]
|
||||
break
|
||||
default:
|
||||
name = item.name
|
||||
color = '#000000'
|
||||
}
|
||||
|
||||
return {
|
||||
name: name,
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
color: color,
|
||||
data: item.trendList?.map((value: number, index: number) => [xlist[index], value]) || []
|
||||
}
|
||||
})
|
||||
|
||||
// 获取x轴和y轴的标签值
|
||||
const xLabels = [
|
||||
'0-10%',
|
||||
'10%-20%',
|
||||
'20%-30%',
|
||||
@@ -115,36 +136,58 @@ const echartList = ref({
|
||||
'70%-80%',
|
||||
'80%-90%',
|
||||
'90%-100%'
|
||||
],
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#111'
|
||||
]
|
||||
const yLabels = ['0-0.01s', '0.01s-0.1s', '0.1s-1s', '1s-10s', '10s']
|
||||
|
||||
echartList.value = {
|
||||
options: {
|
||||
xAxis: null,
|
||||
yAxis: null,
|
||||
dataZoom: null,
|
||||
backgroundColor: '#fff',
|
||||
tooltip: {
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
formatter: function (params: any) {
|
||||
var tips = ''
|
||||
tips += '持续时间: ' + yLabels[params.value[1]] + '</br>'
|
||||
tips += '特征幅值: ' + xLabels[params.value[0]] + '</br>'
|
||||
tips += '事件次数: ' + params.value[2] + '</br>'
|
||||
return tips
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111'
|
||||
title: {
|
||||
text: '暂态事件概率分布',
|
||||
x: 'center'
|
||||
},
|
||||
visualMap: {
|
||||
max: 500,
|
||||
show: false,
|
||||
inRange: {
|
||||
color: ['#313695', '#00BB00', '#ff8000', '#a50026']
|
||||
}
|
||||
},
|
||||
xAxis3D: {
|
||||
type: 'category',
|
||||
name: '特征幅值',
|
||||
data: xLabels,
|
||||
nameGap: 40,
|
||||
|
||||
},
|
||||
yAxis3D: {
|
||||
type: 'category',
|
||||
name: '持续时间',
|
||||
data: ['0-0.01s', '0.01s-0.1s', '0.1s-1s', '1s-10s', '10s'],
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#111'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#111'
|
||||
},
|
||||
data: yLabels,
|
||||
nameGap: 40,
|
||||
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
// 使用深浅的间隔色
|
||||
color: ['#111'],
|
||||
type: 'dashed',
|
||||
opacity: 0.5
|
||||
}
|
||||
@@ -152,15 +195,16 @@ const echartList = ref({
|
||||
},
|
||||
zAxis3D: {
|
||||
type: 'value',
|
||||
splitNumber: 10,
|
||||
minInterval: 10,
|
||||
name: '暂态事件次数'
|
||||
name: '暂态事件次数',
|
||||
nameGap: 30,
|
||||
},
|
||||
grid3D: {
|
||||
viewControl: {
|
||||
projection: 'perspective',
|
||||
distance: 250
|
||||
},
|
||||
|
||||
boxWidth: 200,
|
||||
boxDepth: 80,
|
||||
light: {
|
||||
@@ -175,11 +219,7 @@ const echartList = ref({
|
||||
series: [
|
||||
{
|
||||
type: 'bar3D',
|
||||
data: [
|
||||
[0, 0, 1],
|
||||
[0, 1, 1],
|
||||
[0.2, 1]
|
||||
],
|
||||
data: processedData,
|
||||
shading: 'realistic',
|
||||
label: {
|
||||
show: false,
|
||||
@@ -189,177 +229,32 @@ const echartList = ref({
|
||||
}
|
||||
},
|
||||
|
||||
itemStyle: {
|
||||
opacity: 1
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
textStyle: {
|
||||
fontSize: 20,
|
||||
color: '#900'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#900'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const echartList1 = ref({
|
||||
}
|
||||
|
||||
echartList1.value = {
|
||||
title: {
|
||||
text: '越限时间概率分布'
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
// name: '时间',
|
||||
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
|
||||
type: 'time',
|
||||
type: 'category',
|
||||
data: xlist,
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
formatter: '{value}'
|
||||
}
|
||||
},
|
||||
|
||||
yAxis: {
|
||||
name: '次' // 给X轴加单位
|
||||
name: '次'
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
name: '电压中断',
|
||||
color: '#FF9100',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 10],
|
||||
['2025-10-16 07:15:00', 10],
|
||||
['2025-10-16 07:30:00', 10],
|
||||
['2025-10-16 07:45:00', 10],
|
||||
['2025-10-16 08:00:00', 30],
|
||||
['2025-10-16 08:15:00', 50],
|
||||
['2025-10-16 08:30:00', 60],
|
||||
['2025-10-16 08:45:00', 70],
|
||||
['2025-10-16 09:00:00', 100],
|
||||
['2025-10-16 09:15:00', 120],
|
||||
['2025-10-16 09:30:00', 130],
|
||||
['2025-10-16 09:45:00', 140],
|
||||
['2025-10-16 10:00:00', 160],
|
||||
['2025-10-16 10:15:00', 160],
|
||||
['2025-10-16 10:30:00', 130],
|
||||
['2025-10-16 10:45:00', 120],
|
||||
['2025-10-16 11:00:00', 140],
|
||||
['2025-10-16 11:15:00', 80],
|
||||
['2025-10-16 11:30:00', 70],
|
||||
['2025-10-16 11:45:00', 90],
|
||||
['2025-10-16 12:00:00', 60],
|
||||
['2025-10-16 12:15:00', 60],
|
||||
['2025-10-16 12:30:00', 60],
|
||||
['2025-10-16 12:45:00', 60]
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
color: '#FFBF00',
|
||||
name: '电压暂降',
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 1],
|
||||
['2025-10-16 07:15:00', 1],
|
||||
['2025-10-16 07:30:00', 1],
|
||||
['2025-10-16 07:45:00', 1],
|
||||
['2025-10-16 08:00:00', 3],
|
||||
['2025-10-16 08:15:00', 5],
|
||||
['2025-10-16 08:30:00', 6],
|
||||
['2025-10-16 08:45:00', 7],
|
||||
['2025-10-16 09:00:00', 10],
|
||||
['2025-10-16 09:15:00', 12],
|
||||
['2025-10-16 09:30:00', 13],
|
||||
['2025-10-16 09:45:00', 14],
|
||||
['2025-10-16 10:00:00', 16],
|
||||
['2025-10-16 10:15:00', 16],
|
||||
['2025-10-16 10:30:00', 13],
|
||||
['2025-10-16 10:45:00', 12],
|
||||
['2025-10-16 11:00:00', 14],
|
||||
['2025-10-16 11:15:00', 8],
|
||||
['2025-10-16 11:30:00', 7],
|
||||
['2025-10-16 11:45:00', 9],
|
||||
['2025-10-16 12:00:00', 6],
|
||||
['2025-10-16 12:15:00', 6],
|
||||
['2025-10-16 12:30:00', 6],
|
||||
['2025-10-16 12:45:00', 6]
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
// smooth: true,
|
||||
name: '电压暂升',
|
||||
color: config.layout.elementUiPrimary[0],
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 19],
|
||||
['2025-10-16 07:15:00', 19],
|
||||
['2025-10-16 07:30:00', 19],
|
||||
['2025-10-16 07:45:00', 19],
|
||||
['2025-10-16 08:00:00', 39],
|
||||
['2025-10-16 08:15:00', 59],
|
||||
['2025-10-16 08:30:00', 69],
|
||||
['2025-10-16 08:45:00', 79],
|
||||
['2025-10-16 09:00:00', 109],
|
||||
['2025-10-16 09:15:00', 129],
|
||||
['2025-10-16 09:30:00', 139],
|
||||
['2025-10-16 09:45:00', 149],
|
||||
['2025-10-16 10:00:00', 169],
|
||||
['2025-10-16 10:15:00', 169],
|
||||
['2025-10-16 10:30:00', 139],
|
||||
['2025-10-16 10:45:00', 129],
|
||||
['2025-10-16 11:00:00', 149],
|
||||
['2025-10-16 11:15:00', 89],
|
||||
['2025-10-16 11:30:00', 79],
|
||||
['2025-10-16 11:45:00', 99],
|
||||
['2025-10-16 12:00:00', 69],
|
||||
['2025-10-16 12:15:00', 69],
|
||||
['2025-10-16 12:30:00', 69],
|
||||
['2025-10-16 12:45:00', 69]
|
||||
]
|
||||
series: seriesData
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = []
|
||||
}
|
||||
})
|
||||
|
||||
@@ -371,22 +266,41 @@ provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -2,28 +2,39 @@
|
||||
<div>
|
||||
<!-- 暂态事件详情 -->
|
||||
<el-dialog draggable title="暂态事件详情 " v-model="dialogVisible" append-to-body width="70%">
|
||||
<TableHeader datePicker showExport :showReset="false">
|
||||
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef" @selectChange="selectChange">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点名称">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请选择监测点名称"
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-form-item label="监测点">
|
||||
<el-select filterable v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="height"></Table>
|
||||
<Table ref="tableRef" isGroup :height="heightRef"></Table>
|
||||
</el-dialog>
|
||||
<!-- 查看波形 -->
|
||||
<HarmonicRatio ref="harmonicRatioRef" />
|
||||
<el-dialog
|
||||
v-model="isWaveCharts"
|
||||
draggable
|
||||
title="波形分析"
|
||||
append-to-body
|
||||
width="70%"
|
||||
@close="handleHideCharts"
|
||||
>
|
||||
<waveFormAnalysis
|
||||
v-loading="loading"
|
||||
v-if="isWaveCharts"
|
||||
ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="handleHideCharts"
|
||||
:wp="wp"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -32,21 +43,35 @@ import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import HarmonicRatio from '@/components/cockpit/listOfMainMonitoringPoints/components/harmonicRatio.vue'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import { getSimpleLine } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
|
||||
const dialogVisible: any = ref(false)
|
||||
const harmonicRatioRef: any = ref(null)
|
||||
const options = [
|
||||
{
|
||||
value: '35kV进线',
|
||||
label: '35kV进线'
|
||||
}
|
||||
]
|
||||
const height = mainHeight(0, 2).height as any
|
||||
const waveFormAnalysisRef: any = ref(null)
|
||||
// 波形
|
||||
const isWaveCharts = ref(false)
|
||||
const loading = ref(false)
|
||||
const wp = ref({})
|
||||
const boxoList: any = ref({})
|
||||
|
||||
const tableHeaderRef = ref()
|
||||
|
||||
const options = ref()
|
||||
const heightRef = ref(mainHeight(168, 2.2).height)
|
||||
const selectChange = (flag: boolean, h: any) => {
|
||||
heightRef.value = mainHeight(h, 2.2).height
|
||||
}
|
||||
|
||||
const getSimpleLineList = async () => {
|
||||
const res = await getSimpleLine()
|
||||
options.value = res.data
|
||||
}
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
url: '/cs-harmonic-boot/event/pageEvent',
|
||||
method: 'POST',
|
||||
publicHeight: 30,
|
||||
showPage: false,
|
||||
showPage: true,
|
||||
exportName: '主要监测点列表',
|
||||
column: [
|
||||
{
|
||||
@@ -59,92 +84,141 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
{
|
||||
title: '暂态时间',
|
||||
field: 'time',
|
||||
field: 'startTime',
|
||||
minWidth: '180'
|
||||
},
|
||||
{
|
||||
title: '测点名称',
|
||||
field: 'name',
|
||||
width: '150'
|
||||
field: 'lineName',
|
||||
minWidth: '150'
|
||||
},
|
||||
{
|
||||
title: '暂态类型',
|
||||
field: 'flicker',
|
||||
width: '100',
|
||||
field: 'tag',
|
||||
minWidth: '100'
|
||||
},
|
||||
{
|
||||
title: '特征幅值(%)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'amplitude',
|
||||
minWidth: '100'
|
||||
},
|
||||
{
|
||||
title: '暂降深度(%)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'depth',
|
||||
minWidth: '100',
|
||||
formatter: (row: any) => {
|
||||
// 当暂态类型不是电压暂升时,计算暂降深度 = 100 - 特征幅值
|
||||
if (row.row.tag !== '电压暂升') {
|
||||
const amplitude = parseFloat(row.row.amplitude)
|
||||
if (!isNaN(amplitude)) {
|
||||
return 100 - amplitude
|
||||
}
|
||||
return '-'
|
||||
} else {
|
||||
// 电压暂升时不显示暂降深度
|
||||
return '/'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '持续时间(S)',
|
||||
field: 'flicker',
|
||||
width: '100'
|
||||
field: 'persistTime',
|
||||
minWidth: '100'
|
||||
},
|
||||
{
|
||||
title: '严重度',
|
||||
field: 'flicker',
|
||||
width: '80'
|
||||
field: 'severity',
|
||||
minWidth: '80'
|
||||
},
|
||||
{
|
||||
title: '波形',
|
||||
width: '100',
|
||||
width: '90',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'check',
|
||||
title: '查看波形',
|
||||
name: 'edit',
|
||||
text: '波形分析',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
disabled: row => {
|
||||
return !row.wavePath
|
||||
},
|
||||
|
||||
click: async row => {
|
||||
row.loading1 = true
|
||||
loading.value = true
|
||||
isWaveCharts.value = true
|
||||
dialogVisible.value = false
|
||||
// 在打开弹窗时立即设置高度
|
||||
nextTick(() => {
|
||||
if (waveFormAnalysisRef.value) {
|
||||
// waveFormAnalysisRef.value.setHeight(false, 360)
|
||||
waveFormAnalysisRef.value.setHeight(999, 130, 1.6666666)
|
||||
}
|
||||
})
|
||||
await analyseWave(row.id)
|
||||
.then(res => {
|
||||
row.loading1 = false
|
||||
if (res != undefined) {
|
||||
boxoList.value = row
|
||||
// boxoList.value = {
|
||||
// ...row,
|
||||
// duration: row.persistTime // 将 persistTime 值赋给 duration
|
||||
// }
|
||||
boxoList.value.featureAmplitude =
|
||||
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
||||
boxoList.value.systemType = 'YPT'
|
||||
wp.value = res.data
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
row.loading1 = false
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
nextTick(() => {
|
||||
waveFormAnalysisRef.value &&
|
||||
waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
text: '暂无波形',
|
||||
type: 'info',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !!row.wavePath
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
},
|
||||
{
|
||||
time: '2024-01-01 00:00:00',
|
||||
name: '35kV进线',
|
||||
flicker: '0'
|
||||
}
|
||||
]
|
||||
}
|
||||
loadCallback: () => {}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
const open = async (row: any) => {
|
||||
const open = async (row: any, searchBeginTime: any, searchEndTime: any) => {
|
||||
dialogVisible.value = true
|
||||
getSimpleLineList()
|
||||
tableStore.table.params.lineId = row.id
|
||||
nextTick(() => {
|
||||
tableHeaderRef.value.setTimeInterval([searchBeginTime, searchEndTime])
|
||||
tableStore.table.params.searchBeginTime = searchBeginTime
|
||||
tableStore.table.params.searchEndTime = searchEndTime
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name') {
|
||||
harmonicRatioRef.value.openDialog(row)
|
||||
}
|
||||
const handleHideCharts = () => {
|
||||
isWaveCharts.value = false
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--暂态事件统计 -->
|
||||
<TableHeader :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
|
||||
<TableHeader
|
||||
ref="TableHeaderRef"
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
datePicker
|
||||
v-if="fullscreen" :timeKeyList="prop.timeKey"
|
||||
></TableHeader>
|
||||
<my-echart
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
@@ -24,35 +30,34 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import TransientStatisticsDetail from './components/transientStatisticsDetail.vue'
|
||||
import TransientStatisticsDetail from '@/components/cockpit/transientStatistics/components/transientStatisticsDetail.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { netEventEcharts } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,32 +74,43 @@ const fullscreen = computed(() => {
|
||||
})
|
||||
const config = useConfig()
|
||||
|
||||
const data = [
|
||||
const data = ref()
|
||||
|
||||
const echartList = ref()
|
||||
|
||||
const eventEcharts = () => {
|
||||
netEventEcharts({
|
||||
searchBeginTime: tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
||||
searchEndTime: tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
||||
}).then(res => {
|
||||
// 整理接口数据为图表所需格式
|
||||
const rawData = res.data || {}
|
||||
data.value = [
|
||||
{
|
||||
name: '电压中断',
|
||||
value: 4
|
||||
value: rawData.eventOff || 0
|
||||
},
|
||||
{
|
||||
name: '电压暂降',
|
||||
value: 41
|
||||
value: rawData.eventDown || 0
|
||||
},
|
||||
{
|
||||
name: '电压暂升',
|
||||
value: 46
|
||||
value: rawData.eventUp || 0
|
||||
}
|
||||
]
|
||||
const echartList = ref({
|
||||
title: {},
|
||||
]
|
||||
|
||||
echartList.value = {
|
||||
title: {},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
top: 'center',
|
||||
right: '5%',
|
||||
top: '50',
|
||||
right: '10',
|
||||
formatter: function (e: any) {
|
||||
return e + ' ' + data.filter(item => item.name == e)[0].value + '次'
|
||||
return e + ' ' + data.value.filter((item: any) => item.name == e)[0].value + '次'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
@@ -116,7 +132,7 @@ const echartList = ref({
|
||||
left: 'center'
|
||||
},
|
||||
{
|
||||
text: data[0].value + data[1].value + data[2].value + '次',
|
||||
text: rawData.eventOff + rawData.eventDown + rawData.eventUp + '次',
|
||||
left: 'center',
|
||||
top: 'center'
|
||||
}
|
||||
@@ -128,20 +144,21 @@ const echartList = ref({
|
||||
radius: ['50%', '70%'],
|
||||
label: {
|
||||
show: false,
|
||||
position: 'outside',
|
||||
textStyle: {
|
||||
//数值样式
|
||||
}
|
||||
position: 'outside'
|
||||
},
|
||||
name: '事件统计',
|
||||
data: data
|
||||
data: data.value
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const transientStatisticsDetailRef = ref()
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/dept/deptTree',
|
||||
url: '/cs-harmonic-boot/csevent/netEventTable',
|
||||
method: 'POST',
|
||||
|
||||
showPage: false,
|
||||
@@ -163,75 +180,40 @@ const tableStore: any = new TableStore({
|
||||
|
||||
{
|
||||
title: '电压中断(次)',
|
||||
field: 'type',
|
||||
field: 'eventOff',
|
||||
minWidth: '70',
|
||||
sortable: true,
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.eventOff}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压暂降(次)',
|
||||
field: 'type1',
|
||||
field: 'eventDown',
|
||||
minWidth: '80',
|
||||
sortable: true,
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type1}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.eventDown}</span>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '电压暂升(次)',
|
||||
field: 'type2',
|
||||
field: 'eventUp',
|
||||
minWidth: '80',
|
||||
sortable: true,
|
||||
render: 'customTemplate',
|
||||
customTemplate: (row: any) => {
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type2}</span>`
|
||||
return `<span style='cursor: pointer;text-decoration: underline;'>${row.eventUp}</span>`
|
||||
}
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
setTime()
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '35kV1进线',
|
||||
type: '2',
|
||||
type1: '38',
|
||||
type2: '35'
|
||||
},
|
||||
{
|
||||
name: '35kV1变压器',
|
||||
type: '2',
|
||||
type1: '1',
|
||||
type2: '3'
|
||||
},
|
||||
{
|
||||
name: '35kV1母线',
|
||||
type: '0',
|
||||
type1: '1',
|
||||
type2: '4'
|
||||
},
|
||||
{
|
||||
name: '35kV2母线',
|
||||
type: '0',
|
||||
type1: '1',
|
||||
type2: '4'
|
||||
}
|
||||
]
|
||||
eventEcharts()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -243,7 +225,30 @@ provide('tableStore', tableStore)
|
||||
// 点击行
|
||||
const cellClickEvent = ({ row, column }: any) => {
|
||||
if (column.field != 'name') {
|
||||
transientStatisticsDetailRef.value.open(row)
|
||||
transientStatisticsDetailRef.value.open(
|
||||
row,
|
||||
tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
||||
tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,15 +264,13 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,96 +1,111 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--趋势对比 -->
|
||||
<TableHeader :showReset="false" datePicker @selectChange="selectChange" v-if="fullscreen">
|
||||
<TableHeader
|
||||
datePicker
|
||||
ref="TableHeaderRef"
|
||||
:timeKeyList="prop.timeKey"
|
||||
:showReset="false"
|
||||
@selectChange="selectChange"
|
||||
v-if="fullscreen"
|
||||
>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点名称">
|
||||
<el-form-item label="监测对象">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.power"
|
||||
placeholder="请选择监测点名称"
|
||||
filterable
|
||||
v-model="tableStore.table.params.sensitiveUserId"
|
||||
placeholder="请选择监测对象"
|
||||
clearable
|
||||
style="width: 130px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item in idList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="监测点名称">
|
||||
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称" clearable>
|
||||
<el-option
|
||||
v-for="item in lineIdList"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="电能质量指标">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.indicator"
|
||||
placeholder="请选择电能质量指标"
|
||||
clearable
|
||||
style="width: 130px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indicatorList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-select v-model="tableStore.table.params.indicator" placeholder="请选择电能质量指标" clearable>
|
||||
<el-option v-for="item in indicatorList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="谐波次数">
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="tableStore.table.params.dataLevel">
|
||||
<el-radio-button label="一次值" value="Primary" />
|
||||
<el-radio-button label="二次值" value="Secondary" />
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.exceedingTheLimit"
|
||||
style="min-width: 120px !important"
|
||||
placeholder="请选择"
|
||||
v-model="tableStore.table.params.valueType"
|
||||
>
|
||||
<el-option value="max" label="最大值"></el-option>
|
||||
<el-option value="min" label="最小值"></el-option>
|
||||
<el-option value="avg" label="平均值"></el-option>
|
||||
<el-option value="cp95" label="cp95"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div v-if="shouldShowHarmonicCount()" style="display: flex; color: var(--el-text-color-regular)">
|
||||
<span style="width: 160px">{{ getHarmonicTypeName() }}谐波次数</span>
|
||||
<el-select
|
||||
v-model="tableStore.table.params.harmonicCount"
|
||||
placeholder="请选择谐波次数"
|
||||
clearable
|
||||
style="width: 90px"
|
||||
style="min-width: 80px !important"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in exceedingTheLimitList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
v-for="num in harmonicCountOptions"
|
||||
:key="num"
|
||||
:label="num"
|
||||
:value="num"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<my-echart
|
||||
v-loading="tableStore.table.loading"
|
||||
class="tall"
|
||||
:options="echartList"
|
||||
:style="{ width: prop.width, height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)` }"
|
||||
:style="{
|
||||
width: prop.width,
|
||||
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, reactive, watch, h, computed } from 'vue'
|
||||
import { ref, onMounted, provide, reactive, watch, h, computed, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: String },
|
||||
h: { type: String },
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
timeValue: { type: Object }
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const timeCacheStore = useTimeCacheStore()
|
||||
const TableHeaderRef = ref()
|
||||
const config = useConfig()
|
||||
const powerList: any = ref([
|
||||
{
|
||||
label: '1#变压器',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '2#变压器',
|
||||
value: '2'
|
||||
}
|
||||
])
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
@@ -102,47 +117,194 @@ const fullscreen = computed(() => {
|
||||
return false
|
||||
}
|
||||
})
|
||||
const exceedingTheLimitList: any = ref([
|
||||
{
|
||||
label: '2次',
|
||||
value: '2'
|
||||
},
|
||||
{
|
||||
label: '3次',
|
||||
value: '3'
|
||||
},
|
||||
{
|
||||
label: '4次',
|
||||
value: '4'
|
||||
},
|
||||
{
|
||||
label: '5次',
|
||||
value: '5'
|
||||
}
|
||||
])
|
||||
const indicatorList: any = ref([
|
||||
{
|
||||
label: '谐波电压总畸变率',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '各次谐波电压',
|
||||
value: '2'
|
||||
},
|
||||
{
|
||||
label: '各次谐波电压',
|
||||
value: '3'
|
||||
},
|
||||
{
|
||||
label: '三相电压不平衡',
|
||||
value: '4'
|
||||
}
|
||||
])
|
||||
const echartList = ref({
|
||||
title: {
|
||||
text: '趋势对比'
|
||||
},
|
||||
// 添加谐波次数选项(2-50)
|
||||
const harmonicCountOptions = ref(Array.from({ length: 49 }, (_, i) => i + 2))
|
||||
|
||||
const indicatorList = ref()
|
||||
|
||||
const echartList = ref()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
|
||||
// 监测对象
|
||||
const idList = ref()
|
||||
|
||||
// 监测对象
|
||||
const initListByIds = () => {
|
||||
getListByIds({}).then((res: any) => {
|
||||
if (res.data.length > 0) {
|
||||
idList.value = res.data
|
||||
initCode()
|
||||
}
|
||||
})
|
||||
}
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
if (datePickerValue && datePickerValue.timeValue) {
|
||||
// 更新时间参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
||||
}
|
||||
}
|
||||
|
||||
const initCode = () => {
|
||||
queryByCode('steady_state_limit_trend').then(res => {
|
||||
queryCsDictTree(res.data.id).then(item => {
|
||||
indicatorList.value = item.data
|
||||
tableStore.table.params.indicator = indicatorList.value[0].id
|
||||
nextTick(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
// 治理前
|
||||
const chartsListBefore = ref()
|
||||
// 治理后
|
||||
const chartsListAfter = ref()
|
||||
|
||||
const setEchart = () => {
|
||||
// 从接口数据中提取治理前和治理后的数据
|
||||
const beforeData = chartsListBefore.value || []
|
||||
const afterData = chartsListAfter.value || []
|
||||
|
||||
// 按相位分组数据
|
||||
const beforeGroupedByPhase: any = {}
|
||||
const afterGroupedByPhase: any = {}
|
||||
|
||||
// 处理治理前数据
|
||||
beforeData.forEach((item: any) => {
|
||||
const phase = item.phase || 'default'
|
||||
if (!beforeGroupedByPhase[phase]) {
|
||||
beforeGroupedByPhase[phase] = []
|
||||
}
|
||||
beforeGroupedByPhase[phase].push([item.time, item.statisticalData])
|
||||
})
|
||||
|
||||
// 处理治理后数据
|
||||
afterData.forEach((item: any) => {
|
||||
const phase = item.phase || 'default'
|
||||
if (!afterGroupedByPhase[phase]) {
|
||||
afterGroupedByPhase[phase] = []
|
||||
}
|
||||
afterGroupedByPhase[phase].push([item.time, item.statisticalData])
|
||||
})
|
||||
|
||||
// 构建系列数据
|
||||
const series: any = []
|
||||
|
||||
// 定义相位颜色
|
||||
const phaseColors: any = {
|
||||
A: '#DAA520',
|
||||
B: '#2E8B57',
|
||||
C: '#A52a2a'
|
||||
}
|
||||
|
||||
// 添加治理前数据系列(实线)
|
||||
Object.keys(beforeGroupedByPhase).forEach(phase => {
|
||||
const phaseName = phase === 'default' ? '' : `${phase}相`
|
||||
const color = phaseColors[phase] || config.layout.elementUiPrimary[0]
|
||||
|
||||
series.push({
|
||||
name: `治理前${phaseName}`,
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
data: beforeGroupedByPhase[phase],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: color
|
||||
}
|
||||
},
|
||||
lineStyle: {
|
||||
type: 'solid', // 实线
|
||||
width: 2 // 线条宽度
|
||||
},
|
||||
yAxisIndex: 0
|
||||
})
|
||||
})
|
||||
|
||||
// 添加治理后数据系列(虚线)
|
||||
Object.keys(afterGroupedByPhase).forEach(phase => {
|
||||
const phaseName = phase === 'default' ? '' : `${phase}相`
|
||||
const color = phaseColors[phase] || config.layout.elementUiPrimary[0]
|
||||
|
||||
series.push({
|
||||
name: `治理后${phaseName}`,
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
data: afterGroupedByPhase[phase],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: color
|
||||
}
|
||||
},
|
||||
lineStyle: {
|
||||
type: 'dashed', // 虚线
|
||||
width: 2 // 线条宽度
|
||||
},
|
||||
yAxisIndex: 0
|
||||
})
|
||||
})
|
||||
|
||||
// 获取指标名称用于图表标题
|
||||
let titleText = '治理前后对比'
|
||||
if (beforeData.length > 0 && beforeData[0].anotherName) {
|
||||
titleText = beforeData[0].anotherName
|
||||
} else if (afterData.length > 0 && afterData[0].anotherName) {
|
||||
titleText = afterData[0].anotherName
|
||||
}
|
||||
|
||||
// 构建图例数据
|
||||
const legendData = series.map((item: any, index: number) => {
|
||||
let color = config.layout.elementUiPrimary[0]
|
||||
const name = item.name
|
||||
if (name.includes('A相')) {
|
||||
color = '#DAA520'
|
||||
} else if (name.includes('B相')) {
|
||||
color = '#2E8B57'
|
||||
} else if (name.includes('C相')) {
|
||||
color = '#A52a2a'
|
||||
}
|
||||
|
||||
// 判断是治理前还是治理后,设置不同的线条样式
|
||||
const isBefore = name.includes('治理前')
|
||||
|
||||
return {
|
||||
name: item.name,
|
||||
icon: isBefore
|
||||
? 'rect'
|
||||
: 'path://M0,2 L8,2 L8,6 L0,6 Z M12,2 L20,2 L20,6 L12,6 Z M24,2 L32,2 L32,6 L24,6 Z M36,2 L44,2 L44,6 L36,6 Z', // 矩形组成的粗虚线
|
||||
itemStyle: {
|
||||
color: color // 明确指定图例图标的颜色
|
||||
},
|
||||
lineStyle: {
|
||||
type: isBefore ? 'solid' : 'dashed', // 治理前实线,治理后虚线
|
||||
width: 2
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: titleText
|
||||
},
|
||||
legend: {
|
||||
data: legendData,
|
||||
icon: 'rect',
|
||||
itemWidth: 18,
|
||||
itemHeight: 3,
|
||||
itemStyle: {
|
||||
borderWidth: 0
|
||||
},
|
||||
lineStyle: {
|
||||
width: 2 // 确保图例线条宽度与系列线条宽度一致
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
@@ -153,146 +315,114 @@ const echartList = ref({
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
yAxis: {},
|
||||
yAxis: {
|
||||
name: beforeData.length > 0 ? beforeData[0].unit : afterData.length > 0 ? afterData[0].unit : ''
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
right: '20px'
|
||||
},
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
// name: '暂降次数',
|
||||
type: 'line',
|
||||
name: '治理前',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 1],
|
||||
['2025-10-16 07:15:00', 1],
|
||||
['2025-10-16 07:30:00', 1],
|
||||
['2025-10-16 07:45:00', 1],
|
||||
['2025-10-16 08:00:00', 3],
|
||||
['2025-10-16 08:15:00', 5],
|
||||
['2025-10-16 08:30:00', 6],
|
||||
['2025-10-16 08:45:00', 7],
|
||||
['2025-10-16 09:00:00', 10],
|
||||
['2025-10-16 09:15:00', 12],
|
||||
['2025-10-16 09:30:00', 13],
|
||||
['2025-10-16 09:45:00', 14],
|
||||
['2025-10-16 10:00:00', 16],
|
||||
['2025-10-16 10:15:00', 16],
|
||||
['2025-10-16 10:30:00', 13],
|
||||
['2025-10-16 10:45:00', 12],
|
||||
['2025-10-16 11:00:00', 14],
|
||||
['2025-10-16 11:15:00', 8],
|
||||
['2025-10-16 11:30:00', 7],
|
||||
['2025-10-16 11:45:00', 9],
|
||||
['2025-10-16 12:00:00', 6],
|
||||
['2025-10-16 12:15:00', 6],
|
||||
['2025-10-16 12:30:00', 6],
|
||||
['2025-10-16 12:45:00', 6]
|
||||
],
|
||||
itemStyle: {
|
||||
normal: {
|
||||
//这里是颜色
|
||||
color: function (params: any) {
|
||||
if (params.value[1] == 0 || params.value[1] == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return config.layout.elementUiPrimary[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxisIndex: 0
|
||||
},
|
||||
{
|
||||
name: '治理后',
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
data: [
|
||||
['2025-10-16 07:00:00', 10],
|
||||
['2025-10-16 07:15:00', 10],
|
||||
['2025-10-16 07:30:00', 10],
|
||||
['2025-10-16 07:45:00', 10],
|
||||
['2025-10-16 08:00:00', 30],
|
||||
['2025-10-16 08:15:00', 50],
|
||||
['2025-10-16 08:30:00', 60],
|
||||
['2025-10-16 08:45:00', 70],
|
||||
['2025-10-16 09:00:00', 100],
|
||||
['2025-10-16 09:15:00', 120],
|
||||
['2025-10-16 09:30:00', 130],
|
||||
['2025-10-16 09:45:00', 140],
|
||||
['2025-10-16 10:00:00', 160],
|
||||
['2025-10-16 10:15:00', 160],
|
||||
['2025-10-16 10:30:00', 130],
|
||||
['2025-10-16 10:45:00', 120],
|
||||
['2025-10-16 11:00:00', 140],
|
||||
['2025-10-16 11:15:00', 80],
|
||||
['2025-10-16 11:30:00', 70],
|
||||
['2025-10-16 11:45:00', 90],
|
||||
['2025-10-16 12:00:00', 60],
|
||||
['2025-10-16 12:15:00', 60],
|
||||
['2025-10-16 12:30:00', 60],
|
||||
['2025-10-16 12:45:00', 60]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const headerHeight = ref(57)
|
||||
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
headerHeight.value = height
|
||||
|
||||
// 如果有传入 datePicker 的值
|
||||
if (datePickerValue) {
|
||||
// 更新表格参数
|
||||
tableStore.table.params.searchBeginTime = datePickerValue.timeValue?.[0]
|
||||
tableStore.table.params.searchEndTime = datePickerValue.timeValue?.[1]
|
||||
series: series
|
||||
}
|
||||
}
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-device-boot/csGroup/sensitiveUserTrendData',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
exportName: '趋势对比',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
// 尝试从缓存获取时间值
|
||||
let beginTime, endTime
|
||||
|
||||
if (fullscreen.value) {
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached && cached.timeValue) {
|
||||
beginTime = cached.timeValue[0]
|
||||
endTime = cached.timeValue[1]
|
||||
setTime()
|
||||
if (!tableStore.table.params.sensitiveUserId && idList.value?.length > 0) {
|
||||
tableStore.table.params.sensitiveUserId = idList.value[0].id
|
||||
}
|
||||
let lists: any = []
|
||||
// 处理电能质量指标
|
||||
const selectedIndicator = indicatorList.value?.find(
|
||||
(item: any) => item.id === tableStore.table.params.indicator
|
||||
)
|
||||
if (selectedIndicator) {
|
||||
let frequencys = ''
|
||||
if (selectedIndicator.name.includes('谐波含有率')) {
|
||||
frequencys = tableStore.table.params.harmonicCount
|
||||
}
|
||||
|
||||
// 如果缓存中没有则使用默认值
|
||||
tableStore.table.params.searchBeginTime = beginTime || prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
lists.push({
|
||||
statisticalId: tableStore.table.params.indicator,
|
||||
frequency: frequencys !== null && frequencys !== undefined ? String(frequencys) : ''
|
||||
})
|
||||
}
|
||||
|
||||
tableStore.table.params.searchEndTime = endTime || prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
// 将 lists 添加到请求参数中
|
||||
tableStore.table.params.list = lists
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
// 数据加载完成后的处理
|
||||
if (tableStore.table.data) {
|
||||
chartsListBefore.value = tableStore.table.data.before
|
||||
chartsListAfter.value = tableStore.table.data.after
|
||||
setEchart()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
tableStore.table.params.power = '1'
|
||||
tableStore.table.params.indicator = '1'
|
||||
tableStore.table.params.exceedingTheLimit = '1'
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.dataLevel = 'Primary'
|
||||
tableStore.table.params.valueType = 'avg'
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
initListByIds()
|
||||
})
|
||||
|
||||
const setTime = () => {
|
||||
const time = getTime(
|
||||
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
||||
prop.timeKey,
|
||||
fullscreen.value
|
||||
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
||||
: prop.timeValue
|
||||
)
|
||||
|
||||
if (Array.isArray(time)) {
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
TableHeaderRef.value?.setInterval(time[2] - 0)
|
||||
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
||||
} else {
|
||||
console.warn('获取时间失败,time 不是一个有效数组')
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否应该显示谐波次数选择框
|
||||
const shouldShowHarmonicCount = () => {
|
||||
if (!tableStore.table.params.indicator || !indicatorList.value) return false
|
||||
|
||||
const currentIndicator = indicatorList.value.find((item: any) => item.id === tableStore.table.params.indicator)
|
||||
|
||||
return (
|
||||
currentIndicator &&
|
||||
(currentIndicator.name.includes('电压谐波含有率') || currentIndicator.name.includes('电流谐波含有率'))
|
||||
)
|
||||
}
|
||||
|
||||
// 获取谐波类型名称
|
||||
const getHarmonicTypeName = () => {
|
||||
const currentIndicator = indicatorList.value.find((item: any) => item.id === tableStore.table.params.indicator)
|
||||
|
||||
if (currentIndicator) {
|
||||
if (currentIndicator.name.includes('电压谐波含有率')) {
|
||||
return '电压'
|
||||
} else if (currentIndicator.name.includes('电流谐波含有率')) {
|
||||
return '电流'
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
@@ -300,19 +430,33 @@ watch(
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue, // 监听的目标(函数形式避免直接传递 props 导致的警告)
|
||||
() => prop.timeValue,
|
||||
(newVal, oldVal) => {
|
||||
tableStore.index()
|
||||
},
|
||||
{
|
||||
deep: true // 若 timeValue 是对象/数组,需开启深度监听
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const addMenu = () => {}
|
||||
// 监听指标变化,当指标变化时重置谐波次数
|
||||
watch(
|
||||
() => tableStore.table.params.indicator,
|
||||
newVal => {
|
||||
if (shouldShowHarmonicCount()) {
|
||||
// 如果之前没有设置过谐波次数,则默认设置为2
|
||||
if (!tableStore.table.params.harmonicCount) {
|
||||
tableStore.table.params.harmonicCount = 2
|
||||
}
|
||||
} else {
|
||||
// 如果不是谐波含有率指标,则清除谐波次数设置
|
||||
tableStore.table.params.harmonicCount = ''
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-select) {
|
||||
min-width: 80px;
|
||||
}
|
||||
// :deep(.el-select) {
|
||||
// min-width: 80px;
|
||||
// }
|
||||
</style>
|
||||
|
||||
318
src/components/echarts/rmsWorker.js
Normal file
318
src/components/echarts/rmsWorker.js
Normal file
@@ -0,0 +1,318 @@
|
||||
// 辅助函数
|
||||
const getMax = (temp, tempA, tempB, tempC) => {
|
||||
temp = temp > tempA ? temp : tempA
|
||||
temp = temp > tempB ? temp : tempB
|
||||
if (tempC !== undefined) {
|
||||
temp = temp > tempC ? temp : tempC
|
||||
}
|
||||
return temp
|
||||
}
|
||||
|
||||
const getMaxTwo = (temp, tempA, tempB) => {
|
||||
temp = temp > tempA ? temp : tempA
|
||||
temp = temp > tempB ? temp : tempB
|
||||
return temp
|
||||
}
|
||||
|
||||
const getMin = (temp, tempA, tempB, tempC) => {
|
||||
temp = temp < tempA ? temp : tempA
|
||||
temp = temp < tempB ? temp : tempB
|
||||
if (tempC !== undefined) {
|
||||
temp = temp < tempC ? temp : tempC
|
||||
}
|
||||
return temp
|
||||
}
|
||||
|
||||
const getMinOpen = (temp, tempA, tempB) => {
|
||||
temp = temp < tempA ? temp : tempA
|
||||
temp = temp < tempB ? temp : tempB
|
||||
return temp
|
||||
}
|
||||
|
||||
// 数据处理函数
|
||||
const fliteWaveData = (wp, step, iphasicValue, isOpen) => {
|
||||
const rmsData = wp.listRmsData
|
||||
const pt = Number(wp.pt) / 1000
|
||||
const ct = Number(wp.ct)
|
||||
const titleList = wp.waveTitle
|
||||
let xishu = pt
|
||||
let aTitle = '',
|
||||
bTitle = '',
|
||||
cTitle = '',
|
||||
unit = '电压'
|
||||
let rmsvFirstX = 0,
|
||||
rmsvFirstY = 0,
|
||||
rmsvSecondX = 0,
|
||||
rmsvSecondY = 0,
|
||||
firstZhou = 'a',
|
||||
secondeZhou = 'a'
|
||||
let ifmax = 0,
|
||||
ifmin = 0,
|
||||
ismax = 0,
|
||||
ismin = 0,
|
||||
rfmax = 0,
|
||||
rfmin = 0,
|
||||
rsmax = 0,
|
||||
rsmin = 0
|
||||
|
||||
const shunshiFA = []
|
||||
const shunshiFB = []
|
||||
const shunshiFC = []
|
||||
const shunshiSA = []
|
||||
const shunshiSB = []
|
||||
const shunshiSC = []
|
||||
const rmsFA = []
|
||||
const rmsFB = []
|
||||
const rmsFC = []
|
||||
const rmsSA = []
|
||||
const rmsSB = []
|
||||
const rmsSC = []
|
||||
|
||||
if (titleList[iphasicValue * step + 1]?.substring(0, 1) !== 'U') {
|
||||
xishu = ct
|
||||
unit = '电流'
|
||||
}
|
||||
|
||||
for (let i = 1; i <= iphasicValue; i++) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
aTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 2:
|
||||
bTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 3:
|
||||
cTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (rmsData[0] && rmsData[0][iphasicValue * step + 1] !== undefined) {
|
||||
rfmax = rmsData[0][iphasicValue * step + 1] * xishu
|
||||
rfmin = rmsData[0][iphasicValue * step + 1] * xishu
|
||||
rmsvFirstY = rmsData[0][iphasicValue * step + 1] * xishu
|
||||
rmsvFirstX = rmsData[0][0]
|
||||
rsmax = rmsData[0][iphasicValue * step + 1]
|
||||
rsmin = rmsData[0][iphasicValue * step + 1]
|
||||
rmsvSecondY = rmsData[0][iphasicValue * step + 1]
|
||||
rmsvSecondX = rmsData[0][0]
|
||||
}
|
||||
|
||||
for (let rms = 0; rms < rmsData.length; rms++) {
|
||||
if (!rmsData[rms] || rmsData[rms][iphasicValue * step + 1] === undefined) {
|
||||
break
|
||||
}
|
||||
|
||||
switch (iphasicValue) {
|
||||
case 1:
|
||||
const rmsFirstA = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||
rmsFA.push([rmsData[rms][0], rmsFirstA])
|
||||
rfmax = rfmax > rmsFirstA ? rfmax : rmsFirstA
|
||||
rfmin = rfmin < rmsFirstA ? rfmin : rmsFirstA
|
||||
if (rfmin < rmsvFirstY) {
|
||||
rmsvFirstY = rfmin
|
||||
firstZhou = 'a'
|
||||
rmsvFirstX = rmsData[rms][0]
|
||||
}
|
||||
|
||||
const rmsSecondA = rmsData[rms][iphasicValue * step + 1]
|
||||
rmsSA.push([rmsData[rms][0], rmsSecondA])
|
||||
rsmax = rsmax > rmsSecondA ? rsmax : rmsSecondA
|
||||
rsmin = rsmin < rmsSecondA ? rsmin : rmsSecondA
|
||||
if (rsmin < rmsvSecondY) {
|
||||
rmsvSecondY = rsmin
|
||||
secondeZhou = 'a'
|
||||
rmsvSecondX = rmsData[rms][0]
|
||||
}
|
||||
break
|
||||
case 2:
|
||||
const rmsFirstA2 = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||
const rmsFirstB2 = rmsData[rms][iphasicValue * step + 2] * xishu
|
||||
rmsFA.push([rmsData[rms][0], rmsFirstA2])
|
||||
rmsFB.push([rmsData[rms][0], rmsFirstB2])
|
||||
rfmax = getMaxTwo(rfmax, rmsFirstA2, rmsFirstB2)
|
||||
rfmin = getMinOpen(rfmin, rmsFirstA2, rmsFirstB2)
|
||||
if (rfmin < rmsvFirstY) {
|
||||
rmsvFirstY = rfmin
|
||||
if (rfmin === rmsFirstA2) {
|
||||
firstZhou = 'a'
|
||||
} else if (rfmin === rmsFirstB2) {
|
||||
firstZhou = 'b'
|
||||
}
|
||||
rmsvFirstX = rmsData[rms][0]
|
||||
}
|
||||
|
||||
const rmsSecondA2 = rmsData[rms][iphasicValue * step + 1]
|
||||
const rmsSecondB2 = rmsData[rms][iphasicValue * step + 2]
|
||||
rmsSA.push([rmsData[rms][0], rmsSecondA2])
|
||||
rmsSB.push([rmsData[rms][0], rmsSecondB2])
|
||||
rsmax = getMaxTwo(rsmax, rmsSecondA2, rmsSecondB2)
|
||||
rsmin = getMinOpen(rsmin, rmsSecondA2, rmsSecondB2)
|
||||
if (rsmin < rmsvSecondY) {
|
||||
rmsvSecondY = rsmin
|
||||
if (rsmin === rmsSecondA2) {
|
||||
secondeZhou = 'a'
|
||||
} else if (rsmin === rmsSecondB2) {
|
||||
secondeZhou = 'b'
|
||||
}
|
||||
rmsvSecondX = rmsData[rms][0]
|
||||
}
|
||||
break
|
||||
case 3:
|
||||
const rmsFirstA3 = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||
const rmsFirstB3 = rmsData[rms][iphasicValue * step + 2] * xishu
|
||||
const rmsFirstC3 = rmsData[rms][iphasicValue * step + 3] * xishu
|
||||
rmsFA.push([rmsData[rms][0], rmsFirstA3])
|
||||
rmsFB.push([rmsData[rms][0], rmsFirstB3])
|
||||
rmsFC.push([rmsData[rms][0], rmsFirstC3])
|
||||
rfmax = getMax(rfmax, rmsFirstA3, rmsFirstB3, rmsFirstC3)
|
||||
rfmin = isOpen
|
||||
? getMinOpen(rfmin, rmsFirstA3, rmsFirstC3)
|
||||
: getMin(rfmin, rmsFirstA3, rmsFirstB3, rmsFirstC3)
|
||||
if (rfmin < rmsvFirstY) {
|
||||
rmsvFirstY = rfmin
|
||||
if (rfmin === rmsFirstA3) {
|
||||
firstZhou = 'a'
|
||||
} else if (rfmin === rmsFirstB3) {
|
||||
firstZhou = 'b'
|
||||
} else {
|
||||
firstZhou = 'c'
|
||||
}
|
||||
rmsvFirstX = rmsData[rms][0]
|
||||
}
|
||||
|
||||
const rmsSecondA3 = rmsData[rms][iphasicValue * step + 1]
|
||||
const rmsSecondB3 = rmsData[rms][iphasicValue * step + 2]
|
||||
const rmsSecondC3 = rmsData[rms][iphasicValue * step + 3]
|
||||
rmsSA.push([rmsData[rms][0], rmsSecondA3])
|
||||
rmsSB.push([rmsData[rms][0], rmsSecondB3])
|
||||
rmsSC.push([rmsData[rms][0], rmsSecondC3])
|
||||
rsmax = getMax(rsmax, rmsSecondA3, rmsSecondB3, rmsSecondC3)
|
||||
rsmin = isOpen
|
||||
? getMinOpen(rsmin, rmsSecondA3, rmsSecondC3)
|
||||
: getMin(rsmin, rmsSecondA3, rmsSecondB3, rmsSecondC3)
|
||||
if (rsmin < rmsvSecondY) {
|
||||
rmsvSecondY = rsmin
|
||||
if (rsmin === rmsSecondA3) {
|
||||
secondeZhou = 'a'
|
||||
} else if (rsmin === rmsSecondB3) {
|
||||
secondeZhou = 'b'
|
||||
} else {
|
||||
secondeZhou = 'c'
|
||||
}
|
||||
rmsvSecondX = rmsData[rms][0]
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const instantF = { max: ifmax, min: ifmin }
|
||||
const instantS = { max: ismax, min: ismin }
|
||||
const RMSF = { max: rfmax, min: rfmin }
|
||||
const RMSS = { max: rsmax, min: rsmin }
|
||||
const RMSFMinDetail = { rmsvFirstX, rmsvFirstY, firstZhou }
|
||||
const RMSSMinDetail = { rmsvSecondX, rmsvSecondY, secondeZhou }
|
||||
const shunshiF = { shunshiFA, shunshiFB, shunshiFC }
|
||||
const shunshiS = { shunshiSA, shunshiSB, shunshiSC }
|
||||
const RMSFWave = { rmsFA, rmsFB, rmsFC }
|
||||
const RMSSWave = { rmsSA, rmsSB, rmsSC }
|
||||
const title = { aTitle, bTitle, cTitle, unit }
|
||||
|
||||
return {
|
||||
instantF,
|
||||
instantS,
|
||||
RMSF,
|
||||
RMSS,
|
||||
RMSFMinDetail,
|
||||
RMSSMinDetail,
|
||||
shunshiF,
|
||||
shunshiS,
|
||||
RMSFWave,
|
||||
RMSSWave,
|
||||
title,
|
||||
unit
|
||||
}
|
||||
}
|
||||
|
||||
// 监听消息
|
||||
self.onmessage = function (e) {
|
||||
const { wp, isOpen, value, boxoList } = JSON.parse(e.data)
|
||||
|
||||
try {
|
||||
const iphasicValue = wp.iphasic || 1
|
||||
|
||||
const picCounts = (wp.waveTitle.length - 1) / iphasicValue
|
||||
const waveDatas = []
|
||||
|
||||
for (let i = 0; i < picCounts; i++) {
|
||||
const data = fliteWaveData(wp, i, iphasicValue, isOpen, boxoList)
|
||||
waveDatas.push(data)
|
||||
}
|
||||
// 处理标题
|
||||
let titles = ''
|
||||
if (boxoList.systemType == 'pms') {
|
||||
titles =
|
||||
'变电站名称:' +
|
||||
boxoList.powerStationName +
|
||||
' 监测点名称:' +
|
||||
boxoList.measurementPointName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'ZL') {
|
||||
titles =
|
||||
' 监测点名称:' +
|
||||
boxoList.equipmentName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
boxoList.evtParamVVaDepth +
|
||||
' 持续时间:' +
|
||||
boxoList.evtParamTm +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'YPT') {
|
||||
titles =
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.persistTime +
|
||||
's'
|
||||
} else {
|
||||
titles =
|
||||
'变电站名称:' +
|
||||
boxoList.subName +
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
}
|
||||
// 发送处理结果回主线程
|
||||
self.postMessage({
|
||||
titles: titles,
|
||||
success: true,
|
||||
waveDatas,
|
||||
time: wp.time,
|
||||
type: wp.waveType,
|
||||
severity: wp.yzd,
|
||||
iphasic: iphasicValue
|
||||
})
|
||||
} catch (error) {
|
||||
self.postMessage({
|
||||
success: false,
|
||||
error: error.message
|
||||
})
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1596
src/components/echarts/rmsboxi1.vue
Normal file
1596
src/components/echarts/rmsboxi1.vue
Normal file
File diff suppressed because it is too large
Load Diff
203
src/components/echarts/shuWorker.js
Normal file
203
src/components/echarts/shuWorker.js
Normal file
@@ -0,0 +1,203 @@
|
||||
// waveData.worker.js
|
||||
self.addEventListener('message', function (e) {
|
||||
const { wp, value, iphasic, isOpen, boxoList } = JSON.parse(e.data)
|
||||
|
||||
// 处理波形数据的函数
|
||||
const fliteWaveData = (wp, step) => {
|
||||
// 将原有的fliteWaveData函数实现复制到这里
|
||||
const shunData = wp.listWaveData
|
||||
const pt = Number(wp.pt) / 1000
|
||||
const ct = Number(wp.ct)
|
||||
const titleList = wp.waveTitle
|
||||
let xishu = pt
|
||||
let aTitle = '',
|
||||
bTitle = '',
|
||||
cTitle = '',
|
||||
unit = '电压'
|
||||
let ifmax = 0,
|
||||
ifmin = 0,
|
||||
ismax = 0,
|
||||
ismin = 0
|
||||
|
||||
const shunshiFA = []
|
||||
const shunshiFB = []
|
||||
const shunshiFC = []
|
||||
const shunshiSA = []
|
||||
const shunshiSB = []
|
||||
const shunshiSC = []
|
||||
|
||||
if (shunData.length > 0) {
|
||||
if (titleList[iphasic * step + 1]?.substring(0, 1) !== 'U') {
|
||||
xishu = ct
|
||||
unit = '电流'
|
||||
}
|
||||
|
||||
for (let i = 1; i <= iphasic; i++) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
aTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 2:
|
||||
bTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||
break
|
||||
case 3:
|
||||
cTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (shunData[0][iphasic * step + 1] !== undefined) {
|
||||
ifmax = shunData[0][iphasic * step + 1] * xishu
|
||||
ifmin = shunData[0][iphasic * step + 1] * xishu
|
||||
ismax = shunData[0][iphasic * step + 1]
|
||||
ismin = shunData[0][iphasic * step + 1]
|
||||
}
|
||||
|
||||
for (let shun = 0; shun < shunData.length; shun++) {
|
||||
if (shunData[shun][iphasic * step + 1] === undefined) {
|
||||
break
|
||||
}
|
||||
|
||||
switch (iphasic) {
|
||||
case 1:
|
||||
const shunFirstA = shunData[shun][iphasic * step + 1] * xishu
|
||||
shunshiFA.push([shunData[shun][0], shunFirstA])
|
||||
ifmax = Math.max(ifmax, shunFirstA)
|
||||
ifmin = Math.min(ifmin, shunFirstA)
|
||||
|
||||
const shunSecondA = shunData[shun][iphasic * step + 1]
|
||||
shunshiSA.push([shunData[shun][0], shunSecondA])
|
||||
ismax = Math.max(ismax, shunSecondA)
|
||||
ismin = Math.min(ismin, shunSecondA)
|
||||
break
|
||||
case 2:
|
||||
const shunFirstA2 = shunData[shun][iphasic * step + 1] * xishu
|
||||
const shunFirstB2 = shunData[shun][iphasic * step + 2] * xishu
|
||||
shunshiFA.push([shunData[shun][0], shunFirstA2])
|
||||
shunshiFB.push([shunData[shun][0], shunFirstB2])
|
||||
ifmax = Math.max(ifmax, shunFirstA2, shunFirstB2)
|
||||
ifmin = Math.min(ifmin, shunFirstA2, shunFirstB2)
|
||||
|
||||
const shunSecondA2 = shunData[shun][iphasic * step + 1]
|
||||
const shunSecondB2 = shunData[shun][iphasic * step + 2]
|
||||
shunshiSA.push([shunData[shun][0], shunSecondA2])
|
||||
shunshiSB.push([shunData[shun][0], shunSecondB2])
|
||||
ismax = Math.max(ismax, shunSecondA2, shunSecondB2)
|
||||
ismin = Math.min(ismin, shunSecondA2, shunSecondB2)
|
||||
break
|
||||
case 3:
|
||||
const shunFirstA3 = shunData[shun][iphasic * step + 1] * xishu
|
||||
const shunFirstB3 = shunData[shun][iphasic * step + 2] * xishu
|
||||
const shunFirstC3 = shunData[shun][iphasic * step + 3] * xishu
|
||||
shunshiFA.push([shunData[shun][0], shunFirstA3])
|
||||
shunshiFB.push([shunData[shun][0], shunFirstB3])
|
||||
shunshiFC.push([shunData[shun][0], shunFirstC3])
|
||||
ifmax = Math.max(ifmax, shunFirstA3, shunFirstB3, shunFirstC3)
|
||||
ifmin = isOpen
|
||||
? Math.min(ifmin, shunFirstA3, shunFirstC3)
|
||||
: Math.min(ifmin, shunFirstA3, shunFirstB3, shunFirstC3)
|
||||
|
||||
const shunSecondA3 = shunData[shun][iphasic * step + 1]
|
||||
const shunSecondB3 = shunData[shun][iphasic * step + 2]
|
||||
const shunSecondC3 = shunData[shun][iphasic * step + 3]
|
||||
shunshiSA.push([shunData[shun][0], shunSecondA3])
|
||||
shunshiSB.push([shunData[shun][0], shunSecondB3])
|
||||
shunshiSC.push([shunData[shun][0], shunSecondC3])
|
||||
ismax = Math.max(ismax, shunSecondA3, shunSecondB3, shunSecondC3)
|
||||
ismin = isOpen
|
||||
? Math.min(ismin, shunSecondA3, shunSecondC3)
|
||||
: Math.min(ismin, shunSecondA3, shunSecondB3, shunSecondC3)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const instantF = { max: ifmax, min: ifmin }
|
||||
const instantS = { max: ismax, min: ismin }
|
||||
const shunshiF = { shunshiFA, shunshiFB, shunshiFC }
|
||||
const shunshiS = { shunshiSA, shunshiSB, shunshiSC }
|
||||
const title = { aTitle, bTitle, cTitle, unit }
|
||||
|
||||
return { instantF, instantS, shunshiF, shunshiS, title, unit }
|
||||
}
|
||||
|
||||
// 处理标题
|
||||
let titles = ''
|
||||
if (boxoList.systemType == 'pms') {
|
||||
titles =
|
||||
'变电站名称:' +
|
||||
boxoList.powerStationName +
|
||||
' 监测点名称:' +
|
||||
boxoList.measurementPointName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'ZL') {
|
||||
titles =
|
||||
' 监测点名称:' +
|
||||
boxoList.equipmentName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
boxoList.evtParamVVaDepth +
|
||||
' 持续时间:' +
|
||||
boxoList.evtParamTm +
|
||||
's'
|
||||
} else if (boxoList.systemType == 'YPT') {
|
||||
titles =
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.persistTime +
|
||||
's'
|
||||
} else {
|
||||
titles =
|
||||
'变电站名称:' +
|
||||
boxoList.subName +
|
||||
' 监测点名称:' +
|
||||
boxoList.lineName +
|
||||
' 发生时刻:' +
|
||||
boxoList.startTime +
|
||||
' 暂降(骤升)幅值:' +
|
||||
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||
'% 持续时间:' +
|
||||
boxoList.duration +
|
||||
's'
|
||||
}
|
||||
|
||||
const iphasicValue = wp.iphasic || 1
|
||||
const picCounts = (wp.waveTitle.length - 1) / iphasicValue
|
||||
const waveDatas = []
|
||||
|
||||
for (let i = 0; i < picCounts; i++) {
|
||||
const data = fliteWaveData(wp, i)
|
||||
waveDatas.push(data)
|
||||
}
|
||||
|
||||
const time = wp.time
|
||||
const type = wp.waveType
|
||||
let severity = wp.yzd
|
||||
|
||||
if (severity < 0) {
|
||||
severity = '/'
|
||||
type = '/'
|
||||
}
|
||||
|
||||
// 将处理结果发送回主线程
|
||||
self.postMessage({
|
||||
waveDatas,
|
||||
time,
|
||||
type,
|
||||
severity,
|
||||
titles,
|
||||
iphasic: iphasicValue
|
||||
})
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
1201
src/components/echarts/shushiboxi1.vue
Normal file
1201
src/components/echarts/shushiboxi1.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,9 +5,8 @@
|
||||
style="min-width: 90px; width: 90px; margin-right: 10px"
|
||||
@change="timeChange"
|
||||
>
|
||||
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in filteredTimeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
|
||||
<el-date-picker
|
||||
v-model.trim="timeValue"
|
||||
type="daterange"
|
||||
@@ -21,6 +20,7 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
:shortcuts="shortcuts"
|
||||
/>
|
||||
|
||||
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
|
||||
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
|
||||
<el-button :disabled="preDisabled" type="primary" :icon="DArrowRight" @click="next"></el-button>
|
||||
@@ -36,13 +36,15 @@ interface Props {
|
||||
theCurrentTime?: boolean
|
||||
initialInterval?: number
|
||||
initialTimeValue?: any
|
||||
timeKeyList?: string[] //日期下拉
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
nextFlag: false,
|
||||
theCurrentTime: true,
|
||||
initialInterval: 3,
|
||||
initialTimeValue: undefined
|
||||
initialTimeValue: undefined,
|
||||
timeKeyList: () => []
|
||||
})
|
||||
|
||||
const emit = defineEmits(['change'])
|
||||
@@ -90,6 +92,16 @@ const shortcuts = [
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
// 计算过滤后的 timeOptions
|
||||
const filteredTimeOptions = computed(() => {
|
||||
if (!props.timeKeyList || props.timeKeyList.length === 0) {
|
||||
return timeOptions.value
|
||||
}
|
||||
|
||||
return timeOptions.value.filter((option: any) => props.timeKeyList.includes(option.value.toString()))
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 使用传入的初始值
|
||||
if (props.initialInterval !== undefined) {
|
||||
@@ -99,9 +111,32 @@ onMounted(() => {
|
||||
if (props.initialTimeValue) {
|
||||
timeValue.value = props.initialTimeValue
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
// 初始化时检查按钮状态
|
||||
checkInitialButtonStatus()
|
||||
})
|
||||
|
||||
timeChange(3)
|
||||
})
|
||||
|
||||
// 添加初始化按钮状态检查方法
|
||||
const checkInitialButtonStatus = () => {
|
||||
if (timeValue.value && timeValue.value.length >= 2) {
|
||||
const endTime = timeValue.value[1]
|
||||
const currentDate = window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd')
|
||||
|
||||
// 只有当 props.nextFlag 为 false 时才应用限制
|
||||
if (!props.nextFlag) {
|
||||
// 如果结束时间早于当前日期,则按钮可用(preDisabled = false)
|
||||
// 如果结束时间晚于或等于当前日期,则按钮禁用(preDisabled = true)
|
||||
const endDateTime = new Date(endTime).getTime()
|
||||
const currentDateTime = new Date(currentDate).getTime()
|
||||
preDisabled.value = endDateTime >= currentDateTime
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 添加统一的事件触发方法
|
||||
const emitChange = () => {
|
||||
nextTick(() => {
|
||||
@@ -115,11 +150,9 @@ const emitChange = () => {
|
||||
// 选择时间范围
|
||||
const timeChange = (e: number) => {
|
||||
backDisabled.value = false
|
||||
preDisabled.value = true
|
||||
count.value = 0
|
||||
if (e == 1) {
|
||||
disabledPicker.value = true
|
||||
|
||||
timeValue.value = [setTime(1), setTime()]
|
||||
} else if (e == 2) {
|
||||
disabledPicker.value = true
|
||||
@@ -140,7 +173,6 @@ const timeChange = (e: number) => {
|
||||
} else if (e == 5) {
|
||||
disabledPicker.value = false
|
||||
backDisabled.value = true
|
||||
preDisabled.value = true
|
||||
timeValue.value = [setTime(), setTime()]
|
||||
}
|
||||
if (e == 1 || e == 2) {
|
||||
@@ -148,6 +180,12 @@ const timeChange = (e: number) => {
|
||||
} else {
|
||||
timeFlag.value = 1
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
// 检查按钮状态
|
||||
checkInitialButtonStatus()
|
||||
})
|
||||
|
||||
// 触发 change 事件
|
||||
emitChange()
|
||||
}
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
ref="datePickerRef"
|
||||
:nextFlag="nextFlag"
|
||||
:theCurrentTime="theCurrentTime"
|
||||
:initialInterval="initialInterval"
|
||||
:initialTimeValue="initialTimeValue"
|
||||
@change="handleDatePickerChange"
|
||||
:timeKeyList="props.timeKeyList"
|
||||
></DatePicker>
|
||||
</el-form-item>
|
||||
|
||||
@@ -90,8 +89,8 @@ interface Props {
|
||||
theCurrentTime?: boolean //控制时间前3天展示上个月时间
|
||||
showReset?: boolean //是否显示重置
|
||||
showExport?: boolean //导出控制
|
||||
initialInterval?: 3
|
||||
initialTimeValue?: undefined
|
||||
timeCacheFlag?: boolean //是否取缓存时间
|
||||
timeKeyList?: string[] //日期下拉列表
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -102,17 +101,16 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
theCurrentTime: true,
|
||||
showReset: true,
|
||||
showExport: false,
|
||||
initialInterval: 3,
|
||||
initialTimeValue: undefined
|
||||
timeCacheFlag: true,
|
||||
timeKeyList: () => ['1', '2', '3', '4', '5'] // 修改为箭头函数返回空数组
|
||||
})
|
||||
|
||||
// 处理 DatePicker 值变化事件
|
||||
const handleDatePickerChange = (value: any) => {
|
||||
|
||||
// 将值缓存到 timeCache
|
||||
if (value) {
|
||||
timeCacheStore.setCache(route.path, value.interval, value.timeValue)
|
||||
}
|
||||
// if (value) {
|
||||
// timeCacheStore.setCache(route.path, value.interval, value.timeValue)
|
||||
// }
|
||||
|
||||
// 将 datePicker 的变化传递给父组件
|
||||
emit('selectChange', true, tableHeader.value.offsetHeight, value)
|
||||
@@ -139,18 +137,9 @@ const headerFormSecondStyleClose = {
|
||||
onMounted(() => {
|
||||
// 设置初始值到 DatePicker
|
||||
if (props.datePicker && datePickerRef.value) {
|
||||
// 如果有传入的初始值,则设置到 DatePicker
|
||||
if (props.initialInterval !== undefined) {
|
||||
datePickerRef.value.setInterval(props.initialInterval)
|
||||
}
|
||||
|
||||
if (props.initialTimeValue) {
|
||||
datePickerRef.value.timeValue = props.initialTimeValue
|
||||
}
|
||||
|
||||
// 从缓存中获取值并设置
|
||||
const cached = timeCacheStore.getCache(route.path)
|
||||
if (cached) {
|
||||
if (props.timeCacheFlag && cached) {
|
||||
if (cached.interval !== undefined) {
|
||||
datePickerRef.value.setInterval(cached.interval)
|
||||
}
|
||||
@@ -245,12 +234,29 @@ const onResetForm = () => {
|
||||
const setInterval = (val: any) => {
|
||||
datePickerRef.value.setInterval(val)
|
||||
}
|
||||
|
||||
const setTimeInterval = (val: any) => {
|
||||
datePickerRef.value.timeValue = val
|
||||
tableStore.table.params.searchBeginTime = val[0]
|
||||
tableStore.table.params.searchEndTime = val[1]
|
||||
tableStore.table.params.startTime = val[0]
|
||||
tableStore.table.params.endTime = val[1]
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
tableStore.onTableAction('export', { showAllFlag: true })
|
||||
}
|
||||
|
||||
defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef, showSelectChange, computedSearchRow })
|
||||
defineExpose({
|
||||
onComSearch,
|
||||
areaRef,
|
||||
setDatePicker,
|
||||
setInterval,
|
||||
setTimeInterval,
|
||||
datePickerRef,
|
||||
showSelectChange,
|
||||
computedSearchRow
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -1,24 +1,45 @@
|
||||
<template>
|
||||
<div :style="{ height: typeof props.height === 'string' ? props.height : tableStore.table.height }">
|
||||
<vxe-table ref="tableRef" height="auto" :key="key" :data="tableStore.table.data"
|
||||
v-loading="tableStore.table.loading" v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
||||
@checkbox-all="selectChangeEvent" @checkbox-change="selectChangeEvent" :showOverflow="showOverflow"
|
||||
:sort-config="{ remote: true }" @sort-change="handleSortChange">
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
height="auto"
|
||||
:key="key"
|
||||
:data="tableStore.table.data"
|
||||
v-loading="tableStore.table.loading"
|
||||
v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
||||
@checkbox-all="selectChangeEvent"
|
||||
@checkbox-change="selectChangeEvent"
|
||||
:showOverflow="showOverflow"
|
||||
:sort-config="{ remote: true }"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
|
||||
<!-- Column 组件内部是 el-table-column -->
|
||||
<template v-if="isGroup">
|
||||
<GroupColumn :column="tableStore.table.column" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<Column :attr="item" :key="key + '-column'" v-for="(item, key) in tableStore.table.column"
|
||||
:tree-node="item.treeNode">
|
||||
<Column
|
||||
:attr="item"
|
||||
:key="key + '-column'"
|
||||
v-for="(item, key) in tableStore.table.column"
|
||||
:tree-node="item.treeNode"
|
||||
>
|
||||
<!-- tableStore 预设的列 render 方案 -->
|
||||
<template v-if="item.render" #default="scope">
|
||||
<FieldRender :field="item" :row="scope.row" :column="scope.column" :index="scope.rowIndex" :key="key +
|
||||
<FieldRender
|
||||
:field="item"
|
||||
:row="scope.row"
|
||||
:column="scope.column"
|
||||
:index="scope.rowIndex"
|
||||
:key="
|
||||
key +
|
||||
'-' +
|
||||
item.render +
|
||||
'-' +
|
||||
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
||||
" />
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</Column>
|
||||
</template>
|
||||
@@ -27,11 +48,16 @@
|
||||
</div>
|
||||
|
||||
<div v-if="tableStore.showPage" class="table-pagination">
|
||||
<el-pagination :currentPage="tableStore.table.params!.pageNum" :page-size="tableStore.table.params!.pageSize"
|
||||
:page-sizes="pageSizes" background
|
||||
<el-pagination
|
||||
:currentPage="tableStore.table.params!.pageNum"
|
||||
:page-size="tableStore.table.params!.pageSize"
|
||||
:page-sizes="pageSizes"
|
||||
background
|
||||
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
|
||||
:total="tableStore.table.total" @size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"></el-pagination>
|
||||
:total="tableStore.table.total"
|
||||
@size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<slot name="footer"></slot>
|
||||
</template>
|
||||
@@ -66,6 +92,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
})
|
||||
onMounted(() => {
|
||||
tableStore.table.ref = tableRef.value as VxeTableInstance
|
||||
|
||||
|
||||
})
|
||||
// console.log(props)
|
||||
const onTableSizeChange = (val: number) => {
|
||||
@@ -125,6 +153,7 @@ watch(
|
||||
() => tableStore.table.allFlag,
|
||||
newVal => {
|
||||
if (tableStore.table.allFlag) {
|
||||
console.log('🚀 ~ tableStore.table.allData:', tableStore.table.allData)
|
||||
|
||||
tableRef.value?.exportData({
|
||||
filename: tableStore.exportName || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
:class="menuCollapse ? 'unfold' : ''" size='18' class='fold ml10 menu-collapse'
|
||||
style='cursor: pointer' v-if='props.canExpand' /> -->
|
||||
</div>
|
||||
<el-tree :style="{ height: 'calc(100vh - 200px)' }"
|
||||
<el-tree :style="{ height: 'calc(100vh - 110px)' }"
|
||||
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 }'>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Tree ref="treRef" :width="width" :data="tree" default-expand-all @changePointType="changePointType" @onAdd="onAdd"/>
|
||||
<Tree ref="treRef" :width="width" :showPush="props.showPush" :data="tree" default-expand-all @changePointType="changePointType" @onAdd="onAdd"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@@ -12,9 +12,11 @@ import { useDictData } from '@/stores/dictData'
|
||||
|
||||
interface Props {
|
||||
template?: boolean
|
||||
showPush?: boolean
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
template: false
|
||||
template: false,
|
||||
showPush: false
|
||||
})
|
||||
defineOptions({
|
||||
name: 'govern/deviceTree'
|
||||
@@ -95,13 +97,16 @@ const info = (selectedNodeId?: string) => {
|
||||
tree.value = []
|
||||
}
|
||||
nextTick(() => {
|
||||
|
||||
if (arr1.length) {
|
||||
// 安全检查 treRef 和 treeRef1 是否存在
|
||||
if (treRef.value && treRef.value.treeRef1 && treRef.value.treeRef1.setCurrentKey) {
|
||||
// 安全检查 treRef 和 treeRef 是否存在
|
||||
console.log("🚀 ~ info ~ treRef.value && treRef.value.treeRef && treRef.value.treeRef.setCurrentKey:", treRef.value && treRef.value.treeRef1 && treRef.value.treeRef1.setCurrentKey)
|
||||
|
||||
if (treRef.value && treRef.value.treeRef && treRef.value.treeRef.setCurrentKey) {
|
||||
// 如果传入了要选中的节点ID,则选中该节点,否则选中第一个节点
|
||||
console.log('selectedNodeId:', selectedNodeId);
|
||||
if (selectedNodeId) {
|
||||
treRef.value.treeRef1.setCurrentKey(selectedNodeId);
|
||||
treRef.value.treeRef.setCurrentKey(selectedNodeId);
|
||||
// 查找对应的节点数据并触发事件
|
||||
let selectedNode = null;
|
||||
const findNode = (nodes: any[]) => {
|
||||
@@ -127,7 +132,7 @@ const info = (selectedNodeId?: string) => {
|
||||
}
|
||||
} else {
|
||||
// 初始化选中第一个节点
|
||||
treRef.value.treeRef1.setCurrentKey(arr1[0].id);
|
||||
treRef.value.treeRef.setCurrentKey(arr1[0].id);
|
||||
emit('init', {
|
||||
level: 2,
|
||||
...arr1[0]
|
||||
|
||||
@@ -124,9 +124,7 @@ getDeviceTree().then(res => {
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log("🚀 ~ file: deviceTree.vue ~ line 33 ~ getDeviceTree ~ tree:", arr3.length)
|
||||
if (arr3.length) {
|
||||
console.log("🚀 ~ file: deviceTree.vue ~ line 33 ~ getDeviceTree ~ tree:", arr3)
|
||||
treRef.value.treeRef3.setCurrentKey(arr3[0].id)
|
||||
// 注册父组件事件
|
||||
emit('init', {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getMarketList } from '@/api/user-boot/user'
|
||||
import Tree from '../index.vue'
|
||||
import Tree from '../cloudDevice.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
const config = useConfig()
|
||||
|
||||
29
src/components/tree/govern/officialUserTree.vue
Normal file
29
src/components/tree/govern/officialUserTree.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<Tree ref="treRef" :data="tree" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getFormalUserList } from '@/api/user-boot/official'
|
||||
import Tree from '../cloudDevice.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
const config = useConfig()
|
||||
const tree = ref()
|
||||
const treRef = ref()
|
||||
const emit = defineEmits(['selectUser'])
|
||||
getFormalUserList().then((res: any) => {
|
||||
if (res.code === 'A0000') {
|
||||
tree.value = res.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
icon: 'el-icon-User',
|
||||
color: 'royalblue'
|
||||
}
|
||||
})
|
||||
emit('selectUser', tree.value[0])
|
||||
nextTick(() => {
|
||||
treRef.value.treeRef.setCurrentKey(tree.value[0].id)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,26 +1,44 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="transition: all 0.3s; overflow: hidden; height: 100%">
|
||||
|
||||
<div class="cn-tree">
|
||||
<div style="display: flex; align-items: center" class="mb10">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="filterText" placeholder="请输入内容" clearable>
|
||||
<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>
|
||||
</div>
|
||||
<el-tree style="flex: 1; overflow: auto" :props="defaultProps" highlight-current
|
||||
:filter-node-method="filterNode" node-key="id" v-bind="$attrs" default-expand-all :data="tree"
|
||||
ref="treRef" @node-click="clickNode" :expand-on-click-node="false">
|
||||
<el-tree
|
||||
style="flex: 1; overflow: auto"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
:filter-node-method="filterNode"
|
||||
node-key="id"
|
||||
v-bind="$attrs"
|
||||
default-expand-all
|
||||
:data="tree"
|
||||
ref="treRef"
|
||||
@node-click="clickNode"
|
||||
:expand-on-click-node="false"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<span class="custom-tree-node">
|
||||
<div class="left">
|
||||
<Icon :name="data.icon" style="font-size: 16px" :style="{ color: data.color }"
|
||||
v-if="data.icon" />
|
||||
<span>{{ node.label }}</span>
|
||||
<div class="left" style="display: flex; align-items: center">
|
||||
<Icon
|
||||
:name="data.icon"
|
||||
style="font-size: 16px"
|
||||
:style="{ color: data.color }"
|
||||
v-if="data.icon"
|
||||
/>
|
||||
<span style="margin-left: 5px;">{{ node.label }}</span>
|
||||
</div>
|
||||
|
||||
</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
@@ -43,12 +61,10 @@ defineOptions({
|
||||
|
||||
interface Props {
|
||||
template?: boolean
|
||||
|
||||
}
|
||||
const dictData = useDictData()
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
template: false,
|
||||
|
||||
template: false
|
||||
})
|
||||
const filterText = ref('')
|
||||
watch(filterText, val => {
|
||||
@@ -94,7 +110,6 @@ const defaultProps = {
|
||||
value: 'id'
|
||||
}
|
||||
|
||||
|
||||
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart', 'Policy'])
|
||||
const config = useConfig()
|
||||
const tree = ref()
|
||||
@@ -141,18 +156,18 @@ const clickNode = (e: anyObj) => {
|
||||
emit('nodeChange', e)
|
||||
}
|
||||
|
||||
|
||||
if (props.template) {
|
||||
getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => {
|
||||
getTemplateByDept({ id: dictData.state.area[0].id })
|
||||
.then((res: any) => {
|
||||
emit('Policy', res.data)
|
||||
getTreeList()
|
||||
}).catch(err => {
|
||||
})
|
||||
.catch(err => {
|
||||
getTreeList()
|
||||
})
|
||||
} else {
|
||||
getTreeList()
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.cn-tree {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<Icon name='el-icon-Search' style='font-size: 16px' />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-tooltip placement="bottom" :hide-after="0">
|
||||
<el-tooltip placement="bottom" :hide-after="0" v-if="props.showPush">
|
||||
<template #content>
|
||||
<span>台账推送</span>
|
||||
</template>
|
||||
@@ -23,7 +23,7 @@
|
||||
:style="{ color: config.getColorVal('elementUiPrimary') }"
|
||||
@click="onAdd" />
|
||||
</el-tooltip>
|
||||
<!-- <Icon @click='onMenuCollapse' :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||
<!-- <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>
|
||||
@@ -58,11 +58,13 @@ defineOptions({
|
||||
interface Props {
|
||||
width?: string
|
||||
canExpand?: boolean
|
||||
showPush?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
width: '280px',
|
||||
canExpand: true
|
||||
canExpand: true,
|
||||
showPush: false
|
||||
})
|
||||
const config = useConfig()
|
||||
const { proxy } = useCurrentInstance()
|
||||
|
||||
@@ -85,6 +85,7 @@ const init = async () => {
|
||||
handleAdminRoute(res.data)
|
||||
if (route.params.to) {
|
||||
const lastRoute = JSON.parse(route.params.to as string)
|
||||
|
||||
if (lastRoute.path != adminBaseRoutePath) {
|
||||
let query = !isEmpty(lastRoute.query) ? lastRoute.query : {}
|
||||
routePush({ path: lastRoute.path, query: query })
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { number } from "vue-types"
|
||||
import { number } from 'vue-types'
|
||||
|
||||
const dataProcessing = (arr: any[]) => {
|
||||
return arr
|
||||
@@ -24,9 +24,10 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
base = 1
|
||||
} else {
|
||||
const multiple = 1 / 0.1
|
||||
// 先放大→向上取整→再缩小
|
||||
return Math.ceil(Math.abs(o) * multiple) / multiple
|
||||
|
||||
base = Math.ceil(Math.abs(o) * multiple) / multiple
|
||||
}
|
||||
|
||||
let calculatedValue
|
||||
if (isMin) {
|
||||
if (value < 0) {
|
||||
@@ -39,7 +40,6 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
||||
calculatedValue = value - num * value
|
||||
} else {
|
||||
calculatedValue = value + num * value
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export const yMethod = (arr: any) => {
|
||||
let min = 0
|
||||
maxValue = Math.max(...numList)
|
||||
minValue = Math.min(...numList)
|
||||
const o = maxValue - minValue
|
||||
const o = maxValue - minValue == 0 ? maxValue : maxValue - minValue
|
||||
min = calculateValue(o, minValue, num, true)
|
||||
|
||||
max = calculateValue(o, maxValue, num, false)
|
||||
|
||||
@@ -352,7 +352,9 @@ export function getTimeOfTheMonth(key: any): [string, string] {
|
||||
const dayOfWeek = now.getDay() // 0是周日
|
||||
const diff = now.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1) // 调整为周一
|
||||
const weekStart = new Date(year, month, diff)
|
||||
return [formatDate(weekStart, 'YYYY-MM-DD'), formatDate(now, 'YYYY-MM-DD')]
|
||||
const weekEnd = new Date(weekStart)
|
||||
weekEnd.setDate(weekEnd.getDate() + 6)
|
||||
return [formatDate(weekStart, 'YYYY-MM-DD'), formatDate(weekEnd, 'YYYY-MM-DD')]
|
||||
|
||||
case '5': // 日
|
||||
return [formatDate(now, 'YYYY-MM-DD'), formatDate(now, 'YYYY-MM-DD')]
|
||||
@@ -361,3 +363,23 @@ export function getTimeOfTheMonth(key: any): [string, string] {
|
||||
throw new Error('Invalid key')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当月时间
|
||||
* @param interval 组件外部时间 1 年 2 季 3 月 4 周 5 日
|
||||
* @param timeList 驾驶舱里面组件勾选时间 []
|
||||
* @param externalTime //外部传入时间
|
||||
* @param fullscreen // 全屏是否全屏
|
||||
*/
|
||||
export function getTime(interval: number | 3, timeList: any, externalTime: any) {
|
||||
// console.log('🚀 ~ getTime ~ timeList:', timeList)
|
||||
// 1、先匹配时间
|
||||
// 检查 interval 是否在 timeList 中
|
||||
if (timeList && timeList.includes(interval.toString())) {
|
||||
return [externalTime[0], externalTime[1], interval]
|
||||
} else {
|
||||
if (timeList && timeList.length > 0) {
|
||||
return [...getTimeOfTheMonth(timeList[0]), timeList[0]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ const bubble: {
|
||||
ctx: {},
|
||||
circles: [],
|
||||
animate: true,
|
||||
requestId: null,
|
||||
requestId: null
|
||||
}
|
||||
|
||||
export const init = function (): void {
|
||||
@@ -76,7 +76,7 @@ class Circle {
|
||||
constructor() {
|
||||
this.pos = {
|
||||
x: Math.random() * bubble.width,
|
||||
y: bubble.height + Math.random() * 100,
|
||||
y: bubble.height + Math.random() * 100
|
||||
}
|
||||
this.alpha = 0.1 + Math.random() * 0.3
|
||||
this.scale = 0.1 + Math.random() * 0.3
|
||||
@@ -84,6 +84,16 @@ class Circle {
|
||||
this.draw = function () {
|
||||
this.pos.y -= this.velocity
|
||||
this.alpha -= 0.0005
|
||||
// 当气泡超出顶部或透明度为 0 时,重置位置和属性
|
||||
if (this.pos.y < -10 || this.alpha < 0) {
|
||||
this.pos = {
|
||||
x: Math.random() * bubble.width,
|
||||
y: bubble.height + Math.random() * 100
|
||||
}
|
||||
this.alpha = 0.1 + Math.random() * 0.35
|
||||
this.scale = 0.1 + Math.random() * 0.35
|
||||
this.velocity = Math.random()
|
||||
}
|
||||
bubble.ctx.beginPath()
|
||||
bubble.ctx.arc(this.pos.x, this.pos.y, this.scale * 10, 0, 2 * Math.PI, false)
|
||||
bubble.ctx.fillStyle = 'rgba(255,255,255,' + this.alpha + ')'
|
||||
|
||||
@@ -66,7 +66,9 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||
!(
|
||||
config.url == '/system-boot/file/upload' ||
|
||||
config.url == '/harmonic-boot/grid/getAssessOverview' ||
|
||||
config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData'
|
||||
config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData' ||
|
||||
config.url == '/cs-device-boot/csline/list' ||
|
||||
config.url == '/cs-harmonic-boot/pqSensitiveUser/getListByIds'
|
||||
)
|
||||
)
|
||||
removePending(config)
|
||||
|
||||
@@ -10,7 +10,7 @@ import { compact, isEmpty, reverse } from 'lodash-es'
|
||||
import { isAdminApp } from '@/utils/common'
|
||||
import { getRouteMenu, dictDataCache } from '@/api/auth'
|
||||
import { adminBaseRoutePath } from '@/router/static'
|
||||
const route = useRouter()
|
||||
const route:any = useRouter()
|
||||
/**
|
||||
* 导航失败有错误消息的路由push
|
||||
* @param to — 导航位置,同 router.push
|
||||
|
||||
@@ -18,6 +18,7 @@ interface TableStoreParams {
|
||||
publicHeight?: number //计算高度
|
||||
resetCallback?: () => void // 重置
|
||||
loadCallback?: () => void // 接口调用后的回调
|
||||
exportProcessingData?: () => void //导出处理数据
|
||||
beforeSearchFun?: () => void // 接口调用前的回调
|
||||
}
|
||||
|
||||
@@ -47,9 +48,11 @@ export default class TableStore {
|
||||
column: [],
|
||||
loadCallback: null,
|
||||
resetCallback: null,
|
||||
exportProcessingData: null,
|
||||
beforeSearchFun: null,
|
||||
height: '',
|
||||
publicHeight: 0
|
||||
publicHeight: 0,
|
||||
filename: ''
|
||||
})
|
||||
|
||||
constructor(public options: TableStoreParams) {
|
||||
@@ -64,6 +67,7 @@ export default class TableStore {
|
||||
this.table.publicHeight = options.publicHeight || 0
|
||||
this.table.resetCallback = options.resetCallback || null
|
||||
this.table.loadCallback = options.loadCallback || null
|
||||
this.table.exportProcessingData = options.exportProcessingData || null
|
||||
this.table.beforeSearchFun = options.beforeSearchFun || null
|
||||
Object.assign(this.table.params, options.params)
|
||||
this.table.height = mainHeight(20 + (this.showPage ? 58 : 0) + this.table.publicHeight).height as string
|
||||
@@ -94,14 +98,19 @@ export default class TableStore {
|
||||
this.table.data = []
|
||||
this.table.total = 0
|
||||
}
|
||||
// 只有当 this.table.data 是数组时才执行 filtration 处理
|
||||
if (Array.isArray(this.table.data)) {
|
||||
this.table.copyData = filtration(this.table.data)
|
||||
}
|
||||
if (Array.isArray(res)) {
|
||||
this.table.data = res
|
||||
}
|
||||
|
||||
if (this.isWebPaging) {
|
||||
this.table.webPagingData = window.XEUtils.chunk(this.table.data, this.table.params.pageSize)
|
||||
this.table.data = this.table.webPagingData[this.table.params.pageNum - 1]
|
||||
}
|
||||
|
||||
this.table.loadCallback && this.table.loadCallback()
|
||||
this.table.loading = false
|
||||
})
|
||||
@@ -187,13 +196,8 @@ export default class TableStore {
|
||||
[
|
||||
'export',
|
||||
() => {
|
||||
ElMessage({
|
||||
message: '正在导出,请稍等...',
|
||||
type: 'info',
|
||||
duration: 1000
|
||||
})
|
||||
// this.index()
|
||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||
setTimeout(() => {
|
||||
createAxios(
|
||||
Object.assign(
|
||||
{
|
||||
@@ -204,9 +208,9 @@ export default class TableStore {
|
||||
)
|
||||
).then(res => {
|
||||
this.table.allData = filtration(res.data.records || res.data)
|
||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||
this.table.allFlag = data.showAllFlag || true
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="auto" class="form-one">
|
||||
<el-form-item label="上级菜单">
|
||||
<el-cascader v-model.trim="form.pid" :options="tableStore.table.data" :props="cascaderProps"
|
||||
<el-cascader v-model.trim="form.pid" :options="tableStore.table.data" :props="cascaderProps" clearable
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单名称">
|
||||
@@ -92,6 +92,7 @@ const open = (text: string, data: anyObj) => {
|
||||
}
|
||||
const submit = async () => {
|
||||
if (form.id) {
|
||||
form.pid = form.pid||'0'
|
||||
await updateMenu(form)
|
||||
} else {
|
||||
form.code = 'menu'
|
||||
|
||||
@@ -150,6 +150,8 @@ const checkChange = (data: any) => {
|
||||
updateRoleMenu({
|
||||
id: menuListId.value,
|
||||
idList: treeRef.value.treeRef.getCheckedNodes(false, true).map((node: any) => node.id)
|
||||
}).then(() => {
|
||||
ElMessage.success('操作成功!')
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ const tableStore = new TableStore({
|
||||
return row.state !== 1
|
||||
},
|
||||
click: row => {
|
||||
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
||||
ElMessageBox.prompt('二次校验密码确认', '修改密码', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'password'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog width=“500px” v-model.trim="dialogVisible" title="修改密码">
|
||||
<el-dialog width='500px' draggable v-model.trim="dialogVisible" title="修改密码">
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" class="form-one" :rules="rules" ref="formRef">
|
||||
<el-form-item label="新密码" prop="newPwd">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -729,7 +729,7 @@ const handleHarmonicSpectrum = async () => {
|
||||
// }
|
||||
realTimeFlag.value = false
|
||||
sonTab.value = 2
|
||||
harmonicSpectrumRef.value && harmonicSpectrumRef.value.resetData()
|
||||
harmonicSpectrumRef.value && harmonicSpectrumRef.value.resetData(formInline.dataLevel)
|
||||
// getRealDataMqttMsg()
|
||||
await getBasicRealData(lineId.value).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
@@ -979,10 +979,10 @@ const getRealDataMqttMsg = async () => {
|
||||
})
|
||||
}, 30000)
|
||||
mqttRef.value.on('message', (topic: any, message: any) => {
|
||||
// console.log(
|
||||
// '实时数据&实时趋势---mqtt接收到消息',
|
||||
// JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
// )
|
||||
console.log(
|
||||
'实时数据&实时趋势---mqtt接收到消息',
|
||||
JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
)
|
||||
let obj = JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
|
||||
if (lineId.value != obj.lineId || adminInfo.userIndex != obj.userId) return
|
||||
@@ -991,35 +991,37 @@ const getRealDataMqttMsg = async () => {
|
||||
//如果消息返回值是二次值,下拉框是二次值只需要单位换算 除以1000
|
||||
//如果消息返回值是一次值,下拉框是一次值只需要单位换算 除以1000
|
||||
if (obj.dataLevel == formInline.dataLevel) {
|
||||
|
||||
obj = {
|
||||
...obj,
|
||||
// 电压有效值
|
||||
vRmsA: obj.vRmsA / 1000,
|
||||
vRmsB: obj.vRmsB / 1000,
|
||||
vRmsC: obj.vRmsC / 1000,
|
||||
vRmsA: obj.vRmsA ,
|
||||
vRmsB: obj.vRmsB ,
|
||||
vRmsC: obj.vRmsC ,
|
||||
//基波电压幅值
|
||||
v1A: obj.v1A / 1000,
|
||||
v1B: obj.v1B / 1000,
|
||||
v1C: obj.v1C / 1000,
|
||||
v1A: obj.v1A ,
|
||||
v1B: obj.v1B ,
|
||||
v1C: obj.v1C ,
|
||||
//有功功率
|
||||
pA: obj.pA / 1000,
|
||||
pB: obj.pB / 1000,
|
||||
pC: obj.pC / 1000,
|
||||
pTot: obj.pTot / 1000,
|
||||
pA: obj.pA ,
|
||||
pB: obj.pB ,
|
||||
pC: obj.pC ,
|
||||
pTot: obj.pTot ,
|
||||
//无功功率
|
||||
qA: obj.qA / 1000,
|
||||
qB: obj.qB / 1000,
|
||||
qC: obj.qC / 1000,
|
||||
qTot: obj.qTot / 1000,
|
||||
qA: obj.qA ,
|
||||
qB: obj.qB ,
|
||||
qC: obj.qC ,
|
||||
qTot: obj.qTot ,
|
||||
//视在功率
|
||||
sA: obj.sA / 1000,
|
||||
sB: obj.sB / 1000,
|
||||
sC: obj.sC / 1000,
|
||||
sTot: obj.sTot / 1000
|
||||
sA: obj.sA ,
|
||||
sB: obj.sB ,
|
||||
sC: obj.sC ,
|
||||
sTot: obj.sTot
|
||||
}
|
||||
}
|
||||
//如果消息返回值是二次值,下拉框是一次值需要单位换算 除以1000 并且乘以pt ct
|
||||
if (obj.dataLevel == 'Secondary' && formInline.dataLevel == 'Primary') {
|
||||
|
||||
obj = {
|
||||
...obj,
|
||||
// 电压有效值
|
||||
@@ -1102,7 +1104,7 @@ const getRealDataMqttMsg = async () => {
|
||||
mqttMessage.value = obj
|
||||
|
||||
//更新实时数据主页面值
|
||||
realTimeFlag.value && realTimeRef.value && realTimeRef.value.setRealData(mqttMessage.value)
|
||||
realTimeFlag.value && realTimeRef.value && realTimeRef.value.setRealData(mqttMessage.value,formInline.dataLevel)
|
||||
tableLoading.value = false
|
||||
//更新实时趋势折线图数据
|
||||
if (sonTab.value == 2) {
|
||||
|
||||
@@ -144,7 +144,8 @@ let height: any = mainHeight(275).height
|
||||
const loading = ref(false)
|
||||
const allDataList: any = ref([])
|
||||
const xAixsTimeList: any = ref([])
|
||||
const resetData = () => {
|
||||
|
||||
const resetData = (dataLevel: string) => {
|
||||
loading.value = true
|
||||
indexOptions.value = [
|
||||
{
|
||||
@@ -155,7 +156,7 @@ const resetData = () => {
|
||||
{ name: 'vRmsB', phase: 'B相', data: [], yMethodList: [] },
|
||||
{ name: 'vRmsC', phase: 'C相', data: [], yMethodList: [] }
|
||||
],
|
||||
unit: 'kV',
|
||||
unit: dataLevel === 'Primary' ? 'kV' : 'V',
|
||||
data: [],
|
||||
yMethodList: []
|
||||
},
|
||||
@@ -180,7 +181,7 @@ const resetData = () => {
|
||||
{ name: 'pC', phase: 'C相', data: [], yMethodList: [] },
|
||||
{ name: 'pTot', phase: '总', data: [], yMethodList: [] }
|
||||
],
|
||||
unit: 'kW',
|
||||
unit: dataLevel === 'Primary' ? 'kW' : 'W',
|
||||
data: [],
|
||||
yMethodList: []
|
||||
},
|
||||
@@ -193,7 +194,7 @@ const resetData = () => {
|
||||
{ name: 'qC', phase: 'C相', data: [], yMethodList: [] },
|
||||
{ name: 'qTot', phase: '总', data: [], yMethodList: [] }
|
||||
],
|
||||
unit: 'kW',
|
||||
unit: dataLevel === 'Primary' ? 'kVar' : 'Var',
|
||||
data: [],
|
||||
yMethodList: []
|
||||
},
|
||||
@@ -206,7 +207,7 @@ const resetData = () => {
|
||||
{ name: 'v1B', phase: 'B相', data: [], yMethodList: [] },
|
||||
{ name: 'v1C', phase: 'C相', data: [], yMethodList: [] }
|
||||
],
|
||||
unit: 'kV',
|
||||
unit: dataLevel === 'Primary' ? 'kV' : 'V',
|
||||
data: [],
|
||||
yMethodList: []
|
||||
},
|
||||
@@ -255,9 +256,10 @@ const resetData = () => {
|
||||
allDataList.value = []
|
||||
xAixsTimeList.value = []
|
||||
}
|
||||
resetData()
|
||||
resetData('Primary')
|
||||
const mqttMessage: any = ref()
|
||||
const setHarmonicSpectrumData = (val: any) => {
|
||||
|
||||
mqttMessage.value = val
|
||||
init()
|
||||
}
|
||||
@@ -307,7 +309,6 @@ const init = () => {
|
||||
//循环渲染图表
|
||||
const refName = setChildRef(index)
|
||||
childRefs[refName] = ref(null) // 初始化ref
|
||||
|
||||
item.echartsData = {
|
||||
title: {
|
||||
text: item.name
|
||||
|
||||
@@ -16,24 +16,34 @@
|
||||
<el-radio-group v-model.trim="theTypeOfValue" @change="changeView">
|
||||
<el-radio-button label="一次值" :value="1" />
|
||||
<el-radio-button label="二次值" :value="2" />
|
||||
|
||||
</el-radio-group>
|
||||
|
||||
<el-button @click="handleBack" :icon="Back">返回</el-button>
|
||||
|
||||
</div>
|
||||
<el-tabs class="home_body" type="border-card" v-model.trim="activeName1" @tab-click="handleClick"
|
||||
v-loading="loading">
|
||||
|
||||
<el-tab-pane label="瞬时波形" name="ssbx" :style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<shushiboxi v-if="isWp && wp && activeName == 'ssbx' && showBoxi" :value="value" :boxoList="boxoList"
|
||||
:parentHeight="parentHeight" :wp="wp">
|
||||
</shushiboxi>
|
||||
<el-tabs
|
||||
class="home_body"
|
||||
type="border-card"
|
||||
v-model.trim="activeName1"
|
||||
@tab-click="handleClick"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-tab-pane label="瞬时波形" name="ssbx" :style="'height:' + bxecharts + ';overflow-y: auto;'">
|
||||
<shushiboxi
|
||||
v-if="isWp && wp && activeName == 'ssbx' && showBoxi"
|
||||
:value="value"
|
||||
:boxoList="boxoList"
|
||||
:parentHeight="parentHeight"
|
||||
:wp="wp"
|
||||
></shushiboxi>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="RMS波形" name="rmsbx" :style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<rmsboxi v-if="isWp && wp && activeName == 'rmsbx' && showBoxi" :value="value" :boxoList="boxoList"
|
||||
:parentHeight="parentHeight" :wp="wp">
|
||||
</rmsboxi>
|
||||
<el-tab-pane label="RMS波形" name="rmsbx" :style="'height:' + bxecharts + ';overflow-y: auto;'">
|
||||
<rmsboxi
|
||||
v-if="isWp && wp && activeName == 'rmsbx' && showBoxi"
|
||||
:value="value"
|
||||
:boxoList="boxoList"
|
||||
:parentHeight="parentHeight"
|
||||
:wp="wp"
|
||||
></rmsboxi>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -96,15 +106,12 @@ const wp = ref({})
|
||||
const theTypeOfValue = ref(1)
|
||||
const value = ref(1)
|
||||
|
||||
|
||||
const isWp = ref(false)
|
||||
const boxoList: any = ref([])
|
||||
const getWpData = (val: any, list: any) => {
|
||||
wp.value = val
|
||||
isWp.value = true
|
||||
boxoList.value = list
|
||||
|
||||
console.log(wp.value, val, 'ggggghhhh')
|
||||
}
|
||||
const changeView = () => {
|
||||
showBoxi.value = false
|
||||
@@ -131,16 +138,17 @@ const handleClick = (tab: any, event: any) => {
|
||||
const handleBack = () => {
|
||||
emit('handleHideCharts')
|
||||
}
|
||||
const setHeight = (h: any, vh: any) => {
|
||||
const setHeight = (h: any, vh: any, num = 1) => {
|
||||
console.log('🚀 ~ setHeight ~ h:', h)
|
||||
if (h != false) {
|
||||
parentHeight.value = h
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
bxecharts.value = mainHeight(vh).height
|
||||
bxecharts.value = mainHeight(vh, num).height
|
||||
}, 100)
|
||||
}
|
||||
onMounted(() => { })
|
||||
onMounted(() => {})
|
||||
defineExpose({ getWpData, setHeight })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@@ -165,7 +173,6 @@ defineExpose({ getWpData, setHeight })
|
||||
position: relative;
|
||||
|
||||
.home_header {
|
||||
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="view_top">
|
||||
<!-- 左侧仪表盘 -->
|
||||
<div class="view_top_left">
|
||||
<div class="left_charts_title">电压有效值(kV)</div>
|
||||
<div class="left_charts_title">电压有效值({{ voltageUnit }})</div>
|
||||
<div class="left_charts">
|
||||
<MyEchart :pieInterVal="true" ref="pieChart1" :options="echartsDataV1"></MyEchart>
|
||||
</div>
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="view_bot">
|
||||
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
|
||||
:tooltip-config="{ enterable: true }">
|
||||
<vxe-colgroup align="center" title="电压有效值(kV)">
|
||||
<vxe-colgroup align="center" :title="`电压有效值(${voltageUnit})`">
|
||||
<vxe-column align="center" field="vRmsA" title="A相"></vxe-column>
|
||||
<vxe-column align="center" field="vRmsB" title="B相"></vxe-column>
|
||||
<vxe-column align="center" field="vRmsC" title="C相"></vxe-column>
|
||||
@@ -69,11 +69,11 @@
|
||||
<br />
|
||||
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
|
||||
:tooltip-config="{ enterable: true }">
|
||||
<vxe-column align="center" field="freq" width="140" title="频率(Hz)"></vxe-column>
|
||||
<vxe-column align="center" field="freqDev" width="120" title="频率偏差(Hz)"></vxe-column>
|
||||
<vxe-column align="center" field="freqDev" width="140" title="频率(Hz)"></vxe-column>
|
||||
<vxe-column align="center" field="freq" width="120" title="频率偏差(Hz)"></vxe-column>
|
||||
<vxe-column align="center" width="180" field="vUnbalance" title="电压不平衡度(%)"></vxe-column>
|
||||
<vxe-column align="center" width="180" field="iUnbalance" title="电流不平衡度(%)"></vxe-column>
|
||||
<vxe-colgroup align="center" title="基波电压幅值(kV)">
|
||||
<vxe-colgroup align="center" :title="`基波电压幅值(${voltageUnit})`">
|
||||
<vxe-column align="center" field="v1A" title="A相"></vxe-column>
|
||||
<vxe-column align="center" field="v1B" title="B相"></vxe-column>
|
||||
<vxe-column align="center" field="v1C" title="C相"></vxe-column>
|
||||
@@ -102,7 +102,7 @@
|
||||
<vxe-column align="center" field="iThdB" title="B相"></vxe-column>
|
||||
<vxe-column align="center" field="iThdC" title="C相"></vxe-column>
|
||||
</vxe-colgroup>
|
||||
<vxe-colgroup align="center" title="有功功率(kW)">
|
||||
<vxe-colgroup align="center" :title="`有功功率(${powerUnit})`">
|
||||
<vxe-column align="center" field="pA" title="A相"></vxe-column>
|
||||
<vxe-column align="center" field="pB" title="B相"></vxe-column>
|
||||
<vxe-column align="center" field="pC" title="C相"></vxe-column>
|
||||
@@ -112,7 +112,7 @@
|
||||
<br />
|
||||
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
|
||||
:tooltip-config="{ enterable: true }">
|
||||
<vxe-colgroup align="center" title="无功功率(kVar)">
|
||||
<vxe-colgroup align="center" :title="`无功功率(${reactivePowerUnit})`">
|
||||
<vxe-column align="center" field="qA" title="A相"></vxe-column>
|
||||
<vxe-column align="center" field="qB" title="B相"></vxe-column>
|
||||
<vxe-column align="center" field="qC" title="C相">
|
||||
@@ -122,7 +122,7 @@
|
||||
</vxe-column>
|
||||
<vxe-column align="center" field="qTot" title="总"></vxe-column>
|
||||
</vxe-colgroup>
|
||||
<vxe-colgroup align="center" title="视在功率(kVA)">
|
||||
<vxe-colgroup align="center" :title="`视在功率(${apparentPowerUnit})`">
|
||||
<vxe-column align="center" field="sA" title="A相"></vxe-column>
|
||||
<vxe-column align="center" field="sB" title="B相"></vxe-column>
|
||||
<vxe-column align="center" field="sC" title="C相"></vxe-column>
|
||||
@@ -170,6 +170,10 @@ const echartsDataV3: any = ref({})
|
||||
const echartsDataA1: any = ref({})
|
||||
const echartsDataA2: any = ref({})
|
||||
const echartsDataA3: any = ref({})
|
||||
|
||||
const currentDataLevel = ref('Primary')
|
||||
const previousDataLevel = ref('')
|
||||
|
||||
//渲染中间相角图
|
||||
const initRadioCharts = () => {
|
||||
echartsData1.value = {
|
||||
@@ -542,7 +546,33 @@ const vRadioList: any = ref([])
|
||||
|
||||
const realData = ref<any>({})
|
||||
const realList = ref<any>([])
|
||||
const setRealData = (val: any) => {
|
||||
|
||||
// 计算电压单位
|
||||
const voltageUnit = computed(() => {
|
||||
return currentDataLevel.value === 'Primary' ? 'kV' : 'V'
|
||||
})
|
||||
|
||||
// 计算功率单位
|
||||
const powerUnit = computed(() => {
|
||||
return currentDataLevel.value === 'Primary' ? 'kW' : 'W'
|
||||
})
|
||||
|
||||
// 计算无功功率单位
|
||||
const reactivePowerUnit = computed(() => {
|
||||
return currentDataLevel.value === 'Primary' ? 'kVar' : 'Var'
|
||||
})
|
||||
|
||||
// 计算视在功率单位
|
||||
const apparentPowerUnit = computed(() => {
|
||||
return currentDataLevel.value === 'Primary' ? 'kVA' : 'VA'
|
||||
})
|
||||
|
||||
const setRealData = (val: any,dataLevel:string) => {
|
||||
// 只有当 dataLevel 真正改变时才更新
|
||||
if (dataLevel !== previousDataLevel.value) {
|
||||
currentDataLevel.value = dataLevel
|
||||
previousDataLevel.value = dataLevel
|
||||
}
|
||||
realData.value = val
|
||||
realList.value = [val]
|
||||
initRadioCharts()
|
||||
|
||||
@@ -68,7 +68,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
const pageHeight = mainHeight(20)
|
||||
const loading = ref(true)
|
||||
|
||||
const tableHeight = mainHeight(140)
|
||||
const tableHeight = mainHeight(135)
|
||||
const user: any = ref({})
|
||||
const tableData = ref([])
|
||||
const tableData2 = ref([])
|
||||
|
||||
331
src/views/govern/device/officialUser/index.vue
Normal file
331
src/views/govern/device/officialUser/index.vue
Normal file
@@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<div class="default-main device-manage" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||
<OfficialUserTree @node-click="selectUser" @selectUser="selectUser"></OfficialUserTree>
|
||||
<div class="device-manage-right" :style="{ height: pageHeight.height }">
|
||||
<div class="el-descriptions__header">
|
||||
<el-button type="primary" @click="getEnginnerDev">添加工程 / 设备</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 使用flex布局平均分配高度 -->
|
||||
<div class="tables-container">
|
||||
<div class="table-wrapper">
|
||||
<vxe-table v-bind="defaultAttribute" :data="tableData" height="auto" style="width: 100%">
|
||||
<vxe-column field="name" title="工程名称"></vxe-column>
|
||||
<vxe-column title="操作" width="200px">
|
||||
<template v-slot:default="scoped">
|
||||
<el-button link size="small" type="danger" @click="deleteEngineering(scoped.row)">
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
|
||||
<!-- 新增设备列表 -->
|
||||
<div class="device-list-section table-wrapper">
|
||||
<vxe-table v-bind="defaultAttribute" :data="deviceTableData" height="auto" style="width: 100%">
|
||||
<vxe-column field="name" title="设备名称"></vxe-column>
|
||||
<vxe-column title="操作" width="200px">
|
||||
<template v-slot:default="scoped">
|
||||
<el-button link size="small" type="danger" @click="deleteDevice(scoped.row)">
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 对话框为左右布局 -->
|
||||
<el-dialog
|
||||
v-model.trim="dialogVisible"
|
||||
title="添加工程 / 设备"
|
||||
class="cn-operate-dialog"
|
||||
:close-on-click-modal="false"
|
||||
|
||||
>
|
||||
<div class="dialog-content">
|
||||
<!-- 工程部分 -->
|
||||
<div class="dialog-section">
|
||||
<div class="section-header">
|
||||
<span>工程列表</span>
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="filterText"
|
||||
placeholder="搜索工程"
|
||||
clearable
|
||||
class="search-input"
|
||||
>
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="tableData2.filter((item: any) => {
|
||||
return item.name.includes(filterText)
|
||||
})"
|
||||
height="400px"
|
||||
style="width: 100%"
|
||||
>
|
||||
<vxe-column type="checkbox" width="60"></vxe-column>
|
||||
<vxe-column field="name" title="工程名称"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
|
||||
<!-- 设备部分 -->
|
||||
<div class="dialog-section">
|
||||
<div class="section-header">
|
||||
<span>设备列表</span>
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="deviceFilterText"
|
||||
placeholder="搜索设备"
|
||||
clearable
|
||||
class="search-input"
|
||||
>
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<vxe-table
|
||||
ref="deviceTableRef"
|
||||
v-bind="defaultAttribute"
|
||||
:data="deviceTableData2.filter((item: any) => {
|
||||
return item.name.includes(deviceFilterText)
|
||||
})"
|
||||
height="400px"
|
||||
style="width: 100%"
|
||||
>
|
||||
<vxe-column type="checkbox" width="60"></vxe-column>
|
||||
<vxe-column field="name" title="设备名称"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addData">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: 'govern/officialUser/index'
|
||||
})
|
||||
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import OfficialUserTree from '@/components/tree/govern/officialUserTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { queryRunPortableDevByUseId ,queryUnlinkEngineeringByUseId} from '@/api/cs-device-boot/user'
|
||||
import { add, removeUserDev, queryDevByUseId } from '@/api/cs-system-boot/official'
|
||||
import { ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
|
||||
const pageHeight = mainHeight(20)
|
||||
const loading = ref(true)
|
||||
|
||||
const user: any = ref({})
|
||||
const tableData = ref([])
|
||||
const deviceTableData = ref([]) // 设备表格数据
|
||||
const tableData2 = ref([]) // 工程数据源
|
||||
const deviceTableData2 = ref([]) // 设备数据源
|
||||
const dialogVisible = ref(false)
|
||||
const filterText = ref('') // 工程搜索文本
|
||||
const deviceFilterText = ref('') // 设备搜索文本
|
||||
const tableRef = ref()
|
||||
const deviceTableRef = ref() // 设备表格引用
|
||||
|
||||
const selectUser = (e: any) => {
|
||||
user.value = e
|
||||
loading.value = true
|
||||
|
||||
queryDevByUseId({ userId: e.id }).then((engineeringRes) => {
|
||||
loading.value = false
|
||||
tableData.value = engineeringRes.data.engineeringList || []
|
||||
deviceTableData.value = engineeringRes.data.portableDevList || []
|
||||
}).catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const getEnginnerDev = () => {
|
||||
filterText.value = ''
|
||||
deviceFilterText.value = ''
|
||||
|
||||
// 同时获取工程和设备数据
|
||||
Promise.all([
|
||||
queryUnlinkEngineeringByUseId({ userId: user.value.id }),
|
||||
queryRunPortableDevByUseId({ userId: user.value.id })
|
||||
]).then(([engineeringRes, deviceRes]) => {
|
||||
tableData2.value = engineeringRes.data || []
|
||||
deviceTableData2.value = deviceRes.data || []
|
||||
dialogVisible.value = true
|
||||
|
||||
setTimeout(() => {
|
||||
tableRef.value?.clearCheckboxRow()
|
||||
deviceTableRef.value?.clearCheckboxRow()
|
||||
}, 0)
|
||||
})
|
||||
}
|
||||
|
||||
const deleteEngineering = (row: any) => {
|
||||
ElMessageBox.confirm('是否移出该工程?', '请确认', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 只移除工程,设备列表为空
|
||||
const form = {
|
||||
engineeringList: [row.id], // 要移除的工程ID
|
||||
portableDevList: [], // 设备列表为空
|
||||
userId: user.value.id
|
||||
}
|
||||
|
||||
removeUserDev(form).then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
selectUser(user.value)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备方法
|
||||
const deleteDevice = (row: any) => {
|
||||
console.log('删除设备', row)
|
||||
ElMessageBox.confirm('是否移出该设备?', '请确认', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 只移除设备,工程列表为空
|
||||
const form = {
|
||||
engineeringList: [], // 工程列表为空
|
||||
portableDevList: [row.id], // 要移除的设备ID
|
||||
userId: user.value.id
|
||||
}
|
||||
|
||||
removeUserDev(form).then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
selectUser(user.value)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const addData = () => {
|
||||
const selectedEngineers = tableRef.value.getCheckboxRecords()
|
||||
const selectedDevices = deviceTableRef.value.getCheckboxRecords()
|
||||
|
||||
// 如果没有选择任何项,则提示
|
||||
if (selectedEngineers.length === 0 && selectedDevices.length === 0) {
|
||||
ElMessage.warning('请至少选择一项工程或设备')
|
||||
return
|
||||
}
|
||||
|
||||
// 构造请求参数对象
|
||||
const form = {
|
||||
engineeringList: [] as any[],
|
||||
portableDevList: [] as any[],
|
||||
userId: user.value.id
|
||||
}
|
||||
|
||||
// // 处理已有的工程数据
|
||||
// tableData.value.forEach((item: any) => {
|
||||
// form.engineeringList.push(item.id)
|
||||
// })
|
||||
|
||||
// // 处理已有的设备数据
|
||||
// deviceTableData.value.forEach((item: any) => {
|
||||
// form.portableDevList.push(item.id)
|
||||
// })
|
||||
|
||||
// 添加新选择的工程
|
||||
selectedEngineers.forEach((item: any) => {
|
||||
form.engineeringList.push( item.id)
|
||||
})
|
||||
|
||||
// 添加新选择的设备
|
||||
selectedDevices.forEach((item: any) => {
|
||||
form.portableDevList.push(item.id)
|
||||
})
|
||||
|
||||
// 发送请求
|
||||
add(form).then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
selectUser(user.value)
|
||||
dialogVisible.value = false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.device-manage {
|
||||
display: flex;
|
||||
|
||||
&-right {
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
padding: 10px 10px 10px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.el-descriptions__header {
|
||||
height: 27px;
|
||||
display: flex;
|
||||
justify-content: flex-end; /* 靠右显示 */
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tables-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.table-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
&:first-child {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
||||
.dialog-section {
|
||||
flex: 1;
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
|
||||
span {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -96,14 +96,14 @@ const tableStore = new TableStore({
|
||||
fixed: 'right',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
功能调试: 'warning',
|
||||
出厂调试: 'warning',
|
||||
正式投运: 'success'
|
||||
2: 'warning',
|
||||
3: 'warning',
|
||||
4: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
功能调试: '功能调试',
|
||||
出厂调试: '出厂调试',
|
||||
正式投运: '正式投运'
|
||||
2: '功能调试',
|
||||
3: '出厂调试',
|
||||
4: '正式投运'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
@@ -142,11 +142,14 @@ const tableStore = new TableStore({
|
||||
{ title: '完整性(%)', fixed: 'right', width: 100, field: 'integrity', sortable: true }
|
||||
],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach(item => {
|
||||
exportProcessingData: () => {
|
||||
tableStore.table.allData = tableStore.table.allData.filter(item => {
|
||||
item.process = item.process == 2 ? '功能调试' : item.process == 3 ? '出厂调试' : '正式投运'
|
||||
return item
|
||||
})
|
||||
|
||||
console.log('🚀 ~ tableStore.table.allData:', tableStore.table.allData)
|
||||
},
|
||||
loadCallback: () => {
|
||||
let name = tableStore.table.params.name
|
||||
let data = tableStore.table.copyData.filter(item => {
|
||||
// 处理latestTime默认值
|
||||
@@ -182,7 +185,10 @@ const exportTab = () => {
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
data: tableStore.table.copyData, // 数据源 // 过滤那个字段导出
|
||||
data: tableStore.table.copyData.filter(item => {
|
||||
item.process = item.process == 2 ? '功能调试' : item.process == 3 ? '出厂调试' : '正式投运'
|
||||
return item
|
||||
}), // 数据源 // 过滤那个字段导出
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(
|
||||
column.column.title === undefined ||
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
<TableHeader>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="项目名称">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue"
|
||||
placeholder="请输入项目名称"></el-input>
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
placeholder="请输入项目名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
@@ -12,45 +16,75 @@
|
||||
</template>
|
||||
</TableHeader>
|
||||
<!-- <Table ref="tableRef" /> -->
|
||||
<div style="overflow-x: hidden; overflow-y: scroll;padding: 0 10px;" v-loading="tableStore.table.loading"
|
||||
:style="{ height: tableStore.table.height }">
|
||||
<div
|
||||
style="overflow-x: hidden; overflow-y: scroll; padding: 0 10px"
|
||||
v-loading="tableStore.table.loading"
|
||||
:style="{ height: tableStore.table.height }"
|
||||
>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6" v-for="item in tableStore.table.data" :key="item.id" class="mt10">
|
||||
<el-card class="box-card" @click="querdata(item)" shadow="hover">
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="display: flex;align-items: center">{{ item.name }}
|
||||
<span style="display: flex; align-items: center">
|
||||
{{ item.name }}
|
||||
|
||||
<el-tooltip class="item" effect="dark" content="修改项目" placement="top">
|
||||
<Edit style="margin-left: 5px;width: 16px;" class=" xiaoshou color"
|
||||
@click="editd(item)" />
|
||||
</el-tooltip></span>
|
||||
<div style="display: flex;justify-content: end;">
|
||||
<el-button class="color" icon="el-icon-Share" style="padding: 3px 0" type="text"
|
||||
@click="Aclick(item)">设计</el-button>
|
||||
<Edit
|
||||
style="margin-left: 5px; width: 16px"
|
||||
class="xiaoshou color"
|
||||
@click="editd(item)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
<div style="display: flex; justify-content: end">
|
||||
<el-button
|
||||
class="color"
|
||||
icon="el-icon-Share"
|
||||
style="padding: 3px 0"
|
||||
type="text"
|
||||
@click="Aclick(item)"
|
||||
>
|
||||
设计
|
||||
</el-button>
|
||||
<!-- <el-button icon="el-icon-share" style="padding: 3px 0; color: green"
|
||||
type="text" @click="shejid(item)">设计</el-button> -->
|
||||
<!-- <el-button icon="el-icon-edit" style="padding: 3px 0; color: blue" type="text"
|
||||
@click="shejid(item)">编辑</el-button> -->
|
||||
<el-button icon="el-icon-Delete" style="padding: 3px 0; color: red" type="text"
|
||||
@click="deleted(item)">删除</el-button>
|
||||
<el-button
|
||||
icon="el-icon-Delete"
|
||||
style="padding: 3px 0; color: red"
|
||||
type="text"
|
||||
@click="deleted(item)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<img v-if="item.fileContent" :src="item.fileContent" class="image xiaoshou" @click="imgData(item)" />
|
||||
<el-empty v-else description="暂无设计" style="height: 220px;"/>
|
||||
<img
|
||||
v-if="item.fileContent"
|
||||
:src="item.fileContent"
|
||||
class="image xiaoshou"
|
||||
@click="imgData(item)"
|
||||
/>
|
||||
<el-empty v-else description="暂无设计" style="height: 220px" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="table-pagination">
|
||||
<el-pagination :currentPage="tableStore.table.params!.pageNum"
|
||||
:page-size="tableStore.table.params!.pageSize" :page-sizes="[10, 20, 50, 100]" background
|
||||
:layout="'sizes,total, ->, prev, pager, next, jumper'" :total="tableStore.table.total"
|
||||
@size-change="onTableSizeChange" @current-change="onTableCurrentChange"></el-pagination>
|
||||
<el-pagination
|
||||
:currentPage="tableStore.table.params!.pageNum"
|
||||
:page-size="tableStore.table.params!.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
background
|
||||
:layout="'sizes,total, ->, prev, pager, next, jumper'"
|
||||
:total="tableStore.table.total"
|
||||
@size-change="onTableSizeChange"
|
||||
@current-change="onTableCurrentChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
|
||||
<popup ref="popupRef" @submit="tableStore.index()" />
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -61,9 +95,12 @@ import TableStore from '@/utils/tableStore'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { deleteTopoTemplate, uploadTopo } from '@/api/cs-device-boot/topologyTemplate'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { audit, add } from '@/api/cs-harmonic-boot/mxgraph';
|
||||
import { audit, add } from '@/api/cs-harmonic-boot/mxgraph'
|
||||
import { Edit } from '@element-plus/icons-vue'
|
||||
import popup from './components/popup.vue'
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'ypt'
|
||||
|
||||
defineOptions({
|
||||
name: 'mxgraph/graph-list'
|
||||
})
|
||||
@@ -78,11 +115,8 @@ const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/csconfiguration/queryPage',
|
||||
method: 'POST',
|
||||
publicHeight: 60,
|
||||
column: [
|
||||
],
|
||||
loadCallback: () => {
|
||||
|
||||
}
|
||||
column: [],
|
||||
loadCallback: () => {}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
tableStore.table.params.searchValue = ''
|
||||
@@ -93,12 +127,11 @@ onMounted(() => {
|
||||
})
|
||||
// 查询
|
||||
const onSubmitadd = () => {
|
||||
|
||||
popupRef.value.open({
|
||||
title: '新增项目'
|
||||
})
|
||||
}
|
||||
const querdata = (e: any) => { }
|
||||
const querdata = (e: any) => {}
|
||||
const editd = (e: any) => {
|
||||
popupRef.value.open({
|
||||
title: '修改项目',
|
||||
@@ -107,45 +140,48 @@ const editd = (e: any) => {
|
||||
}
|
||||
// 设计
|
||||
const Aclick = (e: any) => {
|
||||
// window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=zl`)
|
||||
window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=zl`)
|
||||
|
||||
//window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=zl`)
|
||||
window.open(
|
||||
window.location.origin +
|
||||
`/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=${VITE_FLAG ? 'ypt' : 'zl'}`
|
||||
)
|
||||
}
|
||||
// 删除
|
||||
const deleted = (e: any) => {
|
||||
ElMessageBox.confirm("此操作将永久删除该项目, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
ElMessageBox.confirm('此操作将永久删除该项目, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
let data = {
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
status: "0",
|
||||
};
|
||||
status: '0'
|
||||
}
|
||||
audit(data).then((res: any) => {
|
||||
if (res.code == "A0000") {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除项目成功!",
|
||||
});
|
||||
type: 'success',
|
||||
message: '删除项目成功!'
|
||||
})
|
||||
}
|
||||
tableStore.index()
|
||||
});
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const imgData = (e: any) => {
|
||||
// window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=zl#/preview_ZL`)
|
||||
window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=zl#/preview_ZL`)
|
||||
|
||||
window.open(
|
||||
window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=${VITE_FLAG ? 'ypt' : 'zl'}#/preview_ZL`
|
||||
)
|
||||
// window.open('http://192.168.1.128:4001' + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=zl#/preview_ZL`)
|
||||
}
|
||||
|
||||
const onTableSizeChange = (val: number) => {
|
||||
@@ -155,7 +191,6 @@ const onTableSizeChange = (val: number) => {
|
||||
const onTableCurrentChange = (val: number) => {
|
||||
tableStore.onTableAction('current-page-change', { page: val })
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.text {
|
||||
@@ -179,7 +214,7 @@ span {
|
||||
.clearfix::before,
|
||||
.clearfix::after {
|
||||
display: table;
|
||||
content: "";
|
||||
content: '';
|
||||
}
|
||||
|
||||
.clearfix::after {
|
||||
@@ -189,7 +224,7 @@ span {
|
||||
.box-card {
|
||||
width: 100%;
|
||||
// border: 1px solid #000;
|
||||
box-shadow: var(--el-box-shadow-light)
|
||||
box-shadow: var(--el-box-shadow-light);
|
||||
}
|
||||
|
||||
.xiaoshou {
|
||||
@@ -218,7 +253,7 @@ span {
|
||||
|
||||
// 不可全选样式
|
||||
.el-tree-node {
|
||||
.is-leaf+.el-checkbox .el-checkbox__inner {
|
||||
.is-leaf + .el-checkbox .el-checkbox__inner {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
267
src/views/govern/reportCore/lineReport/index.vue
Normal file
267
src/views/govern/reportCore/lineReport/index.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<div class="default-main" :style="height">
|
||||
<splitpanes style="height: 100%" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
<CloudDeviceEntryTree
|
||||
ref="TerminalRef"
|
||||
@node-click="handleNodeClick"
|
||||
@init="handleNodeClick"
|
||||
></CloudDeviceEntryTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" date-picker :show-search="false">
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label=" 模板策略">
|
||||
<el-select v-model="value" placeholder="请选择" @change="changeFn" clearable>
|
||||
<el-option
|
||||
v-for="item in templatePolicy"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成报告</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div class="box" :style="`height: calc(${tableStore.table.height} + 65px)`">
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">监测点详情</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.xq">监测点详情</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降事件列表</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.lb">表格</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降密度</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.mdbg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.mdtx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降事件点</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.sjdITIC">ITIC</el-checkbox>
|
||||
<el-checkbox v-model="formd.sjdF47">F47</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">概率分布</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.glfbfz">暂降幅值</el-checkbox>
|
||||
<el-checkbox v-model="formd.glfbsj">持续时间</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">月份统计</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.tjbg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.tjtx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降原因</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.yybg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.yytx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降类型</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.lxbg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.lxtx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
import CloudDeviceEntryTree from '@/components/tree/govern/cloudDeviceEntryTree.vue'
|
||||
import { getLineExport } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
defineOptions({
|
||||
name: 'TransientReport/monitoringpointReport'
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
const Template: any = ref({})
|
||||
const uploadList: any = ref([])
|
||||
|
||||
const formd: any = ref({
|
||||
xq: true,
|
||||
lb: true,
|
||||
mdbg: false,
|
||||
mdtx: false,
|
||||
sjdITIC: false,
|
||||
sjdF47: false,
|
||||
glfbfz: false,
|
||||
glfbsj: false,
|
||||
tjbg: false,
|
||||
tjtx: false,
|
||||
yybg: false,
|
||||
yytx: false,
|
||||
lxbg: false,
|
||||
lxtx: false,
|
||||
type: 0
|
||||
})
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
})
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
dotList.value = data
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
const isJPG = files.raw.type === 'image/jpg'
|
||||
const isJPEG = files.raw.type === 'image/jpeg'
|
||||
const isPNG = files.raw.type === 'image/png'
|
||||
if (!isJPG && !isPNG && !isJPEG) {
|
||||
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
uploadList.value = files
|
||||
ElMessage.success('上传成功')
|
||||
}
|
||||
|
||||
//生成报告
|
||||
const exportEvent = () => {
|
||||
if (dotList.value?.level != 4) {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
let a = ''
|
||||
|
||||
// formd.value.lineId = monitoringPoint.state.lineId
|
||||
// formd.value.lineName = monitoringPoint.state.lineName.split('>').at(-1)
|
||||
formd.value.lineId = dotList.value.id
|
||||
formd.value.lineName = dotList.value.name
|
||||
formd.value.searchBeginTime = TableHeaderRef.value.datePickerRef.timeValue[0]
|
||||
formd.value.searchEndTime = TableHeaderRef.value.datePickerRef.timeValue[1]
|
||||
formd.value.flag = TableHeaderRef.value.datePickerRef.interval
|
||||
ElMessage('生成报告中,请稍等!')
|
||||
getLineExport(formd.value).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '监测点报告' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
.grid-content {
|
||||
text-align: center;
|
||||
}
|
||||
.divBox {
|
||||
width: 250px;
|
||||
height: 31px;
|
||||
margin: auto;
|
||||
line-height: 32px;
|
||||
border: 1px solid #c9c9c9;
|
||||
&:hover {
|
||||
border: 1px solid #002255;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
padding: 10px;
|
||||
// margin-top: 10px;
|
||||
overflow-y: auto;
|
||||
font-size: 15px;
|
||||
}
|
||||
.el-divider--horizontal {
|
||||
margin: 10px 0;
|
||||
}
|
||||
.mTop {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
175
src/views/govern/reportCore/report/index.vue
Normal file
175
src/views/govern/reportCore/report/index.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div class="default-main" :style="height">
|
||||
<splitpanes style="height: 100%" id="navigation-splitpanes">
|
||||
<pane :size="size">
|
||||
|
||||
<CloudDeviceEntryTree
|
||||
ref="TerminalRef"
|
||||
@node-click="handleNodeClick"
|
||||
@init="handleNodeClick"
|
||||
></CloudDeviceEntryTree>
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<TableHeader ref="TableHeaderRef" datePicker :show-search="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="客户名称">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.crmName"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
clearable
|
||||
placeholder="请输入客户名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报表编号">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.reportNumber"
|
||||
clearable
|
||||
placeholder="请输入报表编号"
|
||||
maxlength="12"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload
|
||||
:show-file-list="false"
|
||||
ref="uploadRef"
|
||||
action=""
|
||||
accept=".png,.jpg"
|
||||
:on-change="choose"
|
||||
:auto-upload="false"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-button icon="el-icon-Upload" type="primary" class="mr10 ml10">上传接线图</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div class="box">
|
||||
<div id="luckysheet">
|
||||
<img
|
||||
width="100%"
|
||||
:style="`height: calc(${tableStore.table.height} + 40px)`"
|
||||
src="@/assets/img/jss.png"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
import type { UploadProps, UploadUserFile } from 'element-plus'
|
||||
import CloudDeviceEntryTree from '@/components/tree/govern/cloudDeviceEntryTree.vue'
|
||||
import { exportModel } from '@/api/cs-harmonic-boot/datatrend'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/report/word'
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({})
|
||||
const Template: any = ref({})
|
||||
const uploadList: any = ref([])
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
})
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
dotList.value = data
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
const isJPG = files.raw.type === 'image/jpg'
|
||||
const isJPEG = files.raw.type === 'image/jpeg'
|
||||
const isPNG = files.raw.type === 'image/png'
|
||||
if (!isJPG && !isPNG && !isJPEG) {
|
||||
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
uploadList.value = files
|
||||
ElMessage.success('上传成功')
|
||||
}
|
||||
// 生成
|
||||
const exportEvent = () => {
|
||||
console.log("🚀 ~ exportEvent ~ dotList.value:", dotList.value)
|
||||
if (dotList.value?.level != 4) {
|
||||
return ElMessage.warning('请选择监测点进行报告生成!')
|
||||
}
|
||||
|
||||
let form = new FormData()
|
||||
form.append('lineIndex', dotList.value.id)
|
||||
form.append('name', dotList.value.name)
|
||||
form.append('crmName', tableStore.table.params.crmName || '')
|
||||
form.append('reportNumber', tableStore.table.params.reportNumber || '')
|
||||
form.append('type', '0')
|
||||
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||
console.log('🚀 ~ exportEvent ~ uploadList.value:', uploadList.value?.raw)
|
||||
form.append('file', uploadList.value?.raw || '')
|
||||
// 特殊字符正则表达式
|
||||
const specialCharRegex = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/
|
||||
if (
|
||||
specialCharRegex.test(tableStore.table.params.crmName) ||
|
||||
specialCharRegex.test(tableStore.table.params.reportNumber)
|
||||
) {
|
||||
ElNotification({
|
||||
type: 'error',
|
||||
message: '包含特殊字符,请注意修改!'
|
||||
})
|
||||
} else {
|
||||
ElMessage('生成报告中...')
|
||||
exportModel(form).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = dotList.value.name // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
|
||||
.box {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -2,35 +2,75 @@
|
||||
<el-tabs v-model.trim="activeName" class="demo-tabs">
|
||||
<el-tab-pane label="数据单位" name="0">
|
||||
绑定数据单位:
|
||||
<el-cascader :popper-append-to-body="false" ref="cascaderUnit" placeholder="请选择数据单位" v-model.trim="value"
|
||||
:options="options1" filterable @change="handleChange" :props="{
|
||||
<el-cascader
|
||||
:popper-append-to-body="false"
|
||||
ref="cascaderUnit"
|
||||
placeholder="请选择数据单位"
|
||||
v-model.trim="value"
|
||||
:options="options1"
|
||||
filterable
|
||||
@change="handleChange"
|
||||
:props="{
|
||||
value: 'code',
|
||||
label: 'name'
|
||||
}"></el-cascader>
|
||||
}"
|
||||
></el-cascader>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="数据指标" name="1">
|
||||
<div class="mb10" style="text-align: end;">
|
||||
<el-radio-group v-model="frontAndBack">
|
||||
<el-radio-button label="治理前" :value="0" />
|
||||
<el-radio-button label="治理后" :value="1" />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div>
|
||||
绑定数据指标:
|
||||
<el-cascader :popper-append-to-body="false" ref="cascaderUnit" placeholder="请选择数据指标" v-model.trim="value"
|
||||
:options="options2" filterable @change="handleChange" :props="{
|
||||
<el-cascader
|
||||
:popper-append-to-body="false"
|
||||
ref="cascaderUnit"
|
||||
placeholder="请选择数据指标"
|
||||
v-model.trim="value"
|
||||
:options="options2"
|
||||
filterable
|
||||
@change="handleChange"
|
||||
:props="{
|
||||
value: 'name',
|
||||
label: 'showName'
|
||||
}"></el-cascader>
|
||||
}"
|
||||
></el-cascader>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合格率判定" name="2">
|
||||
绑定合格率判定:
|
||||
<el-cascader :popper-append-to-body="false" ref="cascaderhgl" placeholder="请选择数据合格率" v-model.trim="value"
|
||||
:options="options3" filterable @change="handleChange" :props="{
|
||||
<el-cascader
|
||||
:popper-append-to-body="false"
|
||||
ref="cascaderhgl"
|
||||
placeholder="请选择数据合格率"
|
||||
v-model.trim="value"
|
||||
:options="options3"
|
||||
filterable
|
||||
@change="handleChange"
|
||||
:props="{
|
||||
value: 'name',
|
||||
label: 'showName'
|
||||
}"></el-cascader>
|
||||
}"
|
||||
></el-cascader>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="监测点台账指标" name="3">
|
||||
绑定数据指标:
|
||||
<el-cascader :popper-append-to-body="false" ref="cascaderjcd" placeholder="请选择监测点台账" v-model.trim="value"
|
||||
:options="options4" filterable @change="handleChange" :props="{
|
||||
<el-cascader
|
||||
:popper-append-to-body="false"
|
||||
ref="cascaderjcd"
|
||||
placeholder="请选择监测点台账"
|
||||
v-model.trim="value"
|
||||
:options="options4"
|
||||
filterable
|
||||
@change="handleChange"
|
||||
:props="{
|
||||
value: 'name',
|
||||
label: 'showName'
|
||||
}"></el-cascader>
|
||||
}"
|
||||
></el-cascader>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
@@ -47,13 +87,12 @@ const options1 = ref([])
|
||||
const options2 = ref([])
|
||||
const options3 = ref([])
|
||||
const options4: any = ref([])
|
||||
const frontAndBack = ref(0)
|
||||
|
||||
const handleChange = (e: any) => {
|
||||
value.value = []
|
||||
|
||||
emit('setValue', e)
|
||||
emit('setValue', e, activeName.value == '1' ? frontAndBack.value : 0)
|
||||
}
|
||||
|
||||
codeDicTree({ code: 'Device_Unit' }).then(res => {
|
||||
options1.value = res.data
|
||||
})
|
||||
@@ -67,7 +106,7 @@ terminalChooseTree().then(res => {
|
||||
options4.value = res.data
|
||||
})
|
||||
|
||||
onMounted(() => { })
|
||||
onMounted(() => {})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-tab-pane) {
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<el-input maxlength="32" show-word-limit placeholder="模板名称" v-model.trim="formdata.name"
|
||||
style="width: 100%"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门:" prop="deptId">
|
||||
<!-- <el-form-item label="部门:" prop="deptId">
|
||||
<Area v-model.trim="formdata.deptId" style="width: 100%" collapse-tags
|
||||
:props="{ multiple: true, label: 'name', value: 'id', emitPath: false }" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="模板类型:" prop="reportType">
|
||||
<el-select style="width: 100%" v-model.trim="formdata.reportType" placeholder="请选择模板类型">
|
||||
|
||||
@@ -35,7 +35,7 @@ const departmentRef = ref()
|
||||
const show = ref(true)
|
||||
const lookShow = ref(true)
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/harmonic-boot/customReport/getTemplateList',
|
||||
url: '/cs-harmonic-boot/customReport/getTemplateList',
|
||||
method: 'POST',
|
||||
isWebPaging: true,
|
||||
column: [
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div class="mb10" style="display: flex; justify-content: flex-end">
|
||||
<el-upload ref="upload" action="" :auto-upload="false" :show-file-list="false" :limit="1"
|
||||
:on-change="beforeUpload">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
action=""
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:limit="1"
|
||||
:on-change="beforeUpload"
|
||||
>
|
||||
<el-button icon="el-icon-Upload" type="primary" class="mr10">导入excel</el-button>
|
||||
</el-upload>
|
||||
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出excel</el-button>
|
||||
@@ -54,13 +60,13 @@ const info = () => {
|
||||
luckysheet.create(options.value)
|
||||
}
|
||||
//绑定value
|
||||
const setValue = (e: any) => {
|
||||
const setValue = (e: any, frontAndBack: number) => {
|
||||
let data = luckysheet.getRange()
|
||||
luckysheet.setCellValue(
|
||||
data[0].row[0],
|
||||
data[0].column[0],
|
||||
{
|
||||
v: e[e.length - 1],
|
||||
v: frontAndBack == 0 ? e[e.length - 1] : `~` + e[e.length - 1],
|
||||
tr: e
|
||||
}
|
||||
// checkedNodes[0].data.label
|
||||
@@ -119,21 +125,25 @@ const submitForm = (formdata: any, text: string) => {
|
||||
params.append('reportForm', formdata.reportForm)
|
||||
ElMessage.info('正在保存请稍等!')
|
||||
if (text == '新增报表模板') {
|
||||
addTemplate(params).then(res => {
|
||||
addTemplate(params)
|
||||
.then(res => {
|
||||
ElMessage.success('新增成功!')
|
||||
formFer.value.shutDown()
|
||||
emit('shutDown')
|
||||
}).catch(err => {
|
||||
})
|
||||
.catch(err => {
|
||||
ElMessage.error('保存失败!')
|
||||
formFer.value.shutDown()
|
||||
})
|
||||
} else if (text == '编辑报表模板') {
|
||||
params.append('id', list.value.id)
|
||||
dateTemplateup(params).then(res => {
|
||||
dateTemplateup(params)
|
||||
.then(res => {
|
||||
ElMessage.success('编辑成功!')
|
||||
formFer.value.shutDown()
|
||||
emit('shutDown')
|
||||
}).catch(err => {
|
||||
})
|
||||
.catch(err => {
|
||||
ElMessage.error('保存失败!')
|
||||
formFer.value.shutDown()
|
||||
})
|
||||
@@ -150,7 +160,7 @@ const open = async (text: string, row?: any) => {
|
||||
info()
|
||||
}
|
||||
defineExpose({ open })
|
||||
onMounted(() => { })
|
||||
onMounted(() => {})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-tab-pane) {
|
||||
|
||||
106
src/views/govern/sensitiveLoadMange/detail.vue
Normal file
106
src/views/govern/sensitiveLoadMange/detail.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<el-dialog class="cn-operate-dialog" width="600px" v-model.trim="dialogVisible" :title="title">
|
||||
<el-form :model="form" label-width="auto" ref="formRef" :rules="rules">
|
||||
<el-form-item label="所属厂站名称" prop="substationName">
|
||||
<el-input v-model.trim="form.substationName" placeholder="请输入所属厂站名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="敏感用户名称" prop="name">
|
||||
<el-input v-model.trim="form.name" placeholder="请输入敏感用户名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="敏感负荷类型" prop="loadType">
|
||||
<el-select v-model.trim="form.loadType" filterable clearable placeholder="请选择数据分类">
|
||||
<el-option
|
||||
v-for="item in DataTypeSelect"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户协议容量(MVA)" prop="userAgreementCapacity">
|
||||
<el-input-number style="width: 100%;" :min="0" maxlength="32" show-word-limit v-model.trim="form.userAgreementCapacity" placeholder="请输入用户协议容量"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="装机容量(MW)" prop="installedCapacity">
|
||||
<el-input-number style="width: 100%;" :min="0" maxlength="32" show-word-limit v-model.trim="form.installedCapacity" placeholder="请输入装机容量"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number style="width: 100%;" :min="0" maxlength="32" show-word-limit v-model.trim="form.sort" placeholder="请输入排序"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref,inject } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { saveUser, updateUser } from '@/api/cs-device-boot/sensitiveLoadMange'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
|
||||
const TypeOptions = ref()
|
||||
|
||||
const dictData = useDictData()
|
||||
const DataTypeSelect = dictData.getBasicData('Sensitive_User_Type')
|
||||
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
|
||||
const formRef = ref()
|
||||
const form = reactive<any>({
|
||||
loadType: [],
|
||||
substationName: null,
|
||||
installedCapacity: null,
|
||||
name: null,
|
||||
userAgreementCapacity:null,
|
||||
id: null,
|
||||
sort:100
|
||||
})
|
||||
const rules = {
|
||||
substationName: [{ required: true, message: '所属厂站名称不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '敏感用户名称不能为空', trigger: 'blur' }],
|
||||
loadType: [{ required: true, message: '请选择敏感负荷类型', trigger: 'blur' }],
|
||||
installedCapacity: [{ required: true, message: '用户协议容量不能为空', trigger: 'blur' }],
|
||||
userAgreementCapacity: [{ required: true, message: '装机容量不能为空', trigger: 'blur' }],
|
||||
sort: [{ required: true, message: '排序不能为空', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('新增')
|
||||
const open = (text: string, data?: anyObj) => {
|
||||
title.value = text
|
||||
dialogVisible.value = true
|
||||
if (data) {
|
||||
for (let key in form) {
|
||||
form[key] = data[key]
|
||||
}
|
||||
} else {
|
||||
for (let key in form) {
|
||||
form[key] = null
|
||||
form.sort = 100
|
||||
}
|
||||
}
|
||||
}
|
||||
const submit = () => {
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (form.id) {
|
||||
await updateUser(form)
|
||||
} else {
|
||||
await saveUser(form)
|
||||
}
|
||||
ElMessage.success('操作成功')
|
||||
tableStore.index()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
105
src/views/govern/sensitiveLoadMange/index.vue
Normal file
105
src/views/govern/sensitiveLoadMange/index.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker>
|
||||
<template #operation>
|
||||
<el-button :icon="Plus" type="primary" @click="addMenu" class="ml10">新增</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<detail ref="detail"></detail>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import Detail from './detail.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { deleteUser } from '@/api/cs-device-boot/sensitiveLoadMange'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/device/sensitiveLoadMange'
|
||||
})
|
||||
const detail = ref()
|
||||
|
||||
const dictData = useDictData()
|
||||
const interferenceType = dictData.getBasicData('Sensitive_User_Type')
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/getList',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '所属厂站名称', field: 'substationName', minWidth: 180 },
|
||||
{ title: '敏感用户名称', field: 'name', minWidth: 180 },
|
||||
{
|
||||
title: '敏感负荷类型',
|
||||
field: 'loadType',
|
||||
minWidth: 120,
|
||||
formatter: row => {
|
||||
return interferenceType.filter(item => item.id == row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
{ title: '用户协议容量(MVA)', field: 'userAgreementCapacity', minWidth: 100 },
|
||||
{ title: '装机容量(MW)', field: 'installedCapacity', minWidth: 100 },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
detail.value.open('编辑', row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
deleteUser([row.id]).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
loadCallback: () => {}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
const addMenu = () => {
|
||||
detail.value.open('新增')
|
||||
}
|
||||
</script>
|
||||
@@ -3,7 +3,12 @@
|
||||
<TableHeader :showSearch="false" v-show="flag">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="日期">
|
||||
<DatePicker ref="datePickerRef" :nextFlag="false" :theCurrentTime="true" @change="handleDatePickerChange"></DatePicker>
|
||||
<DatePicker
|
||||
ref="datePickerRef"
|
||||
:nextFlag="false"
|
||||
:theCurrentTime="true"
|
||||
@change="handleDatePickerChange"
|
||||
></DatePicker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
@@ -11,7 +16,6 @@
|
||||
<el-button type="primary" icon="el-icon-Tools" @click="settings">设置</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<GridLayout
|
||||
v-model:layout="layout"
|
||||
:row-height="rowHeight"
|
||||
@@ -21,6 +25,11 @@
|
||||
:vertical-compact="false"
|
||||
prevent-collision
|
||||
:col-num="12"
|
||||
:style="{
|
||||
transform: `scale(${zoom})`,
|
||||
transformOrigin: 'top left',
|
||||
width: zoom !== 1 ? `${100 / zoom}%` : '100%'
|
||||
}"
|
||||
>
|
||||
<template #item="{ item }">
|
||||
<div class="box">
|
||||
@@ -29,8 +38,8 @@
|
||||
<Icon class="HelpFilled" :name="(item as LayoutItem).icon" />
|
||||
{{ (item as LayoutItem).name }}
|
||||
</div>
|
||||
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="zoom(item)" /> -->
|
||||
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="zoom(item)" />
|
||||
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="setZoom(item)" /> -->
|
||||
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="setZoom(item)" />
|
||||
</div>
|
||||
<div>
|
||||
<component
|
||||
@@ -41,7 +50,7 @@
|
||||
:timeValue="datePickerRef?.timeValue || 3"
|
||||
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||
:width="rowWidth * item.w - 30 + 'px'"
|
||||
:timeKey="(item as LayoutItem).timeKey"
|
||||
:timeKey="(item as LayoutItem).timeKeys"
|
||||
:interval="datePickerRef?.interval"
|
||||
:w="item.w"
|
||||
:h="item.h"
|
||||
@@ -64,7 +73,7 @@ import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
import { queryActivatePage, queryByPagePath } from '@/api/system-boot/csstatisticalset'
|
||||
import RoutingConfig from '@/views/pqs/cockpit/homePage/components/routingConfig.vue'
|
||||
import { useRouter,useRoute } from 'vue-router'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
const { push } = useRouter()
|
||||
const datePickerRef = ref()
|
||||
@@ -75,13 +84,14 @@ const timeCacheStore = useTimeCacheStore()
|
||||
defineOptions({
|
||||
// name: 'dashboard/index'
|
||||
})
|
||||
|
||||
// 定义类型
|
||||
interface LayoutItem {
|
||||
x: number
|
||||
y: number
|
||||
w: number
|
||||
h: number
|
||||
timeKey: number | string
|
||||
timeKeys: any
|
||||
i: string | number
|
||||
name: string
|
||||
path: string
|
||||
@@ -90,6 +100,7 @@ interface LayoutItem {
|
||||
loading?: boolean
|
||||
error?: any
|
||||
}
|
||||
const zoom = ref(1)
|
||||
const RoutingConfigRef = ref()
|
||||
const key = ref(0)
|
||||
const img = new URL(`@/assets/img/amplify.png`, import.meta.url).href
|
||||
@@ -115,13 +126,16 @@ const componentMap = reactive(new Map<string, Component | string>())
|
||||
const dataList: any = ref({})
|
||||
// 获取主内容区域高度
|
||||
const getMainHeight = () => {
|
||||
const elMain = document.querySelector('.el-main')
|
||||
return (elMain?.offsetHeight || 0) - 70
|
||||
const elMain = document.querySelector('.el-main') as HTMLElement | null
|
||||
zoom.value =
|
||||
layout.value.length == 1 ? 1 : (elMain?.offsetHeight ?? 0) > 1080 ? 1 : (elMain?.offsetHeight ?? 0) / 1080
|
||||
// console.log('🚀 ~ getMainHeight ~ elMain:', elMain?.offsetHeight)
|
||||
return ((elMain?.offsetHeight || 0) - 70) / zoom.value
|
||||
}
|
||||
// 获取主内容区域高度
|
||||
const getMainWidth = () => {
|
||||
const elMain = document.querySelector('.el-main')
|
||||
return (elMain?.offsetWidth || 0) - 20
|
||||
const elMain = document.querySelector('.el-main') as HTMLElement | null
|
||||
return ((elMain?.offsetWidth || 0) - 20) / zoom.value
|
||||
}
|
||||
|
||||
// 初始化行高
|
||||
@@ -165,18 +179,21 @@ const registerComponent = (path: string): Component | string | null => {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
// 缩放
|
||||
const zoom = (value: any) => {
|
||||
const setZoom = (value: any) => {
|
||||
if (flag.value) {
|
||||
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
|
||||
} else {
|
||||
layout.value = layoutCopy.value.map((item:any, index: number) => ({
|
||||
layout.value = layoutCopy.value.map((item: any, index: number) => ({
|
||||
...item,
|
||||
i: item.i || index, // 确保有唯一标识
|
||||
component: registerComponent(item.path)
|
||||
}))
|
||||
}
|
||||
|
||||
flag.value = !flag.value
|
||||
|
||||
initRowHeight()
|
||||
key.value += 1
|
||||
}
|
||||
@@ -214,7 +231,7 @@ const fetchLayoutData = async () => {
|
||||
// 窗口大小变化处理 - 使用防抖
|
||||
const handleResize = useDebounceFn(() => {
|
||||
initRowHeight()
|
||||
key.value += 1
|
||||
// key.value += 1
|
||||
}, 200)
|
||||
|
||||
// 修改
|
||||
@@ -232,14 +249,9 @@ const settings = () => {
|
||||
|
||||
// 处理 DatePicker 值变化事件
|
||||
const handleDatePickerChange = (value: any) => {
|
||||
|
||||
// 将值缓存到 timeCache
|
||||
if (value) {
|
||||
timeCacheStore.setCache(
|
||||
route.path,
|
||||
value.interval,
|
||||
value.timeValue
|
||||
)
|
||||
timeCacheStore.setCache(route.path, value.interval, value.timeValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,459 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<!-- 使用 v-for 遍历四个角落 -->
|
||||
<div v-for="corner in corners" v-show="corner.show" :key="corner.id" :class="['corner', corner.className]">
|
||||
<div class="content">
|
||||
<div class="title" style="display: flex">
|
||||
<img src="@/assets/img/lightning.png" class="title_img" />
|
||||
<span>{{ corner.title }}</span>
|
||||
</div>
|
||||
<vxe-table
|
||||
:data="corner.data"
|
||||
size="small"
|
||||
border
|
||||
show-header
|
||||
:header-cell-style="{ textAlign: 'center' }"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
height="200"
|
||||
style="padding: 5px;"
|
||||
>
|
||||
<vxe-column field="name" title="名称"></vxe-column>
|
||||
<vxe-column field="a" title="A" width="40"></vxe-column>
|
||||
<vxe-column field="b" title="B" width="40"></vxe-column>
|
||||
<vxe-column field="c" title="C" width="40"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<span class="close-btn" @click="closeCorner(corner.id)">
|
||||
<Close />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onBeforeUnmount, nextTick, reactive } from 'vue'
|
||||
// import { clickImage } from "@/api/manage_wx";
|
||||
import { Close } from '@element-plus/icons-vue'
|
||||
import socketClient from '@/utils/webSocketClient'
|
||||
|
||||
//开始创建webSocket客户端
|
||||
const dataSocket = reactive({
|
||||
socketServe: socketClient.Instance
|
||||
})
|
||||
// 定义四个角落的数据
|
||||
const corners = ref([
|
||||
{
|
||||
id: 'topLeft',
|
||||
title: '左上',
|
||||
className: 'top-left',
|
||||
show: false,
|
||||
data: [
|
||||
{ name: '电压', a: 1098, b: 2080, c: 3006 },
|
||||
{ name: '电流', a: 15, b: 25, c: 35 },
|
||||
{ name: '电压畸变率', a: 12, b: 22, c: 32 },
|
||||
{ name: '电流畸变率', a: 18, b: 28, c: 38 },
|
||||
{ name: '电压偏值', a: 12, b: 22, c: 32 },
|
||||
{ name: '电压不平衡', a: 18, b: 28, c: 38 }
|
||||
] as any[],
|
||||
elementId: '', // 记录该角落对应的元素ID
|
||||
raceLists: [] as any[] // 为每个角落添加独立的跑马灯数据存储
|
||||
},
|
||||
{
|
||||
id: 'topRight',
|
||||
title: '右上',
|
||||
className: 'top-right',
|
||||
show: false,
|
||||
data: [] as any[],
|
||||
elementId: '',
|
||||
raceLists: [] as any[] // 为每个角落添加独立的跑马灯数据存储
|
||||
}
|
||||
// {
|
||||
// id: "bottomLeft",
|
||||
// title: "左下",
|
||||
// className: "bottom-left",
|
||||
// show: false,
|
||||
// data: [] as { label: string; value: string }[],
|
||||
// elementId: "",
|
||||
// },
|
||||
// {
|
||||
// id: "bottomRight",
|
||||
// title: "右下",
|
||||
// className: "bottom-right",
|
||||
// show: false,
|
||||
// data: [] as { label: string; value: string }[],
|
||||
// elementId: "",
|
||||
// },
|
||||
])
|
||||
|
||||
interface DataTableItem {
|
||||
name: string
|
||||
a: number
|
||||
b: number
|
||||
c: number
|
||||
}
|
||||
|
||||
const tableData = ref<DataTableItem[]>([
|
||||
{ name: '电压', a: 1098, b: 2080, c: 3006 },
|
||||
{ name: '电流', a: 15, b: 25, c: 35 },
|
||||
{ name: '电压畸变率', a: 12, b: 22, c: 32 },
|
||||
{ name: '电流畸变率', a: 18, b: 28, c: 38 },
|
||||
{ name: '电压偏值', a: 12, b: 22, c: 32 },
|
||||
{ name: '电压不平衡', a: 18, b: 28, c: 38 }
|
||||
])
|
||||
|
||||
const steadyStateList = ref([])
|
||||
|
||||
const selectedId = ref('')
|
||||
|
||||
// 内部响应式数据
|
||||
const eventList = ref<any[]>([])
|
||||
|
||||
// const handleClickImage = async (elementId: string) => {
|
||||
// // 检查 elementId 是否有值,没有值则直接返回空数组
|
||||
// if (!elementId) {
|
||||
// eventList.value = [];
|
||||
// return;
|
||||
// }
|
||||
// try {
|
||||
// // 发送点击图片请求
|
||||
// const res = await clickImage({ lineId: elementId });
|
||||
|
||||
// // 确保返回的数据是数组格式,并且过滤掉 null/undefined 元素
|
||||
// let dataToStore: any[] = [];
|
||||
|
||||
// if (Array.isArray(res.data)) {
|
||||
// dataToStore = res.data.filter(
|
||||
// (item:any) => item !== null && item !== undefined
|
||||
// );
|
||||
// } else if (res.data && Array.isArray(res.data.records)) {
|
||||
// dataToStore = res.data.records.filter(
|
||||
// (item:any) => item !== null && item !== undefined
|
||||
// );
|
||||
// } else if (res.data) {
|
||||
// // 如果是单个对象且不为 null
|
||||
// if (res.data !== null && res.data !== undefined) {
|
||||
// dataToStore = [res.data];
|
||||
// }
|
||||
// }
|
||||
|
||||
// eventList.value = dataToStore;
|
||||
// } catch (error) {
|
||||
// console.error("调用 clickImage 接口出错:", error);
|
||||
// // 出错时设置为空数组,避免后续处理出错
|
||||
// eventList.value = [];
|
||||
// }
|
||||
// };
|
||||
|
||||
// 记录显示顺序,用于循环替换
|
||||
const displayOrder = ref<number[]>([])
|
||||
|
||||
// 更新指定角落数据的函数
|
||||
const updateCornerData = (cornerIndex: number, dataItem: any, elementId: string) => {
|
||||
// 更新标题为 objName
|
||||
if (dataItem.objName) {
|
||||
corners.value[cornerIndex].title = dataItem.objName
|
||||
} else {
|
||||
corners.value[cornerIndex].title = dataItem.stationName
|
||||
}
|
||||
|
||||
// 格式化数据
|
||||
corners.value[cornerIndex].data = [
|
||||
{ label: '监测点', value: dataItem.lineName },
|
||||
// {
|
||||
// label: "暂降次数",
|
||||
// value: dataItem.eventIds.length,
|
||||
// },
|
||||
{
|
||||
label: '暂降次数',
|
||||
value: ``
|
||||
},
|
||||
// { label: "稳态指标", value: "Ua:65.5 Ub:65.02 Uc:65.27 Uac:112.85 Uab:112.67 Ubc:112.85" },
|
||||
{
|
||||
label: '稳态指标',
|
||||
value: ``
|
||||
}
|
||||
]
|
||||
|
||||
// 记录该角落对应的元素ID
|
||||
corners.value[cornerIndex].elementId = elementId
|
||||
corners.value[cornerIndex].show = true
|
||||
}
|
||||
|
||||
// 显示下一个角落的函数
|
||||
const showNextCorner = (elementId: string) => {
|
||||
// 检查该元素ID是否已经显示过
|
||||
const existingCornerIndex = corners.value.findIndex(corner => corner.elementId === elementId && corner.show)
|
||||
|
||||
if (existingCornerIndex !== -1) {
|
||||
// 如果该元素已经显示过,不更新数据
|
||||
return
|
||||
}
|
||||
|
||||
// 确保 eventList.value 是数组并且过滤掉 null/undefined 元素
|
||||
if (!Array.isArray(eventList.value)) {
|
||||
console.warn('eventList.value 不是数组格式:', eventList.value)
|
||||
return
|
||||
}
|
||||
|
||||
// 过滤掉 null 和 undefined 元素,然后查找匹配项
|
||||
const validItems = eventList.value.filter(item => item !== null && item !== undefined)
|
||||
const dataItem = validItems.find(item => item.lineId === elementId)
|
||||
|
||||
// 如果没有找到匹配的数据项,则不更新数据
|
||||
if (!dataItem) {
|
||||
console.warn('未找到匹配的数据项:', elementId)
|
||||
return
|
||||
}
|
||||
|
||||
// 查找一个未显示的角落
|
||||
const availableCornerIndex = corners.value.findIndex(corner => !corner.show)
|
||||
|
||||
if (availableCornerIndex !== -1) {
|
||||
// 有空闲角落,显示在该角落
|
||||
updateCornerData(availableCornerIndex, dataItem, elementId)
|
||||
// 将事件数据存储到该角落
|
||||
corners.value[availableCornerIndex].raceLists = dataItem.eventList || []
|
||||
// 记录显示顺序
|
||||
displayOrder.value.push(availableCornerIndex)
|
||||
} else {
|
||||
// 没有空闲角落,按顺序替换角落
|
||||
// 获取需要替换的角落索引(循环替换)
|
||||
const replaceIndex = displayOrder.value.shift() || 0
|
||||
updateCornerData(replaceIndex, dataItem, elementId)
|
||||
// 将事件数据存储到该角落
|
||||
corners.value[replaceIndex].raceLists = dataItem.eventList || []
|
||||
// 将替换的索引重新加入队列末尾
|
||||
displayOrder.value.push(replaceIndex)
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭指定角落的函数
|
||||
const closeCorner = (id: string) => {
|
||||
const cornerIndex = corners.value.findIndex(c => c.id === id)
|
||||
if (cornerIndex !== -1) {
|
||||
corners.value[cornerIndex].show = false
|
||||
corners.value[cornerIndex].elementId = '' // 清空元素ID记录
|
||||
|
||||
// 从显示顺序中移除该角落索引
|
||||
const orderIndex = displayOrder.value.indexOf(cornerIndex)
|
||||
if (orderIndex !== -1) {
|
||||
displayOrder.value.splice(orderIndex, 1)
|
||||
}
|
||||
}
|
||||
send()
|
||||
}
|
||||
|
||||
// 关闭所有角落的函数
|
||||
const closeAllCorners = () => {
|
||||
corners.value.forEach(corner => {
|
||||
corner.show = false
|
||||
corner.elementId = ''
|
||||
})
|
||||
displayOrder.value = []
|
||||
}
|
||||
|
||||
// 组件挂载后初始化监听器
|
||||
onMounted(() => {
|
||||
init()
|
||||
// 初始化时不显示任何内容
|
||||
})
|
||||
|
||||
// 连接webSocket客户端
|
||||
const init = () => {
|
||||
if (!dataSocket.socketServe) {
|
||||
console.error('WebSocket 客户端实例不存在')
|
||||
return
|
||||
}
|
||||
dataSocket.socketServe.connect(new Date().getTime())
|
||||
dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||
if (res.type == 1) {
|
||||
//稳态指标数据
|
||||
let steadyState = JSON.parse(res.message)
|
||||
|
||||
// console.log(steadyState, "8990hhhhh");
|
||||
if (steadyState == null || steadyState.length == 0) return
|
||||
steadyStateList.value = steadyState
|
||||
corners.value.forEach((corner, index) => {
|
||||
let str = ``
|
||||
steadyState
|
||||
.filter((item: any) => item.lineId == corner.elementId)
|
||||
.forEach((item: any) => {
|
||||
if (item.value == 3.1415926) {
|
||||
str += `<div>${item.statisticalName}:/</div>`
|
||||
} else {
|
||||
str += `<div>${item.statisticalName}:${item.value}${item.unit}</div>`
|
||||
}
|
||||
})
|
||||
|
||||
corner.data.length > 0
|
||||
? (corner.data[2].value = `<div style="max-height: 100px;overflow-y: auto;">${str} </div>`)
|
||||
: ''
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const time = ref(null)
|
||||
// 推送消息
|
||||
const send = () => {
|
||||
dataSocket.socketServe.send({
|
||||
pageId: selectedId.value,
|
||||
lineIdList: corners.value.filter(item => item.show == true).map(corner => corner.elementId)
|
||||
})
|
||||
if (time.value) {
|
||||
clearTimeout(time.value)
|
||||
}
|
||||
if (corners.value.filter(item => item.show == true).map(corner => corner.elementId).length == 0) return
|
||||
time.value = setInterval(() => {
|
||||
dataSocket.socketServe.send({
|
||||
pageId: selectedId.value,
|
||||
lineIdList: corners.value.filter(item => item.show == true).map(corner => corner.elementId)
|
||||
})
|
||||
}, 1000 * 60)
|
||||
}
|
||||
|
||||
// 监听来自 iframe 的消息
|
||||
window.addEventListener('message', async function (event) {
|
||||
// 安全起见,可以验证消息来源(origin)
|
||||
// if (event.origin !== 'https://trusted-origin.com') return;
|
||||
|
||||
// 处理从 iframe 发送过来的消息
|
||||
if (event.data.action === 'coreClick') {
|
||||
const clickedElementId = event.data.coreId
|
||||
selectedId.value = event.data.selectedId
|
||||
|
||||
// 调用接口获取最新数据
|
||||
// await handleClickImage(clickedElementId);
|
||||
|
||||
// 根据接收到的元素LineId显示对应数据
|
||||
await showNextCorner(clickedElementId)
|
||||
|
||||
await send()
|
||||
}
|
||||
})
|
||||
|
||||
// 页面卸载时清除定时器
|
||||
onBeforeUnmount(() => {
|
||||
clearTimeout(time.value)
|
||||
dataSocket.socketServe?.closeWs()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.corner {
|
||||
width: 240px;
|
||||
/* height: 135px; */
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
color: #000;
|
||||
/* font-weight: bold; */
|
||||
/* 添加弹出动画 */
|
||||
opacity: 0;
|
||||
transform: scale(0.3);
|
||||
transition: all 0.4s ease-out;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
/* 显示状态的样式 */
|
||||
.corner:not([style*='display: none']):not([style*='display:none']) {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.top-left {
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.top-right {
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.bottom-left {
|
||||
top: 170px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.bottom-right {
|
||||
top: 170px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
// text-align: center;
|
||||
padding: 5px;
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #444;
|
||||
background-color: var(--el-color-primary);
|
||||
border-radius: 8px 8px 0 0;
|
||||
}
|
||||
|
||||
.title_img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.data-item {
|
||||
display: flex;
|
||||
margin-bottom: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.label {
|
||||
/* font-weight: bold; */
|
||||
width: 55px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.value {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 关闭按钮样式 */
|
||||
.close-btn {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
width: 14px;
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.indicator {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.table th,
|
||||
.table td {
|
||||
border: 1px solid #000;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,14 +1,15 @@
|
||||
<template>
|
||||
<div class="default-main" :style="{ padding: prop.height ? '0px !important' : '10px' }">
|
||||
<!-- 实时数据 -->
|
||||
<!-- 实时数据 走驾驶舱-->
|
||||
<!-- 添加加载事件监听 -->
|
||||
<div class="dataBox" :style="{ height: prop.height || pageHeight.height }" >
|
||||
<div class="dataBox" :style="{ height: prop.height ? prop.height : pageHeight.height }">
|
||||
<div
|
||||
class="iframe-container"
|
||||
:style="{
|
||||
boxShadow: `var(--el-box-shadow-light)`
|
||||
}"
|
||||
style="position: relative;"
|
||||
style="position: relative"
|
||||
>
|
||||
<iframe
|
||||
:src="iframeSrc"
|
||||
@@ -19,17 +20,20 @@
|
||||
id="iframeLeft"
|
||||
@load="onIframeLoad"
|
||||
></iframe>
|
||||
<IframeDia
|
||||
style="position: absolute; top: 0px; right: 0px; left: 0px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-card class="bottom-container " style="min-height: 230px;">
|
||||
<div class="buttonBox">
|
||||
<el-button type="primary" icon="el-icon-Aim">复位</el-button>
|
||||
</div>
|
||||
<el-card class="bottom-container" style="min-height: 230px">
|
||||
<!-- <div class="buttonBox">
|
||||
<el-button type="primary" icon="el-icon-Aim" @click="reset">复位</el-button>
|
||||
</div> -->
|
||||
<div class="tableBox">
|
||||
<Table ref="tableRef" height="100%"></Table>
|
||||
<!-- <Table ref="tableRef" height="100%"></Table> -->
|
||||
<vxe-table border auto-resize height="100%" :data="tableData" ref="tableRef">
|
||||
<vxe-column type="seq" title="序号" align="center" width="80px"></vxe-column>
|
||||
<vxe-column field="date" align="center" title="时间" width="200px"></vxe-column>
|
||||
<vxe-column field="name" align="center" title="监测点名" width="200px"></vxe-column>
|
||||
<vxe-column field="address" align="center" title="事件描述"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -40,7 +44,6 @@ import { ref, watch, onMounted, onUnmounted, provide } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import IframeDia from './iframeDia.vue'
|
||||
// import { getActive } from "@/api/manage_wx/index";
|
||||
|
||||
// const props = defineProps<{
|
||||
@@ -48,82 +51,48 @@ import IframeDia from './iframeDia.vue'
|
||||
// }>()
|
||||
|
||||
const prop = defineProps({
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
timeKey: { type: String },
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: Array as () => string[] },
|
||||
timeValue: { type: Object }
|
||||
})
|
||||
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/user-boot/role/selectRoleDetail?id=0',
|
||||
method: 'POST',
|
||||
const tableData = ref()
|
||||
|
||||
showPage: false,
|
||||
exportName: '主要监测点列表',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
field: 'whetherToGovern',
|
||||
minWidth: '70'
|
||||
},
|
||||
{
|
||||
title: '监测点名',
|
||||
field: 'name',
|
||||
minWidth: '90'
|
||||
// 在父页面中添加事件监听器
|
||||
window.addEventListener('message', function (event) {
|
||||
const { action, data } = event.data
|
||||
|
||||
// render: 'customTemplate',
|
||||
// customTemplate: (row: any) => {
|
||||
// return `<span style='cursor: pointer;text-decoration: underline;'>${row.name}</span>`
|
||||
// }
|
||||
},
|
||||
|
||||
{ title: '事件描述', field: 'question', minWidth: '200' }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
// tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
|
||||
// tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = [
|
||||
{
|
||||
name: '10kV1#电动机',
|
||||
type: '电动机',
|
||||
whetherToGovern: '2025-01-01 15:00:00',
|
||||
question: '3次谐波电压、5次谐波电流、电压不平衡度超标'
|
||||
},
|
||||
{
|
||||
name: '10kV2#(治理后)',
|
||||
type: '电焊机',
|
||||
whetherToGovern: '2025-05-01 16:00:00',
|
||||
question: '所有指标均合格'
|
||||
},
|
||||
{
|
||||
name: '380V电焊机(治理前)',
|
||||
type: '电焊机',
|
||||
whetherToGovern: '2025-06-01 15:00:00',
|
||||
question: '5次谐波电流、电压不平衡度超标'
|
||||
},
|
||||
{
|
||||
name: '380V水泵机',
|
||||
type: '电动机',
|
||||
whetherToGovern: '2025-08-01 15:00:00',
|
||||
question: '所有指标均合格'
|
||||
}
|
||||
]
|
||||
if (action == 'securityDetailData') {
|
||||
// 处理接收到的 tableArray 数据
|
||||
tableData.value = data
|
||||
}
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
provide('tableRef', tableRef)
|
||||
|
||||
const pageHeight = mainHeight(40)
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
const reset = () => {
|
||||
// 向 iframe 发送复位事件
|
||||
sendResetToIframe()
|
||||
// 清空表格数据
|
||||
// tableData.value = [];
|
||||
}
|
||||
|
||||
// 向 iframe 发送复位消息的函数
|
||||
const sendResetToIframe = () => {
|
||||
const iframe = document.getElementById('iframeLeft') as HTMLIFrameElement
|
||||
if (iframe && iframe.contentWindow) {
|
||||
iframe.contentWindow.postMessage(
|
||||
{
|
||||
type: 'RESET_EVENT',
|
||||
payload: true
|
||||
},
|
||||
'*' // 生产环境中应替换为具体的域名
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const iframeSrc = ref('')
|
||||
|
||||
@@ -150,10 +119,9 @@ const iframeSrc = ref('')
|
||||
|
||||
onMounted(() => {
|
||||
iframeSrc.value =
|
||||
'http://192.168.1.179:4001' +
|
||||
`/zutai/?id=4b4f7f4260198776594f5f9d93a532e8&&name=stt&&preview=true#/preview_YPT`
|
||||
window.location.origin + `/zutai/?id=4b4f7f4260198776594f5f9d93a532e8&&name=stt&&preview=true#/preview_YPT`
|
||||
|
||||
tableStore.index()
|
||||
// tableStore.index()
|
||||
|
||||
// 监听来自 eventStatistics 组件的消息
|
||||
window.addEventListener('message', handleMessage)
|
||||
@@ -226,16 +194,19 @@ const sendKeysToIframe = (keyList: string[]) => {
|
||||
.iframe-container {
|
||||
flex: 3.5;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
display: flex;
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
|
||||
.buttonBox {
|
||||
display: flex;
|
||||
width: 150px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tableBox {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
|
||||
@@ -337,7 +337,7 @@ function dragEnd(row: any) {
|
||||
name: row.name,
|
||||
path: row.path,
|
||||
icon: row.icon,
|
||||
timeKey: row.timeKey
|
||||
timeKeys: row.timeKeys
|
||||
})
|
||||
gridLayout.value.dragEvent('dragend', dragItem.i, dragItem.x, dragItem.y, dragItem.h, dragItem.w)
|
||||
const item = gridLayout.value.getItem(dropId)
|
||||
@@ -358,11 +358,11 @@ const onSubmit = () => {
|
||||
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
let url = ''
|
||||
await html2canvas(document.querySelector('.GridLayout'), {
|
||||
useCORS: true
|
||||
}).then(canvas => {
|
||||
url = canvas.toDataURL('image/png')
|
||||
})
|
||||
// await html2canvas(document.querySelector('.GridLayout'), {
|
||||
// useCORS: true
|
||||
// }).then(canvas => {
|
||||
// url = canvas.toDataURL('image/png')
|
||||
// })
|
||||
form.pagePath = form.pagePath || ''
|
||||
|
||||
if (valid) {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
:timeValue="datePickerRef.timeValue"
|
||||
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||
:width="rowWidth * item.w - 30 + 'px'"
|
||||
:timeKey="item.timeKey"
|
||||
:timeKey="item.timeKeys"
|
||||
/>
|
||||
<div v-else class="pd10">组件加载失败...</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
<template>
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" width="1000px" :title="title"
|
||||
@close="cancel">
|
||||
<el-dialog
|
||||
draggable
|
||||
class="cn-operate-dialog"
|
||||
v-model="dialogVisible"
|
||||
width="1000px"
|
||||
:title="title"
|
||||
@close="cancel"
|
||||
>
|
||||
<div style="display: flex">
|
||||
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef" style="flex: 1">
|
||||
<el-form-item class="top" label="组件名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入组件名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="top" label="父组件节点" prop="system">
|
||||
<el-cascader v-model="form.system" :options="customDeptOption" :props="props" placeholder="请选择父组件节点"
|
||||
style="width: 100%" />
|
||||
<el-cascader
|
||||
v-model="form.system"
|
||||
:options="customDeptOption"
|
||||
:props="props"
|
||||
placeholder="请选择父组件节点"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="组件图标" prop="icon">
|
||||
<IconSelector v-model="form.icon" placeholder="请选择图标" />
|
||||
@@ -19,14 +30,21 @@
|
||||
<el-form-item class="top" label="组件路径" prop="path">
|
||||
<el-input v-model="form.path" placeholder="请输入组件路径"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="top" label="组件查询时间">
|
||||
<el-radio-group v-model="form.timeKey" style="width: 100%">
|
||||
<el-form-item class="top" label="组件查询时间" prop="timeKeys">
|
||||
<!-- <el-radio-group v-model="form.timeKeys" style="width: 100%">
|
||||
<el-radio-button label="年" value="1" />
|
||||
<el-radio-button label="季" value="2" />
|
||||
<el-radio-button label="月" value="3" />
|
||||
<el-radio-button label="周" value="4" />
|
||||
<el-radio-button label="日" value="5" />
|
||||
</el-radio-group>
|
||||
</el-radio-group> -->
|
||||
<el-checkbox-group v-model="form.timeKeys">
|
||||
<el-checkbox-button value="1">年</el-checkbox-button>
|
||||
<el-checkbox-button value="2">季</el-checkbox-button>
|
||||
<el-checkbox-button value="3">月</el-checkbox-button>
|
||||
<el-checkbox-button value="4">周</el-checkbox-button>
|
||||
<el-checkbox-button value="5">日</el-checkbox-button>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item class="top" label="组件排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入组件排序"></el-input>
|
||||
@@ -34,9 +52,17 @@
|
||||
</el-form>
|
||||
<div style="width: 600px; height: 390px; overflow: hidden">
|
||||
<div class="ml10" style="font-weight: 600">组件展示</div>
|
||||
<component :is="registerComponent(form.path)" v-if="registerComponent(form.path)"
|
||||
class="pd10 GridLayout" :key="form.path" :height="'350px'" :width="'580px'"
|
||||
:timeKey="form.timeKey" :w="12" :h="6"/>
|
||||
<component
|
||||
:is="registerComponent(form.path)"
|
||||
v-if="registerComponent(form.path)"
|
||||
class="pd10 GridLayout"
|
||||
:key="form.path"
|
||||
:height="'350px'"
|
||||
:width="'580px'"
|
||||
:timeKey="form.timeKeys"
|
||||
:w="12"
|
||||
:h="6"
|
||||
/>
|
||||
<!-- <div class="pd10">组件加载失败...</div> -->
|
||||
<el-empty v-else description="未查询到组件" style="height: 350px; width: 533px" />
|
||||
</div>
|
||||
@@ -54,22 +80,20 @@ import { ref, inject, onMounted, type Component, defineAsyncComponent, h, markRa
|
||||
import { reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除
|
||||
import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept'
|
||||
import IconSelector from '@/components/baInput/components/iconSelector.vue'
|
||||
import html2canvas from 'html2canvas'
|
||||
|
||||
const emit = defineEmits(['cancel', 'submit'])
|
||||
const dictData = useDictData()
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const formRef = ref()
|
||||
// 注意不要和表单ref的命名冲突
|
||||
const form = ref<anyObj>({
|
||||
name: '',
|
||||
sort: 100,
|
||||
system: [],
|
||||
timeKey: '3',
|
||||
timeKeys: ['1', '2', '3', '4', '5'],
|
||||
code: '',
|
||||
path: ''
|
||||
})
|
||||
@@ -80,7 +104,8 @@ const rules = {
|
||||
system: [{ required: true, message: '请先择父组件节点', trigger: 'change' }],
|
||||
icon: [{ required: true, message: '请先择组件图标', trigger: 'change' }],
|
||||
path: [{ required: true, message: '请输入组件路径', trigger: 'blur' }],
|
||||
sort: [{ required: true, message: '请输入排序', trigger: 'blur' }]
|
||||
sort: [{ required: true, message: '请输入排序', trigger: 'blur' }],
|
||||
timeKeys: [{ required: true, message: '请选择组件查询时间', trigger: 'change' }]
|
||||
}
|
||||
const customDeptOption: any = ref([])
|
||||
onMounted(() => {
|
||||
@@ -100,6 +125,8 @@ const open = (text: string, data?: anyObj) => {
|
||||
let Data = JSON.parse(JSON.stringify(data))
|
||||
form.value = Data
|
||||
form.value.system = [Data.systemType, Data.pid]
|
||||
// form.value.timeKeys = Data.timeKeys.split(',').map(Number)
|
||||
form.value.timeKeys = Data.timeKeys || []
|
||||
}
|
||||
}
|
||||
const submit = () => {
|
||||
@@ -107,7 +134,6 @@ const submit = () => {
|
||||
if (valid) {
|
||||
let url = ''
|
||||
|
||||
|
||||
await html2canvas(document.querySelector('.GridLayout'), {
|
||||
scale: 2
|
||||
}).then(canvas => {
|
||||
@@ -119,8 +145,10 @@ const submit = () => {
|
||||
systemType: form.value.system[0],
|
||||
pid: form.value.system[1],
|
||||
image: url
|
||||
|
||||
}).then(res => {
|
||||
ElMessage.success('新增成功!')
|
||||
emit('submit')
|
||||
cancel()
|
||||
})
|
||||
} else {
|
||||
@@ -131,6 +159,7 @@ const submit = () => {
|
||||
image: url
|
||||
}).then(res => {
|
||||
ElMessage.success('修改成功!')
|
||||
emit('submit')
|
||||
cancel()
|
||||
})
|
||||
}
|
||||
@@ -176,7 +205,7 @@ const registerComponent = (path: string): Component | string | null => {
|
||||
}
|
||||
}
|
||||
const cancel = () => {
|
||||
tableStore.index()
|
||||
emit('cancel')
|
||||
dialogVisible.value = false
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
143
src/views/setting/dictionary/component/addTree.vue
Normal file
143
src/views/setting/dictionary/component/addTree.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" width="500px" :title="title" @close="cancel">
|
||||
<div style="display: flex">
|
||||
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef" style="flex: 1">
|
||||
<el-form-item class="top" label="上级树">
|
||||
<el-cascader
|
||||
v-model="form.system"
|
||||
:options="customDeptOption"
|
||||
:props="props"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择上级树"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item class="top" label="树名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入组件名称"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="top" label="树排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入组件排序"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, inject, onMounted, type Component, defineAsyncComponent, h, markRaw } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept'
|
||||
|
||||
import { componentTree } from '@/api/user-boot/user'
|
||||
import { pid } from 'process'
|
||||
const dictData = useDictData()
|
||||
const emit = defineEmits(['cancel', 'submit'])
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const formRef = ref()
|
||||
// 注意不要和表单ref的命名冲突
|
||||
const form = ref<anyObj>({
|
||||
name: '',
|
||||
sort: 100,
|
||||
system: [],
|
||||
timeKey: '3',
|
||||
code: 'base',
|
||||
|
||||
})
|
||||
const props = { label: 'name', value: 'id', checkStrictly: true }
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输输入树名称', trigger: 'blur' }],
|
||||
system: [{ required: true, message: '请先择父组件节点', trigger: 'change' }],
|
||||
|
||||
sort: [{ required: true, message: '请输入排序', trigger: 'blur' }]
|
||||
}
|
||||
const customDeptOption: any = ref([])
|
||||
onMounted(() => {})
|
||||
|
||||
const open = (text: string, data?: anyObj) => {
|
||||
getFather()
|
||||
title.value = text
|
||||
dialogVisible.value = true
|
||||
if (data) {
|
||||
let Data = JSON.parse(JSON.stringify(data))
|
||||
form.value.system = Data.systemType
|
||||
form.value.name = Data.name
|
||||
form.value.sort = Data.sort
|
||||
}
|
||||
}
|
||||
// 查询父节点
|
||||
const getFather = () => {
|
||||
componentTree().then(res => {
|
||||
customDeptOption.value = deletePathNotNull(JSON.parse(JSON.stringify(res.data)))
|
||||
})
|
||||
}
|
||||
|
||||
// 递归删除path不为null的数据
|
||||
function deletePathNotNull(data: any) {
|
||||
// 若为数组,遍历处理每个元素
|
||||
if (Array.isArray(data)) {
|
||||
const filtered = []
|
||||
for (let item of data) {
|
||||
// 递归处理子节点
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children = deletePathNotNull(item.children)
|
||||
}
|
||||
// 仅保留path为null或空字符串的节点
|
||||
if (item.path === null || item.path === '') {
|
||||
filtered.push(item)
|
||||
}
|
||||
}
|
||||
return filtered
|
||||
}
|
||||
// 若为单个对象(递归子节点时用)
|
||||
if (typeof data === 'object' && data !== null) {
|
||||
if (data.children && data.children.length > 0) {
|
||||
data.children = deletePathNotNull(data.children)
|
||||
}
|
||||
return data.path === null || data.path === '' ? data : null
|
||||
}
|
||||
return data
|
||||
}
|
||||
const submit = () => {
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (title.value == '新增树') {
|
||||
await componentAdd({
|
||||
...form.value,
|
||||
systemType: form.value.system[0],
|
||||
pid: form.value.system?.at(-1)
|
||||
}).then(res => {
|
||||
ElMessage.success('新增成功!')
|
||||
emit('submit')
|
||||
cancel()
|
||||
})
|
||||
} else {
|
||||
await componentEdit({
|
||||
...form.value,
|
||||
systemType: form.value.system[0],
|
||||
pid: form.value.system[1]
|
||||
}).then(res => {
|
||||
ElMessage.success('修改成功!')
|
||||
emit('submit')
|
||||
cancel()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
emit('cancel')
|
||||
dialogVisible.value = false
|
||||
}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
@@ -2,22 +2,29 @@
|
||||
<div class="default-main">
|
||||
<TableHeader :showSearch="false">
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" @click="add" icon="el-icon-Plus">新增</el-button>
|
||||
<el-button type="primary" @click="addTree" icon="el-icon-Plus">新增树</el-button>
|
||||
<el-button type="primary" @click="add" icon="el-icon-Plus">新增组件</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }" />
|
||||
<Add ref="addRef" v-if="addFlag" @onSubmit="tableStore.index()" />
|
||||
<Table
|
||||
ref="tableRef"
|
||||
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
|
||||
:scroll-y="{ enabled: true }"
|
||||
/>
|
||||
<Add ref="addRef" v-if="addFlag" @cancel="cancel" @submit="tableStore.index()" />
|
||||
<!-- 新增树 -->
|
||||
<Tree ref="treeRef" v-if="addFlag" @cancel="cancel" @submit="tableStore.index()" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide,nextTick } from 'vue'
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import Add from './add.vue'
|
||||
import Tree from './addTree.vue'
|
||||
import { deleteSubassembly } from '@/api/user-boot/dept'
|
||||
defineOptions({
|
||||
name: 'component'
|
||||
@@ -25,6 +32,7 @@ defineOptions({
|
||||
const addRef = ref()
|
||||
const addFlag = ref(false)
|
||||
const tableRef = ref()
|
||||
const treeRef = ref()
|
||||
const treeData: any = ref([])
|
||||
const tableStore = new TableStore({
|
||||
url: '/user-boot/component/componentTree',
|
||||
@@ -39,7 +47,7 @@ const tableStore = new TableStore({
|
||||
width: '80',
|
||||
render: 'icon'
|
||||
},
|
||||
{ field: 'code', title: '组件标识', minWidth: '100', },
|
||||
{ field: 'code', title: '组件标识', minWidth: '100' },
|
||||
{ field: 'path', title: '组件路径' },
|
||||
{ field: 'image', title: '组件展示', render: 'image' },
|
||||
{
|
||||
@@ -53,13 +61,18 @@ const tableStore = new TableStore({
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.path == '' || row.path == null
|
||||
},
|
||||
|
||||
click: row => {
|
||||
addFlag.value = true
|
||||
setTimeout(() => {
|
||||
if (row.path == '' || row.path == null) {
|
||||
// 修改树
|
||||
treeRef.value.open('修改树', row)
|
||||
} else {
|
||||
// 组件修改
|
||||
|
||||
addRef.value.open('修改组件', row)
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
@@ -69,9 +82,7 @@ const tableStore = new TableStore({
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
disabled: row => {
|
||||
return row.path == '' || row.path == null
|
||||
},
|
||||
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
@@ -79,6 +90,7 @@ const tableStore = new TableStore({
|
||||
title: '确定删除?'
|
||||
},
|
||||
click: row => {
|
||||
|
||||
deleteSubassembly({ id: row.id }).then(() => {
|
||||
ElMessage.success('删除成功!')
|
||||
tableStore.index()
|
||||
@@ -127,6 +139,16 @@ const add = () => {
|
||||
addRef.value.open('新增组件')
|
||||
}, 100)
|
||||
}
|
||||
// 新增数
|
||||
const addTree = () => {
|
||||
addFlag.value = true
|
||||
setTimeout(() => {
|
||||
treeRef.value.open('新增树')
|
||||
}, 100)
|
||||
}
|
||||
const cancel = () => {
|
||||
addFlag.value = false
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog class="cn-operate-dialog" v-model.trim="dialogVisible" :title="title">
|
||||
<el-dialog class="cn-operate-dialog" width="500px" v-model.trim="dialogVisible" :title="title">
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules">
|
||||
<el-form-item label="字典名称:" prop="name">
|
||||
|
||||
@@ -35,7 +35,7 @@ const departmentRef = ref()
|
||||
const show = ref(true)
|
||||
const lookShow = ref(true)
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/harmonic-boot/customReport/getTemplateList',
|
||||
url: '/cs-harmonic-boot/customReport/getTemplateList',
|
||||
method: 'POST',
|
||||
isWebPaging: true,
|
||||
column: [
|
||||
|
||||
11
types/table.d.ts
vendored
11
types/table.d.ts
vendored
@@ -8,8 +8,9 @@ declare global {
|
||||
interface CnTable {
|
||||
ref: VxeTableInstance | null
|
||||
data: TableRow[] | any
|
||||
copyData: TableRow[] | any
|
||||
allData: TableRow[] | any
|
||||
copyData: TableRow[] | any
|
||||
filename: any
|
||||
allFlag: Boolean
|
||||
// 前端分页数据
|
||||
webPagingData: TableRow[][]
|
||||
@@ -29,6 +30,7 @@ declare global {
|
||||
loadCallback: (() => void) | null
|
||||
resetCallback: (() => void) | null
|
||||
beforeSearchFun: (() => void) | null
|
||||
exportProcessingData: (() => void) | null
|
||||
height: string
|
||||
publicHeight: number
|
||||
}
|
||||
@@ -50,6 +52,7 @@ declare global {
|
||||
| 'buttons'
|
||||
| 'slot'
|
||||
| 'customTemplate'
|
||||
| 'renderFormatter'
|
||||
| 'customRender'
|
||||
// 默认值
|
||||
default?: any
|
||||
@@ -59,6 +62,7 @@ declare global {
|
||||
custom?: any
|
||||
// 值替换数据,如{open: '开'}
|
||||
replaceValue?: any
|
||||
effect?: any
|
||||
// 时间格式化
|
||||
timeFormat?: string
|
||||
// 开关控制
|
||||
@@ -80,6 +84,8 @@ declare global {
|
||||
index: number
|
||||
) => string
|
||||
children?: TableColumn[]
|
||||
property?: string
|
||||
clickable?: boolean // 是否可点击
|
||||
}
|
||||
|
||||
/* 表格右侧操作按钮 */
|
||||
@@ -90,15 +96,16 @@ declare global {
|
||||
title?: string
|
||||
text?: string
|
||||
class?: string
|
||||
loading?: string
|
||||
type: ButtonType
|
||||
icon: string
|
||||
popconfirm?: Partial<Mutable<PopconfirmProps>>
|
||||
disabledTip?: boolean
|
||||
// 自定义点击事件
|
||||
click?: (row: TableRow, field: TableColumn) => void
|
||||
|
||||
// 按钮是否禁用,请返回布尔值
|
||||
disabled?: (row: TableRow, field: TableColumn) => boolean
|
||||
showDisabled?: (row: TableRow, field: TableColumn) => boolean
|
||||
// 自定义el-button属性
|
||||
attr?: Partial<Mutable<ButtonProps>>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user