feat: add
This commit is contained in:
@ -1,5 +1,13 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { ActionType, ProColumns, ProFormInstance, ProFormSelect, ProFormText } from '@ant-design/pro-components';
|
import {
|
||||||
|
ActionType,
|
||||||
|
ProColumns,
|
||||||
|
ProFormInstance,
|
||||||
|
ProFormSelect,
|
||||||
|
ProFormText,
|
||||||
|
ProFormDigit,
|
||||||
|
ProFormMoney,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
import { ModalForm, PageContainer, ProTable } from '@ant-design/pro-components';
|
import { ModalForm, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||||
import '@umijs/max';
|
import '@umijs/max';
|
||||||
import { Button, message } from 'antd';
|
import { Button, message } from 'antd';
|
||||||
@ -95,6 +103,25 @@ const TableList: React.FC = () => {
|
|||||||
},
|
},
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '进群链接',
|
||||||
|
dataIndex: 'groupLink',
|
||||||
|
valueType: 'textarea',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '可群发数量',
|
||||||
|
dataIndex: 'sendCount',
|
||||||
|
valueType: 'textarea',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '群代发价格',
|
||||||
|
dataIndex: 'price',
|
||||||
|
valueType: 'textarea',
|
||||||
|
search: false,
|
||||||
|
renderText: cents => (cents ? (cents / 100).toFixed(0) : '-'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
valueType: 'option',
|
valueType: 'option',
|
||||||
@ -162,6 +189,8 @@ const TableList: React.FC = () => {
|
|||||||
cityCode: formData.city.value,
|
cityCode: formData.city.value,
|
||||||
cityName: formData.city.label,
|
cityName: formData.city.label,
|
||||||
groupLink: formData.groupLink,
|
groupLink: formData.groupLink,
|
||||||
|
sendCount: formData.sendCount,
|
||||||
|
price: formData.price,
|
||||||
};
|
};
|
||||||
console.log('update confirm', formData, params);
|
console.log('update confirm', formData, params);
|
||||||
try {
|
try {
|
||||||
@ -188,6 +217,29 @@ const TableList: React.FC = () => {
|
|||||||
rules={[{ required: true, message: '必填项' }]}
|
rules={[{ required: true, message: '必填项' }]}
|
||||||
/>
|
/>
|
||||||
<ProFormText name="groupLink" label="进群链接" rules={[{ message: '请输入链接', type: 'url' }]} />
|
<ProFormText name="groupLink" label="进群链接" rules={[{ message: '请输入链接', type: 'url' }]} />
|
||||||
|
<ProFormDigit name="sendCount" label="可群发数量" min={1} fieldProps={{ precision: 0 }} />
|
||||||
|
<ProFormMoney
|
||||||
|
name="price"
|
||||||
|
label="价格"
|
||||||
|
min={0}
|
||||||
|
fieldProps={{
|
||||||
|
precision: 0,
|
||||||
|
formatter: value => {
|
||||||
|
if (!value) return '0';
|
||||||
|
return `${Math.floor(value / 100)}`;
|
||||||
|
},
|
||||||
|
parser: value => {
|
||||||
|
if (!value) return 0;
|
||||||
|
const numValue = parseInt(value.toString().replace(/[^\d]/g, ''));
|
||||||
|
return numValue * 100;
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
transform={(value, namePath) => {
|
||||||
|
return {
|
||||||
|
[namePath]: value ? Math.round(Number(value)) : 0,
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
4
src/services/typings.d.ts
vendored
4
src/services/typings.d.ts
vendored
@ -355,6 +355,8 @@ declare namespace API {
|
|||||||
staffId: number;
|
staffId: number;
|
||||||
cityCode: string;
|
cityCode: string;
|
||||||
groupLink: string;
|
groupLink: string;
|
||||||
|
sendCount: number;
|
||||||
|
price: number;
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,6 +367,8 @@ declare namespace API {
|
|||||||
cityName?: string;
|
cityName?: string;
|
||||||
cityCode: string;
|
cityCode: string;
|
||||||
groupLink: string;
|
groupLink: string;
|
||||||
|
sendCount?: number;
|
||||||
|
price?: number;
|
||||||
created?: string;
|
created?: string;
|
||||||
updated?: string;
|
updated?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user