浏览代码

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

xujing 5 年前
父节点
当前提交
963259f931

+ 5
- 0
src/pages/statistical/consultant/homePagePersons.jsx 查看文件

5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
6
 import apis from '../../../services/apis';
6
 import apis from '../../../services/apis';
7
 import request from '../../../utils/request'
7
 import request from '../../../utils/request'
8
+import Prompt from 'umi/prompt';
8
 
9
 
9
 /**
10
 /**
10
   @param {*} props
11
   @param {*} props
126
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
127
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
127
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
128
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
128
             </div>
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 查看文件

6
 import apis from '../../../services/apis';
6
 import apis from '../../../services/apis';
7
 import request from '../../../utils/request'
7
 import request from '../../../utils/request'
8
 import AuthButton from '../../../components/AuthButton';
8
 import AuthButton from '../../../components/AuthButton';
9
+import Prompt from 'umi/prompt';
9
 
10
 
10
 /**
11
 /**
11
   @param {*} props
12
   @param {*} props
34
     const [visible, setVisible] = useState(false)
35
     const [visible, setVisible] = useState(false)
35
 
36
 
36
     useEffect(() => {
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
     const getList = (params) => {
56
     const getList = (params) => {
42
         updataLoading(true)
57
         updataLoading(true)
58
+        localStorage.setItem("consultantPageParams", JSON.stringify(params));
43
         request({ ...apis.stats.consultantKPI, params: { ...params }, }).then((data) => {
59
         request({ ...apis.stats.consultantKPI, params: { ...params }, }).then((data) => {
44
             setData(data.paged)
60
             setData(data.paged)
45
             setTotalRow(data.total)
61
             setTotalRow(data.total)
448
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
464
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
449
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
465
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
450
             </div>
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 查看文件

4
 import moment from 'moment';
4
 import moment from 'moment';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import request from '../../../utils/request'
6
 import request from '../../../utils/request'
7
+import Prompt from 'umi/prompt';
7
 
8
 
8
 const typeList = [
9
 const typeList = [
9
     {
10
     {
190
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
191
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
191
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
192
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
192
             </div>
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 查看文件

5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
6
 import apis from '../../../services/apis';
6
 import apis from '../../../services/apis';
7
 import request from '../../../utils/request'
7
 import request from '../../../utils/request'
8
+import Prompt from 'umi/prompt';
8
 
9
 
9
 /**
10
 /**
10
   @param {*} props
11
   @param {*} props
160
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
161
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
161
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
162
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
162
             </div>
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 查看文件

4
 import moment from 'moment';
4
 import moment from 'moment';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import request from '../../../utils/request'
6
 import request from '../../../utils/request'
7
+import Prompt from 'umi/prompt';
7
 
8
 
8
 const typeList = [
9
 const typeList = [
9
     {
10
     {
200
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
201
             < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
201
                 <Pagination showQuickJumper defaultCurrent={1} loading={loading} total={data.total} onChange={changePageNum} current={data.current} />
202
                 <Pagination showQuickJumper defaultCurrent={1} loading={loading} total={data.total} onChange={changePageNum} current={data.current} />
202
             </div>
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 查看文件

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