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
02c6f082
Commit
02c6f082
authored
Apr 04, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改分组不切换的问题
parent
67c49371
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
14 deletions
+7
-14
DragTag.jsx
src/pages/GoodsManage/Takeaway/components/DragTag.jsx
+1
-4
GoodsGroup.jsx
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
+5
-9
index.jsx
src/pages/GoodsManage/Takeaway/index.jsx
+1
-1
No files found.
src/pages/GoodsManage/Takeaway/components/DragTag.jsx
View file @
02c6f082
...
...
@@ -40,10 +40,7 @@ const DragTag = ({ text, id, index, changePosition, endChangePosition, edit, del
item
.
index
=
hoverIndex
;
// 将当前当前移动到Box的index赋值给当前拖动的box,不然会出现两个盒子疯狂抖动!
},
drop
:
(
item
,
monitor
)
=>
{
const
dragIndex
=
item
.
index
;
const
hoverIndex
=
index
;
if
(
dragIndex
===
hoverIndex
)
return
;
// 如果回到自己的坑,那就什么都不做
endChangePosition
(
dragIndex
,
hoverIndex
);
// 调用传入的方法完成交换
endChangePosition
();
// 调用传入的方法完成交换
},
});
...
...
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
View file @
02c6f082
...
...
@@ -70,20 +70,16 @@ const GoodsGroup = options => {
};
// 更换位置
const
changePosition
=
async
(
d
ragIndex
,
hover
Index
)
=>
{
const
changePosition
=
async
(
d
Index
,
h
Index
)
=>
{
const
data
=
tags
.
slice
();
const
temp
=
data
[
d
rag
Index
];
const
temp
=
data
[
dIndex
];
// 交换位置
data
[
d
ragIndex
]
=
data
[
hover
Index
];
data
[
h
over
Index
]
=
temp
;
data
[
d
Index
]
=
data
[
h
Index
];
data
[
hIndex
]
=
temp
;
setTags
(
data
);
};
const
endChangePosition
=
async
(
dragIndex
,
hoverIndex
)
=>
{
const
endChangePosition
=
async
()
=>
{
const
data
=
tags
.
slice
();
const
temp
=
data
[
dragIndex
];
// 交换位置
data
[
dragIndex
]
=
data
[
hoverIndex
];
data
[
hoverIndex
]
=
temp
;
const
storageRankList
=
data
.
map
((
item
,
i
)
=>
({
id
:
item
.
id
,
priority
:
i
+
1
,
...
...
src/pages/GoodsManage/Takeaway/index.jsx
View file @
02c6f082
...
...
@@ -22,7 +22,7 @@ const Takeaway = options => {
const
[
shopId
,
setShopId
]
=
useState
(
0
);
const
[
groupId
,
setGroupId
]
=
useState
(
0
);
const
[
pageNo
,
setPageNo
]
=
useState
(
1
);
const
[
pageSize
,
setPageSize
]
=
useState
(
3
0
);
const
[
pageSize
,
setPageSize
]
=
useState
(
5
0
);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
actionLoading
,
setActionLoading
]
=
useState
(
false
);
...
...
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