import{d as z,V as H,f as Z,r as l,cn as J,c_ as K,aw as Q,d9 as S,c,o as n,w as e,aE as x,j as a,W as U,D as M,l as t,i as O,h as Y,F as ee,aI as te,p as m,A as p,B as oe,iG as ae,ca as y,gW as h,gX as T,X as re,cZ as se}from"./index-9PRMimni.js";import{_ as ne}from"./OnlyOffice.vue_vue_type_script_setup_true_lang-BH1_y9Dy.js";import{u as ie}from"./useTags-C1thGhjF.js";import{a as ce}from"./smsFileHistory-3qnGgVom.js";import{_ as le}from"./SMSDetailModal.vue_vue_type_script_setup_true_lang-CGWwxSAF.js";import{h as me}from"./has-CjqcrIOV.js";import"./event-CLiVQHeO.js";import"./account-C850CBTF.js";import"./tabsView-BXskTdVh.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./BasicForm-dL_oCSPM.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./componentSetting-DVhNDBTO.js";import"./ImageUpload-DUsnro3W.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./propTypes-CebMRUpe.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./useForm-CKmgcynv.js";import"./usePageCache-DluHn7Yy.js";import"./useModal-CO65vga3.js";const pe={class:"flex flex-row"},fe={class:"flex-1 flex justify-end items-center gap-4"},Xe=z({__name:"smsTemplateDetail",setup(ue){const{closeCurrentTabToBack:F,closeCurrentAfterAction:I}=ie(),{t:o}=H(),V=Z(),N=se(),C=K(),{id:k,type:b,module:D}=V.query,w=l(),B=l(),d=l(!1),u=l(!0),_=l(!1),r=l();J((s,q,i)=>{if(_.value)return i();C.warning({title:o("common.confirmText"),content:o("sms.smsTemplate.confirmReturn"),positiveText:o("common.confirmText"),negativeText:o("common.closeText"),draggable:!0,onPositiveClick:()=>{I(()=>{i()})},onNegativeClick:()=>{i(!1)}})});function A(){r.value}async function E(){try{if(!r.value)return;d.value=!0,N.success(o("common.saveSuccessText")),g(),d.value=!1}catch{d.value=!1}}function L(){r.value&&B.value?.showModal(r.value)}function P(s){u.value=!1}function W(){g()}function g(){try{_.value=!0,F()}catch(s){console.warn("Error closing tab:",s)}}function $(s){me(s,"fileCode")||C.error({title:o("common.optionsFailText"),content:o("sms.smsTemplate.noData"),positiveText:o("common.confirmText"),onPositiveClick:()=>{g()}})}async function j(){try{if(D==="smsTemplate"&&(r.value=await ce(k)),!r.value)return;$(r.value)}catch{u.value=!1}}return Q(async()=>{try{if(await j(),!r.value)return;await w.value?.handleInitOffice(r.value.fileCode,k,"smsTemplate")}catch{u.value=!1}}),(s,q)=>{const i=oe,f=te,v=U,G=re,R=S("debounce"),X=S("loading");return n(),c(G,null,{default:e(()=>[x((n(),c(v,{segmented:{content:!0},size:"small",class:"proCard"},{header:e(()=>[a(v,{bordered:!1,class:"proCard bg-transparent h-full","content-class":"p-0 flex items-center"},{default:e(()=>[O("div",pe,[a(f,{trigger:"hover"},{trigger:e(()=>[a(i,{quaternary:"",class:"mr-2",onClick:W},{icon:e(()=>[(n(),c(y(t(h)(t(T).back,"text-base"))))]),_:1})]),default:e(()=>[m(p(t(o)("common.back")),1)]),_:1}),a(f,{trigger:"hover"},{trigger:e(()=>[a(v,{bordered:!1,class:"proCard bg-transparent","content-class":"p-0 font-bold text-[18px] md:text-[12px] lg:text-[14px] xl:text-[16px] 2xl:text-[18px] whitespace-nowrap overflow-hidden text-ellipsis flex items-center"},{default:e(()=>[m(p(t(o)("sms.smsTemplate.formDetail")),1)]),_:1})]),default:e(()=>[m(" "+p(t(o)("sms.smsTemplate.formDetail")),1)]),_:1})])]),_:1})]),"header-extra":e(()=>[O("div",fe,[t(b)==="edit"?(n(),Y(ee,{key:0},[a(f,{trigger:"hover"},{trigger:e(()=>[x((n(),c(i,{strong:"",secondary:"",type:"primary",class:"pl-[8px] pr-[8px]"},{icon:e(()=>[a(t(ae))]),_:1})),[[R,A,"300"]])]),default:e(()=>[m(p(t(o)("sms.smsTemplate.importBaseSMSForm")),1)]),_:1}),a(f,{trigger:"hover"},{trigger:e(()=>[x((n(),c(i,{strong:"",secondary:"",type:"primary",class:"pl-[8px] pr-[8px]"},{icon:e(()=>[(n(),c(y(t(h)(t(T).save))))]),_:1})),[[R,E,"1000"]])]),default:e(()=>[m(p(t(o)("common.saveText")),1)]),_:1})],64)):M("",!0),a(f,{trigger:"hover"},{trigger:e(()=>[a(i,{strong:"",secondary:"",type:"primary",class:"pl-[8px] pr-[8px]",onClick:L},{icon:e(()=>[(n(),c(y(t(h)(t(T).log))))]),_:1})]),default:e(()=>[m(p(t(o)("sms.smsTemplate.viewDetail")),1)]),_:1})])]),default:e(()=>[t(_)?M("",!0):(n(),c(t(ne),{key:0,ref_key:"onlyOfficeRef",ref:w,mode:t(b),height:"80vh",onOnInfo:P},null,8,["mode"]))]),_:1})),[[X,t(u)]]),a(le,{ref_key:"SMSDetailModalRef",ref:B},null,512)]),_:1})}}});export{Xe as default};
