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

api-5

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