@byteluck-fe/model-driven-engine 2.6.0-alpha.8 → 2.7.0-alpha.1
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/dist/esm/common/ActionManager.js +154 -72
- package/dist/esm/common/DataManager.js +128 -60
- package/dist/esm/common/Engine.js +1063 -1104
- package/dist/esm/common/OkWorker.js +75 -106
- package/dist/esm/common/Runtime.js +27 -29
- package/dist/esm/common/Store.js +172 -183
- package/dist/esm/common/checkerValue.js +253 -328
- package/dist/esm/common/index.js +2 -2
- package/dist/esm/common/proxyState.js +47 -47
- package/dist/esm/index.js +3 -3
- package/dist/esm/plugins/CalcPlugin.js +306 -378
- package/dist/esm/plugins/ControlsEventPlugin.js +225 -141
- package/dist/esm/plugins/ES6ModulePlugin.js +38 -56
- package/dist/esm/plugins/LifecycleEventPlugin.js +190 -107
- package/dist/esm/plugins/StylePlugin.js +13 -31
- package/dist/esm/plugins/index.js +5 -5
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/runtimeUtils.js +6 -8
- package/dist/index.umd.js +9 -9
- package/dist/types/common/Engine.d.ts +7 -7
- package/dist/types/common/Runtime.d.ts +1 -1
- package/dist/types/common/Store.d.ts +6 -5
- package/dist/types/common/proxyState.d.ts +3 -3
- package/dist/types/plugins/ControlsEventPlugin.d.ts +1 -1
- package/dist/types/plugins/ES6ModulePlugin.d.ts +4 -4
- package/dist/types/plugins/LifecycleEventPlugin.d.ts +1 -1
- package/dist/types/plugins/StylePlugin.d.ts +1 -1
- package/package.json +4 -4
package/dist/esm/common/Store.js
CHANGED
|
@@ -3,20 +3,6 @@ function _classCallCheck(instance, Constructor) {
|
|
|
3
3
|
throw new TypeError("Cannot call a class as a function");
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
function _defineProperties(target, props) {
|
|
7
|
-
for(var i = 0; i < props.length; i++){
|
|
8
|
-
var descriptor = props[i];
|
|
9
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
-
descriptor.configurable = true;
|
|
11
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
16
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
-
return Constructor;
|
|
19
|
-
}
|
|
20
6
|
function _defineProperty(obj, key, value) {
|
|
21
7
|
if (key in obj) {
|
|
22
8
|
Object.defineProperty(obj, key, {
|
|
@@ -32,181 +18,179 @@ function _defineProperty(obj, key, value) {
|
|
|
32
18
|
}
|
|
33
19
|
function _instanceof(left, right) {
|
|
34
20
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
35
|
-
return right[Symbol.hasInstance](left);
|
|
21
|
+
return !!right[Symbol.hasInstance](left);
|
|
36
22
|
} else {
|
|
37
23
|
return left instanceof right;
|
|
38
24
|
}
|
|
39
25
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
function _objectSpread(target) {
|
|
27
|
+
for(var i = 1; i < arguments.length; i++){
|
|
28
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
29
|
+
var ownKeys = Object.keys(source);
|
|
30
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
31
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
32
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
ownKeys.forEach(function(key) {
|
|
36
|
+
_defineProperty(target, key, source[key]);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
}
|
|
41
|
+
import { DataBind, ObjectDataBind } from "@byteluck-fe/model-driven-core";
|
|
42
|
+
import { loopFormSchema, JSONCopy, warn, CONTROL_TYPE, CONTROL_BASE_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
43
|
+
import { loopDataViewControl, loopFormControl, buildUUID } from "../utils/runtimeUtils";
|
|
43
44
|
var Store = /*#__PURE__*/ function() {
|
|
44
45
|
"use strict";
|
|
45
46
|
function Store(props) {
|
|
46
47
|
_classCallCheck(this, Store);
|
|
47
|
-
var
|
|
48
|
+
var _init = init(props.instance), state = _init.state, emptyState = _init.emptyState, databindMapping = _init.databindMapping, controlidMapping = _init.controlidMapping, defaultState = _init.defaultState;
|
|
48
49
|
this.emptyState = emptyState;
|
|
49
50
|
this.state = state;
|
|
50
51
|
this.dataBindMapping = databindMapping;
|
|
51
52
|
this.controlIdMapping = controlidMapping;
|
|
53
|
+
this.defaultState = defaultState;
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/**
|
|
55
|
+
var _proto = Store.prototype;
|
|
56
|
+
/**
|
|
56
57
|
* 使用该方法仅改变数据,不会表单触发事件。明细表可全量赋值也可根据rowIndex进行单独设置
|
|
57
58
|
* @param controlId 组件ID
|
|
58
59
|
* @param value
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (childControlId === controlId) {
|
|
84
|
-
_this1.state[dataView][subtableId][rowIndex][controlId] = value;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
60
|
+
*/ _proto.setState = function setState(controlId, value, rowIndex) {
|
|
61
|
+
var _this = this;
|
|
62
|
+
var controlInfo = this.controlIdMapping[controlId];
|
|
63
|
+
if (controlInfo !== undefined) {
|
|
64
|
+
//qiyu 按照对象赋值,Object.assign会触发多次key的change事件
|
|
65
|
+
this.state[controlInfo.dataView][controlId] = value;
|
|
66
|
+
// if (
|
|
67
|
+
// controlInfo.dataBind instanceof ObjectDataBind &&
|
|
68
|
+
// isPlainObject(value)
|
|
69
|
+
// ) {
|
|
70
|
+
// Object.assign(this.state[controlInfo.dataView][controlId], value)
|
|
71
|
+
// } else {
|
|
72
|
+
// this.state[controlInfo.dataView][controlId] = value
|
|
73
|
+
// }
|
|
74
|
+
} else {
|
|
75
|
+
if (rowIndex !== undefined) {
|
|
76
|
+
//TODO 目前只找了一层明细表,没有递归 如果是添加uid
|
|
77
|
+
Object.keys(this.controlIdMapping).map(function(subtableId) {
|
|
78
|
+
var dataView = _this.controlIdMapping[subtableId].dataView;
|
|
79
|
+
var children = _this.controlIdMapping[subtableId].children;
|
|
80
|
+
if (children !== undefined) {
|
|
81
|
+
Object.keys(children).map(function(childControlId) {
|
|
82
|
+
if (childControlId === controlId) {
|
|
83
|
+
_this.state[dataView][subtableId][rowIndex][controlId] = value;
|
|
87
84
|
}
|
|
88
85
|
});
|
|
89
|
-
} else {
|
|
90
|
-
//不存在的 controlId,直接被挂载到外部key
|
|
91
|
-
this.state[controlId] = value;
|
|
92
86
|
}
|
|
93
|
-
}
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
//不存在的 controlId,直接被挂载到外部key
|
|
90
|
+
this.state[controlId] = value;
|
|
94
91
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var ref;
|
|
121
|
-
state = (ref = _this3.state[dataViewId][subtableId][rowIndex]) === null || ref === void 0 ? void 0 : ref[controlId];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
_proto.getState = function getState(controlId, rowIndex) {
|
|
95
|
+
var _this = this;
|
|
96
|
+
//qiyu 由于header的数据是后补充的,所以从state获取第一层值。
|
|
97
|
+
// const controlInfo = this.controlIdMapping[controlId]
|
|
98
|
+
var detection = this.state[controlId];
|
|
99
|
+
if (detection !== undefined) {
|
|
100
|
+
return this.state[controlId];
|
|
101
|
+
} else {
|
|
102
|
+
var controlInfo = this.controlIdMapping[controlId];
|
|
103
|
+
if (controlInfo !== undefined) {
|
|
104
|
+
return this.state[controlInfo.dataView][controlId];
|
|
105
|
+
} else {
|
|
106
|
+
if (rowIndex !== undefined) {
|
|
107
|
+
var state;
|
|
108
|
+
//TODO 目前只找了一层明细表,没有递归
|
|
109
|
+
Object.keys(this.controlIdMapping).map(function(subtableId) {
|
|
110
|
+
var dataViewId = _this.controlIdMapping[subtableId].dataView;
|
|
111
|
+
var children = _this.controlIdMapping[subtableId].children;
|
|
112
|
+
if (children !== undefined) {
|
|
113
|
+
Object.keys(children).map(function(childControlId) {
|
|
114
|
+
if (childControlId === controlId) {
|
|
115
|
+
var _this_state_dataViewId_subtableId_rowIndex;
|
|
116
|
+
state = (_this_state_dataViewId_subtableId_rowIndex = _this.state[dataViewId][subtableId][rowIndex]) === null || _this_state_dataViewId_subtableId_rowIndex === void 0 ? void 0 : _this_state_dataViewId_subtableId_rowIndex[controlId];
|
|
124
117
|
}
|
|
125
118
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
-
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return state;
|
|
122
|
+
} else {
|
|
123
|
+
var states = [];
|
|
124
|
+
Object.keys(this.controlIdMapping).map(function(subtableId) {
|
|
125
|
+
var dataViewId = _this.controlIdMapping[subtableId].dataView;
|
|
126
|
+
var children = _this.controlIdMapping[subtableId].children;
|
|
127
|
+
if (children !== undefined) {
|
|
128
|
+
Object.keys(children).map(function(childControlId) {
|
|
129
|
+
if (childControlId === controlId) {
|
|
130
|
+
_this.state[dataViewId][subtableId].map(function(item) {
|
|
131
|
+
states.push(item[controlId]);
|
|
141
132
|
});
|
|
142
133
|
}
|
|
143
134
|
});
|
|
144
|
-
return states;
|
|
145
135
|
}
|
|
146
|
-
}
|
|
136
|
+
});
|
|
137
|
+
return states;
|
|
147
138
|
}
|
|
148
139
|
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (childControlId === controlId) {
|
|
178
|
-
state1 = _this4.emptyState[dataViewId][subtableId][controlId];
|
|
179
|
-
}
|
|
180
|
-
});
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
_proto.getEmptyState = function getEmptyState(controlId) {
|
|
143
|
+
var _this = this;
|
|
144
|
+
var detection = this.emptyState[controlId];
|
|
145
|
+
if (detection !== undefined) {
|
|
146
|
+
return this.emptyState[controlId];
|
|
147
|
+
} else {
|
|
148
|
+
var controlInfo = this.controlIdMapping[controlId];
|
|
149
|
+
if (controlInfo !== undefined) {
|
|
150
|
+
var state = this.emptyState[controlInfo.dataView][controlId];
|
|
151
|
+
//判断找到的是否是明细表的控件
|
|
152
|
+
if ("children" in controlInfo) {
|
|
153
|
+
Object.assign(state, {
|
|
154
|
+
uid: "new:" + buildUUID("uid")
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return state;
|
|
158
|
+
} else {
|
|
159
|
+
var state1;
|
|
160
|
+
//TODO 目前只找了一层明细表,没有递归
|
|
161
|
+
Object.keys(this.controlIdMapping).map(function(subtableId) {
|
|
162
|
+
var dataViewId = _this.controlIdMapping[subtableId].dataView;
|
|
163
|
+
var children = _this.controlIdMapping[subtableId].children;
|
|
164
|
+
if (children !== undefined) {
|
|
165
|
+
Object.keys(children).map(function(childControlId) {
|
|
166
|
+
if (childControlId === controlId) {
|
|
167
|
+
state1 = _this.emptyState[dataViewId][subtableId][controlId];
|
|
181
168
|
}
|
|
182
169
|
});
|
|
183
|
-
return state1;
|
|
184
170
|
}
|
|
185
|
-
}
|
|
171
|
+
});
|
|
172
|
+
return state1;
|
|
186
173
|
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
break wrapperFor;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
_proto.getDataBind = function getDataBind(controlId) {
|
|
177
|
+
var result = this.controlIdMapping[controlId];
|
|
178
|
+
if (result) {
|
|
179
|
+
return result.dataBind;
|
|
180
|
+
}
|
|
181
|
+
wrapperFor: for(var id in this.controlIdMapping){
|
|
182
|
+
var dataBindMapping = this.controlIdMapping[id];
|
|
183
|
+
if (dataBindMapping.children) {
|
|
184
|
+
for(var subId in dataBindMapping.children){
|
|
185
|
+
if (subId === controlId) {
|
|
186
|
+
result = dataBindMapping.children[subId];
|
|
187
|
+
break wrapperFor;
|
|
204
188
|
}
|
|
205
189
|
}
|
|
206
|
-
return result === null || result === void 0 ? void 0 : result.dataBind;
|
|
207
190
|
}
|
|
208
191
|
}
|
|
209
|
-
|
|
192
|
+
return result === null || result === void 0 ? void 0 : result.dataBind;
|
|
193
|
+
};
|
|
210
194
|
return Store;
|
|
211
195
|
}();
|
|
212
196
|
function init(instance) {
|
|
@@ -214,6 +198,7 @@ function init(instance) {
|
|
|
214
198
|
var emptyState = {};
|
|
215
199
|
var databindMapping = {};
|
|
216
200
|
var controlidMapping = {};
|
|
201
|
+
var defaultState = {};
|
|
217
202
|
// loopFormControl(instance, (item, children) => {
|
|
218
203
|
// })
|
|
219
204
|
// @ts-ignore
|
|
@@ -229,11 +214,13 @@ function init(instance) {
|
|
|
229
214
|
buildDataBindMapping(databindMapping, dvId, item);
|
|
230
215
|
buildControlIdMapping(controlidMapping, dvId, item);
|
|
231
216
|
});
|
|
232
|
-
state[dvId] =
|
|
217
|
+
state[dvId] = {};
|
|
218
|
+
defaultState[dvId] = dataViewState;
|
|
233
219
|
emptyState[dvId] = emptyDataViewState;
|
|
234
220
|
});
|
|
235
221
|
return {
|
|
236
222
|
state: state,
|
|
223
|
+
defaultState: defaultState,
|
|
237
224
|
emptyState: emptyState,
|
|
238
225
|
databindMapping: databindMapping,
|
|
239
226
|
controlidMapping: controlidMapping
|
|
@@ -244,41 +231,43 @@ item) {
|
|
|
244
231
|
//if (item instanceof RuntimeFormControl) {
|
|
245
232
|
if (item.controlType === CONTROL_BASE_TYPE.FORM) {
|
|
246
233
|
// 2023-4-2 jiaqi 首次进入页面去除填充默认值
|
|
247
|
-
|
|
234
|
+
dataViewState[item.id] = JSONCopy(item.props.defaultValue);
|
|
248
235
|
emptyDataViewState[item.id] = JSONCopy(item.props.defaultValue);
|
|
249
236
|
} else {
|
|
250
237
|
var emptyTemplate = {};
|
|
251
238
|
loopFormSchema(item.props.headers, function(headerItem) {
|
|
252
239
|
emptyTemplate[headerItem.id] = JSONCopy(headerItem.props.defaultValue);
|
|
253
240
|
});
|
|
254
|
-
var
|
|
255
|
-
dataViewState[item.id] = new Array((
|
|
256
|
-
return
|
|
241
|
+
var _item_props_defaultRows;
|
|
242
|
+
dataViewState[item.id] = new Array((_item_props_defaultRows = item.props.defaultRows) !== null && _item_props_defaultRows !== void 0 ? _item_props_defaultRows : 1).fill(0).map(function() {
|
|
243
|
+
return _objectSpread({
|
|
244
|
+
uid: "new:" + buildUUID("uid")
|
|
245
|
+
}, JSONCopy(emptyTemplate));
|
|
257
246
|
});
|
|
258
247
|
emptyDataViewState[item.id] = emptyTemplate;
|
|
259
248
|
}
|
|
260
249
|
}
|
|
261
250
|
function buildDataBindMapping(data, dataViewId, // @ts-ignore
|
|
262
|
-
|
|
251
|
+
item) {
|
|
263
252
|
// if (item instanceof RuntimeFormControl) {
|
|
264
|
-
if (
|
|
265
|
-
var
|
|
266
|
-
if (_instanceof(
|
|
253
|
+
if (item.controlType === CONTROL_BASE_TYPE.FORM) {
|
|
254
|
+
var _item_props, _item_props_dataBind;
|
|
255
|
+
if (_instanceof(item.props.dataBind, ObjectDataBind)) {
|
|
267
256
|
// 特殊的dataBind,比如:金额是currency+amount两个key组成的,日期区间,继承自ObjectDataBind的需要通过Object.keys拿到多个databind
|
|
268
|
-
Object.keys(
|
|
269
|
-
var dataBind =
|
|
257
|
+
Object.keys(item.props.dataBind).map(function(key) {
|
|
258
|
+
var dataBind = item.props.dataBind;
|
|
270
259
|
var dataCode = dataBind[key].dataCode;
|
|
271
260
|
if (dataCode !== undefined) {
|
|
272
261
|
if (data[dataCode] === undefined) {
|
|
273
262
|
data[dataCode] = {
|
|
274
|
-
controlId:
|
|
263
|
+
controlId: item.id,
|
|
275
264
|
fields: [],
|
|
276
265
|
dataViewId: dataViewId
|
|
277
266
|
};
|
|
278
267
|
}
|
|
279
268
|
data[dataCode].fields.push({
|
|
280
269
|
fieldCode: dataBind[key].fieldCode,
|
|
281
|
-
controlId:
|
|
270
|
+
controlId: item.id,
|
|
282
271
|
dataBind: dataBind,
|
|
283
272
|
dataViewId: [
|
|
284
273
|
dataViewId
|
|
@@ -286,38 +275,38 @@ item1) {
|
|
|
286
275
|
});
|
|
287
276
|
}
|
|
288
277
|
});
|
|
289
|
-
} else if (((
|
|
278
|
+
} else if (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : (_item_props_dataBind = _item_props.dataBind) === null || _item_props_dataBind === void 0 ? void 0 : _item_props_dataBind.dataCode) === undefined) {
|
|
290
279
|
//qiyu 2023-2-27 为空跳过。form自定义组件加载失败时,hack的组件props为空。
|
|
291
280
|
} else {
|
|
292
|
-
if (data[
|
|
293
|
-
data[
|
|
281
|
+
if (data[item.props.dataBind.dataCode] === undefined) {
|
|
282
|
+
data[item.props.dataBind.dataCode] = {
|
|
294
283
|
controlId: dataViewId,
|
|
295
284
|
fields: [],
|
|
296
285
|
dataViewId: dataViewId
|
|
297
286
|
};
|
|
298
287
|
}
|
|
299
|
-
data[
|
|
300
|
-
fieldCode:
|
|
301
|
-
controlId:
|
|
302
|
-
dataBind:
|
|
288
|
+
data[item.props.dataBind.dataCode].fields.push({
|
|
289
|
+
fieldCode: item.props.dataBind.fieldCode,
|
|
290
|
+
controlId: item.id,
|
|
291
|
+
dataBind: item.props.dataBind,
|
|
303
292
|
dataViewId: [
|
|
304
293
|
dataViewId
|
|
305
294
|
]
|
|
306
295
|
});
|
|
307
296
|
}
|
|
308
297
|
} else {
|
|
309
|
-
if (
|
|
298
|
+
if (item.props.datasourceBind.dataCode === "") {
|
|
310
299
|
//敏捷依赖后端生成dataCode,预览的时候没有
|
|
311
|
-
warn("datasourceBind.dataCode is empty! maybe in preview mode, control:".concat(
|
|
300
|
+
warn("datasourceBind.dataCode is empty! maybe in preview mode, control:".concat(item.id, " type:").concat(item.type));
|
|
312
301
|
return;
|
|
313
302
|
}
|
|
314
|
-
data[
|
|
315
|
-
controlId:
|
|
303
|
+
data[item.props.datasourceBind.dataCode] = {
|
|
304
|
+
controlId: item.id,
|
|
316
305
|
fields: [],
|
|
317
306
|
dataViewId: dataViewId
|
|
318
307
|
};
|
|
319
|
-
var subtableId =
|
|
320
|
-
loopFormSchema(
|
|
308
|
+
var subtableId = item.id;
|
|
309
|
+
loopFormSchema(item.props.headers, function(item) {
|
|
321
310
|
if (_instanceof(item.props.dataBind, ObjectDataBind)) {
|
|
322
311
|
Object.keys(item.props.dataBind).map(function(key) {
|
|
323
312
|
var dataBind = item.props.dataBind;
|
|
@@ -359,16 +348,16 @@ item) {
|
|
|
359
348
|
data[item.id] = {
|
|
360
349
|
dataBind: new DataBind({
|
|
361
350
|
dataCode: item.props.datasourceBind.dataCode,
|
|
362
|
-
fieldCode:
|
|
351
|
+
fieldCode: ""
|
|
363
352
|
}),
|
|
364
353
|
dataView: dataViewId,
|
|
365
354
|
children: {},
|
|
366
355
|
options: []
|
|
367
356
|
};
|
|
368
357
|
loopFormSchema(item.props.headers, function(formControl) {
|
|
369
|
-
var
|
|
370
|
-
var
|
|
371
|
-
Object.assign((
|
|
358
|
+
var _data_item_id;
|
|
359
|
+
var _data_item_id_children;
|
|
360
|
+
Object.assign((_data_item_id_children = (_data_item_id = data[item.id]) === null || _data_item_id === void 0 ? void 0 : _data_item_id.children) !== null && _data_item_id_children !== void 0 ? _data_item_id_children : {}, _defineProperty({}, formControl.id, {
|
|
372
361
|
dataBind: formControl.props.dataBind
|
|
373
362
|
}));
|
|
374
363
|
});
|