Browse Source

领域检索

xiaoqiao 7 months ago
parent
commit
989b96ff8b

+ 1 - 0
.idea/.gitignore

@@ -6,3 +6,4 @@
 # Datasource local storage ignored files
 /dataSources/
 /dataSources.local.xml
+.idea/

+ 41 - 4
src/main/java/com/bowintek/practice/controller/EsQueryController.java

@@ -12,6 +12,7 @@ import com.bowintek.practice.util.StringUtils;
 import com.bowintek.practice.vo.Analyze.ComparisonResult;
 import com.bowintek.practice.vo.Analyze.EsQueryModel;
 import com.bowintek.practice.vo.Analyze.EsQueryText;
+import com.bowintek.practice.vo.Analyze.FormState;
 import com.bowintek.practice.vo.SaerchtempVo;
 import com.bowintek.practice.vo.system.RoleModel;
 import com.bowintek.practice.vo.temp.GenSqlStringResult;
@@ -40,13 +41,49 @@ public class EsQueryController {
     @PostMapping("/Query")
     public BaseResponse getQuery(@RequestBody EsQueryModel model) {
         //在es查询并返回结果
-        Map<String, Object> results = esQueryService.query(model.getQueryList(),
-                model.getLimiters(),
+        List<ComparisonResult> limiters = model.getLimiters();
+        List<EsQueryText> queryList =model.getQueryList();
+        FormState formState = model.getFormState();
+        if (formState != null) {
+            if (!StringUtils.IsNullEmpty(formState.getWell_common_name())) {
+                limiters.add(new ComparisonResult() {{
+                    setValue(formState.getWell_common_name());
+                    setOpreation("等于");
+                    setFields("well_common_name");
+                    setRelation("AND");
+                }});
+            }
+            if(!StringUtils.IsNullEmpty(formState.getBz_dwmc())){
+                limiters.add(new ComparisonResult() {{
+                    setValue(formState.getBz_dwmc());
+                    setOpreation("等于");
+                    setFields("bz_dwmc");
+                    setRelation("AND");
+                }});
+            }
+            if(!StringUtils.IsNullEmpty(formState.getOrg_name_a1())){
+                limiters.add(new ComparisonResult() {{
+                    setValue(formState.getOrg_name_a1());
+                    setOpreation("等于");
+                    setFields("org_name_a1");
+                    setRelation("AND");
+                }});
+            }
+            if(!StringUtils.IsNullEmpty(formState.getDefaultKeyString())){
+                queryList.add(new EsQueryText(){{
+                    setOperation("等于");
+                    setKeyString(formState.getDefaultKeyString());
+                    setField(formState.getDefaultField());
+                }});
+            }
+        }
+        Map<String, Object> results = esQueryService.query(queryList,
+                limiters,
                 model.getPage(),
                 model.getLimit());
         //保存查询字符串,查询历史统计
-        for(EsQueryText queryText : model.getQueryList()){
-            if(!StringUtils.IsNullEmpty(queryText.getKeyString()))
+        for (EsQueryText queryText : model.getQueryList()) {
+            if (!StringUtils.IsNullEmpty(queryText.getKeyString()))
                 queryLogService.save(queryText.getKeyString(), accountService.getLoginUserID());
         }
 

+ 1 - 1
src/main/java/com/bowintek/practice/services/impl/AnalyzeServiceImpl.java

@@ -198,7 +198,7 @@ public class AnalyzeServiceImpl implements AnalyzeService {
             //度量、维度关联的字段
             result.setFieldName(analyze.getModel().getLexemeText());
             if(!StringUtils.IsNullEmpty(analyze.getModel().getEsIndexField()))
-                result.setFields(analyze.getModel().getEsIndexField().split(","));
+                result.setFields(analyze.getModel().getEsIndexField());
 
             //有 TYPE_CQUAN 说明读取到了 数值+单位
             AnalyzeComparisonResult cquan = findByLexemeType(modelList, "TYPE_CQUAN");

+ 41 - 26
src/main/java/com/bowintek/practice/services/impl/EsQueryServiceImpl.java

@@ -2,6 +2,7 @@ package com.bowintek.practice.services.impl;
 
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
 import co.elastic.clients.elasticsearch._types.FieldValue;
+import co.elastic.clients.elasticsearch._types.SortOptions;
 import co.elastic.clients.elasticsearch._types.SortOrder;
 import co.elastic.clients.elasticsearch._types.aggregations.Aggregate;
 import co.elastic.clients.elasticsearch._types.aggregations.Buckets;
@@ -20,6 +21,7 @@ import co.elastic.clients.json.JsonData;
 import com.bowintek.practice.mapper.cquery.EsIndexCquery;
 import com.bowintek.practice.services.service.AnalyzeService;
 import com.bowintek.practice.services.service.EsQueryService;
+import com.bowintek.practice.util.Constant;
 import com.bowintek.practice.util.StringUtils;
 import com.bowintek.practice.vo.Analyze.ComparisonResult;
 import com.bowintek.practice.vo.Analyze.EsQueryText;
@@ -33,6 +35,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.query.SortQuery;
 import org.springframework.stereotype.Component;
 
 import javax.naming.directory.SearchResult;
@@ -134,6 +137,8 @@ public class EsQueryServiceImpl implements EsQueryService {
             List<String> pathList = getPathCache();
 
             List<Query> queryMustList = new ArrayList<>();
+            BoolQuery.Builder boolQuery = new BoolQuery.Builder();
+
             //[2]分析查询字符串,有的字符串需要变成条件查询
             for (EsQueryText queryText : queryList) {
                 List<Query> shouldQuerys = getComparisonQueryList(queryText);
@@ -143,19 +148,27 @@ public class EsQueryServiceImpl implements EsQueryService {
             }
             //[3]限定查询条件,都是有条件的查询
             for (ComparisonResult cmp : limiters) {
-                List<Query> cmpQuerys = new ArrayList<>();
+                //List<Query> cmpQuerys = new ArrayList<>();
                 //检查查询、对比的值是否为空
                 if (StringUtils.IsNullEmpty(cmp.getValue())) continue;
 
                 //第一级,对比搜索
-                cmpQuerys.addAll(getRangeQueryByComparison(cmp));
+                if (Constant.AND.equals(cmp.getRelation())) {
+                    boolQuery.must(getRangeQueryByComparison(cmp));
+                } else if (Constant.OR.equals(cmp.getRelation())) {
+                    boolQuery.should(getRangeQueryByComparison(cmp));
+                } else if (Constant.NOT.equals(cmp.getRelation())) {
+                    boolQuery.mustNot(getRangeQueryByComparison(cmp));
+                } else {
+                    boolQuery.must(getRangeQueryByComparison(cmp));
+                }
                 //第二级,对比搜索
                /* for (String path : pathList) {
                     cmpQuerys.addAll(getNestedRangeQueryByComparison(cmp, path));
                 }*/
-                if (cmpQuerys.size() > 0) {
+                /*if (cmpQuerys.size() > 0) {
                     queryMustList.addAll(cmpQuerys);
-                }
+                }*/
             }
 
             //[4]建立查询参数分析
@@ -166,19 +179,25 @@ public class EsQueryServiceImpl implements EsQueryService {
             searchRequest.size(limit);
             searchRequest.from(page * limit);
             //==>设置查询条件
-            if (queryMustList.size() > 0) {
-                 Query queryMust = Query.of(q -> q.bool(b -> b.must(queryMustList)));
-                //Query byName = MatchQuery.of(m -> m.field("well_common_name").query("宁12-412"))._toQuery();
-                //Query queryMust = Query.of(q -> q.term(TermQuery.of(m -> m.field("well_common_name.keyword").value("宁12-412"))));
-                searchRequest.query(queryMust);
+
+            if(queryMustList.size()>0){
+                boolQuery.should(queryMustList);
             }
+            Query queryMust = Query.of(q -> q.bool(boolQuery.build()));
+            //Query byName = MatchQuery.of(m -> m.field("well_common_name").query("宁12-412"))._toQuery();
+            //Query queryMust = Query.of(q -> q.term(TermQuery.of(m -> m.field("well_common_name.keyword").value("宁12-412"))));
+            SortOptions.Builder sb = new SortOptions.Builder();
+            sb.field(f -> f.field("create_date").order(SortOrder.Desc));
+            searchRequest.query(queryMust).sort(sb.build());
+
             //==>高亮设置
             searchRequest.highlight(h -> h.fields("*", f -> f.preTags("<font color='red'>")
                     .postTags("</font>")));
             //排序
             //searchRequest.sort(f->f.field(v->v.field("well_id").order(SortOrder.Asc)));
             //查询后分组
-            searchRequest.aggregations("group_well", a -> a.terms(t -> t.field("well_id.keyword")));
+            searchRequest.aggregations("group_well", a -> a.terms(t -> t.field("well_id")));
+
             //[5]Es发起查询
             SearchRequest request = searchRequest.build();
 
@@ -244,27 +263,23 @@ public class EsQueryServiceImpl implements EsQueryService {
 
     public List<Query> getRangeQueryByComparison(ComparisonResult cmp) {
         List<Query> queryList = new ArrayList<>();
-        for (int i = 0; i < cmp.getFields().length; i++) {
-            String fieldString = cmp.getFields()[i];
-            //对比类型查询
-            Query query = getComparisonQuery(fieldString, cmp.getOpreation(), cmp.getValue());
-            if (query != null) queryList.add(query);
-        }
+        String fieldString = cmp.getFields();
+        //对比类型查询
+        Query query = getComparisonQuery(fieldString, cmp.getOpreation(), cmp.getValue());
+        if (query != null) queryList.add(query);
 
         return queryList;
     }
 
     public List<Query> getNestedRangeQueryByComparison(ComparisonResult cmp, String path) {
         List<Query> queryList = new ArrayList<>();
-        for (int i = 0; i < cmp.getFields().length; i++) {
-            String fieldString = cmp.getFields()[i];
-            //对比类型查询
-            Query query = getComparisonQuery(path + "." + fieldString, cmp.getOpreation(), cmp.getValue());
-            if (query != null) {
-                Query nested = NestedQuery.of(q -> q.path(path).query(query)
-                        .ignoreUnmapped(true))._toQuery();
-                queryList.add(nested);
-            }
+        String fieldString = cmp.getFields();
+        //对比类型查询
+        Query query = getComparisonQuery(path + "." + fieldString, cmp.getOpreation(), cmp.getValue());
+        if (query != null) {
+            Query nested = NestedQuery.of(q -> q.path(path).query(query)
+                    .ignoreUnmapped(true))._toQuery();
+            queryList.add(nested);
         }
 
         return queryList;
@@ -282,7 +297,7 @@ public class EsQueryServiceImpl implements EsQueryService {
         else if (opreation.equals("小于等于"))
             query = RangeQuery.of(q -> q.field(fieldString).lte(JsonData.of(value)))._toQuery();
         else if (opreation.equals("等于"))
-            query = MatchQuery.of(q -> q.field(fieldString).query(value))._toQuery();
+            query = MatchQuery.of(q -> q.field(fieldString).query(value).minimumShouldMatch("80%"))._toQuery();
         else if (opreation.equals("包括IN")) {
             String[] ins = value.split(",");
             List<FieldValue> fls = new ArrayList<>();

+ 4 - 0
src/main/java/com/bowintek/practice/util/Constant.java

@@ -6,6 +6,10 @@ public class Constant {
     public static final String YES = "是";
     public static final String No = "否";
 
+    public static final String AND = "AND";
+    public static final String OR = "OR";
+    public static final String NOT = "NOT";
+
     /**
      * 井生产状态
      */

+ 2 - 1
src/main/java/com/bowintek/practice/vo/Analyze/ComparisonResult.java

@@ -8,8 +8,9 @@ public class ComparisonResult {
     private String keyString;
 
     private String fieldName;
-    private String[] fields;
+    private String fields;
     private String opreation;
+    private String relation;
     private String value;
     private String uint;
 

+ 1 - 0
src/main/java/com/bowintek/practice/vo/Analyze/EsQueryModel.java

@@ -8,6 +8,7 @@ import java.util.List;
 public class EsQueryModel {
     private List<ComparisonResult> limiters;
     private List<EsQueryText> queryList;
+    private FormState formState;
     private int page;
     private int limit;
 }

+ 1 - 0
src/main/java/com/bowintek/practice/vo/Analyze/EsQueryText.java

@@ -8,4 +8,5 @@ import java.util.List;
 public class EsQueryText {
     private String keyString;
     private String field;
+    private String operation;
 }

+ 12 - 0
src/main/java/com/bowintek/practice/vo/Analyze/FormState.java

@@ -0,0 +1,12 @@
+package com.bowintek.practice.vo.Analyze;
+
+import lombok.Data;
+
+@Data
+public class FormState {
+    private String well_common_name;
+    private String bz_dwmc;
+    private String org_name_a1;
+    private String defaultField;
+    private String defaultKeyString;
+}

+ 0 - 5
src/main/resources/application.yml

@@ -115,11 +115,6 @@ appconfig:
   uploadfile-url: D:\我的文件\博颖项目\华北油田AI检索\smartsearch\src\main\resources\static\doc
   desKey: MMmmHHss
 
-  #ftp配置 192.168.0.51:21@aqfxgk:qwe123
-  #ftp-host: 192.168.0.68
-  #ftp-port: 21
-  #ftp-user: FtpUser
-  #ftp-pwd: bowin123
   ftp-host: 39.98.145.11
   ftp-port: 21
   ftp-user: BowinFtp

+ 107 - 89
vue/src/components/basic/es-result/query-criteria.vue

@@ -1,46 +1,60 @@
 <template>
-  <a-divider orientation="left"><b style="color:#4E61D0">1.输入检索控制条件</b></a-divider>
-  <a-row :gutter="24">
-    <a-col :span="24">
-      <div class="col-title">组织单位:</div>
-      <a-input v-model:value="formState.org_name_a1" style="width: 400px"></a-input>
-    </a-col>
-    <a-col :span="24">
-      <div class="col-title">作业区/项目部:</div>
-      <a-input v-model:value="formState.bz_dwmc" style="width: 400px"></a-input>
-    </a-col>
-    <a-col :span="24">
-      <div class="col-title">井名:</div>
-      <a-input v-model:value="formState.well_common_name" style="width: 400px"></a-input>
-    </a-col>
-    <a-col :span="24">
-      <div class="col-title">地层名称:</div>
-      <a-input v-model:value="formState.formation_name" style="width: 400px"></a-input>
-    </a-col>
-  </a-row>
-  <a-divider orientation="left"><b style="color:#4E61D0">2.输入检索内容条件</b></a-divider>
-  <a-row :gutter="24">
-    <a-col :span="24" class="query-row">
-      <div class="col-title"></div>
+  <div>
+    <a-space>
       <a-select v-model:value="formState.defaultField" :options="fieldList" class="operTexts"></a-select>
-      <!--AutoComplete继承至vue-->
-      <QueryHistoryComplete v-model:value="formState.defaultKeyString" style="width: 285px"></QueryHistoryComplete>
-      <img src="~@/assets/images/add.png" @click="addQuery"/>
-    </a-col>
-    <a-col :span="24" class="query-row" v-for="(it,index) in queryList">
-      <div class="col-title"></div>
-      <!--a-select v-model:value="it.oper" :options="operTexts" class="operTexts"></a-select-->
-      <a-select v-model:value="it.field" :options="fieldList" class="operTexts"></a-select>
-      <QueryHistoryComplete v-model:value="it.keyString" style="width: 285px"></QueryHistoryComplete>
-      <img src="~@/assets/images/sub.png" @click="onDelete(index)"/>
-    </a-col>
-
-  </a-row>
+      <QueryHistoryComplete v-model:value="formState.defaultKeyString" style="width: 400px"></QueryHistoryComplete>
+      <a-button type="primary" html-type="submit" @click="getQuery">查询</a-button>
+      <a-button @click="() => {formRef.resetFields();}">重置</a-button>
+    </a-space>
+  </div>
+  <a-divider orientation="center" @click="formState.showMoreQuery=!formState.showMoreQuery">
+    <template v-if="!formState.showMoreQuery">
+      更多查询
+      <DoubleRightOutlined rotate="90"/>
+    </template>
+    <template v-else>
+      收 起
+      <DoubleLeftOutlined rotate="90"/>
+    </template>
+  </a-divider>
+  <div v-show="formState.showMoreQuery">
+    <a-divider orientation="left"><b style="color:#4E61D0">1.输入检索控制条件</b></a-divider>
+    <a-row :gutter="24">
+      <a-col :span="24">
+        <div class="col-title">组织单位:</div>
+        <a-input v-model:value="formState.org_name_a1" style="width: 400px"></a-input>
+      </a-col>
+      <a-col :span="24">
+        <div class="col-title">作业区/项目部:</div>
+        <a-input v-model:value="formState.bz_dwmc" style="width: 400px"></a-input>
+      </a-col>
+      <a-col :span="24">
+        <div class="col-title">井名:</div>
+        <a-input v-model:value="formState.well_common_name" style="width: 400px"></a-input>
+      </a-col>
+      <a-col :span="24">
+        <div class="col-title">地层名称:</div>
+        <a-input v-model:value="formState.formation_name" style="width: 400px"></a-input>
+      </a-col>
+    </a-row>
+    <a-divider orientation="left"><b style="color:#4E61D0">2.输入检索内容条件</b></a-divider>
+    <a-row :gutter="24">
+      <a-col :span="24" class="query-row" v-for="(it,index) in limiters">
+        <div class="col-title">
+          <a-select v-model:value="it.relation" :options="operTexts" class="operTexts"></a-select>
+        </div>
+        <a-select v-model:value="it.fields" :options="fieldList" class="operTexts"></a-select>
+        <a-input v-model:value="it.value" style="width: 285px"></a-input>
+        <img src="~@/assets/images/add.png" @click="addQuery" v-if="index==0"/>
+        <img src="~@/assets/images/sub.png" @click="onDelete(index)" v-if="index>0"/>
+      </a-col>
+    </a-row>
+  </div>
 </template>
 
 <script lang="ts">
-import {defineComponent, reactive, ref} from 'vue';
-import type {SelectProps} from "ant-design-vue";
+import {defineComponent, ref, watch} from 'vue';
+import type {FormInstance, SelectProps} from "ant-design-vue";
 import QueryHistoryComplete from '@/components/basic/querylog/history-complete.vue'
 
 export default defineComponent({
@@ -49,92 +63,96 @@ export default defineComponent({
   props: {
     queryObject: Object,
   },
-  setup(props) {
+  emits: [
+    "query"
+  ],
+  setup(props, {emit}) {
     console.log(props);
-    const formState = reactive({
-      page: 1, rows: 10,
+
+    const limiters = ref([{
+      fields: '',
+      value: '',
+      opreation: '等于',
+      relation: 'AND'
+    }]);
+    const formState = ref(Object.assign({}, {
+      page: 1, rows: 10, showMoreQuery: true,
       well_common_name: '',
       bz_dwmc: '',
       formation_name: '',
       org_name_a1: '',
       defaultField: '',
-      defaultKeyString: ''
-    });
-    if (props.queryObject && props.queryObject.queryList.length > 0) {
-      formState.defaultField = props.queryObject.queryList[0].field;
-      formState.defaultKeyString = props.queryObject.queryList[0].keyString;
-    }
+      defaultKeyString: '',
+      operation: 'AND'
+    }, props.queryObject?.formState));
+
+    watch(
+      () => props.queryObject,
+      () => {
+        if (props.queryObject != null) {
+          formState.value = Object.assign({}, {
+            page: 1, rows: 10, showMoreQuery: true,
+            well_common_name: '',
+            bz_dwmc: '',
+            formation_name: '',
+            org_name_a1: '',
+            defaultField: '',
+            defaultKeyString: '',
+            operation: 'AND'
+          }, props.queryObject.formState);
+
+          limiters.value = props.queryObject.limiters.length > 0 ? props.queryObject.limiters : [{
+            field: '',
+            keyString: '',
+            operation: 'AND'
+          }];
+        }
+      }, {}
+    );
+
+    const formRef = ref<FormInstance>();
 
-    const queryList = ref<any>(props.queryObject ? props.queryObject.queryList.slice(1) : []);
 
     const operTexts = [
-      {value: '=', label: '等于'},
-      {value: 'like', label: '包含'},
-      {value: 'null', label: '为空'},
-      {value: 'not null', label: '不为空'}
+      {value: 'AND', label: 'AND'},
+      {value: 'OR', label: 'OR'},
+      {value: 'NOT', label: 'NOT'}
     ] as SelectProps['options'];
 
     const fieldList = [
       {value: '', label: '不限'},
       {value: 'well_id', label: '井号'},
       {value: 'well_common_name', label: '井名'},
-      {value: 'historys.testing_name', label: '测试'}
+      {value: 'well_purpose', label: '井别'}
     ] as SelectProps['options'];
 
     function addQuery() {
-      queryList.value.push({field: '', keyString: ''});
+      limiters.value.push({fields: '', value: '',  opreation: '等于', relation: 'AND'});
     }
 
     function onDelete(index) {
-      queryList.value.splice(index, 1);
+      limiters.value.splice(index, 1);
     }
 
     function getQuery() {
       //组装查询条件
       let queryObject = {
-        queryList: JSON.parse(JSON.stringify(queryList.value)),
+        queryList: [] as any,
         limiters: [] as any,
+        formState: Object,
         page: 0,
         limit: 10
       };
-      //第一条默认查询条件
-      if(formState.defaultKeyString!=null&&formState.defaultKeyString!="") {
-        queryObject.queryList.splice(0, 0, {
-          field: formState.defaultField,
-          keyString: formState.defaultKeyString
-        });
-      }
-      //限定条件写入
-      //{"fieldName":"开钻日期", "fields":["spud_date"],"opreation":"大于","value":"2022-03-28"}
-      /* if(formState.well_common_name!=null&&formState.well_common_name!="") {
-         queryObject.limiters.push({
-           fields: ["well_common_name.keyword"],
-           opreation: '等于',
-           value: formState.well_common_name
-         });
-       }*/
-      let keys = ["well_common_name", "bz_dwmc", "org_name_a1"];
-      for (let index in keys) {
-        if (formState.hasOwnProperty(keys[index])) {
-          if (formState[keys[index]] != null && formState[keys[index]] != "") {
-            queryObject.limiters.push({
-              fields: [`${keys[index]}`],
-              opreation: '等于',
-              value: formState[keys[index]]
-            });
-          }
-        }
-      }
-      //多个值测试,如 组织单位 in 哪些值
-      // queryObject.limiters.push({fields: ["well_type.keyword"], opreation: '包括IN', value: '直井'});
 
+      //多个值测试,如 组织单位 in 哪些值
+      queryObject.formState = formState.value;
+      queryObject.limiters = limiters.value;
       console.log(queryObject);
-      return queryObject;
-      //localStorage.setItem("queryObject",JSON.stringify(queryObject));
+      emit('query', queryObject);
     }
 
     return {
-      formState, queryList, operTexts, fieldList, addQuery, onDelete, getQuery
+      formState, limiters, operTexts, fieldList, addQuery, onDelete, getQuery, formRef
     };
   }
 });

+ 2 - 10
vue/src/views/esdomain/index.vue

@@ -6,14 +6,7 @@
       class="ant-advanced-search-form"
       @finish="onQuery"
     >
-      <queryCriteria ref="queryRef"></queryCriteria>
-      <a-row :gutter="24">
-        <a-col :span="24" class="query-row">
-          <div class="col-title"></div>
-          <a-button type="primary" @click="onQuery">查询</a-button>
-          <a-button style="margin: 0 8px" @click="() => {formRef.resetFields();}">重置</a-button>
-        </a-col>
-      </a-row>
+      <queryCriteria ref="queryRef" @query="onQuery"></queryCriteria>
     </a-form>
   </div>
 </template>
@@ -37,8 +30,7 @@ export default defineComponent({
     const formRef = ref<FormInstance>();
     const queryRef = ref<typeof queryCriteria>();
 
-    const onQuery = () => {
-      let queryObject = queryRef.value?.getQuery();
+    const onQuery = (queryObject) => {
       localStorage.setItem("queryObject",JSON.stringify(queryObject));
       tabsViewStore.addTabByPath('/domain/result', {});
     }

+ 62 - 63
vue/src/views/esdomain/result.vue

@@ -1,26 +1,6 @@
 <template>
   <div class="card-search">
-    <div>
-      <a-space>
-        <a-select v-model:value="formState.tabName" :options="fieldList" class="operTexts"></a-select>
-        <QueryHistoryComplete v-model:value="formState.key" style="width: 285px"></QueryHistoryComplete>
-        <a-button type="primary" html-type="submit" @click="onQuery">查询</a-button>
-        <a-button @click="() => {formRef.resetFields();}">重置</a-button>
-      </a-space>
-    </div>
-    <div v-show="pageState.showMoreQuery">
-      <queryCriteria ref="queryRef" :query-object="queryObject"></queryCriteria>
-    </div>
-    <a-divider orientation="center" @click="pageState.showMoreQuery=!pageState.showMoreQuery">
-      <template v-if="!pageState.showMoreQuery">
-        展开更多
-        <DoubleRightOutlined rotate="90"/>
-      </template>
-      <template v-else>
-        收 起
-        <DoubleLeftOutlined rotate="90"/>
-      </template>
-    </a-divider>
+    <queryCriteria ref="queryRef" :queryObject="queryObject" @query="onQuery"></queryCriteria>
     <a-spin :spinning="pageState.loading">
       <div class="search-group" :style="{ height: pageState.showMoreKey? '150px':'38px' }">
         <div class="search-group-title">检索井名:</div>
@@ -29,19 +9,20 @@
             <a-popover trigger="hover" @visibleChange="visible=>onVisible(visible,it.key)">
               <template #content>
                 <a-descriptions bordered>
-                  <a-descriptions-item label="井名:">{{ wellInfo?.well_common_name }} </a-descriptions-item>
+                  <a-descriptions-item label="井名:">{{ wellInfo?.well_common_name }}</a-descriptions-item>
                   <a-descriptions-item label="井别:">{{ wellInfo?.well_purpose }}</a-descriptions-item>
                   <a-descriptions-item label="井型:">{{ wellInfo?.well_type }}</a-descriptions-item>
                   <a-descriptions-item label="开钻日期:">{{ wellInfo?.spud_date_fmt }}</a-descriptions-item>
                   <a-descriptions-item label="完钻日期:">{{ wellInfo?.end_drilling_date_fmt }}</a-descriptions-item>
-                  <a-descriptions-item label="设计井深:">{{wellInfo?.budgeted_md == null ? "" : (wellInfo?.budgeted_md + "m")}}
+                  <a-descriptions-item label="设计井深:">
+                    {{ wellInfo?.budgeted_md == null ? "" : (wellInfo?.budgeted_md + "m") }}
                   </a-descriptions-item>
                   <a-descriptions-item label="完钻层位:">{{ wellInfo?.completion_formation }}</a-descriptions-item>
                   <a-descriptions-item label="完井方式:">{{ wellInfo?.completion_method }}</a-descriptions-item>
                   <a-descriptions-item label="生产井段:">{{ wellInfo?.well_production_sections }}</a-descriptions-item>
                 </a-descriptions>
               </template>
-              <span>{{it.key}}</span>
+              <span>{{ it.key }}</span>
             </a-popover>
           </template>
         </div>
@@ -88,10 +69,17 @@
               <div class="search-body-item">
                 <component is="cycleView" :indexSetting="it.indexSetting" :data="it"></component>
                 <component is="tableView" :indexSetting="it.indexSetting" :data="it"></component>
-                <component is="chatView" :indexSetting="it.indexSetting" :well_id="it.well_id" :data="it.dws_dm_analytical_assays_new" v-show="it.showMore"></component>
-                <component is="listView" :indexSetting="it.indexSetting" :fieldCode="'fact_dwr_brief_history_assignment'" :data="it.fact_dwr_brief_history_assignment" v-show="it.showMore"></component>
-                <component is="listView" :indexSetting="it.indexSetting" :fieldCode="'fact_dwr_wl_ach_borehole_inter'" :data="it.fact_dwr_wl_ach_borehole_inter" v-show="it.showMore"></component>
-                <component is="docView" :indexSetting="it.indexSetting" :data="it.fact_dwr_well_data_index" v-show="it.showMore"></component>
+                <component is="chatView" :indexSetting="it.indexSetting" :well_id="it.well_id"
+                           :data="it.dws_dm_analytical_assays_new" v-show="it.showMore"></component>
+                <component is="listView" :indexSetting="it.indexSetting"
+                           :fieldCode="'fact_dwr_brief_history_assignment'" :data="it.fact_dwr_brief_history_assignment"
+                           v-show="it.showMore"></component>
+                <component is="listView" :indexSetting="it.indexSetting" :fieldCode="'fact_dwr_wl_ach_borehole_inter'"
+                           :data="it.fact_dwr_wl_ach_borehole_inter" v-show="it.showMore"></component>
+                <component is="listView" :indexSetting="it.indexSetting" :fieldCode="'dws_dm_analytical_assays_new'"
+                           :data="it.dws_dm_analytical_assays_new" v-show="it.showMore"></component>
+                <component is="docView" :indexSetting="it.indexSetting" :data="it.fact_dwr_well_data_index"
+                           v-show="it.showMore"></component>
 
                 <a-divider orientation="center" @click="it.showMore=!it.showMore">
                   <template v-if="!it.showMore">
@@ -170,7 +158,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, chatView, docView, cycleView, queryCriteria, QueryHistoryComplete},
   setup() {
 
     const route = useRoute();
@@ -184,13 +172,13 @@ export default defineComponent({
       page: 1, rows: 10, subjectName: '', tabName: '', tabCode: null, total: 0
     });
     const displayType = ['cycleView', 'tableView', 'listView', 'chatView', 'docView'];
-    const queryObject=ref();
+    const queryObject = ref();
     const pageState = reactive({
       showMoreQuery: false,
       defaultOrder: '',
       timeOrder: '',
       loading: false,
-      showMoreKey:false
+      showMoreKey: false
     });
     const pageParams = ref({
       total: 0,
@@ -205,7 +193,7 @@ export default defineComponent({
     ) => {
       pageParams.value.current = pag.current;
       pageParams.value.pageSize = pag.pageSize;
-      onQuery();
+      onQuery(queryObject.value);
     };
 
     const queryRef = ref<typeof queryCriteria>();
@@ -216,10 +204,10 @@ export default defineComponent({
     ] as SelectProps['options'];
 
 
-     /* get('esindex/getAllList', {}).then(result => {
-        indexList.value = result.list;
-      }) */
-    const getIndex=async () => {
+    /* get('esindex/getAllList', {}).then(result => {
+       indexList.value = result.list;
+     }) */
+    const getIndex = async () => {
       const result = await get('esindex/getAllList', {});
       indexList.value = result.list;
     }
@@ -227,17 +215,17 @@ export default defineComponent({
       tabsViewStore.addTabByPath('/wellinfo/detail', {id: well_id});
     }
 
-    function onQuery() {
-      let queryObject = queryRef.value?.getQuery();
-      loadData(queryObject);
+    function onQuery(args) {
+      queryObject.value = args;
+      loadData();
     }
 
-    function loadData(queryObject) {
-      queryObject.page = pageParams.value.current - 1;
-      queryObject.limit = pageParams.value.pageSize;
+    function loadData() {
+      queryObject.value.page = pageParams.value.current - 1;
+      queryObject.value.limit = pageParams.value.pageSize;
 
       pageState.loading = true;
-      postData('esquery/Query', queryObject).then(result => {
+      postData('esquery/Query', queryObject.value).then(result => {
         pageState.loading = false;
         console.log(result);
         dataList.value = (result as any).rows;
@@ -252,20 +240,23 @@ export default defineComponent({
       dataList.value.forEach(it => {
         let itSetting = indexList.value.find(ind => ind.indexCode == it.index);
         if (itSetting) {
-          it.component = displayType[itSetting.displayType-1];
+          it.component = displayType[itSetting.displayType - 1];
           it.indexSetting = itSetting;
         }
       })
     }
-    const wellInfo=ref();
-    function onVisible(visible,key){
-      console.log(visible,key);
-      if(visible) {
-        get('wellInfo/getWellBaseInfo', {well_id:key}).then(data => {
+
+    const wellInfo = ref();
+
+    function onVisible(visible, key) {
+      console.log(visible, key);
+      if (visible) {
+        get('wellInfo/getWellBaseInfo', {well_id: key}).then(data => {
           wellInfo.value = data;
         })
       }
     }
+
     const listData: string[] = [
       '井号1-1.',
       '井号2-1',
@@ -291,16 +282,16 @@ export default defineComponent({
       handleChange,
       getIndex,
       pageParams,
-      keyList,onVisible,wellInfo,
+      keyList, onVisible, wellInfo,
       queryObject
     };
   },
   created() {
-    this.getIndex().then(()=>{
-      let queryObject = localStorage.getItem("queryObject");
-      if (queryObject != null) {
-        this.queryObject=JSON.parse(queryObject);
-        this.loadData(JSON.parse(queryObject));
+    this.getIndex().then(() => {
+      let params = localStorage.getItem("queryObject");
+      if (params != null) {
+        this.queryObject = JSON.parse(params);
+        this.loadData();
       }
     });
   },
@@ -310,30 +301,33 @@ export default defineComponent({
 </script>
 
 <style lang="less">
-.search-group{
+.search-group {
   display: flex;
   width: 100%;
   border: 1px solid #f0f0f0;
-  padding:10px;
+  padding: 10px;
   margin-bottom: 10px;
   overflow-y: hidden;
 
-  .search-group-title{
+  .search-group-title {
     width: 120px;
     font-weight: bold;
     border-right: 1px solid #f0f0f0;
     text-align: center;
   }
-  .search-group-item{
+
+  .search-group-item {
     flex: 1;
     display: flex;
     flex-wrap: wrap;
+
     span {
       padding: 0px 10px 5px 10px;
       cursor: pointer;
     }
   }
-  .search-group-expend{
+
+  .search-group-expend {
     border-left: 1px solid #f0f0f0;
     width: 120px;
     cursor: pointer;
@@ -433,15 +427,19 @@ export default defineComponent({
   .search-view-chat {
     display: flex;
     flex-flow: wrap;
-    .search-view-chat-img{
+
+    .search-view-chat-img {
       width: 300px;
     }
+
     .search-chat {
       margin-right: 10px;
     }
-    .search-view-chat-info{
+
+    .search-view-chat-info {
       width: 150px;
-      div{
+
+      div {
         padding: 5px;
       }
     }
@@ -450,6 +448,7 @@ export default defineComponent({
   .search-view-doc {
     display: flex;
     margin-bottom: 5px;
+
     img {
       margin-right: 10px;
     }