g-ui-web 1.4.71 → 1.4.72

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.
@@ -53,7 +53,7 @@ var Rkt=Object.defineProperty;var Lkt=(st,a,eh)=>a in st?Rkt(st,a,{enumerable:!0
53
53
  <div class="loadot"></div>
54
54
  <div class="loadot"></div>
55
55
  </div>
56
- `;o.innerHTML=i,n.appendChild(o),(!e||e=="body")&&(o.style.position="fixed");const l=o.querySelectorAll(".loading-dots .loadot");l[0].style.backgroundColor=am.loadingList[0],l[1].style.backgroundColor=am.loadingList[1],l[2].style.backgroundColor=am.loadingList[2],am.name&&typeof am.name=="string"&&am.name.includes("black")&&(o.style.backgroundColor="rgba(0, 0, 0, 0.6)");const s={lg:16,md:12,sm:8,xs:5},c={lg:"12px",md:"10px",sm:"8px",xs:"4px"},d=o.querySelector(".loading-dots");d.style.gap=c[t]||"10px",l.forEach(u=>{u.style.width=`${s[t]}px`,u.style.height=`${s[t]}px`}),globalThis.gui.loading=Ey})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=Ey,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};function lD(e,t=500,n,r){let o=null,i=!1;const l=function(...s){return new Promise((c,d)=>{if(o&&clearTimeout(o),n&&!i){try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!0}else o=setTimeout(()=>{try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!1,o=null},t)})};return l.cancel=function(){o&&clearTimeout(o),i=!1,o=null},l}function JRe(e,t,n={leading:!1,trailing:!0}){let r=null,o=0;const{leading:i,trailing:l}=n,s=function(...c){const d=Date.now();!o&&!i&&(o=d);const u=t-(d-o);u<=0&&(r&&(clearTimeout(r),r=null),o=d,e.apply(this,c)),l&&!r&&(r=setTimeout(()=>{o=i?Date.now():0,r=null,e.apply(this,c)},u))};return s.cancel=function(){r&&clearTimeout(r),r=null,o=0},s}function eLe(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function tLe(e,t=2,n=",",r=".",o="",i=""){if(Number(e)===0)return Number(e).toFixed(t).replace(/\.?0+$/,"");if(!e)return"";e=Number(e).toFixed(t).replace(/\.?0+$/,""),e+="";const l=e.split(".");let s=l[0];const c=l.length>1?r+l[1]:"",d=/(\d+)(\d{3})/;function u(f){return Object.prototype.toString.call(f)==="[object Number]"}if(n&&!u(n))for(;d.test(s);)s=s.replace(d,"$1"+n+"$2");return o+s+c+i}const nLe=(e,t)=>e.toFixed(t),rLe=e=>0 .toFixed(e)+"%",aLe=e=>{const t={key:(e==null?void 0:e.key)||"",sysCode:(e==null?void 0:e.sysCode)||"",appType:(e==null?void 0:e.appType)||"pc",tokenName:(e==null?void 0:e.tokenName)||"gt-token",token:(e==null?void 0:e.token)||""},n=e==null?void 0:e.key,r=n?`gui-ajax-config.${n}`:"gui-ajax-config";qn.commit("setState",{path:r,value:t})},oLe=e=>{const t=e?`gui-ajax-config.${e}`:"gui-ajax-config";return Pr(qn.state,t)},Id=e=>typeof e=="function"?"function":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="object"?"object":typeof e=="boolean"?"boolean":typeof e>"u"?"undefined":typeof e=="bigint"?"bigint":typeof e=="symbol"?"symbol":"null",Or=e=>!!(!e||Object.keys(e).length===0||Array.isArray(e)&&e.length===0);function iLe({exportType:e="excel",excelConfig:t,exportDataQueryParam:n,excelSheetNum:r=1,headers:o={}}){const i=(t==null?void 0:t.excelName)||"导出表格";if(e==="csv"){if(((t==null?void 0:t.sheets)??[]).some(c=>{var d;return(d=c.headers)==null?void 0:d.some(u=>u.children&&u.children.length>0)})){Xi.warning("csv 类型文件不支持导出多级表头");return}if(r>1){Xi.warning("csv 类型文件不支持多 sheet 页");return}}Ey.start("body"),sa.post("https://matrix.gtcloud.cn/preapi/data/exportExcel/general/v2",{exportType:e,excelConfig:t,exportDataQueryParam:n,excelSheetNum:r},{responseType:"blob",headers:{"Content-Type":"application/json",...o}}).then(l=>{const s=new Blob([l.data],{type:"application/vnd.ms-excel"}),c=window.URL.createObjectURL(s),d=document.createElement("a");d.href=c,d.download=`${i}.xlsx`,d.click(),window.URL.revokeObjectURL(c)}).finally(()=>{Ey.done("")})}const Rd=e=>{if(e==null)return null;const t=Number(e);return isNaN(t)?null:t},nH=(e,t,n={})=>{if(!e||e.length===0)return{data:[],unitMap:{}};const{inferBy:r="avg"}=n,o={},i=JSON.parse(JSON.stringify(e)),l={};t.forEach(c=>{const{field:d,unit:u}=c,f=[];e.forEach(g=>{const v=Rd(g[d]);v!==null&&f.push(v)});const p=f.length===0?0:r==="max"?Math.max(...f):f.reduce((g,v)=>g+v,0)/f.length;let h=u,m=0;u==="元"?p>=1e8?(h="亿元",m=2):p>1e4&&(h="万元",m=1):u==="m²"&&(h="万m²",m=1),l[d]={unit:h,level:m}});const s={};return t.forEach(c=>{const{field:d,unit:u}=c;s[u]||(s[u]=[]),s[u].push(d)}),Object.keys(s).forEach(c=>{const d=s[c],u=Math.max(...d.map(f=>l[f].level));if(c==="元"){const f=u===2?"亿元":u===1?"万元":"元";d.forEach(p=>{l[p].unit=f,l[p].level=u})}}),i.forEach(c=>{t.forEach(d=>{const{field:u,unit:f}=d,p=l[u].unit,h=Rd(c[u]);h!==null&&(f==="元"?p==="亿元"?c[u]=Number((h/1e8).toFixed(2)):p==="万元"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h:f==="m²"&&p==="万m²"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h),o[u]=p})}),{data:i,unitMap:o}},rH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o={};e.forEach(s=>{const c=s[n];c&&(o[c]=s)});const i=s=>{if(/^\d{4}$/.test(s))return String(Number(s)-1);if(/^\d{4}-\d{2}$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-Q\d$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-W\d+$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[c,d,u]=s.split("-");return`${Number(c)-1}-${d}-${u}`}return null},l=JSON.parse(JSON.stringify(e));return l.forEach(s=>{const c=s[n],d=i(c),u=d?o[d]:null;r.forEach(f=>{const p=Rd(s[f]);if(!u||p===null){s[`${f}_yoy`]=null;return}const h=Rd(u[f]);if(h===null){s[`${f}_yoy`]=null;return}const m=p-h,g=h===0?null:m/Math.abs(h),v=g===null?"--":`${(g*100).toFixed(2)}%`,y=m>0?"up":m<0?"down":"flat";s[`${f}_yoy`]={value:m,rate:g,ratePercent:v,trend:y}})}),l},aH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o=[...e].sort((l,s)=>{const c=l[n],d=s[n];return c<d?-1:c>d?1:0}),i=JSON.parse(JSON.stringify(o));return i.forEach((l,s)=>{if(s===0){r.forEach(d=>{l[`${d}_mom`]=null});return}const c=i[s-1];r.forEach(d=>{const u=Rd(l[d]),f=Rd(c[d]);if(u===null||f===null){l[`${d}_mom`]=null;return}const p=u-f,h=f===0?null:p/Math.abs(f),m=h===null?"--":`${(h*100).toFixed(2)}%`,g=p>0?"up":p<0?"down":"flat";l[`${d}_mom`]={value:p,rate:h,ratePercent:m,trend:g}})}),i},oH=(e,t)=>{const{sumFields:n,avgFields:r=[],labelField:o,labelText:i="合计"}=t;if(!e||e.length===0)return[];const l=e.filter(c=>!c._isSummary),s={_isSummary:!0};return o&&(s[o]=i),n.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=Number(d.toFixed(2))}),r.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=l.length>0?Number((d/l.length).toFixed(2)):0}),[...l,s]},gf={setKey(e){return`g:${e}`},set(e,t){window.localStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.localStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.localStorage.removeItem(gf.setKey(e))},clear(){window.localStorage.clear()}},lLe={set(e,t){window.sessionStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.sessionStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.sessionStorage.removeItem(gf.setKey(e))},clear(){window.sessionStorage.clear()}};/*! js-cookie v3.0.5 | MIT */function b1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var sLe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function sD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=b1({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in l)l[c]&&(s+="; "+c,l[c]!==!0&&(s+="="+l[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+s}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],l={},s=0;s<i.length;s++){var c=i[s].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(l[u]=e.read(d,u),o===u)break}catch{}}return o?l[o]:l}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",b1({},i,{expires:-1}))},withAttributes:function(o){return sD(this.converter,b1({},this.attributes,o))},withConverter:function(o){return sD(b1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var cD=sD(sLe,{path:"/"});function iH(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=cLe(e),s=new dD(l,{...i}),c=a.reactive([...s.mergeData()]),d=s.reactiveStates,u=s.isLoading,f=s.hasError;s.onDataUpdate(()=>{const C=s.mergeData();c.length=0,c.push(...C)});const p=async C=>s.loadData(C);a.onMounted(()=>{n&&p()});const h=async(C,b)=>s.refreshData(C,b),m=async(C,b)=>C?s.refreshData(C,b):s.refreshAll(),g=async C=>s.refreshAll(C),v=async(C,b)=>s.refreshData(C,b,!0),y=C=>d[C];return r&&a.watch(typeof r=="function"?r:()=>r.value,async C=>{if(o&&o.length>0)for(const b of o)await h(b,C);else await g()},{deep:!0}),{_sourceInstance:s,sourceData:c,sourceState:d,isLoading:u,hasError:f,loadData:p,refreshData:h,reload:m,refreshAll:g,updateData:v,getState:y,mergeData:s.mergeData.bind(s),onDataUpdate:s.onDataUpdate.bind(s),clear:s.clear.bind(s),destroy:s.destroy.bind(s)}}const cLe=e=>{const t=(n,r)=>{if(!r)return n;const o=r.startsWith("/")?r.slice(1):r,i=o.includes("/")?"/":".";return String(o).split(i).reduce((l,s)=>l!=null&&s?l[s]:void 0,n)};if(e&&typeof e=="object"&&"path"in e){const n=e.fieldPath??e.resPath;return[{key:"legacy_obj_api",type:"api",api:{url:e.path,method:(e.method??"GET").toUpperCase(),params:e.params,data:e.data,headers:e.headers,transform:r=>{const o=t(r,n),i=typeof e.transformResponse=="function"?e.transformResponse(o):void 0,l=i!==void 0?i:o;return Array.isArray(l)?l:[l]}}}]}else return e},Wn=async(e,t)=>{if(Array.isArray(e)){if(!e.every(r=>r&&typeof r=="object"&&"type"in r&&(r.type==="api"||r.type==="static")))return e}else{if(e&&typeof e=="object"&&!("path"in e))return[e];if(typeof e=="string"||typeof e=="number")return[{[t]:e}]}};function Hn(e){return e&&typeof e=="object"&&"reactiveStates"in e&&"isLoading"in e&&"hasError"in e&&typeof e.loadData=="function"&&typeof e.refreshData=="function"&&typeof e.mergeData=="function"}function Ln(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function Gn(e){return async t=>{const n=typeof window<"u"&&window.gui&&window.gui.guiDebug===!0||window.guiDebug===!0,r=(e==null?void 0:e.debug)===!0;if(!n&&!r)return;t.preventDefault();const o=e==null?void 0:e.data;Ln(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Hn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class dD{constructor(t,n={}){gc(this,"_configMap",new Map);gc(this,"_stateMap",new Map);gc(this,"_options");gc(this,"_listeners",new Set);gc(this,"reactiveStates",a.reactive({}));gc(this,"isLoading",a.ref(!1));gc(this,"hasError",a.ref(!1));gc(this,"debugMode",!1);gc(this,"pickPath",(t,n)=>{if(!n)return t;const r=n.startsWith("/")?n.slice(1):n,o=r.includes("/")?"/":".";return String(r).split(o).reduce((i,l)=>i!=null&&l?i[l]:void 0,t)});this._options={autoLoad:(n==null?void 0:n.autoLoad)||!1,retryCount:0,retryDelay:1e3,onRequest:i=>i,onResponse:i=>i,onError:()=>{},mergeTransformer:n.mergeTransformer,...n},this.cleanConfig(t).forEach(i=>{this.addSource(i)}),(this._options.autoLoad||this.isOldDataSource(t)&&((t==null?void 0:t.autoQuery)===!0||(t==null?void 0:t.autoQuery)===void 0))&&this.loadData()}addSource(t){this._configMap.set(t.key,t);const n={data:t.type==="static"?t.data??null:null,status:t.type==="static"?"success":"idle",error:null,lastUpdated:t.type==="static"?new Date:null};this._stateMap.set(t.key,n),this.reactiveStates[t.key]=n,t.type==="static"&&t.data!==void 0&&t.data!==null&&Promise.resolve().then(()=>{this.notifyListeners(t.key,t.data)})}removeSource(t){const n=this._configMap.delete(t);return this._stateMap.delete(t),delete this.reactiveStates[t],n}async loadSingle(t,n){const r=this._configMap.get(t);if(!r)throw new Error(`DataSource with key "${t}" not found`);this.updateState(t,{status:"loading",error:null});try{let o;if(r.type==="static")o=r.data;else if(r.type==="api"&&r.api)o=await this.fetchWithRetry(r,n);else throw new Error(`Invalid data source configuration for key "${t}"`);return this.updateState(t,{data:o,status:"success",error:null,lastUpdated:new Date}),this.notifyListeners(t,o),o}catch(o){const i=o instanceof Error?o:new Error(String(o));throw this.updateState(t,{status:"error",error:i}),this._options.onError(i,t),i}}async fetchWithRetry(t,n,r=0){var i;const o=t.api;try{const l=qn.state["gui-ajax-config"]||{},s=typeof document<"u"&&((i=cD.get)==null?void 0:i.call(cD,"token"))||"",c=(l==null?void 0:l.token)||s,d={};if(c){const w=(l==null?void 0:l.tokenName)||"token";d[w]=c}l!=null&&l.sysCode&&(d.sysCode=l.sysCode),l!=null&&l.appType&&(d.appType=l.appType);const u={...d,...o.headers||{}},f={...o.headers||{}},p=t.key==="legacy_obj_api"?f:u;let h={url:o.url,method:o.method||"GET",headers:p};const m={...o.params,...n},g={...o.data,...n};h.method==="GET"?h.params=m:h.data=g,h=this._options.onRequest(h),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:h.url,method:h.method,params:h.params,data:h.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const v=await sa(h),y=v.data;if(y&&typeof y=="object"&&y.code===999){const w=y.errorMsg||"Request failed with code 999";return Xi&&Xi.warning(w),[]}let C=this._options.onResponse(v.data),b=!1;if(o.fieldPath?(C=this.pickPath(C,o.fieldPath),b=!0):C&&typeof C=="object"&&"data"in C&&(C=this.pickPath(C,"data"),b=!0),o.transform){const w=C;let S=o.transform(w,y);C=S!==void 0?S:w}else b&&(C=Array.isArray(C)?C:[C]);return C}catch(l){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw l}}delay(t){return new Promise(n=>setTimeout(n,t))}updateState(t,n){const r=this._stateMap.get(t);if(r){const o={...r,...n};this._stateMap.set(t,o),Object.assign(this.reactiveStates[t],o)}this.updateGlobalStatus()}updateGlobalStatus(){let t=!1,n=!1;this._stateMap.forEach(r=>{r.status==="loading"&&(t=!0),r.status==="error"&&(n=!0)}),this.isLoading&&typeof this.isLoading=="object"&&"value"in this.isLoading?this.isLoading.value=t:this.isLoading=a.ref(t),this.hasError&&typeof this.hasError=="object"&&"value"in this.hasError?this.hasError.value=n:this.hasError=a.ref(n)}notifyListeners(t,n){const r=this._stateMap.get(t);r&&this._listeners.forEach(o=>{o(t,n,r)})}normalizeMethod(t){const n=String(t??"GET").toUpperCase();return n==="POST"||n==="PUT"||n==="DELETE"?n:"GET"}isOldDataSource(t){if(!t||Array.isArray(t)||Object.getPrototypeOf(t)!==Object.prototype)return!1;const n=t.type;return!!(n!=="api"&&n!=="static")}cleanConfig(t){var n;if(this.isOldDataSource(t)){const r=t.fieldPath??t.resPath,o=t.key?((n=qn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:qn.state["gui-ajax-config"]??{},i={};o!=null&&o.tokenName&&(o!=null&&o.token)&&(i[o.tokenName]=o.token),o!=null&&o.sysCode&&(i.sysCode=o.sysCode),o!=null&&o.appType&&(i.appType=o.appType);const l={...i,...t.headers||{}};return[{key:"legacy_obj_api",type:"api",api:{url:t.path,method:this.normalizeMethod(t.method),params:t.params||t.data,data:t.data||t.params,headers:l,...r?{fieldPath:r}:{},transform:(s,c)=>{const d=typeof t.transformResponse=="function"?t.transformResponse(s,c):void 0;return d!==void 0?d:s}}}]}else return t}async loadData(t){const r=(t?Array.isArray(t)?t:[t]:Array.from(this._configMap.keys()).filter(o=>{var i;return((i=this._configMap.get(o))==null?void 0:i.type)==="api"})).map(o=>this.loadSingle(o).then(i=>({key:o,data:i,success:!0})).catch(i=>({key:o,error:i,success:!1})));return await Promise.all(r),this.mergeData()}async refreshData(t,n,r){if(!this._configMap.has(t))throw new Error(`DataSource with key "${t}" not found`);if(r){const i=n;return this.updateState(t,{data:i,status:"success",lastUpdated:new Date}),this.notifyListeners(t,i),i}const o=this._configMap.get(t);if(o.type==="api"&&o.api&&n&&typeof n=="object"&&!Array.isArray(n)){const i={...n};return"_url"in i&&(o.api.url=i._url,delete i._url),(o.api.method||"GET")==="GET"?o.api.params={...o.api.params||{},...i}:o.api.data={...o.api.data||{},...i},this._configMap.set(t,o),this.loadSingle(t)}return this.loadSingle(t,n)}async refreshAll(t){const r=Array.from(this._configMap.keys()).map(o=>{const i=t==null?void 0:t[o];return this.refreshData(o,i).then(l=>({key:o,data:l,success:!0})).catch(l=>({key:o,error:l,success:!1}))});return await Promise.all(r),this.mergeData()}getData(t){var n;return(n=this._stateMap.get(t))==null?void 0:n.data}getAllData(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n.data}),t}getState(t){return this._stateMap.get(t)}getAllStates(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n}),t}getLoadingStatus(t){var n;return((n=this._stateMap.get(t))==null?void 0:n.status)??"idle"}isSourceLoading(t){return this.getLoadingStatus(t)==="loading"}onDataUpdate(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}mergeData(t){const n=t||this._options.mergeTransformer,r=this.getAllData();if(n)return n(r);const o=Object.values(r);return o.length===1?o[0]||[]:o.flat()}clear(){this._configMap.forEach((t,n)=>{this.updateState(n,{data:null,status:"idle",error:null,lastUpdated:null})})}destroy(){this._configMap.clear(),this._stateMap.clear(),this._listeners.clear(),Object.keys(this.reactiveStates).forEach(t=>{delete this.reactiveStates[t]})}reload(t,n){if(typeof t=="string")return this.refreshData(t,n);if(t&&typeof t=="object"&&!n){const r=Array.from(this._configMap.keys());if(r.length===1)return this.refreshData(r[0],t);const o={};return r.forEach(i=>{o[i]=t}),this.refreshAll(o)}return t?this.refreshAll(t):this.refreshAll()}}var dLe={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}},uLe={exports:{}};(function(e,t){(function(n,r){e.exports=r(t5())})(Pl,function(n){function r(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(l,s){return s==="W"?l+"周":l+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(l,s){var c=100*l+s;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(uLe);/*! *****************************************************************************
56
+ `;o.innerHTML=i,n.appendChild(o),(!e||e=="body")&&(o.style.position="fixed");const l=o.querySelectorAll(".loading-dots .loadot");l[0].style.backgroundColor=am.loadingList[0],l[1].style.backgroundColor=am.loadingList[1],l[2].style.backgroundColor=am.loadingList[2],am.name&&typeof am.name=="string"&&am.name.includes("black")&&(o.style.backgroundColor="rgba(0, 0, 0, 0.6)");const s={lg:16,md:12,sm:8,xs:5},c={lg:"12px",md:"10px",sm:"8px",xs:"4px"},d=o.querySelector(".loading-dots");d.style.gap=c[t]||"10px",l.forEach(u=>{u.style.width=`${s[t]}px`,u.style.height=`${s[t]}px`}),globalThis.gui.loading=Ey})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{if(globalThis.gui.loading=Ey,!e||e=="body"){const r=Array.from(document.body.children).filter(i=>i.classList.contains("loading-next")),o=r[r.length-1];o&&o.parentNode&&o.parentNode.removeChild(o),document.body.querySelector(":scope > .loading-next")===null&&(document.body.style.overflow="");return}const n=document.querySelector(`${e} .loading-next`);n&&n.parentNode&&(n.parentNode.removeChild(n),document.body.style.overflow="")},t)})}};function lD(e,t=500,n,r){let o=null,i=!1;const l=function(...s){return new Promise((c,d)=>{if(o&&clearTimeout(o),n&&!i){try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!0}else o=setTimeout(()=>{try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!1,o=null},t)})};return l.cancel=function(){o&&clearTimeout(o),i=!1,o=null},l}function JRe(e,t,n={leading:!1,trailing:!0}){let r=null,o=0;const{leading:i,trailing:l}=n,s=function(...c){const d=Date.now();!o&&!i&&(o=d);const u=t-(d-o);u<=0&&(r&&(clearTimeout(r),r=null),o=d,e.apply(this,c)),l&&!r&&(r=setTimeout(()=>{o=i?Date.now():0,r=null,e.apply(this,c)},u))};return s.cancel=function(){r&&clearTimeout(r),r=null,o=0},s}function eLe(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function tLe(e,t=2,n=",",r=".",o="",i=""){if(Number(e)===0)return Number(e).toFixed(t).replace(/\.?0+$/,"");if(!e)return"";e=Number(e).toFixed(t).replace(/\.?0+$/,""),e+="";const l=e.split(".");let s=l[0];const c=l.length>1?r+l[1]:"",d=/(\d+)(\d{3})/;function u(f){return Object.prototype.toString.call(f)==="[object Number]"}if(n&&!u(n))for(;d.test(s);)s=s.replace(d,"$1"+n+"$2");return o+s+c+i}const nLe=(e,t)=>e.toFixed(t),rLe=e=>0 .toFixed(e)+"%",aLe=e=>{const t={key:(e==null?void 0:e.key)||"",sysCode:(e==null?void 0:e.sysCode)||"",appType:(e==null?void 0:e.appType)||"pc",tokenName:(e==null?void 0:e.tokenName)||"gt-token",token:(e==null?void 0:e.token)||""},n=e==null?void 0:e.key,r=n?`gui-ajax-config.${n}`:"gui-ajax-config";qn.commit("setState",{path:r,value:t})},oLe=e=>{const t=e?`gui-ajax-config.${e}`:"gui-ajax-config";return Pr(qn.state,t)},Id=e=>typeof e=="function"?"function":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="object"?"object":typeof e=="boolean"?"boolean":typeof e>"u"?"undefined":typeof e=="bigint"?"bigint":typeof e=="symbol"?"symbol":"null",Or=e=>!!(!e||Object.keys(e).length===0||Array.isArray(e)&&e.length===0);function iLe({exportType:e="excel",excelConfig:t,exportDataQueryParam:n,excelSheetNum:r=1,headers:o={}}){const i=(t==null?void 0:t.excelName)||"导出表格";if(e==="csv"){if(((t==null?void 0:t.sheets)??[]).some(c=>{var d;return(d=c.headers)==null?void 0:d.some(u=>u.children&&u.children.length>0)})){Xi.warning("csv 类型文件不支持导出多级表头");return}if(r>1){Xi.warning("csv 类型文件不支持多 sheet 页");return}}Ey.start("body"),sa.post("https://matrix.gtcloud.cn/preapi/data/exportExcel/general/v2",{exportType:e,excelConfig:t,exportDataQueryParam:n,excelSheetNum:r},{responseType:"blob",headers:{"Content-Type":"application/json",...o}}).then(l=>{const s=new Blob([l.data],{type:"application/vnd.ms-excel"}),c=window.URL.createObjectURL(s),d=document.createElement("a");d.href=c,d.download=`${i}.xlsx`,d.click(),window.URL.revokeObjectURL(c)}).finally(()=>{Ey.done("body")})}const Rd=e=>{if(e==null)return null;const t=Number(e);return isNaN(t)?null:t},nH=(e,t,n={})=>{if(!e||e.length===0)return{data:[],unitMap:{}};const{inferBy:r="avg"}=n,o={},i=JSON.parse(JSON.stringify(e)),l={};t.forEach(c=>{const{field:d,unit:u}=c,f=[];e.forEach(g=>{const v=Rd(g[d]);v!==null&&f.push(v)});const p=f.length===0?0:r==="max"?Math.max(...f):f.reduce((g,v)=>g+v,0)/f.length;let h=u,m=0;u==="元"?p>=1e8?(h="亿元",m=2):p>1e4&&(h="万元",m=1):u==="m²"&&(h="万m²",m=1),l[d]={unit:h,level:m}});const s={};return t.forEach(c=>{const{field:d,unit:u}=c;s[u]||(s[u]=[]),s[u].push(d)}),Object.keys(s).forEach(c=>{const d=s[c],u=Math.max(...d.map(f=>l[f].level));if(c==="元"){const f=u===2?"亿元":u===1?"万元":"元";d.forEach(p=>{l[p].unit=f,l[p].level=u})}}),i.forEach(c=>{t.forEach(d=>{const{field:u,unit:f}=d,p=l[u].unit,h=Rd(c[u]);h!==null&&(f==="元"?p==="亿元"?c[u]=Number((h/1e8).toFixed(2)):p==="万元"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h:f==="m²"&&p==="万m²"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h),o[u]=p})}),{data:i,unitMap:o}},rH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o={};e.forEach(s=>{const c=s[n];c&&(o[c]=s)});const i=s=>{if(/^\d{4}$/.test(s))return String(Number(s)-1);if(/^\d{4}-\d{2}$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-Q\d$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-W\d+$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[c,d,u]=s.split("-");return`${Number(c)-1}-${d}-${u}`}return null},l=JSON.parse(JSON.stringify(e));return l.forEach(s=>{const c=s[n],d=i(c),u=d?o[d]:null;r.forEach(f=>{const p=Rd(s[f]);if(!u||p===null){s[`${f}_yoy`]=null;return}const h=Rd(u[f]);if(h===null){s[`${f}_yoy`]=null;return}const m=p-h,g=h===0?null:m/Math.abs(h),v=g===null?"--":`${(g*100).toFixed(2)}%`,y=m>0?"up":m<0?"down":"flat";s[`${f}_yoy`]={value:m,rate:g,ratePercent:v,trend:y}})}),l},aH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o=[...e].sort((l,s)=>{const c=l[n],d=s[n];return c<d?-1:c>d?1:0}),i=JSON.parse(JSON.stringify(o));return i.forEach((l,s)=>{if(s===0){r.forEach(d=>{l[`${d}_mom`]=null});return}const c=i[s-1];r.forEach(d=>{const u=Rd(l[d]),f=Rd(c[d]);if(u===null||f===null){l[`${d}_mom`]=null;return}const p=u-f,h=f===0?null:p/Math.abs(f),m=h===null?"--":`${(h*100).toFixed(2)}%`,g=p>0?"up":p<0?"down":"flat";l[`${d}_mom`]={value:p,rate:h,ratePercent:m,trend:g}})}),i},oH=(e,t)=>{const{sumFields:n,avgFields:r=[],labelField:o,labelText:i="合计"}=t;if(!e||e.length===0)return[];const l=e.filter(c=>!c._isSummary),s={_isSummary:!0};return o&&(s[o]=i),n.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=Number(d.toFixed(2))}),r.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=l.length>0?Number((d/l.length).toFixed(2)):0}),[...l,s]},gf={setKey(e){return`g:${e}`},set(e,t){window.localStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.localStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.localStorage.removeItem(gf.setKey(e))},clear(){window.localStorage.clear()}},lLe={set(e,t){window.sessionStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.sessionStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.sessionStorage.removeItem(gf.setKey(e))},clear(){window.sessionStorage.clear()}};/*! js-cookie v3.0.5 | MIT */function b1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var sLe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function sD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=b1({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in l)l[c]&&(s+="; "+c,l[c]!==!0&&(s+="="+l[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+s}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],l={},s=0;s<i.length;s++){var c=i[s].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(l[u]=e.read(d,u),o===u)break}catch{}}return o?l[o]:l}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",b1({},i,{expires:-1}))},withAttributes:function(o){return sD(this.converter,b1({},this.attributes,o))},withConverter:function(o){return sD(b1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var cD=sD(sLe,{path:"/"});function iH(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=cLe(e),s=new dD(l,{...i}),c=a.reactive([...s.mergeData()]),d=s.reactiveStates,u=s.isLoading,f=s.hasError;s.onDataUpdate(()=>{const C=s.mergeData();c.length=0,c.push(...C)});const p=async C=>s.loadData(C);a.onMounted(()=>{n&&p()});const h=async(C,b)=>s.refreshData(C,b),m=async(C,b)=>C?s.refreshData(C,b):s.refreshAll(),g=async C=>s.refreshAll(C),v=async(C,b)=>s.refreshData(C,b,!0),y=C=>d[C];return r&&a.watch(typeof r=="function"?r:()=>r.value,async C=>{if(o&&o.length>0)for(const b of o)await h(b,C);else await g()},{deep:!0}),{_sourceInstance:s,sourceData:c,sourceState:d,isLoading:u,hasError:f,loadData:p,refreshData:h,reload:m,refreshAll:g,updateData:v,getState:y,mergeData:s.mergeData.bind(s),onDataUpdate:s.onDataUpdate.bind(s),clear:s.clear.bind(s),destroy:s.destroy.bind(s)}}const cLe=e=>{const t=(n,r)=>{if(!r)return n;const o=r.startsWith("/")?r.slice(1):r,i=o.includes("/")?"/":".";return String(o).split(i).reduce((l,s)=>l!=null&&s?l[s]:void 0,n)};if(e&&typeof e=="object"&&"path"in e){const n=e.fieldPath??e.resPath;return[{key:"legacy_obj_api",type:"api",api:{url:e.path,method:(e.method??"GET").toUpperCase(),params:e.params,data:e.data,headers:e.headers,transform:r=>{const o=t(r,n),i=typeof e.transformResponse=="function"?e.transformResponse(o):void 0,l=i!==void 0?i:o;return Array.isArray(l)?l:[l]}}}]}else return e},Wn=async(e,t)=>{if(Array.isArray(e)){if(!e.every(r=>r&&typeof r=="object"&&"type"in r&&(r.type==="api"||r.type==="static")))return e}else{if(e&&typeof e=="object"&&!("path"in e))return[e];if(typeof e=="string"||typeof e=="number")return[{[t]:e}]}};function Hn(e){return e&&typeof e=="object"&&"reactiveStates"in e&&"isLoading"in e&&"hasError"in e&&typeof e.loadData=="function"&&typeof e.refreshData=="function"&&typeof e.mergeData=="function"}function Ln(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function Gn(e){return async t=>{const n=typeof window<"u"&&window.gui&&window.gui.guiDebug===!0||window.guiDebug===!0,r=(e==null?void 0:e.debug)===!0;if(!n&&!r)return;t.preventDefault();const o=e==null?void 0:e.data;Ln(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Hn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class dD{constructor(t,n={}){gc(this,"_configMap",new Map);gc(this,"_stateMap",new Map);gc(this,"_options");gc(this,"_listeners",new Set);gc(this,"reactiveStates",a.reactive({}));gc(this,"isLoading",a.ref(!1));gc(this,"hasError",a.ref(!1));gc(this,"debugMode",!1);gc(this,"pickPath",(t,n)=>{if(!n)return t;const r=n.startsWith("/")?n.slice(1):n,o=r.includes("/")?"/":".";return String(r).split(o).reduce((i,l)=>i!=null&&l?i[l]:void 0,t)});this._options={autoLoad:(n==null?void 0:n.autoLoad)||!1,retryCount:0,retryDelay:1e3,onRequest:i=>i,onResponse:i=>i,onError:()=>{},mergeTransformer:n.mergeTransformer,...n},this.cleanConfig(t).forEach(i=>{this.addSource(i)}),(this._options.autoLoad||this.isOldDataSource(t)&&((t==null?void 0:t.autoQuery)===!0||(t==null?void 0:t.autoQuery)===void 0))&&this.loadData()}addSource(t){this._configMap.set(t.key,t);const n={data:t.type==="static"?t.data??null:null,status:t.type==="static"?"success":"idle",error:null,lastUpdated:t.type==="static"?new Date:null};this._stateMap.set(t.key,n),this.reactiveStates[t.key]=n,t.type==="static"&&t.data!==void 0&&t.data!==null&&Promise.resolve().then(()=>{this.notifyListeners(t.key,t.data)})}removeSource(t){const n=this._configMap.delete(t);return this._stateMap.delete(t),delete this.reactiveStates[t],n}async loadSingle(t,n){const r=this._configMap.get(t);if(!r)throw new Error(`DataSource with key "${t}" not found`);this.updateState(t,{status:"loading",error:null});try{let o;if(r.type==="static")o=r.data;else if(r.type==="api"&&r.api)o=await this.fetchWithRetry(r,n);else throw new Error(`Invalid data source configuration for key "${t}"`);return this.updateState(t,{data:o,status:"success",error:null,lastUpdated:new Date}),this.notifyListeners(t,o),o}catch(o){const i=o instanceof Error?o:new Error(String(o));throw this.updateState(t,{status:"error",error:i}),this._options.onError(i,t),i}}async fetchWithRetry(t,n,r=0){var i;const o=t.api;try{const l=qn.state["gui-ajax-config"]||{},s=typeof document<"u"&&((i=cD.get)==null?void 0:i.call(cD,"token"))||"",c=(l==null?void 0:l.token)||s,d={};if(c){const w=(l==null?void 0:l.tokenName)||"token";d[w]=c}l!=null&&l.sysCode&&(d.sysCode=l.sysCode),l!=null&&l.appType&&(d.appType=l.appType);const u={...d,...o.headers||{}},f={...o.headers||{}},p=t.key==="legacy_obj_api"?f:u;let h={url:o.url,method:o.method||"GET",headers:p};const m={...o.params,...n},g={...o.data,...n};h.method==="GET"?h.params=m:h.data=g,h=this._options.onRequest(h),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:h.url,method:h.method,params:h.params,data:h.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const v=await sa(h),y=v.data;if(y&&typeof y=="object"&&y.code===999){const w=y.errorMsg||"Request failed with code 999";return Xi&&Xi.warning(w),[]}let C=this._options.onResponse(v.data),b=!1;if(o.fieldPath?(C=this.pickPath(C,o.fieldPath),b=!0):C&&typeof C=="object"&&"data"in C&&(C=this.pickPath(C,"data"),b=!0),o.transform){const w=C;let S=o.transform(w,y);C=S!==void 0?S:w}else b&&(C=Array.isArray(C)?C:[C]);return C}catch(l){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw l}}delay(t){return new Promise(n=>setTimeout(n,t))}updateState(t,n){const r=this._stateMap.get(t);if(r){const o={...r,...n};this._stateMap.set(t,o),Object.assign(this.reactiveStates[t],o)}this.updateGlobalStatus()}updateGlobalStatus(){let t=!1,n=!1;this._stateMap.forEach(r=>{r.status==="loading"&&(t=!0),r.status==="error"&&(n=!0)}),this.isLoading&&typeof this.isLoading=="object"&&"value"in this.isLoading?this.isLoading.value=t:this.isLoading=a.ref(t),this.hasError&&typeof this.hasError=="object"&&"value"in this.hasError?this.hasError.value=n:this.hasError=a.ref(n)}notifyListeners(t,n){const r=this._stateMap.get(t);r&&this._listeners.forEach(o=>{o(t,n,r)})}normalizeMethod(t){const n=String(t??"GET").toUpperCase();return n==="POST"||n==="PUT"||n==="DELETE"?n:"GET"}isOldDataSource(t){if(!t||Array.isArray(t)||Object.getPrototypeOf(t)!==Object.prototype)return!1;const n=t.type;return!!(n!=="api"&&n!=="static")}cleanConfig(t){var n;if(this.isOldDataSource(t)){const r=t.fieldPath??t.resPath,o=t.key?((n=qn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:qn.state["gui-ajax-config"]??{},i={};o!=null&&o.tokenName&&(o!=null&&o.token)&&(i[o.tokenName]=o.token),o!=null&&o.sysCode&&(i.sysCode=o.sysCode),o!=null&&o.appType&&(i.appType=o.appType);const l={...i,...t.headers||{}};return[{key:"legacy_obj_api",type:"api",api:{url:t.path,method:this.normalizeMethod(t.method),params:t.params||t.data,data:t.data||t.params,headers:l,...r?{fieldPath:r}:{},transform:(s,c)=>{const d=typeof t.transformResponse=="function"?t.transformResponse(s,c):void 0;return d!==void 0?d:s}}}]}else return t}async loadData(t){const r=(t?Array.isArray(t)?t:[t]:Array.from(this._configMap.keys()).filter(o=>{var i;return((i=this._configMap.get(o))==null?void 0:i.type)==="api"})).map(o=>this.loadSingle(o).then(i=>({key:o,data:i,success:!0})).catch(i=>({key:o,error:i,success:!1})));return await Promise.all(r),this.mergeData()}async refreshData(t,n,r){if(!this._configMap.has(t))throw new Error(`DataSource with key "${t}" not found`);if(r){const i=n;return this.updateState(t,{data:i,status:"success",lastUpdated:new Date}),this.notifyListeners(t,i),i}const o=this._configMap.get(t);if(o.type==="api"&&o.api&&n&&typeof n=="object"&&!Array.isArray(n)){const i={...n};return"_url"in i&&(o.api.url=i._url,delete i._url),(o.api.method||"GET")==="GET"?o.api.params={...o.api.params||{},...i}:o.api.data={...o.api.data||{},...i},this._configMap.set(t,o),this.loadSingle(t)}return this.loadSingle(t,n)}async refreshAll(t){const r=Array.from(this._configMap.keys()).map(o=>{const i=t==null?void 0:t[o];return this.refreshData(o,i).then(l=>({key:o,data:l,success:!0})).catch(l=>({key:o,error:l,success:!1}))});return await Promise.all(r),this.mergeData()}getData(t){var n;return(n=this._stateMap.get(t))==null?void 0:n.data}getAllData(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n.data}),t}getState(t){return this._stateMap.get(t)}getAllStates(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n}),t}getLoadingStatus(t){var n;return((n=this._stateMap.get(t))==null?void 0:n.status)??"idle"}isSourceLoading(t){return this.getLoadingStatus(t)==="loading"}onDataUpdate(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}mergeData(t){const n=t||this._options.mergeTransformer,r=this.getAllData();if(n)return n(r);const o=Object.values(r);return o.length===1?o[0]||[]:o.flat()}clear(){this._configMap.forEach((t,n)=>{this.updateState(n,{data:null,status:"idle",error:null,lastUpdated:null})})}destroy(){this._configMap.clear(),this._stateMap.clear(),this._listeners.clear(),Object.keys(this.reactiveStates).forEach(t=>{delete this.reactiveStates[t]})}reload(t,n){if(typeof t=="string")return this.refreshData(t,n);if(t&&typeof t=="object"&&!n){const r=Array.from(this._configMap.keys());if(r.length===1)return this.refreshData(r[0],t);const o={};return r.forEach(i=>{o[i]=t}),this.refreshAll(o)}return t?this.refreshAll(t):this.refreshAll()}}var dLe={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}},uLe={exports:{}};(function(e,t){(function(n,r){e.exports=r(t5())})(Pl,function(n){function r(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(l,s){return s==="W"?l+"周":l+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(l,s){var c=100*l+s;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(uLe);/*! *****************************************************************************
57
57
  Copyright (c) Microsoft Corporation.
