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
34637341
Commit
34637341
authored
Sep 24, 2020
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改新增仓位
parent
1a3a0dea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
31 deletions
+24
-31
PositionSetting.tsx
src/pages/repositories/components/PositionSetting.tsx
+24
-31
No files found.
src/pages/repositories/components/PositionSetting.tsx
View file @
34637341
...
@@ -52,8 +52,8 @@ const transferLabelToValue = (list: any[], label: string, value: string) => {
...
@@ -52,8 +52,8 @@ const transferLabelToValue = (list: any[], label: string, value: string) => {
})
})
}
}
const
BUSINESS_INTEGRATE
=
[
1
,
2
];
const
BUSINESS_INTEGRATE
=
[
1
,
2
];
// 企业商城, 积分商城
const
CANAL
=
[
3
,
4
,
5
]
const
CANAL
=
[
3
,
4
,
5
]
;
// 渠道商城
const
PositionSetting
:
React
.
FC
<
PositionSettingProps
>
=
(
props
)
=>
{
const
PositionSetting
:
React
.
FC
<
PositionSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
...
@@ -72,7 +72,8 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
...
@@ -72,7 +72,8 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
[
productState
,
setProductState
]
=
useState
<
any
>
({})
const
[
productState
,
setProductState
]
=
useState
<
any
>
({})
const
[
membersFilterState
,
setMemberFilter
]
=
useState
({
level
:
[],
role
:
[],
type
:
[]});
const
[
membersFilterState
,
setMemberFilter
]
=
useState
({
level
:
[],
role
:
[],
type
:
[]});
const
[
initValue
,
setInitialValue
]
=
useState
({});
const
[
initValue
,
setInitialValue
]
=
useState
({});
const
[
membersLength
,
setMembersLength
]
=
useState
(
0
)
const
[
membersLength
,
setMembersLength
]
=
useState
(
0
);
// const [channelMemberState, setChannelMemberState] = useState({channelMemberRoleId: '', channelMemberIdList: []})
// useUnitPreview(initValue, addSchemaAction)
// useUnitPreview(initValue, addSchemaAction)
...
@@ -83,14 +84,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
...
@@ -83,14 +84,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
{
levels
=
[],
memberTypes
=
[],
roles
=
[]
}
=
response
.
data
;
const
{
levels
=
[],
memberTypes
=
[],
roles
=
[]
}
=
response
.
data
;
const
allLevels
=
all
.
concat
(
transferLabelToValue
(
levels
,
"levelTag"
,
"level"
));
const
allLevels
=
all
.
concat
(
transferLabelToValue
(
levels
,
"levelTag"
,
"level"
));
const
allMemberTypes
=
all
.
concat
(
transferLabelToValue
(
memberTypes
,
"memberTypeName"
,
"memberTypeId"
))
const
allMemberTypes
=
all
.
concat
(
transferLabelToValue
(
memberTypes
,
"memberTypeName"
,
"memberTypeId"
))
const
allRoles
=
all
.
concat
(
transferLabelToValue
(
roles
,
"roleName"
,
"roleId"
))
//
const allRoles = all.concat(transferLabelToValue(roles, "roleName", "roleId"))
setMemberFilter
((
state
)
=>
{
setMemberFilter
((
state
)
=>
{
return
{
return
{
...
state
,
...
state
,
level
:
allLevels
,
level
:
allLevels
,
role
:
allMemberTyp
es
,
// role: allRol
es,
type
:
all
Rol
es
type
:
all
MemberTyp
es
}
}
})
})
}
}
...
@@ -235,24 +236,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
...
@@ -235,24 +236,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
fetchMemberList
=
async
(
params
)
=>
{
const
fetchMemberList
=
async
(
params
)
=>
{
const
shopType
=
addSchemaAction
.
getFieldValue
(
'shopType'
);
const
shopType
=
addSchemaAction
.
getFieldValue
(
'shopType'
);
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上memberResponseList
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上下面两个参数
const
{
memberResponseList
}
=
productState
;
const
{
channelMemberIdList
,
channelMemberRoleId
}
=
productState
;
if
(
CANAL
.
includes
(
shopType
)
&&
memberResponseList
==
null
)
{
// 如果为空的话那我就不调用了
return
{
code
:
200
,
message
:
''
,
data
:
{
data
:
[],
totalCount
:
[]
}
}
}
const
data
=
{
const
data
=
{
...
params
,
...
params
,
shopType
:
shopType
,
shopType
:
shopType
,
member
s
:
memberResponse
List
,
member
Ids
:
channelMemberId
List
,
roleId
:
channelMemberRoleId
}
}
const
res
=
await
PublicApi
.
postMemberManageAllPageByshoptype
(
data
,
{
ctlType
:
'none'
});
const
res
=
await
PublicApi
.
postMemberManageAllPageByshoptype
(
data
,
{
ctlType
:
'none'
});
return
res
.
data
return
res
.
data
...
@@ -374,15 +365,15 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
...
@@ -374,15 +365,15 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
}
}
},
},
roleId
:
{
//
roleId: {
type
:
'string'
,
//
type: 'string',
"x-component"
:
'Select'
,
//
"x-component": 'Select',
"x-component-props"
:
{
//
"x-component-props": {
options
:
membersFilterState
.
role
,
//
options: membersFilterState.role,
style
:
{
width
:
'180px'
},
//
style: {width: '180px'},
placeholder
:
'请选择会员角色'
//
placeholder: '请选择会员角色'
}
//
}
},
//
},
submit
:
{
submit
:
{
"x-component"
:
'Submit'
,
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
"x-mega-props"
:
{
...
@@ -501,9 +492,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
...
@@ -501,9 +492,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
state
.
value
=
[]
state
.
value
=
[]
})
})
}
}
return
parentState
.
value
return
parentState
.
value
});
});
// 商城类型修改的时候,就清空商品
addSchemaAction
.
setFieldValue
(
'productId'
,
""
);
addSchemaAction
.
setFieldValue
(
'productName'
,
""
);
}
}
})
})
// FormEffectHooks.
// FormEffectHooks.
...
...
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