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
linweijiong
jinfa-platform
Commits
375678e3
Commit
375678e3
authored
Aug 26, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
转化商城类型
parent
a2c341bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
global.d.ts
src/global/config/global.d.ts
+0
-0
PositionSetting.tsx
src/pages/repositories/components/PositionSetting.tsx
+16
-13
index.tsx
src/pages/repositories/schema/index.tsx
+6
-5
No files found.
src/global/config/global.d.ts
~1610bddb1460cd81f648409972bfc813bc51b7ae
→
src/global/config/global.d.ts
View file @
375678e3
File moved
src/pages/repositories/components/PositionSetting.tsx
View file @
375678e3
...
...
@@ -11,7 +11,7 @@ import {
PlusOutlined
,
LinkOutlined
,
}
from
'@ant-design/icons'
import
{
Button
}
from
'antd'
import
{
Button
,
message
}
from
'antd'
import
NiceForm
from
'@/components/NiceForm'
import
ModalTable
from
'@/components/ModalTable'
import
{
GlobalConfig
}
from
'@/global/config'
...
...
@@ -27,10 +27,7 @@ const fetchMemberList = async (params) => {
return
res
.
data
}
const
fetchProductList
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
getProductCommodityGetCommodityDetailList
(
params
)
return
res
.
data
}
const
PositionSetting
:
React
.
FC
<
PositionSettingProps
>
=
(
props
)
=>
{
const
{
addSchemaAction
,
schema
,
formSubmit
}
=
props
...
...
@@ -47,6 +44,14 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
initValue
=
useInitValue
(
PublicApi
.
getWarehouseFreightSpaceDetails
)
useUnitPreview
(
initValue
,
addSchemaAction
)
const
fetchProductList
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
getProductCommodityCommonGetCommodityDetailList
({
...
params
,
shopType
:
addSchemaAction
.
getFieldValue
(
'shopType'
)
})
return
res
.
data
}
// 会员选择后的表格
const
handleDeleteTable
=
(
id
)
=>
{
const
value
=
addSchemaAction
.
getFieldValue
(
'applyMember'
)
...
...
@@ -62,6 +67,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
// 弹出商品选择
const
handleAddProductBtn
=
()
=>
{
const
shopType
=
addSchemaAction
.
getFieldValue
(
'shopType'
)
if
(
!
shopType
)
{
message
.
error
(
'请先选择商城类型'
)
return
false
}
productRowCtl
.
setSelectedRowKeys
([])
productRowCtl
.
setSelectRow
([])
setVisibleChannelRroduct
(
true
)
...
...
@@ -209,18 +219,11 @@ const PositionSetting:React.FC<PositionSettingProps> = (props) => {
const
formProduct
:
ISchema
=
{
type
:
'object'
,
properties
:
{
id
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
"x-component-props"
:
{
placeholder
:
'请输入商品ID'
}
},
name
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
"x-component-props"
:
{
placeholder
:
'请输入商品名称'
placeholder
:
'请输入商品名称
或者ID
'
}
}
}
...
...
src/pages/repositories/schema/index.tsx
View file @
375678e3
...
...
@@ -8,11 +8,12 @@ import { SHOP_TYPES } from '@/constants';
// 将获取的商城转化为可用类型
const
getShopTypeMap
=
(()
=>
{
return
GlobalConfig
.
web
.
shopInfo
.
reduce
((
prev
,
next
)
=>
{
if
(
!
prev
.
find
(
v
=>
v
.
value
===
next
.
id
))
{
prev
.
push
({
label
:
next
.
name
,
value
:
next
.
id
})
const
shopTypeEnumValue
=
SHOP_TYPES
.
find
(
v
=>
v
.
value
===
next
.
type
)
if
(
!
shopTypeEnumValue
)
{
return
prev
}
if
(
!
prev
.
find
(
v
=>
v
.
value
===
shopTypeEnumValue
.
value
))
{
prev
.
push
(
shopTypeEnumValue
)
}
return
prev
},
[])
...
...
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