UNPKG

el-dynamic-form

Version:

ele form pingshu dynamic

2 lines 2.9 MB
/*! For license information please see elDynamicForm.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define("el-dynamic-form",["vue"],t):"object"==typeof exports?exports["el-dynamic-form"]=t(require("vue")):e["el-dynamic-form"]=t(e.Vue)}(this,(function(__WEBPACK_EXTERNAL_MODULE__50154__){return function(){var __webpack_modules__={47499:function(e){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t,n=1;n<arguments.length;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)}var n=["attrs","props","domProps"],o=["class","style","directives"],r=["on","nativeOn"],i=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}};e.exports=function(e){return e.reduce((function(e,a){for(var s in a)if(e[s])if(-1!==n.indexOf(s))e[s]=t({},e[s],a[s]);else if(-1!==o.indexOf(s)){var l=e[s]instanceof Array?e[s]:[e[s]],c=a[s]instanceof Array?a[s]:[a[s]];e[s]=[].concat(l,c)}else if(-1!==r.indexOf(s))for(var d in a[s])if(e[s][d]){var u=e[s][d]instanceof Array?e[s][d]:[e[s][d]],h=a[s][d]instanceof Array?a[s][d]:[a[s][d]];e[s][d]=[].concat(u,h)}else e[s][d]=a[s][d];else if("hook"===s)for(var p in a[s])e[s][p]=e[s][p]?i(e[s][p],a[s][p]):a[s][p];else e[s]=a[s];else e[s]=a[s];return e}),{})}},64734:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var o=n(85505),r=n(97479),i=/%[sdj%]/g;function a(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=1,r=t[0],a=t.length;if("function"==typeof r)return r.apply(null,t.slice(1));if("string"==typeof r){for(var s=String(r).replace(i,(function(e){if("%%"===e)return"%";if(o>=a)return e;switch(e){case"%s":return String(t[o++]);case"%d":return Number(t[o++]);case"%j":try{return JSON.stringify(t[o++])}catch(e){return"[Circular]"}break;default:return e}})),l=t[o];o<a;l=t[++o])s+=" "+l;return s}return r}function s(e,t){return null==e||!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"pattern"===e}(t)||"string"!=typeof e||e)}function l(e,t,n){var o=0,r=e.length;!function i(a){if(a&&a.length)n(a);else{var s=o;o+=1,s<r?t(e[s],i):n([])}}([])}function c(e){return function(t){return t&&t.message?(t.field=t.field||e.fullField,t):{message:t,field:t.field||e.fullField}}}function d(e,t){if(t)for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];"object"===(void 0===i?"undefined":(0,r.A)(i))&&"object"===(0,r.A)(e[n])?e[n]=(0,o.A)({},e[n],i):e[n]=i}return e}var u=function(e,t,n,o,r,i){!e.required||n.hasOwnProperty(e.field)&&!s(t,i||e.type)||o.push(a(r.messages.required,e.fullField))},h={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},p={integer:function(e){return p.number(e)&&parseInt(e,10)===e},float:function(e){return p.number(e)&&!p.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===(void 0===e?"undefined":(0,r.A)(e))&&!p.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&!!e.match(h.email)&&e.length<255},url:function(e){return"string"==typeof e&&!!e.match(h.url)},hex:function(e){return"string"==typeof e&&!!e.match(h.hex)}},m="enum",f=u,g=function(e,t,n,o,r){(/^\s+$/.test(t)||""===t)&&o.push(a(r.messages.whitespace,e.fullField))},v=function(e,t,n,o,i){if(e.required&&void 0===t)u(e,t,n,o,i);else{var s=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?p[s](t)||o.push(a(i.messages.types[s],e.fullField,e.type)):s&&(void 0===t?"undefined":(0,r.A)(t))!==e.type&&o.push(a(i.messages.types[s],e.fullField,e.type))}},y=function(e,t,n,o,r){var i="number"==typeof e.len,s="number"==typeof e.min,l="number"==typeof e.max,c=t,d=null,u="number"==typeof t,h="string"==typeof t,p=Array.isArray(t);if(u?d="number":h?d="string":p&&(d="array"),!d)return!1;p&&(c=t.length),h&&(c=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),i?c!==e.len&&o.push(a(r.messages[d].len,e.fullField,e.len)):s&&!l&&c<e.min?o.push(a(r.messages[d].min,e.fullField,e.min)):l&&!s&&c>e.max?o.push(a(r.messages[d].max,e.fullField,e.max)):s&&l&&(c<e.min||c>e.max)&&o.push(a(r.messages[d].range,e.fullField,e.min,e.max))},b=function(e,t,n,o,r){e[m]=Array.isArray(e[m])?e[m]:[],-1===e[m].indexOf(t)&&o.push(a(r.messages[m],e.fullField,e[m].join(", ")))},_=function(e,t,n,o,r){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||o.push(a(r.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(t)||o.push(a(r.messages.pattern.mismatch,e.fullField,t,e.pattern))))},x=function(e,t,n,o,r){var i=e.type,a=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t,i)&&!e.required)return n();f(e,t,o,a,r,i),s(t,i)||v(e,t,o,a,r)}n(a)},w={string:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t,"string")&&!e.required)return n();f(e,t,o,i,r,"string"),s(t,"string")||(v(e,t,o,i,r),y(e,t,o,i,r),_(e,t,o,i,r),!0===e.whitespace&&g(e,t,o,i,r))}n(i)},method:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),void 0!==t&&v(e,t,o,i,r)}n(i)},number:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),void 0!==t&&(v(e,t,o,i,r),y(e,t,o,i,r))}n(i)},boolean:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),void 0!==t&&v(e,t,o,i,r)}n(i)},regexp:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),s(t)||v(e,t,o,i,r)}n(i)},integer:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),void 0!==t&&(v(e,t,o,i,r),y(e,t,o,i,r))}n(i)},float:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),void 0!==t&&(v(e,t,o,i,r),y(e,t,o,i,r))}n(i)},array:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t,"array")&&!e.required)return n();f(e,t,o,i,r,"array"),s(t,"array")||(v(e,t,o,i,r),y(e,t,o,i,r))}n(i)},object:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),void 0!==t&&v(e,t,o,i,r)}n(i)},enum:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();f(e,t,o,i,r),t&&b(e,t,o,i,r)}n(i)},pattern:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t,"string")&&!e.required)return n();f(e,t,o,i,r),s(t,"string")||_(e,t,o,i,r)}n(i)},date:function(e,t,n,o,r){var i=[];if(e.required||!e.required&&o.hasOwnProperty(e.field)){if(s(t)&&!e.required)return n();if(f(e,t,o,i,r),!s(t)){var a=void 0;a="number"==typeof t?new Date(t):t,v(e,a,o,i,r),a&&y(e,a.getTime(),o,i,r)}}n(i)},url:x,hex:x,email:x,required:function(e,t,n,o,i){var a=[],s=Array.isArray(t)?"array":void 0===t?"undefined":(0,r.A)(t);f(e,t,o,a,i,s),n(a)}};function k(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var C=k();function S(e){this.rules=null,this._messages=C,this.define(e)}S.prototype={messages:function(e){return e&&(this._messages=d(k(),e)),this._messages},define:function(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==(void 0===e?"undefined":(0,r.A)(e))||Array.isArray(e))throw new Error("Rules must be an object");this.rules={};var t=void 0,n=void 0;for(t in e)e.hasOwnProperty(t)&&(n=e[t],this.rules[t]=Array.isArray(n)?n:[n])},validate:function(e){var t=this,n=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments[2];if("function"==typeof i&&(s=i,i={}),this.rules&&0!==Object.keys(this.rules).length){if(i.messages){var u=this.messages();u===C&&(u=k()),d(u,i.messages),i.messages=u}else i.messages=this.messages();var h=void 0,p=void 0,m={};(i.keys||Object.keys(this.rules)).forEach((function(r){h=t.rules[r],p=n[r],h.forEach((function(i){var a=i;"function"==typeof a.transform&&(n===e&&(n=(0,o.A)({},n)),p=n[r]=a.transform(p)),(a="function"==typeof a?{validator:a}:(0,o.A)({},a)).validator=t.getValidationMethod(a),a.field=r,a.fullField=a.fullField||r,a.type=t.getType(a),a.validator&&(m[r]=m[r]||[],m[r].push({rule:a,value:p,source:n,field:r}))}))}));var f={};!function(e,t,n,o){if(t.first){var r=function(e){var t=[];return Object.keys(e).forEach((function(n){t.push.apply(t,e[n])})),t}(e);return l(r,n,o)}var i=t.firstFields||[];!0===i&&(i=Object.keys(e));var a=Object.keys(e),s=a.length,c=0,d=[],u=function(e){d.push.apply(d,e),++c===s&&o(d)};a.forEach((function(t){var o=e[t];-1!==i.indexOf(t)?l(o,n,u):function(e,t,n){var o=[],r=0,i=e.length;function a(e){o.push.apply(o,e),++r===i&&n(o)}e.forEach((function(e){t(e,a)}))}(o,n,u)}))}(m,i,(function(e,t){var n=e.rule,s=!("object"!==n.type&&"array"!==n.type||"object"!==(0,r.A)(n.fields)&&"object"!==(0,r.A)(n.defaultField));function l(e,t){return(0,o.A)({},t,{fullField:n.fullField+"."+e})}function d(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(Array.isArray(r)||(r=[r]),r.length,r.length&&n.message&&(r=[].concat(n.message)),r=r.map(c(n)),i.first&&r.length)return f[n.field]=1,t(r);if(s){if(n.required&&!e.value)return r=n.message?[].concat(n.message).map(c(n)):i.error?[i.error(n,a(i.messages.required,n.field))]:[],t(r);var d={};if(n.defaultField)for(var u in e.value)e.value.hasOwnProperty(u)&&(d[u]=n.defaultField);for(var h in d=(0,o.A)({},d,e.rule.fields))if(d.hasOwnProperty(h)){var p=Array.isArray(d[h])?d[h]:[d[h]];d[h]=p.map(l.bind(null,h))}var m=new S(d);m.messages(i.messages),e.rule.options&&(e.rule.options.messages=i.messages,e.rule.options.error=i.error),m.validate(e.value,e.rule.options||i,(function(e){t(e&&e.length?r.concat(e):e)}))}else t(r)}s=s&&(n.required||!n.required&&e.value),n.field=e.field;var u=n.validator(n,e.value,d,e.source,i);u&&u.then&&u.then((function(){return d()}),(function(e){return d(e)}))}),(function(e){!function(e){var t,n=void 0,o=void 0,r=[],i={};for(n=0;n<e.length;n++)t=e[n],Array.isArray(t)?r=r.concat.apply(r,t):r.push(t);if(r.length)for(n=0;n<r.length;n++)i[o=r[n].field]=i[o]||[],i[o].push(r[n]);else r=null,i=null;s(r,i)}(e)}))}else s&&s()},getType:function(e){if(void 0===e.type&&e.pattern instanceof RegExp&&(e.type="pattern"),"function"!=typeof e.validator&&e.type&&!w.hasOwnProperty(e.type))throw new Error(a("Unknown rule type %s",e.type));return e.type||"string"},getValidationMethod:function(e){if("function"==typeof e.validator)return e.validator;var t=Object.keys(e),n=t.indexOf("message");return-1!==n&&t.splice(n,1),1===t.length&&"required"===t[0]?w.required:w[this.getType(e)]||!1}},S.register=function(e,t){if("function"!=typeof t)throw new Error("Cannot register a validator by type, validator is not a function");w[e]=t},S.messages=C;var M=S},75189:function(e){var t=/^(attrs|props|on|nativeOn|class|style|hook)$/;function n(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}}e.exports=function(e){return e.reduce((function(e,o){var r,i,a,s,l;for(a in o)if(r=e[a],i=o[a],r&&t.test(a))if("class"===a&&("string"==typeof r&&(l=r,e[a]=r={},r[l]=!0),"string"==typeof i&&(l=i,o[a]=i={},i[l]=!0)),"on"===a||"nativeOn"===a||"hook"===a)for(s in i)r[s]=n(r[s],i[s]);else if(Array.isArray(r))e[a]=r.concat(i);else if(Array.isArray(i))e[a]=[r].concat(i);else for(s in i)r[s]=i[s];else e[a]=o[a];return e}),{})}},64708:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(47499),_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__),D_code_ele_dynamic_form_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(22555),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(44114),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(98992),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3949),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(81454),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__),vue__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(50154),vue__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_5__),_utils_index__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(17427),_render_render_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(17780),_render_ruleTrigger_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(82632),_packages__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(87197);function buildListeners(e){const t=e.__config__,n=this.methods||{},o={};return Object.keys(n).forEach((e=>{o[e]=t=>n[e].call(this,t,this.form)})),o.input=n=>setValue.call(this,n,e,t),o}function setValue(e,t,n){this.$set(n,"defaultValue",e),this.$set(this.form,t.__vModel__,e),this.eventHub.emit(t.__vModel__,e)}function renderChildren(e,t){const n=t.__config__;return Array.isArray(n.children)?renderFormItem.call(this,e,n.children):null}Object.keys(_packages__WEBPACK_IMPORTED_MODULE_9__.A).map((e=>{vue__WEBPACK_IMPORTED_MODULE_5___default().component(e,_packages__WEBPACK_IMPORTED_MODULE_9__.A[e])}));const design={colFormItem(e,t){const n=t.__config__,o=buildListeners.call(this,t),{option:r={}}=this.$attrs,i=n.labelWidth||r.labelWidth;return e("el-col",{attrs:{span:n.span}},[e("el-form-item",{attrs:{"label-width":i?"".concat(i,"px"):"120px",prop:t.__vModel__,label:n.showLabel?n.label:""}},[e(_render_render_js__WEBPACK_IMPORTED_MODULE_7__.default,{attrs:(0,D_code_ele_dynamic_form_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_10__.A)({info:this.form,eventHub:this.eventHub,conf:(0,D_code_ele_dynamic_form_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_10__.A)((0,D_code_ele_dynamic_form_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_10__.A)({},t),{},{readonly:this.readonly})},this.$attrs),on:(0,D_code_ele_dynamic_form_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_10__.A)({},o)})])])},rowFormItem(e,t){let n=renderChildren.call(this,e,t);return"flex"===t.type&&(n=e("el-row",{attrs:{type:t.type,justify:t.justify,align:t.align}},[n])),e("el-col",{attrs:{span:t.span}},[e("el-row",{attrs:{gutter:t.gutter}},[n])])}};function renderFormItem(e,t){return t.map((t=>{const{__config__:{layout:n}}=t,o=design[n];if(o)return o.call(this,e,t);throw new Error("__config__里少了layout属性")}))}function renderFrom(e){const{configCopy:t,rules:n,readonly:o}=this,{option:r={}}=this.$attrs,{labelPosition:i,labelWidth:a,size:s}=r;return e("el-form",_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{ref:"elForm",attrs:{size:s,"label-position":i,disabled:o,"label-width":"".concat(a,"px")}},{props:{model:this.form}},{attrs:{rules:n}}]),[renderFormItem.call(this,e,t)])}__webpack_exports__.A={name:"el-dynamic-form",props:{formConfig:{type:Array,required:!0},formData:{type:Object,default:()=>{}},methods:{type:Object,default:()=>{}},readonly:{type:Boolean,default:!1}},data(){const e={form:{},rules:{},configCopy:(0,_utils_index__WEBPACK_IMPORTED_MODULE_6__.C)(this.formConfig),eventHub:new _utils_index__WEBPACK_IMPORTED_MODULE_6__.o_};return this.buildRules(e.configCopy,e.rules),e},watch:{formConfig:{handler:function(e){if(!e)throw"formConfig must be required";if(!Array.isArray(e))throw"formConfig must an Array"},immediate:!0},formData:{handler:function(e){if(void 0===e)return;const t=(0,_utils_index__WEBPACK_IMPORTED_MODULE_6__.C)(e);this.form=this.initFormData(this.configCopy,t)},immediate:!0,deep:!0}},methods:{initFormData(e,t){return e.map((e=>{const n=e.__config__,{defaultValue:o}=n;if(e.__vModel__&&o){if(t[e.__vModel__])return;t[e.__vModel__]=n.defaultValue}n.children&&this.initFormData(n.children,t)})),t},buildRules(fields,rules){fields.map((field=>{const config=field.__config__;if(Array.isArray(config.regList)){if(config.required){const e={required:config.required,message:field.placeholder};void 0===e.message&&(e.message="".concat(config.label,"不能为空")),config.regList.push(e)}rules[field.__vModel__]=config.regList.map((item=>(item.pattern&&(item.pattern=eval(item.pattern)),item.trigger=_render_ruleTrigger_js__WEBPACK_IMPORTED_MODULE_8__.A[config.tag]||"blur",item)))}config.children&&this.buildRules(config.children,rules)}))},submitForm(){return this.form},validate(e){return this.$refs.elForm.validate(e)}},render(e){return renderFrom.call(this,e)}}},5866:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(98992),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_esnext_iterator_every_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(23215),core_js_modules_esnext_iterator_every_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_esnext_iterator_every_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(81454),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__);const transOperator=e=>{let t;switch(e){case"add":t="+";break;case"multiply":t="*";break;case"minus":t="-";break;case"divide":t="/"}return t};__webpack_exports__.A={name:"InputComputed",data(){return{eventObject:{},operator:void 0,formatValue:""}},props:{value:{type:String,default:""},readonly:{type:Boolean,default:!1},calculationRules:{type:Object,default:void 0}},created(){const{relation:e,operator:t}=this.calculationRules;this.operator=t;const{eventHub:n}=this.$attrs;e&&t&&e.map((e=>{this.$set(this.eventObject,e,void 0),n.on(e,(t=>{console.log("".concat(e,"输入了").concat(t)),this.eventObject[e]=t,this.formatValue=this.computedValue(this.eventObject[e]),this.$emit("input",String(this.formatValue))}))}))},watch:{value:{handler(e){this.formatValue=e},deep:!0,immediate:!0}},methods:{computedValue(){const keys=Object.keys(this.eventObject),{operator:operator}=this;let value;const{formData:formData}=this.$attrs;keys.map((e=>{this.eventObject[e]||(this.eventObject[e]=formData[e])}));const allHaveValue=keys.every((e=>this.eventObject[e]));if(allHaveValue){let str="";operator.map((e=>{str+="".concat(this.eventObject[e.value]).concat(e.operator?transOperator(e.operator):"")}));try{value=eval(str)}catch(e){value=NaN}}else value=this.formatValue;return value}},beforeDestroy(){const{relation:e}=this.calculationRules,{eventHub:t}=this.$attrs;e&&e.map((e=>{t.off(e)}))},render(){return(0,arguments[0])("el-input",{attrs:{value:this.formatValue,placeholder:"请输入内容"},on:{input:e=>{this.formatValue=e,this.$emit("input",e)}}})}}},87197:function(e,t,n){"use strict";n.d(t,{A:function(){return Qt}});var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-cascader",{ref:"areaCode",attrs:{"popper-class":e.checkStrictly?"":"area-code",disabled:e.disabled,placeholder:e.placeholder,options:e.areaList,clearable:e.clearable,size:e.size,props:{checkStrictly:e.checkStrictly,label:"name",value:"code",children:"child",multiple:e.multiple},"show-all-levels":!1},on:{change:e.handleChange},model:{value:e.convertedVal,callback:function(t){e.convertedVal=t},expression:"convertedVal"}})],1)};o._withStripped=!0,n(44114),n(98992),n(54520),n(3949),n(81454),n(62953);var r={name:"AreaCode",props:{disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},isChange:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择"},value:{type:[Array,Object],default:()=>[]},appId:{type:String,default:""},checkStrictly:{type:Number,default:1},level:{type:Array,default:()=>[3,5]},rangeArr:{type:Array,default:()=>[]},size:{type:String,default:"—"}},data(){return{areaList:[]}},mounted(){const{level:e,rangeArr:t}=this,[n,o]=e,r=t.map((e=>e[e.length-1])),{option:{api:i}}=this.$attrs;if(i){const{getAreaTree:e}=i;e&&e({maxLevel:o,minLevel:n,rootAreaCodes:r}).then((e=>{this.areaList=e.data||[]}))}},computed:{convertedVal(){const{value:e,$attrs:t,multiple:n}=this;let o=[];if(n)o=e.map((e=>e.map((e=>e.value))));else{const n=t.convertedVal?t.convertedVal[0]:[],r=e[0]?e[0]:n;r&&r.forEach((e=>{o.push(e.value)}))}return o}},methods:{handleChange(e){const{multiple:t}=this,n=this.$refs.areaCode.getCheckedNodes();let o=[];if(t){const t=e.length;if(t<n.length){const r=t?e[0].length-1:0,i=t?n.filter(((t,n)=>t.path[r]===e[n][r])).map((e=>{let{label:t,value:n}=e;return{label:t,value:n}})):void 0;i&&o.push(i)}else n.forEach((e=>{const t=e.pathNodes.map((e=>{let{label:t,value:n}=e;return{label:t,value:n}}));o.push(t)}))}else o=n.length?n[0].pathNodes.map((e=>{let{label:t,value:n}=e;return{label:t,value:n}})):[];const r=o.length?t?[...o]:[o]:[];this.$emit("input",r),this.$emit("change",r)}}},i=(n(84579),n(14486)),a=(0,i.A)(r,o,[],!1,null,null,null);a.options.__file="src/packages/AreaCode.vue";var s=a.exports,l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{staticStyle:{width:"100%"},attrs:{"value-key":"value",multiple:e.multiple,disabled:e.disabled,filterable:"",clearable:"","popper-class":"popper",placeholder:e.placeholder,"filter-method":e.filterOption},on:{change:e.handleChangeTree},model:{value:e.innerValue,callback:function(t){e.innerValue=t},expression:"innerValue"}},e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{value:e,label:e.label+(e.describe?"("+e.describe+")":"")}})})),1)};l._withStripped=!0;var c=n(17427),d={name:"BizRelation",props:{disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择"},value:{type:[Array,Object],default:()=>[]},eventCode:{type:String,default:""},viewCode:{type:String,default:""},idField:{type:String,default:""},nameField:{type:String,default:""},descField:{type:Array,default:()=>[]}},data(){return{treeData:[],innerValue:[],options:[]}},watch:{eventCode(e){e&&this.fetchOptions(this)},viewCode(e){e&&this.fetchOptions(this)},value:{handler(e){this.multiple?this.innerValue=e:this.innerValue=Array.isArray(e)&&e[0]},immediate:!0,deep:!0}},created(){const{eventCode:e,viewCode:t,idField:n,nameField:o,descField:r}=this,i=[];if(e){const a=this.getApi();a&&a(e,{viewCode:t,idField:n,nameField:o,descField:r,columns:i,pageNum:1,pageSize:999}).then((e=>{200===e.code&&(this.options=r?e.data.list.map((e=>({key:e.id,label:e.name,value:e.id,describe:e.describe}))):e.data.list.map((e=>({key:e.id,label:e.name,value:e.id}))))}))}},methods:{getApi(){const{option:{api:e}}=this.$attrs;if(!e)return!1;const{getBizList:t}=e;return t||!1},fetchOptions:(0,c.sg)((e=>{const{eventCode:t,viewCode:n,idField:o,nameField:r,descField:i}=e;if(!(t&&n&&o&&r))return;e.options=[];const a=e.getApi();a&&a(t,{viewCode:n,idField:o,nameField:r,descField:i,columns:[],pageNum:1,pageSize:999}).then((t=>{200===t.code&&(e.options=i?t.data.list.map((e=>({key:e.id,label:e.name,value:e.id,describe:e.describe}))):t.data.list.map((e=>({key:e.id,label:e.name,value:e.id}))))}))}),500),handleChangeTree(){let e;e=this.multiple?this.innerValue:[this.innerValue],this.$emit("input",e),this.$emit("change",e)},filterOption(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0}}},u=n(85072),h=n.n(u),p=n(97825),m=n.n(p),f=n(77659),g=n.n(f),v=n(55056),y=n.n(v),b=n(10540),_=n.n(b),x=n(41113),w=n.n(x),k=n(74986),C={};C.styleTagTransform=w(),C.setAttributes=y(),C.insert=g().bind(null,"head"),C.domAPI=m(),C.insertStyleElement=_(),h()(k.A,C),k.A&&k.A.locals&&k.A.locals;var S=(0,i.A)(d,l,[],!1,null,"07d5d274",null);S.options.__file="src/packages/BizRelation.vue";var M=S.exports,T=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",{staticStyle:{width:"100%"},attrs:{"value-key":"value",multiple:e.multiple,disabled:e.disabled,filterable:"",clearable:"","popper-class":"popper",placeholder:e.placeholder,"filter-method":e.filterOption},on:{change:e.handleChangeTree},model:{value:e.innerValue,callback:function(t){e.innerValue=t},expression:"innerValue"}},e._l(e.options,(function(e){return n("el-option",{key:e.value,attrs:{value:e,label:e.label}})})),1)};T._withStripped=!0;var D={name:"ByDictSelect",props:{disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择"},value:{type:[Array,Object],default:()=>[]},dictType:{type:String,default:""}},data(){return{treeData:[],innerValue:[],options:[],params:void 0}},watch:{dictType(e){e&&this.fetchOptions(this)},value:{handler(e){this.multiple?this.innerValue=e:this.innerValue=Array.isArray(e)&&e[0]},immediate:!0,deep:!0}},created(){const{dictType:e}=this;if(e){const t=this.getApi();t&&t({dictType:e}).then((e=>{200===e.code&&(this.options=e.data.map((e=>({label:e.dictLabel,value:e.dictValue,key:e.dictValue}))))}))}},methods:{getApi(){const{option:{api:e}}=this.$attrs;if(!e)return!1;const{getOptionsByDict:t}=e;return t},fetchOptions:(0,c.sg)((e=>{const{dictType:t}=e,n=e.getApi();n&&n({dictType:t}).then((t=>{200===t.code&&(e.options=t.data.map((e=>({label:e.dictLabel,value:e.dictValue,key:e.dictValue}))))}))}),500),handleChangeTree(){let e;e=this.multiple?this.innerValue:[this.innerValue],this.$emit("input",e),this.$emit("change",e)},filterOption(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0}}},A=n(68034),L={};L.styleTagTransform=w(),L.setAttributes=y(),L.insert=g().bind(null,"head"),L.domAPI=m(),L.insertStyleElement=_(),h()(A.A,L),A.A&&A.A.locals&&A.A.locals;var E=(0,i.A)(D,T,[],!1,null,"ded2a2fc",null);E.options.__file="src/packages/ByDictSelect.vue";var O=E.exports,N=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-cascader",{ref:"DataCascader",attrs:{multiple:e.multiple,disabled:e.disabled,placeholder:e.placeholder,options:e.options,clearable:e.clearable,size:e.size,props:{multiple:e.multiple,checkStrictly:e.checkStrictly}},on:{change:e.handleChange},model:{value:e.convertedVal,callback:function(t){e.convertedVal=t},expression:"convertedVal"}}),e._v(" "),e.isShowData&&e.dataVal?n("el-statistic",{staticStyle:{display:"inline-block"},attrs:{value:e.dataVal}},[n("template",{slot:"suffix"},[e._v(e._s(e.$attrs.unit))])],2):e._e()],1)};N._withStripped=!0;const P=["children"];var Y={name:"DataCascader",props:{disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},isChange:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择"},value:{type:[Array,Object],default:()=>[]},appId:{type:String,default:""},options:{type:Array,default:()=>[]},checkStrictly:{type:Boolean,default:!1},size:{type:String,default:"—"},isData:{type:Boolean,default:!1}},data(){return{dataVal:0}},computed:{convertedVal:{get(){const{value:e,multiple:t}=this,n=e.map((e=>e.map((e=>{let{value:t}=e;return t}))));return e[0]&&e[0][0]&&this.setDataVal(),t?n:n[0]},set(e){return e}},isShowData(){return this.isData}},methods:{setDataVal(){if(this.isData){const{value:e}=this,t=[];e.forEach((e=>{const n=e[e.length-1].extraValue;Number(n)&&t.push(Number(n))}));let n=0;t.forEach((e=>n+=e)),this.dataVal=n}},handleChange(e){const{multiple:t}=this,n={};this.$refs.DataCascader.getCheckedNodes(!this.checkStrictly).map((e=>{let{pathNodes:t}=e;return t})).forEach((e=>{e.forEach((e=>{let{value:t,data:o}=e;const{children:r}=o,i=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(o,P);n[t]=i}))})),e.length?this.setDataVal():this.dataVal=0;const o=t?(0,c.C)(e):[(0,c.C)(e)];o.forEach((e=>{e.forEach(((t,o)=>{e[o]=n[t]}))})),this.$emit("input",o),this.$emit("change",o)}}},I=(0,i.A)(Y,N,[],!1,null,null,null);I.options.__file="src/packages/DataCascader.vue";var R=I.exports,j=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-date-picker",{attrs:{type:"datetimerange","range-separator":"~","default-time":["00:00:00","23:59:59"],"start-placeholder":"开始日期","end-placeholder":"结束日期",format:e.dateFormat},on:{input:e.handleChange},model:{value:e.convertedVal,callback:function(t){e.convertedVal=t},expression:"convertedVal"}}),e._v(" "),n("span",{staticClass:"days"},[e._v(e._s(e.unitStr)+"数:"+e._s(e.value.days||"无"))])],1)};j._withStripped=!0;var H=n(95093),B=n.n(H),F={name:"DateDays",props:{disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},isChange:{type:Boolean,default:!1},placeholder:{type:String,default:"请选择"},value:{type:[Array,Object],default:()=>[]},checks:{type:Array,default:()=>["工作日"]},unit:{type:String,default:"day"},hasWorkTime:{type:Boolean,default:!1},workingDate:{type:Array,default:()=>[new Date(0,0,0,8,0,0),new Date(0,0,0,17,0,0)]},checkStrictly:{type:Boolean,default:!1},size:{type:String,default:"—"}},computed:{convertedVal:{get(){const{start:e,end:t}=this.value;return this.value?[e,t]:this.value},set(e){return e}},unitStr(){return"hour"===this.unit?"小时":"天"},dateFormat(){return"yyyy-MM-dd HH:mm:ss"}},methods:{getApi(){const{option:{api:e}}=this.$attrs;if(!e)return!1;const{calculateWorkTime:t}=e;return t},async handleChange(e){let t,[n,o]=e;if(console.log(B()(n).format("YYYY-MM-DD HH:mm:ss"),B()(o).format("YYYY-MM-DD HH:mm:ss")),n&&o){const{workingDate:e,checks:r,hasWorkTime:i}=this,a=B()(n).format("YYYY-MM-DD HH:mm:ss"),s=B()(o).format("YYYY-MM-DD HH:mm:ss"),l={hasWorkTime:i,workTime:e,start:a,end:s,hasWorkDay:!1,hasNotWorkDay:!1,unit:this.unit};r.includes("工作日")&&(l.hasWorkDay=!0),r.includes("非工作日")&&(l.hasNotWorkDay=!0);const c=this.getApi();this.convertedVal=[n,o];try{t={days:(await c(l)).data,start:a,end:s}}catch(e){t={days:0,start:B()(n).format("YYYY-MM-DD HH:mm:ss"),end:B()(o).format("YYYY-MM-DD HH:mm:ss")}}}else t={days:0,start:void 0,end:void 0};this.$emit("input",t),this.$emit("change",t)}}},$=n(85587),z={};z.styleTagTransform=w(),z.setAttributes=y(),z.insert=g().bind(null,"head"),z.domAPI=m(),z.insertStyleElement=_(),h()($.A,z),$.A&&$.A.locals&&$.A.locals;var V=(0,i.A)(F,j,[],!1,null,"6dab321e",null);V.options.__file="src/packages/DateDays.vue";var W=V.exports,U=function(){var e=this,t=e.$createElement;return(e._self._c||t)("p",{style:{color:e.color,"text-align":e.textAlign}},[e._v(e._s(e.value))])};U._withStripped=!0;var Z={name:"DescText",props:{value:{type:String,default:""},color:{type:String,default:"#000000"},textAlign:{type:String,default:"left"}}},q=(0,i.A)(Z,U,[],!1,null,null,null);q.options.__file="src/packages/DescText.vue";var G=q.exports,K=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-input-number",{staticStyle:{width:"50%"},attrs:{step:.5,placeholder:e.placeholder,disabled:e.disabled},on:{change:e.handleChange},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}}),e._v(" "),n("el-select",{attrs:{slot:"append",placeholder:"请选择",disabled:e.disabled},on:{change:e.handleChange},slot:"append",model:{value:e.unit,callback:function(t){e.unit=t},expression:"unit"}},[n("el-option",{attrs:{label:"天",value:"D"}}),e._v(" "),n("el-option",{attrs:{label:"小时",value:"H"}}),e._v(" "),n("el-option",{attrs:{label:"分钟",value:"M"}})],1)],1)};K._withStripped=!0;var J={name:"Duration",props:{disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"请输入审批时限"},value:{type:Object}},data(){return{time:void 0,unit:"D"}},watch:{value:{handler:function(e){const{time:t,unit:n}=e||{};t||n?(this.time=t,this.unit=n):(this.time=void 0,this.unit="D")},immediate:!0}},methods:{async handleChange(){const[e,t]=[this.time,this.unit];this.$emit("input",{time:e,unit:t})}}},X=(0,i.A)(J,K,[],!1,null,null,null);X.options.__file="src/packages/Duration.vue";var Q=X.exports,ee=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-autocomplete",{staticStyle:{width:"100%"},attrs:{"popper-class":"my-autocomplete",disabled:e.disabled,type:"textarea",rows:3,"fetch-suggestions":e.querySearch,placeholder:e.placeholder,clearable:e.clearable},on:{change:e.handleChange,select:e.handleSelect},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return o?[n("div",{class:["name",e.state.includes(o.value)?"selected":""]},[e._v(e._s(o.value))])]:void 0}}],null,!0),model:{value:e.state,callback:function(t){e.state=t},expression:"state"}})};ee._withStripped=!0;var te={name:"Feedback",props:{disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},placeholder:{type:String,default:"请输入内容"},value:{type:String,default:""},options:{type:Array,default:()=>[]}},data(){return{optionsList:[],confOpts:null,cascaderVisiable:!0,state:this.value,isSelect:!1}},watch:{state(e,t){this.isSelect&&e!==t&&(this.state=t+"".concat(t?",":"")+e,this.isSelect=!1)}},methods:{querySearch(e,t){const n=[];this.options.forEach((e=>{e.value&&n.push(e)})),t(n)},handleSelect(e){console.log(this.state,this.value);let t=0;if(this.options.forEach((e=>{e.value&&this.value.includes(e.value)&&t++})),t>=3)return this.$message.warning("最多支持选择3条!"),void(this.state=this.value);this.isSelect=!0,this.$nextTick((()=>{this.$emit("input",this.state),this.$emit("change",this.state)}))},handleChange(e){this.$emit("input",e),this.$emit("change",e)}}},ne=n(54434),oe={};oe.styleTagTransform=w(),oe.setAttributes=y(),oe.insert=g().bind(null,"head"),oe.domAPI=m(),oe.insertStyleElement=_(),h()(ne.A,oe),ne.A&&ne.A.locals&&ne.A.locals;var re=(0,i.A)(te,ee,[],!1,null,null,null);re.options.__file="src/packages/Feedback.vue";var ie=re.exports,ae=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-input",{ref:"main",attrs:{clearable:e.disabled,disabled:e.disabled,placeholder:e.placeholder},on:{clear:e.handleClear,focus:e.handleShow},model:{value:e.address,callback:function(t){e.address=t},expression:"address"}}),e._v(" "),e.value?n("p",[e._v("\n 纬度:"+e._s(e.value.latitude)+"   经度:"+e._s(e.value.longitude)+"\n ")]):e._e(),e._v(" "),n("el-dialog",{attrs:{visible:e.box,"append-to-body":"",title:"选择位置",width:"80%"},on:{"update:visible":function(t){e.box=t},close:e.handleClose}},[e.box?n("div",[n("div",{staticClass:"input-box",staticStyle:{position:"relative"}},[n("el-input",{staticClass:"input-map-content-input",attrs:{id:"map__input",readonly:e.disabled,clearable:"",placeholder:"输入关键字选取地点"},on:{clear:e.clear,input:e.querySearch},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSearch.apply(null,arguments)}},model:{value:e.address,callback:function(t){e.address=t},expression:"address"}},[n("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.handleSearch},slot:"append"})],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.visibleSuggest,expression:"visibleSuggest"}],staticClass:"Suggest_suggests__E1VWl"},[e.fetching?n("span",{attrs:{size:"small"}},[e._v("加载中"),n("i",{staticClass:"el-icon-loading"})]):e._l(e.suggestArr,(function(t,o){return n("div",{key:o,staticClass:"Suggest_liItem__UATyw",on:{click:function(n){return e.handleSelectSug(t.name)}}},[n("span",{staticClass:"anticon anticon-search",attrs:{role:"img","aria-label":"search"}},[n("i",{staticClass:"el-icon-search"})]),e._v(" "),n("span",{staticClass:"Suggest_name__d+lUa",domProps:{innerHTML:e._s(t.nameStr)}}),e._v(" "),n("span",{staticClass:"Suggest_address__e0ul6"},[e._v(e._s(t.address))])])}))],2),e._v(" "),n("div",{staticClass:"input-map-content-container",attrs:{id:"map__container",tabindex:"0"}}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.visibleResult,expression:"visibleResult"}],staticClass:"input-map-content-result",attrs:{id:"map__result"}},e._l(e.resultArr,(function(t,o){return n("div",{key:o,staticClass:"poibox",on:{click:function(n){return e.showPosition(t)}}},[n("h3",{staticClass:"poi-title"},[n("i",{staticClass:"el-icon-location-outline",staticStyle:{color:"#1890FF"}}),e._v(" "),n("span",{staticClass:"poi-name amap-ellipsis"},[e._v(e._s(t.name))])]),e._v(" "),n("div",{staticClass:"poi-info"},[n("p",{staticClass:"poi-addr amap-ellipsis"},[e._v("地址:"+e._s(t.address))]),e._v(" "),n("p",{staticClass:"poi-tel amap-ellipsis"},[e._v("电话:"+e._s(t.phone))])])])})),0)],1)]):e._e(),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e.disabled?e._e():n("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("确 定")])],1)])],1)};ae._withStripped=!0;var se=n(22555);n(27495),n(25440),n(12041);const le=()=>new Promise((e=>{if(window.T)e(window.T);else{(()=>{const e=document.createElement("script");e.charset="utf-8",e.src="http://api.tianditu.gov.cn/api?v=4.0&tk=458b757eee944290645a95d7c34b7b90",document.head.appendChild(e)})();const t=setInterval((()=>{window.T&&(clearInterval(t),e(window.T))}),50)}}));le();var ce={name:"InputMap",props:{disabled:{type:Boolean,default:!1},value:{type:Object,default:()=>{}},placeholder:{type:String,default:"请选择"}},data(){return{address:"",poi:{},text:"",marker:null,map:null,geocode:null,box:!1,fetching:!1,isSelect:!1,localsearch:null,resultArr:[],suggestArr:[],visibleSuggest:!1,visibleResult:!1,bounds:null}},watch:{poi(e){this.address=e.address},value:{handler:function(e){e?this.address=e.address:this.poi={}},immediate:!0,deep:!0},text(e){e&&(this.poi=(0,se.A)({},e),this.address=e.address)},box:{handler(){this.box&&this.$nextTick((()=>this.init()))}}},methods:{clear(){this.poi={},this.visibleResult=!1,this.map.clearOverLays()},handleSubmit(){this.setVal(),this.$emit("input",this.text),this.visibleResult=!1,this.box=!1},handleClear(){this.text={},this.poi={}},setVal(){const{address:e,formattedAddress:t,longitude:n,latitude:o,county:r}=this.poi;this.text={address:e||t,longitude:n,latitude:o,county:r}},handleShow(){this.$refs.main.blur(),this.box=!0},handleClose(){this.box=!1,this.$emit("blur",{value:this.value})},showPosition(e){const{marker:t,winHtml:n,name:o,address:r,longitude:i,latitude:a}=e,s=new window.T.InfoWindow(n,{autoPan:!0});this.map.panTo(new window.T.LngLat(i,a),17),t.openInfoWindow(s),this.isSelect=!0,this.address=r,this.poi={address:o,longitude:i,latitude:a}},querySearch(e){this.isSelect?this.isSelect=!1:e?(this.fetching=!0,this.localsearch.search(e,4)):this.visibleSuggest=!1},handleSearch(){this.map.clearOverLays(),this.visibleSuggest=!1,this.localsearch.searchInBounds(this.address,this.bounds)},handleSelectSug(e){this.visibleSuggest=!1,this.isSelect=!0,this.address=e,this.handleSearch()},suggests(e){if(e){const t=[];for(let n=0;n<e.length;n++){const{name:o,address:r}=e[n],i=o.replaceAll(this.address,"$".concat(this.address,"$")).split("$");let a="";i.forEach((e=>{a+=e===this.address?'<span style="color: #3385ff;">'.concat(e,"</span>"):e})),t.push({name:o,nameStr:a,address:r})}this.suggestArr=t,this.visibleSuggest=!0}},pois(e){if(e){const t=[],n=[];for(let o=0;o<e.length;o++){const{name:r,address:i,phone:a,lonlat:s}=e[o],[l,c]=s.split(","),d=new window.T.LngLat(l,c),u="名称:"+r+"<br/>地址:"+i,h=new window.T.Marker(d);this.map.addOverLay(h);let p=new window.T.InfoWindow(u,{autoPan:!0});h.addEventListener("click",(()=>{h.openInfoWindow(p)})),t.push(d),n.push({name:r,address:i,phone:a,marker:h,winHtml:u,longitude:l,latitude:c})}this.resultArr=n,this.visibleResult=!0,this.map.setViewport(t)}},MapClick(e){this.map.clearOverLays();const{lng:t,lat:n}=e.lnglat,o=window.T&&new window.T.Marker(new window.T.LngLat(t,n));this.map.addOverLay(o),this.geocode.getLocation(e.lnglat,(e=>{if(0==e.getStatus()){const{county_code:o}=e.getAddressComponent().addressComponent,r=e.getAddress(),i=o.slice(3);this.isSelect=!0,this.address=r,this.poi={address:r,longitude:t,latitude:n,county:i}}}))},init(){le().then((e=>{console.log("地图加载成功",e);const{option:{config:t}}=this.$attrs;if(!t)return;const{VUE_APP_MAP_BOUNDS:n}=t;this.bounds=new e.LngLatBounds(new e.LngLat(...n[0]),new e.LngLat(...n[1])),this.map=new e.Map("map__container"),this.geocode=new e.Geocoder,this.map.addEventListener("click",this.MapClick);const{longitude:o,latitude:r}=this.value||{},i=o?[o,r]:[121.01106,30.67934];this.map.centerAndZoom(new e.LngLat(...i),this.value?16:13);const a={pageCapacity:10,onSearchComplete:e=>{this.fetching=!1,console.log("result>>>>>",e,e.getResultType()),"4"===e.getResultType()?this.suggests(e.getSuggests()):this.pois(e.getPois())}};this.localsearch=new e.LocalSearch(this.map,a);const s=new e.Marker(new e.LngLat(o,r));this.map.addOverLay(s)}),(e=>{console.log("地图加载失败",e)}))}}},de=(n(25661),(0,i.A)(ce,ae,[],!1,null,"740240aa",null));de.options.__file="src/packages/InputMap.vue";var ue=de.exports,he=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"tree-box"},[n("el-select",{ref:"treeSelect",staticStyle:{width:"100%"},attrs:{clearable:!0,placeholder:e.placeholder,multiple:e.multiple,filterable:"","filter-method":e.filterable},on:{clear:e.handleClear,"remove-tag":e.handleRemoveTag},model:{value:e.valueLabel,callback:function(t){e.valueLabel=t},expression:"valueLabel"}},[n("el-option",{attrs:{hidden:"",value:"value",label:"label"}}),e._v(" "),n("el-tree",{ref:"treeSelectTree",attrs:{accordion:!0,data:e.treeData,props:e.props,"node-key":e.props.value,"highlight-current":!e.multiple,"show-checkbox":e.multiple,"check-strictly":!0,load:e.loadNode,lazy:!0,"filter-node-method":e.filterNode},on:{"node-click":e.handleNodeClick,check:e.handleNodeCheckbox}})],1)],1)};he._withStripped=!0,n(72577);var pe={name:"OrgTreeSelect",props:{disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},limits:{type:[Array,Boolean],default:!1},placeholder:{type:String,default:"请选择"},value:{type:[Array],default:()=>[]},multiple:{type:Boolean,default:!0}},data(){return{valueLabel:[],treeData:[],checkedNodes:[],props:{value:"value",label:"label",children:"children",isLeaf:"isLeaf"},multipleLimit:15}},watch:{value:{handler(e,t){e!==t&&this.init()}}},mounted(){this.init()},methods:{init(){Array.isArray(this.value)?this.checkedNodes=this.value:this.checkedNodes=[],this.multiple?this.checkedNodes.map((e=>{this.$refs.treeSelectTree.setChecked(e.deptCode,!0,!1)})):this.$refs.treeSelectTree.setCurrentKey(this.checkedNodes.length>0?this.checkedNodes[0]:void 0),this.initValueLabel()},initValueLabel(){const e=this.checkedNodes.map((e=>e.label));this.multiple?this.valueLabel=e:this.valueLabel=e.length>0?e[0]:void 0},handleClear(){this.valueLabel=[],this.checkedNodes=[],this.multiple?this.$refs.treeSelectTree.setCheckedKeys([]):this.$refs.treeSelectTree.setCurrentKey(null),this.$emit("input",this.checkedNodes)},handleNodeClick(e,t){this.multiple||(this.checkedNodes=[e],this.valueLabel=e.label),t.childNodes&&(t.expanded=!0),this.$emit("input",this.checkedNodes)},handleNodeCheckbox(e,t){const{checkedNodes:n}=t;this.multiple&&(this.multipleLimit>=n.length?(this.checkedNodes=n,this.valueLabel=n.map((e=>e.label))):(this.$refs.treeSelectTree.setChecked(e,!1,!0),this.$message.error("最多选择"+this.multipleLimit+"项"))),this.$emit("input",this.checkedNodes)},handleRemoveTag(e){const t=this.checkedNodes.find((t=>t.label===e));t&&this.$refs.treeSelectTree.setChecked(t.value,!1,!0),this.checkedNodes=this.$refs.treeSelectTree.getCheckedNodes(),this.$emit("input",this.checkedNodes)},loadNode(e,t){if(0===e.level&&this.getOrgData(void 0,t),e.level>=1){const{data:{deptCode:n}}=e;this.getOrgData(n,t)}},getOrgData(e,t){const{option:{api:n,config:o}}=this.$attrs;if(!n)return;const{getOrgTree:r}=n;r&&r({parentCode:e||o.VUE_APP_DEPTCODE}).then((e=>{const n=e.data.map((e=>({deptName:2===e.level?e.parentName+e.deptName:e.deptName,deptCode:e.deptCode,deptPath:e.path,label:2===e.level?e.parentName+e.deptName:e.deptName,value:e.deptCode,isLeaf:e.leaf,children:[],id:e.id})));t(n)}))},filterNode(e,t){return!e||-1!==t[this.props.label].indexOf(e)},filterable:(0,c.sg)((function(e){this.multiple&&this.$refs.treeSelectTree.filter(e)}),500)}},me=pe,fe=(0,i.A)(me,he,[],!1,null,null,null);fe.options.__file="src/packages/OrgTreeSelect.vue";var ge=fe.exports,ve=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-button",{attrs:{size:"mini",disabled:e.readonly||e.disabled,icon:"el-icon-plus",type:"primary",round:""},on:{click:e.selectOrg}},[e._v(e._s(e.placeholder))]),e._v(" "),n("org-items",{attrs:{value:e.value,closable:!e.disabled},on:{remove:function(t){return e.$emit("input",e.value)}}}),e._v(" "),n("org-picker",e._b({ref:"orgPicker",attrs:{title:"请选择",selected:e.value,type:"user",multiple:e.multiple},on:{ok:e.selected}},"org-picker",e.$attrs,!1))],1)};ve._withStripped=!0;var ye=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.title,width:"800px",visible:e.visible,modal:!1},on:{"update:visible":function(t){e.visible=t}}},["请选择可发起本审批的部门"===e.title?n("el-form-item",{attrs:{labelCol:{span:3},label:"部门权限"}},[n("el-radio-group",{model:{value:e.scope,callback:function(t){e.scope=t},expression:"scope"}},[n("el-radio",{attrs:{label:"本级"}},[e._v("本级")]),e._v(" "),n("el-radio",{attrs:{label:"本级及以下"}},[e._v("本级及以下")])],1)],1):e._e(),e._v(" "),n("div",{staticClass:"picker"},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"candidate"},[n("div",[n("el-input",{staticStyle:{width:"90%"},attrs:{size:"small",clearable:"",placeholder:"org"===e.type?"输入搜索":"dept"===e.type?"搜索部门":"post"===e.type?"搜索岗位":"搜索人员","prefix-icon":"el-icon-search"},on:{input:e.searchUser,clear:e.clearOptions},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),e._v(" "),n("span",{staticStyle:{float:"right","margin-top":"5px",color:"#38adff"},on:{click:e.clearOptions}},[e._v("重置")]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.showUsers,expression:"!showUsers"}]},[n("ellipsis",{staticStyle:{color:"#8c8c8c",padding:"5px 0 0"},attrs:{"hover-tip":"",row:1,length:15,tooltip:"",content:e.deptStackStr}},[n("i",{staticClass:"el-icon-office-building"})]),e._v(" "),n("div",{staticStyle:{"margin-top":"5px"}},[n("el-checkbox",{attrs:{disabled:!e.multiple},on:{change:e.handleCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v("全选")]),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.deptStack.length>0,expression:"deptStack.length > 0"}],staticClass:"