aldehyde 0.2.99 → 0.2.100

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 (190) hide show
  1. package/dist/bundle.021f784b1c84781461d2.js +1 -0
  2. package/dist/bundle.03c542ca824e205fe307.js +2 -0
  3. package/dist/bundle.03c542ca824e205fe307.js.LICENSE.txt +27 -0
  4. package/dist/bundle.03c542ca824e205fe307.js.gz +0 -0
  5. package/dist/bundle.15cb660c34802f6cccf5.js +1 -0
  6. package/dist/bundle.15cb660c34802f6cccf5.js.gz +0 -0
  7. package/dist/bundle.2f9c2d692fe0277a37aa.js +2 -0
  8. package/dist/bundle.2f9c2d692fe0277a37aa.js.LICENSE.txt +1 -0
  9. package/dist/bundle.2f9c2d692fe0277a37aa.js.gz +0 -0
  10. package/dist/bundle.320c02187dd135005102.js +2 -0
  11. package/dist/bundle.320c02187dd135005102.js.LICENSE.txt +6 -0
  12. package/dist/bundle.320c02187dd135005102.js.gz +0 -0
  13. package/dist/bundle.35a4af7e2d0da1942d79.js +10 -0
  14. package/dist/bundle.35a4af7e2d0da1942d79.js.gz +0 -0
  15. package/dist/bundle.3f9072b1629cdb384b46.js +2 -0
  16. package/dist/bundle.3f9072b1629cdb384b46.js.LICENSE.txt +5 -0
  17. package/dist/bundle.3f9072b1629cdb384b46.js.gz +0 -0
  18. package/dist/bundle.46e2295b5360a725bcd5.js +1 -0
  19. package/dist/bundle.46e2295b5360a725bcd5.js.gz +0 -0
  20. package/dist/bundle.4c3c988531c3cf360b87.js +1 -0
  21. package/dist/bundle.4c3c988531c3cf360b87.js.gz +0 -0
  22. package/dist/bundle.4df89546fd2e9d665dfb.js +2 -0
  23. package/dist/bundle.4df89546fd2e9d665dfb.js.LICENSE.txt +5 -0
  24. package/dist/bundle.4df89546fd2e9d665dfb.js.gz +0 -0
  25. package/dist/bundle.5a9afb9ee6cceca506fa.js +5 -0
  26. package/dist/bundle.5a9afb9ee6cceca506fa.js.LICENSE.txt +10 -0
  27. package/dist/bundle.5a9afb9ee6cceca506fa.js.gz +0 -0
  28. package/dist/bundle.5e6cccd06b34a0e3a2ff.js +1 -0
  29. package/dist/bundle.5e6cccd06b34a0e3a2ff.js.gz +0 -0
  30. package/dist/bundle.62c62e6aaa7f3c20761e.js +2 -0
  31. package/dist/bundle.62c62e6aaa7f3c20761e.js.LICENSE.txt +17 -0
  32. package/dist/bundle.62c62e6aaa7f3c20761e.js.gz +0 -0
  33. package/dist/bundle.6fd2dadd29083268c5a6.js +2 -0
  34. package/dist/bundle.6fd2dadd29083268c5a6.js.LICENSE.txt +17 -0
  35. package/dist/bundle.6fd2dadd29083268c5a6.js.gz +0 -0
  36. package/dist/bundle.8241d8d05e35988dd480.js +1 -0
  37. package/dist/bundle.8241d8d05e35988dd480.js.gz +0 -0
  38. package/dist/bundle.829683dfa6a98c78c58e.js +2 -0
  39. package/dist/bundle.829683dfa6a98c78c58e.js.LICENSE.txt +14 -0
  40. package/dist/bundle.829683dfa6a98c78c58e.js.gz +0 -0
  41. package/dist/bundle.840e28984e710e12f467.js +75 -0
  42. package/dist/bundle.840e28984e710e12f467.js.LICENSE.txt +8 -0
  43. package/dist/bundle.840e28984e710e12f467.js.gz +0 -0
  44. package/dist/bundle.85ce5221fe6ab1d91f7d.js +2 -0
  45. package/dist/bundle.85ce5221fe6ab1d91f7d.js.LICENSE.txt +1 -0
  46. package/dist/bundle.85ce5221fe6ab1d91f7d.js.gz +0 -0
  47. package/dist/bundle.9cfd99a04bde7f781c30.js +1 -0
  48. package/dist/bundle.9cfd99a04bde7f781c30.js.gz +0 -0
  49. package/dist/bundle.a049dc8814bbbf59160f.js +1 -0
  50. package/dist/bundle.a049dc8814bbbf59160f.js.gz +0 -0
  51. package/dist/bundle.a94f7811fac19aa9d6a3.js +2 -0
  52. package/dist/bundle.a94f7811fac19aa9d6a3.js.LICENSE.txt +1 -0
  53. package/dist/bundle.a94f7811fac19aa9d6a3.js.gz +0 -0
  54. package/dist/bundle.abdde6e82ee9f60d1bf3.js +2 -0
  55. package/dist/bundle.abdde6e82ee9f60d1bf3.js.LICENSE.txt +30 -0
  56. package/dist/bundle.abdde6e82ee9f60d1bf3.js.gz +0 -0
  57. package/dist/bundle.b207a66d5902f39d0c5a.js +1 -0
  58. package/dist/bundle.b207a66d5902f39d0c5a.js.gz +0 -0
  59. package/dist/bundle.b7b86a025aa95dea0e19.js +2 -0
  60. package/dist/bundle.b7b86a025aa95dea0e19.js.LICENSE.txt +8 -0
  61. package/dist/bundle.b7b86a025aa95dea0e19.js.gz +0 -0
  62. package/dist/bundle.b7e3eb480b649b3de67b.js +2 -0
  63. package/dist/bundle.b7e3eb480b649b3de67b.js.LICENSE.txt +5 -0
  64. package/dist/bundle.b7e3eb480b649b3de67b.js.gz +0 -0
  65. package/dist/bundle.c1c6028fd703ebf78c2e.js +2 -0
  66. package/dist/bundle.c1c6028fd703ebf78c2e.js.LICENSE.txt +5 -0
  67. package/dist/bundle.c1c6028fd703ebf78c2e.js.gz +0 -0
  68. package/dist/bundle.cd10ae07e0e0c36d0dee.js +2 -0
  69. package/dist/bundle.cd10ae07e0e0c36d0dee.js.LICENSE.txt +22 -0
  70. package/dist/bundle.cd10ae07e0e0c36d0dee.js.gz +0 -0
  71. package/dist/bundle.cf6a1933769c2aee4e6e.js +1 -0
  72. package/dist/bundle.cf6a1933769c2aee4e6e.js.gz +0 -0
  73. package/dist/bundle.d158d417d1d7a8acb2a1.js +1 -0
  74. package/dist/bundle.d158d417d1d7a8acb2a1.js.gz +0 -0
  75. package/dist/bundle.db40aa107272f4303ece.js +1 -0
  76. package/dist/bundle.db40aa107272f4303ece.js.gz +0 -0
  77. package/dist/bundle.ddefe6d8f235ef95d470.js +1 -0
  78. package/dist/bundle.ddefe6d8f235ef95d470.js.gz +0 -0
  79. package/dist/bundle.e02a7a16b4a6b3bb412f.js +2 -0
  80. package/dist/bundle.e02a7a16b4a6b3bb412f.js.LICENSE.txt +16 -0
  81. package/dist/bundle.e02a7a16b4a6b3bb412f.js.gz +0 -0
  82. package/dist/bundle.e760a70171cf0ae4567b.js +1 -0
  83. package/dist/bundle.e760a70171cf0ae4567b.js.gz +0 -0
  84. package/dist/bundle.f3ce062a620fe456c152.js +1 -0
  85. package/dist/bundle.f6e1c4fda58154810fe2.js +2 -0
  86. package/dist/bundle.f6e1c4fda58154810fe2.js.LICENSE.txt +41 -0
  87. package/dist/bundle.f6e1c4fda58154810fe2.js.gz +0 -0
  88. package/dist/bundle.fe9c09b8ace9c3117b0a.js +1 -0
  89. package/dist/bundle.fe9c09b8ace9c3117b0a.js.gz +0 -0
  90. package/dist/bundle.feaa17bec2057a4ee54f.js +1 -0
  91. package/dist/bundle.feaa17bec2057a4ee54f.js.gz +0 -0
  92. package/dist/css/chemstruc-graph-6437e59640f8b99b774f.css +12 -0
  93. package/dist/css/chemstruc-graph-6437e59640f8b99b774f.css.gz +0 -0
  94. package/dist/css/common-901df6b21f13391f2a53.css +56 -0
  95. package/dist/css/html-editor-draft-5e8e152675ab7d201c00.css +886 -0
  96. package/dist/css/html-editor-draft-5e8e152675ab7d201c00.css.gz +0 -0
  97. package/dist/css/main-f3c8fdebab315e61e7be.css +865 -0
  98. package/dist/css/main-f3c8fdebab315e61e7be.css.gz +0 -0
  99. package/dist/images/development-30de07a0.png +0 -0
  100. package/dist/images/logo-54b328b7.png +0 -0
  101. package/dist/images/pain-point-8f02421e.png +0 -0
  102. package/dist/images/target-13a5b4b9.png +0 -0
  103. package/dist/images/time-cost-cb40d2c2.png +0 -0
  104. package/dist/images/time-prograss-44b86b36.png +0 -0
  105. package/dist/index.html +4 -0
  106. package/lib/controls/collapse-card/index.d.ts +11 -2
  107. package/lib/controls/collapse-card/index.d.ts.map +1 -1
  108. package/lib/controls/collapse-card/index.js +18 -16
  109. package/lib/controls/collapse-card/index.js.map +1 -1
  110. package/lib/controls/entry-control.d.ts.map +1 -1
  111. package/lib/controls/entry-control.js +2 -1
  112. package/lib/controls/entry-control.js.map +1 -1
  113. package/lib/detail/button/fix-right-submit-button-bar.js +1 -1
  114. package/lib/detail/button/fix-right-submit-button-bar.js.map +1 -1
  115. package/lib/detail/view/act-dtmpl-view.js +1 -1
  116. package/lib/detail/view/act-dtmpl-view.js.map +1 -1
  117. package/lib/detail/view/field-view-group.d.ts +10 -1
  118. package/lib/detail/view/field-view-group.d.ts.map +1 -1
  119. package/lib/detail/view/field-view-group.js +17 -11
  120. package/lib/detail/view/field-view-group.js.map +1 -1
  121. package/lib/form/criteria-form.js +3 -3
  122. package/lib/form/criteria-form.js.map +1 -1
  123. package/lib/form/form-Item-group.js +1 -1
  124. package/lib/form/form-Item-group.js.map +1 -1
  125. package/lib/layout/MainPage.js +1 -1
  126. package/lib/layout/MainPage.js.map +1 -1
  127. package/lib/layout/header/index.js +3 -3
  128. package/lib/layout/header/index.js.map +1 -1
  129. package/lib/layout/menu/block.d.ts +13 -1
  130. package/lib/layout/menu/block.d.ts.map +1 -1
  131. package/lib/layout/menu/block.js +66 -8
  132. package/lib/layout/menu/block.js.map +1 -1
  133. package/lib/layout/menu/menu-2layers.d.ts +10 -0
  134. package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
  135. package/lib/layout/menu/menu-2layers.js +32 -9
  136. package/lib/layout/menu/menu-2layers.js.map +1 -1
  137. package/lib/layout/sidebar/index.d.ts.map +1 -1
  138. package/lib/layout/sidebar/index.js +3 -1
  139. package/lib/layout/sidebar/index.js.map +1 -1
  140. package/lib/locale/LocaleProvider.d.ts.map +1 -1
  141. package/lib/locale/LocaleProvider.js +10 -8
  142. package/lib/locale/LocaleProvider.js.map +1 -1
  143. package/lib/locale/translate.d.ts.map +1 -1
  144. package/lib/locale/translate.js +10 -8
  145. package/lib/locale/translate.js.map +1 -1
  146. package/lib/routable/ltmpl-route.d.ts +2 -2
  147. package/lib/routable/ltmpl-route.d.ts.map +1 -1
  148. package/lib/routable/ltmpl-route.js +22 -21
  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 +18 -8
  152. package/lib/table/act-table.js.map +1 -1
  153. package/lib/table/column/column-selector.d.ts.map +1 -1
  154. package/lib/table/column/column-selector.js +20 -18
  155. package/lib/table/column/column-selector.js.map +1 -1
  156. package/lib/table/query-table.d.ts +10 -1
  157. package/lib/table/query-table.d.ts.map +1 -1
  158. package/lib/table/query-table.js +47 -41
  159. package/lib/table/query-table.js.map +1 -1
  160. package/lib/table/relation-table.js +4 -4
  161. package/lib/table/relation-table.js.map +1 -1
  162. package/lib/tree/tmpl-tree.d.ts.map +1 -1
  163. package/lib/tree/tmpl-tree.js +9 -6
  164. package/lib/tree/tmpl-tree.js.map +1 -1
  165. package/lib/tree/tree-node.d.ts.map +1 -1
  166. package/lib/tree/tree-node.js.map +1 -1
  167. package/package.json +1 -1
  168. package/src/aldehyde/controls/action/index.tsx +6 -5
  169. package/src/aldehyde/controls/collapse-card/index.tsx +96 -54
  170. package/src/aldehyde/controls/entry-control.tsx +2 -1
  171. package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +1 -1
  172. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +1 -1
  173. package/src/aldehyde/detail/view/field-view-group.tsx +62 -47
  174. package/src/aldehyde/form/criteria-form.tsx +3 -3
  175. package/src/aldehyde/form/form-Item-group.tsx +1 -1
  176. package/src/aldehyde/layout/MainPage.tsx +1 -1
  177. package/src/aldehyde/layout/header/index.tsx +4 -4
  178. package/src/aldehyde/layout/menu/block.less +11 -0
  179. package/src/aldehyde/layout/menu/block.tsx +132 -72
  180. package/src/aldehyde/layout/menu/menu-2layers.tsx +99 -64
  181. package/src/aldehyde/layout/sidebar/index.tsx +5 -1
  182. package/src/aldehyde/locale/LocaleProvider.tsx +10 -9
  183. package/src/aldehyde/locale/translate.ts +10 -7
  184. package/src/aldehyde/routable/ltmpl-route.tsx +220 -196
  185. package/src/aldehyde/table/act-table.tsx +26 -9
  186. package/src/aldehyde/table/column/column-selector.tsx +111 -72
  187. package/src/aldehyde/table/query-table.tsx +354 -304
  188. package/src/aldehyde/table/relation-table.tsx +4 -4
  189. package/src/aldehyde/tree/tmpl-tree.tsx +19 -3
  190. package/src/aldehyde/tree/tree-node.tsx +0 -3
