NotificationView-3eHruxPe.js 2.1 KB

1
  1. import{notificationApi as m}from"./index-Cvo9SNcI.js";import{_ as N,k as b,o as g,c as A,d as t,w as a,r as l,f as s,C as h,n as x,g as V,i as d,t as E,a as p}from"./index-B793OZVz.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 b(_),(o,e)=>{const I=l("el-button"),D=l("el-tag"),i=l("el-table-column"),w=l("el-table"),O=l("el-pagination"),y=l("el-card"),C=h("loading");return g(),A("div",k,[t(y,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"])),[[C,r.value]]),p("div",S,[t(O,{"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};