@skyfox2000/webui 1.6.11 → 1.6.13

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.
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as ue, ref as R, computed as I, watch as $, resolveDirective as de, openBlock as d, createElementBlock as m, normalizeClass as z, unref as n, createElementVNode as w, withDirectives as b, createBlock as V, mergeProps as G, withCtx as v, createVNode as p, createTextVNode as E, toDisplayString as U, createCommentVNode as y, Fragment as pe, renderList as me } from "vue";
2
- import { _ as H } from "./index-CHodwCV7.js";
3
- import { a as B, _ as K } from "./toolIcon-UCvhWJXc.js";
2
+ import { _ as H } from "./index-CEBo0bZK.js";
3
+ import { a as B, _ as K } from "./toolIcon-CUIeCTuV.js";
4
4
  import { httpPost as N, ResStatus as j } from "@skyfox2000/fapi";
5
- import { L as X, u as Y, $ as a, v as fe, _ as he } from "./upload-template-0m5syH0g.js";
5
+ import { L as X, u as Y, $ as a, v as fe, _ as he } from "./upload-template-Bl7C0exv.js";
6
6
  import F from "vue-m-message";
7
7
  import { Upload as J, Tag as we, Popconfirm as ve, Progress as xe } from "ant-design-vue";
8
- import { U as r, f as be, p as W } from "./file-upload-Cl0wcjbE.js";
8
+ import { U as r, f as be, p as W } from "./file-upload-D7C_mOmO.js";
9
9
  import { combineParams as Z } from "@skyfox2000/microbase";
10
10
  import "async-validator";
11
11
  import "dayjs";
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as V, defineAsyncComponent as J, ref as m, watch as K, onMounted as W, openBlock as p, createElementBlock as x, Fragment as z, createElementVNode as f, toDisplayString as $, unref as l, createVNode as N, createBlock as A, withKeys as v, withModifiers as w, normalizeClass as O, withCtx as L, createCommentVNode as q } from "vue";
2
2
  import "ant-design-vue";
3
- import { _ as D } from "../../assets/modules/toolIcon-UCvhWJXc.js";
3
+ import { _ as D } from "../../assets/modules/toolIcon-CUIeCTuV.js";
4
4
  import "@skyfox2000/fapi";
5
- import { $ as b } from "../../assets/modules/upload-template-0m5syH0g.js";
5
+ import { $ as b } from "../../assets/modules/upload-template-Bl7C0exv.js";
6
6
  import "vue-m-message";
7
- import { _ as Q } from "../../assets/modules/index-egH3AWrg.js";
7
+ import { _ as Q } from "../../assets/modules/index-CWI8upr0.js";
8
8
  import "@skyfox2000/microbase";
9
9
  import "async-validator";
10
10
  import "dayjs";
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, ref as d, watch as _, onMounted as v, resolveComponent as h, openBlock as o, createBlock as t, withCtx as s, createElementVNode as C, normalizeClass as x, createVNode as w, KeepAlive as y, unref as n, resolveDynamicComponent as I } from "vue";
2
- import { _ as g } from "../../assets/modules/baseLayout-Z_8I5P3r.js";
3
- import { an as A, a as S } from "../../assets/modules/upload-template-0m5syH0g.js";
2
+ import { _ as g } from "../../assets/modules/baseLayout-p7VibDY4.js";
3
+ import { an as A, a as S } from "../../assets/modules/upload-template-Bl7C0exv.js";
4
4
  import "@skyfox2000/microbase";
5
5
  import "@skyfox2000/fapi";
6
6
  import b from "vue-m-message";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, openBlock as n, createBlock as p, unref as r, withCtx as e, createVNode as m, createTextVNode as c, toDisplayString as a } from "vue";
