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.
Files changed (201) hide show
  1. package/lib/controls/action/index.js +1 -1
  2. package/lib/controls/action/index.js.map +1 -1
  3. package/lib/controls/action/utils.d.ts +2 -2
  4. package/lib/controls/action/utils.d.ts.map +1 -1
  5. package/lib/controls/action/utils.js +5 -5
  6. package/lib/controls/action/utils.js.map +1 -1
  7. package/lib/controls/file-export/select-code-export.d.ts +13 -0
  8. package/lib/controls/file-export/select-code-export.d.ts.map +1 -0
  9. package/lib/controls/file-export/select-code-export.js +14 -0
  10. package/lib/controls/file-export/select-code-export.js.map +1 -0
  11. package/lib/controls/steps/index.d.ts.map +1 -1
  12. package/lib/controls/steps/index.js +4 -1
  13. package/lib/controls/steps/index.js.map +1 -1
  14. package/lib/detail/button/edit-button.d.ts +11 -0
  15. package/lib/detail/button/edit-button.d.ts.map +1 -0
  16. package/lib/detail/button/edit-button.js +29 -0
  17. package/lib/detail/button/edit-button.js.map +1 -0
  18. package/lib/detail/button/view-button.d.ts +11 -0
  19. package/lib/detail/button/view-button.d.ts.map +1 -0
  20. package/lib/detail/button/view-button.js +28 -0
  21. package/lib/detail/button/view-button.js.map +1 -0
  22. package/lib/detail/view/act-dtmpl-view.d.ts +3 -1
  23. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  24. package/lib/detail/view/act-dtmpl-view.js +9 -3
  25. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  26. package/lib/{exportor → export}/export-frame.d.ts +4 -0
  27. package/lib/export/export-frame.d.ts.map +1 -0
  28. package/lib/{exportor → export}/export-frame.js +6 -4
  29. package/lib/export/export-frame.js.map +1 -0
  30. package/lib/export/select-code-export-frame.d.ts +49 -0
  31. package/lib/export/select-code-export-frame.d.ts.map +1 -0
  32. package/lib/export/select-code-export-frame.js +145 -0
  33. package/lib/export/select-code-export-frame.js.map +1 -0
  34. package/lib/form/criteria-form.d.ts.map +1 -1
  35. package/lib/form/criteria-form.js +26 -2
  36. package/lib/form/criteria-form.js.map +1 -1
  37. package/lib/hooks/useVarCssColor.d.ts +2 -0
  38. package/lib/hooks/useVarCssColor.d.ts.map +1 -0
  39. package/lib/hooks/useVarCssColor.js +7 -0
  40. package/lib/hooks/useVarCssColor.js.map +1 -0
  41. package/lib/index.d.ts +1 -1
  42. package/lib/index.d.ts.map +1 -1
  43. package/lib/index.js +1 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/layout/MainPage.d.ts.map +1 -1
  46. package/lib/layout/MainPage.js.map +1 -1
  47. package/lib/layout/menu/block.css +1 -1
  48. package/lib/layout/menu/block.d.ts.map +1 -1
  49. package/lib/layout/menu/block.js +1 -1
  50. package/lib/layout/menu/block.js.map +1 -1
  51. package/lib/layout2/components/userButton.d.ts +5 -0
  52. package/lib/layout2/components/userButton.d.ts.map +1 -0
  53. package/lib/layout2/components/userButton.js +133 -0
  54. package/lib/layout2/components/userButton.js.map +1 -0
  55. package/lib/layout2/css/header.css +38 -0
  56. package/lib/layout2/header.d.ts +12 -0
  57. package/lib/layout2/header.d.ts.map +1 -0
  58. package/lib/layout2/header.js +225 -0
  59. package/lib/layout2/header.js.map +1 -0
  60. package/lib/layout2/imgs/home.png +0 -0
  61. package/lib/layout2/main.d.ts +9 -0
  62. package/lib/layout2/main.d.ts.map +1 -0
  63. package/lib/layout2/main.js +14 -0
  64. package/lib/layout2/main.js.map +1 -0
  65. package/lib/layout2/page.d.ts +7 -0
  66. package/lib/layout2/page.d.ts.map +1 -0
  67. package/lib/layout2/page.js +120 -0
  68. package/lib/layout2/page.js.map +1 -0
  69. package/lib/layout2/sider.d.ts +10 -0
  70. package/lib/layout2/sider.d.ts.map +1 -0
  71. package/lib/layout2/sider.js +259 -0
  72. package/lib/layout2/sider.js.map +1 -0
  73. package/lib/layout2/type/layout.type.d.ts +10 -0
  74. package/lib/layout2/type/layout.type.d.ts.map +1 -0
  75. package/lib/layout2/type/layout.type.js +2 -0
  76. package/lib/layout2/type/layout.type.js.map +1 -0
  77. package/lib/layout2/util/menu.util.d.ts +28 -0
  78. package/lib/layout2/util/menu.util.d.ts.map +1 -0
  79. package/lib/layout2/util/menu.util.js +76 -0
  80. package/lib/layout2/util/menu.util.js.map +1 -0
  81. package/lib/login/login.d.ts.map +1 -1
  82. package/lib/login/login.js +3 -0
  83. package/lib/login/login.js.map +1 -1
  84. package/lib/login2/Login.d.ts +10 -0
  85. package/lib/login2/Login.d.ts.map +1 -0
  86. package/lib/login2/Login.js +71 -0
  87. package/lib/login2/Login.js.map +1 -0
  88. package/lib/login2/LoginPage.d.ts +4 -0
  89. package/lib/login2/LoginPage.d.ts.map +1 -0
  90. package/lib/login2/LoginPage.js +43 -0
  91. package/lib/login2/LoginPage.js.map +1 -0
  92. package/lib/login2/img/login-bg.png +0 -0
  93. package/lib/login2/index.d.ts +4 -0
  94. package/lib/login2/index.d.ts.map +1 -0
  95. package/lib/login2/index.js +4 -0
  96. package/lib/login2/index.js.map +1 -0
  97. package/lib/module/ltmpl-table.d.ts +6 -4
  98. package/lib/module/ltmpl-table.d.ts.map +1 -1
  99. package/lib/module/ltmpl-table.js +15 -11
  100. package/lib/module/ltmpl-table.js.map +1 -1
  101. package/lib/routable/dtmpl-route.d.ts +3 -2
  102. package/lib/routable/dtmpl-route.d.ts.map +1 -1
  103. package/lib/routable/dtmpl-route.js +20 -16
  104. package/lib/routable/dtmpl-route.js.map +1 -1
  105. package/lib/routable/import-route.d.ts +3 -2
  106. package/lib/routable/import-route.d.ts.map +1 -1
  107. package/lib/routable/import-route.js +10 -6
  108. package/lib/routable/import-route.js.map +1 -1
  109. package/lib/routable/ltmpl-route.d.ts +1 -0
  110. package/lib/routable/ltmpl-route.d.ts.map +1 -1
  111. package/lib/routable/ltmpl-route.js +24 -17
  112. package/lib/routable/ltmpl-route.js.map +1 -1
  113. package/lib/routable/ttmpl-route.d.ts +3 -2
  114. package/lib/routable/ttmpl-route.d.ts.map +1 -1
  115. package/lib/routable/ttmpl-route.js +13 -9
  116. package/lib/routable/ttmpl-route.js.map +1 -1
  117. package/lib/routable/withroute.d.ts +1 -1
  118. package/lib/routable/withroute.d.ts.map +1 -1
  119. package/lib/routable/withroute.js +3 -3
  120. package/lib/routable/withroute.js.map +1 -1
  121. package/lib/table/act-table.d.ts +7 -4
  122. package/lib/table/act-table.d.ts.map +1 -1
  123. package/lib/table/act-table.js +112 -88
  124. package/lib/table/act-table.js.map +1 -1
  125. package/lib/table/index.css +4 -4
  126. package/lib/table/query-table.d.ts.map +1 -1
  127. package/lib/table/query-table.js.map +1 -1
  128. package/lib/table/relation-table.d.ts +2 -2
  129. package/lib/table/relation-table.d.ts.map +1 -1
  130. package/lib/table/relation-table.js +5 -5
  131. package/lib/table/relation-table.js.map +1 -1
  132. package/lib/table/select-table.js +2 -2
  133. package/lib/table/select-table.js.map +1 -1
  134. package/lib/tmpl/hc-data-source.d.ts.map +1 -1
  135. package/lib/tmpl/hc-data-source.js +2 -3
  136. package/lib/tmpl/hc-data-source.js.map +1 -1
  137. package/lib/tmpl/hcservice-v3.d.ts +3 -2
  138. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  139. package/lib/tmpl/hcservice-v3.js +11 -2
  140. package/lib/tmpl/hcservice-v3.js.map +1 -1
  141. package/lib/tmpl/interface.d.ts +46 -6
  142. package/lib/tmpl/interface.d.ts.map +1 -1
  143. package/lib/tree/tmpl-tree.d.ts.map +1 -1
  144. package/lib/tree/tmpl-tree.js +2 -1
  145. package/lib/tree/tmpl-tree.js.map +1 -1
  146. package/lib/welcome/HCWelcome.d.ts +1 -1
  147. package/lib/welcome/HCWelcome.d.ts.map +1 -1
  148. package/lib/welcome/HCWelcome.js +279 -175
  149. package/lib/welcome/HCWelcome.js.map +1 -1
  150. package/lib/welcome/img/welcome.png +0 -0
  151. package/package.json +1 -1
  152. package/src/aldehyde/controls/action/index.tsx +1 -1
  153. package/src/aldehyde/controls/action/utils.tsx +4 -5
  154. package/src/aldehyde/controls/file-export/select-code-export.tsx +40 -0
  155. package/src/aldehyde/controls/steps/index.tsx +6 -1
  156. package/src/aldehyde/detail/button/edit-button.tsx +62 -0
  157. package/src/aldehyde/detail/button/view-button.tsx +61 -0
  158. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +14 -2
  159. package/src/aldehyde/{exportor → export}/export-frame.tsx +10 -6
  160. package/src/aldehyde/export/select-code-export-frame.tsx +218 -0
  161. package/src/aldehyde/form/criteria-form.tsx +35 -0
  162. package/src/aldehyde/hooks/useVarCssColor.ts +6 -0
  163. package/src/aldehyde/index.tsx +2 -2
  164. package/src/aldehyde/layout/MainPage.tsx +8 -6
  165. package/src/aldehyde/layout/menu/block.css +1 -1
  166. package/src/aldehyde/layout/menu/block.tsx +1 -0
  167. package/src/aldehyde/layout2/components/userButton.tsx +171 -0
  168. package/src/aldehyde/layout2/css/header.css +38 -0
  169. package/src/aldehyde/layout2/header.tsx +348 -0
  170. package/src/aldehyde/layout2/imgs/home.png +0 -0
  171. package/src/aldehyde/layout2/main.tsx +27 -0
  172. package/src/aldehyde/layout2/page.tsx +169 -0
  173. package/src/aldehyde/layout2/sider.tsx +357 -0
  174. package/src/aldehyde/layout2/type/layout.type.ts +10 -0
  175. package/src/aldehyde/layout2/util/menu.util.tsx +112 -0
  176. package/src/aldehyde/login/login.tsx +2 -0
  177. package/src/aldehyde/login2/Login.tsx +122 -0
  178. package/src/aldehyde/login2/LoginPage.tsx +59 -0
  179. package/src/aldehyde/login2/img/login-bg.png +0 -0
  180. package/src/aldehyde/login2/index.tsx +4 -0
  181. package/src/aldehyde/module/ltmpl-table.tsx +18 -13
  182. package/src/aldehyde/routable/dtmpl-route.tsx +141 -121
  183. package/src/aldehyde/routable/import-route.tsx +28 -23
  184. package/src/aldehyde/routable/ltmpl-route.tsx +86 -59
  185. package/src/aldehyde/routable/ttmpl-route.tsx +73 -55
  186. package/src/aldehyde/routable/withroute.tsx +21 -18
  187. package/src/aldehyde/table/act-table.tsx +93 -77
  188. package/src/aldehyde/table/index.css +4 -4
  189. package/src/aldehyde/table/query-table.tsx +1 -4
  190. package/src/aldehyde/table/relation-table.tsx +7 -7
  191. package/src/aldehyde/table/select-table.tsx +2 -2
  192. package/src/aldehyde/tmpl/hc-data-source.tsx +373 -352
  193. package/src/aldehyde/tmpl/hcservice-v3.tsx +33 -17
  194. package/src/aldehyde/tmpl/interface.tsx +53 -6
  195. package/src/aldehyde/tree/tmpl-tree.tsx +2 -1
  196. package/src/aldehyde/welcome/HCWelcome.js +294 -241
  197. package/src/aldehyde/welcome/img/welcome.png +0 -0
  198. package/lib/exportor/export-frame.d.ts.map +0 -1
  199. package/lib/exportor/export-frame.js.map +0 -1
  200. /package/lib/{exportor → export}/export-frame.css +0 -0
  201. /package/src/aldehyde/{exportor → export}/export-frame.css +0 -0
