aldehyde 0.2.52 → 0.2.53

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.
Files changed (273) hide show
  1. package/lib/controls/action/index.d.ts +1 -0
  2. package/lib/controls/action/index.d.ts.map +1 -1
  3. package/lib/controls/action/index.js +2 -2
  4. package/lib/controls/action/index.js.map +1 -1
  5. package/lib/controls/cascader/index.d.ts.map +1 -1
  6. package/lib/controls/cascader/index.js +2 -2
  7. package/lib/controls/cascader/index.js.map +1 -1
  8. package/lib/controls/chemstruc/graph.js +2 -2
  9. package/lib/controls/chemstruc/graph.js.map +1 -1
  10. package/lib/controls/cquery/cquick-button.d.ts +1 -0
  11. package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
  12. package/lib/controls/cquery/cquick-button.js +3 -3
  13. package/lib/controls/cquery/cquick-button.js.map +1 -1
  14. package/lib/controls/entity-select/entity-select.js +10 -10
  15. package/lib/controls/entity-select/entity-select.js.map +1 -1
  16. package/lib/controls/entity-select/lab-tree-select.js +3 -3
  17. package/lib/controls/entity-select/lab-tree-select.js.map +1 -1
  18. package/lib/controls/entity-select/popover-entity-select.js +2 -2
  19. package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
  20. package/lib/controls/entry-control.d.ts +1 -0
  21. package/lib/controls/entry-control.d.ts.map +1 -1
  22. package/lib/controls/entry-control.js.map +1 -1
  23. package/lib/controls/file-view/drawer-file-view.d.ts +1 -0
  24. package/lib/controls/file-view/drawer-file-view.d.ts.map +1 -1
  25. package/lib/controls/file-view/drawer-file-view.js +4 -4
  26. package/lib/controls/file-view/drawer-file-view.js.map +1 -1
  27. package/lib/controls/file-view/index.d.ts +2 -1
  28. package/lib/controls/file-view/index.d.ts.map +1 -1
  29. package/lib/controls/file-view/index.js +12 -12
  30. package/lib/controls/file-view/index.js.map +1 -1
  31. package/lib/controls/relation-existion/index.js +2 -2
  32. package/lib/controls/relation-existion/index.js.map +1 -1
  33. package/lib/controls/rfield/index.js +2 -2
  34. package/lib/controls/rfield/index.js.map +1 -1
  35. package/lib/controls/signature/index.js +2 -2
  36. package/lib/controls/signature/index.js.map +1 -1
  37. package/lib/controls/upload/index.js +2 -2
  38. package/lib/controls/upload/index.js.map +1 -1
  39. package/lib/controls/view-control.d.ts +1 -0
  40. package/lib/controls/view-control.d.ts.map +1 -1
  41. package/lib/controls/view-control.js +15 -6
  42. package/lib/controls/view-control.js.map +1 -1
  43. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +1 -0
  44. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
  45. package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
  46. package/lib/detail/button/cquery-button-bar.d.ts +1 -0
  47. package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
  48. package/lib/detail/button/cquery-button-bar.js +3 -3
  49. package/lib/detail/button/cquery-button-bar.js.map +1 -1
  50. package/lib/detail/button/submit-button-bar.d.ts +1 -0
  51. package/lib/detail/button/submit-button-bar.d.ts.map +1 -1
  52. package/lib/detail/button/submit-button-bar.js +3 -3
  53. package/lib/detail/button/submit-button-bar.js.map +1 -1
  54. package/lib/detail/edit/dtmpl-edit.js +9 -9
  55. package/lib/detail/edit/dtmpl-edit.js.map +1 -1
  56. package/lib/detail/edit/fields-edit-card.d.ts +1 -0
  57. package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
  58. package/lib/detail/edit/fields-edit-card.js +2 -2
  59. package/lib/detail/edit/fields-edit-card.js.map +1 -1
  60. package/lib/detail/edit/modal-row-edit.d.ts +1 -0
  61. package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
  62. package/lib/detail/edit/modal-row-edit.js +2 -2
  63. package/lib/detail/edit/modal-row-edit.js.map +1 -1
  64. package/lib/detail/edit/row-edit-card.d.ts +1 -0
  65. package/lib/detail/edit/row-edit-card.d.ts.map +1 -1
  66. package/lib/detail/edit/row-edit-card.js +2 -2
  67. package/lib/detail/edit/row-edit-card.js.map +1 -1
  68. package/lib/detail/edit/row-editor.d.ts +1 -0
  69. package/lib/detail/edit/row-editor.d.ts.map +1 -1
  70. package/lib/detail/edit/row-editor.js +2 -2
  71. package/lib/detail/edit/row-editor.js.map +1 -1
  72. package/lib/detail/view/act-dtmpl-view.js +5 -5
  73. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  74. package/lib/detail/view/dtmpl-view.js +8 -8
  75. package/lib/detail/view/dtmpl-view.js.map +1 -1
  76. package/lib/detail/view/field-view-group.d.ts +1 -0
  77. package/lib/detail/view/field-view-group.d.ts.map +1 -1
  78. package/lib/detail/view/field-view-group.js +2 -2
  79. package/lib/detail/view/field-view-group.js.map +1 -1
  80. package/lib/detail/view/modal-dtmpl-view.js +2 -2
  81. package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
  82. package/lib/detail/view/snapshot-timeline.d.ts +1 -0
  83. package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
  84. package/lib/detail/view/snapshot-timeline.js +4 -4
  85. package/lib/detail/view/snapshot-timeline.js.map +1 -1
  86. package/lib/exportor/export-frame.d.ts +1 -0
  87. package/lib/exportor/export-frame.d.ts.map +1 -1
  88. package/lib/exportor/export-frame.js +6 -3
  89. package/lib/exportor/export-frame.js.map +1 -1
  90. package/lib/form/criteria-form.d.ts +1 -0
  91. package/lib/form/criteria-form.d.ts.map +1 -1
  92. package/lib/form/criteria-form.js +6 -5
  93. package/lib/form/criteria-form.js.map +1 -1
  94. package/lib/form/dtmpl-form.js +9 -9
  95. package/lib/form/dtmpl-form.js.map +1 -1
  96. package/lib/form/field-group-form.d.ts +1 -0
  97. package/lib/form/field-group-form.d.ts.map +1 -1
  98. package/lib/form/field-group-form.js +2 -2
  99. package/lib/form/field-group-form.js.map +1 -1
  100. package/lib/form/fields-form.d.ts +1 -0
  101. package/lib/form/fields-form.d.ts.map +1 -1
  102. package/lib/form/fields-form.js +2 -2
  103. package/lib/form/fields-form.js.map +1 -1
  104. package/lib/form/form-Item-group.d.ts +1 -0
  105. package/lib/form/form-Item-group.d.ts.map +1 -1
  106. package/lib/form/form-Item-group.js +4 -4
  107. package/lib/form/form-Item-group.js.map +1 -1
  108. package/lib/import/excel-import.d.ts +1 -0
  109. package/lib/import/excel-import.d.ts.map +1 -1
  110. package/lib/import/excel-import.js +6 -3
  111. package/lib/import/excel-import.js.map +1 -1
  112. package/lib/layout/menu/l2menu-message-bar.js +2 -2
  113. package/lib/layout/menu/l2menu-message-bar.js.map +1 -1
  114. package/lib/layout/menu/l2menu-quick-bar.js +1 -1
  115. package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
  116. package/lib/layout/menu/userinfo-bar.js +1 -1
  117. package/lib/layout/menu/userinfo-bar.js.map +1 -1
  118. package/lib/login/context-setter.d.ts +1 -0
  119. package/lib/login/context-setter.d.ts.map +1 -1
  120. package/lib/login/context-setter.js +2 -1
  121. package/lib/login/context-setter.js.map +1 -1
  122. package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
  123. package/lib/module/dtmpl-edit-card.js +9 -8
  124. package/lib/module/dtmpl-edit-card.js.map +1 -1
  125. package/lib/module/dtmpl-edit-drawer.js.map +1 -1
  126. package/lib/module/dtmpl-edit-page.js +11 -11
  127. package/lib/module/dtmpl-edit-page.js.map +1 -1
  128. package/lib/module/dtmpl-editor.js +7 -7
  129. package/lib/module/dtmpl-editor.js.map +1 -1
  130. package/lib/module/dtmpl-view-card.d.ts +1 -0
  131. package/lib/module/dtmpl-view-card.d.ts.map +1 -1
  132. package/lib/module/dtmpl-view-card.js +3 -3
  133. package/lib/module/dtmpl-view-card.js.map +1 -1
  134. package/lib/module/dtmpl-view-drawer.js +2 -2
  135. package/lib/module/dtmpl-view-drawer.js.map +1 -1
  136. package/lib/module/dtmpl-view-modal.js +2 -2
  137. package/lib/module/dtmpl-view-modal.js.map +1 -1
  138. package/lib/module/ltmpl-table.d.ts +1 -0
  139. package/lib/module/ltmpl-table.d.ts.map +1 -1
  140. package/lib/module/ltmpl-table.js +8 -8
  141. package/lib/module/ltmpl-table.js.map +1 -1
  142. package/lib/routable/dtmpl-route.js +4 -4
  143. package/lib/routable/dtmpl-route.js.map +1 -1
  144. package/lib/routable/import-route.d.ts +1 -0
  145. package/lib/routable/import-route.d.ts.map +1 -1
  146. package/lib/routable/import-route.js +2 -2
  147. package/lib/routable/import-route.js.map +1 -1
  148. package/lib/routable/ltmpl-route.js +2 -2
  149. package/lib/routable/ltmpl-route.js.map +1 -1
  150. package/lib/table/act-table.d.ts.map +1 -1
  151. package/lib/table/act-table.js +21 -21
  152. package/lib/table/act-table.js.map +1 -1
  153. package/lib/table/l2-act-table.js +4 -4
  154. package/lib/table/l2-act-table.js.map +1 -1
  155. package/lib/table/modal-select-table.d.ts +1 -0
  156. package/lib/table/modal-select-table.d.ts.map +1 -1
  157. package/lib/table/modal-select-table.js +8 -8
  158. package/lib/table/modal-select-table.js.map +1 -1
  159. package/lib/table/query-table.d.ts +1 -0
  160. package/lib/table/query-table.d.ts.map +1 -1
  161. package/lib/table/query-table.js +6 -5
  162. package/lib/table/query-table.js.map +1 -1
  163. package/lib/table/relation-table.d.ts +1 -0
  164. package/lib/table/relation-table.d.ts.map +1 -1
  165. package/lib/table/relation-table.js +17 -16
  166. package/lib/table/relation-table.js.map +1 -1
  167. package/lib/table/select-table.d.ts +1 -0
  168. package/lib/table/select-table.d.ts.map +1 -1
  169. package/lib/table/select-table.js +8 -9
  170. package/lib/table/select-table.js.map +1 -1
  171. package/lib/table/stat/restat.d.ts +1 -0
  172. package/lib/table/stat/restat.d.ts.map +1 -1
  173. package/lib/table/stat/restat.js +4 -4
  174. package/lib/table/stat/restat.js.map +1 -1
  175. package/lib/tmpl/hc-data-source.d.ts +9 -9
  176. package/lib/tmpl/hc-data-source.js +32 -32
  177. package/lib/tmpl/hc-data-source.js.map +1 -1
  178. package/lib/tmpl/hcservice-v3.d.ts +39 -49
  179. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  180. package/lib/tmpl/hcservice-v3.js +207 -174
  181. package/lib/tmpl/hcservice-v3.js.map +1 -1
  182. package/lib/tmpl/interface.d.ts +3 -0
  183. package/lib/tmpl/interface.d.ts.map +1 -1
  184. package/lib/tmpl/interface.js.map +1 -1
  185. package/lib/tmpl/superagent.d.ts +1 -2
  186. package/lib/tmpl/superagent.d.ts.map +1 -1
  187. package/lib/tmpl/superagent.js +33 -37
  188. package/lib/tmpl/superagent.js.map +1 -1
  189. package/lib/units/index.d.ts +4 -4
  190. package/lib/units/index.d.ts.map +1 -1
  191. package/lib/units/index.js +29 -10
  192. package/lib/units/index.js.map +1 -1
  193. package/lib/welcome/HCWelcome.js.map +1 -1
  194. package/lib/welcome/quick-entrance.js +2 -2
  195. package/lib/welcome/quick-entrance.js.map +1 -1
  196. package/lib/welcome/workbench.js +2 -2
  197. package/lib/welcome/workbench.js.map +1 -1
  198. package/package.json +1 -1
  199. package/src/aldehyde/controls/action/index.tsx +3 -2
  200. package/src/aldehyde/controls/cascader/index.tsx +3 -4
  201. package/src/aldehyde/controls/chemstruc/graph.tsx +2 -2
  202. package/src/aldehyde/controls/cquery/cquick-button.tsx +4 -3
  203. package/src/aldehyde/controls/entity-select/entity-select.tsx +10 -10
  204. package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +3 -3
  205. package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +2 -2
  206. package/src/aldehyde/controls/entry-control.tsx +1 -0
  207. package/src/aldehyde/controls/file-view/drawer-file-view.tsx +5 -4
  208. package/src/aldehyde/controls/file-view/index.tsx +13 -12
  209. package/src/aldehyde/controls/relation-existion/index.tsx +2 -2
  210. package/src/aldehyde/controls/rfield/index.tsx +2 -2
  211. package/src/aldehyde/controls/signature/index.tsx +2 -2
  212. package/src/aldehyde/controls/upload/index.tsx +3 -3
  213. package/src/aldehyde/controls/view-control.tsx +5 -4
  214. package/src/aldehyde/custom-page/dtmpl-custom-edit-modal-page.tsx +1 -0
  215. package/src/aldehyde/detail/button/cquery-button-bar.tsx +4 -3
  216. package/src/aldehyde/detail/button/submit-button-bar.tsx +4 -3
  217. package/src/aldehyde/detail/edit/dtmpl-edit.tsx +10 -10
  218. package/src/aldehyde/detail/edit/fields-edit-card.tsx +3 -2
  219. package/src/aldehyde/detail/edit/modal-row-edit.tsx +3 -2
  220. package/src/aldehyde/detail/edit/row-edit-card.tsx +3 -2
  221. package/src/aldehyde/detail/edit/row-editor.tsx +3 -2
  222. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +5 -5
  223. package/src/aldehyde/detail/view/dtmpl-view.tsx +8 -8
  224. package/src/aldehyde/detail/view/field-view-group.tsx +3 -2
  225. package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +2 -2
  226. package/src/aldehyde/detail/view/snapshot-timeline.tsx +5 -4
  227. package/src/aldehyde/exportor/export-frame.tsx +7 -3
  228. package/src/aldehyde/form/criteria-form.tsx +7 -5
  229. package/src/aldehyde/form/dtmpl-form.tsx +9 -9
  230. package/src/aldehyde/form/field-group-form.tsx +3 -2
  231. package/src/aldehyde/form/fields-form.tsx +3 -2
  232. package/src/aldehyde/form/form-Item-group.tsx +5 -4
  233. package/src/aldehyde/import/excel-import.tsx +7 -3
  234. package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +2 -2
  235. package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +1 -1
  236. package/src/aldehyde/layout/menu/userinfo-bar.tsx +1 -1
  237. package/src/aldehyde/login/context-setter.tsx +3 -1
  238. package/src/aldehyde/module/dtmpl-edit-card.tsx +10 -9
  239. package/src/aldehyde/module/dtmpl-edit-drawer.tsx +1 -1
  240. package/src/aldehyde/module/dtmpl-edit-page.tsx +11 -11
  241. package/src/aldehyde/module/dtmpl-editor.tsx +7 -7
  242. package/src/aldehyde/module/dtmpl-view-card.tsx +4 -3
  243. package/src/aldehyde/module/dtmpl-view-drawer.tsx +2 -2
  244. package/src/aldehyde/module/dtmpl-view-modal.tsx +2 -2
  245. package/src/aldehyde/module/ltmpl-table.tsx +9 -8
  246. package/src/aldehyde/routable/dtmpl-route.tsx +4 -4
  247. package/src/aldehyde/routable/import-route.tsx +3 -3
  248. package/src/aldehyde/routable/ltmpl-route.tsx +2 -2
  249. package/src/aldehyde/table/act-table.tsx +21 -20
  250. package/src/aldehyde/table/l2-act-table.tsx +4 -4
  251. package/src/aldehyde/table/modal-select-table.tsx +9 -9
  252. package/src/aldehyde/table/query-table.tsx +8 -5
  253. package/src/aldehyde/table/relation-table.tsx +18 -16
  254. package/src/aldehyde/table/select-table.tsx +9 -9
  255. package/src/aldehyde/table/stat/restat.tsx +5 -4
  256. package/src/aldehyde/tmpl/hc-data-source.tsx +32 -32
  257. package/src/aldehyde/tmpl/hcservice-v3.tsx +205 -162
  258. package/src/aldehyde/tmpl/interface.tsx +3 -0
  259. package/src/aldehyde/tmpl/superagent.js +37 -32
  260. package/src/aldehyde/units/index.tsx +27 -11
  261. package/src/aldehyde/welcome/HCWelcome.js +6 -0
  262. package/src/aldehyde/welcome/quick-entrance.tsx +2 -2
  263. package/src/aldehyde/welcome/workbench.tsx +2 -2
  264. package/lib/exportor/index.d.ts +0 -16
  265. package/lib/exportor/index.d.ts.map +0 -1
  266. package/lib/exportor/index.js +0 -44
  267. package/lib/exportor/index.js.map +0 -1
  268. package/lib/import/template-builder.d.ts +0 -29
  269. package/lib/import/template-builder.d.ts.map +0 -1
  270. package/lib/import/template-builder.js +0 -426
  271. package/lib/import/template-builder.js.map +0 -1
  272. package/src/aldehyde/exportor/index.tsx +0 -56
  273. package/src/aldehyde/import/template-builder.js +0 -474
