import{d as f,r as a,t as $,A as E,f as O,j as e,I as g,B as m,h as V,Q as Y,i as u,g as c,a as _}from"./index-BtzNP73w.js";import{O as J}from"./index-Bulw9wNg.js";import{F as K}from"./Table-BCm752cP.js";import"./index-B6m4IotF.js";import"./iconUtil-D_WnT0lW.js";const G=f.div`
font-size: 16px;
height: 100%;
padding-left: 10px;
display: flex;
flex-direction: column;
  .topSearch {
    height: 60px;
    line-height: 60px;
    padding-left: 20px;
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    background-color: ${s=>s.theme.colorBgContainer};
    .searchflex {
      flex: 1;
      .searchInput {
        width:60%;
      }
      .ysh_search_TreeSelect {
        width:60%;
      }
    }
    .btns {
      display: flex;
      justify-content: flex-start;
      align-items: center;
    }
    .startBtn {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      padding-right: 25px;
    }
    .ysh_search_add {
      margin-left: 20px;
    }
  }
  .content {
    flex: 1;
    height: 100%;
    display: flex;
    overflow: hidden;
    .organ {
      width: 220px;
      height: 100%;
      margin-right: 16px;
      border-radius: 6px;
      background-color: ${s=>s.theme.colorBgContainer};
    }
    .tableBox {
      flex: 1;
      padding: 16px;
      box-sizing: border-box;
      overflow: hidden;
      border-radius: 6px;
      background-color: ${s=>s.theme.colorBgContainer};
    }
  }
`,H=f.div`
  padding: 20px;
  margin: 20px;
  border: 1px solid ${s=>s.theme.colorBorder};
  border-radius: 20px;
  .title {
    line-height: 36px;
    height: 36px;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 20px
  }
  .qr {
    width: 420px;
    height: 420px;
    margin: 0 auto;
    padding: 10px;
  }
  .btns {
    line-height: 36px;
    height: 36px;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 20px
  }
  .tip {
    margin-bottom: 20px;
    font-size: 14px;
    color: #f00;
    line-height: 24px;
    text-align: center;
  }
`,U=a.memo(()=>{const{token:s}=$.useToken(),{message:j}=E.useApp(),{genderList:y,militaryrankList:I,nationList:N}=O(t=>t),[w,x]=a.useState(!1),[i,d]=a.useState([]),[W,X]=a.useState(!1),[Z,S]=a.useState(!0),[l,b]=a.useState(""),[o,k]=a.useState(""),[ee,te]=a.useState(""),[v,z]=a.useState(null),[p,C]=a.useState(""),[B,F]=a.useState(!1),[h,P]=a.useState({});a.useEffect(()=>{(async()=>{const n=await c("/api/Person/All",{pageIndex:1,pageSize:9999999});d(n.data)})()},[]),a.useEffect(()=>{let t=i.length>0&&i.some(n=>n.flag===2);S(!t)},[i]);const R=t=>{b(t.target.value)},D=t=>{k(t.target.value)},Q=async()=>{const t={};l&&(t.PNum=l),o&&(t.PName=o),p&&(t.QorganizeId=p);const n=await c("/api/Person/All",{...t,pageIndex:1,pageSize:9999999});d(n.data)},T=t=>{A(t)},A=async t=>{C(t);const n={};l&&(n.PNum=l),o&&(n.PName=o),n.QorganizeId=t;try{const r=await c("/api/Person/All",{...n,pageIndex:1,pageSize:9999999});d(r.data)}catch(r){j.error(r),console.log(r)}finally{F(!1)}},L=()=>{x(!1)},M=t=>{z(`${t.id}|0|0`),P(t),x(!0)},q=[{title:"序 号",dataIndex:"index",align:"center",key:"index",render:(t,n,r)=>e.jsx(e.Fragment,{children:r+1})},{title:"账 号",dataIndex:"pNum",align:"center",key:"id",render:t=>e.jsx(e.Fragment,{children:t})},{title:"姓 名",dataIndex:"pName",align:"center",key:"id",render:t=>e.jsx(e.Fragment,{children:t})},{title:"性 别",dataIndex:"pSex",align:"center",key:"id",render:t=>e.jsx(e.Fragment,{children:y[t]})},{title:"生 日",dataIndex:"pBirthDate",align:"center",key:"id",render:t=>e.jsx(e.Fragment,{children:_(t).format("YYYY-MM-DD")})},{title:"职 位",dataIndex:"pMilitaryRank",align:"center",key:"id",render:t=>e.jsx(e.Fragment,{children:I[t]})},{title:"民 族",dataIndex:"pNation",align:"center",key:"id",render:t=>e.jsx(e.Fragment,{children:N[t]})},{title:"操作",dataIndex:"id",align:"center",key:"handle",render:(t,n)=>e.jsx(e.Fragment,{children:e.jsxs(m,{style:{width:"100px"},onClick:r=>M(n),children:[e.jsx(u,{})," 二维码"]})})}];return e.jsxs(G,{theme:s,children:[e.jsxs("div",{className:"topSearch",children:[e.jsxs("div",{className:"searchflex",children:[e.jsx("span",{children:"账 号: "}),e.jsx(g,{value:l,onChange:R,placeholder:"请输入账号",className:"searchInput",allowClear:!0})]}),e.jsxs("div",{className:"searchflex",children:[e.jsx("span",{children:"姓 名: "}),e.jsx(g,{className:"searchInput",value:o,onChange:D,allowClear:!0,placeholder:"请输入姓名"})]}),e.jsx("div",{className:"searchflex btns",children:e.jsx(m,{onClick:Q,className:"btn",children:"搜 索"})})]}),e.jsxs("div",{className:"content",children:[e.jsx("div",{className:"organ",children:e.jsx(J,{onSelectOrg:T})}),e.jsx("div",{className:"tableBox",children:i&&e.jsx(K,{rowKey:t=>t.id,size:"small",showExpandColumn:!1,columns:q,loading:B,dataSource:i,sticky:!0,pagination:{total:i.length||0,showSizeChanger:!0,showQuickJumper:!0,showTotal:t=>`共 ${t} 条`}})})]}),e.jsx(V,{text:e.jsxs("span",{children:[e.jsx(u,{}),"   二 维 码"]}),width:640,footer:null,open:w,onCancel:L,children:e.jsxs(H,{children:[e.jsxs("p",{className:"title",children:[e.jsx("span",{children:"账 号: "}),e.jsx("span",{children:h.pNum}),e.jsx("span",{children:"姓 名: "}),e.jsx("span",{children:h.pName})]}),e.jsx("div",{className:"qr",children:e.jsx(Y,{value:v,size:400})})]})})]})});U.displayName="VRQR";export{U as default};
