|
@@ -14,7 +14,7 @@
|
|
|
:label-col="{span:8}">
|
|
|
<a-range-picker format="YYYY-MM-DD"
|
|
|
v-model:value="formState.days"
|
|
|
- :placeholder="['开始日期', '结束日期']" @change="onRangeChange"/>
|
|
|
+ :placeholder="['开始日期', '结束日期']"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
|
|
@@ -53,7 +53,7 @@
|
|
|
<div class="echarts-total">
|
|
|
<span style="font-weight: bold;padding-right: 10px">统计区间:</span>
|
|
|
<template v-for="(it) in getTotals()">
|
|
|
- <span style="color: #2f54eb; font-weight: bold;">{{it.name}}</span> : {{it.total!=null? parseFloat( it.total).toFixed(3):0}}{{it.unit}}
|
|
|
+ <span :style="{color: it.color, fontWeight: 'bold'}">{{it.name}}</span> : {{it.total!=null? parseFloat( it.total).toFixed(3):0}}{{it.unit}}
|
|
|
</template>
|
|
|
</div>
|
|
|
<div class="echart" :id="('chart-'+id)" :style="getChartStyle()"></div>
|
|
@@ -139,6 +139,18 @@
|
|
|
this.getTotals();
|
|
|
this.readerChart();
|
|
|
},
|
|
|
+ // onRangeChange:async function (){
|
|
|
+ // let result = await get('/factwell/getFactWellListByTime', {
|
|
|
+ // wellId : this.wellId,
|
|
|
+ // timeType : this.formState.timeType,
|
|
|
+ // startTime : this.formState.startTime,
|
|
|
+ // endTime : this.formState.endTime
|
|
|
+ // });
|
|
|
+ // this.datas = result.rows;
|
|
|
+ //
|
|
|
+ // this.getTotals();
|
|
|
+ // this.readerChart();
|
|
|
+ // },
|
|
|
initTimeLimit:function (){
|
|
|
if(this.formState.days[0]==null && this.formState.days[1]==null){
|
|
|
let timeResult = this.timeList.filter(row=>{
|
|
@@ -163,12 +175,12 @@
|
|
|
{label:'年', value:'year'}];
|
|
|
},
|
|
|
getTypeOptions:function (){
|
|
|
- return [{label:'产油量', leiLabel:'累产油量', value:'oil', unit:'(万吨)'},
|
|
|
- {label:'产水量', leiLabel:'累产水量', value:'water', unit:'(万吨)'},
|
|
|
- {label:'产液量', leiLabel:'累产液量', value:'fluid', unit:'(万吨)'},
|
|
|
- {label:'产气量', leiLabel:'累产气量', value:'gas', unit:'(立方米)'},
|
|
|
- {label:'含水率', leiLabel:'含水率', value:'watercut', unit:'(%)'},
|
|
|
- {label:'注水量', leiLabel:'累注水量', value:'vol', unit:'(万吨)'}
|
|
|
+ return [{label:'产油量', leiLabel:'累产油量', value:'oil', unit:'(万吨)', color: '#e33e48'},
|
|
|
+ {label:'产水量', leiLabel:'累产水量', value:'water', unit:'(万吨)', color: '#800080'},
|
|
|
+ {label:'产液量', leiLabel:'累产液量', value:'fluid', unit:'(万吨)', color: '#762126'},
|
|
|
+ {label:'产气量', leiLabel:'累产气量', value:'gas', unit:'(立方米)', color: '#f0a1c4'},
|
|
|
+ {label:'含水率', leiLabel:'含水率', value:'watercut', unit:'(%)', color: '#695ef5'},
|
|
|
+ {label:'注水量', leiLabel:'累注水量', value:'vol', unit:'(万吨)', color: '#2af62d'}
|
|
|
];
|
|
|
},
|
|
|
getTypes:function (){
|
|
@@ -181,6 +193,11 @@
|
|
|
return item.label==label;
|
|
|
})[0].unit;
|
|
|
},
|
|
|
+ getTypeColor:function ( label: any ){
|
|
|
+ return this.getTypeOptions().filter((item) => {
|
|
|
+ return item.label==label;
|
|
|
+ })[0].color;
|
|
|
+ },
|
|
|
getxDatas:function (){
|
|
|
//根据后台数据生成需要显示的数据集
|
|
|
let arys = (this.datas as any).map((item) => {
|
|
@@ -247,7 +264,9 @@
|
|
|
for(let i=0;i< showList.length;i++){
|
|
|
let row = { xAxisIndex : this.getGridIndex(i), yAxisIndex: this.getGridIndex(i),
|
|
|
type : this.serieType, data: yDatas[i] ,
|
|
|
- name : i<=1?showList[i].label: null};
|
|
|
+ name : i<=1?showList[i].label: null,
|
|
|
+ itemStyle:{color: this.getTypeColor(showList[i].label)}
|
|
|
+ };
|
|
|
series.push(row);
|
|
|
}
|
|
|
console.log("getSeries",series);
|
|
@@ -275,7 +294,8 @@
|
|
|
totals.push({
|
|
|
name:showList[i].leiLabel,
|
|
|
total : total,
|
|
|
- unit : this.getTypeUnit(showList[i].label)
|
|
|
+ unit : this.getTypeUnit(showList[i].label),
|
|
|
+ color: this.getTypeColor(showList[i].label)
|
|
|
});
|
|
|
}
|
|
|
console.log("getTotals",totals);
|
|
@@ -284,6 +304,7 @@
|
|
|
readerChart: function () {
|
|
|
const option = {
|
|
|
tooltip: { trigger: 'item', triggerOn:"mousemove",showContent:true },
|
|
|
+ toolbox: { feature: { saveAsImage: {} } },
|
|
|
grid: this.getGrids(),
|
|
|
xAxis: this.getxAxis(),
|
|
|
yAxis: this.getyAxis(),
|