fiee-official-website/src/views/financialinformation/secfilings/size768/index.vue

582 lines
13 KiB
Vue
Raw Normal View History

2025-05-26 02:37:58 +00:00
<template>
<div class="page-container">
2025-05-30 08:18:53 +00:00
<div class="sec-filings-container">
2025-05-26 02:37:58 +00:00
<!-- 标题 -->
2025-05-30 08:18:53 +00:00
<div class="page-title">SEC Filings</div>
2025-05-26 02:37:58 +00:00
2025-05-30 08:18:53 +00:00
<!-- 筛选器 -->
<div class="filters">
<div class="filter-group">
<label class="filter-label">Filing year</label>
<n-select
v-model:value="state.selectedYear"
:options="state.yearOptions"
placeholder="- Any -"
style="width: 150px"
clearable
@update:value="handleYearChange"
/>
2025-05-26 02:37:58 +00:00
</div>
2025-05-30 08:18:53 +00:00
<div class="filter-group">
<label class="filter-label">Items per page:</label>
<n-select
v-model:value="state.pageSize"
:options="state.pageSizeOptions"
style="width: 150px"
@update:value="handlePageSizeChange"
/>
2025-05-26 02:37:58 +00:00
</div>
2025-05-30 08:18:53 +00:00
</div>
2025-05-26 02:37:58 +00:00
2025-05-30 08:18:53 +00:00
<!-- 表格 -->
<div class="table-container">
<n-data-table
:columns="columns"
2025-06-17 07:08:22 +00:00
:loading="state.tableLoading"
:data="state.tableData"
2025-05-30 08:18:53 +00:00
:pagination="false"
:bordered="false"
:size="'medium'"
2025-05-30 09:17:02 +00:00
:row-key="(row) => row.idx"
2025-06-17 07:08:22 +00:00
@update:sorter="handleSort"
2025-05-30 08:18:53 +00:00
/>
<!-- 分页器 -->
<div class="pagination-container">
<n-pagination
class="w-full"
v-model:page="state.currentPage"
v-model:page-size="state.pageSize"
show-size-picker
show-quick-jumper
2025-06-17 07:08:22 +00:00
:item-count="state.total"
2025-05-30 08:18:53 +00:00
:page-sizes="[10, 25, 50]"
@update:page="handlePageChange"
@update:page-size="handlePageSizeChange"
>
<template #prev>
<span> Previous</span>
</template>
<template #next>
<span>Next </span>
</template>
</n-pagination>
2025-05-26 02:37:58 +00:00
2025-05-30 08:18:53 +00:00
<div class="pagination-info w-full mt-[20px]">
Displaying {{ startIndex }} - {{ endIndex }} of
2025-06-17 07:08:22 +00:00
{{ state.total }} results
2025-05-26 02:37:58 +00:00
</div>
</div>
2025-05-30 08:18:53 +00:00
</div>
2025-05-26 02:37:58 +00:00
</div>
</div>
</template>
2025-06-17 07:54:23 +00:00
2025-05-26 02:37:58 +00:00
<script setup>
2025-05-30 08:18:53 +00:00
import { reactive, computed, h, onMounted } from "vue";
import { NSelect, NDataTable, NPagination, NButton, NIcon } from "naive-ui";
2025-05-26 02:37:58 +00:00
import { useI18n } from "vue-i18n";
2025-05-30 08:18:53 +00:00
import { useRouter } from "vue-router";
2025-06-17 07:08:22 +00:00
2025-05-26 02:37:58 +00:00
const { t } = useI18n();
2025-05-30 08:18:53 +00:00
const router = useRouter();
2025-06-17 07:43:00 +00:00
import pdfFile from "@/assets/image/icon/icon-pdf.png";
import wordFile from "@/assets/image/icon/icon-word.png";
import excelFile from "@/assets/image/icon/icon-excel.png";
import fileLink from "@/assets/image/icon/icon-link.png";
2025-05-30 08:18:53 +00:00
// 使用 reactive 管理所有状态
const state = reactive({
selectedYear: null,
pageSize: 10,
currentPage: 1,
2025-06-17 07:08:22 +00:00
tableData: [],
tableLoading: false,
total: 0,
sortParams: {},
2025-05-30 08:18:53 +00:00
// 年份选项
yearOptions: [
{ label: "- Any -", value: null },
2025-06-17 07:08:22 +00:00
{
label: "2025",
value: "2025",
},
{
label: "2024",
value: "2024",
},
{
label: "2023",
value: "2023",
},
{
label: "2022",
value: "2022",
},
{
label: "2021",
value: "2021",
},
{
label: "2020",
value: "2020",
},
{
label: "2019",
value: "2019",
},
{
label: "2018",
value: "2018",
},
{
label: "2017",
value: "2017",
},
{
label: "2016",
value: "2016",
},
{
label: "2015",
value: "2015",
},
{
label: "2014",
value: "2014",
},
{
label: "2013",
value: "2013",
},
{
label: "2012",
value: "2012",
},
{
label: "2011",
value: "2011",
},
{
label: "2010",
value: "2010",
},
{
label: "2009",
value: "2009",
},
2025-05-30 08:18:53 +00:00
],
// 每页条数选项
pageSizeOptions: [
{ label: "10", value: 10 },
{ label: "25", value: 25 },
{ label: "50", value: 50 },
],
});
2025-06-17 07:08:22 +00:00
const monthNames = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
];
onMounted(() => {
getListData();
});
import axios from "axios";
const getListData = async () => {
state.tableData = [];
let url = "http://121.229.45.214:9031/api/fiee/sec-filing/web/list";
let params = {
page: state.currentPage,
pageSize: state.pageSize,
year: state.selectedYear,
};
Object.assign(params, state.sortParams);
state.tableLoading = true;
const res = await axios.post(url, params);
if (res.data.status === 0) {
let resData = res.data.data?.data || [];
resData.forEach((item) => {
if (item.filingDate) {
let year = null;
let filingDate = item.filingDate;
if (item.filingDate.includes(", ")) {
// "Feb 04, 2019" 格式,已经是英文格式,保持不变
year = parseInt(item.filingDate.split(", ")[1]);
} else if (item.filingDate.includes("-")) {
// "2025-10-24" 格式,转换为 "Oct 24, 2025" 英文格式
const dateParts = item.filingDate.split("-");
const yearPart = parseInt(dateParts[0]);
const monthPart = parseInt(dateParts[1]);
const dayPart = parseInt(dateParts[2]);
2025-05-30 08:18:53 +00:00
2025-06-17 07:08:22 +00:00
year = yearPart;
const monthName = monthNames[monthPart - 1]; // 月份从1开始数组从0开始
const dayFormatted = dayPart.toString().padStart(2, "0");
filingDate = `${monthName} ${dayFormatted}, ${yearPart}`;
item.year = year;
item.filingDate = filingDate;
item.filing_date = filingDate;
}
2025-05-30 08:18:53 +00:00
}
2025-06-17 07:08:22 +00:00
});
state.tableData = resData;
state.total = res.data.data?.total;
}
state.tableLoading = false;
};
const handleSort = (sortData) => {
state.sortParams = {};
if (sortData.order !== false) {
state.sortParams["sortField"] = sortData.columnKey;
2025-06-17 07:43:00 +00:00
state.sortParams["sortOrder"] = sortData.order.replace("end", "");
2025-06-17 07:08:22 +00:00
}
getListData();
};
2025-05-30 08:18:53 +00:00
// 表格列定义
const columns = [
2025-05-26 02:37:58 +00:00
{
2025-05-30 08:18:53 +00:00
title: "Filing Date",
2025-06-17 07:08:22 +00:00
key: "filing_date",
2025-05-30 08:18:53 +00:00
sorter: "default",
width: 150,
2025-05-26 02:37:58 +00:00
},
{
2025-05-30 08:18:53 +00:00
title: "Form",
key: "form",
width: 120,
render: (row) => {
return h(
"a",
{
href: "javascript:void(0)",
style: {
color: "#0078d7",
textDecoration: "none",
cursor: "pointer",
},
onClick: (e) => {
e.preventDefault();
router.push({
path: "/secfilingsDefail",
query: {
2025-06-17 07:08:22 +00:00
filingKey: row.filingKey,
2025-05-30 08:18:53 +00:00
},
});
},
onMouseover: (e) => {
e.target.style.textDecoration = "underline";
},
onMouseout: (e) => {
e.target.style.textDecoration = "none";
},
},
row.form
);
},
2025-05-26 02:37:58 +00:00
},
{
2025-05-30 08:18:53 +00:00
title: "Description",
key: "description",
ellipsis: {
tooltip: true,
},
2025-05-26 02:37:58 +00:00
},
{
2025-05-30 08:18:53 +00:00
title: "View",
2025-06-17 07:08:22 +00:00
key: "fileLink",
2025-06-17 07:43:00 +00:00
width: 150,
2025-05-30 08:18:53 +00:00
render: (row) => {
return h(
"div",
{
style: {
display: "flex",
gap: "8px",
},
},
[
2025-06-17 07:43:00 +00:00
row.pdfFile
? h(
"a",
{
2025-06-17 07:54:23 +00:00
href: "javascript:void(0)",
2025-06-17 07:43:00 +00:00
style: {
color: "#0078d7",
textDecoration: "none",
fontSize: "12px",
},
2025-06-17 07:54:23 +00:00
onClick: (e) => {
e.preventDefault();
handleViewDocument(row.pdfFile, "pdf");
},
2025-06-17 07:43:00 +00:00
onMouseover: (e) => {
e.target.style.textDecoration = "underline";
},
onMouseout: (e) => {
e.target.style.textDecoration = "none";
},
},
h("img", {
src: pdfFile,
alt: "link",
style: {
width: "24px",
height: "24px",
},
})
)
: null,
row.wordFile
? h(
"a",
{
2025-06-17 07:54:23 +00:00
href: "javascript:void(0)",
2025-06-17 07:43:00 +00:00
style: {
color: "#0078d7",
textDecoration: "none",
fontSize: "12px",
},
2025-06-17 07:54:23 +00:00
onClick: (e) => {
e.preventDefault();
handleViewDocument(row.wordFile, "word");
},
2025-06-17 07:43:00 +00:00
onMouseover: (e) => {
e.target.style.textDecoration = "underline";
},
onMouseout: (e) => {
e.target.style.textDecoration = "none";
},
},
h("img", {
src: wordFile,
alt: "link",
style: {
width: "24px",
height: "24px",
},
})
)
: null,
row.excelFile
? h(
"a",
{
2025-06-17 07:54:23 +00:00
href: "javascript:void(0)",
2025-06-17 07:43:00 +00:00
style: {
color: "#0078d7",
textDecoration: "none",
fontSize: "12px",
},
2025-06-17 07:54:23 +00:00
onClick: (e) => {
e.preventDefault();
handleViewDocument(row.excelFile, "excel");
},
2025-06-17 07:43:00 +00:00
onMouseover: (e) => {
e.target.style.textDecoration = "underline";
},
onMouseout: (e) => {
e.target.style.textDecoration = "none";
},
},
h("img", {
src: excelFile,
alt: "link",
style: {
width: "24px",
height: "24px",
},
})
)
: null,
row.fileLink
? h(
"a",
{
href: row.fileLink,
style: {
color: "#0078d7",
textDecoration: "none",
fontSize: "12px",
},
onMouseover: (e) => {
e.target.style.textDecoration = "underline";
},
onMouseout: (e) => {
e.target.style.textDecoration = "none";
},
},
h("img", {
src: fileLink,
alt: "link",
style: {
width: "24px",
height: "24px",
},
})
)
: null,
2025-05-30 08:18:53 +00:00
]
);
},
2025-05-26 02:37:58 +00:00
},
2025-05-30 08:18:53 +00:00
];
// 当前页起始索引
const startIndex = computed(() => {
return (state.currentPage - 1) * state.pageSize + 1;
});
// 当前页结束索引
const endIndex = computed(() => {
const end = state.currentPage * state.pageSize;
2025-06-17 07:08:22 +00:00
return Math.min(end, state.total);
2025-05-30 08:18:53 +00:00
});
// 处理年份变化
const handleYearChange = (value) => {
state.selectedYear = value;
state.currentPage = 1;
2025-06-17 07:08:22 +00:00
getListData();
2025-05-30 08:18:53 +00:00
};
// 处理页码变化
const handlePageChange = (page) => {
state.currentPage = page;
2025-06-17 07:08:22 +00:00
getListData();
2025-05-30 08:18:53 +00:00
};
// 处理每页条数变化
const handlePageSizeChange = (size) => {
state.pageSize = size;
state.currentPage = 1;
2025-06-17 07:08:22 +00:00
getListData();
2025-05-30 08:18:53 +00:00
};
2025-06-17 07:54:23 +00:00
// 查看文档
const handleViewDocument = (val, type) => {
window.open(
`${import.meta.env.VITE_PAGE_URL}/office?url=${val}&attachmentName=${type}`,
"_blank"
);
};
2025-05-26 02:37:58 +00:00
</script>
2025-06-17 07:43:00 +00:00
2025-05-26 02:37:58 +00:00
<style scoped lang="scss">
.page-container {
background-image: url("@/assets/image/bg.png");
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
2025-05-30 08:18:53 +00:00
min-height: 100vh;
padding: 20px;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
.sec-filings-container {
2025-05-26 02:37:58 +00:00
max-width: calc(100% - 300px);
margin: 0 auto;
padding: 20px;
}
2025-05-30 08:18:53 +00:00
.page-title {
2025-05-26 02:37:58 +00:00
font-size: 85px;
2025-05-30 08:18:53 +00:00
font-weight: bold;
2025-05-26 02:37:58 +00:00
color: #333;
2025-05-30 08:18:53 +00:00
margin-bottom: 40px;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
.filters {
display: flex;
gap: 40px;
2025-05-26 02:37:58 +00:00
margin-bottom: 30px;
2025-05-30 08:18:53 +00:00
align-items: end;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
.filter-group {
2025-05-26 02:37:58 +00:00
display: flex;
2025-05-30 08:18:53 +00:00
flex-direction: column;
gap: 8px;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
.filter-label {
font-size: 50px;
color: #333;
font-weight: 500;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
.table-container {
.n-data-table {
--n-th-color: #f5f5f5;
--n-th-text-color: #333;
--n-td-color: #fff;
--n-border-color: #e0e0e0;
}
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
.pagination-container {
2025-05-26 02:37:58 +00:00
display: flex;
2025-05-30 08:18:53 +00:00
flex-wrap: wrap; // 添加这行
2025-05-26 02:37:58 +00:00
justify-content: space-between;
align-items: center;
2025-05-30 08:18:53 +00:00
margin-top: 20px;
padding: 20px 0;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
.pagination-info {
font-size: 40px;
color: #666;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
:deep(.n-data-table-th) {
background-color: #9e9e9e !important;
color: white !important;
font-weight: bold;
text-align: left;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
:deep(.n-data-table-td) {
border-bottom: 1px solid #e0e0e0;
2025-05-26 02:37:58 +00:00
}
2025-05-30 08:18:53 +00:00
:deep(.n-data-table-tr:hover .n-data-table-td) {
background-color: #f9f9f9;
}
2025-05-26 02:37:58 +00:00
2025-05-30 08:18:53 +00:00
:deep(.n-select) {
.n-base-selection {
border: 1px solid #ccc;
border-radius: 4px;
2025-05-26 02:37:58 +00:00
}
}
2025-05-30 08:18:53 +00:00
:deep(.n-pagination) {
.n-pagination-item {
border: 1px solid #ccc;
2025-05-26 02:37:58 +00:00
2025-05-30 08:18:53 +00:00
&.n-pagination-item--active {
background-color: #969696;
border-color: #969696;
color: white;
}
}
.n-pagination-quick-jumper {
font-size: 40px;
}
2025-05-26 02:37:58 +00:00
2025-05-30 08:18:53 +00:00
.n-pagination-sizes {
font-size: 40px;
2025-05-26 02:37:58 +00:00
}
}
</style>