@form-create/element-ui 3.2.29 → 3.2.31
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 +404 -251
- package/dist/form-create.esm.min.js +2 -2
- package/dist/form-create.js +404 -251
- package/dist/form-create.min.js +2 -2
- package/package.json +11 -11
- package/src/core/alias.js +1 -0
- package/src/parsers/index.js +2 -0
- package/src/parsers/textarea.js +11 -0
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.31
|
|
3
3
|
* (c) 2018-2025 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -1655,9 +1655,181 @@
|
|
|
1655
1655
|
return obj instanceof Array ? _toConsumableArray(obj) : _objectSpread2({}, obj);
|
|
1656
1656
|
}
|
|
1657
1657
|
|
|
1658
|
-
var css_248z$1 = "._fc-group{display:flex;flex-direction:column;justify-content:center;min-height:38px;width:100%}._fc-group-disabled ._fc-group-add,._fc-group-disabled ._fc-group-btn{cursor:not-allowed}._fc-group-handle{background-color:#fff;border:1px dashed #d9d9d9;border-radius:15px;bottom:-15px;display:flex;flex-direction:row;padding:3px 8px;position:absolute;right:30px}._fc-group-btn{cursor:pointer}._fc-group-idx{align-items:center;background:#eee;border-radius:15px;bottom:-15px;display:flex;font-weight:700;height:30px;justify-content:center;left:10px;position:absolute;width:30px}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{border:1px dashed #d9d9d9;border-radius:5px;display:flex;flex-direction:column;margin:5px 5px 25px;padding:20px 20px 25px;position:relative}._fc-group-arrow{height:20px;position:relative;width:20px}._fc-group-arrow:before{border-left:2px solid #999;border-top:2px solid #999;content:\"\";height:9px;left:5px;position:absolute;top:8px;transform:rotate(45deg);width:9px}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{cursor:pointer;height:20px;position:relative;width:20px}._fc-group-plus-minus:after,._fc-group-plus-minus:before{background-color:#409eff;content:\"\";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60%}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{border:1px solid rgba(64,158,255,.5);border-radius:15px;cursor:pointer;height:25px;width:25px}._fc-group-add._fc-group-plus-minus:after,._fc-group-add._fc-group-plus-minus:before{width:50%}";
|
|
1658
|
+
var css_248z$1 = "._fc-group{display:flex;flex-direction:column;justify-content:center;min-height:38px;width:100%}._fc-group-disabled ._fc-group-add,._fc-group-disabled ._fc-group-btn{cursor:not-allowed}._fc-group-handle{background-color:#fff;border:1px dashed #d9d9d9;border-radius:15px;bottom:-15px;display:flex;flex-direction:row;padding:3px 8px;position:absolute;right:30px}._fc-group-btn{cursor:pointer}._fc-group-idx{align-items:center;background:#eee;border-radius:15px;bottom:-15px;display:flex;font-weight:700;height:30px;justify-content:center;left:10px;position:absolute;width:30px}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{border:1px dashed #d9d9d9;border-radius:5px;display:flex;flex-direction:column;margin:5px 5px 25px;padding:20px 20px 25px;position:relative}._fc-group-arrow{height:20px;position:relative;width:20px}._fc-group-arrow:before{border-left:2px solid #999;border-top:2px solid #999;content:\"\";height:9px;left:5px;position:absolute;top:8px;transform:rotate(45deg);width:9px}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{cursor:pointer;height:20px;position:relative;width:20px}._fc-group-plus-minus:after,._fc-group-plus-minus:before{background-color:#409eff;content:\"\";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60%}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{border:1px solid rgba(64,158,255,.5);border-radius:15px;cursor:pointer;height:25px;width:25px}._fc-group-add._fc-group-plus-minus:after,._fc-group-add._fc-group-plus-minus:before{width:50%}._fc-group._fc-group-card{display:flex;flex-direction:column;gap:16px;width:100%}._fc-group._fc-group-card._fc-group-disabled ._fc-group-add,._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{background:#fff;border:1px solid #f0f0f0;border-radius:6px;display:flex;flex-direction:column;margin:0;overflow:hidden;padding:0;position:relative}._fc-group._fc-group-card ._fc-group-header{align-items:center;background:#fafafa;border-bottom:1px solid #f0f0f0;display:flex;justify-content:space-between;padding:16px 20px 12px}._fc-group._fc-group-card ._fc-group-idx{align-items:center;background:#f0f0f0;border:1px solid #e0e0e0;border-radius:6px;color:#666;display:flex;flex-shrink:0;font-size:12px;font-weight:500;height:24px;justify-content:center;margin-right:12px;position:static;width:24px}._fc-group._fc-group-card ._fc-group-title{color:rgba(0,0,0,.85);flex:1;font-size:14px;font-weight:500;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{align-items:center;background-color:transparent;border:none;border-radius:0;bottom:auto;display:flex;flex-direction:row;flex-shrink:0;gap:4px;margin-left:12px;padding:0;position:static;right:auto}._fc-group._fc-group-card ._fc-group-btn{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-btn:hover{background:#f0f8ff;border-color:#1890ff;color:#1890ff}._fc-group._fc-group-card ._fc-group-btn:active{border-color:#096dd9;color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{border-left:1px solid;border-top:1px solid;content:\"\";height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%) rotate(45deg);width:5px}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{align-items:center;display:flex;flex-direction:column;height:24px;justify-content:center;position:relative}._fc-group._fc-group-card ._fc-group-sort:after,._fc-group._fc-group-card ._fc-group-sort:before{border-left:1px solid;border-top:1px solid;content:\"\";height:4px;left:50%;position:absolute;transform:translateX(-50%);width:4px}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translateX(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translateX(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-down,._fc-group._fc-group-card ._fc-group-sort-up{cursor:pointer;height:12px;left:0;position:absolute;right:0;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-down:hover,._fc-group._fc-group-card ._fc-group-sort-up:hover{background:rgba(24,144,255,.1)}._fc-group._fc-group-card ._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-plus-minus:before{background-color:currentColor;content:\"\";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-add:hover{background:#f0f8ff;border-color:#409eff;color:#409eff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;width:24px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{background-color:currentColor;content:\"\";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{color:rgba(0,0,0,.45);font-size:14px;padding:40px 20px;text-align:center}@media (max-width:768px){._fc-group._fc-group-card ._fc-group-container{border-left:none;border-radius:0;border-right:none;margin:0 -8px}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{height:22px;width:22px}}@media (prefers-color-scheme:dark){._fc-group._fc-group-card ._fc-group-container{background:#141414;border-color:#303030}._fc-group._fc-group-card ._fc-group-container:hover{border-color:#434343}._fc-group._fc-group-card ._fc-group-header{background:#1f1f1f;border-bottom-color:#303030}._fc-group._fc-group-card ._fc-group-title{color:hsla(0,0%,100%,.85)}._fc-group._fc-group-card ._fc-group-btn{background:#1f1f1f;border-color:#434343;color:hsla(0,0%,100%,.45)}._fc-group._fc-group-card ._fc-group-btn:hover{background:#111b26;border-color:#177ddc;color:#177ddc}._fc-group._fc-group-card ._fc-group-content{background:#141414}._fc-group._fc-group-card ._fc-group-add{background:#1f1f1f;border-color:#434343;color:hsla(0,0%,100%,.45)}._fc-group._fc-group-card ._fc-group-add:hover{background:#111b26;border-color:#177ddc;color:#177ddc}}";
|
|
1659
1659
|
styleInject(css_248z$1);
|
|
1660
1660
|
|
|
1661
|
+
function debounce(fn, wait) {
|
|
1662
|
+
var timeout = null;
|
|
1663
|
+
return function () {
|
|
1664
|
+
var _this = this;
|
|
1665
|
+
|
|
1666
|
+
for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1667
|
+
arg[_key] = arguments[_key];
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
if (timeout !== null) clearTimeout(timeout);
|
|
1671
|
+
timeout = setTimeout(function () {
|
|
1672
|
+
return fn.call.apply(fn, [_this].concat(arg));
|
|
1673
|
+
}, wait);
|
|
1674
|
+
};
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
function toString(val) {
|
|
1678
|
+
return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
function isPromise(value) {
|
|
1682
|
+
return value && _typeof(value) === 'object' && typeof value.then === 'function';
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
function toPromise(value) {
|
|
1686
|
+
if (isPromise(value)) {
|
|
1687
|
+
return value;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
return Promise.resolve(value);
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
function toLine(name) {
|
|
1694
|
+
var line = name.replace(/([A-Z])/g, '-$1').toLocaleLowerCase();
|
|
1695
|
+
if (line.indexOf('-') === 0) line = line.substr(1);
|
|
1696
|
+
return line;
|
|
1697
|
+
}
|
|
1698
|
+
function upper(str) {
|
|
1699
|
+
return str.replace(str[0], str[0].toLocaleUpperCase());
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
function format(type, msg, rule) {
|
|
1703
|
+
return "[form-create ".concat(type, "]: ").concat(msg) + (rule ? '\n\nrule: ' + JSON.stringify(rule.getRule ? rule.getRule() : rule) : '');
|
|
1704
|
+
}
|
|
1705
|
+
function err(msg, rule) {
|
|
1706
|
+
console.error(format('err', msg, rule));
|
|
1707
|
+
}
|
|
1708
|
+
function logError(e) {
|
|
1709
|
+
err(e.toString());
|
|
1710
|
+
console.error(e);
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
var PREFIX = '[[FORM-CREATE-PREFIX-';
|
|
1714
|
+
var SUFFIX = '-FORM-CREATE-SUFFIX]]';
|
|
1715
|
+
function toJson(obj, space) {
|
|
1716
|
+
return JSON.stringify(deepExtend(Array.isArray(obj) ? [] : {}, obj, true), function (key, val) {
|
|
1717
|
+
if (val && val._isVue === true) return undefined;
|
|
1718
|
+
|
|
1719
|
+
if (typeof val !== 'function') {
|
|
1720
|
+
return val;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
if (val.__json) {
|
|
1724
|
+
return val.__json;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
if (val.__origin) val = val.__origin;
|
|
1728
|
+
if (val.__emit) return undefined;
|
|
1729
|
+
return PREFIX + val + SUFFIX;
|
|
1730
|
+
}, space);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
function makeFn(fn) {
|
|
1734
|
+
return new Function('return ' + fn)();
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
function parseFn(fn, mode) {
|
|
1738
|
+
if (fn && is.String(fn) && fn.length > 4) {
|
|
1739
|
+
var v = fn.trim();
|
|
1740
|
+
var flag = false;
|
|
1741
|
+
|
|
1742
|
+
try {
|
|
1743
|
+
if (v.indexOf(SUFFIX) > 0 && v.indexOf(PREFIX) === 0) {
|
|
1744
|
+
v = v.replace(SUFFIX, '').replace(PREFIX, '');
|
|
1745
|
+
flag = true;
|
|
1746
|
+
} else if (v.indexOf('$FN:') === 0) {
|
|
1747
|
+
v = v.substring(4);
|
|
1748
|
+
flag = true;
|
|
1749
|
+
} else if (v.indexOf('$EXEC:') === 0) {
|
|
1750
|
+
v = v.substring(6);
|
|
1751
|
+
flag = true;
|
|
1752
|
+
} else if (v.indexOf('$GLOBAL:') === 0) {
|
|
1753
|
+
var name = v.substring(8);
|
|
1754
|
+
|
|
1755
|
+
v = function v() {
|
|
1756
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1757
|
+
args[_key] = arguments[_key];
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
var callback = args[0].api.getGlobalEvent(name);
|
|
1761
|
+
|
|
1762
|
+
if (callback) {
|
|
1763
|
+
return callback.call.apply(callback, [this].concat(args));
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
return undefined;
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
v.__json = fn;
|
|
1770
|
+
v.__inject = true;
|
|
1771
|
+
return v;
|
|
1772
|
+
} else if (v.indexOf('$FNX:') === 0) {
|
|
1773
|
+
v = makeFn('function($inject){\n' + v.substring(5) + '\n}');
|
|
1774
|
+
v.__json = fn;
|
|
1775
|
+
v.__inject = true;
|
|
1776
|
+
return v;
|
|
1777
|
+
} else if (!mode && v.indexOf('function ') === 0 && v !== 'function ') {
|
|
1778
|
+
flag = true;
|
|
1779
|
+
} else if (!mode && v.indexOf('function(') === 0 && v !== 'function(') {
|
|
1780
|
+
flag = true;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
if (!flag) return fn;
|
|
1784
|
+
var val;
|
|
1785
|
+
|
|
1786
|
+
try {
|
|
1787
|
+
val = makeFn(v);
|
|
1788
|
+
} catch (e) {
|
|
1789
|
+
val = makeFn('function ' + v);
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
val.__json = fn;
|
|
1793
|
+
return val;
|
|
1794
|
+
} catch (e) {
|
|
1795
|
+
err("\u89E3\u6790\u5931\u8D25:".concat(v, "\n\nerr: ").concat(e));
|
|
1796
|
+
return undefined;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
return fn;
|
|
1801
|
+
}
|
|
1802
|
+
function parseJson(json, mode) {
|
|
1803
|
+
return JSON.parse(json, function (k, v) {
|
|
1804
|
+
if (is.Undef(v) || !v.indexOf) return v;
|
|
1805
|
+
return parseFn(v, mode);
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
var id$2 = 0;
|
|
1810
|
+
function uniqueId() {
|
|
1811
|
+
var num = 370 + ++id$2;
|
|
1812
|
+
return 'F' + Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now())).toString(36) + num.toString(36) + 'c';
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
function deepSet(data, idx, val) {
|
|
1816
|
+
var _data = data,
|
|
1817
|
+
to;
|
|
1818
|
+
(idx || '').split('.').forEach(function (v) {
|
|
1819
|
+
if (to) {
|
|
1820
|
+
if (!_data[to] || _typeof(_data[to]) != 'object') {
|
|
1821
|
+
_data[to] = {};
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
_data = _data[to];
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
to = v;
|
|
1828
|
+
});
|
|
1829
|
+
_data[to] = val;
|
|
1830
|
+
return _data;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1661
1833
|
var NAME$2 = 'fcGroup';
|
|
1662
1834
|
var Group = vue.defineComponent({
|
|
1663
1835
|
name: NAME$2,
|
|
@@ -1697,6 +1869,14 @@
|
|
|
1697
1869
|
type: Boolean,
|
|
1698
1870
|
"default": true
|
|
1699
1871
|
},
|
|
1872
|
+
title: {
|
|
1873
|
+
type: [String, Function],
|
|
1874
|
+
"default": null
|
|
1875
|
+
},
|
|
1876
|
+
type: {
|
|
1877
|
+
type: String,
|
|
1878
|
+
"default": 'default'
|
|
1879
|
+
},
|
|
1700
1880
|
onBeforeRemove: {
|
|
1701
1881
|
type: Function,
|
|
1702
1882
|
"default": function _default() {}
|
|
@@ -1898,16 +2078,27 @@
|
|
|
1898
2078
|
this.input(value);
|
|
1899
2079
|
},
|
|
1900
2080
|
del: function del(index, key) {
|
|
1901
|
-
|
|
2081
|
+
var _this7 = this;
|
|
2082
|
+
|
|
2083
|
+
if (this.disabled) {
|
|
1902
2084
|
return;
|
|
1903
2085
|
}
|
|
1904
2086
|
|
|
1905
|
-
|
|
2087
|
+
var del = function del() {
|
|
2088
|
+
_this7.removeRule(key, true);
|
|
1906
2089
|
|
|
1907
|
-
|
|
2090
|
+
var value = _toConsumableArray(_this7.modelValue);
|
|
1908
2091
|
|
|
1909
|
-
|
|
1910
|
-
|
|
2092
|
+
value.splice(index, 1);
|
|
2093
|
+
|
|
2094
|
+
_this7.input(value);
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
toPromise(this.onBeforeRemove(this.modelValue, index)).then(function (res) {
|
|
2098
|
+
if (false !== res) {
|
|
2099
|
+
del();
|
|
2100
|
+
}
|
|
2101
|
+
});
|
|
1911
2102
|
},
|
|
1912
2103
|
addIcon: function addIcon(key) {
|
|
1913
2104
|
return vue.createVNode("div", {
|
|
@@ -1916,48 +2107,83 @@
|
|
|
1916
2107
|
}, null);
|
|
1917
2108
|
},
|
|
1918
2109
|
delIcon: function delIcon(index, key) {
|
|
1919
|
-
var
|
|
2110
|
+
var _this8 = this;
|
|
1920
2111
|
|
|
1921
2112
|
return vue.createVNode("div", {
|
|
1922
2113
|
"class": "_fc-group-btn _fc-group-plus-minus _fc-group-minus",
|
|
1923
2114
|
"onClick": function onClick() {
|
|
1924
|
-
return
|
|
2115
|
+
return _this8.del(index, key);
|
|
1925
2116
|
}
|
|
1926
2117
|
}, null);
|
|
1927
2118
|
},
|
|
1928
2119
|
sortUpIcon: function sortUpIcon(index) {
|
|
1929
|
-
var
|
|
2120
|
+
var _this9 = this;
|
|
1930
2121
|
|
|
1931
2122
|
return vue.createVNode("div", {
|
|
1932
2123
|
"class": "_fc-group-btn _fc-group-arrow _fc-group-up",
|
|
1933
2124
|
"onClick": function onClick() {
|
|
1934
|
-
return
|
|
2125
|
+
return _this9.changeSort(index, -1);
|
|
1935
2126
|
}
|
|
1936
2127
|
}, null);
|
|
1937
2128
|
},
|
|
1938
2129
|
sortDownIcon: function sortDownIcon(index) {
|
|
1939
|
-
var
|
|
2130
|
+
var _this10 = this;
|
|
1940
2131
|
|
|
1941
2132
|
return vue.createVNode("div", {
|
|
1942
2133
|
"class": "_fc-group-btn _fc-group-arrow _fc-group-down",
|
|
1943
2134
|
"onClick": function onClick() {
|
|
1944
|
-
return
|
|
2135
|
+
return _this10.changeSort(index, 1);
|
|
1945
2136
|
}
|
|
1946
2137
|
}, null);
|
|
1947
2138
|
},
|
|
1948
2139
|
changeSort: function changeSort(index, sort) {
|
|
1949
|
-
var
|
|
2140
|
+
var _this11 = this;
|
|
1950
2141
|
|
|
1951
2142
|
var a = this.sort[index];
|
|
1952
2143
|
this.sort[index] = this.sort[index + sort];
|
|
1953
2144
|
this.sort[index + sort] = a;
|
|
1954
2145
|
this.formCreateInject.subForm(this.sort.map(function (k) {
|
|
1955
|
-
return
|
|
2146
|
+
return _this11.cacheRule[k].$f;
|
|
1956
2147
|
}));
|
|
1957
2148
|
this.formData(0);
|
|
1958
2149
|
},
|
|
2150
|
+
sortIcon: function sortIcon(index, total) {
|
|
2151
|
+
var _this12 = this;
|
|
2152
|
+
|
|
2153
|
+
var canMoveUp = index > 0;
|
|
2154
|
+
var canMoveDown = index < total - 1;
|
|
2155
|
+
|
|
2156
|
+
if (!canMoveUp && !canMoveDown) {
|
|
2157
|
+
return null;
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
if (canMoveUp && canMoveDown) {
|
|
2161
|
+
// 显示合并的上下箭头按钮
|
|
2162
|
+
return vue.createVNode("div", {
|
|
2163
|
+
"class": "_fc-group-btn _fc-group-sort"
|
|
2164
|
+
}, [vue.createVNode("div", {
|
|
2165
|
+
"class": "_fc-group-sort-up",
|
|
2166
|
+
"onClick": function onClick() {
|
|
2167
|
+
return _this12.changeSort(index, -1);
|
|
2168
|
+
}
|
|
2169
|
+
}, null), vue.createVNode("div", {
|
|
2170
|
+
"class": "_fc-group-sort-down",
|
|
2171
|
+
"onClick": function onClick() {
|
|
2172
|
+
return _this12.changeSort(index, 1);
|
|
2173
|
+
}
|
|
2174
|
+
}, null)]);
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
if (canMoveUp) {
|
|
2178
|
+
return this.sortUpIcon(index);
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
if (canMoveDown) {
|
|
2182
|
+
return this.sortDownIcon(index);
|
|
2183
|
+
}
|
|
2184
|
+
},
|
|
1959
2185
|
makeIcon: function makeIcon(total, index, key) {
|
|
1960
|
-
var
|
|
2186
|
+
var _this13 = this;
|
|
1961
2187
|
|
|
1962
2188
|
if (this.$slots.button) {
|
|
1963
2189
|
return this.$slots.button({
|
|
@@ -1966,7 +2192,7 @@
|
|
|
1966
2192
|
vm: this,
|
|
1967
2193
|
key: key,
|
|
1968
2194
|
del: function del() {
|
|
1969
|
-
return
|
|
2195
|
+
return _this13.del(index, key);
|
|
1970
2196
|
},
|
|
1971
2197
|
add: this.add
|
|
1972
2198
|
});
|
|
@@ -1982,12 +2208,12 @@
|
|
|
1982
2208
|
btn.push(this.delIcon(index, key));
|
|
1983
2209
|
}
|
|
1984
2210
|
|
|
1985
|
-
if (this.sortBtn
|
|
1986
|
-
|
|
1987
|
-
}
|
|
2211
|
+
if (this.sortBtn) {
|
|
2212
|
+
var sortBtn = this.sortIcon(index, total);
|
|
1988
2213
|
|
|
1989
|
-
|
|
1990
|
-
|
|
2214
|
+
if (sortBtn) {
|
|
2215
|
+
btn.push(sortBtn);
|
|
2216
|
+
}
|
|
1991
2217
|
}
|
|
1992
2218
|
|
|
1993
2219
|
return btn;
|
|
@@ -1997,8 +2223,21 @@
|
|
|
1997
2223
|
},
|
|
1998
2224
|
expandRule: function expandRule(n) {
|
|
1999
2225
|
for (var i = 0; i < n; i++) {
|
|
2000
|
-
this.
|
|
2226
|
+
this.modelValue.push(this.field ? null : {});
|
|
2001
2227
|
}
|
|
2228
|
+
|
|
2229
|
+
this.input(_toConsumableArray(this.modelValue));
|
|
2230
|
+
},
|
|
2231
|
+
getTitle: function getTitle(index, key) {
|
|
2232
|
+
if (typeof this.title === 'function') {
|
|
2233
|
+
return this.title(index, this.modelValue[index], key);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
if (typeof this.title === 'string') {
|
|
2237
|
+
return this.title.replace('{index}', index + 1);
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
return false;
|
|
2002
2241
|
}
|
|
2003
2242
|
},
|
|
2004
2243
|
created: function created() {
|
|
@@ -2013,12 +2252,13 @@
|
|
|
2013
2252
|
}
|
|
2014
2253
|
},
|
|
2015
2254
|
render: function render() {
|
|
2016
|
-
var
|
|
2255
|
+
var _this14 = this;
|
|
2017
2256
|
|
|
2018
2257
|
var keys = this.sort;
|
|
2019
2258
|
var button = this.button;
|
|
2020
2259
|
var Type = this.form;
|
|
2021
2260
|
var disabled = this.disabled;
|
|
2261
|
+
var isCardType = this.type === 'card';
|
|
2022
2262
|
var children = keys.length === 0 ? this.$slots["default"] ? this.$slots["default"]({
|
|
2023
2263
|
vm: this,
|
|
2024
2264
|
add: this.add
|
|
@@ -2027,44 +2267,86 @@
|
|
|
2027
2267
|
"class": "_fc-group-plus-minus _fc-group-add fc-clock",
|
|
2028
2268
|
"onClick": this.add
|
|
2029
2269
|
}, null) : keys.map(function (key, index) {
|
|
2030
|
-
var
|
|
2031
|
-
rule =
|
|
2032
|
-
options =
|
|
2033
|
-
var btn = button && !disabled ?
|
|
2034
|
-
return vue.createVNode("div", {
|
|
2035
|
-
"class": "_fc-group-container",
|
|
2036
|
-
"key": key
|
|
2037
|
-
}, [vue.createVNode(Type, vue.mergeProps({
|
|
2038
|
-
"key": key
|
|
2039
|
-
}, {
|
|
2040
|
-
disabled: disabled,
|
|
2041
|
-
'onUpdate:modelValue': function onUpdateModelValue(formData) {
|
|
2042
|
-
return _this12.formData(key, formData);
|
|
2043
|
-
},
|
|
2044
|
-
'onEmit-event': function onEmitEvent(name) {
|
|
2045
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2046
|
-
args[_key - 1] = arguments[_key];
|
|
2047
|
-
}
|
|
2270
|
+
var _this14$cacheRule$key = _this14.cacheRule[key],
|
|
2271
|
+
rule = _this14$cacheRule$key.rule,
|
|
2272
|
+
options = _this14$cacheRule$key.options;
|
|
2273
|
+
var btn = button && !disabled ? _this14.makeIcon(keys.length, index, key) : [];
|
|
2048
2274
|
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2275
|
+
var title = _this14.getTitle(index, key);
|
|
2276
|
+
|
|
2277
|
+
if (isCardType) {
|
|
2278
|
+
return vue.createVNode("div", {
|
|
2279
|
+
"class": "_fc-group-container",
|
|
2280
|
+
"key": key
|
|
2281
|
+
}, [vue.createVNode("div", {
|
|
2282
|
+
"class": "_fc-group-header"
|
|
2283
|
+
}, [title === false ? vue.createVNode("div", {
|
|
2284
|
+
"class": "_fc-group-idx"
|
|
2285
|
+
}, [index + 1]) : null, title !== false ? vue.createVNode("div", {
|
|
2286
|
+
"class": "_fc-group-title"
|
|
2287
|
+
}, [title]) : null, vue.createVNode("div", {
|
|
2288
|
+
"class": "_fc-group-handle fc-clock"
|
|
2289
|
+
}, [btn.length ? btn : null])]), vue.createVNode("div", {
|
|
2290
|
+
"class": "_fc-group-content"
|
|
2291
|
+
}, [vue.createVNode(Type, vue.mergeProps({
|
|
2292
|
+
"key": key
|
|
2293
|
+
}, {
|
|
2294
|
+
disabled: disabled,
|
|
2295
|
+
'onUpdate:modelValue': function onUpdateModelValue(formData) {
|
|
2296
|
+
return _this14.formData(key, formData);
|
|
2297
|
+
},
|
|
2298
|
+
'onEmit-event': function onEmitEvent(name) {
|
|
2299
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2300
|
+
args[_key - 1] = arguments[_key];
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
return _this14.emitEvent(name, args, index, key);
|
|
2304
|
+
},
|
|
2305
|
+
'onUpdate:api': function onUpdateApi($f) {
|
|
2306
|
+
return _this14.add$f(index, key, $f);
|
|
2307
|
+
},
|
|
2308
|
+
inFor: true,
|
|
2309
|
+
modelValue: _this14.field ? _defineProperty({}, _this14.field, _this14._value(_this14.modelValue[index])) : _this14.modelValue[index],
|
|
2310
|
+
rule: rule,
|
|
2311
|
+
option: options,
|
|
2312
|
+
extendOption: true
|
|
2313
|
+
}), null)])]);
|
|
2314
|
+
} else {
|
|
2315
|
+
return vue.createVNode("div", {
|
|
2316
|
+
"class": "_fc-group-container",
|
|
2317
|
+
"key": key
|
|
2318
|
+
}, [vue.createVNode(Type, vue.mergeProps({
|
|
2319
|
+
"key": key
|
|
2320
|
+
}, {
|
|
2321
|
+
disabled: disabled,
|
|
2322
|
+
'onUpdate:modelValue': function onUpdateModelValue(formData) {
|
|
2323
|
+
return _this14.formData(key, formData);
|
|
2324
|
+
},
|
|
2325
|
+
'onEmit-event': function onEmitEvent(name) {
|
|
2326
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
2327
|
+
args[_key2 - 1] = arguments[_key2];
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
return _this14.emitEvent(name, args, index, key);
|
|
2331
|
+
},
|
|
2332
|
+
'onUpdate:api': function onUpdateApi($f) {
|
|
2333
|
+
return _this14.add$f(index, key, $f);
|
|
2334
|
+
},
|
|
2335
|
+
inFor: true,
|
|
2336
|
+
modelValue: _this14.field ? _defineProperty({}, _this14.field, _this14._value(_this14.modelValue[index])) : _this14.modelValue[index],
|
|
2337
|
+
rule: rule,
|
|
2338
|
+
option: options,
|
|
2339
|
+
extendOption: true
|
|
2340
|
+
}), null), vue.createVNode("div", {
|
|
2341
|
+
"class": "_fc-group-idx"
|
|
2342
|
+
}, [index + 1]), btn.length ? vue.createVNode("div", {
|
|
2343
|
+
"class": "_fc-group-handle fc-clock"
|
|
2344
|
+
}, [btn]) : null]);
|
|
2345
|
+
}
|
|
2064
2346
|
});
|
|
2065
2347
|
return vue.createVNode("div", {
|
|
2066
2348
|
"key": 'con',
|
|
2067
|
-
"class": '_fc-group ' + (disabled ? '_fc-group-disabled' : '')
|
|
2349
|
+
"class": '_fc-group ' + (disabled ? '_fc-group-disabled' : '') + (isCardType ? ' _fc-group-card' : '')
|
|
2068
2350
|
}, [children]);
|
|
2069
2351
|
}
|
|
2070
2352
|
});
|
|
@@ -2176,31 +2458,6 @@
|
|
|
2176
2458
|
|
|
2177
2459
|
var components = [Checkbox, Frame, Radio, Select, Tree, Upload, Group, Sub, script];
|
|
2178
2460
|
|
|
2179
|
-
function debounce(fn, wait) {
|
|
2180
|
-
var timeout = null;
|
|
2181
|
-
return function () {
|
|
2182
|
-
var _this = this;
|
|
2183
|
-
|
|
2184
|
-
for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2185
|
-
arg[_key] = arguments[_key];
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
if (timeout !== null) clearTimeout(timeout);
|
|
2189
|
-
timeout = setTimeout(function () {
|
|
2190
|
-
return fn.call.apply(fn, [_this].concat(arg));
|
|
2191
|
-
}, wait);
|
|
2192
|
-
};
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
function toLine(name) {
|
|
2196
|
-
var line = name.replace(/([A-Z])/g, '-$1').toLocaleLowerCase();
|
|
2197
|
-
if (line.indexOf('-') === 0) line = line.substr(1);
|
|
2198
|
-
return line;
|
|
2199
|
-
}
|
|
2200
|
-
function upper(str) {
|
|
2201
|
-
return str.replace(str[0], str[0].toLocaleUpperCase());
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
2461
|
var normalMerge = ['props'];
|
|
2205
2462
|
var toArrayMerge = ['class', 'style', 'directives'];
|
|
2206
2463
|
var functionalMerge = ['on', 'hook'];
|
|
@@ -2277,17 +2534,6 @@
|
|
|
2277
2534
|
return [].concat(keyAttrs, _toConsumableArray(normalMerge), _toConsumableArray(toArrayMerge), _toConsumableArray(functionalMerge), arrayAttrs, normalAttrs);
|
|
2278
2535
|
}
|
|
2279
2536
|
|
|
2280
|
-
function format(type, msg, rule) {
|
|
2281
|
-
return "[form-create ".concat(type, "]: ").concat(msg) + (rule ? '\n\nrule: ' + JSON.stringify(rule.getRule ? rule.getRule() : rule) : '');
|
|
2282
|
-
}
|
|
2283
|
-
function err(msg, rule) {
|
|
2284
|
-
console.error(format('err', msg, rule));
|
|
2285
|
-
}
|
|
2286
|
-
function logError(e) {
|
|
2287
|
-
err(e.toString());
|
|
2288
|
-
console.error(e);
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
2537
|
function toCase(str) {
|
|
2292
2538
|
var to = str.replace(/(-[a-z])/g, function (v) {
|
|
2293
2539
|
return v.replace('-', '').toLocaleUpperCase();
|
|
@@ -2298,102 +2544,6 @@
|
|
|
2298
2544
|
return str.replace(str[0], str[0].toLowerCase());
|
|
2299
2545
|
}
|
|
2300
2546
|
|
|
2301
|
-
var PREFIX = '[[FORM-CREATE-PREFIX-';
|
|
2302
|
-
var SUFFIX = '-FORM-CREATE-SUFFIX]]';
|
|
2303
|
-
function toJson(obj, space) {
|
|
2304
|
-
return JSON.stringify(deepExtend(Array.isArray(obj) ? [] : {}, obj, true), function (key, val) {
|
|
2305
|
-
if (val && val._isVue === true) return undefined;
|
|
2306
|
-
|
|
2307
|
-
if (typeof val !== 'function') {
|
|
2308
|
-
return val;
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
if (val.__json) {
|
|
2312
|
-
return val.__json;
|
|
2313
|
-
}
|
|
2314
|
-
|
|
2315
|
-
if (val.__origin) val = val.__origin;
|
|
2316
|
-
if (val.__emit) return undefined;
|
|
2317
|
-
return PREFIX + val + SUFFIX;
|
|
2318
|
-
}, space);
|
|
2319
|
-
}
|
|
2320
|
-
|
|
2321
|
-
function makeFn(fn) {
|
|
2322
|
-
return new Function('return ' + fn)();
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2325
|
-
function parseFn(fn, mode) {
|
|
2326
|
-
if (fn && is.String(fn) && fn.length > 4) {
|
|
2327
|
-
var v = fn.trim();
|
|
2328
|
-
var flag = false;
|
|
2329
|
-
|
|
2330
|
-
try {
|
|
2331
|
-
if (v.indexOf(SUFFIX) > 0 && v.indexOf(PREFIX) === 0) {
|
|
2332
|
-
v = v.replace(SUFFIX, '').replace(PREFIX, '');
|
|
2333
|
-
flag = true;
|
|
2334
|
-
} else if (v.indexOf('$FN:') === 0) {
|
|
2335
|
-
v = v.substring(4);
|
|
2336
|
-
flag = true;
|
|
2337
|
-
} else if (v.indexOf('$EXEC:') === 0) {
|
|
2338
|
-
v = v.substring(6);
|
|
2339
|
-
flag = true;
|
|
2340
|
-
} else if (v.indexOf('$GLOBAL:') === 0) {
|
|
2341
|
-
var name = v.substring(8);
|
|
2342
|
-
|
|
2343
|
-
v = function v() {
|
|
2344
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2345
|
-
args[_key] = arguments[_key];
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2348
|
-
var callback = args[0].api.getGlobalEvent(name);
|
|
2349
|
-
|
|
2350
|
-
if (callback) {
|
|
2351
|
-
return callback.call.apply(callback, [this].concat(args));
|
|
2352
|
-
}
|
|
2353
|
-
|
|
2354
|
-
return undefined;
|
|
2355
|
-
};
|
|
2356
|
-
|
|
2357
|
-
v.__json = fn;
|
|
2358
|
-
v.__inject = true;
|
|
2359
|
-
return v;
|
|
2360
|
-
} else if (v.indexOf('$FNX:') === 0) {
|
|
2361
|
-
v = makeFn('function($inject){\n' + v.substring(5) + '\n}');
|
|
2362
|
-
v.__json = fn;
|
|
2363
|
-
v.__inject = true;
|
|
2364
|
-
return v;
|
|
2365
|
-
} else if (!mode && v.indexOf('function ') === 0 && v !== 'function ') {
|
|
2366
|
-
flag = true;
|
|
2367
|
-
} else if (!mode && v.indexOf('function(') === 0 && v !== 'function(') {
|
|
2368
|
-
flag = true;
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
|
-
if (!flag) return fn;
|
|
2372
|
-
var val;
|
|
2373
|
-
|
|
2374
|
-
try {
|
|
2375
|
-
val = makeFn(v);
|
|
2376
|
-
} catch (e) {
|
|
2377
|
-
val = makeFn('function ' + v);
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
val.__json = fn;
|
|
2381
|
-
return val;
|
|
2382
|
-
} catch (e) {
|
|
2383
|
-
err("\u89E3\u6790\u5931\u8D25:".concat(v, "\n\nerr: ").concat(e));
|
|
2384
|
-
return undefined;
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
return fn;
|
|
2389
|
-
}
|
|
2390
|
-
function parseJson(json, mode) {
|
|
2391
|
-
return JSON.parse(json, function (k, v) {
|
|
2392
|
-
if (is.Undef(v) || !v.indexOf) return v;
|
|
2393
|
-
return parseFn(v, mode);
|
|
2394
|
-
});
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
2547
|
function enumerable(value, writable) {
|
|
2398
2548
|
return {
|
|
2399
2549
|
value: value,
|
|
@@ -3129,7 +3279,11 @@
|
|
|
3129
3279
|
}
|
|
3130
3280
|
|
|
3131
3281
|
if (option.query) {
|
|
3132
|
-
var
|
|
3282
|
+
var query = is.String(option.query) ? option.query : Object.keys(option.query).reduce(function (acc, key) {
|
|
3283
|
+
acc[key] = option.query[key] === null || option.query[key] === undefined ? '' : option.query[key];
|
|
3284
|
+
return acc;
|
|
3285
|
+
}, {});
|
|
3286
|
+
var queryString = new URLSearchParams(query).toString();
|
|
3133
3287
|
|
|
3134
3288
|
if (queryString) {
|
|
3135
3289
|
if (action.includes('?')) {
|
|
@@ -3201,7 +3355,9 @@
|
|
|
3201
3355
|
};
|
|
3202
3356
|
}
|
|
3203
3357
|
|
|
3204
|
-
|
|
3358
|
+
toPromise(fn(res, config.targetRule, api)).then(function (res) {
|
|
3359
|
+
resolve(res);
|
|
3360
|
+
});
|
|
3205
3361
|
},
|
|
3206
3362
|
onError: function onError(err) {
|
|
3207
3363
|
reject(err);
|
|
@@ -4020,34 +4176,6 @@
|
|
|
4020
4176
|
});
|
|
4021
4177
|
}
|
|
4022
4178
|
|
|
4023
|
-
function toString(val) {
|
|
4024
|
-
return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
|
|
4025
|
-
}
|
|
4026
|
-
|
|
4027
|
-
var id$2 = 0;
|
|
4028
|
-
function uniqueId() {
|
|
4029
|
-
var num = 370 + ++id$2;
|
|
4030
|
-
return 'F' + Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now())).toString(36) + num.toString(36) + 'c';
|
|
4031
|
-
}
|
|
4032
|
-
|
|
4033
|
-
function deepSet(data, idx, val) {
|
|
4034
|
-
var _data = data,
|
|
4035
|
-
to;
|
|
4036
|
-
(idx || '').split('.').forEach(function (v) {
|
|
4037
|
-
if (to) {
|
|
4038
|
-
if (!_data[to] || _typeof(_data[to]) != 'object') {
|
|
4039
|
-
_data[to] = {};
|
|
4040
|
-
}
|
|
4041
|
-
|
|
4042
|
-
_data = _data[to];
|
|
4043
|
-
}
|
|
4044
|
-
|
|
4045
|
-
to = v;
|
|
4046
|
-
});
|
|
4047
|
-
_data[to] = val;
|
|
4048
|
-
return _data;
|
|
4049
|
-
}
|
|
4050
|
-
|
|
4051
4179
|
function useRender$1(Render) {
|
|
4052
4180
|
extend(Render.prototype, {
|
|
4053
4181
|
initRender: function initRender() {
|
|
@@ -4813,7 +4941,7 @@
|
|
|
4813
4941
|
options.action = loadVal(options.action || '');
|
|
4814
4942
|
['headers', 'data', 'query'].forEach(function (key) {
|
|
4815
4943
|
if (options[key]) {
|
|
4816
|
-
var data = {};
|
|
4944
|
+
var data = Array.isArray(options[key]) ? [] : {};
|
|
4817
4945
|
Object.keys(options[key]).forEach(function (k) {
|
|
4818
4946
|
data[loadVal(k)] = loadVal(options[key][k]);
|
|
4819
4947
|
});
|
|
@@ -5114,11 +5242,17 @@
|
|
|
5114
5242
|
return this.vm === handle.vm;
|
|
5115
5243
|
},
|
|
5116
5244
|
unwatch: function unwatch() {
|
|
5245
|
+
var _this4 = this;
|
|
5246
|
+
|
|
5117
5247
|
this.watch.forEach(function (un) {
|
|
5118
5248
|
return un();
|
|
5119
5249
|
});
|
|
5120
5250
|
this.watch = [];
|
|
5121
|
-
this.refRule
|
|
5251
|
+
Object.keys(this.refRule).forEach(function (key) {
|
|
5252
|
+
if (key.indexOf('__$') !== 0) {
|
|
5253
|
+
delete _this4.refRule[key];
|
|
5254
|
+
}
|
|
5255
|
+
});
|
|
5122
5256
|
},
|
|
5123
5257
|
unlink: function unlink() {
|
|
5124
5258
|
this.linkOn.forEach(function (un) {
|
|
@@ -5158,15 +5292,15 @@
|
|
|
5158
5292
|
this.ctrlRule = [];
|
|
5159
5293
|
},
|
|
5160
5294
|
rm: function rm() {
|
|
5161
|
-
var
|
|
5295
|
+
var _this5 = this;
|
|
5162
5296
|
|
|
5163
5297
|
var _rm = function _rm() {
|
|
5164
|
-
var index =
|
|
5298
|
+
var index = _this5.root.indexOf(_this5.origin);
|
|
5165
5299
|
|
|
5166
5300
|
if (index > -1) {
|
|
5167
|
-
|
|
5301
|
+
_this5.root.splice(index, 1);
|
|
5168
5302
|
|
|
5169
|
-
|
|
5303
|
+
_this5.$handle && _this5.$handle.refresh();
|
|
5170
5304
|
}
|
|
5171
5305
|
};
|
|
5172
5306
|
|
|
@@ -5177,17 +5311,17 @@
|
|
|
5177
5311
|
}
|
|
5178
5312
|
|
|
5179
5313
|
this.$handle.noWatch(function () {
|
|
5180
|
-
|
|
5181
|
-
|
|
5314
|
+
_this5.$handle.deferSyncValue(function () {
|
|
5315
|
+
_this5.rmCtrl();
|
|
5182
5316
|
|
|
5183
5317
|
_rm();
|
|
5184
5318
|
|
|
5185
|
-
|
|
5319
|
+
_this5.$handle.rmCtx(_this5);
|
|
5186
5320
|
|
|
5187
|
-
extend(
|
|
5321
|
+
extend(_this5, {
|
|
5188
5322
|
root: []
|
|
5189
5323
|
});
|
|
5190
|
-
},
|
|
5324
|
+
}, _this5.input);
|
|
5191
5325
|
});
|
|
5192
5326
|
},
|
|
5193
5327
|
update: function update(handle, init) {
|
|
@@ -5803,7 +5937,7 @@
|
|
|
5803
5937
|
return ctx.rule.ignore === true || (ctx.rule.ignore === 'hidden' || this.options.ignoreHiddenFields) && ctx.hasHidden();
|
|
5804
5938
|
},
|
|
5805
5939
|
appendValue: function appendValue(rule) {
|
|
5806
|
-
if ((!rule.field || !hasProperty(this.appendData, rule.field)) && !this.options.forceCoverValue) {
|
|
5940
|
+
if ((!rule.field || !hasProperty(this.appendData, rule.field)) && (!is.Undef(rule.value) || !this.options.forceCoverValue)) {
|
|
5807
5941
|
return;
|
|
5808
5942
|
}
|
|
5809
5943
|
|
|
@@ -6634,7 +6768,7 @@
|
|
|
6634
6768
|
return val;
|
|
6635
6769
|
} else if (is.Function(item)) {
|
|
6636
6770
|
fn = function fn() {
|
|
6637
|
-
return item(_this4.api.form, _this4.api);
|
|
6771
|
+
return item(_this4.api.form, _this4.api, ctx.rule);
|
|
6638
6772
|
};
|
|
6639
6773
|
} else {
|
|
6640
6774
|
var _group = ctx.getParentGroup();
|
|
@@ -7621,7 +7755,9 @@
|
|
|
7621
7755
|
}
|
|
7622
7756
|
|
|
7623
7757
|
if (option.key) {
|
|
7758
|
+
fc.targetRule = rule;
|
|
7624
7759
|
var res = get('$globalData.' + option.key);
|
|
7760
|
+
delete fc.targetRule;
|
|
7625
7761
|
|
|
7626
7762
|
if (res) {
|
|
7627
7763
|
if (check()) return;
|
|
@@ -7653,7 +7789,9 @@
|
|
|
7653
7789
|
};
|
|
7654
7790
|
}
|
|
7655
7791
|
|
|
7656
|
-
|
|
7792
|
+
toPromise(fn(body, rule, api)).then(function (res) {
|
|
7793
|
+
set(res);
|
|
7794
|
+
});
|
|
7657
7795
|
},
|
|
7658
7796
|
onError: function onError(e) {
|
|
7659
7797
|
set(undefined);
|
|
@@ -7670,12 +7808,11 @@
|
|
|
7670
7808
|
api: api
|
|
7671
7809
|
}).then(function () {
|
|
7672
7810
|
if (is.Function(_option.action)) {
|
|
7673
|
-
_option.action(rule, api).then(function (val) {
|
|
7811
|
+
toPromise(_option.action(rule, api)).then(function (val) {
|
|
7674
7812
|
config.onSuccess(val, true);
|
|
7675
7813
|
})["catch"](function (e) {
|
|
7676
7814
|
config.onError(e);
|
|
7677
7815
|
});
|
|
7678
|
-
|
|
7679
7816
|
return;
|
|
7680
7817
|
}
|
|
7681
7818
|
|
|
@@ -7719,9 +7856,9 @@
|
|
|
7719
7856
|
componentValidate: componentValidate
|
|
7720
7857
|
};
|
|
7721
7858
|
|
|
7722
|
-
var name$
|
|
7859
|
+
var name$7 = 'html';
|
|
7723
7860
|
var html = {
|
|
7724
|
-
name: name$
|
|
7861
|
+
name: name$7,
|
|
7725
7862
|
loadChildren: false,
|
|
7726
7863
|
render: function render(children, ctx) {
|
|
7727
7864
|
ctx.prop.props.innerHTML = children["default"]();
|
|
@@ -8359,6 +8496,8 @@
|
|
|
8359
8496
|
|
|
8360
8497
|
var options = _this4.$handle.loadFetchVar(copy$1(option), get);
|
|
8361
8498
|
|
|
8499
|
+
options.targetRule = _this4.targetRule;
|
|
8500
|
+
|
|
8362
8501
|
_this4.$handle.api.fetch(options).then(function (res) {
|
|
8363
8502
|
_emit(res);
|
|
8364
8503
|
})["catch"](function (e) {
|
|
@@ -8782,12 +8921,12 @@
|
|
|
8782
8921
|
datetimerange: 'YYYY-MM-DD HH:mm:ss',
|
|
8783
8922
|
year: 'YYYY'
|
|
8784
8923
|
};
|
|
8785
|
-
var name$
|
|
8924
|
+
var name$6 = 'datePicker';
|
|
8786
8925
|
var datePicker = {
|
|
8787
|
-
name: name$
|
|
8926
|
+
name: name$6,
|
|
8788
8927
|
maker: function () {
|
|
8789
8928
|
return ['year', 'month', 'date', 'dates', 'week', 'datetime', 'datetimeRange', 'dateRange', 'monthRange'].reduce(function (initial, type) {
|
|
8790
|
-
initial[type] = creatorFactory(name$
|
|
8929
|
+
initial[type] = creatorFactory(name$6, {
|
|
8791
8930
|
type: type.toLowerCase()
|
|
8792
8931
|
});
|
|
8793
8932
|
return initial;
|
|
@@ -8802,28 +8941,28 @@
|
|
|
8802
8941
|
}
|
|
8803
8942
|
};
|
|
8804
8943
|
|
|
8805
|
-
var name$
|
|
8944
|
+
var name$5 = 'hidden';
|
|
8806
8945
|
var hidden = {
|
|
8807
|
-
name: name$
|
|
8808
|
-
maker: _defineProperty({}, name$
|
|
8809
|
-
return creatorFactory(name$
|
|
8946
|
+
name: name$5,
|
|
8947
|
+
maker: _defineProperty({}, name$5, function (field, value) {
|
|
8948
|
+
return creatorFactory(name$5)('', field, value);
|
|
8810
8949
|
}),
|
|
8811
8950
|
render: function render() {
|
|
8812
8951
|
return [];
|
|
8813
8952
|
}
|
|
8814
8953
|
};
|
|
8815
8954
|
|
|
8816
|
-
var name$
|
|
8955
|
+
var name$4 = 'input';
|
|
8817
8956
|
var input = {
|
|
8818
|
-
name: name$
|
|
8957
|
+
name: name$4,
|
|
8819
8958
|
maker: function () {
|
|
8820
8959
|
var maker = ['password', 'url', 'email', 'text', 'textarea'].reduce(function (maker, type) {
|
|
8821
|
-
maker[type] = creatorFactory(name$
|
|
8960
|
+
maker[type] = creatorFactory(name$4, {
|
|
8822
8961
|
type: type
|
|
8823
8962
|
});
|
|
8824
8963
|
return maker;
|
|
8825
8964
|
}, {});
|
|
8826
|
-
maker.idate = creatorFactory(name$
|
|
8965
|
+
maker.idate = creatorFactory(name$4, {
|
|
8827
8966
|
type: 'date'
|
|
8828
8967
|
});
|
|
8829
8968
|
return maker;
|
|
@@ -8837,6 +8976,19 @@
|
|
|
8837
8976
|
}
|
|
8838
8977
|
};
|
|
8839
8978
|
|
|
8979
|
+
var name$3 = 'textarea';
|
|
8980
|
+
var textarea = {
|
|
8981
|
+
name: name$3,
|
|
8982
|
+
mergeProp: function mergeProp(ctx) {
|
|
8983
|
+
var props = ctx.prop.props;
|
|
8984
|
+
props.type = 'textarea';
|
|
8985
|
+
|
|
8986
|
+
if (props && props.autosize && props.autosize.minRows) {
|
|
8987
|
+
props.rows = props.autosize.minRows || 2;
|
|
8988
|
+
}
|
|
8989
|
+
}
|
|
8990
|
+
};
|
|
8991
|
+
|
|
8840
8992
|
var name$2 = 'slider';
|
|
8841
8993
|
var slider = {
|
|
8842
8994
|
name: name$2,
|
|
@@ -8908,7 +9060,7 @@
|
|
|
8908
9060
|
}
|
|
8909
9061
|
};
|
|
8910
9062
|
|
|
8911
|
-
var parsers = [datePicker, hidden, input, slider, timePicker, row, select];
|
|
9063
|
+
var parsers = [datePicker, hidden, input, textarea, slider, timePicker, row, select];
|
|
8912
9064
|
|
|
8913
9065
|
var PRE = 'el';
|
|
8914
9066
|
var alias = {
|
|
@@ -8931,6 +9083,7 @@
|
|
|
8931
9083
|
inputNumber: PRE + '-input-number',
|
|
8932
9084
|
number: PRE + '-input-number',
|
|
8933
9085
|
input: PRE + '-input',
|
|
9086
|
+
textarea: PRE + '-input',
|
|
8934
9087
|
formItem: PRE + '-form-item',
|
|
8935
9088
|
form: PRE + '-form',
|
|
8936
9089
|
frame: 'fc-frame',
|
|
@@ -9694,7 +9847,7 @@
|
|
|
9694
9847
|
function elmFormCreate() {
|
|
9695
9848
|
return FormCreateFactory({
|
|
9696
9849
|
ui: 'element-ui',
|
|
9697
|
-
version: '3.2.
|
|
9850
|
+
version: '3.2.31',
|
|
9698
9851
|
manager: manager,
|
|
9699
9852
|
extendApi: extendApi,
|
|
9700
9853
|
install: install,
|