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
A
ant-design-pro
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
ant-design-pro
Commits
a924c484
Commit
a924c484
authored
Sep 07, 2017
by
ddcat1115
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add EditableItem
adjust AdvancedProfile page
parent
f649e4b9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
13 deletions
+97
-13
src/components/DescriptionList/index.less
src/components/DescriptionList/index.less
+1
-0
src/components/EditableItem/index.js
src/components/EditableItem/index.js
+54
-0
src/components/EditableItem/index.less
src/components/EditableItem/index.less
+25
-0
src/components/PageHeader/index.less
src/components/PageHeader/index.less
+0
-4
src/routes/Profile/AdvancedProfile.js
src/routes/Profile/AdvancedProfile.js
+17
-9
No files found.
src/components/DescriptionList/index.less
View file @
a924c484
...
...
@@ -31,6 +31,7 @@
}
.detail {
width: 100%;
padding-bottom: 16px;
color: @text-color;
display: table-cell;
...
...
src/components/EditableItem/index.js
0 → 100644
View file @
a924c484
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
Input
,
Icon
}
from
'
antd
'
;
import
styles
from
'
./index.less
'
;
export
default
class
EditableItem
extends
PureComponent
{
state
=
{
value
:
this
.
props
.
value
,
editable
:
false
,
};
handleChange
=
(
e
)
=>
{
const
value
=
e
.
target
.
value
;
this
.
setState
({
value
});
}
check
=
()
=>
{
this
.
setState
({
editable
:
false
});
if
(
this
.
props
.
onChange
)
{
this
.
props
.
onChange
(
this
.
state
.
value
);
}
}
edit
=
()
=>
{
this
.
setState
({
editable
:
true
});
}
render
()
{
const
{
value
,
editable
}
=
this
.
state
;
return
(
<
div
className
=
{
styles
.
editableItem
}
>
{
editable
?
<
div
className
=
{
styles
.
wrapper
}
>
<
Input
value
=
{
value
}
onChange
=
{
this
.
handleChange
}
onPressEnter
=
{
this
.
check
}
/
>
<
Icon
type
=
"
check
"
className
=
{
styles
.
icon
}
onClick
=
{
this
.
check
}
/
>
<
/div
>
:
<
div
className
=
{
styles
.
wrapper
}
>
<
span
>
{
value
||
'
'
}
<
/span
>
<
Icon
type
=
"
edit
"
className
=
{
styles
.
icon
}
onClick
=
{
this
.
edit
}
/
>
<
/div
>
}
<
/div
>
);
}
}
src/components/EditableItem/index.less
0 → 100644
View file @
a924c484
@import "~antd/lib/style/themes/default.less";
.editableItem {
line-height: @input-height-base;
display: table;
width: 100%;
margin-top: (@font-size-base * @line-height-base - @input-height-base) / 2;
.wrapper {
display: table-row;
& > * {
display: table-cell;
}
& > *:first-child {
width: 85%;
}
.icon {
cursor: pointer;
text-align: right;
}
}
}
src/components/PageHeader/index.less
View file @
a924c484
...
...
@@ -42,10 +42,6 @@
.action {
margin-left: 56px;
min-width: 266px;
button:not(:last-child) {
margin-right: 8px;
}
}
.title, .action, .content, .extraContent, .main {
...
...
src/routes/Profile/AdvancedProfile.js
View file @
a924c484
...
...
@@ -3,9 +3,11 @@ import { connect } from 'dva';
import
{
Button
,
Menu
,
Dropdown
,
Icon
,
Row
,
Col
,
Steps
,
Card
,
Popover
,
Badge
,
Table
,
Tooltip
}
from
'
antd
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
import
DescriptionList
from
'
../../components/DescriptionList
'
;
import
EditableItem
from
'
../../components/EditableItem
'
;
import
styles
from
'
./AdvancedProfile.less
'
;
const
{
Step
}
=
Steps
;
const
ButtonGroup
=
Button
.
Group
;
const
{
Description
}
=
DescriptionList
;
const
menu
=
(
...
...
@@ -18,13 +20,16 @@ const menu = (
const
action
=
(
<
div
>
<
Button
size
=
"
large
"
type
=
"
primary
"
>
主操作
<
/Button
>
<
Button
size
=
"
large
"
>
次操作
<
/Button
>
<
ButtonGroup
style
=
{{
marginRight
:
8
}}
>
<
Button
size
=
"
large
"
>
操作
<
/Button
>
<
Button
size
=
"
large
"
>
操作
<
/Button
>
<
Dropdown
overlay
=
{
menu
}
>
<
Button
size
=
"
large
"
>
更多
<
Icon
type
=
"
down
"
/>
更多操作
<
Icon
type
=
"
down
"
/>
<
/Button
>
<
/Dropdown
>
<
/ButtonGroup
>
<
Button
size
=
"
large
"
type
=
"
primary
"
>
主操作
<
/Button
>
<
/div
>
);
...
...
@@ -44,10 +49,11 @@ const extra = (
const
description
=
(
<
DescriptionList
col
=
"
2
"
>
<
Description
term
=
"
创建人
"
>
曲丽丽
<
/Description
>
<
Description
term
=
"
关联单据
"
><
a
href
=
""
>
12421
<
/a>
</
Description
>
<
Description
term
=
"
订购产品
"
>
XX
服务
<
/Description
>
<
Description
term
=
"
创建时间
"
>
2017
-
07
-
07
<
/Description
>
<
Description
term
=
"
关联单据
"
><
a
href
=
""
>
12421
<
/a></
Description
>
<
Description
term
=
"
生效日期
"
>
2017
-
07
-
07
~
2017
-
08
-
08
<
/Description
>
<
Description
term
=
"
单据备注
"
>
修改公司地址
:
浙江省杭州市西湖区工专路
<
/Description
>
<
Description
term
=
"
备注
"
>
请于两个工作日内确认
<
/Description
>
<
/DescriptionList
>
);
...
...
@@ -195,7 +201,9 @@ export default class AdvancedProfile extends Component {
<
Description
term
=
"
用户姓名
"
>
付小小
<
/Description
>
<
Description
term
=
"
会员卡号
"
>
32943898021309809423
<
/Description
>
<
Description
term
=
"
身份证
"
>
3321944288191034921
<
/Description
>
<
Description
term
=
"
联系方式
"
>
18322193472
<
/Description
>
<
Description
term
=
"
联系方式
"
>
<
EditableItem
value
=
"
18112345678
"
/>
<
/Description
>
<
Description
term
=
"
联系地址
"
>
曲丽丽
18100000000
浙江省杭州市西湖区黄姑山路工专路交叉路口
<
/Description
>
<
/DescriptionList
>
<
DescriptionList
style
=
{{
marginBottom
:
24
}}
title
=
"
信息组
"
col
=
"
2
"
>
...
...
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