提交 a00f73d3 authored 作者: 张烨's avatar 张烨

fix:政令主页-修改网页标题显示异常

上级 95d83001
流水线 #338 已通过 于阶段
in 1 分 50 秒
......@@ -408,17 +408,12 @@
<div class="title">{{ "科技领域" }}</div>
</div>
<div class="select-main">
<div class="checkbox-group">
<el-checkbox v-model="activeAreaList" label="all" style="width: 100px" class="filter-checkbox"
@change="checked => handleAreaChange('all', checked)">
{{ "全部领域" }}
</el-checkbox>
<el-checkbox v-for="area in areaList" :key="area.id" v-model="activeAreaList" :label="area.id"
style="width: 100px" class="filter-checkbox"
@change="checked => handleAreaChange(area.id, checked)">
<el-checkbox-group class="checkbox-group" v-model="activeAreaList" @change="handleAreaChange">
<el-checkbox label="" class="filter-checkbox">{{ "全部领域" }}</el-checkbox>
<el-checkbox v-for="area in areaList" :key="area.id" :label="area.id" class="filter-checkbox">
{{ area.name }}
</el-checkbox>
</div>
</el-checkbox-group>
</div>
</div>
<div class="select-box">
......@@ -427,13 +422,11 @@
<div class="title">{{ "发布时间" }}</div>
</div>
<div class="select-main">
<div class="checkbox-group">
<el-checkbox v-for="time in pubTime" :key="time.id" v-model="activePubTime" :label="time.id"
style="width: 100px" class="filter-checkbox"
@change="checked => handlePubTimeChange(time.id, checked)">
<el-checkbox-group class="checkbox-group" v-model="activePubTime" @change="handlePubTimeChange">
<el-checkbox v-for="time in pubTime" :key="time.id" :label="time.id" class="filter-checkbox">
{{ time.name }}
</el-checkbox>
</div>
</el-checkbox-group>
</div>
</div>
</div>
......@@ -623,7 +616,6 @@ const handleClickOrder = () => {
// 跳转政令详情
const onNavigateToDetail = (item) => {
window.sessionStorage.setItem("curTabName", item.name || item.title || item.signalTitle);
const route = router.resolve({
path: "/decreeLayout",
query: { id: item.orderId || item.id }
......@@ -1117,7 +1109,7 @@ const handleChangeCheckedDecreeType = () => {
};
const pubTime = ref([
{ id: "all", name: "全部时间" },
{ id: "", name: "全部时间" },
{ id: "2026", name: "2026年" },
{ id: "2025", name: "2025年" },
{ id: "2024", name: "2024年" },
......@@ -1128,41 +1120,26 @@ const pubTime = ref([
]);
const activePubTime = ref(["2026"]);
// 处理发布时间全选逻辑
const handlePubTimeChange = (id, checked) => {
const allIds = pubTime.value.filter(item => item.id !== "all").map(item => item.id);
if (id === "all") {
// 点击全选:选中所有或清空所有
activePubTime.value = checked ? ["all", ...allIds] : [];
const handlePubTimeChange = (event) => {
if (event.length && event[event.length-1] !== "") {
activePubTime.value = event.filter(item => item !== "");
} else {
const selectedIds = activePubTime.value.filter(itemId => itemId !== "all");
const isAllSelected = selectedIds.length === allIds.length;
if (isAllSelected && !activePubTime.value.includes("all")) {
// 手动选中了所有年份,自动勾选全选
activePubTime.value = ["all", ...allIds];
} else if (!isAllSelected && activePubTime.value.includes("all")) {
// 取消某个选项,取消全选状态
activePubTime.value = selectedIds;
}
activePubTime.value = [""];
}
currentPage.value = 1;
handleGetDecreeOrderList();
};
const handleAreaChange = (id, checked) => {
const allIds = areaList.value.map(item => item.id);
if (id === "all") {
activeAreaList.value = checked ? ["all", ...allIds] : [];
const activeAreaList = ref([""]);
const handleAreaChange = (event) => {
if (event.length && event[event.length-1] !== "") {
activeAreaList.value = event.filter(item => item !== "");
} else {
const selectedIds = activeAreaList.value.filter(itemId => itemId !== "all");
const isAllSelected = selectedIds.length === allIds.length;
if (isAllSelected && !activeAreaList.value.includes("all")) {
activeAreaList.value = ["all", ...allIds];
} else if (!isAllSelected && activeAreaList.value.includes("all")) {
activeAreaList.value = selectedIds;
}
activeAreaList.value = [""];
}
currentPage.value = 1;
handleGetDecreeOrderList();
};
const areaList = ref([
......@@ -1171,7 +1148,7 @@ const areaList = ref([
// { id: "通信网络", name: "通信网络" },
// { id: "量子科技", name: "量子科技" }
]);
const activeAreaList = ref(["1"]);
// 修改获取科技领域列表,添加全选选项
const handleGetAreaList = async () => {
try {
......@@ -1179,8 +1156,6 @@ const handleGetAreaList = async () => {
console.log("行业领域列表", res);
if (res.code === 200 && res.data) {
areaList.value = res.data;
// 设置默认全选
activeAreaList.value = ["all", ...res.data.map(item => item.id)];
// 获取列表后重新查询
handleGetDecreeOrderList();
}
......@@ -1193,37 +1168,14 @@ const decreeList = ref([]);
// 修改请求方法,处理全选时不传参数的情况
const handleGetDecreeOrderList = async () => {
// 处理科技领域:如果包含 all 或全选,则 researchTypeIds 为空(不传)
let p1 = "";
const allAreaIds = areaList.value.map(item => item.id);
const selectedAreaIds = activeAreaList.value.filter(id => id !== "all");
if (!activeAreaList.value.includes("all") && selectedAreaIds.length > 0 && selectedAreaIds.length < allAreaIds.length) {
p1 = selectedAreaIds.join(",");
}
// 其他情况(包含all、长度为0、全部选中)p1保持为空,即不传researchTypeIds
// 处理发布时间:如果包含 all 或全选,则 years 为空(不传)
let p2 = "";
const allPubTimeIds = pubTime.value.filter(item => item.id !== "all").map(item => item.id);
const selectedPubTimeIds = activePubTime.value.filter(id => id !== "all");
if (
!activePubTime.value.includes("all") &&
selectedPubTimeIds.length > 0 &&
selectedPubTimeIds.length < allPubTimeIds.length
) {
p2 = selectedPubTimeIds.join(",");
}
// 其他情况(包含all、长度为0、全部选中)p2保持为空,即不传years
const params = {
currentPage: currentPage.value,
pageSize: pageSize.value,
researchTypeIds: p1, // 全选时不传(为空)
researchTypeIds: activeAreaList.value.join(',') || null,
sortFun: isSort.value,
isCN: isChina.value ? 1 : 0,
proposeName: searchType.value,
years: p2, // 全选时不传(为空)
years: activePubTime.value.join(',') || null,
typeIds: checkedDecreeType.value.toString()
};
......@@ -1253,7 +1205,7 @@ const handleGetDecreeOrderList = async () => {
}
};
watch([activePubTime, activeAreaList, checkedGovIns, isSort, isChina, searchType], val => {
watch([checkedGovIns, isSort, isChina, searchType], val => {
// 切换页码到第一页
currentPage.value = 1;
handleGetDecreeOrderList();
......@@ -1268,21 +1220,6 @@ const handleSwithCurDecree = name => {
}
};
// 搜索
const searchDecreeText = ref("");
const handleSearch = () => {
window.sessionStorage.setItem("curTabName", `搜索-${searchDecreeText.value}`);
const curRoute = router.resolve({
path: "/searchResults",
query: {
searchText: searchDecreeText.value,
areaName: "政令"
}
});
window.open(curRoute.href, "_blank");
};
// 关键机构
const keyOrganizationList = ref([]);
const onKeyOrganization = async (event) => {
......@@ -2477,7 +2414,7 @@ onMounted(async () => {
gap: 8px 4px;
.filter-checkbox {
width: 160px;
width: 100px;
height: 24px;
margin-right: 0 !important;
}
......
......@@ -214,13 +214,17 @@ const handleClickMainHeaderBtn = item => {
// 获取全局信息
const summaryInfo = ref({});
const handleGetSummary = async () => {
let pageTitle = "科技政令主页"
try {
const res = await getDecreeSummary({ id: route.query.id });
console.log("全局信息", res);
if (res.code === 200 && res.data) {
summaryInfo.value = res.data;
pageTitle = res.data.name || '科技政令主页';
}
} catch (error) { }
} catch (error) {}
document.title = pageTitle;
window.sessionStorage.setItem("curTabName", pageTitle);
};
// 获取报告原文
......@@ -280,7 +284,6 @@ const handleAnalysisClick = () => {
onMounted(() => {
handleGetSummary();
console.log(route.path);
if (route.path === "/decreeLayout/overview/introduction" || route.path === "/decreeLayout/overview/background" || route.path === "/decreeLayout/overview/measures") {
activeTitle.value = "政令概况";
} else if (route.path === "/decreeLayout/deepDig") {
......
......@@ -78,9 +78,7 @@
<div class="time-line-icon">
<img style="width: 100%; height: 100%;" :src="item.orgImage || DefaultIcon1" alt="">
</div>
<div class="time-line-name text-click-hover" @click="handleToInstitution(item)">{{
item.proposeOrgName
}}</div>
<div class="time-line-name text-click-hover" @click="handleToInstitution(item)">{{ item.proposeOrgName }}</div>
</div>
<div class="timeline-content" @click="handleClickDecree(item)">{{ item.describe }}</div>
</div>
......@@ -174,6 +172,7 @@ const handleGetPrev = async () => {
};
// 跳转行政机构主页
const handleToInstitution = item => {
window.sessionStorage.setItem("curTabName", item.proposeOrgName);
const curRoute = router.resolve({
path: "/institution",
query: {
......@@ -225,7 +224,6 @@ const handleGetLaws = async () => {
};
// 跳转科技法案详情页
const handleClickBull = decree => {
window.sessionStorage.setItem("billId", decree.billId);
window.sessionStorage.setItem("curTabName", decree.title);
const route = router.resolve({
path: "/billLayout",
......@@ -233,8 +231,6 @@ const handleClickBull = decree => {
billId: decree.billId
}
});
console.log(route);
window.open(route.href, "_blank");
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论