zhuliu há 9 meses atrás
pai
commit
d64e29764d

+ 2 - 2
src/utils/model/menuInRow/index.vue

@@ -36,7 +36,7 @@
 <script>
 async function menuInRowFun(el,binding,childNodes){
   el.style.whiteSpace = 'nowrap';
-  el.style.width = 'calc(100% - 60px)'
+//   el.style.width = 'calc(100% - 60px)'
   var el_width = el.clientWidth
   
   var width = 0
@@ -58,7 +58,7 @@ async function menuInRowFun(el,binding,childNodes){
   }
   surplusNum = childNodes.length - num
   binding.value(num,surplusNum)
-  el.style.width = width - widths[num-1] + 20 + 'px'
+//   el.style.width = width - widths[num-1] - 20 + 'px'
 }
 function getMenuItem(el, binding,vnode){
     var that = vnode.context

+ 71 - 0
src/views/components/import/conditionImport/internal_search/filter_search.vue

@@ -0,0 +1,71 @@
+<template>
+  <div class="filter_search height_100">
+    <div class="head">
+        筛选条件
+    </div>
+    <div class="main">
+        <tab1 refs="tab1" :conditions="conditions" :projectId="projectId"></tab1>
+    </div>
+    <div class="head foot" @click="search">
+        筛选
+    </div>
+  </div>
+</template>
+
+<script>
+import tab1 from './tab1.vue';
+export default {
+  components: {
+    tab1
+  },
+  props: {},
+  data() {
+    return {
+        conditions:{},
+        projectId:5503
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    search(){
+        // var data = this.$refs.tab1.getConditions()
+        console.log(this.conditions)
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.filter_search{
+    .head{
+        height: 30px;
+        padding: 15px;
+        background: var(--bg);
+        color: var(--color);
+        text-align: center;
+        line-height: 30px;
+        font-size: 16px;
+        font-weight: bold;
+    }
+    .main{
+        height: calc(100% - 140px);
+        padding: 10px 0;
+        overflow-x: hidden;
+        overflow-y: auto;
+        -ms-overflow-style: none; /* IE 和 Edge */
+        scrollbar-width: none; /* Firefox */
+        &::-webkit-scrollbar {
+            display: none; /* Chrome, Safari, Opera */
+        }
+    }
+    .foot{
+        // height: 50px;
+        cursor: pointer;
+        &:hover{
+            background: #1fb9ef;
+        }
+    }
+}
+</style>

+ 488 - 0
src/views/components/import/conditionImport/internal_search/mixins.js

@@ -0,0 +1,488 @@
+export default{
+    props: {
+        conditions:{
+          type:Object,
+          default:()=>{
+            return {}
+          }
+        },
+        projectId:{
+    
+        }
+      },
+    data() {
+        return {
+            activeNames:[],
+            field:[
+                {
+                    "name": "公开日",
+                    "type": "DateTime",
+                    "value": "PD",
+                    "ifStats": true,
+                    "ifGroup": true,
+                    "filedKind": -1,
+                    "field": "PD",
+                    "groupBy": "dateType"
+                },
+                {
+                    "name": "申请日",
+                    "type": "DateTime",
+                    "value": "AD",
+                    "ifStats": true,
+                    "ifGroup": true,
+                    "filedKind": -1,
+                    "field": "AD",
+                    "groupBy": "dateType"
+                },
+                {
+                    "name": "授权日",
+                    "type": "DateTime",
+                    "value": "GD",
+                    "ifStats": true,
+                    "ifGroup": true,
+                    "filedKind": -1,
+                    "field": "GD",
+                    "groupBy": "dateType"
+                },
+                {
+                    "name": "申请人",
+                    "type": "Array",
+                    "value": "PA",
+                    "ifStats": true,
+                    "ifGroup": true,
+                    "filedKind": -1,
+                    "defaultShowStats": true,
+                    "field": "PA",
+                    "groupBy": "company"
+                },
+                {
+                    "name": "法律状态",
+                    "type": "String",
+                    "value": "SS",
+                    "ifStats": true,
+                    "ifGroup": true,
+                    "filedKind": -1,
+                    "field": "SS",
+                    "groupBy": "typeStatus",
+                    "optionValue": [
+                        {
+                            "label": "有效",
+                            "value": "1"
+                        },
+                        {
+                            "label": "无效",
+                            "value": "2"
+                        },
+                        {
+                            "label": "审中",
+                            "value": "3"
+                        }
+                    ]
+                },
+                {
+                    "name": "IPC分类号",
+                    "type": "Object",
+                    "value": "MIPC",
+                    "ifStats": true,
+                    "ifGroup": true,
+                    "filedKind": -1,
+                    "field": "MIPC",
+                    "groupBy": "classify",
+                    "children": [
+                        {
+                            "label": "IPC部",
+                            "type": "1",
+                            "value": "IC1",
+                            "group": "nos"
+                        },
+                        {
+                            "label": "IPC大类",
+                            "type": "1",
+                            "value": "IC2",
+                            "group": "nos"
+                        },
+                        {
+                            "label": "IPC小类",
+                            "type": "1",
+                            "value": "IC3",
+                            "group": "nos"
+                        },
+                        {
+                            "label": "IPC大组",
+                            "type": "1",
+                            "value": "IC4",
+                            "group": "nos"
+                        },
+                        {
+                            "label": "IPC",
+                            "type": "1",
+                            "value": "IC",
+                            "group": "nos"
+                        }
+                    ]
+                }
+            ],
+        }
+    },
+    methods: {
+        //刷新栏位
+        async refreshField(){
+           
+        },
+        // 条件改变时刷新已打开的折叠面板
+        refreshOptions(sign) {
+            for(let i = 0;i<this.field.length;i++){
+                var index = this.activeNames.indexOf(i)
+                if(index==-1){
+                    continue
+                }
+                let row = this.field[i]
+                row.optionsLength = 0
+                this.getOptions(row)
+            }
+        },
+        //点击折叠面板打开
+        clickItem(item,index){
+            var index1 = this.activeNames.indexOf(index)
+            if(index1 == -1){
+                return 
+            }
+            if(item.options && item.options.length>0){
+                return
+            }
+            this.handleSearch(item)
+        },
+        //获取显示的名称
+        getValueName(item,name){
+          if(item.optionValue){
+            var obj = item.optionValue.find(item=>{
+              return item.value == name
+            })
+            if(obj){
+              return obj.label
+            }
+          }
+          return name
+        },
+        // 点击折叠面板中的搜索
+        handleSearch(row) {
+          row.optionsLength = 0
+          this.getOptions(row)
+        },
+        //获取选项
+        async getOptions(row,sign) {
+          if(!sign){
+            row.topN = 10
+          }
+          this.handleSelectCancel(row)
+          if (row) {
+            if (row.filedKind != -1 && (row.type == 'Array' || row.type == 'tree')) {
+              if (row.filedKind == 0) {
+                this.$set(row,'loading',true)
+                const [num, option] = await Promise.allSettled([this.esCountAnalysis(row), this.queryCustomOption(row)])
+                var nums = num.status == 'fulfilled' ? num.value.detailDTOS : []
+                var options = option.status == 'fulfilled' ? option.value : []
+                var obj = nums.find(item=>{
+                  return item.name == '未选择'
+                })
+                if(obj && obj.number!=0){
+                  options.push(
+                    {
+                      id: "未选择",
+                      name: "未选择",
+                      customFieldId:row.value
+                    }
+                  )
+                }
+                this.$set(row, 'options', options)
+                this.$set(row,'loading',false)
+                if (!sign) {
+                 this.$set(row, 'check', []) 
+                }
+                
+                this.$set(row, 'nums', nums)
+              } else {
+                var type = {
+                  7: '2',//2产品
+                  8: '1',//1产品类别
+                  9: '3'// 3技术分类
+                }
+                const [num,option] = await Promise.allSettled([this.esCountAnalysis(row),this.queryProductCategory(row,type[row.filedKind])])
+                var nums = num.status == 'fulfilled' ? num.value.detailDTOS : []
+                var options = option.status == 'fulfilled' ? option.value : []
+                this.$set(row, 'options', options)
+                if (!sign) {
+                 this.$set(row, 'check', []) 
+                }
+                this.$set(row, 'nums', nums)
+              }
+            } else {
+              this.$set(row,'loading',true)
+              const [num] = await Promise.allSettled([this.esCountAnalysis(row)])
+              var nums = num.status == 'fulfilled' ? num.value.detailDTOS : []
+              for(var i = 0;i<nums.length;i++){
+                if(nums[i].name == '其他'){
+                  nums.splice(i,1)
+                  break;
+                }
+              }
+              this.$set(row, 'options', nums)
+              this.$set(row,'loading',false)
+              if (!sign) {
+                this.$set(row, 'check', []) 
+              }
+              if(nums.length>0){
+                row.optionsLength = num.value.remainingNum
+              }else{
+                row.optionsLength = 0
+              }
+              if(row.optionsLength == 0){
+                this.$set(row, 'isShowBtn', false)
+              }else{
+                this.$set(row, 'isShowBtn', true)
+              }
+            }
+          }
+        },
+        async esCountAnalysis(row) {
+          var countVOS = []
+          if (row.filedKind == -1) {//专利本身栏位(专利著录)
+            let value = (row.children && row.children.length>0) ? row.select : row.value
+            countVOS = [
+              {
+                field: value,
+                valueOne: row.valueOne,
+                valueTwo: row.valueTwo,
+                topN: row.topN,
+                // fieldType: row.type
+              }
+            ]
+          } else {//
+            countVOS = [
+              {
+                field: 'field',
+                fieldId: row.value,
+                valueOne: row.valueOne,
+                valueTwo: row.valueTwo,
+                topN: 9999,//自定义栏位没有加载更多
+                ifHaveChild: row.type == 'tree' ? this.ifHaveChild : false,
+                fieldType: row.type
+              },
+            ]
+          }
+    
+          let params = {
+            condition: this.searchOption || '',//检索条件
+            projectId: this.projectId,//项目id
+            taskId: this.taskId,//任务id
+            countVOS: countVOS,//栏位的聚合入参
+            customFields: this.customFields,//自定义栏位查询
+            groupField:this.groupField,
+          }
+          return await this.$api.esCountAnalysis(params).then(res => res.data)
+        },
+        // 查询自定义栏位选项数据
+        async queryCustomOption(row) {
+          let params = {
+            customFieldId: row.value,
+          }
+          return await this.$api.queryCustomOption(params).then(response => response.data.data)
+        },
+        //获取产品或产品类别架构以及技术分类
+        async queryProductCategory(item, type) {
+          let params = {
+            projectId: this.projectId,
+            taskId: this.taskId,
+            type: type,//类型:1产品类别,2产品,3技术分类,4自定义树
+            typeId: item.value,//产品或类别id
+          }
+          return await this.$api.queryTreeNodeTree(params).then(response => response.data.data)
+        },
+        /**
+         * 获取子组件选择的值
+         * @param {*} value //选中的选项值
+         * @param {*} row //选择选项所属栏位
+         * @param {*} checked //是否选中
+         * @param {*} name //树形属性选中的选项名称
+         */
+        checkData(value,row,checked,name) {
+          if(checked){
+            var obj = {
+              field:{
+                filedKind:row.filedKind,
+                groupBy:row.groupBy,
+                search:(row.children && row.children.length>0)?row.select:row.value,
+                show:null
+              },
+              value:{
+                search:value
+              },
+            }
+            //获取检索栏位信息
+            if(!this.conditions[obj.field.search]){
+              if(row.children && row.children.length>0){
+                var obj1 = row.children.find(item=>{
+                  return item.value == row.select
+                })
+                if(obj1){
+                  obj.field.show = obj1.label
+                }else{
+                  obj.field.show = row.name
+                }
+              }else{
+                obj.field.show = row.name
+              }
+            }
+            //获取检索值信息
+            if(row.filedKind == -1){
+              if(row.optionValue && row.optionValue.length>0){
+                var obj2 = row.optionValue.find(item1=>{
+                    return item1.value == value
+                })
+                if(obj2){
+                  obj.value.show = obj2.label
+                }else{
+                  obj.value.show = value
+                }
+                
+              }else{
+                obj.value.show = value
+              }
+            }else{
+              var obj2 = row.options.find(item1=>{
+                return item1.id == value
+              })
+              if(obj2){
+                obj.value.show = obj2.name
+              }else{
+                obj.value.show = value
+              }
+            }
+    
+            if(name){
+              obj.name = name
+            }
+    
+            if(this.conditions[obj.field.search]){
+              this.conditions[obj.field.search].value.push(obj.value)
+            }else{
+              this.conditions[obj.field.search] = {
+                field:obj.field,
+                value:[obj.value],
+                op:row.groupBy=='company'?'≡':'='
+              }
+            }
+          }else {
+            var searchField = (row.children && row.children.length>0)?row.select:row.value
+            var condition = this.conditions[searchField]
+            if(!condition){
+              return
+            }
+            var values = condition.value
+            var index = values.findIndex(item => {
+              return item.search == value
+            })
+            if (index != -1) {
+              values.splice(index,1)
+            }
+    
+            if(values.length == 0){
+              delete this.conditions[searchField]
+            }
+          }
+        },
+         // 全选
+         handleSelectAll(val) {
+          //勾选状态
+          if (val.filedKind == -1) {//专利本身的全选
+            val.check = val.options.map(item => {
+              return item.name
+            })
+          } else {//其他
+            val.check = val.options.map(item => {
+              return item.id
+            })
+          }
+    
+          var field = {
+            filedKind:val.filedKind,
+            groupBy:val.groupBy,
+            search:(val.children && val.children.length>0)?val.select:val.value,
+            show:null
+          }
+          if(!this.conditions[field.search]){
+            if(val.children && val.children.length>0){
+              var obj1 = val.children.find(item=>{
+                return item.value == val.select
+              })
+              if(obj1){
+                field.show = obj1.label
+              }else{
+                field.show = val.name
+              }
+            }else{
+              field.show = val.name
+            }
+            this.conditions[field.search] = {
+              field:field,
+              value:[],
+              op:val.groupBy=='company'?'≡':'='
+            }
+          }
+          
+          var values = []
+          for(var i = 0;i<val.check.length;i++){
+            var value = val.check[i]
+            var valueObj = {
+              search:value
+            }
+            if(val.filedKind == -1){
+              if(val.optionValue && val.optionValue.length>0){
+                var obj2 = val.optionValue.find(item1=>{
+                    return item1.value == value
+                })
+                if(obj2){
+                  valueObj.show = obj2.label
+                }else{
+                  valueObj.show = value
+                }
+                
+              }else{
+                valueObj.show = value
+              }
+            }else{
+              var obj2 = val.options.find(item1=>{
+                return item1.id == value
+              })
+              if(obj2){
+                valueObj.show = obj2.name
+              }else{
+                valueObj.show = value
+              }
+            }
+            values.push(valueObj)
+          }
+          this.conditions[field.search].value = values
+    
+        },
+        // 取消
+        handleSelectCancel(row) {
+          this.$set(row,'check',[])
+          var searchField = (row.children && row.children.length>0)?row.select:row.value
+          var condition = this.conditions[searchField]
+          if(!condition){
+            return
+          }
+          delete this.conditions[searchField]
+        },
+        // 加载更多
+        handleLoading(val) {
+          val.topN += 10
+          this.getOptions(val,1)
+        },
+        //  专利IPC/CPC/UPC/LOC的选项变化
+        selectChange(val, data) {
+          this.getOptions(data)
+        },
+      },
+}

+ 9 - 3
src/views/components/import/conditionImport/searchResult_internal.vue

@@ -2,7 +2,9 @@
   <div style="background: white; height: 100%">
 
     <el-container>
-      <el-aside width="200px"></el-aside>
+      <el-aside width="300px">
+        <filter_search></filter_search>
+      </el-aside>
       <el-container>
         <el-header style="height:auto !important;padding:0 !important;">
           <div style="width:100%">
@@ -90,10 +92,13 @@ import PatentTableListView from "@/views/project/patentCollection/components/vie
 import PatentAbstractListView from "@/views/project/patentCollection/components/views/Abstract";
 import PatentPictureListView from "@/views/project/patentCollection/components/views/Picture";
 import field from '@/views/components/dialog/fields.vue';
-import projectListDialog from "./components/projectListDialog.vue";
+import projectListDialog from "../components/projectListDialog.vue";
 import search from '@/utils/model/search/search.vue'
 import addAndEditSearchRecords from '@/views/report/analysisAndOpinion/components/searchRecords/dialog/addAndEditSearchRecords.vue';
 import reportTemplateDialog from '@/views/noveltySearch/components/dialog/reportTemplate/reportTemplateDialog.vue';
+
+
+import filter_search from './filter_search.vue';
 export default {
   components: {
     PatentTableListView,
@@ -103,7 +108,8 @@ export default {
     projectListDialog,
     search,
     addAndEditSearchRecords,
-    reportTemplateDialog
+    reportTemplateDialog,
+    filter_search
   },
   props: {
     searchData: {},

+ 125 - 0
src/views/components/import/conditionImport/internal_search/tab1.vue

@@ -0,0 +1,125 @@
+<template>
+  <div class="height_100">
+    <template v-if="field.length > 0">
+      <el-collapse v-model="activeNames" style="margin: 0px 5px 0px 5px;">
+        <el-collapse-item v-for="(item,index) in field" :title="item.name" :name="index" :key="item.value" @click.native="clickItem(item,index)">
+          <!-- 专利本身 -->
+          <template>
+            <div v-if="item.optionValue && item.optionValue.length>0" style="display: flex;align-items: center;">
+              <el-select v-model="item.valueOne"  placeholder="请选择" size="small" clearable>
+                  <el-option v-for="item in item.optionValue" :key="item.value" :label="item.label" :value="item.value"></el-option>
+              </el-select>
+              <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10" icon="el-icon-search" circle></el-button>
+            </div>
+            <template v-else>
+              <div v-if="item.children && item.children.length>0" style="margin-bottom: 10px;">
+                <el-select v-model="item.select" @change="selectChange($event, item)" placeholder="请选择" size="small">
+                  <el-option v-for="item in item.children" :key="item.value" :label="item.label"  :value="item.value"></el-option>
+                </el-select>
+              </div>
+              <div style="display: flex;align-items: center;">
+                <template v-if="item.type == 'DateTime'">
+                  <div>
+                    <el-date-picker clear-icon v-model="item.valueOne" size="small" type="year" value-format="yyyy" placeholder="请选择开始时间"></el-date-picker>
+                    <div style="margin: 5px;">至</div>
+                    <el-date-picker clear-icon v-model="item.valueTwo" size="small" type="year" value-format="yyyy" placeholder="请选择结束时间"></el-date-picker>
+                  </div>
+                  
+                </template>
+                <template v-else>
+                  <el-input size="small" v-model="item.valueOne" placeholder="请输入内容"></el-input>
+                </template>
+                <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10"  icon="el-icon-search" circle></el-button>
+              </div>
+            </template>
+            
+            <div class="content_list" v-loading="item.loading">
+              <el-checkbox-group v-model="item.check">
+                <div class="source-checkbox">
+                  {{ item.value }}
+                  <el-checkbox v-for="source in item.options" :label="source.name" :key="source.name" @change="(val)=>checkData(source.name,item,val)">
+                    <myTooltip :content="source.name" placement="top" effect="light">
+                      <span class="source-checkbox-label text noWrap" :title="source.name">
+                        {{ getValueName(item,source.name) }}
+                      </span>
+                    </myTooltip>
+                    <span class="source-checkbox-count">({{ source.number }})</span>
+                  </el-checkbox>
+                </div>
+              </el-checkbox-group>
+            </div>
+          </template>
+
+          <div class="patent-query-filter-search-bottom">
+            <el-button type="success" size="small" @click.stop="handleSelectAll(item)">全选</el-button>
+            <el-button type="danger" size="small" @click.stop="handleSelectCancel(item)">取消</el-button>
+            <el-button v-if="item.isShowBtn" type="primary" size="small"
+              @click.stop="handleLoading(item)">加载更多</el-button>
+          </div>
+        </el-collapse-item>
+      </el-collapse>
+    </template>
+    <template v-else>
+      <div>暂无数据</div>
+    </template>
+  </div>
+</template>
+
+<script>
+import mixins from './mixins'
+export default {
+  components: {},
+  mixins:[mixins],
+  props: {},
+  data() {
+    return {
+      
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods:{}
+};
+</script>
+<style lang="scss">
+.source-checkbox {
+  // margin-top: 10px;
+
+  span {
+    display: inline-block;
+    font-size: 13px;
+  }
+
+  .el-checkbox {
+    display: block;
+  }
+
+  .el-checkbox__label {
+    position: relative;
+    top: 5px;
+  }
+
+  .source-checkbox-count {
+    color: #409EFF;
+    position: relative;
+    top: -4px;
+    left: 10px;
+  }
+
+  .source-checkbox-label {
+    max-width: 190px;
+    padding-left: 5px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+}
+</style>
+<style lang="scss" scoped>
+.patent-query-filter-search-bottom {
+  text-align: center;
+  margin-top: 10px;
+}
+</style>

+ 1 - 1
src/views/components/import/conditionImport/searchResultIndex.vue

@@ -6,7 +6,7 @@
 
 <script>
 // import searchResult from './searchResult.vue';
-import searchResult from './searchResult_internal.vue';
+import searchResult from './internal_search/searchResult_internal.vue';
 export default {
   components: {
     searchResult