@@ -1,207 +1,231 @@
1
- import React from 'react'
2
- import {AddOrUpdate, LtmplConfigRes, RouterCompProps} from '../tmpl/interface';
1
+ import React from "react";
2
+ import {
3
+ AddOrUpdate,
4
+ LtmplConfigRes,
5
+ RouterCompProps,
6
+ } from "../tmpl/interface";
3
7
  import Units from "../units";
4
- import ActTable from '../table/act-table'
8
+ import ActTable from "../table/act-table";
5
9
  // import StatActTable from '../table/stat-act-table'
6
10
  import HCDataSource from "../tmpl/hc-data-source";
7
11
  import withRouter from "../routable/withroute";
8
- export interface LtmplRouteProps extends RouterCompProps {
9
-
10
- };
12
+ export interface LtmplRouteProps extends RouterCompProps {}
11
13
 
12
14
  export interface LtmplRouteState {
13
- ltmplConfigRes?: LtmplConfigRes,
14
- pageNo?: number,
15
- pageSize?: number,
16
- };
15
+ ltmplConfigRes?: LtmplConfigRes;
16
+ pageNo?: number;
17
+ pageSize?: number;
18
+ }
17
19
 
18
20
  class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
19
- static defaultProps = {
20
- basePath: "",
21
- }
22
- state = {
23
- ltmplConfigRes: undefined,
24
- pageNo: undefined,
25
- pageSize: undefined,
26
- }
27
-
28
- async componentDidMount() {
29
- this.loadData();
30
- }
31
-
32
- onRoute = (path) => {
33
- this.props.navigate(path);
34
- }
35
-
36
- getMenuId = () => {
37
- const {searchParams} = this.props;
38
- let menuId = searchParams.get('menuId');
39
- return menuId;
40
- }
41
-
42
- loadData = async () => {
43
- const {params} = this.props;
44
- const {sourceId} = params;
45
- let ltmplConfigRes:LtmplConfigRes = await HCDataSource.requestLtmplConfig(null,sourceId);
46
- this.setState({
47
- ltmplConfigRes:ltmplConfigRes,
48
- })
49
- }
50
-
51
- async componentDidUpdate(prevProps) {
52
- const {location,params} = this.props;
53
- const {sourceId} = params;
54
- let {sourceId: preSourceId} = prevProps.params;
55
- let {location: preLocation} = prevProps;
56
- if (!sourceId ||
57
- (!preSourceId && this.state.ltmplConfigRes)
58
- || (location.pathname == preLocation.pathname && location.search == preLocation.search)
59
- ) {
60
- return;
61
- }
62
- this.loadData();
63
- }
64
-
65
- showView = (code: string, toCustomPage: boolean = false) => {
66
- const {basePath} = this.props;
67
- const {sourceId} = this.props.params;
68
- const {ltmplConfigRes} = this.state;
69
- let path = `${basePath}/${sourceId}/detail-view?code=${code}&menuId=${this.getMenuId()}`;
70
- if (toCustomPage && ltmplConfigRes.ltmplConfig.customViewPagePath) {
71
- path = `${basePath}${ltmplConfigRes.ltmplConfig.customViewPagePath}?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
72
- }
73
- this.onRoute(path);
74
- }
75
-
76
- doEdit = (code: string, mode: AddOrUpdate, toCustomPage: boolean = false) => {
77
- const {basePath} = this.props;
78
- const {sourceId} = this.props.params;
79
- const {ltmplConfigRes} = this.state;
80
- let mainCode = this.getMainCode();
81
-
82
- let path = `${basePath}/${sourceId}/detail-edit?code=${code}&menuId=${this.getMenuId()}&mode=${mode}`;
83
- if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
84
- path = `${basePath}/page/${sourceId}${ltmplConfigRes.ltmplConfig.customEditPagePath}?code=${code}&menuId=${this.getMenuId()}`;
85
- }
86
- if (mainCode) {
87
- path = path + `&mainCode=${mainCode}`;
88
- }
89
- this.onRoute(path);
90
- }
91
-
92
- getMainCode = () => {
93
- const {searchParams} = this.props;
94
- let mainCode = undefined;
95
- // let criteriaData = Units.transQueryStrToParams(search);
96
- let mcode=searchParams.get('mainCode');
97
- if (mcode) {
98
- // criteriaData = Units.transQueryStrToParams(search);
99
- mainCode = mcode;
100
- }
101
- return mainCode;
102
- }
103
-
104
- doCreate = (addTmplId:string,toCustomPage: boolean = false) => {
105
- const {basePath} = this.props;
106
- const {sourceId} = this.props.params;
107
- const {ltmplConfigRes} = this.state;
108
- let path = `${basePath}/${sourceId}/detail-edit?menuId=${this.getMenuId()}&addTmplId=${addTmplId?addTmplId:""}`;
109
- if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
110
- path = `${basePath}/page/${sourceId}${ltmplConfigRes.ltmplConfig.customEditPagePath}?menuId=${this.getMenuId()}`;
111
- }
112
- let mainCode = this.getMainCode();
113
- if (mainCode) {
114
- path = path + `&mainCode=${mainCode}`;
115
- }
116
- this.onRoute(path);
117
- }
118
-
119
- doRAction = (ractionId: string, mainCode: String) => {
120
- const {basePath} = this.props;
121
- let path = `${basePath}/${ractionId}/act-table?mainCode=${mainCode}&menuId=${this.getMenuId()}`;
122
- this.onRoute(path);
123
- }
124
-
125
- doSearch = (params_) => {
126
- const {basePath} = this.props;
127
- const {sourceId} = this.props.params;
128
- let params = {...params_}
129
- //params['sourceId'] = sourceId;
130
- const newfliter = Units.transQueryParamsToStr(params);
131
- this.props.navigate(`${basePath}/${sourceId}/act-table?${newfliter}`,{replace:true})
132
-
133
- }
134
- onChangeSearch = (params_) => {
135
- let params = {...params_}
136
- //追加过滤条件,hiddenColIds,innerQueryKey
137
- const {searchParams} = this.props;
138
- let mcode=searchParams.get("mainCode");
139
- if (mcode) {
140
- params['mainCode'] = mcode;
141
- }
142
- const {pageSize,pageNo} = this.state;
143
- if(pageSize){
144
- params['pageNo'] = pageNo;
145
- }
146
- if(pageNo){
147
- params['pageSize'] = pageSize;
148
- }
149
- params['menuId']=this.getMenuId();
150
- params['sourceId']=this.getMenuId();
151
- this.doSearch(params);
152
- }
153
-
154
- onChangePage = (pageNo: number, pageSize: number) => {
155
- const {location} = this.props;
156
- let search = location.search;
157
- let params = Units.transQueryStrToParams(search);
158
- params['pageNo'] = pageNo;
159
- params['pageSize'] = pageSize;
160
- this.doSearch(params);
161
-
162
- // this.setState({
163
- // pageNo,
164
- // pageSize
165
- // })
166
- }
167
-
168
-
169
- render() {
170
- const {ltmplConfigRes} = this.state;
171
- const {location, params} = this.props;
172
- const {sourceId} = params;
173
- //let menuId = undefined;
174
- let mainCode = undefined;
175
-
176
- let search = location.search;
177
- let criteriaData = Units.transQueryStrToParams(search);
178
- // if (search.indexOf('menuId') > 0) {
179
- // menuId = criteriaData['menuId'];
180
- // criteriaData['menuId'] = undefined;
181
- // } else {
182
- // menuId = sourceId;
183
- // }
184
- let pageSize = criteriaData['pageSize'];
185
- let pageNo = criteriaData['pageNo'];
186
-
187
- if (search.indexOf('mainCode') > 0) {
188
- //criteriaData = Units.transQueryStrToParams(search);
189
- mainCode = criteriaData['mainCode'];
190
- }
191
- if (!ltmplConfigRes) {
192
- return <></>;
193
- } else {
194
- return <ActTable serverKey={null} pageSize={pageSize} pageNo={pageNo} onChangePage={this.onChangePage}
195
- menuId={this.getMenuId()} mainCode={mainCode} showView={this.showView}
196
- doSearch={this.onChangeSearch} doEdit={this.doEdit} doCreate={this.doCreate}
197
- sourceId={sourceId} criteriaData={criteriaData}
198
- ltmplConfig={ltmplConfigRes?ltmplConfigRes.ltmplConfig:null}
199
- doRAction={this.doRAction}
200
- />
201
- }
202
-
203
- }
21
+ static defaultProps = {
22
+ basePath: "",
23
+ };
24
+ state = {
25
+ ltmplConfigRes: undefined,
26
+ pageNo: undefined,
27
+ pageSize: undefined,
28
+ };
29
+
30
+ async componentDidMount() {
31
+ this.loadData();
32
+ }
33
+
34
+ onRoute = (path) => {
35
+ this.props.navigate(path);
36
+ };
37
+
38
+ getMenuId = () => {
39
+ const { searchParams } = this.props;
40
+ let menuId = searchParams.get("menuId");
41
+ return menuId;
42
+ };
43
+
44
+ loadData = async () => {
45
+ const { params } = this.props;
46
+ const { sourceId } = params;
47
+ let ltmplConfigRes: LtmplConfigRes = await HCDataSource.requestLtmplConfig(
48
+ null,
49
+ sourceId
50
+ );
51
+ this.setState({
52
+ ltmplConfigRes: ltmplConfigRes,
53
+ });
54
+ };
55
+
56
+ async componentDidUpdate(prevProps) {
57
+ const { location, params } = this.props;
58
+ const { sourceId } = params;
59
+ let { sourceId: preSourceId } = prevProps.params;
60
+ let { location: preLocation } = prevProps;
61
+ if (
62
+ !sourceId ||
63
+ (!preSourceId && this.state.ltmplConfigRes) ||
64
+ (location.pathname == preLocation.pathname &&
65
+ location.search == preLocation.search)
66
+ ) {
67
+ return;
68
+ }
69
+ this.loadData();
70
+ }
71
+
72
+ showView = (code: string, toCustomPage: boolean = false) => {
73
+ const { basePath } = this.props;
74
+ const { sourceId } = this.props.params;
75
+ const { ltmplConfigRes } = this.state;
76
+ let path = `${basePath}/${sourceId}/detail-view?code=${code}&menuId=${this.getMenuId()}`;
77
+ if (toCustomPage && ltmplConfigRes.ltmplConfig.customViewPagePath) {
78
+ path = `${basePath}${
79
+ ltmplConfigRes.ltmplConfig.customViewPagePath
80
+ }?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
81
+ }
82
+ this.onRoute(path);
83
+ };
84
+
85
+ doEdit = (code: string, mode: AddOrUpdate, toCustomPage: boolean = false) => {
86
+ const { basePath } = this.props;
87
+ const { sourceId } = this.props.params;
88
+ const { ltmplConfigRes } = this.state;
89
+ let mainCode = this.getMainCode();
90
+
91
+ let path = `${basePath}/${sourceId}/detail-edit?code=${code}&menuId=${this.getMenuId()}&mode=${mode}`;
92
+ if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
93
+ path = `${basePath}/page/${sourceId}${
94
+ ltmplConfigRes.ltmplConfig.customEditPagePath
95
+ }?code=${code}&menuId=${this.getMenuId()}`;
96
+ }
97
+ if (mainCode) {
98
+ path = path + `&mainCode=${mainCode}`;
99
+ }
100
+ this.onRoute(path);
101
+ };
102
+
103
+ getMainCode = () => {
104
+ const { searchParams } = this.props;
105
+ let mainCode = undefined;
106
+ // let criteriaData = Units.transQueryStrToParams(search);
107
+ let mcode = searchParams.get("mainCode");
108
+ if (mcode) {
109
+ // criteriaData = Units.transQueryStrToParams(search);
110
+ mainCode = mcode;
111
+ }
112
+ return mainCode;
113
+ };
114
+
115
+ doCreate = (addTmplId: string, toCustomPage: boolean = false) => {
116
+ const { basePath } = this.props;
117
+ const { sourceId } = this.props.params;
118
+ const { ltmplConfigRes } = this.state;
119
+ let path = `${basePath}/${sourceId}/detail-edit?menuId=${this.getMenuId()}&addTmplId=${
120
+ addTmplId ? addTmplId : ""
121
+ }`;
122
+ if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
123
+ path = `${basePath}/page/${sourceId}${
124
+ ltmplConfigRes.ltmplConfig.customEditPagePath
125
+ }?menuId=${this.getMenuId()}`;
126
+ }
127
+ let mainCode = this.getMainCode();
128
+ if (mainCode) {
129
+ path = path + `&mainCode=${mainCode}`;
130
+ }
131
+ this.onRoute(path);
132
+ };
133
+
134
+ doRAction = (ractionId: string, mainCode: String) => {
135
+ const { basePath } = this.props;
136
+ let path = `${basePath}/${ractionId}/act-table?mainCode=${mainCode}&menuId=${this.getMenuId()}`;
137
+ this.onRoute(path);
138
+ };
139
+
140
+ doSearch = (params_) => {
141
+ const { basePath } = this.props;
142
+ const { sourceId } = this.props.params;
143
+ let params = { ...params_ };
144
+ //params['sourceId'] = sourceId;
145
+ const newfliter = Units.transQueryParamsToStr(params);
146
+ this.props.navigate(`${basePath}/${sourceId}/act-table?${newfliter}`, {
147
+ replace: true,
148
+ });
149
+ };
150
+ onChangeSearch = (params_) => {
151
+ let params = { ...params_ };
152
+ //追加过滤条件,hiddenColIds,innerQueryKey
153
+ const { searchParams } = this.props;
154
+ let mcode = searchParams.get("mainCode");
155
+ if (mcode) {
156
+ params["mainCode"] = mcode;
157
+ }
158
+ const { pageSize, pageNo } = this.state;
159
+ if (pageSize) {
160
+ params["pageNo"] = pageNo;
161
+ }
162
+ if (pageNo) {
163
+ params["pageSize"] = pageSize;
164
+ }
165
+ params["menuId"] = this.getMenuId();
166
+ params["sourceId"] = this.getMenuId();
167
+ this.doSearch(params);
168
+ };
169
+
170
+ onChangePage = (pageNo: number, pageSize: number) => {
171
+ const { location } = this.props;
172
+ let search = location.search;
173
+ let params = Units.transQueryStrToParams(search);
174
+ params["pageNo"] = pageNo;
175
+ params["pageSize"] = pageSize;
176
+ this.doSearch(params);
177
+
178
+ // this.setState({
179
+ // pageNo,
180
+ // pageSize
181
+ // })
182
+ };
183
+
184
+ render() {
185
+ const { ltmplConfigRes } = this.state;
186
+ const { location, params } = this.props;
187
+ const { sourceId } = params;
188
+ //let menuId = undefined;
189
+ let mainCode = undefined;
190
+
191
+ let search = location.search;
192
+ let criteriaData = Units.transQueryStrToParams(search);
193
+ // if (search.indexOf('menuId') > 0) {
194
+ // menuId = criteriaData['menuId'];
195
+ // criteriaData['menuId'] = undefined;
196
+ // } else {
197
+ // menuId = sourceId;
198
+ // }
199
+ let pageSize = criteriaData["pageSize"];
200
+ let pageNo = criteriaData["pageNo"];
201
+
202
+ if (search.indexOf("mainCode") > 0) {
203
+ //criteriaData = Units.transQueryStrToParams(search);
204
+ mainCode = criteriaData["mainCode"];
205
+ }
206
+ if (!ltmplConfigRes) {
207
+ return <></>;
208
+ } else {
209
+ return (
210
+ <ActTable
211
+ serverKey={null}
212
+ pageSize={pageSize}
213
+ pageNo={pageNo}
214
+ onChangePage={this.onChangePage}
215
+ menuId={this.getMenuId()}
216
+ mainCode={mainCode}
217
+ showView={this.showView}
218
+ doSearch={this.onChangeSearch}
219
+ doEdit={this.doEdit}
220
+ doCreate={this.doCreate}
221
+ sourceId={sourceId}
222
+ criteriaData={criteriaData}
223
+ ltmplConfig={ltmplConfigRes ? ltmplConfigRes.ltmplConfig : null}
224
+ doRAction={this.doRAction}
225
+ />
226
+ );
227
+ }
228
+ }
204
229
  }
