提交 bff854a8 authored 作者: 朱政's avatar 朱政

feat:修改调查项目及国会听证会部分入参,完善相关功能

上级 43550109
流水线 #286 已通过 于阶段
in 1 分 32 秒
......@@ -196,7 +196,8 @@ export function getChartAnalysis(data, options = {}) {
},
body: JSON.stringify(data),
signal: abortController.signal,
openWhenHidden: true,
openWhenHidden: false,
retryDelay: 1000,
maxRetries: 2,
onopen: response => {
......
......@@ -112,10 +112,11 @@ export function getThinkTankProjects(params) {
})
}
//智库概览页国会听证会
export function getThinkTankTestimonies() {
export function getThinkTankTestimonies(params) {
return request({
method: 'GET',
url: `/api/think-tank/testimonies`,
params
})
}
//智库调查项目详情主页
......@@ -142,6 +143,13 @@ export function getThinkTankProjectsByThinkTankId(params) {
params: {
pageNum: params.pageNum,
pageSize: params.pageSize,
sortFun: params.sortFun,
sortField: params.sortField,
sortOrder: params.sortOrder,
domainIds: params.domainIds,
startDate: params.startDate,
endDate: params.endDate,
projectName: params.projectName,
}
})
}
......@@ -154,6 +162,11 @@ export function getThinkTankTestimoniesByThinkTankId(params) {
params: {
pageNum: params.pageNum,
pageSize: params.pageSize,
domainIds: params.domainIds,
startDate: params.startDate,
endDate: params.endDate,
title: params.title,
}
})
}
......
......@@ -849,6 +849,9 @@ onBeforeUnmount(() => {
position: absolute;
right: 0;
bottom: 18px;
width: 74px;
height: 28px;
z-index: 2;
.btn-box {
width: 74px;
......@@ -953,6 +956,9 @@ onBeforeUnmount(() => {
position: absolute;
right: 0;
bottom: 18px;
width: 74px;
height: 28px;
z-index: 2;
.btn-box {
width: 74px;
......
......@@ -83,23 +83,23 @@
<div class="text-box">
<div class="time">
<div class="time-title">发布时间:</div>
<div class="time-content">{{ publishTime }}</div>
<div class="time-content">{{ thinkInfo.testimonyDate }}</div>
</div>
<div class="topic">
<div class="topic-title">报告主题:</div>
<div class="topic-content">{{ reportTopic }}</div>
<div class="topic-title">委员会:</div>
<div class="topic-content">{{ thinkInfo.committeeZh }}</div>
</div>
<div class="author">
<div class="author-title">报告作者:</div>
<div class="author-content">
<template v-if="Array.isArray(reportAuthors) && reportAuthors.length">
<span v-if="reportAuthors.length === 1">
{{ reportAuthors[0].name }}
<template v-if="Array.isArray(thinkInfo.relatedPersons) && thinkInfo.relatedPersons.length">
<span v-if="thinkInfo.relatedPersons.length === 1">
{{ thinkInfo.relatedPersons[0].name }}
</span>
<!-- 多个作者:显示第一个 + 等 -->
<span v-else>
{{ reportAuthors[0].name }}{{ reportAuthors.length }}
{{ thinkInfo.relatedPersons[0].name }}{{ thinkInfo.relatedPersons.length }}
</span>
</template>
......@@ -107,11 +107,11 @@
</div>
</div>
<div class="author-box">
<div class="author-item" v-for="(author, idx) in reportAuthors" :key="idx"
v-if="Array.isArray(reportAuthors) && reportAuthors.length"
<div class="author-item" v-for="(author, idx) in thinkInfo.relatedPersons" :key="idx"
v-if="Array.isArray(thinkInfo.relatedPersons) && thinkInfo.relatedPersons.length"
@click="handleClickReportAuthor(author)">
<div class="image"><img :src="author.avatar ? author.avatar : DefaultIcon1" alt=""
@error="() => { if (author.avatar) author.avatar = null; }" /></div>
<div class="image"><img :src="author.avatarUrl ? author.avatarUrl : DefaultIcon1" alt=""
@error="() => { if (author.avatarUrl) author.avatarUrl = null; }" /></div>
<div class="author-text">
<div class="author-name">{{ author.name }}</div>
......@@ -932,7 +932,7 @@ onMounted(() => {
flex-direction: column;
.time {
height: 24px;
height: 30px;
display: flex;
gap: 4px;
......@@ -942,7 +942,7 @@ onMounted(() => {
font-family: "Source Han Sans CN";
font-weight: 700;
font-size: 16px;
line-height: 24px;
line-height: 30px;
letter-spacing: 1px;
text-align: left;
color: rgb(59, 65, 75);
......@@ -958,6 +958,7 @@ onMounted(() => {
letter-spacing: 0px;
text-align: left;
color: rgb(59, 65, 75);
margin-top: 3px;
}
}
......@@ -972,7 +973,7 @@ onMounted(() => {
font-family: "Source Han Sans CN";
font-weight: 700;
font-size: 16px;
line-height: 24px;
line-height: 30px;
letter-spacing: 1px;
text-align: left;
color: rgb(59, 65, 75);
......@@ -1004,7 +1005,7 @@ onMounted(() => {
font-family: "Source Han Sans CN";
font-weight: 700;
font-size: 16px;
line-height: 24px;
line-height: 30px;
letter-spacing: 1px;
text-align: left;
color: rgb(59, 65, 75);
......@@ -1016,6 +1017,7 @@ onMounted(() => {
font-family: "Source Han Sans CN";
font-weight: 400;
font-size: 16px;
margin-top: 3px;
line-height: 24px;
letter-spacing: 0px;
text-align: left;
......
......@@ -2125,6 +2125,7 @@ onMounted(async () => {
height: 16px;
margin-top: 3px;
margin-left: 9px;
cursor: pointer;
img {
width: 100%;
......@@ -2198,6 +2199,7 @@ onMounted(async () => {
height: 20px;
display: flex;
margin-top: 2px;
cursor: pointer;
.img {
width: 100%;
......
......@@ -413,8 +413,13 @@ const handleGetThinkDynamicsReport = async (payload) => {
curFooterProjectList.value = [];
const res = await getThinkTankTestimoniesByThinkTankId({
thinkTankId,
pageNum: Math.max(0, (currentPage.value || 1)),
pageSize: 10
pageNum: Math.max(0, (currentPage.value || 1) ),
pageSize: 10,
domainIds,
startDate,
endDate,
title: keyword || undefined
});
if (res.code === 200 && res.data) {
const list = Array.isArray(res.data.content) ? res.data.content : Array.isArray(res.data) ? res.data : [];
......@@ -432,7 +437,14 @@ const handleGetThinkDynamicsReport = async (payload) => {
const res = await getThinkTankProjectsByThinkTankId({
thinkTankId,
pageNum: currentPage.value,
pageSize: 12
pageSize: 12,
sortFun: sort.value === true,
sortField: "startDate",
sortOrder: sort.value === true ? "asc" : "desc",
domainIds,
startDate,
endDate,
projectName: keyword || undefined
});
if (res.code === 200 && res.data) {
curFooterProjectList.value = res.data.content || [];
......
......@@ -210,6 +210,7 @@ const formatDate = (str) => {
border-radius: 10px;
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: rgba(255, 255, 255, 1);
cursor: pointer;
.footer-card-top {
width: 364px;
......
......@@ -60,18 +60,21 @@
<div class="card-content">
<div v-for="(item, index) in hearingData" :key="item.id ?? index">
<div class="card-item">
<img class="card-item-img" :src=item.coverImgUrl alt="report image" />
<img class="card-item-img" :src="item.coverImgUrl" alt="report image" />
<div class="card-item-text">
<div class="card-item-title">
{{ item.titleZh }}
</div>
<div class="card-item-time">
{{ item.testimonyDate + ' · ' + item.committeeZh }}
{{ item.testimonyDate + ' · ' + item.thinkTankName + ' · ' + item.committeeZh }}
<img src="../ThinkTankDetail/thinkDynamics/images/image open.png" alt="open icon"
class="card-open-image" @click="emit('report-click', item)" />
</div>
<div class="card-item-category" v-if="item.category">
<AreaTag :key="`cat-${item.id}`" :tagName="item.category" />
<div class="card-item-category" v-if="item.domains">
<div v-for="(value, index) in item.domains" :key="`domain-${index}`">
<AreaTag :key="`cat-${item.id}`" :tagName="value" />
</div>
</div>
</div>
</div>
......@@ -111,17 +114,33 @@ import {
const props = defineProps({
researchTypeList: { type: Array, default: () => [] },
researchTimeList: { type: Array, default: () => [] },
selectedAreaList: { type: Array, default: () => [] },
selectedPubTimeList: { type: Array, default: () => [] },
hearingData: { type: Array, default: () => [] },
total: { type: Number, default: 0 }
total: { type: Number, default: 0 },
currentPage: { type: Number, default: 1 }
});
const emit = defineEmits(["report-click"]);
const emit = defineEmits([
"update:selectedAreaList",
"update:selectedPubTimeList",
"filter-change",
"page-change",
"report-click"
]);
const pageSize = 10;
const currentPage = ref(1);
const selectedResearchIds = ref([RESOURCE_FILTER_ALL_AREA]);
const selectedResearchTimeIds = ref([RESOURCE_FILTER_ALL_TIME]);
const selectedResearchIds = computed(() => (
Array.isArray(props.selectedAreaList) && props.selectedAreaList.length
? props.selectedAreaList
: [RESOURCE_FILTER_ALL_AREA]
));
const selectedResearchTimeIds = computed(() => (
Array.isArray(props.selectedPubTimeList) && props.selectedPubTimeList.length
? props.selectedPubTimeList
: [RESOURCE_FILTER_ALL_TIME]
));
const selectedResearchHearingIds = ref([RESOURCE_FILTER_ALL_DEPT]);
......@@ -131,13 +150,15 @@ const researchHearingList = ref([
]);
const handleAreaGroupChange = (val) => {
selectedResearchIds.value = normalizeExclusiveAllOption(val, RESOURCE_FILTER_ALL_AREA);
currentPage.value = 1;
emit("update:selectedAreaList", normalizeExclusiveAllOption(val, RESOURCE_FILTER_ALL_AREA));
emit("page-change", 1);
emit("filter-change");
};
const handleTimeGroupChange = (val) => {
selectedResearchTimeIds.value = normalizeExclusiveAllOption(val, RESOURCE_FILTER_ALL_TIME);
currentPage.value = 1;
emit("update:selectedPubTimeList", normalizeExclusiveAllOption(val, RESOURCE_FILTER_ALL_TIME));
emit("page-change", 1);
emit("filter-change");
};
const handleDeptGroupChange = (val) => {
......@@ -150,7 +171,8 @@ const handleDeptGroupChange = (val) => {
const handlePageChange = page => {
currentPage.value = page;
emit("page-change", page);
emit("filter-change");
};
</script>
......@@ -340,6 +362,7 @@ const handlePageChange = page => {
height: 24px;
display: flex;
}
}
}
......
......@@ -370,6 +370,7 @@ const handleYearGroupChange = (val) => {
height: 16px;
margin-left: 9px;
margin-top: 3px;
cursor: pointer;
img {
width: 100%;
......
......@@ -369,7 +369,9 @@
<ThinkTankCongressHearingOverview v-else-if="activeCate === '国会听证会'" :key="`congress-${resourceTabResetKey}`"
:hearing-data="hearingData" :research-type-list="areaList" :research-time-list="pubTimeList"
:total="projectTotal" @report-click="handleToHearingDetail" />
v-model:selectedAreaList="congressSelectedAreaList" v-model:selectedPubTimeList="congressSelectedPubTimeList"
:total="congressTotal" :current-page="congressCurrentPage" @filter-change="handleCongressFilterChange"
@page-change="handleCongressCurrentChange" @report-click="handleToHearingDetail" />
<ThinkTankPolicyAdviceOverview v-else :key="`policy-${resourceTabResetKey}`" :research-type-list="areaList"
:research-time-list="pubTimeList" :list="policyFooterList" :total="policyTotal"
......@@ -386,7 +388,7 @@
import RiskSignal from "@/components/base/riskSignal/index.vue";
import NewsList from "@/components/base/newsList/index.vue";
import MessageBubble from "@/components/base/messageBubble/index.vue"
import { onMounted, ref, computed, reactive, nextTick } from "vue";
import { onBeforeUnmount, onMounted, ref, computed, reactive, nextTick } from "vue";
import scrollToTop from "@/utils/scrollToTop";
import router from "@/router";
import DivideHeader from "@/components/DivideHeader.vue";
......@@ -507,6 +509,8 @@ const handleGetAllThinkTankList = async () => {
console.error("获取智库列表error", error);
}
};
let box1CarouselTimer = null;
const routerTo = useRouter()
// 跳转到全部智库页面
......@@ -1822,6 +1826,22 @@ const surveyTotal = ref(0);
//国会听证会总数
const projectTotal = ref(0);
// ===== 资源库-国会听证会:独立状态(不影响其它 tab)=====
const congressSelectedAreaList = ref([RESOURCE_FILTER_ALL_AREA]);
const congressSelectedPubTimeList = ref([RESOURCE_FILTER_ALL_TIME]);
const congressCurrentPage = ref(1);
const congressTotal = ref(0);
const handleCongressFilterChange = () => {
congressCurrentPage.value = 1;
handleGetThinkTankHearings();
};
const handleCongressCurrentChange = (page) => {
congressCurrentPage.value = page;
handleGetThinkTankHearings();
};
const handleSurveyFilterChange = () => {
surveyCurrentPage.value = 1;
handleGetThinkTankSurvey();
......@@ -1839,7 +1859,23 @@ const handleGetThinkTankSurvey = async () => {
);
try {
const res = await getThinkTankProjects();
const params = {
pageNum: surveyCurrentPage.value,
pageSize: 12,
sortField: "startDate",
sortOrder: surveySort.value === true ? "asc" : "desc",
domainIds: (() => {
const areas = stripAllAreaForRequest(surveySelectedAreaList.value);
const allAreaIds = (areaList.value || []).map((a) => a.id);
if (isSelectionCoveringAllOptions(areas, allAreaIds)) {
return "";
}
return arrayToString(areas);
})(),
startDate,
endDate
};
const res = await getThinkTankProjects(params);
if (res.code === 200 && res.data) {
surveyFooterList.value = res.data.content;
surveyTotal.value = res.data.totalElements;
......@@ -1852,16 +1888,33 @@ const handleGetThinkTankSurvey = async () => {
}
};
const handleGetThinkTankHearings = async () => {
try {
const res = await getThinkTankTestimonies();
const { startDate, endDate } = getResourceLibraryReportDateRangeFromTimeSelection(
stripAllTimeForRequest(congressSelectedPubTimeList.value),
(pubTimeList.value || []).map((x) => x.id)
);
const params = {
pageNum: congressCurrentPage.value,
pageSize: 10,
sortFun: congressResourceSort.value === true,
domainIds: (() => {
const areas = stripAllAreaForRequest(congressSelectedAreaList.value);
const allAreaIds = (areaList.value || []).map((a) => a.id);
if (isSelectionCoveringAllOptions(areas, allAreaIds)) {
return "";
}
return arrayToString(areas);
})(),
startDate,
endDate
};
const res = await getThinkTankTestimonies(params);
if (res.code === 200 && res.data) {
hearingData.value = res.data.content;
projectTotal.value = res.data.totalElements;
congressTotal.value = res.data.totalElements;
} else {
hearingData.value = [];
projectTotal.value = 0;
congressTotal.value = 0;
}
} catch (error) {
console.error("获取调查项目 error", error);
......@@ -2144,7 +2197,11 @@ onMounted(async () => {
handleGetAllThinkTankList()
await getStatCountInfo();
// 定义一个定时器,每隔2秒轮播一次
setInterval(() => {
if (box1CarouselTimer) {
clearInterval(box1CarouselTimer);
box1CarouselTimer = null;
}
box1CarouselTimer = setInterval(() => {
// 索引加1
box1DataIndex.value++;
// 如果索引大于等于数组长度,重置为0,实现循环轮播
......@@ -2167,6 +2224,13 @@ onMounted(async () => {
handleGetThinkTankReportNews();
handleGetThinkTankReportRemarks();
});
onBeforeUnmount(() => {
if (box1CarouselTimer) {
clearInterval(box1CarouselTimer);
box1CarouselTimer = null;
}
});
</script>
<style lang="scss" scoped>
......@@ -3611,6 +3675,9 @@ onMounted(async () => {
position: absolute;
right: 0;
bottom: 18px;
width: 74px;
height: 28px;
z-index: 2;
.btn-box {
width: 74px;
......@@ -3750,6 +3817,9 @@ onMounted(async () => {
position: absolute;
right: 0;
bottom: 18px;
width: 74px;
height: 28px;
z-index: 2;
.btn-box {
width: 74px;
......@@ -3926,6 +3996,9 @@ onMounted(async () => {
position: absolute;
right: 0;
bottom: 18px;
width: 74px;
height: 28px;
z-index: 2;
.btn-box {
width: 74px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论