@byteluck-fe/model-driven-driven 1.7.10 → 1.7.12

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.
@@ -214,7 +214,7 @@ var applyingPluginName = "";
214
214
  // TODO 拿到permission_controls
215
215
  _this.generatePermissions = generatePermissions;
216
216
  _this.$options = Object.freeze(options);
217
- var _$options = _this.$options, _autoMount = _$options.autoMount, autoMount = _autoMount === void 0 ? false : _autoMount, tmp = _$options.Designer, DesignerClass = tmp === void 0 ? Designer : tmp, schema = _$options.schema, _mode = _$options.mode, mode = _mode === void 0 ? "form" : _mode, tmp1 = _$options.store, storeOptions = tmp1 === void 0 ? {} : tmp1;
217
+ var _this_$options = _this.$options, _this_$options_autoMount = _this_$options.autoMount, autoMount = _this_$options_autoMount === void 0 ? false : _this_$options_autoMount, tmp = _this_$options.Designer, DesignerClass = tmp === void 0 ? Designer : tmp, schema = _this_$options.schema, _this_$options_mode = _this_$options.mode, mode = _this_$options_mode === void 0 ? "form" : _this_$options_mode, tmp1 = _this_$options.store, storeOptions = tmp1 === void 0 ? {} : tmp1;
218
218
  _this.eventLogic = new EventLogic();
219
219
  _this.designer = new DesignerClass();
