|
- var te=Object.defineProperty,le=Object.defineProperties;var oe=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var q=(t,n,l)=>n in t?te(t,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[n]=l,A=(t,n)=>{for(var l in n||(n={}))se.call(n,l)&&q(t,l,n[l]);if(P)for(var l of P(n))ne.call(n,l)&&q(t,l,n[l]);return t},E=(t,n)=>le(t,oe(n));var R=(t,n,l)=>new Promise((d,g)=>{var h=e=>{try{w(l.next(e))}catch(x){g(x)}},b=e=>{try{w(l.throw(e))}catch(x){g(x)}},w=e=>e.done?d(e.value):Promise.resolve(e.value).then(h,b);w((l=l.apply(t,n)).next())});import{_ as de,d as ie,r as k,o as ue,L as re,aw as ce,ay as me,N as F,az as pe,e as m,f as _,I as L,l as s,k as i,m as V,g as S,F as C,J as M,t as B,h as N,aA as _e,aB as fe,x as ve,y as ge,p as be}from"./index.62a6dd28.js";import{g as we}from"./menuManage.95642e31.js";const $=t=>(ve("data-v-8a66ac1e"),t=t(),ge(),t),ye=$(()=>N("div",{class:"el-descriptions__title mb-16"},"\u57FA\u672C\u4FE1\u606F",-1)),De=$(()=>N("div",{class:"el-descriptions__title mb-16"},"\u83DC\u5355\u6743\u9650",-1)),ke=$(()=>N("div",{class:"el-descriptions__title mb-16"},"\u6570\u636E\u6743\u9650",-1)),he={class:"ml-18 mb-16"},xe=ie({name:"roleDrawer"}),Re=Object.assign(xe,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(t,{emit:n}){const{proxy:l}=be(),d=t,g=n,h=k(),b=k(),w=k([]),e=k({id:void 0,name:void 0,manageRoleIds:void 0,describe:void 0,menuDataScopeList:[],menuDataScopeList2:[],menuData:[]}),x={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0",trigger:"blur"}],manageRoleIds:[{required:!1,message:"\u8BF7\u9009\u62E9\u53EF\u63A7\u89D2\u8272",trigger:"change"}]},z=u=>`bgc${u.manageRoleIds}`,G=u=>R(this,null,function*(){!u||(yield u.validate(a=>R(this,null,function*(){var r,c,p;if(a){const y=b.value.getCheckedKeys(),D=E(A({},e.value),{menuIds:y.map(U=>U),id:(r=d.data)==null?void 0:r.id,manageRoleIds:((c=e.value.manageRoleIds)==null?void 0:c.join(","))||"",menuData:void 0,menuDataScopeList2:void 0});(p=d.data)!=null&&p.id?(yield _e(D),l.$message.success("\u7F16\u8F91\u6210\u529F\uFF01")):(yield fe(D),l.$message.success("\u65B0\u589E\u6210\u529F\uFF01")),g("close",!0)}})))}),T=u=>{const a=[];return u.forEach(r=>{r.children?T(r.childern):a.push(r.id)}),a},j=k([]),O=k([]),H=u=>u.filter(a=>a!==null),Q=(u,a)=>{e.value.menuDataScopeList2[a]={dataScope:u,menuId:a};const r=H(e.value.menuDataScopeList2),c=JSON.parse(JSON.stringify(r));e.value.menuDataScopeList=c};return ue(()=>R(this,null,function*(){})),re(()=>d.visible,u=>R(this,null,function*(){if(u){const a=yield ce();if(j.value=a.data.records,d.data&&d.data.id){const p=yield me({id:d.data.id});b.value.setCheckedKeys(T(p.data.menu));const y=[];p.data.menuDataScopeList.forEach(D=>{y.push(D.dataScope)}),yield F(),e.value={id:d.data.id,name:d.data.name,manageRoleIds:p.data.manageRoleIdList,describe:p.data.describe,menuDataScopeList:[],menuDataScopeList2:[],menuData:y}}else e.value.menuData=[];const r=yield pe();O.value=r.data;const c=yield we({id:d.data&&d.data.id||""});w.value=c.data}else h.value.resetFields(),e.value.id=void 0,yield F(),b.value.setCheckedKeys([])})),(u,a)=>{var K;const r=m("el-input"),c=m("el-form-item"),p=m("el-col"),y=m("el-checkbox"),D=m("el-checkbox-group"),U=m("el-row"),W=m("el-tree"),X=m("el-radio"),Y=m("el-radio-group"),Z=m("el-form"),J=m("el-button"),ee=m("el-drawer");return _(),L(ee,{"model-value":t.visible,title:(K=d==null?void 0:d.data)!=null&&K.id?"\u7F16\u8F91\u89D2\u8272":"\u65B0\u589E\u89D2\u8272",size:"50%",onClose:a[5]||(a[5]=o=>g("close"))},{footer:s(()=>[i(J,{type:"primary",onClick:a[3]||(a[3]=o=>G(h.value))},{default:s(()=>[V(" \u63D0\u4EA4 ")]),_:1}),i(J,{type:"info",onClick:a[4]||(a[4]=o=>g("close"))},{default:s(()=>[V(" \u5173\u95ED ")]),_:1})]),default:s(()=>[i(Z,{ref_key:"formRef",ref:h,model:e.value,rules:x,"label-width":"90px","label-suffix":":"},{default:s(()=>[ye,i(U,{gutter:20},{default:s(()=>[i(p,{span:24},{default:s(()=>[i(c,{label:"\u89D2\u8272\u540D\u79F0",prop:"name"},{default:s(()=>{var o,f;return[i(r,{modelValue:e.value.name,"onUpdate:modelValue":a[0]||(a[0]=I=>e.value.name=I),placeholder:"\u8BF7\u8F93\u5165",disabled:Boolean(!((o=t.data)!=null&&o.isEdit)&&((f=t.data)==null?void 0:f.rulesId))},null,8,["modelValue","disabled"])]}),_:1})]),_:1}),i(p,{span:24},{default:s(()=>[i(c,{label:"\u53EF\u63A7\u89D2\u8272",prop:"manageRoleIds"},{default:s(()=>[i(D,{modelValue:e.value.manageRoleIds,"onUpdate:modelValue":a[1]||(a[1]=o=>e.value.manageRoleIds=o)},{default:s(()=>[(_(!0),S(C,null,M(j.value,o=>(_(),L(y,{key:o.id,label:o.id},{default:s(()=>[V(B(o.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),i(c,{label:"\u89D2\u8272\u63CF\u8FF0",prop:"describe"},{default:s(()=>[i(r,{modelValue:e.value.describe,"onUpdate:modelValue":a[2]||(a[2]=o=>e.value.describe=o),type:"textarea",maxlength:"200","show-word-limit":"",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),De,i(c,{"label-width":"0px"},{default:s(()=>[i(W,{ref_key:"menuTreeRef",ref:b,data:w.value,class:"w-full","show-checkbox":"","default-expand-all":"","node-key":"id",props:{class:z,label:"title",value:"id"}},null,8,["data","props"])]),_:1}),ke,(_(!0),S(C,null,M(O.value,o=>(_(),S("div",{key:o.id},[N("div",he,B(o.title),1),(_(!0),S(C,null,M(o.children,(f,I)=>(_(),L(c,{key:f.id,"label-width":"130px",label:f.title,prop:"menuData"},{default:s(()=>[i(Y,{modelValue:e.value.menuData[I],"onUpdate:modelValue":v=>e.value.menuData[I]=v},{default:s(()=>[(_(!0),S(C,null,M(f.dataScopeOption.split(","),(v,ae)=>(_(),L(X,{key:ae,label:v*1,onChange:Se=>Q(v*1,f.id)},{default:s(()=>[V(B(v*1===1?"\u672C\u5355\u4F4D":v*1===2?"\u672C\u5355\u4F4D\u53CA\u4E0B\u5C5E\u5355\u4F4D":v*1===3?"\u672C\u533A\u57DF":"\u5168\u5E02"),1)]),_:2},1032,["label","onChange"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]))),128))]))),128))]),_:1},8,["model"])]),_:1},8,["model-value","title"])}}}),Ce=de(Re,[["__scopeId","data-v-8a66ac1e"],["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/systemManage/roleManage/roleDrawer.vue"]]);export{Ce as default};
|