Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
9bbd944a
Commit
9bbd944a
authored
Jan 04, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改规格保存延迟问题
parent
9a688b97
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
CommonTemplate.jsx
src/pages/ServiceGoods/components/CommonTemplate.jsx
+8
-1
EditFormTable.jsx
src/pages/ServiceGoods/components/EditFormTable.jsx
+7
-6
No files found.
src/pages/ServiceGoods/components/CommonTemplate.jsx
View file @
9bbd944a
...
...
@@ -87,7 +87,13 @@ export const CreateFormInput = props => {
{
...
options
}
style=
{
{
width
:
'
100%
'
}
}
placeholder=
{
`请输入${title}`
}
onBlur=
{
e
=>
onBlurEvent
(
e
.
target
.
value
,
dataIndex
,
rowIndex
)
}
onBlur=
{
e
=>
{
const
inputTarget
=
e
.
target
;
const
timer
=
setTimeout
(()
=>
{
clearTimeout
(
timer
);
onBlurEvent
(
inputTarget
.
value
,
dataIndex
,
rowIndex
);
},
10
);
}
}
/>
);
}
...
...
@@ -140,6 +146,7 @@ export const CreateFormInput = props => {
const
inputTarget
=
e
.
target
;
const
timer
=
setTimeout
(()
=>
{
clearTimeout
(
timer
);
console
.
log
(
'
inputTarget.value :>>
'
,
inputTarget
.
value
);
onBlurEvent
(
inputTarget
.
value
,
dataIndex
,
rowIndex
);
},
10
);
}
}
...
...
src/pages/ServiceGoods/components/EditFormTable.jsx
View file @
9bbd944a
...
...
@@ -62,12 +62,6 @@ const EditFormTable = forwardRef((props, ref) => {
setDataSource
([...
initData
]);
},
[
initData
]);
const
handleSave
=
(
value
,
dataIndex
,
rowIndex
)
=>
{
const
dataList
=
[...
dataSource
];
dataList
[
rowIndex
][
dataIndex
]
=
value
;
setDataSource
([...
dataList
]);
};
const
getValues
=
()
=>
[...
dataSource
].
map
(
item
=>
{
const
{
rowSpanCount
,
option
,
...
childItem
}
=
item
;
...
...
@@ -88,6 +82,13 @@ const EditFormTable = forwardRef((props, ref) => {
props
.
onValuesChange
();
},
400
);
const
handleSave
=
(
value
,
dataIndex
,
rowIndex
)
=>
{
const
dataList
=
[...
dataSource
];
dataList
[
rowIndex
][
dataIndex
]
=
value
;
setDataSource
([...
dataList
]);
getFormValues
();
};
const
rowOnClickEvent
=
row
=>
{
setSkuVisble
(
true
);
setSkuNameItem
({
...
...
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