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