import{u as L,p as N,q as v,t as R,v as K,w as M,_ as V}from"./index-8db2df2c.js";import{p as $}from"./global-0d825ba6.js";import{f as I}from"./date-20546ee0.js";import{B as U,T as q,L as H,a as O,b as j}from"./ui-ba7aaa7e.js";import{e as E,r as p,d as F,M as G,P as n,a3 as r,a4 as a,f as J,I as y,A as m,H as i,a7 as Q,ab as W,a9 as h}from"./vue-bf422dc1.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";const X={name:"DetailSecondary"},Y=E({...X,setup(Z){const C=L(),k=[{title:"通知内容",colKey:"content"},{title:"状态",colKey:"status"},{title:"通知时间",colKey:"create_at",key:"create_at"},{title:"操作",colKey:"operation"}],_=p([]),o=p({defaultPageSize:20,total:0,defaultCurrent:1}),c=p(!1),l=async()=>{c.value=!0;const e={page:o.value.defaultCurrent,limit:o.value.defaultPageSize};try{const{data:t}=await v({...e});_.value=t.list,o.value={...o.value,total:t.count}}catch(t){console.log(t)}finally{c.value=!1}};l();const x=(e,t)=>{o.value.defaultCurrent=e.current,o.value.defaultPageSize=e.pageSize,l()},b=F(()=>({offsetTop:C.isUseTabsRouter?48:0,container:`.${$}-layout`})),S=async e=>{(await R({id:e})).code===1&&(l(),u())},T=async()=>{(await K()).code===1&&(l(),u())},w=async e=>{(await M({id:e})).code===1&&(l(),u())},z=N(),u=()=>{z.getMsgData()};return(e,t)=>{const B=U,f=q,g=H,D=O,P=j,d=G("perms");return n(),r(P,{title:"通知列表",bordered:!1},{default:a(()=>[J(D,{data:_.value,columns:k,"row-key":"id","vertical-align":"top",hover:y(v).length>0,pagination:o.value,"table-layout":"auto","header-affixed-top":b.value,"max-height":"100%",loading:c.value,onPageChange:x},{topContent:a(()=>[m((n(),r(B,{size:"small",style:{"margin-bottom":"10px"},onClick:t[0]||(t[0]=s=>T())},{default:a(()=>[i(" 标记全部已读 ")]),_:1})),[[d,["merchantapi/user/message/readAll"]]])]),status:a(({row:s})=>[s.status?(n(),r(f,{key:0,theme:"success",size:"small",variant:"outline"},{default:a(()=>[i(" 已读 ")]),_:1})):(n(),r(f,{key:1,theme:"warning",size:"small",variant:"outline"},{default:a(()=>[i(" 未读 ")]),_:1}))]),create_at:a(({row:s})=>[Q("span",null,W(y(I)(s.create_at)),1)]),operation:a(({row:s})=>[s.status===0?m((n(),r(g,{key:0,hover:"color",theme:"primary",onClick:A=>S(s.id)},{default:a(()=>[i("标记已读")]),_:2},1032,["onClick"])),[[d,["merchantapi/user/message/read"]]]):h("",!0),s.status===1?m((n(),r(g,{key:1,hover:"color",theme:"primary",onClick:A=>w(s.id)},{default:a(()=>[i("删除")]),_:2},1032,["onClick"])),[[d,["merchantapi/user/message/del"]]]):h("",!0)]),_:1},8,["data","hover","pagination","header-affixed-top","loading"])]),_:1})}}});const ue=V(Y,[["__scopeId","data-v-fe15a4fb"]]);export{ue as default};