@@ -1,27 +1,30 @@
1
- import React, { ReactNode } from "react";
1
+ import React, { ReactNode } from "react";
2
2
  import {
3
3
  AddOrUpdate,
4
+ DoEditParam,
4
5
  LtmplConfigRes,
5
- RouterCompProps,
6
+ RouterCompProps, ShowViewParam,
6
7
  } from "../tmpl/interface";
7
8
  import Units from "../units";
8
9
  import ActTable from "../table/act-table";
9
10
  // import StatActTable from '../table/stat-act-table'
10
11
  import HCDataSource from "../tmpl/hc-data-source";
11
12
  import withRouter from "../routable/withroute";
12
- import {Button, Drawer, Space} from "antd";
13
+ import { Button, Drawer, Space } from "antd";
13
14
  import { LocaleContext } from "../locale/LocaleProvider";
14
- import LtmplTable from "../module/ltmpl-table"
15
+ import LtmplTable from "../module/ltmpl-table";
15
16
 
16
- export interface LtmplRouteProps extends RouterCompProps {}
17
+ export interface LtmplRouteProps extends RouterCompProps {
18
+ layoutRootPath?: string;
19
+ }
17
20
 
18
21
  export interface LtmplRouteState {
19
22
  ltmplConfigRes?: LtmplConfigRes;
20
23
  pageNo?: number;
21
24
  pageSize?: number;
22
- selectedCode?:string;
23
- showDraw?:boolean;
24
- ractionId?:string;
25
+ selectedCode?: string;
26
+ showDraw?: boolean;
27
+ ractionId?: string;
25
28
  }
