ryui-vue
Version:
ry公共组件库
8 lines • 465 kB
JavaScript
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["ryui"]=t(require("vue")):e["ryui"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__203__){return function(){var __webpack_modules__={518:function(__unused_webpack_module,exports,__webpack_require__){
/*!
* @form-create/element-ui v2.5.20
* (c) 2018-2022 xaboy
* Github https://github.com/xaboy/form-create
* Released under the MIT License.
*/
!function(e,t){t(exports,__webpack_require__(203))}(0,(function(exports,Vue){"use strict";function _extends(){return(_extends=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)}Vue=Vue&&Object.prototype.hasOwnProperty.call(Vue,"default")?Vue.default:Vue;var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(e){return e.reduce((function(e,t){for(var r in t)if(e[r])if(-1!==normalMerge.indexOf(r))e[r]=_extends({},e[r],t[r]);else if(-1!==toArrayMerge.indexOf(r)){var n=e[r]instanceof Array?e[r]:[e[r]],i=t[r]instanceof Array?t[r]:[t[r]];e[r]=n.concat(i)}else if(-1!==functionalMerge.indexOf(r))for(var a in t[r])if(e[r][a]){var o=e[r][a]instanceof Array?e[r][a]:[e[r][a]],s=t[r][a]instanceof Array?t[r][a]:[t[r][a]];e[r][a]=o.concat(s)}else e[r][a]=t[r][a];else if("hook"==r)for(var l in t[r])e[r][l]=e[r][l]?mergeFn(e[r][l],t[r][l]):t[r][l];else e[r]=t[r];else e[r]=t[r];return e}),{})},mergeFn=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},helper=mergeJsxProps;function _typeof(e){return(_typeof="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})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _inherits(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&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){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}}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){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 getSlot(e,t){return Object.keys(e).reduce((function(r,n){return t&&-1!==t.indexOf(n)||r.push(e[n]),r}),[])}var NAME="fcCheckbox",Checkbox={name:NAME,props:{formCreateInject:{type:Object,required:!0},value:{type:Array,default:function(){return[]}},type:String},watch:{"formCreateInject.options":{handler:function(){this.update()},deep:!0},value:function(){this.update()}},data:function(){return{trueValue:[]}},methods:{options:function(){var e=this.formCreateInject.options;return Array.isArray(e)?e:[]},onInput:function(e){this.$emit("input",this.options().filter((function(t){return-1!==e.indexOf(t.label)})).map((function(e){return e.value})).filter((function(e){return void 0!==e})))},update:function(){var e=this;this.trueValue=this.value?this.options().filter((function(t){return-1!==e.value.indexOf(t.value)})).map((function(e){return e.label})):[]}},created:function(){this.update()},render:function(){var e=this,t=arguments[0];return t("ElCheckboxGroup",helper([{},this.formCreateInject.prop,{attrs:{value:this.trueValue},on:{input:this.onInput}}]),[this.options().map((function(r,n){var i=_objectSpread2({},r),a="button"===e.type?"ElCheckboxButton":"ElCheckbox";return delete i.value,t(a,{props:_objectSpread2({},i),key:a+n+r.value})})),getSlot(this.$slots)])}};function toArray(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}function styleInject(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var css_248z="._fc-frame .fc-files img {\n width: 100%;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n}\n\n._fc-frame .fc-upload-btn {\n border: 1px dashed #c0ccda;\n cursor: pointer;\n}\n\n._fc-frame .fc-upload-cover {\n opacity: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: rgba(0, 0, 0, .6);\n -webkit-transition: opacity .3s;\n -o-transition: opacity .3s;\n transition: opacity .3s;\n}\n\n._fc-frame .fc-upload-cover i {\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n margin: 0 2px;\n}\n\n._fc-frame .fc-files:hover .fc-upload-cover {\n opacity: 1;\n}\n\n._fc-frame .el-upload {\n display: block;\n}\n\n._fc-frame .fc-upload-btn, .fc-files {\n display: inline-block;\n width: 58px;\n height: 58px;\n text-align: center;\n line-height: 58px;\n border: 1px solid #c0ccda;\n border-radius: 4px;\n overflow: hidden;\n background: #fff;\n position: relative;\n -webkit-box-shadow: 2px 2px 5px rgba(0, 0, 0, .1);\n box-shadow: 2px 2px 5px rgba(0, 0, 0, .1);\n margin-right: 4px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n";styleInject(css_248z);var NAME$1="fcFrame",Frame={name:NAME$1,props:{formCreateInject:{type:Object,required:!0},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:"el-icon-upload2"},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:{type:Function,default:function(e){this.previewImage=this.getSrc(e),this.previewVisible=!0}},modal:{type:Object,default:function(){return{}}},srcKey:{type:[String,Number]},value:[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}},data:function(){return{fileList:toArray(this.value),previewVisible:!1,frameVisible:!1,previewImage:""}},watch:{value:function(e){this.fileList=toArray(e)},fileList:function(e){var t=1===this.maxLength?e[0]||"":e;this.$emit("input",t),this.$emit("change",t)},src:function(e){this.modalVm&&(this.modalVm.src=e)}},methods:{key:function(e){return e},closeModel:function(e){this.$emit(e?"$close":"$ok"),this.reload&&(this.$off("$ok"),this.$off("$close")),this.frameVisible=!1},handleCancel:function(){this.previewVisible=!1},showModel:function(){this.disabled||!1===this.onOpen()||(this.frameVisible=!0)},makeInput:function(){var e=this,t=this.$createElement,r={type:"text",value:this.fileList.map((function(t){return e.getSrc(t)})).toString(),readonly:!0};return t("ElInput",helper([{},{props:r},{key:this.key("input")}]),[this.fileList.length?t("i",{slot:"suffix",class:"el-input__icon el-icon-circle-close",on:{click:function(){return e.fileList=[]}}}):null,t("ElButton",helper([{attrs:{icon:this.icon}},{on:{click:function(){return e.showModel()}}},{slot:"append"}]))])},makeGroup:function(e){var t=this.$createElement;return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),t("div",{key:this.key("group")},_toConsumableArray(e))},makeItem:function(e,t){return(0,this.$createElement)("div",{class:"fc-files",key:this.key("file"+e)},_toConsumableArray(t))},valid:function(e){var t=this.formCreateInject.field||this.field;if(t&&e!==t)throw new Error("[frame]无效的字段值")},makeIcons:function(e,t){var r=this.$createElement;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:this.key("uc")},[n])}},makeHandleIcon:function(e,t){var r=this;return(0,this.$createElement)("i",{class:!0===this.handleIcon||void 0===this.handleIcon?"el-icon-view":this.handleIcon,on:{click:function(){return r.handleClick(e)}},key:this.key("hi"+t)})},makeRemoveIcon:function(e,t){var r=this;return(0,this.$createElement)("i",{class:"el-icon-delete",on:{click:function(){return r.handleRemove(e)}},key:this.key("ri"+t)})},makeFiles:function(){var e=this,t=this.$createElement;return this.makeGroup(this.fileList.map((function(r,n){return e.makeItem(n,[t("i",{class:"el-icon-tickets",on:{click:function(){return e.handleClick(r)}}}),e.makeIcons(r,n)])})))},makeImages:function(){var e=this,t=this.$createElement;return this.makeGroup(this.fileList.map((function(r,n){return e.makeItem(n,[t("img",{attrs:{src:e.getSrc(r)}}),e.makeIcons(r,n)])})))},makeBtn:function(){var e=this,t=this.$createElement;return t("div",{class:"fc-upload-btn",on:{click:function(){return e.showModel()}},key:this.key("btn")},[t("i",{class:this.icon})])},handleClick:function(e){return this.onHandle(e)},handleRemove:function(e){this.disabled||!1!==this.onBeforeRemove(e)&&(this.fileList.splice(this.fileList.indexOf(e),1),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,r){t.valid(e),t.disabled||t.$emit("input",r)},get:function(e){return t.valid(e),t.value},onOk:function(e){return t.$on("$ok",e)},onClose:function(e){return t.$on("$close",e)}})}catch(e){console.log(e)}},makeFooter:function(){var e=this,t=this.$createElement,r=this.$props,n=r.okBtnText,i=r.closeBtnText,a=r.closeBtn,o=r.okBtn;if(r.footer)return t("div",{slot:"footer"},[a?t("ElButton",{on:{click:function(){return!1!==e.onCancel()&&(e.frameVisible=!1)}}},[i]):null,o?t("ElButton",{attrs:{type:"primary"},on:{click:function(){return!1!==e.onOk()&&e.closeModel()}}},[n]):null])}},render:function(){var e,t=this,r=arguments[0],n=this.type;e="input"===n?this.makeInput():"image"===n?this.makeImages():this.makeFiles();var i=this.$props,a=i.width,o=void 0===a?"30%":a,s=i.height,l=i.src,c=i.title,f=i.modalTitle;return this.$nextTick((function(){t.$refs.frame&&t.frameLoad(t.$refs.frame.contentWindow||{})})),r("div",{class:"_fc-frame"},[e,r("el-dialog",{attrs:{appendToBody:!0,modal:this.previewMask,title:f,visible:this.previewVisible},on:{close:this.handleCancel}},[r("img",{style:"width: 100%",attrs:{src:this.previewImage}})]),r("el-dialog",helper([{attrs:{appendToBody:!0}},_objectSpread2({width:o,title:c},this.modal),{attrs:{visible:this.frameVisible},on:{close:function(){return t.closeModel(!0)}}}]),[this.frameVisible||!this.reload?r("iframe",{ref:"frame",attrs:{src:l,frameBorder:"0"},style:{height:s,border:"0 none",width:"100%"}}):null,this.makeFooter()])])},mounted:function(){this.$on("fc.closeModal",this.closeModal)}},NAME$2="fcRadio",Radio={name:NAME$2,props:{formCreateInject:{type:Object,required:!0},value:{},type:String},watch:{"formCreateInject.options":{handler:function(){this.update()},deep:!0},value:function(){this.update()}},data:function(){return{trueValue:[]}},methods:{options:function(){var e=this.formCreateInject.options;return Array.isArray(e)?e:[]},onInput:function(e){this.$emit("input",this.options().filter((function(t){return t.label===e})).reduce((function(e,t){return t.value}),""))},update:function(){var e=this;this.trueValue=this.options().filter((function(t){return t.value===e.value})).reduce((function(e,t){return t.label}),"")}},created:function(){this.update()},render:function(){var e=this,t=arguments[0];return t("ElRadioGroup",helper([{},this.formCreateInject.prop,{attrs:{value:this.trueValue},on:{input:this.onInput}}]),[this.options().map((function(r,n){var i=_objectSpread2({},r),a="button"===e.type?"ElRadioButton":"ElRadio";return delete i.value,t(a,{props:_objectSpread2({},i),key:a+n+r.value})})),getSlot(this.$slots)])}},is={type:function(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef:function(e){return null==e},Element:function(e){return"object"===_typeof(e)&&null!==e&&1===e.nodeType&&!is.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 hasProperty(e,t){return{}.hasOwnProperty.call(e,t)}["Date","Object","String","Boolean","Array","Number"].forEach((function(e){is[e]=function(t){return is.type(t,e)}}));var NAME$3="fcSelect",Select={name:NAME$3,functional:!0,props:{formCreateInject:{type:Object,required:!0}},render:function(e,t){var r=t.props.formCreateInject.options;return e("ElSelect",helper([{},t.data]),[(Array.isArray(r)?r:[]).map((function(t,r){var n=t.slot;return e("ElOption",{props:_objectSpread2({},t),key:""+r+t.value},[n?e("template",{slot:t.slotName||"default"},[is.Function(n)?t.slot(e):n]):null])})),t.children])}},NAME$4="fcTree",Tree={name:NAME$4,formCreateParser:{mergeProp:function(e){var t=e.prop.props;t.nodeKey||(t.nodeKey="id"),t.props||(t.props={label:"title"})}},props:{formCreateInject:{type:Object,required:!0},type:{type:String,default:"checked"},value:{type:[Array,String,Number],default:function(){return[]}}},watch:{value:function(){this.setValue()}},methods:{onChange:function(){this.updateValue()},updateValue:function(){var e;this.$refs.tree&&(e="selected"===this.type.toLocaleLowerCase()?this.$refs.tree.getCurrentKey():this.$refs.tree.getCheckedKeys(),this.$emit("input",e))},setValue:function(){"selected"===this.type.toLocaleLowerCase()?this.$refs.tree.setCurrentKey(this.value):this.$refs.tree.setCheckedKeys(toArray(this.value))}},render:function(){var e=this;return(0,arguments[0])("ElTree",helper([{},this.formCreateInject.prop,{ref:"tree",on:{check:function(){return e.updateValue()},"node-click":function(){return e.updateValue()}}}]),[getSlot(this.$slots)])},mounted:function(){this.setValue()}},css_248z$1="._fc-upload .fc-files img {\n width: 100%;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n}\n\n._fc-upload .fc-upload-btn {\n border: 1px dashed #c0ccda;\n cursor: pointer;\n}\n\n._fc-upload .fc-upload-cover {\n opacity: 0;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: rgba(0, 0, 0, .6);\n -webkit-transition: opacity .3s;\n -o-transition: opacity .3s;\n transition: opacity .3s;\n}\n\n._fc-upload .fc-upload-cover i {\n color: #fff;\n font-size: 20px;\n cursor: pointer;\n margin: 0 2px;\n}\n\n._fc-upload .fc-files:hover .fc-upload-cover {\n opacity: 1;\n}\n\n._fc-upload .el-upload {\n display: block;\n}\n\n._fc-upload .fc-upload-btn, ._fc-upload .fc-files {\n display: inline-block;\n width: 58px;\n height: 58px;\n text-align: center;\n line-height: 58px;\n border: 1px solid #c0ccda;\n border-radius: 4px;\n overflow: hidden;\n background: #fff;\n position: relative;\n -webkit-box-shadow: 2px 2px 5px rgba(0, 0, 0, .1);\n box-shadow: 2px 2px 5px rgba(0, 0, 0, .1);\n margin-right: 4px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n";function parseFile(e,t){return{url:e,name:getFileName(e),uid:t}}function getFileName(e){return(""+e).split("/").pop()}styleInject(css_248z$1);var NAME$5="fcUpload",Upload={name:NAME$5,props:{formCreateInject:{type:Object,required:!0},onHandle:{type:Function,default:function(e){this.previewImage=e.url,this.previewVisible=!0}},uploadType:{type:String,default:"file"},limit:{type:Number,default:0},allowRemove:{type:Boolean,default:!0},previewMask:void 0,modalTitle:String,handleIcon:{type:[String,Boolean],default:function(){}},value:[Array,String]},data:function(){return{uploadList:[],previewVisible:!1,previewImage:"",cacheFiles:[]}},created:function(){void 0===this.formCreateInject.prop.props.showFileList&&(this.formCreateInject.prop.props.showFileList=!1),this.formCreateInject.prop.props.fileList=toArray(this.value).map(parseFile)},watch:{value:function(e){this.$refs.upload.uploadFiles.every((function(e){return!e.status||"success"===e.status}))&&(this.$refs.upload.uploadFiles=toArray(e).map(parseFile),this.uploadList=this.$refs.upload.uploadFiles)},limit:function(e,t){1!==t&&1!==e||this.update()}},methods:{key:function(e){return e},isDisabled:function(){return!0===this.formCreateInject.prop.props.disabled},onRemove:function(e){this.isDisabled()||this.$refs.upload.handleRemove(e)},handleClick:function(e){this.onHandle(e)},makeItem:function(e,t){var r=this.$createElement;return"image"===this.uploadType?r("img",{attrs:{src:e.url},key:this.key("img"+t)}):r("i",{class:"el-icon-tickets",key:this.key("i"+t)})},makeRemoveIcon:function(e,t){var r=this;return(0,this.$createElement)("i",{class:"el-icon-delete",on:{click:function(){return r.onRemove(e)}},key:this.key("ri"+t)})},makeHandleIcon:function(e,t){var r=this;return(0,this.$createElement)("i",{class:!0===this.handleIcon||void 0===this.handleIcon?"el-icon-view":this.handleIcon,on:{click:function(){return r.handleClick(e)}},key:this.key("hi"+t)})},makeProgress:function(e,t){return(0,this.$createElement)("ElProgress",helper([{},{props:{percentage:e.percentage,type:"circle",width:52}},{style:"margin-top:2px;",key:this.key("pg"+t)}]))},makeIcons:function(e,t){var r=this.$createElement,n=[];if(this.allowRemove||!1!==this.handleIcon)return("file"!==this.uploadType&&!1!==this.handleIcon||"file"===this.uploadType&&this.handleIcon)&&n.push(this.makeHandleIcon(e,t)),this.allowRemove&&n.push(this.makeRemoveIcon(e,t)),r("div",{class:"fc-upload-cover"},[n])},makeFiles:function(){var e=this,t=this.$createElement;return this.uploadList.map((function(r,n){return e.$scopedSlots.fileList?e.$scopedSlots.fileList({file:r,index:n,vm:e}):t("div",{key:e.key(n),class:"fc-files"},[void 0!==r.percentage&&"success"!==r.status?e.makeProgress(r,n):[e.makeItem(r,n),e.makeIcons(r,n)]])}))},makeUpload:function(){var e=this.$createElement,t=!this.limit||this.limit>this.uploadList.length;return e("ElUpload",helper([{},this.formCreateInject.prop,{ref:"upload",style:{display:"inline-block"},key:this.key("upload")}]),[t?e("template",{slot:"default"},[this.$slots.default||e("div",{class:"fc-upload-btn"},[e("i",{class:"el-icon-upload2"})])]):null,getSlot(this.$slots,["default"])])},update:function(){var e=this.$refs.upload.uploadFiles.map((function(e){return e.url})).filter((function(e){return void 0!==e}));this.cacheFiles.length!==e.length&&(this.cacheFiles=_toConsumableArray(e),this.$emit("input",1===this.limit?e[0]||"":e))},handleCancel:function(){this.previewVisible=!1}},render:function(){var e=arguments[0];return this.$refs.upload&&(void 0===this.formCreateInject.prop.props.showFileList&&(this.formCreateInject.prop.props.showFileList=this.$refs.upload.showFileList),this.formCreateInject.prop.props.fileList=this.$refs.upload.fileList),e("div",{class:"_fc-upload"},[[this.formCreateInject.prop.props.showFileList?[]:this.makeFiles(),this.makeUpload()],e("el-dialog",{attrs:{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,visible:this.previewVisible},on:{close:this.handleCancel}},[e("img",{attrs:{alt:"example",src:this.previewImage},style:"width: 100%"})])])},mounted:function(){var e=this;this.uploadList=this.$refs.upload.uploadFiles,this.$watch((function(){return e.$refs.upload.uploadFiles}),(function(){e.update()}),{deep:!0})}};function $set(e,t,r){Vue.set(e,t,r)}function $del(e,t){Vue.delete(e,t)}function deepExtend(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i];if((n=Array.isArray(a))||is.Object(a)){var o=void 0===e[i];if(n)n=!1,o&&$set(e,i,[]);else if(a._clone&&void 0!==r){if(!r){$set(e,i,a._clone());continue}a=a.getRule(),o&&$set(e,i,{})}else o&&$set(e,i,{});e[i]=deepExtend(e[i],a,r)}else $set(e,i,a),is.Undef(a)||(is.Undef(a.__json)||(e[i].__json=a.__json),is.Undef(a.__origin)||(e[i].__origin=a.__origin))}return void 0!==r&&Array.isArray(e)?e.filter((function(e){return!e||!e.__ctrl})):e}function deepCopy(e){return deepExtend({},{value:e}).value}var _extends$1=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&$set(e,n,t[n]);return e};function extend(){return _extends$1.apply(this,arguments)}var NAME$6="fcGroup",Group={name:NAME$6,props:{field:String,rule:[Array,Object],rules:Array,expand:Number,options:Object,formCreateInject:{type:Object,required:!0},button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},value:{type:Array,default:function(){return[]}},defaultValue:Object,disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},fontSize:{type:Number,default:28},onBeforeRemove:{type:Function,default:function(){}},onBeforeAdd:{type:Function,default:function(){}}},data:function(){return{len:0,cacheRule:{},cacheValue:{},type:void 0}},computed:{formRule:function(){return this.rules?this.rules:this.rule?Array.isArray(this.rule)?this.rule:[this.rule]:[]}},watch:{formRule:{handler:function(e,t){var r=this;Object.keys(this.cacheRule).forEach((function(n){var i=r.cacheRule[n];if(e===t)deepExtend(i.rule,e);else{var a=i.$f.formData();i.$f.once("reload",(function(){i.$f.setValue(a)})),i.rule=deepCopy(e)}}))},deep:!0},disabled:function(e){if(this.syncDisabled){var t=this.cacheRule;Object.keys(t).forEach((function(r){t[r].$f.disabled(e)}))}},expand:function(e){var t=e-this.value.length;t>0&&this.expandRule(t)},value:function(e){var t=this;e=e||[];var r=Object.keys(this.cacheRule),n=r.length,i=n-e.length;if(i<0){for(var a=i;a<0;a++)this.addRule(e.length+a);for(var o=0;o<n;o++)this.setValue(r[o],e[o])}else{if(i>0)for(var s=0;s<i;s++)this.removeRule(r[n-s-1]);e.forEach((function(n,i){t.setValue(r[i],e[i])}))}}},methods:{_value:function(e){return e&&hasProperty(e,this.field)?e[this.field]:e},cache:function(e,t){this.cacheValue[e]=JSON.stringify(t)},input:function(e){this.$emit("input",e),this.$emit("change",e)},formData:function(e,t){var r=this,n=this.cacheRule,i=Object.keys(n);if(i.filter((function(e){return n[e].$f})).length===i.length){var a=i.map((function(n){var i=e===n?t:_objectSpread2({},r.cacheRule[n].$f.form),a=r.field?i[r.field]||null:i;return r.cache(n,a),a}));this.input(a)}},setValue:function(e,t){var r=this.field,n=this.cacheRule[e].$f;r&&(t=_defineProperty({},r,this._value(t))),this.cacheValue[e]!==JSON.stringify(r?t[r]:t)&&(this.cache(e,t),n.coverValue(t||{}))},addRule:function(e,t){var r=this,n=this.formCreateInject.form.copyRules(this.formRule),i=this.options?_objectSpread2({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){i.formData||(i.formData={});var a=deepCopy(this.defaultValue);extend(i.formData,this.field?_defineProperty({},this.field,a):a)}this.$set(this.cacheRule,++this.len,{rule:n,options:i}),t&&this.$nextTick((function(){return r.$emit("add",n,Object.keys(r.cacheRule).length-1)}))},add$f:function(e,t,r){var n=this;this.cacheRule[t].$f=r,this.formData(t,r.formData()),this.$nextTick((function(){n.syncDisabled&&r.disabled(n.disabled),n.$emit("itemMounted",r,Object.keys(n.cacheRule).indexOf(t))}))},removeRule:function(e,t){var r=this,n=Object.keys(this.cacheRule).indexOf(e);this.$delete(this.cacheRule,e),this.$delete(this.cacheValue,e),t&&this.$nextTick((function(){return r.$emit("remove",n)}))},add:function(e){this.disabled||!1===this.onBeforeAdd(this.value)||this.addRule(e,!0)},del:function(e,t){this.disabled||!1===this.onBeforeRemove(this.value,e)||(this.removeRule(t,!0),this.value.splice(e,1),this.input(this.value))},addIcon:function(e){return(0,this.$createElement)("i",{key:"a".concat(e),class:"el-icon-circle-plus-outline",style:"font-size:".concat(this.fontSize,"px;cursor:").concat(this.disabled?"not-allowed;color:#c9cdd4":"pointer",";"),on:{click:this.add}})},delIcon:function(e,t){var r=this;return(0,this.$createElement)("i",{key:"d".concat(t),class:"el-icon-remove-outline",style:"font-size:".concat(this.fontSize,"px;cursor:").concat(this.disabled?"not-allowed;color:#c9cdd4":"pointer;color:#606266",";"),on:{click:function(){return r.del(e,t)}}})},makeIcon:function(e,t,r){var n=this;return this.$scopedSlots.button?this.$scopedSlots.button({total:e,index:t,vm:this,key:r,del:function(){return n.del(t,r)},add:this.add}):0===t?[0!==this.max&&e>=this.max?null:this.addIcon(r),0===this.min||e>this.min?this.delIcon(t,r):null]:t>=this.min?this.delIcon(t,r):void 0},emitEvent:function(e,t,r,n){this.$emit.apply(this,[e].concat(_toConsumableArray(t),[this.cacheRule[n].$f,r]))},expandRule:function(e){for(var t=0;t<e;t++)this.value.push(this.field?null:{})}},created:function(){this.type=this.formCreateInject.form.$form();var e=(this.expand||0)-this.value.length;e>0&&this.expandRule(e);for(var t=0;t<this.value.length;t++)this.addRule(t)},render:function(){var e=this,t=arguments[0],r=Object.keys(this.cacheRule),n=this.button,i=this.type;return 0===r.length?this.$scopedSlots.default?this.$scopedSlots.default({vm:this,add:this.add}):t("i",{key:"a_def",class:"el-icon-circle-plus-outline",style:"font-size:".concat(this.fontSize,"px;vertical-align:middle;color:").concat(this.disabled?"#c9cdd4;cursor: not-allowed":"#606266;cursor:pointer",";"),on:{click:this.add}}):t("div",{key:"con"},[r.map((function(a,o){var s=e.cacheRule[a],l=s.rule,c=s.options;return t("ElRow",{attrs:{align:"middle",type:"flex"},key:a,style:"border-bottom:1px dashed #DCDFE6;margin-bottom:10px;"},[t("ElCol",{attrs:{span:n?20:24}},[t("ElFormItem",[t(i,helper([{key:a,attrs:{inFor:!0}},{on:{"update:value":function(t){return e.formData(a,t)},"emit-event":function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e.emitEvent(t,n,o,a)},input:function(t){return e.add$f(o,a,t)}}},{attrs:{value:e.field?_defineProperty({},e.field,e._value(e.value[o])):e.value[o],rule:l,option:c,extendOption:!0}}]))])]),n?t("ElCol",{attrs:{span:2,pull:1,push:1}},[e.makeIcon(r.length,o,a)]):null])}))])}},NAME$7="fcSubForm",Sub={name:NAME$7,props:{rule:Array,options:Object,formCreateInject:{type:Object,required:!0},value:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0}},data:function(){return{cacheRule:{},cacheValue:{},type:void 0}},watch:{disabled:function(e){this.syncDisabled&&this.cacheRule.$f.disabled(e)},value:function(e){this.setValue(e)}},methods:{formData:function(e){this.cacheValue=JSON.stringify(e),this.$emit("input",e),this.$emit("change",e)},setValue:function(e){var t=JSON.stringify(e);this.cacheValue!==t&&(this.cacheValue=t,this.cacheRule.$f.coverValue(e||{}))},addRule:function(){var e=this.options?this.options:{submitBtn:!1,resetBtn:!1};e.formData=_objectSpread2({},this.value||{}),this.cacheRule={rule:this.rule,options:e}},add$f:function(e){var t=this;this.cacheRule.$f=e,this.$nextTick((function(){t.syncDisabled&&e.disabled(t.disabled),t.$emit("itemMounted",e)}))},emitEvent:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.$emit.apply(this,[e].concat(r))}},created:function(){this.addRule(),this.type=this.formCreateInject.form.$form()},render:function(){var e=arguments[0],t=this.cacheRule,r=t.rule,n=t.options;return e(this.type,helper([{},{on:{"update:value":this.formData,"emit-event":this.emitEvent,input:this.add$f}},{attrs:{rule:r,option:n,extendOption:!0}}]))}},components=[Checkbox,Frame,Radio,Select,Tree,Upload,Group,Sub],NAME$8="FormCreate",getRuleInject=function e(t,r){if(t&&t!==r)return t.formCreateInject?t.formCreateInject:t.$parent?e(t.$parent,r):void 0};function $FormCreate(e){return{name:NAME$8,componentName:NAME$8,model:{prop:"api"},provide:function(){return{$pfc:this}},inject:{$pfc:{default:null}},props:{rule:{type:Array,required:!0},option:{type:Object,default:function(){return{}}},extendOption:Boolean,value:Object,api:Object,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},data:function(){return{formData:void 0,destroyed:!1,validate:{},$f:void 0,isShow:!0,unique:1,renderRule:_toConsumableArray(this.rule||[]),ctxInject:{},updateValue:JSON.stringify(this.value||{}),isMore:!!this.inFor}},render:function(){return this.formCreate.render()},methods:{_refresh:function(){++this.unique},_renderRule:function(){this.renderRule=_toConsumableArray(this.rule||[])},_updateValue:function(e){this.destroyed||(this.updateValue=JSON.stringify(e),this.$emit("update:value",e))}},watch:{value:{handler:function(e){JSON.stringify(e||{})!==this.updateValue&&this.$f.setValue(e||{})},deep:!0},option:{handler:function(e){this.formCreate.initOptions(e),this.$f.refresh()},deep:!0},rule:function(e){var t=this;e.length===this.renderRule.length&&e.every((function(e){return t.renderRule.indexOf(e)>-1}))||(this.formCreate.$handle.reloadRule(e),this._renderRule())}},beforeCreate:function(){var t=this,r=this.$options.propsData,n=r.rule,i=r.option;this.formCreate=new e(this,n,i),Object.keys(this.formCreate.prop).forEach((function(e){extend(t.$options[e],t.formCreate.prop[e])})),this.$emit("beforeCreate",this.formCreate.api())},created:function(){var e=this,t=this,r=this.formCreate.api(),n=function(){var e=getRuleInject(t,t.$pfc);if(e)if(t.isMore){var n=toArray(e.getSubForm()),i=n.indexOf(r);i>-1&&n.splice(i,1)}else e.subForm()};t.$on("hook:beforeDestroy",(function(){n()})),this.$watch((function(){return e.subForm}),(function(e){e?function(){if(t.$pfc){var e,n=getRuleInject(t,t.$pfc);n&&(t.isMore?(e=toArray(n.getSubForm())).push(r):e=r,n.subForm(e))}}():n()}),{immediate:!0})}}}var normalMerge$1=["attrs","props","domProps","scopedSlots"],toArrayMerge$1=["class","style","directives"],functionalMerge$1=["on","nativeOn"],mergeProps=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=[].concat(normalMerge$1,_toConsumableArray(n.normal||[])),a=[].concat(toArrayMerge$1,_toConsumableArray(n.array||[])),o=[].concat(functionalMerge$1,_toConsumableArray(n.functional||[])),s=n.props||[];return t.reduce((function(t,r){for(var n in r)if(t[n])if(s.indexOf(n)>-1)t[n]=e([r[n]],t[n]);else if(i.indexOf(n)>-1)t[n]=_objectSpread2(_objectSpread2({},t[n]),r[n]);else if(a.indexOf(n)>-1){var l=t[n]instanceof Array?t[n]:[t[n]],c=r[n]instanceof Array?r[n]:[r[n]];t[n]=[].concat(_toConsumableArray(l),_toConsumableArray(c))}else if(o.indexOf(n)>-1)for(var f in r[n])if(t[n][f]){var u=t[n][f]instanceof Array?t[n][f]:[t[n][f]],h=r[n][f]instanceof Array?r[n][f]:[r[n][f]];t[n][f]=[].concat(_toConsumableArray(u),_toConsumableArray(h))}else t[n][f]=r[n][f];else if("hook"===n)for(var p in r[n])t[n][p]?t[n][p]=mergeFn$1(t[n][p],r[n][p]):t[n][p]=r[n][p];else t[n]=r[n];else i.indexOf(n)>-1||o.indexOf(n)>-1||s.indexOf(n)>-1?t[n]=_objectSpread2({},r[n]):a.indexOf(n)>-1?t[n]=r[n]instanceof Array?_toConsumableArray(r[n]):"object"===_typeof(r[n])?_objectSpread2({},r[n]):r[n]:t[n]=r[n];return t}),r)},mergeFn$1=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},keyAttrs=["type","slot","emitPrefix","value","name","native","hidden","display","inject","options","emit","nativeEmit","link","prefix","suffix","update","sync","optionsTo","key","preview","component","cache"],arrayAttrs=["validate","children","control"],normalAttrs=["effect","deep"];function attrs(){return[].concat(keyAttrs,_toConsumableArray(normalMerge$1),_toConsumableArray(toArrayMerge$1),_toConsumableArray(functionalMerge$1),arrayAttrs,normalAttrs)}function format(e,t,r){return"[form-create ".concat(e,"]: ").concat(t)+(r?"\n\nrule: "+JSON.stringify(r.getRule?r.getRule():r):"")}function tip(e,t){console.warn(format("tip",e,t))}function err(e,t){console.error(format("err",e,t))}function logError(e){err(e.toString()),console.error(e)}var PREFIX="[[FORM-CREATE-PREFIX-",SUFFIX="-FORM-CREATE-SUFFIX]]",$T="$FN:",$TX="$FNX:",FUNCTION="function";function toJson(e,t){return JSON.stringify(deepExtend([],e,!0),(function(e,t){if(!t||!0!==t._isVue){if(_typeof(t)!==FUNCTION)return t;if(t.__json)return t.__json;if(t.__origin&&(t=t.__origin),!t.__emit)return PREFIX+t+SUFFIX}}),t)}function makeFn(fn){return eval("("+FUNCTION+"(){return "+fn+" })()")}function parseFn(e,t){if(e&&is.String(e)&&e.length>4){var r=e.trim(),n=!1;try{if(r.indexOf(SUFFIX)>0&&0===r.indexOf(PREFIX))r=r.replace(SUFFIX,"").replace(PREFIX,""),n=!0;else if(0===r.indexOf($T))r=r.replace($T,""),n=!0;else{if(0===r.indexOf($TX))return(r=makeFn("function($inject){"+r.replace($TX,"")+"}")).__json=e,r.__inject=!0,r;t||0!==r.indexOf(FUNCTION)||r===FUNCTION||(n=!0)}if(!n)return e;var i=makeFn(-1===r.indexOf(FUNCTION)&&0!==r.indexOf("(")?FUNCTION+" "+r:r);return i.__json=e,i}catch(e){return void err("解析失败:".concat(r,"\n\nerr: ").concat(e))}}return e}function parseJson(e,t){return JSON.parse(e,(function(e,r){return is.Undef(r)||!r.indexOf?r:parseFn(r,t)}))}function enumerable(e,t){return{value:e,enumerable:!1,configurable:!1,writable:!!t}}function copyRule(e){return copyRules([e])[0]}function copyRules(e,t){return deepExtend([],_toConsumableArray(e),t||!1)}function mergeRule(e,t){return mergeProps(Array.isArray(t)?t:[t],e,{array:arrayAttrs,normal:normalAttrs}),e}function getRule(e){return is.Function(e.getRule)?e.getRule():e}function mergeGlobal(e,t){return e?(Object.keys(t||{}).forEach((function(r){t[r]&&(e[r]=mergeRule(e[r]||{},t[r]))})),e):t}function funcProxy(e,t){Object.defineProperties(e,Object.keys(t).reduce((function(e,r){return e[r]={get:function(){return t[r]()}},e}),{}))}function byCtx(e){return e.__fc__||(e.__origin__?e.__origin__.__fc__:null)}function invoke(e,t){try{t=e()}catch(e){logError(e)}return t}function baseRule(){return{props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0}}function creatorFactory(e,t){return function(r,n,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=new Creator(e,r,n,i,a);return t&&(is.Function(t)?t(o):o.props(t)),o}}function Creator(e,t,r,n,i){this._data=extend(baseRule(),{type:e,title:t,field:r,value:n,props:i||{}}),this.event=this.on}function appendProto(e){e.forEach((function(e){Creator.prototype[e]=function(t){return mergeRule(this._data,_defineProperty({},e,arguments.length<2?t:_defineProperty({},t,arguments[1]))),this}}))}extend(Creator.prototype,{getRule:function(){return this._data},setProp:function(e,t){return $set(this._data,e,t),this},_clone:function(){var e=new this.constructor;return e._data=copyRule(this._data),e}}),appendProto(attrs());var commonMaker=creatorFactory("");function create(e,t,r){var n=commonMaker("",t);return n._data.type=e,n._data.title=r,n}function createTmp(e,t,r,n){var i=commonMaker("",r);return i._data.type="template",i._data.template=e,i._data.title=n,i._data.vm=t,i}function makerFactory(){return{create:create,createTmp:createTmp,template:createTmp,factory:creatorFactory}}function copy(e){return deepCopy(e)}function Api(e){function t(t){return is.Undef(t)?t=e.fields():Array.isArray(t)||(t=[t]),t}function r(r,n,i){t(r).forEach((function(t){e.getCtxs(t).forEach((function(t){$set(t.rule,n,i),e.$render.clearCache(t)}))}))}function n(){var t=e.subForm;return Object.keys(t).reduce((function(e,r){var n=t[r];return n?(Array.isArray(n)?e.push.apply(e,_toConsumableArray(n)):e.push(n),e):e}),[])}var i={get config(){return e.options},get options(){return e.options},get form(){return e.form},get rule(){return e.rules},get parent(){return e.vm.$pfc&&e.vm.$pfc.$f},get children(){return n()},formData:function(r){return t(r).reduce((function(t,r){var n=e.getFieldCtx(r);return n?(t[n.field]=copy(n.rule.value),t):t}),e.options.appendValue?copy(e.appendData):{})},getValue:function(t){var r=e.getFieldCtx(t);if(r)return copy(r.rule.value)},coverValue:function(t){e.deferSyncValue((function(){i.fields().forEach((function(r){var n=e.fieldCtx[r];if(!n)return e.appendData[r]=t[r];var i=hasProperty(t,r);n.forEach((function(e){e.rule.value=i?t[r]:void 0}))}))}))},setValue:function(t){var r=t;arguments.length>=2&&(r=_defineProperty({},t,arguments[1])),e.deferSyncValue((function(){Object.keys(r).forEach((function(t){var n=e.fieldCtx[t];if(!n)return e.appendData[t]=r[t];n.forEach((function(e){e.rule.value=r[t]}))}))}))},removeField:function(t){var r=e.getCtx(t);return e.deferSyncValue((function(){e.getCtxs(t).forEach((function(e){e.rm()}))}),!0),r?r.origin:void 0},removeRule:function(e){var t=e&&byCtx(e);if(t)return t.rm(),t.origin},destroy:function(){e.vm.$el.parentNode&&e.vm.$el.parentNode.removeChild(e.vm.$el),e.vm.$destroy()},fields:function(){return e.fields()},append:function(t,r,n){var i,a=e.sort.length-1,o=e.getCtx(r);o?n?(i=o.rule.children,a=o.rule.children.length-1):(a=o.root.indexOf(o.origin),i=o.root):i=e.rules,i.splice(a+1,0,t)},prepend:function(t,r,n){var i,a=0,o=e.getCtx(r);o?n?i=o.rule.children:(a=o.root.indexOf(o.origin),i=o.root):i=e.rules,i.splice(a,0,t)},hidden:function(t,n){r(n,"hidden",!!t),e.refresh()},hiddenStatus:function(t){var r=e.getCtx(t);if(r)return!!r.rule.hidden},display:function(t,n){r(n,"display",!!t),e.refresh()},displayStatus:function(t){var r=e.getCtx(t);if(r)return!!r.rule.display},disabled:function(r,n){t(n).forEach((function(t){e.getCtxs(t).forEach((function(e){e.rule.props&&$set(e.rule.props,"disabled",!!r)}))})),e.refresh()},all:function(t){return Object.keys(e.ctxs).map((function(r){var n=e.ctxs[r];return t?n.origin:n.rule}))},model:function(t){return e.fields().reduce((function(r,n){var i=e.fieldCtx[n][0];return r[n]=t?i.origin:i.rule,r}),{})},component:function(t){return Object.keys(e.nameCtx).reduce((function(r,n){var i=e.nameCtx[n].map((function(e){return t?e.origin:e.rule}));return r[n]=1===i.length?i[0]:i,r}),{})},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 r=is.Object(t)?byCtx(t):e.getCtxs(t);r&&((r=Array.isArray(r)?r:[r]).forEach((function(t){if(!t.deleted){var r=e.subForm[t.id];r&&(Array.isArray(r)?r.forEach((function(e){e.refresh()})):r&&r.refresh()),e.$render.clearCache(t)}})),e.refresh())}},refresh:function(){n().forEach((function(e){e.refresh()})),e.$render.clearCacheAll(),e.refresh()},refreshOptions:function(){e.$manager.updateOptions(e.options),i.refresh()},hideForm:function(t){$set(e.vm,"isShow",!t)},changeStatus:function(){return e.changeStatus},clearChangeStatus:function(){e.changeStatus=!1},updateRule:function(t,r){e.getCtxs(t).forEach((function(e){extend(e.rule,r)}))},updateRules:function(e){Object.keys(e).forEach((function(t){i.updateRule(t,e[t])}))},mergeRule:function(t,r){e.getCtxs(t).forEach((function(e){mergeRule(e.rule,r)}))},mergeRules:function(e){Object.keys(e).forEach((function(t){i.mergeRule(t,e[t])}))},getRule:function(t,r){var n=e.getCtx(t);if(n)return r?n.origin:n.rule},setEffect:function(t,r,n){var i=e.getCtx(t);i&&r&&("$"===r[0]&&(r=r.substr(1)),hasProperty(i.rule,"$"+r)&&$set(i.rule,"$"+r,n),hasProperty(i.rule,"effect")||(i.rule.effect={}),$set(i.rule.effect,r,n))},updateValidate:function(e,t,n){n?i.mergeRule(e,{validate:t}):r(e,"validate",t)},updateValidates:function(e,t){Object.keys(e).forEach((function(r){i.updateValidate(r,e[r],t)}))},refreshValidate:function(){e.vm.validate={},i.refresh()},resetFields:function(r){t(r).forEach((function(t){e.getCtxs(t).forEach((function(t){e.$render.clearCache(t),t.rule.value=copy(t.defaultValue),e.refreshControl(t)}))}))},method:function(e,t){var r=i.el(e);if(!r||!r[t])throw new Error(format("err","".concat(t,"方法不存在")));return function(){return r[t].apply(r,arguments)}},exec:function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];return invoke((function(){return i.method(e,t).apply(void 0,n)}))},toJson:function(e){return toJson(i.rule,e)},trigger:function(e,t){for(var r=i.el(e),n=arguments.length,a=new Array(n>2?n-2:0),o=2;o<n;o++)a[o-2]=arguments[o];r&&r.$emit.apply(r,[t].concat(a))},el:function(t){var r=e.getCtx(t);if(r)return r.el||e.vm.$refs[r.ref]},closeModal:function(e){var t=i.el(e);t&&t.$emit&&t.$emit("close-modal")},getSubForm:function(t){var r=e.getCtx(t);return r?e.subForm[r.id]:void 0},nextTick:function(t){e.bus.$once("next-tick",t),e.refresh()},nextRefresh:function(t){e.nextRefresh(),t&&invoke(t)},emit:function(t){for(var r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(r=e.vm).$emit.apply(r,[t].concat(i))},helper:{tidyFields:t,props:r}};return["on","once","off","set"].forEach((function(t){i[t]=function(){var r;(r=e.vm)["$".concat(t)].apply(r,arguments)}})),i.changeValue=i.changeField=i.setValue,i}function useCache(e){extend(e.prototype,{initCache:function(){this.clearCacheAll()},clearCache:function(e){if(this.cache[e.id]){(!0===this.cache[e.id].use||this.cache[e.id].parent)&&this.$handle.refresh();var t=this.cache[e.id].parent;this.cache[e.id]=null,t&&this.clearCache(t)}else e.parent&&this.clearCache(e.parent)},clearCacheAll:function(){this.cache={}},setCache:function(e,t,r){this.cache[e.id]={vnode:t,use:!1,parent:r,slot:e.rule.slot}},getCache:function(e){var t=this.cache[e.id];return t.use=!0,t.vnode}})}function toCase(e){return lower(e.replace(/(-[a-z])/g,(function(e){return e.replace("-","").toLocaleUpperCase()})))}function lower(e){return e.replace(e[0],e[0].toLowerCase())}function toString(e){return null==e?"":"object"===_typeof(e)?JSON.stringify(e,null,2):String(e)}function toLine(e){var t=e.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}var id=0;function uniqueId(){return Math.random().toString(36).substr(3,3)+Number("".concat(Date.now()).concat(++id)).toString(36)}function deepSet(e,t,r){var n,i=e;return(t||"").split(".").forEach((function(e){n&&(i[n]&&"object"==_typeof(i[n])||(i[n]={}),i=i[n]),n=e})),i[n]=r,i}function useRender(e){extend(e.prototype,{initRender:function(){this.tempList={},this.clearOrgChildren()},initOrgChildren:function(){var e=this.$handle.ctxs;this.orgChildren=Object.keys(e).reduce((function(t,r){if(!1!==e[r].parser.loadChildren){var n=e[r].rule.children;t[r]=is.trueArray(n)?_toConsumableArray(n):[]}return t}),{})},clearOrgChildren:function(){this.orgChildren={}},getTypeSlot:function(e){var t="type-"+toLine(e);return function r(n){if(n){var i=n.$scopedSlots[t]||n.$scopedSlots["type-"+e];return i||r(n.$pfc)}}(this.vm)},render:function(){var e=this;if(this.vm.isShow){var t;this.$h=this.vm.$createElement,this.$manager.beforeRender();var r=function(){return e.renderList()};return r.renderSlot=function(t){return e.renderList(t)},r.renderName=function(t){return e.renderId(t)},r.renderField=function(t){return e.renderId(t,"field")},t=this.vm.$scopedSlots.container?[this.vm.$scopedSlots.container(r)]:r(),this.$manager.render(t)}},renderList:function(e){var t=this;return this.sort.map((function(r){return e?t.renderSlot(t.$handle.ctxs[r],e):t.renderCtx(t.$handle.ctxs[r])})).filter((function(e){return void 0!==e}))},makeVm:function(e){var t=this,r=e.vm;return r?is.Function(r)?invoke((function(){return e.vm(t.$handle.getInjectData(e))})):r._isVue?r:new _vue(r):new _vue},mergeGlobal:function(e){var t=this.$handle.options.global;t&&(e.cacheConfig||(e.cacheConfig=t[e.originType]||t[e.type]||t[e.trueType]||{}),e.prop=mergeRule({},[t["*"],e.cacheConfig,e.prop]))},setOptions:function(e){e.prop.optionsTo&&e.prop.options&&deepSet(e.prop,e.prop.optionsTo,e.prop.options)},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(r){deepSet(e.prop,r,t[r])}))},setTempProps:function(e,t){if(e.$props){var r=t.prop,n=Object.keys(e.$props),i=this.injectProp(t),a=Object.keys(i);n.forEach((function(t){hasProperty(r.props,t)?e.$props[t]=r.props[t]:a.indexOf(t)>-1&&(e.$props[t]=i[t])}));var o=e.$options.model&&e.$options.model.prop||"value";n.indexOf(o)>-1&&(e.$props[o]=r.value)}},renderTemp:function(e){var t=this;if(!_vue.compile)return tip("当前使用的Vue构建版本不支持compile,无法使用template功能"),[];var r=e.prop,n=e.id,i=e.key;if(!this.tempList[n]){e.el||(e.el=this.makeVm(r),this.vm.$nextTick((function(){return e.parser.mounted(e)})));var a=e.el;e.input&&a.$on(a.$options.model&&a.$options.model.event||"input",(function(r){t.onInput(e,r)})),this.tempList[n]={vm:a,template:_vue.compile(r.template)}}var o=this.tempList[n],s=o.vm,l=o.template;this.setTempProps(s,e);var c=l.render.call(s);return is.Undef(c.data)&&(c.data={}),c.key=i,c.data.ref=e.ref,c.data.key=i,c},parseSide:function(e){return is.Object(e)?mergeRule({},e):e},renderSides:function(e,t,r){var n=t[r?"rule":"prop"];return[this.renderRule(this.parseSide(n.prefix)),e,this.renderRule(this.parseSide(n.suffix))]},renderSlot:function(e,t){return e.rule.slot===t?this.renderCtx(e):void 0},renderId:function(e,t){var r=this,n=this.$handle["field"===t?"fieldCtx":"nameCtx"][e];return n?n.map((function(e){return r.renderCtx(e,e.parent)})):void 0},renderCtx:function(e,t){if("hidden"!==e.type){var r=e.rule;if(!this.cache[e.id]||this.cache[e.id].slot!==r.slot){var n,i=!1!==r.cache,a=e.trueType,o=!(is.Undef(r.display)||r.display);if("template"!==a||r.template)if("fcFragment"===a)n=this.renderChildren(e);else{e.initProp(),this.mergeGlobal(e),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);var s=e.prop;s.preview=!!(hasProperty(s,"preview")?s.preview:this.options.preview),s.props.formCreateInject=this.injectProp(e);var l=s.preview;if(s.hidden)return void this.setCache(e,void 0,t);if("template"===a&&s.template)n=this.renderTemp(e),i=!1;else{var c=[];e.parser.renderChildren?c=e.parser.renderChildren(e):!1!==e.parser.loadChildren&&(c=this.renderChildren(e));var f=this.getTypeSlot(e.type);n=f?f({rule:r,prop:s,preview:l,children:c,api:this.$handle.api,model:s.model||{}}):l?e.parser.preview(c,e):e.parser.render(c,e)}n=this.renderSides(n,e),!e.input&&is.Undef(s.native)||!0===s.native||(n=this.$manager.makeWrap(e,n)),o&&(n=this.display(n)),n=this.item(e,n)}else n=this.renderSides(this.renderChildren(e),e,!0),o&&this.display(n),n=this.item(e,n);return i&&this.setCache(e,n,t),n}return this.getCache(e)}},display:function(e){var t=this;if(Array.isArray(e)){var r=[];return e.forEach((function(e){if(Array.isArray(e))return t.display(e);t.none(e)&&r.push(e)})),r}return this.none(e)},none:function(e){if(e&&e.data)return Array.isArray(e.data.style)?e.data.style.push({display:"none"}):e.data.style=[e.data.style,{disp