@ -1,8 +1,10 @@ |
|||||
|
import { BASE_URL } from '../index'; |
||||
|
|
||||
export enum alarmOverviewApi { |
export enum alarmOverviewApi { |
||||
getAlarmEquipment = '/carbon-smart/api/AlarmOverview/alarmEquipment', //设备告警 数量
|
getAlarmEquipment = `${BASE_URL}/api/AlarmOverview/alarmEquipment`, //设备告警 数量
|
||||
getAlarmEnergyConsumption = '/carbon-smart/api/AlarmOverview/alarmEnergyConsumption', //能碳告警 数量
|
getAlarmEnergyConsumption = `${BASE_URL}/api/AlarmOverview/alarmEnergyConsumption`, //能碳告警 数量
|
||||
getAlarmGateway = '/carbon-smart/api/AlarmOverview/alarmGateway', //网关告警 数量
|
getAlarmGateway = `${BASE_URL}/api/AlarmOverview/alarmGateway`, //网关告警 数量
|
||||
getPriority = '/carbon-smart/api/AlarmOverview/priority', //优先级 数量
|
getPriority = `${BASE_URL}/api/AlarmOverview/priority`, //优先级 数量
|
||||
getProcessProgress = '/carbon-smart/api/AlarmOverview/processProgress', //进度 数量
|
getProcessProgress = `${BASE_URL}/api/AlarmOverview/processProgress`, //进度 数量
|
||||
getAlarmTrend = '/carbon-smart/api/AlarmOverview/alarmTrend', //30天告警 数量
|
getAlarmTrend = `${BASE_URL}/api/AlarmOverview/alarmTrend`, //30天告警 数量
|
||||
} |
} |
||||
|
@ -1,9 +1,11 @@ |
|||||
|
import { BASE_URL } from '../../index'; |
||||
|
|
||||
export enum deviceAlarms { |
export enum deviceAlarms { |
||||
getTableList = '/carbon-smart/api/AlarmEquipment/selectAlarmEquipment', //设备告警分页
|
getTableList = `${BASE_URL}/api/AlarmEquipment/selectAlarmEquipment`, //设备告警分页
|
||||
addOrUpNewData = '/carbon-smart/api/AlarmEquipment/creatOrUpdate', //设备告警添加 修改
|
addOrUpNewData = `${BASE_URL}/api/AlarmEquipment/creatOrUpdate`, //设备告警添加 修改
|
||||
del = '/carbon-smart/api/AlarmEquipment/delete', //设备告警删除
|
del = `${BASE_URL}/api/AlarmEquipment/delete`, //设备告警删除
|
||||
configGetTableList = '/carbon-smart/api/AlarmEquipmentRule/selectAlarmEquipmentRule', //配置设备告警分页
|
configGetTableList = `${BASE_URL}/api/AlarmEquipmentRule/selectAlarmEquipmentRule`, //配置设备告警分页
|
||||
configAddOrUpNewData = '/carbon-smart/api/AlarmEquipmentRule/creatOrUpdate', //配置设备告警添加 修改
|
configAddOrUpNewData = `${BASE_URL}/api/AlarmEquipmentRule/creatOrUpdate`, //配置设备告警添加 修改
|
||||
configFindById = '/carbon-smart/api/AlarmEquipmentRule/findById', //配置设备告警 查询详情
|
configFindById = `${BASE_URL}/api/AlarmEquipmentRule/findById`, //配置设备告警 查询详情
|
||||
configDel = '/carbon-smart/api/AlarmEquipmentRule/delete', //配置设备告警删除
|
configDel = `${BASE_URL}/api/AlarmEquipmentRule/delete`, //配置设备告警删除
|
||||
} |
} |
||||
|
@ -1,9 +1,11 @@ |
|||||
|
import { BASE_URL } from '../../index'; |
||||
|
|
||||
export enum energyAlarms { |
export enum energyAlarms { |
||||
getTableList = '/carbon-smart/api/AlarmEnergyConsumption/selectAlarmEnergyConsumption', //能耗告警分页
|
getTableList = `${BASE_URL}/api/AlarmEnergyConsumption/selectAlarmEnergyConsumption`, //能耗告警分页
|
||||
addOrUpNewData = '/carbon-smart/api/AlarmEnergyConsumption/creatOrUpdate', //能耗告警添加 修改
|
addOrUpNewData = `${BASE_URL}/api/AlarmEnergyConsumption/creatOrUpdate`, //能耗告警添加 修改
|
||||
del = '/carbon-smart/api/AlarmEnergyConsumption/delete', //能耗删除
|
del = `${BASE_URL}/api/AlarmEnergyConsumption/delete`, //能耗删除
|
||||
configGetTableList = '/carbon-smart/api/AlarmEnergyConsumptionRule/selectAlarmEnergyConsumptionRule', //配置设备告警分页
|
configGetTableList = `${BASE_URL}/api/AlarmEnergyConsumptionRule/selectAlarmEnergyConsumptionRule`, //配置设备告警分页
|
||||
configAddOrUpNewData = '/carbon-smart/api/AlarmEnergyConsumptionRule/creatOrUpdate', //配置设备告警添加 修改
|
configAddOrUpNewData = `${BASE_URL}/api/AlarmEnergyConsumptionRule/creatOrUpdate`, //配置设备告警添加 修改
|
||||
configFindById = '/carbon-smart/api/AlarmEnergyConsumptionRule/findById', //配置设备告警 查询详情
|
configFindById = `${BASE_URL}/api/AlarmEnergyConsumptionRule/findById`, //配置设备告警 查询详情
|
||||
configDel = '/carbon-smart/api/AlarmEnergyConsumptionRule/delete', //配置设备告警删除
|
configDel = `${BASE_URL}/api/AlarmEnergyConsumptionRule/delete`, //配置设备告警删除
|
||||
} |
} |
||||
|
@ -1,5 +1,7 @@ |
|||||
|
import { BASE_URL } from '../../index'; |
||||
|
|
||||
export enum notificationManagementApi { |
export enum notificationManagementApi { |
||||
getTableList = '/carbon-smart/api/AlarmContactInformation/selectAlarmContactInformation', //通知管理分页
|
getTableList = `${BASE_URL}/api/AlarmContactInformation/selectAlarmContactInformation`, //通知管理分页
|
||||
upData = '/carbon-smart/api/AlarmContactInformation/update', //通知管理 修改
|
upData = `${BASE_URL}/api/AlarmContactInformation/update`, //通知管理 修改
|
||||
findById = '/carbon-smart/api/AlarmContactInformation/findById', //通知管理 查询详情
|
findById = `${BASE_URL}/api/AlarmContactInformation/findById`, //通知管理 查询详情
|
||||
} |
} |
||||
|
@ -1,6 +1,8 @@ |
|||||
|
import { BASE_URL } from '../index'; |
||||
|
|
||||
export enum energyAlarmApi { |
export enum energyAlarmApi { |
||||
getTableList = '/carbon-smart/api/AlarmEnergyConsumptionLog/selectAlarmEnergyConsumptionLog', //能碳告警 列表
|
getTableList = `${BASE_URL}/api/AlarmEnergyConsumptionLog/selectAlarmEnergyConsumptionLog`, //能碳告警 列表
|
||||
getCodeList = '/carbon-smart/api/AlarmEnergyConsumptionLog/selectErrorCodeList ', //能碳告警 列表
|
getCodeList = `${BASE_URL}/api/AlarmEnergyConsumptionLog/selectErrorCodeList `, //能碳告警 列表
|
||||
getSelectAlarmEnergyConsumptionLogStatusProcess = '/carbon-smart/api/AlarmEnergyConsumptionLogStatusProcess/selectAlarmEnergyConsumptionLogStatusProcess', //能碳告警 状态 没有创建工单log接口
|
getSelectAlarmEnergyConsumptionLogStatusProcess = `${BASE_URL}/api/AlarmEnergyConsumptionLogStatusProcess/selectAlarmEnergyConsumptionLogStatusProcess`, //能碳告警 状态 没有创建工单log接口
|
||||
noCreatOrUpdateLog = '/carbon-smart/api/AlarmEnergyConsumptionLogStatusProcess/creatOrUpdate', //能碳告警 状态 没有创建工单 添加 修改状态log
|
noCreatOrUpdateLog = `${BASE_URL}/api/AlarmEnergyConsumptionLogStatusProcess/creatOrUpdate`, //能碳告警 状态 没有创建工单 添加 修改状态log
|
||||
} |
} |
||||
|
@ -1,6 +1,8 @@ |
|||||
|
import { BASE_URL } from '../index'; |
||||
|
|
||||
export enum equipmentAlarmApi { |
export enum equipmentAlarmApi { |
||||
getTableList = '/carbon-smart/api/AlarmEquipmentLog/selectAlarmEquipmentLog', //设备告警 列表
|
getTableList = `${BASE_URL}/api/AlarmEquipmentLog/selectAlarmEquipmentLog`, //设备告警 列表
|
||||
getCodeList = '/carbon-smart/api/AlarmEquipmentLog/selectErrorCodeList', //设备告警 列表
|
getCodeList = `${BASE_URL}/api/AlarmEquipmentLog/selectErrorCodeList`, //设备告警 列表
|
||||
getSelectAlarmEquipmentLogStatusProcess = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess', //设备告警 状态 没有创建工单log接口
|
getSelectAlarmEquipmentLogStatusProcess = `${BASE_URL}/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess`, //设备告警 状态 没有创建工单log接口
|
||||
noCreatOrUpdateLog = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/creatOrUpdate', //设备告警 状态 没有创建工单 添加 修改状态log
|
noCreatOrUpdateLog = `${BASE_URL}/api/AlarmEquipmentLogStatusProcess/creatOrUpdate`, //设备告警 状态 没有创建工单 添加 修改状态log
|
||||
} |
} |
||||
|
@ -1,3 +1,4 @@ |
|||||
|
import { BASE_URL } from '../index'; |
||||
export enum gatewayAlarmApi { |
export enum gatewayAlarmApi { |
||||
getTableList = '/carbon-smart/api/AlarmGatewayLog/selectAlarmGatewayLog', //网关告警 列表
|
getTableList = `${BASE_URL}/api/AlarmGatewayLog/selectAlarmGatewayLog`, //网关告警 列表
|
||||
} |
} |
||||
|
@ -0,0 +1,5 @@ |
|||||
|
export enum planToAddApi { |
||||
|
getActivatedPlanTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanTree', //计划树
|
||||
|
getActivatedPlanListByTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanListByTree', //计划列表
|
||||
|
updPlan = '/carbon-smart/deviceCtrlPlan/updateActivatedPlan', //修改计划
|
||||
|
} |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 821 B |
@ -1,6 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="37px" height="37px" xmlns="http://www.w3.org/2000/svg"> |
|
||||
<g transform="matrix(1 0 0 1 -738 -62 )"> |
|
||||
<path d="M 32 16.17637875390625 L 32 5 L 5 5 L 5 32 L 16.17637875390625 32 L 16.17637875390625 37 L 0 37 L 0 0 L 37 0 L 37 16.17637875390625 L 32 16.17637875390625 Z M 6.9478248789666415 18.66767607469059 C 6.9478248789666415 15.5442205297455 8.189402439205798 12.548862312376832 10.3991006171875 10.341327827148438 C 12.604273280037184 8.143662959434554 15.590626658621316 6.909656880840238 18.703907459282163 6.909656880840238 C 25.201454239889483 6.909656880840238 30.46875662920404 12.176959270154791 30.46875662920404 18.674506050762112 C 30.46875662920404 20.983959083452117 29.789040393343488 23.24233673232217 28.514333895507814 25.16813439941406 L 36.990756359375 33.66766596484375 L 33.6653550546875 36.99768908984375 L 25.18893259082031 28.49815752441406 C 23.267562429817577 29.7630406080517 21.01764204116391 30.43714706492497 18.717295869201017 30.43714706492497 C 12.217196527718643 30.43714706492497 6.9478248789666415 25.167775416172965 6.9478248789666415 18.66767607469059 Z M 18.53350819726563 25.387670972656252 L 18.526575466796874 25.387670972656245 C 18.537359653048604 25.387721182280185 18.54814394157355 25.387746287194187 18.558928244709044 25.387746287194187 C 22.396705336309363 25.387746287194187 25.50783837263873 22.27661325086481 25.50783837263873 18.438836159264497 C 25.50783837263873 14.601059067664185 22.396705336309363 11.48992603133481 18.558928244709044 11.48992603133481 C 14.72118056523231 11.48992603133481 11.610059711939467 14.601013165475232 11.610018117187504 18.438760844726563 C 11.6100055260099 18.44415500501238 11.609999230414665 18.449549178157536 11.609999230414665 18.45494335313865 C 11.609999230414665 22.280184472224335 14.70827046453852 25.38258105471001 18.53350819726563 25.387670972656252 Z " fill-rule="nonzero" fill="#e4793f" stroke="none" transform="matrix(1 0 0 1 738 62 )" /> |
|
||||
</g> |
|
||||
</svg> |
|
@ -1,6 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="37px" height="37px" xmlns="http://www.w3.org/2000/svg"> |
|
||||
<g transform="matrix(1 0 0 1 -738 -62 )"> |
|
||||
<path d="M 32 16.17637875390625 L 32 5 L 5 5 L 5 32 L 16.17637875390625 32 L 16.17637875390625 37 L 0 37 L 0 0 L 37 0 L 37 16.17637875390625 L 32 16.17637875390625 Z M 6.9478248789666415 18.66767607469059 C 6.9478248789666415 15.5442205297455 8.189402439205798 12.548862312376832 10.3991006171875 10.341327827148438 C 12.604273280037184 8.143662959434554 15.590626658621316 6.909656880840238 18.703907459282163 6.909656880840238 C 25.201454239889483 6.909656880840238 30.46875662920404 12.176959270154791 30.46875662920404 18.674506050762112 C 30.46875662920404 20.983959083452117 29.789040393343488 23.24233673232217 28.514333895507814 25.16813439941406 L 36.990756359375 33.66766596484375 L 33.6653550546875 36.99768908984375 L 25.18893259082031 28.49815752441406 C 23.267562429817577 29.7630406080517 21.01764204116391 30.43714706492497 18.717295869201017 30.43714706492497 C 12.217196527718643 30.43714706492497 6.9478248789666415 25.167775416172965 6.9478248789666415 18.66767607469059 Z M 18.53350819726563 25.387670972656252 L 18.526575466796874 25.387670972656245 C 18.537359653048604 25.387721182280185 18.54814394157355 25.387746287194187 18.558928244709044 25.387746287194187 C 22.396705336309363 25.387746287194187 25.50783837263873 22.27661325086481 25.50783837263873 18.438836159264497 C 25.50783837263873 14.601059067664185 22.396705336309363 11.48992603133481 18.558928244709044 11.48992603133481 C 14.72118056523231 11.48992603133481 11.610059711939467 14.601013165475232 11.610018117187504 18.438760844726563 C 11.6100055260099 18.44415500501238 11.609999230414665 18.449549178157536 11.609999230414665 18.45494335313865 C 11.609999230414665 22.280184472224335 14.70827046453852 25.38258105471001 18.53350819726563 25.387670972656252 Z " fill-rule="nonzero" fill="#e93f33" stroke="none" transform="matrix(1 0 0 1 738 62 )" /> |
|
||||
</g> |
|
||||
</svg> |
|
@ -1,6 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="37px" height="37px" xmlns="http://www.w3.org/2000/svg"> |
|
||||
<g transform="matrix(1 0 0 1 -738 -62 )"> |
|
||||
<path d="M 32 16.17637875390625 L 32 5 L 5 5 L 5 32 L 16.17637875390625 32 L 16.17637875390625 37 L 0 37 L 0 0 L 37 0 L 37 16.17637875390625 L 32 16.17637875390625 Z M 6.9478248789666415 18.66767607469059 C 6.9478248789666415 15.5442205297455 8.189402439205798 12.548862312376832 10.3991006171875 10.341327827148438 C 12.604273280037184 8.143662959434554 15.590626658621316 6.909656880840238 18.703907459282163 6.909656880840238 C 25.201454239889483 6.909656880840238 30.46875662920404 12.176959270154791 30.46875662920404 18.674506050762112 C 30.46875662920404 20.983959083452117 29.789040393343488 23.24233673232217 28.514333895507814 25.16813439941406 L 36.990756359375 33.66766596484375 L 33.6653550546875 36.99768908984375 L 25.18893259082031 28.49815752441406 C 23.267562429817577 29.7630406080517 21.01764204116391 30.43714706492497 18.717295869201017 30.43714706492497 C 12.217196527718643 30.43714706492497 6.9478248789666415 25.167775416172965 6.9478248789666415 18.66767607469059 Z M 18.53350819726563 25.387670972656252 L 18.526575466796874 25.387670972656245 C 18.537359653048604 25.387721182280185 18.54814394157355 25.387746287194187 18.558928244709044 25.387746287194187 C 22.396705336309363 25.387746287194187 25.50783837263873 22.27661325086481 25.50783837263873 18.438836159264497 C 25.50783837263873 14.601059067664185 22.396705336309363 11.48992603133481 18.558928244709044 11.48992603133481 C 14.72118056523231 11.48992603133481 11.610059711939467 14.601013165475232 11.610018117187504 18.438760844726563 C 11.6100055260099 18.44415500501238 11.609999230414665 18.449549178157536 11.609999230414665 18.45494335313865 C 11.609999230414665 22.280184472224335 14.70827046453852 25.38258105471001 18.53350819726563 25.387670972656252 Z " fill-rule="nonzero" fill="#3da1de" stroke="none" transform="matrix(1 0 0 1 738 62 )" /> |
|
||||
</g> |
|
||||
</svg> |
|
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="12px" height="12px" xmlns="http://www.w3.org/2000/svg"> |
||||
|
<g transform="matrix(1 0 0 1 -347 -469 )"> |
||||
|
<path d="M 10.684322033898304 5.219491525423729 C 10.685593220338983 4.930932203389831 10.452966101694914 4.698305084745764 10.165677966101695 4.698305084745764 C 9.878389830508475 4.698305084745764 9.644491525423728 4.930932203389831 9.644491525423728 5.219491525423729 L 9.644491525423728 10.426271186440678 C 9.644491525423728 10.7135593220339 9.410593220338983 10.947457627118645 9.123305084745763 10.947457627118645 L 2.8754237288135593 10.947457627118645 C 2.588135593220339 10.947457627118645 2.354237288135593 10.7135593220339 2.354237288135593 10.426271186440678 L 2.354237288135593 5.219491525423729 C 2.354237288135593 4.932203389830509 2.1216101694915253 4.698305084745764 1.833050847457627 4.698305084745764 C 1.5444915254237288 4.698305084745764 1.3118644067796608 4.930932203389831 1.3118644067796608 5.219491525423729 L 1.3118644067796608 10.426271186440678 C 1.3118644067796608 11.288135593220339 2.01228813559322 11.988559322033899 2.8741525423728818 11.988559322033899 L 9.122033898305085 11.988559322033899 C 9.983898305084745 11.988559322033899 10.684322033898304 11.288135593220339 10.684322033898304 10.426271186440678 L 10.684322033898304 5.219491525423729 Z M 11.98728813559322 2.8766949152542374 C 11.98728813559322 2.589406779661017 11.753389830508475 2.3555084745762715 11.467372881355931 2.3555084745762715 L 9.12457627118644 2.3555084745762715 L 9.12457627118644 1.314406779661017 C 9.12457627118644 0.5961864406779662 8.539830508474576 0.012711864406779662 7.8228813559322035 0.012711864406779662 L 4.177118644067797 0.012711864406779662 C 3.458898305084746 0.012711864406779662 2.87542372881356 0.5961864406779662 2.87542372881356 1.314406779661017 L 2.87542372881356 2.3555084745762715 L 0.5326271186440679 2.3555084745762715 C 0.24661016949152548 2.3555084745762715 0.011440677966101768 2.589406779661017 0.011440677966101768 2.8766949152542374 C 0.011440677966101768 3.1627118644067798 0.2453389830508475 3.3978813559322036 0.5326271186440679 3.3978813559322036 L 11.466101694915254 3.3978813559322036 C 11.752118644067796 3.3978813559322036 11.98728813559322 3.163983050847458 11.98728813559322 2.8766949152542374 Z M 8.083474576271188 2.3555084745762715 L 3.917796610169492 2.3555084745762715 L 3.917796610169492 1.314406779661017 C 3.917796610169492 1.1707627118644068 4.034745762711864 1.053813559322034 4.1783898305084755 1.053813559322034 L 7.822881355932205 1.053813559322034 C 7.966525423728815 1.053813559322034 8.083474576271188 1.1707627118644068 8.083474576271188 1.314406779661017 L 8.083474576271188 2.3555084745762715 Z M 4.698305084745764 9.385169491525422 C 4.985593220338984 9.385169491525422 5.219491525423729 9.149999999999999 5.219491525423729 8.863983050847457 L 5.219491525423729 5.739406779661016 C 5.219491525423729 5.453389830508475 4.985593220338984 5.21822033898305 4.698305084745764 5.21822033898305 C 4.411016949152542 5.21822033898305 4.177118644067797 5.452118644067796 4.177118644067797 5.739406779661016 L 4.177118644067797 8.863983050847457 C 4.177118644067797 9.149999999999999 4.411016949152542 9.385169491525422 4.698305084745764 9.385169491525422 Z M 7.301694915254236 9.385169491525422 C 7.58771186440678 9.383898305084745 7.8228813559322035 9.149999999999999 7.8228813559322035 8.863983050847457 L 7.8228813559322035 5.739406779661016 C 7.8228813559322035 5.453389830508475 7.5889830508474585 5.21822033898305 7.301694915254236 5.21822033898305 C 7.015677966101695 5.21822033898305 6.780508474576271 5.452118644067796 6.780508474576271 5.739406779661016 L 6.780508474576271 8.863983050847457 C 6.780508474576271 9.149999999999999 7.014406779661017 9.385169491525422 7.301694915254236 9.385169491525422 Z " fill-rule="nonzero" fill="#d9001b" stroke="none" transform="matrix(1 0 0 1 347 469 )" /> |
||||
|
</g> |
||||
|
</svg> |
After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,952 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<!-- <a-table |
||||
|
:columns="tableColumns" |
||||
|
:data-source="data" |
||||
|
bordered |
||||
|
:pagination="false" |
||||
|
:scroll="{ x: 2000 }"> |
||||
|
<template #bodyCell="{ column, text, record }"> |
||||
|
<template v-if="column.key === 'action'"> |
||||
|
<span> |
||||
|
<a @click="editData(record)">编辑</a> |
||||
|
<a-divider type="vertical" /> |
||||
|
<a @click="delData(record)">删除</a> |
||||
|
</span> |
||||
|
</template> |
||||
|
</template> |
||||
|
<template #title> |
||||
|
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" valueFormat="YYYY" /> |
||||
|
<div class="buttonGroup"> |
||||
|
<a-button type="primary" @click="addNewData">新增</a-button> |
||||
|
<a-button type="primary">导入</a-button> |
||||
|
<a-button type="primary">导出</a-button> |
||||
|
<a-button type="primary">模板下载</a-button> |
||||
|
<a-button type="primary" @click="uploadVoucher">上传凭证</a-button> |
||||
|
<a-button type="primary">凭证下载</a-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</a-table> --> |
||||
|
<ns-view-list-table |
||||
|
v-bind="tableConfig" |
||||
|
:model="data" |
||||
|
ref="mainRef" |
||||
|
:scroll="{ x: 1500, y: 350 }"> |
||||
|
<!-- <template #bodyCell="{ column, text, record }"> |
||||
|
<template v-if="column.dataIndex === 'janFlag'"> |
||||
|
<span v-if="record.janFlag===1" style="color: rgba(243, 97, 99, 1);">{{text}}</span> |
||||
|
<span v-else style="color: rgba(57, 215, 287, 1);">{{text}}</span> |
||||
|
</template> |
||||
|
</template> --> |
||||
|
</ns-view-list-table> |
||||
|
<!-- <a-pagination |
||||
|
:current="queryParams.pageNum" |
||||
|
:total="total" |
||||
|
:page-size="queryParams.pageSize" |
||||
|
style="display: flex;justify-content: center;margin-top: 16px;" |
||||
|
:show-size-changer="true" |
||||
|
:show-quick-jumper="true" |
||||
|
@change="onChange" /> --> |
||||
|
<!-- 新增数据库数据 --> |
||||
|
<a-drawer |
||||
|
:width="500" |
||||
|
:visible="visible" |
||||
|
:body-style="{ paddingBottom: '80px' }" |
||||
|
:footer-style="{ textAlign: 'right' }" |
||||
|
destroyOnClose |
||||
|
@close="onClose"> |
||||
|
<a-form |
||||
|
ref="formRef" |
||||
|
:model="formState" |
||||
|
:rules="rules" |
||||
|
:label-col="labelCol" |
||||
|
:wrapper-col="wrapperCol"> |
||||
|
<a-form-item ref="name" label="能耗名称" name="energyType"> |
||||
|
<a-input v-model:value="formState.energyType" placeholder="请输入能源种类" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item label="计量单位" name="unit"> |
||||
|
<a-cascader v-model:value="formState.unit" :options="measurementUnit" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item label="能耗类型" name="emissionType" :required="isRequired"> |
||||
|
<a-select v-model:value="formState.emissionType" placeholder="请选择能耗类型"> |
||||
|
<a-select-option v-for="(item, index) in energyTypeOptions" :key="index" :value="item.dicKey"> |
||||
|
{{ item.cnValue }} |
||||
|
</a-select-option> |
||||
|
</a-select> |
||||
|
</a-form-item> |
||||
|
<a-form-item label="自动采集节点" name="collectionNode"> |
||||
|
<a-tree-select |
||||
|
v-model:value="formState.collectionNode" |
||||
|
:tree-line="true" |
||||
|
:tree-data="treeData"> |
||||
|
</a-tree-select> |
||||
|
</a-form-item> |
||||
|
<a-form-item label="计算碳排" name="isComputeCarbon"> |
||||
|
<a-radio-group v-model:value="formState.isComputeCarbon" @change="changeRadio"> |
||||
|
<a-radio :value="0">是</a-radio> |
||||
|
<a-radio :value="1">否</a-radio> |
||||
|
</a-radio-group> |
||||
|
</a-form-item> |
||||
|
<a-form-item label="排放类型" name="emissionType" :required="isRequired"> |
||||
|
<a-select v-model:value="formState.emissionType" placeholder="请选择排放类型"> |
||||
|
<a-select-option v-for="(item, index) in emissionTypeDic" :key="index" :value="item.id"> |
||||
|
{{ item.cnValue }} |
||||
|
</a-select-option> |
||||
|
</a-select> |
||||
|
</a-form-item> |
||||
|
<a-row> |
||||
|
<a-col :span="24" style="display: flex; justify-content: space-around"> |
||||
|
<a-form-item |
||||
|
label="1月" |
||||
|
name="janFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.janFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="2月" |
||||
|
name="febFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.febFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="3月" |
||||
|
name="marFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.marFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
</a-col> |
||||
|
<a-col :span="24" style="display: flex; justify-content: space-around"> |
||||
|
<a-form-item |
||||
|
label="4月" |
||||
|
name="aprFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.aprFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="5月" |
||||
|
name="mayFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.mayFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="6月" |
||||
|
name="junFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.junFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
</a-col> |
||||
|
<a-col :span="24" style="display: flex; justify-content: space-around"> |
||||
|
<a-form-item |
||||
|
label="7月" |
||||
|
name="julFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.julFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="8月" |
||||
|
name="augFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.augFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="9月" |
||||
|
name="sepFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.sepFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
</a-col> |
||||
|
<a-col :span="24" style="display: flex; justify-content: space-around"> |
||||
|
<a-form-item |
||||
|
label="10月" |
||||
|
name="octFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.octFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="11月" |
||||
|
name="novFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.novFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
<a-form-item |
||||
|
label="12月" |
||||
|
name="decFlag" |
||||
|
:label-col="switchLabelCol" |
||||
|
:wrapper-col="switchWrapperCol"> |
||||
|
<a-switch |
||||
|
v-model:checked="formState.decFlag" |
||||
|
:checked-value="1" |
||||
|
:unCheckedValue="0" /> |
||||
|
</a-form-item> |
||||
|
</a-col> |
||||
|
</a-row> |
||||
|
<a-form-item ref="name" label="上传凭证"> |
||||
|
<a-upload |
||||
|
:file-list="fileList" |
||||
|
name="file" |
||||
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf" |
||||
|
@remove="handleFileRemove" |
||||
|
:before-upload="beforeUpload" |
||||
|
@change="handleChange"> |
||||
|
<a-button> |
||||
|
<upload-outlined></upload-outlined> |
||||
|
上传 |
||||
|
</a-button> |
||||
|
</a-upload> |
||||
|
</a-form-item> |
||||
|
</a-form> |
||||
|
<template #footer> |
||||
|
<a-button style="margin-right: 8px" @click="onClose">取消</a-button> |
||||
|
<a-button type="primary" @click="onSubmit">确定</a-button> |
||||
|
</template> |
||||
|
</a-drawer> |
||||
|
<!-- 上传凭证弹窗 --> |
||||
|
<!-- <a-modal :visible="openUpload" title="凭证上传" @ok="handleOk" @cancel="closeOpenUpload"> |
||||
|
<a-upload-dragger |
||||
|
v-model:fileList="fileList" |
||||
|
name="file" |
||||
|
:multiple="true" |
||||
|
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" |
||||
|
@change="handleChange" |
||||
|
@drop="handleDrop" |
||||
|
> |
||||
|
<p class="ant-upload-drag-icon"> |
||||
|
<inbox-outlined></inbox-outlined> |
||||
|
</p> |
||||
|
<p class="ant-upload-hint" style="display: flex;flex-direction: column;"> |
||||
|
<p>1.仅支持pdf格式文件或文件夹</p> |
||||
|
<p>2.文件命名规则为【能源种类_年份】</p> |
||||
|
<p>3.每次上传自动覆盖</p> |
||||
|
</p> |
||||
|
</a-upload-dragger> |
||||
|
</a-modal> --> |
||||
|
<!-- 凭证下载 --> |
||||
|
<a-drawer |
||||
|
:visible="downLoadVisible" |
||||
|
title="凭证列表" |
||||
|
:width="500" |
||||
|
@close="onCloseDownLoad" |
||||
|
:footer-style="{ textAlign: 'right' }"> |
||||
|
<div></div> |
||||
|
<a-table |
||||
|
:columns="downLoadColumns" |
||||
|
:data-source="downLoadData" |
||||
|
bordered |
||||
|
rowKey="id" |
||||
|
:rowSelection="{ |
||||
|
selectedRowKeys: selectedRowKeysSet, |
||||
|
onChange: onSelectionChangeSet, |
||||
|
}" |
||||
|
:pagination="false"> |
||||
|
<template #bodyCell="{ column, text, record }"> |
||||
|
<template v-if="column.key === 'action'"> |
||||
|
<span> |
||||
|
<a @click="downLoad(record)">下载</a> |
||||
|
</span> |
||||
|
</template> |
||||
|
</template> |
||||
|
</a-table> |
||||
|
<template #footer> |
||||
|
<a-button style="margin-right: 8px" @click="onCloseDownLoad">取消</a-button> |
||||
|
<a-button type="primary" @click="onSubmitDownLoad">确定</a-button> |
||||
|
</template> |
||||
|
</a-drawer> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import { ref, toRaw, defineExpose } from 'vue'; |
||||
|
import type { Rule } from 'ant-design-vue/es/form'; |
||||
|
import { Pagination, message, Modal } from 'ant-design-vue'; |
||||
|
import { UploadOutlined } from '@ant-design/icons-vue'; |
||||
|
import type { TreeSelectProps, UploadChangeParam, UploadProps } from 'ant-design-vue'; |
||||
|
import { NsMessage } from '/nerv-lib/component'; |
||||
|
import dayjs, { Dayjs } from 'dayjs'; |
||||
|
import { http } from '/nerv-lib/util/http'; |
||||
|
import { Cookies } from '/nerv-lib/util/cookie'; |
||||
|
import { tableColumns } from '../config'; |
||||
|
import { |
||||
|
energyConsumption, |
||||
|
carbonEmissionFactorLibrary, |
||||
|
uploadPic, |
||||
|
} from '/@/api/carbonEmissionFactorLibrary'; |
||||
|
import { dict } from '/@/api'; |
||||
|
import { group } from '/@/api/deviceManage'; |
||||
|
defineOptions({ |
||||
|
energyType: 'EnergyConsumption', // 与页面路由name一致缓存才可生效 |
||||
|
components: { |
||||
|
'a-pagination': Pagination, |
||||
|
}, |
||||
|
}); |
||||
|
const orgId = ref(''); |
||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!); |
||||
|
orgId.value = result; |
||||
|
const fetch = (api, params = { orgId }, config) => { |
||||
|
return http.post(api, params, config); |
||||
|
}; |
||||
|
const selectYear = ref<Dayjs>(dayjs(new Date().getFullYear().toString())); |
||||
|
const total = ref<number>(); |
||||
|
const queryParams = ref({ |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
orgId: orgId.value, |
||||
|
year: selectYear.value.format('YYYY'), |
||||
|
}); |
||||
|
const isRequired = ref(false); |
||||
|
const visible = ref(false); |
||||
|
const openUpload = ref<boolean>(false); |
||||
|
const data = ref([]); |
||||
|
interface FormState { |
||||
|
energyType: string; |
||||
|
unit: string; |
||||
|
collectionNode: string; |
||||
|
emissionType: string | undefined; |
||||
|
isComputeCarbon: string; |
||||
|
janFlag: string; |
||||
|
febFlag: string; |
||||
|
marFlag: string; |
||||
|
aprFlag: string; |
||||
|
mayFlag: string; |
||||
|
junFlag: string; |
||||
|
julFlag: string; |
||||
|
augFlag: string; |
||||
|
sepFlag: string; |
||||
|
octFlag: string; |
||||
|
novFlag: string; |
||||
|
decFlag: string; |
||||
|
} |
||||
|
const formRef = ref(); |
||||
|
const labelCol = { span: 5 }; |
||||
|
const wrapperCol = { span: 19 }; |
||||
|
const switchLabelCol = { span: 10 }; |
||||
|
const switchWrapperCol = { span: 14 }; |
||||
|
const formState = ref({ |
||||
|
orgId: orgId.value, |
||||
|
}); |
||||
|
// 定义form表单的必填 |
||||
|
const rules: Record<string, Rule[]> = { |
||||
|
energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }], |
||||
|
isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }], |
||||
|
unit: [{ required: true, message: '请选择计量单位', trigger: 'change' }], |
||||
|
}; |
||||
|
// 排放类型的变量 |
||||
|
const emissionTypeDic = ref(); |
||||
|
// 计量单位的变量 |
||||
|
const measurementUnit = ref([]); |
||||
|
// 定义自动采集节点数的变量 |
||||
|
const treeData = ref<TreeSelectProps['treeData']>([]); |
||||
|
// 年份选择改变触发 |
||||
|
const changeYearData = () => { |
||||
|
queryParams.value.year = selectYear.value; |
||||
|
getTableList(); |
||||
|
}; |
||||
|
const mainRef = ref(); |
||||
|
const year = selectYear.value.format('YYYY'); |
||||
|
const tableConfig = ref({ |
||||
|
title: '能耗统计', |
||||
|
api: energyConsumption.pageList, |
||||
|
params: queryParams.value, |
||||
|
headerActions: [ |
||||
|
{ |
||||
|
label: '新增', |
||||
|
name: 'userAdd', |
||||
|
type: 'primary', |
||||
|
handle: () => { |
||||
|
getDictList(); |
||||
|
visible.value = true; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '导入', |
||||
|
type: 'primary', |
||||
|
name: 'userImport', |
||||
|
handle: () => {}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '导出', |
||||
|
type: 'primary', |
||||
|
name: 'userExports', |
||||
|
}, |
||||
|
{ |
||||
|
label: '模板下载', |
||||
|
type: 'primary', |
||||
|
}, |
||||
|
// { |
||||
|
// label: '上传凭证', |
||||
|
// type: 'primary', |
||||
|
// handle: () => { |
||||
|
// openUpload.value = true; |
||||
|
// }, |
||||
|
// }, |
||||
|
{ |
||||
|
label: '凭证下载', |
||||
|
type: 'primary', |
||||
|
handle: () => { |
||||
|
fetch(energyConsumption.voucherDownloadList, { bizType: 3 }).then((res) => { |
||||
|
downLoadData.value = res.data; |
||||
|
}); |
||||
|
downLoadVisible.value = true; |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
columns: [ |
||||
|
{ |
||||
|
title: '序号', |
||||
|
customRender: (text: any) => { |
||||
|
return text.index + 1; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: '能源种类', |
||||
|
dataIndex: 'energyType', |
||||
|
}, |
||||
|
{ |
||||
|
title: '计量单位', |
||||
|
className: 'unitName', |
||||
|
dataIndex: 'unitName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '全年', |
||||
|
dataIndex: 'yearly', |
||||
|
}, |
||||
|
{ |
||||
|
title: '1月', |
||||
|
dataIndex: 'jan', |
||||
|
// customRender: ({ text }: { text: string }) => { |
||||
|
// return <span :style="{ color: getColor(text) }">{text}</span>; |
||||
|
// } |
||||
|
}, |
||||
|
{ |
||||
|
title: '2月', |
||||
|
dataIndex: 'feb', |
||||
|
}, |
||||
|
{ |
||||
|
title: '3月', |
||||
|
dataIndex: 'mar', |
||||
|
}, |
||||
|
{ |
||||
|
title: '4月', |
||||
|
dataIndex: 'apr', |
||||
|
}, |
||||
|
{ |
||||
|
title: '5月', |
||||
|
dataIndex: 'may', |
||||
|
}, |
||||
|
{ |
||||
|
title: '6月', |
||||
|
dataIndex: 'jun', |
||||
|
}, |
||||
|
{ |
||||
|
title: '7月', |
||||
|
dataIndex: 'jul', |
||||
|
}, |
||||
|
{ |
||||
|
title: '8月', |
||||
|
dataIndex: 'aug', |
||||
|
}, |
||||
|
{ |
||||
|
title: '9月', |
||||
|
dataIndex: 'sep', |
||||
|
}, |
||||
|
{ |
||||
|
title: '10月', |
||||
|
dataIndex: 'oct', |
||||
|
}, |
||||
|
{ |
||||
|
title: '11月', |
||||
|
dataIndex: 'nov', |
||||
|
}, |
||||
|
{ |
||||
|
title: '12月', |
||||
|
dataIndex: 'dec', |
||||
|
}, |
||||
|
], |
||||
|
columnActions: { |
||||
|
title: '操作', |
||||
|
actions: [ |
||||
|
{ |
||||
|
label: '编辑', |
||||
|
name: 'userEdit', |
||||
|
handle: (record: any) => { |
||||
|
getDictList(); |
||||
|
visible.value = true; |
||||
|
fetch(energyConsumption.findById, { id: record.id }).then((res) => { |
||||
|
if (res.data.emissionType) { |
||||
|
res.data.emissionType = Number(res.data.emissionType); |
||||
|
} |
||||
|
if (res.data.unit) { |
||||
|
let selectDevice = ref([Number(res.data.unit)]); |
||||
|
findParentIds(measurementUnit.value, res.data.unit, selectDevice.value); |
||||
|
res.data.unit = selectDevice; |
||||
|
} |
||||
|
formState.value = res.data; |
||||
|
emissionType.value = res.data.emissionType; |
||||
|
if (formState.value.isComputeCarbon === 0) { |
||||
|
isRequired.value = true; |
||||
|
} else { |
||||
|
isRequired.value = false; |
||||
|
} |
||||
|
}); |
||||
|
fetch(uploadPic.select, { bizId: record.id, bizType: 3 }).then((res) => { |
||||
|
fileList.value = res.data.map((item) => ({ |
||||
|
uid: item.id.toString(), // 使用文件的id作为唯一标识 |
||||
|
name: item.fileName, // 文件名 |
||||
|
status: 'done', // 设置默认状态为已完成 |
||||
|
type: 'done', |
||||
|
url: item.filePath, // 文件的URL,这里假设用示例的URL格式 |
||||
|
})); |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '删除', |
||||
|
name: 'userDelete', |
||||
|
dynamicParams: { id: 'id' }, |
||||
|
confirm: true, |
||||
|
isReload: true, |
||||
|
api: energyConsumption.del, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
formConfig: { |
||||
|
schemas: [ |
||||
|
{ |
||||
|
field: 'year', |
||||
|
label: '年份', |
||||
|
component: 'NsDatePicker', |
||||
|
componentProps: { |
||||
|
picker: 'year', |
||||
|
valueFormat: 'YYYY', |
||||
|
defaultValue: selectYear.value.format('YYYY'), |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
params: {}, |
||||
|
}, |
||||
|
rowKey: 'id', |
||||
|
}); |
||||
|
const getColor = (value: string | number): string => { |
||||
|
debugger; |
||||
|
if (typeof value === 'string') { |
||||
|
switch (value) { |
||||
|
case 'active': |
||||
|
return 'green'; |
||||
|
case 'inactive': |
||||
|
return 'red'; |
||||
|
default: |
||||
|
return 'black'; |
||||
|
} |
||||
|
} else if (typeof value === 'number') { |
||||
|
return value > 30 ? 'blue' : 'purple'; // 示例:根据年龄设置颜色 |
||||
|
} |
||||
|
return 'black'; |
||||
|
}; |
||||
|
|
||||
|
defineExpose({ |
||||
|
mainRef, |
||||
|
}); |
||||
|
// 定义一个递归函数来查找每一级的id 设备类型回显 层级方法 |
||||
|
function findParentIds(tree: any, targetId: number, result: any) { |
||||
|
for (let item of tree) { |
||||
|
if (item.children && item.children.length > 0) { |
||||
|
if (item.children.some((child: any) => child.value === targetId)) { |
||||
|
result.unshift(item.value); // 将当前节点的id添加到结果数组的最前面 |
||||
|
findParentIds(tree, item.value, result); // 递归查找父级节点的id |
||||
|
break; // 找到后可以退出循环 |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
// 获取表格数据 |
||||
|
const getTableList = () => { |
||||
|
fetch(energyConsumption.pageList, queryParams.value).then((res) => { |
||||
|
data.value = res.data.records; |
||||
|
}); |
||||
|
}; |
||||
|
// 分页器 |
||||
|
const onChange = (pageNumber: number, size: number) => { |
||||
|
queryParams.value.pageNum = pageNumber; |
||||
|
queryParams.value.pageSize = size; |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
}; |
||||
|
// 计算碳排切换 |
||||
|
const emissionType = ref(); |
||||
|
const changeRadio = (e) => { |
||||
|
if (e.target.value === 0) { |
||||
|
isRequired.value = true; |
||||
|
if (emissionType.value) { |
||||
|
formState.value.emissionType = emissionType.value; |
||||
|
} |
||||
|
} else { |
||||
|
isRequired.value = false; |
||||
|
formState.value.emissionType = ''; |
||||
|
} |
||||
|
}; |
||||
|
// 点击确定提交 |
||||
|
const onSubmit = () => { |
||||
|
formRef.value |
||||
|
.validate() |
||||
|
.then(() => { |
||||
|
console.log('values', formState, toRaw(formState)); |
||||
|
formState.value.year = selectYear.value.format('YYYY'); |
||||
|
if (formState.value.unit) { |
||||
|
formState.value.unit = formState.value.unit.join(',').split(',')[1]; |
||||
|
} |
||||
|
if (formState.value.id) { |
||||
|
fetch(energyConsumption.update, formState.value).then((res) => { |
||||
|
if (fileList.value.length !== 0) { |
||||
|
const formData = ref(new FormData()); |
||||
|
fileList.value.forEach((file) => { |
||||
|
if (file.type !== 'done') { |
||||
|
formData.value.append('files', file.originFileObj); |
||||
|
} |
||||
|
}); |
||||
|
formData.value.append('bizType', 3); |
||||
|
formData.value.append('bizId', formState.value.id); |
||||
|
delIds.value.forEach((item) => { |
||||
|
formData.value.append('deleteList', item); |
||||
|
}); |
||||
|
fetch(uploadPic.uploadfiles, formData.value) |
||||
|
.then((res) => { |
||||
|
message.success('操作成功!'); |
||||
|
visible.value = false; |
||||
|
delIds.value = []; |
||||
|
formState.value = { |
||||
|
orgId: orgId.value, |
||||
|
}; |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
console.log('error', error); |
||||
|
}); |
||||
|
} else { |
||||
|
visible.value = false; |
||||
|
delIds.value = []; |
||||
|
formState.value = { |
||||
|
orgId: orgId.value, |
||||
|
}; |
||||
|
message.success('操作成功!'); |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
} |
||||
|
}); |
||||
|
} else { |
||||
|
fetch(energyConsumption.creat, formState.value).then((res) => { |
||||
|
if (res.data === '新增数据已存在') { |
||||
|
visible.value = false; |
||||
|
delIds.value = []; |
||||
|
NsMessage.warning(res.data); |
||||
|
} else { |
||||
|
if (fileList.value.length !== 0) { |
||||
|
const formData = ref(new FormData()); |
||||
|
fileList.value.forEach((file) => { |
||||
|
formData.value.append('files', file.originFileObj); |
||||
|
}); |
||||
|
formData.value.append('bizType', 3); |
||||
|
formData.value.append('bizId', res.data); |
||||
|
fetch(uploadPic.uploadfiles, formData.value) |
||||
|
.then((res) => { |
||||
|
message.success('操作成功!'); |
||||
|
visible.value = false; |
||||
|
delIds.value = []; |
||||
|
formState.value = { |
||||
|
orgId: orgId.value, |
||||
|
}; |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
console.log('error', error); |
||||
|
}); |
||||
|
} else { |
||||
|
visible.value = false; |
||||
|
delIds.value = []; |
||||
|
formState.value = { |
||||
|
orgId: orgId.value, |
||||
|
}; |
||||
|
message.success('操作成功!'); |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
console.log('error', error); |
||||
|
}); |
||||
|
}; |
||||
|
const energyTypeOptions = ref([]); |
||||
|
// 获取字典值 |
||||
|
const getDictList = async () => { |
||||
|
// 获取能耗类型 |
||||
|
const options = await dict({ params: { dicKey: 'ENERGY_TYPE' } }); |
||||
|
energyTypeOptions.value = options.data.data |
||||
|
console.log(energyTypeOptions); |
||||
|
debugger |
||||
|
// 获取排放类型的数据 |
||||
|
fetch(energyConsumption.getDicList, { grp: 'EMISSION_TYPE' }).then((res) => { |
||||
|
emissionTypeDic.value = res.data; |
||||
|
}); |
||||
|
// 获取计量单位的数据 |
||||
|
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'MEASUREMENT_UNIT' }).then( |
||||
|
(res) => { |
||||
|
measurementUnit.value = res.data; |
||||
|
measurementUnit.value = measurementUnit.value.map((item) => ({ |
||||
|
value: item.id, |
||||
|
label: item.cnValue, |
||||
|
children: item.children |
||||
|
? item.children.map((child) => ({ |
||||
|
value: child.id, |
||||
|
label: child.cnValue, |
||||
|
})) |
||||
|
: [], |
||||
|
})); |
||||
|
}, |
||||
|
); |
||||
|
// 获取自动采集节点的数据 |
||||
|
fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE', orgId: orgId.value }).then( |
||||
|
(res) => { |
||||
|
treeData.value = res.data; |
||||
|
treeData.value = treeData.value.map((item) => ({ |
||||
|
value: item.id, |
||||
|
label: item.pointName, |
||||
|
children: item.children |
||||
|
? item.children.map((child) => ({ |
||||
|
value: child.id, |
||||
|
label: child.pointName, |
||||
|
})) |
||||
|
: [], |
||||
|
})); |
||||
|
}, |
||||
|
); |
||||
|
}; |
||||
|
// 点击新增按钮 |
||||
|
const addNewData = () => { |
||||
|
getDictList(); |
||||
|
visible.value = true; |
||||
|
}; |
||||
|
// 点击编辑按钮 |
||||
|
const editData = (record) => { |
||||
|
getDictList(); |
||||
|
visible.value = true; |
||||
|
fetch(energyConsumption.findById, { id: record.id }).then((res) => { |
||||
|
if (res.data.unitName) { |
||||
|
res.data.unitName = res.data.unitName.split(','); |
||||
|
} |
||||
|
formState.value = res.data; |
||||
|
}); |
||||
|
}; |
||||
|
// 点击删除 |
||||
|
const delData = (record) => { |
||||
|
Modal.confirm({ |
||||
|
title: '警告', |
||||
|
content: '确定要删除吗?', |
||||
|
okText: '确定', |
||||
|
okType: 'primary', |
||||
|
cancelText: '取消', |
||||
|
onOk() { |
||||
|
fetch(energyConsumption.del, { id: record.id }).then((res) => { |
||||
|
message.success('操作成功!'); |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
}); |
||||
|
}, |
||||
|
onCancel() { |
||||
|
console.log('Cancel'); |
||||
|
}, |
||||
|
}); |
||||
|
}; |
||||
|
// 关闭新增抽屉 |
||||
|
const onClose = () => { |
||||
|
visible.value = false; |
||||
|
delIds.value = []; |
||||
|
formState.value = { |
||||
|
orgId: orgId.value, |
||||
|
}; |
||||
|
formRef.value.resetFields(); |
||||
|
}; |
||||
|
// 点击上传凭证按钮 |
||||
|
const uploadVoucher = () => { |
||||
|
openUpload.value = true; |
||||
|
}; |
||||
|
// 上传凭证弹窗点击确定 |
||||
|
const handleOk = (e: MouseEvent) => { |
||||
|
console.log(e); |
||||
|
openUpload.value = false; |
||||
|
}; |
||||
|
// 上传凭证相关方法及变量 |
||||
|
const fileList = ref<UploadProps['fileList']>([]); |
||||
|
const beforeUpload: UploadProps['beforeUpload'] = (file) => { |
||||
|
return false; |
||||
|
}; |
||||
|
const handleChange = (info: UploadChangeParam) => { |
||||
|
fileList.value = [...info.fileList]; |
||||
|
if (info.file.status !== 'uploading') { |
||||
|
console.log(info.file, info.fileList); |
||||
|
} |
||||
|
if (info.file.status === 'done') { |
||||
|
message.success(`${info.file.name} 文件上传成功`); |
||||
|
} else if (info.file.status === 'error') { |
||||
|
message.error(`${info.file.name} 文件上传失败`); |
||||
|
} |
||||
|
}; |
||||
|
const delIds = ref([]); |
||||
|
const handleFileRemove = (file) => { |
||||
|
delIds.value.push(file.uid); |
||||
|
const newFileList = []; |
||||
|
fileList.value.forEach((item) => { |
||||
|
if (item.uid !== file.uid) { |
||||
|
newFileList.push(item); |
||||
|
} |
||||
|
}); |
||||
|
fileList.value = newFileList; |
||||
|
}; |
||||
|
// 关闭上传凭证弹窗 |
||||
|
const closeOpenUpload = () => { |
||||
|
openUpload.value = false; |
||||
|
}; |
||||
|
// 凭证下载 |
||||
|
const downLoadVisible = ref(false); |
||||
|
const downLoadColumns = [ |
||||
|
{ |
||||
|
title: '序号', |
||||
|
customRender: (text: any) => { |
||||
|
return text.index + 1; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: '能源类型', |
||||
|
dataIndex: 'bizName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '文件名', |
||||
|
dataIndex: 'fileName', |
||||
|
ellipsis: true, |
||||
|
}, |
||||
|
{ |
||||
|
title: '操作', |
||||
|
key: 'action', |
||||
|
}, |
||||
|
]; |
||||
|
const downLoadData = ref([]); |
||||
|
const selectedRowKeysSet = ref([]); |
||||
|
const onSelectionChangeSet = (selectedKeys, selectedRows) => { |
||||
|
selectedRowKeysSet.value = selectedKeys; |
||||
|
}; |
||||
|
const downLoad = (record) => { |
||||
|
const deleteId = ref(new FormData()); |
||||
|
deleteId.value.append('id', record.id); |
||||
|
const config = { |
||||
|
headers: { |
||||
|
responseType: 'blob', |
||||
|
}, |
||||
|
}; |
||||
|
fetch(uploadPic.download, deleteId.value, config) |
||||
|
.then((res) => { |
||||
|
// 创建一个 URL 对象,指向图片数据的 blob |
||||
|
const url = window.URL.createObjectURL(new Blob([res.data])); |
||||
|
// 创建一个 <a> 标签,用于触发下载 |
||||
|
const link = document.createElement('a'); |
||||
|
link.href = url; |
||||
|
link.setAttribute('download', record.fileName); // 设置下载的文件名 |
||||
|
document.body.appendChild(link); |
||||
|
link.click(); |
||||
|
|
||||
|
// 清理 URL 对象 |
||||
|
window.URL.revokeObjectURL(url); |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
console.error('下载图片失败:', error); |
||||
|
}); |
||||
|
}; |
||||
|
const onSubmitDownLoad = () => { |
||||
|
const deleteIds = ref(new FormData()); |
||||
|
selectedRowKeysSet.value.forEach((item) => { |
||||
|
deleteIds.value.append('ids', item); |
||||
|
}); |
||||
|
fetch(uploadPic.downloadZip, deleteIds.value) |
||||
|
.then((res) => { |
||||
|
// 创建一个 URL 对象,指向图片数据的 blob |
||||
|
const url = window.URL.createObjectURL(new Blob([res.data])); |
||||
|
// 创建一个 <a> 标签,用于触发下载 |
||||
|
const link = document.createElement('a'); |
||||
|
link.href = url; |
||||
|
debugger; |
||||
|
link.setAttribute('download', ''); // 设置下载的文件名 |
||||
|
document.body.appendChild(link); |
||||
|
link.click(); |
||||
|
|
||||
|
// 清理 URL 对象 |
||||
|
window.URL.revokeObjectURL(url); |
||||
|
onCloseDownLoad(); |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
console.error('下载图片失败:', error); |
||||
|
}); |
||||
|
}; |
||||
|
const onCloseDownLoad = () => { |
||||
|
selectedRowKeysSet.value = []; |
||||
|
downLoadVisible.value = false; |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped lang="less"> |
||||
|
:deep(.ant-table-title) { |
||||
|
display: flex; |
||||
|
} |
||||
|
:deep(.ant-table-container) { |
||||
|
padding: 0px 16px; |
||||
|
} |
||||
|
.buttonGroup { |
||||
|
margin-left: 1vw; |
||||
|
width: 30vw; |
||||
|
display: flex; |
||||
|
justify-content: space-around; |
||||
|
} |
||||
|
</style> |
||||
|
<style scoped> |
||||
|
th.column-money, |
||||
|
td.column-money { |
||||
|
text-align: right !important; |
||||
|
} |
||||
|
</style> |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 2.0 MiB |
After Width: | Height: | Size: 1.6 MiB |
@ -1,3 +1,63 @@ |
|||||
// 此文件只定义light(即俯视图小灯泡)的位置信息
|
// 此文件只定义light(即俯视图小灯泡)的位置信息
|
||||
// 与显示状态和分组信息无关
|
// 与显示状态和分组信息无关
|
||||
export const lightPosition = []; |
export const lightPosition = [ |
||||
|
// 安检区A
|
||||
|
{ left: '160px', bottom: '270px' }, |
||||
|
{ left: '185px', bottom: '230px' }, |
||||
|
{ left: '220px', bottom: '180px' }, |
||||
|
{ left: '250px', bottom: '130px' }, |
||||
|
// 站厅区B 1组
|
||||
|
{ left: '240px', bottom: '290px' }, |
||||
|
{ left: '260px', bottom: '260px' }, |
||||
|
{ left: '280px', bottom: '230px' }, |
||||
|
{ left: '310px', bottom: '190px' }, |
||||
|
{ left: '330px', bottom: '160px' }, |
||||
|
// 站厅区B 2组
|
||||
|
{ left: '300px', bottom: '305px' }, |
||||
|
{ left: '325px', bottom: '275px' }, |
||||
|
{ left: '350px', bottom: '245px' }, |
||||
|
{ left: '375px', bottom: '215px' }, |
||||
|
{ left: '400px', bottom: '180px' }, |
||||
|
// 站台区A 1组
|
||||
|
{ left: '370px', bottom: '320px' }, |
||||
|
{ left: '470px', bottom: '210px' }, |
||||
|
// 站台区A 2组
|
||||
|
{ left: '425px', bottom: '335px' }, |
||||
|
{ left: '530px', bottom: '230px' }, |
||||
|
// 站台区A 3组
|
||||
|
{ left: '475px', bottom: '350px' }, |
||||
|
{ left: '590px', bottom: '250px' }, |
||||
|
// 站台区A 4组
|
||||
|
{ left: '530px', bottom: '365px' }, |
||||
|
{ left: '640px', bottom: '270px' }, |
||||
|
// 一楼办公区
|
||||
|
{ left: '570px', bottom: '390px' }, |
||||
|
{ left: '605px', bottom: '365px' }, |
||||
|
{ left: '640px', bottom: '340px' }, |
||||
|
{ left: '675px', bottom: '315px' }, |
||||
|
{ left: '710px', bottom: '290px' }, |
||||
|
// 安保区 4 分组
|
||||
|
{ left: '670px', bottom: '370px' }, |
||||
|
{ left: '720px', bottom: '385px' }, |
||||
|
{ left: '770px', bottom: '400px' }, |
||||
|
{ left: '820px', bottom: '415px' }, |
||||
|
// 一楼男厕A
|
||||
|
{ left: '810px', bottom: '455px' }, |
||||
|
{ left: '970px', bottom: '370px' }, |
||||
|
{ left: '850px', bottom: '465px' }, |
||||
|
{ left: '1010px', bottom: '385px' }, |
||||
|
]; |
||||
|
|
||||
|
export const lightPosition1 = [ |
||||
|
// 二楼办公区
|
||||
|
{ left: '200px', bottom: '380px' }, |
||||
|
{ left: '220px', bottom: '350px' }, |
||||
|
{ left: '240px', bottom: '320px' }, |
||||
|
{ left: '260px', bottom: '290px' }, |
||||
|
{ left: '280px', bottom: '260px' }, |
||||
|
//
|
||||
|
{ left: '940px', bottom: '550px' }, |
||||
|
{ left: '1110px', bottom: '480px' }, |
||||
|
{ left: '990px', bottom: '560px' }, |
||||
|
{ left: '1170px', bottom: '490px' }, |
||||
|
]; |
||||
|
@ -0,0 +1,152 @@ |
|||||
|
import { planToAddApi } from '/@/api/planToAdd'; |
||||
|
import { ref } from 'vue'; |
||||
|
import { http } from '/nerv-lib/util'; |
||||
|
import { getEnum } from '/@/api'; |
||||
|
import { NsMessage } from '/nerv-lib/component'; |
||||
|
|
||||
|
const enumData: any = await getEnum({ params: { enumType: 'CtrlDeviceType' } }); |
||||
|
export const tableConfig = ( |
||||
|
orgId: any, |
||||
|
projectId: any, |
||||
|
mainRef: any, |
||||
|
nsModalFormConfig: any, |
||||
|
modalFormRef: any, |
||||
|
) => { |
||||
|
return ref({ |
||||
|
title: '计划库', |
||||
|
api: planToAddApi.getActivatedPlanListByTree, |
||||
|
params: { orgId, projectId, deviceType: enumData.data[0].value }, |
||||
|
treeConfig: { |
||||
|
defaultExpandAll: true, |
||||
|
header: { |
||||
|
icon: 'name', |
||||
|
title: '执行计划', |
||||
|
}, |
||||
|
params: { projectId, deviceType: enumData.data[0].value }, |
||||
|
dynamicParams: { |
||||
|
id: 'id', |
||||
|
pid: 'pid', |
||||
|
level: 'level', |
||||
|
projectId: 'projectId', |
||||
|
deviceType: 'deviceType', |
||||
|
}, |
||||
|
api: planToAddApi.getActivatedPlanTree, |
||||
|
fieldNames: { |
||||
|
title: 'name', |
||||
|
key: 'id', |
||||
|
pid: 'pid', |
||||
|
level: 'level', |
||||
|
projectId: 'projectId', |
||||
|
deviceType: 'deviceType', |
||||
|
children: 'childList', |
||||
|
}, |
||||
|
formConfig: { |
||||
|
schemas: [ |
||||
|
{ |
||||
|
field: 'deviceType', |
||||
|
label: '告警优先级', |
||||
|
component: 'nsSelectApi', |
||||
|
autoSubmit: true, |
||||
|
componentProps: { |
||||
|
api: () => getEnum({ params: { enumType: 'CtrlDeviceType' } }), |
||||
|
immediate: true, |
||||
|
resultField: 'data', |
||||
|
labelField: 'label', |
||||
|
valueField: 'value', |
||||
|
placeholder: '请选择告警优先级', |
||||
|
showSearch: true, |
||||
|
autoSelectFirst: true, |
||||
|
filterOption: (input: string, option: any) => { |
||||
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0; |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
rowSelection: null, |
||||
|
columns: [ |
||||
|
{ |
||||
|
title: '执行顺序', |
||||
|
dataIndex: 'address', |
||||
|
width: 100, |
||||
|
customRender: (text: any) => { |
||||
|
return text.index + 1; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: '计划类型', |
||||
|
dataIndex: 'planGroupName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '计划名称', |
||||
|
dataIndex: 'planName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '执行时间', |
||||
|
dataIndex: 'executionTime', |
||||
|
}, |
||||
|
], |
||||
|
columnActions: { |
||||
|
title: '操作', |
||||
|
width: 200, |
||||
|
fixed: 'right', |
||||
|
dataIndex: 'tableAction', |
||||
|
actions: [ |
||||
|
{ |
||||
|
label: '编辑', |
||||
|
name: 'energyAlarmEdit', |
||||
|
dynamicParams: ['uuid', 'appealType'], |
||||
|
handle: (data: any) => { |
||||
|
const obj = { ...data }; |
||||
|
nsModalFormConfig.value.title = '编辑'; |
||||
|
setTimeout(() => { |
||||
|
nsModalFormConfig.value.data = { |
||||
|
id: obj.id, |
||||
|
}; |
||||
|
if (obj.startTime) { |
||||
|
nsModalFormConfig.value.data.createTime = obj.startTime |
||||
|
? [obj.startTime, obj.endTime] |
||||
|
: []; |
||||
|
} |
||||
|
}, 1); |
||||
|
modalFormRef.value?.toggle(); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '删除', |
||||
|
name: 'energyAlarmDel', |
||||
|
dynamicParams: ['uuid', 'appealType'], |
||||
|
confirm: true, |
||||
|
handle: (data: any) => { |
||||
|
http.post(planToAddApi.updPlan, { id: data.id, isDeleted: 1 }).then((res) => { |
||||
|
if (res.msg === 'success') { |
||||
|
NsMessage.success('操作成功'); |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
} else { |
||||
|
NsMessage.error(res.msg); |
||||
|
} |
||||
|
}); |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
formConfig: { |
||||
|
schemas: [ |
||||
|
{ |
||||
|
field: 'planName', |
||||
|
label: '计划标题', |
||||
|
component: 'NsInput', |
||||
|
componentProps: { |
||||
|
allowClear: true, |
||||
|
placeholder: '请输入计划名称关键字', |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
params: {}, |
||||
|
}, |
||||
|
// pagination: { pageSizeOptions: false },
|
||||
|
rowKey: 'uuid', |
||||
|
}); |
||||
|
}; |
@ -0,0 +1,87 @@ |
|||||
|
<template> |
||||
|
<ns-view-list-table ref="mainRef" v-bind="config"> |
||||
|
<template #bodyCell="{ record, column }"> |
||||
|
<template v-if="column.dataIndex === 'executionTime'"> |
||||
|
{{ getData(record) }} |
||||
|
</template> |
||||
|
</template> |
||||
|
</ns-view-list-table> |
||||
|
<NsModalFrom ref="modalFormRef" v-bind="nsModalFormConfig" /> |
||||
|
</template> |
||||
|
<script lang="ts" setup> |
||||
|
import { tableConfig } from './config'; |
||||
|
import { ref, onMounted } from 'vue'; |
||||
|
import NsModalFrom from '/@/components/ns-modal-form.vue'; |
||||
|
import { planToAddApi } from '/@/api/planToAdd'; |
||||
|
import { NsMessage } from '/nerv-lib/component'; |
||||
|
|
||||
|
//页面 创建 |
||||
|
const orgId = ref(''); |
||||
|
const projectId = ref(''); |
||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!); |
||||
|
orgId.value = result; |
||||
|
const results = JSON.parse(sessionStorage.getItem('/hx-ai-intelligent/')!); |
||||
|
projectId.value = results.projectId; |
||||
|
const mainRef = ref(null); |
||||
|
const modalFormRef = ref(null); |
||||
|
const getData = (record: any) => { |
||||
|
return record.startTime |
||||
|
? record.startTime.substring(0, 10) + ' - ' + record.endTime.substring(0, 10) |
||||
|
: '未配置时间'; |
||||
|
}; |
||||
|
const nsModalFormConfig = ref({ |
||||
|
api: planToAddApi.updPlan, |
||||
|
data: {}, |
||||
|
title: '编辑', |
||||
|
schemas: [ |
||||
|
{ field: 'id', component: 'NsInput', show: false }, |
||||
|
{ field: 'orgId', component: 'NsInput', show: false }, |
||||
|
{ |
||||
|
field: 'createTime', |
||||
|
label: '执行时间', |
||||
|
component: 'NsRangePicker', |
||||
|
allowClear: true, |
||||
|
fieldMap: ['startTime', 'endTime'], |
||||
|
componentProps: { |
||||
|
valueFormat: 'YYYY-MM-DD hh:mm:ss', |
||||
|
placeholder: ['开始日期', '结束日期'], |
||||
|
}, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: '请选择执行时间', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
], |
||||
|
extraModalConfig: { |
||||
|
bodyStyle: { paddingBottom: 0 }, |
||||
|
}, |
||||
|
success: (data: any) => { |
||||
|
if (data.msg === 'success') { |
||||
|
mainRef.value?.nsTableRef.reload(); |
||||
|
} else { |
||||
|
NsMessage.error(data.msg); |
||||
|
} |
||||
|
}, |
||||
|
}); |
||||
|
//创建页面调用方法 |
||||
|
onMounted(() => {}); |
||||
|
const config = tableConfig( |
||||
|
orgId.value, |
||||
|
projectId.value, |
||||
|
mainRef, |
||||
|
nsModalFormConfig, |
||||
|
modalFormRef, |
||||
|
); |
||||
|
defineOptions({ |
||||
|
name: 'LedgerIndex', // 与页面路由name一致缓存才可生效 |
||||
|
}); |
||||
|
</script> |
||||
|
<style lang="less" scoped> |
||||
|
:deep(.ns-table-search), |
||||
|
:deep(.ns-part-tree), |
||||
|
:deep(.ns-table-main) { |
||||
|
box-shadow: @ns-content-box-shadow; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,33 @@ |
|||||
|
:root { |
||||
|
// 电梯 |
||||
|
// 正常 |
||||
|
--on: #0dffa4; |
||||
|
// 开启 |
||||
|
--open: #0dffa4; |
||||
|
// 上行 |
||||
|
--up:#0dffa4; |
||||
|
// 下行 |
||||
|
--down: #0dffa4; |
||||
|
// 关闭 |
||||
|
--off: #bfcde2; |
||||
|
// 暂停 - 维修 |
||||
|
--pause: #ffbc46; |
||||
|
// 热风 |
||||
|
--hot: #fcf770; |
||||
|
// 告警 - 急停 |
||||
|
--stop: #f36163; |
||||
|
// 故障 |
||||
|
--fault: #ff7636; |
||||
|
// 未知 |
||||
|
--unknown: #a742ff; |
||||
|
|
||||
|
// 风机 |
||||
|
// 关 |
||||
|
--shut: #bfcde2; |
||||
|
// 低速 |
||||
|
--low: #55d1ff; |
||||
|
// 中速 |
||||
|
--middle: #0090FF; |
||||
|
// 高速 |
||||
|
--high: #5757FF; |
||||
|
} |