26
29
 
27
30
  class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
@@ -35,15 +38,21 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
35
38
  ltmplConfigRes: undefined,
36
39
  pageNo: undefined,
37
40
  pageSize: undefined,
38
- selectedCode:undefined,
39
- showDraw:false,
40
- ractionId:undefined,
41
+ selectedCode: undefined,
42
+ showDraw: false,
43
+ ractionId: undefined,
41
44
  };
42
45
 
43
46
  async componentDidMount() {
44
47
  this.loadData();
45
48
  }
46
49
 
50
+ get computedLayoutPath() {
51
+ const { layoutRootPath } = this.props;
52
+ if (layoutRootPath !== undefined) return `/${layoutRootPath}`;
53
+ return "";
54
+ }
55
+
47
56
  onRoute = (path) => {
48
57
  this.props.navigate(path);
49
58
  };
@@ -80,33 +89,41 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
80
89
  ) {
81
90
  return;
82
91
  }
83
- await this.loadData();
92
+ await this.loadData();
84
93
  }
85
94
 
86
- showView = (code: string, toCustomPage: boolean = false) => {
95
+ showView = (showViewParam: ShowViewParam) => {
87
96
  const { basePath } = this.props;
88
97
  const { sourceId } = this.props.params;
89
98
  const { ltmplConfigRes } = this.state;
90
- let path = `${basePath}/${sourceId}/detail-view?code=${code}&menuId=${this.getMenuId()}`;
91
- if (toCustomPage && ltmplConfigRes.ltmplConfig.customViewPagePath) {
92
- path = `${basePath}${
99
+ let dtmplSourceId = showViewParam.dtmplSourceId ? showViewParam.dtmplSourceId : sourceId;
100
+ let path = `${basePath}${
101
+ this.computedLayoutPath
102
+ }/${dtmplSourceId}/detail-view?code=${showViewParam.code}&menuId=${this.getMenuId()}`;
103
+ if (showViewParam.toCustomPage && ltmplConfigRes.ltmplConfig.customViewPagePath) {
104
+ path = `${basePath}${this.computedLayoutPath}${
93
105
  ltmplConfigRes.ltmplConfig.customViewPagePath
94
106
  }?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
95
107
  }
96
108
  this.onRoute(path);
97
109
  };
98
110
 
99
- doEdit = (code: string, mode: AddOrUpdate, toCustomPage: boolean = false) => {
111
+ doEdit = (param: DoEditParam) => {
100
112
  const { basePath } = this.props;
101
113
  const { sourceId } = this.props.params;
102
114
  const { ltmplConfigRes } = this.state;
103
115
  let mainCode = this.getMainCode();
104
116
 
105
- let path = `${basePath}/${sourceId}/detail-edit?code=${code}&menuId=${this.getMenuId()}&mode=${mode}`;
106
- if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
107
- path = `${basePath}/page/${sourceId}${
117
+ let dtmplSourceId = param.dtmplSourceId ? param.dtmplSourceId : sourceId;
118
+ let path = `${basePath}${
119
+ this.computedLayoutPath
120
+ }/${dtmplSourceId}/detail-edit?code=${
121
+ param.code
122
+ }&menuId=${this.getMenuId()}&mode=${param.mode}`;
123
+ if (param.toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
124
+ path = `${basePath}${this.computedLayoutPath}/page/${dtmplSourceId}${
108
125
  ltmplConfigRes.ltmplConfig.customEditPagePath
109
- }?code=${code}&menuId=${this.getMenuId()}`;
126
+ }?code=${param.code}&menuId=${this.getMenuId()}`;
110
127
  }
111
128
  if (mainCode) {
112
129
  path = path + `&mainCode=${mainCode}`;
@@ -130,11 +147,13 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
130
147
  const { basePath } = this.props;
131
148
  const { sourceId } = this.props.params;
132
149
  const { ltmplConfigRes } = this.state;
133
- let path = `${basePath}/${sourceId}/detail-edit?menuId=${this.getMenuId()}&addTmplId=${
150
+ let path = `${basePath}${
151
+ this.computedLayoutPath
152
+ }/${sourceId}/detail-edit?menuId=${this.getMenuId()}&addTmplId=${
134
153
  addTmplId ? addTmplId : ""
135
154
  }`;
136
155
  if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
137
- path = `${basePath}/page/${sourceId}${
156
+ path = `${basePath}${this.computedLayoutPath}/page/${sourceId}${
138
157
  ltmplConfigRes.ltmplConfig.customEditPagePath
139
158
  }?menuId=${this.getMenuId()}`;
140
159
  }
@@ -146,18 +165,19 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
146
165
  };
147
166
 
148
167
  doRAction = (ractionId: string, mainCode: string) => {
149
- if(false){
168
+ if (false) {
150
169
  const { basePath } = this.props;
151
- let path = `${basePath}/${ractionId}/act-table?mainCode=${mainCode}&menuId=${this.getMenuId()}`;
170
+ let path = `${basePath}${
171
+ this.computedLayoutPath
172
+ }/${ractionId}/act-table?mainCode=${mainCode}&menuId=${this.getMenuId()}`;
152
173
  this.onRoute(path);
153
- }else{
174
+ } else {
154
175
  this.setState({
155
176
  selectedCode: mainCode,
156
177
  showDraw: true,
157
178
  ractionId,
158
179
  });
159
180
  }
160
-
161
181
  };
162
182
 
163
183
  closeDrawer = () => {
@@ -172,9 +192,12 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
172
192
  let params = { ...params_ };
173
193
  //params['sourceId'] = sourceId;
174
194
  const newfliter = Units.transQueryParamsToStr(params);
175
- this.props.navigate(`${basePath}/${sourceId}/act-table?${newfliter}`, {
176
- replace: true,
177
- });
195
+ this.props.navigate(
196
+ `${basePath}${this.computedLayoutPath}/${sourceId}/act-table?${newfliter}`,
197
+ {
198
+ replace: true,
199
+ }
200
+ );
178
201
  };
179
202
  onChangeSearch = (params_) => {
180
203
  let params = { ...params_ };
@@ -199,7 +222,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
199
222
  onChangePage = (pageNo: number, pageSize: number) => {
200
223
  const { location } = this.props;
201
224
  let search = location.search;
202
- let params = Units.transQueryStrToParams(search,null);
225
+ let params = Units.transQueryStrToParams(search, null);
203
226
  params["pageNo"] = pageNo;
204
227
  params["pageSize"] = pageSize;
205
228
  this.doSearch(params);
@@ -211,14 +234,17 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
211
234
  };
212
235
 
213
236
  render() {
214
- const { ltmplConfigRes,showDraw,ractionId,selectedCode } = this.state;
237
+ const { ltmplConfigRes, showDraw, ractionId, selectedCode } = this.state;
215
238
  const { location, params } = this.props;
216
239
  const { sourceId } = params;
217
240
  const { translate } = this.context;
218
241
  //let menuId = undefined;
219
242
  let mainCode = undefined;
220
243
  let search = location.search;
221
- let criteriaData = Units.transQueryStrToParams(search,ltmplConfigRes?.ltmplConfig);
244
+ let criteriaData = Units.transQueryStrToParams(
245
+ search,
246
+ ltmplConfigRes?.ltmplConfig
247
+ );
222
248
  let pageSize = criteriaData["pageSize"];
223
249
  let pageNo = criteriaData["pageNo"];
224
250
 
@@ -230,25 +256,25 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
230
256
  return <></>;
231
257
  } else {
232
258
  return (
233
- <>
234
- <ActTable
235
- serverKey={null}
236
- pageSize={pageSize}
237
- pageNo={pageNo}
238
- onChangePage={this.onChangePage}
239
- menuId={this.getMenuId()}
240
- mainCode={mainCode}
241
- showView={this.showView}
242
- doSearch={this.onChangeSearch}
243
- doEdit={this.doEdit}
244
- doCreate={this.doCreate}
245
- sourceId={sourceId}
246
- criteriaData={criteriaData}
247
- ltmplConfig={ltmplConfigRes ? ltmplConfigRes.ltmplConfig : null}
248
- doRAction={this.doRAction}
249
- />
250
- {showDraw?
251
- <Drawer
259
+ <>
260
+ <ActTable
261
+ serverKey={null}
262
+ pageSize={pageSize}
263
+ pageNo={pageNo}
264
+ onChangePage={this.onChangePage}
265
+ menuId={this.getMenuId()}
266
+ mainCode={mainCode}
267
+ showView={this.showView}
268
+ doSearch={this.onChangeSearch}
269
+ doEdit={this.doEdit}
270
+ doCreate={this.doCreate}
271
+ sourceId={sourceId}
272
+ criteriaData={criteriaData}
273
+ ltmplConfig={ltmplConfigRes ? ltmplConfigRes.ltmplConfig : null}
274
+ doRAction={this.doRAction}
275
+ />
276
+ {showDraw ? (
277
+ <Drawer
252
278
  placement={"left"}
253
279
  title={translate("${关联查询}")}
254
280
  closable={true}
@@ -266,16 +292,17 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
266
292
  </Button>
267
293
  </Space>
268
294
  }
269
- >
270
- {
271
- <LtmplTable
295
+ >
296
+ {
297
+ <LtmplTable
272
298
  serverKey={null}
273
299
  sourceId={ractionId}
274
300
  mainCode={selectedCode}
275
- ></LtmplTable>
276
- }
277
- </Drawer>:null}
278
- </>
301
+ ></LtmplTable>
302
+ }
303
+ </Drawer>
304
+ ) : null}
305
+ </>
279
306
  );
280
307
  }
281
308
  }
@@ -1,77 +1,95 @@
1
- import React from 'react'
2
- import {AddOrUpdate, LtmplConfigRes, RouterCompProps, TtmplConfig} from '../tmpl/interface';
1
+ import React from "react";
2
+ import {
3
+ AddOrUpdate,
4
+ LtmplConfigRes,
5
+ RouterCompProps,
6
+ TtmplConfig,
7
+ } from "../tmpl/interface";
3
8
 
4
9
  import HCDataSource from "../tmpl/hc-data-source";
5
10
  import withRouter from "../routable/withroute";
6
11
  import ActTree from "../tree/act-tree";
7
- import {Card} from "antd";
12
+ import { Card } from "antd";
8
13
  export interface TtmplRouteProps extends RouterCompProps {
9
-
10
- };
14
+ layoutRootPath?: string;
15
+ }
11
16
 
12
17
  export interface TtmplRouteState {
13
- ttmplConfig?: TtmplConfig,
14
- };
18
+ ttmplConfig?: TtmplConfig;
19
+ }
15
20
 
