aldehyde 0.2.39 → 0.2.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/button/cquery-button-bar.d.ts +1 -1
- package/lib/detail/rightbar/index.d.ts +1 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.js +2 -2
- package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
- package/lib/form/field-group-form.d.ts +1 -1
- package/lib/layout/header/index.css +8 -7
- package/lib/layout/header/index.d.ts +1 -6
- package/lib/layout/header/index.d.ts.map +1 -1
- package/lib/layout/header/index.js +23 -26
- package/lib/layout/header/index.js.map +1 -1
- package/lib/layout/menu/block.d.ts +1 -0
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/block.js +4 -5
- package/lib/layout/menu/block.js.map +1 -1
- package/lib/layout/menu/block1.d.ts +18 -0
- package/lib/layout/menu/block1.d.ts.map +1 -0
- package/lib/layout/menu/block1.js +46 -0
- package/lib/layout/menu/block1.js.map +1 -0
- package/lib/layout/menu/l2menu-message-bar.d.ts +4 -0
- package/lib/layout/menu/l2menu-message-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.js +7 -2
- package/lib/layout/menu/l2menu-message-bar.js.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts +4 -0
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.js +7 -2
- package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/reset-password.js +2 -5
- package/lib/layout/menu/reset-password.js.map +1 -1
- package/lib/layout/menu/user-bar.d.ts +4 -0
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.js +13 -10
- package/lib/layout/menu/user-bar.js.map +1 -1
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.js +1 -4
- package/lib/layout/menu/userinfo-bar.js.map +1 -1
- package/lib/layout/sidebar/index.css +1 -1
- package/lib/layout/sidebar/index.d.ts +1 -5
- package/lib/layout/sidebar/index.d.ts.map +1 -1
- package/lib/layout/sidebar/index.js +11 -11
- package/lib/layout/sidebar/index.js.map +1 -1
- package/lib/table/l2-act-table.d.ts +1 -1
- package/lib/table/pagination.d.ts +1 -1
- package/lib/table/relation-table.d.ts +2 -2
- package/lib/tmpl/hcservice-v3.js +5 -5
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/superagent.js +5 -5
- package/lib/tmpl/superagent.js.map +1 -1
- package/lib/units/index.d.ts +2 -0
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +7 -0
- package/lib/units/index.js.map +1 -1
- package/package.json +7 -3
- package/src/aldehyde/controls/view-control.tsx +1 -2
- package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +2 -1
- package/src/aldehyde/layout/header/index.css +8 -7
- package/src/aldehyde/layout/header/index.tsx +44 -46
- package/src/aldehyde/layout/menu/block.tsx +19 -18
- package/src/aldehyde/layout/menu/block1.tsx +81 -0
- package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +10 -5
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +9 -6
- package/src/aldehyde/layout/menu/reset-password.tsx +2 -1
- package/src/aldehyde/layout/menu/user-bar.tsx +18 -10
- package/src/aldehyde/layout/menu/userinfo-bar.tsx +2 -1
- package/src/aldehyde/layout/sidebar/index.css +1 -1
- package/src/aldehyde/layout/sidebar/index.tsx +8 -9
- package/src/aldehyde/tmpl/hcservice-v3.tsx +5 -5
- package/src/aldehyde/tmpl/superagent.js +5 -5
- package/src/aldehyde/units/index.tsx +9 -0
|
@@ -41,6 +41,7 @@ export default class ModalDtmplView extends React.PureComponent<ModalDtmplViewPr
|
|
|
41
41
|
// style={style}
|
|
42
42
|
width={'1250px'}
|
|
43
43
|
centered
|
|
44
|
+
wrapClassName={'aaa'}
|
|
44
45
|
bodyStyle={{height: height, overflow: 'auto'}}
|
|
45
46
|
onCancel={onCancel}
|
|
46
47
|
footer={[
|
|
@@ -48,7 +49,7 @@ export default class ModalDtmplView extends React.PureComponent<ModalDtmplViewPr
|
|
|
48
49
|
取 消
|
|
49
50
|
</Button>]}
|
|
50
51
|
>
|
|
51
|
-
{code?<ActDtmplView
|
|
52
|
+
{code?<ActDtmplView showRightNav={false} sourceId={sourceId} code={code} />:""}
|
|
52
53
|
</Modal>
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
color:#333;
|
|
6
6
|
background: #fff;
|
|
7
7
|
font-size: 16px;
|
|
8
|
-
border-bottom: 1px solid
|
|
8
|
+
border-bottom: 1px solid ;
|
|
9
|
+
border-bottom-color: var(--antd-color-primary);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.header-col{
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
cursor: pointer;
|
|
24
25
|
}
|
|
25
26
|
.message-bar:hover{
|
|
26
|
-
background:
|
|
27
|
+
background: var(--message-bar-backgroupd);
|
|
27
28
|
color:#fff;
|
|
28
29
|
border-radius: 30%;
|
|
29
30
|
}
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
color:#1890ff;
|
|
33
34
|
}
|
|
34
35
|
.message-bar-avatar:hover{
|
|
35
|
-
background: #
|
|
36
|
+
background: #var(--message-bar-backgroupd);
|
|
36
37
|
color:#fff;
|
|
37
38
|
}
|
|
38
39
|
.userLogin{
|
|
@@ -46,12 +47,12 @@
|
|
|
46
47
|
font-size: 24px!important;
|
|
47
48
|
}
|
|
48
49
|
.userLogin:hover{
|
|
49
|
-
background:
|
|
50
|
+
background: var(--message-bar-backgroupd);
|
|
50
51
|
color:#000;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
.loginAvatar{
|
|
54
|
-
background:
|
|
55
|
+
background: var(--message-bar-backgroupd);
|
|
55
56
|
font-size:20px;
|
|
56
57
|
vertical-align: middle;
|
|
57
58
|
line-height: 46px;
|
|
@@ -74,10 +75,10 @@
|
|
|
74
75
|
padding-top: 0px;
|
|
75
76
|
border-bottom-style: solid;
|
|
76
77
|
border-bottom-width:2px;
|
|
77
|
-
border-bottom-color
|
|
78
|
+
border-bottom-color:var(--header-block-active-bottom-color) ;
|
|
78
79
|
}
|
|
79
80
|
.header-top .active{
|
|
80
|
-
background:
|
|
81
|
+
background: var(--header-top-active-background) ;
|
|
81
82
|
}
|
|
82
83
|
.header-top .active>a {
|
|
83
84
|
color: #fcfcfc;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {Col, Layout, Row} from 'antd'
|
|
1
|
+
import React, {CSSProperties} from 'react'
|
|
2
|
+
import {Col, Layout, Row, theme} from 'antd'
|
|
3
3
|
import {MenuFoldOutlined, MenuUnfoldOutlined} from '@ant-design/icons';
|
|
4
4
|
import "./index.css"
|
|
5
5
|
import Block, {BlockProps} from "../menu/block";
|
|
6
6
|
import L2MenuMessageBar from '../menu/l2menu-message-bar';
|
|
7
|
-
import L2MenuQuickBar
|
|
7
|
+
import L2MenuQuickBar from '../menu/l2menu-quick-bar';
|
|
8
8
|
import UserBar from '../menu/user-bar';
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
const {Header: AntdHeader,} = Layout;
|
|
10
11
|
|
|
11
12
|
interface HeaderProps extends BlockProps {
|
|
12
13
|
toggle: any;
|
|
@@ -17,48 +18,45 @@ interface HeaderState {
|
|
|
17
18
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</AntdHeader>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
21
|
+
const {useToken} = theme;
|
|
22
|
+
const Header: React.FC<HeaderProps> = (props) => {
|
|
23
|
+
const {token} = useToken();
|
|
24
|
+
let {collapsed} = props;
|
|
25
|
+
const syyy:CSSProperties={'--antd-color-primary': token.colorPrimary} as CSSProperties;
|
|
26
|
+
return (
|
|
27
|
+
<AntdHeader style={{padding: 0, height: 'auto'}}>
|
|
28
|
+
{/*<Row justify="space-around" align="middle" style={{'background':'#0f4da1',height:'100px'}}>*/}
|
|
29
|
+
{/* <Col span={12}>*/}
|
|
30
|
+
{/* <img style={{height:'80px'}} src={Logo}></img>*/}
|
|
31
|
+
{/* </Col>*/}
|
|
32
|
+
{/* <Col span={4}>*/}
|
|
33
|
+
|
|
34
|
+
{/* </Col>*/}
|
|
35
|
+
{/* </Row>*/}
|
|
36
|
+
<Row className="header-top" style={syyy} wrap={false}>
|
|
37
|
+
<Col span={20} className="header-col">
|
|
38
|
+
<div style={{float: 'left'}}>
|
|
39
|
+
{React.createElement(collapsed ? MenuUnfoldOutlined : MenuFoldOutlined, {
|
|
40
|
+
className: 'trigger',
|
|
41
|
+
onClick: () => {
|
|
42
|
+
props.toggle();
|
|
43
|
+
},
|
|
44
|
+
})}
|
|
45
|
+
</div>
|
|
46
|
+
<Block {...props} activeColor={token.colorPrimary} />
|
|
47
|
+
</Col>
|
|
48
|
+
<Col span={1} style={{width: '100%'}}>
|
|
49
|
+
<L2MenuQuickBar backgroudColor={token.colorPrimary} ></L2MenuQuickBar>
|
|
50
|
+
</Col>
|
|
51
|
+
<Col span={1} style={{width: '100%'}}>
|
|
52
|
+
<L2MenuMessageBar backgroudColor={token.colorPrimary}></L2MenuMessageBar>
|
|
53
|
+
</Col>
|
|
54
|
+
<Col span={2}>
|
|
55
|
+
<UserBar backgroudColor={token.colorPrimary}></UserBar>
|
|
56
|
+
</Col>
|
|
57
|
+
</Row>
|
|
58
|
+
</AntdHeader>
|
|
59
|
+
)
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
export default Header
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, {CSSProperties} from "react";
|
|
2
2
|
import { Dropdown, Menu} from 'antd';
|
|
3
3
|
import {BlockMenu} from "../../tmpl/interface";
|
|
4
|
-
import withRouter from "../../routable/withroute";
|
|
5
|
-
import {} from '@ant-design/icons';
|
|
6
4
|
import MenuRender from './menu-render';
|
|
7
5
|
|
|
8
6
|
|
|
@@ -10,6 +8,7 @@ export interface BlockProps{
|
|
|
10
8
|
blocks:BlockMenu[];
|
|
11
9
|
currentBlockId?:string;
|
|
12
10
|
currentL2MenuId?:string;
|
|
11
|
+
activeColor?:string;
|
|
13
12
|
}
|
|
14
13
|
interface BlockState{
|
|
15
14
|
|
|
@@ -17,7 +16,6 @@ interface BlockState{
|
|
|
17
16
|
|
|
18
17
|
class Block extends React.PureComponent<BlockProps, BlockState> {
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
constructor(props) {
|
|
22
20
|
super(props);
|
|
23
21
|
}
|
|
@@ -46,7 +44,10 @@ class Block extends React.PureComponent<BlockProps, BlockState> {
|
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
render(){
|
|
49
|
-
const {currentBlockId,blocks,currentL2MenuId}=this.props;
|
|
47
|
+
const {currentBlockId,blocks,currentL2MenuId,activeColor}=this.props;
|
|
48
|
+
|
|
49
|
+
const syyy={'--header-block-active-bottom-color':activeColor?activeColor:"#1E90FF",'--header-top-active-background':activeColor?activeColor:"#1E90FF"} as CSSProperties
|
|
50
|
+
|
|
50
51
|
if(!blocks || blocks.length<1){
|
|
51
52
|
return <></>;
|
|
52
53
|
}
|
|
@@ -59,19 +60,19 @@ class Block extends React.PureComponent<BlockProps, BlockState> {
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
return (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
blocks.map((item, index) => {
|
|
64
|
+
return <div key={index}
|
|
65
|
+
className={`${item.id == blockId ? "active" : ""} header-block`} style={syyy}>
|
|
66
|
+
<Dropdown overlay={this.renderBlockMenu(item)}>
|
|
67
|
+
<a className="dropdown-link"
|
|
68
|
+
style={item.id == blockId?{color:'#fff'}:{color:activeColor}}
|
|
69
|
+
rel="noopener noreferrer"
|
|
70
|
+
>
|
|
71
|
+
{item.title}
|
|
72
|
+
</a>
|
|
73
|
+
</Dropdown>
|
|
74
|
+
</div>
|
|
75
|
+
})
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, {CSSProperties} from "react";
|
|
2
|
+
import { Dropdown, Menu} from 'antd';
|
|
3
|
+
import {BlockMenu} from "../../tmpl/interface";
|
|
4
|
+
import MenuRender from './menu-render';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export interface BlockProps{
|
|
8
|
+
blocks:BlockMenu[];
|
|
9
|
+
currentBlockId?:string;
|
|
10
|
+
currentL2MenuId?:string;
|
|
11
|
+
activeColor?:string;
|
|
12
|
+
}
|
|
13
|
+
interface BlockState{
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class Block extends React.PureComponent<BlockProps, BlockState> {
|
|
18
|
+
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
renderBlockMenu = (blockMenu:BlockMenu)=>{
|
|
24
|
+
return <Menu>
|
|
25
|
+
{MenuRender.renderL1Menu(blockMenu.l1Menus,null)}
|
|
26
|
+
</Menu>
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
findBlockId = (blocks:BlockMenu[],currentL2MenuId:string) => {
|
|
32
|
+
let blockId:string=undefined;
|
|
33
|
+
for(const block of blocks){
|
|
34
|
+
for(const menul1 of block.l1Menus){
|
|
35
|
+
for(const menul2 of menul1.l2Menus){
|
|
36
|
+
if(menul2.id===currentL2MenuId){
|
|
37
|
+
blockId=block.id;
|
|
38
|
+
return blockId;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return blockId;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
render(){
|
|
47
|
+
const {currentBlockId,blocks,currentL2MenuId,activeColor}=this.props;
|
|
48
|
+
|
|
49
|
+
const syyy={'--header-block-active-bottom-color':activeColor?activeColor:"#1E90FF",'--header-top-active-background':activeColor?activeColor:"#1E90FF"} as CSSProperties
|
|
50
|
+
|
|
51
|
+
if(!blocks || blocks.length<1){
|
|
52
|
+
return <></>;
|
|
53
|
+
}
|
|
54
|
+
let blockId=currentBlockId;
|
|
55
|
+
if(currentL2MenuId && !blockId){
|
|
56
|
+
blockId=this.findBlockId(blocks,currentL2MenuId);
|
|
57
|
+
}
|
|
58
|
+
if(!blockId){
|
|
59
|
+
blockId=blocks.at(0).id;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
blocks.map((item, index) => {
|
|
64
|
+
return <div key={index}
|
|
65
|
+
className={`${item.id == blockId ? "active" : ""} header-block`} style={syyy}>
|
|
66
|
+
<Dropdown overlay={this.renderBlockMenu(item)}>
|
|
67
|
+
<a className="dropdown-link"
|
|
68
|
+
style={item.id == blockId?{color:'#fff'}:{color:activeColor}}
|
|
69
|
+
rel="noopener noreferrer"
|
|
70
|
+
>
|
|
71
|
+
{item.title}
|
|
72
|
+
</a>
|
|
73
|
+
</Dropdown>
|
|
74
|
+
</div>
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default Block;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, {CSSProperties} from 'react'
|
|
2
2
|
import {Badge, Avatar, Dropdown, Menu} from 'antd'
|
|
3
3
|
import {MessageTwoTone,BellOutlined} from '@ant-design/icons';
|
|
4
4
|
import 'antd/dist/reset.css';
|
|
@@ -8,7 +8,7 @@ import {NavLink} from 'react-router-dom';
|
|
|
8
8
|
import HCDataSource from '../../tmpl/hc-data-source'
|
|
9
9
|
import Units from "../../units";
|
|
10
10
|
interface L2MenuMessageBarProps {
|
|
11
|
-
|
|
11
|
+
backgroudColor?:string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface MessageBar {
|
|
@@ -27,6 +27,9 @@ class L2MenuMessageBar extends React.PureComponent<L2MenuMessageBarProps, L2Menu
|
|
|
27
27
|
messageBars:undefined,
|
|
28
28
|
anyState:false,
|
|
29
29
|
}
|
|
30
|
+
static defaultProps={
|
|
31
|
+
backgroudColor:"#4a5f74"
|
|
32
|
+
}
|
|
30
33
|
|
|
31
34
|
async componentDidMount() {
|
|
32
35
|
let l2Menus = await HCDataSource.messageMenus();
|
|
@@ -54,10 +57,12 @@ class L2MenuMessageBar extends React.PureComponent<L2MenuMessageBarProps, L2Menu
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
|
|
60
|
+
|
|
57
61
|
renderMessageBar = (messageBars: MessageBar[]) => {
|
|
58
62
|
|
|
63
|
+
const {backgroudColor}=this.props
|
|
59
64
|
let total:number=0;
|
|
60
|
-
|
|
65
|
+
const syyy:CSSProperties = {'--message-bar-backgroupd':backgroudColor} as CSSProperties;
|
|
61
66
|
const menu = (
|
|
62
67
|
<Menu key={1}>
|
|
63
68
|
{ messageBars.map((messageBar, index) => {
|
|
@@ -85,7 +90,7 @@ class L2MenuMessageBar extends React.PureComponent<L2MenuMessageBarProps, L2Menu
|
|
|
85
90
|
if(l2Menu.defaultCriteriaValue){
|
|
86
91
|
defaultCriteriaData='&'+ Units.transQueryParamsToStr(l2Menu.defaultCriteriaValue);
|
|
87
92
|
}
|
|
88
|
-
return (<div className={'message-bar'} >
|
|
93
|
+
return (<div className={'message-bar'} style={syyy} >
|
|
89
94
|
<a href={l2Menu.customPath ? `/page/${l2Menu.id}${l2Menu.customPath}?menuId=${l2Menu.id}` : `#/${l2Menu.id}/act-table?menuId=${l2Menu.id}${defaultCriteriaData}`}
|
|
90
95
|
className="head-example" >
|
|
91
96
|
<Badge count={messageBar.count} overflowCount={99} offset={[8, -2]}>
|
|
@@ -95,7 +100,7 @@ class L2MenuMessageBar extends React.PureComponent<L2MenuMessageBarProps, L2Menu
|
|
|
95
100
|
</div>)
|
|
96
101
|
}else{
|
|
97
102
|
return <Dropdown overlay={menu} placement="bottomCenter" >
|
|
98
|
-
<div className={'message-bar'} >
|
|
103
|
+
<div className={'message-bar'} style={syyy} >
|
|
99
104
|
<Badge count={total} overflowCount={99} offset={[8, -2]}>
|
|
100
105
|
<span style={{ fontSize: '20px', color: '#08c' }} ><BellOutlined /></span>
|
|
101
106
|
</Badge>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, {CSSProperties} from 'react'
|
|
2
2
|
import { Dropdown, Menu, Drawer, Space,Button} from 'antd'
|
|
3
3
|
import {AppstoreOutlined} from '@ant-design/icons';
|
|
4
4
|
import 'antd/dist/reset.css';
|
|
@@ -7,7 +7,7 @@ import HCDataSource from '../../tmpl/hc-data-source'
|
|
|
7
7
|
import LtmplTable from "../../module/ltmpl-table";
|
|
8
8
|
|
|
9
9
|
interface L2MenuQuickBarProps {
|
|
10
|
-
|
|
10
|
+
backgroudColor?:string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
interface QuickBar {
|
|
@@ -30,6 +30,9 @@ class L2MenuQuickBar extends React.PureComponent<L2MenuQuickBarProps, L2MenuQuic
|
|
|
30
30
|
currentId:undefined,
|
|
31
31
|
showDraw:false,
|
|
32
32
|
}
|
|
33
|
+
static defaultProps={
|
|
34
|
+
backgroudColor:"#4a5f74"
|
|
35
|
+
}
|
|
33
36
|
|
|
34
37
|
async componentDidMount() {
|
|
35
38
|
let l2Menus = await HCDataSource.quickEntranceMenus();
|
|
@@ -62,9 +65,9 @@ class L2MenuQuickBar extends React.PureComponent<L2MenuQuickBarProps, L2MenuQuic
|
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
renderQuickBar = (quickBars: QuickBar[]) => {
|
|
65
|
-
|
|
68
|
+
const {backgroudColor}=this.props
|
|
66
69
|
let total:number=0;
|
|
67
|
-
|
|
70
|
+
const syyy:CSSProperties={'--message-bar-backgroupd':backgroudColor} as CSSProperties;
|
|
68
71
|
const menu = (
|
|
69
72
|
<Menu key={1}>
|
|
70
73
|
{ quickBars.map((quickBar, index) => {
|
|
@@ -86,12 +89,12 @@ class L2MenuQuickBar extends React.PureComponent<L2MenuQuickBarProps, L2MenuQuic
|
|
|
86
89
|
}else if(quickBars.length==1){
|
|
87
90
|
let quickBar=quickBars[0];
|
|
88
91
|
const l2Menu = quickBar.l2Menu;
|
|
89
|
-
return (<div className={'message-bar'}
|
|
92
|
+
return (<div className={'message-bar'} style={syyy} onClick={()=>this.showDraw(quickBar.l2Menu.id)}>
|
|
90
93
|
<span style={{ fontSize: '20px', color: '#08c' }} ><AppstoreOutlined /></span>
|
|
91
94
|
</div>)
|
|
92
95
|
}else{
|
|
93
96
|
return <Dropdown overlay={menu} placement="bottomCenter" >
|
|
94
|
-
<div className={'message-bar'} >
|
|
97
|
+
<div className={'message-bar'} style={syyy} >
|
|
95
98
|
<span style={{ fontSize: '20px', color: '#08c' }} ><AppstoreOutlined /></span>
|
|
96
99
|
</div>
|
|
97
100
|
</Dropdown>
|
|
@@ -172,7 +172,8 @@ class ResetPassword extends React.PureComponent<ResetPasswordProps, ResetPasswor
|
|
|
172
172
|
><span onClick={()=>{
|
|
173
173
|
this.setState({
|
|
174
174
|
showPopover:!showPopover
|
|
175
|
-
})}}
|
|
175
|
+
})}} >修改密码</span>
|
|
176
|
+
{/*<KeyOutlined />*/}
|
|
176
177
|
</Popover>
|
|
177
178
|
</>
|
|
178
179
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, {CSSProperties} from 'react'
|
|
2
2
|
import {Avatar, Col, Dropdown, Menu, Row, Tooltip} from 'antd';
|
|
3
3
|
import {ClearOutlined, LogoutOutlined, ProfileOutlined, UserOutlined,LoginOutlined} from '@ant-design/icons';
|
|
4
4
|
import {UserInfo} from "../../tmpl/interface";
|
|
@@ -11,6 +11,9 @@ import ResetPassword from "./reset-password";
|
|
|
11
11
|
|
|
12
12
|
interface UserBarProps {
|
|
13
13
|
|
|
14
|
+
|
|
15
|
+
backgroudColor?:string,
|
|
16
|
+
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
|
|
@@ -27,6 +30,10 @@ class UserBar extends React.PureComponent<UserBarProps, UserBarState> {
|
|
|
27
30
|
context: undefined,
|
|
28
31
|
}
|
|
29
32
|
|
|
33
|
+
static defaultProps={
|
|
34
|
+
backgroudColor:"#4a5f74"
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
async componentDidMount() {
|
|
31
38
|
let userInfo = await HcserviceV3.getUser();
|
|
32
39
|
//查询 上下文配置信息
|
|
@@ -76,44 +83,45 @@ class UserBar extends React.PureComponent<UserBarProps, UserBarState> {
|
|
|
76
83
|
}
|
|
77
84
|
|
|
78
85
|
render() {
|
|
86
|
+
const {backgroudColor}=this.props;
|
|
79
87
|
const {name, context, roles} = this.state;
|
|
80
|
-
|
|
88
|
+
const syyy:CSSProperties={'--message-bar-backgroupd':backgroudColor}as CSSProperties;;
|
|
81
89
|
const menu =name? (
|
|
82
90
|
<Menu style={{minWidth: '100px'}}>
|
|
83
91
|
<Menu.Item>
|
|
84
92
|
<UserInfoBar/>
|
|
85
93
|
</Menu.Item>
|
|
86
|
-
{context && context.length > 0 ? <Menu.Item>
|
|
87
|
-
<span onClick={this.toSetContext}
|
|
94
|
+
{context && context.length > 0 ? <Menu.Item >{/*icon={<ProfileOutlined/>}*/}
|
|
95
|
+
<span onClick={this.toSetContext}>全局配置</span>
|
|
88
96
|
</Menu.Item> : null}
|
|
89
97
|
<Menu.Item>
|
|
90
98
|
<ResetPassword></ResetPassword>
|
|
91
99
|
</Menu.Item>
|
|
92
100
|
{roles && roles.indexOf("admin") >= 0 ?
|
|
93
101
|
<Menu.Item>
|
|
94
|
-
<span onClick={this.cleanCache}
|
|
102
|
+
<span onClick={this.cleanCache}>清空缓存</span> {/*<ClearOutlined/>*/}
|
|
95
103
|
</Menu.Item> : null
|
|
96
104
|
}
|
|
97
105
|
|
|
98
|
-
<Menu.Item>
|
|
99
|
-
<span onClick={HcserviceV3.logout}><LogoutOutlined
|
|
106
|
+
<Menu.Item >
|
|
107
|
+
<span onClick={HcserviceV3.logout} ><LogoutOutlined/> 退出</span>
|
|
100
108
|
</Menu.Item>
|
|
101
109
|
</Menu>
|
|
102
110
|
):(<Menu>
|
|
103
111
|
<Menu.Item>
|
|
104
|
-
<span onClick={HcserviceV3.logout}><LoginOutlined
|
|
112
|
+
<span onClick={HcserviceV3.logout}><LoginOutlined /> 登录</span>
|
|
105
113
|
</Menu.Item> </Menu>);
|
|
106
114
|
return (
|
|
107
115
|
<>
|
|
108
116
|
<Dropdown overlay={menu} placement="bottomRight" trigger={['click']}>
|
|
109
|
-
<div className="userLogin">
|
|
117
|
+
<div className="userLogin" style={syyy} >
|
|
110
118
|
{/*<Tooltip placement={'right'} title={name} >*/}
|
|
111
119
|
{/*<Avatar style={{ color:'#1890ff' }} shape="square" icon={<UserOutlined/>} size={{ xs: 8, sm: 16, md: 24, lg: 32, xl: 40, xxl: 48 }}>*/}
|
|
112
120
|
{/*</Avatar>*/}
|
|
113
121
|
{/*</Tooltip>*/}
|
|
114
122
|
{/*<UserOutlined/>*/}
|
|
115
123
|
<Tooltip placement="left" title={this.getTitle()}>
|
|
116
|
-
<Avatar className={'loginAvatar'}
|
|
124
|
+
<Avatar className={'loginAvatar'} icon={<UserOutlined/>} size="large">
|
|
117
125
|
{/*{name ?name.substring(0,1).toUpperCase():null}*/}
|
|
118
126
|
</Avatar>
|
|
119
127
|
{/*<span>{name && name.length>=8?name.substring(0,5)+'...':name}</span>*/}
|
|
@@ -35,7 +35,8 @@ class UserInfoBar extends React.PureComponent<UserInfoBarProps, UserInfoBarState
|
|
|
35
35
|
const {showDraw} = this.state;
|
|
36
36
|
return (
|
|
37
37
|
<>
|
|
38
|
-
<span onClick={this.showDraw}
|
|
38
|
+
<span onClick={this.showDraw}>个人信息</span>
|
|
39
|
+
{/*<SolutionOutlined />*/}
|
|
39
40
|
{showDraw?<DtmplViewDrawer title={'个人信息'} width={'calc(100% - 280px)'} sourceId={'0'} open={showDraw} code={"userCode"} onClose={this.closeDrawer}></DtmplViewDrawer>:null}
|
|
40
41
|
</>
|
|
41
42
|
);
|
|
@@ -4,7 +4,7 @@ import Units from '../../units';
|
|
|
4
4
|
import Menu2layers from "../menu/menu-2layers";
|
|
5
5
|
import {Menu2layersProps} from "../../tmpl/interface";
|
|
6
6
|
import Scrollbars from 'react-custom-scrollbars';
|
|
7
|
-
import {Image,
|
|
7
|
+
import {Image, theme} from 'antd';
|
|
8
8
|
interface NavLeftProps extends Menu2layersProps {
|
|
9
9
|
|
|
10
10
|
}
|
|
@@ -12,15 +12,15 @@ interface NavLeftProps extends Menu2layersProps {
|
|
|
12
12
|
interface NavLeftState {
|
|
13
13
|
|
|
14
14
|
}
|
|
15
|
+
const {useToken} = theme;
|
|
16
|
+
const NavLeft :React.FC<NavLeftProps> = (props) => {
|
|
17
|
+
const {token} = useToken();
|
|
18
|
+
let {collapsed} = props;
|
|
15
19
|
|
|
16
|
-
class NavLeft extends React.PureComponent<NavLeftProps, NavLeftState> {
|
|
17
|
-
|
|
18
|
-
render() {
|
|
19
|
-
let {collapsed}=this.props
|
|
20
20
|
return (
|
|
21
21
|
<div>
|
|
22
|
-
<Scrollbars style={{height: 'calc(100vh)'}}
|
|
23
|
-
<div className={collapsed?"logonly" :"logo-blue"}>
|
|
22
|
+
<Scrollbars style={{height: 'calc(100vh)','--logo-blue-background': token.colorPrimary}} autoHide autoHideTimeout={1000}>
|
|
23
|
+
<div className={collapsed?"logonly" :"logo-blue"} style={{}}>
|
|
24
24
|
<a href="#/home">
|
|
25
25
|
{collapsed?<Image
|
|
26
26
|
src={Units.programName_Logo()}
|
|
@@ -28,12 +28,11 @@ class NavLeft extends React.PureComponent<NavLeftProps, NavLeftState> {
|
|
|
28
28
|
</a>
|
|
29
29
|
</div>
|
|
30
30
|
<Menu2layers mode="inline"
|
|
31
|
-
theme="light" {...
|
|
31
|
+
theme="light" {...props}></Menu2layers>
|
|
32
32
|
</Scrollbars>
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
)
|
|
36
|
-
}
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
export default NavLeft
|
|
@@ -235,7 +235,7 @@ export default class HcserviceV3 {
|
|
|
235
235
|
msg = res.message;
|
|
236
236
|
}
|
|
237
237
|
if (message) {
|
|
238
|
-
message.success("保存成功! " + msg)
|
|
238
|
+
message.success("保存成功! " + msg,1)
|
|
239
239
|
}
|
|
240
240
|
code = res.entityCode ? res.entityCode : res.code;
|
|
241
241
|
} else {
|
|
@@ -245,7 +245,7 @@ export default class HcserviceV3 {
|
|
|
245
245
|
}
|
|
246
246
|
} else {
|
|
247
247
|
if (message) {
|
|
248
|
-
message.error("
|
|
248
|
+
message.error("保存失败");
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
return {code, status: res.status};
|
|
@@ -379,7 +379,7 @@ export default class HcserviceV3 {
|
|
|
379
379
|
method: 'DELETE',
|
|
380
380
|
});
|
|
381
381
|
if (res.status == 'success') {
|
|
382
|
-
message.success("删除成功");
|
|
382
|
+
message.success("删除成功",1);
|
|
383
383
|
return true;
|
|
384
384
|
} else {
|
|
385
385
|
message.error("删除失败");
|
|
@@ -441,7 +441,7 @@ export default class HcserviceV3 {
|
|
|
441
441
|
data: {...params, sourceId}
|
|
442
442
|
});
|
|
443
443
|
if (res.status === 'success') {
|
|
444
|
-
message.success("统计成功")
|
|
444
|
+
message.success("统计成功",1)
|
|
445
445
|
} else {
|
|
446
446
|
message.error("统计失败")
|
|
447
447
|
}
|
|
@@ -712,7 +712,7 @@ export default class HcserviceV3 {
|
|
|
712
712
|
}
|
|
713
713
|
},null,null);
|
|
714
714
|
if(res.status != 'success'){
|
|
715
|
-
message.error("错误消息:" + res.message)
|
|
715
|
+
message.error("错误消息:" + res.message,4)
|
|
716
716
|
}
|
|
717
717
|
return res;
|
|
718
718
|
}
|