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
黄庭坚
jinfa-platform
Commits
7fa2cf99
Commit
7fa2cf99
authored
Apr 21, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复删除、确认没有触发页面返回提示的问题
parent
21178661
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
index.tsx
...ity/material/materialQuery/components/operation/index.tsx
+16
-0
sourceListSchema.tsx
...modity/material/materialQuery/schema/sourceListSchema.tsx
+4
-1
sourceList.tsx
src/pages/commodity/material/materialQuery/sourceList.tsx
+8
-0
No files found.
src/pages/commodity/material/materialQuery/components/operation/index.tsx
View file @
7fa2cf99
...
...
@@ -2,7 +2,21 @@ import { FormPath } from '@formily/antd';
import
{
Space
}
from
'antd'
;
import
React
from
'react'
;
interface
OperationProps
{
/**
* 删除之后触发事件
*/
onDeleteAfter
?:
()
=>
void
,
/**
* 保存之后触发事件
*/
onSaveAfter
?:
()
=>
void
,
}
const
Operation
=
(
props
)
=>
{
const
xComponentProps
:
OperationProps
=
props
.
props
[
'x-component-props'
]
||
{};
const
{
onDeleteAfter
,
onSaveAfter
}
=
xComponentProps
;
/** 这里用index 做值貌似有点问题 */
const
[,
index
]
=
props
.
name
.
split
(
"."
)
const
id
=
props
.
form
.
getFieldValue
(
`datas.
${
index
}
.id`
);
...
...
@@ -42,6 +56,7 @@ const Operation = (props) => {
props
.
form
.
setFieldValue
(
`datas`
,
newDataSource
.
filter
((
_item
)
=>
_item
.
status
===
1
))
props
.
form
.
setFieldValue
(
`cacheData`
,
newDataSource
)
onDeleteAfter
?.();
}
const
handleSave
=
()
=>
{
...
...
@@ -74,6 +89,7 @@ const Operation = (props) => {
});
props
.
form
.
setFieldValue
(
`cacheData`
,
newDataSource
)
onSaveAfter
?.();
}
if
(
editable
)
{
...
...
src/pages/commodity/material/materialQuery/schema/sourceListSchema.tsx
View file @
7fa2cf99
...
...
@@ -142,7 +142,10 @@ export const schema: ISchema = {
operations
:
{
title
:
'操作'
,
'x-component'
:
'Operation'
,
editable
:
false
editable
:
false
,
'x-component-props'
:
{
onDeleteAfter
:
'{{handleActionsAfter}}'
,
},
}
}
}
...
...
src/pages/commodity/material/materialQuery/sourceList.tsx
View file @
7fa2cf99
...
...
@@ -198,6 +198,13 @@ const SourceList = () => {
}
}
/**
* 处理删除操作、确认操作没有触发 onFormInputChange 的问题
*/
const
handleActionsAfter
=
()
=>
{
setUnsaved
(
true
)
};
return
(
<
AnchorPage
title=
{
intl
.
formatMessage
({
id
:
'material.sourceList'
,
defaultMessage
:
'货源清单'
})
}
...
...
@@ -218,6 +225,7 @@ const SourceList = () => {
previewPlaceholder=
' '
expressionScope=
{
{
renderAddition
:
renderAddition
(),
handleActionsAfter
:
handleActionsAfter
,
}
}
initialValues=
{
initialValue
}
onSubmit=
{
handleSubmit
}
...
...
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