Browse Source

井筒优化

xiaoqiao 1 year ago
parent
commit
173cc1e45a

+ 11 - 11
src/main/resources/mapping/WellBasicInformationMapper.xml

@@ -115,7 +115,7 @@
       distinct
     </if>
     <include refid="Base_Column_List" />
-    from well_basic_information
+    from BY_DIM.well_basic_information
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -126,21 +126,21 @@
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
-    from well_basic_information
+    from BY_DIM.well_basic_information
     where well_id = #{well_id,jdbcType=VARCHAR}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    delete from well_basic_information
+    delete from BY_DIM.well_basic_information
     where well_id = #{well_id,jdbcType=VARCHAR}
   </delete>
   <delete id="deleteByExample" parameterType="com.bowintek.practice.model.WellBasicInformationExample">
-    delete from well_basic_information
+    delete from BY_DIM.well_basic_information
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
   <insert id="insert" parameterType="com.bowintek.practice.model.WellBasicInformation">
-    insert into well_basic_information (well_id, well_common_name, well_purpose, 
+    insert into BY_DIM.well_basic_information (well_id, well_common_name, well_purpose, 
       well_type, spud_date, end_drilling_date, 
       budgeted_md, completion_formation, completion_method, 
       org_name_a1, org_name_a2, well_legal_name, 
@@ -170,7 +170,7 @@
       )
   </insert>
   <insert id="insertSelective" parameterType="com.bowintek.practice.model.WellBasicInformation">
-    insert into well_basic_information
+    insert into BY_DIM.well_basic_information
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="well_id != null">
         well_id,
@@ -411,13 +411,13 @@
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.bowintek.practice.model.WellBasicInformationExample" resultType="java.lang.Long">
-    select count(*) from well_basic_information
+    select count(*) from BY_DIM.well_basic_information
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </select>
   <update id="updateByExampleSelective" parameterType="map">
-    update well_basic_information
+    update BY_DIM.well_basic_information
     <set>
       <if test="row.well_id != null">
         well_id = #{row.well_id,jdbcType=VARCHAR},
@@ -542,7 +542,7 @@
     </if>
   </update>
   <update id="updateByExample" parameterType="map">
-    update well_basic_information
+    update BY_DIM.well_basic_information
     set well_id = #{row.well_id,jdbcType=VARCHAR},
       well_common_name = #{row.well_common_name,jdbcType=VARCHAR},
       well_purpose = #{row.well_purpose,jdbcType=VARCHAR},
@@ -587,7 +587,7 @@
     </if>
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.practice.model.WellBasicInformation">
-    update well_basic_information
+    update BY_DIM.well_basic_information
     <set>
       <if test="well_common_name != null">
         well_common_name = #{well_common_name,jdbcType=VARCHAR},
@@ -707,7 +707,7 @@
     where well_id = #{well_id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.bowintek.practice.model.WellBasicInformation">
-    update well_basic_information
+    update BY_DIM.well_basic_information
     set well_common_name = #{well_common_name,jdbcType=VARCHAR},
       well_purpose = #{well_purpose,jdbcType=VARCHAR},
       well_type = #{well_type,jdbcType=VARCHAR},

+ 4 - 4
src/main/resources/mapping/WlUserExpendSettingMapper.xml

@@ -83,7 +83,7 @@
     </if>
   </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select 
+    select
     <include refid="Base_Column_List" />
     from wl_user_expend_setting
     where expendID = #{expendID,jdbcType=VARCHAR}
@@ -99,9 +99,9 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.bowintek.practice.model.WlUserExpendSetting">
-    insert into wl_user_expend_setting (expendID, userID, well_id, 
+    insert into wl_user_expend_setting (expendID, userID, well_id,
       setting_json)
-    values (#{expendID,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{well_id,jdbcType=VARCHAR}, 
+    values (#{expendID,jdbcType=VARCHAR}, #{userID,jdbcType=VARCHAR}, #{well_id,jdbcType=VARCHAR},
       #{setting_json,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.bowintek.practice.model.WlUserExpendSetting">
@@ -193,4 +193,4 @@
       setting_json = #{setting_json,jdbcType=VARCHAR}
     where expendID = #{expendID,jdbcType=VARCHAR}
   </update>
-</mapper>
+</mapper>

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

@@ -16,7 +16,7 @@
                         coalesce(wd.fluid_prod_daily, 0)      fluid_prod_daily,
                         coalesce(wd.water_prod_daily, 0)      water_prod_daily,
                         coalesce(wd.water_cut, 0)      water_cut
-                FROM fact_dwr_pc_pro_well_vol_d wd
+                FROM BY_DIM.fact_dwr_pc_pro_well_vol_d wd
                 WHERE wd.prod_time <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
                     and wd.prod_time <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
         <if test="wellId!='' and wellId!=null">
@@ -40,7 +40,7 @@
                     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 fact_dwr_pc_pro_well_vol_m wm
+                FROM BY_DIM.fact_dwr_pc_pro_well_vol_m wm
                 WHERE wm.prod_time <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
                     and wm.prod_time <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
         <if test="wellId!='' and wellId!=null">
@@ -64,7 +64,7 @@
                     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 fact_dwr_pc_pro_well_vol_m wm
+                FROM BY_DIM.fact_dwr_pc_pro_well_vol_m wm
                 WHERE wm.prod_time <![CDATA[ >= ]]> to_date(#{startDay},'YYYY-MM-DD')
                 and wm.prod_time <![CDATA[ <= ]]> to_date(#{endDay},'YYYY-MM-DD')
         <if test="wellId!='' and wellId!=null">

+ 38 - 38
src/main/resources/mapping/cquery/WellInfoCQuery.xml

@@ -25,21 +25,21 @@
                str.azimuth_angle,
                str.well_coordinates_x,
                str.well_coordinates_y
-        from public.well_basic_information well
-                 left join public.fact_dwr_well_structure str on well.well_id = str.well_id
+        from BY_DIM.well_basic_information well
+                 left join BY_DIM.fact_dwr_well_structure str on well.well_id = str.well_id
                  left join (
             select daily.*
-            from public.fact_dwr_pc_pro_well_vol_d daily
+            from BY_DIM.fact_dwr_pc_pro_well_vol_d daily
                      inner join(
-                select well_id, max(prod_time) prod_time from public.fact_dwr_pc_pro_well_vol_d group by well_id
+                select well_id, max(prod_time) prod_time from BY_DIM.fact_dwr_pc_pro_well_vol_d group by well_id
             ) maxdaily on daily.well_id = maxdaily.well_id and daily.prod_time = maxdaily.prod_time
         ) fact_daily on well.well_id = fact_daily.well_id
                  left join (
             select intr.*
-            from public.fact_dwr_well_history_introduction intr
+            from BY_DIM.fact_dwr_well_history_introduction intr
                      inner join(
                 select well_id, max(start_prod_date) start_prod_date
-                from public.fact_dwr_well_history_introduction
+                from BY_DIM.fact_dwr_well_history_introduction
                 group by well_id
             ) maxintr on intr.well_id = maxintr.well_id and intr.start_prod_date = maxintr.start_prod_date
         ) fact_intr on well.well_id = fact_intr.well_id
@@ -50,17 +50,17 @@
         select
         well.*,fact_daily.oil_prod_begin_date,fact_daily.oil_prod_recent_date,fact_daily.current_state,fact_daily.water_cut,
         fact_mon.oil_prod_mon,fact_mon.gas_prod_mon,fact_mon.gas_prod_year,fact_mon.oil_prod_year
-        from public.well_basic_information well
+        from BY_DIM.well_basic_information well
         left join (
-        select daily.* from public.fact_dwr_pc_pro_well_vol_d daily
+        select daily.* from BY_DIM.fact_dwr_pc_pro_well_vol_d daily
         inner join(
-        select well_id, max(prod_time) prod_time from public.fact_dwr_pc_pro_well_vol_d group by well_id
+        select well_id, max(prod_time) prod_time from BY_DIM.fact_dwr_pc_pro_well_vol_d group by well_id
         ) maxdaily on daily.well_id=maxdaily.well_id and daily.prod_time=maxdaily.prod_time
         )fact_daily on well.well_id= fact_daily.well_id
         left join (
-        select mon.* from public.fact_dwr_pc_pro_well_vol_m mon
+        select mon.* from BY_DIM.fact_dwr_pc_pro_well_vol_m mon
         inner join(
-        select well_id, max(prod_time) prod_time from public.fact_dwr_pc_pro_well_vol_m group by well_id
+        select well_id, max(prod_time) prod_time from BY_DIM.fact_dwr_pc_pro_well_vol_m group by well_id
         ) maxmon on mon.well_id=maxmon.well_id and mon.prod_time=maxmon.prod_time
         )fact_mon on well.well_id= fact_mon.well_id
         where 1=1
@@ -114,8 +114,8 @@
             well.geo_description,
             structure.well_coordinates_x x,
             structure.well_coordinates_y y
-        FROM well_basic_information well
-        inner join fact_dwr_well_structure structure on well.well_id = structure.well_id
+        FROM BY_DIM.well_basic_information well
+        inner join BY_DIM.fact_dwr_well_structure structure on well.well_id = structure.well_id
         where 1=1
         <if test="well_common_name!='' and well_common_name!=null">
             and well.well_common_name like Concat('%',#{well_common_name},'%')
@@ -148,29 +148,29 @@
 
     <select id="selectBoreholeInterList" resultType="java.util.HashMap">
         select *
-        from public.fact_dwr_wl_ach_borehole_inter bi
+        from BY_DIM.fact_dwr_wl_ach_borehole_inter bi
         where bi.well_id = #{well_id}
     </select>
     <select id="selectTestHistoryList" resultType="java.util.HashMap">
         select *
-        from public.dws_dm_test_history th
+        from BY_DIM.dws_dm_test_history th
         where th.well_id = #{well_id}
     </select>
     <select id="selectTestHistorySummary" resultType="java.util.HashMap">
         select testing_name, count(1) as testing_num
-        from public.dws_dm_test_history th
+        from BY_DIM.dws_dm_test_history th
         where th.well_id = #{well_id}
         group by th.testing_name
     </select>
     <select id="getLastTestHistory" resultType="java.util.HashMap">
         select *
-        from public.dws_dm_test_history th
+        from BY_DIM.dws_dm_test_history th
         where th.well_id = #{well_id}
         order by th.testing_date desc limit 1
     </select>
     <select id="selectAnalyticalAssaysList" resultType="java.util.HashMap">
         select *
-        from public.dws_dm_analytical_assays aa
+        from BY_DIM.dws_dm_analytical_assays aa
         where aa.well_id = #{well_id}
     </select>
     <select id="selectAnalyticalAssaysSummary" resultType="java.util.HashMap">
@@ -183,35 +183,35 @@
                SUM(CASE WHEN item_code = '录井综合解释' THEN 1 ELSE 0 END)      AS 录井综合解释,
                SUM(CASE WHEN item_code = '气测解释' THEN 1 ELSE 0 END)        AS 气测解释,
                SUM(CASE WHEN item_code = '定量荧光解释' THEN 1 ELSE 0 END)      AS 定量荧光解释
-        FROM public.dws_dm_analytical_assays
+        FROM BY_DIM.dws_dm_analytical_assays
         where well_id = #{well_id}
         GROUP BY item_code;
     </select>
     <select id="selectHistoryAssignmentList" resultType="java.util.HashMap">
         select *
-        from public.fact_dwr_brief_history_assignment ha
+        from BY_DIM.fact_dwr_brief_history_assignment ha
         where ha.well_id = #{well_id}
     </select>
     <select id="selectHistoryAssignmentSummary" resultType="java.util.HashMap">
         select test_processes_name, count(1) as testing_num
-        from public.fact_dwr_brief_history_assignment bha
+        from BY_DIM.fact_dwr_brief_history_assignment bha
         where bha.well_id = #{well_id}
         group by bha.test_processes_name
     </select>
     <select id="getLastHistoryAssignment" resultType="java.util.HashMap">
         select *
-        from public.fact_dwr_brief_history_assignment bha
+        from BY_DIM.fact_dwr_brief_history_assignment bha
         where bha.well_id = #{well_id}
         order by bha.start_time desc limit 1
     </select>
     <select id="selectDataIndexList" resultType="java.util.HashMap">
         select *
-        from public.fact_dwr_well_data_index di
+        from BY_DIM.fact_dwr_well_data_index di
         where di.well_id = #{well_id}
     </select>
     <select id="selectDimProjectTypeList" resultType="java.util.HashMap">
         select name as title,value_id as key
-        from public.dim_project_type
+        from BY_DIM.dim_project_type
         where is_effect = 1
     </select>
     <select id="selectConstructUnitList" resultType="java.util.HashMap">
@@ -221,12 +221,12 @@
                desc3.name as project_name_3,
                desc4.name as project_name_4,
                desc5.name as project_name_5
-        from public.dim_construct_unit_level lv
-                 left join dim_construct_unit_desc desc1 on lv.project_id_1 = desc1.id
-                 left join dim_construct_unit_desc desc2 on lv.project_id_2 = desc2.id
-                 left join dim_construct_unit_desc desc3 on lv.project_id_3 = desc3.id
-                 left join dim_construct_unit_desc desc4 on lv.project_id_4 = desc4.id
-                 left join dim_construct_unit_desc desc5 on lv.project_id_5 = desc5.id
+        from BY_DIM.dim_construct_unit_level lv
+                 left join BY_DIM.dim_construct_unit_desc desc1 on lv.project_id_1 = desc1.id
+                 left join BY_DIM.dim_construct_unit_desc desc2 on lv.project_id_2 = desc2.id
+                 left join BY_DIM.dim_construct_unit_desc desc3 on lv.project_id_3 = desc3.id
+                 left join BY_DIM.dim_construct_unit_desc desc4 on lv.project_id_4 = desc4.id
+                 left join BY_DIM.dim_construct_unit_desc desc5 on lv.project_id_5 = desc5.id
         where lv.is_effect = 1
     </select>
     <select id="selectOilgasUnitList" resultType="java.util.HashMap">
@@ -237,14 +237,14 @@
                desc5.name as project_name_5,
                desc6.name as project_name_6,
                desc7.name as project_name_7
-        from public.dim_oilgas_unit_level lv
-                 left join public.dim_oilgas_unit_desc desc1 on lv.project_id_1 = desc1.id
-                 left join public.dim_oilgas_unit_desc desc2 on lv.project_id_2 = desc2.id
-                 left join public.dim_oilgas_unit_desc desc3 on lv.project_id_3 = desc3.id
-                 left join public.dim_oilgas_unit_desc desc4 on lv.project_id_4 = desc4.id
-                 left join public.dim_oilgas_unit_desc desc5 on lv.project_id_5 = desc5.id
-                 left join public.dim_oilgas_unit_desc desc6 on lv.project_id_6 = desc6.id
-                 left join public.dim_oilgas_unit_desc desc7 on lv.project_id_7 = desc7.id
+        from BY_DIM.dim_oilgas_unit_level lv
+                 left join BY_DIM.dim_oilgas_unit_desc desc1 on lv.project_id_1 = desc1.id
+                 left join BY_DIM.dim_oilgas_unit_desc desc2 on lv.project_id_2 = desc2.id
+                 left join BY_DIM.dim_oilgas_unit_desc desc3 on lv.project_id_3 = desc3.id
+                 left join BY_DIM.dim_oilgas_unit_desc desc4 on lv.project_id_4 = desc4.id
+                 left join BY_DIM.dim_oilgas_unit_desc desc5 on lv.project_id_5 = desc5.id
+                 left join BY_DIM.dim_oilgas_unit_desc desc6 on lv.project_id_6 = desc6.id
+                 left join BY_DIM.dim_oilgas_unit_desc desc7 on lv.project_id_7 = desc7.id
         where lv.is_effect = 1
     </select>
 </mapper>

BIN
target/classes/com/bowintek/practice/services/impl/PositionServiceImpl.class


+ 1 - 1
vue/src/components/basic/chart/chart-map.vue

@@ -48,7 +48,7 @@
     },
     setup(props, context){
       console.log("ChartMap setup" , props, context);
-      let iframeSrc = ref<string>("http://192.168.0.68:8077/a4gis/index.html");
+      let iframeSrc = ref<string>("http://10.73.178.206:8077/a4gis/index.html");
       let iframeRef = ref<any>();   // 和iframe标签的ref绑定
 
       const wellId = computed(() => {

+ 38 - 13
vue/src/views/wellinfo/detail.vue

@@ -1,7 +1,10 @@
 <template>
 
   <div>
-    <a-card title="井史简介" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardSummary.expand=!cardSettings.cardSummary.expand">井史简介</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardSummary.expand" @click="cardSettings.cardSummary.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -20,8 +23,6 @@
           <span>{{ dataModel.recent_testing_date }}</span>进行最近一次<span>{{ dataModel.recent_testing_name }}</span>测试,最近一次产油时间<span>{{
               dataModel.recent_prod_date
             }}</span>,油嘴<span>{{ dataModel.oil_nozzle }}</span>mm,
-        </p>
-        <p>
           油压<span>{{ dataModel.tubing_pres }}</span>MPa,套压<span>{{
             dataModel.casing_pres
           }}</span>MPa,日产液量<span>{{ dataModel.fluid_prod_daily }}</span>t/d,日产油量<span>{{
@@ -32,7 +33,10 @@
         </p>
       </div>
     </a-card>
-    <a-card title="生产动态" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card  :bordered="false"  :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardChat.expand=!cardSettings.cardChat.expand">生产动态</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardChat.expand" @click="cardSettings.cardChat.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -43,7 +47,10 @@
         <ChartProdDynmics :wellId="dataModel.well_id"></ChartProdDynmics>
       </div>
     </a-card>
-    <a-card title="基本信息" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardBaseInfo.expand=!cardSettings.cardBaseInfo.expand">基本信息</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardBaseInfo.expand" @click="cardSettings.cardBaseInfo.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -114,7 +121,10 @@
         </a-descriptions>
       </div>
     </a-card>
-    <a-card title="业务解释" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardExplain.expand=!cardSettings.cardExplain.expand">业务解释</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardExplain.expand" @click="cardSettings.cardExplain.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -128,7 +138,10 @@
         </a-table>
       </div>
     </a-card>
-    <a-card title="相关文档" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardFile.expand=!cardSettings.cardFile.expand">相关文档</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardFile.expand" @click="cardSettings.cardFile.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -147,7 +160,10 @@
         </a-table>
       </div>
     </a-card>
-    <a-card title="测试历史" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card  :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardTest.expand=!cardSettings.cardTest.expand">测试历史</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardTest.expand" @click="cardSettings.cardTest.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -169,7 +185,10 @@
         </a-table>
       </div>
     </a-card>
-    <a-card title="分析化验" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardAnalysis.expand=!cardSettings.cardAnalysis.expand">分析化验</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardAnalysis.expand" @click="cardSettings.cardAnalysis.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -189,7 +208,10 @@
         </a-table>
       </div>
     </a-card>
-    <a-card title="作业简史(业务过程)" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardWork.expand=!cardSettings.cardWork.expand">作业简史(业务过程)</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardWork.expand" @click="cardSettings.cardWork.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -213,7 +235,10 @@
         </a-table>
       </div>
     </a-card>
-    <a-card title="GIS地图" :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+    <a-card :bordered="false" :headStyle="cardSettings.cardHeadStyle" class="card-detail">
+      <template #title>
+        <div slot="title" style="width:100%" @click="cardSettings.cardGIS.expand=!cardSettings.cardGIS.expand">GIS地图</div>
+      </template>
       <template #extra>
         <UpSquareOutlined v-if="cardSettings.cardGIS.expand" @click="cardSettings.cardGIS.expand=false"
                           :style="cardSettings.buttonStyle"/>
@@ -291,12 +316,12 @@ export default defineComponent({
         wellData.boreholeInterList = data.boreholeInterList;
         wellData.testHistoryList = data.testHistoryList;
         wellData.testHistorySummary = data.testHistorySummary;
-        wellData.lastTestHistory = data.lastTestHistory;
+        wellData.lastTestHistory = data.lastTestHistory??{};
         wellData.analyticalAssaysList = data.analyticalAssaysList;
         wellData.analyticalAssaysSummary = data.analyticalAssaysSummary;
         wellData.historyAssignmentList = data.historyAssignmentList;
         wellData.historyAssignmentSummary = data.historyAssignmentSummary;
-        wellData.lastHistoryAssignment = data.lastHistoryAssignment;
+        wellData.lastHistoryAssignment = data.lastHistoryAssignment??{};
         wellData.dataIndexList = data.dataIndexList;
         wellData.historyAssignmentCount = wellData.historyAssignmentSummary.reduce((total, it: any) => total + it.testing_num, 0);
       })

+ 114 - 35
vue/src/views/wellinfo/index.vue

@@ -5,7 +5,7 @@
         <a-tabs v-model:activeKey="activeTab" @change="tabChange" style="width:97%;">
           <a-tab-pane key="1" tab="组织架构目录">
           </a-tab-pane>
-          <a-tab-pane key="2" tab="地单元目录" forceRender="true">
+          <a-tab-pane key="2" tab="地单元目录" forceRender="true">
           </a-tab-pane>
         </a-tabs>
         <DoubleLeftOutlined @click="showTree=false"/>
@@ -13,19 +13,20 @@
       <div style="margin-top: -15px">
         <a-input-search
           v-model:value="subjectTrees.searchStr"
-          placeholder="查找目录..."
+          placeholder="查找目录..." allow-clear
           @search="searchTree"
         />
       </div>
       <div class="query-index-tree-box">
         <a-tree
-          :show-line="true"
+          :show-line="true" blockNode="true"
           :tree-data="subjectTrees.data"
           v-model:expandedKeys="subjectTrees.expandedKeys"
           v-model:selectedKeys="subjectTrees.selectedKeys"
           :replace-fields="replaceFields"
           :autoExpandParent="subjectTrees.autoExpandParent"
           @expand="treeOnExpand" @select="treeOnSelect">
+          <template #switcherIcon="{ switcherCls }"><caret-down-outlined style="font-size:20px;" :class="switcherCls" /></template>
           <template #title="{ label,value,children }">
                     <span v-if="label!=null&&label.indexOf(subjectTrees.searchStr) > -1">
                       {{ label.substr(0, label.indexOf(subjectTrees.searchStr)) }}
@@ -45,10 +46,10 @@
         <a-form ref="formRef" name="fromQuery"
                 class="ant-advanced-search-form"
                 :label-col="labelCol"
-                :model="formState.temp">
+                :model="formState">
           <a-row :gutter="24" class="query-index-row">
             <a-col :span="6">
-              <a-form-item name="tempName" label="井号:">
+              <a-form-item name="well_id" label="井号:">
                 <a-input v-model:value="formState.well_id"/>
               </a-form-item>
             </a-col>
@@ -58,7 +59,7 @@
               </a-form-item>
             </a-col>
             <a-col :span="6">
-              <a-form-item name="tempName" label="井型:">
+              <a-form-item name="well_type" label="井型:">
                 <a-select ref="select" v-model:value="formState.well_type"
                           :options="wellTypeList" :field-names="{label:'name',value:'value'}" :allow-clear="true">
                 </a-select>
@@ -68,41 +69,53 @@
               <MenuOutlined @click="showQuery=true" v-if="!showQuery"/>
               <LineOutlined @click="showQuery=false" v-else/>
               <a-button type="primary" html-type="submit" @click="onQuery" style="margin-left: 10px;">查询</a-button>
-              <a-button html-type="submit" @click="() => {formRef.resetFields();onQuery()}" style="margin-left: 10px;">
+              <a-button html-type="submit"
+                        @click="() => {resetFields();formState.ref_date=new Date(); onQuery()}"
+                        style="margin-left: 10px;">
                 重置
               </a-button>
             </a-col>
           </a-row>
           <a-row :gutter="24" class="query-index-row" v-if="showQuery">
             <a-col :span="6">
-              <a-form-item name="tempName" label="开钻日期:">
-                <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
+              <a-form-item name="spud_date_begin" label="开钻日期:">
+                <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
                                 @change="(d)=>{onRangeChange(d,'spud_date_begin','spud_date_end')}"/>
               </a-form-item>
             </a-col>
             <a-col :span="6">
-              <a-form-item name="well_common_name" label="完井日期:">
-                <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
+              <a-form-item name="completion_date_begin" label="完井日期:">
+                <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
                                 @change="(d)=>{onRangeChange(d,'completion_date_begin','completion_date_end')}"/>
               </a-form-item>
             </a-col>
             <a-col :span="6">
-              <a-form-item name="tempName" label="开始采油日期:">
-                <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
+              <a-form-item name="oil_prod_begin_date_begin" label="开始采油日期:">
+                <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
                                 @change="(d)=>{onRangeChange(d,'oil_prod_begin_date_begin','oil_prod_begin_date_end')}"/>
               </a-form-item>
             </a-col>
           </a-row>
           <a-row :gutter="24" class="query-index-row" v-if="showQuery">
             <a-col :span="6">
-              <a-form-item name="tempName" label="最近采油日期:">
-                <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
+              <a-form-item label="最近采油日期:">
+                <a-range-picker :key="formState.ref_date" format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
                                 @change="(d)=>{onRangeChange(d,'oil_prod_recent_date_begin','oil_prod_recent_date_end')}"/>
               </a-form-item>
             </a-col>
           </a-row>
           <a-row class="edit-operation">
             <a-col :span="24" style="text-align: right">
+              <a-checkbox-group v-model:value="showColumnType">
+                <a-row>
+                  <a-col :span="12">
+                    <a-checkbox value="oil">显示产油</a-checkbox>
+                  </a-col>
+                  <a-col :span="12">
+                    <a-checkbox value="gas">显示产气</a-checkbox>
+                  </a-col>
+                </a-row>
+              </a-checkbox-group>
               <a-radio-group v-model:value="viewModel" style="text-align: left">
                 <a-radio-button value="list">
                   <UnorderedListOutlined/>
@@ -119,7 +132,7 @@
       </div>
       <a-spin :spinning="loading">
         <div class="query-index-table" v-if="viewModel=='list'">
-          <a-table :columns="columns" :data-source="data" :scroll="{ x:'100%', y: 500 }"
+          <a-table :columns="filterColumns" :data-source="data" :scroll="{ x:'100%', y: 550 }"
                    :row-key="record=>record.tempId" :pagination="false"
                    bordered>
             <template #bodyCell="{ column,record }">
@@ -208,7 +221,7 @@
                       @change="(current)=>handleTableChange({ current: current,pageSize: pagination.pageSize })"
                       @showSizeChange="(current,pageSize)=>handleTableChange({ current: current,pageSize: pageSize })"/>
       </a-spin>
-      <div style="width:100%;height: 500px">
+      <div style="width:100%;height: 500px;margin-top:15px">
         <ChartMap></ChartMap>
       </div>
     </div>
@@ -236,7 +249,7 @@
 </template>
 
 <script lang="ts">
-import {ref, defineComponent, reactive, computed} from 'vue';
+import {ref, defineComponent, reactive, computed, watch} from 'vue';
 import type {FormInstance} from 'ant-design-vue';
 import {useRoute} from 'vue-router';
 import {get} from "@/api/common";
@@ -250,7 +263,7 @@ import ChartMap from '@/components/basic/chart/chart-map.vue'
 
 export default defineComponent({
   name: 'wellinfoindex',
-  components: {ChartCell,ChartMap},
+  components: {ChartCell, ChartMap},
   setup() {
     const route = useRoute();
     const expand = ref(false);
@@ -261,6 +274,7 @@ export default defineComponent({
     const activeTab = ref("1");
     const showTree = ref(true);
     const isShowDoc = ref(false);
+    const showColumnType = ref(['oil','gas']);
     const data = ref([{children: [], label: '', value: ''}]);
     const viewModel = ref("list");
     const tabsViewStore = useTabsViewStore();
@@ -271,11 +285,11 @@ export default defineComponent({
       title: 'label',
       key: 'value',
     };
-
     const formState = reactive({
       page: 1,
       rows: 10,
       total: 0,
+      ref_date: new Date(), //重置查询条件使用
       well_common_name: '',
       well_id: '',
       well_type: '',
@@ -290,6 +304,26 @@ export default defineComponent({
       org_id_a1: '',
       project_id: ''
     });
+    const resetFields = function () {
+      let keys: string[] = Object.keys(formState);
+      keys.forEach(key => {
+        if (typeof (formState[key]) == "string") {
+          formState[key] = '';
+        }
+      })
+    }
+    const oilHeader = () => {
+      return {
+        style: {'border-top': '2px solid red'},
+      }
+    }
+    const gasHeader = () => {
+      return {
+        style: {'border-top': '2px solid #0c6be2'},
+      }
+    }
+    const filterColumns = ref([]);
+
     const columns: TableColumnsType = [
       {
         title: '序号',
@@ -337,14 +371,59 @@ export default defineComponent({
           return {class: getTdColor(record.water_cut)};
         }
       },
-      {title: '月产油量(t)', dataIndex: 'oil_prod_mon', key: 'oil_prod_mon', width: 120},
-      {title: '累产油量(t)', dataIndex: 'oil_prod_year', key: 'oil_prod_year', width: 120},
-      {title: '累产油量趋势', dataIndex: 'oil', key: 'oil', width: 150},
-      {title: '月产气量(m³)', dataIndex: 'gas_prod_mon', key: 'gas_prod_mon', width: 120},
-      {title: '累产气量(m³)', dataIndex: 'gas_prod_year', key: 'gas_prod_year', width: 120},
-      {title: '累产气量趋势', dataIndex: 'gas', key: 'gas', width: 150},
+      {
+        title: '最近月产油量(t)',
+        dataIndex: 'oil_prod_mon',
+        key: 'oil_prod_mon',
+        width: 120,
+        customHeaderCell: oilHeader
+      },
+      {
+        title: '累产油量(t)',
+        dataIndex: 'oil_prod_year',
+        key: 'oil_prod_year',
+        width: 120,
+        customHeaderCell: oilHeader
+      },
+      {title: '累产油量趋势', dataIndex: 'oil', key: 'oil', width: 100, customHeaderCell: oilHeader},
+      {
+        title: '最近月产气量(m³)',
+        dataIndex: 'gas_prod_mon',
+        key: 'gas_prod_mon',
+        width: 130,
+        customHeaderCell: gasHeader
+      },
+      {
+        title: '累产气量(m³)',
+        dataIndex: 'gas_prod_year',
+        key: 'gas_prod_year',
+        width: 120,
+        customHeaderCell: gasHeader
+      },
+      {title: '累产气量趋势', dataIndex: 'gas', key: 'gas', width: 100, customHeaderCell: gasHeader},
       {title: '操作列', dataIndex: 'operation', key: 'operation', align: 'center', width: 120}
     ];
+    filterColumns.value = columns as any;
+
+    watch(
+      () => showColumnType.value,
+      () => {
+        const filterValue = columns.filter((item: any) => {
+          if (!showColumnType.value.includes("oil")) {
+            if (["oil_prod_mon", "oil_prod_year", "oil"].includes(item.dataIndex)) {
+              return false
+            }
+          }
+          if (!showColumnType.value.includes("gas")) {
+            if (["gas_prod_mon", "gas_prod_year", "gas"].includes(item.dataIndex)) {
+              return false
+            }
+          }
+          return true
+        })
+        filterColumns.value = filterValue as any;
+      }
+    );
     const getTdColor = (water_cut) => {
       if (water_cut == null || water_cut <= 2) {
         return "";
@@ -495,10 +574,10 @@ export default defineComponent({
     const labelCol = {style: {width: '100px'}};
 
     return {
-      route, selectedRowKeys, columns, loading, activeTab, showTree, onSelectChange, data,
+      route, selectedRowKeys, loading, activeTab, showTree, onSelectChange, data,
       expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList, replaceFields,
       formRef, viewModel, handleTableChange, detail,
-      formState, isShowDoc, showDoc, docList,
+      formState, isShowDoc, showDoc, docList, resetFields, showColumnType, filterColumns,
       labelCol, getTdColor,
       tabChange,
       treeOnExpand,
@@ -584,7 +663,7 @@ export default defineComponent({
   padding: 5px;
   padding-top: 10px;
   overflow-y: scroll;
-  max-height: 600px;
+  max-height: 1000px;
 }
 
 .col-text {
@@ -616,19 +695,19 @@ export default defineComponent({
   }
 }
 
-.color_level1, .color_level1:hover {
+.color_level1, .ant-table-tbody>tr>td.color_level1:hover {
 }
 
-.color_level2, .color_level2:hover {
+.color_level2, .ant-table-tbody>tr>td.color_level2:hover {
   background-color: #EAF4FF !important;
 }
 
-.color_level3, .color_level3:hover {
-  background-color: #D5EAFF;
+.color_level3, .ant-table-tbody>tr>td.color_level3:hover {
+  background-color: #D5EAFF !important;
 }
 
-.color_level4, .color_level4:hover {
-  background-color: #B7DBFF;
+.color_level4, .ant-table-tbody>tr>td.color_level4:hover {
+  background-color: #B7DBFF !important;
 }
 </style>