Browse Source

Merge remote-tracking branch 'origin/master'

xiaoqiao 1 year ago
parent
commit
9d0e97e21c

+ 6 - 6
src/main/resources/mapping/cquery/FactWellCQuery.xml

@@ -10,7 +10,7 @@
                 SUM(t.water_prod_daily) water,
                 SUM(t.water_cut) watercut
         FROM (  SELECT  wd.well_id,
-                        TO_CHAR(wd.prod_date , 'YYYY-MM-dd') prod_time_str,
+                        TO_CHAR(wd.prod_date , 'YYYY-MM-DD') prod_time_str,
                         COALESCE(wd.gas_prod_daily, 0)      gas_prod_daily,
                         COALESCE(wd.oil_prod_daily, 0)      oil_prod_daily,
                         COALESCE(wd.fluid_prod_daily, 0)      fluid_prod_daily,
@@ -35,15 +35,15 @@
             SUM(t.fluid_prod_mon) fluid,
             0 watercut
         FROM (  SELECT wm.well_id,
-                    to_char(to_date(CONCAT(wm.prod_date,'-01'), '%Y-%m-%d'), 'YYYY年MM月') prod_time_str,
+                    to_char(to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD'), 'YYYY年MM月') prod_time_str,
                     COALESCE(wm.gas_prod_mon, 0) gas_prod_mon,
                     COALESCE(wm.oil_prod_mon, 0) oil_prod_mon,
                     COALESCE(wm.water_prod_mon, 0) water_prod_mon,
                     COALESCE(wm.fluid_prod_mon, 0) fluid_prod_mon
                 FROM by_dwr.fact_dwr_pc_pro_well_vol_m wm
                 WHERE wm.prod_date is not null
-                    and to_date(CONCAT(wm.prod_date,'-01'), '%Y-%m-%d')  <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
-                    and to_date(CONCAT(wm.prod_date,'-01'), '%Y-%m-%d')  <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
+                    and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD')  <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
+                    and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD')  <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
         <if test="wellId!='' and wellId!=null">
             and wm.well_id=#{wellId}
         </if>
@@ -67,8 +67,8 @@
                     COALESCE(wm.fluid_prod_mon, 0) fluid_prod_mon
                 FROM by_dwr.fact_dwr_pc_pro_well_vol_m wm
                 WHERE wm.prod_date is not null
-                and to_date(CONCAT(wm.prod_date,'-01'), '%Y-%m-%d')  <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
-                and to_date(CONCAT(wm.prod_date,'-01'), '%Y-%m-%d')  <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
+                and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD')  <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
+                and to_date(CONCAT(wm.prod_date,'-01'), 'YYYY-MM-DD')  <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
         <if test="wellId!='' and wellId!=null">
             and wm.well_id=#{wellId}
         </if>

+ 23 - 14
vue/src/components/basic/chart/chart-cell.vue

@@ -3,9 +3,9 @@
              placement="left"
              @visibleChange="onOpenChange">
     <template #content>
-      <div class="echart" :id="('popover-'+id)" :style="chartStylePopover"></div>
+      <div class="echart" :id="('popover-'+getChartId())" :style="chartStylePopover"></div>
     </template>
-    <div class="echart" :id="('chart-'+id)" :style="chartStyle"></div>
+    <div class="echart" :id="('chart-'+getChartId())" :style="chartStyle"></div>
   </a-popover>
 </template>
 
@@ -17,6 +17,7 @@
   export  default defineComponent ({
     props:{
       wellId: null as any,
+      lineColor : null as any,
       timeType : null as any, //日 day 月 month 年 year
       dataType : null as any//gas产气量 oil产油量
     },
@@ -30,7 +31,8 @@
         chart : null as any,
         serieType : 'line',
         hovered : false,
-        datas : null
+        datas : null,
+        id : Date.now()
       }
     },
     setup(props, context){
@@ -45,15 +47,18 @@
       const wellId = computed(() => {
         return props.wellId ? props.wellId : null
       });
-      const id = computed(() => {
-        return wellId.value + "-" + dataType.value;
+      //const id = computed(() => {
+      //  return wellId.value + "-" + dataType.value;
+      //});
+      const lineColor = computed(()=>{
+        return props.lineColor? props.lineColor : '#0058D0';
       });
 
       return{
         timeType,
         dataType,
         wellId,
-        id
+        lineColor
       }
     },
     mounted(){
@@ -61,10 +66,10 @@
       this.readerCell();
 
       watch(
-        () => this.id,
+        () => this.wellId,
         (n, o) => {
           if(n!=o) {
-            console.log("wellId change",this.id, n, o);
+            console.log("wellId change",this.getChartId(), n, o);
             this.chartDispose();
             this.readerCell();
           }
@@ -72,6 +77,9 @@
       );
     },
     methods:{
+      getChartId:function (){
+        return this.id + "-" + this.wellId + "-" +this.dataType;
+      },
       getDatas:async function(){
         //数据查询逻辑,如果不查询,改此方法返回数据即可
         if(this.datas==null){
@@ -93,7 +101,8 @@
       },
       getSeries:async function (showSymbol){
         let dataArys = await this.getDatas();
-        let series = [{type: this.serieType, data:[] as any, showSymbol:showSymbol}];
+        let series = [{type: this.serieType, data:[] as any, showSymbol:showSymbol,
+          itemStyle : {color:this.lineColor}, lineStyle : {width:1}}];
         //数据组装,这里根据业务组装y轴数据
         (dataArys! as any).forEach(row=>{ series[0].data.push(row[this.dataType]) });
         console.log("getSeries", series);
@@ -109,7 +118,7 @@
         console.log("readerCell-"+this.serieType,option);
 
         if(this.cell==null)
-          this.cell = markRaw(echarts.init(document.getElementById('chart-'+this.id) as HTMLElement));
+          this.cell = markRaw(echarts.init(document.getElementById('chart-'+this.getChartId()) as HTMLElement));
         if(this.cell!=null) {
           this.cell.setOption(option);
           this.cell.resize();
@@ -119,17 +128,17 @@
         let xAxis = await this.getxAxis(true);
         xAxis['nameRotate'] = 0;
         const option = {
-          title: { left: 'center', text: '累产量趋势图' },
+          title: { text: '累产量趋势图' },
           tooltip: { trigger: 'item', triggerOn:"mousemove",showContent:true },
-          grid: { top:'15%', left: '8%', right: '3%', bottom: '6%', containLabel: true },
+          grid: { top:'15%', left: '3%', right: '3%', bottom: '6%', containLabel: true },
           xAxis: xAxis,
-          yAxis: { name:'累产量', nameGap: 50, nameLocation:'center', type: 'value'},
+          yAxis: { type: 'value'},
           series: await this.getSeries(true)
         };
         console.log("readerChart-"+this.serieType,option);
 
         if(this.chart==null)
-          this.chart = markRaw(echarts.init(document.getElementById('popover-'+this.id) as HTMLElement));
+          this.chart = markRaw(echarts.init(document.getElementById('popover-'+this.getChartId()) as HTMLElement));
         if(this.chart!=null) {
           this.chart.setOption(option);
           this.chart.resize();

+ 1 - 1
vue/src/views/position/test.vue

@@ -35,7 +35,7 @@
               <!--列表单元格中显示曲线图,数据需要根据业务库整理-->
               <!--timeType day month year-->
               <!--dataType gas oil-->
-              <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="('吉45-144(A2)')"></ChartCell>
+              <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="('吉45-144(A2)')" :lineColor="('#FF0000')"></ChartCell>
             </div>
           </template>
         </template>

+ 1 - 1
vue/src/views/wellinfo/index.vue

@@ -194,7 +194,7 @@
                     <td>{{ item.oil_prod_mon }}t</td>
                     <td colspan="2" rowspan="2">
                       <div style="height:25px">
-                        <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="item.well_id"></ChartCell>
+                        <ChartCell :timeType="('month')" :dataType="('oil')" :wellId="item.well_id" :lineColor="('#E63038')"></ChartCell>
                       </div>
                     </td>
                   </tr>