import{_ as e,aE as a,aF as o,aG as s,u as l,aH as r,v as t,aI as d,a as i,c as m,w as u,d as n,C as f,F as p,D as c,ai as h,Z as w,e as y,b as _,H as F,aj as v,f as V,i as I}from"./index-BlslIQWi.js";const b=e({name:"FormRender",options:{styleIsolation:"shared"},components:{WFormItem:a},props:{modelValue:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})},jsonConf:{type:Array,default:()=>[]}},computed:{_value:{get(){return this.modelValue},set(e){emit("update:modelValue",e)}},rules(){const e={};return this.formFields.forEach((a=>{a.props.required&&(e[a.id]={rules:[{required:!0,errorMessage:"请填写"+a.title}]})})),e},formFields(){const e=[];return this.jsonConf.forEach((a=>this.loadInnerField(a,e))),console.log(JSON.stringify(e),666),e}},data:()=>({}),onReady(){this.$refs.wflowForm.setRules(this.rules)},methods:{showItem:o,loadInnerField(e,a){"SpanLayout"===e.name?e.props.items.forEach((e=>this.loadInnerField(e,a))):a.push(e)},validate(e){this.$refs.wflowForm.validate().then((a=>{e(!0),console.log("表单数据信息：",a)})).catch((e=>{console.log("表单错误信息：",e)}))}},emits:["update:modelValue"]},[["render",function(e,a,o,b,g,E){const j=V,q=I,C=s("w-form-item"),R=l(t("uni-forms-item"),r),x=l(t("uni-forms"),d);return i(),m(q,{class:"wflow-form"},{default:u((()=>[n(x,{ref:"wflowForm",class:"wflow-form",rules:E.rules,modelValue:E._value,"label-position":"top","label-width":"200"},{default:u((()=>[(i(!0),f(p,null,c(E.formFields,(e=>h((i(),m(R,{class:w("w-form-item "+("R"===e.perm?"w-form-item-r":"")),name:e.id,key:e.id,required:e.props.required},{label:u((()=>[n(q,{class:"w-form-title"},{default:u((()=>[e.props.required&&"E"===e.perm?(i(),m(j,{key:0,style:{color:"#CE5266"}},{default:u((()=>[y("* ")])),_:1})):_("",!0),n(j,{style:{"font-size":"32rpx"}},{default:u((()=>[y(F(e.title),1)])),_:2},1024)])),_:2},1024)])),default:u((()=>[n(C,{type:e.name,modelValue:E._value[e.id],"onUpdate:modelValue":a=>E._value[e.id]=a,"form-props":e.props,readonly:"E"!==e.perm,formData:E._value},null,8,["type","modelValue","onUpdate:modelValue","form-props","readonly","formData"])])),_:2},1032,["class","name","required"])),[[v,E.showItem(e,E._value[e.id])]]))),128))])),_:1},8,["rules","modelValue"])])),_:1})}],["__scopeId","data-v-c065bdd3"]]);export{b as F};
