提交 9250fcda authored 作者: 朱政's avatar 朱政

feat:调查项目及国会听证会的详情页面及列表的样式与功能的开发

上级 00f4a246
流水线 #276 已通过 于阶段
in 1 分 48 秒
...@@ -111,6 +111,13 @@ export function getThinkTankProjects(params) { ...@@ -111,6 +111,13 @@ export function getThinkTankProjects(params) {
params params
}) })
} }
//智库概览页国会听证会
export function getThinkTankTestimonies() {
return request({
method: 'GET',
url: `/api/think-tank/testimonies`,
})
}
//智库调查项目详情主页 //智库调查项目详情主页
export function getThinkTankProjectsInfo(params) { export function getThinkTankProjectsInfo(params) {
return request({ return request({
...@@ -119,7 +126,14 @@ export function getThinkTankProjectsInfo(params) { ...@@ -119,7 +126,14 @@ export function getThinkTankProjectsInfo(params) {
}) })
} }
//智库国会听证会详情主页
export function getThinkTankHearingInfo(params) {
return request({
method: 'GET',
url: `/api/think-tank/testimonies/${params.id}`,
})
}
// 智库详情-调查项目(按智库 id) // 智库详情-调查项目(按智库 id)
export function getThinkTankProjectsByThinkTankId(params) { export function getThinkTankProjectsByThinkTankId(params) {
return request({ return request({
...@@ -131,6 +145,18 @@ export function getThinkTankProjectsByThinkTankId(params) { ...@@ -131,6 +145,18 @@ export function getThinkTankProjectsByThinkTankId(params) {
} }
}) })
} }
// 智库动态-国会听证会(按智库 id)
export function getThinkTankTestimoniesByThinkTankId(params) {
return request({
method: 'GET',
url: `/api/think-tank/${params.thinkTankId}/testimonies`,
params: {
pageNum: params.pageNum,
pageSize: params.pageSize,
}
})
}
//智库调查项目详情作者 //智库调查项目详情作者
export function getThinkTankProjectsAuthors(params) { export function getThinkTankProjectsAuthors(params) {
return request({ return request({
...@@ -469,7 +495,21 @@ export function getThinkTankReportViewpoint(params) { ...@@ -469,7 +495,21 @@ export function getThinkTankReportViewpoint(params) {
} }
}) })
} }
// 获取报告核心论点(支持关键字搜索)
export function getThinkTankHearingViewpoint(params) {
const { testimonyId, pageSize, keyword = '',pageNum } = params
return request({
method: 'GET',
url: `/api/think-tank/testimonies/qa`,
params: {
pageSize,
keyword,
pageNum,
testimonyId
}
})
}
//获取涉及科技领域 //获取涉及科技领域
export function getThinkTankReportIndustry(params) { export function getThinkTankReportIndustry(params) {
return request({ return request({
...@@ -485,13 +525,20 @@ export function getThinkTankReportIndustryCloud(params) { ...@@ -485,13 +525,20 @@ export function getThinkTankReportIndustryCloud(params) {
url: `/api/thinkTankReport/keyword/${params.id}`, url: `/api/thinkTankReport/keyword/${params.id}`,
}) })
} }
//获取科技领域词云 //获取调查项目词云
export function getThinkTankProjectCloud(params) { export function getThinkTankProjectCloud(params) {
return request({ return request({
method: 'GET', method: 'GET',
url: `/api/think-tank/projects/${params.id}/word-cloud`, url: `/api/think-tank/projects/${params.id}/word-cloud`,
}) })
} }
//获取国会听证会词云
export function getThinkTankHearingCloud(params) {
return request({
method: 'GET',
url: `/api/think-tank/testimonies/${params.id}/wordcloud`,
})
}
//获取政策建议落实情况 //获取政策建议落实情况
export function getThinkTankReportPolicy(params) { export function getThinkTankReportPolicy(params) {
......
...@@ -41,17 +41,31 @@ const thinktankRoutes = [ ...@@ -41,17 +41,31 @@ const thinktankRoutes = [
path: "/thinkTank/reportOriginal/:id", path: "/thinkTank/reportOriginal/:id",
name: "ReportOriginal", name: "ReportOriginal",
component: ReportOriginal, component: ReportOriginal,
meta: {
title: "报告原文",
dynamicTitle: true,
titleStorageKey: "reportOriginalTabName"
}
}, },
{ {
path: "/thinkTank/SurveyProjectView/:id", path: "/thinkTank/SurveyProjectView/:id",
name: "SurveyProjectView", name: "SurveyProjectView",
component: SurveyProjectView, component: SurveyProjectView,
meta: {
title: "调查项目",
dynamicTitle: true,
titleStorageKey: "surveyProjectTabName"
}
}, },
{ {
path: "/thinkTank/CongressHearingView/:id", path: "/thinkTank/CongressHearingView/:id",
name: "CongressHearingView", name: "CongressHearingView",
component: CongressHearingView, component: CongressHearingView,
meta: {
title: "国会听证会",
dynamicTitle: true,
titleStorageKey: "congressHearingTabName"
}
}, },
{ {
path: "/thinkTank/allThinkTank", path: "/thinkTank/allThinkTank",
......
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
<div class="header"> <div class="header">
<div class="header-top"> <div class="header-top">
<div class="header-top-left"> <div class="header-top-left">
<img src="../assets/images/box1-logo.png" alt="" /> <img :src=thinkInfo.coverImgUrl alt="" />
<div> <div>
<div class="title">{{ thinkInfo.name }}</div> <div class="title">{{ thinkInfo.titleZh }}</div>
<div class="en-title"> <div class="en-title">
{{ thinkInfo.ename }}.{{ thinkInfo.times }} {{ thinkInfo.testimonyDate }}·{{ "国会听证会" }}·{{ thinkInfo.committeeZh }}
</div> </div>
<div class="tag-box"> <div class="tag-box">
<!-- <div class="tag-box" v-for="value,index in thinkInfo.tags" :key="index"> <!-- <div class="tag-box" v-for="value,index in thinkInfo.tags" :key="index">
<div class="tag">{{ value.industryName }}</div> <div class="tag">{{ value.industryName }}</div>
</div> --> </div> -->
<AreaTag v-for="(value, index) in thinkInfo.tags" :key="index" :tagName="value.industryName"></AreaTag> <AreaTag v-for="(value, index) in thinkInfo.tags" :key="index" :tagName="value.domainName"></AreaTag>
</div> </div>
</div> </div>
</div> </div>
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<div class="box3-main"> <div class="box3-main">
<AiSummary> <AiSummary>
<template #summary-content> <template #summary-content>
{{ box1Data }} {{ thinkInfo.descriptionZh }}
</template> </template>
</AiSummary> </AiSummary>
...@@ -180,10 +180,9 @@ ...@@ -180,10 +180,9 @@
{{ index + 1 }} {{ index + 1 }}
</div> </div>
<div class="center"> <div class="center">
<div class="title" v-html="highlightOpinionText(item.titleZh)"></div> <div class="title" v-html="highlightOpinionText(item.questionZh)"></div>
<div> <div>
<img src="./images/image-open.png" alt="" class="center-image" <img src="./images/image-open.png" alt="" class="center-image" />
@click="handleOpenReportOriginal(item)" />
</div> </div>
<div> <div>
<img v-if="!isOpinionExpanded(item, index)" src="./images/image-down.png" alt="" <img v-if="!isOpinionExpanded(item, index)" src="./images/image-down.png" alt=""
...@@ -194,7 +193,7 @@ ...@@ -194,7 +193,7 @@
</div> </div>
</div> </div>
<div v-if="isOpinionExpanded(item, index)" class="desc" <div v-if="isOpinionExpanded(item, index)" class="desc"
v-html="highlightOpinionText(item.contentZh)"> v-html="highlightOpinionText(item.answerZh)">
</div> </div>
<!-- <div class="right"> --> <!-- <div class="right"> -->
<!-- <div class="tag" v-for="(val, idx) in item.hylyList" :key="idx"> <!-- <div class="tag" v-for="(val, idx) in item.hylyList" :key="idx">
...@@ -239,7 +238,10 @@ import { ...@@ -239,7 +238,10 @@ import {
getThinkTankReportContent, getThinkTankReportContent,
getThinkTankReportIndustry, getThinkTankReportIndustry,
getThinkTankReportIndustryCloud, getThinkTankReportIndustryCloud,
getThinkTankReportViewpoint getThinkTankReportViewpoint,
getThinkTankHearingInfo,
getThinkTankHearingCloud,
getThinkTankHearingViewpoint
} from "@/api/thinkTank/overview"; } from "@/api/thinkTank/overview";
import { getChartAnalysis } from "@/api/aiAnalysis/index"; import { getChartAnalysis } from "@/api/aiAnalysis/index";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
...@@ -270,15 +272,39 @@ const props = defineProps({ ...@@ -270,15 +272,39 @@ const props = defineProps({
} }
}); });
const thinkInfo = ref({ const thinkInfo = ref({
name: "探讨中国开发和管理的跨大陆电网的安全影响",
ename: "调查项目",
tags: [{ industryName: "深海" }, { industryName: "人工智能" }],
thinkTankName: "兰德科技智库",
thinkTankLogoUrl: "http://8.140.26.4:10010/kjb-files/images/org/land.webp",
times: "2024-05-28"
}) })
const applyCongressHearingDocumentTitle = (title) => {
const text = String(title || "").trim();
if (!text) return;
window.sessionStorage.setItem("congressHearingTabName", text);
document.title = text;
};
const handleGetThinkTankHearingInfo = async () => {
try {
const id = router.currentRoute._value.params.id;
if (!id) return;
const res = await getThinkTankHearingInfo({ id });
if (res?.code === 200 && res?.data) {
const info = res.data;
thinkInfo.value = {
...info,
// 保持模板现有字段:titleZh / testimonyDate / committeeZh / coverImgUrl ...
tags: Array.isArray(info.domains) ? info.domains : thinkInfo.value.tags,
};
console.log("thinkInfo", thinkInfo.value);
applyCongressHearingDocumentTitle(info.titleZh || info.title || "");
if (info.summaryZh || info.summary) {
box1Data.value = info.summaryZh || info.summary;
}
projectBackground.value = info.backgroundZh || info.background || projectBackground.value;
}
} catch (error) {
console.error("获取调查项目详情error", error);
}
};
const REPORT_ANALYSIS_TIP_BOX5 = const REPORT_ANALYSIS_TIP_BOX5 =
"智库报告关键词云,数据来源:美国兰德公司官网"; "国会听证会关键词云,数据来源:美国兰德公司官网";
// 刷新后默认展示「报告关键词云」AI 总结 // 刷新后默认展示「报告关键词云」AI 总结
const isShowAiContentBox5 = ref(true); const isShowAiContentBox5 = ref(true);
const aiContentBox5 = ref(""); const aiContentBox5 = ref("");
...@@ -464,19 +490,19 @@ const hasBox5ChartData = computed(() => Array.isArray(box5Data.value) && box5Dat ...@@ -464,19 +490,19 @@ const hasBox5ChartData = computed(() => Array.isArray(box5Data.value) && box5Dat
/** 词云子组件不 watch 数据,每次接口成功有数据时递增 key,强制重新挂载以触发 onMounted */ /** 词云子组件不 watch 数据,每次接口成功有数据时递增 key,强制重新挂载以触发 onMounted */
const box5WordCloudKey = ref(0); const box5WordCloudKey = ref(0);
//获取科技领域词云 //获取国会听证会词云
const handleGetThinkTankReportIndustryCloud = async () => { const handleGetThinkTankReportIndustryCloud = async () => {
try { try {
const params = { const params = {
id: router.currentRoute._value.params.id id: router.currentRoute._value.params.id
// industryId: activeArea.value // industryId: activeArea.value
}; };
const res = await getThinkTankReportIndustryCloud(params); const res = await getThinkTankHearingCloud(params);
console.log("科技领域词云", res); console.log("科技领域词云", res);
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
const data = (res.data || []).map(item => ({ const data = (res.data || []).map(item => ({
name: item.clause, name: item.name,
value: item.count value: item.value
})); }));
// 该接口数据用于「报告关键词云」 // 该接口数据用于「报告关键词云」
box5Data.value = data; box5Data.value = data;
...@@ -566,18 +592,17 @@ const handleCurrentChange = page => { ...@@ -566,18 +592,17 @@ const handleCurrentChange = page => {
handleGetThinkTankReportViewpoint(); handleGetThinkTankReportViewpoint();
}; };
// 获取报告核心论点(支持搜索) // 获取报告听证会(支持搜索)
const handleGetThinkTankReportViewpoint = async () => { const handleGetThinkTankReportViewpoint = async () => {
try { try {
const params = { const params = {
reportId: router.currentRoute._value.params.id, testimonyId: router.currentRoute._value.params.id,
currentPage: currentPage.value - 1, pageNum: currentPage.value,
pageSize: pageSize.value, pageSize: pageSize.value,
keyword: (searchOpinions.value || "").trim(), keyword: (searchOpinions.value || "").trim(),
orgIds: ""
}; };
const res = await getThinkTankReportViewpoint(params); const res = await getThinkTankHearingViewpoint(params);
console.log("核心论点", res.data); console.log("听证会内容", res.data);
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
const nextOpinions = res.data.content || []; const nextOpinions = res.data.content || [];
majorOpinions.value = nextOpinions; majorOpinions.value = nextOpinions;
...@@ -672,6 +697,7 @@ onMounted(() => { ...@@ -672,6 +697,7 @@ onMounted(() => {
handleGetThinkTankReportIndustry(); handleGetThinkTankReportIndustry();
handleGetThinkTankReportIndustryCloud(); handleGetThinkTankReportIndustryCloud();
handleGetThinkTankHearingInfo();
}); });
</script> </script>
...@@ -1484,6 +1510,7 @@ onMounted(() => { ...@@ -1484,6 +1510,7 @@ onMounted(() => {
height: 24px; height: 24px;
margin-top: 12px; margin-top: 12px;
margin-left: 18px; margin-left: 18px;
cursor: pointer;
} }
...@@ -1533,8 +1560,8 @@ onMounted(() => { ...@@ -1533,8 +1560,8 @@ onMounted(() => {
padding-top: 22px; padding-top: 22px;
padding-bottom: 23px; padding-bottom: 23px;
padding-left: 56px; // 24(left) + 13(center margin) + 一点间距 padding-left: 56px;
padding-right: 56px;
color: rgb(59, 65, 75); color: rgb(59, 65, 75);
font-family: "Source Han Sans CN"; font-family: "Source Han Sans CN";
font-weight: 400; font-weight: 400;
......
...@@ -8,18 +8,18 @@ ...@@ -8,18 +8,18 @@
<div> <div>
<div class="title">{{ thinkInfo.name }}</div> <div class="title">{{ thinkInfo.name }}</div>
<div class="en-title"> <div class="en-title">
{{ thinkInfo.ename }} {{ "调查项目" }}
</div> </div>
</div> </div>
</div> </div>
<div class="header-top-right"> <div class="header-top-right">
<div class="image-name-box"> <div class="image-name-box">
<div class="image"><img :src="thinkInfo.thinkTankLogo" alt="" /></div> <div class="image"><img :src="thinkInfo.orgLogo" alt="" /></div>
<div class="name">{{ thinkInfo.thinkTankName }}</div> <div class="name">{{ thinkInfo.orgName }}</div>
</div> </div>
<div class="tag-box"> <div class="tag-box">
<AreaTag v-for="(value, index) in thinkInfo.tags" :key="index" :tagName="value.industryName"></AreaTag> <AreaTag v-for="(value, index) in thinkInfo.tags" :key="index" :tagName="value"></AreaTag>
</div> </div>
</div> </div>
</div> </div>
...@@ -177,6 +177,12 @@ const thinkInfo = ref({ ...@@ -177,6 +177,12 @@ const thinkInfo = ref({
}) })
const reportAuthors = ref([]); const reportAuthors = ref([]);
const projectBackground = ref(""); const projectBackground = ref("");
const applySurveyProjectDocumentTitle = (title) => {
const text = String(title || "").trim();
if (!text) return;
window.sessionStorage.setItem("surveyProjectTabName", text);
document.title = text;
};
const REPORT_ANALYSIS_TIP_BOX5 = const REPORT_ANALYSIS_TIP_BOX5 =
"调查项目关键词云,数据来源:美国兰德公司官网"; "调查项目关键词云,数据来源:美国兰德公司官网";
// 刷新后默认展示「报告关键词云」AI 总结 // 刷新后默认展示「报告关键词云」AI 总结
...@@ -221,7 +227,7 @@ const formatDate = (dateStr) => { ...@@ -221,7 +227,7 @@ const formatDate = (dateStr) => {
if (!dateStr) return ""; if (!dateStr) return "";
const date = new Date(dateStr) const date = new Date(dateStr)
const y = date.getFullYear() const y = date.getFullYear()
const m = date.getMonth() + 1 const m = date.getMonth() + 1
const d = date.getDate() const d = date.getDate()
return `${y}${m}${d}日` return `${y}${m}${d}日`
}; };
...@@ -276,6 +282,7 @@ const handleGetThinkTankProjectsInfo = async () => { ...@@ -276,6 +282,7 @@ const handleGetThinkTankProjectsInfo = async () => {
tags: Array.isArray(info.domains) ? info.domains : thinkInfo.value.tags, tags: Array.isArray(info.domains) ? info.domains : thinkInfo.value.tags,
}; };
console.log("thinkInfo", thinkInfo.value); console.log("thinkInfo", thinkInfo.value);
applySurveyProjectDocumentTitle(info.projectNameZh || info.projectName || "");
if (info.summaryZh || info.summary) { if (info.summaryZh || info.summary) {
box1Data.value = info.summaryZh || info.summary; box1Data.value = info.summaryZh || info.summary;
} }
......
...@@ -32,7 +32,7 @@ const getPieChart = (data) => { ...@@ -32,7 +32,7 @@ const getPieChart = (data) => {
const value = params.value ?? ""; const value = params.value ?? "";
const percent = params.percent != null ? Math.round(params.percent) : 0; const percent = params.percent != null ? Math.round(params.percent) : 0;
return `{name|${name}}\n{time|${value} ${percent}%}`; return `{name|${name}}\n{time| ${percent}%}`;
}, },
minMargin: 10, minMargin: 10,
edgeDistance: 20, edgeDistance: 20,
......
...@@ -21,10 +21,7 @@ ...@@ -21,10 +21,7 @@
<div class="title">{{ "科技领域" }}</div> <div class="title">{{ "科技领域" }}</div>
</div> </div>
<div class="select-main"> <div class="select-main">
<el-checkbox-group <el-checkbox-group class="checkbox-group" :model-value="selectedResearchIds" @change="handleAreaGroupChange">
class="checkbox-group"
:model-value="selectedResearchIds"
@change="handleAreaGroupChange">
<el-checkbox class="filter-checkbox" :label="RESOURCE_FILTER_ALL_AREA"> <el-checkbox class="filter-checkbox" :label="RESOURCE_FILTER_ALL_AREA">
{{ RESOURCE_FILTER_ALL_AREA }} {{ RESOURCE_FILTER_ALL_AREA }}
</el-checkbox> </el-checkbox>
...@@ -40,9 +37,7 @@ ...@@ -40,9 +37,7 @@
<div class="title">{{ "发布时间" }}</div> <div class="title">{{ "发布时间" }}</div>
</div> </div>
<div class="select-main"> <div class="select-main">
<el-checkbox-group <el-checkbox-group class="checkbox-group" :model-value="selectedResearchTimeIds"
class="checkbox-group"
:model-value="selectedResearchTimeIds"
@change="handleTimeGroupChange"> @change="handleTimeGroupChange">
<el-checkbox class="filter-checkbox" :label="RESOURCE_FILTER_ALL_TIME"> <el-checkbox class="filter-checkbox" :label="RESOURCE_FILTER_ALL_TIME">
{{ RESOURCE_FILTER_ALL_TIME }} {{ RESOURCE_FILTER_ALL_TIME }}
...@@ -62,9 +57,7 @@ ...@@ -62,9 +57,7 @@
<div class="title">{{ "听证会部门" }}</div> <div class="title">{{ "听证会部门" }}</div>
</div> </div>
<div class="select-main"> <div class="select-main">
<el-checkbox-group <el-checkbox-group class="checkbox-group" :model-value="selectedResearchHearingIds"
class="checkbox-group"
:model-value="selectedResearchHearingIds"
@change="handleDeptGroupChange"> @change="handleDeptGroupChange">
<el-checkbox class="filter-checkbox" :label="RESOURCE_FILTER_ALL_DEPT"> <el-checkbox class="filter-checkbox" :label="RESOURCE_FILTER_ALL_DEPT">
{{ RESOURCE_FILTER_ALL_DEPT }} {{ RESOURCE_FILTER_ALL_DEPT }}
...@@ -82,31 +75,33 @@ ...@@ -82,31 +75,33 @@
<div class="right"> <div class="right">
<div class="card-box"> <div class="card-box">
<div class="card-content"> <div class="card-content">
<div v-for="(item, index) in displayList" :key="item.id"> <div v-for="(item, index) in hearingData" :key="item.id">
<div class="card-item"> <div class="card-item" @click="handleToReportDetail(item)">
<img class="card-item-img" src="../images/img congress.png" alt="report image" />
<img class="card-item-img" :src="item.coverImgUrl" alt="report image" />
<div class="card-item-text"> <div class="card-item-text">
<div class="card-item-title"> <div class="card-item-title">
<span v-html="highlightText(item.title)"></span> <span v-html="highlightText(item.title)"></span>
</div> </div>
<div class="card-item-time"> <div class="card-item-time">
<span v-html="highlightText(item.time + ' · ' + item.content)"></span> <span v-html="highlightText(item.time + ' · ' + item.content)"></span>
<img src="../images/image open.png" alt="open icon" class="card-open-image" /> <img src="../images/image open.png" alt="open icon" class="card-open-image"
@click.stop="handleToReportDetail(item)" />
</div> </div>
<div class="card-item-category"> {{ item.category }}</div> <div class="card-item-category" v-if="item.category"> {{ item.category }}</div>
</div> </div>
</div> </div>
<div class="divider" v-if="index !== displayList.length - 1"></div> <div class="divider" v-if="index !== hearingData.length - 1"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="right-footer"> <div class="right-footer">
<div class="info"> <div class="info">
{{ filteredHearingData.length }} 篇智库报告 {{ total }} 篇智库报告
</div> </div>
<div class="page-box"> <div class="page-box">
<el-pagination :page-size="10" background layout="prev, pager, next" :total="filteredHearingData.length" <el-pagination :page-size="10" background layout="prev, pager, next" :total="total"
@current-change="handleCurrentChange" :current-page="currentPage" /> @current-change="handleCurrentChange" :current-page="currentPage" />
</div> </div>
</div> </div>
...@@ -262,42 +257,9 @@ const handleDeptGroupChange = (val) => { ...@@ -262,42 +257,9 @@ const handleDeptGroupChange = (val) => {
handleGetThinkDynamicsReport(); handleGetThinkDynamicsReport();
}; };
const filteredHearingData = computed(() => {
const areaSel = stripAllAreaForRequest(selectedResearchIds.value);
const timeSel = stripAllTimeForRequest(selectedResearchTimeIds.value);
const deptSel = stripAllDeptForRequest(selectedResearchHearingIds.value);
const rangeStart = getDateYearsAgo(selectedYear.value || 1);
return (hearingData.value || []).filter(item => {
const itemDate = parseChineseDate(item.time);
const matchTopRange = itemDate ? itemDate >= rangeStart : true;
const matchYear =
timeSel.length === 0 ||
timeSel.some(sel => {
if (sel === RESOURCE_FILTER_EARLIER) {
return matchesEarlierChineseDate(item.time);
}
return String(item.time || "").startsWith(String(sel));
});
const matchDepartment =
deptSel.length === 0 ||
deptSel.some(department =>
String(item.content || "").includes(department) || String(item.title || "").includes(department)
);
const matchType =
areaSel.length === 0 ||
areaSel.some(typeId =>
String(item.category || "").includes(String(typeId)) || String(item.title || "").includes(String(typeId))
);
return matchTopRange && matchYear && matchDepartment && matchType;
});
});
// 只展示当前页的数据
const displayList = computed(() => {
const list = filteredHearingData.value || [];
const start = (currentPage.value - 1) * pageSize;
return list.slice(start, start + pageSize);
});
// 保持模板里的方法名不变,但改成通知父组件,直接传入当前选中值避免时序问题 // 保持模板里的方法名不变,但改成通知父组件,直接传入当前选中值避免时序问题
const handleGetThinkDynamicsReport = () => { const handleGetThinkDynamicsReport = () => {
...@@ -542,7 +504,7 @@ const handleToReportDetail = item => { ...@@ -542,7 +504,7 @@ const handleToReportDetail = item => {
width: 100%; width: 100%;
height: 77px; height: 77px;
display: flex; display: flex;
align-items: center;
...@@ -555,11 +517,9 @@ const handleToReportDetail = item => { ...@@ -555,11 +517,9 @@ const handleToReportDetail = item => {
} }
.card-item-text { .card-item-text {
flex: 1;
min-width: 0;
flex-direction: column; flex-direction: column;
justify-content: space-between;
display: flex; display: flex;
...@@ -592,6 +552,7 @@ const handleToReportDetail = item => { ...@@ -592,6 +552,7 @@ const handleToReportDetail = item => {
height: 16px; height: 16px;
margin-left: 9px; margin-left: 9px;
margin-top: 3px; margin-top: 3px;
cursor: pointer;
} }
} }
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<div class="footer-card-footer"> <div class="footer-card-footer">
<div class="time">{{ formatDate(item.startDate) }}</div> <div class="time">{{ formatDate(item.startDate) }}</div>
<div class="from">{{ item.thinkTankName }}</div> <div class="from">{{ item.thinktankName }}</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</div> </div>
<div class="footer-card-footer"> <div class="footer-card-footer">
<div class="time">{{ formatDate(item.startDate) }}</div> <div class="time">{{ formatDate(item.startDate) }}</div>
<div class="from">{{ item.thinkTankName }}</div> <div class="from">{{ item.thinktankName }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -180,12 +180,14 @@ const handleTimeGroupChange = (val) => { ...@@ -180,12 +180,14 @@ const handleTimeGroupChange = (val) => {
flex-wrap: wrap; flex-wrap: wrap;
gap: 16px 16px; gap: 16px 16px;
.footer-card { .footer-card {
width: 398px; width: 398px;
height: 300px; height: 300px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1); box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
cursor: pointer;
.footer-card-top { .footer-card-top {
width: 364px; width: 364px;
......
...@@ -58,35 +58,34 @@ ...@@ -58,35 +58,34 @@
<div class="right"> <div class="right">
<div class="card-box"> <div class="card-box">
<div class="card-content"> <div class="card-content">
<div v-for="(item, index) in displayList" :key="item.id ?? index"> <div v-for="(item, index) in hearingData" :key="item.id ?? index">
<div class="card-item" @click="emit('report-click', item)"> <div class="card-item">
<img class="card-item-img" src="../ThinkTankDetail/thinkDynamics/images/img congress.png" <img class="card-item-img" :src=item.coverImgUrl alt="report image" />
alt="report image" />
<div class="card-item-text"> <div class="card-item-text">
<div class="card-item-title"> <div class="card-item-title">
{{ item.title }} {{ item.titleZh }}
</div> </div>
<div class="card-item-time"> <div class="card-item-time">
{{ item.time + ' · ' + item.content }} {{ item.testimonyDate + ' · ' + item.committeeZh }}
<img src="../ThinkTankDetail/thinkDynamics/images/image open.png" alt="open icon" <img src="../ThinkTankDetail/thinkDynamics/images/image open.png" alt="open icon"
class="card-open-image" /> class="card-open-image" @click="emit('report-click', item)" />
</div> </div>
<div class="card-item-category"> <div class="card-item-category" v-if="item.category">
<AreaTag :key="`cat-${item.id}`" :tagName="item.category" /> <AreaTag :key="`cat-${item.id}`" :tagName="item.category" />
</div> </div>
</div> </div>
</div> </div>
<div class="divider" v-if="index !== displayList.length - 1"></div> <div class="divider" v-if="index !== hearingData.length - 1"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="right-footer"> <div class="right-footer">
<div class="info"> <div class="info">
{{ filteredHearingData.length }} 篇智库报告 {{ hearingData.length }} 篇智库报告
</div> </div>
<div class="page-box"> <div class="page-box">
<el-pagination :page-size="pageSize" background layout="prev, pager, next" :total="filteredHearingData.length" <el-pagination :page-size="pageSize" background layout="prev, pager, next" :total="total"
@current-change="handlePageChange" :current-page="currentPage" /> @current-change="handlePageChange" :current-page="currentPage" />
</div> </div>
</div> </div>
...@@ -112,6 +111,8 @@ import { ...@@ -112,6 +111,8 @@ import {
const props = defineProps({ const props = defineProps({
researchTypeList: { type: Array, default: () => [] }, researchTypeList: { type: Array, default: () => [] },
researchTimeList: { type: Array, default: () => [] }, researchTimeList: { type: Array, default: () => [] },
hearingData: { type: Array, default: () => [] },
total: { type: Number, default: 0 }
}); });
const emit = defineEmits(["report-click"]); const emit = defineEmits(["report-click"]);
...@@ -123,25 +124,10 @@ const selectedResearchIds = ref([RESOURCE_FILTER_ALL_AREA]); ...@@ -123,25 +124,10 @@ const selectedResearchIds = ref([RESOURCE_FILTER_ALL_AREA]);
const selectedResearchTimeIds = ref([RESOURCE_FILTER_ALL_TIME]); const selectedResearchTimeIds = ref([RESOURCE_FILTER_ALL_TIME]);
const selectedResearchHearingIds = ref([RESOURCE_FILTER_ALL_DEPT]); const selectedResearchHearingIds = ref([RESOURCE_FILTER_ALL_DEPT]);
const hearingData = ref([
{ id: 1, title: "美国国会听证会:人工智能与国家安全", content: "美中经济与安全审查委员会", category: "人工智能", time: "2025年7月8日" },
{ id: 2, title: "美国国会听证会:先进制造供应链韧性", content: "国会-行政部门中国委员会", category: "先进制造", time: "2025年6月15日" },
{ id: 3, title: "美国国会听证会:半导体出口管制与产业政策", content: "美国商务部", category: "半导体", time: "2025年5月22日" },
{ id: 4, title: "美国国会听证会:人工智能与国家安全", content: "美中经济与安全审查委员会", category: "人工智能", time: "2025年7月8日" },
{ id: 5, title: "美国国会听证会:先进制造供应链韧性", content: "国会-行政部门中国委员会", category: "先进制造", time: "2025年6月15日" },
{ id: 6, title: "美国国会听证会:半导体出口管制与产业政策", content: "美国商务部", category: "半导体", time: "2025年5月22日" },
{ id: 7, title: "美国国会听证会:人工智能与国家安全", content: "美中经济与安全审查委员会", category: "人工智能", time: "2025年7月8日" },
{ id: 8, title: "美国国会听证会:先进制造供应链韧性", content: "国会-行政部门中国委员会", category: "先进制造", time: "2025年6月15日" },
{ id: 9, title: "美国国会听证会:半导体出口管制与产业政策", content: "美国商务部", category: "半导体", time: "2025年5月22日" },
{ id: 10, title: "美国国会听证会:人工智能与国家安全", content: "美中经济与安全审查委员会", category: "人工智能", time: "2025年7月8日" },
{ id: 11, title: "美国国会听证会:先进制造供应链韧性", content: "国会-行政部门中国委员会", category: "先进制造", time: "2025年6月15日" },
{ id: 12, title: "美国国会听证会:半导体出口管制与产业政策", content: "美国商务部", category: "半导体", time: "2025年5月22日" },
]);
const researchHearingList = ref([ const researchHearingList = ref([
{ id: "美中经济与安全审查委员会", name: "美中经济与安全审查委员会" },
{ id: "国会-行政部门中国委员会", name: "国会-行政部门中国委员会" },
{ id: "美国商务部", name: "美国商务部" },
]); ]);
const handleAreaGroupChange = (val) => { const handleAreaGroupChange = (val) => {
...@@ -159,39 +145,9 @@ const handleDeptGroupChange = (val) => { ...@@ -159,39 +145,9 @@ const handleDeptGroupChange = (val) => {
currentPage.value = 1; currentPage.value = 1;
}; };
const filteredHearingData = computed(() => {
const areaSel = stripAllAreaForRequest(selectedResearchIds.value);
const timeSel = stripAllTimeForRequest(selectedResearchTimeIds.value);
const deptSel = stripAllDeptForRequest(selectedResearchHearingIds.value);
return (hearingData.value || []).filter(item => {
const matchYear =
timeSel.length === 0 ||
timeSel.some(sel => {
if (sel === RESOURCE_FILTER_EARLIER) {
return matchesEarlierChineseDate(item.time);
}
return String(item.time || "").startsWith(String(sel));
});
const matchDepartment =
deptSel.length === 0 ||
deptSel.some(department =>
String(item.content || "").includes(department) || String(item.title || "").includes(department)
);
const matchType =
areaSel.length === 0 ||
areaSel.some(typeId =>
String(item.category || "").includes(String(typeId)) || String(item.title || "").includes(String(typeId))
);
return matchYear && matchDepartment && matchType;
});
});
const displayList = computed(() => {
const list = filteredHearingData.value || [];
const start = (currentPage.value - 1) * pageSize;
return list.slice(start, start + pageSize);
});
const handlePageChange = page => { const handlePageChange = page => {
currentPage.value = page; currentPage.value = page;
...@@ -335,7 +291,7 @@ const handlePageChange = page => { ...@@ -335,7 +291,7 @@ const handlePageChange = page => {
width: 100%; width: 100%;
height: 77px; height: 77px;
display: flex; display: flex;
align-items: center;
.card-item-img { .card-item-img {
width: 56px; width: 56px;
...@@ -345,8 +301,8 @@ const handlePageChange = page => { ...@@ -345,8 +301,8 @@ const handlePageChange = page => {
} }
.card-item-text { .card-item-text {
flex: 1;
min-width: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -375,6 +331,7 @@ const handlePageChange = page => { ...@@ -375,6 +331,7 @@ const handlePageChange = page => {
height: 16px; height: 16px;
margin-left: 9px; margin-left: 9px;
margin-top: 3px; margin-top: 3px;
cursor: pointer;
} }
} }
......
...@@ -367,7 +367,8 @@ ...@@ -367,7 +367,8 @@
@report-click="handleToSurveyProjectView" @page-change="handleSurveyCurrentChange" /> @report-click="handleToSurveyProjectView" @page-change="handleSurveyCurrentChange" />
<ThinkTankCongressHearingOverview v-else-if="activeCate === '国会听证会'" :key="`congress-${resourceTabResetKey}`" <ThinkTankCongressHearingOverview v-else-if="activeCate === '国会听证会'" :key="`congress-${resourceTabResetKey}`"
:research-type-list="areaList" :research-time-list="pubTimeList" @report-click="handleToReportDetail" /> :hearing-data="hearingData" :research-type-list="areaList" :research-time-list="pubTimeList"
:total="projectTotal" @report-click="handleToHearingDetail" />
<ThinkTankPolicyAdviceOverview v-else :key="`policy-${resourceTabResetKey}`" :research-type-list="areaList" <ThinkTankPolicyAdviceOverview v-else :key="`policy-${resourceTabResetKey}`" :research-type-list="areaList"
:research-time-list="pubTimeList" :list="policyFooterList" :total="policyTotal" :research-time-list="pubTimeList" :list="policyFooterList" :total="policyTotal"
...@@ -408,7 +409,8 @@ import { ...@@ -408,7 +409,8 @@ import {
getThinkTankOverviewPolicy, getThinkTankOverviewPolicy,
getThinkTankReportNews, getThinkTankReportNews,
getThinkTankReportRemarks, getThinkTankReportRemarks,
getThinkTankProjects getThinkTankProjects,
getThinkTankTestimonies
} from "@/api/thinkTank/overview"; } from "@/api/thinkTank/overview";
import { getPersonSummaryInfo } from "@/api/common/index"; import { getPersonSummaryInfo } from "@/api/common/index";
import getMultiLineChart from "./utils/multiLineChart"; import getMultiLineChart from "./utils/multiLineChart";
...@@ -433,7 +435,8 @@ import { ...@@ -433,7 +435,8 @@ import {
stripAllTimeForRequest, stripAllTimeForRequest,
buildNumericYearsQueryString, buildNumericYearsQueryString,
isSelectionCoveringAllOptions, isSelectionCoveringAllOptions,
getResourceLibraryReportDateRangeFromTimeSelection getResourceLibraryReportDateRangeFromTimeSelection,
} from "./utils/resourceLibraryFilters"; } from "./utils/resourceLibraryFilters";
import Message1 from "./assets/images/message-icon1.png"; import Message1 from "./assets/images/message-icon1.png";
...@@ -553,6 +556,8 @@ const getStatCountInfo = async () => { ...@@ -553,6 +556,8 @@ const getStatCountInfo = async () => {
}; };
//国会听证会数据
const hearingData = ref([]);
const searchThinktankText = ref(""); //搜索科技人物及观点 const searchThinktankText = ref(""); //搜索科技人物及观点
// 智库列表 // 智库列表
const cardList = ref([ const cardList = ref([
...@@ -1638,6 +1643,7 @@ const handleClickCate = cate => { ...@@ -1638,6 +1643,7 @@ const handleClickCate = cate => {
handleGetThinkTankPolicyAdvice(); handleGetThinkTankPolicyAdvice();
} else if (cate === "国会听证会") { } else if (cate === "国会听证会") {
resetResourceTabCommon() resetResourceTabCommon()
handleGetThinkTankHearings();
} }
}; };
...@@ -1787,6 +1793,8 @@ const surveySort = ref(null); ...@@ -1787,6 +1793,8 @@ const surveySort = ref(null);
const surveyFooterList = ref([]); const surveyFooterList = ref([]);
const surveyCurrentPage = ref(1); const surveyCurrentPage = ref(1);
const surveyTotal = ref(0); const surveyTotal = ref(0);
//国会听证会总数
const projectTotal = ref(0);
const handleSurveyFilterChange = () => { const handleSurveyFilterChange = () => {
surveyCurrentPage.value = 1; surveyCurrentPage.value = 1;
...@@ -1817,7 +1825,22 @@ const handleGetThinkTankSurvey = async () => { ...@@ -1817,7 +1825,22 @@ const handleGetThinkTankSurvey = async () => {
console.error("获取调查项目 error", error); console.error("获取调查项目 error", error);
} }
}; };
const handleGetThinkTankHearings = async () => {
try {
const res = await getThinkTankTestimonies();
if (res.code === 200 && res.data) {
hearingData.value = res.data.content;
projectTotal.value = res.data.totalElements;
} else {
hearingData.value = [];
projectTotal.value = 0;
}
} catch (error) {
console.error("获取调查项目 error", error);
}
};
// ===== 政策建议:独立状态(不影响智库报告/调查项目)===== // ===== 政策建议:独立状态(不影响智库报告/调查项目)=====
const policyFooterList = ref([]); const policyFooterList = ref([]);
const policyCurrentPage = ref(1); const policyCurrentPage = ref(1);
...@@ -2058,6 +2081,16 @@ const handleToReportDetail = item => { ...@@ -2058,6 +2081,16 @@ const handleToReportDetail = item => {
}); });
window.open(route.href, "_blank"); window.open(route.href, "_blank");
}; };
const handleToHearingDetail = item => {
window.sessionStorage.setItem("curTabName", item.titleZh);
const route = router.resolve({
name: "CongressHearingView",
params: {
id: item.id
}
});
window.open(route.href, "_blank");
};
const handleToSurveyProjectView = item => { const handleToSurveyProjectView = item => {
window.sessionStorage.setItem("curTabName", item.name); window.sessionStorage.setItem("curTabName", item.name);
const route = router.resolve({ const route = router.resolve({
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</div> </div>
<div class="header-top-right"> <div class="header-top-right">
<div class="image-name-box"> <div class="image-name-box">
<div class="image"> <img :src=thinkInfo.thinkTankLogoUrl alt="" /></div> <div class="image"><img :src="thinkInfo.thinkTankLogoUrl" alt="" /></div>
<div class="name">{{ thinkInfo.thinkTankName }}</div> <div class="name">{{ thinkInfo.thinkTankName }}</div>
</div> </div>
<div class="time">{{ thinkInfo.times }}</div> <div class="time">{{ thinkInfo.times }}</div>
...@@ -242,14 +242,38 @@ const handleDownload = async () => { ...@@ -242,14 +242,38 @@ const handleDownload = async () => {
} }
} }
/** 接口可能返回对象或数组;字段名兼容 snake/camel */
const normalizeReportSummaryRow = (row) => {
if (!row || typeof row !== "object") return {};
return {
...row,
name: row.name || "",
imageUrl: row.imageUrl || row.image || "",
ename: row.ename || row.nameEn || row.englishName || "",
times: row.times || row.postDate || "",
thinkTankName: row.thinkTankName || row.thinktankName || "",
thinkTankLogoUrl: row.thinkTankLogoUrl || row.thinktankLogo || ""
};
};
const applyReportOriginalDocumentTitle = (title) => {
const text = String(title || "").trim();
if (!text) return;
window.sessionStorage.setItem("reportOriginalTabName", text);
document.title = text;
};
// 获取报告全局信息 // 获取报告全局信息
const handleGetThinkTankReportSummary = async () => { const handleGetThinkTankReportSummary = async () => {
try { try {
const res = await getThinkTankReportSummary(router.currentRoute._value.params.id); const res = await getThinkTankReportSummary(router.currentRoute._value.params.id);
console.log("报告全局信息", res); console.log("报告全局信息", res);
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
const raw = res.data;
thinkInfo.value = res.data const first = Array.isArray(raw) ? raw[0] : raw;
const normalized = normalizeReportSummaryRow(first);
thinkInfo.value = normalized;
applyReportOriginalDocumentTitle(normalized.name);
} }
} catch (error) { } catch (error) {
console.error("获取报告全局信息error", error); console.error("获取报告全局信息error", error);
......
...@@ -40,7 +40,7 @@ const getPieChart = (data) => { ...@@ -40,7 +40,7 @@ const getPieChart = (data) => {
const value = params.value ?? ""; const value = params.value ?? "";
const percent = params.percent != null ? Math.round(params.percent) : 0; const percent = params.percent != null ? Math.round(params.percent) : 0;
return `{name|${name}}\n{time|${value} ${percent}%}`; return `{name|${name}}\n{time| ${percent}%}`;
}, },
minMargin: 5, minMargin: 5,
edgeDistance: 10, edgeDistance: 10,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论