import{M as m,ax as v,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{m as w,o as K}from"./department.1703796278973.js";import{u as x}from"./department.17037962789732.js";import{d as C,k as d,v as B,m as I,r as k,o as q,c as z,a as L,b as u,z as P,u as o}from"./vue.1703796278973.js";import{_ as R}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./system.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const U={class:"table"},A=C({__name:"AddBindUserDialog",props:{parentId:null,visible:{type:Boolean}},emits:["confirm","update:visible"],setup(_,{emit:i}){const r=_,t=x(),c=d(!1),f=()=>{t.crossPageKeys.length&&r.parentId?(c.value=!0,K(r.parentId,t.crossPageKeys).then(()=>{m.success("操作成功"),i("confirm"),i("update:visible",!1),t.setSelectedKeys([])}).finally(()=>c.value=!1)):m.warning("请选择要绑定的用户")},g=()=>{i("update:visible",!1),t.setSelectedKeys([])},l=[{title:"姓名",dataIndex:"name",key:"name",ellipsis:!0,search:{type:"string"}},{title:"用户名",dataIndex:"username",key:"username",ellipsis:!0,search:{type:"string"}}],p=d({}),s=B({_selectedRowKeys:[],requestFun:async e=>{if(s.cancelSelect(),r.parentId){const n={...e,sorts:[{name:"createTime",order:"desc"}],terms:[...e.terms,{terms:[{column:"id$in-dimension$org$not",value:r.parentId}]}]},a=await w(n);return{code:a.status,result:a.result,status:a.status}}else return{code:200,result:{data:[],pageIndex:0,pageSize:0,total:0},status:200}},onSelectChange:e=>{t.setSelectedKeys(e,e.length?"concat":"")},cancelSelect:()=>{t.setSelectedKeys([],"concat")}});return I(()=>t.crossPageKeys,e=>{s._selectedRowKeys=e}),(e,n)=>{const a=k("pro-search"),y=v,S=b;return q(),z(S,{class:"add-bind-user-dialog-container",title:"绑定",width:"1440px",visible:"",centered:"",confirmLoading:o(c),onOk:f,onCancel:g},{default:L(()=>[u(a,{type:"simple",columns:l,target:"category",onSearch:n[0]||(n[0]=h=>p.value={...h})}),P("div",U,[u(y,{ref:"tableRef",columns:l,request:o(s).requestFun,params:o(p),rowSelection:{selectedRowKeys:o(s)._selectedRowKeys,onChange:o(s).onSelectChange},onCancelSelect:o(s).cancelSelect,model:"TABLE",defaultParams:{pageSize:10,sorts:[{name:"createTime",order:"desc"}]},pagination:{showSizeChanger:!0,pageSizeOptions:["10","20","50","100"]}},null,8,["request","params","rowSelection","onCancelSelect"])])]),_:1},8,["confirmLoading"])}}});const fe=R(A,[["__scopeId","data-v-dafdc34f"]]);export{fe as default};