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
5.7KB

  1. import{d as X,x as ee,b as A,r as i,Z as D,o as te,B as x,c as o,e as d,f as g,h as a,i as l,F as L,H as R,u as le,G as E,j as m,t as y,g as B,R as ae,Y as se,aw as oe,ax as ue,q as ne}from"./index.a2494fc2.js";const re=["onClick"],ie=["onClick"],de=X({name:"memberManage"}),fe=Object.assign(de,{setup(me){const I=ee(),{proxy:w}=ne(),r=A({name:void 0,userRoleList:void 0}),_=i(),V=i(0),q=A([{label:"\u5E8F\u53F7",type:"index",width:"80"},{label:"\u59D3\u540D",key:"name",prop:"name"},{label:"\u89D2\u8272",slot:"userRoleList",minWidth:"200"},{label:"\u72B6\u6001",key:"status",prop:"status",width:"120",render:s=>[D("span",{class:["dot mr-4",`${s.status==="ENABLE"?"bg-success":"bg-danger"}`]}),D("span",{class:`${s.status==="ENABLE"?"text-success":"text-danger"}`},s.status==="ENABLE"?"\u542F\u7528":"\u7981\u7528")]},{label:"\u64CD\u4F5C",slot:"action",width:"120",fixed:"right"}]),C=i([]),p=async(s=_.value.pageParams)=>{const e=await se({...s,...r,orgCode:I.query.id});C.value=e.data.records,V.value=e.data.total},F=()=>{p()},U=()=>{r.name=void 0,r.userRoleList=void 0,_.value.pageParams.pageNumber=1,_.value.pageParams.pageSize=10,p()},f=i(!1),N=i(),u=i({status:!0}),z=s=>{N.value=s.name,u.value={...s,userRoleList:s.userRoleList.map(e=>e.id),status:s.status==="ENABLE"},f.value=!0},P={phoneNo:[{required:!0,pattern:/^1[3456789]\d{9}$/,message:"\u624B\u673A\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E",trigger:"blur"}],userRoleList:[{required:!0,message:"\u8BF7\u9009\u62E9\u7528\u6237\u89D2\u8272",trigger:"change"}],status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:"change"}]},h=i(),T=async s=>{!s||await s.validate(async e=>{if(e){const v={...u.value,status:u.value.status?"ENABLE":"DISABLE",userRoleInfoList:x.userStore.roleListDict.filter(n=>u.value.userRoleList.includes(n.id)).map(n=>({id:n.id,name:n.name}))};await oe(v),w.$message.success("\u7F16\u8F91\u6210\u529F\uFF01"),f.value=!1,p()}})},j=s=>{const e=s.status==="DISABLE"?"\u542F\u7528":"\u7981\u7528";w.$messageBox.confirm(`\u662F\u5426${e}\u8BE5\u7528\u6237?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(async()=>{await ue({employeeCode:s.employeeCode,operation:s.status==="DISABLE"?"ENABLE":"DISABLE",userId:s.userId}),w.$message.success(`${e}\u6210\u529F\uFF01`),p()})};return te(()=>{x.userStore.setRoleStore(),p()}),(s,e)=>{const v=o("el-input"),n=o("el-form-item"),k=o("el-col"),G=o("el-option"),M=o("el-select"),b=o("el-button"),H=o("el-row"),S=o("el-form"),$=o("el-card"),O=o("el-tag"),W=o("table-list"),Y=o("el-checkbox"),Z=o("el-checkbox-group"),J=o("el-switch"),K=o("el-dialog");return d(),g(L,null,[a($,{shadow:"never",class:"search"},{default:l(()=>[a(S,{"label-suffix":":",model:r,size:"small"},{default:l(()=>[a(H,{gutter:16},{default:l(()=>[a(k,{span:8},{default:l(()=>[a(n,{label:"\u59D3\u540D"},{default:l(()=>[a(v,{modelValue:r.name,"onUpdate:modelValue":e[0]||(e[0]=t=>r.name=t),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),a(k,{span:8},{default:l(()=>[a(n,{label:"\u7528\u6237\u89D2\u8272"},{default:l(()=>[a(M,{modelValue:r.userRoleList,"onUpdate:modelValue":e[1]||(e[1]=t=>r.userRoleList=t),style:{width:"100%"},placeholder:"\u8BF7\u9009\u62E9",multiple:!0,"value-key":"id"},{default:l(()=>[(d(!0),g(L,null,R(le(x).userStore.roleListDict,(t,c)=>(d(),E(G,{key:c,label:t.name,value:t},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(k,{span:8},{default:l(()=>[a(n,{class:"btn"},{default:l(()=>[a(b,{type:"primary",onClick:F},{default:l(()=>e[8]||(e[8]=[m("\u67E5\u8BE2")])),_:1}),a(b,{onClick:U},{default:l(()=>e[9]||(e[9]=[m("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a($,{title:"\u89D2\u8272\u5217\u8868",shadow:"never"},{default:l(()=>[a(W,{ref_key:"tableListRef",ref:_,column:q,data:C.value,total:V.value,onGetTableData:p},{userRoleList:l(({scope:t})=>[(d(!0),g(L,null,R(t.row.userRoleList,(c,Q)=>(d(),E(O,{key:Q,type:"info",class:"mr-4 mb-4"},{default:l(()=>[m(y(c.name),1)]),_:2},1024))),128))]),action:l(({scope:t})=>[B("a",{class:"text-primary",onClick:c=>z(t.row)},"\u7F16\u8F91",8,re),B("a",{onClick:c=>j(t.row)},y(t.row.status==="ENABLE"?"\u7981\u7528":"\u542F\u7528"),9,ie)]),_:1},8,["column","data","total"])]),_:1}),a(K,{"model-value":f.value,title:"\u7F16\u8F91 - "+N.value,width:"600px",onClose:e[7]||(e[7]=t=>f.value=!1)},{footer:l(()=>[a(b,{type:"primary",onClick:e[5]||(e[5]=t=>T(h.value))},{default:l(()=>e[11]||(e[11]=[m(" \u63D0\u4EA4 ")])),_:1}),a(b,{onClick:e[6]||(e[6]=t=>f.value=!1)},{default:l(()=>e[12]||(e[12]=[m(" \u5173\u95ED ")])),_:1})]),default:l(()=>[a(S,{ref_key:"formRef",ref:h,model:u.value,rules:P,"label-width":"90px","label-suffix":":"},{default:l(()=>[a(n,{label:"\u624B\u673A\u53F7\u7801",prop:"phoneNo"},{default:l(()=>[a(v,{modelValue:u.value.phoneNo,"onUpdate:modelValue":e[2]||(e[2]=t=>u.value.phoneNo=t),style:{width:"200px"},placeholder:"\u8BF7\u8F93\u5165",maxlength:"11"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u7528\u6237\u89D2\u8272",prop:"userRoleList"},{default:l(()=>[a(Z,{modelValue:u.value.userRoleList,"onUpdate:modelValue":e[3]||(e[3]=t=>u.value.userRoleList=t)},{default:l(()=>[(d(!0),g(L,null,R(s.roleList.filter(t=>t.name==="\u666E\u901A\u7528\u6237"||t.name==="\u5355\u4F4D\u7BA1\u7406\u5458"),t=>(d(),E(Y,{key:t.id,label:t.id},{default:l(()=>[m(y(t.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[a(J,{modelValue:u.value.status,"onUpdate:modelValue":e[4]||(e[4]=t=>u.value.status=t),style:{"--el-switch-on-color":"#4ecb74","--el-switch-off-color":"#ff3b30"}},null,8,["modelValue"]),e[10]||(e[10]=m("\xA0 ")),B("span",{style:ae({color:u.value.status?"#4ECB74":"#FF3B30"})},y(u.value.status?"\u5DF2\u542F\u7528":"\u5DF2\u7981\u7528"),5)]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])],64)}}});export{fe as default};