@form-create/element-ui 3.2.1 → 3.2.3
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/form-create.esm.js +241 -49
- package/dist/form-create.esm.min.js +2 -2
- package/dist/form-create.js +241 -49
- package/dist/form-create.min.js +2 -2
- package/package.json +3 -3
package/dist/form-create.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @form-create/element-ui v3.2.
|
|
2
|
+
* @form-create/element-ui v3.2.3
|
|
3
3
|
* (c) 2018-2024 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -2105,6 +2105,7 @@
|
|
|
2105
2105
|
}
|
|
2106
2106
|
},
|
|
2107
2107
|
extendOption: Boolean,
|
|
2108
|
+
driver: String,
|
|
2108
2109
|
modelValue: Object,
|
|
2109
2110
|
disabled: {
|
|
2110
2111
|
type: Boolean,
|
|
@@ -2221,9 +2222,15 @@
|
|
|
2221
2222
|
var emit$form = debounce(function () {
|
|
2222
2223
|
fc.bus.$emit('$loadData.$form');
|
|
2223
2224
|
}, 100);
|
|
2225
|
+
|
|
2226
|
+
var emit$change = function emit$change(field) {
|
|
2227
|
+
fc.bus.$emit('change-$form.' + field);
|
|
2228
|
+
};
|
|
2229
|
+
|
|
2224
2230
|
vue.onMounted(function () {
|
|
2225
2231
|
if (parent) {
|
|
2226
2232
|
fapi.top.bus.$on('$loadData.$form', emit$topForm);
|
|
2233
|
+
fapi.top.bus.$on('change', emit$change);
|
|
2227
2234
|
}
|
|
2228
2235
|
|
|
2229
2236
|
fc.mounted();
|
|
@@ -2231,6 +2238,7 @@
|
|
|
2231
2238
|
vue.onBeforeUnmount(function () {
|
|
2232
2239
|
if (parent) {
|
|
2233
2240
|
fapi.top.bus.$off('$loadData.$form', emit$topForm);
|
|
2241
|
+
fapi.top.bus.$off('change', emit$change);
|
|
2234
2242
|
}
|
|
2235
2243
|
|
|
2236
2244
|
styleEl && document.head.removeChild(styleEl);
|
|
@@ -2872,9 +2880,9 @@
|
|
|
2872
2880
|
});
|
|
2873
2881
|
xhr.send(formData);
|
|
2874
2882
|
}
|
|
2875
|
-
function asyncFetch(config) {
|
|
2883
|
+
function asyncFetch(config, _fetch) {
|
|
2876
2884
|
return new Promise(function (resolve, reject) {
|
|
2877
|
-
fetch$1(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
2885
|
+
(_fetch || fetch$1)(_objectSpread2(_objectSpread2({}, config), {}, {
|
|
2878
2886
|
onSuccess: function onSuccess(res) {
|
|
2879
2887
|
var fn = function fn(v) {
|
|
2880
2888
|
return v;
|
|
@@ -3435,8 +3443,24 @@
|
|
|
3435
3443
|
bus: h.bus,
|
|
3436
3444
|
fetch: function fetch(opt) {
|
|
3437
3445
|
return new Promise(function (resolve, reject) {
|
|
3446
|
+
opt = deepCopy(opt);
|
|
3447
|
+
opt = h.loadFetchVar(opt);
|
|
3438
3448
|
h.beforeFetch(opt).then(function () {
|
|
3439
|
-
return asyncFetch(opt).then(resolve)["catch"](reject);
|
|
3449
|
+
return asyncFetch(opt, h.fc.create.fetch).then(resolve)["catch"](reject);
|
|
3450
|
+
});
|
|
3451
|
+
});
|
|
3452
|
+
},
|
|
3453
|
+
watchFetch: function watchFetch(opt, callback, error) {
|
|
3454
|
+
return h.fc.watchLoadData(function (get, change) {
|
|
3455
|
+
var _opt = deepCopy(opt);
|
|
3456
|
+
|
|
3457
|
+
_opt = h.loadFetchVar(_opt, get);
|
|
3458
|
+
h.beforeFetch(_opt).then(function () {
|
|
3459
|
+
return asyncFetch(_opt, h.fc.create.fetch).then(function (res) {
|
|
3460
|
+
callback && callback(res, change);
|
|
3461
|
+
})["catch"](function (e) {
|
|
3462
|
+
error && error(e);
|
|
3463
|
+
});
|
|
3440
3464
|
});
|
|
3441
3465
|
});
|
|
3442
3466
|
},
|
|
@@ -3446,6 +3470,9 @@
|
|
|
3446
3470
|
setData: function setData(id, data) {
|
|
3447
3471
|
return h.fc.setData(id, data);
|
|
3448
3472
|
},
|
|
3473
|
+
refreshData: function refreshData(id) {
|
|
3474
|
+
return h.fc.refreshData(id);
|
|
3475
|
+
},
|
|
3449
3476
|
helper: {
|
|
3450
3477
|
tidyFields: tidyFields,
|
|
3451
3478
|
props: props
|
|
@@ -3807,7 +3834,7 @@
|
|
|
3807
3834
|
return vn;
|
|
3808
3835
|
},
|
|
3809
3836
|
getModelField: function getModelField(ctx) {
|
|
3810
|
-
return ctx.
|
|
3837
|
+
return ctx.prop.modelField || ctx.parser.modelField || this.fc.modelFields[this.vNode.aliasMap[ctx.type]] || this.fc.modelFields[ctx.type] || this.fc.modelFields[ctx.originType] || 'modelValue';
|
|
3811
3838
|
},
|
|
3812
3839
|
isFragment: function isFragment(ctx) {
|
|
3813
3840
|
return ctx.type === 'fragment' || ctx.type === 'template';
|
|
@@ -3941,10 +3968,18 @@
|
|
|
3941
3968
|
},
|
|
3942
3969
|
defaultRender: function defaultRender(ctx, children) {
|
|
3943
3970
|
var prop = ctx.prop;
|
|
3944
|
-
|
|
3971
|
+
|
|
3972
|
+
if (prop.component) {
|
|
3973
|
+
if (typeof prop.component === 'string') {
|
|
3974
|
+
return this.vNode.make(prop.component, prop, children);
|
|
3975
|
+
} else {
|
|
3976
|
+
return this.vNode.makeComponent(prop.component, prop, children);
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
|
|
3945
3980
|
if (this.vNode[ctx.type]) return this.vNode[ctx.type](prop, children);
|
|
3946
3981
|
if (this.vNode[ctx.originType]) return this.vNode[ctx.originType](prop, children);
|
|
3947
|
-
return this.vNode.make(lower(
|
|
3982
|
+
return this.vNode.make(lower(prop.type), prop, children);
|
|
3948
3983
|
},
|
|
3949
3984
|
renderRule: function renderRule(rule, children, origin) {
|
|
3950
3985
|
var _this9 = this;
|
|
@@ -4141,7 +4176,9 @@
|
|
|
4141
4176
|
var _this3 = this;
|
|
4142
4177
|
|
|
4143
4178
|
if (str && typeof str === 'string' && str.indexOf('{{') > -1 && str.indexOf('}}') > -1) {
|
|
4179
|
+
var tmp = str;
|
|
4144
4180
|
var vars = extractVar(str);
|
|
4181
|
+
var lastVal;
|
|
4145
4182
|
vars.forEach(function (v) {
|
|
4146
4183
|
var split = v.split('||');
|
|
4147
4184
|
var field = split[0].trim();
|
|
@@ -4149,9 +4186,14 @@
|
|
|
4149
4186
|
if (field) {
|
|
4150
4187
|
var def = (split[1] || '').trim();
|
|
4151
4188
|
var val = get ? get(field, def) : _this3.fc.getLoadData(field, def);
|
|
4189
|
+
lastVal = val;
|
|
4152
4190
|
str = str.replaceAll("{{".concat(v, "}}"), val == null ? '' : val);
|
|
4153
4191
|
}
|
|
4154
4192
|
});
|
|
4193
|
+
|
|
4194
|
+
if (vars.length === 1 && tmp === "{{".concat(vars[0], "}}")) {
|
|
4195
|
+
return lastVal;
|
|
4196
|
+
}
|
|
4155
4197
|
}
|
|
4156
4198
|
|
|
4157
4199
|
return str;
|
|
@@ -5115,7 +5157,19 @@
|
|
|
5115
5157
|
var _this2 = this;
|
|
5116
5158
|
|
|
5117
5159
|
var data = vue.reactive({});
|
|
5118
|
-
this.fields()
|
|
5160
|
+
var fields = this.fields();
|
|
5161
|
+
|
|
5162
|
+
if (this.options.appendValue !== false) {
|
|
5163
|
+
Object.keys(this.appendData).reduce(function (initial, field) {
|
|
5164
|
+
if (fields.indexOf(field) === -1) {
|
|
5165
|
+
initial[field] = vue.toRef(_this2.appendData, field);
|
|
5166
|
+
}
|
|
5167
|
+
|
|
5168
|
+
return initial;
|
|
5169
|
+
}, data);
|
|
5170
|
+
}
|
|
5171
|
+
|
|
5172
|
+
fields.reduce(function (initial, field) {
|
|
5119
5173
|
var ctx = _this2.getCtx(field);
|
|
5120
5174
|
|
|
5121
5175
|
initial[field] = vue.toRef(ctx.rule, 'value');
|
|
@@ -5156,7 +5210,7 @@
|
|
|
5156
5210
|
return this.deferSyncFn.sync = true;
|
|
5157
5211
|
}
|
|
5158
5212
|
|
|
5159
|
-
this.vm.setupState.updateValue(_objectSpread2(
|
|
5213
|
+
this.vm.setupState.updateValue(_objectSpread2({}, this.form));
|
|
5160
5214
|
},
|
|
5161
5215
|
isChange: function isChange(ctx, value) {
|
|
5162
5216
|
return JSON.stringify(this.getFormData(ctx), strFn) !== JSON.stringify(value, strFn);
|
|
@@ -5228,9 +5282,17 @@
|
|
|
5228
5282
|
},
|
|
5229
5283
|
mounted: function mounted(ctx) {},
|
|
5230
5284
|
render: function render(children, ctx) {
|
|
5285
|
+
if (ctx.$handle.fc.renderDriver && ctx.$handle.fc.renderDriver.defaultRender) {
|
|
5286
|
+
return ctx.$handle.fc.renderDriver.defaultRender(ctx, children);
|
|
5287
|
+
}
|
|
5288
|
+
|
|
5231
5289
|
return ctx.$render.defaultRender(ctx, children);
|
|
5232
5290
|
},
|
|
5233
5291
|
preview: function preview(children, ctx) {
|
|
5292
|
+
if (ctx.$handle.fc.renderDriver && ctx.$handle.fc.renderDriver.defaultPreview) {
|
|
5293
|
+
return ctx.$handle.fc.renderDriver.defaultPreview(ctx, children);
|
|
5294
|
+
}
|
|
5295
|
+
|
|
5234
5296
|
return this.render(children, ctx);
|
|
5235
5297
|
},
|
|
5236
5298
|
mergeProp: function mergeProp(ctx) {}
|
|
@@ -5289,6 +5351,18 @@
|
|
|
5289
5351
|
},
|
|
5290
5352
|
getParser: function getParser(ctx) {
|
|
5291
5353
|
var list = this.fc.parsers;
|
|
5354
|
+
var renderDriver = this.fc.renderDriver;
|
|
5355
|
+
|
|
5356
|
+
if (renderDriver) {
|
|
5357
|
+
var _list = renderDriver.parsers || {};
|
|
5358
|
+
|
|
5359
|
+
var parser = _list[ctx.originType] || _list[toCase(ctx.type)] || _list[ctx.trueType];
|
|
5360
|
+
|
|
5361
|
+
if (parser) {
|
|
5362
|
+
return parser;
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5365
|
+
|
|
5292
5366
|
return list[ctx.originType] || list[toCase(ctx.type)] || list[ctx.trueType] || BaseParser;
|
|
5293
5367
|
},
|
|
5294
5368
|
bindParser: function bindParser(ctx) {
|
|
@@ -5486,7 +5560,7 @@
|
|
|
5486
5560
|
|
|
5487
5561
|
this.deferSyncValue(function () {
|
|
5488
5562
|
o && o.forEach(function (child) {
|
|
5489
|
-
if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__ && child.__fc__.parent === ctx
|
|
5563
|
+
if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__ && child.__fc__.parent === ctx) {
|
|
5490
5564
|
_this2.rmCtx(child.__fc__);
|
|
5491
5565
|
}
|
|
5492
5566
|
});
|
|
@@ -6037,6 +6111,17 @@
|
|
|
6037
6111
|
}), opt, this.mergeOptionsRule);
|
|
6038
6112
|
},
|
|
6039
6113
|
updateOptions: function updateOptions(options) {
|
|
6114
|
+
var _this3 = this;
|
|
6115
|
+
|
|
6116
|
+
if (this.$handle.fc.renderDriver && this.$handle.fc.renderDriver.updateOptions) {
|
|
6117
|
+
invoke(function () {
|
|
6118
|
+
_this3.$handle.fc.renderDriver.updateOptions(options, {
|
|
6119
|
+
handle: _this3.$handle,
|
|
6120
|
+
api: _this3.$handle.api
|
|
6121
|
+
});
|
|
6122
|
+
});
|
|
6123
|
+
}
|
|
6124
|
+
|
|
6040
6125
|
this.options = this.mergeOptions([options], this.getDefaultOptions());
|
|
6041
6126
|
this.update();
|
|
6042
6127
|
},
|
|
@@ -6074,7 +6159,18 @@
|
|
|
6074
6159
|
value = deepCopy(value);
|
|
6075
6160
|
}
|
|
6076
6161
|
|
|
6077
|
-
|
|
6162
|
+
var _rule = attr.modify ? rule : inject.getProp();
|
|
6163
|
+
|
|
6164
|
+
if (attr.to === 'child') {
|
|
6165
|
+
if (_rule.children) {
|
|
6166
|
+
_rule.children[0] = value;
|
|
6167
|
+
} else {
|
|
6168
|
+
_rule.children = [value];
|
|
6169
|
+
}
|
|
6170
|
+
} else {
|
|
6171
|
+
deepSet(_rule, attr.to || 'options', value);
|
|
6172
|
+
}
|
|
6173
|
+
|
|
6078
6174
|
api.sync(rule);
|
|
6079
6175
|
}, attr.wait || 300));
|
|
6080
6176
|
|
|
@@ -6203,7 +6299,11 @@
|
|
|
6203
6299
|
}
|
|
6204
6300
|
};
|
|
6205
6301
|
|
|
6206
|
-
fetchAttr._fn[inject.id] = fc.watchLoadData(debounce(function (get) {
|
|
6302
|
+
fetchAttr._fn[inject.id] = fc.watchLoadData(debounce(function (get, change) {
|
|
6303
|
+
if (change && option.watch === false) {
|
|
6304
|
+
return fetchAttr._fn[inject.id]();
|
|
6305
|
+
}
|
|
6306
|
+
|
|
6207
6307
|
var _option = fc.$handle.loadFetchVar(deepCopy(option), get);
|
|
6208
6308
|
|
|
6209
6309
|
var config = _objectSpread2(_objectSpread2({
|
|
@@ -6261,7 +6361,7 @@
|
|
|
6261
6361
|
});
|
|
6262
6362
|
});
|
|
6263
6363
|
});
|
|
6264
|
-
}, option.wait ||
|
|
6364
|
+
}, option.wait || 600));
|
|
6265
6365
|
}
|
|
6266
6366
|
|
|
6267
6367
|
var fetchAttr = {
|
|
@@ -6413,6 +6513,7 @@
|
|
|
6413
6513
|
var parsers = {};
|
|
6414
6514
|
var directives = {};
|
|
6415
6515
|
var modelFields = {};
|
|
6516
|
+
var drivers = {};
|
|
6416
6517
|
var useApps = [];
|
|
6417
6518
|
var listener = [];
|
|
6418
6519
|
var extendApiFn = [config.extendApi];
|
|
@@ -6571,18 +6672,36 @@
|
|
|
6571
6672
|
formulas[name] = fn;
|
|
6572
6673
|
}
|
|
6573
6674
|
|
|
6574
|
-
function
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6675
|
+
function setDriver(name, driver) {
|
|
6676
|
+
var parent = drivers[name] || {};
|
|
6677
|
+
var parsers = parent.parsers || {};
|
|
6678
|
+
|
|
6679
|
+
if (driver.parsers) {
|
|
6680
|
+
Object.keys(driver.parsers).forEach(function (k) {
|
|
6681
|
+
parsers[k] = setPrototypeOf(driver.parsers[k], BaseParser);
|
|
6579
6682
|
});
|
|
6683
|
+
}
|
|
6684
|
+
|
|
6685
|
+
driver.name = name;
|
|
6686
|
+
drivers[name] = _objectSpread2(_objectSpread2(_objectSpread2({}, parent), driver), {}, {
|
|
6687
|
+
parsers: parsers
|
|
6580
6688
|
});
|
|
6581
6689
|
}
|
|
6582
6690
|
|
|
6691
|
+
function refreshData(id) {
|
|
6692
|
+
if (id) {
|
|
6693
|
+
Object.keys(instance).forEach(function (v) {
|
|
6694
|
+
var apis = Array.isArray(instance[v]) ? instance[v] : [instance[v]];
|
|
6695
|
+
apis.forEach(function (that) {
|
|
6696
|
+
that.bus.$emit('$loadData.' + id);
|
|
6697
|
+
});
|
|
6698
|
+
});
|
|
6699
|
+
}
|
|
6700
|
+
}
|
|
6701
|
+
|
|
6583
6702
|
function setData(id, data) {
|
|
6584
6703
|
loadData[id] = data;
|
|
6585
|
-
|
|
6704
|
+
refreshData(id);
|
|
6586
6705
|
}
|
|
6587
6706
|
|
|
6588
6707
|
function setDataDriver(id, data) {
|
|
@@ -6626,7 +6745,7 @@
|
|
|
6626
6745
|
|
|
6627
6746
|
function removeData(id) {
|
|
6628
6747
|
delete loadData[id];
|
|
6629
|
-
|
|
6748
|
+
refreshData(id);
|
|
6630
6749
|
}
|
|
6631
6750
|
|
|
6632
6751
|
function on(name, callback) {
|
|
@@ -6656,13 +6775,15 @@
|
|
|
6656
6775
|
components: components,
|
|
6657
6776
|
directives: directives
|
|
6658
6777
|
},
|
|
6778
|
+
drivers: drivers,
|
|
6779
|
+
renderDriver: null,
|
|
6659
6780
|
setData: setData,
|
|
6660
6781
|
getData: getData,
|
|
6661
|
-
|
|
6782
|
+
refreshData: refreshData,
|
|
6662
6783
|
loadData: loadData,
|
|
6663
6784
|
CreateNode: CreateNode,
|
|
6664
6785
|
bus: new Mitt(),
|
|
6665
|
-
unwatch:
|
|
6786
|
+
unwatch: [],
|
|
6666
6787
|
options: vue.ref({}),
|
|
6667
6788
|
extendApiFn: extendApiFn,
|
|
6668
6789
|
fetchCache: new WeakMap()
|
|
@@ -6699,7 +6820,7 @@
|
|
|
6699
6820
|
var _this2 = this;
|
|
6700
6821
|
|
|
6701
6822
|
if (this.isSub()) {
|
|
6702
|
-
this.unwatch
|
|
6823
|
+
this.unwatch.push(vue.watch(function () {
|
|
6703
6824
|
return _this2.vm.setupState.parent.setupState.fc.options.value;
|
|
6704
6825
|
}, function () {
|
|
6705
6826
|
_this2.initOptions();
|
|
@@ -6707,9 +6828,11 @@
|
|
|
6707
6828
|
_this2.$handle.api.refresh();
|
|
6708
6829
|
}, {
|
|
6709
6830
|
deep: true
|
|
6710
|
-
});
|
|
6831
|
+
}));
|
|
6711
6832
|
}
|
|
6712
6833
|
|
|
6834
|
+
var driver = this.vm.setupState.parent ? this.vm.setupState.parent.setupState.fc.renderDriver : this.vm.props.driver;
|
|
6835
|
+
this.renderDriver = this.drivers[driver];
|
|
6713
6836
|
this.initOptions();
|
|
6714
6837
|
this.$handle.init();
|
|
6715
6838
|
},
|
|
@@ -6756,13 +6879,26 @@
|
|
|
6756
6879
|
_this3.fetchCache.set(option, res);
|
|
6757
6880
|
}
|
|
6758
6881
|
|
|
6759
|
-
_this3.bus.$emit('$loadData.$globalData');
|
|
6882
|
+
_this3.bus.$emit('$loadData.$globalData.' + key);
|
|
6760
6883
|
} else {
|
|
6761
6884
|
_this3.fetchCache["delete"](option);
|
|
6762
6885
|
}
|
|
6763
|
-
}, option.wait ||
|
|
6886
|
+
}, option.wait || 600);
|
|
6887
|
+
|
|
6888
|
+
var _emit = function _emit(data) {
|
|
6889
|
+
_this3.fetchCache.set(option, {
|
|
6890
|
+
status: true,
|
|
6891
|
+
data: data
|
|
6892
|
+
});
|
|
6893
|
+
|
|
6894
|
+
_this3.bus.$emit('$loadData.$globalData.' + key);
|
|
6895
|
+
};
|
|
6764
6896
|
|
|
6765
6897
|
var callback = function callback(get, change) {
|
|
6898
|
+
if (change && option.watch === false) {
|
|
6899
|
+
return unwatch();
|
|
6900
|
+
}
|
|
6901
|
+
|
|
6766
6902
|
if (change) {
|
|
6767
6903
|
reload();
|
|
6768
6904
|
return;
|
|
@@ -6771,16 +6907,42 @@
|
|
|
6771
6907
|
var options = _this3.$handle.loadFetchVar(copy$1(option), get);
|
|
6772
6908
|
|
|
6773
6909
|
_this3.$handle.api.fetch(options).then(function (res) {
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
});
|
|
6778
|
-
|
|
6779
|
-
_this3.bus.$emit('$loadData.$globalData');
|
|
6910
|
+
_emit(res);
|
|
6911
|
+
})["catch"](function (e) {
|
|
6912
|
+
_emit(null);
|
|
6780
6913
|
});
|
|
6781
6914
|
};
|
|
6782
6915
|
|
|
6783
6916
|
var unwatch = this.watchLoadData(callback);
|
|
6917
|
+
this.unwatch.push(unwatch);
|
|
6918
|
+
return val;
|
|
6919
|
+
}
|
|
6920
|
+
}
|
|
6921
|
+
},
|
|
6922
|
+
globalVarDriver: function globalVarDriver(id) {
|
|
6923
|
+
var _this4 = this;
|
|
6924
|
+
|
|
6925
|
+
var split = id.split('.');
|
|
6926
|
+
var key = split.shift();
|
|
6927
|
+
var option = this.options.value.globalVariable && this.options.value.globalVariable[key];
|
|
6928
|
+
|
|
6929
|
+
if (option) {
|
|
6930
|
+
var handle = is.Function(option) ? option : option.handle;
|
|
6931
|
+
|
|
6932
|
+
if (handle) {
|
|
6933
|
+
var val;
|
|
6934
|
+
var unwatch = this.watchLoadData(function (get, change) {
|
|
6935
|
+
if (change) {
|
|
6936
|
+
unwatch();
|
|
6937
|
+
|
|
6938
|
+
_this4.bus.$emit('$loadData.$var.' + key);
|
|
6939
|
+
}
|
|
6940
|
+
|
|
6941
|
+
val = invoke(function () {
|
|
6942
|
+
return handle(get, _this4.$handle.api);
|
|
6943
|
+
});
|
|
6944
|
+
});
|
|
6945
|
+
this.unwatch.push(unwatch);
|
|
6784
6946
|
return val;
|
|
6785
6947
|
}
|
|
6786
6948
|
}
|
|
@@ -6801,6 +6963,9 @@
|
|
|
6801
6963
|
} else if (key === '$globalData') {
|
|
6802
6964
|
val = this.globalDataDriver(split.join('.'));
|
|
6803
6965
|
split = [];
|
|
6966
|
+
} else if (key === '$var') {
|
|
6967
|
+
val = this.globalVarDriver(split.join('.'));
|
|
6968
|
+
split = [];
|
|
6804
6969
|
} else {
|
|
6805
6970
|
val = getData(id, def);
|
|
6806
6971
|
split = [];
|
|
@@ -6811,11 +6976,10 @@
|
|
|
6811
6976
|
}
|
|
6812
6977
|
}
|
|
6813
6978
|
|
|
6814
|
-
console.log(id, val);
|
|
6815
6979
|
return val == null || val === '' ? def : val;
|
|
6816
6980
|
},
|
|
6817
6981
|
watchLoadData: function watchLoadData(fn) {
|
|
6818
|
-
var
|
|
6982
|
+
var _this5 = this;
|
|
6819
6983
|
|
|
6820
6984
|
var unwatch = {};
|
|
6821
6985
|
|
|
@@ -6830,13 +6994,14 @@
|
|
|
6830
6994
|
return unwatch[id].val;
|
|
6831
6995
|
}
|
|
6832
6996
|
|
|
6833
|
-
var val =
|
|
6834
|
-
|
|
6835
|
-
var key = id.split('.').shift();
|
|
6997
|
+
var val = _this5.getLoadData(id, def);
|
|
6836
6998
|
|
|
6837
|
-
var
|
|
6999
|
+
var split = id.split('.');
|
|
7000
|
+
var key = split.shift();
|
|
7001
|
+
var key2 = split.shift() || '';
|
|
7002
|
+
var callback = debounce(function () {
|
|
6838
7003
|
if (key !== id) {
|
|
6839
|
-
var temp =
|
|
7004
|
+
var temp = _this5.getLoadData(id, def);
|
|
6840
7005
|
|
|
6841
7006
|
if (JSON.stringify(temp) !== JSON.stringify(unwatch[id].val)) {
|
|
6842
7007
|
unwatch[id].val = temp;
|
|
@@ -6845,13 +7010,21 @@
|
|
|
6845
7010
|
} else {
|
|
6846
7011
|
run(true);
|
|
6847
7012
|
}
|
|
6848
|
-
};
|
|
7013
|
+
}, 0);
|
|
7014
|
+
|
|
7015
|
+
_this5.bus.$on('$loadData.' + key, callback);
|
|
6849
7016
|
|
|
6850
|
-
|
|
7017
|
+
if (key2) {
|
|
7018
|
+
_this5.bus.$on('$loadData.' + key + '.' + key2, callback);
|
|
7019
|
+
}
|
|
6851
7020
|
|
|
6852
7021
|
unwatch[id] = {
|
|
6853
7022
|
fn: function fn() {
|
|
6854
|
-
|
|
7023
|
+
_this5.bus.$off('$loadData.' + key, callback);
|
|
7024
|
+
|
|
7025
|
+
if (key2) {
|
|
7026
|
+
_this5.bus.$off('$loadData.' + key + '.' + key2, callback);
|
|
7027
|
+
}
|
|
6855
7028
|
},
|
|
6856
7029
|
val: val
|
|
6857
7030
|
};
|
|
@@ -6859,12 +7032,16 @@
|
|
|
6859
7032
|
};
|
|
6860
7033
|
|
|
6861
7034
|
run(false);
|
|
6862
|
-
|
|
7035
|
+
|
|
7036
|
+
var un = function un() {
|
|
6863
7037
|
Object.keys(unwatch).forEach(function (k) {
|
|
6864
7038
|
return unwatch[k].fn();
|
|
6865
7039
|
});
|
|
6866
7040
|
unwatch = {};
|
|
6867
7041
|
};
|
|
7042
|
+
|
|
7043
|
+
this.unwatch.push(un);
|
|
7044
|
+
return un;
|
|
6868
7045
|
},
|
|
6869
7046
|
isSub: function isSub() {
|
|
6870
7047
|
return this.vm.setupState.parent && this.vm.props.extendOption;
|
|
@@ -6916,7 +7093,7 @@
|
|
|
6916
7093
|
this.$handle.mounted();
|
|
6917
7094
|
},
|
|
6918
7095
|
unmount: function unmount() {
|
|
6919
|
-
var
|
|
7096
|
+
var _this6 = this;
|
|
6920
7097
|
|
|
6921
7098
|
if (this.name) {
|
|
6922
7099
|
if (this.inFor) {
|
|
@@ -6928,16 +7105,19 @@
|
|
|
6928
7105
|
}
|
|
6929
7106
|
|
|
6930
7107
|
listener.forEach(function (item) {
|
|
6931
|
-
|
|
7108
|
+
_this6.bus.$off(item.name, item.callback);
|
|
7109
|
+
});
|
|
7110
|
+
this.unwatch.forEach(function (fn) {
|
|
7111
|
+
return fn();
|
|
6932
7112
|
});
|
|
6933
|
-
this.unwatch
|
|
7113
|
+
this.unwatch = [];
|
|
6934
7114
|
this.$handle.reloadRule([]);
|
|
6935
7115
|
},
|
|
6936
7116
|
updated: function updated() {
|
|
6937
|
-
var
|
|
7117
|
+
var _this7 = this;
|
|
6938
7118
|
|
|
6939
7119
|
this.$handle.bindNextTick(function () {
|
|
6940
|
-
return
|
|
7120
|
+
return _this7.bus.$emit('next-tick', _this7.$handle.api);
|
|
6941
7121
|
});
|
|
6942
7122
|
}
|
|
6943
7123
|
});
|
|
@@ -6951,11 +7131,13 @@
|
|
|
6951
7131
|
setDataDriver: setDataDriver,
|
|
6952
7132
|
setData: setData,
|
|
6953
7133
|
removeData: removeData,
|
|
7134
|
+
refreshData: refreshData,
|
|
6954
7135
|
maker: maker,
|
|
6955
7136
|
component: component,
|
|
6956
7137
|
directive: directive,
|
|
6957
7138
|
setModelField: setModelField,
|
|
6958
7139
|
setFormula: setFormula,
|
|
7140
|
+
setDriver: setDriver,
|
|
6959
7141
|
register: register,
|
|
6960
7142
|
$vnode: $vnode,
|
|
6961
7143
|
parser: parser,
|
|
@@ -7033,6 +7215,16 @@
|
|
|
7033
7215
|
|
|
7034
7216
|
var FcComponent = $form();
|
|
7035
7217
|
setPrototypeOf(FcComponent, create);
|
|
7218
|
+
Object.defineProperties(FcComponent, {
|
|
7219
|
+
fetch: {
|
|
7220
|
+
get: function get() {
|
|
7221
|
+
return create.fetch;
|
|
7222
|
+
},
|
|
7223
|
+
set: function set(val) {
|
|
7224
|
+
create.fetch = val;
|
|
7225
|
+
}
|
|
7226
|
+
}
|
|
7227
|
+
});
|
|
7036
7228
|
FcComponent.util = create;
|
|
7037
7229
|
return FcComponent;
|
|
7038
7230
|
}
|
|
@@ -7917,7 +8109,7 @@
|
|
|
7917
8109
|
function elmFormCreate() {
|
|
7918
8110
|
return FormCreateFactory({
|
|
7919
8111
|
ui: 'element-ui',
|
|
7920
|
-
version: '3.2.
|
|
8112
|
+
version: '3.2.3',
|
|
7921
8113
|
manager: manager,
|
|
7922
8114
|
extendApi: extendApi,
|
|
7923
8115
|
install: install,
|