广州市综治平台前端
liuwh
4 days ago fa5361c6776f01975737fb5630594a9c60924fc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * @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;