aldehyde 0.2.180 → 0.2.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/layout/menu/menu-render.d.ts.map +1 -1
- package/lib/layout/menu/menu-render.js +3 -0
- package/lib/layout/menu/menu-render.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +3 -0
- package/lib/layout2/page.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +4 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +86 -33
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +0 -2
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +12 -3
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/units/index.js +6 -6
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/layout/menu/menu-render.tsx +3 -0
- package/src/aldehyde/layout2/page.tsx +3 -0
- package/src/aldehyde/routable/ltmpl-route.tsx +388 -282
- package/src/aldehyde/tmpl/hcservice-v3.tsx +1 -2
- package/src/aldehyde/tmpl/interface.tsx +13 -3
- package/src/aldehyde/units/index.tsx +6 -6
|
@@ -1,327 +1,433 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {ReactNode} from "react";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
AddOrUpdate,
|
|
4
|
+
DoEditParam, LtmplConfig,
|
|
5
|
+
LtmplConfigRes, PageType,
|
|
6
|
+
RouterCompProps,
|
|
7
|
+
ShowViewParam,
|
|
8
8
|
} from "../tmpl/interface";
|
|
9
9
|
import Units from "../units";
|
|
10
10
|
import ActTable from "../table/act-table";
|
|
11
11
|
// import StatActTable from '../table/stat-act-table'
|
|
12
12
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
13
13
|
import withRouter from "../routable/withroute";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import {Button, Drawer, Space} from "antd";
|
|
15
|
+
import {LocaleContext} from "../locale/LocaleProvider";
|
|
16
16
|
import LtmplTable from "../module/ltmpl-table";
|
|
17
|
+
import DtmplViewDrawer from "../module/dtmpl-view-drawer";
|
|
18
|
+
import DtmplCustomEditModalPage from "../custom-page/dtmpl-custom-edit-modal-page";
|
|
19
|
+
import DtmplEditPage from "../module/dtmpl-edit-page";
|
|
20
|
+
import DtmplViewModal from "../module/dtmpl-view-modal";
|
|
17
21
|
|
|
18
22
|
export interface LtmplRouteProps extends RouterCompProps {
|
|
19
|
-
|
|
23
|
+
layoutRootPath?: string;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
export interface LtmplRouteState {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
ltmplConfigRes?: LtmplConfigRes;
|
|
28
|
+
pageNo?: number;
|
|
29
|
+
pageSize?: number;
|
|
30
|
+
selectedCode?: string;
|
|
31
|
+
showDraw?: boolean;
|
|
32
|
+
ractionId?: string;
|
|
33
|
+
showViewDrawer?: boolean;
|
|
34
|
+
showViewModal?: boolean;
|
|
35
|
+
showEdit?: boolean;
|
|
36
|
+
showWindowType?: string;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
static contextType = LocaleContext;
|
|
41
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
basePath: "",
|
|
45
|
+
};
|
|
46
|
+
state = {
|
|
47
|
+
ltmplConfigRes: undefined,
|
|
48
|
+
pageNo: undefined,
|
|
49
|
+
pageSize: undefined,
|
|
50
|
+
selectedCode: undefined,
|
|
51
|
+
showDraw: false,
|
|
52
|
+
ractionId: undefined,
|
|
53
|
+
showViewDrawer: false,
|
|
54
|
+
showViewModal: false,
|
|
55
|
+
showEdit: false,
|
|
56
|
+
showWindowType: "modal"
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
async componentDidMount() {
|
|
60
|
+
this.loadData();
|
|
61
|
+
}
|
|
46
62
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
get computedLayoutPath() {
|
|
64
|
+
const {layoutRootPath} = this.props;
|
|
65
|
+
if (layoutRootPath !== undefined) return `/${layoutRootPath}`;
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
onRoute = (path) => {
|
|
70
|
+
this.props.navigate(path);
|
|
71
|
+
};
|
|
50
72
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
73
|
+
getMenuId = () => {
|
|
74
|
+
const {searchParams} = this.props;
|
|
75
|
+
let menuId = searchParams.get("menuId");
|
|
76
|
+
return menuId;
|
|
77
|
+
};
|
|
56
78
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
79
|
+
doClose = () => {
|
|
80
|
+
this.setState(
|
|
81
|
+
{
|
|
82
|
+
showDraw: false,
|
|
83
|
+
showViewDrawer: false,
|
|
84
|
+
showViewModal: false,
|
|
85
|
+
showEdit: false,
|
|
86
|
+
selectedCode: undefined
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
};
|
|
60
90
|
|
|
61
|
-
getMenuId = () => {
|
|
62
|
-
const { searchParams } = this.props;
|
|
63
|
-
let menuId = searchParams.get("menuId");
|
|
64
|
-
return menuId;
|
|
65
|
-
};
|
|
66
91
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
92
|
+
loadData = async () => {
|
|
93
|
+
const {params} = this.props;
|
|
94
|
+
const {sourceId} = params;
|
|
95
|
+
let ltmplConfigRes: LtmplConfigRes = await HCDataSource.requestLtmplConfig(
|
|
96
|
+
null,
|
|
97
|
+
sourceId
|
|
98
|
+
);
|
|
74
99
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
100
|
+
this.setState({
|
|
101
|
+
ltmplConfigRes: ltmplConfigRes,
|
|
102
|
+
});
|
|
103
|
+
};
|
|
79
104
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
105
|
+
async componentDidUpdate(prevProps) {
|
|
106
|
+
const {location, params} = this.props;
|
|
107
|
+
const {sourceId} = params;
|
|
108
|
+
let {sourceId: preSourceId} = prevProps.params;
|
|
109
|
+
let {location: preLocation} = prevProps;
|
|
110
|
+
if (
|
|
111
|
+
!sourceId ||
|
|
112
|
+
(!preSourceId && this.state.ltmplConfigRes) ||
|
|
113
|
+
(location.pathname == preLocation.pathname &&
|
|
114
|
+
location.search == preLocation.search)
|
|
115
|
+
) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
await this.loadData();
|
|
92
119
|
}
|
|
93
|
-
await this.loadData();
|
|
94
|
-
}
|
|
95
120
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
121
|
+
showView = (showViewParam: ShowViewParam) => {
|
|
122
|
+
const {basePath} = this.props;
|
|
123
|
+
const {sourceId} = this.props.params;
|
|
124
|
+
const {ltmplConfigRes} = this.state;
|
|
125
|
+
let ltmplConfig: LtmplConfig = ltmplConfigRes.ltmplConfig;
|
|
126
|
+
let showType: string = !ltmplConfig.buttonAddConfig ? "routing" : ltmplConfig.buttonAddConfig.showType;
|
|
127
|
+
if (showType == "routing") {
|
|
128
|
+
let dtmplSourceId = showViewParam.dtmplSourceId
|
|
129
|
+
? showViewParam.dtmplSourceId
|
|
130
|
+
: sourceId;
|
|
131
|
+
let path = `${basePath}${
|
|
132
|
+
this.computedLayoutPath
|
|
133
|
+
}/${dtmplSourceId}/detail-view?code=${
|
|
134
|
+
showViewParam.code
|
|
135
|
+
}&menuId=${this.getMenuId()}`;
|
|
136
|
+
if (
|
|
137
|
+
showViewParam.toCustomPage &&
|
|
138
|
+
ltmplConfig.customViewPagePath
|
|
139
|
+
) {
|
|
140
|
+
path = `${basePath}${this.computedLayoutPath}${
|
|
141
|
+
ltmplConfig.customViewPagePath
|
|
142
|
+
}?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
|
|
143
|
+
}
|
|
144
|
+
this.onRoute(path);
|
|
145
|
+
} else {
|
|
146
|
+
this.setState({
|
|
147
|
+
showViewModal: showType=="modal",
|
|
148
|
+
showViewDrawer: showType=="drawer",
|
|
149
|
+
selectedCode: showViewParam.code
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
};
|
|
100
153
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
154
|
+
doEdit = (param: DoEditParam) => {
|
|
155
|
+
const {basePath} = this.props;
|
|
156
|
+
const {sourceId} = this.props.params;
|
|
157
|
+
const {ltmplConfigRes} = this.state;
|
|
158
|
+
let mainCode = this.getMainCode();
|
|
159
|
+
let ltmplConfig: LtmplConfig = ltmplConfigRes.ltmplConfig;
|
|
160
|
+
let showWindowType: PageType = !ltmplConfig.buttonAddConfig ? "routing" : ltmplConfig.buttonAddConfig.showType;
|
|
161
|
+
if (showWindowType == "routing") {
|
|
162
|
+
let dtmplSourceId = param.dtmplSourceId ? param.dtmplSourceId : sourceId;
|
|
163
|
+
let path = `${basePath}${
|
|
164
|
+
this.computedLayoutPath
|
|
165
|
+
}/${dtmplSourceId}/detail-edit?code=${
|
|
166
|
+
param.code
|
|
167
|
+
}&menuId=${this.getMenuId()}&mode=${param.mode}`;
|
|
168
|
+
if (param.toCustomPage && ltmplConfig.customEditPagePath) {
|
|
169
|
+
path = `${basePath}${this.computedLayoutPath}/page/${dtmplSourceId}${
|
|
170
|
+
ltmplConfig.customEditPagePath
|
|
171
|
+
}?code=${param.code}&menuId=${this.getMenuId()}`;
|
|
172
|
+
}
|
|
173
|
+
if (mainCode) {
|
|
174
|
+
path = path + `&mainCode=${mainCode}`;
|
|
175
|
+
}
|
|
176
|
+
this.onRoute(path);
|
|
177
|
+
} else {
|
|
178
|
+
this.setState({
|
|
179
|
+
showEdit: true,
|
|
180
|
+
showWindowType,
|
|
181
|
+
selectedCode: param.code
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
};
|
|
104
185
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
|
|
117
|
-
}
|
|
118
|
-
this.onRoute(path);
|
|
119
|
-
};
|
|
186
|
+
getMainCode = () => {
|
|
187
|
+
const {searchParams} = this.props;
|
|
188
|
+
let mainCode = undefined;
|
|
189
|
+
// let criteriaData = Units.transQueryStrToParams(search);
|
|
190
|
+
let mcode = searchParams.get("mainCode");
|
|
191
|
+
if (mcode) {
|
|
192
|
+
// criteriaData = Units.transQueryStrToParams(search);
|
|
193
|
+
mainCode = mcode;
|
|
194
|
+
}
|
|
195
|
+
return mainCode;
|
|
196
|
+
};
|
|
120
197
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
198
|
+
doCreate = (addTmplId: string, toCustomPage: boolean = false) => {
|
|
199
|
+
const {basePath} = this.props;
|
|
200
|
+
const {sourceId} = this.props.params;
|
|
201
|
+
const {ltmplConfigRes} = this.state;
|
|
202
|
+
let ltmplConfig: LtmplConfig = ltmplConfigRes.ltmplConfig;
|
|
203
|
+
let showType: string = !ltmplConfig.buttonAddConfig ? "routing" : ltmplConfig.buttonAddConfig.showType;
|
|
204
|
+
if (showType == "routing") {
|
|
205
|
+
let path = `${basePath}${
|
|
206
|
+
this.computedLayoutPath
|
|
207
|
+
}/${sourceId}/detail-edit?menuId=${this.getMenuId()}&addTmplId=${
|
|
208
|
+
addTmplId ? addTmplId : ""
|
|
209
|
+
}`;
|
|
210
|
+
if (toCustomPage && ltmplConfig.customEditPagePath) {
|
|
211
|
+
path = `${basePath}${this.computedLayoutPath}/page/${sourceId}${
|
|
212
|
+
ltmplConfig.customEditPagePath
|
|
213
|
+
}?menuId=${this.getMenuId()}`;
|
|
214
|
+
}
|
|
215
|
+
let mainCode = this.getMainCode();
|
|
216
|
+
if (mainCode) {
|
|
217
|
+
path = path + `&mainCode=${mainCode}`;
|
|
218
|
+
}
|
|
219
|
+
this.onRoute(path);
|
|
220
|
+
} else {
|
|
221
|
+
this.setState({
|
|
222
|
+
showEdit: true
|
|
223
|
+
})
|
|
224
|
+
}
|
|
126
225
|
|
|
127
|
-
|
|
128
|
-
let path = `${basePath}${
|
|
129
|
-
this.computedLayoutPath
|
|
130
|
-
}/${dtmplSourceId}/detail-edit?code=${
|
|
131
|
-
param.code
|
|
132
|
-
}&menuId=${this.getMenuId()}&mode=${param.mode}`;
|
|
133
|
-
if (param.toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
|
|
134
|
-
path = `${basePath}${this.computedLayoutPath}/page/${dtmplSourceId}${
|
|
135
|
-
ltmplConfigRes.ltmplConfig.customEditPagePath
|
|
136
|
-
}?code=${param.code}&menuId=${this.getMenuId()}`;
|
|
137
|
-
}
|
|
138
|
-
if (mainCode) {
|
|
139
|
-
path = path + `&mainCode=${mainCode}`;
|
|
140
|
-
}
|
|
141
|
-
this.onRoute(path);
|
|
142
|
-
};
|
|
226
|
+
};
|
|
143
227
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
228
|
+
doRAction = (ractionId: string, mainCode: string) => {
|
|
229
|
+
if (false) {
|
|
230
|
+
const {basePath} = this.props;
|
|
231
|
+
let path = `${basePath}${
|
|
232
|
+
this.computedLayoutPath
|
|
233
|
+
}/${ractionId}/act-table?mainCode=${mainCode}&menuId=${this.getMenuId()}`;
|
|
234
|
+
this.onRoute(path);
|
|
235
|
+
} else {
|
|
236
|
+
this.setState({
|
|
237
|
+
selectedCode: mainCode,
|
|
238
|
+
showDraw: true,
|
|
239
|
+
ractionId,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
};
|
|
155
243
|
|
|
156
|
-
doCreate = (addTmplId: string, toCustomPage: boolean = false) => {
|
|
157
|
-
const { basePath } = this.props;
|
|
158
|
-
const { sourceId } = this.props.params;
|
|
159
|
-
const { ltmplConfigRes } = this.state;
|
|
160
|
-
let path = `${basePath}${
|
|
161
|
-
this.computedLayoutPath
|
|
162
|
-
}/${sourceId}/detail-edit?menuId=${this.getMenuId()}&addTmplId=${
|
|
163
|
-
addTmplId ? addTmplId : ""
|
|
164
|
-
}`;
|
|
165
|
-
if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
|
|
166
|
-
path = `${basePath}${this.computedLayoutPath}/page/${sourceId}${
|
|
167
|
-
ltmplConfigRes.ltmplConfig.customEditPagePath
|
|
168
|
-
}?menuId=${this.getMenuId()}`;
|
|
169
|
-
}
|
|
170
|
-
let mainCode = this.getMainCode();
|
|
171
|
-
if (mainCode) {
|
|
172
|
-
path = path + `&mainCode=${mainCode}`;
|
|
173
|
-
}
|
|
174
|
-
this.onRoute(path);
|
|
175
|
-
};
|
|
176
244
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
245
|
+
doSearch = (params_) => {
|
|
246
|
+
const {basePath} = this.props;
|
|
247
|
+
const {sourceId} = this.props.params;
|
|
248
|
+
let params = {
|
|
249
|
+
...Units.transQueryStrToParams(
|
|
250
|
+
this.props.location.search,
|
|
251
|
+
this.state.ltmplConfigRes?.ltmplConfig
|
|
252
|
+
),
|
|
253
|
+
...params_,
|
|
254
|
+
};
|
|
255
|
+
//params['sourceId'] = sourceId;
|
|
256
|
+
const newfliter = Units.transQueryParamsToStr({...params});
|
|
257
|
+
this.props.navigate(
|
|
258
|
+
`${basePath}${this.computedLayoutPath}/${sourceId}/act-table?${newfliter}`,
|
|
259
|
+
{
|
|
260
|
+
replace: true,
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
};
|
|
264
|
+
onChangeSearch = (params_) => {
|
|
265
|
+
let params = {...params_};
|
|
266
|
+
//追加过滤条件,hiddenColIds,innerQueryKey
|
|
267
|
+
const {searchParams} = this.props;
|
|
268
|
+
let mcode = searchParams.get("mainCode");
|
|
269
|
+
if (mcode) {
|
|
270
|
+
params["mainCode"] = mcode;
|
|
271
|
+
}
|
|
272
|
+
const {pageSize, pageNo} = this.state;
|
|
273
|
+
if (pageSize) {
|
|
274
|
+
params["pageNo"] = pageNo;
|
|
275
|
+
}
|
|
276
|
+
if (pageNo) {
|
|
277
|
+
params["pageSize"] = pageSize;
|
|
278
|
+
}
|
|
279
|
+
params["menuId"] = this.getMenuId();
|
|
280
|
+
params["sourceId"] = this.getMenuId();
|
|
281
|
+
this.doSearch(params);
|
|
282
|
+
};
|
|
283
|
+
doSubmited = () => {
|
|
284
|
+
this.onChangeSearch(null);
|
|
285
|
+
this.doClose();
|
|
190
286
|
}
|
|
191
|
-
};
|
|
192
287
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
288
|
+
onChangePage = (pageNo: number, pageSize: number) => {
|
|
289
|
+
const {location} = this.props;
|
|
290
|
+
let search = location.search;
|
|
291
|
+
let params = Units.transQueryStrToParams(search, null);
|
|
292
|
+
params["pageNo"] = pageNo;
|
|
293
|
+
params["pageSize"] = pageSize;
|
|
294
|
+
this.doSearch(params);
|
|
198
295
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
...Units.transQueryStrToParams(
|
|
204
|
-
this.props.location.search,
|
|
205
|
-
this.state.ltmplConfigRes?.ltmplConfig
|
|
206
|
-
),
|
|
207
|
-
...params_,
|
|
296
|
+
// this.setState({
|
|
297
|
+
// pageNo,
|
|
298
|
+
// pageSize
|
|
299
|
+
// })
|
|
208
300
|
};
|
|
209
|
-
//params['sourceId'] = sourceId;
|
|
210
|
-
const newfliter = Units.transQueryParamsToStr({ ...params });
|
|
211
|
-
this.props.navigate(
|
|
212
|
-
`${basePath}${this.computedLayoutPath}/${sourceId}/act-table?${newfliter}`,
|
|
213
|
-
{
|
|
214
|
-
replace: true,
|
|
215
|
-
}
|
|
216
|
-
);
|
|
217
|
-
};
|
|
218
|
-
onChangeSearch = (params_) => {
|
|
219
|
-
let params = { ...params_ };
|
|
220
|
-
//追加过滤条件,hiddenColIds,innerQueryKey
|
|
221
|
-
const { searchParams } = this.props;
|
|
222
|
-
let mcode = searchParams.get("mainCode");
|
|
223
|
-
if (mcode) {
|
|
224
|
-
params["mainCode"] = mcode;
|
|
225
|
-
}
|
|
226
|
-
const { pageSize, pageNo } = this.state;
|
|
227
|
-
if (pageSize) {
|
|
228
|
-
params["pageNo"] = pageNo;
|
|
229
|
-
}
|
|
230
|
-
if (pageNo) {
|
|
231
|
-
params["pageSize"] = pageSize;
|
|
232
|
-
}
|
|
233
|
-
params["menuId"] = this.getMenuId();
|
|
234
|
-
params["sourceId"] = this.getMenuId();
|
|
235
|
-
this.doSearch(params);
|
|
236
|
-
};
|
|
237
301
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
302
|
+
render() {
|
|
303
|
+
const {
|
|
304
|
+
ltmplConfigRes, showDraw, showWindowType, ractionId, selectedCode,
|
|
305
|
+
showViewDrawer, showViewModal, showEdit
|
|
306
|
+
} = this.state;
|
|
307
|
+
const {location, params,} = this.props;
|
|
308
|
+
const {sourceId} = params;
|
|
309
|
+
const {translate} = this.context;
|
|
310
|
+
//let menuId = undefined;
|
|
311
|
+
let mainCode = undefined;
|
|
312
|
+
let search = location.search;
|
|
313
|
+
let criteriaData = Units.transQueryStrToParams(
|
|
314
|
+
search,
|
|
315
|
+
ltmplConfigRes?.ltmplConfig
|
|
316
|
+
);
|
|
317
|
+
let pageSize = criteriaData["pageSize"];
|
|
318
|
+
let pageNo = criteriaData["pageNo"];
|
|
245
319
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
};
|
|
320
|
+
if (search.indexOf("mainCode") > 0) {
|
|
321
|
+
//criteriaData = Units.transQueryStrToParams(search);
|
|
322
|
+
mainCode = criteriaData["mainCode"];
|
|
323
|
+
}
|
|
251
324
|
|
|
252
|
-
|
|
253
|
-
const { ltmplConfigRes, showDraw, ractionId, selectedCode } = this.state;
|
|
254
|
-
const { location, params } = this.props;
|
|
255
|
-
const { sourceId } = params;
|
|
256
|
-
const { translate } = this.context;
|
|
257
|
-
//let menuId = undefined;
|
|
258
|
-
let mainCode = undefined;
|
|
259
|
-
let search = location.search;
|
|
260
|
-
let criteriaData = Units.transQueryStrToParams(
|
|
261
|
-
search,
|
|
262
|
-
ltmplConfigRes?.ltmplConfig
|
|
263
|
-
);
|
|
264
|
-
let pageSize = criteriaData["pageSize"];
|
|
265
|
-
let pageNo = criteriaData["pageNo"];
|
|
325
|
+
let ltmplConfig = ltmplConfigRes ? ltmplConfigRes.ltmplConfig : null;
|
|
266
326
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
327
|
+
if (!ltmplConfig) {
|
|
328
|
+
return <></>;
|
|
329
|
+
} else {
|
|
330
|
+
return (
|
|
331
|
+
<>
|
|
332
|
+
<ActTable
|
|
333
|
+
serverKey={null}
|
|
334
|
+
pageSize={pageSize}
|
|
335
|
+
pageNo={pageNo}
|
|
336
|
+
onChangePage={this.onChangePage}
|
|
337
|
+
menuId={this.getMenuId()}
|
|
338
|
+
mainCode={mainCode}
|
|
339
|
+
showView={this.showView}
|
|
340
|
+
doSearch={this.onChangeSearch}
|
|
341
|
+
doEdit={this.doEdit}
|
|
342
|
+
doCreate={this.doCreate}
|
|
343
|
+
sourceId={sourceId}
|
|
344
|
+
criteriaData={criteriaData}
|
|
345
|
+
ltmplConfig={ltmplConfig}
|
|
346
|
+
doRAction={this.doRAction}
|
|
347
|
+
/>
|
|
348
|
+
{showDraw ? (
|
|
349
|
+
<Drawer
|
|
350
|
+
placement={"left"}
|
|
351
|
+
title={translate("${关联查询}")}
|
|
352
|
+
closable={true}
|
|
353
|
+
mask={false}
|
|
354
|
+
onClose={this.doClose}
|
|
355
|
+
open={showDraw}
|
|
356
|
+
width={"calc(100% - 280px)"}
|
|
357
|
+
style={{
|
|
358
|
+
maxWidth: 1960,
|
|
359
|
+
}}
|
|
360
|
+
extra={
|
|
361
|
+
<Space>
|
|
362
|
+
<Button onClick={this.doClose}>
|
|
363
|
+
{translate("${关闭}")}
|
|
364
|
+
</Button>
|
|
365
|
+
</Space>
|
|
366
|
+
}
|
|
367
|
+
>
|
|
368
|
+
{
|
|
369
|
+
<LtmplTable
|
|
370
|
+
serverKey={null}
|
|
371
|
+
sourceId={ractionId}
|
|
372
|
+
mainCode={selectedCode}
|
|
373
|
+
></LtmplTable>
|
|
374
|
+
}
|
|
375
|
+
</Drawer>
|
|
376
|
+
) : null}
|
|
377
|
+
{showViewDrawer && selectedCode ? (
|
|
378
|
+
<DtmplViewDrawer
|
|
379
|
+
serverKey={null}
|
|
380
|
+
placement={ltmplConfig.buttonViewConfig.windowPosition}
|
|
381
|
+
width={ltmplConfig.buttonViewConfig.windowWidth}
|
|
382
|
+
onClose={this.doClose}
|
|
383
|
+
open={showViewDrawer}
|
|
384
|
+
sourceId={sourceId}
|
|
385
|
+
code={selectedCode}
|
|
386
|
+
></DtmplViewDrawer>
|
|
387
|
+
) : null}
|
|
388
|
+
{showViewModal && selectedCode ? (
|
|
389
|
+
<DtmplViewModal
|
|
390
|
+
serverKey={null}
|
|
391
|
+
width={ltmplConfig.buttonViewConfig.windowWidth}
|
|
392
|
+
height={ltmplConfig.buttonViewConfig.windowHeight}
|
|
393
|
+
onClose={this.doClose}
|
|
394
|
+
open={showViewModal}
|
|
395
|
+
sourceId={sourceId}
|
|
396
|
+
code={selectedCode}
|
|
397
|
+
></DtmplViewModal>
|
|
398
|
+
) : null}
|
|
399
|
+
{showEdit && ltmplConfig ? (
|
|
400
|
+
ltmplConfig.customEditPagePath ? (
|
|
401
|
+
<DtmplCustomEditModalPage
|
|
402
|
+
open={showEdit}
|
|
403
|
+
onOk={() => {
|
|
404
|
+
this.doSubmited();
|
|
405
|
+
}}
|
|
406
|
+
customPath={ltmplConfig.customEditPagePath}
|
|
407
|
+
sourceId={sourceId}
|
|
408
|
+
mainCode={mainCode}
|
|
409
|
+
code={selectedCode}
|
|
410
|
+
/>
|
|
411
|
+
) : (
|
|
412
|
+
<DtmplEditPage
|
|
413
|
+
defaultDtmplData={ltmplConfig.defaultDtmplData}
|
|
414
|
+
serverKey={null}
|
|
415
|
+
pageType={showWindowType=="modal"?"modal":"drawer"}
|
|
416
|
+
open={showEdit}
|
|
417
|
+
width={selectedCode ? ltmplConfig.buttonEditConfig.windowWidth : ltmplConfig.buttonAddConfig.windowWidth}
|
|
418
|
+
height={selectedCode ? ltmplConfig.buttonEditConfig.windowHeight : ltmplConfig.buttonAddConfig.windowHeight}
|
|
419
|
+
onCancel={this.doClose}
|
|
420
|
+
mainCode={mainCode}
|
|
421
|
+
sourceId={sourceId}
|
|
422
|
+
code={selectedCode}
|
|
423
|
+
onOk={this.doSubmited}
|
|
424
|
+
/>
|
|
425
|
+
)
|
|
426
|
+
) : null}
|
|
427
|
+
</>
|
|
428
|
+
);
|
|
429
|
+
}
|
|
323
430
|
}
|
|
324
|
-
}
|
|
325
431
|
}
|
|
326
432
|
|
|
327
433
|
export default withRouter(LtmplRoute);
|