var y=(f,r,s)=>new Promise((l,p)=>{var d=e=>{try{u(s.next(e))}catch(t){p(t)}},m=e=>{try{u(s.throw(e))}catch(t){p(t)}},u=e=>e.done?l(e.value):Promise.resolve(e.value).then(d,m);u((s=s.apply(f,r)).next())});import{_ as k}from"./write.vue_vue_type_script_setup_true_lang-DoI33O5M.js";import{_ as x}from"./ContentDetailWrap.vue_vue_type_script_setup_true_lang-BT6PDDaO.js";import{c as C}from"./index-OziN21LA.js";import{l as R,aB as b,aI as D,r as w,ai as $,m as h,M as K,O as c,U as _,S as v,u as n}from"./vue-chunks-l-AyUCfi.js";import{c as N,u as T,e as I}from"./index-Cl3s0rC0.js";import{u as S}from"./useEventBus-yN5ROQx3.js";import"./useForm-DFfbRY9m.js";import"./element-plus-C2aeItNs.js";import"./wang-editor-D6T5hJzu.js";import"./tsxHelper-BLTo71S4.js";import"./useValidator-dY8qp_qX.js";import"./message.vue_vue_type_script_setup_true_lang-C0R52Rsd.js";import"./material.vue_vue_type_script_setup_true_lang-yKaOPhwY.js";import"./Dialog.vue_vue_type_style_index_0_lang-DTUY8bxL.js";import"./check.vue_vue_type_script_setup_true_lang-Dmnb7eMH.js";import"./useCrudSchemas-BcUSI-wT.js";import"./tree-Dgaev6Pi.js";import"./index-BQ7fd9kg.js";const Z=R({__name:"operate",props:{type:{type:String,default:"add"},id:{type:Number,default:0}},setup(f){const r=f,{emit:s}=S(),{push:l,go:p}=b();D();const{t:d}=C(),m=w(null);y(this,null,function*(){if(r.type=="add")return;const o=yield N(r.id);o&&(m.value=o)});const e=w(),t=w(!1),g=()=>y(this,null,function*(){const o=n(e),a=yield o==null?void 0:o.submit();if(a){t.value=!0;let i=null;r.type=="edit"?i=yield T(a).catch(()=>{}).finally(()=>{t.value=!1}):i=yield I(a).catch(()=>{}).finally(()=>{t.value=!1}),i&&(s("getList",r.type),l("/wechat/keywords"))}});return(o,a)=>{const i=$("BaseButton");return h(),K(n(x),{title:n(d)("exampleDemo.edit"),onBack:a[1]||(a[1]=B=>n(l)("/example/example-page"))},{header:c(()=>[_(i,{onClick:a[0]||(a[0]=B=>n(p)(-1))},{default:c(()=>[v(" 返回 ")]),_:1}),_(i,{type:"primary",loading:t.value,onClick:g},{default:c(()=>[v(" 保存 ")]),_:1},8,["loading"])]),default:c(()=>[_(k,{ref_key:"writeRef",ref:e,"current-row":m.value},null,8,["current-row"])]),_:1},8,["title"])}}});export{Z as default};
