Преглед изворни кода

去除筛选条件时统计栏位的勾选也同时取消

zhuliu пре 1 година
родитељ
комит
4bd352b3c1

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

@@ -330,7 +330,10 @@ export default {
       this.searchStr = searchStr
       this.customFields = customFields
       this.getList()
-      this.$refs.customFields.close()
+      this.$nextTick(()=>{
+        this.$refs.customFields.close()
+      })
+      
     },
     // 统计组件传的值
     handleCustomFields(val) {

+ 11 - 3
src/views/report/components/patentList/components/customFields/index.vue

@@ -99,12 +99,12 @@ export default {
   watch: {
     searchOption: {
       handler() {
-        this.refreshOptions()
+        this.refreshOptions(1)
       },
     },
     customFields: {
       handler() {
-        this.refreshOptions()
+        this.refreshOptions(1)
       },
     },
   },
@@ -127,10 +127,18 @@ export default {
     // 检索条件取消时统计勾选项一并取消//待修改,需要考虑产品架构、技术分类、等id重复的情况
     close() {
       let currentData = this.searchPatentCheck
+      if(currentData.length==0){
+        this.field.forEach(item => {
+          item.check = []
+        })
+        this.fieldTree.forEach(item=>{
+          item.check = []
+        })
+      }
       var obj = {}
-      
       for (var i = 0; i < currentData.length; i++){
         var item = currentData[i]
+        item.check = item.checkData.map(val=>val.value)
         var str = ''
         if (item.children && item.children.length > 0) {
           str = item.value1 + 'a' + item.filedKind