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
d57e90fc
Commit
d57e90fc
authored
Sep 24, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
c5ac6107
34637341
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 @
d57e90fc
...
...
@@ -52,8 +52,8 @@ const transferLabelToValue = (list: any[], label: string, value: string) => {
})
}
const
BUSINESS_INTEGRATE
=
[
1
,
2
];
const
CANAL
=
[
3
,
4
,
5
]
const
BUSINESS_INTEGRATE
=
[
1
,
2
];
// 企业商城, 积分商城
const
CANAL
=
[
3
,
4
,
5
]
;
// 渠道商城
const
PositionSetting
:
React
.
FC
<
PositionSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
,
onFieldChange
=
()
=>
{}
}
=
props
...
...
@@ -72,7 +72,8 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
[
productState
,
setProductState
]
=
useState
<
any
>
({})
const
[
membersFilterState
,
setMemberFilter
]
=
useState
({
level
:
[],
role
:
[],
type
:
[]});
const
[
initValue
,
setInitialValue
]
=
useState
({});
const
[
membersLength
,
setMembersLength
]
=
useState
(
0
)
const
[
membersLength
,
setMembersLength
]
=
useState
(
0
);
// const [channelMemberState, setChannelMemberState] = useState({channelMemberRoleId: '', channelMemberIdList: []})
// useUnitPreview(initValue, addSchemaAction)
...
...
@@ -83,14 +84,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
{
levels
=
[],
memberTypes
=
[],
roles
=
[]
}
=
response
.
data
;
const
allLevels
=
all
.
concat
(
transferLabelToValue
(
levels
,
"levelTag"
,
"level"
));
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
)
=>
{
return
{
...
state
,
level
:
allLevels
,
role
:
allMemberTyp
es
,
type
:
all
Rol
es
// role: allRol
es,
type
:
all
MemberTyp
es
}
})
}
...
...
@@ -235,24 +236,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
fetchMemberList
=
async
(
params
)
=>
{
const
shopType
=
addSchemaAction
.
getFieldValue
(
'shopType'
);
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上memberResponseList
const
{
memberResponseList
}
=
productState
;
if
(
CANAL
.
includes
(
shopType
)
&&
memberResponseList
==
null
)
{
// 如果为空的话那我就不调用了
return
{
code
:
200
,
message
:
''
,
data
:
{
data
:
[],
totalCount
:
[]
}
}
}
// 当商城类型为 渠道商城、渠道自由商城和渠道积分商城时,需要带上下面两个参数
const
{
channelMemberIdList
,
channelMemberRoleId
}
=
productState
;
const
data
=
{
...
params
,
shopType
:
shopType
,
member
s
:
memberResponse
List
,
member
Ids
:
channelMemberId
List
,
roleId
:
channelMemberRoleId
}
const
res
=
await
PublicApi
.
postMemberManageAllPageByshoptype
(
data
,
{
ctlType
:
'none'
});
return
res
.
data
...
...
@@ -374,15 +365,15 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
}
},
roleId
:
{
type
:
'string'
,
"x-component"
:
'Select'
,
"x-component-props"
:
{
options
:
membersFilterState
.
role
,
style
:
{
width
:
'180px'
},
placeholder
:
'请选择会员角色'
}
},
//
roleId: {
//
type: 'string',
//
"x-component": 'Select',
//
"x-component-props": {
//
options: membersFilterState.role,
//
style: {width: '180px'},
//
placeholder: '请选择会员角色'
//
}
//
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
...
...
@@ -501,9 +492,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
state
.
value
=
[]
})
}
return
parentState
.
value
});
// 商城类型修改的时候,就清空商品
addSchemaAction
.
setFieldValue
(
'productId'
,
""
);
addSchemaAction
.
setFieldValue
(
'productName'
,
""
);
}
})
// 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