傅行帆 5 年 前
コミット
511369abcf
共有2 個のファイルを変更した20 個の追加2 個の削除を含む
  1. 10
    1
      src/pages/customer/customerlist/customerDetail.jsx
  2. 10
    1
      src/pages/customer/customerlist/publicCustomerDetail.jsx

+ 10
- 1
src/pages/customer/customerlist/customerDetail.jsx ファイルの表示

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 moment from 'moment';
7
 import moment from 'moment';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
 
9
 
9
 import router from 'umi/router';
10
 import router from 'umi/router';
10
 
11
 
19
   const [tableData, setTableDataData] = useState([{}])
20
   const [tableData, setTableDataData] = useState([{}])
20
   const [dataConsultant, setDataonsultant] = useState({})
21
   const [dataConsultant, setDataonsultant] = useState({})
21
   const [intentionData, setIntentionData] = useState([])
22
   const [intentionData, setIntentionData] = useState([])
23
+  const [buildingIdValue, setBuildingIdData] = useState()
22
 
24
 
23
   // eslint-disable-next-line react-hooks/rules-of-hooks
25
   // eslint-disable-next-line react-hooks/rules-of-hooks
24
   useEffect(() => {
26
   useEffect(() => {
71
       setDataonsultant(res.geoInfo)
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
   const columns = [
82
   const columns = [
75
     {
83
     {
76
       title: '访问事件',
84
       title: '访问事件',
190
       </div>
198
       </div>
191
       <div className={styles.recordBox}>
199
       <div className={styles.recordBox}>
192
         <p className={styles.tableName}>访问记录</p>
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
         {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
203
         {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
195
       </div>
204
       </div>
196
 
205
 

+ 10
- 1
src/pages/customer/customerlist/publicCustomerDetail.jsx ファイルの表示

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 moment from 'moment';
7
 import moment from 'moment';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
 
9
 
9
 import router from 'umi/router';
10
 import router from 'umi/router';
10
 
11
 
19
   const [tableData, setTableDataData] = useState([{ }])
20
   const [tableData, setTableDataData] = useState([{ }])
20
   const [dataConsultant, setDataonsultant] = useState({})
21
   const [dataConsultant, setDataonsultant] = useState({})
21
   const [intentionData, setIntentionData] = useState([])
22
   const [intentionData, setIntentionData] = useState([])
23
+  const [buildingIdValue, setBuildingIdData] = useState()
22
 
24
 
23
   // eslint-disable-next-line react-hooks/rules-of-hooks
25
   // eslint-disable-next-line react-hooks/rules-of-hooks
24
   useEffect(() => {
26
   useEffect(() => {
72
       setDataonsultant(res.geoInfo)
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
   const columns = [
83
   const columns = [
76
     {
84
     {
77
       title: '访问事件',
85
       title: '访问事件',
158
       </div>
166
       </div>
159
       <div className={publicStyle.recordBox}>
167
       <div className={publicStyle.recordBox}>
160
         <p className={publicStyle.tableName}>访问记录</p>
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
       </div>
171
       </div>
163
     </>
172
     </>
164
   )
173
   )