fix quarterlyreports add api
This commit is contained in:
parent
ee596a518f
commit
faac577341
@ -26,7 +26,7 @@
|
||||
<!-- 报告列表 -->
|
||||
<div class="reports-table">
|
||||
<div class="reports-list">
|
||||
<div v-for="(item, index) in pagedList" :key="index" class="table-row">
|
||||
<div v-for="(item, index) in state.list" :key="index" class="table-row">
|
||||
<div class="content">
|
||||
<div class="file-content">
|
||||
<div class="file-info">
|
||||
@ -36,7 +36,10 @@
|
||||
<p class="file-description">{{ item.description }}</p>
|
||||
</div>
|
||||
<div class="download-section">
|
||||
<p class="download-text" @click="downloadPdf(item.url)">
|
||||
<p
|
||||
class="download-text"
|
||||
@click="downloadPdf(item.url, item.attachmentName)"
|
||||
>
|
||||
PDF Download
|
||||
</p>
|
||||
</div>
|
||||
@ -141,9 +144,9 @@
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onUnmounted, computed, reactive } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
|
||||
// import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
// import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
import axios from "axios";
|
||||
const { t } = useI18n();
|
||||
const searchQuery = ref("");
|
||||
|
||||
@ -152,45 +155,77 @@ const state = reactive({
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
gotoPage: 1,
|
||||
listConfig: {
|
||||
url: "http://114.218.158.24:9020/api/fiee/reports/quarterly/display",
|
||||
// url: "https://erpapi.fiee.com/api/fiee/reports/quarterly/display",
|
||||
params: {
|
||||
filtrate: {
|
||||
fileName: "", //文件名称
|
||||
},
|
||||
},
|
||||
},
|
||||
list: [
|
||||
{
|
||||
title: "2025 Q2 Quarterly Report",
|
||||
description: "Second Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q2,
|
||||
},
|
||||
{
|
||||
title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
description: "First Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q3N,
|
||||
},
|
||||
// {
|
||||
// title: "2025 Q2 Quarterly Report",
|
||||
// description: "Second Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q2,
|
||||
// },
|
||||
// {
|
||||
// title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
// description: "First Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q3N,
|
||||
// },
|
||||
],
|
||||
});
|
||||
|
||||
watch(searchQuery, (newVal) => {
|
||||
if (newVal === "" || newVal === null) {
|
||||
state.listConfig.params.filtrate.fileName = newVal;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
}
|
||||
});
|
||||
const showPageSizeMenu = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener("click", handleClickOutside);
|
||||
getListData();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener("click", handleClickOutside);
|
||||
});
|
||||
const filteredList = computed(() => {
|
||||
if (!searchQuery.value) return state.list;
|
||||
const query = searchQuery.value.toLowerCase();
|
||||
return state.list.filter(
|
||||
(item) =>
|
||||
item.title.toLowerCase().includes(query) ||
|
||||
item.description.toLowerCase().includes(query)
|
||||
);
|
||||
});
|
||||
const getListData = async () => {
|
||||
console.log(state.listConfig);
|
||||
const res = await axios.post(state.listConfig.url, state.listConfig.params);
|
||||
console.log(res);
|
||||
if (res.data.code === 0) {
|
||||
let resData = res.data.data.Item || [];
|
||||
resData.forEach((item) => {
|
||||
item.title = item.fileName;
|
||||
item.description = item.fileIntroduce;
|
||||
item.url = item.attachment;
|
||||
item.attachmentName = item.attachmentName;
|
||||
});
|
||||
state.list = resData;
|
||||
state.total = res.data.data.total || 0;
|
||||
}
|
||||
};
|
||||
// const filteredList = computed(() => {
|
||||
// if (!searchQuery.value) return state.list;
|
||||
// const query = searchQuery.value.toLowerCase();
|
||||
// return state.list.filter(
|
||||
// (item) =>
|
||||
// item.title.toLowerCase().includes(query) ||
|
||||
// item.description.toLowerCase().includes(query)
|
||||
// );
|
||||
// });
|
||||
|
||||
// 分页后的列表
|
||||
const pagedList = computed(() => {
|
||||
const start = (state.currentPage - 1) * state.pageSize;
|
||||
const end = start + state.pageSize;
|
||||
return filteredList.value.slice(start, end);
|
||||
});
|
||||
// const pagedList = computed(() => {
|
||||
// const start = (state.currentPage - 1) * state.pageSize;
|
||||
// const end = start + state.pageSize;
|
||||
// return filteredList.value.slice(start, end);
|
||||
// });
|
||||
|
||||
// 总页数
|
||||
const totalPages = computed(() => {
|
||||
@ -207,13 +242,19 @@ const displayRange = computed(() => {
|
||||
|
||||
const handleSearch = () => {
|
||||
// 搜索处理逻辑
|
||||
// console.log("搜索:", searchQuery.value);
|
||||
state.listConfig.params.filtrate.fileName = searchQuery.value;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
};
|
||||
|
||||
const downloadPdf = async (pdfResource, filename = "") => {
|
||||
try {
|
||||
const isDev = import.meta.env.DEV;
|
||||
const requestUrl = isDev
|
||||
? "/pdf-proxy/" + pdfResource.split("//")[1].split("/").slice(1).join("/")
|
||||
: pdfResource;
|
||||
// 获取PDF文件
|
||||
const response = await fetch(pdfResource);
|
||||
const response = await fetch(requestUrl);
|
||||
const blob = await response.blob();
|
||||
|
||||
// 创建Blob URL
|
||||
@ -232,7 +273,7 @@ const downloadPdf = async (pdfResource, filename = "") => {
|
||||
// 释放Blob URL
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
} catch (error) {
|
||||
// console.error("下载PDF文件失败:", error);
|
||||
console.error("下载PDF文件失败:", error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -322,14 +363,14 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => filteredList.value,
|
||||
(newList) => {
|
||||
state.total = newList.length;
|
||||
state.currentPage = 1;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
// watch(
|
||||
// () => filteredList.value,
|
||||
// (newList) => {
|
||||
// state.total = newList.length;
|
||||
// state.currentPage = 1;
|
||||
// },
|
||||
// { immediate: true }
|
||||
// );
|
||||
|
||||
// 点击外部关闭页面大小选择菜单
|
||||
const handleClickOutside = (event) => {
|
||||
|
@ -26,7 +26,7 @@
|
||||
<!-- 报告列表 -->
|
||||
<div class="reports-table">
|
||||
<div class="reports-list">
|
||||
<div v-for="(item, index) in pagedList" :key="index" class="table-row">
|
||||
<div v-for="(item, index) in state.list" :key="index" class="table-row">
|
||||
<div class="content">
|
||||
<div class="file-content">
|
||||
<div class="file-info">
|
||||
@ -36,7 +36,10 @@
|
||||
<p class="file-description">{{ item.description }}</p>
|
||||
</div>
|
||||
<div class="download-section">
|
||||
<p class="download-text" @click="downloadPdf(item.url)">
|
||||
<p
|
||||
class="download-text"
|
||||
@click="downloadPdf(item.url, item.attachmentName)"
|
||||
>
|
||||
PDF Download
|
||||
</p>
|
||||
</div>
|
||||
@ -141,9 +144,9 @@
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onUnmounted, computed, reactive } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
|
||||
// import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
// import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
import axios from "axios";
|
||||
const { t } = useI18n();
|
||||
const searchQuery = ref("");
|
||||
|
||||
@ -152,45 +155,77 @@ const state = reactive({
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
gotoPage: 1,
|
||||
listConfig: {
|
||||
url: "http://114.218.158.24:9020/api/fiee/reports/quarterly/display",
|
||||
// url: "https://erpapi.fiee.com/api/fiee/reports/quarterly/display",
|
||||
params: {
|
||||
filtrate: {
|
||||
fileName: "", //文件名称
|
||||
},
|
||||
},
|
||||
},
|
||||
list: [
|
||||
{
|
||||
title: "2025 Q2 Quarterly Report",
|
||||
description: "Second Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q2,
|
||||
},
|
||||
{
|
||||
title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
description: "First Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q3N,
|
||||
},
|
||||
// {
|
||||
// title: "2025 Q2 Quarterly Report",
|
||||
// description: "Second Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q2,
|
||||
// },
|
||||
// {
|
||||
// title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
// description: "First Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q3N,
|
||||
// },
|
||||
],
|
||||
});
|
||||
|
||||
watch(searchQuery, (newVal) => {
|
||||
if (newVal === "" || newVal === null) {
|
||||
state.listConfig.params.filtrate.fileName = newVal;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
}
|
||||
});
|
||||
const showPageSizeMenu = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener("click", handleClickOutside);
|
||||
getListData();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener("click", handleClickOutside);
|
||||
});
|
||||
const filteredList = computed(() => {
|
||||
if (!searchQuery.value) return state.list;
|
||||
const query = searchQuery.value.toLowerCase();
|
||||
return state.list.filter(
|
||||
(item) =>
|
||||
item.title.toLowerCase().includes(query) ||
|
||||
item.description.toLowerCase().includes(query)
|
||||
);
|
||||
});
|
||||
const getListData = async () => {
|
||||
console.log(state.listConfig);
|
||||
const res = await axios.post(state.listConfig.url, state.listConfig.params);
|
||||
console.log(res);
|
||||
if (res.data.code === 0) {
|
||||
let resData = res.data.data.Item || [];
|
||||
resData.forEach((item) => {
|
||||
item.title = item.fileName;
|
||||
item.description = item.fileIntroduce;
|
||||
item.url = item.attachment;
|
||||
item.attachmentName = item.attachmentName;
|
||||
});
|
||||
state.list = resData;
|
||||
state.total = res.data.data.total || 0;
|
||||
}
|
||||
};
|
||||
// const filteredList = computed(() => {
|
||||
// if (!searchQuery.value) return state.list;
|
||||
// const query = searchQuery.value.toLowerCase();
|
||||
// return state.list.filter(
|
||||
// (item) =>
|
||||
// item.title.toLowerCase().includes(query) ||
|
||||
// item.description.toLowerCase().includes(query)
|
||||
// );
|
||||
// });
|
||||
|
||||
// 分页后的列表
|
||||
const pagedList = computed(() => {
|
||||
const start = (state.currentPage - 1) * state.pageSize;
|
||||
const end = start + state.pageSize;
|
||||
return filteredList.value.slice(start, end);
|
||||
});
|
||||
// const pagedList = computed(() => {
|
||||
// const start = (state.currentPage - 1) * state.pageSize;
|
||||
// const end = start + state.pageSize;
|
||||
// return filteredList.value.slice(start, end);
|
||||
// });
|
||||
|
||||
// 总页数
|
||||
const totalPages = computed(() => {
|
||||
@ -207,13 +242,19 @@ const displayRange = computed(() => {
|
||||
|
||||
const handleSearch = () => {
|
||||
// 搜索处理逻辑
|
||||
// console.log("搜索:", searchQuery.value);
|
||||
state.listConfig.params.filtrate.fileName = searchQuery.value;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
};
|
||||
|
||||
const downloadPdf = async (pdfResource, filename = "") => {
|
||||
try {
|
||||
const isDev = import.meta.env.DEV;
|
||||
const requestUrl = isDev
|
||||
? "/pdf-proxy/" + pdfResource.split("//")[1].split("/").slice(1).join("/")
|
||||
: pdfResource;
|
||||
// 获取PDF文件
|
||||
const response = await fetch(pdfResource);
|
||||
const response = await fetch(requestUrl);
|
||||
const blob = await response.blob();
|
||||
|
||||
// 创建Blob URL
|
||||
@ -232,7 +273,7 @@ const downloadPdf = async (pdfResource, filename = "") => {
|
||||
// 释放Blob URL
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
} catch (error) {
|
||||
// console.error("下载PDF文件失败:", error);
|
||||
console.error("下载PDF文件失败:", error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -322,14 +363,14 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => filteredList.value,
|
||||
(newList) => {
|
||||
state.total = newList.length;
|
||||
state.currentPage = 1;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
// watch(
|
||||
// () => filteredList.value,
|
||||
// (newList) => {
|
||||
// state.total = newList.length;
|
||||
// state.currentPage = 1;
|
||||
// },
|
||||
// { immediate: true }
|
||||
// );
|
||||
|
||||
// 点击外部关闭页面大小选择菜单
|
||||
const handleClickOutside = (event) => {
|
||||
|
@ -27,7 +27,7 @@
|
||||
<!-- 报告列表 -->
|
||||
<div class="reports-table">
|
||||
<div class="reports-list">
|
||||
<div v-for="(item, index) in pagedList" :key="index" class="table-row">
|
||||
<div v-for="(item, index) in state.list" :key="index" class="table-row">
|
||||
<div class="content">
|
||||
<div class="file-content">
|
||||
<div class="file-info">
|
||||
@ -35,7 +35,10 @@
|
||||
<p class="file-title">{{ item.title }}</p>
|
||||
</div>
|
||||
<p class="file-description">{{ item.description }}</p>
|
||||
<p class="download-text" @click="downloadPdf(item.url)">
|
||||
<p
|
||||
class="download-text"
|
||||
@click="downloadPdf(item.url, item.attachmentName)"
|
||||
>
|
||||
PDF Download
|
||||
</p>
|
||||
</div>
|
||||
@ -127,9 +130,9 @@
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onUnmounted, computed, reactive } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
|
||||
// import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
// import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
import axios from "axios";
|
||||
const { t } = useI18n();
|
||||
const searchQuery = ref("");
|
||||
|
||||
@ -138,45 +141,77 @@ const state = reactive({
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
gotoPage: 1,
|
||||
listConfig: {
|
||||
url: "http://114.218.158.24:9020/api/fiee/reports/quarterly/display",
|
||||
// url: "https://erpapi.fiee.com/api/fiee/reports/quarterly/display",
|
||||
params: {
|
||||
filtrate: {
|
||||
fileName: "", //文件名称
|
||||
},
|
||||
},
|
||||
},
|
||||
list: [
|
||||
{
|
||||
title: "2025 Q2 Quarterly Report",
|
||||
description: "Second Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q2,
|
||||
},
|
||||
{
|
||||
title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
description: "First Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q3N,
|
||||
},
|
||||
// {
|
||||
// title: "2025 Q2 Quarterly Report",
|
||||
// description: "Second Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q2,
|
||||
// },
|
||||
// {
|
||||
// title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
// description: "First Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q3N,
|
||||
// },
|
||||
],
|
||||
});
|
||||
|
||||
watch(searchQuery, (newVal) => {
|
||||
if (newVal === "" || newVal === null) {
|
||||
state.listConfig.params.filtrate.fileName = newVal;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
}
|
||||
});
|
||||
const showPageSizeMenu = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener("click", handleClickOutside);
|
||||
getListData();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener("click", handleClickOutside);
|
||||
});
|
||||
const filteredList = computed(() => {
|
||||
if (!searchQuery.value) return state.list;
|
||||
const query = searchQuery.value.toLowerCase();
|
||||
return state.list.filter(
|
||||
(item) =>
|
||||
item.title.toLowerCase().includes(query) ||
|
||||
item.description.toLowerCase().includes(query)
|
||||
);
|
||||
});
|
||||
const getListData = async () => {
|
||||
console.log(state.listConfig);
|
||||
const res = await axios.post(state.listConfig.url, state.listConfig.params);
|
||||
console.log(res);
|
||||
if (res.data.code === 0) {
|
||||
let resData = res.data.data.Item || [];
|
||||
resData.forEach((item) => {
|
||||
item.title = item.fileName;
|
||||
item.description = item.fileIntroduce;
|
||||
item.url = item.attachment;
|
||||
item.attachmentName = item.attachmentName;
|
||||
});
|
||||
state.list = resData;
|
||||
state.total = res.data.data.total || 0;
|
||||
}
|
||||
};
|
||||
// const filteredList = computed(() => {
|
||||
// if (!searchQuery.value) return state.list;
|
||||
// const query = searchQuery.value.toLowerCase();
|
||||
// return state.list.filter(
|
||||
// (item) =>
|
||||
// item.title.toLowerCase().includes(query) ||
|
||||
// item.description.toLowerCase().includes(query)
|
||||
// );
|
||||
// });
|
||||
|
||||
// 分页后的列表
|
||||
const pagedList = computed(() => {
|
||||
const start = (state.currentPage - 1) * state.pageSize;
|
||||
const end = start + state.pageSize;
|
||||
return filteredList.value.slice(start, end);
|
||||
});
|
||||
// const pagedList = computed(() => {
|
||||
// const start = (state.currentPage - 1) * state.pageSize;
|
||||
// const end = start + state.pageSize;
|
||||
// return filteredList.value.slice(start, end);
|
||||
// });
|
||||
|
||||
// 总页数
|
||||
const totalPages = computed(() => {
|
||||
@ -193,13 +228,19 @@ const displayRange = computed(() => {
|
||||
|
||||
const handleSearch = () => {
|
||||
// 搜索处理逻辑
|
||||
// console.log("搜索:", searchQuery.value);
|
||||
state.listConfig.params.filtrate.fileName = searchQuery.value;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
};
|
||||
|
||||
const downloadPdf = async (pdfResource, filename = "") => {
|
||||
try {
|
||||
const isDev = import.meta.env.DEV;
|
||||
const requestUrl = isDev
|
||||
? "/pdf-proxy/" + pdfResource.split("//")[1].split("/").slice(1).join("/")
|
||||
: pdfResource;
|
||||
// 获取PDF文件
|
||||
const response = await fetch(pdfResource);
|
||||
const response = await fetch(requestUrl);
|
||||
const blob = await response.blob();
|
||||
|
||||
// 创建Blob URL
|
||||
@ -218,7 +259,7 @@ const downloadPdf = async (pdfResource, filename = "") => {
|
||||
// 释放Blob URL
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
} catch (error) {
|
||||
// console.error("下载PDF文件失败:", error);
|
||||
console.error("下载PDF文件失败:", error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -308,14 +349,14 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => filteredList.value,
|
||||
(newList) => {
|
||||
state.total = newList.length;
|
||||
state.currentPage = 1;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
// watch(
|
||||
// () => filteredList.value,
|
||||
// (newList) => {
|
||||
// state.total = newList.length;
|
||||
// state.currentPage = 1;
|
||||
// },
|
||||
// { immediate: true }
|
||||
// );
|
||||
|
||||
// 点击外部关闭页面大小选择菜单
|
||||
const handleClickOutside = (event) => {
|
||||
|
@ -26,7 +26,7 @@
|
||||
<!-- 报告列表 -->
|
||||
<div class="reports-table">
|
||||
<div class="reports-list">
|
||||
<div v-for="(item, index) in pagedList" :key="index" class="table-row">
|
||||
<div v-for="(item, index) in state.list" :key="index" class="table-row">
|
||||
<div class="content">
|
||||
<div class="file-content">
|
||||
<div class="file-info">
|
||||
@ -36,7 +36,10 @@
|
||||
<p class="file-description">{{ item.description }}</p>
|
||||
</div>
|
||||
<div class="download-section">
|
||||
<p class="download-text" @click="downloadPdf(item.url)">
|
||||
<p
|
||||
class="download-text"
|
||||
@click="downloadPdf(item.url, item.attachmentName)"
|
||||
>
|
||||
PDF Download
|
||||
</p>
|
||||
</div>
|
||||
@ -139,9 +142,9 @@
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onUnmounted, computed, reactive } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
|
||||
// import quarterlyPdf2025Q2 from "@/assets/file/quarterly/10Q 2025-Q2.pdf";
|
||||
// import quarterlyPdf2025Q3N from "@/assets/file/quarterly/10Q 2025-Q1-No1.pdf";
|
||||
import axios from "axios";
|
||||
const { t } = useI18n();
|
||||
const searchQuery = ref("");
|
||||
|
||||
@ -150,45 +153,77 @@ const state = reactive({
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
gotoPage: 1,
|
||||
listConfig: {
|
||||
url: "http://114.218.158.24:9020/api/fiee/reports/quarterly/display",
|
||||
// url: "https://erpapi.fiee.com/api/fiee/reports/quarterly/display",
|
||||
params: {
|
||||
filtrate: {
|
||||
fileName: "", //文件名称
|
||||
},
|
||||
},
|
||||
},
|
||||
list: [
|
||||
{
|
||||
title: "2025 Q2 Quarterly Report",
|
||||
description: "Second Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q2,
|
||||
},
|
||||
{
|
||||
title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
description: "First Quarter 2025 Financial Results",
|
||||
url: quarterlyPdf2025Q3N,
|
||||
},
|
||||
// {
|
||||
// title: "2025 Q2 Quarterly Report",
|
||||
// description: "Second Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q2,
|
||||
// },
|
||||
// {
|
||||
// title: "2025 Q1 Quarterly Report Amendment No.1",
|
||||
// description: "First Quarter 2025 Financial Results",
|
||||
// url: quarterlyPdf2025Q3N,
|
||||
// },
|
||||
],
|
||||
});
|
||||
|
||||
watch(searchQuery, (newVal) => {
|
||||
if (newVal === "" || newVal === null) {
|
||||
state.listConfig.params.filtrate.fileName = newVal;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
}
|
||||
});
|
||||
const showPageSizeMenu = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener("click", handleClickOutside);
|
||||
getListData();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener("click", handleClickOutside);
|
||||
});
|
||||
const filteredList = computed(() => {
|
||||
if (!searchQuery.value) return state.list;
|
||||
const query = searchQuery.value.toLowerCase();
|
||||
return state.list.filter(
|
||||
(item) =>
|
||||
item.title.toLowerCase().includes(query) ||
|
||||
item.description.toLowerCase().includes(query)
|
||||
);
|
||||
});
|
||||
const getListData = async () => {
|
||||
console.log(state.listConfig);
|
||||
const res = await axios.post(state.listConfig.url, state.listConfig.params);
|
||||
console.log(res);
|
||||
if (res.data.code === 0) {
|
||||
let resData = res.data.data.Item || [];
|
||||
resData.forEach((item) => {
|
||||
item.title = item.fileName;
|
||||
item.description = item.fileIntroduce;
|
||||
item.url = item.attachment;
|
||||
item.attachmentName = item.attachmentName;
|
||||
});
|
||||
state.list = resData;
|
||||
state.total = res.data.data.total || 0;
|
||||
}
|
||||
};
|
||||
// const filteredList = computed(() => {
|
||||
// if (!searchQuery.value) return state.list;
|
||||
// const query = searchQuery.value.toLowerCase();
|
||||
// return state.list.filter(
|
||||
// (item) =>
|
||||
// item.title.toLowerCase().includes(query) ||
|
||||
// item.description.toLowerCase().includes(query)
|
||||
// );
|
||||
// });
|
||||
|
||||
// 分页后的列表
|
||||
const pagedList = computed(() => {
|
||||
const start = (state.currentPage - 1) * state.pageSize;
|
||||
const end = start + state.pageSize;
|
||||
return filteredList.value.slice(start, end);
|
||||
});
|
||||
// const pagedList = computed(() => {
|
||||
// const start = (state.currentPage - 1) * state.pageSize;
|
||||
// const end = start + state.pageSize;
|
||||
// return filteredList.value.slice(start, end);
|
||||
// });
|
||||
|
||||
// 总页数
|
||||
const totalPages = computed(() => {
|
||||
@ -205,13 +240,19 @@ const displayRange = computed(() => {
|
||||
|
||||
const handleSearch = () => {
|
||||
// 搜索处理逻辑
|
||||
// console.log("搜索:", searchQuery.value);
|
||||
state.listConfig.params.filtrate.fileName = searchQuery.value;
|
||||
state.currentPage = 1;
|
||||
getListData();
|
||||
};
|
||||
|
||||
const downloadPdf = async (pdfResource, filename = "") => {
|
||||
try {
|
||||
const isDev = import.meta.env.DEV;
|
||||
const requestUrl = isDev
|
||||
? "/pdf-proxy/" + pdfResource.split("//")[1].split("/").slice(1).join("/")
|
||||
: pdfResource;
|
||||
// 获取PDF文件
|
||||
const response = await fetch(pdfResource);
|
||||
const response = await fetch(requestUrl);
|
||||
const blob = await response.blob();
|
||||
|
||||
// 创建Blob URL
|
||||
@ -230,7 +271,7 @@ const downloadPdf = async (pdfResource, filename = "") => {
|
||||
// 释放Blob URL
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
} catch (error) {
|
||||
// console.error("下载PDF文件失败:", error);
|
||||
console.error("下载PDF文件失败:", error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -320,14 +361,14 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => filteredList.value,
|
||||
(newList) => {
|
||||
state.total = newList.length;
|
||||
state.currentPage = 1;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
// watch(
|
||||
// () => filteredList.value,
|
||||
// (newList) => {
|
||||
// state.total = newList.length;
|
||||
// state.currentPage = 1;
|
||||
// },
|
||||
// { immediate: true }
|
||||
// );
|
||||
|
||||
// 点击外部关闭页面大小选择菜单
|
||||
const handleClickOutside = (event) => {
|
||||
|
@ -20,6 +20,11 @@ export default defineConfig({
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '/api')
|
||||
},
|
||||
'/pdf-proxy': {
|
||||
target: 'https://cdn-test.szjixun.cn',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/pdf-proxy/, '')
|
||||
},
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
|
Loading…
Reference in New Issue
Block a user