import{_ as k}from"./BaseForm.vue_vue_type_script_setup_true_lang-a7d95b1a-1782111760424v=1.0.0.js";import{u as F,g as T}from"./specialWorkPublicApi-04f6012b-1782111760424v=1.0.0.js";import{u as V}from"./useFormEdit-61a257a4-1782111760424v=1.0.0.js";import{a as q}from"./index-996f931c-1782111760424v=1.0.0.js";import{E as n}from"./eleVendor-99a45232-1782111760424v=1.0.0.js";import{m as p,a as r,e as P,ai as W,p as h,M as L,O as R,U as S,u as d,D as f}from"./vendor-7f807b9d-1782111760424v=1.0.0.js";import"./dataDictApi-d2fc600e-1782111760424v=1.0.0.js";import"./CustomFormTypeSelectDialog-56de3184-1782111760424v=1.0.0.js";import"./CustomForm-9586fd2f-1782111760424v=1.0.0.js";import"./tabs-cb939388-1782111760424v=1.0.0.js";const b=p({name:"specialWorkPublicEdit"}),J=p({...b,setup(w){const{closeCurrent:c}=V(),g=r(null),i=r({year:"",title:"",specialWorkType:"",pushTime:"",startTime:"",endTime:"",content:"",attachments:[],status:"",closeType:"",creatorName:"",customFieldConfList:[],tableTitle:""}),l=r(!1),y=()=>{c()},v=async a=>{l.value=!0;try{let e=F,o="\u66F4\u65B0\u6210\u529F";a.attachments=a.fileStr,a.filloutRequire=a.filloutRequire.join(","),a.customFieldConfList=a.customFieldConfList.map((s,C)=>{var m;return{...s,selectValues:(m=s.selectValues)==null?void 0:m.join(","),fieldValue:s.fieldValue?s.fieldValue:`field${C+1}`}});let t=await e(a);if(t.code==0)n({type:"success",message:`${o}!`});else{n.warning(t.msg),l.value=!1;return}l.value=!1,c()}catch{l.value=!1}},u=q(),_=async a=>{var o;let e=await T(a);if(e.code!=0){n.warning(e.msg);return}e.data.attachments.length>0&&(e.data.attachments=JSON.parse(e.data.attachments)),e.data.specialWorkType&&(e.data.specialWorkType=Number(e.data.specialWorkType)),e.data.filloutRequire=((o=e.data.filloutRequire)==null?void 0:o.split(","))||[],e.data.customFieldConfList=e.data.customFieldConfList.map(t=>{var s;return{...t,selectValues:(s=t.selectValues)==null?void 0:s.split(",")}}),i.value=e.data};return P(()=>{u.query.id&&(g.value=u.query.id,_(u.query.id))}),(a,e)=>{const o=W("PaIndexPage");return h(),L(o,null,{default:R(()=>[S(k,{value:d(i),"onUpdate:value":e[0]||(e[0]=t=>f(i)?i.value=t:null),loading:d(l),"onUpdate:loading":e[1]||(e[1]=t=>f(l)?l.value=t:null),onCancel:y,onSubmit:v},null,8,["value","loading"])]),_:1})}}});export{J as default};
