Commit c8cadeda96726dbbbc47ca006dd42b6c676d9837
Merge branch '云南五彩' of http://git.xlyprint.cn/xlyErp/xlyUmi into 云南五彩
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 | 328 | <div className={styles.listViewStyle}> |
| 329 | 329 | <ListView |
| 330 | 330 | dataSource={slaveData} |
| 331 | - renderFooter={() => ( | |
| 332 | - <div style={{ padding: 30, textAlign: 'center' }}> | |
| 333 | - {this.state.isLoading ? '加载中...' : '加载完毕'} | |
| 334 | - </div>)} | |
| 331 | + renderFooter={() => { | |
| 332 | + const { isLoading } = this.state; | |
| 333 | + const sEmployeeFace = commonUtils.isNotEmptyArr(slaveDataOld) ? slaveDataOld[0].sEmployeeFace : ''; | |
| 334 | + | |
| 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' && sEmployeeFace) { | |
| 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 | 395 | renderRow={row} |
| 336 | 396 | renderSeparator={separator} |
| 337 | 397 | style={{ | ... | ... |