/*
|
* @Author: dminyi 1301963064@qq.com
|
* @Date: 2024-09-13 10:37:48
|
* @LastEditors: dminyi 1301963064@qq.com
|
* @LastEditTime: 2024-09-22 00:14:16
|
* @FilePath: \gzDyh\gz-customerSystem\src\views\register\matterDetail\personCard.jsx
|
* @Description:
|
*/
|
|
import React, { useEffect, useState } from 'react';
|
import { Modal } from '@arco-design/web-react';
|
import * as $$ from '@/utils/utility';
|
|
function getByIdRoleApi(id) {
|
return $$.ax.request({ url: `ctUser/getByIdRole?id=` + id, type: 'get', service: 'cust' });
|
}
|
|
const PersonCard = (props) => {
|
const [personData, setPersonData] = useState({})
|
const getByIdRole = async () => {
|
const res = await getByIdRoleApi(props.personId)
|
if (res.type) {
|
// setPersonView(!props.personView)
|
setPersonData(res.data)
|
console.log(res.data, 'res.data')
|
console.log(personData, 'personData')
|
}
|
}
|
|
useEffect(() => {
|
props.personId && getByIdRole()
|
}, [props.personId])
|
|
|
return (
|
<>
|
<Modal visible={props.personView} onCancel={props.handleCancel} title='工作人员信息' centered footer={null}>
|
<table border="1" align="center" cellpadding="5" className="table">
|
<tr>
|
<th bgcolor="#F7F8FA" className="table-title" width="120">姓名</th>
|
<td width='380'><div style={{ display: 'flex' }}><div>{personData?.trueName}</div></div></td>
|
<th bgcolor="#F7F8FA" className="table-title" width="120">登录账号</th>
|
<td width='380'>{personData?.acc}</td>
|
</tr>
|
<tr>
|
<th bgcolor="#F7F8FA" className="table-title">手机号码</th>
|
<td>{personData?.mobile}</td>
|
<th bgcolor="#F7F8FA" className="table-title">工作电话</th>
|
<td>-</td>
|
</tr>
|
<tr>
|
<th bgcolor="#F7F8FA" className="table-title">所属部门</th>
|
<td>{personData?.unitName}</td>
|
<th bgcolor="#F7F8FA" className="table-title">职务</th>
|
<td>{personData?.userRoles}</td>
|
</tr>
|
</table>
|
</Modal>
|
</>
|
)
|
}
|
|
export default PersonCard;
|