import{b as M}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{W as j}from"./WangEditor-58f37dd0-1782572373740v=1.0.0.js";import{y as z,c as y,r as d,m as H,al as s,z as i,I as F,J as e,R as l,a8 as f,a9 as _,u as t,O as g,M as W,A as S,Q as C,a4 as V,P as D,B as Z}from"./vendor-866bb149-1782572373740v=1.0.0.js";const Q={applicableType:[{required:!0,message:"\u8BF7\u8F93\u5165\u9002\u7528\u4E1A\u52A1 \u56FA\u5B9A\u8D5B\u4E8B\u62A5\u540D",trigger:"blur"}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u534F\u8BAE\u540D\u79F0",trigger:"blur"},{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],content:[{required:!0,message:"\u8BF7\u9009\u62E9\u534F\u8BAE\u5185\u5BB9",trigger:"change"}],mobileSignatureStatus:[],status:[],agreementId:[{required:!0,message:"\u8BF7\u8F93\u5165\u534F\u8BAE\u7F16\u53F7",trigger:"blur"}]},$={class:"pt20 mt30"},Y=z({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(x,{emit:k}){M();let c=x;const B=k,o=y({get(){return R(c.value)},set(n){B("update:value",n)}}),O=y({get(){return c.loading},set(n){B("update:loading",n)}}),b=d(),p=d({xs:24,sm:22,md:20,lg:14,xl:13});d({xs:24,sm:24,md:12,lg:12,xl:12}),d({xs:24,sm:22,md:18,lg:16,xl:8});const P=d([{value:1,label:"\u5F00\u542F"},{value:0,label:"\u5173\u95ED"}]),N=d([{value:1,label:"\u6709\u6548"},{value:0,label:"\u65E0\u6548"}]),R=n=>n,T=()=>JSON.parse(JSON.stringify(o.value)),q=n=>{n.validate(async(u,m)=>{if(u){let r=T();B("submit",r)}else{const r=Object.keys(m)[0];n.scrollToField(r)}})},w=()=>{B("cancel")};return H(()=>{}),(n,u)=>{const m=s("el-form-item"),r=s("PaCol"),I=s("el-input"),v=s("el-radio"),A=s("el-radio-group"),U=s("PaRow"),J=s("HZStepItem"),E=s("el-button"),L=s("el-form");return i(),F(L,{model:t(o),ref_key:"formRef",ref:b,rules:t(Q)},{default:e(()=>[l(J,{title:"\u57FA\u7840\u4FE1\u606F"},{default:e(()=>[l(U,null,{default:e(()=>[l(r,f(_(t(p))),{default:e(()=>[l(m,{label:"\u9002\u7528\u4E1A\u52A1",prop:"applicableType"},{default:e(()=>[u[5]||(u[5]=g(" \u8D5B\u4E8B\u62A5\u540D ",-1)),W(' <el-input v-model="form.applicableType" placeholder="\u8BF7\u8F93\u5165\u9002\u7528\u4E1A\u52A1" />  ')]),_:1,__:[5]})]),_:1},16),l(r,f(_(t(p))),{default:e(()=>[l(m,{label:"\u534F\u8BAE\u540D\u79F0",prop:"name"},{default:e(()=>[l(I,{modelValue:t(o).name,"onUpdate:modelValue":u[0]||(u[0]=a=>t(o).name=a),placeholder:"\u8BF7\u8F93\u5165\u534F\u8BAE\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},16),l(r,f(_(t(p))),{default:e(()=>[l(m,{label:"\u534F\u8BAE\u5185\u5BB9",prop:"content"},{default:e(()=>[l(j,{value:t(o).content,"onUpdate:value":u[1]||(u[1]=a=>t(o).content=a),title:"\u534F\u8BAE\u5185\u5BB9",hideToolBar:!1,showEditorAll:!0,height:"300px",titleLimit:64},null,8,["value"])]),_:1})]),_:1},16),l(r,f(_(t(p))),{default:e(()=>[l(m,{label:"\u79FB\u52A8\u7AEF\u7B7E\u7F72",prop:"mobileSignatureStatus"},{default:e(()=>[l(A,{modelValue:t(o).mobileSignatureStatus,"onUpdate:modelValue":u[2]||(u[2]=a=>t(o).mobileSignatureStatus=a)},{default:e(()=>[(i(!0),S(C,null,V(t(P),a=>(i(),F(v,{key:a.value,label:a.label,value:a.value},{default:e(()=>[g(D(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16),l(r,f(_(t(p))),{default:e(()=>[l(m,{label:"\u72B6\u6001",prop:"status"},{default:e(()=>[l(A,{modelValue:t(o).status,"onUpdate:modelValue":u[3]||(u[3]=a=>t(o).status=a)},{default:e(()=>[(i(!0),S(C,null,V(t(N),a=>(i(),F(v,{key:a.value,label:a.label,value:a.value},{default:e(()=>[g(D(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16)]),_:1})]),_:1}),l(m,null,{default:e(()=>[Z("div",$,[l(E,{onClick:w},{default:e(()=>u[6]||(u[6]=[g("\u8FD4\u56DE",-1)])),_:1,__:[6]}),l(E,{type:"primary",loading:t(O),onClick:u[4]||(u[4]=a=>q(t(b)))},{default:e(()=>u[7]||(u[7]=[g("\u4FDD\u5B58",-1)])),_:1,__:[7]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});export{Y as _};
