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
090b9e46
Commit
090b9e46
authored
Sep 17, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
e7230a6a
f25f01f5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
681 additions
and
560 deletions
+681
-560
channelRoute.ts
config/routes/channelRoute.ts
+8
-0
index.ts
config/utils/index.ts
+3
-0
index.tsx
src/components/AddressSelect/index.tsx
+3
-3
UploadFiles.less
src/components/UploadFiles/UploadFiles.less
+13
-0
UploadFiles.tsx
src/components/UploadFiles/UploadFiles.tsx
+24
-13
index.tsx
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
+2
-2
index.tsx
...rvice/exchangeApplication/components/DetailInfo/index.tsx
+1
-27
index.tsx
...ce/exchangeApplication/exchangePrAddWarehousing/index.tsx
+2
-2
index.tsx
...cation/exchangePrSubmit/components/ExchangeForm/index.tsx
+2
-2
index.tsx
...terService/exchangeManage/components/DetailInfo/index.tsx
+3
-35
verify.tsx
.../afterService/exchangeManage/exchangePrDeliver/verify.tsx
+1
-1
index.tsx
...Service/returnApplication/components/DetailInfo/index.tsx
+1
-0
index.tsx
...pplication/returnPrSubmit/components/ReturnForm/index.tsx
+2
-2
index.tsx
...afterService/returnManage/components/DetailInfo/index.tsx
+1
-0
index.tsx
src/pages/channel/templateDetail/index.tsx
+10
-1
index.tsx
src/pages/editor/mobileSettingPanel/propsSettings/index.tsx
+2
-2
useGetLayout.tsx
...Template/categoryNavigation/common/hooks/useGetLayout.tsx
+7
-6
editPanel.tsx
...ate/categoryNavigation/components/EditPanel/editPanel.tsx
+15
-7
branchList.tsx
...categoryNavigation/components/FormilyBrand/branchList.tsx
+5
-3
index.tsx
.../categoryNavigation/components/FormilyCommodity/index.tsx
+4
-0
ProductContainer.tsx
...vigation/components/Layout/Commodity/ProductContainer.tsx
+2
-2
index.tsx
.../categoryNavigation/components/Layout/Container/index.tsx
+22
-18
index.less
...vigation/components/Layout/SecondaryNavigation/index.less
+16
-2
index.tsx
...avigation/components/Layout/SecondaryNavigation/index.tsx
+5
-2
index.tsx
...plate/categoryNavigation/components/Layout/Tabs/index.tsx
+10
-4
toolbarSubmit.tsx
...e/categoryNavigation/components/Toolbar/toolbarSubmit.tsx
+6
-5
index.tsx
src/pages/mobileTemplate/categoryNavigation/index.tsx
+22
-6
columns_1.tsx
...bility/components/productListLayout/columns/columns_1.tsx
+81
-70
columns_2.tsx
...bility/components/productListLayout/columns/columns_2.tsx
+81
-70
columns_3.tsx
...bility/components/productListLayout/columns/columns_3.tsx
+83
-72
columns_4.tsx
...bility/components/productListLayout/columns/columns_4.tsx
+58
-50
columns_5.tsx
...bility/components/productListLayout/columns/columns_5.tsx
+82
-71
columns_6.tsx
...bility/components/productListLayout/columns/columns_6.tsx
+0
-0
columns_7.tsx
...bility/components/productListLayout/columns/columns_7.tsx
+86
-75
columns_8.tsx
...bility/components/productListLayout/columns/columns_8.tsx
+0
-0
index.tsx
...n/marketingAbility/components/productListLayout/index.tsx
+15
-6
add.tsx
...arketingAbility/selfManagement/readySubmitExamine/add.tsx
+1
-0
index.tsx
...t/readySubmitExamine/components/basicInfoLayout/index.tsx
+2
-0
index.tsx
...readySubmitExamine/components/partakeUserLayout/index.tsx
+0
-1
index.tsx
...ement/readySubmitExamine/components/rulesLayout/index.tsx
+0
-0
No files found.
config/routes/channelRoute.ts
View file @
090b9e46
...
...
@@ -8,6 +8,7 @@
*/
import
{
RouterChild
}
from
'../utils/index'
;
const
ShopRoute
:
RouterChild
=
{
path
:
'/memberCenter/channelAbility'
,
name
:
'渠道能力'
,
...
...
@@ -33,6 +34,13 @@ const ShopRoute: RouterChild = {
component
:
'@/pages/channel/templateDetail'
,
},
{
path
:
`/memberCenter/channelAbility/template/categoryNavigation`
,
name
:
'渠道品类导航页装修'
,
hideInMenu
:
true
,
noLayout
:
true
,
component
:
'@/pages/mobileTemplate/categoryNavigation'
,
},
{
path
:
'/memberCenter/channelAbility/channelSeo'
,
name
:
'店铺SEO设置'
,
component
:
'@/pages/channel/channelSeo'
,
...
...
config/utils/index.ts
View file @
090b9e46
...
...
@@ -34,5 +34,8 @@ export interface RouterChild {
* @memberof RouterChild
*/
noMargin
?:
boolean
/** 是否使用上级路由布局 */
noLayout
?:
boolean
}
src/components/AddressSelect/index.tsx
View file @
090b9e46
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-08-05 10:28:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-1
0 10:27:19
* @LastEditTime: 2021-09-1
7 15:48:16
* @Description: 地址选择 FormItem
*/
import
React
,
{
useState
,
useEffect
,
useMemo
,
useRef
}
from
'react'
;
...
...
@@ -491,12 +491,12 @@ const AddressSelect: React.FC<IProps> = (props) => {
},
[
list
]);
if
(
!
editable
)
{
const
current
=
list
.
find
((
item
)
=>
item
.
id
===
value
.
id
);
const
current
=
list
.
find
((
item
)
=>
item
.
id
===
value
?
.
id
);
const
full
=
current
?
`
${
current
.
name
}
${
current
.
fullAddress
}
${
current
.
phone
}
`
:
null
;
const
isStr
=
typeof
value
===
'string'
;
return
(
<
div
>
{
full
||
(
!
isStr
?
`${value
.name} ${value.fullAddress} ${value.phone
}`
:
value
)
}
</
div
>
<
div
>
{
full
||
(
!
isStr
?
`${value
?.name || ''} ${value?.fullAddress || ''} ${value?.phone || ''
}`
:
value
)
}
</
div
>
);
}
...
...
src/components/UploadFiles/UploadFiles.less
View file @
090b9e46
...
...
@@ -59,3 +59,16 @@
.fileEmpty {
margin-bottom: 0;
}
.uploadContainer {
& > span {
width: 100%;
display: flex;
:global {
.ant-upload {
width: 100%;
}
}
}
}
src/components/UploadFiles/UploadFiles.tsx
View file @
090b9e46
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
cx
from
'classnames'
;
import
{
UploadProps
,
UploadChangeParam
,
UploadFile
}
from
'antd/lib/upload/interface'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
;
import
{
Upload
,
Progress
,
Button
,
message
}
from
'antd'
;
import
{
CloudUploadOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
styles
from
'./UploadFiles.less'
;
import
{
UPLOAD_TYPE
}
from
'@/constants'
;
import
pdfIcon
from
'@/assets/imgs/pdf_icon.png'
;
import
{
getAuth
}
from
'@/utils/auth'
;
import
styles
from
'./UploadFiles.less'
;
type
PickProps
=
"headers"
|
"action"
|
"accept"
|
"beforeUpload"
|
"onChange"
|
"fileList"
...
...
@@ -24,7 +24,15 @@ interface PickUploadProps extends Pick<UploadProps, PickProps> {
customizeItemRender
?:
((
files
:
UploadFile
[],
handleRemove
:
(
fileItem
:
UploadFile
)
=>
void
)
=>
React
.
ReactNode
)
|
null
,
onRemove
?:
((
fileItem
:
UploadFile
)
=>
void
)
|
null
,
/** 是否显示文件 */
showFiles
?:
boolean
showFiles
?:
boolean
,
/**
* 上传最大数
*/
maxCount
?:
number
,
/**
* 自定义渲染child
*/
renderUploadChild
?:
(
fileList
:
any
[])
=>
React
.
ReactNode
,
}
const
UploadFiles
:
React
.
FC
<
PickUploadProps
>
=
(
props
:
PickUploadProps
)
=>
{
...
...
@@ -43,9 +51,12 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
mode
,
buttonText
,
fileContainerClassName
,
showFiles
showFiles
,
renderUploadChild
,
maxCount
,
}
=
props
;
const
hasFileListProps
=
"fileList"
in
props
;
const
hasMaxCount
=
typeof
maxCount
!==
'undefined'
?
{
maxCount
}
:
{};
const
auth
=
getAuth
();
const
[
files
,
setFiles
]
=
useState
<
UploadFile
[]
>
(()
=>
props
.
fileList
||
[]);
// const renderFiles = hasFileListProps ? props.fileList : files;
...
...
@@ -61,23 +72,22 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
},
styles
.
renderFileContainer
,
fileContainerClassName
);
const
uploadProps
=
{
disabled
:
disable
,
name
:
'file'
,
fileList
:
files
,
accept
:
accept
,
action
:
action
,
headers
:
{
...
headers
,
token
:
auth
.
token
},
headers
:
{
...
headers
,
token
:
auth
?
.
token
},
data
:
{
fileType
:
UPLOAD_TYPE
},
disabled
:
disable
,
// disabled: loading || disabled
,
showUploadList
:
false
,
onChange
(
info
:
UploadChangeParam
)
{
console
.
log
(
info
.
file
);
if
(
info
.
file
.
status
===
'error'
||
(
info
.
file
.
status
===
'done'
&&
info
.
file
.
response
?.
code
!==
1000
))
{
message
.
error
(
info
.
file
.
response
?.
message
||
"上传失败, 请检查上传接口"
);
return
;
}
console
.
log
(
123123
);
// 如果不存在fileList, 只存在onChange 那么也要改变组件的file
if
(
!
(
"fileList"
in
props
))
{
const
fileList
=
info
.
fileList
;
...
...
@@ -97,9 +107,9 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
if
(
onChange
)
{
onChange
(
info
);
}
},
beforeUpload
beforeUpload
,
...
hasMaxCount
};
const
handleRemove
=
(
fileItem
:
UploadFile
)
=>
{
...
...
@@ -168,10 +178,11 @@ const UploadFiles: React.FC<PickUploadProps> = (props: PickUploadProps) => {
}
{
!
disable
&&
(
<
div
style=
{
{
order
:
uploadOrder
}
}
>
<
div
style=
{
{
order
:
uploadOrder
}
}
className=
{
styles
.
uploadContainer
}
>
<
Upload
{
...
uploadProps
}
>
{
renderUploadChild
?.(
files
)
}
{
children
||
(
typeof
children
!==
'undefined'
?
children
:
(
<
Button
type=
{
mode
}
icon=
{
<
CloudUploadOutlined
/>
}
>
{
buttonText
}
</
Button
>
...
...
@@ -201,7 +212,7 @@ UploadFiles.defaultProps = {
}
return
true
;
},
onChange
:
(
file
:
UploadChangeParam
)
=>
{
},
onChange
:
(
file
:
UploadChangeParam
)
=>
{},
customizeItemRender
:
null
,
onRemove
:
null
,
disable
:
false
,
...
...
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
View file @
090b9e46
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 17:36:45
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-1
6 10:31:19
* @LastEditTime: 2021-09-1
7 15:40:27
* @Description: 查看退货数量与退款金额 抽屉
*/
import
React
,
{
useEffect
,
useState
}
from
'react'
;
...
...
@@ -203,7 +203,7 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
setPayInfoLoading
(
true
);
try
{
// 编辑状态才请求支付信息,否则默认取申请信息里边的支付信息
if
(
isEdit
&&
isMateriel
)
{
if
(
isEdit
&&
!
isMateriel
)
{
const
res
=
await
PublicApi
.
getOrderCommonAfterSalePaymentFind
({
orderId
:
`
${
applyInfo
.
orderId
}
`
,
});
...
...
src/pages/afterService/exchangeApplication/components/DetailInfo/index.tsx
View file @
090b9e46
...
...
@@ -11,7 +11,6 @@ import { history } from 'umi';
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetAsReplaceGoodsGetDetailByConsumerResponse
,
GetAsReplaceGoodsPageReturnedGoodsResponse
,
}
from
'@/services/AfterServiceV2Api'
;
import
{
EXCHANGE_OUTER_STATUS_FINISHED
,
...
...
@@ -88,8 +87,6 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
headExtra
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
(
null
);
const
[
replaceGoodsList
,
setReplaceGoodsList
]
=
useState
<
GetAsReplaceGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
replaceGoodsLoading
,
setExchangeGoodsLoading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
isPointsOrder
=
detailInfo
?.
orderType
===
ORDER_TYPE2_POINTS
||
detailInfo
?.
orderType
===
ORDER_TYPE2_CHANNEL_POINTS
;
...
...
@@ -227,30 +224,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
});
};
// 获取换货明细列表
const
getReplaceGoods
=
()
=>
{
if
(
!
id
)
{
return
;
}
setExchangeGoodsLoading
(
true
);
PublicApi
.
getAsReplaceGoodsPageReturnedGoods
({
replaceId
:
id
,
current
:
`
${
1
}
`
,
pageSize
:
`
${
99999
}
`
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setReplaceGoodsList
(
res
.
data
);
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setExchangeGoodsLoading
(
false
);
});
};
useEffect
(()
=>
{
getDetailInfo
();
getReplaceGoods
();
},
[]);
const
handleReceivedConfirmReturnDeliver
=
(
id
):
Promise
<
any
>
=>
{
...
...
@@ -468,8 +443,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
title=
"换货商品"
rowKey=
"detailId"
columns=
{
productColumns
}
loading=
{
replaceGoodsLoading
}
dataSource=
{
replaceGoodsList
.
data
}
dataSource=
{
detailInfo
?.
goodsDetailList
}
id=
"goodsDetailList"
/>
</
Suspense
>
...
...
src/pages/afterService/exchangeApplication/exchangePrAddWarehousing/index.tsx
View file @
090b9e46
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-06 16:30:44
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
8-20 16:08:41
* @LastEditTime: 2021-0
9-16 15:17:24
* @Description: 待新增换货入库单
*/
import
React
,
{
useState
,
useRef
}
from
'react'
;
...
...
@@ -44,7 +44,7 @@ const ExchangePrAddWarehousing: React.FC = () => {
confirm
({
title
:
'确认审核操作'
,
icon
:
<
ExclamationCircleOutlined
/>,
content
:
`是否确认审核换货收货单号为
${
record
.
replace
Delivery
No
}
的换货收货单?`
,
content
:
`是否确认审核换货收货单号为
${
record
.
replace
Storage
No
}
的换货收货单?`
,
onOk
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
postAsReplaceGoodsVerifyReplaceGoodsStorage
({
...
...
src/pages/afterService/exchangeApplication/exchangePrSubmit/components/ExchangeForm/index.tsx
View file @
090b9e46
...
...
@@ -288,8 +288,8 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
},
{
title
:
!
isPointsOrder
?
'采购金额'
:
'所需积分小计'
,
dataIndex
:
'
paidA
mount'
,
render
:
(
text
,
record
)
=>
+
text
?
`¥
${
text
}
`
:
record
.
amount
,
dataIndex
:
'
a
mount'
,
render
:
(
text
)
=>
`¥
${
text
}
`
,
},
{
title
:
'已换货数量'
,
...
...
src/pages/afterService/exchangeManage/components/DetailInfo/index.tsx
View file @
090b9e46
import
React
,
{
Suspense
,
useEffect
,
useState
}
from
'react'
;
import
{
PageHeader
,
Descriptions
,
Card
,
Spin
,
Button
,
Row
,
Col
,
Badge
,
...
...
@@ -12,13 +8,11 @@ import {
Tooltip
,
message
,
}
from
'antd'
;
import
{
FormOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
history
}
from
'umi'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetAsReplaceGoodsGetDetailBySupplierResponse
,
GetAsReplaceGoodsPageReturnedGoodsResponse
,
}
from
'@/services/AfterServiceV2Api'
;
import
{
EXCHANGE_OUTER_STATUS_FINISHED
,
...
...
@@ -44,7 +38,6 @@ import {
EXCHANGE_OUTER_STATUS_TAG_MAP
,
EXCHANGE_INNER_STATUS_BADGE_MAP
,
}
from
'../../../constants'
;
import
styles
from
'./index.less'
;
const
ProductList
=
React
.
lazy
(()
=>
import
(
'../../../components/ProductList'
));
const
ExchangeReceivedInfo
=
React
.
lazy
(()
=>
import
(
'../../../components/ExchangeReceivedInfo'
));
...
...
@@ -101,9 +94,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
headExtra
,
})
=>
{
const
[
detailInfo
,
setDetailInfo
]
=
useState
<
DetailInfo
>
(
null
);
const
[
replaceGoodsList
,
setReplaceGoodsList
]
=
useState
<
GetAsReplaceGoodsPageReturnedGoodsResponse
>
({
data
:
[],
totalCount
:
0
});
const
[
infoLoading
,
setInfoloading
]
=
useState
(
false
);
const
[
replaceGoodsLoading
,
setExchangeGoodsLoading
]
=
useState
(
false
);
const
[
exchangeAddress
,
setExchangeAddress
]
=
useState
<
ExchangeAddressValues
>
(
null
);
const
[
returnAddress
,
setReturnAddress
]
=
useState
<
ReturnAddressValues
>
(
null
);
...
...
@@ -142,27 +133,6 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
});
};
// 获取换货明细列表
const
getReplaceGoods
=
()
=>
{
if
(
!
id
)
{
return
;
}
setExchangeGoodsLoading
(
true
);
PublicApi
.
getAsReplaceGoodsPageReturnedGoods
({
replaceId
:
id
,
current
:
`
${
1
}
`
,
pageSize
:
`
${
99999
}
`
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setReplaceGoodsList
(
res
.
data
);
}
}).
catch
((
err
)
=>
{
console
.
warn
(
err
);
}).
finally
(()
=>
{
setExchangeGoodsLoading
(
false
);
});
};
const
handleReturn
=
record
=>
{
if
(
!
isEditReturn
||
!
id
)
{
return
;
...
...
@@ -177,7 +147,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
isNeed
:
record
.
isNeedReturn
===
1
?
0
:
1
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
get
ReplaceGoods
();
get
DetailInfo
();
}
}).
finally
(()
=>
{
msg
();
...
...
@@ -295,7 +265,6 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
useEffect
(()
=>
{
getDetailInfo
();
getReplaceGoods
();
},
[]);
const
handleExchangeAddressSubmit
=
values
=>
{
...
...
@@ -521,8 +490,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
title=
"换货商品"
rowKey=
"detailId"
columns=
{
productColumns
}
loading=
{
replaceGoodsLoading
}
dataSource=
{
replaceGoodsList
.
data
}
dataSource=
{
detailInfo
?.
goodsDetailList
}
id=
"goodsDetailList"
/>
</
Suspense
>
...
...
src/pages/afterService/exchangeManage/exchangePrDeliver/verify.tsx
View file @
090b9e46
...
...
@@ -79,7 +79,7 @@ const ExchangePrDeliverVerify: React.FC = () => {
value=
{
{
productList
:
(
info
?.
goodsDetailList
.
filter
((
item
)
=>
item
.
isNeedReturn
&&
item
.
deliveryCount
>
0
)
.
filter
((
item
)
=>
item
.
deliveryCount
>
0
)
.
map
((
item
)
=>
{
// 从换货统计里边找到对应的商品,
const
current
=
info
?.
replaceStatisticsList
.
find
((
statisticsItem
)
=>
statisticsItem
.
productId
===
item
.
productId
);
...
...
src/pages/afterService/returnApplication/components/DetailInfo/index.tsx
View file @
090b9e46
...
...
@@ -119,6 +119,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
channelTxt
:
item
.
channelName
,
})),
orderType
:
detailInfo
?.
orderType
,
refundAmount
:
record
.
refundAmount
,
});
setVisibleReturnInfo
(
true
);
};
...
...
src/pages/afterService/returnApplication/returnPrSubmit/components/ReturnForm/index.tsx
View file @
090b9e46
...
...
@@ -291,8 +291,8 @@ const ReturnForm: React.FC<BillsFormProps> = ({
},
{
title
:
'金额'
,
dataIndex
:
'
paidA
mount'
,
render
:
(
text
,
record
)
=>
+
text
?
`¥
${
text
}
`
:
record
.
amount
,
dataIndex
:
'
a
mount'
,
render
:
(
text
)
=>
`¥
${
text
}
`
,
},
{
title
:
'已退货数量'
,
...
...
src/pages/afterService/returnManage/components/DetailInfo/index.tsx
View file @
090b9e46
...
...
@@ -124,6 +124,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
channelTxt
:
item
.
channelName
,
})),
orderType
:
detailInfo
?.
orderType
,
refundAmount
:
record
.
refundAmount
,
});
setVisibleReturnInfo
(
true
);
};
...
...
src/pages/channel/templateDetail/index.tsx
View file @
090b9e46
...
...
@@ -84,6 +84,15 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
}
}
const
handleJump
=
()
=>
{
if
(
detailInfo
?.
environment
!==
4
)
{
message
.
info
(
"暂不支持该类型模板预览"
)
return
;
}
window
.
location
.
href
=
`/memberCenter/channelAbility/template/categoryNavigation?id=
${
detailInfo
.
id
}
&template=
${
detailInfo
.
fileName
}
&type=
${
shopType
}
&shopId=
${
detailInfo
.
shopId
}
`
}
return
(
<
DetailPage
title=
"查看模板"
...
...
@@ -127,7 +136,7 @@ const TemplateDetail: React.FC<TemplateDetailPropsType> = (props) => {
</
div
>
{
detailInfo
?.
environment
===
4
&&
(
<
div
className=
{
cx
(
styles
.
btn
,
styles
.
fit
)
}
>
<
div
className=
{
cx
(
styles
.
btn
,
styles
.
fit
)
}
onClick=
{
handleJump
}
>
<
LayoutOutlined
/>
<
label
>
渠道品类导航装修
</
label
>
</
div
>
...
...
src/pages/editor/mobileSettingPanel/propsSettings/index.tsx
View file @
090b9e46
...
...
@@ -27,11 +27,11 @@ interface PropsSettingsPropsType {
}
const
PropsSettings
:
React
.
FC
<
PropsSettingsPropsType
>
=
(
props
)
=>
{
const
{
selectedInfo
,
pageConfig
}
=
props
const
{
selectedInfo
,
shopId
,
pageConfig
}
=
props
const
renderSettingItem
=
()
=>
{
const
{
props
:
initProps
,
propsConfig
,
parentKey
}
=
selectedInfo
||
{};
const
_props
=
{
...
initProps
,
...
props
,
selectedKey
:
selectedInfo
?.
selectedKey
}
const
_props
=
{
...
initProps
,
shopId
,
selectedKey
:
selectedInfo
?.
selectedKey
}
const
componentType
=
propsConfig
?.
componentType
if
(
componentType
)
{
...
...
src/pages/mobileTemplate/categoryNavigation/common/hooks/useGetLayout.tsx
View file @
090b9e46
...
...
@@ -18,6 +18,7 @@ const getData = async () => {
function
useGetLayout
()
{
const
[
info
,
setInfo
]
=
useState
<
any
>
(
null
);
const
{
id
}
=
usePageStatus
();
const
[
dataSourceFromRequest
,
setDataSourceFromRequest
]
=
useState
<
any
>
(
null
);
useEffect
(()
=>
{
if
(
!
id
)
{
...
...
@@ -29,9 +30,7 @@ function useGetLayout() {
templateId
:
id
});
if
(
code
===
1000
)
{
// setInfo(data);
setInfo
({});
console
.
log
(
data
);
setInfo
(
data
);
}
}
fetchData
();
...
...
@@ -40,7 +39,7 @@ function useGetLayout() {
if
(
info
===
null
)
{
return
;
}
const
dataFromRequest
=
{};
const
{
categoryAdornContent
}
=
info
;
const
{
category
=
[]
}
=
categoryAdornContent
||
{};
const
startKey
=
7
;
...
...
@@ -66,6 +65,7 @@ function useGetLayout() {
category
.
forEach
((
_item
,
_index
)
=>
{
const
tabName
=
"CustomizeTabs.TabItem"
;
const
configKey
=
startKey
+
_index
;
dataFromRequest
[
_item
.
id
]
=
_item
;
tabKeys
.
push
(
configKey
.
toString
());
// const children = Object.keys(_item.children);
// console.log(children);
...
...
@@ -123,11 +123,12 @@ function useGetLayout() {
...
cloneconfig
,
...
config
};
setDataSourceFromRequest
(
dataFromRequest
);
console
.
log
(
"newConfig"
,
newConfig
);
updatePageConfig
(
newConfig
);
},
[
info
]);
return
{
info
};
return
{
info
,
dataSourceFromRequest
};
}
export
default
useGetLayout
;
src/pages/mobileTemplate/categoryNavigation/components/EditPanel/editPanel.tsx
View file @
090b9e46
...
...
@@ -18,6 +18,7 @@ import FormilyUpload from '@/components/UploadFiles/FormilyUploadFiles';
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
getAuth
}
from
'@/utils/auth'
;
type
SettingPanelType
=
{
selectedInfo
:
SelectedInfoType
,
...
...
@@ -41,6 +42,7 @@ const ComponentSchema = {
const
formActions
=
createFormActions
();
const
{
onFieldInputChange$
}
=
FormEffectHooks
;
const
EditPanel
=
()
=>
{
const
userAuth
=
getAuth
();
const
fixtureContext
=
useContext
(
context
);
const
{
selectedInfo
,
pageConfig
,
activeKey
,
domKey
}
=
useSelector
<
SettingPanelType
,
STATE_PROPS
|
"activeKey"
|
"domKey"
>
([
'selectedInfo'
,
'pageConfig'
,
'activeKey'
,
"domKey"
]);
const
{
state
:
visible
,
toggle
:
setVisible
}
=
useToggle
(
true
);
...
...
@@ -72,7 +74,7 @@ const EditPanel = () => {
secondaryItem
:
{
secondary
:
selectedInfo
?.
props
?.
id
,
title
:
selectedInfo
?.
props
?.
name
,
icon
:
[{
name
:
selectedInfo
?.
props
?.
name
,
url
:
selectedInfo
?.
props
?.
icon
}],
icon
:
[{
name
:
selectedInfo
?.
props
?.
name
,
url
:
selectedInfo
?.
props
?.
icon
}]
.
filter
((
_item
)
=>
_item
.
url
!==
''
)
,
},
flashSale
:
{
blockTitle
:
selectedInfo
?.
props
.
title
...
...
@@ -148,6 +150,7 @@ const EditPanel = () => {
});
const
renderUploadChild
=
(
value
)
=>
{
console
.
log
(
value
);
const
target
=
value
[
0
];
return
(
<
div
className=
{
styles
.
image
}
>
...
...
@@ -165,10 +168,11 @@ const EditPanel = () => {
const
handleSubmit
=
(
values
)
=>
{
/** 如果是tab 类型修改 */
const
key
=
activeKey
===
null
?
domKey
:
selectedInfo
?.
selectedKey
||
domKey
;
const
componentType
:
keyof
typeof
ComponentSchema
=
activeKey
===
null
?
'
T
abItem'
:
(
selectedInfo
as
any
)?.
otherProps
?.
type
;
const
componentType
:
keyof
typeof
ComponentSchema
=
activeKey
===
null
?
'
t
abItem'
:
(
selectedInfo
as
any
)?.
otherProps
?.
type
;
console
.
log
(
values
);
const
formValueToProps
=
{
T
abItem
:
{
t
abItem
:
{
name
:
values
.
title
,
id
:
values
.
primary
},
...
...
@@ -211,7 +215,7 @@ const EditPanel = () => {
changeProps
({
treeKey
:
key
,
props
:
currentProps
,
title
:
values
?.
title
||
values
?.
name
||
values
?.
productName
||
values
.
branchN
ame
,
title
:
values
?.
title
||
values
?.
name
||
values
?.
rankProduct
?.
name
||
values
.
productName
||
values
?.
brand
?.
n
ame
,
});
setVisible
(
false
);
...
...
@@ -220,7 +224,8 @@ const EditPanel = () => {
const
fetchPrimaryOption
=
async
()
=>
{
const
{
data
,
code
}
=
await
PublicApi
.
getSearchChannelCommodityTemplateGetFirstCategoryListByMemberId
({
shopId
:
fixtureContext
!
.
shopId
?.
toString
()
shopId
:
fixtureContext
!
.
shopId
?.
toString
(),
memberId
:
userAuth
.
memberId
,
});
return
data
;
};
...
...
@@ -233,6 +238,7 @@ const EditPanel = () => {
const
{
data
,
code
}
=
await
PublicApi
.
getSearchChannelCommodityTemplateGetSecondCategoryListByMemberId
({
shopId
:
fixtureContext
!
.
shopId
?.
toString
(),
categoryId
:
activeKey
!
.
toString
(),
memberId
:
userAuth
.
memberId
,
});
if
(
code
===
1000
)
{
const
source
=
data
.
map
((
_item
)
=>
({
label
:
_item
.
name
,
value
:
_item
.
id
}));
...
...
@@ -263,9 +269,11 @@ const EditPanel = () => {
effects=
{
(
$
,
actions
)
=>
{
useAsyncSelect
(
'primary'
,
fetchPrimaryOption
,
[
"name"
,
"id"
]);
onFieldInputChange$
(
'*(primary, secondary)'
).
subscribe
(
fieldState
=>
{
const
{
originAsyncData
}
=
fieldState
;
const
target
=
originAsyncData
.
filter
((
_item
)
=>
_item
.
id
===
fieldState
.
value
)[
0
];
actions
.
setFieldValue
(
'title'
,
target
?.
name
);
console
.
log
(
originAsyncData
)
const
target
=
originAsyncData
.
filter
((
_item
)
=>
(
_item
.
id
===
fieldState
.
value
)
||
_item
.
value
===
fieldState
.
value
)[
0
];
actions
.
setFieldValue
(
'title'
,
target
?.
name
||
target
?.
label
);
});
}
}
...
...
src/pages/mobileTemplate/categoryNavigation/components/FormilyBrand/branchList.tsx
View file @
090b9e46
...
...
@@ -71,7 +71,7 @@ const BranchList = (props) => {
console
.
log
(
values
);
fetchData
({
shopId
:
fixtureContext
?.
shopId
.
toString
(),
c
ategoryId
:
categoryId
.
toString
,
c
ustomerCategoryId
:
categoryId
.
toString
()
,
current
:
current
.
toString
(),
pageSize
:
pageSize
.
toString
(),
});
...
...
@@ -84,7 +84,8 @@ const BranchList = (props) => {
};
const
fetchData
=
async
(
params
:
any
)
=>
{
const
{
data
,
code
}
=
await
PublicApi
.
getSearchCommodityTemplateGetBrandList
(
params
);
console
.
log
(
params
);
const
{
data
,
code
}
=
await
PublicApi
.
getSearchChannelCommodityTemplateGetBrandList
(
params
);
if
(
code
===
1000
)
{
setDataSource
(
data
.
data
);
setTotal
(
data
.
totalCount
);
...
...
@@ -95,9 +96,10 @@ const BranchList = (props) => {
if
(
!
visible
)
{
return
;
}
console
.
log
(
categoryId
);
fetchData
({
shopId
:
fixtureContext
?.
shopId
.
toString
(),
c
ategoryId
:
categoryId
.
toString
,
c
ustomerCategoryId
:
categoryId
.
toString
()
,
current
:
current
.
toString
(),
pageSize
:
pageSize
.
toString
(),
});
...
...
src/pages/mobileTemplate/categoryNavigation/components/FormilyCommodity/index.tsx
View file @
090b9e46
...
...
@@ -4,6 +4,7 @@ import { useSelector } from '@lingxi-disign/react';
import
{
context
}
from
'../../common/context/context'
;
import
{
Product
}
from
'@/pages/transaction/marketingAbility/marketingActivitiesManagement/activePage/fixtures/components/ProductPanel'
;
import
CommodityDrawer
from
'../CommodityDrawer'
;
import
{
getAuth
}
from
'@/utils/auth'
;
interface
Iprops
{
...
...
@@ -32,6 +33,7 @@ interface Iprops {
/** 普通商品 */
const
FormilyCommodity
:
React
.
FC
<
Iprops
>
&
{
isFieldComponent
:
boolean
}
=
(
props
:
Iprops
)
=>
{
const
{
value
,
mutators
}
=
props
;
const
userAuth
=
getAuth
();
/** 1 级分类 id */
const
{
activeKey
}
=
useSelector
<
any
,
"activeKey"
>
([
'activeKey'
]);
const
fixtureContext
=
useContext
(
context
);
...
...
@@ -67,6 +69,8 @@ const FormilyCommodity: React.FC<Iprops> & { isFieldComponent: boolean } = (prop
return
{
shopId
:
fixtureContext
?.
shopId
.
toString
(),
categoryId
:
activeKey
,
memberId
:
userAuth
.
memberId
,
memberRoleId
:
userAuth
.
memberRoleId
,
};
},
[
fixtureContext
?.
shopId
.
toString
(),
activeKey
]);
...
...
src/pages/mobileTemplate/categoryNavigation/components/Layout/Commodity/ProductContainer.tsx
View file @
090b9e46
...
...
@@ -8,7 +8,7 @@ const ProductContainer = (props) => {
marginRight
:
'-8px'
,
flexWrap
:
'wrap'
,
alignItems
:
'stretch'
,
minHeight
:
'20px'
};
const
itemStyle
=
{
paddingRight
:
'8px'
,
...
...
@@ -20,7 +20,7 @@ const ProductContainer = (props) => {
};
return
(
<
Container
card=
{
false
}
listStyle=
{
listStyle
as
any
}
itemStyle=
{
itemStyle
as
any
}
{
...
divProps
}
>
<
Container
card=
{
false
}
listStyle=
{
listStyle
as
any
}
itemStyle=
{
itemStyle
as
any
}
{
...
divProps
}
tooltipTitle=
"精选商品"
>
{
children
}
</
Container
>
);
...
...
src/pages/mobileTemplate/categoryNavigation/components/Layout/Container/index.tsx
View file @
090b9e46
import
React
,
{
CSSProperties
}
from
'react'
;
import
cs
from
'classnames'
;
import
{
Card
}
from
'antd'
;
import
{
Card
,
Tooltip
}
from
'antd'
;
import
styles
from
'./index.less'
;
import
CustomizeCard
from
'../Card'
;
...
...
@@ -12,11 +12,12 @@ interface Iprops {
card
?:
boolean
,
cardProps
?:
CardProps
,
listStyle
?:
CSSProperties
,
itemStyle
?:
CSSProperties
itemStyle
?:
CSSProperties
,
tooltipTitle
?:
string
,
}
const
Container
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
children
,
card
=
true
,
cardProps
=
{},
listStyle
=
{},
itemStyle
=
{}
}
=
props
;
const
{
children
,
card
=
true
,
cardProps
=
{},
listStyle
=
{},
itemStyle
=
{}
,
tooltipTitle
}
=
props
;
const
{
onClick
,
onDrag
,
onDragEnd
,
onDragEnter
,
onDragStart
,
onMouseOver
,
getOperateState
,
className
,
...
rest
}
=
props
as
any
;
const
divProps
=
{
onClick
,
onDrag
,
onDragEnd
,
onDragEnter
,
onDragStart
,
onMouseOver
...
...
@@ -45,21 +46,24 @@ const Container: React.FC<Iprops> = (props: Iprops) => {
</
div
>
</
CustomizeCard
>
)
||
(
<
div
className=
{
styles
.
list
}
style=
{
listStyle
}
>
{
React
.
Children
.
map
(
children
,
(
_child
,
_index
)
=>
{
if
(
_child
===
null
)
{
return
null
;
}
const
node
=
React
.
cloneElement
(
_child
);
return
(
<
div
key=
{
_index
}
className=
{
styles
.
item
}
style=
{
itemStyle
}
>
{
node
}
</
div
>
);
})
}
</
div
>
<
Tooltip
title=
{
tooltipTitle
}
>
<
div
className=
{
styles
.
list
}
style=
{
listStyle
}
>
{
React
.
Children
.
map
(
children
,
(
_child
,
_index
)
=>
{
if
(
_child
===
null
)
{
return
null
;
}
const
node
=
React
.
cloneElement
(
_child
);
return
(
<
div
key=
{
_index
}
className=
{
styles
.
item
}
style=
{
itemStyle
}
>
{
node
}
</
div
>
);
})
}
</
div
>
</
Tooltip
>
)
}
</
div
>
...
...
src/pages/mobileTemplate/categoryNavigation/components/Layout/SecondaryNavigation/index.less
View file @
090b9e46
...
...
@@ -17,9 +17,21 @@
margin-bottom: 12px;
.content {
width: 40p
x;
height: 40px
;
display: fle
x;
flex-direction: column
;
// background-color: red;
.image {
width: 40px;
height: 40px;
margin-bottom: 4px;
}
.name {
text-align: center;
color: '#601314'
}
}
.empty {
...
...
@@ -28,6 +40,8 @@
flex-direction: row;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
}
}
...
...
src/pages/mobileTemplate/categoryNavigation/components/Layout/SecondaryNavigation/index.tsx
View file @
090b9e46
...
...
@@ -64,8 +64,11 @@ const Item = (props) => {
return
(
<
div
className=
{
styles
.
item
}
>
<
div
{
...
divProps
}
className=
{
wrapClass
}
>
<
img
src=
{
icon
}
style=
{
{
width
:
'100%'
,
height
:
'100%'
}
}
/>
<
div
className=
{
wrapClass
}
>
<
div
{
...
divProps
}
style=
{
{
width
:
'40px'
}
}
>
<
img
src=
{
icon
}
className=
{
styles
.
image
}
/>
<
div
className=
{
styles
.
name
}
>
{
name
}
</
div
>
</
div
>
</
div
>
</
div
>
);
...
...
src/pages/mobileTemplate/categoryNavigation/components/Layout/Tabs/index.tsx
View file @
090b9e46
...
...
@@ -7,6 +7,7 @@ import { history } from 'umi';
import
styles
from
'./index.less'
;
import
{
context
}
from
'../../../common/context/context'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
getAuth
}
from
'@/utils/auth'
;
const
{
TabPane
}
=
Tabs
;
...
...
@@ -73,6 +74,7 @@ const getData = async (data: any) => {
const
CustomizeTabs
:
React
.
FC
<
Iprops
>
&
{
TabItem
:
typeof
TabItem
}
=
(
props
:
Iprops
)
=>
{
const
{
children
}
=
props
;
const
auth
=
getAuth
();
const
{
pageConfig
,
shopId
}
=
useSelector
([
'pageConfig'
,
'shopId'
]);
const
[
activeKey
,
setActiveKey
]
=
useState
<
string
>
(
"2"
);
const
[
hasRequestTabKey
,
setHasRequestTabKey
]
=
useState
<
string
[]
>
([]);
...
...
@@ -100,6 +102,8 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
shopId
:
shopId
,
current
:
1
,
pageSize
:
ids
?.
length
,
memberId
:
auth
.
memberId
,
memberRoleId
:
auth
.
memberRoleId
,
}
as
any
);
};
...
...
@@ -112,8 +116,9 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
shopId
:
shopId
,
current
:
1
,
pageSize
:
ids
.
length
,
memberId
:
auth
.
memberId
,
};
return
PublicApi
.
getSearchCommodityTemplateGetBrandList
(
postData
as
any
);
return
PublicApi
.
getSearchC
hannelC
ommodityTemplateGetBrandList
(
postData
as
any
);
};
/** 并行请求 */
...
...
@@ -197,7 +202,9 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
const
{
postData
,
dataSourceMap
,
domKeyMap2Type
}
=
createPostData
(
matches
!
[
2
]);
const
resultData
:
any
=
await
getAnyData
(
postData
);
setHasRequestTabKey
((
prev
)
=>
prev
.
concat
(
activeKey
));
// setHasRequestTabKey((prev) => prev.concat(activeKey));
const
concatActiveKey
=
hasRequestTabKey
.
concat
(
activeKey
);
setHasRequestTabKey
(
concatActiveKey
);
const
finalData
=
{};
const
keyToValue
=
{
suggestProduct
:
'label'
,
...
...
@@ -215,7 +222,6 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
secondary
:
secondaryData
,
...
resultData
};
console
.
log
(
resultDataWithSecondary
);
const
cloneDeepPageConfig
=
cloneDeep
(
pageConfig
);
Object
.
keys
(
resultDataWithSecondary
).
forEach
((
_item
)
=>
{
const
parentKey
=
domKeyMap2Type
.
get
(
_item
);
...
...
@@ -255,7 +261,7 @@ const CustomizeTabs: React.FC<Iprops> & { TabItem: typeof TabItem } = (props: Ip
...
cloneDeepPageConfig
,
...
finalData
,
};
createActions
({
type
:
'onChangeTabKey'
,
payload
:
{
activeKey
:
matches
?.[
1
]
===
'undefined'
?
null
:
matches
?.[
1
]
,
domKey
:
matches
?.[
2
],
pageConfig
:
newConfigData
}
});
createActions
({
type
:
'onChangeTabKey'
,
payload
:
{
activeKey
:
matches
?.[
1
]
===
'undefined'
?
null
:
matches
?.[
1
]
,
domKey
:
matches
?.[
2
],
pageConfig
:
newConfigData
,
hasRequestTabKey
:
concatActiveKey
}
});
setActiveKey
(
activeKey
);
};
...
...
src/pages/mobileTemplate/categoryNavigation/components/Toolbar/toolbarSubmit.tsx
View file @
090b9e46
...
...
@@ -8,17 +8,18 @@ type SettingPanelType = {
}
interface
Iprops
{
onSubmit
?:
null
|
((
pageConfig
:
PageConfigType
)
=>
void
),
onSubmit
?:
null
|
((
pageConfig
:
PageConfigType
,
others
:
any
)
=>
void
),
children
:
React
.
ReactNode
,
loading
:
boolean
loading
:
boolean
,
dataConfig
?:
string
[],
}
const
ToolbarSubmit
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
pageConfig
}
=
useSelector
<
SettingPanelType
,
STATE_PROPS
>
([
'pageConfig'
])
;
const
{
onSubmit
=
null
,
children
,
loading
}
=
props
;
const
{
onSubmit
=
null
,
children
,
loading
,
dataConfig
=
[
"pageConfig"
]
}
=
props
;
const
{
pageConfig
,
...
rest
}
=
useSelector
<
SettingPanelType
,
STATE_PROPS
>
(
dataConfig
as
any
)
;
const
handleCilck
=
()
=>
{
onSubmit
?.(
pageConfig
);
onSubmit
?.(
pageConfig
,
rest
);
};
return
(
...
...
src/pages/mobileTemplate/categoryNavigation/index.tsx
View file @
090b9e46
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Spin
,
message
}
from
'antd'
;
import
{
BrickProvider
,
createActions
,
ModuleTree
}
from
'@lingxi-disign/react'
;
import
{
history
}
from
'umi'
;
...
...
@@ -54,9 +54,19 @@ const keyFunc = {
}
};
const
TITLE_MAP
=
{
secondary
:
"二级品类"
,
flashSale
:
'限时抢购'
,
saleRanking
:
'销量排行'
,
brand
:
'品牌精选'
,
suggestProduct
:
'精选商品'
};
const
CategoryNavigation
=
()
=>
{
const
{
info
}
=
useGetLayout
();
const
{
info
,
dataSourceFromRequest
}
=
useGetLayout
();
const
{
shopId
,
id
}
=
usePageStatus
();
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
useEffect
(()
=>
{
if
(
!
info
)
{
return
;
...
...
@@ -64,14 +74,20 @@ const CategoryNavigation = () => {
createActions
({
type
:
'onChangeShopId'
,
payload
:
{
shopId
:
shopId
}
});
},
[
info
]);
const
onSave
=
async
(
pageConfig
)
=>
{
const
onSave
=
async
(
pageConfig
,
rest
)
=>
{
const
hasRequestTabKey
=
rest
.
hasRequestTabKey
.
map
((
_item
:
string
)
=>
_item
.
match
(
/id_
(
.*
)\/\.\$(\d
+
)
/
)?.[
1
]);
/** domKey 从7开始都是tab 的值 */
const
tabChildren
=
pageConfig
[
4
].
childNodes
.
slice
(
1
);
setLoading
(
true
);
const
result
=
tabChildren
.
map
((
_nodeKey
)
=>
{
if
(
!
pageConfig
[
_nodeKey
])
{
return
;
}
const
{
id
,
name
,
visible
=
true
}
=
pageConfig
[
_nodeKey
].
props
;
if
(
!
hasRequestTabKey
.
includes
(
id
.
toString
()))
{
return
dataSourceFromRequest
[
id
];
}
const
tabProps
=
{
id
,
name
,
...
...
@@ -85,7 +101,7 @@ const CategoryNavigation = () => {
const
rest
=
type
===
'suggestProduct'
?
{
type
:
props
.
type
,
num
:
props
.
num
}
:
{};
tabItemData
[
type
]
=
{
title
:
props
?.
title
||
'标题'
,
title
:
props
?.
title
||
TITLE_MAP
[
type
]
,
...
rest
,
children
:
childNodes
.
map
((
_son
)
=>
{
const
sonData
=
pageConfig
[
_son
];
...
...
@@ -98,12 +114,12 @@ const CategoryNavigation = () => {
tabProps
[
'children'
]
=
tabItemData
;
return
tabProps
;
});
console
.
log
(
result
);
const
postData
=
{
style
:
0
,
category
:
result
};
const
{
data
,
code
}
=
await
PublicApi
.
postTemplateAdornAppChannelSave
({
templateId
:
Number
(
id
),
categoryAdornContent
:
postData
as
any
,
});
setLoading
(
false
);
if
(
code
===
1000
)
{
history
.
goBack
();
}
...
...
@@ -120,7 +136,7 @@ const CategoryNavigation = () => {
customReducer=
{
customReducer
}
>
<
div
className=
{
styles
[
'wrapper'
]
}
>
<
Toolbar
title=
"正在编辑:品类导航页"
extra=
{
<
ToolbarSubmit
loading=
{
false
}
onSubmit=
{
onSave
}
>
保存
</
ToolbarSubmit
>
}
/>
<
Toolbar
title=
"正在编辑:品类导航页"
extra=
{
<
ToolbarSubmit
loading=
{
loading
}
dataConfig=
{
[
'pageConfig'
,
'hasRequestTabKey'
]
}
onSubmit=
{
onSave
}
>
保存
</
ToolbarSubmit
>
}
/>
<
div
className=
{
styles
[
'content'
]
}
>
<
div
className=
{
styles
.
tree
}
>
<
ModuleTree
/>
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_1.tsx
View file @
090b9e46
...
...
@@ -7,13 +7,15 @@ const columns_1 = ({
setDataSource
,
handleDelete
,
form
,
current
})
=>
{
/** 输入 */
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
if
(
_i
===
index
)
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
...
...
@@ -73,88 +75,97 @@ const columns_1 = ({
</
Tooltip
>,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`activityPrice_${index}`
}
rules=
{
[{
required
:
true
,
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'请输入活动价格'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`activityPrice_${_index}`
}
rules=
{
[{
required
:
true
,
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'请输入活动价格'
));
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
}
}]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
index
)
}
/>
</
Form
.
Item
>
)
}]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${index}`
}
dependencies=
{
[
`restrictTotalNum_${index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${_index}`
}
dependencies=
{
[
`restrictTotalNum_${_index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
/>
</
Form
.
Item
>
)
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
}
return
Promise
.
resolve
();
}
return
Promise
.
resolve
();
}
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
/>
</
Form
.
Item
>
)
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'操作'
,
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_2.tsx
View file @
090b9e46
...
...
@@ -7,6 +7,7 @@ const columns_2 = ({
setDataSource
,
handleDelete
,
form
,
current
})
=>
{
const
sumTotal
=
(
price
,
num
)
=>
{
return
(
Number
(
price
)
-
Number
(
num
))
...
...
@@ -16,7 +17,8 @@ const columns_2 = ({
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
if
(
_i
===
index
)
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
if
(
name
===
'plummetPrice'
)
{
return
{
...
_item
,
...
...
@@ -84,27 +86,30 @@ const columns_2 = ({
</
Tooltip
>,
key
:
'plummetPrice'
,
dataIndex
:
'plummetPrice'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`plummetPrice_${index}`
}
rules=
{
[{
required
:
true
,
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'请输入活动价格'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`plummetPrice_${_index}`
}
rules=
{
[{
required
:
true
,
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'请输入活动价格'
));
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
}
}]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'plummetPrice'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'plummetPrice'
,
index
)
}
/>
</
Form
.
Item
>
)
}]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'plummetPrice'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'plummetPrice'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动价格'
,
...
...
@@ -116,62 +121,68 @@ const columns_2 = ({
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${index}`
}
dependencies=
{
[
`restrictTotalNum_${index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${_index}`
}
dependencies=
{
[
`restrictTotalNum_${_index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
/>
</
Form
.
Item
>
)
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
}
return
Promise
.
resolve
();
}
return
Promise
.
resolve
();
}
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
/>
</
Form
.
Item
>
)
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'操作'
,
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_3.tsx
View file @
090b9e46
...
...
@@ -7,13 +7,15 @@ const columns_3 = ({
setDataSource
,
handleDelete
,
form
,
current
})
=>
{
/** 输入 */
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
if
(
_i
===
index
)
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
if
(
name
===
'discount'
)
{
return
{
...
_item
,
...
...
@@ -81,29 +83,32 @@ const columns_3 = ({
</
Tooltip
>,
key
:
'discount'
,
dataIndex
:
'discount'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`discount_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入折扣'
},
()
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
if
(
!
pattern
.
test
(
value
))
{
return
Promise
.
reject
(
new
Error
(
'折扣必须大于0'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`discount_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入折扣'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonAfter=
"折"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'discount'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'discount'
,
index
)
}
/>
</
Form
.
Item
>
)
()
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
if
(
!
pattern
.
test
(
value
))
{
return
Promise
.
reject
(
new
Error
(
'折扣必须大于0'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonAfter=
"折"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'discount'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'discount'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动价格'
,
...
...
@@ -115,62 +120,68 @@ const columns_3 = ({
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${index}`
}
dependencies=
{
[
`restrictTotalNum_${index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${_index}`
}
dependencies=
{
[
`restrictTotalNum_${_index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
/>
</
Form
.
Item
>
)
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
}
return
Promise
.
resolve
();
}
return
Promise
.
resolve
();
}
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
/>
</
Form
.
Item
>
)
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'操作'
,
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_4.tsx
View file @
090b9e46
...
...
@@ -8,13 +8,15 @@ const columns_4 = ({
form
,
handlCollocation
,
value
,
current
})
=>
{
/** 输入 */
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
if
(
_i
===
index
)
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
...
...
@@ -71,62 +73,68 @@ const columns_4 = ({
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${index}`
}
dependencies=
{
[
`restrictTotalNum_${index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${_index}`
}
dependencies=
{
[
`restrictTotalNum_${_index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
/>
</
Form
.
Item
>
)
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
}
return
Promise
.
resolve
();
}
return
Promise
.
resolve
();
}
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
/>
</
Form
.
Item
>
)
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'操作'
,
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_5.tsx
View file @
090b9e46
import
React
from
'react'
;
import
{
Image
,
Form
,
Input
,
Popconfirm
,
Typography
}
from
'antd'
;
const
columns_5
=
({
const
columns_5
=
({
dataSource
,
setDataSource
,
handleDelete
,
form
,
current
})
=>
{
/** 输入 */
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
if
(
_i
===
index
)
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
...
...
@@ -69,88 +71,97 @@ const columns_5 = ({
title
:
'团购价格'
,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`activityPrice_${index}`
}
rules=
{
[{
required
:
true
,
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'请输入团购价格'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`activityPrice_${_index}`
}
rules=
{
[{
required
:
true
,
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
if
(
!
value
)
{
return
Promise
.
reject
(
new
Error
(
'请输入团购价格'
));
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
}
if
(
!
pattern
.
test
(
value
)
||
(
Number
(
value
)
>=
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于商品价格'
));
}
return
Promise
.
resolve
();
}
}]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
index
)
}
/>
</
Form
.
Item
>
)
}]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${index}`
}
dependencies=
{
[
`restrictTotalNum_${index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${_index}`
}
dependencies=
{
[
`restrictTotalNum_${_index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
/>
</
Form
.
Item
>
)
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
}
return
Promise
.
resolve
();
}
return
Promise
.
resolve
();
}
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
/>
</
Form
.
Item
>
)
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'操作'
,
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_6.tsx
View file @
090b9e46
This diff is collapsed.
Click to expand it.
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_7.tsx
View file @
090b9e46
...
...
@@ -7,13 +7,15 @@ const columns_7 = ({
setDataSource
,
handleDelete
,
form
,
current
})
=>
{
/** 输入 */
const
handleInputChange
=
(
e
,
name
,
index
)
=>
{
const
{
value
}
=
e
.
target
;
const
params
=
[...
dataSource
];
const
newData
=
params
.
map
((
_item
,
_i
)
=>
{
if
(
_i
===
index
)
{
const
_idx
=
Number
(((
current
-
1
)
*
10
)
+
_i
);
if
(
_idx
===
index
)
{
return
{
...
_item
,
[
name
]:
Number
(
value
)
...
...
@@ -73,93 +75,102 @@ const columns_7 = ({
</
Tooltip
>,
key
:
'activityPrice'
,
dataIndex
:
'activityPrice'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`activityPrice_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入秒杀价格'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
if
(
!
pattern
.
test
(
value
))
{
return
Promise
.
reject
(
new
Error
(
'最多保留4位小数'
));
}
if
((
Number
(
value
)
>
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于等于商品价格'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
name=
{
`activityPrice_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入秒杀价格'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
index
)
}
/>
</
Form
.
Item
>
)
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,4}
)?
$/
;
if
(
!
pattern
.
test
(
value
))
{
return
Promise
.
reject
(
new
Error
(
'最多保留4位小数'
));
}
if
((
Number
(
value
)
>
Number
(
_record
.
price
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于等于商品价格'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
addonBefore=
"¥"
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'activityPrice'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'个人限购数量'
,
key
:
'restrictNum'
,
dataIndex
:
'restrictNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${index}`
}
dependencies=
{
[
`restrictTotalNum_${index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictNum_${_index}`
}
dependencies=
{
[
`restrictTotalNum_${_index}`
]
}
rules=
{
[{
required
:
true
,
message
:
'请输入个人限购数量'
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
index
)
}
/>
</
Form
.
Item
>
)
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictTotalNum
=
getFieldValue
(
`restrictTotalNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
<
Number
(
restrictTotalNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且小于活动限购总数量'
));
}
return
Promise
.
resolve
();
},
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'活动限购总数量'
,
key
:
'restrictTotalNum'
,
dataIndex
:
'restrictTotalNum'
,
render
:
(
_text
,
_record
,
index
)
=>
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
render
:
(
_text
,
_record
,
index
)
=>
{
const
_index
=
Number
(((
current
-
1
)
*
10
)
+
index
);
return
(
<
Form
.
Item
style=
{
{
marginBottom
:
0
}
}
initialValue=
{
_text
}
validateFirst
name=
{
`restrictTotalNum_${_index}`
}
rules=
{
[{
required
:
true
,
message
:
'请输入活动限购总数量'
},
({
getFieldValue
})
=>
({
validator
:
(
_rule
,
value
)
=>
{
const
pattern
=
/^
(\-)?\d
+
(\.\d
{1,3}
)?
$/
;
const
restrictNum
=
getFieldValue
(
`restrictNum_${_index}`
);
if
(
!
pattern
.
test
(
value
)
||
!
(
Number
(
value
)
>
Number
(
restrictNum
)))
{
return
Promise
.
reject
(
new
Error
(
'必须大于0且大于个人限购数量'
));
}
return
Promise
.
resolve
();
}
return
Promise
.
resolve
();
}
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
index
)
}
/>
</
Form
.
Item
>
)
})
]
}
>
<
Input
style=
{
{
width
:
'112px'
}
}
onPressEnter=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
onBlur=
{
(
e
)
=>
handleInputChange
(
e
,
'restrictTotalNum'
,
_index
)
}
/>
</
Form
.
Item
>
)
}
},
{
title
:
'操作'
,
...
...
src/pages/transaction/marketingAbility/components/productListLayout/columns/columns_8.tsx
View file @
090b9e46
This diff is collapsed.
Click to expand it.
src/pages/transaction/marketingAbility/components/productListLayout/index.tsx
View file @
090b9e46
...
...
@@ -8,6 +8,7 @@ import ListModalLayout from '@/pages/transaction/marketingAbility/components/lis
import
CollocationLayout
from
'@/pages/transaction/marketingAbility/components/collocationLayout'
;
import
{
remindLayout
,
RemindLayoutProps
}
from
'@/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/components/productListLayout/remind'
;
import
CouponsListLayout
from
'@/pages/transaction/marketingAbility/components/couponsListLayout'
;
import
{
number
}
from
'yargs'
;
type
optionProps
=
{
/** key */
...
...
@@ -42,15 +43,18 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
const
[
skuId
,
setSkuId
]
=
useState
<
number
>
(
0
);
// 当前设置商品的id
const
[
remind
,
setRemind
]
=
useState
<
RemindLayoutProps
>
({});
const
[
collocation
,
setCollocation
]
=
useState
<
any
[]
>
([]);
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
);
const
handlesStFieldsValue
=
()
=>
{
const
params
=
[...
dataSource
];
const
_pagination
=
(
current
-
1
)
*
10
;
params
.
forEach
((
_item
,
_i
)
=>
{
const
index
=
Number
(
_pagination
+
_i
)
form
.
setFieldsValue
({
[
`plummetPrice_
${
_i
}
`
]:
_item
.
plummetPrice
,
[
`activityPrice_
${
_i
}
`
]:
_item
.
activityPrice
,
[
`restrictNum_
${
_i
}
`
]:
_item
.
restrictNum
,
[
`restrictTotalNum_
${
_i
}
`
]:
_item
.
restrictTotalNum
,
[
`plummetPrice_
${
index
}
`
]:
_item
.
plummetPrice
,
[
`activityPrice_
${
index
}
`
]:
_item
.
activityPrice
,
[
`restrictNum_
${
index
}
`
]:
_item
.
restrictNum
,
[
`restrictTotalNum_
${
index
}
`
]:
_item
.
restrictTotalNum
,
})
})
}
...
...
@@ -87,8 +91,8 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
}
const
columns
=
useMemo
(()
=>
{
return
Columns
[
value
]?.({
dataSource
,
setDataSource
,
handleDelete
,
form
,
setIdNotInList
,
handlCollocation
,
value
})
},
[
value
,
dataSource
])
return
Columns
[
value
]?.({
dataSource
,
setDataSource
,
handleDelete
,
form
,
setIdNotInList
,
handlCollocation
,
value
,
current
})
},
[
value
,
dataSource
,
current
])
const
toggle
=
(
flag
:
boolean
)
=>
{
const
activityDefined
=
form
.
getFieldValue
(
'activityDefined'
)
||
getActivityDefinedBO
;
...
...
@@ -179,6 +183,10 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
setDataSource
(
fields
)
}
const
handleOnShowSizeChange
=
(
current
,
_size
)
=>
{
setCurrent
(
current
)
}
return
(
<
CardLayout
id=
"productListLayout"
...
...
@@ -195,6 +203,7 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
dataSource=
{
dataSource
}
pagination=
{
{
size
:
'small'
,
onChange
:
handleOnShowSizeChange
}
}
/>
{
/* 选择活动商品 */
}
...
...
src/pages/transaction/marketingAbility/selfManagement/readySubmitExamine/add.tsx
View file @
090b9e46
...
...
@@ -78,6 +78,7 @@ const AddedMarketing = () => {
roleType
:
item
.
roleId
,
roleTypeName
:
item
.
roleName
,
level
:
item
.
level
,
levelTyp
:
item
.
levelType
,
levelTypeName
:
item
.
levelTypeName
,
levelTag
:
item
.
levelTag
,
}
...
...
src/pages/transaction/marketingAbility/selfManagement/readySubmitExamine/components/basicInfoLayout/index.tsx
View file @
090b9e46
...
...
@@ -123,6 +123,7 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
]
}
>
<
DatePicker
showTime
showNow=
{
false
}
allowClear
disabledDate=
{
(
current
)
=>
startTimeDisabled
(
current
,
'endTime'
)
}
/>
...
...
@@ -133,6 +134,7 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
rules=
{
[{
required
:
true
,
message
:
'请选择活动结束时间'
}]
}
>
<
DatePicker
showTime
showNow=
{
false
}
allowClear
disabledDate=
{
(
current
)
=>
endTimeDisabled
(
current
,
'startTime'
)
}
/>
...
...
src/pages/transaction/marketingAbility/selfManagement/readySubmitExamine/components/partakeUserLayout/index.tsx
View file @
090b9e46
...
...
@@ -131,7 +131,6 @@ const PartakeUserLayout: React.FC<PartakeUserLayoutProps> = (props: any) => {
</
Checkbox
.
Group
>
</
Form
.
Item
>
)
}
</
CardLayout
>
)
}
...
...
src/pages/transaction/marketingAbility/selfManagement/readySubmitExamine/components/rulesLayout/index.tsx
View file @
090b9e46
This diff is collapsed.
Click to expand it.
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