feat: change deck edit style and add agent

This commit is contained in:
2024-09-28 02:52:56 +08:00
parent 2e55d718a8
commit fa055d15cc
14 changed files with 620 additions and 33 deletions

View File

@@ -8,6 +8,7 @@ import copy from 'copy-to-clipboard';
import { useNavigate } from 'react-router';
import { EditOutlined, SettingOutlined, LinkOutlined, SaveOutlined, DeleteOutlined, LeftOutlined } from '@ant-design/icons';
import clsx from 'clsx';
import { isObjectNull } from '@/utils/is-null';
const FormModal = () => {
const [form] = Form.useForm();
const containerStore = useContainerStore(
@@ -23,7 +24,12 @@ const FormModal = () => {
useEffect(() => {
const open = containerStore.showEdit;
if (open) {
form.setFieldsValue(containerStore.formData || {});
if (open) {
const isNull = isObjectNull(containerStore.formData);
if (isNull) {
form.setFieldsValue({});
} else form.setFieldsValue(containerStore.formData);
}
}
}, [containerStore.showEdit]);
const onFinish = async (values: any) => {