提交 8f982b4d authored 作者: coderBryanFu's avatar coderBryanFu

update

上级 c8425a6b
import request from "@/api/request.js";
// 今日要闻
export function getTodayNew() {
return request({
method: 'GET',
url: `/api/news/latestNews`,
})
}
// 今日要闻-带参
/**
* @param {industryId}
*/
export function getTodayNewByArea(params) {
return request({
method: 'GET',
url: `/api/news/latestNews`,
params
})
}
// 中美博弈专题
export function getHotNews() {
return request({
method: 'GET',
url: `/api/news/hotNews`,
})
}
// 今日要闻-带参
/**
* @param {industryId}
*/
export function getHotNewsByArea(params) {
return request({
method: 'GET',
url: `/api/news/hotNews`,
params
})
}
\ No newline at end of file
import request from "@/api/request.js";
// 全局信息
/**
* @param {newsId}
*/
export function getNewsSummary(params) {
return request({
method: 'GET',
url: `/api/news/summary/${params.newsId}`,
params
})
}
// 新闻内容
/**
* @param {newsId}
*/
export function getNewsContent(params) {
return request({
method: 'GET',
url: `/api/news/newsContent/${params.newsId}`,
params
})
}
// 事件脉络
/**
* @param {newsId}
*/
export function getNewsEvent(params) {
return request({
method: 'GET',
url: `/api/news/newsEvent/${params.newsId}`,
params
})
}
// 相关新闻
/**
* @param {newsId}
*/
export function getRelationNews(params) {
return request({
method: 'GET',
url: `/api/news/relationNews/${params.newsId}`,
params
})
}
\ No newline at end of file
......@@ -266,7 +266,7 @@
class="box3-item"
v-for="(news, index) in newsList"
:key="index"
@click="handleClickToNewsDetail()"
@click="handleClickToNewsDetail(news)"
>
<div class="left">
<img :src="getProxyUrl(news.newsImage) || News1" alt="" referrerpolicy="no-referrer" @error="e => e.target.src = News1" />
......@@ -884,9 +884,16 @@ const handleToMoreRiskSignal = () => {
window.open(route.href, "_blank");
};
// 跳转新闻详情页
const handleClickToNewsDetail = () => {
const handleClickToNewsDetail = (news) => {
// window.sessionStorage.setItem("newsId", "119_HR_1");
const route = router.resolve("/newsAnalysis");
const route = router.resolve(
{
path: "/newsAnalysis",
query: {
newsId: news.newsId
}
}
);
window.open(route.href, "_blank");
};
......
......@@ -242,7 +242,7 @@
</div>
</div>
<div class="box3-main">
<div class="box3-item" v-for="(news, index) in newsList" :key="index" @click="handleToNewsAnalysis()">
<div class="box3-item" v-for="(news, index) in newsList" :key="index" @click="handleToNewsAnalysis(news)">
<div class="left">
<img :src="news.img" alt="" />
</div>
......@@ -768,6 +768,7 @@ const handleGetNews = async () => {
if (res.code === 200 && res.data) {
newsList.value = res.data.map(item => {
return {
newsId: item.newsId,
img: item.newsImage,
title: item.newsTitle,
content: item.newsContent,
......@@ -781,8 +782,15 @@ const handleGetNews = async () => {
};
handleGetNews();
// 点击新闻条目,跳转到新闻分析页
const handleToNewsAnalysis = () => {
const route = router.resolve("/newsAnalysis");
const handleToNewsAnalysis = (news) => {
const route = router.resolve(
{
path: "/newsAnalysis",
query: {
newsId: news.newsId
}
}
);
window.open(route.href, "_blank");
};
......
<template>
<div class="header-btn" style="width: 100px;display: flex;" @click="back">
<img :src="`src/assets/icons/arrow-left.png`" style="width: 24px;height: 24px;" /> 返回
</div>
<div style="width: 100%;height: 100%;padding:0 20% ">
<div>
<div class=" news-header" style="text-align: left;">
今日要闻
</div>
<div class="content" style="margin-bottom: 20px;">
基于情报价值评估预测算法,掌握全球重要潜在动向
</div>
</div>
<div class="box" style="width: 100%;height: 90%;">
<div class="box-header" style="height: 5vh;">
<div style="display: flex; justify-content: center; ">
<div v-for="item in btnList" :class="btnSelect !== item ? 'header-btn-gray' : 'header-btn-select'"
@click="changeBtn(item)">
{{ item }} >
</div>
</div>
</div>
<div class="divider"></div>
<div v-for="item in HeadlinesData">
<div style="display: flex;">
<div>
<div class="title-blob">
{{ item.title }}
</div>
<div class="content">
新闻来源: {{ item.from }} 发表时间:{{ item.time }}
</div>
<div style="display: flex;">
<div v-for="tag in item.tag" class="tag">
{{ tag }}
</div>
</div>
</div>
<div style="margin-left: auto;padding: 10px;">
<img :src="item.image" />
</div>
</div>
<div class="divider">
</div>
</div>
</div>
</div>
<div class="back-btn" @click="back">
<div class="icon">
<img src="@/assets/icons/arrow-left.png" alt="" />
</div>
<div class="text">{{ "返回" }}</div>
</div>
<div class="wrapper">
<div>
<div class="news-header" style="text-align: left">今日要闻</div>
<div class="news-desc" style="margin-bottom: 20px">基于情报价值评估预测算法,掌握全球重要潜在动向</div>
</div>
<div class="main">
<div class="main-header">
<div
v-for="(item, index) in btnList"
:key="index"
class="header-btn"
:class="{ headerBtnSelect: btnSelect === item }"
@click="changeBtn(item)"
>
{{ item }}
</div>
</div>
<div class="content-box">
<div class="item" v-for="(item, index) in HeadlinesData" :key="index">
<div class="item-left">
<div class="title">{{ item.title }}</div>
<div class="content">
<div class="source">新闻来源: {{ item.from }}</div>
<div class="time">发表时间:{{ item.time }}</div>
</div>
<div class="tag-box">
<div v-for="(tag, index) in item.tag" class="tag" :key="index">
{{ tag }}
</div>
</div>
</div>
<div class="item-right">
<img :src="item.image" />
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from "vue";
import Index from "../innovationSubject/index.vue";
const btnList = ref(["全部", "军事", "政治", "经济", "敌我"])
const btnSelect = ref('新闻纵览')
const btnList = ref(["全部", "军事", "政治", "经济", "科技", "涉我"]);
const btnSelect = ref("全部");
const HeadlinesData = ref([
{
"title": "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”",
"from": "人民网",
"time": "2025-10-05",
"tag": ["以色列", "美国"],
"image": '/testData/HeadlinesData-img.png',
},
{
"title": "IMF上调中东和北非地区经济增长预期",
"from": "CNN",
"time": "2025-10-05",
"tag": ["经济", "中东", "IMF"],
"image": '/testData/HeadlinesData-img.png',
},
{
"title": "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面",
"from": "人民网",
"time": "2025-10-05",
"tag": ["日本", "访华"], "image": '/testData/HeadlinesData-img.png',
},
{
"title": "韩日因独岛主权争议暂停本月联合搜救演习",
"from": "凤凰网",
"time": "2025-10-05",
"tag": ["独岛", "联合军演", "韩国", "日本"], "image": '/testData/HeadlinesData-img.png',
},
{
"title": "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结",
"from": "央视网",
"time": "2025-10-05",
"tag": ["美国", "航母", "加勒比海"], "image": '/testData/HeadlinesData-img.png',
}
])
{
title: "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”",
from: "人民网",
time: "2025-10-05",
tag: ["以色列", "美国"],
image: "/testData/HeadlinesData-img.png"
},
{
title: "IMF上调中东和北非地区经济增长预期",
from: "CNN",
time: "2025-10-05",
tag: ["经济", "中东", "IMF"],
image: "/testData/HeadlinesData-img.png"
},
{
title: "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面",
from: "人民网",
time: "2025-10-05",
tag: ["日本", "访华"],
image: "/testData/HeadlinesData-img.png"
},
{
title: "韩日因独岛主权争议暂停本月联合搜救演习",
from: "凤凰网",
time: "2025-10-05",
tag: ["独岛", "联合军演", "韩国", "日本"],
image: "/testData/HeadlinesData-img.png"
},
{
title: "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结",
from: "央视网",
time: "2025-10-05",
tag: ["美国", "航母", "加勒比海"],
image: "/testData/HeadlinesData-img.png"
}
]);
function changeBtn(btn) {
btnSelect.value = btn
btnSelect.value = btn;
}
const emit = defineEmits(["back"]);
function back() {
emit('back', 'home')
emit("back", "home");
}
</script>
<style scoped>
@import url('./style.css');
<style lang="scss" scoped>
// @import url("./style.css");
.newsBrief-page {
max-width: 100vw;
height: 100%;
overflow: hidden;
margin: 0 auto;
padding: 5vh 10vw 20vh 10vw;
background: url('@/assets/images/background.png') no-repeat;
background-position: center -100px;
background-size: 100% 100%;
min-height: 100vh;
height: 100%;
background: url("@/assets/images/background.png") no-repeat;
background-position: center -100px;
background-size: 100% 100%;
position: relative;
.back-btn {
position: absolute;
top: 24px;
left: 40px;
width: 92px;
height: 40px;
display: flex;
gap: 4px;
align-items: center;
justify-content: center;
box-sizing: border-box;
border: 1px solid rgba(255, 255, 255, 1);
border-radius: 32px;
background: rgba(255, 255, 255, 0.8);
box-shadow: 0 0 10px 10px var(--color-bg-hover);
cursor: pointer;
&:hover {
background: var(--color-bg-hover);
}
.icon {
width: 16px;
height: 16px;
img {
width: 100%;
height: 100%;
}
}
.text {
height: 30px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: center;
}
}
.wrapper {
height: 930px;
position: relative;
.news-header {
margin-top: 80px;
margin-left: 484px;
height: 60px;
color: rgba(34, 41, 52, 1);
font-family: YouSheBiaoTiHei;
font-size: 46px;
font-weight: 400;
line-height: 60px;
letter-spacing: 0px;
text-align: left;
}
.news-desc {
margin-top: 2px;
margin-left: 484px;
height: 30px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.main {
margin: 0 auto;
width: 1000px;
height: 778px;
box-sizing: border-box;
border: 1px solid rgba(231, 243, 255, 1);
border-radius: 10px;
background: rgba(255, 255, 255, 0.8);
.main-header {
height: 64px;
display: flex;
gap: 16px;
padding-top: 24px;
padding-left: 24px;
.header-btn {
height: 40px;
line-height: 40px;
padding: 0 20px;
border-radius: 32px;
background: rgba(32, 33, 35, 0.07);
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
letter-spacing: 0px;
text-align: center;
}
.headerBtnSelect {
box-sizing: border-box;
border: 1px solid rgba(174, 214, 255, 1);
border-radius: 32px;
background: rgba(231, 243, 255, 1);
color: var(--color-main-active);
}
}
.content-box {
margin: 0 auto;
width: 952px;
height: 674px;
overflow: hidden;
overflow-y: auto;
.item {
width: 952px;
height: 114px;
border-bottom: 1px solid rgba(234, 236, 238, 1);
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding-top: 16px;
.item-left {
width: 710px;
.title {
height: 30px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.content {
margin-top: 2px;
display: flex;
gap: 16px;
height: 22px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: left;
}
.tag-box {
margin-top: 4px;
display: flex;
gap: 4px;
.tag {
height: 24px;
padding: 0 8px;
border-radius: 4px;
background: rgba(223, 226, 231, 0.41);
line-height: 24px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: left;
}
}
}
}
}
}
}
}
</style>
<template>
<div class="header-btn" style="width: 100px;display: flex;" @click="back">
<img :src="`src/assets/icons/arrow-left.png`" style="width: 24px;height: 24px;" /> 返回
</div>
<div style="width: 100%;height: 100%;padding:0 20% ">
<div>
<div class=" news-header" style="text-align: left;">
中美博弈专题
</div>
<div class="content" style="margin-bottom: 20px;">
汇聚全球资讯,呈现全球动态,掌握时事脉搏
</div>
</div>
<div class="box" style="width: 100%;height: 90%;">
<div class="box-header" style="height: 5vh;">
<div style="display: flex; justify-content: center; ">
<div v-for="item in btnList" :class="btnSelect !== item ? 'header-btn-gray' : 'header-btn-select'"
@click="changeBtn(item)">
{{ item }} >
</div>
</div>
</div>
<div class="divider"></div>
<div v-for="item in HeadlinesData">
<div style="display: flex;">
<div>
<div class="title-blob">
{{ item.title }}
</div>
<div class="content">
新闻来源: {{ item.from }} 发表时间:{{ item.time }}
</div>
<div style="display: flex;">
<div v-for="tag in item.tag" class="tag">
{{ tag }}
</div>
</div>
</div>
<div style="margin-left: auto;padding: 10px;">
<img :src="`src/assets/icons/arrow-${item.arrow}.png`" />
</div>
</div>
<div class="divider">
</div>
</div>
</div>
</div>
<div class="back-btn" @click="back">
<div class="icon">
<img src="@/assets/icons/arrow-left.png" alt="" />
</div>
<div class="text">{{ "返回" }}</div>
</div>
<div class="wrapper">
<div>
<div class="news-header">中美博弈专题</div>
<div class="news-desc">汇聚全球资讯,呈现全球动态,掌握时事脉搏</div>
</div>
<div class="main">
<div class="main-header">
<div
v-for="(item, index) in btnList"
:key="index"
class="header-btn"
:class="{ headerBtnSelect: btnSelect === item }"
@click="changeBtn(item)"
>
{{ item }}
</div>
</div>
<div class="content-box">
<div class="item" v-for="(item, index) in HeadlinesData" :key="index">
<div class="item-left">
<div class="title">{{ item.title }}</div>
<div class="content">
<div class="source">新闻来源: {{ item.from }}</div>
<div class="time">发表时间:{{ item.time }}</div>
</div>
<div class="tag-box">
<div v-for="(tag, index) in item.tag" class="tag" :key="index">
{{ tag }}
</div>
</div>
</div>
<div class="item-right">
<img :src="`src/assets/icons/arrow-${item.arrow}.png`" />
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from "vue";
// const props = defineProps({
// type: {
// type: String,
// default: 'home'
// }
// })
const btnList = ref(["全部", "军事", "政治", "经济", "敌我"])
const btnSelect = ref('新闻纵览')
const btnList = ref(["全部", "军事", "政治", "经济", "敌我"]);
const btnSelect = ref("新闻纵览");
const HeadlinesData = ref([
{
"title": "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”",
"from": "人民网",
"time": "2025-10-05",
"tag": ["以色列", "美国"],
"arrow": '0',
},
{
"title": "IMF上调中东和北非地区经济增长预期",
"from": "CNN",
"time": "2025-10-05",
"tag": ["经济", "中东", "IMF"],
"arrow": '1',
},
{
"title": "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面",
"from": "人民网",
"time": "2025-10-05",
"tag": ["日本", "访华"],
"arrow": '1',
},
{
"title": "韩日因独岛主权争议暂停本月联合搜救演习",
"from": "凤凰网",
"time": "2025-10-05",
"tag": ["独岛", "联合军演", "韩国", "日本"],
"arrow": '0',
},
{
"title": "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结",
"from": "央视网",
"time": "2025-10-05",
"tag": ["美国", "航母", "加勒比海"],
"arrow": '0',
}
])
{
title: "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”",
from: "人民网",
time: "2025-10-05",
tag: ["以色列", "美国"],
arrow: "0"
},
{
title: "IMF上调中东和北非地区经济增长预期",
from: "CNN",
time: "2025-10-05",
tag: ["经济", "中东", "IMF"],
arrow: "1"
},
{
title: "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面",
from: "人民网",
time: "2025-10-05",
tag: ["日本", "访华"],
arrow: "1"
},
{
title: "韩日因独岛主权争议暂停本月联合搜救演习",
from: "凤凰网",
time: "2025-10-05",
tag: ["独岛", "联合军演", "韩国", "日本"],
arrow: "0"
},
{
title: "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结",
from: "央视网",
time: "2025-10-05",
tag: ["美国", "航母", "加勒比海"],
arrow: "0"
}
]);
function changeBtn(btn) {
btnSelect.value = btn
btnSelect.value = btn;
}
const emit = defineEmits(["back"]);
function back() {
emit('back', 'home')
emit("back", "home");
}
</script>
<style scoped>
@import url('./style.css');
<style lang="scss" scoped>
.newsBrief-page {
max-width: 100vw;
height: 100%;
overflow: hidden;
margin: 0 auto;
padding: 5vh 10vw 20vh 10vw;
background: url('@/assets/images/background.png') no-repeat;
background-position: center -100px;
background-size: 100% 100%;
min-height: 100vh;
max-width: 100vw;
height: 100%;
overflow: hidden;
margin: 0 auto;
padding: 5vh 10vw 20vh 10vw;
background: url("@/assets/images/background.png") no-repeat;
background-position: center -100px;
background-size: 100% 100%;
min-height: 100vh;
.back-btn {
position: absolute;
top: 24px;
left: 40px;
width: 92px;
height: 40px;
display: flex;
gap: 4px;
align-items: center;
justify-content: center;
box-sizing: border-box;
border: 1px solid rgba(255, 255, 255, 1);
border-radius: 32px;
background: rgba(255, 255, 255, 0.8);
box-shadow: 0 0 10px 10px var(--color-bg-hover);
cursor: pointer;
&:hover {
background: var(--color-bg-hover);
}
.icon {
width: 16px;
height: 16px;
img {
width: 100%;
height: 100%;
}
}
.text {
height: 30px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: center;
}
}
.wrapper {
height: 930px;
position: relative;
.news-header {
margin-top: 80px;
margin-left: 484px;
height: 60px;
color: rgba(34, 41, 52, 1);
font-family: YouSheBiaoTiHei;
font-size: 46px;
font-weight: 400;
line-height: 60px;
letter-spacing: 0px;
text-align: left;
}
.news-desc {
margin-top: 2px;
margin-left: 484px;
height: 30px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.main {
margin: 30px auto;
width: 1000px;
height: 778px;
box-sizing: border-box;
border: 1px solid rgba(231, 243, 255, 1);
border-radius: 10px;
background: rgba(255, 255, 255, 0.8);
.main-header {
height: 64px;
display: flex;
gap: 16px;
padding-top: 24px;
padding-left: 24px;
.header-btn {
height: 40px;
line-height: 40px;
padding: 0 20px;
border-radius: 32px;
background: rgba(32, 33, 35, 0.07);
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
letter-spacing: 0px;
text-align: center;
}
.headerBtnSelect {
box-sizing: border-box;
border: 1px solid rgba(174, 214, 255, 1);
border-radius: 32px;
background: rgba(231, 243, 255, 1);
color: var(--color-main-active);
}
}
.content-box {
margin: 0 auto;
width: 952px;
height: 674px;
overflow: hidden;
overflow-y: auto;
.item {
width: 952px;
height: 114px;
border-bottom: 1px solid rgba(234, 236, 238, 1);
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding-top: 16px;
.item-left {
width: 710px;
.title {
height: 30px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.content {
margin-top: 2px;
display: flex;
gap: 16px;
height: 22px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: left;
}
.tag-box {
margin-top: 4px;
display: flex;
gap: 4px;
.tag {
height: 24px;
padding: 0 8px;
border-radius: 4px;
background: rgba(223, 226, 231, 0.41);
line-height: 24px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: left;
}
}
}
}
}
}
}
}
</style>
<template>
<div class="newsBrief-page">
<div v-if="showPage === 'home'">
<div style="justify-content: space-between;">
<div class="news-header">
新闻速览
</div>
<div class="input-box">
<el-input placeholder="请输入关键词" :suffix-icon="searchInput" clearable style="width: 800px;height: 48px;">
</el-input>
</div>
<div class="newsBrief-page">
<div v-if="showPage === 'home'">
<div style="justify-content: space-between">
<div class="news-header">新闻速览</div>
<div class="input-box">
<el-input placeholder="请输入关键词" :suffix-icon="searchInput" clearable style="width: 800px; height: 48px">
</el-input>
</div>
<div class="btn-box">
<div v-for="item,index in btnList" :key="index" :class="btnSelect !== item ? 'header-btn' : 'header-btn-select'"
@click="changeBtn(item)">
<div class="btn-box-text">{{ item }}</div>
<div class="btn-box-icon">
<img v-if="btnSelect === item" src="@/assets/icons/btn-arrow-right-active.png" alt="">
<img v-else src="@/assets/icons/btn-arrow-right.png" alt="">
</div>
</div>
<div class="header-btn-more">
<img src="@/assets/icons/adjustment.png" />
</div>
</div>
</div>
<div class="main" style="display: flex;">
<div class="box">
<div class="box-header">
<img class="box-header-img" src="@/assets/icons/Headlines-icon.svg"></img>
<div style="cursor: pointer;" @click="changePage('headlines')">
今日要闻 >
</div>
</div>
<div class="divider"></div>
<div v-for="item,index in HeadlinesData" :key="index">
<div style="display: flex;">
<div>
<div class="title-blob">
{{ item.title }}
</div>
<div class="content">
新闻来源: {{ item.from }} 发表时间:{{ item.time }}
</div>
<div style="display: flex;">
<div v-for="tag,index in item.tag" :key="index" class="tag">
{{ tag }}
</div>
</div>
</div>
<div style="margin-left: auto;padding: 10px;">
<img :src="item.image" />
</div>
</div>
<div class="divider">
</div>
</div>
</div>
<div class="box" style=" margin-left: 4%;">
<div class="box-header">
<img class="box-header-img" src="@/assets/icons/subject-icon.png"></img>
<div style="cursor: pointer;" @click="changePage('subject')">
中美博弈专题
</div>
</div>
<div class="divider">
</div>
<div v-for="(item, index) in subjectData" :key="index">
<div class="subject-line">
<!-- 左侧:序号 + 文字 -->
<div style="display: flex; align-items: center;">
<div :style="{
color:
index === 0 ? '#CF4F51'
: index === 1 ? '#FF964D'
: index === 2 ? '#E8BD0D'
: '#3B414B'
}">
{{ index <= 2 ? index + 1 : "." }} </div>
<div
style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 32vw ;margin-left: 20px;"
:class="index <= 2 ? 'title-blob' : 'content'">{{ item.text }}
</div>
<div class="btn-box">
<div
v-for="(item, index) in btnList"
:key="index"
:class="btnSelect !== item ? 'header-btn' : 'header-btn-select'"
@click="changeBtn(item)"
>
<div class="btn-box-text">{{ item }}</div>
<div class="btn-box-icon">
<img v-if="btnSelect === item" src="@/assets/icons/btn-arrow-right-active.png" alt="" />
<img v-else src="@/assets/icons/btn-arrow-right.png" alt="" />
</div>
</div>
<div class="header-btn-more">
<img src="@/assets/icons/adjustment.png" />
</div>
</div>
</div>
<div class="main">
<div class="box">
<div class="box-header">
<div class="box-header-img">
<img src="@/assets/icons/Headlines-icon.svg" />
</div>
<div class="box-header-title" @click="changePage('headlines')">今日要闻 ></div>
</div>
<div class="divider"></div>
<div v-for="(item, index) in HeadlinesData" :key="index">
<div class="box1-item">
<div class="box1-item-left">
<div class="box1-item-title">
{{ item.title }}
</div>
<div class="box1-item-content">
<div class="source">新闻来源: {{ item.from }}</div>
<div class="time">发表时间:{{ item.time }}</div>
</div>
<div class="tag-box">
<div v-for="(tag, index) in item.tag" :key="index" class="tag">
{{ tag }}
</div>
</div>
</div>
<div style="margin-left: auto; padding: 10px">
<img :src="item.image" />
</div>
</div>
<!-- 右侧:箭头 -->
<img :src="`src/assets/icons/arrow-${item.arrow}.png`" />
</div>
</div>
</div>
</div>
</div>
<div class="divider"></div>
</div>
</div>
<div class="box">
<div class="box-header">
<div class="box-header-img"><img src="@/assets/icons/subject-icon.png" /></div>
<div class="box-header-title" @click="changePage('subject')">中美博弈专题</div>
</div>
<div class="divider"></div>
<div v-for="(item, index) in subjectData" :key="index">
<div class="subject-line">
<div style="display: flex; align-items: center">
<div class="subject-line-id" :class="{ subjectLineId1: index===0, subjectLineId2: index === 1, subjectLineId3: index === 2 }">
{{ index <= 2 ? index + 1 : "•" }}
</div>
<div class="text" :class="{ textTop: index < 3 }">
{{ item.text }}
</div>
</div>
<img :src="`src/assets/icons/arrow-${item.arrow}.png`" />
</div>
</div>
</div>
</div>
</div>
<Headlines v-if="showPage === 'headlines'" @type="showPage" @back="changePage" />
<Subject v-if="showPage === 'subject'" @back="changePage" />
</div>
<Headlines v-if="showPage === 'headlines'" @type="showPage" @back="changePage" />
<Subject v-if="showPage === 'subject'" @back="changePage" />
</div>
</template>
<script setup>
......@@ -184,7 +169,6 @@ const subjectData = ref([
background: url("@/assets/images/background.png") no-repeat;
background-position: center -100px;
background-size: 100% 100%;
padding-top: 50px;
padding-top: 50px;
}
</style>
......@@ -118,6 +118,8 @@
width: 1440px;
height: 714px;
margin: 0 auto;
display: flex;
gap: 16px;
}
.box {
......@@ -127,31 +129,41 @@
border: 1px solid rgba(231, 243, 255, 1);
border-radius: 10px;
background: rgba(255, 255, 255, 0.8);
padding: 1vw;
padding: 0 24px;
}
.box-header {
height: 56px;
display: flex;
text-align: left;
font-size: 24px;
font-weight: 700;
align-items: center;
}
.box-header-img {
height: 24px;
width: 24px;
margin: 0 5px;
height: 20px;
width: 20px;
border-radius: 2px;
background: rgba(5, 95, 194, 0.16);
box-sizing: border-box;
padding: 2px;
}
.title-blob {
font-size: 16px;
font-weight: 400;
line-height: 30px;
.box-header-img img {
width: 16px;
height: 16px;
}
.box-header-title {
margin-left: 10px;
height: 24px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 18px;
font-weight: 700;
line-height: 24px;
letter-spacing: 0px;
text-align: left;
cursor: pointer;
}
.tag {
......@@ -167,30 +179,106 @@
text-align: left;
}
.content {
.divider {
width: 100%;
height: 1px;
background: #eaecee;
}
.box1-item {
display: flex;
height: 114px;
}
.box1-item-left {
margin-top: 16px;
width: 500px;
}
.box1-item-title {
width: 500px;
height: 30px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.box1-item-content {
margin-top: 2px;
height: 22px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: left;
display: flex;
gap: 16px;
}
.divider {
width: 100%;
height: 1px;
background: #eaecee;
.tag-box {
margin-top: 4px;
display: flex;
gap: 4px;
}
.subject-line {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
height: 2.7vh;
margin: 1vh 0;
height: 30px;
margin: 16px 0;
}
.subject-line-id {
width: 20px;
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
color: rgba(59, 65, 75, 1);
}
.subjectLineId1 {
color: #CE4F51 !important;
}
.subjectLineId2 {
color: #FF954D !important;
}
.subjectLineId3 {
color: #E8BD0B !important;
}
.text {
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.textTop {
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
:deep(.el-input__wrapper) {
box-shadow: none;
border-radius: 10px;
......
......@@ -78,12 +78,17 @@
</div>
<div class="content">{{ item.desc }}</div>
<div class="tag-box">
<div class="tag" :class="{
tag1: val.status === 1,
tag2: val.status === 2,
tag3: val.status === 3,
tag4: val.status === 4
}" v-for="(val, idx) in item.tagList" :key="idx">
<div
class="tag"
:class="{
tag1: val.status === 1,
tag2: val.status === 2,
tag3: val.status === 3,
tag4: val.status === 4
}"
v-for="(val, idx) in item.tagList"
:key="idx"
>
{{ val.name }}
</div>
</div>
......@@ -108,8 +113,12 @@
</div>
</div>
<div style="display: flex">
<img src="./assets/images/right-left-icon1.png" alt=""
style="margin-top: 174px; width: 24px; height: 48px" @click="changeBox1Data('previous')" />
<img
src="./assets/images/right-left-icon1.png"
alt=""
style="margin-top: 174px; width: 24px; height: 48px"
@click="changeBox1Data('previous')"
/>
<div class="box1-main">
<div class="box1-main-left">
<img :src="box1Data[box1DataIndex]?.imageUrl" alt="" />
......@@ -117,7 +126,11 @@
<div class="box1-main-right">
<div class="title">{{ box1Data[box1DataIndex]?.reportName }}</div>
<div class="tag-box">
<div class="tag" v-for="(item, index) in box1Data[box1DataIndex]?.industryVOList" :key="index">
<div
class="tag"
v-for="(item, index) in box1Data[box1DataIndex]?.industryVOList"
:key="index"
>
{{ item }}
</div>
</div>
......@@ -133,8 +146,12 @@
</div>
</div>
</div>
<img src="./assets/images/right-left-icon2.png" alt=""
style="margin-top: 174px; width: 24px; height: 48px" @click="changeBox1Data('next')" />
<img
src="./assets/images/right-left-icon2.png"
alt=""
style="margin-top: 174px; width: 24px; height: 48px"
@click="changeBox1Data('next')"
/>
</div>
</div>
<div class="box2">
......@@ -149,11 +166,14 @@
</div>
<div class="box2-main">
<div class="box2-main-item" v-for="(item, index) in warningList" :key="index">
<div class="item-left" :class="{
itemLeftStatus1: item.status === '一般风险 ' || item.status === '暂无数值',
itemLeftStatus2: item.status === '重大风险',
itemLeftStatus3: item.status === '特别重大'
}">
<div
class="item-left"
:class="{
itemLeftStatus1: item.status === '一般风险 ' || item.status === '暂无数值',
itemLeftStatus2: item.status === '重大风险',
itemLeftStatus3: item.status === '特别重大'
}"
>
{{ item.status || "一般风险" }}
</div>
<div class="item-right">
......@@ -207,14 +227,20 @@
<div class="header-title">{{ "智库人物动态" }}</div>
</div>
<div class="box4-tag-box">
<div class="tag" :class="{
tagActive: box4ActiveTag === tag.name,
tag1: tag.status === 1,
tag2: tag.status === 2,
tag3: tag.status === 3,
tag4: tag.status === 4,
tag5: tag.status === 5
}" v-for="(tag, index) in box4TagList" :key="index" @click="handleClickBox4Tag(tag.name)">
<div
class="tag"
:class="{
tagActive: box4ActiveTag === tag.name,
tag1: tag.status === 1,
tag2: tag.status === 2,
tag3: tag.status === 3,
tag4: tag.status === 4,
tag5: tag.status === 5
}"
v-for="(tag, index) in box4TagList"
:key="index"
@click="handleClickBox4Tag(tag.name)"
>
{{ tag.name }}
</div>
</div>
......@@ -246,8 +272,13 @@
</div>
<div class="box5-select-box">
<el-select v-model="box5selectetedYear" placeholder="选择时间" style="width: 120px">
<el-option v-for="item in box5YearList" :key="item.value" :label="item.label" :value="item.value"
@click="changeBox5Data(item.value)" />
<el-option
v-for="item in box5YearList"
:key="item.value"
:label="item.label"
:value="item.value"
@click="changeBox5Data(item.value)"
/>
</el-select>
</div>
</div>
......@@ -261,8 +292,13 @@
<div class="header-title">{{ "政策建议领域分布" }}</div>
<div class="box6-select-box">
<el-select v-model="box6selectetedYear" placeholder="选择时间" style="width: 120px">
<el-option v-for="item in box6YearList" :key="item.value" :label="item.label" :value="item.value"
@click="handleBox6()" />
<el-option
v-for="item in box6YearList"
:key="item.value"
:label="item.label"
:value="item.value"
@click="handleBox6()"
/>
</el-select>
</div>
</div>
......@@ -291,19 +327,28 @@
</div>
<div class="box8-select-box">
<el-select v-model="box8selectetedYear" placeholder="选择时间" style="width: 120px">
<el-option v-for="item in box8YearList" :key="item.value" :label="item.label" :value="item.value"
@click="changeBox8Data(item.value)" />
<el-option
v-for="item in box8YearList"
:key="item.value"
:label="item.label"
:value="item.value"
@click="changeBox8Data(item.value)"
/>
</el-select>
</div>
</div>
<div class="box8-main">
<div class="box8-item" v-for="(item, index) in box8Data" :key="index">
<div class="item-left"
:class="{ itemBold1: index === 0, itemBold2: index === 1, itemBold3: index === 2 }">
<div
class="item-left"
:class="{ itemBold1: index === 0, itemBold2: index === 1, itemBold3: index === 2 }"
>
{{ index + 1 }}
</div>
<div class="item-center"
:class="{ itemBold1: index === 0, itemBold2: index === 1, itemBold3: index === 2 }">
<div
class="item-center"
:class="{ itemBold1: index === 0, itemBold2: index === 1, itemBold3: index === 2 }"
>
{{ item.clause }}
</div>
<div class="item-right">{{ `${item.count}份报告 >` }}</div>
......@@ -317,8 +362,13 @@
<DivideHeader id="position4" class="divide-header" :titleText="'资源库'"></DivideHeader>
<div class="home-main-footer-header">
<div class="btn-box">
<div class="btn" :class="{ btnActive: activeCate === cate }" v-for="(cate, index) in categoryList"
:key="index" @click="handleClickCate(cate)">
<div
class="btn"
:class="{ btnActive: activeCate === cate }"
v-for="(cate, index) in categoryList"
:key="index"
@click="handleClickCate(cate)"
>
{{ cate }}
</div>
</div>
......@@ -332,11 +382,22 @@
</div>
<div class="select-main">
<div class="checkbox-group">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">
<el-checkbox
v-model="checkAll"
:indeterminate="isIndeterminate"
class="all-checkbox"
@change="handleCheckAllChange"
>
全部领域
</el-checkbox>
<el-checkbox v-for="research in areaList" :key="research.id" v-model="selectedAreaList"
:label="research.id" @change="handleCheckedAreaChange()" class="filter-checkbox">
<el-checkbox
v-for="research in areaList"
:key="research.id"
v-model="selectedAreaList"
:label="research.id"
@change="handleCheckedAreaChange()"
class="filter-checkbox"
>
{{ research.name }}
</el-checkbox>
</div>
......@@ -350,13 +411,22 @@
</div>
<div class="select-main">
<div class="checkbox-group">
<el-checkbox v-model="checkAllTime" :indeterminate="isIndeterminateTime"
@change="handleCheckAllChangeTime">
<el-checkbox
v-model="checkAllTime"
class="all-checkbox"
:indeterminate="isIndeterminateTime"
@change="handleCheckAllChangeTime"
>
全部时间
</el-checkbox>
<el-checkbox-group v-model="selectedPubTimeList">
<el-checkbox v-for="time in pubTimeList" :key="time.id" :label="time.id" class="filter-checkbox"
@change="handleCheckedAreaChangeTime()">
<el-checkbox
v-for="time in pubTimeList"
:key="time.id"
:label="time.id"
class="filter-checkbox"
@change="handleCheckedAreaChangeTime()"
>
{{ time.name }}
</el-checkbox>
</el-checkbox-group>
......@@ -366,8 +436,12 @@
</div>
<div class="right">
<div class="card-box">
<div class="footer-card" v-for="(item, index) in curFooterList" :key="index"
@click="handleToReportDetail(item.id)">
<div
class="footer-card"
v-for="(item, index) in curFooterList"
:key="index"
@click="handleToReportDetail(item.id)"
>
<div class="footer-card-top">
<img :src="item.imageUrl" alt="" />
</div>
......@@ -381,10 +455,16 @@
</div>
</div>
<div class="right-footer">
<div class="info">{{ total }}调查</div>
<div class="info">{{ total }}智库报告</div>
<div class="page-box">
<el-pagination :page-size="12" background layout="prev, pager, next" :total="total"
@current-change="handleCurrentChange" :current-page="currentPage" />
<el-pagination
:page-size="12"
background
layout="prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="currentPage"
/>
</div>
</div>
</div>
......@@ -449,6 +529,7 @@ import Img12 from "./assets/images/img12.png";
import Box1Img from "./assets/images/box1-img.png";
import Box1Logo from "./assets/images/box1-logo.png";
import { setCanvasCreator } from "echarts/core";
import { ElMessage } from "element-plus";
const input = ref(""); //搜索科技人物及观点
// 智库列表
......@@ -723,12 +804,11 @@ function changeBox5Data(value) {
}
// 政策建议趋势分布
const handleGetThinkTankPolicyIndustryChange = async date => {
try {
const res = await getThinkTankPolicyIndustryChange(date);
console.log("政策建议趋势分布", res);
if (res.code === 200 && res.data) {
const originalData = res.data
const originalData = res.data;
// 提取年份
const years = originalData.map(item => item.year);
// 提取所有行业名称
......@@ -758,10 +838,9 @@ const handleGetThinkTankPolicyIndustryChange = async date => {
result.data.push(industryData);
});
box5Data.value = result;
console.log(box5Data.value, 'console.log(box5Data.value)console.log(box5Data.value)')
console.log(box5Data.value, "console.log(box5Data.value)console.log(box5Data.value)");
} else {
box5Data.value = []
box5Data.value = [];
}
} catch (error) {
console.error("获取政策建议趋势分布error", error);
......@@ -769,11 +848,9 @@ const handleGetThinkTankPolicyIndustryChange = async date => {
};
const handleBox5 = async date => {
await handleGetThinkTankPolicyIndustryChange(date);
console.log(box5Data.value, 'console.log(box5Data.value)console.log(box5Data.value)')
console.log(box5Data.value, "console.log(box5Data.value)console.log(box5Data.value)");
let box5Chart = box5Data.value ? getMultiLineChart(
box5Data.value
) : ''
let box5Chart = box5Data.value ? getMultiLineChart(box5Data.value) : "";
setChart(box5Chart, "box5Chart");
};
......@@ -844,13 +921,11 @@ const handleGetThinkTankPolicyIndustry = async () => {
const res = await getThinkTankPolicyIndustry(params);
console.log("政策建议领域分布", res);
if (res.code === 200 && res.data) {
box6Data.value = res.data.map((item, index) => ({
name: item.industry,
value: item.amount,
color: colors[index % colors.length] // 循环使用颜色数组
}));
} else {
box6Data.value = [];
}
......@@ -1124,7 +1199,6 @@ const handleCheckedAreaChange = () => {
};
const pubTimeList = ref([
{
id: 2025,
name: "2025"
......@@ -1154,7 +1228,6 @@ const selectedPubTimeList = ref([""]);
const checkAllTime = ref(false);
const isIndeterminateTime = ref(true);
const handleCheckAllChangeTime = val => {
// console.log(val, "handleCheckAllChange");
if (val) {
......@@ -1178,7 +1251,6 @@ const handleCheckedAreaChangeTime = () => {
handleGetetThinkTankReport();
};
const curFooterList = ref([
{
title: "中国对AI的转型产业政策",
......@@ -1257,10 +1329,10 @@ const currentPage = ref(1);
const total = ref(0);
// 处理页码改变事件
const handleCurrentChange = page => {
console.log(page, 'pagepagepage')
console.log(page, "pagepagepage");
currentPage.value = page;
handleGetetThinkTankReport();
}
};
function arrayToString(arr) {
return arr.reduce((acc, item) => {
if (item !== null && item !== undefined && item !== "") {
......@@ -1293,6 +1365,10 @@ const handleGetetThinkTankReport = async () => {
const handleClick = tank => {
console.log(tank);
// router.push({ name: "ThinkTankDetail", params: { id: tank.id } });
if (!tank.id) {
ElMessage.warning("当前智库id为空,无法进入详情页");
return;
}
const curRoute = router.resolve({ name: "ThinkTankDetail", params: { id: tank.id, name: tank.name } });
window.open(curRoute.href, "_blank");
};
......@@ -1310,15 +1386,15 @@ const handleToMoreRiskSignal = () => {
window.open(route.href, "_blank");
};
const handleToReportDetail = (id) => {
const handleToReportDetail = id => {
const route = router.resolve({
name: 'ReportDetail',
name: "ReportDetail",
params: {
id: id
}
});
window.open(route.href, "_blank");
}
};
onMounted(async () => {
handleGetThinkTankList();
......@@ -2921,15 +2997,14 @@ onMounted(async () => {
.right {
width: 1284px;
height: 1377px;
max-height: 1377px;
.card-box {
width: 1226px;
height: 1248px;
max-height: 1248px;
min-height: 616px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 16px 16px;
.footer-card {
width: 398px;
height: 300px;
......@@ -2989,6 +3064,7 @@ onMounted(async () => {
}
.right-footer {
height: 50px;
margin-top: 43px;
display: flex;
justify-content: space-between;
......@@ -3016,6 +3092,10 @@ onMounted(async () => {
margin-bottom: 36px;
}
.all-checkbox {
width: 220px;
}
.filter-checkbox {
width: 105px;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论