Compare commits
72 Commits
b4c49c3e58
...
main-local
| Author | SHA1 | Date | |
|---|---|---|---|
| 2765bcab10 | |||
| b55d9e2d5c | |||
| 29ab53056a | |||
| 0c32439146 | |||
| 5250db915f | |||
| 814103c881 | |||
| 55b7fba021 | |||
| da4ecc4792 | |||
| 498dc117f2 | |||
| 058879ec45 | |||
| 4d29de93a1 | |||
| 445e9dfc9f | |||
| 3a26f6312b | |||
| 138b0753af | |||
| ac1d1ae154 | |||
| 825243e741 | |||
| 0389ed85f3 | |||
| aef94f406a | |||
| 95d69fb7b1 | |||
| 684002ffc8 | |||
| 098dfa05f8 | |||
| d6c9310e50 | |||
| 085f6fd252 | |||
| 142de3102b | |||
| d3e51322ab | |||
| 9b5806a2c0 | |||
| 2b6697fa5a | |||
| 3bb859b693 | |||
| 5b3701afd0 | |||
| f531075853 | |||
| 81f8f75d7e | |||
| fccddab04a | |||
| 8cb6fbee3e | |||
| f454b02c99 | |||
| bfe72cf2c3 | |||
| fb90d81bb3 | |||
| 823c0949d0 | |||
| 1b712a70f6 | |||
| c1c411e48a | |||
| 43153a791d | |||
| 5d84972b8a | |||
| b122ab35ab | |||
| 11111d035b | |||
| 80f07876c6 | |||
| ab9bb1e85d | |||
| bef8f01d0d | |||
| b469190d9f | |||
| 4079c40e5d | |||
| e98b4ed287 | |||
| 4ebd5f0988 | |||
| a0095b4054 | |||
| 6140ca8f14 | |||
| 84bc29410a | |||
| a3d6cf7c55 | |||
| f3fda19c64 | |||
| 6fb706b528 | |||
| 579920e007 | |||
| 9a8247f833 | |||
| d9eeee106f | |||
| c4c79aaa64 | |||
| c90f4f5766 | |||
| 0966813c25 | |||
| 4a4d26f018 | |||
| 1a11c67aad | |||
| 71fd48918d | |||
| dd4fa36597 | |||
| 9b14d96e24 | |||
| 34d9e038e6 | |||
| ac54ce999e | |||
| f49efb5edd | |||
| 97f9b3ff0e | |||
| 674a0c6c33 |
@ -5,8 +5,9 @@ VUE_APP_TITLE = 上动新能源-EMS管理系统
|
||||
NODE_ENV = 'production'
|
||||
|
||||
# EMS管理系统/生产环境
|
||||
VUE_APP_BASE_API= 'http://1.15.120.242:8089'
|
||||
VUE_APP_BASE_API= 'http://127.0.0.1:8089'
|
||||
|
||||
|
||||
# EMS管理系统/生产环境 图片拼接地址
|
||||
VUE_APP_IMG_URL = 'http://1.15.120.242:8089'
|
||||
VUE_APP_IMG_URL = 'http://127.0.0.1:8089'
|
||||
|
||||
|
||||
@ -2,331 +2,383 @@ import request from '@/utils/request'
|
||||
|
||||
//获取单个站点的信息
|
||||
export function getDzjkHomeView(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/homeView?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/homeView?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//站点首页 冲放曲线
|
||||
export function getSevenChargeData({siteId,startDate,endDate}) {
|
||||
return request({
|
||||
url: `/ems/siteMap/getSevenChargeData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getSevenChargeData({siteId, startDate, endDate}) {
|
||||
return request({
|
||||
url: `/ems/siteMap/getSevenChargeData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取站点包含的设备种类 用来判断单站监控设备监控的菜单栏展示
|
||||
export function getSiteAllDeviceCategory(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteConfig/getSiteAllDeviceCategory?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteConfig/getSiteAllDeviceCategory?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//EMS
|
||||
export function getEmsDataList(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getEmsDataList?siteId=${siteId}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//获取pcs、实时运行头部的设备信息
|
||||
export function getRunningHeadInfo(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningHeadInfo?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningHeadInfo?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取pcs列表
|
||||
export function getPcsDetailInfo(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getPcsDetailInfo?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getPcsDetailInfo?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取BMS总览数据
|
||||
export function getBMSOverView(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getBMSOverView?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getBMSOverView?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取BMS电池簇总览数据
|
||||
export function getBMSBatteryCluster(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getBMSBatteryCluster?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getBMSBatteryCluster?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取单体电池 电池堆列表数据
|
||||
export function getStackNameList(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getStackNameList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getStackNameList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取单体电池 电池簇列表数据
|
||||
export function getClusterNameList({stackDeviceId,siteId}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getClusterNameList?stackDeviceId=${stackDeviceId}&siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getClusterNameList({stackDeviceId, siteId}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getClusterNameList?stackDeviceId=${stackDeviceId}&siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//单体电池表格数据
|
||||
export function getClusterDataInfoList({siteId, stackDeviceId, clusterDeviceId,batteryId, pageSize, pageNum}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getClusterDataInfoList?clusterDeviceId=${clusterDeviceId}&siteId=${siteId}&stackDeviceId=${stackDeviceId}&batteryId=${batteryId}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getClusterDataInfoList({siteId, stackDeviceId, clusterDeviceId, batteryId, pageSize, pageNum}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getClusterDataInfoList?clusterDeviceId=${clusterDeviceId}&siteId=${siteId}&stackDeviceId=${stackDeviceId}&batteryId=${batteryId}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 单体电池图表
|
||||
//http://localhost:8089/ems/siteMonitor/getSingleBatteryData?clusterDeviceId=BMSC01&siteId=021_FXX_01&deviceId=001&startDate=2025-07-11&endDate=2025-07-18
|
||||
export function getSingleBatteryData({siteId,deviceId,clusterDeviceId,startDate,endDate}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getSingleBatteryData?siteId=${siteId}&deviceId=${deviceId}&startDate=${startDate}&endDate=${endDate}&clusterDeviceId=${clusterDeviceId}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getSingleBatteryData({siteId, deviceId, clusterDeviceId, startDate, endDate}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getSingleBatteryData?siteId=${siteId}&deviceId=${deviceId}&startDate=${startDate}&endDate=${endDate}&clusterDeviceId=${clusterDeviceId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取液冷列表数据
|
||||
export function getCoolingDataList(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getCoolingDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getCoolingDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取动环数据
|
||||
export function getDhDataList(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getDhDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getDhDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取消防数据
|
||||
export function getXfDataList(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getXfDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getXfDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//获取电表数据
|
||||
export function getAmmeterDataList(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getAmmeterDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getAmmeterDataList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 故障告警
|
||||
export function getAlarmDetailList({status,siteId, deviceId, alarmLevel, alarmStartTime, alarmEndTime,pageSize,pageNum}) {
|
||||
return request({
|
||||
url: `/ems/siteAlarm/getAlarmDetailList?siteId=${siteId}&status=${status}&deviceId=${deviceId}&alarmLevel=${alarmLevel}&alarmStartTime=${alarmStartTime}&alarmEndTime=${alarmEndTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getAlarmDetailList({
|
||||
status,
|
||||
siteId,
|
||||
deviceId,
|
||||
alarmLevel,
|
||||
alarmStartTime,
|
||||
alarmEndTime,
|
||||
pageSize,
|
||||
pageNum
|
||||
}) {
|
||||
return request({
|
||||
url: `/ems/siteAlarm/getAlarmDetailList?siteId=${siteId}&status=${status}&deviceId=${deviceId}&alarmLevel=${alarmLevel}&alarmStartTime=${alarmStartTime}&alarmEndTime=${alarmEndTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 告警生成工单
|
||||
export function createTicketNo(data) {
|
||||
return request({
|
||||
url: `/ems/siteAlarm/createTicketNo`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteAlarm/createTicketNo`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 概率统计
|
||||
//获取概率统计 电量指标接口
|
||||
export function getElectricData({siteId,startDate,endDate}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getElectricData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getElectricData({siteId, startDate, endDate}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getElectricData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取pcs列表
|
||||
export function getPcsNameList(siteId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getPcsNameList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getPcsNameList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//pcs曲线
|
||||
export function getPCSData({siteId,startTime,endTime,dataType}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getPCSData?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getPCSData({siteId, startTime, endTime, dataType}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getPCSData?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//电池堆曲线
|
||||
export function getStackData({siteId,startTime,endTime,dataType}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getStackData?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getStackData({siteId, startTime, endTime, dataType}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getStackData?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//电池温度
|
||||
export function getClusterData({siteId,stackId,clusterId,dateTime,pageNum,pageSize}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getClusterData?siteId=${siteId}&stackId=${stackId}&clusterId=${clusterId}&dateTime=${dateTime}&pageNum=${pageNum}&pageSize=${pageSize}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getClusterData({siteId, stackId, clusterId, dateTime, pageNum, pageSize}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getClusterData?siteId=${siteId}&stackId=${stackId}&clusterId=${clusterId}&dateTime=${dateTime}&pageNum=${pageNum}&pageSize=${pageSize}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 实时运行
|
||||
//储能
|
||||
export function storagePower(siteId,startTime,endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/storagePower?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function storagePower(siteId, startTime, endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/storagePower?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//poc温度
|
||||
export function pcsMaxTemp(siteId,startTime,endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/pcsMaxTemp?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function pcsMaxTemp(siteId, startTime, endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/pcsMaxTemp?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 电池平均soc
|
||||
export function batteryAveSoc(siteId,startTime,endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/batteryAveSoc?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function batteryAveSoc(siteId, startTime, endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/batteryAveSoc?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 电池平均温度
|
||||
export function batteryAveTemp(siteId,startTime,endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/batteryAveTemp?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function batteryAveTemp(siteId, startTime, endTime) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/runningGraph/batteryAveTemp?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 功率曲线
|
||||
export function getPowerData({siteId,startDate,endDate}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getPowerData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get'
|
||||
})
|
||||
export function getPowerData({siteId, startDate, endDate}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getPowerData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//电表列表
|
||||
export function getLoadNameList(siteId) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getLoadNameList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 电表报表
|
||||
export function getAmmeterData({siteId,startTime,endTime, pageSize, pageNum}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getAmmeterData?siteId=${siteId}&startTime=${startTime}&endTime=${endTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/ems/statsReport/getLoadNameList?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 电表报表
|
||||
export function getAmmeterData({siteId, startTime, endTime, pageSize, pageNum}) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getAmmeterData?siteId=${siteId}&startTime=${startTime}&endTime=${endTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 电价报表
|
||||
export function getAmmeterRevenueData(data) {
|
||||
return request({
|
||||
url: `/ems/statsReport/getAmmeterRevenueData`,
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
//策略列表
|
||||
export function strategyRunningList(siteId) {
|
||||
return request({
|
||||
url: `/system/strategyRunning/list?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/system/strategyRunning/list?siteId=${siteId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//停止策略
|
||||
export function stopStrategyRunning(id) {
|
||||
return request({
|
||||
url: `/system/strategyRunning/stop?id=${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/system/strategyRunning/stop?id=${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有主策略
|
||||
export function getMainStrategyList() {
|
||||
return request({
|
||||
url: `/system/strategyRunning/getMainStrategyList`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/system/strategyRunning/getMainStrategyList`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//获取所有辅助策略
|
||||
export function getAuxStrategyList() {
|
||||
return request({
|
||||
url: `/system/strategyRunning/getAuxStrategyList`,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: `/system/strategyRunning/getAuxStrategyList`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//配置策略
|
||||
export function configStrategy(data) {
|
||||
return request({
|
||||
url: `/system/strategyRunning/configStrategy`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/system/strategyRunning/configStrategy`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//http://localhost:8089/strategy/temp/getTempNameList?strategyId=1&siteId=021_FXX_01
|
||||
//获取策略下的所有模板列表
|
||||
export function getTempNameList({siteId,strategyId}) {
|
||||
return request({
|
||||
url: `/strategy/temp/getTempNameList?siteId=${siteId}&strategyId=${strategyId}`,
|
||||
method: 'get',
|
||||
})
|
||||
export function getTempNameList({siteId, strategyId}) {
|
||||
return request({
|
||||
url: `/strategy/temp/getTempNameList?siteId=${siteId}&strategyId=${strategyId}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//获取模板详情
|
||||
///strategy/temp/list?templateId=1
|
||||
export function getStrategyTempDetail(templateId) {
|
||||
return request({
|
||||
url: `/strategy/temp/list?templateId=${templateId}`,
|
||||
method: 'get',
|
||||
})
|
||||
return request({
|
||||
url: `/strategy/temp/list?templateId=${templateId}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//新增模板
|
||||
export function addStrategyTemp(data) {
|
||||
return request({
|
||||
url: `/strategy/temp`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/strategy/temp`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function editStrategyTemp(data) {
|
||||
return request({
|
||||
url: `/strategy/temp`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/strategy/temp`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//http://localhost:8089/strategy/temp/{id}
|
||||
export function deleteStrategyTemp(id) {
|
||||
return request({
|
||||
url: `/strategy/temp/`+id,
|
||||
method: 'delete',
|
||||
})
|
||||
return request({
|
||||
url: `/strategy/temp/` + id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
//http://localhost:8089/strategy/timeConfig/list?strategyId=1&siteId=021_FXX_01
|
||||
export function timeConfigList({siteId,strategyId}) {
|
||||
return request({
|
||||
url: `/strategy/timeConfig/list?siteId=${siteId}&strategyId=${strategyId}`,
|
||||
method: 'get',
|
||||
})
|
||||
export function timeConfigList({siteId, strategyId}) {
|
||||
return request({
|
||||
url: `/strategy/timeConfig/list?siteId=${siteId}&strategyId=${strategyId}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//保存时间配置
|
||||
// http://localhost:8089/strategy/timeConfig
|
||||
export function setTimeConfigList(data) {
|
||||
return request({
|
||||
url: `/strategy/timeConfig`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: `/strategy/timeConfig`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 策略曲线图
|
||||
//http://localhost:8089/strategy/curve/curveList?strategyId=1&siteId=021_FXX_01
|
||||
export function curveList({siteId,strategyId}) {
|
||||
return request({
|
||||
url: `/strategy/curve/curveList?siteId=${siteId}&strategyId=${strategyId}`,
|
||||
method: 'get',
|
||||
})
|
||||
export function curveList({siteId, strategyId}) {
|
||||
return request({
|
||||
url: `/strategy/curve/curveList?siteId=${siteId}&strategyId=${strategyId}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
//单站监控 首页 当日功率曲线
|
||||
export function getPointData({siteId,startDate,endDate}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getPointData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get',
|
||||
})
|
||||
export function getPointData({siteId, startDate, endDate}) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getPointData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
@ -9,10 +9,11 @@ export function getSiteInfoList({siteName, startTime, endTime, pageSize, pageNum
|
||||
}
|
||||
|
||||
// 设备列表
|
||||
export function getDeviceInfoList({siteId, pageSize, pageNum}) {
|
||||
export function getDeviceInfoList(data) {
|
||||
return request({
|
||||
url: `/ems/siteConfig/getDeviceInfoList?siteId=${siteId}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||
method: 'get'
|
||||
url: `/ems/siteConfig/getDeviceInfoList`,
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
@ -58,6 +59,15 @@ export function deleteService(id) {
|
||||
})
|
||||
}
|
||||
|
||||
//pcs开、关机
|
||||
export function updateDeviceStatus(data) {
|
||||
return request({
|
||||
url: `/ems/siteConfig/updateDeviceStatus`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取上级设备id列表
|
||||
export function getParentDeviceId({siteId, deviceCategory}) {
|
||||
return request({
|
||||
|
||||
BIN
src/assets/images/ems/bigData-1.png
Normal file
BIN
src/assets/images/ems/bigData-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 MiB |
BIN
src/assets/images/ems/bigData-2.png
Normal file
BIN
src/assets/images/ems/bigData-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
BIN
src/assets/images/ems/bigData-3.png
Normal file
BIN
src/assets/images/ems/bigData-3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 MiB |
@ -9,53 +9,61 @@
|
||||
padding: 24px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
//除去顶部信息(如搜索栏、站点基本信息等)外的 白色背景内容区域
|
||||
.ems-content-container{
|
||||
.ems-content-container {
|
||||
background-color: #ffffff;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
//需要设置内padding的白色背景区域
|
||||
.ems-content-container-padding{
|
||||
.ems-content-container-padding {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
//card通用样式 标题、body
|
||||
.common-card-container{
|
||||
.el-card__header{
|
||||
padding:14px;
|
||||
border-bottom: none;
|
||||
font-size: 12px;
|
||||
background: #F1F5FB ;
|
||||
position: relative;
|
||||
.card-title{
|
||||
font-weight: 500;
|
||||
color:#333333;
|
||||
}
|
||||
.el-button--text{
|
||||
color: #666666;
|
||||
}
|
||||
.common-card-container {
|
||||
.el-card__header {
|
||||
padding: 14px;
|
||||
border-bottom: none;
|
||||
font-size: 12px;
|
||||
background: #F1F5FB;
|
||||
position: relative;
|
||||
|
||||
.card-title {
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.common-card-container-body-no-padding{
|
||||
.el-card__body{
|
||||
padding:0;
|
||||
|
||||
.el-button--text {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.common-card-container-body-no-padding {
|
||||
.el-card__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.common-card-container-no-title-bg {
|
||||
.el-card__header{
|
||||
background-color: transparent;
|
||||
}
|
||||
.el-card__header {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
//单站监控 设备监控card公共样式
|
||||
.sbjk-card-container{
|
||||
.sbjk-card-container {
|
||||
.el-card__header {
|
||||
background-color: transparent;
|
||||
padding: 5px 14px;
|
||||
color: #ffffff;
|
||||
position: relative;
|
||||
border-radius: 5px 5px 0 0;
|
||||
.large-title{
|
||||
|
||||
.large-title {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
@ -63,6 +71,7 @@
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.info {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
@ -70,15 +79,18 @@
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.el-button--text{
|
||||
|
||||
.el-button--text {
|
||||
color: #666666;
|
||||
}
|
||||
.alarm{
|
||||
|
||||
.alarm {
|
||||
position: absolute;
|
||||
right: 25px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
.alarm-icon{
|
||||
|
||||
.alarm-icon {
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
display: block;
|
||||
@ -86,23 +98,38 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//红色背景颜色标题
|
||||
&.warning-card-container{
|
||||
&.warning-card-container {
|
||||
.el-card__header {
|
||||
background-color: #fc6b69;
|
||||
background-color: #b64040; //#fc6b69;
|
||||
}
|
||||
|
||||
.work-status {
|
||||
color: #b64040 !important;;
|
||||
}
|
||||
}
|
||||
|
||||
//绿色背景颜色标题
|
||||
&.running-card-container {
|
||||
.el-card__header {
|
||||
background-color: #05aea3;
|
||||
background-color: #40b6a5; //#05aea3;
|
||||
}
|
||||
|
||||
.work-status {
|
||||
color: #40b6a5 !important;
|
||||
}
|
||||
}
|
||||
|
||||
//灰色背景颜色标题
|
||||
&.timing-card-container {
|
||||
.el-card__header {
|
||||
background-color: #666666;
|
||||
}
|
||||
|
||||
.work-status {
|
||||
color: #666666 !important;;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,11 +138,13 @@
|
||||
&.common-card-container .el-card__header {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
|
||||
.time-range-header {
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.card-title {
|
||||
line-height: 40px;
|
||||
}
|
||||
@ -124,86 +153,100 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//描述样式 PCS、BMS总览、BMS电池簇页面公共样式
|
||||
.descriptions-main{
|
||||
padding:24px;
|
||||
.descriptions-main {
|
||||
padding: 24px;
|
||||
position: relative;
|
||||
&.descriptions-main-bg-color{
|
||||
background-color:#f1f5fc ;
|
||||
.el-descriptions__body{
|
||||
background-color:#f1f5fc ;
|
||||
|
||||
&.descriptions-main-bg-color {
|
||||
background-color: #f1f5fc;
|
||||
|
||||
.el-descriptions__body {
|
||||
background-color: #f1f5fc;
|
||||
}
|
||||
}
|
||||
.el-descriptions-item__cell[colspan='1']{
|
||||
width:25%
|
||||
|
||||
.el-descriptions-item__cell[colspan='1'] {
|
||||
width: 25%
|
||||
}
|
||||
.el-descriptions__body .el-descriptions__table{
|
||||
.descriptions-direction{
|
||||
|
||||
.el-descriptions__body .el-descriptions__table {
|
||||
.descriptions-direction {
|
||||
line-height: 19px;
|
||||
color: #666666;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.descriptions-label{
|
||||
|
||||
.descriptions-label {
|
||||
line-height: 14px;
|
||||
color: #666666;
|
||||
font-size: 12px;
|
||||
}
|
||||
.danger{
|
||||
color:#FC6B69;
|
||||
|
||||
.danger {
|
||||
color: #FC6B69;
|
||||
}
|
||||
.save{
|
||||
color:#09ADA3;
|
||||
|
||||
.save {
|
||||
color: #09ADA3;
|
||||
}
|
||||
.keep{
|
||||
color:#3C81FF;
|
||||
|
||||
.keep {
|
||||
color: #3C81FF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//电表、液冷公共样式
|
||||
.device-info-row{
|
||||
.device-info-row {
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
border-left: 1px solid #eee;
|
||||
border-top: 1px solid #eee;
|
||||
.device-info-col{
|
||||
|
||||
.device-info-col {
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
font-size:12px;
|
||||
color:#666666;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
line-height: 14px;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-right: 1px solid #eee;
|
||||
.left{
|
||||
|
||||
.left {
|
||||
}
|
||||
.right{
|
||||
|
||||
.right {
|
||||
display: block;
|
||||
font-weight: 500;
|
||||
font-size:16px;
|
||||
font-size: 16px;
|
||||
line-height: 18px;
|
||||
margin-top:10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//公共表格样式
|
||||
.el-table{
|
||||
font-size:13px;
|
||||
.el-table {
|
||||
font-size: 13px;
|
||||
}
|
||||
.common-table.el-table{
|
||||
color:#333333;
|
||||
|
||||
.common-table.el-table {
|
||||
color: #333333;
|
||||
|
||||
.el-table__header-wrapper th, .el-table__fixed-header-wrapper th {
|
||||
background: #f1f5fc;
|
||||
border-bottom: none;
|
||||
|
||||
.table-head {
|
||||
color: #515a6e;
|
||||
}
|
||||
}
|
||||
.warning-status{
|
||||
color:#FC6B69;
|
||||
|
||||
.warning-status {
|
||||
color: #FC6B69;
|
||||
|
||||
&.circle::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
@ -217,25 +260,30 @@
|
||||
}
|
||||
|
||||
//二、三级菜单栏样式
|
||||
.ems-second-menu{
|
||||
width:fit-content;
|
||||
.el-menu-item{
|
||||
.ems-second-menu {
|
||||
width: fit-content;
|
||||
|
||||
.el-menu-item {
|
||||
line-height: 40px;
|
||||
height: 40px;
|
||||
padding:0;
|
||||
padding: 0;
|
||||
}
|
||||
&.el-menu--horizontal > .el-menu-item.is-active,&.el-menu--horizontal > .el-menu-item{
|
||||
border-bottom:none!important;
|
||||
|
||||
&.el-menu--horizontal > .el-menu-item.is-active, &.el-menu--horizontal > .el-menu-item {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
.el-menu-item.is-active{
|
||||
background: #0366c1!important;
|
||||
|
||||
.el-menu-item.is-active {
|
||||
background: #0366c1 !important;
|
||||
}
|
||||
}
|
||||
.ems-third-menu-container{
|
||||
|
||||
.ems-third-menu-container {
|
||||
position: relative;
|
||||
padding-left: 160px;
|
||||
background-color: #ffffff;
|
||||
.ems-third-menu{
|
||||
|
||||
.ems-third-menu {
|
||||
border-right: none;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
height: fit-content;
|
||||
@ -249,22 +297,23 @@
|
||||
width: 125px;
|
||||
text-align: center;
|
||||
}
|
||||
.el-menu-item:hover{
|
||||
background: #67b1ff!important;
|
||||
color:#ffffff!important;
|
||||
|
||||
.el-menu-item:hover {
|
||||
background: #67b1ff !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
.el-menu-item.is-active{
|
||||
background: #409eff!important;
|
||||
|
||||
.el-menu-item.is-active {
|
||||
background: #409eff !important;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//按钮栏 选中样式
|
||||
.ems-btns-group{
|
||||
.activeBtn{
|
||||
.ems-btns-group {
|
||||
.activeBtn {
|
||||
background-color: #0366c1;
|
||||
border-color: #0366c1;
|
||||
color: #ffffff;
|
||||
@ -273,11 +322,12 @@
|
||||
}
|
||||
|
||||
//搜索栏样式
|
||||
.select-container.el-form--inline .el-form-item{
|
||||
.select-container.el-form--inline .el-form-item {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
//红色背景颜色按钮
|
||||
.alarm-btn,.alarm-btn:hover, .alarm-btn:focus{
|
||||
.alarm-btn, .alarm-btn:hover, .alarm-btn:focus {
|
||||
background-color: #FC6B69;
|
||||
border-color: #FC6B69;
|
||||
}
|
||||
|
||||
137
src/components/BigDataPopup/index.vue
Normal file
137
src/components/BigDataPopup/index.vue
Normal file
@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:fullscreen="true"
|
||||
:append-to-body="true"
|
||||
:visible.sync="show"
|
||||
:show-close="false"
|
||||
top="0"
|
||||
custom-class="big-data-dialog"
|
||||
>
|
||||
<div class="swiper-container">
|
||||
<div class="swiper-icon left-icon" v-show="imgIndex > 0">
|
||||
<i class="el-icon-d-arrow-left icon" @click="toLeft"></i>
|
||||
</div>
|
||||
<div v-show="showRightIcon" class="swiper-icon right-icon">
|
||||
<i class="el-icon-d-arrow-right icon" @click="toRight"></i>
|
||||
</div>
|
||||
<div
|
||||
class="img-container"
|
||||
:style="{ transform: 'translateX(' + imgIndex * -100 + 'vw)' }"
|
||||
>
|
||||
<img
|
||||
v-for="index in maxImgNumber"
|
||||
:key="'swiperImg' + index"
|
||||
:src="require(`@/assets/images/ems/bigData-${index}.png`)"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="close-btn" @click="show = false">
|
||||
<i class="el-icon-close"></i>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.close-btn {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
font-size: 23px;
|
||||
line-height: 20px;
|
||||
color: rgba(217, 242, 255, 1);
|
||||
cursor: pointer;
|
||||
}
|
||||
.swiper-container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
.swiper-icon {
|
||||
color: rgba(217, 242, 255, 1);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 20;
|
||||
cursor: pointer;
|
||||
font-size: 30px;
|
||||
padding: 20px;
|
||||
background: transparent;
|
||||
&.left-icon {
|
||||
left: 20px;
|
||||
}
|
||||
&.right-icon {
|
||||
right: 20px;
|
||||
}
|
||||
&:hover {
|
||||
.icon {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.icon {
|
||||
transition: all 0.6s;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.img-container {
|
||||
height: 100%;
|
||||
transition: all 1s;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
z-index: 0;
|
||||
img {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: block;
|
||||
margin: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.big-data-dialog {
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
imgIndex: 0,
|
||||
maxImgNumber: 3,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
showRightIcon() {
|
||||
return this.imgIndex < this.maxImgNumber - 1;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
handler(newValue) {
|
||||
if (!newValue) this.imgIndex = 0;
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toLeft() {
|
||||
if (this.imgIndex === 0) return;
|
||||
this.imgIndex -= 1;
|
||||
},
|
||||
toRight() {
|
||||
if (this.imgIndex >= this.maxImgNumber - 1) return;
|
||||
this.imgIndex += 1;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -1,36 +1,68 @@
|
||||
<template>
|
||||
<div class="time-range">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
:clearable="false"
|
||||
:picker-options="pickerOptions"
|
||||
end-placeholder="结束时间">
|
||||
</el-date-picker>
|
||||
<el-button size="mini" style="margin-left: 10px;" :loading="loading" @click="reset">重置</el-button>
|
||||
<el-button type="primary" size="mini" :loading="loading" @click="search">搜索</el-button>
|
||||
<el-button type="primary" size="mini" :loading="loading" @click="timeLine('before')">上一时段</el-button>
|
||||
<el-button type="primary" size="mini" :loading="loading" @click="timeLine('next')" :disabled="disabledNextBtn">下一时段</el-button>
|
||||
</div>
|
||||
<div class="time-range">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
:class="miniTimePicker ? 'mini-date-picker' : ''"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
value-format="yyyy-MM-dd"
|
||||
:clearable="false"
|
||||
:picker-options="pickerOptions"
|
||||
end-placeholder="结束时间">
|
||||
</el-date-picker>
|
||||
<template v-if="!showIcon">
|
||||
<el-button size="mini" style="margin-left: 10px;" :loading="loading" @click="reset">重置</el-button>
|
||||
<el-button type="primary" size="mini" :loading="loading" @click="search">搜索</el-button>
|
||||
<el-button type="primary" size="mini" :loading="loading" @click="timeLine('before')">上一时段</el-button>
|
||||
<el-button type="primary" size="mini" :loading="loading" @click="timeLine('next')" :disabled="disabledNextBtn">
|
||||
下一时段
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button class="btn-icon" icon="el-icon-refresh-right" circle size="mini" style="margin-left: 8px;"
|
||||
:loading="loading"
|
||||
@click="reset"></el-button>
|
||||
<el-button class="btn-icon" type="primary" size="mini" icon="el-icon-search" circle :loading="loading"
|
||||
@click="search"></el-button>
|
||||
<el-button class="btn-icon" type="primary" size="mini" icon="el-icon-d-arrow-left" circle :loading="loading"
|
||||
@click="timeLine('before')"></el-button>
|
||||
<el-button class="btn-icon" type="primary" size="mini" icon="el-icon-d-arrow-right" circle :loading="loading"
|
||||
@click="timeLine('next')"
|
||||
:disabled="disabledNextBtn"></el-button>
|
||||
</template>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {formatDate} from '@/filters/ems'
|
||||
|
||||
export default {
|
||||
computed:{
|
||||
disabledNextBtn(){
|
||||
props: {
|
||||
showIcon: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
miniTimePicker: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
disabledNextBtn() {
|
||||
return new Date(this.dateRange[1]) >= new Date(this.defaultDateRange[1])
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
dateRange:[],
|
||||
defaultDateRange:[],
|
||||
pickerOptions:{
|
||||
loading: false,
|
||||
dateRange: [],
|
||||
defaultDateRange: [],
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
@ -38,64 +70,81 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(today=false){
|
||||
const now = new Date(),formatNow = formatDate(now);
|
||||
const weekAgo = formatDate(today ? new Date(now.getTime()) : new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000))
|
||||
this.dateRange = [weekAgo, formatNow];
|
||||
this.defaultDateRange=[weekAgo, formatNow];
|
||||
this.$emit('updateDate',this.dateRange)
|
||||
init(today = false) {
|
||||
const now = new Date(), formatNow = formatDate(now);
|
||||
const weekAgo = formatDate(today ? new Date(now.getTime()) : new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000))
|
||||
this.dateRange = [weekAgo, formatNow];
|
||||
this.defaultDateRange = [weekAgo, formatNow];
|
||||
this.$emit('updateDate', this.dateRange)
|
||||
},
|
||||
showBtnLoading(status){
|
||||
this.loading = status
|
||||
showBtnLoading(status) {
|
||||
this.loading = status
|
||||
},
|
||||
resetDate(){
|
||||
resetDate() {
|
||||
this.dateRange = this.defaultDateRange
|
||||
},
|
||||
//重置 设置时间范围为初始化时间段
|
||||
reset(){
|
||||
this.resetDate()
|
||||
this.$emit('reset')
|
||||
this.$emit('updateDate',this.dateRange)
|
||||
reset() {
|
||||
this.resetDate()
|
||||
this.$emit('reset')
|
||||
this.$emit('updateDate', this.dateRange)
|
||||
},
|
||||
// 搜索
|
||||
search(){
|
||||
this.$emit('updateDate',this.dateRange)
|
||||
search() {
|
||||
this.$emit('updateDate', this.dateRange)
|
||||
},
|
||||
timeLine(type){
|
||||
if(!this.dateRange || !this.dateRange[0] || !this.dateRange[1]) return
|
||||
const nowStartTimes = new Date(this.dateRange[0]).getTime(),nowEndTimes = new Date(this.dateRange[1]).getTime(),maxTime = new Date(this.defaultDateRange[1]).getTime()
|
||||
timeLine(type) {
|
||||
if (!this.dateRange || !this.dateRange[0] || !this.dateRange[1]) return
|
||||
const nowStartTimes = new Date(this.dateRange[0]).getTime(), nowEndTimes = new Date(this.dateRange[1]).getTime(),
|
||||
maxTime = new Date(this.defaultDateRange[1]).getTime()
|
||||
const nowDis = nowEndTimes - nowStartTimes//用户当前选择时间差 可能=0
|
||||
//baseTime,maxTime 毫秒数
|
||||
const baseDis = 24 * 60 * 60 * 1000
|
||||
const baseDis = 24 * 60 * 60 * 1000
|
||||
const calcDis = nowDis === 0 ? baseDis : nowDis
|
||||
let start = type === 'before' ? nowStartTimes - calcDis : nowStartTimes + calcDis
|
||||
if(start>maxTime) start=maxTime
|
||||
if (start > maxTime) start = maxTime
|
||||
let end = type === 'before' ? nowEndTimes - calcDis : nowEndTimes + calcDis
|
||||
if(end>maxTime) end=maxTime
|
||||
this.dateRange = [formatDate(start),formatDate(end)]
|
||||
this.$emit('updateDate',this.dateRange)
|
||||
if (end > maxTime) end = maxTime
|
||||
this.dateRange = [formatDate(start), formatDate(end)]
|
||||
this.$emit('updateDate', this.dateRange)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.time-range{
|
||||
display: flex;
|
||||
::v-deep {
|
||||
.el-range-editor--medium .el-range__icon, .el-range-editor--medium .el-range__close-icon{
|
||||
line-height: 22px;
|
||||
}
|
||||
.el-range-editor--medium.el-input__inner{
|
||||
height: 30px;
|
||||
}
|
||||
.el-range-editor--medium .el-range-separator{
|
||||
line-height: 24px;
|
||||
}
|
||||
.el-button--mini{
|
||||
padding:3px 10px;
|
||||
}
|
||||
.time-range {
|
||||
display: flex;
|
||||
|
||||
::v-deep {
|
||||
|
||||
.el-range-editor--medium .el-range__icon, .el-range-editor--medium .el-range__close-icon {
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.el-range-editor--medium.el-input__inner {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.el-range-editor--medium .el-range-separator {
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.el-button--mini {
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
// 展示icon的小组件
|
||||
.btn-icon.el-button--mini {
|
||||
padding: 3px 8px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
//小宽度时间选择框
|
||||
.mini-date-picker {
|
||||
width: 250px !important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -32,13 +32,13 @@ export default {
|
||||
attr:'installCapacity'
|
||||
|
||||
},{
|
||||
title:'总充电量(MWh)',
|
||||
title:'总充电量(KWh)',
|
||||
num:'',
|
||||
color:'#A696FF',
|
||||
attr:'totalChargedCap'
|
||||
|
||||
},{
|
||||
title:'总放电量(MWh)',
|
||||
title:'总放电量(KWh)',
|
||||
num:'',
|
||||
color:'#A696FF',
|
||||
attr:'totalDischargedCap'
|
||||
|
||||
@ -1,19 +1,24 @@
|
||||
<template>
|
||||
<div class="navbar">
|
||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
||||
@toggleClick="toggleSideBar"/>
|
||||
|
||||
<breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
|
||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
|
||||
<breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container"/>
|
||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>
|
||||
|
||||
<div class="right-menu">
|
||||
<template v-if="device!=='mobile'">
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
<div class="big-data-container">
|
||||
<i class="el-icon-s-marketing big-data-icon" @click.stop="showBigDataImg"></i>
|
||||
</div>
|
||||
|
||||
<search id="header-search" class="right-menu-item"/>
|
||||
|
||||
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect"/>
|
||||
|
||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||
<size-select id="size-select" class="right-menu-item hover-effect"/>
|
||||
</el-tooltip>
|
||||
|
||||
</template>
|
||||
@ -32,22 +37,23 @@
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
<div class="right-menu-item hover-effect setting" @click="setLayout" v-if="setting">
|
||||
<svg-icon icon-class="more-up" />
|
||||
<svg-icon icon-class="more-up"/>
|
||||
</div>
|
||||
</div>
|
||||
<BigDataPopup ref="bigDataPopup"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import {mapGetters} from 'vuex'
|
||||
import Breadcrumb from '@/components/Breadcrumb'
|
||||
import TopNav from '@/components/TopNav'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
import Screenfull from '@/components/Screenfull'
|
||||
import SizeSelect from '@/components/SizeSelect'
|
||||
import Search from '@/components/HeaderSearch'
|
||||
import BigDataPopup from '@/components/BigDataPopup'
|
||||
|
||||
export default {
|
||||
emits: ['setLayout'],
|
||||
@ -57,7 +63,8 @@ export default {
|
||||
Hamburger,
|
||||
Screenfull,
|
||||
SizeSelect,
|
||||
Search
|
||||
Search,
|
||||
BigDataPopup
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
@ -78,6 +85,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showBigDataImg() {
|
||||
this.$refs.bigDataPopup.show = true
|
||||
},
|
||||
toggleSideBar() {
|
||||
this.$store.dispatch('app/toggleSideBar')
|
||||
},
|
||||
@ -93,7 +103,8 @@ export default {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
location.href = '/index'
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -105,7 +116,7 @@ export default {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
||||
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
|
||||
|
||||
.hamburger-container {
|
||||
line-height: 46px;
|
||||
@ -113,7 +124,7 @@ export default {
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
transition: background .3s;
|
||||
-webkit-tap-highlight-color:transparent;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, .025)
|
||||
@ -139,6 +150,17 @@ export default {
|
||||
height: 100%;
|
||||
line-height: 50px;
|
||||
|
||||
.big-data-container {
|
||||
display: inline-block;
|
||||
padding: 0 8px;
|
||||
height: 100%;
|
||||
font-size: 24px;
|
||||
color: #5a5e66;
|
||||
vertical-align: text-bottom;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
@ -177,7 +199,7 @@ export default {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-nickname{
|
||||
.user-nickname {
|
||||
position: relative;
|
||||
bottom: 10px;
|
||||
font-size: 14px;
|
||||
|
||||
@ -2,168 +2,265 @@ import Layout from "@/layout/index.vue";
|
||||
|
||||
//单站监控
|
||||
// todo 本地设置了 hidden:true,不会显示在侧边栏,需要在系统管理、菜单管理中手动添加菜单后才会展示在侧边栏
|
||||
export const dzjk=[
|
||||
{
|
||||
path: '/dzjk',
|
||||
component: Layout,
|
||||
redirect: '/dzjk/home',
|
||||
meta: { title: '单站监控', icon: 'server',},
|
||||
alwaysShow: false,
|
||||
name:'Dzjk',
|
||||
children: [
|
||||
{
|
||||
path: '/dzjk/home',
|
||||
component: () => import('@/views/ems/dzjk/home/index.vue'),
|
||||
name: 'DzjkHome',
|
||||
meta: { title: '站点首页',breadcrumb: false,activeMenu: '/dzjk/home',activeSecondMenuName:'DzjkHome' }
|
||||
},
|
||||
{
|
||||
path: '/dzjk/zxlt',
|
||||
component: () => import('@/views/ems/dzjk/zxlt/index.vue'),
|
||||
name: 'DzjkZxlt',
|
||||
meta: { title: '主线路图',breadcrumb: false,activeMenu: '/dzjk/zxlt',activeSecondMenuName:'DzjkZxlt' }
|
||||
},
|
||||
{
|
||||
path: '/dzjk/sbjk',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/index.vue'),
|
||||
name: 'DzjkSbjk',
|
||||
alwaysShow: false,
|
||||
meta: { title: '设备监控',breadcrumb: false,activeMenu: '/dzjk/sbjk'},
|
||||
hidden: false,
|
||||
redirect: '/dzjk/sbjk/ssyx',
|
||||
children: [
|
||||
{
|
||||
path: 'ssyx',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/ssyx/index.vue'),
|
||||
name: 'DzjkSbjkSsyx',
|
||||
hidden: true,
|
||||
meta: { title: '实时运行',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'SSYX'},
|
||||
},
|
||||
{
|
||||
path: 'pcs',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/pcs/index.vue'),
|
||||
name: 'DzjkSbjkPcs',
|
||||
hidden: true,
|
||||
meta: { title: 'PCS',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'PCS'},
|
||||
},
|
||||
{
|
||||
path: 'bmszl',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/bmszl/index.vue'),
|
||||
name: 'DzjkSbjkBmszl',
|
||||
hidden: true,
|
||||
meta: { title: 'BMS总览',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk', deviceCategory:'STACK'},
|
||||
},
|
||||
{
|
||||
path: 'bmsdcc',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/bmsdcc/index.vue'),
|
||||
name: 'DzjkSbjkBmsdcc',
|
||||
hidden: true,
|
||||
meta: { title: 'BMS电池簇',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'CLUSTER'},
|
||||
},
|
||||
{
|
||||
path: 'dtdc',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/dtdc/index.vue'),
|
||||
name: 'DzjkSbjkDtdc',
|
||||
hidden: true,
|
||||
meta: { title: '单体电池',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'BATTERY'},
|
||||
},
|
||||
{
|
||||
path: 'db',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/db/index.vue'),
|
||||
name: 'DzjkSbjkDb',
|
||||
hidden: true,
|
||||
meta: { title: '电表',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'AMMETER'},
|
||||
},
|
||||
{
|
||||
path: 'yl',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/yl/index.vue'),
|
||||
name: 'DzjkSbjkYl',
|
||||
hidden: true,
|
||||
meta: { title: '液冷',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'COOLING'},
|
||||
},
|
||||
{
|
||||
path: 'dh',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/dh/index.vue'),
|
||||
name: 'DzjkSbjkDh',
|
||||
hidden: true,
|
||||
meta: { title: '动环',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'DH'},
|
||||
},
|
||||
{
|
||||
path: 'xf',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/xf/index.vue'),
|
||||
name: 'DzjkSbjkXf',
|
||||
hidden: true,
|
||||
meta: { title: '消防',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkSbjk',deviceCategory:'XF'},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/dzjk/gzgj',
|
||||
component: () => import('@/views/ems/dzjk/gzgj/index.vue'),
|
||||
name: 'DzjkGzgj',
|
||||
meta: { title: '故障告警',breadcrumb: false,activeMenu: '/dzjk/gzgj',activeSecondMenuName:'DzjkGzgj' }
|
||||
},
|
||||
{
|
||||
path: '/dzjk/tjbb',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/index.vue'),
|
||||
name: 'DzjkTjbb',
|
||||
alwaysShow: false,
|
||||
meta: {title: '统计报表', breadcrumb: false, activeMenu: '/dzjk/tjbb'},
|
||||
hidden: false,
|
||||
redirect: '/dzjk/tjbb/gltj',
|
||||
children: [
|
||||
{
|
||||
path: 'gltj',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/gltj/index.vue'),
|
||||
name: 'DzjkTjbbGltj',
|
||||
hidden: true,
|
||||
meta: { title: '概率统计',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||
},
|
||||
{
|
||||
path: 'glqx',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/glqx/index.vue'),
|
||||
name: 'DzjkTjbbGlqx',
|
||||
hidden: true,
|
||||
meta: { title: '功率曲线',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||
},
|
||||
{
|
||||
path: 'pcsqx',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/pcsqx/index.vue'),
|
||||
name: 'DzjkTjbbPcsqx',
|
||||
hidden: true,
|
||||
meta: { title: 'PCS曲线',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||
},
|
||||
{
|
||||
path: 'dcdqx',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/dcdqx/index.vue'),
|
||||
name: 'DzjkTjbbDcdqx',
|
||||
hidden: true,
|
||||
meta: { title: '电池堆曲线',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||
},
|
||||
{
|
||||
path: 'dcwd',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/dcwd/index.vue'),
|
||||
name: 'DzjkTjbbDcwd',
|
||||
hidden: true,
|
||||
meta: { title: '电池温度',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||
},
|
||||
{
|
||||
path: 'dbbb',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/dbbb/index.vue'),
|
||||
name: 'DzjkTjbbDbbb',
|
||||
hidden: true,
|
||||
meta: { title: '电表报表',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/dzjk/clpz',
|
||||
component: () => import('@/views/ems/dzjk/clpz/clyx/index.vue'),
|
||||
name: 'DzjkClpz',
|
||||
meta: {title: '策略配置', breadcrumb: false, activeMenu: '/dzjk/clpz'},
|
||||
}
|
||||
export const dzjk = [
|
||||
{
|
||||
path: '/dzjk',
|
||||
component: Layout,
|
||||
redirect: '/dzjk/home',
|
||||
meta: {title: '单站监控', icon: 'server',},
|
||||
alwaysShow: false,
|
||||
name: 'Dzjk',
|
||||
children: [
|
||||
{
|
||||
path: '/dzjk/home',
|
||||
component: () => import('@/views/ems/dzjk/home/index.vue'),
|
||||
name: 'DzjkHome',
|
||||
meta: {title: '站点首页', breadcrumb: false, activeMenu: '/dzjk/home', activeSecondMenuName: 'DzjkHome'}
|
||||
},
|
||||
{
|
||||
path: '/dzjk/zxlt',
|
||||
component: () => import('@/views/ems/dzjk/zxlt/index.vue'),
|
||||
name: 'DzjkZxlt',
|
||||
meta: {title: '主线路图', breadcrumb: false, activeMenu: '/dzjk/zxlt', activeSecondMenuName: 'DzjkZxlt'}
|
||||
},
|
||||
{
|
||||
path: '/dzjk/sbjk',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/index.vue'),
|
||||
name: 'DzjkSbjk',
|
||||
alwaysShow: false,
|
||||
meta: {title: '设备监控', breadcrumb: false, activeMenu: '/dzjk/sbjk'},
|
||||
hidden: false,
|
||||
redirect: '/dzjk/sbjk/ssyx',
|
||||
children: [
|
||||
{
|
||||
path: 'ssyx',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/ssyx/index.vue'),
|
||||
name: 'DzjkSbjkSsyx',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '实时运行',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'SSYX'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'ems',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/ems/index.vue'),
|
||||
name: 'DzjkSbjkEms',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: 'EMS',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'EMS'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'pcs',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/pcs/index.vue'),
|
||||
name: 'DzjkSbjkPcs',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: 'PCS',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'PCS'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'bmszl',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/bmszl/index.vue'),
|
||||
name: 'DzjkSbjkBmszl',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: 'BMS总览',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'STACK'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'bmsdcc',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/bmsdcc/index.vue'),
|
||||
name: 'DzjkSbjkBmsdcc',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: 'BMS电池簇',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'CLUSTER'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dtdc',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/dtdc/index.vue'),
|
||||
name: 'DzjkSbjkDtdc',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '单体电池',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'BATTERY'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'db',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/db/index.vue'),
|
||||
name: 'DzjkSbjkDb',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '电表',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'AMMETER'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'yl',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/yl/index.vue'),
|
||||
name: 'DzjkSbjkYl',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '液冷',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/sbjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'COOLING'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dh',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/dh/index.vue'),
|
||||
name: 'DzjkSbjkDh',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '动环',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'DH'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'xf',
|
||||
component: () => import('@/views/ems/dzjk/sbjk/xf/index.vue'),
|
||||
name: 'DzjkSbjkXf',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '消防',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk',
|
||||
activeSecondMenuName: 'DzjkSbjk',
|
||||
deviceCategory: 'XF'
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/dzjk/gzgj',
|
||||
component: () => import('@/views/ems/dzjk/gzgj/index.vue'),
|
||||
name: 'DzjkGzgj',
|
||||
meta: {title: '故障告警', breadcrumb: false, activeMenu: '/dzjk/gzgj', activeSecondMenuName: 'DzjkGzgj'}
|
||||
},
|
||||
{
|
||||
path: '/dzjk/tjbb',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/index.vue'),
|
||||
name: 'DzjkTjbb',
|
||||
alwaysShow: false,
|
||||
meta: {title: '统计报表', breadcrumb: false, activeMenu: '/dzjk/tjbb'},
|
||||
hidden: false,
|
||||
redirect: '/dzjk/tjbb/gltj',
|
||||
children: [
|
||||
{
|
||||
path: 'gltj',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/gltj/index.vue'),
|
||||
name: 'DzjkTjbbGltj',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '运行统计',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/tjbb',
|
||||
activeSecondMenuName: 'DzjkTjbb'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'glqx',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/glqx/index.vue'),
|
||||
name: 'DzjkTjbbGlqx',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '功率曲线',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/tjbb',
|
||||
activeSecondMenuName: 'DzjkTjbb'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'pcsqx',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/pcsqx/index.vue'),
|
||||
name: 'DzjkTjbbPcsqx',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: 'PCS曲线',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/tjbb',
|
||||
activeSecondMenuName: 'DzjkTjbb'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dcdqx',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/dcdqx/index.vue'),
|
||||
name: 'DzjkTjbbDcdqx',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '电池堆曲线',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/tjbb',
|
||||
activeSecondMenuName: 'DzjkTjbb'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dcwd',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/dcwd/index.vue'),
|
||||
name: 'DzjkTjbbDcwd',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '电池温度',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/tjbb',
|
||||
activeSecondMenuName: 'DzjkTjbb'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dbbb',
|
||||
component: () => import('@/views/ems/dzjk/tjbb/dbbb/index.vue'),
|
||||
name: 'DzjkTjbbDbbb',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '电表报表',
|
||||
breadcrumb: false,
|
||||
activeMenu: '/dzjk/tjbb',
|
||||
activeSecondMenuName: 'DzjkTjbb'
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/dzjk/clpz',
|
||||
component: () => import('@/views/ems/dzjk/clpz/clyx/index.vue'),
|
||||
name: 'DzjkClpz',
|
||||
meta: {title: '策略配置', breadcrumb: false, activeMenu: '/dzjk/clpz'},
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
@ -1,62 +1,81 @@
|
||||
import {getAllSites} from '@/api/ems/zddt'
|
||||
import {getAlarmDetailList,getSiteAllDeviceCategory} from'@/api/ems/dzjk'
|
||||
const ems = {
|
||||
state: {
|
||||
dzjkAlarmLighting:false,//单站监控 告警统计红点标志
|
||||
zdList:[],
|
||||
zdDeviceCategoryOptions:{},//站点各个站点包含的设备种类 {021_DDS_01:["BATTERY","CLUSTER","STACK", "DH", "AMMETER", "PCS", "XF"],021_DDS_02:[]...}
|
||||
workStatusOptions:{'0':'正常','1':'异常','2':'停止'},//工作状态
|
||||
deviceStatusOptions:{'0':'离线','1':'待机','2':'运行','3':'故障','4':'停机'},//设备状态
|
||||
gridStatusOptions:{'0':'并网','1':'未并网'},//并网状态
|
||||
controlModeOptions:{'0':'远程','1':'本地'},//控制模式
|
||||
warnOptions:{0:'正常', 1:'中断', 2:'不在线',3:'异常'},//告警状态
|
||||
communicationStatusOptions:{'0':'正常','1':'通讯中断','2':'异常'},//通讯状态
|
||||
workModeOptions:{'0':'正常','1':'停止'},//工作模式
|
||||
alarmLevelOptions:{'A':'提示','B':'一般','C':'严重','D':'紧急'},//告警等级
|
||||
alarmStatusOptions:{'0':'待处理','1':'已处理','2':'处理中'},//告警状态
|
||||
deviceTypeOptions:{'TCP':'TCP','RTU':'RTU'},//设备类型
|
||||
ticketStatusOptions:{1:'待处理', 2:'处理中', 3:'已处理'},//工单处理状态
|
||||
strategyStatusOptions:{'0':'未启用', '1':'已运行', '2':'已暂停', '3':'禁用', '4':'删除'},//策略状态
|
||||
chargeStatusOptions:{'1':'充电','2':'待机'},//冲放状态
|
||||
deviceCategoryOptions:{'PCS':'PCS','STACK':'电池堆','CLUSTER':'电池簇','COOLING':'液冷','BATTERY':'单体电池','AMMETER':'电表'},//设备类别
|
||||
comparisonOperatorOptions:{'>':'>','<':'<','=':'=','>=':'>=','<=':'<='},
|
||||
relationWithPoint:{'||':'||','&&':'&&'}
|
||||
},
|
||||
mutations: {
|
||||
SET_ZD_LIST(state, list) {
|
||||
state.zdList = list || []
|
||||
},
|
||||
SET_DZJK_ALARM_LIGHTING(state, status) {
|
||||
state.dzjkAlarmLighting = status
|
||||
},
|
||||
SET_ZD_DEVICE_CATEGORY_OPTIONS(state,{siteId,data}){
|
||||
state.zdDeviceCategoryOptions = Object.assign({}, state.zdDeviceCategoryOptions, {[siteId]:data})
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
getZdList({commit,state}){
|
||||
if(state.zdList.length === 0){
|
||||
getAllSites().then(response => {
|
||||
commit('SET_ZD_LIST', response?.data || [])
|
||||
console.log('store action getZdList 获取站点数据',state.zdList)
|
||||
})
|
||||
}
|
||||
},
|
||||
//查询站点的所有待处理0的告警 存在展示红点标志
|
||||
getSiteAlarmNum({state,commit},siteId){
|
||||
getAlarmDetailList({status:0,siteId,pageSize:10,pageNum:1,deviceId:'',alarmLevel:'',alarmStartTime:'',alarmEndTime:''}).then(response=>{
|
||||
commit('SET_DZJK_ALARM_LIGHTING',!!response?.total || false)
|
||||
})
|
||||
},
|
||||
getSiteDeviceCategory({state,commit},siteId){
|
||||
getSiteAllDeviceCategory(siteId).then(response=>{
|
||||
let data = response?.data || [];
|
||||
data.unshift('SSYX');
|
||||
commit('SET_ZD_DEVICE_CATEGORY_OPTIONS',{siteId,data})
|
||||
})
|
||||
}
|
||||
import {getAlarmDetailList, getSiteAllDeviceCategory} from '@/api/ems/dzjk'
|
||||
|
||||
}
|
||||
const ems = {
|
||||
state: {
|
||||
dzjkAlarmLighting: false,//单站监控 告警统计红点标志
|
||||
zdList: [],
|
||||
zdDeviceCategoryOptions: {},//站点各个站点包含的设备种类 {021_DDS_01:["BATTERY","CLUSTER","STACK", "DH", "AMMETER", "PCS", "XF"],021_DDS_02:[]...}
|
||||
CLUSTERWorkStatusOptions: {'0': '静置', '1': '充电', '2': '放电', '3': '待机', '5': '运行', '9': "故障"},//电池簇工作状态
|
||||
PCSWorkStatusOptions: {'0': '运行', '1': '停机', '2': '故障', '3': '待机', '4': '充电', '5': '放电'},//PCS工作状态
|
||||
STACKWorkStatusOptions: {
|
||||
"0": "静置",
|
||||
"1": "充电",
|
||||
"2": "放电",
|
||||
"3": "浮充",
|
||||
'4': '待机',
|
||||
'5': '运行',
|
||||
'9': "故障"
|
||||
},//STACKBMS总览工作状态
|
||||
deviceStatusOptions: {'0': '离线', '1': '在线'},//设备状态
|
||||
gridStatusOptions: {'0': '并网', '1': '未并网'},//并网状态
|
||||
controlModeOptions: {'0': '远程', '1': '本地'},//控制模式
|
||||
warnOptions: {0: '正常', 1: '中断', 2: '不在线', 3: '异常'},//告警状态
|
||||
communicationStatusOptions: {'0': '正常', '1': '通讯中断', '2': '异常'},//通讯状态
|
||||
workModeOptions: {'0': '正常', '1': '停止'},//工作模式
|
||||
alarmLevelOptions: {'A': '提示', 'B': '一般', 'C': '严重', 'D': '紧急'},//告警等级
|
||||
alarmStatusOptions: {'0': '待处理', '1': '已处理', '2': '处理中'},//告警状态
|
||||
deviceTypeOptions: {'TCP': 'TCP', 'RTU': 'RTU'},//设备类型
|
||||
ticketStatusOptions: {1: '待处理', 2: '处理中', 3: '已处理'},//工单处理状态
|
||||
strategyStatusOptions: {'0': '未启用', '1': '已运行', '2': '已暂停', '3': '禁用', '4': '删除'},//策略状态
|
||||
chargeStatusOptions: {'1': '充电', '2': '待机', '3': '放电'},//冲放状态
|
||||
comparisonOperatorOptions: {'>': '>', '<': '<', '=': '=', '>=': '>=', '<=': '<='},
|
||||
relationWithPoint: {'||': '||', '&&': '&&'}
|
||||
},
|
||||
mutations: {
|
||||
SET_ZD_LIST(state, list) {
|
||||
state.zdList = list || []
|
||||
},
|
||||
SET_DZJK_ALARM_LIGHTING(state, status) {
|
||||
state.dzjkAlarmLighting = status
|
||||
},
|
||||
SET_ZD_DEVICE_CATEGORY_OPTIONS(state, {siteId, data}) {
|
||||
state.zdDeviceCategoryOptions = Object.assign({}, state.zdDeviceCategoryOptions, {[siteId]: data})
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
getZdList({commit, state}) {
|
||||
if (state.zdList.length === 0) {
|
||||
getAllSites().then(response => {
|
||||
commit('SET_ZD_LIST', response?.data || [])
|
||||
console.log('store action getZdList 获取站点数据', state.zdList)
|
||||
})
|
||||
}
|
||||
},
|
||||
//查询站点的所有待处理0的告警 存在展示红点标志
|
||||
getSiteAlarmNum({state, commit}, siteId) {
|
||||
getAlarmDetailList({
|
||||
status: 0,
|
||||
siteId,
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
deviceId: '',
|
||||
alarmLevel: '',
|
||||
alarmStartTime: '',
|
||||
alarmEndTime: ''
|
||||
}).then(response => {
|
||||
commit('SET_DZJK_ALARM_LIGHTING', !!response?.total || false)
|
||||
})
|
||||
},
|
||||
getSiteDeviceCategory({state, commit}, siteId) {
|
||||
getSiteAllDeviceCategory(siteId).then(response => {
|
||||
let data = response?.data || [];
|
||||
data.unshift('SSYX');
|
||||
commit('SET_ZD_DEVICE_CATEGORY_OPTIONS', {siteId, data})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export default ems
|
||||
|
||||
@ -1,119 +1,140 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增模板':`编辑模板` ">
|
||||
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="模板名称" prop="templateName">
|
||||
<el-input v-model="formData.templateName" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="soc限制" prop="sdcLimit" required>
|
||||
<el-switch :active-value="1" :inactive-value="0" v-model="formData.sdcLimit"></el-switch>
|
||||
</el-form-item>
|
||||
<!-- <template v-if="formData.sdcLimit === 1">-->
|
||||
<el-form-item label="soc下限" prop="sdcDown">
|
||||
<el-input v-model="formData.sdcDown" placeholder="请输入" clearable :style="{width: '100%'}"></el-input>
|
||||
<el-dialog :visible.sync="dialogTableVisible" class="ems-dialog add-template-dialog"
|
||||
:title="mode === 'add'?'新增模板':`编辑模板` ">
|
||||
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label="模板名称" prop="templateName">
|
||||
<el-input v-model="formData.templateName" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="soc限制" prop="sdcLimit" required>
|
||||
<el-switch :active-value="1" :inactive-value="0" v-model="formData.sdcLimit"></el-switch>
|
||||
</el-form-item>
|
||||
<!-- <template v-if="formData.sdcLimit === 1">-->
|
||||
<el-form-item label="soc下限" prop="sdcDown">
|
||||
<el-input v-model="formData.sdcDown" placeholder="请输入" clearable :style="{width: '100%'}"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="soc上限" prop="sdcUp">
|
||||
<el-input v-model="formData.sdcUp" placeholder="请输入" clearable :style="{width: '100%'}"></el-input>
|
||||
</el-form-item>
|
||||
<!-- </template>-->
|
||||
</el-form>
|
||||
<el-button type="primary" size="mini" @click="addTime">新增</el-button>
|
||||
<!-- 新增时间段表单-->
|
||||
<el-collapse-transition>
|
||||
<el-card v-show="showAddTime" shadow="always" class="common-card-container" style="margin-top:25px;">
|
||||
<el-form class="add-time-form transition-box" ref="addTimeForm" :model="formInline" :rules="formInlineRule"
|
||||
label-width="100px" style="margin-top:25px">
|
||||
<!-- <el-form-item label="开始时间" prop="startTime">-->
|
||||
<!-- <el-time-select-->
|
||||
<!-- placeholder="开始时间"-->
|
||||
<!-- v-model="formInline.startTime"-->
|
||||
<!-- :picker-options="{-->
|
||||
<!-- start: '00:00',-->
|
||||
<!-- step: '00:01',-->
|
||||
<!-- end: '23:00',-->
|
||||
<!-- }">-->
|
||||
<!-- </el-time-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="结束时间" prop="endTime">-->
|
||||
<!-- <el-time-select-->
|
||||
<!-- placeholder="结束时间"-->
|
||||
<!-- v-model="formInline.endTime"-->
|
||||
<!-- :picker-options="{-->
|
||||
<!-- start: '00:00',-->
|
||||
<!-- step: '00:01',-->
|
||||
<!-- end: '23:00',-->
|
||||
<!-- minTime: formInline.startTime-->
|
||||
<!-- }">-->
|
||||
<!-- </el-time-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="时间范围" prop="timeRange">
|
||||
<el-time-picker
|
||||
is-range
|
||||
v-model="formInline.timeRange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
placeholder="选择时间范围"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
:style="{width: '100%'}">
|
||||
</el-time-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="soc上限" prop="sdcUp">
|
||||
<el-input v-model="formData.sdcUp" placeholder="请输入" clearable :style="{width: '100%'}"></el-input>
|
||||
<el-form-item label="冲放功率" prop="chargeDischargePower">
|
||||
<el-input v-model="formInline.chargeDischargePower" placeholder="请输入"
|
||||
:style="{width: '100%'}"></el-input>
|
||||
</el-form-item>
|
||||
<!-- </template>-->
|
||||
</el-form>
|
||||
<el-button type="primary" size="mini" @click="addTime">新增</el-button>
|
||||
<!-- 新增时间段表单-->
|
||||
<el-collapse-transition>
|
||||
<el-card v-show="showAddTime" shadow="always" class="common-card-container" style="margin-top:25px;">
|
||||
<el-form class="add-time-form transition-box" ref="addTimeForm" :model="formInline" :rules="formInlineRule" label-width="100px" style="margin-top:25px">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-time-select
|
||||
placeholder="开始时间"
|
||||
v-model="formInline.startTime"
|
||||
:picker-options="{
|
||||
start: '00:00',
|
||||
step: '01:00',
|
||||
end: '23:00',
|
||||
}">
|
||||
</el-time-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-time-select
|
||||
placeholder="结束时间"
|
||||
v-model="formInline.endTime"
|
||||
:picker-options="{
|
||||
start: '00:00',
|
||||
step: '01:00',
|
||||
end: '23:00',
|
||||
minTime: formInline.startTime
|
||||
}">
|
||||
</el-time-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="冲放功率" prop="chargeDischargePower">
|
||||
<el-input v-model="formInline.chargeDischargePower" placeholder="请输入"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="充电状态" prop="chargeStatus">
|
||||
<el-select v-model="formInline.chargeStatus" placeholder="请选择">
|
||||
<el-option v-for="(value,key) in chargeStatusOptions" :key="key+'chargeStatusOptions'" :label="value" :value="key"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="saveTime">保存</el-button>
|
||||
<el-button size="mini" @click="cancelAddTime">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-collapse-transition>
|
||||
<el-table
|
||||
<el-form-item label="充电状态" prop="chargeStatus">
|
||||
<el-select v-model="formInline.chargeStatus" placeholder="请选择" :style="{width: '100%'}">
|
||||
<el-option v-for="(value,key) in chargeStatusOptions" :key="key+'chargeStatusOptions'" :label="value"
|
||||
:value="key"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="saveTime">保存</el-button>
|
||||
<el-button size="mini" @click="cancelAddTime">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-collapse-transition>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%;margin-top:25px">
|
||||
<!-- todo 如果要在span-method中使用column.property 在表格中必须定义prop="xxx"属性-->
|
||||
<el-table-column
|
||||
<el-table-column
|
||||
prop="startTime"
|
||||
label="开始时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="endTime"
|
||||
label="结束时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="chargeDischargePower"
|
||||
label="充放功率(kW)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="chargeStatus"
|
||||
label="充电状态">
|
||||
<template slot-scope="scope">
|
||||
{{chargeStatusOptions[scope.row.chargeStatus]}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<template slot-scope="scope">
|
||||
{{ chargeStatusOptions[scope.row.chargeStatus] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@click.native.prevent="deleteRow(scope.$index, tableData)"
|
||||
type="warning"
|
||||
size="mini">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<el-button type="primary" @click="saveDialog">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<el-button type="primary" @click="saveDialog">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
import {addStrategyTemp,editStrategyTemp,getStrategyTempDetail} from '@/api/ems/dzjk'
|
||||
import {addStrategyTemp, editStrategyTemp, getStrategyTempDetail} from '@/api/ems/dzjk'
|
||||
|
||||
export default {
|
||||
inject:['$home'],
|
||||
inject: ['$home'],
|
||||
data() {
|
||||
const now = new Date()
|
||||
const year = now.getFullYear(), month = now.getMonth(), day = now.getDate()
|
||||
const range = [new Date(year, month, day, 0), new Date(year, month, day, 23)]
|
||||
return {
|
||||
mode:'',
|
||||
editTempId:'',
|
||||
dialogTableVisible:false,
|
||||
mode: '',
|
||||
editTempId: '',
|
||||
dialogTableVisible: false,
|
||||
secondRange: range,
|
||||
formData: {
|
||||
templateName: '',
|
||||
sdcLimit: false,
|
||||
@ -127,44 +148,41 @@ export default {
|
||||
trigger: 'blur'
|
||||
}],
|
||||
sdcDown: [
|
||||
{required: true,message: '请输入', trigger: 'blur'},
|
||||
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入合法数字或小数' }
|
||||
{required: true, message: '请输入', trigger: 'blur'},
|
||||
{pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入合法数字或小数'}
|
||||
],
|
||||
sdcUp: [
|
||||
{required: true,message: '请输入', trigger: 'blur'},
|
||||
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入合法数字或小数' }
|
||||
{required: true, message: '请输入', trigger: 'blur'},
|
||||
{pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入合法数字或小数'}
|
||||
],
|
||||
},
|
||||
showAddTime: false,
|
||||
formInline:{
|
||||
startTime:'',endTime:'',chargeDischargePower:'',chargeStatus:''
|
||||
formInline: {
|
||||
timeRange: range,
|
||||
chargeDischargePower: '',
|
||||
chargeStatus: ''
|
||||
},
|
||||
formInlineRule:{
|
||||
startTime: [{
|
||||
formInlineRule: {
|
||||
timeRange: [{
|
||||
required: true,
|
||||
message: '请选择开始时间',
|
||||
trigger: 'change'
|
||||
}],
|
||||
endTime: [{
|
||||
required: true,
|
||||
message: '请选择结束时间',
|
||||
message: '请选择时间范围',
|
||||
trigger: 'change'
|
||||
}],
|
||||
chargeDischargePower: [{
|
||||
required: true,
|
||||
message: '请输入冲放功率',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入合法数字或小数' }
|
||||
required: true,
|
||||
message: '请输入冲放功率',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{pattern: /^-?\d*\.?\d*$/, message: '请输入合法数字或小数'}
|
||||
],
|
||||
chargeStatus:[{
|
||||
chargeStatus: [{
|
||||
required: true,
|
||||
message: '请选择充放状态',
|
||||
trigger: ['blur','change']
|
||||
}
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]
|
||||
},
|
||||
tableData:[],
|
||||
tableData: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -172,145 +190,136 @@ export default {
|
||||
chargeStatusOptions: state => state?.ems?.chargeStatusOptions || {},
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
"formInline.startTime":{
|
||||
handler(newVal){
|
||||
if(newVal && this.formInline.endTime){
|
||||
const endTime = parseInt((this.formInline.endTime).split(':')[0] || 0)
|
||||
const startTime =parseInt(newVal.split(':')[0])
|
||||
if(endTime<=startTime){
|
||||
this.formInline.endTime = `${startTime+1 <=9 ? '0'+(startTime+1) : startTime+1}:00`
|
||||
}
|
||||
}
|
||||
},
|
||||
deep:true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeSiteId(){
|
||||
this.dialogTableVisible=false
|
||||
this.mode=''
|
||||
this.editTempId=''
|
||||
this.formData={
|
||||
changeSiteId() {
|
||||
this.dialogTableVisible = false
|
||||
this.mode = ''
|
||||
this.editTempId = ''
|
||||
this.formData = {
|
||||
templateName: '',
|
||||
sdcLimit: false,
|
||||
sdcDown: '',
|
||||
sdcUp: '',
|
||||
}
|
||||
this.formInline={
|
||||
startTime:'',endTime:'',chargeDischargePower:'',chargeStatus:''
|
||||
}
|
||||
this.formInline = {
|
||||
timeRange: this.secondRange, chargeDischargePower: '', chargeStatus: ''
|
||||
}//startTime: '', endTime: '',
|
||||
this.showAddTime = false
|
||||
this.tableData=[]
|
||||
this.tableData = []
|
||||
},
|
||||
show({mode = 'add', editTempId = ''}){
|
||||
show({mode = 'add', editTempId = ''}) {
|
||||
this.$nextTick(() => {
|
||||
this.dialogTableVisible = true
|
||||
this.mode = mode
|
||||
this.editTempId=editTempId
|
||||
if(mode === 'edit' && editTempId){
|
||||
this.editTempId = editTempId
|
||||
if (mode === 'edit' && editTempId) {
|
||||
getStrategyTempDetail(this.editTempId).then(response => {
|
||||
const data=JSON.parse(JSON.stringify(response?.data || []));
|
||||
if(data.length>0){
|
||||
const {templateName,sdcLimit,sdcDown,sdcUp} =JSON.parse(JSON.stringify( data[0]));
|
||||
this.formData.templateName=templateName
|
||||
this.formData.sdcLimit=sdcLimit
|
||||
this.formData.sdcDown=sdcDown
|
||||
this.formData.sdcUp=sdcUp
|
||||
const data = JSON.parse(JSON.stringify(response?.data || []));
|
||||
if (data.length > 0) {
|
||||
const {templateName, sdcLimit, sdcDown, sdcUp} = JSON.parse(JSON.stringify(data[0]));
|
||||
this.formData.templateName = templateName
|
||||
this.formData.sdcLimit = sdcLimit
|
||||
this.formData.sdcDown = sdcDown
|
||||
this.formData.sdcUp = sdcUp
|
||||
}
|
||||
if(data.length === 1){
|
||||
const {startTime,endTime}=data;
|
||||
if(!startTime || !endTime){
|
||||
if (data.length === 1) {
|
||||
const {startTime, endTime} = data;
|
||||
if (!startTime || !endTime) {
|
||||
this.tableData = []
|
||||
}else{
|
||||
this.tableData= data
|
||||
} else {
|
||||
this.tableData = data
|
||||
}
|
||||
}else{
|
||||
this.tableData= data
|
||||
} else {
|
||||
this.tableData = data
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
addTime(){
|
||||
this.showAddTime=true
|
||||
addTime() {
|
||||
this.showAddTime = true
|
||||
},
|
||||
cancelAddTime(){
|
||||
cancelAddTime() {
|
||||
this.$refs.addTimeForm.resetFields()
|
||||
this.showAddTime=false
|
||||
this.formInline = {startTime:'',endTime:'',chargeDischargePower:'',chargeStatus:''}
|
||||
this.showAddTime = false
|
||||
this.formInline = {timeRange: this.secondRange, chargeDischargePower: '', chargeStatus: ''}//startTime: '', endTime: '',
|
||||
},
|
||||
saveTime(){
|
||||
saveTime() {
|
||||
//表单校验,校验成功,添加到tableData里
|
||||
this.$refs.addTimeForm.validate(valid => {
|
||||
if (!valid) return
|
||||
this.tableData.push(JSON.parse(JSON.stringify(this.formInline)));
|
||||
this.$nextTick(() => {this.cancelAddTime()})
|
||||
const {timeRange: [startTime, endTime], chargeDischargePower, chargeStatus} = this.formInline
|
||||
|
||||
this.tableData.push({startTime, endTime, chargeDischargePower, chargeStatus})
|
||||
this.$nextTick(() => {
|
||||
this.cancelAddTime()
|
||||
})
|
||||
})
|
||||
},
|
||||
deleteRow(index){
|
||||
this.tableData.splice(index,1)
|
||||
deleteRow(index) {
|
||||
this.tableData.splice(index, 1)
|
||||
},
|
||||
saveDialog() {
|
||||
this.$refs.addTempForm.validate(valid => {
|
||||
if (!valid) return
|
||||
//校验时间选择范围是否冲突
|
||||
let status = true
|
||||
this.tableData.forEach((outer,outerIndex)=>{
|
||||
const {startTime, endTime}=outer
|
||||
const outerStart = parseInt(startTime),outerEnd = parseInt(endTime)
|
||||
if(outerStart>outerEnd){
|
||||
status = false
|
||||
}else{
|
||||
this.tableData.forEach((inner,innerIndex)=>{
|
||||
if(innerIndex !== outerIndex){
|
||||
const {startTime:innerStartTime, endTime:innerEndTime}=inner
|
||||
const innerStart = parseInt(innerStartTime),innerEnd = parseInt(innerEndTime)
|
||||
if((innerStart<outerStart && innerEnd>outerEnd) || !((innerStart<outerStart && innerEnd<=outerStart) || (innerStart>=outerEnd && innerEnd>outerEnd))){
|
||||
status=false
|
||||
}
|
||||
}
|
||||
})
|
||||
const {templateName, sdcLimit, sdcDown, sdcUp} = this.formData
|
||||
const {siteId, updateStrategyId} = this.$home
|
||||
const {tableData} = this
|
||||
if (this.mode === 'edit') {
|
||||
editStrategyTemp({
|
||||
siteId,
|
||||
strategyId: updateStrategyId,
|
||||
templateId: this.editTempId,
|
||||
templateName,
|
||||
sdcLimit,
|
||||
sdcDown,
|
||||
sdcUp,
|
||||
timeConfigList: tableData
|
||||
}).then(response => {
|
||||
if (response?.code === 200) {
|
||||
this.closeDialog()
|
||||
this.$emit('update')
|
||||
this.$emit('updateTimeSetting')
|
||||
}
|
||||
})
|
||||
if(!status){
|
||||
return this.$message.error('时间选择范围冲突');
|
||||
}
|
||||
const {templateName,sdcLimit,sdcDown,sdcUp} = this.formData
|
||||
const {siteId,updateStrategyId} =this.$home
|
||||
const {tableData} = this
|
||||
if(this.mode==='edit'){
|
||||
editStrategyTemp({siteId,strategyId:updateStrategyId,templateId:this.editTempId,templateName,sdcLimit,sdcDown,sdcUp,timeConfigList:tableData}).then(response=>{
|
||||
if(response?.code === 200){
|
||||
this.closeDialog()
|
||||
this.$emit('update')
|
||||
this.$emit('updateTimeSetting')
|
||||
}
|
||||
})
|
||||
}else{
|
||||
addStrategyTemp({siteId,strategyId:updateStrategyId,templateName,sdcLimit,sdcDown,sdcUp,timeConfigList:tableData}).then(response=>{
|
||||
if(response?.code === 200){
|
||||
this.closeDialog()
|
||||
this.$emit('update')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
addStrategyTemp({
|
||||
siteId,
|
||||
strategyId: updateStrategyId,
|
||||
templateName,
|
||||
sdcLimit,
|
||||
sdcDown,
|
||||
sdcUp,
|
||||
timeConfigList: tableData
|
||||
}).then(response => {
|
||||
if (response?.code === 200) {
|
||||
this.closeDialog()
|
||||
this.$emit('update')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
closeDialog(){
|
||||
closeDialog() {
|
||||
// 清空所有数据
|
||||
this.$refs.addTempForm.resetFields()
|
||||
this.formData={
|
||||
this.formData = {
|
||||
templateName: '',
|
||||
sdcLimit:0,
|
||||
sdcDown: '',
|
||||
sdcUp: '',
|
||||
sdcLimit: 0,
|
||||
sdcDown: '',
|
||||
sdcUp: '',
|
||||
}
|
||||
this.tableData=[]
|
||||
this.tableData = []
|
||||
this.cancelAddTime()
|
||||
this.dialogTableVisible=false
|
||||
this.dialogTableVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.add-template-dialog {
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
@ -1,27 +1,30 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading" class="ems-dashboard-editor-container ems-content-container-padding">
|
||||
<div v-loading="loading" class="ems-dashboard-editor-container ems-content-container-padding">
|
||||
<!-- 搜索栏-->
|
||||
<el-form :inline="true" class="select-container">
|
||||
<el-form-item label="设备清单">
|
||||
<el-select v-model="search.deviceId" clearable placeholder="请选择" :loading="loading" loading-text="正在加载数据">
|
||||
<el-option :label="item.deviceName" :value="item.deviceId" v-for="(item,key) in deviceOptions" :key="key+'deviceIdOptions'"></el-option>
|
||||
<el-select v-model="search.deviceId" clearable placeholder="请选择" :loading="loading"
|
||||
loading-text="正在加载数据">
|
||||
<el-option :label="item.deviceName" :value="item.deviceId" v-for="(item,key) in deviceOptions"
|
||||
:key="key+'deviceIdOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警等级">
|
||||
<el-select v-model="search.alarmLevel" clearable placeholder="请选择" :loading="loading" loading-text="正在加载数据">
|
||||
<el-option :label="value" :value="key" v-for="(value,key) in $store.state.ems.alarmLevelOptions" :key="key+'alarmLevelOptions'"></el-option>
|
||||
<el-select v-model="search.alarmLevel" clearable placeholder="请选择" :loading="loading"
|
||||
loading-text="正在加载数据" style="width: 130px">
|
||||
<el-option :label="value" :value="key" v-for="(value,key) in $store.state.ems.alarmLevelOptions"
|
||||
:key="key+'alarmLevelOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间选择">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
:picker-options="pickerOptions"
|
||||
:default-value="defaultDateRange"
|
||||
end-placeholder="结束时间">
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
:picker-options="pickerOptions"
|
||||
:default-value="defaultDateRange"
|
||||
end-placeholder="结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -36,7 +39,9 @@
|
||||
<el-row style="">
|
||||
<el-col :xs="24" :sm="24" :lg="24">
|
||||
<el-button-group class="ems-btns-group">
|
||||
<el-button v-for="(item,index) in btnList" :key="index+'dtdcBtns'" :class="{'activeBtn' : activeBtn === item.id}" @click="changeDataType(item.id)">{{item.name}}</el-button>
|
||||
<el-button v-for="(item,index) in btnList" :key="index+'dtdcBtns'"
|
||||
:class="{'activeBtn' : activeBtn === item.id}" @click="changeDataType(item.id)">{{ item.name }}
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -47,64 +52,67 @@
|
||||
stripe
|
||||
max-height="500"
|
||||
style="width: 100%;margin-top:25px;">
|
||||
<el-table-column
|
||||
<el-table-column
|
||||
prop="deviceName"
|
||||
label="设备名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="告警等级"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{$store.state.ems.alarmLevelOptions[scope.row.alarmLevel]}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ $store.state.ems.alarmLevelOptions[scope.row.alarmLevel] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmContent"
|
||||
show-overflow-tooltip
|
||||
label="告警内容">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmStartTime"
|
||||
label="告警发生时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDate(scope.row.alarmStartTime,true)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatDate(scope.row.alarmStartTime, true) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="alarmEndTime"
|
||||
label="告警结束时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{formatDate(scope.row.alarmEndTime,true)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<template slot-scope="scope">
|
||||
<span>{{ formatDate(scope.row.alarmEndTime, true) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="状态">
|
||||
<template slot-scope="scope">
|
||||
<span :class="['0','2'].includes(scope.row.status) ? 'warning-status' : ''">{{$store.state.ems.alarmStatusOptions[scope.row.status]}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
:class="['0','2'].includes(scope.row.status) ? 'warning-status' : ''">{{ $store.state.ems.alarmStatusOptions[scope.row.status] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="工单"
|
||||
fixed="right"
|
||||
width="250"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" v-if="scope.row.ticketNo" @click="toTicket">已生成工单(工单号:{{scope.row.ticketNo}})</el-button>
|
||||
<el-button type="primary" size="mini" v-else @click="createTicket(scope.row.id)">生成工单</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" v-if="scope.row.ticketNo" @click="toTicket">
|
||||
已生成工单(工单号:{{ scope.row.ticketNo }})
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" v-else @click="createTicket(scope.row.id)">生成工单</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-show="tableData.length>0"
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalSize"
|
||||
style="margin-top:15px;text-align: center"
|
||||
v-show="tableData.length>0"
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalSize"
|
||||
style="margin-top:15px;text-align: center"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
@ -113,113 +121,127 @@
|
||||
|
||||
|
||||
<script>
|
||||
import {getAlarmDetailList,createTicketNo} from'@/api/ems/dzjk'
|
||||
import {getDeviceList} from'@/api/ems/site'
|
||||
import {createTicketNo, getAlarmDetailList} from '@/api/ems/dzjk'
|
||||
import {getDeviceList} from '@/api/ems/site'
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { formatDate } from '@/filters/ems'
|
||||
import {formatDate} from '@/filters/ems'
|
||||
|
||||
export default {
|
||||
name:'DzjkGzgj',
|
||||
mixins:[getQuerySiteId],
|
||||
name: 'DzjkGzgj',
|
||||
mixins: [getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
btnList:[
|
||||
{name:'未处理告警',id:'today'},
|
||||
{name:'历史告警',id:'history'},
|
||||
loading: false,
|
||||
btnList: [
|
||||
{name: '未处理告警', id: 'today'},
|
||||
{name: '历史告警', id: 'history'},
|
||||
],
|
||||
deviceOptions:[],//设备列表
|
||||
pickerOptions:{
|
||||
deviceOptions: [],//设备列表
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
},
|
||||
defaultDateRange:[],//默认展示的时间
|
||||
dateRange:[],//alarmStartTime,alarmEndTime
|
||||
activeBtn:'today',
|
||||
search:{deviceId:'',alarmLevel:''},
|
||||
defaultDateRange: [],//默认展示的时间
|
||||
dateRange: [],//alarmStartTime,alarmEndTime
|
||||
activeBtn: 'today',
|
||||
search: {deviceId: '', alarmLevel: ''},
|
||||
// 表格、分页
|
||||
tableData:[],
|
||||
pageSize:10,//分页栏当前每个数据总数
|
||||
pageNum:1,//分页栏当前页数
|
||||
totalSize:0,//table表格数据总数
|
||||
tableData: [],
|
||||
pageSize: 10,//分页栏当前每个数据总数
|
||||
pageNum: 1,//分页栏当前页数
|
||||
totalSize: 0,//table表格数据总数
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
formatDate,
|
||||
toTicket(){
|
||||
this.$router.push({path:'/ticket'})
|
||||
toTicket() {
|
||||
this.$router.push({path: '/ticket'})
|
||||
},
|
||||
//生成工单
|
||||
createTicket(id){
|
||||
createTicket(id) {
|
||||
this.loading = true
|
||||
createTicketNo({id}).then(response=>{
|
||||
createTicketNo({id}).then(response => {
|
||||
response?.data && this.toTicket()
|
||||
}).finally(()=>{this.loading = false})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 判断是否是同一天
|
||||
isSameDay(day1, day2) {
|
||||
const date1 = new Date(day1),date2 = new Date(day2)
|
||||
const date1 = new Date(day1), date2 = new Date(day2)
|
||||
return date1.getFullYear() === date2.getFullYear() &&
|
||||
date1.getMonth() === date2.getMonth() &&
|
||||
date1.getDate() === date2.getDate();
|
||||
date1.getMonth() === date2.getMonth() &&
|
||||
date1.getDate() === date2.getDate();
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageNum = val
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
onSearch(){
|
||||
this.pageNum =1//每次搜索从1开始搜索
|
||||
onSearch() {
|
||||
this.pageNum = 1//每次搜索从1开始搜索
|
||||
this.getData()
|
||||
},
|
||||
// 重置
|
||||
onReset(){
|
||||
this.search={deviceId:'',alarmLevel:''}
|
||||
this.dateRange=[]
|
||||
this.pageNum =1//每次搜索从1开始搜索
|
||||
onReset() {
|
||||
this.search = {deviceId: '', alarmLevel: ''}
|
||||
this.dateRange = []
|
||||
this.pageNum = 1//每次搜索从1开始搜索
|
||||
this.getData()
|
||||
},
|
||||
// 切换今日、历史告警
|
||||
changeDataType(id){
|
||||
if(id !== this.activeBtn){
|
||||
changeDataType(id) {
|
||||
if (id !== this.activeBtn) {
|
||||
console.log('点击了不同的菜单,更新数据')
|
||||
this.activeBtn=id;
|
||||
this.activeBtn = id;
|
||||
this.getData()
|
||||
}
|
||||
},
|
||||
// 获取数据
|
||||
getData(){
|
||||
this.$store.dispatch('getSiteAlarmNum',this.siteId)
|
||||
this.loading=true
|
||||
const {deviceId,alarmLevel} = this.search
|
||||
const {siteId,pageNum,pageSize,activeBtn} =this
|
||||
const [alarmStartTime='',alarmEndTime='']=(this.dateRange || [])
|
||||
getData() {
|
||||
this.$store.dispatch('getSiteAlarmNum', this.siteId)
|
||||
this.loading = true
|
||||
const {deviceId, alarmLevel} = this.search
|
||||
const {siteId, pageNum, pageSize, activeBtn} = this
|
||||
const [alarmStartTime = '', alarmEndTime = ''] = (this.dateRange || [])
|
||||
let status = activeBtn === 'today' ? '0' : '1,2'
|
||||
getAlarmDetailList({status,deviceId,alarmLevel,siteId,pageSize,pageNum,alarmStartTime:formatDate(alarmStartTime),alarmEndTime:formatDate(alarmEndTime)}).then(response => {
|
||||
this.tableData=response?.rows || [];
|
||||
getAlarmDetailList({
|
||||
status,
|
||||
deviceId,
|
||||
alarmLevel,
|
||||
siteId,
|
||||
pageSize,
|
||||
pageNum,
|
||||
alarmStartTime: formatDate(alarmStartTime),
|
||||
alarmEndTime: formatDate(alarmEndTime)
|
||||
}).then(response => {
|
||||
this.tableData = response?.rows || [];
|
||||
this.totalSize = response?.total || 0
|
||||
}).finally(() => {this.loading=false})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getDeviceOptions(){
|
||||
getDeviceOptions() {
|
||||
getDeviceList(this.siteId).then(response => {
|
||||
this.deviceOptions = JSON.parse(JSON.stringify(response?.data || []))
|
||||
})
|
||||
},
|
||||
init(){
|
||||
init() {
|
||||
this.getDeviceOptions()
|
||||
this.onReset()
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
mounted() {
|
||||
const now = new Date();
|
||||
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
||||
this.defaultDateRange = [lastMonth, now];
|
||||
|
||||
@ -1,30 +1,29 @@
|
||||
|
||||
<template>
|
||||
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding time-range-card">
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title">当日功率曲线</span>
|
||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate"/>
|
||||
</div>
|
||||
<div style="height: 310px" id="activeChart"></div>
|
||||
</el-card>
|
||||
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding time-range-card">
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title">当日功率曲线</span>
|
||||
<date-range-select ref="dateRangeSelect" :showIcon="true" :mini-time-picker="true" @updateDate="updateDate"/>
|
||||
</div>
|
||||
<div style="height: 310px" id="activeChart"></div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
import resize from '@/mixins/ems/resize'
|
||||
import DateRangeSelect from '@/components/Ems/DateRangeSelect/index.vue'
|
||||
import { getPointData } from '@/api/ems/dzjk'
|
||||
import {getPointData} from '@/api/ems/dzjk'
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
|
||||
export default {
|
||||
mixins: [resize,intervalUpdate],
|
||||
mixins: [resize, intervalUpdate],
|
||||
components: {DateRangeSelect},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
timeRange:[],
|
||||
siteId:'',
|
||||
isInit:true
|
||||
timeRange: [],
|
||||
siteId: '',
|
||||
isInit: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -41,23 +40,23 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 更新时间范围 重置图表
|
||||
updateDate(data){
|
||||
this.timeRange=data
|
||||
updateDate(data) {
|
||||
this.timeRange = data
|
||||
!this.isInit && this.getGVQXData()
|
||||
this.isInit = false
|
||||
},
|
||||
getGVQXData(){
|
||||
getGVQXData() {
|
||||
this.showLoading()
|
||||
const {siteId,timeRange}=this
|
||||
getPointData({siteId,startDate:timeRange[0],endDate:timeRange[1]}).then(response => {
|
||||
const {siteId, timeRange} = this
|
||||
getPointData({siteId, startDate: timeRange[0], endDate: timeRange[1]}).then(response => {
|
||||
this.setOption(response?.data || [])
|
||||
}).finally(()=>this.hideLoading())
|
||||
}).finally(() => this.hideLoading())
|
||||
},
|
||||
init(siteId){
|
||||
init(siteId) {
|
||||
//初始化 清空数据
|
||||
this.siteId = siteId
|
||||
this.isInit = true
|
||||
this.timeRange=[]
|
||||
this.timeRange = []
|
||||
this.$refs.dateRangeSelect.init(true)
|
||||
this.getGVQXData()
|
||||
this.updateInterval(this.getGVQXData)
|
||||
@ -65,17 +64,17 @@ export default {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.querySelector('#activeChart'))
|
||||
},
|
||||
showLoading(){
|
||||
showLoading() {
|
||||
this.chart && this.chart.showLoading()
|
||||
},
|
||||
hideLoading(){
|
||||
hideLoading() {
|
||||
this.chart && this.chart.hideLoading()
|
||||
},
|
||||
setOption(data) {
|
||||
const source = [['日期','电网功率','负载功率','储能功率','光伏功率','soc平均值','soh平均值','电池平均温度平均值']]
|
||||
console.log('source.slice(1)',source[0].slice(1))
|
||||
this.chart && data.forEach((item)=>{
|
||||
source.push([item.statisDate,item.gridPower,item.loadPower,item.storagePower,item.pvPower,item.avgSoc,item.avgSoh,item.avgTemp])
|
||||
const source = [['日期', '电网功率', '负载功率', '储能功率', '光伏功率', 'soc平均值', 'soh平均值', '电池平均温度平均值']]
|
||||
console.log('source.slice(1)', source[0].slice(1))
|
||||
this.chart && data.forEach((item) => {
|
||||
source.push([item.statisDate, item.gridPower, item.loadPower, item.storagePower, item.pvPower, item.avgSoc, item.avgSoh, item.avgTemp])
|
||||
})
|
||||
this.chart.setOption({
|
||||
grid: {
|
||||
@ -91,8 +90,8 @@ export default {
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
textStyle:{
|
||||
color:"#333333",
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
@ -105,11 +104,17 @@ export default {
|
||||
type: 'value',
|
||||
},
|
||||
],
|
||||
dataset:{source},
|
||||
series: source[0].slice(1).map((item,index)=>{
|
||||
dataset: {source},
|
||||
series: source[0].slice(1).map((item, index) => {
|
||||
return {
|
||||
type: 'line',
|
||||
yAxisIndex:index<=4 ? 0 : 1
|
||||
type: 'line',//index === 5 ? 'bar' : 'line',
|
||||
showSymbol: false,
|
||||
symbolSize: 2,
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.5,
|
||||
},
|
||||
yAxisIndex: index <= 4 ? 0 : 1
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
|
||||
<template>
|
||||
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding time-range-card">
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title">一周充放曲线</span>
|
||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate"/>
|
||||
</div>
|
||||
<div style="height: 310px" id="weekChart"></div>
|
||||
</el-card>
|
||||
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding time-range-card">
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title">一周充放曲线</span>
|
||||
<date-range-select ref="dateRangeSelect" :showIcon="true" :mini-time-picker="true" @updateDate="updateDate"/>
|
||||
</div>
|
||||
<div style="height: 310px" id="weekChart"></div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -14,14 +13,15 @@ import * as echarts from 'echarts'
|
||||
import resize from '@/mixins/ems/resize'
|
||||
import DateRangeSelect from '@/components/Ems/DateRangeSelect/index.vue'
|
||||
import {getSevenChargeData} from '@/api/ems/dzjk'
|
||||
|
||||
export default {
|
||||
mixins: [resize],
|
||||
components: {DateRangeSelect},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
timeRange:[],
|
||||
siteId:'',
|
||||
timeRange: [],
|
||||
siteId: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -38,41 +38,40 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 更新时间范围 重置图表
|
||||
updateDate(data){
|
||||
this.timeRange=data
|
||||
updateDate(data) {
|
||||
this.timeRange = data
|
||||
this.getWeekKData()
|
||||
},
|
||||
getWeekKData(){
|
||||
getWeekKData() {
|
||||
this.showLoading()
|
||||
const {siteId,timeRange}=this
|
||||
this.hideLoading()
|
||||
getSevenChargeData({siteId,startDate:timeRange[0],endDate:timeRange[1]}).then(response => {
|
||||
const {siteId, timeRange} = this
|
||||
getSevenChargeData({siteId, startDate: timeRange[0], endDate: timeRange[1]}).then(response => {
|
||||
this.setOption(response?.data || [])
|
||||
}).finally(()=>this.hideLoading())
|
||||
}).finally(() => this.hideLoading())
|
||||
},
|
||||
init(siteId){
|
||||
init(siteId) {
|
||||
//初始化 清空数据
|
||||
this.siteId = siteId
|
||||
this.timeRange=[]
|
||||
this.deviceId=''
|
||||
this.timeRange = []
|
||||
this.deviceId = ''
|
||||
this.$refs.dateRangeSelect.init()
|
||||
},
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.querySelector('#weekChart'))
|
||||
},
|
||||
showLoading(){
|
||||
showLoading() {
|
||||
this.chart && this.chart.showLoading()
|
||||
},
|
||||
hideLoading(){
|
||||
hideLoading() {
|
||||
this.chart && this.chart.hideLoading()
|
||||
},
|
||||
setOption(data,unit) {
|
||||
const source = [['日期','充电量','放电量']]
|
||||
data.forEach(item=>{
|
||||
source.push([item.ammeterDate, item.chargedCap,item.disChargedCap])
|
||||
setOption(data, unit) {
|
||||
const source = [['日期', '充电量', '放电量']]
|
||||
data.forEach(item => {
|
||||
source.push([item.ammeterDate, item.chargedCap, item.disChargedCap])
|
||||
})
|
||||
this.chart && this.chart.setOption({
|
||||
color:['#4472c4','#70ad47'],//所有充放电颜色保持统一
|
||||
color: ['#4472c4', '#70ad47'],//所有充放电颜色保持统一
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
@ -88,29 +87,29 @@ export default {
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
name:unit,
|
||||
nameLocation:'center'
|
||||
name: unit,
|
||||
nameLocation: 'center'
|
||||
},
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
name:'充电量/放电量kWh',
|
||||
name: '充电量/放电量kWh',
|
||||
axisLine: {
|
||||
lineStyle:{
|
||||
lineStyle: {
|
||||
color: '#333333',
|
||||
},
|
||||
onZero:false
|
||||
onZero: false
|
||||
}
|
||||
}],
|
||||
dataset:{
|
||||
dataset: {
|
||||
source
|
||||
},
|
||||
series: [
|
||||
{
|
||||
yAxisIndex:0,
|
||||
yAxisIndex: 0,
|
||||
type: 'bar',
|
||||
},
|
||||
{
|
||||
yAxisIndex:0,
|
||||
yAxisIndex: 0,
|
||||
type: 'bar',
|
||||
},
|
||||
]
|
||||
|
||||
@ -4,130 +4,164 @@
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-row style="background: #fff" class="row-container" :gutter="15">
|
||||
<el-col v-if="tableData.length > 0" :xs="24" :sm="24" :lg="24">
|
||||
<alarm-table :tableData="tableData" />
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="6">
|
||||
<el-col :xs="24" :sm="24" :lg="5">
|
||||
<!-- 站点信息-->
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding"
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="card-title">站点信息</span>
|
||||
<div class="alarm-msg" v-if="tableData.length > 0" @click="toAlarm">
|
||||
<i class="el-icon-message-solid"></i> 设备告警
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
|
||||
style="box-sizing: border-box; height: 218px; padding: 20px 15px"
|
||||
>
|
||||
<el-descriptions class="home-normal-info" :column="1">
|
||||
<el-descriptions-item
|
||||
size="mini"
|
||||
v-for="(item, index) in singleZdInfo"
|
||||
:key="index + 'singleZdInfo'"
|
||||
:label="item.title"
|
||||
>{{ info[item.attr] | formatNumber }}</el-descriptions-item
|
||||
>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="card-title">总累计运行数据</span>
|
||||
</div>
|
||||
<div
|
||||
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!-- 地址、运行时间-->
|
||||
<div class="site-info site-info-address">
|
||||
<div class="title">
|
||||
<i class="el-icon-location"></i>
|
||||
</div>
|
||||
<div class="value">{{ info.siteAddress }}</div>
|
||||
</div>
|
||||
<div class="site-info">
|
||||
<div class="title">
|
||||
<i class="el-icon-date"></i>
|
||||
</div>
|
||||
<div class="value">{{ info.runningTime || '-' }}</div>
|
||||
</div>
|
||||
<!-- 装机功率、容量 -->
|
||||
<el-row :gutter="10" style="margin-top:20px;">
|
||||
<el-col
|
||||
:span="12"
|
||||
v-for="(item, index) in sjglData"
|
||||
:key="index + 'sjglData'"
|
||||
class="sjgl-data"
|
||||
:span="12"
|
||||
class="sjgl-col power-col"
|
||||
>
|
||||
<div class="sjgl-title">{{ item.title }}</div>
|
||||
<div class="sjgl-value">
|
||||
{{ runningInfo[item.attr] | formatNumber }}
|
||||
<div class="sjgl-wrapper">
|
||||
<div class="sjgl-title">装机功率(MW)</div>
|
||||
<div class="sjgl-value">
|
||||
{{ info.installPower | formatNumber }}
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="12"
|
||||
class="sjgl-col power-col"
|
||||
>
|
||||
<div class="sjgl-wrapper">
|
||||
<div class="sjgl-title">装机容量(MW)</div>
|
||||
<div class="sjgl-value">
|
||||
{{ info.installCapacity | formatNumber }}
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="10">
|
||||
<cl-info :info="runningInfo.strategyTempInfo" />
|
||||
<!-- 总累计运行数据-->
|
||||
<el-col :xs="24" :sm="24" :lg="19">
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="card-title">总累计运行数据</span>
|
||||
<div class="total-count">
|
||||
<span class="title">总收入</span>
|
||||
<span class="value">{{ runningInfo.totalRevenue | formatNumber }}</span>
|
||||
<span class="unit">元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="box-sizing: border-box; height: 218px; padding: 20px 15px"
|
||||
>
|
||||
<el-row :gutter="10">
|
||||
<el-col
|
||||
:span="6"
|
||||
v-for="(item, index) in sjglData"
|
||||
:key="index + 'sjglData'"
|
||||
class="sjgl-col"
|
||||
>
|
||||
<div class="sjgl-wrapper">
|
||||
<div class="sjgl-title">{{ item.title }}</div>
|
||||
<div class="sjgl-value" :style="{color:item.color}">
|
||||
{{ runningInfo[item.attr] | formatNumber }}
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="24">
|
||||
<week-chart ref="weekChart" />
|
||||
<el-col :xs="24" :sm="24" :lg="12">
|
||||
<week-chart ref="weekChart"/>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="24">
|
||||
<active-chart ref="activeChart" />
|
||||
<el-col :xs="24" :sm="24" :lg="12">
|
||||
<active-chart ref="activeChart"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSingleSiteBaseInfo } from "@/api/ems/zddt";
|
||||
import { getDzjkHomeView } from "@/api/ems/dzjk";
|
||||
import {getSingleSiteBaseInfo} from "@/api/ems/zddt";
|
||||
import {getDzjkHomeView} from "@/api/ems/dzjk";
|
||||
import WeekChart from "./WeekChart.vue";
|
||||
import ActiveChart from "./ActiveChart.vue";
|
||||
import AlarmTable from "./AlarmTable.vue";
|
||||
import ClInfo from "./ClInfo.vue";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
|
||||
export default {
|
||||
name: "DzjkSbjkHome",
|
||||
components: { WeekChart, ActiveChart, AlarmTable, ClInfo },
|
||||
components: {WeekChart, ActiveChart, AlarmTable, ClInfo},
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
singleZdInfo: [
|
||||
{
|
||||
title: "电站位置",
|
||||
attr: "siteAddress",
|
||||
},
|
||||
{
|
||||
title: "投运时间",
|
||||
attr: "runningTime",
|
||||
},
|
||||
{
|
||||
title: "装机功率(MW)",
|
||||
attr: "installPower",
|
||||
},
|
||||
{
|
||||
title: "装机容量(MW)",
|
||||
attr: "installCapacity",
|
||||
},
|
||||
],
|
||||
sjglData: [
|
||||
{
|
||||
title: "今日充电量(kWh)",
|
||||
attr: "dayChargedCap",
|
||||
color: '#4472c4'
|
||||
},
|
||||
{
|
||||
title: "今日放电量(kWh)",
|
||||
attr: "dayDisChargedCap",
|
||||
color: '#70ad47'
|
||||
},
|
||||
{
|
||||
title: "总充电量(kWh)",
|
||||
attr: "totalChargedCap",
|
||||
color: '#4472c4'
|
||||
},
|
||||
{
|
||||
title: "今日实时收入(元)",
|
||||
attr: "dayRevenue",
|
||||
color: '#f67438'
|
||||
},
|
||||
{
|
||||
title: "昨日充电量(kWh)",
|
||||
attr: "yesterdayChargedCap",
|
||||
color: '#4472c4'
|
||||
},
|
||||
{
|
||||
title: "昨日放电量(kWh)",
|
||||
attr: "yesterdayDisChargedCap",
|
||||
color: '#70ad47'
|
||||
},
|
||||
{
|
||||
title: "总放电量(kWh)",
|
||||
attr: "totalDischargedCap",
|
||||
color: '#70ad47'
|
||||
},
|
||||
{
|
||||
title: "总收入(元)",
|
||||
attr: "totalRevenue",
|
||||
},
|
||||
{
|
||||
title: "当日实时收入(元)",
|
||||
attr: "dayRevenue",
|
||||
title: "昨日实时收入(元)",
|
||||
attr: "yesterdayRevenue",
|
||||
color: '#f67438'
|
||||
},
|
||||
],
|
||||
info: {}, //基本信息
|
||||
@ -136,14 +170,13 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
tableData() {
|
||||
console.log(
|
||||
"this.runningInfo?.siteMonitorHomeAlarmVo ",
|
||||
this.runningInfo?.siteMonitorHomeAlarmVo
|
||||
);
|
||||
return this.runningInfo?.siteMonitorHomeAlarmVo || [];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toAlarm() {
|
||||
this.$router.push({path: "/dzjk/gzgj", query: this.$route.query});
|
||||
},
|
||||
getBaseInfo() {
|
||||
return getSingleSiteBaseInfo(this.siteId).then((response) => {
|
||||
this.info = response?.data || {};
|
||||
@ -173,6 +206,73 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
//设备告警
|
||||
.alarm-msg {
|
||||
background: #ff4949;
|
||||
padding: 2px 5px;
|
||||
font-size: 10px;
|
||||
font-weight: bolder;
|
||||
border-radius: 3px;
|
||||
line-height: 20px;
|
||||
cursor: pointer;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
//基本信息-地址 运行️时间
|
||||
.site-info {
|
||||
display: flex;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
margin-bottom: 10px;
|
||||
align-items: center;
|
||||
|
||||
&.site-info-address {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #1791ff;
|
||||
font-size: 18px;
|
||||
line-height: 20px;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.value {
|
||||
color: #000;
|
||||
font-size: 12px;
|
||||
max-height: 40px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
//总收入
|
||||
.total-count {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 12px;
|
||||
font-weight: bolder;
|
||||
color: #333;
|
||||
line-height: 14px;
|
||||
|
||||
.unit {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 22px;
|
||||
font-weight: bolder;
|
||||
color: #ed2f1d;
|
||||
font-style: italic;
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.row-container {
|
||||
& > .el-col {
|
||||
margin-bottom: 20px;
|
||||
@ -180,25 +280,47 @@ export default {
|
||||
}
|
||||
|
||||
//数据概览
|
||||
.sjgl-data {
|
||||
text-align: center;
|
||||
&:nth-child(1),
|
||||
.sjgl-col {
|
||||
.sjgl-wrapper {
|
||||
text-align: left;
|
||||
padding: 15px 20px;
|
||||
background-color: #f2f7fb;
|
||||
}
|
||||
|
||||
&.power-col {
|
||||
.sjgl-wrapper {
|
||||
padding: 10px;
|
||||
|
||||
.sjgl-value {
|
||||
color: #c44444;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(4),
|
||||
&:nth-child(2),
|
||||
&:nth-child(3),
|
||||
&:nth-child(4) {
|
||||
margin-bottom: 25px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.sjgl-title {
|
||||
color: #666666;
|
||||
color: #717171;
|
||||
line-height: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sjgl-value {
|
||||
color: rgba(51, 51, 51, 1);
|
||||
font-size: 26px;
|
||||
font-size: 22px;
|
||||
line-height: 26px;
|
||||
font-weight: 500;
|
||||
font-weight: bolder;
|
||||
font-style: italic;
|
||||
margin-top: 14px;
|
||||
word-wrap: break-word;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -206,10 +328,12 @@ export default {
|
||||
<style lang="scss">
|
||||
.home-normal-info {
|
||||
font-size: 12px;
|
||||
|
||||
.el-descriptions-item__container {
|
||||
.el-descriptions-item__label {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.el-descriptions-item__content {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
<!--电位展示图表-->
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="show"
|
||||
:title="pointName"
|
||||
:close-on-click-modal="false"
|
||||
show-close
|
||||
destroy-on-close
|
||||
lock-scroll
|
||||
append-to-body
|
||||
width="1000px"
|
||||
class="ems-dialog"
|
||||
:before-close="handleClosed"
|
||||
:visible.sync="show"
|
||||
:title="pointName"
|
||||
:close-on-click-modal="false"
|
||||
show-close
|
||||
destroy-on-close
|
||||
lock-scroll
|
||||
append-to-body
|
||||
width="1000px"
|
||||
class="ems-dialog"
|
||||
:before-close="handleClosed"
|
||||
>
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding time-range-card"
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding time-range-card"
|
||||
>
|
||||
<div slot="header" class="time-range-header">
|
||||
<el-radio-group class="card-title" v-model="dataUnit">
|
||||
@ -23,10 +23,10 @@
|
||||
<el-radio :label="3">天</el-radio>
|
||||
</el-radio-group>
|
||||
<date-time-select
|
||||
ref="dateTimeSelect"
|
||||
:data-unit="dataUnit"
|
||||
@initDate="(e) => (dataRange = e || [])"
|
||||
@updateDate="updateDate"
|
||||
ref="dateTimeSelect"
|
||||
:data-unit="dataUnit"
|
||||
@initDate="(e) => (dataRange = e || [])"
|
||||
@updateDate="updateDate"
|
||||
/>
|
||||
</div>
|
||||
<div style="height: 350px" id="searchChart"></div>
|
||||
@ -37,10 +37,11 @@
|
||||
import * as echarts from "echarts";
|
||||
import resize from "@/mixins/ems/resize";
|
||||
import DateTimeSelect from "@/views/ems/search/DateTimeSelect.vue";
|
||||
import { getPointValueList } from "@/api/ems/search";
|
||||
import {getPointValueList} from "@/api/ems/search";
|
||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
||||
|
||||
export default {
|
||||
components: { DateRangeSelect, DateTimeSelect },
|
||||
components: {DateRangeSelect, DateTimeSelect},
|
||||
mixins: [resize],
|
||||
props: {
|
||||
siteId: {
|
||||
@ -93,7 +94,7 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
showChart({ pointName, deviceCategory, deviceId, child = "" }) {
|
||||
showChart({pointName, deviceCategory, deviceId, child = ""}) {
|
||||
//初始化数据
|
||||
this.pointName = pointName;
|
||||
this.deviceCategory = deviceCategory;
|
||||
@ -152,84 +153,94 @@ export default {
|
||||
endDate,
|
||||
siteDeviceMap,
|
||||
})
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.hideLoading();
|
||||
});
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.hideLoading();
|
||||
});
|
||||
},
|
||||
setOption(data) {
|
||||
if (!this.chart) return;
|
||||
this.chart.clear();
|
||||
console.log("返回的数据", data);
|
||||
let dataset = [];
|
||||
if (data.length > 0) {
|
||||
data.forEach((item, index) => {
|
||||
item.deviceList.forEach((inner) => {
|
||||
dataset.push({
|
||||
name: `${
|
||||
this.isDtdc
|
||||
? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}${inner.deviceId}`
|
||||
: `${inner.deviceId}`
|
||||
}`,
|
||||
type: "line",
|
||||
markPoint: {
|
||||
symbolSize: 30,
|
||||
emphasis: {
|
||||
disabled:false//打开 鼠标高亮
|
||||
},
|
||||
data: [//最大值、最小值
|
||||
{
|
||||
// type: 'max',
|
||||
name: `最大值`,
|
||||
coord:[inner.maxDate,inner.maxValue],
|
||||
relativeTo:'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
},
|
||||
},
|
||||
{
|
||||
// type: 'min',
|
||||
name: `最小值`,
|
||||
coord:[inner.minDate,inner.minValue],
|
||||
relativeTo:'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
xdata: [],
|
||||
data: [],
|
||||
});
|
||||
const length = dataset.length;
|
||||
inner.pointValueList.forEach((value) => {
|
||||
dataset[length - 1].xdata.push(value.valueDate);
|
||||
dataset[length - 1].data.push(value.pointValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
if (!data || data.length <= 0) {
|
||||
this.$message.warning("暂无数据");
|
||||
}
|
||||
console.log("图表数据", dataset);
|
||||
console.log('展示的图表类型chartType', data[0].chartType)
|
||||
|
||||
if (data[0].chartType === 2) {
|
||||
// 箱型图
|
||||
this.setBoxOption(data)
|
||||
} else {
|
||||
//折线图
|
||||
this.setLineOption(data)
|
||||
}
|
||||
},
|
||||
setLineOption(data) {
|
||||
let dataset = [];
|
||||
data.forEach((item, index) => {
|
||||
item.deviceList.forEach((inner) => {
|
||||
dataset.push({
|
||||
name: `${
|
||||
this.isDtdc
|
||||
? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}${inner.deviceId}`
|
||||
: `${inner.deviceId}`
|
||||
}`,
|
||||
type: "line",
|
||||
markPoint: {
|
||||
symbolSize: 30,
|
||||
emphasis: {
|
||||
disabled: false//打开 鼠标高亮
|
||||
},
|
||||
data: [//最大值、最小值
|
||||
{
|
||||
// type: 'max',
|
||||
name: `最大值`,
|
||||
coord: [inner.maxDate, inner.maxValue],
|
||||
relativeTo: 'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
},
|
||||
},
|
||||
{
|
||||
// type: 'min',
|
||||
name: `最小值`,
|
||||
coord: [inner.minDate, inner.minValue],
|
||||
relativeTo: 'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
xdata: [],
|
||||
data: [],
|
||||
});
|
||||
const length = dataset.length;
|
||||
inner.pointValueList.forEach((value) => {
|
||||
dataset[length - 1].xdata.push(value.valueDate);
|
||||
dataset[length - 1].data.push(value.pointValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
console.log("折线图图表数据", dataset);
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
// left: 'center',
|
||||
@ -241,14 +252,17 @@ export default {
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "cross", // 默认为直线,可选为:'line' | 'shadow'
|
||||
type: 'cross',
|
||||
},
|
||||
// axisPointer: {
|
||||
// // 坐标轴指示器,坐标轴触发有效
|
||||
// type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
// },
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: { type: "category", data: dataset?.[0]?.xdata || [] },
|
||||
xAxis: {type: "category", data: dataset?.[0]?.xdata || []},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
@ -266,6 +280,122 @@ export default {
|
||||
series: dataset,
|
||||
});
|
||||
},
|
||||
setBoxOption(data) {
|
||||
let dataset = [];
|
||||
data.forEach((item, index) => {
|
||||
item.deviceList.forEach((inner) => {
|
||||
dataset.push({
|
||||
name: `${
|
||||
this.isDtdc
|
||||
? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}${inner.deviceId}`
|
||||
: `${inner.deviceId}`
|
||||
}`,
|
||||
type: "boxplot",
|
||||
// markPoint: {
|
||||
// symbolSize: 30,
|
||||
// emphasis: {
|
||||
// disabled: false//打开 鼠标高亮
|
||||
// },
|
||||
// data: [//最大值、最小值
|
||||
// {
|
||||
// // type: 'max',
|
||||
// name: `最大值`,
|
||||
// coord: [inner.maxDate, inner.maxValue],
|
||||
// relativeTo: 'coordinate',
|
||||
// label: {
|
||||
// position: "top",
|
||||
// formatter: item.dataType === 2 ? ([
|
||||
// `最大值:${inner.maxValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// `差值:${inner.diffValue}`,
|
||||
// ]).join('\n') : ([
|
||||
// `最大值:${inner.maxValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// ]).join('\n'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// // type: 'min',
|
||||
// name: `最小值`,
|
||||
// coord: [inner.minDate, inner.minValue],
|
||||
// relativeTo: 'coordinate',
|
||||
// label: {
|
||||
// position: "top",
|
||||
// formatter: item.dataType === 2 ? ([
|
||||
// `最小值:${inner.minValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// `差值:${inner.diffValue}`,
|
||||
// ]).join('\n') : ([
|
||||
// `最小值:${inner.minValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// ]).join('\n'),
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
xdata: [],
|
||||
data: [],
|
||||
});
|
||||
const length = dataset.length;
|
||||
inner.pointValueList.forEach((value) => {
|
||||
const {valueDate, min, q1, median, q3, max} = value
|
||||
// const mid = (max - min) / 2, minLine = min + Math.abs(median / 2),
|
||||
// maxLine = max - Math.abs(median / 2)
|
||||
dataset[length - 1].xdata.push(valueDate);
|
||||
dataset[length - 1].data.push([min, q1, median, q3, max]);
|
||||
});
|
||||
});
|
||||
});
|
||||
console.log("箱型图图表数据", dataset);
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
// left: 'center',
|
||||
// top: '10',
|
||||
},
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function (params) {
|
||||
let data = params.data;
|
||||
let result = params.marker + params.name + ' ' + params.seriesName + '<br/>';
|
||||
result += '最小值: ' + data[1] + '<br/>';
|
||||
result += '平均值: ' + data[3] + '<br/>';
|
||||
result += '最大值: ' + data[5];
|
||||
return result;
|
||||
}
|
||||
// trigger: "axis",
|
||||
// axisPointer: {
|
||||
// type: 'cross',
|
||||
// },
|
||||
// axisPointer: {
|
||||
// // 坐标轴指示器,坐标轴触发有效
|
||||
// type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
// },
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {type: "category", data: dataset?.[0]?.xdata || []},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside",
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
],
|
||||
series: dataset,
|
||||
});
|
||||
},
|
||||
|
||||
updateDate(val) {
|
||||
this.dataRange = val || [];
|
||||
this.getDate();
|
||||
|
||||
@ -1,20 +1,22 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<div v-for="(baseInfo,index) in baseInfoList" :key="index+'bmsdccContainer'" style="margin-bottom:25px;">
|
||||
<el-card shadow="always" class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
||||
:class="{
|
||||
'warning-card-container':baseInfo.workStatus && baseInfo.workStatus !== '0',
|
||||
'running-card-container':baseInfo.workStatus === '0'
|
||||
}">
|
||||
<el-card shadow="always"
|
||||
class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
||||
:class="handleCardClass(baseInfo)">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{baseInfo.parentDeviceName?`${baseInfo.parentDeviceName} -> ` : ''}}{{baseInfo.deviceName}}</span>
|
||||
<span
|
||||
class="large-title">{{
|
||||
baseInfo.parentDeviceName ? `${baseInfo.parentDeviceName} -> ` : ''
|
||||
}}{{ baseInfo.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>数据更新时间:{{ baseInfo.dataUpdateTime || '-'}}</div>
|
||||
<div>数据更新时间:{{ baseInfo.dataUpdateTime || '-' }}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" size="small" style="margin-right:20px;" @click="pointDetail(baseInfo,'point')">详细</el-button>
|
||||
<el-badge :value="baseInfo.alarmNum || 0" class="item">
|
||||
<el-button type="primary" round size="small" style="margin-right:20px;"
|
||||
@click="pointDetail(baseInfo,'point')">详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!baseInfo.alarmNum" :value="baseInfo.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(baseInfo,'alarmPoint')"
|
||||
@ -22,70 +24,93 @@
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptions-main">
|
||||
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||
<el-descriptions-item labelClassName="descriptions-label" :contentClassName="`descriptions-direction ${baseInfo.workStatus === '0' ? 'save' :'danger'}`" :span="1" label="工作状态" >{{$store.state.ems.workStatusOptions[baseInfo.workStatus]}}</el-descriptions-item>
|
||||
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="与PCS通信">{{$store.state.ems.communicationStatusOptions[baseInfo.pcsCommunicationStatus]}}</el-descriptions-item>
|
||||
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="与EMS通信">{{$store.state.ems.communicationStatusOptions[baseInfo.emsCommunicationStatus]}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="descriptions-main descriptions-main-bg-color">
|
||||
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :span="1" :label="item.label">
|
||||
<div class="descriptions-main">
|
||||
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||
<el-descriptions-item
|
||||
contentClassName="descriptions-direction work-status"
|
||||
:span="1" label="工作状态">
|
||||
{{ CLUSTERWorkStatusOptions[baseInfo.workStatus] }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item contentClassName="descriptions-direction"
|
||||
:span="1" label="与PCS通信">
|
||||
{{ $store.state.ems.communicationStatusOptions[baseInfo.pcsCommunicationStatus] }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item contentClassName="descriptions-direction"
|
||||
:span="1" label="与EMS通信">
|
||||
{{ $store.state.ems.communicationStatusOptions[baseInfo.emsCommunicationStatus] }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="descriptions-main descriptions-main-bg-color">
|
||||
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction"
|
||||
v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :span="1"
|
||||
:label="item.label">
|
||||
<span class="pointer" @click="showChart(item.pointName || '',baseInfo.deviceId)">
|
||||
{{baseInfo[item.attr] | formatNumber}} <span v-if="item.unit" v-html="item.unit"></span>
|
||||
{{ baseInfo[item.attr] | formatNumber }} <span v-if="item.unit" v-html="item.unit"></span>
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<!-- 进度-->
|
||||
<div class="process-container">
|
||||
<div class="process-line-bg">
|
||||
<div class="process-line" :style="{height:baseInfo.currentSoc+'%'}"></div>
|
||||
</div>
|
||||
<div class="process pointer" @click="showChart( '当前SOC',baseInfo.deviceId)">当前SOC : {{baseInfo.currentSoc}}%</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<!-- 进度-->
|
||||
<div class="process-container">
|
||||
<div class="process-line-bg">
|
||||
<div class="process-line" :style="{height:baseInfo.currentSoc+'%'}"></div>
|
||||
</div>
|
||||
<div class="process pointer" @click="showChart( '当前SOC',baseInfo.deviceId)">当前SOC :
|
||||
{{ baseInfo.currentSoc }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
class="common-table"
|
||||
:data="baseInfo.batteryDataList"
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
class="common-table"
|
||||
:data="baseInfo.batteryDataList"
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
<el-table-column
|
||||
prop="dataName"
|
||||
label="名称">
|
||||
prop="dataName"
|
||||
label="名称">
|
||||
<template slot-scope="scope">
|
||||
<span v-html="scope.row.dataName+'('+unitObj[scope.row.dataName]+')'"></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="avgData"
|
||||
label="单体平均值"
|
||||
prop="avgData"
|
||||
label="单体平均值"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{scope.row.avgData}}</span>
|
||||
<span class="pointer"
|
||||
@click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{
|
||||
scope.row.avgData
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="minData"
|
||||
label="单体最小值">
|
||||
prop="minData"
|
||||
label="单体最小值">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{scope.row.minData}}</span>
|
||||
<span class="pointer"
|
||||
@click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{
|
||||
scope.row.minData
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="minDataID"
|
||||
label="单体最小值ID">
|
||||
prop="minDataID"
|
||||
label="单体最小值ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="maxData"
|
||||
label="单体最大值">
|
||||
prop="maxData"
|
||||
label="单体最大值">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer " @click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{scope.row.maxData}}</span>
|
||||
<span class="pointer "
|
||||
@click="showChart( tablePointNameMap[scope.row.dataName+scope.column.label],baseInfo.deviceId)">{{
|
||||
scope.row.maxData
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="maxDataID"
|
||||
label="单体最大值ID">
|
||||
prop="maxDataID"
|
||||
label="单体最大值ID">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
@ -103,59 +128,72 @@ import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
import {getBMSBatteryCluster} from '@/api/ems/dzjk'
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name:'DzjkSbjkBmsdcc',
|
||||
mixins:[getQuerySiteId,intervalUpdate],
|
||||
components:{PointTable, pointChart},
|
||||
name: 'DzjkSbjkBmsdcc',
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
components: {PointTable, pointChart},
|
||||
computed: {
|
||||
...mapState({
|
||||
CLUSTERWorkStatusOptions: state => state?.ems?.CLUSTERWorkStatusOptions || {},
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
unitObj:{
|
||||
'电压':'V',
|
||||
'温度':'℃',
|
||||
'SOC':'%'
|
||||
loading: false,
|
||||
unitObj: {
|
||||
'电压': 'V',
|
||||
'温度': '℃',
|
||||
'SOC': '%'
|
||||
},
|
||||
tablePointNameMap:{
|
||||
'电压单体最小值':'最低单体电压',
|
||||
'电压单体平均值':'电压平均值',
|
||||
'电压单体最大值':'最高单体电压',
|
||||
'温度单体最小值':'最低单体温度',
|
||||
'温度单体平均值':'平均单体温度',
|
||||
'温度单体最大值':'最高单体温度',
|
||||
'SOC单体最小值':'最低单体SOC',
|
||||
'SOC单体平均值':'当前SOC',
|
||||
'SOC单体最大值':'最高单体SOC',
|
||||
tablePointNameMap: {
|
||||
'电压单体最小值': '最低单体电压',
|
||||
'电压单体平均值': '电压平均值',
|
||||
'电压单体最大值': '最高单体电压',
|
||||
'温度单体最小值': '最低单体温度',
|
||||
'温度单体平均值': '平均单体温度',
|
||||
'温度单体最大值': '最高单体温度',
|
||||
'SOC单体最小值': '最低单体SOC',
|
||||
'SOC单体平均值': '当前SOC',
|
||||
'SOC单体最大值': '最高单体SOC',
|
||||
},
|
||||
baseInfoList:[],
|
||||
infoData:[
|
||||
{label:'簇电压',attr:'clusterVoltage',unit:'V',pointName:'簇电压'},
|
||||
{label:'可充电量',attr:'chargeableCapacity',unit:'kWh',pointName:'可充电量'},
|
||||
{label:'累计充电量',attr:'totalChargedCapacity',unit:'kWh',pointName:'累计充电量'},
|
||||
{label:'簇电流',attr:'clusterCurrent',unit:'A',pointName:'簇电流'},
|
||||
{label:'可放电量',attr:'dischargeableCapacity',unit:'kWh',pointName:'可放电量'},
|
||||
{label:'累计放电量',attr:'totalDischargedCapacity',unit:'kWh',pointName:'累计放电量'},
|
||||
{label:'SOH',attr:'soh',unit:'%',pointName:'SOH'},
|
||||
{label:'平均温度',attr:'averageTemperature',unit:'℃',pointName:'平均温度'},
|
||||
{label:'绝缘电阻',attr:'insulationResistance',unit:'Ω',pointName:'绝缘电阻'},
|
||||
baseInfoList: [],
|
||||
infoData: [
|
||||
{label: '簇电压', attr: 'clusterVoltage', unit: 'V', pointName: '簇电压'},
|
||||
{label: '可充电量', attr: 'chargeableCapacity', unit: 'kWh', pointName: '可充电量'},
|
||||
{label: '累计充电量', attr: 'totalChargedCapacity', unit: 'kWh', pointName: '累计充电量'},
|
||||
{label: '簇电流', attr: 'clusterCurrent', unit: 'A', pointName: '簇电流'},
|
||||
{label: '可放电量', attr: 'dischargeableCapacity', unit: 'kWh', pointName: '可放电量'},
|
||||
{label: '累计放电量', attr: 'totalDischargedCapacity', unit: 'kWh', pointName: '累计放电量'},
|
||||
{label: 'SOH', attr: 'soh', unit: '%', pointName: 'SOH'},
|
||||
{label: '平均温度', attr: 'averageTemperature', unit: '℃', pointName: '平均温度'},
|
||||
{label: '绝缘电阻', attr: 'insulationResistance', unit: 'Ω', pointName: '绝缘电阻'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
handleCardClass(item) {
|
||||
const {workStatus = ''} = item
|
||||
return !(Object.keys(this.CLUSTERWorkStatusOptions).includes(item.workStatus)) ? "timing-card-container" : workStatus === '9' ? 'warning-card-container' : 'running-card-container'
|
||||
},
|
||||
// 查看设备电位表格
|
||||
pointDetail(row,dataType){
|
||||
const {siteId,deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId,deviceId,deviceCategory:'CLUSTER'},dataType)
|
||||
pointDetail(row, dataType) {
|
||||
const {siteId, deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId, deviceId, deviceCategory: 'CLUSTER'}, dataType)
|
||||
},
|
||||
showChart(pointName,deviceId){
|
||||
pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'CLUSTER',deviceId})
|
||||
showChart(pointName, deviceId) {
|
||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'CLUSTER', deviceId})
|
||||
},
|
||||
updateData(){
|
||||
updateData() {
|
||||
this.loading = true
|
||||
getBMSBatteryCluster(this.siteId).then(response => {
|
||||
this.baseInfoList = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {this.loading = false})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
init(){
|
||||
init() {
|
||||
this.updateData()
|
||||
this.updateInterval(this.updateData)
|
||||
}
|
||||
@ -166,28 +204,32 @@ export default {
|
||||
<style scoped lang="scss">
|
||||
::v-deep {
|
||||
//描述列表样式
|
||||
.descriptions-main{
|
||||
padding:24px 300px 24px 24px;
|
||||
.descriptions-main {
|
||||
padding: 24px 300px 24px 24px;
|
||||
}
|
||||
.descriptions-main-bottom{
|
||||
padding:14px 300px 14px 24px;
|
||||
|
||||
.descriptions-main-bottom {
|
||||
padding: 14px 300px 14px 24px;
|
||||
}
|
||||
}
|
||||
|
||||
// 进度条样式
|
||||
.process-container{
|
||||
width:100px;
|
||||
.process-container {
|
||||
width: 100px;
|
||||
position: absolute;
|
||||
right:70px;
|
||||
top:50%;
|
||||
right: 70px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
.process-line-bg{
|
||||
|
||||
.process-line-bg {
|
||||
position: relative;
|
||||
width:100%;
|
||||
width: 100%;
|
||||
height: 110px;
|
||||
background-color:#fff2cb ;
|
||||
background-color: #fff2cb;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 0 10px #fff2cb, 0 0 0 rgba(255, 242, 203, 0.5);
|
||||
.process-line{
|
||||
|
||||
.process-line {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
@ -198,9 +240,10 @@ export default {
|
||||
box-shadow: 0 0 10px #ffbf14, 0 0 0 rgba(255, 191, 20, 0.5);
|
||||
}
|
||||
}
|
||||
.process{
|
||||
margin-top:15px;
|
||||
color:#666666;
|
||||
|
||||
.process {
|
||||
margin-top: 15px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<div v-for="(baseInfo,index) in baseInfoList" :key="index+'bmszlContainer'" style="margin-bottom:25px;">
|
||||
<el-card :class="{
|
||||
'warning-card-container':baseInfo.workStatus && baseInfo.workStatus !== '0',
|
||||
'running-card-container':baseInfo.workStatus === '0'
|
||||
}" class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
||||
shadow="always">
|
||||
<el-card
|
||||
:class="handleCardClass(baseInfo)"
|
||||
class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
||||
shadow="always">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{baseInfo.deviceName}}</span>
|
||||
<span class="large-title">{{ baseInfo.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>数据更新时间:{{ baseInfo.dataUpdateTime || '-'}}</div>
|
||||
<div>数据更新时间:{{ baseInfo.dataUpdateTime || '-' }}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" size="small" style="margin-right:20px;" @click="pointDetail(baseInfo,'point')">详细</el-button>
|
||||
<el-badge :value="baseInfo.alarmNum || 0" class="item">
|
||||
<el-button type="primary" round size="small" style="margin-right:20px;"
|
||||
@click="pointDetail(baseInfo,'point')">详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!baseInfo.alarmNum" :value="baseInfo.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(baseInfo,'alarmPoint')"
|
||||
@ -24,16 +24,28 @@
|
||||
</div>
|
||||
<div class="descriptions-main">
|
||||
<el-descriptions :colon="false" :column="3" direction="vertical">
|
||||
<el-descriptions-item :contentClassName="`descriptions-direction ${baseInfo.workStatus === '0' ? 'save' :'danger'}`" :span="1" label="工作状态" labelClassName="descriptions-label" >{{$store.state.ems.workStatusOptions[baseInfo.workStatus]}}</el-descriptions-item>
|
||||
<el-descriptions-item :span="1" contentClassName="descriptions-direction" label="与PCS通信" labelClassName="descriptions-label">{{$store.state.ems.communicationStatusOptions[baseInfo.pcsCommunicationStatus]}}</el-descriptions-item>
|
||||
<el-descriptions-item :span="1" contentClassName="descriptions-direction" label="与EMS通信" labelClassName="descriptions-label">{{$store.state.ems.communicationStatusOptions[baseInfo.emsCommunicationStatus]}}</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
contentClassName="descriptions-direction work-status"
|
||||
label="工作状态" labelClassName="descriptions-label">
|
||||
{{ STACKWorkStatusOptions[baseInfo.workStatus] }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="1" contentClassName="descriptions-direction" label="与PCS通信"
|
||||
labelClassName="descriptions-label">
|
||||
{{ $store.state.ems.communicationStatusOptions[baseInfo.pcsCommunicationStatus] }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="1" contentClassName="descriptions-direction" label="与EMS通信"
|
||||
labelClassName="descriptions-label">
|
||||
{{ $store.state.ems.communicationStatusOptions[baseInfo.emsCommunicationStatus] }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="descriptions-main descriptions-main-bg-color">
|
||||
<el-descriptions :colon="false" :column="3" direction="vertical">
|
||||
<el-descriptions-item v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :label="item.label" :span="1" contentClassName="descriptions-direction" labelClassName="descriptions-label">
|
||||
<span class="pointer" @click="showChart(item.pointName || '',baseInfo.deviceId)">
|
||||
{{baseInfo[item.attr] | formatNumber}}<span v-if="item.unit" v-html="item.unit"></span>
|
||||
<el-descriptions-item v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :label="item.label"
|
||||
:span="1" contentClassName="descriptions-direction"
|
||||
labelClassName="descriptions-label">
|
||||
<span class="pointer" @click="showChart(item.pointName || '',baseInfo.deviceId)">
|
||||
{{ baseInfo[item.attr] | formatNumber }}<span v-if="item.unit" v-html="item.unit"></span>
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
@ -42,80 +54,97 @@
|
||||
<div class="process-line-bg">
|
||||
<div :style="{height:baseInfo.stackSoc+'%'}" class="process-line"></div>
|
||||
</div>
|
||||
<div class="process pointer" @click="showChart('当前SOC',baseInfo.deviceId)">当前SOC : {{baseInfo.stackSoc}}%</div>
|
||||
<div class="process pointer" @click="showChart('当前SOC',baseInfo.deviceId)">当前SOC :
|
||||
{{ baseInfo.stackSoc }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="baseInfo.batteryDataList"
|
||||
class="common-table"
|
||||
max-height="500"
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
:data="baseInfo.batteryDataList"
|
||||
class="common-table"
|
||||
max-height="500"
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
<el-table-column
|
||||
label="簇号"
|
||||
prop="clusterId">
|
||||
label="簇号"
|
||||
prop="clusterId">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="簇电压"
|
||||
label="簇电压"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart('簇电压',scope.row.clusterId,'CLUSTER')">{{scope.row.clusterVoltage}} V</span>
|
||||
<span class="pointer"
|
||||
@click="showChart('簇电压',scope.row.clusterId,'CLUSTER')">{{ scope.row.clusterVoltage }} V</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="簇电流">
|
||||
label="簇电流">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart('簇电流',scope.row.clusterId,'CLUSTER')">{{scope.row.clusterCurrent}} A</span>
|
||||
<span class="pointer"
|
||||
@click="showChart('簇电流',scope.row.clusterId,'CLUSTER')">{{ scope.row.clusterCurrent }} A</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="簇SOC">
|
||||
label="簇SOC">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart('当前SOC',scope.row.clusterId,'CLUSTER')">{{scope.row.currentSoc}} %</span>
|
||||
<span class="pointer"
|
||||
@click="showChart('当前SOC',scope.row.clusterId,'CLUSTER')">{{ scope.row.currentSoc }} %</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="单体最高电压"
|
||||
prop="maxVoltage">
|
||||
label="单体最高电压"
|
||||
prop="maxVoltage">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart('最高单体电压',scope.row.clusterId,'CLUSTER')">{{scope.row.maxCellVoltage}} V</span>
|
||||
<span class="pointer"
|
||||
@click="showChart('最高单体电压',scope.row.clusterId,'CLUSTER')">{{
|
||||
scope.row.maxCellVoltage
|
||||
}} V</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="电池号码"
|
||||
prop="maxCellVoltageId">
|
||||
label="电池号码"
|
||||
prop="maxCellVoltageId">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="单体最低电压"
|
||||
prop="minVoltage">
|
||||
label="单体最低电压"
|
||||
prop="minVoltage">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart('最低单体电压',scope.row.clusterId,'CLUSTER')">{{scope.row.minCellVoltage}} V</span>
|
||||
<span class="pointer"
|
||||
@click="showChart('最低单体电压',scope.row.clusterId,'CLUSTER')">{{
|
||||
scope.row.minCellVoltage
|
||||
}} V</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="电池号码"
|
||||
prop="minCellVoltageId">
|
||||
label="电池号码"
|
||||
prop="minCellVoltageId">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="单体最高温度">
|
||||
label="单体最高温度">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart('最高单体温度',scope.row.clusterId,'CLUSTER')">{{scope.row.maxCellTemp}} ℃</span>
|
||||
<span class="pointer"
|
||||
@click="showChart('最高单体温度',scope.row.clusterId,'CLUSTER')">{{
|
||||
scope.row.maxCellTemp
|
||||
}} ℃</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="电池号码"
|
||||
prop="maxCellTempId">
|
||||
label="电池号码"
|
||||
prop="maxCellTempId">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="单体最低温度"
|
||||
prop="minTemperature">
|
||||
label="单体最低温度"
|
||||
prop="minTemperature">
|
||||
<template slot-scope="scope">
|
||||
<span class="pointer" @click="showChart('最低单体温度',scope.row.clusterId,'CLUSTER')">{{scope.row.minCellTemp}} ℃</span>
|
||||
<span class="pointer"
|
||||
@click="showChart('最低单体温度',scope.row.clusterId,'CLUSTER')">{{
|
||||
scope.row.minCellTemp
|
||||
}} ℃</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="电池号码"
|
||||
prop="minCellTempId">
|
||||
label="电池号码"
|
||||
prop="minCellTempId">
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
@ -133,43 +162,57 @@ import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
import pointChart from "./../PointChart.vue";
|
||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name:'DzjkSbjkBmszl',
|
||||
components: {pointChart,PointTable},
|
||||
mixins:[getQuerySiteId,intervalUpdate],
|
||||
name: 'DzjkSbjkBmszl',
|
||||
components: {pointChart, PointTable},
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
computed: {
|
||||
...mapState({
|
||||
STACKWorkStatusOptions: state => state?.ems?.STACKWorkStatusOptions || {},
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
baseInfoList:[],
|
||||
infoData:[
|
||||
{label:'电池堆总电压',attr:'stackVoltage',unit:'V',pointName:'电池堆电压'},
|
||||
{label:'可充电量',attr:'availableChargeCapacity',unit:'kWh',pointName:'可充电量'},
|
||||
{label:'累计充电量',attr:'totalChargeCapacity',unit:'kWh',pointName:'累计充电量'},
|
||||
{label:'电池堆总电流',attr:'stackCurrent',unit:'A',pointName:'电池堆总电流'},
|
||||
{label:'可放电量',attr:'availableDischargeCapacity',unit:'kWh',pointName:'可放电量'},
|
||||
{label:'累计放电量',attr:'totalDischargeCapacity',unit:'kWh',pointName:'累计放电量'},
|
||||
{label:'SOH',attr:'stackSoh',unit:'%',pointName:'SOH'},
|
||||
{label:'平均温度',attr:'operatingTemp',unit:'℃',pointName:'平均温度'},
|
||||
{label:'绝缘电阻',attr:'stackInsulationResistance',unit:'Ω',pointName:'绝缘电阻'},
|
||||
loading: false,
|
||||
baseInfoList: [],
|
||||
infoData: [
|
||||
{label: '电池堆总电压', attr: 'stackVoltage', unit: 'V', pointName: '电池堆电压'},
|
||||
{label: '可充电量', attr: 'availableChargeCapacity', unit: 'kWh', pointName: '可充电量'},
|
||||
{label: '累计充电量', attr: 'totalChargeCapacity', unit: 'kWh', pointName: '累计充电量'},
|
||||
{label: '电池堆总电流', attr: 'stackCurrent', unit: 'A', pointName: '电池堆总电流'},
|
||||
{label: '可放电量', attr: 'availableDischargeCapacity', unit: 'kWh', pointName: '可放电量'},
|
||||
{label: '累计放电量', attr: 'totalDischargeCapacity', unit: 'kWh', pointName: '累计放电量'},
|
||||
{label: 'SOH', attr: 'stackSoh', unit: '%', pointName: 'SOH'},
|
||||
{label: '平均温度', attr: 'operatingTemp', unit: '℃', pointName: '平均温度'},
|
||||
{label: '绝缘电阻', attr: 'stackInsulationResistance', unit: 'Ω', pointName: '绝缘电阻'},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
handleCardClass(item) {
|
||||
const {workStatus = ''} = item
|
||||
return !Object.keys(this.STACKWorkStatusOptions).find(i => i === workStatus) ? "timing-card-container" : workStatus === '9' ? 'warning-card-container' : 'running-card-container'
|
||||
},
|
||||
|
||||
// 查看设备电位表格
|
||||
pointDetail(row,dataType){
|
||||
const {siteId,deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId,deviceId,deviceCategory:'STACK'},dataType)
|
||||
pointDetail(row, dataType) {
|
||||
const {siteId, deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId, deviceId, deviceCategory: 'STACK'}, dataType)
|
||||
},
|
||||
showChart(pointName,deviceId,deviceCategory = 'STACK'){
|
||||
pointName && this.$refs.pointChart.showChart({pointName,deviceCategory,deviceId})
|
||||
showChart(pointName, deviceId, deviceCategory = 'STACK') {
|
||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory, deviceId})
|
||||
},
|
||||
updateData(){
|
||||
updateData() {
|
||||
this.loading = true
|
||||
getBMSOverView(this.siteId).then(response => {
|
||||
this.baseInfoList = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {this.loading = false})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
init(){
|
||||
init() {
|
||||
this.updateData()
|
||||
this.updateInterval(this.updateData)
|
||||
}
|
||||
@ -189,21 +232,24 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 进度条样式
|
||||
.process-container{
|
||||
width:100px;
|
||||
.process-container {
|
||||
width: 100px;
|
||||
position: absolute;
|
||||
right:70px;
|
||||
top:50%;
|
||||
right: 70px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
.process-line-bg{
|
||||
|
||||
.process-line-bg {
|
||||
position: relative;
|
||||
width:100%;
|
||||
width: 100%;
|
||||
height: 110px;
|
||||
background-color:#fff2cb ;
|
||||
background-color: #fff2cb;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 0 10px #fff2cb, 0 0 0 rgba(255, 242, 203, 0.5);
|
||||
.process-line{
|
||||
|
||||
.process-line {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
@ -214,9 +260,10 @@ export default {
|
||||
box-shadow: 0 0 10px rgb(252 108 108), 0 0 0 rgba(252, 108, 108, 0.5);
|
||||
}
|
||||
}
|
||||
.process{
|
||||
margin-top:15px;
|
||||
color:#666666;
|
||||
|
||||
.process {
|
||||
margin-top: 15px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,45 +1,49 @@
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'dbList'"
|
||||
shadow="always"
|
||||
class="sbjk-card-container list"
|
||||
:class="{
|
||||
'warning-card-container':item.emsCommunicationStatus && item.emsCommunicationStatus !== '0',
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'dbList'"
|
||||
shadow="always"
|
||||
class="sbjk-card-container list"
|
||||
:class="{
|
||||
'timing-card-container':!['0','2'].includes(item.emsCommunicationStatus),
|
||||
'warning-card-container':item.emsCommunicationStatus === '2',
|
||||
'running-card-container':item.emsCommunicationStatus === '0'
|
||||
}"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="large-title">{{ item.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>
|
||||
{{
|
||||
$store.state.ems.communicationStatusOptions[
|
||||
item.emsCommunicationStatus
|
||||
]
|
||||
}}
|
||||
</div>
|
||||
<div>数据更新时间:{{ item.dataUpdateTime }}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">详细</el-button>
|
||||
<el-badge :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in deviceIdTypeMsg[item.deviceId]" :key="tempDataIndex+'dbTempData'" :span="8" class="device-info-col">
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="large-title">{{ item.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>
|
||||
{{
|
||||
communicationStatusOptions[item.emsCommunicationStatus] || '-'
|
||||
}}
|
||||
</div>
|
||||
<div>数据更新时间:{{ item.dataUpdateTime || '-' }}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" round size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">
|
||||
详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!item.alarmNum" :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in (deviceIdTypeMsg[item.deviceId] || otherTypeMsg)"
|
||||
:key="tempDataIndex+'dbTempData'"
|
||||
:span="8" class="device-info-col">
|
||||
<span class="pointer" @click="showChart(tempDataItem.pointName,item.deviceId)">
|
||||
<span class="left">{{tempDataItem.name}}</span> <span class="right">{{item[tempDataItem.attr]}}<span v-html="tempDataItem.unit"></span></span>
|
||||
<span class="left">{{ tempDataItem.name }}</span> <span class="right">{{ item[tempDataItem.attr] || '-' }}<span
|
||||
v-html="tempDataItem.unit"></span></span>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
@ -49,117 +53,161 @@
|
||||
<script>
|
||||
import pointChart from "./../PointChart.vue";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getAmmeterDataList } from "@/api/ems/dzjk";
|
||||
import {getAmmeterDataList} from "@/api/ems/dzjk";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "DzjkSbjkDb",
|
||||
mixins: [getQuerySiteId,intervalUpdate],
|
||||
components:{PointTable, pointChart},
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
components: {PointTable, pointChart},
|
||||
computed: {
|
||||
|
||||
...mapState({
|
||||
communicationStatusOptions: state => state?.ems?.communicationStatusOptions || {},
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
list:[],
|
||||
deviceIdTypeMsg:{
|
||||
'LOAD':[
|
||||
list: [],
|
||||
deviceIdTypeMsg: {
|
||||
'LOAD': [
|
||||
{
|
||||
name:'正向有功电能',
|
||||
attr:'forwardActive',
|
||||
pointName:'正向有功电能'
|
||||
name: '正向有功电能',
|
||||
attr: 'forwardActive',
|
||||
pointName: '正向有功电能',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
name:'反向有功电能',
|
||||
attr:'reverseActive',
|
||||
pointName:'反向有功电能'
|
||||
name: '反向有功电能',
|
||||
attr: 'reverseActive',
|
||||
pointName: '反向有功电能',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
name:'正向无功电能',
|
||||
attr:'forwardReactive',
|
||||
pointName:'正向无功电能'
|
||||
name: '正向无功电能',
|
||||
attr: 'forwardReactive',
|
||||
pointName: '正向无功电能',
|
||||
unit: 'kvarh'
|
||||
},
|
||||
{
|
||||
name:'反向无功电能',
|
||||
attr:'reverseReactive',
|
||||
pointName:'反向无功电能'
|
||||
name: '反向无功电能',
|
||||
attr: 'reverseReactive',
|
||||
pointName: '反向无功电能',
|
||||
unit: 'kvarh'
|
||||
},
|
||||
{
|
||||
name:'有功功率',
|
||||
attr:'activePower',
|
||||
pointName:'总有功功率'
|
||||
name: '有功功率',
|
||||
attr: 'activePower',
|
||||
pointName: '总有功功率',
|
||||
unit: 'kW'
|
||||
},
|
||||
{
|
||||
name:'无功功率',
|
||||
attr:'reactivePower',
|
||||
pointName:'总无功功率'
|
||||
name: '无功功率',
|
||||
attr: 'reactivePower',
|
||||
pointName: '总无功功率',
|
||||
unit: 'kvar'
|
||||
}
|
||||
],
|
||||
'METE':[
|
||||
'METE': [
|
||||
{
|
||||
name:'正向有功电能',
|
||||
attr:'forwardActive',
|
||||
pointName:'正向有功电能'
|
||||
name: '正向有功电能',
|
||||
attr: 'forwardActive',
|
||||
pointName: '正向有功电能',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
name:'反向有功电能',
|
||||
attr:'reverseActive',
|
||||
pointName:'反向有功电能'
|
||||
name: '反向有功电能',
|
||||
attr: 'reverseActive',
|
||||
pointName: '反向有功电能',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
name:'正向无功电能',
|
||||
attr:'forwardReactive',
|
||||
pointName:'正向无功电能'
|
||||
name: '正向无功电能',
|
||||
attr: 'forwardReactive',
|
||||
pointName: '正向无功电能',
|
||||
unit: 'kvarh'
|
||||
},
|
||||
{
|
||||
name:'反向无功电能',
|
||||
attr:'reverseReactive',
|
||||
pointName:'反向无功电能'
|
||||
name: '反向无功电能',
|
||||
attr: 'reverseReactive',
|
||||
pointName: '反向无功电能',
|
||||
unit: 'kvarh'
|
||||
},
|
||||
{
|
||||
name:'有功功率',
|
||||
attr:'activePower',
|
||||
pointName:'总有功功率'
|
||||
name: '有功功率',
|
||||
attr: 'activePower',
|
||||
pointName: '总有功功率',
|
||||
unit: 'kW'
|
||||
},
|
||||
{
|
||||
name:'无功功率',
|
||||
attr:'reactivePower',
|
||||
pointName:'总无功功率'
|
||||
name: '无功功率',
|
||||
attr: 'reactivePower',
|
||||
pointName: '总无功功率',
|
||||
unit: 'kvar'
|
||||
}
|
||||
],
|
||||
'METEGF':[
|
||||
'METEGF': [
|
||||
{
|
||||
name:'有功电能',
|
||||
attr:'activeEnergy',
|
||||
pointName:'有功电能'
|
||||
name: '有功电能',
|
||||
attr: 'activeEnergy',
|
||||
pointName: '有功电能',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
name:'无功电能',
|
||||
attr:'reactiveEnergy',
|
||||
pointName:'无功电能'
|
||||
name: '无功电能',
|
||||
attr: 'reactiveEnergy',
|
||||
pointName: '无功电能',
|
||||
unit: 'kvarh'
|
||||
},
|
||||
{
|
||||
name:'有功功率',
|
||||
attr:'activePower',
|
||||
pointName:'总有功功率'
|
||||
name: '有功功率',
|
||||
attr: 'activePower',
|
||||
pointName: '总有功功率',
|
||||
unit: 'kW'
|
||||
},
|
||||
{
|
||||
name:'无功功率',
|
||||
attr:'reactivePower',
|
||||
pointName:'总无功功率'
|
||||
name: '无功功率',
|
||||
attr: 'reactivePower',
|
||||
pointName: '总无功功率',
|
||||
unit: 'kvar'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
otherTypeMsg: [
|
||||
{
|
||||
name: '正向有功电能',
|
||||
attr: 'forwardActive',
|
||||
pointName: '正向有功电能',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
name: '反向有功电能',
|
||||
attr: 'reverseActive',
|
||||
pointName: '反向有功电能',
|
||||
unit: 'kWh'
|
||||
},
|
||||
{
|
||||
name: '有功功率',
|
||||
attr: 'activePower',
|
||||
pointName: '总有功功率',
|
||||
unit: 'kW'
|
||||
},
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 查看设备电位表格
|
||||
pointDetail(row,dataType){
|
||||
pointDetail(row, dataType) {
|
||||
const {deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId:this.siteId,deviceId,deviceCategory:'AMMETER'},dataType)
|
||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'AMMETER'}, dataType)
|
||||
},
|
||||
showChart(pointName,deviceId){
|
||||
pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'AMMETER',deviceId})
|
||||
showChart(pointName, deviceId) {
|
||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'AMMETER', deviceId})
|
||||
},
|
||||
updateData(){
|
||||
updateData() {
|
||||
this.loading = true;
|
||||
getAmmeterDataList(this.siteId)
|
||||
.then((response) => {
|
||||
@ -174,13 +222,14 @@ export default {
|
||||
this.updateInterval(this.updateData)
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
mounted() {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sbjk-card-container {
|
||||
&.list:not(:last-child){
|
||||
&.list:not(:last-child) {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,38 +1,42 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'ylLise'"
|
||||
class="sbjk-card-container running-card-container"
|
||||
shadow="always">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{item.deviceName}}</span>
|
||||
<div class="info">
|
||||
<div>数据更新时间:{{ item.dataUpdateTime || '-'}}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">详细</el-button>
|
||||
<el-badge :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
<div v-loading="loading">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'ylLise'"
|
||||
class="sbjk-card-container running-card-container"
|
||||
shadow="always">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{ item.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>数据更新时间:{{ item.dataUpdateTime || '-' }}</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'hdTempData'" :span="12" class="device-info-col">
|
||||
<div class="alarm">
|
||||
<el-button type="primary" round size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">
|
||||
详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!item.alarmNum" :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'hdTempData'" :span="12"
|
||||
class="device-info-col">
|
||||
<span class="pointer" @click="showChart(tempDataItem.title,item.deviceId)">
|
||||
<span class="left">{{tempDataItem.title}}</span> <span class="right">{{item[tempDataItem.attr]}}<span v-html="tempDataItem.unit"></span></span>
|
||||
<span class="left">{{ tempDataItem.title }}</span> <span
|
||||
class="right">{{ item[tempDataItem.attr] || '-' }}<span
|
||||
v-html="tempDataItem.unit"></span></span>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -42,66 +46,73 @@ import {getDhDataList} from '@/api/ems/dzjk'
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
import pointChart from "./../PointChart.vue";
|
||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
|
||||
export default {
|
||||
name:'DzjkSbjkDh',
|
||||
mixins:[getQuerySiteId,intervalUpdate],
|
||||
components:{pointChart,PointTable},
|
||||
name: 'DzjkSbjkDh',
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
components: {pointChart, PointTable},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
list:[],
|
||||
tempData:[
|
||||
{title:'湿度',attr:'humidity',unit:'℃'},
|
||||
{title:'温度',attr:'temperature',unit:''},
|
||||
loading: false,
|
||||
list: [],
|
||||
tempData: [
|
||||
{title: '湿度', attr: 'humidity', unit: ''},
|
||||
{title: '温度', attr: 'temperature', unit: '℃'},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
// 查看设备电位表格
|
||||
pointDetail(row,dataType){
|
||||
pointDetail(row, dataType) {
|
||||
const {deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId:this.siteId,deviceId,deviceCategory:'DH'},dataType)
|
||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'DH'}, dataType)
|
||||
},
|
||||
showChart(pointName,deviceId){
|
||||
pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'DH',deviceId})
|
||||
showChart(pointName, deviceId) {
|
||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'DH', deviceId})
|
||||
},
|
||||
updateData(){
|
||||
updateData() {
|
||||
this.loading = true
|
||||
getDhDataList(this.siteId).then(response => {
|
||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {this.loading = false})
|
||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
init(){
|
||||
init() {
|
||||
this.updateData()
|
||||
this.updateInterval(this.updateData)
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
mounted() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sbjk-card-container{
|
||||
&:not(:last-child){
|
||||
.sbjk-card-container {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.el-row{
|
||||
|
||||
.el-row {
|
||||
background-color: #ffffff;
|
||||
border:1px solid #eeeeee;
|
||||
border: 1px solid #eeeeee;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
color: #333333;
|
||||
.el-col{
|
||||
padding:12px 0;
|
||||
|
||||
.el-col {
|
||||
padding: 12px 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
.el-col{
|
||||
|
||||
.el-col {
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
}
|
||||
.el-col:not(:nth-child(3n)){
|
||||
|
||||
.el-col:not(:nth-child(3n)) {
|
||||
border-right: 1px solid #eeeeee;
|
||||
}
|
||||
}
|
||||
|
||||
133
src/views/ems/dzjk/sbjk/ems/index.vue
Normal file
133
src/views/ems/dzjk/sbjk/ems/index.vue
Normal file
@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<div v-loading="loading" class="ems">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'emsList'"
|
||||
class="sbjk-card-container list running-card-container"
|
||||
shadow="always"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="large-title">{{ item.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>
|
||||
EMS控制模式: {{
|
||||
item.emsStatus === 0 ? '自动' : '手动'
|
||||
}}
|
||||
</div>
|
||||
<div>数据更新时间:{{ item.dataUpdateTime }}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button size="small" round style="margin-right:20px;" type="primary" @click="pointDetail(item,'point')">详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!item.alarmNum" :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in bmsDataList" :key="tempDataIndex+'bmsTempData'"
|
||||
:span="6" class="device-info-col">
|
||||
<span class="pointer" @click="showChart(tempDataItem.name,item.deviceId)">
|
||||
<span class="left">{{ tempDataItem.name }}</span> <span class="right">{{ item[tempDataItem.attr] }}<span
|
||||
v-html="tempDataItem.unit"></span></span>
|
||||
</span>
|
||||
</el-col>
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in pcsDataList" :key="tempDataIndex+'pcsTempData'"
|
||||
:span="6" class="device-info-col">
|
||||
<span class="pointer" @click="showChart(tempDataItem.name,item.deviceId)">
|
||||
<span class="left">{{ tempDataItem.name }}</span> <span class="right">{{ item[tempDataItem.attr] }}<span
|
||||
v-html="tempDataItem.unit"></span></span>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-empty v-show="list.length <= 0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pointChart from "./../PointChart.vue";
|
||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import {getEmsDataList} from "@/api/ems/dzjk";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
|
||||
export default {
|
||||
name: "DzjkSbjkEms",
|
||||
components: {pointChart, PointTable},
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
list: [],
|
||||
bmsDataList: [{
|
||||
name: 'BMS1SOC',
|
||||
attr: 'bms1Soc'
|
||||
},
|
||||
{
|
||||
name: 'BMS2SOC',
|
||||
attr: 'bms2Soc'
|
||||
},
|
||||
{
|
||||
name: 'BMS3SOC',
|
||||
attr: 'bms3Soc'
|
||||
},
|
||||
{
|
||||
name: 'BMS4SOC',
|
||||
attr: 'bms4Soc'
|
||||
}],
|
||||
pcsDataList: [{
|
||||
name: 'PCS-1有功功率',
|
||||
attr: 'pcs1Yggl'
|
||||
},
|
||||
{
|
||||
name: 'PCS-2有功功率',
|
||||
attr: 'pcs2Yggl'
|
||||
},
|
||||
{
|
||||
name: 'PCS-3有功功率',
|
||||
attr: 'pcs3Yggl'
|
||||
},
|
||||
{
|
||||
name: 'PCS-4有功功率',
|
||||
attr: 'pcs4Yggl'
|
||||
}]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 查看设备电位表格
|
||||
pointDetail(row, dataType) {
|
||||
const {deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'EMS'}, dataType)
|
||||
},
|
||||
showChart(pointName, deviceId) {
|
||||
pointName &&
|
||||
this.$refs.pointChart.showChart({pointName, deviceCategory: 'EMS', deviceId});
|
||||
},
|
||||
getData() {
|
||||
this.loading = true;
|
||||
getEmsDataList(this.siteId)
|
||||
.then((response) => {
|
||||
const data = response?.data || {};
|
||||
this.list = JSON.parse(JSON.stringify(data));
|
||||
})
|
||||
.finally(() => (this.loading = false));
|
||||
},
|
||||
updateData() {
|
||||
this.getData();
|
||||
},
|
||||
init() {
|
||||
this.updateData();
|
||||
this.updateInterval(this.updateData);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@ -1,41 +1,46 @@
|
||||
<template>
|
||||
<div v-loading="loading" class="pcs-ems-dashboard-editor-container">
|
||||
<!-- 顶部六个方块-->
|
||||
<real-time-base-info :data="runningHeadData" />
|
||||
<real-time-base-info :data="runningHeadData"/>
|
||||
<div
|
||||
v-for="(pcsItem, pcsIndex) in pcsList"
|
||||
:key="pcsIndex + 'PcsHome'"
|
||||
style="margin-bottom: 25px"
|
||||
v-for="(pcsItem, pcsIndex) in pcsList"
|
||||
:key="pcsIndex + 'PcsHome'"
|
||||
style="margin-bottom: 25px"
|
||||
>
|
||||
<el-card
|
||||
:class="{
|
||||
'warning-card-container': pcsItem.workStatus === '1',
|
||||
'timing-card-container': pcsItem.workStatus === '2',
|
||||
'running-card-container': !['1', '2'].includes(pcsItem.workStatus),
|
||||
}"
|
||||
class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
||||
shadow="always"
|
||||
:class="handleCardClass(pcsItem)"
|
||||
class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
||||
shadow="always"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="large-title"
|
||||
>{{ pcsItem.deviceName }}</span
|
||||
>{{ pcsItem.deviceName }}</span
|
||||
>
|
||||
<div class="info">
|
||||
<div>
|
||||
{{
|
||||
$store.state.ems.communicationStatusOptions[
|
||||
pcsItem.communicationStatus
|
||||
]
|
||||
pcsItem.communicationStatus
|
||||
]
|
||||
}}
|
||||
</div>
|
||||
<div>数据更新时间:{{ pcsItem.dataUpdateTime }}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" size="small" style="margin-right:20px;" @click="pointDetail(pcsItem,'point')">详细</el-button>
|
||||
<el-badge :value="pcsItem.alarmNum || 0" class="item">
|
||||
<pcs-switch style="margin-right:10px;"
|
||||
:round="true"
|
||||
size="small"
|
||||
type="danger"
|
||||
:data="pcsItem"
|
||||
@updateSuccess="init"/>
|
||||
<el-button type="primary" round size="small" style="margin-right:20px;"
|
||||
@click="pointDetail(pcsItem,'point')">
|
||||
详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!pcsItem.alarmNum" :value="pcsItem.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(pcsItem,'alarmPoint')"
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(pcsItem,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
@ -43,64 +48,66 @@
|
||||
<div class="descriptions-main">
|
||||
<el-descriptions :colon="false" :column="4" direction="vertical">
|
||||
<el-descriptions-item
|
||||
:contentClassName="`descriptions-direction ${
|
||||
pcsItem.workStatus === '0' ? 'save' : 'danger'
|
||||
}`"
|
||||
:span="1"
|
||||
label="工作状态"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
$store.state.ems.workStatusOptions[pcsItem.workStatus]
|
||||
}}</el-descriptions-item
|
||||
contentClassName="descriptions-direction work-status"
|
||||
:span="1"
|
||||
label="工作状态"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
PCSWorkStatusOptions[pcsItem.workStatus]
|
||||
}}
|
||||
</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="并网状态"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="并网状态"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
$store.state.ems.gridStatusOptions[pcsItem.gridStatus]
|
||||
}}</el-descriptions-item
|
||||
}}
|
||||
</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item
|
||||
:contentClassName="`descriptions-direction ${
|
||||
pcsItem.deviceStatus === '2' ? 'save' : 'danger'
|
||||
:contentClassName="`descriptions-direction ${
|
||||
pcsItem.deviceStatus === '1' ? 'save' : 'danger'
|
||||
}`"
|
||||
:span="1"
|
||||
label="设备状态"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
:span="1"
|
||||
label="设备状态"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
$store.state.ems.deviceStatusOptions[pcsItem.deviceStatus]
|
||||
}}</el-descriptions-item
|
||||
}}
|
||||
</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="控制模式"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="控制模式"
|
||||
labelClassName="descriptions-label"
|
||||
>{{
|
||||
$store.state.ems.controlModeOptions[pcsItem.controlMode]
|
||||
}}</el-descriptions-item
|
||||
}}
|
||||
</el-descriptions-item
|
||||
>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="descriptions-main descriptions-main-bg-color">
|
||||
<el-descriptions
|
||||
:colon="false"
|
||||
:column="4"
|
||||
contentClassName="descriptions-direction"
|
||||
direction="vertical"
|
||||
labelClassName="descriptions-label"
|
||||
:colon="false"
|
||||
:column="4"
|
||||
contentClassName="descriptions-direction"
|
||||
direction="vertical"
|
||||
labelClassName="descriptions-label"
|
||||
>
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in infoData"
|
||||
:key="index + 'pcsInfoData'"
|
||||
:label="item.label"
|
||||
:span="1"
|
||||
v-for="(item, index) in infoData"
|
||||
:key="index + 'pcsInfoData'"
|
||||
:label="item.label"
|
||||
:span="1"
|
||||
>
|
||||
<span
|
||||
class="pointer"
|
||||
@click="
|
||||
class="pointer"
|
||||
@click="
|
||||
showChart(item.pointName || '', pcsItem.deviceId)
|
||||
"
|
||||
>
|
||||
@ -111,58 +118,59 @@
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div
|
||||
v-for="(item, index) in pcsItem.pcsBranchInfoList"
|
||||
:key="index + 'pcsBranchInfoList'"
|
||||
class="descriptions-main"
|
||||
v-for="(item, index) in pcsItem.pcsBranchInfoList"
|
||||
:key="index + 'pcsBranchInfoList'"
|
||||
class="descriptions-main"
|
||||
>
|
||||
<el-descriptions
|
||||
:colon="false"
|
||||
:column="4"
|
||||
contentClassName="descriptions-direction keep"
|
||||
direction="vertical"
|
||||
labelClassName="descriptions-label"
|
||||
:colon="false"
|
||||
:column="4"
|
||||
contentClassName="descriptions-direction keep"
|
||||
direction="vertical"
|
||||
labelClassName="descriptions-label"
|
||||
>
|
||||
<el-descriptions-item
|
||||
:label="'支路' + (index + 1)"
|
||||
:span="4"
|
||||
contentClassName="descriptions-direction keep"
|
||||
labelClassName="descriptions-label"
|
||||
>{{ item.dischargeStatus }}</el-descriptions-item
|
||||
:label="'支路' + (index + 1)"
|
||||
:span="4"
|
||||
contentClassName="descriptions-direction keep"
|
||||
labelClassName="descriptions-label"
|
||||
>{{ item.dischargeStatus }}
|
||||
</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="直流功率"
|
||||
labelClassName="descriptions-label"
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="直流功率"
|
||||
labelClassName="descriptions-label"
|
||||
>
|
||||
<span
|
||||
class="pointer"
|
||||
@click="showChart('直流功率', item.deviceId,true)"
|
||||
>{{ item.dcPower }}kW</span
|
||||
class="pointer"
|
||||
@click="showChart('直流功率', item.deviceId,true)"
|
||||
>{{ item.dcPower }}kW</span
|
||||
>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="直流电压"
|
||||
labelClassName="descriptions-label"
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="直流电压"
|
||||
labelClassName="descriptions-label"
|
||||
>
|
||||
<span
|
||||
class="pointer"
|
||||
@click="showChart('直流电压', item.deviceId,true)"
|
||||
>{{ item.dcVoltage }}V</span
|
||||
class="pointer"
|
||||
@click="showChart('直流电压', item.deviceId,true)"
|
||||
>{{ item.dcVoltage }}V</span
|
||||
>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="直流电流"
|
||||
labelClassName="descriptions-label"
|
||||
:span="1"
|
||||
contentClassName="descriptions-direction"
|
||||
label="直流电流"
|
||||
labelClassName="descriptions-label"
|
||||
>
|
||||
<span
|
||||
class="pointer"
|
||||
@click="showChart('直流电流', item.deviceId,true)"
|
||||
>{{ item.dcCurrent }}A</span
|
||||
class="pointer"
|
||||
@click="showChart('直流电流', item.deviceId,true)"
|
||||
>{{ item.dcCurrent }}A</span
|
||||
>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
@ -170,7 +178,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
<el-empty v-show="pcsList.length <= 0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId" />
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</template>
|
||||
@ -180,12 +188,20 @@ import pointChart from "./../PointChart.vue";
|
||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
import RealTimeBaseInfo from "./../RealTimeBaseInfo.vue";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getRunningHeadInfo, getPcsDetailInfo } from "@/api/ems/dzjk";
|
||||
import {getPcsDetailInfo, getRunningHeadInfo} from "@/api/ems/dzjk";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
import PcsSwitch from "@/views/ems/site/sblb/PcsSwitch.vue";
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "DzjkSbjkPcs",
|
||||
components: { RealTimeBaseInfo, pointChart ,PointTable},
|
||||
components: {RealTimeBaseInfo, pointChart, PointTable, PcsSwitch},
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
computed: {
|
||||
...mapState({
|
||||
PCSWorkStatusOptions: state => state?.ems?.PCSWorkStatusOptions || {},
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@ -193,10 +209,10 @@ export default {
|
||||
pcsList: [],
|
||||
infoData: [
|
||||
{
|
||||
label: "总交流有功电率",
|
||||
label: "总交流有功功率",
|
||||
attr: "totalActivePower",
|
||||
unit: "kW",
|
||||
pointName: "总交流有功电率",
|
||||
pointName: "总交流有功功率",
|
||||
},
|
||||
{
|
||||
label: "当天交流充电量",
|
||||
@ -204,7 +220,7 @@ export default {
|
||||
unit: "kWh",
|
||||
pointName: "当天交流充电量 (kWh)",
|
||||
},
|
||||
{ label: "A相电压", attr: "aPhaseVoltage", unit: "V", pointName: "" },
|
||||
{label: "A相电压", attr: "aPhaseVoltage", unit: "V", pointName: ""},
|
||||
{
|
||||
label: "A相电流",
|
||||
attr: "aPhaseCurrent",
|
||||
@ -212,10 +228,10 @@ export default {
|
||||
pointName: "A相电流",
|
||||
},
|
||||
{
|
||||
label: "总交流无功电率",
|
||||
label: "总交流无功功率",
|
||||
attr: "totalReactivePower",
|
||||
unit: "kVar",
|
||||
pointName: "总交流无功电率",
|
||||
pointName: "总交流无功功率",
|
||||
},
|
||||
{
|
||||
label: "当天交流放电量",
|
||||
@ -223,7 +239,7 @@ export default {
|
||||
unit: "kWh",
|
||||
pointName: "当天交流放电量 (kWh)",
|
||||
},
|
||||
{ label: "B相电压", attr: "bPhaseVoltage", unit: "V", pointName: "" },
|
||||
{label: "B相电压", attr: "bPhaseVoltage", unit: "V", pointName: ""},
|
||||
{
|
||||
label: "B相电流",
|
||||
attr: "bPhaseCurrent",
|
||||
@ -242,7 +258,7 @@ export default {
|
||||
unit: "℃",
|
||||
pointName: "",
|
||||
},
|
||||
{ label: "C相电压", attr: "cPhaseVoltage", unit: "V", pointName: "" },
|
||||
{label: "C相电压", attr: "cPhaseVoltage", unit: "V", pointName: ""},
|
||||
{
|
||||
label: "C相电流",
|
||||
attr: "cPhaseCurrent",
|
||||
@ -272,14 +288,18 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 查看设备电位表格
|
||||
pointDetail(row,dataType){
|
||||
const {deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId:this.siteId,deviceId,deviceCategory:'PCS'},dataType)
|
||||
handleCardClass(item) {
|
||||
const {workStatus = ''} = item
|
||||
return workStatus === '1' || !Object.keys(this.PCSWorkStatusOptions).find(i => i === workStatus) ? "timing-card-container" : workStatus === '2' ? 'warning-card-container' : 'running-card-container'
|
||||
},
|
||||
showChart(pointName, deviceId,isBranch=false) {
|
||||
// 查看设备电位表格
|
||||
pointDetail(row, dataType) {
|
||||
const {deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'PCS'}, dataType)
|
||||
},
|
||||
showChart(pointName, deviceId, isBranch = false) {
|
||||
pointName &&
|
||||
this.$refs.pointChart.showChart({ pointName,deviceCategory:isBranch ? 'BRANCH' : 'PCS', deviceId });
|
||||
this.$refs.pointChart.showChart({pointName, deviceCategory: isBranch ? 'BRANCH' : 'PCS', deviceId});
|
||||
},
|
||||
//6个方块数据
|
||||
getRunningHeadData() {
|
||||
@ -290,11 +310,11 @@ export default {
|
||||
getPcsList() {
|
||||
this.loading = true;
|
||||
getPcsDetailInfo(this.siteId)
|
||||
.then((response) => {
|
||||
const data = response?.data || {};
|
||||
this.pcsList = JSON.parse(JSON.stringify(data));
|
||||
})
|
||||
.finally(() => (this.loading = false));
|
||||
.then((response) => {
|
||||
const data = response?.data || {};
|
||||
this.pcsList = JSON.parse(JSON.stringify(data));
|
||||
})
|
||||
.finally(() => (this.loading = false));
|
||||
},
|
||||
updateData() {
|
||||
this.getRunningHeadData();
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding"
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding"
|
||||
>
|
||||
<div slot="header">
|
||||
<span class="card-title">PCS有功功率/PCS无功功率</span>
|
||||
</div>
|
||||
<div style="height: 360px" id="cnglqxChart" />
|
||||
<div style="height: 360px" id="cnglqxChart"/>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import resize from "@/mixins/ems/resize";
|
||||
import { storagePower } from "@/api/ems/dzjk";
|
||||
import {storagePower} from "@/api/ems/dzjk";
|
||||
|
||||
export default {
|
||||
mixins: [resize],
|
||||
@ -36,56 +36,56 @@ export default {
|
||||
methods: {
|
||||
init(siteId, timeRange) {
|
||||
this.chart.showLoading();
|
||||
const [startTime='', endTime=''] = timeRange;
|
||||
storagePower(siteId,startTime,endTime)
|
||||
.then((response) => {
|
||||
this.setOption(response?.data?.pcsPowerList || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.chart.hideLoading();
|
||||
});
|
||||
const [startTime = '', endTime = ''] = timeRange;
|
||||
storagePower(siteId, startTime, endTime)
|
||||
.then((response) => {
|
||||
this.setOption(response?.data?.pcsPowerList || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.chart.hideLoading();
|
||||
});
|
||||
},
|
||||
setOption(data) {
|
||||
let xdata = [],
|
||||
series = [];
|
||||
series = [];
|
||||
data.forEach((element, index) => {
|
||||
if (index === 0) {
|
||||
xdata = (element.energyStoragePowList || []).map((i) => i.createDate);
|
||||
}
|
||||
series.push(
|
||||
{
|
||||
type: "line",
|
||||
name: `${element.deviceId}有功功率`,
|
||||
areaStyle: {
|
||||
// color:'#FFBD00'
|
||||
{
|
||||
type: "line",
|
||||
name: `${element.deviceId}有功功率`,
|
||||
areaStyle: {
|
||||
// color:'#FFBD00'
|
||||
},
|
||||
data: (element.energyStoragePowList || []).map(
|
||||
(i) => {
|
||||
return {
|
||||
value: i.pcsTotalActPower,
|
||||
year: i.dateDay || ''
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
data: (element.energyStoragePowList || []).map(
|
||||
(i) => {
|
||||
return {
|
||||
value:i.pcsTotalActPower,
|
||||
year:i.dateDay || ''
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
name: `${element.deviceId}无功功率`,
|
||||
areaStyle: {
|
||||
// color:'#FFBD00'
|
||||
},
|
||||
data: (element.energyStoragePowList || []).map(
|
||||
(i) => {
|
||||
return {
|
||||
value: i.pcsTotalReactivePower,
|
||||
year:i.dateDay || ''
|
||||
}
|
||||
}
|
||||
),
|
||||
}
|
||||
{
|
||||
type: "line",
|
||||
name: `${element.deviceId}无功功率`,
|
||||
areaStyle: {
|
||||
// color:'#FFBD00'
|
||||
},
|
||||
data: (element.energyStoragePowList || []).map(
|
||||
(i) => {
|
||||
return {
|
||||
value: i.pcsTotalReactivePower,
|
||||
year: i.dateDay || ''
|
||||
}
|
||||
}
|
||||
),
|
||||
}
|
||||
);
|
||||
});
|
||||
this.chart.setOption({
|
||||
this.chart && this.chart.setOption({
|
||||
legend: {
|
||||
left: "center",
|
||||
top: "5",
|
||||
@ -99,29 +99,29 @@ export default {
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
show:true,
|
||||
show: true,
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
formatter :(params)=>{
|
||||
if(params.length <= 0) return
|
||||
let result = (params[0].data.year || '')+' '+ params[0].name + '<div>'
|
||||
params.forEach(item=>{
|
||||
const {color,seriesName,value} = item
|
||||
result += `<div style="position: relative;padding-left:20px;line-height: 20px;">
|
||||
formatter: (params) => {
|
||||
if (params.length <= 0) return
|
||||
let result = (params[0].data.year || '') + ' ' + params[0].name + '<div>'
|
||||
params.forEach(item => {
|
||||
const {color, seriesName, value} = item
|
||||
result += `<div style="position: relative;padding-left:20px;line-height: 20px;">
|
||||
<div style="position: absolute;top:50%;left:0;width:12px;height:12px;border-radius:100%;background: ${color};transform: translateY(-50%)"></div>
|
||||
<span>${seriesName}</span><span style="margin-left:20px;font-weight: 700">${value}</span></div>`
|
||||
})
|
||||
result+='</div>'
|
||||
result += '</div>'
|
||||
return result
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: { type: "category", data: xdata },
|
||||
xAxis: {type: "category", data: xdata},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
@ -137,7 +137,7 @@ export default {
|
||||
},
|
||||
],
|
||||
series,
|
||||
});
|
||||
}, true);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -54,7 +54,7 @@ export default {
|
||||
year:element.dateDay,
|
||||
});
|
||||
});
|
||||
xdata = this.chart.setOption({
|
||||
this.chart && this.chart.setOption({
|
||||
legend: {
|
||||
left: "center",
|
||||
top: "5",
|
||||
@ -115,7 +115,7 @@ export default {
|
||||
data: ydata,
|
||||
},
|
||||
],
|
||||
});
|
||||
},true);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -57,7 +57,7 @@ export default {
|
||||
}
|
||||
);
|
||||
});
|
||||
xdata = this.chart.setOption({
|
||||
this.chart && this.chart.setOption({
|
||||
legend: {
|
||||
left: "center",
|
||||
top: "5",
|
||||
@ -118,7 +118,7 @@ export default {
|
||||
data: ydata,
|
||||
},
|
||||
],
|
||||
});
|
||||
},true);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -66,7 +66,7 @@ export default {
|
||||
}),
|
||||
});
|
||||
});
|
||||
this.chart.setOption({
|
||||
this.chart && this.chart.setOption({
|
||||
legend: {
|
||||
left: "center",
|
||||
top: "5",
|
||||
@ -118,7 +118,7 @@ export default {
|
||||
},
|
||||
],
|
||||
series,
|
||||
});
|
||||
},true);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,49 +1,54 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'ylLise'"
|
||||
class="sbjk-card-container running-card-container"
|
||||
:class="{
|
||||
<div v-loading="loading">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'ylLise'"
|
||||
class="sbjk-card-container running-card-container"
|
||||
:class="{
|
||||
'warning-card-container':item.emsCommunicationStatus && item.emsCommunicationStatus !== '0',
|
||||
'running-card-container':item.emsCommunicationStatus === '0'
|
||||
}"
|
||||
shadow="always">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{item.deviceName}}</span>
|
||||
<div class="info">
|
||||
<div>
|
||||
{{
|
||||
$store.state.ems.communicationStatusOptions[
|
||||
item.emsCommunicationStatus
|
||||
]
|
||||
}}
|
||||
</div>
|
||||
<div>数据更新时间:{{ item.dataUpdateTime || '-'}}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">详细</el-button>
|
||||
<el-badge :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
shadow="always">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{ item.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>
|
||||
{{
|
||||
$store.state.ems.communicationStatusOptions[
|
||||
item.emsCommunicationStatus
|
||||
]
|
||||
}}
|
||||
</div>
|
||||
<div>数据更新时间:{{ item.dataUpdateTime || '-' }}</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'hdTempData'" :span="12" class="device-info-col">
|
||||
<div class="alarm">
|
||||
<el-button type="primary" round size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">
|
||||
详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!item.alarmNum" :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'hdTempData'" :span="12"
|
||||
class="device-info-col">
|
||||
<span class="pointer" @click="showChart(tempDataItem.title,item.deviceId)">
|
||||
<span class="left">{{tempDataItem.title}}</span> <span class="right">{{item[tempDataItem.attr] || ''}}<span v-html="tempDataItem.unit"></span></span>
|
||||
<span class="left">{{ tempDataItem.title }}</span> <span class="right">{{
|
||||
item[tempDataItem.attr] || '-'
|
||||
}}<span
|
||||
v-html="tempDataItem.unit"></span></span>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -53,68 +58,75 @@ import {getXfDataList} from '@/api/ems/dzjk'
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
import pointChart from "./../PointChart.vue";
|
||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
|
||||
export default {
|
||||
name:'DzjkSbjkXf',
|
||||
mixins:[getQuerySiteId,intervalUpdate],
|
||||
components:{pointChart,PointTable},
|
||||
name: 'DzjkSbjkXf',
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
components: {pointChart, PointTable},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
list:[],
|
||||
tempData:[
|
||||
{title:'主电源备用电池状态',attr:'dczt',unit:''},
|
||||
{title:'手自动状态延时状态',attr:'yszt',unit:''},
|
||||
{title:'启动喷洒气体喷洒状态',attr:'pszt',unit:''},
|
||||
{title:'压力开关状态电磁阀状态',attr:'dcfzt',unit:''},
|
||||
loading: false,
|
||||
list: [],
|
||||
tempData: [
|
||||
{title: '主电源备用电池状态', attr: 'dczt', unit: ''},
|
||||
{title: '手自动状态延时状态', attr: 'yszt', unit: ''},
|
||||
{title: '启动喷洒气体喷洒状态', attr: 'pszt', unit: ''},
|
||||
{title: '压力开关状态电磁阀状态', attr: 'dcfzt', unit: ''},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
// 查看设备电位表格
|
||||
pointDetail(row,dataType){
|
||||
pointDetail(row, dataType) {
|
||||
const {deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId:this.siteId,deviceId,deviceCategory:'XF'},dataType)
|
||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'XF'}, dataType)
|
||||
},
|
||||
showChart(pointName,deviceId){
|
||||
pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'XF',deviceId})
|
||||
showChart(pointName, deviceId) {
|
||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'XF', deviceId})
|
||||
},
|
||||
updateData(){
|
||||
updateData() {
|
||||
this.loading = true
|
||||
getXfDataList(this.siteId).then(response => {
|
||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {this.loading = false})
|
||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
init(){
|
||||
init() {
|
||||
this.updateData()
|
||||
this.updateInterval(this.updateData)
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
mounted() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sbjk-card-container{
|
||||
&:not(:last-child){
|
||||
.sbjk-card-container {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.el-row{
|
||||
|
||||
.el-row {
|
||||
background-color: #ffffff;
|
||||
border:1px solid #eeeeee;
|
||||
border: 1px solid #eeeeee;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
color: #333333;
|
||||
.el-col{
|
||||
padding:12px 0;
|
||||
|
||||
.el-col {
|
||||
padding: 12px 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
.el-col{
|
||||
|
||||
.el-col {
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
}
|
||||
.el-col:not(:nth-child(3n)){
|
||||
|
||||
.el-col:not(:nth-child(3n)) {
|
||||
border-right: 1px solid #eeeeee;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,38 +1,42 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'ylLise'"
|
||||
class="sbjk-card-container running-card-container"
|
||||
shadow="always">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{item.deviceName}}</span>
|
||||
<div class="info">
|
||||
<div>数据更新时间:{{ item.dataUpdateTime || '-'}}</div>
|
||||
</div>
|
||||
<div class="alarm">
|
||||
<el-button type="primary" size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">详细</el-button>
|
||||
<el-badge :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
<div v-loading="loading">
|
||||
<el-card
|
||||
v-for="(item,index) in list"
|
||||
:key="index+'ylLise'"
|
||||
class="sbjk-card-container running-card-container"
|
||||
shadow="always">
|
||||
<div slot="header">
|
||||
<span class="large-title">{{ item.deviceName }}</span>
|
||||
<div class="info">
|
||||
<div>数据更新时间:{{ item.dataUpdateTime || '-' }}</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'ylTempData'" :span="8" class="device-info-col">
|
||||
<div class="alarm">
|
||||
<el-button type="primary" round size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">
|
||||
详细
|
||||
</el-button>
|
||||
<el-badge :hidden="!item.alarmNum" :value="item.alarmNum || 0" class="item">
|
||||
<i
|
||||
class="el-icon-message-solid alarm-icon"
|
||||
@click="pointDetail(item,'alarmPoint')"
|
||||
></i>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="device-info-row">
|
||||
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'ylTempData'" :span="8"
|
||||
class="device-info-col">
|
||||
<span class="pointer" @click="showChart(tempDataItem.title,item.deviceId)">
|
||||
<span class="left">{{tempDataItem.title}}</span> <span class="right">{{item[tempDataItem.attr]}}<span v-html="tempDataItem.unit"></span></span>
|
||||
<span class="left">{{ tempDataItem.title }}</span> <span
|
||||
class="right">{{ item[tempDataItem.attr] || '-' }}<span
|
||||
v-html="tempDataItem.unit"></span></span>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
||||
<point-table ref="pointTable"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -42,54 +46,57 @@ import {getCoolingDataList} from '@/api/ems/dzjk'
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
import pointChart from "./../PointChart.vue";
|
||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
||||
|
||||
export default {
|
||||
name:'DzjkSbjkYl',
|
||||
mixins:[getQuerySiteId,intervalUpdate],
|
||||
components:{pointChart,PointTable},
|
||||
name: 'DzjkSbjkYl',
|
||||
mixins: [getQuerySiteId, intervalUpdate],
|
||||
components: {pointChart, PointTable},
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
list:[],
|
||||
tempData:[
|
||||
{title:'供水温度',attr:'gsTemp',unit:'℃'},
|
||||
{title:'回水温度',attr:'hsTemp',unit:'℃'},
|
||||
{title:'供水压力',attr:'gsPressure',unit:'bar'},
|
||||
{title:'回水压力',attr:'hsPressure',unit:'bar'},
|
||||
{title:'冷源水温度',attr:'lysTemp',unit:'℃'},
|
||||
{title:'VB01开度',attr:'vb01Kd',unit:'%'},
|
||||
{title:'VB02开度',attr:'vb02Kd',unit:'%'},
|
||||
loading: false,
|
||||
list: [],
|
||||
tempData: [
|
||||
{title: '供水温度', attr: 'gsTemp', unit: '℃'},
|
||||
{title: '回水温度', attr: 'hsTemp', unit: '℃'},
|
||||
{title: '供水压力', attr: 'gsPressure', unit: 'bar'},
|
||||
{title: '回水压力', attr: 'hsPressure', unit: 'bar'},
|
||||
{title: '冷源水温度', attr: 'lysTemp', unit: '℃'},
|
||||
{title: 'VB01开度', attr: 'vb01Kd', unit: '%'},
|
||||
{title: 'VB02开度', attr: 'vb02Kd', unit: '%'},
|
||||
]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
// 查看设备电位表格
|
||||
pointDetail(row,dataType){
|
||||
pointDetail(row, dataType) {
|
||||
const {deviceId} = row
|
||||
this.$refs.pointTable.showTable({siteId:this.siteId,deviceId,deviceCategory:'COOLING'},dataType)
|
||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'COOLING'}, dataType)
|
||||
},
|
||||
showChart(pointName,deviceId){
|
||||
pointName && this.$refs.pointChart.showChart({pointName,deviceCategory:'COOLING',deviceId})
|
||||
showChart(pointName, deviceId) {
|
||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'COOLING', deviceId})
|
||||
},
|
||||
updateData(){
|
||||
updateData() {
|
||||
this.loading = true
|
||||
getCoolingDataList(this.siteId).then(response => {
|
||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {this.loading = false})
|
||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
init(){
|
||||
init() {
|
||||
this.updateData()
|
||||
this.updateInterval(this.updateData)
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
mounted() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.sbjk-card-container{
|
||||
&:not(:last-child){
|
||||
.sbjk-card-container {
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
<template>
|
||||
<div style="width:100%" v-loading="loading">
|
||||
<!-- 搜索栏-->
|
||||
@ -22,172 +21,185 @@
|
||||
<el-form-item>
|
||||
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="exportTable" native-type="button">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!--表格-->
|
||||
<el-table
|
||||
class="common-table"
|
||||
:data="tableData"
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
<!-- 汇总列-->
|
||||
<el-table-column label="汇总">
|
||||
<el-table-column
|
||||
prop="dataTime"
|
||||
label="日期"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="充电量" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activePeakKwh"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeHighKwh"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeFlatKwh"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeValleyKwh"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeTotalKwh"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="放电量" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActivePeakKwh"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveHighKwh"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveFlatKwh"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveValleyKwh"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveTotalKwh"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 效率-->
|
||||
<el-table-column label="效率(%)" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="effect">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-show="tableData.length>0"
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalSize"
|
||||
style="margin-top:15px;text-align: center"
|
||||
>
|
||||
</el-pagination>
|
||||
class="common-table"
|
||||
:data="tableData"
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
<!-- 汇总列-->
|
||||
<el-table-column label="汇总">
|
||||
<el-table-column
|
||||
prop="dataTime"
|
||||
label="日期"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="充电量" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activePeakKwh"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeHighKwh"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeFlatKwh"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeValleyKwh"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeTotalKwh"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="放电量" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActivePeakKwh"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveHighKwh"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveFlatKwh"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveValleyKwh"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveTotalKwh"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 效率-->
|
||||
<el-table-column label="效率(%)" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="effect">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-show="tableData.length>0"
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalSize"
|
||||
style="margin-top:15px;text-align: center"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getAmmeterData} from '@/api/ems/dzjk'
|
||||
import {getAmmeterData} from '@/api/ems/dzjk'
|
||||
import {formatDate} from "@/filters/ems";
|
||||
|
||||
export default {
|
||||
name:'DzjkTjbbDbbb',
|
||||
name: 'DzjkTjbbDbbb',
|
||||
mixins: [getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
pickerOptions:{
|
||||
loading: false,
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
},
|
||||
defaultDateRange:[],//默认展示的时间
|
||||
dateRange:[],
|
||||
tableData:[],
|
||||
pageSize:10,//分页栏当前每个数据总数
|
||||
pageNum:1,//分页栏当前页数
|
||||
totalSize:0,//table表格数据总数
|
||||
defaultDateRange: [],//默认展示的时间
|
||||
dateRange: [],
|
||||
tableData: [],
|
||||
pageSize: 10,//分页栏当前每个数据总数
|
||||
pageNum: 1,//分页栏当前页数
|
||||
totalSize: 0,//table表格数据总数
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
// 导出表格
|
||||
exportTable() {
|
||||
if (!this.dateRange?.length) return
|
||||
const [startTime, endTime] = this.dateRange
|
||||
this.download('ems/statsReport/exportAmmeterData', {
|
||||
siteId: this.siteId,
|
||||
startTime,
|
||||
endTime,
|
||||
}, `电表报表_${startTime}-${endTime}.xlsx`)
|
||||
},
|
||||
// 搜索
|
||||
onSearch(){
|
||||
this.pageNum =1//每次搜索从1开始搜索
|
||||
onSearch() {
|
||||
this.pageNum = 1//每次搜索从1开始搜索
|
||||
this.getData()
|
||||
},
|
||||
// 重置
|
||||
onReset(){
|
||||
this.dateRange=this.defaultDateRange
|
||||
this.pageNum =1//每次搜索从1开始搜索
|
||||
onReset() {
|
||||
this.dateRange = this.defaultDateRange
|
||||
this.pageNum = 1//每次搜索从1开始搜索
|
||||
this.getData()
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageNum = val
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
// 获取数据
|
||||
getData(){
|
||||
this.loading=true
|
||||
const {siteId,pageNum,pageSize} =this
|
||||
const [startTime='',endTime='']=(this.dateRange || [])
|
||||
getAmmeterData({siteId:siteId,startTime,endTime,pageSize,pageNum}).then(response=>{
|
||||
this.tableData=response?.rows || [];
|
||||
getData() {
|
||||
this.loading = true
|
||||
const {siteId, pageNum, pageSize} = this
|
||||
const [startTime = '', endTime = ''] = (this.dateRange || [])
|
||||
getAmmeterData({siteId: siteId, startTime, endTime, pageSize, pageNum}).then(response => {
|
||||
this.tableData = response?.rows || [];
|
||||
this.totalSize = response?.total || 0
|
||||
}).finally(()=> {
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
init(){
|
||||
this.dateRange=[]
|
||||
this.tableData=[]
|
||||
this.totalSize=0
|
||||
this.pageSize=10
|
||||
init() {
|
||||
this.dateRange = []
|
||||
this.tableData = []
|
||||
this.totalSize = 0
|
||||
this.pageSize = 10
|
||||
this.pageNum = 1
|
||||
const now = new Date().getTime();
|
||||
const lastMonth = new Date(now-30 * 24 * 60 * 60 * 1000).getTime();
|
||||
this.defaultDateRange = [formatDate(lastMonth), formatDate(now)];
|
||||
this.dateRange=[formatDate(lastMonth), formatDate(now)];
|
||||
let now = new Date(), lastDay = now.getTime(), firstDay = new Date(now.setDate(1)).getTime();
|
||||
this.defaultDateRange = [formatDate(firstDay), formatDate(lastDay)];
|
||||
this.dateRange = [formatDate(firstDay), formatDate(lastDay)];
|
||||
this.getData()
|
||||
},
|
||||
},
|
||||
@ -195,8 +207,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep{
|
||||
.common-table.el-table .el-table__header-wrapper th, .common-table.el-table .el-table__fixed-header-wrapper th{
|
||||
::v-deep {
|
||||
.common-table.el-table .el-table__header-wrapper th, .common-table.el-table .el-table__fixed-header-wrapper th {
|
||||
border-bottom: 1px solid #dfe6ec;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,22 +1,23 @@
|
||||
<template>
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container time-range-card"
|
||||
style="margin-top: 20px"
|
||||
shadow="always"
|
||||
class="common-card-container time-range-card"
|
||||
style="margin-top: 20px"
|
||||
>
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title"> </span>
|
||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate" />
|
||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate"/>
|
||||
</div>
|
||||
<div class="card-main" v-loading="loading">
|
||||
<el-button-group class="ems-btns-group">
|
||||
<el-button
|
||||
v-for="(item, index) in btnList"
|
||||
:key="index + 'dcdqxBtns'"
|
||||
size="mini"
|
||||
:class="{ activeBtn: activeBtn === item.id }"
|
||||
@click="changeDataType(item.id)"
|
||||
>{{ item.name }}</el-button
|
||||
v-for="(item, index) in btnList"
|
||||
:key="index + 'dcdqxBtns'"
|
||||
size="mini"
|
||||
:class="{ activeBtn: activeBtn === item.id }"
|
||||
@click="changeDataType(item.id)"
|
||||
>{{ item.name }}
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
<div id="dcdEchart" style="height: 310px"></div>
|
||||
@ -28,12 +29,13 @@
|
||||
import * as echarts from "echarts";
|
||||
import resize from "@/mixins/ems/resize";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getStackData, getStackNameList } from "@/api/ems/dzjk";
|
||||
import { formatDate } from "@/filters/ems";
|
||||
import {getStackData} from "@/api/ems/dzjk";
|
||||
import {formatDate} from "@/filters/ems";
|
||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
||||
|
||||
export default {
|
||||
name: "DzjkTjbbDcdqx",
|
||||
components: { DateRangeSelect },
|
||||
components: {DateRangeSelect},
|
||||
mixins: [resize, getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
@ -46,10 +48,10 @@ export default {
|
||||
loading: false,
|
||||
activeBtn: "1",
|
||||
btnList: [
|
||||
{ name: "堆平均维度", id: "1", attr: ["temp"], source: ["有功功率"] },
|
||||
{ name: "堆电压", id: "2", attr: ["voltage"], source: ["堆电压"] },
|
||||
{ name: "堆电流", id: "3", attr: ["current"], source: ["堆电流"] },
|
||||
{ name: "堆soc", id: "4", attr: ["soc"], source: ["堆soc"] },
|
||||
{name: "堆平均维度", id: "1", attr: ["temp"], source: ["有功功率"]},
|
||||
{name: "堆电压", id: "2", attr: ["voltage"], source: ["堆电压"]},
|
||||
{name: "堆电流", id: "3", attr: ["current"], source: ["堆电流"]},
|
||||
{name: "堆soc", id: "4", attr: ["soc"], source: ["堆soc"]},
|
||||
],
|
||||
};
|
||||
},
|
||||
@ -66,7 +68,7 @@ export default {
|
||||
this.getData();
|
||||
},
|
||||
getData() {
|
||||
const { siteId, activeBtn } = this;
|
||||
const {siteId, activeBtn} = this;
|
||||
const [start = "", end = ""] = this.dateRange || [];
|
||||
//接口调用完成之后 设置图表、结束loading
|
||||
this.loading = true;
|
||||
@ -76,12 +78,12 @@ export default {
|
||||
endTime: formatDate(end),
|
||||
dataType: activeBtn,
|
||||
})
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
compareDate(date1, date2) {
|
||||
console.log("比较时间", date1, date2);
|
||||
@ -92,9 +94,9 @@ export default {
|
||||
const [date1_Y = "", date1_M = "", date1_D = ""] = date1.split("-"); //根据空格区分[年月日,小时]
|
||||
const [date2_Y = "", date2_M = "", date2_D = ""] = date2.split("-"); //根据空格区分[年月日,小时]
|
||||
return (
|
||||
(date1_Y === date2_Y && date1_M === date2_M && date1_D - date2_D) ||
|
||||
(date1_Y === date2_Y && date1_M - date2_M) ||
|
||||
date1_Y - date2_Y
|
||||
(date1_Y === date2_Y && date1_M === date2_M && date1_D - date2_D) ||
|
||||
(date1_Y === date2_Y && date1_M - date2_M) ||
|
||||
date1_Y - date2_Y
|
||||
);
|
||||
},
|
||||
setOption(data) {
|
||||
@ -106,7 +108,7 @@ export default {
|
||||
const source = [];
|
||||
const sourceTop = ["日期"];
|
||||
let map = {},
|
||||
mapArr = [];
|
||||
mapArr = [];
|
||||
// 生成所有{日期:[],日期:[]}格式的对象和所有包含所有日期的[日期1,日期2...]
|
||||
data.forEach((item) => {
|
||||
item.dataList.forEach((inner) => {
|
||||
@ -136,38 +138,53 @@ export default {
|
||||
});
|
||||
source.unshift(sourceTop);
|
||||
this.chart.setOption(
|
||||
{
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
left: "center",
|
||||
bottom: "15",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
{
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
left: "center",
|
||||
top: "10",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside",
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
],
|
||||
dataset: {source},
|
||||
series: source[0].slice(1).map((item) => {
|
||||
return {
|
||||
type: "line",
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.7,
|
||||
},
|
||||
};
|
||||
}),
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataset: { source },
|
||||
series: source[0].slice(1).map((item) => {
|
||||
return {
|
||||
type: "line",
|
||||
};
|
||||
}),
|
||||
},
|
||||
true
|
||||
true
|
||||
);
|
||||
},
|
||||
initChart() {
|
||||
@ -176,7 +193,7 @@ export default {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart();
|
||||
this.$refs.dateRangeSelect.init();
|
||||
this.$refs.dateRangeSelect.init(true);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@ -1,15 +1,14 @@
|
||||
<template>
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container time-range-card"
|
||||
style="margin-top: 20px"
|
||||
shadow="always"
|
||||
class="common-card-container time-range-card"
|
||||
style="margin-top: 20px"
|
||||
>
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title">功率曲线</span>
|
||||
<date-range-select
|
||||
ref="dateRangeSelect"
|
||||
@reset="resetTime"
|
||||
@updateDate="updateDate"
|
||||
ref="dateRangeSelect"
|
||||
@updateDate="updateDate"
|
||||
/>
|
||||
</div>
|
||||
<div class="card-main" v-loading="loading">
|
||||
@ -22,12 +21,13 @@
|
||||
import * as echarts from "echarts";
|
||||
import resize from "@/mixins/ems/resize";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getPcsNameList, getPowerData } from "@/api/ems/dzjk";
|
||||
import { formatDate } from "@/filters/ems";
|
||||
import {getPowerData} from "@/api/ems/dzjk";
|
||||
import {formatDate} from "@/filters/ems";
|
||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
||||
|
||||
export default {
|
||||
name: "DzjkTjbbGlqx",
|
||||
components: { DateRangeSelect },
|
||||
components: {DateRangeSelect},
|
||||
mixins: [resize, getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
@ -38,7 +38,6 @@ export default {
|
||||
},
|
||||
dateRange: [],
|
||||
loading: false,
|
||||
dateRangeInit: true,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@ -47,30 +46,22 @@ export default {
|
||||
this.dateRange = data || [];
|
||||
this.getData();
|
||||
},
|
||||
resetTime() {
|
||||
this.dateRangeInit = true;
|
||||
},
|
||||
getData() {
|
||||
const { siteId } = this;
|
||||
const {siteId} = this;
|
||||
let [start = "", end = ""] = this.dateRange || [];
|
||||
//接口调用完成之后 设置图表、结束loading
|
||||
this.loading = true;
|
||||
if (this.dateRangeInit) {
|
||||
start = "";
|
||||
end = "";
|
||||
this.dateRangeInit = false;
|
||||
}
|
||||
getPowerData({
|
||||
siteId,
|
||||
startDate: formatDate(start),
|
||||
endDate: formatDate(end),
|
||||
})
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
setOption(data) {
|
||||
const source = [["日期", "电网功率", "负载功率", "储能功率", "光伏功率"]];
|
||||
@ -84,47 +75,74 @@ export default {
|
||||
]);
|
||||
});
|
||||
this.chart.setOption(
|
||||
{
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
left: "center",
|
||||
bottom: "15",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
{
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataset: { source },
|
||||
series: [
|
||||
{
|
||||
type: "line",
|
||||
legend: {
|
||||
left: "center",
|
||||
top: "10",
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
xAxis: {
|
||||
type: "category",
|
||||
},
|
||||
],
|
||||
},
|
||||
true
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataset: {source},
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside",
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: "line",
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.7,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.7,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.7,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.7,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
true
|
||||
);
|
||||
},
|
||||
initChart() {
|
||||
@ -133,7 +151,6 @@ export default {
|
||||
},
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.dateRangeInit = true;
|
||||
this.initChart();
|
||||
this.$refs.dateRangeSelect.init();
|
||||
});
|
||||
|
||||
@ -1,22 +1,23 @@
|
||||
<template>
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container time-range-card"
|
||||
style="margin-top: 20px"
|
||||
shadow="always"
|
||||
class="common-card-container time-range-card"
|
||||
style="margin-top: 20px"
|
||||
>
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title"> </span>
|
||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate" />
|
||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate"/>
|
||||
</div>
|
||||
<div class="card-main" v-loading="loading">
|
||||
<el-button-group class="ems-btns-group">
|
||||
<el-button
|
||||
v-for="(item, index) in btnList"
|
||||
:key="index + 'flqxcBtns'"
|
||||
size="mini"
|
||||
:class="{ activeBtn: activeBtn === item.id }"
|
||||
@click="changeDataType(item.id)"
|
||||
>{{ item.name }}</el-button
|
||||
v-for="(item, index) in btnList"
|
||||
:key="index + 'flqxcBtns'"
|
||||
size="mini"
|
||||
:class="{ activeBtn: activeBtn === item.id }"
|
||||
@click="changeDataType(item.id)"
|
||||
>{{ item.name }}
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
<div id="pcsEchart" style="height: 310px"></div>
|
||||
@ -28,12 +29,13 @@
|
||||
import * as echarts from "echarts";
|
||||
import resize from "@/mixins/ems/resize";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getPCSData, getPcsNameList } from "@/api/ems/dzjk";
|
||||
import { formatDate } from "@/filters/ems";
|
||||
import {getPCSData} from "@/api/ems/dzjk";
|
||||
import {formatDate} from "@/filters/ems";
|
||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
||||
|
||||
export default {
|
||||
name: "DzjkTjbbPcsqx",
|
||||
components: { DateRangeSelect },
|
||||
components: {DateRangeSelect},
|
||||
mixins: [resize, getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
@ -82,7 +84,7 @@ export default {
|
||||
this.getData();
|
||||
},
|
||||
getData() {
|
||||
const { siteId, activeBtn } = this;
|
||||
const {siteId, activeBtn} = this;
|
||||
const [start = "", end = ""] = this.dateRange || [];
|
||||
this.loading = true;
|
||||
//接口调用完成之后 设置图表、结束loading
|
||||
@ -92,12 +94,12 @@ export default {
|
||||
endTime: formatDate(end),
|
||||
dataType: activeBtn,
|
||||
})
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
compareDate(date1, date2) {
|
||||
console.log("比较时间", date1, date2);
|
||||
@ -108,9 +110,9 @@ export default {
|
||||
const [date1_Y = "", date1_M = "", date1_D = ""] = date1.split("-"); //根据空格区分[年月日,小时]
|
||||
const [date2_Y = "", date2_M = "", date2_D = ""] = date2.split("-"); //根据空格区分[年月日,小时]
|
||||
return (
|
||||
(date1_Y === date2_Y && date1_M === date2_M && date1_D - date2_D) ||
|
||||
(date1_Y === date2_Y && date1_M - date2_M) ||
|
||||
date1_Y - date2_Y
|
||||
(date1_Y === date2_Y && date1_M === date2_M && date1_D - date2_D) ||
|
||||
(date1_Y === date2_Y && date1_M - date2_M) ||
|
||||
date1_Y - date2_Y
|
||||
);
|
||||
},
|
||||
setOption(data) {
|
||||
@ -122,7 +124,7 @@ export default {
|
||||
const source = [];
|
||||
const sourceTop = ["日期"];
|
||||
let map = {},
|
||||
mapArr = [];
|
||||
mapArr = [];
|
||||
// 生成所有{日期:[],日期:[]}格式的对象和所有包含所有日期的[日期1,日期2...]
|
||||
data.forEach((item) => {
|
||||
item.dataList.forEach((inner) => {
|
||||
@ -152,38 +154,53 @@ export default {
|
||||
});
|
||||
source.unshift(sourceTop);
|
||||
this.chart.setOption(
|
||||
{
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
left: "center",
|
||||
bottom: "15",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
{
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
left: "center",
|
||||
top: "10",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside",
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
],
|
||||
dataset: {source},
|
||||
series: source[0].slice(1).map((item) => {
|
||||
return {
|
||||
type: "line",
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.7,
|
||||
},
|
||||
};
|
||||
}),
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataset: { source },
|
||||
series: source[0].slice(1).map((item) => {
|
||||
return {
|
||||
type: "line",
|
||||
};
|
||||
}),
|
||||
},
|
||||
true
|
||||
true
|
||||
);
|
||||
},
|
||||
initChart() {
|
||||
@ -192,7 +209,7 @@ export default {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart();
|
||||
this.$refs.dateRangeSelect.init();
|
||||
this.$refs.dateRangeSelect.init(true);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
<template>
|
||||
<div style="width:100%" v-loading="loading">
|
||||
<!-- 搜索栏-->
|
||||
@ -22,172 +21,187 @@
|
||||
<el-form-item>
|
||||
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="exportTable" native-type="button">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!--表格-->
|
||||
<el-table
|
||||
class="common-table"
|
||||
:data="tableData"
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
<!-- 汇总列-->
|
||||
<el-table-column label="汇总">
|
||||
<el-table-column
|
||||
prop="dataTime"
|
||||
label="日期"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="充电价格" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activePeakKwh"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeHighKwh"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeFlatKwh"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeValleyKwh"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeTotalKwh"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="放电价格" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActivePeakKwh"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveHighKwh"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveFlatKwh"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveValleyKwh"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveTotalKwh"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 效率-->
|
||||
<!-- <el-table-column label="效率(%)" align="center">-->
|
||||
<!-- <el-table-column-->
|
||||
<!-- align="center"-->
|
||||
<!-- prop="effect">-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-show="tableData.length>0"
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalSize"
|
||||
style="margin-top:15px;text-align: center"
|
||||
>
|
||||
</el-pagination>
|
||||
class="common-table"
|
||||
:data="tableData"
|
||||
show-summary
|
||||
stripe
|
||||
style="width: 100%;margin-top:25px;">
|
||||
<!-- 汇总列-->
|
||||
<el-table-column label="汇总" min-width="100px" align="center">
|
||||
<el-table-column
|
||||
prop="dataTime"
|
||||
label="日期"
|
||||
min-width="100px" align="center">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="充电价格" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activePeakPrice"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeHighPrice"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeFlatPrice"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeValleyPrice"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="activeTotalPrice"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!--充电量列-->
|
||||
<el-table-column label="放电价格" align="center">
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActivePeakPrice"
|
||||
label="尖">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveHighPrice"
|
||||
label="峰">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveFlatPrice"
|
||||
label="平">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveValleyPrice"
|
||||
label="谷">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="reActiveTotalPrice"
|
||||
label="总">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 实际收益-->
|
||||
<el-table-column label="" align="center" fixed="right">
|
||||
<el-table-column
|
||||
prop="actualRevenue"
|
||||
label="实际收益"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-show="tableData.length>0"
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalSize"
|
||||
style="margin-top:15px;text-align: center"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { getAmmeterData} from '@/api/ems/dzjk'
|
||||
import {getAmmeterRevenueData} from '@/api/ems/dzjk'
|
||||
import {formatDate} from "@/filters/ems";
|
||||
|
||||
export default {
|
||||
name:'DzjkTjbbSybb',
|
||||
name: 'DzjkTjbbSybb',
|
||||
mixins: [getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
pickerOptions:{
|
||||
loading: false,
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
},
|
||||
defaultDateRange:[],//默认展示的时间
|
||||
dateRange:[],
|
||||
tableData:[],
|
||||
pageSize:10,//分页栏当前每个数据总数
|
||||
pageNum:1,//分页栏当前页数
|
||||
totalSize:0,//table表格数据总数
|
||||
defaultDateRange: [],//默认展示的时间
|
||||
dateRange: [],
|
||||
tableData: [],
|
||||
pageSize: 10,//分页栏当前每个数据总数
|
||||
pageNum: 1,//分页栏当前页数
|
||||
totalSize: 0,//table表格数据总数
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
methods: {
|
||||
// 导出表格
|
||||
exportTable() {
|
||||
if (!this.dateRange?.length) return
|
||||
const [startTime, endTime] = this.dateRange
|
||||
this.download('ems/statsReport/exportAmmeterRevenueData', {
|
||||
siteId: this.siteId,
|
||||
startTime,
|
||||
endTime,
|
||||
}, `收益报表_${startTime}-${endTime}.xlsx`)
|
||||
},
|
||||
// 搜索
|
||||
onSearch(){
|
||||
this.pageNum =1//每次搜索从1开始搜索
|
||||
onSearch() {
|
||||
this.pageNum = 1//每次搜索从1开始搜索
|
||||
this.getData()
|
||||
},
|
||||
// 重置
|
||||
onReset(){
|
||||
this.dateRange=this.defaultDateRange
|
||||
this.pageNum =1//每次搜索从1开始搜索
|
||||
onReset() {
|
||||
this.dateRange = this.defaultDateRange
|
||||
this.pageNum = 1//每次搜索从1开始搜索
|
||||
this.getData()
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageNum = val
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
// 获取数据
|
||||
getData(){
|
||||
this.loading=true
|
||||
const {siteId,pageNum,pageSize} =this
|
||||
const [startTime='',endTime='']=(this.dateRange || [])
|
||||
getAmmeterData({siteId:siteId,startTime,endTime,pageSize,pageNum}).then(response=>{
|
||||
this.tableData=response?.rows || [];
|
||||
getData() {
|
||||
this.loading = true
|
||||
const {siteId, pageNum, pageSize} = this
|
||||
const [startTime = '', endTime = ''] = (this.dateRange || [])
|
||||
getAmmeterRevenueData({siteId: siteId, startTime, endTime, pageSize, pageNum}).then(response => {
|
||||
this.tableData = response?.rows || [];
|
||||
this.totalSize = response?.total || 0
|
||||
}).finally(()=> {
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
init(){
|
||||
this.dateRange=[]
|
||||
this.tableData=[]
|
||||
this.totalSize=0
|
||||
this.pageSize=10
|
||||
init() {
|
||||
this.dateRange = []
|
||||
this.tableData = []
|
||||
this.totalSize = 0
|
||||
this.pageSize = 10
|
||||
this.pageNum = 1
|
||||
const now = new Date().getTime();
|
||||
const lastMonth = new Date(now-30 * 24 * 60 * 60 * 1000).getTime();
|
||||
this.defaultDateRange = [formatDate(lastMonth), formatDate(now)];
|
||||
this.dateRange=[formatDate(lastMonth), formatDate(now)];
|
||||
let now = new Date(), lastDay = now.getTime(), firstDay = new Date(now.setDate(1)).getTime();
|
||||
this.defaultDateRange = [formatDate(firstDay), formatDate(lastDay)];
|
||||
this.dateRange = [formatDate(firstDay), formatDate(lastDay)];
|
||||
this.getData()
|
||||
},
|
||||
},
|
||||
@ -195,10 +209,20 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep{
|
||||
.common-table.el-table .el-table__header-wrapper th, .common-table.el-table .el-table__fixed-header-wrapper th{
|
||||
border-bottom: 1px solid #dfe6ec;
|
||||
::v-deep {
|
||||
.common-table.el-table {
|
||||
.el-table__header-wrapper th, .common-table.el-table .el-table__fixed-header-wrapper th {
|
||||
border-bottom: 1px solid #dfe6ec;
|
||||
}
|
||||
|
||||
.el-table__footer-wrapper {
|
||||
tbody td.el-table__cell {
|
||||
color: #000;
|
||||
font-weight: bolder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -1,577 +0,0 @@
|
||||
<template>
|
||||
<div class="ems-dashboard-editor-container" v-loading="loading">
|
||||
<div class="container" v-show="!empty">
|
||||
<!-- 云、电脑 -->
|
||||
<div class="top">
|
||||
<div class="cloud-container">
|
||||
<div class="cloud">
|
||||
<span style="z-index: 2; position: relative">云</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="double-arrows">
|
||||
<div class="top-arrows"></div>
|
||||
<div class="bottom-arrows"></div>
|
||||
</div>
|
||||
<div class="computer">
|
||||
<img src="@/assets/images/ems/computer.png" alt="" />
|
||||
<span style="z-index: 2; position: relative">ems</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outer-border">
|
||||
<!-- 电表-->
|
||||
<div class="row-lists-container" v-if="showDb">
|
||||
<div class="row-title">电表({{ db.length }})</div>
|
||||
<div class="row-lists">
|
||||
<div v-for="item in db" :key="item.deviceId" class="row-items">
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.communicationStatus === '0' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ communicationStatusOptions[item.communicationStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img
|
||||
class="img-db"
|
||||
:src="require('@/assets/images/ems/db.png')"
|
||||
/>
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 液冷-->
|
||||
<div class="row-lists-container" v-if="showLq">
|
||||
<div class="row-title">冷却({{ lq.length }})</div>
|
||||
<div class="row-lists">
|
||||
<div v-for="item in lq" :key="item.deviceId" class="row-items">
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.communicationStatus === '0' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ communicationStatusOptions[item.communicationStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img
|
||||
class="img-lq"
|
||||
:src="require('@/assets/images/ems/lq.png')"
|
||||
/>
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PCS-->
|
||||
<div class="row-lists-container" v-if="showPcs">
|
||||
<div class="row-lists">
|
||||
<div class="row-title">PCS({{ pcs.length }})</div>
|
||||
<div
|
||||
v-for="(item, index) in pcs"
|
||||
:key="item.deviceId"
|
||||
class="row-items row-items-pcs"
|
||||
>
|
||||
<!-- pcs -->
|
||||
<div class="parent-dash">
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.communicationStatus === '0' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ communicationStatusOptions[item.communicationStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img
|
||||
class="img-pcs"
|
||||
:src="require('@/assets/images/ems/pcs.png')"
|
||||
/>
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 子设备 bms -->
|
||||
<div
|
||||
v-if="item.children && item.children.length > 0"
|
||||
class="children-dash"
|
||||
>
|
||||
<div
|
||||
class="row-children-title"
|
||||
v-if="bmsHasParentLength > 0 && index === 0"
|
||||
>
|
||||
BMS({{ bmsHasParentLength }})
|
||||
</div>
|
||||
<div
|
||||
v-for="(childrenItem, childrenIndex) in item.children"
|
||||
:key="childrenIndex + 'childrenBms'"
|
||||
class="children-dash-items"
|
||||
>
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
childrenItem.communicationStatus === '0'
|
||||
? 'status-running'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{
|
||||
communicationStatusOptions[
|
||||
childrenItem.communicationStatus
|
||||
]
|
||||
}}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img
|
||||
class="img-pcs"
|
||||
:src="require('@/assets/images/ems/bms.png')"
|
||||
/>
|
||||
<div class="name">{{ childrenItem.deviceName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-lists-container" v-if="showPcs">
|
||||
<div class="row-title">PCS({{ pcs.length }})</div>
|
||||
<div class="row-lists">
|
||||
<div
|
||||
v-for="item in bmsNoParent"
|
||||
:key="item.deviceId"
|
||||
class="row-items row-items-pcs"
|
||||
>
|
||||
<!-- pcs -->
|
||||
<div class="parent-dash">
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.communicationStatus === '0' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ communicationStatusOptions[item.communicationStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img :src="require('@/assets/images/ems/bms.png')" />
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- bms没有上级设备-->
|
||||
<div class="row-lists-container" v-if="bmsNoParent.length > 0">
|
||||
<div class="row-title">BMS({{ bmsNoParent.length }})</div>
|
||||
<div class="row-lists">
|
||||
<div
|
||||
v-for="item in bmsNoParent"
|
||||
:key="item.deviceId"
|
||||
class="row-items row-items-pcs"
|
||||
>
|
||||
<!-- pcs -->
|
||||
<div class="parent-dash">
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.communicationStatus === '0' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ communicationStatusOptions[item.communicationStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img :src="require('@/assets/images/ems/bms.png')" />
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty v-show="empty" :image-size="200"></el-empty>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDeviceList } from "@/api/ems/site";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { mapState } from "vuex";
|
||||
export default {
|
||||
name: "DzjkZxlt",
|
||||
mixins: [getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
pcs: [],
|
||||
bms: [],
|
||||
db: [],
|
||||
lq: [],
|
||||
pcsHasChildren: [],
|
||||
pcsNoChildren: [],
|
||||
bmsNoParent: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
communicationStatusOptions: (state) =>
|
||||
state.ems.communicationStatusOptions,
|
||||
}),
|
||||
|
||||
showPcs() {
|
||||
return this.pcs.length > 0;
|
||||
},
|
||||
showBms() {
|
||||
return this.bms.length > 0;
|
||||
},
|
||||
showDb() {
|
||||
return this.db.length > 0;
|
||||
},
|
||||
showLq() {
|
||||
return this.lq.length > 0;
|
||||
},
|
||||
bmsHasParentLength() {
|
||||
let count = 0;
|
||||
this.pcs.forEach((item) => (count += item.children.length));
|
||||
return count;
|
||||
},
|
||||
empty() {
|
||||
return !this.showBms && !this.showPcs && !this.showDb && !this.showLq;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.pcs = [];
|
||||
this.bms = [];
|
||||
this.lq = [];
|
||||
this.db = [];
|
||||
this.bmsNoParent = [];
|
||||
this.loading = true;
|
||||
getDeviceList(this.siteId)
|
||||
.then((response) => {
|
||||
const data = JSON.parse(JSON.stringify(response?.data || []));
|
||||
let pcs = [],
|
||||
bms = [],
|
||||
db = [],
|
||||
lq = [],
|
||||
bmsNoParent = [];
|
||||
data.forEach((item) => {
|
||||
// 电表
|
||||
if (item.deviceCategory === "AMMETER") {
|
||||
db.push({ ...item, children: [] });
|
||||
} else if (item.deviceCategory === "PCS") {
|
||||
// pcs
|
||||
pcs.push({ ...item, children: [] });
|
||||
} else if (item.deviceCategory === "STACK") {
|
||||
// bms
|
||||
bms.push({ ...item, children: [] });
|
||||
} else if (item.deviceCategory === "COOLING") {
|
||||
// 液冷
|
||||
lq.push({ ...item, children: [] });
|
||||
}
|
||||
});
|
||||
bms.forEach((item, index) => {
|
||||
if (item.parentId) {
|
||||
pcs
|
||||
.find((pcsItem) => pcsItem.deviceId === item.parentId)
|
||||
.children.push(item);
|
||||
} else {
|
||||
bmsNoParent.push(item);
|
||||
}
|
||||
});
|
||||
this.pcs = pcs;
|
||||
this.bms = bms;
|
||||
this.lq = lq;
|
||||
this.db = db;
|
||||
this.pcsHasChildren = pcs.filter((item) => item.children.length > 0);
|
||||
this.pcsNoChildren = pcs.filter((item) => item.children.length === 0);
|
||||
this.bmsNoParent = bmsNoParent;
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$sqDistance: 30px;
|
||||
$borderColor: #174a8e;
|
||||
$lineColor: #86bcc7;
|
||||
|
||||
.ems-dashboard-editor-container {
|
||||
background-color: #ffffff;
|
||||
padding: 0;
|
||||
color: #666666;
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
//云 、计算机 、箭头
|
||||
.top {
|
||||
z-index: 2;
|
||||
width: fit-content;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
// position: absolute;
|
||||
// top: 50%;
|
||||
// left: 0;
|
||||
// transform: translateY(-50%);
|
||||
//云 样式
|
||||
.cloud-container {
|
||||
margin: 0 auto;
|
||||
.cloud {
|
||||
width: 60px;
|
||||
height: 26px;
|
||||
background: #cbebfd;
|
||||
border-radius: 100px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
}
|
||||
.cloud:before,
|
||||
.cloud:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
background: #cbebfd;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 100%;
|
||||
}
|
||||
.cloud:before {
|
||||
top: -9px;
|
||||
left: 8px;
|
||||
}
|
||||
.cloud:after {
|
||||
top: -6px;
|
||||
right: 9px;
|
||||
}
|
||||
}
|
||||
//双箭头
|
||||
.double-arrows {
|
||||
height: fit-content;
|
||||
margin: 0 10px;
|
||||
text-align: center;
|
||||
.top-arrows,
|
||||
.bottom-arrows {
|
||||
height: 4px;
|
||||
width: 30px;
|
||||
background-color: #5ea9df;
|
||||
margin: 0 10px;
|
||||
position: relative;
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
.top-arrows {
|
||||
vertical-align: super;
|
||||
}
|
||||
.top-arrows::after {
|
||||
top: -4px;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid #5ea9df;
|
||||
border-top: 6px solid transparent;
|
||||
left: -11px;
|
||||
}
|
||||
.bottom-arrows {
|
||||
margin-top: 8px;
|
||||
&::after {
|
||||
top: -4px;
|
||||
border-top: 6px solid transparent;
|
||||
border-left: 6px solid #5ea9df;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
right: -11px;
|
||||
left: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//电脑
|
||||
.computer {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
img {
|
||||
width: 80px;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
.outer-border {
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
border: 1.5px solid $borderColor;
|
||||
border-radius: 5px;
|
||||
padding-left: 120px;
|
||||
padding-right: 20px;
|
||||
margin-left: -40px;
|
||||
}
|
||||
|
||||
// 设备列表
|
||||
.row-lists-container {
|
||||
font-size: 10px;
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
.row-title {
|
||||
position: absolute;
|
||||
left: -$sqDistance - 30px;
|
||||
top: calc(50% + 10px);
|
||||
transform: translateY(-50%);
|
||||
color: #000;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.row-lists {
|
||||
display: flex;
|
||||
position: relative;
|
||||
.row-items {
|
||||
position: relative;
|
||||
padding: 5px 0;
|
||||
&:not(:first-child) {
|
||||
margin-left: $sqDistance; //和外层父元素上下padding一致
|
||||
}
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 3px;
|
||||
width: $sqDistance - 2px;
|
||||
background: $lineColor;
|
||||
position: absolute;
|
||||
left: -$sqDistance;
|
||||
top: calc(50% + 10px);
|
||||
transform: scale(1, 0.4);
|
||||
}
|
||||
// 一列 第一个设备最上面的线
|
||||
&:first-child {
|
||||
&::before {
|
||||
width: $sqDistance + 20px;
|
||||
// top: -$sqDistance - 20px;
|
||||
}
|
||||
}
|
||||
// 一列 最后一个设备最下面的线
|
||||
// &:last-child {
|
||||
// &::after {
|
||||
// content: "";
|
||||
// display: block;
|
||||
// width: 3px;
|
||||
// height: $sqDistance - 2px;
|
||||
// background: $lineColor;
|
||||
// position: absolute;
|
||||
// bottom: -$sqDistance;
|
||||
// left: 50%;
|
||||
// transform: scale(0.4, 1);
|
||||
// }
|
||||
// }
|
||||
// 设备状态
|
||||
.status {
|
||||
margin: 0 auto 4px;
|
||||
width: fit-content;
|
||||
height: 18px;
|
||||
padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
font-size: 8px;
|
||||
line-height: 18px;
|
||||
border: 1px solid #08ffff;
|
||||
border-radius: 2px;
|
||||
background: #aaaaaa;
|
||||
color: #ffffff;
|
||||
&.status-running {
|
||||
background: #00c69c;
|
||||
}
|
||||
}
|
||||
// 图片+设备名称
|
||||
.row-items-img {
|
||||
position: relative;
|
||||
padding-top: 12px;
|
||||
img {
|
||||
width: 80px;
|
||||
height: auto;
|
||||
display: block;
|
||||
&.img-lq {
|
||||
width: 50px;
|
||||
}
|
||||
&.img-pcs {
|
||||
width: 50px;
|
||||
}
|
||||
&.img-db {
|
||||
width: 56px;
|
||||
}
|
||||
}
|
||||
.name {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 0;
|
||||
color: #666;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//子设备
|
||||
.row-lists-container-children {
|
||||
margin: 10px 0 0 $sqDistance;
|
||||
.parent-dash {
|
||||
position: relative;
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 40px;
|
||||
width: 3px;
|
||||
background: #ec7f8c;
|
||||
position: absolute;
|
||||
left: 20%;
|
||||
top: -40px;
|
||||
transform: scale(0.4, 1) rotate(-40deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
.parent-dash {
|
||||
width: fit-content;
|
||||
}
|
||||
.children-dash {
|
||||
margin: $sqDistance 0 0 $sqDistance;
|
||||
position: relative;
|
||||
.row-children-title {
|
||||
position: absolute;
|
||||
left: -$sqDistance - 30px;
|
||||
top: calc(50% + 10px);
|
||||
transform: translateY(-50%);
|
||||
color: #000;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.children-dash-items {
|
||||
position: relative;
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: $sqDistance;
|
||||
width: 3px;
|
||||
background: #ec7f8c;
|
||||
position: absolute;
|
||||
left: 20%;
|
||||
top: -$sqDistance;
|
||||
transform: scale(0.4, 1) rotate(-40deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,614 +0,0 @@
|
||||
<template>
|
||||
<div class="ems-dashboard-editor-container" v-loading="loading" >
|
||||
<div class="container" v-show="!empty">
|
||||
<div class="top">
|
||||
<div class="cloud-container">
|
||||
<div class="cloud">
|
||||
<span style="z-index:2;position: relative;">云</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="double-arrows">
|
||||
<div class="top-arrows"></div>
|
||||
<div class="bottom-arrows"></div>
|
||||
</div>
|
||||
<div class="computer">
|
||||
<img src="@/assets/images/ems/computer.png" alt="">
|
||||
<span style="z-index:2;position: relative;">ems</span>
|
||||
</div>
|
||||
<div class="arrow"></div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<!-- 四列设备-->
|
||||
<div class="zxlt-row">
|
||||
<!-- bms、pcs 下级和上级在一列 -->
|
||||
<div class="row-lists pcs-row-lists" v-if="showPcsAndBms">
|
||||
<div class="item-square">
|
||||
<div class="row-lists-title" v-if="showPcs">PCS({{pcs.length}})</div>
|
||||
<div class="row-lists-title" v-if="showBms">BMS({{bms.length}})</div>
|
||||
</div>
|
||||
<!-- 上下级块 class区分-->
|
||||
<div class="item-square pcs-has-children-item-square" :class="{'no-bms-list':!showBms}" v-for="(item,index) in pcsHasChildren" :key="index+'pcsHasChildren'">
|
||||
<!-- 左边的上级 上级只有一个-->
|
||||
<div class="item-lists parent-item-lists">
|
||||
<!-- 上级设备-->
|
||||
<div class="items normal-items-arrow">
|
||||
<div class="items-inner">
|
||||
<div style="text-align: center;margin-bottom:10px;">
|
||||
<div class="status" :class="item.communicationStatus === '0' ?'status-normal' : 'status-warn'">通讯状态:{{communicationStatusOptions[item.communicationStatus] || '-'}}</div>
|
||||
</div>
|
||||
<img v-if="item.pictureUrl" :src="item.pictureUrl">
|
||||
<img v-else :src="require('@/assets/images/ems/pcs.png')"/>
|
||||
<div class="name">{{item.deviceName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右边的下级 下级有多个-->
|
||||
<div class="item-lists children-item-lists">
|
||||
<!-- 下级设备 循环生成-->
|
||||
<div class="items children-items-arrow bms-children-arrow" v-for="children in item.children" :key="children.deviceId">
|
||||
<div class="items-inner">
|
||||
<div style="text-align: center;margin-bottom:10px;">
|
||||
<div class="status" :class="children.communicationStatus === '0' ?'status-normal' : 'status-warn'">通讯状态:{{communicationStatusOptions[children.communicationStatus] || '-'}}</div>
|
||||
</div>
|
||||
<img v-if="children.pictureUrl" :src="children.pictureUrl">
|
||||
<img v-else :src="require('@/assets/images/ems/bms.png')"/>
|
||||
<div class="name">{{children.deviceName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 没有上下级关系的bms、pcs-->
|
||||
<div class="item-square" :class="{'no-bms-list':!showBms}">
|
||||
<!-- 左边没有下级的pcs-->
|
||||
<div class="item-lists">
|
||||
<div class="items normal-items-arrow" v-for="item in pcsNoChildren" :key="item.deviceId">
|
||||
<div class="items-inner">
|
||||
<div style="text-align: center;margin-bottom:10px;">
|
||||
<div class="status" :class="item.communicationStatus === '0' ?'status-normal' : 'status-warn'">通讯状态:{{communicationStatusOptions[item.communicationStatus] || '-'}}</div>
|
||||
</div>
|
||||
<img v-if="item.pictureUrl" :src="item.pictureUrl">
|
||||
<img v-else :src="require('@/assets/images/ems/pcs.png')"/>
|
||||
<div class="name">{{item.deviceName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右边没有上级的bms-->
|
||||
<div class="item-lists">
|
||||
<!-- 下级设备 循环生成-->
|
||||
<div class="items children-items-arrow" v-for="item in bmsNoParent" :key="item.deviceId">
|
||||
<div class="items-inner">
|
||||
<div style="text-align: center;margin-bottom:10px;">
|
||||
<div class="status" :class="item.communicationStatus === '0' ?'status-normal' : 'status-warn'">通讯状态:{{communicationStatusOptions[item.communicationStatus] || '-'}}</div>
|
||||
</div>
|
||||
<img v-if="item.pictureUrl" :src="item.pictureUrl">
|
||||
<img v-else :src="require('@/assets/images/ems/bms.png')"/>
|
||||
<div class="name">{{item.deviceName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 电表-->
|
||||
<div class="row-lists" v-if="showDb">
|
||||
<div class="item-square">
|
||||
<div class="row-lists-title" style="width:100%;">电表({{db.length}})</div>
|
||||
</div>
|
||||
<div class="item-square">
|
||||
<!-- 左边的下级 下级有多个-->
|
||||
<div class="item-lists">
|
||||
<!-- 下级设备 循环生成-->
|
||||
<div class="items normal-items-arrow" v-for="item in db" :key="item.deviceId">
|
||||
<div class="items-inner">
|
||||
<div style="text-align: center;margin-bottom:10px;">
|
||||
<div class="status" :class="item.communicationStatus === '0' ?'status-normal' : 'status-warn'">通讯状态:{{communicationStatusOptions[item.communicationStatus] || '-'}}</div>
|
||||
</div>
|
||||
<img v-if="item.pictureUrl" :src="item.pictureUrl">
|
||||
<img v-else :src="require('@/assets/images/ems/bms.png')"/>
|
||||
<div class="name">{{item.deviceName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--冷却-->
|
||||
<div class="row-lists" v-if="showLq">
|
||||
<div class="item-square">
|
||||
<div class="row-lists-title" style="width:100%;">冷却({{lq.length}})</div>
|
||||
</div>
|
||||
<div class="item-square">
|
||||
<div class="item-lists">
|
||||
<div class="items normal-items-arrow" v-for="item in lq" :key="item.deviceId">
|
||||
<div class="items-inner">
|
||||
<div style="text-align: center;margin-bottom:10px;">
|
||||
<div class="status" :class="item.communicationStatus === '0' ?'status-normal' : 'status-warn'">通讯状态:{{communicationStatusOptions[item.communicationStatus] || '-'}}</div>
|
||||
</div>
|
||||
<img v-if="item.pictureUrl" :src="item.pictureUrl">
|
||||
<img v-else :src="require('@/assets/images/ems/bms.png')"/>
|
||||
<div class="name">{{item.deviceName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty v-show="empty" :image-size="200"></el-empty>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import {getDeviceList} from'@/api/ems/site'
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import {mapState} from "vuex";
|
||||
export default {
|
||||
name: 'DzjkZxlt',
|
||||
mixins: [getQuerySiteId],
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
pcs :[],
|
||||
bms:[],
|
||||
db:[],
|
||||
lq:[],
|
||||
pcsHasChildren:[],
|
||||
pcsNoChildren:[],
|
||||
bmsNoParent:[]
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
...mapState({
|
||||
communicationStatusOptions:(state)=>state.ems.communicationStatusOptions
|
||||
}),
|
||||
|
||||
showPcs(){
|
||||
return this.pcs.length>0
|
||||
},
|
||||
showBms(){
|
||||
return this.bms.length>0
|
||||
},
|
||||
showDb(){
|
||||
return this.db.length>0
|
||||
},
|
||||
showLq(){
|
||||
return this.lq.length>0
|
||||
},
|
||||
showPcsAndBms(){
|
||||
return this.showPcs || this.showBms
|
||||
},
|
||||
empty(){
|
||||
return !this.showBms && !this.showPcs && !this.showDb && !this.showLq
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
init(){
|
||||
this.pcs = []
|
||||
this.bms = []
|
||||
this.lq=[]
|
||||
this.db=[]
|
||||
this.bmsNoParent=[]
|
||||
this.loading = true
|
||||
getDeviceList(this.siteId).then(response => {
|
||||
const data =JSON.parse(JSON.stringify(response?.data || []))
|
||||
let pcs = [],bms=[],db=[],lq=[],bmsNoParent=[]
|
||||
data.forEach(item=>{
|
||||
// 电表
|
||||
if(item.deviceCategory === 'AMMETER'){
|
||||
db.push({...item,children:[]})
|
||||
}else if(item.deviceCategory === 'PCS'){
|
||||
// pcs
|
||||
pcs.push({...item,children:[]})
|
||||
}else if(item.deviceCategory === 'STACK'){
|
||||
// bms
|
||||
bms.push({...item,children:[]})
|
||||
}else if(item.deviceCategory === 'COOLING'){
|
||||
// 液冷
|
||||
lq.push({...item,children:[]})
|
||||
}
|
||||
})
|
||||
bms.forEach((item,index)=>{
|
||||
if(item.parentId){
|
||||
pcs.find(pcsItem=>pcsItem.deviceId === item.parentId).children.push(item)
|
||||
}else{
|
||||
bmsNoParent.push(item)
|
||||
}
|
||||
})
|
||||
this.pcs = pcs
|
||||
this.bms = bms
|
||||
this.lq=lq
|
||||
this.db=db
|
||||
this.pcsHasChildren = pcs.filter(item=>item.children.length > 0)
|
||||
this.pcsNoChildren = pcs.filter(item=>item.children.length === 0)
|
||||
this.bmsNoParent = bmsNoParent
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$distance:60px;
|
||||
$arrowDistance:80px;//margin:60+quare的padding10
|
||||
$arrowColoe:#5ea9df;
|
||||
$lineColoe:#5ea9df;
|
||||
.ems-dashboard-editor-container {
|
||||
background-color: #ffffff;
|
||||
padding:0;
|
||||
.container{
|
||||
position: relative;
|
||||
overflow-x: auto;
|
||||
}
|
||||
//云 、计算机 、箭头
|
||||
.top{
|
||||
width: 280px;
|
||||
font-size: 30px;
|
||||
line-height: 40px;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
//云 样式
|
||||
.cloud-container{
|
||||
padding-top:40px;
|
||||
margin:0 auto;
|
||||
.cloud {
|
||||
width: 150px;
|
||||
height: 60px;
|
||||
background: #cbebfd;
|
||||
border-radius: 200px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
color:#666666;
|
||||
}
|
||||
.cloud:before, .cloud:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background:#cbebfd;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.cloud:before {
|
||||
top: -28px;
|
||||
left: 20px;
|
||||
}
|
||||
.cloud:after {
|
||||
top: -31px;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
//双箭头
|
||||
.double-arrows {
|
||||
height: 50px;
|
||||
margin:20px 0;
|
||||
text-align: center;
|
||||
.top-arrows,.bottom-arrows{
|
||||
height: 100%;
|
||||
width: 6px;
|
||||
background-color: $arrowColoe;
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
position: relative;
|
||||
vertical-align: super;
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left:0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
|
||||
}
|
||||
}
|
||||
.top-arrows{
|
||||
vertical-align: super;
|
||||
}
|
||||
.top-arrows::after {
|
||||
bottom: -24px;
|
||||
border-bottom: 12px solid transparent;
|
||||
border-left: 12px solid transparent;
|
||||
border-right: 12px solid transparent;
|
||||
border-top: 14px solid $arrowColoe;
|
||||
left: -9px;
|
||||
}
|
||||
.bottom-arrows{
|
||||
margin-top:12px;
|
||||
&::after {
|
||||
top: -24px;
|
||||
border-top: 12px solid transparent;
|
||||
border-left: 12px solid transparent;
|
||||
border-right: 12px solid transparent;
|
||||
border-bottom: 14px solid $arrowColoe;
|
||||
left: -9px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//电脑
|
||||
.computer{
|
||||
margin:20px auto;
|
||||
text-align: center;
|
||||
color:#666666;
|
||||
position: relative;
|
||||
img {
|
||||
width: auto;
|
||||
height: 100px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.arrow{
|
||||
height: 50px;
|
||||
width: 30px;
|
||||
border-radius: 5px;
|
||||
background-color: $arrowColoe;
|
||||
position: relative;
|
||||
margin:0 auto;
|
||||
&::after{
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
left: -9px;
|
||||
border-top: 24px solid $arrowColoe;
|
||||
border-left: 24px solid transparent;
|
||||
border-bottom: 24px solid transparent;
|
||||
border-right: 24px solid transparent;
|
||||
bottom: -44px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.bottom{
|
||||
z-index:1;
|
||||
box-sizing: border-box;
|
||||
margin-top:50px;
|
||||
.zxlt-row{
|
||||
display: flex;
|
||||
padding:20px $distance;
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
&:before{
|
||||
content: '';
|
||||
display: block;
|
||||
width:calc(100% - 100px);
|
||||
height:1px;
|
||||
background-color: $lineColoe;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left: $distance/2;
|
||||
}
|
||||
.row-lists{
|
||||
height: fit-content;
|
||||
position: relative;
|
||||
&:before{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 1px;
|
||||
position: absolute;
|
||||
left:-($distance/2);
|
||||
top:-20px;
|
||||
background-color: $lineColoe;
|
||||
}
|
||||
//pcs列 bms右侧的边框
|
||||
&.pcs-row-lists{
|
||||
&:after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 1px;
|
||||
position: absolute;
|
||||
right:-(($distance/2) + 1);
|
||||
top:-20px;
|
||||
background-color: $lineColoe;
|
||||
}
|
||||
}
|
||||
&:not(:last-child){
|
||||
margin-right: $distance;
|
||||
}
|
||||
.item-square{
|
||||
//左右 两列
|
||||
display: flex;
|
||||
vertical-align: middle;
|
||||
align-items: flex-start;
|
||||
padding:10px;
|
||||
border-radius: 5px;
|
||||
&:not(:last-child){
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.row-lists-title{
|
||||
font-size: 20px;
|
||||
line-height: 20px;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
}
|
||||
.item-lists{
|
||||
position: relative;
|
||||
&:not(:last-child){
|
||||
margin-right:$distance;
|
||||
}
|
||||
//每个设备
|
||||
.items{
|
||||
background-color: #cbebfd;
|
||||
position: relative;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1), 0 0 0 rgba(0, 0, 0, 0.5);
|
||||
//普通设备 箭头方向
|
||||
&.normal-items-arrow{
|
||||
&:before{
|
||||
content: '';
|
||||
display: block;
|
||||
width:($arrowDistance/2) - 15;
|
||||
height: 4px;
|
||||
background-color: $arrowColoe;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left: -($arrowDistance/2);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
&:after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 0;
|
||||
width: 0;
|
||||
border-left: 10px solid #5ea9df;
|
||||
border-right: 10px solid transparent;
|
||||
border-bottom: 10px solid transparent;
|
||||
border-top: 10px solid transparent;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -15px;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
//下级的箭头
|
||||
&.children-items-arrow{
|
||||
&:before{
|
||||
content: '';
|
||||
display: block;
|
||||
width:($arrowDistance/2) - 15;
|
||||
height: 4px;
|
||||
background-color: $arrowColoe;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
right: -($arrowDistance/2);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
&:after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 0;
|
||||
width: 0;
|
||||
border-right: 10px solid #5ea9df;
|
||||
border-left: 10px solid transparent;
|
||||
border-bottom: 10px solid transparent;
|
||||
border-top: 10px solid transparent;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: -15px;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
&:not(:last-child){
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.items-inner{
|
||||
background-color: #ffffff;
|
||||
border-radius: 5px;
|
||||
padding:10px;
|
||||
width:130px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
img{
|
||||
width: 80px;
|
||||
height: auto;
|
||||
display: block;
|
||||
z-index:2;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.name{
|
||||
text-align: center;
|
||||
margin-top:10px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
z-index:2;
|
||||
}
|
||||
.status{
|
||||
z-index:2;
|
||||
margin-top:10px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
position: relative;
|
||||
padding-left:20px;
|
||||
display: inline;
|
||||
&.status-normal {
|
||||
&:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50%;
|
||||
background-color: #05AEA3;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:0;
|
||||
transform: translate(0,-50%);
|
||||
}
|
||||
}
|
||||
&.status-warn{
|
||||
&:before{
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50%;
|
||||
background-color: #FC6B69;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:0;
|
||||
transform: translate(0,-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.children-item-lists{
|
||||
//todo 手动修改
|
||||
&:before{
|
||||
content: '';
|
||||
display: block;
|
||||
width:40px;
|
||||
height: 4px;
|
||||
background-color: $arrowColoe;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left: -50px;
|
||||
transform:translateY(-50%);
|
||||
}
|
||||
&:after{
|
||||
content: '';
|
||||
display: block;
|
||||
height: 0;
|
||||
width: 0;
|
||||
border-left: 10px solid #5ea9df;
|
||||
border-right: 10px solid transparent;
|
||||
border-bottom: 10px solid transparent;
|
||||
border-top: 10px solid transparent;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -14px;
|
||||
transform:translateY(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.pcs-has-children-item-square{
|
||||
vertical-align: middle;
|
||||
align-items: center;
|
||||
background-color: #ffefad;
|
||||
}
|
||||
.no-bms-list{
|
||||
.item-lists{
|
||||
&:not(:last-child){
|
||||
margin-right:0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<div class="bottom-arrows"></div>
|
||||
</div>
|
||||
<div class="computer">
|
||||
<img src="@/assets/images/ems/computer.png" alt="" />
|
||||
<img src="@/assets/images/ems/computer.png" alt=""/>
|
||||
<span style="z-index: 2; position: relative">ems</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,27 +22,27 @@
|
||||
<div class="row-lists-container" v-if="showDb">
|
||||
<div class="row-title">电表({{ db.length }})</div>
|
||||
<div
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(db.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(db.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
>
|
||||
<template v-for="(item, index) in handlerList('db', outter)">
|
||||
<div :key="index" class="row-items">
|
||||
<div
|
||||
style="position: relative; z-index: 2; background-color: #fff"
|
||||
style="position: relative; z-index: 2; background-color: #fff"
|
||||
>
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.runningStatus === '2' ? 'status-running' : ''
|
||||
class="status"
|
||||
:class="
|
||||
item.deviceStatus === '1' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ deviceStatusOptions[item.runningStatus] }}
|
||||
{{ deviceStatusOptions[item.deviceStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img
|
||||
class="img-db"
|
||||
:src="require('@/assets/images/ems/db.png')"
|
||||
class="img-db"
|
||||
:src="require('@/assets/images/ems/db.png')"
|
||||
/>
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
@ -56,27 +56,27 @@
|
||||
<div class="row-lists-container" v-if="showLq">
|
||||
<div class="row-title">冷却({{ lq.length }})</div>
|
||||
<div
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(lq.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(lq.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
>
|
||||
<template v-for="(item, index) in handlerList('lq', outter)">
|
||||
<div :key="index" class="row-items">
|
||||
<div
|
||||
style="position: relative; z-index: 2; background-color: #fff"
|
||||
style="position: relative; z-index: 2; background-color: #fff"
|
||||
>
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.runningStatus === '2' ? 'status-running' : ''
|
||||
class="status"
|
||||
:class="
|
||||
item.deviceStatus === '1' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ deviceStatusOptions[item.runningStatus] }}
|
||||
{{ deviceStatusOptions[item.deviceStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img
|
||||
class="img-lq"
|
||||
:src="require('@/assets/images/ems/lq.png')"
|
||||
class="img-lq"
|
||||
:src="require('@/assets/images/ems/lq.png')"
|
||||
/>
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
@ -88,37 +88,37 @@
|
||||
|
||||
<!-- 没有上级设备的bms -->
|
||||
<div
|
||||
class="row-lists-container"
|
||||
v-if="bmsHasParentLength !== bms.length"
|
||||
class="row-lists-container"
|
||||
v-if="bmsHasParentLength !== bms.length"
|
||||
>
|
||||
<div class="row-title">BMS({{ bmsNoParent.length }})</div>
|
||||
<div
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(bmsNoParent.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(bmsNoParent.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
>
|
||||
<template
|
||||
v-for="(item, index) in handlerList('bmsNoParent', outter)"
|
||||
v-for="(item, index) in handlerList('bmsNoParent', outter)"
|
||||
>
|
||||
<div :key="index" class="row-items">
|
||||
<div
|
||||
style="position: relative; z-index: 2; background-color: #fff"
|
||||
style="position: relative; z-index: 2; background-color: #fff"
|
||||
>
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.runningStatus === '2' ? 'status-running' : ''
|
||||
class="status"
|
||||
:class="
|
||||
item.deviceStatus === '1' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ deviceStatusOptions[item.runningStatus] }}
|
||||
{{ deviceStatusOptions[item.deviceStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img row-items-img-bms">
|
||||
<div style="position:relative;">
|
||||
<img
|
||||
class="img-bms"
|
||||
:src="require('@/assets/images/ems/bms.png')"
|
||||
class="img-bms"
|
||||
:src="require('@/assets/images/ems/bms.png')"
|
||||
/>
|
||||
<div class="num">{{item.batteryNum || 0}}</div>
|
||||
<div class="num">{{ item.batteryNum || 0 }}</div>
|
||||
</div>
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
@ -130,8 +130,8 @@
|
||||
|
||||
<!-- pcs -->
|
||||
<div
|
||||
class="row-lists-container row-lists-container-with-children"
|
||||
v-if="showPcs"
|
||||
class="row-lists-container row-lists-container-with-children"
|
||||
v-if="showPcs"
|
||||
>
|
||||
<div class="row-title">
|
||||
PCS({{ pcs.length }}){{
|
||||
@ -139,56 +139,56 @@
|
||||
}}
|
||||
</div>
|
||||
<div
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(pcs.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
class="row-lists"
|
||||
v-for="outter in Math.ceil(pcs.length / 3)"
|
||||
:key="outter + 'row'"
|
||||
>
|
||||
<template v-for="(item, index) in handlerList('pcs', outter)">
|
||||
<div :key="index" class="row-items">
|
||||
<!-- 上级设备 -->
|
||||
<div class="parent-dash">
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.runningStatus === '2' ? 'status-running' : ''
|
||||
class="status"
|
||||
:class="
|
||||
item.deviceStatus === '1' ? 'status-running' : ''
|
||||
"
|
||||
>
|
||||
{{ deviceStatusOptions[item.runningStatus] }}
|
||||
{{ deviceStatusOptions[item.deviceStatus] }}
|
||||
</div>
|
||||
<div class="row-items-img">
|
||||
<img
|
||||
class="img-pcs"
|
||||
:src="require('@/assets/images/ems/pcs.png')"
|
||||
class="img-pcs"
|
||||
:src="require('@/assets/images/ems/pcs.png')"
|
||||
/>
|
||||
<div class="name">{{ item.deviceName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 下级设备 -->
|
||||
<div
|
||||
class="children-dash"
|
||||
v-if="item.children && item.children.length > 0"
|
||||
class="children-dash"
|
||||
v-if="item.children && item.children.length > 0"
|
||||
>
|
||||
<div
|
||||
class="status"
|
||||
:class="
|
||||
item.children[0].runningStatus === '2'
|
||||
class="status"
|
||||
:class="
|
||||
item.children[0].deviceStatus === '1'
|
||||
? 'status-running'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{
|
||||
deviceStatusOptions[
|
||||
item.children[0].runningStatus
|
||||
]
|
||||
item.children[0].deviceStatus
|
||||
]
|
||||
}}
|
||||
</div>
|
||||
<div class="row-items-img row-items-img-bms">
|
||||
<div style="position: relative">
|
||||
<img
|
||||
class="img-bms"
|
||||
:src="require('@/assets/images/ems/bms.png')"
|
||||
class="img-bms"
|
||||
:src="require('@/assets/images/ems/bms.png')"
|
||||
/>
|
||||
<div class="num">{{item.batteryNum || 0}}</div>
|
||||
<div class="num">{{ item.batteryNum || 0 }}</div>
|
||||
</div>
|
||||
<div class="name">{{ item.children[0].deviceName }}</div>
|
||||
</div>
|
||||
@ -204,9 +204,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDeviceList } from "@/api/ems/site";
|
||||
import {getDeviceList} from "@/api/ems/site";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import { mapState } from "vuex";
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "DzjkZxlt",
|
||||
mixins: [getQuerySiteId],
|
||||
@ -223,7 +224,7 @@ export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
deviceStatusOptions: (state) =>
|
||||
state.ems.deviceStatusOptions,
|
||||
state.ems.deviceStatusOptions,
|
||||
}),
|
||||
|
||||
showPcs() {
|
||||
@ -245,7 +246,7 @@ export default {
|
||||
},
|
||||
pcsHasChildren() {
|
||||
return this.pcs.filter(
|
||||
(item) => item.children && item.children.length > 0
|
||||
(item) => item.children && item.children.length > 0
|
||||
);
|
||||
},
|
||||
empty() {
|
||||
@ -270,46 +271,46 @@ export default {
|
||||
this.bmsNoParent = [];
|
||||
this.loading = true;
|
||||
getDeviceList(this.siteId)
|
||||
.then((response) => {
|
||||
const data = JSON.parse(JSON.stringify(response?.data || []));
|
||||
let pcs = [],
|
||||
bms = [],
|
||||
db = [],
|
||||
lq = [],
|
||||
bmsNoParent = [];
|
||||
data.forEach((item) => {
|
||||
// 电表
|
||||
if (item.deviceCategory === "AMMETER") {
|
||||
db.push({ ...item, children: [] });
|
||||
} else if (item.deviceCategory === "PCS") {
|
||||
// pcs
|
||||
pcs.push({ ...item, children: [] });
|
||||
} else if (item.deviceCategory === "STACK") {
|
||||
// bms
|
||||
bms.push({ ...item, children: [] });
|
||||
} else if (item.deviceCategory === "COOLING") {
|
||||
// 液冷
|
||||
lq.push({ ...item, children: [] });
|
||||
}
|
||||
.then((response) => {
|
||||
const data = JSON.parse(JSON.stringify(response?.data || []));
|
||||
let pcs = [],
|
||||
bms = [],
|
||||
db = [],
|
||||
lq = [],
|
||||
bmsNoParent = [];
|
||||
data.forEach((item) => {
|
||||
// 电表
|
||||
if (item.deviceCategory === "AMMETER") {
|
||||
db.push({...item, children: []});
|
||||
} else if (item.deviceCategory === "PCS") {
|
||||
// pcs
|
||||
pcs.push({...item, children: []});
|
||||
} else if (item.deviceCategory === "STACK") {
|
||||
// bms
|
||||
bms.push({...item, children: []});
|
||||
} else if (item.deviceCategory === "COOLING") {
|
||||
// 液冷
|
||||
lq.push({...item, children: []});
|
||||
}
|
||||
});
|
||||
bms.forEach((item, index) => {
|
||||
if (item.parentId) {
|
||||
pcs
|
||||
.find((pcsItem) => pcsItem.deviceId === item.parentId)
|
||||
.children.push(item);
|
||||
} else {
|
||||
bmsNoParent.push(item);
|
||||
}
|
||||
});
|
||||
this.pcs = pcs;
|
||||
this.bms = bms;
|
||||
this.lq = lq;
|
||||
this.db = db;
|
||||
this.bmsNoParent = bmsNoParent;
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
bms.forEach((item, index) => {
|
||||
if (item.parentId) {
|
||||
pcs
|
||||
.find((pcsItem) => pcsItem.deviceId === item.parentId)
|
||||
.children.push(item);
|
||||
} else {
|
||||
bmsNoParent.push(item);
|
||||
}
|
||||
});
|
||||
this.pcs = pcs;
|
||||
this.bms = bms;
|
||||
this.lq = lq;
|
||||
this.db = db;
|
||||
this.bmsNoParent = bmsNoParent;
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -329,6 +330,7 @@ $lineColor: #86bcc7;
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
//云 、计算机 、箭头
|
||||
.top {
|
||||
z-index: 2;
|
||||
@ -343,6 +345,7 @@ $lineColor: #86bcc7;
|
||||
//云 样式
|
||||
.cloud-container {
|
||||
margin: 0 auto;
|
||||
|
||||
.cloud {
|
||||
width: 60px;
|
||||
height: 26px;
|
||||
@ -354,6 +357,7 @@ $lineColor: #86bcc7;
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.cloud:before,
|
||||
.cloud:after {
|
||||
content: "";
|
||||
@ -363,20 +367,24 @@ $lineColor: #86bcc7;
|
||||
height: 30px;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
.cloud:before {
|
||||
top: -9px;
|
||||
left: 8px;
|
||||
}
|
||||
|
||||
.cloud:after {
|
||||
top: -6px;
|
||||
right: 9px;
|
||||
}
|
||||
}
|
||||
|
||||
//双箭头
|
||||
.double-arrows {
|
||||
height: fit-content;
|
||||
margin: 0 10px;
|
||||
text-align: center;
|
||||
|
||||
.top-arrows,
|
||||
.bottom-arrows {
|
||||
height: 4px;
|
||||
@ -384,6 +392,7 @@ $lineColor: #86bcc7;
|
||||
background-color: #5ea9df;
|
||||
margin: 0 10px;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
@ -392,9 +401,11 @@ $lineColor: #86bcc7;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.top-arrows {
|
||||
vertical-align: super;
|
||||
}
|
||||
|
||||
.top-arrows::after {
|
||||
top: -4px;
|
||||
border-bottom: 6px solid transparent;
|
||||
@ -403,8 +414,10 @@ $lineColor: #86bcc7;
|
||||
border-top: 6px solid transparent;
|
||||
left: -11px;
|
||||
}
|
||||
|
||||
.bottom-arrows {
|
||||
margin-top: 8px;
|
||||
|
||||
&::after {
|
||||
top: -4px;
|
||||
border-top: 6px solid transparent;
|
||||
@ -425,6 +438,7 @@ $lineColor: #86bcc7;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
|
||||
img {
|
||||
width: 80px;
|
||||
height: auto;
|
||||
@ -432,6 +446,7 @@ $lineColor: #86bcc7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.outer-border {
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
@ -448,11 +463,11 @@ $lineColor: #86bcc7;
|
||||
|
||||
&:not(:first-child) {
|
||||
background: linear-gradient(
|
||||
to top,
|
||||
transparent 0%,
|
||||
transparent 50%,
|
||||
#ccc 50%,
|
||||
#ccc 100%
|
||||
to top,
|
||||
transparent 0%,
|
||||
transparent 50%,
|
||||
#ccc 50%,
|
||||
#ccc 100%
|
||||
);
|
||||
background-size: 1px 10px;
|
||||
background-repeat: repeat-y;
|
||||
@ -467,8 +482,10 @@ $lineColor: #86bcc7;
|
||||
color: #000;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.row-lists {
|
||||
position: relative;
|
||||
|
||||
.row-items {
|
||||
position: relative;
|
||||
padding: 5px 0;
|
||||
@ -503,17 +520,21 @@ $lineColor: #86bcc7;
|
||||
border-radius: 2px;
|
||||
background: #aaaaaa;
|
||||
color: #ffffff;
|
||||
|
||||
&.status-running {
|
||||
background: #00c69c;
|
||||
}
|
||||
}
|
||||
|
||||
// 图片+设备名称
|
||||
.row-items-img {
|
||||
position: relative;
|
||||
padding-top: 12px;
|
||||
&.row-items-img-bms{
|
||||
|
||||
&.row-items-img-bms {
|
||||
padding-top: 14px;
|
||||
.num{
|
||||
|
||||
.num {
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
right: -2px;
|
||||
@ -526,21 +547,26 @@ $lineColor: #86bcc7;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 80px;
|
||||
height: auto;
|
||||
display: block;
|
||||
position: relative;
|
||||
|
||||
&.img-lq {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
&.img-pcs {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
&.img-db {
|
||||
width: 56px;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
@ -559,19 +585,24 @@ $lineColor: #86bcc7;
|
||||
&:not(:last-child) {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.row-items {
|
||||
display: flex;
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.parent-dash {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background-color: #fff;
|
||||
|
||||
> div {
|
||||
z-index: 2;
|
||||
position: inherit;
|
||||
}
|
||||
|
||||
&::after {
|
||||
z-index: 1;
|
||||
content: "";
|
||||
@ -585,16 +616,19 @@ $lineColor: #86bcc7;
|
||||
transform: scale(0.4, 1);
|
||||
}
|
||||
}
|
||||
|
||||
.children-dash {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background-color: #fff;
|
||||
margin: -20px 0 0 26px;
|
||||
height: fit-content;
|
||||
|
||||
> div {
|
||||
z-index: 2;
|
||||
position: inherit;
|
||||
}
|
||||
|
||||
&::after {
|
||||
z-index: 1;
|
||||
content: "";
|
||||
|
||||
@ -1,68 +1,68 @@
|
||||
<template>
|
||||
<div
|
||||
v-loading="loading"
|
||||
class="ems-dashboard-editor-container"
|
||||
style="background-color: #ffffff"
|
||||
v-loading="loading"
|
||||
class="ems-dashboard-editor-container"
|
||||
style="background-color: #ffffff"
|
||||
>
|
||||
<el-form ref="form" :model="form" label-position="top">
|
||||
<el-form-item
|
||||
label="站点"
|
||||
prop="siteIds"
|
||||
:rules="[{ required: true, message: '请选择站点' }]"
|
||||
label="站点"
|
||||
prop="siteIds"
|
||||
:rules="[{ required: true, message: '请选择站点' }]"
|
||||
>
|
||||
<el-radio-group v-model="form.siteIds" @input="changeSiteIds">
|
||||
<el-radio
|
||||
v-for="(item, index) in siteList"
|
||||
:key="index + 'zdListSearch'"
|
||||
:label="item.siteId"
|
||||
v-for="(item, index) in siteList"
|
||||
:key="index + 'zdListSearch'"
|
||||
:label="item.siteId"
|
||||
>
|
||||
{{ item.siteName }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="设备"
|
||||
prop="deviceCategory"
|
||||
:rules="[{ required: true, message: '请选择设备' }]"
|
||||
label="设备"
|
||||
prop="deviceCategory"
|
||||
:rules="[{ required: true, message: '请选择设备' }]"
|
||||
>
|
||||
<el-radio-group v-model="form.deviceCategory" @input="changeSiteIds">
|
||||
<el-radio
|
||||
v-for="(item, index) in deviceCategoryList"
|
||||
:key="index + 'sbListSearch'"
|
||||
:label="item.code"
|
||||
v-for="(item, index) in deviceCategoryList"
|
||||
:key="index + 'sbListSearch'"
|
||||
:label="item.code"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="isDtdc"
|
||||
label="单体电池(不超过5个)"
|
||||
prop="child"
|
||||
:rules="[{ required: true, message: '请选择单体电池' }]"
|
||||
v-if="isDtdc"
|
||||
label="单体电池(不超过5个)"
|
||||
prop="child"
|
||||
:rules="[{ required: true, message: '请选择单体电池' }]"
|
||||
>
|
||||
<el-cascader
|
||||
v-model="form.child"
|
||||
style="width: 400px"
|
||||
:props="{ multiple: true }"
|
||||
:show-all-levels="false"
|
||||
:options="childOptions"
|
||||
@change="handleChildChange"
|
||||
v-model="form.child"
|
||||
style="width: 400px"
|
||||
:props="{ multiple: true }"
|
||||
:show-all-levels="false"
|
||||
:options="childOptions"
|
||||
@change="handleChildChange"
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<div style="display: flex">
|
||||
<el-form-item
|
||||
label="点位"
|
||||
prop="pointName"
|
||||
:rules="[{ required: true, message: '请输入点位' }]"
|
||||
style="margin-right: 50px"
|
||||
label="点位"
|
||||
prop="pointName"
|
||||
:rules="[{ required: true, message: '请输入点位' }]"
|
||||
style="margin-right: 50px"
|
||||
>
|
||||
<el-autocomplete
|
||||
v-model="form.pointName"
|
||||
placeholder="请输入点位"
|
||||
clearable
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
@select="handleSelect"
|
||||
v-model="form.pointName"
|
||||
placeholder="请输入点位"
|
||||
clearable
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
@select="handleSelect"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
</div>
|
||||
@ -71,8 +71,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-card
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding time-range-card"
|
||||
shadow="always"
|
||||
class="common-card-container common-card-container-body-no-padding time-range-card"
|
||||
>
|
||||
<div slot="header" class="time-range-header">
|
||||
<span class="card-title">
|
||||
@ -83,10 +83,10 @@
|
||||
</el-radio-group>
|
||||
</span>
|
||||
<date-time-select
|
||||
ref="dateTimeSelect"
|
||||
:data-unit="form.dataUnit"
|
||||
@initDate="(e) => (form.dataRange = e || [])"
|
||||
@updateDate="updateDate"
|
||||
ref="dateTimeSelect"
|
||||
:data-unit="form.dataUnit"
|
||||
@initDate="(e) => (form.dataRange = e || [])"
|
||||
@updateDate="updateDate"
|
||||
/>
|
||||
</div>
|
||||
<div style="height: 350px" id="searchChart"></div>
|
||||
@ -97,18 +97,14 @@
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import resize from "@/mixins/ems/resize";
|
||||
import { getAllSites } from "@/api/ems/zddt";
|
||||
import {
|
||||
getAllDeviceCategory,
|
||||
getPointValueList,
|
||||
pointFuzzyQuery,
|
||||
getAllBatteryIdsBySites,
|
||||
} from "@/api/ems/search";
|
||||
import {getAllSites} from "@/api/ems/zddt";
|
||||
import {getAllBatteryIdsBySites, getAllDeviceCategory, getPointValueList, pointFuzzyQuery,} from "@/api/ems/search";
|
||||
import DateTimeSelect from "./DateTimeSelect.vue";
|
||||
|
||||
export default {
|
||||
name: "Search",
|
||||
mixins: [resize],
|
||||
components: { DateTimeSelect },
|
||||
components: {DateTimeSelect},
|
||||
computed: {
|
||||
isDtdc() {
|
||||
return this.form.deviceCategory === "BATTERY";
|
||||
@ -161,7 +157,7 @@ export default {
|
||||
getChildList() {
|
||||
this.childOptions = [];
|
||||
this.form.child = [];
|
||||
const { siteIds } = this.form;
|
||||
const {siteIds} = this.form;
|
||||
getAllBatteryIdsBySites([siteIds]).then((response) => {
|
||||
const data = response?.data || {};
|
||||
const base = 50;
|
||||
@ -178,7 +174,7 @@ export default {
|
||||
if (num === 0) return;
|
||||
for (let i = 1; i <= num; i++) {
|
||||
const start = (i - 1) * base + 1,
|
||||
end = i * base;
|
||||
end = i * base;
|
||||
options[index].children.push({
|
||||
value: i,
|
||||
label: `${start}-${end}`,
|
||||
@ -214,76 +210,88 @@ export default {
|
||||
this.getDate();
|
||||
},
|
||||
setOption(data) {
|
||||
// 点位类型 dataType 1-瞬时值 2-累计值 仅当值为2展示差值
|
||||
// 图表类型 chartType 1-曲线图,2-箱线图
|
||||
if (!this.chart) return;
|
||||
this.chart.clear();
|
||||
console.log("返回的数据", data);
|
||||
let dataset = [];
|
||||
if (data.length > 0) {
|
||||
data.forEach((item, index) => {
|
||||
item.deviceList.forEach((inner) => {
|
||||
dataset.push({
|
||||
name: `${
|
||||
this.isDtdc
|
||||
? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}`
|
||||
: ""
|
||||
}${inner.deviceId}`,
|
||||
type: "line",
|
||||
markPoint: {
|
||||
symbolSize: 30,
|
||||
emphasis: {
|
||||
disabled:false//打开 鼠标高亮
|
||||
},
|
||||
data: [//最大值、最小值
|
||||
{
|
||||
// type: 'max',
|
||||
name: `最大值`,
|
||||
coord:[inner.maxDate,inner.maxValue],
|
||||
relativeTo:'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
},
|
||||
},
|
||||
{
|
||||
// type: 'min',
|
||||
name: `最小值`,
|
||||
coord:[inner.minDate,inner.minValue],
|
||||
relativeTo:'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
xdata: [],
|
||||
data: [],
|
||||
});
|
||||
const length = dataset.length;
|
||||
inner.pointValueList.forEach((value) => {
|
||||
dataset[length - 1].xdata.push(value.valueDate);
|
||||
dataset[length - 1].data.push(value.pointValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
if (!data || data.length <= 0) {
|
||||
this.$message.warning("暂无数据");
|
||||
}
|
||||
console.log("图表数据", dataset);
|
||||
console.log('展示的图表类型chartType', data[0].chartType)
|
||||
|
||||
if (data[0].chartType === 2) {
|
||||
// 箱型图
|
||||
this.setBoxOption(data)
|
||||
} else {
|
||||
//折线图
|
||||
this.setLineOption(data)
|
||||
}
|
||||
},
|
||||
setLineOption(data) {
|
||||
let dataset = [];
|
||||
data.forEach((item, index) => {
|
||||
item.deviceList.forEach((inner) => {
|
||||
dataset.push({
|
||||
name: `${
|
||||
this.isDtdc
|
||||
? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}`
|
||||
: ""
|
||||
}${inner.deviceId}`,
|
||||
type: "line",
|
||||
markPoint: {
|
||||
symbolSize: 30,
|
||||
emphasis: {
|
||||
disabled: false//打开 鼠标高亮
|
||||
},
|
||||
data: [//最大值、最小值
|
||||
{
|
||||
// type: 'max',
|
||||
name: `最大值`,
|
||||
coord: [inner.maxDate, inner.maxValue],
|
||||
relativeTo: 'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最大值:${inner.maxValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
},
|
||||
},
|
||||
{
|
||||
// type: 'min',
|
||||
name: `最小值`,
|
||||
coord: [inner.minDate, inner.minValue],
|
||||
relativeTo: 'coordinate',
|
||||
label: {
|
||||
position: "top",
|
||||
formatter: item.dataType === 2 ? ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
`差值:${inner.diffValue}`,
|
||||
]).join('\n') : ([
|
||||
`最小值:${inner.minValue}`,
|
||||
// `平均值:${inner.avgValue}`,
|
||||
]).join('\n'),
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
xdata: [],
|
||||
data: [],
|
||||
});
|
||||
const length = dataset.length;
|
||||
inner.pointValueList.forEach((value) => {
|
||||
dataset[length - 1].xdata.push(value.valueDate);
|
||||
dataset[length - 1].data.push(value.pointValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
console.log("折线图图表数据", dataset);
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
// left: 'center',
|
||||
@ -305,7 +313,120 @@ export default {
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: { type: "category", data: dataset?.[0]?.xdata || [] },
|
||||
xAxis: {type: "category", data: dataset?.[0]?.xdata || []},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside",
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
],
|
||||
series: dataset,
|
||||
});
|
||||
},
|
||||
setBoxOption(data) {
|
||||
let dataset = [];
|
||||
data.forEach((item, index) => {
|
||||
item.deviceList.forEach((inner) => {
|
||||
dataset.push({
|
||||
name: `${
|
||||
this.isDtdc
|
||||
? `${inner.parentDeviceId ? inner.parentDeviceId + "-" : ""}`
|
||||
: ""
|
||||
}${inner.deviceId}`,
|
||||
type: "boxplot",
|
||||
// markPoint: {
|
||||
// symbolSize: 30,
|
||||
// emphasis: {
|
||||
// disabled: false//打开 鼠标高亮
|
||||
// },
|
||||
// data: [//最大值、最小值
|
||||
// {
|
||||
// // type: 'max',
|
||||
// name: `最大值`,
|
||||
// coord: [inner.maxDate, inner.maxValue],
|
||||
// relativeTo: 'coordinate',
|
||||
// label: {
|
||||
// position: "top",
|
||||
// formatter: item.dataType === 2 ? ([
|
||||
// `最大值:${inner.maxValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// `差值:${inner.diffValue}`,
|
||||
// ]).join('\n') : ([
|
||||
// `最大值:${inner.maxValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// ]).join('\n'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// // type: 'min',
|
||||
// name: `最小值`,
|
||||
// coord: [inner.minDate, inner.minValue],
|
||||
// relativeTo: 'coordinate',
|
||||
// label: {
|
||||
// position: "top",
|
||||
// formatter: item.dataType === 2 ? ([
|
||||
// `最小值:${inner.minValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// `差值:${inner.diffValue}`,
|
||||
// ]).join('\n') : ([
|
||||
// `最小值:${inner.minValue}`,
|
||||
// // `平均值:${inner.avgValue}`,
|
||||
// ]).join('\n'),
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
xdata: [],
|
||||
data: [],
|
||||
});
|
||||
const length = dataset.length;
|
||||
inner.pointValueList.forEach((value) => {
|
||||
const {valueDate, min, q1, median, q3, max} = value
|
||||
dataset[length - 1].xdata.push(valueDate);
|
||||
dataset[length - 1].data.push([min, q1, median, q3, max]);
|
||||
});
|
||||
});
|
||||
});
|
||||
console.log("箱型图图表数据", dataset);
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
// left: 'center',
|
||||
// top: '10',
|
||||
},
|
||||
grid: {
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function (params) {
|
||||
let data = params.data;
|
||||
let result = params.marker + params.name + ' ' + params.seriesName + '<br/>';
|
||||
result += '最小值: ' + data[1] + '<br/>';
|
||||
result += '平均值: ' + data[3] + '<br/>';
|
||||
result += '最大值: ' + data[5];
|
||||
return result;
|
||||
}
|
||||
// trigger: "axis",
|
||||
// axisPointer: {
|
||||
// type: 'cross',
|
||||
// },
|
||||
// axisPointer: {
|
||||
// // 坐标轴指示器,坐标轴触发有效
|
||||
// type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
// },
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
},
|
||||
xAxis: {type: "category", data: dataset?.[0]?.xdata || []},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
@ -345,9 +466,9 @@ export default {
|
||||
}).then((response) => {
|
||||
const data = response?.data || [];
|
||||
cb(
|
||||
data.map((item) => {
|
||||
return { name: item, value: item };
|
||||
})
|
||||
data.map((item) => {
|
||||
return {name: item, value: item};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
@ -359,10 +480,11 @@ export default {
|
||||
},
|
||||
getZdList() {
|
||||
return getAllSites()
|
||||
.then((response) => {
|
||||
this.siteList = response.data || [];
|
||||
})
|
||||
.finally(() => {});
|
||||
.then((response) => {
|
||||
this.siteList = response.data || [];
|
||||
})
|
||||
.finally(() => {
|
||||
});
|
||||
},
|
||||
getDate() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
@ -371,8 +493,8 @@ export default {
|
||||
return this.$message.error("请输入正确的点位");
|
||||
}
|
||||
if (
|
||||
this.isDtdc &&
|
||||
(this.form.child.length === 0 || this.form.child.length > 5)
|
||||
this.isDtdc &&
|
||||
(this.form.child.length === 0 || this.form.child.length > 5)
|
||||
) {
|
||||
return this.$message.error("请选择单体电池且不能超过5个");
|
||||
}
|
||||
@ -417,12 +539,12 @@ export default {
|
||||
endDate,
|
||||
siteDeviceMap,
|
||||
})
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
.then((response) => {
|
||||
this.setOption(response?.data || []);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -440,7 +562,7 @@ export default {
|
||||
this.initChart();
|
||||
this.$refs.dateTimeSelect.init();
|
||||
Promise.all([this.getDeviceCategory(), this.getZdList()]).finally(
|
||||
() => (this.loading = false)
|
||||
() => (this.loading = false)
|
||||
);
|
||||
});
|
||||
},
|
||||
|
||||
@ -1,42 +1,42 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-loading="loading"
|
||||
width="90%"
|
||||
:visible.sync="dialogTableVisible"
|
||||
class="ems-dialog"
|
||||
title="保护方案"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="false"
|
||||
v-loading="loading"
|
||||
width="90%"
|
||||
:visible.sync="dialogTableVisible"
|
||||
class="ems-dialog"
|
||||
title="保护方案"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="false"
|
||||
>
|
||||
<el-form
|
||||
v-loading="loading > 0"
|
||||
ref="addTempForm"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
size="medium"
|
||||
label-width="140px"
|
||||
v-loading="loading > 0"
|
||||
ref="addTempForm"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
size="medium"
|
||||
label-width="140px"
|
||||
>
|
||||
<el-form-item label="站点" prop="siteId">
|
||||
<el-select
|
||||
v-model="formData.siteId"
|
||||
placeholder="请选择"
|
||||
:style="{ width: '50%' }"
|
||||
@change="changeType"
|
||||
v-model="formData.siteId"
|
||||
placeholder="请选择"
|
||||
:style="{ width: '50%' }"
|
||||
@change="changeType"
|
||||
>
|
||||
<el-option
|
||||
:label="item.siteName"
|
||||
:value="item.siteId"
|
||||
v-for="(item, index) in siteList"
|
||||
:key="index + 'siteOptions'"
|
||||
:label="item.siteName"
|
||||
:value="item.siteId"
|
||||
v-for="(item, index) in siteList"
|
||||
:key="index + 'siteOptions'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备保护名称" prop="faultName">
|
||||
<el-input
|
||||
v-model="formData.faultName"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
:style="{ width: '50%' }"
|
||||
v-model="formData.faultName"
|
||||
placeholder="请输入"
|
||||
clearable
|
||||
:style="{ width: '50%' }"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -53,9 +53,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="是否告警" prop="isAlert">
|
||||
<el-checkbox
|
||||
v-model="formData.isAlert"
|
||||
:true-label="1"
|
||||
:false-label="0"
|
||||
v-model="formData.isAlert"
|
||||
:true-label="1"
|
||||
:false-label="0"
|
||||
></el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警等级" prop="faultLevel">
|
||||
@ -81,11 +81,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click.native.prevent="addRow('protectionSettings')"
|
||||
block
|
||||
type="primary"
|
||||
size="mini"
|
||||
style="margin-bottom: 20px"
|
||||
@click.native.prevent="addRow('protectionSettings')"
|
||||
block
|
||||
type="primary"
|
||||
size="mini"
|
||||
style="margin-bottom: 20px"
|
||||
>
|
||||
新增保护前提
|
||||
</el-button>
|
||||
@ -103,38 +103,40 @@
|
||||
<div>操作</div>
|
||||
</div>
|
||||
<div
|
||||
class="time-lists"
|
||||
v-for="(item, index) in protectionSettings"
|
||||
:key="'protectionSettings' + index"
|
||||
class="time-lists"
|
||||
v-for="(item, index) in protectionSettings"
|
||||
:key="'protectionSettings' + index"
|
||||
>
|
||||
<div>
|
||||
<el-cascader
|
||||
v-model="item.deviceId"
|
||||
:options="childOptions"
|
||||
:props="props"
|
||||
:show-all-levels="false"
|
||||
:ref="'protectionSettings'+index"
|
||||
@change="(v)=>handleChange(v,'protectionSettings',index)"
|
||||
></el-cascader>
|
||||
</div>
|
||||
<div>
|
||||
<el-autocomplete
|
||||
v-model="item.point"
|
||||
placeholder="请输入点位"
|
||||
clearable
|
||||
:fetch-suggestions="
|
||||
v-model="item.point"
|
||||
placeholder="请输入点位"
|
||||
clearable
|
||||
:fetch-suggestions="
|
||||
(q, c) =>
|
||||
querySearchAsync(q, c, index, 'protectionSettings')
|
||||
"
|
||||
@select="(v) => handleSelect(v, index, 'protectionSettings')"
|
||||
@select="(v) => handleSelect(v, index, 'protectionSettings')"
|
||||
></el-autocomplete>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-select v-model="item.faultOperator" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(value, key) in comparisonOperatorOptions"
|
||||
:key="key + 'faultOperator'"
|
||||
:label="key"
|
||||
:value="value"
|
||||
v-for="(value, key) in comparisonOperatorOptions"
|
||||
:key="key + 'faultOperator'"
|
||||
:label="key"
|
||||
:value="value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@ -145,35 +147,35 @@
|
||||
<div>
|
||||
<el-select v-model="item.releaseOperator" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(value, key) in comparisonOperatorOptions"
|
||||
:key="key + 'releaseOperator'"
|
||||
:label="key"
|
||||
:value="value"
|
||||
v-for="(value, key) in comparisonOperatorOptions"
|
||||
:key="key + 'releaseOperator'"
|
||||
:label="key"
|
||||
:value="value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-input
|
||||
placeholder="请输入释放值"
|
||||
v-model="item.releaseValue"
|
||||
placeholder="请输入释放值"
|
||||
v-model="item.releaseValue"
|
||||
>
|
||||
</el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-select v-model="item.relationNext" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(value, key) in relationWithPoint"
|
||||
:key="key + 'relation'"
|
||||
:label="key"
|
||||
:value="value"
|
||||
v-for="(value, key) in relationWithPoint"
|
||||
:key="key + 'relation'"
|
||||
:label="key"
|
||||
:value="value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click.native.prevent="deleteRow(index,'protectionSettings')"
|
||||
type="warning"
|
||||
size="mini"
|
||||
@click.native.prevent="deleteRow(index,'protectionSettings')"
|
||||
type="warning"
|
||||
size="mini"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
@ -198,11 +200,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click.native.prevent="addRow('protectionPlan')"
|
||||
block
|
||||
type="primary"
|
||||
size="mini"
|
||||
style="margin-bottom: 20px"
|
||||
@click.native.prevent="addRow('protectionPlan')"
|
||||
block
|
||||
type="primary"
|
||||
size="mini"
|
||||
style="margin-bottom: 20px"
|
||||
>
|
||||
新增保护方案
|
||||
</el-button>
|
||||
@ -217,27 +219,29 @@
|
||||
<div>操作</div>
|
||||
</div>
|
||||
<div
|
||||
class="time-lists"
|
||||
v-for="(item, index) in protectionPlan"
|
||||
:key="'protectionPlan' + index"
|
||||
class="time-lists"
|
||||
v-for="(item, index) in protectionPlan"
|
||||
:key="'protectionPlan' + index"
|
||||
>
|
||||
<div>
|
||||
<el-cascader
|
||||
v-model="item.deviceId"
|
||||
:show-all-levels="false"
|
||||
:options="childOptions"
|
||||
:props="props"
|
||||
:ref="'protectionPlan'+index"
|
||||
@change="(v)=>handleChange(v,'protectionPlan',index)"
|
||||
></el-cascader>
|
||||
</div>
|
||||
<div>
|
||||
<el-autocomplete
|
||||
v-model="item.point"
|
||||
placeholder="请输入点位"
|
||||
clearable
|
||||
:fetch-suggestions="
|
||||
v-model="item.point"
|
||||
placeholder="请输入点位"
|
||||
clearable
|
||||
:fetch-suggestions="
|
||||
(q, c) => querySearchAsync(q, c, index, 'protectionPlan')
|
||||
"
|
||||
@select="(v) => handleSelect(v, index, 'protectionPlan')"
|
||||
@select="(v) => handleSelect(v, index, 'protectionPlan')"
|
||||
></el-autocomplete>
|
||||
</div>
|
||||
|
||||
@ -248,9 +252,9 @@
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click.native.prevent="deleteRow(index,'protectionPlan')"
|
||||
type="warning"
|
||||
size="mini"
|
||||
@click.native.prevent="deleteRow(index,'protectionPlan')"
|
||||
type="warning"
|
||||
size="mini"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
@ -267,16 +271,12 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import { getAllSites } from "@/api/ems/zddt";
|
||||
import { validText } from "@/utils/validate";
|
||||
import {
|
||||
updateProtectPlan,
|
||||
addProtectPlan,
|
||||
getProtectPlan,
|
||||
getDeviceListBySiteAndCategory
|
||||
} from "@/api/ems/site";
|
||||
import { getAllDeviceCategory, pointFuzzyQuery } from "@/api/ems/search";
|
||||
import {mapState} from "vuex";
|
||||
import {getAllSites} from "@/api/ems/zddt";
|
||||
import {validText} from "@/utils/validate";
|
||||
import {addProtectPlan, getDeviceListBySiteAndCategory, getProtectPlan, updateProtectPlan} from "@/api/ems/site";
|
||||
import {getAllDeviceCategory, pointFuzzyQuery} from "@/api/ems/search";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const validateText = (rule, value, callback) => {
|
||||
@ -287,9 +287,17 @@ export default {
|
||||
}
|
||||
};
|
||||
return {
|
||||
mode:'',
|
||||
props: {
|
||||
// emitPath: false,//在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
lazy: true,
|
||||
lazyLoad: (node, resolve) => {
|
||||
console.log('---------node', node)
|
||||
this.getDeviceList(node, resolve)
|
||||
}
|
||||
},
|
||||
mode: '',
|
||||
loading: 0,
|
||||
childOptions:[],
|
||||
childOptions: [],
|
||||
protectionSettings: [],
|
||||
protectionPlan: [],
|
||||
dialogTableVisible: false,
|
||||
@ -302,7 +310,7 @@ export default {
|
||||
faultLevel: 1, //告警等级
|
||||
faultDelaySeconds: "", //故障延时
|
||||
releaseDelaySeconds: "", //释放延时
|
||||
description:'',//方案描述
|
||||
description: '',//方案描述
|
||||
},
|
||||
rules: {
|
||||
siteId: [
|
||||
@ -313,22 +321,22 @@ export default {
|
||||
},
|
||||
],
|
||||
faultName: [
|
||||
{ required: true, message: "请输入设备保护名称", trigger: "blur" },
|
||||
{required: true, message: "请输入设备保护名称", trigger: "blur"},
|
||||
],
|
||||
isAlert: [
|
||||
{ required: true, message: "请选择是否告警", trigger: "blur" },
|
||||
{required: true, message: "请选择是否告警", trigger: "blur"},
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: "请输入设备描述", trigger: "blur" },
|
||||
{ validator: validateText, trigger: "blur" },
|
||||
{required: true, message: "请输入设备描述", trigger: "blur"},
|
||||
{validator: validateText, trigger: "blur"},
|
||||
],
|
||||
faultDelaySeconds: [
|
||||
{ required: true, message: "请输入保护前提延时", trigger: "blur" },
|
||||
{ validator: validateText, trigger: "blur" },
|
||||
{required: true, message: "请输入保护前提延时", trigger: "blur"},
|
||||
{validator: validateText, trigger: "blur"},
|
||||
],
|
||||
releaseDelaySeconds: [
|
||||
{ required: true, message: "请输入保护方案延时", trigger: "blur" },
|
||||
{ validator: validateText, trigger: "blur" },
|
||||
{required: true, message: "请输入保护方案延时", trigger: "blur"},
|
||||
{validator: validateText, trigger: "blur"},
|
||||
],
|
||||
},
|
||||
};
|
||||
@ -336,24 +344,24 @@ export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
communicationStatusOptions: (state) =>
|
||||
state?.ems?.communicationStatusOptions || {},
|
||||
state?.ems?.communicationStatusOptions || {},
|
||||
deviceTypeOptions: (state) => state?.ems?.deviceTypeOptions || {},
|
||||
comparisonOperatorOptions: (state) =>
|
||||
state?.ems?.comparisonOperatorOptions || {},
|
||||
state?.ems?.comparisonOperatorOptions || {},
|
||||
relationWithPoint: (state) => state?.ems?.relationWithPoint || {},
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
open(id,siteId){
|
||||
this.dialogTableVisible=true
|
||||
open(id, siteId) {
|
||||
this.dialogTableVisible = true
|
||||
this.getZdList();
|
||||
this.getDeviceCategoryList().then(()=>{
|
||||
if(id && siteId) {
|
||||
this.getDeviceList('PCS',siteId)
|
||||
this.getDeviceList('STACK',siteId)
|
||||
this.getDeviceCategoryList().then(() => {
|
||||
if (id && siteId) {
|
||||
// this.getDeviceList('PCS', siteId)
|
||||
// this.getDeviceList('STACK', siteId)
|
||||
}
|
||||
});
|
||||
if(id){
|
||||
if (id) {
|
||||
this.formData.id = id
|
||||
this.mode = 'edit'
|
||||
getProtectPlan(id).then(response => {
|
||||
@ -365,53 +373,74 @@ export default {
|
||||
isAlert: data?.isAlert || 0, //是否告警
|
||||
faultLevel: data?.faultLevel || 1, //告警等级
|
||||
faultDelaySeconds: data?.faultDelaySeconds || "", //故障延时
|
||||
releaseDelaySeconds: data?.releaseDelaySeconds ||"", //释放延时
|
||||
description: data?.description ||'',//方案描述
|
||||
releaseDelaySeconds: data?.releaseDelaySeconds || "", //释放延时
|
||||
description: data?.description || '',//方案描述
|
||||
}
|
||||
const plan =(JSON.parse(data?.protectionPlan || [])).map(item=>{
|
||||
return Object.assign({},item,{
|
||||
deviceId:[item.deviceCategory || '',item.deviceId || ''],
|
||||
const plan = (JSON.parse(data?.protectionPlan || [])).map(item => {
|
||||
const index = this.childOptions.findIndex(i => i.value === item.deviceCategory)
|
||||
if (index > -1) {
|
||||
!this.childOptions[index].children.find(i => i.value === item.deviceId) && this.childOptions[index].children.push({
|
||||
value: item.deviceId,
|
||||
label: item.deviceName,
|
||||
leaf: true
|
||||
})
|
||||
}
|
||||
return Object.assign({}, item, {
|
||||
deviceId: [item.deviceCategory || '', item.deviceId || ''],
|
||||
deviceName: [item.categoryName || '', item.deviceName || ''],
|
||||
})
|
||||
})
|
||||
const settings =(JSON.parse(data?.protectionSettings || [])).map(item=>{
|
||||
return Object.assign({},item,{
|
||||
deviceId:[item.deviceCategory || '',item.deviceId || ''],
|
||||
const settings = (JSON.parse(data?.protectionSettings || [])).map(item => {
|
||||
const index = this.childOptions.findIndex(i => i.value === item.deviceCategory)
|
||||
if (index > -1) {
|
||||
!this.childOptions[index].children.find(i => i.value === item.deviceId) && this.childOptions[index].children.push({
|
||||
value: item.deviceId,
|
||||
label: item.deviceName,
|
||||
leaf: true
|
||||
})
|
||||
}
|
||||
return Object.assign({}, item, {
|
||||
deviceId: [item.deviceCategory || '', item.deviceId || ''],
|
||||
deviceName: [item.categoryName || '', item.deviceName || ''],
|
||||
})
|
||||
})
|
||||
this.$nextTick(()=>{
|
||||
this.protectionPlan.splice(0,0,...plan)
|
||||
this.protectionSettings.splice(0,0,...settings)
|
||||
this.$nextTick(() => {
|
||||
this.protectionPlan.splice(0, 0, ...plan)
|
||||
this.protectionSettings.splice(0, 0, ...settings)
|
||||
})
|
||||
console.log('获取设备保护详情并初始化',this.formData,this.protectionPlan,this.protectionSettings)
|
||||
console.log('获取设备保护详情并初始化', this.formData, this.protectionPlan, this.protectionSettings, this.childOptions)
|
||||
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
this.mode = 'add'
|
||||
}
|
||||
},
|
||||
// 新增设备保护前提、设备保护方案
|
||||
addRow(type) {
|
||||
const item = type === 'protectionSettings' ? {
|
||||
deviceId:[],//设备ID
|
||||
deviceId: [],//设备ID
|
||||
deviceName: [],
|
||||
deviceCategory: "",//设备类型 英文
|
||||
categoryName:'',//设备类型名称 中文
|
||||
categoryName: '',//设备类型名称 中文
|
||||
point: "",//点位 英文
|
||||
pointName:"",//点位 中文
|
||||
pointName: "",//点位 中文
|
||||
faultValue: "",//故障值
|
||||
releaseValue: "",//释放值
|
||||
faultOperator: "",//故障值比较关系
|
||||
releaseOperator: "",//释放值比较关系
|
||||
relationNext: "",//与下一个点位的关系
|
||||
} : {
|
||||
deviceId:[],
|
||||
deviceId: [],
|
||||
deviceName: [],
|
||||
deviceCategory: "",//设备类型 英文
|
||||
categoryName:'',//设备类型名称 中文
|
||||
categoryName: '',//设备类型名称 中文
|
||||
point: "",
|
||||
pointName:"",
|
||||
pointName: "",
|
||||
value: "",//设置值
|
||||
}
|
||||
// this.$set(this[type], this[type].length, item);
|
||||
this[type].splice(this[type].length,0,item)
|
||||
console.log('新增设备保护前提、方案',type,this[type])
|
||||
this[type].splice(this[type].length, 0, item)
|
||||
console.log('新增设备保护前提、方案', type, this[type])
|
||||
},
|
||||
// 删除设备保护前提、设备保护方案
|
||||
deleteRow(index, type) {
|
||||
@ -435,25 +464,25 @@ export default {
|
||||
}).then((response) => {
|
||||
const data = response?.data || [];
|
||||
cb(
|
||||
data.map((item) => {
|
||||
return { name: item, value: item };
|
||||
})
|
||||
data.map((item) => {
|
||||
return {name: item, value: item};
|
||||
})
|
||||
);
|
||||
});
|
||||
},
|
||||
// 点位选择
|
||||
handleSelect(data, index, type) {
|
||||
console.log('选择点位',data,index,type)
|
||||
console.log('选择点位', data, index, type)
|
||||
// this.$set(this[type], index, Object.assign({},this[type][index],{
|
||||
// point:data.value,
|
||||
// pointName:data.value,
|
||||
// }));
|
||||
let line = Object.assign({},this[type][index],{
|
||||
point:data.value,
|
||||
pointName:data.value,
|
||||
let line = Object.assign({}, this[type][index], {
|
||||
point: data.value,
|
||||
pointName: data.value,
|
||||
})
|
||||
this[type].splice(index,1,line);
|
||||
console.log('选择点位配置完成',this[type][index])
|
||||
this[type].splice(index, 1, line);
|
||||
console.log('选择点位配置完成', this[type][index])
|
||||
},
|
||||
|
||||
// 获取设备类别-不区分站点
|
||||
@ -461,79 +490,86 @@ export default {
|
||||
this.loading += 1;
|
||||
return getAllDeviceCategory()
|
||||
.then((response) => {
|
||||
const data = (response?.data || []).filter(item => ['PCS','STACK'].includes(item.code));
|
||||
// this.childOptions=[]
|
||||
this.$set(this,'childOptions',[])
|
||||
let arr =[]
|
||||
const data = (response?.data || []);
|
||||
this.$set(this, 'childOptions', [])
|
||||
let arr = []
|
||||
data.forEach((item) => {
|
||||
arr.push({
|
||||
value: item.code,
|
||||
label: item.name,
|
||||
children:[]
|
||||
leaf: false,
|
||||
children: []
|
||||
})
|
||||
})
|
||||
this.childOptions.splice(0,0,...arr)
|
||||
console.log('获取设备类型',data,this.childOptions)
|
||||
this.childOptions.splice(0, 0, ...arr)
|
||||
console.log('获取设备类型', data, this.childOptions)
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading -= 1;
|
||||
});
|
||||
},
|
||||
//获取设备列表-区分站点
|
||||
getDeviceList(deviceCategory,siteId){
|
||||
this.$nextTick(()=>{
|
||||
getDeviceListBySiteAndCategory({siteId:siteId || this.formData.siteId,deviceCategory}).then((response) => {
|
||||
const data = (response?.data || []).map(item => {
|
||||
return {
|
||||
label: item.deviceName,
|
||||
value: item.id,
|
||||
}
|
||||
})
|
||||
const index = this.childOptions.findIndex(item=>item.value === deviceCategory)
|
||||
if(index>-1){
|
||||
const length = this.childOptions[index].children.length
|
||||
this.childOptions[index].children.splice(0,length,...data)
|
||||
getDeviceList(node, resolve) {
|
||||
if (!this.formData.siteId) {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "请先选择站点",
|
||||
});
|
||||
return resolve([])
|
||||
}
|
||||
getDeviceListBySiteAndCategory({
|
||||
siteId: this.formData.siteId,
|
||||
deviceCategory: node.value
|
||||
}).then((response) => {
|
||||
const data = (response?.data || []).map(item => {
|
||||
return {
|
||||
label: item.deviceName,
|
||||
value: item.id,
|
||||
leaf: true
|
||||
}
|
||||
})
|
||||
resolve(data)
|
||||
}).catch(() => {
|
||||
resolve([])
|
||||
})
|
||||
},
|
||||
//更新站点下面的设备列表
|
||||
updateSiteDeviceList(){
|
||||
updateSiteDeviceList() {
|
||||
this.childOptions.forEach(item => {
|
||||
const length = item.children.length
|
||||
item.children.splice(0,length)
|
||||
item.children.splice(0, length)
|
||||
})
|
||||
this.getDeviceList('PCS')
|
||||
this.getDeviceList('STACK')
|
||||
},
|
||||
//选中设备类型、设备
|
||||
handleChange(data,type,index){
|
||||
const deviceCategory = data[0],deviceId=data[1]
|
||||
console.log('设置选中设备类型、设备',deviceCategory,deviceId,type,index)
|
||||
const item = Object.assign({},this[type][index],{
|
||||
deviceId:data,
|
||||
deviceCategory,
|
||||
categoryName : this.childOptions.find(i=>i.value === deviceCategory).label,
|
||||
pointName:'',
|
||||
point:''
|
||||
handleChange(data, type, index) {
|
||||
console.log('设置选中设备类型、设备', data, type, index)
|
||||
const {label = '', parent = {}} = this.$refs[type + index][0].getCheckedNodes()[0]
|
||||
console.log('选中设备的名称', parent.label, label)
|
||||
const item = Object.assign({}, this[type][index], {
|
||||
deviceId: data,
|
||||
deviceName: [parent.label, label],
|
||||
deviceCategory: data[0],
|
||||
categoryName: parent.label,
|
||||
pointName: '',
|
||||
point: ''
|
||||
})
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
// this.$set(this[type], index, item);
|
||||
this[type].splice(index,1,item);
|
||||
this[type].splice(index, 1, item);
|
||||
})
|
||||
console.log('设置选中设备类型、设备配置完成',this[type][index])
|
||||
console.log('设置选中设备类型、设备配置完成', this[type][index])
|
||||
},
|
||||
|
||||
//获取站点列表
|
||||
getZdList() {
|
||||
this.loading += 1;
|
||||
getAllSites()
|
||||
.then((response) => {
|
||||
this.siteList = response?.data || [];
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading -= 1;
|
||||
});
|
||||
.then((response) => {
|
||||
this.siteList = response?.data || [];
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading -= 1;
|
||||
});
|
||||
},
|
||||
// 切换站点
|
||||
// 重新获取设备列表
|
||||
@ -541,62 +577,65 @@ export default {
|
||||
changeType() {
|
||||
//获取当前站点下的pcs和bms
|
||||
this.updateSiteDeviceList()
|
||||
if(this.protectionSettings.length>0){
|
||||
const list =this.protectionSettings
|
||||
if (this.protectionSettings.length > 0) {
|
||||
const list = this.protectionSettings
|
||||
list.forEach((item) => {
|
||||
item.point = ""
|
||||
item.pointName = ""
|
||||
item.deviceId=[]
|
||||
item.categoryName=''
|
||||
item.deviceCategory=''
|
||||
item.deviceId = []
|
||||
item.deviceName = []
|
||||
item.categoryName = ''
|
||||
item.deviceCategory = ''
|
||||
});
|
||||
// this.$set(this,'protectionSettings',list)
|
||||
this.$nextTick(()=>{
|
||||
this.protectionSettings.splice(0,this.protectionSettings.length,...list)
|
||||
this.$nextTick(() => {
|
||||
this.protectionSettings.splice(0, this.protectionSettings.length, ...list)
|
||||
})
|
||||
}
|
||||
if(this.protectionPlan.length>0){
|
||||
const list =this.protectionPlan
|
||||
if (this.protectionPlan.length > 0) {
|
||||
const list = this.protectionPlan
|
||||
list.forEach((item) => {
|
||||
item.point = ""
|
||||
item.pointName = ""
|
||||
item.deviceId=[]
|
||||
item.categoryName=''
|
||||
item.deviceCategory=''
|
||||
item.deviceId = []
|
||||
item.deviceName = []
|
||||
item.categoryName = ''
|
||||
item.deviceCategory = ''
|
||||
});
|
||||
// this.$set(this,'protectionPlan',list)
|
||||
this.$nextTick(()=>{
|
||||
this.protectionPlan.splice(0,this.protectionPlan.length,...list)
|
||||
this.$nextTick(() => {
|
||||
this.protectionPlan.splice(0, this.protectionPlan.length, ...list)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
saveDialog() {
|
||||
function getToastMsg(name,type,index){
|
||||
function getToastMsg(name, type, index) {
|
||||
return {
|
||||
protectionSettings:{
|
||||
deviceId:`请选择保护前提第${index}行的设备`,//设备ID
|
||||
protectionSettings: {
|
||||
deviceId: `请选择保护前提第${index}行的设备`,//设备ID
|
||||
deviceCategory: `请选择保护前提第${index}行的设备类型`,//设备类型 英文
|
||||
categoryName:`请选择保护前提第${index}行的设备类型`,//设备类型名称 中文
|
||||
categoryName: `请选择保护前提第${index}行的设备类型`,//设备类型名称 中文
|
||||
point: `请选择保护前提第${index}行的点位`,//点位 英文
|
||||
pointName:`请选择保护前提第${index}行的点位`,//点位 中文
|
||||
pointName: `请选择保护前提第${index}行的点位`,//点位 中文
|
||||
faultValue: `请输入保护前提第${index}行的故障值`,//故障值
|
||||
releaseValue: `请输入保护前提第${index}行的释放值`,//释放值
|
||||
faultOperator: `请选择保护前提第${index}行的故障值比较关系`,//故障值比较关系
|
||||
releaseOperator: `请选择保护前提第${index}行的释放值比较关系`,//释放值比较关系
|
||||
relationNext: `请选择保护前提第${index}行与下一个点位的关系`,//与下一个点位的关系
|
||||
},
|
||||
protectionPlan :{
|
||||
deviceId:`请选择保护方案第${index}行的设备`,
|
||||
protectionPlan: {
|
||||
deviceId: `请选择保护方案第${index}行的设备`,
|
||||
deviceCategory: `请选择保护方案第${index}行的设备类型`,//设备类型 英文
|
||||
categoryName:`请选择保护方案第${index}行的设备类型`,//设备类型名称 中文
|
||||
categoryName: `请选择保护方案第${index}行的设备类型`,//设备类型名称 中文
|
||||
point: `请选择保护方案第${index}行的点位`,
|
||||
pointName:`请选择保护方案第${index}行的点位`,
|
||||
pointName: `请选择保护方案第${index}行的点位`,
|
||||
value: `请输入保护方案第${index}行的故障值`,//设置值
|
||||
}
|
||||
}[type][name]
|
||||
}
|
||||
|
||||
this.$refs.addTempForm.validate((valid) => {
|
||||
if (!valid) return;
|
||||
const {
|
||||
@ -607,67 +646,69 @@ export default {
|
||||
faultLevel = 1, //告警等级
|
||||
faultDelaySeconds = "", //故障延时
|
||||
releaseDelaySeconds = "", //释放延时
|
||||
description="",//方案描述
|
||||
description = "",//方案描述
|
||||
} = this.formData;
|
||||
const {protectionSettings,protectionPlan} = this
|
||||
let protectionSettingsValidateStatus= true , protectionPlanValidateStatus= true
|
||||
for(let i = 0;i<protectionSettings.length;i++){
|
||||
const {protectionSettings, protectionPlan} = this
|
||||
let protectionSettingsValidateStatus = true, protectionPlanValidateStatus = true
|
||||
for (let i = 0; i < protectionSettings.length; i++) {
|
||||
let valueMap = Object.entries(protectionSettings[i]);
|
||||
for(let inner = 0;inner < valueMap.length;inner++){
|
||||
const key =valueMap[inner][0],value =valueMap[inner][1]
|
||||
if(key === 'relationNext'){
|
||||
if(protectionSettings[i+1] && !value){//有下一个点位
|
||||
this.$message.error(getToastMsg(key,'protectionSettings',i+1))
|
||||
protectionSettingsValidateStatus=false
|
||||
for (let inner = 0; inner < valueMap.length; inner++) {
|
||||
const key = valueMap[inner][0], value = valueMap[inner][1]
|
||||
if (key === 'relationNext') {
|
||||
if (protectionSettings[i + 1] && !value) {//有下一个点位
|
||||
this.$message.error(getToastMsg(key, 'protectionSettings', i + 1))
|
||||
protectionSettingsValidateStatus = false
|
||||
break
|
||||
}
|
||||
}else{
|
||||
if(![0,'0'].includes(value) && !value){
|
||||
this.$message.error(getToastMsg(key,'protectionSettings',i+1))
|
||||
protectionSettingsValidateStatus=false
|
||||
} else {
|
||||
if (![0, '0'].includes(value) && !value) {
|
||||
this.$message.error(getToastMsg(key, 'protectionSettings', i + 1))
|
||||
protectionSettingsValidateStatus = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!protectionSettingsValidateStatus) break
|
||||
if (!protectionSettingsValidateStatus) break
|
||||
}
|
||||
|
||||
for(let i = 0;i<protectionPlan.length;i++){
|
||||
for (let i = 0; i < protectionPlan.length; i++) {
|
||||
let valueMap = Object.entries(protectionPlan[i]);
|
||||
for(let inner = 0;inner < valueMap.length;inner++){
|
||||
const key =valueMap[inner][0],value =valueMap[inner][1]
|
||||
if(key === 'relationNext'){
|
||||
if(protectionPlan[i+1] && !value){//有下一个点位
|
||||
this.$message.error(getToastMsg(key,'protectionPlan',i+1))
|
||||
protectionPlanValidateStatus=false
|
||||
for (let inner = 0; inner < valueMap.length; inner++) {
|
||||
const key = valueMap[inner][0], value = valueMap[inner][1]
|
||||
if (key === 'relationNext') {
|
||||
if (protectionPlan[i + 1] && !value) {//有下一个点位
|
||||
this.$message.error(getToastMsg(key, 'protectionPlan', i + 1))
|
||||
protectionPlanValidateStatus = false
|
||||
break
|
||||
}else{
|
||||
} else {
|
||||
// protectionPlan[i][key] = ''//清空选择的关系
|
||||
}
|
||||
}else{
|
||||
if(![0,'0'].includes(value) && !value){
|
||||
this.$message.error(getToastMsg(key,'protectionPlan',i+1))
|
||||
protectionPlanValidateStatus=false
|
||||
} else {
|
||||
if (![0, '0'].includes(value) && !value) {
|
||||
this.$message.error(getToastMsg(key, 'protectionPlan', i + 1))
|
||||
protectionPlanValidateStatus = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!protectionPlanValidateStatus) break
|
||||
if (!protectionPlanValidateStatus) break
|
||||
}
|
||||
|
||||
if(!protectionSettingsValidateStatus || !protectionPlanValidateStatus) return
|
||||
const settings = protectionSettings.map(item=>{
|
||||
return Object.assign({},item,{
|
||||
deviceId:item.deviceId[1],
|
||||
if (!protectionSettingsValidateStatus || !protectionPlanValidateStatus) return
|
||||
const settings = protectionSettings.map(item => {
|
||||
return Object.assign({}, item, {
|
||||
deviceId: item.deviceId[1],
|
||||
deviceName: item.deviceName[1],
|
||||
})
|
||||
})
|
||||
const plan = protectionPlan.map(item=>{
|
||||
return Object.assign({},item,{
|
||||
deviceId:item.deviceId[1],
|
||||
const plan = protectionPlan.map(item => {
|
||||
return Object.assign({}, item, {
|
||||
deviceId: item.deviceId[1],
|
||||
deviceName: item.deviceName[1],
|
||||
})
|
||||
})
|
||||
this.loading += 1;
|
||||
const params= {
|
||||
const params = {
|
||||
siteId,
|
||||
faultName,
|
||||
isAlert,
|
||||
@ -675,49 +716,49 @@ export default {
|
||||
faultDelaySeconds,
|
||||
releaseDelaySeconds,
|
||||
description,
|
||||
protectionSettings:JSON.stringify(settings),
|
||||
protectionPlan:JSON.stringify(plan),
|
||||
protectionSettings: JSON.stringify(settings),
|
||||
protectionPlan: JSON.stringify(plan),
|
||||
}
|
||||
if (this.mode === "add") {
|
||||
addProtectPlan(params)
|
||||
.then((response) => {
|
||||
if (response.code === 200) {
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit("update");
|
||||
this.closeDialog();
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading -= 1;
|
||||
});
|
||||
.then((response) => {
|
||||
if (response.code === 200) {
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit("update");
|
||||
this.closeDialog();
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading -= 1;
|
||||
});
|
||||
} else {
|
||||
params.id = id
|
||||
updateProtectPlan(params)
|
||||
.then((response) => {
|
||||
if (response.code === 200) {
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit("update");
|
||||
this.closeDialog();
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading -= 1;
|
||||
});
|
||||
.then((response) => {
|
||||
if (response.code === 200) {
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit("update");
|
||||
this.closeDialog();
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading -= 1;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
closeDialog() {
|
||||
this.$emit("clear");
|
||||
// 清空所有数据
|
||||
for(let key in this.formData) {
|
||||
for (let key in this.formData) {
|
||||
this.formData[key] = key === 'isAlert' ? 0 : key === 'faultLevel' ? 1 : ''
|
||||
}
|
||||
this.$refs.addTempForm.resetFields();
|
||||
this.$set(this,'protectionSettings',[])
|
||||
this.$set(this,'protectionPlan',[])
|
||||
this.$set(this,'childOptions',[])
|
||||
this.$set(this, 'protectionSettings', [])
|
||||
this.$set(this, 'protectionPlan', [])
|
||||
this.$set(this, 'childOptions', [])
|
||||
this.dialogTableVisible = false;
|
||||
},
|
||||
},
|
||||
@ -727,35 +768,43 @@ export default {
|
||||
.items-container {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.item-title {
|
||||
line-height: 16px;
|
||||
padding: 10px 0;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.time-lists-container {
|
||||
width: 100%;
|
||||
border: 1px solid #eee;
|
||||
|
||||
.time-lists {
|
||||
&:not(:last-child) {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
display: flex;
|
||||
|
||||
& > div {
|
||||
width: 16%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
padding: 10px 15px;
|
||||
|
||||
&:not(:last-child) {
|
||||
width: 28%;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
.el-date-editor.el-input,
|
||||
.el-date-editor.el-input__inner {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.time-lists-title {
|
||||
color: #000;
|
||||
font-size: 12px;
|
||||
|
||||
@ -1,77 +1,136 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialogTableVisible" :close-on-press-escape="false" :close-on-click-modal="false" :show-close="false" destroy-on-close lock-scroll append-to-body width="600px" class="ems-dialog" :title="mode === 'add'?'新增设备':`编辑设备` " >
|
||||
<el-form v-loading="loading>0" ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="140px">
|
||||
<el-form-item label="站点" prop="siteId">
|
||||
<el-select v-model="formData.siteId" placeholder="请选择" :style="{width: '100%'}" @change="changeType">
|
||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'siteOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备id" prop="deviceId" >
|
||||
<el-input v-model="formData.deviceId" placeholder="请输入" maxlength="60" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="formData.deviceName" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备描述" prop="description">
|
||||
<el-input v-model="formData.description" type="textarea" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作状态" prop="communicationStatus">
|
||||
<el-select v-model="formData.communicationStatus" placeholder="请选择" :style="{width: '100%'}">
|
||||
<el-option :label="value" :value="key" v-for="(value,key) in communicationStatusOptions" :key="key+'communicationStatusOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="deviceType">
|
||||
<el-select v-model="formData.deviceType" placeholder="请选择" :style="{width: '100%'}">
|
||||
<el-option :label="value" :value="key" v-for="(value,key) in deviceTypeOptions" :key="key+'deviceTypeOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类别" prop="deviceCategory">
|
||||
<el-select v-model="formData.deviceCategory" placeholder="请选择" :style="{width: '100%'}" @change="changeType">
|
||||
<el-option :label="item.name" :value="item.code" v-for="(item,index) in deviceCategoryList" :key="index+'deviceCategoryList'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级设备" prop="parentId" v-if="dccDeviceCategoryList.includes(formData.deviceCategory)">
|
||||
<el-select v-model="formData.parentId" :placeholder="parentDeviceList.length === 0 && !formData.siteId ? '请先选择站点' : '请选择'" :style="{width: '100%'}">
|
||||
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in parentDeviceList" :key="index+'parentDeviceList'" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="TCP设备的ip地址" prop="ipAddress" v-if="formData.deviceType === 'TCP'">
|
||||
<el-input v-model="formData.ipAddress" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="TCP设备的端口号" prop="ipPort" v-if="formData.deviceType === 'TCP'">
|
||||
<el-input v-model="formData.ipPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-dialog :visible.sync="dialogTableVisible" :close-on-press-escape="false" :close-on-click-modal="false"
|
||||
:show-close="false" destroy-on-close lock-scroll append-to-body width="800px" class="ems-dialog"
|
||||
:title="mode === 'add'?'新增设备':`编辑设备` ">
|
||||
<div v-loading="loading>0">
|
||||
<el-form v-loading="loading>0" ref="addTempForm" inline :model="formData" :rules="rules" size="medium"
|
||||
label-width="120px" class="device-form">
|
||||
<el-form-item label="站点" prop="siteId">
|
||||
<el-select v-model="formData.siteId" placeholder="请选择" :style="{width: '100%'}" @change="changeType">
|
||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList"
|
||||
:key="index+'siteOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备id" prop="deviceId">
|
||||
<el-input v-model="formData.deviceId" placeholder="请输入" maxlength="60" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="formData.deviceName" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备描述" prop="description">
|
||||
<el-input v-model="formData.description" type="textarea" placeholder="请输入" clearable
|
||||
:style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作状态" prop="communicationStatus">
|
||||
<el-select v-model="formData.communicationStatus" placeholder="请选择" :style="{width: '100%'}">
|
||||
<el-option :label="value" :value="key" v-for="(value,key) in communicationStatusOptions"
|
||||
:key="key+'communicationStatusOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="deviceType">
|
||||
<el-select v-model="formData.deviceType" placeholder="请选择" :style="{width: '100%'}">
|
||||
<el-option :label="value" :value="key" v-for="(value,key) in deviceTypeOptions"
|
||||
:key="key+'deviceTypeOptions'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类别" prop="deviceCategory">
|
||||
<el-select v-model="formData.deviceCategory" placeholder="请选择" :style="{width: '100%'}"
|
||||
@change="changeType">
|
||||
<el-option :label="item.name" :value="item.code" v-for="(item,index) in deviceCategoryList"
|
||||
:key="index+'deviceCategoryList'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级设备" prop="parentId" v-if="dccDeviceCategoryList.includes(formData.deviceCategory)">
|
||||
<el-select v-model="formData.parentId"
|
||||
:placeholder="parentDeviceList.length === 0 && !formData.siteId ? '请先选择站点' : '请选择'"
|
||||
:style="{width: '100%'}">
|
||||
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in parentDeviceList"
|
||||
:key="index+'parentDeviceList'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="TCP设备的ip地址" prop="ipAddress" v-if="formData.deviceType === 'TCP'">
|
||||
<el-input v-model="formData.ipAddress" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="TCP设备的端口号" prop="ipPort" v-if="formData.deviceType === 'TCP'">
|
||||
<el-input v-model="formData.ipPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="从站地址" prop="slaveId" v-if="formData.deviceType === 'TCP'">
|
||||
<el-input v-model="formData.slaveId" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="串口路径" prop="serialPort">
|
||||
<el-input v-model="formData.serialPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="波特率" prop="baudRate">
|
||||
<el-input v-model="formData.baudRate" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据位" prop="dataBits">
|
||||
<el-input v-model="formData.dataBits" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="停止位" prop="stopBits">
|
||||
<el-input v-model="formData.stopBits" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="校验位" prop="parity">
|
||||
<el-input v-model="formData.parity" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" prop="pictureUrl">
|
||||
<image-upload :limit="1" :drag="false" @input="uploadImage" :value="formData.pictureUrl"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="串口路径" prop="serialPort">
|
||||
<el-input v-model="formData.serialPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="波特率" prop="baudRate">
|
||||
<el-input v-model="formData.baudRate" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据位" prop="dataBits">
|
||||
<el-input v-model="formData.dataBits" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="停止位" prop="stopBits">
|
||||
<el-input v-model="formData.stopBits" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="校验位" prop="parity">
|
||||
<el-input v-model="formData.parity" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" prop="pictureUrl">
|
||||
<image-upload :limit="1" :drag="false" @input="uploadImage" :value="formData.pictureUrl"/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</el-form>
|
||||
<!-- pcs配置-->
|
||||
<el-form v-if="isPcs" ref="pcsSettingForm" inline :model="pcsSetting" size="medium"
|
||||
label-width="120px" class="device-form" :rules="pcsSettingRules">
|
||||
<div style="font-size: 14px;padding: 10px 0 20px;font-weight: 600;">PCS配置</div>
|
||||
<el-form-item label="开关机地址" prop="pointAddress">
|
||||
<el-input v-model="pcsSetting.pointAddress" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="功率地址" prop="powerAddress">
|
||||
<el-input v-model="pcsSetting.powerAddress" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开机指令" prop="startCommand">
|
||||
<el-input v-model="pcsSetting.startCommand" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开机目标功率" prop="startPower">
|
||||
<el-input v-model="pcsSetting.startPower" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="关机指令" prop="stopCommand">
|
||||
<el-input v-model="pcsSetting.stopCommand" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="关机目标功率" prop="stopPower">
|
||||
<el-input v-model="pcsSetting.stopPower" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="电池簇数" prop="clusterNum">
|
||||
<el-input v-model="pcsSetting.clusterNum" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<template v-for="index in parseInt(pcsSetting.clusterNum) || 0">
|
||||
<el-form-item :label="'电池簇'+(index)+'地址'"
|
||||
prop="clusterPointAddress">
|
||||
<el-input v-model="pcsSetting.clusterPointAddress[index-1]" placeholder="请输入" clearable
|
||||
:style="{width: '100%'}">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<el-button type="primary" @click="saveDialog">确定</el-button>
|
||||
@ -82,257 +141,404 @@
|
||||
import {mapState} from "vuex";
|
||||
import {getAllSites} from '@/api/ems/zddt'
|
||||
import {validText} from '@/utils/validate'
|
||||
import {getDeviceDetailInfo,updateDevice,addDevice,getParentDeviceId} from "@/api/ems/site";
|
||||
import {addDevice, getDeviceDetailInfo, getParentDeviceId, updateDevice} from "@/api/ems/site";
|
||||
import {getAllDeviceCategory} from '@/api/ems/search'
|
||||
|
||||
export default {
|
||||
props:{
|
||||
mode:{
|
||||
type:String,
|
||||
default:"add"
|
||||
props: {
|
||||
mode: {
|
||||
type: String,
|
||||
default: "add"
|
||||
},
|
||||
id:{
|
||||
type:String|Number,
|
||||
required:false
|
||||
id: {
|
||||
type: String | Number,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const validateText=(rule, value, callback) =>{
|
||||
const validateText = (rule, value, callback) => {
|
||||
if (value !== '' && !validText(value)) {
|
||||
callback(new Error('只能输入中文、英文、数字和特殊字符!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
const validateDeviceId=(rule, value, callback) =>{
|
||||
const validateDeviceId = (rule, value, callback) => {
|
||||
if (value !== '' && !/^[a-zA-Z0-9]+$/.test(value)) {
|
||||
callback(new Error('只能输入英文和数字!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
const validateNumber = (rule, value, callback) => {
|
||||
if (value !== '' && !/^[0-9]+$/.test(value)) {
|
||||
callback(new Error('只能输入数字!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
return {
|
||||
loading:0,
|
||||
dccDeviceCategoryList:['CLUSTER','BATTERY'],//需要展示上级设备的设备类型
|
||||
dialogTableVisible:false,
|
||||
parentDeviceList:[],//上级设备列表 从接口获取数据
|
||||
siteList:[],//站点列表 从接口获取数据
|
||||
deviceCategoryList:[],//设备类别列表 从接口获取数据
|
||||
loading: 0,
|
||||
dccDeviceCategoryList: ['CLUSTER', 'BATTERY'],//需要展示上级设备的设备类型
|
||||
dialogTableVisible: false,
|
||||
parentDeviceList: [],//上级设备列表 从接口获取数据
|
||||
siteList: [],//站点列表 从接口获取数据
|
||||
deviceCategoryList: [],//设备类别列表 从接口获取数据
|
||||
formData: {
|
||||
id:'',//设备唯一标识
|
||||
siteId:'',//站点ID
|
||||
deviceId:'',//设备id
|
||||
deviceName:'',//设备名称
|
||||
description:'',//设备描述
|
||||
communicationStatus:'',//工作状态
|
||||
deviceType:'',//设备类型
|
||||
deviceCategory:'',//设备类别
|
||||
parentId:'',//上级设备id
|
||||
ipAddress:'',//TCP设备的ip地址
|
||||
ipPort:"",//TCP端口号
|
||||
serialPort:'',//串口路径
|
||||
baudRate:'',//波特率
|
||||
dataBits:'',//数据位
|
||||
stopBits:'',//停止位
|
||||
parity:'',//校验位
|
||||
pictureUrl:'',//设备图片
|
||||
id: '',//设备唯一标识
|
||||
siteId: '',//站点ID
|
||||
deviceId: '',//设备id
|
||||
deviceName: '',//设备名称
|
||||
description: '',//设备描述
|
||||
communicationStatus: '',//工作状态
|
||||
deviceType: '',//设备类型
|
||||
deviceCategory: '',//设备类别
|
||||
parentId: '',//上级设备id
|
||||
ipAddress: '',//TCP设备的ip地址
|
||||
ipPort: "",//TCP端口号
|
||||
serialPort: '',//串口路径
|
||||
baudRate: '',//波特率
|
||||
dataBits: '',//数据位
|
||||
stopBits: '',//停止位
|
||||
parity: '',//校验位
|
||||
pictureUrl: '',//设备图片
|
||||
slaveId: '',//从站地址
|
||||
},
|
||||
pcsSetting: {
|
||||
deviceSettingId: '',
|
||||
powerAddress: '',//功率地址
|
||||
pointAddress: "",//开关机地址
|
||||
startCommand: "",//开机指令
|
||||
stopCommand: "",//关机指令
|
||||
startPower: '',//开机目标功率
|
||||
stopPower: '',//关机目标功率
|
||||
clusterNum: '',//电池簇数
|
||||
clusterPointAddress: []//电池簇地址
|
||||
},
|
||||
rules: {
|
||||
siteId:[
|
||||
{ required: true, message: '请选择站点', trigger: ['blur','change']}
|
||||
siteId: [
|
||||
{required: true, message: '请选择站点', trigger: ['blur', 'change']}
|
||||
],
|
||||
deviceId:[
|
||||
{ required: true, message: '请输入设备id', trigger: 'blur'},
|
||||
{ validator: validateDeviceId, trigger: 'blur' }
|
||||
deviceId: [
|
||||
{required: true, message: '请输入设备id', trigger: 'blur'},
|
||||
{validator: validateDeviceId, trigger: 'blur'}
|
||||
],
|
||||
deviceName:[
|
||||
{ required: true, message: '请输入设备名称', trigger: 'blur'},
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
deviceName: [
|
||||
{required: true, message: '请输入设备名称', trigger: 'blur'},
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
description:[
|
||||
{ required: true, message: '请输入设备描述', trigger: 'blur'},
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
description: [
|
||||
{required: true, message: '请输入设备描述', trigger: 'blur'},
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
communicationStatus:[
|
||||
{ required: true, message: '请选择工作状态', trigger: ['blur','change']}
|
||||
communicationStatus: [
|
||||
{required: true, message: '请选择工作状态', trigger: ['blur', 'change']}
|
||||
],
|
||||
deviceType:[
|
||||
{ required: true, message: '请选择设备类型', trigger:['blur','change']}
|
||||
deviceType: [
|
||||
{required: true, message: '请选择设备类型', trigger: ['blur', 'change']}
|
||||
],
|
||||
deviceCategory:[
|
||||
{ required: true, message: '请选择设备类别', trigger: ['blur','change']}
|
||||
deviceCategory: [
|
||||
{required: true, message: '请选择设备类别', trigger: ['blur', 'change']}
|
||||
],
|
||||
ipAddress:[
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
ipAddress: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
ipPort:[
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
ipPort: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
serialPort:[
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
slaveId: [
|
||||
{validator: validateNumber, trigger: 'blur'}
|
||||
],
|
||||
baudRate:[
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
serialPort: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
dataBits:[
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
baudRate: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
stopBits:[
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
dataBits: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
parity:[
|
||||
{ validator: validateText, trigger: 'blur' }
|
||||
stopBits: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
parity: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
// pictureUrl:[
|
||||
// { required: true, message: '请上传图片', trigger: ['blur', 'change']}
|
||||
// ],
|
||||
},
|
||||
pcsSettingRules: {
|
||||
pointAddress: [
|
||||
{required: true, message: '请输入开关机地址', trigger: 'blur'},
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
powerAddress: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
startCommand: [
|
||||
{required: true, message: '请输入开机指令', trigger: 'blur'},
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
startPower: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
stopCommand: [
|
||||
{required: true, message: '请输入关机指令', trigger: 'blur'},
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
stopPower: [
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
],
|
||||
clusterNum: [
|
||||
{required: true, message: '请输入电池簇数', trigger: 'blur'},
|
||||
{validator: validateNumber, trigger: 'blur'}
|
||||
],
|
||||
clusterPointAddress: [
|
||||
{required: true, message: '请输入电池簇地址', trigger: 'blur'},
|
||||
{validator: validateText, trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
communicationStatusOptions: state => state?.ems?.communicationStatusOptions || {},
|
||||
deviceTypeOptions:state=>state?.ems?.deviceTypeOptions || {}
|
||||
})
|
||||
deviceTypeOptions: state => state?.ems?.deviceTypeOptions || {}
|
||||
}),
|
||||
isPcs() {
|
||||
return this.formData.deviceCategory === 'PCS'
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
dialogTableVisible:{
|
||||
handler(newVal){
|
||||
watch: {
|
||||
dialogTableVisible: {
|
||||
handler(newVal) {
|
||||
//打开弹窗
|
||||
if(newVal){
|
||||
if (newVal) {
|
||||
this.getZdList()
|
||||
this.getDeviceCategoryList()
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
id:{
|
||||
handler(newVal){
|
||||
if((newVal || newVal===0) && this.mode !== 'add'){
|
||||
this.loading+=1
|
||||
id: {
|
||||
handler(newVal) {
|
||||
if ((newVal || newVal === 0) && this.mode !== 'add') {
|
||||
this.loading += 1
|
||||
getDeviceDetailInfo(newVal).then(response => {
|
||||
this.formData = JSON.parse(JSON.stringify(response?.data || {}));
|
||||
if(this.dccDeviceCategoryList.includes(this.formData.deviceCategory)){
|
||||
const {pcsSetting, ...data} = JSON.parse(JSON.stringify(response?.data || {}))
|
||||
this.formData = data;
|
||||
if (pcsSetting && JSON.stringify(pcsSetting) !== '{}') {
|
||||
this.pcsSetting = JSON.parse(JSON.stringify({
|
||||
...pcsSetting,
|
||||
clusterPointAddress: JSON.parse(pcsSetting.clusterPointAddress || [])
|
||||
}));
|
||||
}
|
||||
if (this.dccDeviceCategoryList.includes(this.formData.deviceCategory)) {
|
||||
this.getParentDeviceList(true)
|
||||
}
|
||||
}).finally(() => {this.loading-=1})
|
||||
}).finally(() => {
|
||||
this.loading -= 1
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeType(){
|
||||
if(this.dccDeviceCategoryList.includes(this.formData.deviceCategory)){
|
||||
changeType() {
|
||||
if (this.dccDeviceCategoryList.includes(this.formData.deviceCategory)) {
|
||||
this.getParentDeviceList()
|
||||
}
|
||||
},
|
||||
uploadImage(data){
|
||||
uploadImage(data) {
|
||||
this.formData.pictureUrl = data
|
||||
},
|
||||
//获取站点列表
|
||||
getZdList(){
|
||||
this.loading+=1
|
||||
getZdList() {
|
||||
this.loading += 1
|
||||
getAllSites().then(response => {
|
||||
this.siteList = response?.data || []
|
||||
}).finally(() => {this.loading-=1})
|
||||
}).finally(() => {
|
||||
this.loading -= 1
|
||||
})
|
||||
},
|
||||
// 获取设备类别
|
||||
getDeviceCategoryList(){
|
||||
this.loading+=1
|
||||
getDeviceCategoryList() {
|
||||
this.loading += 1
|
||||
getAllDeviceCategory().then(response => {
|
||||
this.deviceCategoryList = response?.data || []
|
||||
}).finally(() => {this.loading-=1})
|
||||
}).finally(() => {
|
||||
this.loading -= 1
|
||||
})
|
||||
},
|
||||
//获取上级id列表
|
||||
getParentDeviceList(init=false){
|
||||
if(!this.formData.siteId){
|
||||
return console.log('请先选择站点')
|
||||
getParentDeviceList(init = false) {
|
||||
if (!this.formData.siteId) {
|
||||
return console.log('请先选择站点')
|
||||
}
|
||||
!init && (this.formData.parentId='')
|
||||
this.loading= this.loading+1
|
||||
getParentDeviceId({siteId:this.formData.siteId,deviceCategory:this.formData.deviceCategory}).then(response => {
|
||||
!init && (this.formData.parentId = '')
|
||||
this.loading = this.loading + 1
|
||||
getParentDeviceId({siteId: this.formData.siteId, deviceCategory: this.formData.deviceCategory}).then(response => {
|
||||
this.parentDeviceList = JSON.parse(JSON.stringify(response?.data || []));
|
||||
}).finally(() => {
|
||||
this.loading=this.loading -1
|
||||
this.loading = this.loading - 1
|
||||
})
|
||||
},
|
||||
saveData() {
|
||||
this.loading += 1
|
||||
const {
|
||||
id = '',
|
||||
siteId = '',//站点ID
|
||||
deviceId = '',//设备id
|
||||
deviceName = '',//设备名称
|
||||
description = '',//设备描述
|
||||
communicationStatus = '',//工作状态
|
||||
deviceType = '',//设备类型
|
||||
deviceCategory = '',//设备类别
|
||||
parentId = '',//上级设备id
|
||||
ipAddress = '',//TCP设备的ip地址
|
||||
ipPort = "",//TCP端口号
|
||||
serialPort = '',//串口路径
|
||||
baudRate = '',//波特率
|
||||
dataBits = '',//数据位
|
||||
stopBits = '',//停止位
|
||||
parity = '',//校验位
|
||||
pictureUrl = '',//设备图片
|
||||
slaveId = '',//从站地址
|
||||
} = this.formData;
|
||||
const {
|
||||
deviceSettingId,
|
||||
powerAddress,
|
||||
pointAddress,
|
||||
startCommand,
|
||||
stopCommand,
|
||||
startPower,
|
||||
stopPower,
|
||||
clusterNum,
|
||||
clusterPointAddress
|
||||
} = this.pcsSetting
|
||||
let params = {
|
||||
siteId,
|
||||
deviceId,
|
||||
deviceName,
|
||||
description,
|
||||
communicationStatus,
|
||||
deviceType,
|
||||
deviceCategory,
|
||||
parentId,
|
||||
ipAddress,
|
||||
ipPort,
|
||||
serialPort,
|
||||
baudRate,
|
||||
dataBits,
|
||||
stopBits,
|
||||
parity,
|
||||
pictureUrl,
|
||||
slaveId,
|
||||
}
|
||||
if (this.isPcs) {
|
||||
params.pcsSetting = {
|
||||
powerAddress,
|
||||
pointAddress,
|
||||
startCommand,
|
||||
stopCommand,
|
||||
startPower,
|
||||
stopPower,
|
||||
clusterNum,
|
||||
clusterPointAddress: JSON.stringify(!clusterNum ? [] : (clusterPointAddress || []).slice(0, clusterNum))
|
||||
}
|
||||
}
|
||||
if (this.mode === 'add') {
|
||||
addDevice(params).then(response => {
|
||||
if (response.code === 200) {
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit('update')
|
||||
this.closeDialog()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading -= 1
|
||||
})
|
||||
} else {
|
||||
params.id = id
|
||||
params.pcsSetting && (params.pcsSetting.deviceSettingId = deviceSettingId)
|
||||
updateDevice(params).then(response => {
|
||||
if (response.code === 200) {
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit('update')
|
||||
this.closeDialog()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading -= 1
|
||||
})
|
||||
}
|
||||
},
|
||||
saveDialog() {
|
||||
this.$refs.addTempForm.validate(valid => {
|
||||
if (!valid) return
|
||||
this.loading+=1
|
||||
const {
|
||||
id='',
|
||||
siteId='',//站点ID
|
||||
deviceId='',//设备id
|
||||
deviceName='',//设备名称
|
||||
description='',//设备描述
|
||||
communicationStatus='',//工作状态
|
||||
deviceType='',//设备类型
|
||||
deviceCategory='',//设备类别
|
||||
parentId='',//上级设备id
|
||||
ipAddress='',//TCP设备的ip地址
|
||||
ipPort="",//TCP端口号
|
||||
serialPort='',//串口路径
|
||||
baudRate='',//波特率
|
||||
dataBits='',//数据位
|
||||
stopBits='',//停止位
|
||||
parity='',//校验位
|
||||
pictureUrl='',//设备图片
|
||||
}= this.formData;
|
||||
if(this.mode === 'add'){
|
||||
addDevice({siteId,deviceId,deviceName,description,communicationStatus,deviceType,deviceCategory,parentId,ipAddress,ipPort,serialPort,baudRate,dataBits,stopBits,parity,pictureUrl}).then(response => {
|
||||
if(response.code === 200){
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit('update')
|
||||
this.closeDialog()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading-=1
|
||||
})
|
||||
}else{
|
||||
updateDevice({id,siteId,deviceId,deviceName,description,communicationStatus,deviceType,deviceCategory,parentId,ipAddress,ipPort,serialPort,baudRate,dataBits,stopBits,parity,pictureUrl}).then(response => {
|
||||
if(response.code === 200){
|
||||
//新增成功
|
||||
// 关闭弹窗 更新表格
|
||||
this.$emit('update')
|
||||
this.closeDialog()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading-=1
|
||||
if (this.isPcs) {
|
||||
this.$refs.pcsSettingForm.validate(pcsValidate => {
|
||||
if (!pcsValidate) return
|
||||
this.saveData()
|
||||
})
|
||||
} else {
|
||||
this.saveData()
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
closeDialog(){
|
||||
closeDialog() {
|
||||
this.$emit('clear')
|
||||
// 清空所有数据
|
||||
this.formData= {
|
||||
id:'',//设备唯一标识
|
||||
siteId:'',//站点ID
|
||||
deviceId:'',//设备id
|
||||
deviceName:'',//设备名称
|
||||
description:'',//设备描述
|
||||
communicationStatus:'',//工作状态
|
||||
deviceType:'',//设备类型
|
||||
deviceCategory:'',//设备类别
|
||||
parentId:'',//上级设备id
|
||||
ipAddress:'',//TCP设备的ip地址
|
||||
ipPort:"",//TCP端口号
|
||||
serialPort:'',//串口路径
|
||||
baudRate:'',//波特率
|
||||
dataBits:'',//数据位
|
||||
stopBits:'',//停止位
|
||||
parity:'',//校验位
|
||||
pictureUrl:'',//设备图片
|
||||
this.formData = {
|
||||
id: '',//设备唯一标识
|
||||
siteId: '',//站点ID
|
||||
deviceId: '',//设备id
|
||||
deviceName: '',//设备名称
|
||||
description: '',//设备描述
|
||||
communicationStatus: '',//工作状态
|
||||
deviceType: '',//设备类型
|
||||
deviceCategory: '',//设备类别
|
||||
parentId: '',//上级设备id
|
||||
ipAddress: '',//TCP设备的ip地址
|
||||
ipPort: "",//TCP端口号
|
||||
serialPort: '',//串口路径
|
||||
baudRate: '',//波特率
|
||||
dataBits: '',//数据位
|
||||
stopBits: '',//停止位
|
||||
parity: '',//校验位
|
||||
pictureUrl: '',//设备图片
|
||||
slaveId: '',//从站地址
|
||||
}
|
||||
this.pcsSetting = {
|
||||
deviceSettingId: '',
|
||||
powerAddress: '',//功率地址
|
||||
pointAddress: "",//开关机地址
|
||||
startCommand: "",//开机指令
|
||||
stopCommand: "",//关机指令
|
||||
startPower: '',//开机目标功率
|
||||
stopPower: '',//关机目标功率
|
||||
clusterNum: '',//电池簇数
|
||||
clusterPointAddress: []//电池簇地址
|
||||
}
|
||||
this.$refs.addTempForm.resetFields()
|
||||
this.dialogTableVisible=false
|
||||
this.$refs?.pcsSettingForm?.resetFields()
|
||||
this.dialogTableVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
.device-form {
|
||||
::v-deep .el-form-item--medium .el-form-item__content {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
width: 50%;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
98
src/views/ems/site/sblb/PcsSwitch.vue
Normal file
98
src/views/ems/site/sblb/PcsSwitch.vue
Normal file
@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<el-button :size="size" :type="type" :round="round" @click="switchStatus"
|
||||
>
|
||||
{{ label }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
<script>
|
||||
import {updateDeviceStatus} from "@/api/ems/site";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
type: String,
|
||||
default: 'mini',
|
||||
required: false
|
||||
},
|
||||
round: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'primary',
|
||||
required: false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
workStatus: null,
|
||||
deviceId: null,
|
||||
deviceName: null,
|
||||
}
|
||||
},
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
runningStatusMap: ['0', '3', '4', '6']
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
label() {
|
||||
return this.runningStatusMap.includes(this.data.workStatus) ? '关机' : '开机'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
switchStatus() {
|
||||
const {workStatus, deviceId, deviceName, siteId} = this.data
|
||||
this.$confirm(`确认要${this.label}设备${deviceName || ''}吗?`, {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
showClose: false,
|
||||
closeOnClickModal: false,
|
||||
type: "warning",
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === "confirm") {
|
||||
instance.confirmButtonLoading = true;
|
||||
//做开关机操作,更新成功后刷新表格
|
||||
updateDeviceStatus({
|
||||
siteId,
|
||||
workStatus: this.runningStatusMap.includes(workStatus) ? "1" : '0',//1 关机 0开机
|
||||
deviceId
|
||||
})
|
||||
.then((response) => {
|
||||
response.code === 200 && done();
|
||||
})
|
||||
.finally(() => {
|
||||
instance.confirmButtonLoading = false;
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
//只有在废弃成功的情况下会走到这里
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: `${deviceName}${this.label}成功!`,
|
||||
});
|
||||
this.$emit('updateSuccess')
|
||||
//调用接口 更新表格数据
|
||||
})
|
||||
.catch(() => {
|
||||
//取消关机
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -80,7 +80,7 @@
|
||||
<el-table-column label="数据点位" prop="dataPoint"></el-table-column>
|
||||
<el-table-column
|
||||
label="数据点位名称"
|
||||
prop="pointName"
|
||||
prop="dataPointName"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="modbus地址">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
@ -88,8 +88,8 @@
|
||||
<!-- `${scope.row.ipAddress || ""} ${scope.row.ipPort || ""}`-->
|
||||
<!-- }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="寄存器地址" prop="寄存器地址"></el-table-column>
|
||||
<!-- </el-table-column>
|
||||
<el-table-column label="寄存器地址" prop="寄存器地址"></el-table-column>-->
|
||||
<el-table-column
|
||||
label="最新值"
|
||||
prop="pointValue"
|
||||
|
||||
@ -42,8 +42,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showDialog({siteId, code}) {
|
||||
this.upload.data = {siteId, deviceCategory: code}
|
||||
showDialog({siteId, deviceCategory, deviceId}) {
|
||||
this.upload.data = {siteId, deviceCategory, deviceId}
|
||||
this.show = true;
|
||||
},
|
||||
//关闭弹窗 重置数据
|
||||
|
||||
@ -8,13 +8,23 @@
|
||||
:key="index+'zdxeSelect'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型">
|
||||
<el-select v-model="deviceCategory" placeholder="请选择设备类型" @change="onSearch" clearable>
|
||||
<el-option
|
||||
v-for="(item,index) in deviceCategoryList"
|
||||
:key="index+'deviceCategorySelect'"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- <el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>-->
|
||||
<!-- <el-button @click="onReset" native-type="button">重置</el-button>-->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button type="primary" @click="addDevice" native-type="button">新增设备</el-button>
|
||||
<el-dropdown @command="downloadPointDetail">
|
||||
<el-dropdown @command="(val)=>downloadPointDetail(val,false)">
|
||||
<el-button
|
||||
style="margin-left:10px;"
|
||||
type="primary"
|
||||
@ -28,22 +38,20 @@
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-dropdown @command="uploadPointDetail">
|
||||
<el-button
|
||||
style="margin-left:10px;"
|
||||
type="success"
|
||||
plain>
|
||||
上传点位清单
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-for="(item,index) in deviceCategoryList" :key="index+'deviceCategoryList'"
|
||||
:command="item">
|
||||
{{ item.name }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
|
||||
<!-- <el-dropdown @command="(val)=>uploadPointDetail(val,false)">-->
|
||||
<!-- <el-button-->
|
||||
<!-- style="margin-left:10px;"-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain>-->
|
||||
<!-- 上传点位清单-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-dropdown-menu slot="dropdown">-->
|
||||
<!-- <el-dropdown-item v-for="(item,index) in deviceCategoryList" :key="index+'deviceCategoryList'"-->
|
||||
<!-- :command="item">-->
|
||||
<!-- {{ item.name }}-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </el-dropdown-menu>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<el-table
|
||||
class="common-table"
|
||||
:data="tableData"
|
||||
@ -72,10 +80,14 @@
|
||||
label="设备类别">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="runningStatus"
|
||||
prop="deviceStatus"
|
||||
label="在线状态">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ $store.state.ems.deviceStatusOptions[scope.row.runningStatus] }}</span>
|
||||
<span>{{ $store.state.ems.deviceStatusOptions[scope.row.deviceStatus] }}</span>
|
||||
<pcs-switch v-if="scope.row.deviceCategory === 'PCS' && ![null,'',undefined].includes(scope.row.workStatus)"
|
||||
style="margin-left:5px;"
|
||||
:data="{siteId:scope.row.siteId,workStatus:scope.row.workStatus,deviceId:scope.row.deviceId,deviceName:scope.row.deviceName}"
|
||||
@updateSuccess="getData"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -96,6 +108,23 @@
|
||||
报警点位清单
|
||||
</el-button>
|
||||
<br>
|
||||
<el-button
|
||||
@click="downloadPointDetail(scope.row,true)"
|
||||
style="margin-top:10px;"
|
||||
type="primary"
|
||||
plain
|
||||
size="mini">
|
||||
下载点位清单
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="uploadPointDetail(scope.row,true)"
|
||||
style="margin-top:10px;"
|
||||
type="success"
|
||||
plain
|
||||
size="mini">
|
||||
上传点位清单
|
||||
</el-button>
|
||||
<br>
|
||||
<el-button
|
||||
@click="editDevice(scope.row)"
|
||||
style="margin-top:10px;"
|
||||
@ -126,7 +155,7 @@
|
||||
style="margin-top:15px;text-align: center"
|
||||
>
|
||||
</el-pagination>
|
||||
<el-dialog :visible.sync="dialogTableVisible" class="ems-dialog" title=" 详细信息" :close-on-click-modal="false"
|
||||
<el-dialog :visible.sync="dialogTableVisible" class="ems-dialog" title="详细信息" :close-on-click-modal="false"
|
||||
:before-close="handleClosed">
|
||||
<div class="descriptions-main" style="padding: 0">
|
||||
<el-descriptions direction="vertical" :column="2" :colon="false" border>
|
||||
@ -151,10 +180,11 @@ import {getAllDeviceCategory} from '@/api/ems/search'
|
||||
import PointTable from './PointTable.vue'
|
||||
import AddDevice from "./AddDevice.vue";
|
||||
import PointUpload from "./PointUpload.vue";
|
||||
import PcsSwitch from "./PcsSwitch.vue";
|
||||
|
||||
export default {
|
||||
name: "Sblb",
|
||||
components: {AddDevice, PointTable, PointUpload},
|
||||
components: {AddDevice, PointTable, PointUpload, PcsSwitch},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@ -163,8 +193,9 @@ export default {
|
||||
editDeviceId: '',//编辑设备id
|
||||
siteId: '',
|
||||
siteList: [],
|
||||
tableData: [],
|
||||
deviceCategory: '',//搜索栏设备类型
|
||||
deviceCategoryList: [],//设备类别
|
||||
tableData: [],
|
||||
pageSize: 10,//分页栏当前每个数据总数
|
||||
pageNum: 1,//分页栏当前页数
|
||||
totalSize: 0,//table表格数据总数
|
||||
@ -204,15 +235,26 @@ export default {
|
||||
this.$refs.pointTable.showTable(row, dataType)
|
||||
},
|
||||
// 下载点位清单
|
||||
downloadPointDetail(command) {
|
||||
downloadPointDetail(command, isDetail = false) {
|
||||
const siteId = isDetail ? command.siteId : this.siteId
|
||||
const deviceCategory = isDetail ? command.deviceCategory : command.code
|
||||
const categoryName = isDetail ? command.categoryName : command.name
|
||||
const deviceId = isDetail ? command.deviceId : null
|
||||
console.log('下载', command, isDetail)
|
||||
this.download('ems/pointMatch/export', {
|
||||
siteId: this.siteId,
|
||||
deviceCategory: command.code
|
||||
}, `点位清单_${command.name}_${new Date().getTime()}.xlsx`)
|
||||
siteId,
|
||||
deviceCategory,
|
||||
deviceId,
|
||||
}, `点位清单_${categoryName}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 上传点位清单
|
||||
uploadPointDetail(command) {
|
||||
this.$refs.pointUpload.showDialog({...command, siteId: this.siteId})
|
||||
uploadPointDetail(command, isDetail = false) {
|
||||
const siteId = isDetail ? command.siteId : this.siteId
|
||||
const deviceCategory = isDetail ? command.deviceCategory : command.code
|
||||
const categoryName = isDetail ? command.categoryName : command.name
|
||||
const deviceId = isDetail ? command.deviceId : ''
|
||||
console.log('上传', command, isDetail)
|
||||
this.$refs.pointUpload.showDialog({siteId, deviceCategory, categoryName, deviceId})
|
||||
},
|
||||
clearEditDeviceData() {
|
||||
this.mode = '';
|
||||
@ -312,8 +354,8 @@ export default {
|
||||
// 获取数据
|
||||
getData() {
|
||||
this.loading = true
|
||||
const {siteId, pageNum, pageSize} = this
|
||||
getDeviceInfoList({siteId, pageNum, pageSize}).then(response => {
|
||||
const {siteId, deviceCategory, pageNum, pageSize} = this
|
||||
getDeviceInfoList({siteId, deviceCategory, pageNum, pageSize}).then(response => {
|
||||
this.tableData = response?.rows || [];
|
||||
this.totalSize = response?.total || 0
|
||||
}).finally(() => {
|
||||
|
||||
@ -6,30 +6,39 @@
|
||||
<pane size="16">
|
||||
<el-col>
|
||||
<div class="head-container">
|
||||
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
|
||||
<el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small"
|
||||
prefix-icon="el-icon-search" style="margin-bottom: 20px"/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current @node-click="handleNodeClick" />
|
||||
<el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
|
||||
:filter-node-method="filterNode" ref="tree" node-key="id" default-expand-all highlight-current
|
||||
@node-click="handleNodeClick"/>
|
||||
</div>
|
||||
</el-col>
|
||||
</pane>
|
||||
<!--用户数据-->
|
||||
<pane size="84">
|
||||
<el-col>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px">
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
|
||||
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@ -39,33 +48,48 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['system:user:add']">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:user:edit']">修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:user:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
@click="handleDelete" v-hasPermi="['system:user:remove']">删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
|
||||
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
|
||||
v-hasPermi="['system:user:import']">导入
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['system:user:export']">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible"/>
|
||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber"
|
||||
v-if="columns[4].visible" width="120"/>
|
||||
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
||||
@ -75,20 +99,30 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope" v-if="scope.row.userId !== 1">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
|
||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:user:edit']">修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:user:remove']">删除
|
||||
</el-button>
|
||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
|
||||
v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
|
||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="handleResetPwd" icon="el-icon-key" v-hasPermi="['system:user:resetPwd']">重置密码</el-dropdown-item>
|
||||
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check" v-hasPermi="['system:user:edit']">分配角色</el-dropdown-item>
|
||||
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
|
||||
v-hasPermi="['system:user:resetPwd']">重置密码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
|
||||
v-hasPermi="['system:user:edit']">分配角色
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
</el-col>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
@ -100,36 +134,38 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<treeselect v-model="form.deptId" :options="enabledDeptOptions" :show-count="true" placeholder="请选择归属部门" />
|
||||
<treeselect v-model="form.deptId" :options="enabledDeptOptions" :show-count="true"
|
||||
placeholder="请选择归属部门"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
|
||||
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
|
||||
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20"
|
||||
show-password/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -137,14 +173,17 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-select v-model="form.sex" placeholder="请选择性别">
|
||||
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
||||
<el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">
|
||||
{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -153,14 +192,33 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位">
|
||||
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
|
||||
<el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId" :disabled="item.status == 1" ></el-option>
|
||||
<el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"
|
||||
:disabled="item.status == 1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
|
||||
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
|
||||
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId"
|
||||
:disabled="item.status == 1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="归属站点" name="belongSite">
|
||||
<el-select
|
||||
v-model="form.belongSite"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="请选择"
|
||||
style="width:100%"
|
||||
@change="selectBelongSite">
|
||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList"
|
||||
:disabled="item.siteId!== 'all' && (form.belongSite || []).includes('all')"
|
||||
:key="index+'zdxeSelect'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -181,15 +239,20 @@
|
||||
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
|
||||
<el-checkbox v-model="upload.updateSupport"/>
|
||||
是否更新已经存在的用户数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
|
||||
@click="importTemplate">下载模板
|
||||
</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -201,17 +264,27 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"
|
||||
import { getToken } from "@/utils/auth"
|
||||
import {
|
||||
addUser,
|
||||
changeUserStatus,
|
||||
delUser,
|
||||
deptTreeSelect,
|
||||
getUser,
|
||||
listUser,
|
||||
resetUserPwd,
|
||||
updateUser
|
||||
} from "@/api/system/user"
|
||||
import {getAllSites} from '@/api/ems/zddt'
|
||||
import {getToken} from "@/utils/auth"
|
||||
import Treeselect from "@riophae/vue-treeselect"
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||
import { Splitpanes, Pane } from "splitpanes"
|
||||
import {Pane, Splitpanes} from "splitpanes"
|
||||
import "splitpanes/dist/splitpanes.css"
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
dicts: ['sys_normal_disable', 'sys_user_sex'],
|
||||
components: { Treeselect, Splitpanes, Pane },
|
||||
components: {Treeselect, Splitpanes, Pane},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -228,6 +301,8 @@ export default {
|
||||
total: 0,
|
||||
// 用户表格数据
|
||||
userList: null,
|
||||
// 站点列表数据
|
||||
siteList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 所有部门树选项
|
||||
@ -263,7 +338,7 @@ export default {
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
headers: {Authorization: "Bearer " + getToken()},
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/user/importData"
|
||||
},
|
||||
@ -278,27 +353,27 @@ export default {
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
{ key: 0, label: `用户编号`, visible: true },
|
||||
{ key: 1, label: `用户名称`, visible: true },
|
||||
{ key: 2, label: `用户昵称`, visible: true },
|
||||
{ key: 3, label: `部门`, visible: true },
|
||||
{ key: 4, label: `手机号码`, visible: true },
|
||||
{ key: 5, label: `状态`, visible: true },
|
||||
{ key: 6, label: `创建时间`, visible: true }
|
||||
{key: 0, label: `用户编号`, visible: true},
|
||||
{key: 1, label: `用户名称`, visible: true},
|
||||
{key: 2, label: `用户昵称`, visible: true},
|
||||
{key: 3, label: `部门`, visible: true},
|
||||
{key: 4, label: `手机号码`, visible: true},
|
||||
{key: 5, label: `状态`, visible: true},
|
||||
{key: 6, label: `创建时间`, visible: true}
|
||||
],
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' }
|
||||
{required: true, message: "用户名称不能为空", trigger: "blur"},
|
||||
{min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur'}
|
||||
],
|
||||
nickName: [
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||
{required: true, message: "用户昵称不能为空", trigger: "blur"}
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
||||
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
|
||||
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
|
||||
{required: true, message: "用户密码不能为空", trigger: "blur"},
|
||||
{min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur'},
|
||||
{pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur"}
|
||||
],
|
||||
email: [
|
||||
{
|
||||
@ -313,7 +388,8 @@ export default {
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -324,6 +400,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getZdList()
|
||||
this.getList()
|
||||
this.getDeptTree()
|
||||
this.getConfigKey("sys.user.initPassword").then(response => {
|
||||
@ -331,14 +408,37 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
selectBelongSite(data) {
|
||||
console.log('选中的站点', data)
|
||||
if (data.includes("all")) {
|
||||
this.form.belongSite = ['all']
|
||||
return
|
||||
}
|
||||
if (this.siteList.length && data.length === (this.siteList.length - 1)) {
|
||||
this.form.belongSite = ['all']
|
||||
}
|
||||
},
|
||||
//获取站点列表
|
||||
getZdList() {
|
||||
return getAllSites().then(response => {
|
||||
this.siteList = response?.data || []
|
||||
if (this.siteList.length > 0) {
|
||||
this.siteList.unshift({
|
||||
id: 'all',
|
||||
siteId: "all",
|
||||
siteName: "全部"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.userList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}
|
||||
this.userList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}
|
||||
)
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
@ -373,11 +473,11 @@ export default {
|
||||
// 用户状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === "0" ? "启用" : "停用"
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function () {
|
||||
return changeUserStatus(row.userId, row.status)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(text + "成功")
|
||||
}).catch(function() {
|
||||
}).catch(function () {
|
||||
row.status = row.status === "0" ? "1" : "0"
|
||||
})
|
||||
},
|
||||
@ -400,7 +500,8 @@ export default {
|
||||
status: "0",
|
||||
remark: undefined,
|
||||
postIds: [],
|
||||
roleIds: []
|
||||
roleIds: [],
|
||||
belongSite: []
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
@ -455,6 +556,7 @@ export default {
|
||||
this.form = response.data
|
||||
this.postOptions = response.posts
|
||||
this.roleOptions = response.roles
|
||||
this.$set(this.form, "belongSite", response?.data?.belongSite ? JSON.parse(response.data.belongSite) : [])
|
||||
this.$set(this.form, "postIds", response.postIds)
|
||||
this.$set(this.form, "roleIds", response.roleIds)
|
||||
this.open = true
|
||||
@ -475,29 +577,30 @@ export default {
|
||||
return "不能包含非法字符:< > \" ' \\\ |"
|
||||
}
|
||||
},
|
||||
}).then(({ value }) => {
|
||||
resetUserPwd(row.userId, value).then(response => {
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value)
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).then(({value}) => {
|
||||
resetUserPwd(row.userId, value).then(response => {
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value)
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 分配角色操作 */
|
||||
handleAuthRole: function(row) {
|
||||
handleAuthRole: function (row) {
|
||||
const userId = row.userId
|
||||
this.$router.push("/system/user-auth/role/" + userId)
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.userId != undefined) {
|
||||
updateUser(this.form).then(response => {
|
||||
updateUser({...this.form, belongSite: JSON.stringify(this.form.belongSite)}).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addUser(this.form).then(response => {
|
||||
addUser({...this.form, belongSite: JSON.stringify(this.form.belongSite)}).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
@ -509,12 +612,13 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const userIds = row.userId || this.ids
|
||||
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function () {
|
||||
return delUser(userIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@ -529,8 +633,7 @@ export default {
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('system/user/importTemplate', {
|
||||
}, `user_template_${new Date().getTime()}.xlsx`)
|
||||
this.download('system/user/importTemplate', {}, `user_template_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
@ -541,7 +644,7 @@ export default {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true})
|
||||
this.getList()
|
||||
},
|
||||
// 提交上传文件
|
||||
|
||||
Reference in New Issue
Block a user