58
58
 
59
59
  Permission to use, copy, modify, and/or distribute this software for any
Binary file
package/lib/g-ui-web.js CHANGED
@@ -44863,9 +44863,13 @@ const e3e = {
44863
44863
  done: function(e, t = 0) {
44864
44864
  De(() => {
44865
44865
  setTimeout(() => {
44866
- globalThis.gui.loading = zb, document.body.style.overflow = "";
44867
- const n = e ? document.querySelector(`${e} .loading-next`) : document.querySelector(".loading-next");
44868
- n && n.parentNode && n.parentNode.removeChild(n);
44866
+ if (globalThis.gui.loading = zb, !e || e == "body") {
44867
+ const r = Array.from(document.body.children).filter((o) => o.classList.contains("loading-next")), a = r[r.length - 1];
44868
+ a && a.parentNode && a.parentNode.removeChild(a), document.body.querySelector(":scope > .loading-next") === null && (document.body.style.overflow = "");
44869
+ return;
44870
+ }
44871
+ const n = document.querySelector(`${e} .loading-next`);
44872
+ n && n.parentNode && (n.parentNode.removeChild(n), document.body.style.overflow = "");
44869
44873
  }, t);
44870
44874
  });
44871
44875
  }
@@ -44988,7 +44992,7 @@ function $Tt({
44988
44992
  const l = new Blob([i.data], { type: "application/vnd.ms-excel" }), s = window.URL.createObjectURL(l), u = document.createElement("a");
44989
44993
  u.href = s, u.download = `${o}.xlsx`, u.click(), window.URL.revokeObjectURL(s);
44990
44994
  }).finally(() => {
44991
- zb.done("");
44995
+ zb.done("body");
44992
44996
  });
44993
44997
  }
