提交 b72966e2 authored 作者: yanpeng's avatar yanpeng

api, UI

上级 d970f091
......@@ -322,9 +322,10 @@ export function getCompareCountSan(startTime) {
return request200(
request({
method: "GET",
url: "/api/entitiesDataCount/compareCountSan",
// url: "/api/entitiesDataCount/compareCountSan",
url: "/api/entitiesDataInfo/getSanCountInfo",
params: {
startTime
sanctionDate: startTime || "2025-11-11"
}
})
);
......@@ -397,6 +398,18 @@ export function getSanDomainCount() {
);
}
/**
* 上市企业制裁强度
*/
export function getSanStrength() {
return request200(
request({
method: "GET",
url: "/api/entitiesDataInfo/listedEntity/sanInfo"
})
);
}
/**
* 新增实体领域分布情况
* @param {string} sanTime - 开始时间,格式为 'YYYY-MM-DD'
......
{
"code": 200,
"message": "操作成功",
"success": true,
"data": [
{
"sanTypeName": "实体清单",
"domainCountInfo": [
{
"id": "3",
"name": "新一代信息技术",
"count": 108
},
{
"id": "14",
"name": "核",
"count": 34
},
{
"id": "8",
"name": "先进制造",
"count": 242
},
{
"id": "7",
"name": "海洋",
"count": 66
},
{
"id": "2",
"name": "生物科技",
"count": 19
},
{
"id": "10",
"name": "航空航天",
"count": 180
},
{
"id": "6",
"name": "集成电路",
"count": 442
},
{
"id": "1",
"name": "人工智能",
"count": 157
},
{
"id": "9",
"name": "新材料",
"count": 50
},
{
"id": "4",
"name": "量子科技",
"count": 40
},
{
"id": "13",
"name": "太空",
"count": 3
},
{
"id": "5",
"name": "新能源",
"count": 9
},
{
"id": "11",
"name": "深海",
"count": 5
},
{
"id": "22",
"name": "经济",
"count": 25
},
{
"id": "23",
"name": "军事",
"count": 31
},
{
"id": "24",
"name": "科技",
"count": 62
},
{
"id": "25",
"name": "安全",
"count": 20
}
]
}
]
}
\ No newline at end of file
[
{
"id": null,
"name": "2025-10-09",
"count": 10
},
{
"id": null,
"name": "2025-10-08",
"count": 8
},
{
"id": null,
"name": "2025-09-16",
"count": 16
}
]
\ No newline at end of file
......@@ -72,7 +72,7 @@ import Echarts from "@/components/Chart/index.vue";
import { getBarChart, getLineChart } from "../../utils/charts";
import _ from "lodash";
import Hint from "./hint.vue";
import { getEntityFinancing, getEntityMarketValue, getKeyListedEntityList } from "@/api/exportControl";
import { getEntityFinancing, getEntityMarketValue, getKeyListedEntityList, getSanStrength } from "@/api/exportControl";
import { useRoute } from "vue-router";
const route = useRoute();
const options = [
......@@ -193,9 +193,11 @@ const fetchEntityFinancing = async () => {
// 数据结构示例: [{name: "2025-10-09", count: 41}, ...]
// 按日期排序
const sortedData = data.sort((a, b) => {
return new Date(a.name) - new Date(b.name);
});
const sortedData = data
.sort((a, b) => {
return new Date(a.name) - new Date(b.name);
})
.filter((item, idx) => idx % 3 === 0);
// 提取 x 轴数据(日期)
const xAxisData = sortedData.map(item => item.name);
......@@ -225,9 +227,11 @@ const fetchEntityMarketValue = async () => {
// 数据结构示例: [{name: "2025-10-09", count: 220}, ...]
// 按日期排序
const sortedData = data.sort((a, b) => {
return new Date(a.name) - new Date(b.name);
});
const sortedData = data
.sort((a, b) => {
return new Date(a.name) - new Date(b.name);
})
.filter((item, idx) => idx % 3 === 0);
// 提取 x 轴数据(日期)
const xAxisData = sortedData.map(item => item.name);
......@@ -243,13 +247,42 @@ const fetchEntityMarketValue = async () => {
}
};
//
const fetchSanStrength = async () => {
try {
const data = await getSanStrength();
if (data && Array.isArray(data)) {
// 根据 fishbone-mock.json 的数据结构处理数据
// 数据结构示例: [{name: "2025-10-09", count: 220}, ...]
// 按日期排序
const sortedData = data
.sort((a, b) => {
return new Date(a.name) - new Date(b.name);
})
.filter((item, idx) => idx % 3 === 0);
// 提取 x 轴数据(日期)
const xAxisData = sortedData.map(item => item.name);
// 提取 y 轴数据(市值数据)
const seriesData = sortedData.map(item => item.count);
// 更新图表配置,使用指定的颜色
bar1Option.value = getBarChart(xAxisData, seriesData, ["rgba(22, 119, 255, 1)", "rgba(22, 119, 255, 0)"], "制裁强度");
}
} catch (error) {
console.error("获取上市企业市值变化数据失败:", error);
}
};
onMounted(() => {
bar1Option.value = getBarChart(
["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
[219, 228, 129, 159, 152, 157, 78, 34, 56, 78],
["rgba(22, 119, 255, 1)", "rgba(22, 119, 255, 0)"],
"制裁强度"
);
// bar1Option.value = getBarChart(
// ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
// [219, 228, 129, 159, 152, 157, 78, 34, 56, 78],
// ["rgba(22, 119, 255, 1)", "rgba(22, 119, 255, 0)"],
// "制裁强度"
// );
// bar2Option.value = getBarChart(
// ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
// [39, 28, 49, 19, 22, 25, 78, 34, 56, 28],
......@@ -266,6 +299,7 @@ onMounted(() => {
fetchEntityFinancing();
fetchEntityMarketValue();
fetchKeyListedEntityList();
fetchSanStrength();
});
// 监听搜索关键词变化,重新获取数据
......
......@@ -66,37 +66,39 @@ const activePanelId = ref(null);
onMounted(async () => {
try {
const [compareCountSanData] = await Promise.all([getCompareCountSan(route.query.startTime)]);
const { countSanNow, countSanLast, countDomainNow, countDomainLast, countTypeNow, countTypeLast } =
compareCountSanData ?? {};
// const { countSanNow, countSanLast, countDomainNow, countDomainLast, countTypeNow, countTypeLast } =
// compareCountSanData ?? {};
const { entityNum, entityChange, listedCompanyNum, listedCompanyChange, domainNum, domainChange, typeNum, typeChange } =
compareCountSanData ?? {};
compareCountSan.value = [
{
id: 1,
name: "新增实体数量",
number: countSanNow,
isUp: countSanNow - countSanLast >= 0,
ComparisonNumber: Math.abs(countSanNow - countSanLast)
number: entityNum,
isUp: entityChange >= 0,
ComparisonNumber: Math.abs(entityChange)
},
{
id: 2,
name: "上市企业数量",
number: "--",
isUp: true,
ComparisonNumber: "--"
number: listedCompanyNum,
isUp: listedCompanyChange >= 0,
ComparisonNumber: Math.abs(listedCompanyChange)
},
{
id: 3,
name: "涉及领域数量",
number: countDomainNow,
isUp: countDomainNow - countDomainLast >= 0,
ComparisonNumber: Math.abs(countDomainNow - countDomainLast)
number: domainNum,
isUp: domainChange >= 0,
ComparisonNumber: Math.abs(domainChange)
},
{
id: 4,
name: "实体类别数量",
number: countTypeNow,
isUp: countTypeNow - countTypeLast >= 0,
ComparisonNumber: Math.abs(countTypeNow - countTypeLast)
number: typeNum,
isUp: typeChange >= 0,
ComparisonNumber: Math.abs(typeChange)
}
];
activePanelId.value = compareCountSan.value[0].id;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论