import intl from 'react-intl-universal'; import React, { useEffect, useState } from 'react'; import { Modal, message, Input, Form } from 'antd'; import { request } from '@/utils/http'; import config from '@/utils/config'; const SettingModal = ({ file, handleCancel, }: { file?: any; handleCancel: (cks?: any[]) => void; }) => { const [form] = Form.useForm(); const [loading, setLoading] = useState(false); const handleOk = async (values: any) => { setLoading(true); const payload = { ...file, ...values }; request .post(`${config.apiPrefix}scripts`, payload) .then(({ code, data }) => { if (code === 200) { message.success(intl.get('保存文件成功')); handleCancel(data); } setLoading(false); }); }; return ( handleCancel()} >
); }; export default SettingModal;