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

update

上级 4f47da48
...@@ -10,4 +10,58 @@ export function getBillIndustry(params) { ...@@ -10,4 +10,58 @@ export function getBillIndustry(params) {
url: `/api/BillOverview/billIndustry/${params.year}`, url: `/api/BillOverview/billIndustry/${params.year}`,
params, params,
}) })
}
// 涉华法案统计
export function getBillCount() {
return request({
method: 'GET',
url: `/api/BillOverview/billCount`,
})
}
// 获取关键条款
export function getBillOverviewKeyTK() {
return request({
method: 'GET',
url: `/api/BillOverview/keyTk`,
})
}
// 获取热门法案列表
export function getHotBills() {
return request({
method: 'GET',
url: '/api/BillOverview/hotBills',
})
}
// 获取法案风险信号
export function getBillRiskSignal() {
return request({
method: 'GET',
url: '/api/BillOverview/riskSignal',
})
}
// 根据法案类型获取法案列表
/**
* @param {type}
*/
export function getBillsByType(params) {
return request({
method: 'GET',
url: '/api/BillOverview/bills',
params,
})
}
// 根据行业领域字典列表
export function getHylyList() {
return request({
method: 'GET',
url: `/api/billImpactAnalysis/industry/hylyList`,
})
} }
\ No newline at end of file
import request from "@/api/request.js";
// 获取热门法案列表
export function getHotBills() {
return request({
method: 'GET',
url: '/api/BillOverview/hotBills',
})
}
// 获取法案风险信号
export function getBillRiskSignal() {
return request({
method: 'GET',
url: '/api/BillOverview/riskSignal',
})
}
// 根据法案类型获取法案列表
/**
* @param {type}
*/
export function getBillsByType(params) {
return request({
method: 'GET',
url: '/api/BillOverview/bills',
params,
})
}
// 根据行业领域字典列表
export function getHylyList() {
return request({
method: 'GET',
url: `/api/billImpactAnalysis/industry/hylyList`,
})
}
\ No newline at end of file
...@@ -16,5 +16,32 @@ export function getThinkTankRiskSignal() { ...@@ -16,5 +16,32 @@ export function getThinkTankRiskSignal() {
method: 'GET', method: 'GET',
url: `/api/thinkTankOverview/riskSignal`, url: `/api/thinkTankOverview/riskSignal`,
})
}
// 政策建议趋势分布
export function getThinkTankPolicyIndustryChange() {
return request({
method: 'GET',
url: `/api/thinkTankOverview/policyIndustryChange`,
})
}
// 政策建议领域分布
export function getThinkTankPolicyIndustry(params) {
return request({
method: 'GET',
url: `/api/thinkTankOverview/policyIndustry/${params.year}`,
params
})
}
// 资金流向
export function getThinkTankDonation() {
return request({
method: 'GET',
url: `/api/thinkTankOverview/donation`,
}) })
} }
\ No newline at end of file
...@@ -22,10 +22,10 @@ const getWordCloudChart = (data) => { ...@@ -22,10 +22,10 @@ const getWordCloudChart = (data) => {
// shape: 'pentagon' // 五边形 // shape: 'pentagon' // 五边形
// shape: 'star' // 星形 // shape: 'star' // 星形
// shape: 'cardioid' // 心形 // shape: 'cardioid' // 心形
gridSize: 5, // 网格大小,影响词间距。 gridSize: 15, // 网格大小,影响词间距。
sizeRange: [10, 30], // 定义词云中文字大小的范围 sizeRange: [10, 30], // 定义词云中文字大小的范围
rotationRange: [0, 0], rotationRange: [0, 0],
rotationStep: 10, rotationStep: 15,
drawOutOfBound: false, // 是否超出画布 drawOutOfBound: false, // 是否超出画布
// 字体 // 字体
textStyle: { textStyle: {
......
...@@ -582,8 +582,6 @@ import entityIcon from "./assets/images/icon-entity.png"; ...@@ -582,8 +582,6 @@ import entityIcon from "./assets/images/icon-entity.png";
import newsImg from "@/assets/images/news-img.png"; import newsImg from "@/assets/images/news-img.png";
import { getHotBills, getBillsByType, getHylyList } from "@/api/home";
import getMultiLineChart from "./utils/multiLineChart"; import getMultiLineChart from "./utils/multiLineChart";
import bill1 from "./assets/images/bill1.png"; import bill1 from "./assets/images/bill1.png";
......
...@@ -550,7 +550,6 @@ import entityIcon from "./assets/images/icon-entity.png"; ...@@ -550,7 +550,6 @@ import entityIcon from "./assets/images/icon-entity.png";
import newsImg from "@/assets/images/news-img.png"; import newsImg from "@/assets/images/news-img.png";
import { getHotBills, getBillsByType, getHylyList } from "@/api/home";
import headerIcon1 from "./assets/icons/header-icon1.png"; import headerIcon1 from "./assets/icons/header-icon1.png";
import headerIcon2 from "./assets/icons/header-icon2.png"; import headerIcon2 from "./assets/icons/header-icon2.png";
......
...@@ -480,14 +480,13 @@ onMounted(() => {}); ...@@ -480,14 +480,13 @@ onMounted(() => {});
width: 36px; width: 36px;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
// box-sizing: border-box;
border-radius: 4px; border-radius: 4px;
background: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.3);
cursor: pointer; cursor: pointer;
.header-img-box { .header-img-box {
width: 19px; width: 19px;
height: 24px; height: 24px;
margin: 6px auto; margin: 4px auto;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -129,11 +129,12 @@ ...@@ -129,11 +129,12 @@
<div <div
class="item-left" class="item-left"
:class="{ :class="{
itemLeftStatus1: item.status === '一般风险', itemLeftStatus1: item.status === '一般风险 ' || item.status === '暂无数值',
itemLeftStatus2: item.status === '重大风险' itemLeftStatus2: item.status === '重大风险',
itemLeftStatus3: item.status === '特别重大'
}" }"
> >
{{ item.status }} {{ item.status || "一般风险" }}
</div> </div>
<div class="item-right"> <div class="item-right">
<div class="text"> <div class="text">
...@@ -414,7 +415,13 @@ import router from "@/router"; ...@@ -414,7 +415,13 @@ import router from "@/router";
import DivideHeader from "@/components/DivideHeader.vue"; import DivideHeader from "@/components/DivideHeader.vue";
import setChart from "@/utils/setChart"; import setChart from "@/utils/setChart";
import { getThinkTankList, getThinkTankRiskSignal } from "@/api/thinkTank/overview"; import {
getThinkTankList,
getThinkTankRiskSignal,
getThinkTankPolicyIndustryChange,
getThinkTankPolicyIndustry,
getThinkTankDonation
} from "@/api/thinkTank/overview";
import getMultiLineChart from "./utils/multiLineChart"; import getMultiLineChart from "./utils/multiLineChart";
import getPieChart from "./utils/piechart"; import getPieChart from "./utils/piechart";
...@@ -722,23 +729,7 @@ const handleClickCate = cate => { ...@@ -722,23 +729,7 @@ const handleClickCate = cate => {
handleGetBillsByType(); handleGetBillsByType();
}; };
const chart1Data = ref({
title: ["2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
data: [
{
name: "337调查",
value: [73, 32, 42, 48, 38, 49, 63, 75, 70, 86, 95, 87]
},
{
name: "301调查",
value: [8, 3, 2, 8, 9, 10, 12, 18, 16, 18, 20, 22]
},
{
name: "232调查",
value: [1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3]
}
]
});
// 查看更多风险信号 // 查看更多风险信号
const handleToMoreRiskSignal = () => { const handleToMoreRiskSignal = () => {
...@@ -821,6 +812,24 @@ const curFooterList = ref([ ...@@ -821,6 +812,24 @@ const curFooterList = ref([
} }
]); ]);
const box5Data = ref({
title: ["2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
data: [
{
name: "人工智能",
value: [73, 32, 42, 48, 38, 49, 63, 75, 70, 86, 95, 87]
},
{
name: "集成电路",
value: [8, 3, 2, 8, 9, 10, 12, 18, 16, 18, 20, 22]
},
{
name: "量子科技",
value: [1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3]
}
]
});
const box5selectetedYear = ref("近十年"); const box5selectetedYear = ref("近十年");
const box5YearList = ref([ const box5YearList = ref([
{ {
...@@ -1020,30 +1029,164 @@ const handleGetThinkTankList = async () => { ...@@ -1020,30 +1029,164 @@ const handleGetThinkTankList = async () => {
// 获取智库风险信号 // 获取智库风险信号
const handleGetThinkTankRiskSignal = async () => { const handleGetThinkTankRiskSignal = async () => {
try { try {
const res = await getThinkTankRiskSignal() const res = await getThinkTankRiskSignal();
console.log('智库风险信号',res); console.log("智库风险信号", res);
if (res.code === 200) {
warningList.value = res.data.map(item => {
return {
title: item.name,
time: item.times,
id: item.reportId,
status: item.riskLevel || "暂无数值"
};
});
}
} catch (error) { } catch (error) {
console.error("获取智库风险信号error", error); console.error("获取智库风险信号error", error);
} }
} };
onMounted(async () => { // 政策建议趋势分布
handleGetThinkTankList(); const handleGetThinkTankPolicyIndustryChange = async () => {
handleGetThinkTankRiskSignal() try {
const res = await getThinkTankPolicyIndustryChange();
console.log("政策建议趋势分布", res);
if(res.code === 200 && res.data) {
} else {
box5Data.value = []
}
} catch (error) {
console.error("获取政策建议趋势分布error", error);
}
};
const handleBox5 = async() => {
await handleGetThinkTankPolicyIndustryChange()
let box5Chart = getMultiLineChart( let box5Chart = getMultiLineChart(
chart1Data.value.title, box5Data.value.title,
chart1Data.value.data[0].value, box5Data.value.data[0].value,
chart1Data.value.data[1].value, box5Data.value.data[1].value,
chart1Data.value.data[2].value box5Data.value.data[2].value
); );
setChart(box5Chart, "box5Chart"); setChart(box5Chart, "box5Chart");
}
// 政策建议趋势分布
const handleGetThinkTankPolicyIndustry = async () => {
const params = {
apply: 1,
yaer: box6selectetedYear.value
}
try {
const res = await getThinkTankPolicyIndustry(params);
console.log("政策建议领域分布", res);
if(res.code === 200 && res.data) {
} else {
box6Data.value = []
}
} catch (error) {
console.error("获取政策建议领域分布error", error);
}
};
const handleBox6 = async() => {
await handleGetThinkTankPolicyIndustry()
const box6Chart = getPieChart(box6Data.value); const box6Chart = getPieChart(box6Data.value);
setChart(box6Chart, "box6Chart"); setChart(box6Chart, "box6Chart");
}
function transformThinkTankData(data) {
const nodes = [];
const links = [];
const nodeSet = new Set(); // 用于去重
// 遍历每个智库
data.forEach(thinkTank => {
const thinkTankName = thinkTank.thinkTankName;
// 添加智库节点
if (!nodeSet.has(thinkTankName)) {
nodes.push({ name: thinkTankName });
nodeSet.add(thinkTankName);
}
// 遍历每个资金来源
thinkTank.thinkTankDonationSourceVOList.forEach(source => {
const { amount, institution, secondInstitution } = source;
// 处理机构节点
if (institution && !nodeSet.has(institution)) {
nodes.push({ name: institution });
nodeSet.add(institution);
}
// 处理二级机构节点
if (secondInstitution && !nodeSet.has(secondInstitution)) {
nodes.push({ name: secondInstitution });
nodeSet.add(secondInstitution);
}
// 构建链接
if (institution && secondInstitution) {
// 情况1: institution → secondInstitution → thinkTankName
links.push({
source: institution,
target: secondInstitution,
value: amount
});
links.push({
source: secondInstitution,
target: thinkTankName,
value: amount
});
} else if (institution && !secondInstitution) {
// 情况2: institution → thinkTankName
links.push({
source: institution,
target: thinkTankName,
value: amount
});
} else if (!institution && !secondInstitution) {
// 情况3: 只有智库节点
links.push({
source: thinkTankName,
value: amount
});
}
});
});
return { nodes, links };
}
// 智库资金流向
const handleGetThinkTankDonation = async () => {
try {
const res = await getThinkTankDonation();
console.log("智库资金流向", res);
if (res.code === 200 && res.data) {
box7Data.value = transformThinkTankData(res.data);
}
} catch (error) {
console.error("获取智库资金流向error", error);
}
};
const handleBox7 = async () => {
await handleGetThinkTankDonation();
const box7Chart = getSankeyChart(box7Data.value.nodes, box7Data.value.links); const box7Chart = getSankeyChart(box7Data.value.nodes, box7Data.value.links);
setChart(box7Chart, "box7Chart"); setChart(box7Chart, "box7Chart");
};
onMounted(async () => {
handleGetThinkTankList();
handleGetThinkTankRiskSignal();
handleBox5()
handleBox6()
handleBox7();
}); });
</script> </script>
...@@ -1521,22 +1664,13 @@ onMounted(async () => { ...@@ -1521,22 +1664,13 @@ onMounted(async () => {
&:hover { &:hover {
background: var(--color-bg-hover); background: var(--color-bg-hover);
} }
.itemLeftStatus1 {
color: rgba(82, 196, 26, 1) !important;
background: rgba(246, 255, 237, 1) !important;
}
.itemLeftStatus2 {
color: rgba(250, 140, 22, 1) !important;
background: rgba(255, 247, 230, 1) !important;
}
.item-left { .item-left {
margin-top: 4px; margin-top: 4px;
margin-left: 2px; margin-left: 2px;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 20px; border-radius: 20px;
background: rgba(255, 241, 240);
color: rgba(245, 34, 45, 1);
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
...@@ -1545,6 +1679,18 @@ onMounted(async () => { ...@@ -1545,6 +1679,18 @@ onMounted(async () => {
padding: 6px 4px; padding: 6px 4px;
text-align: center; text-align: center;
} }
.itemLeftStatus1 {
color: rgba(82, 196, 26, 1) !important;
background: rgba(246, 255, 237, 1) !important;
}
.itemLeftStatus2 {
color: rgba(250, 140, 22, 1) !important;
background: rgba(255, 247, 230, 1) !important;
}
.itemLeftStatus3 {
color: rgba(245, 34, 45, 1);
background: rgba(255, 241, 240);
}
.item-right { .item-right {
margin-left: 13px; margin-left: 13px;
width: 408px; width: 408px;
...@@ -1552,12 +1698,15 @@ onMounted(async () => { ...@@ -1552,12 +1698,15 @@ onMounted(async () => {
border-bottom: 1px solid rgba(240, 242, 244, 1); border-bottom: 1px solid rgba(240, 242, 244, 1);
display: flex; display: flex;
.text { .text {
width: 348px; width: 315px;
color: rgba(59, 65, 75, 1); color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 47px; line-height: 47px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.time { .time {
margin-left: 10px; margin-left: 10px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论