import{i as e,t}from"./react-B8IZ02wI.js";import{t as n}from"./button-DqbiydrF.js";import{t as r}from"./table-BvNKB5G4.js";import{t as i}from"./descriptions-jIXgutZ5.js";import{T as a}from"./authStore-BvQBJ9ky.js";import{On as o,at as s,kn as c,n as l}from"./index-Bg7bo8aA.js";import{i as u,r as d}from"./fieldAccess-Ce4C729w.js";import{t as f}from"./FieldAccessValue-BinuhcV3.js";import{t as p}from"./RealNamePersonFormModal-BSMB2VI1.js";import{t as m}from"./DetailNotFound-tUu8FUyt.js";var h=e(t(),1),g=l();function _(){let{id:e}=c(),t=o(),l=Number(e),[_,v]=(0,h.useState)(null),[y,b]=(0,h.useState)(!1),[x,S]=(0,h.useState)(!0),[C,w]=(0,h.useState)(!1),T=()=>{e&&(S(!0),w(!1),a.get(l).then(e=>v(e.data)).catch(()=>w(!0)).finally(()=>S(!1)))};if((0,h.useEffect)(()=>{T()},[e]),x&&!_)return(0,g.jsx)(`div`,{style:{padding:48,textAlign:`center`},children:`加载中…`});if(C||!_)return(0,g.jsx)(m,{backTo:`/real-name-persons`,title:`实名人不存在`});let E=_.bindings||[];return(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,justifyContent:`space-between`},children:[(0,g.jsx)(n,{onClick:()=>t(`/real-name-persons`),children:`← 返回实名人库`}),(0,g.jsx)(n,{onClick:()=>b(!0),children:`编辑`})]}),(0,g.jsxs)(`div`,{className:`panel-proto`,style:{marginBottom:16},children:[(0,g.jsx)(`div`,{className:`panel-proto-header`,children:(0,g.jsxs)(`h3`,{children:[_.fullName,` `,(0,g.jsx)(s,{children:_.personCode})]})}),(0,g.jsxs)(`div`,{className:`panel-proto-body`,children:[(0,g.jsxs)(i,{column:3,size:`small`,children:[u(d(_,`mobile`))&&(0,g.jsx)(i.Item,{label:`联系电话`,children:(0,g.jsx)(f,{entity:`real_name`,resourceId:l,fieldKey:`real_name.mobile`,label:`联系电话`,value:_.mobile,access:d(_,`mobile`)})}),(0,g.jsx)(i.Item,{label:`与公司关系`,children:_.relationLabel||`—`}),(0,g.jsx)(i.Item,{label:`关联员工`,children:_.linkedUserName?(0,g.jsx)(`a`,{onClick:()=>t(`/users/${_.linkedUserId}`),children:_.linkedUserName}):`—`}),u(d(_,`fullName`))&&(0,g.jsx)(i.Item,{label:`姓名`,children:(0,g.jsx)(f,{entity:`real_name`,resourceId:l,fieldKey:`real_name.full_name`,label:`姓名`,value:_.fullName,access:d(_,`fullName`)})}),u(d(_,`idCardNumber`))&&(0,g.jsx)(i.Item,{label:`身份证`,children:_.hasIdCard?(0,g.jsx)(f,{entity:`real_name`,resourceId:l,fieldKey:`real_name.id_card_number`,label:`身份证号`,value:_.idCardNumber,access:d(_,`idCardNumber`)}):`—`}),(0,g.jsx)(i.Item,{label:`身份证有效期`,children:_.idCardLongTerm?`长期`:`${_.idCardValidFrom||`—`} ~ ${_.idCardValidTo||`—`}`}),(0,g.jsx)(i.Item,{label:`开户行`,children:_.bankName||`—`}),u(d(_,`bankCardNumber`))&&(0,g.jsx)(i.Item,{label:`银行卡`,children:_.hasBankCard?(0,g.jsx)(f,{entity:`real_name`,resourceId:l,fieldKey:`real_name.bank_card_number`,label:`银行卡号`,value:_.bankCardNumber,access:d(_,`bankCardNumber`)}):`—`}),u(d(_,`bankReservedMobile`))&&(0,g.jsx)(i.Item,{label:`银行预留手机`,children:(0,g.jsx)(f,{entity:`real_name`,resourceId:l,fieldKey:`real_name.bank_reserved_mobile`,label:`银行预留手机`,value:_.bankReservedMobile,access:d(_,`bankReservedMobile`)})}),(0,g.jsx)(i.Item,{label:`状态`,children:(0,g.jsx)(s,{color:_.status===`ACTIVE`?`green`:`default`,children:_.status===`ACTIVE`?`正常`:String(_.status)})})]}),_.remark&&(0,g.jsxs)(`div`,{style:{marginTop:16,padding:`12px 14px`,background:`#f8fafc`,borderRadius:8,border:`1px solid var(--card-border)`},children:[(0,g.jsx)(`div`,{style:{fontSize:12,color:`#6b7280`,marginBottom:6},children:`关系备注说明`}),(0,g.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,lineHeight:1.6,fontSize:14},children:_.remark})]})]})]}),(0,g.jsxs)(`div`,{className:`panel-proto`,children:[(0,g.jsx)(`div`,{className:`panel-proto-header`,children:(0,g.jsx)(`h3`,{children:`绑定资产`})}),(0,g.jsx)(`div`,{className:`panel-proto-body`,style:{padding:0},children:(0,g.jsx)(r,{size:`small`,rowKey:`id`,dataSource:E,pagination:!1,columns:[{title:`资产类型`,dataIndex:`resourceType`},{title:`资产`,dataIndex:`resourceLabel`},{title:`绑定角色`,dataIndex:`bindingRole`},{title:`状态`,dataIndex:`isCurrent`,render:e=>(0,g.jsx)(s,{color:e?`green`:`default`,children:e?`当前`:`历史`})},{title:`生效`,render:(e,t)=>`${t.effectiveFrom||`—`} ~ ${t.effectiveTo||`至今`}`},{title:`操作`,render:(e,r)=>r.resourceType===`ACCOUNT`?(0,g.jsx)(n,{type:`link`,size:`small`,onClick:()=>t(`/accounts/${r.resourceId}`),children:`查看账号`}):null}]})})]}),(0,g.jsx)(p,{open:y,person:_,onClose:()=>b(!1),onSuccess:T})]})}export{_ as default};