1import{r as u,u as k,c as j,j as o,F as D,a as e,L as E,h as F,v as T}from"./index.7613290f.js";import{A as S}from"./APIOther.d2eeae1a.js";import{f as L}from"./dateFormat.c9475f4c.js";import{D as I}from"./Dashboard.6f7d53d6.js";import"./appInsights.79eb1af4.js";function $(){const i=sessionStorage.getItem("token"),[s,c]=u.exports.useState(),{GetOtherNews:d}=S({tokenParam:i});async function h(){try{const a=await d();a&&c(a)}catch(a){console.error(a)}}u.exports.useEffect(function(){h()},[]);function x(){const a=k(),[n,w]=u.exports.useState(),[g,b]=j(),r=10,[m,v]=u.exports.useState(s),[l,f]=u.exports.useState(1),[y,P]=u.exports.useState(),N=Math.ceil(m.length/r);function C(){l!==N&&(f(t=>t+1),b(t=>({...t,page:l+1})))}function A(){l!==1&&(f(t=>t-1),b(t=>({...t,page:l-1})))}function B(t){t===1&&(f(p=>1),b(p=>({...p,page:1}))),t===-1&&(f(p=>N),b(p=>({...p,page:N})))}return u.exports.useEffect(function(){n||v(()=>s),n==="imoe"&&v(()=>s.filter(t=>t.NewsType==="\u6559\u80B2\u90E8\u516C\u544A")),n==="system"&&v(()=>s.filter(t=>t.NewsType==="\u7CFB\u7D71\u516C\u544A")),n==="event"&&v(()=>s.filter(t=>t.NewsType==="\u6D3B\u52D5\u8A0A\u606F")),f(()=>1)},[n]),u.exports.useEffect(function(){const t=g.get("page");t&&f(parseInt(t))},[g]),u.exports.useEffect(function(){P(()=>m.slice((l-1)*r,l*r))},[l,m]),{navigate:a,newsType:n,setNewsType:w,currentNewsList:m,currentPage:l,currentPageNews:y,totalPages:N,handleNextPage:C,handlePreviousPage:A,handlePage:B,newsPerPage:r}}return{newsList:s,useBulletinBoard:x}}function O({useBulletinBoard:i}){const{navigate:s,newsType:c,setNewsType:d,currentPage:h,currentPageNews:x,totalPages:a,handleNextPage:n,handlePreviousPage:w,handlePage:g,newsPerPage:b}=i();return o(D,{children:[e("div",{className:"\u6A19\u984C w-full text-center text-2xl py-3 font-bold lg:border-b-0 border-b border-black",children:"\u8A0A\u606F\u516C\u544A"}),o("div",{className:"\u5206\u985E flex flex-wrap w-full justify-center gap-5 py-5",children:[e("div",{onClick:()=>d(""),className:`cursor-pointer border border-moe-blue py-2 px-5 rounded font-bold ${c?"text-moe-blue hover:bg-moe-footer":"bg-moe-blue text-white "}`,children:"\u6240\u6709\u516C\u544A"}),e("div",{onClick:()=>d("imoe"),className:`cursor-pointer border border-moe-blue py-2 px-5 rounded font-bold ${c=="imoe"?"bg-moe-blue text-white ":"text-moe-blue hover:bg-moe-footer"}`,children:"\u6559\u80B2\u90E8\u516C\u544A"}),e("div",{onClick:()=>d("system"),className:`cursor-pointer border border-moe-blue py-2 px-5 rounded font-bold ${c=="system"?"bg-moe-blue text-white ":"text-moe-blue hover:bg-moe-footer"}`,children:"\u7CFB\u7D71\u516C\u544A"}),e("div",{onClick:()=>d("event"),className:`cursor-pointer border border-moe-blue py-2 px-5 rounded font-bold ${c=="event"?"bg-moe-blue text-white ":"text-moe-blue hover:bg-moe-footer"}`,children:"\u6D3B\u52D5\u8A0A\u606F"})]}),o("div",{className:"\u8868\u683C w-full borde1 boreder-moe-grey text-md",children:[o("div",{className:"w-full lg:grid lg:grid-cols-[5%,8%,1fr,18%] h-14 border-y border-black font-bold text-moe-blue hidden gap-5",children:[e("div",{}),e("div",{className:"flex justify-center items-center truncate",children:"\u8A0A\u606F\u985E\u5225"}),e("div",{className:"flex justify-center items-center px-2.5 truncate",children:"\u5167\u5BB9"}),e("div",{className:"flex items-center justify-center truncate",children:"\u767C\u5E03\u65E5\u671F"})]}),x&&x.map((r,m)=>o(E,{to:`/bulletin/detail/${r.NewsID}`,className:"w-full grid lg:grid-cols-[5%,8%,1fr,18%] lg:h-14 py-3 odd:bg-gray-300/20 hover:bg-moe-grey group gap-5",children:[o("div",{className:"flex justify-start items-center gap-3 px-5",children:[(h-1)*b+(m+1),o("div",{className:"text-moe-grey group-hover:text-white",children:[" ",r.SetTop==1?e(F,{icon:T}):null]})]}),e("div",{className:"flex justify-start lg:justify-center items-center truncate px-5 lg:px-0 w-full",children:r.NewsType}),e("div",{className:"flex justify-start items-center mx-5 lg:border-x-2 border-moe-grey group-hover:border-white w-full truncate",children:e("span",{className:"truncate lg:px-3 w-11/12",children:r.NewsTitle})}),e("div",{className:"flex justify-end lg:justify-start items-center truncate mx-3",children:e("span",{className:"truncate px-3",children:L(r.UpdateTime)})})]},r.NewsID))]}),o("div",{className:"\u63DB\u9801 flex w-full justify-center flex-col items-center py-5 border-t border-black gap-5",children:[o("div",{className:"flex gap-3",children:[e("button",{className:"border border-moe-blue bg-moe-footer py-2 px-5 rounded active:bg-moe-blue active:text-white hover:bg-moe-blue-border2 transition-all duration-150",onClick:()=>g(1),children:"\u7B2C\u4E00\u9801"}),e("button",{className:"border border-moe-blue bg-moe-footer py-2 px-5 rounded active:bg-moe-blue active:text-white hover:bg-moe-blue-border2 transition-all duration-150",onClick:w,children:"\u524D\u4E00\u9801"}),e("button",{className:"border border-moe-blue bg-moe-footer py-2 px-5 rounded active:bg-moe-blue active:text-white hover:bg-moe-blue-border2 transition-all duration-150",onClick:n,children:"\u5F8C\u4E00\u9801"}),e("button",{className:"border border-moe-blue bg-moe-footer py-2 px-5 rounded active:bg-moe-blue active:text-white hover:bg-moe-blue-border2 transition-all duration-150",onClick:()=>g(-1),children:"\u6700\u5F8C\u9801"})]}),o("div",{children:[h," / ",a]})]})]})}function H(){const{newsList:i,useBulletinBoard:s}=$();return o("div",{className:"w-full",children:[e(I,{}),e("div",{className:"py-10",children:i&&e(O,{newsList:i,useBulletinBoard:s})})]})}export{H as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.