一键成片功能优化,生成剪辑url存储逻辑
This commit is contained in:
@@ -127,9 +127,9 @@ const TableList: React.FC = () => {
|
||||
|
||||
if (response.resp_code === 0) {
|
||||
return {
|
||||
data: response.data.records || [],
|
||||
data: response.data.data || [],
|
||||
success: true,
|
||||
total: response.data.total || 0,
|
||||
total: response.data.count || 0,
|
||||
};
|
||||
}
|
||||
message.error(response.resp_msg);
|
||||
|
||||
+24
-4
@@ -6,6 +6,8 @@ import {
|
||||
ProFormText,
|
||||
ProFormDigit,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Form } from 'antd';
|
||||
import { ENABLE_PROFIT_OPTIONS, PAYEE_TYPE_OPTIONS } from '../index';
|
||||
|
||||
interface CreateFormProps {
|
||||
visible: boolean;
|
||||
@@ -26,6 +28,10 @@ const CreateForm: React.FC<CreateFormProps> = ({
|
||||
waylineOptions,
|
||||
deviceOptions,
|
||||
}) => {
|
||||
// 使用 Form.useWatch 监听 enableProfit 的值
|
||||
const [form] = Form.useForm();
|
||||
const enableProfit = Form.useWatch('enableProfit', form);
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
title="新增二维码"
|
||||
@@ -33,6 +39,10 @@ const CreateForm: React.FC<CreateFormProps> = ({
|
||||
onVisibleChange={onVisibleChange}
|
||||
modalProps={{ destroyOnClose: true }}
|
||||
onFinish={onSubmit}
|
||||
form={form}
|
||||
initialValues={{
|
||||
enableProfit: 0, // 默认不开启分润
|
||||
}}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
@@ -114,22 +124,31 @@ const CreateForm: React.FC<CreateFormProps> = ({
|
||||
/>
|
||||
</ProForm.Group>
|
||||
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="enableProfit"
|
||||
label="是否开启分润"
|
||||
options={ENABLE_PROFIT_OPTIONS}
|
||||
rules={[{ required: true, message: '请选择是否开启分润' }]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="payeeType"
|
||||
label="分账账号类型"
|
||||
options={[
|
||||
{ label: '商户ID', value: 'MERCHANT_ID' },
|
||||
{ label: '个人openid', value: 'PERSONAL_OPENID' },
|
||||
]}
|
||||
options={PAYEE_TYPE_OPTIONS}
|
||||
placeholder="请选择分账账号类型"
|
||||
disabled={enableProfit === 0}
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="payeeAccount"
|
||||
label="分账账号"
|
||||
placeholder="请输入分账账号"
|
||||
disabled={enableProfit === 0}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
|
||||
@@ -141,6 +160,7 @@ const CreateForm: React.FC<CreateFormProps> = ({
|
||||
min={0}
|
||||
max={100}
|
||||
placeholder="请输入分账比例"
|
||||
disabled={enableProfit === 0}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
|
||||
+23
-6
@@ -6,7 +6,7 @@ import {
|
||||
ProFormText,
|
||||
ProFormDigit,
|
||||
} from '@ant-design/pro-components';
|
||||
import { STATUS_OPTIONS, PAYEE_TYPE_OPTIONS } from '../index';
|
||||
import { STATUS_OPTIONS, PAYEE_TYPE_OPTIONS, ENABLE_PROFIT_OPTIONS } from '../index';
|
||||
import { Form, Space } from 'antd';
|
||||
import styles from './index.less';
|
||||
|
||||
@@ -31,6 +31,9 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
||||
waylineOptions,
|
||||
deviceOptions,
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const enableProfit = Form.useWatch('enableProfit', form);
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
title="修改二维码"
|
||||
@@ -38,7 +41,11 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
||||
onVisibleChange={onVisibleChange}
|
||||
modalProps={{ destroyOnClose: true }}
|
||||
onFinish={onSubmit}
|
||||
initialValues={values}
|
||||
form={form}
|
||||
initialValues={{
|
||||
...values,
|
||||
enableProfit: values?.enableProfit ?? 0,
|
||||
}}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
@@ -119,22 +126,31 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
||||
/>
|
||||
</ProForm.Group>
|
||||
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="enableProfit"
|
||||
label="是否开启分润"
|
||||
options={ENABLE_PROFIT_OPTIONS}
|
||||
rules={[{ required: true, message: '请选择是否开启分润' }]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="payeeType"
|
||||
label="分账账号类型"
|
||||
options={[
|
||||
{ label: '商户ID', value: 'MERCHANT_ID' },
|
||||
{ label: '个人openid', value: 'PERSONAL_OPENID' },
|
||||
]}
|
||||
options={PAYEE_TYPE_OPTIONS}
|
||||
placeholder="请选择分账账号类型"
|
||||
disabled={enableProfit === 0}
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="payeeAccount"
|
||||
label="分账账号"
|
||||
placeholder="请输入分账账号"
|
||||
disabled={enableProfit === 0}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
|
||||
@@ -146,6 +162,7 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
||||
min={0}
|
||||
max={100}
|
||||
placeholder="请输入分账比例"
|
||||
disabled={enableProfit === 0}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
|
||||
@@ -43,6 +43,12 @@ export const PAYEE_STATUS_OPTIONS = [
|
||||
{ label: '验证失败', value: 2 },
|
||||
] as const;
|
||||
|
||||
// 添加分润状态常量
|
||||
export const ENABLE_PROFIT_OPTIONS = [
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 1 },
|
||||
] as const;
|
||||
|
||||
const handleApiRequest = async (
|
||||
apiCall: () => Promise<any>,
|
||||
loadingMessage: string,
|
||||
@@ -301,25 +307,36 @@ const TableList: React.FC = () => {
|
||||
render: (status) => renderStatus(status as number),
|
||||
},
|
||||
{
|
||||
title: '分账账号',
|
||||
dataIndex: 'payeeAccount',
|
||||
width: 140,
|
||||
ellipsis: true,
|
||||
title: '是否开启分润',
|
||||
dataIndex: 'enableProfit',
|
||||
width: 120,
|
||||
render: (_, record) => {
|
||||
const status = record.enableProfit === 1 ? '是' : '否';
|
||||
const color = record.enableProfit === 1 ? 'green' : 'default';
|
||||
return <Tag color={color}>{status}</Tag>;
|
||||
},
|
||||
valueEnum: {
|
||||
0: { text: '否' },
|
||||
1: { text: '是' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '账号类型',
|
||||
dataIndex: 'payeeType',
|
||||
width: 100,
|
||||
valueEnum: {
|
||||
'MERCHANT_ID': { text: '商户ID' },
|
||||
'PERSONAL_OPENID': { text: '个人openid' },
|
||||
title: '分账账号',
|
||||
dataIndex: 'payeeAccount',
|
||||
width: 180,
|
||||
render: (_, record) => {
|
||||
if (record.enableProfit !== 1) return '-';
|
||||
return record.payeeAccount || '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '分账比例',
|
||||
dataIndex: 'profitRate',
|
||||
width: 100,
|
||||
render: (val) => val ? `${val}%` : '-',
|
||||
render: (_, record) => {
|
||||
if (record.enableProfit !== 1) return '-';
|
||||
return record.profitRate ? `${record.profitRate}%` : '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '验证状态',
|
||||
@@ -358,6 +375,15 @@ const TableList: React.FC = () => {
|
||||
width: 160,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '账号类型',
|
||||
dataIndex: 'payeeType',
|
||||
width: 100,
|
||||
valueEnum: {
|
||||
'MERCHANT_ID': { text: '商户ID' },
|
||||
'PERSONAL_OPENID': { text: '个人openid' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
|
||||
Reference in New Issue
Block a user