Skip to content

Commit 70f5a13

Browse files
LGDHuaOPERLGDHuaOPER
authored andcommitted
feat(comp-opericon, comp-projectanalysis): 曲线选择,个人账号、管理员下拉菜单
增加:工程分析主页面曲线选择功能;增加:个人账号、管理员下拉菜单选择
1 parent e9f44b6 commit 70f5a13

File tree

3 files changed

+110
-6
lines changed

3 files changed

+110
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ data_analysis-React
9494
- `2019/01/21`
9595
- 版本回退:删除V1.0.0,回退至`1d3ba909a7fcc10aeb404f5b872151c8457c7d37`
9696
- 新分支:V1.0.0
97+
- 增加:工程分析主页面曲线选择功能;增加:个人账号、管理员下拉菜单选择
9798
9899
## 生产环境依赖或第三方库
99100
- `antd` `3.12.1`

app/component/common/OperIcon.jsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
import React from 'react';
2-
import { Icon, Row, Col, Divider, Input } from 'antd';
2+
import { Icon, Row, Col, Divider, Input, Menu, Dropdown } from 'antd';
33
import _ from 'lodash';
44
import myLifeCircle from '../../public/js/myLifeCircle';
55
import eventProxy from '../../public/js/eventProxy';
66

77
const Search = Input.Search;
8+
const menu = (
9+
<Menu>
10+
<Menu.SubMenu
11+
key="UserSubMenu"
12+
title={
13+
<span>
14+
<Icon type="smile" /> <span>Admin</span>
15+
</span>
16+
}
17+
>
18+
<Menu.Item key="User">
19+
<a rel="noopener noreferrer" href="User.html">
20+
<Icon type="setting" /> <span>个人账号</span>
21+
</a>
22+
</Menu.Item>
23+
</Menu.SubMenu>
24+
<Menu.Divider />
25+
<Menu.Item key="Admin">
26+
<a rel="noopener noreferrer" href="Admin.html">
27+
<Icon type="user" /> <span>管理员</span>
28+
</a>
29+
</Menu.Item>
30+
</Menu>
31+
);
832

933
class OperIcon extends React.Component {
1034
/*
@@ -74,7 +98,9 @@ class OperIcon extends React.Component {
7498
<Divider type="vertical" />
7599
</Col>
76100
<Col span={1}>
77-
<Icon style={{ fontSize: 22, cursor: 'pointer' }} type="user" title="账户信息与管理员" />
101+
<Dropdown overlay={menu} placement="bottomRight">
102+
<Icon style={{ fontSize: 22, cursor: 'pointer' }} type="user" title="账户信息与管理员" />
103+
</Dropdown>
78104
</Col>
79105
<Col span={1}>
80106
<Divider type="vertical" />
@@ -88,7 +114,9 @@ class OperIcon extends React.Component {
88114
return (
89115
<Row style={{ height: 40, lineHeight: 40 }} type="flex" justify="end" align="middle">
90116
<Col span={1}>
91-
<Icon style={{ fontSize: 22, cursor: 'pointer' }} type="user" title="账户信息与管理员" />
117+
<Dropdown overlay={menu} placement="bottomRight">
118+
<Icon style={{ fontSize: 22, cursor: 'pointer' }} type="user" title="账户信息与管理员" />
119+
</Dropdown>
92120
</Col>
93121
<Col span={1}>
94122
<Divider type="vertical" />

app/component/projectAnalysis/Index.jsx

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Breadcrumb } from 'antd';
2+
import { Breadcrumb, Collapse, List, Tag } from 'antd';
33
import _ from 'lodash';
44
import dayjs from 'dayjs';
55
// import relativeTime from 'dayjs/plugin/relativeTime';
@@ -13,6 +13,8 @@ import DataTable from '../dataTable/Index';
1313
import '../../public/css/libs/react-split-pane.css';
1414
import '../../public/css/projectAnalysis.pcss';
1515

16+
const Panel = Collapse.Panel;
17+
1618
const routes = [
1719
{
1820
path: 'index',
@@ -30,6 +32,34 @@ const routes = [
3032

3133
const allTableData = _.cloneDeep(mockData.tableData);
3234
const allKeys = _.cloneDeep(mockData.allKeys);
35+
const dataSource = {
36+
DC: [
37+
{
38+
title: 'ID-VD',
39+
description: 'DC之ID-VD'
40+
},
41+
{
42+
title: 'ID-VG',
43+
description: 'DC之ID-VG'
44+
}
45+
],
46+
RTP: [
47+
{
48+
title: 'BTI',
49+
description: 'RTP之BTI'
50+
},
51+
{
52+
title: 'HCI',
53+
description: 'RTP之HCI'
54+
}
55+
],
56+
'RF-S2P': [
57+
{
58+
title: 'SP2',
59+
description: 'RF-S2P之SP2'
60+
}
61+
]
62+
};
3363

3464
myLifeCircle.setBaseOptions({
3565
'getDerivedStateFromProps.componentLastProps': 'componentLastProps'
@@ -53,7 +83,7 @@ class Index extends React.Component {
5383
quoteDataTable2: 'projectAnalysis2',
5484
outSplitPane: {
5585
defaultSize: 250,
56-
minSize: 150,
86+
minSize: 200,
5787
maxSize: 300
5888
},
5989
inSplitPane: {
@@ -153,7 +183,52 @@ class Index extends React.Component {
153183
/>
154184
</div>
155185
</SplitPane>
156-
<div>1</div>
186+
<div>
187+
<Collapse accordion>
188+
<Panel header="DC" key="DC">
189+
<List
190+
itemLayout="horizontal"
191+
dataSource={dataSource.DC}
192+
renderItem={(item) => (
193+
<List.Item actions={[<Tag color="orange">待开发</Tag>]}>
194+
<List.Item.Meta
195+
title={<a href="https://ant.design">{item.title}</a>}
196+
description={item.description}
197+
/>
198+
</List.Item>
199+
)}
200+
/>
201+
</Panel>
202+
<Panel header="RTP" key="RTP">
203+
<List
204+
itemLayout="horizontal"
205+
dataSource={dataSource.RTP}
206+
renderItem={(item) => (
207+
<List.Item actions={[<Tag color="orange">待开发</Tag>]}>
208+
<List.Item.Meta
209+
title={<a href="https://ant.design">{item.title}</a>}
210+
description={item.description}
211+
/>
212+
</List.Item>
213+
)}
214+
/>
215+
</Panel>
216+
<Panel header="RF-S2P" key="RF-S2P">
217+
<List
218+
itemLayout="horizontal"
219+
dataSource={dataSource['RF-S2P']}
220+
renderItem={(item) => (
221+
<List.Item actions={[<Tag color="green">已开发</Tag>]}>
222+
<List.Item.Meta
223+
title={<a href="https://ant.design">{item.title}</a>}
224+
description={item.description}
225+
/>
226+
</List.Item>
227+
)}
228+
/>
229+
</Panel>
230+
</Collapse>
231+
</div>
157232
</SplitPane>
158233
</div>
159234
</div>

0 commit comments

Comments
 (0)