mirror of
https://github.com/PlayEdu/backend
synced 2025-06-08 03:04:09 +08:00
资源视频编辑组件优化
This commit is contained in:
parent
e29744ea88
commit
9dc959b064
@ -6,12 +6,14 @@ interface PropInterface {
|
||||
id: number;
|
||||
open: boolean;
|
||||
onCancel: () => void;
|
||||
onSuccess: () => void;
|
||||
}
|
||||
|
||||
export const VideosUpdateDialog: React.FC<PropInterface> = ({
|
||||
id,
|
||||
open,
|
||||
onCancel,
|
||||
onSuccess,
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
@ -72,9 +74,12 @@ export const VideosUpdateDialog: React.FC<PropInterface> = ({
|
||||
};
|
||||
|
||||
const onFinish = (values: any) => {
|
||||
if (Array.isArray(values.category_id)) {
|
||||
values.category_id = values.category_id[0];
|
||||
}
|
||||
resource.videoUpdate(id, values).then((res: any) => {
|
||||
message.success("保存成功!");
|
||||
onCancel();
|
||||
onSuccess();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -341,6 +341,10 @@ const ResourceVideosPage = () => {
|
||||
id={Number(updateId)}
|
||||
open={updateVisible}
|
||||
onCancel={() => setUpdateVisible(false)}
|
||||
onSuccess={() => {
|
||||
setUpdateVisible(false);
|
||||
setRefresh(!refresh);
|
||||
}}
|
||||
></VideosUpdateDialog>
|
||||
</div>
|
||||
</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user