代码规范调整
This commit is contained in:
parent
e71e8b6012
commit
e4c423acba
|
|
@ -22,8 +22,10 @@ const form = createForm({});
|
||||||
|
|
||||||
const AddNftContractModal = ({ onOk, onCancel, ...rest }: AddNftContractModalPropsType) => {
|
const AddNftContractModal = ({ onOk, onCancel, ...rest }: AddNftContractModalPropsType) => {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
|
form.submit(async () => {
|
||||||
const formState = form.getFormState();
|
const formState = form.getFormState();
|
||||||
onOk(formState.values);
|
onOk(formState.values);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
onCancel();
|
onCancel();
|
||||||
|
|
@ -35,24 +37,31 @@ const AddNftContractModal = ({ onOk, onCancel, ...rest }: AddNftContractModalPro
|
||||||
<SchemaField>
|
<SchemaField>
|
||||||
<SchemaField.String
|
<SchemaField.String
|
||||||
name="contract_name"
|
name="contract_name"
|
||||||
title="名称"
|
title="合约名称"
|
||||||
required
|
required
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="Input"
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
<SchemaField.Number
|
<SchemaField.String
|
||||||
name="contract_address"
|
name="address"
|
||||||
title="合约"
|
title="合约地址"
|
||||||
required
|
required
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="NumberPicker"
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
<SchemaField.Number
|
<SchemaField.String
|
||||||
name="description"
|
name="description"
|
||||||
title=""
|
title="描述"
|
||||||
required
|
required
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="NumberPicker"
|
x-component="Input"
|
||||||
|
/>
|
||||||
|
<SchemaField.String
|
||||||
|
name="contract_symbol"
|
||||||
|
title="合约符号"
|
||||||
|
required
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
</SchemaField>
|
</SchemaField>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
// import { fetchTableData } from '@/utils/table';
|
import { fetchTableData } from '@/utils/table';
|
||||||
import AddNftContractModal from './components/AddNftContract';
|
import AddNftContractModal from './components/AddNftContract';
|
||||||
|
import { getContractData, createContract } from '@/services/nft/contract';
|
||||||
|
|
||||||
const Address: React.FC = () => {
|
const Address: React.FC = () => {
|
||||||
const tableRef = useRef<ActionType>();
|
const tableRef = useRef<ActionType>();
|
||||||
|
|
@ -35,6 +36,7 @@ const Address: React.FC = () => {
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
|
search={false}
|
||||||
actionRef={tableRef}
|
actionRef={tableRef}
|
||||||
toolBarActions={[
|
toolBarActions={[
|
||||||
{
|
{
|
||||||
|
|
@ -45,19 +47,19 @@ const Address: React.FC = () => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
// request={async (params) => {
|
request={async (params) => {
|
||||||
// // return fetchTableData(, params);
|
return fetchTableData(getContractData, params);
|
||||||
// }}
|
}}
|
||||||
/>
|
/>
|
||||||
<AddNftContractModal
|
<AddNftContractModal
|
||||||
visible={visible}
|
visible={visible}
|
||||||
onCancel={function () {
|
onCancel={function () {
|
||||||
setNftModal(false);
|
setVisible(false);
|
||||||
}}
|
}}
|
||||||
onOk={async function (val: any): Promise<void> {
|
onOk={async function (val: any): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const params = { ...val };
|
const params = { ...val };
|
||||||
// await creatNftAddress(params);
|
await createContract(params);
|
||||||
message.success('添加成功');
|
message.success('添加成功');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,19 @@
|
||||||
import React, { useRef } from 'react';
|
import React, { useRef, useEffect } from 'react';
|
||||||
import { createForm } from '@formily/core';
|
import { createForm } from '@formily/core';
|
||||||
import { createSchemaField } from '@formily/react';
|
import { createSchemaField } from '@formily/react';
|
||||||
import Modal, { ModalProps } from '@/components/Modal';
|
import Modal, { ModalProps } from '@/components/Modal';
|
||||||
import Upload from '@/components/Upload';
|
import Upload from '@/components/Upload';
|
||||||
|
import { Button, message } from 'antd';
|
||||||
// import { fetchTableData } from '@/utils/table';
|
// import { fetchTableData } from '@/utils/table';
|
||||||
import { UploadBizType } from '@/constants/enum/uploadBizType';
|
import {
|
||||||
import { Form, FormItem, Input, NumberPicker } from '@formily/antd';
|
Form,
|
||||||
|
FormItem,
|
||||||
|
Input,
|
||||||
|
NumberPicker,
|
||||||
|
ArrayItems,
|
||||||
|
FormButtonGroup,
|
||||||
|
ArrayTable,
|
||||||
|
} from '@formily/antd';
|
||||||
|
|
||||||
interface AddNftModalPropsType extends ModalProps {
|
interface AddNftModalPropsType extends ModalProps {
|
||||||
onOk: (val: any) => void;
|
onOk: (val: any) => void;
|
||||||
|
|
@ -18,6 +26,9 @@ const SchemaField = createSchemaField({
|
||||||
Input,
|
Input,
|
||||||
NumberPicker,
|
NumberPicker,
|
||||||
Upload,
|
Upload,
|
||||||
|
ArrayItems,
|
||||||
|
FormButtonGroup,
|
||||||
|
ArrayTable,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -25,8 +36,20 @@ const form = createForm({});
|
||||||
|
|
||||||
const AddNftModal = ({ onOk, onCancel, ...rest }: AddNftModalPropsType) => {
|
const AddNftModal = ({ onOk, onCancel, ...rest }: AddNftModalPropsType) => {
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
|
form.submit(async () => {
|
||||||
const formState = form.getFormState();
|
const formState = form.getFormState();
|
||||||
onOk(formState.values);
|
onOk(formState.values);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const handleAddResoruce = () => {
|
||||||
|
const resourceList = form.getFieldState('contacts').value;
|
||||||
|
if (resourceList.length >= 1) {
|
||||||
|
message.warning('只能添加1个属性');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
form.setFieldState('contacts', (state) => {
|
||||||
|
state.value = [...resourceList, {}];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
onCancel();
|
onCancel();
|
||||||
|
|
@ -37,16 +60,17 @@ const AddNftModal = ({ onOk, onCancel, ...rest }: AddNftModalPropsType) => {
|
||||||
<Form form={form} labelCol={4} wrapperCol={18}>
|
<Form form={form} labelCol={4} wrapperCol={18}>
|
||||||
<SchemaField>
|
<SchemaField>
|
||||||
<SchemaField.String
|
<SchemaField.String
|
||||||
name="nft_name"
|
name="name"
|
||||||
title="名称"
|
title="名称"
|
||||||
required
|
x-validator={{ required: true }}
|
||||||
x-decorator="FormItem"
|
|
||||||
x-component="Input"
|
x-component="Input"
|
||||||
|
x-decorator="FormItem"
|
||||||
/>
|
/>
|
||||||
<SchemaField.Number
|
<SchemaField.Number
|
||||||
name="contract"
|
name="contract"
|
||||||
title="合约"
|
title="合约"
|
||||||
required
|
required
|
||||||
|
x-validator={{ required: true }}
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="Input"
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
|
|
@ -54,17 +78,89 @@ const AddNftModal = ({ onOk, onCancel, ...rest }: AddNftModalPropsType) => {
|
||||||
name="description"
|
name="description"
|
||||||
title="描述"
|
title="描述"
|
||||||
required
|
required
|
||||||
|
x-validator={{ required: true }}
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="Input"
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
<SchemaField.String
|
<SchemaField.String
|
||||||
name="img"
|
name="image"
|
||||||
title="图片"
|
title="图片"
|
||||||
required
|
required
|
||||||
|
x-validator={{ required: true }}
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="Upload"
|
x-component="Upload"
|
||||||
/>
|
/>
|
||||||
|
<SchemaField.String
|
||||||
|
name="avatar"
|
||||||
|
title="avatar"
|
||||||
|
required
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="Input"
|
||||||
|
/>
|
||||||
|
<SchemaField.Array
|
||||||
|
name="contacts"
|
||||||
|
title="属性"
|
||||||
|
required
|
||||||
|
// x-validator={[{ required: true }]}
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="ArrayItems"
|
||||||
|
>
|
||||||
|
<SchemaField.Object x-component="ArrayItems.Item">
|
||||||
|
<SchemaField.Void x-decorator="FormItem" />
|
||||||
|
<SchemaField.Void
|
||||||
|
name="popover"
|
||||||
|
title=""
|
||||||
|
required
|
||||||
|
x-decorator="Editable.Popover"
|
||||||
|
x-component="FormLayout"
|
||||||
|
x-component-props={{
|
||||||
|
layout: 'vertical',
|
||||||
|
}}
|
||||||
|
x-reactions={[
|
||||||
|
{
|
||||||
|
fulfill: {
|
||||||
|
schema: {
|
||||||
|
title: '{{$self.query(".name").value() }}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<SchemaField.String
|
||||||
|
name="trait_type"
|
||||||
|
required
|
||||||
|
title="类型"
|
||||||
|
x-validator={{ required: true }}
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="Input"
|
||||||
|
x-component-props={{
|
||||||
|
style: {
|
||||||
|
width: 300,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<SchemaField.String
|
||||||
|
name="value"
|
||||||
|
title="值"
|
||||||
|
required
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="Input"
|
||||||
|
x-component-props={{
|
||||||
|
style: {
|
||||||
|
width: 300,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SchemaField.Void>
|
||||||
|
<SchemaField.Void x-decorator="FormItem" x-component="ArrayItems.Remove" />
|
||||||
|
</SchemaField.Object>
|
||||||
|
</SchemaField.Array>
|
||||||
</SchemaField>
|
</SchemaField>
|
||||||
|
<FormButtonGroup.FormItem style={{ marginBottom: 20 }}>
|
||||||
|
<Button type="dashed" onClick={handleAddResoruce} block>
|
||||||
|
添加属性
|
||||||
|
</Button>
|
||||||
|
</FormButtonGroup.FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { createForm } from '@formily/core';
|
||||||
import { createSchemaField } from '@formily/react';
|
import { createSchemaField } from '@formily/react';
|
||||||
import Modal, { ModalProps } from '@/components/Modal';
|
import Modal, { ModalProps } from '@/components/Modal';
|
||||||
import Upload from '@/components/Upload';
|
import Upload from '@/components/Upload';
|
||||||
// import { fetchTableData } from '@/utils/table';
|
import { Button, message } from 'antd';
|
||||||
import { Form, FormItem, Input, NumberPicker } from '@formily/antd';
|
import { Form, FormItem, Input, NumberPicker, ArrayItems, FormButtonGroup } from '@formily/antd';
|
||||||
|
|
||||||
interface EditNftModalPropsType extends ModalProps {
|
interface EditNftModalPropsType extends ModalProps {
|
||||||
onOk: (val: any) => void;
|
onOk: (val: any) => void;
|
||||||
|
|
@ -18,6 +18,8 @@ const SchemaField = createSchemaField({
|
||||||
Input,
|
Input,
|
||||||
NumberPicker,
|
NumberPicker,
|
||||||
Upload,
|
Upload,
|
||||||
|
ArrayItems,
|
||||||
|
FormButtonGroup,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -28,8 +30,20 @@ const EditNftModal = ({ onOk, onCancel, modalData, ...rest }: EditNftModalPropsT
|
||||||
form.setInitialValues(modalData);
|
form.setInitialValues(modalData);
|
||||||
});
|
});
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
|
form.submit(async () => {
|
||||||
const formState = form.getFormState();
|
const formState = form.getFormState();
|
||||||
onOk(formState.values);
|
onOk(formState.values);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const handleAddResoruce = () => {
|
||||||
|
const resourceList = form.getFieldState('contacts').value;
|
||||||
|
if (resourceList.length >= 1) {
|
||||||
|
message.warning('只能添加1个属性');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
form.setFieldState('contacts', (state) => {
|
||||||
|
state.value = [...resourceList, {}];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
onCancel();
|
onCancel();
|
||||||
|
|
@ -39,26 +53,21 @@ const EditNftModal = ({ onOk, onCancel, modalData, ...rest }: EditNftModalPropsT
|
||||||
<Modal title="添加NFT" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
<Modal title="添加NFT" onOk={handleOk} onCancel={handleCancel} width={800} {...rest}>
|
||||||
<Form form={form} labelCol={4} wrapperCol={18}>
|
<Form form={form} labelCol={4} wrapperCol={18}>
|
||||||
<SchemaField>
|
<SchemaField>
|
||||||
<SchemaField.String
|
<SchemaField.String name="name" title="名称" x-decorator="FormItem" x-component="Input" />
|
||||||
name="nft_name"
|
|
||||||
title="名称"
|
|
||||||
x-decorator="FormItem"
|
|
||||||
x-component="Input"
|
|
||||||
/>
|
|
||||||
<SchemaField.String
|
<SchemaField.String
|
||||||
name="token_id"
|
name="token_id"
|
||||||
title="tokenID"
|
title="tokenID"
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="Input"
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
<SchemaField.Number
|
<SchemaField.String
|
||||||
name="contract"
|
name="contract"
|
||||||
title="合约"
|
title="合约"
|
||||||
required
|
required
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="Input"
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
<SchemaField.Number
|
<SchemaField.String
|
||||||
name="description"
|
name="description"
|
||||||
title="描述"
|
title="描述"
|
||||||
required
|
required
|
||||||
|
|
@ -66,13 +75,83 @@ const EditNftModal = ({ onOk, onCancel, modalData, ...rest }: EditNftModalPropsT
|
||||||
x-component="Input"
|
x-component="Input"
|
||||||
/>
|
/>
|
||||||
<SchemaField.String
|
<SchemaField.String
|
||||||
name="img"
|
name="image"
|
||||||
title="图片"
|
title="图片"
|
||||||
required
|
required
|
||||||
x-decorator="FormItem"
|
x-decorator="FormItem"
|
||||||
x-component="Upload"
|
x-component="Upload"
|
||||||
/>
|
/>
|
||||||
|
<SchemaField.String
|
||||||
|
name="avatar"
|
||||||
|
title="avatar"
|
||||||
|
required
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="Input"
|
||||||
|
/>
|
||||||
|
<SchemaField.Array
|
||||||
|
name="contacts"
|
||||||
|
title="属性"
|
||||||
|
required
|
||||||
|
// x-validator={[{ required: true }]}
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="ArrayItems"
|
||||||
|
>
|
||||||
|
<SchemaField.Object x-component="ArrayItems.Item">
|
||||||
|
<SchemaField.Void x-decorator="FormItem" />
|
||||||
|
<SchemaField.Void
|
||||||
|
name="popover"
|
||||||
|
title=""
|
||||||
|
required
|
||||||
|
x-decorator="Editable.Popover"
|
||||||
|
x-component="FormLayout"
|
||||||
|
x-component-props={{
|
||||||
|
layout: 'vertical',
|
||||||
|
}}
|
||||||
|
x-reactions={[
|
||||||
|
{
|
||||||
|
fulfill: {
|
||||||
|
schema: {
|
||||||
|
title: '{{$self.query(".name").value() }}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<SchemaField.String
|
||||||
|
name="trait_type"
|
||||||
|
required
|
||||||
|
title="类型"
|
||||||
|
x-validator={{ required: true }}
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="Input"
|
||||||
|
x-component-props={{
|
||||||
|
style: {
|
||||||
|
width: 300,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<SchemaField.String
|
||||||
|
name="value"
|
||||||
|
title="值"
|
||||||
|
required
|
||||||
|
x-decorator="FormItem"
|
||||||
|
x-component="Input"
|
||||||
|
x-component-props={{
|
||||||
|
style: {
|
||||||
|
width: 300,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SchemaField.Void>
|
||||||
|
<SchemaField.Void x-decorator="FormItem" x-component="ArrayItems.Remove" />
|
||||||
|
</SchemaField.Object>
|
||||||
|
</SchemaField.Array>
|
||||||
</SchemaField>
|
</SchemaField>
|
||||||
|
<FormButtonGroup.FormItem style={{ marginBottom: 20 }}>
|
||||||
|
<Button type="dashed" onClick={handleAddResoruce} block>
|
||||||
|
添加属性
|
||||||
|
</Button>
|
||||||
|
</FormButtonGroup.FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,11 @@ import { message, Button, Upload, Space, Row } from 'antd';
|
||||||
import Table, { ProColumns, ActionType } from '@/components/Table';
|
import Table, { ProColumns, ActionType } from '@/components/Table';
|
||||||
import { RcFile } from 'antd/lib/upload';
|
import { RcFile } from 'antd/lib/upload';
|
||||||
import XLSX from 'xlsx';
|
import XLSX from 'xlsx';
|
||||||
// import { fetchTableData } from '@/utils/table';
|
import { fetchTableData } from '@/utils/table';
|
||||||
import EditNftModal from './components/EditNftModel';
|
import EditNftModal from './components/EditNftModel';
|
||||||
import AddNftModal from './components/AddNftModel';
|
import AddNftModal from './components/AddNftModel';
|
||||||
import PaySelectModal from '@/widget/PaySelectModal';
|
import PaySelectModal from '@/widget/PaySelectModal';
|
||||||
|
import { getNftData, createNft, editNft, getTokenId } from '@/services/nft/nft';
|
||||||
|
|
||||||
const Address: React.FC = () => {
|
const Address: React.FC = () => {
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
|
@ -78,6 +79,18 @@ const Address: React.FC = () => {
|
||||||
width: 150,
|
width: 150,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'image',
|
||||||
|
dataIndex: 'image',
|
||||||
|
width: 150,
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'avatar',
|
||||||
|
dataIndex: 'avatar',
|
||||||
|
width: 150,
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
valueType: 'option',
|
valueType: 'option',
|
||||||
|
|
@ -117,9 +130,9 @@ const Address: React.FC = () => {
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
search={false}
|
search={false}
|
||||||
actionRef={tableRef}
|
actionRef={tableRef}
|
||||||
// request={async (params) => {
|
request={async (params) => {
|
||||||
// // return fetchTableData(, params);
|
return fetchTableData(getNftData, params);
|
||||||
// }}
|
}}
|
||||||
/>
|
/>
|
||||||
<AddNftModal
|
<AddNftModal
|
||||||
visible={visible}
|
visible={visible}
|
||||||
|
|
@ -130,8 +143,9 @@ const Address: React.FC = () => {
|
||||||
try {
|
try {
|
||||||
const params = { ...val };
|
const params = { ...val };
|
||||||
console.log(val);
|
console.log(val);
|
||||||
// await creatNftAddress(params);
|
await createNft(params);
|
||||||
message.success('添加成功');
|
message.success('添加成功');
|
||||||
|
setVisible(false);
|
||||||
tableRef.current?.reload();
|
tableRef.current?.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
@ -149,8 +163,7 @@ const Address: React.FC = () => {
|
||||||
onOk={async function (val: any): Promise<void> {
|
onOk={async function (val: any): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const params = { ...val };
|
const params = { ...val };
|
||||||
// await creatNftAddress(params);
|
await editNft(params);
|
||||||
console.log(params);
|
|
||||||
message.success('添加成功');
|
message.success('添加成功');
|
||||||
tableRef.current?.reload();
|
tableRef.current?.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -166,16 +179,17 @@ const Address: React.FC = () => {
|
||||||
setPayVisible(false);
|
setPayVisible(false);
|
||||||
}}
|
}}
|
||||||
onOk={async function (val: any): Promise<void> {
|
onOk={async function (val: any): Promise<void> {
|
||||||
try {
|
// setPayVisible(false);
|
||||||
const params = { ...val };
|
// try {
|
||||||
// await creatNftAddress(params);
|
// const params = { ...val };
|
||||||
console.log(params);
|
// // await creatNftAddress(params);
|
||||||
message.success('添加成功');
|
// console.log(params);
|
||||||
} catch (e) {
|
// message.success('添加成功');
|
||||||
console.log(e);
|
// } catch (e) {
|
||||||
message.success('发生错误');
|
// console.log(e);
|
||||||
setPayVisible(false);
|
// message.success('发生错误');
|
||||||
}
|
// setPayVisible(false);
|
||||||
|
// }
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
import request from '@/utils/request';
|
||||||
|
//获取获取所有合约
|
||||||
|
export const getContractData = (params) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tbg/api/v1/contract/get',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 创建合约
|
||||||
|
export const createContract = (data) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tbg/api/v1/erc721/create',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
import request from '@/utils/request';
|
||||||
|
//获取获取所有NFT
|
||||||
|
export const getNftData = (params) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tbg/api/v1/nft/get',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 创建NFT
|
||||||
|
export const createNft = (data) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tbg/api/v1/nft/create',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//编辑NFT
|
||||||
|
export const editNft = (data) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tbg/api/v1/nft/update',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 检查TokenId
|
||||||
|
export const getTokenId = (params) => {
|
||||||
|
return request.request({
|
||||||
|
url: '/tbg/api/v1/nft/check',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue