import{u as U,W as O}from"./index-996f931c-1782111760424v=1.0.0.js";import{m as S,f as B,a as i,e as M,ai as n,p as E,M as y,O as o,t as c,U as l,ac as g,ad as v,u as t,K as T,R as h,S as b}from"./vendor-7f807b9d-1782111760424v=1.0.0.js";const z={year:[],title:[{max:255,message:"\u6700\u591A 255 \u4E2A\u5B57\u7B26",trigger:"blur"}],allotType:[],attachments:[],status:[],creatorName:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}],content:[]},W={class:"pt20 mt30"},G=S({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1},showUpload:{type:Boolean,default:!0}},emits:["update:value","update:loading","cancel","submit"],setup(F,{emit:D}){U();let _=F;const m=D,a=B({get(){return A(_.value)},set(u){m("update:value",u)}}),k=B({get(){return _.loading},set(u){m("update:loading",u)}}),C=i(),d=i({xs:24,sm:22,md:20,lg:14,xl:13});i({xs:24,sm:24,md:12,lg:12,xl:12}),i({xs:24,sm:22,md:18,lg:16,xl:8});const A=u=>u,w=()=>JSON.parse(JSON.stringify(a.value)),V=u=>{u.validate(async(e,p)=>{if(e){let s=w();m("submit",s)}else{const s=Object.keys(p)[0];u.scrollToField(s)}})},N=()=>{m("cancel")};return M(()=>{}),(u,e)=>{const p=n("el-input"),s=n("el-form-item"),f=n("PaCol"),P=n("DocumentMul"),L=n("PaRow"),x=n("el-button"),R=n("el-form");return E(),y(R,{model:t(a),ref_key:"formRef",ref:C,rules:t(z),"label-width":"160px"},{default:o(()=>[e[7]||(e[7]=c("div",{class:"mb30"},null,-1)),l(L,null,{default:o(()=>[l(f,g(v(t(d))),{default:o(()=>[l(s,{label:"\u5DE5\u4F5C\u60C5\u51B5\u6982\u8FF0",prop:"digest"},{default:o(()=>[l(p,{modelValue:t(a).digest,"onUpdate:modelValue":e[0]||(e[0]=r=>t(a).digest=r),placeholder:"\u8BF7\u8F93\u5165\u9879\u76EE\u60C5\u51B5\u6982\u8FF0"},null,8,["modelValue"])]),_:1})]),_:1},16),l(f,g(v(t(d))),{default:o(()=>[l(s,{label:"\u5DE5\u4F5C\u60C5\u51B5\u8BF4\u660E",prop:"content"},{default:o(()=>[l(O,{value:t(a).content,"onUpdate:value":e[1]||(e[1]=r=>t(a).content=r),hideToolBar:!1,showEditorAll:!0,height:"300px",titleLimit:64},null,8,["value"])]),_:1})]),_:1},16),F.showUpload?(E(),y(f,g(T({key:0},t(d))),{default:o(()=>[l(s,{label:"\u9644\u4EF6\u4E0A\u4F20",prop:"attachments"},{default:o(()=>[l(P,{fileList:t(a).attachments,"onUpdate:fileList":e[2]||(e[2]=r=>t(a).attachments=r),showFileList:!1,fileSize:5e3,limit:999,mutiple:!0},{tip:o(()=>e[4]||(e[4]=[c("div",{class:"el-upload__tip"},"\u53EA\u80FD\u4E0A\u4F20.doc/.docx/.xls/.xlsx/.ppt/.pptx/.pdf/.mp4/.zip/.rar\u6587\u4EF6\uFF0C\u4E14\u4E0D\u8D85\u8FC75\u4E2AG",-1)])),_:1},8,["fileList"])]),_:1})]),_:1},16)):h("v-if",!0)]),_:1}),l(s,null,{default:o(()=>[c("div",W,[l(x,{onClick:N},{default:o(()=>e[5]||(e[5]=[b("\u8FD4\u56DE")])),_:1}),l(x,{type:"primary",loading:t(k),onClick:e[3]||(e[3]=r=>V(t(C)))},{default:o(()=>e[6]||(e[6]=[b("\u4FDD\u5B58")])),_:1},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});export{G as _};
