(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6ada0270"],{1836:function(t,e,o){"use strict";o("d19a")},7533:function(t,e,o){"use strict";o.r(e);var i=o("7a23");const s={style:{"margin-bottom":"10px"}},n={key:0,style:{"text-align":"center"}},l={key:1,style:{"font-size":"16px",color:"#939292"}},a={class:"f-loading"};function r(t,e,o,r,c,d){const m=Object(i["resolveComponent"])("vol-form"),p=Object(i["resolveComponent"])("vol-table"),h=Object(i["resolveComponent"])("el-button");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[c.loading?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:0,labelWidth:300,class:"submit-form",style:Object(i["normalizeStyle"])({width:c.formWidth+"px"})},[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(c.title),1),Object(i["createVNode"])(m,{ref:"form",labelPosition:"top",labelWidth:0,"load-key":!0,formFields:c.options.fields,formRules:c.options.formOptions},null,8,["formFields","formRules"]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(c.options.tables,(t,e)=>(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{style:{margin:"20px 0"},key:e},[Object(i["createElementVNode"])("h4",s,Object(i["toDisplayString"])(t.name),1),Object(i["createVNode"])(p,{url:t.url,"load-key":!1,index:!0,ref_for:!0,ref:"table"+e,tableData:t.tableData,columns:t.columns,"max-height":250,"pagination-hide":t.pagination,"column-index":!0,ck:!0},null,8,["url","tableData","columns","pagination-hide"])]))),128)),c.hasId?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",n,[Object(i["createVNode"])(h,{type:"primary",onClick:d.submit},{default:Object(i["withCtx"])(()=>[Object(i["createTextVNode"])("提交")]),_:1},8,["onClick"])])):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",l,"未获取到参数"))],4)),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",a,"正在加载中...",512),[[i["vShow"],c.loading]])])}o("14d9");var c=o("6e5b"),d=o("0b13"),m={components:{"vol-form":c["a"],"vol-table":d["a"]},data(){return{hasId:!1,loading:!0,formWidth:300,title:"",options:{fields:{FormId:void 0},formOptions:[],tables:[],tabs:[]}}},methods:{submit(){this.$refs.form.validate(()=>{let t={};for(const e in this.options.fields)t[e]=this.options.fields[e]&&"object"==typeof this.options.fields[e]?this.options.fields[e].join(","):this.options.fields[e];this.http.post("api/formDesignOptions/submit",{mainData:{FormData:JSON.stringify(t),FormId:this.options.fields.FormId}},!0).then(t=>{if(!t.status)return this.$message.error(t.message);this.$Message.success("提交成功"),this.$router.push({path:"/message",text:"提交成功"})})})},initIndex(){let t=1;this.options.formOptions.forEach(e=>{e.forEach(t=>{t.data&&(t.data=[])}),e.length>t&&(t=e.length)}),this.options.tables.length?this.formWidth=800:this.formWidth=1===t?450:300*t,1==t&&this.options.formOptions.forEach((t,e)=>{t[0].placeholder=t[0].title,t[0].title=e+1+"、"+t[0].title})}},created(){this.options.fields.FormId=this.$route.query.id,this.hasId=!!this.options.fields.FormId;let t="api/formDesignOptions/getFormOptions?id="+this.$route.query.id;this.http.get(t,{},!0).then(t=>{if(!t.data.formOptions)return this.$message.error("未获取到配置信息");var e=JSON.parse(t.data.formOptions);this.options.formOptions=e.formOptions,Object.assign(this.options.fields,e.fields),this.options.tables=e.tables,this.initIndex(),this.title=t.data.title,this.loading=!1})}},p=(o("1836"),o("d959")),h=o.n(p);const b=h()(m,[["render",r],["__scopeId","data-v-dad42b22"]]);e["default"]=b},d19a:function(t,e,o){}}]);
|