提交 27c0b9d0 authored 作者: 胡卉清's avatar 胡卉清

合并分支 'dev_hhq' 到 'master'

Dev hhq 查看合并请求 !64
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"json5": "^2.2.3", "json5": "^2.2.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"markdown-it": "^14.1.0", "markdown-it": "^14.1.0",
"pdfjs-dist": "^5.4.449",
"vue": "^3.4.0", "vue": "^3.4.0",
"vue-router": "^4.2.5" "vue-router": "^4.2.5"
}, },
...@@ -663,6 +664,244 @@ ...@@ -663,6 +664,244 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/@napi-rs/canvas": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas/-/canvas-0.1.86.tgz",
"integrity": "sha512-hOkywnrkdFdVpsuaNsZWfEY7kc96eROV2DuMTTvGF15AZfwobzdG2w0eDlU5UBx3Lg/XlWUnqVT5zLUWyo5h6A==",
"optional": true,
"workspaces": [
"e2e/*"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
},
"optionalDependencies": {
"@napi-rs/canvas-android-arm64": "0.1.86",
"@napi-rs/canvas-darwin-arm64": "0.1.86",
"@napi-rs/canvas-darwin-x64": "0.1.86",
"@napi-rs/canvas-linux-arm-gnueabihf": "0.1.86",
"@napi-rs/canvas-linux-arm64-gnu": "0.1.86",
"@napi-rs/canvas-linux-arm64-musl": "0.1.86",
"@napi-rs/canvas-linux-riscv64-gnu": "0.1.86",
"@napi-rs/canvas-linux-x64-gnu": "0.1.86",
"@napi-rs/canvas-linux-x64-musl": "0.1.86",
"@napi-rs/canvas-win32-arm64-msvc": "0.1.86",
"@napi-rs/canvas-win32-x64-msvc": "0.1.86"
}
},
"node_modules/@napi-rs/canvas-android-arm64": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-android-arm64/-/canvas-android-arm64-0.1.86.tgz",
"integrity": "sha512-IjkZFKUr6GzMzzrawJaN3v+yY3Fvpa71e0DcbePfxWelFKnESIir+XUcdAbim29JOd0JE0/hQJdfUCb5t/Fjrw==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-darwin-arm64": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-darwin-arm64/-/canvas-darwin-arm64-0.1.86.tgz",
"integrity": "sha512-PUCxDq0wSSJbtaOqoKj3+t5tyDbtxWumziOTykdn3T839hu6koMaBFpGk9lXpsGaPNgyFpPqjxhtsPljBGnDHg==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-darwin-x64": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-darwin-x64/-/canvas-darwin-x64-0.1.86.tgz",
"integrity": "sha512-rlCFLv4Rrg45qFZq7mysrKnsUbMhwdNg3YPuVfo9u4RkOqm7ooAJvdyDFxiqfSsJJTqupYqa9VQCUt8WKxKhNQ==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-linux-arm-gnueabihf": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-linux-arm-gnueabihf/-/canvas-linux-arm-gnueabihf-0.1.86.tgz",
"integrity": "sha512-6xWwyMc9BlDBt+9XHN/GzUo3MozHta/2fxQHMb80x0K2zpZuAdDKUYHmYzx9dFWDY3SbPYnx6iRlQl6wxnwS1w==",
"cpu": [
"arm"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-linux-arm64-gnu": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-linux-arm64-gnu/-/canvas-linux-arm64-gnu-0.1.86.tgz",
"integrity": "sha512-r2OX3w50xHxrToTovOSQWwkVfSq752CUzH9dzlVXyr8UDKFV8dMjfa9hePXvAJhN3NBp4TkHcGx15QCdaCIwnA==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-linux-arm64-musl": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-linux-arm64-musl/-/canvas-linux-arm64-musl-0.1.86.tgz",
"integrity": "sha512-jbXuh8zVFUPw6a9SGpgc6EC+fRbGGyP1NFfeQiVqGLs6bN93ROtPLPL6MH9Bp6yt0CXUFallk2vgKdWDbmW+bw==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-linux-riscv64-gnu": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-linux-riscv64-gnu/-/canvas-linux-riscv64-gnu-0.1.86.tgz",
"integrity": "sha512-9IwHR2qbq2HceM9fgwyL7x37Jy3ptt1uxvikQEuWR0FisIx9QEdt7F3huljCky76aoouF2vSd0R2fHo3ESRoPw==",
"cpu": [
"riscv64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-linux-x64-gnu": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-linux-x64-gnu/-/canvas-linux-x64-gnu-0.1.86.tgz",
"integrity": "sha512-Jor+rhRN6ubix+D2QkNn9XlPPVAYl+2qFrkZ4oZN9UgtqIUZ+n+HljxhlkkDFRaX1mlxXOXPQjxaZg17zDSFcQ==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-linux-x64-musl": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-linux-x64-musl/-/canvas-linux-x64-musl-0.1.86.tgz",
"integrity": "sha512-A28VTy91DbclopSGZ2tIon3p8hcVI1JhnNpDpJ5N9rYlUnVz1WQo4waEMh+FICTZF07O3coxBNZc4Vu4doFw7A==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-win32-arm64-msvc": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-win32-arm64-msvc/-/canvas-win32-arm64-msvc-0.1.86.tgz",
"integrity": "sha512-q6G1YXUt3gBCAS2bcDMCaBL4y20di8eVVBi1XhjUqZSVyZZxxwIuRQHy31NlPJUCMiyNiMuc6zeI0uqgkWwAmA==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@napi-rs/canvas-win32-x64-msvc": {
"version": "0.1.86",
"resolved": "https://registry.npmmirror.com/@napi-rs/canvas-win32-x64-msvc/-/canvas-win32-x64-msvc-0.1.86.tgz",
"integrity": "sha512-X0g46uRVgnvCM1cOjRXAOSFSG63ktUFIf/TIfbKCUc7QpmYUcHmSP9iR6DGOYfk+SggLsXoJCIhPTotYeZEAmg==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
}
},
"node_modules/@nodelib/fs.scandir": { "node_modules/@nodelib/fs.scandir": {
"version": "2.1.5", "version": "2.1.5",
"resolved": "https://registry.npmmirror.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "resolved": "https://registry.npmmirror.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
...@@ -5157,6 +5396,17 @@ ...@@ -5157,6 +5396,17 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/pdfjs-dist": {
"version": "5.4.449",
"resolved": "https://registry.npmmirror.com/pdfjs-dist/-/pdfjs-dist-5.4.449.tgz",
"integrity": "sha512-CegnUaT0QwAyQMS+7o2POr4wWUNNe8VaKKlcuoRHeYo98cVnqPpwOXNSx6Trl6szH02JrRcsPgletV6GmF3LtQ==",
"engines": {
"node": ">=20.16.0 || >=22.3.0"
},
"optionalDependencies": {
"@napi-rs/canvas": "^0.1.81"
}
},
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz",
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
"json5": "^2.2.3", "json5": "^2.2.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"markdown-it": "^14.1.0", "markdown-it": "^14.1.0",
"pdfjs-dist": "^5.4.449",
"vue": "^3.4.0", "vue": "^3.4.0",
"vue-router": "^4.2.5" "vue-router": "^4.2.5"
}, },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -202,6 +202,16 @@ export const getThinkTankReportSummary = (params) => { ...@@ -202,6 +202,16 @@ export const getThinkTankReportSummary = (params) => {
); );
} }
//获取报告原文
export const getThinkTankReportcontentUrl = (params) => {
return request(
{
method: 'GET',
url: `/api/thinkTankReport/contentUrl/${params}`,
}
);
}
//获取报告内容摘要 //获取报告内容摘要
export function getThinkTankReportAbstract(params) { export function getThinkTankReportAbstract(params) {
return request({ return request({
......
...@@ -2,33 +2,41 @@ ...@@ -2,33 +2,41 @@
import thinkTank from "@/views/thinkTank/index.vue"; import thinkTank from "@/views/thinkTank/index.vue";
import ThinkTankDetail from "@/views/thinkTank/ThinkTankDetail/index.vue"; import ThinkTankDetail from "@/views/thinkTank/ThinkTankDetail/index.vue";
import ReportDetail from "@/views/thinkTank/ReportDetail/index.vue"; import ReportDetail from "@/views/thinkTank/ReportDetail/index.vue";
import ReportOriginal from "@/views/thinkTank/reportOriginal/index.vue"
const thinktankRoutes = [ const thinktankRoutes = [
// 智库系统的主要路由 // 智库系统的主要路由
{ {
path: "/thinkTank", path: "/thinkTank",
name: "thinkTank", name: "thinkTank",
component: thinkTank, component: thinkTank,
meta: { meta: {
title: "首页" title: "首页"
} }
}, },
{ {
path: "/thinkTank/thinkTankDetail/:id", path: "/thinkTank/thinkTankDetail/:id",
name: "ThinkTankDetail", name: "ThinkTankDetail",
component: ThinkTankDetail, component: ThinkTankDetail,
meta: { meta: {
title: "智库详情" title: "智库详情"
} }
}, },
{ {
path: "/thinkTank/reportDetail/:id", path: "/thinkTank/reportDetail/:id",
name: "ReportDetail", name: "ReportDetail",
component: ReportDetail, component: ReportDetail,
meta: { meta: {
title: "报告详情" title: "报告详情"
} }
}, },
{
path: "/thinkTank/reportOriginal/:id",
name: "ReportOriginal",
component: ReportOriginal,
meta: {
title: "报告原文"
}
},
] ]
......
...@@ -9,9 +9,12 @@ ...@@ -9,9 +9,12 @@
<div class="en-title"> <div class="en-title">
{{ thinkInfo.ename }} {{ thinkInfo.ename }}
</div> </div>
<div class="tag-box" v-for="value in thinkInfo.tags"> <div style="display: flex;">
<div class="tag">{{ value }}</div> <div class="tag-box" v-for="value in thinkInfo.tags">
<div class="tag">{{ value.industryName }}</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -102,7 +105,15 @@ const handleGetThinkTankReportSummary = async () => { ...@@ -102,7 +105,15 @@ const handleGetThinkTankReportSummary = async () => {
}; };
const toReport = () => { const toReport = () => {
window.open(reportUrl.value, "_blank"); console.log(reportUrl.value, 'reportUrl.valuereportUrl.value')
const route = router.resolve({
name: "ReportOriginal",
params: {
id: router.currentRoute._value.params.id
}
});
window.open(route.href, "_blank");
} }
const tabActiveName = ref("报告分析"); const tabActiveName = ref("报告分析");
...@@ -130,7 +141,7 @@ onMounted(async () => { ...@@ -130,7 +141,7 @@ onMounted(async () => {
.header-top { .header-top {
margin-top: 20px; margin-top: 20px;
margin-left: 248px; margin-left: 160px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-right: 160px; margin-right: 160px;
...@@ -139,8 +150,8 @@ onMounted(async () => { ...@@ -139,8 +150,8 @@ onMounted(async () => {
display: flex; display: flex;
img { img {
width: 88px; width: 72px;
height: 88px height: 88px;
} }
.title { .title {
......
...@@ -43,14 +43,14 @@ ...@@ -43,14 +43,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="right"> <!-- <div class="right">
<div class="text"> <div class="text">
{{ "查看智库原文" }} {{ "查看智库原文" }}
</div> </div>
<div class="icon"> <div class="icon">
<img src="@/assets/icons/open.png" alt="" /> <img src="@/assets/icons/open.png" alt="" />
</div> </div>
</div> </div> -->
</div> </div>
</div> </div>
...@@ -435,6 +435,7 @@ onMounted(async () => { ...@@ -435,6 +435,7 @@ onMounted(async () => {
overflow-y: auto; overflow-y: auto;
.box1-item { .box1-item {
align-items: center;
// height: 128px; // height: 128px;
border-bottom: 1px solid rgba(234, 236, 238, 1); border-bottom: 1px solid rgba(234, 236, 238, 1);
display: flex; display: flex;
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</div> </div>
</div> </div>
<div class="box3-main-footer"> <div class="box3-main-footer">
<div class="info">{{ total }}项调查</div> <div class="info">{{ total }}条建议</div>
<div class="page-box"> <div class="page-box">
<el-pagination :page-size="12" background layout="prev, pager, next" :total="total" <el-pagination :page-size="12" background layout="prev, pager, next" :total="total"
@current-change="handleCurrentChange" :current-page="currentPage" /> @current-change="handleCurrentChange" :current-page="currentPage" />
......
...@@ -111,29 +111,36 @@ ...@@ -111,29 +111,36 @@
<img :src="item.imageUrl" alt="" /> <img :src="item.imageUrl" alt="" />
</div> </div>
<div class="item-right"> <div class="item-right">
<div class="title">{{ item.content }}</div> <div>
<div class="info">{{ item.times }} · {{ item.name }}</div> <div class="title">{{ item.content }}</div>
<div class="tag-box"> <div class="info">{{ item.times }} · {{ item.name }}</div>
<div class="tag" v-for="(tag, idx) in item.tagList" :key="idx"> <div class="tag-box">
{{ tag }} <div class="tag" v-for="(tag, idx) in item.tagList" :key="idx">
</div> {{ tag }}
</div>
<div class="file-box">
<div class="file" v-for="(file, idxx) in item.relationBillsList" :key="idxx">
<div class="type">法案</div>
<div class="title">{{ file.billName }}</div>
<div class="more">
<img src="./images/arrow-right.png" alt="" />
</div> </div>
</div> </div>
<div class="file" v-for="(file, idxx) in item.relationAdList" :key="idxx"> <div class="file-box">
<div class="type">政令</div> <div class="file" v-for="(file, idxx) in item.relationBillsList" :key="idxx">
<div class="title">{{ file.adName }}</div> <div class="type">法案</div>
<div class="more"> <div class="title">{{ file.billName }}</div>
<img src="./images/arrow-right.png" alt="" /> <div class="more">
<img src="./images/arrow-right.png" alt="" />
</div>
</div>
<div class="file" v-for="(file, idxx) in item.relationAdList" :key="idxx">
<div class="type">政令</div>
<div class="title">{{ file.adName }}</div>
<div class="more">
<img src="./images/arrow-right.png" alt="" />
</div>
</div> </div>
</div> </div>
</div> </div>
<div>
<div class="more" @click="toDetaile(item.reportId)">
<img src="@/assets/icons/open.png" alt="" />
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -528,6 +535,17 @@ function getDateMonthsAgo(months) { ...@@ -528,6 +535,17 @@ function getDateMonthsAgo(months) {
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
} }
const toDetaile = (id) => {
const route = router.resolve({
name: "ReportDetail",
params: {
id: id
}
});
window.open(route.href, "_blank");
}
const total = ref(0); const total = ref(0);
const sort = ref(true); const sort = ref(true);
const currentPage = ref(1); const currentPage = ref(1);
...@@ -826,7 +844,7 @@ onMounted(() => { ...@@ -826,7 +844,7 @@ onMounted(() => {
height: 1540px; height: 1540px;
.right-main-item { .right-main-item {
height: 154px; // height: 154px;
box-sizing: border-box; box-sizing: border-box;
padding-top: 8px; padding-top: 8px;
border-bottom: 1px solid rgba(234, 236, 238, 1); border-bottom: 1px solid rgba(234, 236, 238, 1);
...@@ -845,6 +863,9 @@ onMounted(() => { ...@@ -845,6 +863,9 @@ onMounted(() => {
.item-right { .item-right {
margin-left: 15px; margin-left: 15px;
display: flex;
width: 100%;
justify-content: space-between;
.title { .title {
// height: 24px; // height: 24px;
......
...@@ -13,7 +13,13 @@ const getPieChart = (data) => { ...@@ -13,7 +13,13 @@ const getPieChart = (data) => {
}, },
label: { label: {
alignTo: 'edge', alignTo: 'edge',
formatter: '{name|{b}}\n{time|{c} 个 {d}%}', // formatter: '{name|{b}}\n{time|{c} 个 {d}%}',
formatter: function (params) {
console.log(params, 'params')
// params.c 是当前数据项的 value 值
const time = params.data.value / 1000000; // 将值除以 1000000
return `{name|${params.data.name}}\n{time|${time.toFixed(2)}}亿美元`; // 使用 toFixed(2) 保留两位小数
},
minMargin: 15, minMargin: 15,
edgeDistance: 10, edgeDistance: 10,
lineHeight: 15, lineHeight: 15,
...@@ -22,10 +28,12 @@ const getPieChart = (data) => { ...@@ -22,10 +28,12 @@ const getPieChart = (data) => {
fontSize: 16, fontSize: 16,
color: 'rgba(59, 65, 75, 1)', color: 'rgba(59, 65, 75, 1)',
fontWeight: 700, fontWeight: 700,
lineHeight: 20
}, },
time: { time: {
fontSize: 14, fontSize: 14,
color: 'rgba(59, 65, 75, 1)', color: 'rgba(59, 65, 75, 1)',
lineHeight: 20
} }
} }
}, },
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<div class="title">{{ "智库发布" }}</div> <div class="title">{{ "智库发布" }}</div>
</div> </div>
<div class="box1-header-right"> <div class="box1-header-right" @click="toDetaile()">
查看详情 > 查看详情 >
</div> </div>
</div> </div>
...@@ -334,7 +334,7 @@ ...@@ -334,7 +334,7 @@
</template> </template>
</el-popover> </el-popover>
<div class="item-right">{{ `${item.count}份报告 >` }}</div> <!-- <div class="item-right">{{ `${item.count}份报告 >` }}</div> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -588,6 +588,17 @@ function changeBox1Data(type) { ...@@ -588,6 +588,17 @@ function changeBox1Data(type) {
box1DataIndex.value === box1Data.value.length - 1 ? "" : (box1DataIndex.value = box1DataIndex.value + 1); box1DataIndex.value === box1Data.value.length - 1 ? "" : (box1DataIndex.value = box1DataIndex.value + 1);
} }
} }
const toDetaile = () => {
const route = router.resolve({
name: "ReportDetail",
params: {
id: box1Data.value[box1DataIndex.value].reportId
}
});
window.open(route.href, "_blank");
}
// 风险信号 // 风险信号
const warningList = ref([ const warningList = ref([
{ {
...@@ -2861,7 +2872,7 @@ onMounted(async () => { ...@@ -2861,7 +2872,7 @@ onMounted(async () => {
.item-center { .item-center {
margin-left: 20px; margin-left: 20px;
width: 315px; width: 425px;
height: 24px; height: 24px;
color: rgba(59, 65, 75, 1); color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
......
<template>
<div class="wrap">
<div class="header">
<div class="header-top">
<div class="header-top-left">
<img :src="thinkInfo.contentUrl" alt="" />
<div>
<div class="title">{{ thinkInfo.name }}</div>
<div class="en-title">
{{ thinkInfo.ename }}
</div>
<div style="display: flex;">
<div class="tag-box" v-for="value in thinkInfo.tags">
<div class="tag">{{ value.industryName }}</div>
</div>
</div>
</div>
</div>
<div class="header-top-right">
<div class="name">{{ thinkInfo.thinkTankName }}</div>
<div class="time">{{ thinkInfo.times }}</div>
</div>
</div>
</div>
<div class="main">
<div class="main-header">
<div style=" margin-top: 17px;">
智库报告原文
</div>
</div>
<div class="report-box">
<pdf :pdfUrl="reportUrl" style="width: 48%;" />
<pdf :pdfUrl="reportUrlEn" style="width: 48%;" />
<!-- <iframe src="https://www.rand.org/pubs/research_reports/RRA3572-1.html" width="100%" height="600px"
frameborder="0" allowfullscreen></iframe> -->
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import pdf from "./pdf.vue";
import {
getThinkTankReportSummary
} from "@/api/thinkTank/overview";
import { useRouter } from "vue-router";
const router = useRouter();
const reportUrl = ref('')
const reportUrlEn = ref('')
const thinkInfo = ref({})
// 获取报告全局信息
const handleGetThinkTankReportSummary = async () => {
try {
const res = await getThinkTankReportSummary(router.currentRoute._value.params.id);
console.log("报告全局信息", res);
if (res.code === 200 && res.data) {
reportUrl.value = res.data.contentUrl
reportUrlEn.value = res.data.contentEn
thinkInfo.value = res.data
}
} catch (error) {
console.error("获取报告全局信息error", error);
}
};
const tabActiveName = ref("报告分析");
const switchTab = name => {
tabActiveName.value = name;
};
onMounted(async () => {
handleGetThinkTankReportSummary()
});
</script>
<style lang="scss" scoped>
.wrap {
width: 1920px;
// height: 984px;
.header {
width: 1920px;
height: 125px;
box-sizing: border-box;
border-bottom: 1px solid rgba(234, 236, 238, 1);
border-top: 1px solid rgba(234, 236, 238, 1);
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: rgba(255, 255, 255, 1);
.header-top {
margin-top: 20px;
margin-left: 160px;
display: flex;
justify-content: space-between;
margin-right: 160px;
.header-top-left {
display: flex;
img {
width: 72px;
height: 88px;
}
.title {
margin-left: 20px;
height: 26px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 20px;
font-weight: 700;
line-height: 26px;
letter-spacing: 0px;
text-align: left;
}
.en-title {
margin-left: 20px;
height: 24px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 24px;
letter-spacing: 0px;
text-align: left;
}
.tag-box {
margin-top: 11px;
display: flex;
gap: 8px;
margin-left: 20px;
.tag {
height: 26px;
padding: 0 8px;
box-sizing: border-box;
border: 1px solid rgba(231, 243, 255, 1);
border-radius: 4px;
background: rgba(246, 250, 255, 1);
color: var(--color-main-active);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 24px;
letter-spacing: 0px;
text-align: left;
}
}
}
.header-top-right {
.name {
height: 24px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 24px;
letter-spacing: 0px;
text-align: right;
}
.time {
height: 24px;
margin-top: 5px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 24px;
letter-spacing: 0px;
text-align: right;
}
}
}
.header-bottom {
margin: 0 auto;
margin-top: 30px;
width: 1600px;
height: 48px;
display: flex;
justify-content: space-between;
.tab-box {
width: 224px;
height: 48px;
display: flex;
gap: 24px;
.tab {
width: 94px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
cursor: pointer;
border-bottom: 2px solid transparent;
.icon {
width: 16px;
height: 16px;
img {
width: 100%;
height: 100%;
}
}
.text {
height: 24px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 18px;
font-weight: 400;
line-height: 24px;
}
.textActive {
color: rgba(5, 95, 194, 1);
font-weight: 700;
}
}
.tabActive {
border-bottom: 2px solid rgba(5, 95, 194, 1);
}
}
.btn-box {
display: flex;
gap: 12px;
.btn {
width: 120px;
height: 36px;
box-sizing: border-box;
border: 1px solid rgba(230, 231, 232, 1);
border-radius: 6px;
background: rgba(255, 255, 255, 1);
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
.icon {
width: 16px;
height: 16px;
img {
width: 100%;
height: 100%;
}
}
.text {
width: 66px;
height: 22px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: center;
}
}
.btn1 {
border-radius: 6px;
background: var(--color-main-active);
.text {
color: rgba(255, 255, 255, 1);
}
}
}
}
}
.main {
margin-left: 160px;
background: #ffffff;
width: 1600px;
height: 1025px;
overflow: hidden;
.main-header {
height: 64px;
/* box-sizing: border-box; */
border-bottom: 1px solid rgb(234, 236, 238);
border-top: 1px solid rgb(234, 236, 238);
/* box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1); */
background: rgb(255, 255, 255);
margin: 0 70px;
color: rgba(59, 65, 75, 1);
line-height: 64px;
font-family: Microsoft YaHei;
font-style: Bold;
font-size: 20px;
font-weight: 700;
line-height: 26px;
letter-spacing: 0px;
text-align: left;
}
.report-box {
width: 100%;
height: 750px;
overflow: auto;
display: flex;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="pdf-viewer">
<canvas ref="pdfCanvas"></canvas>
<div v-if="loading" class="loading">加载中...</div>
</div>
</template>
<script>
import { ref, onMounted } from 'vue';
import * as pdfjsLib from 'pdfjs-dist';
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
'pdfjs-dist/build/pdf.worker.min.mjs',
import.meta.url
).href;
export default {
name: 'PdfViewer',
props: {
pdfUrl: {
type: String,
required: true
}
},
setup(props) {
const pdfCanvas = ref(null);
const loading = ref(true);
onMounted(async () => {
try {
const loadingTask = pdfjsLib.getDocument(props.pdfUrl);
const pdf = await loadingTask.promise;
const page = await pdf.getPage(1); // 加载第一页
const viewport = page.getViewport({ scale: 1.5 });
const context = pdfCanvas.value.getContext('2d');
const renderContext = {
canvasContext: context,
viewport: viewport
};
pdfCanvas.value.width = viewport.width;
pdfCanvas.value.height = viewport.height;
await page.render(renderContext).promise;
} catch (error) {
console.error('加载 PDF 出错:', error);
} finally {
loading.value = false;
}
});
return {
pdfCanvas,
loading
};
}
};
</script>
<style scoped>
.pdf-viewer {
position: relative;
width: 100%;
height: 800px;
}
canvas {
width: 100%;
height: 100%;
}
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 18px;
color: #333;
}
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论