diff --git a/src/utils/fixDict.js b/src/utils/fixDict.js index 42b6768..3b2ceb9 100644 --- a/src/utils/fixDict.js +++ b/src/utils/fixDict.js @@ -141,10 +141,13 @@ ], // 根据因子的单位来匹配,扩展'#3ba272', '#fc8452', '#9a60b4', '#ea7ccc' propsColorYs: [ - { label: '(米)', color: '#5470c6', value: 'm' }, - { label: '(米/秒)', color: '#91cc75', value: 'm/s' }, - { label: '(度)', color: '#fac858', value: '°' }, - { label: '(立方米/小时)', color: '#ee6666', value: 'm³/h' }, - { label: '(立方米)', color: '#73c0de', value: 'm³' }, + { label: '日降水量', color: '#5470c6', value: 'mm' }, + { label: '当前降水量', color: '#ea7ccc', value: 'mm' }, + { label: '降水量累计值', color: '#91cc75', value: 'mm' }, + { label: '瞬时流量、抽水流量', color: '#fac858', value: 'm³/s' }, + { label: '总出库流量、过闸总流量', color: '#ee6666', value: 'm³/s' }, + { label: '流速2', color: '#73c0de', value: 'm/s' }, + { label: '水位1', color: '#9a60b4', value: 'm/s' }, + { label: '悬浮物1', color: '#3ba272', value: 'mg/l' }, ], }; \ No newline at end of file diff --git a/src/utils/fixDict.js b/src/utils/fixDict.js index 42b6768..3b2ceb9 100644 --- a/src/utils/fixDict.js +++ b/src/utils/fixDict.js @@ -141,10 +141,13 @@ ], // 根据因子的单位来匹配,扩展'#3ba272', '#fc8452', '#9a60b4', '#ea7ccc' propsColorYs: [ - { label: '(米)', color: '#5470c6', value: 'm' }, - { label: '(米/秒)', color: '#91cc75', value: 'm/s' }, - { label: '(度)', color: '#fac858', value: '°' }, - { label: '(立方米/小时)', color: '#ee6666', value: 'm³/h' }, - { label: '(立方米)', color: '#73c0de', value: 'm³' }, + { label: '日降水量', color: '#5470c6', value: 'mm' }, + { label: '当前降水量', color: '#ea7ccc', value: 'mm' }, + { label: '降水量累计值', color: '#91cc75', value: 'mm' }, + { label: '瞬时流量、抽水流量', color: '#fac858', value: 'm³/s' }, + { label: '总出库流量、过闸总流量', color: '#ee6666', value: 'm³/s' }, + { label: '流速2', color: '#73c0de', value: 'm/s' }, + { label: '水位1', color: '#9a60b4', value: 'm/s' }, + { label: '悬浮物1', color: '#3ba272', value: 'mg/l' }, ], }; \ No newline at end of file diff --git a/src/views/dataAnalysis/syntheticData/reportAnaly.vue b/src/views/dataAnalysis/syntheticData/reportAnaly.vue index 746da72..9eb0342 100644 --- a/src/views/dataAnalysis/syntheticData/reportAnaly.vue +++ b/src/views/dataAnalysis/syntheticData/reportAnaly.vue @@ -41,17 +41,18 @@ chartOptionYs.color = []; let res = await graphicReport(params); if (res && res.code == 200) { - console.log(res.data,'res.datares.data'); - let datas = res.data; + console.log(res.data, 'res.datares.data'); + let datas=res.data + console.log(datas, 'datas.datas.datas'); + if (JSON.stringify(datas) == '{}' || datas.propertyMonitorXList.length == 0) { chartOptionYs.xAxis.data = []; echartLoading.value = false; return false; - } - else { + } else { chartOptionYs.xAxis.data = datas.propertyMonitorXList; datas.propertyMonitorList.map(item => { - if(item.ylist.length==0) return + if (item.ylist.length == 0) return; setEchartY(item); //设置多y轴 chartOptionYs.series.push({ name: item.monitorPropertyName + item.propertyUnit, @@ -66,18 +67,22 @@ chartOptionYs.grid.left = 50 * (chartOptionYs.yAxis.length - 1); //left值设置 setTimeout(() => { intChart(); - }); + }, 200); echartLoading.value = false; } } } // 设置多y轴 function setEchartY(row) { + console.log(row,'rowrow'); + propsColor.map((item, index) => { - if (row.propertyUnit == item.label) { + console.log(item,'item'); + + if (row.monitorPropertyName == item.label) { chartOptionYs.color.push(item.color); chartOptionYs.yAxis.push({ - name: item.value, //value是英文单位,label是中文单位 + name: item.label, //value是英文单位,label是中文单位 position: 'left', offset: 50 * chartOptionYs.yAxis.length, axisLine: { show: true, lineStyle: { color: item.color } },