@byteluck-fe/model-driven-driven 2.7.0-alpha.3 → 2.7.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/Store.js CHANGED
@@ -28,22 +28,9 @@ function _createClass(Constructor, protoProps, staticProps) {
28
28
  if (staticProps) _defineProperties(Constructor, staticProps);
29
29
  return Constructor;
30
30
  }
31
- function _defineProperty(obj, key, value) {
32
- if (key in obj) {
33
- Object.defineProperty(obj, key, {
34
- value: value,
35
- enumerable: true,
36
- configurable: true,
37
- writable: true
38
- });
39
- } else {
40
- obj[key] = value;
41
- }
42
- return obj;
43
- }
44
31
  function _instanceof(left, right) {
45
32
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
46
- return !!right[Symbol.hasInstance](left);
33
+ return right[Symbol.hasInstance](left);
47
34
  } else {
48
35
  return left instanceof right;
49
36
  }
@@ -95,58 +82,37 @@ function _unsupportedIterableToArray(o, minLen) {
95
82
  if (n === "Map" || n === "Set") return Array.from(n);
96
83
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
97
84
  }
98
- import { DataBind } from "@byteluck-fe/model-driven-core";
99
- import { hasChildrenControl, hasHeaderControl } from "./designerUtils";
100
- import { Group } from "@byteluck-fe/model-driven-settings";
101
- import { CONTROL_BASE_TYPE, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
85
+ import { DataBind } from '@byteluck-fe/model-driven-core';
86
+ import { hasChildrenControl, hasHeaderControl } from './designerUtils';
87
+ import { Group } from '@byteluck-fe/model-driven-settings';
88
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE } from '@byteluck-fe/model-driven-shared';
102
89
  // 维护当前selected,。。 selectedControlSetting
