提交 57543ed6 authored 作者: yanpeng's avatar yanpeng

api-5

上级 52826e66
......@@ -353,6 +353,24 @@ export function getEntitiesCountBy50PercentRules(
);
}
/**
* 获取前序事件
*/
// /entitiesDataInfo/precedingEvents
export function getPrecedingEvents(startTime = "2025-11-11", pageNum = 1, pageSize = 10) {
return request200(
request({
method: "POST",
url: "/api/entitiesDataInfo/precedingEvents",
data: {
sanctionDate: startTime,
pageNum,
pageSize
}
})
);
}
/**
* 领域分布查询
*/
......@@ -745,3 +763,76 @@ export function getKeyListedEntityList(date, keyword = "") {
})
);
}
/**
* 获取科学仪器对美依赖数量
*/
export function getScientificInstrumentDependencyCount(orgIds = "12100000400012916R,121000004013595328,12100000435230200R") {
return request200(
request({
method: "GET",
url: "/api/instrument/getDependencyUS",
params: {
orgIds
}
})
);
}
/**
* 科学仪器近十年对美依赖度升高风险分析
* url: /instrument/getDependencyUSRisk
*/
export function getScientificInstrumentDependencyRisk() {
return request200(
request({
method: "GET",
url: "/api/instrument/getDependencyUSRisk"
})
);
}
/**
* 科学仪器近十年国产化数量统计
* url:/instrument/getLocalizationRisk
*/
export function getScientificInstrumentLocalizationRisk() {
return request200(
request({
method: "GET",
url: "/api/instrument/getLocalizationRisk"
})
);
}
/**
* 科学仪器进口国统计
* url: /instrument/getOriginCount
*/
export function getScientificInstrumentOriginCount(orgIds = "12100000400012916R,121000004013595328,12100000435230200R") {
return request200(
request({
method: "GET",
url: "/api/instrument/getOriginCount",
params: {
orgIds
}
})
);
}
/**
* 新增科研机构列表
* url: /entitiesDataInfo/scientificImpact/entityList
*/
export function getScientificImpactEntityList(startTime) {
return request200(
request({
method: "GET",
url: "/api/entitiesDataInfo/scientificImpact/entityList",
params: {
sanctionDate: startTime || "2025-11-11"
}
})
);
}
[
{
"id": 86,
"name": "人工智能",
"nameZh": "人工智能",
"description": null,
"parentId": null,
"isMainBranch": "Y",
"children": null
"name": "美国",
"count": 0.37960339943342775
},
{
"name": "德国",
"count": 0.20113314447592068
},
{
"name": "日本",
"count": 0.1558073654390935
}
]
\ No newline at end of file
......@@ -99,6 +99,13 @@ import college9 from "../../assets/images/college9.png";
import college10 from "../../assets/images/college10.png";
import college11 from "../../assets/images/college11.png";
import { getHorizontalBarChart1, getPieOption2, getMultipleLineChart } from "../../utils/charts";
import {
getScientificImpactEntityList,
getScientificInstrumentDependencyCount,
getScientificInstrumentDependencyRisk,
getScientificInstrumentLocalizationRisk,
getScientificInstrumentOriginCount
} from "@/api/exportControl";
const selectOptions = [
{
value: 1,
......@@ -170,39 +177,153 @@ const horizontalBarOptions = shallowRef({});
const pieOptions2 = shallowRef({});
const multipleLineOptions1 = shallowRef({});
const multipleLineOptions2 = shallowRef({});
onMounted(() => {
horizontalBarOptions.value = getHorizontalBarChart1(
["地球探测仪器", "计算机及其配套设备", "天文仪器", "分析仪器", "核仪器", "物理性能测试仪器", "医学科研仪器"],
[10, 10, 21, 25, 79, 95, 109],
false
);
pieOptions2.value = getPieOption2([
{ name: "美国", value: 27 },
{ name: "日本", value: 22 },
{ name: "德国", value: 18 },
{ name: "英国", value: 15 },
{ name: "韩国", value: 12 },
{ name: "荷兰", value: 8 },
{ name: "其他", value: 7 }
]);
multipleLineOptions1.value = getMultipleLineChart({
dates: ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
data: [
{ name: "电子测量仪器", value: [45, 35, 25, 20, 20, 14, 15, 15, 23, 21] },
{ name: "分析仪器", value: [35, 33, 24, 21, 22, 18, 13, 19, 21, 31] },
{ name: "工艺试验仪器", value: [32, 22, 12, 11, 14, 15, 17, 13, 12, 26] },
{ name: "核仪器", value: [48, 38, 28, 28, 28, 18, 18, 18, 28, 28] }
]
});
multipleLineOptions2.value = getMultipleLineChart({
dates: ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
data: [
{ name: "电子测量仪器", value: [45, 35, 25, 20, 20, 14, 15, 15, 23, 21] },
{ name: "分析仪器", value: [35, 33, 24, 21, 22, 18, 13, 19, 21, 31] },
{ name: "工艺试验仪器", value: [32, 22, 12, 11, 14, 15, 17, 13, 12, 26] },
{ name: "核仪器", value: [48, 38, 28, 28, 28, 18, 18, 18, 28, 28] }
]
});
// 获取仪器对美依赖度升高风险分析数据
const fetchDependencyRiskData = async () => {
try {
const data = await getScientificInstrumentDependencyRisk();
if (data && data.instrumentCountList && Array.isArray(data.instrumentCountList)) {
// 提取年份数据(去重并排序)
const allYears = [...new Set(data.instrumentCountList.flatMap(item => item.countList.map(c => c.year)))].sort();
// 转换数据格式以适应 getMultipleLineChart
const chartData = data.instrumentCountList.map(item => {
// 为每个仪器类型创建完整的年份数据序列
const values = allYears.map(year => {
const yearData = item.countList.find(c => c.year === year);
return yearData ? yearData.count : 0;
});
return {
name: item.name,
value: values
};
});
// 使用 getMultipleLineChart 生成图表配置
multipleLineOptions1.value = getMultipleLineChart({
dates: allYears.map(String), // 转换为字符串以匹配原数据格式
data: chartData
});
}
} catch (error) {
console.error("获取仪器对美依赖度升高风险分析数据失败:", error);
}
};
// 获取仪器国产化降低风险分析数据
const fetchLocalizationRiskData = async () => {
try {
const data = await getScientificInstrumentLocalizationRisk();
if (data && data.instrumentCountList && Array.isArray(data.instrumentCountList)) {
// 提取年份数据(去重并排序)
const allYears = [...new Set(data.instrumentCountList.flatMap(item => item.countList.map(c => c.year)))].sort();
// 转换数据格式以适应 getMultipleLineChart
const chartData = data.instrumentCountList.map(item => {
// 为每个仪器类型创建完整的年份数据序列
const values = allYears.map(year => {
const yearData = item.countList.find(c => c.year === year);
return yearData ? yearData.count : 0;
});
return {
name: item.name,
value: values
};
});
// 使用 getMultipleLineChart 生成图表配置
multipleLineOptions2.value = getMultipleLineChart({
dates: allYears.map(String), // 转换为字符串以匹配原数据格式
data: chartData
});
}
} catch (error) {
console.error("获取仪器国产化降低风险分析数据失败:", error);
}
};
// 获取各类别仪器对美依赖情况数据
const fetchDependencyCountData = async () => {
try {
const data = await getScientificInstrumentDependencyCount();
if (data && Array.isArray(data)) {
// 按照 count 降序排列
const sortedData = data.sort((a, b) => a.count - b.count);
// 提取仪器名称和对应的计数
const names = sortedData.map(item => item.name);
const counts = sortedData.map(item => item.count);
// 使用 getHorizontalBarChart1 生成图表配置
horizontalBarOptions.value = getHorizontalBarChart1(names, counts, false);
}
} catch (error) {
console.error("获取各类别仪器对美依赖情况数据失败:", error);
}
};
// 获取仪器进口国可替代性分析数据
const fetchOriginCountData = async () => {
try {
const data = await getScientificInstrumentOriginCount();
if (data && Array.isArray(data)) {
// 转换数据格式以适应 getPieOption2
// 数据结构应该是 [{ name: "国家名", value: 数量 }]
const pieData = data.map(item => ({
name: item.name,
value: (item.count * 100).toFixed(1)
}));
// 使用 getPieOption2 生成图表配置
pieOptions2.value = getPieOption2(pieData);
}
} catch (error) {
console.error("获取仪器进口国可替代性分析数据失败:", error);
}
};
onMounted(async () => {
// horizontalBarOptions.value = getHorizontalBarChart1(
// ["地球探测仪器", "计算机及其配套设备", "天文仪器", "分析仪器", "核仪器", "物理性能测试仪器", "医学科研仪器"],
// [10, 10, 21, 25, 79, 95, 109],
// false
// );
// pieOptions2.value = getPieOption2([
// { name: "美国", value: 27 },
// { name: "日本", value: 22 },
// { name: "德国", value: 18 },
// { name: "英国", value: 15 },
// { name: "韩国", value: 12 },
// { name: "荷兰", value: 8 },
// { name: "其他", value: 7 }
// ]);
// multipleLineOptions1.value = getMultipleLineChart({
// dates: ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
// data: [
// { name: "电子测量仪器", value: [45, 35, 25, 20, 20, 14, 15, 15, 23, 21] },
// { name: "分析仪器", value: [35, 33, 24, 21, 22, 18, 13, 19, 21, 31] },
// { name: "工艺试验仪器", value: [32, 22, 12, 11, 14, 15, 17, 13, 12, 26] },
// { name: "核仪器", value: [48, 38, 28, 28, 28, 18, 18, 18, 28, 28] }
// ]
// });
// multipleLineOptions2.value = getMultipleLineChart({
// dates: ["2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"],
// data: [
// { name: "电子测量仪器", value: [45, 35, 25, 20, 20, 14, 15, 15, 23, 21] },
// { name: "分析仪器", value: [35, 33, 24, 21, 22, 18, 13, 19, 21, 31] },
// { name: "工艺试验仪器", value: [32, 22, 12, 11, 14, 15, 17, 13, 12, 26] },
// { name: "核仪器", value: [48, 38, 28, 28, 28, 18, 18, 18, 28, 28] }
// ]
// });
// 获取各类别仪器对美依赖情况数据
await fetchDependencyCountData();
// 获取仪器进口国可替代性分析数据
await fetchOriginCountData();
// 获取仪器对美依赖度升高风险分析数据
await fetchDependencyRiskData();
// 获取仪器国产化降低风险分析数据
await fetchLocalizationRiskData();
});
</script>
......
......@@ -12,7 +12,7 @@
<div class="item" v-for="(item, index) in listData" :key="index" @click="handleEttClick(item)">
<div class="index" :class="{ isTopTen: index < 10 }">{{ index + 1 }}</div>
<div class="name">{{ item.name || item.nameEn }}</div>
<div class="icon" :class="{ iconUp: item.isUp, iconDown: !item.isUp }"></div>
<div class="icon" :class="{ iconUp: item.marketChange > 0, iconDown: item.marketChange < 0 }"></div>
</div>
</div>
</div>
......
......@@ -186,12 +186,12 @@ const fetchEntityFinancing = async () => {
// 按日期排序
const sortedData = data
.sort((a, b) => {
return new Date(a.name) - new Date(b.name);
return new Date(a.year) - new Date(b.year);
})
.filter((item, idx) => idx % 3 === 0);
// 提取 x 轴数据(日期)
const xAxisData = sortedData.map(item => item.name);
const xAxisData = sortedData.map(item => item.year);
// 提取 y 轴数据(融资数量)
const seriesData = sortedData.map(item => item.count);
......
......@@ -30,7 +30,7 @@ onMounted(async () => {
.filter(item => item.count > 0)
.map(item => {
return {
name: item?.domain,
name: item?.name,
value: item?.count
};
})
......
<template>
<div class="message-bubble">
<div class="avatar-container" @click="handleClick">
<img :src="avatar" :alt="name" class="avatar" />
<img :src="avatar || avatarUser" :alt="name" class="avatar" />
</div>
<div class="bubble-container">
<div class="bubble">
......@@ -19,6 +19,8 @@
</template>
<script setup>
import avatarUser from "@/assets/images/avatar_user.png";
const emit = defineEmits(["click", "info-click"]);
defineProps({
avatar: {
......
......@@ -220,7 +220,7 @@
<template #default>
<div class="news-list">
<NewsList :list-data="newsList" @click="handleNewsInfoClick" />
<NewsList :list-data="newsList" @item-click="item => handleNewsInfoClick(item)" />
</div>
</template>
</custom-container>
......@@ -321,7 +321,7 @@
</div>
<div class="box3-content">
<div class="box3-content-title">商业管制清单(CCL)更新频度</div>
<el-table :data="tableData1" stripe style="width: 100%">
<el-table :data="tableData2" stripe style="width: 100%">
<el-table-column prop="year" label="年份" width="150" />
<el-table-column label="发布次数" width="200">
<template #default="scope">
......@@ -694,6 +694,7 @@ import _ from "lodash";
const handleCompClick = item => {
console.log("item", item);
if (item.entityType != 2) return;
const route = router.resolve({
path: "/companyPages",
query: {
......@@ -712,6 +713,8 @@ const trendOption = ref({});
const trendChecked = ref(false);
// 发布频度
const tableData1 = ref([]);
// CCL发布频度
const tableData2 = ref([]);
// 历次制裁过程
const sanctionProcessList = ref([]);
const sanctionPage = ref(1);
......@@ -727,10 +730,11 @@ const newsList = ref([]);
onMounted(async () => {
try {
const [dataCount, entitiesDataInfo, industryCountByYear, countDomainByYear] = await Promise.all([
const [dataCount, entitiesDataInfo, industryCountByYear,cclList, countDomainByYear] = await Promise.all([
getEntitiesDataCount(),
getEntitiesDataInfo(),
getIndustryCountByYear(1),
getIndustryCountByYear(13),
getCountDomainByYear(trendChecked.value)
]);
// 交换第二个和第三个元素
......@@ -742,6 +746,7 @@ onMounted(async () => {
});
entitiesDataInfoList.value = entitiesDataInfo || [];
const list = _.chain(industryCountByYear).filter("year").orderBy("year", "desc").value();
const cclList1 = _.chain(cclList).filter("year").orderBy("year", "desc").value();
const total = _.sumBy(list, "count");
tableData1.value = _.map(list, item => {
return {
......@@ -751,6 +756,14 @@ onMounted(async () => {
tags: item.domain
};
}).slice(0, 5);
tableData2.value = _.map(cclList1, item => {
return {
year: item.year,
num: item.count,
percent: item.count / total,
tags: item.domain
};
}).slice(0, 5);
console.log("countDomainByYear", countDomainByYear);
// 整理柱状图数据并应用到趋势图
if (countDomainByYear && countDomainByYear[0].yearDomainCount) {
......@@ -1194,6 +1207,7 @@ const fetchNewsInfo = async () => {
const data = await getNewsInfo();
if (data && Array.isArray(data)) {
newsList.value = data.map(item => ({
...item,
avatar: item.newsImage,
name: item.newsTitle,
time: formatTime(item.newsDate),
......@@ -1439,7 +1453,7 @@ const handleNewsInfoClick = item => {
const route = router.resolve({
path: "/newsAnalysis",
query: {
newsId: item.id
newsId: item.newsId
}
});
window.open(route.href, "_blank");
......
......@@ -139,6 +139,7 @@ export function getPieOption2(data, title) {
}
},
legend: {
type: "scroll",
icon: "rect",
top: "center",
right: "40",
......@@ -825,6 +826,7 @@ export const getMultipleLineChart = obj => {
containLabel: true
},
legend: {
type: "scroll",
right: "5%",
icon: "circle",
itemWidth: 15,
......@@ -835,7 +837,7 @@ export const getMultipleLineChart = obj => {
},
itemGap: 17,
data: obj.data.map((item, index) => {
return { name: item.name, itemStyle: { color: color[index] } };
return { name: item.name, itemStyle: { color: color[index % 4] } };
})
},
xAxis: {
......
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论