fix(智能媒体):一键成片功能完善

This commit is contained in:
2025-04-17 14:10:44 +08:00
parent 4cb2d4df76
commit 834da9f8b4
10 changed files with 431 additions and 127 deletions
@@ -7,7 +7,7 @@ import {
ProFormDigit,
} from '@ant-design/pro-components';
import { Form } from 'antd';
import { ENABLE_PROFIT_OPTIONS, PAYEE_TYPE_OPTIONS } from '../index';
import { ENABLE_PROFIT_OPTIONS, PAYEE_TYPE_OPTIONS, ENABLE_VIDEO_EDIT_OPTIONS } from '../index';
interface CreateFormProps {
visible: boolean;
@@ -163,6 +163,17 @@ const CreateForm: React.FC<CreateFormProps> = ({
disabled={enableProfit === 0}
/>
</ProForm.Group>
<ProForm.Group>
<ProFormSelect
width="md"
name="enableVideoEdit"
label="是否开启一键成片"
options={ENABLE_VIDEO_EDIT_OPTIONS}
rules={[{ required: true, message: '请选择是否开启一键成片' }]}
initialValue={0}
/>
</ProForm.Group>
</ModalForm>
);
};
@@ -6,7 +6,7 @@ import {
ProFormText,
ProFormDigit,
} from '@ant-design/pro-components';
import { STATUS_OPTIONS, PAYEE_TYPE_OPTIONS, ENABLE_PROFIT_OPTIONS } from '../index';
import { STATUS_OPTIONS, PAYEE_TYPE_OPTIONS, ENABLE_PROFIT_OPTIONS, ENABLE_VIDEO_EDIT_OPTIONS } from '../index';
import { Form, Space } from 'antd';
import styles from './index.less';
@@ -165,6 +165,16 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
disabled={enableProfit === 0}
/>
</ProForm.Group>
<ProForm.Group>
<ProFormSelect
width="md"
name="enableVideoEdit"
label="是否开启一键成片"
options={ENABLE_VIDEO_EDIT_OPTIONS}
rules={[{ required: true, message: '请选择是否开启一键成片' }]}
/>
</ProForm.Group>
</ModalForm>
);
};
@@ -49,6 +49,12 @@ export const ENABLE_PROFIT_OPTIONS = [
{ label: '是', value: 1 },
] as const;
// 添加一键成片状态常量
export const ENABLE_VIDEO_EDIT_OPTIONS = [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
] as const;
const handleApiRequest = async (
apiCall: () => Promise<any>,
loadingMessage: string,
@@ -384,6 +390,20 @@ const TableList: React.FC = () => {
'PERSONAL_OPENID': { text: '个人openid' },
},
},
{
title: '是否开启一键成片',
dataIndex: 'enableVideoEdit',
width: 140,
render: (_, record) => {
const status = record.enableVideoEdit === 1 ? '是' : '否';
const color = record.enableVideoEdit === 1 ? 'green' : 'default';
return <Tag color={color}>{status}</Tag>;
},
valueEnum: {
0: { text: '否' },
1: { text: '是' },
},
},
{
title: '操作',
key: 'action',