2
- import { r as s } from "../../assets/modules/upload-template-0m5syH0g.js";
2
+ import { r as s } from "../../assets/modules/upload-template-Bl7C0exv.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, openBlock as n, createBlock as p, unref as e, withCtx as r, createVNode as m, createTextVNode as a, toDisplayString as c } from "vue";
2
- import { r as u } from "../../assets/modules/upload-template-0m5syH0g.js";
2
+ import { r as u } from "../../assets/modules/upload-template-Bl7C0exv.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as be, ref as p, computed as S, watch as H, onMounted as he, openBlock as f, createBlock as Q, unref as r, withCtx as D, renderSlot as W, createElementBlock as g, createVNode as _, createTextVNode as Z, toDisplayString as E, createCommentVNode as B, createElementVNode as b, normalizeClass as Fe, Fragment as ie, renderList as ne } from "vue";
2
- import { _ as J } from "../../assets/modules/index-CHodwCV7.js";
2
+ import { _ as J } from "../../assets/modules/index-CEBo0bZK.js";
3
3
  import { Modal as Ce, Upload as ce, Space as Ue } from "ant-design-vue";
4
4
  import { httpGet as _e, ResStatus as de } from "@skyfox2000/fapi";
5
- import { $ as a, H as Ee, Z as Te, S as Re } from "../../assets/modules/upload-template-0m5syH0g.js";
5
+ import { $ as a, H as Ee, Z as Te, S as Re } from "../../assets/modules/upload-template-Bl7C0exv.js";
6
6
  import m from "vue-m-message";
7
- import { c as pe, _ as Y, a as Se, p as De, i as ke } from "../../assets/modules/index-BPYPV4jB.js";
8
- import { A as Pe, p as Le, U as ue } from "../../assets/modules/file-upload-Cl0wcjbE.js";
7
+ import { c as pe, _ as Y, a as Se, p as De, i as ke } from "../../assets/modules/index-BQN_a3GE.js";
8
+ import { A as Pe, p as Le, U as ue } from "../../assets/modules/file-upload-D7C_mOmO.js";
9
9
  import "@skyfox2000/microbase";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, ref as d, watch as _, onMounted as v, resolveComponent as h, openBlock as o, createBlock as t, withCtx as s, createElementVNode as C, normalizeClass as x, createVNode as w, KeepAlive as I, unref as n, resolveDynamicComponent as g } from "vue";
2
- import { _ as y } from "../../assets/modules/baseLayout-Z_8I5P3r.js";
3
- import { an as A, a as S } from "../../assets/modules/upload-template-0m5syH0g.js";
2
+ import { _ as y } from "../../assets/modules/baseLayout-p7VibDY4.js";
3
+ import { an as A, a as S } from "../../assets/modules/upload-template-Bl7C0exv.js";
4
4
  import "@skyfox2000/microbase";
5
5
  import "@skyfox2000/fapi";
6
6
  import k from "vue-m-message";
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as T, ref as l, watch as x, onMounted as F, openBlock as C, createBlock as q, unref as u, withCtx as d, createVNode as f, createTextVNode as L, toDisplayString as b } from "vue";
2
- import { _ as g } from "../../assets/modules/index-CHodwCV7.js";
2
+ import { _ as g } from "../../assets/modules/index-CEBo0bZK.js";
3
3
  import { Modal as D, Space as z } from "ant-design-vue";
4
4
  import { httpPost as N, ResStatus as O } from "@skyfox2000/fapi";
5
- import { am as n, $ as w } from "../../assets/modules/upload-template-0m5syH0g.js";
5
+ import { am as n, $ as w } from "../../assets/modules/upload-template-Bl7C0exv.js";
6
6
  import "vue-m-message";
7
- import { U as M } from "../../assets/modules/file-upload-Cl0wcjbE.js";
7
+ import { U as M } from "../../assets/modules/file-upload-D7C_mOmO.js";
8
8
  import "@skyfox2000/microbase";
9
9
  import "async-validator";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
