aldehyde 0.2.63 → 0.2.65
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/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +3 -3
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +2 -2
- package/lib/custom-page/dtmpl-custom-edit-modal-page.js +2 -2
- package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.d.ts +13 -0
- package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -0
- package/lib/detail/button/bottom-submit-button-bar.js +30 -0
- package/lib/detail/button/bottom-submit-button-bar.js.map +1 -0
- package/lib/detail/button/fix-right-submit-button-bar.d.ts +15 -0
- package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -0
- package/lib/detail/button/fix-right-submit-button-bar.js +88 -0
- package/lib/detail/button/fix-right-submit-button-bar.js.map +1 -0
- package/lib/detail/button/submit-button-bar.d.ts +4 -3
- package/lib/detail/button/submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/submit-button-bar.js +8 -90
- package/lib/detail/button/submit-button-bar.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/detail/edit/row-editor.d.ts.map +1 -1
- package/lib/detail/edit/row-editor.js +1 -1
- package/lib/detail/edit/row-editor.js.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.js +1 -1
- package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
- package/lib/layout/MainPage.d.ts.map +1 -1
- package/lib/layout/MainPage.js +50 -10
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/layout/menu/block.d.ts +1 -1
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/block.js +21 -9
- package/lib/layout/menu/block.js.map +1 -1
- package/lib/layout/menu/menu-2layers.js +5 -5
- package/lib/layout/menu/menu-2layers.js.map +1 -1
- package/lib/layout/menu/menu-render.d.ts +6 -4
- package/lib/layout/menu/menu-render.d.ts.map +1 -1
- package/lib/layout/menu/menu-render.js +85 -30
- package/lib/layout/menu/menu-render.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts +2 -2
- package/lib/module/dtmpl-edit-page.js +2 -2
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-view-drawer.d.ts +2 -2
- package/lib/module/dtmpl-view-drawer.js +3 -3
- package/lib/module/dtmpl-view-drawer.js.map +1 -1
- package/lib/module/dtmpl-view-modal.d.ts +2 -2
- package/lib/module/dtmpl-view-modal.js +3 -3
- package/lib/module/dtmpl-view-modal.js.map +1 -1
- package/lib/module/ltmpl-drawer.d.ts +1 -1
- package/lib/module/ltmpl-drawer.js +3 -3
- package/lib/module/ltmpl-drawer.js.map +1 -1
- package/lib/module/ltmpl-modal.d.ts +2 -2
- package/lib/module/ltmpl-modal.d.ts.map +1 -1
- package/lib/module/ltmpl-modal.js +5 -6
- package/lib/module/ltmpl-modal.js.map +1 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +2 -2
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +4 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +2 -4
- package/src/aldehyde/custom-page/dtmpl-custom-edit-modal-page.tsx +2 -2
- package/src/aldehyde/detail/button/bottom-submit-button-bar.tsx +55 -0
- package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +130 -0
- package/src/aldehyde/detail/button/submit-button-bar.tsx +13 -119
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +1 -1
- package/src/aldehyde/detail/edit/row-editor.tsx +0 -1
- package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +1 -1
- package/src/aldehyde/layout/MainPage.tsx +87 -49
- package/src/aldehyde/layout/menu/block.tsx +20 -12
- package/src/aldehyde/layout/menu/menu-2layers.tsx +5 -5
- package/src/aldehyde/layout/menu/menu-render.tsx +108 -48
- package/src/aldehyde/module/dtmpl-edit-page.tsx +2 -2
- package/src/aldehyde/module/dtmpl-view-drawer.tsx +3 -3
- package/src/aldehyde/module/dtmpl-view-modal.tsx +3 -3
- package/src/aldehyde/module/ltmpl-drawer.tsx +3 -3
- package/src/aldehyde/module/ltmpl-modal.tsx +6 -8
- package/src/aldehyde/table/relation-table.tsx +0 -2
- package/src/aldehyde/tmpl/interface.tsx +6 -1
- package/lib/layout/menu/block1.d.ts +0 -18
- package/lib/layout/menu/block1.d.ts.map +0 -1
- package/lib/layout/menu/block1.js +0 -46
- package/lib/layout/menu/block1.js.map +0 -1
- package/src/aldehyde/layout/menu/block1.tsx +0 -81
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React, {RefObject} from 'react'
|
|
2
2
|
import './index.css'
|
|
3
|
-
import {ActionConfig, ButtonName, DtmplConfig, TmplBase} from "../../../aldehyde/tmpl/interface";
|
|
3
|
+
import {ActionConfig, ButtonName, ButtonPosition, DtmplConfig, TmplBase} from "../../../aldehyde/tmpl/interface";
|
|
4
4
|
import {Affix, Button, Popconfirm, Popover} from "antd";
|
|
5
5
|
import {LeftOutlined, SaveOutlined} from '@ant-design/icons';
|
|
6
6
|
import Action from "../../controls/action";
|
|
7
|
+
import FixRightSubmitButtonBar from './fix-right-submit-button-bar'
|
|
7
8
|
import {FormInstance} from "antd/lib/form/hooks/useForm";
|
|
9
|
+
import BottomSubmitButtonBar from "./bottom-submit-button-bar";
|
|
8
10
|
|
|
9
|
-
interface SubmitButtonProps {
|
|
11
|
+
export interface SubmitButtonProps {
|
|
10
12
|
serverKey?:string,
|
|
11
13
|
dtmplConfig: DtmplConfig,
|
|
12
|
-
|
|
14
|
+
position?:ButtonPosition,
|
|
13
15
|
doSubmit: (actionId?: string,codes?:string[],params?:object) => void;
|
|
14
16
|
formRef: RefObject<FormInstance>,
|
|
15
17
|
serial:number,
|
|
@@ -27,126 +29,18 @@ class SubmitButtonBar extends React.PureComponent<SubmitButtonProps, SubmitButto
|
|
|
27
29
|
// stateSerial:0,
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
let buttonSize:number=0;
|
|
32
|
-
if(actions ){
|
|
33
|
-
buttonSize=buttonSize+actions.length;
|
|
34
|
-
}
|
|
35
|
-
if((buttons && buttons.includes('dtmplSave')) ){
|
|
36
|
-
buttonSize=buttonSize+1;
|
|
37
|
-
}
|
|
38
|
-
if (buttonSize>=3) {
|
|
39
|
-
return 120;
|
|
40
|
-
} else if (buttonSize==2){
|
|
41
|
-
return 86;
|
|
42
|
-
}else{
|
|
43
|
-
return 80;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// async componentDidMount() {
|
|
48
|
-
// console.log("SubmitButtonBar this.loadData()");
|
|
49
|
-
//
|
|
50
|
-
// console.log("SubmitButtonBar this.loadData()1");
|
|
51
|
-
// // if(code!=preCode || (!code && preCode)){
|
|
52
|
-
// // await this.loadData();
|
|
53
|
-
// // }else{
|
|
54
|
-
// // formRef.current.resetFields();
|
|
55
|
-
// // }
|
|
56
|
-
// }
|
|
32
|
+
static defaultProps={
|
|
57
33
|
|
|
58
|
-
|
|
59
|
-
// console.log("SubmitButtonBar this.loadData()2");
|
|
60
|
-
// this.setState({
|
|
61
|
-
// stateSerial: this.state.stateSerial + 1,
|
|
62
|
-
// })
|
|
63
|
-
// }
|
|
34
|
+
}
|
|
64
35
|
|
|
65
36
|
render() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const {buttons, actions} = dtmplConfig;
|
|
69
|
-
const cardList: TmplBase[] = [];
|
|
70
|
-
|
|
71
|
-
//console.log(" submit-button-bar serial:",serial);
|
|
72
|
-
// console.log(" submit-button-bar stateSerial:",stateSerial);
|
|
73
|
-
|
|
74
|
-
if (dtmplConfig.premises && dtmplConfig.premises.length > 0) {
|
|
75
|
-
cardList.push({
|
|
76
|
-
id: '1', title: '默认字段',
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
dtmplConfig.groups.forEach(g => {
|
|
80
|
-
cardList.push({
|
|
81
|
-
title: g.title,
|
|
82
|
-
id: g.id,
|
|
83
|
-
});
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
let content
|
|
87
|
-
if (actions && actions.length > 1) {
|
|
88
|
-
content = (
|
|
89
|
-
<div className="btns">
|
|
90
|
-
{actions.map((item, index) => {
|
|
91
|
-
if (index > 1) {
|
|
92
|
-
// return <Popconfirm key={item.id} placement="top" title={"确定要保存修改并执行此操作吗?"}
|
|
93
|
-
// onConfirm={() => doSubmit(item.id)} okText="确定" cancelText="取消">
|
|
94
|
-
// <Button
|
|
95
|
-
// type="primary"
|
|
96
|
-
// >{item.title}</Button>
|
|
97
|
-
// </Popconfirm>
|
|
98
|
-
return <Action serverKey={serverKey} iconType={'icon-title'} hiddenType={'disabled'} buttonType={'primary'} serial={serial} key={item.id} formRef={formRef} actionConfig={item} doAction={doSubmit}></Action>
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
</div>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
37
|
+
const {position, doSubmit, serial, dtmplConfig, formRef} = this.props;
|
|
38
|
+
let posi = position ? position : dtmplConfig.buttonPosition ? dtmplConfig.buttonPosition : undefined
|
|
106
39
|
|
|
107
|
-
return
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
style={{position: 'absolute',bottom:60,right: 15,}} offsetBottom={this.calcOffsetBottom(buttons, actions)}
|
|
112
|
-
>
|
|
113
|
-
<div className={'submitButtonBar'} >
|
|
114
|
-
<ul>
|
|
115
|
-
{buttons.includes('dtmplSave') ? <li key={100}>
|
|
116
|
-
<Button
|
|
117
|
-
onClick={() => doSubmit()}
|
|
118
|
-
type='primary'
|
|
119
|
-
icon={<SaveOutlined/>}
|
|
120
|
-
key="btn" block
|
|
121
|
-
>保 存</Button>
|
|
122
|
-
</li> : ""
|
|
123
|
-
}
|
|
124
|
-
{//处理前两个
|
|
125
|
-
actions ? actions.map((item, index) => {
|
|
126
|
-
if (index < 2) {
|
|
127
|
-
return <li key={index}>
|
|
128
|
-
{/*<Popconfirm placement="left" title={"确定要保存修改并执行此操作吗?"} onConfirm={() => doSubmit(item.id)} okText="确定" cancelText="取消">*/}
|
|
129
|
-
{/*<Button block*/}
|
|
130
|
-
{/* type={'primary'}>{item.title}</Button>*/}
|
|
131
|
-
{/*</Popconfirm>*/}
|
|
132
|
-
<Action serverKey={serverKey} hiddenType={'disabled'} buttonType={'primary-block'} serial={serial} key={item.id} formRef={formRef} actionConfig={item} doAction={doSubmit}></Action>
|
|
133
|
-
</li>
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
) : ""
|
|
137
|
-
}
|
|
138
|
-
{//处理后面的
|
|
139
|
-
actions && actions.length > 2 ?
|
|
140
|
-
<Popover placement="leftTop" content={content} trigger="hover">
|
|
141
|
-
<Button block>
|
|
142
|
-
<LeftOutlined/>{'更多'}
|
|
143
|
-
</Button>
|
|
144
|
-
</Popover> : ""
|
|
145
|
-
}
|
|
146
|
-
</ul>
|
|
147
|
-
</div>
|
|
148
|
-
</Affix>
|
|
149
|
-
)
|
|
40
|
+
return <>{!posi || posi == 'fixedBottomRight' ?
|
|
41
|
+
<FixRightSubmitButtonBar doSubmit={doSubmit} serial={serial} dtmplConfig={dtmplConfig} formRef={formRef}/>
|
|
42
|
+
: <BottomSubmitButtonBar position={posi} doSubmit={doSubmit} serial={serial} dtmplConfig={dtmplConfig} formRef={formRef}/>
|
|
43
|
+
}</>
|
|
150
44
|
}
|
|
151
45
|
}
|
|
152
46
|
|
|
@@ -210,7 +210,7 @@ export default class DtmplEdit extends React.PureComponent<DtmplEditProps, Dtmpl
|
|
|
210
210
|
{showRightNav ?
|
|
211
211
|
<RightBar parentId={id} dtmplConfig={dtmplConfig}/> : ""
|
|
212
212
|
}
|
|
213
|
-
<SubmitButtonBar serverKey={serverKey} serial={serial} dtmplConfig={dtmplConfig} doSubmit={this.doSubmit}
|
|
213
|
+
<SubmitButtonBar serverKey={serverKey} serial={serial} dtmplConfig={dtmplConfig} doSubmit={this.doSubmit} formRef={this.formRef}></SubmitButtonBar>
|
|
214
214
|
<CqueryButtonBar serverKey={serverKey} dtmplConfig={dtmplConfig} mainCode={code}></CqueryButtonBar>
|
|
215
215
|
<PostResult
|
|
216
216
|
open={showPostResult}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import {Layout} from 'antd'
|
|
3
3
|
import Footer from './footer/index';
|
|
4
4
|
import {BlockMenu} from "../tmpl/interface";
|
|
5
5
|
import Header from './header';
|
|
@@ -11,6 +11,7 @@ import Scrollbars from 'react-custom-scrollbars';
|
|
|
11
11
|
import "./common.css"
|
|
12
12
|
import "./coverstyle.css"
|
|
13
13
|
import withRouter from "../routable/withroute";
|
|
14
|
+
|
|
14
15
|
const {Content, Sider} = Layout;
|
|
15
16
|
|
|
16
17
|
interface MainPageProps {
|
|
@@ -23,8 +24,8 @@ interface MainPageState {
|
|
|
23
24
|
currentL2MenuId?: string,
|
|
24
25
|
blocks?: BlockMenu[],
|
|
25
26
|
currentBlockId?: string,
|
|
26
|
-
isImporter?:boolean,
|
|
27
|
-
sideBartitle?:string,
|
|
27
|
+
isImporter?: boolean,
|
|
28
|
+
sideBartitle?: string,
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
@@ -34,8 +35,8 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
34
35
|
blocks: [],
|
|
35
36
|
currentL2MenuId: undefined,
|
|
36
37
|
currentBlockId: undefined,
|
|
37
|
-
isImporter:false,
|
|
38
|
-
sideBartitle:undefined,
|
|
38
|
+
isImporter: false,
|
|
39
|
+
sideBartitle: undefined,
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
async componentDidMount() {
|
|
@@ -56,12 +57,12 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
let blockRes = await HCDataSource.requestBlocks(l2MenuId ? l2MenuId : undefined, blockId ? blockId : undefined);
|
|
59
|
-
this.setState((state)=>({
|
|
60
|
-
isImporter:currentURL.hash.indexOf('/importer')>0,
|
|
61
|
-
blocks: blockRes.blocks?blockRes.blocks:[],
|
|
60
|
+
this.setState((state) => ({
|
|
61
|
+
isImporter: currentURL.hash.indexOf('/importer') > 0,
|
|
62
|
+
blocks: blockRes.blocks ? blockRes.blocks : [],
|
|
62
63
|
currentL2MenuId: blockRes.l2MenuId,
|
|
63
64
|
currentBlockId: blockRes.blockId,
|
|
64
|
-
sideBartitle:blockRes.programName,
|
|
65
|
+
sideBartitle: blockRes.programName,
|
|
65
66
|
}));
|
|
66
67
|
|
|
67
68
|
}
|
|
@@ -74,10 +75,10 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
74
75
|
var searchParams = new URLSearchParams('?' + search);
|
|
75
76
|
let blockId = searchParams.get('blockId');
|
|
76
77
|
let l2MenuId = searchParams.get('menuId');
|
|
77
|
-
let isImporter_= currentURL.hash.indexOf('/importer')>0;
|
|
78
|
-
if(prevState.isImporter!=isImporter_){
|
|
79
|
-
this.setState((state)=>({
|
|
80
|
-
isImporter:isImporter_,
|
|
78
|
+
let isImporter_ = currentURL.hash.indexOf('/importer') > 0;
|
|
79
|
+
if (prevState.isImporter != isImporter_) {
|
|
80
|
+
this.setState((state) => ({
|
|
81
|
+
isImporter: isImporter_,
|
|
81
82
|
}))
|
|
82
83
|
}
|
|
83
84
|
//进一步找找l2MenuId
|
|
@@ -93,7 +94,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
93
94
|
|
|
94
95
|
const {currentL2MenuId, currentBlockId} = this.state;
|
|
95
96
|
if (l2MenuId && currentL2MenuId != l2MenuId) {
|
|
96
|
-
this.setState((state)=>({
|
|
97
|
+
this.setState((state) => ({
|
|
97
98
|
currentL2MenuId: l2MenuId,
|
|
98
99
|
}));
|
|
99
100
|
}
|
|
@@ -102,7 +103,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
102
103
|
blockId = this.findBlockIdOfL2Menu(l2MenuId);
|
|
103
104
|
}
|
|
104
105
|
if (blockId && currentBlockId != blockId) {
|
|
105
|
-
this.setState((state)=>({
|
|
106
|
+
this.setState((state) => ({
|
|
106
107
|
currentBlockId: blockId,
|
|
107
108
|
}));
|
|
108
109
|
}
|
|
@@ -130,11 +131,29 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
130
131
|
const {blocks} = this.state;
|
|
131
132
|
if (leMenuId) {
|
|
132
133
|
for (const block of blocks) {
|
|
133
|
-
|
|
134
|
-
for (const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
if (block.l1Menus) {
|
|
135
|
+
for (const menul1 of block.l1Menus) {
|
|
136
|
+
for (const menul2 of menul1.l2Menus) {
|
|
137
|
+
if (menul2.id == leMenuId) {
|
|
138
|
+
blockId = block.id;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
for (const menul1 of block.items) {
|
|
145
|
+
if (menul1.items) {
|
|
146
|
+
for (const menul2 of menul1.items) {
|
|
147
|
+
if (menul2.id == leMenuId) {
|
|
148
|
+
blockId = block.id;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
if (menul1.id == leMenuId) {
|
|
154
|
+
blockId = block.id;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
138
157
|
}
|
|
139
158
|
}
|
|
140
159
|
}
|
|
@@ -147,13 +166,32 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
147
166
|
const {blocks, currentL2MenuId, currentBlockId} = this.state;
|
|
148
167
|
let result: BlockMenu = undefined;
|
|
149
168
|
|
|
150
|
-
if (currentL2MenuId
|
|
169
|
+
if (currentL2MenuId) {
|
|
151
170
|
for (const block of blocks) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
|
|
172
|
+
if (block.l1Menus) {
|
|
173
|
+
for (const menul1 of block.l1Menus) {
|
|
174
|
+
for (const menul2 of menul1.l2Menus) {
|
|
175
|
+
if (menul2.id == currentL2MenuId) {
|
|
176
|
+
result = block;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
for (const menul1 of block.items) {
|
|
183
|
+
if (menul1.items) {
|
|
184
|
+
for (const menul2 of menul1.items) {
|
|
185
|
+
if (menul2.id == currentL2MenuId) {
|
|
186
|
+
result = block;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
if (menul1.id == currentL2MenuId) {
|
|
192
|
+
result = block;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
157
195
|
}
|
|
158
196
|
}
|
|
159
197
|
}
|
|
@@ -167,50 +205,50 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
167
205
|
}
|
|
168
206
|
}
|
|
169
207
|
}
|
|
170
|
-
if(!result){
|
|
208
|
+
if (!result) {
|
|
171
209
|
result = blocks.at(0);
|
|
172
210
|
}
|
|
173
211
|
return result;
|
|
174
212
|
}
|
|
175
213
|
|
|
176
214
|
toggle = () => {
|
|
177
|
-
this.setState((state)=>({
|
|
215
|
+
this.setState((state) => ({
|
|
178
216
|
collapsed: !this.state.collapsed,
|
|
179
217
|
}));
|
|
180
218
|
};
|
|
181
219
|
|
|
182
220
|
render() {
|
|
183
221
|
|
|
184
|
-
const {collapsed, currentL2MenuId, currentBlockId,isImporter,sideBartitle} = this.state;
|
|
222
|
+
const {collapsed, currentL2MenuId, currentBlockId, isImporter, sideBartitle} = this.state;
|
|
185
223
|
//滚动条回到顶部
|
|
186
224
|
// document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
187
|
-
|
|
225
|
+
// @ts-ignore
|
|
188
226
|
// eslint-disable-next-line no-unused-expressions
|
|
189
227
|
this.scrollbarRef?.current?.scrollToTop();
|
|
190
228
|
return (
|
|
191
|
-
<Scrollbars ref={this.scrollbarRef} style={{
|
|
229
|
+
<Scrollbars ref={this.scrollbarRef} style={{height: 'calc(100vh)'}} autoHide autoHideTimeout={1000}>
|
|
192
230
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
231
|
+
{/*<Row justify="space-around" align="middle" style={{'background':'#0f4da1',height:'80px'}}>*/}
|
|
232
|
+
{/* <Col span={12}>*/}
|
|
233
|
+
{/* <img style={{height:'60px'}} src={Logo}></img>*/}
|
|
234
|
+
{/* </Col>*/}
|
|
235
|
+
{/* <Col span={4}>*/}
|
|
198
236
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<DocumentTitle title={(isImporter?'导入-':"") + this.findBlockTitle(currentBlockId)}>
|
|
237
|
+
{/* </Col>*/}
|
|
238
|
+
{/*</Row>*/}
|
|
239
|
+
<DocumentTitle title={(isImporter ? '导入-' : "") + this.findBlockTitle(currentBlockId)}>
|
|
202
240
|
<Layout>
|
|
203
241
|
<Sider theme={"light"}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
242
|
+
style={{
|
|
243
|
+
// background: '#0f4da1',
|
|
244
|
+
overflow: 'auto',
|
|
245
|
+
height: '100vh',
|
|
246
|
+
position: 'fixed',
|
|
247
|
+
left: 0,
|
|
248
|
+
top: 0,
|
|
249
|
+
bottom: 0,
|
|
250
|
+
}}
|
|
251
|
+
collapsed={collapsed}
|
|
214
252
|
>
|
|
215
253
|
<SideBar title={sideBartitle} blockMenu={this.findCurrentBlock()}
|
|
216
254
|
currentL2MenuId={currentL2MenuId} collapsed={collapsed}/>
|
|
@@ -20,25 +20,33 @@ class Block extends React.PureComponent<BlockProps, BlockState> {
|
|
|
20
20
|
super(props);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
{MenuRender.renderL1Menu(blockMenu.l1Menus,null)}
|
|
26
|
-
</Menu>
|
|
27
|
-
|
|
23
|
+
getSubMenu = (blockMenu:BlockMenu)=>{
|
|
24
|
+
return MenuRender.getMenu(blockMenu,null);
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
|
|
31
27
|
findBlockId = (blocks:BlockMenu[],currentL2MenuId:string) => {
|
|
32
28
|
let blockId:string=undefined;
|
|
33
29
|
for(const block of blocks){
|
|
34
|
-
|
|
35
|
-
for(const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
if(block.l1Menus){
|
|
31
|
+
for(const menul1 of block.l1Menus){
|
|
32
|
+
for(const menul2 of menul1.l2Menus){
|
|
33
|
+
if(menul2.id===currentL2MenuId){
|
|
34
|
+
blockId=block.id;
|
|
35
|
+
return blockId;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}else{
|
|
40
|
+
for(const menul1 of block.items){
|
|
41
|
+
for(const menul2 of menul1.items){
|
|
42
|
+
if(menul2.id===currentL2MenuId){
|
|
43
|
+
blockId=block.id;
|
|
44
|
+
return blockId;
|
|
45
|
+
}
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
48
|
}
|
|
49
|
+
|
|
42
50
|
}
|
|
43
51
|
return blockId;
|
|
44
52
|
}
|
|
@@ -63,7 +71,7 @@ class Block extends React.PureComponent<BlockProps, BlockState> {
|
|
|
63
71
|
blocks.map((item, index) => {
|
|
64
72
|
return <div key={index}
|
|
65
73
|
className={`${item.id == blockId ? "active" : ""} header-block`} style={syyy}>
|
|
66
|
-
<Dropdown
|
|
74
|
+
<Dropdown menu={{ items:this.getSubMenu(item) }}>
|
|
67
75
|
<a className="dropdown-link"
|
|
68
76
|
style={item.id == blockId?{color:'#fff'}:{color:activeColor}}
|
|
69
77
|
rel="noopener noreferrer"
|
|
@@ -20,7 +20,7 @@ class Menu2layers extends React.PureComponent<Menu2layersProps, Menu2layersState
|
|
|
20
20
|
componentDidMount() {
|
|
21
21
|
const {currentL2MenuId, blockMenu,collapsed} = this.props;
|
|
22
22
|
const {openKeys} = this.state;
|
|
23
|
-
let openKey = blockMenu?MenuRender.findOpenId(blockMenu
|
|
23
|
+
let openKey = blockMenu?MenuRender.findOpenId(blockMenu, currentL2MenuId):undefined;
|
|
24
24
|
if(openKey && openKeys.length<1){
|
|
25
25
|
this.setState({
|
|
26
26
|
openKeys:[openKey.toString()]
|
|
@@ -34,15 +34,15 @@ class Menu2layers extends React.PureComponent<Menu2layersProps, Menu2layersState
|
|
|
34
34
|
|
|
35
35
|
if(!preBlockMenu || !blockMenu || blockMenu.id!=preBlockMenu.id ){
|
|
36
36
|
//console.log('currentL2MenuId:',currentL2MenuId);
|
|
37
|
-
let openKey = blockMenu?MenuRender.findOpenId(blockMenu
|
|
37
|
+
let openKey = blockMenu? MenuRender.findOpenId(blockMenu, currentL2MenuId):undefined;
|
|
38
38
|
if (openKey) {
|
|
39
39
|
this.setState({
|
|
40
40
|
openKeys:[openKey],
|
|
41
41
|
})
|
|
42
42
|
}
|
|
43
43
|
}else {
|
|
44
|
-
let openKey = blockMenu?MenuRender.findOpenId(blockMenu
|
|
45
|
-
let preOpenKey = blockMenu?MenuRender.findOpenId(preBlockMenu
|
|
44
|
+
let openKey = blockMenu?MenuRender.findOpenId(blockMenu, currentL2MenuId):undefined;
|
|
45
|
+
let preOpenKey = blockMenu?MenuRender.findOpenId(preBlockMenu, preMenuId):undefined;
|
|
46
46
|
if((!preOpenKey && openKey) || (openKey && openKey!=preOpenKey)){
|
|
47
47
|
this.setState({
|
|
48
48
|
openKeys:[openKey],
|
|
@@ -70,8 +70,8 @@ class Menu2layers extends React.PureComponent<Menu2layersProps, Menu2layersState
|
|
|
70
70
|
onOpenChange={this.handleOpen} //手风琴
|
|
71
71
|
selectedKeys={currentL2MenuId ? [currentL2MenuId.toString()] : undefined}
|
|
72
72
|
openKeys={!collapsed?openKeys:undefined}
|
|
73
|
+
items={blockMenu ? MenuRender.getMenu(blockMenu, undefined,basePath) : []}
|
|
73
74
|
>
|
|
74
|
-
{blockMenu ? MenuRender.renderL1Menu(blockMenu.l1Menus, undefined,basePath) : ""}
|
|
75
75
|
</Menu>
|
|
76
76
|
);
|
|
77
77
|
}
|