import{u as w}from"./useFormEdit-42a9503c-1779868775780v=1.0.0.js";import{g as O}from"./account-ec8d0b54-1779868775780v=1.0.0.js";import{l as T,e as U,a as j,b as J,ah as l,m as n,p as i,u as d,M as _,R as M,U as c,O as t,F as k,a7 as x,S as f,T as $}from"./vendor-98154105-1779868775780v=1.0.0.js";import{_ as q}from"./_plugin-vue_export-helper-8c5478df-1779868775780v=1.0.0.js";import"./index-0f3e2c06-1779868775780v=1.0.0.js";import"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import"./tabs-e9b8af2b-1779868775780v=1.0.0.js";const z=T({__name:"accountRole",props:{accountId:[String,Number],loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(L,{emit:R}){const{ruleFormRef:S,closeCurrent:G}=w();let s=L;const v=U({get(){return s.loading},set(e){m("update:loading",e)}}),m=R,r=j([]),F=async()=>{const e=await O(s.accountId);r.value=e.data.mpTypeRolesList};J(()=>s.accountId,(e,a)=>{e&&e!==a&&F()},{deep:!0,immediate:!0});const N=async e=>{},g=()=>{let e=JSON.parse(JSON.stringify(r.value)),a=[];return e.map(o=>{o.roleList&&o.roleList.length>0&&o.roleList.map(u=>{u.isSelect&&a.push({roleId:u.roleId,mpId:o.mpId})})}),{accountId:s.accountId,roleList:a}},V=()=>{let e=g();m("submit",e)},B=()=>{let e=g();m("cancel",e)};return(e,a)=>{const y=l("el-empty"),o=l("el-checkbox"),u=l("el-col"),b=l("el-form-item"),h=l("el-button"),A=l("el-form");return n(),i("div",null,[d(r).length==0?(n(),_(y,{key:0,description:"\u6682\u65E0\u6570\u636E"})):M("",!0),c(A,{ref_key:"ruleFormRef",ref:S,"label-width":"220px",class:"line_form"},{default:t(()=>[(n(!0),i(k,null,x(d(r),(C,D)=>(n(),_(b,{key:D,label:C.mpName,prop:""},{default:t(()=>[(n(!0),i(k,null,x(C.roleList,(p,E)=>(n(),_(u,{key:E,span:6},{default:t(()=>[c(o,{modelValue:p.isSelect,"onUpdate:modelValue":I=>p.isSelect=I,onChange:I=>N(p)},{default:t(()=>[f($(p.roleName),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024))),128))]),_:2},1032,["label"]))),128)),c(b,{prop:""},{default:t(()=>[c(h,{onClick:B},{default:t(()=>[f("\u8FD4\u56DE")]),_:1}),c(h,{type:"primary",loading:d(v),onClick:V},{default:t(()=>[f("\u4FDD\u5B58")]),_:1},8,["loading"])]),_:1})]),_:1},512)])}}});const Z=q(z,[["__scopeId","data-v-86be09a9"]]);export{Z as default};
