aldehyde 0.2.160 → 0.2.161
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/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 +23 -0
- package/lib/detail/button/edit-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 +218 -0
- package/lib/layout2/header.js.map +1 -0
- package/lib/layout2/imgs/1.png +0 -0
- package/lib/layout2/imgs/2.png +0 -0
- package/lib/layout2/imgs/3.png +0 -0
- package/lib/layout2/imgs/4.png +0 -0
- package/lib/layout2/imgs/5.png +0 -0
- package/lib/layout2/imgs/6.png +0 -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/login2/Login.d.ts +10 -0
- package/lib/login2/Login.d.ts.map +1 -0
- package/lib/login2/Login.js +63 -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 +42 -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 +4 -2
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +10 -8
- 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 +21 -15
- 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 +6 -3
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +110 -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 +41 -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.js +254 -169
- 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/detail/button/edit-button.tsx +51 -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 +334 -0
- package/src/aldehyde/layout2/imgs/1.png +0 -0
- package/src/aldehyde/layout2/imgs/2.png +0 -0
- package/src/aldehyde/layout2/imgs/3.png +0 -0
- package/src/aldehyde/layout2/imgs/4.png +0 -0
- package/src/aldehyde/layout2/imgs/5.png +0 -0
- package/src/aldehyde/layout2/imgs/6.png +0 -0
- package/src/aldehyde/layout2/imgs/home.png +0 -0
- package/src/aldehyde/layout2/imgs/s.svg +3 -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/login2/Login.tsx +110 -0
- package/src/aldehyde/login2/LoginPage.tsx +58 -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 +12 -9
- 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 +82 -56
- package/src/aldehyde/routable/ttmpl-route.tsx +73 -55
- package/src/aldehyde/routable/withroute.tsx +21 -18
- package/src/aldehyde/table/act-table.tsx +88 -66
- 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 +43 -6
- package/src/aldehyde/tree/tmpl-tree.tsx +2 -1
- package/src/aldehyde/welcome/HCWelcome.js +270 -235
- 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
|
@@ -1,415 +1,436 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
ActionConfig,
|
|
3
|
+
BlockMenu,
|
|
4
|
+
DtmplConfig,
|
|
5
|
+
DtmplData,
|
|
6
|
+
EnumItem,
|
|
7
|
+
FieldBase,
|
|
8
|
+
Level2Menu,
|
|
9
|
+
LtmplConfig,
|
|
10
|
+
LtmplConfigRes,
|
|
11
|
+
SelectConfig,
|
|
12
|
+
TtmplConfig,
|
|
13
13
|
} from "./interface";
|
|
14
14
|
import HcserviceV3 from "./hcservice-v3";
|
|
15
15
|
import ControlTypeSupportor from "./control-type-supportor";
|
|
16
|
-
import {message} from "antd";
|
|
16
|
+
import { message } from "antd";
|
|
17
17
|
import translate from "../locale/translate";
|
|
18
18
|
|
|
19
19
|
const blocksCache: BlockMenu[] = [];
|
|
20
20
|
let programName;
|
|
21
21
|
let fastMenuCached = false;
|
|
22
22
|
let blocksCached = false;
|
|
23
|
-
const fastMenuCache: Map<string, Level2Menu[]> = new Map<
|
|
23
|
+
const fastMenuCache: Map<string, Level2Menu[]> = new Map<
|
|
24
|
+
string,
|
|
25
|
+
Level2Menu[]
|
|
26
|
+
>();
|
|
24
27
|
const enumMap: Map<string, EnumItem[]> = new Map<string, EnumItem[]>(); //key mstrucId
|
|
25
|
-
const enumValueMap: Map<string, Map<string, string>> = new Map<
|
|
28
|
+
const enumValueMap: Map<string, Map<string, string>> = new Map<
|
|
29
|
+
string,
|
|
30
|
+
Map<string, string>
|
|
31
|
+
>();
|
|
26
32
|
// const optionsMap: Map<string, EnumItem[]> = new Map<string, EnumItem[]>();//key mstrucId
|
|
27
|
-
const selectConfigMap: Map<string, SelectConfig> = new Map<
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
const selectConfigMap: Map<string, SelectConfig> = new Map<
|
|
34
|
+
string,
|
|
35
|
+
SelectConfig
|
|
36
|
+
>();
|
|
37
|
+
const ltmplConfigMap: Map<string, LtmplConfigRes> = new Map<
|
|
38
|
+
string,
|
|
39
|
+
LtmplConfigRes
|
|
40
|
+
>();
|
|
41
|
+
const l2LtmplConfigMap: Map<string, LtmplConfigRes> = new Map<
|
|
42
|
+
string,
|
|
43
|
+
LtmplConfigRes
|
|
44
|
+
>();
|
|
30
45
|
const dtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
|
|
31
46
|
const ttmplConfigMap: Map<string, TtmplConfig> = new Map<string, TtmplConfig>();
|
|
32
|
-
const viewDtmplConfigMap: Map<string, DtmplConfig> = new Map<
|
|
33
|
-
|
|
47
|
+
const viewDtmplConfigMap: Map<string, DtmplConfig> = new Map<
|
|
48
|
+
string,
|
|
49
|
+
DtmplConfig
|
|
50
|
+
>();
|
|
51
|
+
const addDtmplConfigMap: Map<string, DtmplConfig> = new Map<
|
|
52
|
+
string,
|
|
53
|
+
DtmplConfig
|
|
54
|
+
>();
|
|
34
55
|
const objctCacheMap: Map<string, DtmplData> = new Map<string, DtmplData>();
|
|
35
56
|
|
|
36
57
|
function findUnloadEnumMstrucIdOfFields(fields: FieldBase[]) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
const mstrucIdArray = [];
|
|
59
|
+
if (fields) {
|
|
60
|
+
fields.forEach((item) => {
|
|
61
|
+
let controlType = ControlTypeSupportor.getSupportControlType(item);
|
|
62
|
+
if (
|
|
63
|
+
controlType == "caselect" ||
|
|
64
|
+
controlType == "select" ||
|
|
65
|
+
controlType == "multiselect" ||
|
|
66
|
+
controlType == "steps" ||
|
|
67
|
+
controlType == "preselect" ||
|
|
68
|
+
controlType == "checkbox" ||
|
|
69
|
+
controlType == "radio"
|
|
70
|
+
) {
|
|
71
|
+
if (!enumMap.has(item.mstrucId)) {
|
|
72
|
+
mstrucIdArray.push(item.mstrucId);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return mstrucIdArray;
|
|
57
78
|
}
|
|
58
79
|
|
|
59
80
|
function findUnloadEnumMstrucIdOfActions(actions: ActionConfig[]) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
const mstrucIds = [];
|
|
82
|
+
if (actions) {
|
|
83
|
+
actions.forEach((item) => {
|
|
84
|
+
let subs = findUnloadEnumMstrucIdOfFields(item.writes);
|
|
85
|
+
concat(mstrucIds, subs);
|
|
86
|
+
subs = findUnloadEnumMstrucIdOfFields(item.preposes);
|
|
87
|
+
concat(mstrucIds, subs);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return mstrucIds;
|
|
70
91
|
}
|
|
71
92
|
|
|
72
93
|
async function loadEnumOfDtmplConfig(
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
serverKey: string,
|
|
95
|
+
selectConfig: DtmplConfig
|
|
75
96
|
) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
concat(mstrucIds, subs);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
let subs = findUnloadEnumMstrucIdOfActions(selectConfig.actions);
|
|
97
|
+
const mstrucIds = [];
|
|
98
|
+
if (selectConfig) {
|
|
99
|
+
if (selectConfig.groups) {
|
|
100
|
+
selectConfig.groups.forEach((group) => {
|
|
101
|
+
let subs = findUnloadEnumMstrucIdOfFields(group.fields);
|
|
85
102
|
concat(mstrucIds, subs);
|
|
86
|
-
|
|
103
|
+
});
|
|
87
104
|
}
|
|
105
|
+
let subs = findUnloadEnumMstrucIdOfActions(selectConfig.actions);
|
|
106
|
+
concat(mstrucIds, subs);
|
|
107
|
+
await loadEnum(serverKey, mstrucIds);
|
|
108
|
+
}
|
|
88
109
|
}
|
|
89
110
|
|
|
90
111
|
function concat(mstrucIds, sub) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
if (sub) {
|
|
113
|
+
sub.forEach((id) => {
|
|
114
|
+
if (!mstrucIds.includes(id)) {
|
|
115
|
+
mstrucIds.push(id);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return mstrucIds;
|
|
99
120
|
}
|
|
100
121
|
|
|
101
122
|
async function loadEnumOfSelectConfig(
|
|
102
|
-
|
|
103
|
-
|
|
123
|
+
serverKey: string,
|
|
124
|
+
selectConfig: SelectConfig
|
|
104
125
|
) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
126
|
+
const mstrucIds = [];
|
|
127
|
+
let subs = findUnloadEnumMstrucIdOfFields(selectConfig.columns);
|
|
128
|
+
concat(mstrucIds, subs);
|
|
129
|
+
subs = findUnloadEnumMstrucIdOfFields(selectConfig.criterias);
|
|
130
|
+
concat(mstrucIds, subs);
|
|
131
|
+
await loadEnum(serverKey, mstrucIds);
|
|
111
132
|
}
|
|
112
133
|
|
|
113
134
|
async function loadEnumOfLtmplConfig(
|
|
114
|
-
|
|
115
|
-
|
|
135
|
+
serverKey: string,
|
|
136
|
+
selectConfig: LtmplConfig
|
|
116
137
|
) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
const mstrucIds = [];
|
|
139
|
+
if (!selectConfig) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
let subs = findUnloadEnumMstrucIdOfFields(selectConfig.columns);
|
|
143
|
+
concat(mstrucIds, subs);
|
|
144
|
+
subs = findUnloadEnumMstrucIdOfFields(selectConfig.criterias);
|
|
145
|
+
concat(mstrucIds, subs);
|
|
146
|
+
subs = findUnloadEnumMstrucIdOfFields(selectConfig.drillingParams);
|
|
147
|
+
concat(mstrucIds, subs);
|
|
148
|
+
subs = findUnloadEnumMstrucIdOfFields(selectConfig.reStatParams);
|
|
149
|
+
concat(mstrucIds, subs);
|
|
150
|
+
subs = findUnloadEnumMstrucIdOfActions(selectConfig.actions);
|
|
151
|
+
concat(mstrucIds, subs);
|
|
152
|
+
subs = findUnloadEnumMstrucIdOfActions(selectConfig.rowActions);
|
|
153
|
+
concat(mstrucIds, subs);
|
|
154
|
+
await loadEnum(serverKey, mstrucIds);
|
|
134
155
|
}
|
|
135
156
|
|
|
136
157
|
async function loadEnum(serverKey: string, mstrucIds: string[], path?: string) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
enumMap.set(key, ems);
|
|
158
|
+
if (mstrucIds && mstrucIds.length > 0) {
|
|
159
|
+
let reqEnum = await HcserviceV3.requestEnum(serverKey, mstrucIds, path);
|
|
160
|
+
for (let key in reqEnum) {
|
|
161
|
+
let ems = reqEnum[key];
|
|
162
|
+
for (let option of ems) {
|
|
163
|
+
if (option["css"]) {
|
|
164
|
+
option["color"] = option["css"].color;
|
|
147
165
|
}
|
|
166
|
+
}
|
|
167
|
+
enumMap.set(key, ems);
|
|
148
168
|
}
|
|
169
|
+
}
|
|
149
170
|
}
|
|
150
171
|
|
|
151
|
-
function HCDataSource() {
|
|
152
|
-
}
|
|
172
|
+
function HCDataSource() {}
|
|
153
173
|
|
|
154
|
-
HCDataSource.loadEnumOfFields = async function
|
|
155
|
-
|
|
156
|
-
|
|
174
|
+
HCDataSource.loadEnumOfFields = async function(
|
|
175
|
+
serverKey: string,
|
|
176
|
+
fields: FieldBase[]
|
|
157
177
|
) {
|
|
158
|
-
|
|
159
|
-
|
|
178
|
+
const mstrucIds = findUnloadEnumMstrucIdOfFields(fields);
|
|
179
|
+
await loadEnum(serverKey, mstrucIds);
|
|
160
180
|
};
|
|
161
181
|
|
|
162
|
-
HCDataSource.loadEnumOfFieldsWithPath = async function
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
182
|
+
HCDataSource.loadEnumOfFieldsWithPath = async function(
|
|
183
|
+
serverKey: string,
|
|
184
|
+
fields: FieldBase[],
|
|
185
|
+
path: string
|
|
166
186
|
) {
|
|
167
|
-
|
|
168
|
-
|
|
187
|
+
const mstrucIds = findUnloadEnumMstrucIdOfFields(fields);
|
|
188
|
+
await loadEnum(serverKey, mstrucIds, path);
|
|
169
189
|
};
|
|
170
190
|
|
|
171
|
-
HCDataSource.getOptions = async function
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
enumMap.set(mstrucId, reqOptions);
|
|
191
|
+
HCDataSource.getOptions = async function(serverKey: string, mstrucId: string) {
|
|
192
|
+
if (!mstrucId) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
if (!enumMap.has(mstrucId)) {
|
|
196
|
+
let reqOptions = await HcserviceV3.requestOptions(serverKey, mstrucId)[
|
|
197
|
+
mstrucId
|
|
198
|
+
];
|
|
199
|
+
if (reqOptions != null) {
|
|
200
|
+
for (let option of reqOptions) {
|
|
201
|
+
if (option["css"]) {
|
|
202
|
+
option["color"] = option["css"].color;
|
|
186
203
|
}
|
|
204
|
+
}
|
|
205
|
+
enumMap.set(mstrucId, reqOptions);
|
|
187
206
|
}
|
|
207
|
+
}
|
|
188
208
|
|
|
189
|
-
|
|
209
|
+
return enumMap.get(mstrucId);
|
|
190
210
|
};
|
|
191
211
|
|
|
192
|
-
HCDataSource.requestLtmplConfig = async function
|
|
193
|
-
|
|
194
|
-
|
|
212
|
+
HCDataSource.requestLtmplConfig = async function(
|
|
213
|
+
serverKey: string,
|
|
214
|
+
sourceId: string
|
|
195
215
|
) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
216
|
+
if (!ltmplConfigMap.has(sourceId)) {
|
|
217
|
+
ltmplConfigMap.set(
|
|
218
|
+
sourceId,
|
|
219
|
+
await HcserviceV3.requestLtmplConfig(serverKey, sourceId)
|
|
220
|
+
);
|
|
221
|
+
//加载枚举
|
|
222
|
+
let res: LtmplConfigRes = ltmplConfigMap.get(sourceId);
|
|
223
|
+
await loadEnumOfLtmplConfig(serverKey, res.ltmplConfig);
|
|
224
|
+
}
|
|
225
|
+
return ltmplConfigMap.get(sourceId);
|
|
206
226
|
};
|
|
207
|
-
HCDataSource.requestL2LtmplConfig = async function
|
|
208
|
-
|
|
209
|
-
|
|
227
|
+
HCDataSource.requestL2LtmplConfig = async function(
|
|
228
|
+
serverKey: string,
|
|
229
|
+
sourceId: string
|
|
210
230
|
) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
231
|
+
if (!l2LtmplConfigMap.has(sourceId)) {
|
|
232
|
+
l2LtmplConfigMap.set(
|
|
233
|
+
sourceId,
|
|
234
|
+
await HcserviceV3.requestL2LtmplConfig(serverKey, sourceId)
|
|
235
|
+
);
|
|
236
|
+
//加载枚举
|
|
237
|
+
let res: LtmplConfigRes = l2LtmplConfigMap.get(sourceId);
|
|
238
|
+
await loadEnumOfLtmplConfig(serverKey, res.ltmplConfig);
|
|
239
|
+
}
|
|
240
|
+
return l2LtmplConfigMap.get(sourceId);
|
|
221
241
|
};
|
|
222
242
|
|
|
223
|
-
HCDataSource.requestSelectConfig = async function
|
|
224
|
-
|
|
225
|
-
|
|
243
|
+
HCDataSource.requestSelectConfig = async function(
|
|
244
|
+
serverKey: string,
|
|
245
|
+
sourceId: string
|
|
226
246
|
) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
247
|
+
if (!selectConfigMap.has(sourceId)) {
|
|
248
|
+
selectConfigMap.set(
|
|
249
|
+
sourceId,
|
|
250
|
+
await HcserviceV3.requestSelectConfig(serverKey, sourceId)
|
|
251
|
+
);
|
|
252
|
+
//加载枚举
|
|
253
|
+
await loadEnumOfSelectConfig(serverKey, selectConfigMap.get(sourceId));
|
|
254
|
+
}
|
|
255
|
+
return selectConfigMap.get(sourceId);
|
|
236
256
|
};
|
|
237
|
-
HCDataSource.requestDtmplConfig = async function
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
257
|
+
HCDataSource.requestDtmplConfig = async function(
|
|
258
|
+
serverKey: string,
|
|
259
|
+
sourceId: string,
|
|
260
|
+
code: string
|
|
241
261
|
) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
//加载枚举
|
|
256
|
-
await loadEnumOfDtmplConfig(serverKey, dtmplConfig);
|
|
262
|
+
if (!dtmplConfigMap.has(sourceId)) {
|
|
263
|
+
let dtmplConfig: DtmplConfig = await HcserviceV3.requestDtmplConfig(
|
|
264
|
+
serverKey,
|
|
265
|
+
sourceId,
|
|
266
|
+
code
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
if (dtmplConfig && !dtmplConfig.dynamic) {
|
|
270
|
+
dtmplConfigMap.set(sourceId, dtmplConfig);
|
|
271
|
+
} else {
|
|
272
|
+
//直接返回
|
|
273
|
+
return dtmplConfig;
|
|
257
274
|
}
|
|
258
|
-
|
|
275
|
+
//加载枚举
|
|
276
|
+
await loadEnumOfDtmplConfig(serverKey, dtmplConfig);
|
|
277
|
+
}
|
|
278
|
+
return dtmplConfigMap.get(sourceId);
|
|
259
279
|
};
|
|
260
280
|
|
|
261
|
-
HCDataSource.requestTtmplConfig = async function
|
|
262
|
-
|
|
263
|
-
|
|
281
|
+
HCDataSource.requestTtmplConfig = async function(
|
|
282
|
+
serverKey: string,
|
|
283
|
+
sourceId: string
|
|
264
284
|
) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
285
|
+
if (!ttmplConfigMap.has(sourceId)) {
|
|
286
|
+
let res = await HcserviceV3.requestTtmplConfig(serverKey, sourceId);
|
|
287
|
+
ttmplConfigMap.set(sourceId, res);
|
|
288
|
+
ttmplConfigMap.set(res.id, res);
|
|
289
|
+
}
|
|
290
|
+
return ttmplConfigMap.get(sourceId);
|
|
271
291
|
};
|
|
272
292
|
|
|
273
|
-
HCDataSource.requestViewDtmplConfig = async function
|
|
274
|
-
|
|
275
|
-
|
|
293
|
+
HCDataSource.requestViewDtmplConfig = async function(
|
|
294
|
+
serverKey: string,
|
|
295
|
+
sourceId: string
|
|
276
296
|
) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
297
|
+
if (!viewDtmplConfigMap.has(sourceId)) {
|
|
298
|
+
viewDtmplConfigMap.set(
|
|
299
|
+
sourceId,
|
|
300
|
+
await HcserviceV3.requestViewDtmplConfig(serverKey, sourceId)
|
|
301
|
+
);
|
|
302
|
+
//加载枚举
|
|
303
|
+
await loadEnumOfDtmplConfig(serverKey, viewDtmplConfigMap.get(sourceId));
|
|
304
|
+
}
|
|
305
|
+
return viewDtmplConfigMap.get(sourceId);
|
|
286
306
|
};
|
|
287
307
|
|
|
288
|
-
HCDataSource.requestAddDtmplConfig = async function
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
308
|
+
HCDataSource.requestAddDtmplConfig = async function(
|
|
309
|
+
serverKey: string,
|
|
310
|
+
sourceId: string,
|
|
311
|
+
addTmplId: string
|
|
292
312
|
) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
313
|
+
let key = addTmplId ? addTmplId : sourceId;
|
|
314
|
+
if (!addDtmplConfigMap.has(key)) {
|
|
315
|
+
addDtmplConfigMap.set(
|
|
316
|
+
key,
|
|
317
|
+
await HcserviceV3.requestAddDtmplConfig(serverKey, sourceId, addTmplId)
|
|
318
|
+
);
|
|
319
|
+
//加载枚举
|
|
320
|
+
await loadEnumOfDtmplConfig(serverKey, addDtmplConfigMap.get(key));
|
|
321
|
+
}
|
|
322
|
+
return addDtmplConfigMap.get(key);
|
|
303
323
|
};
|
|
304
324
|
|
|
305
|
-
HCDataSource.getEnums = function
|
|
306
|
-
|
|
307
|
-
|
|
325
|
+
HCDataSource.getEnums = function(mstrucId: string): EnumItem[] {
|
|
326
|
+
//这里是不是后续可以考虑防止串改
|
|
327
|
+
return enumMap.get(mstrucId);
|
|
308
328
|
};
|
|
309
329
|
|
|
310
|
-
HCDataSource.getEnumsValueMap = function
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
330
|
+
HCDataSource.getEnumsValueMap = function(
|
|
331
|
+
mstrucId: string
|
|
332
|
+
): Map<string, string> {
|
|
333
|
+
//这里是不是后续可以考虑防止串改
|
|
334
|
+
let map = enumValueMap.get(mstrucId);
|
|
335
|
+
if (!map) {
|
|
336
|
+
let emap = enumMap.get(mstrucId);
|
|
337
|
+
if (emap) {
|
|
338
|
+
map = new Map<string, string>();
|
|
339
|
+
enumValueMap.set(mstrucId, map);
|
|
340
|
+
emap.map((item) => {
|
|
341
|
+
map.set(item.value, item.value);
|
|
342
|
+
map.set(item.id, item.value);
|
|
343
|
+
});
|
|
344
|
+
} else {
|
|
345
|
+
return null;
|
|
325
346
|
}
|
|
326
|
-
|
|
347
|
+
}
|
|
348
|
+
return map;
|
|
327
349
|
};
|
|
328
350
|
|
|
329
|
-
HCDataSource.getEnumOption = function
|
|
330
|
-
|
|
331
|
-
|
|
351
|
+
HCDataSource.getEnumOption = function(
|
|
352
|
+
mstrucId: string,
|
|
353
|
+
enumValue: string
|
|
332
354
|
): EnumItem {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
355
|
+
if (!enumValue) {
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
let options = this.getEnums(mstrucId);
|
|
359
|
+
let enumItem: EnumItem = undefined;
|
|
360
|
+
if (options) {
|
|
361
|
+
options.forEach((option) => {
|
|
362
|
+
if (option.value === enumValue) {
|
|
363
|
+
enumItem = option;
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
return enumItem;
|
|
347
369
|
};
|
|
348
370
|
HCDataSource.getEnumValueColor = (
|
|
349
|
-
|
|
350
|
-
|
|
371
|
+
mstrucId: string,
|
|
372
|
+
enumValue: string
|
|
351
373
|
): string => {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
374
|
+
let enumItem: EnumItem = HCDataSource.getEnumOption(mstrucId, enumValue);
|
|
375
|
+
if (enumItem) {
|
|
376
|
+
return enumItem.color;
|
|
377
|
+
} else {
|
|
378
|
+
return undefined;
|
|
379
|
+
}
|
|
358
380
|
};
|
|
359
381
|
|
|
360
382
|
HCDataSource.requestBlocks = async (l2MenuId: string, blockId: string) => {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
} else {
|
|
382
|
-
result = {
|
|
383
|
-
blocks: blocksCache,
|
|
384
|
-
blockId,
|
|
385
|
-
l2MenuId,
|
|
386
|
-
programName,
|
|
387
|
-
};
|
|
383
|
+
let result;
|
|
384
|
+
if (!blocksCached) {
|
|
385
|
+
blocksCached = true;
|
|
386
|
+
let blockRes = (await HcserviceV3.requestBlocks(
|
|
387
|
+
l2MenuId ? l2MenuId : undefined,
|
|
388
|
+
blockId ? blockId : undefined
|
|
389
|
+
)) as any;
|
|
390
|
+
if (blockRes) {
|
|
391
|
+
for (let block of blockRes.blocks) {
|
|
392
|
+
blocksCache.push(block);
|
|
393
|
+
}
|
|
394
|
+
programName = blockRes.programName;
|
|
395
|
+
result = {
|
|
396
|
+
blocks: blockRes.blocks,
|
|
397
|
+
l2MenuId: blockRes.l2MenuId,
|
|
398
|
+
blockId: blockRes.blockId,
|
|
399
|
+
programName: blockRes.programName,
|
|
400
|
+
};
|
|
388
401
|
}
|
|
389
|
-
|
|
390
|
-
|
|
402
|
+
} else {
|
|
403
|
+
result = {
|
|
404
|
+
blocks: blocksCache,
|
|
405
|
+
blockId,
|
|
406
|
+
l2MenuId,
|
|
407
|
+
programName,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return result;
|
|
391
412
|
};
|
|
392
413
|
|
|
393
414
|
HCDataSource.initfastMenu = async () => {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
415
|
+
// let result:Map<string,Level2Menu[]> ;
|
|
416
|
+
if (fastMenuCache.size < 1) {
|
|
417
|
+
let re = await HcserviceV3.requestFastMenu();
|
|
418
|
+
if (re) {
|
|
419
|
+
for (let e in re) {
|
|
420
|
+
fastMenuCache.set(e, re[e]);
|
|
421
|
+
}
|
|
402
422
|
}
|
|
423
|
+
}
|
|
403
424
|
};
|
|
404
425
|
|
|
405
426
|
HCDataSource.fastMenu = async (key: string) => {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
427
|
+
// let result:Map<string,Level2Menu[]> ;
|
|
428
|
+
if (!fastMenuCached) {
|
|
429
|
+
fastMenuCached = true;
|
|
430
|
+
await HCDataSource.initfastMenu();
|
|
431
|
+
}
|
|
411
432
|
|
|
412
|
-
|
|
433
|
+
return fastMenuCache.get(key);
|
|
413
434
|
};
|
|
414
435
|
|
|
415
436
|
// HCDataSource.quickEntranceMenus = async () => {
|
|
@@ -445,49 +466,49 @@ HCDataSource.fastMenu = async (key: string) => {
|
|
|
445
466
|
// return [...workbenchCache];
|
|
446
467
|
// }
|
|
447
468
|
|
|
448
|
-
HCDataSource.reload = async function
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
469
|
+
HCDataSource.reload = async function(roles: string[]) {
|
|
470
|
+
// if(roles.includes("admin")){
|
|
471
|
+
let res = await HcserviceV3.reload();
|
|
472
|
+
if (res.status != "success") {
|
|
473
|
+
// message.error(res.message);
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
this.clear();
|
|
477
|
+
message.success(translate("${执行成功}"));
|
|
478
|
+
// }else{
|
|
479
|
+
// this.clearOnly();
|
|
480
|
+
// message.success("执行成功");
|
|
481
|
+
// }
|
|
461
482
|
};
|
|
462
483
|
|
|
463
|
-
HCDataSource.cache = function
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
484
|
+
HCDataSource.cache = function(data: DtmplData) {
|
|
485
|
+
if (data) {
|
|
486
|
+
// console.log('put----',data);
|
|
487
|
+
objctCacheMap.set(data.code, data);
|
|
488
|
+
}
|
|
468
489
|
};
|
|
469
490
|
|
|
470
|
-
HCDataSource.getCache = function
|
|
471
|
-
|
|
472
|
-
|
|
491
|
+
HCDataSource.getCache = function(code: string) {
|
|
492
|
+
//console.log('objctCacheMap',objctCacheMap);
|
|
493
|
+
return objctCacheMap.get(code);
|
|
473
494
|
};
|
|
474
495
|
|
|
475
|
-
HCDataSource.clear = async function
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
496
|
+
HCDataSource.clear = async function() {
|
|
497
|
+
fastMenuCache.clear();
|
|
498
|
+
enumMap.clear();
|
|
499
|
+
ltmplConfigMap.clear();
|
|
500
|
+
dtmplConfigMap.clear();
|
|
501
|
+
viewDtmplConfigMap.clear();
|
|
502
|
+
addDtmplConfigMap.clear();
|
|
503
|
+
selectConfigMap.clear();
|
|
504
|
+
l2LtmplConfigMap.clear();
|
|
505
|
+
// optionsMap.clear();
|
|
506
|
+
blocksCache.splice(0, blocksCache.length);
|
|
507
|
+
blocksCached = false;
|
|
508
|
+
// quickEntranceCache.splice(0, quickEntranceCache.length);
|
|
509
|
+
// messageCache.splice(0, quickEntranceCache.length);
|
|
510
|
+
// workbenchCache.splice(0, workbenchCache.length);
|
|
511
|
+
objctCacheMap.clear();
|
|
491
512
|
};
|
|
492
513
|
|
|
493
514
|
export default HCDataSource; //对外 TmplDataSource
|