Browse Source

检索条件的修改

zhuliu 1 year ago
parent
commit
3f8bed3813

+ 40 - 0
src/utils/common.js

@@ -32,6 +32,46 @@ export default {
       }, delay)
     }
   },
+  //对象转数组
+  objectToArray(val){
+    var data = []
+    if (Object.keys(val).length > 0) {
+      Object.keys(val).forEach(item => {
+        if(val[item]){
+          data.push(
+            {
+              key: item,
+              value: val[item]
+            }
+          )
+        }
+        
+      })
+    } else {
+      return []
+    }
+    return data
+  },
+  //转简单数组
+  ArrayToArray(data){
+    var arr = []
+    data.forEach(item => {
+      if (item.type == 3) {
+        arr.push({
+          key:item.value,
+          value:item.searchValue.map(itemValue => {
+            return itemValue.value
+          })
+        })
+      } else {
+        arr.push({
+          key:item.value,
+          value:item.searchValue.label
+        })
+      }
+    })
+    return arr
+  },
   //object转字符串
   objectToString(val) {
     var data = []

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

@@ -36,7 +36,7 @@
     <div class="option" v-if="searchOptions.length > 0">
       <el-popover placement="bottom" title="" width="300" trigger="hover" class="margin-left_10">
         <div class="main">
-          <div v-for="(item, index) in searchOptions" :key="item.value" class="box">
+          <div v-for="(item, index) in searchOptions" :key="index" class="box">
             <el-alert type="success" :closable="false">
               <div class="content">
                 <span class="color-black">{{ item.label }}</span>

+ 4 - 1
src/utils/model/svg/mixins.js

@@ -6,7 +6,10 @@ export default {
       type:[Array,Object]
     },
     QuestionTotal:Array,
-    eventName:String
+    eventName:String,
+    eventId:{
+      
+    }
   },
   components: {
     // Popover,

+ 14 - 5
src/views/components/import/task/components/index.vue

@@ -284,20 +284,29 @@ export default {
         }
       })
       // 返回条件对象
