Kaynağa Gözat

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

xujing 5 yıl önce
ebeveyn
işleme
963259f931

+ 5
- 0
src/pages/statistical/consultant/homePagePersons.jsx Dosyayı Görüntüle

@@ -5,6 +5,7 @@ import moment from 'moment';
5 5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
6 6
 import apis from '../../../services/apis';
7 7
 import request from '../../../utils/request'
8
+import Prompt from 'umi/prompt';
8 9
 
9 10
 /**
10 11
   @param {*} props
@@ -126,6 +127,10 @@ function record(props) {
126 127
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
127 128
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
128 129
             </div>
130
+            <Prompt message={location =>
131
+        location.pathname.startsWith("/statistical/consultant")
132
+          ? true
133
+          : localStorage.removeItem("consultantPageParams")} />
129 134
         </>
130 135
     )
131 136
 }

+ 21
- 1
src/pages/statistical/consultant/index.jsx Dosyayı Görüntüle

@@ -6,6 +6,7 @@ import BuildSelect from '../../../components/SelectButton/BuildSelect'
6 6
 import apis from '../../../services/apis';
7 7
 import request from '../../../utils/request'
8 8
 import AuthButton from '../../../components/AuthButton';
9
+import Prompt from 'umi/prompt';
9 10
 
10 11
 /**
11 12
   @param {*} props
@@ -34,12 +35,27 @@ function record(props) {
34 35
     const [visible, setVisible] = useState(false)
35 36
 
36 37
     useEffect(() => {
37
-        getList(formData);
38
+        if (localStorage.getItem("consultantPageParams")) {
39
+            props.form.setFieldsValue(JSON.parse(localStorage.getItem("consultantPageParams")));
40
+            const consultantPageParams = JSON.parse(localStorage.getItem("consultantPageParams"))
41
+            updateRadioVal(moment(consultantPageParams.endDate).diff(moment(consultantPageParams.startDate), 'day'))
42
+            updateFormData({
43
+                ...formData,
44
+                startDate: consultantPageParams.startDate,
45
+                endDate: consultantPageParams.endDate,
46
+                buildingId: consultantPageParams.buildingId,
47
+                pageNum:consultantPageParams.pageNum
48
+            })
49
+            getList(JSON.parse(localStorage.getItem("consultantPageParams")))
50
+          } else {
51
+            getList(formData);
52
+          }
38 53
     }, [])
39 54
 
40 55
     // 查询列表
41 56
     const getList = (params) => {
42 57
         updataLoading(true)
58
+        localStorage.setItem("consultantPageParams", JSON.stringify(params));
43 59
         request({ ...apis.stats.consultantKPI, params: { ...params }, }).then((data) => {
44 60
             setData(data.paged)
45 61
             setTotalRow(data.total)
@@ -448,6 +464,10 @@ function record(props) {
448 464
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
449 465
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
450 466
             </div>
467
+            <Prompt message={location =>
468
+        location.pathname.startsWith("/statistical/consultant")
469
+          ? true
470
+          : localStorage.removeItem("consultantPageParams")} />
451 471
         </>
452 472
     )
453 473
 }

+ 5
- 0
src/pages/statistical/consultant/sharetable.jsx Dosyayı Görüntüle

@@ -4,6 +4,7 @@ import router from 'umi/router';
4 4
 import moment from 'moment';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request'
7
+import Prompt from 'umi/prompt';
7 8
 
8 9
 const typeList = [
9 10
     {
@@ -190,6 +191,10 @@ function record(props) {
190 191
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
191 192
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
192 193
             </div>
194
+            <Prompt message={location =>
195
+        location.pathname.startsWith("/statistical/consultant")
196
+          ? true
197
+          : localStorage.removeItem("consultantPageParams")} />
193 198
         </>
194 199
     )
195 200
 }

+ 5
- 0
src/pages/statistical/consultant/table.jsx Dosyayı Görüntüle

@@ -5,6 +5,7 @@ import moment from 'moment';
5 5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
6 6
 import apis from '../../../services/apis';
7 7
 import request from '../../../utils/request'
8
+import Prompt from 'umi/prompt';
8 9
 
9 10
 /**
10 11
   @param {*} props
@@ -160,6 +161,10 @@ function record(props) {
160 161
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
161 162
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
162 163
             </div>
164
+            <Prompt message={location =>
165
+        location.pathname.startsWith("/statistical/consultant")
166
+          ? true
167
+          : localStorage.removeItem("consultantPageParams")} />
163 168
         </>
164 169
     )
165 170
 }

+ 5
- 0
src/pages/statistical/consultant/visitNum.jsx Dosyayı Görüntüle

@@ -4,6 +4,7 @@ import router from 'umi/router';
4 4
 import moment from 'moment';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request'
7
+import Prompt from 'umi/prompt';
7 8
 
8 9
 const typeList = [
9 10
     {
@@ -200,6 +201,10 @@ function record(props) {
200 201
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
201 202
                 <Pagination showQuickJumper defaultCurrent={1} loading={loading} total={data.total} onChange={changePageNum} current={data.current} />
202 203
             </div>
204
+            <Prompt message={location =>
205
+        location.pathname.startsWith("/statistical/consultant")
206
+          ? true
207
+          : localStorage.removeItem("consultantPageParams")} />
203 208
         </>
204 209
     )
205 210
 }

+ 5
- 0
src/pages/statistical/consultant/visitPersons.jsx Dosyayı Görüntüle

@@ -5,6 +5,7 @@ import moment from 'moment';
5 5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
6 6
 import apis from '../../../services/apis';
7 7
 import request from '../../../utils/request'
8
+import Prompt from 'umi/prompt';
8 9
 
9 10
 /**
10 11
   @param {*} props
@@ -118,6 +119,10 @@ function record(props) {
118 119
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
119 120
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
120 121
             </div>
122
+            <Prompt message={location =>
123
+        location.pathname.startsWith("/statistical/consultant")
124
+          ? true
125
+          : localStorage.removeItem("consultantPageParams")} />
121 126
         </>
122 127
     )
123 128
 }