import{M as x,a0 as R,ax as $}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897336.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang.17037962789733.js";import{_ as m}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import K from"./AddBindUserDialog.1703796278973.js";import{m as q,n as N}from"./department.1703796278973.js";import{d as S,k as u,v as T,m as V,r as f,o as b,x as A,b as t,a as o,u as a,t as C,z as v,c as D,M as F,B as O}from"./vue.1703796278973.js";const U=v("div",{style:{display:"inline-block",width:"12px",height:"1px"}},null,-1),M={class:"dialogs"},j=S({name:"user"}),pe=S({...j,props:{parentId:null},setup(_){const i=_,p="system/Department",h=[{title:"姓名",dataIndex:"name",key:"name",ellipsis:!0,fixed:"left",search:{type:"string"}},{title:"用户名",dataIndex:"username",key:"username",ellipsis:!0,fixed:"left",search:{type:"string"}},{title:"状态",dataIndex:"status",key:"status",ellipsis:!0,fixed:"left",search:{type:"select",options:[{label:"正常",value:1},{label:"禁用",value:0}]},scopedSlots:!0},{title:"操作",dataIndex:"action",key:"action",scopedSlots:!0,width:"200px"}],y=u({}),w=s=>{y.value=s},g=u({}),e=T({_selectedRowKeys:[],requestFun:async s=>{if(e.cancelSelect(),i.parentId){const n={...s,sorts:[{name:"createTime",order:"desc"}],terms:[...s.terms,{terms:[{column:"id$in-dimension$org",value:i.parentId}],type:"and"}]},c=await q(n);return{code:c.status,result:c.result,status:c.status}}else return{code:200,result:{data:[],pageIndex:0,pageSize:0,total:0},status:200}},unBind:s=>{const n=s?[s.id]:e._selectedRowKeys;if(n.length<1)return x.warning("请勾选需要解绑的数据");N(i.parentId,n).then(()=>{x.success("操作成功"),e.refresh()})},onSelectChange:s=>{e._selectedRowKeys=s},cancelSelect:()=>{e._selectedRowKeys=[]},refresh:()=>{g.value.reload()}}),l=u(!1);return V(()=>i.parentId,()=>{e.refresh()}),(s,n)=>{const c=f("pro-search"),d=f("AIcon"),I=z,k=R,B=$,P=f("FullPage");return b(),A("div",null,[t(c,{columns:h,target:"category",onSearch:w,style:{"margin-bottom":"0"}}),t(P,null,{default:o(()=>[t(B,{ref_key:"tableRef",ref:g,columns:h,request:a(e).requestFun,params:a(y),rowSelection:{selectedRowKeys:a(e)._selectedRowKeys,onChange:a(e).onSelectChange},onCancelSelect:a(e).cancelSelect,model:"TABLE",defaultParams:{pageSize:10},pagination:{showSizeChanger:!0,pageSizeOptions:["10","20","50","100"]}},{headerTitle:o(()=>[t(m,{type:"primary",hasPermission:`${p}:bind-user`,onClick:n[0]||(n[0]=r=>l.value=!0),style:{"margin-right":"15px"},disabled:!_.parentId},{default:o(()=>[t(d,{type:"PlusOutlined"}),C("绑定用户 ")]),_:1},8,["hasPermission","disabled"]),U,t(m,{hasPermission:`${p}:bind`,popConfirm:{title:"是否解除绑定",onConfirm:()=>a(e).unBind()}},{default:o(()=>[t(d,{type:"DisconnectOutlined"}),C("批量解绑 ")]),_:1},8,["hasPermission","popConfirm"])]),status:o(r=>[t(I,{status:r.status,text:r.status?"正常":"禁用",statusNames:{1:"success",0:"error"}},null,8,["status","text"])]),action:o(r=>[t(k,{size:16},{default:o(()=>[t(m,{type:"link",hasPermission:`${p}:bind`,popConfirm:{title:"是否解除绑定",onConfirm:()=>a(e).unBind(r)}},{default:o(()=>[t(d,{type:"DisconnectOutlined"})]),_:2},1032,["hasPermission","popConfirm"])]),_:2},1024)]),_:1},8,["request","params","rowSelection","onCancelSelect"])]),_:1}),v("div",M,[a(l)?(b(),D(K,{key:0,visible:a(l),"onUpdate:visible":n[1]||(n[1]=r=>F(l)?l.value=r:null),"parent-id":i.parentId,onConfirm:a(e).refresh},null,8,["visible","parent-id","onConfirm"])):O("",!0)])])}}});export{pe as _};
