|
@@ -1,7 +1,6 @@
|
|
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
|
import { Button, Cascader, Form, FormInstance, Input, InputNumber, Modal } from 'antd'
|
|
|
-import { TopLeftArrType } from '.'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
import { useSelector } from 'react-redux'
|
|
|
import { RootState } from '@/store'
|
|
@@ -16,22 +15,21 @@ export type A2AddInfoType = {
|
|
|
}
|
|
|
|
|
|
type Props = {
|
|
|
- topType: TopLeftArrType
|
|
|
addInfo: A2AddInfoType
|
|
|
addFu: () => void
|
|
|
closeFu: () => void
|
|
|
}
|
|
|
|
|
|
-function A2add({ topType, addInfo, addFu, closeFu }: Props) {
|
|
|
+function A2add({ addInfo, addFu, closeFu }: Props) {
|
|
|
const treeData = useSelector((state: RootState) => state.A2classify.treeData)
|
|
|
|
|
|
// 级联选择器改变的时候 筛选当前级联的 信息出来
|
|
|
const [acCardInfo, setAcCardInfo] = useState({} as A2TreeType)
|
|
|
const [parentIdArr, setParentIdArr] = useState<number[] | null>(null)
|
|
|
|
|
|
- useEffect(() => {
|
|
|
- console.log(acCardInfo, parentIdArr)
|
|
|
- }, [acCardInfo, parentIdArr])
|
|
|
+ // useEffect(() => {
|
|
|
+ // console.log(acCardInfo, parentIdArr)
|
|
|
+ // }, [acCardInfo, parentIdArr])
|
|
|
|
|
|
useEffect(() => {
|
|
|
setAcCardInfo(addInfo.acInfo)
|
|
@@ -98,7 +96,7 @@ function A2add({ topType, addInfo, addFu, closeFu }: Props) {
|
|
|
level,
|
|
|
parentId
|
|
|
}
|
|
|
- console.log(123, obj)
|
|
|
+ // console.log(123, obj)
|
|
|
// if (1 + 1 === 2) {
|
|
|
// return
|
|
|
// }
|
|
@@ -117,7 +115,7 @@ function A2add({ topType, addInfo, addFu, closeFu }: Props) {
|
|
|
<Modal
|
|
|
wrapClassName={styles.A2add}
|
|
|
open={true}
|
|
|
- title={`${addInfo.txt} - ${topType}`}
|
|
|
+ title={`${addInfo.txt} - 中图法分类`}
|
|
|
footer={
|
|
|
[] // 设置footer为空,去掉 取消 确定默认按钮
|
|
|
}
|
|
@@ -132,8 +130,8 @@ function A2add({ topType, addInfo, addFu, closeFu }: Props) {
|
|
|
onFinishFailed={onFinishFailed}
|
|
|
autoComplete='off'
|
|
|
>
|
|
|
- <div className='fromRow'>
|
|
|
- <div className='fromRowll'>父级分类:</div>
|
|
|
+ <div className='fromRow' hidden={addInfo.txt === '编辑'}>
|
|
|
+ <div className='fromRowll'>{addInfo.txt === '新增' ? '父级' : '当前'}分类:</div>
|
|
|
<div className='fromRowrr'>
|
|
|
<Cascader
|
|
|
style={{ width: 658 }}
|
|
@@ -172,12 +170,7 @@ function A2add({ topType, addInfo, addFu, closeFu }: Props) {
|
|
|
name='sort'
|
|
|
rules={[{ required: true, message: '请输入排序值!' }]}
|
|
|
>
|
|
|
- <InputNumber
|
|
|
- min={1}
|
|
|
- max={999}
|
|
|
- precision={0}
|
|
|
- placeholder='请输入1~999的数字。数字越小,排序越靠前'
|
|
|
- />
|
|
|
+ <InputNumber min={1} max={999} precision={0} placeholder='请输入' />
|
|
|
</Form.Item>
|
|
|
<div className='fromRowTit'>
|
|
|
请输入1~999的数字。数字越小,排序越靠前。数字相同时,更新发布的内容排在前面
|