You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.4 KiB
JavaScript

var p=(d,k,c)=>new Promise((u,a)=>{var g=s=>{try{m(c.next(s))}catch(i){a(i)}},x=s=>{try{m(c.throw(s))}catch(i){a(i)}},m=s=>s.done?u(s.value):Promise.resolve(s.value).then(g,x);m((c=c.apply(d,k)).next())});import{a as P,B as U}from"./index-CFoN8Rd1.js";import{_ as E}from"./index-BOLOV4Nz.js";import{d as K,u as O}from"./index-DutP3P3Y.js";import{u as $,_ as z}from"./useTable-Cd94Wh3e.js";import"./index-C74Cm-s2.js";import{D as j}from"./dictEnum-DeC8h6ZR.js";import{u as q}from"./useRender-4sNWTYKY.js";import{bh as G,_ as J}from"./entry/index-2-yrRtrk-1723018314898.js";import{j as W}from"./index-BZQ-x4fz.js";import{ap as R,y as H,a6 as Q,aC as C,ao as X}from"./antd-BY-1PcYE.js";import{d as Y,f as b,r as Z,o as ee,_ as n,a8 as f,a9 as l,k as I,u as e,ad as D,ac as S,ak as te,al as ae,$ as M,ab as se,G as re,a1 as oe,F as T}from"./vue-aEZWZQSa.js";import"./useWindowSizeFn-B-EvmDAM.js";import"./useForm-LE1nNjjX.js";import"./FormItem.vue_vue_type_script_lang-CVian0fA.js";import"./componentMap-V_hpsodh.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-D3qGI2S_.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./style-uL-203nC.js";import"./helper-CfgyYzyh.js";import"./BasicForm.vue_vue_type_style_index_0_lang-szaiWa_E.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-CIg2I4zL.js";import"./download-dYo-2j8R.js";import"./useLoading-DkMJ65Y_.js";import"./index-x8RddcFV.js";import"./dict-soaxCSmk.js";const{renderDict:le}=q(),ne=[{dataIndex:"userName",title:"名称"},{dataIndex:"nickName",title:"昵称"},{dataIndex:"avatar",title:"头像",width:80},{dataIndex:"deptName",title:"部门"},{dataIndex:"phonenumber",title:"手机号"},{dataIndex:"status",title:"状态",customRender({value:d}){return le(d,j.NORMAL_DISABLE)}},{dataIndex:"createTime",title:"创建时间"}],ce=[{field:"userName",label:"用户账号",component:"Input"},{field:"phonenumber",label:"手机号码",component:"Input"}],ie=Y({name:"AddMultiInstanceModal",__name:"index",props:{multiple:{type:Boolean,required:!1,default:!0}},emits:["register","selectDone"],setup(d,{emit:k}){const c=d,u=b(""),a=Z({tree:[],selectDeptId:[]}),g=b(!0);function x(){return p(this,null,function*(){yield s()})}ee(()=>p(this,null,function*(){const t=yield K();G(t,o=>{o.icon="el:group"}),a.tree=t,g.value=!1}));const[m,{reload:s,getSelectRows:i,setSelectedRows:w}]=$({rowSelection:{type:"checkbox"},showSelectionBar:!0,clickToRowSelect:!0,clearSelectOnPageChange:!1,showIndexColumn:!1,size:"small",api:O,rowKey:"userId",useSearchForm:!0,formConfig:{schemas:ce,name:"user",baseColProps:{xs:24,sm:24,md:24,lg:8},labelWidth:80,resetFunc:()=>p(this,null,function*(){a.selectDeptId=[],u.value="",yield s()})},columns:ne,beforeFetch(t){return a.selectDeptId.length===1&&(t.deptId=a.selectDeptId[0]),h.value&&(t.excludeUserIds=h.value),t}}),h=b(""),[N,{closeModal:B,modalLoading:y}]=P(A);function A(t){return p(this,null,function*(){y(!0);const o=yield W(t);h.value=o,y(!1)})}const F=k;function L(){F("selectDone",i()),B(),v()}function v(){h.value="",w([])}function V(t){c.multiple||w([t])}return(t,o)=>(n(),f(e(U),D(t.$attrs,{title:"用户选择",defaultFullscreen:"",canFullscreen:!1,onRegister:e(N),onOk:L,onCancel:v}),{default:l(()=>[I(e(X),null,{default:l(()=>[I(e(R),D({xs:24,sm:24,md:24,lg:4},{class:"h-[calc(100vh-80px)]"}),{default:l(()=>[I(e(H),{active:!0,paragraph:{rows:8},loading:g.value},{default:l(()=>[a.tree.length?(n(),f(e(E),{key:0,fieldNames:{title:"label",key:"id"},"tree-data":a.tree,showLine:{showLeafIcon:!1},search:!0,searchValue:u.value,"onUpdate:searchValue":o[0]||(o[0]=r=>u.value=r),defaultExpandAll:"",onSelect:x,selectedKeys:a.selectDeptId,"onUpdate:selectedKeys":o[1]||(o[1]=r=>a.selectDeptId=r)},null,8,["tree-data","searchValue","selectedKeys"])):S("",!0)]),_:1},8,["loading"])]),_:1},16),I(e(R),te(ae({xs:24,sm:24,md:24,lg:20})),{default:l(()=>[I(e(z),{onRegister:e(m),onRowClick:V},{tableTitle:l(()=>[(n(!0),M(T,null,se(e(i)(),r=>(n(),f(e(Q),{key:r.userId},{default:l(()=>[re(oe(r.nickName),1)]),_:2},1024))),128))]),bodyCell:l(({column:r,record:_})=>[r&&_&&r.dataIndex==="avatar"?(n(),M(T,{key:0},[_.avatar?(n(),f(e(C),{key:0,src:_.avatar},null,8,["src"])):(n(),f(e(C),{key:1,src:"https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"}))],64)):S("",!0)]),_:1},8,["onRegister"])]),_:1},16)]),_:1})]),_:1},16,["onRegister"]))}}),Ue=J(ie,[["__scopeId","data-v-657b1ca0"]]);export{Ue as default};