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

update

...@@ -58,8 +58,11 @@ export function getUSGovernmentJointSanctionRank() { ...@@ -58,8 +58,11 @@ export function getUSGovernmentJointSanctionRank() {
/** /**
* @header token * @header token
* @param {Object} params * @param {Object} params
* @param {String} params.currentPage = 1 // 当前页 * @param {String} params.startDate // 开始日期
* @param {String} params.pageSize = 1000 // 每页数量 * @param {String} params.endDate // 截止日期
* @param {Boolean} params.onlyHistory // 是否仅历史举措
* @param {Boolean} params.onlyFuture // 是否仅未来举措
* @param {String} params.field // 领域ID
*/ */
export function getUSGovernmentSanctionHistory(params) { export function getUSGovernmentSanctionHistory(params) {
return request({ return request({
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</div> </div>
<div class="select-box"> <div class="select-box">
<div class="rank-btns"> <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>
<div class="rank-btn" :class="{ active: rankType === 'enterprise' }" @click="rankType = 'enterprise'"> <div class="rank-btn" :class="{ active: rankType === 'enterprise' }" @click="rankType = 'enterprise'">
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</div> </div>
<div class="rank-btn" :class="{ active: rankType === 'school' }" @click="rankType = 'school'"> <div class="rank-btn" :class="{ active: rankType === 'school' }" @click="rankType = 'school'">
受打压院校 受打压院校
</div> </div> -->
</div> </div>
<el-select v-model="selectedField" placeholder="全部领域" class="field-select"> <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" /> <el-option v-for="item in fieldOptions" :key="item.value" :label="item.label" :value="item.value" />
......
...@@ -187,15 +187,10 @@ ...@@ -187,15 +187,10 @@
</div> </div>
</div> </div>
<div class="events-container"> <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="card-top-line" :class="getLineColorClass(event.level)"></div>
<div class="event-header"> <div class="event-header">
<div class="event-date">{{ event.date }}</div> <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> </div>
<el-tooltip <el-tooltip
effect="dark" effect="dark"
...@@ -276,35 +271,21 @@ const loadingHistory = ref(false); ...@@ -276,35 +271,21 @@ const loadingHistory = ref(false);
const getUSGovernmentSanctionHistoryData = async () => { const getUSGovernmentSanctionHistoryData = async () => {
loadingHistory.value = true; loadingHistory.value = true;
try { try {
const res = await getUSGovernmentSanctionHistory({ const params = {
currentPage: 1, onlyHistory: measureType.value === "history",
pageSize: 1000 onlyFuture: measureType.value === "future",
}); field: selectedField.value || null
if (res.code === 200 && res.data && res.data.content) { };
const rawList = res.data.content;
const orgMap = {}; const res = await getUSGovernmentSanctionHistory(params);
if (governmentList.value && governmentList.value.length) { if (res.code === 200 && res.data) {
governmentList.value.forEach(g => { // 如果返回的是 content 数组(分页结构)或直接是数组
if (g.departId) { const rawList = res.data.content || res.data;
orgMap[g.departId] = g.title;
}
});
}
const grouped = {}; const grouped = {};
rawList.forEach(item => { rawList.forEach(item => {
// 尝试获取部门名称 // 使用 orgName 进行分组,如果没有则显示未知部门
let deptName = "未知部门"; const deptName = item.orgName || "未知部门";
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;
}
if (!grouped[deptName]) { if (!grouped[deptName]) {
grouped[deptName] = { grouped[deptName] = {
...@@ -316,11 +297,18 @@ const getUSGovernmentSanctionHistoryData = async () => { ...@@ -316,11 +297,18 @@ const getUSGovernmentSanctionHistoryData = async () => {
} }
grouped[deptName].count++; 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({ grouped[deptName].events.push({
date: item.postDate ? item.postDate.replace(/^(\d{4})-(\d{2})-(\d{2})$/, "$1年$2月$3日") : "", date: item.postDate ? item.postDate.replace(/^(\d{4})-(\d{2})-(\d{2})$/, "$1年$2月$3日") : "",
content: item.name || item.summary, content: item.name || item.summary,
tags: item.techDomainList ? item.techDomainList.slice(0, 2) : [], tags: item.techDomainList ? item.techDomainList.slice(0, 2) : [],
level: getLevelByCount(item.cnEntityCount) level: level
}); });
}); });
timelineList.value = Object.values(grouped); timelineList.value = Object.values(grouped);
...@@ -333,14 +321,6 @@ const getUSGovernmentSanctionHistoryData = async () => { ...@@ -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 loadingJointRank = ref(false);
const getUSGovernmentJointSanctionRankData = async () => { const getUSGovernmentJointSanctionRankData = async () => {
...@@ -666,13 +646,40 @@ const fieldOptions = ref([ ...@@ -666,13 +646,40 @@ const fieldOptions = ref([
{ label: "深海", value: "11" }, { label: "深海", value: "11" },
{ label: "极地", value: "12" }, { label: "极地", value: "12" },
{ label: "太空", value: "13" }, { 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([ const methodOptions = ref([
{ label: "全部制裁手段", value: "" }, { label: "全部制裁手段", value: "" },
{ label: "法案", value: "-1" }, { 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([]); const dynamicList = ref([]);
...@@ -708,6 +715,13 @@ const getLineColorClass = level => { ...@@ -708,6 +715,13 @@ const getLineColorClass = level => {
return `line-default`; return `line-default`;
}; };
const getCardColorClass = level => {
if (level) {
return `card-${level}`;
}
return `card-default`;
};
const dateRange = ref([0, 0]); const dateRange = ref([0, 0]);
const filteredTimelineList = computed(() => { const filteredTimelineList = computed(() => {
...@@ -911,7 +925,7 @@ const initChart = (xAxisData = [], seriesData = []) => { ...@@ -911,7 +925,7 @@ const initChart = (xAxisData = [], seriesData = []) => {
{ {
data: seriesData, data: seriesData,
type: "line", type: "line",
smooth: false, smooth: true,
symbol: "circle", symbol: "circle",
symbolSize: 8, symbolSize: 8,
itemStyle: { itemStyle: {
...@@ -950,6 +964,11 @@ watch( ...@@ -950,6 +964,11 @@ watch(
} }
); );
// 监听筛选条件变化,更新时间线数据
watch([() => measureType.value, () => selectedField.value], () => {
getUSGovernmentSanctionHistoryData();
});
onMounted(() => { onMounted(() => {
initChart(); initChart();
initSlider(); initSlider();
...@@ -1745,6 +1764,35 @@ const prev = () => { ...@@ -1745,6 +1764,35 @@ const prev = () => {
overflow: hidden; overflow: hidden;
flex-shrink: 0; 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 { .card-top-line {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -1780,8 +1828,9 @@ const prev = () => { ...@@ -1780,8 +1828,9 @@ const prev = () => {
background-color: #13c2c2; background-color: #13c2c2;
} }
&.line-white,
&.line-default { &.line-default {
background-color: rgb(234, 236, 238); background-color: #fff;
} }
} }
...@@ -1797,33 +1846,6 @@ const prev = () => { ...@@ -1797,33 +1846,6 @@ const prev = () => {
color: rgb(59, 65, 75); color: rgb(59, 65, 75);
line-height: 30px; 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 { .event-content {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论