Browse Source

feat: 物业版添加subtype url参数,用于回显信息类型筛选框

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 năm trước cách đây
mục cha
commit
2a068d4341

+ 27 - 4
src/web/staticres/js/selector/area-city-data.js

@@ -188,6 +188,22 @@ var selectAreachoose = {
       }
       this.getData()
     },
+    processingsubtype(data) { // 采购单位回显
+      // data格式为['招标公告', '招标预告']
+      if (data) {
+        let list
+        if (Array.isArray(data)) {
+          list = data
+        } else {
+          list = data.toString().split(',')
+        }
+        let arr = list
+        this.checkecho(arr, 'value') // 回显选中信息
+      } else {
+        this.reactAll()// 置为初始
+      }
+      this.getData()
+    },
     reactAll() {
       this.num = '全部'
       this.leftList.forEach(ele => {
@@ -217,11 +233,18 @@ var selectAreachoose = {
     checkecho(arr, key) {
       arr.forEach(ele => {
         this.leftList.forEach(e => {
-          e.children.forEach(item => {
-            if (ele == item[key]) {
+          if (ele == e.value) {
+            e.selected = true
+            e.children.forEach(item => {
               item.selected = true
-            }
-          })
+            })
+          } else {
+            e.children.forEach(item => {
+              if (ele == item[key]) {
+                item.selected = true
+              }
+            })
+          }
         })
       })
       this.leftList.forEach((ele, index) => {

+ 14 - 0
src/web/templates/pc/supsearch.html

@@ -3338,6 +3338,7 @@ function checkTagDisabled () {
         showPage: true,
         inResourceBIiframe: getParam('resource') === 'BI',
         inBIPropertyiframe: getParam('property') === 'BIProperty',  // 物业专版
+        BISubtype: getParam('subtype'),
         listState: {
           prevPageNum: 1,
           size: pageSize,
@@ -3658,6 +3659,11 @@ function checkTagDisabled () {
             }
           }
         })
+        // url添加subtype参数回显信息类型---物业版专属功能
+        if(this.BISubtype) {
+          const BISubtypeArr = this.BISubtype.indexOf(',') !== -1 ? this.BISubtype.split(',') : [this.BISubtype]
+          this.setInfoTypeEcho(BISubtypeArr)
+        }
       }
     },
     destroyed: function () {
@@ -5476,6 +5482,14 @@ function checkTagDisabled () {
         this.proxyTags = item.agency ? item.agency.split(',') : []
         beforeSubmit('page-init-recovery');
       },
+      // 回显信息类型下拉框筛选条件
+      setInfoTypeEcho: function (param) {
+        //  回显信息类型下拉组件
+        try{
+          this.$refs.selectInfoType.initData()
+          this.$refs.selectInfoType.processingsubtype(param)
+        }catch(e){}
+      },
       // 删除筛选项
       onDeleteFilter: function (id) {
         var _this = this