Compare commits

...

2 Commits

  1. 6
      web/client/src/sections/fillion/actions/infor.js
  2. 31
      web/client/src/sections/fillion/components/infor/videoUpload.js

6
web/client/src/sections/fillion/actions/infor.js

@ -343,7 +343,7 @@ export function putAddPropagata (query) {
data: query,
actionType: 'PUT_PROPAGATA',
url: ApiTable.putpropagata,
msg: { error: '新增宣传视频信息失败' },
msg: { option: '新增宣传视频' },
// reducer: { name: 'reportstatistic' }
});
}
@ -354,7 +354,7 @@ export function putEditPropagata (query) {
data: query,
actionType: 'PUT_PROPAGATA',
url: ApiTable.putpropagata,
msg: { error: '编辑宣传视频信息失败' },
msg: { option: '编辑宣传视频' },
// reducer: { name: 'reportstatistic' }
});
}
@ -364,7 +364,7 @@ export function delPropagata (query) {
dispatch: dispatch,
actionType: 'DEL_PROPAGATA',
url: ApiTable.delpropagata.replace("{publicityId}", query?.publicityId),
msg: { error: '删除宣传视频信息失败' },
msg: { option: '删除宣传视频信息' },
// reducer: { name: 'reportstatistic' }
});
}

31
web/client/src/sections/fillion/components/infor/videoUpload.js

@ -9,7 +9,6 @@ import { getPropagata } from '../../actions/infor';
const VideoUpload = (props) => {
const { dispatch, record, counts, setCounts } = props
const [form] = Form.useForm();
@ -20,11 +19,9 @@ const VideoUpload = (props) => {
}
const showModalEdit = () => {
setIsModalVisible(true);
};
//新增
const handleOkAdd = () => {
form.validateFields().then((values) => {
@ -49,24 +46,28 @@ const VideoUpload = (props) => {
form.validateFields().then((values) => {
const videoname = values.username
const id = record.id
const video = record.video
const data = { publicityId: id, name: videoname, video: video }
const newVideoAddress = values.video.map((item) => {
return item.storageUrl
})
const data = { publicityId: id, name: videoname, video: newVideoAddress }
dispatch(putEditPropagata(data)).then(() => {
dispatch(getPropagata()).then((res) => {
setCounts(res.payload.data)
console.log(data);
})
})
setIsModalVisible(false);
}
);
setIsModalVisible(false);
};
const handleCancel = () => {
setIsModalVisible(false);
};
const handleCancelEdit = () => {
setIsModalVisible(false);
form.resetFields()
};
const onFinish = (values) => {
console.log('Success:', values);
@ -80,7 +81,7 @@ const VideoUpload = (props) => {
<div >
{
props.type_ys ? <div><Button type='primary' onClick={showModal}>新增</Button>
<Modal visible={isModalVisible} onOk={handleOkAdd} onCancel={handleCancel}>
<Modal visible={isModalVisible} onOk={handleOkAdd} onCancel={handleCancelEdit} >
<Form
form={form}
name="basic"
@ -123,7 +124,7 @@ const VideoUpload = (props) => {
]}
>
<Uploads
maxFilesNum={10}
maxFilesNum={1}
fileTypes={['mp4']}
maxFileSize={200}
/>
@ -178,9 +179,15 @@ const VideoUpload = (props) => {
<Form.Item
label="选择视频"
name="video"
rules={[
{
required: true,
message: '必须上传视频!',
},
]}
>
<Uploads
maxFilesNum={10}
maxFilesNum={1}
fileTypes={['mp4']}
maxFileSize={200}
/>

Loading…
Cancel
Save