import{b as j}from"./index-b309bf9f-1782729249161v=1.0.0.js";import{W as z}from"./WangEditor-ba648bf2-1782729249161v=1.0.0.js";import{y as J,c as R,r as d,m as K,al as s,z as g,I as _,J as t,B as T,R as o,a8 as p,a9 as f,u as e,A as D,Q as x,a4 as k,O as v,P,M as F}from"./vendor-1e24e3ad-1782729249161v=1.0.0.js";const W={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u516C\u544A\u540D\u79F0",trigger:"blur"},{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],uploadType:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E0A\u4F20\u7C7B\u578B",trigger:"change"}],coverImage:[],isPopupRemind:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F39\u7A97\u63D0\u9192",trigger:"change"}],popupRemindType:[{required:!0,message:"\u8BF7\u9009\u62E9\u63D0\u9192\u65B9\u5F0F",trigger:"change"}],content:[{max:65535,message:"\u6700\u591A 65535 \u4E2A\u5B57\u7B26",trigger:"blur"}],publishTime:[],isHomeRecommend:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u9996\u9875\u63A8\u8350",trigger:"change"}],status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:"change"}],creator:[{max:32,message:"\u6700\u591A 32 \u4E2A\u5B57\u7B26",trigger:"blur"}],updater:[{max:32,message:"\u6700\u591A 32 \u4E2A\u5B57\u7B26",trigger:"blur"}],createTime:[],updateTime:[]},Q={class:"pt20 mt30"},Z=J({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(w,{emit:L}){j();let b=w;const c=L,a=R({get(){return q(b.value)},set(r){c("update:value",r)}}),O=R({get(){return b.loading},set(r){c("update:loading",r)}}),y=d(),m=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 S=d([{label:"\u4E0A\u4F20\u56FE\u7247",value:"pic"}]),U=d([{label:"\u9996\u6B21\u767B\u5F55",value:"first"},{label:"\u6BCF\u6B21\u767B\u5F55",value:"every"}]);d([{label:"\u672A\u53D1\u5E03",value:0},{label:"\u53D1\u5E03",value:1}]);const q=r=>r,H=()=>JSON.parse(JSON.stringify(a.value)),M=r=>{r.validate(async(u,B)=>{if(u){let n=H();c("submit",n)}else{const n=Object.keys(B)[0];r.scrollToField(n)}})},N=()=>{c("cancel")};return K(()=>{}),(r,u)=>{const B=s("el-input"),n=s("el-form-item"),i=s("PaCol"),C=s("el-radio"),E=s("el-radio-group"),I=s("DocumentMul"),A=s("el-switch"),h=s("PaRow"),V=s("el-button"),Y=s("el-form");return g(),_(Y,{model:e(a),ref_key:"formRef",ref:y,rules:e(W),"label-width":"160px"},{default:t(()=>[u[10]||(u[10]=T("div",{class:"mb30"},null,-1)),o(h,null,{default:t(()=>[o(i,p(f(e(m))),{default:t(()=>[o(n,{label:"\u516C\u544A\u540D\u79F0",prop:"name"},{default:t(()=>[o(B,{modelValue:e(a).name,"onUpdate:modelValue":u[0]||(u[0]=l=>e(a).name=l),placeholder:"\u8BF7\u8F93\u5165\u516C\u544A\u6807\u9898"},null,8,["modelValue"])]),_:1})]),_:1},16),o(i,p(f(e(m))),{default:t(()=>[o(n,{label:"\u4E0A\u4F20\u7C7B\u578B",prop:"uploadType"},{default:t(()=>[o(E,{modelValue:e(a).uploadType,"onUpdate:modelValue":u[1]||(u[1]=l=>e(a).uploadType=l)},{default:t(()=>[(g(!0),D(x,null,k(e(S),l=>(g(),_(C,{key:l.value,label:l.label,value:l.value},{default:t(()=>[v(P(l.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16),o(i,p(f(e(m))),{default:t(()=>[o(n,{label:"\u5C01\u9762\u56FE\u7247",prop:"coverImage"},{default:t(()=>[o(I,{fileList:e(a).coverImage,"onUpdate:fileList":u[2]||(u[2]=l=>e(a).coverImage=l),showFileList:!0,fileSize:5,limit:1,drag:!1,mutiple:!1,uploadType:"img",accept:".png,.jpg"},null,8,["fileList"])]),_:1})]),_:1},16),o(i,p(f(e(m))),{default:t(()=>[o(n,{label:"\u5F39\u7A97\u63D0\u9192",prop:"isPopupRemind"},{default:t(()=>[o(A,{modelValue:e(a).isPopupRemind,"onUpdate:modelValue":u[3]||(u[3]=l=>e(a).isPopupRemind=l),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1})]),_:1},16),o(i,p(f(e(m))),{default:t(()=>[e(a).isPopupRemind?(g(),_(n,{key:0,label:"\u63D0\u9192\u65B9\u5F0F",prop:"popupRemindType"},{default:t(()=>[o(E,{modelValue:e(a).popupRemindType,"onUpdate:modelValue":u[4]||(u[4]=l=>e(a).popupRemindType=l)},{default:t(()=>[(g(!0),D(x,null,k(e(U),l=>(g(),_(C,{key:l.value,label:l.label,value:l.value},{default:t(()=>[v(P(l.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):F("v-if",!0)]),_:1},16),o(i,p(f(e(m))),{default:t(()=>[o(n,{label:"\u6B63\u6587",prop:"content"},{default:t(()=>[o(z,{value:e(a).content,"onUpdate:value":u[5]||(u[5]=l=>e(a).content=l),title:"\u516C\u544A\u6B63\u6587",hideToolBar:!1,showEditorAll:!0,height:"300px",titleLimit:64,toolbarConfig:{insertKeys:{index:105,keys:["myFullScreen"]},excludeKeys:["insertVideo","codeBlock","group-video","fullScreen","insertLink","insertTable"]}},null,8,["value"]),F(' <el-input v-model="form.content" placeholder="\u8BF7\u8F93\u5165\u6B63\u6587" /> ')]),_:1})]),_:1},16),F(` <PaCol v-bind="oneLine"
				><el-form-item label="\u53D1\u5E03\u65F6\u95F4" prop="publishTime">
					<el-date-picker
						v-model="form.publishTime"
						type="datetime"
						value-format="YYYY-MM-DD HH:mm:ss"
						placeholder="\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4"
						style="width: 100%"
					/> </el-form-item></PaCol> `),o(i,p(f(e(m))),{default:t(()=>[o(n,{label:"\u662F\u5426\u9996\u9875\u63A8\u8350",prop:"isHomeRecommend"},{default:t(()=>[o(A,{modelValue:e(a).isHomeRecommend,"onUpdate:modelValue":u[6]||(u[6]=l=>e(a).isHomeRecommend=l),"active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1})]),_:1},16)]),_:1}),o(n,null,{default:t(()=>[T("div",Q,[o(V,{onClick:N},{default:t(()=>u[8]||(u[8]=[v("\u8FD4\u56DE",-1)])),_:1,__:[8]}),o(V,{type:"primary",loading:e(O),onClick:u[7]||(u[7]=l=>M(e(y)))},{default:t(()=>u[9]||(u[9]=[v("\u4FDD\u5B58",-1)])),_:1,__:[9]},8,["loading"])])]),_:1})]),_:1,__:[10]},8,["model","rules"])}}});export{Z as _};
