@form-create/element-ui 3.2.18 → 3.2.20
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 +214 -50
- package/dist/form-create.esm.min.js +2 -2
- package/dist/form-create.js +214 -50
- package/dist/form-create.min.js +2 -2
- package/package.json +4 -4
- package/src/core/manager.js +3 -3
- package/src/core/provider.js +1 -1
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.20
|
|
3
3
|
* (c) 2018-2025 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -1787,7 +1787,7 @@
|
|
|
1787
1787
|
return;
|
|
1788
1788
|
}
|
|
1789
1789
|
|
|
1790
|
-
this.cacheRule[key].$f && this.cacheRule[key].$f.
|
|
1790
|
+
this.cacheRule[key].$f && this.cacheRule[key].$f.coverValue(value);
|
|
1791
1791
|
this.cache(key, value);
|
|
1792
1792
|
},
|
|
1793
1793
|
addRule: function addRule(i, emit) {
|
|
@@ -2327,6 +2327,9 @@
|
|
|
2327
2327
|
var emit$topForm = debounce(function () {
|
|
2328
2328
|
fc.bus.$emit('$loadData.$topForm');
|
|
2329
2329
|
}, 100);
|
|
2330
|
+
var emit$scopeForm = debounce(function () {
|
|
2331
|
+
fc.bus.$emit('$loadData.$scopeForm');
|
|
2332
|
+
}, 100);
|
|
2330
2333
|
var emit$form = debounce(function () {
|
|
2331
2334
|
fc.bus.$emit('$loadData.$form');
|
|
2332
2335
|
}, 100);
|
|
@@ -2341,6 +2344,10 @@
|
|
|
2341
2344
|
fapi.top.bus.$on('change', emit$change);
|
|
2342
2345
|
}
|
|
2343
2346
|
|
|
2347
|
+
if (fapi !== fapi.scope) {
|
|
2348
|
+
fapi.scope.bus.$on('$loadData.$scopeForm', emit$scopeForm);
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2344
2351
|
fc.mounted();
|
|
2345
2352
|
});
|
|
2346
2353
|
vue.onBeforeUnmount(function () {
|
|
@@ -2349,6 +2356,10 @@
|
|
|
2349
2356
|
fapi.top.bus.$off('change', emit$change);
|
|
2350
2357
|
}
|
|
2351
2358
|
|
|
2359
|
+
if (fapi !== fapi.scope) {
|
|
2360
|
+
fapi.scope.bus.$off('$loadData.$scopeForm', emit$scopeForm);
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2352
2363
|
styleEl && document.head.removeChild(styleEl);
|
|
2353
2364
|
rmSubForm();
|
|
2354
2365
|
data.destroyed = true;
|
|
@@ -2362,6 +2373,14 @@
|
|
|
2362
2373
|
}, {
|
|
2363
2374
|
immediate: true
|
|
2364
2375
|
});
|
|
2376
|
+
vue.watch(function () {
|
|
2377
|
+
return props.option;
|
|
2378
|
+
}, function () {
|
|
2379
|
+
fc.initOptions();
|
|
2380
|
+
fapi.refresh();
|
|
2381
|
+
}, {
|
|
2382
|
+
deep: true
|
|
2383
|
+
});
|
|
2365
2384
|
vue.watch(function () {
|
|
2366
2385
|
return _toConsumableArray(rule.value);
|
|
2367
2386
|
}, function (n) {
|
|
@@ -2372,14 +2391,6 @@
|
|
|
2372
2391
|
fc.$handle.reloadRule(rule.value);
|
|
2373
2392
|
vm.setupState.renderRule();
|
|
2374
2393
|
});
|
|
2375
|
-
vue.watch(function () {
|
|
2376
|
-
return props.option;
|
|
2377
|
-
}, function () {
|
|
2378
|
-
fc.initOptions();
|
|
2379
|
-
fapi.refresh();
|
|
2380
|
-
}, {
|
|
2381
|
-
deep: true
|
|
2382
|
-
});
|
|
2383
2394
|
vue.watch(function () {
|
|
2384
2395
|
return [props.disabled, props.preview];
|
|
2385
2396
|
}, function () {
|
|
@@ -2440,6 +2451,9 @@
|
|
|
2440
2451
|
|
|
2441
2452
|
if (!parent) {
|
|
2442
2453
|
emit$topForm();
|
|
2454
|
+
emit$scopeForm();
|
|
2455
|
+
} else if (!subForm.value) {
|
|
2456
|
+
emit$scopeForm();
|
|
2443
2457
|
}
|
|
2444
2458
|
});
|
|
2445
2459
|
}
|
|
@@ -3021,10 +3035,12 @@
|
|
|
3021
3035
|
if (option.query) {
|
|
3022
3036
|
var queryString = new URLSearchParams(option.query).toString();
|
|
3023
3037
|
|
|
3024
|
-
if (
|
|
3025
|
-
action
|
|
3026
|
-
|
|
3027
|
-
|
|
3038
|
+
if (queryString) {
|
|
3039
|
+
if (action.includes('?')) {
|
|
3040
|
+
action += "&".concat(queryString);
|
|
3041
|
+
} else {
|
|
3042
|
+
action += "?".concat(queryString);
|
|
3043
|
+
}
|
|
3028
3044
|
}
|
|
3029
3045
|
}
|
|
3030
3046
|
|
|
@@ -3164,6 +3180,20 @@
|
|
|
3164
3180
|
return api;
|
|
3165
3181
|
},
|
|
3166
3182
|
|
|
3183
|
+
get scope() {
|
|
3184
|
+
var parent = h.vm;
|
|
3185
|
+
|
|
3186
|
+
while (parent && parent.setupState.fapi) {
|
|
3187
|
+
if (!parent.props.subForm) {
|
|
3188
|
+
return parent.setupState.fapi;
|
|
3189
|
+
} else {
|
|
3190
|
+
parent = parent.setupState.parent;
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
|
|
3194
|
+
return api.top;
|
|
3195
|
+
},
|
|
3196
|
+
|
|
3167
3197
|
get children() {
|
|
3168
3198
|
return allSubForm();
|
|
3169
3199
|
},
|
|
@@ -3194,10 +3224,10 @@
|
|
|
3194
3224
|
},
|
|
3195
3225
|
|
|
3196
3226
|
formData: function formData(fields) {
|
|
3197
|
-
if (fields == null) {
|
|
3227
|
+
if (fields == null || typeof fields === 'boolean') {
|
|
3198
3228
|
var data = {};
|
|
3199
3229
|
Object.keys(h.form).forEach(function (k) {
|
|
3200
|
-
if (h.ignoreFields.indexOf(k) === -1) {
|
|
3230
|
+
if (fields === true || h.ignoreFields.indexOf(k) === -1) {
|
|
3201
3231
|
data[k] = copy(h.form[k]);
|
|
3202
3232
|
}
|
|
3203
3233
|
});
|
|
@@ -3672,6 +3702,16 @@
|
|
|
3672
3702
|
}
|
|
3673
3703
|
});
|
|
3674
3704
|
},
|
|
3705
|
+
renderRule: function renderRule(id, onInput, force) {
|
|
3706
|
+
var flag = _typeof(id) === 'object';
|
|
3707
|
+
var ctx = flag ? byCtx(id) : h.getCtx(id);
|
|
3708
|
+
return ctx ? h.$render.createRuleVnode(ctx, onInput, force) : undefined;
|
|
3709
|
+
},
|
|
3710
|
+
renderChildren: function renderChildren(id, onInput, force) {
|
|
3711
|
+
var flag = _typeof(id) === 'object';
|
|
3712
|
+
var ctx = flag ? byCtx(id) : h.getCtx(id);
|
|
3713
|
+
return ctx ? h.$render.createChildrenVnodes(ctx, onInput, force) : undefined;
|
|
3714
|
+
},
|
|
3675
3715
|
nextTick: function nextTick(fn) {
|
|
3676
3716
|
h.bus.$once('next-tick', fn);
|
|
3677
3717
|
h.refresh();
|
|
@@ -3738,7 +3778,11 @@
|
|
|
3738
3778
|
}, opt.wait == null ? 1000 : opt.wait);
|
|
3739
3779
|
},
|
|
3740
3780
|
getData: function getData(id, def) {
|
|
3741
|
-
|
|
3781
|
+
if (h.fc.get) {
|
|
3782
|
+
return h.fc.get(id, def);
|
|
3783
|
+
} else {
|
|
3784
|
+
return h.fc.getLoadData(id, def);
|
|
3785
|
+
}
|
|
3742
3786
|
},
|
|
3743
3787
|
watchData: function watchData(fn) {
|
|
3744
3788
|
return h.fc.watchLoadData(function (get, change) {
|
|
@@ -3975,7 +4019,7 @@
|
|
|
3975
4019
|
if (ctx.type === 'hidden') return;
|
|
3976
4020
|
var rule = ctx.rule;
|
|
3977
4021
|
|
|
3978
|
-
if (!this.cache[ctx.id] || this.cache[ctx.id].slot !== rule.slot) {
|
|
4022
|
+
if (this.force || !this.cache[ctx.id] || this.cache[ctx.id].slot !== rule.slot) {
|
|
3979
4023
|
var vn;
|
|
3980
4024
|
ctx.initProp();
|
|
3981
4025
|
this.mergeGlobal(ctx);
|
|
@@ -4027,6 +4071,18 @@
|
|
|
4027
4071
|
|
|
4028
4072
|
Object.keys(prop.renderSlots || {}).forEach(function (key) {
|
|
4029
4073
|
children[key] = function () {
|
|
4074
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
4075
|
+
args[_key2] = arguments[_key2];
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
if (is.Function(prop.renderSlots[key])) {
|
|
4079
|
+
return invoke(function () {
|
|
4080
|
+
var _prop$renderSlots;
|
|
4081
|
+
|
|
4082
|
+
return (_prop$renderSlots = prop.renderSlots)[key].apply(_prop$renderSlots, args);
|
|
4083
|
+
});
|
|
4084
|
+
}
|
|
4085
|
+
|
|
4030
4086
|
var rule = _this4.parseSide(prop.renderSlots[key], ctx);
|
|
4031
4087
|
|
|
4032
4088
|
return _this4.renderRule(rule);
|
|
@@ -4205,6 +4261,8 @@
|
|
|
4205
4261
|
}];
|
|
4206
4262
|
|
|
4207
4263
|
if (ctx.input) {
|
|
4264
|
+
var tmpInput = this.tmpInput;
|
|
4265
|
+
|
|
4208
4266
|
if (this.vm.props.disabled === true) {
|
|
4209
4267
|
ctx.prop.props.disabled = true;
|
|
4210
4268
|
}
|
|
@@ -4212,6 +4270,8 @@
|
|
|
4212
4270
|
var field = this.getModelField(ctx);
|
|
4213
4271
|
var model = {
|
|
4214
4272
|
callback: function callback(value) {
|
|
4273
|
+
tmpInput && tmpInput(ctx.field, value, ctx.rule);
|
|
4274
|
+
|
|
4215
4275
|
_this7.onInput(ctx, value);
|
|
4216
4276
|
},
|
|
4217
4277
|
modelField: field,
|
|
@@ -4284,6 +4344,23 @@
|
|
|
4284
4344
|
if (this.vNode[ctx.originType]) return this.vNode[ctx.originType](prop, children);
|
|
4285
4345
|
return this.vNode.make(lower(prop.type), prop, children);
|
|
4286
4346
|
},
|
|
4347
|
+
createChildrenVnodes: function createChildrenVnodes(ctx, onInput, force) {
|
|
4348
|
+
this.force = force !== false;
|
|
4349
|
+
this.tmpInput = onInput;
|
|
4350
|
+
var res = this.renderChildren(ctx.rule.children, ctx);
|
|
4351
|
+
this.force = false;
|
|
4352
|
+
this.tmpInput = null;
|
|
4353
|
+
return res;
|
|
4354
|
+
},
|
|
4355
|
+
createRuleVnode: function createRuleVnode(ctx, onInput, force) {
|
|
4356
|
+
this.force = force !== false;
|
|
4357
|
+
this.tmpInput = onInput;
|
|
4358
|
+
var slotBag = makeSlotBag();
|
|
4359
|
+
this.renderSlot(slotBag, ctx, ctx.parent);
|
|
4360
|
+
this.force = false;
|
|
4361
|
+
this.tmpInput = null;
|
|
4362
|
+
return slotBag.getSlots();
|
|
4363
|
+
},
|
|
4287
4364
|
renderRule: function renderRule(rule, children, origin) {
|
|
4288
4365
|
var _this9 = this;
|
|
4289
4366
|
|
|
@@ -4331,6 +4408,8 @@
|
|
|
4331
4408
|
vm: handle.vm,
|
|
4332
4409
|
$manager: handle.$manager,
|
|
4333
4410
|
vNode: new handle.fc.CreateNode(handle.vm),
|
|
4411
|
+
force: false,
|
|
4412
|
+
tmpInput: null,
|
|
4334
4413
|
id: id$1++
|
|
4335
4414
|
});
|
|
4336
4415
|
funcProxy(this, {
|
|
@@ -4477,7 +4556,7 @@
|
|
|
4477
4556
|
fn.__json = _fn.__json;
|
|
4478
4557
|
return fn;
|
|
4479
4558
|
},
|
|
4480
|
-
loadStrVar: function loadStrVar(str, get) {
|
|
4559
|
+
loadStrVar: function loadStrVar(str, get, group) {
|
|
4481
4560
|
var _this3 = this;
|
|
4482
4561
|
|
|
4483
4562
|
if (str && typeof str === 'string' && str.indexOf('{{') > -1 && str.indexOf('}}') > -1) {
|
|
@@ -4490,7 +4569,29 @@
|
|
|
4490
4569
|
|
|
4491
4570
|
if (field) {
|
|
4492
4571
|
var def = (split[1] || '').trim();
|
|
4493
|
-
var val
|
|
4572
|
+
var val;
|
|
4573
|
+
var flag = false;
|
|
4574
|
+
|
|
4575
|
+
if (group && field.indexOf('$form.') === 0) {
|
|
4576
|
+
var _split = field.split('.');
|
|
4577
|
+
|
|
4578
|
+
_split.shift();
|
|
4579
|
+
|
|
4580
|
+
if (hasProperty(group.value, _split[0])) {
|
|
4581
|
+
flag = true;
|
|
4582
|
+
val = get ? get({
|
|
4583
|
+
id: '$form.' + _split[0] + '_' + group.rule.__fc__.id,
|
|
4584
|
+
getValue: function getValue() {
|
|
4585
|
+
return deepGet(group.value, _split);
|
|
4586
|
+
}
|
|
4587
|
+
}) : deepGet(group.value, _split);
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
|
|
4591
|
+
if (!flag) {
|
|
4592
|
+
val = get ? get(field, def) : _this3.fc.getLoadData(field, def);
|
|
4593
|
+
}
|
|
4594
|
+
|
|
4494
4595
|
lastVal = val;
|
|
4495
4596
|
str = str.replaceAll("{{".concat(v, "}}"), val == null ? '' : val);
|
|
4496
4597
|
}
|
|
@@ -4503,11 +4604,20 @@
|
|
|
4503
4604
|
|
|
4504
4605
|
return str;
|
|
4505
4606
|
},
|
|
4506
|
-
loadFetchVar: function loadFetchVar(options, get) {
|
|
4607
|
+
loadFetchVar: function loadFetchVar(options, get, rule) {
|
|
4507
4608
|
var _this4 = this;
|
|
4508
4609
|
|
|
4610
|
+
var group;
|
|
4611
|
+
|
|
4612
|
+
if (rule && rule.__fc__) {
|
|
4613
|
+
group = rule.__fc__.getParentGroup();
|
|
4614
|
+
}
|
|
4615
|
+
|
|
4509
4616
|
var loadVal = function loadVal(str) {
|
|
4510
|
-
return _this4.loadStrVar(str, get
|
|
4617
|
+
return _this4.loadStrVar(str, get, group ? {
|
|
4618
|
+
rule: rule,
|
|
4619
|
+
value: _this4.subRuleData[group.id] || {}
|
|
4620
|
+
} : null);
|
|
4511
4621
|
};
|
|
4512
4622
|
|
|
4513
4623
|
options.action = loadVal(options.action || '');
|
|
@@ -5230,7 +5340,7 @@
|
|
|
5230
5340
|
hideLst[valid ? 'push' : 'unshift'](function () {
|
|
5231
5341
|
if (method === 'disabled' || method === 'enabled') {
|
|
5232
5342
|
_this7.api.disabled(!valid, rule);
|
|
5233
|
-
} else if (method === 'display') {
|
|
5343
|
+
} else if (method === 'display' || method === 'show') {
|
|
5234
5344
|
_this7.api.display(valid, rule);
|
|
5235
5345
|
} else if (method === 'required') {
|
|
5236
5346
|
rule.forEach(function (item) {
|
|
@@ -5240,6 +5350,8 @@
|
|
|
5240
5350
|
if (!valid) {
|
|
5241
5351
|
_this7.api.clearValidateState(rule);
|
|
5242
5352
|
}
|
|
5353
|
+
} else if (method === 'if') {
|
|
5354
|
+
_this7.api.hidden(!valid, rule);
|
|
5243
5355
|
} else {
|
|
5244
5356
|
_this7.api.hidden(!valid, rule);
|
|
5245
5357
|
}
|
|
@@ -5830,8 +5942,10 @@
|
|
|
5830
5942
|
var match = temp.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);
|
|
5831
5943
|
|
|
5832
5944
|
if (match) {
|
|
5945
|
+
var _ctx$refRule, _ctx$refRule$__$title;
|
|
5946
|
+
|
|
5833
5947
|
temp.message = _this.api.t(match[1], {
|
|
5834
|
-
title: ctx.refRule.__$title.value
|
|
5948
|
+
title: (_ctx$refRule = ctx.refRule) === null || _ctx$refRule === void 0 ? void 0 : (_ctx$refRule$__$title = _ctx$refRule.__$title) === null || _ctx$refRule$__$title === void 0 ? void 0 : _ctx$refRule$__$title.value
|
|
5835
5949
|
});
|
|
5836
5950
|
}
|
|
5837
5951
|
}
|
|
@@ -5978,7 +6092,9 @@
|
|
|
5978
6092
|
return one.handler(_this2.api, ctx.rule);
|
|
5979
6093
|
});
|
|
5980
6094
|
} else {
|
|
5981
|
-
flag =
|
|
6095
|
+
flag = invoke(function () {
|
|
6096
|
+
return new Function('$condition', '$val', '$form', '$scope', '$group', '$rule', "with($form){with($scope){with(this){with($group){ return $condition['".concat(one.condition, "'](").concat(field, ", ").concat(compare ? compare : '$val', "); }}}}")).call(_this2.api.form, condition, one.value, _this2.api.top.form, _this2.api.top === _this2.api.scope ? {} : _this2.api.scope.form, group ? _this2.subRuleData[group.id] || {} : {}, ctx.rule);
|
|
6097
|
+
});
|
|
5982
6098
|
}
|
|
5983
6099
|
|
|
5984
6100
|
if (or && flag) {
|
|
@@ -6045,7 +6161,7 @@
|
|
|
6045
6161
|
|
|
6046
6162
|
return obj;
|
|
6047
6163
|
}, {});
|
|
6048
|
-
return new Function('$formulas', '$form', '$group', '$rule', '$api', "with($form){with(this){with($group){with($formulas){ return ".concat(str, " }}}}")).call(this.api.form, formulas, this.api.top.form, group ? this.subRuleData[group.id] || {} : {}, ctx.rule, this.api);
|
|
6164
|
+
return new Function('$formulas', '$form', '$scope', '$group', '$rule', '$api', "with($form){with($scope){with(this){with($group){with($formulas){ return ".concat(str, " }}}}}")).call(this.api.form, formulas, this.api.top.form, this.api.top === this.api.scope ? {} : this.api.scope.form, group ? this.subRuleData[group.id] || {} : {}, ctx.rule, this.api);
|
|
6049
6165
|
},
|
|
6050
6166
|
updateChildren: function updateChildren(ctx, n, o) {
|
|
6051
6167
|
var _this3 = this;
|
|
@@ -6186,8 +6302,11 @@
|
|
|
6186
6302
|
hook.forEach(function (fn) {
|
|
6187
6303
|
invoke(function () {
|
|
6188
6304
|
return fn(_objectSpread2(_objectSpread2({}, args || {}), {}, {
|
|
6305
|
+
self: ctx.rule,
|
|
6189
6306
|
rule: ctx.rule,
|
|
6190
|
-
|
|
6307
|
+
$f: _this2.api,
|
|
6308
|
+
api: _this2.api,
|
|
6309
|
+
option: _this2.vm.props.option
|
|
6191
6310
|
}));
|
|
6192
6311
|
});
|
|
6193
6312
|
});
|
|
@@ -6441,10 +6560,10 @@
|
|
|
6441
6560
|
isBreakWatch: function isBreakWatch() {
|
|
6442
6561
|
return this.loading || this.noWatchFn || this.reloading;
|
|
6443
6562
|
},
|
|
6444
|
-
|
|
6563
|
+
globalBeforeFetch: function globalBeforeFetch(opt) {
|
|
6445
6564
|
var _this2 = this;
|
|
6446
6565
|
|
|
6447
|
-
return new Promise(function (resolve) {
|
|
6566
|
+
return new Promise(function (resolve, reject) {
|
|
6448
6567
|
var source = _this2.options.beforeFetch && invoke(function () {
|
|
6449
6568
|
return _this2.options.beforeFetch(opt, {
|
|
6450
6569
|
api: _this2.api
|
|
@@ -6452,11 +6571,32 @@
|
|
|
6452
6571
|
});
|
|
6453
6572
|
|
|
6454
6573
|
if (source && is.Function(source.then)) {
|
|
6455
|
-
source.then(resolve);
|
|
6574
|
+
source.then(resolve)["catch"](reject);
|
|
6456
6575
|
} else {
|
|
6457
6576
|
resolve();
|
|
6458
6577
|
}
|
|
6459
6578
|
});
|
|
6579
|
+
},
|
|
6580
|
+
beforeFetch: function beforeFetch(opt) {
|
|
6581
|
+
var _this3 = this;
|
|
6582
|
+
|
|
6583
|
+
return new Promise(function (resolve, reject) {
|
|
6584
|
+
var res = opt && opt.beforeFetch && invoke(function () {
|
|
6585
|
+
return opt.beforeFetch(opt, {
|
|
6586
|
+
api: _this3.api
|
|
6587
|
+
});
|
|
6588
|
+
});
|
|
6589
|
+
|
|
6590
|
+
if (res && is.Function(res.then)) {
|
|
6591
|
+
res.then(resolve)["catch"](reject);
|
|
6592
|
+
} else if (res === false) {
|
|
6593
|
+
reject();
|
|
6594
|
+
} else {
|
|
6595
|
+
resolve();
|
|
6596
|
+
}
|
|
6597
|
+
}).then(function () {
|
|
6598
|
+
return _this3.globalBeforeFetch(opt);
|
|
6599
|
+
});
|
|
6460
6600
|
}
|
|
6461
6601
|
});
|
|
6462
6602
|
useInject(Handler);
|
|
@@ -6658,7 +6798,7 @@
|
|
|
6658
6798
|
var loadData = {
|
|
6659
6799
|
name: 'loadData',
|
|
6660
6800
|
_fn: [],
|
|
6661
|
-
|
|
6801
|
+
mounted: function mounted(inject, rule, api) {
|
|
6662
6802
|
this.deleted(inject);
|
|
6663
6803
|
var attrs = toArray(inject.getValue());
|
|
6664
6804
|
var unwatchs = [];
|
|
@@ -6912,7 +7052,7 @@
|
|
|
6912
7052
|
return fetchAttr._fn[inject.id]();
|
|
6913
7053
|
}
|
|
6914
7054
|
|
|
6915
|
-
var _option = fc.$handle.loadFetchVar(deepCopy(option), get);
|
|
7055
|
+
var _option = fc.$handle.loadFetchVar(deepCopy(option), get, rule);
|
|
6916
7056
|
|
|
6917
7057
|
var config = _objectSpread2(_objectSpread2({
|
|
6918
7058
|
headers: {}
|
|
@@ -7153,10 +7293,12 @@
|
|
|
7153
7293
|
var globalConfig = {
|
|
7154
7294
|
global: {}
|
|
7155
7295
|
};
|
|
7156
|
-
var
|
|
7296
|
+
var isMobile = config.isMobile === true;
|
|
7297
|
+
var loadData = vue.reactive({
|
|
7298
|
+
$mobile: isMobile
|
|
7299
|
+
});
|
|
7157
7300
|
var CreateNode = CreateNodeFactory();
|
|
7158
7301
|
var formulas = {};
|
|
7159
|
-
var isMobile = config.isMobile === true;
|
|
7160
7302
|
var prototype = {};
|
|
7161
7303
|
exportAttrs(config.attrs || {});
|
|
7162
7304
|
|
|
@@ -7412,9 +7554,9 @@
|
|
|
7412
7554
|
components: components,
|
|
7413
7555
|
directives: directives
|
|
7414
7556
|
},
|
|
7557
|
+
get: null,
|
|
7415
7558
|
drivers: drivers,
|
|
7416
7559
|
renderDriver: null,
|
|
7417
|
-
get: null,
|
|
7418
7560
|
refreshData: refreshData,
|
|
7419
7561
|
loadData: loadData,
|
|
7420
7562
|
CreateNode: CreateNode,
|
|
@@ -7639,11 +7781,18 @@
|
|
|
7639
7781
|
var handle = is.Function(option) ? option : parseFn(option.handle);
|
|
7640
7782
|
|
|
7641
7783
|
if (handle) {
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7784
|
+
var val;
|
|
7785
|
+
var unwatch = this.watchLoadData(function (get, flag) {
|
|
7786
|
+
if (flag) {
|
|
7787
|
+
_this5.bus.$emit('$loadData.$var.' + key);
|
|
7788
|
+
|
|
7789
|
+
unwatch();
|
|
7790
|
+
} else {
|
|
7791
|
+
val = handle(get, _this5.$handle.api);
|
|
7792
|
+
}
|
|
7793
|
+
});
|
|
7794
|
+
this.unwatch.push(unwatch);
|
|
7795
|
+
return val;
|
|
7647
7796
|
}
|
|
7648
7797
|
}
|
|
7649
7798
|
},
|
|
@@ -7663,9 +7812,11 @@
|
|
|
7663
7812
|
var key = split.shift();
|
|
7664
7813
|
|
|
7665
7814
|
if (key === '$topForm') {
|
|
7666
|
-
val = this.$handle.api.top.formData();
|
|
7815
|
+
val = this.$handle.api.top.formData(true);
|
|
7816
|
+
} else if (key === '$scopeForm') {
|
|
7817
|
+
val = this.$handle.api.scope.formData(true);
|
|
7667
7818
|
} else if (key === '$form') {
|
|
7668
|
-
val = this.$handle.api.formData();
|
|
7819
|
+
val = this.$handle.api.formData(true);
|
|
7669
7820
|
} else if (key === '$options') {
|
|
7670
7821
|
val = this.options.value;
|
|
7671
7822
|
} else if (key === '$globalData') {
|
|
@@ -7680,6 +7831,8 @@
|
|
|
7680
7831
|
} else if (key === '$t') {
|
|
7681
7832
|
val = this.globalLanguageDriver(split.join('.'));
|
|
7682
7833
|
split = [];
|
|
7834
|
+
} else if (key === '$preview') {
|
|
7835
|
+
return this.$handle.preview;
|
|
7683
7836
|
} else {
|
|
7684
7837
|
var tmpData = this.vm.setupState.top.setupState.fc.tmpData;
|
|
7685
7838
|
|
|
@@ -7718,18 +7871,25 @@
|
|
|
7718
7871
|
};
|
|
7719
7872
|
|
|
7720
7873
|
var get = function get(id, def) {
|
|
7874
|
+
var getValue;
|
|
7875
|
+
|
|
7876
|
+
if (_typeof(id) === 'object') {
|
|
7877
|
+
getValue = id.getValue;
|
|
7878
|
+
id = id.id;
|
|
7879
|
+
}
|
|
7880
|
+
|
|
7721
7881
|
if (unwatch[id]) {
|
|
7722
7882
|
return unwatch[id].val;
|
|
7723
7883
|
}
|
|
7724
7884
|
|
|
7725
7885
|
var data = vue.computed(function () {
|
|
7726
|
-
return _this6.getLoadData(id, def);
|
|
7886
|
+
return getValue ? getValue() : _this6.getLoadData(id, def);
|
|
7727
7887
|
});
|
|
7728
7888
|
var split = id.split('.');
|
|
7729
7889
|
var key = split.shift();
|
|
7730
7890
|
var key2 = split.shift() || '';
|
|
7731
7891
|
var callback = debounce(function () {
|
|
7732
|
-
var temp = _this6.getLoadData(id, def);
|
|
7892
|
+
var temp = getValue ? getValue() : _this6.getLoadData(id, def);
|
|
7733
7893
|
|
|
7734
7894
|
if (!unwatch[id]) {
|
|
7735
7895
|
return;
|
|
@@ -8352,7 +8512,9 @@
|
|
|
8352
8512
|
},
|
|
8353
8513
|
makeInfo: function makeInfo(rule, uni, ctx) {
|
|
8354
8514
|
var _ctx$refRule,
|
|
8515
|
+
_ctx$refRule$__$title,
|
|
8355
8516
|
_ctx$refRule2,
|
|
8517
|
+
_ctx$refRule2$__$titl,
|
|
8356
8518
|
_this5 = this;
|
|
8357
8519
|
|
|
8358
8520
|
var titleProp = _objectSpread2({}, rule.title);
|
|
@@ -8363,10 +8525,10 @@
|
|
|
8363
8525
|
var form = this.options.form;
|
|
8364
8526
|
var titleSlot = this.getSlot('title');
|
|
8365
8527
|
var children = [titleSlot ? titleSlot({
|
|
8366
|
-
title: (_ctx$refRule = ctx.refRule) === null || _ctx$refRule === void 0 ? void 0 : _ctx$refRule.__$title.value,
|
|
8528
|
+
title: (_ctx$refRule = ctx.refRule) === null || _ctx$refRule === void 0 ? void 0 : (_ctx$refRule$__$title = _ctx$refRule.__$title) === null || _ctx$refRule$__$title === void 0 ? void 0 : _ctx$refRule$__$title.value,
|
|
8367
8529
|
rule: ctx.rule,
|
|
8368
8530
|
options: this.options
|
|
8369
|
-
}) : ((_ctx$refRule2 = ctx.refRule) === null || _ctx$refRule2 === void 0 ? void 0 : _ctx$refRule2.__$title.value) + (form.labelSuffix || form['label-suffix'] || '')];
|
|
8531
|
+
}) : ((_ctx$refRule2 = ctx.refRule) === null || _ctx$refRule2 === void 0 ? void 0 : (_ctx$refRule2$__$titl = _ctx$refRule2.__$title) === null || _ctx$refRule2$__$titl === void 0 ? void 0 : _ctx$refRule2$__$titl.value) + (form.labelSuffix || form['label-suffix'] || '')];
|
|
8370
8532
|
|
|
8371
8533
|
if (!isFalse(infoProp.show) && (infoProp.info || infoProp["native"]) && !isFalse(infoProp.icon)) {
|
|
8372
8534
|
var prop = {
|
|
@@ -8382,9 +8544,9 @@
|
|
|
8382
8544
|
var field = 'content';
|
|
8383
8545
|
|
|
8384
8546
|
if (infoProp.info && !hasProperty(prop.props, field)) {
|
|
8385
|
-
var _ctx$refRule3;
|
|
8547
|
+
var _ctx$refRule3, _ctx$refRule3$__$info;
|
|
8386
8548
|
|
|
8387
|
-
prop.props[field] = (_ctx$refRule3 = ctx.refRule) === null || _ctx$refRule3 === void 0 ? void 0 : _ctx$refRule3.__$info.value;
|
|
8549
|
+
prop.props[field] = (_ctx$refRule3 = ctx.refRule) === null || _ctx$refRule3 === void 0 ? void 0 : (_ctx$refRule3$__$info = _ctx$refRule3.__$info) === null || _ctx$refRule3$__$info === void 0 ? void 0 : _ctx$refRule3$__$info.value;
|
|
8388
8550
|
}
|
|
8389
8551
|
|
|
8390
8552
|
children[infoProp.align !== 'left' ? 'unshift' : 'push'](this.$r(mergeProps([infoProp, prop]), _defineProperty({}, titleProp.slot || (isTip ? 'default' : 'reference'), function () {
|
|
@@ -8783,6 +8945,8 @@
|
|
|
8783
8945
|
inject.clearProp();
|
|
8784
8946
|
api.clearValidateState([rule.field]);
|
|
8785
8947
|
} else {
|
|
8948
|
+
var _rule$__fc__$refRule$;
|
|
8949
|
+
|
|
8786
8950
|
var validate = _objectSpread2({
|
|
8787
8951
|
required: true,
|
|
8788
8952
|
validator: function validator(_, v, call) {
|
|
@@ -8790,7 +8954,7 @@
|
|
|
8790
8954
|
}
|
|
8791
8955
|
}, val);
|
|
8792
8956
|
|
|
8793
|
-
var title = rule.__fc__.refRule.__$title
|
|
8957
|
+
var title = (_rule$__fc__$refRule$ = rule.__fc__.refRule.__$title) === null || _rule$__fc__$refRule$ === void 0 ? void 0 : _rule$__fc__$refRule$.value;
|
|
8794
8958
|
|
|
8795
8959
|
if (!validate.message) {
|
|
8796
8960
|
validate.message = api.t('required', {
|
|
@@ -8863,7 +9027,7 @@
|
|
|
8863
9027
|
function elmFormCreate() {
|
|
8864
9028
|
return FormCreateFactory({
|
|
8865
9029
|
ui: 'element-ui',
|
|
8866
|
-
version: '3.2.
|
|
9030
|
+
version: '3.2.20',
|
|
8867
9031
|
manager: manager,
|
|
8868
9032
|
extendApi: extendApi,
|
|
8869
9033
|
install: install,
|