var K=Object.defineProperty,F=Object.defineProperties;var q=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var h=(s,t,e)=>t in s?K(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,z=(s,t)=>{for(var e in t||(t={}))M.call(t,e)&&h(s,e,t[e]);if(N)for(var e of N(t))X.call(t,e)&&h(s,e,t[e]);return s},I=(s,t)=>F(s,q(t));var x=(s,t,e)=>new Promise((y,p)=>{var v=u=>{try{i(e.next(u))}catch(a){p(a)}},m=u=>{try{i(e.throw(u))}catch(a){p(a)}},i=u=>u.done?y(u.value):Promise.resolve(u.value).then(v,m);i((e=e.apply(s,t)).next())});import{m as H,n as J,r as Q}from"./index-b06c1eac.js";import{d as Y,u as Z,s as ee,m as te,r as R,G as A,a as ae,j as l,o as f,h as L,w as _,b as r,e as n,c as w,i as B,F as oe,v as ne,n as se,t as g,k as D}from"./index-90c78f99.js";import{u as le}from"./useCurrentInstance-cd4729ef.js";const re={class:"pr-16 flex flex-col w-full page-footer"},ie={class:"flex items-center justify-between"},ce=r("p",{class:"mt-8 mb-8 font-semibold title text-black text-20"},"消息中心",-1),de={class:"flex items-center"},ue={key:0,class:"cycle bg-danger"},_e={class:"text-info"},pe={class:"footer"},me={class:"text-center font-bold text-18 text-[#000000]"},ge={class:"text-info text-right mb-8"},Re=Y({__name:"index",setup(s){const t=Z(),{proxy:e}=le(),y=ee(te.userStore).userInfo,p=R([]),v=R(0),m=A({pageNumber:1,pageSize:10}),i=()=>x(this,null,function*(){const c=yield H(I(z({},m),{userId:y.value.userId,type:b.value==="ALL"?void 0:b.value}));p.value=c.data.records,v.value=c.data.total}),u=c=>x(this,null,function*(){c.id&&(yield J(c.id)),c.type==="WORK_ORDER_URGING"?t.push({name:"workOrderList",query:{orderNum:c.notifyExtra.workOrderNo}}):(a.visible=!0,a.data=c),i()}),a=A({visible:!1,data:void 0}),b=R("ALL"),fe=()=>x(this,null,function*(){yield Q(),e.$message.success("全部已读成功！"),i()});return ae(()=>{i()}),(c,d)=>{const G=l("page-title"),k=l("el-tab-pane"),O=l("el-tabs"),V=l("svg-icon"),E=l("ArrowRightBold"),S=l("el-icon"),C=l("el-button"),U=l("no-data"),$=l("el-pagination"),T=l("el-card"),P=l("el-dialog"),W=l("views");return f(),L(W,null,{default:_(()=>[r("div",re,[n(G,null,{default:_(()=>[r("div",ie,[ce,B("",!0)])]),_:1}),n(T,{class:"my-card news-center text-14 tab-card",shadow:"never"},{header:_(()=>[n(O,{modelValue:b.value,"onUpdate:modelValue":d[0]||(d[0]=o=>b.value=o),onTabChange:i},{default:_(()=>[n(k,{label:"全部",name:"ALL"}),n(k,{label:"工单消息",name:"WORK_ORDER_URGING"}),n(k,{label:"预警消息",name:"INDEX_WARNING"})]),_:1},8,["modelValue"])]),default:_(()=>[r("ul",null,[p.value&&p.value.length?(f(!0),w(oe,{key:0},ne(p.value,(o,j)=>(f(),w("li",{key:j,class:"px-24 py-14 news-li flex justify-between"},[r("div",de,[n(V,{name:"msg-icon",class:"text-40 mr-16"}),r("div",null,[o.readed?B("",!0):(f(),w("p",ue)),r("p",{class:se(`${o.readed?"text-regular":"text-black font-semibold"} mb-4`)},g(o.content),3),r("p",_e,g(o.createTime),1)])]),n(C,{link:"",type:"primary",onClick:ve=>u(o)},{default:_(()=>[D(g(o.type==="WORK_ORDER_URGING"?"去处理":"去查看")+" ",1),n(S,{class:"ml-9"},{default:_(()=>[n(E)]),_:1})]),_:2},1032,["onClick"])]))),128)):(f(),L(U,{key:1}))]),n($,{currentPage:m.pageNumber,"onUpdate:currentPage":d[1]||(d[1]=o=>m.pageNumber=o),"page-size":m.pageSize,"onUpdate:pageSize":d[2]||(d[2]=o=>m.pageSize=o),background:"","page-sizes":[10,20,30,40],layout:"total, prev, pager, next, sizes",total:v.value,onSizeChange:i,onCurrentChange:i},null,8,["currentPage","page-size","total"])]),_:1}),r("div",pe,[n(C,{onClick:d[3]||(d[3]=o=>c.$router.go(-1))},{default:_(()=>[D(" 返 回 ")]),_:1})])]),n(P,{"model-value":a.visible,title:"预警详情",width:640,"destroy-on-close":"",onClose:d[4]||(d[4]=o=>a.visible=!1)},{default:_(()=>[r("p",me,g(a.data&&a.data.title),1),r("p",ge,g(a.data&&a.data.createTime),1),r("div",null,g(a.data&&a.data.content),1)]),_:1},8,["model-value"])]),_:1})}}});export{Re as default};
