import{notificationApi as m}from"./index-DxOMYcp4.js";import{_ as N,E as C,o as E,c as h,d as t,w as a,r as l,h as s,X as A,Y as x,j as V,b as p,t as g,a as d}from"./index-BKsb6cIX.js";import"./index-B8_nURbH.js";const k={class:"notification-page notification-workbench"},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"),b=l("el-tag"),i=l("el-table-column"),w=l("el-table"),D=l("el-pagination"),O=l("el-card"),y=A("loading");return E(),h("div",k,[t(O,null,{header:a(()=>[d("div",P,[e[2]||(e[2]=d("span",null,"消息通知",-1)),t(I,{text:"",type:"primary",onClick:R},{default:a(()=>[...e[1]||(e[1]=[p("全部已读",-1)])]),_:1})])]),default:a(()=>[x((E(),V(w,{data:u.value,stripe:""},{default:a(()=>[t(i,{label:"状态",width:"70"},{default:a(({row:n})=>[t(b,{size:"small",type:n.isRead===0?"danger":"info"},{default:a(()=>[p(g(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})=>[p(g(v(n.type)),1)]),_:1}),t(i,{prop:"createdAtFriendly",label:"时间",width:"100"})]),_:1},8,["data"])),[[y,r.value]]),d("div",S,[t(D,{"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})])}}},z=N(G,[["__scopeId","data-v-02f1bf7c"]]);export{z as default};
