zhuliu пре 1 година
родитељ
комит
51b20dab0b

+ 2 - 2
src/utils/model/retrieval/search.vue

@@ -39,8 +39,8 @@
           <div v-for="(item, index) in searchOptions" :key="item.value" class="box">
             <el-alert type="success" :closable="false">
               <div class="content">
-                <div class="color-black">{{ item.label }}</div>
-                <b class="padding-right_10">AND</b>
+                <span class="color-black">{{ item.label }}</span>
+                <b class="padding_0_5">=</b>
                 <span class="color-black">
                   <span v-if="item.type == 3">
                     <span class="padding_0_5">(</span>

+ 17 - 13
src/views/components/drawer/Field.vue

@@ -96,7 +96,8 @@
                 node-key="id"
                 default-expand-all
                 :expand-on-click-node="false"
-                draggable
+                :draggable="false"
+                :props='treeProps'
                 @node-drop="handleDrop"
             >
               <div class="custom-tree-node" slot-scope="{ node, data }">
@@ -143,6 +144,9 @@ export default {
   },
   data() {
     return {
+      treeProps:{
+        children:'child'
+      },
       optionDialogWidth: '500px',
       lockOption: false,
       valueChange: false,
@@ -275,7 +279,7 @@ export default {
         return false
       }
       this.optionLoading = true
-      this.$api.deleteCustomOption({ id: item.id, type: this.ruleForm.type }).then(response => {
+      this.$api.deleteCustomOption([{ id: item.id, customFieldId: this.ruleForm.id }]).then(response => {
         this.ruleForm.option.splice(index, 1)
         this.$message.success('操作成功')
         this.optionLoading = false
@@ -306,15 +310,15 @@ export default {
     },
     handleDeleteTreeNode(node, data) {
       const parent = node.parent
-      const children = parent.data.children || parent.data
+      const child = parent.data.child || parent.data
       if (!data.id) {
-        children.splice(children.findIndex(d => d.$treeNodeId === data.$treeNodeId), 1)
+        child.splice(child.findIndex(d => d.$treeNodeId === data.$treeNodeId), 1)
         this.lockOption = false
         return false
       }
       this.optionLoading = true
-      this.$api.deleteCustomOption({ id: data.id, type: this.ruleForm.type }).then(response => {
-        children.splice(children.findIndex(d => d.id === data.id), 1)
+      this.$api.deleteCustomOption([{ id: data.id, customFieldId: this.ruleForm.id }]).then(response => {
+        child.splice(child.findIndex(d => d.id === data.id), 1)
         this.$message.success('操作成功')
         this.optionLoading = false
         this.lockOption = false
@@ -326,15 +330,15 @@ export default {
       if (this.lockOption) {
         return false
       }
-      if (!data.children) {
-        this.$set(data, 'children', [])
+      if (!data.child) {
+        this.$set(data, 'child', [])
       }
-      const lastIndex = data.children.length - 1
-      data.children.push({
+      const lastIndex = data.child.length - 1
+      data.child.push({
         name: '',
         parentId: data.id,
-        order: lastIndex < 0 ? 0 : data.children[lastIndex].order + 1,
-        children: [],
+        order: lastIndex < 0 ? 0 : data.child[lastIndex].order + 1,
+        child: [],
       })
       this.lockOption = true
       this.$forceUpdate()
@@ -390,7 +394,7 @@ export default {
           name: '',
           parentId: 0,
           order: lastIndex < 0 ? 0 : this.ruleForm.option[lastIndex].order + 1,
-          children: [],
+          child: [],
         })
       } else {
         this.ruleForm.option.push({

+ 6 - 3
src/views/event/components/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="height_100">
-    <el-container>
+    <el-container v-if="showView">
       <el-header>
         <div>
           <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
@@ -86,7 +86,7 @@ export default {
   },
   props: {
     eventName:'',
-    applicationScenario:null,
+    scenarioId:null,
     isOperate:''
   },
   data() {
@@ -94,7 +94,10 @@ export default {
       //检索字段
       searchFiled: [],
       //检索条件
-      searchOption: { },
+      searchOption: {
+        scenarioId:this.scenarioId,
+        name:this.eventName
+      },
       //分组的值
       groupingValue: '',
       //分组

+ 3 - 3
src/views/layout/components/UserBar.vue

@@ -152,7 +152,7 @@ export default {
           value:'3',
           label:'事件',
           path:'/Event',
-          belong:'event'
+          belong:'Event'
         },
         {
           value:'1',
@@ -164,13 +164,13 @@ export default {
           value:'4',
           label:'报告',
           path:'/AllReport',
-          belong:'report'
+          belong:'AllReport'
         },
         {
           value:'2',
           label:'产品',
           path:'/product',
-          belong:'product'
+          belong:'Product'
         },
         {
           value:'6',

+ 132 - 0
src/views/project/patentCollection/components/filter/Folder.vue

@@ -0,0 +1,132 @@
+<template>
+  <div class="patent-folder-filter">
+    <div class="patent-folder-filter-option">
+      <el-input :style="{ width: true ? '180px' : '220px'}" v-model="queryParams.name" placeholder="请输入文件夹名称" size="small"></el-input>
+      <div class="float_right">
+        <el-button type="primary" size="small" icon="el-icon-search" circle @click="handleSearch"></el-button>
+        <el-button type="success" size="small" icon="el-icon-edit" circle @click="handleManage" :disabled="!($permission('/workspace/common/folder_manage') && $r(projectId,[1,2]))"></el-button>
+      </div>
+    </div>
+    <el-tree
+        v-if="refresh"
+        class="folder-tree"
+        @node-click="handleSelect"
+        ref="patentFolderFilterTree"
+        :data="folder"
+        node-key="id"
+        default-expand-all
+        check-strictly
+        :expand-on-click-node="false"
+        highlight-current
+        :current-node-key="activeItem"
+    >
+      <div class="custom-filter-tree-node" slot-scope="{ node, data }">
+        <span class="name">{{ data.name }}</span>
+        <span class="total">(<span>{{ data.total }}</span>)</span>
+      </div>
+    </el-tree>
+    <folder-dialog @close="close" ref="folderDialog" />
+  </div>
+</template>
+
+<script>
+import FolderDialog from '../../../components/dialog/Folder'
+
+export default {
+  components: {
+    FolderDialog,
+  },
+  data() {
+    return {
+      folder: [],
+      queryParams: {
+        name: '',
+        projectId: 0,
+        patentTotal: true
+      },
+      activeItem: 0,
+      refresh: true
+    }
+  },
+  computed: {
+    projectId() {
+      return this.$store.state.patent.projectId
+    },
+    queryData() {
+      return this.$store.state.patent.queryData
+    }
+  },
+  mounted() {
+    this.queryParams.projectId = this.projectId
+    this.getList()
+  },
+  methods: {
+    updateQueryDataFolder(data) {
+      this.$store.commit('SET_PATENT_QUERY_DATA', [])
+      const index = this.queryData.map(item => item.type).indexOf('folder')
+      const value = {
+        data: [{
+          value: data.id,
+          label: data.name,
+        }],
+        type: 'folder',
+        key: 'folder',
+        name: '文件夹'
+      }
+      if (index === -1) {
+        this.queryData.push(value)
+      } else {
+        this.$set(this.queryData, index, value)
+      }
+    },
+    handleSelect(data) {
+      this.activeItem = data.id
+      this.updateQueryDataFolder(data)
+      this.$emit('on-change', data.id)
+    },
+    close() {
+      this.getList()
+    },
+    getList() {
+      this.refresh = false
+      this.$api.getProjectFolderList(this.queryParams).then(response => {
+        this.folder = response.data
+        this.$nextTick(() => {
+          this.refresh = true
+        })
+      })
+    },
+    refreshView() {
+      this.activeItem = 0
+      this.refresh = false
+      this.$nextTick(() => {
+        this.refresh = true
+      })
+    },
+    handleSearch() {
+      this.getList()
+    },
+    handleManage() {
+      this.$refs.folderDialog.open(this.queryParams.projectId)
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.patent-folder-filter {
+  .patent-folder-filter-option {
+    margin-bottom: 10px;
+  }
+  .folder-tree {
+    .el-tree-node__content {
+      height: 45px;
+      color: #000;
+    }
+  }
+  .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+    background: #ecf5ff !important;
+    color: #409EFF!important;
+  }
+}
+</style>

+ 555 - 0
src/views/project/patentCollection/components/filter/Query.vue

@@ -0,0 +1,555 @@
+<template>
+  <div class="patent-query-filter">
+    <el-container>
+      <el-header class="patent-query-filter-header">
+        <div class="query-read-status" v-for="(item, key) in readList" :class="{ 'query-read-status_is-active' : key === returnData.read }" @click="handleReadQuery(key)">
+          <span class="a">(<span class="b">{{ readStatus[key] }}</span>)</span>
+          <span class="c">{{ item }}</span>
+        </div>
+      </el-header>
+      <el-main class="patent-query-filter-main">
+        <el-collapse v-model="activeNames" @change="handleChange">
+          <el-collapse-item v-for="item in field.filter(f => !f.hidden)" :title="item.name" :name="item.key" v-if="sourceQuery[item.key]">
+            <div v-if="isClassNumber(item.key)" class="patent-query-filter-main-select">
+              <el-select v-model="sourceQuery[item.key].classId" size="small" placeholder="请选择" @change="handleClassIdChange(item)">
+                <el-option v-if="['13', '15'].indexOf(item.key) !== -1" value="1" label="部"></el-option>
+                <el-option v-else value="1" label="分类号"></el-option>
+                <el-option value="2" label="大类"></el-option>
+                <el-option value="3" label="小类"></el-option>
+                <el-option v-if="['13', '15'].indexOf(item.key) !== -1" value="4" label="大组"></el-option>
+                <el-option v-if="['13', '15'].indexOf(item.key) !== -1" value="5" label="小组"></el-option>
+              </el-select>
+            </div>
+            <div class="patent-query-filter-search">
+              <div class="patent-query-filter-search-input">
+                <el-input v-if="['25-12', '26-12'].indexOf(item.key) === -1" v-model="sourceQuery[item.key].label" size="small" placeholder="请输入查询内容"></el-input>
+                <div v-else class="year-data-picker">
+                  <el-date-picker clear-icon size="small" v-model="sourceQuery[item.key].datePicker[0]" type="year" value-format="yyyy"></el-date-picker>
+                  <span>至</span>
+                  <el-date-picker clear-icon size="small" v-model="sourceQuery[item.key].datePicker[1]" type="year" value-format="yyyy"></el-date-picker>
+                </div>
+              </div>
+              <el-button @click="handleSearch(item)" size="small" type="primary" icon="el-icon-search" circle></el-button>
+            </div>
+            <el-checkbox-group v-if="['40-0'].indexOf(item.key) ===-1" v-model="sourceQuery[item.key].checked" @change="onChange(item.key)">
+              <div class="source-checkbox">
+                <el-checkbox v-for="source in sourceData[item.key]" :label="source.value">
+                  <span class="source-checkbox-label" :title="source.label">{{ source.label }}</span>
+                  <span class="source-checkbox-count">({{ source.count }})</span>
+                </el-checkbox>
+              </div>
+            </el-checkbox-group>
+            <el-checkbox-group v-if="['40-0'].indexOf(item.key) !==-1" v-model="sourceQuery[item.key].checked" @change="onChange(item.key)">
+              <div class="source-checkbox">
+                <el-checkbox v-for="source in sourceData[item.key]" :label="source.label">
+                  <span class="source-checkbox-label" :title="source.label">{{ source.label }}</span>
+                  <span class="source-checkbox-count">({{ source.count }})</span>
+                </el-checkbox>
+              </div>
+            </el-checkbox-group>
+            <div class="patent-query-filter-search-bottom">
+              <el-button type="success" size="small" @click="handleSelectAll(item)" :loading="sourceQuery[item.key].loading">全选</el-button>
+              <el-button type="danger" size="small" @click="handleSelectCancel(item)">取消</el-button>
+              <el-button v-if="!sourceQuery[item.key].isEnd" type="primary" size="small" @click="handleLoadMore(item)" :loading="sourceQuery[item.key].loading">加载更多</el-button>
+              <span v-else></span>
+            </div>
+          </el-collapse-item>
+        </el-collapse>
+      </el-main>
+      <el-footer class="patent-query-filter-footer">
+        <el-button type="primary" size="small" @click="handleMoreQuery">更多过滤项</el-button>
+        <el-button type="warning" size="small" @click="handleTextQuery" class="margin-right_10">文本筛选</el-button>
+      </el-footer>
+    </el-container>
+
+    <el-dialog title="管理过滤字段" :visible.sync="visible" width="630px" append-to-body destroy-on-close :before-close="close" top="10vh">
+      <div class="paten-query-filter-dialog">
+        <el-transfer
+            class="transfer"
+            v-model="selected"
+            filterable
+            :filter-method="filterMethod"
+            :titles="['未选择', '已选择']"
+            :button-texts="['', '']"
+            :format="{ noChecked: '${total}', hasChecked: '${checked}/${total}' }"
+            @right-check-change="rightCheckChange"
+            @change="handleChange2"
+            :data="form">
+          <span slot-scope="{ option }">{{ option.name }}</span>
+          <div slot="left-footer"></div>
+          <div class="transfer-footer" slot="right-footer">
+            <el-button @click="handleQueryOrder(-1)" type="primary" size="small" icon="el-icon-top" circle></el-button>
+            <el-button @click="handleQueryOrder(1)" size="small" icon="el-icon-bottom" circle></el-button>
+          </div>
+        </el-transfer>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="warning" class="float_left" @click="getPatentQueryField(true)" :loading="btnLoading2">重置</el-button>
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="updatePatentQueryField" :loading="btnLoading">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <patent-text-query-filter ref="patentTextQueryFilter" @submit="handleTextSearch" />
+  </div>
+</template>
+
+<script>
+import { patentQueryMixins } from "../mixins";
+import PatentTextQueryFilter from "../dialog/PatentTextQueryFilter";
+
+export default {
+  mixins: [patentQueryMixins],
+  components: {
+    PatentTextQueryFilter
+  },
+  data() {
+    return {
+      field: [],
+      visible: false,
+      loading: false,
+      btnLoading: false,
+      btnLoading2: false,
+      queryParams: {
+        projectId: 0,
+        folder: []
+      },
+      sourceQuery: {},
+      sourceData: {},
+      classTemp: [],
+      hasSource: [],
+      activeNames: [],
+      data: [],
+      selected: [],
+      rightSelect: [],
+      form: [],
+      readStatus: {},
+      readList: {
+        all: '全部',
+        read: '已读',
+        unread: '未读',
+      },
+      returnData: {
+        read: 'all',
+        field: [],
+        key: ''
+      },
+    }
+  },
+  watch: {
+    closeFieldDrawer() {
+      this.getPatentQueryField()
+    },
+    submitIndexSetting() {
+      this.refreshSourceData()
+    }
+  },
+  methods: {
+    async loadData() {
+      this.queryParams.projectId = this.projectId
+      this.queryParams.folder = this.folder
+      await this.getPatentQueryField(false, true)
+      this.getPatentReadTotal()
+    },
+    initFieldQueryForm() {
+      this.form.map(item => {
+        const temp = this.sourceQuery[item.key]
+        if (!temp) {
+          this.$set(this.sourceQuery, item.key, {
+            projectId: this.queryParams.projectId,
+            folder: this.queryParams.folder,
+            key: item.key,
+            current: 1,
+            size: 10,
+            order: 'desc',
+            label: '',
+            loading: false,
+            checked: [],
+            classId: '1',
+            type: item.type,
+            isEnd: false,
+            datePicker: ['', '']
+          })
+        }
+      })
+    },
+    async getPatentQueryField(refresh, loadForm) {
+      let params = {
+        projectId: this.queryParams.projectId,
+        type: 'query',
+        refresh: refresh
+      }
+      const { data } = await this.$api.getUserSettingField(params)
+      // console.log(data)
+      this.initFieldData(data)
+      if (loadForm) {
+        this.initFieldQueryForm()
+      }
+      if (refresh) {
+        this.visible = false
+      }
+    },
+    initFieldData(data) {
+      this.field = data
+      this.form = JSON.parse(JSON.stringify(data))
+      this.selected = this.field.filter(item => !item.hidden).map(item => item.key)
+    },
+    getPatentQueryFieldSource(key, refresh = false) {
+      let params = {
+        projectId: this.sourceQuery[key].projectId,
+        folder: this.sourceQuery[key].folder,
+        key: this.isClassNumber(key) ? (key + '-' + this.sourceQuery[key].classId) : this.sourceQuery[key].key,
+        current: this.sourceQuery[key].current,
+        size: this.sourceQuery[key].size,
+        order: this.sourceQuery[key].order,
+        label: this.sourceQuery[key].label,
+        type: this.sourceQuery[key].type,
+        startDate: this.sourceQuery[key].datePicker[0],
+        endDate: this.sourceQuery[key].datePicker[1],
+        refresh: false,
+      }
+      this.sourceQuery[key].loading = true
+      this.$api.getPatentQuerySourceList(params).then(response => {
+        const records = response.data.records
+        let temp = this.sourceData[key]
+        if (!temp || refresh) {
+          temp = records
+        } else {
+          temp.push(...records)
+        }
+        if (this.isClassNumber(key)) {
+          this.classTemp.push(...temp)
+        }
+        this.sourceQuery[key].isEnd = temp.length >= response.data.total
+        this.$set(this.sourceData, key, temp)
+        this.sourceQuery[key].loading = false
+      }).catch(error => {
+        this.sourceQuery[key].loading = false
+      })
+    },
+    handleChange(data) {
+      const val = data[data.length - 1];
+      if (val && this.hasSource.indexOf(val) === -1) {
+        this.hasSource.push(val)
+        this.getPatentQueryFieldSource(val)
+      }
+    },
+    handleClassIdChange(item) {
+      this.sourceData[item.key] = []
+      this.sourceQuery[item.key].current = 1
+      this.sourceQuery[item.key].label = ''
+      // this.sourceQuery[item.key].checked = []
+      this.getPatentQueryFieldSource(item.key)
+    },
+    handleSearch(item) {
+      this.sourceData[item.key] = []
+      // this.sourceQuery[item.key].checked = []
+      this.sourceQuery[item.key].current = 1
+      this.getPatentQueryFieldSource(item.key)
+    },
+    handleLoadMore(item) {
+      this.sourceQuery[item.key].current = this.sourceQuery[item.key].current + 1
+      this.getPatentQueryFieldSource(item.key)
+    },
+    handleSelectAll(item) {
+      const key = item.key
+      let params = {
+        projectId: this.sourceQuery[key].projectId,
+        folder: this.sourceQuery[key].folder,
+        key: this.isClassNumber(key) ? (key + '-' + this.sourceQuery[key].classId) : this.sourceQuery[key].key,
+        current: 1,
+        size: 9999999,
+        order: this.sourceQuery[key].order,
+        label: this.sourceQuery[key].label,
+        type: this.sourceQuery[key].type,
+        startDate: this.sourceQuery[key].datePicker[0],
+        endDate: this.sourceQuery[key].datePicker[1],
+        refresh: false,
+      }
+      this.sourceQuery[key].loading = true
+      this.$api.getPatentQuerySourceList(params).then(response => {
+        const records = response.data.records
+        this.sourceQuery[key].checked = records.map(item => item.value)
+        this.onChange(key)
+        this.sourceQuery[key].loading = false
+      }).catch(error => {
+        this.sourceQuery[key].loading = false
+      })
+    },
+    handleSelectCancel(item) {
+      const key = item.key
+      this.sourceQuery[key].checked = []
+      this.onChange(key)
+    },
+    handleReadQuery(type) {
+      this.returnData.read = type
+      this.returnData.key = ''
+      this.refreshSourceData()
+      this.$emit('on-change', this.returnData)
+    },
+    isClassNumber(key) {
+      return ['13', '15', '16', '17'].indexOf(key) !== -1
+    },
+    async handleMoreQuery() {
+      await this.getPatentQueryField()
+      this.visible = true
+    },
+    handleTextQuery() {
+      this.$refs.patentTextQueryFilter.open()
+    },
+    handleTextSearch(data) {
+      const label = {
+        'name': '标题',
+        'abstractStr': '摘要',
+        'publicNo': '公开号',
+        'applicationNo': '申请号',
+        'rightContent': '权利要求',
+      }
+      for (let key in data) {
+        if (data[key]) {
+          const index = this.queryData.map(item => item.key).indexOf(key)
+          const value = {
+            data: [{
+              label: data[key],
+              value: data[key]
+            }],
+            type: 'text',
+            key: key,
+            name: label[key]
+          }
+          if (index === -1) {
+            this.queryData.push(value)
+          } else {
+            this.$set(this.queryData, index, value)
+          }
+        }
+      }
+      this.$emit('text-change', data)
+    },
+    onChange(key) {
+      let field = []
+      for (let name in this.sourceQuery) {
+        field.push({
+          value: this.sourceQuery[name].checked,
+          key: name,
+          classId: this.sourceQuery[name].classId,
+          type: this.sourceQuery[name].type
+        })
+      }
+      const res = new Map()
+      this.updateQueryData(key, (this.isClassNumber(key) ? this.classTemp.filter((a) => !res.has(a.value) && res.set(a.value, 1)) : this.sourceData[key]), field.find(item => item.key === key))
+      this.returnData.field = field
+      this.returnData.key = key
+      this.$emit('on-change', this.returnData)
+    },
+    updateQueryData(key, source, data) {
+      const index = this.queryData.map(item => item.key).indexOf(data.key)
+      const value = {
+        data: source.filter(item => data.value.indexOf(item.value) !== -1),
+        type: 'field',
+        key: data.key,
+        name: this.field.find(item => item.key === key).name || ''
+      }
+      if (index === -1) {
+        this.queryData.push(value)
+      } else {
+        this.$set(this.queryData, index, value)
+      }
+    },
+    close() {
+      this.visible = false
+    },
+    rightCheckChange(data) {
+      this.rightSelect = data
+    },
+    handleChange2() {
+      let order = 1
+      for (let i = 0; i < this.selected.length; i++) {
+        const index = this.form.map(item => item.key).indexOf(this.selected[i])
+        this.form[index].order = order++
+      }
+    },
+    handleQueryOrder(order) {
+      this.rightSelect.map(item => {
+        const index = this.selected.indexOf(item)
+        const cIndex = index + order
+        if (cIndex < 0 || cIndex >= this.selected.length) {
+          return false
+        }
+        let current = this.form.find(item => item.key === this.selected[index])
+        let exchange = this.form.find(item => item.key === this.selected[cIndex])
+        current.order = current.order + order
+        exchange.order = exchange.order + (order === -1 ? 1 : -1)
+        this.form.sort((a, b) => {
+          return a.order - b.order
+        })
+        const temp = this.selected[index]
+        this.selected[index] = this.selected[cIndex]
+        this.selected[cIndex] = temp
+      })
+    },
+    filterMethod(query, item) {
+      // console.log(query,item)
+      return item.name.indexOf(query) !== -1
+    },
+    updatePatentQueryField() {
+     
+      this.form.map(item => item.hidden = this.selected.indexOf(item.key) === -1)
+      let data = {
+        data: this.form,
+        projectId: this.queryParams.projectId,
+        type: 'query'
+      }
+      this.btnLoading = true
+      this.$api.updateUserSettingField(data).then(response => {
+        this.close()
+        this.initFieldData(response.data)
+        this.initFieldQueryForm()
+        this.btnLoading = false
+        this.$message.success('操作成功')
+      }).catch(error => {
+        this.btnLoading = false
+      })
+    },
+    getPatentReadTotal() {
+      this.$api.getPatentReadTotal({ projectId: this.queryParams.projectId, folder: this.queryParams.folder }).then(response => {
+        this.readStatus = response.data
+      })
+    },
+    refreshSourceData() {
+      this.activeNames = []
+      this.hasSource = []
+      this.sourceData = {}
+      for (let key in this.sourceQuery) {
+        this.sourceQuery[key].current = 1
+        this.sourceQuery[key].label = ''
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.patent-query-filter {
+  height: 100%;
+  .patent-query-filter-header {
+    display: flex;
+    justify-content: space-between;
+    height: 40px !important;
+    padding: 0 !important;
+  }
+  .patent-query-filter-main {
+    height: 100%;
+    padding: 10px 0;
+    .patent-query-filter-main-select {
+      .el-select {
+        width: 255px;
+      }
+    }
+    .patent-query-filter-search {
+      height: 40px;
+      line-height: 40px;
+      .patent-query-filter-search-input {
+        width: 220px;
+        display: inline-block;
+      }
+      .el-button {
+        margin-left: 5px;
+      }
+      .el-date-editor {
+        width: 90px;
+      }
+    }
+    .patent-query-filter-search-bottom {
+      text-align: center;
+      margin-top: 10px;
+    }
+  }
+  .patent-query-filter-footer {
+    padding: 10px 0 !important;
+    .el-button {
+      float: right;
+    }
+  }
+  .year-data-picker {
+    display: flex;
+    justify-content: space-between;
+    .el-input__prefix {
+      display: none;
+    }
+    .el-input__inner {
+      padding: 10px;
+      text-align: center;
+    }
+  }
+  .query-read-status {
+    font-size: 12px;
+    height: 25px;
+    line-height: 25px;
+    cursor: pointer;
+    background: #dcdcdc;
+    border-radius: 3px;
+    padding: 0 5px;
+    // span {
+    //   display: inline-block;
+    // }
+    .a {
+      position:unset
+    }
+    .b {
+      text-align: center;
+      min-width: 30px;
+    }
+    .c {
+      margin-left: 5px;
+    }
+  }
+  .query-read-status_is-active {
+    background: #409EFF !important;
+    color: #ffffff !important;
+  }
+  .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;
+    }
+  }
+}
+.paten-query-filter-dialog {
+  text-align: center;
+  .transfer {
+    text-align: left;
+    display: inline-block;
+  }
+  .el-transfer-panel__body {
+    height: 400px;
+  }
+  .el-transfer-panel__list.is-filterable {
+    height: 350px;
+  }
+  .transfer-footer {
+    margin: 5px;
+  }
+}
+</style>

+ 255 - 0
src/views/project/patentCollection/components/filter/Tree.vue

@@ -0,0 +1,255 @@
+<template>
+  <div class="patent-tree-filter">
+    <el-container>
+      <el-header class="change-show-type" v-show="treeList.length">
+        <el-form label-position="top">
+          <el-form-item label="开启不关联模式">
+            <el-switch v-model="switchType" @change="onChange2"></el-switch>
+            <span class="change-show-type-info">描述:主分类不包含子分类</span>
+          </el-form-item>
+        </el-form>
+      </el-header>
+      <el-main class="patent-tree-filter-main">
+        <template v-if="treeList.length">
+          <div v-if="refresh">
+            <el-collapse v-model="activeNames" @change="handleChange">
+              <el-collapse-item v-for="item in treeList" :title="item.name" :name="item.id">
+                <el-tree
+                    @check-change="onChange"
+                    :ref="item.id"
+                    :data="item.option"
+                    show-checkbox
+                    node-key="id"
+                    check-strictly
+                    default-expand-all
+                >
+                  <div class="custom-filter-tree-node" slot-scope="{ node, data }">
+                    <span class="name">{{ data.name }}</span>
+                    <span class="total">({{ getCount(item.id, data.id) }})</span>
+                  </div>
+                </el-tree>
+              </el-collapse-item>
+            </el-collapse>
+          </div>
+        </template>
+        <template v-else>
+          <div class="no-data">暂无数据</div>
+        </template>
+      </el-main>
+    </el-container>
+  </div>
+</template>
+
+<script>
+import { patentQueryMixins } from "../mixins";
+import { getTreeLastChildren, getTreeDataList } from "@/utils";
+
+export default {
+  mixins: [patentQueryMixins],
+  data() {
+    return {
+      treeList: [],
+      activeNames: [],
+      hasSource: [],
+      sourceQuery: {},
+      queryParams: {
+        projectId: 0,
+        folder: null
+      },
+      sourceData: {},
+      switchType: false,
+      refresh: true
+    }
+  },
+  watch: {
+    closeFieldDrawer() {
+      this.getPatentQueryTree()
+    },
+    submitIndexSetting() {
+      this.activeNames = []
+      this.hasSource = []
+    }
+  },
+  mounted() {
+  },
+  methods: {
+    getCount(key, node) {
+      if (!this.sourceData[key]) {
+        return 0;
+      }
+      const data = this.sourceData[key].find(item => parseInt(item.value) === node)
+      if (data) {
+        return data.count
+      }
+      return 0
+    },
+    loadData() {
+      this.queryParams.projectId = this.projectId
+      this.queryParams.folder = this.folder
+      this.getPatentQueryTree()
+      // console.log(this.sourceData)
+    },
+    reset() {
+      this.treeList.map(item => {
+        this.$set(this.sourceQuery, item.id, {
+          projectId: this.queryParams.projectId,
+          folder: this.queryParams.folder,
+          key: item.id,
+          loading: false,
+          checked: [],
+          type: item.type
+        })
+        this.handleChange([item.id])
+      })
+    },
+    getPatentQueryTree() {
+      this.$api.getProjectFieldTree({ projectId: this.queryParams.projectId }).then(response => {
+        this.treeList = response.data
+        this.$nextTick(() => {
+          const data = this.queryData.filter(item => item.type === 'tree')
+          for (let val of data) {
+            const keys = val.key.split('-')
+            this.switchType = keys[1] === '1'
+            this.$refs[keys[0]][0].setCheckedKeys(val.data.map(item => item.value))
+          }
+          this.reset()
+        })
+      })
+    },
+    getPatentQueryTreeSource(key) {
+      let data = JSON.parse(JSON.stringify(this.params))
+      data.field.filter(item => item.type === '6').map(item => item.value = [])
+      let params = {
+        projectId: this.sourceQuery[key].projectId,
+        folder: this.queryParams.folder,
+        key: this.sourceQuery[key].key + '-' + (this.switchType ? '1' : '0'),
+        type: this.sourceQuery[key].type,
+        current: 1,
+        size: 9999,
+        queryParams: data
+      }
+      this.sourceQuery[key].loading = true
+      this.$api.getPatentQuerySourceList(params).then(response => {
+        this.$set(this.sourceData, key, response.data.records)
+        this.sourceQuery[key].loading = false
+      }).catch(error => {
+        this.sourceQuery[key].loading = false
+      })
+    },
+    handleChange(data) {
+      const val = data[data.length - 1];
+      if (val && this.hasSource.indexOf(val) === -1) {
+        this.hasSource.push(val)
+        this.getPatentQueryTreeSource(val)
+      }
+    },
+    onChange(node, checked) {
+      const refs = this.$refs
+      const { fieldId, id } = node
+      let data = []
+      for (let key in refs) {
+        let val = []
+        const keys = refs[key][0].getCheckedKeys()
+        const treeNodes = getTreeDataList(this.treeList.find(item => item.id === parseInt(key)).option || [], [])
+        const selected = treeNodes.filter(item => keys.indexOf(item.id) !== -1)
+        selected.map(item => {
+          val.push(item.id)
+          if (!this.switchType) {
+            val.push(...getTreeDataList([item], []).map(item => item.id))
+          }
+        })
+        const key2 = key + '-' + (this.switchType ? '1' : '0')
+        data.push({
+          key: key2,
+          type: '6',
+          value: val
+        })
+        this.updateQueryData(parseInt(key), key2, keys, treeNodes)
+      }
+      this.$emit('on-change', data)
+      // this.activeNames = [fieldId]
+      // this.hasSource = [fieldId]
+      // this.sourceData = {}
+      // this.getPatentQueryTreeSource(fieldId)
+    },
+    updateQueryData(id, key, selected, data) {
+      const index = this.queryData.map(item => item.key).indexOf(key)
+      const tree = this.treeList.find(item => item.id === id)
+      const value = {
+        data: data.filter(item => selected.indexOf(item.id) !== -1).map(item => {
+          return {
+            label: item.name,
+            value: item.id,
+          }
+        }),
+        type: 'tree',
+        key: key,
+        name: tree.name || '',
+        tree: tree.option
+      }
+      if (index === -1) {
+        this.queryData.push(value)
+      } else {
+        this.$set(this.queryData, index, value)
+      }
+    },
+    getChildrenNode(treeList) {
+
+    },
+    onChange2() {
+      this.hasSource = []
+      this.activeNames = []
+      this.sourceData = {}
+      this.reset()
+      this.refresh = false
+      this.$emit('on-change', [])
+      this.$nextTick(() => {
+        this.refresh = true
+      })
+      this.$store.commit('SET_PATENT_QUERY_DATA', this.queryData.filter(data => data.type !== 'tree'))
+      // for (let key in this.$refs) {
+      //   this.getPatentQueryTreeSource(key)
+      // }
+      // this.onChange()
+    },
+    refreshTreeSelected(keys, id) {
+      try {
+        this.$nextTick(() => {
+          this.$refs[keys[0]][0].setChecked(id, false)
+        })
+      } catch (e) {
+        // console.error(e)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.patent-tree-filter {
+  height: 100%;
+  .patent-tree-filter-main {
+    height: 100%;
+    padding: 10px 0;
+    .no-data {
+      text-align: center;
+      color: #6b6868;
+    }
+  }
+  .change-show-type {
+    font-size: 13px;
+    .change-show-type-info {
+      color: #6b6868;
+      padding-left: 10px;
+    }
+    .el-form-item__label{
+      padding: 0 !important;
+      line-height: 20px;
+    }
+    .el-form-item__content {
+      height: 30px;
+      line-height: 30px;
+    }
+  }
+}
+</style>

+ 21 - 0
src/views/project/patentCollection/components/filter/index.vue

@@ -0,0 +1,21 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 40 - 8
src/views/visual/components/components/svgVisual.vue

@@ -708,11 +708,12 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2218" dy="14" x="0">
-              <tspan id="SvgjsTspan2219" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2219" style="">事件数量:{{ getEventNumber('竞争对手威胁应对') }}</tspan>
             </tspan>
           </text>
         </g>
       </g>
+
       <g id="SvgjsG2220" transform="translate(958.125,485.9140222283114)">
         <path
           id="SvgjsPath2221"
@@ -847,7 +848,7 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2242" dy="14" x="0">
-              <tspan id="SvgjsTspan2243" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2243" style="">事件数量:{{ getEventNumber('专利培育布局') }}</tspan>
             </tspan>
           </text>
         </g>
@@ -935,7 +936,7 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2255" dy="14" x="0">
-              <tspan id="SvgjsTspan2256" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2256" style="">事件数量:{{ getEventNumber('IPO上市') }}</tspan>
             </tspan>
           </text>
         </g>
@@ -1175,7 +1176,7 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2292" dy="14" x="0">
-              <tspan id="SvgjsTspan2293" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2293" style="">事件数量:{{ getEventNumber('侵权纠纷') }}</tspan>
             </tspan>
           </text>
         </g>
@@ -1588,6 +1589,9 @@
           fill="none"
         ></path>
       </g>
+
+
+      <!-- 科技与重大立项专利导航 -->
       <g
         id="SvgjsG2356"
         transform="translate(93.39885892702978,57.85423225208305)"
@@ -1733,11 +1737,13 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2378" dy="14" x="216">
-              <tspan id="SvgjsTspan2379" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2379" style="">事件数量:{{ getEventNumber('科技与重大立项专利导航') }}</tspan>
             </tspan>
           </text>
         </g>
       </g>
+
+<!-- 专利盘点与运维 -->
       <g
         id="SvgjsG2380"
         transform="matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,377.1211853027344,314.78125)"
@@ -1857,7 +1863,7 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2397" dy="14" x="216">
-              <tspan id="SvgjsTspan2398" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2398" style="">事件数量:{{ getEventNumber('专利盘点与运维') }}</tspan>
             </tspan>
           </text>
         </g>
@@ -2027,6 +2033,8 @@
           fill="none"
         ></path>
       </g>
+
+
       <g
         id="SvgjsG2424"
         transform="translate(143.67271785405956,534.5859126608023)"
@@ -2172,7 +2180,7 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2446" dy="14" x="216">
-              <tspan id="SvgjsTspan2447" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2447" style="">事件数量:{{ getEventNumber('产品上市/出口风险控制') }}</tspan>
             </tspan>
           </text>
         </g>
@@ -2230,6 +2238,8 @@
           ></text>
         </g>
       </g>
+
+
       <g
         id="SvgjsG2455"
         transform="matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,344.572303201501,439.98516845703125)"
@@ -2393,7 +2403,7 @@
             transform="rotate(0)"
           >
             <tspan id="SvgjsTspan2480" dy="14" x="216">
-              <tspan id="SvgjsTspan2481" style="">事件数量:0</tspan>
+              <tspan id="SvgjsTspan2481" style="">事件数量:{{ getEventNumber('专利维权') }}</tspan>
             </tspan>
           </text>
         </g>
@@ -2557,12 +2567,34 @@
   
   <script>
 export default {
+  props:{
+    total:{
+
+    }
+  },
+  watch:{
 
+  },
   mounted() {},
   methods: {
     handleClick(type,title) {
       this.$emit("click", { type,title });
     },
+    getEventNumber(name){
+      if(this.total && Object.keys(this.total).length>0){
+        var obj = this.total.find(item=>{
+          return item.name == name
+        })
+        if(obj){
+          return obj.count || 0
+        }else{
+          return 0
+        }
+      }else{
+        return 0
+      }
+      
+    }
   },
 };
 </script>

+ 4 - 26
src/views/visual/components/drawer/eventDrawer.vue

@@ -2,7 +2,7 @@
     <div>
       <el-drawer class="custom-drawer-form" size="1000px" :with-header="false" :visible.sync="drawer" direction="rtl" :before-close="close" destroy-on-close append-to-body>
           <div style="padding:10px;height:100%">
-            <questionIndex :applicationScenario="getQuestionId(params.scenarioName)" :isOperate='2'></questionIndex>
+            <questionIndex :scenarioId="params.scenarioId" :isOperate='2'></questionIndex>
           </div>
       </el-drawer>
     </div>
@@ -19,43 +19,21 @@
       return {
           //控制弹窗是否显示
           drawer:false,
-          //事件的信息
+          //应用场景的信息
           params:{},
-          //事件数量
-          QuestionTotal:[]
       };
     },
     watch: {},
     computed: {},
     created() {},
     mounted() {
-        //获取事件数量
-        this.getEventNumber()
     },
     methods: {
-        //获取当前应用场景数据
-        getQuestionId(type){
-            if(this.QuestionTotal.length>0){
-                var a= this.QuestionTotal.find(item=>{return item.applicationScenarioName == type})
-                if(a){
-                    return a.applicationScenarioValue
-                }
-            }
-        },
-        //获取事件数量
-        async getEventNumber(){
-            await  this.$api.queryApplicationScenarioEventNumber().then(response=>{
-                if(response.code == 200){
-                this.QuestionTotal = response.data
-                }
-            })
-        },
         //打开抽屉
-        open(scenarioName, typeName, question){
+        open(scenarioName, scenarioId){
           this.params = {
               scenarioName:scenarioName, 
-              typeName:typeName, 
-              question:question
+              scenarioId:scenarioId, 
           }
           this.drawer = true
         },

+ 28 - 9
src/views/visual/components/sceneSVG.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="svgDataDiv" ref="svgDataDiv">
-      <svg-visual @click="handleClick"></svg-visual>
+      <svg-visual @click="handleClick" :total="total"></svg-visual>
    
     <eventDrawer ref="eventDrawer" @close="closeDrawer"></eventDrawer>
   </div>
@@ -22,15 +22,17 @@ export default {
     };
   },
   watch: {},
-  computed: {},
+  computed: {
+    scenario(){
+      return this.$store.state.dictMessage.scenario
+    }
+  },
   created() {},
   async mounted() {
     //获取块的最大宽高
     this.getDivWidth()
     //获取应用场景对应事件总数量
     await this.getScenarioTotal()
-    //获取每个应用场景已完成未完成数量
-    await this.getProjectStatusTotal()
   },
   methods: {
     //获取块的最大宽高
@@ -60,8 +62,24 @@ export default {
     },
     // 应用场景对应事件总数量
     async getScenarioTotal() {
-      await this.$api.getScenarioAndTypeTotal().then(response => {
-        this.total = response.data.scenario
+      var params = {
+          "current": 1,
+          "size": 10,
+          "searchQuery": "",
+          "orderDTOList": [
+            {
+              "orderBy": "createTime",
+              "orderType": 1
+            }
+          ],
+          "groupBy": "scenarioId"
+        }
+      await this.$api.groupEvent(params).then(res => {
+        if (res.code == 200) {
+          this.total=res.data.data.values
+        }
+      }).catch(err => {
+        this.total = []
       })
     },
     // 详情及清单按钮事件
@@ -74,7 +92,10 @@ export default {
           })
           break
         case 1:
-          this.$refs.eventDrawer.open(title, null)
+          var scenarioId = this.scenario.find(item=>{
+            return item.name == title
+          }).id
+          this.$refs.eventDrawer.open(title, [scenarioId])
           break
       }
     },
@@ -82,8 +103,6 @@ export default {
     closeDrawer(){
         //获取应用场景对应事件总数量
         this.getScenarioTotal()
-        //获取每个应用场景已完成未完成数量
-        this.getProjectStatusTotal()
     },
   },
 };