From 5c73fdea86438aa65c0a22d98ee593a2c576d257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Wed, 9 Jul 2025 14:24:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(property-marketing):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=8A=95=E6=94=BE=E6=8C=87=E5=8D=97=E4=B8=8B=E8=BD=BD=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E9=87=8D=E6=9E=84PDF=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table-data/guideListHistory.vue | 34 ++-- .../components/table-data/listSearchForm.vue | 2 +- .../table-data/placementGuideList.vue | 3 +- .../investment-guidelines/index.vue | 147 +++++++++++++----- 4 files changed, 123 insertions(+), 63 deletions(-) diff --git a/src/views/property-marketing/put-account/investment-guidelines/components/table-data/guideListHistory.vue b/src/views/property-marketing/put-account/investment-guidelines/components/table-data/guideListHistory.vue index eac738f..cba3821 100644 --- a/src/views/property-marketing/put-account/investment-guidelines/components/table-data/guideListHistory.vue +++ b/src/views/property-marketing/put-account/investment-guidelines/components/table-data/guideListHistory.vue @@ -21,7 +21,7 @@ - 下载 + 下载 详情 @@ -82,32 +82,24 @@ const goDetail = async (id) => { router.push(`/put-account/detail/${id}`); }; -const downloadDetailAsImage = (id) => { - const url = `/put-account/detail/${id}`; - const win = window.open(url, '_blank'); - - win.onload = () => { - setTimeout(() => { - html2canvas(win.document.body, { - useCORS: true, - scale: 2, - }).then((canvas) => { - const imgData = canvas.toDataURL('image/png'); - const link = document.createElement('a'); - link.href = imgData; - link.download = `详情页面_${Date.now()}.png`; - link.click(); - win.close(); // 关闭新窗口 - }); - }, 2000); // 等待页面加载 - }; +const downLoad = (fileUrl) => { + if (isEmpty(fileUrl)) { + Message.error('下载失败,文件不存在'); + return; + } + const link = document.createElement('a'); + link.href = fileUrl; + link.download = '投放指南.pdf'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); }; const deleteData = async (id) => { const { code, message } = await deleteHistorylog(id); if (code == 200) { Message.success(message); emits('onSearch'); - console.log('onsearch') + console.log('onsearch'); } }; diff --git a/src/views/property-marketing/put-account/investment-guidelines/components/table-data/listSearchForm.vue b/src/views/property-marketing/put-account/investment-guidelines/components/table-data/listSearchForm.vue index a28c68f..816b0cb 100644 --- a/src/views/property-marketing/put-account/investment-guidelines/components/table-data/listSearchForm.vue +++ b/src/views/property-marketing/put-account/investment-guidelines/components/table-data/listSearchForm.vue @@ -50,7 +50,7 @@
- + diff --git a/src/views/property-marketing/put-account/investment-guidelines/components/table-data/placementGuideList.vue b/src/views/property-marketing/put-account/investment-guidelines/components/table-data/placementGuideList.vue index 456372c..ebd2c5b 100644 --- a/src/views/property-marketing/put-account/investment-guidelines/components/table-data/placementGuideList.vue +++ b/src/views/property-marketing/put-account/investment-guidelines/components/table-data/placementGuideList.vue @@ -54,8 +54,7 @@ diff --git a/src/views/property-marketing/put-account/investment-guidelines/index.vue b/src/views/property-marketing/put-account/investment-guidelines/index.vue index 20298ce..a1f079a 100644 --- a/src/views/property-marketing/put-account/investment-guidelines/index.vue +++ b/src/views/property-marketing/put-account/investment-guidelines/index.vue @@ -5,7 +5,7 @@ @@ -16,6 +16,7 @@
- -
- + +
- +
-
-
+