103
90
  export var Store = /*#__PURE__*/ function() {
104
91
  "use strict";
105
92
  function Store(options) {
106
93
  _classCallCheck(this, Store);
107
94
  /**
108
- * 页面控件实例树
109
- * */ _defineProperty(this, "instance", void 0);
110
- /**
111
- * 拍平的控件数组
112
- * */ _defineProperty(this, "flatInstances", void 0);
113
- /**
114
- * 控件id组成的map
115
- * */ _defineProperty(this, "instanceIdMap", void 0);
116
- /**
117
- * dataCode和fieldCode组成的map
118
- * {
119
- * [主表dataCode]: {
120
- * [fieldCode]: 控件
121
- * },
122
- * [子表dataCode]: {
123
- * [fieldCode]: 控件
124
- * }
125
- * }
126
- * */ _defineProperty(this, "dataFieldCodeMap", void 0);
127
- /**
128
95
  * 当前选中的控件
129
- * */ _defineProperty(this, "selected", null);
96
+ * */ this.selected = null;
130
97
  /**
131
98
  * 当前选中的数据作用域控件
132
- * */ _defineProperty(this, "selectedInstanceDataScopeParent", null);
133
- _defineProperty(this, "selectedDataScopeFlatInstances", []);
99
+ * */ this.selectedInstanceDataScopeParent = null;
100
+ this.selectedDataScopeFlatInstances = [];
134
101
  /**
135
102
  * 当前选中控件的setting
136
- * */ _defineProperty(this, "selectedInstanceSetting", []);
137
- _defineProperty(this, "selectedInstanceSettingItems", []);
103
+ * */ this.selectedInstanceSetting = [];
104
+ this.selectedInstanceSettingItems = [];
138
105
  /**
139
106
  * 当前选中控件的数据模型
140
- * */ _defineProperty(this, "selectedFieldItem", null);
107
+ * */ this.selectedFieldItem = null;
141
108
  /**
142
109
  * 扩展字段,比如appId,dataCode等
143
- * */ _defineProperty(this, "external", {});
144
- _defineProperty(this, "movingInstance", null);
145
- _defineProperty(this, "movingInstanceOldParent", null);
146
- _defineProperty(this, "movingInstanceOldDataScopeParent", null);
147
- _defineProperty(this, "getParentBeforeInstanceMove", void 0);
148
- var _options_getParentBeforeInstanceMove;
149
- this.getParentBeforeInstanceMove = (_options_getParentBeforeInstanceMove = options.getParentBeforeInstanceMove) !== null && _options_getParentBeforeInstanceMove !== void 0 ? _options_getParentBeforeInstanceMove : function(instance) {
110
+ * */ this.external = {};
111
+ this.movingInstance = null;
112
+ this.movingInstanceOldParent = null;
113
+ this.movingInstanceOldDataScopeParent = null;
114
+ var _getParentBeforeInstanceMove;
115
+ this.getParentBeforeInstanceMove = (_getParentBeforeInstanceMove = options.getParentBeforeInstanceMove) !== null && _getParentBeforeInstanceMove !== void 0 ? _getParentBeforeInstanceMove : function(instance) {
150
116
  return instance.parent;
151
117
  };
152
118
  this.instance = options.instance;
@@ -199,8 +165,8 @@ export var Store = /*#__PURE__*/ function() {
199
165
  this.selectedInstanceSetting = settings;
200
166
  this.selectedInstanceSettingItems = [];
201
167
  this.selectedInstanceSetting.forEach(function(group) {
202
- var _this_selectedInstanceSettingItems;
203
- (_this_selectedInstanceSettingItems = _this.selectedInstanceSettingItems).push.apply(_this_selectedInstanceSettingItems, _toConsumableArray(_this.getSettingItems(group)));
168
+ var _selectedInstanceSettingItems;
169
+ (_selectedInstanceSettingItems = _this.selectedInstanceSettingItems).push.apply(_selectedInstanceSettingItems, _toConsumableArray(_this.getSettingItems(group)));
204
170
  });
205
171
  }
206
172
  },
@@ -242,7 +208,7 @@ export var Store = /*#__PURE__*/ function() {
242
208
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
243
209
  try {
244
210
  for(var _iterator = map.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
245
- var _step_value = _slicedToArray(_step.value, 2), key = _step_value[0], value = _step_value[1];
211
+ var _value = _slicedToArray(_step.value, 2), key = _value[0], value = _value[1];
246
212
  if (value.id === instance.id) {
247
213
  map.delete(key);
248
214
  break;
@@ -324,7 +290,7 @@ export function isDataScopeInstance(instance) {
324
290
  return [
325
291
  CONTROL_TYPE.SUBTABLE,
326
292
  CONTROL_TYPE.DATA_VIEW,
327
- CONTROL_TYPE.LIST_VIEW
293
+ CONTROL_TYPE.LIST_VIEW,
328
294
  ].includes(instance.type);
329
295
  }
330
296
  export function findInstanceDataScopeParent(instance) {
@@ -1,33 +1,33 @@
1
- import { CONTROL_TYPE, FieldTypes } from "@byteluck-fe/model-driven-shared";
1
+ import { CONTROL_TYPE, FieldTypes } from '@byteluck-fe/model-driven-shared';
2
2
  // 使用ObjectDataBind 的控件
3
3
  export var objectDataBindControlTypes = [
4
4
  CONTROL_TYPE.AMOUNT,
5
5
  CONTROL_TYPE.CALC,
6
- CONTROL_TYPE.DATE_RANGE
6
+ CONTROL_TYPE.DATE_RANGE,
7
7
  ];
8
8
  export var objectDataBindKeyToFieldType = {
9
9
  amount: {
10
- caption: "金额",
10
+ caption: '金额',
11
11
  fieldType: FieldTypes.DECIMAL
12
12
  },
13
13
  currency: {
14
- caption: "币种",
14
+ caption: '币种',
15
15
  fieldType: FieldTypes.VARCHAR
16
16
  },
17
17
  result: {
18
- caption: "结果",
18
+ caption: '结果',
19
19
  fieldType: FieldTypes.DECIMAL
20
20
  },
21
21
  unit: {
22
- caption: "单位",
22
+ caption: '单位',
23
23
  fieldType: FieldTypes.VARCHAR
24
24
  },
25
25
  min: {
26
- caption: "开始时间",
26
+ caption: '开始时间',
27
27
  fieldType: FieldTypes.TIMESTAMP
28
28
  },
29
29
  max: {
30
- caption: "结束时间",
30
+ caption: '结束时间',
31
31
  fieldType: FieldTypes.TIMESTAMP
32
32
  }
33
33
  };
@@ -1,9 +1,9 @@
1
- import { CONTROL_BASE_TYPE, CONTROL_TYPE, isArray } from "@byteluck-fe/model-driven-shared";
1
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE, isArray } from '@byteluck-fe/model-driven-shared';
2
2
  export function hasChildrenControl(instance) {
3
- return "children" in instance && isArray(instance.children);
3
+ return 'children' in instance && isArray(instance.children);
4
4
  }
5
5
  export function hasHeaderControl(instance) {
6
- return "headers" in instance.props && isArray(instance.props.headers);
6
+ return 'headers' in instance.props && isArray(instance.props.headers);
7
7
  }
8
8
  export function loopFormControl(control, callback) {
9
9
  if (Array.isArray(control)) {
@@ -14,8 +14,9 @@ export function loopFormControl(control, callback) {
14
14
  // @ts-ignore
15
15
  loopFormControl(item.props.headers, callback);
16
16
  } else if (hasChildrenControl(item)) {
17
- loopFormControl(// @ts-ignore
18
- item === null || item === void 0 ? void 0 : item.children, callback);
17
+ var // @ts-ignore
18
+ ref;
19
+ loopFormControl((ref = (item)) === null || ref === void 0 ? void 0 : ref.children, callback);
19
20
  // @ts-ignore
20
21
  // } else if (item instanceof DesignerFormControl) {
21
22
  } else if (item.controlType === CONTROL_BASE_TYPE.FORM) {
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import Designer from "./Designer";
1
+ import Designer from './Designer';
2
2
  export { Designer };
3
- export * from "./utils";
4
- export * from "./Builder";
5
- export * from "./designerUtils";
6
- export * from "./Driven";
7
- export * from "./Store";
3
+ export * from './utils';
4
+ export * from './Builder';
5
+ export * from './designerUtils';
6
+ export * from './Driven';
7
+ export * from './Store';
package/dist/esm/utils.js CHANGED
@@ -85,105 +85,11 @@ function _unsupportedIterableToArray(o, minLen) {
85
85
  if (n === "Map" || n === "Set") return Array.from(n);
86
86
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
87
87
  }
88
- var __generator = this && this.__generator || function(thisArg, body) {
89
- var f, y, t, g, _ = {
90
- label: 0,
91
- sent: function() {
92
- if (t[0] & 1) throw t[1];
93
- return t[1];
94
- },
95
- trys: [],
96
- ops: []
97
- };
98
- return g = {
99
- next: verb(0),
100
- "throw": verb(1),
101
- "return": verb(2)
102
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
103
- return this;
104
- }), g;
105
- function verb(n) {
106
- return function(v) {
107
- return step([
108
- n,
109
- v
110
- ]);
111
- };
112
- }
113
- function step(op) {
114
- if (f) throw new TypeError("Generator is already executing.");
115
- while(_)try {
116
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
117
- if (y = 0, t) op = [
118
- op[0] & 2,
119
- t.value
120
- ];
121
- switch(op[0]){
122
- case 0:
123
- case 1:
124
- t = op;
125
- break;
126
- case 4:
127
- _.label++;
128
- return {
129
- value: op[1],
130
- done: false
131
- };
132
- case 5:
133
- _.label++;
134
- y = op[1];
135
- op = [
136
- 0
137
- ];
138
- continue;
139
- case 7:
140
- op = _.ops.pop();
141
- _.trys.pop();
142
- continue;
143
- default:
144
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
145
- _ = 0;
146
- continue;
147
- }
148
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
149
- _.label = op[1];
150
- break;
151
- }
152
- if (op[0] === 6 && _.label < t[1]) {
153
- _.label = t[1];
154
- t = op;
155
- break;
156
- }
157
- if (t && _.label < t[2]) {
158
- _.label = t[2];
159
- _.ops.push(op);
160
- break;
161
- }
162
- if (t[2]) _.ops.pop();
163
- _.trys.pop();
164
- continue;
165
- }
166
- op = body.call(thisArg, _);
167
- } catch (e) {
168
- op = [
169
- 6,
170
- e
171
- ];
172
- y = 0;
173
- } finally{
174
- f = t = 0;
175
- }
176
- if (op[0] & 5) throw op[1];
177
- return {
178
- value: op[0] ? op[1] : void 0,
179
- done: true
180
- };
181
- }
182
- };
183
- import { loopFormControl } from "./designerUtils";
184
- import { CONTROL_BASE_TYPE, CONTROL_TYPE, FieldTypeToColumnType, isArray } from "@byteluck-fe/model-driven-shared";
185
- import Designer from "./Designer";
186
- import { objectDataBindControlTypes, objectDataBindKeyToFieldType } from "./constants";
88
+ import regeneratorRuntime from "regenerator-runtime";
89
+ import { loopFormControl } from './designerUtils';
90
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE, FieldTypeToColumnType, isArray } from '@byteluck-fe/model-driven-shared';
91
+ import Designer from './Designer';
92
+ import { objectDataBindControlTypes, objectDataBindKeyToFieldType } from './constants';
187
93
  export function getMasterFormControls(controls) {
188
94
  var formctls = [];
189
95
  // @ts-ignore
@@ -199,7 +105,7 @@ export function getMasterFormControls(controls) {
199
105
  * @description 给modelBindInfoList中填充fieldCode和dataCode
200
106
  * @description 我们生成fieldCode的规则是:DataBind的控件,取`field_${id}`,ObjectDataBind的控件,取`field_${id}_${key}`, key指的是ObjectDataBind.keys()
201
107
  * */ export function fillModelBindInfoListFieldCode(modelBindInfoList) {
202
- var dataCode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
108
+ var dataCode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
203
109
  if (!modelBindInfoList || !Array.isArray(modelBindInfoList)) return [];
204
110
  return modelBindInfoList.map(function(item) {
205
111
  if (!item.dataBind) return item;
@@ -210,7 +116,7 @@ export function getMasterFormControls(controls) {
210
116
  Object.keys(objectDataBind).forEach(function(key) {
211
117
  var dataBind = objectDataBind[key];
212
118
  // 如果是ObjectDataBind的话,需要将id拼接当前的key作为元素的fieldCode
213
- var fieldCode = item.controlId + "_" + key;
119
+ var fieldCode = item.controlId + '_' + key;
214
120
  dataBind.fieldCode = fieldCodeBeforeAddPrefix(fieldCode);
215
121
  dataBind.dataCode = dataCode;
216
122
  });
@@ -222,7 +128,7 @@ export function getMasterFormControls(controls) {
222
128
  });
223
129
  }
224
130
  function fieldCodeBeforeAddPrefix(fieldCode) {
225
- var prefix = "field_";
131
+ var prefix = 'field_';
226
132
  if (fieldCode.startsWith(prefix)) {
227
133
  return fieldCode;
228
134
  }
@@ -252,7 +158,7 @@ function fieldCodeBeforeAddPrefix(fieldCode) {
252
158
  // 当前key对应的fieldType
253
159
  var fieldType = objectDataBindKeyToFieldType[key].fieldType;
254
160
  // 拼接当前列的caption
255
- var caption = item.caption + "_" + objectDataBindKeyToFieldType[key].caption;
161
+ var caption = item.caption + '_' + objectDataBindKeyToFieldType[key].caption;
256
162
  // 通过fieldType获取列类型
257
163
  var controlType = getColumnTypeFromFiledType(fieldType);
258
164
  if (!controlType) return;
@@ -260,8 +166,8 @@ function fieldCodeBeforeAddPrefix(fieldCode) {
260
166
  caption: caption,
261
167
  dataBind: dataBind
262
168
  };
263
- if (key === "currency") {
264
- props.optionConfig = "datasource";
169
+ if (key === 'currency') {
170
+ props.optionConfig = 'datasource';
265
171
  props.datasourceBind = datasourceBind;
266
172
  }
267
173
  // @ts-ignore
@@ -271,17 +177,17 @@ function fieldCodeBeforeAddPrefix(fieldCode) {
271
177
  column && columns.push(column);
272
178
  });
273
179
  } else {
274
- var controlType = getColumnTypeFromFiledType(item.fieldType);
275
- if (!controlType) return;
180
+ var controlType1 = getColumnTypeFromFiledType(item.fieldType);
181
+ if (!controlType1) return;
276
182
  // @ts-ignore
277
- var column = designer.createControlInstance(controlType, {
183
+ var column1 = designer.createControlInstance(controlType1, {
278
184
  props: {
279
185
  caption: item.caption,
280
186
  dataBind: item.dataBind,
281
187
  datasourceBind: item.datasourceBind
282
188
  }
283
189
  });
284
- column && columns.push(column);
190
+ column1 && columns.push(column1);
285
191
  }
286
192
  });
287
193
  return columns;
@@ -320,42 +226,35 @@ function checkSchema(controls, messages, ignore) {
320
226
  return _checkSchema.apply(this, arguments);
321
227
  }
322
228
  function _checkSchema() {
323
- _checkSchema = _asyncToGenerator(function(controls, messages, ignore) {
229
+ _checkSchema = _asyncToGenerator(regeneratorRuntime.mark(function _callee(controls, messages, ignore) {
324
230
  var result;
325
- return __generator(this, function(_state) {
326
- switch(_state.label){
231
+ return regeneratorRuntime.wrap(function _callee$(_ctx) {
232
+ while(1)switch(_ctx.prev = _ctx.next){
327
233
  case 0:
328
- if (!Array.isArray(controls)) return [
329
- 3,
330
- 2
331
- ];
332
- return [
333
- 4,
334
- Promise.all(controls.map(function(control) {
335
- return control.validate(messages, ignore);
336
- }))
337
- ];
338
- case 1:
339
- result = _state.sent();
340
- return [
341
- 2,
342
- result.every(function(state) {
343
- return state;
344
- })
345
- ];
346
- case 2:
347
- return [
348
- 4,
349
- controls.validate(messages, ignore)
350
- ];
234
+ if (!Array.isArray(controls)) {
235
+ _ctx.next = 5;
236
+ break;
237
+ }
238
+ _ctx.next = 3;
239
+ return Promise.all(controls.map(function(control) {
240
+ return control.validate(messages, ignore);
241
+ }));
351
242
  case 3:
352
- return [
353
- 2,
354
- _state.sent()
355
- ];
243
+ result = _ctx.sent;
244
+ return _ctx.abrupt("return", result.every(function(state) {
245
+ return state;
246
+ }));
247
+ case 5:
248
+ _ctx.next = 7;
249
+ return controls.validate(messages, ignore);
250
+ case 7:
251
+ return _ctx.abrupt("return", _ctx.sent);
252
+ case 8:
253
+ case "end":
254
+ return _ctx.stop();
356
255
  }
357
- });
358
- });
256
+ }, _callee);
257
+ }));
359
258
  return _checkSchema.apply(this, arguments);
360
259
  }
361
260
  // 不可以被权限控制的控件
@@ -387,46 +286,46 @@ var cannotEditControlTypes = [
387
286
  // 列表操作列单独处理三个按钮的权限
388
287
  var LIST_OPERATION_BUTTON_PERMISSIONS_MAPS = {
389
288
  check: {
390
- id: "listPageCheckBtnId",
391
- caption: "查看"
289
+ id: 'listPageCheckBtnId',
290
+ caption: '查看'
392
291
  },
393
292
  edit: {
394
- id: "listPageEditBtnId",
395
- caption: "编辑"
293
+ id: 'listPageEditBtnId',
294
+ caption: '编辑'
396
295
  },
397
296
  delete: {
398
- id: "listPageDeleteBtnId",
399
- caption: "删除"
297
+ id: 'listPageDeleteBtnId',
298
+ caption: '删除'
400
299
  }
401
300
  };
402
301
  // 生成权限字段
403
302
  function generatePermissions(controls, parent) {
404
- var result = [];
303
+ var result1 = [];
405
304
  if (isArray(controls)) {
406
305
  var _result;
407
- (_result = result).push.apply(_result, _toConsumableArray(controls.map(function(item) {
306
+ (_result = result1).push.apply(_result, _toConsumableArray(controls.map(function(item) {
408
307
  return generatePermissions(item, parent);
409
308
  }).flat()));
410
309
  } else {
411
310
  var type = controls.type;
412
- var _controls_props = controls.props, caption = _controls_props.caption, content = _controls_props.content;
311
+ var _props = controls.props, caption1 = _props.caption, content = _props.content;
413
312
  var permissionItem;
414
313
  if (!PermissionExcludeControlTypes.includes(type)) {
415
- var _parent_controlId;
314
+ var ref;
416
315
  permissionItem = {
417
316
  controlId: controls.id,
418
- caption: caption || content || controls.name,
317
+ caption: caption1 || content || controls.name,
419
318
  type: controls.type,
420
319
  controlType: controls.controlType,
421
- parentId: (_parent_controlId = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && _parent_controlId !== void 0 ? _parent_controlId : null,
320
+ parentId: (ref = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && ref !== void 0 ? ref : null,
422
321
  canEdit: !cannotEditControlTypes.includes(type),
423
322
  canRead: true,
424
323
  canHide: true,
425
- group: "element"
324
+ group: 'element'
426
325
  };
427
326
  if (parent && parent.type === CONTROL_TYPE.SUBTABLE) {
428
327
  // 如果有parent,则利用下划线拼接caption
429
- permissionItem.caption = parent.caption + "_" + permissionItem.caption;
328
+ permissionItem.caption = parent.caption + '_' + permissionItem.caption;
430
329
  }
431
330
  if (type === CONTROL_TYPE.VUE_FORM_ITEM) {
432
331
  permissionItem.caption = controls.props.controlExportName || controls.name;
@@ -437,59 +336,59 @@ function generatePermissions(controls, parent) {
437
336
  // ) {
438
337
  if (controls.controlType === CONTROL_BASE_TYPE.FORM || controls.controlType === CONTROL_BASE_TYPE.COLUMN) {
439
338
  var //@ts-ignore
440
- _controls_props1, _controls_props_dataBind, //@ts-ignore
441
- _controls_props2, _controls_props_dataBind1;
442
- if (((_controls_props1 = controls.props) === null || _controls_props1 === void 0 ? void 0 : (_controls_props_dataBind = _controls_props1.dataBind) === null || _controls_props_dataBind === void 0 ? void 0 : _controls_props_dataBind.fieldCode) !== undefined && ((_controls_props2 = controls.props) === null || _controls_props2 === void 0 ? void 0 : (_controls_props_dataBind1 = _controls_props2.dataBind) === null || _controls_props_dataBind1 === void 0 ? void 0 : _controls_props_dataBind1.fieldCode) !== "") {
443
- permissionItem.group = "field";
339
+ ref1, ref2, //@ts-ignore
340
+ ref3, ref4;
341
+ if (((ref1 = controls.props) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.dataBind) === null || ref2 === void 0 ? void 0 : ref2.fieldCode) !== undefined && ((ref3 = controls.props) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.dataBind) === null || ref4 === void 0 ? void 0 : ref4.fieldCode) !== '') {
342
+ permissionItem.group = 'field';
444
343
  }
445
344
  }
446
- result.push(permissionItem);
345
+ result1.push(permissionItem);
447
346
  //追加vue容器权限
448
347
  if (type === CONTROL_TYPE.VUE_FORM_ITEM) {
449
- var _controls_props3, _controls_props_dataBind2, _controls_props4, _controls_props_dataBind3;
450
- var vueFormItemGroup = "element";
451
- if (((_controls_props3 = controls.props) === null || _controls_props3 === void 0 ? void 0 : (_controls_props_dataBind2 = _controls_props3.dataBind) === null || _controls_props_dataBind2 === void 0 ? void 0 : _controls_props_dataBind2.fieldCode) !== undefined && ((_controls_props4 = controls.props) === null || _controls_props4 === void 0 ? void 0 : (_controls_props_dataBind3 = _controls_props4.dataBind) === null || _controls_props_dataBind3 === void 0 ? void 0 : _controls_props_dataBind3.fieldCode) !== "") {
452
- vueFormItemGroup = "field";
348
+ var ref5, ref6, ref7, ref8;
349
+ var vueFormItemGroup = 'element';
350
+ if (((ref5 = controls.props) === null || ref5 === void 0 ? void 0 : (ref6 = ref5.dataBind) === null || ref6 === void 0 ? void 0 : ref6.fieldCode) !== undefined && ((ref7 = controls.props) === null || ref7 === void 0 ? void 0 : (ref8 = ref7.dataBind) === null || ref8 === void 0 ? void 0 : ref8.fieldCode) !== '') {
351
+ vueFormItemGroup = 'field';
453
352
  }
454
- var permissions = controls.props["permissions"];
353
+ var permissions = controls.props['permissions'];
455
354
  permissions === null || permissions === void 0 ? void 0 : permissions.map(function(item) {
456
- var _controls_id;
355
+ var _id;
457
356
  permissionItem = {
458
357
  controlId: item.key,
459
358
  caption: item.caption,
460
359
  type: controls.type,
461
360
  controlType: controls.controlType,
462
- parentId: (_controls_id = controls.id) !== null && _controls_id !== void 0 ? _controls_id : null,
361
+ parentId: (_id = controls.id) !== null && _id !== void 0 ? _id : null,
463
362
  canEdit: true,
464
363
  canRead: true,
465
364
  canHide: true,
466
365
  group: vueFormItemGroup
467
366
  };
468
- result.push(permissionItem);
367
+ result1.push(permissionItem);
469
368
  });
470
369
  }
471
370
  } else if (type === CONTROL_TYPE.OPERATION_COLUMN) {
472
371
  // 列表的操作列单独处理
473
372
  Object.entries(LIST_OPERATION_BUTTON_PERMISSIONS_MAPS).reduce(function(result, param) {
474
- var _param = _slicedToArray(param, 2), key = _param[0], _param_ = _param[1], caption = _param_.caption, controlId = _param_.id;
373
+ var _param = _slicedToArray(param, 2), key = _param[0], ref = _param[1], caption = ref.caption, controlId = ref.id;
475
374
  var operationItem = controls.props[key];
476
375
  if (operationItem && operationItem.isShow) {
477
- var _parent_controlId;
376
+ var ref9;
478
377
  // 只能控制是否显示
479
378
  result.push({
480
379
  controlId: controlId,
481
380
  caption: caption,
482
381
  type: controls.type,
483
382
  controlType: controls.controlType,
484
- parentId: (_parent_controlId = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && _parent_controlId !== void 0 ? _parent_controlId : null,
383
+ parentId: (ref9 = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && ref9 !== void 0 ? ref9 : null,
485
384
  canEdit: false,
486
385
  canRead: false,
487
386
  canHide: true,
488
- group: "element"
387
+ group: 'element'
489
388
  });
490
389
  }
491
390
  return result;
492
- }, result);
391
+ }, result1);
493
392
  }
494
393
  // else if (type === CONTROL_TYPE.CUSTOM_COLUMN) {
495
394
  // //追加自定义列上的vue容器权限
@@ -513,7 +412,7 @@ function generatePermissions(controls, parent) {
513
412
  // }
514
413
  if (controls.children) {
515
414
  var _result1;
516
- (_result1 = result).push.apply(_result1, _toConsumableArray(controls.children.map(function(item) {
415
+ (_result1 = result1).push.apply(_result1, _toConsumableArray(controls.children.map(function(item) {
517
416
  return generatePermissions(item, parent);
518
417
  }).flat()));
519
418
  }
@@ -521,11 +420,11 @@ function generatePermissions(controls, parent) {
521
420
  if (controls.controlType === CONTROL_BASE_TYPE.LIST) {
522
421
  var // 明细子表和列表的需要给parentId
523
422
  _result2;
524
- (_result2 = result).push.apply(_result2, _toConsumableArray(controls.props.headers.map(function(item) {
423
+ (_result2 = result1).push.apply(_result2, _toConsumableArray(controls.props.headers.map(function(item) {
525
424
  return generatePermissions(item, permissionItem);
526
425
  }).flat()));
527
426
  }
528
427
  }
529
- return result;
428
+ return result1;
530
429
  }
531
430
  export { toSchema, getModelBindInfoList, checkSchema, generatePermissions };