aldehyde 0.2.287 → 0.2.290
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/select/index.js +0 -1
- package/lib/controls/select/index.js.map +1 -1
- package/lib/controls/upload/index.js +1 -1
- package/lib/controls/upload/mult-file-upload.js +1 -1
- package/lib/form/dtmpl-form.d.ts +3 -0
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +24 -3
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/lowcode-components/act-table/index.d.ts +30 -0
- package/lib/lowcode-components/act-table/index.d.ts.map +1 -0
- package/lib/lowcode-components/act-table/index.js +86 -0
- package/lib/lowcode-components/act-table/index.js.map +1 -0
- package/lib/lowcode-components/act-table/index.less +27 -0
- package/lib/lowcode-components/base-table/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-table/index.js +8 -4
- package/lib/lowcode-components/base-table/index.js.map +1 -1
- package/lib/lowcode-components/index.d.ts +2 -0
- package/lib/lowcode-components/index.d.ts.map +1 -1
- package/lib/lowcode-components/index.js +2 -1
- package/lib/lowcode-components/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.js +8 -0
- package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -1
- package/lib/module/dtmpl-edit-card.d.ts +2 -2
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-card.js +13 -5
- package/lib/module/dtmpl-edit-card.js.map +1 -1
- package/lib/table/relation-table.d.ts +3 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +32 -18
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts +2 -0
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +18 -0
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +1 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +11 -59
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.d.ts.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +24 -0
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/select/index.tsx +0 -1
- package/src/aldehyde/controls/upload/index.tsx +1 -1
- package/src/aldehyde/controls/upload/mult-file-upload.tsx +1 -1
- package/src/aldehyde/form/dtmpl-form.tsx +28 -2
- package/src/aldehyde/lowcode-components/act-table/index.less +27 -0
- package/src/aldehyde/lowcode-components/act-table/index.tsx +127 -0
- package/src/aldehyde/lowcode-components/base-table/index.tsx +8 -4
- package/src/aldehyde/lowcode-components/index.ts +4 -2
- package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +8 -0
- package/src/aldehyde/module/dtmpl-edit-card.tsx +282 -272
- package/src/aldehyde/table/relation-table.tsx +915 -893
- package/src/aldehyde/tmpl/control-type-supportor.tsx +18 -0
- package/src/aldehyde/tmpl/hcservice-v3.tsx +15 -62
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +22 -0
|
@@ -1,314 +1,324 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, {ReactNode} from "react";
|
|
2
|
+
import {Button, FormInstance, Space, Card} from "antd";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
DtmplBaseProps,
|
|
5
|
+
DtmplConfig,
|
|
6
|
+
DtmplData,
|
|
7
7
|
} from "../tmpl/interface";
|
|
8
8
|
import DtmplForm from "../form/dtmpl-form";
|
|
9
9
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
10
10
|
import Units from "../units";
|
|
11
11
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
12
12
|
import Action from "../controls/action";
|
|
13
|
-
import {
|
|
13
|
+
import {LocaleContext} from "../locale/LocaleProvider";
|
|
14
14
|
|
|
15
15
|
interface DtmplEditCardProps extends DtmplBaseProps {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
onOk?: (code: string) => void;
|
|
17
|
+
style?: {};
|
|
18
|
+
title?: ReactNode;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
interface DtmplEditCardState {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
id?: string;
|
|
23
|
+
queryingCode?: string;
|
|
24
|
+
dtmplConfig?: DtmplConfig;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
serial?: number;
|
|
27
|
+
dtmplData?: DtmplData;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export default class DtmplEditCard extends React.PureComponent<
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
DtmplEditCardProps,
|
|
32
|
+
DtmplEditCardState
|
|
33
33
|
> {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
async componentDidMount() {
|
|
57
|
-
await this.loadConfigData();
|
|
58
|
-
}
|
|
34
|
+
formRef = React.createRef<FormInstance>();
|
|
35
|
+
autoSaveTimer = -1000000000000000;
|
|
36
|
+
autoSaveInterval = undefined;
|
|
37
|
+
static contextType = LocaleContext;
|
|
38
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
39
|
+
onClickBody = (e) => {
|
|
40
|
+
//console.log("点击了我" + this.autoSaveTimer);
|
|
41
|
+
this.autoSaveTimer = 0;
|
|
42
|
+
};
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
showConfirm: false,
|
|
45
|
+
okText: "确定",
|
|
46
|
+
};
|
|
47
|
+
state = {
|
|
48
|
+
id: "dtmplEditCard" + Units.getRandomNum(6),
|
|
49
|
+
queryingCode: undefined,
|
|
50
|
+
dtmplConfig: undefined,
|
|
51
|
+
loading: true,
|
|
52
|
+
serial: 1,
|
|
53
|
+
dtmplData: undefined,
|
|
54
|
+
};
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
const { dtmplConfig,dtmplData,queryingCode } = this.state;
|
|
62
|
-
if (prevProps && prevProps != this.props) {
|
|
63
|
-
let code=this.props.code?this.props.code:queryingCode;
|
|
64
|
-
if (prevProps.sourceId != this.props.sourceId || dtmplConfig == null || (!this.props.code && prevProps.code)) {
|
|
56
|
+
async componentDidMount() {
|
|
65
57
|
await this.loadConfigData();
|
|
66
|
-
} else if(prevProps.sourceId != this.props.sourceId || queryingCode!=code || !dtmplData ){
|
|
67
|
-
//防止反复请求 code
|
|
68
|
-
if(code){
|
|
69
|
-
await this.loadCodeData(dtmplConfig,code);
|
|
70
|
-
}else{
|
|
71
|
-
await this.loadData(dtmplConfig);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
58
|
}
|
|
75
|
-
}
|
|
76
59
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
60
|
+
async componentDidUpdate(prevProps) {
|
|
61
|
+
const {dtmplConfig, dtmplData, queryingCode} = this.state;
|
|
62
|
+
if (prevProps && prevProps != this.props) {
|
|
63
|
+
let code = this.props.code ? this.props.code : queryingCode;
|
|
64
|
+
if (prevProps.sourceId != this.props.sourceId || dtmplConfig == null || (!this.props.code && prevProps.code)) {
|
|
65
|
+
await this.loadConfigData();
|
|
66
|
+
} else if (prevProps.sourceId != this.props.sourceId || queryingCode != code || !dtmplData) {
|
|
67
|
+
//防止反复请求 code
|
|
68
|
+
if (code) {
|
|
69
|
+
await this.loadCodeData(dtmplConfig, code);
|
|
70
|
+
} else {
|
|
71
|
+
await this.loadData(dtmplConfig);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
80
75
|
}
|
|
81
|
-
}
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
});
|
|
88
|
-
let dtmplConfig:DtmplConfig = undefined;
|
|
89
|
-
if (code) {
|
|
90
|
-
dtmplConfig = await HCDataSource.requestDtmplConfig(
|
|
91
|
-
serverKey,
|
|
92
|
-
sourceId,
|
|
93
|
-
code
|
|
94
|
-
);
|
|
95
|
-
} else {
|
|
96
|
-
dtmplConfig = await HCDataSource.requestAddDtmplConfig(
|
|
97
|
-
serverKey,
|
|
98
|
-
sourceId,
|
|
99
|
-
addTmplId
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
if(dtmplConfig.entity){
|
|
103
|
-
let dtmplData=dtmplConfig.entity;
|
|
104
|
-
dtmplConfig.entity=undefined;
|
|
105
|
-
this.setState({
|
|
106
|
-
queryingCode:code,
|
|
107
|
-
dtmplData,
|
|
108
|
-
dtmplConfig,
|
|
109
|
-
loading: false,
|
|
110
|
-
});
|
|
111
|
-
}else{
|
|
112
|
-
await this.loadData(dtmplConfig);
|
|
113
|
-
this.setState({
|
|
114
|
-
dtmplConfig,
|
|
115
|
-
loading: false,
|
|
116
|
-
});
|
|
77
|
+
componentWillUnmount(): void {
|
|
78
|
+
if (this.autoSaveInterval) {
|
|
79
|
+
clearInterval(this.autoSaveInterval);
|
|
80
|
+
}
|
|
117
81
|
}
|
|
118
|
-
};
|
|
119
82
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
83
|
+
loadConfigData = async () => {
|
|
84
|
+
const {sourceId, code, serverKey, addTmplId} = this.props;
|
|
85
|
+
this.setState({
|
|
86
|
+
loading: true,
|
|
87
|
+
});
|
|
88
|
+
let dtmplConfig: DtmplConfig = undefined;
|
|
89
|
+
if (code) {
|
|
90
|
+
dtmplConfig = await HCDataSource.requestDtmplConfig(
|
|
91
|
+
serverKey,
|
|
92
|
+
sourceId,
|
|
93
|
+
code
|
|
94
|
+
);
|
|
95
|
+
} else {
|
|
96
|
+
dtmplConfig = await HCDataSource.requestAddDtmplConfig(
|
|
97
|
+
serverKey,
|
|
98
|
+
sourceId,
|
|
99
|
+
addTmplId
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
if (dtmplConfig.entity) {
|
|
103
|
+
let dtmplData = dtmplConfig.entity;
|
|
104
|
+
dtmplConfig.entity = undefined;
|
|
105
|
+
this.setState({
|
|
106
|
+
queryingCode: code,
|
|
107
|
+
dtmplData,
|
|
108
|
+
dtmplConfig,
|
|
109
|
+
loading: false,
|
|
110
|
+
});
|
|
111
|
+
} else {
|
|
112
|
+
await this.loadData(dtmplConfig);
|
|
113
|
+
this.setState({
|
|
114
|
+
dtmplConfig,
|
|
115
|
+
loading: false,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
};
|
|
132
119
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
120
|
+
loadData = async (dtmplConfig: DtmplConfig) => {
|
|
121
|
+
const {
|
|
122
|
+
sourceId,
|
|
123
|
+
serverKey,
|
|
124
|
+
code: propsCode,
|
|
125
|
+
codeSource
|
|
126
|
+
} = this.props;
|
|
127
|
+
let code = propsCode;
|
|
128
|
+
if (!code && codeSource) {
|
|
129
|
+
code = await HcserviceV3.queryCode(sourceId, codeSource, serverKey);
|
|
130
|
+
}
|
|
131
|
+
await this.loadCodeData(dtmplConfig, code)
|
|
132
|
+
|
|
133
|
+
};
|
|
134
|
+
reloadData = async () => {
|
|
135
|
+
const {queryingCode, dtmplConfig} = this.state;
|
|
136
|
+
const {
|
|
137
|
+
sourceId,
|
|
138
|
+
serverKey,
|
|
139
|
+
code: propsCode,
|
|
140
|
+
codeSource
|
|
141
|
+
} = this.props;
|
|
142
|
+
let code = propsCode ? propsCode : queryingCode;
|
|
143
|
+
if (!code && codeSource) {
|
|
144
|
+
code = await HcserviceV3.queryCode(sourceId, codeSource, serverKey);
|
|
145
|
+
}
|
|
146
|
+
await this.loadCodeData(dtmplConfig, code);
|
|
147
|
+
};
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
loadCodeData = async (dtmplConfig: DtmplConfig, code: string) => {
|
|
151
|
+
const {
|
|
152
|
+
sourceId,
|
|
153
|
+
defaultDtmplData,
|
|
154
|
+
serverKey,
|
|
155
|
+
} = this.props;
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
157
|
+
//重设定时器
|
|
158
|
+
if (dtmplConfig.autoSaveInterval && dtmplConfig.autoSaveInterval > 0) {
|
|
159
|
+
if (this.autoSaveInterval) {
|
|
160
|
+
clearInterval(this.autoSaveInterval);
|
|
161
|
+
}
|
|
162
|
+
this.autoSaveInterval = setInterval(() => {
|
|
163
|
+
if (this.autoSaveTimer >= dtmplConfig.autoSaveInterval) {
|
|
164
|
+
// console.log('执行自动保存');
|
|
165
|
+
this.autoSaveTimer = -1000000000000000;
|
|
166
|
+
this.doSubmit(undefined);
|
|
167
|
+
} else {
|
|
168
|
+
this.autoSaveTimer = this.autoSaveTimer + 1;
|
|
169
|
+
}
|
|
170
|
+
}, 1000);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (code) {
|
|
174
|
+
this.setState({
|
|
175
|
+
loading: true,
|
|
176
|
+
queryingCode: code,
|
|
177
|
+
dtmplData: undefined,
|
|
178
|
+
});
|
|
179
|
+
const dtmplData_: DtmplData = await HcserviceV3.getDtmplData(
|
|
180
|
+
dtmplConfig,
|
|
181
|
+
serverKey,
|
|
182
|
+
sourceId,
|
|
183
|
+
code
|
|
184
|
+
);
|
|
185
|
+
if ((!this.state.queryingCode || code == dtmplData_.code) &&
|
|
186
|
+
(!dtmplData_.sourceId || (this.props.sourceId == dtmplData_.sourceId))) {
|
|
187
|
+
this.setState({
|
|
188
|
+
dtmplData: dtmplData_,
|
|
189
|
+
id: code,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
this.setState({
|
|
193
|
+
loading: false,
|
|
194
|
+
});
|
|
195
|
+
} else if (defaultDtmplData) {
|
|
196
|
+
this.setState({
|
|
197
|
+
dtmplData: {...defaultDtmplData},
|
|
198
|
+
loading: false,
|
|
199
|
+
});
|
|
167
200
|
} else {
|
|
168
|
-
|
|
201
|
+
this.setState({
|
|
202
|
+
dtmplData: {
|
|
203
|
+
code: undefined,
|
|
204
|
+
title: undefined,
|
|
205
|
+
fieldMap: {},
|
|
206
|
+
arrayMap: {},
|
|
207
|
+
},
|
|
208
|
+
loading: false,
|
|
209
|
+
});
|
|
169
210
|
}
|
|
170
|
-
|
|
171
|
-
}
|
|
211
|
+
setTimeout(() => this.onValuesChange(), 300);
|
|
212
|
+
};
|
|
172
213
|
|
|
173
|
-
|
|
174
|
-
this.setState({
|
|
175
|
-
loading: true,
|
|
176
|
-
queryingCode:code,
|
|
177
|
-
dtmplData:undefined,
|
|
178
|
-
});
|
|
179
|
-
const dtmplData_: DtmplData = await HcserviceV3.getDtmplData(
|
|
180
|
-
dtmplConfig,
|
|
181
|
-
serverKey,
|
|
182
|
-
sourceId,
|
|
183
|
-
code
|
|
184
|
-
);
|
|
185
|
-
if( (!this.state.queryingCode || code == dtmplData_.code) &&
|
|
186
|
-
(!dtmplData_.sourceId || (this.props.sourceId==dtmplData_.sourceId))){
|
|
214
|
+
onValuesChange = () => {
|
|
187
215
|
this.setState({
|
|
188
|
-
|
|
189
|
-
id: code,
|
|
216
|
+
serial: this.state.serial + 1,
|
|
190
217
|
});
|
|
191
|
-
|
|
192
|
-
this.setState({
|
|
193
|
-
loading: false,
|
|
194
|
-
});
|
|
195
|
-
} else if (defaultDtmplData) {
|
|
196
|
-
this.setState({
|
|
197
|
-
dtmplData: {...defaultDtmplData},
|
|
198
|
-
loading: false,
|
|
199
|
-
});
|
|
200
|
-
} else {
|
|
201
|
-
this.setState({
|
|
202
|
-
dtmplData: {
|
|
203
|
-
code: undefined,
|
|
204
|
-
title: undefined,
|
|
205
|
-
fieldMap: {},
|
|
206
|
-
arrayMap: {},
|
|
207
|
-
},
|
|
208
|
-
loading: false,
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
setTimeout(() => this.onValuesChange(), 300);
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
onValuesChange = () => {
|
|
215
|
-
this.setState({
|
|
216
|
-
serial: this.state.serial + 1,
|
|
217
|
-
});
|
|
218
|
-
};
|
|
218
|
+
};
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
//
|
|
223
|
-
this.formRef.current.setFieldsValue({ actionId: actionId });
|
|
220
|
+
// doSubmit = async (actionId?: number, codes?: string[], params?: object) => {
|
|
221
|
+
// await this.doSubmit1(actionId, codes, params);
|
|
222
|
+
// //await this.reloadData();
|
|
224
223
|
// }
|
|
225
|
-
if (mainCode) {
|
|
226
|
-
this.formRef.current.setFieldsValue({ mainCode: mainCode });
|
|
227
|
-
}
|
|
228
|
-
if (params) {
|
|
229
|
-
this.formRef.current.setFieldsValue(params);
|
|
230
|
-
}
|
|
231
|
-
this.formRef.current.submit();
|
|
232
|
-
};
|
|
233
224
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
225
|
+
doSubmit = async (actionId?: number, codes?: string[], params?: object) => {
|
|
226
|
+
const {mainCode} = this.props;
|
|
227
|
+
//if (actionId) {
|
|
228
|
+
this.formRef.current.setFieldsValue({actionId: actionId});
|
|
229
|
+
// }
|
|
230
|
+
if (mainCode) {
|
|
231
|
+
this.formRef.current.setFieldsValue({mainCode: mainCode});
|
|
232
|
+
}
|
|
233
|
+
if (params) {
|
|
234
|
+
this.formRef.current.setFieldsValue(params);
|
|
235
|
+
}
|
|
236
|
+
this.formRef.current.submit();
|
|
237
|
+
//this.reloadData();
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
getFooter = () => {
|
|
241
|
+
const {serverKey} = this.props;
|
|
242
|
+
const {dtmplData, serial} = this.state;
|
|
243
|
+
const {translate} = this.context;
|
|
244
|
+
const footerButtons = [];
|
|
245
|
+
footerButtons.unshift(
|
|
246
|
+
<Button onClick={() => this.reloadData()}>
|
|
247
|
+
{translate("${刷新}")}
|
|
248
|
+
</Button>
|
|
249
|
+
);
|
|
253
250
|
footerButtons.unshift(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
key={ac.id}
|
|
260
|
-
formRef={this.formRef}
|
|
261
|
-
actionConfig={ac}
|
|
262
|
-
doAction={this.doSubmit}
|
|
263
|
-
></Action>
|
|
251
|
+
<Button onClick={() => {
|
|
252
|
+
this.doSubmit();
|
|
253
|
+
}} type={"primary"}>
|
|
254
|
+
{translate("${保存}")}
|
|
255
|
+
</Button>
|
|
264
256
|
);
|
|
265
|
-
|
|
257
|
+
const {dtmplConfig} = this.state;
|
|
258
|
+
//处理action
|
|
259
|
+
if (dtmplConfig) {
|
|
260
|
+
dtmplConfig.actions.forEach((ac, index) => {
|
|
261
|
+
footerButtons.unshift(
|
|
262
|
+
<Action
|
|
263
|
+
serverKey={serverKey}
|
|
264
|
+
iconType={"icon-title"}
|
|
265
|
+
hiddenType={"disabled"}
|
|
266
|
+
serial={serial}
|
|
267
|
+
key={ac.id}
|
|
268
|
+
formRef={this.formRef}
|
|
269
|
+
actionConfig={ac}
|
|
270
|
+
doAction={this.doSubmit}
|
|
271
|
+
></Action>
|
|
272
|
+
);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
return footerButtons;
|
|
276
|
+
};
|
|
277
|
+
onFinish = async (code: any) => {
|
|
278
|
+
this.setState({loading: false})
|
|
279
|
+
if (code) {
|
|
280
|
+
this.props.onOk(code);
|
|
281
|
+
await this.reloadData();
|
|
282
|
+
}
|
|
283
|
+
|
|
266
284
|
}
|
|
267
|
-
return footerButtons;
|
|
268
|
-
};
|
|
269
|
-
onFinish = (code:any) => {
|
|
270
|
-
this.setState({loading:false})
|
|
271
|
-
if(code){
|
|
272
|
-
this.props.onOk(code);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
285
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
+
render() {
|
|
287
|
+
const {
|
|
288
|
+
sourceId,
|
|
289
|
+
mainCode,
|
|
290
|
+
style,
|
|
291
|
+
maxColsOnRow,
|
|
292
|
+
title,
|
|
293
|
+
serverKey,
|
|
294
|
+
} = this.props;
|
|
295
|
+
const {dtmplConfig, id, dtmplData} = this.state;
|
|
286
296
|
|
|
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
|
-
|
|
297
|
+
return (
|
|
298
|
+
<>
|
|
299
|
+
<Card
|
|
300
|
+
onClick={this.onClickBody}
|
|
301
|
+
styles={{body: {padding: "6px"}, header: {alignItems: "center"}}}
|
|
302
|
+
title={title}
|
|
303
|
+
style={{minWidth: maxColsOnRow == 1 ? "360px" : "720px", ...style}}
|
|
304
|
+
extra={<Space>{this.getFooter()}</Space>}
|
|
305
|
+
>
|
|
306
|
+
<DtmplForm
|
|
307
|
+
serverKey={serverKey}
|
|
308
|
+
showHeader={false}
|
|
309
|
+
mainCode={mainCode}
|
|
310
|
+
parentId={id}
|
|
311
|
+
dtmplConfig={dtmplConfig}
|
|
312
|
+
formRef={this.formRef}
|
|
313
|
+
sourceId={sourceId}
|
|
314
|
+
onFinish={this.onFinish}
|
|
315
|
+
maxColsOnRow={maxColsOnRow}
|
|
316
|
+
showConfirm={false}
|
|
317
|
+
dtmplData={dtmplData}
|
|
318
|
+
onValuesChange={this.onValuesChange}
|
|
319
|
+
/>
|
|
320
|
+
</Card>
|
|
321
|
+
</>
|
|
322
|
+
);
|
|
323
|
+
}
|
|
314
324
|
}
|