You can not 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 line
3.6KB

  1. import{G as q,E as N,a as H,r as b,B as Z,b as s,c as p,L,h as l,f as t,i as f,e as J,d as h,F as x,H as S,u as K,t as M,k as Q,Z as W,s as X}from"./index-dd5fae99.js";const Y={class:"search mb-16"},ee=Q({name:"driverDialog"}),te=Object.assign(ee,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},orgCode:{type:String,default:""}},emits:["close","getUserData"],setup(C,{emit:B}){const{proxy:D}=X(),u=C,I=q(N.userStore).roleList||{},v=B,o=H({userRoleList:void 0,name:void 0,phoneNo:void 0}),d=b(),R=b(0),E=[{type:"selection",reserveSelection:!0,width:"55"},{label:"姓名",key:"name",prop:"name"},{label:"所属单位(主职)",key:"orgName",prop:"orgName",showOverflowTooltip:!0,width:250},{label:"所属区域",key:"regionId",prop:"regionId",width:"150"},{label:"用户角色",slot:"userRoleList",width:200}],c=b([]),_=async(n=(e=>(e=d.value)==null?void 0:e.pageParams)())=>{const i=await W({...n,...o,orgCode:u.orgCode,status:"ENABLE"});R.value=i.data.total,c.value=i.data.records||[],u.data&&u.data.length&&c.value&&c.value.forEach(r=>{u.data.map(w=>w.id*1).includes(r.userId)&&d.value.toggleRowSelect(r,!0)})},T=()=>{_()},U=()=>{o.userRoleList=void 0,o.name=void 0,o.phoneNo=void 0,d.value.pageParams.pageNumber=1,d.value.pageParams.pageSize=10,_()},y=b([]),z=n=>{y.value=n},F=()=>{var n;((n=y.value)==null?void 0:n.length)>10?D.$messageBox.warning("最多选择10位人员"):v("getUserData",y.value)};return Z(()=>u.visible,async n=>{n&&(_(),N.userStore.setRoleStore())}),(n,e)=>{const i=s("el-input"),r=s("el-form-item"),m=s("el-col"),w=s("el-option"),P=s("el-select"),V=s("el-row"),g=s("el-button"),$=s("el-form"),A=s("el-tag"),G=s("table-list"),O=s("el-dialog");return p(),L(O,{"model-value":C.visible,title:"选择人员",width:"840px","destroy-on-close":"",onClose:e[4]||(e[4]=a=>v("close"))},{footer:l(()=>[t(g,{type:"primary",size:"small",onClick:F},{default:l(()=>e[7]||(e[7]=[f(" 确定 ")])),_:1}),t(g,{size:"small",onClick:e[3]||(e[3]=a=>v("close"))},{default:l(()=>e[8]||(e[8]=[f(" 关闭 ")])),_:1})]),default:l(()=>[J("div",Y,[t($,{"label-suffix":":",model:o,size:"small"},{default:l(()=>[t(V,{gutter:16,class:"mb-16"},{default:l(()=>[t(m,{span:8},{default:l(()=>[t(r,{label:"用户姓名"},{default:l(()=>[t(i,{modelValue:o.name,"onUpdate:modelValue":e[0]||(e[0]=a=>o.name=a),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),t(m,{span:8},{default:l(()=>[t(r,{label:"手机号码"},{default:l(()=>[t(i,{modelValue:o.phoneNo,"onUpdate:modelValue":e[1]||(e[1]=a=>o.phoneNo=a),maxlength:"11",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),t(m,{span:8},{default:l(()=>[t(r,{label:"用户角色"},{default:l(()=>[t(P,{modelValue:o.userRoleList,"onUpdate:modelValue":e[2]||(e[2]=a=>o.userRoleList=a),style:{width:"100%"},clearable:"",placeholder:"请选择"},{default:l(()=>[(p(!0),h(x,null,S(K(I),(a,k)=>(p(),L(w,{key:k,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(V,null,{default:l(()=>[t(m,{span:24},{default:l(()=>[t(r,{class:"btn"},{default:l(()=>[t(g,{type:"primary",onClick:T},{default:l(()=>e[5]||(e[5]=[f("查询")])),_:1}),t(g,{type:"info",onClick:U},{default:l(()=>e[6]||(e[6]=[f("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),t(G,{ref_key:"tableListRef",ref:d,column:E,data:c.value,total:R.value,"row-key":"userId",onSelectionChange:z,onGetTableData:_},{userRoleList:l(({scope:a})=>[(p(!0),h(x,null,S(a.row.userRoleList,(k,j)=>(p(),L(A,{key:j,type:"info",class:"mr-4"},{default:l(()=>[f(M(k.name),1)]),_:2},1024))),128))]),_:1},8,["data","total"])]),_:1},8,["model-value"])}}});export{te as default};