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
31551664
Commit
31551664
authored
Mar 24, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 解决 forwardRef 问题
parent
47ad8c79
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
55 additions
and
35 deletions
+55
-35
index.jsx
src/pages/GoodsManage/SearchForm/index.jsx
+10
-8
GoodsGroup.jsx
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
+16
-5
GroupInfo.jsx
src/pages/GoodsManage/Takeaway/components/GroupInfo.jsx
+1
-1
MinimumPurchase.jsx
...pages/GoodsManage/Takeaway/components/MinimumPurchase.jsx
+3
-3
SendModal.jsx
src/pages/GoodsManage/Takeaway/components/SendModal.jsx
+3
-3
StockModal.jsx
src/pages/GoodsManage/Takeaway/components/StockModal.jsx
+3
-3
SwitchGroupModal.jsx
...ages/GoodsManage/Takeaway/components/SwitchGroupModal.jsx
+3
-3
WeekTime.jsx
src/pages/GoodsManage/Takeaway/components/WeekTime.jsx
+3
-3
index.jsx
src/pages/GoodsManage/Takeaway/index.jsx
+2
-2
style.less
src/pages/GoodsManage/style.less
+11
-4
No files found.
src/pages/GoodsManage/SearchForm/index.jsx
View file @
31551664
...
@@ -147,7 +147,7 @@ class goodsManage extends Component {
...
@@ -147,7 +147,7 @@ class goodsManage extends Component {
className=
{
styles
.
searchForm
}
className=
{
styles
.
searchForm
}
>
>
<
FormItem
label=
"SKU编码"
name=
"skuId"
>
<
FormItem
label=
"SKU编码"
name=
"skuId"
>
<
Input
placeholder=
"请输入SKU编码"
allowClear
style=
{
selectW
}
/>
<
Input
Number
placeholder=
"请输入SKU编码"
allowClear
style=
{
selectW
}
/>
</
FormItem
>
</
FormItem
>
<
FormItem
label=
"商品名称"
name=
"skuName"
>
<
FormItem
label=
"商品名称"
name=
"skuName"
>
<
Input
placeholder=
"请输入商品名称"
allowClear
style=
{
selectW
}
/>
<
Input
placeholder=
"请输入商品名称"
allowClear
style=
{
selectW
}
/>
...
@@ -212,13 +212,15 @@ class goodsManage extends Component {
...
@@ -212,13 +212,15 @@ class goodsManage extends Component {
<
Button
onClick=
{
()
=>
this
.
onReset
()
}
type=
"primary"
className=
{
styles
.
button
}
>
<
Button
onClick=
{
()
=>
this
.
onReset
()
}
type=
"primary"
className=
{
styles
.
button
}
>
重置
重置
</
Button
>
</
Button
>
<
Button
{
this
.
state
.
productType
!==
5
&&
(
loading=
{
this
.
state
.
loading
}
<
Button
onClick=
{
()
=>
this
.
onExportGoodsInfo
()
}
loading=
{
this
.
state
.
loading
}
className=
{
styles
.
button
}
onClick=
{
()
=>
this
.
onExportGoodsInfo
()
}
>
className=
{
styles
.
button
}
导出
>
</
Button
>
导出
</
Button
>
)
}
</
FormItem
>
</
FormItem
>
{
canEditable
?
(
{
canEditable
?
(
<
FormItem
style=
{
{
float
:
'
right
'
}
}
>
<
FormItem
style=
{
{
float
:
'
right
'
}
}
>
...
...
src/pages/GoodsManage/Takeaway/components/GoodsGroup.jsx
View file @
31551664
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
{
Button
,
Modal
,
Tag
}
from
'
antd
'
;
import
{
Button
,
Select
,
Tag
}
from
'
antd
'
;
import
{
DndProvider
}
from
'
react-dnd
'
;
import
{
DndProvider
}
from
'
react-dnd
'
;
import
HTML5Backend
from
'
react-dnd-html5-backend
'
;
import
HTML5Backend
from
'
react-dnd-html5-backend
'
;
import
styles
from
'
../../style.less
'
;
import
styles
from
'
../../style.less
'
;
...
@@ -11,6 +11,7 @@ const GoodsGroup = options => {
...
@@ -11,6 +11,7 @@ const GoodsGroup = options => {
const
[
groupEdit
,
setGroupEdit
]
=
useState
(
false
);
const
[
groupEdit
,
setGroupEdit
]
=
useState
(
false
);
const
[
selected
,
setSelected
]
=
useState
(
0
);
const
[
selected
,
setSelected
]
=
useState
(
0
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
[
shops
,
setShops
]
=
useState
([]);
const
[
tags
,
setTags
]
=
useState
([
const
[
tags
,
setTags
]
=
useState
([
{
{
...
@@ -52,10 +53,20 @@ const GoodsGroup = options => {
...
@@ -52,10 +53,20 @@ const GoodsGroup = options => {
return
(
return
(
<
div
className=
{
styles
.
groupBox
}
>
<
div
className=
{
styles
.
groupBox
}
>
<
div
className=
{
styles
[
'
groupBox-title
'
]
}
>
<
div
className=
{
styles
[
'
groupBox-title
'
]
}
>
<
div
>
商品分组
</
div
>
<
div
className=
{
styles
[
'
groupBox-title--name
'
]
}
>
所属门店
</
div
>
<
Button
className=
{
styles
[
'
groupBox-btn
'
]
}
onClick=
{
()
=>
setGroupEdit
(
!
groupEdit
)
}
>
<
Select
{
groupEdit
?
'
完成
'
:
'
编辑分组
'
}
showSearch
</
Button
>
placeholder=
"请选择所属门店"
onChange=
{
options
.
changeShop
}
filterOption=
{
(
input
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
input
.
toLowerCase
())
}
options=
{
shops
}
/>
</
div
>
<
div
className=
{
styles
[
'
groupBox-title
'
]
}
>
<
div
className=
{
styles
[
'
groupBox-title--name
'
]
}
>
商品分组
</
div
>
<
Button
onClick=
{
()
=>
setGroupEdit
(
!
groupEdit
)
}
>
{
groupEdit
?
'
完成
'
:
'
编辑分组
'
}
</
Button
>
</
div
>
</
div
>
<
div
className=
{
styles
[
'
groupBox-body
'
]
}
>
<
div
className=
{
styles
[
'
groupBox-body
'
]
}
>
{
groupEdit
?
(
{
groupEdit
?
(
...
...
src/pages/GoodsManage/Takeaway/components/GroupInfo.jsx
View file @
31551664
import
React
,
{
useState
}
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Form
,
Modal
,
Input
,
Checkbox
,
Alert
}
from
'
antd
'
;
import
{
Form
,
Modal
,
Input
,
Checkbox
,
Alert
}
from
'
antd
'
;
const
GroupInfo
=
options
=>
{
const
GroupInfo
=
options
=>
{
...
...
src/pages/GoodsManage/Takeaway/components/MinimumPurchase.jsx
View file @
31551664
import
React
,
{
forwardRef
}
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Modal
,
Form
,
Input
}
from
'
antd
'
;
import
{
Modal
,
Form
,
Input
}
from
'
antd
'
;
const
MinimumPurchase
=
forwardRef
(
options
=>
{
const
MinimumPurchase
=
options
=>
{
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
handleCancel
=
()
=>
{
const
handleCancel
=
()
=>
{
options
.
cancel
(
false
);
options
.
cancel
(
false
);
...
@@ -42,6 +42,6 @@ const MinimumPurchase = forwardRef(options => {
...
@@ -42,6 +42,6 @@ const MinimumPurchase = forwardRef(options => {
</
Form
>
</
Form
>
</
Modal
>
</
Modal
>
);
);
}
)
;
};
export
default
MinimumPurchase
;
export
default
MinimumPurchase
;
src/pages/GoodsManage/Takeaway/components/SendModal.jsx
View file @
31551664
import
React
,
{
forwardRef
}
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Modal
,
Form
,
Radio
}
from
'
antd
'
;
import
{
Modal
,
Form
,
Radio
}
from
'
antd
'
;
const
SendModal
=
forwardRef
(
options
=>
{
const
SendModal
=
options
=>
{
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
handleCancel
=
()
=>
{
const
handleCancel
=
()
=>
{
options
.
cancel
(
false
);
options
.
cancel
(
false
);
...
@@ -47,6 +47,6 @@ const SendModal = forwardRef(options => {
...
@@ -47,6 +47,6 @@ const SendModal = forwardRef(options => {
<
div
>
开启后顾客单点这些商品不可下单
</
div
>
<
div
>
开启后顾客单点这些商品不可下单
</
div
>
</
Modal
>
</
Modal
>
);
);
}
)
;
};
export
default
SendModal
;
export
default
SendModal
;
src/pages/GoodsManage/Takeaway/components/StockModal.jsx
View file @
31551664
import
React
,
{
forwardRef
,
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Modal
,
Form
,
Input
,
Checkbox
,
Radio
,
Switch
}
from
'
antd
'
;
import
{
Modal
,
Form
,
Input
,
Checkbox
,
Radio
,
Switch
}
from
'
antd
'
;
import
{
deepClone
}
from
'
@/utils/utils
'
;
import
{
deepClone
}
from
'
@/utils/utils
'
;
import
styles
from
'
../../style.less
'
;
import
styles
from
'
../../style.less
'
;
const
StockModal
=
forwardRef
(
options
=>
{
const
StockModal
=
options
=>
{
const
[
stockType
,
setStockType
]
=
useState
(
0
);
const
[
stockType
,
setStockType
]
=
useState
(
0
);
const
[
maxStock
,
setMaxStock
]
=
useState
(
0
);
const
[
maxStock
,
setMaxStock
]
=
useState
(
0
);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
...
@@ -102,6 +102,6 @@ const StockModal = forwardRef(options => {
...
@@ -102,6 +102,6 @@ const StockModal = forwardRef(options => {
<
div
className=
{
styles
[
'
stock-box--red
'
]
}
>
修改成功后,原库存将被替换,请谨慎操作
</
div
>
<
div
className=
{
styles
[
'
stock-box--red
'
]
}
>
修改成功后,原库存将被替换,请谨慎操作
</
div
>
</
Modal
>
</
Modal
>
);
);
}
)
;
};
export
default
StockModal
;
export
default
StockModal
;
src/pages/GoodsManage/Takeaway/components/SwitchGroupModal.jsx
View file @
31551664
import
React
,
{
forwardRef
}
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Modal
,
Form
,
Select
}
from
'
antd
'
;
import
{
Modal
,
Form
,
Select
}
from
'
antd
'
;
const
SwitchGroupModal
=
forwardRef
(
options
=>
{
const
SwitchGroupModal
=
options
=>
{
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
handleCancel
=
()
=>
{
const
handleCancel
=
()
=>
{
options
.
cancel
(
false
);
options
.
cancel
(
false
);
...
@@ -47,6 +47,6 @@ const SwitchGroupModal = forwardRef(options => {
...
@@ -47,6 +47,6 @@ const SwitchGroupModal = forwardRef(options => {
</
Form
>
</
Form
>
</
Modal
>
</
Modal
>
);
);
}
)
;
};
export
default
SwitchGroupModal
;
export
default
SwitchGroupModal
;
src/pages/GoodsManage/Takeaway/components/WeekTime.jsx
View file @
31551664
import
React
,
{
forwardRef
,
useState
}
from
'
react
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
{
Modal
,
Radio
,
Form
,
TimePicker
,
Checkbox
}
from
'
antd
'
;
import
{
Modal
,
Radio
,
Form
,
TimePicker
,
Checkbox
}
from
'
antd
'
;
import
{
MinusSquareOutlined
,
PlusSquareOutlined
}
from
'
@ant-design/icons
'
;
import
{
MinusSquareOutlined
,
PlusSquareOutlined
}
from
'
@ant-design/icons
'
;
import
moment
from
'
moment
'
;
import
moment
from
'
moment
'
;
...
@@ -6,7 +6,7 @@ import { deepClone } from '@/utils/utils';
...
@@ -6,7 +6,7 @@ import { deepClone } from '@/utils/utils';
import
{
saleWeeks
}
from
'
../../staticdata
'
;
import
{
saleWeeks
}
from
'
../../staticdata
'
;
import
styles
from
'
../../style.less
'
;
import
styles
from
'
../../style.less
'
;
const
WeekTime
=
forwardRef
(
options
=>
{
const
WeekTime
=
options
=>
{
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
type
,
setType
]
=
useState
(
1
);
const
[
type
,
setType
]
=
useState
(
1
);
...
@@ -163,6 +163,6 @@ const WeekTime = forwardRef(options => {
...
@@ -163,6 +163,6 @@ const WeekTime = forwardRef(options => {
</
Form
>
</
Form
>
</
Modal
>
</
Modal
>
);
);
}
)
;
};
export
default
WeekTime
;
export
default
WeekTime
;
src/pages/GoodsManage/Takeaway/index.jsx
View file @
31551664
import
React
,
{
useState
,
use
Ref
,
use
Effect
,
useCallback
,
useMemo
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
,
useCallback
,
useMemo
}
from
'
react
'
;
import
{
Spin
,
Table
,
Modal
,
message
,
notification
}
from
'
antd
'
;
import
{
Spin
,
Table
,
Modal
,
message
,
notification
}
from
'
antd
'
;
import
{
MenuOutlined
,
HolderOutlined
,
FormOutlined
,
CloseCircleOutlined
}
from
'
@ant-design/icons
'
;
import
{
MenuOutlined
,
HolderOutlined
,
FormOutlined
,
CloseCircleOutlined
}
from
'
@ant-design/icons
'
;
import
{
SortableContainer
,
SortableElement
,
SortableHandle
}
from
'
react-sortable-hoc
'
;
import
{
SortableContainer
,
SortableElement
,
SortableHandle
}
from
'
react-sortable-hoc
'
;
...
@@ -117,7 +117,7 @@ const Takeaway = options => {
...
@@ -117,7 +117,7 @@ const Takeaway = options => {
return
(
return
(
<
div
className=
{
styles
.
takeawayBox
}
>
<
div
className=
{
styles
.
takeawayBox
}
>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
GoodsGroup
/>
<
GoodsGroup
changeShop=
{
setShopId
}
/>
<
ActionBar
<
ActionBar
selectedRowKeys=
{
selectedRowKeys
}
selectedRowKeys=
{
selectedRowKeys
}
handleSearch=
{
getDataList
}
handleSearch=
{
getDataList
}
...
...
src/pages/GoodsManage/style.less
View file @
31551664
...
@@ -54,9 +54,15 @@
...
@@ -54,9 +54,15 @@
.searchForm {
.searchForm {
:global {
:global {
.ant-form-item-label {
.ant-form-item-label {
line-height: 40px;
line-height: 32px;
}
.ant-form-item {
margin-bottom: 12px;
}
}
}
}
.button {
margin: 1px 5px;
}
}
}
.queryBtn {
.queryBtn {
margin-left: 45px;
margin-left: 45px;
...
@@ -133,6 +139,7 @@
...
@@ -133,6 +139,7 @@
.takeawayBox {
.takeawayBox {
margin-top: 20px;
margin-top: 20px;
padding-bottom: 40px;
background-color: #fff;
background-color: #fff;
}
}
.groupBox {
.groupBox {
...
@@ -142,9 +149,9 @@
...
@@ -142,9 +149,9 @@
align-items: center;
align-items: center;
padding: 10px 0;
padding: 10px 0;
font-size: 18px;
font-size: 18px;
}
&--name {
&-btn {
margin-right: 15px;
margin-left: 15px;
}
}
}
&-body {
&-body {
padding: 5px 0;
padding: 5px 0;
...
...
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