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
c8d6033e
Commit
c8d6033e
authored
Aug 06, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充仓位schema能力
parent
b9d80389
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
58 deletions
+113
-58
index.tsx
src/components/NiceForm/index.tsx
+23
-1
adjustRepository.tsx
src/pages/repositories/adjustRepository.tsx
+1
-1
index.tsx
src/pages/repositories/index.tsx
+26
-28
index.tsx
src/pages/repositories/schema/index.tsx
+63
-28
No files found.
src/components/NiceForm/index.tsx
View file @
c8d6033e
...
...
@@ -2,7 +2,8 @@ import React from 'react';
import
SchemaForm
,
{
IAntdSchemaFormProps
,
createVirtualBox
,
registerVirtualBox
,
}
from
'@formily/antd'
;
import
{
Button
,
Space
}
from
'antd'
;
import
{
Button
,
Space
,
Row
,
Col
}
from
'antd'
;
import
styled
from
'styled-components'
import
CustomUpload
from
'./components/CustomUpload'
;
import
CustomStatus
from
'./components/CustomStatus'
;
import
CustomAddArray
from
'./components/CustomAddArray'
;
...
...
@@ -18,6 +19,27 @@ import Children from './components/Children';
export
interface
NiceFormProps
extends
IAntdSchemaFormProps
{}
const
RowLayout
=
styled
(
props
=>
<
Row
justify=
'end'
{
...
props
}
/>)
`
.mega-layout-item {
margin-bottom: 20px !important;
}
.mega-layout-container {
margin-bottom: 0;
}
`
registerVirtualBox
(
'flex-layout'
,
(
_props
)
=>
{
const
{
children
,
props
}
=
_props
const
rowStyle
=
props
[
'x-component-props'
]
?
props
[
'x-component-props'
].
rowStyle
:
{}
const
colStyle
=
props
[
'x-component-props'
]
?
props
[
'x-component-props'
].
colStyle
:
{}
return
(
<
RowLayout
style=
{
rowStyle
}
>
{
children
.
map
((
v
,
i
)
=>
<
Col
style=
{
colStyle
}
key=
{
i
}
>
{
v
}
</
Col
>)
}
</
RowLayout
>
)
})
const
NiceForm
:
React
.
FC
<
NiceFormProps
>
=
props
=>
{
const
{
children
,
components
,
...
reset
}
=
props
;
const
customComponents
=
{
...
...
src/pages/repositories/adjustRepository.tsx
View file @
c8d6033e
...
...
@@ -366,7 +366,7 @@ const AdjustRepository:React.FC<{}> = (props) => {
return
(<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
"
新建仓位
"
title=
"
仓位库存调拨
"
extra=
{
[
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
保存
...
...
src/pages/repositories/index.tsx
View file @
c8d6033e
...
...
@@ -157,6 +157,16 @@ const Repositories: React.FC<{}> = () => {
history
.
push
(
`/memberCenter/commodityAbility/repositories/addRepository`
);
};
const
controllerBtns
=
<
Space
>
<
Button
type=
"primary"
onClick=
{
handleToAdd
}
icon=
{
<
PlusOutlined
/>
}
>
新建
</
Button
>
</
Space
>
return
(
<
PageHeaderWrapper
>
<
Card
>
...
...
@@ -166,34 +176,22 @@ const Repositories: React.FC<{}> = () => {
tableProps=
{
{
rowKey
:
'id'
}
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
controlRender=
{
<
Row
justify=
"space-between"
>
<
Col
>
<
Space
>
<
Button
type=
"primary"
onClick=
{
handleToAdd
}
icon=
{
<
PlusOutlined
/>
}
>
新建
</
Button
>
</
Space
>
</
Col
>
<
Col
>
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'search'
,
FORM_FILTER_PATH
,
);
}
}
schema=
{
repositSchema
}
/>
</
Col
>
</
Row
>
<
NiceForm
actions=
{
formActions
}
onSubmit=
{
values
=>
ref
.
current
.
reload
(
values
)
}
expressionScope=
{
{
controllerBtns
}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'search'
,
FORM_FILTER_PATH
,
);
}
}
schema=
{
repositSchema
}
/>
}
/>
</
Card
>
...
...
src/pages/repositories/schema/index.tsx
View file @
c8d6033e
...
...
@@ -11,51 +11,86 @@ export const repositSchema: ISchema = {
type
:
'object'
,
"x-component"
:
'mega-layout'
,
properties
:
{
search
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
'请输入仓位名称'
}
},
[
FORM_FILTER_PATH
]:
{
topLayout
:
{
type
:
'object'
,
"x-component"
:
"mega-layout"
,
visible
:
false
,
"x-component"
:
'mega-layout'
,
"x-component-props"
:
{
inline
:
true
grid
:
true
},
properties
:
{
productName
:
{
type
:
'string'
,
ctl
:
{
type
:
'object'
,
"x-component"
:
'Children'
,
"x-component-props"
:
{
placeholder
:
'商品名称'
children
:
"{{controllerBtns}}"
}
},
productId
:
{
search
:
{
type
:
'string'
,
"x-component"
:
'Search'
,
"x-mega-props"
:
{
},
"x-component-props"
:
{
placeholder
:
'
商品ID
'
placeholder
:
'
请输入仓位名称
'
}
}
}
},
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
"x-component"
:
"flex-layout"
,
"x-component-props"
:
{
rowStyle
:
{
flexWrap
:
'nowrap'
},
category
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择品类'
colStyle
:
{
marginLeft
:
20
}
},
properties
:
{
PRO_LAYOUT
:
{
type
:
'object'
,
"x-component"
:
'mega-layout'
,
"x-mega-props"
:
{
span
:
5
},
enum
:
[]
},
brand
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择品牌'
inline
:
true
},
enum
:
[]
properties
:
{
productName
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'商品名称'
}
},
productId
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'商品ID'
}
},
category
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择品类'
},
enum
:
[]
},
brand
:
{
type
:
'string'
,
"x-component-props"
:
{
placeholder
:
'请选择品牌'
},
enum
:
[]
},
}
},
submit
:
{
"x-component"
:
'Submit'
,
"x-mega-props"
:
{
span
:
1
},
"x-component-props"
:
{
children
:
'查询'
}
...
...
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