da-xian 1 månad sedan
förälder
incheckning
ad21794b83
3 ändrade filer med 38 tillägg och 15 borttagningar
  1. 1 0
      .gitignore
  2. 31 10
      vue/src/components/basic/chart/chart-prod-dynamics.vue
  3. 6 5
      vue/src/views/esdomain/result.vue

+ 1 - 0
.gitignore

@@ -37,3 +37,4 @@ target/
 /src/main/resources/META-INF/MANIFEST.MF
 
 
+/WEB-INF/web.xml

+ 31 - 10
vue/src/components/basic/chart/chart-prod-dynamics.vue

@@ -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>&nbsp;:&nbsp;{{it.total!=null? parseFloat( it.total).toFixed(3):0}}{{it.unit}} &nbsp;&nbsp;&nbsp;&nbsp;
+        <span :style="{color: it.color, fontWeight: 'bold'}">{{it.name}}</span>&nbsp;:&nbsp;{{it.total!=null? parseFloat( it.total).toFixed(3):0}}{{it.unit}} &nbsp;&nbsp;&nbsp;&nbsp;
       </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(),

+ 6 - 5
vue/src/views/esdomain/result.vue

@@ -75,8 +75,8 @@
                            :data="it.dws_dm_analytical_assays_new" v-show="it.showMore" :key="it.key"></component>
                 <component is="docView" :indexSetting="it.indexSetting" :data="it.fact_dwr_well_data_index"
                            v-show="it.showMore" :key="it.key"></component>
-                <component is="chatView" :indexSetting="it.indexSetting" :well_id="it.well_id"
-                           :data="it.dws_dm_analytical_assays_new" v-show="it.showMore" :key="it.key"></component>
+                <component is="chartProdDynmics" :indexSetting="it.indexSetting" :wellId="it.well_id"
+                           v-if="it.showMore" :key="it.key"></component>
 
                 <a-divider orientation="center" @click="it.showMore=!it.showMore">
                   <template v-if="!it.showMore">
@@ -142,7 +142,7 @@ import {useRoute, useRouter} from "vue-router";
 import type {SelectProps, FormInstance} from "ant-design-vue";
 import tableView from '@/components/basic/es-result/table-view.vue';
 import listView from '@/components/basic/es-result/list-view.vue';
-import chatView from '@/components/basic/es-result/chat-view.vue';
+import chartProdDynmics from '@/components/basic/chart/chart-prod-dynamics.vue';
 import docView from '@/components/basic/es-result/doc-view.vue';
 import cycleView from '@/components/basic/es-result/cycle-view.vue';
 import {get, postData} from "@/api/common";
@@ -154,7 +154,7 @@ import QueryHistoryComplete from '@/components/basic/querylog/history-complete.v
 
 export default defineComponent({
   name: 'esdomainResult',
-  components: {tableView, listView, chatView, docView, cycleView, queryCriteria, QueryHistoryComplete},
+  components: {tableView, listView, chartProdDynmics, docView, cycleView, queryCriteria, QueryHistoryComplete},
   setup() {
 
     const route = useRoute();
@@ -171,7 +171,7 @@ export default defineComponent({
     const formState = reactive({
       page: 1, rows: 10, subjectName: '', tabName: '', tabCode: null, total: 0
     });
-    const displayType = ['cycleView', 'tableView', 'listView', 'chatView', 'docView'];
+    const displayType = ['cycleView', 'tableView', 'listView', 'chartProdDynmics', 'docView'];
     const queryObject = ref();
     const pageState = reactive({
       showMoreQuery: false,
@@ -208,6 +208,7 @@ export default defineComponent({
       indexList.value = result;
     }
     const showWell = (well_id, well_common_name) => {
+      debugger;
       tabsViewStore.addTabByPath('/wellinfo/detail', {id: well_id});
       storeWell(well_common_name);
     }