import{g as e,u as a,a as t,B as l,b as s,r as n,o as i,c as r,d as u,e as m,f as o,h as d,w as c,m as _,j as p}from"./daotianAdmin-20240327_164749.js";import{a as b,u as v,s as f}from"./daotianAdmin-20240327_16474915.js";const h={class:"g_flex_row_center"},g={class:"m-job-detail g_pt_24",style:{width:"880px"}},k={class:"g_flex_row_start g_mt_24 g_ml_110"},w={__name:"add",setup(w){e().appContext.app.config.globalProperties.G;const y=a(),Y=t();l.locale("zh-cn"),s();let T=n({});i((()=>{[{},{},{}].forEach(((e,a)=>{e.rank=a+1,e.title="常用发票主体信息"+a,e.content="默认主体：郑州伯才科技有限公司 单位名称：郑州伯才科技有限公司 纳税人识别号：91410100MA9L4HDT0L 地址：河南自贸试验区郑州"+a,e.time="2024-03-11 13:04:24"})),Y.query.id&&b(Y.query.id).then((e=>{T.value=e.data,T.value.publishTimeStr=l(e.data.publishTime)})),setTimeout((()=>{M()}),1e3)}));const q=n();window.addEventListener("message",(e=>{e.data.lake&&(T.value.contentYuque=e.data.lake,T.value.content=e.data.html,T.value.remake=e.data.remake)}));const M=()=>{q.value.contentWindow.postMessage(""),"messageEdit"==Y.name?q.value.contentWindow.postMessage(T.value.content):q.value.contentWindow.postMessage("")},x=()=>{y.back()},H=n(0),S=()=>{let e={title:T.value.title,content:T.value.content,remake:T.value.remake,contentYuque:T.value.contentYuque,publishTimeStr:l(T.value.publishTimeStr).format("YYYY-MM-DD HH:mm")+":00",status:H.value};"messageEdit"==Y.name?(e.recordId=Y.query.id,v(e).then((e=>{y.back()}))):f(e).then((e=>{y.back()}))};return(e,a)=>{const t=r("a-input"),l=r("a-form-item"),s=r("a-date-picker"),n=r("a-button"),i=r("a-form");return u(),m("div",h,[o("div",g,[d(i,{model:_(T),class:"main_container",onFinish:S,labelCol:{span:3},wrapperCol:{span:20}},{default:c((()=>[d(l,{class:"g_mb_12",label:"标题",name:"title",rules:[{required:!0,message:"请输入标题"}]},{default:c((()=>[d(t,{value:_(T).title,"onUpdate:value":a[0]||(a[0]=e=>_(T).title=e),placeholder:"请输入标题"},null,8,["value"])])),_:1}),d(l,{class:"g_mb_12",label:"发布时间",name:"publishTimeStr",rules:[{required:!1,message:"请选择发布时间"}]},{default:c((()=>[d(s,{value:_(T).publishTimeStr,"onUpdate:value":a[1]||(a[1]=e=>_(T).publishTimeStr=e),placeholder:"请选择发布时间",minuteStep:30,format:"YYYY-MM-DD HH:mm",showTime:{format:"HH:mm"},style:{width:"100%"}},null,8,["value"])])),_:1}),d(l,{class:"g_mb_12",label:"内容",rules:[{required:!0,message:"请输入内容"}],name:"content"},{default:c((()=>[o("iframe",{src:"../../../public/static/editor.html",class:"g_border_d",width:"100%",height:"500px",frameborder:"0",ref_key:"iframeDom",ref:q,style:{"border-radius":"6px"}},null,512)])),_:1}),d(l,{class:"g_mb_12"},{default:c((()=>[o("div",k,[d(n,{class:"g_mr_16",onClick:x},{default:c((()=>[p("取消")])),_:1}),d(n,{class:"g_mr_16",onClick:a[2]||(a[2]=e=>H.value=0),"html-type":"submit"},{default:c((()=>[p("存草稿")])),_:1}),d(n,{type:"primary",onClick:a[3]||(a[3]=e=>H.value=1),"html-type":"submit"},{default:c((()=>[p("发布")])),_:1})])])),_:1})])),_:1},8,["model"])])])}}};export{w as default};
