import{notificationApi as m}from"./index-3KNrlnzw.js";import{_ as N,h as C,o as g,c as h,b as t,w as a,r as l,g as s,y as A,k as x,m as V,e as d,t as E,a as p}from"./index-BO9jfAEj.js";const k={class:"notification-page"},P={class:"card-header"},S={style:{"margin-top":"16px","text-align":"center"}},G={__name:"NotificationView",setup(K){const u=s([]),r=s(!1),c=s(1),f=s(0);function v(o){return{OKR_REVIEW:"OKR审核",OKR_REVIEWED:"审核结果",SCORE_CONFIRM:"评分确认",SCORE_CONFIRMED:"确认通知",PERIOD_DEADLINE:"截止提醒",PERIOD_OKR_ALIGN:"周期发布",PERIOD_EXECUTING:"开始执行",PERIOD_ASSESSING:"考评开始",PERIOD_ARCHIVED:"周期归档",KR_LAGGING:"进度滞后",FEEDBACK_NOTIFY:"面谈通知"}[o]||o}async function _(){r.value=!0;try{const o=await m.getPage({page:c.value,size:20});u.value=o.records,f.value=o.total}finally{r.value=!1}}async function R(){await m.markAllRead(),await _()}return C(_),(o,e)=>{const I=l("el-button"),D=l("el-tag"),i=l("el-table-column"),w=l("el-table"),y=l("el-pagination"),O=l("el-card"),b=A("loading");return g(),h("div",k,[t(O,null,{header:a(()=>[p("div",P,[e[2]||(e[2]=p("span",null,"消息通知",-1)),t(I,{text:"",type:"primary",onClick:R},{default:a(()=>[...e[1]||(e[1]=[d("全部已读",-1)])]),_:1})])]),default:a(()=>[x((g(),V(w,{data:u.value,stripe:""},{default:a(()=>[t(i,{label:"状态",width:"70"},{default:a(({row:n})=>[t(D,{size:"small",type:n.isRead===0?"danger":"info"},{default:a(()=>[d(E(n.isRead===0?"未读":"已读"),1)]),_:2},1032,["type"])]),_:1}),t(i,{prop:"title",label:"标题","min-width":"180"}),t(i,{prop:"content",label:"内容","min-width":"240","show-overflow-tooltip":""}),t(i,{label:"类型",width:"120"},{default:a(({row:n})=>[d(E(v(n.type)),1)]),_:1}),t(i,{prop:"createdAtFriendly",label:"时间",width:"100"})]),_:1},8,["data"])),[[b,r.value]]),p("div",S,[t(y,{"current-page":c.value,"onUpdate:currentPage":e[0]||(e[0]=n=>c.value=n),total:f.value,"page-size":20,layout:"prev, pager, next",onCurrentChange:_},null,8,["current-page","total"])])]),_:1})])}}},L=N(G,[["__scopeId","data-v-109f2d89"]]);export{L as default};
