g-ui-web 1.4.6 → 1.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/g-ui-web.cjs CHANGED
@@ -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=fh.loadingList[0],l[1].style.backgroundColor=fh.loadingList[1],l[2].style.backgroundColor=fh.loadingList[2],fh.name&&typeof fh.name=="string"&&fh.name.includes("black")&&(o.style.backgroundColor="rgba(0, 0, 0, 0.6)");const s={lg:16,md:12,sm:8,xs:5},u={lg:"12px",md:"10px",sm:"8px",xs:"4px"},c=o.querySelector(".loading-dots");c.style.gap=u[t]||"10px",l.forEach(d=>{d.style.width=`${s[t]}px`,d.style.height=`${s[t]}px`}),globalThis.gui.loading=fM})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=fM,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 $X(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=bPe(e),s=new NI(l,{...i}),u=a.reactive([...s.mergeData()]),c=s.reactiveStates,d=s.isLoading,f=s.hasError;s.onDataUpdate(()=>{const C=s.mergeData();u.length=0,u.push(...C)});const p=async C=>s.loadData(C);a.onMounted(()=>{n&&p()});const h=async(C,b)=>s.refreshData(C,b),v=async(C,b)=>C?s.refreshData(C,b):s.refreshAll(),m=async C=>s.refreshAll(C),g=async(C,b)=>s.refreshData(C,b,!0),y=C=>c[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 m()},{deep:!0}),{_sourceInstance:s,sourceData:u,sourceState:c,isLoading:d,hasError:f,loadData:p,refreshData:h,reload:v,refreshAll:m,updateData:g,getState:y,mergeData:s.mergeData.bind(s),onDataUpdate:s.onDataUpdate.bind(s),clear:s.clear.bind(s),destroy:s.destroy.bind(s)}}const bPe=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},Xn=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 Yn(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 Vn(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function qn(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;Vn(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Yn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class NI{constructor(t,n={}){gs(this,"_configMap",new Map);gs(this,"_stateMap",new Map);gs(this,"_options");gs(this,"_listeners",new Set);gs(this,"reactiveStates",a.reactive({}));gs(this,"isLoading",a.ref(!1));gs(this,"hasError",a.ref(!1));gs(this,"debugMode",!1);gs(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||t&&typeof t=="object"&&"path"in t&&t.path)&&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){const o=t.api;try{const i=Kn.state["gui-ajax-config"]||{},l={};i!=null&&i.tokenName&&(i!=null&&i.token)&&(l[i.tokenName]=i.token),i!=null&&i.sysCode&&(l.sysCode=i.sysCode),i!=null&&i.appType&&(l.appType=i.appType);const s={...l,...o.headers||{}},u={...o.headers||{}},c=t.key==="legacy_obj_api"?u:s;let d={url:o.url,method:o.method||"GET",headers:c};const f={...o.params||{},...n||{}},p={...o.data||{},...n||{}};d.method==="GET"||(d.data=p),d.params=f,d=this._options.onRequest(d),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:d.url,method:d.method,params:d.params,data:d.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const h=await ha(d),v=h.data;if(v&&typeof v=="object"&&v.code===999){const y=v.errorMsg||"Request failed with code 999";return eu&&eu.warning(y),[]}let m=this._options.onResponse(h.data),g=!1;if(o.fieldPath?(m=this.pickPath(m,o.fieldPath),g=!0):m&&typeof m=="object"&&"data"in m&&(m=this.pickPath(m,"data"),g=!0),o.transform){const y=m;let C=o.transform(y,v);m=C!==void 0?C:y}else g&&(m=Array.isArray(m)?m:[m]);return m}catch(i){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw i}}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"}cleanConfig(t){var n;if(t&&typeof t=="object"&&"path"in t){const r=t.fieldPath??t.resPath,o=t.key?((n=Kn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:Kn.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,u)=>{const c=typeof t.transformResponse=="function"?t.transformResponse(s,u):void 0;return c!==void 0?c: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 o=n;return this.updateState(t,{data:o,status:"success",lastUpdated:new Date}),this.notifyListeners(t,o),o}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 CPe={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}"}}};/*! *****************************************************************************
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=fh.loadingList[0],l[1].style.backgroundColor=fh.loadingList[1],l[2].style.backgroundColor=fh.loadingList[2],fh.name&&typeof fh.name=="string"&&fh.name.includes("black")&&(o.style.backgroundColor="rgba(0, 0, 0, 0.6)");const s={lg:16,md:12,sm:8,xs:5},u={lg:"12px",md:"10px",sm:"8px",xs:"4px"},c=o.querySelector(".loading-dots");c.style.gap=u[t]||"10px",l.forEach(d=>{d.style.width=`${s[t]}px`,d.style.height=`${s[t]}px`}),globalThis.gui.loading=fM})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=fM,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 $X(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=bPe(e),s=new NI(l,{...i}),u=a.reactive([...s.mergeData()]),c=s.reactiveStates,d=s.isLoading,f=s.hasError;s.onDataUpdate(()=>{const C=s.mergeData();u.length=0,u.push(...C)});const p=async C=>s.loadData(C);a.onMounted(()=>{n&&p()});const h=async(C,b)=>s.refreshData(C,b),v=async(C,b)=>C?s.refreshData(C,b):s.refreshAll(),m=async C=>s.refreshAll(C),g=async(C,b)=>s.refreshData(C,b,!0),y=C=>c[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 m()},{deep:!0}),{_sourceInstance:s,sourceData:u,sourceState:c,isLoading:d,hasError:f,loadData:p,refreshData:h,reload:v,refreshAll:m,updateData:g,getState:y,mergeData:s.mergeData.bind(s),onDataUpdate:s.onDataUpdate.bind(s),clear:s.clear.bind(s),destroy:s.destroy.bind(s)}}const bPe=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},Xn=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 Yn(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 Vn(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function qn(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;Vn(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Yn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class NI{constructor(t,n={}){gs(this,"_configMap",new Map);gs(this,"_stateMap",new Map);gs(this,"_options");gs(this,"_listeners",new Set);gs(this,"reactiveStates",a.reactive({}));gs(this,"isLoading",a.ref(!1));gs(this,"hasError",a.ref(!1));gs(this,"debugMode",!1);gs(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){const o=t.api;try{const i=Kn.state["gui-ajax-config"]||{},l={};i!=null&&i.tokenName&&(i!=null&&i.token)&&(l[i.tokenName]=i.token),i!=null&&i.sysCode&&(l.sysCode=i.sysCode),i!=null&&i.appType&&(l.appType=i.appType);const s={...l,...o.headers||{}},u={...o.headers||{}},c=t.key==="legacy_obj_api"?u:s;let d={url:o.url,method:o.method||"GET",headers:c};const f={...o.params||{},...n||{}},p={...o.data||{},...n||{}};d.method==="GET"||(d.data=p),d.params=f,d=this._options.onRequest(d),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:d.url,method:d.method,params:d.params,data:d.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const h=await ha(d),v=h.data;if(v&&typeof v=="object"&&v.code===999){const y=v.errorMsg||"Request failed with code 999";return eu&&eu.warning(y),[]}let m=this._options.onResponse(h.data),g=!1;if(o.fieldPath?(m=this.pickPath(m,o.fieldPath),g=!0):m&&typeof m=="object"&&"data"in m&&(m=this.pickPath(m,"data"),g=!0),o.transform){const y=m;let C=o.transform(y,v);m=C!==void 0?C:y}else g&&(m=Array.isArray(m)?m:[m]);return m}catch(i){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw i}}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=Kn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:Kn.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,u)=>{const c=typeof t.transformResponse=="function"?t.transformResponse(s,u):void 0;return c!==void 0?c: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 o=n;return this.updateState(t,{data:o,status:"success",lastUpdated:new Date}),this.notifyListeners(t,o),o}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 CPe={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}"}}};/*! *****************************************************************************
57
57
  Copyright (c) Microsoft Corporation.
58
58
 
59
59
  Permission to use, copy, modify, and/or distribute this software for any
@@ -53,7 +53,7 @@ var tkt=Object.defineProperty;var nkt=(vt,a,Jp)=>a in vt?tkt(vt,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=rm.loadingList[0],l[1].style.backgroundColor=rm.loadingList[1],l[2].style.backgroundColor=rm.loadingList[2],rm.name&&typeof rm.name=="string"&&rm.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=aD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=aD,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 K8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=KRe(e),s=new oD(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 KRe=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},Xn=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 Wn(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 Vn(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function qn(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;Vn(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Wn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class oD{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||t&&typeof t=="object"&&"path"in t&&t.path)&&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){const o=t.api;try{const i=Kn.state["gui-ajax-config"]||{},l={};i!=null&&i.tokenName&&(i!=null&&i.token)&&(l[i.tokenName]=i.token),i!=null&&i.sysCode&&(l.sysCode=i.sysCode),i!=null&&i.appType&&(l.appType=i.appType);const s={...l,...o.headers||{}},c={...o.headers||{}},d=t.key==="legacy_obj_api"?c:s;let u={url:o.url,method:o.method||"GET",headers:d};const f={...o.params||{},...n||{}},p={...o.data||{},...n||{}};u.method==="GET"||(u.data=p),u.params=f,u=this._options.onRequest(u),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:u.url,method:u.method,params:u.params,data:u.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const h=await sa(u),m=h.data;if(m&&typeof m=="object"&&m.code===999){const y=m.errorMsg||"Request failed with code 999";return As&&As.warning(y),[]}let g=this._options.onResponse(h.data),v=!1;if(o.fieldPath?(g=this.pickPath(g,o.fieldPath),v=!0):g&&typeof g=="object"&&"data"in g&&(g=this.pickPath(g,"data"),v=!0),o.transform){const y=g;let C=o.transform(y,m);g=C!==void 0?C:y}else v&&(g=Array.isArray(g)?g:[g]);return g}catch(i){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw i}}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"}cleanConfig(t){var n;if(t&&typeof t=="object"&&"path"in t){const r=t.fieldPath??t.resPath,o=t.key?((n=Kn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:Kn.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 o=n;return this.updateState(t,{data:o,status:"success",lastUpdated:new Date}),this.notifyListeners(t,o),o}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 XRe={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}"}}};/*! *****************************************************************************
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=rm.loadingList[0],l[1].style.backgroundColor=rm.loadingList[1],l[2].style.backgroundColor=rm.loadingList[2],rm.name&&typeof rm.name=="string"&&rm.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=aD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=aD,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 K8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=KRe(e),s=new oD(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 KRe=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},Xn=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 Wn(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 Vn(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function qn(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;Vn(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Wn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class oD{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){const o=t.api;try{const i=Kn.state["gui-ajax-config"]||{},l={};i!=null&&i.tokenName&&(i!=null&&i.token)&&(l[i.tokenName]=i.token),i!=null&&i.sysCode&&(l.sysCode=i.sysCode),i!=null&&i.appType&&(l.appType=i.appType);const s={...l,...o.headers||{}},c={...o.headers||{}},d=t.key==="legacy_obj_api"?c:s;let u={url:o.url,method:o.method||"GET",headers:d};const f={...o.params||{},...n||{}},p={...o.data||{},...n||{}};u.method==="GET"||(u.data=p),u.params=f,u=this._options.onRequest(u),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:u.url,method:u.method,params:u.params,data:u.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const h=await sa(u),m=h.data;if(m&&typeof m=="object"&&m.code===999){const y=m.errorMsg||"Request failed with code 999";return As&&As.warning(y),[]}let g=this._options.onResponse(h.data),v=!1;if(o.fieldPath?(g=this.pickPath(g,o.fieldPath),v=!0):g&&typeof g=="object"&&"data"in g&&(g=this.pickPath(g,"data"),v=!0),o.transform){const y=g;let C=o.transform(y,m);g=C!==void 0?C:y}else v&&(g=Array.isArray(g)?g:[g]);return g}catch(i){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw i}}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=Kn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:Kn.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 o=n;return this.updateState(t,{data:o,status:"success",lastUpdated:new Date}),this.notifyListeners(t,o),o}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 XRe={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}"}}};/*! *****************************************************************************
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
@@ -45177,7 +45177,7 @@ class Qq {
45177
45177
  ...n
45178
45178
  }, this.cleanConfig(t).forEach((o) => {
45179
45179
  this.addSource(o);
45180
- }), (this._options.autoLoad || t && typeof t == "object" && "path" in t && t.path) && this.loadData();
45180
+ }), (this._options.autoLoad || this.isOldDataSource(t) && ((t == null ? void 0 : t.autoQuery) === !0 || (t == null ? void 0 : t.autoQuery) === void 0)) && this.loadData();
45181
45181
  }
45182
45182
  /**
45183
45183
  * 添加数据源
@@ -45312,6 +45312,11 @@ class Qq {
45312
45312
  const n = String(t ?? "GET").toUpperCase();
45313
45313
  return n === "POST" || n === "PUT" || n === "DELETE" ? n : "GET";
45314
45314
  }
45315
+ isOldDataSource(t) {
45316
+ if (!t || Array.isArray(t) || Object.getPrototypeOf(t) !== Object.prototype) return !1;
45317
+ const n = t.type;
45318
+ return !!(n !== "api" && n !== "static");
45319
+ }
45315
45320
  /**
45316
45321
  * 清理配置,将旧版格式(path + resPath)转换为新版 DataSourceConfig
45317
45322
  * - 支持新版 fieldPath
@@ -45319,7 +45324,7 @@ class Qq {
45319
45324
  */
45320
45325
  cleanConfig(t) {
45321
45326
  var n;
45322
- if (t && typeof t == "object" && "path" in t) {
45327
+ if (this.isOldDataSource(t)) {
45323
45328
  const r = t.fieldPath ?? t.resPath, a = t.key ? ((n = Ir.state["gui-ajax-config"]) == null ? void 0 : n[t.key]) ?? {} : Ir.state["gui-ajax-config"] ?? {}, o = {};
45324
45329
  a != null && a.tokenName && (a != null && a.token) && (o[a.tokenName] = a.token), a != null && a.sysCode && (o.sysCode = a.sysCode), a != null && a.appType && (o.appType = a.appType);
45325
45330
  const i = { ...o, ...t.headers || {} };
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=rm.loadingList[0],l[1].style.backgroundColor=rm.loadingList[1],l[2].style.backgroundColor=rm.loadingList[2],rm.name&&typeof rm.name=="string"&&rm.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=aD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=aD,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 K8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=jRe(e),s=new oD(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 jRe=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},Xn=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 Wn(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 Vn(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function qn(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;Vn(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Wn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class oD{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||t&&typeof t=="object"&&"path"in t&&t.path)&&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){const o=t.api;try{const i=Kn.state["gui-ajax-config"]||{},l={};i!=null&&i.tokenName&&(i!=null&&i.token)&&(l[i.tokenName]=i.token),i!=null&&i.sysCode&&(l.sysCode=i.sysCode),i!=null&&i.appType&&(l.appType=i.appType);const s={...l,...o.headers||{}},c={...o.headers||{}},d=t.key==="legacy_obj_api"?c:s;let u={url:o.url,method:o.method||"GET",headers:d};const f={...o.params||{},...n||{}},p={...o.data||{},...n||{}};u.method==="GET"||(u.data=p),u.params=f,u=this._options.onRequest(u),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:u.url,method:u.method,params:u.params,data:u.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const h=await sa(u),m=h.data;if(m&&typeof m=="object"&&m.code===999){const y=m.errorMsg||"Request failed with code 999";return As&&As.warning(y),[]}let g=this._options.onResponse(h.data),v=!1;if(o.fieldPath?(g=this.pickPath(g,o.fieldPath),v=!0):g&&typeof g=="object"&&"data"in g&&(g=this.pickPath(g,"data"),v=!0),o.transform){const y=g;let C=o.transform(y,m);g=C!==void 0?C:y}else v&&(g=Array.isArray(g)?g:[g]);return g}catch(i){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw i}}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"}cleanConfig(t){var n;if(t&&typeof t=="object"&&"path"in t){const r=t.fieldPath??t.resPath,o=t.key?((n=Kn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:Kn.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 o=n;return this.updateState(t,{data:o,status:"success",lastUpdated:new Date}),this.notifyListeners(t,o),o}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 KRe={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}"}}};/*! *****************************************************************************
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=rm.loadingList[0],l[1].style.backgroundColor=rm.loadingList[1],l[2].style.backgroundColor=rm.loadingList[2],rm.name&&typeof rm.name=="string"&&rm.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=aD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=aD,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 K8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=jRe(e),s=new oD(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 jRe=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},Xn=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 Wn(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 Vn(e){return e&&typeof e=="object"&&"sourceData"in e&&"_sourceInstance"in e&&typeof e.onDataUpdate=="function"}function qn(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;Vn(o)?(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o._sourceInstance.debugMode=!0,await o._sourceInstance.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成")):Wn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class oD{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){const o=t.api;try{const i=Kn.state["gui-ajax-config"]||{},l={};i!=null&&i.tokenName&&(i!=null&&i.token)&&(l[i.tokenName]=i.token),i!=null&&i.sysCode&&(l.sysCode=i.sysCode),i!=null&&i.appType&&(l.appType=i.appType);const s={...l,...o.headers||{}},c={...o.headers||{}},d=t.key==="legacy_obj_api"?c:s;let u={url:o.url,method:o.method||"GET",headers:d};const f={...o.params||{},...n||{}},p={...o.data||{},...n||{}};u.method==="GET"||(u.data=p),u.params=f,u=this._options.onRequest(u),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:u.url,method:u.method,params:u.params,data:u.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const h=await sa(u),m=h.data;if(m&&typeof m=="object"&&m.code===999){const y=m.errorMsg||"Request failed with code 999";return As&&As.warning(y),[]}let g=this._options.onResponse(h.data),v=!1;if(o.fieldPath?(g=this.pickPath(g,o.fieldPath),v=!0):g&&typeof g=="object"&&"data"in g&&(g=this.pickPath(g,"data"),v=!0),o.transform){const y=g;let C=o.transform(y,m);g=C!==void 0?C:y}else v&&(g=Array.isArray(g)?g:[g]);return g}catch(i){if(r<this._options.retryCount)return await this.delay(this._options.retryDelay),this.fetchWithRetry(t,n,r+1);throw i}}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=Kn.state["gui-ajax-config"])==null?void 0:n[t.key])??{}:Kn.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 o=n;return this.updateState(t,{data:o,status:"success",lastUpdated:new Date}),this.notifyListeners(t,o),o}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 KRe={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}"}}};/*! *****************************************************************************
57
57
  Copyright (c) Microsoft Corporation.
58
58
 
59
59
  Permission to use, copy, modify, and/or distribute this software for any
@@ -111,6 +111,7 @@ declare class DataSource {
111
111
  */
112
112
  private notifyListeners;
113
113
  private normalizeMethod;
114
+ private isOldDataSource;
114
115
  /**
115
116
  * 清理配置,将旧版格式(path + resPath)转换为新版 DataSourceConfig
116
117
  * - 支持新版 fieldPath
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.6",
5
+ "version": "1.4.8",
6
6
  "author": "wyu",
7
7
  "license": "MIT",
8
8
  "type": "module",