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

智库问题修复

上级 4adce9b7
......@@ -249,3 +249,19 @@ export function getThinkTankReportPolicyAction(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 @@
</div>
<div class="box-main">
<div class="select-box">
<el-select v-model="box3SelectYear" placeholder="选择时间" style="width: 100px">
<el-option v-for="item in box3YearList" :key="item.value" :label="item.label" :value="item.value"
<el-select v-model="box3SelectMonths" placeholder="选择时间" style="width: 100px">
<el-option v-for="item in box3MonthsList" :key="item.value" :label="item.label" :value="item.value"
@click="handleGetThinkPolicyIndustryChange()" />
</el-select>
</div>
......@@ -345,8 +345,8 @@ const box3Data = ref({
// ]
});
const box3SelectYear = ref("2025");
const box3YearList = ref([
const box3SelectMonths = ref("2025");
const box3MonthsList = ref([
{
label: "2025",
value: "2025"
......@@ -365,7 +365,7 @@ const handleGetThinkPolicyIndustryChange = async () => {
try {
const parmas = {
id: router.currentRoute._value.params.id,
year: box3SelectYear.value
year: box3SelectMonths.value
};
const res = await getThinkPolicyIndustryChange(parmas);
console.log("热门研究方向变化趋势", res);
......@@ -515,6 +515,19 @@ function getDateYearsAgo(years) {
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 sort = ref(true);
const currentPage = ref(1);
......
......@@ -930,8 +930,9 @@ onMounted(() => {
.box3-main-left {
width: 536px;
height: 326px;
margin-left: 10px;
height: 366px;
// margin-left: 10px;
margin: 0;
}
.box3-main-right {
......
......@@ -5,10 +5,10 @@ const getTreeMapChart = (treemapData) => {
formatter: '{b}: {c}人'
},
grid: {
top: '2%',
left: '2%',
right: '2%',
bottom: '2%',
top: '0%',
left: '0%',
right: '0%',
bottom: '0%',
containLabel: true
},
series: [
......@@ -22,12 +22,12 @@ const getTreeMapChart = (treemapData) => {
},
label: {
show: true,
formatter: '{b}\n{c}人',
fontSize: 12
formatter: '{b}',
fontSize: 10
},
upperLabel: {
show: true,
height: 30
height: 22
},
itemStyle: {
borderColor: '#fff',
......
......@@ -84,7 +84,7 @@
tag3: val.status === 3,
tag4: val.status === 4
}" v-for="(val, idx) in item.tagList" :key="idx">
{{ val.name }}
{{ val.industryName }}
</div>
</div>
</div>
......@@ -191,14 +191,14 @@
<div class="box3-main">
<div class="box3-item" v-for="(news, index) in newsList" :key="index">
<div class="left">
<img :src="news.img" alt="" />
<img :src="news.newsImage !== null ? news.newsImage : defaultNewsIcon" />
</div>
<div class="right">
<div class="right-top">
<div class="title">{{ news.title }}</div>
<div class="time">{{ news.from }}</div>
<div class="title">{{ news.newsTitle }}</div>
<div class="time">{{ news.newsOrg }}</div>
</div>
<div class="right-footer">{{ news.content }}</div>
<div class="right-footer">{{ news.newsContent }}</div>
</div>
</div>
</div>
......@@ -225,14 +225,15 @@
<div class="box4-main">
<div class="box4-main-item" v-for="(item, index) in messageList" :key="index">
<div class="left">
<img :src="item.img" alt="" />
<img :src="item.personImage ? item.personImage : defaultHeaderIcin" alt="" />
</div>
<div class="right">
<div class="right-top">
<div class="name">{{ item.name }}</div>
<div class="name">{{ item.personName
}}</div>
<div class="time">{{ item.time }}</div>
</div>
<div class="content">{{ item.content }}</div>
<div class="content">{{ item.remarks }}</div>
</div>
</div>
</div>
......@@ -249,8 +250,8 @@
<div class="box5-header-title">{{ "政策建议趋势分布" }}</div>
</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"
<el-select v-model="box5selectetedMonths" placeholder="选择时间" style="width: 120px">
<el-option v-for="item in box5MonthsList" :key="item.value" :label="item.label" :value="item.value"
@click="changeBox5Data(item.value)" />
</el-select>
</div>
......@@ -326,6 +327,10 @@
{{ cate }}
</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 class="home-main-footer-main">
<div class="left">
......@@ -415,13 +420,16 @@ import {
getThinkTankHot,
getNewReport,
getHylyList,
getThinkTankReport
getThinkTankReport,
getThinkTankReportNews,
getThinkTankReportRemarks
} from "@/api/thinkTank/overview";
import getMultiLineChart from "./utils/multiLineChart";
import getPieChart from "./utils/piechart";
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 News2 from "./assets/images/news2.png";
import News3 from "./assets/images/news3.png";
......@@ -624,37 +632,50 @@ const newsList = ref([
}
]);
// 智库人物动态
const box4TagList = ref([
{
name: "新能源",
status: 3
},
{
name: "人工智能",
status: 2
},
{
name: "通信网络",
status: 2
},
{
name: "量子科技",
status: 5
},
{
name: "生物科技",
status: 1
},
{
name: "集成电路",
status: 4
//获取新闻资讯
const handleGetThinkTankReportNews = async () => {
try {
const res = await getThinkTankReportNews();
console.log("新闻资讯", res);
if (res.code === 200 && res.data) {
newsList.value = res.data
}
} catch (error) {
console.error("获取新闻资讯error", error);
}
]);
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([
{
......@@ -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({
// title: ["2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
......@@ -708,28 +742,45 @@ function getDateYearsAgo(years) {
const day = String(pastDate.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
}
const box5selectetedYear = ref("近十年");
const box5YearList = ref([
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 box5selectetedMonths = ref(24);
const box5MonthsList = ref([
{
label: "近十年",
value: 10
label: "近3个月",
value: 3
},
{
label: "近五年",
value: 5
label: "近6个月",
value: 6
},
{
label: "近三年",
value: 3
label: "近12个月",
value: 12
},
{
label: "近24个月",
value: 24
}
]);
function changeBox5Data(value) {
handleBox5(getDateYearsAgo(value));
handleBox5(getDateMonthsAgo(value));
}
// 政策建议趋势分布
const handleGetThinkTankPolicyIndustryChange = async date => {
try {
const res = await getThinkTankPolicyIndustryChange(date);
console.log("政策建议趋势分布", res);
if (res.code === 200 && res.data) {
......@@ -980,7 +1031,7 @@ function transformThinkTankData(data) {
}
});
});
console.log(nodes, links, 'nodes, linksnodes, links')
return { nodes, links };
}
......@@ -1168,7 +1219,7 @@ const pubTimeList = ref([
const selectedPubTimeList = ref([""]);
const checkAllTime = ref(false);
const isIndeterminateTime = ref(true);
const sort = ref(false)
const handleCheckAllChangeTime = val => {
// console.log(val, "handleCheckAllChange");
if (val) {
......@@ -1288,6 +1339,7 @@ const handleGetetThinkTankReport = async () => {
const params = {
currentPage: currentPage.value - 1,
pageSize: 12,
sortFun: sort.value,
researchTypeIds: arrayToString(selectedAreaList.value),
years: arrayToString(selectedPubTimeList.value)
};
......@@ -1339,14 +1391,27 @@ const handleToReportDetail = id => {
onMounted(async () => {
handleGetThinkTankList();
// 定义一个定时器,每隔2秒轮播一次
setInterval(() => {
// 索引加1
box1DataIndex.value++;
// 如果索引大于等于数组长度,重置为0,实现循环轮播
if (currentIndex >= box1Data.value.length) {
currentIndex = 0;
}
}, 3000); // 2000毫秒,即2秒
handleGetNewReport();
handleGetThinkTankRiskSignal();
handleBox5(getDateYearsAgo(10));
handleBox5(getDateMonthsAgo(24));
handleBox6();
handleBox7();
handleGetHylyList();
handleGetThinkTankHot(getDateYearsAgo(1));
handleGetetThinkTankReport();
handleGetThinkTankReportNews()
handleGetThinkTankReportRemarks()
});
</script>
......@@ -1662,8 +1727,20 @@ onMounted(async () => {
margin: 0 20px;
display: flex;
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 {
// width: auto; /* 根据内容自动调整宽度 */
height: 22px;
padding: 0 8px;
box-sizing: border-box;
......@@ -1672,6 +1749,20 @@ onMounted(async () => {
font-size: 14px;
font-weight: 400;
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 {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论