2025-05-23 00:50:08 +00:00
< template >
2025-05-23 02:45:41 +00:00
< div class = "press-releases-page" >
2025-06-13 04:06:12 +00:00
< n -infinite -scroll :distance ="0" @load ="doLoadMore" >
< main
class = "p-[80px] mx-auto"
style = "max-width: 100vw; min-width: 285px;"
>
< div class = "title mb-[24px]" >
{ { t ( 'press_releases.title' ) } }
< / div >
< div class = "search-container" >
< n -select
: options = "state.selectOptions"
v - model : value = "state.selectedValue"
class = "search-select"
: font - size = "72"
/ >
< n -input
v - model : value = "state.inputValue"
type = "text"
: placeholder = "t('press_releases.search.placeholder')"
class = "search-input"
clearable
: font - size = "72"
/ >
< n -button
type = "primary"
@ click = "handleSearch"
class = "search-button"
: font - size = "72"
2025-05-30 17:21:02 +00:00
>
2025-06-13 04:06:12 +00:00
{ { t ( 'press_releases.search.button' ) } }
< / n - b u t t o n >
< / div >
< div v-for ="(item, idx) in state.filterNewsData" :key ="idx" >
< div class = "news-item mt-[10px]" >
< div class = "news-item-date" > { { item . date } } < / div >
< div
2025-06-16 05:27:27 +00:00
class = "news-item-title text-[#0078d7] cursor-pointer"
style = "word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;"
2025-06-13 04:06:12 +00:00
@ click = "handleNewClick(item)"
>
{ { item . title } }
< / div >
2025-06-16 05:27:27 +00:00
< n -tooltip
trigger = "click"
: disabled = "!item.showTooltip"
width = "trigger"
>
< template # trigger >
< div
: ref = "(el) => setTitleRef(el, idx)"
class = "news-item-content"
style = "
word - break : break - word ;
display : - webkit - box ;
- webkit - line - clamp : 2 ;
- webkit - box - orient : vertical ;
overflow : hidden ;
text - overflow : ellipsis ;
"
>
{ { item . summary } }
< / div >
< / template >
< div slot = "content" >
{ { item . summary } }
< / div >
< / n - t o o l t i p >
2025-05-23 02:45:41 +00:00
< / div >
2025-05-30 17:21:02 +00:00
< / div >
2025-06-13 04:06:12 +00:00
< / main >
< / n - i n f i n i t e - s c r o l l >
2025-05-23 00:50:08 +00:00
< / div >
< / template >
2025-05-23 02:45:41 +00:00
2025-05-23 00:50:08 +00:00
< script setup >
2025-05-30 11:19:12 +00:00
import customDefaultPage from "@/components/customDefaultPage/index.vue" ;
2025-06-16 05:27:27 +00:00
import { reactive , onMounted , watch , nextTick , ref } from "vue" ;
import { NSelect , NInput , NButton , NInfiniteScroll , NTooltip } from "naive-ui" ;
2025-05-30 11:19:12 +00:00
import { useI18n } from "vue-i18n" ;
2025-06-13 04:06:12 +00:00
import axios from 'axios'
2025-05-23 02:45:41 +00:00
2025-06-13 04:06:12 +00:00
import { useRouter } from "vue-router" ;
2025-05-30 11:19:12 +00:00
const router = useRouter ( ) ;
const { t } = useI18n ( ) ;
2025-05-23 02:45:41 +00:00
const state = reactive ( {
2025-05-30 11:19:12 +00:00
selectedValue : "all_years" , //选中值
2025-05-23 02:45:41 +00:00
selectOptions : [
{
2025-05-30 11:19:12 +00:00
label : "All Years" ,
value : "all_years" ,
2025-05-23 02:45:41 +00:00
} ,
2025-05-23 03:52:04 +00:00
... Array . from ( { length : 2025 - 1990 + 1 } , ( _ , i ) => {
2025-05-30 11:19:12 +00:00
const year = 2025 - i ;
return { label : String ( year ) , value : String ( year ) } ;
2025-05-23 03:52:04 +00:00
} ) ,
2025-05-23 02:45:41 +00:00
] , //下拉选项
2025-05-30 11:19:12 +00:00
inputValue : "" , //输入值
newsData : [
2025-06-06 09:59:21 +00:00
{
date : "June 3, 2025" ,
title : "FiEE, Inc. seized market opportunities through 2025 Osaka Expo" ,
content :
"Hong Kong, 3 June 2025 — FiEE, Inc. (NASDAQ:MINM) (“FiEE, Inc.” or the “Company”), a technology company integrating IoT, connectivity and AI to redefine brand management solutions in the digital era, is pleased to announce significant business updates...." ,
} ,
2025-06-03 02:37:55 +00:00
{
2025-06-03 03:11:20 +00:00
date : "June 2, 2025" ,
2025-06-03 02:37:55 +00:00
title : "FiEE, Inc. Closes Its First Day of Trading on NASDAQ" ,
content :
"Hong Kong, 2 June 2025 — FiEE, Inc. (NASDAQ:MINM) (“FiEE, Inc.” or the “Company”), a technology company integrating IoT, connectivity and AI to redefine brand management solutions in the digital era, commenced..." ,
} ,
2025-06-03 02:59:19 +00:00
{
date : "May 30, 2025" ,
title : "FiEE, Inc. Announces Reinitiation of Trading on Nasdaq" ,
content :
"Hong Kong, May 30, 2025 — FiEE, Inc. (“FiEE, Inc.” or the “Company”), a technology company integrating IoT, connectivity and AI to redefine brand management solutions..." ,
} ,
2025-05-30 11:19:12 +00:00
] ,
filterNewsData : [ ] ,
2025-06-13 04:06:12 +00:00
loading : false , //是否正在加载数据
hasMore : true , //是否还有更多数据
currentPage : 1 , //当前页码
2025-05-30 11:19:12 +00:00
} ) ;
2025-06-16 05:27:27 +00:00
const titleRefs = ref ( [ ] )
const setTitleRef = ( el , idx ) => {
if ( el ) titleRefs . value [ idx ] = el
}
const checkAllTitleOverflow = ( ) => {
state . filterNewsData . forEach ( ( item , idx ) => {
const el = titleRefs . value [ idx ]
if ( ! el ) {
item . showTooltip = false
return
}
item . showTooltip = el . scrollHeight > el . clientHeight || el . scrollWidth > el . clientWidth
} )
}
2025-05-30 11:19:12 +00:00
onMounted ( ( ) => {
2025-06-13 04:06:12 +00:00
// state.filterNewsData = state.newsData;
getPressReleasesDisplay ( )
2025-06-16 05:27:27 +00:00
nextTick ( ( ) => {
checkAllTitleOverflow ( )
} )
} )
watch ( ( ) => state . filterNewsData , ( ) => {
nextTick ( ( ) => {
checkAllTitleOverflow ( )
} )
} , { deep : true } )
2025-05-30 11:19:12 +00:00
2025-06-13 04:06:12 +00:00
// 获取新闻列表
const getPressReleasesDisplay = ( ) => {
let url = 'http://172.16.100.93:9020/api/fiee/pressreleases/display'
let params = {
query : state . inputValue ,
page : state . currentPage ,
pageSize : 10 ,
timeStart : state . selectedValue
? state . selectedValue === 'all_years'
? null
: new Date ( state . selectedValue ) . getTime ( )
: null ,
}
// console.log(params)
axios . post ( url , params ) . then ( ( res ) => {
// console.log(res)
if ( res . status === 200 ) {
if ( res . data . status === 0 ) {
res . data . data ? . data ? . forEach ( ( item ) => {
item . date = new Date ( item . createdAt ) . toLocaleDateString ( 'en-US' , {
month : 'short' ,
day : 'numeric' ,
year : 'numeric' ,
} )
} )
if ( state . currentPage === 1 ) {
state . filterNewsData = res . data . data ? . data || [ ]
} else {
state . filterNewsData = [
... state . filterNewsData ,
... ( res . data . data ? . data || [ ] ) ,
]
}
if ( state . filterNewsData . length < ( res . data . data ? . total || 0 ) ) {
state . hasMore = true
} else {
state . hasMore = false
}
}
}
} )
}
2025-05-30 11:19:12 +00:00
const handleFilter = ( ) => {
// 筛选逻辑
let filteredData = [ ... state . newsData ] ;
// 按年份筛选
if ( state . selectedValue !== "all_years" ) {
filteredData = filteredData . filter ( ( item ) => {
// 从日期字符串中提取年份,假设日期格式为 "May 30, 2025"
const dateMatch = item . date . match ( /\b\d{4}\b/ ) ;
if ( dateMatch ) {
const year = dateMatch [ 0 ] ;
return year === state . selectedValue ;
}
return false ;
} ) ;
}
// 按输入内容进行模糊查询( title 和 content)
if ( state . inputValue && state . inputValue . trim ( ) !== "" ) {
const searchText = state . inputValue . toLowerCase ( ) . trim ( ) ;
filteredData = filteredData . filter ( ( item ) => {
const titleMatch = item . title . toLowerCase ( ) . includes ( searchText ) ;
const contentMatch = item . content . toLowerCase ( ) . includes ( searchText ) ;
return titleMatch || contentMatch ;
} ) ;
}
state . filterNewsData = filteredData ;
} ;
// 添加 watcher 来实现自动筛选
watch (
( ) => [ state . selectedValue , state . inputValue ] ,
( ) => {
2025-06-13 04:06:12 +00:00
// handleFilter();
state . currentPage = 1
getPressReleasesDisplay ( )
}
2025-05-30 11:19:12 +00:00
) ;
2025-05-23 02:45:41 +00:00
const handleSearch = ( ) => {
2025-05-30 11:19:12 +00:00
// 手动触发筛选(保留这个函数以保持兼容性)
2025-06-13 04:06:12 +00:00
// handleFilter();
state . currentPage = 1
getPressReleasesDisplay ( )
2025-05-30 17:39:45 +00:00
// console.log("筛选结果:", state.filterNewsData);
2025-05-30 11:19:12 +00:00
} ;
const handleNewClick = ( item ) => {
router . push ( {
path : "/news" ,
query : {
2025-06-13 04:06:12 +00:00
id : item . id ,
2025-05-30 11:19:12 +00:00
} ,
} ) ;
} ;
2025-06-13 04:06:12 +00:00
//加载更多数据
const doLoadMore = ( ) => {
if ( ! state . hasMore || state . loading ) {
return
}
// console.log('触底了')
state . loading = true
state . currentPage ++
getPressReleasesDisplay ( ) . finally ( ( ) => {
state . loading = false
} )
}
2025-05-23 00:50:08 +00:00
< / script >
2025-05-23 02:45:41 +00:00
< style scoped lang = "scss" >
. title {
font - size : 113 px ;
font - weight : bold ;
color : # 333 ;
text - align : center ;
margin - top : 8 px ;
}
. search - container {
margin - bottom : 24 px ;
display : flex ;
flex - direction : row ;
align - items : center ;
background - color : # f6f7f9 ;
border - radius : 8 px ;
padding : 8 px ;
gap : 16 px ;
}
. search - select {
width : 1000 px ;
: deep ( . n - base - selection ) {
padding : 4 px 0 ;
}
}
. search - input {
width : 100 % ;
}
: deep ( . n - input ) {
. n - input _ _input {
padding : 4 px 0 ;
border - radius : 4 px ;
}
}
: deep ( . n - select ) {
. n - select _ _input {
padding : 8 px 12 px ;
border : 1 px solid # ccc ;
border - radius : 4 px ;
}
}
: deep ( . n - button ) {
width : 260 px ;
padding : 20 px 16 px ;
border - radius : 4 px ;
}
2025-05-30 11:19:12 +00:00
. news - item {
padding : 16 px ;
border - bottom : 1 px solid # eee ;
margin - bottom : 16 px ;
}
. news - item - date {
font - size : 72 px ;
color : # 666 ;
margin - bottom : 8 px ;
}
. news - item - title {
font - size : 92 px ;
font - weight : bold ;
margin - bottom : 8 px ;
line - height : 1.4 ;
}
. news - item - content {
font - size : 72 px ;
color : # 333 ;
line - height : 1.6 ;
}
2025-05-23 02:45:41 +00:00
< / style >