12
- import { U as $ } from "../../assets/modules/uploadList-LIJgk4DF.js";
12
+ import { U as $ } from "../../assets/modules/uploadList-DIvGI7qL.js";
13
13
  const H = /* @__PURE__ */ T({
14
14
  __name: "templateFile",
15
15
  props: {
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as F, ref as s, watch as y, onMounted as z, openBlock as D, createBlock as _, unref as u, withCtx as p, createVNode as m, mergeProps as L, createTextVNode as w, toDisplayString as C } from "vue";
2
- import { _ as g } from "../../assets/modules/index-CHodwCV7.js";
2
+ import { _ as g } from "../../assets/modules/index-CEBo0bZK.js";
3
3
  import { Modal as k, Space as N } from "ant-design-vue";
4
4
  import { ResStatus as T } from "@skyfox2000/fapi";
5
- import { $ as v, a2 as $ } from "../../assets/modules/upload-template-0m5syH0g.js";
5
+ import { $ as v, a2 as $ } from "../../assets/modules/upload-template-Bl7C0exv.js";
6
6
  import A from "vue-m-message";
7
7
  import "@skyfox2000/microbase";
8
8
  import "async-validator";
9
9
  import "dayjs";
10
- import { A as E } from "../../assets/modules/file-upload-Cl0wcjbE.js";
10
+ import { A as E } from "../../assets/modules/file-upload-D7C_mOmO.js";
11
11
  import "vue-draggable-next";
12
- import { U as B } from "../../assets/modules/uploadList-LIJgk4DF.js";
12
+ import { U as B } from "../../assets/modules/uploadList-DIvGI7qL.js";
13
13
  const W = /* @__PURE__ */ F({
14
14
  __name: "uploadForm",
15
15
  props: {
@@ -1,4 +1,4 @@
1
1
  import { ButtonTool } from '../typings/tools';
2
- import { Ref } from 'vue';
2
+ import { Ref, ComputedRef } from 'vue';
3
3
  export declare const uploadTempOpener: Ref<boolean, boolean>;
4
- export declare const uploadTempBtn: ButtonTool;
4
+ export declare const uploadTempBtn: ComputedRef<ButtonTool>;
package/lib/webui.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import { u as Ae, i as ve, a as ze, $ as y, L as $t, c as Dt, P as oe, o as Qe, b as Ft, d as Pt, e as Je, g as Xe, r as fe, f as Ze, h as et, j as tt, k as It, l as be, m as at, _ as lt, n as rt, O as Oe, p as Et, q as ot, s as Lt, t as Ut, v as te, w as Mt, x as Nt, y as Rt, z as Bt, A as At, B as zt, C as se, D as Ot, E as de, F as Kt, G as jt, H as st, M as Vt } from "./assets/modules/upload-template-0m5syH0g.js";
2
- import { I as Vr, J as Yr, K as Gr, N as Wr, Q as Hr, R as qr, S as Qr, T as Jr, U as Xr, V as Zr, W as eo, X as to, Y as ao, Z as lo, a0 as ro, a1 as oo, a2 as so, a3 as no, a4 as io, a5 as co, a6 as uo, a7 as po, a8 as fo, a9 as vo, aa as mo, ab as go, ac as ho, ad as bo, ae as xo, af as yo, ag as wo, ah as ko, ai as _o, aj as Co, ak as So, al as To, am as $o, an as Do, ao as Fo, ap as Po, aq as Io, ar as Eo, as as Lo, at as Uo, au as Mo } from "./assets/modules/upload-template-0m5syH0g.js";
3
- import { f as Yt, p as Ye } from "./assets/modules/file-upload-Cl0wcjbE.js";
4
- import { A as Ro, U as Bo } from "./assets/modules/file-upload-Cl0wcjbE.js";
1
+ import { u as Ae, i as ve, a as ze, $ as y, L as $t, c as Dt, P as oe, o as Qe, b as Ft, d as Pt, e as Je, g as Xe, r as fe, f as Ze, h as et, j as tt, k as It, l as be, m as at, _ as lt, n as rt, O as Oe, p as Et, q as ot, s as Lt, t as Ut, v as te, w as Mt, x as Nt, y as Rt, z as Bt, A as At, B as zt, C as se, D as Ot, E as de, F as Kt, G as jt, H as st, M as Vt } from "./assets/modules/upload-template-Bl7C0exv.js";
2
+ import { I as Vr, J as Yr, K as Gr, N as Wr, Q as Hr, R as qr, S as Qr, T as Jr, U as Xr, V as Zr, W as eo, X as to, Y as ao, Z as lo, a0 as ro, a1 as oo, a2 as so, a3 as no, a4 as io, a5 as co, a6 as uo, a7 as po, a8 as fo, a9 as vo, aa as mo, ab as go, ac as ho, ad as bo, ae as xo, af as yo, ag as wo, ah as ko, ai as _o, aj as Co, ak as So, al as To, am as $o, an as Do, ao as Fo, ap as Po, aq as Io, ar as Eo, as as Lo, at as Uo, au as Mo } from "./assets/modules/upload-template-Bl7C0exv.js";
3
+ import { f as Yt, p as Ye } from "./assets/modules/file-upload-D7C_mOmO.js";
4
+ import { A as Ro, U as Bo } from "./assets/modules/file-upload-D7C_mOmO.js";
5
5
  import { EnvConfig as Ee, isMicroApp as Gt } from "@skyfox2000/microbase";
6
6
  import { FrontCache as he, httpPost as Ke, ResStatus as je, SERVER_HOST as Wt, fieldMapping as xe } from "@skyfox2000/fapi";
7
7
  import ae from "vue-m-message";
@@ -10,15 +10,15 @@ import "async-validator";
10
10
  import Re from "dayjs";
11
11
  import { Popover as Jt, theme as ct, Drawer as Xt, Space as pe, Form as ut, message as Zt, FormItem as dt, ConfigProvider as we, Popconfirm as pt, DropdownButton as ft, Menu as Te, MenuItem as $e, Dropdown as Be, Checkbox as ea, List as ta, ListItem as aa, Card as la, Button as vt, Table as mt, Tree as ra, Cascader as oa, DatePicker as sa, Input as me, InputPassword as na, InputNumber as ia, RangePicker as ca, Textarea as ua, TimePicker as da, Transfer as pa, TreeSelect as fa, Upload as va, Image as ma, LayoutContent as ga } from "ant-design-vue";
12
12
  import { VueDraggableNext as ha } from "vue-draggable-next";
13
- import { d as ba } from "./assets/modules/uploadList-LIJgk4DF.js";
14
- import { C as zo, U as Oo, a as Ko, p as jo } from "./assets/modules/uploadList-LIJgk4DF.js";
15
- import { c as gt } from "./assets/modules/index-BPYPV4jB.js";
16
- import { _ as Yo, a as Go, b as Wo, d as Ho, e as qo, f as Qo, g as Jo, h as Xo, n as Zo, p as es, t as ts, v as as } from "./assets/modules/index-BPYPV4jB.js";
17
- import { _ as ee } from "./assets/modules/index-CHodwCV7.js";
18
- import { _ as Y } from "./assets/modules/toolIcon-UCvhWJXc.js";
19
- import { a as rs } from "./assets/modules/toolIcon-UCvhWJXc.js";
20
- import { _ as ss, a as ns, b as is, c as cs, d as us, I as ds, e as ps, f as fs, g as vs } from "./assets/modules/menuTabs-DI8dZ2Gm.js";
21
- import { _ as gs } from "./assets/modules/index-egH3AWrg.js";
13
+ import { d as ba } from "./assets/modules/uploadList-DIvGI7qL.js";
14
+ import { C as zo, U as Oo, a as Ko, p as jo } from "./assets/modules/uploadList-DIvGI7qL.js";
15
+ import { c as gt } from "./assets/modules/index-BQN_a3GE.js";
16
+ import { _ as Yo, a as Go, b as Wo, d as Ho, e as qo, f as Qo, g as Jo, h as Xo, n as Zo, p as es, t as ts, v as as } from "./assets/modules/index-BQN_a3GE.js";
17
+ import { _ as ee } from "./assets/modules/index-CEBo0bZK.js";
18
+ import { _ as Y } from "./assets/modules/toolIcon-CUIeCTuV.js";
19
+ import { a as rs } from "./assets/modules/toolIcon-CUIeCTuV.js";
20
+ import { _ as ss, a as ns, b as is, c as cs, d as us, I as ds, e as ps, f as fs, g as vs } from "./assets/modules/menuTabs-RYgm30Xy.js";
21
+ import { _ as gs } from "./assets/modules/index-CWI8upr0.js";
22
22
  import { _ as ce } from "./assets/modules/_plugin-vue_export-helper-CHgC5LLL.js";
23
23
  const We = (r, a, e, t = "remove") => {
24
24
  if (!e)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.6.11",
3
+ "version": "1.6.13",
4
4
  "description": "后台前端通用组件定义, 支持国际化",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -106,36 +106,7 @@ async function loadLocaleFromCloud(locale: string): Promise<LocaleMessages> {
106
106
  }
107
107
  }
108
108
 
109
- /**
110
- * 从localStorage获取缓存的语言包
111
- */
112
- function getCachedLocale(locale: string): LocaleMessages | null {
113
- try {
114
- const cached = localStorage.getItem(`locale_cache_${locale}`);
115
- if (cached) {
116
- const data = JSON.parse(cached);
117
- return data.messages;
118
- }
119
- } catch (error) {
120
- console.error(`Error reading cached locale ${locale}:`, error);
121
- }
122
- return null;
123
- }
124
109
 
125
- /**
126
- * 缓存语言包到localStorage
127
- */
128
- function cacheLocale(locale: string, messages: LocaleMessages): void {
129
- try {
130
- const data = {
131
- messages,
132
- timestamp: Date.now()
133
- };
134
- localStorage.setItem(`locale_cache_${locale}`, JSON.stringify(data));
135
- } catch (error) {
136
- console.error(`Error caching locale ${locale}:`, error);
137
- }
138
- }
139
110
 
140
111
  /**
141
112
  * 获取所有可用语言代码
@@ -242,42 +213,31 @@ function deepClone<T>(obj: T): T {
242
213
  }
243
214
 
244
215
  /**
245
- * 加载语言包 - 使用缓存优先策略
246
- * 实现合并逻辑:defaultLocale作为基础,缓存和云端进行合并
247
- * 确保异步加载完成后再继续执行
216
+ * 加载语言包 - 内置翻译 + 云端合并
217
+ * 内置翻译始终最新,云端翻译用于扩展覆盖
248
218
  */
249
219
  async function loadLocale(locale: string): Promise<void> {
250
- // 1. 首先加载对应语言的内置翻译作为基础
220
+ // 1. 加载内置翻译作为基础
251
221
  const builtInLocale = builtInLocales[locale] || builtInLocales["zh-CN"];
252
222
  const baseMessages = deepClone(builtInLocale);
253
223
 
254
- // 2. 获取本地缓存(如果有)
255
- const cachedMessages = getCachedLocale(locale);
256
-
257
- // 3. 同步加载云端语言包(必须等待完成)
224
+ // 2. 加载云端翻译(用户自定义扩展)
258
225
  let cloudMessages: LocaleMessages = {};
259
226
  try {
260
227
  cloudMessages = await loadLocaleFromCloud(locale);
261
228
  } catch (error) {
262
- // 加载失败时使用空对象,不报错
229
+ // 加载失败时使用空对象
263
230
  }
264
231
 
265
- // 4. 合并策略:defaultLocale + 缓存 + 云端
266
- // 优先级:云端 > 缓存 > defaultLocale
232
+ // 3. 合并:内置 + 云端,云端优先级高
267
233
  let finalMessages = baseMessages;
268
-
269
- if (cachedMessages && Object.keys(cachedMessages).length > 0) {
270
- finalMessages = deepMerge(finalMessages, cachedMessages);
271
- }
272
-
273
234
  if (cloudMessages && Object.keys(cloudMessages).length > 0) {
274
235
  finalMessages = deepMerge(finalMessages, cloudMessages);
275
236
  }
276
237
 
277
- // 5. 设置到内存和缓存
238
+ // 4. 设置到内存
278
239
  loadedMessages[locale] = finalMessages;
279
240
  i18n.global.setLocaleMessage(locale, finalMessages);
280
- cacheLocale(locale, finalMessages);
281
241
  }
282
242
  /**
283
243
  * 初始化语言 - 使用缓存优先+异步后台加载策略
@@ -1,11 +1,11 @@
1
1
  import { ButtonTool } from '@/typings/tools';
2
- import { ref } from 'vue';
2
+ import { ref, computed } from 'vue';
3
3
  import { $t } from '@/locales';
4
4
 
5
5
  export const uploadTempOpener = ref<boolean>(false);
6
6
 
7
- // 添加上传模板按钮
8
- export const uploadTempBtn: ButtonTool = {
7
+ // 添加上传模板按钮 - 使用 computed 动态获取翻译
8
+ export const uploadTempBtn = computed<ButtonTool>(() => ({
9
9
  label: $t('webui.utils.tools.templateManagement'),
10
10
  key: 'uploadTemp',
11
11
  type: 'primary',
@@ -13,4 +13,4 @@ export const uploadTempBtn: ButtonTool = {
13
13
  click: () => {
14
14
  uploadTempOpener.value = true;
15
15
  },
16
- };
16
+ }));