aldehyde 0.2.160 → 0.2.163
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/action/index.js +1 -1
- package/lib/controls/action/index.js.map +1 -1
- package/lib/controls/action/utils.d.ts +2 -2
- package/lib/controls/action/utils.d.ts.map +1 -1
- package/lib/controls/action/utils.js +5 -5
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/file-export/select-code-export.d.ts +13 -0
- package/lib/controls/file-export/select-code-export.d.ts.map +1 -0
- package/lib/controls/file-export/select-code-export.js +14 -0
- package/lib/controls/file-export/select-code-export.js.map +1 -0
- package/lib/controls/steps/index.d.ts.map +1 -1
- package/lib/controls/steps/index.js +4 -1
- package/lib/controls/steps/index.js.map +1 -1
- package/lib/detail/button/edit-button.d.ts +11 -0
- package/lib/detail/button/edit-button.d.ts.map +1 -0
- package/lib/detail/button/edit-button.js +29 -0
- package/lib/detail/button/edit-button.js.map +1 -0
- package/lib/detail/button/view-button.d.ts +11 -0
- package/lib/detail/button/view-button.d.ts.map +1 -0
- package/lib/detail/button/view-button.js +28 -0
- package/lib/detail/button/view-button.js.map +1 -0
- package/lib/detail/view/act-dtmpl-view.d.ts +3 -1
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +9 -3
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/{exportor → export}/export-frame.d.ts +4 -0
- package/lib/export/export-frame.d.ts.map +1 -0
- package/lib/{exportor → export}/export-frame.js +6 -4
- package/lib/export/export-frame.js.map +1 -0
- package/lib/export/select-code-export-frame.d.ts +49 -0
- package/lib/export/select-code-export-frame.d.ts.map +1 -0
- package/lib/export/select-code-export-frame.js +145 -0
- package/lib/export/select-code-export-frame.js.map +1 -0
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +26 -2
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/hooks/useVarCssColor.d.ts +2 -0
- package/lib/hooks/useVarCssColor.d.ts.map +1 -0
- package/lib/hooks/useVarCssColor.js +7 -0
- package/lib/hooks/useVarCssColor.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/layout/MainPage.d.ts.map +1 -1
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/layout/menu/block.css +1 -1
- package/lib/layout/menu/block.d.ts.map +1 -1
- package/lib/layout/menu/block.js +1 -1
- package/lib/layout/menu/block.js.map +1 -1
- package/lib/layout2/components/userButton.d.ts +5 -0
- package/lib/layout2/components/userButton.d.ts.map +1 -0
- package/lib/layout2/components/userButton.js +133 -0
- package/lib/layout2/components/userButton.js.map +1 -0
- package/lib/layout2/css/header.css +38 -0
- package/lib/layout2/header.d.ts +12 -0
- package/lib/layout2/header.d.ts.map +1 -0
- package/lib/layout2/header.js +225 -0
- package/lib/layout2/header.js.map +1 -0
- package/lib/layout2/imgs/home.png +0 -0
- package/lib/layout2/main.d.ts +9 -0
- package/lib/layout2/main.d.ts.map +1 -0
- package/lib/layout2/main.js +14 -0
- package/lib/layout2/main.js.map +1 -0
- package/lib/layout2/page.d.ts +7 -0
- package/lib/layout2/page.d.ts.map +1 -0
- package/lib/layout2/page.js +120 -0
- package/lib/layout2/page.js.map +1 -0
- package/lib/layout2/sider.d.ts +10 -0
- package/lib/layout2/sider.d.ts.map +1 -0
- package/lib/layout2/sider.js +259 -0
- package/lib/layout2/sider.js.map +1 -0
- package/lib/layout2/type/layout.type.d.ts +10 -0
- package/lib/layout2/type/layout.type.d.ts.map +1 -0
- package/lib/layout2/type/layout.type.js +2 -0
- package/lib/layout2/type/layout.type.js.map +1 -0
- package/lib/layout2/util/menu.util.d.ts +28 -0
- package/lib/layout2/util/menu.util.d.ts.map +1 -0
- package/lib/layout2/util/menu.util.js +76 -0
- package/lib/layout2/util/menu.util.js.map +1 -0
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +3 -0
- package/lib/login/login.js.map +1 -1
- package/lib/login2/Login.d.ts +10 -0
- package/lib/login2/Login.d.ts.map +1 -0
- package/lib/login2/Login.js +71 -0
- package/lib/login2/Login.js.map +1 -0
- package/lib/login2/LoginPage.d.ts +4 -0
- package/lib/login2/LoginPage.d.ts.map +1 -0
- package/lib/login2/LoginPage.js +43 -0
- package/lib/login2/LoginPage.js.map +1 -0
- package/lib/login2/img/login-bg.png +0 -0
- package/lib/login2/index.d.ts +4 -0
- package/lib/login2/index.d.ts.map +1 -0
- package/lib/login2/index.js +4 -0
- package/lib/login2/index.js.map +1 -0
- package/lib/module/ltmpl-table.d.ts +6 -4
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +15 -11
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/routable/dtmpl-route.d.ts +3 -2
- package/lib/routable/dtmpl-route.d.ts.map +1 -1
- package/lib/routable/dtmpl-route.js +20 -16
- package/lib/routable/dtmpl-route.js.map +1 -1
- package/lib/routable/import-route.d.ts +3 -2
- package/lib/routable/import-route.d.ts.map +1 -1
- package/lib/routable/import-route.js +10 -6
- package/lib/routable/import-route.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +1 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +24 -17
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/routable/ttmpl-route.d.ts +3 -2
- package/lib/routable/ttmpl-route.d.ts.map +1 -1
- package/lib/routable/ttmpl-route.js +13 -9
- package/lib/routable/ttmpl-route.js.map +1 -1
- package/lib/routable/withroute.d.ts +1 -1
- package/lib/routable/withroute.d.ts.map +1 -1
- package/lib/routable/withroute.js +3 -3
- package/lib/routable/withroute.js.map +1 -1
- package/lib/table/act-table.d.ts +7 -4
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +112 -88
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/index.css +4 -4
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +2 -2
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +5 -5
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.js +2 -2
- 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 +2 -3
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +3 -2
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +11 -2
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +46 -6
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/tree/tmpl-tree.js +2 -1
- package/lib/tree/tmpl-tree.js.map +1 -1
- package/lib/welcome/HCWelcome.d.ts +1 -1
- package/lib/welcome/HCWelcome.d.ts.map +1 -1
- package/lib/welcome/HCWelcome.js +279 -175
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/img/welcome.png +0 -0
- package/package.json +1 -1
- package/src/aldehyde/controls/action/index.tsx +1 -1
- package/src/aldehyde/controls/action/utils.tsx +4 -5
- package/src/aldehyde/controls/file-export/select-code-export.tsx +40 -0
- package/src/aldehyde/controls/steps/index.tsx +6 -1
- package/src/aldehyde/detail/button/edit-button.tsx +62 -0
- package/src/aldehyde/detail/button/view-button.tsx +61 -0
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +14 -2
- package/src/aldehyde/{exportor → export}/export-frame.tsx +10 -6
- package/src/aldehyde/export/select-code-export-frame.tsx +218 -0
- package/src/aldehyde/form/criteria-form.tsx +35 -0
- package/src/aldehyde/hooks/useVarCssColor.ts +6 -0
- package/src/aldehyde/index.tsx +2 -2
- package/src/aldehyde/layout/MainPage.tsx +8 -6
- package/src/aldehyde/layout/menu/block.css +1 -1
- package/src/aldehyde/layout/menu/block.tsx +1 -0
- package/src/aldehyde/layout2/components/userButton.tsx +171 -0
- package/src/aldehyde/layout2/css/header.css +38 -0
- package/src/aldehyde/layout2/header.tsx +348 -0
- package/src/aldehyde/layout2/imgs/home.png +0 -0
- package/src/aldehyde/layout2/main.tsx +27 -0
- package/src/aldehyde/layout2/page.tsx +169 -0
- package/src/aldehyde/layout2/sider.tsx +357 -0
- package/src/aldehyde/layout2/type/layout.type.ts +10 -0
- package/src/aldehyde/layout2/util/menu.util.tsx +112 -0
- package/src/aldehyde/login/login.tsx +2 -0
- package/src/aldehyde/login2/Login.tsx +122 -0
- package/src/aldehyde/login2/LoginPage.tsx +59 -0
- package/src/aldehyde/login2/img/login-bg.png +0 -0
- package/src/aldehyde/login2/index.tsx +4 -0
- package/src/aldehyde/module/ltmpl-table.tsx +18 -13
- package/src/aldehyde/routable/dtmpl-route.tsx +141 -121
- package/src/aldehyde/routable/import-route.tsx +28 -23
- package/src/aldehyde/routable/ltmpl-route.tsx +86 -59
- package/src/aldehyde/routable/ttmpl-route.tsx +73 -55
- package/src/aldehyde/routable/withroute.tsx +21 -18
- package/src/aldehyde/table/act-table.tsx +93 -77
- package/src/aldehyde/table/index.css +4 -4
- package/src/aldehyde/table/query-table.tsx +1 -4
- package/src/aldehyde/table/relation-table.tsx +7 -7
- package/src/aldehyde/table/select-table.tsx +2 -2
- package/src/aldehyde/tmpl/hc-data-source.tsx +373 -352
- package/src/aldehyde/tmpl/hcservice-v3.tsx +33 -17
- package/src/aldehyde/tmpl/interface.tsx +53 -6
- package/src/aldehyde/tree/tmpl-tree.tsx +2 -1
- package/src/aldehyde/welcome/HCWelcome.js +294 -241
- package/src/aldehyde/welcome/img/welcome.png +0 -0
- package/lib/exportor/export-frame.d.ts.map +0 -1
- package/lib/exportor/export-frame.js.map +0 -1
- /package/lib/{exportor → export}/export-frame.css +0 -0
- /package/src/aldehyde/{exportor → export}/export-frame.css +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "antd";
|
|
3
|
+
import { DoEditParam, DtmplData, LtmplConfig } from "../../tmpl/interface";
|
|
4
|
+
import { EditOutlined } from "@ant-design/icons";
|
|
5
|
+
import ActionUtils from "../../controls/action/utils";
|
|
6
|
+
|
|
7
|
+
interface EditButtonProps {
|
|
8
|
+
serverKey?: string;
|
|
9
|
+
doEdit: (doEditParam: DoEditParam) => void;
|
|
10
|
+
data: DtmplData;
|
|
11
|
+
ltmplConfig: LtmplConfig;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const EditButton: React.FC<EditButtonProps> = (props) => {
|
|
15
|
+
const { doEdit, data, ltmplConfig } = props;
|
|
16
|
+
let button = undefined;
|
|
17
|
+
if (ltmplConfig.classEditConfigs) {
|
|
18
|
+
ltmplConfig.classEditConfigs.forEach((classEditConfig) => {
|
|
19
|
+
if (
|
|
20
|
+
!button &&
|
|
21
|
+
ActionUtils.isShow(classEditConfig.preposes, [data], undefined)
|
|
22
|
+
) {
|
|
23
|
+
button = (
|
|
24
|
+
<Button
|
|
25
|
+
size="small"
|
|
26
|
+
type="dashed"
|
|
27
|
+
icon={<EditOutlined />}
|
|
28
|
+
onClick={() =>
|
|
29
|
+
doEdit({
|
|
30
|
+
code: data.code,
|
|
31
|
+
mode: "update",
|
|
32
|
+
dtmplSourceId: classEditConfig.id,
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
></Button>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// debugger
|
|
42
|
+
if (
|
|
43
|
+
!button &&
|
|
44
|
+
ActionUtils.isShow(
|
|
45
|
+
ltmplConfig.buttonEditAction?.preposes,
|
|
46
|
+
[data],
|
|
47
|
+
undefined
|
|
48
|
+
)
|
|
49
|
+
) {
|
|
50
|
+
button = (
|
|
51
|
+
<Button
|
|
52
|
+
size="small"
|
|
53
|
+
type="dashed"
|
|
54
|
+
icon={<EditOutlined />}
|
|
55
|
+
onClick={() => doEdit({ code: data.code, mode: "update" })}
|
|
56
|
+
></Button>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return button ? button : <></>;
|
|
61
|
+
};
|
|
62
|
+
export default EditButton;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "antd";
|
|
3
|
+
import {DtmplData, LtmplConfig, ShowViewParam} from "../../tmpl/interface";
|
|
4
|
+
import { AlignCenterOutlined } from "@ant-design/icons";
|
|
5
|
+
import ActionUtils from "../../controls/action/utils";
|
|
6
|
+
|
|
7
|
+
interface ViewButtonProps {
|
|
8
|
+
serverKey?: string;
|
|
9
|
+
showView: (showViewParam: ShowViewParam) => void;
|
|
10
|
+
data: DtmplData;
|
|
11
|
+
ltmplConfig: LtmplConfig;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const EditButton: React.FC<ViewButtonProps> = (props) => {
|
|
15
|
+
const { showView, data, ltmplConfig } = props;
|
|
16
|
+
let button = undefined;
|
|
17
|
+
if (ltmplConfig.classViewConfigs) {
|
|
18
|
+
ltmplConfig.classViewConfigs.forEach((classViewConfig) => {
|
|
19
|
+
if (
|
|
20
|
+
!button &&
|
|
21
|
+
ActionUtils.isShow(classViewConfig.preposes, [data], undefined)
|
|
22
|
+
) {
|
|
23
|
+
button = (
|
|
24
|
+
<Button
|
|
25
|
+
size="small"
|
|
26
|
+
type="dashed"
|
|
27
|
+
icon={<AlignCenterOutlined />}
|
|
28
|
+
onClick={() =>
|
|
29
|
+
showView({
|
|
30
|
+
code: data.code,
|
|
31
|
+
dtmplSourceId: classViewConfig.id,
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
></Button>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// debugger
|
|
41
|
+
if (
|
|
42
|
+
!button &&
|
|
43
|
+
ActionUtils.isShow(
|
|
44
|
+
ltmplConfig.buttonViewAction?.preposes,
|
|
45
|
+
[data],
|
|
46
|
+
undefined
|
|
47
|
+
)
|
|
48
|
+
) {
|
|
49
|
+
button = (
|
|
50
|
+
<Button
|
|
51
|
+
size="small"
|
|
52
|
+
type="dashed"
|
|
53
|
+
icon={<AlignCenterOutlined />}
|
|
54
|
+
onClick={() => showView({ code: data.code})}
|
|
55
|
+
></Button>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return button ? button : <></>;
|
|
60
|
+
};
|
|
61
|
+
export default EditButton;
|
|
@@ -29,6 +29,7 @@ export interface ActDtmplViewStat {
|
|
|
29
29
|
snapshotOpen?: boolean;
|
|
30
30
|
layout?: object;
|
|
31
31
|
refreshCode?: string;
|
|
32
|
+
actionDtmplData?:DtmplData;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
class ActDtmplView extends React.PureComponent<
|
|
@@ -54,17 +55,27 @@ class ActDtmplView extends React.PureComponent<
|
|
|
54
55
|
wrapperCol: {span: 16},
|
|
55
56
|
},
|
|
56
57
|
refreshCode: undefined,
|
|
58
|
+
actionDtmplData:undefined,
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
async componentDidMount() {
|
|
60
|
-
const {sourceId, serverKey} = this.props;
|
|
62
|
+
const {sourceId,code, serverKey} = this.props;
|
|
61
63
|
let dtmplConfig = await HCDataSource.requestViewDtmplConfig(
|
|
62
64
|
serverKey,
|
|
63
65
|
sourceId
|
|
64
66
|
);
|
|
67
|
+
let actionDtmplData=undefined
|
|
68
|
+
if(dtmplConfig.viewActions && dtmplConfig?.viewActions.length>0){
|
|
69
|
+
actionDtmplData = await HcserviceV3.requestViewDtmplData(
|
|
70
|
+
serverKey,
|
|
71
|
+
sourceId,
|
|
72
|
+
code,null
|
|
73
|
+
);
|
|
74
|
+
}
|
|
65
75
|
|
|
66
76
|
this.setState({
|
|
67
77
|
dtmplConfig,
|
|
78
|
+
actionDtmplData,
|
|
68
79
|
});
|
|
69
80
|
}
|
|
70
81
|
|
|
@@ -149,7 +160,7 @@ class ActDtmplView extends React.PureComponent<
|
|
|
149
160
|
loading,
|
|
150
161
|
layout,
|
|
151
162
|
snapshotOpen,
|
|
152
|
-
refreshCode,
|
|
163
|
+
refreshCode,actionDtmplData,
|
|
153
164
|
} = this.state;
|
|
154
165
|
const {translate} = this.context;
|
|
155
166
|
|
|
@@ -192,6 +203,7 @@ class ActDtmplView extends React.PureComponent<
|
|
|
192
203
|
iconType={"icon-title"}
|
|
193
204
|
hiddenType={"disabled"}
|
|
194
205
|
//serial={serial}
|
|
206
|
+
data={[actionDtmplData]}
|
|
195
207
|
key={ac.id}
|
|
196
208
|
formRef={this.formRef}
|
|
197
209
|
actionConfig={ac}
|
|
@@ -8,12 +8,16 @@ import { LocaleContext } from "../locale/LocaleProvider";
|
|
|
8
8
|
const RadioGroup = Radio.Group;
|
|
9
9
|
type ExportStatus = "ready" | "exporting" | "success" | "fail" | "stop";
|
|
10
10
|
type ExportMode = "current" | "all";
|
|
11
|
+
export type ExportType="ltmpl-data-excel"|"ltmpl-data-filedata";
|
|
12
|
+
|
|
11
13
|
interface ExportFrameProps {
|
|
12
14
|
defaultExportMode?: string;
|
|
13
15
|
serverKey?: string;
|
|
16
|
+
sourceId?:string;
|
|
14
17
|
queryKey: QueryKey;
|
|
15
18
|
currentPage?: PageInfo;
|
|
16
19
|
title: string;
|
|
20
|
+
type:ExportType;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
interface ExportFrameStat {
|
|
@@ -36,6 +40,7 @@ export default class ExportFrame extends React.PureComponent<
|
|
|
36
40
|
> {
|
|
37
41
|
static defaultProps = {
|
|
38
42
|
defaultExportMode: "all",
|
|
43
|
+
type:"ltmpl-data-excel",
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
state = {
|
|
@@ -86,20 +91,19 @@ export default class ExportFrame extends React.PureComponent<
|
|
|
86
91
|
}
|
|
87
92
|
|
|
88
93
|
handleStart = () => {
|
|
89
|
-
const { queryKey, currentPage, title, serverKey } = this.props;
|
|
94
|
+
const { queryKey, currentPage, title, serverKey,type,sourceId } = this.props;
|
|
90
95
|
const { startPageNo, endPageNo, exportMode } = this.state;
|
|
91
96
|
|
|
92
|
-
|
|
93
|
-
|
|
94
97
|
this.setState({
|
|
95
98
|
exportStatus: "ready",
|
|
96
99
|
});
|
|
97
100
|
const { getServiceLangStr } = this.context;
|
|
98
101
|
Super.super({
|
|
99
|
-
url: `/v3/
|
|
102
|
+
url: `/v3/export/${type}`,
|
|
100
103
|
serverKey,
|
|
101
104
|
method: "GET",
|
|
102
105
|
query: {
|
|
106
|
+
sourceId,
|
|
103
107
|
language:getServiceLangStr(),
|
|
104
108
|
scope: exportMode,
|
|
105
109
|
withDetail: false,
|
|
@@ -127,7 +131,7 @@ export default class ExportFrame extends React.PureComponent<
|
|
|
127
131
|
const { exportStatus } = this.state;
|
|
128
132
|
Super.super(
|
|
129
133
|
{
|
|
130
|
-
url: `/v3/
|
|
134
|
+
url: `/v3/export/status`,
|
|
131
135
|
serverKey,
|
|
132
136
|
query: {
|
|
133
137
|
interrupted: exportStatus == "stop",
|
|
@@ -180,7 +184,7 @@ export default class ExportFrame extends React.PureComponent<
|
|
|
180
184
|
Units.downloadFile(
|
|
181
185
|
Units.joinPath(
|
|
182
186
|
Units.api(serverKey),
|
|
183
|
-
`/v3/
|
|
187
|
+
`/v3/export/download?exportId=${exportId}&@token=${hydrocarbonToken}&@programToken=${Units.programCode(
|
|
184
188
|
serverKey
|
|
185
189
|
)}`
|
|
186
190
|
),
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, Progress } from "antd";
|
|
3
|
+
import "./export-frame.css";
|
|
4
|
+
import Super from "../tmpl/superagent";
|
|
5
|
+
import Units from "../units";
|
|
6
|
+
import {ButtonConfig} from "../tmpl/interface";
|
|
7
|
+
import { LocaleContext } from "../locale/LocaleProvider";
|
|
8
|
+
interface SelectCodeExportFrameProps {
|
|
9
|
+
serverKey?: string;
|
|
10
|
+
fileExport:ButtonConfig;
|
|
11
|
+
codes: string[];
|
|
12
|
+
title?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface SelectCodeExportFrameStat {
|
|
16
|
+
interrupted?: boolean;
|
|
17
|
+
exportId?: string;
|
|
18
|
+
exportMode?: string;
|
|
19
|
+
percent?: number;
|
|
20
|
+
exportStatus?: string;
|
|
21
|
+
exportingMsg?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default class SelectCodeExportFrame extends React.PureComponent<
|
|
25
|
+
SelectCodeExportFrameProps,
|
|
26
|
+
SelectCodeExportFrameStat
|
|
27
|
+
> {
|
|
28
|
+
static defaultProps = {
|
|
29
|
+
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
state = {
|
|
33
|
+
interrupted: false,
|
|
34
|
+
exportId: undefined,
|
|
35
|
+
percent: 0,
|
|
36
|
+
exportStatus: "ready",
|
|
37
|
+
exportingMsg: "",
|
|
38
|
+
};
|
|
39
|
+
static contextType = LocaleContext;
|
|
40
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
41
|
+
|
|
42
|
+
componentWillUnmount() {
|
|
43
|
+
console.log("销毁");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
timerID = undefined;
|
|
47
|
+
setInerval = (interval) => {
|
|
48
|
+
if (this.timerID) {
|
|
49
|
+
clearInterval(this.timerID);
|
|
50
|
+
}
|
|
51
|
+
this.timerID = interval;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
shouldComponentUpdate(prevProps, prevState) {
|
|
55
|
+
if(prevProps && prevProps.codes && this.props.codes){
|
|
56
|
+
if(this.props.codes!=prevProps.codes){
|
|
57
|
+
this.setState({exportStatus:'ready',percent:0,exportingMsg:""})
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
handleStart = () => {
|
|
64
|
+
const { title, serverKey,codes,fileExport } = this.props;
|
|
65
|
+
const { } = this.state;
|
|
66
|
+
|
|
67
|
+
this.setState({
|
|
68
|
+
exportStatus: "ready",
|
|
69
|
+
});
|
|
70
|
+
const { getServiceLangStr } = this.context;
|
|
71
|
+
Super.super({
|
|
72
|
+
url: `/v3/export/ltmpl-data-filedata`,
|
|
73
|
+
serverKey,
|
|
74
|
+
method: "GET",
|
|
75
|
+
query: {
|
|
76
|
+
language:getServiceLangStr(),
|
|
77
|
+
codes: codes,
|
|
78
|
+
sourceId:fileExport.id,
|
|
79
|
+
},
|
|
80
|
+
}).then((res) => {
|
|
81
|
+
if (res.exportId) {
|
|
82
|
+
this.setState({
|
|
83
|
+
exportId: res.exportId,
|
|
84
|
+
exportStatus: "exporting",
|
|
85
|
+
});
|
|
86
|
+
this.statusOut(res.exportId);
|
|
87
|
+
this.setInerval(setInterval(() => this.statusOut(res.exportId), 2000));
|
|
88
|
+
} else {
|
|
89
|
+
this.setState({
|
|
90
|
+
exportStatus: "fail",
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
statusOut = (exportId) => {
|
|
96
|
+
const { serverKey } = this.props;
|
|
97
|
+
const { exportStatus } = this.state;
|
|
98
|
+
Super.super(
|
|
99
|
+
{
|
|
100
|
+
url: `/v3/export/status`,
|
|
101
|
+
serverKey,
|
|
102
|
+
query: {
|
|
103
|
+
interrupted: exportStatus == "stop",
|
|
104
|
+
exportId,
|
|
105
|
+
},
|
|
106
|
+
method: "GET",
|
|
107
|
+
},
|
|
108
|
+
"",
|
|
109
|
+
"none"
|
|
110
|
+
).then((res) => {
|
|
111
|
+
if (res.status == "error") {
|
|
112
|
+
clearInterval(this.timerID);
|
|
113
|
+
console.log(res.statusMsg, this.timerID);
|
|
114
|
+
this.setState({
|
|
115
|
+
exportingMsg: res.statusMsg,
|
|
116
|
+
exportStatus: "stop",
|
|
117
|
+
percent: 0,
|
|
118
|
+
});
|
|
119
|
+
} else if (res.breaked) {
|
|
120
|
+
clearInterval(this.timerID);
|
|
121
|
+
this.setState({
|
|
122
|
+
exportingMsg: "已终止",
|
|
123
|
+
exportStatus: "stop",
|
|
124
|
+
percent: 0,
|
|
125
|
+
});
|
|
126
|
+
} else {
|
|
127
|
+
this.setState({
|
|
128
|
+
exportingMsg: res.statusMsg,
|
|
129
|
+
percent: Math.floor((res.current / res.totalCount) * 100),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (exportStatus == "stop") {
|
|
134
|
+
clearInterval(this.timerID);
|
|
135
|
+
}
|
|
136
|
+
if (res.completed === true) {
|
|
137
|
+
clearInterval(this.timerID);
|
|
138
|
+
this.setState({
|
|
139
|
+
exportStatus: "success",
|
|
140
|
+
exportingMsg: res.statusMsg,
|
|
141
|
+
percent: Math.floor((res.current / res.totalCount) * 100),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
download = () => {
|
|
147
|
+
const { title, serverKey } = this.props;
|
|
148
|
+
const { exportId } = this.state;
|
|
149
|
+
const hydrocarbonToken = Units.hydrocarbonToken();
|
|
150
|
+
Units.downloadFile(
|
|
151
|
+
Units.joinPath(
|
|
152
|
+
Units.api(serverKey),
|
|
153
|
+
`/v3/export/download?exportId=${exportId}&@token=${hydrocarbonToken}&@programToken=${Units.programCode(
|
|
154
|
+
serverKey
|
|
155
|
+
)}`
|
|
156
|
+
),
|
|
157
|
+
title
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
handleCancel = () => {
|
|
162
|
+
this.setState({
|
|
163
|
+
percent: 0,
|
|
164
|
+
exportStatus: "stop",
|
|
165
|
+
exportId: undefined,
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
render() {
|
|
170
|
+
const { } = this.props;
|
|
171
|
+
const {
|
|
172
|
+
exportStatus,
|
|
173
|
+
percent,
|
|
174
|
+
exportingMsg,
|
|
175
|
+
} = this.state;
|
|
176
|
+
const { translate } = this.context;
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<div style={{ width: "400px" }} className="exportFrame">
|
|
180
|
+
<div>
|
|
181
|
+
{exportStatus == "ready" ? (
|
|
182
|
+
<>
|
|
183
|
+
<Button type="primary" onClick={this.handleStart}>
|
|
184
|
+
{translate("${开始导出}")}
|
|
185
|
+
</Button>
|
|
186
|
+
</>
|
|
187
|
+
) : exportStatus == "exporting" ? (
|
|
188
|
+
<Button onClick={this.handleCancel}>
|
|
189
|
+
{translate("${取消导出}")}
|
|
190
|
+
</Button>
|
|
191
|
+
) : (
|
|
192
|
+
<Button onClick={this.handleStart}>
|
|
193
|
+
{translate("${重新导出}")}
|
|
194
|
+
</Button>
|
|
195
|
+
)}
|
|
196
|
+
{exportStatus == "success" ? (
|
|
197
|
+
<Button
|
|
198
|
+
type="primary"
|
|
199
|
+
style={{ marginLeft: 10 }}
|
|
200
|
+
disabled={exportStatus != "success"}
|
|
201
|
+
onClick={this.download}
|
|
202
|
+
>
|
|
203
|
+
{translate("${下载文件}")}
|
|
204
|
+
</Button>
|
|
205
|
+
) : (
|
|
206
|
+
""
|
|
207
|
+
)}
|
|
208
|
+
{percent > 0 ? (
|
|
209
|
+
<Progress percent={percent} size="small" status="active" />
|
|
210
|
+
) : (
|
|
211
|
+
""
|
|
212
|
+
)}
|
|
213
|
+
<p>{translate("${"+exportingMsg+"}")}</p>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -25,6 +25,7 @@ import CquickButton from "../controls/cquery/cquick-button";
|
|
|
25
25
|
import { useLocale } from "../locale/useLocale";
|
|
26
26
|
import { SearchOutlined } from "@ant-design/icons";
|
|
27
27
|
import { ProgramConfig } from "../index";
|
|
28
|
+
import SelectCodeExport from "../controls/file-export/select-code-export";
|
|
28
29
|
|
|
29
30
|
const { Panel } = Collapse;
|
|
30
31
|
const FormItem = AntdForm.Item;
|
|
@@ -69,6 +70,7 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
69
70
|
let {
|
|
70
71
|
buttons,
|
|
71
72
|
actions,
|
|
73
|
+
fileExports,
|
|
72
74
|
jumps,
|
|
73
75
|
cQuerys,
|
|
74
76
|
criterias,
|
|
@@ -129,6 +131,38 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
129
131
|
}
|
|
130
132
|
};
|
|
131
133
|
|
|
134
|
+
const renderFileExport = () => {
|
|
135
|
+
if (doAction && fileExports && fileExports.length > 0) {
|
|
136
|
+
return fileExports.map((fileExport) => {
|
|
137
|
+
let disabled = true;
|
|
138
|
+
if (selectedRows) {
|
|
139
|
+
if (selectedRows.length > 0 && fileExport.multible) {
|
|
140
|
+
disabled = false;
|
|
141
|
+
} else if (selectedRows.length == 1) {
|
|
142
|
+
disabled = false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
let codes=[];
|
|
146
|
+
if(selectedDatas){
|
|
147
|
+
selectedDatas.forEach(s=>{
|
|
148
|
+
codes.push(s.code);
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<SelectCodeExport
|
|
154
|
+
serverKey={serverKey}
|
|
155
|
+
hiddenType={"disabled"}
|
|
156
|
+
codes={codes}
|
|
157
|
+
key={fileExport.id}
|
|
158
|
+
fileExport={fileExport}
|
|
159
|
+
disabled={disabled}
|
|
160
|
+
></SelectCodeExport>
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
132
166
|
const renderUpdrill = () => {
|
|
133
167
|
if (updrillButtonConfigs && updrillButtonConfigs.length > 0) {
|
|
134
168
|
let i = 0;
|
|
@@ -402,6 +436,7 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
402
436
|
{renderJump()}
|
|
403
437
|
{renderCQuery()}
|
|
404
438
|
{renderUpdrill()}
|
|
439
|
+
{ renderFileExport()}
|
|
405
440
|
</Space>
|
|
406
441
|
</Space>
|
|
407
442
|
</Col>
|
package/src/aldehyde/index.tsx
CHANGED
|
@@ -113,7 +113,7 @@ import DatePicker from "./controls/date-picker";
|
|
|
113
113
|
import ModelStrucV3 from "./tmpl/model-struc-v3";
|
|
114
114
|
|
|
115
115
|
import TmplConfigAnalysis from "./tmpl/tmpl-config-analysis";
|
|
116
|
-
import BlockMenuAuthTree from "./tree/block-menu-auth-tree"
|
|
116
|
+
import BlockMenuAuthTree from "./tree/block-menu-auth-tree";
|
|
117
117
|
|
|
118
118
|
// locale
|
|
119
119
|
import { LocaleProvider } from "./locale/LocaleProvider";
|
|
@@ -167,5 +167,5 @@ export {
|
|
|
167
167
|
LocaleProvider,
|
|
168
168
|
useLocale,
|
|
169
169
|
antdLangMp,
|
|
170
|
-
TmplConfigAnalysis
|
|
170
|
+
TmplConfigAnalysis,
|
|
171
171
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Layout
|
|
2
|
+
import { Layout, Affix } from "antd";
|
|
3
3
|
import Footer from "./footer/index";
|
|
4
4
|
import { BlockMenu } from "../tmpl/interface";
|
|
5
5
|
import Header from "./header";
|
|
@@ -21,8 +21,8 @@ interface MainPageProps {
|
|
|
21
21
|
footer?: any;
|
|
22
22
|
sideBartitle?: any;
|
|
23
23
|
sideBarLogo?: any;
|
|
24
|
-
leftHeader?:any;
|
|
25
|
-
leftCollapsedHeader?:any;
|
|
24
|
+
leftHeader?: any;
|
|
25
|
+
leftCollapsedHeader?: any;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
interface MainPageState {
|
|
@@ -232,7 +232,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
232
232
|
};
|
|
233
233
|
|
|
234
234
|
render() {
|
|
235
|
-
const { footer, sideBarLogo,leftHeader,leftCollapsedHeader } = this.props;
|
|
235
|
+
const { footer, sideBarLogo, leftHeader, leftCollapsedHeader } = this.props;
|
|
236
236
|
const {
|
|
237
237
|
collapsed,
|
|
238
238
|
currentL2MenuId,
|
|
@@ -281,7 +281,9 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
281
281
|
}}
|
|
282
282
|
collapsed={collapsed}
|
|
283
283
|
>
|
|
284
|
-
<SideBar
|
|
284
|
+
<SideBar
|
|
285
|
+
header={leftHeader}
|
|
286
|
+
collapsedHeader={leftCollapsedHeader}
|
|
285
287
|
title={translate("${" + sideBartitle + "}")}
|
|
286
288
|
logo={sideBarLogo}
|
|
287
289
|
blockMenu={this.findCurrentBlock()}
|
|
@@ -299,7 +301,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
299
301
|
}
|
|
300
302
|
}
|
|
301
303
|
>
|
|
302
|
-
<Header
|
|
304
|
+
<Header toggle={this.toggle} {...this.state} />
|
|
303
305
|
<Content
|
|
304
306
|
style={{
|
|
305
307
|
margin: "24px 16px 0",
|