shaogen1995 2 mesiacov pred
rodič
commit
38a96b20f1
1 zmenil súbory, kde vykonal 10 pridanie a 3 odobranie
  1. 10 3
      src/pages/A2video/A2add/index.tsx

+ 10 - 3
src/pages/A2video/A2add/index.tsx

@@ -17,6 +17,8 @@ type Props = {
 }
 
 function A2add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
+  const [type, setType] = useState('')
+
   const FormBoxRef = useRef<FormInstance>(null)
   // 封面图的ref
   const ZupThumbRef = useRef<any>(null)
@@ -27,6 +29,8 @@ function A2add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
     if (res.code === 0) {
       const info = res.data
 
+      setType(info.type)
+
       if (info.releaseDate) info.releaseDate = dayjs(info.releaseDate)
 
       FormBoxRef.current?.setFieldsValue(info)
@@ -78,7 +82,8 @@ function A2add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
         cover: coverUrl.originalUrl || '',
         coverSmall: coverUrl.compressedUrl || '',
         videoUrl: videoUrl.originalUrl || '',
-        videoName: videoUrl.originalName
+        videoName: videoUrl.originalName,
+        type
       }
 
       const res: any = await A2_APIsave(obj)
@@ -91,7 +96,7 @@ function A2add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
       }
       // console.log("通过校验,点击确定");
     },
-    [addTableFu, closeFu, editTableFu, _id, txt]
+    [txt, _id, type, addTableFu, editTableFu, closeFu]
   )
 
   return (
@@ -123,6 +128,8 @@ function A2add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
 
         <Form.Item label='类别' name='type' rules={[{ required: true, message: '请选择类别' }]}>
           <Select
+            value={type}
+            onChange={e => setType(e)}
             disabled={txt === '查看'}
             style={{ width: 150 }}
             options={A2typeSelectType}
@@ -143,7 +150,7 @@ function A2add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
               format={['image/jpeg', 'image/png']}
               formatTxt='png、jpg和jpeg'
               checkTxt='请上传封面图'
-              upTxt='最多1张'
+              upTxt={`最多1张${type === '追光视频' ? ';建议尺寸 460px X 600px' : type === '科普视频' ? ';建议尺寸 350px X 240px' : ''}`}
               myType='thumb'
               size={5}
             />