205
230
 
206
231
  export default withRouter(LtmplRoute);
207
-
@@ -76,7 +76,7 @@ const { Panel } = Collapse;
76
76
  type Level = "l1" | "l2";
77
77
 
78
78
  const defaultDisabledColIds: string[] = ["20000", "10000"];
79
-
79
+ let refresh=true;
80
80
  interface ActTableProps extends TmplBaseProps {
81
81
  criteriaData: object;
82
82
  pageNo: number;
@@ -284,7 +284,11 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
284
284
  column["render"] = (text, record, index) => <label>{index + 1}</label>;
285
285
  item["sorter"] = undefined;
286
286
  } else if (item.id == "10000") {
287
- column["title"] = <Tooltip title={"拖拽排序"}>{item.title}</Tooltip>;
287
+ column["title"] = (
288
+ <Tooltip title={translate("${拖拽排序}")}>
289
+ {translate("${" + item.title + "}")}
290
+ </Tooltip>
291
+ );
288
292
  column["width"] = 30;
289
293
  column["dataIndex"] = item.id;
290
294
  column["className"] = "drag-visible";
@@ -511,6 +515,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
511
515
  );
512
516
  } else {
513
517
  column["className"] = "opsColumn";
518
+ column["title"] = translate("${" + item.title + "}");
514
519
  column["render"] = (text, record) => {
515
520
  return (
516
521
  <ViewControl
@@ -523,6 +528,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
523
528
  };
524
529
  }
525
530
  });
