Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
74b673e5
Commit
74b673e5
authored
Apr 12, 2019
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix type error
parent
de7f6505
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
7 deletions
+118
-7
AdvancedForm/src/components/FooterToolbar/index.less
AdvancedForm/src/components/FooterToolbar/index.less
+33
-0
AdvancedForm/src/components/FooterToolbar/index.tsx
AdvancedForm/src/components/FooterToolbar/index.tsx
+53
-0
AdvancedForm/src/index.tsx
AdvancedForm/src/index.tsx
+32
-7
No files found.
AdvancedForm/src/components/FooterToolbar/index.less
0 → 100644
View file @
74b673e5
@import '~antd/lib/style/themes/default.less';
.toolbar {
position: fixed;
right: 0;
bottom: 0;
z-index: 9;
width: 100%;
height: 56px;
padding: 0 24px;
line-height: 56px;
background: #fff;
border-top: 1px solid @border-color-split;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
&::after {
display: block;
clear: both;
content: '';
}
.left {
float: left;
}
.right {
float: right;
}
button + button {
margin-left: 8px;
}
}
AdvancedForm/src/components/FooterToolbar/index.tsx
0 → 100644
View file @
74b673e5
import
React
,
{
Component
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./index.less
'
;
export
interface
FooterToolbarProps
{
extra
?:
React
.
ReactNode
;
style
?:
React
.
CSSProperties
;
className
?:
string
;
}
export
default
class
FooterToolbar
extends
Component
<
FooterToolbarProps
>
{
static
contextTypes
=
{
isMobile
:
PropTypes
.
bool
,
};
state
=
{
width
:
undefined
,
};
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
);
this
.
resizeFooterToolbar
();
}
componentWillUnmount
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
resizeFooterToolbar
);
}
resizeFooterToolbar
=
()
=>
{
const
sider
=
document
.
querySelector
(
'
.ant-layout-sider
'
)
as
HTMLDivElement
;
if
(
sider
==
null
)
{
return
;
}
const
{
isMobile
}
=
this
.
context
;
const
width
=
isMobile
?
null
:
`calc(100% -
${
sider
.
style
.
width
}
)`
;
const
{
width
:
stateWidth
}
=
this
.
state
;
if
(
stateWidth
!==
width
)
{
this
.
setState
({
width
});
}
};
render
()
{
const
{
children
,
className
,
extra
,
...
restProps
}
=
this
.
props
;
const
{
width
}
=
this
.
state
;
return
(
<
div
className
=
{
classNames
(
className
,
styles
.
toolbar
)
}
style
=
{
{
width
}
}
{
...
restProps
}
>
<
div
className
=
{
styles
.
left
}
>
{
extra
}
</
div
>
<
div
className
=
{
styles
.
right
}
>
{
children
}
</
div
>
</
div
>
);
}
}
AdvancedForm/src/index.tsx
View file @
74b673e5
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
Card
,
Form
,
Icon
,
Col
,
Row
,
DatePicker
,
TimePicker
,
Input
,
Select
,
Popover
}
from
'
antd
'
;
import
{
Card
,
Form
,
Icon
,
Button
,
Col
,
Row
,
DatePicker
,
TimePicker
,
Input
,
Select
,
Popover
,
}
from
'
antd
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
TableForm
from
'
./components/TableForm
'
;
import
TableForm
from
'
./components/TableForm
'
;
import
styles
from
'
./style.less
'
;
import
styles
from
'
./style.less
'
;
import
{
FormComponentProps
}
from
'
antd/lib/form
'
;
import
{
FormComponentProps
}
from
'
antd/lib/form
'
;
import
{
Dispatch
}
from
'
redux
'
;
import
{
Dispatch
}
from
'
redux
'
;
import
FooterToolbar
from
'
./components/FooterToolbar
'
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
{
RangePicker
}
=
DatePicker
;
const
{
RangePicker
}
=
DatePicker
;
...
@@ -47,9 +60,10 @@ const tableData = [
...
@@ -47,9 +60,10 @@ const tableData = [
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
extends
FormComponentProps
{
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
extends
FormComponentProps
{
dispatch
:
Dispatch
;
dispatch
:
Dispatch
;
submitting
:
boolean
;
}
}
@
connect
(({
loading
}:
{
loading
:
{
effects
:
any
}
})
=>
({
@
connect
(({
loading
}:
{
loading
:
{
effects
:
{
[
key
:
string
]:
boolean
}
}
})
=>
({
submitting
:
loading
.
effects
[
'
BLOCK_NAME_CAMEL_CASE/submitAdvancedForm
'
],
submitting
:
loading
.
effects
[
'
BLOCK_NAME_CAMEL_CASE/submitAdvancedForm
'
],
}))
}))
class
PAGE_NAME_UPPER_CAMEL_CASE
extends
Component
<
PAGE_NAME_UPPER_CAMEL_CASEProps
>
{
class
PAGE_NAME_UPPER_CAMEL_CASE
extends
Component
<
PAGE_NAME_UPPER_CAMEL_CASEProps
>
{
...
@@ -99,7 +113,12 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
...
@@ -99,7 +113,12 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
content
=
{
errorList
}
content
=
{
errorList
}
overlayClassName
=
{
styles
.
errorPopover
}
overlayClassName
=
{
styles
.
errorPopover
}
trigger
=
"click"
trigger
=
"click"
getPopupContainer
=
{
trigger
=>
trigger
&&
trigger
.
parentNode
}
getPopupContainer
=
{
(
trigger
:
HTMLElement
)
=>
{
if
(
trigger
&&
trigger
.
parentNode
)
{
return
trigger
.
parentNode
as
HTMLElement
;
}
return
trigger
;
}
}
>
>
<
Icon
type
=
"exclamation-circle"
/>
<
Icon
type
=
"exclamation-circle"
/>
</
Popover
>
</
Popover
>
...
@@ -140,8 +159,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
...
@@ -140,8 +159,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
render
()
{
render
()
{
const
{
const
{
form
:
{
getFieldDecorator
},
form
:
{
getFieldDecorator
},
submitting
,
}
=
this
.
props
;
}
=
this
.
props
;
const
{
width
}
=
this
.
state
;
return
(
return
(
<>
<>
<
Card
title
=
"仓库管理"
className
=
{
styles
.
card
}
bordered
=
{
false
}
>
<
Card
title
=
"仓库管理"
className
=
{
styles
.
card
}
bordered
=
{
false
}
>
...
@@ -269,7 +289,12 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
...
@@ -269,7 +289,12 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
<
TimePicker
<
TimePicker
placeholder
=
"提醒时间"
placeholder
=
"提醒时间"
style
=
{
{
width
:
'
100%
'
}
}
style
=
{
{
width
:
'
100%
'
}
}
getPopupContainer
=
{
trigger
=>
trigger
.
ParentNode
}
getPopupContainer
=
{
trigger
=>
{
if
(
trigger
&&
trigger
.
parentNode
)
{
return
trigger
.
parentNode
as
HTMLElement
;
}
return
trigger
;
}
}
/>
/>
)
}
)
}
</
Form
.
Item
>
</
Form
.
Item
>
...
@@ -294,12 +319,12 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
...
@@ -294,12 +319,12 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
initialValue
:
tableData
,
initialValue
:
tableData
,
})(<
TableForm
/>)
}
})(<
TableForm
/>)
}
</
Card
>
</
Card
>
{
/*
<FooterToolbar style={{ width }}>
<
FooterToolbar
style
=
{
{
width
}
}
>
{
this
.
getErrorInfo
()
}
{
this
.
getErrorInfo
()
}
<
Button
type
=
"primary"
onClick
=
{
this
.
validate
}
loading
=
{
submitting
}
>
<
Button
type
=
"primary"
onClick
=
{
this
.
validate
}
loading
=
{
submitting
}
>
提交
提交
</
Button
>
</
Button
>
</FooterToolbar>
*/
}
</
FooterToolbar
>
</>
</>
);
);
}
}
...
...
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