diff --git a/src/pages/Recharge/Address/Components/AddAddressModal.tsx b/src/pages/Recharge/Address/Components/AddAddressModal.tsx
new file mode 100644
index 0000000..dbd4a9d
--- /dev/null
+++ b/src/pages/Recharge/Address/Components/AddAddressModal.tsx
@@ -0,0 +1,97 @@
+// 创建弹窗
+import React, { useRef } from 'react';
+import { createForm, onFieldReact, FormPathPattern, Field } from '@formily/core';
+import { FormProvider, createSchemaField } from '@formily/react';
+import { getCoinTypeList } from '@/services/recharge/coinType';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, Select } from '@formily/antd';
+import { action } from '@formily/reactive';
+
+interface AddAddressModalPropsType extends ModalProps {
+ onOk: (val: any) => void;
+ onCancel: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ Select,
+ },
+});
+
+const useAsyncDataSource = (
+ pattern: FormPathPattern,
+ service: (field: Field) => Promise<{ label: string; value: any }[]>,
+) => {
+ onFieldReact(pattern, (field) => {
+ service(field).then(
+ action.bound((data) => {
+ field.dataSource = data;
+ }),
+ );
+ });
+};
+
+const form = createForm({
+ effects: () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ useAsyncDataSource('bc_name', async (field) => {
+ const list = await getCoinTypeList({ page: 1, page_size: 10 });
+ const option = [];
+ for (let index = 0; index < list.items.length; index++) {
+ const element = list.items[index];
+ const item = {
+ label: element.bc_name,
+ value: element.bc_name,
+ };
+ option.push(item);
+ }
+ return option;
+ });
+ },
+});
+
+const AddAddressModal = ({ onOk, onCancel, ...rest }: AddAddressModalPropsType) => {
+ const handleOk = () => {
+ const formState = form.getFormState();
+ onOk(formState.values);
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+
+
+
+
+ {/* */}
+
+ );
+};
+
+export default AddAddressModal;
diff --git a/src/pages/Recharge/Address/Components/EditAddressModal.tsx b/src/pages/Recharge/Address/Components/EditAddressModal.tsx
new file mode 100644
index 0000000..ca55c75
--- /dev/null
+++ b/src/pages/Recharge/Address/Components/EditAddressModal.tsx
@@ -0,0 +1,106 @@
+// 修改弹窗
+import React, { useRef, useEffect } from 'react';
+import { createForm, onFieldReact, FormPathPattern, Field } from '@formily/core';
+import { getCoinTypeList } from '@/services/recharge/coinType';
+import { FormProvider, createSchemaField } from '@formily/react';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, Select } from '@formily/antd';
+import { action } from '@formily/reactive';
+
+interface EditAddressModalPropsType extends ModalProps {
+ editModalData: any;
+ onOk: (val: any) => void;
+ onCancel: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ Select,
+ },
+});
+
+const EditAddressModal = ({
+ onOk,
+ onCancel,
+ editModalData,
+ ...rest
+}: EditAddressModalPropsType) => {
+ const useAsyncDataSource = (
+ pattern: FormPathPattern,
+ service: (field: Field) => Promise<{ label: string; value: any }[]>,
+ ) => {
+ onFieldReact(pattern, (field) => {
+ service(field).then(
+ action.bound((data) => {
+ field.dataSource = data;
+ }),
+ );
+ });
+ };
+
+ const form = createForm({
+ effects: () => {
+ // eslint-disable-next-line react-hooks/rules-of-hooks
+ useAsyncDataSource('bc_name', async (field) => {
+ const list = await getCoinTypeList({ page: 1, page_size: 10 });
+ const option = [];
+ for (let index = 0; index < list.items.length; index++) {
+ const element = list.items[index];
+ const item = {
+ label: element.bc_name,
+ value: element.bc_name,
+ };
+ option.push(item);
+ }
+ return option;
+ });
+ },
+ });
+
+ useEffect(() => {
+ form.setInitialValues(editModalData);
+ });
+
+ const handleOk = () => {
+ const formState = form.getFormState();
+ onOk(formState.values);
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default EditAddressModal;
diff --git a/src/pages/Recharge/CoinType/Components/AddCoinTypeModal.tsx b/src/pages/Recharge/CoinType/Components/AddCoinTypeModal.tsx
new file mode 100644
index 0000000..798c15a
--- /dev/null
+++ b/src/pages/Recharge/CoinType/Components/AddCoinTypeModal.tsx
@@ -0,0 +1,71 @@
+// 添加代币类型弹窗
+import React, { useRef } from 'react';
+import { createForm } from '@formily/core';
+import { createSchemaField } from '@formily/react';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, NumberPicker } from '@formily/antd';
+
+interface AddCoinTypeModalPropsType extends ModalProps {
+ onOk: (val: any) => void;
+ onCancel: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ NumberPicker,
+ },
+});
+
+const form = createForm({});
+
+const AddCoinTypeModal = ({ onOk, onCancel, ...rest }: AddCoinTypeModalPropsType) => {
+ const handleOk = () => {
+ const formState = form.getFormState();
+ onOk(formState.values);
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default AddCoinTypeModal;
diff --git a/src/pages/Recharge/CoinType/Components/EditCoinTypeModal.tsx b/src/pages/Recharge/CoinType/Components/EditCoinTypeModal.tsx
new file mode 100644
index 0000000..e61e366
--- /dev/null
+++ b/src/pages/Recharge/CoinType/Components/EditCoinTypeModal.tsx
@@ -0,0 +1,72 @@
+// 修改弹窗
+import React, { useRef, useEffect } from 'react';
+import { createForm } from '@formily/core';
+import { createSchemaField } from '@formily/react';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, Select } from '@formily/antd';
+
+interface EditCoinTypeModalPropsType extends ModalProps {
+ editModalData: any;
+ onOk: (val: any) => void;
+ onCancel: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ Select,
+ },
+});
+
+const form = createForm({});
+
+const EditCoinTypeModal = ({
+ onOk,
+ onCancel,
+ editModalData,
+ ...rest
+}: EditCoinTypeModalPropsType) => {
+ useEffect(() => {
+ form.setInitialValues(editModalData);
+ });
+
+ const handleOk = () => {
+ const formState = form.getFormState();
+ onOk(formState.values);
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default EditCoinTypeModal;
diff --git a/src/pages/System/Account/Components/AddAccountModal.tsx b/src/pages/System/Account/Components/AddAccountModal.tsx
new file mode 100644
index 0000000..9b07a1e
--- /dev/null
+++ b/src/pages/System/Account/Components/AddAccountModal.tsx
@@ -0,0 +1,84 @@
+// 创建弹窗
+import React, { useRef } from 'react';
+import { createForm } from '@formily/core';
+import { createSchemaField } from '@formily/react';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, Select } from '@formily/antd';
+import { addUser } from '@/services/system/accountManage';
+
+interface AddAccountModalPropsType extends ModalProps {
+ onCancel: () => void;
+ onOk: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ Select,
+ },
+});
+
+const form = createForm({});
+
+const AddAccountModal = ({ onOk, onCancel, ...rest }: AddAccountModalPropsType) => {
+ const handleOk = async () => {
+ form.submit(async () => {
+ onOk();
+ const formState = form.getFormState();
+ formState.values.role = parseInt(formState.values.role);
+ await addUser(formState.values);
+ });
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default AddAccountModal;
diff --git a/src/pages/System/Account/Components/EditAccountModal.tsx b/src/pages/System/Account/Components/EditAccountModal.tsx
new file mode 100644
index 0000000..44f66ba
--- /dev/null
+++ b/src/pages/System/Account/Components/EditAccountModal.tsx
@@ -0,0 +1,82 @@
+// 创建弹窗
+import React, { useRef, useEffect } from 'react';
+import { createForm } from '@formily/core';
+import { createSchemaField } from '@formily/react';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, Select } from '@formily/antd';
+import { addUser, updateUser } from '@/services/system/accountManage';
+
+interface AddUserModalPropsType extends ModalProps {
+ editModalData: any;
+ onCancel: () => void;
+ onOk: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ Select,
+ },
+});
+
+const form = createForm({});
+
+const AddUserModal = ({ onOk, onCancel, editModalData, ...rest }: AddUserModalPropsType) => {
+ useEffect(() => {
+ form.setInitialValues(editModalData);
+ });
+
+ const handleOk = async () => {
+ onOk();
+ const formState = form.getFormState();
+ formState.values.role = parseInt(formState.values.role);
+ await updateUser(formState.values);
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default AddUserModal;
diff --git a/src/pages/System/Notice/Components/AddNoticeModal.tsx b/src/pages/System/Notice/Components/AddNoticeModal.tsx
new file mode 100644
index 0000000..da5cb75
--- /dev/null
+++ b/src/pages/System/Notice/Components/AddNoticeModal.tsx
@@ -0,0 +1,69 @@
+// 添加代币类型弹窗
+import React, { useRef } from 'react';
+import { createForm } from '@formily/core';
+import { createSchemaField } from '@formily/react';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, Select } from '@formily/antd';
+
+interface AddNoticeModalPropsType extends ModalProps {
+ onOk: (val: any) => void;
+ onCancel: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ Select,
+ },
+});
+
+const form = createForm({});
+
+const AddNoticeModal = ({ onOk, onCancel, ...rest }: AddNoticeModalPropsType) => {
+ const handleOk = () => {
+ const formState = form.getFormState();
+ formState.values.code = parseInt(formState.values.code);
+ onOk(formState.values);
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default AddNoticeModal;
diff --git a/src/pages/System/Notice/Components/EditNoticeModal.tsx b/src/pages/System/Notice/Components/EditNoticeModal.tsx
new file mode 100644
index 0000000..7713f06
--- /dev/null
+++ b/src/pages/System/Notice/Components/EditNoticeModal.tsx
@@ -0,0 +1,63 @@
+// 修改弹窗
+import React, { useRef, useEffect } from 'react';
+import { createForm } from '@formily/core';
+import { createSchemaField } from '@formily/react';
+import Modal, { ModalProps } from '@/components/Modal';
+import { Form, FormItem, Input, Select } from '@formily/antd';
+
+interface EditNoticeModalPropsType extends ModalProps {
+ editModalData: any;
+ onOk: (val: any) => void;
+ onCancel: () => void;
+}
+
+const SchemaField = createSchemaField({
+ components: {
+ FormItem,
+ Input,
+ Select,
+ },
+});
+
+const form = createForm({});
+
+const EditNoticeModal = ({ onOk, onCancel, editModalData, ...rest }: EditNoticeModalPropsType) => {
+ useEffect(() => {
+ form.setInitialValues(editModalData);
+ });
+
+ const handleOk = () => {
+ const formState = form.getFormState();
+ onOk(formState.values);
+ };
+
+ const handleCancel = () => {
+ onCancel();
+ };
+
+ return (
+
+
+
+ );
+};
+
+export default EditNoticeModal;