import React, { useEffect, useState, useRef } from 'react'; import { Modal, Form, Input,message,DatePicker } from 'antd'; import ButtonComp from '@/components/ButtonComp'; import { addPasswordDeviceInfo } from '@/services/device'; interface PageProps { title?: string; visibility: boolean; onCancel: () => void; onOk: () => void; } const AddModal = ({ title = "提示", visibility = false, onCancel, onOk, ...props }: PageProps) => { const [form] = Form.useForm(); const passwordDeviceInfo= { "belongCryptoSystem": "string", "communicationAddressType": "string", "createTime": "string", "deviceAliases": "string", "equipmentDeploymentLocation": "string", "equipmentManagementUnit": "string", "equipmentManufacturer": "string", "equipmentType": "string", "equipmentUserUnit": "string", "id": 0, "isolatorExternalNetworkIp": "string", "memo": "string", "passwordDeviceNumber": "string", "passwordDeviceSerialNumber": "string", "passwordEntityIdentifier": "string", "registrationDate": "string", "superiorEquipmentNumber": "string", "sysType": "string", "updateTime": "string" }; const onFinish = (values: any) => { values.registrationDate=values['registrationDate'].format('YYYY-MM-DD'), addPasswordDeviceInfo({...values,passwordDeviceInfo}).then((res) => { if (res?.result == "success") { message.success('新增成功'); form.resetFields(); } else { message.error(res?.errorMsg); } }) }; return ( <>
{/* { }} /> */}
(如0000001)
{ form.submit(); // onOk(); }} />
); }; export default AddModal;