Kaynağa Gözat

添加领域筛选

xiaohaizhao 2 yıl önce
ebeveyn
işleme
eeadf9e45a
2 değiştirilmiş dosya ile 36 ekleme ve 2 silme
  1. 34 1
      packageA/salesHourglass/index.js
  2. 2 1
      project.private.config.json

+ 34 - 1
packageA/salesHourglass/index.js

@@ -52,6 +52,7 @@ Page({
             where: {
                 begdate: "",
                 enddate: "",
+                tradefield: ""
             }
         },
         filtratelist: [null, {
@@ -133,6 +134,34 @@ Page({
                 "filtratelist[0]": data
             });
         });
+
+        _Http.basic({
+            "id": 20221223141802,
+            "content": {
+                "pageNumber": 1,
+                "pageSize": 9999,
+                "where": {
+                    "condition": ""
+                }
+            }
+        }, false).then(res => {
+            console.log("获取领域", res)
+            let filtratelist = this.data.filtratelist
+            if (res.msg == '成功') {
+                filtratelist.splice(filtratelist.length - 1, 0, {
+                    label: "领域",
+                    index: null,
+                    showName: "tradefield", //显示字段
+                    valueKey: "tradefield", //返回Key
+                    selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
+                    value: "", //选中值
+                    list: res.data
+                })
+                this.setData({
+                    filtratelist
+                })
+            }
+        })
     },
     onReady() {
         this.setChartData();
@@ -151,11 +180,13 @@ Page({
 
     },
     handleFilter(e) {
+        console.log(e)
         let {
             active,
             dateType,
             enddate,
-            startdate
+            startdate,
+            tradefield
         } = e.detail;
         if (active && active != 'id') {
             this.data.content.type = active.type == '人员' ? 0 : 1;
@@ -171,6 +202,8 @@ Page({
         } else {
             this.data.content.dateType = dateType && dateType != 'id' ? dateType : 0
         }
+
+        this.data.content.tradefield = tradefield
         this.setChartData();
     },
     setChartData() {

+ 2 - 1
project.private.config.json

@@ -100,5 +100,6 @@
                 }
             ]
         }
-    }
+    },
+    "libVersion": "3.3.3"
 }