Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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-platform
Commits
7b623fe6
Commit
7b623fe6
authored
Apr 13, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理新增招标切换锚点品类置空问题
parent
6404ab29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
index.tsx
src/components/AnchorDrawer/index.tsx
+14
-10
index.tsx
...orBids/addNewBid/components/relevanceGoodDrawer/index.tsx
+2
-0
No files found.
src/components/AnchorDrawer/index.tsx
View file @
7b623fe6
import
React
,
{
ReactNode
,
use
Callback
,
useContext
,
useEffect
,
useRef
,
useState
}
from
'react'
import
{
Modal
,
Drawer
,
Button
,
Tabs
,
Row
,
Col
,
Anchor
}
from
'antd'
import
React
,
{
ReactNode
,
use
Effect
,
useState
}
from
'react'
import
{
Drawer
,
Row
,
Col
,
Anchor
}
from
'antd'
import
style
from
'./index.less'
import
NiceForm
from
'../NiceForm'
import
{
IAntdSchemaFormProps
,
registerVirtualBox
}
from
'@formily/antd'
...
...
@@ -27,6 +27,8 @@ export interface AnchorProps extends IAntdSchemaFormProps {
isForm
?:
boolean
,
/** Drawer其他配置 */
restDrawer
?:
any
,
/** 重载的字段 */
reloadFields
?:
string
[],
}
const
AnchorDrawer
:
React
.
FC
<
AnchorProps
>
=
({
...
...
@@ -40,20 +42,13 @@ const AnchorDrawer: React.FC<AnchorProps> = ({
isForm
=
false
,
actions
,
restDrawer
,
reloadFields
,
...
restProps
})
=>
{
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
0
)
const
[
offsetTopList
,
setOffsetTopList
]
=
useState
<
number
[]
>
([])
// useEffect(() => {
// if (currentRef) {
// currentRef.current = {
// formActions,
// }
// }
// }, [])
useEffect
(()
=>
{
let
tempArr
:
any
=
[]
let
floors
:
any
=
[]
...
...
@@ -96,8 +91,17 @@ const AnchorDrawer: React.FC<AnchorProps> = ({
behavior
:
"smooth"
,
})
if
(
offsetTopList
[
i
]
+
dom
.
clientHeight
>=
dom
.
scrollHeight
)
{
// @tofix 此状态的变更会影响表单某些字段的显示
setCurrent
(
i
)
}
// @tofixed 重置字段值
if
(
reloadFields
.
length
)
{
for
(
let
i
=
0
;
i
<
reloadFields
.
length
;
i
++
)
{
actions
.
getFieldValue
(
reloadFields
[
i
]).
then
(
value
=>
{
actions
.
setFieldValue
(
reloadFields
[
i
],
value
)
})
}
}
}
registerVirtualBox
(
"CustomTitle"
,
({
children
,
schema
})
=>
{
...
...
src/pages/procurement/callForBids/addNewBid/components/relevanceGoodDrawer/index.tsx
View file @
7b623fe6
...
...
@@ -210,6 +210,7 @@ export const RelevanceGoodDrawer:React.FC<RelevanceGoodDrawerProps> = ({
effects=
{
(
$
,
ctx
)
=>
{
ctx
.
reset
()
$
(
'onFormMount'
).
subscribe
(
async
()
=>
{
console
.
log
(
1
)
const
commonData
=
await
getCommonData
()
ctx
.
setFieldState
(
'categoryId'
,
state
=>
{
state
.
props
[
'x-component-props'
].
options
=
commonData
[
'categoryData'
]
...
...
@@ -247,6 +248,7 @@ export const RelevanceGoodDrawer:React.FC<RelevanceGoodDrawerProps> = ({
className
:
style
.
parentDrawerWrapper
,
destroyOnClose
:
true
,
}
}
reloadFields=
{
[
'categoryId'
]
}
>
<
DrawerTable
drawerTitle=
'选择货品'
...
...
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