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 lines
3.7KB

  1. import{d as q,G as J,D as V,b as H,r as b,L as K,c as s,e as p,I as L,i as e,h as l,j as c,g as M,f as N,F as x,J as D,u as Q,t as W,$ as X,x as Y}from"./index.cfe9160f.js";const Z={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(k,{emit:S}){const{proxy:I}=Y(),u=k,B=J(V.userStore).roleList||{},v=S,o=H({userRoleList:void 0,name:void 0,phoneNo:void 0}),d=b(),C=b(0),T=[{type:"selection",reserveSelection:!0,width:"55"},{label:"\u59D3\u540D",key:"name",prop:"name"},{label:"\u6240\u5C5E\u5355\u4F4D\uFF08\u4E3B\u804C\uFF09",key:"orgName",prop:"orgName",showOverflowTooltip:!0,width:250},{label:"\u6240\u5C5E\u533A\u57DF",key:"regionId",prop:"regionId",width:"150"},{label:"\u7528\u6237\u89D2\u8272",slot:"userRoleList",width:200}],f=b([]),_=async(n=(t=>(t=d.value)==null?void 0:t.pageParams)())=>{const i=await X({...n,...o,orgCode:u.orgCode,status:"ENABLE"});C.value=i.data.total,f.value=i.data.records||[],u.data&&u.data.length&&f.value&&f.value.forEach(r=>{u.data.map(h=>h.id*1).includes(r.userId)&&d.value.toggleRowSelect(r,!0)})},U=()=>{_()},z=()=>{o.userRoleList=void 0,o.name=void 0,o.phoneNo=void 0,d.value.pageParams.pageNumber=1,d.value.pageParams.pageSize=10,_()},y=b([]),E=n=>{y.value=n},$=()=>{var n;((n=y.value)==null?void 0:n.length)>10?I.$messageBox.warning("\u6700\u591A\u9009\u62E910\u4F4D\u4EBA\u5458"):v("getUserData",y.value)};return K(()=>u.visible,async n=>{n&&(_(),V.userStore.setRoleStore())}),(n,t)=>{const i=s("el-input"),r=s("el-form-item"),m=s("el-col"),h=s("el-option"),F=s("el-select"),R=s("el-row"),g=s("el-button"),P=s("el-form"),j=s("el-tag"),A=s("table-list"),G=s("el-dialog");return p(),L(G,{"model-value":k.visible,title:"\u9009\u62E9\u4EBA\u5458",width:"840px","destroy-on-close":"",onClose:t[4]||(t[4]=a=>v("close"))},{footer:e(()=>[l(g,{type:"primary",size:"small",onClick:$},{default:e(()=>[c(" \u786E\u5B9A ")]),_:1}),l(g,{size:"small",onClick:t[3]||(t[3]=a=>v("close"))},{default:e(()=>[c(" \u5173\u95ED ")]),_:1})]),default:e(()=>[M("div",Z,[l(P,{"label-suffix":":",model:o,size:"small"},{default:e(()=>[l(R,{gutter:16,class:"mb-16"},{default:e(()=>[l(m,{span:8},{default:e(()=>[l(r,{label:"\u7528\u6237\u59D3\u540D"},{default:e(()=>[l(i,{modelValue:o.name,"onUpdate:modelValue":t[0]||(t[0]=a=>o.name=a),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(m,{span:8},{default:e(()=>[l(r,{label:"\u624B\u673A\u53F7\u7801"},{default:e(()=>[l(i,{modelValue:o.phoneNo,"onUpdate:modelValue":t[1]||(t[1]=a=>o.phoneNo=a),maxlength:"11",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),l(m,{span:8},{default:e(()=>[l(r,{label:"\u7528\u6237\u89D2\u8272"},{default:e(()=>[l(F,{modelValue:o.userRoleList,"onUpdate:modelValue":t[2]||(t[2]=a=>o.userRoleList=a),style:{width:"100%"},clearable:"",placeholder:"\u8BF7\u9009\u62E9"},{default:e(()=>[(p(!0),N(x,null,D(Q(B),(a,w)=>(p(),L(h,{key:w,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(R,null,{default:e(()=>[l(m,{span:24},{default:e(()=>[l(r,{class:"btn"},{default:e(()=>[l(g,{type:"primary",onClick:U},{default:e(()=>[c("\u67E5\u8BE2")]),_:1}),l(g,{type:"info",onClick:z},{default:e(()=>[c("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),l(A,{ref_key:"tableListRef",ref:d,column:T,data:f.value,total:C.value,"row-key":"userId",onSelectionChange:E,onGetTableData:_},{userRoleList:e(({scope:a})=>[(p(!0),N(x,null,D(a.row.userRoleList,(w,O)=>(p(),L(j,{key:O,type:"info",class:"mr-4"},{default:e(()=>[c(W(w.name),1)]),_:2},1024))),128))]),_:1},8,["data","total"])]),_:1},8,["model-value"])}}});export{te as default};