-      this.searchOption=params
+      this.searchOption=this.$commonJS.ArrayToArray(val)
       // 调用查询接口
       this.queryParams.current=1
       this.getList()
     },
     //获取任务
     getList(){
-        var params = {
-            ...this.searchFiled2,
-            ...this.searchOption
+        // var params = {
+        //     ...this.searchFiled2,
+        //     ...this.searchOption
+        // }
+        var searchFiled2 = this.$commonJS.objectToArray(this.searchFiled2)
+        var searchOption1 = this.searchOption
+        if(this.searchOption.constructor == Object){
+          searchOption1 = this.$commonJS.objectToArray(this.searchOption)
         }
+        let searchOption = [
+          ...searchFiled2,//固有检索字段
+          ...searchOption1
+        ]
         var params = {
             ...this.queryParams,
-            searchQuery:this.$commonJS.objectToString(params),
+            searchQuery:this.$commonJS.objectToString(searchOption),
             orderDTOList:this.sort
         }
         this.$api.queryImportTask(params).then(res => {

+ 3 - 3
src/views/event/components/dialog/addEvent.vue

@@ -250,9 +250,9 @@ export default {
     getAdminClientList() {
       this.$api.getAdminClientList(this.client.queryParams).then(response => {
         if(response.code == 200){
-          if(this.clientId){
+          if(this.formData[0].clientId){
             var index = response.data.records.findIndex(item=>{
-              return item.id == this.clientId
+              return item.id == this.formData[0].clientId
             })
             if(index!=-1){
               this.clientList.shift()
@@ -273,7 +273,7 @@ export default {
         if(data.clientId){
           this.clientList.push(
             {
-              id:clientId,
+              id:data.clientId,
               name:data.clientName
             }
           )

+ 1 - 1
src/views/event/components/index.vue

@@ -242,7 +242,7 @@ export default {
         }
       })
       // 返回条件对象
-      this.searchOption=params
+      this.searchOption=this.$commonJS.ArrayToArray(val)
       // 调用查询接口
       this.queryParams.current=1
       this.isGrouping()

+ 2 - 3
src/views/event/components/view/card.vue

@@ -8,7 +8,7 @@
               <!-- <span># {{ (itemIndex + 1) + ((queryParams.current - 1) * queryParams.size)}}</span> -->
               <span @click="handleItem(item)" class="cursor_pointer">{{ item.name }}</span>
             </div>
-            <div v-if="!projectId && !show">
+            <!-- <div v-if="!projectId && !show">
               <el-dropdown @command="handleCommand($event, item)" trigger="click">
                 <span class="el-dropdown-link">
                   <i class="el-icon-more" style="font-size: 16px;"></i>
@@ -26,10 +26,9 @@
                       </el-dropdown-menu>
                     </el-dropdown>
                   </el-dropdown-item>
-                  <!-- <el-dropdown-item command="3" divided class="color-red">删除</el-dropdown-item> -->
                 </el-dropdown-menu>
               </el-dropdown>
-            </div>
+            </div> -->
           </div>
           <div>
             <el-form label-position="left" label-width="140px">

+ 2 - 2
src/views/event/components/view/table.vue

@@ -27,7 +27,7 @@
               @command="handleCommand($event,scope.row)">
               <span>编 辑</span>
               <el-dropdown-menu slot="dropdown" style="text-align:center">
-                <el-dropdown-item command="0">新增专利数据库</el-dropdown-item>
+                <!-- <el-dropdown-item command="0">新增专利数据库</el-dropdown-item>
                 <el-dropdown-item>
                   <el-dropdown trigger="hover" placement="right-start">
                     <span class="el-dropdown-link"> 新增报告 </span>
@@ -35,7 +35,7 @@
                         <el-dropdown-item v-for="item in dictMessage.REPORT_TYPE.filter(item=>!['6'].includes(item.value))" :key="item.label"  @click.native="handleAnalyse(item.value,scope.row)" v-if="$permission('/pcs/report/add/' + item.permission)">{{item.label}}</el-dropdown-item>
                     </el-dropdown-menu>
                 </el-dropdown> 
-                </el-dropdown-item>
+                </el-dropdown-item> -->
                 <el-dropdown-item command="10" divided style="color:red">删 除</el-dropdown-item>
               </el-dropdown-menu>
             </el-dropdown>

+ 2 - 2
src/views/layout/mixins/index.js

@@ -4,8 +4,8 @@ import Store from '@/store'
 export const webSocket = {
   methods: {
     connectWebSocket(userId) {
-      // let webSocket = new WebSocket(`ws://${this.$c.staticURL}:8877/api/xiaoshi/ws/` + userId)
-      let webSocket = new WebSocket(`ws://192.168.1.18:8877/api/xiaoshi/ws/` + userId)
+      let webSocket = new WebSocket(`ws://${this.$c.staticURL}:8877/api/xiaoshi/ws/` + userId)
+      // let webSocket = new WebSocket(`ws://192.168.1.18:8877/api/xiaoshi/ws/` + userId)
       Store.commit('SET_WEB_SOCKET', webSocket)
       webSocket.onopen = () => {
         console.log('WebSocket连接成功')

+ 12 - 3
src/views/patentMining/components/fileMessage.vue

@@ -172,11 +172,20 @@ export default {
     },
     // 获取数据
     async getList() {
-      let searchOption = {
+      let searchOption2 = {
         processId: this.pathObjCopy,//流程节点id
         projectId: this.id,//固有检索
-        ...this.searchOption
+        // ...this.searchOption
       }
+      var searchFiled2 = this.$commonJS.objectToArray(searchOption2)
+      var searchOption1 = this.searchOption
+      if(this.searchOption.constructor == Object){
+        searchOption1 = this.$commonJS.objectToArray(this.searchOption)
+      }
+      let searchOption = [
+        ...searchFiled2,//固有检索字段
+        ...searchOption1
+      ]
       let params = {
         ...this.queryParams,//分页信息
         searchQuery: this.$commonJS.objectToString(searchOption || {}),//检索条件
@@ -208,7 +217,7 @@ export default {
         }
       })
       // 返回字符串
-      this.searchOption = params
+      this.searchOption = this.$commonJS.ArrayToArray(val)
       // 调用查询接口
       this.queryParams.current = 1
       this.getList()

+ 0 - 1
src/views/patentMining/components/view/MergeTable.vue

@@ -37,7 +37,6 @@ export default {
     },
     // 检索条件
     searchOption: {
-      type: Object,
       default: () => {
         return {}
       }

+ 1 - 1
src/views/patentMining/components/viewIndex.vue

@@ -240,7 +240,7 @@ export default {
         }
       })
       // 返回条件对象
-      this.searchOption = params
+      this.searchOption = this.$commonJS.ArrayToArray(val)
       // 调用查询接口
       this.queryParams.current = 1
       this.getList()

+ 2 - 0
src/views/product/components/framework/viewIndex.vue

@@ -372,6 +372,8 @@ export default {
           params[item.value] = item.searchValue.label
         }
       })
+
+      
       // 返回字符串
       this.searchOption.searchQuery = this.$commonJS.objectToString(params)
 

+ 1 - 1
src/views/product/components/index.vue

@@ -399,7 +399,7 @@ export default {
         })
       }
       
-      this.searchOption = params
+      this.searchOption = this.$commonJS.ArrayToArray(val)
       this.queryParams.current = 1
       this.getList()
     },

+ 3 - 1
src/views/product/components/view/productTable.vue

@@ -73,7 +73,9 @@ export default {
     },
     row:'',
     searchOption:{
-      default:{}
+      default:()=>{
+        return {}
+      }
     },
     column:{
       default:()=>{

+ 5 - 0
src/views/project/components/drawer/form.vue

@@ -232,6 +232,11 @@ export default {
       productVisible:false,
       //产品或产品类别架构
       structureList:[],
+      StructureProp:{
+        value:'id',
+        label: 'name',
+        children: 'child'
+      },
       //委托方
       clientList:{
         queryParams:{

+ 0 - 1
src/views/project/components/view/MergeTable.vue

@@ -32,7 +32,6 @@ export default {
   props: {
     // 检索条件
     searchOption: {
-      type: Object,
       default: () => {
         return {}
       }

+ 1 - 1
src/views/project/index.vue

@@ -242,7 +242,7 @@ export default {
           params[item.value] = item.searchValue.label
         }
       })
-      this.searchOption = params
+      this.searchOption = this.$commonJS.ArrayToArray(val)
       // 调用查询接口
       this.queryParams.current = 1
       this.isGrouping()

+ 0 - 1
src/views/report/components/allocationTask/components/allocationTask.vue

@@ -107,7 +107,6 @@ export default {
       default: '',
     },
     oldSearchOption: {
-      type: Object,
       default: () => {
         return {}
       }

+ 15 - 4
src/views/report/components/checkPatent/checkPatent.vue

@@ -181,7 +181,7 @@ export default {
         }
       })
       // 返回字符串
-      this.searchOption = params
+      this.searchOption = this.$commonJS.ArrayToArray(val)
       // 调用查询接口
       this.queryParams.current = 1
       this.getList()
@@ -236,10 +236,21 @@ export default {
       this.getList()
     },
     getList() {
-      var searchOption = {
-        ...this.oldSearchOption,
-        ...this.searchOption
+      // var searchOption = {
+      //   ...this.oldSearchOption,
+      //   ...this.searchOption
+      // }
+      var searchOption1 = this.searchOption
+      if(this.searchOption.constructor == Object){
+        searchOption1 = this.$commonJS.objectToArray(this.searchOption)
       }
+      if(this.oldSearchOption.constructor == Object){
+        oldSearchOption = this.$commonJS.objectToArray(this.oldSearchOption)
+      }
+      let searchOption = [
+        ...oldSearchOption,//固有检索字段
+        ...searchOption1
+      ]
       var searchStr = this.$commonJS.objectToString(searchOption)
       var patentNoStr = ''
       this.patentNos.forEach((item, index) =>{

+ 4 - 1
src/views/report/components/details/components/basicMessage.vue

@@ -145,7 +145,7 @@
       </el-form-item>
     </el-form>
 
-    <flow-Path :projectId="projectId"></flow-Path>
+    <flow-Path :projectId="projectId" v-if="reportType == 7"></flow-Path>
   </div>
 </template>
   
@@ -159,6 +159,9 @@ export default {
   props: {
     projectId:{
       default:0
+    },
+    reportType:{
+      default:0
     }
   },
   data() {

+ 1 - 1
src/views/report/components/index.vue

@@ -350,7 +350,7 @@ export default {
         }
       })
       // 返回字符串
-      this.searchOption = params
+      this.searchOption = this.$commonJS.ArrayToArray(val)
       // 调用查询接口
       this.queryParams.current = 1
       this.getList()

+ 3 - 3
src/views/report/components/productResult/productResult.vue

@@ -64,8 +64,8 @@
               <td>公告日</td>
               <td><span v-if="patent">{{ patent.grantDate }}</span></td>
               <td>专利权人</td>
-              <td><span v-if="patent && patent.rightHolder"><span
-                    v-for="item in patent.rightHolder.filter(a => a.type == 1)">{{ item.name }}</span></span></td>
+              <td><span v-if="patent && patent.rightHolder">
+                <span v-for="item in patent.rightHolder.filter(a => a.type == 1)" :key="item.name">{{ item.name }}</span></span></td>
             </tr>
             <tr>
               <td>优先权</td>
@@ -262,7 +262,7 @@ export default {
   },
   async mounted() {
     await this.getPatentList()
-    if (this.patentList) {
+    if (this.patentList && this.patentList.length>0) {
       this.patent = this.patentList[0]
       this.getList(this.patent.patentNo)
     }

+ 1 - 1
src/views/report/components/splitPage/splitPage.vue

@@ -81,7 +81,7 @@
           </el-table-column>
 
           <!-- 父组件传递栏位 -->
-          <el-table-column v-for="(item, index) in columnList" :key="index" :prop="item.value" :label="item.name"
+          <el-table-column v-for="(item, index) in columnList" :key="index" :label="item.name"
             align="center" min-width="160px">
 
             <template slot-scope="scope">

+ 0 - 1
src/views/report/components/view/mergeTable.vue

@@ -28,7 +28,6 @@ export default {
   props: {
     // 检索条件
     searchOption: {
-      type: Object,
       default: () => {
         return {}
       }

+ 33 - 22
src/views/task/components/index.vue

@@ -10,7 +10,7 @@
         </div>
       </el-header>
       <el-main class="height_100">
-        <el-table :data="tableData" height="calc(100% - 1px)" style="width: 100%;" border
+        <el-table :data="tableData" max-height="calc(100% - 1px)" style="width: 100%;" border
           header-row-class-name="custom-table-header" @sort-change="sortChange">
           <el-table-column label="#" align="center" width="80px">
             <template slot-scope="scope">
@@ -188,12 +188,40 @@ export default {
         this.getList()
       }
     },
+     // 左侧搜索
+     search(val) {
+      let params = {}
+      val.forEach(item => {
+        if (item.type == 3) {
+          params[item.value] = item.searchValue.map(itemValue => {
+            return itemValue.value
+          })
+        } else {
+          params[item.value] = item.searchValue.label
+        }
+      })
+      // 返回字符串
+      this.searchOption = this.$commonJS.ArrayToArray(val)
+      // 调用查询接口
+      this.queryParams.current = 1
+      this.getList()
+    },
     // 请求数据
     getList() {
-      let searchOption = {
-        ...this.searchFiled2,//固有检索字段
-        ...this.searchOption
+      // let searchOption = {
+      //   ...this.searchFiled2,//固有检索字段
+      //   ...this.searchOption
+      // }
+      
+      var searchFiled2 = this.$commonJS.objectToArray(this.searchFiled2)
+      var searchOption1 = this.searchOption
+      if(this.searchOption.constructor == Object){
+        searchOption1 = this.$commonJS.objectToArray(this.searchOption)
       }
+      let searchOption = [
+        ...searchFiled2,//固有检索字段
+        ...searchOption1
+      ]
       let params = {
         ...this.queryParams,//分页信息
         searchQuery: this.$commonJS.objectToString(searchOption),//检索条件
@@ -440,24 +468,7 @@ export default {
         }
       })
     },
-    // 左侧搜索
-    search(val) {
-      let params = {}
-      val.forEach(item => {
-        if (item.type == 3) {
-          params[item.value] = item.searchValue.map(itemValue => {
-            return itemValue.value
-          })
-        } else {
-          params[item.value] = item.searchValue.label
-        }
-      })
-      // 返回字符串
-      this.searchOption = params
-      // 调用查询接口
-      this.queryParams.current = 1
-      this.getList()
-    },
+   
     //排序
     sortChange({ column, prop, order }) {
       //如需要多个字段排序,则不需要清空

+ 3 - 2
src/views/visual/title/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="visual-title">
       <el-button type="primary" class="visual-title-back" icon="el-icon-back" @click="handleBack" v-if="!sign">返回</el-button>
-       <myCustomSvg  class="myCustomSvg" :title="title" :total="total" :QuestionTotal="QuestionTotal" :eventName="eventName" @on-click="handleClick"></myCustomSvg>
+       <myCustomSvg  class="myCustomSvg" :title="title" :total="total" :QuestionTotal="QuestionTotal" :eventId="eventId" :eventName="eventName" @on-click="handleClick"></myCustomSvg>
       <!-- <tips class="c-tips" /> -->
       <titleDrawer ref="titleDrawer" @close="close" />
       <eventDrawer ref="eventDrawer" @close="closeDrawer"></eventDrawer>
@@ -118,7 +118,8 @@
           scenarioId:this.scenarioId,
           matterId:matterId,
           isPatentMining:isPatentMining,
-          eventName:this.eventName
+          eventName:this.eventName,
+          eventId:this.eventId
         }
         this.$refs.titleDrawer.open(data)
       },