Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
project
jinfa-admin
Commits
307bc0ab
Commit
307bc0ab
authored
Aug 17, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat(支付参数配置): 修改提交参数
parent
5b7edf3f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
16 deletions
+66
-16
index.ts
config/routes/index.ts
+1
-2
ruleSettingRoutes.ts
config/routes/ruleSettingRoutes.ts
+3
-2
modal.tsx
src/pages/ruleSettingManage/paySetting/components/modal.tsx
+11
-1
index.tsx
src/pages/ruleSettingManage/paySetting/index.tsx
+50
-10
index.tsx
src/pages/ruleSettingManage/payStrategy/index.tsx
+1
-1
No files found.
config/routes/index.ts
View file @
307bc0ab
...
...
@@ -16,7 +16,7 @@
// import demandQuoteOrderRoute from './demandQuoteOrderRoute' //需求报价单管理
// import logisticsRoutes from './logisticsRoutes'
// import memberAbility from './memberAbility'
import
ruleSettingRoutes
from
'./ruleSettingRoutes'
//
import ruleSettingRoutes from './ruleSettingRoutes'
// import authConfig from './authConfig'
// import rfqRoute from './rfqRoute' // 询价单路由
// import rfqOfferRoute from './rfqOfferRoute' // 询价单路由
...
...
@@ -108,7 +108,6 @@ const router = [
// },
// ...routeList,
// merchantMarketingRoute,
ruleSettingRoutes
,
marketingRoutes
,
// platformCouponManageRoute,
...
asyncRoutes
,
...
...
config/routes/ruleSettingRoutes.ts
View file @
307bc0ab
...
...
@@ -39,8 +39,9 @@ const router = {
{
path
:
'/ruleSettingManager/paySetting'
,
name
:
'paySetting'
,
component
:
'@/pages/ruleSettingManage/paySetting/settingIndex'
,
hidePageHeader
:
true
component
:
'@/pages/ruleSettingManage/paySetting'
,
hidePageHeader
:
true
,
noMargin
:
true
,
},
{
path
:
'/ruleSettingManager/transactionRules'
,
...
...
src/pages/ruleSettingManage/paySetting/components/modal.tsx
View file @
307bc0ab
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
{
Modal
,
Form
,
Select
,
Input
}
from
'antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
isEmpty
}
from
'@/components/NiceForm/components/AntUpload/shared'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
...
...
@@ -25,7 +26,7 @@ interface ModalProps {
value
?:
string
,
/** 描述 */
remark
?:
String
}
[]
,
},
/** 确定 */
onConfirm
:
(
e
)
=>
void
,
/** 取消 */
...
...
@@ -79,6 +80,15 @@ const ModalLayout: React.FC<ModalProps> = ({
})
}
useEffect
(()
=>
{
if
(
!
isEmpty
(
value
))
{
console
.
log
(
value
)
form
.
setFieldsValue
({
...
value
})
}
},
[
value
])
return
(
<
Modal
width=
{
576
}
...
...
src/pages/ruleSettingManage/paySetting/index.tsx
View file @
307bc0ab
import
React
,
{
useEffect
,
useState
,
Fragment
}
from
'react'
;
import
PeripheralLayout
from
'@/components/DetailLayout'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
Tabs
,
Form
,
Button
,
Radio
,
Table
,
Space
,
Image
}
from
'antd'
;
import
{
Tabs
,
Form
,
Button
,
Radio
,
Table
,
Space
,
Image
,
Popconfirm
}
from
'antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
Card
from
'@/components/Card'
;
import
style
from
'./index.less'
;
...
...
@@ -42,6 +42,8 @@ type parameters = {
value
?:
string
,
/** remark */
remark
?:
string
/** key */
key
?:
string
}
type
channels
=
{
...
...
@@ -62,9 +64,12 @@ const PaySettingLayout = () => {
const
[
visible
,
setVisible
]
=
useState
<
boolean
>
(
false
);
const
[
tabLink
,
setTabLink
]
=
useState
<
TabLink
>
([])
const
[
parameterFind
,
setParameterFind
]
=
useState
<
any
[]
>
([]);
const
[
payChannel
,
setPayChannel
]
=
useState
<
string
>
(
''
);
const
[
payChannel
,
setPayChannel
]
=
useState
<
string
>
(
'
1
'
);
const
[
parameters
,
setParameters
]
=
useState
<
FindProps
[]
>
([]);
// 提交的数据
const
[
channel
,
setChannel
]
=
useState
<
number
[]
>
([]);
// 已勾选配置的支付渠道枚举值
const
[
value
,
setValue
]
=
useState
<
parameters
>
({});
const
[
isEdit
,
setIsEdit
]
=
useState
<
boolean
>
(
false
);
const
[
editIndex
,
setEditIndex
]
=
useState
<
number
>
(
0
);
const
columns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -86,9 +91,17 @@ const PaySettingLayout = () => {
title
:
'操作'
,
key
:
'options'
,
dataIndex
:
'options'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
<>
<
Button
type=
'link'
>
编辑
</
Button
>
<
Button
type=
'link'
>
删除
</
Button
>
render
:
(
_
:
any
,
record
:
any
,
index
:
number
)
=>
<>
<
Button
type=
'link'
onClick=
{
()
=>
handleEdit
(
record
,
index
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要执行这个操作?"
onConfirm=
{
()
=>
handleDelete
(
index
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
'link'
>
删除
</
Button
>
</
Popconfirm
>
</>
}
]
...
...
@@ -106,7 +119,7 @@ const PaySettingLayout = () => {
}))
/** 组合数据 */
const
params
:
FindProps
[]
=
[]
const
_channel
:
number
[]
=
[]
const
_channel
:
number
[]
=
[]
data
.
forEach
(
item
=>
{
const
_obj
:
FindProps
=
{}
_obj
.
payType
=
item
.
payType
;
...
...
@@ -189,16 +202,39 @@ const PaySettingLayout = () => {
const
_channels
=
[...
item
.
channels
]
_channels
.
forEach
(
_item
=>
{
if
(
_item
.
payChannel
===
Number
(
payChannel
))
{
_item
.
parameters
.
push
(
format
)
if
(
isEdit
)
{
_item
.
parameters
[
editIndex
]
=
format
;
}
else
{
_item
.
parameters
.
push
(
format
)
}
}
})
})
setIsEdit
(
false
);
setParameters
(
_parameters
);
setVisible
(
false
);
}
/** 删除支付参数 */
const
handleDelete
=
(
index
)
=>
{
const
_parameters
=
[...
parameters
];
_parameters
.
forEach
((
item
:
any
)
=>
{
const
_channels
=
[...
item
.
channels
]
_channels
.
forEach
(
_item
=>
{
if
(
_item
.
payChannel
===
Number
(
payChannel
))
{
_item
.
parameters
.
splice
(
index
,
1
)
}
})
})
setParameters
(
_parameters
);
}
/** 编辑支付参数 */
const
handleEdit
=
()
=>
{
}
const
handleEdit
=
(
record
,
index
)
=>
{
setValue
(
record
);
setEditIndex
(
index
);
setIsEdit
(
true
)
setVisible
(
true
);
}
const
dataSource
=
(
payType
,
_payChannel
)
=>
{
let
_parameters
:
any
=
[];
...
...
@@ -210,6 +246,9 @@ const PaySettingLayout = () => {
return
[...
_parameters
]
}
const
handleTabsChange
=
(
activeKey
)
=>
{
setPayChannel
(
activeKey
)
}
return
(
<
PeripheralLayout
...
...
@@ -237,7 +276,7 @@ const PaySettingLayout = () => {
>
<
div
className=
{
style
.
tabsLayout
}
>
{
item
.
payType
===
1
&&
(
<
Tabs
>
<
Tabs
onChange=
{
handleTabsChange
}
>
{
item
.
channels
.
map
((
_item
,
_index
)
=>
(
<
TabPane
tab=
{
<
Space
><
Image
preview=
{
false
}
width=
{
16
}
height=
{
16
}
src=
{
PIC_MAP
[
_item
.
payChannel
]
}
/>
{
_item
.
payChannelName
}
</
Space
>
}
key=
{
_item
.
payChannel
}
forceRender
>
<
Form
.
Item
...
...
@@ -318,6 +357,7 @@ const PaySettingLayout = () => {
))
}
</
Form
>
<
ModalLayout
value=
{
value
}
visible=
{
visible
}
payChannel=
{
payChannel
}
onConfirm=
{
handleConfirm
}
...
...
src/pages/ruleSettingManage/payStrategy/index.tsx
View file @
307bc0ab
...
...
@@ -88,7 +88,7 @@ const List: React.FC<{}> = () => {
<
Card
>
<
StandardTable
currentRef=
{
ref
}
tableProps=
{
{
rowKey
:
'
i
d'
}
}
tableProps=
{
{
rowKey
:
'
paymentI
d'
}
}
columns=
{
columns
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
formilyLayouts=
{
{
...
...
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