@jiess/plus
Version:
基于Jiess核心库的强化与拓展,为Jiess应用的完整形态
1 lines • 78.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JiessPlus=t():e.JiessPlus=t()}(globalThis,(()=>(()=>{"use strict";var e={d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{$ActionButton:()=>hs,$ActionButtons:()=>ds,$Area:()=>os,$Autocomplete:()=>fs,$Between:()=>as,$Cascader:()=>js,$CascaderPanel:()=>Ss,$Checkbox:()=>xs,$CheckboxButton:()=>ws,$CheckboxButtonGroup:()=>Ds,$CheckboxGroup:()=>Os,$ColorPicker:()=>$s,$DatePicker:()=>ys,$Dynamic:()=>ls,$ExpandFilter:()=>Es,$Input:()=>ps,$InputNumber:()=>ms,$JiessDialog:()=>Is,$JiessHttp:()=>ts,$JiessLoading:()=>Gt,$JiessMidder:()=>xt,$JiessTable:()=>Fs,$Radio:()=>ks,$RadioButton:()=>Ps,$RadioButtonGroup:()=>Vs,$RadioGroup:()=>Bs,$Scrollbar:()=>Ns,$SearchTree:()=>Us,$Select:()=>_s,$SelectGroup:()=>As,$SlotTree:()=>Gs,$Space:()=>cs,$SpaceItem:()=>us,$SuperTable:()=>Js,$Switch:()=>vs,$SwitchEnv:()=>Ms,$TableFilter:()=>qs,$TableTabs:()=>zs,$TableTools:()=>Ls,$TimePicker:()=>bs,$TimeSelect:()=>gs,$TipText:()=>ns,$Transfer:()=>Ts,$baseDebounce1:()=>S,$baseDebounce2:()=>_,$baseThrottle1:()=>R,$baseThrottle2:()=>D,$check:()=>Te,$clone:()=>$,$component:()=>Ne,$computed:()=>Ve,$copy:()=>b,$dateFormat:()=>k,$debounce1:()=>T,$debounce2:()=>A,$diff:()=>d,$entry:()=>Ee,$env:()=>ss,$firstLowerCase:()=>f,$firstUpperCase:()=>p,$getCookie:()=>C,$getUUID:()=>w,$identify:()=>g,$initExecute:()=>N,$initHook:()=>is,$isDef:()=>x,$isReactive:()=>Re,$isUndef:()=>v,$nfn:()=>m,$querystring:()=>V,$reactive:()=>Be,$ref:()=>De,$set:()=>Fe,$setCookie:()=>j,$throttle1:()=>O,$throttle2:()=>B,$timer:()=>y,$toString:()=>P,$useComponent:()=>Ie,$watch:()=>_e,$watchEffect:()=>Ae});const s="JIESS_CONSTRUCTOR",i="isJiess",n="THIS_IS_JIESS",r="JIESS_INIT_VALUE",o="_isJiessRef",a="_isJiessComputed",l="JiessForceUpdate",c="_initialParent",u=[s,"_isVue","_uid","_Ctor","__v_isRef","__v_isReactive","$$typeof","_store",{field:"install",type:"function"}],h=["is","component","$exclude"],d=(e,t,s=!0)=>{if(Object.is(e,t))return!0;const i=Object.prototype.toString.call(e);if(i!==Object.prototype.toString.call(t))return!1;if("[object Date]"===i)return e.getTime()===t.getTime();if("[object Promise]"===i)return!1;if("function"==typeof e)return String(e)===String(t);if(e&&"object"==typeof e){const i=Object.keys(e),n=Object.keys(t);if(i.length===n.length){let i=e,n=t;if(s){const s=[],r=[];if(i=$(e,(e=>(s.push(e),s.length))),n=$(t,(e=>(r.push(e),r.length))),s.length!==r.length)return!1;if(!s.every(((e,t)=>Object.is(e,r[t]))))return!1}return function(e,t){const s=Object.keys(e),i=Object.keys(t);for(let n of s){if(!i.includes(n))return!1;if(!d(e[n],t[n],!1))return!1}return!0}(i,n)}}return!1};function p(e){return e.slice(0,1).toUpperCase()+e.slice(1)}function f(e){return e.slice(0,1).toLowerCase()+e.slice(1)}const m=(...e)=>{},y=(e=m,t=0)=>{let s=setTimeout((()=>{null!==s&&clearTimeout(s),e()}),t)},g=function(e,t,s=!0){if("exp"===t&&(t="RegExp"),Array.isArray(t))return t.some((t=>g(e,t)));if(s&&!g(t,"string",!1))throw new Error(`${t} Error:须提供字符串`);return t=p(t),Object.prototype.toString.call(e)===`[object ${t}]`};function b(e,t){for(let s in t){let i=t[s];Array.isArray(i)?(e[s]=[],b(e[s],i)):g(i,"object")?(e[s]={},b(e[s],i)):e[s]=i}}const $=(e,t,s=new WeakSet)=>{if(g(e,["array","object"])){if(s.has(e))return t?.(e,"loop");if(s.add(e),Array.isArray(e))return e.map((e=>$(e,t,s)));if(E(e))return t?.(e,"filter")||e;{const i={};for(const n in e)if(h.includes(n))i[n]=e[n];else if(Reflect.has(e,n)){const r=e[n];i[n]=$(r,t,s)}return i}}return e},v=(e,t)=>!(!t||""!==e)||[null,void 0,NaN].some((t=>Object.is(t,e))),x=(e,t)=>!v(e,t),w=function(e=6){e=parseInt(e.toString(),10),e=isNaN(e)?6:e;for(var t="";e--;)t+="0123456789abcdefghijklmnopqrstubwxyzABCEDFGHIJKLMNOPQRSTUVWXYZ"[Math.round(61*Math.random())];return t},k=function(e,t){let s=new Date(e),i={"M+":s.getMonth()+1,"d+":s.getDate(),"h+":s.getHours(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};const n=(/(y+)/.exec(t)||[])[1];n&&(t=t.replace(n,s.getFullYear()+""));for(let e in i){const s=i[e]+"",n=(new RegExp("("+e+")").exec(t)||[])[1];n&&(t=t.replace(n,`00${s}`.slice(-n.length)))}return t},P=e=>{let t=0,s={},i=(e,n)=>{if(Array.isArray(n))return n.map((t=>i(e,t)));if("function"==typeof n){let i=`__${t++}__`;return s[i]=n.toString(),s[i].startsWith(e)&&(s[i]=s[i].replace(e,"function")),i}if(g(n,"object")){if(n&&"object"==typeof n&&!Array.isArray(n)){const{$model:e,$done:i,...r}=n;if("template"===e){let e=`__${t++}__`;return s[e]=i(r),e}return r}return n}return n},n=JSON.stringify(e,((e,t)=>e?i(e,t):t),2);for(let e in s)n=n.replace(new RegExp(`"${e}"`),s[e]);return n},C=function(e){let t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),s=document.cookie.match(t);return s?decodeURIComponent(s[2]):null},j=function(e,t,s=30){let i=new Date;i.setTime(i.getTime()+24*s*60*60*1e3),t=encodeURIComponent(t),document.cookie=`${e}=${t};expires=${i.toUTCString()};path=/`},S=(e=!1)=>{let t;return function(s,i=100){x(t,!0)?clearTimeout(t):e&&s(),t=setTimeout(s,i)}},T=S(),_=()=>{let e=0;return function(t,s=100){let i=(new Date).getTime();i-e>s&&t(),e=i}},A=_(),R=()=>{let e=!0;return function(t,s=100){e&&(e=!1,setTimeout((()=>{e=!0,t()}),s))}},O=R(),D=()=>{let e=0;return function(t,s=100){let i=(new Date).getTime();i-e>s&&(e=i,t())}},B=D(),V={initVal:e=>["string","number"].includes(typeof e)?e.toString():"",stringify(e){let t=[];for(let s in e){const i=e[s];Array.isArray(i)?i.forEach((e=>t.push(`${s}=${this.initVal(e)}`))):t.push(`${s}=${this.initVal(i)}`)}return t.join("&")},parse(e){const t={};return e.split("&").forEach((e=>{const[s,...i]=e.split("="),n=i.join("=");s in t?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(n)):t[s]=n})),t}},N=function(e,...t){return(s,i=[],n)=>{if("function"==typeof s){let r=null;return r=e?s.call(e,...t,...i):s(...t,...i),void 0===r?n:r}return void 0===n?s:n}},I=(e,t)=>{throw new Error(`${e} Error:${t}`)},F=(e,t,i=s)=>!!g(e,"object")&&Object.is(e[i],t),E=e=>u.some((t=>{if("string"==typeof t)return Reflect.has(e,t);{const{field:s,type:i}=t;if(Reflect.has(e,s))return g(e[s],i)}}));function J(e,t,s=m,i="数据类型"){if(g(e,t))return s();I(i,`须提供 ${t} 类型`)}const M=e=>{const t={...e},s=t.default;return delete t.default,Object.assign(t,s)};function q(e={},t="toString"){if("function"==typeof e[t]){if("string"==typeof t){const s=new RegExp(t,"g");return(e[t]+"").replace(s,"")}return e[t]+""}}const z=(()=>{const e=q();return(t,s)=>q(t,s)===e})(),L=(e,t)=>Array.isArray(e)?[...e]:g(e,"object")?{...e}:t?void I("shallowCopy","须提供对象或数组"):e,G=(e,t,s={})=>{if(e.has(t)){const i=s;s=e.get(t),"function"==typeof i&&i(s)}return s};function U(e){return F(e,"JsRender")}function H(e,t){U(e)?t(e):Array.isArray(e)&&e.forEach((e=>{U(e)&&t(e)}))}function K(e){H(e,(e=>{e.destory()}))}const W=new WeakMap;function X(e){return!(!e||"object"!=typeof e||!e[n])}const Z=e=>!!g(e,"object")&&Reflect.has(e,"$proxy"),Y=e=>{const{$proxy:t,field:s,done:i}=e;return i?i(t):s?t[s]:t},Q=e=>{if(Z(e)){const{$proxy:t,field:s="value"}=e;return t[s]}return e},ee=(e,t)=>Array.isArray(e)?function(e){let t=null;return e.filter((e=>{if(!U(e))return!0;{const s=e,{_resConfig:i,_resData:n}=s;if(void 0!==i.$show){const e=n.style={...n.style};if(W.has(s)||W.set(s,e.display),i.$show){if("none"===e.display){const t=W.get(s);t?e.display=t:delete e.display}}else e.display="none"}let{$if:r=!0,$elseIf:o}=i;if(r=Q(r),o=Q(o),!x(o,!0))return i.hasOwnProperty("$if")?(t=!!r,r):(t=null,r);if("boolean"==typeof t){const e=o&&!t;return e&&(t=!0),e}I("$elseIf","须配合$if")}}))}(e).map(ee):U(e)?e.getNative(t):x(e)?e:void 0;class te{static uid=1;constructor(e,t={}){this[s]=e,this.J_uid=te.uid++,"function"==typeof t&&(t=t(this)),Object.assign(this,t),this.bindCxt()}bindCxt(){for(const e of Reflect.ownKeys(this.__proto__))"constructor"!==e&&"string"==typeof e&&("function"==typeof this[e]&&(this[e]=this[e].bind(this)),this.freezeField(e))}resetField(e,t){Object.prototype.hasOwnProperty.call(this,e)&&Object.defineProperty(this,e,{value:t})}freezeField(e){Object.prototype.hasOwnProperty.call(this,e)&&Object.defineProperty(this,e,{writable:!1,enumerable:!0,configurable:!0})}}const se=class extends te{watcher;fn;flush;constructor(e,t,s="async"){super("Composite"),this.watcher=e,this.fn=t,this.flush=s,this.effecting="doned",this.debounce1=S()}initComputed(e,t){this.computer=!0,this.target=e,this.proxy=t}init(e,t,s,i){return this.watcher.effecter.addCurrent(this),this.done(e,t,s,i),this.watcher.effecter.removeCurrent(),this.value}done(e,t,s,i){return this.effecting="start",this.value=this.fn(e,t,s,i),this.effecting="computed",this.computer&&(this.proxy.value=this.value),this.effecting="doned",this.value}check(e){this.computer?"start"===this.effecting?I("Computed","计算中禁止赋值"):"function"==typeof e&&e((e=>{this.target.value=e,this.watcher.effecter.trigger(this.target,"value",e,this.proxy)})):"function"==typeof e&&e()}trigger(e,t,s,i){this.check(((n=m)=>{"sync"===this.flush?n(this.init(e,t,s,i)):this.debounce1((()=>n(this.init())),0)}))}},ie=[Symbol.iterator,"constructor","__proto__","prototype",NaN,null,void 0,1/0],ne=class extends te{watcher;current;execStack=[];mapStore;constructor(e){super("Effecter"),this.watcher=e,this.mapStore=new WeakMap}addCurrent(e){this.current&&this.execStack.push(this.current),this.current=e}removeCurrent(){this.current=this.execStack.pop()}collect(e,t){if("start"!==this.current?.effecting)return;if(ie.includes(t))return;if(z(e,t))return;const s=G(this.mapStore,e),i=t;s[i]=s[i]||new Set,s[i].add(this.current),this.mapStore.set(e,s)}trigger(e,t,s,i){if(ie.includes(t))return;if(z(e,t))return;this.current?.check();const n=G(this.mapStore,e);n.hasOwnProperty(t)&&n[t].forEach((n=>n.trigger(e,t,s,i))),this.watcher.update(i,t,s)}},re=(e,t)=>void 0===e?t:e;class oe extends te{proxy;field;config;reuse=!1;constructor(e,t,s={}){super("Observe"),this.proxy=e,this.field=t,this.config=s,this.cbs=new Set,this.debounce1=S();const{hasKey:i,defaultValue:n,observe:r,...o}=s;this.observe(r),this.other=o,this.value=i?e[t]:L(e);const a=this.value=re(this.value,n);this.getValue(((e,t)=>{this.result=e,t&&this.dispatch(e,{value:a,...o})}))}getValue(e){const{value:t,config:s,result:i}=this,{defaultValue:n,done:r}=s;"function"==typeof r?g(r,"AsyncFunction")?(r(t,this).then((t=>e(t,!0))),e(re(i,n))):e(r(t,this)):e(t)}observe(e){return"function"==typeof e&&this.cbs.add(e),this}resolve(e){const t=this.value,s={value:e,oldValue:t,...this.other};let{isSync:i,hasKey:n,sameState:r=!1}=this.config;if(n){try{r=d(t,e)}catch(e){console.error(e)}if(r)return;this.value=e,this.oldValue=t,this.getValue((e=>this.dispatch(e,s)))}else{const t=()=>{this.value=L(e),this.getValue((e=>this.dispatch(e,s)))};i?t():this.debounce1((()=>t()),0)}}dispatch(e,t){t.oldResult=this.result,t.result=this.result=e,this.cbs.forEach((s=>s(e,t.oldResult,t)))}}const ae=class extends te{watcher;constructor(e){super("Observer"),this.watcher=e}create(e,t){return E(e)&&"Target"!==e[s]?e:J(e,["array","object"],(()=>{const s=new Proxy(e,{get:(e,s,i)=>s===n||("_initialTarget"===s?e:s===c?t:s===Symbol.toStringTag?Array.isArray(e)?"Array":"Object":(this.watcher.effecter.collect(e,s),F(e,!0,a)&&"value"===s?e.getValue():Reflect.get(e,s,i))),set:(e,s,i,n)=>(s===c&&(t=i),!!Object.is(e[s],i)||(this.trigger(e,s,i,n),Reflect.set(e,s,i,n))),deleteProperty:(e,t)=>(t in e&&this.trigger(e,t,void 0,s),Reflect.deleteProperty(e,t))});for(const t in e)h.includes(t)||g(e[t],["array","object"])&&(e[t]=this.create(e[t],s));return s}),"创建响应式数据")}trigger(e,t,s,i){const{effecter:n}=this.watcher;F(e,!0,a)?e.setValue(s,t):n.trigger(e,t,s,i)}},le=class extends te{_setter;_composite;constructor(){super("Target"),this[n]=!0,this.value=r,this[a]=!0}initSetter(e){this._setter=e}initComposite(e){this._composite=e}getValue(){return this.value===r&&(this.value=this._composite?.init()),this.value}setValue(e,t){"value"!==t?I("Computed","仅允许对value赋值"):"function"==typeof this._setter?this._setter(e):"computed"===this._composite?.effecting||I("Computed","须提供setter")}},ce=new WeakMap,ue=new WeakMap;class he extends te{static instance;effecter;observer;constructor(){return super("Watcher"),this.observer=new ae(this),this.effecter=new ne(this),he.instance?he.instance:he.instance=this}createProxy(e){let t=!1;const s=$(e,((e,s)=>{"loop"===s&&(t=!0)}));return t?this.observer?.create(s):this.observer?.create(e)}createComputed(e,t){const s=new le,i=this.createProxy(s);if(g(e,"object")){const{get:t,set:i}=e;"function"==typeof t&&(e=t),"function"==typeof i&&s.initSetter(i)}const n=new se(this,e,t);return s.initComposite(n),n.initComputed(s,i),i}watchEffect(e,t){new se(this,e,t).init()}observe(e={$proxy:{}}){const{$proxy:t,field:s,warn:i=!0,...r}=e,l=Reflect.has(t,a)||Reflect.has(t,o)?"value":s,c=r.hasKey=g(l,["number","string"]);if(t[n]){const e=new oe(t,l,r);if(c){const s=G(ce,t,[]),i=l;s[i]=s[i]||[],s[i].push(e),ce.set(t,s)}else{const s=G(ue,t,[]);ue.set(t,s),s.push(e)}return e}if(!i)return Y(e);if("function"==typeof i){const e=r.done,s=i(t,l);return e?e(s):s}console.warn("$proxy:需要定义为响应式对象")}bind(e,t,s,{cb:i}){if(!g(s,["number","string"])){const n=s,r=this.createProxy(n);return r[c]=e,"function"==typeof i?i(r):t&&(e[t]=r),r}e[t]=s}update(e,t,s){G(ce,e,(e=>{const i=e[t];Array.isArray(i)&&i.forEach((e=>e.resolve(s)))})),this.resolveParent(e)}resolveParent(e){G(ue,e,(t=>{Array.isArray(t)&&t.forEach((t=>t.resolve(e)))}));const t=e[c];t?.[n]&&this.resolveParent(t)}}let de=1,pe="jiess";const fe=class extends te{ctx;expose={};isDestory=!1;constructor(e,t){super("JsRender"),this.ctx=e,this._buildNode(t)}_buildNode({config:e,data:t}){t.is=Ie(t.is),this[i]=F(t.is,!0,i),this._resData=this._initParam(t),this._resConfig=this._initParam(e);const{$ref:s}=this._resConfig;"function"==typeof s?this.ctx.nextTick((()=>{y((()=>s(this.expose,this)))})):g(s,"object")&&s[o]&&(s.value=this.expose)}_initParam(e){const t={};for(const s in e){const i=e[s];g(i,["object","array"])?this._analyObserve(t,i,s):t[s]=i}return t}_analyObserve(e,t,s){const n=this.ctx._slotRender;if("$if"!==s&&"$elseIf"!==s&&this[i])e[s]=t;else if(Z(t))if(X(t.$proxy)){const i=(t=this.ctx._observe(t)).result;e[s]="children"===s?n.initNodes(i):i,t.observe(((t,i)=>{this.isDestory||("children"===s?(K(i),e[s]=n.initNodes(t)):e[s]=t,this.ctx.forceUpdate())}))}else e[s]=Y(t);else e[s]="children"===s?n.initNodes(t):t}_initKey(e,t){return g(e,"object")&&v(e.key)&&(e.key=x(t)?`${pe}_${t}`:"auto_"+de++),e}_injectKey({J_uid:e}){let{key:t}=this._resData;if(t){if("string"==typeof t){if(t.startsWith("_static_"))return;if(Number(t.split("_")[1])===e)return}}else t=this.J_uid;this._resData.key=`${pe}_${e}_${t}`}getNative(e){const{ctx:t,_resData:s}=this,{component:n,_slotRender:r}=t,{is:o,key:a,children:l,...c}=s;if(F(o,!0,i)){if(!this._vnode){const{jiessEnv:t}=n,{slot:s,...i}=c,r=this._initKey({is:o,key:a,slot:s},e);this._vnode=t.createVNode(r,(()=>(this.component=new Pe(o,t),{NativeComponent:this.component.start(i,l,this),component:this.component})))}return this._vnode}return r.toRender(this,e)}destory(){this.isDestory||(this.isDestory=!0,this[i]?this.component&&K(this.ctx._nodes):K(this._resData.children))}},me=[];class ye extends te{contextParam;static instance;$env="";$render;$moTag="div";JiessComponent;constructor(e={},t){super("Jiess"),this.contextParam=t,Object.assign(this,e),ye.instance=this}static addCtx(e){me.push(e)}static removeCtx(e){me.splice(me.indexOf(e),1)}static useCtx(){return me[me.length-1]}useInjects(e){if(this.contextParam){const{$page:t,...s}=this.contextParam;return"function"==typeof t&&(s.$page=t.call(e,this)),s}}}const ge=ye,be=class extends te{ctx;constructor(e,t){super("Attrs"),this.ctx=e,this.config={},this.data={},this.init(this.initAttrs(t))}initAttrs({...e}={}){const t=e.class||e.className,{env:s}=this.ctx.component.jiessEnv;return delete e.class,delete e.className,t&&(e["vue3"===s?"class":"className"]=t),e}init(e){const{env:t}=this.ctx.component.jiessEnv,{children:s,...i}=function(e,t){const{$mergeAttrs:s,...i}=t;return Object.assign(i,s?.[e])}(t,e);var n,r,o;return n=["$if","$ref","$elseIf","$name","$show","$slots","$render","$observe","$slotData","$mergeAttrs"],r=i,o=this.config,n.forEach((e=>{r.hasOwnProperty(e)&&(o[e]=r[e],delete r[e])})),x(s)&&(i.children=s),this.data=i,this}},$e=new WeakMap,ve=class extends te{ctx;attrs;constructor(e,t){if(super("Done"),this.ctx=e,this.attrs=t,$e.has(t))return $e.get(t);$e.set(t,this)}beginSetup(e){const{ctx:t}=this,s={},{setup:i,props:n,name:r}=e,a=new be(t,this.attrs);s.$param=a.data,s.$props=function(e,t,s=""){if(t){let i="",n={};return s&&(i=`${s} 组件 `),J(t,"function",(()=>{let s=t();J(s,"object",(()=>{for(let t in s){const r=s[t];let a,l=!1,c=null,u=!1,h=!1;if("string"==typeof r)c=r;else if("object"==typeof r){const e=r;c=e.type,a=e.default,h=!!e.isRef,l=!!e.required,u=!!e.isResponsive}l&&!e.hasOwnProperty(t)&&I(`${i}${t}`,"必须");const d=e=>{if(void 0!==e)return"string"!=typeof c||g(e,c)||I(`${i}${t}`,`须提供 ${c} 类型`),e},p=e=>e&&"object"==typeof e&&e[o],f=e.hasOwnProperty(t)?e[t]:a;u&&!X(f)&&I(`${i}${t}`,"须提供 Jiess 响应式数据"),p(f)?(d(f.value),n[t]=f):void 0!==f&&h?I(`${i}${t}`,"须提供 JiessRef 响应式数据"):n[t]=d(f)}}),`${i}Props 返回`)}),`${i}Props 定义`),n}return{...e}}(a.data,n,r),t.expose(s),J(i,["function","asyncFunction"],(()=>{ge.addCtx(t),i.call(t,s.$props,s.$param),ge.removeCtx(t)}),"setup函数")}buildRender(e=this.attrs){return this.jsRender&&!this.jsRender.isDestory||(this.jsRender=new fe(this.ctx,new be(this.ctx,e))),this.jsRender}},xe=class extends te{ctx;children;constructor(e,t){super("SlotRender"),this.ctx=e,this.children=t}initNodes(e){return v(e)?e:[e].flat(1/0).filter((e=>x(e))).map((e=>{if("function"==typeof e)return e;if("object"!=typeof e)return e+"";if(!("$slot"in e))return U(e)?e:new ve(this.ctx,e).buildRender();{const{$slot:t="default",...s}=e,{slots:i,baseCnf:n}=this.initSlots(t,s);if(x(i))return this.initNodes(i);if(g(s,"object"))return this.initNodes(n)}}))}initSlots(e="default",{$slotData:t,...s}={}){const{$slots:i}=this.ctx.PJR?._resConfig||{};if(i&&"object"==typeof i){let n=i[e];return g(n,"function")&&(n=n.call(this.ctx,t)),"default"===e&&x(this.children)&&(n=x(n)?n:this.children),{baseCnf:s,slots:n}}return{baseCnf:s,slots:this.children}}toRender(e,t){const{$moTag:s,$env:i}=this.ctx.jiess,{is:n=s,children:r,...o}=e._resData;e._initKey(o,t);const a=this.getSlots(o,r,e);return"JiessFragment"===n?"vue3"===i?a.default.call(this):a:this.$h(n,o,a,e)}$h(e,t,s,i){const{jiessEnv:n}=this.ctx.component;return n.createElement(e,t,s,i)}getSlots(e,t,s){const{ctx:i}=this,{env:n}=i.component.jiessEnv,r=e=>{const t=this.initNodes(e);return H(t,(e=>e._injectKey(s))),ee(t)};let{$slots:o}=s._resConfig||{};if("react"!==n){e.scopedSlots=e.scopedSlots||{};const s=e.scopedSlots;o={...o};let a={};for(let e in o){let t=o[e];"vue2"===n?"function"==typeof t?s[e]=e=>r(t.call(i,e)):a[e]=r(t):a[e]=e=>r(g(t,"function")?t.call(i,e):t)}return a.hasOwnProperty("default")||("vue2"===n?s.hasOwnProperty("default")||x(t)&&(a.default=r(t)):x(t)&&(a.default=()=>r(t))),"vue2"===n?Object.values(a).flat(1/0):a}if(x(t)){let e=r(t);return e.length>1?e:e[0]}}};function we(e,t=1/0,s){const{_provideData:i,PJR:n}=s?.ctx||{},r=i;return g(r,"object")&&r.hasOwnProperty(e)?r[e]:n&&t>0?we(e,--t,n):null}const ke=class extends te{component;PJR;$obs={};_provideData={};_slotRender;_nodes=[];_lifts={beforeRender:[],beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[]};constructor(e,t,s,i){const{IS:n,jiessEnv:r}=e;super("Context",(e=>r.jiess.useInjects(e))),this.component=e,this.PJR=i,this.jiess=r.jiess,this._slotRender=new xe(this,s),new ve(this,t).beginSetup(n)}forceUpdate(){this.component.frame?.forceUpdate()}onBeforeRender(e){this._lifts.beforeRender.push({fn:e,once:!1})}onBeforeMount(e){this._lifts.beforeMount.push({fn:e,once:!1})}onMounted(e){this._lifts.mounted.push({fn:e,once:!1})}onBeforeUpdate(e,t=!1){this._lifts.beforeUpdate.push({fn:e,once:t})}onUpdated(e,t=!1){this._lifts.updated.push({fn:e,once:t})}onBeforeUnmount(e){this._lifts.beforeUnmount.push({fn:e,once:!1})}nextTick(e){switch(this.jiess.$env){case"vue3":this.jiess.nextTick(e);break;case"vue2":this.component.frame?.$nextTick(e);break;default:v(e)}}add(...e){return this._nodes=[...this._nodes,...this._slotRender.initNodes(e)],this}native(...e){return ee(this._slotRender.initNodes(e))}provide(e={}){Object.assign(this._provideData,e)}inject(e,t){return we(e,t,this.PJR)}expose(e){this.PJR&&Object.assign(this.PJR.expose,e)}_buildVNodeTree(){let e=ee(this._nodes);return this._lifts.beforeRender.forEach((t=>{"function"==typeof t.fn&&(e=t.fn(e)||e,t.once&&delete t.fn)})),e}_observe({key:e,...t}){const{$proxy:s,field:i="value"}=t;let n=null;if(e&&"string"==typeof e){this.$obs[e]=this.$obs[e]||new WeakMap;const r=this.$obs[e].get(s)||{};Reflect.has(r,i)&&(t={defaultValue:r[i].result,...t}),n=r[i]=(new he).observe(t),this.$obs[e].set(s,r)}else n=(new he).observe(t);return n}},Pe=class extends te{IS;jiessEnv;cpn;ctx;frame;frameProps={};constructor(e,t){super("Component"),this.IS=e,this.jiessEnv=t,this[i]=!0}start(e={},t,s){return this.cpn=this.cpn||this.component(e,t,s)}component(e,t,s){return this.jiessEnv.component(this,(()=>{const i={...e};return this.ctx=new ke(this,i,t,s),e=>{this.ctx._lifts[e].forEach((e=>{"function"==typeof e.fn&&(e.fn(),e.once&&delete e.fn)}))}}))}},Ce=new WeakMap,je=new WeakMap,Se={},Te=F;function _e(e,t,s){const i={};t&&("object"==typeof t?Object.assign(i,t):i.field=t);const n=(new he).observe({$proxy:e,...i});F(n,"Observe")&&n.observe(s)}const Ae=(e,t="async")=>J(e,"function",(()=>(new he).watchEffect(e,t))),Re=e=>X(e);let Oe=1;function De(e){return Be({value:e,[o]:!0,__uid:Oe++})}function Be(e){return J(e,["Object","Array"],(()=>{let t=null;return Ce.has(e)?t=Ce.get(e):(t=(new he).createProxy(e),Ce.set(e,t)),t}))}function Ve(e,t="async"){return J(e,["Object","Function"],(()=>{let s=null;return je.has(e)?s=je.get(e):(s=(new he).createComputed(e,t),je.set(e,s)),s}))}function Ne(e,t){J(e,"string"),Se[e]=t}function Ie(e){return Se[e]||e}function Fe(e,t,s,i={}){return(new he).bind(e,t,s,i)}function Ee(e,t,s){const n=new ge(M(t),s);return new e(n,(({is:e,setup:t,jiessEnv:s})=>{if(F(e,!0,i));else{if("function"!=typeof t)throw new Error("须提供(组件is)或(setup函数)");e={isJiess:!0,name:"JiessComponent",setup:t}}return new Pe(e,s)})),n}const Je=/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,Me=/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$/,qe={ruleData:{card:e=>({exp:[Je,Me],msg:"身份证号校验不通过"})}},ze={rowKey:"id",fieldPage:"page",fieldPageSize:"limit",fieldTotal:"total",fieldDatas:"list",defaultPage:1,defaultPageSize:10,defaultTotal:0,defaultDatas:[],boxParam:void 0,initLayout:void 0},Le=void 0,Ge=void 0,Ue={model:"divider"},He={_ruleConfig:qe,_SuperTable:ze,_ProPager:Le,_ProTable:Ge,_FilterLayout:Ue,_SwitchEnv:{envs:{local:{label:"本地环境",protocol:"http:",hostname:"127.0.0.1",port:"9007",pathname:"api"},development:{label:"研发环境",protocol:"http:",hostname:"121.37.217.25",port:"9007",pathname:"api"},test:{label:"测试环境",protocol:"http:",hostname:"121.37.195.250",port:"9007",pathname:"api"},preview:{label:"预览环境",protocol:"http:",hostname:"121.37.195.250",port:"9007",pathname:"api"},production:{label:"生产环境",protocol:"http:",hostname:"121.37.217.25",port:"9007",pathname:"api"}}}},Ke=/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,We=/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;class Xe{area;config;rules=[];ruleData;constructor(e,t={}){this.area=e,this.config=t,this.ruleData=this.getRuleData()}buildByFn(e,t){return{trigger:["blur","submit"],validator:async(s,i,n)=>{const r=await e(i,t);return this.area.hook.hookBuildRule(r,n)}}}getRuleData(){const{config:e}=this,t={},{ruleData:s}=qe;if(s)for(let e in s){const i=s[e];t[e]=e=>"function"==typeof i?this.buildByFn(i,e):i}return{required:t=>({required:!0,message:`${t} 必填`,...e}),range:(t,s,i)=>({min:s,max:i,message:`${t} 长度控制在${s}到${i}`,...e}),requireArr:e=>this.buildByFn((t=>{if(!Array.isArray(t)||!t?.length)return`${e} 需要非空数组`}),e),email:e=>this.buildByFn((t=>{if(!Ke.test(t))return`${e} 邮箱格式有误`}),e),phone:e=>this.buildByFn((t=>{if(!We.test(t))return`${e} 手机格式有误`}),e),...t}}init(e,t=""){if(Array.isArray(e))return e.map((e=>"string"==typeof e?this.ruleData[e](t):Array.isArray(e)?this.ruleData.range(t,...e):"function"==typeof e?this.buildByFn(e,t):e))}}const Ze=class{area;config={};staticValues={};initialValues={};fieldsSet=new Set;fieldsMap=new Map;values={};constructor(e){this.area=e,this.area=e}init({initialValues:e,staticValues:t,...s}={initialValues:{},staticValues:{}}){this.config=s,this.area.nameManger=this,this.staticValues={...t},this.initialValues={...e},this.values=this.area.hook.hookInitValues(this)}getBaseValues(){return{...this.staticValues,...this.initialValues}}getInputValue(e){const t=e,s=this.getBaseValues();if(Reflect.has(s,t))return s[t]}input(e,{defaultValue:t}={}){const{fieldsMap:s,fieldsSet:i,area:n}=this;if(!e)return;if("object"==typeof e){if(s.has(e))return s.get(e)}else if(i.has(e))return e;let r,o;const a=this.getBaseValues();if(Array.isArray(e))r=e.join("__"),o=e.every((e=>Reflect.has(a,e)))?e.map((e=>this.getInputValue(e))):[],s.set(e,r);else if("object"==typeof e){const{config:t}=e;if(!t)throw new Error("name为配置对象时,需定义config属性");o=[];const i=e=>{const t=[];return(e=Array.isArray(e)?e:[e]).forEach((e=>{const{inputField:s,inputDone:i}=e;let n=this.getInputValue(s);"function"==typeof i&&(n=i(n,a)),t.push(s),o.push(n)})),t.join("__")};r=i(t),Array.isArray(t)||(o=o[0]),s.set(e,r)}else i.add(r=e),o=this.getInputValue(e);const{ctx:l,hook:c}=n,u=void 0===o?t:o;return c.hookNameMangerInput(this.values,r,u,l),r}async output({...e}=this.values){for(let[t,s]of this.fieldsMap){const i=e[s];if(delete e[s],Array.isArray(t))Array.isArray(i)&&t.forEach(((t,s)=>e[t]=i[s]));else{if(!t.config)throw new Error("name为配置对象时,需定义config属性");const s=async(t,s)=>{const{inputField:n,outputField:r,outputDone:o}=t;let a=i;Array.isArray(i)&&(a="number"==typeof s?i[s]:i),"function"==typeof o&&(a=await o(a,e)),e[r||n]=a};Array.isArray(t.config)?await Promise.all(t.config.map(s)):await s(t.config)}}return e}},Ye=e=>e&&"object"==typeof e,Qe=(e,t,i=s)=>Ye(e)&&e[i]===t,et=(e,t)=>{if(Z(e)){const{$proxy:s,done:i,field:n,...r}=e,o=s[n||"value"];return t&&_e(s,{done:i,field:n,...r},t),"function"==typeof i?i(o):o}return e};function tt(e,t,s=[]){for(const i of e){const e=[...s,i.value];if(i.value===t)return e;if(Array.isArray(i.children)){const s=tt(i.children,t,e);if(s)return s}}}const st=(e,t,s="label")=>{const i=[];if(!Array.isArray(t)){const i=tt(e,t);return i&&st(e,i,s)}return t.forEach((t=>{const n=e.find((e=>e.value===t));n&&(i.push(n[s]),e=n.children)})),i};function it(e,t,s){let i=null;return g(e,"AsyncFunction")?e().then(t):g(e,"Function")?e((e=>{i=t(e)??e})):Z(e)&&(i=et(e,t)),"function"==typeof s?s(i??e):i??e}const nt=e=>{if(Ye(e)){const t=e;if(t._isJiessRef||t._isJiessComputed)return t.value}return e};function rt(e,t){const s=e.indexOf(t),i=e.substring(0,s),n=e.slice(s+t.length);return s>-1?this.native({is:"b",children:[i,{is:"span",children:t,style:{color:"#FF6666"}},n]}):e}function ot(e,t,s){return e?.map((e=>{let i=!1,{children:n,...r}=e;if(Array.isArray(n)&&n.length){let e=ot.call(this,n,t,s).filter(Boolean);if(e.length&&(i=!0,r.children=e),r[s].includes(t)&&(i=!0,r[s+"_text"]=r[s],r[s]=rt.call(this,r[s],t)),!i)return}else r[s].includes(t)&&(i=!0,r[s+"_text"]=r[s],r[s]=rt.call(this,r[s],t));return i&&r}))}function at(e,t,s=1,i){const n={display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",WebkitLineClamp:s,textOverflow:"ellipsis",wordBreak:"break-all"};let r="onMouseenter";return"react"===this.jiess.$env&&(r="onMouseEnter"),{style:1===s?{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}:n,children:t,[r]:({target:t})=>{if(1===s){const{scrollWidth:s,clientWidth:i}=t;e.disabled=s<=i}else{const{scrollHeight:s,clientHeight:i}=t;e.disabled=s<=i}},...i}}const lt=class{area;constructor(e){this.area=e}getFieldValue(e){return this.area.formOper?.getFieldValue(e)}getFieldsValue(){return this.area.formOper?.getFieldsValue()}setFieldValue(e,t){this.area.formOper?.setFieldValue(e,t)}setFieldsValue(e){this.area.formOper?.setFieldsValue(e)}validateField(e){return this.area.formOper?.validateField(e)}validateFields(){return this.area.formOper?.validateFields()}resetFields(){this.area.formOper?.resetFields()}scrollToField(){this.area.formOper?.scrollToField()}value(e=!0){return new Promise((async(t,s)=>{const{nameManger:i,formOper:n}=this.area;let r={};if("boolean"==typeof e)try{r=e?await(n?.validateFields()):await(n?.getFieldsValue())}catch(e){return void(e&&console.warn("【获取表单数据】",e))}else e&&"object"==typeof e?r=e:s("须提供数据对象才可解析");t(await i.output(r))}))}},ct=class{func;otherAttrs={};constructor(e){this.func=e}_buildLevel(e,t,s=0){const{$if:i,$show:n,$elseIf:r,...o}=e;if(t[s]){const{is:a,isEnd:l,fieldHas:c,fieldInject:u,fieldParam:h,fieldPicks:d,useOtherAttrs:p,...f}=t[s];if(l)return this.func(e,f);const m=(()=>{if(c){const e=o[c.field];return delete o[c.field],"boolean"==typeof e?e:c.default}return!0})(),y=(()=>{if(h){const e=o[h.field]||h.default;return delete o[h.field],{...e}}})();d?.forEach((e=>{e&&o.hasOwnProperty(e)&&(y[e]=o[e],delete o[e])}));const g=s+1;let b={$if:i,$show:n,$elseIf:r};if(t[g]||(this.otherAttrs=o),m){b={is:a,...b,...y};const e=this._buildLevel(o,t,g);return b.children?b.children=[b.children,e]:b.children=e,"function"==typeof u&&(b=u(this,b,o)||b),"function"==typeof p&&p(b,this.otherAttrs),b}return this._buildLevel({...b,...o},t,g)}return this.func(e)}},ut=class extends ct{hook;ctx;exec;[s]="AreaBuilder";formOper={};other={};nameManger;collect=[];param={};constructor(e,t,s){super((()=>this.collect.flat(1/0).map((e=>Qe(e,"ItemBuilder")?e.useArea(this):e)))),this.hook=e,this.ctx=t,this.nameManger=new Ze(this),this.exec=N(t),this.nameManger.init(s)}init(){const{spaceParam:e,ruleConfig:t={},hasRule:s=!0,gutter:i=8,span:n=8,...r}=this.nameManger.config;return r.spaceParam={span:n,gutter:i,...e},this.param=Object.assign({rule:new Xe(this,t),childsProxy:Be({}),hasRule:s},r),this.hook.hookNameManger(this),this}reload(e){this.nameManger.init(e),this.init(),this.ctx._nodes.length=0;const t=this.done();return this.ctx.forceUpdate(),t}render({is:e,...t}){return this.hook.itemBuilder({is:e},t)}add(...e){return this.collect.push(...e),this}done(e=!0){const{ctx:t,param:s}=this,i=this.hook.levelsArea(),n=new lt(this),r=this._buildLevel({...s},i);return e?(t.add(r),n):{node:r,action:n}}},ht=["Select","SelectGroup","CheckboxGroup","RadioGroup","RadioButtonGroup"],dt=class{itemBuilder;[s]="PreviewManger";className=[];constructor(e){this.itemBuilder=e}initClassName(e){this.className=e?[e].flat(1/0):[]}buildByName(e,t){let{className:s}=this;return t&&(s=[...s,t]),e.className=s,e}buildNode({name:e,children:t,className:s,$mode:i,$slots:n,$brother:r,$preview:o,...a}){const{hook:l,param:c,area:u,cpts:h={}}=this.itemBuilder,{mark:d,proxyChildren:p,optionBuilder:f,valueBuilder:m}=c;if(!u)return[];const{childsProxy:y}=u.param,b=(e,t)=>{const s=e.find((e=>e.value===t));return"antd"===l.uiName?s?s.children:"":s?s.label:""};if(this.initClassName(s),e&&p&&(y._initialTarget[e]=t,t={$proxy:y,field:e}),h.is?.isJiess&&(h.$area=u),"preview"===u?.param.mode)if(this.className.push("jiess-item_preview"),"edit"===i)a=this.buildByName({children:t,...h,...a},"jiess-item");else if(e){a.name=e;const s=l.hookProxyValue(u,a),i=e=>{const t=this.buildByName({is:l.$c.$TipText,text:e});return g(o,"object")&&Object.assign(t,o),t};if("function"==typeof o)a=o(s,t);else if("function"==typeof m)a=i(m.call(this,a,s));else if(ht.includes(d)){const e=Be({textValue:""}),n=(t,s)=>{"function"==typeof f&&(s=f.call(this,s)),Array.isArray(t)?e.textValue=t.map((e=>b(s,e))).filter(Boolean).join():e.textValue=b(s,t)};let r=et(s,(e=>n(r=e,o))),o=et(t,(e=>n(r,o=e)));n(r,o),a=i({$proxy:e,field:"textValue"})}else a=i(s)}else a=this.buildByName({children:t,...a});else a=this.buildByName({children:t,...h,...a},"jiess-item");return n&&(a.$slots=n),r?[a,r]:a}};let pt=1;const ft=class extends ct{hook;info;J_uid=pt++;ctx;[s]="ItemBuilder";cpts={};setValue;param={};area;itemParam={};previewManger;constructor(e,t=[],s){super((e=>this.previewManger.buildNode(e))),this.hook=e,this.info=s,this.previewManger=new dt(this),Array.isArray(t)?(this.cpts=t[0],this.param=t[1]||{}):(this.cpts=t,this.param={})}call(e,t,s={}){const i=this;return this.ctx=e,{$itemBuilder:this,is:e.jiess.JiessComponent,setup(){const{name:e="value",...n}=s,{hook:r,previewManger:o}=i;e&&(i.info.$name=e,n.initialValues=n.initialValues||{},n.initialValues[e]=t,i.setValue=t=>{a.nameManger.values[e]=t});const a=i.area=this.area(n),l=r.hookItemCall(i);this.add(o.buildNode(l))}}}useArea(e){this.area=e,this.ctx=e.ctx;const t=this.hook.hookItemCall(this),s=this.hook.levelsItem();return this._buildLevel(t,s)}},mt=class{hook;config;method;area;param;constructor(e,t){this.hook=e,this.config=t}initOptions(e){const{area:t,param:s}=this;return function(e,t){return it(e,t,(e=>Array.isArray(e)?e:[]))}(e,(e=>{let i=null;i="selectGroup"===this.method?this.getGroups(e):this.getOptions(e),t?.param?.childsProxy&&s?.name&&(t.param.childsProxy[s.name]=i)}),this.hook)}fieldsOption({...e}){const{text:t="text",value:s="value",disabled:i="disabled"}=this.fields;if(t in e){const s=e[t];delete e[t],e.text=s}if(s in e){const t=e[s];delete e[s],e.value=t}if(i in e){const t=e[i];delete e[i],e.disabled=t}return e}fieldsGroup({...e}){const{text:t="text",children:s="children"}=this.fields;if(t in e){const s=e[t];delete e[t],e.text=s}if(s in e){const t=e[s];delete e[s],e.children=t}return e}getOptions(e,t="no-group_"){return e=this.initOptions(e),this.area&&Array.isArray(e)?e.map(((e,s)=>{const i=this.fieldsOption(e);let{text:n,render:r,...o}=i;return n=this.area?.exec(r,[i],n),this.config.hookOption?.(n,{key:t+s,attrs:o,opt:i})})):[]}getGroups(e){return this.initOptions(e).map(((e,t)=>{const s=t+"_group_",i=this.fieldsGroup(e),{text:n,children:r,...o}=i;return{key:s,label:n,is:this.config.Group,children:this.getOptions(r,s),...o}}))}initParam(e,t,s){const{children:i,$options:n,$fields:r,...o}=t;this.config.hookParam?.(e,t,o),this.hook=e.hook,this.area=e.area,this.fields=r||{},this.param=o;const a=i||n;return o.children="group"===s?this.getGroups(a):this.getOptions(a),o}radio(e,t){return this.method="radio",this.initParam(e,t)}radioButton(e,t){return this.method="radioButton",this.initParam(e,t)}checkbox(e,t){return this.method="checkbox",this.initParam(e,t)}checkboxButton(e,t){return this.method="checkboxButton",this.initParam(e,t)}select(e,t){return this.method="select",this.initParam(e,t)}selectGroup(e,t){return this.method="selectGroup",this.initParam(e,t,"group")}};const yt=class{midder;debounces;queue;listenerCache;doneCache;constructor(e){this.midder=e,this.debounces={},this.queue={},this.listenerCache={},this.doneCache={}}clean(e,t){if("string"==typeof e)if(t){const s=this.listenerCache[e];Array.isArray(s)&&s.splice(s.findIndex((e=>e.tag===t)),1)}else delete this.listenerCache[e];else this.listenerCache={}}addListener(e){const{tag:t,name:s}=e;this.debounces[s]=this.debounces[s]||S();const i=this.listenerCache[s]=this.listenerCache[s]||[];if("string"==typeof t){const s=i.findIndex((e=>e.tag===t));s>-1?i.splice(s,1,e):i.push(e)}else i.push(e)}addDones(e){const{midder:t,doneCache:s}=this,{name:i}=e;t.isDebounce&&this.debounces[i]?(s[i]||(s[i]=()=>{this.debounces[i]((()=>{delete s[i],this.done(e)}))}),s[i]()):this.done(e)}async done(e){let{name:t,defaultValue:s}=e,{queue:i,midder:n,listenerCache:r}=this,{$results:o}=n,a=null;if(Array.isArray(r[t]))try{for(let s of r[t])await s.done(e)}catch(e){a=e||"执行异常"}else o[t]=n.result=s;if(Array.isArray(i[t]))for(let e of i[t])a?e.reject(a):e.resolve(o[t]);delete i[t]}},gt=class{midder;tag;fn;name="useDefaultKey";constructor(e){this.midder=e}init(...e){const{model:t}=this.midder;let s;return"multiple"===t||"no-store"===t?(this.name=e[0],s=e[1]):s=e[0],g(s,"object")&&"function"==typeof s.listener?("string"==typeof s.tag&&(this.tag=s.tag),this.fn=s.listener):"function"==typeof s?this.fn=s:I("Midder","未提供监听器"),this}async done(e){let{fn:t,name:s,midder:i}=this;try{let{defaultValue:n,args:r}=e,o=await(t?.call(i,n,...r));return void 0===o&&(o=n),i.$results[s]=i.result=o,e.defaultValue=o}catch(e){return Promise.reject(e)}}},bt=class{midder;tag;name="useDefaultKey";defaultValue;args;constructor(e){this.midder=e,this.args=[]}init(...e){const{model:t}=this.midder;let s;return"multiple"===t||"no-store"===t?(this.name=e[0],s=e[1],this.args=e.slice(2)):(s=e[0],this.args=e.slice(1)),g(s,"object")&&s.hasOwnProperty("defaultValue")?("string"==typeof s.tag&&(this.tag=s.tag),this.defaultValue=s.defaultValue):this.defaultValue=s,this}start(){const{tag:e,name:t,midder:s}=this,{queue:i}=s.$listenerStore;return new Promise(((s,n)=>{const r=i[t]=i[t]||[];if("string"==typeof e){const t=r.find((t=>t.tag===e));t?(t.resolve=s,t.reject=n):r.push({resolve:s,reject:n,tag:e})}else r.push({resolve:s,reject:n})}))}},$t={},vt=new WeakMap,xt=class extends te{reference;model;isDebounce;$jiess;$watchEffects;result;$results;$listenerStore;constructor(e,t,s,i=!0){if(super("JiessMidder"),this.reference=t,this.model=s,this.isDebounce=i,this.$jiess=e,this.$watchEffects={},this.result=null,this.$results={},this.$listenerStore=new yt(this),"no-store"!==s){if(g(t,["symbol","string","number"])){return $t[t]||($t[t]=this)}return vt.get(t)||(vt.set(t,this),this)}}watchEffect(e,t,s={}){this.$watchEffects[t]||(this.$watchEffects[t]=!0,this.$jiess.$watchEffect(e,s))}clean(e,t){this.$listenerStore.clean(e,t)}addListener(...e){const t=new gt(this).init(...e);this.$listenerStore.addListener(t)}dispatch(...e){const t=new bt(this).init(...e),s=t.start();return this.$listenerStore.addDones(t),s}};async function wt({api:e,midder:t,requestData:s}){let i=null;const{customRequest:n,customReload:r}=t.table;if(i="function"==typeof n?await n(e,s,t):await e(s),"function"==typeof r){const e=await r(i,s,t);e&&(i=e)}return i}async function kt(e,t){const{pager:s,proxy:i,filter:n,table:r,JiessTableConfig:o}=t,{fieldPage:a,fieldPageSize:l,fieldTotal:c,fieldDatas:u,defaultTotal:h}=o;try{const{page:o,pageSize:d,...p}=s.values,f={...n.values,...r.values,...p};f[a]=o,f[l]=d;for(const e in f){const t=f[e];"string"==typeof t&&(f[e]=t.trim())}const m=await wt({api:e,requestData:f,midder:t});return i.datas=m?.[u],i.total=Number(m?.[c]||h),f}catch(e){console.error("列表数据异常:",e)}}async function Pt(e,t){const{filter:s,table:i,proxy:n}=t;try{const r={...s.values,...i.values};return n.datas=await wt({api:e,requestData:r,midder:t}),r}catch(e){console.error("列表数据异常:",e)}}const Ct={add:"新增",edit:"编辑"};function jt(e){return(t,s,{type:i,title:n,param:r,...o}={})=>{const{record:a={},...l}=o;return new Promise((o=>{const c=i;i&&!e[c]&&(e[c]={}),this.$tan({title:n||Ct[c],children:{is:t,type:i,midder:e,record:a,...l},onOk:async t=>{let{action:n,actions:r,httpParam:a}=e[c];n&&(r=[n]);let l={};r&&(l=await Promise.all(r.map((e=>e.value()))).then((e=>e.reduce(((e,t)=>Object.assign(t,e)),{}))));const u=`${i}TanHttpBefore`;l=await e.dispatch(u,{tag:u,defaultValue:l}),l=Object.assign(l,a),await s(l,t),e.table.reload(),o(),t()},...r})}))}}const St=class{$m;$c;ui;jiess;uiName="未初始化";levelsArea=m;levelsItem=m;constructor(e,t){this.$m=e,this.$c=t}hookBuildRule(e,t){}hookFormParam(e,t){}hookItemCall(e){}hookFormItem(e,t){}hookInitValues(e){}hookProxyValue(e,t){}areaBuilder(e,t){return new ut(this,e,t).init()}itemBuilder(e,t={}){return new ft(this,e,t)}initValue(e){const{defaultValue:t,...s}=e.param;return"defaultValue"in e.param&&(s.defaultValue="function"==typeof t?t(e.info):t),s}initFormItem(e,t,...s){const i={};if(t){const s={key:t};s[e]=t,Object.assign(i,s)}return Object.assign(i,...s)}hookNameManger(e){}hookNameMangerInput(e,t,s,i){e[t]=s}},Tt=class extends St{stack="vue";hookInitParam(e,{valueName:t,eventName:s},i){const{values:n}=e.nameManger,{onEvent:r,name:o,...a}=i,l=a[s];return a[t]={$proxy:n,field:o},a[s]=t=>{const s=n[o]=e.exec(r,[t],t);e.exec(l,[s])},a.name=o,a}},_t=class extends Tt{stackVersion="2";constructor(e,t){super(e,t)}hookNameMangerInput(e,t,s,i){i?.component.frame?.$set?.(e,t,s)}};var At;!function(e){e.React="react",e.Vue2="vue2",e.Vue3="vue3"}(At||(At={}));const Rt=function(e){if(g(e,"object"))for(const t in e){const s=e[t];if(void 0===s)delete e[t];else if(g(s,"object")){const e=s;(t+"").startsWith("$")||e[n]||Rt(e)}}};function Ot(e){let{on:t,key:s,ref:i,slot:n,style:r,props:o,attrs:a,refInFor:l,domProps:c,nativeOn:u,className:h,directives:d,scopedSlots:p,...f}=e,m={key:s,ref:i,slot:n,style:r,props:o,refInFor:l,domProps:c,nativeOn:u,directives:d,scopedSlots:p,class:h};const y=function(e){const t={},s={};for(let i in e)"function"==typeof e[i]&&"string"==typeof i&&i.startsWith("on")&&/[A-Z]/.test(i[2])?t[i.slice(2,3).toLowerCase()+i.slice(3)]=e[i]:s[i]=e[i];return{on:t,attrs:s}}(f);return m.attrs=Object.assign({},a,y.attrs),m.on=Object.assign({},t,y.on),Rt(m),m}const Dt="vue2";class Bt{jiess;env=Dt;h;deal;constructor(e,t){this.jiess=e,this.h=m,this.deal=Ot;const s=this;this.env=e.$env=Dt,e.JiessComponent={inheritAttrs:!1,created(){const{component:e,setup:i,children:n,...r}=this.$attrs,o={is:e,setup:i,jiessEnv:s};this.result=t(o).start(r,n)},render(e){return e(this.result)}}}initRender(e){const{$render:t}=this.jiess;this.h="function"==typeof t?(...s)=>t.call(this,e,...s):e}createElement(e,t,s){return t=Ot(t),this.h(e,t,s)}createVNode({key:e,slot:t},s){const{NativeComponent:i}=s(this);return this.createElement(i,{key:e,slot:t})}component(e,t){let s=this,i=m;return{data:()=>({[l]:!1,values:{},state:{}}),inheritAttrs:!1,created(){e.frame=this,e.frameProps=this.$props,i=t()},beforeMount(){i("beforeMount")},mounted(){i("mounted")},beforeUpdate(){i("beforeUpdate")},updated(){i("updated")},beforeUnmount(){i("beforeUnmount")},render(t){s.initRender(t),this[l];const{$moTag:i}=s.jiess;let n=e.ctx._buildVNodeTree();if(Array.isArray(n)){if(n=n.flat(1/0),n.length>1)return t(i,n);{const e=n[0];return g(e,"object")?e:t(i,e)}}return n},methods:{forceUpdate(){this[l]=!this[l]},initResponsiveData(e,t=Symbol()){return this.$set(this.state,t,e)}}}}}function Vt(){return[{is:this.ui.Form,fieldHas:{field:"hasForm",default:!0},fieldParam:{field:"formParam",default:{}},fieldInject:(e,t)=>this.hookFormParam(e,t),fieldPicks:["size","labelWidth","disabled","class"]},{is:this.ui.Card,fieldHas:{field:"hasCard",default:!0},fieldParam:{field:"cardParam",default:{}},fieldPicks:["children","shadow","header","className"],useOtherAttrs:(e,{rule:t,hasRule:s,childsProxy:i,...n})=>{Object.assign(e,n)}},{is:this.$c.$Space,fieldHas:{field:"hasSpace",default:!0},fieldParam:{field:"spaceParam",default:{}},fieldPicks:["span","gutter"]}]}function Nt(){return[{is:this.$c.$SpaceItem,fieldHas:{field:"$hasSpaceItem",default:!0},fieldParam:{field:"$spaceItemParam",default:{}},fieldPicks:["$span"]},{is:this.ui.FormItem,fieldHas:{field:"$hasFormItem",default:!0},fieldParam:{field:"$formItemParam",default:{}},fieldPicks:["$label","$rules"],fieldInject:(e,{$label:t,$rules:s,...i},{name:n})=>{if(!e.area)return[];i.label=t,i=this.hookFormItem(n,i);const{rule:r,hasRule:o=!0}=e.area.param;return o?i.rules=r?.init(s,t):i.style={marginBottom:0},i}}]}const It=class{area;refName;ctx;values;constructor(e,t){this.area=e,this.refName=t;const{ctx:s,nameManger:i}=e;this.ctx=s,this.values=i.values}ref(){return this.ctx.component.frame?.$refs?.[this.refName]}checkName(e,t){if("string"!=typeof e)throw new Error("参数 name 须定义为字符串");if(Reflect.has(this.values,e))return t&&t()}getFieldValue(e){return this.checkName(e,(()=>this.values[e]))}getFieldsValue(){return{...this.values}}setFieldsValue(e,t=!0){for(let s in this.values)(t||Reflect.has(e,s))&&(this.values[s]=e[s])}setFieldValue(e,t){this.checkName(e,(()=>this.values[e]=t))}validateField(e){return this.checkName(e,(()=>new Promise(((t,s)=>{this.ref()?.validateField(e,(i=>{i?s(i):t(this.values[e])}))}))))}validateFields(){return new Promise(((e,t)=>{this.ref()?.validate((s=>{if(!s)return t(),!1;e(this.getFieldsValue())}))}))}resetFields(){return this.ref()?.resetFields()}scrollToField(){return this.ref()?.scrollToField()}clearValidate(){return this.ref()?.clearValidate()}};let Ft=1;const Et=class extends _t{levelsArea=Vt;levelsItem=Nt;uiName="element";constructor(e,t){super(e,t)}hookNameManger({ctx:e,nameManger:t}){t.values=e.component.frame?.initResponsiveData?.(t.values)}hookBuildRule(e,t){t(e||void 0)}hookFormParam(e,t){const s="Jiess_formRef"+Ft++,i=e.nameManger.values;return e.formOper=new It(e,s),{ref:s,model:i,labelWidth:"88px",...t}}hookInitValues(e){return Be({...e.staticValues})}hookItemCall(e){const t=this.initValue(e),{groupConfig:s,valueName:i="value",eventName:n="onInput"}=t,r="defaultValue"in t?t.defaultValue:null;let{$name:o,...a}=e.info;if(o){const t={defaultValue:r,valueName:i,eventName:n};a.name=e.area?.nameManger.input(o,t),a=this.hookInitParam(e.area,t,a)}if(s){const{method:t,groupManger:i}=s;return i[t](e,a)}return a}hookFormItem(e,...t){return this.initFormItem("prop",e,...t)}hookProxyValue(e,t){return t.value}hookDialog(e,t,s){const{okText:i="确定",cancelText:n="取消",hasButtons:r=!0,leftFooter:o,buttons:a,onOk:l=e,onCancel:c=e,showOk:u=!0,showCancal:h=!0,...d}=s,p=De(!0);return{show:p,is:this.ui.Dialog,beforeClose:e,visible:{$proxy:p},$slots:{footer(){if(o||r)return{is:as,left:o,right:r?{is:ds,buttons:()=>a||(()=>{const s=[];return u&&s.push({text:i,type:"primary",onClick:()=>l.call(t,e)}),h&&s.push({text:n,onClick:()=>c.call(t,e)}),s})()}:void 0}}},...d}}};class Jt extends Et{jiess={};ui={};static instance;globalConfig={};constructor({ui:e,globalConfig:t,...s}){if(Jt.instance)return Jt.instance;super(s,{$identify:g,$clone:$,$watch:_e,$computed:Ve,$reactive:Be,$watchEffect:Ae,$Space:cs,$SpaceItem:us,$TipText:ns}),this.ui=e,this.globalConfig={...He,...t},Jt.instance=this}start(e){const t=this.ui.Message;"function"==typeof e&&(e=e(this.ui,this.$m,this)),this.jiess=Ee(Bt,this.$m,{$msg:(e,s="success")=>t({message:e,type:s}),area:os,...e});const s=new xt(this.jiess,"GlobalMidder","no-store");return this.jiess.contextParam.$midder=s,this.jiess}}const Mt=Jt,qt="ProTable",zt={};class Lt{tag;keys;fn;wait;cache;startTime;constructor(e,t,s=m,i=300){this.tag=e,this.keys=t,this.fn=s,this.wait=i,this.cache={},this.startTime=0,zt[e]=this}add(e,t){this.checkKey(e,t,(s=>{this.cache[s]=[e,t],this.startTime=Date.now(),this.fn(!0)}))}remove(e,t){this.checkKey(e,t,(e=>{delete this.cache[e];let t=Date.now()-this.startTime;if(!Object.keys(this.cache).length){let e=this.wait-t;e>0?y((()=>this.fn(!1)),e):this.fn(!1)}}))}checkKey(e,t,s){const i=Lt.getKey(e,t);this.keys.includes(i)&&s(i)}static getKey(e,t){return`${e}__${t.toLocaleUpperCase()}`}static request(e,t){Object.values(zt).forEach((s=>s.add(e,t)))}static response(e,t){Object.values(zt).forEach((s=>s.remove(e,t)))}}const Gt=Lt,Ut={isJiess:!0,name:"Custom",setup({midder:e,hook:t}){const{columns:s=[]}=e.proxy,i=De([...s]);this.add({draggable:!0,is:t.ui.Tree,"node-key":"key","show-checkbox":!0,"check-strictly":!0,"default-checked-keys":s.filter((e=>!e.hidden)).map((e=>e.key)),data:{$proxy:i},on:{"node-drop"(t,s,n,r){r.stopPropagation(),e.proxy.columns=[],y((()=>e.proxy.columns=[...i.value]),0)},check(t,{checkedKeys:i}){e.proxy.columns=s.map((e=>(e.hidden=!i.includes(e.key),e)))}},allowDrop:(e,t,s)=>"inner"!==s,allowDrag:e=>"操作"!==e.label})}},Ht={isJiess:!0,name:"FilterLayout",setup({hook:e,filter:t,buttons:s,boxStyle:i,isCollapse:n,$ActionButtons:r,showButtons:o=!0,collapseParam:a={},collapseItemParam:l={},...c}){const{model:u="divider"}=Ue,h=["filter-layout",u];n||h.push("no-expand");const d=e=>{e.addEventListener("click",(e=>e.stopPropagation())),e.addEventListener("keyup",(e=>{e.stopPropagation(),"Enter"===e.key&&t.onSearch()}))};this.add({style:i,className:h.join(" "),children:[n?{is:e.ui.Collapse,children:{is:e.ui.CollapseItem,...l,children:[{ref:d,slot:"title",style:{width:"100%"},children:{$slot:"default"}},{ref:d,style:{width:"100%"},children:{$slot:"expand"}}]},...a}:{style:{flex:1},children:{$slot:"default"},...a},{$if:o,style:{margin:"0 36px 0 18px"},children:{is:r,buttons:()=>{const[e,i,...n]=s;return[{text:"搜索",onClick:t.onSearch,type:"primary",...e},{text:"重置",onClick:t.onReset,...i},...n]},...c}}]})}},Kt="36px",Wt={right:"30px",bottom:"30vh",color:"white",zIndex:1e4,width:Kt,height:Kt,lineHeight:Kt,fontSize:"24px",cursor:"pointer",position:"fixed",textAlign:"center",borderRadius:"50%",backgroundColor:"#FF6666",boxShadow:"1px 1px 6px #6666"},Xt={},Zt=class{req;key;headers;cache;waitTime=0;constructor(e,t){this.req=e;const{waitTime:s=0}=t,{url:i,method:n}=e;this.body=e.body,this.waitTime=s,this.headers=e.headers,this.key=Gt.getKey(i,n),this.cache=Xt[this.key]||[],Xt[this.key]=this.cache}add(e){this.cache.push(e)}remove(e){this.cache.splice(this.cache.indexOf(e),1)}start(){return new Promise(((e,t)=>{const{headers:s,body:i}=this;if(!Xt[this.key].some((n=>{if(n.body===i&&JSON.stringify(n.headers)===JSON.stringify(s)){switch(n.status){case 1e3:n.cbs.push({resolve:e,reject:t});break;case 2e3:e(n.value);break;case 3e3:t(n.value)}return!0}}))){const n={cbs:[{resolve:e,reject:t}],key:this.key,status:1e3,value:{},headers:s,body:i};this.add(n),this.req.request().then((e=>{n.value=e,n.status=2e3,n.cbs.forEach((({resolve:t})=>t(e)))})).catch((e=>{n.value=e,n.status=3e3,n.cbs.forEach((({reject:t})=>t(e)))})).finally((()=>{this.waitTime>0?y((()=>this.remove(n)),