|
|
@@ -7,7 +7,7 @@ import { MessageFu } from '@/utils/message'
|
|
|
import ZupOne from '@/components/ZupOne'
|
|
|
import ZupImgs from '@/components/ZupImgs'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
-import TextArea from 'antd/es/input/TextArea'
|
|
|
+import ZRichTextOne from '@/components/ZRichTextOne'
|
|
|
|
|
|
type Props = {
|
|
|
txt: AddTxtType
|
|
|
@@ -20,7 +20,11 @@ type Props = {
|
|
|
function A6add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
const FormBoxRef = useRef<FormInstance>(null)
|
|
|
const ZupThumbRef = useRef<any>(null)
|
|
|
+ const ZupPersonRef = useRef<any>(null)
|
|
|
const ZupImgsRef = useRef<any>(null)
|
|
|
+ const listSummaryRef = useRef<any>(null)
|
|
|
+ const introductionRef = useRef<any>(null)
|
|
|
+ const deedsRef = useRef<any>(null)
|
|
|
|
|
|
const getInfoFu = useCallback(async (id: string) => {
|
|
|
const res = await A6_APIgetInfo(id)
|
|
|
@@ -32,7 +36,15 @@ function A6add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
originalUrl: info.cover,
|
|
|
compressedUrl: info.coverSmall
|
|
|
})
|
|
|
+ ZupPersonRef.current?.setFileComFileFu({
|
|
|
+ originalName: '',
|
|
|
+ originalUrl: info.personImages,
|
|
|
+ compressedUrl: info.personImagesSmall
|
|
|
+ })
|
|
|
ZupImgsRef.current?.setFileComFileFu(info.images || [])
|
|
|
+ listSummaryRef.current?.ritxtShowFu(info.listSummary)
|
|
|
+ introductionRef.current?.ritxtShowFu(info.introduction)
|
|
|
+ deedsRef.current?.ritxtShowFu(info.deeds)
|
|
|
}
|
|
|
}, [])
|
|
|
|
|
|
@@ -52,13 +64,24 @@ function A6add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
const coverUrl = ZupThumbRef.current?.fileComFileResFu()
|
|
|
if (!coverUrl.originalUrl) return MessageFu.warning('请上传封面图')
|
|
|
|
|
|
+ const personUrl = ZupPersonRef.current?.fileComFileResFu()
|
|
|
+ if (!personUrl.originalUrl) return MessageFu.warning('请上传详情页人物封面')
|
|
|
+
|
|
|
const images = ZupImgsRef.current?.fileComFileResFu() || []
|
|
|
+ const listSummaryRtf = listSummaryRef.current?.fatherBtnOkFu() || { val: '' }
|
|
|
+ const introductionRtf = introductionRef.current?.fatherBtnOkFu() || { val: '' }
|
|
|
+ const deedsRtf = deedsRef.current?.fatherBtnOkFu() || { val: '' }
|
|
|
|
|
|
const obj = {
|
|
|
...values,
|
|
|
_id: txt === '新增' ? null : _id,
|
|
|
+ listSummary: listSummaryRtf.val || '',
|
|
|
+ introduction: introductionRtf.val || '',
|
|
|
+ deeds: deedsRtf.val || '',
|
|
|
cover: coverUrl.originalUrl || '',
|
|
|
coverSmall: coverUrl.compressedUrl || '',
|
|
|
+ personImages: personUrl.originalUrl || '',
|
|
|
+ personImagesSmall: personUrl.compressedUrl || '',
|
|
|
images
|
|
|
}
|
|
|
|
|
|
@@ -116,6 +139,18 @@ function A6add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
</div>
|
|
|
</Form.Item>
|
|
|
|
|
|
+ <div className='formBox'>
|
|
|
+ <div className='formBoxll'>列表简介:</div>
|
|
|
+ <div className='formBoxrr'>
|
|
|
+ <ZRichTextOne
|
|
|
+ check={false}
|
|
|
+ showUpload={false}
|
|
|
+ isLook={txt === '查看'}
|
|
|
+ ref={listSummaryRef}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<Form.Item label='摘要' name='summary' getValueFromEvent={e => e.target.value}>
|
|
|
<Input
|
|
|
readOnly={txt === '查看'}
|
|
|
@@ -125,25 +160,29 @@ function A6add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
/>
|
|
|
</Form.Item>
|
|
|
|
|
|
- <Form.Item label='个人简介' name='introduction' getValueFromEvent={e => e.target.value}>
|
|
|
- <TextArea
|
|
|
- readOnly={txt === '查看'}
|
|
|
- maxLength={2000}
|
|
|
- showCount
|
|
|
- rows={5}
|
|
|
- placeholder='请输入内容,不超过2000个字'
|
|
|
- />
|
|
|
- </Form.Item>
|
|
|
+ <div className='formBox'>
|
|
|
+ <div className='formBoxll'>个人简介:</div>
|
|
|
+ <div className='formBoxrr'>
|
|
|
+ <ZRichTextOne
|
|
|
+ check={false}
|
|
|
+ showUpload={false}
|
|
|
+ isLook={txt === '查看'}
|
|
|
+ ref={introductionRef}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <Form.Item label='追光事迹' name='deeds' getValueFromEvent={e => e.target.value}>
|
|
|
- <TextArea
|
|
|
- readOnly={txt === '查看'}
|
|
|
- maxLength={20000}
|
|
|
- showCount
|
|
|
- rows={5}
|
|
|
- placeholder='请输入内容,不超过20000个字'
|
|
|
- />
|
|
|
- </Form.Item>
|
|
|
+ <div className='formBox'>
|
|
|
+ <div className='formBoxll'>追光事迹:</div>
|
|
|
+ <div className='formBoxrr'>
|
|
|
+ <ZRichTextOne
|
|
|
+ check={false}
|
|
|
+ showUpload={false}
|
|
|
+ isLook={txt === '查看'}
|
|
|
+ ref={deedsRef}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
<div className='formBox'>
|
|
|
<div className='formBoxll'>
|
|
|
@@ -166,6 +205,26 @@ function A6add({ txt, _id, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
</div>
|
|
|
|
|
|
<div className='formBox'>
|
|
|
+ <div className='formBoxll'>
|
|
|
+ <span>* </span>详情页人物封面:
|
|
|
+ </div>
|
|
|
+ <div className='formBoxrr'>
|
|
|
+ <ZupOne
|
|
|
+ ref={ZupPersonRef}
|
|
|
+ isLook={txt === '查看'}
|
|
|
+ fileCheck={fileCheck}
|
|
|
+ myUrl='file/upload?upPath=A6person'
|
|
|
+ format={['image/jpeg', 'image/png']}
|
|
|
+ formatTxt='png、jpg和jpeg'
|
|
|
+ checkTxt='请上传详情页人物封面'
|
|
|
+ upTxt='最多1张'
|
|
|
+ myType='thumb'
|
|
|
+ size={5}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className='formBox'>
|
|
|
<div className='formBoxll'>图片:</div>
|
|
|
<div className='formBoxrr'>
|
|
|
<ZupImgs
|