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

update

...@@ -192,6 +192,16 @@ export function getThinkTankPerson(params) { ...@@ -192,6 +192,16 @@ export function getThinkTankPerson(params) {
}) })
} }
//智库报告:获取报告全局信息
export const getThinkTankReportSummary = (params) => {
return request(
{
method: 'GET',
url: `/api/thinkTankReport/summary/${params}`,
}
);
}
//获取报告内容摘要 //获取报告内容摘要
export function getThinkTankReportAbstract(params) { export function getThinkTankReportAbstract(params) {
return request({ return request({
......
...@@ -5,15 +5,20 @@ ...@@ -5,15 +5,20 @@
<div class="news-header"> <div class="news-header">
新闻速览 新闻速览
</div> </div>
<div style="display: flex;padding: 3vh;justify-content: center; "> <div class="input-box">
<el-input placeholder="请输入关键词" :suffix-icon="searchInput" clearable style="width: 60vw;height: 5vh;"> <el-input placeholder="请输入关键词" :suffix-icon="searchInput" clearable style="width: 800px;height: 48px;">
</el-input> </el-input>
</div> </div>
<div style="display: flex;padding: 3vh;justify-content: center; "> <div class="btn-box">
<div v-for="item in btnList" :class="btnSelect !== item ? 'header-btn' : 'header-btn-select'" <div v-for="item,index in btnList" :key="index" :class="btnSelect !== item ? 'header-btn' : 'header-btn-select'"
@click="changeBtn(item)"> @click="changeBtn(item)">
{{ 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>
<div class="header-btn-more"> <div class="header-btn-more">
<img src="@/assets/icons/adjustment.png" /> <img src="@/assets/icons/adjustment.png" />
...@@ -21,7 +26,7 @@ ...@@ -21,7 +26,7 @@
</div> </div>
</div> </div>
<div style="display: flex;"> <div class="main" style="display: flex;">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<img class="box-header-img" src="@/assets/icons/Headlines-icon.svg"></img> <img class="box-header-img" src="@/assets/icons/Headlines-icon.svg"></img>
...@@ -30,7 +35,7 @@ ...@@ -30,7 +35,7 @@
</div> </div>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
<div v-for="item in HeadlinesData"> <div v-for="item,index in HeadlinesData" :key="index">
<div style="display: flex;"> <div style="display: flex;">
<div> <div>
<div class="title-blob"> <div class="title-blob">
...@@ -40,7 +45,7 @@ ...@@ -40,7 +45,7 @@
新闻来源: {{ item.from }} 发表时间:{{ item.time }} 新闻来源: {{ item.from }} 发表时间:{{ item.time }}
</div> </div>
<div style="display: flex;"> <div style="display: flex;">
<div v-for="tag in item.tag" class="tag"> <div v-for="tag,index in item.tag" :key="index" class="tag">
{{ tag }} {{ tag }}
</div> </div>
</div> </div>
...@@ -64,7 +69,7 @@ ...@@ -64,7 +69,7 @@
<div class="divider"> <div class="divider">
</div> </div>
<div v-for="(item, index) in subjectData"> <div v-for="(item, index) in subjectData" :key="index">
<div class="subject-line"> <div class="subject-line">
<!-- 左侧:序号 + 文字 --> <!-- 左侧:序号 + 文字 -->
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
...@@ -99,88 +104,87 @@ ...@@ -99,88 +104,87 @@
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import Headlines from './Headlines.vue' import Headlines from "./Headlines.vue";
import Subject from './Subject.vue' import Subject from "./Subject.vue";
// import style from './style.css' // import style from './style.css'
//顶部数据搜索 //顶部数据搜索
const searchInput = ref('') const searchInput = ref("");
const btnList = ref(["新闻纵览", "焦点新闻", "全球热点", "军事热点", "台湾动向", "美国政治", "亚洲局势", "东亚动态"]) const btnList = ref(["新闻纵览", "焦点新闻", "全球热点", "军事热点", "台湾动向", "美国政治", "亚洲局势", "东亚动态"]);
const btnSelect = ref('新闻纵览') const btnSelect = ref("新闻纵览");
const HeadlinesData = ref([ const HeadlinesData = ref([
{ {
"title": "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”", title: "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”",
"from": "人民网", from: "人民网",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["以色列", "美国"], tag: ["以色列", "美国"],
"image": '/testData/HeadlinesData-img.png', image: "/testData/HeadlinesData-img.png"
}, },
{ {
"title": "IMF上调中东和北非地区经济增长预期", title: "IMF上调中东和北非地区经济增长预期",
"from": "CNN", from: "CNN",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["经济", "中东", "IMF"], tag: ["经济", "中东", "IMF"],
"image": '/testData/HeadlinesData-img.png', image: "/testData/HeadlinesData-img.png"
}, },
{ {
"title": "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面", title: "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面",
"from": "人民网", from: "人民网",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["日本", "访华"], "image": '/testData/HeadlinesData-img.png', tag: ["日本", "访华"],
}, image: "/testData/HeadlinesData-img.png"
{ },
"title": "韩日因独岛主权争议暂停本月联合搜救演习", {
"from": "凤凰网", title: "韩日因独岛主权争议暂停本月联合搜救演习",
"time": "2025-10-05", from: "凤凰网",
"tag": ["独岛", "联合军演", "韩国", "日本"], "image": '/testData/HeadlinesData-img.png', time: "2025-10-05",
}, tag: ["独岛", "联合军演", "韩国", "日本"],
{ image: "/testData/HeadlinesData-img.png"
"title": "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结", },
"from": "央视网", {
"time": "2025-10-05", title: "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结",
"tag": ["美国", "航母", "加勒比海"], "image": '/testData/HeadlinesData-img.png', from: "央视网",
} time: "2025-10-05",
]) tag: ["美国", "航母", "加勒比海"],
image: "/testData/HeadlinesData-img.png"
}
]);
function changeBtn(btn) { function changeBtn(btn) {
btnSelect.value = btn btnSelect.value = btn;
} }
//当前页面显示 //当前页面显示
const showPage = ref('home') const showPage = ref("home");
function changePage(page) { function changePage(page) {
console.log(page) console.log(page);
showPage.value = page showPage.value = page;
} }
//博弈专题新闻数据 //博弈专题新闻数据
const subjectData = ref([ const subjectData = ref([
{ id: 1, text: "乌克兰与法国签署意向书 将获 100 架“阵风”战机及多套防空系统", arrow: 0 }, { id: 1, text: "乌克兰与法国签署意向书 将获 100 架“阵风”战机及多套防空系统", arrow: 0 },
{ id: 2, text: "安理会通过涉加沙决议 建立和平委员会作为过渡行政机构", arrow: 1 }, { id: 2, text: "安理会通过涉加沙决议 建立和平委员会作为过渡行政机构", arrow: 1 },
{ id: 3, text: "日本首相高市早苗涉台及修“无核三原则”言论遭多方强烈反对", arrow: 1 }, { id: 3, text: "日本首相高市早苗涉台及修“无核三原则”言论遭多方强烈反对", arrow: 1 },
{ id: 4, text: "美“福特”号航母打击群进入加勒比海 委方谴责其意图策动政权更迭", arrow: 1 }, { id: 4, text: "美“福特”号航母打击群进入加勒比海 委方谴责其意图策动政权更迭", arrow: 1 },
{ id: 5, text: "BBC回应特朗普10亿-50亿美元索赔诉讼 称诽谤指控无依据", arrow: 1 }, { id: 5, text: "BBC回应特朗普10亿-50亿美元索赔诉讼 称诽谤指控无依据", arrow: 1 },
{ id: 6, text: "俄军打击乌142个区域设施 乌军击落或压制91架俄无人机", arrow: 1 }, { id: 6, text: "俄军打击乌142个区域设施 乌军击落或压制91架俄无人机", arrow: 1 },
{ id: 7, text: "中国女法官张玲玲以第一高票当选联合国上诉法庭法官", arrow: 0 }, { id: 7, text: "中国女法官张玲玲以第一高票当选联合国上诉法庭法官", arrow: 0 },
{ id: 8, text: "美股三大股指17日收盘普跌 比特币跌破92000美元", arrow: 1 }, { id: 8, text: "美股三大股指17日收盘普跌 比特币跌破92000美元", arrow: 1 },
{ id: 9, text: "高盛大幅下调2026年布伦特和WTI原油价格预测", arrow: 1 }, { id: 9, text: "高盛大幅下调2026年布伦特和WTI原油价格预测", arrow: 1 },
{ id: 10, text: "2026米兰冬奥会火炬传递完整路线公布 将穿越意大利全部20个大区", arrow: 1 }, { id: 10, text: "2026米兰冬奥会火炬传递完整路线公布 将穿越意大利全部20个大区", arrow: 1 },
{ id: 11, text: "特朗普宣称若重掌白宫将推动美国开展自1992年以来首次核试验", arrow: 1 }, { id: 11, text: "特朗普宣称若重掌白宫将推动美国开展自1992年以来首次核试验", arrow: 1 },
{ id: 12, text: "欧盟发布2025年秋季经济预测 欧元区今年GDP预计增长1.3%", arrow: 1 } { id: 12, text: "欧盟发布2025年秋季经济预测 欧元区今年GDP预计增长1.3%", arrow: 1 }
]) ]);
</script> </script>
<style scoped> <style lang="scss" scoped>
@import url('./style.css'); @import url("./style.css");
.newsBrief-page { .newsBrief-page {
max-width: 100vw; height: 100%;
height: 100%; background: url("@/assets/images/background.png") no-repeat;
overflow: hidden; background-position: center -100px;
margin: 0 auto; background-size: 100% 100%;
padding: 5vh 10vw 20vh 10vw; padding-top: 50px;
background: url('@/assets/images/background.png') no-repeat;
background-position: center -100px;
background-size: 100% 100%;
min-height: 100vh;
} }
</style> </style>
/* 分割线 */
/* 左右横线 + 中间文字 */
.news-header { .news-header {
color: rgba(34, 41, 52, 1); color: rgba(34, 41, 52, 1);
font-family: "YouSheBiaoTiHei", sans-serif; font-family: YouSheBiaoTiHei;
font-size: 46px; font-size: 46px;
font-weight: 400; font-weight: 400;
line-height: 60px; line-height: 60px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: center; text-align: center;
margin: 0 auto;
}
.input-box {
width: 800px;
height: 48px;
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);
margin: 20px auto 0;
}
.btn-box {
display: flex;
justify-content: center;
gap: 16px;
margin-top: 60px;
margin-bottom: 24px;
} }
.header-btn { .header-btn {
cursor: pointer; cursor: pointer;
padding: 2px 20px; padding: 0px 20px;
box-sizing: border-box; box-sizing: border-box;
margin: 5px;
border: 1px solid rgba(255, 255, 255, 1); border: 1px solid rgba(255, 255, 255, 1);
border-radius: 32px; border-radius: 32px;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
color: rgba(95, 101, 108, 1); color: rgba(95, 101, 108, 1);
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 30px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: center; text-align: center;
position: relative;
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}
.header-btn:hover {
background: rgba(231, 243, 255, 1);
} }
.header-btn-gray { .header-btn-gray {
cursor: pointer; cursor: pointer;
padding: 2px 20px; padding: 2px 20px;
...@@ -40,21 +67,36 @@ ...@@ -40,21 +67,36 @@
letter-spacing: 0px; letter-spacing: 0px;
text-align: center; text-align: center;
} }
.header-btn-select { .header-btn-select {
cursor: pointer; cursor: pointer;
padding: 2px 20px; padding: 0px 20px;
margin: 5px;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid rgba(174, 214, 255, 1); border: 1px solid rgba(174, 214, 255, 1);
border-radius: 32px; border-radius: 32px;
background: rgba(231, 243, 255, 1); background: rgba(231, 243, 255, 1);
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 30px; color: var(--color-main-active);
letter-spacing: 0px; letter-spacing: 0px;
text-align: center; text-align: center;
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
} }
.btn-box-icon {
width: 6px;
height: 12px;
}
.btn-box-icon img {
width: 100%;
height: 100%;
}
.header-btn-more { .header-btn-more {
cursor: pointer; cursor: pointer;
width: 34px; width: 34px;
...@@ -64,51 +106,65 @@ ...@@ -64,51 +106,65 @@
border: 1px solid, rgba(255, 255, 255, 1); border: 1px solid, rgba(255, 255, 255, 1);
border-radius: 32px; border-radius: 32px;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
display: flex; /* 开启 flex */ display: flex;
justify-content: center; /* 水平居中 */ /* 开启 flex */
align-items: center; /* 垂直居中 */ justify-content: center;
/* 水平居中 */
align-items: center;
/* 垂直居中 */
} }
.main {
width: 1440px;
height: 714px;
margin: 0 auto;
}
.box { .box {
width: 48%; width: 712px;
height: 55vh; height: 656px;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid rgba(231, 243, 255, 1); border: 1px solid rgba(231, 243, 255, 1);
border-radius: 10px; border-radius: 10px;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
padding: 1vw; padding: 1vw;
.box-header {
height: 4vh; }
display: flex;
text-align: left; .box-header {
font-size: 24px; height: 56px;
font-weight: 700; display: flex;
align-items: center; text-align: left;
.box-header-img { font-size: 24px;
height: 24px; font-weight: 700;
width: 24px; align-items: center;
margin: 0 5px; }
}
} .box-header-img {
.title-blob { height: 24px;
font-size: 16px; width: 24px;
font-weight: 400; margin: 0 5px;
line-height: 30px; }
letter-spacing: 0px;
text-align: left; .title-blob {
} font-size: 16px;
font-weight: 400;
.tag { line-height: 30px;
margin: 2px; letter-spacing: 0px;
padding: 2px 8px 2px 8px; text-align: left;
border-radius: 4px; }
background: rgba(223, 226, 231, 0.41);
color: rgba(132, 136, 142, 1); .tag {
font-size: 14px; margin: 2px;
font-weight: 400; padding: 2px 8px 2px 8px;
line-height: 22px; border-radius: 4px;
letter-spacing: 0px; background: rgba(223, 226, 231, 0.41);
text-align: left; color: rgba(132, 136, 142, 1);
} font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: left;
} }
.content { .content {
...@@ -119,6 +175,7 @@ ...@@ -119,6 +175,7 @@
letter-spacing: 0px; letter-spacing: 0px;
text-align: left; text-align: left;
} }
.divider { .divider {
width: 100%; width: 100%;
height: 1px; height: 1px;
...@@ -133,3 +190,16 @@ ...@@ -133,3 +190,16 @@
height: 2.7vh; height: 2.7vh;
margin: 1vh 0; margin: 1vh 0;
} }
:deep(.el-input__wrapper) {
box-shadow: none;
border-radius: 10px;
}
:deep(.el-input__wrapper:hover) {
box-shadow: none !important;
}
:deep(.el-input__wrapper.is-focus) {
box-shadow: none !important;
}
\ No newline at end of file
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<div class="icon"> <div class="icon">
<img src="./images/btn-icon2.png" alt="" /> <img src="./images/btn-icon2.png" alt="" />
</div> </div>
<div class="text">{{ "报告原文" }}</div> <div class="text" @click="toReport()">{{ "报告原文" }}</div>
</div> </div>
<div class="btn"> <div class="btn">
<div class="icon"> <div class="icon">
...@@ -71,16 +71,41 @@ ...@@ -71,16 +71,41 @@
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref, onMounted } from "vue";
import ReportAnalysis from './reportAnalysis/index.vue' import ReportAnalysis from './reportAnalysis/index.vue'
import PolicyTracking from './policyTracking/index.vue' import PolicyTracking from './policyTracking/index.vue'
import {
getThinkTankReportSummary
} from "@/api/thinkTank/overview";
import { useRouter } from "vue-router";
const router = useRouter();
const reportUrl = ref('')
// 获取报告全局信息
const handleGetThinkTankReportSummary = async () => {
try {
const res = await getThinkTankReportSummary(router.currentRoute._value.params.id);
console.log("报告全局信息", res);
if (res.code === 200 && res.data) {
reportUrl.value = res.data.reportUrl
}
} catch (error) {
console.error("获取报告全局信息error", error);
}
};
const toReport = () => {
window.open(reportUrl.value, "_blank");
}
const tabActiveName = ref("报告分析"); const tabActiveName = ref("报告分析");
const switchTab = name => { const switchTab = name => {
tabActiveName.value = name; tabActiveName.value = name;
}; };
onMounted(async () => {
handleGetThinkTankReportSummary()
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -39,13 +39,8 @@ ...@@ -39,13 +39,8 @@
</div> </div>
<div class="box2-main"> <div class="box2-main">
<div class="box2-main-tag-box"> <div class="box2-main-tag-box">
<div <div class="tag" :class="{ tagActive: activeArea === item }" v-for="(item, index) in areaList" :key="index"
class="tag" @click="handleClickArea(item.status)">
:class="{ tagActive: activeArea === item }"
v-for="(item, index) in areaList"
:key="index"
@click="handleClickArea(item.status)"
>
{{ item.industryName }} {{ item.industryName }}
</div> </div>
</div> </div>
...@@ -79,7 +74,7 @@ ...@@ -79,7 +74,7 @@
<div class="box3-main-main"> <div class="box3-main-main">
<div class="box3-item" v-for="(item, index) in majorOpinions" :key="index"> <div class="box3-item" v-for="(item, index) in majorOpinions" :key="index">
<div class="left"> <div class="left">
{{ item.id }} {{ index + 1 }}
</div> </div>
<div class="center"> <div class="center">
<div class="title">{{ item.content }}</div> <div class="title">{{ item.content }}</div>
...@@ -101,14 +96,8 @@ ...@@ -101,14 +96,8 @@
<div class="box3-main-footer"> <div class="box3-main-footer">
<div class="info">{{ total }}项调查</div> <div class="info">{{ total }}项调查</div>
<div class="page-box"> <div class="page-box">
<el-pagination <el-pagination :page-size="12" background layout="prev, pager, next" :total="total"
:page-size="12" @current-change="handleCurrentChange" :current-page="currentPage" />
background
layout="prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="currentPage"
/>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -12,13 +12,8 @@ ...@@ -12,13 +12,8 @@
<div class="box-main"> <div class="box-main">
<div class="select-box"> <div class="select-box">
<el-select v-model="box1SelectYear" placeholder="选择时间" style="width: 100px"> <el-select v-model="box1SelectYear" placeholder="选择时间" style="width: 100px">
<el-option <el-option v-for="(item, index) in box1YearList" :key="index" :label="item.label" :value="item.value"
v-for="(item, index) in box1YearList" @click="handleGetThinkPolicyIndustry()" />
:key="index"
:label="item.label"
:value="item.value"
@click="handleGetThinkPolicyIndustry()"
/>
</el-select> </el-select>
</div> </div>
<div id="box1Chart"></div> <div id="box1Chart"></div>
...@@ -35,26 +30,16 @@ ...@@ -35,26 +30,16 @@
<div class="box-main"> <div class="box-main">
<div class="select-box"> <div class="select-box">
<el-select v-model="box2SelectYear" placeholder="选择时间" style="width: 100px"> <el-select v-model="box2SelectYear" placeholder="选择时间" style="width: 100px">
<el-option <el-option v-for="item in box2YearList" :key="item.value" :label="item.label" :value="item.value"
v-for="item in box2YearList" @click="handleGetThinkPolicyIndustryTotal()" />
:key="item.value"
:label="item.label"
:value="item.value"
@click="handleGetThinkPolicyIndustryTotal()"
/>
</el-select> </el-select>
</div> </div>
<div id="box2Chart"> <div id="box2Chart">
<div class="box2-item" v-for="(item, index) in box2Data" :key="index"> <div class="box2-item" v-for="(item, index) in box2Data" :key="index">
<div class="icon" :style="{ background: item.color }"></div> <div class="icon" :style="{ background: item.color }"></div>
<div class="name">{{ item.industry }}</div> <div class="name">{{ item.industry }}</div>
<el-progress <el-progress :show-text="false" :color="box2ColorList[index]" style="width: 170px" stroke-width="8"
:show-text="false" :percentage="item.percent" />
:color="box2ColorList[index]"
style="width: 170px"
stroke-width="8"
:percentage="item.percent"
/>
<div class="num">{{ item.amount + "项" }} / {{ item.totalAmount + "项" }}</div> <div class="num">{{ item.amount + "项" }} / {{ item.totalAmount + "项" }}</div>
<div class="per">{{ item.percent + "%" }}</div> <div class="per">{{ item.percent + "%" }}</div>
</div> </div>
...@@ -75,13 +60,8 @@ ...@@ -75,13 +60,8 @@
<div class="box-main"> <div class="box-main">
<div class="select-box"> <div class="select-box">
<el-select v-model="box3SelectYear" placeholder="选择时间" style="width: 100px"> <el-select v-model="box3SelectYear" placeholder="选择时间" style="width: 100px">
<el-option <el-option v-for="item in box3YearList" :key="item.value" :label="item.label" :value="item.value"
v-for="item in box3YearList" @click="handleGetThinkPolicyIndustryChange()" />
:key="item.value"
:label="item.label"
:value="item.value"
@click="handleGetThinkPolicyIndustryChange()"
/>
</el-select> </el-select>
</div> </div>
<div id="box3Chart"></div> <div id="box3Chart"></div>
...@@ -119,14 +99,8 @@ ...@@ -119,14 +99,8 @@
class="filter-checkbox"> class="filter-checkbox">
{{ item }} {{ item }}
</el-checkbox> --> </el-checkbox> -->
<el-checkbox <el-checkbox style="width: 180px" v-for="research in areaList" :key="research.id"
style="width: 180px" v-model="selectedAreaList" :label="research.id" class="filter-checkbox">
v-for="research in areaList"
:key="research.id"
v-model="selectedAreaList"
:label="research.id"
class="filter-checkbox"
>
{{ research.name }} {{ research.name }}
</el-checkbox> </el-checkbox>
</div> </div>
...@@ -140,8 +114,8 @@ ...@@ -140,8 +114,8 @@
<img :src="item.imageUrl" alt="" /> <img :src="item.imageUrl" alt="" />
</div> </div>
<div class="item-right"> <div class="item-right">
<div class="title">{{ item.name }}</div> <div class="title">{{ item.content }}</div>
<div class="info">{{ item.times }} · {{ item.content }}</div> <div class="info">{{ item.times }} · {{ item.name }}</div>
<div class="tag-box"> <div class="tag-box">
<div class="tag" v-for="(tag, idx) in item.tagList" :key="idx"> <div class="tag" v-for="(tag, idx) in item.tagList" :key="idx">
{{ tag }} {{ tag }}
...@@ -169,14 +143,8 @@ ...@@ -169,14 +143,8 @@
<div class="right-footer"> <div class="right-footer">
<div class="info">{{ total }}项调查</div> <div class="info">{{ total }}项调查</div>
<div class="page-box"> <div class="page-box">
<el-pagination <el-pagination :page-size="12" background layout="prev, pager, next" :total="total"
:page-size="12" @current-change="handleCurrentChange" :current-page="currentPage" />
background
layout="prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="currentPage"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -797,6 +765,7 @@ onMounted(() => { ...@@ -797,6 +765,7 @@ onMounted(() => {
.select-box { .select-box {
margin-top: 21px; margin-top: 21px;
.select-box-header { .select-box-header {
display: flex; display: flex;
gap: 17px; gap: 17px;
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<img :src="item.logo" alt="" /> <img :src="item.logo" alt="" />
</div> </div>
<div class="rank" :class="{ rank1: item.rank === 1, rank2: item.rank === 2, rank3: item.rank === 3 }"> <div class="rank" :class="{ rank1: item.rank === 1, rank2: item.rank === 2, rank3: item.rank === 3 }">
{{ "No." + item.rank }} {{ "No." + (index + 1) }}
</div> </div>
</div> </div>
<div class="card-title"> <div class="card-title">
...@@ -673,21 +673,21 @@ const messageList = ref([ ...@@ -673,21 +673,21 @@ const messageList = ref([
// 政策建议趋势分布 // 政策建议趋势分布
const box5Data = ref({ const box5Data = ref({
title: ["2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"], // title: ["2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
data: [ // data: [
{ // {
name: "人工智能", // name: "人工智能",
value: [73, 32, 42, 48, 38, 49, 63, 75, 70, 86, 95, 87] // value: [73, 32, 42, 48, 38, 49, 63, 75, 70, 86, 95, 87]
}, // },
{ // {
name: "集成电路", // name: "集成电路",
value: [8, 3, 2, 8, 9, 10, 12, 18, 16, 18, 20, 22] // value: [8, 3, 2, 8, 9, 10, 12, 18, 16, 18, 20, 22]
}, // },
{ // {
name: "量子科技", // name: "量子科技",
value: [1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3] // value: [1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3]
} // }
] // ]
}); });
//获取当前时间x年前的日期 //获取当前时间x年前的日期
...@@ -723,12 +723,45 @@ function changeBox5Data(value) { ...@@ -723,12 +723,45 @@ function changeBox5Data(value) {
} }
// 政策建议趋势分布 // 政策建议趋势分布
const handleGetThinkTankPolicyIndustryChange = async date => { const handleGetThinkTankPolicyIndustryChange = async date => {
try { try {
const res = await getThinkTankPolicyIndustryChange(date); const res = await getThinkTankPolicyIndustryChange(date);
console.log("政策建议趋势分布", res); console.log("政策建议趋势分布", res);
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
const originalData = res.data
// 提取年份
const years = originalData.map(item => item.year);
// 提取所有行业名称
const industries = new Set();
originalData.forEach(item => {
item.industryList.forEach(industry => {
industries.add(industry.industry);
});
});
// 初始化目标数据结构
const result = {
title: years,
data: []
};
// 遍历每个行业,生成对应的 value 数组
industries.forEach(industry => {
const industryData = {
name: industry,
value: []
};
originalData.forEach(yearData => {
const amount = yearData.industryList.find(i => i.industry === industry)?.amount || 0;
industryData.value.push(amount);
});
result.data.push(industryData);
});
box5Data.value = result;
console.log(box5Data.value, 'console.log(box5Data.value)console.log(box5Data.value)')
} else { } else {
box5Data.value = []; box5Data.value = []
} }
} catch (error) { } catch (error) {
console.error("获取政策建议趋势分布error", error); console.error("获取政策建议趋势分布error", error);
...@@ -736,12 +769,11 @@ const handleGetThinkTankPolicyIndustryChange = async date => { ...@@ -736,12 +769,11 @@ const handleGetThinkTankPolicyIndustryChange = async date => {
}; };
const handleBox5 = async date => { const handleBox5 = async date => {
await handleGetThinkTankPolicyIndustryChange(date); await handleGetThinkTankPolicyIndustryChange(date);
let box5Chart = getMultiLineChart( console.log(box5Data.value, 'console.log(box5Data.value)console.log(box5Data.value)')
box5Data.value.title,
box5Data.value.data[0].value, let box5Chart = box5Data.value ? getMultiLineChart(
box5Data.value.data[1].value, box5Data.value
box5Data.value.data[2].value ) : ''
);
setChart(box5Chart, "box5Chart"); setChart(box5Chart, "box5Chart");
}; };
...@@ -812,6 +844,13 @@ const handleGetThinkTankPolicyIndustry = async () => { ...@@ -812,6 +844,13 @@ const handleGetThinkTankPolicyIndustry = async () => {
const res = await getThinkTankPolicyIndustry(params); const res = await getThinkTankPolicyIndustry(params);
console.log("政策建议领域分布", res); console.log("政策建议领域分布", res);
if (res.code === 200 && res.data) { 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 { } else {
box6Data.value = []; box6Data.value = [];
} }
......
import * as echarts from 'echarts' import * as echarts from 'echarts';
const getMultiLineChart = (data) => {
// 提取标题和系列数据
// const { title, series } = data;
const title = data.title
const series = data.data
// 动态生成 series 配置
const echartsSeries = series.map((item, index) => ({
name: item.name,
type: 'line',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: item.color || `rgba(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, 0.7)` // 随机颜色
},
{
offset: 1,
color: item.color ? `${item.color.replace('0.7', '0')}` : `rgba(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, 0)` // 随机颜色
}
])
},
emphasis: {
focus: 'series'
},
data: item.value
}));
const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => {
return { return {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -21,14 +48,14 @@ const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => { ...@@ -21,14 +48,14 @@ const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => {
legend: { legend: {
show: true, show: true,
top: 10, top: 10,
left:'center' left: 'center'
}, },
color: ['rgba(10, 87, 166, 0.7)', 'rgba(255, 172, 77, 0.7)','rgba(114, 46, 209, 0.7)'], color: series.map(item => item.color || `rgba(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, 0.7)`), // 动态颜色
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: dataX data: title
} }
], ],
yAxis: [ yAxis: [
...@@ -36,61 +63,8 @@ const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => { ...@@ -36,61 +63,8 @@ const getMultiLineChart = (dataX, dataY1, dataY2, dataY3) => {
type: 'value' type: 'value'
} }
], ],
series: [ series: echartsSeries
{ };
name: '人工智能', };
type: 'line',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(10, 87, 166, 0.7)' // 起始颜色
}, {
offset: 1,
color: 'rgba(10, 87, 166, 0)' // 结束颜色
}])
},
emphasis: {
focus: 'series'
},
data: dataY1
},
{
name: '集成电路',
type: 'line',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(255, 172, 77, 0.7)' // 起始颜色
}, {
offset: 1,
color: 'rgba(255, 172, 77, 0)' // 结束颜色
}])
},
emphasis: {
focus: 'series'
},
data: dataY2
},
{
name: '量子科技',
type: 'line',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: 'rgba(114, 46, 209, 0.7)' // 起始颜色
}, {
offset: 1,
color: 'rgba(114, 46, 209, 0)' // 结束颜色
}])
},
emphasis: {
focus: 'series'
},
data: dataY3
}
]
}
}
export default getMultiLineChart export default getMultiLineChart;
\ No newline at end of file \ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论