|
@ -49,9 +49,8 @@ const TemplateModal = ({ |
|
|
name: templateData.name, |
|
|
name: templateData.name, |
|
|
gaussianBlur: templateData.gaussianBlur || 1, |
|
|
gaussianBlur: templateData.gaussianBlur || 1, |
|
|
physicalRadius: templateData.physicalRadius || 40.0, |
|
|
physicalRadius: templateData.physicalRadius || 40.0, |
|
|
gradientThresholdValue: |
|
|
gradientThresholdValue: templateData.gradientThresholdValue, |
|
|
templateData.gradientThresholdValue || 100, |
|
|
anchorThresholdValue: templateData.anchorThresholdValue, |
|
|
anchorThresholdValue: templateData.anchorThresholdValue || 80, |
|
|
|
|
|
}); |
|
|
}); |
|
|
setIsBaseline(templateData.isBaseline || false); |
|
|
setIsBaseline(templateData.isBaseline || false); |
|
|
setIsPerspectiveCorrection( |
|
|
setIsPerspectiveCorrection( |
|
@ -60,10 +59,8 @@ const TemplateModal = ({ |
|
|
setBinaryThreshold(templateData.binaryThreshold || 100); |
|
|
setBinaryThreshold(templateData.binaryThreshold || 100); |
|
|
setGaussianBlur(templateData.gaussianBlur || 1); |
|
|
setGaussianBlur(templateData.gaussianBlur || 1); |
|
|
setPhysicalRadius(templateData.physicalRadius || 40.0); |
|
|
setPhysicalRadius(templateData.physicalRadius || 40.0); |
|
|
setGradientThresholdValue( |
|
|
setGradientThresholdValue(templateData.gradientThresholdValue); |
|
|
templateData.gradientThresholdValue || 100 |
|
|
setAnchorThresholdValue(templateData.anchorThresholdValue); |
|
|
); |
|
|
|
|
|
setAnchorThresholdValue(templateData.anchorThresholdValue || 80); |
|
|
|
|
|
|
|
|
|
|
|
// 设置图片数据 |
|
|
// 设置图片数据 |
|
|
if (templateData.imageUrl) { |
|
|
if (templateData.imageUrl) { |
|
@ -161,6 +158,7 @@ const TemplateModal = ({ |
|
|
|
|
|
|
|
|
const handleOk = async () => { |
|
|
const handleOk = async () => { |
|
|
try { |
|
|
try { |
|
|
|
|
|
debugger; |
|
|
const values = await form.validateFields(); |
|
|
const values = await form.validateFields(); |
|
|
|
|
|
|
|
|
// 检查是否上传了图片 |
|
|
// 检查是否上传了图片 |
|
@ -201,7 +199,7 @@ const TemplateModal = ({ |
|
|
const handleDelete = () => { |
|
|
const handleDelete = () => { |
|
|
if (templateData) { |
|
|
if (templateData) { |
|
|
// 检查是否为第一个模板(内置模板) |
|
|
// 检查是否为第一个模板(内置模板) |
|
|
if (templateData.key === 'builtin_1') { |
|
|
if (templateData.key === "builtin_1") { |
|
|
message.warning("该模板为内置模板,不允许删除!"); |
|
|
message.warning("该模板为内置模板,不允许删除!"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -220,7 +218,7 @@ const TemplateModal = ({ |
|
|
onCancel={onCancel} |
|
|
onCancel={onCancel} |
|
|
width={500} |
|
|
width={500} |
|
|
footer={[ |
|
|
footer={[ |
|
|
mode === "edit" && templateData?.key !== 'builtin_1' && ( |
|
|
mode === "edit" && templateData?.key !== "builtin_1" && ( |
|
|
<Popconfirm |
|
|
<Popconfirm |
|
|
key="delete" |
|
|
key="delete" |
|
|
title={`确认删除标靶模板[${templateData?.name}]?`} |
|
|
title={`确认删除标靶模板[${templateData?.name}]?`} |
|
@ -262,7 +260,12 @@ const TemplateModal = ({ |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
|
|
|
|
|
|
<Form.Item |
|
|
<Form.Item |
|
|
label="标靶图片" |
|
|
label={ |
|
|
|
|
|
<> |
|
|
|
|
|
标靶图片 |
|
|
|
|
|
<span style={{ color: "red", marginLeft: 4 }}>*</span> |
|
|
|
|
|
</> |
|
|
|
|
|
} |
|
|
rules={[{ required: true, message: "请上传标靶图片" }]} |
|
|
rules={[{ required: true, message: "请上传标靶图片" }]} |
|
|
> |
|
|
> |
|
|
<Upload |
|
|
<Upload |
|
|