g-ui-web 1.3.60 → 1.3.61
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 +1 -1
- package/lib/g-ui-web.iife.js +1 -1
- package/lib/g-ui-web.iife.js.gz +0 -0
- package/lib/g-ui-web.js +2 -2
- package/lib/g-ui-web.js.gz +0 -0
- package/lib/g-ui-web.umd.cjs +1 -1
- package/package.json +1 -1
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=hM})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=hM,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};/*! js-cookie v3.0.5 | MIT */function ZC(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 SPe={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 vM(e,t){function n(o,i,l){if(!(typeof document>"u")){l=ZC({},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 u in l)l[u]&&(s+="; "+u,l[u]!==!0&&(s+="="+l[u].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 u=i[s].split("="),c=u.slice(1).join("=");try{var d=decodeURIComponent(u[0]);if(l[d]=e.read(c,d),o===d)break}catch{}}return o?l[o]:l}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",ZC({},i,{expires:-1}))},withAttributes:function(o){return vM(this.converter,ZC({},this.attributes,o))},withConverter:function(o){return vM(ZC({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var G_=vM(SPe,{path:"/"});function GX(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=xPe(e),s=new II(l,{...i,immediate:!1}),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 xPe=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},Kn=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 jn(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 Xn(e){return async t=>{const n=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] 数据重新加载完成")):jn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class II{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={immediate:!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.immediate||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){var i;const o=t.api;try{const l=typeof document<"u"&&((i=G_.get)==null?void 0:i.call(G_,"token"))||"";let s={url:o.url,method:o.method||"GET",headers:{...o.headers||{},token:l}};const u={...o.params,...n},c={...o.data,...n};s.method==="GET"?s.params=u:s.data=c,s=this._options.onRequest(s),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:s.url,method:s.method,params:s.params,data:s.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const d=await ha(s),f=d.data;if(f&&typeof f=="object"&&f.code===999){const h=f.errorMsg||"Request failed with code 999";return eu&&eu.warning(h),[]}let p=this._options.onResponse(d.data);return o.fieldPath&&(p=this.pickPath(p,o.fieldPath)),o.transform?p=o.transform(p):o.fieldPath&&(p=Array.isArray(p)?p:[p]),p}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.value=t,this.hasError.value=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){if(t&&typeof t=="object"&&"path"in t){const n=t.fieldPath??t.resPath;return[{key:t.key??"legacy_obj_api",type:"api",api:{url:t.path,method:this.normalizeMethod(t.method),params:t.params,data:t.data,headers:t.headers,...n?{fieldPath:n}:{},transform:t.transformResponse}}]}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){return t?this.refreshData(t,n):this.refreshAll()}}var kPe={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=hM})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=hM,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};/*! js-cookie v3.0.5 | MIT */function ZC(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 SPe={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 vM(e,t){function n(o,i,l){if(!(typeof document>"u")){l=ZC({},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 u in l)l[u]&&(s+="; "+u,l[u]!==!0&&(s+="="+l[u].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 u=i[s].split("="),c=u.slice(1).join("=");try{var d=decodeURIComponent(u[0]);if(l[d]=e.read(c,d),o===d)break}catch{}}return o?l[o]:l}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",ZC({},i,{expires:-1}))},withAttributes:function(o){return vM(this.converter,ZC({},this.attributes,o))},withConverter:function(o){return vM(ZC({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var G_=vM(SPe,{path:"/"});function GX(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=xPe(e),s=new II(l,{...i,immediate:!1}),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 xPe=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},Kn=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 jn(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 Xn(e){return async t=>{const n=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] 数据重新加载完成")):jn(o)&&(console.log("🔍 [DataSource Debug] 右键触发调试,重新加载数据..."),o.debugMode=!0,o.loadData(),console.log("✅ [DataSource Debug] 数据重新加载完成"))}}class II{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={immediate:!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.immediate||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){var i;const o=t.api;try{const l=typeof document<"u"&&((i=G_.get)==null?void 0:i.call(G_,"token"))||"";let s={url:o.url,method:o.method||"GET",headers:{...o.headers||{},token:l}};const u={...o.params,...n},c={...o.data,...n};s.method==="GET"?s.params=u:s.data=c,s=this._options.onRequest(s),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:s.url,method:s.method,params:s.params,data:s.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const d=await ha(s),f=d.data;if(f&&typeof f=="object"&&f.code===999){const h=f.errorMsg||"Request failed with code 999";return eu&&eu.warning(h),[]}let p=this._options.onResponse(d.data);return o.fieldPath&&(p=this.pickPath(p,o.fieldPath)),o.transform?p=o.transform(p):o.fieldPath&&(p=Array.isArray(p)?p:[p]),p}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.value=t,this.hasError.value=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){if(t&&typeof t=="object"&&"path"in t){const n=t.fieldPath??t.resPath;return[{key:t.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:t.headers,...n?{fieldPath:n}:{},transform:t.transformResponse}}]}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){return t?this.refreshData(t,n):this.refreshAll()}}var kPe={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
|
package/lib/g-ui-web.iife.js
CHANGED
|
@@ -53,7 +53,7 @@ var okt=Object.defineProperty;var ikt=(vt,a,Jp)=>a in vt?okt(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=oD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=oD,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};/*! js-cookie v3.0.5 | MIT */function v1(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 ZRe={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 iD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=v1({},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,"",v1({},i,{expires:-1}))},withAttributes:function(o){return iD(this.converter,v1({},this.attributes,o))},withConverter:function(o){return iD(v1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var lD=iD(ZRe,{path:"/"});function Z8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=QRe(e),s=new sD(l,{...i,immediate:!1}),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 QRe=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},Kn=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 Xn(e){return async t=>{const n=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 sD{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={immediate:!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.immediate||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){var i;const o=t.api;try{const l=typeof document<"u"&&((i=lD.get)==null?void 0:i.call(lD,"token"))||"";let s={url:o.url,method:o.method||"GET",headers:{...o.headers||{},token:l}};const c={...o.params,...n},d={...o.data,...n};s.method==="GET"?s.params=c:s.data=d,s=this._options.onRequest(s),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:s.url,method:s.method,params:s.params,data:s.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const u=await sa(s),f=u.data;if(f&&typeof f=="object"&&f.code===999){const h=f.errorMsg||"Request failed with code 999";return As&&As.warning(h),[]}let p=this._options.onResponse(u.data);return o.fieldPath&&(p=this.pickPath(p,o.fieldPath)),o.transform?p=o.transform(p):o.fieldPath&&(p=Array.isArray(p)?p:[p]),p}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.value=t,this.hasError.value=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){if(t&&typeof t=="object"&&"path"in t){const n=t.fieldPath??t.resPath;return[{key:t.key??"legacy_obj_api",type:"api",api:{url:t.path,method:this.normalizeMethod(t.method),params:t.params,data:t.data,headers:t.headers,...n?{fieldPath:n}:{},transform:t.transformResponse}}]}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){return t?this.refreshData(t,n):this.refreshAll()}}var JRe={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=oD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=oD,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};/*! js-cookie v3.0.5 | MIT */function v1(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 ZRe={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 iD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=v1({},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,"",v1({},i,{expires:-1}))},withAttributes:function(o){return iD(this.converter,v1({},this.attributes,o))},withConverter:function(o){return iD(v1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var lD=iD(ZRe,{path:"/"});function Z8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=QRe(e),s=new sD(l,{...i,immediate:!1}),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 QRe=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},Kn=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 Xn(e){return async t=>{const n=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 sD{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={immediate:!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.immediate||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){var i;const o=t.api;try{const l=typeof document<"u"&&((i=lD.get)==null?void 0:i.call(lD,"token"))||"";let s={url:o.url,method:o.method||"GET",headers:{...o.headers||{},token:l}};const c={...o.params,...n},d={...o.data,...n};s.method==="GET"?s.params=c:s.data=d,s=this._options.onRequest(s),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:s.url,method:s.method,params:s.params,data:s.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const u=await sa(s),f=u.data;if(f&&typeof f=="object"&&f.code===999){const h=f.errorMsg||"Request failed with code 999";return As&&As.warning(h),[]}let p=this._options.onResponse(u.data);return o.fieldPath&&(p=this.pickPath(p,o.fieldPath)),o.transform?p=o.transform(p):o.fieldPath&&(p=Array.isArray(p)?p:[p]),p}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.value=t,this.hasError.value=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){if(t&&typeof t=="object"&&"path"in t){const n=t.fieldPath??t.resPath;return[{key:t.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:t.headers,...n?{fieldPath:n}:{},transform:t.transformResponse}}]}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){return t?this.refreshData(t,n):this.refreshAll()}}var JRe={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
|
package/lib/g-ui-web.iife.js.gz
CHANGED
|
Binary file
|
package/lib/g-ui-web.js
CHANGED
|
@@ -45394,8 +45394,8 @@ class tZ {
|
|
|
45394
45394
|
api: {
|
|
45395
45395
|
url: t.path,
|
|
45396
45396
|
method: this.normalizeMethod(t.method),
|
|
45397
|
-
params: t.params,
|
|
45398
|
-
data: t.data,
|
|
45397
|
+
params: t.params || t.data,
|
|
45398
|
+
data: t.data || t.params,
|
|
45399
45399
|
headers: t.headers,
|
|
45400
45400
|
// 将 resPath/fieldPath 转为新版的 fieldPath
|
|
45401
45401
|
...n ? { fieldPath: n } : {},
|
package/lib/g-ui-web.js.gz
CHANGED
|
Binary file
|
package/lib/g-ui-web.umd.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=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=oD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=oD,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};/*! js-cookie v3.0.5 | MIT */function v1(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 qRe={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 iD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=v1({},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,"",v1({},i,{expires:-1}))},withAttributes:function(o){return iD(this.converter,v1({},this.attributes,o))},withConverter:function(o){return iD(v1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var lD=iD(qRe,{path:"/"});function Z8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=ZRe(e),s=new sD(l,{...i,immediate:!1}),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 ZRe=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},Kn=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 Xn(e){return async t=>{const n=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 sD{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={immediate:!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.immediate||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){var i;const o=t.api;try{const l=typeof document<"u"&&((i=lD.get)==null?void 0:i.call(lD,"token"))||"";let s={url:o.url,method:o.method||"GET",headers:{...o.headers||{},token:l}};const c={...o.params,...n},d={...o.data,...n};s.method==="GET"?s.params=c:s.data=d,s=this._options.onRequest(s),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:s.url,method:s.method,params:s.params,data:s.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const u=await sa(s),f=u.data;if(f&&typeof f=="object"&&f.code===999){const h=f.errorMsg||"Request failed with code 999";return As&&As.warning(h),[]}let p=this._options.onResponse(u.data);return o.fieldPath&&(p=this.pickPath(p,o.fieldPath)),o.transform?p=o.transform(p):o.fieldPath&&(p=Array.isArray(p)?p:[p]),p}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.value=t,this.hasError.value=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){if(t&&typeof t=="object"&&"path"in t){const n=t.fieldPath??t.resPath;return[{key:t.key??"legacy_obj_api",type:"api",api:{url:t.path,method:this.normalizeMethod(t.method),params:t.params,data:t.data,headers:t.headers,...n?{fieldPath:n}:{},transform:t.transformResponse}}]}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){return t?this.refreshData(t,n):this.refreshAll()}}var QRe={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=oD})},done:function(e,t=0){a.nextTick(()=>{setTimeout(()=>{globalThis.gui.loading=oD,document.body.style.overflow="";const n=e?document.querySelector(`${e} .loading-next`):document.querySelector(".loading-next");n&&n.parentNode&&n.parentNode.removeChild(n)},t)})}};/*! js-cookie v3.0.5 | MIT */function v1(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 qRe={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 iD(e,t){function n(o,i,l){if(!(typeof document>"u")){l=v1({},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,"",v1({},i,{expires:-1}))},withAttributes:function(o){return iD(this.converter,v1({},this.attributes,o))},withConverter:function(o){return iD(v1({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var lD=iD(qRe,{path:"/"});function Z8(e,t={}){const{autoLoad:n=!0,watchParams:r,watchKeys:o,...i}=t,l=ZRe(e),s=new sD(l,{...i,immediate:!1}),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 ZRe=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},Kn=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 Xn(e){return async t=>{const n=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 sD{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={immediate:!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.immediate||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){var i;const o=t.api;try{const l=typeof document<"u"&&((i=lD.get)==null?void 0:i.call(lD,"token"))||"";let s={url:o.url,method:o.method||"GET",headers:{...o.headers||{},token:l}};const c={...o.params,...n},d={...o.data,...n};s.method==="GET"?s.params=c:s.data=d,s=this._options.onRequest(s),this.debugMode&&console.log("🔍 [DataSource Debug] Request:",{url:s.url,method:s.method,params:s.params,data:s.data,fieldPath:o.fieldPath,retryCount:r,timestamp:new Date().toISOString()});const u=await sa(s),f=u.data;if(f&&typeof f=="object"&&f.code===999){const h=f.errorMsg||"Request failed with code 999";return As&&As.warning(h),[]}let p=this._options.onResponse(u.data);return o.fieldPath&&(p=this.pickPath(p,o.fieldPath)),o.transform?p=o.transform(p):o.fieldPath&&(p=Array.isArray(p)?p:[p]),p}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.value=t,this.hasError.value=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){if(t&&typeof t=="object"&&"path"in t){const n=t.fieldPath??t.resPath;return[{key:t.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:t.headers,...n?{fieldPath:n}:{},transform:t.transformResponse}}]}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){return t?this.refreshData(t,n):this.refreshAll()}}var QRe={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
|