UNPKG

el-dynamic-form

Version:

ele form pingshu dynamic

2 lines 2.48 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__154__){return function(){var __webpack_modules__={7499: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 r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)}var n=["attrs","props","domProps"],r=["class","style","directives"],o=["on","nativeOn"],a=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}};e.exports=function(e){return e.reduce((function(e,i){for(var c in i)if(e[c])if(-1!==n.indexOf(c))e[c]=t({},e[c],i[c]);else if(-1!==r.indexOf(c)){var s=e[c]instanceof Array?e[c]:[e[c]],u=i[c]instanceof Array?i[c]:[i[c]];e[c]=[].concat(s,u)}else if(-1!==o.indexOf(c))for(var l in i[c])if(e[c][l]){var d=e[c][l]instanceof Array?e[c][l]:[e[c][l]],f=i[c][l]instanceof Array?i[c][l]:[i[c][l]];e[c][l]=[].concat(d,f)}else e[c][l]=i[c][l];else if("hook"===c)for(var p in i[c])e[c][p]=e[c][p]?a(e[c][p],i[c][p]):i[c][p];else e[c]=i[c];else e[c]=i[c];return e}),{})}},4708:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var _vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7499),_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_14__=__webpack_require__(2555),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7495),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(2953),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(4114),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8992),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(4520),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_esnext_iterator_find_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(2577),core_js_modules_esnext_iterator_find_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_esnext_iterator_find_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(3949),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(1454),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_8__),vue__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(154),vue__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_9__),_utils_index__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(7427),_render_render_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(7780),_render_ruleTrigger_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(2632),_packages__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(2516);function hiddenAndShow(e,t){let n,r,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];console.log(a);const{typeId:i}=t;if("RADIO"===i||"string"==typeof e)n=e,a.length?(o=e?"=":"-",r=a):o="+";else{const t=e.map((e=>e.value)),c=a.map((e=>e.value));a.length>e.length?(o="-","CHECKBOX"===i?n=a.filter((t=>!e.includes(t)))[0]:"SELECT_V2"===i&&(n=c.filter((e=>!t.includes(e)))[0])):a.length===e.length?(o="=",n=t[0],r=c[0]):(o="+","CHECKBOX"===i?n=e[e.length-1]:"SELECT_V2"===i&&(n=t[t.length-1]))}const c=t.__vModel__+"$"+n+"^"+t.typeId,s=this.formRules.map((e=>e.opsRules.filter((e=>e)).map((e=>e.split("$")[0]+"$"+e.split("$")[1])).join("/"))).join("/"),u=this.formRules.map((e=>e.opsRules.filter((e=>e)).map((e=>e.split("$")[2])).join("$"))).join("$"),l=(0,_utils_index__WEBPACK_IMPORTED_MODULE_10__.C)(this.configCopy),d=l.map((e=>e.__vModel__)),f=(0,_utils_index__WEBPACK_IMPORTED_MODULE_10__.C)(this.form),p=s.split("/");function m(e,t,n){e.forEach((e=>{if(s.includes(e)&&p.forEach(((r,o)=>{r.includes(e)&&m(u.split("$")[o].split("&"),t,n)})),t.formConfig.forEach((t=>{t.__vModel__===e&&(t.__config__.defaultValue=void 0)})),n){const n=d.indexOf(e);n>=0&&(d.splice(n,1),delete f[e],delete t.rules[e])}else delete f[e],delete t.rules[e]}))}let h,g;if("="===o&&(h=t.__vModel__+"$"+r+"^"+t.typeId,s.includes(h))){const e=s.split("/").indexOf(h);m(u.split("$")[e].split("&"),this,!0)}if(s.includes(c)){const e=s.split("/").indexOf(c),t=u.split("$")[e].split("&");if("+"===o||"="===o){const e=[...d,...t],n=this.formConfig.filter((t=>e.includes(t.__vModel__))),r={};l.forEach((e=>r[e.__vModel__]=e)),g=n.map((e=>{const t=r[e.__vModel__];return"Table_List"===e.typeId&&(e.__config__.defaultValue=(0,_utils_index__WEBPACK_IMPORTED_MODULE_10__.C)(this.formData[e.__vModel__])),t||e}));const o={};t.forEach((e=>{const t=this.formConfig.filter((t=>t.__vModel__===e))[0];t&&(o[e]=t.__config__.defaultValue)})),t.forEach((e=>f[e]=o[e]))}else g=l.filter((e=>!t.includes(e.__vModel__))),m(t,this);this.$set(this,"configCopy",g),this.form=f,this.buildRules(g,this.rules)}else if("="===o&&s.includes(h)){const e=this.formConfig.filter((e=>d.includes(e.__vModel__))),t={};l.forEach((e=>t[e.__vModel__]=e)),g=e.map((e=>t[e.__vModel__]||e)),this.$set(this,"configCopy",g),this.form=f,this.buildRules(g,this.rules)}}function defaultHidenVisible(e,t){let n=(0,_utils_index__WEBPACK_IMPORTED_MODULE_10__.C)(t);if(Array.isArray(e)&&e.length){const t=e.map((e=>e.opsRules.filter((e=>e)).map((e=>e.split("$")[2])).join("$"))).join("$"),r=[];if(this.formData&&Object.keys(this.formData).length){for(let t in this.formData){let o=this.formData[t];if(n.find((e=>"RADIO"===e.typeId&&o))&&(o=[{label:o,key:o,value:o}]),Array.isArray(o)){const a=n.filter((e=>e.__vModel__===t))[0];o.forEach((n=>{if(a){const o="$"+n.value+"^"+a.typeId+"$";e.forEach((e=>{e.opsRules.forEach((e=>{e&&e.includes(t+o)&&r.push(...e.split(o)[1].split("&"))}))}))}}))}}n=n.filter((e=>{const n=e.__vModel__;return!t.includes(n)||r.includes(n)}))}else n=n.filter((e=>!t.includes(e.__vModel__)))}return n}function buildListeners(e){const t=e.__config__,n=this.methods||{},r={};return Object.keys(n).forEach((e=>{r[e]=t=>n[e].call(this,t,this.form)})),r.input=n=>setValue.call(this,n,e,t),r}function setValue(e,t,n){const{typeId:r}=t;["SELECT","SELECT_V2","RADIO"].includes(r)&&hiddenAndShow.call(this,e,t,this.form[t.__vModel__]),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_13__.A).map((e=>{vue__WEBPACK_IMPORTED_MODULE_9___default().component(e,_packages__WEBPACK_IMPORTED_MODULE_13__.A[e])}));const design={colFormItem(e,t){const n=t.__config__,r=buildListeners.call(this,t),{option:o={}}=this.$attrs,a=n.labelWidth||o.labelWidth;return e("el-col",{attrs:{span:n.span}},[e("el-form-item",{attrs:{"label-width":a?"".concat(a,"px"):"120px",prop:t.__vModel__,label:n.showLabel?n.label:""}},[e(_render_render_js__WEBPACK_IMPORTED_MODULE_11__.default,{attrs:(0,D_code_ele_dynamic_form_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__.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_14__.A)((0,D_code_ele_dynamic_form_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_14__.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_14__.A)({},r)})])])},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,r=design[n];if(r)return r.call(this,e,t);throw new Error("__config__里少了layout属性")}))}function renderFrom(e){const{configCopy:t,rules:n,readonly:r,componentKey:o}=this,{option:a={}}=this.$attrs,{labelPosition:i,labelWidth:c,size:s}=a;return e("el-form",_vue_babel_helper_vue_jsx_merge_props__WEBPACK_IMPORTED_MODULE_0___default()([{ref:"elForm",key:o,attrs:{size:s,"label-position":i,disabled:r,"label-width":"".concat(c,"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},formRules:{type:Array,default:()=>[]}},data(){const{formRules:e,formConfig:t}=this,n={form:{},rules:{},configCopy:defaultHidenVisible.call(this,e,t),eventHub:new _utils_index__WEBPACK_IMPORTED_MODULE_10__.o_,componentKey:0};return this.buildRules(n.configCopy,n.rules),n},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;this.configCopy=defaultHidenVisible.call(this,this.formRules,this.formConfig),this.buildRules(this.configCopy,this.rules);const t=(0,_utils_index__WEBPACK_IMPORTED_MODULE_10__.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:r}=n;if(e.__vModel__&&r){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)}config.regular&&config.regList.push({pattern:config.regular,message:config.errorMessage}),rules[field.__vModel__]=config.regList.map((item=>(item.pattern&&(item.pattern=eval(item.pattern)),item.trigger=_render_ruleTrigger_js__WEBPACK_IMPORTED_MODULE_12__.A[config.tag]||"blur",item)))}config.children&&this.buildRules(config.children,rules);const{props:props}=field;"CARD"===field.typeId&&this.buildRules(props.rows,rules),"TABS"!==field.typeId&&"COLLAPSE"!==field.typeId||props.tabs.map((e=>{this.buildRules(e.rows,rules)})),"Table_List"===field.typeId&&this.buildRules(props.columns,rules)}))},submitForm(){return this.form},validate(e){return this.$refs.elForm.validate(e)},reloadForm(){this.componentKey+=1}},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__(8992),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__(3215),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__(1454),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)}}})}}},2516:function(e,t,n){"use strict";n.d(t,{A:function(){return an}});var r=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)};r._withStripped=!0;var o=n(2555),a=(n(4114),n(8992),n(4520),n(3949),n(1454),n(2953),n(7427)),i={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,r]=e,i=t.map((e=>e[e.length-1])),{option:{api:c}}=this.$attrs;if(c){const{getAreaTree:e}=c,[t,s]=(0,a.Th)(e);e&&t((0,o.A)({maxLevel:r,minLevel:n,rootAreaCodes:i},s)).then((e=>{this.areaList=e.data||[]}))}},computed:{convertedVal(){const{value:e,$attrs:t,multiple:n}=this;let r=[];if(n)r=e.map((e=>e.map((e=>e.value))));else{const n=t.convertedVal?t.convertedVal[0]:[],o=e[0]?e[0]:n;o&&o.forEach((e=>{r.push(e.value)}))}return r}},methods:{handleChange(e){const{multiple:t}=this,n=this.$refs.areaCode.getCheckedNodes();let r=[];if(t){const t=e.length;if(t<n.length){const o=t?e[0].length-1:0,a=t?n.filter(((t,n)=>t.path[o]===e[n][o])).map((e=>{let{label:t,value:n}=e;return{label:t,value:n}})):void 0;a&&r.push(a)}else n.forEach((e=>{const t=e.pathNodes.map((e=>{let{label:t,value:n}=e;return{label:t,value:n}}));r.push(t)}))}else r=n.length?n[0].pathNodes.map((e=>{let{label:t,value:n}=e;return{label:t,value:n}})):[];const o=r.length?t?[...r]:[r]:[];this.$emit("input",o),this.$emit("change",o)}}},c=(n(4579),n(4486)),s=(0,c.A)(i,r,[],!1,null,null,null);s.options.__file="src/packages/AreaCode.vue";var u=s.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 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:()=>[]},bizAssignmentRules:{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:r,descField:i}=this,c=[];if(e){const s=this.getApi(),[u,l]=(0,a.Th)(s);s&&u(e,(0,o.A)({viewCode:t,idField:n,nameField:r,descField:i,columns:c,pageNum:1,pageSize:999},l)).then((e=>{200===e.code&&(this.options=i?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,a.sg)((e=>{const{eventCode:t,viewCode:n,idField:r,nameField:i,descField:c}=e;if(!(t&&n&&r&&i))return;e.options=[];const s=e.getApi(),[u,l]=(0,a.Th)(s);s&&u(t,(0,o.A)({viewCode:n,idField:r,nameField:i,descField:c,columns:[],pageNum:1,pageSize:999},l)).then((t=>{200===t.code&&(e.options=c?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;if(e=this.multiple?this.innerValue:[this.innerValue],this.$emit("input",e),this.$emit("change",e),Array.isArray(this.bizAssignmentRules)&&this.bizAssignmentRules.length){const{option:{api:t}}=this.$attrs,{getNormalDetail:n}=t,[r]=e,[o]=(0,a.Th)(n);r.key&&n&&o(this.eventCode,r.key).then((e=>{console.log(this.$attrs);const{formData:t}=this.$attrs;this.bizAssignmentRules.map((n=>{const{bizFieldCode:r,currentFieldCode:o}=n;this.$set(t,o,e.data[r])}))}))}},filterOption(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0}}},f=n(5072),p=n.n(f),m=n(7825),h=n.n(m),g=n(7659),y=n.n(g),_=n(5056),v=n.n(_),A=n(540),b=n.n(A),x=n(1113),k=n.n(x),w=n(4986),C={};C.styleTagTransform=k(),C.setAttributes=v(),C.insert=y().bind(null,"head"),C.domAPI=h(),C.insertStyleElement=b(),p()(w.A,C),w.A&&w.A.locals&&w.A.locals;var E=(0,c.A)(d,l,[],!1,null,"07d5d274",null);E.options.__file="src/packages/BizRelation.vue";var B=E.exports,M=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)};M._withStripped=!0;var S={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(),[n,r]=(0,a.Th)(t);t&&n((0,o.A)({dictType:e},r)).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,a.sg)((e=>{const{dictType:t}=e,n=e.getApi(),[r,i]=(0,a.Th)(n);n&&r((0,o.A)({dictType:t},i)).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}}},L=n(8034),z={};z.styleTagTransform=k(),z.setAttributes=v(),z.insert=y().bind(null,"head"),z.domAPI=h(),z.insertStyleElement=b(),p()(L.A,z),L.A&&L.A.locals&&L.A.locals;var D=(0,c.A)(S,M,[],!1,null,"ded2a2fc",null);D.options.__file="src/packages/ByDictSelect.vue";var T=D.exports,O=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-cascader",{ref:"DataCascader",staticStyle:{width:"100%"},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)};function Y(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}O._withStripped=!0;const j=["children"];var H={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:r}=e;const{children:o}=r,a=Y(r,j);n[t]=a}))})),e.length?this.setDataVal():this.dataVal=0;const r=t?(0,a.C)(e):[(0,a.C)(e)];r.forEach((e=>{e.forEach(((t,r)=>{e[r]=n[t]}))})),this.$emit("input",r),this.$emit("change",r)}}},P=(0,c.A)(H,O,[],!1,null,null,null);P.options.__file="src/packages/DataCascader.vue";var R=P.exports,I=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)};I._withStripped=!0;var N=n(5093),F=n.n(N),W={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,r]=e;if(console.log(F()(n).format("YYYY-MM-DD HH:mm:ss"),F()(r).format("YYYY-MM-DD HH:mm:ss")),n&&r){const{workingDate:e,checks:o,hasWorkTime:i}=this,c=F()(n).format("YYYY-MM-DD HH:mm:ss"),s=F()(r).format("YYYY-MM-DD HH:mm:ss"),u={hasWorkTime:i,workTime:e,start:c,end:s,hasWorkDay:!1,hasNotWorkDay:!1,unit:this.unit};o.includes("工作日")&&(u.hasWorkDay=!0),o.includes("非工作日")&&(u.hasNotWorkDay=!0);const l=this.getApi(),[d]=(0,a.Th)(l);this.convertedVal=[n,r];try{t={days:(await d(u)).data,start:c,end:s}}catch(e){t={days:0,start:F()(n).format("YYYY-MM-DD HH:mm:ss"),end:F()(r).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)}}},V=n(5587),U={};U.styleTagTransform=k(),U.setAttributes=v(),U.insert=y().bind(null,"head"),U.domAPI=h(),U.insertStyleElement=b(),p()(V.A,U),V.A&&V.A.locals&&V.A.locals;var q=(0,c.A)(W,I,[],!1,null,"6dab321e",null);q.options.__file="src/packages/DateDays.vue";var $=q.exports,G=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))])};G._withStripped=!0;var K={name:"DescText",props:{value:{type:String,default:""},color:{type:String,default:"#000000"},textAlign:{type:String,default:"left"}}},J=(0,c.A)(K,G,[],!1,null,null,null);J.options.__file="src/packages/DescText.vue";var X=J.exports,Z=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,min:0},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)};Z._withStripped=!0;var Q={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})}}},ee=(0,c.A)(Q,Z,[],!1,null,null,null);ee.options.__file="src/packages/Duration.vue";var te=ee.exports,ne=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 r=t.item;return r?[n("div",{class:["name",e.state.includes(r.value)?"selected":""]},[e._v(e._s(r.value))])]:void 0}}],null,!0),model:{value:e.state,callback:function(t){e.state=t},expression:"state"}})};ne._withStripped=!0;var re={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)},value:{handler(e){this.state=e}}},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)}}},oe=n(4434),ae={};ae.styleTagTransform=k(),ae.setAttributes=v(),ae.insert=y().bind(null,"head"),ae.domAPI=h(),ae.insertStyleElement=b(),p()(oe.A,ae),oe.A&&oe.A.locals&&oe.A.locals;var ie=(0,c.A)(re,ne,[],!1,null,null,null);ie.options.__file="src/packages/Feedback.vue";var ce=ie.exports,se=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,r){return n("div",{key:r,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,r){return n("div",{key:r,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)};se._withStripped=!0,n(7495),n(5440),n(2041);const ue=()=>new Promise((e=>{if(window.T)e(window.T);else{(()=>{const e=document.createElement("script");e.charset="utf-8",e.src="//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)}}));ue();var le={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,o.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:r,county:o}=this.poi;this.text={address:e||t,longitude:n,latitude:r,county:o}},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:r,address:o,longitude:a,latitude:i}=e,c=new window.T.InfoWindow(n,{autoPan:!0});this.map.panTo(new window.T.LngLat(a,i),17),t.openInfoWindow(c),this.isSelect=!0,this.address=o,this.poi={address:r,longitude:a,latitude:i}},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:r,address:o}=e[n],a=r.replaceAll(this.address,"$".concat(this.address,"$")).split("$");let i="";a.forEach((e=>{i+=e===this.address?'<span style="color: #3385ff;">'.concat(e,"</span>"):e})),t.push({name:r,nameStr:i,address:o})}this.suggestArr=t,this.visibleSuggest=!0}},pois(e){if(e){const t=[],n=[];for(let r=0;r<e.length;r++){const{name:o,address:a,phone:i,lonlat:c}=e[r],[s,u]=c.split(","),l=new window.T.LngLat(s,u),d="名称:"+o+"<br/>地址:"+a,f=new window.T.Marker(l);this.map.addOverLay(f);let p=new window.T.InfoWindow(d,{autoPan:!0});f.addEventListener("click",(()=>{f.openInfoWindow(p)})),t.push(l),n.push({name:o,address:a,phone:i,marker:f,winHtml:d,longitude:s,latitude:u})}this.resultArr=n,this.visibleResult=!0,this.map.setViewport(t)}},MapClick(e){this.map.clearOverLays();const{lng:t,lat:n}=e.lnglat,r=window.T&&new window.T.Marker(new window.T.LngLat(t,n));this.map.addOverLay(r),this.geocode.getLocation(e.lnglat,(e=>{if(0==e.getStatus()){const{county_code:r}=e.getAddressComponent().addressComponent,o=e.getAddress(),a=r.slice(3);this.isSelect=!0,this.address=o,this.poi={address:o,longitude:t,latitude:n,county:a}}}))},init(){ue().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:r,latitude:o}=this.value||{},a=r?[r,o]:[121.01106,30.67934];this.map.centerAndZoom(new e.LngLat(...a),this.value?16:13);const i={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,i);const c=new e.Marker(new e.LngLat(r,o));this.map.addOverLay(c)}),(e=>{console.log("地图加载失败",e)}))}}},de=(n(5661),(0,c.A)(le,se,[],!1,null,"740240aa",null));de.options.__file="src/packages/InputMap.vue";var fe=de.exports,pe=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)};pe._withStripped=!0,n(2577);var me={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:r}}=this.$attrs;if(!n)return;const{getOrgTree:i}=n,[c,s]=(0,a.Th)(n.getOrgTree);i&&c((0,o.A)({parentCode:e||r.VUE_APP_DEPTCODE},s)).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,a.sg)((function(e){this.multiple&&this.$refs.treeSelectTree.filter(e)}),500)}},he=(0,c.A)(me,pe,[],!1,null,null,null);he.options.__file="src/packages/OrgTreeSelect.vue";var ge=he.exports,ye=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("OrgPickerV2",e._b({ref:"orgPicker",attrs:{title:e.title,showOrgPicker:e.isShowDialog,checkedData:e.userIdList,isPersonLevel:!0,isCheckLeafOnly:e.isCheckLeafOnly,isSingleCheck:!e.multiple,isAppendToBody:!1,isMergeUser:!1},on:{"update:showOrgPicker":function(t){e.isShowDialog=t},"update:show-org-picker":function(t){e.isShowDialog=t},updateCheckedData:e.updateCheckedPerson}},"OrgPickerV2",e.$attrs,!1))],1)};ye._withStripped=!0;var _e=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.title+(e.isSingleCheck?"(单选)":""),visible:e.dialogVisible,"append-to-body":e.isAppendToBody,width:"60%",modal:!1},on:{"update:visible":function(t){e.dialogVisible=t},close:e.cancel}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.generalLoading,expression:"generalLoading"}],staticClass:"content"},[n("div",{staticClass:"left"},[n("div",{staticClass:"search-bar"},[n("el-input",{staticClass:"search-input",attrs:{"prefix-icon":"el-icon-search",placeholder:"输入关键字搜索",size:"mini",clearable:""},on:{clear:e.resetList},model:{value:e.searchValue,callback:function(t){e.searchValue=t},expression:"searchValue"}}),e._v(" "),n("el-button",{staticClass:"search-button",attrs:{type:"text",size:"small"},on:{click:e.searchList}},[e._v("搜索")]),e._v(" "),n("el-button",{staticClass:"search-button",attrs:{type:"text",size:"small"},on:{click:e.resetList}},[e._v("重置")])],1),e._v(" "),n("div",{staticClass:"breadcrumbs"},[n("i",{staticClass:"el-icon-office-building"}),e._v(" "),e.crumbList.length?n("el-tooltip",{attrs:{effect:"dark",content:e.crumbList.map((function(e){return e.label})).join(" > "),placement:"top"}},[n("div",{staticClass:"crumb-str text-ellipsis"},[e._v(e._s(e.crumbList.map((function(e){return e.label})).join(" > ")))])]):n("div",{staticClass:"crumb-str text-ellipsis"},[e._v("请从列表中选择数据")])],1),e._v(" "),n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticClass:"list"},[n("div",{staticClass:"check-all"},[n("el-checkbox",{attrs:{indeterminate:e.indeterminateAll,disabled:e.isSingleCheck},on:{change:e.checkedAllChange},model:{value:e.currentCheckedAll,callback:function(t){e.currentCheckedAll=t},expression:"currentCheckedAll"}},[e._v("全选")]),e._v(" "),n("el-button",{staticStyle:{"margin-left":"20px"},style:{marginLeft:"20px",visibility:e.crumbList.length>1||e.crumbList.length&&e.crumbList[0].code!==e.rootDeptCode?"visible":"hidden"},attrs:{type:"text"},on:{click:e.prevLevel}},[e._v("上一级")])],1),e._v(" "),e._l(e.list,(function(t,r){return n("div",{key:r,ref:"listItem"+r,refInFor:!0,staticClass:"list-item"},[n("el-checkbox",{class:[t.disabledColorNormal&&"user-dept-checkbox"],attrs:{indeterminate:t.indeterminate,disabled:t.disabled},on:{change:function(){return e.checkedChange(t,!1)}},model:{value:t.checked,callback:function(n){e.$set(t,"checked",n)},expression:"item.checked"}},[n("div",{ref:"listItemCheckLabel"+r,refInFor:!0,staticClass:"checkbox-label"},[n("i",{class:t.icon,staticStyle:{"margin-right":"5px"}}),e._v(" "),n("span",[e._v(e._s(t.label))])])]),e._v(" "),n("el-button",{style:{marginLeft:"20px",visibility:t.leaf?"hidden":"visible"},attrs:{type:"text"},on:{click:function(n){return e.nextLevel(t)}}},[e._v("下一级")])],1)}))],2)]),e._v(" "),n("div",{staticClass:"right"},[n("div",{staticClass:"total-bar"},[n("span",[e._v("已选 "+e._s(e.checkedList.length)+" 项")]),e._v(" "),n("span",{on:{click:e.clearAllChecked}},[e._v("清空")])]),e._v(" "),n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.checkedListLoading,expression:"checkedListLoading"}],staticClass:"checked-list"},[e.checkedList.length?e._l(e.checkedList,(function(t,r){return n("div",{key:r,staticClass:"checked-list-item"},[n("span",[e._v(e._s(t.showCheckedName))]),e._v(" "),n("i",{staticClass:"el-icon-close",on:{click:function(n){return e.deleteThisChecked(t)}}})])})):n("div",{staticClass:"empty-box"},[n("el-empty",{attrs:{description:"请点击左侧列表选择数据"}})],1)],2)])]),e._v(" "),n("span",{attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"small"},on:{click:e.cancel}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.submit}},[e._v("确 定")])],1)])};_e._withStripped=!0,n(7642),n(8004),n(3853),n(5876),n(4856),n(5024),n(1698),n(3215),n(7550);var ve={name:"OrgPicker",props:{title:{type:String,default:""},showOrgPicker:{type:Boolean,default:!1},isPersonLevel:{type:Boolean,default:!1},checkedData:{type:Array,default:()=>[]},enableDeptData:{type:Array,default:()=>[]},enableUserData:{type:Array,default:()=>[]},isCheckLeafOnly:{type:Boolean,default:!1},isSingleCheck:{type:Boolean,default:!1},isAppendToBody:{type:Boolean,default:!1},isMergeUser:{type:Boolean,default:!0}},watch:{async showOrgPicker(e){if(this.dialogVisible=e,e){var t,n;this.generalLoading=!0;let e=[],r=[];if(this.enableParents=[],null!==(t=this.enableDeptData)&&void 0!==t&&t.length&&(e=await this.getParentDeptInfo(this.enableDeptData.join(","))),this.isPersonLevel&&null!==(n=this.enableUserData)&&void 0!==n&&n.length){let e=[];this.enableUserData[0].indexOf("-")>-1?(e=this.enableUserData.map((e=>e.split("-")[0])),e=[...new Set(e)]):e=await this.getUserDeptCodesByUserIds(this.enableUserData.join(",")),r=await this.getParentDeptInfo(e.join(",")),r=r.concat(e)}this.enableParents=e.concat(r),this.enableParents=[...new Set(this.enableParents)],this.resetList().then((()=>{if(this.checkedData.length){let e,t;this.isPersonLevel?this.checkedData[0].indexOf("-")>-1?(e=this.getUserInfoByCodeList,t=this.checkedData.map((e=>({deptCode:e.split("-")[0],userId:e.split("-")[1]})))):(e=this.getUserInfoByUserIdList,t={userIdList:this.checkedData.join(",")}):(e=this.getOrgTree,t={deptCodes:this.checkedData.join(",")}),this.getAlreadyCheckList(e,t).then((()=>{this.generalLoading=!1}))}else this.checkedList=[],this.validListItemChecked(),this.generalLoading=!1}))}}},data(){return{generalLoading:!1,dialogVisible:!1,crumbList:[],searchValue:"",listLoading:!1,list:[],currentCheckedAll:!1,indeterminateAll:!1,checkedListLoading:!1,checkedList:[],enableParents:[],userSystemList:[{value:"zzd",label:"浙政钉",icon:n(4172)},{value:"dd",label:"钉钉",icon:n(5740)}],userSystemMap:{1:"zzd",2:"dd",zzd:1,dd:2}}},computed:{rootDeptCode(){return this.$attrs.option.config.VUE_APP_DEPTCODE}},methods:{getOrgTree(e){return new Promise((t=>{const{option:{api:n}}=this.$attrs;if(!n.getOrgTree)return Promise.reject("no api");const[r,i]=(0,a.Th)(n.getOrgTree);r((0,o.A)((0,o.A)({},e),i)).then((n=>{t(n.data.map((t=>{var n,r,o,a;let{deptCode:i,deptName:c,parentCode:s,parentName:u,path:l,department:d,leaf:f,sourceType:p}=t,m=!this.isPersonLevel&&f,h=!1,g=!1;return null!==(n=this.enableDeptData)&&void 0!==n&&n.length||this.isPersonLevel&&null!==(r=this.enableUserData)&&void 0!==r&&r.length?(h=l.split("/").filter((e=>e)).every((e=>!this.enableDeptData.includes(e))),this.enableParents.includes(i)&&(g=!0),this.isPersonLevel&&!h&&(g=!0),!this.isCheckLeafOnly||m||h||(g=!0)):g=!0,(this.isPersonLevel||this.isCheckLeafOnly&&!m)&&(h=!0),{code:i,label:"[".concat(null===(o=this.userSystemList.find((e=>e.value===this.userSystemMap[p])))||void 0===o?void 0:o.label,"]").concat(c),originDeptName:c,pCode:e.parentCode===this.rootDeptCode?null:s,pName:e.parentCode===this.rootDeptCode?null:u,leaf:m,sourceType:p,flag:"department",disabled:h,disabledColorNormal:g,checked:!1,deptPath:l,showCheckedName:"[".concat(null===(a=this.userSystemList.find((e=>e.value===this.userSystemMap[p])))||void 0===a?void 0:a.label,"]").concat(d),icon:"el-icon-folder-opened"}})))}))}))},getLargeDeptsByCodes(e){return new Promise((t=>{const{option:{api:n}}=this.$attrs;if(!n.getLargeDeptsByCodes)return Promise.reject("no api");const[r,i]=(0,a.Th)(n.getLargeDeptsByCodes);r((0,o.A)({deptCodes:e},i)).then((e=>{t(e.data.map((e=>{var t;let{deptCode:n,department:r,path:o,sourceType:a}=e;return{code:n,path:o,showCheckedName:"[".concat(null===(t=this.userSystemList.find((e=>e.value===this.userSystemMap[a])))||void 0===t?void 0:t.label,"]").concat(r)}})))}))}))},getUserSearch(e,t){return new Promise((n=>{const{option:{api:r}}=this.$attrs;if(!r.getUserSearch)return Promise.reject("no api");const[i,c]=(0,a.Th)(r.getUserSearch);i((0,o.A)((0,o.A)({},e),c)).then((r=>{let a=[];r.data.forEach((e=>{e.positions.forEach((t=>{a.push((0,o.A)((0,o.A)({},e),t))}))})),"search"===t||(a=a.filter((t=>t.deptCode===e.deptCode))),a.length?this.handleUserDataList(a).then((e=>{n(e)})):n([])}))}))},getUserInfoByUserIdList(e){return new Promise((t=>{const{option:{api:n}}=this.$attrs;if(!n.getUserInfoByUserIdList)return Promise.reject("no api");const[r,i]=(0,a.Th)(n.getUserInfoByUserIdList);r((0,o.A)((0,o.A)({},e),i)).then((e=>{e.data.length?this.handleUserDataList(e.data).then((e=>{t(e)})):t([])}))}))},async getUserDeptCodesByUserIds(e){const{option:{api:t}}=thi