Commit fbf1a17899d88da40026c7522bab5fb4c1209fba
1 parent
89b90f87
1.手机端人员巡检增加已刷脸上班人员展示
Showing
1 changed file
with
64 additions
and
4 deletions
src/mobile/common/CommobileList.js
| @@ -328,10 +328,70 @@ class CommobileList extends React.Component { | @@ -328,10 +328,70 @@ class CommobileList extends React.Component { | ||
| 328 | <div className={styles.listViewStyle}> | 328 | <div className={styles.listViewStyle}> |
| 329 | <ListView | 329 | <ListView |
| 330 | dataSource={slaveData} | 330 | dataSource={slaveData} |
| 331 | - renderFooter={() => ( | ||
| 332 | - <div style={{ padding: 30, textAlign: 'center' }}> | ||
| 333 | - {this.state.isLoading ? '加载中...' : '加载完毕'} | ||
| 334 | - </div>)} | 331 | + renderFooter={() => { |
| 332 | + const { isLoading, sEmployeeFace = 'A在卷凹车间已上班,B在卷凹车间已上班,C在卷凹车间已上班,D在卷凹车间已上班' } = this.state; | ||
| 333 | + | ||
| 334 | + // 1. 加载中:只显示加载中 | ||
| 335 | + if (isLoading) { | ||
| 336 | + return ( | ||
| 337 | + <div style={{ padding: 30, textAlign: 'center' }}> | ||
| 338 | + 加载中... | ||
| 339 | + </div> | ||
| 340 | + ); | ||
| 341 | + } | ||
| 342 | + | ||
| 343 | + // 2. 加载完成 → 判断是不是指定页面 | ||
| 344 | + if (this.props.sModelsId === '172117190122117661213659540') { | ||
| 345 | + const statusList = sEmployeeFace | ||
| 346 | + ?.split(',') | ||
| 347 | + ?.filter(item => item.trim() !== '') || []; | ||
| 348 | + | ||
| 349 | + // 显示:加载完毕 + 员工状态列表 | ||
| 350 | + return ( | ||
| 351 | + <div> | ||
| 352 | + {/* 第一行:加载完毕 */} | ||
| 353 | + <div style={{ padding: '10px 30px', textAlign: 'center', fontSize: 14, color: '#666' }}> | ||
| 354 | + 加载完毕 | ||
| 355 | + </div> | ||
| 356 | + | ||
| 357 | + {/* 第二部分:员工状态卡片 */} | ||
| 358 | + <div style={{ | ||
| 359 | + padding: '16px 20px', | ||
| 360 | + textAlign: 'left', | ||
| 361 | + backgroundColor: '#f7f8fa', | ||
| 362 | + borderRadius: '8px', | ||
| 363 | + margin: '12px 1px', | ||
| 364 | + boxShadow: '0 1px 3px rgba(0,0,0,0.05)', | ||
| 365 | + }}> | ||
| 366 | + {statusList.length === 0 ? ( | ||
| 367 | + <div style={{ fontSize: 15, color: '#999' }}>暂无员工状态</div> | ||
| 368 | + ) : ( | ||
| 369 | + statusList.map((item, index) => ( | ||
| 370 | + <div | ||
| 371 | + key={index} | ||
| 372 | + style={{ | ||
| 373 | + fontSize: 15, | ||
| 374 | + color: '#ff0000', | ||
| 375 | + lineHeight: '24px', | ||
| 376 | + marginBottom: index === statusList.length - 1 ? 0 : '6px' | ||
| 377 | + }} | ||
| 378 | + > | ||
| 379 | + {item.trim()} | ||
| 380 | + </div> | ||
| 381 | + )) | ||
| 382 | + )} | ||
| 383 | + </div> | ||
| 384 | + </div> | ||
| 385 | + ); | ||
| 386 | + } | ||
| 387 | + | ||
| 388 | + // 3. 其他页面:只显示加载完毕 | ||
| 389 | + return ( | ||
| 390 | + <div style={{ padding: 30, textAlign: 'center' }}> | ||
| 391 | + 加载完毕 | ||
| 392 | + </div> | ||
| 393 | + ); | ||
| 394 | + }} | ||
| 335 | renderRow={row} | 395 | renderRow={row} |
| 336 | renderSeparator={separator} | 396 | renderSeparator={separator} |
| 337 | style={{ | 397 | style={{ |