fix quarterlyreports add api

This commit is contained in:
yuanshan 2025-10-15 14:30:38 +08:00
parent ee596a518f
commit faac577341
5 changed files with 333 additions and 164 deletions

View File

@ -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) => {

View File

@ -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) => {

View File

@ -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) => {

View File

@ -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) => {

View File

@ -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: [