فهرست منبع

工作汇报列表添加时间筛选

xiaohaizhao 2 سال پیش
والد
کامیت
312e622280
2فایلهای تغییر یافته به همراه25 افزوده شده و 3 حذف شده
  1. 24 2
      packageA/report/index.js
  2. 1 1
      packageA/report/index.wxml

+ 24 - 2
packageA/report/index.js

@@ -35,6 +35,23 @@ Page({
                 name: "未读",
                 value: "0"
             }]
+        }, {
+            label: "时间筛选",
+            index: null,
+            showName: "name", //显示字段
+            valueKey: "date", //返回Key
+            selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+            value: "", //选中值
+            list: [{
+                name: "今日",
+                value: "today"
+            }, {
+                name: "最近三天",
+                value: "lastthreedays"
+            }, {
+                name: "最近一周",
+                value: "lastWeek"
+            }]
         }],
         isread: {
             label: "阅读状态",
@@ -130,9 +147,14 @@ Page({
     handleFilter({
         detail
     }) {
-        let condition = this.data.where.condition;
+        console.log(detail)
+        detail.condition = this.data.where.condition;
+        detail.today = 0
+        detail.lastthreedays = 0
+        detail.lastWeek = 0
+        if (detail.date) detail[detail.date] = 1;
         this.data.where = detail;
-        this.data.where.condition = condition;
+        console.log(detail)
         this.selectComponent("#" + this.data.active).getList(true);
     },
     onClick() {

+ 1 - 1
packageA/report/index.wxml

@@ -23,4 +23,4 @@
         <Yl_FloatingButton />
     </picker>
 </block>
-<Yl_Filtrate1 id='Yl_Filtrate1' show='{{filterShow}}' list="{{filtratelist}}" bindhandle="handleFilter" />
+<Yl_Filtrate1 id='Yl_Filtrate1' dateRange show='{{filterShow}}' list="{{filtratelist}}" bindhandle="handleFilter" />