import{a0 as N,ax as B}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897336.js";import{_ as P}from"./index.vue_vue_type_script_setup_true_lang.17037962789733.js";import V from"./ViewDialog.1703796278973.js";import{_ as y}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import{c as A,e as R,f as D}from"./system.1703796278973.js";import{a as M}from"./notificationSubscription.1703796278973.js";import{h as Y}from"./moment.1703796278973.js";import"./default.1703796278973.js";import"./index.1703796278973299.js";import{u as $}from"./useParams.1703796278973.js";import{d as b,k as n,p as q,r as c,o as g,c as x,a as o,z as H,b as r,t as h,A as k,u as s,M as L,B as U}from"./vue.1703796278973.js";import{aN as j}from"./index.17037962789733.js";import{_ as z}from"./_plugin-vue_export-helper.1703796278973.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897337.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.1703796278973307.js";import"./config.1703796278973.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./permission.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897334.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const J={class:"notification-record-container"},E=b({name:"NotificationRecord"}),O=b({...E,setup(Z){const{updateAlarm:S}=A(),u=[{title:"类型",dataIndex:"topicProvider",key:"topicProvider",search:{type:"select",options:()=>M().then(a=>a.result.map(t=>({label:t.name,value:t.id})).filter(t=>t.value==="alarm"))},scopedSlots:!0,ellipsis:!0},{title:"消息",dataIndex:"message",key:"message",search:{type:"string"},scopedSlots:!0,ellipsis:!0},{title:"通知时间",dataIndex:"notifyTime",key:"notifyTime",search:{type:"date"},scopedSlots:!0,ellipsis:!0},{title:"状态",dataIndex:"state",key:"state",search:{type:"select",options:[{label:"未读",value:"unread"},{label:"已读",value:"read"}]},scopedSlots:!0,ellipsis:!0},{title:"操作",dataIndex:"action",key:"action",ellipsis:!0,scopedSlots:!0,width:"200px"}],d=n({}),m=n(),p={changeStatus:a=>{const t=a.state.value==="read"?"_unread":"_read";D(t,[a.id]).then(l=>{l.status===200&&(j.success("操作成功！"),p.refresh(),S())})},view:a=>{console.log("row: ",a),_.value=a,i.value=!0},refresh:()=>{m.value&&m.value.reload()}},i=n(!1),_=n({}),f=$();return q(()=>{var a,t;(a=f.params)!=null&&a.value.row&&p.view((t=f.params)==null?void 0:t.value.row)}),(a,t)=>{const l=c("pro-search"),I=P,v=c("AIcon"),w=N,C=B,T=c("page-container");return g(),x(T,null,{default:o(()=>[H("div",J,[r(l,{columns:u,target:"category",onSearch:t[0]||(t[0]=e=>d.value={...e})}),r(C,{ref_key:"tableRef",ref:m,columns:u,request:s(R),model:"TABLE",params:s(d),defaultParams:{"sorts[0].name":"notifyTime","sorts[0].order":"desc"}},{topicProvider:o(e=>[h(k(e.topicName),1)]),notifyTime:o(e=>[h(k(s(Y)(e.notifyTime).format("YYYY-MM-DD HH:mm:ss")),1)]),state:o(e=>[r(I,{status:e.state.value,text:e.state.text,statusNames:{read:"success",unread:"error"}},null,8,["status","text"])]),action:o(e=>[r(w,{size:16},{default:o(()=>[r(y,{type:"link",popConfirm:{title:`确认标为${e.state.value==="read"?"未读":"已读"}`,onConfirm:()=>p.changeStatus(e)},tooltip:{title:e.state.value==="read"?"标为未读":"标为已读"}},{default:o(()=>[r(v,{type:"icon-a-PIZHU1"})]),_:2},1032,["popConfirm","tooltip"]),r(y,{type:"link",tooltip:{title:"查看"},onClick:F=>p.view(e)},{default:o(()=>[r(v,{type:"SearchOutlined"})]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["request","params","defaultParams"]),s(i)?(g(),x(V,{key:0,visible:s(i),"onUpdate:visible":t[1]||(t[1]=e=>L(i)?i.value=e:null),data:s(_)},null,8,["visible","data"])):U("",!0)])]),_:1})}}});const Le=z(O,[["__scopeId","data-v-6d848a12"]]);export{Le as default};