@@ -15,21 +15,22 @@ import format from 'dayjs';
15
15
  import HCDataSource from "./hc-data-source";
16
16
  import { ProgramConfig } from "../index";
17
17
  export default class HcserviceV3 {
18
- static requestEnum(mstrucIds, path) {
18
+ static requestEnum(serverKey, mstrucIds, path) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
20
  if (!path) {
21
- return yield this.requestEnumWithPath(mstrucIds, "/enum");
21
+ return yield this.requestEnumWithPath(serverKey, mstrucIds, "/enum");
22
22
  }
23
23
  else {
24
- return yield this.requestEnumWithPath(mstrucIds, path);
24
+ return yield this.requestEnumWithPath(serverKey, mstrucIds, path);
25
25
  }
26
26
  });
27
27
  }
28
- static requestEnumWithPath(mstrucIds, path) {
28
+ static requestEnumWithPath(serverKey, mstrucIds, path) {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
30
  if (mstrucIds.length > 0) {
31
31
  let res = yield Super.super({
32
32
  url: Units.joinPath("/v3", path),
33
+ serverKey,
33
34
  query: {
34
35
  mstrucIds
35
36
  },
@@ -41,106 +42,113 @@ export default class HcserviceV3 {
41
42
  }
42
43
  });
43
44
  }
44
- static requestOptions(mstrucId) {
45
+ static requestOptions(serverKey, mstrucId) {
45
46
  return __awaiter(this, void 0, void 0, function* () {
46
- return yield this.requestEnum([mstrucId]);
47
+ return yield this.requestEnum(serverKey, [mstrucId], null);
47
48
  });
48
49
  }
49
- static requestDtmplConfig(sourceId) {
50
+ static requestDtmplConfig(serverKey, sourceId) {
50
51
  return __awaiter(this, void 0, void 0, function* () {
51
52
  let url = `/v3/dtmpl/config`;
52
53
  let res = yield Super.super({
53
54
  url,
55
+ serverKey,
54
56
  method: "GET",
55
57
  query: { sourceId }
56
58
  });
57
59
  return res.dtmplConfig;
58
60
  });
59
61
  }
60
- static requestViewDtmplConfig(sourceId) {
62
+ static requestViewDtmplConfig(serverKey, sourceId) {
61
63
  return __awaiter(this, void 0, void 0, function* () {
62
64
  let url = `/v3/view-dtmpl/config`;
63
65
  let res = yield Super.super({
64
66
  url,
67
+ serverKey,
65
68
  method: "GET",
66
69
  query: { sourceId }
67
70
  });
68
71
  return res.dtmplConfig;
69
72
  });
70
73
  }
71
- static requestAddDtmplConfig(sourceId) {
74
+ static requestAddDtmplConfig(serverKey, sourceId) {
72
75
  return __awaiter(this, void 0, void 0, function* () {
73
76
  let url = `/v3/add-dtmpl/config`;
74
77
  let res = yield Super.super({
75
78
  url,
79
+ serverKey,
76
80
  method: "GET",
77
81
  query: { sourceId }
78
82
  });
79
83
  return res.dtmplConfig;
80
84
  });
81
85
  }
82
- static requestSelectConfig(sourceId) {
86
+ static requestSelectConfig(serverKey, sourceId) {
83
87
  return __awaiter(this, void 0, void 0, function* () {
84
88
  let url = `/v3/select/config`;
85
89
  let res = yield Super.super({
86
90
  url,
91
+ serverKey,
87
92
  method: "GET",
88
93
  query: { sourceId }
89
94
  });
90
95
  return res.selectConfig;
91
96
  });
92
97
  }
93
- static requestLtmplConfig(sourceId) {
98
+ static requestLtmplConfig(serverKey, sourceId) {
94
99
  return __awaiter(this, void 0, void 0, function* () {
95
100
  let url = `/v3/ltmpl/config`;
96
101
  let res = yield Super.super({
97
102
  url,
103
+ serverKey,
98
104
  method: "GET",
99
105
  query: { sourceId }
100
106
  });
101
107
  return res;
102
108
  });
103
109
  }
104
- static requestL2LtmplConfig(sourceId) {
110
+ static requestL2LtmplConfig(serverKey, sourceId) {
105
111
  return __awaiter(this, void 0, void 0, function* () {
106
112
  let url = `/v3/l2/ltmpl/config`;
107
113
  let res = yield Super.super({
108
114
  url,
115
+ serverKey,
109
116
  method: "GET",
110
117
  query: { sourceId }
111
118
  });
112
119
  return res;
113
120
  });
114
121
  }
115
- static requestLtmplQueryKey(sourceId, condition) {
122
+ static requestLtmplQueryKey(serverKey, sourceId, condition) {
116
123
  return __awaiter(this, void 0, void 0, function* () {
117
124
  //console.log('condition:',condition);
118
125
  let url = `/v3/ltmpl/query/key`;
119
126
  let res = yield Super.super({
120
127
  url: url,
128
+ serverKey,
121
129
  method: 'GET',
122
130
  query: Object.assign(Object.assign({}, condition), { sourceId })
123
131
  });
124
132
  return res;
125
133
  });
126
134
  }
127
- static requestLtmplQueryTop(sourceId, condition) {
135
+ static requestLtmplQueryTop(serverKey, sourceId, condition) {
128
136
  return __awaiter(this, void 0, void 0, function* () {
129
137
  // console.log('condition:',condition);
130
138
  let url = `/v3/ltmpl/top-data`;
131
- return yield this.requestCommonLtmplQueryTop(sourceId, condition, url);
139
+ return yield this.requestCommonLtmplQueryTop(serverKey, sourceId, condition, url);
132
140
  });
133
141
  }
134
- static requestMstrucLtmplQueryTop(sourceId, condition) {
142
+ static requestMstrucLtmplQueryTop(serverKey, sourceId, condition) {
135
143
  return __awaiter(this, void 0, void 0, function* () {
136
144
  //console.log('condition:',condition);
137
145
  let url = `/v3/mstruc/ltmpl/top-data`;
138
- return yield this.requestCommonLtmplQueryTop(sourceId, condition, url);
146
+ return yield this.requestCommonLtmplQueryTop(serverKey, sourceId, condition, url);
139
147
  });
140
148
  }
141
- static queryTop1(sourceId) {
149
+ static queryTop1(serverKey, sourceId) {
142
150
  return __awaiter(this, void 0, void 0, function* () {
143
- let data = yield HcserviceV3.requestMstrucLtmplQueryTop(sourceId, { top: 1 });
151
+ let data = yield HcserviceV3.requestMstrucLtmplQueryTop(serverKey, sourceId, { top: 1 });
144
152
  let queriedCode = null;
145
153
  if (data && data.entities && data.entities[0]) {
146
154
  queriedCode = data.entities[0].code;
@@ -148,17 +156,18 @@ export default class HcserviceV3 {
148
156
  return queriedCode;
149
157
  });
150
158
  }
151
- static requestCommonLtmplQueryTop(sourceId, condition, url) {
159
+ static requestCommonLtmplQueryTop(serverKey, sourceId, condition, url) {
152
160
  return __awaiter(this, void 0, void 0, function* () {
153
161
  let res = yield Super.super({
154
162
  url: url,
163
+ serverKey,
155
164
  method: 'GET',
156
165
  query: Object.assign(Object.assign({}, condition), { sourceId })
157
166
  });
158
167
  return res;
159
168
  });
160
169
  }
161
- static requestSelectedData(sourceId, codes) {
170
+ static requestSelectedData(serverKey, sourceId, codes) {
162
171
  return __awaiter(this, void 0, void 0, function* () {
163
172
  if (!codes) {
164
173
  message.warning("没有选择实体");
@@ -167,6 +176,7 @@ export default class HcserviceV3 {
167
176
  let url = `/v3/field-group/data/selected`;
168
177
  let res = yield Super.super({
169
178
  url: url,
179
+ serverKey,
170
180
  query: { codes, sourceId },
171
181
  method: 'GET'
172
182
  });
@@ -179,10 +189,11 @@ export default class HcserviceV3 {
179
189
  }
180
190
  });
181
191
  }
182
- static requestVersionList(sourceId, code) {
192
+ static requestVersionList(serverKey, sourceId, code) {
183
193
  return __awaiter(this, void 0, void 0, function* () {
184
194
  let res = yield Super.super({
185
195
  url: `/v3/dtmpl/data/versions`,
196
+ serverKey,
186
197
  query: {
187
198
  pageNo: 1,
188
199
  sourceId,
@@ -193,13 +204,14 @@ export default class HcserviceV3 {
193
204
  return res.versions;
194
205
  });
195
206
  }
196
- static requestCommonDtmplData(sourceId, code, versionId, url) {
207
+ static requestCommonDtmplData(serverKey, sourceId, code, versionId, url) {
197
208
  return __awaiter(this, void 0, void 0, function* () {
198
209
  // if(sourceId=="user"){
199
210
  // return this.requestUserDtmplData();
200
211
  // }
201
212
  let res = yield Super.super({
202
- url: url,
213
+ url,
214
+ serverKey,
203
215
  query: {
204
216
  code, versionId, sourceId
205
217
  },
@@ -214,31 +226,31 @@ export default class HcserviceV3 {
214
226
  }
215
227
  });
216
228
  }
217
- static requestDtmplData(sourceId, code, versionId) {
229
+ static requestDtmplData(serverKey, sourceId, code, versionId) {
218
230
  return __awaiter(this, void 0, void 0, function* () {
219
231
  let url = `/v3/dtmpl/data`;
220
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
232
+ return yield this.requestCommonDtmplData(serverKey, sourceId, code, versionId, url);
221
233
  });
222
234
  }
223
- static requestMstrucDtmplData(sourceId, code, versionId) {
235
+ static requestMstrucDtmplData(serverKey, sourceId, code, versionId) {
224
236
  return __awaiter(this, void 0, void 0, function* () {
225
237
  let url = `/v3/mstruc/dtmpl/data`;
226
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
238
+ return yield this.requestCommonDtmplData(serverKey, sourceId, code, versionId, url);
227
239
  });
228
240
  }
229
- static requestViewDtmplData(sourceId, code, versionId) {
241
+ static requestViewDtmplData(serverKey, sourceId, code, versionId) {
230
242
  return __awaiter(this, void 0, void 0, function* () {
231
243
  let url = `/v3/view-dtmpl/data`;
232
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
244
+ return yield this.requestCommonDtmplData(serverKey, sourceId, code, versionId, url);
233
245
  });
234
246
  }
235
- static requestMstrucViewDtmplData(sourceId, code, versionId) {
247
+ static requestMstrucViewDtmplData(serverKey, sourceId, code, versionId) {
236
248
  return __awaiter(this, void 0, void 0, function* () {
237
249
  let url = `/v3/mstruc/view-dtmpl/data`;
238
- return yield this.requestCommonDtmplData(sourceId, code, versionId, url);
250
+ return yield this.requestCommonDtmplData(serverKey, sourceId, code, versionId, url);
239
251
  });
240
252
  }
241
- static postCommonDtmplData(sourceId, formDataObj, message, url) {
253
+ static postCommonDtmplData(serverKey, sourceId, formDataObj, message, url) {
242
254
  return __awaiter(this, void 0, void 0, function* () {
243
255
  const formData = new FormData();
244
256
  for (let k in formDataObj) {
@@ -248,7 +260,8 @@ export default class HcserviceV3 {
248
260
  }
249
261
  formData.append('sourceId', sourceId.toString());
250
262
  let res = yield Super.super({
251
- url: url,
263
+ url,
264
+ serverKey,
252
265
  data: formData,
253
266
  method: 'POST'
254
267
  }, 'formdata');
@@ -278,61 +291,60 @@ export default class HcserviceV3 {
278
291
  return { code, status: res.status };
279
292
  });
280
293
  }
281
- static postDtmplData(sourceId, formDataObj, message) {
294
+ static postDtmplData(serverKey, sourceId, formDataObj, message) {
282
295
  return __awaiter(this, void 0, void 0, function* () {
283
296
  let url = `/v3/dtmpl/data`;
284
- return yield this.postCommonDtmplData(sourceId, formDataObj, message, url);
297
+ return yield this.postCommonDtmplData(serverKey, sourceId, formDataObj, message, url);
285
298
  });
286
299
  }
287
- static postMstrucDtmplData(sourceId, formDataObj, message) {
300
+ static postMstrucDtmplData(serverKey, sourceId, formDataObj, message) {
288
301
  return __awaiter(this, void 0, void 0, function* () {
289
302
  let url = `/v3/mstruc/dtmpl/data`;
290
- return yield this.postCommonDtmplData(sourceId, formDataObj, message, url);
291
- });
292
- }
293
- static postFileAction(file) {
294
- return Units.joinPath(Units.api(), '/v3/upload');
295
- }
296
- static postFile(formData, message) {
297
- return __awaiter(this, void 0, void 0, function* () {
298
- let res = yield Super.super({
299
- url: `/v3/upload`,
300
- data: formData,
301
- method: 'POST'
302
- }, 'formdata');
303
- let fileKey = null;
304
- if (res) {
305
- if (res.status === "success") {
306
- if (message) {
307
- message.success("上传成功! ");
308
- }
309
- fileKey = res.fileKey;
310
- }
311
- }
312
- else {
313
- if (message) {
314
- message.error("上传失败!");
315
- }
316
- }
317
- return fileKey;
318
- });
319
- }
320
- static requestL2LtmplQueryKey(sourceId, condition) {
303
+ return yield this.postCommonDtmplData(serverKey, sourceId, formDataObj, message, url);
304
+ });
305
+ }
306
+ static postFileAction(serverKey, file) {
307
+ return Units.joinPath(Units.api(serverKey), '/v3/upload');
308
+ }
309
+ // static async postFile(formData, message) {
310
+ // let res = await Super.super({
311
+ // url: `/v3/upload`,
312
+ // data: formData,
313
+ // method: 'POST'
314
+ // }, 'formdata')
315
+ // let fileKey = null;
316
+ // if (res) {
317
+ // if (res.status === "success") {
318
+ // if (message) {
319
+ // message.success("上传成功! ")
320
+ // }
321
+ // fileKey = res.fileKey;
322
+ // }
323
+ // } else {
324
+ // if (message) {
325
+ // message.error("上传失败!");
326
+ // }
327
+ // }
328
+ // return fileKey;
329
+ // }
330
+ static requestL2LtmplQueryKey(serverKey, sourceId, condition) {
321
331
  return __awaiter(this, void 0, void 0, function* () {
322
332
  let url = `v3/l2/ltmpl/query/key`;
323
333
  let res = yield Super.super({
324
- url: url,
334
+ url,
335
+ serverKey,
325
336
  method: 'GET',
326
337
  query: Object.assign(Object.assign({}, condition), { sourceId })
327
338
  });
328
339
  return res;
329
340
  });
330
341
  }
331
- static requestLtmplCount(sourceId) {
342
+ static requestLtmplCount(serverKey, sourceId) {
332
343
  return __awaiter(this, void 0, void 0, function* () {
333
344
  let url = `/v3/ltmpl/data/count`;
334
345
  let res = yield Super.super({
335
- url: url,
346
+ url,
347
+ serverKey,
336
348
  query: { sourceId },
337
349
  method: 'GET',
338
350
  });
@@ -360,10 +372,11 @@ export default class HcserviceV3 {
360
372
  // });
361
373
  // return criterias;
362
374
  // }
363
- static requestQueryData(queryKey, pageInfo) {
375
+ static requestQueryData(serverKey, queryKey, pageInfo) {
364
376
  return __awaiter(this, void 0, void 0, function* () {
365
377
  let res = yield Super.super({
366
378
  url: `/v3/ltmpl/query/data`,
379
+ serverKey,
367
380
  method: 'GET',
368
381
  query: Object.assign({ queryKey }, pageInfo)
369
382
  });
@@ -388,16 +401,17 @@ export default class HcserviceV3 {
388
401
  }
389
402
  return codes;
390
403
  }
391
- static deleteData(sourceId, selectedRows) {
404
+ static deleteData(serverKey, sourceId, selectedRows) {
392
405
  return __awaiter(this, void 0, void 0, function* () {
393
406
  const codes = this.getCodesOfSelectedRows(selectedRows);
394
- return yield this.deleteByCode(sourceId, codes);
407
+ return yield this.deleteByCode(serverKey, sourceId, codes);
395
408
  });
396
409
  }
397
- static deleteByCode(sourceId, codes) {
410
+ static deleteByCode(serverKey, sourceId, codes) {
398
411
  return __awaiter(this, void 0, void 0, function* () {
399
412
  let res = yield Super.super({
400
413
  url: `/v3/ltmpl/data`,
414
+ serverKey,
401
415
  data: {
402
416
  codes, sourceId
403
417
  },
@@ -414,26 +428,25 @@ export default class HcserviceV3 {
414
428
  }
415
429
  });
416
430
  }
417
- static requestQueryCount(queryKey) {
431
+ static requestQueryCount(serverKey, queryKey) {
418
432
  return __awaiter(this, void 0, void 0, function* () {
419
433
  let res = yield Super.super({
420
434
  url: `/v3/ltmpl/query/count`,
435
+ serverKey,
421
436
  method: "GET",
422
437
  query: { queryKey }
423
438
  });
424
439
  return res.count;
425
440
  });
426
441
  }
427
- static requestFile(path) {
428
- return __awaiter(this, void 0, void 0, function* () {
429
- let res = yield Super.super({
430
- url: Units.joinPath("/v3/files/", path),
431
- method: "GET"
432
- });
433
- return res;
434
- });
435
- }
436
- static postActions(actionId, selectedRows, actionDataObj) {
442
+ // static async requestFile(path) {
443
+ // let res = await Super.super({
444
+ // url: Units.joinPath("/v3/files/", path),
445
+ // method: "GET"
446
+ // });
447
+ // return res;
448
+ // }
449
+ static postActions(serverKey, actionId, selectedRows, actionDataObj) {
437
450
  return __awaiter(this, void 0, void 0, function* () {
438
451
  const codes = this.getCodesOfSelectedRows(selectedRows);
439
452
  const formData = new FormData();
@@ -444,29 +457,29 @@ export default class HcserviceV3 {
444
457
  formData.append('codes', codes.join(","));
445
458
  let res = yield Super.super({
446
459
  url: `/v3/action`,
460
+ serverKey,
447
461
  data: formData,
448
462
  method: 'POST'
449
- }, 'formdata');
463
+ }, 'formdata', null);
450
464
  return res;
451
465
  });
452
466
  }
453
- static postJumps(jumpId, code) {
454
- return __awaiter(this, void 0, void 0, function* () {
455
- let res = yield Super.super({
456
- url: `/v3/jump`,
457
- query: {
458
- code,
459
- sourceId: jumpId,
460
- },
461
- method: "GET",
462
- });
463
- return res;
464
- });
465
- }
466
- static increCalc(sourceId, params = {}) {
467
+ // static async postJumps(jumpId, code: string,sourceId:string) {
468
+ // let res = await Super.super({
469
+ // url: `/v3/jump`,
470
+ // query: {
471
+ // code,
472
+ // sourceId: jumpId,
473
+ // },
474
+ // method: "GET",
475
+ // },null,null,sourceId);
476
+ // return res;
477
+ // }
478
+ static increCalc(serverKey, sourceId, params = {}) {
467
479
  return __awaiter(this, void 0, void 0, function* () {
468
480
  let res = yield Super.super({
469
481
  url: `/v3/stat/increcalc`,
482
+ serverKey,
470
483
  method: "POST",
471
484
  data: Object.assign(Object.assign({}, params), { sourceId })
472
485
  });
@@ -479,35 +492,53 @@ export default class HcserviceV3 {
479
492
  return res;
480
493
  });
481
494
  }
482
- static downloadDetailExcel(sourceId, entityCode) {
483
- const hydrocarbonToken = Units.hydrocarbonToken();
484
- let url = Units.joinPath(Units.api(), `/v3/dtmpl/excel`) + `?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
485
- Units.downloadFile(url, "详情");
495
+ static doCopy(serverKey, sourceId, code, copyRelation, copyOpp2One) {
496
+ return __awaiter(this, void 0, void 0, function* () {
497
+ let res = yield Super.super({
498
+ url: `/v3/mstruc/copy-data`,
499
+ serverKey,
500
+ method: "POST",
501
+ query: {
502
+ sourceId,
503
+ code, copyRelation, copyOpp2One
504
+ }
505
+ }, null, null);
506
+ if (res.status != 'success') {
507
+ message.error("错误消息:" + res.message, 4);
508
+ }
509
+ return res;
510
+ });
486
511
  }
487
- static download(path) {
512
+ // static downloadDetailExcel(sourceId, entityCode) {
513
+ // const hydrocarbonToken = Units.hydrocarbonToken();
514
+ // let url = Units.joinPath(Units.api(), `/v3/dtmpl/excel`)+`?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
515
+ // Units.downloadFile(url, "详情");
516
+ // }
517
+ static download(serverKey, path) {
488
518
  let vars = path.split("/");
489
519
  let fileName = vars[vars.length - 1];
490
- Units.downloadFile(this.getFileUrl(path) + `&disposition=attachment`, fileName);
520
+ Units.downloadFile(this.getFileUrl(serverKey, path) + `&disposition=attachment`, fileName);
491
521
  }
492
- static openfile(path, toolbar) {
522
+ static openfile(serverKey, path, toolbar) {
493
523
  let vars = path.split("/");
494
524
  let fileName = vars[vars.length - 1];
495
- Units.openFile(this.getFileUrl(path), fileName, toolbar);
525
+ Units.openFile(this.getFileUrl(serverKey, path), fileName, toolbar);
496
526
  }
497
- static getFileUrl(path) {
527
+ static getFileUrl(serverKey, path) {
498
528
  const hydrocarbonToken = Units.hydrocarbonToken();
499
- let url = Units.joinPath(Units.api(), Units.joinPath("/v3/files", path)) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
529
+ let url = Units.joinPath(Units.api(serverKey), Units.joinPath("/v3/files", path)) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
500
530
  return url;
501
531
  }
502
- static getFileTxtUrl(path) {
532
+ static getFileTxtUrl(serverKey, path) {
503
533
  const hydrocarbonToken = Units.hydrocarbonToken();
504
- let url = Units.joinPath(Units.api(), Units.joinPath("/v3/files/text", path)) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
534
+ let url = Units.joinPath(Units.api(serverKey), Units.joinPath("/v3/files/text", path)) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
505
535
  return url;
506
536
  }
507
- static loadFileTxt(path) {
537
+ static loadFileTxt(serverKey, path) {
508
538
  return __awaiter(this, void 0, void 0, function* () {
509
539
  let res = yield Super.super({
510
540
  url: Units.joinPath("/v3/files/text", path),
541
+ serverKey,
511
542
  method: "GET",
512
543
  });
513
544
  return res.text;
@@ -684,50 +715,49 @@ export default class HcserviceV3 {
684
715
  return res.l2Menus;
685
716
  });
686
717
  }
687
- static requestKsList(path, params, depth = 1, pageinfo = { pageNo: 1, pageSize: 100 }) {
688
- return __awaiter(this, void 0, void 0, function* () {
689
- let url = Units.joinPath("/v3/ks/list", path);
690
- let res = yield Super.super({
691
- url: url,
692
- method: "GET",
693
- query: Object.assign(Object.assign({ depth }, params), { pageNo: pageinfo.pageNo, pageSize: pageinfo.pageSize })
694
- });
695
- //console.log("ks list:", res);
696
- if (res.status == 'error') {
697
- return null;
698
- }
699
- else {
700
- return res.result;
701
- }
702
- });
703
- }
704
- static requestKsListTopPage(queryKey, pageNo, pageSize) {
705
- return __awaiter(this, void 0, void 0, function* () {
706
- let url = `/v3/ks/query/data`;
707
- let res = yield Super.super({
708
- url: url,
709
- method: "GET",
710
- query: {
711
- pageNo,
712
- pageSize, queryKey
713
- }
714
- });
715
- //console.log("requestKsListToPage:", res);
716
- return res.result;
717
- });
718
- }
719
- static requestKsUnique(path, depth = 1) {
720
- return __awaiter(this, void 0, void 0, function* () {
721
- let url = Units.joinPath("/v3/ks/unique", path);
722
- let res = yield Super.super({
723
- url: url,
724
- depth,
725
- method: "GET",
726
- });
727
- //console.log("ks unique:", res);
728
- return res.result;
729
- });
730
- }
718
+ // static async requestKsList(path, params, depth = 1, pageinfo = {pageNo: 1, pageSize: 100}) {
719
+ // let url = Units.joinPath("/v3/ks/list", path)
720
+ // let res = await Super.super({
721
+ // url: url,
722
+ // method: "GET",
723
+ // query: {
724
+ // depth,
725
+ // ...params,
726
+ // pageNo: pageinfo.pageNo,
727
+ // pageSize: pageinfo.pageSize
728
+ // }
729
+ // });
730
+ // //console.log("ks list:", res);
731
+ // if (res.status == 'error') {
732
+ // return null;
733
+ // } else {
734
+ // return res.result;
735
+ // }
736
+ //
737
+ // }
738
+ // static async requestKsListTopPage(queryKey, pageNo, pageSize) {
739
+ // let url = `/v3/ks/query/data`
740
+ // let res = await Super.super({
741
+ // url: url,
742
+ // method: "GET",
743
+ // query: {
744
+ // pageNo,
745
+ // pageSize, queryKey
746
+ // }
747
+ // });
748
+ // //console.log("requestKsListToPage:", res);
749
+ // return res.result;
750
+ // }
751
+ // static async requestKsUnique(path: string, depth = 1) {
752
+ // let url = Units.joinPath("/v3/ks/unique", path)
753
+ // let res = await Super.super({
754
+ // url: url,
755
+ // depth,
756
+ // method: "GET",
757
+ // });
758
+ // //console.log("ks unique:", res);
759
+ // return res.result;
760
+ // }
731
761
  static reload() {
732
762
  return __awaiter(this, void 0, void 0, function* () {
733
763
  let url = `/v3/tmpl/reload`;
@@ -738,22 +768,6 @@ export default class HcserviceV3 {
738
768
  return res;
739
769
  });
740
770
  }
741
- static doCopy(sourceId, code, copyRelation, copyOpp2One) {
742
- return __awaiter(this, void 0, void 0, function* () {
743
- let res = yield Super.super({
744
- url: `/v3/mstruc/copy-data`,
745
- method: "POST",
746
- query: {
747
- sourceId,
748
- code, copyRelation, copyOpp2One
749
- }
750
- }, null, null);
751
- if (res.status != 'success') {
752
- message.error("错误消息:" + res.message, 4);
753
- }
754
- return res;
755
- });
756
- }
757
771
  static initProgramConfig(ProgramConfigJson) {
758
772
  return __awaiter(this, void 0, void 0, function* () {
759
773
  //设置项目配置信息
@@ -763,6 +777,25 @@ export default class HcserviceV3 {
763
777
  if (ProgramConfigJson['hydrocarbonServer']) {
764
778
  ProgramConfig.setHydrocarbonServer(ProgramConfigJson['hydrocarbonServer']);
765
779
  }
780
+ //注册扩展服务器
781
+ if (ProgramConfigJson['extendServer']) {
782
+ let extend = ProgramConfigJson['extendServer'];
783
+ if (typeof extend == "object") {
784
+ let extendServers = [];
785
+ if (Array.isArray(extend)) {
786
+ extendServers = extend;
787
+ }
788
+ else {
789
+ extendServers.push(extend);
790
+ }
791
+ for (let es of extendServers) {
792
+ if (es.key && es['hydrocarbonServer']) {
793
+ ProgramConfig.setProgramCode(es['programCode'], es.key);
794
+ ProgramConfig.setHydrocarbonServer(es['hydrocarbonServer'], es['programCode']);
795
+ }
796
+ }
797
+ }
798
+ }
766
799
  ProgramConfig.setProgramName(ProgramConfigJson['programName']);
767
800
  ProgramConfig.setProgramName_sub(ProgramConfigJson['programName_sub']);
768
801
  ProgramConfig.setProgramName_NavLeft(ProgramConfigJson['programName_NavLeft']);