import{r as d,d as I,u as L,a as P,o as A,f as p,h as M,c as $,b as a,w as o,i as q,j as c,N as E,B as S,k as w,l as z,g as x,e as f,n as K,p as b,_ as G}from"./index-CkzfmDGw.js";import{S as H}from"./SearchOutline-BKr0yDBJ.js";import{R as J}from"./RefreshOutline-DXhpU5zO.js";const Q={page(e){return d({url:"/biz/user/page",method:"get",params:e})},detail(e){return d({url:`/biz/user/${e}`,method:"get"})},create(e){return d({url:"/biz/user",method:"post",data:e})},update(e){return d({url:"/biz/user",method:"put",data:e})},delete(e){return d({url:`/biz/user/${e.join(",")}`,method:"delete"})},export(e){var v;const l={};return(v=e==null?void 0:e.ids)!=null&&v.length&&(l.ids=e.ids.join(",")),(e==null?void 0:e.id)!==void 0&&(e==null?void 0:e.id)!==null&&(l.id=e.id),(e==null?void 0:e.name)!==void 0&&(e==null?void 0:e.name)!==null&&(l.name=e.name),(e==null?void 0:e.status)!==void 0&&(e==null?void 0:e.status)!==null&&(l.status=e.status),d({url:"/biz/user/export",method:"get",params:l,responseType:"blob"})},importData(e){const l=new FormData;return l.append("file",e),d({url:"/biz/user/import",method:"post",data:l,headers:{"Content-Type":"multipart/form-data"}})},downloadTemplate(){return d({url:"/biz/user/template",method:"get",responseType:"blob"})}},W={class:"page-container"},X={class:"search-form"},Y=I({__name:"index1",setup(e){L(),P();const l=x({id:null,name:"",status:null}),v=f([]),y=f(!1),C=f([]),s=x({page:1,pageSize:10,itemCount:0,showSizePicker:!0,pageSizes:[10,20,50]}),h=f([]),_=f([]),m=f([]),N=[{title:"微信id",key:"wuid"},{title:"手机号",key:"phone"},{title:"微信昵称",key:"nickName"},{title:"用户头像",key:"avatarUrl",width:100,render(n){return n.avatarUrl?K("img",{src:n.avatarUrl,style:{width:"60px",height:"60px",objectFit:"cover",borderRadius:"4px"}}):"-"}},{title:"名称",key:"name"},{title:"用户性别",key:"gender",render(n){const t=n.gender,u=h.value.find(i=>i.value===t||String(i.value)===String(t));return u?u.label:t??"-"}},{title:"资产人资图片",key:"assetsUrl"},{title:"资产审核结果",key:"assetsState",render(n){const t=n.assetsState,u=m.value.find(i=>i.value===t||String(i.value)===String(t));return u?u.label:t??"-"}},{title:"银行卡号",key:"bankCard"},{title:"开户行名称",key:"bankOpenName"},{title:"创建时间",key:"createTime"},{title:"修改时间",key:"updateTime"},{title:"创建人",key:"createBy"},{title:"更新人",key:"updateBy"},{title:"状态",key:"status",render(n){const t=n.status,u=_.value.find(i=>i.value===t||String(i.value)===String(t));return u?u.label:t??"-"}},{title:"操作",key:"actions",width:140,fixed:"right",render(n){}}];async function g(){y.value=!0;try{const n=await Q.page({page:s.page,pageSize:s.pageSize,id:l.id||void 0,name:l.name||void 0,status:l.status||void 0});v.value=n.list,s.itemCount=n.total}finally{y.value=!1}}function k(){s.page=1,g()}function B(){l.id=null,l.name="",l.status=null,k()}function T(n){s.page=n,g()}function U(n){s.pageSize=n,s.page=1,g()}function V(n){C.value=n}async function D(){try{const n=await b.listByType("gender");h.value=n.map(t=>({label:t.dictLabel,value:Number(t.dictValue)||t.dictValue}))}catch{}try{const n=await b.listByType("sys_status");_.value=n.map(t=>({label:t.dictLabel,value:Number(t.dictValue)||t.dictValue}))}catch{}try{const n=await b.listByType("assets_state");m.value=n.map(t=>({label:t.dictLabel,value:Number(t.dictValue)||t.dictValue}))}catch{}}return A(()=>{g(),D()}),(n,t)=>{const u=p("n-input"),i=p("n-form-item"),O=p("n-select"),R=p("n-form"),j=p("n-data-table"),F=p("n-card");return M(),$("div",W,[a(F,null,{default:o(()=>[q("div",X,[a(R,{inline:"",model:l,"label-placement":"left"},{default:o(()=>[a(i,{label:"id"},{default:o(()=>[a(u,{value:l.id,"onUpdate:value":t[0]||(t[0]=r=>l.id=r),placeholder:"请输入id",clearable:""},null,8,["value"])]),_:1}),a(i,{label:"名称"},{default:o(()=>[a(u,{value:l.name,"onUpdate:value":t[1]||(t[1]=r=>l.name=r),placeholder:"请输入名称",clearable:""},null,8,["value"])]),_:1}),a(i,{label:"状态"},{default:o(()=>[a(O,{value:l.status,"onUpdate:value":t[2]||(t[2]=r=>l.status=r),placeholder:"请选择状态",clearable:"",style:{width:"150px"},options:_.value},null,8,["value","options"])]),_:1}),a(i,null,{default:o(()=>[a(c(E),null,{default:o(()=>[a(c(S),{type:"primary",onClick:k},{icon:o(()=>[a(c(z),null,{default:o(()=>[a(c(H))]),_:1})]),default:o(()=>[t[3]||(t[3]=w(" 搜索 ",-1))]),_:1}),a(c(S),{onClick:B},{icon:o(()=>[a(c(z),null,{default:o(()=>[a(c(J))]),_:1})]),default:o(()=>[t[4]||(t[4]=w(" 重置 ",-1))]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),a(j,{columns:N,data:v.value,loading:y.value,pagination:s,"row-key":r=>r.id,"scroll-x":1200,"onUpdate:page":T,"onUpdate:pageSize":U,"onUpdate:checkedRowKeys":V},null,8,["data","loading","pagination","row-key"])]),_:1})])}}}),ne=G(Y,[["__scopeId","data-v-afec3f85"]]);export{ne as default};