531
+
526
532
  return tableColumns;
527
533
  };
528
534
 
@@ -540,6 +546,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
540
546
  this.loadData(defaultDisabledColIds, [], sortedColConfigs);
541
547
  }
542
548
 
549
+
550
+
543
551
  async componentDidUpdate(prevProps) {
544
552
  const { sourceId, criteriaData, ltmplConfig } = this.props;
545
553
  const { translate } = this.context;
@@ -550,7 +558,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
550
558
  } = prevProps;
551
559
 
552
560
  let { hiddenColIds, sortedColConfigs } = this.state;
553
- if (
561
+
562
+ if (refresh ||
554
563
  (sourceId && preSourceId != sourceId) ||
555
564
  (ltmplConfig &&
556
565
  (!preLtmplConfig || ltmplConfig.id != preLtmplConfig.id)) ||
@@ -563,8 +572,11 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
563
572
  "pageNo",
564
573
  ])
565
574
  ) {
575
+ //5秒后允许再次请求数据
576
+ refresh=false;
577
+
566
578
  if (ltmplConfig.id == preLtmplConfig.id) {
567
- this.loadData(hiddenColIds, [], sortedColConfigs);
579
+ await this.loadData(hiddenColIds, [], sortedColConfigs);
568
580
  } else {
569
581
  let sColConfigs = undefined;
570
582
  if (ltmplConfig) {
@@ -577,8 +589,11 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
577
589
  this.setState({
578
590
  viewModels: ["table"],
579
591
  });
580
- this.loadData(defaultDisabledColIds, [], sColConfigs);
592
+ await this.loadData(defaultDisabledColIds, [], sColConfigs);
581
593
  }
594
+ setTimeout( function() {
595
+ refresh=true;
596
+ },2000);
582
597
  }
583
598
  }
