You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

newModuleForm.c119b871.js 3.2KB

1
  1. import{d as J,D as P,r as k,o as z,c as a,e as n,I as u,i as s,h as d,f as _,F as f,J as c,V as x,j as v,t as b,u as p,g as A,k as G}from"./index.0b616ce3.js";import{h as H,f as K,c as g,b as O,e as Q}from"./uploadAction.0353e8a4.js";const W={class:"el-upload__tip"},X=J({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(),h=V=>{y.value.validate(i=>{V(i)})};return z(()=>{l.value=r.data}),U({validForm:h,formData:l}),(V,i)=>{var L;const M=a("el-input"),j=a("el-input-number"),B=a("el-radio"),C=a("el-radio-group"),D=a("el-checkbox"),S=a("el-checkbox-group"),q=a("el-button"),R=a("el-upload"),T=a("el-form-item"),$=a("el-col"),E=a("el-row"),I=a("el-form");return l.value&&((L=l.value.formList)==null?void 0:L.length)?(n(),u(I,{key:0,ref_key:"formRef",ref:y,model:l.value,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":"",onSubmit:i[1]||(i[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(T,{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:i[0]||(i[0]=x(()=>{},["prevent"]))},null,8,["modelValue","onUpdate:modelValue","min","max"])):t.props.type==="\u5355\u9009"?(n(),u(C,{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(B,{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(S,{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(D,{key:m,label:e.name},{default:s(()=>[v(b(e.name),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):(n(),u(R,{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:p(N),"on-success":e=>p(H)(e,l.value.formList[o].value,!1),"before-upload":e=>p(K)(e,{types:p(g)}),accept:p(g).map(e=>`.${e}`).join(","),"on-preview":p(O)},{tip:s(()=>[A("div",W," \u652F\u6301"+b(p(Q))+"\u6587\u4EF6 ",1)]),default:s(()=>[d(q,{type:"primary",plain:""},{default:s(()=>[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"])):G("",!0)}}});export{F as default};