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

更新系统头部标题部分

上级 500f8d20
...@@ -5,29 +5,12 @@ ...@@ -5,29 +5,12 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useRoute } from "vue-router";
import AiBox from "./components/AiBox.vue";
import { getPersonType } from "@/api/common/index"; import { getPersonType } from "@/api/common/index";
// import { useDraggable } from "@vueuse/core";
import Menu1 from "@/assets/icons/overview/menu1.png";
import Menu2 from "@/assets/icons/overview/menu2.png";
import Menu3 from "@/assets/icons/overview/menu3.png";
import Menu4 from "@/assets/icons/overview/menu4.png";
import Menu5 from "@/assets/icons/overview/menu5.png";
import Menu6 from "@/assets/icons/overview/menu6.png";
import Menu7 from "@/assets/icons/overview/menu7.png";
import Menu8 from "@/assets/icons/overview/menu8.png";
import Menu9 from "@/assets/icons/overview/menu9.png";
import Menu10 from "@/assets/icons/overview/menu10.png";
import Menu11 from "@/assets/icons/overview/menu11.png";
import Menu12 from "@/assets/icons/overview/menu12.png";
import { ElMessage } from "element-plus";
const router = useRouter(); const router = useRouter();
const route = useRoute();
import useTagsViewStore from '@/stores/tagsView.js' import useTagsViewStore from '@/stores/tagsView.js'
...@@ -37,7 +20,7 @@ const tagsViewStore = useTagsViewStore() ...@@ -37,7 +20,7 @@ const tagsViewStore = useTagsViewStore()
// 在路由全局守卫中处理 // 在路由全局守卫中处理
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 路由允许添加标签(排除掉隐藏的布局页如 /404, /login 等) // 路由允许添加标签(排除掉隐藏的布局页如 /404, /login 等)
if (to.path.includes('dataLibrary')) { if (to.path.indexOf('dataLibrary') > -1 ) {
tagsViewStore.addView({ tagsViewStore.addView({
path: to.path, path: to.path,
name: to.name, // 对应组件的 name,用于缓存 name: to.name, // 对应组件的 name,用于缓存
...@@ -48,17 +31,6 @@ router.beforeEach((to, from, next) => { ...@@ -48,17 +31,6 @@ router.beforeEach((to, from, next) => {
next() next()
}) })
const isShowAiBox = ref(false);
const closeAiBox = () => {
isShowAiBox.value = false;
};
const openAiBox = () => {
isShowAiBox.value = true;
};
const personTypeList = ref([]); const personTypeList = ref([]);
// 获取人物类别 // 获取人物类别
...@@ -75,146 +47,6 @@ const handleGetPersonType = async () => { ...@@ -75,146 +47,6 @@ const handleGetPersonType = async () => {
} catch (error) {} } catch (error) {}
}; };
const isCurrentOverview = computed(() => {
if (route.path === "/ZMOverView") {
return true;
} else {
return false;
}
});
// 概览页标题列表
const homeTitleList = ref([
{
name: "中美科技博弈",
path: "/ZMOverView",
disabled: false
},
{
name: "主要国家科技动向感知",
path: "",
disabled: true
},
{
name: "主要国家竞争科技安全",
path: "",
disabled: true
}
]);
const homeActiveTitleIndex = ref(0);
const isShowMenu = ref(false);
const handleShowMenu = (index, isShow) => {
if (index === 0) {
isShowMenu.value = isShow;
}
};
const handleHoverMenu = isShow => {
isShowMenu.value = isShow;
};
const menuList = ref([
{
title: "中美科技博弈概览",
icon: Menu1,
path: "/ZMOverView"
},
{
title: "科技法案",
icon: Menu2,
path: "/billHome"
},
{
title: "科技政令",
icon: Menu3,
path: "/decree"
},
{
title: "美国科技智库",
icon: Menu4,
path: "/thinkTank"
},
{
title: "出口管制",
icon: Menu5,
path: "/exportControl"
},
{
title: "科研合作限制",
icon: Menu6,
path: "/cooperationRestrictions"
},
{
title: "投融资限制",
icon: Menu7,
path: "/finance"
},
{
title: "市场准入限制",
icon: Menu8,
path: "/marketAccessRestrictions"
},
{
title: "规则限制",
icon: Menu9,
path: "/ruleRestrictions"
},
{
title: "美国科技人物观点",
icon: Menu10,
path: "/technologyFigures"
},
{
title: "美国主要创新主体动向",
icon: Menu11,
path: "/innovationSubject"
},
{
title: "美国科研资助体系",
icon: Menu12,
path: "/scientificFunding"
}
]);
const handleToModule = item => {
const curRoute = router.resolve({
path: item.path
});
window.open(curRoute.href, "_blank");
};
const searchText = ref("");
const handleSearch = () => {
const curRoute = router.resolve({
path: "/searchResults",
query: {
searchText: searchText.value
}
});
window.open(curRoute.href, "_blank");
};
const handleClickTitle = item => {
if (item.name === "主要国家科技动向感知" || item.name === "主要国家竞争科技安全") {
ElMessage.warning("当前功能正在开发中,敬请期待!");
}
};
const handleOpenPage = page => {
const pageObj = {
znwd: "/chat",
znxb: "/writtingAsstaint"
};
window.open(pageObj[page], "_blank");
};
const handleClickToolBox = () => {
ElMessage.warning("当前功能正在开发中,敬请期待!");
};
onMounted(() => { onMounted(() => {
handleGetPersonType(); handleGetPersonType();
}); });
...@@ -281,457 +113,6 @@ body { ...@@ -281,457 +113,6 @@ body {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
} }
.pro-wrapper {
width: 100vw;
height: 100vh;
position: relative;
overflow: hidden;
.home-page {
width: 100%;
height: 100%;
position: relative;
.navbar {
width: 100%;
height: 64px;
border-bottom: 1px solid rgba(234, 236, 238, 1);
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: linear-gradient(180deg, rgba(246, 250, 255, 0.8) 0%, rgba(255, 255, 255, 0.8) 100%);
.nav-content {
width: 1600px;
height: 64px;
margin: 0 auto;
display: flex;
justify-content: space-between;
position: relative;
.nav-left {
height: 64px;
display: flex;
.icon {
margin-top: 17px;
width: 29px;
height: 30px;
img {
width: 100%;
height: 100%;
}
}
.title-box {
display: flex;
height: 64px;
margin-left: 21px;
gap: 33px;
.title {
height: 64px;
cursor: pointer;
&:hover {
.text {
color: var(--color-main-active);
}
}
.text {
height: 39px;
margin-top: 12px;
color: rgba(59, 65, 75, 1);
font-family: YouSheBiaoTiHei;
font-style: Regular;
font-size: 30px;
font-weight: 400;
line-height: 39px;
letter-spacing: 0px;
}
.textActive {
color: var(--color-main-active);
}
.bottom-line {
width: 50px;
height: 4px;
margin: 0 auto;
margin-top: 9px;
background: var(--color-main-active);
}
}
}
}
.nav-right {
display: flex;
justify-content: flex-end;
gap: 21px;
.search-box {
margin-top: 16px;
width: 300px;
height: 36px;
box-sizing: border-box;
border: 1px solid rgba(231, 243, 255, 1);
border-radius: 10px;
background: rgba(231, 243, 255, 1);
display: flex;
.input {
width: 264px;
height: 36px;
}
.icon {
width: 18px;
height: 18px;
margin-left: 9px;
margin-top: 9px;
img {
width: 100%;
height: 100%;
}
}
}
.info-box {
height: 64px;
display: flex;
justify-content: flex-end;
align-items: center;
.mail {
width: 32px;
height: 32px;
margin-right: 14px;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.user {
width: 32px;
height: 32px;
margin-right: 11px;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.name {
width: 48px;
height: 30px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-style: Regular;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
}
}
}
.menu-box {
position: absolute;
z-index: 999999;
width: 713px;
height: 413px;
top: 64px;
left: 0;
box-sizing: border-box;
border: 1px solid rgba(255, 255, 255, 1);
border-radius: 10px;
backdrop-filter: blur(30px);
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: rgba(255, 255, 255, 0.8);
.menu-content {
width: 562px;
height: 348px;
margin-top: 8px;
margin-left: 72px;
display: flex;
flex-wrap: wrap;
.menu-item {
margin-top: 36px;
width: 280px;
height: 24px;
display: flex;
cursor: pointer;
&:hover {
.title {
color: var(--color-main-active);
font-size: 20px;
}
}
.icon {
width: 24px;
height: 24px;
img {
width: 100%;
height: 100%;
}
}
.title {
margin-left: 16px;
height: 24px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-style: Bold;
font-size: 18px;
font-weight: 700;
line-height: 24px;
letter-spacing: 0px;
text-align: left;
}
}
}
}
}
}
.main-container {
width: 100%;
height: calc(100vh - 64px);
position: relative;
overflow: hidden;
}
}
.content-page {
width: 100%;
height: 100%;
.navbar {
display: flex;
justify-content: center;
align-items: center;
background: #fff;
color: rgba(10, 18, 30, 1);
border-bottom: 1px solid #e5e7eb;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
position: relative;
box-sizing: border-box;
height: 72px;
.nav-brand {
display: flex;
align-items: center;
gap: 12px;
position: absolute;
left: 160px;
.brand-icon {
width: 48px;
height: 48px;
img {
width: 100%;
height: 100%;
}
}
.brand-text {
cursor: pointer;
.text-ch {
height: 37px;
color: rgba(10, 18, 30, 1);
font-family: Microsoft YaHei;
font-size: 32px;
font-weight: 700;
line-height: 37px;
}
.text-en {
color: rgba(10, 18, 30, 1);
font-family: Microsoft YaHei;
font-size: 10px;
font-weight: 400;
line-height: 13px;
}
}
}
.user-info {
display: flex;
align-items: center;
gap: 20px;
padding: 8px 12px;
border-radius: 6px;
color: #333;
position: absolute;
right: 160px;
.email {
width: 20px;
height: 20px;
img {
width: 100%;
height: 100%;
}
}
.avator {
width: 32px;
height: 32px;
img {
width: 100%;
height: 100%;
}
}
.user {
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
}
}
}
.main-container {
width: 100%;
height: calc(100vh - 72px);
position: relative;
overflow: hidden;
}
}
.right-btn {
position: absolute;
// top: 132px;
top: 100px;
right: 0;
z-index: 10000000000000;
.item {
width: 108px;
height: 40px;
box-sizing: border-box;
border: 1px solid #fff;
border-radius: 50px 0px 0px 50px;
background: rgba(255, 255, 255, 0.65);
display: flex;
margin-bottom: 8px;
cursor: pointer;
.icon {
width: 36px;
height: 36px;
margin-top: 2px;
margin-left: 2px;
img {
width: 100%;
height: 100%;
}
}
.text {
width: 36px;
height: 24px;
color: rgba(59, 65, 75, 1);
font-family: Source Han Sans CN;
font-style: Regular;
font-size: 18px;
font-weight: 400;
line-height: 24px;
letter-spacing: 0px;
text-align: left;
margin-top: 8px;
margin-left: 10px;
}
}
}
.tool-box {
position: absolute;
top: 400px;
right: 28px;
top: 681px;
width: 62px;
height: 217px;
box-sizing: border-box;
border: 1px solid rgba(255, 255, 255, 1);
border-radius: 10px;
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: rgba(255, 255, 255, 0.65);
box-sizing: border-box;
padding: 24px 18px;
display: flex;
flex-direction: column;
justify-content: space-between;
.tool-item {
width: 24px;
height: 24px;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
}
.ai-btn {
position: absolute;
bottom: 240px;
right: 10px;
z-index: 9999;
cursor: pointer;
.icon {
width: 96px;
height: 96px;
img {
width: 100%;
height: 100%;
}
}
.text {
margin-top: -15px;
height: 24px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 24px;
text-align: center;
}
}
.ai-dialog {
position: absolute;
right: 100px;
top: 100px;
z-index: 9999;
}
}
:deep(.el-input__wrapper) { :deep(.el-input__wrapper) {
height: 100%; height: 100%;
box-shadow: none; box-shadow: none;
...@@ -747,27 +128,4 @@ body { ...@@ -747,27 +128,4 @@ body {
box-shadow: none !important; box-shadow: none !important;
} }
.title[aria-disabled="true"] {
opacity: 0.3;
cursor: not-allowed;
pointer-events: none;
}
.info-box[aria-disabled="true"] {
opacity: 0.3;
cursor: not-allowed;
pointer-events: none;
}
.right-btn[aria-disabled="true"] {
opacity: 0.3;
cursor: not-allowed;
pointer-events: none;
}
.tool-box[aria-disabled="true"] {
opacity: 0.3;
cursor: not-allowed;
pointer-events: none;
}
</style> </style>
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
<div class="title-box" v-show="!isShowSearchBar"> <div class="title-box" v-show="!isShowSearchBar">
<!-- <div class="title-box" v-if="false"> --> <!-- <div class="title-box" v-if="false"> -->
<div class="title" v-for="(item, index) in homeTitleList" :key="index" <div class="title" v-for="(item, index) in homeTitleList" :key="index"
@mouseenter="handleShowMenu(index, true)" @mouseleave="handleShowMenu(index, false)" @mouseenter="handleShowMenu(index, true)" @click="handleClickTitle(item, index)">
@click="handleClickTitle(item)">
<div class="text" :class="{ textActive: homeActiveTitleIndex === index }"> <div class="text" :class="{ textActive: homeActiveTitleIndex === index }">
{{ item.name }} {{ item.name }}
</div> </div>
...@@ -42,6 +41,17 @@ ...@@ -42,6 +41,17 @@
</div> </div>
</div> </div>
</div> </div>
<div class="tool-box" v-show="isShowTool" @mouseenter="handleHoverTool(true)"
@mouseleave="handleHoverTool(false)">
<div class="menu-content">
<div class="menu-item" v-for="(item, index) in toolList" :key="index" @click="handleToModule(item)">
<div class="icon">
<img :src="item.icon" alt="" />
</div>
<div class="title">{{ item.title }}</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -65,6 +75,8 @@ import Menu9 from "@/assets/icons/overview/menu9.png"; ...@@ -65,6 +75,8 @@ import Menu9 from "@/assets/icons/overview/menu9.png";
import Menu10 from "@/assets/icons/overview/menu10.png"; import Menu10 from "@/assets/icons/overview/menu10.png";
import Menu11 from "@/assets/icons/overview/menu11.png"; import Menu11 from "@/assets/icons/overview/menu11.png";
import Menu12 from "@/assets/icons/overview/menu12.png"; import Menu12 from "@/assets/icons/overview/menu12.png";
import Tool1 from './tool1.svg'
import Tool2 from './tool2.svg'
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { useWrittingAsstaintStore } from "@/stores/writtingAsstaintStore"; import { useWrittingAsstaintStore } from "@/stores/writtingAsstaintStore";
const store = useWrittingAsstaintStore(); const store = useWrittingAsstaintStore();
...@@ -91,29 +103,43 @@ const handleGetPersonType = async () => { ...@@ -91,29 +103,43 @@ const handleGetPersonType = async () => {
// 概览页标题列表 // 概览页标题列表
const homeTitleList = ref([ const homeTitleList = ref([
{ {
name: "中美科技博弈", name: "首页",
path: "/ZMOverView", path: "/ZMOverView",
disabled: false disabled: false
}, },
// {
// name: "主要国家科技动向感知", {
// path: "", name: "中美科技博弈",
// disabled: true path: "/billHome",
// }, disabled: false
// { },
// name: "主要国家竞争科技安全", {
// path: "", name: "智能工具",
// disabled: true path: "/chat",
// } disabled: false
},
{
name: "数据资源库",
path: "/dataLibrary",
disabled: false
}
]); ]);
const homeActiveTitleIndex = ref(0); const homeActiveTitleIndex = ref(0);
const isShowMenu = ref(false); const isShowMenu = ref(false);
const handleShowMenu = (index, isShow) => { const handleShowMenu = (index, isShow) => {
if (index === 0) { if (index === 1) {
isShowMenu.value = isShow; isShowMenu.value = isShow;
isShowTool.value = false;
} else if (index === 2) {
isShowMenu.value = false
isShowTool.value = isShow;
} else {
isShowMenu.value = false
isShowTool.value = false;
} }
}; };
...@@ -122,11 +148,11 @@ const handleHoverMenu = isShow => { ...@@ -122,11 +148,11 @@ const handleHoverMenu = isShow => {
}; };
const menuList = ref([ const menuList = ref([
{ // {
title: "中美科技博弈概览", // title: "中美科技博弈概览",
icon: Menu1, // icon: Menu1,
path: "/ZMOverView" // path: "/ZMOverView"
}, // },
{ {
title: "科技法案", title: "科技法案",
icon: Menu2, icon: Menu2,
...@@ -184,11 +210,34 @@ const menuList = ref([ ...@@ -184,11 +210,34 @@ const menuList = ref([
} }
]); ]);
const isShowTool = ref(false);
const handleHoverTool = isShow => {
isShowTool.value = isShow;
};
const toolList = ref([
{
title: "智能问答",
icon: Tool1,
path: "/chat"
},
{
title: "智能写报",
icon: Tool2,
path: "/writting"
},
])
const handleToModule = item => { const handleToModule = item => {
const curRoute = router.resolve({ // const curRoute = router.resolve({
// path: item.path
// });
// window.open(curRoute.href, "_blank");
router.push({
path: item.path path: item.path
}); })
window.open(curRoute.href, "_blank");
}; };
const searchText = ref(""); const searchText = ref("");
...@@ -203,10 +252,20 @@ const handleSearch = () => { ...@@ -203,10 +252,20 @@ const handleSearch = () => {
window.open(curRoute.href, "_blank"); window.open(curRoute.href, "_blank");
}; };
const handleClickTitle = item => { const handleClickTitle = (item, index) => {
if (item.name === "主要国家科技动向感知" || item.name === "主要国家竞争科技安全") { if (homeActiveTitleIndex.value === index) return
ElMessage.warning("当前功能正在开发中,敬请期待!");
homeActiveTitleIndex.value = index
window.localStorage.setItem('homeActiveTitleIndex', homeActiveTitleIndex.value)
if (item.name === '智能工具') {
const curRoute = router.resolve({
path: item.path,
});
window.open(curRoute.href, "_blank");
} else {
router.push(item.path)
} }
}; };
const handleClickToolBox = () => { const handleClickToolBox = () => {
...@@ -215,6 +274,7 @@ const handleClickToolBox = () => { ...@@ -215,6 +274,7 @@ const handleClickToolBox = () => {
onMounted(() => { onMounted(() => {
handleGetPersonType(); handleGetPersonType();
homeActiveTitleIndex.value = Number(window.localStorage.getItem('homeActiveTitleIndex'))
}); });
</script> </script>
...@@ -450,6 +510,66 @@ onMounted(() => { ...@@ -450,6 +510,66 @@ onMounted(() => {
} }
} }
} }
.tool-box {
position: absolute;
z-index: 999999;
width: 273px;
height: 171px;
top: 52px;
left: 300px;
box-sizing: border-box;
border: 1px solid rgba(255, 255, 255, 1);
border-radius: 10px;
backdrop-filter: blur(30px);
box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
background: rgba(255, 255, 255, 0.8);
.menu-content {
width: 562px;
height: 348px;
margin-top: 8px;
margin-left: 72px;
.menu-item {
margin-top: 36px;
width: 280px;
height: 24px;
display: flex;
cursor: pointer;
&:hover {
.title {
color: var(--color-main-active);
font-size: 20px;
}
}
.icon {
width: 24px;
height: 24px;
img {
width: 100%;
height: 100%;
}
}
.title {
margin-left: 16px;
height: 24px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-style: Bold;
font-size: 18px;
font-weight: 700;
line-height: 24px;
letter-spacing: 0px;
text-align: left;
}
}
}
}
} }
} }
</style> </style>
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24.000000" height="24.000000" fill="none" customFrame="#000000">
<defs>
<linearGradient id="paint_linear_1" x1="12" x2="12" y1="1" y2="23.0000019" gradientUnits="userSpaceOnUse">
<stop stop-color="rgb(0,91,244)" offset="0" stop-opacity="1" />
<stop stop-color="rgb(101,0,253)" offset="1" stop-opacity="1" />
</linearGradient>
</defs>
<rect id="ZM" width="24.000000" height="24.000000" x="0.000000" y="0.000000" />
<path id="合并" d="M16.1924 8.34956L17.265 9.39747C16.1916 12.5467 12.973 15.696 8.68258 16.2219C5.81801 16.5715 2.54479 19.4738 1 23C2.07341 16.7015 4.39054 1 20.4837 1C19.4119 4.1461 18.3401 6.24507 17.2683 7.29535L16.1924 8.34956ZM16.9643 4.86177C17.4797 3.85558 19.0242 2.51052 19.0242 1.83869C18.5092 2.17461 16.9643 2.84605 15.9343 4.35789C14.9044 5.86972 12.3295 6.87729 12.3295 6.87729C13.3594 6.54137 16.4489 5.86795 16.9643 4.86177ZM15.4194 8.8928C15.4194 9.56464 15.1104 11.1099 13.8744 11.9161C12.6385 12.7223 10.2696 13.5957 9.23961 13.9316C9.23961 13.9316 12.0205 12.6215 12.8445 11.4122C13.6684 10.2029 14.9044 9.22872 15.4194 8.8928ZM19.254 14.3913C19.254 14.3913 18.5049 16.1842 17.0059 17.2593C15.507 18.3345 13.2582 18.6917 13.2582 18.6917C13.2582 18.6917 15.3188 19.0509 16.2555 20.128C17.1923 21.205 17.0051 23 17.0051 23C17.0051 23 17.7544 21.205 19.2532 20.128C20.7519 19.0509 23 18.6919 23 18.6919C23 18.6919 20.9401 18.3345 20.0036 17.2593C19.0671 16.1842 19.254 14.3913 19.254 14.3913Z" fill="url(#paint_linear_1)" fill-rule="evenodd" />
</svg>
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24.000000" height="24.000000" fill="none" customFrame="#000000">
<defs>
<linearGradient id="paint_linear_2" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
<stop stop-color="rgb(0,91,244)" offset="0" stop-opacity="1" />
<stop stop-color="rgb(101,0,253)" offset="1" stop-opacity="1" />
</linearGradient>
</defs>
<rect id="法案" width="24.000000" height="24.000000" x="0.000000" y="0.000000" />
<path id="减去顶层" d="M1.00002 11.1429C1.00002 6.0934 5.66569 2 11.4211 2C17.1765 2 21.8421 6.0934 21.8421 11.1429C21.8421 16.1923 17.1765 20.2857 11.4211 20.2857C10.0795 20.2857 8.79726 20.0634 7.61946 19.6584C6.99335 19.443 5.83647 18.8635 5.83647 18.8635L1 19.6588L2.90775 16.417C2.90775 16.417 2.15952 15.3834 1.87639 14.8183C1.31279 13.6935 1.00002 12.4503 1.00002 11.1429ZM15.7969 6.57031C15.7969 6.57031 15.5142 7.22506 14.9487 7.61766C14.3831 8.01027 13.5347 8.14075 13.5347 8.14075C13.5347 8.14075 14.3121 8.2719 14.6656 8.66523C15.019 9.05855 14.9484 9.71404 14.9484 9.71404C14.9484 9.71404 15.2311 9.05854 15.7965 8.66523C16.362 8.27192 17.2102 8.14079 17.2102 8.14079C17.2102 8.14079 16.433 8.01028 16.0797 7.61766C15.7263 7.22505 15.7969 6.57031 15.7969 6.57031ZM12.5406 14.0703L11.6792 8.14197L7.22535 8.14197L7.55117 8.43609L5.05229 14.0703L6.89676 14.0703L7.65333 12.4565L10.3676 12.4565L10.594 14.0703L12.5406 14.0703ZM8.09512 11.4514L9.18027 9.14708L9.9396 9.14708L10.2654 11.4514L8.09512 11.4514ZM16.3866 9.83812L15.6492 14.0703L13.5921 14.0703L14.1004 10.2371L13.7718 9.83812L16.3866 9.83812ZM9.10525 20.5652C10.534 21.4701 12.266 22 14.1326 22C19.0299 22 23 18.3529 23 13.854C23 12.9035 22.8228 11.991 22.497 11.1429C22.5038 11.2826 22.5072 11.423 22.5072 11.5643C22.5072 16.7661 17.8755 20.9831 12.162 20.9831C11.0979 20.9831 10.0713 20.8368 9.10525 20.5652Z" fill="url(#paint_linear_2)" fill-rule="evenodd" />
</svg>
...@@ -26,21 +26,33 @@ const routes = [ ...@@ -26,21 +26,33 @@ const routes = [
name: "Home", name: "Home",
component: Home, component: Home,
children: [ children: [
...fileRoutes ...fileRoutes,
{
path: "/dataLibrary",
name: "DataLibrary",
redirect: "./dataLibrary/countryBill",
component: DataLibrary,
meta: {
title: '数据资源库'
},
children: [
...dataRoutes
]
},
] ]
}, },
{ // {
path: "/dataLibrary", // path: "/dataLibrary",
name: "DataLibrary", // name: "DataLibrary",
component: DataLibrary, // component: DataLibrary,
meta: { // meta: {
title: '数据资源库' // title: '数据资源库'
}, // },
children: [ // children: [
...dataRoutes // ...dataRoutes
] // ]
}, // },
]; ];
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<DivideHeader id="position1" class="divide1" :titleText="'最新动态'"></DivideHeader> <DivideHeader id="position1" class="divide1" :titleText="'最新动态'"></DivideHeader>
<div class="home-content-center"> <div class="home-content-center">
<div class="center-top"> <div class="center-top">
<overviewMainBox class="box1" title="热门法案" @toDetail="handleClickToDetail"> <OverviewMainBox class="box1" title="热门法案" @toDetail="handleClickToDetail">
<template #headerIcon> <template #headerIcon>
<img style="width: 100%; height: 100%" src="./assets/images/box1-header-icon.png" alt="" /> <img style="width: 100%; height: 100%" src="./assets/images/box1-header-icon.png" alt="" />
</template> </template>
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
</overviewMainBox> </OverviewMainBox>
<RiskSignal :list="warningList" @more-click="handleToMoreRiskSignal" @item-click="handleClickToDetailO" <RiskSignal :list="warningList" @more-click="handleToMoreRiskSignal" @item-click="handleClickToDetailO"
riskLevel="signalLevel" postDate="signalTime" name="signalTitle" /> riskLevel="signalLevel" postDate="signalTime" name="signalTitle" />
</div> </div>
...@@ -273,7 +273,7 @@ import { ...@@ -273,7 +273,7 @@ import {
import { getPersonSummaryInfo } from "@/api/common/index"; import { getPersonSummaryInfo } from "@/api/common/index";
import { getChartAnalysis } from "@/api/aiAnalysis/index"; import { getChartAnalysis } from "@/api/aiAnalysis/index";
import DivideHeader from "@/components/DivideHeader.vue"; import DivideHeader from "@/components/DivideHeader.vue";
import overviewMainBox from "@/components/base/BoxBackground/OverviewMainBox.vue"; import OverviewMainBox from "@/components/base/BoxBackground/OverviewMainBox.vue";
import OverviewCard from "./OverviewCard.vue"; import OverviewCard from "./OverviewCard.vue";
import ResourceLibrarySection from "./ResourceLibrarySection.vue"; import ResourceLibrarySection from "./ResourceLibrarySection.vue";
import { useContainerScroll } from "@/hooks/useScrollShow"; import { useContainerScroll } from "@/hooks/useScrollShow";
......
...@@ -7,10 +7,16 @@ ...@@ -7,10 +7,16 @@
<SelectBox :placeholder-name="DatePlaceHolder" select-title="提出时间" :select-list="dateList" <SelectBox :placeholder-name="DatePlaceHolder" select-title="提出时间" :select-list="dateList"
:select-name="selectedDate" :custom-time="customTime" @update:select-text="handleSelectDate" :select-name="selectedDate" :custom-time="customTime" @update:select-text="handleSelectDate"
@update:custom-time="handleCustomDate" /> @update:custom-time="handleCustomDate" />
<SelectBox v-if="isFolderAll" :placeholder-name="insPlaceHolder" select-title="发布机构" :select-list="institutionList" <SelectBox v-if="isFolderAll" :placeholder-name="partyPlaceHolder" select-title="所属党派" :select-list="partyList"
:select-name="selectedIns" @update:select-text="handleSelectIns" /> :select-name="selectedParty" @update:select-text="handleSelectParty" />
<SelectBox v-if="isFolderAll" :placeholder-name="decreeTypePlaceHolder" select-title="政令类型" <SelectBox v-if="isFolderAll" :placeholder-name="congressPlaceHolder" select-title="提出议院"
:select-list="decreeTypeList" :select-name="selectedDecreeType" @update:select-text="handleSelectDecreeType" /> :select-list="congressList" :select-name="selectedCongress" @update:select-text="handleSelectCongress" />
<SelectBox v-if="isFolderAll" :placeholder-name="orgPlaceHolder" select-title="委员会" :select-list="orgList"
:select-name="selectedOrg" @update:select-text="handleSelectOrg" />
<SelectBox v-if="isFolderAll" :placeholder-name="memberPlaceHolder" select-title="提出议员"
:select-list="memberList" :select-name="selectedmember" @update:select-text="handleSelectMember" />
<SelectBox v-if="isFolderAll" :placeholder-name="statusPlaceHolder" select-title="所处阶段"
:select-list="statusList" :select-name="selectedStatus" @update:select-text="handleSelectStauts" />
<div class="check-box"> <div class="check-box">
<div class="check-box-left text-tip-1"> <div class="check-box-left text-tip-1">
{{ '是否涉华:' }} {{ '是否涉华:' }}
...@@ -20,21 +26,11 @@ ...@@ -20,21 +26,11 @@
{{ '只看涉华法案' }} {{ '只看涉华法案' }}
</el-checkbox> </el-checkbox>
</div> </div>
</div>
<div class="check-box">
<div class="check-box-left text-tip-1">
{{ '科技相关:' }}
</div>
<div class="check-box-right">
<el-checkbox v-model="isInvolveTechnology" class="involve-checkbox">
{{ '只看科技相关' }}
</el-checkbox>
</div>
</div> </div>
</div> </div>
<div class="header-footer"> <div class="header-footer">
<div class="header-footer-left"> <div class="header-footer-left">
<ActiveTag v-for="tag, index in activeTagList" :key="index" :tagName="tag" <ActiveTag v-for="tag, index in activeTagList" :key="index" :tagName="tag.name"
@close="handleCloseCurTag(tag, index)" /> @close="handleCloseCurTag(tag, index)" />
</div> </div>
<div class="header-footer-right"> <div class="header-footer-right">
...@@ -56,8 +52,8 @@ ...@@ -56,8 +52,8 @@
<div class="content-header"> <div class="content-header">
<ChartHeader :list="staticsDemensionList" @clickItem="handleClickDemensionItem"> <ChartHeader :list="staticsDemensionList" @clickItem="handleClickDemensionItem">
<template #chart-header-right> <template #chart-header-right>
<el-select v-model="selectedTime" placeholder="选择时间" style="width: 150px" <el-select v-model="selectedTime" placeholder="选择时间" style="width: 150px" v-show="curDemension === '提案时间'"
v-show="curDemension === '提案时间'"> @change="handleChangeTime">
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
...@@ -66,11 +62,11 @@ ...@@ -66,11 +62,11 @@
</div> </div>
<div class="content-main"> <div class="content-main">
<ChartContainer :chartTitle="curChartTitle" :chartTypeList="curChartTypeList" <ChartContainer :chartTitle="curChartTitle" :chartTypeList="curChartTypeList"
@clickChartItem="handleSwitchActiveChart"> @clickChartItem="handleSwitchActiveChart" @download="handleDownloadCurChartData">
<template #chart-box> <template #chart-box>
<LineChart v-if="activeChart === '折线图'" :lineChartData="curChartData" /> <LineChart v-if="activeChart === '折线图'" :lineChartData="curChartData" />
<PieChart v-if="activeChart === '饼状图'" :pieChartData="curChartData" />
<BarChart v-if="activeChart === '柱状图'" :barChartData="curChartData" /> <BarChart v-if="activeChart === '柱状图'" :barChartData="curChartData" />
<PieChart v-if="activeChart === '饼状图'" :pieChartData="curChartData" />
<RaderChart v-if="activeChart === '雷达图'" :radarChartData="curChartData" /> <RaderChart v-if="activeChart === '雷达图'" :radarChartData="curChartData" />
</template> </template>
</ChartContainer> </ChartContainer>
...@@ -95,12 +91,14 @@ ...@@ -95,12 +91,14 @@
</div> </div>
<div class="header-left-item2 text-tip-1">{{ `已选择${selectedCount}项` }}</div> <div class="header-left-item2 text-tip-1">{{ `已选择${selectedCount}项` }}</div>
<div class="header-left-item2 text-tip-1 cancel" @click="handleClearAll" v-show="selectedCount">{{ '取消' }} <div class="header-left-item2 text-tip-1 cancel" @click="handleClearAll" v-show="selectedCount">{{ '取消' }}
<div class="header-left-item3 text-tip-1" v-if="isShowAllDataMaxLengthTip">{{ `(当前最大选择不能超过1万条!)` }}</div>
</div> </div>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="header-right-item item1"> <div class="header-right-item item1">
<div class="icon"> <div class="icon">
<img src="../assets/icons/download.svg" alt=""> <img src="../../assets/icons/download.svg" alt="">
</div> </div>
<div class="text text-tip-1" @click="handleExport">{{ '导出' }}</div> <div class="text text-tip-1" @click="handleExport">{{ '导出' }}</div>
</div> </div>
...@@ -113,7 +111,7 @@ ...@@ -113,7 +111,7 @@
<el-select v-model="isSort" placeholder="发布时间" style="width: 166px" @change="handlePxChange"> <el-select v-model="isSort" placeholder="发布时间" style="width: 166px" @change="handlePxChange">
<template #prefix> <template #prefix>
<div style="display: flex; align-items: center; height: 100%"> <div style="display: flex; align-items: center; height: 100%">
<img src="../assets/icons/desc-icon.svg" style="width: 14px; height: 14px" /> <img src="../../assets/icons/desc-icon.svg" style="width: 14px; height: 14px" />
</div> </div>
</template> </template>
<el-option v-for="item in releaseTimeList" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in releaseTimeList" :key="item.value" :label="item.label" :value="item.value" />
...@@ -121,27 +119,28 @@ ...@@ -121,27 +119,28 @@
</div> </div>
</div> </div>
</div> </div>
<div class="data-main-box-main-content"> <div class="data-main-box-main-content" v-loading="loading" element-loading-text="全部数据加载中,请稍候...">
<el-table ref="tableRef" :data="tableData" row-key="id" @selection-change="handleSelectionChange" <el-table ref="tableRef" :data="tableData" row-key="id" @selection-change="handleSelectionChange"
@select="handleSelect" @select-all="handleSelectAll" style="width: 100%" :row-style="{ height: '52px' }"> @select="handleSelect" @select-all="handleSelectAll" style="width: 100%" :row-style="{ height: '52px' }">
<el-table-column type="selection" width="40" /> <el-table-column type="selection" width="40" />
<el-table-column label="政令名称" width="455"> <el-table-column label="法案名称" width="455">
<template #default="scope"> <template #default="scope">
<span class="title-item text-compact-bold" @click="handleClickToDetail(scope.row)">{{ scope.row.title <span class="title-item text-compact-bold" @click="handleClickToDetail(scope.row)">{{ scope.row.title
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="发布时间" width="180" class-name="date-column"> <el-table-column label="提案时间" width="120" class-name="date-column">
<template #default="scope">{{ scope.row.date }}</template> <template #default="scope">{{ scope.row.date }}</template>
</el-table-column> </el-table-column>
<el-table-column label="发布机构" width="480"> <el-table-column label="提案人" width="480">
<template #default="scope"> <template #default="scope">
<span class="person-item text-compact" @click="handlePerClick(scope.row)">{{ scope.row.sponsorPersonName <span class="person-item text-compact" @click="handlePerClick(scope.row)">{{ scope.row.sponsorPersonName
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="affiliation" label="涉及领域" width="120" /> <el-table-column property="affiliation" label="所属党派" width="120" />
<el-table-column property="originDepart" label="政令类型" width="180" /> <el-table-column property="originDepart" label="提出委员会" width="180" />
<el-table-column property="status" label="所处阶段" width="120" />
</el-table> </el-table>
</div> </div>
</div> </div>
...@@ -155,15 +154,15 @@ ...@@ -155,15 +154,15 @@
<script setup> <script setup>
import { ref, computed, watch, onMounted, nextTick } from 'vue' import { ref, computed, watch, onMounted, nextTick } from 'vue'
import ChartContainer from '../components/ChartContainer/index.vue' import ChartContainer from '../../components/ChartContainer/index.vue'
import ChartHeader from '../components/ChartHeader/index.vue' import ChartHeader from '../../components/ChartHeader/index.vue'
import ActiveTag from '../components/ActiveTag/index.vue' import ActiveTag from '../../components/ActiveTag/index.vue'
import HeaderBtnBox from '../components/HeaderBtnBox/index.vue' import HeaderBtnBox from '../../components/HeaderBtnBox/index.vue'
import LineChart from '../components/LineChart/index.vue' import LineChart from '../../components/LineChart/index.vue'
import PieChart from '../components/PieChart/index.vue' import PieChart from '../../components/PieChart/index.vue'
import BarChart from '../components/BarChart/index.vue' import BarChart from '../../components/BarChart/index.vue'
import RaderChart from '../components/RadarChart/idnex.vue' import RaderChart from '../../components/RadarChart/idnex.vue'
import SelectBox from '../components/SelectBox/index.vue' import SelectBox from '../../components/SelectBox/index.vue'
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import router from '@/router' import router from '@/router'
...@@ -185,7 +184,17 @@ const handleSwitchChartData = () => { ...@@ -185,7 +184,17 @@ const handleSwitchChartData = () => {
})[0] })[0]
setTimeout(() => { setTimeout(() => {
activeChart.value = curDemensionItem.chartTypeList[0] activeChart.value = curDemensionItem.chartTypeList[0]
curChartData.value = curDemensionItem.data if (curDemension.value === '提案时间') {
if (selectedTime.value === '按月度统计') {
curChartData.value = curDemensionItem.data
} else if (selectedTime.value === '按季度统计') {
curChartData.value = curDemensionItem.quatarData
} else {
curChartData.value = curDemensionItem.yearData
}
} else {
curChartData.value = curDemensionItem.data
}
}) })
} }
} }
...@@ -196,36 +205,58 @@ const totalNum = ref(0) ...@@ -196,36 +205,58 @@ const totalNum = ref(0)
// 统计维度列表 // 统计维度列表
const staticsDemensionList = ref([ const staticsDemensionList = ref([
{ {
name: '发布时间', name: '提案时间',
active: true, active: true,
chartTypeList: ['折线图', '柱状图'], chartTypeList: ['折线图', '柱状图'],
chartTitle: '政令发布时间趋势变化', chartTitle: '美国会法案提出数量随时间变化趋势',
data: { data: {
dataX: [], dataX: [],
dataY: [] dataY: []
}, },
quatarData:{ quatarData: {
dataX: [],
dataY: []
}, },
yearData: { yearData: {
dataX: [],
dataY: []
} }
}, },
{ {
name: '科技领域', name: '科技领域',
active: false, active: false,
chartTypeList: ['饼状图'], chartTypeList: ['饼状图'],
chartTitle: '政令科技领域分布', chartTitle: '美国会法案领域分布',
data: [] data: []
}, },
{ {
name: '发布机构', name: '提出议院',
active: false, active: false,
chartTypeList: ['饼状图'], chartTypeList: ['饼状图'],
chartTitle: '政令发布机构分布', chartTitle: '美国会法案议院分布',
data: [] data: []
} },
{
name: '提出委员会',
active: false,
chartTypeList: ['饼状图'],
chartTitle: '美国会法案委员会分布',
data: []
},
{
name: '提出议员党派',
active: false,
chartTypeList: ['饼状图'],
chartTitle: '美国会法案党派分布',
data: []
},
{
name: '立法阶段',
active: false,
chartTypeList: ['饼状图'],
chartTitle: '美国会法案立法阶段分布',
data: []
},
]) ])
// 当前维度下的图表列表 // 当前维度下的图表列表
...@@ -233,13 +264,13 @@ const curChartTypeList = computed(() => { ...@@ -233,13 +264,13 @@ const curChartTypeList = computed(() => {
let arr = staticsDemensionList.value.filter(item => item.active) let arr = staticsDemensionList.value.filter(item => item.active)
return arr[0].chartTypeList return arr[0].chartTypeList
}) })
// 当前图表标题 // 当前图表标题
const curChartTitle = computed(() => { const curChartTitle = computed(() => {
let arr = staticsDemensionList.value.filter(item => item.active) let arr = staticsDemensionList.value.filter(item => item.active)
return arr[0].chartTitle return arr[0].chartTitle
}) })
// 当前维度 // 当前维度
const curDemension = ref('提案时间') const curDemension = ref('提案时间')
...@@ -253,11 +284,19 @@ const handleClickDemensionItem = (val) => { ...@@ -253,11 +284,19 @@ const handleClickDemensionItem = (val) => {
curDemension.value = val.name curDemension.value = val.name
setTimeout(() => { setTimeout(() => {
activeChart.value = val.chartTypeList[0] activeChart.value = val.chartTypeList[0]
curChartData.value = val.data if (curDemension.value === '提案时间' && selectedTime.value === '按年度统计') {
curChartData.value = val.yearData
} else if (curDemension.value === '提案时间' && selectedTime.value === '按季度统计') {
curChartData.value = val.quatarData
} else {
curChartData.value = val.data
}
}) })
} }
// 时间图表 当前选择时间
const selectedTime = ref('按月统计') const selectedTime = ref('按月统计')
// 时间图表-时间列表
const timeList = ref([ const timeList = ref([
{ {
label: '按年度统计', label: '按年度统计',
...@@ -272,42 +311,140 @@ const timeList = ref([ ...@@ -272,42 +311,140 @@ const timeList = ref([
value: '按月度统计' value: '按月度统计'
}, },
]) ])
const handleChangeTime = value => {
let curChart = activeChart.value
activeChart.value = ''
if (value === '按月度统计') {
setTimeout(() => {
activeChart.value = curChart
curChartData.value = staticsDemensionList.value[0].data
})
} else if (value === '按季度统计') {
setTimeout(() => {
activeChart.value = curChart
curChartData.value = staticsDemensionList.value[0].quatarData
})
} else {
setTimeout(() => {
activeChart.value = curChart
curChartData.value = staticsDemensionList.value[0].yearData
})
}
}
// 激活的标签列表 // 激活的标签列表
const activeTagList = computed(() => { const activeTagList = computed(() => {
const arr = [] const arr = []
if (selectedArea.value && selectedArea.value !== '全部领域') { if (selectedArea.value && selectedArea.value !== '全部领域') {
arr.push(selectedArea.value) arr.push(
{
tag: '科技领域',
name: selectedArea.value
}
)
} }
if (selectedDate.value === '自定义') { if (selectedDate.value === '自定义') {
arr.push(customTime.value.join('至')) arr.push(
{
tag: '提出时间',
name: customTime.value.join('至')
}
)
} }
if (selectedIns.value && selectedIns.value !== '全部机构') { if (selectedParty.value && selectedParty.value !== '全部党派') {
arr.push(selectedIns.value) arr.push(
{
tag: '所属党派',
name: selectedParty.value
}
)
} }
if (selectedDecreeType.value && selectedDecreeType.value !== '全部类型') { if (selectedCongress.value && selectedCongress.value !== '全部议院') {
arr.push(selectedDecreeType.value) arr.push(
{
tag: '提出议院',
name: selectedCongress.value
}
)
}
if (selectedOrg.value && selectedOrg.value !== '全部委员会') {
arr.push(
{
tag: '委员会',
name: selectedOrg.value
}
)
}
if (selectedmember.value && selectedmember.value !== '全部议员') {
arr.push(
{
tag: '提出议员',
name: selectedmember.value
}
)
}
if (selectedStatus.value && selectedStatus.value !== '全部阶段') {
arr.push(
{
tag: '所处阶段',
name: selectedStatus.value
}
)
} }
if (isInvolveCn.value) { if (isInvolveCn.value) {
const involveStr = '涉华' const involveStr = '涉华'
arr.push(involveStr) arr.push(
{
tag: '是否涉华',
name: involveStr
}
)
} }
return arr return arr
}) })
// 关闭当前标签
const handleCloseCurTag = (tag, index) => { const handleCloseCurTag = (tag, index) => {
switch (tag.tag) {
case '科技领域':
selectedArea.value = '全部领域'
break
case '提出时间':
selectedDate.value = ''
break
case '所属党派':
selectedParty.value = '全部党派'
break
case '提出议院':
selectedCongress.value = '全部议院'
break
case '委员会':
selectedOrg.value = '全部委员会'
break
case '提出议员':
selectedmember.value = '全部议员'
break
case '所处阶段':
selectedStatus.value = '全部阶段'
break
case '是否涉华':
isInvolveCn.value = false
break
}
// alert(tag.name) // alert(tag.name)
activeTagList.value.splice(index, 1) // activeTagList.value.splice(index, 1)
} }
const activeChart = ref('') const activeChart = ref('') // 当前激活的图表
// 切换当前图表
const handleSwitchActiveChart = val => { const handleSwitchActiveChart = val => {
activeChart.value = val.name activeChart.value = val.name
} }
// 雷达图数据
const radarChartData = ref({ const radarChartData = ref({
title: [ title: [
{ {
...@@ -357,7 +494,7 @@ const radarChartData = ref({ ...@@ -357,7 +494,7 @@ const radarChartData = ref({
// 数据- 是否全选 // 数据- 是否全选
const isSelectedAll = ref(false) const isSelectedAll = ref(false)
// 批量操作-当前操作
const curOperation = ref('') const curOperation = ref('')
const operationList = ref([ const operationList = ref([
{ {
...@@ -447,7 +584,7 @@ const handleSelectArea = (value) => { ...@@ -447,7 +584,7 @@ const handleSelectArea = (value) => {
selectedArea.value = value selectedArea.value = value
} }
// 发布时间 // 提出时间
const DatePlaceHolder = ref('请选择时间') const DatePlaceHolder = ref('请选择时间')
const selectedDate = ref('') const selectedDate = ref('')
const dateList = ref([ const dateList = ref([
...@@ -474,10 +611,8 @@ const dateList = ref([ ...@@ -474,10 +611,8 @@ const dateList = ref([
]) ])
const customTime = ref([]) // 自定义时间 const customTime = ref([]) // 自定义时间
const handleCustomDate = value => { const handleCustomDate = value => {
// console.log('value', value);
customTime.value = value customTime.value = value
} }
const handleSelectDate = (value) => { const handleSelectDate = (value) => {
selectedDate.value = value selectedDate.value = value
if (selectedDate.value !== '自定义') { if (selectedDate.value !== '自定义') {
...@@ -485,51 +620,125 @@ const handleSelectDate = (value) => { ...@@ -485,51 +620,125 @@ const handleSelectDate = (value) => {
} }
} }
// 发布机构 机构列表 // 所属党派
const institutionList = ref([ const partyList = ref([
{ {
name: '全部机构', name: '全部党派',
id: '全部机构' id: '全部党派'
}, },
{ {
name: '机构1', name: '共和党',
id: '机构1' id: '共和党'
}, },
{ {
name: '机构2', name: '民主党',
id: '机构2' id: '民主党'
}, },
{ {
name: '机构3', name: '其他',
id: '机构3' id: '其他'
}, },
]) ])
const selectedIns = ref('全部机构') const selectedParty = ref('全部党派')
const insPlaceHolder = ref('请选择机构') const partyPlaceHolder = ref('请选择党派')
const handleSelectParty = value => {
selectedParty.value = value
}
const handleSelectIns = value => { // 议院列表
selectedIns.value = value const congressList = ref([
{
name: '全部议院',
id: '全部议院'
},
{
name: '众议院',
id: '众议院'
},
{
name: '参议院',
id: '参议院'
}
])
const selectedCongress = ref('全部议院')
const congressPlaceHolder = ref('请选择议院')
const handleSelectCongress = value => {
selectedCongress.value = value
} }
// 政令类型 // 委员会
const decreeTypeList = ref([ const orgList = ref([])
const selectedOrg = ref('全部委员会')
const orgPlaceHolder = ref('请选择委员会')
const handleSelectOrg = value => {
selectedOrg.value = value
}
const handleGetOrgList = async () => {
try {
const res = await getPostOrgList()
console.log('委员会列表', res);
if (res.code === 200 && res.data) {
orgList.value = res.data.map(item => {
return {
name: item.departmentName,
id: item.departmentName
}
})
orgList.value = [{ name: '全部委员会', id: '全部委员会' }, ...orgList.value]
}
} catch (error) {
console.error('获取委员会列表报错:', error);
}
}
// 提出议员
const memberList = ref([])
const selectedmember = ref('全部议员')
const memberPlaceHolder = ref('请选择议员')
const handleSelectMember = value => {
selectedmember.value = value
}
const handleGetMemberList = async () => {
try {
const res = await getPostMemberList()
console.log('议员列表', res);
if (res.code === 200 && res.data) {
memberList.value = res.data.map(item => {
return {
name: item.memberName,
id: item.memberName,
memberId: item.memberId
}
})
memberList.value = [{ name: '全部议员', id: '全部议员' }, ...memberList.value]
}
} catch (error) {
console.error('获取议员列表报错:', error);
}
}
// 阶段列表
const statusList = ref([
{ {
name: '全部类型', name: '全部阶段',
id: '全部类型' id: '全部阶段'
}, },
{ {
name: '行政命令', name: '提出',
id: '行政命令' id: '0'
}, },
{ {
name: '备忘录', name: '通过',
id: '备忘录' id: '1'
} }
]) ])
const selectedDecreeType = ref('全部类型') const selectedStatus = ref('全部阶段')
const decreeTypePlaceHolder = ref('请选择议院') const statusPlaceHolder = ref('请选择立法阶段')
const handleSelectDecreeType = value => { const handleSelectStauts = value => {
selectedDecreeType.value = value selectedStatus.value = value
} }
// 是否涉华 // 是否涉华
...@@ -537,15 +746,15 @@ const isInvolveCn = ref(false) ...@@ -537,15 +746,15 @@ const isInvolveCn = ref(false)
const handleInvolveCnChange = () => { const handleInvolveCnChange = () => {
} }
// 是否科技相关
const isInvolveTechnology = ref(false)
// 清空条件 // 清空条件
const handleClear = () => { const handleClear = () => {
selectedArea.value = '全部领域' selectedArea.value = '全部领域'
selectedDate.value = '' selectedDate.value = ''
selectedIns.value = '全部机构' selectedParty.value = '全部党派'
selectedDecreeType.value = '全部类型' selectedCongress.value = '全部议院'
selectedOrg.value = '全部委员会'
selectedmember.value = '全部议员'
selectedStatus.value = '全部阶段'
isInvolveCn.value = false isInvolveCn.value = false
ElMessage.success('已清空条件!') ElMessage.success('已清空条件!')
} }
...@@ -561,8 +770,6 @@ const handleSwitchFolderAll = () => { ...@@ -561,8 +770,6 @@ const handleSwitchFolderAll = () => {
isFolderAll.value = !isFolderAll.value isFolderAll.value = !isFolderAll.value
} }
const tableRef = ref(null) const tableRef = ref(null)
// 表格数据 // 表格数据
...@@ -579,11 +786,7 @@ const releaseTimeList = ref([ ...@@ -579,11 +786,7 @@ const releaseTimeList = ref([
value: false value: false
} }
]); ]);
const isSort = ref(true); // true 倒序 false 升序 const isSort = ref(true); // true 倒序 false 升序
// const handleSwithSort = () => {
// isSort.value = !isSort.value;
// };
const handlePxChange = val => { const handlePxChange = val => {
fetchTableData() fetchTableData()
}; };
...@@ -597,10 +800,10 @@ const selectedMap = ref(new Map()) // 使用 Map 存储,key 为唯一 id ...@@ -597,10 +800,10 @@ const selectedMap = ref(new Map()) // 使用 Map 存储,key 为唯一 id
// 计算已选中的条数 // 计算已选中的条数
const selectedCount = computed(() => selectedMap.value.size) const selectedCount = computed(() => selectedMap.value.size)
// 获取表格数据(示例) // 获取当前页表格数据(示例)
const fetchTableData = async () => { const fetchTableData = async () => {
isSelectedAll.value = false // isSelectedAll.value = false
selectedMap.value.clear() // selectedMap.value.clear()
// 调用接口获取数据... // 调用接口获取数据...
const params = { const params = {
page: currentPage.value, page: currentPage.value,
...@@ -610,8 +813,11 @@ const fetchTableData = async () => { ...@@ -610,8 +813,11 @@ const fetchTableData = async () => {
domains: selectedArea.value === '全部领域' ? null : [selectedArea.value], domains: selectedArea.value === '全部领域' ? null : [selectedArea.value],
proposedDateStart: customTime.value[0], proposedDateStart: customTime.value[0],
proposedDateEnd: customTime.value[1], proposedDateEnd: customTime.value[1],
affiliation: selectedIns.value === '全部机构' ? null : selectedIns.value, affiliation: selectedParty.value === '全部党派' ? null : selectedParty.value,
originChamber: selectedDecreeType.value === '全部类型' ? null : selectedDecreeType.value, originChamber: selectedCongress.value === '全部议院' ? null : selectedCongress.value,
originDepart: selectedOrg.value === '全部委员会' ? null : selectedOrg.value,
sponsorPersonName: selectedmember.value === '全部议员' ? null : selectedmember.value,
status: selectedStatus.value === '通过' ? 1 : 0,
sleStatus: isInvolveCn ? 'Y' : 'N', sleStatus: isInvolveCn ? 'Y' : 'N',
sort: isSort.value ? 0 : 1 // 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序 sort: isSort.value ? 0 : 1 // 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序
} }
...@@ -625,6 +831,14 @@ const fetchTableData = async () => { ...@@ -625,6 +831,14 @@ const fetchTableData = async () => {
dataX: Object.keys(res.data.aggregationsDate), dataX: Object.keys(res.data.aggregationsDate),
dataY: Object.values(res.data.aggregationsDate).map(value => Number(value)) dataY: Object.values(res.data.aggregationsDate).map(value => Number(value))
} }
staticsDemensionList.value[0].quatarData = {
dataX: Object.keys(res.data.aggregationsQuarter),
dataY: Object.values(res.data.aggregationsQuarter).map(value => Number(value))
}
staticsDemensionList.value[0].yearData = {
dataX: Object.keys(res.data.aggregationsYear),
dataY: Object.values(res.data.aggregationsYear).map(value => Number(value))
}
staticsDemensionList.value[1].data = Object.entries(res.data.aggregationsDomain).map(([key, value]) => ({ staticsDemensionList.value[1].data = Object.entries(res.data.aggregationsDomain).map(([key, value]) => ({
name: key, name: key,
value: Number(value) value: Number(value)
...@@ -647,9 +861,6 @@ const fetchTableData = async () => { ...@@ -647,9 +861,6 @@ const fetchTableData = async () => {
})) }))
} }
const curDemensionItem = staticsDemensionList.value.filter(item => { const curDemensionItem = staticsDemensionList.value.filter(item => {
return item.name === curDemension.value return item.name === curDemension.value
})[0] })[0]
...@@ -658,10 +869,6 @@ const fetchTableData = async () => { ...@@ -658,10 +869,6 @@ const fetchTableData = async () => {
activeChart.value = curDemensionItem.chartTypeList[0] activeChart.value = curDemensionItem.chartTypeList[0]
curChartData.value = curDemensionItem.data curChartData.value = curDemensionItem.data
}) })
} catch (error) { } catch (error) {
} }
...@@ -677,6 +884,37 @@ const fetchTableData = async () => { ...@@ -677,6 +884,37 @@ const fetchTableData = async () => {
}) })
}) })
} }
const allData = ref([])
// 获取筛选条件下全部表格数据
const fetchAllData = async () => {
const params = {
page: 1,
size: 9999,
keyword: '',
type: 1, // type 1= 法案 2= 政令 3 =智库 4=智库报告 5=实体清单【制裁记录】 6= 人物 7= 机构 8=新闻 9= 社媒
domains: selectedArea.value === '全部领域' ? null : [selectedArea.value],
proposedDateStart: customTime.value[0],
proposedDateEnd: customTime.value[1],
affiliation: selectedParty.value === '全部党派' ? null : selectedParty.value,
originChamber: selectedCongress.value === '全部议院' ? null : selectedCongress.value,
originDepart: selectedOrg.value === '全部委员会' ? null : selectedOrg.value,
sponsorPersonName: selectedmember.value === '全部议员' ? null : selectedmember.value,
status: selectedStatus.value === '通过' ? 1 : 0,
sleStatus: isInvolveCn ? 'Y' : 'N',
sort: isSort.value ? 0 : 1 // 0 先按分数降序 后按时间降序 1 先按分数降序,再按时间升序
}
try {
const res = await search(params)
console.log('搜索结果', res);
if (res.code === 200 && res.data) {
allData.value = res.data.records
}
} catch (error) {
ElMessage.error('加载全部数据出错!')
}
}
// 单选事件 // 单选事件
const handleSelect = (selection, row) => { const handleSelect = (selection, row) => {
...@@ -689,7 +927,7 @@ const handleSelect = (selection, row) => { ...@@ -689,7 +927,7 @@ const handleSelect = (selection, row) => {
} }
} }
// 全选/全不选事件 // 表格自带 当前页 全选/全不选事件
const handleSelectAll = (selection) => { const handleSelectAll = (selection) => {
if (selection.length > 0) { if (selection.length > 0) {
// 全选:将当前页所有数据添加到 Map // 全选:将当前页所有数据添加到 Map
...@@ -722,10 +960,10 @@ const handleSelectAllPage = () => { ...@@ -722,10 +960,10 @@ const handleSelectAllPage = () => {
) )
if (currentPageSelected) { if (currentPageSelected) {
// 已全选,则取消当前页的全选 // 已全选,则不动当前页的全选
tableData.value.forEach(row => { tableData.value.forEach(row => {
tableRef.value.toggleRowSelection(row, false) tableRef.value.toggleRowSelection(row, false)
selectedMap.value.delete(row.id) // selectedMap.value.delete(row.id)
}) })
} else { } else {
// 未全选,则全选当前页 // 未全选,则全选当前页
...@@ -738,39 +976,47 @@ const handleSelectAllPage = () => { ...@@ -738,39 +976,47 @@ const handleSelectAllPage = () => {
} }
} }
// 处理全选 // 全选最大1万条提示
const handleSelectAllChange = () => { const isShowAllDataMaxLengthTip = ref(false)
const loading = ref(false) // 加载数据loading
// 处理 全选(全部数据)
const handleSelectAllChange = async () => {
if (isSelectedAll.value) { if (isSelectedAll.value) {
if (totalNum.value > 10000) {
isShowAllDataMaxLengthTip.value = true
}
loading.value = true
await fetchAllData()
handleSelectAllPage() handleSelectAllPage()
allData.value.forEach(row => {
if (!selectedMap.value.has(row.id)) {
selectedMap.value.set(row.id, row)
}
})
loading.value = false
} else { } else {
handleClearAll() handleClearAll()
} }
// if (isSelectedAll.value) {
// // 全选:将当前页所有数据添加到 Map
// tableData.value.forEach(row => {
// if (!selectedMap.value.has(row.id)) {
// selectedMap.value.set(row.id, row)
// }
// })
// } else {
// // 全不选:从 Map 中移除当前页的所有数据
// tableData.value.forEach(row => {
// selectedMap.value.delete(row.id)
// })
// }
} }
// 清空所有选择 // 清空所有选择
const handleClearAll = () => { const handleClearAll = () => {
isSelectedAll.value = false
selectedMap.value.clear() selectedMap.value.clear()
tableRef.value?.clearSelection() tableRef.value?.clearSelection()
} }
// 翻页 // 翻页
const handleCurrentChange = (val) => { const handleCurrentChange = async (val) => {
currentPage.value = val currentPage.value = val
fetchTableData() await fetchTableData()
if (isSelectedAll.value) {
handleSelectAllPage()
}
} }
...@@ -788,6 +1034,20 @@ watch(tableData, () => { ...@@ -788,6 +1034,20 @@ watch(tableData, () => {
// 当前图表数据 // 当前图表数据
const curChartData = ref(null) const curChartData = ref(null)
// 下载当前图表数据
const handleDownloadCurChartData = () => {
const jsonStr = JSON.stringify(curChartData.value, null, 2);
const blob = new Blob([jsonStr], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = 'chartData.json';
link.click();
URL.revokeObjectURL(url);
}
// 跳转到当前页 初始化筛选条件 // 跳转到当前页 初始化筛选条件
const initParam = () => { const initParam = () => {
const hasQuery = Object.keys(route.query).length > 0; const hasQuery = Object.keys(route.query).length > 0;
...@@ -799,8 +1059,14 @@ const initParam = () => { ...@@ -799,8 +1059,14 @@ const initParam = () => {
customTime.value = JSON.parse(route.query.selectedDate) customTime.value = JSON.parse(route.query.selectedDate)
} }
isInvolveCn.value = route.query.isInvolveCn ? true : false isInvolveCn.value = route.query.isInvolveCn ? true : false
if (route.query.selectedStatus) {
selectedStatus.value = route.query.selectedStatus === '1' ? '通过' : '提出'
} else {
selectedStatus.value = '全部阶段'
}
selectedDecreeType.value = route.query.selectedDecreeType ? route.query.selectedDecreeType : '全部类型' selectedCongress.value = route.query.selectedCongress ? route.query.selectedCongress : '全部议院'
selectedOrg.value = route.query.selectedOrg ? route.query.selectedOrg : '全部委员会'
const query = route.query; const query = route.query;
if (Object.keys(query).length > 0) { if (Object.keys(query).length > 0) {
...@@ -814,8 +1080,14 @@ const initParam = () => { ...@@ -814,8 +1080,14 @@ const initParam = () => {
customTime.value = JSON.parse(savedQuery.selectedDate) customTime.value = JSON.parse(savedQuery.selectedDate)
} }
isInvolveCn.value = savedQuery.isInvolveCn ? true : false isInvolveCn.value = savedQuery.isInvolveCn ? true : false
if (savedQuery.selectedStatus) {
selectedStatus.value = savedQuery.selectedStatus === '1' ? '通过' : '提出'
} else {
selectedStatus.value = '全部阶段'
}
selectedDecreeType.value = savedQuery.selectedDecreeType ? savedQuery.selectedDecreeType : '全部类型' selectedCongress.value = savedQuery.selectedCongress ? savedQuery.selectedCongress : '全部议院'
selectedOrg.value = savedQuery.selectedOrg ? savedQuery.selectedOrg : '全部委员会'
} }
} }
...@@ -837,7 +1109,7 @@ const handleClickToDetail = (curBill) => { ...@@ -837,7 +1109,7 @@ const handleClickToDetail = (curBill) => {
// 跳转人物详情 // 跳转人物详情
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: {
...@@ -871,7 +1143,6 @@ onMounted(async () => { ...@@ -871,7 +1143,6 @@ onMounted(async () => {
initParam() initParam()
// 初始化 // 初始化
await fetchTableData() await fetchTableData()
...@@ -1050,6 +1321,10 @@ onMounted(async () => { ...@@ -1050,6 +1321,10 @@ onMounted(async () => {
} }
.header-left-item3 {
color: var(--color-orange-100);
}
.cancel { .cancel {
cursor: pointer; cursor: pointer;
} }
...@@ -1143,4 +1418,21 @@ onMounted(async () => { ...@@ -1143,4 +1418,21 @@ onMounted(async () => {
text-decoration: underline; text-decoration: underline;
} }
} }
</style>
\ No newline at end of file :deep(.el-table__header-wrapper) {
// background-color: #f5f7fa;
height: 48px;
}
:deep(.el-table__header th) {
// background-color: #f5f7fa;
color: var(--text-primary-50-color);
font-weight: bold;
}
/* 针对特定列 */
// :deep(.el-table__header th:first-child) {
// background-color: #e6f7ff;
// color: #1890ff;
// }</style>
\ No newline at end of file
<template> <template>
<div class="data-library-wrapper"> <div class="data-library-wrapper">
<div class="data-library-header"> <!-- <div class="data-library-header">
<div class="header-left"> <div class="header-left">
<div class="icon"> <div class="icon">
<img src="@/assets/icons/overview/logo.png" alt=""> <img src="@/assets/icons/overview/logo.png" alt="">
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="name">{{ "管理员" }}</div> <div class="name">{{ "管理员" }}</div>
</div> </div>
</div> </div>
</div> </div> -->
<div class="data-library-main"> <div class="data-library-main">
<div class="data-library-sider"> <div class="data-library-sider">
<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">
...@@ -96,7 +96,7 @@ const tagsViewStore = useTagsViewStore() ...@@ -96,7 +96,7 @@ const tagsViewStore = useTagsViewStore()
// 在路由全局守卫中处理 // 在路由全局守卫中处理
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 路由允许添加标签(排除掉隐藏的布局页如 /404, /login 等) // 路由允许添加标签(排除掉隐藏的布局页如 /404, /login 等)
if (to.meta?.title && !to.meta?.hiddenTag) { if (to.path.indexOf('dataLibrary') > -1) {
tagsViewStore.addView({ tagsViewStore.addView({
path: to.path, path: to.path,
name: to.name, // 对应组件的 name,用于缓存 name: to.name, // 对应组件的 name,用于缓存
...@@ -479,7 +479,7 @@ const handleClickToolBox = () => { ...@@ -479,7 +479,7 @@ const handleClickToolBox = () => {
onMounted(() => { onMounted(() => {
const path = route.path const path = route.path
console.log(decodeURI(route.fullPath)); console.log(decodeURI(route.fullPath));
switch (path) { switch (path) {
case '/dataLibrary/countryBill': case '/dataLibrary/countryBill':
siderList.value[0].active = true siderList.value[0].active = true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论