44994
44998
  const mf = (e) => {
Binary file
@@ -53,7 +53,7 @@
53
53
  <div class="loadot"></div>
54
54
  <div class="loadot"></div>
55
55
  </div>
56
- `;o.innerHTML=i,n.appendChild(o),(!e||e=="body")&&(o.style.position="fixed");const l=o.querySelectorAll(".loading-dots .loadot");l[0].style.backgroundColor=am.loadingList[0],l[1].style.backgroundColor=am.loadingList[1],l[2].style.backgroundColor=am.loadingList[2],am.name&&typeof am.name=="string"&&am.name.includes("black")&&(o.style.backgroundColor="rgba(0, 0, 0, 0.6)");const s={lg:16,md:12,sm:8,xs:5},c={lg:"12px",md:"10px",sm:"8px",xs:"4px"},d=o.querySelector(".loading-dots");d.style.gap=c[t]||"10px",l.forEach(u=>{u.style.width=`${s[t]}px`,u.style.height=`${s[t]}px`}),globalThis.gui.loading=Ey})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=Ey,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};function lD(e,t=500,n,r){let o=null,i=!1;const l=function(...s){return new Promise((c,d)=>{if(o&&clearTimeout(o),n&&!i){try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!0}else o=setTimeout(()=>{try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!1,o=null},t)})};return l.cancel=function(){o&&clearTimeout(o),i=!1,o=null},l}function QRe(e,t,n={leading:!1,trailing:!0}){let r=null,o=0;const{leading:i,trailing:l}=n,s=function(...c){const d=Date.now();!o&&!i&&(o=d);const u=t-(d-o);u<=0&&(r&&(clearTimeout(r),r=null),o=d,e.apply(this,c)),l&&!r&&(r=setTimeout(()=>{o=i?Date.now():0,r=null,e.apply(this,c)},u))};return s.cancel=function(){r&&clearTimeout(r),r=null,o=0},s}function JRe(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function eLe(e,t=2,n=",",r=".",o="",i=""){if(Number(e)===0)return Number(e).toFixed(t).replace(/\.?0+$/,"");if(!e)return"";e=Number(e).toFixed(t).replace(/\.?0+$/,""),e+="";const l=e.split(".");let s=l[0];const c=l.length>1?r+l[1]:"",d=/(\d+)(\d{3})/;function u(f){return Object.prototype.toString.call(f)==="[object Number]"}if(n&&!u(n))for(;d.test(s);)s=s.replace(d,"$1"+n+"$2");return o+s+c+i}const tLe=(e,t)=>e.toFixed(t),nLe=e=>0 .toFixed(e)+"%",rLe=e=>{const t={key:(e==null?void 0:e.key)||"",sysCode:(e==null?void 0:e.sysCode)||"",appType:(e==null?void 0:e.appType)||"pc",tokenName:(e==null?void 0:e.tokenName)||"gt-token",token:(e==null?void 0:e.token)||""},n=e==null?void 0:e.key,r=n?`gui-ajax-config.${n}`:"gui-ajax-config";qn.commit("setState",{path:r,value:t})},aLe=e=>{const t=e?`gui-ajax-config.${e}`:"gui-ajax-config";return Pr(qn.state,t)},Id=e=>typeof e=="function"?"function":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="object"?"object":typeof e=="boolean"?"boolean":typeof e>"u"?"undefined":typeof e=="bigint"?"bigint":typeof e=="symbol"?"symbol":"null",Or=e=>!!(!e||Object.keys(e).length===0||Array.isArray(e)&&e.length===0);function oLe({exportType:e="excel",excelConfig:t,exportDataQueryParam:n,excelSheetNum:r=1,headers:o={}}){const i=(t==null?void 0:t.excelName)||"导出表格";if(e==="csv"){if(((t==null?void 0:t.sheets)??[]).some(c=>{var d;return(d=c.headers)==null?void 0:d.some(u=>u.children&&u.children.length>0)})){Xi.warning("csv 类型文件不支持导出多级表头");return}if(r>1){Xi.warning("csv 类型文件不支持多 sheet 页");return}}Ey.start("body"),sa.post("https://matrix.gtcloud.cn/preapi/data/exportExcel/general/v2",{exportType:e,excelConfig:t,exportDataQueryParam:n,excelSheetNum:r},{responseType:"blob",headers:{"Content-Type":"application/json",...o}}).then(l=>{const s=new Blob([l.data],{type:"application/vnd.ms-excel"}),c=window.URL.createObjectURL(s),d=document.createElement("a");d.href=c,d.download=`${i}.xlsx`,d.click(),window.URL.revokeObjectURL(c)}).finally(()=>{Ey.done("")})}const Rd=e=>{if(e==null)return null;const t=Number(e);return isNaN(t)?null:t},nH=(e,t,n={})=>{if(!e||e.length===0)return{data:[],unitMap:{}};const{inferBy:r="avg"}=n,o={},i=JSON.parse(JSON.stringify(e)),l={};t.forEach(c=>{const{field:d,unit:u}=c,f=[];e.forEach(g=>{const v=Rd(g[d]);v!==null&&f.push(v)});const p=f.length===0?0:r==="max"?Math.max(...f):f.reduce((g,v)=>g+v,0)/f.length;let h=u,m=0;u==="元"?p>=1e8?(h="亿元",m=2):p>1e4&&(h="万元",m=1):u==="m²"&&(h="万m²",m=1),l[d]={unit:h,level:m}});const s={};return t.forEach(c=>{const{field:d,unit:u}=c;s[u]||(s[u]=[]),s[u].push(d)}),Object.keys(s).forEach(c=>{const d=s[c],u=Math.max(...d.map(f=>l[f].level));if(c==="元"){const f=u===2?"亿元":u===1?"万元":"元";d.forEach(p=>{l[p].unit=f,l[p].level=u})}}),i.forEach(c=>{t.forEach(d=>{const{field:u,unit:f}=d,p=l[u].unit,h=Rd(c[u]);h!==null&&(f==="元"?p==="亿元"?c[u]=Number((h/1e8).toFixed(2)):p==="万元"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h:f==="m²"&&p==="万m²"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h),o[u]=p})}),{data:i,unitMap:o}},rH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o={};e.forEach(s=>{const c=s[n];c&&(o[c]=s)});const i=s=>{if(/^\d{4}$/.test(s))return String(Number(s)-1);if(/^\d{4}-\d{2}$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-Q\d$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-W\d+$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[c,d,u]=s.split("-");return`${Number(c)-1}-${d}-${u}`}return null},l=JSON.parse(JSON.stringify(e));return l.forEach(s=>{const c=s[n],d=i(c),u=d?o[d]:null;r.forEach(f=>{const p=Rd(s[f]);if(!u||p===null){s[`${f}_yoy`]=null;return}const h=Rd(u[f]);if(h===null){s[`${f}_yoy`]=null;return}const m=p-h,g=h===0?null:m/Math.abs(h),v=g===null?"--":`${(g*100).toFixed(2)}%`,y=m>0?"up":m<0?"down":"flat";s[`${f}_yoy`]={value:m,rate:g,ratePercent:v,trend:y}})}),l},aH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o=[...e].sort((l,s)=>{const c=l[n],d=s[n];return c<d?-1:c>d?1:0}),i=JSON.parse(JSON.stringify(o));return i.forEach((l,s)=>{if(s===0){r.forEach(d=>{l[`${d}_mom`]=null});return}const c=i[s-1];r.forEach(d=>{const u=Rd(l[d]),f=Rd(c[d]);if(u===null||f===null){l[`${d}_mom`]=null;return}const p=u-f,h=f===0?null:p/Math.abs(f),m=h===null?"--":`${(h*100).toFixed(2)}%`,g=p>0?"up":p<0?"down":"flat";l[`${d}_mom`]={value:p,rate:h,ratePercent:m,trend:g}})}),i},oH=(e,t)=>{const{sumFields:n,avgFields:r=[],labelField:o,labelText:i="合计"}=t;if(!e||e.length===0)return[];const l=e.filter(c=>!c._isSummary),s={_isSummary:!0};return o&&(s[o]=i),n.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=Number(d.toFixed(2))}),r.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=l.length>0?Number((d/l.length).toFixed(2)):0}),[...l,s]},gf={setKey(e){return`g:${e}`},set(e,t){window.localStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.localStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.localStorage.removeItem(gf.setKey(e))},clear(){window.localStorage.clear()}},iLe={set(e,t){window.sessionStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.sessionStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.sessionStorage.removeItem(gf.setKey(e))},clear(){window.sessionStorage.clear()}};/*! js-cookie v3.0.5 | MIT */function b1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var lLe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function sD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=b1({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in l)l[c]&&(s+="; "+c,l[c]!==!0&&(s+="="+l[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+s}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],l={},s=0;s<i.length;s++){var c=i[s].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(l[u]=e.read(d,u),o===u)break}catch{}}return o?l[o]:l}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",b1({},i,{expires:-1}))},withAttributes:function(o){return sD(this.converter,b1({},this.attributes,o))},withConverter:function(o){return sD(b1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var cD=sD(lLe,{path:"/"});function iH(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=sLe(e),s=new dD(l,{...i}),c=a.reactive([...s.mergeData()]),d=s.reactiveStates,u=s.isLoading,f=s.hasError;s.onDataUpdate(()=>{const C=s.mergeData();c.length=0,c.push(...C)});const p=async C=>s.loadData(C);a.onMounted(()=>{n&&p()});const h=async(C,b)=>s.refreshData(C,b),m=async(C,b)=>C?s.refreshData(C,b):s.refreshAll(),g=async C=>s.refreshAll(C),v=async(C,b)=>s.refreshData(C,b,!0),y=C=>d[C];return r&&a.watch(typeof r=="function"?r:()=>r.value,async C=>{if(o&&o.length>0)for(const b of o)await h(b,C);else await g()},{deep:!0}),{_sourceInstance:s,sourceData:c,sourceState:d,isLoading:u,hasError:f,loadData:p,refreshData:h,reload:m,refreshAll:g,updateData:v,getState:y,mergeData:s.mergeData.bind(s),onDataUpdate:s.onDataUpdate.bind(s),clear:s.clear.bind(s),destroy:s.destroy.bind(s)}}const sLe=e=>{const t=(n,r)=>{if(!r)return n;const o=r.startsWith("/")?r.slice(1):r,i=o.includes("/")?"/":".";return String(o).split(i).reduce((l,s)=>l!=null&&s?l[s]:void 0,n)};if(e&&typeof e=="object"&&"path"in e){const n=e.fieldPath??e.resPath;return[{key:"legacy_obj_api",type:"api",api:{url:e.path,method:(e.method??"GET").toUpperCase(),params:e.params,data:e.data,headers:e.headers,transform:r=>{const o=t(r,n),i=typeof e.transformResponse=="function"?e.transformResponse(o):void 0,l=i!==void 0?i:o;return Array.isArray(l)?l:[l]}}}]}else return e},Wn=async(e,t)=>{if(Array.isArray(e)){if(!e.every(r=>r&&typeof r=="object"&&"type"in r&&(r.type==="api"||r.type==="static")))return e}else{if(e&&typeof e=="object"&&!("path"in e))return[e];if(typeof e=="string"||typeof e=="number")return[{[t]:e}]}};function Hn(e){return e&&typeof e=="object"&&"reactiveStates"in e&&"isLoading"in e&&"hasError"in e&&typeof e.loadData=="function"&&typeof e.refreshData=="function"&&typeof e.mergeData=="function"}function Ln(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function Gn(e){return async t=>{const n=typeof window<"u"&&window.gui&&window.gui.guiDebug===!0||window.guiDebug===!0,r=(e==null?void 0:e.debug)===!0;if(!n&&!r)return;t.preventDefault();const o=e==null?void 0:e.data;Ln(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Hn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class dD{constructor(t,n={}){gc(this,"_configMap",new Map);gc(this,"_stateMap",new Map);gc(this,"_options");gc(this,"_listeners",new Set);gc(this,"reactiveStates",a.reactive({}));gc(this,"isLoading",a.ref(!1));gc(this,"hasError",a.ref(!1));gc(this,"debugMode",!1);gc(this,"pickPath",(t,n)=>{if(!n)return t;const r=n.startsWith("/")?n.slice(1):n,o=r.includes("/")?"/":".";return String(r).split(o).reduce((i,l)=>i!=null&&l?i[l]:void 0,t)});this._options={autoLoad:(n==null?void 0:n.autoLoad)||!1,retryCount:0,retryDelay:1e3,onRequest:i=>i,onResponse:i=>i,onError:()=>{},mergeTransformer:n.mergeTransformer,...n},this.cleanConfig(t).forEach(i=>{this.addSource(i)}),(this._options.autoLoad||this.isOldDataSource(t)&&((t==null?void 0:t.autoQuery)===!0||(t==null?void 0:t.autoQuery)===void 0))&&this.loadData()}addSource(t){this._configMap.set(t.key,t);const n={data:t.type==="static"?t.data??null:null,status:t.type==="static"?"success":"idle",error:null,lastUpdated:t.type==="static"?new Date:null};this._stateMap.set(t.key,n),this.reactiveStates[t.key]=n,t.type==="static"&&t.data!==void 0&&t.data!==null&&Promise.resolve().then(()=>{this.notifyListeners(t.key,t.data)})}removeSource(t){const n=this._configMap.delete(t);return this._stateMap.delete(t),delete this.reactiveStates[t],n}async loadSingle(t,n){const r=this._configMap.get(t);if(!r)throw new Error(`DataSource with key "${t}" not found`);this.updateState(t,{status:"loading",error:null});try{let o;if(r.type==="static")o=r.data;else if(r.type==="api"&&r.api)o=await this.fetchWithRetry(r,n);else throw new Error(`Invalid data source configuration for key "${t}"`);return this.updateState(t,{data:o,status:"success",error:null,lastUpdated:new Date}),this.notifyListeners(t,o),o}catch(o){const i=o instanceof Error?o:new Error(String(o));throw this.updateState(t,{status:"error",error:i}),this._options.onError(i,t),i}}async fetchWithRetry(t,n,r=0){var i;const o=t.api;try{const l=qn.state["gui-ajax-config"]||{},s=typeof document<"u"&&((i=cD.get)==null?void 0:i.call(cD,"token"))||"",c=(l==null?void 0:l.token)||s,d={};if(c){const w=(l==null?void 0:l.tokenName)||"token";d[w]=c}l!=null&&l.sysCode&&(d.sysCode=l.sysCode),l!=null&&l.appType&&(d.appType=l.appType);const u={...d,...o.headers||{}},f={...o.headers||{}},p=t.key==="legacy_obj_api"?f:u;let h={url:o.url,method:o.method||"GET",headers:p};const m={...o.params,...n},g={...o.data,...n};h.method==="GET"?h.params=m:h.data=g,h=this._options.onRequest(h),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:h.url,method:h.method,params:h.params,data:h.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const v=await sa(h),y=v.data;if(y&&typeof y=="object"&&y.code===999){const w=y.errorMsg||"Request failed with code 999";return Xi&&Xi.warning(w),[]}let C=this._options.onResponse(v.data),b=!1;if(o.fieldPath?(C=this.pickPath(C,o.fieldPath),b=!0):C&&typeof C=="object"&&"data"in C&&(C=this.pickPath(C,"data"),b=!0),o.transform){const w=C;let S=o.transform(w,y);C=S!==void 0?S:w}else b&&(C=Array.isArray(C)?C:[C]);return C}catch(l){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw l}}delay(t){return new Promise(n=>setTimeout(n,t))}updateState(t,n){const r=this._stateMap.get(t);if(r){const o={...r,...n};this._stateMap.set(t,o),Object.assign(this.reactiveStates[t],o)}this.updateGlobalStatus()}updateGlobalStatus(){let t=!1,n=!1;this._stateMap.forEach(r=>{r.status==="loading"&&(t=!0),r.status==="error"&&(n=!0)}),this.isLoading&&typeof this.isLoading=="object"&&"value"in this.isLoading?this.isLoading.value=t:this.isLoading=a.ref(t),this.hasError&&typeof this.hasError=="object"&&"value"in this.hasError?this.hasError.value=n:this.hasError=a.ref(n)}notifyListeners(t,n){const r=this._stateMap.get(t);r&&this._listeners.forEach(o=>{o(t,n,r)})}normalizeMethod(t){const n=String(t??"GET").toUpperCase();return n==="POST"||n==="PUT"||n==="DELETE"?n:"GET"}isOldDataSource(t){if(!t||Array.isArray(t)||Object.getPrototypeOf(t)!==Object.prototype)return!1;const n=t.type;return!!(n!=="api"&&n!=="static")}cleanConfig(t){var n;if(this.isOldDataSource(t)){const r=t.fieldPath??t.resPath,o=t.key?((n=qn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:qn.state["gui-ajax-config"]??{},i={};o!=null&&o.tokenName&&(o!=null&&o.token)&&(i[o.tokenName]=o.token),o!=null&&o.sysCode&&(i.sysCode=o.sysCode),o!=null&&o.appType&&(i.appType=o.appType);const l={...i,...t.headers||{}};return[{key:"legacy_obj_api",type:"api",api:{url:t.path,method:this.normalizeMethod(t.method),params:t.params||t.data,data:t.data||t.params,headers:l,...r?{fieldPath:r}:{},transform:(s,c)=>{const d=typeof t.transformResponse=="function"?t.transformResponse(s,c):void 0;return d!==void 0?d:s}}}]}else return t}async loadData(t){const r=(t?Array.isArray(t)?t:[t]:Array.from(this._configMap.keys()).filter(o=>{var i;return((i=this._configMap.get(o))==null?void 0:i.type)==="api"})).map(o=>this.loadSingle(o).then(i=>({key:o,data:i,success:!0})).catch(i=>({key:o,error:i,success:!1})));return await Promise.all(r),this.mergeData()}async refreshData(t,n,r){if(!this._configMap.has(t))throw new Error(`DataSource with key "${t}" not found`);if(r){const i=n;return this.updateState(t,{data:i,status:"success",lastUpdated:new Date}),this.notifyListeners(t,i),i}const o=this._configMap.get(t);if(o.type==="api"&&o.api&&n&&typeof n=="object"&&!Array.isArray(n)){const i={...n};return"_url"in i&&(o.api.url=i._url,delete i._url),(o.api.method||"GET")==="GET"?o.api.params={...o.api.params||{},...i}:o.api.data={...o.api.data||{},...i},this._configMap.set(t,o),this.loadSingle(t)}return this.loadSingle(t,n)}async refreshAll(t){const r=Array.from(this._configMap.keys()).map(o=>{const i=t==null?void 0:t[o];return this.refreshData(o,i).then(l=>({key:o,data:l,success:!0})).catch(l=>({key:o,error:l,success:!1}))});return await Promise.all(r),this.mergeData()}getData(t){var n;return(n=this._stateMap.get(t))==null?void 0:n.data}getAllData(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n.data}),t}getState(t){return this._stateMap.get(t)}getAllStates(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n}),t}getLoadingStatus(t){var n;return((n=this._stateMap.get(t))==null?void 0:n.status)??"idle"}isSourceLoading(t){return this.getLoadingStatus(t)==="loading"}onDataUpdate(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}mergeData(t){const n=t||this._options.mergeTransformer,r=this.getAllData();if(n)return n(r);const o=Object.values(r);return o.length===1?o[0]||[]:o.flat()}clear(){this._configMap.forEach((t,n)=>{this.updateState(n,{data:null,status:"idle",error:null,lastUpdated:null})})}destroy(){this._configMap.clear(),this._stateMap.clear(),this._listeners.clear(),Object.keys(this.reactiveStates).forEach(t=>{delete this.reactiveStates[t]})}reload(t,n){if(typeof t=="string")return this.refreshData(t,n);if(t&&typeof t=="object"&&!n){const r=Array.from(this._configMap.keys());if(r.length===1)return this.refreshData(r[0],t);const o={};return r.forEach(i=>{o[i]=t}),this.refreshAll(o)}return t?this.refreshAll(t):this.refreshAll()}}var cLe={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}},dLe={exports:{}};(function(e,t){(function(n,r){e.exports=r(t5())})(Pl,function(n){function r(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(l,s){return s==="W"?l+"周":l+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(l,s){var c=100*l+s;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(dLe);/*! *****************************************************************************
56
+ `;o.innerHTML=i,n.appendChild(o),(!e||e=="body")&&(o.style.position="fixed");const l=o.querySelectorAll(".loading-dots .loadot");l[0].style.backgroundColor=am.loadingList[0],l[1].style.backgroundColor=am.loadingList[1],l[2].style.backgroundColor=am.loadingList[2],am.name&&typeof am.name=="string"&&am.name.includes("black")&&(o.style.backgroundColor="rgba(0, 0, 0, 0.6)");const s={lg:16,md:12,sm:8,xs:5},c={lg:"12px",md:"10px",sm:"8px",xs:"4px"},d=o.querySelector(".loading-dots");d.style.gap=c[t]||"10px",l.forEach(u=>{u.style.width=`${s[t]}px`,u.style.height=`${s[t]}px`}),globalThis.gui.loading=Ey})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{if(globalThis.gui.loading=Ey,!e||e=="body"){const r=Array.from(document.body.children).filter(i=>i.classList.contains("loading-next")),o=r[r.length-1];o&&o.parentNode&&o.parentNode.removeChild(o),document.body.querySelector(":scope > .loading-next")===null&&(document.body.style.overflow="");return}const n=document.querySelector(`${e} .loading-next`);n&&n.parentNode&&(n.parentNode.removeChild(n),document.body.style.overflow="")},t)})}};function lD(e,t=500,n,r){let o=null,i=!1;const l=function(...s){return new Promise((c,d)=>{if(o&&clearTimeout(o),n&&!i){try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!0}else o=setTimeout(()=>{try{const u=e.apply(this,s);r&&r(u),c(u)}catch(u){d(u)}i=!1,o=null},t)})};return l.cancel=function(){o&&clearTimeout(o),i=!1,o=null},l}function QRe(e,t,n={leading:!1,trailing:!0}){let r=null,o=0;const{leading:i,trailing:l}=n,s=function(...c){const d=Date.now();!o&&!i&&(o=d);const u=t-(d-o);u<=0&&(r&&(clearTimeout(r),r=null),o=d,e.apply(this,c)),l&&!r&&(r=setTimeout(()=>{o=i?Date.now():0,r=null,e.apply(this,c)},u))};return s.cancel=function(){r&&clearTimeout(r),r=null,o=0},s}function JRe(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function eLe(e,t=2,n=",",r=".",o="",i=""){if(Number(e)===0)return Number(e).toFixed(t).replace(/\.?0+$/,"");if(!e)return"";e=Number(e).toFixed(t).replace(/\.?0+$/,""),e+="";const l=e.split(".");let s=l[0];const c=l.length>1?r+l[1]:"",d=/(\d+)(\d{3})/;function u(f){return Object.prototype.toString.call(f)==="[object Number]"}if(n&&!u(n))for(;d.test(s);)s=s.replace(d,"$1"+n+"$2");return o+s+c+i}const tLe=(e,t)=>e.toFixed(t),nLe=e=>0 .toFixed(e)+"%",rLe=e=>{const t={key:(e==null?void 0:e.key)||"",sysCode:(e==null?void 0:e.sysCode)||"",appType:(e==null?void 0:e.appType)||"pc",tokenName:(e==null?void 0:e.tokenName)||"gt-token",token:(e==null?void 0:e.token)||""},n=e==null?void 0:e.key,r=n?`gui-ajax-config.${n}`:"gui-ajax-config";qn.commit("setState",{path:r,value:t})},aLe=e=>{const t=e?`gui-ajax-config.${e}`:"gui-ajax-config";return Pr(qn.state,t)},Id=e=>typeof e=="function"?"function":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="object"?"object":typeof e=="boolean"?"boolean":typeof e>"u"?"undefined":typeof e=="bigint"?"bigint":typeof e=="symbol"?"symbol":"null",Or=e=>!!(!e||Object.keys(e).length===0||Array.isArray(e)&&e.length===0);function oLe({exportType:e="excel",excelConfig:t,exportDataQueryParam:n,excelSheetNum:r=1,headers:o={}}){const i=(t==null?void 0:t.excelName)||"导出表格";if(e==="csv"){if(((t==null?void 0:t.sheets)??[]).some(c=>{var d;return(d=c.headers)==null?void 0:d.some(u=>u.children&&u.children.length>0)})){Xi.warning("csv 类型文件不支持导出多级表头");return}if(r>1){Xi.warning("csv 类型文件不支持多 sheet 页");return}}Ey.start("body"),sa.post("https://matrix.gtcloud.cn/preapi/data/exportExcel/general/v2",{exportType:e,excelConfig:t,exportDataQueryParam:n,excelSheetNum:r},{responseType:"blob",headers:{"Content-Type":"application/json",...o}}).then(l=>{const s=new Blob([l.data],{type:"application/vnd.ms-excel"}),c=window.URL.createObjectURL(s),d=document.createElement("a");d.href=c,d.download=`${i}.xlsx`,d.click(),window.URL.revokeObjectURL(c)}).finally(()=>{Ey.done("body")})}const Rd=e=>{if(e==null)return null;const t=Number(e);return isNaN(t)?null:t},nH=(e,t,n={})=>{if(!e||e.length===0)return{data:[],unitMap:{}};const{inferBy:r="avg"}=n,o={},i=JSON.parse(JSON.stringify(e)),l={};t.forEach(c=>{const{field:d,unit:u}=c,f=[];e.forEach(g=>{const v=Rd(g[d]);v!==null&&f.push(v)});const p=f.length===0?0:r==="max"?Math.max(...f):f.reduce((g,v)=>g+v,0)/f.length;let h=u,m=0;u==="元"?p>=1e8?(h="亿元",m=2):p>1e4&&(h="万元",m=1):u==="m²"&&(h="万m²",m=1),l[d]={unit:h,level:m}});const s={};return t.forEach(c=>{const{field:d,unit:u}=c;s[u]||(s[u]=[]),s[u].push(d)}),Object.keys(s).forEach(c=>{const d=s[c],u=Math.max(...d.map(f=>l[f].level));if(c==="元"){const f=u===2?"亿元":u===1?"万元":"元";d.forEach(p=>{l[p].unit=f,l[p].level=u})}}),i.forEach(c=>{t.forEach(d=>{const{field:u,unit:f}=d,p=l[u].unit,h=Rd(c[u]);h!==null&&(f==="元"?p==="亿元"?c[u]=Number((h/1e8).toFixed(2)):p==="万元"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h:f==="m²"&&p==="万m²"?c[u]=Number((h/1e4).toFixed(2)):c[u]=h),o[u]=p})}),{data:i,unitMap:o}},rH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o={};e.forEach(s=>{const c=s[n];c&&(o[c]=s)});const i=s=>{if(/^\d{4}$/.test(s))return String(Number(s)-1);if(/^\d{4}-\d{2}$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-Q\d$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-W\d+$/.test(s)){const[c,d]=s.split("-");return`${Number(c)-1}-${d}`}else if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[c,d,u]=s.split("-");return`${Number(c)-1}-${d}-${u}`}return null},l=JSON.parse(JSON.stringify(e));return l.forEach(s=>{const c=s[n],d=i(c),u=d?o[d]:null;r.forEach(f=>{const p=Rd(s[f]);if(!u||p===null){s[`${f}_yoy`]=null;return}const h=Rd(u[f]);if(h===null){s[`${f}_yoy`]=null;return}const m=p-h,g=h===0?null:m/Math.abs(h),v=g===null?"--":`${(g*100).toFixed(2)}%`,y=m>0?"up":m<0?"down":"flat";s[`${f}_yoy`]={value:m,rate:g,ratePercent:v,trend:y}})}),l},aH=(e,t)=>{const{timeField:n,valueFields:r}=t;if(!e||e.length===0)return[];const o=[...e].sort((l,s)=>{const c=l[n],d=s[n];return c<d?-1:c>d?1:0}),i=JSON.parse(JSON.stringify(o));return i.forEach((l,s)=>{if(s===0){r.forEach(d=>{l[`${d}_mom`]=null});return}const c=i[s-1];r.forEach(d=>{const u=Rd(l[d]),f=Rd(c[d]);if(u===null||f===null){l[`${d}_mom`]=null;return}const p=u-f,h=f===0?null:p/Math.abs(f),m=h===null?"--":`${(h*100).toFixed(2)}%`,g=p>0?"up":p<0?"down":"flat";l[`${d}_mom`]={value:p,rate:h,ratePercent:m,trend:g}})}),i},oH=(e,t)=>{const{sumFields:n,avgFields:r=[],labelField:o,labelText:i="合计"}=t;if(!e||e.length===0)return[];const l=e.filter(c=>!c._isSummary),s={_isSummary:!0};return o&&(s[o]=i),n.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=Number(d.toFixed(2))}),r.forEach(c=>{let d=0;l.forEach(u=>{const f=Rd(u[c]);f!==null&&(d+=f)}),s[c]=l.length>0?Number((d/l.length).toFixed(2)):0}),[...l,s]},gf={setKey(e){return`g:${e}`},set(e,t){window.localStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.localStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.localStorage.removeItem(gf.setKey(e))},clear(){window.localStorage.clear()}},iLe={set(e,t){window.sessionStorage.setItem(gf.setKey(e),JSON.stringify(t))},get(e){let t=window.sessionStorage.getItem(gf.setKey(e));return JSON.parse(t)},remove(e){window.sessionStorage.removeItem(gf.setKey(e))},clear(){window.sessionStorage.clear()}};/*! js-cookie v3.0.5 | MIT */function b1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var lLe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function sD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=b1({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in l)l[c]&&(s+="; "+c,l[c]!==!0&&(s+="="+l[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+s}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],l={},s=0;s<i.length;s++){var c=i[s].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(l[u]=e.read(d,u),o===u)break}catch{}}return o?l[o]:l}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",b1({},i,{expires:-1}))},withAttributes:function(o){return sD(this.converter,b1({},this.attributes,o))},withConverter:function(o){return sD(b1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var cD=sD(lLe,{path:"/"});function iH(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=sLe(e),s=new dD(l,{...i}),c=a.reactive([...s.mergeData()]),d=s.reactiveStates,u=s.isLoading,f=s.hasError;s.onDataUpdate(()=>{const C=s.mergeData();c.length=0,c.push(...C)});const p=async C=>s.loadData(C);a.onMounted(()=>{n&&p()});const h=async(C,b)=>s.refreshData(C,b),m=async(C,b)=>C?s.refreshData(C,b):s.refreshAll(),g=async C=>s.refreshAll(C),v=async(C,b)=>s.refreshData(C,b,!0),y=C=>d[C];return r&&a.watch(typeof r=="function"?r:()=>r.value,async C=>{if(o&&o.length>0)for(const b of o)await h(b,C);else await g()},{deep:!0}),{_sourceInstance:s,sourceData:c,sourceState:d,isLoading:u,hasError:f,loadData:p,refreshData:h,reload:m,refreshAll:g,updateData:v,getState:y,mergeData:s.mergeData.bind(s),onDataUpdate:s.onDataUpdate.bind(s),clear:s.clear.bind(s),destroy:s.destroy.bind(s)}}const sLe=e=>{const t=(n,r)=>{if(!r)return n;const o=r.startsWith("/")?r.slice(1):r,i=o.includes("/")?"/":".";return String(o).split(i).reduce((l,s)=>l!=null&&s?l[s]:void 0,n)};if(e&&typeof e=="object"&&"path"in e){const n=e.fieldPath??e.resPath;return[{key:"legacy_obj_api",type:"api",api:{url:e.path,method:(e.method??"GET").toUpperCase(),params:e.params,data:e.data,headers:e.headers,transform:r=>{const o=t(r,n),i=typeof e.transformResponse=="function"?e.transformResponse(o):void 0,l=i!==void 0?i:o;return Array.isArray(l)?l:[l]}}}]}else return e},Wn=async(e,t)=>{if(Array.isArray(e)){if(!e.every(r=>r&&typeof r=="object"&&"type"in r&&(r.type==="api"||r.type==="static")))return e}else{if(e&&typeof e=="object"&&!("path"in e))return[e];if(typeof e=="string"||typeof e=="number")return[{[t]:e}]}};function Hn(e){return e&&typeof e=="object"&&"reactiveStates"in e&&"isLoading"in e&&"hasError"in e&&typeof e.loadData=="function"&&typeof e.refreshData=="function"&&typeof e.mergeData=="function"}function Ln(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function Gn(e){return async t=>{const n=typeof window<"u"&&window.gui&&window.gui.guiDebug===!0||window.guiDebug===!0,r=(e==null?void 0:e.debug)===!0;if(!n&&!r)return;t.preventDefault();const o=e==null?void 0:e.data;Ln(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Hn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class dD{constructor(t,n={}){gc(this,"_configMap",new Map);gc(this,"_stateMap",new Map);gc(this,"_options");gc(this,"_listeners",new Set);gc(this,"reactiveStates",a.reactive({}));gc(this,"isLoading",a.ref(!1));gc(this,"hasError",a.ref(!1));gc(this,"debugMode",!1);gc(this,"pickPath",(t,n)=>{if(!n)return t;const r=n.startsWith("/")?n.slice(1):n,o=r.includes("/")?"/":".";return String(r).split(o).reduce((i,l)=>i!=null&&l?i[l]:void 0,t)});this._options={autoLoad:(n==null?void 0:n.autoLoad)||!1,retryCount:0,retryDelay:1e3,onRequest:i=>i,onResponse:i=>i,onError:()=>{},mergeTransformer:n.mergeTransformer,...n},this.cleanConfig(t).forEach(i=>{this.addSource(i)}),(this._options.autoLoad||this.isOldDataSource(t)&&((t==null?void 0:t.autoQuery)===!0||(t==null?void 0:t.autoQuery)===void 0))&&this.loadData()}addSource(t){this._configMap.set(t.key,t);const n={data:t.type==="static"?t.data??null:null,status:t.type==="static"?"success":"idle",error:null,lastUpdated:t.type==="static"?new Date:null};this._stateMap.set(t.key,n),this.reactiveStates[t.key]=n,t.type==="static"&&t.data!==void 0&&t.data!==null&&Promise.resolve().then(()=>{this.notifyListeners(t.key,t.data)})}removeSource(t){const n=this._configMap.delete(t);return this._stateMap.delete(t),delete this.reactiveStates[t],n}async loadSingle(t,n){const r=this._configMap.get(t);if(!r)throw new Error(`DataSource with key "${t}" not found`);this.updateState(t,{status:"loading",error:null});try{let o;if(r.type==="static")o=r.data;else if(r.type==="api"&&r.api)o=await this.fetchWithRetry(r,n);else throw new Error(`Invalid data source configuration for key "${t}"`);return this.updateState(t,{data:o,status:"success",error:null,lastUpdated:new Date}),this.notifyListeners(t,o),o}catch(o){const i=o instanceof Error?o:new Error(String(o));throw this.updateState(t,{status:"error",error:i}),this._options.onError(i,t),i}}async fetchWithRetry(t,n,r=0){var i;const o=t.api;try{const l=qn.state["gui-ajax-config"]||{},s=typeof document<"u"&&((i=cD.get)==null?void 0:i.call(cD,"token"))||"",c=(l==null?void 0:l.token)||s,d={};if(c){const w=(l==null?void 0:l.tokenName)||"token";d[w]=c}l!=null&&l.sysCode&&(d.sysCode=l.sysCode),l!=null&&l.appType&&(d.appType=l.appType);const u={...d,...o.headers||{}},f={...o.headers||{}},p=t.key==="legacy_obj_api"?f:u;let h={url:o.url,method:o.method||"GET",headers:p};const m={...o.params,...n},g={...o.data,...n};h.method==="GET"?h.params=m:h.data=g,h=this._options.onRequest(h),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:h.url,method:h.method,params:h.params,data:h.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const v=await sa(h),y=v.data;if(y&&typeof y=="object"&&y.code===999){const w=y.errorMsg||"Request failed with code 999";return Xi&&Xi.warning(w),[]}let C=this._options.onResponse(v.data),b=!1;if(o.fieldPath?(C=this.pickPath(C,o.fieldPath),b=!0):C&&typeof C=="object"&&"data"in C&&(C=this.pickPath(C,"data"),b=!0),o.transform){const w=C;let S=o.transform(w,y);C=S!==void 0?S:w}else b&&(C=Array.isArray(C)?C:[C]);return C}catch(l){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw l}}delay(t){return new Promise(n=>setTimeout(n,t))}updateState(t,n){const r=this._stateMap.get(t);if(r){const o={...r,...n};this._stateMap.set(t,o),Object.assign(this.reactiveStates[t],o)}this.updateGlobalStatus()}updateGlobalStatus(){let t=!1,n=!1;this._stateMap.forEach(r=>{r.status==="loading"&&(t=!0),r.status==="error"&&(n=!0)}),this.isLoading&&typeof this.isLoading=="object"&&"value"in this.isLoading?this.isLoading.value=t:this.isLoading=a.ref(t),this.hasError&&typeof this.hasError=="object"&&"value"in this.hasError?this.hasError.value=n:this.hasError=a.ref(n)}notifyListeners(t,n){const r=this._stateMap.get(t);r&&this._listeners.forEach(o=>{o(t,n,r)})}normalizeMethod(t){const n=String(t??"GET").toUpperCase();return n==="POST"||n==="PUT"||n==="DELETE"?n:"GET"}isOldDataSource(t){if(!t||Array.isArray(t)||Object.getPrototypeOf(t)!==Object.prototype)return!1;const n=t.type;return!!(n!=="api"&&n!=="static")}cleanConfig(t){var n;if(this.isOldDataSource(t)){const r=t.fieldPath??t.resPath,o=t.key?((n=qn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:qn.state["gui-ajax-config"]??{},i={};o!=null&&o.tokenName&&(o!=null&&o.token)&&(i[o.tokenName]=o.token),o!=null&&o.sysCode&&(i.sysCode=o.sysCode),o!=null&&o.appType&&(i.appType=o.appType);const l={...i,...t.headers||{}};return[{key:"legacy_obj_api",type:"api",api:{url:t.path,method:this.normalizeMethod(t.method),params:t.params||t.data,data:t.data||t.params,headers:l,...r?{fieldPath:r}:{},transform:(s,c)=>{const d=typeof t.transformResponse=="function"?t.transformResponse(s,c):void 0;return d!==void 0?d:s}}}]}else return t}async loadData(t){const r=(t?Array.isArray(t)?t:[t]:Array.from(this._configMap.keys()).filter(o=>{var i;return((i=this._configMap.get(o))==null?void 0:i.type)==="api"})).map(o=>this.loadSingle(o).then(i=>({key:o,data:i,success:!0})).catch(i=>({key:o,error:i,success:!1})));return await Promise.all(r),this.mergeData()}async refreshData(t,n,r){if(!this._configMap.has(t))throw new Error(`DataSource with key "${t}" not found`);if(r){const i=n;return this.updateState(t,{data:i,status:"success",lastUpdated:new Date}),this.notifyListeners(t,i),i}const o=this._configMap.get(t);if(o.type==="api"&&o.api&&n&&typeof n=="object"&&!Array.isArray(n)){const i={...n};return"_url"in i&&(o.api.url=i._url,delete i._url),(o.api.method||"GET")==="GET"?o.api.params={...o.api.params||{},...i}:o.api.data={...o.api.data||{},...i},this._configMap.set(t,o),this.loadSingle(t)}return this.loadSingle(t,n)}async refreshAll(t){const r=Array.from(this._configMap.keys()).map(o=>{const i=t==null?void 0:t[o];return this.refreshData(o,i).then(l=>({key:o,data:l,success:!0})).catch(l=>({key:o,error:l,success:!1}))});return await Promise.all(r),this.mergeData()}getData(t){var n;return(n=this._stateMap.get(t))==null?void 0:n.data}getAllData(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n.data}),t}getState(t){return this._stateMap.get(t)}getAllStates(){const t={};return this._stateMap.forEach((n,r)=>{t[r]=n}),t}getLoadingStatus(t){var n;return((n=this._stateMap.get(t))==null?void 0:n.status)??"idle"}isSourceLoading(t){return this.getLoadingStatus(t)==="loading"}onDataUpdate(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}mergeData(t){const n=t||this._options.mergeTransformer,r=this.getAllData();if(n)return n(r);const o=Object.values(r);return o.length===1?o[0]||[]:o.flat()}clear(){this._configMap.forEach((t,n)=>{this.updateState(n,{data:null,status:"idle",error:null,lastUpdated:null})})}destroy(){this._configMap.clear(),this._stateMap.clear(),this._listeners.clear(),Object.keys(this.reactiveStates).forEach(t=>{delete this.reactiveStates[t]})}reload(t,n){if(typeof t=="string")return this.refreshData(t,n);if(t&&typeof t=="object"&&!n){const r=Array.from(this._configMap.keys());if(r.length===1)return this.refreshData(r[0],t);const o={};return r.forEach(i=>{o[i]=t}),this.refreshAll(o)}return t?this.refreshAll(t):this.refreshAll()}}var cLe={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}},dLe={exports:{}};(function(e,t){(function(n,r){e.exports=r(t5())})(Pl,function(n){function r(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var o=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(l,s){return s==="W"?l+"周":l+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(l,s){var c=100*l+s;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return o.default.locale(i,null,!0),i})})(dLe);/*! *****************************************************************************
57
57
  Copyright (c) Microsoft Corporation.
58
58
 
59
59
  Permission to use, copy, modify, and/or distribute this software for any
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "g-ui-web",
3
3
  "private": false,
4
4
  "description": "可视化组件库",
5
- "version": "1.4.71",
5
+ "version": "1.4.72",
6
6
  "author": "wyu",
7
7
  "license": "MIT",
8
8
  "type": "module",