|
@@ -33,7 +33,13 @@ function Z1dict() {
|
|
|
dispatch(
|
|
|
Z1_APIgetDict(topId[1], data => {
|
|
|
setLoding(true)
|
|
|
- if (data && data.length) setAcShu(data[0].id)
|
|
|
+ if (data && data.length) {
|
|
|
+ setAcShu(data[0].id)
|
|
|
+ const txtDom: HTMLDivElement = document.querySelector('.ant-select-selection-item')!
|
|
|
+ if (txtDom) {
|
|
|
+ acShuTxtRef.current = txtDom.title
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
)
|
|
|
}, [dispatch, topId])
|
|
@@ -62,12 +68,18 @@ function Z1dict() {
|
|
|
|
|
|
// 当前选中的树节点ID
|
|
|
const [acShu, setAcShu] = useState('0')
|
|
|
+ // 树节点文字信息
|
|
|
+ const acShuTxtRef = useRef('')
|
|
|
|
|
|
// 点击树节点
|
|
|
const onSelect = (id: any) => {
|
|
|
// console.log('点击树节点', id)
|
|
|
-
|
|
|
- if (id[0]) setAcShu(id[0])
|
|
|
+ if (id[0]) {
|
|
|
+ setAcShu(id[0])
|
|
|
+ // const txtDom: HTMLDivElement = document.querySelector('.ant-select-selection-item')!
|
|
|
+ // console.log('-------11', txtDom.title)
|
|
|
+ // if (txtDom) acShuTxtRef.current = txtDom.title
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const [value, setValue] = useState('')
|
|
@@ -190,7 +202,13 @@ function Z1dict() {
|
|
|
<div className='Z1toprr'>
|
|
|
<Button
|
|
|
type='primary'
|
|
|
- onClick={() => setAddInfo({ id: '-1', txt: '新增', acInfo: rightData })}
|
|
|
+ onClick={() =>
|
|
|
+ setAddInfo({
|
|
|
+ id: '-1',
|
|
|
+ txt: '新增',
|
|
|
+ acInfo: rightData
|
|
|
+ })
|
|
|
+ }
|
|
|
>
|
|
|
新增
|
|
|
</Button>
|
|
@@ -256,6 +274,7 @@ function Z1dict() {
|
|
|
{/* 新增/编辑页面 中图法分类 */}
|
|
|
{addInfo.id ? (
|
|
|
<Z1add
|
|
|
+ acShuTxt={acShuTxtRef.current}
|
|
|
addInfo={addInfo}
|
|
|
addFu={() => resetFu(false)}
|
|
|
closeFu={() => setAddInfo({} as Z1AddInfoType)}
|