@archbiz/element-ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/element-ui.cjs +11 -0
- package/dist/element-ui.js +5518 -0
- package/dist/style.css +1 -0
- package/package.json +50 -4
- package/src/components/ab-checkbox.vue +51 -0
- package/src/components/ab-color-picker.vue +39 -0
- package/src/components/ab-detail/ab-detail.vue +285 -0
- package/src/components/ab-detail/index.js +1 -0
- package/src/components/ab-drawer/ab-drawer.vue +50 -0
- package/src/components/ab-drawer/index.js +3 -0
- package/src/components/ab-icon/ab-icon.vue +90 -0
- package/src/components/ab-icon/index.js +1 -0
- package/src/components/ab-input-number.vue +49 -0
- package/src/components/ab-input-range.vue +90 -0
- package/src/components/ab-radio.vue +51 -0
- package/src/components/ab-router-link.vue +46 -0
- package/src/components/ab-search/ab-search.vue +168 -0
- package/src/components/ab-search/index.js +4 -0
- package/src/components/ab-select.vue +107 -0
- package/src/components/ab-table/ab-table-column.vue +131 -0
- package/src/components/ab-table/ab-table-columns.vue +62 -0
- package/src/components/ab-table/ab-table-operate.vue +160 -0
- package/src/components/ab-table/ab-table.vue +316 -0
- package/src/components/ab-table/columns.js +90 -0
- package/src/components/ab-table/footer.js +77 -0
- package/src/components/ab-table/formatter.js +2 -0
- package/src/components/ab-table/index.js +8 -0
- package/src/components/ab-table/utils.js +36 -0
- package/src/components/ab-time-period.vue +116 -0
- package/src/components/ab-time-picker.vue +38 -0
- package/src/components/ab-toolbar/ab-toolbar.vue +102 -0
- package/src/components/ab-toolbar/index.js +1 -0
- package/src/components/ab-tree-select.vue +456 -0
- package/src/components/ab-upload-file.vue +277 -0
- package/src/components/index.js +27 -0
- package/src/core/ab-form.js +25 -0
- package/src/core/alias.js +36 -0
- package/src/core/config.js +65 -0
- package/src/core/form-render.js +256 -0
- package/src/core/options.js +25 -0
- package/src/hooks/use-cache.js +75 -0
- package/src/index.js +39 -0
- package/src/makers/datePicker.js +8 -0
- package/src/makers/frame.js +23 -0
- package/src/makers/index.js +23 -0
- package/src/makers/input.js +12 -0
- package/src/makers/select.js +8 -0
- package/src/makers/slider.js +7 -0
- package/src/makers/timePicker.js +8 -0
- package/src/makers/tree.js +10 -0
- package/src/makers/upload.js +20 -0
- package/src/parsers/checkbox.js +5 -0
- package/src/parsers/colorPicker.js +29 -0
- package/src/parsers/datePicker.js +24 -0
- package/src/parsers/frame.js +17 -0
- package/src/parsers/hidden.js +11 -0
- package/src/parsers/index.js +36 -0
- package/src/parsers/input.js +15 -0
- package/src/parsers/number.js +29 -0
- package/src/parsers/radio.js +5 -0
- package/src/parsers/select.js +15 -0
- package/src/parsers/slider.js +21 -0
- package/src/parsers/switch.js +11 -0
- package/src/parsers/text.js +25 -0
- package/src/parsers/timePicker.js +12 -0
- package/src/parsers/tree.js +37 -0
- package/src/parsers/upload.js +35 -0
- package/src/plugins/ab-detail.js +7 -0
- package/src/plugins/ab-drawer.js +7 -0
- package/src/plugins/ab-form.js +14 -0
- package/src/plugins/ab-search.js +7 -0
- package/src/plugins/ab-table.js +15 -0
- package/src/plugins/ab-toolbar.js +7 -0
- package/src/rule/defaults.js +187 -0
- package/src/rule/formatter.js +218 -0
- package/src/style/index.css +356 -0
- package/src/utils/formatter.js +188 -0
- package/src/utils/router-link.js +59 -0
- package/README.md +0 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("@archbiz/core-v2"),w=require("@archbiz/utils");var Un=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-select",e._b({ref:"el",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-select",e.$attrs,!1),[e._l(e.options,function(r,i){return[e.hasGroup(r)?n("el-option-group",{key:`group-${i}-${r.label}`,attrs:{label:r.label}},e._l(e.trueArray(r.options),function(s,o){return n("el-option",e._b({key:`group-${i}-${o}-${s.value}`},"el-option",s,!1))}),1):[e.showValue?n("el-option",{key:`${i}-${r.value}`,class:r.class,attrs:{label:r.label,value:r.value}},[n("span",{staticClass:"p-option__left"},[e._v(e._s(r.label))]),n("span",{staticClass:"p-option__right"},[e._v(e._s(r.value))])]):e.showKey||e.showCode?n("el-option",{key:`${i}-${r.value}`,class:r.class,attrs:{label:r.label,value:r.value}},[n("span",{staticClass:"p-option__left"},[e._v(e._s(r.label))]),e.showKey?n("span",{staticClass:"p-option__right"},[e._v(e._s(r.key))]):e._e(),e.showCode?n("span",{staticClass:"p-option__right"},[e._v(e._s(r.code))]):e._e()]):n("el-option",{key:`${i}-${r.value}`,attrs:{label:r.label,value:r.value}})]]}),e._t("default")],2)},Wn=[];function _(e,t,n,r,i,s,o,l){var a=typeof e=="function"?e.options:e;t&&(a.render=t,a.staticRenderFns=n,a._compiled=!0),r&&(a.functional=!0),s&&(a._scopeId="data-v-"+s);var c;if(o?(c=function(f){f=f||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!f&&typeof __VUE_SSR_CONTEXT__<"u"&&(f=__VUE_SSR_CONTEXT__),i&&i.call(this,f),f&&f._registeredComponents&&f._registeredComponents.add(o)},a._ssrRegister=c):i&&(c=l?function(){i.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(a.functional){a._injectStyles=c;var u=a.render;a.render=function(p,h){return c.call(h),u(p,h)}}else{var d=a.beforeCreate;a.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:a}}const Gn={name:"AbSelect",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String,showValue:Boolean,showKey:{type:Boolean,default:!0},showCode:{type:Boolean,default:!0}},computed:{options(){const e=this.abFormInject&&this.abFormInject.options;return Array.isArray(e)?e:[]},currentSize(){return this.$ELEMENT&&this.$ELEMENT.size||"default"}},mounted(){this.$emit("fc.el",this.$refs.el)},methods:{hasGroup(e){return!!e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"options")},trueArray(e){return Array.isArray(e)?e:[]},handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},rt={};var Qn=_(Gn,Un,Wn,!1,Jn,null,null,null);function Jn(e){for(let t in rt)this[t]=rt[t]}const Kt=function(){return Qn.exports}();var Xn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-radio-group",e._b({ref:"el",attrs:{value:e.value},on:{input:e.handleInput}},"el-radio-group",e.$attrs,!1),[e._l(e.optionsList,function(r,i){var s,o,l,a;return[e.type==="button"?n("el-radio-button",e._b({key:`button-${i}-${r.value}`,attrs:{label:r.value}},"el-radio-button",e.optionProps(r),!1),[e._v(" "+e._s((s=(o=r.label)!==null&&o!==void 0?o:r.value)!==null&&s!==void 0?s:"")+" ")]):n("el-radio",e._b({key:`radio-${i}-${r.value}`,attrs:{label:r.value}},"el-radio",e.optionProps(r),!1),[e._v(" "+e._s((l=(a=r.label)!==null&&a!==void 0?a:r.value)!==null&&l!==void 0?l:"")+" ")])]}),e._t("default")],2)},Zn=[];const er={name:"AbRadio",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:[String,Number,Boolean],default:void 0},options:Array,type:String},computed:{optionsList(){const e=this.options||this.abFormInject&&this.abFormInject.options||[];return Array.isArray(e)?e:[]}},methods:{optionProps(e){const{value:t,label:n,...r}=e||{};return r},handleInput(e){this.$emit("input",e)}}},it={};var tr=_(er,Xn,Zn,!1,nr,null,null,null);function nr(e){for(let t in it)this[t]=it[t]}const rr=function(){return tr.exports}();var ir=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-checkbox-group",e._b({ref:"el",attrs:{value:e.value},on:{input:e.handleInput}},"el-checkbox-group",e.$attrs,!1),[e._l(e.optionsList,function(r,i){var s,o,l,a;return[e.type==="button"?n("el-checkbox-button",e._b({key:`button-${i}-${r.value}`,attrs:{label:r.value}},"el-checkbox-button",e.optionProps(r),!1),[e._v(" "+e._s((s=(o=r.label)!==null&&o!==void 0?o:r.value)!==null&&s!==void 0?s:"")+" ")]):n("el-checkbox",e._b({key:`checkbox-${i}-${r.value}`,attrs:{label:r.value}},"el-checkbox",e.optionProps(r),!1),[e._v(" "+e._s((l=(a=r.label)!==null&&a!==void 0?a:r.value)!==null&&l!==void 0?l:"")+" ")])]}),e._t("default")],2)},sr=[];const or={name:"AbCheckbox",inheritAttrs:!1,props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},options:Array,type:String},computed:{optionsList(){const e=this.options||this.abFormInject&&this.abFormInject.options||[];return Array.isArray(e)?e:[]}},methods:{optionProps(e){const{value:t,label:n,...r}=e||{};return r},handleInput(e){this.$emit("input",e)}}},st={};var ar=_(or,ir,sr,!1,lr,null,null,null);function lr(e){for(let t in st)this[t]=st[t]}const ur=function(){return ar.exports}();/**
|
|
2
|
+
* (c) Iconify
|
|
3
|
+
*
|
|
4
|
+
* For the full copyright and license information, please view the license.txt or license.gpl.txt
|
|
5
|
+
* files at https://github.com/iconify/iconify
|
|
6
|
+
*
|
|
7
|
+
* Licensed under MIT.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
* @version 3.1.1
|
|
11
|
+
*/const Vt=Object.freeze({left:0,top:0,width:16,height:16}),ye=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),re=Object.freeze({...Vt,...ye}),Be=Object.freeze({...re,body:"",hidden:!1});function cr(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function ot(e,t){const n=cr(e,t);for(const r in Be)r in ye?r in e&&!(r in n)&&(n[r]=ye[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function dr(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(o){if(n[o])return i[o]=[];if(!(o in i)){i[o]=null;const l=r[o]&&r[o].parent,a=l&&s(l);a&&(i[o]=[l].concat(a))}return i[o]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(s),i}function fr(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function o(l){s=ot(r[l]||i[l],s)}return o(t),n.forEach(o),ot(e,s)}function Ut(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=dr(e);for(const i in r){const s=r[i];s&&(t(i,fr(e,i,s)),n.push(i))}return n}const W=/^[a-z0-9]+(-[a-z0-9]+)*$/,q=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),a=i.pop(),c={provider:i.length>0?i[0]:r,prefix:a,name:l};return t&&!pe(c)?null:c}const s=i[0],o=s.split("-");if(o.length>1){const l={provider:r,prefix:o.shift(),name:o.join("-")};return t&&!pe(l)?null:l}if(n&&r===""){const l={provider:r,prefix:"",name:s};return t&&!pe(l,n)?null:l}return null},pe=(e,t)=>e?!!((e.provider===""||e.provider.match(W))&&(t&&e.prefix===""||e.prefix.match(W))&&e.name.match(W)):!1,pr={provider:"",aliases:{},not_found:{},...Vt};function ke(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Wt(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ke(e,pr))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(W)||typeof s.body!="string"||!ke(s,Be))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],o=s.parent;if(!i.match(W)||typeof o!="string"||!n[o]&&!r[o]||!ke(s,Be))return null}return t}const ge=Object.create(null);function hr(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function A(e,t){const n=ge[e]||(ge[e]=Object.create(null));return n[t]||(n[t]=hr(e,t))}function Je(e,t){return Wt(t)?Ut(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function mr(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function yr(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(ge)).forEach(i=>{(typeof i=="string"&&typeof t=="string"?[t]:Object.keys(ge[i]||{})).forEach(o=>{const l=A(i,o);n=n.concat(Object.keys(l.icons).map(a=>(i!==""?"@"+i+":":"")+o+":"+a))})}),n}let X=!1;function gr(e){return typeof e=="boolean"&&(X=e),X}function ie(e){const t=typeof e=="string"?q(e,!0,X):e;if(t){const n=A(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Gt(e,t){const n=q(e,!0,X);if(!n)return!1;const r=A(n.provider,n.prefix);return mr(r,n.name,t)}function Qt(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),X&&!t&&!e.prefix){let i=!1;return Wt(e)&&(e.prefix="",Ut(e,(s,o)=>{o&&Gt(s,o)&&(i=!0)})),i}const n=e.prefix;if(!pe({provider:t,prefix:n,name:"a"}))return!1;const r=A(t,n);return!!Je(r,e)}function br(e){return!!ie(e)}function _r(e){const t=ie(e);return t?{...re,...t}:null}const Jt=Object.freeze({width:null,height:null}),Xt=Object.freeze({...Jt,...ye}),vr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,$r=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Le(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(vr);if(r===null||!r.length)return e;const i=[];let s=r.shift(),o=$r.test(s);for(;;){if(o){const l=parseFloat(s);isNaN(l)?i.push(s):i.push(Math.ceil(l*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");o=!o}}const wr=e=>e==="unset"||e==="undefined"||e==="none";function we(e,t){const n={...re,...e},r={...Xt,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(h=>{const y=[],b=h.hFlip,L=h.vFlip;let S=h.rotate;b?L?S+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):L&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let x;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:x=i.height/2+i.top,y.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:x=i.width/2+i.left,y.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")");break}S%2===1&&(i.left!==i.top&&(x=i.left,i.left=i.top,i.top=x),i.width!==i.height&&(x=i.width,i.width=i.height,i.height=x)),y.length&&(s='<g transform="'+y.join(" ")+'">'+s+"</g>")});const o=r.width,l=r.height,a=i.width,c=i.height;let u,d;o===null?(d=l===null?"1em":l==="auto"?c:l,u=Le(d,a/c)):(u=o==="auto"?a:o,d=l===null?Le(u,c/a):l==="auto"?c:l);const f={},p=(h,y)=>{wr(y)||(f[h]=y.toString())};return p("width",u),p("height",d),f.viewBox=i.left.toString()+" "+i.top.toString()+" "+a.toString()+" "+c.toString(),{attributes:f,body:s}}const Sr=/\sid="(\S+)"/g,xr="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Cr=0;function Zt(e,t=xr){const n=[];let r;for(;r=Sr.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(Cr++).toString(),l=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const M={local:!0,session:!0},en={local:new Set,session:new Set};let Xe=!1;function Tr(e){Xe=e}const at="iconify2",Z="iconify",tn=Z+"-count",lt=Z+"-version",nn=36e5,Fr=168;function ze(e,t){try{return e.getItem(t)}catch{}}function Ze(e,t,n){try{return e.setItem(t,n),!0}catch{}}function ut(e,t){try{e.removeItem(t)}catch{}}function qe(e,t){return Ze(e,tn,t.toString())}function Ye(e){return parseInt(ze(e,tn))||0}let ue=typeof window>"u"?{}:window;function rn(e){const t=e+"Storage";try{if(ue&&ue[t]&&typeof ue[t].length=="number")return ue[t]}catch{}M[e]=!1}function sn(e,t){const n=rn(e);if(!n)return;const r=ze(n,lt);if(r!==at){if(r){const l=Ye(n);for(let a=0;a<l;a++)ut(n,Z+a.toString())}Ze(n,lt,at),qe(n,0);return}const i=Math.floor(Date.now()/nn)-Fr,s=l=>{const a=Z+l.toString(),c=ze(n,a);if(typeof c=="string"){try{const u=JSON.parse(c);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>i&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,l))return!0}catch{}ut(n,a)}};let o=Ye(n);for(let l=o-1;l>=0;l--)s(l)||(l===o-1?(o--,qe(n,o)):en[e].add(l))}function on(){if(!Xe){Tr(!0);for(const e in M)sn(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=A(r,i);if(!Je(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function an(e,t){switch(e){case"local":case"session":M[e]=t;break;case"all":for(const n in M)M[n]=t;break}}const Ke=Object.create(null);function ln(e,t){Ke[e]=t}function Ve(e){return Ke[e]||Ke[""]}function et(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Se=Object.create(null),K=["https://api.simplesvg.com","https://api.unisvg.com"],he=[];for(;K.length>0;)K.length===1||Math.random()>.5?he.push(K.shift()):he.push(K.pop());Se[""]=et({resources:["https://api.iconify.design"].concat(he)});function un(e,t){const n=et(t);return n===null?!1:(Se[e]=n,!0)}function xe(e){return Se[e]}function Ar(){return Object.keys(Se)}const kr=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let be=kr();function Pr(e){be=e}function Er(){return be}function Ir(e,t){const n=xe(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(o=>{i=Math.max(i,o.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Dr(e){return e===404}const Rr=(e,t,n)=>{const r=[],i=Ir(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},l=0;return n.forEach((a,c)=>{l+=a.length+1,l>=i&&c>0&&(r.push(o),o={type:s,provider:e,prefix:t,icons:[]},l=a.length),o.icons.push(a)}),r.push(o),r};function Nr(e){if(typeof e=="string"){const t=xe(e);if(t)return t.path}return"/"}const Or=(e,t,n)=>{if(!be){n("abort",424);return}let r=Nr(t.provider);switch(t.type){case"icons":{const s=t.prefix,l=t.icons.join(","),a=new URLSearchParams({icons:l});r+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;be(e+r).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(Dr(o)?"abort":"next",o)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},jr={prepare:Rr,send:Or};function Mr(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,o=i.prefix,l=i.name,a=n[s]||(n[s]=Object.create(null)),c=a[o]||(a[o]=A(s,o));let u;l in c.icons?u=t.loaded:o===""||c.missing.has(l)?u=t.missing:u=t.pending;const d={provider:s,prefix:o,name:l};u.push(d)}),t}function cn(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Hr(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const o=s.icons,l=o.pending.length;o.pending=o.pending.filter(a=>{if(a.prefix!==i)return!0;const c=a.name;if(e.icons[c])o.loaded.push({provider:r,prefix:i,name:c});else if(e.missing.has(c))o.missing.push({provider:r,prefix:i,name:c});else return n=!0,!0;return!1}),o.pending.length!==l&&(n||cn([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let Br=0;function Lr(e,t,n){const r=Br++,i=cn.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),i}function zr(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?q(i,t,n):i;s&&r.push(s)}),r}var qr={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Yr(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let o;if(e.random){let g=e.resources.slice(0);for(o=[];g.length>1;){const T=Math.floor(Math.random()*g.length);o.push(g[T]),g=g.slice(0,T).concat(g.slice(T+1))}o=o.concat(g)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const l=Date.now();let a="pending",c=0,u,d=null,f=[],p=[];typeof r=="function"&&p.push(r);function h(){d&&(clearTimeout(d),d=null)}function y(){a==="pending"&&(a="aborted"),h(),f.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),f=[]}function b(g,T){T&&(p=[]),typeof g=="function"&&p.push(g)}function L(){return{startTime:l,payload:t,status:a,queriesSent:c,queriesPending:f.length,subscribe:b,abort:y}}function S(){a="failed",p.forEach(g=>{g(void 0,u)})}function x(){f.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),f=[]}function Vn(g,T,Y){const le=T!=="success";switch(f=f.filter(O=>O!==g),a){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(T==="abort"){u=Y,S();return}if(le){u=Y,f.length||(o.length?Ae():S());return}if(h(),x(),!e.random){const O=e.resources.indexOf(g.resource);O!==-1&&O!==e.index&&(e.index=O)}a="completed",p.forEach(O=>{O(Y)})}function Ae(){if(a!=="pending")return;h();const g=o.shift();if(g===void 0){if(f.length){d=setTimeout(()=>{h(),a==="pending"&&(x(),S())},e.timeout);return}S();return}const T={status:"pending",resource:g,callback:(Y,le)=>{Vn(T,Y,le)}};f.push(T),c++,d=setTimeout(Ae,e.rotate),n(g,t,T.callback)}return setTimeout(Ae),L}function dn(e){const t={...qr,...e};let n=[];function r(){n=n.filter(l=>l().status==="pending")}function i(l,a,c){const u=Yr(t,l,a,(d,f)=>{r(),c&&c(d,f)});return n.push(u),u}function s(l){return n.find(a=>l(a))||null}return{query:i,find:s,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:r}}function ct(){}const Pe=Object.create(null);function Kr(e){if(!Pe[e]){const t=xe(e);if(!t)return;const n=dn(t),r={config:t,redundancy:n};Pe[e]=r}return Pe[e]}function fn(e,t,n){let r,i;if(typeof e=="string"){const s=Ve(e);if(!s)return n(void 0,424),ct;i=s.send;const o=Kr(e);o&&(r=o.redundancy)}else{const s=et(e);if(s){r=dn(s);const o=e.resources?e.resources[0]:"",l=Ve(o);l&&(i=l.send)}}return!r||!i?(n(void 0,424),ct):r.query(t,i,n)().abort}function Vr(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in M)sn(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Ur(e,t){Xe||on();function n(r){let i;if(!M[r]||!(i=rn(r)))return;const s=en[r];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=Ye(i),!qe(i,o+1))return;const l={cached:Math.floor(Date.now()/nn),provider:e.provider,data:t};return Ze(i,Z+o.toString(),JSON.stringify(l))}t.lastModified&&!Vr(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function dt(){}function Wr(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Hr(e)}))}function Gr(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=Ve(n)))return;s.prepare(n,r,i).forEach(l=>{fn(n,l,a=>{if(typeof a!="object")l.icons.forEach(c=>{e.missing.add(c)});else try{const c=Je(e,a);if(!c.length)return;const u=e.pendingIcons;u&&c.forEach(d=>{u.delete(d)}),Ur(e,a)}catch(c){console.error(c)}Wr(e)})})}))}const Qr=e=>{const n=A(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},tt=(e,t)=>{const n=zr(e,!0,gr()),r=Mr(n);if(!r.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(r.loaded,r.missing,r.pending,dt)}),()=>{a=!1}}const i=Object.create(null),s=[];let o,l;return r.pending.forEach(a=>{const{provider:c,prefix:u}=a;if(u===l&&c===o)return;o=c,l=u,s.push(A(c,u));const d=i[c]||(i[c]=Object.create(null));d[u]||(d[u]=[])}),r.pending.forEach(a=>{const{provider:c,prefix:u,name:d}=a,f=A(c,u),p=f.pendingIcons||(f.pendingIcons=new Set);p.has(d)||(p.add(d),i[c][u].push(d))}),s.forEach(a=>{const{provider:c,prefix:u}=a;i[c][u].length&&Gr(a,i[c][u])}),t?Lr(t,r,s):dt},Jr=e=>new Promise((t,n)=>{const r=typeof e=="string"?q(e,!0):e;if(!r){n(e);return}tt([r||e],i=>{if(i.length&&r){const s=ie(r);if(s){t({...re,...s});return}}n(e)})});function pn(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Jt?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Ce={...Xt,inline:!1},Ee="iconify",Ue="iconify-inline",R="iconifyData"+Date.now();let H=[];function se(e){for(let t=0;t<H.length;t++){const n=H[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function hn(e,t=!1){let n=se(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},H.push(n),n)}function Xr(){if(document.documentElement)return hn(document.documentElement);H.push({node:()=>document.documentElement})}function Zr(e){H=H.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function oe(){return H}function ei(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let G=null;const ti={childList:!0,subtree:!0,attributes:!0};function mn(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,G&&G(e)}))}function ni(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const i=t[r];if(i.addedNodes&&i.addedNodes.length>0||i.type==="attributes"&&i.target[R]!==void 0){n.paused||mn(e);return}}}function yn(e,t){e.observer.instance.observe(t,ti)}function _e(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;!n||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(ni.bind(null,e)),yn(e,n),t.paused||mn(e))}function ft(){oe().forEach(_e)}function gn(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function ri(e){const t=G!==null;if(G!==e&&(G=e,t&&oe().forEach(gn)),t){ft();return}ei(ft)}function We(e){(e?[e]:oe()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function ii(e){if(e){const t=se(e);t&&We(t)}else We()}function Ge(e){(e?[e]:oe()).forEach(t=>{if(!t.observer){_e(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const r=typeof t.node=="function"?t.node():t.node;if(r)n.instance?yn(t,r):_e(t);else return}})}function si(e){if(e){const t=se(e);t&&Ge(t)}else Ge()}function bn(e,t=!1){const n=hn(e,t);return _e(n),n}function _n(e){const t=se(e);t&&(gn(t),Zr(e))}function oi(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const i in Ce)if(n[i]!==r[i])return!0;return!1}function ai(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}const li=/[\s,]+/;function ui(e,t){t.split(li).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const ci=["width","height"],di=["inline","hFlip","vFlip"];function fi(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function pi(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&q(t,!0);if(!n)return null;const r={...Ce,inline:e.classList&&e.classList.contains(Ue)};ci.forEach(l=>{const a=e.getAttribute("data-"+l);a&&(r[l]=a)});const i=e.getAttribute("data-rotate");typeof i=="string"&&(r.rotate=ai(i));const s=e.getAttribute("data-flip");typeof s=="string"&&ui(r,s),di.forEach(l=>{const a="data-"+l,c=fi(e.getAttribute(a),a);typeof c=="boolean"&&(r[l]=c)});const o=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:o}}const hi="svg."+Ee+", i."+Ee+", span."+Ee+", i."+Ue+", span."+Ue;function mi(e){const t=[];return e.querySelectorAll(hi).forEach(n=>{const r=n[R]||n.tagName.toLowerCase()!=="svg"?pi(n):null;r&&t.push({node:n,props:r})}),t}function vn(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let Q;function yi(){try{Q=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Q=null}}function gi(e){return Q===void 0&&yi(),Q?Q.createHTML(e):e}function $n(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function wn(e,t,n,r){const i=e.classList;if(r){const o=r.classList;Array.from(o).forEach(l=>{i.add(l)})}const s=[];return t.forEach(o=>{i.contains(o)?n.has(o)&&s.push(o):(i.add(o),s.push(o))}),n.forEach(o=>{t.has(o)||i.remove(o)}),s}function Sn(e,t,n){const r=e.style;(n||[]).forEach(s=>{r.removeProperty(s)});const i=[];for(const s in t)r.getPropertyValue(s)||(i.push(s),r.setProperty(s,t[s]));return i}function xn(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const i=t.customisations,s=we(n,i),o=e[R],l=vn(Zt(s.body),{"aria-hidden":"true",role:"img",...s.attributes});r.innerHTML=gi(l);const a=r.childNodes[0],c=e.attributes;for(let h=0;h<c.length;h++){const y=c.item(h),b=y.name;b!=="class"&&!a.hasAttribute(b)&&a.setAttribute(b,y.value)}const u=$n(t.icon),d=wn(a,u,new Set(o&&o.addedClasses),e),f=Sn(a,i.inline?{"vertical-align":"-0.125em"}:{},o&&o.addedStyles),p={...t,status:"loaded",addedClasses:d,addedStyles:f};return a[R]=p,e.parentNode&&e.parentNode.replaceChild(a,e),a}function bi(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function _i(e){return"data:image/svg+xml,"+bi(e)}function vi(e){return'url("'+_i(e)+'")'}const $i={display:"inline-block"},Qe={"background-color":"currentColor"},Cn={"background-color":"transparent"},pt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},ht={"-webkit-mask":Qe,mask:Qe,background:Cn};for(const e in ht){const t=ht[e];for(const n in pt)t[e+"-"+n]=pt[n]}function mt(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function wi(e,t,n,r){const i=t.customisations,s=we(n,i),o=s.attributes,l=e[R],a=vn(s.body,{...o,width:n.width+"",height:n.height+""}),c=$n(t.icon),u=wn(e,c,new Set(l&&l.addedClasses)),f={"--svg":vi(a),width:mt(o.width),height:mt(o.height),...$i,...r?Qe:Cn};i.inline&&(f["vertical-align"]="-0.125em");const p=Sn(e,f,l&&l.addedStyles),h={...t,status:"loaded",addedClasses:u,addedStyles:p};return e[R]=h,e}let ce=!1;function Si(){ce||(ce=!0,setTimeout(()=>{ce&&(ce=!1,z())}))}function z(e,t=!1){const n=Object.create(null);function r(i,s){const{provider:o,prefix:l,name:a}=i,c=A(o,l),u=c.icons[a];if(u)return{status:"loaded",icon:u};if(c.missing.has(a))return{status:"missing"};if(s&&!Qr(i)){const d=n[o]||(n[o]=Object.create(null));(d[l]||(d[l]=new Set)).add(a)}return{status:"loading"}}(e?[e]:oe()).forEach(i=>{const s=typeof i.node=="function"?i.node():i.node;if(!s||!s.querySelectorAll)return;let o=!1,l=!1;function a(c,u,d){if(l||(l=!0,We(i)),c.tagName.toUpperCase()!=="SVG"){const f=u.mode,p=f==="mask"||(f==="bg"?!1:f==="style"?d.body.indexOf("currentColor")!==-1:null);if(typeof p=="boolean"){wi(c,u,{...re,...d},p);return}}xn(c,u,d)}mi(s).forEach(({node:c,props:u})=>{const d=c[R];if(!d){const{status:p,icon:h}=r(u.icon,!0);if(h){a(c,u,h);return}o=o||p==="loading",c[R]={...u,status:p};return}let f;if(oi(d,u)){if(f=r(u.icon,d.name!==u.name),!f.icon){o=o||f.status==="loading",Object.assign(d,{...u,status:f.status});return}}else{if(d.status!=="loading")return;if(f=r(u.icon,!1),!f.icon){d.status=f.status;return}}a(c,u,f.icon)}),i.temporary&&!o?_n(s):t&&o?bn(s,!0):l&&i.observer&&Ge(i)});for(const i in n){const s=n[i];for(const o in s){const l=s[o];tt(Array.from(l).map(a=>({provider:i,prefix:o,name:a})),Si)}}}function xi(e){const t=se(e);t?z(t):z({node:e,temporary:!0},!0)}function Tn(e,t,n=!1){const r=ie(e);if(!r)return null;const i=q(e),s=pn(Ce,t||{}),o=xn(document.createElement("span"),{name:e,icon:i,customisations:s},r);return n?o.outerHTML:o}function Ci(){return"3.1.1"}function Ti(e,t){return Tn(e,t,!1)}function Fi(e,t){return Tn(e,t,!0)}function Ai(e,t){const n=ie(e);if(!n)return null;const r=pn(Ce,t||{});return we(n,r)}function ki(e){e?xi(e):z()}if(typeof document<"u"&&typeof window<"u"){Xr();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Qt(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{ri(z),z()})}function Pi(e,t){an(e,t!==!1)}function Ei(e){an(e,!0)}ln("",jr);if(typeof document<"u"&&typeof window<"u"){on();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;un(n,i)||console.error(r)}catch{console.error(r)}}}}const Ii={getAPIConfig:xe,setAPIModule:ln,sendAPIQuery:fn,setFetch:Pr,getFetch:Er,listAPIProviders:Ar},me={_api:Ii,addAPIProvider:un,loadIcons:tt,loadIcon:Jr,iconExists:br,getIcon:_r,listIcons:yr,addIcon:Gt,addCollection:Qt,replaceIDs:Zt,calculateSize:Le,buildIcon:we,getVersion:Ci,renderSVG:Ti,renderHTML:Fi,renderIcon:Ai,scan:ki,observe:bn,stopObserving:_n,pauseObserver:ii,resumeObserver:si,enableCache:Pi,disableCache:Ei};try{self.Iconify===void 0&&(self.Iconify=me)}catch{}var Di=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"ab-icon",style:e.wrapperStyle},[e.isLocal?n("svg",{class:e.svgClassNames,attrs:{"aria-hidden":"true"}},[n("use",{attrs:{"xlink:href":e.symbolId}})]):n("span",{ref:"elRef",class:e.svgClassNames,attrs:{"data-icon":e.symbolId}})])},Ri=[];const Ni={name:"AbIcon",props:{icon:{type:String,default:void 0},color:{type:String,default:void 0},size:{type:Number,default:16},svgClass:{type:String,default:void 0}},computed:{isLocal(){return!!(this.icon&&this.icon.startsWith("svg-icon:"))},symbolId(){return this.isLocal?`#icon-${this.icon.split("svg-icon:")[1]}`:this.icon},svgClassNames(){return`iconify ${this.svgClass||""}`.trim()},wrapperStyle(){return{fontSize:`${this.size}px`,height:"1em",color:this.color}}},watch:{icon(e){this.updateIcon(e)}},mounted(){this.updateIcon(this.icon)},methods:{async updateIcon(e){if(this.isLocal||typeof document>"u")return;const t=this.$refs.elRef;if(!t||(await this.$nextTick(),!e))return;const n=me&&typeof me.renderSVG=="function"?me.renderSVG(e,{}):null;if(n)t.textContent="",t.appendChild(n);else{const r=document.createElement("span");r.className="iconify",r.dataset.icon=e,t.textContent="",t.appendChild(r)}}}},yt={};var Oi=_(Ni,Di,Ri,!1,ji,null,null,null);function ji(e){for(let t in yt)this[t]=yt[t]}const nt=function(){return Oi.exports}();var Mi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-popover",{ref:"popover",attrs:{placement:"bottom-start",width:"320",disabled:e.disabled,trigger:"manual","popper-class":"ab-tree-select__popper"},on:{show:e.onShow,hide:e.onHide},model:{value:e.visible,callback:function(r){e.visible=r},expression:"visible"}},[n("div",{staticClass:"ab-tree-select__dropdown",on:{mouseenter:e.onDropdownEnter,mouseleave:e.onDropdownLeave}},[e.filterable?n("div",{staticClass:"ab-tree-select__filter"},[n("el-input",{staticClass:"ab-tree-select__filter-input",attrs:{size:"small",placeholder:"搜索..."},on:{keydown:[function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"]))return null;r.stopPropagation()},function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"tab",9,r.key,"Tab"))return null;r.stopPropagation()}],click:function(r){r.stopPropagation()}},model:{value:e.filterText,callback:function(r){e.filterText=r},expression:"filterText"}},[n("template",{slot:"prefix"},[n("i",{staticClass:"el-icon-search"})]),e.filterText?n("template",{slot:"suffix"},[n("i",{staticClass:"el-icon-circle-close",on:{click:function(r){r.stopPropagation(),e.filterText=""}}})]):e._e()],2)],1):e._e(),n("el-tree",{ref:"tree",staticStyle:{"max-height":"300px",overflow:"auto"},attrs:{data:e.filteredData,props:e.treeProps,"node-key":e.treeProps.value,"default-expanded-keys":e.defaultExpandedKeysInternal,"show-checkbox":e.multiple,"check-strictly":e.checkStrictly,"highlight-current":!e.multiple,"default-checked-keys":e.getDefaultCheckedKeys(),"filter-node-method":e.filterNodeMethod},on:{"node-click":e.handleNodeClick,"check-change":e.handleCheckChange,"current-change":e.handleCurrentChange}}),e.filteredData.length===0&&e.filterText?n("div",{staticClass:"ab-tree-select__empty"},[e._v("无匹配数据")]):e._e()],1),n("template",{slot:"reference"},[n("div",{staticClass:"ab-tree-select__reference"},[e.multiple?n("div",{staticClass:"ab-tree-select__tags-wrapper",on:{click:e.handleClick}},[n("input",{ref:"input",attrs:{type:"hidden",name:e.$attrs.name},domProps:{value:Array.isArray(e.value)?e.value.join(","):e.value||""}}),n("div",{staticClass:"ab-tree-select__tags"},[e.displayLabels.length===1?n("el-tag",{staticClass:"ab-tree-select__tag",attrs:{size:"small",type:"info"},on:{close:function(r){return r.stopPropagation(),e.removeTag(e.displayLabels[0].value)}}},[e._v(" "+e._s(e.displayLabels[0].label)+" ")]):e.displayLabels.length>1?n("span",{staticClass:"ab-tree-select__tag-multiple"},[n("el-tag",{staticClass:"ab-tree-select__first-tag",attrs:{size:"small",type:"info"},on:{close:function(r){return r.stopPropagation(),e.removeTag(e.displayLabels[0].value)}}},[e._v(" "+e._s(e.displayLabels[0].label)+" ")]),n("el-tag",{staticClass:"ab-tree-select__count-tag",attrs:{size:"small",type:"info"}},[e._v(" +"+e._s(e.displayLabels.length-1)+" ")])],1):n("span",{staticClass:"ab-tree-select__placeholder"},[e._v(e._s(e.placeholder))]),n("i",{staticClass:"el-select__caret el-icon-arrow-down",class:{"is-reverse":e.visible}})],1)]):n("el-input",e._b({ref:"input",staticClass:"ab-tree-select__input",attrs:{value:e.displayValue,size:e.currentSize,disabled:e.disabled,readonly:!0,placeholder:e.placeholder},on:{focus:e.handleFocus,blur:e.handleBlur}},"el-input",e.$attrs,!1),[n("template",{slot:"suffix"},[n("i",{staticClass:"el-input__suffix-inner el-select__caret el-icon-arrow-down",class:{"is-reverse":e.visible}})])],2)],1)])],2)},Hi=[];const Bi={name:"AbTreeSelect",inheritAttrs:!1,props:{value:{type:[Array,String,Number,Boolean,Object],default:void 0},data:{type:Array,default:()=>[]},props:{type:Object,default:()=>({})},multiple:Boolean,checkStrictly:Boolean,filterable:Boolean,disabled:Boolean,placeholder:String,size:String,defaultExpandedKeys:Array,showValue:Boolean,showKey:Boolean,showCode:Boolean,abFormInject:Object},data(){return{visible:!1,filterText:"",dropdownHovering:!1,inputHovering:!1,currentNodeKey:null,defaultExpandedKeysInternal:[]}},computed:{currentSize(){return this.size||this.$ELEMENT&&this.$ELEMENT.size||"default"},treeData(){return this.data||this.abFormInject&&this.abFormInject.options||[]},treeProps(){const e=this.props||{};return{value:e.valueKey||e.nodeKey||"value",label:e.label||"label",children:e.children||"children",disabled:e.disabled||"disabled",leaf:e.leaf||"isLeaf",...e}},filteredData(){if(!this.filterText)return this.treeData;const e=this.filterText.toLowerCase(),t=n=>n.map(r=>{const s=String(r[this.treeProps.label]||"").toLowerCase().includes(e),o=r[this.treeProps.children],l=o?t(o):[];return s||l.length?{...r,[this.treeProps.children]:l}:null}).filter(Boolean);return t(this.treeData)},displayLabels(){if(!this.multiple||!this.value||!Array.isArray(this.value)||!this.value.length)return[];const e=this.treeProps.value,t=this.treeProps.label,n=(r,i)=>{for(const s of r||[]){if(s[e]===i)return s;const o=n(s[this.treeProps.children],i);if(o)return o}return null};return this.value.map(r=>{const i=n(this.treeData,r);return i?{value:r,label:i[t]}:{value:r,label:String(r)}})},displayValue(){if(this.value===void 0||this.value===null||this.value==="")return"";const e=Array.isArray(this.value)?this.value:[this.value],t=this.treeProps.value,n=this.treeProps.label,r=(s,o)=>{for(const l of s||[]){if(l[t]===o)return l[n];const a=r(l[this.treeProps.children],o);if(a)return a}return null};return e.map(s=>r(this.treeData,s)).filter(Boolean).join(", ")}},watch:{visible(e){e&&(this.filterText="",this.$nextTick(()=>{this.$refs.tree&&(this.multiple&&Array.isArray(this.value)?this.$refs.tree.setCheckedKeys(this.value):!this.multiple&&this.value!==void 0&&this.value!==null&&this.$refs.tree.setCurrentKey(this.value))}))},value(e){this.visible&&this.$refs.tree&&(this.multiple&&Array.isArray(e)?this.$refs.tree.setCheckedKeys(e):!this.multiple&&e!==void 0&&e!==null&&this.$refs.tree.setCurrentKey(e))},treeData(e){if(this.defaultExpandedKeys&&this.defaultExpandedKeys.length)this.defaultExpandedKeysInternal=[...this.defaultExpandedKeys];else{const t=[],n=r=>{for(const i of r||[])i[this.treeProps.children]&&i[this.treeProps.children].length&&(t.push(i[this.treeProps.value]),n(i[this.treeProps.children]))};n(e),this.defaultExpandedKeysInternal=t}}},mounted(){this.$emit("fc.el",this.$refs.input),document.addEventListener("click",this.handleOutsideClick,!0),this.updateDefaultExpandedKeys()},beforeDestroy(){document.removeEventListener("click",this.handleOutsideClick,!0)},methods:{filterNodeMethod(e,t){return this.filterText?String(t[this.treeProps.label]||"").toLowerCase().includes(this.filterText.toLowerCase()):!0},getDefaultCheckedKeys(){if(!this.multiple)return[];const e=this.treeProps.value;if(this.checkStrictly)return Array.isArray(this.value)?this.value:this.value?[this.value]:[];const t=[],n=r=>{for(const i of r||[])!i[this.treeProps.children]||!i[this.treeProps.children].length?t.push(i[e]):n(i[this.treeProps.children])};return n(this.treeData),t.filter(r=>Array.isArray(this.value)?this.value.includes(r):this.value===r)},handleNodeClick(e,t,n){if(this.multiple)return;const r=this.treeProps.value,i=e[r];this.$emit("input",i),this.$emit("change",i),this.visible=!1},handleCheckChange(e,t){if(!this.multiple)return;const n=this.treeProps.value,r=this.$refs.tree.getCheckedKeys();let i;this.checkStrictly?i=r:i=this.$refs.tree.getCheckedNodes().filter(o=>o.isLeaf).map(o=>o[n]),this.$emit("input",i),this.$emit("change",i)},handleCurrentChange(e){e&&(this.currentNodeKey=e[this.treeProps.value])},handleFocus(){!this.disabled&&!this.multiple&&(this.inputHovering=!0)},handleBlur(){this.multiple||(this.inputHovering=!1,setTimeout(()=>{!this.inputHovering&&!this.dropdownHovering&&(this.visible=!1)},150))},handleClick(e){if(!this.disabled){if(e.target.closest(".ab-tree-select__tag"))return;this.visible=!this.visible}},onDropdownEnter(){this.dropdownHovering=!0},onDropdownLeave(){this.dropdownHovering=!1,setTimeout(()=>{!this.inputHovering&&!this.dropdownHovering&&(this.visible=!1)},100)},onShow(){this.$emit("visible-change",!0)},onHide(){this.$emit("visible-change",!1)},handleOutsideClick(e){if(this.$refs.popover&&this.$refs.popover.popperElm){const t=this.$refs.popover.popperElm,n=this.$refs.popover.referenceElm||this.$el.querySelector(".ab-tree-select__reference");!t.contains(e.target)&&(!n||!n.contains(e.target))&&(this.visible=!1)}},removeTag(e){if(this.disabled)return;let t;this.multiple&&Array.isArray(this.value)&&(t=this.value.filter(n=>n!==e)),this.$emit("input",t),this.$emit("change",t)},updateDefaultExpandedKeys(){if(this.defaultExpandedKeys&&this.defaultExpandedKeys.length)this.defaultExpandedKeysInternal=[...this.defaultExpandedKeys];else{const e=[],t=n=>{for(const r of n||[])r[this.treeProps.children]&&r[this.treeProps.children].length&&(e.push(r[this.treeProps.value]),t(r[this.treeProps.children]))};t(this.treeData),this.defaultExpandedKeysInternal=e}}}},gt={};var Li=_(Bi,Mi,Hi,!1,zi,"2bf84bb8",null,null);function zi(e){for(let t in gt)this[t]=gt[t]}const Fn=function(){return Li.exports}();var qi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-input",e._b({ref:"el",staticClass:"ab-input-number",attrs:{type:"number",value:e.displayValue,size:e.size,disabled:e.disabled,readonly:e.readonly,placeholder:e.placeholder},on:{input:e.handleInput}},"el-input",e.$attrs,!1),[e.prefix?n("span",{staticClass:"ab-input-number__prefix",attrs:{slot:"prefix"},slot:"prefix"},[e._v(e._s(e.prefix))]):e._e(),e.suffix?n("span",{staticClass:"ab-input-number__suffix",attrs:{slot:"suffix"},slot:"suffix"},[e._v(e._s(e.suffix))]):e._e()])},Yi=[];const Ki={name:"AbInputNumber",inheritAttrs:!1,props:{value:{type:[String,Number],default:void 0},prefix:{type:String,default:void 0},suffix:{type:String,default:void 0},size:{type:String,default:void 0},disabled:Boolean,readonly:Boolean,placeholder:String,abFormInject:{type:Object,default:void 0}},computed:{displayValue(){return this.value===null||this.value===void 0?"":this.value}},methods:{handleInput(e){if(e===""||e===null||e===void 0){this.$emit("input",void 0);return}const t=Number(e);this.$emit("input",Number.isNaN(t)?void 0:t)}}},bt={};var Vi=_(Ki,qi,Yi,!1,Ui,null,null,null);function Ui(e){for(let t in bt)this[t]=bt[t]}const Wi=function(){return Vi.exports}();var Gi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-input-range"},[e.prefix?n("span",{staticClass:"range-prefix"},[e._v(e._s(e.prefix))]):e._e(),e.isReadonly?[e._v(" "+e._s(e.range[0])+" ~ "+e._s(e.range[1])+" ")]:[n("el-input",{staticClass:"ab-input-range__val",attrs:{value:e.range[0]===null?"":e.range[0],size:e.currentSize,placeholder:"最小",clearable:e.clearable},on:{input:function(r){return e.updateRange(0,r)},change:function(r){return e.emitChange(0,r)}}}),n("span",{staticClass:"range-splitter"},[e._v(" ~ ")]),n("el-input",{staticClass:"ab-input-range__val",attrs:{value:e.range[1]===null?"":e.range[1],size:e.currentSize,placeholder:"最大",clearable:e.clearable},on:{input:function(r){return e.updateRange(1,r)},change:function(r){return e.emitChange(1,r)}}})],e.suffix?n("span",{staticClass:"range-suffix"},[e._v(e._s(e.suffix))]):e._e()],2)},Qi=[];const Ji={name:"AbInputRange",props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},prefix:{type:[String,Number],default:void 0},suffix:{type:[String,Number],default:void 0},clearable:{type:Boolean,default:!0},readonly:Boolean},computed:{range(){const e=Array.isArray(this.value)?this.value:[];return[e[0]===void 0?null:e[0],e[1]===void 0?null:e[1]]},isReadonly(){return this.readonly===!0||!!(this.abFormInject&&this.abFormInject.readonly===!0)},currentSize(){return this.$ELEMENT&&this.$ELEMENT.size||"default"}},methods:{rangeWithValue(e,t){const n=[...this.range];return n[e]=t===""?null:t,n},updateRange(e,t){this.$emit("input",this.rangeWithValue(e,t))},emitChange(e,t){this.$emit("change",this.rangeWithValue(e,t))}}},_t={};var Xi=_(Ji,Gi,Qi,!1,Zi,null,null,null);function Zi(e){for(let t in _t)this[t]=_t[t]}const es=function(){return Xi.exports}();var ts=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-time-period w-full"},[n("div",{staticClass:"start-time"},[e._v(e._s(e.period[0]||"--:--"))]),e.isReadonly?n("div",[e._v("~")]):n("el-slider",{class:{"is-empty":!e.period[0]&&!e.period[1]},attrs:{value:e.sliderValue,range:"",step:30,min:e.bounds[0],max:e.bounds[1],"format-tooltip":e.formatTime},on:{input:e.updatePeriod,change:e.handleChange}}),n("div",{staticClass:"end-time"},[e._v(e._s(e.period[1]||"--:--"))])],1)},ns=[];function de(e){const t=/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/.exec(String(e||"").trim());if(!t)return 0;const n=Number(t[1]),r=Number(t[2]),i=t[3]?Number(t[3]):0;return n*3600+r*60+i}function Ie(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60,i=`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`;return r?`${i}:${String(r).padStart(2,"0")}`:i}const rs={name:"AbTimePeriod",props:{abFormInject:{type:Object,default:void 0},value:{type:Array,default:()=>[]},startTime:{type:String,default:"08:00"},endTime:{type:String,default:"18:00"},readonly:Boolean},computed:{isReadonly(){return this.readonly===!0||!!(this.abFormInject&&this.abFormInject.readonly===!0)},bounds(){const e=de(this.startTime),t=de(this.endTime);return e<t?[e,t]:[0,86400]},period(){const e=Array.isArray(this.value)?this.value:[];return[e[0]===""||e[0]===void 0?null:e[0],e[1]===""||e[1]===void 0?null:e[1]]},selected(){const[e,t]=this.bounds,n=this.period[0]===null?e:de(this.period[0]),r=this.period[1]===null?t:de(this.period[1]);return n<=r?[n,r]:[e,t]},sliderValue(){const e=t=>Math.min(this.bounds[1],Math.max(this.bounds[0],t));return[e(this.selected[0]),e(this.selected[1])]}},methods:{formatTime:Ie,toPeriod(e){const t=Array.isArray(e)?e:[];return[this.period[0]!==null&&t[0]===this.sliderValue[0]?this.period[0]:Ie(t[0]),this.period[1]!==null&&t[1]===this.sliderValue[1]?this.period[1]:Ie(t[1])]},updatePeriod(e){this.$emit("input",this.toPeriod(e))},handleChange(e){this.$emit("change",this.toPeriod(e))}}},vt={};var is=_(rs,ts,ns,!1,ss,null,null,null);function ss(e){for(let t in vt)this[t]=vt[t]}const os=function(){return is.exports}(),C=(e="localStorage")=>({wsCache:e==="localStorage"?window.localStorage:window.sessionStorage,setLang:as,getLang:An,isZhCN:kn,setTheme:ls,getTheme:us,isDark:cs,setCurrentSize:ds,getCurrentSize:fs,setUser:ps,getUser:hs}),N={IS_DARK:"isDark",LANG:"lang",THEME:"theme",LAYOUT:"layout",CURRENT_SIZE:"currentSize",USER:"user"},as=(e="")=>{const{wsCache:t}=C();t.setItem(N.LANG,e)},An=()=>{const{wsCache:e}=C();return e.getItem(N.LANG)},kn=()=>{const e=An()||"";return!e||String(e).toLowerCase()==="zh-cn"},ls=e=>{const{wsCache:t}=C();t.setItem(N.THEME,JSON.stringify(e||"{}"))},us=()=>{const{wsCache:e}=C(),t=e.getItem(N.THEME);return t?JSON.parse(t):void 0},cs=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,ds=(e="")=>{const{wsCache:t}=C();t.setItem(N.CURRENT_SIZE,e)},fs=()=>{const{wsCache:e}=C();return e.getItem(N.CURRENT_SIZE)},ps=e=>{const{wsCache:t}=C();t.setItem(N.USER,JSON.stringify(e||"{}"))},hs=()=>{const{wsCache:e}=C(),t=e.getItem(N.USER),n=t?JSON.parse(t):{};return n.permissions=new Set(n.permissions||[]),n};var ms=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-time-picker",e._b({ref:"el",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-time-picker",e.$attrs,!1))},ys=[];const gs={name:"AbTimePicker",inheritAttrs:!1,props:{value:{default:void 0},abFormInject:{type:Object,default:void 0}},computed:{currentSize(){const{getCurrentSize:e}=C(),t=e();return t&&t!=="default"&&t!=="large"?t:void 0}},methods:{handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},$t={};var bs=_(gs,ms,ys,!1,_s,null,null,null);function _s(e){for(let t in $t)this[t]=$t[t]}const vs=function(){return bs.exports}();var $s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-color-picker",e._b({ref:"el",staticClass:"ab-color-picker",attrs:{value:e.value,size:e.currentSize},on:{input:e.handleInput,change:e.handleChange}},"el-color-picker",e.$attrs,!1))},ws=[];const Ss={name:"AbColorPicker",inheritAttrs:!1,props:{value:{default:void 0},abFormInject:{type:Object,default:void 0}},computed:{currentSize(){const{getCurrentSize:e}=C(),t=e();return t&&t!=="default"&&t!=="large"?t:void 0}},methods:{handleInput(e){this.$emit("input",e)},handleChange(e){this.$emit("change",e)}}},wt={};var xs=_(Ss,$s,ws,!1,Cs,null,null,null);function Cs(e){for(let t in wt)this[t]=wt[t]}const Ts=function(){return xs.exports}();var Fs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-upload-file"},[e.currentDisabled?e._e():n("el-upload",{attrs:{action:"","show-file-list":!1,drag:e.drag,multiple:e.currentLimit>1,accept:e.accept,"before-upload":e.beforeUpload,"http-request":e.uploadRequest}},[n("el-button",{attrs:{type:"primary",size:"small"}},[e._v("选择文件")]),e.isShowTip?n("div",{staticClass:"ab-upload-file__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 支持 "+e._s(e.fileTypes.join("/"))+",单个不超过 "+e._s(e.fileSize)+" MB ")]):e._e()],1),n("ul",{staticClass:"ab-upload-file__list"},e._l(e.files,function(r){return n("li",{key:r.uid,staticClass:"ab-upload-file__item"},[n("span",{staticClass:"ab-upload-file__name"},[e._v(e._s(r.name))]),r.status==="uploading"?n("span",{staticClass:"ab-upload-file__tip"},[e._v("上传中...")]):e._e(),r.error?n("span",{staticClass:"ab-upload-file__error"},[e._v(e._s(r.error))]):e._e(),r.url&&e.preEnabled?n("el-button",{attrs:{type:"text"},on:{click:function(i){return e.preview(r)}}},[e._v("预览")]):e._e(),r.url&&e.dowEnabled?n("el-link",{attrs:{href:r.url,target:"_blank",download:""}},[e._v("下载")]):e._e(),!e.currentDisabled&&e.delEnabled&&r.status!=="uploading"?n("el-button",{attrs:{type:"text"},on:{click:function(i){return e.removeFile(r)}}},[e._v(" 删除 ")]):e._e()],1)}),0)],1)},As=[];const ks=["png","jpg","jpeg","gif","webp","bmp","svg"],Ps=["doc","xls","txt","pdf"];function Es(e){const t=String(e).split(/[?#]/,1)[0].split("/").pop()||e;try{return decodeURIComponent(t)}catch(n){if(n instanceof URIError)return t;throw n}}function Is(e){if(typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()&&e!=="new")return e}const Ds={name:"AbUploadFile",props:{value:{type:Array,default:()=>[]},apis:{type:Object,default:void 0},abFormInject:{type:Object,default:void 0},idFieldTable:{type:String,default:void 0},businessCode:{type:String,default:void 0},uploadType:{type:String,default:void 0},maxLength:{type:[Number,String],default:void 0},fileType:{type:Array,default:void 0},fileSize:{type:Number,default:5},limit:{type:Number,default:void 0},drag:Boolean,isShowTip:{type:Boolean,default:!0},readonly:Boolean,disabled:Boolean,delEnabled:{type:Boolean,default:!0},preEnabled:{type:Boolean,default:!0},dowEnabled:{type:Boolean,default:!0},coverEnabled:Boolean,autoCover:Boolean},data(){return{uid:0,files:[]}},computed:{currentDisabled(){return this.disabled||this.readonly||!!(this.abFormInject&&this.abFormInject.readonly===!0)},currentLimit(){return this.limit!=null?Number(this.limit):this.maxLength!=null?Number(this.maxLength):5},fileTypes(){return Array.isArray(this.fileType)&&this.fileType.length?this.fileType:this.uploadType==="image"?ks:Ps},accept(){return this.fileTypes.map(e=>`.${String(e).replace(/^\./,"")}`).join(",")},apisClient(){return this.apis||this.$abUploadApis}},watch:{value:{handler(e){this.syncFromValue(e)},immediate:!0,deep:!0}},methods:{syncFromValue(e){const t=Array.isArray(e)?e:[],n=[...this.files],r=t.map(i=>{const s=n.findIndex(o=>o.url===i);return s>-1?n.splice(s,1)[0]:{uid:++this.uid,name:Es(i),url:i,id:void 0,fileId:void 0,size:void 0,error:void 0,status:"linked"}});this.files=[...r,...this.files.filter(i=>i.status==="uploading"||i.status==="failed")]},publish(){this.$emit("input",this.files.filter(e=>e.url).map(e=>e.url))},beforeUpload(e){if(this.files.filter(i=>i.status==="uploading"||i.status==="linked").length>=this.currentLimit)return this.$message.error(`最多上传 ${this.currentLimit} 个文件`),!1;const n=e.name||"",r=n.includes(".")?n.slice(n.lastIndexOf(".")+1).toLowerCase():"";return this.fileTypes.length&&!this.fileTypes.some(i=>String(i).toLowerCase().replace(/^\./,"")===r)?(this.$message.error(`仅支持 ${this.fileTypes.join("/")} 格式`),!1):e.size>this.fileSize*1024*1024?(this.$message.error(`文件大小不能超过 ${this.fileSize} MB`),!1):!0},uploadRequest(e){const t=this.apisClient;if(!t||typeof t.upload!="function"){const r=new Error("未配置上传接口");return this.$message.error(r.message),this.$emit("error",r),Promise.reject(r)}const n={uid:++this.uid,name:e.file&&e.file.name,url:void 0,id:void 0,fileId:void 0,size:void 0,error:void 0,status:"uploading"};return this.files.push(n),Promise.resolve().then(()=>t.upload({file:e.file})).then(r=>{const i=r&&r.data?r.data:r;if(!i||i.id==null||typeof i.url!="string"||!i.url)throw new TypeError("上传接口需返回 id、name、url");return this.$set(n,"id",i.id),this.$set(n,"fileId",i.id),this.$set(n,"url",i.url),this.$set(n,"name",i.name||e.file&&e.file.name||i.url),this.$set(n,"size",i.size),this.$set(n,"status","linked"),this.publish(),r}).catch(r=>{throw this.$set(n,"status","failed"),this.$set(n,"error",this.errorMessage(r)),this.$emit("error",r),r})},handleUploadError(e){this.$emit("error",e)},removeFile(e){const t=this.apisClient,n=this.businessId(),r=()=>{this.files=this.files.filter(i=>i.uid!==e.uid),this.publish()};if(t&&typeof t.remove=="function"&&e.fileId!=null&&n!==void 0){Promise.resolve(t.remove({...this.businessParams(n),fileId:e.fileId})).then(r).catch(i=>{this.$message.error(this.errorMessage(i)),this.$emit("error",i)});return}r()},preview(e){const t=e.name||"",n=t.includes(".")?t.slice(t.lastIndexOf(".")+1).toLowerCase():"";this.$emit("preview",{url:e.url,name:t,extension:n,fileId:e.fileId})},businessId(){const e=this.abFormInject,t=e&&e.formValue&&e.idField?e.formValue[e.idField]:void 0;return Is(t)},businessParams(e){return{businessType:this.idFieldTable||this.abFormInject&&this.abFormInject.idFieldTable,businessCode:this.businessCode,businessId:e}},errorMessage(e){return e instanceof Error?e.message:String(e)}}},St={};var Rs=_(Ds,Fs,As,!1,Ns,"0306328f",null,null);function Ns(e){for(let t in St)this[t]=St[t]}const Os=function(){return Rs.exports}();function Pn(e){return typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"}function En(e){return typeof e=="string"||typeof e=="function"||Pn(e)}function De(e){return e==null||typeof e=="string"||typeof e=="number"?e:String(e)}function xt(e){if(e!=null)return typeof e=="string"||typeof e=="number"?e:String(e)}function js(e,t,n){if(t==null||t==="")return;if(typeof e=="function")return e(n);if(typeof e=="string")return{name:e,query:{id:De(t)}};if(!Pn(e))return;const r={name:e.name},i=e.query;typeof i=="string"?r.query={[i]:De(t)}:i&&(r.query={},Object.keys(i).forEach(o=>{const l=i[o];r.query[o]=De(n[l])}));const s=e.params;if(typeof s=="string"){const o=xt(t);o!==void 0&&(r.params={[s]:o})}else s&&(r.params={},Object.keys(s).forEach(o=>{const l=s[o],a=xt(n[l]);a!==void 0&&(r.params[o]=a)}));return r}var Ms=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"ab-router-link"},[n("ab-icon",{attrs:{icon:"ep:link",size:16,color:e.primaryColor}}),e.to?n("router-link",{staticClass:"ab-router-link__anchor",attrs:{to:e.to}},[e._t("default")],2):e._t("default")],2)},Hs=[];const Bs={name:"AbRouterLink",props:{link:{type:[String,Function,Object],default:void 0},value:{default:void 0},row:{type:Object,default:()=>({})}},computed:{to(){return js(this.link,this.value,this.row)},primaryColor(){const e=getComputedStyle(document.documentElement);return(e==null?void 0:e.getPropertyValue("--el-color-primary").trim())||"#1890ff"}}},Ct={};var Ls=_(Bs,Ms,Hs,!1,zs,"973bb136",null,null);function zs(e){for(let t in Ct)this[t]=Ct[t]}const ae=function(){return Ls.exports}(),qs=[Kt,rr,ur,nt,Fn,Wi,es,os,vs,Ts,Os,ae],Ys="checkbox",Ks={name:Ys,parser:m.BaseParser},Vs="colorPicker";let Us=class extends m.BaseParser{render(t){const n=this.vm&&this.vm.$createElement;if(this.vm&&this.vm.readonly===!0&&n){const r=this.$handle.getFormData(this),i=typeof r=="string"?r:void 0;return n("span",{class:"ab-color-picker__readonly",style:{backgroundColor:i,color:i?w.Color.getContrast(i):w.ColorsEnum.black||"#000000"},attrs:{title:i||""}},[String(r??"")])}return this.$render.defaultRender(this,t)}};const Ws={name:Vs,parser:Us},Gs="datePicker",Tt={date:"yyyy-MM-dd",month:"yyyy-MM",datetime:"yyyy-MM-dd HH:mm:ss",week:"yyyywWW",timerange:"HH:mm:ss",daterange:"yyyy-MM-dd",monthrange:"yyyy-MM",datetimerange:"yyyy-MM-dd HH:mm:ss",year:"yyyy"};let Qs=class extends m.BaseParser{init(){const t=this.rule.props;t.valueFormat||(t.valueFormat=Tt[t.type]||Tt.date)}};const Js={name:Gs,parser:Qs},Xs="frame";let Zs=class extends m.BaseParser{render(t){const n=this.$render.inputVData(this).props("field",this.field);return this.vNode.frame(n,t)}closeModel(){this.el.closeModel&&this.el.closeModel()}};const eo={name:Xs,parser:Zs},to="hidden";let no=class extends m.BaseParser{render(){return[]}};const ro={name:to,parser:no},io="input";let so=class extends m.BaseParser{init(){const{props:t}=this.rule;t&&t.autosize&&t.autosize.minRows&&w.$set(t,"rows",t.autosize.minRows||2)}};const oo={name:io,parser:so};function ao(){if(typeof window>"u")return"¥";try{return kn()?"¥":"$"}catch{return"¥"}}class Ft extends m.BaseParser{}class lo extends m.BaseParser{init(){const t=this.rule.props=this.rule.props||{};t.prefix===void 0&&(t.prefix=ao()),t.align===void 0&&(t.align="right")}}class uo extends m.BaseParser{init(){const t=this.rule.props=this.rule.props||{};t.suffix===void 0&&(t.suffix="%"),t.align===void 0&&(t.align="right")}}const co="radio",fo={name:co,parser:m.BaseParser},po="select";let ho=class extends m.BaseParser{toFormValue(t){return this.rule.props.multiple&&!Array.isArray(t)?w.toArray(t):t}};const mo={name:po,parser:ho},yo="slider";let go=class extends m.BaseParser{toFormValue(t){const n=this.rule,r=Array.isArray(t),i=n.props,s=i.min||0;let o;return i.range===!0?o=r?t:[s,parseFloat(t)||s]:o=r?parseFloat(t[0])||s:parseFloat(t),o}};const bo={name:yo,parser:go},_o="switch";let vo=class extends m.BaseParser{render(t){return this.vNode.switch(this.$render.inputVData(this).get(),t)}};const $o={name:_o,parser:vo},V=e=>String(e).padStart(2,"0");function E(e){return typeof e>"u"||e==="undefined"||e==="null"||e===null||e===""||typeof e=="number"&&isNaN(e)}function wo(e){return E(e)?e:new Intl.NumberFormat("zh-CN",{style:"currency",currency:"CNY"}).format(e)}function So(e){return E(e)?e:(Math.round(e*100)/100).toLocaleString()}function xo(e){return E(e)?e:Math.round(e*100)/100+" %"}function ee(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e);if(typeof e=="string"){const t=e.trim();return/^\d+$/.test(t)?new Date(Number(t)):new Date(t)}return new Date(e)}function In(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),n=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-n);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return{year:t.getUTCFullYear(),week:Math.ceil(((t-r)/864e5+1)/7)}}function k(e,t="YYYY-MM-DD"){if(e==null||e==="")return e;const n=ee(e);if(isNaN(n.getTime()))return e;const r=In(n),i={YYYY:String(n.getFullYear()),MM:V(n.getMonth()+1),DD:V(n.getDate()),HH:V(n.getHours()),mm:V(n.getMinutes()),ss:V(n.getSeconds()),Q:String(Math.floor(n.getMonth()/3)+1),W:String(r.week),GGGG:String(r.year)};return t.replace(/YYYY|MM|DD|HH|mm|ss|Q|W|GGGG/g,s=>i[s])}function Co(e,t,n="label",r){if(Array.isArray(t)&&!t.length)return"";let i=t;if(Array.isArray(i)?i=i.map(l=>String(l).trim()):i!=null&&(i=String(i).trim()),!e||!e.length)return E(i)?"":i;const s=l=>!Array.isArray(r)||!r.length?!0:r.some(a=>!a||typeof a!="object"?!0:Object.entries(a).every(([c,u])=>{const d=l?l[c]:void 0;return u==null?d===u:Array.isArray(u)?u.some(f=>String(d)===String(f)):Array.isArray(d)?d.some(f=>String(f)===String(u)):String(d)===String(u)})),o=Array.isArray(i)?e.filter(l=>i.includes(String(l.value))&&s(l)):e.filter(l=>(l.value===i||String(l.value)===String(i))&&s(l));if(o.length){const l=o.map(a=>a[n]).filter(a=>a!=null&&a!=="");return[...new Set(l)].join("、")}return Array.isArray(i)||E(i)?"":i}const At=({cellValue:e}={},t="YYYY-MM-DD HH:mm")=>k(e,t),Re=({cellValue:e}={},t="YYYY")=>k(e,t),Ne=({cellValue:e}={},t="Q")=>e==null||e===""||isNaN(ee(e).getTime())?e:`${k(e,"YYYY")}年${k(e,t)}季度`,Oe=({cellValue:e}={},t="MM")=>e==null||e===""||isNaN(ee(e).getTime())?e:`${k(e,"YYYY")}年 ${k(e,t)}月`,To=({cellValue:e}={},t="W")=>{if(e==null||e==="")return e;const n=typeof e=="string"?/^(\d{4})-(\d{1,2})(?:st|nd|rd|th|周)$/i.exec(e):null;if(!n&&isNaN(ee(e).getTime()))return e;const r=In(ee(e));return`${n?n[1]:r.year}年第${n?n[2]:k(e,t)}周`},Fo=({cellValue:e,itemValue:t}={})=>{const n=e??t;return E(n)?n:So(n)},Ao=({cellValue:e}={})=>E(e)?e:xo(e),ko=({cellValue:e,itemValue:t}={})=>{const n=E(e)?t:e;return E(n)?n:wo(n)};function te(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,r)=>te(n,t[r]));if(e&&t&&typeof e=="object"&&typeof t=="object"){const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(r=>te(e[r],t[r]))}return!1}function Dn(e,t,{valueField:n="value",childrenField:r="children"}={}){for(const i of e||[]){if(te(i?i[n]:void 0,t))return i;const s=Dn(i?i[r]:void 0,t,{valueField:n,childrenField:r});if(s)return s}}function kt(e){var n;const t=((n=e.props)==null?void 0:n.options)||e.options;return({cellValue:r})=>r==null||r===""?"":(Array.isArray(r)?r:[r]).map(s=>{const o=Array.isArray(t)?t.find(l=>l&&l.value===s):void 0;return o&&o.label!==void 0?o.label:s??""}).join("、")}function Po(e){return({cellValue:t})=>{const{activeValue:n=!0,inactiveValue:r=!1,activeText:i,inactiveText:s}=e.props||{};return t===n?i||"开启":t===r?s||"关闭":t??""}}function Eo(e){const t=e.props||{},n=t.props||{},r=e.optionsTo==="props.data"&&Array.isArray(e.options)?e.options:t.data,i=n.value??t.nodeKey??t.valueKey??"value",s=n.label??"label",o=n.children??"children";return({cellValue:l})=>l==null||l===""?"":(Array.isArray(l)?l:[l]).map(c=>{const u=Array.isArray(r)?Dn(r,c,{valueField:i,childrenField:o}):void 0;return u&&u[s]!==void 0?u[s]:c}).join("、")}function Rn(e,t,n,r){for(const i of e||[]){if(te(i[n],t))return[i];const s=Rn(i[r],t,n,r);if(s)return[i,...s]}}function Io(e){const t=e.props||{},n=t.props||{},r=e.optionsTo==="props.options"&&Array.isArray(e.options)?e.options:t.options,i=n.value??"value",s=n.label??"label",o=n.children??"children",l=Array.isArray(r)?r:[],a=t.separator??" / ",c=t.showAllLevels!==!1;function u(d){let f;if(n.emitPath===!1){const p=Rn(l,d,i,o);f=p?p.map(h=>h[s]??h[i]):[d]}else{const p=Array.isArray(d)?d:[d];let h=l;f=p.map(y=>{const b=h.find(L=>te(L[i],y));return h=b&&Array.isArray(b[o])?b[o]:[],b&&b[s]!==void 0?b[s]:y})}return(c?f:f.slice(-1)).join(a)}return({cellValue:d})=>d==null||d===""?"":n.multiple===!0?(Array.isArray(d)?d:[d]).map(u).join("、"):u(d)}const Do={year:Re,years:Re,yearrange:Re,quarter:Ne,quarters:Ne,quarterrange:Ne,month:Oe,months:Oe,monthrange:Oe,week:To,datetime:At,datetimerange:At},Ro=/YYYY|MM|DD|HH|mm|ss/g,No=/[.*+?^${}()|[\]\\]/g;function Nn(e,t){if(typeof e!="string"||typeof t!="string"||t==="YYYY-wo")return e;if(t==="x"||t==="X"){const l=Number(e);return Number.isFinite(l)?new Date(t==="X"?l*1e3:l):e}const n=[],r=t.replace(No,"\\$&").replace(Ro,l=>(n.push(l),"\\d{1,4}")),i=new RegExp(`^${r}$`).exec(e);if(!i)return e;const s={YYYY:1970,MM:1,DD:1,HH:0,mm:0,ss:0};n.forEach((l,a)=>{s[l]=Number(i[a+1])});const o=new Date(s.YYYY,s.MM-1,s.DD,s.HH,s.mm,s.ss);return isNaN(o.getTime())?e:o}function Oo(e){var r;const t=((r=e.props)==null?void 0:r.type)??"date",n=i=>{var l,a;if(i==null||i==="")return"";const s=Nn(i,(l=e.props)==null?void 0:l.valueFormat);if((a=e.props)!=null&&a.format)return k(s,e.props.format);const o=Do[t];return o?o({cellValue:s}):k(s)};return({cellValue:i})=>{var o;if(!Array.isArray(i))return n(i);if(i.every(l=>l==null||l===""))return"";const s=t.endsWith("range")?((o=e.props)==null?void 0:o.rangeSeparator)??" - ":"、";return i.map(n).join(s)}}function jo(e){const t=n=>{var i,s;if(n==null||n==="")return"";const r=Nn(n,((i=e.props)==null?void 0:i.valueFormat)??"HH:mm");return k(r,((s=e.props)==null?void 0:s.format)??"HH:mm")};return({cellValue:n})=>{var r;return Array.isArray(n)?n.every(i=>i==null||i==="")?"":n.map(t).join(((r=e.props)==null?void 0:r.rangeSeparator)??" - "):t(n)}}const Mo=new Map([["radio",kt],["checkbox",kt],["switch",Po],["treeSelect",Eo],["cascader",Io],["inputNumber",()=>Fo],["inputCurrency",()=>ko],["inputPercent",()=>Ao],["datePicker",Oo],["timePicker",jo]]);function Te(e){if(typeof e.formatter=="function")return{...e,formatter:e.formatter};const t=Mo.get(e.type??"");let n;return t?n=t(e):Array.isArray(e.options)&&e.options.length>0&&(n=Ho(e)),{...e,formatter:n}}function Ho(e){return({cellValue:t})=>Co(e.options,t)}const Bo="text";let Lo=class extends m.BaseParser{render(){const n=this.rule.field!==void 0?this.$handle.getFormData(this):this.rule.value,r=this.$handle&&this.$handle.fCreateApi?this.$handle.fCreateApi.formData():{},i=Te({...this.rule,props:this.rule.props||{}}).formatter,s=typeof i=="function"?i({cellValue:n,column:this.rule,row:r}):n,o=String(s??""),l=this.rule.link;return En(l)?this.vNode.make(ae,{props:{link:l,value:n,row:r}},[o]):this.vNode.make("span",{domProps:{textContent:o}})}};const zo={name:Bo,parser:Lo},qo="timePicker";let Yo=class extends m.BaseParser{init(){const t=this.rule.props;t.valueFormat||(t.valueFormat="HH:mm:ss")}};const Ko={name:qo,parser:Yo},Vo="tree";let Uo=class extends m.BaseParser{init(){const t=this.rule.props;w.isUndef(t.nodeKey)&&w.$set(t,"nodeKey","id"),w.isUndef(t.props)&&w.$set(t,"props",{label:"title"})}render(t){const n=this.$render.parserToData(this).get();return this.vNode.tree({props:{ctx:n,children:t,value:this.$handle.getFormData(this),type:n.props.type},ref:this.refName,key:this.key,on:{input:r=>{this.$render.onInput(this,r)}}})}};const Wo={name:Vo,parser:Uo},Go="upload";class Qo extends m.BaseParser{render(t){const n=this.$render.parserToData(this).get(),{key:r,refName:i}=this;delete n.props.fileList;const s={uploadType:n.props.uploadType,maxLength:n.props.limit,modalTitle:n.props.modalTitle,handleIcon:n.props.handleIcon,onHandle:n.props.onHandle,allowRemove:n.props.allowRemove,previewMask:n.props.previewMask,value:this.$handle.getFormData(this),ctx:n,children:t};return this.vNode.upload({props:s,key:r,ref:i,on:{input:o=>{this.$render.onInput(this,o)}}})}}const Jo={name:Go,parser:Qo},Xo=[Ks,Ws,Js,eo,ro,oo,fo,mo,bo,$o,zo,Ko,Wo,Jo,{name:"number",parser:Ft},{name:"inputNumber",parser:Ft},{name:"inputCurrency",parser:lo},{name:"inputPercent",parser:uo}];function Zo(){return{form:{inline:!0,labelPosition:"right",labelSuffix:void 0,hideRequiredAsterisk:!1,labelWidth:"120px",fieldWidth:"238px",showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,disabled:!1,size:void 0},row:{gutter:0,type:void 0,align:void 0,justify:void 0,tag:"div"},info:{type:"popover",trigger:"hover",placement:"top-start",icon:"el-icon-warning"},submitBtn:{type:"primary",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-upload",width:"100%",autofocus:!1,nativeType:"button",innerText:"提交",show:!1,col:void 0,click:void 0},resetBtn:{type:"default",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-refresh",width:"100%",autofocus:!1,nativeType:"button",innerText:"重置",show:!1,col:void 0,click:void 0}}}const v="el",ea={input:`${v}-input`,password:`${v}-input`,textarea:`${v}-input`,text:"span",hidden:"span",divider:`${v}-divider`,number:`${v}-input-number`,inputNumber:`${v}-input-number`,inputCurrency:"ab-input-number",inputPercent:"ab-input-number",select:"ab-select",radio:"ab-radio",checkbox:"ab-checkbox",switch:`${v}-switch`,datePicker:`${v}-date-picker`,timePicker:"ab-time-picker",slider:`${v}-slider`,rate:`${v}-rate`,colorPicker:"ab-color-picker",cascader:`${v}-cascader`,treeSelect:"ab-tree-select",inputRange:"ab-input-range",timePeriod:"ab-time-period",uploadFile:"ab-upload-file",upload:"ab-upload-file",form:`${v}-form`,formItem:`${v}-form-item`,ElButton:`${v}-button`,button:`${v}-button`,icon:"ab-icon",row:`${v}-row`,col:`${v}-col`};const ta=new Set(["select","treeselect","radio","checkbox","inputrange","timeperiod","tree","upload","uploadfile","frame"]),na=new Set(["input","password","textarea","number","inputnumber","inputcurrency","inputpercent","select","radio","checkbox","switch","datepicker","timepicker","slider","rate","cascader","treeselect","text"]);function Pt(e){return e.type==="tooltip"}class ra extends m.BaseForm{get injectTypes(){return ta}readonlyRender(t){if(!this.$handle.vm||!this.$handle.vm.readonly||!t.isDef||t.rule.component||!na.has(t.type))return;const n=t.rule,r=this.$handle.getFormData(t),i=this.$handle.formData||{},s=Te({...n,props:n.props||{}}).formatter,o=typeof s=="function"?s({cellValue:r,column:n,row:i}):r,l=String(o??""),a=n.link;return En(a)?this.vNode.make(ae,{props:{link:a,value:r,row:i}},[l]):this.vNode.make("span",{domProps:{textContent:l}})}inputVData(t){const n=t.rule.props||{};t.vData.attrs({...n}),!n.size&&this.options.form.size&&t.vData.props("size",this.options.form.size)}validate(t){this.getFormRef().validate(n=>{t&&t(n)})}validateField(t,n){this.getFormRef().validateField(t,n)}resetField(t){this.vm.$refs[t.formItemRefName].resetField()}clearValidateState(t){const n=this.vm.$refs[t.formItemRefName];n&&(n.validateMessage="",n.validateState="")}beforeRender(){this.propsData=this.vData.props(this.options.form).props({model:this.$handle.formData,rules:this.$handle.validate,key:"form"+this.unique}).ref(this.refName).nativeOn({submit:w.preventDefault}).class(this.options.form.className).class("form-create",!0).class("ab-form",!0).key(this.unique).get()}render(t){return t.length>0&&t.push(this.makeFormBtn()),this.vNode.form(this.propsData,[this.options.row===!1?t:this.makeRow(t)])}makeRow(t){const n={},r=this.options.row||{};return r.class&&(n[r.class]=!0),this.vNode.row({props:r||{},key:"fr"+this.unique,class:n},t)}container(t,n){return this.makeFormItem(n,t)}makeFormItem(t,n){let r=`fItem${t.key}${this.unique}`,{rule:i,field:s,formItemRefName:o}=t,l=this.getGetCol(t),a=!l.labelWidth&&!i.title?0:l.labelWidth,c=t.isDef?this.options.form&&this.options.form.fieldWidth:"",{inline:u,col:d}=this.propsData.props,f=this.vData.props({prop:s,rules:i.validate,labelWidth:w.toString(a),required:i.props.required}).key(r).ref(o).class(i.className).style(c?{"--ab-field-width":w.toString(c)}:void 0).get(),p=this.vNode.formItem(f,[n,this.makeFormPop(t,r)]);return u===!0||d===!1?p:this.makeCol(l,t,r,[p])}makeFormPop({rule:t},n){if(t.title){const r=w.isString(t.title)?{title:t.title}:t.title,i=this.options.info||{},s=[r.title||""];return t.info&&s.push(this.vNode.make(Pt(i)?"el-tooltip":"el-popover",{props:{...i,content:t.info},key:`pop${n}`},[this.vNode.icon({class:[i.icon||"el-icon-warning"],slot:Pt(i)?"default":"reference"})])),this.vNode.make("span",{...r,slot:"label"},s)}}makeCol(t,n,r,i){t.span===void 0&&(t.span=24);const s={};return t.class&&(s[t.class]=!0),this.vNode.col({props:t,class:s,key:`${r}col1`},i)}makeFormBtn(){let t=[],n=this.vm.buttonProps!==!1&&this.vm.buttonProps.show!==!1,r=this.vm.resetProps!==!1&&this.vm.resetProps.show!==!1;return n&&t.push(this.makeSubmitBtn(r?19:24)),r&&t.push(this.makeResetBtn(4)),this.propsData.props.inline===!0?t:t.length?this.vNode.col({props:{span:24},key:`${this.unique}col2`},t):[]}makeResetBtn(t){const n=this.vm.resetProps,r=n.col||{span:t,push:1};return this.vNode.col({props:r,key:`${this.unique}col3`},[this.vNode.button({key:`frsbtn${this.unique}`,props:n,on:{click:()=>{const i=this.$handle.fCreateApi;w.isFunction(n.click)?n.click(i):i.resetFields()}},style:{width:n.width}},[n.innerText])])}makeSubmitBtn(t){const n=this.vm.buttonProps,r=n.col||{span:t};return this.vNode.col({props:r,key:`${this.unique}col4`},[this.vNode.button({key:`fbtn${this.unique}`,props:n,on:{click:()=>{const i=this.$handle.fCreateApi;w.isFunction(n.click)?n.click(i):i.submit()}},style:{width:n.width}},[n.innerText])])}}const ia="datePicker",sa=["year","month","date","dates","week","datetime","datetimeRange","dateRange"].reduce((e,t)=>(e[t]=m.creatorTypeFactory(ia,t.toLowerCase()),e),{}),oa="frame",je={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]},B=Object.keys(je).reduce((e,t)=>(e[t]=m.creatorTypeFactory(oa,n=>n.props({type:je[t][0],maxLength:je[t][1]})),e),{});B.frameInput=B.frameInputs;B.frameFile=B.frameFiles;B.frameImage=B.frameImages;const On="input",jn=["password","url","email","text","textarea"].reduce((e,t)=>(e[t]=m.creatorTypeFactory(On,t),e),{});jn.idate=m.creatorTypeFactory(On,"date");const Et="select",aa={selectMultiple:m.creatorTypeFactory(Et,!0,"multiple"),selectOne:m.creatorTypeFactory(Et,!1,"multiple")},la="slider",ua={sliderRange:m.creatorTypeFactory(la,!0,"range")},It="timePicker",ca={time:m.creatorTypeFactory(It,e=>e.props({isRange:!1})),timeRange:m.creatorTypeFactory(It,e=>e.props({isRange:!0}))},da="tree",Dt={treeSelected:"selected",treeChecked:"checked"},fa=Object.keys(Dt).reduce((e,t)=>(e[t]=m.creatorTypeFactory(da,Dt[t]),e),{}),pa="upload",Me={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]},ne=Object.keys(Me).reduce((e,t)=>(e[t]=m.creatorTypeFactory(pa,n=>n.props({uploadType:Me[t][0],maxLength:Me[t][1]})),e),{});ne.uploadImage=ne.image;ne.uploadFile=ne.file;const I={...sa,...B,...jn,...aa,...ua,...ca,...fa,...ne},ha=["autoComplete","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate","group"];ha.forEach(e=>{I[e]=m.creatorFactory(e)});I.auto=I.autoComplete;I.number=I.inputNumber;I.color=I.colorPicker;I.hidden=(e,t)=>m.creatorFactory("hidden")("",e,t);const ma=24*60*60*1e3,F={today:"今天",yesterday:"昨天",lastWeek:"上周",last7:"近7天",last30:"近30天",thisMonth:"本月",thisYear:"今年"},ya=["rgba(1, 1, 1, 0)","#45b787","#21532fff","#6e9bc5","#2775b6","#F26666","#D95970","#ECD2B9","#BF9D8A","#ECDEC0","#D0AC57","#e0e0e0","#beb6b6","#918883","#F2F2F2","#ececec","#2E3032","#182327","rgba(0, 0, 0, 0.5)"];function fe(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function U(e,...t){const n=fe(e)?{...e}:{};for(const r of t)if(fe(r))for(const i of Object.keys(r)){const s=r[i];n[i]=fe(s)?U(fe(n[i])?n[i]:{},s):s}return n}function Rt(e,t,n){let r=e;for(const i of t.split(".")){if(r==null)return n;r=r[i]}return r===void 0?n:r}function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function j(e){const t=new Date(e);return t.setHours(23,59,59,999),t}function Mn(e){const t=P(e);return t.setDate(t.getDate()-t.getDay()),t}function ga(e){const t=P(e);return t.setDate(t.getDate()-t.getDay()+6),j(t)}function ba(e){const t=P(e);return t.setDate(1),t}function _a(e){return new Date(new Date(e).getFullYear(),0,1,0,0,0,0)}function D(e,t){return new Date(e.getTime()+t*ma)}const va=[{text:F.today,value:()=>P(new Date).getTime()},{text:F.yesterday,value:()=>P(D(new Date,-1)).getTime()},{text:F.lastWeek,value:()=>Mn(D(new Date,-7)).getTime()}],$a=[{text:F.today,value:()=>[P(new Date).getTime(),j(new Date).getTime()]},{text:F.yesterday,value:()=>[P(D(new Date,-1)).getTime(),j(D(new Date,-1)).getTime()]},{text:F.lastWeek,value:()=>[Mn(D(new Date,-7)).getTime(),ga(D(new Date,-7)).getTime()]},{text:F.last7,value:()=>[P(D(new Date,-7)).getTime(),j(new Date).getTime()]},{text:F.last30,value:()=>[P(D(new Date,-30)).getTime(),j(new Date).getTime()]},{text:F.thisMonth,value:()=>[ba(new Date).getTime(),j(new Date).getTime()]},{text:F.thisYear,value:()=>[_a(new Date).getTime(),j(new Date).getTime()]}];function wa(e){return e.getTime()>Date.now()}const Nt={hidden:{hidden:!0},datePicker:{props:{valueFormat:"timestamp"}},timePicker:{props:{format:"HH:mm",valueFormat:"HH:mm"}},select:{props:{showKey:!0,showCode:!0}},treeSelect:{props:{defaultExpandAll:!0,expandOnClickNode:!1}},treeSelectMultiple:{props:{multiple:!0,type:"checked",showCheckbox:!0}},inputNumber:{align:"right"},inputCurrency:{align:"right"},inputPercent:{align:"right"},switch:{align:"center"},colorPicker:{props:{showAlpha:!0,predefine:ya}},divider:{props:{contentPosition:"left"}}};function Sa(e,t){if(t===void 0)return e;if(!Array.isArray(t))return t;const n=new Set(t.map(r=>r&&r.slot).filter(Boolean));return[...e.filter(r=>!r.slot||!n.has(r.slot)),...t]}function Hn(e,t={}){const{type:n,disabledDate:r,shortcuts:i}=e||{};let s=Nt[n||""];if(n==="datePicker"){if(r===!0&&(s=U({},s,{props:{disabledDate:wa}})),i===!0){const d=Rt(e,"props.type")==="daterange";s=U({},s,{props:{shortcuts:d?$a:va}})}}else n==="treeSelect"&&Rt(e,"props.multiple")&&(s=U({},s,Nt.treeSelectMultiple));if(!s)return e;const o=t.includeChildren!==!1,{children:l,...a}=s,u=U({},o?s:a,e);return o&&l?{...u,children:Sa(l,e.children)}:u}function xa(){m.VNode.use(ea);const{AbForm:e}=m({ui:"element-ui",version:"0.1.1",formRender:ra,components:qs,parsers:Xo,makers:I,getConfig:Zo,mergeRule:t=>Hn(t)});return e}function Ca(e,t={}){const{AbForm:n}=t||{};n&&(e.use(n),e.component("ab-icon",nt),e.component("ab-router-link",ae))}var Ta=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["ab-search",e.compactMode?"compact":""]},[n("ab-form",{ref:"visibleForm",attrs:{rule:e.visibleRule,option:e.formOption},on:{change:e.handleFormChange}}),n("transition",{staticClass:"ab-search__expanded",attrs:{mode:"out-in",appear:""}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.expanded,expression:"expanded"}]},[n("ab-form",{ref:"hiddenForm",attrs:{rule:e.hiddenRule,option:e.formOption},on:{change:e.handleFormChange}})],1)])],1)},Fa=[];const Aa={name:"AbSearch",props:{rule:{type:Array,default:()=>[]},value:{type:Object,default:()=>({})},option:{type:Object,default:()=>({})},compactMode:{type:Boolean,default:!1}},data(){return{expanded:!1,opr:this.createOperatesRule()}},computed:{formOption(){const{getCurrentSize:e}=C(),t=e();return{...this.option,formData:this.value,form:{...this.option&&this.option.form,size:t}}},visibleRule(){return[...this.rule.filter(e=>!this.isHidden(e)),this.opr]},hiddenRule(){return this.rule.filter(e=>this.isHidden(e)).map(e=>({...this.getRule(e),hidden:!1}))}},watch:{value:{handler(e){this.syncValue(e)},deep:!0}},mounted(){this.syncValue(this.value)},methods:{createOperatesRule(){return{type:"formItem",native:!0,class:"ab-form-item ab-search__operates",children:[{type:"ElButton",native:!0,children:["搜索"],props:{type:"primary",icon:"el-icon-search"},on:{click:()=>this.handleSearch()}},{type:"ElButton",native:!0,children:["重置"],props:{icon:"el-icon-refresh"},on:{click:()=>this.handleReset()}},{type:"ElButton",native:!0,children:["展开"],props:{type:"text",icon:"el-icon-arrow-down"},on:{click:()=>this.toggleExpand()}}]}},updateOperatesRule(){const e=this.opr.children[2];e.children=[this.expanded?"收起":"展开"],e.props.icon=this.expanded?"el-icon-arrow-up":"el-icon-arrow-down"},getRule(e){return e&&typeof e.getRule=="function"?e.getRule():e},isHidden(e){const t=this.getRule(e);return!!(t&&t.hidden)},forms(){return[this.$refs.visibleForm,this.$refs.hiddenForm]},collectFormData(){const e={...this.value};return this.forms().forEach(t=>{const n=t&&t.$f;n&&Object.assign(e,n.formData())}),e},syncValue(e){this.forms().forEach(t=>{const n=t&&t.$f;n&&Object.keys(e||{}).forEach(r=>n.setValue(r,e[r]))})},handleFormChange(){this.$emit("input",this.collectFormData())},toggleExpand(){this.expanded=!this.expanded,this.updateOperatesRule()},handleSearch(){const e=this.collectFormData();this.$emit("input",e),this.$emit("search",e)},handleReset(){this.forms().forEach(e=>{const t=e&&e.$f;t&&t.resetFields()}),this.$emit("input",{}),this.$emit("reset",{})}}},Ot={};var ka=_(Aa,Ta,Fa,!1,Pa,"6f06c64a",null,null);function Pa(e){for(let t in Ot)this[t]=Ot[t]}const Bn=function(){return ka.exports}();function Ea(e){e.component("ab-search",Bn)}var Ia=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-drawer",{attrs:{visible:e.currentVisible,"with-header":!1,"show-close":!1,"append-to-body":"","close-on-click-modal":"","close-on-press-escape":"","destroy-on-close":"",size:e.drawerSize},on:{"update:visible":function(r){e.currentVisible=r}}},[e._t("default")],2)},Da=[];const Ra={name:"AbDrawer",model:{prop:"visible",event:"update:visible"},props:{visible:{type:Boolean,default:!1},detailLevel:{type:Number,default:1}},computed:{currentVisible:{get(){return this.visible},set(e){this.$emit("update:visible",e)}},drawerSize(){return this.detailLevel&&this.detailLevel<5?`${100-24-this.detailLevel*8}%`:"32%"}}},jt={};var Na=_(Ra,Ia,Da,!1,Oa,null,null,null);function Oa(e){for(let t in jt)this[t]=jt[t]}const Ln=function(){return Na.exports}();function ja(e){e.component("ab-drawer",Ln)}function zn(e,t,n=[]){const r=e.filter(i=>{var s;return i.field||i.expand||((s=i.children)==null?void 0:s.length)}).filter(i=>i.tableVisible!==!1).map((i,s)=>{var l;const o=Hn({...i},{includeChildren:!1});return o.children&&o.field!=="OPERATE"&&(o.children=zn(o.children,t,[...n,i.field?`field:${i.field}`:`index:${s}`])),o.field!=="operate"&&!((l=o.children)!=null&&l.length)&&(o.sortFieldTable===void 0&&t&&(o.sortFieldTable=t),o.width===void 0&&o.minWidth===void 0&&(o.width=120)),o});return Ma(r,n)}function Ma(e,t=[]){const n=[],r=new Map;for(const i of e){const s=typeof i.group=="string"?i.group?[i.group]:[]:i.group??[];if(!Array.isArray(s)||s.some(c=>typeof c!="string"||!c.trim()))throw new TypeError("Table column group must be a non-empty name or an array of non-empty names.");if(!s.length){n.push(i);continue}let o=n;const l=[];let a;for(const c of s){l.push(c);const u=JSON.stringify(l);let d=r.get(u);d||(d={field:`__ab_table_group__${encodeURIComponent(JSON.stringify([t,l]))}`,title:c,children:[]},r.set(u,d),o.push(d)),a=d,o=d.children}a&&i.groupAlign!==void 0&&(a.groupAlign=i.groupAlign),o.push(i)}return n}function Ha(e,t){const n=e.sortData;if(!n)return e;const r=new Map,i=new Set;function s(u,d){var f;for(const p of u){const h=p.getKey?p.getKey():p.field;h&&(r.set(h,d),p.defaultVisible===!1&&i.add(h),(f=p.children)!=null&&f.length&&s(p.children,h))}}s(t,null);const o=new Set;function l(u,d){return u.some(f=>{if(!f||typeof f.k!="string"||f.c!==void 0&&!Array.isArray(f.c))return!0;const{k:p,c:h}=f;return o.has(p)||r.has(p)&&r.get(p)!==d?!0:(o.add(p),h?l(h,p):!1)})}if(!(Array.isArray(n)?l(n,null):typeof n!="object"||Object.keys(n).some(u=>r.has(u)&&r.get(u)!==null)))return e;const c=e.visibleData&&{...e.visibleData};if(c)for(const u of i)c[u]===!0&&delete c[u];return{...e,sortData:void 0,visibleData:c}}function qn(e,t){for(const n of e){if(n.field===t)return n;if(n.children){const r=qn(n.children,t);if(r)return r}}}function Ba(e,t,n,r){if(!n)return e;const i=n.footerFormatter||Te(n).formatter;return i?i({cellValue:e,row:t,column:r||n}):e}function La(e,t,n,r,i){if(typeof e.labelField!="string"||!e.labelField.trim()||!Array.isArray(e.fields))throw new TypeError("AbTable footerSummary requires a labelField and a fields array.");const s=["__proto__","constructor","prototype"],o=new Set([e.labelField]),l=[],a=[],c=p=>{if(!p.trim()||o.has(p)||s.includes(p))throw new TypeError(`AbTable footerSummary has an invalid or duplicate field: "${p}".`);o.add(p)};if(s.includes(e.labelField))throw new TypeError("AbTable footerSummary has an invalid labelField.");for(const p of e.fields)if(typeof p=="string")c(p),l.push(p);else{if(!p||typeof p!="object"||Array.isArray(p)||!Object.keys(p).length)throw new TypeError("AbTable footerSummary fields must be field names or objects of callbacks.");for(const[h,y]of Object.entries(p)){if(c(h),typeof y!="function")throw new TypeError(`AbTable footerSummary handler for "${h}" must be a function.`);a.push([h,y])}}const u={};for(const p of l){let h=null;for(const y of t){const b=y[p];if(!(b==null||typeof b=="string"&&!b.trim())){if(typeof b!="number"&&typeof b!="string"||!Number.isFinite(Number(b)))throw new TypeError(`AbTable footerSummary field "${p}" must contain numbers or numeric strings.`);if(h=(h??0)+Number(b),!Number.isFinite(h))throw new RangeError(`AbTable footerSummary total for "${p}" is not finite.`)}}u[p]=h}for(const[p,h]of a){const y=t.length?h({rows:t,totals:Object.freeze({...u})}):null;if(y!==null&&(typeof y!="number"||!Number.isFinite(y)))throw new TypeError(`AbTable footerSummary handler for "${p}" must return a finite number or null.`);u[p]=y}const d={[e.labelField]:e.label??r,...u},f={...d};for(const[p,h]of Object.entries(u))f[p]=h===null?"-":Ba(h,d,qn(n,p),i(p));return f}const $={DETAIL:"detail",DEL:"del",ADD:"add",EDIT:"edit",SAVE:"save",CREATE:"create",READ:"read",UPDATE:"update",EXPORT:"export",OPERATE:"OPERATE"};function He(e,t){return!(e!=null&&e.length)&&!(t!=null&&t.length),!0}function za(e){return e==null?[]:Array.isArray(e)?e:[e]}function Yn(e="default"){return e==="large"?"medium":e==="default"?"small":"mini"}function qa(e){let t=0;for(const n of e)n.group&&(t=Math.max(t,za(n.group).length));return t+1}const Mt={mini:36,small:40,medium:44,large:48},Ya={name:"AbTable",provide(){return{abTableRef:{value:this},abTableDetailRef:{value:this}}},props:{id:{type:[String,Number],default:void 0},title:String,rule:{type:Array,default:()=>[]},queryHandler:Function,query:{type:Object,default:()=>({})},pagerEnable:{type:Boolean,default:!0},pagerConfig:{type:Object,default:()=>({})},locale:{type:String,default:"zh-cn"},idField:{type:String,default:"id"},idFieldTable:String,permiPrefix:String,compactMode:Boolean,parentIdField:String,accordion:Boolean,hasChildField:{type:String,default:"hasChildren"},lazyMethod:Function,isCurrent:Boolean,dragable:Boolean,absDragable:Boolean,rowClassName:Function,headerCellClassName:Function,cellClassName:Function,rowStyle:[String,Object,Function],editable:Boolean,singleSelect:Boolean,multiSelect:Boolean,validRules:Object,sortable:{type:Boolean,default:!0},sortLocally:Boolean,footerSummary:Object,maxHeight:Number,offsetTop:Number,autoHeight:Boolean,readonly:{type:Boolean,default:!0},size:{type:String,default:"default"}},data(){return{currentValue:[],loading:!1,pageNo:1,pageSize:10,currentPageSizes:[10,15,20,50,100],total:0,sortFieldTable:"",sortField:"",sortType:"",maxH:this.maxHeight||0,requestVersion:0,sortParams:void 0}},computed:{currentRule(){return zn(this.rule,this.idFieldTable)},tableId(){return this.id||`ab-table-${this._uid}`},vxeCurrentSize(){return Yn(this.size)},pagerFields(){return{pageNo:this.pagerConfig.pageNoField??"pageNo",pageSize:this.pagerConfig.pageSizeField??"pageSize",sortFieldTable:this.pagerConfig.sortFieldTableField??"sortFieldTable",sortField:this.pagerConfig.sortFieldField??"sortField",sortType:this.pagerConfig.sortTypeField??"sortType"}},sortConfig(){return{trigger:"cell",remote:!this.sortLocally}},currentFooterData(){if(!this.footerSummary)return[];const e=this.$refs.table,t=n=>e&&e.getColumnByField?e.getColumnByField(n):void 0;return[La(this.footerSummary,this.currentValue,this.currentRule,"合计",t)]},currentReadonly(){return!(!this.readonly||this.multiSelect||this.singleSelect)}},watch:{query:{handler(){this.reload()},deep:!0},vxeCurrentSize:{handler(){this.$nextTick(()=>this.calculateTableHeight())}},compactMode:{handler(){this.$nextTick(()=>this.calculateTableHeight())}}},created(){this.initializePager()},mounted(){this.calculateTableHeight(),this.init()},methods:{initializePager(){const e=this.pagerFields;this.pageNo=Number(this.query[e.pageNo]??1),this.pageSize=Number(this.query[e.pageSize]??10),this.sortFieldTable=this.query[e.sortFieldTable]??"",this.sortField=this.query[e.sortField]??"",this.sortType=this.query[e.sortType]??""},calculateTableHeight(){var c,u;if(!this.autoHeight){this.maxH=this.maxHeight||0;return}const e=this.$refs.table,t=((c=e==null?void 0:e.cellConfig)==null?void 0:c.height)||Mt[this.vxeCurrentSize]||Mt.medium,n=this.$el&&this.$el.parentElement,r=((u=n==null?void 0:n.querySelector(".ab-toolbar"))==null?void 0:u.getBoundingClientRect().height)||0,i=this.$refs.pager&&this.$refs.pager.$el,s=(i==null?void 0:i.getBoundingClientRect().height)||0,o=qa(this.rule)*t,l=((n==null?void 0:n.getBoundingClientRect().height)||500)-r-s;if(this.maxH=this.offsetTop?Math.max(l,window.innerHeight-this.offsetTop):l,this.maxH<=0)return;let a=Math.min(Math.max(Math.round((this.maxH-o-t*1.5)/t),10),100);this.footerSummary&&(a-=1),this.currentPageSizes.includes(a)||(this.currentPageSizes=[...this.currentPageSizes,a].sort((d,f)=>d-f)),this.pageSize=a},async init(){if(typeof this.queryHandler!="function")return;const e=++this.requestVersion;this.loading=!0;try{const t=this.pagerFields,n={...this.query,[t.pageNo]:this.pageNo,[t.pageSize]:this.pageSize,[t.sortFieldTable]:this.sortFieldTable,[t.sortField]:this.sortField,[t.sortType]:this.sortType},r=await this.queryHandler(n);if(e!==this.requestVersion)return;const i=Array.isArray(r)?r:(r==null?void 0:r.data)??(r==null?void 0:r.list);if(!Array.isArray(i))throw new TypeError("AbTable queryHandler must return an array or an object containing a data or list array.");this.currentValue=i,this.total=Array.isArray(r)?r.length:r.total??i.length}finally{e===this.requestVersion&&(this.loading=!1)}},async reload(){this.pageNo=1,await this.init()},async refresh(){await this.init()},resize(){this.calculateTableHeight()},remove(e){const t=this.currentValue.indexOf(e);t>=0&&this.currentValue.splice(t,1),this.total=Math.max(0,this.total-1)},async exportData(e){const t=this.$refs.table;!t||typeof t.exportData!="function"||await t.exportData({filename:e||this.title,columns:this.currentRule.filter(n=>n.field&&n.field!==$.OPERATE&&!n.hidden)})},handlePageChange({currentPage:e,pageSize:t}){this.pageNo=e,this.pageSize=t,this.init()},handleSortChanged({field:e,order:t,column:n}){var r,i;t?(this.sortFieldTable=((r=n==null?void 0:n.params)==null?void 0:r.sortFieldTable)??this.idFieldTable??"",this.sortField=(((i=n==null?void 0:n.params)==null?void 0:i.sortField)||e).replace(/[A-Z]/g,s=>`_${s.toLowerCase()}`),this.sortType=t):(this.sortFieldTable=this.idFieldTable??"",this.sortField=this.idField||"id",this.sortType="desc"),this.refresh()},handleCellClick({row:e,column:t}){var r,i;if((t==null?void 0:t.field)===$.OPERATE)return;const n=this.$refs.table;!this.editable||this.currentReadonly?(r=n==null?void 0:n.clearCheckboxRow)==null||r.call(n):(i=n==null?void 0:n.setCheckboxRow)==null||i.call(n,e,!0),this.$emit("cellClick",{row:e,column:t})},columnProps(e,t){return{rule:e,idx:t,idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,sortable:this.sortable,deleteHandler:this.deleteHandler,readonly:this.readonly}}},render(e){const t={id:this.tableId,data:this.currentValue,stripe:!this.parentIdField,border:!0,size:this.vxeCurrentSize,loading:this.loading,showOverflow:!0,showHeaderOverflow:!0,showFooterOverflow:!0,autoResize:!0,sortConfig:this.sortConfig,showFooter:!!this.footerSummary,footerData:this.currentFooterData,cellClassName:this.cellClassName,headerCellClassName:this.headerCellClassName,rowClassName:this.rowClassName,rowStyle:this.rowStyle,customConfig:{immediate:!0,storage:!0,restoreStore:(i={})=>{const s=i.storeData,o=i.$table||this.$refs.table;return!s||!o||typeof o.getFullColumns!="function"?s:Ha(s,o.getFullColumns())}}};this.maxH&&(t.maxHeight=this.maxH),this.compactMode&&(t.cellConfig={padding:!1,height:30});const n=this.currentRule.map((i,s)=>e("ab-table-columns",{props:this.columnProps(i,s),on:{refresh:this.refresh},key:i.field||s})),r=[e("vxe-table",{props:t,ref:"table",on:{"sort-change":this.handleSortChanged,"cell-click":this.handleCellClick}},n)];if(this.pagerEnable){const i={currentPage:this.pageNo,pageSize:this.pageSize,pageSizes:this.currentPageSizes,total:this.total};this.pagerConfig.layouts&&(i.layouts=this.pagerConfig.layouts),r.push(e("vxe-pager",{props:i,ref:"pager",on:{"page-change":this.handlePageChange}}))}return e("div",{class:"ab-table"},r)}};let Ka,Va;const Ht={};var Ua=_(Ya,Ka,Va,!1,Wa,null,null,null);function Wa(e){for(let t in Ht)this[t]=Ht[t]}const Ga=function(){return Ua.exports}(),Qa={name:"AbTableColumns",props:{rule:{type:Object,required:!0},idx:{type:[Number,String],default:0},idField:String,idFieldTable:String,permiPrefix:String,sortable:Boolean,deleteHandler:Function,readonly:Boolean},computed:{isGroup(){var t;const e=this.rule||{};return!!((t=e.children)!=null&&t.length)&&(e.field?e.field!==$.OPERATE:!e.type&&!!e.title)}},methods:{childProps(e,t){return{rule:e,idx:t,idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,sortable:this.sortable,deleteHandler:this.deleteHandler,readonly:this.readonly}}},render(e){return this.isGroup?e("vxe-colgroup",{props:{field:this.rule.field,title:this.rule.title,headerAlign:this.rule.groupAlign||this.rule.align||"center"}},(this.rule.children||[]).map((t,n)=>e("ab-table-columns",{props:this.childProps(t,n),on:{refresh:()=>this.$emit("refresh")},key:t.field||`${this.idx}_${n}`}))):e("ab-table-column",{props:this.childProps(this.rule,this.idx),on:{refresh:()=>this.$emit("refresh")}})}};let Ja,Xa;const Bt={};var Za=_(Qa,Ja,Xa,!1,el,null,null,null);function el(e){for(let t in Bt)this[t]=Bt[t]}const tl=function(){return Za.exports}();function nl(e,t){if(!e||typeof e.options!="function")return;if(e.__abOptionsPromise)return e.__abOptionsPromise;const n=e.options;return e.__abOptionsPromise=Promise.resolve().then(()=>n()).then(r=>(e.options=Array.isArray(r)?r:[],t&&t(e.options),e.options)).catch(()=>(e.options=[],t&&t(e.options),e.options)),e.__abOptionsPromise}const rl={name:"AbTableColumn",props:{rule:{type:Object,required:!0},idField:String,idFieldTable:String,permiPrefix:String,sortable:Boolean,deleteHandler:Function,readonly:Boolean},data(){return{loadedOptions:void 0}},created(){nl(this.rule,e=>{this.loadedOptions=e})},computed:{effectiveRule(){return this.loadedOptions?{...this.rule,options:this.loadedOptions}:this.rule},isVisible(){return!this.rule.hidden},ruleSortable(){return this.sortable!==!1&&this.rule.sortable!==!1&&this.rule.sortFieldTable!==!1&&(this.rule.sortable===!0||this.rule.sortFieldTable!==void 0||!!this.idFieldTable)},ruleParams(){var e,t;return{...this.rule.params||{},sortField:this.rule.sortField??((e=this.rule.params)==null?void 0:e.sortField),sortFieldTable:typeof this.rule.sortFieldTable=="string"?this.rule.sortFieldTable:((t=this.rule.params)==null?void 0:t.sortFieldTable)??this.idFieldTable??""}},formatter(){return Te(this.effectiveRule).formatter}},methods:{changeHandler({cellValue:e,row:t,column:n}){var r,i;typeof((i=(r=this.rule)==null?void 0:r.on)==null?void 0:i.change)=="function"&&this.rule.on.change({cellValue:e,row:t,column:n})},formattedValue(e){const t=e.row?e.row[this.rule.field]:void 0;return this.formatter?this.formatter({cellValue:t,column:e.column,row:e.row}):t??""},renderCell(e,t){const n=this.rule.field,r=t.row?t.row[n]:void 0,i=[];if(this.rule.type==="ElRow"&&n===$.OPERATE?i.push(e("ab-table-operate",{props:{idField:this.idField,idFieldTable:this.idFieldTable,permiPrefix:this.permiPrefix,rule:this.rule,modelValue:t.row,deleteHandler:this.deleteHandler,readonly:this.readonly,link:!0},on:{refresh:()=>this.$emit("refresh")}})):this.rule.cellRender&&this.rule.type==="switch"?i.push(e("el-switch",{props:{...this.rule.props||{},value:r},on:{change:s=>{t.row[n]=s,this.changeHandler({cellValue:s,row:t.row,column:t.column})}}})):this.rule.cellRender?i.push(this.rule.type||""):this.rule.link?i.push(e("ab-router-link",{props:{link:this.rule.link,value:r,row:t.row}},[String(this.formattedValue(t)??"")])):i.push(String(this.formattedValue(t)??"")),this.rule.cellArrow){const s=Number(r)<0;i.push(e("ab-icon",{props:{icon:s?"streamline:graph-arrow-decrease":"streamline:graph-arrow-increase"},class:s?"danger":"success"}))}return i}},render(e){if(!this.rule.field)return e("span");const t={title:this.rule.title,field:this.rule.field,sortable:this.ruleSortable,params:this.ruleParams,width:this.rule.width||"auto",minWidth:this.rule.minWidth,align:this.rule.align,fixed:this.rule.fixed,visible:this.isVisible,className:this.rule.cellArrow?"items-center":""};return e("vxe-column",{props:t,scopedSlots:{default:n=>this.renderCell(e,n)}})}};let il,sl;const Lt={};var ol=_(rl,il,sl,!1,al,null,null,null);function al(e){for(let t in Lt)this[t]=Lt[t]}const ll=function(){return ol.exports}(),ve=e=>{if(Array.isArray(e))return e.map(ve);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(n=>{t[n]=ve(e[n])}),t}return e},ul=(...e)=>{const t=[],n=new Set,r=i=>{if(i){if(typeof i=="string"){if(n.has(i))return;n.add(i)}t.push(i)}};return e.forEach(i=>{i&&(Array.isArray(i)?i.forEach(r):r(i))}),t},cl={name:"AbTableOperate",inject:{abTableRef:{default:()=>({})},abTableDetailRef:{default:()=>({})}},props:{rule:{type:[Object,Array],default:void 0},modelValue:{type:Object,default:()=>({})},idField:String,idFieldTable:String,permiPrefix:String,link:Boolean,plain:Boolean,deleteHandler:Function,readonly:Boolean},computed:{formOption(){const{getCurrentSize:e}=C(),t=e();return{formData:this.value,form:{size:t}}},rules(){var t,n,r,i,s,o,l;if(!this.rule||Array.isArray(this.rule)&&!this.rule.length)return;const e=Array.isArray(this.rule)?{type:"ElRow",children:ve(this.rule),native:!0}:{...ve(this.rule),native:!0};delete e.field;for(const a of e.children||[])if(a.props=this.buttonProps(((t=a.props)==null?void 0:t.type)||"primary",a),a.field===$.CREATE?(a.children=[{type:"icon",props:{icon:"ep:plus"}},"新增"],a.props=this.buttonProps("primary",a),(n=a.on)!=null&&n.click||(a.on={...a.on||{},click:this.createHandler}),this.permiPrefix&&!((r=a.computed)!=null&&r.hidden)&&(a.computed={...a.computed||{},hidden:this.createEnabled})):a.field===$.DETAIL?(a.children=[{type:"icon",props:{icon:"ep:view"}},"详情"],a.props=this.buttonProps("primary",a),(i=a.on)!=null&&i.click||(a.on={...a.on||{},click:this.detailHandler})):a.field===$.DEL?(a.children=[{type:"icon",props:{icon:"ep:delete"}},"删除"],a.props=this.buttonProps("danger",a),(s=a.on)!=null&&s.click||(a.on={...a.on||{},click:this.delHandler}),this.permiPrefix&&!((o=a.computed)!=null&&o.hidden)&&(a.computed={...a.computed||{},hidden:this.deleteEnabled})):a.field===$.EXPORT&&(a.children=[{type:"icon",props:{icon:"ep:download"}},"导出"],a.props=this.buttonProps("warning",a),this.permiPrefix&&!((l=a.computed)!=null&&l.hidden)&&(a.computed={...a.computed||{},hidden:this.exportEnabled})),a.native=!0,a.computed&&a.computed.hidden!==void 0&&(a.hidden=typeof a.computed.hidden=="function"?!!a.computed.hidden():!!a.computed.hidden),a.inject&&a.on&&typeof a.on.click=="function"){const c=a.on.click,u=this.modelValue;a.on.click=d=>c({api:{getValue:f=>(u||{})[f]},row:u,...d&&typeof d=="object"?d:{}})}return[e]}},methods:{buttonProps(e,t){const n={plain:this.plain,size:"mini"};return this.link?(n.type="text",t&&(t.class=ul(t.class,`${e}`))):n.type=e,n},createEnabled(){return!He([`${this.permiPrefix}:create`],["admin"])},deleteEnabled(){return!He([`${this.permiPrefix}:delete`],["admin"])},exportEnabled(){return!He([`${this.permiPrefix}:export`],["admin"])},toggleDetail(e){const t=this.abTableDetailRef&&this.abTableDetailRef.value;t&&typeof t.toggle=="function"&&t.toggle(!0,this.modelValue,e)},createHandler(){this.toggleDetail(!1)},detailHandler(){this.toggleDetail(this.readonly)},async delHandler(){typeof this.deleteHandler=="function"&&this.idField&&await this.deleteHandler(this.modelValue[this.idField]);const e=this.abTableRef&&this.abTableRef.value;e&&typeof e.remove=="function"&&e.remove(this.modelValue),this.$emit("refresh")}},render(e){return this.rules?e("ab-form",{props:{rule:this.rules,value:this.modelValue,inline:!0},on:{refresh:()=>this.$emit("refresh"),input:t=>this.$emit("input",t)}}):e("span")}};let dl,fl;const zt={};var pl=_(cl,dl,fl,!1,hl,null,null,null);function hl(e){for(let t in zt)this[t]=zt[t]}const ml=function(){return pl.exports}();function yl(e){e.component("ab-table",Ga),e.component("ab-table-columns",tl),e.component("ab-table-column",ll),e.component("ab-table-operate",ml),e.component("ab-router-link",ae)}var gl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-detail"},[n("el-card",{staticClass:"ab-detail__header w-full",attrs:{shadow:"never"}},[n("div",{staticClass:"ab-detail__title"},[e._v(e._s(e.currentTitle))]),n("ab-table-operate",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"ab-detail__opr",attrs:{"permi-prefix":e.permiPrefix,rule:e.operationRule,"model-value":e.currentValue,plain:"",readonly:e.currentReadonly},on:{input:function(r){e.oapi=r}}})],1),n("el-card",{staticClass:"ab-detail__form",attrs:{shadow:"never"}},[n("ab-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"formRef",attrs:{option:e.formOption,rule:e.formRules,"id-field":e.idField,"id-field-table":e.idFieldTable,readonly:e.currentReadonly},on:{input:e.handleFormApi,change:e.handleFormChange}})],1)],1)},bl=[];function _l(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.render=="function"}function J(e){if(_l(e))return e;if(Array.isArray(e))return e.map(J);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(n=>{t[n]=J(e[n])}),t}return e}const vl={name:"AbDetail",provide(){return{abTableDetailRef:{value:this}}},props:{title:String,id:{type:[String,Number],default:void 0},idField:{type:String,default:"id"},idFieldTable:String,value:{type:Object,default:()=>({})},rule:{type:Array,default:()=>[]},validRules:Object,permiPrefix:String,getHandler:Function,createHandler:Function,updateHandler:Function,deleteHandler:Function,vertical:Boolean,detailLevel:{type:Number,default:1},editable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!0}},data(){return{currentValue:{},currentReadonly:this.readonly,loading:!1,fapi:void 0,oapi:void 0}},computed:{formOption(){const{getCurrentSize:e}=C();return{form:{size:e()}}},isCreate(){const e=this.currentValue?this.currentValue[this.idField]:void 0;return!e||e==="new"},currentTitle(){const e=this.title||this.$route&&this.$route.meta&&this.$route.meta.title||"";return this.isCreate?`新增 - ${e}`:this.currentReadonly?`详情 - ${e}`:`编辑 - ${e}`},rules(){return(this.rule||[]).map(e=>e&&typeof e.getRule=="function"?e.getRule():e)},operationRule(){const e=this.rules.find(r=>r.type!==$.OPERATE&&r.field===$.OPERATE),t=e?J(e):{type:"ElRow",field:$.OPERATE,title:"操作",width:260,fixed:"right",children:[]};t.children=(t.children||[]).filter(r=>r.field!==$.DETAIL);const n=this;return t.children.push({type:"ElButton",hidden:!this.currentReadonly,children:[{type:"icon",props:{icon:"ep:edit-pen"}},"编辑"],props:{type:"primary"},on:{click:()=>n.editHandler()}},{type:"ElButton",hidden:this.currentReadonly,children:[{type:"icon",props:{icon:"ep:check"}},"保存"],props:{type:"success",plain:!0},on:{click:()=>n.saveHandler()}},{type:"ElButton",hidden:this.currentReadonly,children:[{type:"icon",props:{icon:"ep:refresh-right"}},"取消"],on:{click:()=>n.cancelHandler()}},{type:"ElButton",children:[{type:"icon",props:{icon:"ep:back"}},"返回"],on:{click:()=>n.returnHandler()}}),t},formRules(){return this.rules.filter(e=>e.type!==$.OPERATE&&e.field!==$.OPERATE).map(e=>J(e))}},watch:{value:{handler(e){this.currentValue={...e},this.syncFormData(e)},immediate:!0,deep:!0},readonly(e){this.currentReadonly=e},id(e){this.init(e)}},mounted(){this.init(this.id)},methods:{formApi(){return this.fapi||this.$refs.formRef&&this.$refs.formRef.$f},handleFormApi(e){this.fapi=e},handleFormChange(){const e=this.formApi(),t=e?e.formData():{...this.currentValue};this.currentValue=t,this.$emit("input",t)},resetFormData(){const e=this.formApi();e&&typeof e.resetFields=="function"&&e.resetFields()},syncFormData(e){const t=this.formApi();!t||!e||Object.keys(e).forEach(n=>t.setValue(n,e[n]))},refreshForm(){const e=this.formApi();e&&typeof e.refresh=="function"&&e.refresh()},async init(e){this.loading=!0;let t;e!=null&&typeof this.getHandler=="function"?t=await this.getHandler(e)||{}:t={},this.currentValue=t,await this.$nextTick(),this.resetFormData(),this.syncFormData(t),this.refreshForm(),this.loading=!1,this.$emit("input",this.currentValue)},editHandler(){this.currentReadonly=!1,this.refreshForm()},async saveHandler(){if(this.loading=!0,this.isCreate&&typeof this.createHandler=="function"){const e=await this.createHandler(this.currentValue);e&&(this.currentValue[this.idField]=e),await this.$nextTick(),this.$emit("input",this.currentValue)}else!this.isCreate&&typeof this.updateHandler=="function"&&await this.updateHandler(this.currentValue);this.loading=!1,this.close()},cancelHandler(){this.currentReadonly=!0,this.refreshForm()},returnHandler(){this.close()},async open(e=void 0,t=!1){this.currentReadonly=t,this.loading=!0;let n;typeof this.getHandler=="function"&&e&&e[this.idField]?n=await this.getHandler(e[this.idField])||{}:(n=J(e)||{},this.rules.forEach(r=>{r.field&&r.field!==$.OPERATE&&typeof n[r.field]>"u"&&typeof r.edit>"u"&&typeof r.itemRender>"u"&&(n[r.field]="")})),this.currentValue=n,await this.$nextTick(),this.resetFormData(),this.syncFormData(n),this.refreshForm(),this.loading=!1,this.$emit("open",this.currentValue),this.$emit("input",this.currentValue)},close(){this.currentReadonly=!0,this.currentValue={},this.resetFormData(),this.$emit("close")},toggle(e=!1,t=void 0,n=!1){return e?this.open(t,n):this.close()},async reload(){if(typeof this.getHandler!="function"||!this.currentValue[this.idField]){console.error("abTableDetail.reload: no getHandler or no idField!");return}const e=await this.getHandler(this.currentValue[this.idField]);this.open(e,this.currentReadonly)}}},qt={};var $l=_(vl,gl,bl,!1,wl,null,null,null);function wl(e){for(let t in qt)this[t]=qt[t]}const Kn=function(){return $l.exports}();function Sl(e){e.component("ab-detail",Kn)}const xl=e=>e===void 0?e:JSON.parse(JSON.stringify(e)),Cl={name:"AbToolbar",inject:{abTableRef:{default:()=>({})}},props:{title:String,permiPrefix:String,rule:{type:[Object,Array],default:void 0},queryHandler:Function,refreshEnable:{type:Boolean,default:!0},exportEnable:{type:Boolean,default:!1},settingEnable:{type:Boolean,default:!0},btnTreeEnable:Boolean,classNmae:String,vertical:{type:Boolean,default:!1}},data(){return{loading:!1}},computed:{vxeCurrentSize(){return Yn("default")},currentRule(){if(!this.rule||Array.isArray(this.rule)&&!this.rule.length)return;const e=xl(this.rule);return Array.isArray(e)?{type:"ElRow",children:[...e]}:e},refreshHandler(){if(this.queryHandler)return this.queryHandler;const e=this.abTableRef&&this.abTableRef.value;if(e&&typeof e.reload=="function")return e.reload}},mounted(){const e=this.abTableRef&&this.abTableRef.value,t=this.$refs.toolbar&&(this.$refs.toolbar.$el?this.$refs.toolbar:this.$refs.toolbar);e&&e.tableRef&&t&&typeof e.tableRef.connect=="function"&&e.tableRef.connect(t)},methods:{getTitle(){return this.title},renderButtons(e){var t,n;return this.title?e("div",{class:"ab-toolbar__title"},[this.$slots.icon,this.title]):this.$slots.buttons?this.$slots.buttons:e("div",{class:"ab-toolbar__title"},[((n=(t=this.$route)==null?void 0:t.meta)==null?void 0:n.title)||""])},renderTools(e){const t=[...this.$slots.tools||[]];return this.currentRule&&t.push(e("ab-table-operate",{props:{permiPrefix:this.permiPrefix,rule:this.currentRule,plain:!0}})),t}},render(e){return e("vxe-toolbar",{class:"ab-toolbar",ref:"toolbar",props:{className:this.classNmae,size:this.vxeCurrentSize,loading:this.loading,export:this.exportEnable,refresh:this.refreshEnable?this.refreshHandler?{query:this.refreshHandler}:!0:!1,custom:!!this.settingEnable,vertical:this.vertical},scopedSlots:{buttons:()=>this.renderButtons(e),tools:()=>this.renderTools(e)}})}};let Tl,Fl;const Yt={};var Al=_(Cl,Tl,Fl,!1,kl,null,null,null);function kl(e){for(let t in Yt)this[t]=Yt[t]}const Pl=function(){return Al.exports}();function El(e){e.component("ab-toolbar",Pl)}const Fe=xa();typeof window<"u"&&(window.abForm=Fe);function $e(e,t={}){t&&t.upload&&(e.prototype.$abUploadApis=t.upload),!$e.installed&&($e.installed=!0,Ca(e,{AbForm:Fe}),Ea(e),ja(e),yl(e),Sl(e),El(e))}const Il=Fe.maker,Dl={install:$e};exports.AbDetail=Kn;exports.AbDrawer=Ln;exports.AbForm=Fe;exports.AbIcon=nt;exports.AbSearch=Bn;exports.AbSelect=Kt;exports.AbTreeSelect=Fn;exports.default=Dl;exports.maker=Il;exports.setupArchbizKit=$e;
|