import{c as V}from"./common-8a6acaa7.js";import{d as z,p as r,i as l,a as c,z as h,m as o,j as s,B as R,t as B,k as e,v as q,c as k,F as A,q as G,l as E,C as U,D as F,G as P,_ as J,w as K,e as N,H as Q,I as W}from"./index-deffec86.js";const X={class:"flex-row"},Z=["id"],ee={class:"notice-dialog-box"},te={class:"time-text ml5 mr5"},oe=["innerHTML"],ne={key:0,class:"flex-row ml5 mr5 mt10"},le={class:"flex-direction"},se={class:"dialog-footer"},ae=z({__name:"noticeDialog",setup(T,{expose:x}){const u=r(!1),{proxy:w}=P(),f=r("\u586B\u62A5\u516C\u544A"),y=r(""),i=r(null),C=()=>{b()},t=n=>w.$dayjs(n*1e3).format("YYYY/MM/DD"),_=r(!1),p=()=>{_.value=!_.value},D=async n=>{n.file_url?window.open("https://qmjs.ynsport.cn/fileview/onlinePreview?url="+encodeURIComponent(U.encode(n.file_url))):F.warning("\u9884\u89C8\u5730\u5740\u65E0\u6548")},b=async()=>{const n=await V({involve_business:5});if(n.code==200){if(Object.prototype.toString.call(n.data)=="[object Object]"){let{is_remind:a,valid_start_time:S,valid_end_time:d}=n.data;new Date().getTime(),new Date(S).getTime(),new Date(d).getTime(),f.value=n.data.title,y.value=n.data.content,i.value=n.data,u.value=!0;return}F.warning("\u6682\u65E0\u516C\u544A")}else F.warning(n.message)};return x({openDialog:C}),(n,a)=>{const S=l("FullScreen"),d=l("el-icon"),g=l("el-button"),M=l("Minus"),I=l("Close"),L=l("el-divider"),$=l("Link"),O=l("Download"),Y=l("el-link"),H=l("el-dialog");return c(),h(H,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=m=>u.value=m),title:f.value,center:"",width:"40%","show-close":!1,fullscreen:_.value},{header:o(({titleId:m,titleClass:v,close:j})=>[s("div",X,[s("h4",{id:m,class:R(v),style:{flex:"1"}},B(f.value),11,Z),_.value?(c(),h(g,{key:1,type:"text",onClick:p,class:"mr10"},{default:o(()=>[e(d,{size:"20",color:"grey"},{default:o(()=>[e(M)]),_:1})]),_:1})):(c(),h(g,{key:0,type:"text",onClick:p,class:"mr10"},{default:o(()=>[e(d,{size:"20",color:"grey"},{default:o(()=>[e(S)]),_:1})]),_:1})),e(g,{type:"text",onClick:j},{default:o(()=>[e(d,{size:"20",color:"grey"},{default:o(()=>[e(I)]),_:1})]),_:2},1032,["onClick"])])]),footer:o(()=>[s("span",se,[e(g,{type:"primary",onClick:a[0]||(a[0]=m=>u.value=!1)},{default:o(()=>a[3]||(a[3]=[q("\u786E\u8BA4")])),_:1})])]),default:o(()=>{var m;return[s("div",ee,[s("div",te,"\u53D1\u5E03\u65F6\u95F4:"+B(t(i.value.c_time)),1),e(L,{class:"mb10 mt10"}),s("div",null,[s("div",{innerHTML:y.value},null,8,oe)]),((m=i.value.attachments)==null?void 0:m.length)>0?(c(),k("div",ne,[a[2]||(a[2]=s("div",{class:"mr30 flx-center"},"\u9644\u4EF6",-1)),s("div",le,[(c(!0),k(A,null,G(i.value.attachments,v=>(c(),k("div",{key:v,class:"flex-row flx-center"},[e(g,{type:"text",class:"attachment-link mr10",onClick:j=>D(v)},{default:o(()=>[e(d,null,{default:o(()=>[e($)]),_:1}),s("span",null,B(v.name),1)]),_:2},1032,["onClick"]),e(Y,{href:v.file_url,target:"_blank"},{default:o(()=>[e(d,{size:"20"},{default:o(()=>[e(O)]),_:1})]),_:2},1032,["href"])]))),128))])])):E("v-if",!0)])]}),_:1},8,["modelValue","title","fullscreen"])}}});const ie=J(ae,[["__scopeId","data-v-125ff6ee"]]),ue=z({__name:"index",props:{isShow:{type:Boolean,default:!1},showAlert:{type:Boolean,default:!1}},setup(T,{expose:x}){const u=r(null),w=r(!1),f=r(""),y=T,i=()=>{var t;(t=u.value)==null||t.openDialog()},C=async()=>{const t=await V({involve_business:5});if(t.code==200&&Object.prototype.toString.call(t.data)=="[object Object]"){let{is_remind:_,valid_start_time:p,valid_end_time:D}=t.data;new Date().getTime(),new Date(p).getTime(),new Date(D).getTime();let b=Q("show_notice");w.value=!0,f.value=t.data.title,_==1&&!b&&(i(),W("show_notice",!0))}else t.message};return K(()=>y.isShow,t=>{t&&C()},{immediate:!0}),x({openNotice:i}),(t,_)=>{const p=l("el-alert");return c(),k(A,null,[e(ie,{ref_key:"noticeRef",ref:u},null,512),N(w)&&t.showAlert?(c(),h(p,{key:0,title:"\u516C\u544A:"+N(f),type:"warning",description:"",closable:!1,class:"mb10","show-icon":"",onClick:i},null,8,["title"])):E("v-if",!0)],64)}}});export{ue as _};
