傅行帆 5 年前
父节点
当前提交
511369abcf

+ 10
- 1
src/pages/customer/customerlist/customerDetail.jsx 查看文件

@@ -5,6 +5,7 @@ import styles from './style.less';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request';
7 7
 import moment from 'moment';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8 9
 
9 10
 import router from 'umi/router';
10 11
 
@@ -19,6 +20,7 @@ function header(props) {
19 20
   const [tableData, setTableDataData] = useState([{}])
20 21
   const [dataConsultant, setDataonsultant] = useState({})
21 22
   const [intentionData, setIntentionData] = useState([])
23
+  const [buildingIdValue, setBuildingIdData] = useState()
22 24
 
23 25
   // eslint-disable-next-line react-hooks/rules-of-hooks
24 26
   useEffect(() => {
@@ -71,6 +73,12 @@ function header(props) {
71 73
       setDataonsultant(res.geoInfo)
72 74
     })
73 75
   }
76
+
77
+  function changBuilding(buildingId) {
78
+    setBuildingIdData(buildingId)
79
+    getById({ pageNumber: 1, pageSize: 10, buildingId: buildingId })
80
+  }
81
+
74 82
   const columns = [
75 83
     {
76 84
       title: '访问事件',
@@ -190,7 +198,8 @@ function header(props) {
190 198
       </div>
191 199
       <div className={styles.recordBox}>
192 200
         <p className={styles.tableName}>访问记录</p>
193
-        <Table dataSource={tableData.records} columns={columns} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
201
+        <BuildSelect onChange={changBuilding} value={buildingIdValue} />
202
+        <Table dataSource={tableData.records} columns={columns} style={{marginTop: '15px'}} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
194 203
         {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
195 204
       </div>
196 205
 

+ 10
- 1
src/pages/customer/customerlist/publicCustomerDetail.jsx 查看文件

@@ -5,6 +5,7 @@ import publicStyle from './publicStyle.less';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request';
7 7
 import moment from 'moment';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8 9
 
9 10
 import router from 'umi/router';
10 11
 
@@ -19,6 +20,7 @@ function header(props) {
19 20
   const [tableData, setTableDataData] = useState([{ }])
20 21
   const [dataConsultant, setDataonsultant] = useState({})
21 22
   const [intentionData, setIntentionData] = useState([])
23
+  const [buildingIdValue, setBuildingIdData] = useState()
22 24
 
23 25
   // eslint-disable-next-line react-hooks/rules-of-hooks
24 26
   useEffect(() => {
@@ -72,6 +74,12 @@ function onChange(number) {
72 74
       setDataonsultant(res.geoInfo)
73 75
     })
74 76
   }
77
+
78
+  function changBuilding(buildingId) {
79
+    setBuildingIdData(buildingId)
80
+    getById({ pageNumber: 1, pageSize: 10, buildingId: buildingId })
81
+  }
82
+
75 83
   const columns = [
76 84
     {
77 85
       title: '访问事件',
@@ -158,7 +166,8 @@ function onChange(number) {
158 166
       </div>
159 167
       <div className={publicStyle.recordBox}>
160 168
         <p className={publicStyle.tableName}>访问记录</p>
161
-        <Table dataSource={tableData.records} columns={columns} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
169
+        <BuildSelect onChange={changBuilding} value={buildingIdValue} />
170
+        <Table dataSource={tableData.records} columns={columns} style={{marginTop: '15px'}} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
162 171
       </div>
163 172
     </>
164 173
   )