提交 577538d8 authored 作者: huhuiqing's avatar huhuiqing

智库问题修复

上级 4adce9b7
...@@ -249,3 +249,19 @@ export function getThinkTankReportPolicyAction(params) { ...@@ -249,3 +249,19 @@ export function getThinkTankReportPolicyAction(params) {
url: `/api/thinkTankReport/policyAction/${params}`, url: `/api/thinkTankReport/policyAction/${params}`,
}) })
} }
//通用接口:获取新闻资讯智库模块
export function getThinkTankReportNews() {
return request({
method: 'GET',
url: `/api/commonFeature/news/0102`,
})
}
//获取人物动态 通用接口:获取社交媒体-智库模块
export function getThinkTankReportRemarks() {
return request({
method: 'GET',
url: `/api/commonFeature/remarks/0102`,
})
}
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
</div> </div>
<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="box3SelectMonths" placeholder="选择时间" style="width: 100px">
<el-option v-for="item in box3YearList" :key="item.value" :label="item.label" :value="item.value" <el-option v-for="item in box3MonthsList" :key="item.value" :label="item.label" :value="item.value"
@click="handleGetThinkPolicyIndustryChange()" /> @click="handleGetThinkPolicyIndustryChange()" />
</el-select> </el-select>
</div> </div>
...@@ -345,8 +345,8 @@ const box3Data = ref({ ...@@ -345,8 +345,8 @@ const box3Data = ref({
// ] // ]
}); });
const box3SelectYear = ref("2025"); const box3SelectMonths = ref("2025");
const box3YearList = ref([ const box3MonthsList = ref([
{ {
label: "2025", label: "2025",
value: "2025" value: "2025"
...@@ -365,7 +365,7 @@ const handleGetThinkPolicyIndustryChange = async () => { ...@@ -365,7 +365,7 @@ const handleGetThinkPolicyIndustryChange = async () => {
try { try {
const parmas = { const parmas = {
id: router.currentRoute._value.params.id, id: router.currentRoute._value.params.id,
year: box3SelectYear.value year: box3SelectMonths.value
}; };
const res = await getThinkPolicyIndustryChange(parmas); const res = await getThinkPolicyIndustryChange(parmas);
console.log("热门研究方向变化趋势", res); console.log("热门研究方向变化趋势", res);
...@@ -515,6 +515,19 @@ function getDateYearsAgo(years) { ...@@ -515,6 +515,19 @@ function getDateYearsAgo(years) {
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
} }
function getDateMonthsAgo(months) {
// 获取当前日期
const currentDate = new Date();
// 计算指定月数之前的日期
const pastDate = new Date(currentDate);
pastDate.setMonth(currentDate.getMonth() - months); // 减去指定的月数
// 格式化日期为 "YYYY-MM-DD" 的形式
const year = pastDate.getFullYear();
const month = String(pastDate.getMonth() + 1).padStart(2, "0"); // 月份从0开始,需要加1
const day = String(pastDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
const total = ref(0); const total = ref(0);
const sort = ref(true); const sort = ref(true);
const currentPage = ref(1); const currentPage = ref(1);
......
...@@ -930,8 +930,9 @@ onMounted(() => { ...@@ -930,8 +930,9 @@ onMounted(() => {
.box3-main-left { .box3-main-left {
width: 536px; width: 536px;
height: 326px; height: 366px;
margin-left: 10px; // margin-left: 10px;
margin: 0;
} }
.box3-main-right { .box3-main-right {
......
...@@ -5,10 +5,10 @@ const getTreeMapChart = (treemapData) => { ...@@ -5,10 +5,10 @@ const getTreeMapChart = (treemapData) => {
formatter: '{b}: {c}人' formatter: '{b}: {c}人'
}, },
grid: { grid: {
top: '2%', top: '0%',
left: '2%', left: '0%',
right: '2%', right: '0%',
bottom: '2%', bottom: '0%',
containLabel: true containLabel: true
}, },
series: [ series: [
...@@ -22,12 +22,12 @@ const getTreeMapChart = (treemapData) => { ...@@ -22,12 +22,12 @@ const getTreeMapChart = (treemapData) => {
}, },
label: { label: {
show: true, show: true,
formatter: '{b}\n{c}人', formatter: '{b}',
fontSize: 12 fontSize: 10
}, },
upperLabel: { upperLabel: {
show: true, show: true,
height: 30 height: 22
}, },
itemStyle: { itemStyle: {
borderColor: '#fff', borderColor: '#fff',
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
tag3: val.status === 3, tag3: val.status === 3,
tag4: val.status === 4 tag4: val.status === 4
}" v-for="(val, idx) in item.tagList" :key="idx"> }" v-for="(val, idx) in item.tagList" :key="idx">
{{ val.name }} {{ val.industryName }}
</div> </div>
</div> </div>
</div> </div>
...@@ -191,14 +191,14 @@ ...@@ -191,14 +191,14 @@
<div class="box3-main"> <div class="box3-main">
<div class="box3-item" v-for="(news, index) in newsList" :key="index"> <div class="box3-item" v-for="(news, index) in newsList" :key="index">
<div class="left"> <div class="left">
<img :src="news.img" alt="" /> <img :src="news.newsImage !== null ? news.newsImage : defaultNewsIcon" />
</div> </div>
<div class="right"> <div class="right">
<div class="right-top"> <div class="right-top">
<div class="title">{{ news.title }}</div> <div class="title">{{ news.newsTitle }}</div>
<div class="time">{{ news.from }}</div> <div class="time">{{ news.newsOrg }}</div>
</div> </div>
<div class="right-footer">{{ news.content }}</div> <div class="right-footer">{{ news.newsContent }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -225,14 +225,15 @@ ...@@ -225,14 +225,15 @@
<div class="box4-main"> <div class="box4-main">
<div class="box4-main-item" v-for="(item, index) in messageList" :key="index"> <div class="box4-main-item" v-for="(item, index) in messageList" :key="index">
<div class="left"> <div class="left">
<img :src="item.img" alt="" /> <img :src="item.personImage ? item.personImage : defaultHeaderIcin" alt="" />
</div> </div>
<div class="right"> <div class="right">
<div class="right-top"> <div class="right-top">
<div class="name">{{ item.name }}</div> <div class="name">{{ item.personName
}}</div>
<div class="time">{{ item.time }}</div> <div class="time">{{ item.time }}</div>
</div> </div>
<div class="content">{{ item.content }}</div> <div class="content">{{ item.remarks }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -249,8 +250,8 @@ ...@@ -249,8 +250,8 @@
<div class="box5-header-title">{{ "政策建议趋势分布" }}</div> <div class="box5-header-title">{{ "政策建议趋势分布" }}</div>
</div> </div>
<div class="box5-select-box"> <div class="box5-select-box">
<el-select v-model="box5selectetedYear" placeholder="选择时间" style="width: 120px"> <el-select v-model="box5selectetedMonths" placeholder="选择时间" style="width: 120px">
<el-option v-for="item in box5YearList" :key="item.value" :label="item.label" :value="item.value" <el-option v-for="item in box5MonthsList" :key="item.value" :label="item.label" :value="item.value"
@click="changeBox5Data(item.value)" /> @click="changeBox5Data(item.value)" />
</el-select> </el-select>
</div> </div>
...@@ -326,6 +327,10 @@ ...@@ -326,6 +327,10 @@
{{ cate }} {{ cate }}
</div> </div>
</div> </div>
<el-select v-model="sort" placeholder="发布时间" style="width: 120px; margin-left: 8px">
<el-option @click="handleGetetThinkTankReport()" :key="true" label="正序" :value="true" />
<el-option @click="handleGetetThinkTankReport()" :key="false" label="倒序" :value="false" />
</el-select>
</div> </div>
<div class="home-main-footer-main"> <div class="home-main-footer-main">
<div class="left"> <div class="left">
...@@ -415,13 +420,16 @@ import { ...@@ -415,13 +420,16 @@ import {
getThinkTankHot, getThinkTankHot,
getNewReport, getNewReport,
getHylyList, getHylyList,
getThinkTankReport getThinkTankReport,
getThinkTankReportNews,
getThinkTankReportRemarks
} from "@/api/thinkTank/overview"; } from "@/api/thinkTank/overview";
import getMultiLineChart from "./utils/multiLineChart"; import getMultiLineChart from "./utils/multiLineChart";
import getPieChart from "./utils/piechart"; import getPieChart from "./utils/piechart";
import getSankeyChart from "./utils/sankey"; import getSankeyChart from "./utils/sankey";
import defaultNewsIcon from '@/assets/icons/default-icon-news.png'
import defaultHeaderIcin from '@/assets/icons/default-icon1.png'
import News1 from "./assets/images/news1.png"; import News1 from "./assets/images/news1.png";
import News2 from "./assets/images/news2.png"; import News2 from "./assets/images/news2.png";
import News3 from "./assets/images/news3.png"; import News3 from "./assets/images/news3.png";
...@@ -624,37 +632,50 @@ const newsList = ref([ ...@@ -624,37 +632,50 @@ const newsList = ref([
} }
]); ]);
// 智库人物动态 //获取新闻资讯
const box4TagList = ref([ const handleGetThinkTankReportNews = async () => {
{ try {
name: "新能源", const res = await getThinkTankReportNews();
status: 3 console.log("新闻资讯", res);
}, if (res.code === 200 && res.data) {
{ newsList.value = res.data
name: "人工智能", }
status: 2 } catch (error) {
}, console.error("获取新闻资讯error", error);
{
name: "通信网络",
status: 2
},
{
name: "量子科技",
status: 5
},
{
name: "生物科技",
status: 1
},
{
name: "集成电路",
status: 4
} }
]);
const box4ActiveTag = ref("通信网络");
const handleClickBox4Tag = tag => {
box4ActiveTag.value = tag;
}; };
// 智库人物动态
// const box4TagList = ref([
// {
// name: "新能源",
// status: 3
// },
// {
// name: "人工智能",
// status: 2
// },
// {
// name: "通信网络",
// status: 2
// },
// {
// name: "量子科技",
// status: 5
// },
// {
// name: "生物科技",
// status: 1
// },
// {
// name: "集成电路",
// status: 4
// }
// ]);
// const box4ActiveTag = ref("通信网络");
// const handleClickBox4Tag = tag => {
// box4ActiveTag.value = tag;
// };
const messageList = ref([ const messageList = ref([
{ {
...@@ -677,6 +698,19 @@ const messageList = ref([ ...@@ -677,6 +698,19 @@ const messageList = ref([
} }
]); ]);
//智库人物动态
const handleGetThinkTankReportRemarks = async () => {
try {
const res = await getThinkTankReportRemarks();
console.log("智库人物动态", res);
if (res.code === 200 && res.data) {
messageList.value = res.data
}
} catch (error) {
console.error("获取智库人物动态error", error);
}
};
// 政策建议趋势分布 // 政策建议趋势分布
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"],
...@@ -708,28 +742,45 @@ function getDateYearsAgo(years) { ...@@ -708,28 +742,45 @@ function getDateYearsAgo(years) {
const day = String(pastDate.getDate()).padStart(2, "0"); const day = String(pastDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`; return `${year}-${month}-${day}`;
} }
const box5selectetedYear = ref("近十年"); function getDateMonthsAgo(months) {
const box5YearList = ref([ // 获取当前日期
const currentDate = new Date();
// 计算指定月数之前的日期
const pastDate = new Date(currentDate);
pastDate.setMonth(currentDate.getMonth() - months); // 减去指定的月数
// 格式化日期为 "YYYY-MM-DD" 的形式
const year = pastDate.getFullYear();
const month = String(pastDate.getMonth() + 1).padStart(2, "0"); // 月份从0开始,需要加1
const day = String(pastDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
const box5selectetedMonths = ref(24);
const box5MonthsList = ref([
{ {
label: "近十年", label: "近3个月",
value: 10 value: 3
}, },
{ {
label: "近五年", label: "近6个月",
value: 5 value: 6
}, },
{ {
label: "近三年", label: "近12个月",
value: 3 value: 12
},
{
label: "近24个月",
value: 24
} }
]); ]);
function changeBox5Data(value) { function changeBox5Data(value) {
handleBox5(getDateYearsAgo(value)); handleBox5(getDateMonthsAgo(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) {
...@@ -980,7 +1031,7 @@ function transformThinkTankData(data) { ...@@ -980,7 +1031,7 @@ function transformThinkTankData(data) {
} }
}); });
}); });
console.log(nodes, links, 'nodes, linksnodes, links')
return { nodes, links }; return { nodes, links };
} }
...@@ -1168,7 +1219,7 @@ const pubTimeList = ref([ ...@@ -1168,7 +1219,7 @@ const pubTimeList = ref([
const selectedPubTimeList = ref([""]); const selectedPubTimeList = ref([""]);
const checkAllTime = ref(false); const checkAllTime = ref(false);
const isIndeterminateTime = ref(true); const isIndeterminateTime = ref(true);
const sort = ref(false)
const handleCheckAllChangeTime = val => { const handleCheckAllChangeTime = val => {
// console.log(val, "handleCheckAllChange"); // console.log(val, "handleCheckAllChange");
if (val) { if (val) {
...@@ -1288,6 +1339,7 @@ const handleGetetThinkTankReport = async () => { ...@@ -1288,6 +1339,7 @@ const handleGetetThinkTankReport = async () => {
const params = { const params = {
currentPage: currentPage.value - 1, currentPage: currentPage.value - 1,
pageSize: 12, pageSize: 12,
sortFun: sort.value,
researchTypeIds: arrayToString(selectedAreaList.value), researchTypeIds: arrayToString(selectedAreaList.value),
years: arrayToString(selectedPubTimeList.value) years: arrayToString(selectedPubTimeList.value)
}; };
...@@ -1339,14 +1391,27 @@ const handleToReportDetail = id => { ...@@ -1339,14 +1391,27 @@ const handleToReportDetail = id => {
onMounted(async () => { onMounted(async () => {
handleGetThinkTankList(); handleGetThinkTankList();
// 定义一个定时器,每隔2秒轮播一次
setInterval(() => {
// 索引加1
box1DataIndex.value++;
// 如果索引大于等于数组长度,重置为0,实现循环轮播
if (currentIndex >= box1Data.value.length) {
currentIndex = 0;
}
}, 3000); // 2000毫秒,即2秒
handleGetNewReport(); handleGetNewReport();
handleGetThinkTankRiskSignal(); handleGetThinkTankRiskSignal();
handleBox5(getDateYearsAgo(10));
handleBox5(getDateMonthsAgo(24));
handleBox6(); handleBox6();
handleBox7(); handleBox7();
handleGetHylyList(); handleGetHylyList();
handleGetThinkTankHot(getDateYearsAgo(1)); handleGetThinkTankHot(getDateYearsAgo(1));
handleGetetThinkTankReport(); handleGetetThinkTankReport();
handleGetThinkTankReportNews()
handleGetThinkTankReportRemarks()
}); });
</script> </script>
...@@ -1662,8 +1727,20 @@ onMounted(async () => { ...@@ -1662,8 +1727,20 @@ onMounted(async () => {
margin: 0 20px; margin: 0 20px;
display: flex; display: flex;
gap: 8px; gap: 8px;
height: 25px;
margin: 0 20px;
display: flex;
flex-wrap: wrap;
/* 允许换行 */
gap: 8px;
overflow: auto;
/* 根据内容自动调整高度 */
// max-width: calc(3 * 40px + 2 * 8px);
/* 每行 3 列,每个 tag 最大宽度 200px,gap 8px */
.tag { .tag {
// width: auto; /* 根据内容自动调整宽度 */
height: 22px; height: 22px;
padding: 0 8px; padding: 0 8px;
box-sizing: border-box; box-sizing: border-box;
...@@ -1672,6 +1749,20 @@ onMounted(async () => { ...@@ -1672,6 +1749,20 @@ onMounted(async () => {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
line-height: 20px; line-height: 20px;
white-space: nowrap;
/* 不换行 */
box-sizing: border-box;
border: 1px solid rgba(186, 224, 255, 1);
border-radius: 4px;
background: rgba(230, 244, 255, 1);
color: rgba(22, 119, 255, 1);
font-family: Microsoft YaHei;
font-style: Regular;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: left;
} }
.tag1 { .tag1 {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论