@form-create/element-ui 3.2.8 → 3.2.9

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @form-create/element-ui v3.2.8
2
+ * @form-create/element-ui v3.2.9
3
3
  * (c) 2018-2024 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -1286,7 +1286,7 @@ var Tree = defineComponent({
1286
1286
  return createVNode(resolveComponent("ElTree"), mergeProps$1(this.$attrs, {
1287
1287
  "ref": "tree",
1288
1288
  "onCheck": this.updateValue,
1289
- "onNode-click": this.updateValue
1289
+ "onNodeClick": this.updateValue
1290
1290
  }), this.$slots);
1291
1291
  },
1292
1292
  mounted: function mounted() {
@@ -1414,7 +1414,7 @@ var Upload = defineComponent({
1414
1414
  }, [createVNode(resolveComponent("ElUpload"), mergeProps$1({
1415
1415
  "key": len
1416
1416
  }, this.$attrs, {
1417
- "list-type": this.listType || 'picture-card',
1417
+ "listType": this.listType || 'picture-card',
1418
1418
  "class": {
1419
1419
  '_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= len : false
1420
1420
  },
@@ -2149,6 +2149,15 @@ function $FormCreate(FormCreate, components, directives) {
2149
2149
  var vm = getCurrentInstance();
2150
2150
  provide('parentFC', vm);
2151
2151
  var parent = inject('parentFC', null);
2152
+ var top = parent;
2153
+
2154
+ if (parent) {
2155
+ while (top.setupState.parent) {
2156
+ top = top.setupState.parent;
2157
+ }
2158
+ } else {
2159
+ top = vm;
2160
+ }
2152
2161
 
2153
2162
  var _toRefs = toRefs(props),
2154
2163
  rule = _toRefs.rule,
@@ -2281,6 +2290,7 @@ function $FormCreate(FormCreate, components, directives) {
2281
2290
  if (fc.$handle.isBreakWatch() || n.length === data.renderRule.length && n.every(function (v) {
2282
2291
  return data.renderRule.indexOf(v) > -1;
2283
2292
  })) return;
2293
+ fc.$handle.updateAppendData();
2284
2294
  fc.$handle.reloadRule(rule.value);
2285
2295
  vm.setupState.renderRule();
2286
2296
  });
@@ -2306,12 +2316,14 @@ function $FormCreate(FormCreate, components, directives) {
2306
2316
  fapi.setValue(n || {});
2307
2317
  }
2308
2318
  }, {
2309
- deep: true
2319
+ deep: true,
2320
+ flush: 'post'
2310
2321
  });
2311
2322
  watch(function () {
2312
2323
  return props.index;
2313
2324
  }, function () {
2314
2325
  fapi.coverValue({});
2326
+ fc.$handle.updateAppendData();
2315
2327
  nextTick(function () {
2316
2328
  nextTick(function () {
2317
2329
  fapi.clearValidateState();
@@ -2323,6 +2335,7 @@ function $FormCreate(FormCreate, components, directives) {
2323
2335
  return _objectSpread2(_objectSpread2({
2324
2336
  fc: markRaw(fc),
2325
2337
  parent: parent ? markRaw(parent) : parent,
2338
+ top: markRaw(top),
2326
2339
  fapi: markRaw(fapi)
2327
2340
  }, toRefs(data)), {}, {
2328
2341
  getGroupInject: function getGroupInject() {
@@ -2449,6 +2462,16 @@ function logError(e) {
2449
2462
  console.error(e);
2450
2463
  }
2451
2464
 
2465
+ function toCase(str) {
2466
+ var to = str.replace(/(-[a-z])/g, function (v) {
2467
+ return v.replace('-', '').toLocaleUpperCase();
2468
+ });
2469
+ return lower(to);
2470
+ }
2471
+ function lower(str) {
2472
+ return str.replace(str[0], str[0].toLowerCase());
2473
+ }
2474
+
2452
2475
  var PREFIX = '[[FORM-CREATE-PREFIX-';
2453
2476
  var SUFFIX = '-FORM-CREATE-SUFFIX]]';
2454
2477
  var $T = '$FN:';
@@ -2676,6 +2699,10 @@ function toProps(rule) {
2676
2699
  var prop = _objectSpread2({}, rule.props || {});
2677
2700
 
2678
2701
  Object.keys(rule.on || {}).forEach(function (k) {
2702
+ if (k.indexOf('-') > 0) {
2703
+ k = toCase(k);
2704
+ }
2705
+
2679
2706
  var name = "on".concat(upper(k));
2680
2707
 
2681
2708
  if (Array.isArray(prop[name])) {
@@ -3365,7 +3392,7 @@ function Api(h) {
3365
3392
  },
3366
3393
  method: function method(id, name) {
3367
3394
  var el = api.el(id);
3368
- if (!el || !el[name]) throw new Error(format('err', "".concat(name, "\u65B9\u6CD5\u4E0D\u5B58\u5728")));
3395
+ if (!el || !el[name]) throw new Error(format('err', "".concat(name, " \u65B9\u6CD5\u4E0D\u5B58\u5728")));
3369
3396
  return function () {
3370
3397
  return el[name].apply(el, arguments);
3371
3398
  };
@@ -3430,6 +3457,11 @@ function Api(h) {
3430
3457
  findRules(ctx ? ctx.loadChildrenPending() : rule.children);
3431
3458
  return rules;
3432
3459
  },
3460
+ getParentRule: function getParentRule(id) {
3461
+ var flag = _typeof(id) === 'object';
3462
+ var ctx = flag ? byCtx(id) : h.getCtx(id);
3463
+ return ctx.parent.rule;
3464
+ },
3433
3465
  getParentSubRule: function getParentSubRule(id) {
3434
3466
  var flag = _typeof(id) === 'object';
3435
3467
  var ctx = flag ? byCtx(id) : h.getCtx(id);
@@ -3538,8 +3570,8 @@ function Api(h) {
3538
3570
  getData: function getData(id, def) {
3539
3571
  return h.fc.getLoadData(id, def);
3540
3572
  },
3541
- setData: function setData(id, data) {
3542
- return h.fc.setData(id, data);
3573
+ setData: function setData(id, data, isGlobal) {
3574
+ return h.fc.setData(id, data, isGlobal);
3543
3575
  },
3544
3576
  refreshData: function refreshData(id) {
3545
3577
  return h.fc.refreshData(id);
@@ -3612,16 +3644,6 @@ function useCache(Render) {
3612
3644
  });
3613
3645
  }
3614
3646
 
3615
- function toCase(str) {
3616
- var to = str.replace(/(-[a-z])/g, function (v) {
3617
- return v.replace('-', '').toLocaleUpperCase();
3618
- });
3619
- return lower(to);
3620
- }
3621
- function lower(str) {
3622
- return str.replace(str[0], str[0].toLowerCase());
3623
- }
3624
-
3625
3647
  function toString(val) {
3626
3648
  return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
3627
3649
  }
@@ -3780,7 +3802,7 @@ function useRender$1(Render) {
3780
3802
  this.setOptions(ctx);
3781
3803
  this.ctxProp(ctx);
3782
3804
  var prop = ctx.prop;
3783
- prop.preview = !!(prop.preview != null ? prop.preview : this.vm.props.preview !== undefined ? this.vm.props.preview : this.options.preview || false);
3805
+ prop.preview = !!(prop.preview != null ? prop.preview : this.$handle.preview);
3784
3806
  prop.props.formCreateInject = this.injectProp(ctx);
3785
3807
  var cacheFlag = prop.cache !== false;
3786
3808
  var preview = prop.preview;
@@ -3933,7 +3955,10 @@ function useRender$1(Render) {
3933
3955
  id: ctx.id,
3934
3956
  field: ctx.field,
3935
3957
  rule: ctx.rule,
3936
- input: ctx.input
3958
+ input: ctx.input,
3959
+ updateValue: function updateValue(data) {
3960
+ _this6.$handle.onUpdateValue(ctx, data);
3961
+ }
3937
3962
  };
3938
3963
  }
3939
3964
 
@@ -5066,11 +5091,23 @@ function useLoader(Handler) {
5066
5091
  }
5067
5092
  });
5068
5093
  });
5069
- hideLst.length && nextTick(function () {
5070
- hideLst.forEach(function (v) {
5071
- return v();
5072
- });
5073
- });
5094
+
5095
+ if (hideLst.length) {
5096
+ if (this.loading) {
5097
+ hideLst.length && this.bus.$once('load-end', function () {
5098
+ hideLst.forEach(function (v) {
5099
+ return v();
5100
+ });
5101
+ });
5102
+ } else {
5103
+ hideLst.length && nextTick(function () {
5104
+ hideLst.forEach(function (v) {
5105
+ return v();
5106
+ });
5107
+ });
5108
+ }
5109
+ }
5110
+
5074
5111
  this.vm.emit('control', ctx.origin, this.api);
5075
5112
  this.effect(ctx, 'control');
5076
5113
  return flag;
@@ -5249,7 +5286,10 @@ function useInput(Handler) {
5249
5286
  this.syncValue();
5250
5287
  },
5251
5288
  appendValue: function appendValue(rule) {
5252
- if (!rule.field || !hasProperty(this.appendData, rule.field)) return;
5289
+ if ((!rule.field || !hasProperty(this.appendData, rule.field)) && !this.options.forceCoverValue) {
5290
+ return;
5291
+ }
5292
+
5253
5293
  rule.value = this.appendData[rule.field];
5254
5294
  delete this.appendData[rule.field];
5255
5295
  },
@@ -5536,123 +5576,135 @@ function useContext(Handler) {
5536
5576
  }
5537
5577
 
5538
5578
  this.bus.$once('load-end', function () {
5539
- var computed = ctx.rule.computed;
5579
+ var computedRule = ctx.rule.computed;
5540
5580
 
5541
- if (!computed) {
5581
+ if (!computedRule) {
5542
5582
  return;
5543
5583
  }
5544
5584
 
5545
- if (_typeof(computed) !== 'object') {
5546
- computed = {
5547
- value: computed
5585
+ if (_typeof(computedRule) !== 'object') {
5586
+ computedRule = {
5587
+ value: computedRule
5548
5588
  };
5549
5589
  }
5550
5590
 
5551
- Object.keys(computed).forEach(function (k) {
5552
- ctx.watch.push(watch(function () {
5553
- var item = computed[k];
5591
+ Object.keys(computedRule).forEach(function (k) {
5592
+ var computedValue = computed(function () {
5593
+ var item = computedRule[k];
5554
5594
  if (!item) return undefined;
5555
- var fn;
5556
-
5557
- if (_typeof(item) === 'object') {
5558
- var group = ctx.getParentGroup();
5595
+ return _this.compute(ctx, item);
5596
+ });
5559
5597
 
5560
- var checkCondition = function checkCondition(item) {
5561
- item = Array.isArray(item) ? {
5562
- mode: 'AND',
5563
- group: item
5564
- } : item;
5598
+ var callback = function callback(n) {
5599
+ if (k === 'value') {
5600
+ _this.onInput(ctx, n);
5601
+ } else if (k[0] === '$') {
5602
+ _this.api.setEffect(ctx.id, k, n);
5603
+ } else {
5604
+ deepSet(ctx.rule, k, n);
5605
+ }
5606
+ };
5565
5607
 
5566
- if (!is.trueArray(item.group)) {
5567
- return true;
5568
- }
5608
+ if (k === 'value' ? [undefined, null, ''].indexOf(ctx.rule.value) > -1 : computedValue.value !== deepGet(ctx.rule, k)) {
5609
+ callback(computedValue.value);
5610
+ }
5569
5611
 
5570
- var or = item.mode === 'OR';
5571
- var valid = true;
5612
+ ctx.watch.push(watch(computedValue, function (n) {
5613
+ setTimeout(function () {
5614
+ callback(n);
5615
+ });
5616
+ }));
5617
+ });
5618
+ });
5619
+ this.watchEffect(ctx);
5620
+ },
5621
+ compute: function compute(ctx, item) {
5622
+ var _this2 = this;
5572
5623
 
5573
- for (var i = 0; i < item.group.length; i++) {
5574
- var one = item.group[i];
5575
- var flag = void 0;
5624
+ var fn;
5576
5625
 
5577
- if (one.mode) {
5578
- flag = checkCondition(one);
5579
- } else if (!condition[one.condition]) {
5580
- flag = false;
5581
- } else {
5582
- flag = new Function('_$', '_$val', '$form', '_group', "with($form){with(this){with(_group){ return _$['".concat(one.condition, "'](").concat(one.field, ", ").concat(one.compare ? one.compare : '_$val', "); }}}")).call(_this.api.form, condition, one.value, _this.api.top.form, group ? _this.subRuleData[group.id] || {} : {});
5583
- }
5626
+ if (_typeof(item) === 'object') {
5627
+ var group = ctx.getParentGroup();
5584
5628
 
5585
- if (or && flag) {
5586
- return true;
5587
- }
5629
+ var checkCondition = function checkCondition(item) {
5630
+ item = Array.isArray(item) ? {
5631
+ mode: 'AND',
5632
+ group: item
5633
+ } : item;
5588
5634
 
5589
- if (!or) {
5590
- valid = valid && flag;
5591
- }
5592
- }
5635
+ if (!is.trueArray(item.group)) {
5636
+ return true;
5637
+ }
5593
5638
 
5594
- return or ? false : valid;
5595
- };
5639
+ var or = item.mode === 'OR';
5640
+ var valid = true;
5596
5641
 
5597
- var _val = checkCondition(item);
5642
+ for (var i = 0; i < item.group.length; i++) {
5643
+ var one = item.group[i];
5644
+ var flag = void 0;
5598
5645
 
5599
- return item.invert === true ? !_val : _val;
5600
- } else if (is.Function(item)) {
5601
- fn = function fn() {
5602
- return item(_this.api.form, _this.api);
5603
- };
5646
+ if (one.mode) {
5647
+ flag = checkCondition(one);
5648
+ } else if (!condition[one.condition]) {
5649
+ flag = false;
5604
5650
  } else {
5605
- var _group = ctx.getParentGroup();
5651
+ flag = new Function('$condition', '$val', '$form', '$group', "with($form){with(this){with($group){ return $condition['".concat(one.condition, "'](").concat(one.field, ", ").concat(one.compare ? one.compare : '$val', "); }}}")).call(_this2.api.form, condition, one.value, _this2.api.top.form, group ? _this2.subRuleData[group.id] || {} : {});
5652
+ }
5606
5653
 
5607
- fn = function fn() {
5608
- return new Function('_formulas', '$form', '_group', '$rule', '$api', "with($form){with(this){with(_group){with(_formulas){ return ".concat(item, " }}}}")).call(_this.api.form, _this.fc.formulas, _this.api.top.form, _group ? _this.subRuleData[_group.id] || {} : {}, ctx.rule, _this.api);
5609
- };
5654
+ if (or && flag) {
5655
+ return true;
5610
5656
  }
5611
5657
 
5612
- return invoke(fn, undefined);
5613
- }, function (n) {
5614
- setTimeout(function () {
5615
- if (k === 'value') {
5616
- _this.onInput(ctx, n);
5617
- } else if (k[0] === '$') {
5618
- _this.api.setEffect(ctx.id, k, n);
5619
- } else {
5620
- deepSet(ctx.rule, k, n);
5621
- }
5622
- });
5623
- }, {
5624
- immediate: k === 'value' ? [undefined, null, ''].indexOf(ctx.rule.value) > -1 : true
5625
- }));
5626
- });
5627
- });
5628
- this.watchEffect(ctx);
5658
+ if (!or) {
5659
+ valid = valid && flag;
5660
+ }
5661
+ }
5662
+
5663
+ return or ? false : valid;
5664
+ };
5665
+
5666
+ var val = checkCondition(item);
5667
+ return item.invert === true ? !val : val;
5668
+ } else if (is.Function(item)) {
5669
+ fn = function fn() {
5670
+ return item(_this2.api.form, _this2.api);
5671
+ };
5672
+ } else {
5673
+ var _group = ctx.getParentGroup();
5674
+
5675
+ fn = function fn() {
5676
+ return new Function('$formulas', '$form', '$group', '$rule', '$api', "with($form){with(this){with($group){with($formulas){ return ".concat(item, " }}}}")).call(_this2.api.form, _this2.fc.formulas, _this2.api.top.form, _group ? _this2.subRuleData[_group.id] || {} : {}, ctx.rule, _this2.api);
5677
+ };
5678
+ }
5679
+
5680
+ return invoke(fn, undefined);
5629
5681
  },
5630
5682
  updateChildren: function updateChildren(ctx, n, o) {
5631
- var _this2 = this;
5683
+ var _this3 = this;
5632
5684
 
5633
5685
  this.deferSyncValue(function () {
5634
5686
  o && o.forEach(function (child) {
5635
5687
  if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__ && child.__fc__.parent === ctx) {
5636
- _this2.rmCtx(child.__fc__);
5688
+ _this3.rmCtx(child.__fc__);
5637
5689
  }
5638
5690
  });
5639
5691
 
5640
5692
  if (is.trueArray(n)) {
5641
- _this2.loadChildren(n, ctx);
5693
+ _this3.loadChildren(n, ctx);
5642
5694
 
5643
- _this2.bus.$emit('update', _this2.api);
5695
+ _this3.bus.$emit('update', _this3.api);
5644
5696
  }
5645
5697
  });
5646
5698
  },
5647
5699
  rmSub: function rmSub(sub) {
5648
- var _this3 = this;
5700
+ var _this4 = this;
5649
5701
 
5650
5702
  is.trueArray(sub) && sub.forEach(function (r) {
5651
- r && r.__fc__ && _this3.rmCtx(r.__fc__);
5703
+ r && r.__fc__ && _this4.rmCtx(r.__fc__);
5652
5704
  });
5653
5705
  },
5654
5706
  rmCtx: function rmCtx(ctx) {
5655
- var _this4 = this;
5707
+ var _this5 = this;
5656
5708
 
5657
5709
  if (ctx.deleted) return;
5658
5710
  var id = ctx.id,
@@ -5681,19 +5733,19 @@ function useContext(Handler) {
5681
5733
  }
5682
5734
 
5683
5735
  this.deferSyncValue(function () {
5684
- if (!_this4.reloading) {
5736
+ if (!_this5.reloading) {
5685
5737
  if (ctx.parser.loadChildren !== false) {
5686
5738
  var children = ctx.getPending('children', ctx.rule.children);
5687
5739
 
5688
5740
  if (is.trueArray(children)) {
5689
5741
  children.forEach(function (h) {
5690
- return h.__fc__ && _this4.rmCtx(h.__fc__);
5742
+ return h.__fc__ && _this5.rmCtx(h.__fc__);
5691
5743
  });
5692
5744
  }
5693
5745
  }
5694
5746
 
5695
- if (ctx.root === _this4.rules) {
5696
- _this4.vm.setupState.renderRule();
5747
+ if (ctx.root === _this5.rules) {
5748
+ _this5.vm.setupState.renderRule();
5697
5749
  }
5698
5750
  }
5699
5751
  }, input);
@@ -5930,6 +5982,9 @@ function Handler(fc) {
5930
5982
  },
5931
5983
  bus: function bus() {
5932
5984
  return fc.bus;
5985
+ },
5986
+ preview: function preview() {
5987
+ return fc.vm.props.preview != null ? fc.vm.props.preview : this.options.preview || false;
5933
5988
  }
5934
5989
  });
5935
5990
  extend(this, {
@@ -5977,7 +6032,7 @@ extend(Handler.prototype, {
5977
6032
  });
5978
6033
  },
5979
6034
  init: function init() {
5980
- this.appendData = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options.formData || {}), this.fc.vm.props.modelValue || {}), this.appendData);
6035
+ this.updateAppendData();
5981
6036
  this.useProvider();
5982
6037
  this.usePage();
5983
6038
  this.loadRule();
@@ -5986,6 +6041,9 @@ extend(Handler.prototype, {
5986
6041
 
5987
6042
  this.lifecycle('created');
5988
6043
  },
6044
+ updateAppendData: function updateAppendData() {
6045
+ this.appendData = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options.formData || {}), this.fc.vm.props.modelValue || {}), this.appendData);
6046
+ },
5989
6047
  isBreakWatch: function isBreakWatch() {
5990
6048
  return this.loading || this.noWatchFn || this.reloading;
5991
6049
  },
@@ -6266,13 +6324,21 @@ var loadData = function loadData(fc) {
6266
6324
  var componentValidate = {
6267
6325
  name: 'componentValidate',
6268
6326
  load: function load(attr, rule, api) {
6269
- var method = attr.getValue();
6327
+ var options = attr.getValue();
6270
6328
 
6271
- if (!method) {
6329
+ if (!options || options.method === false) {
6272
6330
  attr.clearProp();
6273
6331
  api.clearValidateState([rule.field]);
6274
6332
  } else {
6275
- attr.getProp().validate = [{
6333
+ if (!is.Object(options)) {
6334
+ options = {
6335
+ method: options
6336
+ };
6337
+ }
6338
+
6339
+ var method = options.method;
6340
+ delete options.method;
6341
+ attr.getProp().validate = [_objectSpread2(_objectSpread2({}, options), {}, {
6276
6342
  validator: function validator() {
6277
6343
  var ctx = byCtx(rule);
6278
6344
 
@@ -6281,14 +6347,14 @@ var componentValidate = {
6281
6347
  args[_key] = arguments[_key];
6282
6348
  }
6283
6349
 
6284
- return api.exec.apply(api, [ctx.id, method === true ? 'formCreateValidate' : method].concat(args, [{
6350
+ return api.exec.apply(api, [ctx.id, is.String(method) ? method : 'formCreateValidate'].concat(args, [{
6285
6351
  attr: attr,
6286
6352
  rule: rule,
6287
6353
  api: api
6288
6354
  }]));
6289
6355
  }
6290
6356
  }
6291
- }];
6357
+ })];
6292
6358
  }
6293
6359
  },
6294
6360
  watch: function watch() {
@@ -6619,7 +6685,7 @@ function FormCreateFactory(config) {
6619
6685
 
6620
6686
  function register() {
6621
6687
  var data = nameProp.apply(void 0, arguments);
6622
- if (data.id && data.prop) providers[data.id] = _objectSpread2(_objectSpread2({}, data.prop), {}, {
6688
+ if (data.id && data.prop) providers[data.id] = is.Function(data.prop) ? data.prop : _objectSpread2(_objectSpread2({}, data.prop), {}, {
6623
6689
  name: data.id
6624
6690
  });
6625
6691
  }
@@ -6765,8 +6831,8 @@ function FormCreateFactory(config) {
6765
6831
  }
6766
6832
  }
6767
6833
 
6768
- function setData(id, data) {
6769
- loadData[id] = data;
6834
+ function _setData(id, data) {
6835
+ deepSet(loadData, id, data);
6770
6836
  refreshData(id);
6771
6837
  }
6772
6838
 
@@ -6782,7 +6848,8 @@ function FormCreateFactory(config) {
6782
6848
  };
6783
6849
 
6784
6850
  callback._driver = true;
6785
- setData(id, callback);
6851
+
6852
+ _setData(id, callback);
6786
6853
  }
6787
6854
 
6788
6855
  function getData(id, def) {
@@ -6843,8 +6910,6 @@ function FormCreateFactory(config) {
6843
6910
  },
6844
6911
  drivers: drivers,
6845
6912
  renderDriver: null,
6846
- setData: setData,
6847
- getData: getData,
6848
6913
  refreshData: refreshData,
6849
6914
  loadData: loadData,
6850
6915
  CreateNode: CreateNode,
@@ -6852,7 +6917,8 @@ function FormCreateFactory(config) {
6852
6917
  unwatch: [],
6853
6918
  options: ref({}),
6854
6919
  extendApiFn: extendApiFn,
6855
- fetchCache: new WeakMap()
6920
+ fetchCache: new WeakMap(),
6921
+ tmpData: {}
6856
6922
  });
6857
6923
  listener.forEach(function (item) {
6858
6924
  _this.bus.$on(item.name, item.callback);
@@ -7040,6 +7106,14 @@ function FormCreateFactory(config) {
7040
7106
  }
7041
7107
  }
7042
7108
  },
7109
+ setData: function setData(id, data, isGlobal) {
7110
+ if (!isGlobal) {
7111
+ deepSet(this.vm.setupState.top.setupState.fc.tmpData, id, data);
7112
+ this.bus.$emit('$loadData.' + id);
7113
+ } else {
7114
+ _setData(id, data);
7115
+ }
7116
+ },
7043
7117
  getLoadData: function getLoadData(id, def) {
7044
7118
  var val = null;
7045
7119
 
@@ -7060,11 +7134,12 @@ function FormCreateFactory(config) {
7060
7134
  val = this.globalVarDriver(split.join('.'));
7061
7135
  split = [];
7062
7136
  } else {
7063
- val = getData(id, def);
7137
+ var tmpData = this.vm.setupState.top.setupState.fc.tmpData;
7138
+ val = hasProperty(tmpData, key) ? deepGet(tmpData, id) : getData(key);
7064
7139
  split = [];
7065
7140
  }
7066
7141
 
7067
- if (split.length) {
7142
+ if (val && split.length) {
7068
7143
  val = deepGet(val, split);
7069
7144
  }
7070
7145
  }
@@ -7200,6 +7275,7 @@ function FormCreateFactory(config) {
7200
7275
  listener.forEach(function (item) {
7201
7276
  _this7.bus.$off(item.name, item.callback);
7202
7277
  });
7278
+ this.tmpData = {};
7203
7279
  this.unwatch.forEach(function (fn) {
7204
7280
  return fn();
7205
7281
  });
@@ -7222,7 +7298,7 @@ function FormCreateFactory(config) {
7222
7298
  extendApi: extendApi,
7223
7299
  getData: getData,
7224
7300
  setDataDriver: setDataDriver,
7225
- setData: setData,
7301
+ setData: _setData,
7226
7302
  removeData: removeData,
7227
7303
  refreshData: refreshData,
7228
7304
  maker: maker,
@@ -7640,7 +7716,7 @@ var manager = {
7640
7716
  e.preventDefault();
7641
7717
  }
7642
7718
  },
7643
- "class": [form.className, form["class"], 'form-create', this.options.preview ? 'is-preview' : ''],
7719
+ "class": [form.className, form["class"], 'form-create', this.$handle.preview ? 'is-preview' : ''],
7644
7720
  style: form.style,
7645
7721
  type: 'form'
7646
7722
  };
@@ -7660,7 +7736,7 @@ var manager = {
7660
7736
  render: function render(children) {
7661
7737
  var _this2 = this;
7662
7738
 
7663
- if (children.slotLen() && !this.options.preview) {
7739
+ if (children.slotLen() && !this.$handle.preview) {
7664
7740
  children.setSlot(undefined, function () {
7665
7741
  return _this2.makeFormBtn();
7666
7742
  });
@@ -8203,7 +8279,7 @@ function install(FormCreate) {
8203
8279
  function elmFormCreate() {
8204
8280
  return FormCreateFactory({
8205
8281
  ui: 'element-ui',
8206
- version: '3.2.8',
8282
+ version: '3.2.9',
8207
8283
  manager: manager,
8208
8284
  extendApi: extendApi,
8209
8285
  install: install,