|
|
@@ -3,10 +3,11 @@ import React from 'react';
|
|
|
// 定义弹出框数据类型
|
|
|
interface PopupData {
|
|
|
title: string;
|
|
|
+ subtitle: string;
|
|
|
metrics: {
|
|
|
label: string;
|
|
|
value: string;
|
|
|
- unit?: string;
|
|
|
+ unit: string;
|
|
|
}[];
|
|
|
}
|
|
|
|
|
|
@@ -23,11 +24,11 @@ const PopupInfoBox: React.FC<PopupInfoBoxProps> = ({
|
|
|
}) => {
|
|
|
// 默认数据
|
|
|
const defaultData: PopupData = {
|
|
|
- title: "粮食源头",
|
|
|
+ title: "源头",
|
|
|
+ subtitle: "江汉大米核心示范基地荆门/荆州/黄冈/孝感",
|
|
|
metrics: [
|
|
|
- { label: "种植面积", value: "15", unit: "万亩" },
|
|
|
- { label: "年产量", value: "200", unit: "万吨" },
|
|
|
- { label: "带动农户", value: "5000", unit: "户" }
|
|
|
+ { label: "辐射带动:", value: ">20", unit: "万亩" },
|
|
|
+ { label: "自建基地规模:", value: "6~15", unit: "万亩" }
|
|
|
]
|
|
|
};
|
|
|
|
|
|
@@ -56,40 +57,58 @@ const PopupInfoBox: React.FC<PopupInfoBoxProps> = ({
|
|
|
</div>
|
|
|
|
|
|
{/* 内容区域 */}
|
|
|
- <div className="absolute content-stretch flex flex-col gap-[12px] items-center left-[50px] top-[31.73px] w-[470px]">
|
|
|
+ <div className="absolute content-stretch flex flex-col gap-[12px] items-center left-[29.81px] top-[31.73px] w-[420px]">
|
|
|
{/* 标题区域 */}
|
|
|
<div className="content-stretch flex flex-col gap-[12px] items-start relative shrink-0 w-full">
|
|
|
<div className="box-border content-stretch flex gap-[10px] h-[62px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
- <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white whitespace-nowrap">
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[36px] text-lime-200 whitespace-nowrap">
|
|
|
<p className="leading-[32px]">{displayData.title}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="box-border content-stretch flex gap-[10px] h-[62px] items-center px-0 py-[4px] relative shrink-0 w-full">
|
|
|
- <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white whitespace-nowrap">
|
|
|
- <p className="leading-[32px]">详细信息</p>
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white">
|
|
|
+ <p className="leading-[32px] bg-gradient-to-b from-white to-sky-400 bg-clip-text text-transparent break-words">{displayData.subtitle}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
{/* 数据指标区域 */}
|
|
|
<div className="content-stretch flex flex-col gap-[12px] items-start relative shrink-0 w-full">
|
|
|
+ {/* 第一行数据 */}
|
|
|
<div className="content-stretch flex gap-[20px] items-start relative shrink-0">
|
|
|
- {displayData.metrics.slice(0, 3).map((metric, index) => (
|
|
|
- <div key={index} className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
- <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white whitespace-nowrap">
|
|
|
- <p className="leading-[32px]">{metric.label}</p>
|
|
|
- </div>
|
|
|
+ <div className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white whitespace-nowrap">
|
|
|
+ <p className="leading-[32px]">{displayData.metrics[0]?.label}</p>
|
|
|
</div>
|
|
|
- ))}
|
|
|
+ </div>
|
|
|
+ <div className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[36px] text-lime-200 whitespace-nowrap">
|
|
|
+ <p className="leading-[32px]">{displayData.metrics[0]?.value}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white whitespace-nowrap">
|
|
|
+ <p className="leading-[32px]">{displayData.metrics[0]?.unit}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ {/* 第二行数据 */}
|
|
|
<div className="content-stretch flex gap-[20px] items-start relative shrink-0">
|
|
|
- {displayData.metrics.slice(0, 3).map((metric, index) => (
|
|
|
- <div key={index} className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
- <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-[#C5FF92] whitespace-nowrap">
|
|
|
- <p className="leading-[32px]">{metric.value} {metric.unit}</p>
|
|
|
- </div>
|
|
|
+ <div className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white whitespace-nowrap">
|
|
|
+ <p className="leading-[32px]">{displayData.metrics[1]?.label}</p>
|
|
|
</div>
|
|
|
- ))}
|
|
|
+ </div>
|
|
|
+ <div className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[36px] text-lime-200 whitespace-nowrap">
|
|
|
+ <p className="leading-[32px]">{displayData.metrics[1]?.value}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="box-border content-stretch flex gap-[10px] items-center px-0 py-[4px] relative shrink-0">
|
|
|
+ <div className="flex flex-col font-bold justify-center leading-[0] not-italic relative shrink-0 text-[24px] text-white whitespace-nowrap">
|
|
|
+ <p className="leading-[32px]">{displayData.metrics[1]?.unit}</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|