From e3cbbee6b74a42d2995e9c08fce1b149a7228d25 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 22 Sep 2023 16:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/search/SearchForm.jsx | 16 ++++++------ src/stores/DatePickerStore.js | 37 +++++++++++++++------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/components/search/SearchForm.jsx b/src/components/search/SearchForm.jsx index 9dca78c..36bccbe 100644 --- a/src/components/search/SearchForm.jsx +++ b/src/components/search/SearchForm.jsx @@ -278,14 +278,6 @@ function getFields(props) { , 2 ), - item( - 'dates', - 99, - - - , - midCol - ), item( 'years', 99, @@ -303,6 +295,14 @@ function getFields(props) { , 2 ), + item( + 'dates', + 99, + + + , + midCol + ), item( 'operator', 99, diff --git a/src/stores/DatePickerStore.js b/src/stores/DatePickerStore.js index d4f24eb..1609148 100644 --- a/src/stores/DatePickerStore.js +++ b/src/stores/DatePickerStore.js @@ -10,23 +10,6 @@ class DatePickerStore { makeAutoObservable(this); } - formValues = { - 'DepartmentList': { 'key': 'ALL', 'label': '所有小组' }, - 'WebCode': { 'key': 'ALL', 'label': '所有来源' }, - 'IncludeTickets': { 'key': '1', 'label': '含门票' }, - 'DateType': { 'key': 'applyDate', 'label': '提交日期' }, - 'year': moment(), - }; - - formValuesToSub = { - DepartmentList: 'ALL', - WebCode: 'ALL', - IncludeTickets: '1', - DateType: 'applyDate', - Date1: moment().startOf('year').format('YYYY-MM-DD'), - Date2: moment().endOf('year').format('YYYY-MM-DD 23:59'), - }; - start_date = moment().startOf('week').subtract(7, 'days'); end_date = moment().endOf('week').subtract(7, 'days'); start_date_cp = false; @@ -57,6 +40,26 @@ class DatePickerStore { return [moment(this.start_date).subtract(1, 'year'), moment(this.end_date).subtract(1, 'year')]; } + + formValues = { + 'DepartmentList': { 'key': 'ALL', 'label': '所有小组' }, + 'WebCode': { 'key': 'ALL', 'label': '所有来源' }, + 'IncludeTickets': { 'key': '1', 'label': '含门票' }, + 'DateType': { 'key': 'applyDate', 'label': '提交日期' }, + 'years': this.start_date, + // 'months': [moment(), moment()], + 'dates': [this.start_date, this.end_date], + }; + + formValuesToSub = { + DepartmentList: 'ALL', + WebCode: 'ALL', + IncludeTickets: '1', + DateType: 'applyDate', + Date1: this.start_date.format('YYYY-MM-DD'), + Date2: this.end_date.format('YYYY-MM-DD 23:59'), + }; + setFormValues(data){ this.formValues = data; }