Kaynağa Gözat

内部检索检索方式修改

zhuliu 7 ay önce
ebeveyn
işleme
b0b3ece076

+ 4 - 1
src/utils/model/index.js

@@ -32,6 +32,8 @@ import menuInRowItem from "./menuInRow/menuInRowItem.vue"
 //专利附图展示
 import patentImage from "./patentImage/index.vue"
 
+import myTextarea from "./textarea/index.vue"
+
 var models = {
   myCustomSvg,
   myTree,
@@ -60,7 +62,8 @@ var models = {
 
   menuInRow,
   menuInRowItem,
-  patentImage
+  patentImage,
+  myTextarea
 }
 export default {
   install(Vue) {

+ 25 - 9
src/utils/model/search/search.vue

@@ -1,5 +1,5 @@
 <template>
-    <div style="padding:10px">
+    <div style="padding:10px" class="mySearch">
         <!-- 表单检索 -->
         <div>
             <div class="content_border">
@@ -33,14 +33,14 @@
                         <!-- </el-col> -->
                         <!-- 运算符 -->
                         <!-- <el-col :span="3" style="padding:0"> -->
-                            <el-select v-model="list[i].operator" size='small' style="width:150px" v-if="!searchResult">
+                            <!-- <el-select v-model="list[i].operator" size='small' style="width:150px" v-if="!searchResult">
                                 <el-option
                                     v-for="item in operator"
                                     :key="item[operatorProps.value]"
                                     :label="item[operatorProps.label]"
                                     :value="item[operatorProps.value]">
                                 </el-option>
-                            </el-select>
+                            </el-select> -->
                         <!-- </el-col> -->
                         <!-- 搜索值 -->
                         <!-- <el-col :span="9"> -->
@@ -75,7 +75,10 @@
                                             </el-option>
                                         </el-select>
                                     </div>
-                                    <div v-else style="width:100%"><el-input size='small' style="width:100%" v-model="list[i].value" :placeholder="list[i].placeholder"></el-input> </div>
+                                    <div v-else style="width:100%">
+                                        <myTextarea size='small' style="width:100%;" v-model="list[i].value" :placeholder="list[i].placeholder"></myTextarea>
+                                        <!-- <el-input class="autoInput" size='small' style="width:100%;" v-model="list[i].value" :placeholder="list[i].placeholder"></el-input>  -->
+                                    </div>
                                 </slot>
                                
                               
@@ -91,11 +94,11 @@
                     <div style="width:80px" v-if="!searchResult">
                         <!-- <span v-if="list.length==1" style="opacity: 0;"> 内容 </span> -->
                         <span v-if="list.length==1" class="btns"> 
-                            <el-button v-if="searchValue" size="small" @click="add(i)"><i class="el-icon-plus"></i></el-button>
-                            <el-button size="small" @click="deleteList(i)" style="opacity:0"><i class="el-icon-delete"></i></el-button>
+                            <el-button size="small" @click="add(i)"><i class="el-icon-plus"></i></el-button>
+                            <el-button size="small" @click="deleteList(i)" class="pointerEvents" style="opacity:0;"><i class="el-icon-delete"></i></el-button>
                         </span>
                         <span v-else class="btns">
-                            <el-button v-if="searchValue" size="small" @click="add(i)"><i class="el-icon-plus"></i></el-button>
+                            <el-button size="small" @click="add(i)"><i class="el-icon-plus"></i></el-button>
                             <el-button size="small" @click="deleteList(i)"><i class="el-icon-delete"></i></el-button>
                         </span>
                         
@@ -103,7 +106,7 @@
                 </div>
 
             </div>
-            <div class="button_group" v-if="searchValue">
+            <div class="button_group" v-if="showOperate">
                 <!-- <el-button size="small" type="primary" @click="add">增加</el-button> -->
                 <el-button size="small" type="primary" @click="search2">检索</el-button>
                 <el-button size="small" @click="reset">重置</el-button>
@@ -124,8 +127,19 @@
     </div>
 </template>
 <script>
+import myTextarea from '../textarea/index.vue'
 export default {
+    components:{
+        myTextarea
+    },
     props:{
+        //显示操作
+        showOperate:{
+            type:Boolean,
+            default:()=>{
+                return true
+            }
+        },
         //逻辑符
         logical:{
             type:Array,
@@ -513,10 +527,12 @@ export default {
     },
 }
 </script>
+<style lang="scss">
+</style>
 <style lang="scss" scoped>
 .btns{
     display: flex;
-    align-items: center;
+    // align-items: center;
 }
     .content_border{
         width:100%;

+ 89 - 0
src/utils/model/textarea/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <el-input ref="myAutoInput" class="myAutoInput" type="textarea" :autosize="size" resize="none" @focus="focus" @blur="blur" v-bind="$attrs" v-on='$listeners'></el-input>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    autosize:{
+        
+    }
+  },
+  data() {
+    return {
+        textareaDom:null,
+        size:false,
+        height:'30px'
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.init()
+  },
+  methods: {
+    init(){
+        let dom = this.$refs.myAutoInput.$el
+        let childNodes = dom.children
+        let textarea = ''
+        for(let i = 0;i<childNodes.length;i++){
+            let child = childNodes[i]
+            if(child.tagName == 'TEXTAREA'){
+                textarea = child
+            }
+        }
+        this.textareaDom = textarea
+        let height = this.textareaDom.scrollHeight
+        if(height<114){
+            this.height = height + 'px'
+        }
+    },
+    focus(){
+        if(!this.textareaDom){
+            return
+        }
+        
+        this.textareaDom.style.height = this.height
+        this.size = true
+    },
+    blur(){
+        if(!this.textareaDom){
+            return
+        }
+        this.textareaDom.scrollTop = 0
+        this.size = false
+        this.height = this.textareaDom.style.height
+        this.textareaDom.style.height = 'inherit'
+        
+    },
+  },
+};
+</script>
+<style lang="scss">
+    .myAutoInput{
+        width: 100%;
+        height:32px;
+        position: relative;
+        textarea{
+            height: inherit;
+            overflow: hidden;
+            padding: 6px 15px;
+            min-height: 32px !important;
+        }
+        textarea::placeholder{
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow:ellipsis;
+        }
+        textarea:focus{
+            overflow-y: auto;
+            max-height: 114px;
+            position: relative;
+            z-index: 999;
+        }
+    }
+</style>
+<style lang="scss" scoped>
+</style>

+ 86 - 0
src/views/components/import/conditionImport/internal_search/filterDialog.vue

@@ -0,0 +1,86 @@
+<template>
+  <div>
+    <el-dialog
+        title="过滤"
+        :visible.sync="visible"
+        width="500px"
+        :before-close="handleClose"
+        :append-to-body="true" 
+        :close-on-click-modal="false">
+        <div>
+            <myFormSearch ref="myFormSearch" :list="list" :field="field" :searchValue="false" @search="search"></myFormSearch>
+        </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    DBType:{}
+  },
+  data() {
+    return {
+        visible:false,
+        list:[],
+        field:[],
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    open(){
+        this.list = []
+        this.getField()
+        this.visible = true
+    },
+    getField(){
+      var data = JSON.parse(JSON.stringify(this.$constants.searchField))
+      var fields = []
+      for(var i = 0;i<data.length;i++){
+        var item = data[i]
+        if(item.DBType.indexOf(this.DBType)==-1 || item.value == 'project'){
+          continue
+        }
+        var children = []
+        for(var j = 0;j<item.children.length;j++){
+            var child = item.children[j]
+            if(child.value=='GJ' || child.DBType.indexOf(this.DBType)==-1){
+                continue;
+            }
+            children.push(child)
+            if(child.after && child.after.length){
+              children.push(...child.after)
+            }
+        }
+        if(children && children.length>0){
+          fields.push(
+            {
+              ...item,
+              children:children
+            }
+          )
+        }
+      }
+      this.field = fields
+    },
+    handleClose(){
+        this.visible = false
+    },
+    search(val,data){
+        var a = {
+            searchStr: `${val?val:''}`,
+            data:data,
+            isRepeat:true
+        }
+      this.$emit('search',a)
+      this.handleClose()
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 101 - 0
src/views/components/import/conditionImport/internal_search/indexMixins.js

@@ -1,7 +1,108 @@
 
 
 export default{
+    data() {
+        return {
+            projectQuery:{
+                queryParams:{
+                    current:1,
+                    size:10
+                },
+                loading:false,
+                data:[]
+            }
+        }
+    },
     methods: {
+        //检索
+        inputSearch(){
+            this.searchBth()
+            this.refreshCount()
+        },
+        //过滤
+        filterSearch(){
+            this.$refs.filterDialog.open()
+        },
+        initProjectSelect(){
+            if(this.condition.otherCondition.projectId){
+                this.getProjectQuery(this.condition.otherCondition.projectId)
+            }
+        },
+        //切换检索范围
+        changeDBType(){
+            this.inputSearch()
+        },
+        //切换检索数据库
+        changeProject(value){
+            if(!value){
+                this.condition.otherCondition.projectName = null
+                this.inputSearch()
+                return
+            }
+            var obj = this.projectQuery.data.find(item=>{
+                return item.id == value
+            })
+            if(obj){
+                this.condition.otherCondition.projectName = obj.name
+            }
+            this.inputSearch()
+        },
+        getProjectQuery(id){
+            var obj = this.projectQuery
+            obj.data=[]
+            obj.queryParams.current = 1
+            obj.id = id
+            obj.name = ''
+            this.getProject()
+        },
+        //懒加载事件
+        lazyLoading(){
+            var obj = this.projectQuery
+            if(obj.queryParams.current * obj.queryParams.size>=obj.queryParams.total){
+                return false
+            }
+            obj.queryParams.current += 1
+            this.getProject()
+        },
+        //远程搜索
+        remoteMethod(query){
+            var obj = this.projectQuery
+            obj.data=[]
+            obj.queryParams.current = 1
+            obj.name = query.trim()
+            this.getProject()
+        },
+        //获取专题库数据
+        async getProject(){
+            var obj = this.projectQuery
+            obj.loading = true;
+            var str = ''
+            if(obj.name){
+                str+=`name=${obj.name}`
+            }
+            if(obj.id){
+                str+=`id=${obj.id}`
+            }
+            let params = {
+                ...obj.queryParams,//分页信息
+                searchQuery:str,//检索条件
+                orderDTOList: [
+                {
+                    orderBy: "createTime",
+                    orderType: 1
+                },
+                ]//排序
+            }
+            await this.$api.queryPatentProject(params).then(response => {
+                if(response.code == 200){
+                    obj.loading = false;
+                    obj.data.push(...response.data.data)
+                    obj.id = null
+                    obj.queryParams.total = response.data.total
+                }
+            })
+        },
+
         //图表分析
         async handleAnalyses() {
             var params = {

+ 64 - 15
src/views/components/import/conditionImport/internal_search/searchResult_internal.vue

@@ -3,12 +3,12 @@
   <div style="background: white; height: 100%" >
     <el-container>
       <el-aside width="300px">
-        <filter_search ref="filter_search" @customTab="handleCustomFields" :numberQuery="condition.NO" :searchOption="condition.searchCondition" :customFields="customFields" :projectId="conditionObj.projectId?conditionObj.projectId[0]:undefined"></filter_search>
+        <filter_search ref="filter_search" @customTab="handleCustomFields" :numberQuery="condition.NO" :searchOption="condition.searchCondition" :customFields="customFields" :projectId="condition.otherCondition?condition.otherCondition.projectId:undefined"></filter_search>
       </el-aside>
       <el-container>
         <el-header style="height:auto !important;padding:0 !important;">
           <div style="width:100%">
-            <div class="display_flex" style="margin-top: 0px;">
+            <!-- <div class="display_flex" style="margin-top: 0px;">
               <search :field="field" :searchResult="true" :searchValue="false" :countryList="queryParams.countryList"
                 @search="search"></search>
               <div class="display_flex" style="width:calc(100% - 550px);">
@@ -29,13 +29,43 @@
                         <el-dropdown-item @click.native.prevent="searchFinish">
                             检索
                         </el-dropdown-item>
-                        <!-- <el-dropdown-item v-if="condition.reportType==1||condition.reportType == 2||condition.reportType == 3" @click.native.prevent="saveSearchCondition">
-                          保存检索式
-                        </el-dropdown-item> -->
                     </el-dropdown-menu>
                 </el-dropdown>
                 </div>
               </div>
+            </div> -->
+            <div class="display_flex filterCondition">
+              <el-form :inline="true">
+                <el-form-item label="检索范围:">
+                  <el-select size="small" v-model="condition.DBType" @change="changeDBType" style="width:100%"  placeholder="请选择">
+                    <template v-if="condition.DBType == 'inner_WD' || condition.DBType == 'inner_CN'">
+                      <el-option label="中国专利检索(内)" value="inner_CN"></el-option>
+                      <el-option label="全球专利检索(内)" value="inner_DB"></el-option>
+                    </template>
+                    <template v-else>
+                      <el-option label="中国专利检索" value="CN"></el-option>
+                      <el-option label="世界专利检索" value="DB"></el-option>
+                    </template>
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="数据库:" v-if="condition.DBType == 'inner_WD' || condition.DBType == 'inner_CN'">
+                  <el-select size="small" v-model.number="condition.otherCondition.projectId" @change="changeProject" style="width:100%" filterable remote clearable placeholder="请选择" v-SelectLazyLoading="lazyLoading" :remote-method="remoteMethod" @focus="remoteMethod('')">
+                      <el-option
+                          v-for="item in projectQuery.data"
+                          :key="item.id"
+                          :label="item.name"
+                          :value="parseInt(item.id)"
+                      >
+                      </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-form>
+            </div>
+            <div class="display_flex filterCondition">
+              <div class="label">检索条件:</div>
+              <myTextarea size='small' style="width:100%;" v-model="condition.searchCondition"></myTextarea>
+              <el-button type="primary" size="small" class="margin-left_10" @click="inputSearch()">检索</el-button>
+              <el-button type="primary" size="small" @click="filterSearch">过滤</el-button>
             </div>
             <div v-if="filterConditions.length>0" class="display_flex filterCondition">
               <div class="label">筛选条件:</div>
@@ -191,6 +221,8 @@
     <addAndEditSearchRecords ref="addAndEditSearchRecords" :projectId="condition.importToId"></addAndEditSearchRecords>
     <inventionPointDialog v-if="noveltySearch" :projectId="projectId" :retrieveRecordId="retrieveRecordId"  :contrastFileList="saveRemarkList" @updateInventionPoint="getPatentSimilarMess"></inventionPointDialog>
     <reportTemplateDialog ref="reportTemplateDialog"></reportTemplateDialog>
+    <!-- 过滤 -->
+    <filterDialog ref="filterDialog" :DBType="condition.DBType" @search="search"></filterDialog>
   </div>
 </template>
 
@@ -211,6 +243,8 @@ import filter_search from './filter_search.vue';
 
 import PatentKeywordsHighlight from '@/views/project/components/PatentKeywordsHighlight.vue'
 import indexMixins from './indexMixins'
+
+import filterDialog from './filterDialog.vue';
 export default {
   components: {
     PatentTableListView,
@@ -222,7 +256,8 @@ export default {
     addAndEditSearchRecords,
     reportTemplateDialog,
     filter_search,
-    PatentKeywordsHighlight
+    PatentKeywordsHighlight,
+    filterDialog
   },
   mixins:[indexMixins],
   props: {
@@ -312,7 +347,8 @@ export default {
   },
   created() { },
   async mounted() {
-    this.condition.originalCondition = this.condition.searchCondition
+    this.initProjectSelect()
+    this.$set(this.condition,'originalCondition',this.condition.searchCondition)
     this.getField()
     this.columnList = await this.$commonJS.getCustomField('patent',{ projectId: 0, taskId: null })
     if(this.noveltySearch){
@@ -429,7 +465,7 @@ export default {
             outside:this.outside,
             noveltySearch:this.noveltySearch,
             projectId:this.projectId,
-            innerProjectId:this.innerProjectId || 0,
+            innerProjectId:this.innerProjectId || (this.condition.otherCondition?this.condition.otherCondition.projectId:0),
             retrieveRecordId:this.queryParams.retrieveRecordId
           }
         }
@@ -438,8 +474,8 @@ export default {
     // 统计组件传的值
     handleCustomFields(val) {
       this.filterConditions.push(...val)
-      var str = this.getConditionStrByCount(val)
-      this.condition.searchCondition = `${this.condition.searchCondition} AND ${str}`
+      // var str = this.getConditionStrByCount(val)
+      // this.condition.searchCondition = `${this.condition.searchCondition} AND ${str}`
       this.searchBth()
       this.refreshCount()
     },
@@ -492,7 +528,7 @@ export default {
         return false
       }
       if (val.isRepeat) {
-        this.condition.searchCondition = `${this.condition.searchCondition} AND ${val.searchStr}`
+        // this.condition.searchCondition = `${this.condition.searchCondition} AND ${val.searchStr}`
         // this.condition.showCondition = `${this.condition.showCondition} AND ${val.searchStr}`
         this.getFilterCondition(val)
       } else {
@@ -502,7 +538,8 @@ export default {
         }
         this.condition.searchCondition = searchStr
         this.condition.showCondition = searchStr
-        this.condition.originalCondition = searchStr
+        // this.condition.originalCondition = searchStr
+        this.$set(this.condition,'originalCondition',searchStr)
         this.changeOriginalCondition(val)
       }
       this.refreshCount()
@@ -528,7 +565,7 @@ export default {
             value.push(
               {
                 search: item.value,
-                show: item.show.value
+                show: item.show.value || item.value
               }
             )
           }
@@ -651,7 +688,7 @@ export default {
       }
       var params = {
         stringRequest:{
-          projectId: this.innerProjectId,
+          projectId: this.innerProjectId || (this.condition.otherCondition?this.condition.otherCondition.projectId:''),
           searchQuery: this.condition.searchCondition || '',
           orderDTOList:this.sort,
         },
@@ -768,16 +805,28 @@ export default {
     },
     //查询内部数据库数据
     async getInnerProjectPatent(){
+      var searchQuery = this.getConditionStrByCount(this.filterConditions||[])
+      if(this.condition.searchCondition){
+        if(searchQuery){
+          searchQuery = `${this.condition.searchCondition} AND ${searchQuery}`
+        }else{
+          searchQuery = `${this.condition.searchCondition}`
+        }
+      }
+      
       let params = {
         current: this.queryParams.current, //页码(最多 200 页)
         size: this.queryParams.size, //每页返回条数(最多 50 条)
         projectId: this.innerProjectId,
-        searchQuery: this.condition.searchCondition || '',//检索条件
+        searchQuery: searchQuery,//检索条件
         semanteme:this.semanteme,
         //专利号检索
         numberQuery:this.condition.NO,
         redisKey:this.condition.redisKey,
       }
+      if(this.condition.otherCondition && this.condition.otherCondition.projectId){
+        params.projectId = this.condition.otherCondition.projectId
+      }
       if(this.queryParams.OrderBy && this.queryParams.OrderByType){
         var orderDTOList = [
           {

+ 5 - 4
src/views/components/import/conditionImport/search.vue

@@ -321,11 +321,12 @@ export default {
                 DBType:this.DBType,
                 retrieveRecordId:null,
                 type:4,
+                otherCondition:data.otherCondition||{}
             }
-            if(data.otherCondition){
-                a.searchCondition = data.otherCondition.search + (val?` AND ${val}`:'')
-                a.showCondition = data.otherCondition.show + (val?` AND ${val}`:'')
-            }
+            // if(data.otherCondition){
+            //     a.searchCondition = data.otherCondition.search + (val?` AND ${val}`:'')
+            //     a.showCondition = data.otherCondition.show + (val?` AND ${val}`:'')
+            // }
             if(data.component == 'patentNoSearch'){
                 a.NO = data.data
                 a.component = 'patentNoSearch'