diff --git a/src/api/ems/dzjk.js b/src/api/ems/dzjk.js index 38c208d..5f3f356 100644 --- a/src/api/ems/dzjk.js +++ b/src/api/ems/dzjk.js @@ -277,10 +277,10 @@ export function setTimeConfigList(data) { }) } // 策略曲线图 -//http://localhost:8089/strategy/curve/list?strategyId=1&siteId=021_FXX_01 +//http://localhost:8089/strategy/curve/curveList?strategyId=1&siteId=021_FXX_01 export function curveList({siteId,strategyId}) { return request({ - url: `/strategy/curve/list?siteId=${siteId}&strategyId=${strategyId}`, + url: `/strategy/curve/curveList?siteId=${siteId}&strategyId=${strategyId}`, method: 'get', }) } diff --git a/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue b/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue index faf80a0..dced071 100644 --- a/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue +++ b/src/views/ems/dzjk/clpz/xftg/TempPowerChart.vue @@ -47,6 +47,26 @@ export default { }, setOption(data) { 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({ color:['#FFBD00','#3C81FF'], legend: { @@ -63,7 +83,7 @@ export default { color:"#333333", }, xAxis: { - data: ['01:00','02:00','03:00','05:00','06:00','07:00','08:00','09:00','10:00'], + type: 'category', axisLine: { lineStyle:{ color: '#333333', @@ -78,16 +98,14 @@ export default { } } }, + dataset: { + source + }, series: [ { - name:'模板一', - data: [80,92,1,34,90,130,320,80,9,91], + name:'冲放功率', type: 'line', - },{ - name:'模板二', - data: [820,932,901,934,1290,1330,1320,820,932,901], - type: 'line', - }] + }] }) } }