import{x as M,r as u,c as F,k as U,al as n,y as m,H as N,I as t,Q as l,a8 as V,a9 as D,u as s,M as v,O as P,A as b,z as x,P as E,a4 as L}from"./vendor-6ae0c374-1783405707921v=1.0.0.js";import{u as H,a as Q,_ as Z}from"./index-71d7b18c-1783405707921v=1.0.0.js";import"./eleVendor-d42abce8-1783405707921v=1.0.0.js";const $={roleName:[{max:50,message:"\u6700\u591A 50 \u4E2A\u5B57\u7B26",trigger:"blur"}],startTime:[]},G={class:"mpName"},K={class:"pt20 mt30"},W=M({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(R,{emit:w}){H();const B=Q();let C=R;const O=u(B.query.identity_name),i=w,p=F({get(){return S(C.value)},set(e){i("update:value",e)}}),A=F({get(){return C.loading},set(e){i("update:loading",e)}}),h=u(),k=u({xs:24,sm:22,md:20,lg:14,xl:13});u({xs:24,sm:24,md:12,lg:12,xl:12}),u({xs:24,sm:22,md:18,lg:16,xl:8});const S=e=>e,T=()=>JSON.parse(JSON.stringify(p.value)),j=e=>{e.validate(async(o,r)=>{if(o){let a=T();const d=[];a.rightList.forEach(c=>{c.role_list.forEach(_=>{_.is_select&&d.push(_.role_id)})});const f={identity_code:B.query.identity_code,relo_ids:d.join(",")};i("submit",f)}else{const a=Object.keys(r)[0];e.scrollToField(a)}})},z=()=>{i("cancel")};return U(()=>{}),(e,o)=>{const r=n("el-form-item"),a=n("PaCol"),d=n("el-checkbox"),f=n("PaRow"),c=n("el-button"),_=n("el-form");return m(),N(_,{model:s(p),ref_key:"formRef",ref:h,rules:s($),"label-width":"160px"},{default:t(()=>[l(f,null,{default:t(()=>[l(a,V(D(s(k))),{default:t(()=>[l(r,{label:"\u7BA1\u7406\u5458\u7C7B\u578B",prop:"roleName"},{default:t(()=>[v(P(s(O)),1)]),_:1})]),_:1},16),l(a,V(D(s(k))),{default:t(()=>[l(r,{label:"\u6388\u6743\u89D2\u8272",prop:"startTime"},{default:t(()=>[b("div",null,[(m(!0),x(E,null,L(s(p).rightList,(g,q)=>(m(),x("div",{class:"mpItem",key:q+"rightList"},[b("div",G,P(g.mp_name),1),(m(!0),x(E,null,L(g.role_list,(y,I)=>(m(),N(d,{class:"roleList",key:I,label:y.role_name,modelValue:y.is_select,"onUpdate:modelValue":J=>y.is_select=J},null,8,["label","modelValue","onUpdate:modelValue"]))),128))]))),128))])]),_:1})]),_:1},16)]),_:1}),l(r,null,{default:t(()=>[b("div",K,[l(c,{onClick:z},{default:t(()=>o[1]||(o[1]=[v("\u8FD4\u56DE",-1)])),_:1,__:[1]}),l(c,{type:"primary",loading:s(A),onClick:o[0]||(o[0]=g=>j(s(h)))},{default:t(()=>o[2]||(o[2]=[v("\u4FDD\u5B58",-1)])),_:1,__:[2]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});const oe=Z(W,[["__scopeId","data-v-160141db"],["__file","D:/desktop/huaZhong/huazhong-common/apps/vue-admin/src/views/roleConf/roleConf/components/BaseForm.vue"]]);export{oe as default};
