import{W as A}from"./index-1dbedb0f-1782729249161v=1.0.0.js";import{i as w,j as L,k as O}from"./eventListApi-caa95bfe-1782729249161v=1.0.0.js";import{z as C,_ as P}from"./index-b309bf9f-1782729249161v=1.0.0.js";import{E as b}from"./eleVendor-5008d1ec-1782729249161v=1.0.0.js";import{y as M,r as i,m as S,al as B,z as _,A as h,B as y,R as r,M as I,Q as W,a4 as j,I as U,J as d,O as g,P as F,u as E}from"./vendor-1e24e3ad-1782729249161v=1.0.0.js";import"./style-368a93d4-1782729249161v=1.0.0.js";import"./index-d7758263-1782729249161v=1.0.0.js";const J={class:"data-entry-container"},Q={class:"data-entry-title"},$={class:"data-entry-content"},q={class:"data-entry-content-item"},G=M({__name:"DataEntry",props:{eventId:{default:""}},emits:["previous","save"],setup(N,{emit:R}){const v=N,D=R,f=i({bizConfType:"event_regulation",bizContentId:8});i({isEventRegulation:1,eventRegulationContent:"sint cupidatat veniam"});const p=i([]),u=i(!1),m=i({}),k=async()=>{let a=await w(v.eventId);if(a.code===0){f.value.bizContentId=a.data.bizContentId,f.value.bizConfType=a.data.bizConfType;let e=[];a.data.customFieldConfList.forEach(t=>{e.push({fieldName:t.fieldName,fieldValue:t.fieldValue,valueData:m.value[t.fieldName]||""})}),p.value=e}},z=async()=>{let a=await L(v.eventId),e={};try{a.code===0&&(a.data.forEach(t=>{let n="";t.list.forEach(o=>{n+=`<p>${o}</p>`}),e[t.name]=n}),m.value=e,m.value)}catch(t){console.error("\u83B7\u53D6\u9ED8\u8BA4\u6570\u636E",t)}},V=()=>{D("previous")},x=async()=>{let a={},e="";const t=s=>"<h3>"+s+"</h3>";p.value.forEach((s,T)=>{e+=t(C(T)+"\u3001"+s.fieldName),e+=s.valueData,a[s.fieldValue]=s.valueData});let n={...f.value,...a},o={eventId:v.eventId,isEventRegulation:1,eventRegulationContent:e};u.value=!0;let c={...o,...n},l=await O(c,()=>{u.value=!1});l.code===0?(b.success("\u4FDD\u5B58\u6210\u529F"),D("save",e),u.value=!1):(b.error(l.msg),u.value=!1)};return S(async()=>{await z(),k()}),(a,e)=>{const t=B("el-form-item"),n=B("el-button");return _(),h("div",J,[y("div",Q,[r(t,{label:""}),I(" TODO  \u5BFC\u5165\u529F\u80FD\u672A\u5B9E\u73B0 "),I(' <el-button type="primary" @click="handleAdd">\u65B0\u589E</el-button> ')]),y("div",$,[(_(!0),h(W,null,j(E(p),(o,c)=>(_(),U(t,{key:c,label:o.fieldName,"label-position":"top"},{label:d(({label:l})=>[g(F(E(C)(c))+"\u3001 "+F(l),1)]),default:d(()=>[y("div",q,[r(A,{value:o.valueData,"onUpdate:value":l=>o.valueData=l,hideToolBar:"",height:"200px",importWord:!0},null,8,["value","onUpdate:value"])])]),_:2},1032,["label"]))),128)),r(t,null,{default:d(()=>[r(n,{onClick:V},{default:d(()=>e[0]||(e[0]=[g("\u4E0A\u4E00\u6B65",-1)])),_:1,__:[0]}),r(n,{type:"primary",onClick:x,loading:E(u)},{default:d(()=>e[1]||(e[1]=[g("\u4FDD\u5B58",-1)])),_:1,__:[1]},8,["loading"])]),_:1})])])}}});const ae=P(G,[["__scopeId","data-v-7eae2d21"]]);export{ae as default};
