import { Button, Image, Space, Table, Upload } from "antd";
import { useState } from "react";
import OrgEquipmentSelectModal from "./OrgEquipmentSelectModal";
export default function EquipmentStep({
equipmentList = [],
disabled,
onAdd,
onRemove,
onUploadCalibration,
}) {
const [selectOpen, setSelectOpen] = useState(false);
const [previewImage, setPreviewImage] = useState("");
const existingIds = equipmentList.map((item) => String(item.sourceEquipmentId || ""));
const isImage = (url) => /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(url || "");
return (
<>
申请单位装备清单
{!disabled && (
)}
index + 1 },
{ title: "装备名称", dataIndex: "deviceName" },
{ title: "规格型号", dataIndex: "deviceModel" },
{ title: "生产厂家", dataIndex: "manufacturer" },
{
title: "计量检定情况",
width: 180,
render: (_, record) => (
{record.calibrationReportUrl ? (
) : (
!disabled && (
{
if (info.file.status === "done") {
const data = info.file.response?.data;
if (data) {
onUploadCalibration?.(record, data);
}
}
}}
>
)
)}
),
},
{
title: "操作",
width: 100,
render: (_, record) => (
!disabled && (
)
),
},
]}
/>
setSelectOpen(false)}
onConfirm={(ids, rows) => {
onAdd?.(ids, rows);
setSelectOpen(false);
}}
/>
{
if (!visible) setPreviewImage("");
},
}}
/>
>
);
}