|
|
@@ -46,16 +46,6 @@ function Z1formSet({ sId, closeFu }: Props) {
|
|
|
// 点击新增字段
|
|
|
const [addId, setAddId] = useState(0)
|
|
|
|
|
|
- // 移动
|
|
|
- const sortMove = useCallback(
|
|
|
- async (index: number, flag: 1 | -1) => {
|
|
|
- const id1 = info.fields[index].id!
|
|
|
- const id2 = info.fields[index + flag].id!
|
|
|
- const res = await Z1_APIformSort(flag === 1 ? id2 : id1, flag === 1 ? id1 : id2)
|
|
|
- if (res.code === 0) getInfoFu()
|
|
|
- },
|
|
|
- [getInfoFu, info.fields]
|
|
|
- )
|
|
|
// 关联字典数组
|
|
|
const dictArrTemp = useSelector((state: RootState) => state.Z2dict.dictAll)
|
|
|
// 关联标签
|
|
|
@@ -67,6 +57,17 @@ function Z1formSet({ sId, closeFu }: Props) {
|
|
|
return arr.filter(v => !formAddFilterFu().includes(v.fieldName))
|
|
|
}, [info.fields])
|
|
|
|
|
|
+ // 移动
|
|
|
+ const sortMove = useCallback(
|
|
|
+ async (index: number, flag: 1 | -1) => {
|
|
|
+ const id1 = resList[index].id!
|
|
|
+ const id2 = resList[index + flag].id!
|
|
|
+ const res = await Z1_APIformSort(flag === 1 ? id2 : id1, flag === 1 ? id1 : id2)
|
|
|
+ if (res.code === 0) getInfoFu()
|
|
|
+ },
|
|
|
+ [getInfoFu, resList]
|
|
|
+ )
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.Z1formSet}>
|
|
|
<div className='Z1fTop'>
|
|
|
@@ -151,13 +152,13 @@ function Z1formSet({ sId, closeFu }: Props) {
|
|
|
<div className='Z1fDel'>
|
|
|
<Button
|
|
|
onClick={() => sortMove(index, 1)}
|
|
|
- disabled={index === info.fields.length - 1}
|
|
|
+ disabled={index === resList.length - 1}
|
|
|
title='下移'
|
|
|
icon={<CaretDownOutlined rev={undefined} />}
|
|
|
></Button>
|
|
|
<Button
|
|
|
onClick={() => sortMove(index, -1)}
|
|
|
- disabled={index === 5}
|
|
|
+ disabled={index === 6}
|
|
|
title='上移'
|
|
|
icon={<CaretUpOutlined rev={undefined} />}
|
|
|
></Button>
|