aldehyde 0.2.382 → 0.2.384
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/lowcode-components/lowcode-view/component/screen-fit/index.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/screen-fit/index.js +7 -1
- package/lib/lowcode-components/lowcode-view/component/screen-fit/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/index.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/index.js +1 -1
- package/lib/lowcode-components/lowcode-view/index.js.map +1 -1
- package/lib/module/block-menu-tree-drawer.d.ts.map +1 -1
- package/lib/module/block-menu-tree-drawer.js +2 -12
- package/lib/module/block-menu-tree-drawer.js.map +1 -1
- package/lib/module/dtmpl-edit-page.js +5 -4
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-view-drawer.d.ts.map +1 -1
- package/lib/module/dtmpl-view-drawer.js +5 -5
- package/lib/module/dtmpl-view-drawer.js.map +1 -1
- package/lib/module/ltmpl-drawer.d.ts.map +1 -1
- package/lib/module/ltmpl-drawer.js +2 -1
- package/lib/module/ltmpl-drawer.js.map +1 -1
- package/lib/table/select-table.d.ts +2 -0
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +18 -1
- package/lib/table/select-table.js.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +1 -0
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tree/tree-utils.js +1 -1
- package/lib/tree/tree-utils.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +6 -1
- package/src/aldehyde/lowcode-components/lowcode-view/index.tsx +7 -1
- package/src/aldehyde/module/block-menu-tree-drawer.tsx +58 -59
- package/src/aldehyde/module/dtmpl-edit-page.tsx +4 -4
- package/src/aldehyde/module/dtmpl-view-drawer.tsx +42 -41
- package/src/aldehyde/module/ltmpl-drawer.tsx +28 -27
- package/src/aldehyde/table/select-table.tsx +19 -0
- package/src/aldehyde/tmpl/hc-data-source.tsx +23 -22
- package/src/aldehyde/tree/tree-utils.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-unused-expressions */
|
|
1
2
|
import React, { ReactNode, useEffect, useRef, useState } from 'react'
|
|
2
3
|
import debounce from "lodash/debounce";
|
|
3
4
|
import './index.less';
|
|
@@ -56,7 +57,11 @@ export default function ScreenFit(props: ScreenFitProps) {
|
|
|
56
57
|
case 'full-y':
|
|
57
58
|
elRef.current.style.transform = `scale(${heightScale})`;
|
|
58
59
|
scaleChange?.(heightScale, heightScale);
|
|
59
|
-
|
|
60
|
+
if (currentWidth > (+realWidth * heightScale)) {
|
|
61
|
+
elRef.current.style.margin = `0px ${(currentWidth - +realWidth * heightScale) / 2}px`;
|
|
62
|
+
} else {
|
|
63
|
+
elRef.current.style.margin = "0px";
|
|
64
|
+
}
|
|
60
65
|
break;
|
|
61
66
|
default:
|
|
62
67
|
// 按照宽高最小比例进行缩放
|
|
@@ -170,7 +170,13 @@ const LowcodeView = (props: Props) => {
|
|
|
170
170
|
|
|
171
171
|
return (
|
|
172
172
|
<ControllerContext.Provider value={{ setControllers, setSearchParams }}>
|
|
173
|
-
<div className='lowcodeView' style={{
|
|
173
|
+
<div className='lowcodeView' style={{
|
|
174
|
+
height: isFullScreen ? "100vh" : viewHeight[layoutRootPath || "v2"], ...screenFitStyleMap[adaptationType || "scale"],
|
|
175
|
+
background: backgroundColor,
|
|
176
|
+
backgroundImage: `url(${backgroundImage})`,
|
|
177
|
+
backgroundSize: "100% 100%",
|
|
178
|
+
backgroundRepeat: 'no-repeat',
|
|
179
|
+
}}>
|
|
174
180
|
{loading || !layerManager ?
|
|
175
181
|
<Loading />
|
|
176
182
|
:
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {Button, Drawer,message} from 'antd'
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Drawer, message } from 'antd'
|
|
3
3
|
import BlockMenuTree from "../tree/block-menu-auth-tree";
|
|
4
4
|
import HcserviceV3 from '../tmpl/hcservice-v3'
|
|
5
5
|
import translate from "../locale/translate";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface BlockMenuTreeDrawerProps {
|
|
10
|
-
roleCode:string,
|
|
7
|
+
interface BlockMenuTreeDrawerProps {
|
|
8
|
+
roleCode: string,
|
|
11
9
|
onCancel: () => void,
|
|
12
10
|
onOk: () => void,
|
|
13
|
-
placement?:'top' | 'right' | 'bottom' | 'left',
|
|
14
|
-
width?:number,
|
|
15
|
-
open
|
|
11
|
+
placement?: 'top' | 'right' | 'bottom' | 'left',
|
|
12
|
+
width?: number,
|
|
13
|
+
open: boolean,
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
interface BlockMenuTreeDrawerState {
|
|
19
|
-
selectedAuths:string[],
|
|
20
|
-
loading:boolean,
|
|
21
|
-
role?:object
|
|
17
|
+
selectedAuths: string[],
|
|
18
|
+
loading: boolean,
|
|
19
|
+
role?: object
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
export default class BlockMenuTreeDrawer extends React.PureComponent<BlockMenuTreeDrawerProps, BlockMenuTreeDrawerState> {
|
|
25
23
|
|
|
26
24
|
static defaultProps = {
|
|
27
25
|
showConfirm: true,
|
|
28
|
-
width:'500',
|
|
26
|
+
width: '500',
|
|
29
27
|
forceRender: true,
|
|
30
|
-
style: {maxWidth: '92vw', maxHeight: '92vh'},
|
|
31
|
-
placement:'left',
|
|
32
|
-
roleCode:undefined
|
|
28
|
+
style: { maxWidth: '92vw', maxHeight: '92vh' },
|
|
29
|
+
placement: 'left',
|
|
30
|
+
roleCode: undefined
|
|
33
31
|
}
|
|
34
32
|
state = {
|
|
35
|
-
selectedAuths:[],
|
|
36
|
-
loading:true,
|
|
37
|
-
role:undefined
|
|
33
|
+
selectedAuths: [],
|
|
34
|
+
loading: true,
|
|
35
|
+
role: undefined
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
async componentDidMount() {
|
|
@@ -42,73 +40,74 @@ export default class BlockMenuTreeDrawer extends React.PureComponent<BlockMenuTr
|
|
|
42
40
|
await this.loadData();
|
|
43
41
|
}
|
|
44
42
|
async componentDidUpdate(preProps) {
|
|
45
|
-
const {roleCode}=this.props
|
|
46
|
-
const {roleCode:preRoleCode}=preProps
|
|
43
|
+
const { roleCode } = this.props
|
|
44
|
+
const { roleCode: preRoleCode } = preProps
|
|
47
45
|
|
|
48
|
-
if(!preRoleCode
|
|
46
|
+
if (!preRoleCode || preRoleCode != roleCode) {
|
|
49
47
|
//debugger
|
|
50
|
-
|
|
48
|
+
await this.loadData();
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
|
-
loadData=async ()=>{
|
|
54
|
-
const {roleCode}=this.props
|
|
55
|
-
if(!roleCode){
|
|
51
|
+
loadData = async () => {
|
|
52
|
+
const { roleCode } = this.props
|
|
53
|
+
if (!roleCode) {
|
|
56
54
|
return
|
|
57
55
|
}
|
|
58
56
|
this.setState({
|
|
59
57
|
loading: true
|
|
60
58
|
})
|
|
61
59
|
//查询角色对应的权限
|
|
62
|
-
let res=await HcserviceV3.requestRoleAuths(roleCode)
|
|
60
|
+
let res = await HcserviceV3.requestRoleAuths(roleCode)
|
|
63
61
|
|
|
64
62
|
|
|
65
63
|
this.setState({
|
|
66
64
|
loading: false,
|
|
67
|
-
selectedAuths:res?.auths,
|
|
68
|
-
role:res?.role
|
|
65
|
+
selectedAuths: res?.auths,
|
|
66
|
+
role: res?.role
|
|
69
67
|
})
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
|
|
73
71
|
|
|
74
|
-
saveAuth=async ()=>{
|
|
75
|
-
const {roleCode,onOk}=this.props
|
|
76
|
-
let res=await HcserviceV3.postRoleAuths(roleCode,this.state.selectedAuths);
|
|
77
|
-
if(res.status=='success'){
|
|
72
|
+
saveAuth = async () => {
|
|
73
|
+
const { roleCode, onOk } = this.props
|
|
74
|
+
let res = await HcserviceV3.postRoleAuths(roleCode, this.state.selectedAuths);
|
|
75
|
+
if (res.status == 'success') {
|
|
78
76
|
message.success(translate("${保存成功}!"));
|
|
79
77
|
}
|
|
80
|
-
if(onOk)onOk();
|
|
78
|
+
if (onOk) onOk();
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
|
|
84
82
|
render() {
|
|
85
|
-
const {
|
|
86
|
-
|
|
83
|
+
const { width, onCancel, open } = this.props;
|
|
84
|
+
const placement = this.props.placement || 'left';
|
|
85
|
+
const { loading, role } = this.state;
|
|
87
86
|
return (<Drawer
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
87
|
+
loading={loading}
|
|
88
|
+
title={role?.name}
|
|
89
|
+
placement={placement}
|
|
90
|
+
closable={true}
|
|
91
|
+
mask={false}
|
|
92
|
+
onClose={onCancel}
|
|
93
|
+
// onOk={()=>this.saveAuth}
|
|
94
|
+
open={open}
|
|
95
|
+
width={width}
|
|
96
|
+
extra={[<Button type={'primary'} onClick={this.saveAuth} >{translate("${保存}")}</Button>]}
|
|
97
|
+
style={{
|
|
98
|
+
maxWidth: '92vw',
|
|
99
|
+
}}
|
|
100
|
+
// extra={
|
|
101
|
+
// <Space>{this.getFooter()}</Space>
|
|
102
|
+
// }
|
|
103
|
+
>
|
|
104
|
+
<BlockMenuTree checks={this.state.selectedAuths} onChange={(auths) => {
|
|
105
|
+
this.setState({
|
|
106
|
+
selectedAuths: auths
|
|
107
|
+
})
|
|
108
|
+
}}></BlockMenuTree>
|
|
110
109
|
</Drawer>
|
|
111
|
-
|
|
110
|
+
)
|
|
112
111
|
|
|
113
112
|
}
|
|
114
113
|
|
|
@@ -399,12 +399,12 @@ export default class DtmplEditPage extends React.PureComponent<
|
|
|
399
399
|
mainCode,
|
|
400
400
|
width,
|
|
401
401
|
pageType,
|
|
402
|
-
placement,
|
|
403
402
|
maxColsOnRow,
|
|
404
403
|
title,
|
|
405
404
|
serverKey, parentFormInstance
|
|
406
405
|
} = this.props;
|
|
407
406
|
const { dtmplConfig, id, dtmplData, valueFieldMap } = this.state;
|
|
407
|
+
const placement = this.props.placement || "left";
|
|
408
408
|
|
|
409
409
|
let title1 = title ? title : dtmplConfig ? dtmplConfig.title : "";
|
|
410
410
|
const { translate } = this.context;
|
|
@@ -460,11 +460,11 @@ export default class DtmplEditPage extends React.PureComponent<
|
|
|
460
460
|
width={width}
|
|
461
461
|
onClose={onCancel}
|
|
462
462
|
open={open}
|
|
463
|
-
height={
|
|
463
|
+
height={["top", "bottom"].includes(placement) ? height : "calc(100%)"}
|
|
464
464
|
style={{
|
|
465
|
-
maxWidth:
|
|
465
|
+
maxWidth: ["top", "bottom"].includes(placement) ? "100vw" : "92vw",
|
|
466
466
|
border: "2px solid #d9d9d9",
|
|
467
|
-
width
|
|
467
|
+
width,
|
|
468
468
|
}}
|
|
469
469
|
extra={<Space>{this.getFooter()}</Space>}
|
|
470
470
|
>
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import React, {ReactNode} from 'react'
|
|
2
|
-
import {Drawer, Space, Button} from 'antd'
|
|
1
|
+
import React, { ReactNode } from 'react'
|
|
2
|
+
import { Drawer, Space, Button } from 'antd'
|
|
3
3
|
import DtmplViewCard from "./dtmpl-view-card";
|
|
4
|
-
import {DtmplBaseProps} from "../tmpl/interface";
|
|
5
|
-
import ToolTipBar from "../detail/tooltipbar";
|
|
4
|
+
import { DtmplBaseProps } from "../tmpl/interface";
|
|
6
5
|
|
|
7
|
-
interface DtmplViewDrawerProps extends DtmplBaseProps{
|
|
8
|
-
title?:ReactNode,
|
|
6
|
+
interface DtmplViewDrawerProps extends DtmplBaseProps {
|
|
7
|
+
title?: ReactNode,
|
|
9
8
|
open: boolean,
|
|
10
9
|
onClose: () => void,
|
|
11
|
-
placement?:'top' | 'right' | 'bottom' | 'left',
|
|
12
|
-
width?:string|number,
|
|
13
|
-
height?:string|number,
|
|
14
|
-
cancelText:string,
|
|
15
|
-
editable?:boolean,
|
|
10
|
+
placement?: 'top' | 'right' | 'bottom' | 'left',
|
|
11
|
+
width?: string | number,
|
|
12
|
+
height?: string | number,
|
|
13
|
+
cancelText: string,
|
|
14
|
+
editable?: boolean,
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
interface DtmplViewDrawerState {
|
|
@@ -21,18 +20,18 @@ interface DtmplViewDrawerState {
|
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
class DtmplViewDrawer extends React.PureComponent<DtmplViewDrawerProps, DtmplViewDrawerState> {
|
|
24
|
-
state={
|
|
23
|
+
state = {
|
|
25
24
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
static defaultProps = {
|
|
29
28
|
height: "82vh",
|
|
30
|
-
width:"82vw",
|
|
29
|
+
width: "82vw",
|
|
31
30
|
forceRender: true,
|
|
32
31
|
cancelText: "关闭",
|
|
33
|
-
placement:'left',
|
|
34
|
-
open:false,
|
|
35
|
-
editable:true,
|
|
32
|
+
placement: 'left',
|
|
33
|
+
open: false,
|
|
34
|
+
editable: true,
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
async componentDidMount() {
|
|
@@ -40,31 +39,33 @@ class DtmplViewDrawer extends React.PureComponent<DtmplViewDrawerProps, DtmplVie
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
render() {
|
|
43
|
-
const {title,sourceId,code,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
|
|
42
|
+
const { title, sourceId, code, open, onClose, width, height, cancelText, editable, serverKey, codeSource } = this.props;
|
|
43
|
+
const placement = this.props.placement || 'left';
|
|
44
|
+
|
|
45
|
+
return (<Drawer
|
|
46
|
+
height={["top", "bottom"].includes(placement) ? height : "100%"}
|
|
47
|
+
placement={placement}
|
|
48
|
+
title={title}
|
|
49
|
+
closable={true}
|
|
50
|
+
mask={false}
|
|
51
|
+
destroyOnHidden={true}
|
|
52
|
+
onClose={onClose}
|
|
53
|
+
open={open}
|
|
54
|
+
style={{
|
|
55
|
+
maxWidth: ["top", "bottom"].includes(placement) ? "100vw" : "92vw",
|
|
56
|
+
border: "2px solid #d9d9d9",
|
|
57
|
+
width
|
|
58
|
+
// borderRightWidth:"2px",
|
|
59
|
+
// borderLeftWidth:"2px",
|
|
60
|
+
}}
|
|
61
|
+
extra={
|
|
62
|
+
<Space>
|
|
63
|
+
<Button onClick={() => onClose()}>{cancelText}</Button>
|
|
64
|
+
</Space>
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
<DtmplViewCard codeSource={codeSource} serverKey={serverKey} editable={editable} sourceId={sourceId} code={code} />
|
|
68
|
+
</Drawer>)
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React, {ReactNode} from 'react';
|
|
2
|
-
import {Drawer} from 'antd'
|
|
3
|
-
import LtmplTable, {LtmplTableProps} from "./ltmpl-table";
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Drawer } from 'antd'
|
|
3
|
+
import LtmplTable, { LtmplTableProps } from "./ltmpl-table";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
interface LtmplDrawPageProps extends LtmplTableProps {
|
|
7
7
|
onCancel: () => void,
|
|
8
|
-
placement?:'top' | 'right' | 'bottom' | 'left',
|
|
9
|
-
title?:ReactNode,
|
|
10
|
-
width?:number,
|
|
11
|
-
open:boolean,
|
|
8
|
+
placement?: 'top' | 'right' | 'bottom' | 'left',
|
|
9
|
+
title?: ReactNode,
|
|
10
|
+
width?: number,
|
|
11
|
+
open: boolean,
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface LtmplDrawPageState {
|
|
@@ -19,12 +19,12 @@ export default class LtmplDrawer extends React.PureComponent<LtmplDrawPageProps,
|
|
|
19
19
|
|
|
20
20
|
static defaultProps = {
|
|
21
21
|
showConfirm: true,
|
|
22
|
-
width:'76vw',
|
|
22
|
+
width: '76vw',
|
|
23
23
|
forceRender: true,
|
|
24
|
-
style: {maxWidth: '92vw', maxHeight: '92vh'},
|
|
24
|
+
style: { maxWidth: '92vw', maxHeight: '92vh' },
|
|
25
25
|
okText: "确定",
|
|
26
26
|
cancelText: "取消",
|
|
27
|
-
placement:'left',
|
|
27
|
+
placement: 'left',
|
|
28
28
|
}
|
|
29
29
|
state = {
|
|
30
30
|
|
|
@@ -32,26 +32,27 @@ export default class LtmplDrawer extends React.PureComponent<LtmplDrawPageProps,
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
render() {
|
|
35
|
-
const {title,
|
|
35
|
+
const { title, width, onCancel, open, ...other } = this.props;
|
|
36
|
+
const placement = this.props.placement || 'left';
|
|
36
37
|
|
|
37
38
|
return (<Drawer
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
title={title}
|
|
40
|
+
placement={placement}
|
|
41
|
+
closable={true}
|
|
42
|
+
mask={false}
|
|
43
|
+
onClose={onCancel}
|
|
44
|
+
open={open}
|
|
45
|
+
width={width}
|
|
46
|
+
style={{
|
|
47
|
+
maxWidth: '92vw',
|
|
48
|
+
}}
|
|
49
|
+
// extra={
|
|
50
|
+
// <Space>{this.getFooter()}</Space>
|
|
51
|
+
// }
|
|
52
|
+
>
|
|
53
|
+
<LtmplTable {...other}></LtmplTable>
|
|
53
54
|
</Drawer>
|
|
54
|
-
|
|
55
|
+
)
|
|
55
56
|
|
|
56
57
|
}
|
|
57
58
|
|
|
@@ -332,6 +332,24 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
+
doSelectedAction = async (actionId: string, codes, params: object) => {
|
|
336
|
+
const { selectedRows } = this.props;
|
|
337
|
+
this.doAction(actionId, selectedRows, params);
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
doAction = async (actionId: string, selectedRows: SelectedRow[], params) => {
|
|
341
|
+
const { serverKey } = this.props;
|
|
342
|
+
const { selectConfig, criteriaData } = this.state;
|
|
343
|
+
this.setState({ loading: true });
|
|
344
|
+
let result: boolean = await HcserviceV3.postActions(serverKey, actionId, selectedRows, params);
|
|
345
|
+
if (result) {
|
|
346
|
+
//重新加载数据
|
|
347
|
+
await this.loadData(selectConfig, criteriaData);
|
|
348
|
+
} else {
|
|
349
|
+
this.setState({ loading: false });
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
|
|
335
353
|
|
|
336
354
|
render() {
|
|
337
355
|
let { maxSelectedRows, selectedRows, selectedDatas, serverKey, sourceId, mainCode, fieldConfig, funcMode } = this.props;
|
|
@@ -370,6 +388,7 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
370
388
|
data={criteriaData}
|
|
371
389
|
doSearch={this.doSearch} loading={loading}
|
|
372
390
|
doCustomButton={() => this.editItem()}
|
|
391
|
+
doAction={this.doSelectedAction}
|
|
373
392
|
/>
|
|
374
393
|
</div> : null}
|
|
375
394
|
<QueryTable key={"QueryTable" + sourceId} serverKey={serverKey} maxSelectedRows={maxSelectedRows ? maxSelectedRows : selectConfig.maxSelectedRows}
|
|
@@ -169,9 +169,9 @@ async function loadEnum(serverKey: string, mstrucIds: string[], path?: string) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
function HCDataSource() {}
|
|
172
|
+
function HCDataSource() { }
|
|
173
173
|
|
|
174
|
-
HCDataSource.loadEnumOfFields = async function(
|
|
174
|
+
HCDataSource.loadEnumOfFields = async function (
|
|
175
175
|
serverKey: string,
|
|
176
176
|
fields: FieldBase[]
|
|
177
177
|
) {
|
|
@@ -179,7 +179,7 @@ HCDataSource.loadEnumOfFields = async function(
|
|
|
179
179
|
await loadEnum(serverKey, mstrucIds);
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
HCDataSource.loadEnumOfFieldsWithPath = async function(
|
|
182
|
+
HCDataSource.loadEnumOfFieldsWithPath = async function (
|
|
183
183
|
serverKey: string,
|
|
184
184
|
fields: FieldBase[],
|
|
185
185
|
path: string
|
|
@@ -188,7 +188,7 @@ HCDataSource.loadEnumOfFieldsWithPath = async function(
|
|
|
188
188
|
await loadEnum(serverKey, mstrucIds, path);
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
-
HCDataSource.getOptions = async function(serverKey: string, mstrucId: string) {
|
|
191
|
+
HCDataSource.getOptions = async function (serverKey: string, mstrucId: string) {
|
|
192
192
|
if (!mstrucId) {
|
|
193
193
|
return null;
|
|
194
194
|
}
|
|
@@ -209,7 +209,7 @@ HCDataSource.getOptions = async function(serverKey: string, mstrucId: string) {
|
|
|
209
209
|
return enumMap.get(mstrucId);
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
-
HCDataSource.requestLtmplConfig = async function(
|
|
212
|
+
HCDataSource.requestLtmplConfig = async function (
|
|
213
213
|
serverKey: string,
|
|
214
214
|
sourceId: string
|
|
215
215
|
) {
|
|
@@ -224,7 +224,7 @@ HCDataSource.requestLtmplConfig = async function(
|
|
|
224
224
|
}
|
|
225
225
|
return ltmplConfigMap.get(sourceId);
|
|
226
226
|
};
|
|
227
|
-
HCDataSource.requestL2LtmplConfig = async function(
|
|
227
|
+
HCDataSource.requestL2LtmplConfig = async function (
|
|
228
228
|
serverKey: string,
|
|
229
229
|
sourceId: string
|
|
230
230
|
) {
|
|
@@ -240,7 +240,7 @@ HCDataSource.requestL2LtmplConfig = async function(
|
|
|
240
240
|
return l2LtmplConfigMap.get(sourceId);
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
HCDataSource.requestSelectConfig = async function(
|
|
243
|
+
HCDataSource.requestSelectConfig = async function (
|
|
244
244
|
serverKey: string,
|
|
245
245
|
sourceId: string
|
|
246
246
|
) {
|
|
@@ -254,7 +254,7 @@ HCDataSource.requestSelectConfig = async function(
|
|
|
254
254
|
}
|
|
255
255
|
return selectConfigMap.get(sourceId);
|
|
256
256
|
};
|
|
257
|
-
HCDataSource.requestDtmplConfig = async function(
|
|
257
|
+
HCDataSource.requestDtmplConfig = async function (
|
|
258
258
|
serverKey: string,
|
|
259
259
|
sourceId: string,
|
|
260
260
|
code: string
|
|
@@ -278,7 +278,7 @@ HCDataSource.requestDtmplConfig = async function(
|
|
|
278
278
|
return dtmplConfigMap.get(sourceId);
|
|
279
279
|
};
|
|
280
280
|
|
|
281
|
-
HCDataSource.requestTtmplConfig = async function(
|
|
281
|
+
HCDataSource.requestTtmplConfig = async function (
|
|
282
282
|
serverKey: string,
|
|
283
283
|
sourceId: string
|
|
284
284
|
) {
|
|
@@ -290,7 +290,7 @@ HCDataSource.requestTtmplConfig = async function(
|
|
|
290
290
|
return ttmplConfigMap.get(sourceId);
|
|
291
291
|
};
|
|
292
292
|
|
|
293
|
-
HCDataSource.requestViewDtmplConfig = async function(
|
|
293
|
+
HCDataSource.requestViewDtmplConfig = async function (
|
|
294
294
|
serverKey: string,
|
|
295
295
|
sourceId: string
|
|
296
296
|
) {
|
|
@@ -305,7 +305,7 @@ HCDataSource.requestViewDtmplConfig = async function(
|
|
|
305
305
|
return viewDtmplConfigMap.get(sourceId);
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
-
HCDataSource.requestAddDtmplConfig = async function(
|
|
308
|
+
HCDataSource.requestAddDtmplConfig = async function (
|
|
309
309
|
serverKey: string,
|
|
310
310
|
sourceId: string,
|
|
311
311
|
addTmplId: string
|
|
@@ -338,12 +338,12 @@ HCDataSource.requestAddDtmplConfig = async function(
|
|
|
338
338
|
// return ltmplConfigMap.get(sourceId);
|
|
339
339
|
// };
|
|
340
340
|
|
|
341
|
-
HCDataSource.getEnums = function(mstrucId: string): EnumItem[] {
|
|
341
|
+
HCDataSource.getEnums = function (mstrucId: string): EnumItem[] {
|
|
342
342
|
//这里是不是后续可以考虑防止串改
|
|
343
343
|
return enumMap.get(mstrucId);
|
|
344
344
|
};
|
|
345
345
|
|
|
346
|
-
HCDataSource.getEnumsValueMap = function(
|
|
346
|
+
HCDataSource.getEnumsValueMap = function (
|
|
347
347
|
mstrucId: string
|
|
348
348
|
): Map<string, string> {
|
|
349
349
|
//这里是不是后续可以考虑防止串改
|
|
@@ -364,7 +364,7 @@ HCDataSource.getEnumsValueMap = function(
|
|
|
364
364
|
return map;
|
|
365
365
|
};
|
|
366
366
|
|
|
367
|
-
HCDataSource.getEnumOption = function(
|
|
367
|
+
HCDataSource.getEnumOption = function (
|
|
368
368
|
mstrucId: string,
|
|
369
369
|
enumValue: string
|
|
370
370
|
): EnumItem {
|
|
@@ -428,7 +428,7 @@ HCDataSource.requestBlocks = async (l2MenuId: string, blockId: string) => {
|
|
|
428
428
|
};
|
|
429
429
|
|
|
430
430
|
HCDataSource.initfastMenu = async () => {
|
|
431
|
-
|
|
431
|
+
if (!fastMenuCached) {
|
|
432
432
|
if (fastMenuCache.size < 1) {
|
|
433
433
|
let re = await HcserviceV3.requestFastMenu();
|
|
434
434
|
if (re) {
|
|
@@ -438,7 +438,7 @@ HCDataSource.initfastMenu = async () => {
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
}
|
|
441
|
-
|
|
441
|
+
fastMenuCached = true;
|
|
442
442
|
}
|
|
443
443
|
};
|
|
444
444
|
|
|
@@ -446,7 +446,7 @@ HCDataSource.fastMenu = async (key: string) => {
|
|
|
446
446
|
// let result:Map<string,Level2Menu[]> ;
|
|
447
447
|
// if (!fastMenuCached) {
|
|
448
448
|
// fastMenuCached = true;
|
|
449
|
-
|
|
449
|
+
let re = await HCDataSource.initfastMenu();
|
|
450
450
|
//}
|
|
451
451
|
return fastMenuCache.get(key);
|
|
452
452
|
};
|
|
@@ -484,7 +484,7 @@ HCDataSource.fastMenu = async (key: string) => {
|
|
|
484
484
|
// return [...workbenchCache];
|
|
485
485
|
// }
|
|
486
486
|
|
|
487
|
-
HCDataSource.reload = async function(roles: string[]) {
|
|
487
|
+
HCDataSource.reload = async function (roles: string[]) {
|
|
488
488
|
// if(roles.includes("admin")){
|
|
489
489
|
let res = await HcserviceV3.reload();
|
|
490
490
|
if (res.status != "success") {
|
|
@@ -499,19 +499,19 @@ HCDataSource.reload = async function(roles: string[]) {
|
|
|
499
499
|
// }
|
|
500
500
|
};
|
|
501
501
|
|
|
502
|
-
HCDataSource.cache = function(data: DtmplData) {
|
|
502
|
+
HCDataSource.cache = function (data: DtmplData) {
|
|
503
503
|
if (data) {
|
|
504
504
|
// console.log('put----',data);
|
|
505
505
|
objctCacheMap.set(data.code, data);
|
|
506
506
|
}
|
|
507
507
|
};
|
|
508
508
|
|
|
509
|
-
HCDataSource.getCache = function(code: string) {
|
|
509
|
+
HCDataSource.getCache = function (code: string) {
|
|
510
510
|
//console.log('objctCacheMap',objctCacheMap);
|
|
511
511
|
return objctCacheMap.get(code);
|
|
512
512
|
};
|
|
513
513
|
|
|
514
|
-
HCDataSource.clear = async function() {
|
|
514
|
+
HCDataSource.clear = async function () {
|
|
515
515
|
fastMenuCache.clear();
|
|
516
516
|
enumMap.clear();
|
|
517
517
|
ltmplConfigMap.clear();
|
|
@@ -523,11 +523,12 @@ HCDataSource.clear = async function() {
|
|
|
523
523
|
// optionsMap.clear();
|
|
524
524
|
blocksCache.splice(0, blocksCache.length);
|
|
525
525
|
blocksCached = false;
|
|
526
|
-
fastMenuCached=false;
|
|
526
|
+
fastMenuCached = false;
|
|
527
527
|
// quickEntranceCache.splice(0, quickEntranceCache.length);
|
|
528
528
|
// messageCache.splice(0, quickEntranceCache.length);
|
|
529
529
|
// workbenchCache.splice(0, workbenchCache.length);
|
|
530
530
|
objctCacheMap.clear();
|
|
531
|
+
ttmplConfigMap.clear();
|
|
531
532
|
};
|
|
532
533
|
|
|
533
534
|
export default HCDataSource; //对外 TmplDataSource
|
|
@@ -205,7 +205,7 @@ export default class TreeUtils {
|
|
|
205
205
|
children.forEach((no) => {
|
|
206
206
|
let n = { ...no };
|
|
207
207
|
let v = n.searchValue ? n.searchValue : n.name;
|
|
208
|
-
if (v
|
|
208
|
+
if (v?.indexOf(searchValue) >= 0) {
|
|
209
209
|
newNodes.push(n);
|
|
210
210
|
}
|
|
211
211
|
if (n.children && n.children.length > 0) {
|