aldehyde 0.2.313 → 0.2.315
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/direct-file-view/index.d.ts.map +1 -1
- package/lib/controls/direct-file-view/index.js +15 -7
- package/lib/controls/direct-file-view/index.js.map +1 -1
- package/lib/controls/direct-upload/index.d.ts.map +1 -1
- package/lib/controls/direct-upload/index.js +13 -7
- package/lib/controls/direct-upload/index.js.map +1 -1
- package/lib/login2/login-page.d.ts.map +1 -1
- package/lib/login2/login-page.js +7 -8
- package/lib/login2/login-page.js.map +1 -1
- package/lib/login3/index.less +3 -3
- package/lib/login3/login-page.d.ts.map +1 -1
- package/lib/login3/login-page.js +2 -1
- package/lib/login3/login-page.js.map +1 -1
- package/lib/lowcode-components/base-map/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-map/index.js +8 -4
- package/lib/lowcode-components/base-map/index.js.map +1 -1
- package/lib/lowcode-components/effectScatter-map/index.d.ts.map +1 -1
- package/lib/lowcode-components/effectScatter-map/index.js +8 -4
- package/lib/lowcode-components/effectScatter-map/index.js.map +1 -1
- package/lib/lowcode-components/effectScatter-map-3d/index.d.ts.map +1 -1
- package/lib/lowcode-components/effectScatter-map-3d/index.js +8 -4
- package/lib/lowcode-components/effectScatter-map-3d/index.js.map +1 -1
- package/lib/lowcode-components/index.d.ts +2 -0
- package/lib/lowcode-components/index.d.ts.map +1 -1
- package/lib/lowcode-components/index.js +3 -1
- package/lib/lowcode-components/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.js +8 -0
- package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -1
- package/lib/lowcode-components/placeholder-component/index.d.ts +13 -0
- package/lib/lowcode-components/placeholder-component/index.d.ts.map +1 -0
- package/lib/lowcode-components/placeholder-component/index.js +33 -0
- package/lib/lowcode-components/placeholder-component/index.js.map +1 -0
- package/lib/tree/act-tree.d.ts.map +1 -1
- package/lib/tree/act-tree.js +2 -7
- package/lib/tree/act-tree.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 +15 -0
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/direct-file-view/index.tsx +23 -7
- package/src/aldehyde/controls/direct-upload/index.tsx +20 -7
- package/src/aldehyde/login2/login-page.tsx +41 -42
- package/src/aldehyde/login3/index.less +3 -3
- package/src/aldehyde/login3/login-page.tsx +5 -3
- package/src/aldehyde/lowcode-components/base-map/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/effectScatter-map-3d/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/index.ts +5 -2
- package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +8 -0
- package/src/aldehyde/lowcode-components/placeholder-component/index.tsx +57 -0
- package/src/aldehyde/tree/act-tree.tsx +8 -13
- package/src/aldehyde/units/index.tsx +74 -58
|
@@ -4,14 +4,14 @@ import LoginBgPng from "./img/login-bg.png";
|
|
|
4
4
|
import { useLocale } from "../locale/useLocale";
|
|
5
5
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
6
6
|
import ProgramConfig from "../units";
|
|
7
|
-
import { Col, Row} from "antd";
|
|
7
|
+
import { Col, Row } from "antd";
|
|
8
8
|
import ResetPassword from "../layout/menu/reset-password";
|
|
9
|
-
import {SafetyCertificateTwoTone} from '@ant-design/icons'
|
|
9
|
+
import { SafetyCertificateTwoTone } from '@ant-design/icons'
|
|
10
10
|
type LoginPageProps = {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
programName?: string;
|
|
12
|
+
copyright?: string;
|
|
13
13
|
};
|
|
14
|
-
const LoginPage = (props:LoginPageProps) => {
|
|
14
|
+
const LoginPage = (props: LoginPageProps) => {
|
|
15
15
|
|
|
16
16
|
const { translate } = useLocale();
|
|
17
17
|
|
|
@@ -40,51 +40,50 @@ const LoginPage = (props:LoginPageProps) => {
|
|
|
40
40
|
aspectRatio: "1/1",
|
|
41
41
|
}}
|
|
42
42
|
>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{props.programName?translate("${" + props.programName + "}"): translate("${" + ProgramConfig.programName() + "}")}
|
|
43
|
+
<div
|
|
44
|
+
style={{
|
|
45
|
+
fontWeight: 600,
|
|
46
|
+
fontSize: "30px",
|
|
47
|
+
color: "#222222",
|
|
48
|
+
marginBottom: 10,
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{translate("${欢迎,登录}")}
|
|
52
|
+
</div>
|
|
53
|
+
<div
|
|
54
|
+
style={{
|
|
55
|
+
fontWeight: 600,
|
|
56
|
+
fontSize: "24px",
|
|
57
|
+
color: "#222222",
|
|
58
|
+
marginBottom: 40,
|
|
59
|
+
}}
|
|
60
|
+
>{props.programName == "Aldehyde" ? "" :
|
|
61
|
+
<><SafetyCertificateTwoTone />
|
|
62
|
+
{props.programName ? translate("${" + props.programName + "}") : translate("${" + ProgramConfig.programName() + "}")}
|
|
64
63
|
</>}
|
|
65
|
-
|
|
64
|
+
</div>
|
|
66
65
|
<Login
|
|
67
66
|
onFinish={(token) => {
|
|
68
67
|
HCDataSource.clear();
|
|
69
68
|
window.location.hash = "/v2/home";
|
|
70
|
-
|
|
69
|
+
ProgramConfig.setHydrocarbonToken(token);
|
|
71
70
|
}}
|
|
72
71
|
></Login>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
<Row>
|
|
73
|
+
<Col span={6} offset={18}><ResetPassword showUserName={true}></ResetPassword></Col>
|
|
74
|
+
</Row>
|
|
75
|
+
{props.copyright ?
|
|
76
76
|
<div
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</
|
|
86
|
-
|
|
87
|
-
</div>
|
|
77
|
+
style={{
|
|
78
|
+
fontWeight: 600,
|
|
79
|
+
fontSize: "14px",
|
|
80
|
+
color: "#999",
|
|
81
|
+
marginTop: 40,
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
{"Copyright ◎ 2025" + (props.copyright || "")}
|
|
85
|
+
</div> : ""
|
|
86
|
+
}
|
|
88
87
|
</div>
|
|
89
88
|
</div>
|
|
90
89
|
);
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
flex-direction: row-reverse;
|
|
10
10
|
justify-content: flex-start;
|
|
11
11
|
align-items: center;
|
|
12
|
+
overflow: hidden;
|
|
12
13
|
|
|
13
14
|
.login-logo-img {
|
|
14
15
|
position: absolute;
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
|
|
63
64
|
.login-form {
|
|
64
65
|
padding: 40px;
|
|
65
|
-
min-height:
|
|
66
|
+
min-height: 350px;
|
|
66
67
|
position: relative;
|
|
67
68
|
|
|
68
69
|
.ant-input::placeholder {
|
|
@@ -95,8 +96,7 @@
|
|
|
95
96
|
font-weight: 600;
|
|
96
97
|
font-size: 14px;
|
|
97
98
|
color: #ffffff;
|
|
98
|
-
|
|
99
|
-
bottom: 40px;
|
|
99
|
+
margin-top: 40px;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -54,9 +54,11 @@ const LoginPage = (props: LoginPageProps) => {
|
|
|
54
54
|
<div className="reset-password">
|
|
55
55
|
<ResetPassword showUserName={true} />
|
|
56
56
|
</div>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
{props.copyright ?
|
|
58
|
+
<div className="login-copyright">
|
|
59
|
+
{"Copyright ◎ 2025" + (props.copyright || "")}
|
|
60
|
+
</div> : ""
|
|
61
|
+
}
|
|
60
62
|
</div>
|
|
61
63
|
</div>
|
|
62
64
|
</div >
|
|
@@ -159,6 +159,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
159
159
|
// 自定义弹窗渲染
|
|
160
160
|
const customizeTooltipConfig = (config) => {
|
|
161
161
|
const { title, width, height, padding, backgroundColor, backgroundImage, content } = config;
|
|
162
|
+
let titleText = title.text;
|
|
162
163
|
return {
|
|
163
164
|
padding: 0,
|
|
164
165
|
borderWidth: 0,
|
|
@@ -167,10 +168,11 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
167
168
|
formatter: (params) => {
|
|
168
169
|
const itemData = params.data.itemData;
|
|
169
170
|
const dom = document.createElement("div");
|
|
171
|
+
if (title.titleType === "d1") { titleText = itemData?.value?.[title.titleType] || ""; }
|
|
170
172
|
const bgImg = `background-image: url(${backgroundImage});background-size: 100% 100%;background-repeat: no-repeat;background-position: center;`;
|
|
171
173
|
dom.style = `width:${width}px;height:${height}px;${backgroundImage ? bgImg : `background:${backgroundColor}`}`;
|
|
172
174
|
dom.innerHTML = `<div style="padding:${padding}px;width:100%;height:100%">
|
|
173
|
-
${title?.text ? `<div style="width:100%;margin-bottom:4px; font-size: ${title.fontSize}px; color: ${title.color}; text-align: ${title.position}">${
|
|
175
|
+
${title?.text ? `<div style="width:100%;margin-bottom:4px; font-size: ${title.fontSize}px; color: ${title.color}; text-align: ${title.position}">${titleText}</div>` : ""}
|
|
174
176
|
${content?.value?.map(r => itemData?.config?.[r] && `<div style="width:100%;display:flex;justify-content:space-between;align-items:center; font-size: ${content.fontSize}px; color: ${content.color};">
|
|
175
177
|
<div style="width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${itemData?.config?.[r] || ""}</div>
|
|
176
178
|
<div style="width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right">${itemData?.value?.[r] || ""}</div>
|
|
@@ -185,6 +185,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
185
185
|
// 自定义弹窗渲染
|
|
186
186
|
const customizeTooltipConfig = (config) => {
|
|
187
187
|
const { title, width, height, padding, backgroundColor, backgroundImage, content } = config;
|
|
188
|
+
let titleText = title.text;
|
|
188
189
|
return {
|
|
189
190
|
padding: 0,
|
|
190
191
|
borderWidth: 0,
|
|
@@ -193,10 +194,11 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
193
194
|
formatter: (params) => {
|
|
194
195
|
const itemData = params.data.itemData;
|
|
195
196
|
const dom = document.createElement("div");
|
|
197
|
+
if (title.titleType === "d1") { titleText = itemData?.value?.[title.titleType]; }
|
|
196
198
|
const bgImg = `background-image: url(${backgroundImage});background-size: 100% 100%;background-repeat: no-repeat;background-position: center;`;
|
|
197
199
|
dom.style = `width:${width}px;height:${height}px;${backgroundImage ? bgImg : `background:${backgroundColor}`}`;
|
|
198
200
|
dom.innerHTML = `<div style="padding:${padding}px;width:100%;height:100%">
|
|
199
|
-
${title?.text ? `<div style="width:100%;margin-bottom:4px; font-size: ${title.fontSize}px; color: ${title.color}; text-align: ${title.position}">${
|
|
201
|
+
${title?.text ? `<div style="width:100%;margin-bottom:4px; font-size: ${title.fontSize}px; color: ${title.color}; text-align: ${title.position}">${titleText}</div>` : ""}
|
|
200
202
|
${content?.value?.map(r => itemData?.config?.[r] && `<div style="width:100%;display:flex;justify-content:space-between;align-items:center; font-size: ${content.fontSize}px; color: ${content.color};">
|
|
201
203
|
<div style="width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${itemData?.config?.[r] || ""}</div>
|
|
202
204
|
<div style="width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right">${itemData?.value?.[r] || ""}</div>
|
|
@@ -281,6 +281,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
281
281
|
// 自定义弹窗渲染
|
|
282
282
|
const customizeTooltipConfig = (config) => {
|
|
283
283
|
const { title, width, height, padding, backgroundColor, backgroundImage, content } = config;
|
|
284
|
+
let titleText = title.text;
|
|
284
285
|
return {
|
|
285
286
|
padding: 0,
|
|
286
287
|
borderWidth: 0,
|
|
@@ -289,10 +290,11 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
289
290
|
formatter: (params) => {
|
|
290
291
|
const itemData = params.data.itemData;
|
|
291
292
|
const dom = document.createElement("div");
|
|
293
|
+
if (title.titleType === "d1") { titleText = itemData?.value?.[title.titleType]; }
|
|
292
294
|
const bgImg = `background-image: url(${backgroundImage});background-size: 100% 100%;background-repeat: no-repeat;background-position: center;`;
|
|
293
295
|
dom.style = `width:${width}px;height:${height}px;${backgroundImage ? bgImg : `background:${backgroundColor}`}`;
|
|
294
296
|
dom.innerHTML = `<div style="padding:${padding}px;width:100%;height:100%">
|
|
295
|
-
${title?.text ? `<div style="width:100%;margin-bottom:4px; font-size: ${title.fontSize}px; color: ${title.color}; text-align: ${title.position}">${
|
|
297
|
+
${title?.text ? `<div style="width:100%;margin-bottom:4px; font-size: ${title.fontSize}px; color: ${title.color}; text-align: ${title.position}">${titleText}</div>` : ""}
|
|
296
298
|
${content?.value?.map(r => itemData?.config?.[r] && `<div style="width:100%;display:flex;justify-content:space-between;align-items:center; font-size: ${content.fontSize}px; color: ${content.color};">
|
|
297
299
|
<div style="width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${itemData?.config?.[r] || ""}</div>
|
|
298
300
|
<div style="width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right">${itemData?.value?.[r] || ""}</div>
|
|
@@ -49,6 +49,7 @@ import StrokeAnimation from "./stroke-animation";
|
|
|
49
49
|
import EffectScatterMap3D from "./effectScatter-map-3d";
|
|
50
50
|
import BaseButton from "./base-button";
|
|
51
51
|
import BaseTabs from "./base-tabs";
|
|
52
|
+
import PlaceholderComponent from "./placeholder-component";
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
type CompoundedComponent = {
|
|
@@ -102,7 +103,8 @@ type CompoundedComponent = {
|
|
|
102
103
|
StrokeAnimation?: typeof StrokeAnimation,
|
|
103
104
|
EffectScatterMap3D?: typeof EffectScatterMap3D,
|
|
104
105
|
BaseButton?: typeof BaseButton,
|
|
105
|
-
BaseTabs?: typeof BaseTabs
|
|
106
|
+
BaseTabs?: typeof BaseTabs,
|
|
107
|
+
PlaceholderComponent?: typeof PlaceholderComponent
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
const LowcodeComponents: CompoundedComponent = {
|
|
@@ -114,7 +116,8 @@ const LowcodeComponents: CompoundedComponent = {
|
|
|
114
116
|
Decoration1, Decoration2, Decoration3, Decoration4, Decoration5,
|
|
115
117
|
Decoration6, Decoration7, Decoration8, Decoration9, Decoration10, Decoration11,
|
|
116
118
|
BaseTable, TextScroller, CapsuleBarChart, CircularProgressChart, ActTable, ProgressChart,
|
|
117
|
-
LineBarChart, Column3dChart, StrokeAnimation, EffectScatterMap3D, BaseButton, BaseTabs
|
|
119
|
+
LineBarChart, Column3dChart, StrokeAnimation, EffectScatterMap3D, BaseButton, BaseTabs,
|
|
120
|
+
PlaceholderComponent
|
|
118
121
|
};
|
|
119
122
|
|
|
120
123
|
export default LowcodeComponents;
|
|
@@ -50,6 +50,7 @@ import StrokeAnimation from "../../stroke-animation";
|
|
|
50
50
|
import EffectScatterMap3D from "../../effectScatter-map-3d";
|
|
51
51
|
import BaseButton from "../../base-button";
|
|
52
52
|
import BaseTabs from "../../base-tabs";
|
|
53
|
+
import PlaceholderComponent from "../../placeholder-component";
|
|
53
54
|
|
|
54
55
|
interface ComponentItemConfig {
|
|
55
56
|
baseInfo: BaseInfoType, // 基础信息
|
|
@@ -435,5 +436,12 @@ export const compsConfig: { [key: string]: ComponentItemConfig } = {
|
|
|
435
436
|
compName: "选项卡",
|
|
436
437
|
compKey: "BaseTabs"
|
|
437
438
|
}
|
|
439
|
+
},
|
|
440
|
+
PlaceholderComponent: {
|
|
441
|
+
componentNode: PlaceholderComponent,
|
|
442
|
+
baseInfo: {
|
|
443
|
+
compName: "占位组件",
|
|
444
|
+
compKey: "PlaceholderComponent"
|
|
445
|
+
}
|
|
438
446
|
}
|
|
439
447
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
import React, { ForwardedRef, forwardRef, useMemo, useImperativeHandle, useState } from 'react';
|
|
3
|
+
import Units from "../../units/index";
|
|
4
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
|
+
|
|
6
|
+
const defStyle = {
|
|
7
|
+
color: '#9a9a9a',
|
|
8
|
+
height: '100%',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
border: '1px solid #9a9a9a',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export interface ComponentProps {
|
|
16
|
+
style: { key: string },
|
|
17
|
+
isDesignMode?: boolean; // 是否编辑模式
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CompImageonentRef {
|
|
21
|
+
updateConfig: (newConfig: ComponentProps) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const PlaceholderComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<CompImageonentRef>) => {
|
|
25
|
+
const { isDesignMode } = props;
|
|
26
|
+
const { translate } = useLocale();
|
|
27
|
+
const [key, setKey] = useState<string>(props.style?.key);
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
useImperativeHandle(ref, () => ({
|
|
31
|
+
updateConfig: (newConfig) => setKey(newConfig.style?.key),
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const renderComponent = useMemo(() => {
|
|
36
|
+
const temComponent = Units.getCustomComponent(key);
|
|
37
|
+
if (temComponent) {
|
|
38
|
+
return React.createElement(temComponent);
|
|
39
|
+
}
|
|
40
|
+
return <div style={defStyle}>{translate("${没有找到自定义组件}")}</div>;
|
|
41
|
+
}, [key]);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div style={{ width: '100%', height: '100%' }}>
|
|
45
|
+
{isDesignMode || !key ?
|
|
46
|
+
<div style={defStyle}>
|
|
47
|
+
<div>{translate("${占位组件}")}</div>
|
|
48
|
+
</div> :
|
|
49
|
+
<div style={{ width: '100%', height: '100%', overflow: "auto" }}>
|
|
50
|
+
{renderComponent}
|
|
51
|
+
</div>
|
|
52
|
+
}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export default PlaceholderComponent;
|
|
@@ -12,7 +12,7 @@ const { Text, Title } = Typography;
|
|
|
12
12
|
|
|
13
13
|
interface ActTreeProps {
|
|
14
14
|
ttmplConfig: TtmplConfig;
|
|
15
|
-
top:number,
|
|
15
|
+
top: number,
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
interface ActTreeState {
|
|
@@ -30,7 +30,7 @@ export default class ActTree extends React.PureComponent<
|
|
|
30
30
|
ActTreeProps,
|
|
31
31
|
ActTreeState
|
|
32
32
|
> {
|
|
33
|
-
static defaultProps = {top:66};
|
|
33
|
+
static defaultProps = { top: 66 };
|
|
34
34
|
state = {
|
|
35
35
|
ttmplNodeConfig: undefined,
|
|
36
36
|
recordCode: undefined,
|
|
@@ -124,8 +124,8 @@ export default class ActTree extends React.PureComponent<
|
|
|
124
124
|
this.showCard(title, sourceId, mainCode, recordCode, false, true, null);
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
onDelete = async (sourceId: string, recordCode?: string) => {
|
|
128
|
+
await HcserviceV3.deleteByCode(null, sourceId, [recordCode]);
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
onAddSub = (
|
|
@@ -138,8 +138,8 @@ export default class ActTree extends React.PureComponent<
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
render() {
|
|
141
|
-
const {top} = this.props;
|
|
142
|
-
const { translate,siderCollapsed } = this.context;
|
|
141
|
+
const { top } = this.props;
|
|
142
|
+
const { translate, siderCollapsed } = this.context;
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
const {
|
|
@@ -161,12 +161,7 @@ export default class ActTree extends React.PureComponent<
|
|
|
161
161
|
width={300}
|
|
162
162
|
theme={"light"}
|
|
163
163
|
style={{
|
|
164
|
-
height:
|
|
165
|
-
position: "fixed",
|
|
166
|
-
left: 0,
|
|
167
|
-
top: top,
|
|
168
|
-
bottom: 0,
|
|
169
|
-
marginLeft: siderCollapsed?10:210,
|
|
164
|
+
height: `calc(100vh - ${top}px)`,
|
|
170
165
|
}}
|
|
171
166
|
>
|
|
172
167
|
<TmplTree
|
|
@@ -180,7 +175,7 @@ export default class ActTree extends React.PureComponent<
|
|
|
180
175
|
ref={this.refTmplTree}
|
|
181
176
|
></TmplTree>
|
|
182
177
|
</Sider>
|
|
183
|
-
<Layout style={{ marginLeft:
|
|
178
|
+
<Layout style={{ marginLeft: 22, backgroundColor: "#fff" }}>
|
|
184
179
|
<Content style={{ overflow: "initial" }}>
|
|
185
180
|
{showEdit ? (
|
|
186
181
|
<DtmplEditCard
|
|
@@ -14,7 +14,7 @@ import { ProgramConfig } from "../index";
|
|
|
14
14
|
import { CriteriaFormProps } from "../form/criteria-form";
|
|
15
15
|
import ControlTypeSupportor from "../tmpl/control-type-supportor";
|
|
16
16
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
17
|
-
import {UserInfo} from "../tmpl/interface";
|
|
17
|
+
import { UserInfo } from "../tmpl/interface";
|
|
18
18
|
|
|
19
19
|
let storageKeyPrefix = undefined;
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ let MENU_MAP = {};
|
|
|
24
24
|
|
|
25
25
|
let MENU_ID_ICON_MAP = {};
|
|
26
26
|
|
|
27
|
-
const CustomButtonConfig_Map={}
|
|
27
|
+
const CustomButtonConfig_Map = {}
|
|
28
28
|
|
|
29
29
|
const CUSTOM_VIEW_CONTROL_MAP = {};
|
|
30
30
|
|
|
@@ -40,6 +40,8 @@ const extendServerMap = {};
|
|
|
40
40
|
|
|
41
41
|
let antdUseToken = undefined;
|
|
42
42
|
|
|
43
|
+
const CUSTOM_COMPONENT_MAP = {};
|
|
44
|
+
|
|
43
45
|
// let siderCollapsed:boolean = true;
|
|
44
46
|
|
|
45
47
|
export default {
|
|
@@ -59,18 +61,18 @@ export default {
|
|
|
59
61
|
},
|
|
60
62
|
|
|
61
63
|
|
|
62
|
-
setMenuIconMap(menuIconMap){
|
|
63
|
-
MENU_ID_ICON_MAP=menuIconMap;
|
|
64
|
+
setMenuIconMap(menuIconMap) {
|
|
65
|
+
MENU_ID_ICON_MAP = menuIconMap;
|
|
64
66
|
},
|
|
65
|
-
mapMenuIcon(menuId){
|
|
67
|
+
mapMenuIcon(menuId) {
|
|
66
68
|
return MENU_ID_ICON_MAP[menuId];
|
|
67
69
|
},
|
|
68
70
|
|
|
69
|
-
setMenuMap(menuMap){
|
|
70
|
-
MENU_MAP=menuMap;
|
|
71
|
+
setMenuMap(menuMap) {
|
|
72
|
+
MENU_MAP = menuMap;
|
|
71
73
|
},
|
|
72
|
-
mapMenu(menuId){
|
|
73
|
-
if(menuId=='home'){
|
|
74
|
+
mapMenu(menuId) {
|
|
75
|
+
if (menuId == 'home') {
|
|
74
76
|
return "首页"
|
|
75
77
|
}
|
|
76
78
|
return MENU_MAP[menuId];
|
|
@@ -102,16 +104,16 @@ export default {
|
|
|
102
104
|
},
|
|
103
105
|
|
|
104
106
|
setCustomButtonConfig(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
key: string,
|
|
108
|
+
config: CustomButtonConfig
|
|
107
109
|
) {
|
|
108
110
|
CustomButtonConfig_Map[key] = config;
|
|
109
111
|
},
|
|
110
112
|
|
|
111
113
|
getCustomButtonConfig(
|
|
112
|
-
|
|
114
|
+
key: string
|
|
113
115
|
) {
|
|
114
|
-
|
|
116
|
+
return CustomButtonConfig_Map[key];
|
|
115
117
|
},
|
|
116
118
|
|
|
117
119
|
setAppCtmplConfigFunc(
|
|
@@ -133,14 +135,14 @@ export default {
|
|
|
133
135
|
criteriaData,
|
|
134
136
|
props
|
|
135
137
|
);
|
|
136
|
-
}else{
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
} else {
|
|
139
|
+
//用内置的
|
|
140
|
+
return TmplConfigAnalysis.buildInCtmplConfig(
|
|
141
|
+
ltmplConfig,
|
|
142
|
+
criteriaData,
|
|
143
|
+
props
|
|
144
|
+
);
|
|
145
|
+
}
|
|
144
146
|
}
|
|
145
147
|
return ltmplConfig;
|
|
146
148
|
},
|
|
@@ -302,23 +304,23 @@ export default {
|
|
|
302
304
|
}
|
|
303
305
|
return hydrocarbonToken;
|
|
304
306
|
},
|
|
305
|
-
setServerHydrocarbonToken(serverkey: string,token:string) {
|
|
307
|
+
setServerHydrocarbonToken(serverkey: string, token: string) {
|
|
306
308
|
if (serverkey && token) {
|
|
307
309
|
window.sessionStorage.setItem(serverkey + "hydrocarbonToken", token);
|
|
308
310
|
}
|
|
309
311
|
this.setHydrocarbonToken(token, serverkey);
|
|
310
312
|
},
|
|
311
|
-
serverHydrocarbonToken(serverKey:string) {
|
|
313
|
+
serverHydrocarbonToken(serverKey: string) {
|
|
312
314
|
let hydrocarbonToken = window.sessionStorage.getItem(
|
|
313
|
-
|
|
315
|
+
serverKey + "hydrocarbonToken"
|
|
314
316
|
);
|
|
315
317
|
if (!hydrocarbonToken) {
|
|
316
318
|
hydrocarbonToken = window.localStorage.getItem(
|
|
317
|
-
|
|
319
|
+
serverKey + "hydrocarbonToken"
|
|
318
320
|
);
|
|
319
321
|
}
|
|
320
322
|
if (!hydrocarbonToken) {
|
|
321
|
-
|
|
323
|
+
hydrocarbonToken = this.hydrocarbonToken();
|
|
322
324
|
}
|
|
323
325
|
return hydrocarbonToken;
|
|
324
326
|
},
|
|
@@ -590,14 +592,14 @@ export default {
|
|
|
590
592
|
value.length > 200
|
|
591
593
|
? "350px"
|
|
592
594
|
: value.length > 150
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
595
|
+
? "300px"
|
|
596
|
+
: value.length > 100
|
|
597
|
+
? "250px"
|
|
598
|
+
: value.length > 50
|
|
599
|
+
? "200px"
|
|
600
|
+
: value.length >= 20
|
|
601
|
+
? "160px"
|
|
602
|
+
: "80px";
|
|
601
603
|
//let min_value_length = value.length > 20 ? '160px' : '80px';
|
|
602
604
|
style.minWidth = min_value_length;
|
|
603
605
|
return style;
|
|
@@ -732,23 +734,23 @@ export default {
|
|
|
732
734
|
if (!obj[name]) {
|
|
733
735
|
obj[name] = [];
|
|
734
736
|
}
|
|
735
|
-
let pvalue=decodeURIComponent(res[1]);
|
|
737
|
+
let pvalue = decodeURIComponent(res[1]);
|
|
736
738
|
obj[name].push(
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
739
|
+
this.configParamTrans(
|
|
740
|
+
pvalue,
|
|
741
|
+
this.getItemType(name, pvalue, ltmplConfig)
|
|
742
|
+
)
|
|
741
743
|
);
|
|
742
744
|
} else {
|
|
743
745
|
const res = arr2[i].split("=");
|
|
744
746
|
const name = res[0];
|
|
745
747
|
if (name) {
|
|
746
|
-
let pvalue=decodeURIComponent(res[1]);
|
|
748
|
+
let pvalue = decodeURIComponent(res[1]);
|
|
747
749
|
obj[name] =
|
|
748
750
|
this.configParamTrans(
|
|
749
|
-
|
|
751
|
+
pvalue,
|
|
750
752
|
this.getItemType(name, pvalue, ltmplConfig)
|
|
751
|
-
|
|
753
|
+
);
|
|
752
754
|
}
|
|
753
755
|
}
|
|
754
756
|
}
|
|
@@ -764,14 +766,14 @@ export default {
|
|
|
764
766
|
configParamTrans(value: string, itemType: string) {
|
|
765
767
|
if (value && value.startsWith && value.startsWith("$$current")) {
|
|
766
768
|
return TmplConfigAnalysis.current(value, this.getDayjsFormat(itemType));
|
|
767
|
-
}else if (value && value.startsWith("$$user.code")) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
}else{
|
|
769
|
+
} else if (value && value.startsWith("$$user.code")) {
|
|
770
|
+
let userInfo: UserInfo = this.getCurrentUserInfo();
|
|
771
|
+
if (userInfo) {
|
|
772
|
+
return userInfo.id + "@R@";
|
|
773
|
+
} else {
|
|
774
|
+
return null;
|
|
775
|
+
}
|
|
776
|
+
} else {
|
|
775
777
|
return value;
|
|
776
778
|
}
|
|
777
779
|
|
|
@@ -860,10 +862,10 @@ export default {
|
|
|
860
862
|
return item.extType
|
|
861
863
|
? item.extType
|
|
862
864
|
: item.msExtType
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
865
|
+
? item.msExtType
|
|
866
|
+
: item.msType
|
|
867
|
+
? item.msType
|
|
868
|
+
: item.type;
|
|
867
869
|
},
|
|
868
870
|
isEmpty(obj) {
|
|
869
871
|
if (!obj) {
|
|
@@ -1056,13 +1058,27 @@ export default {
|
|
|
1056
1058
|
this.setSessionProgramCode(programCode);
|
|
1057
1059
|
},
|
|
1058
1060
|
getReactKey() {
|
|
1059
|
-
|
|
1061
|
+
return new Date().getTime().toString();
|
|
1060
1062
|
},
|
|
1061
|
-
async getUserInfo(programCode?:string, token?:string) {
|
|
1062
|
-
|
|
1063
|
-
|
|
1063
|
+
async getUserInfo(programCode?: string, token?: string) {
|
|
1064
|
+
currentUser = await HcserviceV3.getUser(programCode, token);
|
|
1065
|
+
return currentUser;
|
|
1064
1066
|
},
|
|
1065
1067
|
getCurrentUserInfo() {
|
|
1066
1068
|
return currentUser;
|
|
1069
|
+
},
|
|
1070
|
+
// 低代码拖拽页面-自定义组件
|
|
1071
|
+
setCustomComponent(key_: string, name: object) {
|
|
1072
|
+
let key = key_;
|
|
1073
|
+
if (!key) {
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1076
|
+
CUSTOM_COMPONENT_MAP[key] = name;
|
|
1077
|
+
},
|
|
1078
|
+
getCustomComponent(key: string) {
|
|
1079
|
+
if (!key) {
|
|
1080
|
+
return null;
|
|
1081
|
+
}
|
|
1082
|
+
return CUSTOM_COMPONENT_MAP[key];
|
|
1067
1083
|
}
|
|
1068
1084
|
};
|