refactor(statistics): 简化统计组件数据渲染并补充类型声明
- 移除第一层弹窗 tableConfig 的统一 renderCell - 移除统计页面 formatValue,直接使用原始数据 - 补充指标 blue 类型对应样式 - 为 8 个统计公共组件增加统一的 TypeScript 声明 - 调整 jsconfig 以识别根目录 typesmaster
parent
6dfc89c8d7
commit
25b5e9b5e5
|
|
@ -6,5 +6,5 @@
|
||||||
},
|
},
|
||||||
"jsx": "react"
|
"jsx": "react"
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src", "types"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ const tableRows = [
|
||||||
rectificationRate: "97.50%",
|
rectificationRate: "97.50%",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#f07f7f", "#ffd54d", "#45c8b2", "#65a9e8", "#aa83d6"];
|
const chartColors = ["#f07f7f", "#ffd54d", "#45c8b2", "#65a9e8", "#aa83d6"];
|
||||||
|
|
||||||
|
|
@ -131,7 +130,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
color: chartColors,
|
color: chartColors,
|
||||||
tooltip: { trigger: "item" },
|
tooltip: { trigger: "item" },
|
||||||
title: {
|
title: {
|
||||||
text: formatValue(total),
|
text: total,
|
||||||
subtext: "隐患总数",
|
subtext: "隐患总数",
|
||||||
left: "28.5%",
|
left: "28.5%",
|
||||||
top: "46%",
|
top: "46%",
|
||||||
|
|
@ -153,7 +152,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
formatter: (name) => {
|
formatter: (name) => {
|
||||||
const index = metrics.findIndex(item => item.name === name);
|
const index = metrics.findIndex(item => item.name === name);
|
||||||
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
||||||
return `${name} ${formatValue(values[index])} · ${ratio}%`;
|
return `${name} ${values[index]} · ${ratio}%`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
|
|
@ -187,7 +186,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -295,7 +294,6 @@ function HiddenDangerExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,6 @@ const departmentRows = [
|
||||||
{ id: 4, department: "设备管理部", total: 22410, rectified: 21760, pending: 650, rate: "97.10%" },
|
{ id: 4, department: "设备管理部", total: 22410, rectified: 21760, pending: 650, rate: "97.10%" },
|
||||||
{ id: 5, department: "综合管理部", total: 16031, rectified: 15455, pending: 576, rate: "96.40%" },
|
{ id: 5, department: "综合管理部", total: 16031, rectified: 15455, pending: 576, rate: "96.40%" },
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
function HiddenChart({ type, data }) {
|
function HiddenChart({ type, data }) {
|
||||||
const chartRef = useRef(null);
|
const chartRef = useRef(null);
|
||||||
|
|
||||||
|
|
@ -47,7 +45,7 @@ function HiddenChart({ type, data }) {
|
||||||
color: ["#65a9e8", "#45c8b2", "#aa83d6", "#f07f7f", "#ffd54d"],
|
color: ["#65a9e8", "#45c8b2", "#aa83d6", "#f07f7f", "#ffd54d"],
|
||||||
tooltip: { trigger: "item" },
|
tooltip: { trigger: "item" },
|
||||||
title: {
|
title: {
|
||||||
text: formatValue(total),
|
text: total,
|
||||||
subtext: "隐患总数",
|
subtext: "隐患总数",
|
||||||
left: "17%",
|
left: "17%",
|
||||||
top: "41%",
|
top: "41%",
|
||||||
|
|
@ -195,9 +193,10 @@ function HiddenDangerPanel({ onExpand }) {
|
||||||
renderRow={row => (
|
renderRow={row => (
|
||||||
<OverviewTableRow key={row.id}>
|
<OverviewTableRow key={row.id}>
|
||||||
<span>{row.department}</span>
|
<span>{row.department}</span>
|
||||||
<span>{formatValue(row.total)}</span>
|
<span>{row.total}</span>
|
||||||
<span>{formatValue(row.rectified)}</span>
|
<span>{row.rectified}</span>
|
||||||
<span>{formatValue(row.pending)}</span>
|
<span>{row.pending}</span>
|
||||||
|
<span>{row.rate}</span>
|
||||||
<span>{row.rate}</span>
|
<span>{row.rate}</span>
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,6 @@ const tableRows = [
|
||||||
unplanned: 14,
|
unplanned: 14,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#45c8b2", "#ffb547"];
|
const chartColors = ["#45c8b2", "#ffb547"];
|
||||||
|
|
||||||
|
|
@ -209,7 +208,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -371,7 +370,6 @@ function SafetyInspectionExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "单位执行明细",
|
title: "单位执行明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,6 @@ const tableRows = [
|
||||||
{ id: 12, unit: "十公司", name: "周倩", role: "综合部部长", mobile: "187****2468", phone: "3568246" },
|
{ id: 12, unit: "十公司", name: "周倩", role: "综合部部长", mobile: "187****2468", phone: "3568246" },
|
||||||
{ id: 13, unit: "保税物流中心", name: "马超", role: "运营部部长", mobile: "188****9675", phone: "3568967" },
|
{ id: 13, unit: "保税物流中心", name: "马超", role: "运营部部长", mobile: "188****9675", phone: "3568967" },
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -200,7 +199,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -327,7 +326,6 @@ function EmergencyManagementExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "应急值班明细",
|
title: "应急值班明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,6 @@ const tableRows = [
|
||||||
low: 665,
|
low: 665,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff1f10", "#ff7900", "#ffca09", "#4b9eff"];
|
const chartColors = ["#ff1f10", "#ff7900", "#ffca09", "#4b9eff"];
|
||||||
|
|
||||||
|
|
@ -194,7 +193,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
color: chartColors,
|
color: chartColors,
|
||||||
tooltip: { trigger: "item", confine: true },
|
tooltip: { trigger: "item", confine: true },
|
||||||
title: {
|
title: {
|
||||||
text: formatValue(total),
|
text: total,
|
||||||
subtext: "风险总数",
|
subtext: "风险总数",
|
||||||
left: "20.5%",
|
left: "20.5%",
|
||||||
top: "42%",
|
top: "42%",
|
||||||
|
|
@ -214,7 +213,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
formatter: (name) => {
|
formatter: (name) => {
|
||||||
const index = metrics.findIndex(item => item.name === name);
|
const index = metrics.findIndex(item => item.name === name);
|
||||||
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
||||||
return `${name} ${formatValue(values[index])} · ${ratio}%`;
|
return `${name} ${values[index]} · ${ratio}%`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
|
|
@ -248,7 +247,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -360,7 +359,6 @@ function RiskStatisticsExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: "1.2fr 0.8fr repeat(4, 0.8fr)",
|
gridColumns: "1.2fr 0.8fr repeat(4, 0.8fr)",
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,6 @@ const tableRows = [
|
||||||
abnormal: 2,
|
abnormal: 2,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -175,7 +174,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -283,7 +282,6 @@ function FireInspectionExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ const tableRows = [
|
||||||
department: "安全环保部",
|
department: "安全环保部",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -156,7 +155,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -272,7 +271,6 @@ function KeyWorkExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "当天重点作业列表",
|
title: "当天重点作业列表",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@ const tableRows = [
|
||||||
secondPeople: 382,
|
secondPeople: 382,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -176,7 +175,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -292,7 +291,6 @@ function RelatedPartyExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,6 @@ const tableRows = [
|
||||||
abnormal: 2,
|
abnormal: 2,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -175,7 +174,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -283,7 +282,6 @@ function FireSafetyExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ const tableRows = [
|
||||||
rectificationRate: "98.77%",
|
rectificationRate: "98.77%",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#f07f7f", "#ffd54d", "#45c8b2", "#65a9e8", "#aa83d6"];
|
const chartColors = ["#f07f7f", "#ffd54d", "#45c8b2", "#65a9e8", "#aa83d6"];
|
||||||
|
|
||||||
|
|
@ -131,7 +130,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
color: chartColors,
|
color: chartColors,
|
||||||
tooltip: { trigger: "item" },
|
tooltip: { trigger: "item" },
|
||||||
title: {
|
title: {
|
||||||
text: formatValue(total),
|
text: total,
|
||||||
subtext: "隐患总数",
|
subtext: "隐患总数",
|
||||||
left: "28.5%",
|
left: "28.5%",
|
||||||
top: "46%",
|
top: "46%",
|
||||||
|
|
@ -153,7 +152,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
formatter: (name) => {
|
formatter: (name) => {
|
||||||
const index = metrics.findIndex(item => item.name === name);
|
const index = metrics.findIndex(item => item.name === name);
|
||||||
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
||||||
return `${name} ${formatValue(values[index])} · ${ratio}%`;
|
return `${name} ${values[index]} · ${ratio}%`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
|
|
@ -187,7 +186,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -295,7 +294,6 @@ function HiddenDangerExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,6 @@ const tableRows = [
|
||||||
completionRate: "100%",
|
completionRate: "100%",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -161,7 +160,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -273,7 +272,6 @@ function MajorHazardExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,6 @@ const tableRows = [
|
||||||
low: 665,
|
low: 665,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff1f10", "#ff7900", "#ffca09", "#4b9eff"];
|
const chartColors = ["#ff1f10", "#ff7900", "#ffca09", "#4b9eff"];
|
||||||
|
|
||||||
|
|
@ -194,7 +193,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
color: chartColors,
|
color: chartColors,
|
||||||
tooltip: { trigger: "item", confine: true },
|
tooltip: { trigger: "item", confine: true },
|
||||||
title: {
|
title: {
|
||||||
text: formatValue(total),
|
text: total,
|
||||||
subtext: "风险总数",
|
subtext: "风险总数",
|
||||||
left: "20.5%",
|
left: "20.5%",
|
||||||
top: "42%",
|
top: "42%",
|
||||||
|
|
@ -214,7 +213,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
formatter: (name) => {
|
formatter: (name) => {
|
||||||
const index = metrics.findIndex(item => item.name === name);
|
const index = metrics.findIndex(item => item.name === name);
|
||||||
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
||||||
return `${name} ${formatValue(values[index])} · ${ratio}%`;
|
return `${name} ${values[index]} · ${ratio}%`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
|
|
@ -248,7 +247,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -360,7 +359,6 @@ function RiskControlExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: "1.2fr 0.8fr repeat(4, 0.8fr)",
|
gridColumns: "1.2fr 0.8fr repeat(4, 0.8fr)",
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,6 @@ const tableRows = [
|
||||||
{ id: 12, unit: "十公司", name: "周倩", role: "综合部部长", mobile: "187****2468", phone: "3568246" },
|
{ id: 12, unit: "十公司", name: "周倩", role: "综合部部长", mobile: "187****2468", phone: "3568246" },
|
||||||
{ id: 13, unit: "保税物流中心", name: "马超", role: "运营部部长", mobile: "188****9675", phone: "3568967" },
|
{ id: 13, unit: "保税物流中心", name: "马超", role: "运营部部长", mobile: "188****9675", phone: "3568967" },
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -200,7 +199,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -327,7 +326,6 @@ function EmergencyManagementExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "应急值班明细",
|
title: "应急值班明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,6 @@ const tableRows = [
|
||||||
completionRate: "91.7%",
|
completionRate: "91.7%",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -161,7 +160,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -273,7 +272,6 @@ function SafetyEvaluationExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,6 @@ const tableRows = [
|
||||||
unplanned: 14,
|
unplanned: 14,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#45c8b2", "#ffb547"];
|
const chartColors = ["#45c8b2", "#ffb547"];
|
||||||
|
|
||||||
|
|
@ -209,7 +208,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -371,7 +370,6 @@ function SafetyInspectionExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "单位执行明细",
|
title: "单位执行明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,6 @@ const tableRows = [
|
||||||
blue: 7,
|
blue: 7,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff1f10", "#ff7900", "#ffca09", "#4b9eff"];
|
const chartColors = ["#ff1f10", "#ff7900", "#ffca09", "#4b9eff"];
|
||||||
|
|
||||||
|
|
@ -133,7 +132,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
color: chartColors,
|
color: chartColors,
|
||||||
tooltip: { trigger: "item" },
|
tooltip: { trigger: "item" },
|
||||||
title: {
|
title: {
|
||||||
text: formatValue(total),
|
text: total,
|
||||||
subtext: "封闭区域总数",
|
subtext: "封闭区域总数",
|
||||||
left: "28.5%",
|
left: "28.5%",
|
||||||
top: "46%",
|
top: "46%",
|
||||||
|
|
@ -155,7 +154,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
formatter: (name) => {
|
formatter: (name) => {
|
||||||
const index = metrics.findIndex(item => item.name === name);
|
const index = metrics.findIndex(item => item.name === name);
|
||||||
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
const ratio = total ? (values[index] / total * 100).toFixed(2) : "0.00";
|
||||||
return `${name} ${formatValue(values[index])} · ${ratio}%`;
|
return `${name} ${values[index]} · ${ratio}%`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
series: [{
|
series: [{
|
||||||
|
|
@ -189,7 +188,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -304,7 +303,6 @@ function FixedColorExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,6 @@ const tableRows = [
|
||||||
dangerousWorkStarts: 3,
|
dangerousWorkStarts: 3,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -151,7 +150,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -267,7 +266,6 @@ function KeyWorkExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,6 @@ const tableRows = [
|
||||||
processingRate: "100%",
|
processingRate: "100%",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -154,7 +153,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -266,7 +265,6 @@ function PenaltyStatisticsExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@ const mockRows = [
|
||||||
{ id: 4, unit: "蓝天环保", projectCount: 1, penaltyCount: 1, amount: 8000 },
|
{ id: 4, unit: "蓝天环保", projectCount: 1, penaltyCount: 1, amount: 8000 },
|
||||||
];
|
];
|
||||||
const mockSummary = { projectCount: 4, penaltyCount: 6, amount: 11500 };
|
const mockSummary = { projectCount: 4, penaltyCount: 6, amount: 11500 };
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
function PenaltyStatisticsPanel({ onExpand }) {
|
function PenaltyStatisticsPanel({ onExpand }) {
|
||||||
return (
|
return (
|
||||||
<Panel title="相关方处罚统计表" onExpand={onExpand} className={styles.panel}>
|
<Panel title="相关方处罚统计表" onExpand={onExpand} className={styles.panel}>
|
||||||
|
|
@ -29,17 +27,17 @@ function PenaltyStatisticsPanel({ onExpand }) {
|
||||||
renderRow={record => (
|
renderRow={record => (
|
||||||
<OverviewTableRow key={record.id}>
|
<OverviewTableRow key={record.id}>
|
||||||
<span>{record.unit}</span>
|
<span>{record.unit}</span>
|
||||||
<span>{formatValue(record.projectCount)}</span>
|
<span>{record.projectCount}</span>
|
||||||
<span>{formatValue(record.penaltyCount)}</span>
|
<span>{record.penaltyCount}</span>
|
||||||
<span>{formatValue(record.amount)}</span>
|
<span>{record.amount}</span>
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
)}
|
)}
|
||||||
summary={(
|
summary={(
|
||||||
<OverviewTableRow type="summary">
|
<OverviewTableRow type="summary">
|
||||||
<span>合计</span>
|
<span>合计</span>
|
||||||
<span>{formatValue(mockSummary.projectCount)}</span>
|
<span>{mockSummary.projectCount}</span>
|
||||||
<span>{formatValue(mockSummary.penaltyCount)}</span>
|
<span>{mockSummary.penaltyCount}</span>
|
||||||
<span>{formatValue(mockSummary.amount)}</span>
|
<span>{mockSummary.amount}</span>
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
)}
|
)}
|
||||||
scrollLimit={4}
|
scrollLimit={4}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@ const tableRows = [
|
||||||
secondPeople: 382,
|
secondPeople: 382,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
const chartColors = ["#ff4338", "#ff8a23", "#f6c445", "#3d8fe8", "#38bca7"];
|
||||||
|
|
||||||
|
|
@ -176,7 +175,7 @@ function getChartOption(type, metrics, trend) {
|
||||||
type: "category",
|
type: "category",
|
||||||
inverse: true,
|
inverse: true,
|
||||||
position: "right",
|
position: "right",
|
||||||
data: metrics.map(item => formatValue(item.value)),
|
data: metrics.map(item => item.value),
|
||||||
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
axisLabel: { color: "#3b445c", fontSize: 11, margin: 10 },
|
||||||
axisLine: { show: false },
|
axisLine: { show: false },
|
||||||
axisTick: { show: false },
|
axisTick: { show: false },
|
||||||
|
|
@ -292,7 +291,6 @@ function RelatedPartyExpandedPanel({ selectedCompany }) {
|
||||||
dataSource: tableRows,
|
dataSource: tableRows,
|
||||||
description: `${scopeName} · ${periodLabel}`,
|
description: `${scopeName} · ${periodLabel}`,
|
||||||
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
gridColumns: `repeat(${tableColumns.length}, minmax(0, 1fr))`,
|
||||||
renderCell: (record, column) => formatValue(record[column.dataIndex]),
|
|
||||||
scrollLimit: 3,
|
scrollLimit: 3,
|
||||||
title: "统计明细",
|
title: "统计明细",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@ const mockSecondRows = [
|
||||||
];
|
];
|
||||||
const mockFirstSummary = { type: "统计", unitCount: 259, peopleCount: 3401 };
|
const mockFirstSummary = { type: "统计", unitCount: 259, peopleCount: 3401 };
|
||||||
const mockSecondSummary = { type: "合计", unitCount: 525, peopleCount: 10956 };
|
const mockSecondSummary = { type: "合计", unitCount: 525, peopleCount: 10956 };
|
||||||
const formatValue = value => typeof value === "number" ? value.toLocaleString("zh-CN") : value;
|
|
||||||
|
|
||||||
function RelatedPartyPanel({ onExpand }) {
|
function RelatedPartyPanel({ onExpand }) {
|
||||||
return (
|
return (
|
||||||
<Panel title="相关方单位情况统计" onExpand={onExpand} className={styles.panel}>
|
<Panel title="相关方单位情况统计" onExpand={onExpand} className={styles.panel}>
|
||||||
|
|
@ -45,15 +43,15 @@ function RelatedPartyPanel({ onExpand }) {
|
||||||
renderRow={record => (
|
renderRow={record => (
|
||||||
<OverviewTableRow key={record.id}>
|
<OverviewTableRow key={record.id}>
|
||||||
<span>{record.type}</span>
|
<span>{record.type}</span>
|
||||||
<span>{formatValue(record.unitCount)}</span>
|
<span>{record.unitCount}</span>
|
||||||
<span>{formatValue(record.peopleCount)}</span>
|
<span>{record.peopleCount}</span>
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
)}
|
)}
|
||||||
summary={(
|
summary={(
|
||||||
<OverviewTableRow type="summary">
|
<OverviewTableRow type="summary">
|
||||||
<span>{mockFirstSummary.type}</span>
|
<span>{mockFirstSummary.type}</span>
|
||||||
<span>{formatValue(mockFirstSummary.unitCount)}</span>
|
<span>{mockFirstSummary.unitCount}</span>
|
||||||
<span>{formatValue(mockFirstSummary.peopleCount)}</span>
|
<span>{mockFirstSummary.peopleCount}</span>
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
@ -75,15 +73,15 @@ function RelatedPartyPanel({ onExpand }) {
|
||||||
renderRow={record => (
|
renderRow={record => (
|
||||||
<OverviewTableRow key={record.id}>
|
<OverviewTableRow key={record.id}>
|
||||||
<span>{record.type}</span>
|
<span>{record.type}</span>
|
||||||
<span>{formatValue(record.unitCount)}</span>
|
<span>{record.unitCount}</span>
|
||||||
<span>{formatValue(record.peopleCount)}</span>
|
<span>{record.peopleCount}</span>
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
)}
|
)}
|
||||||
summary={(
|
summary={(
|
||||||
<OverviewTableRow type="summary">
|
<OverviewTableRow type="summary">
|
||||||
<span>{mockSecondSummary.type}</span>
|
<span>{mockSecondSummary.type}</span>
|
||||||
<span>{formatValue(mockSecondSummary.unitCount)}</span>
|
<span>{mockSecondSummary.unitCount}</span>
|
||||||
<span>{formatValue(mockSecondSummary.peopleCount)}</span>
|
<span>{mockSecondSummary.peopleCount}</span>
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,7 @@ function ExpandedLayout({
|
||||||
<OverviewTableRow key={record.id}>
|
<OverviewTableRow key={record.id}>
|
||||||
{tableConfig.columns.map(column => (
|
{tableConfig.columns.map(column => (
|
||||||
<span key={column.dataIndex}>
|
<span key={column.dataIndex}>
|
||||||
{column.renderCell
|
{column.renderCell ? column.renderCell(record) : record[column.dataIndex]}
|
||||||
? column.renderCell(record)
|
|
||||||
: tableConfig.renderCell?.(record, column) ?? record[column.dataIndex]}
|
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</OverviewTableRow>
|
</OverviewTableRow>
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,10 @@
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&[data-tone="blue"] strong {
|
||||||
|
color: #2e75c6;
|
||||||
|
}
|
||||||
|
|
||||||
&[data-tone="red"] strong {
|
&[data-tone="red"] strong {
|
||||||
color: #e8473f;
|
color: #e8473f;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ export const closeWindow = () => {
|
||||||
window.close();
|
window.close();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!window.closed && !window.opener) {
|
if (!window.closed && !window.opener) {
|
||||||
// window.location.href = "https://gbs-gateway.qhdsafety.com/";
|
window.location.href = "https://gbs-gateway.qhdsafety.com/";
|
||||||
window.location.href = "http://192.168.198.8:30140/";
|
// window.location.href = "http://192.168.198.8:30140/";
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,246 @@
|
||||||
|
declare module "~/pages/Container/Statistics/components/Panel" {
|
||||||
|
/** 首页统计大块公共外壳的属性。 */
|
||||||
|
export interface StatisticsPanelProps {
|
||||||
|
/** 统计块标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 统计块主体内容。 */
|
||||||
|
children: import("react").ReactNode;
|
||||||
|
/** 点击“更多”时打开第一层放大弹窗。 */
|
||||||
|
onExpand: () => void;
|
||||||
|
/** 标题栏中位于“更多”按钮前的附加内容。 */
|
||||||
|
extra?: import("react").ReactNode;
|
||||||
|
/** 业务统计块追加的 CSS Modules 类名。 */
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染首页统计大块公共外壳。 */
|
||||||
|
export default function Panel(props: StatisticsPanelProps): import("react").ReactElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "~/pages/Container/Statistics/components/OverviewTable" {
|
||||||
|
/** 首页和第一层弹窗共用的滚动表格属性。 */
|
||||||
|
export interface OverviewTableProps<T = Record<string, any>> {
|
||||||
|
/** CSS Grid 的列模板。 */
|
||||||
|
columns: string;
|
||||||
|
/** 表格数据,行类型会传递给 renderRow。 */
|
||||||
|
dataSource: T[];
|
||||||
|
/** 表头内容。 */
|
||||||
|
header: import("react").ReactNode;
|
||||||
|
/** 根据当前数据行渲染整行内容。 */
|
||||||
|
renderRow: (record: T, index: number, dataSource: T[]) => import("react").ReactNode;
|
||||||
|
/** 表格底部合计行。 */
|
||||||
|
summary?: import("react").ReactNode;
|
||||||
|
/** 超过该行数后启用无缝滚动,默认值为 4。 */
|
||||||
|
scrollLimit?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 滚动表格单行布局的属性。 */
|
||||||
|
export interface OverviewTableRowProps {
|
||||||
|
/** 行类型,默认值为 body。 */
|
||||||
|
type?: "header" | "body" | "summary";
|
||||||
|
/** 当前行中的单元格内容。 */
|
||||||
|
children: import("react").ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染滚动表格。 */
|
||||||
|
export default function OverviewTable<T = Record<string, any>>(
|
||||||
|
props: OverviewTableProps<T>,
|
||||||
|
): import("react").ReactElement;
|
||||||
|
|
||||||
|
/** 渲染滚动表格中的表头、数据行或合计行。 */
|
||||||
|
export function OverviewTableRow(props: OverviewTableRowProps): import("react").ReactElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "~/pages/Container/Statistics/components/ExpandedLayer" {
|
||||||
|
/** 当前页面第一层放大弹窗外壳的属性。 */
|
||||||
|
export interface ExpandedLayerProps {
|
||||||
|
/** 是否显示放大弹窗。 */
|
||||||
|
open: boolean;
|
||||||
|
/** 弹窗标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 当前业务的第一层放大内容。 */
|
||||||
|
children: import("react").ReactNode;
|
||||||
|
/** 关闭第一层放大弹窗。 */
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染当前页面第一层放大弹窗。 */
|
||||||
|
export default function ExpandedLayer(props: ExpandedLayerProps): import("react").ReactElement | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "~/pages/Container/Statistics/components/ExpandedLayout" {
|
||||||
|
/** 第一层放大弹窗顶部的单个指标。 */
|
||||||
|
export interface ExpandedMetricItem {
|
||||||
|
/** 指标名称。 */
|
||||||
|
name: string;
|
||||||
|
/** 指标值,支持数字、百分比和已格式化的字符串。 */
|
||||||
|
value: string | number;
|
||||||
|
/** 指标颜色标识。 */
|
||||||
|
tone?: "blue" | "red" | "orange" | "yellow" | "green";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 滚动表格的一行数据,各业务弹窗可以继续添加自己的字段。 */
|
||||||
|
export interface ExpandedTableRecord {
|
||||||
|
/** 行唯一标识。 */
|
||||||
|
id: import("react").Key;
|
||||||
|
[field: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 第一层放大弹窗底部滚动表格的列配置。 */
|
||||||
|
export interface ExpandedTableColumn {
|
||||||
|
/** 列标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 对应数据行中的字段名。 */
|
||||||
|
dataIndex: string;
|
||||||
|
/** 当前列独立的单元格渲染方法。 */
|
||||||
|
renderCell?: (record: ExpandedTableRecord) => import("react").ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 第一层放大弹窗底部滚动表格的完整配置。 */
|
||||||
|
export interface ExpandedTableConfig {
|
||||||
|
/** 表格标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 表格标题右侧的统计范围等说明。 */
|
||||||
|
description: import("react").ReactNode;
|
||||||
|
/** CSS Grid 的列模板,例如 repeat(4, minmax(0, 1fr))。 */
|
||||||
|
gridColumns: string;
|
||||||
|
/** 超过该行数后启用无缝滚动。 */
|
||||||
|
scrollLimit: number;
|
||||||
|
/** 表格列配置。 */
|
||||||
|
columns: ExpandedTableColumn[];
|
||||||
|
/** 表格数据。 */
|
||||||
|
dataSource: ExpandedTableRecord[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 第一层放大弹窗右侧的单个业务入口。 */
|
||||||
|
export interface ExpandedBusinessEntry {
|
||||||
|
/** 入口唯一标识。 */
|
||||||
|
key: import("react").Key;
|
||||||
|
/** 入口标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 入口说明。 */
|
||||||
|
description: string;
|
||||||
|
/** 点击入口时打开对应列表弹窗。 */
|
||||||
|
onClick: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 第一层放大弹窗右侧的当前统计项。 */
|
||||||
|
export interface ExpandedStatisticItem {
|
||||||
|
/** 统计项名称。 */
|
||||||
|
label: string;
|
||||||
|
/** 统计项内容。 */
|
||||||
|
value: import("react").ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 第一层放大弹窗公共左右布局的属性。 */
|
||||||
|
export interface ExpandedLayoutProps {
|
||||||
|
/** 左侧主标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 左侧副标题。 */
|
||||||
|
subtitle: string;
|
||||||
|
/** 主标题右侧内容,当前通常传入统计周期 Segmented。 */
|
||||||
|
headerExtra: import("react").ReactNode;
|
||||||
|
/** 右侧当前统计中显示的统计周期。 */
|
||||||
|
periodText: string;
|
||||||
|
/** 左侧顶部指标列表。 */
|
||||||
|
metrics: ExpandedMetricItem[];
|
||||||
|
/** 左侧中间由各业务弹窗自行维护的图表或统计内容。 */
|
||||||
|
mainContent: import("react").ReactNode;
|
||||||
|
/** 左侧底部滚动表格配置。 */
|
||||||
|
tableConfig: ExpandedTableConfig;
|
||||||
|
/** 右侧业务入口列表。 */
|
||||||
|
businessEntries: ExpandedBusinessEntry[];
|
||||||
|
/** 右侧当前统计列表。 */
|
||||||
|
statistics: ExpandedStatisticItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染第一层放大弹窗的公共左右布局。 */
|
||||||
|
export default function ExpandedLayout(props: ExpandedLayoutProps): import("react").ReactElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "~/pages/Container/Statistics/components/ListDialog" {
|
||||||
|
/** 第二层列表弹窗公共外框的属性。 */
|
||||||
|
export interface ListDialogProps {
|
||||||
|
/** 列表弹窗标题,用于无障碍说明。 */
|
||||||
|
title: string;
|
||||||
|
/** 业务模块自己的列表内容。 */
|
||||||
|
children: import("react").ReactNode;
|
||||||
|
/** 关闭第二层列表弹窗。 */
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染第二层列表弹窗公共外框。 */
|
||||||
|
export default function ListDialog(props: ListDialogProps): import("react").ReactElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "~/pages/Container/Statistics/components/ListLayout" {
|
||||||
|
/** 第二层业务列表公共上下布局的属性。 */
|
||||||
|
export interface ListLayoutProps {
|
||||||
|
/** 列表主标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 列表副标题。 */
|
||||||
|
subtitle: string;
|
||||||
|
/** 点击右上角关闭按钮时执行的方法。 */
|
||||||
|
onBack: () => void;
|
||||||
|
/** 搜索区域内容。 */
|
||||||
|
searchContent: import("react").ReactNode;
|
||||||
|
/** 表格区域内容。 */
|
||||||
|
tableContent: import("react").ReactNode;
|
||||||
|
/** 底部统计范围等说明。 */
|
||||||
|
footerContent: import("react").ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染第二层业务列表公共上下布局。 */
|
||||||
|
export default function ListLayout(props: ListLayoutProps): import("react").ReactElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "~/pages/Container/Statistics/components/DetailDialog" {
|
||||||
|
/** 第三层详情弹窗公共外框的属性。 */
|
||||||
|
export interface DetailDialogProps {
|
||||||
|
/** 详情弹窗标题。 */
|
||||||
|
title: string;
|
||||||
|
/** 业务模块自己的详情字段内容。 */
|
||||||
|
children: import("react").ReactNode;
|
||||||
|
/** 关闭第三层详情弹窗。 */
|
||||||
|
onClose: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染第三层详情弹窗公共外框。 */
|
||||||
|
export default function DetailDialog(props: DetailDialogProps): import("react").ReactElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "~/pages/Container/Statistics/components/Header" {
|
||||||
|
/** 首页当前选中的统计范围。 */
|
||||||
|
export interface StatisticsCompanyOption {
|
||||||
|
/** Select 使用的选项值。 */
|
||||||
|
value: string | number;
|
||||||
|
/** Select 显示的选项文字。 */
|
||||||
|
label: string;
|
||||||
|
/** 页面统计和弹窗中显示的公司名称。 */
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 首页天气接口当前天气数据。 */
|
||||||
|
export interface StatisticsWeatherNow {
|
||||||
|
text?: string;
|
||||||
|
temp?: string | number;
|
||||||
|
wind_class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 首页公共头部对外暴露的属性,接口方法由 Connect 注入。 */
|
||||||
|
export interface StatisticsHeaderProps {
|
||||||
|
/** 页面历史对象,仅使用返回上一页能力。 */
|
||||||
|
history: { goBack: () => void };
|
||||||
|
/** 当前选择的统计范围。 */
|
||||||
|
selectedCompany: StatisticsCompanyOption;
|
||||||
|
/** 天气数据,兼容接口 now 包装和直接返回两种结构。 */
|
||||||
|
weather: StatisticsWeatherNow | { now: StatisticsWeatherNow };
|
||||||
|
/** 天气请求状态。 */
|
||||||
|
weatherLoading: boolean;
|
||||||
|
/** 切换统计范围时更新首页状态。 */
|
||||||
|
onCompanyChange: (company: StatisticsCompanyOption) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 渲染统计页面公共头部。 */
|
||||||
|
export default function Header(props: StatisticsHeaderProps): import("react").ReactElement;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue