|
@@ -3,10 +3,8 @@ import styles from './index.module.scss'
|
|
|
import { Button, Empty, Input, Modal, Select } from 'antd'
|
|
|
import { MessageFu } from '@/utils/message'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
-import { A1RRlistType } from '../data'
|
|
|
-import { useDispatch, useSelector } from 'react-redux'
|
|
|
-import { A1_APIgetList, A1_APIsaveRR } from '@/store/action/A1record'
|
|
|
-import { RootState } from '@/store'
|
|
|
+import { A1ListSelectType, A1RRlistType } from '../data'
|
|
|
+import { A1_APIsaveRR } from '@/store/action/A1record'
|
|
|
import { DeleteOutlined } from '@ant-design/icons'
|
|
|
import classNames from 'classnames'
|
|
|
|
|
@@ -16,34 +14,21 @@ type Props = {
|
|
|
closeFu: () => void
|
|
|
upDataFu: () => void
|
|
|
oldList: A1RRlistType[]
|
|
|
+ listAllResTemp: A1ListSelectType
|
|
|
}
|
|
|
|
|
|
-function A1relation({ sId, closeFu, upDataFu, oldList, sName }: Props) {
|
|
|
- // 获取所有烈士信息
|
|
|
- const dispatch = useDispatch()
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- dispatch(
|
|
|
- A1_APIgetList({
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 99999
|
|
|
- })
|
|
|
- )
|
|
|
- }, [dispatch])
|
|
|
-
|
|
|
- const listAll = useSelector((state: RootState) => state.A1record.tableInfo.list)
|
|
|
+function A1relation({ sId, closeFu, upDataFu, oldList, sName, listAllResTemp }: Props) {
|
|
|
const [list, setList] = useState<A1RRlistType[]>([])
|
|
|
|
|
|
+ // 所有烈士信息改造
|
|
|
const listAllRes = useMemo(() => {
|
|
|
- return listAll
|
|
|
- .filter(v => v.id !== sId)
|
|
|
+ return listAllResTemp
|
|
|
+ .filter(v => v.value !== sId)
|
|
|
.map(c => ({
|
|
|
- value: c.id,
|
|
|
- label: c.name,
|
|
|
- disabled: list.map(q => q.moduleId).includes(c.id)
|
|
|
+ ...c,
|
|
|
+ disabled: list.map(q => q.moduleId).includes(c.value)
|
|
|
}))
|
|
|
- }, [list, listAll, sId])
|
|
|
- // 获取所有烈士信息-end
|
|
|
+ }, [list, listAllResTemp, sId])
|
|
|
|
|
|
// useEffect(() => {
|
|
|
// console.log('xxxxx', list)
|