zhuliu 7 months ago
parent
commit
4a708fbf05

+ 29 - 12
src/views/components/import/conditionImport/internal_search/searchResult_internal.vue

@@ -395,12 +395,23 @@ export default {
       this.field = fields
     },
     //解析检索式
-    analyzingCondition(){
+    analyzingCondition(sign){
+      var conditionObj = {}
       if(this.condition && this.condition.searchCondition){
-        var conditionObj = this.$commonJS.extractFieldsAndValues(this.condition.searchCondition)
-        this.conditionObj = conditionObj
-        console.log(conditionObj)
+        conditionObj = this.$commonJS.extractFieldsAndValues(this.condition.searchCondition) || {}
       }
+      if(this.filterConditions && this.filterConditions.length){
+        this.filterConditions.forEach((item,index)=>{
+          if(!conditionObj[item.field.search]){
+            conditionObj[item.field.search] = []
+          }
+          conditionObj[item.field.search].push(...item.value.map(value=>`"${value.search}"`))
+        })
+      }
+      if(sign){
+        return conditionObj
+      }
+      this.conditionObj = conditionObj
     },
     //查询对比文件
     queryComparePatent(){
@@ -424,7 +435,7 @@ export default {
     //保存检索式
     saveSearchCondition(){
       var form = {
-        searchCondition:this.condition.searchCondition,
+        searchCondition:this.getConditionStr(),
         searchBase:'小世系统',
         allNum:this.total,
         searchPerson:this.userinfo.name,
@@ -443,7 +454,7 @@ export default {
       }
       if(!this.outside){
         search.searchOption = {
-          searchQuery: this.condition.searchCondition || '',
+          searchQuery: this.getConditionStr() || '',
           moreConditions:true
         }
         if(this.queryParams.OrderBy && this.queryParams.OrderByType){
@@ -511,8 +522,8 @@ export default {
       }else{
         this.filterConditions.splice(index,1)
       }
-      var str = this.getConditionStrByCount(this.filterConditions)
-      this.condition.searchCondition = `${this.condition.originalCondition}` + (str?` AND ${str}`:'')
+      // var str = this.getConditionStrByCount(this.filterConditions)
+      // this.condition.searchCondition = `${this.condition.originalCondition}` + (str?` AND ${str}`:'')
       this.searchBth()
       this.refreshCount()
     },
@@ -690,7 +701,7 @@ export default {
       var params = {
         stringRequest:{
           projectId: this.innerProjectId || (this.condition.otherCondition?this.condition.otherCondition.projectId:''),
-          searchQuery: this.condition.searchCondition || '',
+          searchQuery: this.getConditionStr() || '',
           orderDTOList:this.sort,
         },
         startNumber:1, //开始位置
@@ -804,8 +815,9 @@ export default {
         this.queryParams.endNumber = this.total
       }
     },
-    //查询内部数据库数据
-    async getInnerProjectPatent(){
+
+    //获取检索式字符串
+    getConditionStr(){
       var searchQuery = this.getConditionStrByCount(this.filterConditions||[])
       if(this.condition.searchCondition){
         if(searchQuery){
@@ -814,6 +826,11 @@ export default {
           searchQuery = `${this.condition.searchCondition}`
         }
       }
+      return searchQuery
+    },
+    //查询内部数据库数据
+    async getInnerProjectPatent(){
+      var searchQuery = this.getConditionStr()
       
       let params = {
         current: this.queryParams.current, //页码(最多 200 页)
@@ -879,7 +896,7 @@ export default {
       var params = {
         // CurrentQuery: this.searchData.searchCondition, //检索式
         // DBType: this.searchData.DBType, //”CN”或”WD”,表示检索中文库或世界库
-        CurrentQuery: this.condition.searchCondition, //检索式
+        CurrentQuery: this.getConditionStr(), //检索式
         DBType: this.condition.DBType, //”CN”或”WD”,表示检索中文库或世界库
         PageNum: this.queryParams.current, //页码(最多 200 页)
         RowCount: this.queryParams.size, //每页返回条数(最多 50 条)