Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-admin
Commits
395f7058
Commit
395f7058
authored
Jan 13, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理品类属性树切换会调用两次接口的问题
parent
012d1d52
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
index.tsx
...oductManage/classAndProperty/categoryAttributes/index.tsx
+7
-2
index.tsx
...es/productManage/classAndProperty/propertyValue/index.tsx
+7
-2
No files found.
src/pages/productManage/classAndProperty/categoryAttributes/index.tsx
View file @
395f7058
...
...
@@ -86,6 +86,7 @@ const CategoryAttributes: React.FC<{}> = () => {
const
[
selectedTableRowKeys
,
setSelectedTableRowKeys
]
=
useState
<
Array
<
number
>>
([])
//表格选择
const
[
linkTableRowData
,
setLinkTableRowData
]
=
useState
<
any
[]
>
([])
const
[
attributeRowSelection
,
attributeRowCtl
]
=
useRowSelectionTable
()
const
flag
=
useRef
<
boolean
>
(
false
)
const
{
treeStatus
,
...
...
@@ -105,9 +106,13 @@ const CategoryAttributes: React.FC<{}> = () => {
// 获取选中项的关联属性列表
useEffect
(()
=>
{
if
(
selectKey
)
if
(
selectKey
&&
flag
.
current
)
{
ref
.
current
.
reload
()
// ref.current.reload({ current: 1, pageSize: 10, name: '', categoryId: selectKey, isByCategory: true })
}
else
if
(
!
selectKey
)
{
flag
.
current
=
false
}
else
{
flag
.
current
=
true
}
},
[
selectKey
])
const
fetchLinkAttributeData
=
(
params
:
any
)
=>
{
...
...
src/pages/productManage/classAndProperty/propertyValue/index.tsx
View file @
395f7058
...
...
@@ -26,6 +26,7 @@ const PropertyValue: React.FC<{}> = () => {
const
[
selectKey
,
setSelectKey
]
=
useState
(
undefined
)
const
[
selectNode
,
setSelectNode
]
=
useState
<
any
>
()
const
[
customExpandkeys
,
setCustomExpandkeys
]
=
useState
<
any
>
()
const
flag
=
useRef
<
boolean
>
(
false
)
const
{
treeStatus
,
...
...
@@ -58,9 +59,13 @@ const PropertyValue: React.FC<{}> = () => {
},
[])
useEffect
(()
=>
{
if
(
selectKey
)
if
(
selectKey
&&
flag
.
current
)
{
ref
.
current
.
reload
()
// ref.current.reload({current: 1, pageSize: 10, name: '', attributeId: selectKey})
}
else
if
(
!
selectKey
)
{
flag
.
current
=
false
}
else
{
flag
.
current
=
true
}
},
[
selectKey
])
const
onHandleSelect
=
(
key
,
node
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment