import{d as K,Q as L,r as T,a as N,o as R,E as x,c as d,R as j,f,g as G,h as C,l as t,m as i,M as g,q as h,K as _,j as D,i as M,w as O,k as P,x as q}from"./index.3a30a18d.js";import{C as y}from"./api.a76c2034.js";import{_ as H}from"./_plugin-vue_export-helper.cdc0426e.js";const J={class:"section-main-container layout-padding"},Q={class:"section-main-padding layout-padding-auto layout-padding-view"},$={class:"section-user-search mb15"},W=K({__name:"index",setup(X){var b;const S=L(),c=T(),e=N({loading:!1,securityGuardList:[],regulatorsList:[],props:{multiple:!0,checkStrictly:!1,emitPath:!0,value:"code",label:"name"},searchInfo:{name:"",companyName:"",idCardNo:"",superviseDepartIds:[],options:[],securityStationName:""},superviseDepartIdArr:[],userInfo:{superviseDesk:!1},totalCount:0,pageIndex:1,pageSize:10,pageCount:null});e.searchInfo.companyName=(b=S.query)==null?void 0:b.companyName,localStorage.getItem("userInfo")&&(e.userInfo={...e.userInfo,...JSON.parse(localStorage.getItem("userInfo"))}),console.info("userInfo",JSON.parse(localStorage.getItem("userInfo")));const w={multiple:!0,checkStrictly:!1,emitPath:!0,value:"code",label:"name"};R(()=>{B(),p(),e.userInfo.superviseDesk&&k()});const p=()=>{e.loading=!0;let o=[];c.value.getCheckedNodes().length&&c.value.getCheckedNodes().forEach(n=>o.push(n.value)),e.searchInfo.superviseDepartIds=o;let a={pageIndex:e.pageIndex,pageSize:e.pageSize,companyName:e.searchInfo.companyName,name:e.searchInfo.name,idCardNo:e.searchInfo.idCardNo,securityStationName:e.searchInfo.securityStationName,superviseDepartIds:e.searchInfo.superviseDepartIds};if(e.userInfo.superviseDesk){let n=[];c.value.getCheckedNodes().length&&c.value.getCheckedNodes().forEach(s=>n.push(s.value)),a.superviseDepartIds=n}y().unActivatedSecurityGuardSearchApi(a).then(n=>{let{status:s,message:m,data:r}=n;if(s!==200){x.error(m);return}let{pageCount:I,pageSize:u,totalCount:v}=r;e.pageSize=u,e.pageCount=I,e.totalCount=v,e.securityGuardList=r.data}),setTimeout(()=>{e.loading=!1},500)},B=()=>{y().searchDepartsApi().then(o=>{if(o.status==200){let a=o.data;e.searchInfo.options=a}})},k=()=>{y().searchDepartsApi().then(o=>{let{status:a,message:n,data:s}=o;if(a!==200){x.error(n);return}e.regulatorsList=s})},F=()=>{e.userInfo.superviseDesk&&c.value.getCheckedNodes().length&&c.value.$refs.panel.clearCheckedNodes();let o={name:"",companyName:"",idCardNo:"",securityStationName:"",superviseDepartIds:null,options:e.searchInfo.options};e.superviseDepartIdArr=[],e.searchInfo=N(o),q(()=>{p()})},E=()=>{const o={pageIndex:e.pageIndex,pageSize:e.pageSize,name:e.searchInfo.name,securityStationName:e.searchInfo.securityStationName,idCardNo:e.searchInfo.idCardNo,superviseDepartIds:e.searchInfo.superviseDepartIds};e.loading=!0,y().exportunActivatedSecurityApi(o).then(a=>{setTimeout(()=>{e.loading=!0,p()},500);const n=a,s=new Blob([n]),m="\u672A\u6FC0\u6D3B\u4EBA\u5458.xlsx";if("download"in document.createElement("a")){const r=document.createElement("a");r.download=m,r.style.display="none",r.href=URL.createObjectURL(s),document.body.appendChild(r),r.click(),URL.revokeObjectURL(r.href),document.body.removeChild(r)}else navigator.msSaveBlob(s,m)}).catch(a=>{})},A=o=>{e.pageSize=o,p()},V=o=>{e.pageIndex=o,p()};return(o,a)=>{const n=d("el-input"),s=d("el-form-item"),m=d("el-cascader"),r=d("el-button"),I=d("el-form"),u=d("el-table-column"),v=d("el-table"),z=d("el-pagination"),U=j("loading");return f(),G("div",J,[C("div",Q,[C("div",$,[t(I,{inline:!0,model:e.searchInfo,class:"demo-form-inline","label-position":"left",size:"default",onSubmit:a[5]||(a[5]=M(()=>{},["prevent"]))},{default:i(()=>[e.userInfo.superviseDesk?(f(),g(s,{key:0,label:"\u516C\u53F8\u540D\u79F0"},{default:i(()=>[t(n,{modelValue:e.searchInfo.companyName,"onUpdate:modelValue":a[0]||(a[0]=l=>e.searchInfo.companyName=l),placeholder:"\u8BF7\u8F93\u5165\u516C\u53F8\u540D\u79F0",clearable:"",onKeyup:h(p,["enter"]),style:{"max-width":"180px"}},null,8,["modelValue","onKeyup"])]),_:1})):_("",!0),t(s,{label:"\u59D3\u540D"},{default:i(()=>[t(n,{modelValue:e.searchInfo.name,"onUpdate:modelValue":a[1]||(a[1]=l=>e.searchInfo.name=l),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",clearable:"",onKeyup:h(p,["enter"]),style:{"max-width":"180px"}},null,8,["modelValue","onKeyup"])]),_:1}),t(s,{label:"\u8BC1\u4EF6\u53F7"},{default:i(()=>[t(n,{modelValue:e.searchInfo.idCardNo,"onUpdate:modelValue":a[2]||(a[2]=l=>e.searchInfo.idCardNo=l),placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u53F7",clearable:"",onKeyup:h(p,["enter"]),style:{"max-width":"180px"}},null,8,["modelValue","onKeyup"])]),_:1}),t(s,{label:"\u76D1\u7BA1\u673A\u6784"},{default:i(()=>[t(m,{modelValue:e.superviseDepartIdArr,"onUpdate:modelValue":a[3]||(a[3]=l=>e.superviseDepartIdArr=l),options:e.searchInfo.options,props:w,"collapse-tags":"","collapse-tags-tooltip":"","show-all-levels":!1,clearable:"",ref_key:"myCascader",ref:c},null,8,["modelValue","options"])]),_:1}),t(s,{label:"\u6240\u5C5E\u9A7B\u52E4\u70B9"},{default:i(()=>[t(n,{modelValue:e.searchInfo.securityStationName,"onUpdate:modelValue":a[4]||(a[4]=l=>e.searchInfo.securityStationName=l),placeholder:"\u8BF7\u8F93\u5165\u6240\u5C5E\u9A7B\u52E4\u70B9",clearable:"",onKeyup:h(p,["enter"]),style:{"max-width":"180px"}},null,8,["modelValue","onKeyup"])]),_:1}),t(s,null,{default:i(()=>[t(r,{type:"primary",onClick:p},{default:i(()=>[D("\u67E5\u8BE2")]),_:1}),t(r,{type:"default",onClick:F},{default:i(()=>[D("\u91CD\u7F6E")]),_:1}),t(r,{type:"primary",onClick:E},{default:i(()=>[D("\u5BFC\u51FA")]),_:1})]),_:1})]),_:1},8,["model"])]),O((f(),g(v,{data:e.securityGuardList,style:{width:"100%"}},{default:i(()=>[t(u,{type:"index",width:"80",label:"\u5E8F\u53F7",align:"center"}),t(u,{prop:"name",label:"\u59D3\u540D",align:"center","show-overflow-tooltip":""}),t(u,{prop:"sexText",label:"\u6027\u522B",align:"center","show-overflow-tooltip":""}),t(u,{prop:"idCardNo",label:"\u8BC1\u4EF6\u53F7",align:"center","show-overflow-tooltip":""}),t(u,{prop:"contact",label:"\u8054\u7CFB\u7535\u8BDD",align:"center","show-overflow-tooltip":""}),e.userInfo.superviseDesk?(f(),g(u,{key:0,prop:"companyName",label:"\u516C\u53F8\u540D\u79F0",align:"center","show-overflow-tooltip":""})):_("",!0),e.userInfo.superviseDesk?(f(),g(u,{key:1,prop:"superviseDepartName",label:"\u6240\u5C5E\u76D1\u7BA1\u673A\u6784",align:"center","show-overflow-tooltip":""})):_("",!0),t(u,{prop:"authenticatedStatusText",label:"\u5B9E\u540D\u8BA4\u8BC1",align:"center","show-overflow-tooltip":""}),t(u,{label:"\u6301\u8BC1\u60C5\u51B5",align:"center","show-overflow-tooltip":""},{default:i(l=>[C("span",null,P(l.row.hasSecurityCertificateNo?"\u662F":"\u5426"),1)]),_:1}),t(u,{prop:"securityStationName",label:"\u6240\u5C5E\u9A7B\u52E4\u70B9",align:"center","show-overflow-tooltip":""})]),_:1},8,["data"])),[[U,e.loading]]),t(z,{onSizeChange:A,onCurrentChange:V,class:"mt15","pager-count":5,"page-sizes":[10,20,30,100,200,300,1e3],"current-page":e.pageIndex,"onUpdate:current-page":a[6]||(a[6]=l=>e.pageIndex=l),background:"","page-size":e.pageSize,"onUpdate:page-size":a[7]||(a[7]=l=>e.pageSize=l),layout:"total, sizes, prev, pager, next, jumper",total:e.totalCount},null,8,["current-page","page-size","total"])])])}}});const ae=H(W,[["__scopeId","data-v-0fa38329"]]);export{ae as default};