import{M as p,ax as S,W as b}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.1703796278973300.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{c as y,e as w}from"./role.1703796278973.js";import{d as x,k as m,r as k,o as C,c as B,a as I,b as c,u as d}from"./vue.1703796278973.js";const V=x({__name:"AddUserDialog",props:{visible:{type:Boolean},roleId:null},emits:["refresh","update:visible"],setup(u,{emit:s}){const n=u,i=[{title:"姓名",dataIndex:"name",key:"name",search:{type:"string"}},{title:"用户名",dataIndex:"username",key:"username",search:{type:"string"}}],l=m({}),o=m([]),f=t=>{const e={...t,sorts:[{name:"createTime",order:"desc"}],terms:[{terms:[{column:"id$in-dimension$role$not",value:n.roleId}]}]};return t.terms[0]&&e.terms.unshift({terms:t.terms[0].terms}),y(e)},g=()=>{o.value.length<1?p.error("请至少选择一项"):w(n.roleId,o.value).then(t=>{t.status===200&&(p.success("操作成功"),s("refresh"),s("update:visible",!1))})},v=(t,e)=>{const r=new Set(o.value);console.log(t,e),e?r.add(t.id):r.delete(t.id),o.value=[...r.values()]};return(t,e)=>{const r=k("pro-search"),_=S,h=b;return C(),B(h,{visible:"",title:"新增",width:"1000px",onOk:g,onCancel:e[2]||(e[2]=a=>s("update:visible",!1))},{default:I(()=>[c(r,{columns:i,target:"simple",onSearch:e[0]||(e[0]=a=>l.value={...a})}),c(_,{ref:"tableRef",columns:i,request:f,model:"TABLE",params:d(l),rowSelection:{selectedRowKeys:d(o),onSelect:v},onCancelSelect:e[1]||(e[1]=a=>o.value=[]),defaultParams:{pageSize:10},pagination:{pageSizeOptions:["10","20","50","100"],showSizeChanger:!0,hideOnSinglePage:!1}},null,8,["params","rowSelection"])]),_:1})}}});export{V as _};
