diff --git a/src/api/ems/dzjk.js b/src/api/ems/dzjk.js index 711f2c1..e3b1165 100644 --- a/src/api/ems/dzjk.js +++ b/src/api/ems/dzjk.js @@ -212,3 +212,66 @@ export function configStrategy(data) { }) } +//http://localhost:8089/strategy/temp/getTempNameList?strategyId=1&siteId=021_FXX_01 +//获取策略下的所有模板列表 +export function getTempNameList({siteId,strategyId}) { + return request({ + url: `/strategy/temp/getTempNameList?siteId=${siteId}&strategyId=${strategyId}`, + method: 'get', + }) +} +//获取模板详情 +///strategy/temp/list?templateId=1 +export function getStrategyTempDetail(templateId) { + return request({ + url: `/strategy/temp/list?templateId=${templateId}`, + method: 'get', + }) +} +//新增模板 +export function addStrategyTemp(data) { + return request({ + url: `/strategy/temp`, + method: 'post', + data + }) +} +export function editStrategyTemp(data) { + return request({ + url: `/strategy/temp`, + method: 'put', + data + }) +} +//http://localhost:8089/strategy/temp/{id} +export function deleteStrategyTemp(id) { + return request({ + url: `/strategy/temp/`+id, + method: 'delete', + }) +} + +//http://localhost:8089/strategy/timeConfig/list?strategyId=1&siteId=021_FXX_01 +export function timeConfigList({siteId,strategyId}) { + return request({ + url: `/strategy/timeConfig/list?siteId=${siteId}&strategyId=${strategyId}`, + method: 'get', + }) +} +//保存时间配置 +// http://localhost:8089/strategy/timeConfig +export function setTimeConfigList(data) { + return request({ + url: `/strategy/timeConfig`, + method: 'post', + data + }) +} +// 策略曲线图 +//http://localhost:8089/strategy/curve/list?strategyId=1&siteId=021_FXX_01 +export function curveList({siteId,strategyId}) { + return request({ + url: `/strategy/curve/list?siteId=${siteId}&strategyId=${strategyId}`, + method: 'get', + }) +} diff --git a/src/router/ems.js b/src/router/ems.js index bcce906..a2c2b7f 100644 --- a/src/router/ems.js +++ b/src/router/ems.js @@ -164,14 +164,14 @@ export const dzjk=[ name: 'DzjkClpzClyx', meta: { 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'}, - } + // { + // 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'}, + // } ] } ] diff --git a/src/store/modules/ems.js b/src/store/modules/ems.js index d801777..0c84ac1 100644 --- a/src/store/modules/ems.js +++ b/src/store/modules/ems.js @@ -13,6 +13,7 @@ const ems = { deviceTypeOptions:{'TCP':'TCP','RTU':'RTU'},//设备类型 ticketStatusOptions:{0:'待处理', 1:'已处理', 2:'处理中'},//工单处理状态 strategyStatusOptions:{'0':'未启用', 1:'已运行', 2:'已暂停', 3:'禁用', 4:'删除'},//策略状态 + chargeStatusOptions:{'1':'充电','2':'待机'},//冲放状态 }, mutations: { SET_ZD_LIST(state, list) { diff --git a/src/views/ems/dzjk/clpz/clyx/index.vue b/src/views/ems/dzjk/clpz/clyx/index.vue index 9e5c373..b1bc51d 100644 --- a/src/views/ems/dzjk/clpz/clyx/index.vue +++ b/src/views/ems/dzjk/clpz/clyx/index.vue @@ -1,28 +1,31 @@ @@ -30,13 +33,17 @@ import Setting from './../Setting.vue' import ClContainer from './../ClContainer.vue' import getQuerySiteId from '@/mixins/ems/getQuerySiteId' +import Xftg from './../xftg/index.vue' import {strategyRunningList} from '@/api/ems/dzjk' export default { name:'DzjkClpzClyx', - components:{ClContainer,Setting}, + components:{ClContainer,Setting,Xftg}, mixins: [getQuerySiteId], data() { return { + showTemp:false, + updateStrategyId:'', + updateStrategyName:'', loading:false, list:[], } @@ -54,14 +61,20 @@ export default { strategyRunningList(this.siteId).then(response => { this.list =JSON.parse(JSON.stringify(response?.data || {})) }).finally(() => {this.loading=false}) + this.$nextTick(() => { + // 每次切换站点 展示策略运行 清空策略配置的数据 + this.$refs['xftgTemp'] && this.$refs['xftgTemp'].changeSiteId() + this.showTemp=false + this.updateStrategyId='' + this.updateStrategyName='' + }) }, - toDetail(id){ - id && this.$router.push({ - path:'/dzjk/clpz/xftg', - query:{ - ...this.$route.query, - id - } + toDetail(id,name){ + this.updateStrategyId=id + this.updateStrategyName = name + this.showTemp = true + this.$nextTick(() => { + this.$refs['xftgTemp'].init() }) } }, diff --git a/src/views/ems/dzjk/clpz/xftg/AddTemplate.vue b/src/views/ems/dzjk/clpz/xftg/AddTemplate.vue index 59ec149..4acb3f2 100644 --- a/src/views/ems/dzjk/clpz/xftg/AddTemplate.vue +++ b/src/views/ems/dzjk/clpz/xftg/AddTemplate.vue @@ -1,19 +1,21 @@ - diff --git a/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue b/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue index d10adb7..faf80a0 100644 --- a/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue +++ b/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue @@ -12,32 +12,41 @@ diff --git a/src/views/ems/dzjk/clpz/xftg/TimeSetting.vue b/src/views/ems/dzjk/clpz/xftg/TimeSetting.vue index 513a2c1..363500f 100644 --- a/src/views/ems/dzjk/clpz/xftg/TimeSetting.vue +++ b/src/views/ems/dzjk/clpz/xftg/TimeSetting.vue @@ -2,30 +2,112 @@ - + - diff --git a/src/views/ems/dzjk/clpz/xftg/index.vue b/src/views/ems/dzjk/clpz/xftg/index.vue index f83181c..809c6cb 100644 --- a/src/views/ems/dzjk/clpz/xftg/index.vue +++ b/src/views/ems/dzjk/clpz/xftg/index.vue @@ -1,12 +1,14 @@ @@ -24,6 +26,25 @@ export default { } }, methods:{ + init(){ + this.$nextTick(() => { + this.$refs.tempTable.init() + this.$refs.timeSetting.init() + this.$refs.tomePowerChart.init() + }) + }, + changeSiteId(){ + this.$nextTick(() => { + this.$refs.tempTable.changeSiteId() + this.$refs.timeSetting.changeSiteId() + this.$refs.tomePowerChart.changeSiteId() + }) + }, + //在编辑、删除模板后更新时间配置、echart的数据?todo + updateTimeSetting(){ + this.$refs.timeSetting.init() + this.$refs.tomePowerChart.init() + } }, mounted(){