|
- import{d as H,B as P,r as k,o as z,c as a,e as n,G as u,i as s,h as d,f,F as _,H as c,T as x,j as v,t as b,u as i,g as A,k as I}from"./index.55251523.js";import{h as J,f as K,c as g,b as O,e as Q}from"./uploadAction.6ab57011.js";const W={class:"el-upload__tip"},X=H({name:"newModuleForm"}),F=Object.assign(X,{props:{data:{type:Object,default:null}},setup(w,{expose:U}){const N=P.dictStore.uploadUrl,r=w,l=k({formList:[]}),y=k(),B=V=>{y.value.validate(p=>{V(p)})};return z(()=>{l.value=r.data}),U({validForm:B,formData:l}),(V,p)=>{var L;const M=a("el-input"),j=a("el-input-number"),C=a("el-radio"),S=a("el-radio-group"),h=a("el-checkbox"),D=a("el-checkbox-group"),T=a("el-button"),q=a("el-upload"),R=a("el-form-item"),$=a("el-col"),E=a("el-row"),G=a("el-form");return l.value&&((L=l.value.formList)==null?void 0:L.length)?(n(),u(G,{key:0,ref_key:"formRef",ref:y,model:l.value,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":"",onSubmit:p[1]||(p[1]=x(()=>{},["prevent"]))},{default:s(()=>[d(E,{gutter:40},{default:s(()=>[(n(!0),f(_,null,c(r.data&&r.data.formList,(t,o)=>(n(),u($,{key:o,span:12},{default:s(()=>[d(R,{label:t.name,prop:`formList[${o}].value`,rules:[{required:t.props.required,message:"\u8BF7\u5B8C\u5584\u5FC5\u586B\u5185\u5BB9"}]},{default:s(()=>[t.props.type==="\u8F93\u5165"?(n(),u(M,{key:0,modelValue:l.value.formList[o].value,"onUpdate:modelValue":e=>l.value.formList[o].value=e,placeholder:"\u8BF7\u8F93\u5165",maxlength:t.props.maxLength},null,8,["modelValue","onUpdate:modelValue","maxlength"])):t.props.type==="\u6570\u503C\u8F93\u5165"?(n(),u(j,{key:1,modelValue:l.value.formList[o].value,"onUpdate:modelValue":e=>l.value.formList[o].value=e,placeholder:"\u8BF7\u8F93\u5165",min:t.props.minNumber,max:t.props.maxNumber,controls:!1,onMousewheel:p[0]||(p[0]=x(()=>{},["prevent"]))},null,8,["modelValue","onUpdate:modelValue","min","max"])):t.props.type==="\u5355\u9009"?(n(),u(S,{key:2,modelValue:l.value.formList[o].value,"onUpdate:modelValue":e=>l.value.formList[o].value=e},{default:s(()=>[(n(!0),f(_,null,c(t.props.options,(e,m)=>(n(),u(C,{key:m,label:e.name},{default:s(()=>[v(b(e.name),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):t.props.type==="\u591A\u9009"?(n(),u(D,{key:3,modelValue:l.value.formList[o].value,"onUpdate:modelValue":e=>l.value.formList[o].value=e},{default:s(()=>[(n(!0),f(_,null,c(t.props.options,(e,m)=>(n(),u(h,{key:m,label:e.name},{default:s(()=>[v(b(e.name),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):(n(),u(q,{key:4,"file-list":l.value.formList[o].value,"onUpdate:fileList":e=>l.value.formList[o].value=e,class:"w-full",limit:t.props.fileNumber,action:i(N),"on-success":e=>i(J)(e,l.value.formList[o].value,!1),"before-upload":e=>i(K)(e,{types:i(g)}),accept:i(g).map(e=>`.${e}`).join(","),"on-preview":i(O)},{tip:s(()=>[A("div",W," \u652F\u6301"+b(i(Q))+"\u6587\u4EF6 ",1)]),default:s(()=>[d(T,{type:"primary",plain:""},{default:s(()=>p[2]||(p[2]=[v("\u9009\u62E9\u6587\u4EF6")])),_:1})]),_:2},1032,["file-list","onUpdate:fileList","limit","action","on-success","before-upload","accept","on-preview"]))]),_:2},1032,["label","prop","rules"])]),_:2},1024))),128))]),_:1})]),_:1},8,["model"])):I("",!0)}}});export{F as default};
|