import{u as M,a as U,_ as H}from"./index-c87bcfde-1782468512657v=1.0.0.js";import{x as Q,r as u,c as F,k as $,al as n,y as m,H as N,I as o,Q as l,a8 as V,a9 as P,u as s,M as b,O as D,A as x,z as v,P as E,a4 as L}from"./vendor-27e23c1b-1782468512657v=1.0.0.js";import"./eleVendor-12a75a9a-1782468512657v=1.0.0.js";const G={roleName:[{max:50,message:"\u6700\u591A 50 \u4E2A\u5B57\u7B26",trigger:"blur"}],startTime:[]},K={class:"mpName"},W={class:"pt20 mt30"},X=Q({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(R,{emit:O}){M();const B=U();let C=R;const w=u(B.query.identity_name),i=O,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)}}),k=u(),h=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(t,r)=>{if(t){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)}})},q=()=>{i("cancel")};return $(()=>{}),(e,t)=>{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:k,rules:s(G),"label-width":"160px"},{default:o(()=>[l(f,null,{default:o(()=>[l(a,V(P(s(h))),{default:o(()=>[l(r,{label:"\u7BA1\u7406\u5458\u7C7B\u578B",prop:"roleName"},{default:o(()=>[b(D(s(w)),1)]),_:1})]),_:1},16),l(a,V(P(s(h))),{default:o(()=>[l(r,{label:"\u6388\u6743\u89D2\u8272",prop:"startTime"},{default:o(()=>[x("div",null,[(m(!0),v(E,null,L(s(p).rightList,(y,z)=>(m(),v("div",{class:"mpItem",key:z+"rightList"},[x("div",K,D(y.mp_name),1),(m(!0),v(E,null,L(y.role_list,(g,I)=>(m(),N(d,{class:"roleList",key:I,label:g.role_name,modelValue:g.is_select,"onUpdate:modelValue":J=>g.is_select=J},null,8,["label","modelValue","onUpdate:modelValue"]))),128))]))),128))])]),_:1})]),_:1},16)]),_:1}),l(r,null,{default:o(()=>[x("div",W,[l(c,{onClick:q},{default:o(()=>t[1]||(t[1]=[b("\u8FD4\u56DE",-1)])),_:1,__:[1]}),l(c,{type:"primary",loading:s(A),onClick:t[0]||(t[0]=y=>j(s(k)))},{default:o(()=>t[2]||(t[2]=[b("\u4FDD\u5B58",-1)])),_:1,__:[2]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});const te=H(X,[["__scopeId","data-v-f797bcd8"]]);export{te as default};
