|
@@ -9,6 +9,7 @@ import { A1AddInfoType, TypeA1dict } from './data'
|
|
|
import { A1_APIgetInfo, A1_APIsave } from '@/store/action/A1atlas'
|
|
import { A1_APIgetInfo, A1_APIsave } from '@/store/action/A1atlas'
|
|
|
import TextArea from 'antd/es/input/TextArea'
|
|
import TextArea from 'antd/es/input/TextArea'
|
|
|
import ZRichTexts from '@/components/ZRichTexts'
|
|
import ZRichTexts from '@/components/ZRichTexts'
|
|
|
|
|
+import ZupOne from '@/components/ZupOne'
|
|
|
|
|
|
|
|
type Props = {
|
|
type Props = {
|
|
|
addInfo: A1AddInfoType
|
|
addInfo: A1AddInfoType
|
|
@@ -19,6 +20,8 @@ type Props = {
|
|
|
function A1add({ addInfo, addFu, closeFu }: Props) {
|
|
function A1add({ addInfo, addFu, closeFu }: Props) {
|
|
|
// 富文本的ref
|
|
// 富文本的ref
|
|
|
const ZRichTextRef = useRef<any>(null)
|
|
const ZRichTextRef = useRef<any>(null)
|
|
|
|
|
+ // 封面图的ref
|
|
|
|
|
+ const ZupThumbRef = useRef<any>(null)
|
|
|
|
|
|
|
|
const { dictAll: treeData } = useSelector((state: RootState) => state.A1atlas)
|
|
const { dictAll: treeData } = useSelector((state: RootState) => state.A1atlas)
|
|
|
|
|
|
|
@@ -66,6 +69,13 @@ function A1add({ addInfo, addFu, closeFu }: Props) {
|
|
|
// 设置富文本
|
|
// 设置富文本
|
|
|
if (res.data.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf))
|
|
if (res.data.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf))
|
|
|
|
|
|
|
|
|
|
+ // 设置封面图
|
|
|
|
|
+ ZupThumbRef.current?.setFileComFileFu({
|
|
|
|
|
+ fileName: '',
|
|
|
|
|
+ filePath: res.data.thumbPc || '',
|
|
|
|
|
+ thumb: res.data.thumb || ''
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
settypeSon(res.data.typeSon ? res.data.typeSon : '2')
|
|
settypeSon(res.data.typeSon ? res.data.typeSon : '2')
|
|
|
FormBoxRef.current?.setFieldsValue({
|
|
FormBoxRef.current?.setFieldsValue({
|
|
|
...res.data,
|
|
...res.data,
|
|
@@ -94,6 +104,9 @@ function A1add({ addInfo, addFu, closeFu }: Props) {
|
|
|
// 通过校验点击确定
|
|
// 通过校验点击确定
|
|
|
const onFinish = useCallback(
|
|
const onFinish = useCallback(
|
|
|
async (values: any) => {
|
|
async (values: any) => {
|
|
|
|
|
+ // 封面图
|
|
|
|
|
+ const coverUrl1 = ZupThumbRef.current?.fileComFileResFu()
|
|
|
|
|
+
|
|
|
// 富文本
|
|
// 富文本
|
|
|
const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
const rtf = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
|
|
|
|
@@ -117,7 +130,9 @@ function A1add({ addInfo, addFu, closeFu }: Props) {
|
|
|
parentId,
|
|
parentId,
|
|
|
type: 'dict',
|
|
type: 'dict',
|
|
|
rtf: JSON.stringify(rtf.val || ''),
|
|
rtf: JSON.stringify(rtf.val || ''),
|
|
|
- sort: 999
|
|
|
|
|
|
|
+ sort: 999,
|
|
|
|
|
+ thumb: coverUrl1.thumb || '',
|
|
|
|
|
+ thumbPc: coverUrl1.filePath || ''
|
|
|
}
|
|
}
|
|
|
// console.log(123, obj)
|
|
// console.log(123, obj)
|
|
|
// if (1 + 1 === 2) {
|
|
// if (1 + 1 === 2) {
|
|
@@ -220,6 +235,29 @@ function A1add({ addInfo, addFu, closeFu }: Props) {
|
|
|
<div className='fromRowTit'>关闭时,该节点会关闭详情页</div>
|
|
<div className='fromRowTit'>关闭时,该节点会关闭详情页</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <Form.Item label='模板' name='label'>
|
|
|
|
|
+ <TextArea maxLength={2000} showCount placeholder='请输入内容' />
|
|
|
|
|
+ </Form.Item>
|
|
|
|
|
+
|
|
|
|
|
+ <div className='fromRow fromRow2'>
|
|
|
|
|
+ <div className='fromRowll'>封面图:</div>
|
|
|
|
|
+ <div className='fromRowrr'>
|
|
|
|
|
+ <ZupOne
|
|
|
|
|
+ ref={ZupThumbRef}
|
|
|
|
|
+ isLook={false}
|
|
|
|
|
+ fileCheck={false}
|
|
|
|
|
+ dirCode='A1atlasCover'
|
|
|
|
|
+ myUrl='cms/dict/upload'
|
|
|
|
|
+ format={['image/jpeg', 'image/png']}
|
|
|
|
|
+ formatTxt='png、jpg和jpeg'
|
|
|
|
|
+ checkTxt='请上传封面图!'
|
|
|
|
|
+ upTxt='最多1张'
|
|
|
|
|
+ myType='thumb'
|
|
|
|
|
+ size={5}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<Form.Item label='详情页类型' name='typeSon'>
|
|
<Form.Item label='详情页类型' name='typeSon'>
|
|
|
<Radio.Group
|
|
<Radio.Group
|
|
|
onChange={e => settypeSon(e.target.value)}
|
|
onChange={e => settypeSon(e.target.value)}
|