16
21
  class TtmplRoute extends React.PureComponent<TtmplRouteProps, TtmplRouteState> {
17
- static defaultProps = {
18
- basePath: "",
19
- }
20
- state = {
21
- ttmplConfig: undefined,
22
- }
22
+ static defaultProps = {
23
+ basePath: "",
24
+ };
25
+ state = {
26
+ ttmplConfig: undefined,
27
+ };
23
28
 
24
- async componentDidMount() {
25
- this.loadData();
26
- }
29
+ async componentDidMount() {
30
+ this.loadData();
31
+ }
27
32
 
28
- onRoute = (path) => {
29
- this.props.navigate(path);
30
- }
33
+ get computedLayoutPath() {
34
+ const { layoutRootPath } = this.props;
35
+ if (layoutRootPath !== undefined) return `/${layoutRootPath}`;
36
+ return "";
37
+ }
31
38
 
32
- getMenuId = () => {
33
- const {searchParams} = this.props;
34
- let menuId = searchParams.get('menuId');
35
- return menuId;
36
- }
39
+ onRoute = (path) => {
40
+ this.props.navigate(path);
41
+ };
42
+
43
+ getMenuId = () => {
44
+ const { searchParams } = this.props;
45
+ let menuId = searchParams.get("menuId");
46
+ return menuId;
47
+ };
37
48
 
38
- loadData = async () => {
39
- const {params} = this.props;
40
- const {sourceId} = params;
41
- let ttmplConfig:TtmplConfig = await HCDataSource.requestTtmplConfig(null,sourceId);
42
- //debugger
43
- if(ttmplConfig.type=='1M'){
44
- this.props.navigate(`/${ttmplConfig.id}/act-table`);
45
- }else{
46
- this.setState({
47
- ttmplConfig:{...ttmplConfig},
48
- })
49
- }
49
+ loadData = async () => {
50
+ const { params } = this.props;
51
+ const { sourceId } = params;
52
+ let ttmplConfig: TtmplConfig = await HCDataSource.requestTtmplConfig(
53
+ null,
54
+ sourceId
55
+ );
56
+ // debugger;
57
+ if (ttmplConfig.type == "1M") {
58
+ this.props.navigate(
59
+ `${this.computedLayoutPath}/${ttmplConfig.id}/act-table`
60
+ );
61
+ } else {
62
+ this.setState({
63
+ ttmplConfig: { ...ttmplConfig },
64
+ });
50
65
  }
66
+ };
51
67
 
52
- async componentDidUpdate(prevProps) {
53
- const {location,params} = this.props;
54
- const {sourceId} = params;
55
- let {sourceId: preSourceId} = prevProps.params;
56
- let {location: preLocation} = prevProps;
68
+ async componentDidUpdate(prevProps) {
69
+ const { location, params } = this.props;
70
+ const { sourceId } = params;
71
+ let { sourceId: preSourceId } = prevProps.params;
72
+ let { location: preLocation } = prevProps;
57
73
 
58
- if (sourceId && preSourceId && sourceId==preSourceId) {
59
- return;
60
- }
61
- await this.loadData();
74
+ if (sourceId && preSourceId && sourceId == preSourceId) {
75
+ return;
62
76
  }
77
+ await this.loadData();
78
+ }
63
79
 
64
- render() {
65
- const { } = this.props;
66
- const {ttmplConfig}=this.state;
67
- if(!ttmplConfig){
68
- return <Card loading={true}></Card>
69
- }else{
70
- return <><ActTree ttmplConfig={ttmplConfig}></ActTree></>;
71
- }
72
-
80
+ render() {
81
+ const {} = this.props;
82
+ const { ttmplConfig } = this.state;
83
+ if (!ttmplConfig) {
84
+ return <Card loading={true}></Card>;
85
+ } else {
86
+ return (
87
+ <>
88
+ <ActTree ttmplConfig={ttmplConfig}></ActTree>
89
+ </>
90
+ );
73
91
  }
92
+ }
74
93
  }
75
94
 
76
95
  export default withRouter(TtmplRoute);
77
-
@@ -1,22 +1,25 @@
1
- import React from 'react'
2
- import {useLocation, useNavigate, useParams,useSearchParams} from "react-router-dom";
1
+ import React from "react";
2
+ import {
3
+ useLocation,
4
+ useNavigate,
5
+ useParams,
6
+ useSearchParams,
7
+ } from "react-router-dom";
3
8
 
4
- const withRouter = Comp => props => {
5
- const location = useLocation();
6
- const navigate = useNavigate();
7
- const params = useParams();
8
- const [searchParams,setSearchParams]=useSearchParams();
9
- return (
10
- <Comp
11
- {...props}
12
- location={location}
13
- navigate={navigate}
14
- params={params}
15
- searchParams={searchParams}
16
- />
17
- );
9
+ const withRouter = (Comp) => (props) => {
10
+ const location = useLocation();
11
+ const navigate = useNavigate();
12
+ const params = useParams();
13
+ const [searchParams, setSearchParams] = useSearchParams();
14
+ return (
15
+ <Comp
16
+ {...props}
17
+ location={location}
18
+ navigate={navigate}
19
+ params={params}
20
+ searchParams={searchParams}
21
+ />
22
+ );
18
23
  };
19
24
 
20
-
21
25
  export default withRouter;
22
-