584
599
 
@@ -930,7 +945,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
930
945
  <ExportFrame //导出组件
931
946
  serverKey={serverKey}
932
947
  queryKey={queryKey}
933
- title={ltmplConfig.title}
948
+ title={translate("${" + ltmplConfig.title + "}")}
934
949
  />
935
950
  }
936
951
  title={translate("${导出}")}
@@ -1006,7 +1021,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1006
1021
  </Col>
1007
1022
  <Col span={24}>
1008
1023
  <Checkbox value={"verticalList"}>
1009
- {translate("纵向列表")}
1024
+ {translate("${纵向列表}")}
1010
1025
  </Checkbox>
1011
1026
  </Col>
1012
1027
  {/*<Col span={24}><Checkbox value={'horizontalList'}>横向列表</Checkbox></Col>*/}
@@ -1132,6 +1147,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1132
1147
  onChangePage,
1133
1148
  serverKey,
1134
1149
  } = this.props;
1150
+ const { translate } = this.context;
1135
1151
 
1136
1152
  if (!ltmplConfig || !sourceId) {
1137
1153
  return (
@@ -1202,7 +1218,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1202
1218
  ) : null}
1203
1219
  <h3>
1204
1220
  {" "}
1205
- {title ? title : ltmplConfig.title}
1221
+ {translate("${" + (title ? title : ltmplConfig.title) + "}")}
1206
1222
  <p className="fr">{this.renderHeaderButtons()}</p>
1207
1223
  </h3>
1208
1224
  </span>
@@ -1252,6 +1268,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1252
1268
  initCollapse,
1253
1269
  tip,
1254
1270
  } = this.props;
1271
+ const { translate } = this.context;
1255
1272
 
1256
1273
  if (!ltmplConfig || !sourceId) {
1257
1274
  return (
@@ -1270,7 +1287,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
1270
1287
  initCollapse={initCollapse}
1271
1288
  title={
1272
1289
  <>
1273
- {title ? title : ltmplConfig.title}
1290
+ {translate("${" + (title ? title : ltmplConfig.title) + "}")}
1274
1291
  <ToolTipBar
1275
1292
  content={tip ? tip : ltmplConfig ? ltmplConfig.tip : null}
1276
1293
  />