aldehyde 0.2.130 → 0.2.132
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/date-picker/index.d.ts.map +1 -1
- package/lib/controls/date-picker/index.js +4 -1
- package/lib/controls/date-picker/index.js.map +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +10 -1
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js +1 -0
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/dtmpl-view.js +4 -0
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/layout/MainPage.d.ts.map +1 -1
- package/lib/layout/MainPage.js +2 -2
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/layout/sidebar/index.d.ts +2 -0
- package/lib/layout/sidebar/index.d.ts.map +1 -1
- package/lib/layout/sidebar/index.js +24 -12
- package/lib/layout/sidebar/index.js.map +1 -1
- package/lib/login/router-login.d.ts.map +1 -1
- package/lib/login/router-login.js +27 -10
- package/lib/login/router-login.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +1 -0
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-editor.d.ts.map +1 -1
- package/lib/module/dtmpl-editor.js +1 -0
- package/lib/module/dtmpl-editor.js.map +1 -1
- package/lib/module/embed-dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/embed-dtmpl-edit-page.js +1 -0
- package/lib/module/embed-dtmpl-edit-page.js.map +1 -1
- package/lib/table/index.css +12 -12
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +7 -3
- package/lib/table/query-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +4 -0
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +3 -0
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/date-picker/index.tsx +6 -1
- package/src/aldehyde/controls/entry-control.tsx +26 -9
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +1 -0
- package/src/aldehyde/detail/view/dtmpl-view.tsx +4 -1
- package/src/aldehyde/layout/MainPage.tsx +4 -2
- package/src/aldehyde/layout/sidebar/index.tsx +46 -36
- package/src/aldehyde/login/router-login.tsx +66 -44
- package/src/aldehyde/module/dtmpl-edit-page.tsx +1 -0
- package/src/aldehyde/module/dtmpl-editor.tsx +1 -0
- package/src/aldehyde/module/embed-dtmpl-edit-page.tsx +1 -0
- package/src/aldehyde/table/index.css +12 -12
- package/src/aldehyde/table/query-table.tsx +12 -7
- package/src/aldehyde/tmpl/control-type-supportor.tsx +5 -0
- package/src/aldehyde/units/index.tsx +3 -0
|
@@ -8,6 +8,8 @@ import { Image, theme } from "antd";
|
|
|
8
8
|
import logo from "./logo.png";
|
|
9
9
|
import { useLocale } from "../../locale/useLocale";
|
|
10
10
|
interface SideBarProps extends Menu2layersProps {
|
|
11
|
+
header?:any;
|
|
12
|
+
collapsedHeader?:any;
|
|
11
13
|
title?: string;
|
|
12
14
|
logo?: any;
|
|
13
15
|
}
|
|
@@ -18,7 +20,7 @@ const SideBar: React.FC<SideBarProps> = (props) => {
|
|
|
18
20
|
const { translate } = useLocale();
|
|
19
21
|
const { token } = useToken();
|
|
20
22
|
let syyy = { "--logo-blue-background": token.colorPrimary } as CSSProperties;
|
|
21
|
-
let { collapsed } = props;
|
|
23
|
+
let { collapsed,header,collapsedHeader } = props;
|
|
22
24
|
return (
|
|
23
25
|
<div>
|
|
24
26
|
<Scrollbars
|
|
@@ -28,41 +30,49 @@ const SideBar: React.FC<SideBarProps> = (props) => {
|
|
|
28
30
|
>
|
|
29
31
|
<div className={collapsed ? "logonly" : "logo-blue"} style={syyy}>
|
|
30
32
|
<a href="#/home">
|
|
31
|
-
{collapsed ?
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
33
|
+
{collapsed ?( collapsedHeader ? <div style={{
|
|
34
|
+
overflow: "hidden",
|
|
35
|
+
height: "56px",
|
|
36
|
+
padding:"2px"
|
|
37
|
+
}}>{collapsedHeader}</div>:
|
|
38
|
+
props.logo ?
|
|
39
|
+
<Image src={props.logo}/>
|
|
40
|
+
: (
|
|
41
|
+
<h1
|
|
42
|
+
style={{
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
height: "56px",
|
|
45
|
+
paddingLeft: "-20px",
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
M
|
|
49
|
+
</h1>
|
|
50
|
+
)
|
|
51
|
+
) : (header ? <div style={{
|
|
52
|
+
overflow: "hidden",
|
|
53
|
+
height: "56px",
|
|
54
|
+
padding: "2px"
|
|
55
|
+
}}>{header}</div> :
|
|
56
|
+
<>
|
|
57
|
+
<h1
|
|
58
|
+
style={{
|
|
59
|
+
overflow: "hidden",
|
|
60
|
+
height: "56px",
|
|
61
|
+
paddingLeft: "-20px",
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
<>
|
|
65
|
+
{props.logo ? (
|
|
66
|
+
<Image width={"30px"} src={props.logo}/>
|
|
67
|
+
) : (
|
|
68
|
+
<></>
|
|
69
|
+
)}
|
|
70
|
+
{translate(
|
|
71
|
+
props.title ? props.title : Units.programName_NavLeft()
|
|
72
|
+
)}
|
|
73
|
+
</>
|
|
74
|
+
</h1>
|
|
75
|
+
</>
|
|
66
76
|
)}
|
|
67
77
|
</a>
|
|
68
78
|
</div>
|
|
@@ -4,62 +4,84 @@ import "./index.css";
|
|
|
4
4
|
import withRouter from "../routable/withroute";
|
|
5
5
|
import Login from "./login";
|
|
6
6
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import {Col, Row, theme} from "antd";
|
|
8
|
+
import {useLocale} from "../locale/useLocale";
|
|
9
9
|
import LocaleButton from "../locale/LocaleButton";
|
|
10
10
|
|
|
11
|
+
const {useToken} = theme;
|
|
12
|
+
|
|
11
13
|
interface RLoginitProps {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
params: object;
|
|
15
|
+
autoSaveUser?: boolean;
|
|
16
|
+
theme?: any;
|
|
17
|
+
themePosition?: "left" | "center" | "right"|undefined
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
interface RLoginitState {
|
|
20
|
+
interface RLoginitState {
|
|
21
|
+
}
|
|
17
22
|
|
|
18
23
|
const RouterLogin = (props: RLoginitProps) => {
|
|
19
|
-
|
|
24
|
+
const {token} = useToken();
|
|
25
|
+
const {params, autoSaveUser, themePosition, theme} = props;
|
|
26
|
+
|
|
27
|
+
const {translate} = useLocale();
|
|
28
|
+
Units.setProgramCode4RoutePath(params);
|
|
29
|
+
|
|
30
|
+
const getLogin = () => {
|
|
31
|
+
return <Login
|
|
32
|
+
onFinish={(token) => {
|
|
33
|
+
HCDataSource.clear();
|
|
34
|
+
window.location.hash = "#/context-setter";
|
|
35
|
+
Units.setHydrocarbonToken(token);
|
|
36
|
+
}}
|
|
37
|
+
title={<h3>{translate("${欢迎登录}")}</h3>}
|
|
38
|
+
autoSaveUser={autoSaveUser}
|
|
39
|
+
/>
|
|
40
|
+
}
|
|
41
|
+
const getContent = () => {
|
|
42
|
+
if (themePosition) {
|
|
43
|
+
if (themePosition == "left") {
|
|
44
|
+
return <>
|
|
45
|
+
<Col span={12}>{theme}</Col>
|
|
46
|
+
<Col span={12}>{getLogin()} </Col>
|
|
47
|
+
</>
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
return <><Col>{getLogin()}</Col></>
|
|
51
|
+
}
|
|
52
|
+
}
|
|
20
53
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onFinish={(token) => {
|
|
28
|
-
HCDataSource.clear();
|
|
29
|
-
window.location.hash = "#/context-setter";
|
|
30
|
-
Units.setHydrocarbonToken(token);
|
|
31
|
-
}}
|
|
32
|
-
title={<h3>{translate("${欢迎登录}")}</h3>}
|
|
33
|
-
autoSaveUser={autoSaveUser}
|
|
34
|
-
/>{" "}
|
|
35
|
-
</Col>
|
|
36
|
-
</Row>
|
|
37
|
-
);
|
|
54
|
+
return (
|
|
55
|
+
<Row justify="center" align="middle" className="login-blue"
|
|
56
|
+
style={{background: token.colorPrimary}}>
|
|
57
|
+
{getContent()}
|
|
58
|
+
</Row>
|
|
59
|
+
);
|
|
38
60
|
};
|
|
39
61
|
|
|
40
62
|
const I18nLogin = (props: RLoginitProps) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
style={{
|
|
66
|
+
position: "relative",
|
|
67
|
+
width: "100%",
|
|
68
|
+
height: "100%",
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
<div
|
|
72
|
+
style={{
|
|
73
|
+
position: "absolute",
|
|
74
|
+
top: "10px",
|
|
75
|
+
right: "10px",
|
|
76
|
+
zIndex: "10000",
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
<LocaleButton size="large"></LocaleButton>
|
|
80
|
+
</div>
|
|
59
81
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
<RouterLogin {...props} />
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
63
85
|
};
|
|
64
86
|
|
|
65
87
|
export default withRouter(I18nLogin);
|
|
@@ -109,6 +109,7 @@ export default class DtmplEditPage extends React.PureComponent<ModalEditorProps,
|
|
|
109
109
|
if (code) {
|
|
110
110
|
this.setState({
|
|
111
111
|
loading: true,
|
|
112
|
+
dtmplData:undefined,
|
|
112
113
|
})
|
|
113
114
|
const dtmplData_:DtmplData=await HcserviceV3.getDtmplData(dtmplConfig,serverKey,sourceId, code);
|
|
114
115
|
this.setState({
|
|
@@ -94,6 +94,7 @@ export default class EmbedDtmplEditPage extends React.PureComponent<EmbedDtmplEd
|
|
|
94
94
|
if (code) {
|
|
95
95
|
this.setState({
|
|
96
96
|
loading: true,
|
|
97
|
+
dtmplData:undefined,
|
|
97
98
|
})
|
|
98
99
|
const dtmplData_:DtmplData=await HcserviceV3.getDtmplData(dtmplConfig,serverKey,sourceId, code);
|
|
99
100
|
this.setState({
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
/* padding:0px;*/
|
|
51
51
|
/*}*/
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
background-color: rgb(225, 250, 235)
|
|
55
|
-
}
|
|
53
|
+
/*.ant-table-cell:has(.xiaoji) {*/
|
|
54
|
+
/* background-color: rgb(225, 250, 235);*/
|
|
55
|
+
/*}*/
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
background-color: #00b96b
|
|
59
|
-
}
|
|
57
|
+
/*.ant-table-cell:has(.zongji) {*/
|
|
58
|
+
/* background-color: #00b96b;*/
|
|
59
|
+
/*}*/
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
background-color: rgb(225, 250, 235)
|
|
63
|
-
}
|
|
61
|
+
/*.xiaoji {*/
|
|
62
|
+
/* background-color: rgb(225, 250, 235);*/
|
|
63
|
+
/*}*/
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
background-color: #00b96b
|
|
67
|
-
}
|
|
65
|
+
/*.zongji {*/
|
|
66
|
+
/* background-color: #00b96b;*/
|
|
67
|
+
/*}*/
|
|
@@ -22,6 +22,7 @@ import Scrollbars from "react-custom-scrollbars";
|
|
|
22
22
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
23
23
|
import { BigNumber } from "bignumber.js";
|
|
24
24
|
import Column from "antd/es/table/Column";
|
|
25
|
+
import {ColumnsType} from "antd/es/table";
|
|
25
26
|
const { Panel } = Collapse;
|
|
26
27
|
const SortableItem = SortableElement((props) => <tr {...props} />);
|
|
27
28
|
const SortableBody = SortableContainer((props) => <tbody {...props} />);
|
|
@@ -919,28 +920,32 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
919
920
|
: this.props.columns;
|
|
920
921
|
|
|
921
922
|
const sumConfigs: {
|
|
922
|
-
sum: { value: string; id: string }[];
|
|
923
|
-
avg: { value: string; id: string }[];
|
|
923
|
+
sum: { value: string; id: string;columnConfig?:any }[];
|
|
924
|
+
avg: { value: string; id: string;columnConfig?:any }[];
|
|
924
925
|
} = { sum: [], avg: [] };
|
|
925
926
|
|
|
926
927
|
if (this.getRowSelection()) {
|
|
927
928
|
sumConfigs["avg"].push({
|
|
928
929
|
value: "",
|
|
929
930
|
id: "",
|
|
931
|
+
columnConfig:{align:'center'}
|
|
930
932
|
});
|
|
931
933
|
sumConfigs["sum"].push({
|
|
932
934
|
value: "",
|
|
933
935
|
id: "",
|
|
936
|
+
columnConfig:{"align":'center'}
|
|
934
937
|
});
|
|
935
938
|
}
|
|
936
939
|
|
|
937
940
|
sumConfigs["sum"].push({
|
|
938
941
|
value: translate("${合计}"),
|
|
939
942
|
id: "title",
|
|
943
|
+
columnConfig:{"align":'center'}
|
|
940
944
|
});
|
|
941
945
|
sumConfigs["avg"].push({
|
|
942
946
|
value: translate("${均值}"),
|
|
943
947
|
id: "title",
|
|
948
|
+
columnConfig:{"align":'center'}
|
|
944
949
|
});
|
|
945
950
|
|
|
946
951
|
let sumLen = 0,
|
|
@@ -950,7 +955,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
950
955
|
const idx = i,
|
|
951
956
|
dataIndex = columns[i].dataIndex;
|
|
952
957
|
if (idx === 0) continue;
|
|
953
|
-
const sum = { value: "", id: "" };
|
|
958
|
+
const sum = { value: "", id: "",columnConfig:columns[i] };
|
|
954
959
|
const sumConfigIdx = summaryConfigs.findIndex(
|
|
955
960
|
({ id }) => id === dataIndex
|
|
956
961
|
);
|
|
@@ -1006,8 +1011,8 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
1006
1011
|
<></>
|
|
1007
1012
|
) : (
|
|
1008
1013
|
<Table.Summary.Row>
|
|
1009
|
-
{sumConfigs["sum"].map(({ id, value }, idx) => (
|
|
1010
|
-
<Table.Summary.Cell index={idx} className="zongji">
|
|
1014
|
+
{sumConfigs["sum"].map(({ id, value ,columnConfig}, idx) => (
|
|
1015
|
+
<Table.Summary.Cell align={columnConfig?.align} index={idx} className="zongji">
|
|
1011
1016
|
{value}
|
|
1012
1017
|
</Table.Summary.Cell>
|
|
1013
1018
|
))}
|
|
@@ -1017,8 +1022,8 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
1017
1022
|
<></>
|
|
1018
1023
|
) : (
|
|
1019
1024
|
<Table.Summary.Row>
|
|
1020
|
-
{sumConfigs["avg"].map(({ id, value }, idx) => (
|
|
1021
|
-
<Table.Summary.Cell index={idx} className="zongji">
|
|
1025
|
+
{sumConfigs["avg"].map(({ id, value,columnConfig }, idx) => (
|
|
1026
|
+
<Table.Summary.Cell align={columnConfig?.align} index={idx} className="zongji">
|
|
1022
1027
|
{value}
|
|
1023
1028
|
</Table.Summary.Cell>
|
|
1024
1029
|
))}
|
|
@@ -23,6 +23,10 @@ SupportInputTypes.add('timerange-mm');
|
|
|
23
23
|
SupportInputTypes.add('time');
|
|
24
24
|
SupportInputTypes.add('timerange');
|
|
25
25
|
|
|
26
|
+
SupportInputTypes.add('timerange-HH-unorder');
|
|
27
|
+
SupportInputTypes.add('timerange-mm-unorder');
|
|
28
|
+
SupportInputTypes.add('timerange-unorder');
|
|
29
|
+
|
|
26
30
|
SupportInputTypes.add('text');
|
|
27
31
|
SupportInputTypes.add('textarea');
|
|
28
32
|
SupportInputTypes.add('html');
|
|
@@ -34,6 +38,7 @@ SupportInputTypes.add('select');
|
|
|
34
38
|
SupportInputTypes.add('multiselect');
|
|
35
39
|
SupportInputTypes.add('checkbox');
|
|
36
40
|
SupportInputTypes.add('radio');
|
|
41
|
+
SupportInputTypes.add('yes-no-select');
|
|
37
42
|
SupportInputTypes.add('yes-no-radio');
|
|
38
43
|
SupportInputTypes.add('yes-no-switch');
|
|
39
44
|
SupportInputTypes.add('caselect');
|
|
@@ -659,14 +659,17 @@ export default {
|
|
|
659
659
|
break;
|
|
660
660
|
case 'time-HH':
|
|
661
661
|
case 'timerange-HH':
|
|
662
|
+
case 'timerange-HH-unorder':
|
|
662
663
|
format = 'HH';
|
|
663
664
|
break;
|
|
664
665
|
case 'time-mm':
|
|
665
666
|
case 'timerange-mm':
|
|
667
|
+
case 'timerange-mm-unorder':
|
|
666
668
|
format = 'HH:mm';
|
|
667
669
|
break;
|
|
668
670
|
case 'time':
|
|
669
671
|
case 'timerange':
|
|
672
|
+
case 'timerange-unorder':
|
|
670
673
|
format = 'HH:mm:ss';
|
|
671
674
|
break;
|
|
672
675
|
}
|