@byteluck-fe/model-driven-engine 2.3.1-beta.13 → 2.3.1-beta.18
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/Store.js +12 -46
- package/dist/index.umd.js +7 -7
- package/dist/types/common/Store.d.ts +1 -1
- package/package.json +4 -4
package/dist/esm/common/Store.js
CHANGED
|
@@ -23,45 +23,6 @@ function _instanceof(left, right) {
|
|
|
23
23
|
return left instanceof right;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
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
|
-
function ownKeys(object, enumerableOnly) {
|
|
42
|
-
var keys = Object.keys(object);
|
|
43
|
-
if (Object.getOwnPropertySymbols) {
|
|
44
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
45
|
-
if (enumerableOnly) {
|
|
46
|
-
symbols = symbols.filter(function(sym) {
|
|
47
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
keys.push.apply(keys, symbols);
|
|
51
|
-
}
|
|
52
|
-
return keys;
|
|
53
|
-
}
|
|
54
|
-
function _objectSpreadProps(target, source) {
|
|
55
|
-
source = source != null ? source : {};
|
|
56
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
57
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
58
|
-
} else {
|
|
59
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
60
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return target;
|
|
64
|
-
}
|
|
65
26
|
import { DataBind, ObjectDataBind } from "@byteluck-fe/model-driven-core";
|
|
66
27
|
import { loopFormSchema, JSONCopy, warn, CONTROL_TYPE, CONTROL_BASE_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
67
28
|
import { loopDataViewControl, loopFormControl, buildUUID } from "../utils/runtimeUtils";
|
|
@@ -96,7 +57,7 @@ var Store = /*#__PURE__*/ function() {
|
|
|
96
57
|
// }
|
|
97
58
|
} else {
|
|
98
59
|
if (rowIndex !== undefined) {
|
|
99
|
-
//TODO 目前只找了一层明细表,没有递归
|
|
60
|
+
//TODO 目前只找了一层明细表,没有递归 如果是添加uid
|
|
100
61
|
Object.keys(this.controlIdMapping).map(function(subtableId) {
|
|
101
62
|
var dataView = _this.controlIdMapping[subtableId].dataView;
|
|
102
63
|
var children = _this.controlIdMapping[subtableId].children;
|
|
@@ -170,9 +131,16 @@ var Store = /*#__PURE__*/ function() {
|
|
|
170
131
|
} else {
|
|
171
132
|
var controlInfo = this.controlIdMapping[controlId];
|
|
172
133
|
if (controlInfo !== undefined) {
|
|
173
|
-
|
|
134
|
+
var state = this.emptyState[controlInfo.dataView][controlId];
|
|
135
|
+
//判断找到的是否是明细表的控件
|
|
136
|
+
if ("children" in controlInfo) {
|
|
137
|
+
Object.assign(state, {
|
|
138
|
+
uid: "new:" + buildUUID("uid")
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return state;
|
|
174
142
|
} else {
|
|
175
|
-
var
|
|
143
|
+
var state1;
|
|
176
144
|
//TODO 目前只找了一层明细表,没有递归
|
|
177
145
|
Object.keys(this.controlIdMapping).map(function(subtableId) {
|
|
178
146
|
var dataViewId = _this.controlIdMapping[subtableId].dataView;
|
|
@@ -180,14 +148,12 @@ var Store = /*#__PURE__*/ function() {
|
|
|
180
148
|
if (children !== undefined) {
|
|
181
149
|
Object.keys(children).map(function(childControlId) {
|
|
182
150
|
if (childControlId === controlId) {
|
|
183
|
-
|
|
184
|
-
uid: "new:" + buildUUID("uid")
|
|
185
|
-
});
|
|
151
|
+
state1 = _this.emptyState[dataViewId][subtableId][controlId];
|
|
186
152
|
}
|
|
187
153
|
});
|
|
188
154
|
}
|
|
189
155
|
});
|
|
190
|
-
return
|
|
156
|
+
return state1;
|
|
191
157
|
}
|
|
192
158
|
}
|
|
193
159
|
};
|