mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 01:14:50 +08:00
修复弹出数据不重置
This commit is contained in:
@@ -36,12 +36,8 @@ const CronModal = ({
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (cron) {
|
||||
form.setFieldsValue(cron);
|
||||
} else {
|
||||
form.resetFields();
|
||||
}
|
||||
}, [cron]);
|
||||
form.resetFields();
|
||||
}, [cron, visible]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
@@ -60,9 +56,13 @@ const CronModal = ({
|
||||
}}
|
||||
onCancel={() => handleCancel()}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form form={form} layout="vertical" name="form_in_modal" preserve={false}>
|
||||
<Form
|
||||
form={form}
|
||||
layout="vertical"
|
||||
name="form_in_modal"
|
||||
initialValues={cron}
|
||||
>
|
||||
<Form.Item name="name" label="名称">
|
||||
<Input placeholder="请输入任务名称" />
|
||||
</Form.Item>
|
||||
|
||||
Vendored
+2
-8
@@ -34,7 +34,7 @@ const EditNameModal = ({
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
}, [ids]);
|
||||
}, [ids, visible]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
@@ -53,14 +53,8 @@ const EditNameModal = ({
|
||||
}}
|
||||
onCancel={() => handleCancel()}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
layout="vertical"
|
||||
name="edit_name_modal"
|
||||
preserve={false}
|
||||
>
|
||||
<Form form={form} layout="vertical" name="edit_name_modal">
|
||||
<Form.Item
|
||||
name="name"
|
||||
rules={[{ required: true, message: '请输入新的环境变量名称' }]}
|
||||
|
||||
Vendored
+3
-3
@@ -274,7 +274,7 @@ const Env = () => {
|
||||
title: '确认删除',
|
||||
content: (
|
||||
<>
|
||||
确认删除Env{' '}
|
||||
确认删除变量{' '}
|
||||
<Text style={{ wordBreak: 'break-all' }} type="warning">
|
||||
{record.value}
|
||||
</Text>{' '}
|
||||
@@ -365,7 +365,7 @@ const Env = () => {
|
||||
const delEnvs = () => {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: <>确认删除选中的Env吗</>,
|
||||
content: <>确认删除选中的变量吗</>,
|
||||
onOk() {
|
||||
request
|
||||
.delete(`${config.apiPrefix}envs`, { data: selectedRowIds })
|
||||
@@ -388,7 +388,7 @@ const Env = () => {
|
||||
const operateEnvs = (operationStatus: number) => {
|
||||
Modal.confirm({
|
||||
title: `确认${OperationName[operationStatus]}`,
|
||||
content: <>确认{OperationName[operationStatus]}选中的Env吗</>,
|
||||
content: <>确认{OperationName[operationStatus]}选中的变量吗</>,
|
||||
onOk() {
|
||||
request
|
||||
.put(`${config.apiPrefix}envs/${OperationPath[operationStatus]}`, {
|
||||
|
||||
Vendored
+2
-9
@@ -33,7 +33,7 @@ const EnvModal = ({
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
}, [env]);
|
||||
}, [env, visible]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
@@ -52,15 +52,8 @@ const EnvModal = ({
|
||||
}}
|
||||
onCancel={() => handleCancel()}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
layout="vertical"
|
||||
name="env_modal"
|
||||
preserve={false}
|
||||
initialValues={env}
|
||||
>
|
||||
<Form form={form} layout="vertical" name="env_modal" initialValues={env}>
|
||||
<Form.Item
|
||||
name="name"
|
||||
label="名称"
|
||||
|
||||
Reference in New Issue
Block a user