提交 18829f75 authored 作者: coderBryanFu's avatar coderBryanFu

update

......@@ -58,8 +58,11 @@ export function getUSGovernmentJointSanctionRank() {
/**
* @header token
* @param {Object} params
* @param {String} params.currentPage = 1 // 当前页
* @param {String} params.pageSize = 1000 // 每页数量
* @param {String} params.startDate // 开始日期
* @param {String} params.endDate // 截止日期
* @param {Boolean} params.onlyHistory // 是否仅历史举措
* @param {Boolean} params.onlyFuture // 是否仅未来举措
* @param {String} params.field // 领域ID
*/
export function getUSGovernmentSanctionHistory(params) {
return request({
......
......@@ -100,7 +100,7 @@
</div>
<div class="select-box">
<div class="rank-btns">
<div class="rank-btn" :class="{ active: rankType === 'institution' }" @click="rankType = 'institution'">
<!-- <div class="rank-btn" :class="{ active: rankType === 'institution' }" @click="rankType = 'institution'">
对我打压机构
</div>
<div class="rank-btn" :class="{ active: rankType === 'enterprise' }" @click="rankType = 'enterprise'">
......@@ -108,7 +108,7 @@
</div>
<div class="rank-btn" :class="{ active: rankType === 'school' }" @click="rankType = 'school'">
受打压院校
</div>
</div> -->
</div>
<el-select v-model="selectedField" placeholder="全部领域" class="field-select">
<el-option v-for="item in fieldOptions" :key="item.value" :label="item.label" :value="item.value" />
......
......@@ -187,15 +187,10 @@
</div>
</div>
<div class="events-container">
<div v-for="(event, eIndex) in dept.events" :key="eIndex" class="event-card">
<div v-for="(event, eIndex) in dept.events" :key="eIndex" class="event-card" :class="getCardColorClass(event.level)">
<div class="card-top-line" :class="getLineColorClass(event.level)"></div>
<div class="event-header">
<div class="event-date">{{ event.date }}</div>
<div v-if="event.level" class="traffic-light">
<div class="light" :class="{ active: event.level === 'green', green: true }"></div>
<div class="light" :class="{ active: event.level === 'yellow', yellow: true }"></div>
<div class="light" :class="{ active: event.level === 'red', red: true }"></div>
</div>
</div>
<el-tooltip
effect="dark"
......@@ -276,35 +271,21 @@ const loadingHistory = ref(false);
const getUSGovernmentSanctionHistoryData = async () => {
loadingHistory.value = true;
try {
const res = await getUSGovernmentSanctionHistory({
currentPage: 1,
pageSize: 1000
});
if (res.code === 200 && res.data && res.data.content) {
const rawList = res.data.content;
const params = {
onlyHistory: measureType.value === "history",
onlyFuture: measureType.value === "future",
field: selectedField.value || null
};
const orgMap = {};
if (governmentList.value && governmentList.value.length) {
governmentList.value.forEach(g => {
if (g.departId) {
orgMap[g.departId] = g.title;
}
});
}
const res = await getUSGovernmentSanctionHistory(params);
if (res.code === 200 && res.data) {
// 如果返回的是 content 数组(分页结构)或直接是数组
const rawList = res.data.content || res.data;
const grouped = {};
rawList.forEach(item => {
// 尝试获取部门名称
let deptName = "未知部门";
if (item.orgName) {
deptName = item.orgName;
} else if (item.orgId && orgMap[item.orgId]) {
deptName = orgMap[item.orgId];
} else if (item.orgId) {
if (item.orgId === "241") deptName = "商务部工业与安全局";
else if (item.orgId === "203") deptName = "海外资产控制办公室";
else deptName = "部门 " + item.orgId;
}
// 使用 orgName 进行分组,如果没有则显示未知部门
const deptName = item.orgName || "未知部门";
if (!grouped[deptName]) {
grouped[deptName] = {
......@@ -316,11 +297,18 @@ const getUSGovernmentSanctionHistoryData = async () => {
}
grouped[deptName].count++;
// 根据 status 映射红绿灯颜色
let level = "";
if (item.status === 1) level = "red";
else if (item.status === 2) level = "yellow";
else if (item.status === 3) level = "green";
else if (item.status === 4) level = "white";
grouped[deptName].events.push({
date: item.postDate ? item.postDate.replace(/^(\d{4})-(\d{2})-(\d{2})$/, "$1年$2月$3日") : "",
content: item.name || item.summary,
tags: item.techDomainList ? item.techDomainList.slice(0, 2) : [],
level: getLevelByCount(item.cnEntityCount)
level: level
});
});
timelineList.value = Object.values(grouped);
......@@ -333,14 +321,6 @@ const getUSGovernmentSanctionHistoryData = async () => {
}
};
// 辅助函数:根据受影响实体数量生成level
const getLevelByCount = count => {
const c = count || 0;
if (c === 0) return "green"; // 0 或空 绿色
if (c <= 10) return "yellow"; // 1-10 黄色
return "red"; // >10 红色
};
// 全政府-美政府部门联合制裁排行
const loadingJointRank = ref(false);
const getUSGovernmentJointSanctionRankData = async () => {
......@@ -666,13 +646,40 @@ const fieldOptions = ref([
{ label: "深海", value: "11" },
{ label: "极地", value: "12" },
{ label: "太空", value: "13" },
{ label: "核", value: "14" }
{ label: "核", value: "14" },
{ label: "政治", value: "20" },
{ label: "外交", value: "21" },
{ label: "经济", value: "22" },
{ label: "军事", value: "23" },
{ label: "科技", value: "24" },
{ label: "安全", value: "25" },
{ label: "其他", value: "99" },
]);
const methodOptions = ref([
{ label: "全部制裁手段", value: "" },
{ label: "法案", value: "-1" },
{ label: "行政令", value: "-2" }
{ label: "政令", value: "-2" },
{ label: "实体清单", value: "1" },
{ label: "特别国民指定清单", value: "2" },
{ label: "涉军企业", value: "3" },
{ label: "行业制裁识别清单", value: "4" },
{ label: "无法核实清单", value: "5" },
{ label: "军事最终用户清单", value: "6" },
{ label: "非SDN中国军工企业名单", value: "7" },
{ label: "拒绝往来人员清单", value: "8" },
{ label: "军事最终用途与最终用户规则", value: "9" },
{ label: "欧盟合并制裁清单", value: "10" },
{ label: "英国制裁清单", value: "11" },
{ label: "加拿大合并自主制裁清单", value: "12" },
{ label: "商业管制清单", value: "13" },
// { label: "232调查", value: "14" },
// { label: "Capta List (CAP) - Treasury Department", value: "15" },
// { label: "ITAR Debarred (DTC) - State Department", value: "16" },
// { label: "Nonproliferation Sanctions (ISN) - State Department", value: "17" },
// { label: "Non-SDN Menu-Based Sanctions List (NS-MBS List) - Treasury Department", value: "18" },
// { label: "Palestinian Legislative Council List (PLC) - Treasury Department", value: "19" },
// { label: "经验证最终用户清单", value: "20" }
]);
const dynamicList = ref([]);
......@@ -708,6 +715,13 @@ const getLineColorClass = level => {
return `line-default`;
};
const getCardColorClass = level => {
if (level) {
return `card-${level}`;
}
return `card-default`;
};
const dateRange = ref([0, 0]);
const filteredTimelineList = computed(() => {
......@@ -911,7 +925,7 @@ const initChart = (xAxisData = [], seriesData = []) => {
{
data: seriesData,
type: "line",
smooth: false,
smooth: true,
symbol: "circle",
symbolSize: 8,
itemStyle: {
......@@ -950,6 +964,11 @@ watch(
}
);
// 监听筛选条件变化,更新时间线数据
watch([() => measureType.value, () => selectedField.value], () => {
getUSGovernmentSanctionHistoryData();
});
onMounted(() => {
initChart();
initSlider();
......@@ -1745,6 +1764,35 @@ const prev = () => {
overflow: hidden;
flex-shrink: 0;
&.card-red {
background: linear-gradient(180deg, rgba(206, 79, 81, 0.08) 0%, rgba(255, 255, 255, 1) 60%);
.event-date {
color: rgb(206, 79, 81) !important;
}
}
&.card-yellow {
background: linear-gradient(180deg, rgba(232, 189, 11, 0.08) 0%, rgba(255, 255, 255, 1) 60%);
.event-date {
color: rgb(232, 189, 11) !important;
}
}
&.card-green {
background: linear-gradient(180deg, rgba(33, 129, 57, 0.08) 0%, rgba(255, 255, 255, 1) 60%);
.event-date {
color: rgb(33, 129, 57) !important;
}
}
&.card-white,
&.card-default {
background: #fff;
.event-date {
color: rgb(59, 65, 75) !important;
}
}
.card-top-line {
position: absolute;
top: 0;
......@@ -1780,8 +1828,9 @@ const prev = () => {
background-color: #13c2c2;
}
&.line-white,
&.line-default {
background-color: rgb(234, 236, 238);
background-color: #fff;
}
}
......@@ -1797,33 +1846,6 @@ const prev = () => {
color: rgb(59, 65, 75);
line-height: 30px;
}
.traffic-light {
display: flex;
gap: 2px;
background-color: rgb(247, 248, 249);
padding: 2px 2px;
border-radius: 20px;
.light {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: rgb(234, 236, 238);
&.green.active {
background-color: rgb(33, 129, 57);
}
&.yellow.active {
background-color: rgb(232, 189, 11);
}
&.red.active {
background-color: rgb(206, 79, 81);
}
}
}
}
.event-content {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论