@form-create/element-ui 3.1.25 → 3.1.27
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 +16 -11
- package/dist/form-create.esm.min.js +3 -3
- package/dist/form-create.js +16 -11
- package/dist/form-create.min.js +3 -3
- package/package.json +6 -6
- package/src/core/manager.js +1 -1
package/dist/form-create.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @form-create/element-ui v3.1.
|
|
3
|
-
* (c) 2018-
|
|
2
|
+
* @form-create/element-ui v3.1.27
|
|
3
|
+
* (c) 2018-2024 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
@@ -346,7 +346,7 @@ function styleInject(css, ref) {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
var css_248z$3 = "._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}";
|
|
349
|
+
var css_248z$3 = "._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled .el-button{color:#999;cursor:not-allowed!important}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}";
|
|
350
350
|
styleInject(css_248z$3);
|
|
351
351
|
|
|
352
352
|
var script$6 = {
|
|
@@ -645,7 +645,7 @@ var Frame = defineComponent({
|
|
|
645
645
|
}, null);
|
|
646
646
|
},
|
|
647
647
|
suffix: function suffix() {
|
|
648
|
-
return _this.fileList.length ? createVNode(resolveComponent("ElIcon"), {
|
|
648
|
+
return _this.fileList.length && !_this.disabled ? createVNode(resolveComponent("ElIcon"), {
|
|
649
649
|
"class": "el-input__icon _fc-upload-icon",
|
|
650
650
|
"onClick": function onClick() {
|
|
651
651
|
_this.fileList = [];
|
|
@@ -888,7 +888,10 @@ var Frame = defineComponent({
|
|
|
888
888
|
}
|
|
889
889
|
});
|
|
890
890
|
return createVNode("div", {
|
|
891
|
-
"class":
|
|
891
|
+
"class": {
|
|
892
|
+
'_fc-frame': true,
|
|
893
|
+
'_fc-disabled': this.disabled
|
|
894
|
+
}
|
|
892
895
|
}, [node, createVNode(resolveComponent("ElDialog"), {
|
|
893
896
|
"appendToBody": true,
|
|
894
897
|
"modal": this.previewMask,
|
|
@@ -1189,7 +1192,7 @@ var Tree = defineComponent({
|
|
|
1189
1192
|
}
|
|
1190
1193
|
});
|
|
1191
1194
|
|
|
1192
|
-
var css_248z$2 = "._fc-exceed .el-upload{display:none}";
|
|
1195
|
+
var css_248z$2 = "._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}";
|
|
1193
1196
|
styleInject(css_248z$2);
|
|
1194
1197
|
|
|
1195
1198
|
var script$1 = {
|
|
@@ -1759,7 +1762,7 @@ var Group = defineComponent({
|
|
|
1759
1762
|
},
|
|
1760
1763
|
expandRule: function expandRule(n) {
|
|
1761
1764
|
for (var i = 0; i < n; i++) {
|
|
1762
|
-
this.
|
|
1765
|
+
this.addRule(i);
|
|
1763
1766
|
}
|
|
1764
1767
|
}
|
|
1765
1768
|
},
|
|
@@ -3225,7 +3228,7 @@ function useRender$1(Render) {
|
|
|
3225
3228
|
_vn = _this4.display(_vn);
|
|
3226
3229
|
}
|
|
3227
3230
|
|
|
3228
|
-
cacheFlag && _this4.setCache(ctx, function () {
|
|
3231
|
+
cacheFlag && !Object.keys(children).length && _this4.setCache(ctx, function () {
|
|
3229
3232
|
return _vn;
|
|
3230
3233
|
}, parent);
|
|
3231
3234
|
return _vn;
|
|
@@ -3799,6 +3802,8 @@ extend(RuleContext.prototype, {
|
|
|
3799
3802
|
|
|
3800
3803
|
onLoad && onLoad(value);
|
|
3801
3804
|
_this2.$api && _this2.$api.sync(_this2.rule);
|
|
3805
|
+
})["catch"](function (e) {
|
|
3806
|
+
console.error(e);
|
|
3802
3807
|
});
|
|
3803
3808
|
value = def;
|
|
3804
3809
|
this.setPending(key, origin, value);
|
|
@@ -4822,7 +4827,7 @@ function useContext(Handler) {
|
|
|
4822
4827
|
|
|
4823
4828
|
this.deferSyncValue(function () {
|
|
4824
4829
|
o && o.forEach(function (child) {
|
|
4825
|
-
if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__ && child.__fc__.parent === ctx) {
|
|
4830
|
+
if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__ && child.__fc__.parent === ctx && child.__fc__.root === o) {
|
|
4826
4831
|
_this2.rmCtx(child.__fc__);
|
|
4827
4832
|
}
|
|
4828
4833
|
});
|
|
@@ -6572,7 +6577,7 @@ var manager = {
|
|
|
6572
6577
|
on: {
|
|
6573
6578
|
click: function click() {
|
|
6574
6579
|
var fApi = _this6.$handle.api;
|
|
6575
|
-
_this6.options.submitBtn.click ? _this6.options.submitBtn.click(fApi) : fApi.submit();
|
|
6580
|
+
_this6.options.submitBtn.click ? _this6.options.submitBtn.click(fApi) : fApi.submit()["catch"](function () {});
|
|
6576
6581
|
}
|
|
6577
6582
|
},
|
|
6578
6583
|
key: "".concat(this.key, "b1")
|
|
@@ -6915,7 +6920,7 @@ function install(FormCreate) {
|
|
|
6915
6920
|
function elmFormCreate() {
|
|
6916
6921
|
return FormCreateFactory({
|
|
6917
6922
|
ui: 'element-ui',
|
|
6918
|
-
version: '3.1.
|
|
6923
|
+
version: '3.1.27',
|
|
6919
6924
|
manager: manager,
|
|
6920
6925
|
extendApi: extendApi,
|
|
6921
6926
|
install: install,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @form-create/element-ui v3.1.
|
|
3
|
-
* (c) 2018-
|
|
2
|
+
* @form-create/element-ui v3.1.27
|
|
3
|
+
* (c) 2018-2024 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{defineComponent as e,toRef as t,resolveComponent as n,createVNode as r,mergeProps as i,openBlock as o,createElementBlock as a,createElementVNode as u,isVNode as c,nextTick as l,Fragment as s,markRaw as f,watch as d,reactive as p,getCurrentInstance as h,provide as m,inject as v,toRefs as g,onMounted as y,onBeforeUnmount as b,onUpdated as x,computed as _,withDirectives as w,resolveDirective as k,createApp as $,h as C,ref as O}from"vue";function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}function A(e,t){return A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},A(e,t)}function P(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R(e);if(t){var i=R(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return P(this,n)}}function B(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t){return Object.keys(e).reduce((function(n,r){return t&&-1!==t.indexOf(r)||n.push(e[r]),n}),[])}var M=e({name:"fcCheckbox",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:function(){return[]}},type:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t(e.formCreateInject,"options",[]);return{options:function(){return Array.isArray(r.value)?r.value:[]},value:t(e,"modelValue"),onInput:function(e){n.emit("update:modelValue",e)}}},render:function(){var e,t,o=this,a="button"===this.type?"ElCheckboxButton":"ElCheckbox",u=n(a);return r(n("ElCheckboxGroup"),i(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),V({default:function(){return[o.options().map((function(e,t){var n=V({},e),o=n.value;return delete n.value,r(u,i(n,{label:o,key:a+t+"-"+e.value}),{default:function(){return[n.label||n.value||""]}})})),null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t)]}},T(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}});function N(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}function L(e){e=e||new Map;var t={$on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},$once:function(e,n){n._once=!0,t.$on(e,n)},$off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},$emit:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(e.get(n)||[]).slice().map((function(e){e._once&&(t.$off(n,e),delete e._once),e.apply(void 0,i)})),(e.get("*")||[]).slice().map((function(e){e(n,i)}))}};return t}function U(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}U("._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}");var H={name:"IconCircleClose"},z={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Y=[u("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),u("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1)];H.render=function(e,t,n,r,i,u){return o(),a("svg",z,Y)};var q={name:"IconDocument"},W={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},J=[u("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"},null,-1)];q.render=function(e,t,n,r,i,u){return o(),a("svg",W,J)};var K={name:"IconDelete"},G={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},X=[u("path",{fill:"currentColor",d:"M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"},null,-1)];K.render=function(e,t,n,r,i,u){return o(),a("svg",G,X)};var Q={name:"IconView"},Z={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},ee=[u("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1)];Q.render=function(e,t,n,r,i,u){return o(),a("svg",Z,ee)};var te={name:"IconFolderOpened"},ne={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},re=[u("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"},null,-1)];function ie(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!c(e)}te.render=function(e,t,n,r,i,u){return o(),a("svg",ne,re)};var oe=e({name:"fcFrame",props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"IconFolderOpened"},width:{type:String,default:"500px"},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:"确定"},closeBtnText:{type:String,default:"关闭"},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:function(){}},onOk:{type:Function,default:function(){}},onCancel:{type:Function,default:function(){}},onLoad:{type:Function,default:function(){}},onBeforeRemove:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},onHandle:Function,modal:{type:Object,default:function(){return{}}},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolderOpened:te,IconView:Q},data:function(){return{fileList:N(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new L}},watch:{modelValue:function(e){this.fileList=N(e)}},methods:{close:function(){this.closeModel(!0)},closeModel:function(e){this.bus.$emit(e?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel:function(){this.previewVisible=!1},showModel:function(){this.disabled||!1===this.onOpen()||(this.frameVisible=!0)},input:function(){var e=this.fileList,t=1===this.maxLength?e[0]||"":e;this.$emit("update:modelValue",t),this.$emit("change",t)},makeInput:function(){var e=this;return r(n("ElInput"),i({type:"text",modelValue:this.fileList.map((function(t){return e.getSrc(t)})).toString(),readonly:!0},{key:1}),{append:function(){return r(n("ElButton"),{icon:n(e.icon),onClick:function(){return e.showModel()}},null)},suffix:function(){return e.fileList.length?r(n("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:function(){e.fileList=[],e.input()}},{default:function(){return[r(H,null,null)]}}):null}})},makeGroup:function(e){return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),r("div",{key:2},[e])},makeItem:function(e,t){return r("div",{class:"_fc-files",key:"3"+e},[t])},valid:function(e){var t=this.formCreateInject.field||this.field;if(t&&e!==t)throw new Error("[frame]无效的字段值")},makeIcons:function(e,t){if(!1!==this.handleIcon||!0===this.allowRemove){var n=[];return("file"!==this.type&&!1!==this.handleIcon||"file"===this.type&&this.handleIcon)&&n.push(this.makeHandleIcon(e,t)),this.allowRemove&&n.push(this.makeRemoveIcon(e,t)),r("div",{class:"_fc-upload-cover",key:4},[n])}},makeHandleIcon:function(e,t){var i=this,o=n(!0===this.handleIcon||void 0===this.handleIcon?"icon-view":this.handleIcon);return r(n("ElIcon"),{onClick:function(){return i.handleClick(e)},key:"5"+t},{default:function(){return[r(o,null,null)]}})},makeRemoveIcon:function(e,t){var i=this;return r(n("ElIcon"),{onClick:function(){return i.handleRemove(e)},key:"6"+t},{default:function(){return[r(K,null,null)]}})},makeFiles:function(){var e=this;return this.makeGroup(this.fileList.map((function(t,i){return e.makeItem(i,[r(n("ElIcon"),{onClick:function(){return e.handleClick(t)}},{default:function(){return[r(q,null,null)]}}),e.makeIcons(t,i)])})))},makeImages:function(){var e=this;return this.makeGroup(this.fileList.map((function(t,n){return e.makeItem(n,[r("img",{src:e.getSrc(t)},null),e.makeIcons(t,n)])})))},makeBtn:function(){var e=this,t=n(this.icon);return r("div",{class:"_fc-upload-btn",onClick:function(){return e.showModel()},key:7},[r(n("ElIcon"),null,{default:function(){return[r(t,null,null)]}})])},handleClick:function(e){if(this.onHandle)return this.onHandle(e);this.previewImage=this.getSrc(e),this.previewVisible=!0},handleRemove:function(e){this.disabled||!1!==this.onBeforeRemove(e)&&(this.fileList.splice(this.fileList.indexOf(e),1),this.input(),this.onRemove(e))},getSrc:function(e){return this.srcKey?e[this.srcKey]:e},frameLoad:function(e){var t=this;this.onLoad(e);try{!0===this.helper&&(e.form_create_helper={api:this.formCreateInject.api,close:function(e){t.valid(e),t.closeModel()},set:function(e,n){t.valid(e),!t.disabled&&t.$emit("update:modelValue",n)},get:function(e){return t.valid(e),t.modelValue},onOk:function(e){return t.bus.$on("$ok",e)},onClose:function(e){return t.bus.$on("$close",e)}})}catch(e){console.error(e)}},makeFooter:function(){var e=this,t=this.$props,i=t.okBtnText,o=t.closeBtnText,a=t.closeBtn,u=t.okBtn;if(t.footer)return r("div",null,[a?r(n("ElButton"),{onClick:function(){return!1!==e.onCancel()&&(e.frameVisible=!1)}},ie(o)?o:{default:function(){return[o]}}):null,u?r(n("ElButton"),{type:"primary",onClick:function(){return!1!==e.onOk()&&e.closeModel()}},ie(i)?i:{default:function(){return[i]}}):null])}},render:function(){var e,t=this,o=this.type;e="input"===o?this.makeInput():"image"===o?this.makeImages():this.makeFiles();var a=this.$props,u=a.width,c=void 0===u?"30%":u,s=a.height,f=a.src,d=a.title,p=a.modalTitle;return l((function(){t.$refs.frame&&t.frameLoad(t.$refs.frame.contentWindow||{})})),r("div",{class:"_fc-frame"},[e,r(n("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:p,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[r("img",{style:"width: 100%",src:t.previewImage},null)]}}),r(n("ElDialog"),i({appendToBody:!0},V({width:c,title:d},this.modal),{modelValue:this.frameVisible,onClose:function(){return t.closeModel(!0)}}),{default:function(){return[t.frameVisible||!t.reload?r("iframe",{ref:"frame",src:f,frameBorder:"0",style:{height:s,border:"0 none",width:"100%"}},null):null]},footer:function(){return t.makeFooter()}})])},beforeMount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.on("fc:closeModal:"+t,this.close),n&&r.on("fc:closeModal:"+n,this.close)},beforeUnmount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.off("fc:closeModal:"+t,this.close),n&&r.off("fc:closeModal:"+n,this.close)}}),ae=e({name:"fcRadio",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},type:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t(e.formCreateInject,"options",[]);return{options:function(){return Array.isArray(r.value)?r.value:[]},value:t(e,"modelValue"),onInput:function(e){n.emit("update:modelValue",e)}}},render:function(){var e,t,o=this,a="button"===this.type?"ElRadioButton":"ElRadio",u=n(a);return r(n("ElRadioGroup"),i(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),V({default:function(){return[o.options().map((function(e,t){var n=V({},e),o=n.value;return delete n.value,r(u,i(n,{label:o,key:a+t+"-"+e.value}),{default:function(){return[n.label||n.value||""]}})})),null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t)]}},T(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),ue={type:function(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef:function(e){return null==e},Element:function(e){return"object"===F(e)&&null!==e&&1===e.nodeType&&!ue.Object(e)},trueArray:function(e){return Array.isArray(e)&&e.length>0},Function:function(e){var t=this.getType(e);return"Function"===t||"AsyncFunction"===t},getType:function(e){var t=Object.prototype.toString.call(e);return/^\[object (.*)\]$/.exec(t)[1]},empty:function(e){return null==e||(!(!Array.isArray(e)||!Array.isArray(e)||e.length)||"string"==typeof e&&!e)}};function ce(e,t){return{}.hasOwnProperty.call(e,t)}["Date","Object","String","Boolean","Array","Number"].forEach((function(e){ue[e]=function(t){return ue.type(t,e)}}));var le=e({name:"fcSelect",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup:function(e){var n=t(e.formCreateInject,"options",[]);return{options:function(){return Array.isArray(n.value)?n.value:[]},value:t(e,"modelValue")}},render:function(){var e,t,o=this,a=function(e,t){return r(n("ElOption"),i(e,{key:t+"-"+e.value}),null)},u=this.options();return r(n("ElSelect"),i(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":function(e){return o.$emit("update:modelValue",e)},ref:"el"}),V({default:function(){return[u.map((function(e,t){return ce(e||"","options")?function(e,t){return r(n("ElOptionGroup"),{label:e.label,key:t+"-"+e.label},{default:function(){return[ue.trueArray(e.options)&&e.options.map((function(e,t){return a(e,t)}))]}})}(e,t):a(e,t)})),null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t)]}},T(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),se=e({name:"fcTree",inheritAttrs:!1,formCreateParser:{mergeProp:function(e){var t=e.prop.props;t.nodeKey||(t.nodeKey="id"),t.props||(t.props={label:"title"})}},props:{type:String,modelValue:{type:[Array,String,Number],default:function(){return[]}}},emits:["update:modelValue","fc.el"],watch:{modelValue:function(){this.setValue()}},methods:{updateValue:function(){var e;this.$refs.tree&&(e="selected"===this.type?this.$refs.tree.getCurrentKey():this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",e))},setValue:function(){this.$refs.tree&&("selected"===this.type?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(N(this.modelValue)))}},render:function(){return r(n("ElTree"),i(this.$attrs,{ref:"tree",onCheck:this.updateValue,"onNode-click":this.updateValue}),this.$slots)},mounted:function(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}});U("._fc-exceed .el-upload{display:none}");var fe={name:"IconUpload"},de={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},pe=[u("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)];function he(e,t){return{url:e,name:me(e),uid:t}}function me(e){return(""+e).split("/").pop()}fe.render=function(e,t,n,r,i,u){return o(),a("svg",de,pe)};var ve=e({name:"fcUpload",inheritAttrs:!1,formCreateParser:{toFormValue:function(e){return N(e)},toValue:function(e,t){return 1===t.prop.props.limit?e[0]||"":e}},props:{previewMask:void 0,onPreview:Function,modalTitle:String,modelValue:[Array,String]},emits:["update:modelValue","change","remove","fc.el"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=N(this.modelValue).map(he)},watch:{modelValue:function(e){this.fileList=N(e).map(he)}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)}},render:function(){var e,t,o=this,a=N(this.modelValue).length;return r(s,null,[r(n("ElUpload"),i({key:a,"list-type":"picture-card"},this.$attrs,{class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=a},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,fileList:this.fileList,ref:"upload"}),V({default:function(){return[(null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t))||r(n("ElIcon"),null,{default:function(){return[r(fe,null,null)]}})]}},T(this.$slots,["default"]))),r(n("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[r("img",{style:"width: 100%",src:o.previewImage},null)]}})])},mounted:function(){this.$emit("fc.el",this.$refs.upload)}});function ge(e,t,n){e[t]=n}function ye(e,t){delete e[t]}function be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];if((r=Array.isArray(o))||ue.Object(o)){var a=void 0===e[i];if(r)r=!1,a&&ge(e,i,[]);else if(o._clone&&void 0!==n){if(!n){ge(e,i,o._clone());continue}o=o.getRule(),a&&ge(e,i,{})}else a&&ge(e,i,{});e[i]=be(e[i],o,n)}else ge(e,i,o),ue.Undef(o)||(ue.Undef(o.__json)||(e[i].__json=o.__json),ue.Undef(o.__origin)||(e[i].__origin=o.__origin))}return void 0!==n&&Array.isArray(e)?e.filter((function(e){return!e||!e.__ctrl})):e}function xe(e){return be({},{value:e}).value}var _e=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&ge(e,r,t[r]);return e};function we(){return _e.apply(this,arguments)}U('._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%}');var ke=e({name:"fcGroup",props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:function(){return[]}},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},onBeforeRemove:{type:Function,default:function(){}},onBeforeAdd:{type:Function,default:function(){}},formCreateInject:Object,parse:Function},data:function(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:f(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler:function(e,t){var n=this;Object.keys(this.cacheRule).forEach((function(r){var i=n.cacheRule[r];if(i.$f){var o=i.$f.formData();if(e===t)i.$f.deferSyncValue((function(){be(i.rule,e),i.$f.setValue(o)}),!0);else{var a=i.$f.formData();i.$f.once("reloading",(function(){i.$f.setValue(a)})),i.rule=xe(e)}}}))},deep:!0},disabled:function(e){if(this.syncDisabled){var t=this.cacheRule;Object.keys(t).forEach((function(n){t[n].$f.disabled(e)}))}},expand:function(e){var t=e-this.modelValue.length;t>0&&this.expandRule(t)},modelValue:{handler:function(e){var t=this;e=e||[];var n=Object.keys(this.sort),r=n.length,i=r-e.length;if(i<0){for(var o=i;o<0;o++)this.addRule(e.length+o,!0);for(var a=0;a<r;a++)this.setValue(n[a],e[a])}else{if(i>0)for(var u=0;u<i;u++)this.removeRule(n[r-u-1]);e.forEach((function(r,i){t.setValue(n[i],e[i])}))}},deep:!0}},methods:{_value:function(e){return e&&ce(e,this.field)?e[this.field]:e},cache:function(e,t){this.cacheValue[e]=JSON.stringify(t)},input:function(e){this.$emit("update:modelValue",e),this.$emit("change",e)},formData:function(e,t){var n=this,r=this.cacheRule,i=this.sort;if(i.filter((function(e){return r[e].$f})).length===i.length){var o=i.map((function(r){var i=e===r?t:V({},n.cacheRule[r].$f.form),o=n.field?i[n.field]||null:i;return n.cache(r,o),o}));this.input(o)}},setValue:function(e,t){var n=this.field;n&&(t=j({},n,this._value(t))),this.cacheValue[e]!==JSON.stringify(n?t[n]:t)&&this.cache(e,t)},addRule:function(e,t){var n=this,r=this.formCreateInject.form.copyRules(this.rule||[]),i=this.options?V({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});var o=xe(this.defaultValue);we(i.formData,this.field?j({},this.field,o):o)}this.parse&&this.parse({rule:r,options:i,index:this.sort.length}),this.cacheRule[++this.len]={rule:r,options:i},t&&l((function(){return n.$emit("add",r,Object.keys(n.cacheRule).length-1)}))},add$f:function(e,t,n){var r=this;this.cacheRule[t].$f=n,l((function(){r.syncDisabled&&n.disabled(r.disabled),r.$emit("itemMounted",n,Object.keys(r.cacheRule).indexOf(t))}))},removeRule:function(e,t){var n=this,r=Object.keys(this.cacheRule).indexOf(e);delete this.cacheRule[e],delete this.cacheValue[e],t&&l((function(){return n.$emit("remove",r)}))},add:function(e){if(!this.disabled&&!1!==this.onBeforeAdd(this.modelValue)){var t=B(this.modelValue);t.push(this.defaultValue?xe(this.defaultValue):this.field?null:{}),this.input(t)}},del:function(e,t){if(!this.disabled&&!1!==this.onBeforeRemove(this.modelValue,e)){this.removeRule(t,!0);var n=B(this.modelValue);n.splice(e,1),this.input(n)}},addIcon:function(e){return r("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon:function(e,t){var n=this;return r("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:function(){return n.del(e,t)}},null)},sortUpIcon:function(e){var t=this;return r("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:function(){return t.changeSort(e,-1)}},null)},sortDownIcon:function(e){var t=this;return r("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:function(){return t.changeSort(e,1)}},null)},changeSort:function(e,t){var n=this.sort[e];this.sort[e]=this.sort[e+t],this.sort[e+t]=n,this.formData(0)},makeIcon:function(e,t,n){var r=this;if(this.$slots.button)return this.$slots.button({total:e,index:t,vm:this,key:n,del:function(){return r.del(t,n)},add:this.add});var i=[];return(!this.max||e<this.max)&&e===t+1&&i.push(this.addIcon(n)),e>this.min&&i.push(this.delIcon(t,n)),this.sortBtn&&t&&i.push(this.sortUpIcon(t)),this.sortBtn&&t!==e-1&&i.push(this.sortDownIcon(t)),i},emitEvent:function(e,t,n,r){this.$emit.apply(this,[e].concat(B(t),[this.cacheRule[r].$f,n]))},expandRule:function(e){for(var t=0;t<e;t++)this.modelValue.push(this.field?null:{})}},created:function(){var e=this;d((function(){return V({},e.cacheRule)}),(function(t){e.sort=Object.keys(t)}),{immediate:!0});for(var t=(this.expand||0)-this.modelValue.length,n=0;n<this.modelValue.length;n++)this.addRule(n);t>0&&this.expandRule(t)},render:function(){var e=this,t=this.sort,n=this.button,o=this.form,a=this.disabled,u=0===t.length?this.$slots.default?this.$slots.default({vm:this,add:this.add}):r("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add",onClick:this.add},null):t.map((function(u,c){var l=e.cacheRule[u],s=l.rule,f=l.options,d=n&&!a?e.makeIcon(t.length,c,u):[];return r("div",{class:"_fc-group-container",key:u},[r(o,i({key:u},{"onUpdate:modelValue":function(t){return e.formData(u,t)},"onEmit-event":function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.emitEvent(t,r,c,u)},"onUpdate:api":function(t){return e.add$f(c,u,t)},inFor:!0,modelValue:e.field?j({},e.field,e._value(e.modelValue[c])):e.modelValue[c],rule:s,option:f,extendOption:!0}),null),r("div",{class:"_fc-group-idx"},[c+1]),d.length?r("div",{class:"_fc-group-handle"},[d]):null])}));return r("div",{key:"con",class:"_fc-group "+(a?"_fc-group-disabled":"")},[u])}}),$e=e({name:"fcSubForm",props:{rule:Array,options:{type:Object,default:function(){return p({submitBtn:!1,resetBtn:!1})}},modelValue:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data:function(){return{cacheValue:{},subApi:{},form:f(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{disabled:function(e){this.syncDisabled&&this.subApi.disabled(e)},modelValue:function(e){this.setValue(e)}},methods:{formData:function(e){this.cacheValue=JSON.stringify(e),this.$emit("update:modelValue",e),this.$emit("change",e)},setValue:function(e){var t=JSON.stringify(e);this.cacheValue!==t&&(this.cacheValue=t,this.subApi.coverValue(e||{}))},add$f:function(e){var t=this;this.subApi=e,l((function(){t.syncDisabled&&e.disabled(t.disabled),t.$emit("itemMounted",e)}))}},render:function(){var e=this.form;return r(e,{"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onEmit-event":this.$emit,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),Ce={name:"IconWarning"},Oe={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Se=[u("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"},null,-1)];Ce.render=function(e,t,n,r,i,u){return o(),a("svg",Oe,Se)};var Ve=[M,oe,ae,le,se,ve,ke,$e,Ce],Fe=function e(t,n){if(t&&t!==n)return t.props.formCreateInject?t.props.formCreateInject:t.parent?e(t.parent,n):void 0};function Ee(t,n,r){return e({name:"FormCreate",components:n,directives:r,props:{rule:{type:Array,required:!0,default:function(){return[]}},option:{type:Object,default:function(){return{}}},extendOption:Boolean,modelValue:Object,api:Object,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","submit","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail"],render:function(){return this.fc.render()},setup:function(e){var n=h();m("parentFC",n);var r=v("parentFC",null),i=g(e),o=i.rule,a=i.modelValue,u=i.subForm,c=i.inFor,l=p({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:B(o.value||[]),updateValue:JSON.stringify(a||{})}),s=new t(n),_=s.api(),w=c.value,k=function(){var e=Fe(n,r);if(e)if(w){var t=N(e.getSubForm()),i=t.indexOf(_);i>-1&&t.splice(i,1)}else e.subForm()};return y((function(){s.mounted()})),b((function(){k(),l.destroyed=!0,s.unmount()})),x((function(){s.updated()})),d(u,(function(e){e?function(){if(r){var e,t=Fe(n,r);t&&(w?(e=N(t.getSubForm())).push(_):e=_,t.subForm(e))}}():k()}),{immediate:!0}),d((function(){return B(o.value)}),(function(e){s.$handle.isBreakWatch()||e.length===l.renderRule.length&&e.every((function(e){return l.renderRule.indexOf(e)>-1}))||(s.$handle.reloadRule(o.value),n.setupState.renderRule())})),d((function(){return e.option}),(function(e){s.initOptions(e),_.refresh()}),{deep:!0}),d(a,(function(e){JSON.stringify(e||{})!==l.updateValue&&(_.config.forceCoverValue?_.coverValue(e||{}):_.setValue(e||{}))}),{deep:!0}),V(V({fc:f(s),parent:r?f(r):r,fapi:f(_)},g(l)),{},{refresh:function(){++l.unique},renderRule:function(){l.renderRule=B(o.value||[])},updateValue:function(e){l.destroyed||(l.updateValue=JSON.stringify(e),n.emit("update:modelValue",e))}})},created:function(){var e=h();e.setupState.fc.init(),e.emit("update:api",e.setupState.fapi)}})}var je=["props"],Re=["class","style","directives"],Ae=["on"],Pe=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=[].concat(je,B(r.normal||[])),o=[].concat(Re,B(r.array||[])),a=[].concat(Ae,B(r.functional||[])),u=r.props||[];return t.reduce((function(t,n){for(var r in n)if(t[r])if(u.indexOf(r)>-1)t[r]=e([n[r]],t[r]);else if(i.indexOf(r)>-1)t[r]=V(V({},t[r]),n[r]);else if(o.indexOf(r)>-1){var c=t[r]instanceof Array?t[r]:[t[r]],l=n[r]instanceof Array?n[r]:[n[r]];t[r]=[].concat(B(c),B(l))}else if(a.indexOf(r)>-1)for(var s in n[r])if(t[r][s]){var f=t[r][s]instanceof Array?t[r][s]:[t[r][s]],d=n[r][s]instanceof Array?n[r][s]:[n[r][s]];t[r][s]=[].concat(B(f),B(d))}else t[r][s]=n[r][s];else if("hook"===r)for(var p in n[r])t[r][p]?t[r][p]=Ie(t[r][p],n[r][p]):t[r][p]=n[r][p];else t[r]=n[r];else i.indexOf(r)>-1||a.indexOf(r)>-1||u.indexOf(r)>-1?t[r]=V({},n[r]):o.indexOf(r)>-1?t[r]=n[r]instanceof Array?B(n[r]):"object"===F(n[r])?V({},n[r]):n[r]:t[r]=n[r];return t}),n)},Ie=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},Be=["type","slot","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache"],De=["validate","children","control"],Te=["effect"];function Me(){return[].concat(Be,B(je),B(Re),B(Ae),De,Te)}function Ne(e,t,n){return"[form-create ".concat(e,"]: ").concat(t)+(n?"\n\nrule: "+JSON.stringify(n.getRule?n.getRule():n):"")}function Le(e,t){console.error(Ne("err",e,t))}function Ue(e){var t=e.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}var He="[[FORM-CREATE-PREFIX-",ze="-FORM-CREATE-SUFFIX]]";function Ye(e,t){return JSON.stringify(be([],e,!0),(function(e,t){if(!t||!0!==t._isVue){if("function"!==F(t))return t;if(t.__json)return t.__json;if(t.__origin&&(t=t.__origin),!t.__emit)return He+t+ze}}),t)}function qe(e){return new Function("return "+e)()}function We(e,t){if(e&&ue.String(e)&&e.length>4){var n=e.trim(),r=!1;try{if(n.indexOf(ze)>0&&0===n.indexOf(He))n=n.replace(ze,"").replace(He,""),r=!0;else if(0===n.indexOf("$FN:"))n=n.replace("$FN:",""),r=!0;else{if(0===n.indexOf("$FNX:"))return(n=qe("function($inject){"+n.replace("$FNX:","")+"}")).__json=e,n.__inject=!0,n;t||0!==n.indexOf("function")||"function"===n||(r=!0)}if(!r)return e;var i=qe(-1===n.indexOf("function")&&0!==n.indexOf("(")?"function "+n:n);return i.__json=e,i}catch(e){return void Le("解析失败:".concat(n,"\n\nerr: ").concat(e))}}return e}function Je(e,t){return JSON.parse(e,(function(e,n){return ue.Undef(n)||!n.indexOf?n:We(n,t)}))}function Ke(e,t){return{value:e,enumerable:!1,configurable:!1,writable:!!t}}function Ge(e,t){return Xe([e],t||!1)[0]}function Xe(e,t){return be([],B(e),t||!1)}function Qe(e,t){return Pe(Array.isArray(t)?t:[t],e,{array:De,normal:Te}),e}function Ze(e){var t=ue.Function(e.getRule)?e.getRule():e;return t.type||(t.type="input"),t}function et(e,t){Object.defineProperties(e,Object.keys(t).reduce((function(e,n){return e[n]={get:function(){return t[n]()}},e}),{}))}function tt(e){return e.__fc__||(e.__origin__?e.__origin__.__fc__:null)}function nt(e,t){try{t=e()}catch(e){!function(e){Le(e.toString()),console.error(e)}(e)}return t}function rt(){var e={},t=function(e){return e||"default"};return{setSlot:function(n,r){n=t(n),!r||Array.isArray(r)&&r.length||(e[n]||(e[n]=[]),e[n].push(r))},getSlot:function(n,r){n=t(n);var i=[];return(e[n]||[]).forEach((function(e){if(Array.isArray(e))i.push.apply(i,B(e));else if(ue.Function(e)){var t=e.apply(void 0,B(r||[]));Array.isArray(t)?i.push.apply(i,B(t)):i.push(t)}else ue.Undef(e)||i.push(e)})),i},getSlots:function(){var t=this,n={};return Object.keys(e).forEach((function(e){n[e]=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.getSlot(e,r)}})),n},slotLen:function(n){return n=t(n),e[n]?e[n].length:0},mergeBag:function(e){var t=this;if(!e)return this;var n=ue.Function(e.getSlots)?e.getSlots():e;return Array.isArray(e)||c(e)?this.setSlot(void 0,(function(){return e})):Object.keys(n).forEach((function(e){t.setSlot(e,n[e])})),this}}}function it(e){var t=V({},e.props||{});return Object.keys(e.on||{}).forEach((function(n){var r,i="on".concat((r=n).replace(r[0],r[0].toLocaleUpperCase()));Array.isArray(t[i])?t[i]=[].concat(B(t[i]),[e.on[n]]):t[i]?t[i]=[t[i],e.on[n]]:t[i]=e.on[n]})),t.key=e.key,t.ref=e.ref,t.class=e.class,t.style=e.style,t.slot&&delete t.slot,t}function ot(e,t){return function(n,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=new at(e,n,r,i,o);return t&&(ue.Function(t)?t(a):a.props(t)),a}}function at(e,t,n,r,i){this._data=we({props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0},{type:e,title:t,field:n,value:r,props:i||{}}),this.event=this.on}function ut(e){e.forEach((function(e){at.prototype[e]=function(t){return Qe(this._data,j({},e,arguments.length<2?t:j({},t,arguments[1]))),this}}))}we(at.prototype,{getRule:function(){return this._data},setProp:function(e,t){return ge(this._data,e,t),this},modelField:function(e){return this._data.modelField=e,this},_clone:function(){var e=new this.constructor;return e._data=Ge(this._data),e}}),ut(Me());var ct=ot("");function lt(e,t,n){var r=ct("",t);return r._data.type=e,r._data.title=n,r}function st(){return{create:lt,factory:ot}}function ft(e){return xe(e)}function dt(e){return pt(e.replace(/(-[a-z])/g,(function(e){return e.replace("-","").toLocaleUpperCase()})))}function pt(e){return e.replace(e[0],e[0].toLowerCase())}function ht(e){return null==e?"":"object"===F(e)?JSON.stringify(e,null,2):String(e)}var mt=0;function vt(){return"F"+Math.random().toString(36).substr(3,3)+Number("".concat(Date.now()).concat(++mt)).toString(36)}function gt(e,t,n){var r,i=e;return(t||"").split(".").forEach((function(e){r&&(i[r]&&"object"==F(i[r])||(i[r]={}),i=i[r]),r=e})),i[r]=n,i}var yt=1;function bt(e){we(this,{$handle:e,fc:e.fc,vm:e.vm,$manager:e.$manager,vNode:new e.fc.CreateNode(e.vm),id:yt++}),et(this,{options:function(){return e.options},sort:function(){return e.sort}}),this.initCache(),this.initRender()}!function(e){we(e.prototype,{initCache:function(){this.clearCacheAll()},clearCache:function(e){e.rule.cache||this.cache[e.id]&&((!0===this.cache[e.id].use||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id]=null)},clearCacheAll:function(){this.cache={}},setCache:function(e,t,n){this.cache[e.id]={vnode:t,use:!1,parent:n,slot:e.rule.slot}},getCache:function(e){var t=this.cache[e.id];if(t)return t.use=!0,t.vnode}})}(bt),function(e){we(e.prototype,{initRender:function(){this.cacheConfig={}},getTypeSlot:function(e){return function t(n){if(n){var r=void 0;return e.rule.field&&(r=n.slots["field-"+Ue(e.rule.field)]||n.slots["field-"+e.rule.field]),r||(r=n.slots["type-"+Ue(e.type)]||n.slots["type-"+e.type]),r||t(n.setupState.parent)}}(this.vm)},render:function(){var e=this;if(this.vm.setupState.isShow){this.$manager.beforeRender();var t=rt();return this.sort.forEach((function(n){e.renderSlot(t,e.$handle.ctxs[n])})),this.$manager.render(t)}},renderSlot:function(e,t,n){if(this.isFragment(t)){t.initProp(),this.mergeGlobal(t),t.initNone();var r=this.renderChildren(t.loadChildrenPending(),t),i=r.default;i&&e.setSlot(t.rule.slot,(function(){return i()})),delete r.default,e.mergeBag(r)}else e.setSlot(t.rule.slot,this.renderCtx(t,n))},mergeGlobal:function(e){var t=this;this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=_((function(){var n=t.$handle.options.global;return Qe({},[n["*"],n[e.originType]||n[e.type]||n[e.type]||{}])}))),e.prop=Qe({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions:function(e){var t=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=t,e.prop.optionsTo&&t&>(e.prop,e.prop.optionsTo,t)},deepSet:function(e){var t=e.rule.deep;t&&Object.keys(t).sort((function(e,t){return e.length<t.length?-1:1})).forEach((function(n){gt(e.prop,n,t[n])}))},parseSide:function(e,t){return ue.Object(e)?Qe({props:{formCreateInject:t.prop.props.formCreateInject}},e):e},renderSides:function(e,t,n){var r=t[n?"rule":"prop"];return[this.renderRule(this.parseSide(r.prefix,t)),e,this.renderRule(this.parseSide(r.suffix,t))]},renderId:function(e,t){var n=this,r=this.$handle["field"===t?"fieldCtx":"nameCtx"][e];return r?r.map((function(e){return n.renderCtx(e,e.parent)})):void 0},renderCtx:function(e,t){var n=this;try{if("hidden"===e.type)return;var r=e.rule;if(!this.cache[e.id]||this.cache[e.id].slot!==r.slot){var i;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);var o=e.prop;o.preview=!!(ce(o,"preview")?o.preview:this.options.preview),o.props.formCreateInject=this.injectProp(e);var a=!1!==o.cache,u=o.preview;if(o.hidden)return void this.setCache(e,void 0,t);i=function(){for(var i=arguments.length,c=new Array(i),l=0;l<i;l++)c[l]=arguments[l];var s={rule:r,prop:o,preview:u,api:n.$handle.api,model:o.model||{},slotValue:c};c.length&&r.slotUpdate&&nt((function(){return r.slotUpdate(s)}));var f={},d=e.loadChildrenPending();e.parser.renderChildren?f=e.parser.renderChildren(d,e):!1!==e.parser.loadChildren&&(f=n.renderChildren(d,e));var p,h=n.getTypeSlot(e);return h?(s.children=f,p=h(s)):p=u?e.parser.preview(f,e):e.parser.render(f,e),p=n.renderSides(p,e),!e.input&&ue.Undef(o.native)||!0===o.native||(p=n.$manager.makeWrap(e,p)),e.none&&(p=n.display(p)),a&&n.setCache(e,(function(){return p}),t),p},this.setCache(e,i,t)}return function(){var t=n.getCache(e);if(t)return t.apply(void 0,arguments);if(!n.cache[e.id]){var r=n.renderCtx(e,e.parent);return r?r():void 0}}}catch(e){return void console.error(e)}},getModelField:function(e){return e.rule.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},display:function(e){var t=this;if(Array.isArray(e)){var n=[];return e.forEach((function(e){if(Array.isArray(e))return t.display(e);t.none(e)&&n.push(e)})),n}return this.none(e)},none:function(e){if(e)return Array.isArray(e.props.style)?e.props.style.push({display:"none"}):e.props.style=[e.props.style,{display:"none"}],e},isFragment:function(e){return"fragment"===e.type||"template"===e.type},injectProp:function(e){var t=this,n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:function(n){t.$handle.addSubForm(e,n)},getSubForm:function(){return t.$handle.subForm[e.id]},options:[],children:[],preview:!1,field:e.field,rule:e.rule,input:e.input});var r=n.ctxInject[e.id];return we(r,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),r},ctxProp:function(e,t){var n=this,r=e.ref,i=e.key,o=e.rule;this.$manager.mergeProp(e,t),e.parser.mergeProp(e,t);var a=[{ref:r,key:o.key||"".concat(i,"fc"),slot:void 0,on:{vnodeMounted:function(t){t.el.__rule__=e.rule,n.onMounted(e,t.el)},"fc.el":function(t){e.exportEl=t,t&&((t.$el||t).__rule__=e.rule)}}}];if(!t&&e.input){var u=this.getModelField(e),c={callback:function(t){n.onInput(e,t)},value:this.$handle.getFormData(e)};a.push({on:j({},"update:".concat(u),c.callback),props:j({},u,c.value)}),e.prop.model=c}return Pe(a,e.prop),e.prop},onMounted:function(e,t){e.el=this.vm.refs[e.ref]||t,e.parser.mounted(e),this.$handle.effect(e,"mounted")},onInput:function(e,t){this.$handle.onInput(e,t)},renderChildren:function(e,t){var n=this;if(!ue.trueArray(e))return{};var r=rt();return e.map((function(i){if(i)return ue.String(i)?r.setSlot(null,i):i.__fc__?n.renderSlot(r,i.__fc__,t):void(i.type&&l((function(){n.$handle.loadChildren(e,t),n.$handle.refresh()})))})),r.getSlots()},defaultRender:function(e,t){var n=e.prop;return n.component?this.vNode.makeComponent(n.component,n,t):this.vNode[e.type]?this.vNode[e.type](n,t):this.vNode[e.originType]?this.vNode[e.originType](n,t):this.vNode.make(pt(e.originType),n,t)},renderRule:function(e,t,n){var r=this;if(e){if(ue.String(e))return e;var i;if(n)i=e.type;else if(i=e.is,e.type){i=dt(e.type);var o=this.vNode.aliasMap[i];o&&(i=dt(o))}if(i){var a=rt();ue.trueArray(e.children)&&e.children.forEach((function(e){e&&a.setSlot(null==e?void 0:e.slot,(function(){return r.renderRule(e)}))}));var u=V({},e);return delete u.type,delete u.is,this.vNode.make(i,u,a.mergeBag(t).getSlots())}}}})}(bt);var xt=["hook:updated","hook:mounted"];function _t(e,t,n){var r,i=vt(),o=!!t.field;we(this,{id:i,ref:i,wrapRef:i+"fi",rule:t,origin:t.__origin__||t,name:t.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],parent:null,cacheConfig:null,prop:V({},t),computed:{},payload:{},refRule:{},input:o,el:void 0,exportEl:void 0,defaultValue:o?xe(n):void 0,field:t.field||void 0}),this.updateType(),this.updateKey(),r=this,Object.defineProperties(r.origin,{__fc__:Ke(f(r),!0)}),this.update(e,!0)}we(_t.prototype,{loadChildrenPending:function(){var e=this,t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:function(t){e.$handle&&e.$handle.loadChildren(t,e)},onUpdate:function(t,n){e.$handle&&(t===n?e.$handle.loadChildren(t,e):e.$handle.updateChildren(e,t,n))},onReload:function(t){e.$handle?e.$handle.updateChildren(e,[],t):delete e.pending.children}})},loadPending:function(e){var t=this,n=e.key,r=e.origin,i=e.def,o=e.onLoad,a=e.onReload,u=e.onUpdate;if(this.pending[n]&&this.pending[n].origin===r)return this.getPending(n,i);delete this.pending[n];var c=r;if(ue.Function(r)){var l=nt((function(){return r({rule:t.rule,api:t.$api,update:function(e){var o=e||i,a=t.getPending(n,i);t.setPending(n,r,o),u&&u(o,a)},reload:function(){var e=t.getPending(n,i);delete t.pending[n],a&&a(e),t.$api&&t.$api.sync(t.rule)}})}));l&&ue.Function(l.then)?(l.then((function(e){var a=e||i;t.setPending(n,r,a),o&&o(a),t.$api&&t.$api.sync(t.rule)})),c=i,this.setPending(n,r,c)):(c=l||i,this.setPending(n,r,c),o&&o(c))}return c},getPending:function(e,t){return this.pending[e]&&this.pending[e].value||t},setPending:function(e,t,n){this.pending[e]={origin:t,value:p(n)}},effectData:function(e){return this.payload[e]||(this.payload[e]={}),this.payload[e]},clearEffectData:function(e){void 0===e?this.payload={}:delete this.payload[e]},updateKey:function(e){this.key=vt(),e&&this.parent&&this.parent.updateKey(e)},updateType:function(){this.originType=this.rule.type,this.type=dt(this.rule.type)},setParser:function(e){this.parser=e,e.init(this)},initProp:function(){var e=this,t=V({},this.rule);delete t.children,this.prop=Qe({},[t].concat(B(Object.keys(this.payload).map((function(t){return e.payload[t]}))),[this.computed]))},initNone:function(){var e,t;this.none=(e=this,t=!(ue.Undef(e.prop.display)||e.prop.display),e.parent&&e.parent.none||t)},check:function(e){return this.vm===e.vm},unwatch:function(){this.watch.forEach((function(e){return e()})),this.watch=[],this.refRule={}},unlink:function(){this.linkOn.forEach((function(e){return e()})),this.linkOn=[]},link:function(){this.unlink(),this.$handle.appendLink(this)},watchTo:function(){this.$handle.watchCtx(this)},delete:function(){var e=void 0;this.unwatch(),this.unlink(),this.rmCtrl(),we(this,{deleted:!0,prop:V({},this.rule),computed:{},el:e,$handle:e,$render:e,$api:e,vm:e,vNode:e,parent:null,cacheConfig:null,none:!1})},rmCtrl:function(){this.ctrlRule.forEach((function(e){return e.__fc__&&e.__fc__.rm()})),this.ctrlRule=[]},rm:function(){var e=this,t=function(){var t=e.root.indexOf(e.origin);t>-1&&(e.root.splice(t,1),e.$handle&&e.$handle.refresh())};this.deleted?t():this.$handle.noWatch((function(){e.$handle.deferSyncValue((function(){e.rmCtrl(),t(),e.$handle.rmCtx(e),we(e,{root:[]})}),e.input)}))},update:function(e,t){we(this,{deleted:!1,$handle:e,$render:e.$render,$api:e.api,vm:e.vm,trueType:e.getType(this.originType),vNode:e.$render.vNode,updated:!1,cacheValue:this.rule.value}),!t&&this.unwatch(),this.watchTo(),this.link()}});var wt={"==":function(e){return function(t){return t===e}},"!=":function(e){return function(t){return t!==e}},"<>":function(e){return function(t){return t!==e}},">":function(e){return function(t){return t>e}},">=":function(e){return function(t){return t>=e}},"<":function(e){return function(t){return t<e}},"<=":function(e){return function(t){return t<=e}},in:function(e){return function(t){return e&&e.indexOf&&e.indexOf(t)>-1}},on:function(e){return function(t){return t&&t.indexOf&&t.indexOf(e)>-1}},notIn:function(e){return function(t){return!wt.in(e)(t)}},notOn:function(e){return function(t){return!wt.on(e)(t)}},between:function(e){return function(t){return t>e[0]&&t<e[1]}},notBetween:function(e){return function(t){return t<e[0]||t>e[1]}}};function kt(e,t){for(var n=0;n<e.ctrlRule.length;n++){var r=e.ctrlRule[n];if(r.children===t)return r}}function $t(e){return!!e.rule.__ctrl}function Ct(e,t){return"function"==typeof t?""+t:t}var Ot={init:function(e){},toFormValue:function(e,t){return e},toValue:function(e,t){return e},mounted:function(e){},render:function(e,t){return t.$render.defaultRender(t,e)},preview:function(e,t){return this.render(e,t)},mergeProp:function(e){}},St={sum:function(e){if(Array.isArray(e)){var t=0;return e.map((function(e){return t+=e||0})),t}},column:function(e,t){return Array.isArray(e)?e.map((function(e){return e[t]})):[]},get:function(e,t,n){for(var r=t.split("."),i=e,o=0;o<r.length;o++){if(!ce(i,r[o]))return void 0===n?0:n;i=i[r[o]]}return i}},Vt=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"];function Ft(e){var t=this;et(this,{options:function(){return e.options.value||{}},bus:function(){return e.bus}}),we(this,{fc:e,vm:e.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:p({}),subForm:{},form:p({}),appendData:{},providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:function(){t.lifecycle("reload")}}),this.initData(e.rules),this.$manager=new e.manager(this),this.$render=new bt(this),this.api=e.extendApi(function(e){function t(t){return ue.Undef(t)?t=e.fields():Array.isArray(t)||(t=[t]),t}function n(n,r,i){t(n).forEach((function(t){e.getCtxs(t).forEach((function(t){ge(t.rule,r,i),e.$render.clearCache(t)}))}))}function r(){var t=e.subForm;return Object.keys(t).reduce((function(e,n){var r=t[n];return r?(Array.isArray(r)?e.push.apply(e,B(r)):e.push(r),e):e}),[])}var i={get config(){return e.options},set config(t){e.fc.options.value=t},get options(){return e.options},set options(t){e.fc.options.value=t},get form(){return e.form},get rule(){return e.rules},get parent(){return e.vm.parent&&e.vm.parent.setupState.fapi},get children(){return r()},formData:function(n){return t(n).reduce((function(t,n){var r=e.getFieldCtx(n);return r?(t[r.field]=ft(r.rule.value),t):t}),{})},getValue:function(t){var n=e.getFieldCtx(t);if(n)return ft(n.rule.value)},coverValue:function(t){var n=V({},t||{});e.deferSyncValue((function(){i.fields().forEach((function(r){var i=e.fieldCtx[r];if(i){var o=ce(t,r);i.forEach((function(e){e.rule.value=o?t[r]:void 0})),delete n[r]}})),we(e.appendData,n)}))},setValue:function(t){var n=t;arguments.length>=2&&(n=j({},t,arguments[1])),e.deferSyncValue((function(){Object.keys(n).forEach((function(t){var r=e.fieldCtx[t];if(!r)return e.appendData[t]=n[t];r.forEach((function(e){e.rule.value=n[t]}))}))}))},removeField:function(t){var n=e.getCtx(t);return e.deferSyncValue((function(){e.getCtxs(t).forEach((function(e){e.rm()}))}),!0),n?n.origin:void 0},removeRule:function(e){var t=e&&tt(e);if(t)return t.rm(),t.origin},fields:function(){return e.fields()},append:function(t,n,r){var i,o=e.sort.length-1,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return;o=a.rule.children.length-1}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o+1,0,t)},prepend:function(t,n,r){var i,o=0,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o,0,t)},hidden:function(t,r){n(r,"hidden",!!t),e.refresh()},hiddenStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.hidden},display:function(t,r){n(r,"display",!!t),e.refresh()},displayStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.display},disabled:function(n,r){t(r).forEach((function(t){e.getCtxs(t).forEach((function(e){ge(e.rule.props,"disabled",!!n)}))})),e.refresh()},all:function(t){return Object.keys(e.ctxs).map((function(n){var r=e.ctxs[n];return t?r.origin:r.rule}))},model:function(t){return e.fields().reduce((function(n,r){var i=e.fieldCtx[r][0];return n[r]=t?i.origin:i.rule,n}),{})},component:function(t){return Object.keys(e.nameCtx).reduce((function(n,r){var i=e.nameCtx[r].map((function(e){return t?e.origin:e.rule}));return n[r]=1===i.length?i[0]:i,n}),{})},bind:function(){return i.form},reload:function(t){e.reloadRule(t)},updateOptions:function(t){e.fc.updateOptions(t),i.refresh()},onSubmit:function(e){i.updateOptions({onSubmit:e})},sync:function(t){if(Array.isArray(t))t.forEach((function(e){return i.sync(e)}));else{var n=ue.Object(t)?tt(t):e.getCtxs(t);n&&((n=Array.isArray(n)?n:[n]).forEach((function(t){if(!t.deleted){var n=e.subForm[t.id];n&&(Array.isArray(n)?n.forEach((function(e){e.refresh()})):n&&n.refresh()),e.$render.clearCache(t)}})),e.refresh())}},refresh:function(){r().forEach((function(e){e.refresh()})),e.$render.clearCacheAll(),e.refresh()},refreshOptions:function(){e.$manager.updateOptions(e.options),i.refresh()},hideForm:function(t){e.vm.setupState.isShow=!t},changeStatus:function(){return e.changeStatus},clearChangeStatus:function(){e.changeStatus=!1},updateRule:function(t,n){e.getCtxs(t).forEach((function(e){we(e.rule,n)}))},updateRules:function(e){Object.keys(e).forEach((function(t){i.updateRule(t,e[t])}))},mergeRule:function(t,n){e.getCtxs(t).forEach((function(e){Qe(e.rule,n)}))},mergeRules:function(e){Object.keys(e).forEach((function(t){i.mergeRule(t,e[t])}))},getRule:function(t,n){var r=e.getCtx(t);if(r)return n?r.origin:r.rule},setEffect:function(t,n,r){var i=e.getCtx(t);i&&n&&("$"===n[0]&&(n=n.substr(1)),ce(i.rule,"$"+n)&&ge(i.rule,"$"+n,r),ce(i.rule,"effect")||(i.rule.effect={}),ge(i.rule.effect,n,r))},clearEffectData:function(t,n){var r=e.getCtx(t);r&&(n&&"$"===n[0]&&(n=n.substr(1)),r.clearEffectData(n),i.sync(t))},updateValidate:function(e,t,r){r?i.mergeRule(e,{validate:t}):n(e,"validate",t)},updateValidates:function(e,t){Object.keys(e).forEach((function(n){i.updateValidate(n,e[n],t)}))},refreshValidate:function(){i.refresh()},resetFields:function(n){t(n).forEach((function(t){e.getCtxs(t).forEach((function(t){e.$render.clearCache(t),t.rule.value=ft(t.defaultValue)}))}))},method:function(e,t){var n=i.el(e);if(!n||!n[t])throw new Error(Ne("err","".concat(t,"方法不存在")));return function(){return n[t].apply(n,arguments)}},exec:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return nt((function(){return i.method(e,t).apply(void 0,r)}))},toJson:function(e){return Ye(i.rule,e)},trigger:function(e,t){for(var n=i.el(e),r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];n&&n.$emit.apply(n,[t].concat(o))},el:function(t){var n=e.getCtx(t);if(n)return n.el||e.vm.refs[n.ref]},closeModal:function(t){e.bus.$emit("fc:closeModal:"+t)},getSubForm:function(t){var n=e.getCtx(t);return n?e.subForm[n.id]:void 0},nextTick:function(t){e.bus.$once("next-tick",t),e.refresh()},nextRefresh:function(t){e.nextRefresh(),t&&nt(t)},deferSyncValue:function(t,n){e.deferSyncValue(t,n)},emit:function(t){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=e.vm).emit.apply(n,[t].concat(i))},helper:{tidyFields:t,props:n}};return["on","once","off","set"].forEach((function(t){i[t]=function(){var n;(n=e.bus)["$".concat(t)].apply(n,arguments)}})),i.changeValue=i.changeField=i.setValue,i}(this),this)}function Et(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function jt(e){if("undefined"!=typeof XMLHttpRequest){var t,n=new XMLHttpRequest,r=e.action;n.onerror=function(t){e.onError(t)},n.onload=function(){if(n.status<200||n.status>=300)return e.onError(function(e,t,n){var r="fail to ".concat(e," ").concat(n.status,"'"),i=new Error(r);return i.status=n.status,i.url=e,i}(r,0,n),Et(n));e.onSuccess(Et(n))},n.open(e.method||"get",r,!0),e.data&&("json"!==(e.dataType||"").toLowerCase()?(t=new FormData,Object.keys(e.data).map((function(n){t.append(n,e.data[n])}))):(t=JSON.stringify(e.data),n.setRequestHeader("content-type","application/json"))),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var i=e.headers||{};Object.keys(i).forEach((function(e){null!==i[e]&&n.setRequestHeader(e,i[e])})),n.send(t)}}we(Ft.prototype,{initData:function(e){we(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:e})},init:function(){this.appendData=V(V(V({},this.options.formData||{}),this.fc.vm.props.modelValue||{}),this.appendData),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init()},isBreakWatch:function(){return this.loading||this.noWatchFn||this.reloading}}),function(e){we(e.prototype,{parseInjectEvent:function(e,t){var n=e.inject||this.options.injectEvent;return this.parseEventLst(e,t,n)},parseEventLst:function(e,t,n,r){var i=this;return Object.keys(t).forEach((function(o){var a=i.parseEvent(e,t[o],n,r);a&&(t[o]=a)})),t},parseEvent:function(e,t,n,r){if(ue.Function(t)&&(!1!==n&&!ue.Undef(n)||t.__inject))return this.inject(e,t,n);if(!r&&Array.isArray(t)&&t[0]&&(ue.String(t[0])||ue.Function(t[0])))return this.parseEventLst(e,t,n,!0);if(ue.String(t)){var i=We(t);if(i&&t!==i)return i.__inject?this.parseEvent(e,i,n,!0):i}},parseEmit:function(e){var t=this,n={},r=e.rule,i=r.emitPrefix,o=r.field,a=r.name,u=r.inject,c=r.emit||[];if(ue.trueArray(c)){var l=i||o||a;l&&c.forEach((function(e){if(e){var i;ue.Object(e)&&(i=e.inject,e=e.name);var o=Ue("".concat(l,"-").concat(e)),a=function(){for(var e,n,r,i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];(e=t.vm).emit.apply(e,[o].concat(a)),(n=t.vm).emit.apply(n,["emit-event",o].concat(a)),(r=t.bus).$emit.apply(r,[o].concat(a))};if(a.__emit=!0,i||!1!==u){var c=i||u||t.options.injectEvent;n[e]=ue.Undef(c)?a:t.inject(r,a,c)}else n[e]=a}}))}return e.computed.on=n,n},getInjectData:function(e,t){var n=this.vm.props,r=n.option,i=n.rule;return{$f:this.api,api:this.api,rule:i,self:e.__origin__,option:r,inject:t}},inject:function(e,t,n){if(t.__origin){if(this.watching&&!this.loading)return t;t=t.__origin}var r=this,i=function(){for(var i=r.getInjectData(e,n),o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return i.args=[].concat(a),a.unshift(i),t.apply(this,a)};return i.__origin=t,i.__json=t.__json,i}})}(Ft),function(e){we(e.prototype,{usePage:function(){var e=this,t=this.options.page;if(t){var n,r=25,i=(n=this.rules).length<31?31:Math.ceil(n.length/3);ue.Object(t)&&(t.first&&(r=parseInt(t.first,10)||r),t.limit&&(i=parseInt(t.limit,10)||i)),we(this,{first:r,limit:i,pageEnd:this.rules.length<=r}),this.bus.$on("page-end",(function(){return e.vm.emit("page-end",e.api)})),this.pageLoad()}},pageLoad:function(){var e=this;this.bus.$on(xt,(function t(){e.pageEnd?(e.bus.$off(xt,t),e.bus.$emit("page-end")):(e.first+=e.limit,e.pageEnd=e.rules.length<=e.first,e.loadRule(),e.refresh())}))}})}(Ft),function(e){we(e.prototype,{clearNextTick:function(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick:function(e){var t=this;this.clearNextTick(),this.nextTick=setTimeout((function(){e(),t.nextTick=null}),10)},render:function(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}(Ft),function(e){we(e.prototype,{nextRefresh:function(e){var t=this,n=this.loadedId;l((function(){n===t.loadedId&&(e?e():t.refresh())}))},parseRule:function(e){var t=this,n=Ze(e);return Object.defineProperties(n,{__origin__:Ke(e,!0)}),function(e){var t={props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0};Object.keys(t).forEach((function(n){ce(e,n)||(e[n]=t[n])}))}(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach((function(e){e&&t.loadFn(e,n)})),this.loadCtrl(n),n.update&&(n.update=We(n.update)),n},loadFn:function(e,t){var n=this;["on","props","deep"].forEach((function(r){e[r]&&n.parseInjectEvent(t,e[r])}))},loadCtrl:function(e){e.control&&e.control.forEach((function(e){e.handle&&(e.handle=We(e.handle))}))},syncProp:function(e){var t=this,n=e.rule;ue.trueArray(n.sync)&&Pe([{on:n.sync.reduce((function(e,r){return e["update:".concat(r)]=function(e){n.props[r]=e,t.vm.emit("sync",r,e,n,t.fapi)},e}),{})}],e.computed)},loadRule:function(){var e=this;this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue((function(){if(e._loadRule(e.rules),e.loading=!1,e.cycleLoad&&e.pageEnd)return e.loadRule();e.syncForm(),e.pageEnd&&e.bus.$emit("load-end"),e.vm.setupState.renderRule()}))},loadChildren:function(e,t){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,t),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(t)},_loadRule:function(e,t){var n=this,r=function t(r){var i=e[r-1];if(!i||!i.__fc__)return r>0?t(r-1):-1;var o=n.sort.indexOf(i.__fc__.id);return o>-1?o:t(r-1)},i=function(e,t){ue.trueArray(e)&&n._loadRule(e,t)};e.map((function(o,a){if((!t||ue.Object(o))&&(n.pageEnd||t||!(a>=n.first))){if(o.__fc__&&o.__fc__.root===e&&n.ctxs[o.__fc__.id])return i(o.__fc__.loadChildrenPending(),o.__fc__),o.__fc__;var u,c=Ze(o),l=function(){return!(!c.field||!n.fieldCtx[c.field]||n.fieldCtx[c.field][0]===o.__fc__)};n.ruleEffect(c,"init",{repeat:l()}),l()&&n.vm.emit("repeat-field",o,n.api);var s=!1,f=!!o.__fc__,d=c.value;if(f){d=(u=o.__fc__).defaultValue;var p=!u.check(n);if(u.deleted){if(p){if($t(u))return;u.update(n)}}else if(p){if($t(u))return;e[a]=o=o._clone?o._clone():Ge(o),u=null,s=!0}}if(u)u.originType!==u.rule.type&&(u.updateType(),n.bindParser(u)),n.appendValue(u.rule);else{var h=n.parseRule(o);u=new _t(n,h,f?d:h.value),n.bindParser(u)}n.parseEmit(u),n.syncProp(u),u.parent=t||null,u.root=e,n.setCtx(u),!s&&!f&&n.effect(u,"load"),n.effect(u,"created");var m=u.loadChildrenPending();if(!1===u.parser.loadChildren||i(m,u),!t){var v=r(a);v>-1||!a?n.sort.splice(v+1,0,u.id):n.sort.push(u.id)}var g=u.rule;return u.updated||(u.updated=!0,ue.Function(g.update)&&n.bus.$once("load-end",(function(){n.refreshUpdate(u,g.value,"init")})),n.effect(u,"loaded")),n.refreshControl(u)&&(n.cycleLoad=!0),u}}))},refreshControl:function(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl:function(e){var t=this,n=function(e){var t=e.rule.control||[];return ue.Object(t)?[t]:t}(e),r=[],i=this.api;if(!n.length)return!1;for(var o=function(t){var o=n[t],a=o.handle||(wt[o.condition||"=="]||wt["=="])(o.value);if(!ue.trueArray(o.rule))return"continue";var u=V(V({},o),{},{valid:nt((function(){return a(e.rule.value,i)})),ctrl:kt(e,o.rule),isHidden:ue.String(o.rule[0])});if(u.valid&&u.ctrl||!u.valid&&!u.ctrl&&!u.isHidden)return"continue";r.push(u)},a=0;a<n.length;a++)o(a);if(!r.length)return!1;var u=[],c=!1;return this.deferSyncValue((function(){r.reverse().forEach((function(n){var r=n.isHidden,o=n.valid,a=n.rule,l=n.prepend,s=n.append,f=n.child,d=n.ctrl,p=n.method;if(r)return o?e.ctrlRule.push({__ctrl:!0,children:a,valid:o}):e.ctrlRule.splice(e.ctrlRule.indexOf(d),1),void u[o?"push":"unshift"]((function(){"disabled"===p?t.api.disabled(!o,a):"display"===p?t.api.display(o,a):"required"===p?(a.forEach((function(e){t.api.setEffect(e,"required",o)})),o||t.api.clearValidateState(a)):t.api.hidden(!o,a)}));if(o){c=!0;var h={type:"fragment",native:!0,__ctrl:!0,children:a};e.ctrlRule.push(h),t.bus.$once("load-start",(function(){l?i.prepend(h,l,f):s||f?i.append(h,s||e.id,f):e.root.splice(e.root.indexOf(e.origin)+1,0,h)}))}else{e.ctrlRule.splice(e.ctrlRule.indexOf(d),1);var m=tt(d);m&&m.rm()}}))})),u.length&&l((function(){u.forEach((function(e){return e()}))})),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),c},reloadRule:function(e){return this._reloadRule(e)},_reloadRule:function(e){var t=this;e||(e=this.rules);var n=V({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue((function(){t.bus.$once("load-end",(function(){Object.keys(n).filter((function(e){return void 0===t.ctxs[e]})).forEach((function(e){return t.rmCtx(n[e])})),t.$render.clearCacheAll()})),t.reloading=!0,t.loadRule(),t.reloading=!1,t.refresh(),t.bus.$emit("reloading",t.api)})),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh:function(){this.vm.setupState.refresh()}})}(Ft),function(e){we(e.prototype,{setValue:function(e,t,n,r){e.deleted||(e.rule.value=t,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,n),this.syncValue(),this.valueChange(e,t),this.vm.emit("change",e.field,t,e.origin,this.api,r||!1),this.effect(e,"value"))},onInput:function(e,t){var n;e.input&&(this.isQuote(e,n=e.parser.toValue(t,e))||this.isChange(e,t))&&this.setValue(e,n,t)},setFormData:function(e,t){ge(this.formData,e.id,t)},getFormData:function(e){return this.formData[e.id]},syncForm:function(){var e=this,n=p({});this.fields().reduce((function(n,r){var i=e.getCtx(r);return n[r]=t(i.rule,"value"),n}),n),this.form=n,this.syncValue()},appendValue:function(e){e.field&&ce(this.appendData,e.field)&&(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm:function(e,t){this.subForm[e.id]=t},deferSyncValue:function(e,t){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=t),nt(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncValue())},syncValue:function(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;this.vm.setupState.updateValue(V({},this.form))},isChange:function(e,t){return JSON.stringify(this.getFormData(e),Ct)!==JSON.stringify(t,Ct)},isQuote:function(e,t){return(ue.Object(t)||Array.isArray(t))&&t===e.rule.value},refreshUpdate:function(e,t,n){var r=this;if(ue.Function(e.rule.update)){var i=nt((function(){return e.rule.update(t,e.origin,r.api,{origin:n||"change"})}));if(void 0===i)return;e.rule.hidden=!0===i}},valueChange:function(e,t){this.refreshRule(e,t),this.bus.$emit("change-"+e.field,t)},refreshRule:function(e,t,n){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,t,n)},appendLink:function(e){var t=this,n=e.rule.link;ue.trueArray(n)&&n.forEach((function(n){var r=function(){return t.refreshRule(e,e.rule.value,"link")};t.bus.$on("change-"+n,r),e.linkOn.push((function(){return t.bus.$off("change-"+n,r)}))}))},fields:function(){return Object.keys(this.fieldCtx)}})}(Ft),function(e){we(e.prototype,{getCtx:function(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs:function(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx:function(e,t,n){var r="".concat(n,"Ctx");this[r][t]?this[r][t].push(e):this[r][t]=[e]},rmIdCtx:function(e,t,n){var r="".concat(n,"Ctx"),i=this[r][t];if(!i)return!1;var o=i.splice(i.indexOf(e)>>>0,1).length>0;return i.length||delete this[r][t],o},getFieldCtx:function(e){return(this.fieldCtx[e]||[])[0]},getNameCtx:function(e){return this.nameCtx[e]||[]},setCtx:function(e){var t=e.id,n=e.field,r=e.name,i=e.rule;this.ctxs[t]=e,r&&this.setIdCtx(e,r,"name"),e.input&&(this.setIdCtx(e,n,"field"),this.setFormData(e,e.parser.toFormValue(i.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,i.value,e.origin,this.api))},getParser:function(e){var t=this.fc.parsers;return t[e.originType]||t[dt(e.type)]||t[e.trueType]||Ot},bindParser:function(e){e.setParser(this.getParser(e))},getType:function(e){var t=this.fc.CreateNode.aliasMap,n=t[e]||t[dt(e)]||e;return dt(n)},noWatch:function(e){this.noWatchFn||(this.noWatchFn=e),nt(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx:function(e){var n=this;if(Me().filter((function(e){return"_"!==e[0]&&"$"!==e[0]&&-1===Vt.indexOf(e)})).forEach((function(r){var i=t(e.rule,r),o="children"===r;e.refRule[r]=i,e.watch.push(d(o?function(){return ue.Function(i.value)?i.value:B(i.value||[])}:function(){return i.value},(function(t,a){var u=i.value;if(!n.isBreakWatch()){if(o&&!1===e.parser.loadChildren)return n.$render.clearCache(e),void n.nextRefresh();n.watching=!0,"link"!==r?(["props","on","deep"].indexOf(r)>-1?(n.parseInjectEvent(e.rule,u||{}),"props"===r&&e.input&&n.setFormData(e,e.parser.toFormValue(e.rule.value,e))):"emit"===r?n.parseEmit(e):["prefix","suffix"].indexOf(r)>-1?u&&n.loadFn(u,e.rule):"type"===r?(e.updateType(),n.bindParser(e)):o&&(ue.Function(a)&&(a=e.getPending("children",[])),ue.Function(u)&&(u=e.loadChildrenPending()),n.updateChildren(e,u,a)),n.$render.clearCache(e),n.refresh(),n.watching=!1):e.link()}}),{deep:!o,sync:o}))})),e.input){var r=t(e.rule,"value");e.watch.push(d((function(){return r.value}),(function(){var t=e.parser.toFormValue(r.value,e);n.isChange(e,t)&&n.setValue(e,r.value,t,!0)}))),this.bus.$once("load-end",(function(){var i=t(e.rule,"computed");e.watch.push(d((function(){var e=i.value;if(e)return nt(ue.Function(e)?function(){return e(n.api.form,n.api)}:function(){return new Function("_","with(this){ return ".concat(e," }")).call(n.api.form,St)},void 0)}),(function(e){r.value=e}),{immediate:!!i.value}))}))}this.watchEffect(e)},updateChildren:function(e,t,n){var r=this;this.deferSyncValue((function(){n&&n.forEach((function(n){-1===(t||[]).indexOf(n)&&n&&!ue.String(n)&&n.__fc__&&n.__fc__.parent===e&&r.rmCtx(n.__fc__)})),ue.trueArray(t)&&(r.loadChildren(t,e),r.bus.$emit("update",r.api))}))},rmSub:function(e){var t=this;ue.trueArray(e)&&e.forEach((function(e){e&&e.__fc__&&t.rmCtx(e.__fc__)}))},rmCtx:function(e){var t=this;if(!e.deleted){var n=e.id,r=e.field,i=e.input,o=e.name;ye(this.ctxs,n),ye(this.formData,n),ye(this.subForm,n),ye(this.vm.setupState.ctxInject,n),i&&this.rmIdCtx(e,r,"field"),o&&this.rmIdCtx(e,o,"name"),i&&!ce(this.fieldCtx,r)&&ye(this.form,r),this.deferSyncValue((function(){if(!t.reloading){if(!1!==e.parser.loadChildren){var n=e.getPending("children",e.rule.children);ue.trueArray(n)&&n.forEach((function(e){return e.__fc__&&t.rmCtx(e.__fc__)}))}e.root===t.rules&&t.vm.setupState.renderRule()}}),i);var a=this.sort.indexOf(n);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),i&&!this.fieldCtx[r]&&this.vm.emit("remove-field",r,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}}})}(Ft),function(e){we(e.prototype,{mounted:function(){var e=this,t=function(){e.isMounted=!0,e.lifecycle("mounted")};this.pageEnd?t():this.bus.$once("page-end",t)},lifecycle:function(e){var t=this,n=this.options[e];ue.Function(n)&&nt((function(){return n(t.api)})),this.vm.emit(e,this.api)}})}(Ft),function(e){we(e.prototype,{useProvider:function(){var e=this,t=this.fc.providers;Object.keys(t).forEach((function(n){var r=t[n];ue.Function(r)&&(r=r(e.fc)),r._c=function(e){var t=e.components;if(Array.isArray(t)){var n=function(e){return e.filter((function(e,t,n){return n.indexOf(e,0)===t}))}(t.filter((function(e){return"*"!==e})));return!!n.length&&n}return!!ue.String(t)&&[t]}(r),e.onEffect(r),e.providers[n]=r}))},onEffect:function(e){var t=this,n=[];(e._c||["*"]).forEach((function(r){var i="*"===r?"*":t.getType(r);n.indexOf(i)>-1||(n.push(i),t.bus.$on("p:".concat(e.name,":").concat(i,":").concat(e.input?1:0),(function(t,n){e[t]&&e[t].apply(e,B(n))})))})),e._used=n},watchEffect:function(e){var t=this,n={required:function(){var t,n;return(ce(e.rule,"$required")?e.rule.$required:null===(t=e.rule)||void 0===t||null===(n=t.effect)||void 0===n?void 0:n.required)||!1}};Object.keys(e.rule.effect||{}).forEach((function(t){n[t]=function(){return e.rule.effect[t]}})),Object.keys(e.rule).forEach((function(t){"$"===t[0]&&(n[t.substr(1)]=function(){return e.rule[t]})})),Object.keys(n).forEach((function(r){e.watch.push(d(n[r],(function(n){t.effect(e,"watch",j({},r,n))}),{deep:!0}))}))},ruleEffect:function(e,t,n){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},t,n)},effect:function(e,t,n){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:n},t)},getEffect:function(e,t){return ce(e,"$"+t)?e["$"+t]:ce(e,"effect")&&ce(e.effect,t)?e.effect[t]:void 0},emitEffect:function(e,t,n){var r=this,i=e.ctx,o=e.rule,a=e.input,u=e.type,c=e.custom;if(u&&!(["fcFragment","fragment"].indexOf(u)>-1)){var l=c||Object.keys(o).reduce((function(e,t){return"$"===t[0]&&(e[t.substr(1)]=o[t]),e}),V({},o.effect||{}));Object.keys(l).forEach((function(e){var c=r.providers[e];if(c&&(!c.input||a)){var s;if(c._c){if(!(c._used.indexOf(u)>-1))return;s=u}else s="*";var f=V({value:l[e],getValue:function(){return r.getEffect(o,e)}},n||{});i&&(f.getProp=function(){return i.effectData(e)},f.clearProp=function(){return i.clearEffectData(e)},f.mergeProp=function(e){return Qe(f.getProp(),[e])},f.id=i.id),r.bus.$emit("p:".concat(e,":").concat(s,":").concat(c.input?1:0),t,[f,o,r.api])}}))}}})}(Ft);var Rt=e({name:"fcFragment",inheritAttrs:!1,props:["vnode"],render:function(){return this.vnode}});function At(e,t){var n=e.directives;return n?(Array.isArray(n)||(n=[n]),w(t,n.reduce((function(e,t){return e.concat(function(e){return Object.keys(e).map((function(t){var n=e[t],r=k(t);if(r)return[r,n.value,n.arg,n.modifiers]})).filter((function(e){return!!e}))}(t))}),[]))):t}function Pt(e){var t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(n,It);var t=I(n);function n(){return E(this,n),t.apply(this,arguments)}return n}();return Object.assign(t.prototype,e),t}function It(e){we(this,{$handle:e,vm:e.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}we(It.prototype,{__init:function(){var e=this;this.$render=this.$handle.$render,this.$r=function(){var t;return(t=e.$render).renderRule.apply(t,arguments)}},updateKey:function(){this.key=vt()},init:function(){},update:function(){},beforeRender:function(){},form:function(){return this.vm.refs[this.ref]},mergeOptions:function(e,t){var n=this;return Pe(e.map((function(e){return n.tidyOptions(e)})),t,this.mergeOptionsRule)},updateOptions:function(e){this.options=this.mergeOptions([e],this.getDefaultOptions()),this.update()},tidyOptions:function(e){return e},tidyRule:function(e){},mergeProp:function(e){},getDefaultOptions:function(){return{}},render:function(e){}});var Bt={name:"componentValidate",load:function(e,t,n){var r=e.getValue();r?e.getProp().validate=[{validator:function(){var i=tt(t);if(i){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return n.exec.apply(n,[i.id,!0===r?"formCreateValidate":r].concat(a,[{attr:e,rule:t,api:n}]))}}}]:(e.clearProp(),n.clearValidateState([t.field]))},watch:function(){Bt.load.apply(Bt,arguments)}},Dt={fetch:function(e){function t(t,n,r){var i=t.value,o=function(e){void 0===e?(t.clearProp(),r.sync(n)):gt(t.getProp(),i.to||"options",e)};if(ue.Function(i)&&(i=i(n,r)),(i=function(e){return ue.String(e)&&(e={action:e,to:"options"}),e}(i))&&i.action){i.to||(i.to="options");var a=i.onError,u=function(){if(!t.getValue())return t.clearProp(),r.sync(n),!0},c=V(V({headers:{}},i),{},{onSuccess:function(e,t){if(!u()){var a=function(e){return t?e:e.data};ue.Function(i.parse)?a=i.parse:i.parse&&ue.String(i.parse)&&(a=function(e){return i.parse.split(".").forEach((function(t){e&&(e=e[t])})),e}),o(a(e,n,r)),r.sync(n)}},onError:function(e){o(void 0),u()||(a||function(e){return Le(e.message||"fetch fail "+i.action)})(e,n,r)}});e.options.beforeFetch&&nt((function(){return e.options.beforeFetch(c,{rule:n,api:r})})),ue.Function(i.action)?i.action(n,r).then((function(e){c.onSuccess(e,!0)})).catch((function(e){c.onError(e)})):nt((function(){return e.create.fetch(c,{inject:t,rule:n,api:r})}))}else o(void 0)}return{name:"fetch",loaded:function(){t.apply(void 0,arguments)},watch:function(){t.apply(void 0,arguments)}}},loadData:function(e){var t={name:"loadData",_fn:[],created:function(t,n,r){this.deleted(t);var i=N(t.getValue()),o=[];i.forEach((function(i){if(i){var a=function o(){!1!==i.watch&&(e.bus.$off("p.loadData."+i.attr,o),e.bus.$once("p.loadData."+i.attr,o));var a=void 0;i.attr&&(a=e.loadData[i.attr]||i.default,i.copy&&(a=xe(a))),gt(t.getProp(),i.to||"options",a),r.sync(n)};o.push((function(){return e.bus.$off("p.loadData."+i.attr,a)})),a()}})),this._fn[t.id]=o},deleted:function(e){this._fn[e.id]&&this._fn[e.id].forEach((function(e){e()})),e.clearProp()}};return t.watch=t.created,t},componentValidate:Bt},Tt={name:"html",loadChildren:!1,render:function(e,t){return t.prop.props.innerHTML=e.default(),t.vNode.make(t.prop.props.tag||"div",t.prop)},renderChildren:function(e){return{default:function(){return e.filter((function(e){return ue.String(e)})).join("")}}}};function Mt(e,t){var n;return 2===arguments.length?t=(n=arguments[1])[e]:n=arguments[2],{id:t,prop:n}}function Nt(){return Mt.apply(void 0,["name"].concat(Array.prototype.slice.call(arguments)))}var Lt=1,Ut={};function Ht(e){var t,i=j({},Rt.name,Rt),o={},a={},u={},c=[],s=V({},Dt),f=st(),m={global:{}},v={},g=function(){var e={};function t(){}return we(t.prototype,{make:function(e,t,n){return At(t,this.h(e,it(t),n))},makeComponent:function(e,t,n){try{return At(t,r(e,it(t),n))}catch(e){return console.error(e),r("")}},h:function(e,t,i){var o=h().appContext.config.isNativeTag(e);o&&delete t.formCreateInject;try{return r(o?e:n(e),t,i)}catch(e){return console.error(e),r("")}},aliasMap:e}),we(t,{aliasMap:e,alias:function(t,n){e[t]=n},use:function(e){Object.keys(e).forEach((function(n){var r=Ue(n),i=ht(n).toLocaleLowerCase(),o=e[n];[n,r,i].forEach((function(e){t.alias(n,o),t.prototype[e]=function(e,t){return this.make(o,e,t)}}))}))}}),t}();function y(e){var t=Ut[e];return Array.isArray(t)?t.map((function(e){return e.api()})):t?t.api():void 0}function b(e){c.push(e)}function x(){var e=Nt.apply(void 0,arguments);e.id&&e.prop&&(a[e.id]=e.prop)}function _(){var e=Nt.apply(void 0,arguments);e.id&&e.prop&&(s[e.id]=V(V({},e.prop),{},{name:e.id}))}function w(e){g.use(e)}function k(){var e=Nt.apply(void 0,arguments);if(e.id&&e.prop){var t=dt(e.id),n=e.prop,r=!0===n.merge?o[t]:void 0;o[t]=V(V({},r||Ot),n),f[t]=ot(t),n.maker&&we(f,n.maker)}}function S(e,t){var n;if(ue.String(e)){if(n=e,void 0===t)return i[n]}else n=e.displayName||e.name,t=e;n&&t&&(i[n]=t,i[dt(n)]=t,t.formCreateParser&&k(n,t.formCreateParser))}function F(){return Ee(N,i,a)}function E(){return Rt}function R(e,t){return ue.Function(e.install)?e.install(A,t):ue.Function(e)&&e(A,t),this}function A(e,t){var n=function(e,t){var n=F();return $({data:function(){return p({rule:e,option:t})},render:function(){return C(n,V({ref:"fc"},this.$data))}})}(e,t||{});c.forEach((function(e){nt((function(){return e(A,n)}))}));var r=document.createElement("div");return((null==t?void 0:t.el)||document.body).appendChild(r),n.mount(r).$refs.fc.fapi}function P(t){var n=V({},e);return t?n.inherit={components:i,parsers:o,directives:a,modelFields:u,providers:s,useApps:c,maker:f,loadData:v}:delete n.inherit,Ht(n)}function I(e,t){u[e]=t}function D(e){Object.keys(Ut).forEach((function(t){(Array.isArray(Ut[t])?Ut[t]:[Ut[t]]).forEach((function(t){t.bus.$emit("p.loadData."+e)}))}))}function T(e,t){v[e]=t,D(e)}function M(e){delete v[e],D(e)}function N(t){var n=this;we(this,{id:Lt++,create:A,vm:t,manager:Pt(e.manager),parsers:o,providers:s,modelFields:u,rules:t.props.rule,name:t.props.name||vt(),inFor:t.props.inFor,prop:{components:i,directives:a},loadData:v,CreateNode:g,bus:new L,unwatch:null,options:O(t.props.option||{}),extendApi:e.extendApi||function(e){return e}}),l((function(){d(n.options,(function(){n.$handle.$manager.updateOptions(n.options.value),n.api().refresh()}),{deep:!0})})),we(t.appContext.components,i),we(t.appContext.directives,a),this.$handle=new Ft(this),this.name&&(this.inFor?(Ut[this.name]||(Ut[this.name]=[]),Ut[this.name].push(this)):Ut[this.name]=this)}function U(t){we(t,{version:e.version,ui:e.ui,setData:T,removeData:M,maker:f,component:S,directive:x,setModelField:I,register:_,$vnode:E,parser:k,use:R,factory:P,componentAlias:w,copyRule:Ge,copyRules:Xe,fetch:jt,$form:F,parseFn:We,parseJson:Je,toJson:Ye,useApp:b,getApi:y})}if(function(e){var t=e.key||[],n=e.array||[],r=e.normal||[];Be.push.apply(Be,B(t)),De.push.apply(De,B(n)),Te.push.apply(Te,B(r)),ut([].concat(B(t),B(n),B(r)))}(e.attrs||{}),we(N.prototype,{init:function(){var e=this;this.isSub()&&(this.unwatch=d((function(){return e.vm.parent.option}),(function(){e.initOptions(e.options.value),e.$handle.api.refresh()}),{deep:!0})),this.initOptions(this.options.value),this.$handle.init()},isSub:function(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions:function(e){this.options.value=V({formData:{},submitBtn:{},resetBtn:{}},xe(m)),this.isSub()&&(this.options.value=this.mergeOptions(this.options.value,this.vm.setupState.parent.setupState.fapi.config||{},!0)),this.updateOptions(e)},mergeOptions:function(e,t,n){return t=xe(t),n&&["page","onSubmit","mounted","reload","formData","el"].forEach((function(e){delete t[e]})),t.global&&(e.global=function(e,t){return e?(Object.keys(t||{}).forEach((function(n){t[n]&&(e[n]=Qe(e[n]||{},t[n]))})),e):t}(e.global,t.global),delete t.global),this.$handle.$manager.mergeOptions([t],e),e},updateOptions:function(e){this.options.value=this.mergeOptions(this.options.value,e),this.$handle.$manager.updateOptions(this.options.value)},api:function(){return this.$handle.api},render:function(){return this.$handle.render()},mounted:function(){this.$handle.mounted()},unmount:function(){if(this.name)if(this.inFor){var e=Ut[this.name].indexOf(this);Ut[this.name].splice(e,1)}else delete Ut[this.name];this.unwatch&&this.unwatch(),this.$handle.reloadRule([])},updated:function(){var e=this;this.$handle.bindNextTick((function(){return e.bus.$emit("next-tick",e.$handle.api)}))}}),U(A),we(t=A,{create:A,install:function(e,n){if(m=V(V({},m),n||{}),!0!==e._installedFormCreate){e._installedFormCreate=!0;var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(e,t)};U(r),e.config.globalProperties.$formCreate=r,e.component("FormCreate",F()),c.forEach((function(n){nt((function(){return n(t,e)}))}))}}}),g.use({fragment:"fcFragment"}),e.install&&A.use(e),b((function(e,t){t.mixin({props:["formCreateInject"]})})),k(Tt),e.inherit){var H=e.inherit;H.components&&we(i,H.components),H.parsers&&we(o,H.parsers),H.directives&&we(a,H.directives),H.modelFields&&we(u,H.modelFields),H.providers&&we(s,H.providers),H.useApps&&we(c,H.useApps),H.maker&&we(f,H.maker),H.loadData&&we(v,H.loadData)}return A}var zt={date:"YYYY-MM-DD",month:"YYYY-MM",datetime:"YYYY-MM-DD HH:mm:ss",timerange:"HH:mm:ss",daterange:"YYYY-MM-DD",monthrange:"YYYY-MM",datetimerange:"YYYY-MM-DD HH:mm:ss",year:"YYYY"},Yt={name:"datePicker",maker:["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((function(e,t){return e[t]=ot("datePicker",{type:t.toLowerCase()}),e}),{}),mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat=zt[t.type]||zt.date)}},qt={name:"hidden",maker:j({},"hidden",(function(e,t){return ot("hidden")("",e,t)})),render:function(){return[]}},Wt={name:"input",maker:function(){var e=["password","url","email","text","textarea"].reduce((function(e,t){return e[t]=ot("input",{type:t}),e}),{});return e.idate=ot("input",{type:"date"}),e}(),mergeProp:function(e){var t=e.prop.props;t&&t.autosize&&t.autosize.minRows&&(t.rows=t.autosize.minRows||2)}},Jt=[Yt,qt,Wt,{name:"slider",maker:{sliderRange:ot("slider",{range:!0})},toFormValue:function(e,t){var n=Array.isArray(e),r=t.prop.props,i=r.min||0;return!0===r.range?n?e:[i,parseFloat(e)||i]:n?parseFloat(e[0])||i:parseFloat(e)}},{name:"timePicker",maker:{time:ot("timePicker",(function(e){return e.props.isRange=!1})),timeRange:ot("timePicker",(function(e){return e.props.isRange=!0}))},mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")}},{name:"FcRow",render:function(e,t){return t.vNode.col({props:{span:24}},{default:function(){return[t.vNode.row(t.prop,e)]}})}},{name:"select",toFormValue:function(e,t){return t.prop.props.multiple&&!Array.isArray(e)?N(e):e}}],Kt={button:"el-button",icon:"el-icon",slider:"el-slider",rate:"el-rate",upload:"fc-upload",cascader:"el-cascader",popover:"el-popover",tooltip:"el-tooltip",colorPicker:"el-colorPicker",timePicker:"el-time-picker",timeSelect:"el-time-select",datePicker:"el-date-picker",switch:"el-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:"el-input-number",number:"el-input-number",input:"el-input",formItem:"el-form-item",form:"el-form",frame:"fc-frame",col:"el-col",row:"el-row",tree:"fc-tree",autoComplete:"el-autocomplete",auto:"el-autocomplete",group:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function Gt(e,t){var n;ce(e,t)&&(ue.String(e[t])&&(e[t]=(j(n={},t,e[t]),j(n,"show",!0),n)))}function Xt(e){return!1===e}function Qt(e){var t=V({},e);return delete t.children,t}var Zt={validate:function(){var e=this.form();return e?e.validate():new Promise((function(e){return e()}))},validateField:function(e){var t=this;return new Promise((function(n,r){var i=t.form();i?i.validateField(e,(function(e){e?r(e):n(null)})):n()}))},clearValidateState:function(e){var t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},tidyOptions:function(e){return["submitBtn","resetBtn","row","info","wrap","col"].forEach((function(t){!function(e,t){ce(e,t)&&!ue.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)})),e},tidyRule:function(e){var t=e.prop;return Gt(t,"title"),Gt(t,"info"),t},mergeProp:function(e){e.prop=Pe([{info:this.options.info||{},wrap:this.options.wrap||{},col:this.options.col||{}},e.prop],{info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}},{normal:["title","info","col","wrap"]})},getDefaultOptions:function(){return{form:{inline:!1,labelPosition:"right",labelWidth:"125px",disabled:!1,size:void 0},row:{show:!0,gutter:0},submitBtn:{type:"primary",loading:!1,disabled:!1,innerText:"提交",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"重置",show:!1,col:void 0,click:void 0}}},update:function(){var e=this.options.form;this.rule={props:V({},e),on:{submit:function(e){e.preventDefault()}},class:[e.className,e.class,"form-create"],style:e.style,type:"form"}},beforeRender:function(){var e=this.key,t=this.ref,n=this.$handle;we(this.rule,{key:e,ref:t}),we(this.rule.props,{model:n.formData})},render:function(e){var t=this;return e.slotLen()&&e.setSlot(void 0,(function(){return t.makeFormBtn()})),this.$r(this.rule,Xt(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap:function(e,t){var n=this,r=e.prop,i="".concat(this.key).concat(e.key),o=r.col,a=this.isTitle(r),u=o.labelWidth||a?o.labelWidth:0,c=this.rule.props,l=c.inline,s=c.col,f=Xt(r.wrap.show)?t:this.$r(Pe([r.wrap,{props:V(V({labelWidth:void 0===u?u:ht(u),label:a?r.title.title:void 0},Qt(r.wrap||{})),{},{prop:e.id,rules:r.validate}),class:r.className,key:"".concat(i,"fi"),ref:e.wrapRef,type:"formItem"}]),V({default:function(){return t}},a?{label:function(){return n.makeInfo(r,i)}}:{}));return!0===l||Xt(s)||Xt(o.show)?f:this.makeCol(r,i,[f])},isTitle:function(e){if(!1===this.options.form.title)return!1;var t=e.title;return!(!t.title&&!t.native||Xt(t.show))},makeInfo:function(e,t){var n=this,r=V({},e.title),i=V({},e.info),o="tooltip"===i.type,a=this.options.form,u=[(r.title||"")+(a.labelSuffix||a["label-suffix"]||"")];if(!Xt(i.show)&&(i.info||i.native)&&!Xt(i.icon)){var c={type:i.type||"popover",props:Qt(i),key:"".concat(t,"pop")};delete c.props.icon,delete c.props.show,delete c.props.info,delete c.props.align,delete c.props.native;var l="content";i.info&&!ce(c.props,l)&&(c.props[l]=i.info),u["left"!==i.align?"unshift":"push"](this.$r(Pe([i,c]),j({},r.slot||(o?"default":"reference"),(function(){return n.$r({type:"ElIcon",style:"top:2px",key:"".concat(t,"i")},{default:function(){return n.$r({type:!0===i.icon?"icon-warning":i.icon})}},!0)}))))}var s=Pe([r,{props:Qt(r),key:"".concat(t,"tit"),type:r.type||"span"}]);return delete s.props.show,delete s.props.title,delete s.props.native,this.$r(s,u)},makeCol:function(e,t,n){var r=e.col;return this.$r({class:r.class,type:"col",props:r||{span:24},key:"".concat(t,"col")},n)},makeRow:function(e){var t=this.options.row||{};return this.$r({type:"row",props:t,class:t.class,key:"".concat(this.key,"row")},e)},makeFormBtn:function(){var e=[];if(Xt(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),Xt(this.options.resetBtn.show)||e.push(this.makeResetBtn()),e.length){var t=this.$r({type:"formItem",key:"".concat(this.key,"fb")},e);return!0===this.rule.props.inline?t:this.$r({type:"col",props:{span:24},key:"".concat(this.key,"fc")},[t])}},makeResetBtn:function(){var e=this,t=V({},this.options.resetBtn),n=t.innerText;return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.resetBtn.click?e.options.resetBtn.click(t):t.resetFields()}},key:"".concat(this.key,"b2")},[n])},makeSubmitBtn:function(){var e=this,t=V({},this.options.submitBtn),n=t.innerText;return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.submitBtn.click?e.options.submitBtn.click(t):t.submit()}},key:"".concat(this.key,"b1")},[n])}},en={};!function(e){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate"].forEach((function(t){e[t]=ot(t)})),e.auto=e.autoComplete,e.number=e.inputNumber,e.color=e.colorPicker}(en),function(e){var t="select",n="multiple";e.selectMultiple=ot(t,j({},n,!0)),e.selectOne=ot(t,j({},n,!1))}(en),function(e){var t={treeSelected:"selected",treeChecked:"checked"};Object.keys(t).reduce((function(e,n){return e[n]=ot("tree",{type:t[n]}),e}),e)}(en),function(e){var t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=ot("upload",(function(e){return e.props({uploadType:t[n][0],maxLength:t[n][1]})})),e}),e),e.uploadImage=e.image,e.uploadFile=e.file}(en),function(e){var t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=ot("frame",(function(e){return e.props({type:t[n][0],maxLength:t[n][1]})})),e}),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(en);function tn(e,t){return ue.Boolean(e)?e={show:e}:ue.Undef(e)||ue.Object(e)||(e={show:t}),e}function nn(e,t){return we(e,{formEl:function(){return t.$manager.form()},wrapEl:function(e){var n=t.getFieldCtx(e);if(n)return t.vm.refs[n.wrapRef]},validate:function(n){return new Promise((function(r,i){var o=e.children,a=[t.$manager.validate()];o.forEach((function(e){a.push(e.validate())})),Promise.all(a).then((function(){r(!0),n&&n(!0)})).catch((function(r){i(r),n&&n(r),t.vm.emit("validate-fail",r,{api:e})}))}))},validateField:function(n,r){return new Promise((function(i,o){var a=t.getFieldCtx(n);if(a){var u=t.subForm[a.id],c=[t.$manager.validateField(a.id)];N(u).forEach((function(e){c.push(e.validate())})),Promise.all(c).then((function(){i(null),r&&r(null)})).catch((function(i){o(i),r&&r(i),t.vm.emit("validate-field-fail",i,{field:n,api:e})}))}}))},clearValidateState:function(n){var r=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.helper.tidyFields(n).forEach((function(e){i&&r.clearSubValidateState(e),t.getCtxs(e).forEach((function(e){t.$manager.clearValidateState(e)}))}))},clearSubValidateState:function(n){e.helper.tidyFields(n).forEach((function(e){t.getCtxs(e).forEach((function(e){var n=t.subForm[e.id];n&&(Array.isArray(n)?n.forEach((function(e){e.clearValidateState()})):n&&n.clearValidateState())}))}))},btn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({show:!!t})}},resetBtn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({show:!!t})}},submitBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=tn(t.options.submitBtn,!0);we(r,n),t.options.submitBtn=r,e.refreshOptions()},resetBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=tn(t.options.resetBtn,!1);we(r,n),t.options.resetBtn=r,e.refreshOptions()},submit:function(n,r){return new Promise((function(i,o){e.validate().then((function(){var r=e.formData();ue.Function(n)&&nt((function(){return n(r,e)})),ue.Function(t.options.onSubmit)&&nt((function(){return t.options.onSubmit(r,e)})),t.vm.emit("submit",r,e),i(r)})).catch((function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];ue.Function(r)&&nt((function(){return r.apply(void 0,[e].concat(n))})),o.apply(void 0,n)}))}))}}),e}U(".form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}");var rn={name:"required",load:function(e,t,n){var r=function(e){return ue.Boolean(e)?{required:e}:ue.String(e)?{message:e}:ue.Undef(e)?{required:!1}:ue.Function(e)?{validator:e}:ue.Object(e)?e:{}}(e.getValue());if(!1===r.required)e.clearProp();else{var i=V({required:!0,validator:function(e,t,n){ue.empty(t)?n(i.message):n()}},r);if(!i.message){var o=t.title||"";i.message=(("object"===F(o)?o.title:o)||"")+"不能为空"}e.getProp().validate=[i]}n.sync(t)},watch:function(){rn.load.apply(rn,arguments)}};function on(e){e.componentAlias(Kt),Ve.forEach((function(t){e.component(t.name,t)})),e.register(rn),Jt.forEach((function(t){e.parser(t)})),Object.keys(en).forEach((function(t){e.maker[t]=en[t]})),"undefined"!=typeof window&&window.ElementPlus&&e.useApp((function(e,t){t.use(window.ElementPlus)}))}var an=Ht({ui:"element-ui",version:"3.1.25",manager:Zt,extendApi:nn,install:on,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=an);var un=an.maker;export{an as default,un as maker};
|
|
7
|
+
import{defineComponent as e,toRef as t,resolveComponent as n,createVNode as r,mergeProps as i,openBlock as o,createElementBlock as a,createElementVNode as u,isVNode as c,nextTick as l,Fragment as s,markRaw as f,watch as d,reactive as p,getCurrentInstance as h,provide as m,inject as v,toRefs as g,onMounted as y,onBeforeUnmount as b,onUpdated as x,computed as _,withDirectives as w,resolveDirective as k,createApp as $,h as C,ref as O}from"vue";function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}function A(e,t){return A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},A(e,t)}function P(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=R(e);if(t){var i=R(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return P(this,n)}}function B(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t){return Object.keys(e).reduce((function(n,r){return t&&-1!==t.indexOf(r)||n.push(e[r]),n}),[])}var M=e({name:"fcCheckbox",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:function(){return[]}},type:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t(e.formCreateInject,"options",[]);return{options:function(){return Array.isArray(r.value)?r.value:[]},value:t(e,"modelValue"),onInput:function(e){n.emit("update:modelValue",e)}}},render:function(){var e,t,o=this,a="button"===this.type?"ElCheckboxButton":"ElCheckbox",u=n(a);return r(n("ElCheckboxGroup"),i(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),V({default:function(){return[o.options().map((function(e,t){var n=V({},e),o=n.value;return delete n.value,r(u,i(n,{label:o,key:a+t+"-"+e.value}),{default:function(){return[n.label||n.value||""]}})})),null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t)]}},T(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}});function N(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}function L(e){e=e||new Map;var t={$on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},$once:function(e,n){n._once=!0,t.$on(e,n)},$off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},$emit:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(e.get(n)||[]).slice().map((function(e){e._once&&(t.$off(n,e),delete e._once),e.apply(void 0,i)})),(e.get("*")||[]).slice().map((function(e){e(n,i)}))}};return t}function U(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}U("._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled .el-button{color:#999;cursor:not-allowed!important}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}");var H={name:"IconCircleClose"},z={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Y=[u("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),u("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1)];H.render=function(e,t,n,r,i,u){return o(),a("svg",z,Y)};var q={name:"IconDocument"},W={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},J=[u("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"},null,-1)];q.render=function(e,t,n,r,i,u){return o(),a("svg",W,J)};var K={name:"IconDelete"},G={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},X=[u("path",{fill:"currentColor",d:"M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"},null,-1)];K.render=function(e,t,n,r,i,u){return o(),a("svg",G,X)};var Q={name:"IconView"},Z={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},ee=[u("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1)];Q.render=function(e,t,n,r,i,u){return o(),a("svg",Z,ee)};var te={name:"IconFolderOpened"},ne={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},re=[u("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"},null,-1)];function ie(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!c(e)}te.render=function(e,t,n,r,i,u){return o(),a("svg",ne,re)};var oe=e({name:"fcFrame",props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"IconFolderOpened"},width:{type:String,default:"500px"},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:"确定"},closeBtnText:{type:String,default:"关闭"},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:function(){}},onOk:{type:Function,default:function(){}},onCancel:{type:Function,default:function(){}},onLoad:{type:Function,default:function(){}},onBeforeRemove:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},onHandle:Function,modal:{type:Object,default:function(){return{}}},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolderOpened:te,IconView:Q},data:function(){return{fileList:N(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new L}},watch:{modelValue:function(e){this.fileList=N(e)}},methods:{close:function(){this.closeModel(!0)},closeModel:function(e){this.bus.$emit(e?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel:function(){this.previewVisible=!1},showModel:function(){this.disabled||!1===this.onOpen()||(this.frameVisible=!0)},input:function(){var e=this.fileList,t=1===this.maxLength?e[0]||"":e;this.$emit("update:modelValue",t),this.$emit("change",t)},makeInput:function(){var e=this;return r(n("ElInput"),i({type:"text",modelValue:this.fileList.map((function(t){return e.getSrc(t)})).toString(),readonly:!0},{key:1}),{append:function(){return r(n("ElButton"),{icon:n(e.icon),onClick:function(){return e.showModel()}},null)},suffix:function(){return e.fileList.length&&!e.disabled?r(n("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:function(){e.fileList=[],e.input()}},{default:function(){return[r(H,null,null)]}}):null}})},makeGroup:function(e){return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),r("div",{key:2},[e])},makeItem:function(e,t){return r("div",{class:"_fc-files",key:"3"+e},[t])},valid:function(e){var t=this.formCreateInject.field||this.field;if(t&&e!==t)throw new Error("[frame]无效的字段值")},makeIcons:function(e,t){if(!1!==this.handleIcon||!0===this.allowRemove){var n=[];return("file"!==this.type&&!1!==this.handleIcon||"file"===this.type&&this.handleIcon)&&n.push(this.makeHandleIcon(e,t)),this.allowRemove&&n.push(this.makeRemoveIcon(e,t)),r("div",{class:"_fc-upload-cover",key:4},[n])}},makeHandleIcon:function(e,t){var i=this,o=n(!0===this.handleIcon||void 0===this.handleIcon?"icon-view":this.handleIcon);return r(n("ElIcon"),{onClick:function(){return i.handleClick(e)},key:"5"+t},{default:function(){return[r(o,null,null)]}})},makeRemoveIcon:function(e,t){var i=this;return r(n("ElIcon"),{onClick:function(){return i.handleRemove(e)},key:"6"+t},{default:function(){return[r(K,null,null)]}})},makeFiles:function(){var e=this;return this.makeGroup(this.fileList.map((function(t,i){return e.makeItem(i,[r(n("ElIcon"),{onClick:function(){return e.handleClick(t)}},{default:function(){return[r(q,null,null)]}}),e.makeIcons(t,i)])})))},makeImages:function(){var e=this;return this.makeGroup(this.fileList.map((function(t,n){return e.makeItem(n,[r("img",{src:e.getSrc(t)},null),e.makeIcons(t,n)])})))},makeBtn:function(){var e=this,t=n(this.icon);return r("div",{class:"_fc-upload-btn",onClick:function(){return e.showModel()},key:7},[r(n("ElIcon"),null,{default:function(){return[r(t,null,null)]}})])},handleClick:function(e){if(this.onHandle)return this.onHandle(e);this.previewImage=this.getSrc(e),this.previewVisible=!0},handleRemove:function(e){this.disabled||!1!==this.onBeforeRemove(e)&&(this.fileList.splice(this.fileList.indexOf(e),1),this.input(),this.onRemove(e))},getSrc:function(e){return this.srcKey?e[this.srcKey]:e},frameLoad:function(e){var t=this;this.onLoad(e);try{!0===this.helper&&(e.form_create_helper={api:this.formCreateInject.api,close:function(e){t.valid(e),t.closeModel()},set:function(e,n){t.valid(e),!t.disabled&&t.$emit("update:modelValue",n)},get:function(e){return t.valid(e),t.modelValue},onOk:function(e){return t.bus.$on("$ok",e)},onClose:function(e){return t.bus.$on("$close",e)}})}catch(e){console.error(e)}},makeFooter:function(){var e=this,t=this.$props,i=t.okBtnText,o=t.closeBtnText,a=t.closeBtn,u=t.okBtn;if(t.footer)return r("div",null,[a?r(n("ElButton"),{onClick:function(){return!1!==e.onCancel()&&(e.frameVisible=!1)}},ie(o)?o:{default:function(){return[o]}}):null,u?r(n("ElButton"),{type:"primary",onClick:function(){return!1!==e.onOk()&&e.closeModel()}},ie(i)?i:{default:function(){return[i]}}):null])}},render:function(){var e,t=this,o=this.type;e="input"===o?this.makeInput():"image"===o?this.makeImages():this.makeFiles();var a=this.$props,u=a.width,c=void 0===u?"30%":u,s=a.height,f=a.src,d=a.title,p=a.modalTitle;return l((function(){t.$refs.frame&&t.frameLoad(t.$refs.frame.contentWindow||{})})),r("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,r(n("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:p,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[r("img",{style:"width: 100%",src:t.previewImage},null)]}}),r(n("ElDialog"),i({appendToBody:!0},V({width:c,title:d},this.modal),{modelValue:this.frameVisible,onClose:function(){return t.closeModel(!0)}}),{default:function(){return[t.frameVisible||!t.reload?r("iframe",{ref:"frame",src:f,frameBorder:"0",style:{height:s,border:"0 none",width:"100%"}},null):null]},footer:function(){return t.makeFooter()}})])},beforeMount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.on("fc:closeModal:"+t,this.close),n&&r.on("fc:closeModal:"+n,this.close)},beforeUnmount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.off("fc:closeModal:"+t,this.close),n&&r.off("fc:closeModal:"+n,this.close)}}),ae=e({name:"fcRadio",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},type:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t(e.formCreateInject,"options",[]);return{options:function(){return Array.isArray(r.value)?r.value:[]},value:t(e,"modelValue"),onInput:function(e){n.emit("update:modelValue",e)}}},render:function(){var e,t,o=this,a="button"===this.type?"ElRadioButton":"ElRadio",u=n(a);return r(n("ElRadioGroup"),i(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),V({default:function(){return[o.options().map((function(e,t){var n=V({},e),o=n.value;return delete n.value,r(u,i(n,{label:o,key:a+t+"-"+e.value}),{default:function(){return[n.label||n.value||""]}})})),null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t)]}},T(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),ue={type:function(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef:function(e){return null==e},Element:function(e){return"object"===F(e)&&null!==e&&1===e.nodeType&&!ue.Object(e)},trueArray:function(e){return Array.isArray(e)&&e.length>0},Function:function(e){var t=this.getType(e);return"Function"===t||"AsyncFunction"===t},getType:function(e){var t=Object.prototype.toString.call(e);return/^\[object (.*)\]$/.exec(t)[1]},empty:function(e){return null==e||(!(!Array.isArray(e)||!Array.isArray(e)||e.length)||"string"==typeof e&&!e)}};function ce(e,t){return{}.hasOwnProperty.call(e,t)}["Date","Object","String","Boolean","Array","Number"].forEach((function(e){ue[e]=function(t){return ue.type(t,e)}}));var le=e({name:"fcSelect",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup:function(e){var n=t(e.formCreateInject,"options",[]);return{options:function(){return Array.isArray(n.value)?n.value:[]},value:t(e,"modelValue")}},render:function(){var e,t,o=this,a=function(e,t){return r(n("ElOption"),i(e,{key:t+"-"+e.value}),null)},u=this.options();return r(n("ElSelect"),i(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":function(e){return o.$emit("update:modelValue",e)},ref:"el"}),V({default:function(){return[u.map((function(e,t){return ce(e||"","options")?function(e,t){return r(n("ElOptionGroup"),{label:e.label,key:t+"-"+e.label},{default:function(){return[ue.trueArray(e.options)&&e.options.map((function(e,t){return a(e,t)}))]}})}(e,t):a(e,t)})),null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t)]}},T(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),se=e({name:"fcTree",inheritAttrs:!1,formCreateParser:{mergeProp:function(e){var t=e.prop.props;t.nodeKey||(t.nodeKey="id"),t.props||(t.props={label:"title"})}},props:{type:String,modelValue:{type:[Array,String,Number],default:function(){return[]}}},emits:["update:modelValue","fc.el"],watch:{modelValue:function(){this.setValue()}},methods:{updateValue:function(){var e;this.$refs.tree&&(e="selected"===this.type?this.$refs.tree.getCurrentKey():this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",e))},setValue:function(){this.$refs.tree&&("selected"===this.type?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(N(this.modelValue)))}},render:function(){return r(n("ElTree"),i(this.$attrs,{ref:"tree",onCheck:this.updateValue,"onNode-click":this.updateValue}),this.$slots)},mounted:function(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}});U("._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}");var fe={name:"IconUpload"},de={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},pe=[u("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1)];function he(e,t){return{url:e,name:me(e),uid:t}}function me(e){return(""+e).split("/").pop()}fe.render=function(e,t,n,r,i,u){return o(),a("svg",de,pe)};var ve=e({name:"fcUpload",inheritAttrs:!1,formCreateParser:{toFormValue:function(e){return N(e)},toValue:function(e,t){return 1===t.prop.props.limit?e[0]||"":e}},props:{previewMask:void 0,onPreview:Function,modalTitle:String,modelValue:[Array,String]},emits:["update:modelValue","change","remove","fc.el"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=N(this.modelValue).map(he)},watch:{modelValue:function(e){this.fileList=N(e).map(he)}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)}},render:function(){var e,t,o=this,a=N(this.modelValue).length;return r(s,null,[r(n("ElUpload"),i({key:a,"list-type":"picture-card"},this.$attrs,{class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=a},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,fileList:this.fileList,ref:"upload"}),V({default:function(){return[(null===(e=(t=o.$slots).default)||void 0===e?void 0:e.call(t))||r(n("ElIcon"),null,{default:function(){return[r(fe,null,null)]}})]}},T(this.$slots,["default"]))),r(n("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[r("img",{style:"width: 100%",src:o.previewImage},null)]}})])},mounted:function(){this.$emit("fc.el",this.$refs.upload)}});function ge(e,t,n){e[t]=n}function ye(e,t){delete e[t]}function be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];if((r=Array.isArray(o))||ue.Object(o)){var a=void 0===e[i];if(r)r=!1,a&&ge(e,i,[]);else if(o._clone&&void 0!==n){if(!n){ge(e,i,o._clone());continue}o=o.getRule(),a&&ge(e,i,{})}else a&&ge(e,i,{});e[i]=be(e[i],o,n)}else ge(e,i,o),ue.Undef(o)||(ue.Undef(o.__json)||(e[i].__json=o.__json),ue.Undef(o.__origin)||(e[i].__origin=o.__origin))}return void 0!==n&&Array.isArray(e)?e.filter((function(e){return!e||!e.__ctrl})):e}function xe(e){return be({},{value:e}).value}var _e=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&ge(e,r,t[r]);return e};function we(){return _e.apply(this,arguments)}U('._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%}');var ke=e({name:"fcGroup",props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:function(){return[]}},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},onBeforeRemove:{type:Function,default:function(){}},onBeforeAdd:{type:Function,default:function(){}},formCreateInject:Object,parse:Function},data:function(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:f(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler:function(e,t){var n=this;Object.keys(this.cacheRule).forEach((function(r){var i=n.cacheRule[r];if(i.$f){var o=i.$f.formData();if(e===t)i.$f.deferSyncValue((function(){be(i.rule,e),i.$f.setValue(o)}),!0);else{var a=i.$f.formData();i.$f.once("reloading",(function(){i.$f.setValue(a)})),i.rule=xe(e)}}}))},deep:!0},disabled:function(e){if(this.syncDisabled){var t=this.cacheRule;Object.keys(t).forEach((function(n){t[n].$f.disabled(e)}))}},expand:function(e){var t=e-this.modelValue.length;t>0&&this.expandRule(t)},modelValue:{handler:function(e){var t=this;e=e||[];var n=Object.keys(this.sort),r=n.length,i=r-e.length;if(i<0){for(var o=i;o<0;o++)this.addRule(e.length+o,!0);for(var a=0;a<r;a++)this.setValue(n[a],e[a])}else{if(i>0)for(var u=0;u<i;u++)this.removeRule(n[r-u-1]);e.forEach((function(r,i){t.setValue(n[i],e[i])}))}},deep:!0}},methods:{_value:function(e){return e&&ce(e,this.field)?e[this.field]:e},cache:function(e,t){this.cacheValue[e]=JSON.stringify(t)},input:function(e){this.$emit("update:modelValue",e),this.$emit("change",e)},formData:function(e,t){var n=this,r=this.cacheRule,i=this.sort;if(i.filter((function(e){return r[e].$f})).length===i.length){var o=i.map((function(r){var i=e===r?t:V({},n.cacheRule[r].$f.form),o=n.field?i[n.field]||null:i;return n.cache(r,o),o}));this.input(o)}},setValue:function(e,t){var n=this.field;n&&(t=j({},n,this._value(t))),this.cacheValue[e]!==JSON.stringify(n?t[n]:t)&&this.cache(e,t)},addRule:function(e,t){var n=this,r=this.formCreateInject.form.copyRules(this.rule||[]),i=this.options?V({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});var o=xe(this.defaultValue);we(i.formData,this.field?j({},this.field,o):o)}this.parse&&this.parse({rule:r,options:i,index:this.sort.length}),this.cacheRule[++this.len]={rule:r,options:i},t&&l((function(){return n.$emit("add",r,Object.keys(n.cacheRule).length-1)}))},add$f:function(e,t,n){var r=this;this.cacheRule[t].$f=n,l((function(){r.syncDisabled&&n.disabled(r.disabled),r.$emit("itemMounted",n,Object.keys(r.cacheRule).indexOf(t))}))},removeRule:function(e,t){var n=this,r=Object.keys(this.cacheRule).indexOf(e);delete this.cacheRule[e],delete this.cacheValue[e],t&&l((function(){return n.$emit("remove",r)}))},add:function(e){if(!this.disabled&&!1!==this.onBeforeAdd(this.modelValue)){var t=B(this.modelValue);t.push(this.defaultValue?xe(this.defaultValue):this.field?null:{}),this.input(t)}},del:function(e,t){if(!this.disabled&&!1!==this.onBeforeRemove(this.modelValue,e)){this.removeRule(t,!0);var n=B(this.modelValue);n.splice(e,1),this.input(n)}},addIcon:function(e){return r("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon:function(e,t){var n=this;return r("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:function(){return n.del(e,t)}},null)},sortUpIcon:function(e){var t=this;return r("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:function(){return t.changeSort(e,-1)}},null)},sortDownIcon:function(e){var t=this;return r("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:function(){return t.changeSort(e,1)}},null)},changeSort:function(e,t){var n=this.sort[e];this.sort[e]=this.sort[e+t],this.sort[e+t]=n,this.formData(0)},makeIcon:function(e,t,n){var r=this;if(this.$slots.button)return this.$slots.button({total:e,index:t,vm:this,key:n,del:function(){return r.del(t,n)},add:this.add});var i=[];return(!this.max||e<this.max)&&e===t+1&&i.push(this.addIcon(n)),e>this.min&&i.push(this.delIcon(t,n)),this.sortBtn&&t&&i.push(this.sortUpIcon(t)),this.sortBtn&&t!==e-1&&i.push(this.sortDownIcon(t)),i},emitEvent:function(e,t,n,r){this.$emit.apply(this,[e].concat(B(t),[this.cacheRule[r].$f,n]))},expandRule:function(e){for(var t=0;t<e;t++)this.addRule(t)}},created:function(){var e=this;d((function(){return V({},e.cacheRule)}),(function(t){e.sort=Object.keys(t)}),{immediate:!0});for(var t=(this.expand||0)-this.modelValue.length,n=0;n<this.modelValue.length;n++)this.addRule(n);t>0&&this.expandRule(t)},render:function(){var e=this,t=this.sort,n=this.button,o=this.form,a=this.disabled,u=0===t.length?this.$slots.default?this.$slots.default({vm:this,add:this.add}):r("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add",onClick:this.add},null):t.map((function(u,c){var l=e.cacheRule[u],s=l.rule,f=l.options,d=n&&!a?e.makeIcon(t.length,c,u):[];return r("div",{class:"_fc-group-container",key:u},[r(o,i({key:u},{"onUpdate:modelValue":function(t){return e.formData(u,t)},"onEmit-event":function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.emitEvent(t,r,c,u)},"onUpdate:api":function(t){return e.add$f(c,u,t)},inFor:!0,modelValue:e.field?j({},e.field,e._value(e.modelValue[c])):e.modelValue[c],rule:s,option:f,extendOption:!0}),null),r("div",{class:"_fc-group-idx"},[c+1]),d.length?r("div",{class:"_fc-group-handle"},[d]):null])}));return r("div",{key:"con",class:"_fc-group "+(a?"_fc-group-disabled":"")},[u])}}),$e=e({name:"fcSubForm",props:{rule:Array,options:{type:Object,default:function(){return p({submitBtn:!1,resetBtn:!1})}},modelValue:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data:function(){return{cacheValue:{},subApi:{},form:f(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{disabled:function(e){this.syncDisabled&&this.subApi.disabled(e)},modelValue:function(e){this.setValue(e)}},methods:{formData:function(e){this.cacheValue=JSON.stringify(e),this.$emit("update:modelValue",e),this.$emit("change",e)},setValue:function(e){var t=JSON.stringify(e);this.cacheValue!==t&&(this.cacheValue=t,this.subApi.coverValue(e||{}))},add$f:function(e){var t=this;this.subApi=e,l((function(){t.syncDisabled&&e.disabled(t.disabled),t.$emit("itemMounted",e)}))}},render:function(){var e=this.form;return r(e,{"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onEmit-event":this.$emit,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),Ce={name:"IconWarning"},Oe={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Se=[u("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"},null,-1)];Ce.render=function(e,t,n,r,i,u){return o(),a("svg",Oe,Se)};var Ve=[M,oe,ae,le,se,ve,ke,$e,Ce],Fe=function e(t,n){if(t&&t!==n)return t.props.formCreateInject?t.props.formCreateInject:t.parent?e(t.parent,n):void 0};function Ee(t,n,r){return e({name:"FormCreate",components:n,directives:r,props:{rule:{type:Array,required:!0,default:function(){return[]}},option:{type:Object,default:function(){return{}}},extendOption:Boolean,modelValue:Object,api:Object,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","submit","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail"],render:function(){return this.fc.render()},setup:function(e){var n=h();m("parentFC",n);var r=v("parentFC",null),i=g(e),o=i.rule,a=i.modelValue,u=i.subForm,c=i.inFor,l=p({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:B(o.value||[]),updateValue:JSON.stringify(a||{})}),s=new t(n),_=s.api(),w=c.value,k=function(){var e=Fe(n,r);if(e)if(w){var t=N(e.getSubForm()),i=t.indexOf(_);i>-1&&t.splice(i,1)}else e.subForm()};return y((function(){s.mounted()})),b((function(){k(),l.destroyed=!0,s.unmount()})),x((function(){s.updated()})),d(u,(function(e){e?function(){if(r){var e,t=Fe(n,r);t&&(w?(e=N(t.getSubForm())).push(_):e=_,t.subForm(e))}}():k()}),{immediate:!0}),d((function(){return B(o.value)}),(function(e){s.$handle.isBreakWatch()||e.length===l.renderRule.length&&e.every((function(e){return l.renderRule.indexOf(e)>-1}))||(s.$handle.reloadRule(o.value),n.setupState.renderRule())})),d((function(){return e.option}),(function(e){s.initOptions(e),_.refresh()}),{deep:!0}),d(a,(function(e){JSON.stringify(e||{})!==l.updateValue&&(_.config.forceCoverValue?_.coverValue(e||{}):_.setValue(e||{}))}),{deep:!0}),V(V({fc:f(s),parent:r?f(r):r,fapi:f(_)},g(l)),{},{refresh:function(){++l.unique},renderRule:function(){l.renderRule=B(o.value||[])},updateValue:function(e){l.destroyed||(l.updateValue=JSON.stringify(e),n.emit("update:modelValue",e))}})},created:function(){var e=h();e.setupState.fc.init(),e.emit("update:api",e.setupState.fapi)}})}var je=["props"],Re=["class","style","directives"],Ae=["on"],Pe=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=[].concat(je,B(r.normal||[])),o=[].concat(Re,B(r.array||[])),a=[].concat(Ae,B(r.functional||[])),u=r.props||[];return t.reduce((function(t,n){for(var r in n)if(t[r])if(u.indexOf(r)>-1)t[r]=e([n[r]],t[r]);else if(i.indexOf(r)>-1)t[r]=V(V({},t[r]),n[r]);else if(o.indexOf(r)>-1){var c=t[r]instanceof Array?t[r]:[t[r]],l=n[r]instanceof Array?n[r]:[n[r]];t[r]=[].concat(B(c),B(l))}else if(a.indexOf(r)>-1)for(var s in n[r])if(t[r][s]){var f=t[r][s]instanceof Array?t[r][s]:[t[r][s]],d=n[r][s]instanceof Array?n[r][s]:[n[r][s]];t[r][s]=[].concat(B(f),B(d))}else t[r][s]=n[r][s];else if("hook"===r)for(var p in n[r])t[r][p]?t[r][p]=Ie(t[r][p],n[r][p]):t[r][p]=n[r][p];else t[r]=n[r];else i.indexOf(r)>-1||a.indexOf(r)>-1||u.indexOf(r)>-1?t[r]=V({},n[r]):o.indexOf(r)>-1?t[r]=n[r]instanceof Array?B(n[r]):"object"===F(n[r])?V({},n[r]):n[r]:t[r]=n[r];return t}),n)},Ie=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},Be=["type","slot","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache"],De=["validate","children","control"],Te=["effect"];function Me(){return[].concat(Be,B(je),B(Re),B(Ae),De,Te)}function Ne(e,t,n){return"[form-create ".concat(e,"]: ").concat(t)+(n?"\n\nrule: "+JSON.stringify(n.getRule?n.getRule():n):"")}function Le(e,t){console.error(Ne("err",e,t))}function Ue(e){var t=e.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}var He="[[FORM-CREATE-PREFIX-",ze="-FORM-CREATE-SUFFIX]]";function Ye(e,t){return JSON.stringify(be([],e,!0),(function(e,t){if(!t||!0!==t._isVue){if("function"!==F(t))return t;if(t.__json)return t.__json;if(t.__origin&&(t=t.__origin),!t.__emit)return He+t+ze}}),t)}function qe(e){return new Function("return "+e)()}function We(e,t){if(e&&ue.String(e)&&e.length>4){var n=e.trim(),r=!1;try{if(n.indexOf(ze)>0&&0===n.indexOf(He))n=n.replace(ze,"").replace(He,""),r=!0;else if(0===n.indexOf("$FN:"))n=n.replace("$FN:",""),r=!0;else{if(0===n.indexOf("$FNX:"))return(n=qe("function($inject){"+n.replace("$FNX:","")+"}")).__json=e,n.__inject=!0,n;t||0!==n.indexOf("function")||"function"===n||(r=!0)}if(!r)return e;var i=qe(-1===n.indexOf("function")&&0!==n.indexOf("(")?"function "+n:n);return i.__json=e,i}catch(e){return void Le("解析失败:".concat(n,"\n\nerr: ").concat(e))}}return e}function Je(e,t){return JSON.parse(e,(function(e,n){return ue.Undef(n)||!n.indexOf?n:We(n,t)}))}function Ke(e,t){return{value:e,enumerable:!1,configurable:!1,writable:!!t}}function Ge(e,t){return Xe([e],t||!1)[0]}function Xe(e,t){return be([],B(e),t||!1)}function Qe(e,t){return Pe(Array.isArray(t)?t:[t],e,{array:De,normal:Te}),e}function Ze(e){var t=ue.Function(e.getRule)?e.getRule():e;return t.type||(t.type="input"),t}function et(e,t){Object.defineProperties(e,Object.keys(t).reduce((function(e,n){return e[n]={get:function(){return t[n]()}},e}),{}))}function tt(e){return e.__fc__||(e.__origin__?e.__origin__.__fc__:null)}function nt(e,t){try{t=e()}catch(e){!function(e){Le(e.toString()),console.error(e)}(e)}return t}function rt(){var e={},t=function(e){return e||"default"};return{setSlot:function(n,r){n=t(n),!r||Array.isArray(r)&&r.length||(e[n]||(e[n]=[]),e[n].push(r))},getSlot:function(n,r){n=t(n);var i=[];return(e[n]||[]).forEach((function(e){if(Array.isArray(e))i.push.apply(i,B(e));else if(ue.Function(e)){var t=e.apply(void 0,B(r||[]));Array.isArray(t)?i.push.apply(i,B(t)):i.push(t)}else ue.Undef(e)||i.push(e)})),i},getSlots:function(){var t=this,n={};return Object.keys(e).forEach((function(e){n[e]=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.getSlot(e,r)}})),n},slotLen:function(n){return n=t(n),e[n]?e[n].length:0},mergeBag:function(e){var t=this;if(!e)return this;var n=ue.Function(e.getSlots)?e.getSlots():e;return Array.isArray(e)||c(e)?this.setSlot(void 0,(function(){return e})):Object.keys(n).forEach((function(e){t.setSlot(e,n[e])})),this}}}function it(e){var t=V({},e.props||{});return Object.keys(e.on||{}).forEach((function(n){var r,i="on".concat((r=n).replace(r[0],r[0].toLocaleUpperCase()));Array.isArray(t[i])?t[i]=[].concat(B(t[i]),[e.on[n]]):t[i]?t[i]=[t[i],e.on[n]]:t[i]=e.on[n]})),t.key=e.key,t.ref=e.ref,t.class=e.class,t.style=e.style,t.slot&&delete t.slot,t}function ot(e,t){return function(n,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=new at(e,n,r,i,o);return t&&(ue.Function(t)?t(a):a.props(t)),a}}function at(e,t,n,r,i){this._data=we({props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0},{type:e,title:t,field:n,value:r,props:i||{}}),this.event=this.on}function ut(e){e.forEach((function(e){at.prototype[e]=function(t){return Qe(this._data,j({},e,arguments.length<2?t:j({},t,arguments[1]))),this}}))}we(at.prototype,{getRule:function(){return this._data},setProp:function(e,t){return ge(this._data,e,t),this},modelField:function(e){return this._data.modelField=e,this},_clone:function(){var e=new this.constructor;return e._data=Ge(this._data),e}}),ut(Me());var ct=ot("");function lt(e,t,n){var r=ct("",t);return r._data.type=e,r._data.title=n,r}function st(){return{create:lt,factory:ot}}function ft(e){return xe(e)}function dt(e){return pt(e.replace(/(-[a-z])/g,(function(e){return e.replace("-","").toLocaleUpperCase()})))}function pt(e){return e.replace(e[0],e[0].toLowerCase())}function ht(e){return null==e?"":"object"===F(e)?JSON.stringify(e,null,2):String(e)}var mt=0;function vt(){return"F"+Math.random().toString(36).substr(3,3)+Number("".concat(Date.now()).concat(++mt)).toString(36)}function gt(e,t,n){var r,i=e;return(t||"").split(".").forEach((function(e){r&&(i[r]&&"object"==F(i[r])||(i[r]={}),i=i[r]),r=e})),i[r]=n,i}var yt=1;function bt(e){we(this,{$handle:e,fc:e.fc,vm:e.vm,$manager:e.$manager,vNode:new e.fc.CreateNode(e.vm),id:yt++}),et(this,{options:function(){return e.options},sort:function(){return e.sort}}),this.initCache(),this.initRender()}!function(e){we(e.prototype,{initCache:function(){this.clearCacheAll()},clearCache:function(e){e.rule.cache||this.cache[e.id]&&((!0===this.cache[e.id].use||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id]=null)},clearCacheAll:function(){this.cache={}},setCache:function(e,t,n){this.cache[e.id]={vnode:t,use:!1,parent:n,slot:e.rule.slot}},getCache:function(e){var t=this.cache[e.id];if(t)return t.use=!0,t.vnode}})}(bt),function(e){we(e.prototype,{initRender:function(){this.cacheConfig={}},getTypeSlot:function(e){return function t(n){if(n){var r=void 0;return e.rule.field&&(r=n.slots["field-"+Ue(e.rule.field)]||n.slots["field-"+e.rule.field]),r||(r=n.slots["type-"+Ue(e.type)]||n.slots["type-"+e.type]),r||t(n.setupState.parent)}}(this.vm)},render:function(){var e=this;if(this.vm.setupState.isShow){this.$manager.beforeRender();var t=rt();return this.sort.forEach((function(n){e.renderSlot(t,e.$handle.ctxs[n])})),this.$manager.render(t)}},renderSlot:function(e,t,n){if(this.isFragment(t)){t.initProp(),this.mergeGlobal(t),t.initNone();var r=this.renderChildren(t.loadChildrenPending(),t),i=r.default;i&&e.setSlot(t.rule.slot,(function(){return i()})),delete r.default,e.mergeBag(r)}else e.setSlot(t.rule.slot,this.renderCtx(t,n))},mergeGlobal:function(e){var t=this;this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=_((function(){var n=t.$handle.options.global;return Qe({},[n["*"],n[e.originType]||n[e.type]||n[e.type]||{}])}))),e.prop=Qe({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions:function(e){var t=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=t,e.prop.optionsTo&&t&>(e.prop,e.prop.optionsTo,t)},deepSet:function(e){var t=e.rule.deep;t&&Object.keys(t).sort((function(e,t){return e.length<t.length?-1:1})).forEach((function(n){gt(e.prop,n,t[n])}))},parseSide:function(e,t){return ue.Object(e)?Qe({props:{formCreateInject:t.prop.props.formCreateInject}},e):e},renderSides:function(e,t,n){var r=t[n?"rule":"prop"];return[this.renderRule(this.parseSide(r.prefix,t)),e,this.renderRule(this.parseSide(r.suffix,t))]},renderId:function(e,t){var n=this,r=this.$handle["field"===t?"fieldCtx":"nameCtx"][e];return r?r.map((function(e){return n.renderCtx(e,e.parent)})):void 0},renderCtx:function(e,t){var n=this;try{if("hidden"===e.type)return;var r=e.rule;if(!this.cache[e.id]||this.cache[e.id].slot!==r.slot){var i;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);var o=e.prop;o.preview=!!(ce(o,"preview")?o.preview:this.options.preview),o.props.formCreateInject=this.injectProp(e);var a=!1!==o.cache,u=o.preview;if(o.hidden)return void this.setCache(e,void 0,t);i=function(){for(var i=arguments.length,c=new Array(i),l=0;l<i;l++)c[l]=arguments[l];var s={rule:r,prop:o,preview:u,api:n.$handle.api,model:o.model||{},slotValue:c};c.length&&r.slotUpdate&&nt((function(){return r.slotUpdate(s)}));var f={},d=e.loadChildrenPending();e.parser.renderChildren?f=e.parser.renderChildren(d,e):!1!==e.parser.loadChildren&&(f=n.renderChildren(d,e));var p,h=n.getTypeSlot(e);return h?(s.children=f,p=h(s)):p=u?e.parser.preview(f,e):e.parser.render(f,e),p=n.renderSides(p,e),!e.input&&ue.Undef(o.native)||!0===o.native||(p=n.$manager.makeWrap(e,p)),e.none&&(p=n.display(p)),a&&!Object.keys(f).length&&n.setCache(e,(function(){return p}),t),p},this.setCache(e,i,t)}return function(){var t=n.getCache(e);if(t)return t.apply(void 0,arguments);if(!n.cache[e.id]){var r=n.renderCtx(e,e.parent);return r?r():void 0}}}catch(e){return void console.error(e)}},getModelField:function(e){return e.rule.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},display:function(e){var t=this;if(Array.isArray(e)){var n=[];return e.forEach((function(e){if(Array.isArray(e))return t.display(e);t.none(e)&&n.push(e)})),n}return this.none(e)},none:function(e){if(e)return Array.isArray(e.props.style)?e.props.style.push({display:"none"}):e.props.style=[e.props.style,{display:"none"}],e},isFragment:function(e){return"fragment"===e.type||"template"===e.type},injectProp:function(e){var t=this,n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:function(n){t.$handle.addSubForm(e,n)},getSubForm:function(){return t.$handle.subForm[e.id]},options:[],children:[],preview:!1,field:e.field,rule:e.rule,input:e.input});var r=n.ctxInject[e.id];return we(r,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),r},ctxProp:function(e,t){var n=this,r=e.ref,i=e.key,o=e.rule;this.$manager.mergeProp(e,t),e.parser.mergeProp(e,t);var a=[{ref:r,key:o.key||"".concat(i,"fc"),slot:void 0,on:{vnodeMounted:function(t){t.el.__rule__=e.rule,n.onMounted(e,t.el)},"fc.el":function(t){e.exportEl=t,t&&((t.$el||t).__rule__=e.rule)}}}];if(!t&&e.input){var u=this.getModelField(e),c={callback:function(t){n.onInput(e,t)},value:this.$handle.getFormData(e)};a.push({on:j({},"update:".concat(u),c.callback),props:j({},u,c.value)}),e.prop.model=c}return Pe(a,e.prop),e.prop},onMounted:function(e,t){e.el=this.vm.refs[e.ref]||t,e.parser.mounted(e),this.$handle.effect(e,"mounted")},onInput:function(e,t){this.$handle.onInput(e,t)},renderChildren:function(e,t){var n=this;if(!ue.trueArray(e))return{};var r=rt();return e.map((function(i){if(i)return ue.String(i)?r.setSlot(null,i):i.__fc__?n.renderSlot(r,i.__fc__,t):void(i.type&&l((function(){n.$handle.loadChildren(e,t),n.$handle.refresh()})))})),r.getSlots()},defaultRender:function(e,t){var n=e.prop;return n.component?this.vNode.makeComponent(n.component,n,t):this.vNode[e.type]?this.vNode[e.type](n,t):this.vNode[e.originType]?this.vNode[e.originType](n,t):this.vNode.make(pt(e.originType),n,t)},renderRule:function(e,t,n){var r=this;if(e){if(ue.String(e))return e;var i;if(n)i=e.type;else if(i=e.is,e.type){i=dt(e.type);var o=this.vNode.aliasMap[i];o&&(i=dt(o))}if(i){var a=rt();ue.trueArray(e.children)&&e.children.forEach((function(e){e&&a.setSlot(null==e?void 0:e.slot,(function(){return r.renderRule(e)}))}));var u=V({},e);return delete u.type,delete u.is,this.vNode.make(i,u,a.mergeBag(t).getSlots())}}}})}(bt);var xt=["hook:updated","hook:mounted"];function _t(e,t,n){var r,i=vt(),o=!!t.field;we(this,{id:i,ref:i,wrapRef:i+"fi",rule:t,origin:t.__origin__||t,name:t.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],parent:null,cacheConfig:null,prop:V({},t),computed:{},payload:{},refRule:{},input:o,el:void 0,exportEl:void 0,defaultValue:o?xe(n):void 0,field:t.field||void 0}),this.updateType(),this.updateKey(),r=this,Object.defineProperties(r.origin,{__fc__:Ke(f(r),!0)}),this.update(e,!0)}we(_t.prototype,{loadChildrenPending:function(){var e=this,t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:function(t){e.$handle&&e.$handle.loadChildren(t,e)},onUpdate:function(t,n){e.$handle&&(t===n?e.$handle.loadChildren(t,e):e.$handle.updateChildren(e,t,n))},onReload:function(t){e.$handle?e.$handle.updateChildren(e,[],t):delete e.pending.children}})},loadPending:function(e){var t=this,n=e.key,r=e.origin,i=e.def,o=e.onLoad,a=e.onReload,u=e.onUpdate;if(this.pending[n]&&this.pending[n].origin===r)return this.getPending(n,i);delete this.pending[n];var c=r;if(ue.Function(r)){var l=nt((function(){return r({rule:t.rule,api:t.$api,update:function(e){var o=e||i,a=t.getPending(n,i);t.setPending(n,r,o),u&&u(o,a)},reload:function(){var e=t.getPending(n,i);delete t.pending[n],a&&a(e),t.$api&&t.$api.sync(t.rule)}})}));l&&ue.Function(l.then)?(l.then((function(e){var a=e||i;t.setPending(n,r,a),o&&o(a),t.$api&&t.$api.sync(t.rule)})).catch((function(e){console.error(e)})),c=i,this.setPending(n,r,c)):(c=l||i,this.setPending(n,r,c),o&&o(c))}return c},getPending:function(e,t){return this.pending[e]&&this.pending[e].value||t},setPending:function(e,t,n){this.pending[e]={origin:t,value:p(n)}},effectData:function(e){return this.payload[e]||(this.payload[e]={}),this.payload[e]},clearEffectData:function(e){void 0===e?this.payload={}:delete this.payload[e]},updateKey:function(e){this.key=vt(),e&&this.parent&&this.parent.updateKey(e)},updateType:function(){this.originType=this.rule.type,this.type=dt(this.rule.type)},setParser:function(e){this.parser=e,e.init(this)},initProp:function(){var e=this,t=V({},this.rule);delete t.children,this.prop=Qe({},[t].concat(B(Object.keys(this.payload).map((function(t){return e.payload[t]}))),[this.computed]))},initNone:function(){var e,t;this.none=(e=this,t=!(ue.Undef(e.prop.display)||e.prop.display),e.parent&&e.parent.none||t)},check:function(e){return this.vm===e.vm},unwatch:function(){this.watch.forEach((function(e){return e()})),this.watch=[],this.refRule={}},unlink:function(){this.linkOn.forEach((function(e){return e()})),this.linkOn=[]},link:function(){this.unlink(),this.$handle.appendLink(this)},watchTo:function(){this.$handle.watchCtx(this)},delete:function(){var e=void 0;this.unwatch(),this.unlink(),this.rmCtrl(),we(this,{deleted:!0,prop:V({},this.rule),computed:{},el:e,$handle:e,$render:e,$api:e,vm:e,vNode:e,parent:null,cacheConfig:null,none:!1})},rmCtrl:function(){this.ctrlRule.forEach((function(e){return e.__fc__&&e.__fc__.rm()})),this.ctrlRule=[]},rm:function(){var e=this,t=function(){var t=e.root.indexOf(e.origin);t>-1&&(e.root.splice(t,1),e.$handle&&e.$handle.refresh())};this.deleted?t():this.$handle.noWatch((function(){e.$handle.deferSyncValue((function(){e.rmCtrl(),t(),e.$handle.rmCtx(e),we(e,{root:[]})}),e.input)}))},update:function(e,t){we(this,{deleted:!1,$handle:e,$render:e.$render,$api:e.api,vm:e.vm,trueType:e.getType(this.originType),vNode:e.$render.vNode,updated:!1,cacheValue:this.rule.value}),!t&&this.unwatch(),this.watchTo(),this.link()}});var wt={"==":function(e){return function(t){return t===e}},"!=":function(e){return function(t){return t!==e}},"<>":function(e){return function(t){return t!==e}},">":function(e){return function(t){return t>e}},">=":function(e){return function(t){return t>=e}},"<":function(e){return function(t){return t<e}},"<=":function(e){return function(t){return t<=e}},in:function(e){return function(t){return e&&e.indexOf&&e.indexOf(t)>-1}},on:function(e){return function(t){return t&&t.indexOf&&t.indexOf(e)>-1}},notIn:function(e){return function(t){return!wt.in(e)(t)}},notOn:function(e){return function(t){return!wt.on(e)(t)}},between:function(e){return function(t){return t>e[0]&&t<e[1]}},notBetween:function(e){return function(t){return t<e[0]||t>e[1]}}};function kt(e,t){for(var n=0;n<e.ctrlRule.length;n++){var r=e.ctrlRule[n];if(r.children===t)return r}}function $t(e){return!!e.rule.__ctrl}function Ct(e,t){return"function"==typeof t?""+t:t}var Ot={init:function(e){},toFormValue:function(e,t){return e},toValue:function(e,t){return e},mounted:function(e){},render:function(e,t){return t.$render.defaultRender(t,e)},preview:function(e,t){return this.render(e,t)},mergeProp:function(e){}},St={sum:function(e){if(Array.isArray(e)){var t=0;return e.map((function(e){return t+=e||0})),t}},column:function(e,t){return Array.isArray(e)?e.map((function(e){return e[t]})):[]},get:function(e,t,n){for(var r=t.split("."),i=e,o=0;o<r.length;o++){if(!ce(i,r[o]))return void 0===n?0:n;i=i[r[o]]}return i}},Vt=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"];function Ft(e){var t=this;et(this,{options:function(){return e.options.value||{}},bus:function(){return e.bus}}),we(this,{fc:e,vm:e.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:p({}),subForm:{},form:p({}),appendData:{},providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:function(){t.lifecycle("reload")}}),this.initData(e.rules),this.$manager=new e.manager(this),this.$render=new bt(this),this.api=e.extendApi(function(e){function t(t){return ue.Undef(t)?t=e.fields():Array.isArray(t)||(t=[t]),t}function n(n,r,i){t(n).forEach((function(t){e.getCtxs(t).forEach((function(t){ge(t.rule,r,i),e.$render.clearCache(t)}))}))}function r(){var t=e.subForm;return Object.keys(t).reduce((function(e,n){var r=t[n];return r?(Array.isArray(r)?e.push.apply(e,B(r)):e.push(r),e):e}),[])}var i={get config(){return e.options},set config(t){e.fc.options.value=t},get options(){return e.options},set options(t){e.fc.options.value=t},get form(){return e.form},get rule(){return e.rules},get parent(){return e.vm.parent&&e.vm.parent.setupState.fapi},get children(){return r()},formData:function(n){return t(n).reduce((function(t,n){var r=e.getFieldCtx(n);return r?(t[r.field]=ft(r.rule.value),t):t}),{})},getValue:function(t){var n=e.getFieldCtx(t);if(n)return ft(n.rule.value)},coverValue:function(t){var n=V({},t||{});e.deferSyncValue((function(){i.fields().forEach((function(r){var i=e.fieldCtx[r];if(i){var o=ce(t,r);i.forEach((function(e){e.rule.value=o?t[r]:void 0})),delete n[r]}})),we(e.appendData,n)}))},setValue:function(t){var n=t;arguments.length>=2&&(n=j({},t,arguments[1])),e.deferSyncValue((function(){Object.keys(n).forEach((function(t){var r=e.fieldCtx[t];if(!r)return e.appendData[t]=n[t];r.forEach((function(e){e.rule.value=n[t]}))}))}))},removeField:function(t){var n=e.getCtx(t);return e.deferSyncValue((function(){e.getCtxs(t).forEach((function(e){e.rm()}))}),!0),n?n.origin:void 0},removeRule:function(e){var t=e&&tt(e);if(t)return t.rm(),t.origin},fields:function(){return e.fields()},append:function(t,n,r){var i,o=e.sort.length-1,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return;o=a.rule.children.length-1}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o+1,0,t)},prepend:function(t,n,r){var i,o=0,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o,0,t)},hidden:function(t,r){n(r,"hidden",!!t),e.refresh()},hiddenStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.hidden},display:function(t,r){n(r,"display",!!t),e.refresh()},displayStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.display},disabled:function(n,r){t(r).forEach((function(t){e.getCtxs(t).forEach((function(e){ge(e.rule.props,"disabled",!!n)}))})),e.refresh()},all:function(t){return Object.keys(e.ctxs).map((function(n){var r=e.ctxs[n];return t?r.origin:r.rule}))},model:function(t){return e.fields().reduce((function(n,r){var i=e.fieldCtx[r][0];return n[r]=t?i.origin:i.rule,n}),{})},component:function(t){return Object.keys(e.nameCtx).reduce((function(n,r){var i=e.nameCtx[r].map((function(e){return t?e.origin:e.rule}));return n[r]=1===i.length?i[0]:i,n}),{})},bind:function(){return i.form},reload:function(t){e.reloadRule(t)},updateOptions:function(t){e.fc.updateOptions(t),i.refresh()},onSubmit:function(e){i.updateOptions({onSubmit:e})},sync:function(t){if(Array.isArray(t))t.forEach((function(e){return i.sync(e)}));else{var n=ue.Object(t)?tt(t):e.getCtxs(t);n&&((n=Array.isArray(n)?n:[n]).forEach((function(t){if(!t.deleted){var n=e.subForm[t.id];n&&(Array.isArray(n)?n.forEach((function(e){e.refresh()})):n&&n.refresh()),e.$render.clearCache(t)}})),e.refresh())}},refresh:function(){r().forEach((function(e){e.refresh()})),e.$render.clearCacheAll(),e.refresh()},refreshOptions:function(){e.$manager.updateOptions(e.options),i.refresh()},hideForm:function(t){e.vm.setupState.isShow=!t},changeStatus:function(){return e.changeStatus},clearChangeStatus:function(){e.changeStatus=!1},updateRule:function(t,n){e.getCtxs(t).forEach((function(e){we(e.rule,n)}))},updateRules:function(e){Object.keys(e).forEach((function(t){i.updateRule(t,e[t])}))},mergeRule:function(t,n){e.getCtxs(t).forEach((function(e){Qe(e.rule,n)}))},mergeRules:function(e){Object.keys(e).forEach((function(t){i.mergeRule(t,e[t])}))},getRule:function(t,n){var r=e.getCtx(t);if(r)return n?r.origin:r.rule},setEffect:function(t,n,r){var i=e.getCtx(t);i&&n&&("$"===n[0]&&(n=n.substr(1)),ce(i.rule,"$"+n)&&ge(i.rule,"$"+n,r),ce(i.rule,"effect")||(i.rule.effect={}),ge(i.rule.effect,n,r))},clearEffectData:function(t,n){var r=e.getCtx(t);r&&(n&&"$"===n[0]&&(n=n.substr(1)),r.clearEffectData(n),i.sync(t))},updateValidate:function(e,t,r){r?i.mergeRule(e,{validate:t}):n(e,"validate",t)},updateValidates:function(e,t){Object.keys(e).forEach((function(n){i.updateValidate(n,e[n],t)}))},refreshValidate:function(){i.refresh()},resetFields:function(n){t(n).forEach((function(t){e.getCtxs(t).forEach((function(t){e.$render.clearCache(t),t.rule.value=ft(t.defaultValue)}))}))},method:function(e,t){var n=i.el(e);if(!n||!n[t])throw new Error(Ne("err","".concat(t,"方法不存在")));return function(){return n[t].apply(n,arguments)}},exec:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return nt((function(){return i.method(e,t).apply(void 0,r)}))},toJson:function(e){return Ye(i.rule,e)},trigger:function(e,t){for(var n=i.el(e),r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];n&&n.$emit.apply(n,[t].concat(o))},el:function(t){var n=e.getCtx(t);if(n)return n.el||e.vm.refs[n.ref]},closeModal:function(t){e.bus.$emit("fc:closeModal:"+t)},getSubForm:function(t){var n=e.getCtx(t);return n?e.subForm[n.id]:void 0},nextTick:function(t){e.bus.$once("next-tick",t),e.refresh()},nextRefresh:function(t){e.nextRefresh(),t&&nt(t)},deferSyncValue:function(t,n){e.deferSyncValue(t,n)},emit:function(t){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=e.vm).emit.apply(n,[t].concat(i))},helper:{tidyFields:t,props:n}};return["on","once","off","set"].forEach((function(t){i[t]=function(){var n;(n=e.bus)["$".concat(t)].apply(n,arguments)}})),i.changeValue=i.changeField=i.setValue,i}(this),this)}function Et(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function jt(e){if("undefined"!=typeof XMLHttpRequest){var t,n=new XMLHttpRequest,r=e.action;n.onerror=function(t){e.onError(t)},n.onload=function(){if(n.status<200||n.status>=300)return e.onError(function(e,t,n){var r="fail to ".concat(e," ").concat(n.status,"'"),i=new Error(r);return i.status=n.status,i.url=e,i}(r,0,n),Et(n));e.onSuccess(Et(n))},n.open(e.method||"get",r,!0),e.data&&("json"!==(e.dataType||"").toLowerCase()?(t=new FormData,Object.keys(e.data).map((function(n){t.append(n,e.data[n])}))):(t=JSON.stringify(e.data),n.setRequestHeader("content-type","application/json"))),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var i=e.headers||{};Object.keys(i).forEach((function(e){null!==i[e]&&n.setRequestHeader(e,i[e])})),n.send(t)}}we(Ft.prototype,{initData:function(e){we(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:e})},init:function(){this.appendData=V(V(V({},this.options.formData||{}),this.fc.vm.props.modelValue||{}),this.appendData),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init()},isBreakWatch:function(){return this.loading||this.noWatchFn||this.reloading}}),function(e){we(e.prototype,{parseInjectEvent:function(e,t){var n=e.inject||this.options.injectEvent;return this.parseEventLst(e,t,n)},parseEventLst:function(e,t,n,r){var i=this;return Object.keys(t).forEach((function(o){var a=i.parseEvent(e,t[o],n,r);a&&(t[o]=a)})),t},parseEvent:function(e,t,n,r){if(ue.Function(t)&&(!1!==n&&!ue.Undef(n)||t.__inject))return this.inject(e,t,n);if(!r&&Array.isArray(t)&&t[0]&&(ue.String(t[0])||ue.Function(t[0])))return this.parseEventLst(e,t,n,!0);if(ue.String(t)){var i=We(t);if(i&&t!==i)return i.__inject?this.parseEvent(e,i,n,!0):i}},parseEmit:function(e){var t=this,n={},r=e.rule,i=r.emitPrefix,o=r.field,a=r.name,u=r.inject,c=r.emit||[];if(ue.trueArray(c)){var l=i||o||a;l&&c.forEach((function(e){if(e){var i;ue.Object(e)&&(i=e.inject,e=e.name);var o=Ue("".concat(l,"-").concat(e)),a=function(){for(var e,n,r,i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];(e=t.vm).emit.apply(e,[o].concat(a)),(n=t.vm).emit.apply(n,["emit-event",o].concat(a)),(r=t.bus).$emit.apply(r,[o].concat(a))};if(a.__emit=!0,i||!1!==u){var c=i||u||t.options.injectEvent;n[e]=ue.Undef(c)?a:t.inject(r,a,c)}else n[e]=a}}))}return e.computed.on=n,n},getInjectData:function(e,t){var n=this.vm.props,r=n.option,i=n.rule;return{$f:this.api,api:this.api,rule:i,self:e.__origin__,option:r,inject:t}},inject:function(e,t,n){if(t.__origin){if(this.watching&&!this.loading)return t;t=t.__origin}var r=this,i=function(){for(var i=r.getInjectData(e,n),o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return i.args=[].concat(a),a.unshift(i),t.apply(this,a)};return i.__origin=t,i.__json=t.__json,i}})}(Ft),function(e){we(e.prototype,{usePage:function(){var e=this,t=this.options.page;if(t){var n,r=25,i=(n=this.rules).length<31?31:Math.ceil(n.length/3);ue.Object(t)&&(t.first&&(r=parseInt(t.first,10)||r),t.limit&&(i=parseInt(t.limit,10)||i)),we(this,{first:r,limit:i,pageEnd:this.rules.length<=r}),this.bus.$on("page-end",(function(){return e.vm.emit("page-end",e.api)})),this.pageLoad()}},pageLoad:function(){var e=this;this.bus.$on(xt,(function t(){e.pageEnd?(e.bus.$off(xt,t),e.bus.$emit("page-end")):(e.first+=e.limit,e.pageEnd=e.rules.length<=e.first,e.loadRule(),e.refresh())}))}})}(Ft),function(e){we(e.prototype,{clearNextTick:function(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick:function(e){var t=this;this.clearNextTick(),this.nextTick=setTimeout((function(){e(),t.nextTick=null}),10)},render:function(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}(Ft),function(e){we(e.prototype,{nextRefresh:function(e){var t=this,n=this.loadedId;l((function(){n===t.loadedId&&(e?e():t.refresh())}))},parseRule:function(e){var t=this,n=Ze(e);return Object.defineProperties(n,{__origin__:Ke(e,!0)}),function(e){var t={props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0};Object.keys(t).forEach((function(n){ce(e,n)||(e[n]=t[n])}))}(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach((function(e){e&&t.loadFn(e,n)})),this.loadCtrl(n),n.update&&(n.update=We(n.update)),n},loadFn:function(e,t){var n=this;["on","props","deep"].forEach((function(r){e[r]&&n.parseInjectEvent(t,e[r])}))},loadCtrl:function(e){e.control&&e.control.forEach((function(e){e.handle&&(e.handle=We(e.handle))}))},syncProp:function(e){var t=this,n=e.rule;ue.trueArray(n.sync)&&Pe([{on:n.sync.reduce((function(e,r){return e["update:".concat(r)]=function(e){n.props[r]=e,t.vm.emit("sync",r,e,n,t.fapi)},e}),{})}],e.computed)},loadRule:function(){var e=this;this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue((function(){if(e._loadRule(e.rules),e.loading=!1,e.cycleLoad&&e.pageEnd)return e.loadRule();e.syncForm(),e.pageEnd&&e.bus.$emit("load-end"),e.vm.setupState.renderRule()}))},loadChildren:function(e,t){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,t),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(t)},_loadRule:function(e,t){var n=this,r=function t(r){var i=e[r-1];if(!i||!i.__fc__)return r>0?t(r-1):-1;var o=n.sort.indexOf(i.__fc__.id);return o>-1?o:t(r-1)},i=function(e,t){ue.trueArray(e)&&n._loadRule(e,t)};e.map((function(o,a){if((!t||ue.Object(o))&&(n.pageEnd||t||!(a>=n.first))){if(o.__fc__&&o.__fc__.root===e&&n.ctxs[o.__fc__.id])return i(o.__fc__.loadChildrenPending(),o.__fc__),o.__fc__;var u,c=Ze(o),l=function(){return!(!c.field||!n.fieldCtx[c.field]||n.fieldCtx[c.field][0]===o.__fc__)};n.ruleEffect(c,"init",{repeat:l()}),l()&&n.vm.emit("repeat-field",o,n.api);var s=!1,f=!!o.__fc__,d=c.value;if(f){d=(u=o.__fc__).defaultValue;var p=!u.check(n);if(u.deleted){if(p){if($t(u))return;u.update(n)}}else if(p){if($t(u))return;e[a]=o=o._clone?o._clone():Ge(o),u=null,s=!0}}if(u)u.originType!==u.rule.type&&(u.updateType(),n.bindParser(u)),n.appendValue(u.rule);else{var h=n.parseRule(o);u=new _t(n,h,f?d:h.value),n.bindParser(u)}n.parseEmit(u),n.syncProp(u),u.parent=t||null,u.root=e,n.setCtx(u),!s&&!f&&n.effect(u,"load"),n.effect(u,"created");var m=u.loadChildrenPending();if(!1===u.parser.loadChildren||i(m,u),!t){var v=r(a);v>-1||!a?n.sort.splice(v+1,0,u.id):n.sort.push(u.id)}var g=u.rule;return u.updated||(u.updated=!0,ue.Function(g.update)&&n.bus.$once("load-end",(function(){n.refreshUpdate(u,g.value,"init")})),n.effect(u,"loaded")),n.refreshControl(u)&&(n.cycleLoad=!0),u}}))},refreshControl:function(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl:function(e){var t=this,n=function(e){var t=e.rule.control||[];return ue.Object(t)?[t]:t}(e),r=[],i=this.api;if(!n.length)return!1;for(var o=function(t){var o=n[t],a=o.handle||(wt[o.condition||"=="]||wt["=="])(o.value);if(!ue.trueArray(o.rule))return"continue";var u=V(V({},o),{},{valid:nt((function(){return a(e.rule.value,i)})),ctrl:kt(e,o.rule),isHidden:ue.String(o.rule[0])});if(u.valid&&u.ctrl||!u.valid&&!u.ctrl&&!u.isHidden)return"continue";r.push(u)},a=0;a<n.length;a++)o(a);if(!r.length)return!1;var u=[],c=!1;return this.deferSyncValue((function(){r.reverse().forEach((function(n){var r=n.isHidden,o=n.valid,a=n.rule,l=n.prepend,s=n.append,f=n.child,d=n.ctrl,p=n.method;if(r)return o?e.ctrlRule.push({__ctrl:!0,children:a,valid:o}):e.ctrlRule.splice(e.ctrlRule.indexOf(d),1),void u[o?"push":"unshift"]((function(){"disabled"===p?t.api.disabled(!o,a):"display"===p?t.api.display(o,a):"required"===p?(a.forEach((function(e){t.api.setEffect(e,"required",o)})),o||t.api.clearValidateState(a)):t.api.hidden(!o,a)}));if(o){c=!0;var h={type:"fragment",native:!0,__ctrl:!0,children:a};e.ctrlRule.push(h),t.bus.$once("load-start",(function(){l?i.prepend(h,l,f):s||f?i.append(h,s||e.id,f):e.root.splice(e.root.indexOf(e.origin)+1,0,h)}))}else{e.ctrlRule.splice(e.ctrlRule.indexOf(d),1);var m=tt(d);m&&m.rm()}}))})),u.length&&l((function(){u.forEach((function(e){return e()}))})),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),c},reloadRule:function(e){return this._reloadRule(e)},_reloadRule:function(e){var t=this;e||(e=this.rules);var n=V({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue((function(){t.bus.$once("load-end",(function(){Object.keys(n).filter((function(e){return void 0===t.ctxs[e]})).forEach((function(e){return t.rmCtx(n[e])})),t.$render.clearCacheAll()})),t.reloading=!0,t.loadRule(),t.reloading=!1,t.refresh(),t.bus.$emit("reloading",t.api)})),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh:function(){this.vm.setupState.refresh()}})}(Ft),function(e){we(e.prototype,{setValue:function(e,t,n,r){e.deleted||(e.rule.value=t,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,n),this.syncValue(),this.valueChange(e,t),this.vm.emit("change",e.field,t,e.origin,this.api,r||!1),this.effect(e,"value"))},onInput:function(e,t){var n;e.input&&(this.isQuote(e,n=e.parser.toValue(t,e))||this.isChange(e,t))&&this.setValue(e,n,t)},setFormData:function(e,t){ge(this.formData,e.id,t)},getFormData:function(e){return this.formData[e.id]},syncForm:function(){var e=this,n=p({});this.fields().reduce((function(n,r){var i=e.getCtx(r);return n[r]=t(i.rule,"value"),n}),n),this.form=n,this.syncValue()},appendValue:function(e){e.field&&ce(this.appendData,e.field)&&(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm:function(e,t){this.subForm[e.id]=t},deferSyncValue:function(e,t){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=t),nt(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncValue())},syncValue:function(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;this.vm.setupState.updateValue(V({},this.form))},isChange:function(e,t){return JSON.stringify(this.getFormData(e),Ct)!==JSON.stringify(t,Ct)},isQuote:function(e,t){return(ue.Object(t)||Array.isArray(t))&&t===e.rule.value},refreshUpdate:function(e,t,n){var r=this;if(ue.Function(e.rule.update)){var i=nt((function(){return e.rule.update(t,e.origin,r.api,{origin:n||"change"})}));if(void 0===i)return;e.rule.hidden=!0===i}},valueChange:function(e,t){this.refreshRule(e,t),this.bus.$emit("change-"+e.field,t)},refreshRule:function(e,t,n){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,t,n)},appendLink:function(e){var t=this,n=e.rule.link;ue.trueArray(n)&&n.forEach((function(n){var r=function(){return t.refreshRule(e,e.rule.value,"link")};t.bus.$on("change-"+n,r),e.linkOn.push((function(){return t.bus.$off("change-"+n,r)}))}))},fields:function(){return Object.keys(this.fieldCtx)}})}(Ft),function(e){we(e.prototype,{getCtx:function(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs:function(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx:function(e,t,n){var r="".concat(n,"Ctx");this[r][t]?this[r][t].push(e):this[r][t]=[e]},rmIdCtx:function(e,t,n){var r="".concat(n,"Ctx"),i=this[r][t];if(!i)return!1;var o=i.splice(i.indexOf(e)>>>0,1).length>0;return i.length||delete this[r][t],o},getFieldCtx:function(e){return(this.fieldCtx[e]||[])[0]},getNameCtx:function(e){return this.nameCtx[e]||[]},setCtx:function(e){var t=e.id,n=e.field,r=e.name,i=e.rule;this.ctxs[t]=e,r&&this.setIdCtx(e,r,"name"),e.input&&(this.setIdCtx(e,n,"field"),this.setFormData(e,e.parser.toFormValue(i.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,i.value,e.origin,this.api))},getParser:function(e){var t=this.fc.parsers;return t[e.originType]||t[dt(e.type)]||t[e.trueType]||Ot},bindParser:function(e){e.setParser(this.getParser(e))},getType:function(e){var t=this.fc.CreateNode.aliasMap,n=t[e]||t[dt(e)]||e;return dt(n)},noWatch:function(e){this.noWatchFn||(this.noWatchFn=e),nt(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx:function(e){var n=this;if(Me().filter((function(e){return"_"!==e[0]&&"$"!==e[0]&&-1===Vt.indexOf(e)})).forEach((function(r){var i=t(e.rule,r),o="children"===r;e.refRule[r]=i,e.watch.push(d(o?function(){return ue.Function(i.value)?i.value:B(i.value||[])}:function(){return i.value},(function(t,a){var u=i.value;if(!n.isBreakWatch()){if(o&&!1===e.parser.loadChildren)return n.$render.clearCache(e),void n.nextRefresh();n.watching=!0,"link"!==r?(["props","on","deep"].indexOf(r)>-1?(n.parseInjectEvent(e.rule,u||{}),"props"===r&&e.input&&n.setFormData(e,e.parser.toFormValue(e.rule.value,e))):"emit"===r?n.parseEmit(e):["prefix","suffix"].indexOf(r)>-1?u&&n.loadFn(u,e.rule):"type"===r?(e.updateType(),n.bindParser(e)):o&&(ue.Function(a)&&(a=e.getPending("children",[])),ue.Function(u)&&(u=e.loadChildrenPending()),n.updateChildren(e,u,a)),n.$render.clearCache(e),n.refresh(),n.watching=!1):e.link()}}),{deep:!o,sync:o}))})),e.input){var r=t(e.rule,"value");e.watch.push(d((function(){return r.value}),(function(){var t=e.parser.toFormValue(r.value,e);n.isChange(e,t)&&n.setValue(e,r.value,t,!0)}))),this.bus.$once("load-end",(function(){var i=t(e.rule,"computed");e.watch.push(d((function(){var e=i.value;if(e)return nt(ue.Function(e)?function(){return e(n.api.form,n.api)}:function(){return new Function("_","with(this){ return ".concat(e," }")).call(n.api.form,St)},void 0)}),(function(e){r.value=e}),{immediate:!!i.value}))}))}this.watchEffect(e)},updateChildren:function(e,t,n){var r=this;this.deferSyncValue((function(){n&&n.forEach((function(i){-1===(t||[]).indexOf(i)&&i&&!ue.String(i)&&i.__fc__&&i.__fc__.parent===e&&i.__fc__.root===n&&r.rmCtx(i.__fc__)})),ue.trueArray(t)&&(r.loadChildren(t,e),r.bus.$emit("update",r.api))}))},rmSub:function(e){var t=this;ue.trueArray(e)&&e.forEach((function(e){e&&e.__fc__&&t.rmCtx(e.__fc__)}))},rmCtx:function(e){var t=this;if(!e.deleted){var n=e.id,r=e.field,i=e.input,o=e.name;ye(this.ctxs,n),ye(this.formData,n),ye(this.subForm,n),ye(this.vm.setupState.ctxInject,n),i&&this.rmIdCtx(e,r,"field"),o&&this.rmIdCtx(e,o,"name"),i&&!ce(this.fieldCtx,r)&&ye(this.form,r),this.deferSyncValue((function(){if(!t.reloading){if(!1!==e.parser.loadChildren){var n=e.getPending("children",e.rule.children);ue.trueArray(n)&&n.forEach((function(e){return e.__fc__&&t.rmCtx(e.__fc__)}))}e.root===t.rules&&t.vm.setupState.renderRule()}}),i);var a=this.sort.indexOf(n);return a>-1&&this.sort.splice(a,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),i&&!this.fieldCtx[r]&&this.vm.emit("remove-field",r,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}}})}(Ft),function(e){we(e.prototype,{mounted:function(){var e=this,t=function(){e.isMounted=!0,e.lifecycle("mounted")};this.pageEnd?t():this.bus.$once("page-end",t)},lifecycle:function(e){var t=this,n=this.options[e];ue.Function(n)&&nt((function(){return n(t.api)})),this.vm.emit(e,this.api)}})}(Ft),function(e){we(e.prototype,{useProvider:function(){var e=this,t=this.fc.providers;Object.keys(t).forEach((function(n){var r=t[n];ue.Function(r)&&(r=r(e.fc)),r._c=function(e){var t=e.components;if(Array.isArray(t)){var n=function(e){return e.filter((function(e,t,n){return n.indexOf(e,0)===t}))}(t.filter((function(e){return"*"!==e})));return!!n.length&&n}return!!ue.String(t)&&[t]}(r),e.onEffect(r),e.providers[n]=r}))},onEffect:function(e){var t=this,n=[];(e._c||["*"]).forEach((function(r){var i="*"===r?"*":t.getType(r);n.indexOf(i)>-1||(n.push(i),t.bus.$on("p:".concat(e.name,":").concat(i,":").concat(e.input?1:0),(function(t,n){e[t]&&e[t].apply(e,B(n))})))})),e._used=n},watchEffect:function(e){var t=this,n={required:function(){var t,n;return(ce(e.rule,"$required")?e.rule.$required:null===(t=e.rule)||void 0===t||null===(n=t.effect)||void 0===n?void 0:n.required)||!1}};Object.keys(e.rule.effect||{}).forEach((function(t){n[t]=function(){return e.rule.effect[t]}})),Object.keys(e.rule).forEach((function(t){"$"===t[0]&&(n[t.substr(1)]=function(){return e.rule[t]})})),Object.keys(n).forEach((function(r){e.watch.push(d(n[r],(function(n){t.effect(e,"watch",j({},r,n))}),{deep:!0}))}))},ruleEffect:function(e,t,n){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},t,n)},effect:function(e,t,n){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:n},t)},getEffect:function(e,t){return ce(e,"$"+t)?e["$"+t]:ce(e,"effect")&&ce(e.effect,t)?e.effect[t]:void 0},emitEffect:function(e,t,n){var r=this,i=e.ctx,o=e.rule,a=e.input,u=e.type,c=e.custom;if(u&&!(["fcFragment","fragment"].indexOf(u)>-1)){var l=c||Object.keys(o).reduce((function(e,t){return"$"===t[0]&&(e[t.substr(1)]=o[t]),e}),V({},o.effect||{}));Object.keys(l).forEach((function(e){var c=r.providers[e];if(c&&(!c.input||a)){var s;if(c._c){if(!(c._used.indexOf(u)>-1))return;s=u}else s="*";var f=V({value:l[e],getValue:function(){return r.getEffect(o,e)}},n||{});i&&(f.getProp=function(){return i.effectData(e)},f.clearProp=function(){return i.clearEffectData(e)},f.mergeProp=function(e){return Qe(f.getProp(),[e])},f.id=i.id),r.bus.$emit("p:".concat(e,":").concat(s,":").concat(c.input?1:0),t,[f,o,r.api])}}))}}})}(Ft);var Rt=e({name:"fcFragment",inheritAttrs:!1,props:["vnode"],render:function(){return this.vnode}});function At(e,t){var n=e.directives;return n?(Array.isArray(n)||(n=[n]),w(t,n.reduce((function(e,t){return e.concat(function(e){return Object.keys(e).map((function(t){var n=e[t],r=k(t);if(r)return[r,n.value,n.arg,n.modifiers]})).filter((function(e){return!!e}))}(t))}),[]))):t}function Pt(e){var t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(n,It);var t=I(n);function n(){return E(this,n),t.apply(this,arguments)}return n}();return Object.assign(t.prototype,e),t}function It(e){we(this,{$handle:e,vm:e.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}we(It.prototype,{__init:function(){var e=this;this.$render=this.$handle.$render,this.$r=function(){var t;return(t=e.$render).renderRule.apply(t,arguments)}},updateKey:function(){this.key=vt()},init:function(){},update:function(){},beforeRender:function(){},form:function(){return this.vm.refs[this.ref]},mergeOptions:function(e,t){var n=this;return Pe(e.map((function(e){return n.tidyOptions(e)})),t,this.mergeOptionsRule)},updateOptions:function(e){this.options=this.mergeOptions([e],this.getDefaultOptions()),this.update()},tidyOptions:function(e){return e},tidyRule:function(e){},mergeProp:function(e){},getDefaultOptions:function(){return{}},render:function(e){}});var Bt={name:"componentValidate",load:function(e,t,n){var r=e.getValue();r?e.getProp().validate=[{validator:function(){var i=tt(t);if(i){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return n.exec.apply(n,[i.id,!0===r?"formCreateValidate":r].concat(a,[{attr:e,rule:t,api:n}]))}}}]:(e.clearProp(),n.clearValidateState([t.field]))},watch:function(){Bt.load.apply(Bt,arguments)}},Dt={fetch:function(e){function t(t,n,r){var i=t.value,o=function(e){void 0===e?(t.clearProp(),r.sync(n)):gt(t.getProp(),i.to||"options",e)};if(ue.Function(i)&&(i=i(n,r)),(i=function(e){return ue.String(e)&&(e={action:e,to:"options"}),e}(i))&&i.action){i.to||(i.to="options");var a=i.onError,u=function(){if(!t.getValue())return t.clearProp(),r.sync(n),!0},c=V(V({headers:{}},i),{},{onSuccess:function(e,t){if(!u()){var a=function(e){return t?e:e.data};ue.Function(i.parse)?a=i.parse:i.parse&&ue.String(i.parse)&&(a=function(e){return i.parse.split(".").forEach((function(t){e&&(e=e[t])})),e}),o(a(e,n,r)),r.sync(n)}},onError:function(e){o(void 0),u()||(a||function(e){return Le(e.message||"fetch fail "+i.action)})(e,n,r)}});e.options.beforeFetch&&nt((function(){return e.options.beforeFetch(c,{rule:n,api:r})})),ue.Function(i.action)?i.action(n,r).then((function(e){c.onSuccess(e,!0)})).catch((function(e){c.onError(e)})):nt((function(){return e.create.fetch(c,{inject:t,rule:n,api:r})}))}else o(void 0)}return{name:"fetch",loaded:function(){t.apply(void 0,arguments)},watch:function(){t.apply(void 0,arguments)}}},loadData:function(e){var t={name:"loadData",_fn:[],created:function(t,n,r){this.deleted(t);var i=N(t.getValue()),o=[];i.forEach((function(i){if(i){var a=function o(){!1!==i.watch&&(e.bus.$off("p.loadData."+i.attr,o),e.bus.$once("p.loadData."+i.attr,o));var a=void 0;i.attr&&(a=e.loadData[i.attr]||i.default,i.copy&&(a=xe(a))),gt(t.getProp(),i.to||"options",a),r.sync(n)};o.push((function(){return e.bus.$off("p.loadData."+i.attr,a)})),a()}})),this._fn[t.id]=o},deleted:function(e){this._fn[e.id]&&this._fn[e.id].forEach((function(e){e()})),e.clearProp()}};return t.watch=t.created,t},componentValidate:Bt},Tt={name:"html",loadChildren:!1,render:function(e,t){return t.prop.props.innerHTML=e.default(),t.vNode.make(t.prop.props.tag||"div",t.prop)},renderChildren:function(e){return{default:function(){return e.filter((function(e){return ue.String(e)})).join("")}}}};function Mt(e,t){var n;return 2===arguments.length?t=(n=arguments[1])[e]:n=arguments[2],{id:t,prop:n}}function Nt(){return Mt.apply(void 0,["name"].concat(Array.prototype.slice.call(arguments)))}var Lt=1,Ut={};function Ht(e){var t,i=j({},Rt.name,Rt),o={},a={},u={},c=[],s=V({},Dt),f=st(),m={global:{}},v={},g=function(){var e={};function t(){}return we(t.prototype,{make:function(e,t,n){return At(t,this.h(e,it(t),n))},makeComponent:function(e,t,n){try{return At(t,r(e,it(t),n))}catch(e){return console.error(e),r("")}},h:function(e,t,i){var o=h().appContext.config.isNativeTag(e);o&&delete t.formCreateInject;try{return r(o?e:n(e),t,i)}catch(e){return console.error(e),r("")}},aliasMap:e}),we(t,{aliasMap:e,alias:function(t,n){e[t]=n},use:function(e){Object.keys(e).forEach((function(n){var r=Ue(n),i=ht(n).toLocaleLowerCase(),o=e[n];[n,r,i].forEach((function(e){t.alias(n,o),t.prototype[e]=function(e,t){return this.make(o,e,t)}}))}))}}),t}();function y(e){var t=Ut[e];return Array.isArray(t)?t.map((function(e){return e.api()})):t?t.api():void 0}function b(e){c.push(e)}function x(){var e=Nt.apply(void 0,arguments);e.id&&e.prop&&(a[e.id]=e.prop)}function _(){var e=Nt.apply(void 0,arguments);e.id&&e.prop&&(s[e.id]=V(V({},e.prop),{},{name:e.id}))}function w(e){g.use(e)}function k(){var e=Nt.apply(void 0,arguments);if(e.id&&e.prop){var t=dt(e.id),n=e.prop,r=!0===n.merge?o[t]:void 0;o[t]=V(V({},r||Ot),n),f[t]=ot(t),n.maker&&we(f,n.maker)}}function S(e,t){var n;if(ue.String(e)){if(n=e,void 0===t)return i[n]}else n=e.displayName||e.name,t=e;n&&t&&(i[n]=t,i[dt(n)]=t,t.formCreateParser&&k(n,t.formCreateParser))}function F(){return Ee(N,i,a)}function E(){return Rt}function R(e,t){return ue.Function(e.install)?e.install(A,t):ue.Function(e)&&e(A,t),this}function A(e,t){var n=function(e,t){var n=F();return $({data:function(){return p({rule:e,option:t})},render:function(){return C(n,V({ref:"fc"},this.$data))}})}(e,t||{});c.forEach((function(e){nt((function(){return e(A,n)}))}));var r=document.createElement("div");return((null==t?void 0:t.el)||document.body).appendChild(r),n.mount(r).$refs.fc.fapi}function P(t){var n=V({},e);return t?n.inherit={components:i,parsers:o,directives:a,modelFields:u,providers:s,useApps:c,maker:f,loadData:v}:delete n.inherit,Ht(n)}function I(e,t){u[e]=t}function D(e){Object.keys(Ut).forEach((function(t){(Array.isArray(Ut[t])?Ut[t]:[Ut[t]]).forEach((function(t){t.bus.$emit("p.loadData."+e)}))}))}function T(e,t){v[e]=t,D(e)}function M(e){delete v[e],D(e)}function N(t){var n=this;we(this,{id:Lt++,create:A,vm:t,manager:Pt(e.manager),parsers:o,providers:s,modelFields:u,rules:t.props.rule,name:t.props.name||vt(),inFor:t.props.inFor,prop:{components:i,directives:a},loadData:v,CreateNode:g,bus:new L,unwatch:null,options:O(t.props.option||{}),extendApi:e.extendApi||function(e){return e}}),l((function(){d(n.options,(function(){n.$handle.$manager.updateOptions(n.options.value),n.api().refresh()}),{deep:!0})})),we(t.appContext.components,i),we(t.appContext.directives,a),this.$handle=new Ft(this),this.name&&(this.inFor?(Ut[this.name]||(Ut[this.name]=[]),Ut[this.name].push(this)):Ut[this.name]=this)}function U(t){we(t,{version:e.version,ui:e.ui,setData:T,removeData:M,maker:f,component:S,directive:x,setModelField:I,register:_,$vnode:E,parser:k,use:R,factory:P,componentAlias:w,copyRule:Ge,copyRules:Xe,fetch:jt,$form:F,parseFn:We,parseJson:Je,toJson:Ye,useApp:b,getApi:y})}if(function(e){var t=e.key||[],n=e.array||[],r=e.normal||[];Be.push.apply(Be,B(t)),De.push.apply(De,B(n)),Te.push.apply(Te,B(r)),ut([].concat(B(t),B(n),B(r)))}(e.attrs||{}),we(N.prototype,{init:function(){var e=this;this.isSub()&&(this.unwatch=d((function(){return e.vm.parent.option}),(function(){e.initOptions(e.options.value),e.$handle.api.refresh()}),{deep:!0})),this.initOptions(this.options.value),this.$handle.init()},isSub:function(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions:function(e){this.options.value=V({formData:{},submitBtn:{},resetBtn:{}},xe(m)),this.isSub()&&(this.options.value=this.mergeOptions(this.options.value,this.vm.setupState.parent.setupState.fapi.config||{},!0)),this.updateOptions(e)},mergeOptions:function(e,t,n){return t=xe(t),n&&["page","onSubmit","mounted","reload","formData","el"].forEach((function(e){delete t[e]})),t.global&&(e.global=function(e,t){return e?(Object.keys(t||{}).forEach((function(n){t[n]&&(e[n]=Qe(e[n]||{},t[n]))})),e):t}(e.global,t.global),delete t.global),this.$handle.$manager.mergeOptions([t],e),e},updateOptions:function(e){this.options.value=this.mergeOptions(this.options.value,e),this.$handle.$manager.updateOptions(this.options.value)},api:function(){return this.$handle.api},render:function(){return this.$handle.render()},mounted:function(){this.$handle.mounted()},unmount:function(){if(this.name)if(this.inFor){var e=Ut[this.name].indexOf(this);Ut[this.name].splice(e,1)}else delete Ut[this.name];this.unwatch&&this.unwatch(),this.$handle.reloadRule([])},updated:function(){var e=this;this.$handle.bindNextTick((function(){return e.bus.$emit("next-tick",e.$handle.api)}))}}),U(A),we(t=A,{create:A,install:function(e,n){if(m=V(V({},m),n||{}),!0!==e._installedFormCreate){e._installedFormCreate=!0;var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(e,t)};U(r),e.config.globalProperties.$formCreate=r,e.component("FormCreate",F()),c.forEach((function(n){nt((function(){return n(t,e)}))}))}}}),g.use({fragment:"fcFragment"}),e.install&&A.use(e),b((function(e,t){t.mixin({props:["formCreateInject"]})})),k(Tt),e.inherit){var H=e.inherit;H.components&&we(i,H.components),H.parsers&&we(o,H.parsers),H.directives&&we(a,H.directives),H.modelFields&&we(u,H.modelFields),H.providers&&we(s,H.providers),H.useApps&&we(c,H.useApps),H.maker&&we(f,H.maker),H.loadData&&we(v,H.loadData)}return A}var zt={date:"YYYY-MM-DD",month:"YYYY-MM",datetime:"YYYY-MM-DD HH:mm:ss",timerange:"HH:mm:ss",daterange:"YYYY-MM-DD",monthrange:"YYYY-MM",datetimerange:"YYYY-MM-DD HH:mm:ss",year:"YYYY"},Yt={name:"datePicker",maker:["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((function(e,t){return e[t]=ot("datePicker",{type:t.toLowerCase()}),e}),{}),mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat=zt[t.type]||zt.date)}},qt={name:"hidden",maker:j({},"hidden",(function(e,t){return ot("hidden")("",e,t)})),render:function(){return[]}},Wt={name:"input",maker:function(){var e=["password","url","email","text","textarea"].reduce((function(e,t){return e[t]=ot("input",{type:t}),e}),{});return e.idate=ot("input",{type:"date"}),e}(),mergeProp:function(e){var t=e.prop.props;t&&t.autosize&&t.autosize.minRows&&(t.rows=t.autosize.minRows||2)}},Jt=[Yt,qt,Wt,{name:"slider",maker:{sliderRange:ot("slider",{range:!0})},toFormValue:function(e,t){var n=Array.isArray(e),r=t.prop.props,i=r.min||0;return!0===r.range?n?e:[i,parseFloat(e)||i]:n?parseFloat(e[0])||i:parseFloat(e)}},{name:"timePicker",maker:{time:ot("timePicker",(function(e){return e.props.isRange=!1})),timeRange:ot("timePicker",(function(e){return e.props.isRange=!0}))},mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")}},{name:"FcRow",render:function(e,t){return t.vNode.col({props:{span:24}},{default:function(){return[t.vNode.row(t.prop,e)]}})}},{name:"select",toFormValue:function(e,t){return t.prop.props.multiple&&!Array.isArray(e)?N(e):e}}],Kt={button:"el-button",icon:"el-icon",slider:"el-slider",rate:"el-rate",upload:"fc-upload",cascader:"el-cascader",popover:"el-popover",tooltip:"el-tooltip",colorPicker:"el-colorPicker",timePicker:"el-time-picker",timeSelect:"el-time-select",datePicker:"el-date-picker",switch:"el-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:"el-input-number",number:"el-input-number",input:"el-input",formItem:"el-form-item",form:"el-form",frame:"fc-frame",col:"el-col",row:"el-row",tree:"fc-tree",autoComplete:"el-autocomplete",auto:"el-autocomplete",group:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function Gt(e,t){var n;ce(e,t)&&(ue.String(e[t])&&(e[t]=(j(n={},t,e[t]),j(n,"show",!0),n)))}function Xt(e){return!1===e}function Qt(e){var t=V({},e);return delete t.children,t}var Zt={validate:function(){var e=this.form();return e?e.validate():new Promise((function(e){return e()}))},validateField:function(e){var t=this;return new Promise((function(n,r){var i=t.form();i?i.validateField(e,(function(e){e?r(e):n(null)})):n()}))},clearValidateState:function(e){var t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},tidyOptions:function(e){return["submitBtn","resetBtn","row","info","wrap","col"].forEach((function(t){!function(e,t){ce(e,t)&&!ue.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)})),e},tidyRule:function(e){var t=e.prop;return Gt(t,"title"),Gt(t,"info"),t},mergeProp:function(e){e.prop=Pe([{info:this.options.info||{},wrap:this.options.wrap||{},col:this.options.col||{}},e.prop],{info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}},{normal:["title","info","col","wrap"]})},getDefaultOptions:function(){return{form:{inline:!1,labelPosition:"right",labelWidth:"125px",disabled:!1,size:void 0},row:{show:!0,gutter:0},submitBtn:{type:"primary",loading:!1,disabled:!1,innerText:"提交",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"重置",show:!1,col:void 0,click:void 0}}},update:function(){var e=this.options.form;this.rule={props:V({},e),on:{submit:function(e){e.preventDefault()}},class:[e.className,e.class,"form-create"],style:e.style,type:"form"}},beforeRender:function(){var e=this.key,t=this.ref,n=this.$handle;we(this.rule,{key:e,ref:t}),we(this.rule.props,{model:n.formData})},render:function(e){var t=this;return e.slotLen()&&e.setSlot(void 0,(function(){return t.makeFormBtn()})),this.$r(this.rule,Xt(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap:function(e,t){var n=this,r=e.prop,i="".concat(this.key).concat(e.key),o=r.col,a=this.isTitle(r),u=o.labelWidth||a?o.labelWidth:0,c=this.rule.props,l=c.inline,s=c.col,f=Xt(r.wrap.show)?t:this.$r(Pe([r.wrap,{props:V(V({labelWidth:void 0===u?u:ht(u),label:a?r.title.title:void 0},Qt(r.wrap||{})),{},{prop:e.id,rules:r.validate}),class:r.className,key:"".concat(i,"fi"),ref:e.wrapRef,type:"formItem"}]),V({default:function(){return t}},a?{label:function(){return n.makeInfo(r,i)}}:{}));return!0===l||Xt(s)||Xt(o.show)?f:this.makeCol(r,i,[f])},isTitle:function(e){if(!1===this.options.form.title)return!1;var t=e.title;return!(!t.title&&!t.native||Xt(t.show))},makeInfo:function(e,t){var n=this,r=V({},e.title),i=V({},e.info),o="tooltip"===i.type,a=this.options.form,u=[(r.title||"")+(a.labelSuffix||a["label-suffix"]||"")];if(!Xt(i.show)&&(i.info||i.native)&&!Xt(i.icon)){var c={type:i.type||"popover",props:Qt(i),key:"".concat(t,"pop")};delete c.props.icon,delete c.props.show,delete c.props.info,delete c.props.align,delete c.props.native;var l="content";i.info&&!ce(c.props,l)&&(c.props[l]=i.info),u["left"!==i.align?"unshift":"push"](this.$r(Pe([i,c]),j({},r.slot||(o?"default":"reference"),(function(){return n.$r({type:"ElIcon",style:"top:2px",key:"".concat(t,"i")},{default:function(){return n.$r({type:!0===i.icon?"icon-warning":i.icon})}},!0)}))))}var s=Pe([r,{props:Qt(r),key:"".concat(t,"tit"),type:r.type||"span"}]);return delete s.props.show,delete s.props.title,delete s.props.native,this.$r(s,u)},makeCol:function(e,t,n){var r=e.col;return this.$r({class:r.class,type:"col",props:r||{span:24},key:"".concat(t,"col")},n)},makeRow:function(e){var t=this.options.row||{};return this.$r({type:"row",props:t,class:t.class,key:"".concat(this.key,"row")},e)},makeFormBtn:function(){var e=[];if(Xt(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),Xt(this.options.resetBtn.show)||e.push(this.makeResetBtn()),e.length){var t=this.$r({type:"formItem",key:"".concat(this.key,"fb")},e);return!0===this.rule.props.inline?t:this.$r({type:"col",props:{span:24},key:"".concat(this.key,"fc")},[t])}},makeResetBtn:function(){var e=this,t=V({},this.options.resetBtn),n=t.innerText;return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.resetBtn.click?e.options.resetBtn.click(t):t.resetFields()}},key:"".concat(this.key,"b2")},[n])},makeSubmitBtn:function(){var e=this,t=V({},this.options.submitBtn),n=t.innerText;return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.submitBtn.click?e.options.submitBtn.click(t):t.submit().catch((function(){}))}},key:"".concat(this.key,"b1")},[n])}},en={};!function(e){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate"].forEach((function(t){e[t]=ot(t)})),e.auto=e.autoComplete,e.number=e.inputNumber,e.color=e.colorPicker}(en),function(e){var t="select",n="multiple";e.selectMultiple=ot(t,j({},n,!0)),e.selectOne=ot(t,j({},n,!1))}(en),function(e){var t={treeSelected:"selected",treeChecked:"checked"};Object.keys(t).reduce((function(e,n){return e[n]=ot("tree",{type:t[n]}),e}),e)}(en),function(e){var t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=ot("upload",(function(e){return e.props({uploadType:t[n][0],maxLength:t[n][1]})})),e}),e),e.uploadImage=e.image,e.uploadFile=e.file}(en),function(e){var t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=ot("frame",(function(e){return e.props({type:t[n][0],maxLength:t[n][1]})})),e}),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(en);function tn(e,t){return ue.Boolean(e)?e={show:e}:ue.Undef(e)||ue.Object(e)||(e={show:t}),e}function nn(e,t){return we(e,{formEl:function(){return t.$manager.form()},wrapEl:function(e){var n=t.getFieldCtx(e);if(n)return t.vm.refs[n.wrapRef]},validate:function(n){return new Promise((function(r,i){var o=e.children,a=[t.$manager.validate()];o.forEach((function(e){a.push(e.validate())})),Promise.all(a).then((function(){r(!0),n&&n(!0)})).catch((function(r){i(r),n&&n(r),t.vm.emit("validate-fail",r,{api:e})}))}))},validateField:function(n,r){return new Promise((function(i,o){var a=t.getFieldCtx(n);if(a){var u=t.subForm[a.id],c=[t.$manager.validateField(a.id)];N(u).forEach((function(e){c.push(e.validate())})),Promise.all(c).then((function(){i(null),r&&r(null)})).catch((function(i){o(i),r&&r(i),t.vm.emit("validate-field-fail",i,{field:n,api:e})}))}}))},clearValidateState:function(n){var r=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.helper.tidyFields(n).forEach((function(e){i&&r.clearSubValidateState(e),t.getCtxs(e).forEach((function(e){t.$manager.clearValidateState(e)}))}))},clearSubValidateState:function(n){e.helper.tidyFields(n).forEach((function(e){t.getCtxs(e).forEach((function(e){var n=t.subForm[e.id];n&&(Array.isArray(n)?n.forEach((function(e){e.clearValidateState()})):n&&n.clearValidateState())}))}))},btn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({show:!!t})}},resetBtn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({show:!!t})}},submitBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=tn(t.options.submitBtn,!0);we(r,n),t.options.submitBtn=r,e.refreshOptions()},resetBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=tn(t.options.resetBtn,!1);we(r,n),t.options.resetBtn=r,e.refreshOptions()},submit:function(n,r){return new Promise((function(i,o){e.validate().then((function(){var r=e.formData();ue.Function(n)&&nt((function(){return n(r,e)})),ue.Function(t.options.onSubmit)&&nt((function(){return t.options.onSubmit(r,e)})),t.vm.emit("submit",r,e),i(r)})).catch((function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];ue.Function(r)&&nt((function(){return r.apply(void 0,[e].concat(n))})),o.apply(void 0,n)}))}))}}),e}U(".form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}");var rn={name:"required",load:function(e,t,n){var r=function(e){return ue.Boolean(e)?{required:e}:ue.String(e)?{message:e}:ue.Undef(e)?{required:!1}:ue.Function(e)?{validator:e}:ue.Object(e)?e:{}}(e.getValue());if(!1===r.required)e.clearProp();else{var i=V({required:!0,validator:function(e,t,n){ue.empty(t)?n(i.message):n()}},r);if(!i.message){var o=t.title||"";i.message=(("object"===F(o)?o.title:o)||"")+"不能为空"}e.getProp().validate=[i]}n.sync(t)},watch:function(){rn.load.apply(rn,arguments)}};function on(e){e.componentAlias(Kt),Ve.forEach((function(t){e.component(t.name,t)})),e.register(rn),Jt.forEach((function(t){e.parser(t)})),Object.keys(en).forEach((function(t){e.maker[t]=en[t]})),"undefined"!=typeof window&&window.ElementPlus&&e.useApp((function(e,t){t.use(window.ElementPlus)}))}var an=Ht({ui:"element-ui",version:"3.1.27",manager:Zt,extendApi:nn,install:on,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=an);var un=an.maker;export{an as default,un as maker};
|