Compare commits
2 Commits
develop-lo
...
fe14089562
| Author | SHA1 | Date | |
|---|---|---|---|
| fe14089562 | |||
| b68f2608f3 |
@ -1,15 +1,14 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 上动新能源-EMS管理系统
|
VUE_APP_TITLE = 上动新能源-EMS管理系统
|
||||||
|
|
||||||
# 路由懒加载
|
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
NODE_ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# EMS管理系统/开发环境
|
# EMS管理系统/开发环境
|
||||||
VUE_APP_BASE_API = '/dev-api'
|
VUE_APP_BASE_API = '/dev-api'
|
||||||
|
|
||||||
|
# 路由懒加载
|
||||||
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
||||||
# EMS管理系统/开发环境 图片拼接地址
|
# EMS管理系统/开发环境 图片拼接地址
|
||||||
VUE_APP_IMG_URL = '/dev-api'
|
VUE_APP_IMG_URL = '/dev-api'
|
||||||
|
|
||||||
|
|||||||
@ -2,11 +2,10 @@
|
|||||||
VUE_APP_TITLE = 上动新能源-EMS管理系统
|
VUE_APP_TITLE = 上动新能源-EMS管理系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
NODE_ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# EMS管理系统/生产环境
|
# EMS管理系统/生产环境
|
||||||
VUE_APP_BASE_API= 'http://1.15.120.242:8089'
|
VUE_APP_BASE_API = '/dev-api'
|
||||||
|
|
||||||
# EMS管理系统/生产环境 图片拼接地址
|
|
||||||
VUE_APP_IMG_URL = 'http://1.15.120.242:8089'
|
|
||||||
|
|
||||||
|
# EMS管理系统/生产环境 图片拼接地址 todo baseUrl有变更时 请更新
|
||||||
|
VUE_APP_IMG_URL = 'http://110.40.171.179:8089'
|
||||||
|
|||||||
12
.env.staging
@ -1,12 +1,12 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 上动新能源-EMS管理系统
|
VUE_APP_TITLE = 上动新能源-EMS管理系统
|
||||||
|
|
||||||
|
BABEL_ENV = production
|
||||||
|
|
||||||
|
NODE_ENV = production
|
||||||
|
|
||||||
# 测试环境配置
|
# 测试环境配置
|
||||||
NODE_ENV = 'staging'
|
ENV = 'staging'
|
||||||
|
|
||||||
# EMS管理系统/测试环境
|
# EMS管理系统/测试环境
|
||||||
VUE_APP_BASE_API= 'http://110.40.171.179:8089'
|
VUE_APP_BASE_API = '/stage-api'
|
||||||
|
|
||||||
# EMS管理系统/测试环境 图片拼接地址
|
|
||||||
VUE_APP_IMG_URL = 'http://110.40.171.179:8089'
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="icon" href="<%= BASE_URL %>logo-icon.png">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= webpackConfig.name %></title>
|
<title><%= webpackConfig.name %></title>
|
||||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 31 KiB |
@ -10,7 +10,7 @@ import ThemePicker from "@/components/ThemePicker"
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
components: { ThemePicker }
|
components: { ThemePicker },
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -8,30 +8,6 @@ export function getDzjkHomeView(siteId) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//站点首页 冲放曲线
|
|
||||||
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'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//EMS
|
|
||||||
export function getEmsDataList(siteId) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/siteMonitor/getEmsDataList?siteId=${siteId}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取pcs、实时运行头部的设备信息
|
//获取pcs、实时运行头部的设备信息
|
||||||
export function getRunningHeadInfo(siteId) {
|
export function getRunningHeadInfo(siteId) {
|
||||||
return request({
|
return request({
|
||||||
@ -39,7 +15,6 @@ export function getRunningHeadInfo(siteId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取pcs列表
|
//获取pcs列表
|
||||||
export function getPcsDetailInfo(siteId) {
|
export function getPcsDetailInfo(siteId) {
|
||||||
return request({
|
return request({
|
||||||
@ -71,23 +46,20 @@ export function getStackNameList(siteId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取单体电池 电池簇列表数据
|
//获取单体电池 电池簇列表数据
|
||||||
export function getClusterNameList({stackDeviceId, siteId}) {
|
export function getClusterNameList(stackDeviceId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteMonitor/getClusterNameList?stackDeviceId=${stackDeviceId}&siteId=${siteId}`,
|
url: `/ems/siteMonitor/getClusterNameList?stackDeviceId=${stackDeviceId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//单体电池表格数据
|
//单体电池表格数据
|
||||||
export function getClusterDataInfoList({siteId, stackDeviceId, clusterDeviceId, batteryId, pageSize, pageNum}) {
|
export function getClusterDataInfoList({siteId, stackDeviceId, clusterDeviceId, pageSize, pageNum}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteMonitor/getClusterDataInfoList?clusterDeviceId=${clusterDeviceId}&siteId=${siteId}&stackDeviceId=${stackDeviceId}&batteryId=${batteryId}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
url: `/ems/siteMonitor/getClusterDataInfoList?clusterDeviceId=${clusterDeviceId}&siteId=${siteId}&stackDeviceId=${stackDeviceId}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单体电池图表
|
// 单体电池图表
|
||||||
//http://localhost:8089/ems/siteMonitor/getSingleBatteryData?clusterDeviceId=BMSC01&siteId=021_FXX_01&deviceId=001&startDate=2025-07-11&endDate=2025-07-18
|
//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}) {
|
export function getSingleBatteryData({siteId,deviceId,clusterDeviceId,startDate,endDate}) {
|
||||||
@ -105,23 +77,6 @@ export function getCoolingDataList(siteId) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取动环数据
|
|
||||||
export function getDhDataList(siteId) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/siteMonitor/getDhDataList?siteId=${siteId}`,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取消防数据
|
|
||||||
export function getXfDataList(siteId) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/siteMonitor/getXfDataList?siteId=${siteId}`,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//获取电表数据
|
//获取电表数据
|
||||||
export function getAmmeterDataList(siteId) {
|
export function getAmmeterDataList(siteId) {
|
||||||
return request({
|
return request({
|
||||||
@ -131,31 +86,13 @@ export function getAmmeterDataList(siteId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 故障告警
|
// 故障告警
|
||||||
export function getAlarmDetailList({
|
export function getAlarmDetailList({siteId, deviceType, alarmLevel, alarmStartTime, alarmEndTime,pageSize,pageNum}) {
|
||||||
status,
|
|
||||||
siteId,
|
|
||||||
deviceId,
|
|
||||||
alarmLevel,
|
|
||||||
alarmStartTime,
|
|
||||||
alarmEndTime,
|
|
||||||
pageSize,
|
|
||||||
pageNum
|
|
||||||
}) {
|
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteAlarm/getAlarmDetailList?siteId=${siteId}&status=${status}&deviceId=${deviceId}&alarmLevel=${alarmLevel}&alarmStartTime=${alarmStartTime}&alarmEndTime=${alarmEndTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
url: `/ems/siteAlarm/getAlarmDetailList?siteId=${siteId}&deviceType=${deviceType}&alarmLevel=${alarmLevel}&alarmStartTime=${alarmStartTime}&alarmEndTime=${alarmEndTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 告警生成工单
|
|
||||||
export function createTicketNo(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/siteAlarm/createTicketNo`,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 概率统计
|
// 概率统计
|
||||||
//获取概率统计 电量指标接口
|
//获取概率统计 电量指标接口
|
||||||
export function getElectricData({siteId,startDate,endDate}) {
|
export function getElectricData({siteId,startDate,endDate}) {
|
||||||
@ -164,7 +101,6 @@ export function getElectricData({siteId, startDate, endDate}) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取pcs列表
|
//获取pcs列表
|
||||||
export function getPcsNameList(siteId) {
|
export function getPcsNameList(siteId) {
|
||||||
return request({
|
return request({
|
||||||
@ -172,23 +108,20 @@ export function getPcsNameList(siteId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//pcs曲线
|
//pcs曲线
|
||||||
export function getPCSData({siteId, startTime, endTime, dataType}) {
|
export function getPCSData({siteId,deviceId,startTime,endTime,dataType}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/statsReport/getPCSData?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
url: `/ems/statsReport/getPCSData?siteId=${siteId}&deviceId=${deviceId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//电池堆曲线
|
//电池堆曲线
|
||||||
export function getStackData({siteId, startTime, endTime, dataType}) {
|
export function getStackData({siteId,deviceId,startTime,endTime,dataType}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/statsReport/getStackData?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
url: `/ems/statsReport/getStackData?siteId=${siteId}&deviceId=${deviceId}&startDate=${startTime}&endDate=${endTime}&dataType=${dataType}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//电池温度
|
//电池温度
|
||||||
export function getClusterData({siteId,stackId,clusterId,dateTime,pageNum,pageSize}) {
|
export function getClusterData({siteId,stackId,clusterId,dateTime,pageNum,pageSize}) {
|
||||||
return request({
|
return request({
|
||||||
@ -200,41 +133,37 @@ export function getClusterData({siteId, stackId, clusterId, dateTime, pageNum, p
|
|||||||
|
|
||||||
// 实时运行
|
// 实时运行
|
||||||
//储能
|
//储能
|
||||||
export function storagePower(siteId, startTime, endTime) {
|
export function storagePower(siteId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteMonitor/runningGraph/storagePower?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
url: `/ems/siteMonitor/runningGraph/storagePower?siteId=${siteId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//poc平均温度
|
||||||
//poc温度
|
export function stackAveTemp(siteId) {
|
||||||
export function pcsMaxTemp(siteId, startTime, endTime) {
|
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteMonitor/runningGraph/pcsMaxTemp?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
url: `/ems/siteMonitor/runningGraph/stackAveTemp?siteId=${siteId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 电池平均soc
|
// 电池平均soc
|
||||||
export function batteryAveSoc(siteId, startTime, endTime) {
|
export function batteryAveSoc(siteId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteMonitor/runningGraph/batteryAveSoc?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
url: `/ems/siteMonitor/runningGraph/batteryAveSoc?siteId=${siteId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 电池平均温度
|
// 电池平均温度
|
||||||
export function batteryAveTemp(siteId, startTime, endTime) {
|
export function batteryAveTemp(siteId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteMonitor/runningGraph/batteryAveTemp?siteId=${siteId}&startDate=${startTime}&endDate=${endTime}`,
|
url: `/ems/siteMonitor/runningGraph/batteryAveTemp?siteId=${siteId}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 功率曲线
|
// 功率曲线
|
||||||
export function getPowerData({siteId, startDate, endDate}) {
|
export function getPowerData({siteId,deviceId,startDate,endDate,dataType}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/statsReport/getPowerData?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
|
url: `/ems/statsReport/getPowerData?siteId=${siteId}&deviceId=${deviceId}&startDate=${startDate}&endDate=${endDate}&dataType=${dataType}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -246,23 +175,14 @@ export function getLoadNameList(siteId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 电表报表
|
// 电表报表
|
||||||
export function getAmmeterData({siteId, startTime, endTime, pageSize, pageNum}) {
|
export function getAmmeterData({siteId,deviceId,dateTime}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/statsReport/getAmmeterData?siteId=${siteId}&startTime=${startTime}&endTime=${endTime}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
url: `/ems/statsReport/getAmmeterData?siteId=${siteId}&deviceId=${deviceId}&dateTime=${dateTime}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 电价报表
|
|
||||||
export function getAmmeterRevenueData(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/statsReport/getAmmeterRevenueData`,
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//策略列表
|
//策略列表
|
||||||
export function strategyRunningList(siteId) {
|
export function strategyRunningList(siteId) {
|
||||||
@ -271,7 +191,6 @@ export function strategyRunningList(siteId) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//停止策略
|
//停止策略
|
||||||
export function stopStrategyRunning(id) {
|
export function stopStrategyRunning(id) {
|
||||||
return request({
|
return request({
|
||||||
@ -279,7 +198,6 @@ export function stopStrategyRunning(id) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取所有主策略
|
// 获取所有主策略
|
||||||
export function getMainStrategyList() {
|
export function getMainStrategyList() {
|
||||||
return request({
|
return request({
|
||||||
@ -287,7 +205,6 @@ export function getMainStrategyList() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取所有辅助策略
|
//获取所有辅助策略
|
||||||
export function getAuxStrategyList() {
|
export function getAuxStrategyList() {
|
||||||
return request({
|
return request({
|
||||||
@ -295,7 +212,6 @@ export function getAuxStrategyList() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//配置策略
|
//配置策略
|
||||||
export function configStrategy(data) {
|
export function configStrategy(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -313,7 +229,6 @@ export function getTempNameList({siteId, strategyId}) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取模板详情
|
//获取模板详情
|
||||||
///strategy/temp/list?templateId=1
|
///strategy/temp/list?templateId=1
|
||||||
export function getStrategyTempDetail(templateId) {
|
export function getStrategyTempDetail(templateId) {
|
||||||
@ -322,7 +237,6 @@ export function getStrategyTempDetail(templateId) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//新增模板
|
//新增模板
|
||||||
export function addStrategyTemp(data) {
|
export function addStrategyTemp(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -331,7 +245,6 @@ export function addStrategyTemp(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function editStrategyTemp(data) {
|
export function editStrategyTemp(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/strategy/temp`,
|
url: `/strategy/temp`,
|
||||||
@ -339,7 +252,6 @@ export function editStrategyTemp(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//http://localhost:8089/strategy/temp/{id}
|
//http://localhost:8089/strategy/temp/{id}
|
||||||
export function deleteStrategyTemp(id) {
|
export function deleteStrategyTemp(id) {
|
||||||
return request({
|
return request({
|
||||||
@ -355,7 +267,6 @@ export function timeConfigList({siteId, strategyId}) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//保存时间配置
|
//保存时间配置
|
||||||
// http://localhost:8089/strategy/timeConfig
|
// http://localhost:8089/strategy/timeConfig
|
||||||
export function setTimeConfigList(data) {
|
export function setTimeConfigList(data) {
|
||||||
@ -365,20 +276,11 @@ export function setTimeConfigList(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 策略曲线图
|
// 策略曲线图
|
||||||
//http://localhost:8089/strategy/curve/curveList?strategyId=1&siteId=021_FXX_01
|
//http://localhost:8089/strategy/curve/list?strategyId=1&siteId=021_FXX_01
|
||||||
export function curveList({siteId,strategyId}) {
|
export function curveList({siteId,strategyId}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/strategy/curve/curveList?siteId=${siteId}&strategyId=${strategyId}`,
|
url: `/strategy/curve/list?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',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,42 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
// 新增
|
|
||||||
export function addPriceConfig(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ems/energyPriceConfig',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//修改
|
|
||||||
export function editPriceConfig(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ems/energyPriceConfig',
|
|
||||||
method: 'put',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//删除
|
|
||||||
export function energyPriceConfig(id) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/energyPriceConfig/${id}`,
|
|
||||||
method: 'DELETE',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//详情
|
|
||||||
export function detailPriceConfig(id) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/energyPriceConfig/${id}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//列表
|
|
||||||
export function listPriceConfig({startTime,endTime,pageSize,pageNum,siteId}) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/energyPriceConfig/list?startTime=${startTime}&endTime=${endTime}&pageNum=${pageNum}&pageSize=${pageSize}&siteId=${siteId}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
// 获取设备列表
|
|
||||||
export function getAllDeviceCategory() {
|
|
||||||
return request({
|
|
||||||
url: '/ems/generalQuery/getAllDeviceCategory',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 点位列表
|
|
||||||
export function pointFuzzyQuery(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ems/generalQuery/pointFuzzyQuery',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 图表
|
|
||||||
export function getPointValueList(data) {
|
|
||||||
return request({
|
|
||||||
url: '/ems/generalQuery/getPointValueList',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 图表
|
|
||||||
export function getAllBatteryIdsBySites(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/generalQuery/getAllBatteryIdsBySites/${data}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,5 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 站点列表
|
// 站点列表
|
||||||
export function getSiteInfoList({siteName,startTime, endTime,pageSize,pageNum}) {
|
export function getSiteInfoList({siteName,startTime, endTime,pageSize,pageNum}) {
|
||||||
return request({
|
return request({
|
||||||
@ -9,11 +8,10 @@ export function getSiteInfoList({siteName, startTime, endTime, pageSize, pageNum
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设备列表
|
// 设备列表
|
||||||
export function getDeviceInfoList(data) {
|
export function getDeviceInfoList({siteId,pageSize,pageNum}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteConfig/getDeviceInfoList`,
|
url: `/ems/siteConfig/getDeviceInfoList?siteId=${siteId}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
||||||
method: 'get',
|
method: 'get'
|
||||||
params: data
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +39,6 @@ export function addDevice(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑设备
|
// 编辑设备
|
||||||
export function updateDevice(data) {
|
export function updateDevice(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -50,7 +47,6 @@ export function updateDevice(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除设备
|
// 删除设备
|
||||||
export function deleteService(id) {
|
export function deleteService(id) {
|
||||||
return request({
|
return request({
|
||||||
@ -59,23 +55,6 @@ 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({
|
|
||||||
url: `/ems/siteConfig/getParentDeviceId?siteId=${siteId}&deviceCategory=${deviceCategory}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取所有设备
|
//获取所有设备
|
||||||
export function getDeviceList(siteId) {
|
export function getDeviceList(siteId) {
|
||||||
return request({
|
return request({
|
||||||
@ -83,121 +62,3 @@ export function getDeviceList(siteId) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取设备点位table
|
|
||||||
export function getDevicePointList(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/siteConfig/getDevicePointList`,
|
|
||||||
method: 'get',
|
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//获取设备类型下面的所有设备列表
|
|
||||||
export function getDeviceListBySiteAndCategory({siteId, deviceCategory}) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/siteConfig/getDeviceListBySiteAndCategory?siteId=${siteId}&deviceCategory=${deviceCategory}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//新增设备保护
|
|
||||||
export function addProtectPlan(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/protectPlan`,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//修改设备保护
|
|
||||||
export function updateProtectPlan(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/protectPlan`,
|
|
||||||
method: 'put',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//删除设备保护
|
|
||||||
export function deleteProtectPlan(id) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/protectPlan/${id}`,
|
|
||||||
method: 'delete',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//设备保护详情
|
|
||||||
export function getProtectPlan(id) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/protectPlan/${id}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//设备保护详情列表
|
|
||||||
//http://localhost:8089/ems/protectPlan/list?pageSize=10&pageNum=1&faultName=总压&siteId=021_DDS_01
|
|
||||||
export function protectPlanList({siteId, faultName, pageSize, pageNum}) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/protectPlan/list?siteId=${siteId}&faultName=${faultName}&pageSize=${pageSize}&pageNum=${pageNum}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 点位导出
|
|
||||||
export function exportPointList(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/pointMatch/export`,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 点位导入
|
|
||||||
export function importPointList(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/pointMatch/importData`,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//mqtt
|
|
||||||
export function getMqttList({pageSize, pageNum, mqttTopic, topicName, siteId}) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/mqttConfig/list?pageSize=${pageSize}&pageNum=${pageNum}&mqttTopic=${mqttTopic}&topicName=${topicName}&siteId=${siteId}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getMqttDetail(id) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/mqttConfig/${id}`,
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function addMqtt(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/mqttConfig`,
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function editMqtt(data) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/mqttConfig`,
|
|
||||||
method: 'put',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function deleteMqtt(id) {
|
|
||||||
return request({
|
|
||||||
url: `/ems/mqttConfig/${id}`,
|
|
||||||
method: 'delete',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.2 MiB |
|
Before Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 1021 KiB |
|
Before Width: | Height: | Size: 31 KiB |
BIN
src/assets/images/ems/logo-large.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 34 KiB |
BIN
src/assets/images/login-background.jpg
Normal file
|
After Width: | Height: | Size: 509 KiB |
@ -5,17 +5,15 @@
|
|||||||
//右侧内容区域
|
//右侧内容区域
|
||||||
//父元素
|
//父元素
|
||||||
.ems-dashboard-editor-container{
|
.ems-dashboard-editor-container{
|
||||||
background-color: #F1F5FC;
|
background-color: #FFFFFF;//#F1F5FC
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
//除去顶部信息(如搜索栏、站点基本信息等)外的 白色背景内容区域
|
//除去顶部信息(如搜索栏、站点基本信息等)外的 白色背景内容区域
|
||||||
.ems-content-container{
|
.ems-content-container{
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
//需要设置内padding的白色背景区域
|
//需要设置内padding的白色背景区域
|
||||||
.ems-content-container-padding{
|
.ems-content-container-padding{
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
@ -28,148 +26,43 @@
|
|||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
background: #F1F5FB ;
|
background: #F1F5FB ;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.card-title{
|
.card-title{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color:#333333;
|
color:#333333;
|
||||||
}
|
}
|
||||||
|
.large-title{
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
.el-button--text{
|
.el-button--text{
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.common-card-container-body-no-padding{
|
.common-card-container-body-no-padding{
|
||||||
.el-card__body{
|
.el-card__body{
|
||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.common-card-container-no-title-bg {
|
.common-card-container-no-title-bg {
|
||||||
.el-card__header{
|
.el-card__header{
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//单站监控 设备监控card公共样式
|
|
||||||
.sbjk-card-container {
|
|
||||||
.el-card__header {
|
|
||||||
background-color: transparent;
|
|
||||||
padding: 5px 14px;
|
|
||||||
color: #ffffff;
|
|
||||||
position: relative;
|
|
||||||
border-radius: 5px 5px 0 0;
|
|
||||||
|
|
||||||
.large-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 500;
|
|
||||||
line-height: 40px;
|
|
||||||
padding: 0 50px 0 11px;
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-button--text {
|
|
||||||
color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.alarm {
|
|
||||||
position: absolute;
|
|
||||||
right: 25px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
|
|
||||||
.alarm-icon {
|
|
||||||
font-size: 22px;
|
|
||||||
color: #fff;
|
|
||||||
display: block;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//红色背景颜色标题
|
|
||||||
&.warning-card-container {
|
|
||||||
.el-card__header {
|
|
||||||
background-color: #b64040; //#fc6b69;
|
|
||||||
}
|
|
||||||
|
|
||||||
.work-status {
|
|
||||||
color: #b64040 !important;;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//绿色背景颜色标题
|
|
||||||
&.running-card-container {
|
|
||||||
.el-card__header {
|
|
||||||
background-color: #40b6a5; //#05aea3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.work-status {
|
|
||||||
color: #40b6a5 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//灰色背景颜色标题
|
|
||||||
&.timing-card-container {
|
|
||||||
.el-card__header {
|
|
||||||
background-color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.work-status {
|
|
||||||
color: #666666 !important;;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* card标题里的时间选择器 */
|
|
||||||
.time-range-card {
|
|
||||||
&.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//描述样式 PCS、BMS总览、BMS电池簇页面公共样式
|
//描述样式 PCS、BMS总览、BMS电池簇页面公共样式
|
||||||
.descriptions-main{
|
.descriptions-main{
|
||||||
padding:24px;
|
padding:24px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&.descriptions-main-bg-color{
|
&.descriptions-main-bg-color{
|
||||||
background-color:#f1f5fc ;
|
background-color:#f1f5fc ;
|
||||||
|
|
||||||
.el-descriptions__body{
|
.el-descriptions__body{
|
||||||
background-color:#f1f5fc ;
|
background-color:#f1f5fc ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-descriptions-item__cell[colspan='1']{
|
.el-descriptions-item__cell[colspan='1']{
|
||||||
width:25%
|
width:25%
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-descriptions__body .el-descriptions__table{
|
.el-descriptions__body .el-descriptions__table{
|
||||||
.descriptions-direction{
|
.descriptions-direction{
|
||||||
line-height: 19px;
|
line-height: 19px;
|
||||||
@ -177,76 +70,35 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.descriptions-label{
|
.descriptions-label{
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danger{
|
.danger{
|
||||||
color:#FC6B69;
|
color:#FC6B69;
|
||||||
}
|
}
|
||||||
|
|
||||||
.save{
|
.save{
|
||||||
color:#09ADA3;
|
color:#09ADA3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.keep{
|
.keep{
|
||||||
color:#3C81FF;
|
color:#3C81FF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//电表、液冷公共样式
|
|
||||||
.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 {
|
|
||||||
padding: 10px 0;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666666;
|
|
||||||
line-height: 14px;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
border-right: 1px solid #eee;
|
|
||||||
|
|
||||||
.left {
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
display: block;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 18px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//公共表格样式
|
//公共表格样式
|
||||||
.el-table {
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.common-table.el-table{
|
.common-table.el-table{
|
||||||
color:#333333;
|
color:#333333;
|
||||||
|
|
||||||
.el-table__header-wrapper th, .el-table__fixed-header-wrapper th {
|
.el-table__header-wrapper th, .el-table__fixed-header-wrapper th {
|
||||||
background: #f1f5fc;
|
background: #f1f5fc;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
|
||||||
.table-head {
|
.table-head {
|
||||||
color: #515a6e;
|
color: #515a6e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.warning-status{
|
.warning-status{
|
||||||
color:#FC6B69;
|
color:#FC6B69;
|
||||||
|
|
||||||
&.circle::before {
|
&.circle::before {
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -262,35 +114,22 @@
|
|||||||
//二、三级菜单栏样式
|
//二、三级菜单栏样式
|
||||||
.ems-second-menu{
|
.ems-second-menu{
|
||||||
width:fit-content;
|
width:fit-content;
|
||||||
|
|
||||||
.el-menu-item{
|
.el-menu-item{
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.el-menu--horizontal > .el-menu-item.is-active,&.el-menu--horizontal > .el-menu-item{
|
&.el-menu--horizontal > .el-menu-item.is-active,&.el-menu--horizontal > .el-menu-item{
|
||||||
border-bottom:none!important;
|
border-bottom:none!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu-item.is-active{
|
.el-menu-item.is-active{
|
||||||
background: #0366c1!important;
|
background: #0366c1!important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ems-third-menu-container {
|
|
||||||
position: relative;
|
|
||||||
padding-left: 140px;
|
|
||||||
background-color: #ffffff;
|
|
||||||
|
|
||||||
.ems-third-menu{
|
.ems-third-menu{
|
||||||
border-right: none;
|
border-right: none;
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
|
|
||||||
.el-menu-item{
|
.el-menu-item{
|
||||||
line-height: 45px;
|
line-height: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
@ -298,18 +137,15 @@
|
|||||||
width: 125px;
|
width: 125px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu-item:hover{
|
.el-menu-item:hover{
|
||||||
background: #67b1ff!important;
|
background: #67b1ff!important;
|
||||||
color:#ffffff!important;
|
color:#ffffff!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu-item.is-active{
|
.el-menu-item.is-active{
|
||||||
background: #409eff!important;
|
background: #409eff!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//按钮栏 选中样式
|
//按钮栏 选中样式
|
||||||
@ -326,7 +162,6 @@
|
|||||||
.select-container.el-form--inline .el-form-item{
|
.select-container.el-form--inline .el-form-item{
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
//红色背景颜色按钮
|
//红色背景颜色按钮
|
||||||
.alarm-btn,.alarm-btn:hover, .alarm-btn:focus{
|
.alarm-btn,.alarm-btn:hover, .alarm-btn:focus{
|
||||||
background-color: #FC6B69;
|
background-color: #FC6B69;
|
||||||
|
|||||||
@ -1,137 +0,0 @@
|
|||||||
<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,150 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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 {
|
|
||||||
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: {
|
|
||||||
disabledDate(time) {
|
|
||||||
return time.getTime() > Date.now();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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)
|
|
||||||
},
|
|
||||||
showBtnLoading(status) {
|
|
||||||
this.loading = status
|
|
||||||
},
|
|
||||||
resetDate() {
|
|
||||||
this.dateRange = this.defaultDateRange
|
|
||||||
},
|
|
||||||
//重置 设置时间范围为初始化时间段
|
|
||||||
reset() {
|
|
||||||
this.resetDate()
|
|
||||||
this.$emit('reset')
|
|
||||||
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()
|
|
||||||
const nowDis = nowEndTimes - nowStartTimes//用户当前选择时间差 可能=0
|
|
||||||
//baseTime,maxTime 毫秒数
|
|
||||||
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
|
|
||||||
let end = type === 'before' ? nowEndTimes - calcDis : nowEndTimes + calcDis
|
|
||||||
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: 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'
|
attr:'installCapacity'
|
||||||
|
|
||||||
},{
|
},{
|
||||||
title:'总充电量(KWh)',
|
title:'总充电量(MWh)',
|
||||||
num:'',
|
num:'',
|
||||||
color:'#A696FF',
|
color:'#A696FF',
|
||||||
attr:'totalChargedCap'
|
attr:'totalChargedCap'
|
||||||
|
|
||||||
},{
|
},{
|
||||||
title:'总放电量(KWh)',
|
title:'总放电量(MWh)',
|
||||||
num:'',
|
num:'',
|
||||||
color:'#A696FF',
|
color:'#A696FF',
|
||||||
attr:'totalDischargedCap'
|
attr:'totalDischargedCap'
|
||||||
|
|||||||
@ -3,13 +3,13 @@
|
|||||||
<div class="zd-select-container">
|
<div class="zd-select-container">
|
||||||
<el-form :inline="true">
|
<el-form :inline="true">
|
||||||
<el-form-item label="站点选择">
|
<el-form-item label="站点选择">
|
||||||
<el-select v-model="id" placeholder="请选择换电站名称" :loading="loading" loading-text="正在加载数据" @change="onSubmit">
|
<el-select v-model="id" placeholder="请选择换电站名称" :loading="loading" loading-text="正在加载数据">
|
||||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'zdxeSelect'"></el-option>
|
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'zdxeSelect'"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item>-->
|
<el-form-item>
|
||||||
<!-- <el-button type="primary" :loading="searchLoading" @click="onSubmit">搜索</el-button>-->
|
<el-button type="primary" :loading="searchLoading" @click="onSubmit">搜索</el-button>
|
||||||
<!-- </el-form-item>-->
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,17 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
||||||
@toggleClick="toggleSideBar"/>
|
|
||||||
|
|
||||||
<breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
|
<breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
|
||||||
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
|
<top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
<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" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
|
|
||||||
@ -37,11 +32,11 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|
||||||
<div class="right-menu-item hover-effect setting" @click="setLayout" v-if="setting">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<BigDataPopup ref="bigDataPopup"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -53,7 +48,6 @@ import Hamburger from '@/components/Hamburger'
|
|||||||
import Screenfull from '@/components/Screenfull'
|
import Screenfull from '@/components/Screenfull'
|
||||||
import SizeSelect from '@/components/SizeSelect'
|
import SizeSelect from '@/components/SizeSelect'
|
||||||
import Search from '@/components/HeaderSearch'
|
import Search from '@/components/HeaderSearch'
|
||||||
import BigDataPopup from '@/components/BigDataPopup'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
emits: ['setLayout'],
|
emits: ['setLayout'],
|
||||||
@ -63,8 +57,7 @@ export default {
|
|||||||
Hamburger,
|
Hamburger,
|
||||||
Screenfull,
|
Screenfull,
|
||||||
SizeSelect,
|
SizeSelect,
|
||||||
Search,
|
Search
|
||||||
BigDataPopup
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
@ -85,9 +78,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showBigDataImg() {
|
|
||||||
this.$refs.bigDataPopup.show = true
|
|
||||||
},
|
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
},
|
},
|
||||||
@ -103,8 +93,7 @@ export default {
|
|||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
location.href = '/index'
|
location.href = '/index'
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,17 +139,6 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 50px;
|
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 {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
@ -190,7 +168,6 @@ export default {
|
|||||||
.avatar-wrapper {
|
.avatar-wrapper {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-right: 10px;
|
|
||||||
|
|
||||||
.user-avatar {
|
.user-avatar {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@ -1,22 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||||
class="sidebar-logo-container"
|
|
||||||
:class="{ collapse: collapse }"
|
|
||||||
:style="{
|
|
||||||
backgroundColor:
|
|
||||||
sideTheme === 'theme-dark'
|
|
||||||
? variables.menuBackground
|
|
||||||
: variables.menuLightBackground,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<transition name="sidebarLogoFade">
|
<transition name="sidebarLogoFade">
|
||||||
<router-link
|
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
||||||
v-if="collapse"
|
<img :src="logo" class="sidebar-logo" />
|
||||||
key="collapse"
|
|
||||||
class="sidebar-logo-link"
|
|
||||||
to="/"
|
|
||||||
>
|
|
||||||
<img :src="logoSmall" class="sidebar-logo" />
|
|
||||||
<!-- <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>-->
|
<!-- <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>-->
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||||
@ -28,33 +14,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import variables from "@/assets/styles/variables.scss";
|
import logoImg from '@/assets/logo/logo.png'
|
||||||
import logo from "@/assets/images/ems/logo.png";
|
import variables from '@/assets/styles/variables.scss'
|
||||||
import logoSmall from "@/assets/images/ems/logo-small.png";
|
import logo from '@/assets/images/ems/logo.png'
|
||||||
|
import logoLarge from '@/assets/images/ems/logo-large.png'
|
||||||
export default {
|
export default {
|
||||||
name: "SidebarLogo",
|
name: 'SidebarLogo',
|
||||||
props: {
|
props: {
|
||||||
collapse: {
|
collapse: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true,
|
required: true
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
variables() {
|
variables() {
|
||||||
return variables;
|
return variables
|
||||||
},
|
},
|
||||||
sideTheme() {
|
sideTheme() {
|
||||||
return this.$store.state.settings.sideTheme;
|
return this.$store.state.settings.sideTheme
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: process.env.VUE_APP_TITLE,
|
title: process.env.VUE_APP_TITLE,
|
||||||
|
// logo: logoImg
|
||||||
logo:logo,
|
logo:logo,
|
||||||
logoSmall: logoSmall,
|
logoLarge:logoLarge
|
||||||
};
|
}
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -55,12 +55,3 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
|
||||||
::v-deep{
|
|
||||||
//,.el-submenu.is-active>.el-submenu__title 选中了二级菜单的以及菜单
|
|
||||||
.el-menu-item.is-active{
|
|
||||||
background-color: rgba(0,0,0,0.1) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -6,16 +6,16 @@ const getQuerySiteId= {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.query':{
|
'$store.state.ems.zdList':{
|
||||||
handler (newQuery,oldQuery) {
|
handler (newQuery,oldQuery) {
|
||||||
|
if(!newQuery || newQuery.length === 0){return}
|
||||||
// 参数变化处理
|
// 参数变化处理
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const {siteId} =newQuery
|
const {siteId} =newQuery[0]
|
||||||
if(siteId){
|
|
||||||
this.siteId = siteId
|
this.siteId = siteId
|
||||||
siteId && this.init(newQuery.siteId)
|
siteId && this.init(newQuery.siteId)
|
||||||
console.log('mixin=>getQuerySiteId=>页面参数siteId发生了变化,this.siteId=',this.siteId)
|
console.log('watch站点列表返回数据newQuery=',newQuery)
|
||||||
}
|
console.log('设置页面siteId,this.siteId=',this.siteId)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|||||||
@ -1,24 +0,0 @@
|
|||||||
// 定时刷新
|
|
||||||
const intervalUpdate= {
|
|
||||||
data: function () {
|
|
||||||
return {
|
|
||||||
intervalUpdateTimer:null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
console.log('销毁之前 清空定时器')
|
|
||||||
if( this.intervalUpdateTimer) {
|
|
||||||
window.clearInterval(this.intervalUpdateTimer)
|
|
||||||
this.intervalUpdateTimer = null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
updateInterval: function (cn,time=60000) {
|
|
||||||
window.clearInterval(this.intervalUpdateTimer)
|
|
||||||
this.intervalUpdateTimer = null
|
|
||||||
this.intervalUpdateTimer = window.setInterval(cn,time)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
export default intervalUpdate
|
|
||||||
@ -31,6 +31,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
// 判断当前用户是否已拉取完user_info信息
|
// 判断当前用户是否已拉取完user_info信息
|
||||||
store.dispatch('GetInfo').then(() => {
|
store.dispatch('GetInfo').then(() => {
|
||||||
isRelogin.show = false
|
isRelogin.show = false
|
||||||
|
store.dispatch('getZdList')
|
||||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||||
// 根据roles权限生成可访问的路由表
|
// 根据roles权限生成可访问的路由表
|
||||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||||
|
|||||||
@ -1,5 +1,23 @@
|
|||||||
import Layout from "@/layout/index.vue";
|
import Layout from "@/layout/index.vue";
|
||||||
|
|
||||||
|
//todo delete 删除动态路由页面的定义 接口会传递进来
|
||||||
|
// const ems = [
|
||||||
|
// {
|
||||||
|
// path: '',
|
||||||
|
// component: Layout,
|
||||||
|
// redirect: 'noRedirect',
|
||||||
|
// children: [
|
||||||
|
// {
|
||||||
|
// path: 'zddt',
|
||||||
|
// component: () => import('@/views/ems/zddt/index'),
|
||||||
|
// name: 'zddt',
|
||||||
|
// meta: { title: '站点地图', icon: 'guide' }
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// export default ems
|
||||||
|
|
||||||
//单站监控
|
//单站监控
|
||||||
// todo 本地设置了 hidden:true,不会显示在侧边栏,需要在系统管理、菜单管理中手动添加菜单后才会展示在侧边栏
|
// todo 本地设置了 hidden:true,不会显示在侧边栏,需要在系统管理、菜单管理中手动添加菜单后才会展示在侧边栏
|
||||||
export const dzjk=[
|
export const dzjk=[
|
||||||
@ -7,166 +25,79 @@ export const dzjk = [
|
|||||||
path: '/dzjk',
|
path: '/dzjk',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/dzjk/home',
|
redirect: '/dzjk/home',
|
||||||
meta: {title: '单站监控', icon: 'dashboard',},
|
meta: { title: '单站监控', icon: 'server',},
|
||||||
alwaysShow: false,
|
alwaysShow: false,
|
||||||
name:'Dzjk',
|
name:'Dzjk',
|
||||||
hidden: true,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
component: () => import('@/views/ems/dzjk/index'),
|
|
||||||
name: 'Dzjk',
|
|
||||||
redirect: '/dzjk/home',
|
|
||||||
hidden: true,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/dzjk/home',
|
path: '/dzjk/home',
|
||||||
component: () => import('@/views/ems/dzjk/home/index.vue'),
|
component: () => import('@/views/ems/dzjk/home/index.vue'),
|
||||||
name: 'DzjkHome',
|
name: 'DzjkHome',
|
||||||
meta: {
|
meta: { title: '站点首页',breadcrumb: false,activeMenu: '/dzjk/home',activeSecondMenuName:'DzjkHome' }
|
||||||
title: '站点首页',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkHome'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dzjk/zxlt',
|
path: '/dzjk/zxlt',
|
||||||
component: () => import('@/views/ems/dzjk/zxlt/index.vue'),
|
component: () => import('@/views/ems/dzjk/zxlt/index.vue'),
|
||||||
name: 'DzjkZxlt',
|
name: 'DzjkZxlt',
|
||||||
meta: {
|
meta: { title: '主线路图',breadcrumb: false,activeMenu: '/dzjk/zxlt',activeSecondMenuName:'DzjkZxlt' }
|
||||||
title: '主线路图',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkZxlt'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dzjk/sbjk',
|
path: '/dzjk/sbjk',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/index.vue'),
|
||||||
name: 'DzjkSbjk',
|
name: 'DzjkSbjk',
|
||||||
meta: {title: '设备监控', breadcrumb: false, activeMenu: '/dzjk'},
|
alwaysShow: false,
|
||||||
|
meta: { title: '设备监控',breadcrumb: false,activeMenu: '/dzjk/sbjk'},
|
||||||
|
hidden: false,
|
||||||
redirect: '/dzjk/sbjk/ssyx',
|
redirect: '/dzjk/sbjk/ssyx',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'ssyx',
|
path: 'ssyx',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/ssyx/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/ssyx/index.vue'),
|
||||||
name: 'DzjkSbjkSsyx',
|
name: 'DzjkSbjkSsyx',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '实时运行',
|
meta: { title: '实时运行',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'SSYX'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'ems',
|
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/ems/index.vue'),
|
|
||||||
name: 'DzjkSbjkEms',
|
|
||||||
meta: {
|
|
||||||
title: 'EMS',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'EMS'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'pcs',
|
path: 'pcs',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/pcs/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/pcs/index.vue'),
|
||||||
name: 'DzjkSbjkPcs',
|
name: 'DzjkSbjkPcs',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: 'PCS',
|
meta: { title: 'PCS',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'PCS'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'bmszl',
|
path: 'bmszl',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/bmszl/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/bmszl/index.vue'),
|
||||||
name: 'DzjkSbjkBmszl',
|
name: 'DzjkSbjkBmszl',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: 'BMS总览',
|
meta: { title: 'BMS总览',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'STACK'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'bmsdcc',
|
path: 'bmsdcc',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/bmsdcc/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/bmsdcc/index.vue'),
|
||||||
name: 'DzjkSbjkBmsdcc',
|
name: 'DzjkSbjkBmsdcc',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: 'BMS电池簇',
|
meta: { title: 'BMS电池簇',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'CLUSTER'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dtdc',
|
path: 'dtdc',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/dtdc/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/dtdc/index.vue'),
|
||||||
name: 'DzjkSbjkDtdc',
|
name: 'DzjkSbjkDtdc',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: 'BMS单体电池',
|
meta: { title: '单体电池',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'BATTERY'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'db',
|
path: 'db',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/db/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/db/index.vue'),
|
||||||
name: 'DzjkSbjkDb',
|
name: 'DzjkSbjkDb',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '电表',
|
meta: { title: '电表',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'AMMETER'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'yl',
|
path: 'yl',
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/yl/index.vue'),
|
component: () => import('@/views/ems/dzjk/sbjk/yl/index.vue'),
|
||||||
name: 'DzjkSbjkYl',
|
name: 'DzjkSbjkYl',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '冷却',
|
meta: { title: '液冷',breadcrumb: false,activeMenu: '/dzjk/sbjk',activeSecondMenuName:'DzjkSbjk'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'COOLING'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'dh',
|
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/dh/index.vue'),
|
|
||||||
name: 'DzjkSbjkDh',
|
|
||||||
meta: {
|
|
||||||
title: '动环',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'DH'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'xf',
|
|
||||||
component: () => import('@/views/ems/dzjk/sbjk/xf/index.vue'),
|
|
||||||
name: 'DzjkSbjkXf',
|
|
||||||
meta: {
|
|
||||||
title: '消防',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkSbjk',
|
|
||||||
deviceCategory: 'XF'
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -174,128 +105,66 @@ export const dzjk = [
|
|||||||
path: '/dzjk/gzgj',
|
path: '/dzjk/gzgj',
|
||||||
component: () => import('@/views/ems/dzjk/gzgj/index.vue'),
|
component: () => import('@/views/ems/dzjk/gzgj/index.vue'),
|
||||||
name: 'DzjkGzgj',
|
name: 'DzjkGzgj',
|
||||||
meta: {
|
meta: { title: '故障告警',breadcrumb: false,activeMenu: '/dzjk/gzgj',activeSecondMenuName:'DzjkGzgj' }
|
||||||
title: '故障告警',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkGzgj'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dzjk/tjbb',
|
path: '/dzjk/tjbb',
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/index.vue'),
|
component: () => import('@/views/ems/dzjk/tjbb/index.vue'),
|
||||||
name: 'DzjkTjbb',
|
name: 'DzjkTjbb',
|
||||||
meta: {title: '统计报表', breadcrumb: false, activeMenu: '/dzjk'},
|
alwaysShow: false,
|
||||||
|
meta: {title: '统计报表', breadcrumb: false, activeMenu: '/dzjk/tjbb'},
|
||||||
|
hidden: false,
|
||||||
redirect: '/dzjk/tjbb/gltj',
|
redirect: '/dzjk/tjbb/gltj',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'gltj',
|
path: 'gltj',
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/gltj/index.vue'),
|
component: () => import('@/views/ems/dzjk/tjbb/gltj/index.vue'),
|
||||||
name: 'DzjkTjbbGltj',
|
name: 'DzjkTjbbGltj',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '运行统计',
|
meta: { title: '概率统计',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkTjbb'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'glqx',
|
path: 'glqx',
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/glqx/index.vue'),
|
component: () => import('@/views/ems/dzjk/tjbb/glqx/index.vue'),
|
||||||
name: 'DzjkTjbbGlqx',
|
name: 'DzjkTjbbGlqx',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '功率曲线',
|
meta: { title: '功率曲线',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkTjbb'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'pcsqx',
|
path: 'pcsqx',
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/pcsqx/index.vue'),
|
component: () => import('@/views/ems/dzjk/tjbb/pcsqx/index.vue'),
|
||||||
name: 'DzjkTjbbPcsqx',
|
name: 'DzjkTjbbPcsqx',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: 'PCS曲线',
|
meta: { title: 'PCS曲线',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkTjbb'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dcdqx',
|
path: 'dcdqx',
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/dcdqx/index.vue'),
|
component: () => import('@/views/ems/dzjk/tjbb/dcdqx/index.vue'),
|
||||||
name: 'DzjkTjbbDcdqx',
|
name: 'DzjkTjbbDcdqx',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '电池堆曲线',
|
meta: { title: '电池堆曲线',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkTjbb'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dcwd',
|
path: 'dcwd',
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/dcwd/index.vue'),
|
component: () => import('@/views/ems/dzjk/tjbb/dcwd/index.vue'),
|
||||||
name: 'DzjkTjbbDcwd',
|
name: 'DzjkTjbbDcwd',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '电池温度',
|
meta: { title: '电池温度',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkTjbb'
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'dbbb',
|
path: 'dbbb',
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/dbbb/index.vue'),
|
component: () => import('@/views/ems/dzjk/tjbb/dbbb/index.vue'),
|
||||||
name: 'DzjkTjbbDbbb',
|
name: 'DzjkTjbbDbbb',
|
||||||
meta: {
|
hidden: true,
|
||||||
title: '电表报表',
|
meta: { title: '电表报表',breadcrumb: false,activeMenu: '/dzjk/tjbb',activeSecondMenuName:'DzjkTjbb'},
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkTjbb'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'sybb',
|
|
||||||
component: () => import('@/views/ems/dzjk/tjbb/sybb/index.vue'),
|
|
||||||
name: 'DzjkTjbbSybb',
|
|
||||||
meta: {
|
|
||||||
title: '收益报表',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkTjbb'
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dzjk/clpz',
|
path: '/dzjk/clpz',
|
||||||
component: () => import('@/views/ems/dzjk/clpz/index.vue'),
|
|
||||||
name: 'DzjkClpz',
|
|
||||||
meta: {title: '策略配置', breadcrumb: false, activeMenu: '/dzjk'},
|
|
||||||
redirect: '/dzjk/clpz/clyx',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'clyx',
|
|
||||||
component: () => import('@/views/ems/dzjk/clpz/clyx/index.vue'),
|
component: () => import('@/views/ems/dzjk/clpz/clyx/index.vue'),
|
||||||
name: 'DzjkClpzClyx',
|
name: 'DzjkClpz',
|
||||||
meta: {
|
meta: {title: '策略配置', breadcrumb: false, activeMenu: '/dzjk/clpz'},
|
||||||
title: '策略运行',
|
|
||||||
breadcrumb: false,
|
|
||||||
activeMenu: '/dzjk',
|
|
||||||
activeSecondMenuName: 'DzjkClpz'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// path: 'xftg',
|
|
||||||
// component: () => import('@/views/ems/dzjk/clpz/xftg/index.vue'),
|
|
||||||
// hidden:true,
|
|
||||||
// breadcrumb: false,
|
|
||||||
// name: 'DzjkClpzXftg',
|
|
||||||
// meta: { title: '削峰填谷',breadcrumb: false,activeMenu: '/dzjk',activeSecondMenuName:'DzjkClpz'},
|
|
||||||
// }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Router from 'vue-router'
|
import Router from 'vue-router'
|
||||||
|
// todo delete
|
||||||
|
import ems from './ems'//EMS管理系统routers引用
|
||||||
import {dzjk} from '@/router/ems'
|
import {dzjk} from '@/router/ems'
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
@ -90,6 +92,7 @@ export const constantRoutes = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
// EMS管理系统routers
|
// EMS管理系统routers
|
||||||
|
// ...ems
|
||||||
...dzjk
|
...dzjk
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -7,12 +7,12 @@ module.exports = {
|
|||||||
/**
|
/**
|
||||||
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
|
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
|
||||||
*/
|
*/
|
||||||
sideTheme: 'theme-light',
|
sideTheme: 'theme-dark',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统布局配置
|
* 系统布局配置
|
||||||
*/
|
*/
|
||||||
showSettings: false,
|
showSettings: true,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否显示顶部导航
|
* 是否显示顶部导航
|
||||||
@ -52,5 +52,5 @@ module.exports = {
|
|||||||
/**
|
/**
|
||||||
* 底部版权文本内容
|
* 底部版权文本内容
|
||||||
*/
|
*/
|
||||||
footerContent: 'Copyright © 2025 上动新能源 版权所有'
|
footerContent: 'Copyright © 2018-2025 xzzn. All Rights Reserved.'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,22 +1,9 @@
|
|||||||
import {getAlarmDetailList, getSiteAllDeviceCategory} from '@/api/ems/dzjk'
|
import {getAllSites} from '@/api/ems/zddt'
|
||||||
|
|
||||||
const ems = {
|
const ems = {
|
||||||
state: {
|
state: {
|
||||||
dzjkAlarmLighting: false,//单站监控 告警统计红点标志
|
|
||||||
zdList:[],
|
zdList:[],
|
||||||
zdDeviceCategoryOptions: {},//站点各个站点包含的设备种类 {021_DDS_01:["BATTERY","CLUSTER","STACK", "DH", "AMMETER", "PCS", "XF"],021_DDS_02:[]...}
|
workStatusOptions:{'0':'正常','1':'异常','2':'停止'},//工作状态
|
||||||
CLUSTERWorkStatusOptions: {'0': '静置', '1': '充电', '2': '放电', '3': '待机', '5': '运行', '9': "故障"},//电池簇工作状态
|
deviceStatusOptions:{'0':'在线','1':'离线','2':'维修中'},//设备状态
|
||||||
PCSWorkStatusOptions: {'0': '运行', '1': '停机', '2': '故障', '3': '待机', '4': '充电', '5': '放电'},//PCS工作状态
|
|
||||||
STACKWorkStatusOptions: {
|
|
||||||
"0": "静置",
|
|
||||||
"1": "充电",
|
|
||||||
"2": "放电",
|
|
||||||
"3": "浮充",
|
|
||||||
'4': '待机',
|
|
||||||
'5': '运行',
|
|
||||||
'9': "故障"
|
|
||||||
},//STACKBMS总览工作状态
|
|
||||||
deviceStatusOptions: {'0': '离线', '1': '在线'},//设备状态
|
|
||||||
gridStatusOptions:{'0':'并网','1':'未并网'},//并网状态
|
gridStatusOptions:{'0':'并网','1':'未并网'},//并网状态
|
||||||
controlModeOptions:{'0':'远程','1':'本地'},//控制模式
|
controlModeOptions:{'0':'远程','1':'本地'},//控制模式
|
||||||
warnOptions:{0:'正常', 1:'中断', 2:'不在线',3:'异常'},//告警状态
|
warnOptions:{0:'正常', 1:'中断', 2:'不在线',3:'异常'},//告警状态
|
||||||
@ -25,48 +12,26 @@ const ems = {
|
|||||||
alarmLevelOptions:{'A':'提示','B':'一般','C':'严重','D':'紧急'},//告警等级
|
alarmLevelOptions:{'A':'提示','B':'一般','C':'严重','D':'紧急'},//告警等级
|
||||||
alarmStatusOptions:{'0':'待处理','1':'已处理','2':'处理中'},//告警状态
|
alarmStatusOptions:{'0':'待处理','1':'已处理','2':'处理中'},//告警状态
|
||||||
deviceTypeOptions:{'TCP':'TCP','RTU':'RTU'},//设备类型
|
deviceTypeOptions:{'TCP':'TCP','RTU':'RTU'},//设备类型
|
||||||
ticketStatusOptions: {1: '待处理', 2: '处理中', 3: '已处理'},//工单处理状态
|
ticketStatusOptions:{0:'待处理', 1:'已处理', 2:'处理中'},//工单处理状态
|
||||||
strategyStatusOptions:{'0':'未启用', '1':'已运行', '2':'已暂停', '3':'禁用', '4':'删除'},//策略状态
|
strategyStatusOptions:{'0':'未启用', '1':'已运行', '2':'已暂停', '3':'禁用', '4':'删除'},//策略状态
|
||||||
chargeStatusOptions: {'1': '充电', '2': '待机', '3': '放电'},//冲放状态
|
chargeStatusOptions:{'1':'充电','2':'待机'},//冲放状态
|
||||||
comparisonOperatorOptions: {'>': '>', '<': '<', '=': '=', '>=': '>=', '<=': '<='},
|
|
||||||
relationWithPoint: {'||': '||', '&&': '&&'}
|
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
SET_ZD_LIST(state, list) {
|
SET_ZD_LIST(state, list) {
|
||||||
state.zdList = 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: {
|
actions: {
|
||||||
//查询站点的所有待处理0的告警 存在展示红点标志
|
getZdList({commit,state}){
|
||||||
getSiteAlarmNum({state, commit}, siteId) {
|
if(state.zdList.length === 0){
|
||||||
getAlarmDetailList({
|
getAllSites().then(response => {
|
||||||
status: 0,
|
commit('SET_ZD_LIST', response?.data || [])
|
||||||
siteId,
|
console.log('store action getZdList 获取站点数据',state.zdList)
|
||||||
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
|
export default ems
|
||||||
|
|||||||
@ -34,12 +34,6 @@ const permission = {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// 向后端请求路由数据
|
// 向后端请求路由数据
|
||||||
getRouters().then(res => {
|
getRouters().then(res => {
|
||||||
let hasDzjk = false
|
|
||||||
if(res?.data){
|
|
||||||
res.data.forEach(i=>{
|
|
||||||
i.children && i.children.find(j=>j.path.indexOf('dzjk')>-1) && (hasDzjk=true)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const sdata = JSON.parse(JSON.stringify(res.data))
|
const sdata = JSON.parse(JSON.stringify(res.data))
|
||||||
const rdata = JSON.parse(JSON.stringify(res.data))
|
const rdata = JSON.parse(JSON.stringify(res.data))
|
||||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||||
@ -47,10 +41,6 @@ const permission = {
|
|||||||
const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
|
const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
|
||||||
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
|
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
|
||||||
router.addRoutes(asyncRoutes)
|
router.addRoutes(asyncRoutes)
|
||||||
if(!hasDzjk){
|
|
||||||
const index = constantRoutes.findIndex(i=>i.path.indexOf('dzjk')>-1)
|
|
||||||
constantRoutes.splice(index,1)
|
|
||||||
}
|
|
||||||
commit('SET_ROUTES', rewriteRoutes)
|
commit('SET_ROUTES', rewriteRoutes)
|
||||||
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
|
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
|
||||||
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
|
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
|
||||||
@ -121,7 +111,7 @@ export function filterDynamicRoutes(routes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const loadView = (view) => {
|
export const loadView = (view) => {
|
||||||
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'staging') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
return (resolve) => require([`@/views/${view}`], resolve)
|
return (resolve) => require([`@/views/${view}`], resolve)
|
||||||
} else {
|
} else {
|
||||||
// 使用 import 实现生产环境的路由懒加载
|
// 使用 import 实现生产环境的路由懒加载
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading" class="ems-dashboard-editor-container ems-content-container-padding">
|
||||||
<template v-if="!showTemp">
|
<template v-if="!showTemp">
|
||||||
<el-button v-if="!showTemp" type="primary" plain @click="settingStrategy" style="margin-bottom: 20px;">新增策略</el-button>
|
<el-button v-if="!showTemp" type="primary" plain @click="settingStrategy" style="margin-bottom: 20px;">新增策略</el-button>
|
||||||
<cl-container v-for="(item,index) in list" :key="index+'clContainer'" :info="item" :hide-setting-btn="showTemp" class="contain" @update="init" @showSetting="settingStrategy(item)">
|
<cl-container v-for="(item,index) in list" :key="index+'clContainer'" :info="item" :hide-setting-btn="showTemp" class="contain" @update="init" @showSetting="settingStrategy(item)">
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ems-dashboard-editor-container ems-third-menu-container">
|
|
||||||
<el-menu
|
|
||||||
class="ems-third-menu"
|
|
||||||
:default-active="$route.name"
|
|
||||||
background-color="#ffffff"
|
|
||||||
text-color="#666666"
|
|
||||||
active-text-color="#ffffff"
|
|
||||||
>
|
|
||||||
<el-menu-item :index="item.name" v-for="(item,index) in childrenRoute" :key="index+'clpzChildrenRoute'">
|
|
||||||
<router-link style="height: 100%;width: 100%;display: block;" :to="{path:item.path,query:$route.query}">
|
|
||||||
{{item.meta.title}}
|
|
||||||
</router-link>
|
|
||||||
</el-menu-item>
|
|
||||||
</el-menu>
|
|
||||||
|
|
||||||
<div class="ems-content-container ems-content-container-padding clpz-ems-content-container">
|
|
||||||
<keep-alive>
|
|
||||||
<router-view></router-view>
|
|
||||||
</keep-alive>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { dzjk } from '@/router/ems'
|
|
||||||
const childrenRoute = dzjk[0].children[0].children.find(item=> item.name==='DzjkClpz').children.filter(item=>!item?.hidden)//获取到统计报表下面的字路由
|
|
||||||
console.log('设备监控子路由',childrenRoute)
|
|
||||||
export default {
|
|
||||||
name:'DzjkClpz',
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
childrenRoute,
|
|
||||||
activeMenu:''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
console.log('当前统计报表页面路由',this.$route)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.clpz-ems-content-container{
|
|
||||||
margin-top:0;
|
|
||||||
padding-top:0;
|
|
||||||
padding-right: 0;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="dialogTableVisible" class="ems-dialog add-template-dialog"
|
<el-dialog :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增模板':`编辑模板` ">
|
||||||
:title="mode === 'add'?'新增模板':`编辑模板` ">
|
|
||||||
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||||
<el-form-item label="模板名称" prop="templateName">
|
<el-form-item label="模板名称" prop="templateName">
|
||||||
<el-input v-model="formData.templateName" placeholder="请输入" clearable :style="{width: '100%'}">
|
<el-input v-model="formData.templateName" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||||
@ -22,52 +21,36 @@
|
|||||||
<!-- 新增时间段表单-->
|
<!-- 新增时间段表单-->
|
||||||
<el-collapse-transition>
|
<el-collapse-transition>
|
||||||
<el-card v-show="showAddTime" shadow="always" class="common-card-container" style="margin-top:25px;">
|
<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"
|
<el-form class="add-time-form transition-box" ref="addTimeForm" :model="formInline" :rules="formInlineRule" label-width="100px" style="margin-top:25px">
|
||||||
label-width="100px" style="margin-top:25px">
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
<!-- <el-form-item label="开始时间" prop="startTime">-->
|
<el-time-select
|
||||||
<!-- <el-time-select-->
|
placeholder="开始时间"
|
||||||
<!-- placeholder="开始时间"-->
|
v-model="formInline.startTime"
|
||||||
<!-- v-model="formInline.startTime"-->
|
:picker-options="{
|
||||||
<!-- :picker-options="{-->
|
start: '00:00',
|
||||||
<!-- start: '00:00',-->
|
step: '01:00',
|
||||||
<!-- step: '00:01',-->
|
end: '23:00',
|
||||||
<!-- end: '23:00',-->
|
}">
|
||||||
<!-- }">-->
|
</el-time-select>
|
||||||
<!-- </el-time-select>-->
|
</el-form-item>
|
||||||
<!-- </el-form-item>-->
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
<!-- <el-form-item label="结束时间" prop="endTime">-->
|
<el-time-select
|
||||||
<!-- <el-time-select-->
|
placeholder="结束时间"
|
||||||
<!-- placeholder="结束时间"-->
|
v-model="formInline.endTime"
|
||||||
<!-- v-model="formInline.endTime"-->
|
:picker-options="{
|
||||||
<!-- :picker-options="{-->
|
start: '00:00',
|
||||||
<!-- start: '00:00',-->
|
step: '01:00',
|
||||||
<!-- step: '00:01',-->
|
end: '23:00',
|
||||||
<!-- end: '23:00',-->
|
minTime: formInline.startTime
|
||||||
<!-- minTime: formInline.startTime-->
|
}">
|
||||||
<!-- }">-->
|
</el-time-select>
|
||||||
<!-- </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>
|
||||||
<el-form-item label="冲放功率" prop="chargeDischargePower">
|
<el-form-item label="冲放功率" prop="chargeDischargePower">
|
||||||
<el-input v-model="formInline.chargeDischargePower" placeholder="请输入"
|
<el-input v-model="formInline.chargeDischargePower" placeholder="请输入"></el-input>
|
||||||
:style="{width: '100%'}"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="充电状态" prop="chargeStatus">
|
<el-form-item label="充电状态" prop="chargeStatus">
|
||||||
<el-select v-model="formInline.chargeStatus" placeholder="请选择" :style="{width: '100%'}">
|
<el-select v-model="formInline.chargeStatus" placeholder="请选择">
|
||||||
<el-option v-for="(value,key) in chargeStatusOptions" :key="key+'chargeStatusOptions'" :label="value"
|
<el-option v-for="(value,key) in chargeStatusOptions" :key="key+'chargeStatusOptions'" :label="value" :value="key"></el-option>
|
||||||
:value="key"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -81,6 +64,7 @@
|
|||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
border
|
||||||
style="width: 100%;margin-top:25px">
|
style="width: 100%;margin-top:25px">
|
||||||
|
<!-- todo 如果要在span-method中使用column.property 在表格中必须定义prop="xxx"属性-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="startTime"
|
prop="startTime"
|
||||||
label="开始时间">
|
label="开始时间">
|
||||||
@ -123,18 +107,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import {addStrategyTemp,editStrategyTemp,getStrategyTempDetail} from '@/api/ems/dzjk'
|
import {addStrategyTemp,editStrategyTemp,getStrategyTempDetail} from '@/api/ems/dzjk'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
inject:['$home'],
|
inject:['$home'],
|
||||||
data() {
|
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 {
|
return {
|
||||||
mode:'',
|
mode:'',
|
||||||
editTempId:'',
|
editTempId:'',
|
||||||
dialogTableVisible:false,
|
dialogTableVisible:false,
|
||||||
secondRange: range,
|
|
||||||
formData: {
|
formData: {
|
||||||
templateName: '',
|
templateName: '',
|
||||||
sdcLimit: false,
|
sdcLimit: false,
|
||||||
@ -158,14 +137,17 @@ export default {
|
|||||||
},
|
},
|
||||||
showAddTime: false,
|
showAddTime: false,
|
||||||
formInline:{
|
formInline:{
|
||||||
timeRange: range,
|
startTime:'',endTime:'',chargeDischargePower:'',chargeStatus:''
|
||||||
chargeDischargePower: '',
|
|
||||||
chargeStatus: ''
|
|
||||||
},
|
},
|
||||||
formInlineRule:{
|
formInlineRule:{
|
||||||
timeRange: [{
|
startTime: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择时间范围',
|
message: '请选择开始时间',
|
||||||
|
trigger: 'change'
|
||||||
|
}],
|
||||||
|
endTime: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择结束时间',
|
||||||
trigger: 'change'
|
trigger: 'change'
|
||||||
}],
|
}],
|
||||||
chargeDischargePower: [{
|
chargeDischargePower: [{
|
||||||
@ -173,7 +155,7 @@ export default {
|
|||||||
message: '请输入冲放功率',
|
message: '请输入冲放功率',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
},
|
},
|
||||||
{pattern: /^-?\d*\.?\d*$/, message: '请输入合法数字或小数'}
|
{ pattern: /^(0|[1-9]\d*)(\.\d+)?$/, message: '请输入合法数字或小数' }
|
||||||
],
|
],
|
||||||
chargeStatus:[{
|
chargeStatus:[{
|
||||||
required: true,
|
required: true,
|
||||||
@ -190,6 +172,20 @@ export default {
|
|||||||
chargeStatusOptions: state => state?.ems?.chargeStatusOptions || {},
|
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: {
|
methods: {
|
||||||
changeSiteId(){
|
changeSiteId(){
|
||||||
this.dialogTableVisible=false
|
this.dialogTableVisible=false
|
||||||
@ -202,8 +198,8 @@ export default {
|
|||||||
sdcUp: '',
|
sdcUp: '',
|
||||||
}
|
}
|
||||||
this.formInline={
|
this.formInline={
|
||||||
timeRange: this.secondRange, chargeDischargePower: '', chargeStatus: ''
|
startTime:'',endTime:'',chargeDischargePower:'',chargeStatus:''
|
||||||
}//startTime: '', endTime: '',
|
}
|
||||||
this.showAddTime = false
|
this.showAddTime = false
|
||||||
this.tableData=[]
|
this.tableData=[]
|
||||||
},
|
},
|
||||||
@ -242,18 +238,14 @@ export default {
|
|||||||
cancelAddTime(){
|
cancelAddTime(){
|
||||||
this.$refs.addTimeForm.resetFields()
|
this.$refs.addTimeForm.resetFields()
|
||||||
this.showAddTime=false
|
this.showAddTime=false
|
||||||
this.formInline = {timeRange: this.secondRange, chargeDischargePower: '', chargeStatus: ''}//startTime: '', endTime: '',
|
this.formInline = {startTime:'',endTime:'',chargeDischargePower:'',chargeStatus:''}
|
||||||
},
|
},
|
||||||
saveTime(){
|
saveTime(){
|
||||||
//表单校验,校验成功,添加到tableData里
|
//表单校验,校验成功,添加到tableData里
|
||||||
this.$refs.addTimeForm.validate(valid => {
|
this.$refs.addTimeForm.validate(valid => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
const {timeRange: [startTime, endTime], chargeDischargePower, chargeStatus} = this.formInline
|
this.tableData.push(JSON.parse(JSON.stringify(this.formInline)));
|
||||||
|
this.$nextTick(() => {this.cancelAddTime()})
|
||||||
this.tableData.push({startTime, endTime, chargeDischargePower, chargeStatus})
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.cancelAddTime()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteRow(index){
|
deleteRow(index){
|
||||||
@ -262,20 +254,33 @@ export default {
|
|||||||
saveDialog() {
|
saveDialog() {
|
||||||
this.$refs.addTempForm.validate(valid => {
|
this.$refs.addTempForm.validate(valid => {
|
||||||
if (!valid) return
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(!status){
|
||||||
|
return this.$message.error('时间选择范围冲突');
|
||||||
|
}
|
||||||
const {templateName,sdcLimit,sdcDown,sdcUp} = this.formData
|
const {templateName,sdcLimit,sdcDown,sdcUp} = this.formData
|
||||||
const {siteId,updateStrategyId} =this.$home
|
const {siteId,updateStrategyId} =this.$home
|
||||||
const {tableData} = this
|
const {tableData} = this
|
||||||
if(this.mode==='edit'){
|
if(this.mode==='edit'){
|
||||||
editStrategyTemp({
|
editStrategyTemp({siteId,strategyId:updateStrategyId,templateId:this.editTempId,templateName,sdcLimit,sdcDown,sdcUp,timeConfigList:tableData}).then(response=>{
|
||||||
siteId,
|
|
||||||
strategyId: updateStrategyId,
|
|
||||||
templateId: this.editTempId,
|
|
||||||
templateName,
|
|
||||||
sdcLimit,
|
|
||||||
sdcDown,
|
|
||||||
sdcUp,
|
|
||||||
timeConfigList: tableData
|
|
||||||
}).then(response => {
|
|
||||||
if(response?.code === 200){
|
if(response?.code === 200){
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
this.$emit('update')
|
this.$emit('update')
|
||||||
@ -283,15 +288,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
addStrategyTemp({
|
addStrategyTemp({siteId,strategyId:updateStrategyId,templateName,sdcLimit,sdcDown,sdcUp,timeConfigList:tableData}).then(response=>{
|
||||||
siteId,
|
|
||||||
strategyId: updateStrategyId,
|
|
||||||
templateName,
|
|
||||||
sdcLimit,
|
|
||||||
sdcDown,
|
|
||||||
sdcUp,
|
|
||||||
timeConfigList: tableData
|
|
||||||
}).then(response => {
|
|
||||||
if(response?.code === 200){
|
if(response?.code === 200){
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
this.$emit('update')
|
this.$emit('update')
|
||||||
@ -317,9 +314,3 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
|
||||||
.add-template-dialog {
|
|
||||||
max-height: 90vh;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -47,34 +47,11 @@ export default {
|
|||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(data) {
|
||||||
if(!this.chart) return
|
if(!this.chart) return
|
||||||
let obj = {}
|
|
||||||
for(var i=0;i<=23;i++){
|
|
||||||
obj[i] = {
|
|
||||||
title:i<=9?`0${i}:00` : `${i}:00`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const nowMonth = new Date().getMonth()+1;
|
|
||||||
const localMonth = data.find(item=>item.month === nowMonth)?.powerList || []
|
|
||||||
localMonth.forEach(item => {
|
|
||||||
const startHours = parseInt(item.startTime.split(':')[0], 10)
|
|
||||||
const endHours =parseInt(item.endTime.split(':')[0], 10)
|
|
||||||
for(let i=startHours;i<=endHours;i++){
|
|
||||||
obj[i].value = item.powerData
|
|
||||||
}
|
|
||||||
})
|
|
||||||
let source = [['时间','冲放功率']]
|
|
||||||
Object.values(obj).forEach(item => {
|
|
||||||
const {title,value} = item
|
|
||||||
source.push([title,value])
|
|
||||||
})
|
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
color:['#FFBD00','#3C81FF'],
|
color:['#FFBD00','#3C81FF'],
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
bottom: '15',
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
@ -86,7 +63,7 @@ export default {
|
|||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
data: ['01:00','02:00','03:00','05:00','06:00','07:00','08:00','09:00','10:00'],
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle:{
|
lineStyle:{
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
@ -101,12 +78,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataset: {
|
|
||||||
source
|
|
||||||
},
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name:'冲放功率',
|
name:'模板一',
|
||||||
|
data: [80,92,1,34,90,130,320,80,9,91],
|
||||||
|
type: 'line',
|
||||||
|
},{
|
||||||
|
name:'模板二',
|
||||||
|
data: [820,932,901,934,1290,1330,1320,820,932,901],
|
||||||
type: 'line',
|
type: 'line',
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- <cl-container :hideSettingBtn="true">-->
|
<!-- <cl-container :hideSettingBtn="true">-->
|
||||||
<!-- <template v-slot:default>-->
|
<!-- <template v-slot:default>-->
|
||||||
<div>
|
<div class="ems-dashboard-editor-container ems-content-container-padding">
|
||||||
<temp-table ref="tempTable" @updateTimeSetting="updateTimeSetting"/>
|
<temp-table ref="tempTable" @updateTimeSetting="updateTimeSetting"/>
|
||||||
<time-setting ref="timeSetting"/>
|
<time-setting ref="timeSetting"/>
|
||||||
<temp-power-chart ref="tomePowerChart"/>
|
<temp-power-chart ref="tomePowerChart"/>
|
||||||
@ -40,6 +40,7 @@ export default {
|
|||||||
this.$refs.tomePowerChart.changeSiteId()
|
this.$refs.tomePowerChart.changeSiteId()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//在编辑、删除模板后更新时间配置、echart的数据?todo
|
||||||
updateTimeSetting(){
|
updateTimeSetting(){
|
||||||
this.$refs.timeSetting.init()
|
this.$refs.timeSetting.init()
|
||||||
this.$refs.tomePowerChart.init()
|
this.$refs.tomePowerChart.init()
|
||||||
|
|||||||
@ -1,19 +1,16 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card v-loading="loading" gshadow="always" class="common-card-container common-card-container-no-title-bg">
|
<div v-loading="loading" class="ems-dashboard-editor-container ems-content-container-padding">
|
||||||
<!-- 搜索栏-->
|
<!-- 搜索栏-->
|
||||||
<el-form :inline="true" class="select-container">
|
<el-form :inline="true" class="select-container">
|
||||||
<el-form-item label="设备清单">
|
<el-form-item label="设备类型">
|
||||||
<el-select v-model="search.deviceId" clearable placeholder="请选择" :loading="loading"
|
<el-select v-model="search.deviceType" clearable placeholder="请选择" :loading="loading" loading-text="正在加载数据">
|
||||||
loading-text="正在加载数据">
|
<el-option :label="value" :value="key" v-for="(value,key) in $store.state.ems.deviceTypeOptions" :key="key+'deviceTypeOptions'"></el-option>
|
||||||
<el-option :label="item.deviceName" :value="item.deviceId" v-for="(item,key) in deviceOptions"
|
|
||||||
:key="key+'deviceIdOptions'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="告警等级">
|
<el-form-item label="告警等级">
|
||||||
<el-select v-model="search.alarmLevel" clearable placeholder="请选择" :loading="loading"
|
<el-select v-model="search.alarmLevel" clearable placeholder="请选择" :loading="loading" loading-text="正在加载数据">
|
||||||
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-option :label="value" :value="key" v-for="(value,key) in $store.state.ems.alarmLevelOptions"
|
|
||||||
:key="key+'alarmLevelOptions'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="时间选择">
|
<el-form-item label="时间选择">
|
||||||
@ -39,9 +36,7 @@
|
|||||||
<el-row style="">
|
<el-row style="">
|
||||||
<el-col :xs="24" :sm="24" :lg="24">
|
<el-col :xs="24" :sm="24" :lg="24">
|
||||||
<el-button-group class="ems-btns-group">
|
<el-button-group class="ems-btns-group">
|
||||||
<el-button v-for="(item,index) in btnList" :key="index+'dtdcBtns'"
|
<el-button v-for="(item,index) in btnList" :key="index+'dtdcBtns'" :class="{'activeBtn' : activeBtn === item.id}" @click="changeDataType(item.id)">{{item.name}}</el-button>
|
||||||
:class="{'activeBtn' : activeBtn === item.id}" @click="changeDataType(item.id)">{{ item.name }}
|
|
||||||
</el-button>
|
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -85,10 +80,7 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
label="状态">
|
label="状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span
|
<span :class="['0','2'].includes(scope.row.status) ? 'warning-status' : ''">{{$store.state.ems.alarmStatusOptions[scope.row.status]}}</span>
|
||||||
:class="['0','2'].includes(scope.row.status) ? 'warning-status' : ''">{{
|
|
||||||
$store.state.ems.alarmStatusOptions[scope.row.status]
|
|
||||||
}}</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@ -97,10 +89,8 @@
|
|||||||
width="250"
|
width="250"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" size="mini" v-if="scope.row.ticketNo" @click="toTicket">
|
<el-button type="text" size="mini" v-if="scope.row.ticketNo" @click="toTicket">已生成工单(工单号:{{scope.row.ticketNo}})</el-button>
|
||||||
已生成工单(工单号:{{ scope.row.ticketNo }})
|
<el-button type="primary" size="mini" v-else @click="toTicket">生成工单</el-button>
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" size="mini" v-else @click="createTicket(scope.row.id)">生成工单</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -118,16 +108,14 @@
|
|||||||
>
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {createTicketNo, getAlarmDetailList} from '@/api/ems/dzjk'
|
import {getAlarmDetailList} from'@/api/ems/dzjk'
|
||||||
import {getDeviceList} from '@/api/ems/site'
|
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import { formatDate } from '@/filters/ems'
|
import { formatDate } from '@/filters/ems'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name:'DzjkGzgj',
|
name:'DzjkGzgj',
|
||||||
mixins:[getQuerySiteId],
|
mixins:[getQuerySiteId],
|
||||||
@ -135,10 +123,9 @@ export default {
|
|||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
btnList:[
|
btnList:[
|
||||||
{name: '未处理告警', id: 'today'},
|
{name:'今日告警',id:'today'},
|
||||||
{name:'历史告警',id:'history'},
|
{name:'历史告警',id:'history'},
|
||||||
],
|
],
|
||||||
deviceOptions: [],//设备列表
|
|
||||||
pickerOptions:{
|
pickerOptions:{
|
||||||
disabledDate(time) {
|
disabledDate(time) {
|
||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
@ -147,7 +134,7 @@ export default {
|
|||||||
defaultDateRange:[],//默认展示的时间
|
defaultDateRange:[],//默认展示的时间
|
||||||
dateRange:[],//alarmStartTime,alarmEndTime
|
dateRange:[],//alarmStartTime,alarmEndTime
|
||||||
activeBtn:'today',
|
activeBtn:'today',
|
||||||
search: {deviceId: '', alarmLevel: ''},
|
search:{deviceType:'',alarmLevel:''},
|
||||||
// 表格、分页
|
// 表格、分页
|
||||||
tableData:[],
|
tableData:[],
|
||||||
pageSize:10,//分页栏当前每个数据总数
|
pageSize:10,//分页栏当前每个数据总数
|
||||||
@ -160,15 +147,6 @@ export default {
|
|||||||
toTicket(){
|
toTicket(){
|
||||||
this.$router.push({path:'/ticket'})
|
this.$router.push({path:'/ticket'})
|
||||||
},
|
},
|
||||||
//生成工单
|
|
||||||
createTicket(id) {
|
|
||||||
this.loading = true
|
|
||||||
createTicketNo({id}).then(response => {
|
|
||||||
response?.data && this.toTicket()
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 判断是否是同一天
|
// 判断是否是同一天
|
||||||
isSameDay(day1, day2) {
|
isSameDay(day1, day2) {
|
||||||
const date1 = new Date(day1),date2 = new Date(day2)
|
const date1 = new Date(day1),date2 = new Date(day2)
|
||||||
@ -192,11 +170,23 @@ export default {
|
|||||||
// 搜索
|
// 搜索
|
||||||
onSearch(){
|
onSearch(){
|
||||||
this.pageNum =1//每次搜索从1开始搜索
|
this.pageNum =1//每次搜索从1开始搜索
|
||||||
|
const [alarmStartTime='',alarmEndTime='']=(this.dateRange || [])
|
||||||
|
// 选中了时间范围
|
||||||
|
if(alarmStartTime && alarmStartTime){
|
||||||
|
// 如果选择的时间范围是今天
|
||||||
|
if(this.isSameDay(alarmStartTime,alarmEndTime) && this.isSameDay(alarmStartTime,new Date())){
|
||||||
|
this.activeBtn = 'today'
|
||||||
|
}else {
|
||||||
|
this.activeBtn = 'history'
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//没有选择时间范围 还是按照选中的今日告警、历史告警查询
|
||||||
|
}
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
// 重置
|
// 重置
|
||||||
onReset(){
|
onReset(){
|
||||||
this.search = {deviceId: '', alarmLevel: ''}
|
this.search={deviceType:'',alarmLevel:''}
|
||||||
this.dateRange=[]
|
this.dateRange=[]
|
||||||
this.pageNum =1//每次搜索从1开始搜索
|
this.pageNum =1//每次搜索从1开始搜索
|
||||||
this.getData()
|
this.getData()
|
||||||
@ -206,40 +196,46 @@ export default {
|
|||||||
if(id !== this.activeBtn){
|
if(id !== this.activeBtn){
|
||||||
console.log('点击了不同的菜单,更新数据')
|
console.log('点击了不同的菜单,更新数据')
|
||||||
this.activeBtn=id;
|
this.activeBtn=id;
|
||||||
|
const [alarmStartTime,alarmEndTime]=(this.dateRange || [])
|
||||||
|
// 切换到今日告警,如果已经选择了时间范围清空
|
||||||
|
if(alarmStartTime && alarmEndTime){
|
||||||
|
// 如果切换到了今日告警,时间范围不相等或者相等但是不是今天 清空时间选择范围
|
||||||
|
if(id === 'today' && !this.isSameDay(alarmStartTime,alarmEndTime) || (this.isSameDay(alarmStartTime,alarmEndTime) && !this.isSameDay(alarmStartTime,new Date()))){
|
||||||
|
this.dateRange = []
|
||||||
|
}else if(id === 'history' && this.isSameDay(alarmStartTime,alarmEndTime) && this.isSameDay(alarmStartTime,new Date())){
|
||||||
|
// 切换成历史告警,但是选择时间范围是当天,清空时间范围
|
||||||
|
this.dateRange = []
|
||||||
|
}
|
||||||
|
}
|
||||||
this.getData()
|
this.getData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取数据
|
// 获取数据
|
||||||
getData(){
|
getData(){
|
||||||
this.$store.dispatch('getSiteAlarmNum', this.siteId)
|
|
||||||
this.loading=true
|
this.loading=true
|
||||||
const {deviceId, alarmLevel} = this.search
|
const {deviceType,alarmLevel} = this.search
|
||||||
const {siteId,pageNum,pageSize,activeBtn} =this
|
const {siteId,pageNum,pageSize,activeBtn} =this
|
||||||
const [alarmStartTime='',alarmEndTime='']=(this.dateRange || [])
|
const [alarmStartTime='',alarmEndTime='']=(this.dateRange || [])
|
||||||
let status = activeBtn === 'today' ? '0' : '1,2'
|
let start='',end = '',now =new Date()
|
||||||
getAlarmDetailList({
|
if(activeBtn === 'today'){
|
||||||
status,
|
start = end = now
|
||||||
deviceId,
|
}else{
|
||||||
alarmLevel,
|
if(alarmStartTime && alarmEndTime){
|
||||||
siteId,
|
start = alarmStartTime
|
||||||
pageSize,
|
end = alarmEndTime
|
||||||
pageNum,
|
}else{
|
||||||
alarmStartTime: formatDate(alarmStartTime),
|
start=''
|
||||||
alarmEndTime: formatDate(alarmEndTime)
|
end = ''
|
||||||
}).then(response => {
|
// now
|
||||||
|
// end.setDate(end.getDate() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getAlarmDetailList({deviceType,alarmLevel,siteId,pageSize,pageNum,alarmStartTime:formatDate(start),alarmEndTime:formatDate(end)}).then(response => {
|
||||||
this.tableData=response?.rows || [];
|
this.tableData=response?.rows || [];
|
||||||
this.totalSize = response?.total || 0
|
this.totalSize = response?.total || 0
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading=false})
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getDeviceOptions() {
|
|
||||||
getDeviceList(this.siteId).then(response => {
|
|
||||||
this.deviceOptions = JSON.parse(JSON.stringify(response?.data || []))
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
this.getDeviceOptions()
|
|
||||||
this.onReset()
|
this.onReset()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,127 +0,0 @@
|
|||||||
<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" :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 intervalUpdate from "@/mixins/ems/intervalUpdate";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [resize, intervalUpdate],
|
|
||||||
components: {DateRangeSelect},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
chart: null,
|
|
||||||
timeRange: [],
|
|
||||||
siteId: '',
|
|
||||||
isInit: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.initChart()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
if (!this.chart) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.chart.dispose()
|
|
||||||
this.chart = null
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 更新时间范围 重置图表
|
|
||||||
updateDate(data) {
|
|
||||||
this.timeRange = data
|
|
||||||
!this.isInit && this.getGVQXData()
|
|
||||||
this.isInit = false
|
|
||||||
},
|
|
||||||
getGVQXData() {
|
|
||||||
this.showLoading()
|
|
||||||
const {siteId, timeRange} = this
|
|
||||||
getPointData({siteId, startDate: timeRange[0], endDate: timeRange[1]}).then(response => {
|
|
||||||
this.setOption(response?.data || [])
|
|
||||||
}).finally(() => this.hideLoading())
|
|
||||||
},
|
|
||||||
init(siteId) {
|
|
||||||
//初始化 清空数据
|
|
||||||
this.siteId = siteId
|
|
||||||
this.isInit = true
|
|
||||||
this.timeRange = []
|
|
||||||
this.$refs.dateRangeSelect.init(true)
|
|
||||||
this.getGVQXData()
|
|
||||||
this.updateInterval(this.getGVQXData)
|
|
||||||
},
|
|
||||||
initChart() {
|
|
||||||
this.chart = echarts.init(document.querySelector('#activeChart'))
|
|
||||||
},
|
|
||||||
showLoading() {
|
|
||||||
this.chart && this.chart.showLoading()
|
|
||||||
},
|
|
||||||
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])
|
|
||||||
})
|
|
||||||
this.chart.setOption({
|
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
left: 'center',
|
|
||||||
bottom: '15',
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
||||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
textStyle: {
|
|
||||||
color: "#333333",
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
},
|
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
dataset: {source},
|
|
||||||
series: source[0].slice(1).map((item, index) => {
|
|
||||||
return {
|
|
||||||
type: 'line',//index === 5 ? 'bar' : 'line',
|
|
||||||
showSymbol: false,
|
|
||||||
symbolSize: 2,
|
|
||||||
smooth: true,
|
|
||||||
areaStyle: {
|
|
||||||
opacity: 0.5,
|
|
||||||
},
|
|
||||||
yAxisIndex: index <= 4 ? 0 : 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- <el-card shadow="always" class="common-card-container common-card-container-body-no-padding">
|
|
||||||
<div slot="header">
|
|
||||||
<span class="card-title">当前报警</span>
|
|
||||||
</div>
|
|
||||||
<div class="ssgj-container">
|
|
||||||
<el-table
|
|
||||||
class="common-table"
|
|
||||||
:data="tableData"
|
|
||||||
height="100%"
|
|
||||||
stripe
|
|
||||||
style="width: 100%">
|
|
||||||
<el-table-column
|
|
||||||
prop="deviceName"
|
|
||||||
label="名称">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="状态"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span :class="{'circle warning-status' : scope.row.status !== 0}">{{ $store.state.ems.warnOptions[scope.row.status]}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
class-name="alarm-content"
|
|
||||||
prop="alarmContent"
|
|
||||||
show-overflow-tooltip
|
|
||||||
label="告警内容">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="工单"
|
|
||||||
fixed="right"
|
|
||||||
show-overflow-tooltip
|
|
||||||
>
|
|
||||||
<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="toTicket">生成工单</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</el-card> -->
|
|
||||||
<el-alert type="error" :closable="false">
|
|
||||||
<template>
|
|
||||||
<div style="cursor: pointer" @click="toAlarm">设备告警</div>
|
|
||||||
</template>
|
|
||||||
</el-alert>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
tableData: {
|
|
||||||
require: true,
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toAlarm() {
|
|
||||||
this.$router.push({ path: "/dzjk/gzgj", query: this.$route.query });
|
|
||||||
},
|
|
||||||
toTicket() {
|
|
||||||
this.$router.push({ path: "/ticket" });
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
//实时告警
|
|
||||||
.ssgj-container {
|
|
||||||
padding: 20px;
|
|
||||||
height: 250px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
::v-deep {
|
|
||||||
.el-table .el-table__header-wrapper th,
|
|
||||||
.el-table .el-table__fixed-header-wrapper th {
|
|
||||||
background: #fff2cb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-card
|
|
||||||
shadow="always"
|
|
||||||
class="common-card-container common-card-container-body-no-padding"
|
|
||||||
>
|
|
||||||
<div slot="header">
|
|
||||||
<span class="card-title">策略信息</span>
|
|
||||||
</div>
|
|
||||||
<!-- <el-empty :image-size="100" ></el-empty> -->
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
box-sizing: border-box;
|
|
||||||
height: 250px;
|
|
||||||
padding: 20px 15px;
|
|
||||||
overflow-y: auto;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<el-descriptions class="home-normal-info" :column="2">
|
|
||||||
<el-descriptions-item size="mini" label="模板名称">{{
|
|
||||||
info.mainStrategyName || "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item size="mini" label="SOC限制">{{
|
|
||||||
mainInfo.sdcLimit === 1 ? "开" : mainInfo.sdcLimit === 0 ? "关" : "-"
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item size="mini" label="SOC下限(%)">{{
|
|
||||||
formatNumber(mainInfo.sdcDown)
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
<el-descriptions-item size="mini" label="SOC上限(%)">{{
|
|
||||||
formatNumber(mainInfo.sdcUp)
|
|
||||||
}}</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
<el-table
|
|
||||||
:data="info.siteMonitorDataVo || []"
|
|
||||||
border
|
|
||||||
size="mini"
|
|
||||||
style="width: 100%; margin-top: 15px"
|
|
||||||
>
|
|
||||||
<el-table-column prop="startTime" label="开始时间"> </el-table-column>
|
|
||||||
<el-table-column prop="endTime" label="结束时间"> </el-table-column>
|
|
||||||
<el-table-column prop="chargeDischargePower" label="充放功率(kW)">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="chargeStatus" label="充电状态">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ chargeStatusOptions[scope.row.chargeStatus] }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { mapState } from "vuex";
|
|
||||||
import { formatNumber } from "@/filters/ems";
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
info: {
|
|
||||||
require: true,
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
chargeStatusOptions: (state) => state?.ems?.chargeStatusOptions || {},
|
|
||||||
}),
|
|
||||||
mainInfo() {
|
|
||||||
return this.info?.siteMonitorDataVo?.length > 0
|
|
||||||
? this.info.siteMonitorDataVo[0]
|
|
||||||
: {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
formatNumber,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
148
src/views/ems/dzjk/home/NllzChart.vue
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<el-row style="background:#fff;margin-top:30px;">
|
||||||
|
<el-col :xs="24" :sm="24" :lg="24">
|
||||||
|
<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="height: 310px" id="nllzChart"></div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from 'echarts'
|
||||||
|
import resize from '@/mixins/ems/resize'
|
||||||
|
import {formatNumber} from "@/filters/ems";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [resize],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
chart: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.initChart()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
if (!this.chart) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.chart.dispose()
|
||||||
|
this.chart = null
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initChart() {
|
||||||
|
this.chart = echarts.init(document.querySelector('#nllzChart'))
|
||||||
|
},
|
||||||
|
setOption(data) {
|
||||||
|
const {siteMonitorDataVo=[],gridNrtPower,loadNrtPower,energyStorageNrtPower,energyStorageAvailElec} = data
|
||||||
|
const source = [['日期','充电量','放电量']]
|
||||||
|
siteMonitorDataVo.forEach(item=>{
|
||||||
|
source.push([item.ammeterDate, item.chargedCap,item.disChargedCap])
|
||||||
|
})
|
||||||
|
this.chart.setOption({
|
||||||
|
title: [
|
||||||
|
// 右上角
|
||||||
|
{
|
||||||
|
text: `电网 实时功率:${formatNumber(gridNrtPower)} kW`,
|
||||||
|
top: 10,
|
||||||
|
right: 10,
|
||||||
|
textStyle:{
|
||||||
|
fontSize:12,
|
||||||
|
color:'#666666'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 右下角
|
||||||
|
{
|
||||||
|
text: `负载 实时功率:${formatNumber(loadNrtPower)} kW`,
|
||||||
|
bottom: 10,
|
||||||
|
right: 10,
|
||||||
|
textStyle:{
|
||||||
|
fontSize:12,
|
||||||
|
color:'#666666'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 左下角第一行
|
||||||
|
{
|
||||||
|
text: '储能',
|
||||||
|
bottom: 40,
|
||||||
|
left: 10,
|
||||||
|
textStyle:{
|
||||||
|
fontSize:12,
|
||||||
|
color:'#666666'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 左下角第二行
|
||||||
|
{
|
||||||
|
text: `实时功率:${formatNumber(energyStorageNrtPower)} kW`,
|
||||||
|
bottom: 26,
|
||||||
|
left: 10,
|
||||||
|
textStyle:{
|
||||||
|
fontSize:12,
|
||||||
|
color:'#666666'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 左下角第三行
|
||||||
|
{
|
||||||
|
text: `可用电量:${formatNumber(energyStorageAvailElec)} kWh`,
|
||||||
|
bottom: 10,
|
||||||
|
left: 10,
|
||||||
|
textStyle:{
|
||||||
|
fontSize:12,
|
||||||
|
color:'#666666'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
grid:{
|
||||||
|
left:200
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
textStyle:{
|
||||||
|
color:"#333333",
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
axisLine: {
|
||||||
|
lineStyle:{
|
||||||
|
color: '#333333',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLine: {
|
||||||
|
lineStyle:{
|
||||||
|
color: '#333333',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataset:{
|
||||||
|
source
|
||||||
|
// source: [['日期','充电量','放电量']]
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name:'充电量',
|
||||||
|
type: 'line',
|
||||||
|
},{
|
||||||
|
name:'放电量',
|
||||||
|
type: 'line',
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
@ -1,120 +0,0 @@
|
|||||||
<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" :showIcon="true" :mini-time-picker="true" @updateDate="updateDate"/>
|
|
||||||
</div>
|
|
||||||
<div style="height: 310px" id="weekChart"></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 {getSevenChargeData} from '@/api/ems/dzjk'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [resize],
|
|
||||||
components: {DateRangeSelect},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
chart: null,
|
|
||||||
timeRange: [],
|
|
||||||
siteId: '',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.initChart()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
if (!this.chart) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.chart.dispose()
|
|
||||||
this.chart = null
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 更新时间范围 重置图表
|
|
||||||
updateDate(data) {
|
|
||||||
this.timeRange = data
|
|
||||||
this.getWeekKData()
|
|
||||||
},
|
|
||||||
getWeekKData() {
|
|
||||||
this.showLoading()
|
|
||||||
const {siteId, timeRange} = this
|
|
||||||
getSevenChargeData({siteId, startDate: timeRange[0], endDate: timeRange[1]}).then(response => {
|
|
||||||
this.setOption(response?.data || [])
|
|
||||||
}).finally(() => this.hideLoading())
|
|
||||||
},
|
|
||||||
init(siteId) {
|
|
||||||
//初始化 清空数据
|
|
||||||
this.siteId = siteId
|
|
||||||
this.timeRange = []
|
|
||||||
this.deviceId = ''
|
|
||||||
this.$refs.dateRangeSelect.init()
|
|
||||||
},
|
|
||||||
initChart() {
|
|
||||||
this.chart = echarts.init(document.querySelector('#weekChart'))
|
|
||||||
},
|
|
||||||
showLoading() {
|
|
||||||
this.chart && this.chart.showLoading()
|
|
||||||
},
|
|
||||||
hideLoading() {
|
|
||||||
this.chart && this.chart.hideLoading()
|
|
||||||
},
|
|
||||||
setOption(data, unit) {
|
|
||||||
const source = [['日期', '充电量', '放电量']]
|
|
||||||
data.forEach(item => {
|
|
||||||
source.push([item.ammeterDate, item.chargedCap, item.disChargedCap])
|
|
||||||
})
|
|
||||||
this.chart && this.chart.setOption({
|
|
||||||
color: ['#4472c4', '#70ad47'],//所有充放电颜色保持统一
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
||||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
left: 'center',
|
|
||||||
bottom: '15',
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
name: unit,
|
|
||||||
nameLocation: 'center'
|
|
||||||
},
|
|
||||||
yAxis: [{
|
|
||||||
type: 'value',
|
|
||||||
name: '充电量/放电量kWh',
|
|
||||||
axisLine: {
|
|
||||||
lineStyle: {
|
|
||||||
color: '#333333',
|
|
||||||
},
|
|
||||||
onZero: false
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
dataset: {
|
|
||||||
source
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
yAxisIndex: 0,
|
|
||||||
type: 'bar',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
yAxisIndex: 0,
|
|
||||||
type: 'bar',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,339 +1,148 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading" class="ems-dashboard-editor-container">
|
||||||
<el-row style="background: #fff" class="row-container" :gutter="15">
|
<el-row :gutter="32" style="background:#fff;">
|
||||||
<el-col :xs="24" :sm="24" :lg="5">
|
<el-col :xs="24" :sm="24" :lg="10">
|
||||||
<!-- 站点信息-->
|
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding">
|
||||||
<el-card
|
|
||||||
shadow="always"
|
|
||||||
class="common-card-container common-card-container-body-no-padding"
|
|
||||||
>
|
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span class="card-title">站点信息</span>
|
<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>
|
<div style="height: 310px" >
|
||||||
<div
|
<el-row :gutter="20">
|
||||||
style="box-sizing: border-box; height: 218px; padding: 20px 15px"
|
<el-col :span="12" v-for="(item,index) in sjglData" :key="index+'sjglData'" class="sjgl-data">
|
||||||
>
|
|
||||||
<!-- 地址、运行时间-->
|
|
||||||
<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"
|
|
||||||
class="sjgl-col power-col"
|
|
||||||
>
|
|
||||||
<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="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-title">{{item.title}}</div>
|
||||||
<div class="sjgl-value" :style="{color:item.color}">
|
<div class="sjgl-value">{{item.value | formatNumber}}</div>
|
||||||
{{ runningInfo[item.attr] | formatNumber }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="24" :lg="12">
|
<el-col :xs="24" :sm="24" :lg="14">
|
||||||
<week-chart ref="weekChart"/>
|
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding">
|
||||||
</el-col>
|
<div slot="header">
|
||||||
<el-col :xs="24" :sm="24" :lg="12">
|
<span class="card-title">实时告警</span>
|
||||||
<active-chart ref="activeChart"/>
|
<!-- <el-button style="float: right; padding: 3px 0" type="text" size="small">通讯状态:<span style="color:red">超时</span></el-button>-->
|
||||||
|
</div>
|
||||||
|
<div class="ssgj-container">
|
||||||
|
<el-table
|
||||||
|
class="common-table"
|
||||||
|
:data="tableData"
|
||||||
|
height="100%"
|
||||||
|
stripe
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
prop="deviceName"
|
||||||
|
label="名称">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="状态"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span :class="{'circle warning-status' : scope.row.status !== 0}">{{ $store.state.ems.warnOptions[scope.row.status]}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
class-name="alarm-content"
|
||||||
|
prop="alarmContent"
|
||||||
|
label="告警内容">
|
||||||
|
</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="toTicket">生成工单</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<nllz-chart ref="nllzChart"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getSingleSiteBaseInfo} from "@/api/ems/zddt";
|
import {getDzjkHomeView} from '@/api/ems/dzjk'
|
||||||
import {getDzjkHomeView} from "@/api/ems/dzjk";
|
import NllzChart from "./NllzChart.vue";
|
||||||
import WeekChart from "./WeekChart.vue";
|
import getQuerySiteId from '@/mixins/ems/getQuerySiteId'
|
||||||
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 {
|
export default {
|
||||||
name: "DzjkSbjkHome",
|
name:'DzjkSbjkHome',
|
||||||
components: {WeekChart, ActiveChart, AlarmTable, ClInfo},
|
components: {NllzChart},
|
||||||
mixins: [getQuerySiteId, intervalUpdate],
|
mixins: [getQuerySiteId],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
sjglData: [
|
sjglData:[{
|
||||||
{
|
title:'今日充电量(MWh)',
|
||||||
title: "今日充电量(kWh)",
|
value:'',
|
||||||
attr: "dayChargedCap",
|
attr:'dayChargedCap'
|
||||||
color: '#4472c4'
|
},{
|
||||||
},
|
title:'今日放电量(MWh)',
|
||||||
{
|
value:'',
|
||||||
title: "今日放电量(kWh)",
|
attr:'dayDisChargedCap'
|
||||||
attr: "dayDisChargedCap",
|
},{
|
||||||
color: '#70ad47'
|
title:'总充电量(MWh)',
|
||||||
},
|
value:'',
|
||||||
{
|
attr:'totalChargedCap'
|
||||||
title: "总充电量(kWh)",
|
},{
|
||||||
attr: "totalChargedCap",
|
title:'总放电量(MWh)',
|
||||||
color: '#4472c4'
|
value:'',
|
||||||
},
|
attr:'totalDischargedCap'
|
||||||
{
|
}],
|
||||||
title: "今日实时收入(元)",
|
// todo 表格里的不同状态可能需要显示不同颜色 确定表格内容
|
||||||
attr: "dayRevenue",
|
tableData:[]
|
||||||
color: '#f67438'
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "昨日充电量(kWh)",
|
|
||||||
attr: "yesterdayChargedCap",
|
|
||||||
color: '#4472c4'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "昨日放电量(kWh)",
|
|
||||||
attr: "yesterdayDisChargedCap",
|
|
||||||
color: '#70ad47'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "总放电量(kWh)",
|
|
||||||
attr: "totalDischargedCap",
|
|
||||||
color: '#70ad47'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "昨日实时收入(元)",
|
|
||||||
attr: "yesterdayRevenue",
|
|
||||||
color: '#f67438'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
info: {}, //基本信息
|
|
||||||
runningInfo: {}, //总累计运行数据+报警表格
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
tableData() {
|
|
||||||
return this.runningInfo?.siteMonitorHomeAlarmVo || [];
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
toAlarm() {
|
toTicket(){
|
||||||
this.$router.push({path: "/dzjk/gzgj", query: this.$route.query});
|
this.$router.push({path:'/ticket'})
|
||||||
},
|
|
||||||
getBaseInfo() {
|
|
||||||
return getSingleSiteBaseInfo(this.siteId).then((response) => {
|
|
||||||
this.info = response?.data || {};
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getRunningInfo() {
|
|
||||||
return getDzjkHomeView(this.siteId).then((response) => {
|
|
||||||
this.runningInfo = response?.data || {};
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
// 功率曲线
|
getDzjkHomeView(this.siteId).then(response => {
|
||||||
this.$refs.activeChart.init(this.siteId);
|
const data = response?.data || {}
|
||||||
// 一周冲放曲线
|
this.sjglData.forEach(item=>{
|
||||||
this.$refs.weekChart.init(this.siteId);
|
item.value =data[item.attr]
|
||||||
// 静态信息 this.getBaseInfo()
|
})
|
||||||
// 总累计运行数据+故障告警 this.getRunningInfo()
|
this.tableData = data?.siteMonitorHomeAlarmVo || []
|
||||||
Promise.all([this.getBaseInfo(), this.getRunningInfo()]).finally(() => {
|
this.$refs.nllzChart.setOption(data)
|
||||||
this.loading = false;
|
}).finally(() => {this.loading = false})
|
||||||
});
|
}
|
||||||
// 一分钟循环一次总累计运行数据
|
|
||||||
this.updateInterval(this.getRunningInfo);
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//数据概览
|
//数据概览
|
||||||
.sjgl-col {
|
.sjgl-data{
|
||||||
.sjgl-wrapper {
|
text-align: center;
|
||||||
text-align: left;
|
margin-top:20px;
|
||||||
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: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sjgl-title{
|
.sjgl-title{
|
||||||
color: #717171;
|
color: #666666;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
font-weight: bold;
|
padding-top: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sjgl-value{
|
.sjgl-value{
|
||||||
color: rgba(51,51,51,1);
|
color: rgba(51,51,51,1);
|
||||||
font-size: 22px;
|
font-size: 26px;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
font-weight: bolder;
|
font-weight: 500;
|
||||||
font-style: italic;
|
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
//实时告警
|
||||||
|
.ssgj-container{
|
||||||
<style lang="scss">
|
padding:20px;
|
||||||
.home-normal-info {
|
height: 310px;
|
||||||
font-size: 12px;
|
box-sizing: border-box;
|
||||||
|
::v-deep{
|
||||||
.el-descriptions-item__container {
|
.el-table .el-table__header-wrapper th, .el-table .el-table__fixed-header-wrapper th{
|
||||||
.el-descriptions-item__label {
|
background:#FFF2CB ;
|
||||||
color: #666666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-descriptions-item__content {
|
|
||||||
color: #333333;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
active-text-color="#ffffff"
|
active-text-color="#ffffff"
|
||||||
mode="horizontal"
|
mode="horizontal"
|
||||||
>
|
>
|
||||||
<el-menu-item :index="item.name" v-for="(item,index) in childrenRoute" :key="index+'dzjkChildrenRoute'" :class="{'lighting':item.path.indexOf('gzgj')>-1 && dzjkAlarmLighting}">
|
<el-menu-item :index="item.name" v-for="(item,index) in childrenRoute" :key="index+'dzjkChildrenRoute'">
|
||||||
<router-link style="height: 100%;width: 100%;display: block;padding:0 20px;" :to="{path:item.path,query:$route.query}">
|
<router-link style="height: 100%;width: 100%;display: block;padding:0 20px;" :to="{path:item.path,query:$route.query}">
|
||||||
{{item.meta.title}}
|
{{item.meta.title}}
|
||||||
</router-link>
|
</router-link>
|
||||||
@ -30,7 +30,6 @@ import { dzjk } from '@/router/ems'
|
|||||||
const childrenRoute = dzjk[0].children[0].children//获取到单站监控下面的字路由
|
const childrenRoute = dzjk[0].children[0].children//获取到单站监控下面的字路由
|
||||||
console.log('childrenRoute',childrenRoute)
|
console.log('childrenRoute',childrenRoute)
|
||||||
import ZdSelect from '@/components/Ems/ZdSelect/index.vue'
|
import ZdSelect from '@/components/Ems/ZdSelect/index.vue'
|
||||||
import {mapState} from "vuex";
|
|
||||||
export default {
|
export default {
|
||||||
components:{ZdSelect},
|
components:{ZdSelect},
|
||||||
data(){
|
data(){
|
||||||
@ -39,21 +38,14 @@ export default {
|
|||||||
activeMenu:''
|
activeMenu:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
|
||||||
...mapState({
|
|
||||||
dzjkAlarmLighting:state=>state.ems.dzjkAlarmLighting
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods:{
|
methods:{
|
||||||
submitSite(id){
|
submitSite(id){
|
||||||
if(id !== this.$route.query.siteId){
|
if(id != this.$route.query.siteId){
|
||||||
// console.log('单站监控选择了其他的站点id=',id,'并更新页面地址参数')
|
console.log('单站监控选择了其他的站点id=',id,'并更新页面地址参数')
|
||||||
this.$router.push({query:{...this.$route.query,siteId:id}})
|
this.$router.push({query:{...this.$route.query,siteId:id}})
|
||||||
}else{
|
}else{
|
||||||
// console.log('单站监控选择了相同的其他的站点id=',id,'页面地址不发生改变')
|
console.log('单站监控选择了相同的其他的站点id=',id,'页面地址不发生改变')
|
||||||
}
|
}
|
||||||
//获取告警列表数据
|
|
||||||
this.$store.dispatch('getSiteAlarmNum',id)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeRouteLeave(to,from, next){
|
beforeRouteLeave(to,from, next){
|
||||||
@ -62,27 +54,15 @@ export default {
|
|||||||
this.$store.commit('SET_ZD_LIST',[])
|
this.$store.commit('SET_ZD_LIST',[])
|
||||||
next()
|
next()
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
console.log('单站监控一级页面路由',this.$route)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.dzjk-ems-content-container{
|
.dzjk-ems-content-container{
|
||||||
margin-top:0;
|
margin-top:0;
|
||||||
min-height: 60vh;
|
|
||||||
}
|
|
||||||
.lighting{
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
&::after{
|
|
||||||
content:"";
|
|
||||||
display: block;
|
|
||||||
background-color: red;
|
|
||||||
height: 10px;
|
|
||||||
width: 10px;
|
|
||||||
border-radius: 100%;
|
|
||||||
position: absolute;
|
|
||||||
right: -2px;
|
|
||||||
top: -2px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,420 +0,0 @@
|
|||||||
<!--电位展示图表-->
|
|
||||||
<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"
|
|
||||||
>
|
|
||||||
<el-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">
|
|
||||||
<el-radio :label="1">分钟</el-radio>
|
|
||||||
<el-radio :label="2">小时</el-radio>
|
|
||||||
<el-radio :label="3">天</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
<date-time-select
|
|
||||||
ref="dateTimeSelect"
|
|
||||||
:data-unit="dataUnit"
|
|
||||||
@initDate="(e) => (dataRange = e || [])"
|
|
||||||
@updateDate="updateDate"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div style="height: 350px" id="searchChart"></div>
|
|
||||||
</el-card>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
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 DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {DateRangeSelect, DateTimeSelect},
|
|
||||||
mixins: [resize],
|
|
||||||
props: {
|
|
||||||
siteId: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isDtdc() {
|
|
||||||
return this.deviceCategory === "BATTERY";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
show(val) {
|
|
||||||
if (!val) {
|
|
||||||
this.pointName = "";
|
|
||||||
this.deviceCategory = "";
|
|
||||||
this.deviceId = "";
|
|
||||||
this.dataUnit = 1;
|
|
||||||
this.child = "";
|
|
||||||
if (!this.chart) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.hideLoading();
|
|
||||||
this.chart.dispose();
|
|
||||||
this.chart = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dataUnit: {
|
|
||||||
handler(newVal, oldVal) {
|
|
||||||
if (!this.show) return;
|
|
||||||
console.log("wacth到了dataUnit的变化", newVal, oldVal);
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.dateTimeSelect.init();
|
|
||||||
this.getDate();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
show: false,
|
|
||||||
chart: null,
|
|
||||||
dataUnit: 1,
|
|
||||||
dataRange: [],
|
|
||||||
child: "", //单体电池需要数据
|
|
||||||
pointName: "",
|
|
||||||
deviceCategory: "",
|
|
||||||
deviceId: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showChart({pointName, deviceCategory, deviceId, child = ""}) {
|
|
||||||
//初始化数据
|
|
||||||
this.pointName = pointName;
|
|
||||||
this.deviceCategory = deviceCategory;
|
|
||||||
this.deviceId = deviceId;
|
|
||||||
child && (this.child = child);
|
|
||||||
this.show = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.dateTimeSelect.init();
|
|
||||||
this.initChart();
|
|
||||||
this.getDate();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
initChart() {
|
|
||||||
this.chart = echarts.init(document.querySelector("#searchChart"));
|
|
||||||
},
|
|
||||||
showLoading() {
|
|
||||||
this.chart && this.chart.showLoading();
|
|
||||||
},
|
|
||||||
hideLoading() {
|
|
||||||
this.chart && this.chart.hideLoading();
|
|
||||||
},
|
|
||||||
getDate() {
|
|
||||||
this.showLoading();
|
|
||||||
const {
|
|
||||||
siteId,
|
|
||||||
dataUnit,
|
|
||||||
dataRange: [start = "", end = ""],
|
|
||||||
child,
|
|
||||||
deviceId,
|
|
||||||
deviceCategory,
|
|
||||||
pointName,
|
|
||||||
} = this;
|
|
||||||
let siteDeviceMap = {};
|
|
||||||
child && (siteDeviceMap[siteId] = child);
|
|
||||||
let startDate, endDate;
|
|
||||||
if (start && dataUnit === 3) {
|
|
||||||
// startDate= start + `${dataUnit === 2 ? ':00' : ' 00:00:00'}`
|
|
||||||
startDate = start + " 00:00:00";
|
|
||||||
} else {
|
|
||||||
startDate = start;
|
|
||||||
}
|
|
||||||
if (end && dataUnit === 3) {
|
|
||||||
// endDate= end + `${dataUnit === 2 ? ':00' : ' 00:00:00'}`
|
|
||||||
endDate = end + " 00:00:00";
|
|
||||||
} else {
|
|
||||||
endDate = end;
|
|
||||||
}
|
|
||||||
|
|
||||||
getPointValueList({
|
|
||||||
siteIds: [siteId],
|
|
||||||
deviceId,
|
|
||||||
dataUnit,
|
|
||||||
deviceCategory,
|
|
||||||
pointName,
|
|
||||||
startDate,
|
|
||||||
endDate,
|
|
||||||
siteDeviceMap,
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.setOption(response?.data || []);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.hideLoading();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setOption(data) {
|
|
||||||
if (!this.chart) return;
|
|
||||||
this.chart.clear();
|
|
||||||
console.log("返回的数据", data);
|
|
||||||
if (!data || data.length <= 0) {
|
|
||||||
this.$message.warning("暂无数据");
|
|
||||||
}
|
|
||||||
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',
|
|
||||||
// top: '10',
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
containLabel: true,
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
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,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
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();
|
|
||||||
},
|
|
||||||
handleClosed(done) {
|
|
||||||
if (!this.chart) {
|
|
||||||
return done();
|
|
||||||
}
|
|
||||||
this.chart.dispose();
|
|
||||||
this.chart = null;
|
|
||||||
done();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
::v-deep {
|
|
||||||
.card-title .el-radio {
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 6个方块-->
|
<!-- 6个方块-->
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :xs="12" :sm="8" :lg="4" style="margin-bottom: 10px;" class="single-square-box-container" v-for="(item,index) in singleZdSqaure" :key="index+'singleSquareBox'">
|
<el-col :xs="12" :sm="8" :lg="4" class="single-square-box-container" v-for="(item,index) in singleZdSqaure" :key="index+'singleSquareBox'">
|
||||||
<single-square-box :data="{...item,value:formatNumber(data[item.attr])}" ></single-square-box>
|
<single-square-box :data="{...item,value:formatNumber(data[item.attr])}" ></single-square-box>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -64,10 +64,5 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@media only screen and (min-width: 1200px) {
|
|
||||||
.single-square-box-container {
|
|
||||||
min-width: 16.6666666667%;
|
|
||||||
width: fit-content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,64 +1,28 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div v-for="(baseInfo,index) in baseInfoList" :key="index+'bmsdccContainer'" style="margin-bottom:25px;">
|
<div v-for="(baseInfo,index) in baseInfoList" :key="index+'bmsdccContainer'" style="margin-bottom:25px;">
|
||||||
<el-card shadow="always"
|
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding common-card-container-no-title-bg">
|
||||||
class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
|
||||||
:class="handleCardClass(baseInfo)">
|
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span
|
<span class="large-title">{{index+1}}#{{baseInfo.deviceName}}</span>
|
||||||
class="large-title">{{
|
|
||||||
baseInfo.parentDeviceName ? `${baseInfo.parentDeviceName} -> ` : ''
|
|
||||||
}}{{ baseInfo.deviceName }}</span>
|
|
||||||
<div class="info">
|
|
||||||
<div>数据更新时间:{{ baseInfo.dataUpdateTime || '-' }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="alarm">
|
|
||||||
<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')"
|
|
||||||
></i>
|
|
||||||
</el-badge>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="descriptions-main">
|
<div class="descriptions-main">
|
||||||
<el-descriptions direction="vertical" :column="3" :colon="false">
|
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||||
<el-descriptions-item
|
<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>
|
||||||
contentClassName="descriptions-direction work-status"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="与PCS通信">{{$store.state.ems.communicationStatusOptions[baseInfo.pcsCommunicationStatus]}}</el-descriptions-item>
|
||||||
:span="1" label="工作状态">
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="与EMS通信">{{$store.state.ems.communicationStatusOptions[baseInfo.emsCommunicationStatus]}}</el-descriptions-item>
|
||||||
{{ 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>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
<div class="descriptions-main descriptions-main-bg-color">
|
<div class="descriptions-main descriptions-main-bg-color">
|
||||||
<el-descriptions direction="vertical" :column="3" :colon="false">
|
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||||
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :span="1" :label="item.label">{{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'" :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>
|
|
||||||
</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<!-- 进度-->
|
<!-- 进度-->
|
||||||
<div class="process-container">
|
<div class="process-container">
|
||||||
<div class="process-line-bg">
|
<div class="process-line-bg">
|
||||||
<div class="process-line":style="{height:baseInfo.currentSoc+'%'}"></div>
|
<div class="process-line":style="{height:baseInfo.currentSoc+'%'}"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="process pointer" @click="showChart( '当前SOC',baseInfo.deviceId)">当前SOC :
|
<div class="process">当前SOC : {{baseInfo.currentSoc}}%</div>
|
||||||
{{ baseInfo.currentSoc }}%
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
@ -77,22 +41,10 @@
|
|||||||
prop="avgData"
|
prop="avgData"
|
||||||
label="单体平均值"
|
label="单体平均值"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
|
||||||
<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>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="minData"
|
prop="minData"
|
||||||
label="单体最小值">
|
label="单体最小值">
|
||||||
<template slot-scope="scope">
|
|
||||||
<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>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="minDataID"
|
prop="minDataID"
|
||||||
@ -101,12 +53,6 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
prop="maxData"
|
prop="maxData"
|
||||||
label="单体最大值">
|
label="单体最大值">
|
||||||
<template slot-scope="scope">
|
|
||||||
<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>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="maxDataID"
|
prop="maxDataID"
|
||||||
@ -116,29 +62,17 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<el-empty v-show="baseInfoList.length<=0" :image-size="200"></el-empty>
|
<el-empty v-show="baseInfoList.length<=0" :image-size="200"></el-empty>
|
||||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
|
||||||
<point-table ref="pointTable"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import pointChart from "./../PointChart.vue";
|
|
||||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
|
||||||
import {getBMSBatteryCluster} from '@/api/ems/dzjk'
|
import {getBMSBatteryCluster} from '@/api/ems/dzjk'
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
|
||||||
import {mapState} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name:'DzjkSbjkBmsdcc',
|
name:'DzjkSbjkBmsdcc',
|
||||||
mixins: [getQuerySiteId, intervalUpdate],
|
mixins:[getQuerySiteId],
|
||||||
components: {PointTable, pointChart},
|
components:{},
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
CLUSTERWorkStatusOptions: state => state?.ems?.CLUSTERWorkStatusOptions || {},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
@ -147,55 +81,27 @@ export default {
|
|||||||
'温度':'℃',
|
'温度':'℃',
|
||||||
'SOC':'%'
|
'SOC':'%'
|
||||||
},
|
},
|
||||||
tablePointNameMap: {
|
|
||||||
'电压单体最小值': '最低单体电压',
|
|
||||||
'电压单体平均值': '电压平均值',
|
|
||||||
'电压单体最大值': '最高单体电压',
|
|
||||||
'温度单体最小值': '最低单体温度',
|
|
||||||
'温度单体平均值': '平均单体温度',
|
|
||||||
'温度单体最大值': '最高单体温度',
|
|
||||||
'SOC单体最小值': '最低单体SOC',
|
|
||||||
'SOC单体平均值': '当前SOC',
|
|
||||||
'SOC单体最大值': '最高单体SOC',
|
|
||||||
},
|
|
||||||
baseInfoList:[],
|
baseInfoList:[],
|
||||||
infoData:[
|
infoData:[
|
||||||
{label: '簇电压', attr: 'clusterVoltage', unit: 'V', pointName: '簇电压'},
|
{label:'簇电压',attr:'clusterVoltage',unit:'V'},
|
||||||
{label: '可充电量', attr: 'chargeableCapacity', unit: 'kWh', pointName: '可充电量'},
|
{label:'可充电量',attr:'chargeableCapacity',unit:'kWh'},
|
||||||
{label: '累计充电量', attr: 'totalChargedCapacity', unit: 'kWh', pointName: '累计充电量'},
|
{label:'累计充电量',attr:'totalChargedCapacity',unit:'kWh'},
|
||||||
{label: '簇电流', attr: 'clusterCurrent', unit: 'A', pointName: '簇电流'},
|
{label:'簇电流',attr:'clusterCurrent',unit:'A'},
|
||||||
{label: '可放电量', attr: 'dischargeableCapacity', unit: 'kWh', pointName: '可放电量'},
|
{label:'可放电量',attr:'dischargeableCapacity',unit:'kWh'},
|
||||||
{label: '累计放电量', attr: 'totalDischargedCapacity', unit: 'kWh', pointName: '累计放电量'},
|
{label:'累计放电量',attr:'totalDischargedCapacity',unit:'kWh'},
|
||||||
{label: 'SOH', attr: 'soh', unit: '%', pointName: 'SOH'},
|
{label:'SOH',attr:'soh',unit:'%'},
|
||||||
{label: '平均温度', attr: 'averageTemperature', unit: '℃', pointName: '平均温度'},
|
{label:'平均温度',attr:'averageTemperature',unit:'℃'},
|
||||||
{label: '绝缘电阻', attr: 'insulationResistance', unit: 'Ω', pointName: '绝缘电阻'},
|
{label:'绝缘电阻',attr:'insulationResistance',unit:'Ω'},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
handleCardClass(item) {
|
init(){
|
||||||
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)
|
|
||||||
},
|
|
||||||
showChart(pointName, deviceId) {
|
|
||||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'CLUSTER', deviceId})
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getBMSBatteryCluster(this.siteId).then(response => {
|
getBMSBatteryCluster(this.siteId).then(response => {
|
||||||
this.baseInfoList = JSON.parse(JSON.stringify(response?.data || []));
|
this.baseInfoList = JSON.parse(JSON.stringify(response?.data || []));
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading = false})
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.updateData()
|
|
||||||
this.updateInterval(this.updateData)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,12 +113,10 @@ export default {
|
|||||||
.descriptions-main{
|
.descriptions-main{
|
||||||
padding:24px 300px 24px 24px;
|
padding:24px 300px 24px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.descriptions-main-bottom{
|
.descriptions-main-bottom{
|
||||||
padding:14px 300px 14px 24px;
|
padding:14px 300px 14px 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进度条样式
|
// 进度条样式
|
||||||
.process-container{
|
.process-container{
|
||||||
width:100px;
|
width:100px;
|
||||||
@ -220,7 +124,6 @@ export default {
|
|||||||
right:70px;
|
right:70px;
|
||||||
top:50%;
|
top:50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
|
|
||||||
.process-line-bg{
|
.process-line-bg{
|
||||||
position: relative;
|
position: relative;
|
||||||
width:100%;
|
width:100%;
|
||||||
@ -228,7 +131,6 @@ export default {
|
|||||||
background-color:#fff2cb ;
|
background-color:#fff2cb ;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
box-shadow: 0 0 10px #fff2cb, 0 0 0 rgba(255, 242, 203, 0.5);
|
box-shadow: 0 0 10px #fff2cb, 0 0 0 rgba(255, 242, 203, 0.5);
|
||||||
|
|
||||||
.process-line{
|
.process-line{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -240,7 +142,6 @@ export default {
|
|||||||
box-shadow: 0 0 10px #ffbf14, 0 0 0 rgba(255, 191, 20, 0.5);
|
box-shadow: 0 0 10px #ffbf14, 0 0 0 rgba(255, 191, 20, 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.process{
|
.process{
|
||||||
margin-top:15px;
|
margin-top:15px;
|
||||||
color:#666666;
|
color:#666666;
|
||||||
|
|||||||
@ -1,227 +1,130 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div v-for="(baseInfo,index) in baseInfoList" :key="index+'bmszlContainer'" style="margin-bottom:25px;">
|
<div v-for="(baseInfo,index) in baseInfoList" :key="index+'bmszlContainer'" style="margin-bottom:25px;">
|
||||||
<el-card
|
<el-card shadow="always" class="common-card-container common-card-container-body-no-padding common-card-container-no-title-bg">
|
||||||
:class="handleCardClass(baseInfo)"
|
|
||||||
class="sbjk-card-container common-card-container-body-no-padding common-card-container-no-title-bg"
|
|
||||||
shadow="always">
|
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span class="large-title">{{ baseInfo.deviceName }}</span>
|
<span class="large-title">{{index+1}}#{{baseInfo.deviceName}}</span>
|
||||||
<div class="info">
|
|
||||||
<div>数据更新时间:{{ baseInfo.dataUpdateTime || '-' }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="alarm">
|
|
||||||
<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')"
|
|
||||||
></i>
|
|
||||||
</el-badge>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="descriptions-main">
|
<div class="descriptions-main">
|
||||||
<el-descriptions :colon="false" :column="3" direction="vertical">
|
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||||
<el-descriptions-item
|
<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>
|
||||||
contentClassName="descriptions-direction work-status"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="与PCS通信">{{$store.state.ems.communicationStatusOptions[baseInfo.pcsCommunicationStatus]}}</el-descriptions-item>
|
||||||
label="工作状态" labelClassName="descriptions-label">
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="与EMS通信">{{$store.state.ems.communicationStatusOptions[baseInfo.emsCommunicationStatus]}}</el-descriptions-item>
|
||||||
{{ 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>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
<div class="descriptions-main descriptions-main-bg-color">
|
<div class="descriptions-main descriptions-main-bg-color">
|
||||||
<el-descriptions :colon="false" :column="3" direction="vertical">
|
<el-descriptions direction="vertical" :column="3" :colon="false">
|
||||||
<el-descriptions-item v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :label="item.label"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :span="1" :label="item.label">{{baseInfo[item.attr] | formatNumber}} <span v-if="item.unit" v-html="item.unit"></span></el-descriptions-item>
|
||||||
: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>
|
</el-descriptions>
|
||||||
<!-- 进度-->
|
<!-- 进度-->
|
||||||
<div class="process-container">
|
<div class="process-container">
|
||||||
<div class="process-line-bg">
|
<div class="process-line-bg">
|
||||||
<div :style="{height:baseInfo.stackSoc+'%'}" class="process-line"></div>
|
<div class="process-line" :style="{height:baseInfo.stackSoc+'%'}"></div>
|
||||||
</div>
|
|
||||||
<div class="process pointer" @click="showChart('当前SOC',baseInfo.deviceId)">当前SOC :
|
|
||||||
{{ baseInfo.stackSoc }}%
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="process">当前SOC : {{baseInfo.stackSoc}}%</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
:data="baseInfo.batteryDataList"
|
|
||||||
class="common-table"
|
class="common-table"
|
||||||
max-height="500"
|
:data="baseInfo.batteryDataList"
|
||||||
stripe
|
stripe
|
||||||
|
max-height="500"
|
||||||
style="width: 100%;margin-top:25px;">
|
style="width: 100%;margin-top:25px;">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="簇号"
|
prop="clusterId"
|
||||||
prop="clusterId">
|
label="簇号">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="簇电压"
|
label="簇电压"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="pointer"
|
<span>{{scope.row.clusterVoltage}} V</span>
|
||||||
@click="showChart('簇电压',scope.row.clusterId,'CLUSTER')">{{ scope.row.clusterVoltage }} V</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="簇电流">
|
label="簇电流">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="pointer"
|
<span>{{scope.row.clusterCurrent}} A</span>
|
||||||
@click="showChart('簇电流',scope.row.clusterId,'CLUSTER')">{{ scope.row.clusterCurrent }} A</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="簇SOC">
|
label="簇SOC">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="pointer"
|
<span>{{scope.row.currentSoc}} %</span>
|
||||||
@click="showChart('当前SOC',scope.row.clusterId,'CLUSTER')">{{ scope.row.currentSoc }} %</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="单体最高电压"
|
prop="maxVoltage"
|
||||||
prop="maxVoltage">
|
label="单体最高电压">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="pointer"
|
<span>{{scope.row.maxCellVoltage}} V</span>
|
||||||
@click="showChart('最高单体电压',scope.row.clusterId,'CLUSTER')">{{
|
|
||||||
scope.row.maxCellVoltage
|
|
||||||
}} V</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="电池号码"
|
prop="minVoltage"
|
||||||
prop="maxCellVoltageId">
|
label="单体最低电压">
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="单体最低电压"
|
|
||||||
prop="minVoltage">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="pointer"
|
<span>{{scope.row.minCellVoltage}} V</span>
|
||||||
@click="showChart('最低单体电压',scope.row.clusterId,'CLUSTER')">{{
|
|
||||||
scope.row.minCellVoltage
|
|
||||||
}} V</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
|
||||||
label="电池号码"
|
|
||||||
prop="minCellVoltageId">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="单体最高温度">
|
label="单体最高温度">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="pointer"
|
<span>{{scope.row.maxCellTemp}} ℃</span>
|
||||||
@click="showChart('最高单体温度',scope.row.clusterId,'CLUSTER')">{{
|
|
||||||
scope.row.maxCellTemp
|
|
||||||
}} ℃</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="电池号码"
|
prop="minTemperature"
|
||||||
prop="maxCellTempId">
|
label="单体最低温度">
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="单体最低温度"
|
|
||||||
prop="minTemperature">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="pointer"
|
<span>{{scope.row.minCellTemp}} ℃</span>
|
||||||
@click="showChart('最低单体温度',scope.row.clusterId,'CLUSTER')">{{
|
|
||||||
scope.row.minCellTemp
|
|
||||||
}} ℃</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
|
||||||
label="电池号码"
|
|
||||||
prop="minCellTempId">
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<el-empty v-show="baseInfoList.length<=0" :image-size="200"></el-empty>
|
<el-empty v-show="baseInfoList.length<=0" :image-size="200"></el-empty>
|
||||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
|
||||||
<point-table ref="pointTable"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getBMSOverView} from '@/api/ems/dzjk'
|
import {getBMSOverView} from '@/api/ems/dzjk'
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
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 {
|
export default {
|
||||||
name:'DzjkSbjkBmszl',
|
name:'DzjkSbjkBmszl',
|
||||||
components: {pointChart, PointTable},
|
mixins:[getQuerySiteId],
|
||||||
mixins: [getQuerySiteId, intervalUpdate],
|
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
STACKWorkStatusOptions: state => state?.ems?.STACKWorkStatusOptions || {},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
baseInfoList:[],
|
baseInfoList:[],
|
||||||
infoData:[
|
infoData:[
|
||||||
{label: '电池堆总电压', attr: 'stackVoltage', unit: 'V', pointName: '电池堆电压'},
|
{label:'电池堆总电压',attr:'stackVoltage',unit:'V'},
|
||||||
{label: '可充电量', attr: 'availableChargeCapacity', unit: 'kWh', pointName: '可充电量'},
|
{label:'可充电量',attr:'availableChargeCapacity',unit:'kWh'},
|
||||||
{label: '累计充电量', attr: 'totalChargeCapacity', unit: 'kWh', pointName: '累计充电量'},
|
{label:'累计充电量',attr:'totalChargeCapacity',unit:'kWh'},
|
||||||
{label: '电池堆总电流', attr: 'stackCurrent', unit: 'A', pointName: '电池堆总电流'},
|
{label:'电池堆总电流',attr:'stackCurrent',unit:'A'},
|
||||||
{label: '可放电量', attr: 'availableDischargeCapacity', unit: 'kWh', pointName: '可放电量'},
|
{label:'可放电量',attr:'availableDischargeCapacity',unit:'kWh'},
|
||||||
{label: '累计放电量', attr: 'totalDischargeCapacity', unit: 'kWh', pointName: '累计放电量'},
|
{label:'累计放电量',attr:'totalDischargeCapacity',unit:'kWh'},
|
||||||
{label: 'SOH', attr: 'stackSoh', unit: '%', pointName: 'SOH'},
|
{label:'SOH',attr:'stackSoh',unit:'%'},
|
||||||
{label: '平均温度', attr: 'operatingTemp', unit: '℃', pointName: '平均温度'},
|
{label:'平均温度',attr:'operatingTemp',unit:'℃'},
|
||||||
{label: '绝缘电阻', attr: 'stackInsulationResistance', unit: 'Ω', pointName: '绝缘电阻'},
|
{label:'绝缘电阻',attr:'stackInsulationResistance',unit:'Ω'},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
handleCardClass(item) {
|
init(){
|
||||||
const {workStatus = ''} = item
|
this.loading=true;
|
||||||
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)
|
|
||||||
},
|
|
||||||
showChart(pointName, deviceId, deviceCategory = 'STACK') {
|
|
||||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory, deviceId})
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.loading = true
|
|
||||||
getBMSOverView(this.siteId).then(response => {
|
getBMSOverView(this.siteId).then(response => {
|
||||||
this.baseInfoList = JSON.parse(JSON.stringify(response?.data || []));
|
this.baseInfoList = JSON.parse(JSON.stringify(response?.data || []));
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading = false})
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.updateData()
|
|
||||||
this.updateInterval(this.updateData)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style scoped lang="scss">
|
||||||
::v-deep {
|
::v-deep {
|
||||||
//描述列表样式
|
//描述列表样式
|
||||||
.descriptions-main {
|
.descriptions-main {
|
||||||
@ -232,7 +135,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进度条样式
|
// 进度条样式
|
||||||
.process-container{
|
.process-container{
|
||||||
width:100px;
|
width:100px;
|
||||||
@ -240,7 +142,6 @@ export default {
|
|||||||
right:70px;
|
right:70px;
|
||||||
top:50%;
|
top:50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
|
|
||||||
.process-line-bg{
|
.process-line-bg{
|
||||||
position: relative;
|
position: relative;
|
||||||
width:100%;
|
width:100%;
|
||||||
@ -248,7 +149,6 @@ export default {
|
|||||||
background-color:#fff2cb ;
|
background-color:#fff2cb ;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
box-shadow: 0 0 10px #fff2cb, 0 0 0 rgba(255, 242, 203, 0.5);
|
box-shadow: 0 0 10px #fff2cb, 0 0 0 rgba(255, 242, 203, 0.5);
|
||||||
|
|
||||||
.process-line{
|
.process-line{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -260,7 +160,6 @@ export default {
|
|||||||
box-shadow: 0 0 10px rgb(252 108 108), 0 0 0 rgba(252, 108, 108, 0.5);
|
box-shadow: 0 0 10px rgb(252 108 108), 0 0 0 rgba(252, 108, 108, 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.process{
|
.process{
|
||||||
margin-top:15px;
|
margin-top:15px;
|
||||||
color:#666666;
|
color:#666666;
|
||||||
|
|||||||
@ -1,237 +1,134 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<el-card
|
<el-card shadow="always" class="common-card-container" :class="zbInfo.emsCommunicationStatus === '1' ? 'zb-common-card-container' : 'cnb-common-card-container'">
|
||||||
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">
|
<div slot="header">
|
||||||
<span class="large-title">{{ item.deviceName }}</span>
|
<span class="large-title">1#{{zbInfo.deviceName}}</span>
|
||||||
<div class="info">
|
<div class="status">
|
||||||
<div>
|
<div>{{$store.state.ems.communicationStatusOptions[zbInfo.emsCommunicationStatus]}}</div>
|
||||||
{{
|
<div>数据更新时间:{{zbInfo.dataUpdateTime}}</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>
|
||||||
</div>
|
</div>
|
||||||
<el-row class="device-info-row">
|
<el-table
|
||||||
<el-col v-for="(tempDataItem,tempDataIndex) in (deviceIdTypeMsg[item.deviceId] || otherTypeMsg)"
|
class="common-table"
|
||||||
:key="tempDataIndex+'dbTempData'"
|
:data="zbInfo.loadDataDetailInfo"
|
||||||
:span="8" class="device-info-col">
|
stripe
|
||||||
<span class="pointer" @click="showChart(tempDataItem.pointName,item.deviceId)">
|
style="width: 100%;">
|
||||||
<span class="left">{{ tempDataItem.name }}</span> <span class="right">{{ item[tempDataItem.attr] || '-' }}<span
|
<el-table-column
|
||||||
v-html="tempDataItem.unit"></span></span>
|
prop="category"
|
||||||
</span>
|
label="类别">
|
||||||
</el-col>
|
</el-table-column>
|
||||||
</el-row>
|
<el-table-column
|
||||||
|
prop="totalKwh"
|
||||||
|
label="总/kWh"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="peakKwh"
|
||||||
|
label="尖/kWh">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="highKwh"
|
||||||
|
label="峰/kWh">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="flatKwh"
|
||||||
|
label="平/kWh">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="valleyKwh"
|
||||||
|
label="谷/kWh">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
<el-card shadow="always" class="common-card-container" style="margin-top:20px" :class="cnbInfo.emsCommunicationStatus === '1' ? 'zb-common-card-container' : 'cnb-common-card-container'">
|
||||||
|
<div slot="header">
|
||||||
|
<span class="large-title">2#{{cnbInfo.deviceName}}</span>
|
||||||
|
<div class="status">
|
||||||
|
<div>{{$store.state.ems.communicationStatusOptions[cnbInfo.emsCommunicationStatus]}}</div>
|
||||||
|
<div>数据更新时间:{{cnbInfo.dataUpdateTime}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
class="common-table"
|
||||||
|
:data="cnbInfo.meteDataDetailInfo"
|
||||||
|
stripe
|
||||||
|
style="width: 100%;">
|
||||||
|
<el-table-column
|
||||||
|
prop="category"
|
||||||
|
label="类别">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="activePower"
|
||||||
|
label="有功功率"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="reactivePower"
|
||||||
|
label="无功功率">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
</el-card>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import pointChart from "./../PointChart.vue";
|
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
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 {
|
export default {
|
||||||
name: "DzjkSbjkDb",
|
name:'DzjkSbjkDb',
|
||||||
mixins: [getQuerySiteId, intervalUpdate],
|
mixins:[getQuerySiteId],
|
||||||
components: {PointTable, pointChart},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
...mapState({
|
|
||||||
communicationStatusOptions: state => state?.ems?.communicationStatusOptions || {},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
list: [],
|
zbInfo:{},
|
||||||
deviceIdTypeMsg: {
|
cnbInfo:{},
|
||||||
'LOAD': [
|
|
||||||
{
|
|
||||||
name: '正向有功电能',
|
|
||||||
attr: 'forwardActive',
|
|
||||||
pointName: '正向有功电能',
|
|
||||||
unit: 'kWh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '反向有功电能',
|
|
||||||
attr: 'reverseActive',
|
|
||||||
pointName: '反向有功电能',
|
|
||||||
unit: 'kWh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '正向无功电能',
|
|
||||||
attr: 'forwardReactive',
|
|
||||||
pointName: '正向无功电能',
|
|
||||||
unit: 'kvarh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '反向无功电能',
|
|
||||||
attr: 'reverseReactive',
|
|
||||||
pointName: '反向无功电能',
|
|
||||||
unit: 'kvarh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '有功功率',
|
|
||||||
attr: 'activePower',
|
|
||||||
pointName: '总有功功率',
|
|
||||||
unit: 'kW'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '无功功率',
|
|
||||||
attr: 'reactivePower',
|
|
||||||
pointName: '总无功功率',
|
|
||||||
unit: 'kvar'
|
|
||||||
}
|
}
|
||||||
],
|
|
||||||
'METE': [
|
|
||||||
{
|
|
||||||
name: '正向有功电能',
|
|
||||||
attr: 'forwardActive',
|
|
||||||
pointName: '正向有功电能',
|
|
||||||
unit: 'kWh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '反向有功电能',
|
|
||||||
attr: 'reverseActive',
|
|
||||||
pointName: '反向有功电能',
|
|
||||||
unit: 'kWh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '正向无功电能',
|
|
||||||
attr: 'forwardReactive',
|
|
||||||
pointName: '正向无功电能',
|
|
||||||
unit: 'kvarh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '反向无功电能',
|
|
||||||
attr: 'reverseReactive',
|
|
||||||
pointName: '反向无功电能',
|
|
||||||
unit: 'kvarh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '有功功率',
|
|
||||||
attr: 'activePower',
|
|
||||||
pointName: '总有功功率',
|
|
||||||
unit: 'kW'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '无功功率',
|
|
||||||
attr: 'reactivePower',
|
|
||||||
pointName: '总无功功率',
|
|
||||||
unit: 'kvar'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'METEGF': [
|
|
||||||
{
|
|
||||||
name: '有功电能',
|
|
||||||
attr: 'activeEnergy',
|
|
||||||
pointName: '有功电能',
|
|
||||||
unit: 'kWh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '无功电能',
|
|
||||||
attr: 'reactiveEnergy',
|
|
||||||
pointName: '无功电能',
|
|
||||||
unit: 'kvarh'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '有功功率',
|
|
||||||
attr: 'activePower',
|
|
||||||
pointName: '总有功功率',
|
|
||||||
unit: 'kW'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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:{
|
methods:{
|
||||||
// 查看设备电位表格
|
|
||||||
pointDetail(row, dataType) {
|
|
||||||
const {deviceId} = row
|
|
||||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'AMMETER'}, dataType)
|
|
||||||
},
|
|
||||||
showChart(pointName, deviceId) {
|
|
||||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'AMMETER', deviceId})
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.loading = true;
|
|
||||||
getAmmeterDataList(this.siteId)
|
|
||||||
.then((response) => {
|
|
||||||
this.list = response?.data || []
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
init(){
|
init(){
|
||||||
this.updateData()
|
this.loading = true
|
||||||
this.updateInterval(this.updateData)
|
getAmmeterDataList(this.siteId).then(response => {
|
||||||
},
|
this.zbInfo =JSON.parse(JSON.stringify(response?.data?.ammeterLoadData || {}));
|
||||||
|
this.cnbInfo =JSON.parse(JSON.stringify(response?.data?.ammeterMeteData || {}));
|
||||||
|
}).finally(() => {this.loading = false})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
},
|
|
||||||
};
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.sbjk-card-container {
|
.zb-common-card-container,.cnb-common-card-container{
|
||||||
&.list:not(:last-child) {
|
::v-deep{
|
||||||
margin-bottom: 25px;
|
.el-card__header{
|
||||||
|
padding:10px 14px;
|
||||||
|
background-color: #FC6B69;
|
||||||
|
color:#ffffff;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.cnb-common-card-container{
|
||||||
|
margin-top:25px;
|
||||||
|
::v-deep{
|
||||||
|
.el-card__header{
|
||||||
|
background-color: #05AEA3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.status{
|
||||||
|
position: absolute;
|
||||||
|
right:14px;
|
||||||
|
top:50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,120 +0,0 @@
|
|||||||
<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" 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>
|
|
||||||
</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 getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
|
||||||
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},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
list: [],
|
|
||||||
tempData: [
|
|
||||||
{title: '湿度', attr: 'humidity', unit: ''},
|
|
||||||
{title: '温度', attr: 'temperature', unit: '℃'},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 查看设备电位表格
|
|
||||||
pointDetail(row, dataType) {
|
|
||||||
const {deviceId} = row
|
|
||||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'DH'}, dataType)
|
|
||||||
},
|
|
||||||
showChart(pointName, deviceId) {
|
|
||||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'DH', deviceId})
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.loading = true
|
|
||||||
getDhDataList(this.siteId).then(response => {
|
|
||||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.updateData()
|
|
||||||
this.updateInterval(this.updateData)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.sbjk-card-container {
|
|
||||||
&:not(:last-child) {
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border: 1px solid #eeeeee;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 16px;
|
|
||||||
color: #333333;
|
|
||||||
|
|
||||||
.el-col {
|
|
||||||
padding: 12px 0;
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-col {
|
|
||||||
border-bottom: 1px solid #eeeeee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-col:not(:nth-child(3n)) {
|
|
||||||
border-right: 1px solid #eeeeee;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -7,40 +7,46 @@
|
|||||||
lock-scroll
|
lock-scroll
|
||||||
append-to-body
|
append-to-body
|
||||||
width="700px"
|
width="700px"
|
||||||
class="ems-dialog chart-detail-dialog"
|
class="ems-dialog"
|
||||||
:before-close="handleColsed"
|
:before-close="handleColsed"
|
||||||
>
|
>
|
||||||
<el-card
|
<div>
|
||||||
shadow="always"
|
<el-form size="medium" label-width="100px" inline>
|
||||||
class="common-card-container time-range-card"
|
<el-form-item label="时间选择">
|
||||||
style="margin-top: 20px"
|
<el-date-picker
|
||||||
>
|
v-model="dateRange"
|
||||||
<div slot="header" class="time-range-header">
|
type="daterange"
|
||||||
<span class="card-title"></span>
|
range-separator="至"
|
||||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate" />
|
start-placeholder="开始时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
:default-value="defaultDateRange"
|
||||||
|
end-placeholder="结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getData">搜索</el-button>
|
||||||
|
<el-button @click="onReset">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div id="lineChart" style="height: 360px;width: 100%;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-main" v-loading="loading">
|
|
||||||
<div id="lineChart" style="height: 310px"></div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from '@/mixins/ems/resize'
|
||||||
import { getSingleBatteryData } from "@/api/ems/dzjk";
|
import {getSingleBatteryData} from '@/api/ems/dzjk'
|
||||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
|
||||||
export default {
|
export default {
|
||||||
components: { DateRangeSelect },
|
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
siteId: "",
|
siteId:'',
|
||||||
deviceId: "",
|
deviceId:'',
|
||||||
clusterDeviceId: "",
|
clusterDeviceId:'',
|
||||||
dataType: "", //展示的数据类型 空值展示所有数据
|
dataType:'',//展示的数据类型 空值展示所有数据
|
||||||
pickerOptions:{
|
pickerOptions:{
|
||||||
disabledDate(time) {
|
disabledDate(time) {
|
||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
@ -48,152 +54,120 @@ export default {
|
|||||||
},
|
},
|
||||||
dialogTableVisible: false,
|
dialogTableVisible: false,
|
||||||
dateRange: [],
|
dateRange: [],
|
||||||
};
|
defaultDateRange:[]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 更新时间范围 重置图表
|
|
||||||
updateDate(data) {
|
|
||||||
this.dateRange = data || [];
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
handleColsed(done){
|
handleColsed(done){
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return done();
|
return done()
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
done();
|
done()
|
||||||
},
|
},
|
||||||
getData(){
|
getData(){
|
||||||
if (this.loading) return;
|
if(this.loading) return
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.chart.showLoading();
|
this.chart.showLoading()
|
||||||
const {
|
const {siteId, deviceId,clusterDeviceId,dateRange:[startDate='',endDate='']}=this;
|
||||||
siteId,
|
getSingleBatteryData({siteId, deviceId,clusterDeviceId,startDate,endDate}).then(response => {
|
||||||
deviceId,
|
this.setOption(response?.data || [])
|
||||||
clusterDeviceId,
|
}).finally(()=>{
|
||||||
dateRange: [startDate = "", endDate = ""],
|
|
||||||
} = this;
|
|
||||||
getSingleBatteryData({
|
|
||||||
siteId,
|
|
||||||
deviceId,
|
|
||||||
clusterDeviceId,
|
|
||||||
startDate,
|
|
||||||
endDate,
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.setOption(response?.data || []);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.chart.hideLoading();
|
this.chart.hideLoading()
|
||||||
});
|
})
|
||||||
|
},
|
||||||
|
// 重置
|
||||||
|
onReset(){
|
||||||
|
this.dateRange=[]
|
||||||
|
this.getData()
|
||||||
},
|
},
|
||||||
initChart({siteId, clusterDeviceId, deviceId},dataType) {
|
initChart({siteId, clusterDeviceId, deviceId},dataType) {
|
||||||
this.siteId = siteId;
|
this.siteId=siteId
|
||||||
this.clusterDeviceId = clusterDeviceId;
|
this.clusterDeviceId=clusterDeviceId
|
||||||
this.deviceId = deviceId;
|
this.deviceId=deviceId
|
||||||
this.dataType = dataType;
|
this.dataType=dataType
|
||||||
this.dialogTableVisible = true;
|
this.dateRange=[]
|
||||||
|
this.dialogTableVisible = true
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
!this.chart &&
|
!this.chart && (this.chart = echarts.init(document.querySelector('#lineChart')))
|
||||||
(this.chart = echarts.init(document.querySelector("#lineChart")));
|
this.getData()
|
||||||
this.$refs.dateRangeSelect.init();
|
})
|
||||||
});
|
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(data) {
|
||||||
const obj = {
|
const obj = {
|
||||||
voltage: "电压",
|
voltage:'电压',
|
||||||
temperature: "温度",
|
temperature:'温度',
|
||||||
soc: "SOC",
|
soc:'SOC',
|
||||||
soh: "SOH",
|
soh:'SOH',
|
||||||
};
|
|
||||||
let source,
|
|
||||||
series,
|
|
||||||
{ dataType } = this;
|
|
||||||
if (dataType) {
|
|
||||||
source = [["日期", obj[dataType]]];
|
|
||||||
data.forEach((item) => {
|
|
||||||
source.push([item.dataTimestamp, item[dataType]]);
|
|
||||||
});
|
|
||||||
series = [
|
|
||||||
{
|
|
||||||
name: obj[dataType],
|
|
||||||
type: "line",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
source = [["日期", "电压", "温度", "SOC", "SOH"]];
|
|
||||||
data.forEach((item) => {
|
|
||||||
source.push([
|
|
||||||
item.dataTimestamp,
|
|
||||||
item.voltage,
|
|
||||||
item.temperature,
|
|
||||||
item.soc,
|
|
||||||
item.soh,
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
series = [
|
|
||||||
{
|
|
||||||
name: "电压",
|
|
||||||
type: "line",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "温度",
|
|
||||||
type: "line",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "SOC",
|
|
||||||
type: "line",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "SOH",
|
|
||||||
type: "line",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
this.chart &&
|
let source,series,{dataType} = this
|
||||||
this.chart.setOption({
|
if(dataType){
|
||||||
color: ["#FFBD00", "#3C81FF", "#05AEA3", "#F86F70"],
|
source = [['日期',obj[dataType]]]
|
||||||
grid: {
|
data.forEach(item => {
|
||||||
containLabel: true,
|
source.push([item.dataTimestamp,item[dataType]])
|
||||||
|
})
|
||||||
|
series=[{
|
||||||
|
name:obj[dataType],
|
||||||
|
type: 'line',
|
||||||
|
}]
|
||||||
|
}else{
|
||||||
|
source = [['日期','电压','温度','SOC','SOH']]
|
||||||
|
data.forEach(item => {
|
||||||
|
source.push([item.dataTimestamp,item.voltage,item.temperature,item.soc,item.soh])
|
||||||
|
})
|
||||||
|
series=[
|
||||||
|
{
|
||||||
|
name:'电压',
|
||||||
|
type: 'line',
|
||||||
|
|
||||||
|
},{
|
||||||
|
name:'温度',
|
||||||
|
type: 'line',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:'SOC',
|
||||||
|
type: 'line',
|
||||||
|
|
||||||
|
},{
|
||||||
|
name:'SOH',
|
||||||
|
type: 'line',
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.chart && this.chart.setOption({
|
||||||
|
color:['#FFBD00','#3C81FF','#05AEA3','#F86F70'],
|
||||||
legend: {
|
legend: {
|
||||||
left: "center",
|
bottom: '10',
|
||||||
bottom: "15",
|
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
// 坐标轴指示器,坐标轴触发有效
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: "category",
|
type: 'category',
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataset:{
|
dataset:{
|
||||||
source,
|
source
|
||||||
},
|
},
|
||||||
series,
|
series
|
||||||
});
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
mounted(){
|
||||||
mounted() {},
|
const now = new Date();
|
||||||
};
|
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
||||||
|
this.defaultDateRange = [lastMonth, now];
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
|
||||||
.chart-detail-dialog {
|
|
||||||
::v-deep {
|
|
||||||
.el-dialog__body {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -1,193 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<template v-if="totalSize.length === 0">
|
|
||||||
<el-empty :size="200"></el-empty>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div class="lists-container clearfix">
|
|
||||||
<div
|
|
||||||
class="lists"
|
|
||||||
v-for="(item, index) in tableData"
|
|
||||||
:key="index + 'dtdcList'"
|
|
||||||
:class="handleListClass(item)"
|
|
||||||
>
|
|
||||||
<div style="font-size: 10px; font-weight: 600">
|
|
||||||
{{ item.clusterDeviceId }}
|
|
||||||
</div>
|
|
||||||
<div>#{{ item.deviceId }}</div>
|
|
||||||
<div class="dy pointer" @click="chartDetail(item, '电压 (V)')">
|
|
||||||
{{ item.voltage }}V
|
|
||||||
</div>
|
|
||||||
<div class="wd pointer" @click="chartDetail(item, '温度 (℃)')">
|
|
||||||
{{ item.temperature }}℃
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- <el-pagination
|
|
||||||
v-show="tableData.length > 0"
|
|
||||||
background
|
|
||||||
@size-change="(val) => $emit('handleSizeChange', val)"
|
|
||||||
@current-change="(val) => $emit('handleCurrentChange', val)"
|
|
||||||
: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> -->
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
pointIdList: {
|
|
||||||
require: true,
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
tableData: {
|
|
||||||
require: true,
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
totalSize: {
|
|
||||||
require: true,
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
// pageNum: {
|
|
||||||
// require: true,
|
|
||||||
// type: Number,
|
|
||||||
// default: 1,
|
|
||||||
// },
|
|
||||||
// pageSize: {
|
|
||||||
// require: true,
|
|
||||||
// type: Number,
|
|
||||||
// default: 10,
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
//最低单体温度 最高温度 最低电压 最高电压 todo 这里的顺序需要和图形组件里的顺序保持一致,
|
|
||||||
colorMap: {
|
|
||||||
0: "minwd",
|
|
||||||
1: "maxwd",
|
|
||||||
2: "mindy",
|
|
||||||
3: "maxdy",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//处理图形class 对应高亮设置
|
|
||||||
handleListClass(item) {
|
|
||||||
let className = "";
|
|
||||||
const { clusterDeviceId, deviceId } = item,
|
|
||||||
clusterIdList = Object.keys(this.pointIdList);
|
|
||||||
if (clusterIdList.includes(clusterDeviceId)) {
|
|
||||||
const index = this.pointIdList[clusterDeviceId].findIndex(
|
|
||||||
(ids) => ids === parseInt(deviceId)
|
|
||||||
);
|
|
||||||
if (index > -1) {
|
|
||||||
className = this.colorMap[index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return className;
|
|
||||||
},
|
|
||||||
//查看表格行图表
|
|
||||||
chartDetail(row, dataType = "") {
|
|
||||||
const { clusterDeviceId, deviceId } = row;
|
|
||||||
this.$emit("chart", { ...row, dataType });
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.lists-container {
|
|
||||||
padding: 20px 0;
|
|
||||||
.lists {
|
|
||||||
margin: 10px 5px;
|
|
||||||
padding: 5px 9px;
|
|
||||||
font-size: 11px;
|
|
||||||
line-height: 20px;
|
|
||||||
border: 1.6px solid #09ada3;
|
|
||||||
border-radius: 5px;
|
|
||||||
position: relative;
|
|
||||||
color: #333333;
|
|
||||||
float: left;
|
|
||||||
box-sizing: content-box;
|
|
||||||
min-width: 60px;
|
|
||||||
width: auto;
|
|
||||||
&::before {
|
|
||||||
display: block;
|
|
||||||
content: "";
|
|
||||||
top: -7px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
position: absolute;
|
|
||||||
width: 45%;
|
|
||||||
height: 0;
|
|
||||||
border-bottom: 7px solid #09ada3;
|
|
||||||
border-left: 5px solid transparent;
|
|
||||||
border-right: 5px solid transparent;
|
|
||||||
}
|
|
||||||
&.minwd {
|
|
||||||
border-color: #3794ff;
|
|
||||||
.wd {
|
|
||||||
color: #3794ff;
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
border-bottom-color: #3794ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.maxwd {
|
|
||||||
border-color: #ff3a3b;
|
|
||||||
.wd {
|
|
||||||
color: #ff3a3b;
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
border-bottom-color: #ff3a3b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.mindy {
|
|
||||||
border-color: #de6902;
|
|
||||||
.dy {
|
|
||||||
color: #de6902;
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
border-bottom-color: #de6902;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.maxdy {
|
|
||||||
border-color: #ffb521;
|
|
||||||
.dy {
|
|
||||||
color: #ffb521;
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
border-bottom-color: #ffb521;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.dtdc-pagination {
|
|
||||||
::v-deep {
|
|
||||||
.el-button {
|
|
||||||
padding: 2px 10px !important;
|
|
||||||
font-size: 11px;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
.activeBtn {
|
|
||||||
background-color: #09ada3;
|
|
||||||
border-color: #09ada3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-table
|
|
||||||
class="common-table"
|
|
||||||
:data="tableData"
|
|
||||||
stripe
|
|
||||||
style="width: 100%; margin-top: 25px"
|
|
||||||
>
|
|
||||||
<el-table-column prop="deviceId" label="单体编号"></el-table-column>
|
|
||||||
<el-table-column prop="clusterDeviceId" label="簇号"></el-table-column>
|
|
||||||
<el-table-column prop="voltage" label="电压 (V)">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
@click="chartDetail(scope.row, '电压 (V)')"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ scope.row.voltage }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="temperature" label="温度 (℃)">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
@click="chartDetail(scope.row, '温度 (℃)')"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ scope.row.temperature }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="soc" label="SOC (%)">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
@click="chartDetail(scope.row, 'SOC (%)')"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ scope.row.soc }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="soh" label="SOH (%)">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
@click="chartDetail(scope.row, 'SOH (%)')"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
{{ scope.row.soh }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="160">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button @click="$emit('pointDetail',scope.row,'point')" type="text" size="small">
|
|
||||||
详细
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="$emit('pointDetail',scope.row,'alarmPoint')" type="text" size="small">
|
|
||||||
报警点位详细
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<!-- <el-pagination
|
|
||||||
v-show="tableData.length > 0"
|
|
||||||
background
|
|
||||||
@size-change="(val) => $emit('handleSizeChange', val)"
|
|
||||||
@current-change="(val) => $emit('handleCurrentChange', val)"
|
|
||||||
: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>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
tableData: {
|
|
||||||
require: true,
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
pointIdList: {
|
|
||||||
require: true,
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
totalSize: {
|
|
||||||
require: true,
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
// pageNum: {
|
|
||||||
// require: true,
|
|
||||||
// type: Number,
|
|
||||||
// default: 1,
|
|
||||||
// },
|
|
||||||
// pageSize: {
|
|
||||||
// require: true,
|
|
||||||
// type: Number,
|
|
||||||
// default: 10,
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//查看表格行图表
|
|
||||||
chartDetail(row, dataType = "") {
|
|
||||||
this.$emit("chart", {...row, dataType});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style></style>
|
|
||||||
@ -1,95 +1,110 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<el-card v-loading="loading" shadow="always" class="common-card-container common-card-container-no-title-bg">
|
||||||
v-loading="loading"
|
|
||||||
shadow="always"
|
|
||||||
class="sbjk-card-container common-card-container-no-title-bg running-card-container"
|
|
||||||
>
|
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span class="large-title">单体电池实时数据</span>
|
<span class="large-title">单体电池实时数据</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索栏-->
|
<!-- 搜索栏-->
|
||||||
<el-form :inline="true" class="select-container">
|
<el-form :inline="true" class="select-container">
|
||||||
<el-form-item label="编号">
|
|
||||||
<el-input
|
|
||||||
v-model="search.batteryId"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="电池堆">
|
<el-form-item label="电池堆">
|
||||||
<el-select
|
<el-select v-model="search.stackId" placeholder="请选择" @change="changeStackId">
|
||||||
v-model="search.stackId"
|
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in stackOptions" :key="index+'stackOptions'"></el-option>
|
||||||
placeholder="请选择"
|
|
||||||
@change="changeStackId"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
:label="item.deviceName"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="(item, index) in stackOptions"
|
|
||||||
:key="index + 'stackOptions'"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="电池簇">
|
<el-form-item label="电池簇">
|
||||||
<el-select
|
<el-select v-model="search.clusterId" :no-data-text="!search.stackId && stackOptions.length > 0 ? '请先选择电池堆':'无数据'" placeholder="请选择" :loading="clusterloading" loading-text="正在加载数据">
|
||||||
v-model="search.clusterId"
|
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in clusterOptions" :key="index+'clusterOptions'"></el-option>
|
||||||
:no-data-text="
|
|
||||||
!search.stackId && stackOptions.length > 0
|
|
||||||
? '请先选择电池堆'
|
|
||||||
: '无数据'
|
|
||||||
"
|
|
||||||
placeholder="请选择"
|
|
||||||
:loading="clusterloading"
|
|
||||||
loading-text="正在加载数据"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
:label="item.deviceName"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="(item, index) in clusterOptions"
|
|
||||||
:key="index + 'clusterOptions'"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSearch" native-type="button"
|
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
||||||
>搜索</el-button
|
|
||||||
>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="onReset" native-type="button">重置</el-button>
|
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 切换 -->
|
<!-- 图表-->
|
||||||
<div class="tip-container">
|
<!-- <div style="margin:30px 0;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);">-->
|
||||||
<div class="color-tip" v-show="activeBtn === 'list'">
|
<!-- <el-row style="background:#fff;margin:30px 0;">-->
|
||||||
单体信息
|
<!-- <el-col :xs="24" :sm="24" :lg="24">-->
|
||||||
<span class="tip minwd">最低单体温度</span>
|
<!-- <bar-chart ref="barChart"/>-->
|
||||||
<span class="tip maxwd">最高单体温度</span>
|
<!-- </el-col>-->
|
||||||
<span class="tip mindy">单体最低电压</span>
|
<!-- </el-row>-->
|
||||||
<span class="tip maxdy">单体最高电压</span>
|
<!-- </div>-->
|
||||||
</div>
|
<el-table
|
||||||
<el-button-group class="ems-btns-group">
|
class="common-table"
|
||||||
<el-button
|
:data="tableData"
|
||||||
:class="{ activeBtn: activeBtn === 'table' }"
|
stripe
|
||||||
@click="changeMenu('table')"
|
style="width: 100%;margin-top: 25px">
|
||||||
>图表</el-button
|
<el-table-column
|
||||||
|
prop="deviceId"
|
||||||
|
label="单体编号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="clusterDeviceId"
|
||||||
|
label="簇号">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="voltage"
|
||||||
|
label="电压(V)"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
:class="{ activeBtn: activeBtn === 'list' }"
|
@click="chartDetail(scope.row,'voltage')"
|
||||||
@click="changeMenu('list')"
|
type="text"
|
||||||
>图形</el-button
|
size="small">
|
||||||
>
|
{{scope.row.voltage}}
|
||||||
</el-button-group>
|
</el-button>
|
||||||
</div>
|
</template>
|
||||||
<component
|
</el-table-column>
|
||||||
:is="activeBtn === 'table' ? 'DtdcTable' : 'DtdcList'"
|
<el-table-column
|
||||||
:tableData="tableData"
|
prop="temperature"
|
||||||
:totalSize="totalSize"
|
label="温度(℃)">
|
||||||
:pointIdList="pointIdList"
|
<template slot-scope="scope">
|
||||||
@chart="chartDetail"
|
<el-button
|
||||||
@pointDetail="pointDetail"
|
@click="chartDetail(scope.row,'temperature')"
|
||||||
></component>
|
type="text"
|
||||||
|
size="small">
|
||||||
|
{{scope.row.temperature}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="soc"
|
||||||
|
label="SOC(%)">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="chartDetail(scope.row,'soc')"
|
||||||
|
type="text"
|
||||||
|
size="small">
|
||||||
|
{{scope.row.soc}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="soh"
|
||||||
|
label="SOH(%)">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="chartDetail(scope.row,'soh')"
|
||||||
|
type="text"
|
||||||
|
size="small">
|
||||||
|
{{scope.row.soh}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="曲线图">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="chartDetail(scope.row)"
|
||||||
|
type="text"
|
||||||
|
size="small">
|
||||||
|
展示
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
v-show="tableData.length>0"
|
v-show="tableData.length>0"
|
||||||
background
|
background
|
||||||
@ -104,251 +119,106 @@
|
|||||||
>
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<chart-detail ref="chartDetail"/>
|
<chart-detail ref="chartDetail"/>
|
||||||
<point-chart ref="pointChart" :site-id="siteId" />
|
|
||||||
<point-table ref="pointTable"/>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BarChart from "./BarChart";
|
import BarChart from './BarChart'
|
||||||
import {
|
import {getStackNameList, getClusterNameList, getClusterDataInfoList} from '@/api/ems/dzjk'
|
||||||
getStackNameList,
|
|
||||||
getClusterNameList,
|
|
||||||
getClusterDataInfoList,
|
|
||||||
} from "@/api/ems/dzjk";
|
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import ChartDetail from "./ChartDetail.vue";
|
import ChartDetail from "./ChartDetail.vue";
|
||||||
import Table from "./Table.vue";
|
|
||||||
import List from "./List.vue";
|
|
||||||
import pointChart from "./../PointChart.vue";
|
|
||||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
|
||||||
export default {
|
export default {
|
||||||
name: "DzjkSbjkDtdc",
|
name:'DzjkSbjkDtdc',
|
||||||
mixins:[getQuerySiteId],
|
mixins:[getQuerySiteId],
|
||||||
components: {
|
components:{BarChart, ChartDetail},
|
||||||
PointTable,
|
|
||||||
BarChart,
|
|
||||||
ChartDetail,
|
|
||||||
DtdcTable: Table,
|
|
||||||
DtdcList: List,
|
|
||||||
pointChart,
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
pointIdList() {
|
|
||||||
let obj = {};
|
|
||||||
this.pointData.forEach((item) => {
|
|
||||||
const {
|
|
||||||
maxCellTempId,
|
|
||||||
maxCellVoltageId,
|
|
||||||
minCellTempId,
|
|
||||||
minCellVoltageId,
|
|
||||||
} = item;
|
|
||||||
obj[item.clusterId] = [
|
|
||||||
parseInt(minCellTempId || 0),
|
|
||||||
parseInt(maxCellTempId || 0),
|
|
||||||
parseInt(minCellVoltageId || 0),
|
|
||||||
parseInt(maxCellVoltageId || 0),
|
|
||||||
]; //最低单体温度 最高温度 最低电压 最高电压 todo 这里的顺序需要和图形组件里的顺序保持一致,
|
|
||||||
});
|
|
||||||
return obj;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
clusterloading:false,
|
clusterloading:false,
|
||||||
search: { stackId: "", clusterId: "", batteryId: "" },
|
search:{stackId:'',clusterId:''},
|
||||||
stackOptions:[],//{id:'',deviceName:''}
|
stackOptions:[],//{id:'',deviceName:''}
|
||||||
clusterOptions:[],//{id:'',deviceName:''}
|
clusterOptions:[],//{id:'',deviceName:''}
|
||||||
tableData:[],
|
tableData:[],
|
||||||
pointData: [],
|
pageSize:10,//分页栏当前每个数据总数
|
||||||
pageSize: 40, //分页栏当前每个数据总数
|
|
||||||
pageNum:1,//分页栏当前页数
|
pageNum:1,//分页栏当前页数
|
||||||
totalSize:0,//table表格数据总数
|
totalSize:0,//table表格数据总数
|
||||||
activeBtn: "table",
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
// 查看设备电位表格
|
|
||||||
pointDetail(row,dataType){
|
|
||||||
const {deviceId,clusterDeviceId} = row
|
|
||||||
this.$refs.pointTable.showTable({siteId:this.siteId,deviceId,deviceCategory:'BATTERY',parentId:clusterDeviceId},dataType)
|
|
||||||
},
|
|
||||||
changeMenu(menu) {
|
|
||||||
const { activeBtn } = this;
|
|
||||||
activeBtn !== menu && (this.activeBtn = menu);
|
|
||||||
},
|
|
||||||
//查看表格行图表
|
//查看表格行图表
|
||||||
chartDetail({ deviceId, clusterDeviceId, dataType = "" }) {
|
chartDetail(row,dataType = ''){
|
||||||
dataType &&
|
const { clusterDeviceId, deviceId} = row,{siteId} = this
|
||||||
this.$refs.pointChart.showChart({
|
this.$refs.chartDetail.initChart({siteId,clusterDeviceId,deviceId},dataType)
|
||||||
pointName: dataType,
|
|
||||||
deviceCategory:'BATTERY',
|
|
||||||
deviceId: clusterDeviceId,
|
|
||||||
child: [deviceId],
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 分页
|
// 分页
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.pageSize = val;
|
this.pageSize = val;
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.getTableData();
|
this.getTableData()
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.pageNum = val;
|
this.pageNum = val
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.getTableData();
|
this.getTableData()
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
// 搜索
|
// 搜索
|
||||||
onSearch(){
|
onSearch(){
|
||||||
this.pageNum = 1; //每次搜索从1开始搜索
|
this.pageNum =1//每次搜索从1开始搜索
|
||||||
this.getTableData();
|
this.getTableData()
|
||||||
},
|
},
|
||||||
// 重置
|
// 重置
|
||||||
// 清空搜索栏选中数据
|
// 清空搜索栏选中数据
|
||||||
// 清空电池簇列表,保留电池堆列表
|
// 清空电池簇列表,保留电池堆列表
|
||||||
onReset(){
|
onReset(){
|
||||||
this.search = { stackId: "", clusterId: "", batteryId: "" };
|
this.search={stackId:'',clusterId:''}
|
||||||
this.clusterOptions = [];
|
this.clusterOptions=[]
|
||||||
this.pageNum = 1;
|
this.pageNum = 1
|
||||||
this.getTableData();
|
this.getTableData()
|
||||||
},
|
},
|
||||||
changeStackId(val){
|
changeStackId(val){
|
||||||
if(val){
|
if(val){
|
||||||
console.log(
|
console.log('选择了电池堆,需要获取对应的电池簇',val,this.search.stackId)
|
||||||
"选择了电池堆,需要获取对应的电池簇",
|
this.search.clusterId=''
|
||||||
val,
|
this.getClusterList()
|
||||||
this.search.stackId
|
|
||||||
);
|
|
||||||
this.search.clusterId = "";
|
|
||||||
this.getClusterList();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//表格数据
|
//表格数据
|
||||||
getTableData(){
|
getTableData(){
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
const {
|
const {stackId:stackDeviceId,clusterId:clusterDeviceId} =this.search
|
||||||
stackId: stackDeviceId,
|
const {siteId,pageNum,pageSize}=this
|
||||||
clusterId: clusterDeviceId,
|
getClusterDataInfoList({stackDeviceId,clusterDeviceId,siteId,pageNum,pageSize}).then(response => {
|
||||||
batteryId,
|
this.tableData=response?.rows || [];
|
||||||
} = this.search;
|
this.totalSize = response?.total || 0
|
||||||
const { siteId, pageNum, pageSize } = this;
|
}).finally(()=>{
|
||||||
getClusterDataInfoList({
|
|
||||||
stackDeviceId,
|
|
||||||
clusterDeviceId,
|
|
||||||
siteId,
|
|
||||||
batteryId,
|
|
||||||
pageNum,
|
|
||||||
pageSize,
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.tableData = response?.rows?.[0]?.batteryList || []; //todo check
|
|
||||||
this.pointData = response?.rows?.[0]?.clusterList || []; //todo check
|
|
||||||
this.totalSize = response?.total || 0;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading=false;
|
this.loading=false;
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
getStackList(){
|
getStackList(){
|
||||||
getStackNameList(this.siteId).then((response) => {
|
getStackNameList(this.siteId).then(response => {
|
||||||
this.stackOptions = JSON.parse(JSON.stringify(response?.data || []));
|
this.stackOptions = JSON.parse(JSON.stringify(response?.data || []))
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
getClusterList(){
|
getClusterList(){
|
||||||
this.clusterloading = true;
|
this.clusterloading =true
|
||||||
getClusterNameList({
|
getClusterNameList(this.search.stackId).then(response => {
|
||||||
stackDeviceId: this.search.stackId,
|
this.clusterOptions = JSON.parse(JSON.stringify(response?.data || []))
|
||||||
siteId: this.siteId,
|
}).finally(() => {this.clusterloading =false})
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.clusterOptions = JSON.parse(
|
|
||||||
JSON.stringify(response?.data || [])
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.clusterloading = false;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
// 只有页面初次加载或切换站点的时候调用电池堆列表,其他情况不需要
|
// 只有页面初次加载或切换站点的时候调用电池堆列表,其他情况不需要
|
||||||
this.search = { stackId: "", clusterId: "", batteryId: "" }; //保证切换站点时,清空选择项
|
this.search={stackId:'',clusterId:''}//保证切换站点时,清空选择项
|
||||||
this.clusterOptions = [];
|
this.getStackList()
|
||||||
this.pageNum = 1;
|
this.getTableData()
|
||||||
this.totalSize = 0;
|
}
|
||||||
this.getStackList();
|
|
||||||
this.getTableData();
|
|
||||||
},
|
},
|
||||||
},
|
mounted(){
|
||||||
mounted() {},
|
|
||||||
};
|
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
|
||||||
.tip-container {
|
|
||||||
text-align: right;
|
|
||||||
position: relative;
|
|
||||||
.color-tip {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 0;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
font-size: 11px;
|
|
||||||
line-height: 12px;
|
|
||||||
color: #333;
|
|
||||||
.tip {
|
|
||||||
padding-left: 30px;
|
|
||||||
position: relative;
|
|
||||||
&::before {
|
|
||||||
display: block;
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 14px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
&.minwd {
|
|
||||||
color: #3794ff;
|
|
||||||
&::before {
|
|
||||||
background: #3794ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.maxwd {
|
|
||||||
color: #ff3a3b;
|
|
||||||
&::before {
|
|
||||||
background: #ff3a3b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.mindy {
|
|
||||||
color: #de6902;
|
|
||||||
&::before {
|
|
||||||
background: #de6902;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.maxdy {
|
|
||||||
color: #ffb521;
|
|
||||||
&::before {
|
|
||||||
background: #ffb521;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
::v-deep {
|
|
||||||
.el-button-group.ems-btns-group {
|
|
||||||
& > .el-button {
|
|
||||||
padding: 5px 30px !important;
|
|
||||||
font-size: 11px;
|
|
||||||
line-height: 16px;
|
|
||||||
// padding-left: 50px;
|
|
||||||
// padding-right: 50px;
|
|
||||||
// font-size: 16px;
|
|
||||||
// line-height: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -1,133 +0,0 @@
|
|||||||
<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,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="ems-dashboard-editor-container ems-third-menu-container" v-loading="loading">
|
<div class="ems-dashboard-editor-container ems-content-container-padding sbjk-ems-dashboard-editor-container">
|
||||||
<el-menu
|
<el-menu
|
||||||
class="ems-third-menu"
|
class="ems-third-menu"
|
||||||
:default-active="$route.name"
|
:default-active="$route.name"
|
||||||
@ -7,7 +7,7 @@
|
|||||||
text-color="#666666"
|
text-color="#666666"
|
||||||
active-text-color="#ffffff"
|
active-text-color="#ffffff"
|
||||||
>
|
>
|
||||||
<el-menu-item :index="item.name" v-for="(item,index) in categoryRouter" :key="index+'dzjkChildrenRoute'">
|
<el-menu-item :index="item.name" v-for="(item,index) in childrenRoute" :key="index+'dzjkChildrenRoute'">
|
||||||
<router-link style="height: 100%;width: 100%;display: block" :to="{path:item.path,query:$route.query}">
|
<router-link style="height: 100%;width: 100%;display: block" :to="{path:item.path,query:$route.query}">
|
||||||
{{item.meta.title}}
|
{{item.meta.title}}
|
||||||
</router-link>
|
</router-link>
|
||||||
@ -23,48 +23,29 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
|
||||||
import { dzjk } from '@/router/ems'
|
import { dzjk } from '@/router/ems'
|
||||||
import {mapState} from "vuex";
|
const childrenRoute = dzjk[0].children.find(item=> item.name==='DzjkSbjk').children//获取到单站监控-设备监控下面的字路由
|
||||||
const childrenRoute = dzjk[0].children[0].children.find(item=> item.name==='DzjkSbjk').children//获取到单站监控-设备监控下面的字路由
|
console.log('设备监控子路由',childrenRoute)
|
||||||
export default {
|
export default {
|
||||||
name:'DzjkSbjk',
|
name:'DzjkSbjk',
|
||||||
mixins:[getQuerySiteId],
|
|
||||||
computed:{
|
|
||||||
...mapState({
|
|
||||||
zdDeviceCategoryOptions: state => state.ems.zdDeviceCategoryOptions,
|
|
||||||
}),
|
|
||||||
locationSiteCategory(){
|
|
||||||
return this.zdDeviceCategoryOptions[this.siteId] || []
|
|
||||||
},
|
|
||||||
categoryRouter(){
|
|
||||||
const routeData =this.childrenRoute.filter(item=>this.locationSiteCategory.includes(item.meta.deviceCategory))
|
|
||||||
if(this.siteId && routeData.length > 0 && this.locationSiteCategory && this.locationSiteCategory.length >1){
|
|
||||||
const locationPageDeviceCategory = this.$route.meta?.deviceCategory || ''
|
|
||||||
if(!routeData.some(item=> item.meta.deviceCategory===locationPageDeviceCategory)){
|
|
||||||
this.$router.replace({path:'/dzjk/sbjk/ssyx',query:this.$route.query})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return routeData
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
childrenRoute,
|
childrenRoute,
|
||||||
activeMenu:'',
|
activeMenu:''
|
||||||
loading:false,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
mounted() {
|
||||||
init(){
|
console.log('当前设备监控页面路由',this.$route)
|
||||||
this.loading=true
|
|
||||||
this.$store.dispatch('getSiteDeviceCategory',this.siteId).finally(()=>this.loading=false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.sbjk-ems-dashboard-editor-container{
|
||||||
|
display: flex;
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
.sbjk-ems-content-container{
|
.sbjk-ems-content-container{
|
||||||
margin-top:0;
|
margin-top:0;
|
||||||
padding-top:0;
|
padding-top:0;
|
||||||
|
|||||||
@ -1,324 +1,208 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading" class="pcs-ems-dashboard-editor-container">
|
<div class="pcs-ems-dashboard-editor-container" v-loading="loading">
|
||||||
<!-- 顶部六个方块-->
|
<!-- 顶部六个方块-->
|
||||||
<real-time-base-info :data="runningHeadData"/>
|
<real-time-base-info :data="runningHeadData"/>
|
||||||
<div
|
<!-- 内容-->
|
||||||
v-for="(pcsItem, pcsIndex) in pcsList"
|
<el-container class="pcs-container" v-for="(pcsItem,pcsIndex) in pcsList" :key="pcsIndex+'PcsHome'">
|
||||||
:key="pcsIndex + 'PcsHome'"
|
<!-- 背景颜色根据工作状态来展示-->
|
||||||
style="margin-bottom: 25px"
|
<el-header class="pcs-header" :class="pcsItem.workStatus === '1' ? 'warn' : pcsItem.workStatus === '2' ? 'close' : ''">
|
||||||
>
|
<div class="pcs-title">{{pcsItem.deviceName}}</div>
|
||||||
<el-card
|
<div class="pcs-status">
|
||||||
:class="handleCardClass(pcsItem)"
|
<div>{{$store.state.ems.communicationStatusOptions[pcsItem.communicationStatus]}}</div>
|
||||||
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
|
|
||||||
>
|
|
||||||
<div class="info">
|
|
||||||
<div>
|
|
||||||
{{
|
|
||||||
$store.state.ems.communicationStatusOptions[
|
|
||||||
pcsItem.communicationStatus
|
|
||||||
]
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
<div>数据更新时间:{{pcsItem.dataUpdateTime}}</div>
|
<div>数据更新时间:{{pcsItem.dataUpdateTime}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="alarm">
|
<!-- <div class="pcs-btns">-->
|
||||||
<el-button type="primary" round size="small" style="margin-right:20px;"
|
<!-- <el-button type="warning" size="small" @click="problemSaved">故障复位</el-button>-->
|
||||||
@click="pointDetail(pcsItem,'point')">
|
<!-- <el-button size="small" @click="machineClosed">关机</el-button>-->
|
||||||
详细
|
<!-- </div>-->
|
||||||
</el-button>
|
</el-header>
|
||||||
<el-badge :hidden="!pcsItem.alarmNum" :value="pcsItem.alarmNum || 0" class="item">
|
<el-main style="padding: 0">
|
||||||
<i
|
|
||||||
class="el-icon-message-solid alarm-icon"
|
|
||||||
@click="pointDetail(pcsItem,'alarmPoint')"
|
|
||||||
></i>
|
|
||||||
</el-badge>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="descriptions-main">
|
<div class="descriptions-main">
|
||||||
<el-descriptions :colon="false" :column="4" direction="vertical">
|
<el-descriptions direction="vertical" :column="4" :colon="false">
|
||||||
<el-descriptions-item
|
<el-descriptions-item labelClassName="descriptions-label" :contentClassName="`descriptions-direction ${pcsItem.workStatus === '0' ? 'save' :'danger'}`" :span="1" label="工作状态">{{$store.state.ems.workStatusOptions[pcsItem.workStatus]}}</el-descriptions-item>
|
||||||
contentClassName="descriptions-direction work-status"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="并网状态">{{$store.state.ems.gridStatusOptions[pcsItem.gridStatus]}}</el-descriptions-item>
|
||||||
:span="1"
|
<el-descriptions-item labelClassName="descriptions-label" :contentClassName="`descriptions-direction ${pcsItem.deviceStatus === '0' ? 'save' : 'danger'}`" :span="1" label="设备状态">{{$store.state.ems.deviceStatusOptions[pcsItem.deviceStatus]}}</el-descriptions-item>
|
||||||
label="工作状态"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="控制模式">{{$store.state.ems.controlModeOptions[pcsItem.controlMode]}}</el-descriptions-item>
|
||||||
labelClassName="descriptions-label"
|
|
||||||
>{{
|
|
||||||
PCSWorkStatusOptions[pcsItem.workStatus]
|
|
||||||
}}
|
|
||||||
</el-descriptions-item
|
|
||||||
>
|
|
||||||
<el-descriptions-item
|
|
||||||
:span="1"
|
|
||||||
contentClassName="descriptions-direction"
|
|
||||||
label="并网状态"
|
|
||||||
labelClassName="descriptions-label"
|
|
||||||
>{{
|
|
||||||
$store.state.ems.gridStatusOptions[pcsItem.gridStatus]
|
|
||||||
}}
|
|
||||||
</el-descriptions-item
|
|
||||||
>
|
|
||||||
<el-descriptions-item
|
|
||||||
:contentClassName="`descriptions-direction ${
|
|
||||||
pcsItem.deviceStatus === '1' ? 'save' : 'danger'
|
|
||||||
}`"
|
|
||||||
:span="1"
|
|
||||||
label="设备状态"
|
|
||||||
labelClassName="descriptions-label"
|
|
||||||
>{{
|
|
||||||
$store.state.ems.deviceStatusOptions[pcsItem.deviceStatus]
|
|
||||||
}}
|
|
||||||
</el-descriptions-item
|
|
||||||
>
|
|
||||||
<el-descriptions-item
|
|
||||||
:span="1"
|
|
||||||
contentClassName="descriptions-direction"
|
|
||||||
label="控制模式"
|
|
||||||
labelClassName="descriptions-label"
|
|
||||||
>{{
|
|
||||||
$store.state.ems.controlModeOptions[pcsItem.controlMode]
|
|
||||||
}}
|
|
||||||
</el-descriptions-item
|
|
||||||
>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
<div class="descriptions-main descriptions-main-bg-color">
|
<div class="descriptions-main descriptions-main-bg-color">
|
||||||
<el-descriptions
|
<el-descriptions labelClassName="descriptions-label" contentClassName="descriptions-direction" direction="vertical" :column="4" :colon="false">
|
||||||
:colon="false"
|
<el-descriptions-item v-for="(item,index) in infoData" :key="index+'pcsInfoData'" :span="1" :label="item.label">{{pcsItem[item.attr] | formatNumber}} <span v-if="item.unit" v-html="item.unit"></span></el-descriptions-item>
|
||||||
: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"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
class="pointer"
|
|
||||||
@click="
|
|
||||||
showChart(item.pointName || '', pcsItem.deviceId)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ pcsItem[item.attr] | formatNumber }}
|
|
||||||
<span v-if="item.unit" v-html="item.unit"></span>
|
|
||||||
</span>
|
|
||||||
</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="descriptions-main" v-for="(item,index) in pcsItem.pcsBranchInfoList" :key="index+'pcsBranchInfoList'">
|
||||||
v-for="(item, index) in pcsItem.pcsBranchInfoList"
|
<el-descriptions labelClassName="descriptions-label" contentClassName="descriptions-direction keep" direction="vertical" :column="4" :colon="false">
|
||||||
:key="index + 'pcsBranchInfoList'"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction keep" :span="4" :label="'支路'+(index+1)">{{item.dischargeStatus}}</el-descriptions-item>
|
||||||
class="descriptions-main"
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="直流功率">{{item.dcPower}}kW</el-descriptions-item>
|
||||||
>
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="直流电压">{{item.dcVoltage}}V</el-descriptions-item>
|
||||||
<el-descriptions
|
<el-descriptions-item labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" label="直流电流">{{item.dcCurrent}}A</el-descriptions-item>
|
||||||
: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
|
|
||||||
>
|
|
||||||
<el-descriptions-item
|
|
||||||
:span="1"
|
|
||||||
contentClassName="descriptions-direction"
|
|
||||||
label="直流功率"
|
|
||||||
labelClassName="descriptions-label"
|
|
||||||
>
|
|
||||||
<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
|
|
||||||
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
|
|
||||||
class="pointer"
|
|
||||||
@click="showChart('直流电流', item.deviceId,true)"
|
|
||||||
>{{ item.dcCurrent }}A</span
|
|
||||||
>
|
|
||||||
</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-main>
|
||||||
</div>
|
</el-container>
|
||||||
<el-empty v-show="pcsList.length<=0" :image-size="200"></el-empty>
|
<el-empty v-show="pcsList.length<=0" :image-size="200"></el-empty>
|
||||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
|
||||||
<point-table ref="pointTable"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import pointChart from "./../PointChart.vue";
|
|
||||||
import PointTable from "@/views/ems/site/sblb/PointTable.vue";
|
|
||||||
import RealTimeBaseInfo from "./../RealTimeBaseInfo.vue";
|
import RealTimeBaseInfo from "./../RealTimeBaseInfo.vue";
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getPcsDetailInfo, getRunningHeadInfo} from "@/api/ems/dzjk";
|
import {getRunningHeadInfo,getPcsDetailInfo} from '@/api/ems/dzjk'
|
||||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
|
||||||
import {mapState} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DzjkSbjkPcs",
|
name:'DzjkSbjkPcs',
|
||||||
components: {RealTimeBaseInfo, pointChart, PointTable},
|
components:{RealTimeBaseInfo},
|
||||||
mixins: [getQuerySiteId, intervalUpdate],
|
mixins:[getQuerySiteId],
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
PCSWorkStatusOptions: state => state?.ems?.PCSWorkStatusOptions || {},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
runningHeadData:{},//运行信息
|
runningHeadData:{},//运行信息
|
||||||
pcsList:[],
|
pcsList:[],
|
||||||
infoData:[
|
infoData:[
|
||||||
{
|
{label:'总交流有功电率',attr:'totalActivePower',unit:'kW'},
|
||||||
label: "总交流有功功率",
|
{label:'当天交流充电量',attr:'dailyAcChargeEnergy',unit:'kWh'},
|
||||||
attr: "totalActivePower",
|
{label:'A相电压',attr:'aPhaseVoltage',unit:'V'},
|
||||||
unit: "kW",
|
{label:'A相电流',attr:'aPhaseCurrent',unit:'A'},
|
||||||
pointName: "总交流有功功率",
|
{label:'总交流无功电率',attr:'totalReactivePower',unit:'kVar'},
|
||||||
},
|
{label:'当天交流放电量',attr:'dailyAcDischargeEnergy',unit:'kWh'},
|
||||||
{
|
{label:'B相电压',attr:'bPhaseVoltage',unit:'V'},
|
||||||
label: "当天交流充电量",
|
{label:'B相电流',attr:'bPhaseCurrent',unit:'A'},
|
||||||
attr: "dailyAcChargeEnergy",
|
{label:'总交流视在功率',attr:'totalApparentPower',unit:'kVA'},
|
||||||
unit: "kWh",
|
{label:'PCS模块温度',attr:'pcsModuleTemperature',unit:'℃'},
|
||||||
pointName: "当天交流充电量 (kWh)",
|
{label:'C相电压',attr:'cPhaseVoltage',unit:'V'},
|
||||||
},
|
{label:'C相电流',attr:'cPhaseCurrent',unit:'A'},
|
||||||
{label: "A相电压", attr: "aPhaseVoltage", unit: "V", pointName: ""},
|
{label:'总交流功率因数',attr:'totalPowerFactor',unit:''},
|
||||||
{
|
{label:'PCS环境温度',attr:'pcsEnvironmentTemperature',unit:'℃'},
|
||||||
label: "A相电流",
|
{label:'交流频率',attr:'acFrequency',unit:'Hz'}
|
||||||
attr: "aPhaseCurrent",
|
|
||||||
unit: "A",
|
|
||||||
pointName: "A相电流",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "总交流无功功率",
|
|
||||||
attr: "totalReactivePower",
|
|
||||||
unit: "kVar",
|
|
||||||
pointName: "总交流无功功率",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "当天交流放电量",
|
|
||||||
attr: "dailyAcDischargeEnergy",
|
|
||||||
unit: "kWh",
|
|
||||||
pointName: "当天交流放电量 (kWh)",
|
|
||||||
},
|
|
||||||
{label: "B相电压", attr: "bPhaseVoltage", unit: "V", pointName: ""},
|
|
||||||
{
|
|
||||||
label: "B相电流",
|
|
||||||
attr: "bPhaseCurrent",
|
|
||||||
unit: "A",
|
|
||||||
pointName: "B相电流",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "总交流视在功率",
|
|
||||||
attr: "totalApparentPower",
|
|
||||||
unit: "kVA",
|
|
||||||
pointName: "总交流视在功率",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "PCS模块温度",
|
|
||||||
attr: "pcsModuleTemperature",
|
|
||||||
unit: "℃",
|
|
||||||
pointName: "",
|
|
||||||
},
|
|
||||||
{label: "C相电压", attr: "cPhaseVoltage", unit: "V", pointName: ""},
|
|
||||||
{
|
|
||||||
label: "C相电流",
|
|
||||||
attr: "cPhaseCurrent",
|
|
||||||
unit: "A",
|
|
||||||
pointName: "C相电流",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "总交流功率因数",
|
|
||||||
attr: "totalPowerFactor",
|
|
||||||
unit: "",
|
|
||||||
pointName: "总交流功率因数",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "PCS环境温度",
|
|
||||||
attr: "pcsEnvironmentTemperature",
|
|
||||||
unit: "℃",
|
|
||||||
pointName: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "交流频率",
|
|
||||||
attr: "acFrequency",
|
|
||||||
unit: "Hz",
|
|
||||||
pointName: "交流频率",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
pcsBranchList:[],//pcs的支路列表
|
pcsBranchList:[],//pcs的支路列表
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
handleCardClass(item) {
|
problemSaved(){
|
||||||
const {workStatus = ''} = item
|
this.$confirm('确认故障已复位?', {
|
||||||
return workStatus === '1' || !Object.keys(this.PCSWorkStatusOptions).find(i => i === workStatus) ? "timing-card-container" : workStatus === '2' ? 'warning-card-container' : 'running-card-container'
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
showClose:false,
|
||||||
|
closeOnClickModal:false,
|
||||||
|
type: 'warning',
|
||||||
|
beforeClose: (action, instance, done) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
instance.confirmButtonLoading = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
// todo 调用接口如果关机成功 调用done方法 否则不关闭弹窗
|
||||||
|
done();
|
||||||
|
// setTimeout(() => {
|
||||||
|
instance.confirmButtonLoading = false;
|
||||||
|
// }, 300);
|
||||||
|
}, 3000);
|
||||||
|
} else {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
//只有在故障复位成功的情况下会走到这里
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '故障复位成功!'
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
//取消复位
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 查看设备电位表格
|
machineClosed(){
|
||||||
pointDetail(row, dataType) {
|
this.$confirm('确认要关机吗?', {
|
||||||
const {deviceId} = row
|
confirmButtonText: '确定',
|
||||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'PCS'}, dataType)
|
cancelButtonText: '取消',
|
||||||
},
|
showClose:false,
|
||||||
showChart(pointName, deviceId, isBranch = false) {
|
closeOnClickModal:false,
|
||||||
pointName &&
|
type: 'warning',
|
||||||
this.$refs.pointChart.showChart({pointName, deviceCategory: isBranch ? 'BRANCH' : 'PCS', deviceId});
|
beforeClose: (action, instance, done) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
instance.confirmButtonLoading = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
// todo 调用接口如果关机成功 调用done方法 否则不关闭弹窗
|
||||||
|
done();
|
||||||
|
// setTimeout(() => {
|
||||||
|
instance.confirmButtonLoading = false;
|
||||||
|
// }, 300);
|
||||||
|
}, 3000);
|
||||||
|
} else {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
//只有在关机成功的情况下会走到这里
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '关机成功!'
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
//取消关机
|
||||||
|
});
|
||||||
},
|
},
|
||||||
//6个方块数据
|
//6个方块数据
|
||||||
getRunningHeadData(){
|
getRunningHeadData(){
|
||||||
getRunningHeadInfo(this.siteId).then((response) => {
|
getRunningHeadInfo(this.siteId).then(response => {
|
||||||
this.runningHeadData = response?.data || {};
|
this.runningHeadData = response?.data || {}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
getPcsList(){
|
getPcsList(){
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
getPcsDetailInfo(this.siteId)
|
getPcsDetailInfo(this.siteId).then(response => {
|
||||||
.then((response) => {
|
const data = response?.data || {}
|
||||||
const data = response?.data || {};
|
this.pcsList = JSON.parse(JSON.stringify(data))
|
||||||
this.pcsList = JSON.parse(JSON.stringify(data));
|
}).finally(()=>this.loading = false)
|
||||||
})
|
|
||||||
.finally(() => (this.loading = false));
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.getRunningHeadData();
|
|
||||||
this.getPcsList();
|
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
this.updateData();
|
this.getRunningHeadData()
|
||||||
this.updateInterval(this.updateData);
|
this.getPcsList()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style scoped lang="scss">
|
||||||
|
.pcs-container{
|
||||||
|
margin-top: 25px;
|
||||||
|
border:1px solid #eeeeee;
|
||||||
|
border-radius: 6px 6px 0 0;
|
||||||
|
//红色标题
|
||||||
|
.pcs-header{
|
||||||
|
background: #05AEA3;
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 6px 6px 0 0;
|
||||||
|
.pcs-title{
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 20px;
|
||||||
|
padding: 0 50px 0 25px;
|
||||||
|
}
|
||||||
|
.pcs-status{
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
.pcs-btns{
|
||||||
|
position: absolute;
|
||||||
|
right: 25px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pcs-header.warn{
|
||||||
|
background-color:#FC6B69 ;
|
||||||
|
}
|
||||||
|
.pcs-header.close{
|
||||||
|
background-color:#666666 ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<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">
|
<div slot="header">
|
||||||
<span class="card-title">PCS有功功率/PCS无功功率</span>
|
<span class="card-title">储能功率曲线</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 360px" id="cnglqxChart"/>
|
<div style="height: 360px" id="cnglqxChart"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -12,133 +10,99 @@
|
|||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from '@/mixins/ems/resize'
|
||||||
import {storagePower} from "@/api/ems/dzjk";
|
import {formatDate} from "@/filters/ems";
|
||||||
|
import {storagePower} from '@/api/ems/dzjk'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.chart = echarts.init(document.querySelector("#cnglqxChart"));
|
this.chart = echarts.init(document.querySelector('#cnglqxChart'))
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(siteId, timeRange) {
|
init(siteId){
|
||||||
this.chart.showLoading();
|
this.chart.showLoading()
|
||||||
const [startTime = '', endTime = ''] = timeRange;
|
const x = []
|
||||||
storagePower(siteId, startTime, endTime)
|
const data1 =[],data2 =[]
|
||||||
.then((response) => {
|
storagePower(siteId).then(response => {
|
||||||
this.setOption(response?.data?.pcsPowerList || []);
|
const source = response?.data?.energyStoragePowList || []
|
||||||
|
source.forEach(item=>{
|
||||||
|
x.push(formatDate(item.createDate,false,true))
|
||||||
|
data1.push(item.pcsTotalActPower)
|
||||||
|
data2.push(item.pcsTotalReactivePower)
|
||||||
|
})
|
||||||
|
this.setOption(x,data1,data2)
|
||||||
|
}).finally(()=>{
|
||||||
|
this.chart.hideLoading()
|
||||||
})
|
})
|
||||||
.finally(() => {
|
|
||||||
this.chart.hideLoading();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(x,data1,data2) {
|
||||||
let xdata = [],
|
this.chart.setOption({
|
||||||
series = [];
|
color:['#FFBD00','#3C81FF'],
|
||||||
data.forEach((element, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
xdata = (element.energyStoragePowList || []).map((i) => i.createDate);
|
|
||||||
}
|
|
||||||
series.push(
|
|
||||||
{
|
|
||||||
type: "line",
|
|
||||||
name: `${element.deviceId}有功功率`,
|
|
||||||
areaStyle: {
|
|
||||||
// color:'#FFBD00'
|
|
||||||
},
|
|
||||||
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 || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
this.chart && this.chart.setOption({
|
|
||||||
legend: {
|
legend: {
|
||||||
left: "center",
|
left: 'center',
|
||||||
top: "5",
|
top: '10',
|
||||||
itemWidth: 10,
|
|
||||||
itemHeight: 5,
|
|
||||||
textStyle: {
|
|
||||||
fontSize: 9,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
containLabel: true,
|
left: "15%"
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
show: true,
|
trigger: 'axis',
|
||||||
trigger: "axis",
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
axisPointer: {
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
// 坐标轴指示器,坐标轴触发有效
|
|
||||||
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;">
|
|
||||||
<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>'
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: {type: "category", data: xdata},
|
xAxis: {type:'category',data:x},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataZoom: [
|
dataZoom: [
|
||||||
{
|
{
|
||||||
type: "inside",
|
type: 'inside',
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
series,
|
// POC昨日有功功率、POC昨日无功功率
|
||||||
}, true);
|
series: [
|
||||||
|
{
|
||||||
|
name:'POC实时有功功率',
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {
|
||||||
|
color:'#FFBD00'
|
||||||
},
|
},
|
||||||
|
data: data1,
|
||||||
|
},{
|
||||||
|
name:'POC实时无功功率',
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {
|
||||||
|
color: '#3C81FF'
|
||||||
},
|
},
|
||||||
};
|
data: data2
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<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">
|
<div slot="header">
|
||||||
<span class="card-title">平均SOC</span>
|
<span class="card-title">电池平均SOC</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 360px" id="dcpjsocChart"/>
|
<div style="height: 360px" id="dcpjsocChart"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -12,111 +10,90 @@
|
|||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from '@/mixins/ems/resize'
|
||||||
import { batteryAveSoc } from "@/api/ems/dzjk";
|
import {formatDate} from "@/filters/ems";
|
||||||
|
import {batteryAveSoc} from '@/api/ems/dzjk'
|
||||||
export default {
|
export default {
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.chart = echarts.init(document.querySelector("#dcpjsocChart"));
|
this.chart = echarts.init(document.querySelector('#dcpjsocChart'))
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(siteId,timeRange) {
|
init(siteId){
|
||||||
this.chart.showLoading();
|
this.chart.showLoading()
|
||||||
const [startTime='', endTime=''] = timeRange;
|
const x = []
|
||||||
batteryAveSoc(siteId,startTime,endTime)
|
const data =[]
|
||||||
.then((response) => {
|
batteryAveSoc(siteId).then(response => {
|
||||||
this.setOption(response?.data?.batteryAveSOCList || []);
|
const source = response?.data?.batteryAveSOCList || []
|
||||||
|
source.forEach(item=>{
|
||||||
|
x.push(formatDate(item.createDate,false,true))
|
||||||
|
data.push(item.batterySOC)
|
||||||
|
})
|
||||||
|
this.setOption(x,data)
|
||||||
|
}).finally(()=>{
|
||||||
|
this.chart.hideLoading()
|
||||||
})
|
})
|
||||||
.finally(() => {
|
|
||||||
this.chart.hideLoading();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setOption(data) {
|
|
||||||
let xdata = [],
|
|
||||||
ydata = [];
|
|
||||||
data.forEach((element) => {
|
|
||||||
xdata.push(element.createDate);
|
|
||||||
ydata.push({
|
|
||||||
value:element.batterySOC,
|
|
||||||
year:element.dateDay,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.chart && this.chart.setOption({
|
|
||||||
legend: {
|
|
||||||
left: "center",
|
|
||||||
top: "5",
|
|
||||||
itemWidth: 10,
|
|
||||||
itemHeight: 5,
|
|
||||||
textStyle: {
|
|
||||||
fontSize: 9,
|
|
||||||
},
|
},
|
||||||
|
setOption(x,data) {
|
||||||
|
this.chart.setOption({
|
||||||
|
color:['#FFBD00','#3C81FF'],
|
||||||
|
// legend: {
|
||||||
|
// left: 'center',
|
||||||
|
// bottom: '10',
|
||||||
|
// },
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
containLabel: true,
|
left: "15%"
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
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;">
|
|
||||||
<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>'
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: { type: "category", data: xdata },
|
xAxis: {type:'category',data:x},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataZoom: [
|
dataZoom: [
|
||||||
{
|
{
|
||||||
type: "inside",
|
type: 'inside',
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: "line",
|
name:'电池平均SOC',
|
||||||
name: `平均SOC`,
|
data: data,
|
||||||
|
type: 'line',
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
// color:'#FFBD00'
|
color:'#FFBD00'
|
||||||
},
|
}
|
||||||
data: ydata,
|
|
||||||
},
|
}]
|
||||||
],
|
})
|
||||||
},true);
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<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">
|
<div slot="header">
|
||||||
<span class="card-title">电池平均温度</span>
|
<span class="card-title">电池平均温度</span>
|
||||||
</div>
|
</div>
|
||||||
@ -12,114 +10,90 @@
|
|||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from '@/mixins/ems/resize'
|
||||||
import { batteryAveTemp } from "@/api/ems/dzjk";
|
import {formatDate} from "@/filters/ems";
|
||||||
|
import {batteryAveTemp} from '@/api/ems/dzjk'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.chart = echarts.init(document.querySelector("#dcpjwdChart"));
|
this.chart = echarts.init(document.querySelector('#dcpjwdChart'))
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(siteId,timeRange) {
|
init(siteId){
|
||||||
this.chart.showLoading();
|
this.chart.showLoading()
|
||||||
const [startTime='', endTime=''] = timeRange;
|
const x = []
|
||||||
batteryAveTemp(siteId,startTime,endTime)
|
const data1 =[],data2 =[]
|
||||||
.then((response) => {
|
batteryAveTemp(siteId).then(response => {
|
||||||
this.setOption(response?.data?.batteryAveTempList || []);
|
const source = response?.data?.batteryAveTempList || []
|
||||||
|
source.forEach(item=>{
|
||||||
|
x.push(formatDate(item.createDate,false,true))
|
||||||
|
data1.push(item.batteryTemp)
|
||||||
|
})
|
||||||
|
this.setOption(x,data1,data2)
|
||||||
|
}).finally(()=>{
|
||||||
|
this.chart.hideLoading()
|
||||||
})
|
})
|
||||||
.finally(() => {
|
|
||||||
this.chart.hideLoading();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(x,data) {
|
||||||
let xdata = [],
|
this.chart.setOption({
|
||||||
ydata = [];
|
color:['#3C81FF'],
|
||||||
data.forEach((element) => {
|
// legend: {
|
||||||
xdata.push(element.createDate);
|
// left: 'center',
|
||||||
ydata.push(
|
// bottom: '10',
|
||||||
{
|
// },
|
||||||
value: element.batteryTemp,
|
tooltip: {
|
||||||
year: element.dateDay
|
trigger: 'axis',
|
||||||
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
}
|
}
|
||||||
);
|
|
||||||
});
|
|
||||||
this.chart && this.chart.setOption({
|
|
||||||
legend: {
|
|
||||||
left: "center",
|
|
||||||
top: "5",
|
|
||||||
itemWidth: 10,
|
|
||||||
itemHeight: 5,
|
|
||||||
textStyle: {
|
|
||||||
fontSize: 9,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
containLabel: true,
|
left: "15%"
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
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;">
|
|
||||||
<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>'
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: { type: "category", data: xdata },
|
xAxis: {type:'category',data:x},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataZoom: [
|
dataZoom: [
|
||||||
{
|
{
|
||||||
type: "inside",
|
type: 'inside',
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: "line",
|
name:'电池平均温度',
|
||||||
name: `电池平均温度`,
|
data: data,
|
||||||
|
type: 'line',
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
// color:'#FFBD00'
|
color:'#3C81FF'
|
||||||
},
|
},
|
||||||
data: ydata,
|
}]
|
||||||
},
|
})
|
||||||
],
|
}
|
||||||
},true);
|
}
|
||||||
},
|
}
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<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">
|
<div slot="header">
|
||||||
<span class="card-title">PCS最高温度</span>
|
<span class="card-title">Poc平均温度</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 360px" id="pocpjwdChart"/>
|
<div style="height: 360px" id="pocpjwdChart"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -12,114 +10,87 @@
|
|||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from '@/mixins/ems/resize'
|
||||||
import { pcsMaxTemp } from "@/api/ems/dzjk";
|
import {formatDate} from "@/filters/ems";
|
||||||
|
import {stackAveTemp} from '@/api/ems/dzjk'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.chart = echarts.init(document.querySelector("#pocpjwdChart"));
|
this.chart = echarts.init(document.querySelector('#pocpjwdChart'))
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(siteId,timeRange) {
|
init(siteId){
|
||||||
this.chart.showLoading();
|
this.chart.showLoading()
|
||||||
const [startTime='', endTime=''] = timeRange;
|
const x = []
|
||||||
pcsMaxTemp(siteId,startTime,endTime)
|
const data =[]
|
||||||
.then((response) => {
|
stackAveTemp(siteId).then(response => {
|
||||||
this.setOption(response?.data?.pcsMaxTempList || []);
|
const source = response?.data?.stackAveTempList || []
|
||||||
|
source.forEach(item=>{
|
||||||
|
x.push(formatDate(item.createDate,false,true))
|
||||||
|
data.push(item.temp)
|
||||||
|
})
|
||||||
|
this.setOption(x,data)
|
||||||
|
}).finally(()=>{
|
||||||
|
this.chart.hideLoading()
|
||||||
})
|
})
|
||||||
.finally(() => {
|
|
||||||
this.chart.hideLoading();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(x,data) {
|
||||||
let xdata = [],
|
this.chart.setOption({
|
||||||
series = [];
|
color:['#FFBD00','#3C81FF'],
|
||||||
data.forEach((element, index) => {
|
tooltip: {
|
||||||
if (index === 0) {
|
trigger: 'axis',
|
||||||
xdata = (element.maxTempVoList || []).map((i) => i.createDate);
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
}
|
}
|
||||||
series.push({
|
|
||||||
type: "line",
|
|
||||||
name: `${element.deviceId}最高温度`,
|
|
||||||
areaStyle: {
|
|
||||||
// color:'#FFBD00'
|
|
||||||
},
|
|
||||||
data: (element.maxTempVoList || []).map((i) => {
|
|
||||||
return {
|
|
||||||
value: i.temp,
|
|
||||||
year: i.dateDay
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.chart && this.chart.setOption({
|
|
||||||
legend: {
|
|
||||||
left: "center",
|
|
||||||
top: "5",
|
|
||||||
itemWidth: 10,
|
|
||||||
itemHeight: 5,
|
|
||||||
textStyle: {
|
|
||||||
fontSize: 9,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
containLabel: true,
|
left: "15%"
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
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;">
|
|
||||||
<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>'
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: { type: "category", data: xdata },
|
xAxis: {type:'category',data:x},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataZoom: [
|
dataZoom: [
|
||||||
{
|
{
|
||||||
type: "inside",
|
type: 'inside',
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 100,
|
end: 100
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
series,
|
series: [
|
||||||
},true);
|
{
|
||||||
},
|
name:'Poc平均温度',
|
||||||
},
|
data: data,
|
||||||
};
|
type: 'line',
|
||||||
|
areaStyle: {
|
||||||
|
color:'#FFBD00'
|
||||||
|
}
|
||||||
|
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
<div class="ssyx-ems-dashboard-editor-container">
|
<div class="ssyx-ems-dashboard-editor-container">
|
||||||
<!-- 6个方块-->
|
<!-- 6个方块-->
|
||||||
<real-time-base-info :data="runningHeadData"/>
|
<real-time-base-info :data="runningHeadData"/>
|
||||||
<!-- 时间选择 -->
|
|
||||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate" style="margin-top:20px;"/>
|
|
||||||
<!-- echart图表-->
|
<!-- echart图表-->
|
||||||
<el-row :gutter="32" style="background:#fff;margin:30px 0;">
|
<el-row :gutter="32" style="background:#fff;margin:30px 0;">
|
||||||
<el-col :xs="24" :sm="12" :lg="12">
|
<el-col :xs="24" :sm="12" :lg="12">
|
||||||
@ -29,7 +27,6 @@
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import DateRangeSelect from '@/components/Ems/DateRangeSelect/index.vue'
|
|
||||||
import RealTimeBaseInfo from "./../RealTimeBaseInfo.vue";
|
import RealTimeBaseInfo from "./../RealTimeBaseInfo.vue";
|
||||||
import CnglqxChart from './CnglqxChart.vue'
|
import CnglqxChart from './CnglqxChart.vue'
|
||||||
import PocpjwdChart from './PocpjwdChart.vue'
|
import PocpjwdChart from './PocpjwdChart.vue'
|
||||||
@ -37,17 +34,14 @@ import DcpjwdChart from './DcpjwdChart.vue'
|
|||||||
import DcpjsocChart from './DcpjsocChart.vue'
|
import DcpjsocChart from './DcpjsocChart.vue'
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getRunningHeadInfo} from '@/api/ems/dzjk'
|
import {getRunningHeadInfo} from '@/api/ems/dzjk'
|
||||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name:'DzjkSbjkSsyx',
|
name:'DzjkSbjkSsyx',
|
||||||
components:{RealTimeBaseInfo,CnglqxChart,PocpjwdChart,DcpjwdChart,DcpjsocChart,DateRangeSelect},
|
components:{RealTimeBaseInfo,CnglqxChart,PocpjwdChart,DcpjwdChart,DcpjsocChart},
|
||||||
mixins:[getQuerySiteId,intervalUpdate],
|
mixins:[getQuerySiteId],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
runningHeadData:{},//运行信息
|
runningHeadData:{},//运行信息
|
||||||
timeRange:[],
|
|
||||||
isInit:true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
@ -57,28 +51,15 @@ export default {
|
|||||||
this.runningHeadData = response?.data || {}
|
this.runningHeadData = response?.data || {}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 更新时间范围 重置图表
|
|
||||||
updateDate(data){
|
|
||||||
this.timeRange=data
|
|
||||||
!this.isInit && this.updateChart()
|
|
||||||
this.isInit = false
|
|
||||||
},
|
|
||||||
updateChart(){
|
|
||||||
this.$refs.cnglqx.init(this.siteId,this.timeRange||[])
|
|
||||||
this.$refs.pocpjwd.init(this.siteId,this.timeRange||[])
|
|
||||||
this.$refs.dcpjsoc.init(this.siteId,this.timeRange||[])
|
|
||||||
this.$refs.dcpjwd.init(this.siteId,this.timeRange||[])
|
|
||||||
this.updateInterval(this.updateData)
|
|
||||||
},
|
|
||||||
updateData(){
|
|
||||||
this.getRunningHeadData()
|
|
||||||
this.updateChart()
|
|
||||||
},
|
|
||||||
init(){
|
init(){
|
||||||
this.$refs.dateRangeSelect.init(true)
|
this.getRunningHeadData()
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.updateData()
|
this.$refs.cnglqx.init(this.siteId)
|
||||||
|
this.$refs.pocpjwd.init(this.siteId)
|
||||||
|
this.$refs.dcpjsoc.init(this.siteId)
|
||||||
|
this.$refs.dcpjwd.init(this.siteId)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,134 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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" 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>
|
|
||||||
</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 getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
|
||||||
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},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
list: [],
|
|
||||||
tempData: [
|
|
||||||
{title: '主电源备用电池状态', attr: 'dczt', unit: ''},
|
|
||||||
{title: '手自动状态延时状态', attr: 'yszt', unit: ''},
|
|
||||||
{title: '启动喷洒气体喷洒状态', attr: 'pszt', unit: ''},
|
|
||||||
{title: '压力开关状态电磁阀状态', attr: 'dcfzt', unit: ''},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 查看设备电位表格
|
|
||||||
pointDetail(row, dataType) {
|
|
||||||
const {deviceId} = row
|
|
||||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'XF'}, dataType)
|
|
||||||
},
|
|
||||||
showChart(pointName, deviceId) {
|
|
||||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'XF', deviceId})
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.loading = true
|
|
||||||
getXfDataList(this.siteId).then(response => {
|
|
||||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.updateData()
|
|
||||||
this.updateInterval(this.updateData)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.sbjk-card-container {
|
|
||||||
&:not(:last-child) {
|
|
||||||
margin-bottom: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row {
|
|
||||||
background-color: #ffffff;
|
|
||||||
border: 1px solid #eeeeee;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 16px;
|
|
||||||
color: #333333;
|
|
||||||
|
|
||||||
.el-col {
|
|
||||||
padding: 12px 0;
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-col {
|
|
||||||
border-bottom: 1px solid #eeeeee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-col:not(:nth-child(3n)) {
|
|
||||||
border-right: 1px solid #eeeeee;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,41 +1,20 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<el-card
|
<!-- todo 判断条件是否需要更新-->
|
||||||
v-for="(item,index) in list"
|
<div class="yl-item-container" :class="{'yl-warn-item-container':item.workMode !== '0'}" v-for="(item,index) in list" :key="index+'ylLise'">
|
||||||
:key="index+'ylLise'"
|
<div class="header">
|
||||||
class="sbjk-card-container running-card-container"
|
<div class="header-title">{{item.systemName}}</div>
|
||||||
shadow="always">
|
<div>工作模式:<span class="header-values">{{$store.state.ems.workModeOptions[item.workMode]}}</span></div>
|
||||||
<div slot="header">
|
<div>当前温度:<span class="header-values">{{item.currentTemperature}}℃</span></div>
|
||||||
<span class="large-title">{{ item.deviceName }}</span>
|
|
||||||
<div class="info">
|
|
||||||
<div>数据更新时间:{{ item.dataUpdateTime || '-' }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="alarm">
|
<div class="content">
|
||||||
<el-button type="primary" round size="small" style="margin-right:20px;" @click="pointDetail(item,'point')">
|
<el-row>
|
||||||
详细
|
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'ylTempData'" :span="8">{{tempDataItem.title}}:{{item[tempDataItem.attr]}}℃</el-col>
|
||||||
</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>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</div>
|
||||||
|
</div>
|
||||||
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
<el-empty v-show="list.length<=0" :image-size="200"></el-empty>
|
||||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
|
||||||
<point-table ref="pointTable"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -43,49 +22,30 @@
|
|||||||
<script>
|
<script>
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getCoolingDataList} from '@/api/ems/dzjk'
|
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 {
|
export default {
|
||||||
name:'DzjkSbjkYl',
|
name:'DzjkSbjkYl',
|
||||||
mixins: [getQuerySiteId, intervalUpdate],
|
mixins:[getQuerySiteId],
|
||||||
components: {pointChart, PointTable},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
list:[],
|
list:[],
|
||||||
tempData:[
|
tempData:[
|
||||||
{title: '供水温度', attr: 'gsTemp', unit: '℃'},
|
{title:'制热开启点',attr:'heatingStartPoint'},
|
||||||
{title: '回水温度', attr: 'hsTemp', unit: '℃'},
|
{title:'制冷开启点',attr:'coolingStartPoint'},
|
||||||
{title: '供水压力', attr: 'gsPressure', unit: 'bar'},
|
{title:'高温告警点',attr:'highTempAlarmPoint'},
|
||||||
{title: '回水压力', attr: 'hsPressure', unit: 'bar'},
|
{title:'制热停止点',attr:'heatingStopPoint'},
|
||||||
{title: '冷源水温度', attr: 'lysTemp', unit: '℃'},
|
{title:'制冷停止点',attr:'coolingStopPoint'},
|
||||||
{title: 'VB01开度', attr: 'vb01Kd', unit: '%'},
|
{title:'低温告警点',attr:'lowTempAlarmPoint'},
|
||||||
{title: 'VB02开度', attr: 'vb02Kd', unit: '%'},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
// 查看设备电位表格
|
init(){
|
||||||
pointDetail(row, dataType) {
|
|
||||||
const {deviceId} = row
|
|
||||||
this.$refs.pointTable.showTable({siteId: this.siteId, deviceId, deviceCategory: 'COOLING'}, dataType)
|
|
||||||
},
|
|
||||||
showChart(pointName, deviceId) {
|
|
||||||
pointName && this.$refs.pointChart.showChart({pointName, deviceCategory: 'COOLING', deviceId})
|
|
||||||
},
|
|
||||||
updateData() {
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getCoolingDataList(this.siteId).then(response => {
|
getCoolingDataList(this.siteId).then(response => {
|
||||||
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
this.list = JSON.parse(JSON.stringify(response?.data || []));
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading = false})
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.updateData()
|
|
||||||
this.updateInterval(this.updateData)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
@ -95,9 +55,64 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.sbjk-card-container {
|
.yl-item-container{
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #EBF6F6;
|
||||||
&:not(:last-child){
|
&:not(:last-child){
|
||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
|
.header{
|
||||||
|
line-height: 40px;
|
||||||
|
font-size: 14px;
|
||||||
|
>div{
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 40px;
|
||||||
}
|
}
|
||||||
|
.header-title{
|
||||||
|
border-radius: 5px 0 5px 0;
|
||||||
|
color:#ffffff;
|
||||||
|
width: 120px;
|
||||||
|
height: 40px;
|
||||||
|
font-size: 16px;
|
||||||
|
background-color: #05AEA3;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.header-values{
|
||||||
|
color: #05AEA3;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content{
|
||||||
|
padding:25px;
|
||||||
|
.el-row{
|
||||||
|
background-color: #ffffff;
|
||||||
|
border:1px solid #eeeeee;
|
||||||
|
line-height: 14px;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 12px;
|
||||||
|
.el-col{
|
||||||
|
padding:10px 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.el-col:nth-child(-n+3){
|
||||||
|
border-bottom: 1px solid #eeeeee;
|
||||||
|
}
|
||||||
|
.el-col:not(:nth-child(3n)){
|
||||||
|
border-right: 1px solid #eeeeee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.yl-warn-item-container{
|
||||||
|
background-color: #FFF1F0;
|
||||||
|
.header{
|
||||||
|
.header-title{
|
||||||
|
background-color: #FC6B69;
|
||||||
|
}
|
||||||
|
.header-values{
|
||||||
|
color: #FC6B69;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,19 +1,25 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div style="width:100%" v-loading="loading">
|
<div style="width:100%" v-loading="loading">
|
||||||
<!-- 搜索栏-->
|
<!-- 搜索栏-->
|
||||||
<el-form :inline="true" class="select-container">
|
<el-form :inline="true" class="select-container">
|
||||||
|
<el-form-item label="电表">
|
||||||
|
<el-select v-model="search.deviceId" placeholder="请选择" loading-text="正在加载数据">
|
||||||
|
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in deviceOptions" :key="index+'dbOptions'"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="日报">-->
|
||||||
|
<!-- <el-select v-model="search.rb" placeholder="请选择" :loading="loading" loading-text="正在加载数据">-->
|
||||||
|
<!-- <el-option :label="item.name" :value="item.id" v-for="(item,index) in rbOptions" :key="index+'rbOptions'"></el-option>-->
|
||||||
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="时间选择">
|
<el-form-item label="时间选择">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="dateRange"
|
v-model="search.date"
|
||||||
type="daterange"
|
type="date"
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
:clearable="false"
|
|
||||||
:picker-options="pickerOptions"
|
:picker-options="pickerOptions"
|
||||||
:default-value="defaultDateRange"
|
:default-value="defaultDate">
|
||||||
></el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
||||||
@ -21,9 +27,6 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="onReset" native-type="button">重置</el-button>
|
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="exportTable" native-type="button">导出</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<!--表格-->
|
<!--表格-->
|
||||||
<el-table
|
<el-table
|
||||||
@ -37,94 +40,72 @@
|
|||||||
prop="dataTime"
|
prop="dataTime"
|
||||||
label="日期"
|
label="日期"
|
||||||
width="120">
|
width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{scope.row.dataTime}}{{scope.row.dataTime === '汇总' ? '' : ':00'}}</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!--充电量列-->
|
<!--充电量列-->
|
||||||
<el-table-column label="充电量" align="center">
|
<el-table-column label="充电量">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="activePeakKwh"
|
prop="activePeakKwh"
|
||||||
label="尖">
|
label="尖">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="activeHighKwh"
|
prop="activeHighKwh"
|
||||||
label="峰">
|
label="峰">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="activeFlatKwh"
|
prop="activeFlatKwh"
|
||||||
label="平">
|
label="平">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="activeValleyKwh"
|
prop="activeValleyKwh"
|
||||||
label="谷">
|
label="谷">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="activeTotalKwh"
|
prop="activeTotalKwh"
|
||||||
label="总">
|
label="总">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!--充电量列-->
|
<!--充电量列-->
|
||||||
<el-table-column label="放电量" align="center">
|
<el-table-column label="放电量">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="reActivePeakKwh"
|
prop="reActivePeakKwh"
|
||||||
label="尖">
|
label="尖">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="reActiveHighKwh"
|
prop="reActiveHighKwh"
|
||||||
label="峰">
|
label="峰">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="reActiveFlatKwh"
|
prop="reActiveFlatKwh"
|
||||||
label="平">
|
label="平">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="reActiveValleyKwh"
|
prop="reActiveValleyKwh"
|
||||||
label="谷">
|
label="谷">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="reActiveTotalKwh"
|
prop="reActiveTotalKwh"
|
||||||
label="总">
|
label="总">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- 效率-->
|
<!-- 效率-->
|
||||||
<el-table-column label="效率(%)" align="center">
|
<el-table-column label="效率(%)">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
|
||||||
prop="effect">
|
prop="effect">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getAmmeterData} from '@/api/ems/dzjk'
|
import { getAmmeterData, getLoadNameList} from '@/api/ems/dzjk'
|
||||||
import {formatDate} from "@/filters/ems";
|
import {formatDate} from "@/filters/ems";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name:'DzjkTjbbDbbb',
|
name:'DzjkTjbbDbbb',
|
||||||
mixins: [getQuerySiteId],
|
mixins: [getQuerySiteId],
|
||||||
@ -136,73 +117,61 @@ export default {
|
|||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultDateRange: [],//默认展示的时间
|
defaultDate:'',//默认展示的时间
|
||||||
dateRange: [],
|
search:{deviceId:'',date:''},
|
||||||
tableData: [],
|
deviceOptions:[],
|
||||||
pageSize: 10,//分页栏当前每个数据总数
|
// rbOptions:[
|
||||||
pageNum: 1,//分页栏当前页数
|
// {name:'日报1',id:1},
|
||||||
totalSize: 0,//table表格数据总数
|
// {name:'日报2',id:2},
|
||||||
|
// ],
|
||||||
|
tableData:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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(){
|
onSearch(){
|
||||||
this.pageNum = 1//每次搜索从1开始搜索
|
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
// 重置
|
// 重置
|
||||||
onReset(){
|
onReset(){
|
||||||
this.dateRange = this.defaultDateRange
|
this.search.date = ''
|
||||||
this.pageNum = 1//每次搜索从1开始搜索
|
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
// 分页
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.pageSize = val;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.pageNum = val
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
getData(){
|
getData(){
|
||||||
|
if(!this.search.deviceId) return
|
||||||
this.loading=true
|
this.loading=true
|
||||||
const {siteId, pageNum, pageSize} = this
|
getAmmeterData({siteId:this.siteId,deviceId:this.search.deviceId,dateTime:formatDate(this.search.date)}).then(response=>{
|
||||||
const [startTime = '', endTime = ''] = (this.dateRange || [])
|
this.tableData=response?.data || [];
|
||||||
getAmmeterData({siteId: siteId, startTime, endTime, pageSize, pageNum}).then(response => {
|
|
||||||
this.tableData = response?.rows || [];
|
|
||||||
this.totalSize = response?.total || 0
|
|
||||||
}).finally(()=> {
|
}).finally(()=> {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getDbList(){
|
||||||
|
return getLoadNameList(this.siteId).then(response=>{
|
||||||
|
this.deviceOptions=response?.data || [];
|
||||||
|
this.deviceOptions.length > 0 && (this.search.deviceId = this.deviceOptions[0].id);
|
||||||
|
})
|
||||||
|
},
|
||||||
init(){
|
init(){
|
||||||
this.dateRange = []
|
this.loading = true
|
||||||
|
this.deviceOptions = []
|
||||||
|
this.search.deviceId=''
|
||||||
|
this.search.date=''
|
||||||
this.tableData=[]
|
this.tableData=[]
|
||||||
this.totalSize = 0
|
this.getDbList().then(()=>{
|
||||||
this.pageSize = 10
|
if(this.search.deviceId){
|
||||||
this.pageNum = 1
|
this.onReset()
|
||||||
let now = new Date(), lastDay = now.getTime(), firstDay = new Date(now.setDate(1)).getTime();
|
}else{
|
||||||
this.defaultDateRange = [formatDate(firstDay), formatDate(lastDay)];
|
this.loading = false
|
||||||
this.dateRange = [formatDate(firstDay), formatDate(lastDay)];
|
}
|
||||||
this.getData()
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted(){
|
||||||
|
this.defaultDate = new Date()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -1,41 +1,56 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<div v-loading="loading">
|
||||||
shadow="always"
|
<div class="select-container">
|
||||||
class="common-card-container time-range-card"
|
<el-form :inline="true">
|
||||||
style="margin-top: 20px"
|
<el-form-item label="电池堆">
|
||||||
>
|
<el-select v-model="pcs" placeholder="请选择" :loading="loading" loading-text="正在加载数据">
|
||||||
<div slot="header" class="time-range-header">
|
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in pcsOptions" :key="index+'pcsListOptions'"></el-option>
|
||||||
<span class="card-title"> </span>
|
</el-select>
|
||||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate"/>
|
</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="结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-main" v-loading="loading">
|
<div style="margin:30px 0;">
|
||||||
|
<!-- 二个选择按钮-->
|
||||||
|
<el-row style="">
|
||||||
|
<el-col :xs="24" :sm="24" :lg="24">
|
||||||
<el-button-group class="ems-btns-group">
|
<el-button-group class="ems-btns-group">
|
||||||
<el-button
|
<el-button v-for="(item,index) in btnList" :key="index+'dcdqxBtns'" :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>
|
</el-button-group>
|
||||||
<div id="dcdEchart" style="height: 310px"></div>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!--echart-->
|
||||||
|
<div id="dcdEchart" style="height:360px;"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from "@/mixins/ems/resize";
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getStackData} from "@/api/ems/dzjk";
|
import { getStackData, getStackNameList} from '@/api/ems/dzjk'
|
||||||
import {formatDate} from "@/filters/ems";
|
import {formatDate} from "@/filters/ems";
|
||||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DzjkTjbbDcdqx",
|
name:'DzjkTjbbDcdqx',
|
||||||
components: {DateRangeSelect},
|
|
||||||
mixins: [resize,getQuerySiteId],
|
mixins: [resize,getQuerySiteId],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -44,165 +59,124 @@ export default {
|
|||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
defaultDateRange:[],//默认展示的时间
|
||||||
dateRange:[],
|
dateRange:[],
|
||||||
loading:false,
|
loading:false,
|
||||||
activeBtn: "1",
|
pcs:'',
|
||||||
|
pcsOptions: [],
|
||||||
|
activeBtn:'1',
|
||||||
btnList:[
|
btnList:[
|
||||||
{name: "堆平均维度", id: "1", attr: ["temp"], source: ["有功功率"]},
|
{name:'堆平均维度',id:'1',attr:['temp'],source:[['日期','有功功率']]},
|
||||||
{name: "堆电压", id: "2", attr: ["voltage"], source: ["堆电压"]},
|
{name:'堆电压',id:'2',attr:['voltage'],source:[['日期','堆电压']]},
|
||||||
{name: "堆电流", id: "3", attr: ["current"], source: ["堆电流"]},
|
{name:'堆电流',id:'3',attr:['current'],source:[['日期','堆电流']]},
|
||||||
{name: "堆soc", id: "4", attr: ["soc"], source: ["堆soc"]},
|
{name:'堆soc',id:'4',attr:['soc'],source:[['日期','堆soc']]},
|
||||||
],
|
],
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeDataType(id){
|
changeDataType(id){
|
||||||
if(id !== this.activeBtn){
|
if(id !== this.activeBtn){
|
||||||
this.activeBtn=id;
|
this.activeBtn=id;
|
||||||
this.getData();
|
this.getData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 更新时间范围 重置图表
|
// 搜索
|
||||||
updateDate(data) {
|
onSearch(){
|
||||||
this.dateRange = data || [];
|
this.getData()
|
||||||
this.getData();
|
},
|
||||||
|
// 重置
|
||||||
|
onReset(){
|
||||||
|
// this.pcs = this.pcsOptions.length > 0 ?this.pcsOptions[0].id : ''
|
||||||
|
this.dateRange=''
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
getPcsList(){
|
||||||
|
return getStackNameList(this.siteId).then(response => {
|
||||||
|
const data = JSON.parse(JSON.stringify(response?.data || []))
|
||||||
|
this.pcsOptions = data
|
||||||
|
this.pcs = data.length>0?data[0].id:'';
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getData(){
|
getData(){
|
||||||
const {siteId, activeBtn} = this;
|
const {siteId,pcs,activeBtn}=this;
|
||||||
const [start = "", end = ""] = this.dateRange || [];
|
const [start='',end='']=(this.dateRange || [])
|
||||||
|
if(!pcs) return
|
||||||
//接口调用完成之后 设置图表、结束loading
|
//接口调用完成之后 设置图表、结束loading
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
getStackData({
|
getStackData({siteId,deviceId:pcs,startTime:formatDate(start),endTime:formatDate(end),dataType:activeBtn}).then(response => {
|
||||||
siteId,
|
this.setOption(response?.data || [])
|
||||||
startTime: formatDate(start),
|
}).finally(()=>{this.loading=false;})
|
||||||
endTime: formatDate(end),
|
|
||||||
dataType: activeBtn,
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.setOption(response?.data || []);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
compareDate(date1, date2) {
|
|
||||||
console.log("比较时间", date1, date2);
|
|
||||||
// 年2025-09/天2025-09-15/时2025-09-15/10:00
|
|
||||||
if (date1.indexOf(":") > -1 && date2.indexOf(":") > -1) {
|
|
||||||
return parseInt(date1) - parseInt(date2);
|
|
||||||
}
|
|
||||||
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
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(data) {
|
||||||
const ele = this.btnList.find((item) => {
|
const ele = this.btnList.find((item)=>{return item.id === this.activeBtn})
|
||||||
return item.id === this.activeBtn;
|
const source = JSON.parse(JSON.stringify(ele.source))
|
||||||
});
|
const length = ele.attr.length
|
||||||
const sourceBase = JSON.parse(JSON.stringify(ele.source));
|
const series = []
|
||||||
// sourceBase={name:'堆平均维度',id:'1',attr:['temp'],source:['有功功率']},
|
|
||||||
const source = [];
|
|
||||||
const sourceTop = ["日期"];
|
|
||||||
let map = {},
|
|
||||||
mapArr = [];
|
|
||||||
// 生成所有{日期:[],日期:[]}格式的对象和所有包含所有日期的[日期1,日期2...]
|
|
||||||
data.forEach((item)=>{
|
data.forEach((item)=>{
|
||||||
item.dataList.forEach((inner) => {
|
const arr = ele.attr.map(key=>item[key])
|
||||||
// 日期格式
|
source.push([item.statisDate,...arr])
|
||||||
// 年2025-09/天2025-09-15/时2025-09-15/10:00
|
})
|
||||||
// 所有数据的日期格式一致
|
ele.attr.forEach((item)=>{
|
||||||
if (!map[inner.statisDate]) {
|
series.push({
|
||||||
map[inner.statisDate] = [];
|
name:length>1?item:ele.name,
|
||||||
mapArr.push(inner.statisDate);
|
type:ele.type || 'scatter'
|
||||||
}
|
})
|
||||||
});
|
})
|
||||||
});
|
this.chart.setOption({
|
||||||
data.forEach((item, itemIndex) => {
|
color:['#FFBD00','#3C81FF'],
|
||||||
const dataTimeList = item.dataList.map((i) => i.statisDate);
|
|
||||||
const noDataTime = mapArr.filter((i) => !dataTimeList.includes(i));
|
|
||||||
sourceBase.forEach((outer, outerIndex) => {
|
|
||||||
sourceTop.push(`${item.deviceId}-${outer}`);
|
|
||||||
noDataTime.forEach((i) => map[i].push(""));
|
|
||||||
item.dataList.forEach((inner, innerIndex) => {
|
|
||||||
map[inner.statisDate].push(inner[ele.attr[outerIndex]]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
mapArr = mapArr.sort((a, b) => this.compareDate(a, b));
|
|
||||||
mapArr.forEach((item) => {
|
|
||||||
source.push([item, ...map[item]]);
|
|
||||||
});
|
|
||||||
source.unshift(sourceTop);
|
|
||||||
this.chart.setOption(
|
|
||||||
{
|
|
||||||
grid: {
|
|
||||||
containLabel: true,
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: "center",
|
left: 'center',
|
||||||
top: "10",
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
// 坐标轴指示器,坐标轴触发有效
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: "category",
|
type: 'category',
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataZoom: [
|
|
||||||
{
|
|
||||||
type: "inside",
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
dataset: {source},
|
dataset: {source},
|
||||||
series: source[0].slice(1).map((item) => {
|
series
|
||||||
return {
|
},true)
|
||||||
type: "line",
|
|
||||||
smooth: true,
|
|
||||||
areaStyle: {
|
|
||||||
opacity: 0.7,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
true
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
initChart() {
|
initChart() {
|
||||||
this.chart = echarts.init(document.querySelector("#dcdEchart"));
|
this.chart = echarts.init(document.querySelector('#dcdEchart'));
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
this.$nextTick(() => {
|
this.loading = true
|
||||||
this.initChart();
|
this.pcs=''
|
||||||
this.$refs.dateRangeSelect.init(true);
|
this.pcsOptions=[]
|
||||||
});
|
this.initChart()
|
||||||
|
this.getPcsList().then(()=>{
|
||||||
|
if(this.pcs){
|
||||||
|
this.onReset()
|
||||||
|
}else{
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
mounted(){
|
||||||
|
const now = new Date();
|
||||||
|
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
||||||
|
this.defaultDateRange = [lastMonth, now];
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -171,7 +171,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async getClusterList(){
|
async getClusterList(){
|
||||||
this.clusterloading =true
|
this.clusterloading =true
|
||||||
await getClusterNameList({stackDeviceId: this.search.stackId, siteId: this.siteId}).then(response => {
|
await getClusterNameList(this.search.stackId).then(response => {
|
||||||
const data = JSON.parse(JSON.stringify(response?.data || []))
|
const data = JSON.parse(JSON.stringify(response?.data || []))
|
||||||
this.clusterOptions = data
|
this.clusterOptions = data
|
||||||
this.search.clusterId = data.length > 0 ? data[0].id : ''
|
this.search.clusterId = data.length > 0 ? data[0].id : ''
|
||||||
|
|||||||
@ -1,33 +1,61 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<div v-loading="loading">
|
||||||
shadow="always"
|
<div class="select-container">
|
||||||
class="common-card-container time-range-card"
|
<el-form :inline="true">
|
||||||
style="margin-top: 20px"
|
<!-- <el-form-item label="网点">-->
|
||||||
>
|
<!-- <el-select v-model="wd" placeholder="请选择" :loading="loading" loading-text="正在加载数据">-->
|
||||||
<div slot="header" class="time-range-header">
|
<!-- <el-option :label="item.name" :value="item.id" v-for="(item,index) in wdOptions" :key="index+'sblxOptions'"></el-option>-->
|
||||||
<span class="card-title">功率曲线</span>
|
<!-- </el-select>-->
|
||||||
<date-range-select
|
<!-- </el-form-item>-->
|
||||||
ref="dateRangeSelect"
|
<el-form-item label="PCS">
|
||||||
@updateDate="updateDate"
|
<el-select v-model="pcs" placeholder="请选择" :loading="loading" loading-text="正在加载数据">
|
||||||
/>
|
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in pcsOptions" :key="index+'pcsListOptions'"></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="结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div style="margin:30px 0;">
|
||||||
|
<!-- 二个选择按钮-->
|
||||||
|
<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+'flqxcBtns'" :class="{'activeBtn' : activeBtn === item.id}" @click="changeDataType(item.id)">{{item.name}}</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!--echart-->
|
||||||
|
<div id="glqxEchart" style="height:360px;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-main" v-loading="loading">
|
|
||||||
<div id="glqxEchart" style="height: 310px"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from "@/mixins/ems/resize";
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getPowerData} from "@/api/ems/dzjk";
|
import {getPcsNameList, getPowerData} from "@/api/ems/dzjk";
|
||||||
import {formatDate} from "@/filters/ems";
|
import {formatDate} from "@/filters/ems";
|
||||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DzjkTjbbGlqx",
|
name:'DzjkTjbbGlqx',
|
||||||
components: {DateRangeSelect},
|
|
||||||
mixins: [resize,getQuerySiteId],
|
mixins: [resize,getQuerySiteId],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -36,133 +64,120 @@ export default {
|
|||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
defaultDateRange:[],//默认展示的时间
|
||||||
dateRange:[],
|
dateRange:[],
|
||||||
loading:false,
|
loading:false,
|
||||||
};
|
pcs:'',
|
||||||
|
pcsOptions: [],
|
||||||
|
activeBtn:'1',
|
||||||
|
btnList:[
|
||||||
|
{name:'电网功率',id:'1',attr:'gridPower'},
|
||||||
|
{name:'负载功率',id:'2',attr:'loadPower'},
|
||||||
|
{name:'储能功率',id:'3',attr:'storagePower'},
|
||||||
|
{name:'光伏功率',id:'4',attr:'pvPower'},
|
||||||
|
],
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 更新时间范围 重置图表
|
changeDataType(id){
|
||||||
updateDate(data) {
|
if(id !== this.activeBtn){
|
||||||
this.dateRange = data || [];
|
console.log('点击了不同的菜单,更新数据')
|
||||||
this.getData();
|
this.activeBtn=id;
|
||||||
|
this.getData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 搜索
|
||||||
|
onSearch(){
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
// 重置
|
||||||
|
onReset(){
|
||||||
|
this.dateRange=[]
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
getPcsList(){
|
||||||
|
return getPcsNameList(this.siteId).then(response => {
|
||||||
|
const data = response?.data || [];
|
||||||
|
this.pcsOptions = data
|
||||||
|
this.pcs = data.length>0?data[0].id:'';
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getData(){
|
getData(){
|
||||||
const {siteId} = this;
|
const {siteId,pcs,activeBtn}=this;
|
||||||
let [start = "", end = ""] = this.dateRange || [];
|
const [start='',end='']=(this.dateRange || [])
|
||||||
|
if(!pcs) return
|
||||||
//接口调用完成之后 设置图表、结束loading
|
//接口调用完成之后 设置图表、结束loading
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
getPowerData({
|
getPowerData({siteId,deviceId:pcs,startDate:formatDate(start),endDate:formatDate(end),dataType:activeBtn}).then(response => {
|
||||||
siteId,
|
this.setOption(response?.data || [])
|
||||||
startDate: formatDate(start),
|
}).finally(()=>{this.loading=false;})
|
||||||
endDate: formatDate(end),
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.setOption(response?.data || []);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(data) {
|
||||||
const source = [["日期", "电网功率", "负载功率", "储能功率", "光伏功率"]];
|
const {name,attr} =this.btnList.find(item=>item.id===this.activeBtn)
|
||||||
data.forEach((item) => {
|
const source = [['日期',name]]
|
||||||
source.push([
|
data.forEach((item,index)=>{
|
||||||
item.statisDate,
|
source.push([item.statisDate,item[attr]])
|
||||||
item.gridPower,
|
})
|
||||||
item.loadPower,
|
this.chart.setOption({
|
||||||
item.storagePower,
|
color:['#FFBD00','#3C81FF'],
|
||||||
item.pvPower,
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
this.chart.setOption(
|
|
||||||
{
|
|
||||||
grid: {
|
|
||||||
containLabel: true,
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: "center",
|
left: 'center',
|
||||||
top: "10",
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
// 坐标轴指示器,坐标轴触发有效
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: "category",
|
type: 'category',
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataset:{source},
|
dataset:{source},
|
||||||
dataZoom: [
|
|
||||||
{
|
|
||||||
type: "inside",
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: "line",
|
name,
|
||||||
smooth: true,
|
type: 'scatter',
|
||||||
areaStyle: {
|
}
|
||||||
opacity: 0.7,
|
]
|
||||||
},
|
},true)
|
||||||
},
|
|
||||||
{
|
|
||||||
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() {
|
initChart() {
|
||||||
if (this.chart) return;
|
this.chart = echarts.init(document.querySelector('#glqxEchart'));
|
||||||
this.chart = echarts.init(document.querySelector("#glqxEchart"));
|
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
this.$nextTick(() => {
|
this.loading = true
|
||||||
this.initChart();
|
this.pcs=''
|
||||||
this.$refs.dateRangeSelect.init();
|
this.pcsOptions=[]
|
||||||
});
|
this.initChart()
|
||||||
|
this.getPcsList().then(()=>{
|
||||||
|
if(this.pcs){
|
||||||
|
this.onReset()
|
||||||
|
}else{
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
mounted(){
|
||||||
|
const now = new Date();
|
||||||
|
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
||||||
|
this.defaultDateRange = [lastMonth, now];
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card shadow="always" class="common-card-container time-range-card" style="margin-top:20px">
|
<el-card shadow="always" class="common-card-container" style="margin-top:20px">
|
||||||
<div slot="header" class="time-range-header">
|
<div slot="header">
|
||||||
<span class="card-title">电量指标</span>
|
<span class="card-title">电量指标</span>
|
||||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate"/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-main" v-loading="loading">
|
<div class="card-main" v-loading="loading">
|
||||||
|
<!-- 搜索栏-->
|
||||||
|
<div class="select-container">
|
||||||
|
<el-form :inline="true">
|
||||||
|
<el-form-item label="时间选择">
|
||||||
|
<el-date-picker
|
||||||
|
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>
|
||||||
|
<el-button type="primary" @click="getData" native-type="button">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
<div class="total-data">
|
<div class="total-data">
|
||||||
<div>总充电量:<span class="point">{{totalChargedCap | formatNumber}}kWh</span></div>
|
<div>总充电量:<span class="point">{{totalChargedCap | formatNumber}}kWh</span></div>
|
||||||
<div>总放电量:<span class="point">{{totalDisChargedCap | formatNumber}}kWh</span></div>
|
<div>总放电量:<span class="point">{{totalDisChargedCap | formatNumber}}kWh</span></div>
|
||||||
<div>综合效率:<span class="point">{{efficiency | formatNumber}}%</span></div>
|
<div>综合效率:<span class="point">{{efficiency | formatNumber}}%</span></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="dlzbChart" style="height: 310px;"></div>
|
<div id="dlzbChart" style="height: 310px"></div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
@ -21,9 +42,7 @@ import resize from "@/mixins/ems/resize";
|
|||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getElectricData} from '@/api/ems/dzjk'
|
import {getElectricData} from '@/api/ems/dzjk'
|
||||||
import {formatDate} from '@/filters/ems'
|
import {formatDate} from '@/filters/ems'
|
||||||
import DateRangeSelect from '@/components/Ems/DateRangeSelect/index.vue'
|
|
||||||
export default {
|
export default {
|
||||||
components: {DateRangeSelect},
|
|
||||||
mixins: [resize,getQuerySiteId],
|
mixins: [resize,getQuerySiteId],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -32,6 +51,7 @@ export default {
|
|||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
defaultDateRange:[],//默认展示的时间
|
||||||
dateRange:[],
|
dateRange:[],
|
||||||
loading:false,
|
loading:false,
|
||||||
chart: null,
|
chart: null,
|
||||||
@ -41,9 +61,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 更新时间范围 重置图表
|
// 重置
|
||||||
updateDate(data){
|
onReset(){
|
||||||
this.dateRange=data || []
|
this.dateRange=[]
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
setOption(data,unit){
|
setOption(data,unit){
|
||||||
@ -52,26 +72,17 @@ export default {
|
|||||||
source.push([item.ammeterDate, item.chargedCap,item.disChargedCap,item.dailyEfficiency])
|
source.push([item.ammeterDate, item.chargedCap,item.disChargedCap,item.dailyEfficiency])
|
||||||
})
|
})
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
legend: {
|
color:['#FFBD00','#3C81FF','#05AEA3'],
|
||||||
left: 'center',
|
// legend: {
|
||||||
bottom: '15',
|
// left: 'right',
|
||||||
},
|
// bottom: '10',
|
||||||
grid: {
|
// },
|
||||||
top:40,
|
tooltip: {},
|
||||||
containLabel: true
|
xAxis: {
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
|
||||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
xAxis: [{
|
|
||||||
type: 'category',
|
type: 'category',
|
||||||
name:`单位:${unit}`,
|
name:unit,
|
||||||
nameLocation:'center',
|
nameLocation:'center'
|
||||||
nameGap:30
|
},
|
||||||
}],
|
|
||||||
yAxis: [{
|
yAxis: [{
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name:'充电量/放电量kWh',
|
name:'充电量/放电量kWh',
|
||||||
@ -91,25 +102,22 @@ export default {
|
|||||||
onZero:false
|
onZero:false
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
grid:{top:40},
|
||||||
dataset:{
|
dataset:{
|
||||||
source
|
source
|
||||||
},
|
},
|
||||||
//所有充放电颜色保持统一
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
yAxisIndex:0,
|
yAxisIndex:0,
|
||||||
type: 'bar',//柱状图
|
type: 'bar',//柱状图
|
||||||
color:'#4472c4'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
yAxisIndex:0,
|
yAxisIndex:0,
|
||||||
type: 'bar',//柱状图
|
type: 'bar',//柱状图
|
||||||
color:'#70ad47'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
yAxisIndex:1,
|
yAxisIndex:1,
|
||||||
type: 'line',//柱状图
|
type: 'line',//柱状图
|
||||||
color:'#FFBD00'
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -130,13 +138,15 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
this.$nextTick(()=>{
|
|
||||||
this.chart = echarts.init(document.querySelector('#dlzbChart'));
|
this.chart = echarts.init(document.querySelector('#dlzbChart'));
|
||||||
this.$refs.dateRangeSelect.init()
|
this.onReset()
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted(){
|
||||||
|
const now = new Date();
|
||||||
|
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
||||||
|
this.defaultDateRange = [lastMonth, now];
|
||||||
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return
|
return
|
||||||
@ -153,7 +163,7 @@ export default {
|
|||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
padding:20px 0;
|
padding:10px 0;
|
||||||
>div{
|
>div{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="ems-dashboard-editor-container ems-third-menu-container">
|
<div class="ems-dashboard-editor-container ems-content-container-padding tjbb-ems-dashboard-editor-container">
|
||||||
<el-menu
|
<el-menu
|
||||||
class="ems-third-menu"
|
class="ems-third-menu"
|
||||||
:default-active="$route.name"
|
:default-active="$route.name"
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { dzjk } from '@/router/ems'
|
import { dzjk } from '@/router/ems'
|
||||||
const childrenRoute = dzjk[0].children[0].children.find(item=> item.name==='DzjkTjbb').children//获取到统计报表下面的字路由
|
const childrenRoute = dzjk[0].children.find(item=> item.name==='DzjkTjbb').children//获取到统计报表下面的字路由
|
||||||
console.log('设备监控子路由',childrenRoute)
|
console.log('设备监控子路由',childrenRoute)
|
||||||
export default {
|
export default {
|
||||||
name:'DzjkTjbb',
|
name:'DzjkTjbb',
|
||||||
@ -43,6 +43,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.tjbb-ems-dashboard-editor-container{
|
||||||
|
display: flex;
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
.tjbb-ems-content-container{
|
.tjbb-ems-content-container{
|
||||||
margin-top:0;
|
margin-top:0;
|
||||||
padding-top:0;
|
padding-top:0;
|
||||||
|
|||||||
@ -1,41 +1,56 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-card
|
<div v-loading="loading">
|
||||||
shadow="always"
|
<div class="select-container">
|
||||||
class="common-card-container time-range-card"
|
<el-form :inline="true">
|
||||||
style="margin-top: 20px"
|
<el-form-item label="PCS">
|
||||||
>
|
<el-select v-model="pcs" placeholder="请选择" :loading="loading" loading-text="正在加载数据">
|
||||||
<div slot="header" class="time-range-header">
|
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in pcsOptions" :key="index+'pcsListOptions'"></el-option>
|
||||||
<span class="card-title"> </span>
|
</el-select>
|
||||||
<date-range-select ref="dateRangeSelect" @updateDate="updateDate"/>
|
</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="结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-main" v-loading="loading">
|
<div style="margin:30px 0;">
|
||||||
|
<!-- 二个选择按钮-->
|
||||||
|
<el-row style="">
|
||||||
|
<el-col :xs="24" :sm="24" :lg="24">
|
||||||
<el-button-group class="ems-btns-group">
|
<el-button-group class="ems-btns-group">
|
||||||
<el-button
|
<el-button v-for="(item,index) in btnList" :key="index+'flqxcBtns'" :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>
|
</el-button-group>
|
||||||
<div id="pcsEchart" style="height: 310px"></div>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!--echart-->
|
||||||
|
<div id="pcsEchart" style="height:360px;"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from 'echarts'
|
||||||
import resize from "@/mixins/ems/resize";
|
import resize from "@/mixins/ems/resize";
|
||||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||||
import {getPCSData} from "@/api/ems/dzjk";
|
import { getPCSData, getPcsNameList} from '@/api/ems/dzjk'
|
||||||
import {formatDate} from "@/filters/ems";
|
import {formatDate} from "@/filters/ems";
|
||||||
import DateRangeSelect from "@/components/Ems/DateRangeSelect/index.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DzjkTjbbPcsqx",
|
name:'DzjkTjbbPcsqx',
|
||||||
components: {DateRangeSelect},
|
|
||||||
mixins: [resize,getQuerySiteId],
|
mixins: [resize,getQuerySiteId],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -44,181 +59,130 @@ export default {
|
|||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
defaultDateRange:[],//默认展示的时间
|
||||||
dateRange:[],
|
dateRange:[],
|
||||||
loading:false,
|
loading:false,
|
||||||
activeBtn: "1",
|
pcs:'',
|
||||||
|
pcsOptions: [],
|
||||||
|
activeBtn:'1',
|
||||||
btnList:[
|
btnList:[
|
||||||
{
|
{name:'有功功率',id:'1',attr:['activePower'],source:[['日期','有功功率']]},
|
||||||
name: "有功功率",
|
{name:'无功功率',id:'2',attr:['reactivePower'],source:[['日期','无功功率']]},
|
||||||
id: "1",
|
// {name:'温度',id:'wd'},
|
||||||
attr: ["activePower"],
|
// {name:'三相电压',id:'sxdy'},
|
||||||
source: ["有功功率"],
|
{name:'三相电流',id:'3',attr:['uCurrent','vCurrent','wCurrent'],source:[['日期','u电流','v电流','w电流']],type:'bar'},
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "无功功率",
|
|
||||||
id: "2",
|
|
||||||
attr: ["reactivePower"],
|
|
||||||
source: ["无功功率"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "三相电流",
|
|
||||||
id: "3",
|
|
||||||
attr: ["uCurrent", "vCurrent", "wCurrent"],
|
|
||||||
source: ["u电流", "v电流", "w电流"],
|
|
||||||
type: "bar",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeDataType(id){
|
changeDataType(id){
|
||||||
if(id !== this.activeBtn){
|
if(id !== this.activeBtn){
|
||||||
console.log("点击了不同的菜单,更新数据");
|
console.log('点击了不同的菜单,更新数据')
|
||||||
this.activeBtn=id;
|
this.activeBtn=id;
|
||||||
this.getData();
|
this.getData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 更新时间范围 重置图表
|
// 搜索
|
||||||
updateDate(data) {
|
onSearch(){
|
||||||
this.dateRange = data || [];
|
this.getData()
|
||||||
this.getData();
|
},
|
||||||
|
// 重置
|
||||||
|
onReset(){
|
||||||
|
// this.pcs = this.pcsOptions.length > 0 ?this.pcsOptions[0].id : ''
|
||||||
|
this.dateRange=[]
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
getPcsList(){
|
||||||
|
return getPcsNameList(this.siteId).then(response => {
|
||||||
|
const data = response?.data || [];
|
||||||
|
this.pcsOptions = data
|
||||||
|
this.pcs = data.length>0?data[0].id:'';
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getData(){
|
getData(){
|
||||||
const {siteId, activeBtn} = this;
|
const {siteId,pcs,activeBtn}=this;
|
||||||
const [start = "", end = ""] = this.dateRange || [];
|
const [start='',end='']=(this.dateRange || [])
|
||||||
|
if(!pcs) return
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
//接口调用完成之后 设置图表、结束loading
|
//接口调用完成之后 设置图表、结束loading
|
||||||
getPCSData({
|
getPCSData({siteId,deviceId:pcs,startTime:formatDate(start),endTime:formatDate(end),dataType:activeBtn}).then(response => {
|
||||||
siteId,
|
this.setOption(response?.data || [])
|
||||||
startTime: formatDate(start),
|
}).finally(()=>{this.loading=false;})
|
||||||
endTime: formatDate(end),
|
|
||||||
dataType: activeBtn,
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.setOption(response?.data || []);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
compareDate(date1, date2) {
|
|
||||||
console.log("比较时间", date1, date2);
|
|
||||||
// 年2025-09/天2025-09-15/时2025-09-15/10:00
|
|
||||||
if (date1.indexOf(":") > -1 && date2.indexOf(":") > -1) {
|
|
||||||
return parseInt(date1) - parseInt(date2);
|
|
||||||
}
|
|
||||||
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
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(data) {
|
||||||
const ele = this.btnList.find((item) => {
|
const ele = this.btnList.find((item)=>{return item.id === this.activeBtn})
|
||||||
return item.id === this.activeBtn;
|
const source = JSON.parse(JSON.stringify(ele.source))
|
||||||
});
|
const length = ele.attr.length
|
||||||
const sourceBase = JSON.parse(JSON.stringify(ele.source));
|
const series = []
|
||||||
// sourceBase={name:'堆平均维度',id:'1',attr:['temp'],source:['有功功率']},
|
|
||||||
const source = [];
|
|
||||||
const sourceTop = ["日期"];
|
|
||||||
let map = {},
|
|
||||||
mapArr = [];
|
|
||||||
// 生成所有{日期:[],日期:[]}格式的对象和所有包含所有日期的[日期1,日期2...]
|
|
||||||
data.forEach((item)=>{
|
data.forEach((item)=>{
|
||||||
item.dataList.forEach((inner) => {
|
const arr = ele.attr.map(key=>item[key])
|
||||||
// 日期格式
|
source.push([item.statisDate,...arr])
|
||||||
// 年2025-09/天2025-09-15/时2025-09-15/10:00
|
})
|
||||||
// 所有数据的日期格式一致
|
ele.attr.forEach((item)=>{
|
||||||
if (!map[inner.statisDate]) {
|
series.push({
|
||||||
map[inner.statisDate] = [];
|
name:length>1?item:ele.name,
|
||||||
mapArr.push(inner.statisDate);
|
type:ele.type || 'scatter'
|
||||||
}
|
})
|
||||||
});
|
})
|
||||||
});
|
this.chart.setOption({
|
||||||
data.forEach((item, itemIndex) => {
|
color:['#FFBD00','#3C81FF','#91cc74'],
|
||||||
const dataTimeList = item.dataList.map((i) => i.statisDate);
|
|
||||||
const noDataTime = mapArr.filter((i) => !dataTimeList.includes(i));
|
|
||||||
sourceBase.forEach((outer, outerIndex) => {
|
|
||||||
sourceTop.push(`${item.deviceId}-${outer}`);
|
|
||||||
noDataTime.forEach((i) => map[i].push(""));
|
|
||||||
item.dataList.forEach((inner, innerIndex) => {
|
|
||||||
map[inner.statisDate].push(inner[ele.attr[outerIndex]]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
mapArr = mapArr.sort((a, b) => this.compareDate(a, b));
|
|
||||||
mapArr.forEach((item) => {
|
|
||||||
source.push([item, ...map[item]]);
|
|
||||||
});
|
|
||||||
source.unshift(sourceTop);
|
|
||||||
this.chart.setOption(
|
|
||||||
{
|
|
||||||
grid: {
|
|
||||||
containLabel: true,
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: "center",
|
left: 'center',
|
||||||
top: "10",
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||||
// 坐标轴指示器,坐标轴触发有效
|
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
textStyle:{
|
textStyle:{
|
||||||
color:"#333333",
|
color:"#333333",
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: "category",
|
type: 'category',
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: 'value',
|
||||||
},
|
},
|
||||||
dataZoom: [
|
|
||||||
{
|
|
||||||
type: "inside",
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
dataset: {source},
|
dataset: {source},
|
||||||
series: source[0].slice(1).map((item) => {
|
series
|
||||||
return {
|
|
||||||
type: "line",
|
},true)
|
||||||
smooth: true,
|
|
||||||
areaStyle: {
|
|
||||||
opacity: 0.7,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
true
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
initChart() {
|
initChart() {
|
||||||
this.chart = echarts.init(document.querySelector("#pcsEchart"));
|
this.chart = echarts.init(document.querySelector('#pcsEchart'));
|
||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
this.$nextTick(() => {
|
this.loading = true
|
||||||
this.initChart();
|
this.pcs=''
|
||||||
this.$refs.dateRangeSelect.init(true);
|
this.pcsOptions=[]
|
||||||
});
|
this.dateRange =[]
|
||||||
|
this.initChart()
|
||||||
|
this.getPcsList().then(()=>{
|
||||||
|
if(this.pcs){
|
||||||
|
this.onReset()
|
||||||
|
}else{
|
||||||
|
this.loading=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
mounted(){
|
||||||
|
const now = new Date();
|
||||||
|
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
||||||
|
this.defaultDateRange = [lastMonth, now];
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
if (!this.chart) {
|
if (!this.chart) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.chart.dispose();
|
this.chart.dispose()
|
||||||
this.chart = null;
|
this.chart = null
|
||||||
},
|
},
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,228 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="width:100%" v-loading="loading">
|
|
||||||
<!-- 搜索栏-->
|
|
||||||
<el-form :inline="true" class="select-container">
|
|
||||||
<el-form-item label="时间选择">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="dateRange"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
:clearable="false"
|
|
||||||
:picker-options="pickerOptions"
|
|
||||||
:default-value="defaultDateRange"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<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"
|
|
||||||
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 {getAmmeterRevenueData} from '@/api/ems/dzjk'
|
|
||||||
import {formatDate} from "@/filters/ems";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'DzjkTjbbSybb',
|
|
||||||
mixins: [getQuerySiteId],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
pickerOptions: {
|
|
||||||
disabledDate(time) {
|
|
||||||
return time.getTime() > Date.now();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
defaultDateRange: [],//默认展示的时间
|
|
||||||
dateRange: [],
|
|
||||||
tableData: [],
|
|
||||||
pageSize: 10,//分页栏当前每个数据总数
|
|
||||||
pageNum: 1,//分页栏当前页数
|
|
||||||
totalSize: 0,//table表格数据总数
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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开始搜索
|
|
||||||
this.getData()
|
|
||||||
},
|
|
||||||
// 重置
|
|
||||||
onReset() {
|
|
||||||
this.dateRange = this.defaultDateRange
|
|
||||||
this.pageNum = 1//每次搜索从1开始搜索
|
|
||||||
this.getData()
|
|
||||||
},
|
|
||||||
// 分页
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.pageSize = val;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.pageNum = val
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取数据
|
|
||||||
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(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.dateRange = []
|
|
||||||
this.tableData = []
|
|
||||||
this.totalSize = 0
|
|
||||||
this.pageSize = 10
|
|
||||||
this.pageNum = 1
|
|
||||||
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()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</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;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-table__footer-wrapper {
|
|
||||||
tbody td.el-table__cell {
|
|
||||||
color: #000;
|
|
||||||
font-weight: bolder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -39,12 +39,9 @@ export default {
|
|||||||
source.push([item.dateMonth,item.chargeEnergy,item.disChargeEnergy])
|
source.push([item.dateMonth,item.chargeEnergy,item.disChargeEnergy])
|
||||||
})
|
})
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
bottom: '15',
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|||||||
@ -39,12 +39,9 @@ export default {
|
|||||||
})
|
})
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
color:['#3C81FF','#FFBE29'],
|
color:['#3C81FF','#FFBE29'],
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
bottom: '15',
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|||||||
@ -39,12 +39,9 @@ export default {
|
|||||||
})
|
})
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
color:['#F86F70'],
|
color:['#F86F70'],
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
bottom: '15',
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|||||||
@ -42,12 +42,9 @@ export default {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item'
|
trigger: 'item'
|
||||||
},
|
},
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
bottom: '15',
|
bottom:'10'
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,12 +39,9 @@ export default {
|
|||||||
})
|
})
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
color:['#FFBE01'],
|
color:['#FFBE01'],
|
||||||
grid: {
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
legend: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
bottom: '15',
|
bottom: '10',
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<zd-info></zd-info>
|
<zd-info></zd-info>
|
||||||
<div class="ems-content-container ems-content-container-padding">
|
<div class="ems-content-container ems-content-container-padding">
|
||||||
<div class="content-title">数据概览</div>
|
<div class="content-title">数据概览</div>
|
||||||
<el-row :gutter="15" style="background:#fff;margin:30px 0;">
|
<el-row :gutter="32" style="background:#fff;margin:30px 0;">
|
||||||
<el-col :xs="24" :sm="12" :lg="12">
|
<el-col :xs="24" :sm="12" :lg="12">
|
||||||
<dlzb-chart ref="dlzbchart"/>
|
<dlzb-chart ref="dlzbchart"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="15" style="background:#fff;margin:0;">
|
<el-row :gutter="32" style="background:#fff;margin:0;">
|
||||||
<el-col :xs="24" :sm="8" :lg="8">
|
<el-col :xs="24" :sm="8" :lg="8">
|
||||||
<gjqs-chart ref="gjqsChart"/>
|
<gjqs-chart ref="gjqsChart"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@ -1,136 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="time-range">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="dateRange"
|
|
||||||
:type="type"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始时间"
|
|
||||||
:format="valueFormat"
|
|
||||||
:value-format="valueFormat"
|
|
||||||
: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>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {formatDate} from '@/filters/ems'
|
|
||||||
export default {
|
|
||||||
props:{
|
|
||||||
dataUnit:{
|
|
||||||
type:Number,
|
|
||||||
default:1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed:{
|
|
||||||
type(){
|
|
||||||
return this.dataUnit === 3 ? 'daterange' : 'datetimerange'
|
|
||||||
},
|
|
||||||
valueFormat(){
|
|
||||||
return this.dataUnit === 3 ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'
|
|
||||||
},
|
|
||||||
disabledNextBtn(){
|
|
||||||
if(this.dateRange && this.dateRange.length ===2){
|
|
||||||
return new Date(this.dateRange[1]) >= new Date(this.defaultDateRange[1])
|
|
||||||
}else{
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading:false,
|
|
||||||
dateRange:[],
|
|
||||||
defaultDateRange:[],
|
|
||||||
pickerOptions:{
|
|
||||||
disabledDate(time) {
|
|
||||||
return time.getTime() > Date.now();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(){
|
|
||||||
const {dataUnit} = this
|
|
||||||
const timeDis= dataUnit === 3? 30 * 24 * 60 * 60 * 1000 :dataUnit === 2 ? 24 * 60 * 60 * 1000 : 60 * 60 * 1000
|
|
||||||
const now = new Date(),formatNow = formatDate(now.getTime(),dataUnit !== 3 );
|
|
||||||
const timeAgo = formatDate(new Date(now.getTime() - timeDis),dataUnit !== 3)
|
|
||||||
this.dateRange = [timeAgo, formatNow];
|
|
||||||
this.defaultDateRange=[timeAgo, formatNow];
|
|
||||||
console.log('init',timeAgo,formatNow)
|
|
||||||
this.$emit('initDate',this.dateRange || [])
|
|
||||||
},
|
|
||||||
showBtnLoading(status){
|
|
||||||
this.loading = status
|
|
||||||
},
|
|
||||||
// 切换分、时、天 重置时间可选范围
|
|
||||||
resetDate(){
|
|
||||||
this.dateRange = this.defaultDateRange
|
|
||||||
},
|
|
||||||
//重置 设置时间范围为初始化时间段
|
|
||||||
reset(){
|
|
||||||
this.resetDate()
|
|
||||||
this.$emit('updateDate',this.dateRange || [])
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
search(){
|
|
||||||
if(this.dateRange && this.dateRange.length>0){
|
|
||||||
const {dataUnit} = this
|
|
||||||
const [start,end] = this.dateRange
|
|
||||||
if([1,2].includes(dataUnit)){
|
|
||||||
const startTime = new Date(start),endTime=new Date(end)
|
|
||||||
const timeDis= 7 * 24 * 60 * 60 * 1000
|
|
||||||
if(endTime - startTime > timeDis){
|
|
||||||
this.$message.error(`按分钟或小时查询数据,时间范围不能超过7天`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.$emit('updateDate',this.dateRange || [])
|
|
||||||
}else{
|
|
||||||
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()
|
|
||||||
const nowDis = nowEndTimes - nowStartTimes//用户当前选择时间差 可能=0
|
|
||||||
//baseTime,maxTime 毫秒数
|
|
||||||
const baseDis = this.dataUnit === 3 ? 24 * 60 * 60 * 1000 :60 * 60 * 1000
|
|
||||||
const calcDis = nowDis === 0 ? baseDis : nowDis
|
|
||||||
let start = type === 'before' ? nowStartTimes - calcDis : nowStartTimes + calcDis
|
|
||||||
if(start>maxTime) start=maxTime
|
|
||||||
let end = type === 'before' ? nowEndTimes - calcDis : nowEndTimes + calcDis
|
|
||||||
if(end>maxTime) end=maxTime
|
|
||||||
this.dateRange = [formatDate(start,this.dataUnit !== 3),formatDate(end,this.dataUnit !== 3)]
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,572 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
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: '请选择站点' }]"
|
|
||||||
>
|
|
||||||
<el-radio-group v-model="form.siteIds" @input="changeSiteIds">
|
|
||||||
<el-radio
|
|
||||||
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: '请选择设备' }]"
|
|
||||||
>
|
|
||||||
<el-radio-group v-model="form.deviceCategory" @input="changeSiteIds">
|
|
||||||
<el-radio
|
|
||||||
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: '请选择单体电池' }]"
|
|
||||||
>
|
|
||||||
<el-cascader
|
|
||||||
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"
|
|
||||||
>
|
|
||||||
<el-autocomplete
|
|
||||||
v-model="form.pointName"
|
|
||||||
placeholder="请输入点位"
|
|
||||||
clearable
|
|
||||||
:fetch-suggestions="querySearchAsync"
|
|
||||||
@select="handleSelect"
|
|
||||||
></el-autocomplete>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="submitForm">生成图表</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<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">
|
|
||||||
<el-radio-group v-model="form.dataUnit">
|
|
||||||
<el-radio :label="1">分钟</el-radio>
|
|
||||||
<el-radio :label="2">小时</el-radio>
|
|
||||||
<el-radio :label="3">天</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</span>
|
|
||||||
<date-time-select
|
|
||||||
ref="dateTimeSelect"
|
|
||||||
:data-unit="form.dataUnit"
|
|
||||||
@initDate="(e) => (form.dataRange = e || [])"
|
|
||||||
@updateDate="updateDate"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div style="height: 350px" id="searchChart"></div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import * as echarts from "echarts";
|
|
||||||
import resize from "@/mixins/ems/resize";
|
|
||||||
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},
|
|
||||||
computed: {
|
|
||||||
isDtdc() {
|
|
||||||
return this.form.deviceCategory === "BATTERY";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
"form.siteIds": {
|
|
||||||
handler(newVal) {
|
|
||||||
newVal && this.isDtdc && this.getChildList();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
isDtdc: {
|
|
||||||
handler(newVal) {
|
|
||||||
newVal && this.form.siteIds && this.getChildList();
|
|
||||||
!newVal && (this.form.child = []);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"form.dataUnit": {
|
|
||||||
handler(newVal, oldVal) {
|
|
||||||
console.log("wacth到了dataUnit的变化", newVal, oldVal);
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.dateTimeSelect.init();
|
|
||||||
this.getDate();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
chart: null,
|
|
||||||
deviceCategoryList: [], //设备列表
|
|
||||||
siteList: [], //站点列表
|
|
||||||
childOptions: [], //二级设备列表
|
|
||||||
form: {
|
|
||||||
dataRange: [], //时间选择范围
|
|
||||||
child: [],
|
|
||||||
siteIds: "", //当前选中的站点id 默认选中第一个站点
|
|
||||||
deviceCategory: "", //设备
|
|
||||||
pointName: "", //点位
|
|
||||||
dataUnit: 1, //横坐标
|
|
||||||
},
|
|
||||||
loading: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
changeSiteIds(val) {
|
|
||||||
console.log("切换站点或设备清空点位", val);
|
|
||||||
val && (this.form.pointName = "");
|
|
||||||
},
|
|
||||||
getChildList() {
|
|
||||||
this.childOptions = [];
|
|
||||||
this.form.child = [];
|
|
||||||
const {siteIds} = this.form;
|
|
||||||
getAllBatteryIdsBySites([siteIds]).then((response) => {
|
|
||||||
const data = response?.data || {};
|
|
||||||
const base = 50;
|
|
||||||
let options = [];
|
|
||||||
Object.entries(data).forEach(([key, value], index) => {
|
|
||||||
if (!value) value = [];
|
|
||||||
options.push({
|
|
||||||
value: key,
|
|
||||||
label: this.siteList.find((s) => s.siteId === key)?.siteName || "",
|
|
||||||
children: [],
|
|
||||||
});
|
|
||||||
const length = value.length;
|
|
||||||
const num = Math.ceil(length / base);
|
|
||||||
if (num === 0) return;
|
|
||||||
for (let i = 1; i <= num; i++) {
|
|
||||||
const start = (i - 1) * base + 1,
|
|
||||||
end = i * base;
|
|
||||||
options[index].children.push({
|
|
||||||
value: i,
|
|
||||||
label: `${start}-${end}`,
|
|
||||||
children: [],
|
|
||||||
});
|
|
||||||
for (let s = start; s <= Math.min(length, end); s++) {
|
|
||||||
options[index].children[i - 1].children.push({
|
|
||||||
value: value[s - 1],
|
|
||||||
label: value[s - 1],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log("二级设备options", options);
|
|
||||||
this.childOptions = options;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleChildChange(data) {
|
|
||||||
console.log("选择二级设备", data);
|
|
||||||
this.form.child = data;
|
|
||||||
},
|
|
||||||
showLoading() {
|
|
||||||
this.chart && this.chart.showLoading();
|
|
||||||
},
|
|
||||||
hideLoading() {
|
|
||||||
this.chart && this.chart.hideLoading();
|
|
||||||
},
|
|
||||||
initChart() {
|
|
||||||
this.chart = echarts.init(document.querySelector("#searchChart"));
|
|
||||||
},
|
|
||||||
updateDate(val) {
|
|
||||||
this.form.dataRange = val || [];
|
|
||||||
this.getDate();
|
|
||||||
},
|
|
||||||
setOption(data) {
|
|
||||||
// 点位类型 dataType 1-瞬时值 2-累计值 仅当值为2展示差值
|
|
||||||
// 图表类型 chartType 1-曲线图,2-箱线图
|
|
||||||
if (!this.chart) return;
|
|
||||||
this.chart.clear();
|
|
||||||
console.log("返回的数据", data);
|
|
||||||
if (!data || data.length <= 0) {
|
|
||||||
this.$message.warning("暂无数据");
|
|
||||||
}
|
|
||||||
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',
|
|
||||||
// top: '10',
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
containLabel: true,
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
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,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
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",
|
|
||||||
},
|
|
||||||
dataZoom: [
|
|
||||||
{
|
|
||||||
type: "inside",
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
start: 0,
|
|
||||||
end: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
series: dataset,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
submitForm() {
|
|
||||||
this.getDate();
|
|
||||||
},
|
|
||||||
handleSelect(data) {
|
|
||||||
this.form.pointName = data.value;
|
|
||||||
},
|
|
||||||
querySearchAsync(query, cb) {
|
|
||||||
console.log("查询数据", query);
|
|
||||||
if (!this.form.siteIds || !this.form.deviceCategory) {
|
|
||||||
this.$message({
|
|
||||||
type: "warning",
|
|
||||||
message: "请先选择站点和设备",
|
|
||||||
});
|
|
||||||
return cb([]);
|
|
||||||
}
|
|
||||||
pointFuzzyQuery({
|
|
||||||
siteIds: [this.form.siteIds],
|
|
||||||
deviceCategory: this.form.deviceCategory,
|
|
||||||
pointName: query,
|
|
||||||
}).then((response) => {
|
|
||||||
const data = response?.data || [];
|
|
||||||
cb(
|
|
||||||
data.map((item) => {
|
|
||||||
return {name: item, value: item};
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 获取所有设备
|
|
||||||
getDeviceCategory() {
|
|
||||||
return getAllDeviceCategory().then((response) => {
|
|
||||||
this.deviceCategoryList = response?.data || [];
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getZdList() {
|
|
||||||
return getAllSites()
|
|
||||||
.then((response) => {
|
|
||||||
this.siteList = response.data || [];
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getDate() {
|
|
||||||
this.$refs.form.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (!this.form.pointName) {
|
|
||||||
return this.$message.error("请输入正确的点位");
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
this.isDtdc &&
|
|
||||||
(this.form.child.length === 0 || this.form.child.length > 5)
|
|
||||||
) {
|
|
||||||
return this.$message.error("请选择单体电池且不能超过5个");
|
|
||||||
}
|
|
||||||
const {
|
|
||||||
siteIds,
|
|
||||||
dataUnit,
|
|
||||||
deviceCategory,
|
|
||||||
pointName,
|
|
||||||
dataRange: [start = "", end = ""],
|
|
||||||
child,
|
|
||||||
} = this.form;
|
|
||||||
if (!start || !end) return this.$message.error("请选择时间");
|
|
||||||
let siteDeviceMap = {};
|
|
||||||
child.forEach(([first, second, third]) => {
|
|
||||||
if (siteDeviceMap[first]) {
|
|
||||||
siteDeviceMap[first].push(third);
|
|
||||||
} else {
|
|
||||||
siteDeviceMap[first] = [];
|
|
||||||
siteDeviceMap[first].push(third);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let startDate, endDate;
|
|
||||||
if (start && dataUnit === 3) {
|
|
||||||
// startDate= start + `${dataUnit === 2 ? ':00' : ' 00:00:00'}`
|
|
||||||
startDate = start + " 00:00:00";
|
|
||||||
} else {
|
|
||||||
startDate = start;
|
|
||||||
}
|
|
||||||
if (end && dataUnit === 3) {
|
|
||||||
// endDate= end + `${dataUnit === 2 ? ':00' : ' 00:00:00'}`
|
|
||||||
endDate = end + " 00:00:00";
|
|
||||||
} else {
|
|
||||||
endDate = end;
|
|
||||||
}
|
|
||||||
this.loading = true;
|
|
||||||
getPointValueList({
|
|
||||||
siteIds: [siteIds],
|
|
||||||
dataUnit,
|
|
||||||
deviceCategory,
|
|
||||||
pointName,
|
|
||||||
startDate,
|
|
||||||
endDate,
|
|
||||||
siteDeviceMap,
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.setOption(response?.data || []);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
beforeDestroy() {
|
|
||||||
if (!this.chart) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.chart.dispose();
|
|
||||||
this.chart = null;
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loading = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.initChart();
|
|
||||||
this.$refs.dateTimeSelect.init();
|
|
||||||
Promise.all([this.getDeviceCategory(), this.getZdList()]).finally(
|
|
||||||
() => (this.loading = false)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
@ -1,146 +0,0 @@
|
|||||||
<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="400px" 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" :disabled="mode === 'edit'" placeholder="请选择站点" :loading="searchLoading" loading-text="正在加载数据">
|
|
||||||
<el-option v-for="(item,index) in siteList" :key="index+'zdxeSelect'" :label="item.siteName" :value="item.siteId" ></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="消息等级" prop="qos">
|
|
||||||
<el-select v-model="formData.qos" placeholder="请选择消息等级">
|
|
||||||
<el-option :value="1">1</el-option>
|
|
||||||
<el-option :value="2">2</el-option>
|
|
||||||
<el-option :value="3">3</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="订阅topic" prop="mqttTopic">
|
|
||||||
<el-input v-model="formData.mqttTopic" placeholder="请输入" clearable :style="{width: '100%'}">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="topic描述" prop="topicName">
|
|
||||||
<el-input v-model="formData.topicName" type="textarea" placeholder="请输入" clearable :style="{width: '100%'}">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer">
|
|
||||||
<el-button @click="closeDialog">取消</el-button>
|
|
||||||
<el-button type="primary" @click="saveDialog">确定</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import {editMqtt,addMqtt,getMqttDetail} from "@/api/ems/site";
|
|
||||||
import {getAllSites} from '@/api/ems/zddt'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading:0,
|
|
||||||
siteList:[],
|
|
||||||
searchLoading:false,
|
|
||||||
dialogTableVisible:false,
|
|
||||||
mode:'',
|
|
||||||
formData: {
|
|
||||||
id:'',//设备唯一标识
|
|
||||||
siteId:'',
|
|
||||||
qos:'',
|
|
||||||
topicName:'',
|
|
||||||
mqttTopic:''
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
siteId:[
|
|
||||||
{ required: true, message: '请选择站点', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
qos:[
|
|
||||||
{ required: true, message: '请选择消息等级', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
mqttTopic:[
|
|
||||||
{ required: true, message: '请输入订阅topic', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
topicName:[
|
|
||||||
{ required: true, message: '请输入topic描述', trigger: 'blur'},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showDialog(id){
|
|
||||||
this.dialogTableVisible = true
|
|
||||||
this.getZdList()
|
|
||||||
if(id){
|
|
||||||
this.mode = 'edit'
|
|
||||||
this.formData.id = id
|
|
||||||
this.getDetail(id)
|
|
||||||
}else{
|
|
||||||
this.mode = 'add'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//获取站点列表
|
|
||||||
getZdList(){
|
|
||||||
this.searchLoading=true
|
|
||||||
getAllSites().then(response => {
|
|
||||||
this.siteList = response?.data || []
|
|
||||||
}).finally(() => {this.searchLoading=false})
|
|
||||||
},
|
|
||||||
getDetail(id){
|
|
||||||
getMqttDetail(id).then(response => {
|
|
||||||
const {topicName='',mqttTopic='',qos='',siteId=''} = JSON.parse(JSON.stringify(response?.data || {}));
|
|
||||||
this.formData.mqttTopic=mqttTopic;
|
|
||||||
this.formData.topicName=topicName;
|
|
||||||
this.formData.qos=qos;
|
|
||||||
this.formData.siteId=siteId;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
saveDialog() {
|
|
||||||
this.$refs.addTempForm.validate(valid => {
|
|
||||||
if (!valid) return
|
|
||||||
this.loading+=1
|
|
||||||
const {
|
|
||||||
id='',
|
|
||||||
siteId='',
|
|
||||||
qos='',
|
|
||||||
mqttTopic='',//站点ID
|
|
||||||
topicName='',//设备id
|
|
||||||
}= this.formData;
|
|
||||||
if(this.mode === 'add'){
|
|
||||||
addMqtt( {mqttTopic,topicName,siteId,qos}).then(response => {
|
|
||||||
if(response.code === 200){
|
|
||||||
//新增成功
|
|
||||||
// 关闭弹窗 更新表格
|
|
||||||
this.$emit('update')
|
|
||||||
this.closeDialog()
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading-=1
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
editMqtt({mqttTopic,topicName,id,siteId,qos}).then(response => {
|
|
||||||
if(response.code === 200){
|
|
||||||
//新增成功
|
|
||||||
// 关闭弹窗 更新表格
|
|
||||||
this.$emit('update')
|
|
||||||
this.closeDialog()
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading-=1
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
closeDialog(){
|
|
||||||
this.$emit('clear')
|
|
||||||
// 清空所有数据
|
|
||||||
this.formData= {
|
|
||||||
id:'',//设备唯一标识
|
|
||||||
mqttTopic:'',
|
|
||||||
topicName:''
|
|
||||||
}
|
|
||||||
this.$refs.addTempForm.resetFields()
|
|
||||||
this.dialogTableVisible=false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
||||||
@ -1,201 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ems-dashboard-editor-container" style="background-color: #ffffff" v-loading="loading">
|
|
||||||
<el-form :inline="true" class="select-container">
|
|
||||||
<el-form-item label="站点选择">
|
|
||||||
<el-select v-model="form.siteId" placeholder="请选择换电站名称" :loading="searchLoading" loading-text="正在加载数据" clearable>
|
|
||||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'zdxeSelect'"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="订阅topic">
|
|
||||||
<el-input
|
|
||||||
v-model="form.mqttTopic"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入订阅topic"
|
|
||||||
style="width: 150px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="topic描述">
|
|
||||||
<el-input
|
|
||||||
v-model="form.topicName"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入topic描述"
|
|
||||||
style="width: 150px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button native-type="button" type="primary" @click="onSearch">搜索</el-button>
|
|
||||||
<el-button native-type="button" @click="onReset">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-button type="primary" @click="addPowerConfig('')">新增</el-button>
|
|
||||||
<el-table
|
|
||||||
:data="tableData"
|
|
||||||
class="common-table"
|
|
||||||
max-height="600px"
|
|
||||||
stripe
|
|
||||||
style="width: 100%;margin-top: 25px">
|
|
||||||
<el-table-column
|
|
||||||
label="站点"
|
|
||||||
prop="siteId">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="消息等级"
|
|
||||||
prop="qos">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="订阅topic"
|
|
||||||
prop="mqttTopic">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="topic描述"
|
|
||||||
prop="topicName">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
fixed="right"
|
|
||||||
label="操作">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
style="margin-top:10px;"
|
|
||||||
type="warning"
|
|
||||||
@click="addPowerConfig(scope.row.id)">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
style="margin-top:10px;"
|
|
||||||
type="danger"
|
|
||||||
@click="deleteMqtt(scope.row)">
|
|
||||||
删除
|
|
||||||
</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"
|
|
||||||
>
|
|
||||||
</el-pagination>
|
|
||||||
<add-mqtt ref="addMqtt" @update="getData"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {deleteMqtt,getMqttList} from '@/api/ems/site'
|
|
||||||
import {getAllSites} from '@/api/ems/zddt'
|
|
||||||
import AddMqtt from './AddMqtt.vue'
|
|
||||||
export default {
|
|
||||||
name: "Mqtt",
|
|
||||||
components: {AddMqtt},
|
|
||||||
computed: { },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
form:{
|
|
||||||
siteId:"",
|
|
||||||
topicName:'',
|
|
||||||
mqttTopic:''
|
|
||||||
},
|
|
||||||
siteList:[],
|
|
||||||
searchLoading:false,
|
|
||||||
loading:false,
|
|
||||||
tableData:[],
|
|
||||||
pageSize:10,//分页栏当前每个数据总数
|
|
||||||
pageNum:1,//分页栏当前页数
|
|
||||||
totalSize:0,//table表格数据总数
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
// 分页
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.pageSize = val;
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
this.getData()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.pageNum = val
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
this.getData()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
onSearch(){
|
|
||||||
this.pageNum =1//每次搜索从1开始搜索
|
|
||||||
this.getData()
|
|
||||||
},
|
|
||||||
onReset(){
|
|
||||||
this.form={
|
|
||||||
siteId:'',
|
|
||||||
topicName:'',
|
|
||||||
mqttTopic:''
|
|
||||||
}
|
|
||||||
this.pageNum =1//每次搜索从1开始搜索
|
|
||||||
this.getData()
|
|
||||||
},
|
|
||||||
//获取站点列表
|
|
||||||
getZdList(){
|
|
||||||
this.searchLoading=true
|
|
||||||
return getAllSites().then(response => {
|
|
||||||
this.siteList = response?.data || []
|
|
||||||
// if( this.siteList.length>0 ) this.siteId = this.siteList[0].siteId
|
|
||||||
}).finally(() => {this.searchLoading=false})
|
|
||||||
},
|
|
||||||
getData(){
|
|
||||||
this.loading=true;
|
|
||||||
const {mqttTopic,topicName,siteId} = this.form;
|
|
||||||
const {pageNum,pageSize} = this;
|
|
||||||
getMqttList({pageNum,pageSize,mqttTopic,topicName,siteId}).then(response => {
|
|
||||||
this.tableData=response?.rows || [];
|
|
||||||
this.totalSize = response?.total || 0
|
|
||||||
}).finally(() => {this.loading=false})
|
|
||||||
},
|
|
||||||
addPowerConfig(id=''){
|
|
||||||
this.$refs.addMqtt.showDialog(id);
|
|
||||||
},
|
|
||||||
deleteMqtt(row){
|
|
||||||
this.$confirm(`确认要删除该配置吗?`, {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
showClose:false,
|
|
||||||
closeOnClickModal:false,
|
|
||||||
type: 'warning',
|
|
||||||
beforeClose: (action, instance, done) => {
|
|
||||||
if (action === 'confirm') {
|
|
||||||
instance.confirmButtonLoading = true;
|
|
||||||
deleteMqtt(row.id).then(response => {
|
|
||||||
response.code === 200 && done();
|
|
||||||
}).finally(() => {
|
|
||||||
instance.confirmButtonLoading = false;
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).then(() => {
|
|
||||||
//只有在废弃成功的情况下会走到这里
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '删除成功!'
|
|
||||||
});
|
|
||||||
this.getData()
|
|
||||||
//调用接口 更新表格数据
|
|
||||||
}).catch(() => {
|
|
||||||
//取消关机
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loading=true
|
|
||||||
this.getZdList()
|
|
||||||
this.getData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,306 +0,0 @@
|
|||||||
//选择年月 配置尖峰平谷对应的电价 配置24小时选择对应的尖峰平谷
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-dialog v-loading="loading" width="780px" :visible.sync="dialogTableVisible" class="ems-dialog" title="电价配置" :close-on-click-modal="false" :show-close="false">
|
|
||||||
<div class="items-container">
|
|
||||||
<div class="item-title">站点:</div>
|
|
||||||
<div class="item-content">
|
|
||||||
<el-select v-model="siteId" :disabled="mode === 'edit'" placeholder="请选择站点" :loading="searchLoading" loading-text="正在加载数据">
|
|
||||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'zdxeSelect'"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="items-container">
|
|
||||||
<div class="item-title">时间:</div>
|
|
||||||
<div class="item-content">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="powerDate"
|
|
||||||
format="yyyy-MM"
|
|
||||||
value-format="yyyy-MM"
|
|
||||||
type="month"
|
|
||||||
placeholder="请选择月份"
|
|
||||||
:disabled="mode === 'edit'"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="display: flex">
|
|
||||||
<div class="items-container price-types" v-for="item in priceTypeOptions" :key="item.id">
|
|
||||||
<div class="item-title">{{item.name}}:</div>
|
|
||||||
<div class="item-content">
|
|
||||||
<el-input
|
|
||||||
placeholder="请输入价格"
|
|
||||||
v-model="item.price">
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="items-container">
|
|
||||||
<div class="item-title">
|
|
||||||
<el-button
|
|
||||||
@click.native.prevent="addRow"
|
|
||||||
block
|
|
||||||
type="primary"
|
|
||||||
size="mini">
|
|
||||||
新增时间段配置
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="time-lists-container">
|
|
||||||
<div class="time-lists time-lists-title">
|
|
||||||
<div>开始时间</div>
|
|
||||||
<div>结束时间(不包括)</div>
|
|
||||||
<div>电价</div>
|
|
||||||
<div>操作</div>
|
|
||||||
</div>
|
|
||||||
<div class="time-lists" v-for="(item,index) in hoursOptions" :key="'hoursOptions'+index">
|
|
||||||
<div>
|
|
||||||
<el-time-select
|
|
||||||
placeholder="开始时间"
|
|
||||||
v-model="item.startTime"
|
|
||||||
:picker-options="{
|
|
||||||
start: '00:00',
|
|
||||||
step: '01:00',
|
|
||||||
end: '23:00',
|
|
||||||
}">
|
|
||||||
</el-time-select>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-time-select
|
|
||||||
placeholder="结束时间"
|
|
||||||
v-model="item.endTime"
|
|
||||||
:picker-options="{
|
|
||||||
start: '00:00',
|
|
||||||
step: '01:00',
|
|
||||||
end: '24:00',
|
|
||||||
minTime: item.startTime
|
|
||||||
}">
|
|
||||||
</el-time-select>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-select v-model="item.costType" placeholder="请选择">
|
|
||||||
<el-option v-for="(value,key) in priceTypeOptions" :key="key+'priceTypeOptions'" :label="value.name" :value="value.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button
|
|
||||||
@click.native.prevent="deleteRow(index)"
|
|
||||||
type="warning"
|
|
||||||
size="mini">
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div slot="footer">
|
|
||||||
<el-button @click="closeDialog">取消</el-button>
|
|
||||||
<el-button type="primary" @click="saveDialog">确定</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import {addPriceConfig,editPriceConfig,detailPriceConfig} from '@/api/ems/powerTariff'
|
|
||||||
import {getAllSites} from '@/api/ems/zddt'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mode:'',
|
|
||||||
id:'',
|
|
||||||
searchLoading:false,
|
|
||||||
siteId:'',
|
|
||||||
siteList:[],
|
|
||||||
powerDate:'',//时间
|
|
||||||
//尖-peak,峰-high,平-flat,谷=valley
|
|
||||||
priceTypeOptions:[{
|
|
||||||
id:'peak',
|
|
||||||
name:'尖',
|
|
||||||
price:''
|
|
||||||
},{
|
|
||||||
id:'high',
|
|
||||||
name:'峰',
|
|
||||||
price:''
|
|
||||||
},{
|
|
||||||
id:'flat',
|
|
||||||
name:'平',
|
|
||||||
price:''
|
|
||||||
},{
|
|
||||||
id:'valley',
|
|
||||||
name:'谷',
|
|
||||||
price:''
|
|
||||||
}],
|
|
||||||
hoursOptions:[],
|
|
||||||
loading:false,
|
|
||||||
dialogTableVisible:false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
addRow(){
|
|
||||||
this.hoursOptions.push({
|
|
||||||
startTime:'',
|
|
||||||
endTime:'',
|
|
||||||
costType:''
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deleteRow(index){
|
|
||||||
this.hoursOptions.splice(index,1)
|
|
||||||
},
|
|
||||||
//获取站点列表
|
|
||||||
getZdList(){
|
|
||||||
this.searchLoading=true
|
|
||||||
getAllSites().then(response => {
|
|
||||||
this.siteList = response?.data || []
|
|
||||||
}).finally(() => {this.searchLoading=false})
|
|
||||||
},
|
|
||||||
showDialog(id){
|
|
||||||
this.getZdList()
|
|
||||||
this.id = id
|
|
||||||
if(id) {
|
|
||||||
this.mode='edit'
|
|
||||||
//获取详情 初始化hoursOptions
|
|
||||||
this.loading = true
|
|
||||||
detailPriceConfig(id).then(response => {
|
|
||||||
const data = response?.data || {}
|
|
||||||
this.siteId = data?.siteId || ''
|
|
||||||
this.hoursOptions = data?.range || []
|
|
||||||
this.powerDate=data?.year && data?.month ? data.year +'-'+data.month : ''
|
|
||||||
this.priceTypeOptions.forEach(item=>{
|
|
||||||
item.price = data[item.id]
|
|
||||||
})
|
|
||||||
}).finally(()=>this.loading = false)
|
|
||||||
}else {
|
|
||||||
this.mode='add'
|
|
||||||
}
|
|
||||||
this.dialogTableVisible=true
|
|
||||||
},
|
|
||||||
saveDialog() {
|
|
||||||
if(this.siteId === '') return this.$message.error('请选择站点')
|
|
||||||
if(this.powerDate === '') return this.$message.error('请选择时间')
|
|
||||||
let priceArr=[]
|
|
||||||
this.priceTypeOptions.forEach(item=>{
|
|
||||||
!['0',0].includes(item.price) && !item.price && priceArr.push(item.name)
|
|
||||||
})
|
|
||||||
if(priceArr.length>0) return this.$message.error(`请配置${priceArr.join(',')}的电价`)
|
|
||||||
|
|
||||||
if(this.hoursOptions.length<=0) return this.$message.error(`请配置24小时的电价`)
|
|
||||||
let hours=false,hourDis=false
|
|
||||||
this.hoursOptions.forEach(item=>{
|
|
||||||
if(!item.startTime || !item.endTime || !item.costType ) hours=true
|
|
||||||
if(parseInt(item.startTime)>=parseInt(item.endTime)) hourDis=true
|
|
||||||
})
|
|
||||||
if(hours) return this.$message.error(`时间段电价配置错误`)
|
|
||||||
if(hourDis) return this.$message.error(`结束时间要大于开始时间`)
|
|
||||||
let hoursMap={}
|
|
||||||
this.hoursOptions.forEach(item=>{
|
|
||||||
let s = parseInt(item.startTime),e=parseInt(item.endTime)
|
|
||||||
for(s;s<e;s++){
|
|
||||||
if(!hoursMap[s]) hoursMap[s]=1
|
|
||||||
else hoursMap[s]+=1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log('hoursMap======',hoursMap)
|
|
||||||
if(Object.values(hoursMap).length<24 || Object.values(hoursMap).find(i=>i>1)) return this.$message.error(`请配置24小时的电价且时间不能重复`)
|
|
||||||
const {powerDate,priceTypeOptions,hoursOptions,mode,id,siteId} =this
|
|
||||||
this.loading = true
|
|
||||||
let params={
|
|
||||||
year:powerDate.split('-')[0],
|
|
||||||
month:parseInt(powerDate.split('-')[1]),
|
|
||||||
range:hoursOptions,
|
|
||||||
siteId,
|
|
||||||
}
|
|
||||||
priceTypeOptions.forEach(item=>{params[item.id]=item.price})
|
|
||||||
if(mode === 'edit') params.id = id
|
|
||||||
console.log('参数=======',params)
|
|
||||||
//调接口传数据 区分新增还是修改 成功之后关闭弹窗 更新表格
|
|
||||||
if(mode === 'add'){
|
|
||||||
addPriceConfig(params).then(response => {
|
|
||||||
if(response.code === 200){
|
|
||||||
this.$emit('update')
|
|
||||||
this.closeDialog()
|
|
||||||
}else{
|
|
||||||
this.$message.error('新增失败')
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
editPriceConfig(params).then(response => {
|
|
||||||
if(response.code === 200){
|
|
||||||
this.$emit('update')
|
|
||||||
this.closeDialog()
|
|
||||||
}else{
|
|
||||||
this.$message.error('修改失败')
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
closeDialog(){
|
|
||||||
// 清空所有数据
|
|
||||||
this.$emit('clear')
|
|
||||||
this.mode=''
|
|
||||||
this.id=''
|
|
||||||
this.siteId=''
|
|
||||||
this.siteList=[]
|
|
||||||
this.searchLoading=false
|
|
||||||
this.powerDate=''
|
|
||||||
this.hoursOptions=[]
|
|
||||||
this.priceTypeOptions.forEach(item=>{
|
|
||||||
item.price=''
|
|
||||||
})
|
|
||||||
this.dialogTableVisible=false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.items-container{
|
|
||||||
margin-bottom: 20px;
|
|
||||||
.item-title{
|
|
||||||
line-height: 16px;
|
|
||||||
padding: 10px 0;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.price-types{
|
|
||||||
width: 150px;
|
|
||||||
&:not(:last-child){
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.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;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -1,208 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ems-dashboard-editor-container" style="background-color: #ffffff" v-loading="loading">
|
|
||||||
<el-form :inline="true" class="select-container">
|
|
||||||
<el-form-item label="站点选择">
|
|
||||||
<el-select v-model="siteId" placeholder="请选择换电站名称" :loading="searchLoading" loading-text="正在加载数据" @change="onSearch" clearable>
|
|
||||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'zdxeSelect'"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="年份选择">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="defaultYear"
|
|
||||||
type="year"
|
|
||||||
:clearable="false"
|
|
||||||
placeholder="请选择年份"
|
|
||||||
align="center"
|
|
||||||
format="yyyy年"
|
|
||||||
value-format="yyyy"
|
|
||||||
@change="changeDefaultYear"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<br>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="addPowerConfig('')">新增电价配置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div class="month-lists-container" v-infinite-scroll="getData" infinite-scroll-immediate="false">
|
|
||||||
<el-empty v-show="tableData.length<=0" :image-size="200"></el-empty>
|
|
||||||
<el-card
|
|
||||||
shadow="always"
|
|
||||||
class="common-card-container time-range-card"
|
|
||||||
v-for="item in tableData"
|
|
||||||
:key="item.id"
|
|
||||||
>
|
|
||||||
<div slot="header" class="time-range-header">
|
|
||||||
<span class="card-title">{{siteList.find(i=>i.siteId===item.siteId).siteName || item.siteId || ''}}-{{item.month}}月电价时段划分</span>
|
|
||||||
<div>
|
|
||||||
<el-button type="primary" size="mini" @click="addPowerConfig(item.id)">编辑</el-button>
|
|
||||||
<el-button type="warning" size="mini" @click="deletePowerConfig(item)">删除</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="price-table-container">
|
|
||||||
<div class="price-table">
|
|
||||||
<div class="time-list">
|
|
||||||
<div class="time"> </div>
|
|
||||||
<div class="type">时段</div>
|
|
||||||
<div class="price">电价(元/kWh)</div>
|
|
||||||
</div>
|
|
||||||
<div class="time-list" v-for="(rangeItem,rangeIndex) in item.range" :key="rangeIndex+'price'">
|
|
||||||
<div class="time">{{`${rangeItem.startTime}-${rangeItem.endTime}`}}</div>
|
|
||||||
<div class="type">{{priceTypeOptions[rangeItem.costType]}}</div>
|
|
||||||
<div class="price">{{item[rangeItem.costType]}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
<add-power-tariff ref="addPowerTariff" @update="getData(true)"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {energyPriceConfig,listPriceConfig} from '@/api/ems/powerTariff'
|
|
||||||
import {getAllSites} from '@/api/ems/zddt'
|
|
||||||
import AddPowerTariff from './AddPowerTariff.vue'
|
|
||||||
import DateTimeSelect from "@/views/ems/search/DateTimeSelect.vue";
|
|
||||||
export default {
|
|
||||||
name: "PowerTariff",
|
|
||||||
components: {DateTimeSelect, AddPowerTariff},
|
|
||||||
computed: { },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading:false,
|
|
||||||
pageNum:1,
|
|
||||||
pageSize:40,
|
|
||||||
searchLoading:false,
|
|
||||||
siteId:'',
|
|
||||||
siteList:[],
|
|
||||||
tableData:[],
|
|
||||||
tableTotal:0,
|
|
||||||
defaultYear:'',
|
|
||||||
pickerOptions:{
|
|
||||||
disabledDate(time) {
|
|
||||||
return time.getFullYear() >= new Date().getFullYear()+1;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
priceTypeOptions:{
|
|
||||||
'peak':'尖',
|
|
||||||
'high':'峰',
|
|
||||||
'flat':'平',
|
|
||||||
'valley':'谷'
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
resetTableData(){
|
|
||||||
this.tableData=[]
|
|
||||||
this.tableTotal=0
|
|
||||||
this.pageNum=1
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
onSearch(){
|
|
||||||
this.getData(true)
|
|
||||||
},
|
|
||||||
//获取站点列表
|
|
||||||
getZdList(){
|
|
||||||
this.searchLoading=true
|
|
||||||
return getAllSites().then(response => {
|
|
||||||
this.siteList = response?.data || []
|
|
||||||
if( this.siteList.length>0 ) this.siteId = this.siteList[0].siteId
|
|
||||||
}).finally(() => {this.searchLoading=false})
|
|
||||||
},
|
|
||||||
changeDefaultYear(){
|
|
||||||
this.getData(true)
|
|
||||||
},
|
|
||||||
getData(reset=false){
|
|
||||||
reset && this.resetTableData()
|
|
||||||
if(!reset && this.tableData.length>=this.tableTotal) return
|
|
||||||
this.loading=true;
|
|
||||||
const date = new Date(this.defaultYear).getFullYear()
|
|
||||||
const startTime = date+'-01',endTime = date+'-12'
|
|
||||||
listPriceConfig({startTime,endTime,pageNum:this.pageNum,pageSize:this.pageSize,siteId:this.siteId}).then(response => {
|
|
||||||
const data = JSON.parse(JSON.stringify(response?.rows || []))
|
|
||||||
data.length > 0 && (this.pageNum += 1)
|
|
||||||
this.tableData.push(...data)
|
|
||||||
this.tableTotal=response?.total || 0
|
|
||||||
}).finally(() => {this.loading=false})
|
|
||||||
},
|
|
||||||
addPowerConfig(id=''){
|
|
||||||
this.$refs.addPowerTariff.showDialog(id);
|
|
||||||
},
|
|
||||||
deletePowerConfig(row){
|
|
||||||
this.$confirm(`确认要删除${row.month}月的电价配置吗?`, {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
showClose:false,
|
|
||||||
closeOnClickModal:false,
|
|
||||||
type: 'warning',
|
|
||||||
beforeClose: (action, instance, done) => {
|
|
||||||
if (action === 'confirm') {
|
|
||||||
instance.confirmButtonLoading = true;
|
|
||||||
energyPriceConfig(row.id).then(response => {
|
|
||||||
response.code === 200 && done();
|
|
||||||
}).finally(() => {
|
|
||||||
instance.confirmButtonLoading = false;
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).then(() => {
|
|
||||||
//只有在废弃成功的情况下会走到这里
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '删除成功!'
|
|
||||||
});
|
|
||||||
this.getData(true)
|
|
||||||
//调用接口 更新表格数据
|
|
||||||
}).catch(() => {
|
|
||||||
//取消关机
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.defaultYear = new Date()
|
|
||||||
this.loading=true
|
|
||||||
this.getZdList().then(()=>{
|
|
||||||
this.getData(true)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.month-lists-container{
|
|
||||||
max-height:100vh ;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.common-card-container{
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
.price-table-container{
|
|
||||||
overflow-x: auto;
|
|
||||||
.price-table{
|
|
||||||
border:1px solid #eee;
|
|
||||||
width: fit-content;
|
|
||||||
overflow-x: auto;
|
|
||||||
display: flex;
|
|
||||||
.time-list{
|
|
||||||
&:not(:first-child){
|
|
||||||
border-left:1px solid #eee;
|
|
||||||
}
|
|
||||||
text-align: center;
|
|
||||||
width: 140px;
|
|
||||||
&>div{
|
|
||||||
height: 30px;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 30px;
|
|
||||||
color:#000;
|
|
||||||
&.time,&.type{
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,815 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog
|
|
||||||
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"
|
|
||||||
>
|
|
||||||
<el-form-item label="站点" prop="siteId">
|
|
||||||
<el-select
|
|
||||||
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'"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="设备保护名称" prop="faultName">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.faultName"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
:style="{ width: '50%' }"
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="处理方案描述" prop="description">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.description"
|
|
||||||
type="textarea"
|
|
||||||
:rows="2"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
:style="{ width: '50%' }"
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否告警" prop="isAlert">
|
|
||||||
<el-checkbox
|
|
||||||
v-model="formData.isAlert"
|
|
||||||
:true-label="1"
|
|
||||||
:false-label="0"
|
|
||||||
></el-checkbox>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="告警等级" prop="faultLevel">
|
|
||||||
<el-radio-group v-model="formData.faultLevel" :style="{ width: '50%' }" :disabled="mode === 'edit'">
|
|
||||||
<el-radio :label="1">等级1</el-radio>
|
|
||||||
<el-radio :label="2">等级2</el-radio>
|
|
||||||
<el-radio :label="3">等级3</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<div class="items-container">
|
|
||||||
<div class="item-title">
|
|
||||||
保护前提:
|
|
||||||
<div style="display: inline-block; margin-left: 20px">
|
|
||||||
<el-form-item label="延时" prop="faultDelaySeconds">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.faultDelaySeconds"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
:style="{ width: '200px', display: 'inline-block' }"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button
|
|
||||||
@click.native.prevent="addRow('protectionSettings')"
|
|
||||||
block
|
|
||||||
type="primary"
|
|
||||||
size="mini"
|
|
||||||
style="margin-bottom: 20px"
|
|
||||||
>
|
|
||||||
新增保护前提
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="time-lists-container">
|
|
||||||
<div class="time-lists time-lists-title">
|
|
||||||
<div>设备类型</div>
|
|
||||||
<div>点位</div>
|
|
||||||
<div>故障值比较符号</div>
|
|
||||||
<div>故障值</div>
|
|
||||||
<div>释放值比较符号</div>
|
|
||||||
<div>释放值</div>
|
|
||||||
<div>关系</div>
|
|
||||||
<div>操作</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
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="
|
|
||||||
(q, c) =>
|
|
||||||
querySearchAsync(q, c, 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"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-input placeholder="请输入故障值" v-model="item.faultValue">
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-select v-model="item.releaseOperator" placeholder="请选择">
|
|
||||||
<el-option
|
|
||||||
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"
|
|
||||||
>
|
|
||||||
</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"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button
|
|
||||||
@click.native.prevent="deleteRow(index,'protectionSettings')"
|
|
||||||
type="warning"
|
|
||||||
size="mini"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="items-container">
|
|
||||||
<div class="item-title">
|
|
||||||
保护方案:
|
|
||||||
<div style="display: inline-block; margin-left: 20px">
|
|
||||||
<el-form-item label="延时" prop="releaseDelaySeconds">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.releaseDelaySeconds"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
:style="{ width: '200px', display: 'inline-block' }"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button
|
|
||||||
@click.native.prevent="addRow('protectionPlan')"
|
|
||||||
block
|
|
||||||
type="primary"
|
|
||||||
size="mini"
|
|
||||||
style="margin-bottom: 20px"
|
|
||||||
>
|
|
||||||
新增保护方案
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="time-lists-container">
|
|
||||||
<div class="time-lists time-lists-title">
|
|
||||||
<div>设备类型</div>
|
|
||||||
<div>点位</div>
|
|
||||||
<div>故障值比较符号</div>
|
|
||||||
<div>故障值</div>
|
|
||||||
<div>操作</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
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="
|
|
||||||
(q, c) => querySearchAsync(q, c, index, 'protectionPlan')
|
|
||||||
"
|
|
||||||
@select="(v) => handleSelect(v, index, 'protectionPlan')"
|
|
||||||
></el-autocomplete>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>=</div>
|
|
||||||
<div>
|
|
||||||
<el-input placeholder="请输入故障值" v-model="item.value">
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button
|
|
||||||
@click.native.prevent="deleteRow(index,'protectionPlan')"
|
|
||||||
type="warning"
|
|
||||||
size="mini"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
|
||||||
<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 {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) => {
|
|
||||||
if (value !== "" && !validText(value)) {
|
|
||||||
callback(new Error("只能输入中文、英文、数字和特殊字符!"));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
// emitPath: false,//在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
|
||||||
lazy: true,
|
|
||||||
lazyLoad: (node, resolve) => {
|
|
||||||
console.log('---------node', node)
|
|
||||||
this.getDeviceList(node, resolve)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mode: '',
|
|
||||||
loading: 0,
|
|
||||||
childOptions: [],
|
|
||||||
protectionSettings: [],
|
|
||||||
protectionPlan: [],
|
|
||||||
dialogTableVisible: false,
|
|
||||||
siteList: [], //站点列表 从接口获取数据
|
|
||||||
formData: {
|
|
||||||
id: "", //设备唯一标识
|
|
||||||
siteId: "", //站点ID
|
|
||||||
faultName: "", //设备保护名称
|
|
||||||
isAlert: 0, //是否告警
|
|
||||||
faultLevel: 1, //告警等级
|
|
||||||
faultDelaySeconds: "", //故障延时
|
|
||||||
releaseDelaySeconds: "", //释放延时
|
|
||||||
description: '',//方案描述
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
siteId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请选择站点",
|
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
faultName: [
|
|
||||||
{required: true, message: "请输入设备保护名称", trigger: "blur"},
|
|
||||||
],
|
|
||||||
isAlert: [
|
|
||||||
{required: true, message: "请选择是否告警", trigger: "blur"},
|
|
||||||
],
|
|
||||||
description: [
|
|
||||||
{required: true, message: "请输入设备描述", trigger: "blur"},
|
|
||||||
{validator: validateText, trigger: "blur"},
|
|
||||||
],
|
|
||||||
faultDelaySeconds: [
|
|
||||||
{required: true, message: "请输入保护前提延时", trigger: "blur"},
|
|
||||||
{validator: validateText, trigger: "blur"},
|
|
||||||
],
|
|
||||||
releaseDelaySeconds: [
|
|
||||||
{required: true, message: "请输入保护方案延时", trigger: "blur"},
|
|
||||||
{validator: validateText, trigger: "blur"},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState({
|
|
||||||
communicationStatusOptions: (state) =>
|
|
||||||
state?.ems?.communicationStatusOptions || {},
|
|
||||||
deviceTypeOptions: (state) => state?.ems?.deviceTypeOptions || {},
|
|
||||||
comparisonOperatorOptions: (state) =>
|
|
||||||
state?.ems?.comparisonOperatorOptions || {},
|
|
||||||
relationWithPoint: (state) => state?.ems?.relationWithPoint || {},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
open(id, siteId) {
|
|
||||||
this.dialogTableVisible = true
|
|
||||||
this.getZdList();
|
|
||||||
this.getDeviceCategoryList().then(() => {
|
|
||||||
if (id && siteId) {
|
|
||||||
// this.getDeviceList('PCS', siteId)
|
|
||||||
// this.getDeviceList('STACK', siteId)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (id) {
|
|
||||||
this.formData.id = id
|
|
||||||
this.mode = 'edit'
|
|
||||||
getProtectPlan(id).then(response => {
|
|
||||||
const data = response?.data || {}
|
|
||||||
this.formData = {
|
|
||||||
id,
|
|
||||||
siteId: data?.siteId || '', //站点ID
|
|
||||||
faultName: data?.faultName || '', //设备保护名称
|
|
||||||
isAlert: data?.isAlert || 0, //是否告警
|
|
||||||
faultLevel: data?.faultLevel || 1, //告警等级
|
|
||||||
faultDelaySeconds: data?.faultDelaySeconds || "", //故障延时
|
|
||||||
releaseDelaySeconds: data?.releaseDelaySeconds || "", //释放延时
|
|
||||||
description: data?.description || '',//方案描述
|
|
||||||
}
|
|
||||||
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 => {
|
|
||||||
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)
|
|
||||||
})
|
|
||||||
console.log('获取设备保护详情并初始化', this.formData, this.protectionPlan, this.protectionSettings, this.childOptions)
|
|
||||||
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.mode = 'add'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 新增设备保护前提、设备保护方案
|
|
||||||
addRow(type) {
|
|
||||||
const item = type === 'protectionSettings' ? {
|
|
||||||
deviceId: [],//设备ID
|
|
||||||
deviceName: [],
|
|
||||||
deviceCategory: "",//设备类型 英文
|
|
||||||
categoryName: '',//设备类型名称 中文
|
|
||||||
point: "",//点位 英文
|
|
||||||
pointName: "",//点位 中文
|
|
||||||
faultValue: "",//故障值
|
|
||||||
releaseValue: "",//释放值
|
|
||||||
faultOperator: "",//故障值比较关系
|
|
||||||
releaseOperator: "",//释放值比较关系
|
|
||||||
relationNext: "",//与下一个点位的关系
|
|
||||||
} : {
|
|
||||||
deviceId: [],
|
|
||||||
deviceName: [],
|
|
||||||
deviceCategory: "",//设备类型 英文
|
|
||||||
categoryName: '',//设备类型名称 中文
|
|
||||||
point: "",
|
|
||||||
pointName: "",
|
|
||||||
value: "",//设置值
|
|
||||||
}
|
|
||||||
// this.$set(this[type], this[type].length, item);
|
|
||||||
this[type].splice(this[type].length, 0, item)
|
|
||||||
console.log('新增设备保护前提、方案', type, this[type])
|
|
||||||
},
|
|
||||||
// 删除设备保护前提、设备保护方案
|
|
||||||
deleteRow(index, type) {
|
|
||||||
this[type].splice(index, 1);
|
|
||||||
},
|
|
||||||
|
|
||||||
// 设备保护前提、设备保护方案点位选择
|
|
||||||
querySearchAsync(query, cb, index, type) {
|
|
||||||
console.log("查询数据", query, index);
|
|
||||||
if (!this.formData.siteId || !this[type][index].deviceCategory) {
|
|
||||||
this.$message({
|
|
||||||
type: "warning",
|
|
||||||
message: "请先选择站点和设备",
|
|
||||||
});
|
|
||||||
return cb([]);
|
|
||||||
}
|
|
||||||
pointFuzzyQuery({
|
|
||||||
siteIds: [this.formData.siteId],
|
|
||||||
deviceCategory: this[type][index].deviceCategory,
|
|
||||||
pointName: query,
|
|
||||||
}).then((response) => {
|
|
||||||
const data = response?.data || [];
|
|
||||||
cb(
|
|
||||||
data.map((item) => {
|
|
||||||
return {name: item, value: item};
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 点位选择
|
|
||||||
handleSelect(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,
|
|
||||||
})
|
|
||||||
this[type].splice(index, 1, line);
|
|
||||||
console.log('选择点位配置完成', this[type][index])
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取设备类别-不区分站点
|
|
||||||
getDeviceCategoryList() {
|
|
||||||
this.loading += 1;
|
|
||||||
return getAllDeviceCategory()
|
|
||||||
.then((response) => {
|
|
||||||
const data = (response?.data || []);
|
|
||||||
this.$set(this, 'childOptions', [])
|
|
||||||
let arr = []
|
|
||||||
data.forEach((item) => {
|
|
||||||
arr.push({
|
|
||||||
value: item.code,
|
|
||||||
label: item.name,
|
|
||||||
leaf: false,
|
|
||||||
children: []
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.childOptions.splice(0, 0, ...arr)
|
|
||||||
console.log('获取设备类型', data, this.childOptions)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading -= 1;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//获取设备列表-区分站点
|
|
||||||
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() {
|
|
||||||
this.childOptions.forEach(item => {
|
|
||||||
const length = item.children.length
|
|
||||||
item.children.splice(0, length)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//选中设备类型、设备
|
|
||||||
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.$set(this[type], index, item);
|
|
||||||
this[type].splice(index, 1, item);
|
|
||||||
})
|
|
||||||
console.log('设置选中设备类型、设备配置完成', this[type][index])
|
|
||||||
},
|
|
||||||
|
|
||||||
//获取站点列表
|
|
||||||
getZdList() {
|
|
||||||
this.loading += 1;
|
|
||||||
getAllSites()
|
|
||||||
.then((response) => {
|
|
||||||
this.siteList = response?.data || [];
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading -= 1;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 切换站点
|
|
||||||
// 重新获取设备列表
|
|
||||||
// 清空选中的设备、点位信息
|
|
||||||
changeType() {
|
|
||||||
//获取当前站点下的pcs和bms
|
|
||||||
this.updateSiteDeviceList()
|
|
||||||
if (this.protectionSettings.length > 0) {
|
|
||||||
const list = this.protectionSettings
|
|
||||||
list.forEach((item) => {
|
|
||||||
item.point = ""
|
|
||||||
item.pointName = ""
|
|
||||||
item.deviceId = []
|
|
||||||
item.deviceName = []
|
|
||||||
item.categoryName = ''
|
|
||||||
item.deviceCategory = ''
|
|
||||||
});
|
|
||||||
// this.$set(this,'protectionSettings',list)
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.protectionSettings.splice(0, this.protectionSettings.length, ...list)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (this.protectionPlan.length > 0) {
|
|
||||||
const list = this.protectionPlan
|
|
||||||
list.forEach((item) => {
|
|
||||||
item.point = ""
|
|
||||||
item.pointName = ""
|
|
||||||
item.deviceId = []
|
|
||||||
item.deviceName = []
|
|
||||||
item.categoryName = ''
|
|
||||||
item.deviceCategory = ''
|
|
||||||
});
|
|
||||||
// this.$set(this,'protectionPlan',list)
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.protectionPlan.splice(0, this.protectionPlan.length, ...list)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
saveDialog() {
|
|
||||||
function getToastMsg(name, type, index) {
|
|
||||||
return {
|
|
||||||
protectionSettings: {
|
|
||||||
deviceId: `请选择保护前提第${index}行的设备`,//设备ID
|
|
||||||
deviceCategory: `请选择保护前提第${index}行的设备类型`,//设备类型 英文
|
|
||||||
categoryName: `请选择保护前提第${index}行的设备类型`,//设备类型名称 中文
|
|
||||||
point: `请选择保护前提第${index}行的点位`,//点位 英文
|
|
||||||
pointName: `请选择保护前提第${index}行的点位`,//点位 中文
|
|
||||||
faultValue: `请输入保护前提第${index}行的故障值`,//故障值
|
|
||||||
releaseValue: `请输入保护前提第${index}行的释放值`,//释放值
|
|
||||||
faultOperator: `请选择保护前提第${index}行的故障值比较关系`,//故障值比较关系
|
|
||||||
releaseOperator: `请选择保护前提第${index}行的释放值比较关系`,//释放值比较关系
|
|
||||||
relationNext: `请选择保护前提第${index}行与下一个点位的关系`,//与下一个点位的关系
|
|
||||||
},
|
|
||||||
protectionPlan: {
|
|
||||||
deviceId: `请选择保护方案第${index}行的设备`,
|
|
||||||
deviceCategory: `请选择保护方案第${index}行的设备类型`,//设备类型 英文
|
|
||||||
categoryName: `请选择保护方案第${index}行的设备类型`,//设备类型名称 中文
|
|
||||||
point: `请选择保护方案第${index}行的点位`,
|
|
||||||
pointName: `请选择保护方案第${index}行的点位`,
|
|
||||||
value: `请输入保护方案第${index}行的故障值`,//设置值
|
|
||||||
}
|
|
||||||
}[type][name]
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$refs.addTempForm.validate((valid) => {
|
|
||||||
if (!valid) return;
|
|
||||||
const {
|
|
||||||
id = "", //设备唯一标识
|
|
||||||
siteId = "", //站点ID
|
|
||||||
faultName = "", //设备保护名称
|
|
||||||
isAlert = 0, //是否告警
|
|
||||||
faultLevel = 1, //告警等级
|
|
||||||
faultDelaySeconds = "", //故障延时
|
|
||||||
releaseDelaySeconds = "", //释放延时
|
|
||||||
description = "",//方案描述
|
|
||||||
} = this.formData;
|
|
||||||
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
|
|
||||||
break
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (![0, '0'].includes(value) && !value) {
|
|
||||||
this.$message.error(getToastMsg(key, 'protectionSettings', i + 1))
|
|
||||||
protectionSettingsValidateStatus = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!protectionSettingsValidateStatus) break
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
break
|
|
||||||
} else {
|
|
||||||
// protectionPlan[i][key] = ''//清空选择的关系
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (![0, '0'].includes(value) && !value) {
|
|
||||||
this.$message.error(getToastMsg(key, 'protectionPlan', i + 1))
|
|
||||||
protectionPlanValidateStatus = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!protectionPlanValidateStatus) break
|
|
||||||
}
|
|
||||||
|
|
||||||
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],
|
|
||||||
deviceName: item.deviceName[1],
|
|
||||||
})
|
|
||||||
})
|
|
||||||
this.loading += 1;
|
|
||||||
const params = {
|
|
||||||
siteId,
|
|
||||||
faultName,
|
|
||||||
isAlert,
|
|
||||||
faultLevel,
|
|
||||||
faultDelaySeconds,
|
|
||||||
releaseDelaySeconds,
|
|
||||||
description,
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
params.id = id
|
|
||||||
updateProtectPlan(params)
|
|
||||||
.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) {
|
|
||||||
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.dialogTableVisible = false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.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;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,259 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div
|
|
||||||
class="ems-dashboard-editor-container"
|
|
||||||
style="background-color: #ffffff"
|
|
||||||
v-loading="loading"
|
|
||||||
>
|
|
||||||
<el-form :inline="true" class="select-container">
|
|
||||||
<el-form-item label="站点选择">
|
|
||||||
<el-select
|
|
||||||
v-model="form.siteId"
|
|
||||||
placeholder="请选择换电站名称"
|
|
||||||
:loading="searchLoading"
|
|
||||||
loading-text="正在加载数据"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
:label="item.siteName"
|
|
||||||
:value="item.siteId"
|
|
||||||
v-for="(item, index) in siteList"
|
|
||||||
:key="index + 'zdxeSelect'"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="故障名称">
|
|
||||||
<el-input
|
|
||||||
v-model="form.faultName"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入故障名称"
|
|
||||||
style="width: 150px"
|
|
||||||
></el-input>
|
|
||||||
</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-table
|
|
||||||
class="common-table"
|
|
||||||
:data="tableData"
|
|
||||||
stripe
|
|
||||||
max-height="600px"
|
|
||||||
style="width: 100%; margin-top: 25px"
|
|
||||||
>
|
|
||||||
<el-table-column prop="siteId" label="站点" width="100"> </el-table-column>
|
|
||||||
<el-table-column prop="faultName" label="设备保护名称" width="100"> </el-table-column>
|
|
||||||
<el-table-column prop="faultLevel" label="故障等级" width="100">
|
|
||||||
<template slot-scope="scope">等级{{scope.row.faultLevel}}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="isAlert" label="是否告警" width="100">
|
|
||||||
<template slot-scope="scope">{{scope.row.isAlert === 1 ? '是' : '否'}}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="description" label="处理方案描述" width="200" show-overflow-tooltip>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="protectionSettings" label="保护前提" show-overflow-tooltip width="400">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div v-html="handleProtectionSettings(scope.row.protectionSettings)"></div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="faultDelaySeconds" label="保护前提延时(s)" width="120">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="protectionPlan" label="保护方案" show-overflow-tooltip width="200">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div v-html="handleProtectionPlan(scope.row.protectionPlan)"></div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="releaseDelaySeconds" label="保护方案延时(s)" width="120">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column fixed="right" label="操作" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button @click="editDevice(scope.row)" type="warning" size="mini">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button type="danger" @click="deleteDevice(scope.row)" size="mini">
|
|
||||||
删除
|
|
||||||
</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"
|
|
||||||
>
|
|
||||||
</el-pagination>
|
|
||||||
<add-device
|
|
||||||
ref="addDevice"
|
|
||||||
@update="getData"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
protectPlanList,
|
|
||||||
deleteProtectPlan,
|
|
||||||
} from "@/api/ems/site";
|
|
||||||
import { getAllSites } from "@/api/ems/zddt";
|
|
||||||
import AddDevice from "./AddDevice.vue";
|
|
||||||
export default {
|
|
||||||
name: "SBBH",
|
|
||||||
components: { AddDevice },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
form:{
|
|
||||||
siteId:'',
|
|
||||||
faultName:''
|
|
||||||
},
|
|
||||||
loading: false,
|
|
||||||
searchLoading: false,
|
|
||||||
siteList: [],
|
|
||||||
tableData: [],
|
|
||||||
pageSize: 10, //分页栏当前每个数据总数
|
|
||||||
pageNum: 1, //分页栏当前页数
|
|
||||||
totalSize: 0, //table表格数据总数
|
|
||||||
dialogTableVisible: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleProtectionSettings(data){
|
|
||||||
if(!data || !JSON.parse(data)) return
|
|
||||||
const arr = JSON.parse(data),
|
|
||||||
str= arr.map((item,index)=>{
|
|
||||||
const {categoryName='',deviceId='',point='',faultOperator='',faultValue='',releaseOperator='',releaseValue='',relationNext=''} = item
|
|
||||||
return `<div>${index+1}、 <span>${categoryName ? categoryName + '-' : ''}${deviceId ? deviceId + '-' : ''}${ point || ''}</span> <span>故障:${faultOperator || ''}${ faultValue || ''}</span> <span>释放:${releaseOperator || ''}${releaseValue || ''}</span> ${arr[index+1] ? '<span>关系:'+(relationNext || '')+'</span>' : ''}</div>`
|
|
||||||
})
|
|
||||||
return str.join('')
|
|
||||||
},
|
|
||||||
handleProtectionPlan(data){
|
|
||||||
if(!data || !JSON.parse(data)) return
|
|
||||||
const arr = JSON.parse(data),
|
|
||||||
str= arr.map((item,index)=>{
|
|
||||||
const {categoryName='',deviceId='',point='',value=''} = item
|
|
||||||
return `<div>${index+1}、 <span>${categoryName ? categoryName + '-' : ''}${deviceId ? deviceId + '-' : ''}${ point || ''}</span> <span>故障:=${ value || ''}</span> </div>`
|
|
||||||
})
|
|
||||||
return str.join('')
|
|
||||||
},
|
|
||||||
// 新增设备 展示弹窗
|
|
||||||
addDevice() {
|
|
||||||
this.$refs.addDevice.open()
|
|
||||||
},
|
|
||||||
// 编辑设备
|
|
||||||
editDevice(row) {
|
|
||||||
this.$refs.addDevice.open(row.id,row.siteId)
|
|
||||||
},
|
|
||||||
//删除设备
|
|
||||||
deleteDevice(row) {
|
|
||||||
console.log('删除')
|
|
||||||
this.$confirm(`确认要设备保护${row.faultName}吗?`, {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
showClose: false,
|
|
||||||
closeOnClickModal: false,
|
|
||||||
type: "warning",
|
|
||||||
beforeClose: (action, instance, done) => {
|
|
||||||
if (action === "confirm") {
|
|
||||||
instance.confirmButtonLoading = true;
|
|
||||||
deleteProtectPlan(row.id)
|
|
||||||
.then((response) => {
|
|
||||||
response.code === 200 && done();
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
instance.confirmButtonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
//只有在废弃成功的情况下会走到这里
|
|
||||||
this.$message({
|
|
||||||
type: "success",
|
|
||||||
message: "删除成功!",
|
|
||||||
});
|
|
||||||
this.getData();
|
|
||||||
//调用接口 更新表格数据
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
//取消关机
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 分页
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.pageSize = val;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.pageNum = val;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
onSearch() {
|
|
||||||
this.pageNum = 1; //每次搜索从1开始搜索
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
// 重置
|
|
||||||
onReset() {
|
|
||||||
this.form={
|
|
||||||
siteId: "",
|
|
||||||
faultName: "",
|
|
||||||
}
|
|
||||||
this.pageNum = 1; //每次搜索从1开始搜索
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
// 获取数据
|
|
||||||
getData() {
|
|
||||||
this.loading = true;
|
|
||||||
const { pageNum, pageSize } = this,{siteId,faultName=''}=this.form;
|
|
||||||
protectPlanList({ siteId, faultName,pageNum, pageSize })
|
|
||||||
.then((response) => {
|
|
||||||
this.tableData = response?.rows || [];
|
|
||||||
this.totalSize = response?.total || 0;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//获取站点列表
|
|
||||||
getZdList() {
|
|
||||||
this.searchLoading = true;
|
|
||||||
return getAllSites()
|
|
||||||
.then((response) => {
|
|
||||||
this.siteList = response?.data || [];
|
|
||||||
if (this.siteList.length > 0) this.form.siteId = this.siteList[0].siteId;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.searchLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loading = true;
|
|
||||||
this.form = {
|
|
||||||
siteId: "",
|
|
||||||
faultName: "",
|
|
||||||
};
|
|
||||||
this.pageNum = 1; //每次搜索从1开始搜索
|
|
||||||
this.getZdList().then(() => {
|
|
||||||
this.getData();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
|
||||||
@ -1,18 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="dialogTableVisible" :close-on-press-escape="false" :close-on-click-modal="false"
|
<el-dialog :visible.sync="dialogTableVisible" :close-on-click-modal="false" :show-close="false" destroy-on-close lock-scroll append-to-body width="600px" class="ems-dialog" :title="mode === 'add'?'新增设备':`编辑设备` " >
|
||||||
:show-close="false" destroy-on-close lock-scroll append-to-body width="800px" class="ems-dialog"
|
<el-form v-loading="loading>0" ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||||
: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-form-item label="站点" prop="siteId">
|
||||||
<el-select v-model="formData.siteId" placeholder="请选择" :style="{width: '100%'}" @change="changeType">
|
<el-select v-model="formData.siteId" placeholder="请选择" :style="{width: '100%'}">
|
||||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList"
|
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'siteOptions'"></el-option>
|
||||||
:key="index+'siteOptions'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备id" prop="deviceId" >
|
<el-form-item label="设备id" prop="deviceId" >
|
||||||
<el-input v-model="formData.deviceId" placeholder="请输入" maxlength="60" clearable :style="{width: '100%'}">
|
<el-input v-model="formData.deviceId" maxlength="60" clearable :style="{width: '100%'}">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备名称" prop="deviceName">
|
<el-form-item label="设备名称" prop="deviceName">
|
||||||
@ -20,37 +15,31 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备描述" prop="description">
|
<el-form-item label="设备描述" prop="description">
|
||||||
<el-input v-model="formData.description" type="textarea" placeholder="请输入" clearable
|
<el-input v-model="formData.description" type="textarea" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||||
:style="{width: '100%'}">
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工作状态" prop="communicationStatus">
|
<el-form-item label="工作状态" prop="communicationStatus">
|
||||||
<el-select v-model="formData.communicationStatus" placeholder="请选择" :style="{width: '100%'}">
|
<el-select v-model="formData.communicationStatus" placeholder="请选择" :style="{width: '100%'}">
|
||||||
<el-option :label="value" :value="key" v-for="(value,key) in communicationStatusOptions"
|
<el-option :label="value" :value="key" v-for="(value,key) in communicationStatusOptions" :key="key+'communicationStatusOptions'"></el-option>
|
||||||
:key="key+'communicationStatusOptions'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备类型" prop="deviceType">
|
<el-form-item label="设备类型" prop="deviceType">
|
||||||
<el-select v-model="formData.deviceType" placeholder="请选择" :style="{width: '100%'}">
|
<el-select v-model="formData.deviceType" placeholder="请选择" :style="{width: '100%'}">
|
||||||
<el-option :label="value" :value="key" v-for="(value,key) in deviceTypeOptions"
|
<el-option :label="value" :value="key" v-for="(value,key) in deviceTypeOptions" :key="key+'deviceTypeOptions'"></el-option>
|
||||||
:key="key+'deviceTypeOptions'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备类别" prop="deviceCategory">
|
<el-form-item label="设备类别" prop="deviceCategory">
|
||||||
<el-select v-model="formData.deviceCategory" placeholder="请选择" :style="{width: '100%'}"
|
<el-select v-model="formData.deviceCategory" placeholder="请选择" :style="{width: '100%'}">
|
||||||
@change="changeType">
|
<el-option :label="item" :value="item" v-for="(item,index) in deviceCategoryList" :key="index+'deviceCategoryList'"></el-option>
|
||||||
<el-option :label="item.name" :value="item.code" v-for="(item,index) in deviceCategoryList"
|
|
||||||
:key="index+'deviceCategoryList'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="上级设备" prop="parentId" v-if="dccDeviceCategoryList.includes(formData.deviceCategory)">
|
<!-- todo 只有电池簇展示-->
|
||||||
<el-select v-model="formData.parentId"
|
<el-form-item label="上级设备" prop="parentId" v-if="formData.deviceCategory === dccDeviceCategory">
|
||||||
:placeholder="parentDeviceList.length === 0 && !formData.siteId ? '请先选择站点' : '请选择'"
|
<el-select v-model="formData.parentId" :placeholder="parentDeviceList.length === 0 && !formData.siteId ? '请先选择站点' : '请选择'" :style="{width: '100%'}">
|
||||||
:style="{width: '100%'}">
|
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in parentDeviceList" :key="index+'parentDeviceList'" ></el-option>
|
||||||
<el-option :label="item.deviceName" :value="item.id" v-for="(item,index) in parentDeviceList"
|
|
||||||
:key="index+'parentDeviceList'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!--todo tcp设备才展示ip地址、端口号?-->
|
||||||
<el-form-item label="TCP设备的ip地址" prop="ipAddress" v-if="formData.deviceType === 'TCP'">
|
<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 v-model="formData.ipAddress" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -59,10 +48,7 @@
|
|||||||
<el-input v-model="formData.ipPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
<el-input v-model="formData.ipPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</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-form-item label="串口路径" prop="serialPort">
|
||||||
<el-input v-model="formData.serialPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
<el-input v-model="formData.serialPort" placeholder="请输入" clearable :style="{width: '100%'}">
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -88,49 +74,6 @@
|
|||||||
</el-form-item>
|
</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">
|
<div slot="footer">
|
||||||
<el-button @click="closeDialog">取消</el-button>
|
<el-button @click="closeDialog">取消</el-button>
|
||||||
<el-button type="primary" @click="saveDialog">确定</el-button>
|
<el-button type="primary" @click="saveDialog">确定</el-button>
|
||||||
@ -139,11 +82,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
|
import {getStackNameList} from '@/api/ems/dzjk'
|
||||||
import {getAllSites} from '@/api/ems/zddt'
|
import {getAllSites} from '@/api/ems/zddt'
|
||||||
import {validText} from '@/utils/validate'
|
import {validText} from '@/utils/validate'
|
||||||
import {addDevice, getDeviceDetailInfo, getParentDeviceId, updateDevice} from "@/api/ems/site";
|
import {getDeviceDetailInfo,getDeviceCategory,updateDevice,addDevice} from "@/api/ems/site";
|
||||||
import {getAllDeviceCategory} from '@/api/ems/search'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props:{
|
props:{
|
||||||
mode:{
|
mode:{
|
||||||
@ -170,16 +112,9 @@ export default {
|
|||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const validateNumber = (rule, value, callback) => {
|
|
||||||
if (value !== '' && !/^[0-9]+$/.test(value)) {
|
|
||||||
callback(new Error('只能输入数字!'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
loading:0,
|
loading:0,
|
||||||
dccDeviceCategoryList: ['CLUSTER', 'BATTERY'],//需要展示上级设备的设备类型
|
dccDeviceCategory:'CLUSTER',
|
||||||
dialogTableVisible:false,
|
dialogTableVisible:false,
|
||||||
parentDeviceList:[],//上级设备列表 从接口获取数据
|
parentDeviceList:[],//上级设备列表 从接口获取数据
|
||||||
siteList:[],//站点列表 从接口获取数据
|
siteList:[],//站点列表 从接口获取数据
|
||||||
@ -202,18 +137,6 @@ export default {
|
|||||||
stopBits:'',//停止位
|
stopBits:'',//停止位
|
||||||
parity:'',//校验位
|
parity:'',//校验位
|
||||||
pictureUrl:'',//设备图片
|
pictureUrl:'',//设备图片
|
||||||
slaveId: '',//从站地址
|
|
||||||
},
|
|
||||||
pcsSetting: {
|
|
||||||
deviceSettingId: '',
|
|
||||||
powerAddress: '',//功率地址
|
|
||||||
pointAddress: "",//开关机地址
|
|
||||||
startCommand: "",//开机指令
|
|
||||||
stopCommand: "",//关机指令
|
|
||||||
startPower: '',//开机目标功率
|
|
||||||
stopPower: '',//关机目标功率
|
|
||||||
clusterNum: '',//电池簇数
|
|
||||||
clusterPointAddress: []//电池簇地址
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
siteId:[
|
siteId:[
|
||||||
@ -246,9 +169,6 @@ export default {
|
|||||||
ipPort:[
|
ipPort:[
|
||||||
{ validator: validateText, trigger: 'blur' }
|
{ validator: validateText, trigger: 'blur' }
|
||||||
],
|
],
|
||||||
slaveId: [
|
|
||||||
{validator: validateNumber, trigger: 'blur'}
|
|
||||||
],
|
|
||||||
serialPort:[
|
serialPort:[
|
||||||
{ validator: validateText, trigger: 'blur' }
|
{ validator: validateText, trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -268,49 +188,33 @@ export default {
|
|||||||
// { required: true, message: '请上传图片', trigger: ['blur', 'change']}
|
// { 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: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
communicationStatusOptions: state => state?.ems?.communicationStatusOptions || {},
|
communicationStatusOptions: state => state?.ems?.communicationStatusOptions || {},
|
||||||
deviceTypeOptions:state=>state?.ems?.deviceTypeOptions || {}
|
deviceTypeOptions:state=>state?.ems?.deviceTypeOptions || {}
|
||||||
}),
|
})
|
||||||
isPcs() {
|
|
||||||
return this.formData.deviceCategory === 'PCS'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
|
'formData.deviceCategory':{
|
||||||
|
handler(newVal){
|
||||||
|
// 只有电池簇需要选择上级设备 调用接口获取电池堆列表
|
||||||
|
if(newVal && newVal === this.dccDeviceCategory){
|
||||||
|
this.getParentDeviceList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate:true
|
||||||
|
},
|
||||||
|
'formData.siteId':{
|
||||||
|
handler(newVal,oldVal){
|
||||||
|
// 只有电池簇需要选择上级设备 调用接口获取电池堆列表
|
||||||
|
if(newVal && oldVal!== newVal && this.formData.deviceCategory === this.dccDeviceCategory){
|
||||||
|
this.getParentDeviceList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate:true
|
||||||
|
},
|
||||||
dialogTableVisible:{
|
dialogTableVisible:{
|
||||||
handler(newVal){
|
handler(newVal){
|
||||||
//打开弹窗
|
//打开弹窗
|
||||||
@ -326,31 +230,14 @@ export default {
|
|||||||
if((newVal || newVal===0) && this.mode !== 'add'){
|
if((newVal || newVal===0) && this.mode !== 'add'){
|
||||||
this.loading+=1
|
this.loading+=1
|
||||||
getDeviceDetailInfo(newVal).then(response => {
|
getDeviceDetailInfo(newVal).then(response => {
|
||||||
const {pcsSetting, ...data} = JSON.parse(JSON.stringify(response?.data || {}))
|
this.formData = JSON.parse(JSON.stringify(response?.data || {}));
|
||||||
this.formData = data;
|
}).finally(() => {this.loading-=1})
|
||||||
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
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeType() {
|
|
||||||
if (this.dccDeviceCategoryList.includes(this.formData.deviceCategory)) {
|
|
||||||
this.getParentDeviceList()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
uploadImage(data){
|
uploadImage(data){
|
||||||
this.formData.pictureUrl = data
|
this.formData.pictureUrl = data
|
||||||
},
|
},
|
||||||
@ -359,33 +246,31 @@ export default {
|
|||||||
this.loading+=1
|
this.loading+=1
|
||||||
getAllSites().then(response => {
|
getAllSites().then(response => {
|
||||||
this.siteList = response?.data || []
|
this.siteList = response?.data || []
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading-=1})
|
||||||
this.loading -= 1
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
// 获取设备类别
|
// 获取设备类别
|
||||||
getDeviceCategoryList(){
|
getDeviceCategoryList(){
|
||||||
this.loading+=1
|
this.loading+=1
|
||||||
getAllDeviceCategory().then(response => {
|
getDeviceCategory().then(response => {
|
||||||
this.deviceCategoryList = response?.data || []
|
this.deviceCategoryList = response?.data || []
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading-=1})
|
||||||
this.loading -= 1
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
//获取上级id列表
|
//获取上级id列表
|
||||||
getParentDeviceList(init = false) {
|
getParentDeviceList(){
|
||||||
if(!this.formData.siteId){
|
if(!this.formData.siteId){
|
||||||
return console.log('请先选择站点')
|
return console.log('请先选择站点')
|
||||||
}
|
}
|
||||||
!init && (this.formData.parentId = '')
|
this.formData.parentId=''
|
||||||
this.loading= this.loading+1
|
this.loading= this.loading+1
|
||||||
getParentDeviceId({siteId: this.formData.siteId, deviceCategory: this.formData.deviceCategory}).then(response => {
|
getStackNameList(this.formData.siteId).then(response => {
|
||||||
this.parentDeviceList = JSON.parse(JSON.stringify(response?.data || []));
|
this.parentDeviceList = JSON.parse(JSON.stringify(response?.data || []));
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading=this.loading -1
|
this.loading=this.loading -1
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
saveData() {
|
saveDialog() {
|
||||||
|
this.$refs.addTempForm.validate(valid => {
|
||||||
|
if (!valid) return
|
||||||
this.loading+=1
|
this.loading+=1
|
||||||
const {
|
const {
|
||||||
id='',
|
id='',
|
||||||
@ -405,52 +290,9 @@ export default {
|
|||||||
stopBits='',//停止位
|
stopBits='',//停止位
|
||||||
parity='',//校验位
|
parity='',//校验位
|
||||||
pictureUrl='',//设备图片
|
pictureUrl='',//设备图片
|
||||||
slaveId = '',//从站地址
|
|
||||||
}= this.formData;
|
}= 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'){
|
if(this.mode === 'add'){
|
||||||
addDevice(params).then(response => {
|
addDevice({siteId,deviceId,deviceName,description,communicationStatus,deviceType,deviceCategory,parentId,ipAddress,ipPort,serialPort,baudRate,dataBits,stopBits,parity,pictureUrl}).then(response => {
|
||||||
if(response.code === 200){
|
if(response.code === 200){
|
||||||
//新增成功
|
//新增成功
|
||||||
// 关闭弹窗 更新表格
|
// 关闭弹窗 更新表格
|
||||||
@ -461,9 +303,7 @@ export default {
|
|||||||
this.loading-=1
|
this.loading-=1
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
params.id = id
|
updateDevice({id,siteId,deviceId,deviceName,description,communicationStatus,deviceType,deviceCategory,parentId,ipAddress,ipPort,serialPort,baudRate,dataBits,stopBits,parity,pictureUrl}).then(response => {
|
||||||
params.pcsSetting && (params.pcsSetting.deviceSettingId = deviceSettingId)
|
|
||||||
updateDevice(params).then(response => {
|
|
||||||
if(response.code === 200){
|
if(response.code === 200){
|
||||||
//新增成功
|
//新增成功
|
||||||
// 关闭弹窗 更新表格
|
// 关闭弹窗 更新表格
|
||||||
@ -474,23 +314,13 @@ export default {
|
|||||||
this.loading-=1
|
this.loading-=1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
saveDialog() {
|
|
||||||
this.$refs.addTempForm.validate(valid => {
|
|
||||||
if (!valid) return
|
|
||||||
if (this.isPcs) {
|
|
||||||
this.$refs.pcsSettingForm.validate(pcsValidate => {
|
|
||||||
if (!pcsValidate) return
|
|
||||||
this.saveData()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.saveData()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeDialog(){
|
closeDialog(){
|
||||||
this.$emit('clear')
|
this.$emit('clear')
|
||||||
// 清空所有数据
|
// 清空所有数据
|
||||||
|
this.$refs.addTempForm.resetFields()
|
||||||
this.formData= {
|
this.formData= {
|
||||||
id:'',//设备唯一标识
|
id:'',//设备唯一标识
|
||||||
siteId:'',//站点ID
|
siteId:'',//站点ID
|
||||||
@ -509,36 +339,12 @@ export default {
|
|||||||
stopBits:'',//停止位
|
stopBits:'',//停止位
|
||||||
parity:'',//校验位
|
parity:'',//校验位
|
||||||
pictureUrl:'',//设备图片
|
pictureUrl:'',//设备图片
|
||||||
slaveId: '',//从站地址
|
|
||||||
}
|
}
|
||||||
this.pcsSetting = {
|
|
||||||
deviceSettingId: '',
|
|
||||||
powerAddress: '',//功率地址
|
|
||||||
pointAddress: "",//开关机地址
|
|
||||||
startCommand: "",//开机指令
|
|
||||||
stopCommand: "",//关机指令
|
|
||||||
startPower: '',//开机目标功率
|
|
||||||
stopPower: '',//关机目标功率
|
|
||||||
clusterNum: '',//电池簇数
|
|
||||||
clusterPointAddress: []//电池簇地址
|
|
||||||
}
|
|
||||||
this.$refs.addTempForm.resetFields()
|
|
||||||
this.$refs?.pcsSettingForm?.resetFields()
|
|
||||||
this.dialogTableVisible=false
|
this.dialogTableVisible=false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped>
|
||||||
.device-form {
|
|
||||||
::v-deep .el-form-item--medium .el-form-item__content {
|
|
||||||
width: 260px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item {
|
|
||||||
width: 50%;
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,94 +0,0 @@
|
|||||||
<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
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
label() {
|
|
||||||
return this.data.workStatus === '0' ? '关机' : '开机'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
switchStatus() {
|
|
||||||
console.log(this.data, 11111111)
|
|
||||||
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: workStatus === '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>
|
|
||||||
@ -1,302 +0,0 @@
|
|||||||
<!--电位展示图表-->
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-dialog
|
|
||||||
v-loading="loading"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:visible.sync="show"
|
|
||||||
append-to-body
|
|
||||||
class="ems-dialog"
|
|
||||||
destroy-on-close
|
|
||||||
lock-scroll
|
|
||||||
show-close
|
|
||||||
:title="dataType === 'point' ? '点位清单' : '报警点位'"
|
|
||||||
width="950px"
|
|
||||||
>
|
|
||||||
<el-form :inline="true" label-width="100px">
|
|
||||||
<el-form-item label="点位名称">
|
|
||||||
<el-input
|
|
||||||
v-model="form.dataPointName"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入点位名称"
|
|
||||||
style="width: 150px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="点位">
|
|
||||||
<el-input
|
|
||||||
v-model="form.dataPoint"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入点位"
|
|
||||||
style="width: 150px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="modbus ip">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="form.ipAddress"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- placeholder="请输入ip"-->
|
|
||||||
<!-- style="width: 150px"-->
|
|
||||||
<!-- ></el-input>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<br>
|
|
||||||
<el-form-item label="最小值">
|
|
||||||
<el-input
|
|
||||||
v-model="form.lower"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入最小值"
|
|
||||||
style="width: 150px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="最大值">
|
|
||||||
<el-input
|
|
||||||
v-model="form.upper"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入最大值"
|
|
||||||
style="width: 150px"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="modbus 端口">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="form.ipPort"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- placeholder="请输入端口"-->
|
|
||||||
<!-- style="width: 150px"-->
|
|
||||||
<!-- ></el-input>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item style="margin-left: 20px">
|
|
||||||
<el-button type="primary" @click="search">搜索</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-table
|
|
||||||
:data="tableData"
|
|
||||||
class="common-table"
|
|
||||||
max-height="400px"
|
|
||||||
stripe
|
|
||||||
style="width: 100%"
|
|
||||||
:default-sort="defaultSort"
|
|
||||||
@sort-change="handleSortChange"
|
|
||||||
>
|
|
||||||
<el-table-column label="数据点位" prop="dataPoint"></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="数据点位名称"
|
|
||||||
prop="dataPointName"
|
|
||||||
></el-table-column>
|
|
||||||
<!-- <el-table-column label="modbus地址">-->
|
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <span>{{-->
|
|
||||||
<!-- `${scope.row.ipAddress || ""} ${scope.row.ipPort || ""}`-->
|
|
||||||
<!-- }}</span>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>
|
|
||||||
<el-table-column label="寄存器地址" prop="寄存器地址"></el-table-column>-->
|
|
||||||
<el-table-column
|
|
||||||
label="最新值"
|
|
||||||
prop="pointValue"
|
|
||||||
align="right"
|
|
||||||
sortable="custom"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span class="pointer" @click="showChart(scope.row)">{{
|
|
||||||
scope.row.pointValue
|
|
||||||
}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="单位" prop="dataUnit"></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="更新时间"
|
|
||||||
min-width="160px"
|
|
||||||
prop="updateTime"
|
|
||||||
sortable="custom"
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
v-show="tableData.length > 0"
|
|
||||||
:current-page="pageNum"
|
|
||||||
:page-size="pageSize"
|
|
||||||
:page-sizes="[10, 20, 30, 40]"
|
|
||||||
:pager-count="5"
|
|
||||||
:total="totalSize"
|
|
||||||
background
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
small
|
|
||||||
style="margin-top: 15px; text-align: center"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
>
|
|
||||||
</el-pagination>
|
|
||||||
</el-dialog>
|
|
||||||
<point-chart ref="pointChart" :site-id="siteId"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import {getDevicePointList} from "@/api/ems/site";
|
|
||||||
import pointChart from "@/views/ems/dzjk/sbjk/PointChart.vue";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {pointChart},
|
|
||||||
watch: {
|
|
||||||
show(val) {
|
|
||||||
if (!val) {
|
|
||||||
this.tableData = [];
|
|
||||||
this.deviceId = "";
|
|
||||||
this.parentId = "";
|
|
||||||
this.siteId = "";
|
|
||||||
this.pageSize = 10;
|
|
||||||
this.pageNum = 1;
|
|
||||||
this.totalSize = 0;
|
|
||||||
this.dataType = '';
|
|
||||||
this.form = {
|
|
||||||
sortMethod: "desc", //升序不传或者asc、降序desc)
|
|
||||||
sortData: this.defaultSort.prop,
|
|
||||||
dataPointName: "", //点位名称
|
|
||||||
dataPoint: "", //点位名称
|
|
||||||
lower: "", //
|
|
||||||
upper: "", //
|
|
||||||
// ipAddress: "",
|
|
||||||
// ipPort: "",
|
|
||||||
};
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isDtdc() {
|
|
||||||
return this.deviceCategory === "BATTERY";
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 默认排序
|
|
||||||
defaultSort: {prop: "updateTime", order: "descending"},
|
|
||||||
show: false,
|
|
||||||
loading: false,
|
|
||||||
dataType: '',//展示的数据类型 point点位/alarmPoint报警点位
|
|
||||||
form: {
|
|
||||||
sortData: "updateTime", //最新值升序不传或者asc、降序desc)
|
|
||||||
sortMethod: "desc", //升序不传或者asc、降序desc)
|
|
||||||
dataPointName: "", //点位名称
|
|
||||||
dataPoint: "", //点位名称
|
|
||||||
lower: "", //
|
|
||||||
upper: "", //
|
|
||||||
// ipAddress: "",
|
|
||||||
// ipPort: "",
|
|
||||||
},
|
|
||||||
deviceCategory: "",
|
|
||||||
deviceId: "",
|
|
||||||
parentId: "",
|
|
||||||
siteId: "",
|
|
||||||
tableData: [],
|
|
||||||
pageSize: 10, //分页栏当前每个数据总数
|
|
||||||
pageNum: 1, //分页栏当前页数
|
|
||||||
totalSize: 0, //table表格数据总数
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showChart({pointName}) {
|
|
||||||
if (pointName) {
|
|
||||||
const {deviceCategory, deviceId} = this;
|
|
||||||
if (this.isDtdc)
|
|
||||||
this.$refs.pointChart.showChart({
|
|
||||||
pointName,
|
|
||||||
deviceCategory,
|
|
||||||
deviceId: this.parentId,
|
|
||||||
child: [deviceId],
|
|
||||||
});
|
|
||||||
else
|
|
||||||
this.$refs.pointChart.showChart({
|
|
||||||
pointName,
|
|
||||||
deviceCategory,
|
|
||||||
deviceId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleSortChange(column) {
|
|
||||||
this.form.sortData = column.prop;
|
|
||||||
this.form.sortMethod = column.order === "descending" ? "desc" : "asc";
|
|
||||||
console.log("切换排序方式", column, this.form);
|
|
||||||
this.getData()
|
|
||||||
},
|
|
||||||
search() {
|
|
||||||
this.pageNum = 1;
|
|
||||||
this.getData()
|
|
||||||
},
|
|
||||||
// 分页
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.pageSize = val;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData()
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.pageNum = val;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.getData()
|
|
||||||
});
|
|
||||||
},
|
|
||||||
showTable({deviceCategory, siteId, deviceId, parentId = ""}, dataType) {
|
|
||||||
this.dataType = dataType;
|
|
||||||
this.deviceCategory = deviceCategory;
|
|
||||||
this.siteId = siteId;
|
|
||||||
this.deviceId = deviceId;
|
|
||||||
this.parentId = deviceCategory === "BATTERY" ? parentId : ""; //只有单体电池需要这个值
|
|
||||||
this.show = true;
|
|
||||||
this.getData()
|
|
||||||
},
|
|
||||||
getData() {
|
|
||||||
const {
|
|
||||||
siteId,
|
|
||||||
deviceId,
|
|
||||||
deviceCategory,
|
|
||||||
parentId,
|
|
||||||
pageNum,
|
|
||||||
pageSize,
|
|
||||||
form: {
|
|
||||||
sortData,
|
|
||||||
sortMethod,
|
|
||||||
dataPointName,
|
|
||||||
dataPoint,
|
|
||||||
lower,
|
|
||||||
upper,
|
|
||||||
// ipAddress,
|
|
||||||
// ipPort,
|
|
||||||
},
|
|
||||||
} = this;
|
|
||||||
const params = {
|
|
||||||
siteId,
|
|
||||||
deviceId,
|
|
||||||
deviceCategory,
|
|
||||||
parentId,
|
|
||||||
pageNum,
|
|
||||||
pageSize,
|
|
||||||
sortData,
|
|
||||||
sortMethod,
|
|
||||||
dataPointName,
|
|
||||||
dataPoint,
|
|
||||||
lower,
|
|
||||||
upper,
|
|
||||||
// ipAddress: '',
|
|
||||||
// ipPort: '',
|
|
||||||
}
|
|
||||||
params.isAlarm = this.dataType === 'point' ? 0 : 1
|
|
||||||
this.loading = true;
|
|
||||||
getDevicePointList(params)
|
|
||||||
.then((response) => {
|
|
||||||
this.tableData = response?.rows || [];
|
|
||||||
this.totalSize = response?.total || 0;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
::v-deep {
|
|
||||||
.card-title .el-radio {
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog :visible.sync="show" class="ems-dialog" title="点位上传" width="400px" append-to-body
|
|
||||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
|
||||||
<!-- <file-upload :fileType='["xls", "xlsx"]' value="String" :limit="1" :drag="false" @input="updateFile"/>-->
|
|
||||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"
|
|
||||||
:data="upload.data" :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">
|
|
||||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
||||||
<!-- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>-->
|
|
||||||
</div>
|
|
||||||
</el-upload>
|
|
||||||
<div slot="footer">
|
|
||||||
<el-button @click="handleClosed">取消</el-button>
|
|
||||||
<el-button type="primary" @click="submitFileForm">确定</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
import {getToken} from "@/utils/auth"
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
show: false,
|
|
||||||
// 用户导入参数
|
|
||||||
upload: {
|
|
||||||
data: {},
|
|
||||||
// 是否禁用上传
|
|
||||||
isUploading: false,
|
|
||||||
// 设置上传的请求头部
|
|
||||||
headers: {Authorization: "Bearer " + getToken()},
|
|
||||||
// 上传的地址
|
|
||||||
url: process.env.VUE_APP_BASE_API + "/ems/pointMatch/importDataByDevice"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showDialog({siteId, deviceCategory, deviceId}) {
|
|
||||||
this.upload.data = {siteId, deviceCategory, deviceId}
|
|
||||||
this.show = true;
|
|
||||||
},
|
|
||||||
//关闭弹窗 重置数据
|
|
||||||
handleClosed() {
|
|
||||||
this.$refs.upload.clearFiles()//写在before-closed无效
|
|
||||||
this.upload.data = {}
|
|
||||||
this.show = false
|
|
||||||
},
|
|
||||||
// updateFile(data){
|
|
||||||
// console.log('上传文件emit',data)
|
|
||||||
// },
|
|
||||||
// saveDialog(){
|
|
||||||
// this.show=true
|
|
||||||
// },
|
|
||||||
// 文件上传中处理 返回参数event, file, fileList
|
|
||||||
handleFileUploadProgress() {
|
|
||||||
this.upload.isUploading = true
|
|
||||||
},
|
|
||||||
// 文件上传成功处理 返回参数response, file, fileList
|
|
||||||
handleFileSuccess(response) {
|
|
||||||
console.log('上传文件结果', response)
|
|
||||||
this.upload.isUploading = false
|
|
||||||
if (response.code === 500 && !response.msg) response.msg = '上传失败'
|
|
||||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + (response.msg || '上传成功') + "</div>", "导入结果", {dangerouslyUseHTMLString: true})
|
|
||||||
this.$emit('update')
|
|
||||||
this.handleClosed()
|
|
||||||
},
|
|
||||||
// 提交上传文件
|
|
||||||
submitFileForm() {
|
|
||||||
this.$refs.upload.submit()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,57 +1,18 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="ems-dashboard-editor-container" style="background-color: #ffffff" v-loading="loading">
|
<div class="ems-dashboard-editor-container" style="background-color: #ffffff" v-loading="loading">
|
||||||
<el-form :inline="true" class="select-container">
|
<el-form :inline="true" class="select-container">
|
||||||
<el-form-item label="站点选择">
|
<el-form-item label="站点选择">
|
||||||
<el-select v-model="siteId" placeholder="请选择换电站名称" :loading="searchLoading" loading-text="正在加载数据"
|
<el-select v-model="siteId" placeholder="请选择换电站名称" :loading="loading" loading-text="正在加载数据">
|
||||||
@change="onSearch" clearable>
|
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList" :key="index+'zdxeSelect'"></el-option>
|
||||||
<el-option :label="item.siteName" :value="item.siteId" v-for="(item,index) in siteList"
|
|
||||||
: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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<!-- <el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>-->
|
<el-button type="primary" @click="onSearch" native-type="button">搜索</el-button>
|
||||||
<!-- <el-button @click="onReset" native-type="button">重置</el-button>-->
|
<el-button @click="onReset" native-type="button">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-button type="primary" @click="addDevice" native-type="button">新增设备</el-button>
|
<el-button type="primary" @click="addDevice" native-type="button">新增设备</el-button>
|
||||||
<el-dropdown @command="(val)=>downloadPointDetail(val,false)">
|
|
||||||
<el-button
|
|
||||||
style="margin-left:10px;"
|
|
||||||
type="primary"
|
|
||||||
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
|
<el-table
|
||||||
class="common-table"
|
class="common-table"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
@ -76,65 +37,35 @@
|
|||||||
label="设备名称">
|
label="设备名称">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="categoryName"
|
prop="deviceType"
|
||||||
label="设备类别">
|
label="设备类型">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="deviceStatus"
|
prop="communicationStatus"
|
||||||
label="在线状态">
|
label="通信状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ $store.state.ems.deviceStatusOptions[scope.row.deviceStatus] }}</span>
|
<span>{{$store.state.ems.communicationStatusOptions[scope.row.communicationStatus]}}</span>
|
||||||
<!-- <pcs-switch v-if="scope.row.deviceCategory === 'PCS' && ![null,'',undefined].includes(scope.row.deviceStatus)"-->
|
|
||||||
<!-- style="margin-left:5px;"-->
|
|
||||||
<!-- :data="{siteId:scope.row.siteId,deviceStatus:scope.row.deviceStatus,deviceId:scope.row.deviceId,deviceName:scope.row.deviceName}"-->
|
|
||||||
<!-- @updateSuccess="getData"/>-->
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
fixed="right"
|
fixed="right"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="250">
|
width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<!-- <el-button-->
|
||||||
@click="pointDetail(scope.row,'point')"
|
<!-- @click="toDetail(scope.row.id)"-->
|
||||||
type="primary"
|
<!-- type="primary"-->
|
||||||
size="mini">
|
<!-- size="mini">-->
|
||||||
点位清单
|
<!-- 查看详情-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<el-button
|
|
||||||
@click="pointDetail(scope.row,'alarmPoint')"
|
|
||||||
type="primary"
|
|
||||||
size="mini">
|
|
||||||
报警点位清单
|
|
||||||
</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
|
<el-button
|
||||||
@click="editDevice(scope.row)"
|
@click="editDevice(scope.row)"
|
||||||
style="margin-top:10px;"
|
|
||||||
type="warning"
|
type="warning"
|
||||||
size="mini">
|
size="mini">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
style="margin-top:10px;"
|
|
||||||
@click="deleteDevice(scope.row)"
|
@click="deleteDevice(scope.row)"
|
||||||
size="mini">
|
size="mini">
|
||||||
删除
|
删除
|
||||||
@ -155,36 +86,25 @@
|
|||||||
style="margin-top:15px;text-align: center"
|
style="margin-top:15px;text-align: center"
|
||||||
>
|
>
|
||||||
</el-pagination>
|
</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">
|
||||||
:before-close="handleClosed">
|
|
||||||
<div class="descriptions-main" style="padding: 0" >
|
<div class="descriptions-main" style="padding: 0" >
|
||||||
<el-descriptions direction="vertical" :column="2" :colon="false" border>
|
<el-descriptions direction="vertical" :column="2" :colon="false" border>
|
||||||
<el-descriptions-item v-for="(item,index) in detailData" :key="index+'descriptions'"
|
<el-descriptions-item v-for="(item,index) in detailData" :key="index+'descriptions'" labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1" :label="item.label">{{item.value}}</el-descriptions-item>
|
||||||
labelClassName="descriptions-label" contentClassName="descriptions-direction" :span="1"
|
|
||||||
:label="item.label">{{ item.value }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<add-device ref="addDevice" :mode="mode" :id="editDeviceId" @update="getData" @clear="clearEditDeviceData"/>
|
<add-device ref="addDevice" :mode="mode" :id="editDeviceId" @update="getData" @clear="clearEditDeviceData"/>
|
||||||
<point-table ref="pointTable"/>
|
|
||||||
<point-upload ref="pointUpload" @update="getData"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {deleteService, getDeviceDetailInfo, getDeviceInfoList} from '@/api/ems/site'
|
import {getDeviceInfoList,getDeviceDetailInfo,deleteService} from'@/api/ems/site'
|
||||||
import {getAllSites} from '@/api/ems/zddt'
|
import {getAllSites} from '@/api/ems/zddt'
|
||||||
import {formatNumber} from "@/filters/ems";
|
import {formatNumber} from "@/filters/ems";
|
||||||
import {getAllDeviceCategory} from '@/api/ems/search'
|
|
||||||
import PointTable from './PointTable.vue'
|
|
||||||
import AddDevice from "./AddDevice.vue";
|
import AddDevice from "./AddDevice.vue";
|
||||||
import PointUpload from "./PointUpload.vue";
|
|
||||||
// import PcsSwitch from "./PcsSwitch.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Sblb",
|
name: "Sblb",
|
||||||
components: {AddDevice, PointTable, PointUpload},
|
components:{AddDevice},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
@ -193,8 +113,6 @@ export default {
|
|||||||
editDeviceId:'',//编辑设备id
|
editDeviceId:'',//编辑设备id
|
||||||
siteId:'',
|
siteId:'',
|
||||||
siteList:[],
|
siteList:[],
|
||||||
deviceCategory: '',//搜索栏设备类型
|
|
||||||
deviceCategoryList: [],//设备类别
|
|
||||||
tableData:[],
|
tableData:[],
|
||||||
pageSize:10,//分页栏当前每个数据总数
|
pageSize:10,//分页栏当前每个数据总数
|
||||||
pageNum:1,//分页栏当前页数
|
pageNum:1,//分页栏当前页数
|
||||||
@ -224,38 +142,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
// 获取设备类别
|
|
||||||
getDeviceCategoryList() {
|
|
||||||
getAllDeviceCategory().then(response => {
|
|
||||||
this.deviceCategoryList = response?.data || []
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 查看设备电位表格
|
|
||||||
pointDetail(row, dataType) {
|
|
||||||
this.$refs.pointTable.showTable(row, dataType)
|
|
||||||
},
|
|
||||||
// 下载点位清单
|
|
||||||
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,
|
|
||||||
deviceCategory,
|
|
||||||
deviceId,
|
|
||||||
}, `点位清单_${categoryName}_${new Date().getTime()}.xlsx`)
|
|
||||||
},
|
|
||||||
// 上传点位清单
|
|
||||||
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(){
|
clearEditDeviceData(){
|
||||||
this.mode = '';
|
this.mode = '';
|
||||||
this.editDeviceId=''
|
this.editDeviceId=''
|
||||||
@ -304,9 +190,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleClosed(done){
|
handleClosed(done){
|
||||||
this.detailData.forEach((item) => {
|
this.detailData.forEach((item)=>{item.value = ''})
|
||||||
item.value = ''
|
|
||||||
})
|
|
||||||
done()
|
done()
|
||||||
},
|
},
|
||||||
toDetail(id){
|
toDetail(id){
|
||||||
@ -322,9 +206,7 @@ export default {
|
|||||||
|
|
||||||
})
|
})
|
||||||
this.dialogTableVisible = true
|
this.dialogTableVisible = true
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading = false})
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 分页
|
// 分页
|
||||||
@ -354,33 +236,23 @@ export default {
|
|||||||
// 获取数据
|
// 获取数据
|
||||||
getData(){
|
getData(){
|
||||||
this.loading=true
|
this.loading=true
|
||||||
const {siteId, deviceCategory, pageNum, pageSize} = this
|
const {siteId,pageNum,pageSize} =this
|
||||||
getDeviceInfoList({siteId, deviceCategory, pageNum, pageSize}).then(response => {
|
getDeviceInfoList({siteId,pageNum,pageSize}).then(response => {
|
||||||
this.tableData=response?.rows || [];
|
this.tableData=response?.rows || [];
|
||||||
this.totalSize = response?.total || 0
|
this.totalSize = response?.total || 0
|
||||||
}).finally(() => {
|
}).finally(() => {this.loading=false})
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
//获取站点列表
|
//获取站点列表
|
||||||
getZdList(){
|
getZdList(){
|
||||||
this.searchLoading=true
|
this.searchLoading=true
|
||||||
return getAllSites().then(response => {
|
getAllSites().then(response => {
|
||||||
this.siteList = response?.data || []
|
this.siteList = response?.data || []
|
||||||
if (this.siteList.length > 0) this.siteId = this.siteList[0].siteId
|
}).finally(() => {this.searchLoading=false})
|
||||||
}).finally(() => {
|
|
||||||
this.searchLoading = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loading = true
|
this.onReset()
|
||||||
this.siteId = ''
|
this.getZdList()
|
||||||
this.pageNum = 1//每次搜索从1开始搜索
|
|
||||||
this.getDeviceCategoryList()
|
|
||||||
this.getZdList().then(() => {
|
|
||||||
this.getData()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-loading="loading>0" :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增工单':`编辑工单`" :close-on-press-escape="false" :close-on-click-modal="false" :show-close="false">
|
<el-dialog v-loading="loading>0" :visible.sync="dialogTableVisible" class="ems-dialog" :title="mode === 'add'?'新增工单':`编辑工单` " :close-on-click-modal="false" :show-close="false">
|
||||||
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="120px">
|
<el-form ref="addTempForm" :model="formData" :rules="rules" size="medium" label-width="120px">
|
||||||
<el-form-item label="工单号" prop="ticketNo" v-if="mode !== 'add'">
|
<el-form-item label="工单号" prop="ticketNo" v-if="mode !== 'add'">
|
||||||
<el-input disabled v-model="formData.ticketNo" clearable :style="{width: '100%'}">
|
<el-input disabled v-model="formData.ticketNo" clearable :style="{width: '100%'}">
|
||||||
@ -159,7 +159,7 @@ export default {
|
|||||||
this.$refs.addTempForm.validate(valid => {
|
this.$refs.addTempForm.validate(valid => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
this.loading+=1
|
this.loading+=1
|
||||||
const {title='',content='',status='',userId='',workUserId='',id='',expectedCompleteTime='',ticketNo=''} = this.formData;
|
const {title='',content='',status='',userId='',workUserId='',id='',expectedCompleteTime=''} = this.formData;
|
||||||
if(this.mode === 'add'){
|
if(this.mode === 'add'){
|
||||||
addTicket({title,content,status,userId,workUserId,expectedCompleteTime}).then(response => {
|
addTicket({title,content,status,userId,workUserId,expectedCompleteTime}).then(response => {
|
||||||
if(response.code === 200){
|
if(response.code === 200){
|
||||||
@ -172,7 +172,7 @@ export default {
|
|||||||
this.loading-=1
|
this.loading-=1
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
updateTicket({title,content,status,userId,workUserId,id,expectedCompleteTime,ticketNo}).then(response => {
|
updateTicket({title,content,status,userId,workUserId,id,expectedCompleteTime}).then(response => {
|
||||||
if(response.code === 200){
|
if(response.code === 200){
|
||||||
//新增成功
|
//新增成功
|
||||||
// 关闭弹窗 更新表格
|
// 关闭弹窗 更新表格
|
||||||
|
|||||||