220
220
  _this.store = new Store(_objectSpread({
@@ -229,7 +229,7 @@ var applyingPluginName = "";
229
229
  var _proto = Driven.prototype;
230
230
  // 挂载
231
231
  _proto.mount = function mount() {
232
- var _$options = this.$options, _plugins = _$options.plugins, plugins = _plugins === void 0 ? [] : _plugins;
232
+ var _this_$options = this.$options, _this_$options_plugins = _this_$options.plugins, plugins = _this_$options_plugins === void 0 ? [] : _this_$options_plugins;
233
233
  this.__plugins = plugins;
234
234
  this.applyPlugins();
235
235
  this.isMounted = true;
@@ -245,8 +245,8 @@ var applyingPluginName = "";
245
245
  if (this.__pluginsApplied) return;
246
246
  this.__plugins.forEach(function(plugin) {
247
247
  try {
248
- var _pluginName;
249
- applyingPluginName = (_pluginName = plugin.pluginName) !== null && _pluginName !== void 0 ? _pluginName : plugin.constructor.name;
248
+ var _plugin_pluginName;
249
+ applyingPluginName = (_plugin_pluginName = plugin.pluginName) !== null && _plugin_pluginName !== void 0 ? _plugin_pluginName : plugin.constructor.name;
250
250
  plugin.apply(_this);
251
251
  applyingPluginName = "";
252
252
  } catch (e) {
@@ -307,10 +307,10 @@ var applyingPluginName = "";
307
307
  };
308
308
  _proto.concatSetting = function concatSetting(settings, otherSettings, settingFromId) {
309
309
  var _this = this;
310
- var ref, ref1, ref2, ref3;
310
+ var _settings_, _otherSettings_, _settings_1, _otherSettings_1;
311
311
  var result = settings;
312
312
  // tab
313
- if (((ref = settings[0]) === null || ref === void 0 ? void 0 : ref.type) === "tab" && ((ref1 = otherSettings[0]) === null || ref1 === void 0 ? void 0 : ref1.type) === "tab") {
313
+ if (((_settings_ = settings[0]) === null || _settings_ === void 0 ? void 0 : _settings_.type) === "tab" && ((_otherSettings_ = otherSettings[0]) === null || _otherSettings_ === void 0 ? void 0 : _otherSettings_.type) === "tab") {
314
314
  var tabSettings = settings;
315
315
  var otherTabSettings = otherSettings.slice(0);
316
316
  result = tabSettings.map(function(tab, index) {
@@ -333,7 +333,7 @@ var applyingPluginName = "";
333
333
  })));
334
334
  }
335
335
  // group
336
- } else if (((ref2 = settings[0]) === null || ref2 === void 0 ? void 0 : ref2.type) === "group" && ((ref3 = otherSettings[0]) === null || ref3 === void 0 ? void 0 : ref3.type) === "group") {
336
+ } else if (((_settings_1 = settings[0]) === null || _settings_1 === void 0 ? void 0 : _settings_1.type) === "group" && ((_otherSettings_1 = otherSettings[0]) === null || _otherSettings_1 === void 0 ? void 0 : _otherSettings_1.type) === "group") {
337
337
  var groupSettings = settings;
338
338
  var otherGroupSettings = otherSettings;
339
339
  result = _toConsumableArray(this.formatGroupSetting(otherGroupSettings, settingFromId)).concat(_toConsumableArray(groupSettings));
@@ -359,8 +359,8 @@ var applyingPluginName = "";
359
359
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
360
360
  args[_key] = arguments[_key];
361
361
  }
362
- var _designer;
363
- return (_designer = this.designer).registerControlConfig.apply(_designer, _toConsumableArray(args));
362
+ var _this_designer;
363
+ return (_this_designer = this.designer).registerControlConfig.apply(_this_designer, _toConsumableArray(args));
364
364
  };
365
365
  _proto.getControlConfig = function getControlConfig(control) {
366
366
  return this.designer.getControlConfig(control);
@@ -395,7 +395,7 @@ var applyingPluginName = "";
395
395
  };
396
396
  _proto.moveEnd = function moveEnd() {
397
397
  var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.store.movingInstance;
398
- var ref;
398
+ var _this_store_selected;
399
399
  if (instance === null) return;
400
400
  var _instance = this.getInstance(instance);
401
401
  if (!_instance) return;
@@ -409,7 +409,7 @@ var applyingPluginName = "";
409
409
  var newParent = _instance.parent;
410
410
  // 移动之后清空movingInstance
411
411
  this.store.setMovingInstance(null);
412
- if (_instance.id !== ((ref = this.store.selected) === null || ref === void 0 ? void 0 : ref.id)) {
412
+ if (_instance.id !== ((_this_store_selected = this.store.selected) === null || _this_store_selected === void 0 ? void 0 : _this_store_selected.id)) {
413
413
  this.selectInstance(_instance);
414
414
  } else {
415
415
  this.store.setSelectInstance(_instance);
@@ -455,7 +455,7 @@ var applyingPluginName = "";
455
455
  });
456
456
  };
457
457
  _proto.updateInstancePropValue = function updateInstancePropValue(instance, propName, value, payload) {
458
- var ref;
458
+ var _this_store_selected;
459
459
  var result = updateValueFromKeys(instance.props, propName, value);
460
460
  if (!result) {
461
461
  return;
@@ -464,7 +464,7 @@ var applyingPluginName = "";
464
464
  if (propName.startsWith("dataBind")) {
465
465
  this.store.updateDataFieldCodeMap(instance);
466
466
  }
467
- if (instance.id === ((ref = this.store.selected) === null || ref === void 0 ? void 0 : ref.id)) {
467
+ if (instance.id === ((_this_store_selected = this.store.selected) === null || _this_store_selected === void 0 ? void 0 : _this_store_selected.id)) {
468
468
  this.callSelectedEffect(propName, payload);
469
469
  }
470
470
  this.emit("updated", {
@@ -563,8 +563,8 @@ var applyingPluginName = "";
563
563
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
564
564
  arg[_key] = arguments[_key];
565
565
  }
566
- var _designer;
567
- (_designer = this.designer).registerControl.apply(_designer, _toConsumableArray(arg));
566
+ var _this_designer;
567
+ (_this_designer = this.designer).registerControl.apply(_this_designer, _toConsumableArray(arg));
568
568
  return this;
569
569
  };
570
570
  /**
package/dist/esm/Store.js CHANGED
@@ -111,8 +111,8 @@ export var Store = /*#__PURE__*/ function() {
111
111
  this.movingInstance = null;
112
112
  this.movingInstanceOldParent = null;
113
113
  this.movingInstanceOldDataScopeParent = null;
114
- var _getParentBeforeInstanceMove;
115
- this.getParentBeforeInstanceMove = (_getParentBeforeInstanceMove = options.getParentBeforeInstanceMove) !== null && _getParentBeforeInstanceMove !== void 0 ? _getParentBeforeInstanceMove : function(instance) {
114
+ var _options_getParentBeforeInstanceMove;
115
+ this.getParentBeforeInstanceMove = (_options_getParentBeforeInstanceMove = options.getParentBeforeInstanceMove) !== null && _options_getParentBeforeInstanceMove !== void 0 ? _options_getParentBeforeInstanceMove : function(instance) {
116
116
  return instance.parent;
117
117
  };
118
118
  this.instance = options.instance;
@@ -133,8 +133,8 @@ export var Store = /*#__PURE__*/ function() {
133
133
  this.selectedInstanceSetting = settings;
134
134
  this.selectedInstanceSettingItems = [];
135
135
  this.selectedInstanceSetting.forEach(function(group) {
136
- var _selectedInstanceSettingItems;
137
- (_selectedInstanceSettingItems = _this.selectedInstanceSettingItems).push.apply(_selectedInstanceSettingItems, _toConsumableArray(_this.getSettingItems(group)));
136
+ var _this_selectedInstanceSettingItems;
137
+ (_this_selectedInstanceSettingItems = _this.selectedInstanceSettingItems).push.apply(_this_selectedInstanceSettingItems, _toConsumableArray(_this.getSettingItems(group)));
138
138
  });
139
139
  };
140
140
  _proto.getSettingItems = function getSettingItems(group) {
@@ -164,7 +164,7 @@ export var Store = /*#__PURE__*/ function() {
164
164
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
165
165
  try {
166
166
  for(var _iterator = map.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
167
- var _value = _slicedToArray(_step.value, 2), key = _value[0], value = _value[1];
167
+ var _step_value = _slicedToArray(_step.value, 2), key = _step_value[0], value = _step_value[1];
168
168
  if (value.id === instance.id) {
169
169
  map.delete(key);
170
170
  break;
package/dist/esm/utils.js CHANGED
@@ -415,16 +415,16 @@ function generatePermissions(controls, parent) {
415
415
  }).flat()));
416
416
  } else {
417
417
  var type = controls.type;
418
- var _props = controls.props, caption = _props.caption, content = _props.content;
418
+ var _controls_props = controls.props, caption = _controls_props.caption, content = _controls_props.content;
419
419
  var permissionItem;
420
420
  if (!PermissionExcludeControlTypes.includes(type)) {
421
- var ref;
421
+ var _parent_controlId;
422
422
  permissionItem = {
423
423
  controlId: controls.id,
424
424
  caption: caption || content || controls.name,
425
425
  type: controls.type,
426
426
  controlType: controls.controlType,
427
- parentId: (ref = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && ref !== void 0 ? ref : null,
427
+ parentId: (_parent_controlId = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && _parent_controlId !== void 0 ? _parent_controlId : null,
428
428
  canEdit: !cannotEditControlTypes.includes(type),
429
429
  canRead: true,
430
430
  canHide: true,
@@ -438,28 +438,28 @@ function generatePermissions(controls, parent) {
438
438
  permissionItem.caption = controls.props.controlExportName || controls.name;
439
439
  }
440
440
  if (_instanceof(controls, DesignerFormControl) || _instanceof(controls, DesignerColumnControl)) {
441
- var ref1, ref2, ref3, ref4;
442
- 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) !== "") {
441
+ var _controls_props1, _controls_props_dataBind, _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
443
  permissionItem.group = "field";
444
444
  }
445
445
  }
446
446
  result.push(permissionItem);
447
447
  //追加vue容器权限
448
448
  if (type === CONTROL_TYPE.VUE_FORM_ITEM) {
449
- var ref5, ref6, ref7, ref8;
449
+ var _controls_props3, _controls_props_dataBind2, _controls_props4, _controls_props_dataBind3;
450
450
  var vueFormItemGroup = "element";
451
- 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) !== "") {
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
452
  vueFormItemGroup = "field";
453
453
  }
454
454
  var permissions = controls.props["permissions"];
455
455
  permissions === null || permissions === void 0 ? void 0 : permissions.map(function(item) {
456
- var _id;
456
+ var _controls_id;
457
457
  permissionItem = {
458
458
  controlId: item.key,
459
459
  caption: item.caption,
460
460
  type: controls.type,
461
461
  controlType: controls.controlType,
462
- parentId: (_id = controls.id) !== null && _id !== void 0 ? _id : null,
462
+ parentId: (_controls_id = controls.id) !== null && _controls_id !== void 0 ? _controls_id : null,
463
463
  canEdit: true,
464
464
  canRead: true,
465
465
  canHide: true,
@@ -471,17 +471,17 @@ function generatePermissions(controls, parent) {
471
471
  } else if (type === CONTROL_TYPE.OPERATION_COLUMN) {
472
472
  // 列表的操作列单独处理
473
473
  Object.entries(LIST_OPERATION_BUTTON_PERMISSIONS_MAPS).reduce(function(result, param) {
474
- var _param = _slicedToArray(param, 2), key = _param[0], ref = _param[1], caption = ref.caption, controlId = ref.id;
474
+ var _param = _slicedToArray(param, 2), key = _param[0], _param_ = _param[1], caption = _param_.caption, controlId = _param_.id;
475
475
  var operationItem = controls.props[key];
476
476
  if (operationItem && operationItem.isShow) {
477
- var ref1;
477
+ var _parent_controlId;
478
478
  // 只能控制是否显示
479
479
  result.push({
480
480
  controlId: controlId,
481
481
  caption: caption,
482
482
  type: controls.type,
483
483
  controlType: controls.controlType,
484
- parentId: (ref1 = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && ref1 !== void 0 ? ref1 : null,
484
+ parentId: (_parent_controlId = parent === null || parent === void 0 ? void 0 : parent.controlId) !== null && _parent_controlId !== void 0 ? _parent_controlId : null,
485
485
  canEdit: false,
486
486
  canRead: false,
487
487
  canHide: true,