提交 d4ef0ffe authored 作者: coderBryanFu's avatar coderBryanFu

feat:goToPage文件夹新增解码文件getDecode.js,修改数据资源库标题

上级 d969b887
...@@ -180,11 +180,13 @@ const homeTitleList = computed(() => { ...@@ -180,11 +180,13 @@ const homeTitleList = computed(() => {
disabled: false disabled: false
}] }]
if (route.path.includes('/dataLibrary')) { // if (route.path.includes('/dataLibrary')) {
return dataLibraryTitleList // return dataLibraryTitleList
} else { // } else {
// return mainTitleList
// }
return mainTitleList return mainTitleList
}
}); });
const homeActiveTitleIndex = computed(() => { const homeActiveTitleIndex = computed(() => {
......
...@@ -112,7 +112,7 @@ const routes = [ ...@@ -112,7 +112,7 @@ const routes = [
component: DataLibrary, component: DataLibrary,
meta: { meta: {
title: '数据资源库', title: '数据资源库',
isShowHeader: true isShowHeader: false
}, },
children: [ children: [
...dataRoutes ...dataRoutes
......
// 解码
export const getDecodedParams = () => {
if (window.location.search) {
const urlParams = new URLSearchParams(window.location.search)
const encoded = urlParams.get('data')
if (!encoded) return null;
try {
// Base64 解码
const decoded = atob(encoded);
const jsonStr = decodeURIComponent(decoded);
return JSON.parse(jsonStr);
} catch (e) {
console.error('解码失败', e);
return null;
}
} else {
const obj = router.currentRoute.value.params
const encoded = Object.values(obj)[0]
if (!encoded) return null;
try {
// Base64 解码
const decoded = atob(encoded);
const jsonStr = decodeURIComponent(decoded);
return jsonStr;
} catch (e) {
console.error('解码失败', e);
return null;
}
}
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ import getQuarterRange from './getQuarterRange'; ...@@ -4,7 +4,7 @@ import getQuarterRange from './getQuarterRange';
import * as echarts from 'echarts' import * as echarts from 'echarts'
import 'echarts-wordcloud'; import 'echarts-wordcloud';
import router from '@/router/index' import router from '@/router/index'
import { goToDataCountryBill, goToDataDecree, goToDataThinkTank } from './goToPage'; // import { goToDataCountryBill, goToDataDecree, goToDataThinkTank } from './goToPage';
import goToPage from './goToPage/index'; import goToPage from './goToPage/index';
const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => { const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => {
let chartDom = document.getElementById(chartId); let chartDom = document.getElementById(chartId);
...@@ -97,7 +97,7 @@ const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => { ...@@ -97,7 +97,7 @@ const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => {
// }); // });
// window.open(route.href, "_blank"); // window.open(route.href, "_blank");
} }
goToDataDecree(selectParam) goToPage.goToDataDecree(selectParam)
break break
case '科技智库报告': case '科技智库报告':
...@@ -106,11 +106,11 @@ const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => { ...@@ -106,11 +106,11 @@ const setChart = (option, chartId, allowClick, selectParam, otherAreaList) => {
const year = params.name.slice(0, 4) const year = params.name.slice(0, 4)
const quatarNum = Number(params.name[params.name.length - 1]) const quatarNum = Number(params.name[params.name.length - 1])
selectParam.selectedDate = JSON.stringify(getQuarterRange(year, quatarNum)) selectParam.selectedDate = JSON.stringify(getQuarterRange(year, quatarNum))
goToDataThinkTank(selectParam); goToPage.goToDataThinkTank(selectParam);
return return
} else if (selectParam.key === 2) { } else if (selectParam.key === 2) {
selectParam.domains = params.name selectParam.domains = params.name
goToDataThinkTank(selectParam); goToPage.goToDataThinkTank(selectParam);
return return
} }
} }
......
...@@ -174,6 +174,7 @@ import { search, getStatusList } from '@/api/comprehensiveSearch' ...@@ -174,6 +174,7 @@ import { search, getStatusList } from '@/api/comprehensiveSearch'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import getDateRange from '@/utils/getDateRange' import getDateRange from '@/utils/getDateRange'
import { getDecodedParams } from '@/utils/goToPage' import { getDecodedParams } from '@/utils/goToPage'
import goToPage from '@/utils/goToPage/index'
const route = useRoute(); const route = useRoute();
...@@ -1152,7 +1153,7 @@ const handleDownloadCurChartData = () => { ...@@ -1152,7 +1153,7 @@ const handleDownloadCurChartData = () => {
// 跳转到当前页 初始化筛选条件 // 跳转到当前页 初始化筛选条件
const initParam = () => { const initParam = () => {
const routeQuery = getDecodedParams() const routeQuery = goToPage.getDecodedParams()
console.log('routeQuery',routeQuery); console.log('routeQuery',routeQuery);
const hasQuery = Object.keys(routeQuery).length > 0; const hasQuery = Object.keys(routeQuery).length > 0;
...@@ -1213,30 +1214,31 @@ const initParam = () => { ...@@ -1213,30 +1214,31 @@ const initParam = () => {
// 跳转法案详情 // 跳转法案详情
const handleClickToDetail = (curBill) => { const handleClickToDetail = (curBill) => {
console.log('curBill', curBill); // console.log('curBill', curBill);
// window.sessionStorage.setItem("billId", curBill.id);
window.sessionStorage.setItem("billId", curBill.id); // window.sessionStorage.setItem("curTabName", curBill.title);
window.sessionStorage.setItem("curTabName", curBill.title); // const route = router.resolve({
const route = router.resolve({ // path: "/billLayout",
path: "/billLayout", // query: {
query: { // billId: curBill.id
billId: curBill.id // }
} // });
}); // window.open(route.href, "_blank");
window.open(route.href, "_blank"); goToPage.goToBill(curBill.id, curBill.title)
}; };
// 跳转人物详情 // 跳转人物详情
const handlePerClick = item => { const handlePerClick = item => {
window.sessionStorage.setItem("curTabName", item.sponsorPersonName); // window.sessionStorage.setItem("curTabName", item.sponsorPersonName);
const route = router.resolve({ // const route = router.resolve({
path: "/characterPage", // path: "/characterPage",
query: { // query: {
type: 2, // type: 2,
personId: item.personId // personId: item.personId
} // }
}); // });
window.open(route.href, "_blank"); // window.open(route.href, "_blank");
goToPage.goToCharacterPage(item.personId, item.sponsorPersonName)
}; };
// 导出 // 导出
......
...@@ -187,6 +187,7 @@ import getDateRange from '@/utils/getDateRange' ...@@ -187,6 +187,7 @@ import getDateRange from '@/utils/getDateRange'
import { getDepartmentList } from "@/api/decree/home"; import { getDepartmentList } from "@/api/decree/home";
import { getDecodedParams } from '@/utils/goToPage' import { getDecodedParams } from '@/utils/goToPage'
import goToPage from '@/utils/goToPage/index'
const route = useRoute(); const route = useRoute();
...@@ -976,7 +977,7 @@ const handleDownloadCurChartData = () => { ...@@ -976,7 +977,7 @@ const handleDownloadCurChartData = () => {
// 跳转到当前页 初始化筛选条件 // 跳转到当前页 初始化筛选条件
const initParam = () => { const initParam = () => {
const routeQuery = getDecodedParams() const routeQuery = goToPage.getDecodedParams()
const hasQuery = Object.keys(routeQuery).length > 0; const hasQuery = Object.keys(routeQuery).length > 0;
if (hasQuery) { if (hasQuery) {
if (routeQuery.selectedAreaList) { if (routeQuery.selectedAreaList) {
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
<div class="data-library-wrapper"> <div class="data-library-wrapper">
<div class="data-library-main"> <div class="data-library-main">
<div class="data-library-sider"> <div class="data-library-sider">
<div class="sider-header">
<div class="logo">
<img src="@/assets/icons/overview/logo.png" alt="">
</div>
<div class="title text-title-1-show">{{ '数据资源库' }}</div>
</div>
<div class="sider-item-box" v-for="(item, index) in siderList" :key="index"> <div class="sider-item-box" v-for="(item, index) in siderList" :key="index">
<div class="sider-item" @click="handleSiderItem(item)"> <div class="sider-item" @click="handleSiderItem(item)">
<div class="sider-icon"> <div class="sider-icon">
...@@ -626,6 +632,24 @@ onBeforeUnmount(() => { ...@@ -626,6 +632,24 @@ onBeforeUnmount(() => {
width: 320px; width: 320px;
background: rgb(255, 255, 255); background: rgb(255, 255, 255);
border-right: 1px solid rgba(234, 236, 238, 1); border-right: 1px solid rgba(234, 236, 238, 1);
.sider-header{
height: 64px;
display: flex;
gap: 23px;
align-items: center;
.logo{
margin-left: 24px;
width: 30px;
height: 30px;
img{
width: 100%;
height: 100%;
}
}
.title{
color: var(--color-primary-100);
}
}
.sider-item { .sider-item {
height: 54px; height: 54px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论