@robot-admin/layout 2.0.1 → 2.0.2

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { ref as d, computed as $, watch as F, defineComponent as oe, useModel as le, onUnmounted as ie, openBlock as R, createBlock as ae, unref as l, withCtx as n, createVNode as a, createElementVNode as t, createElementBlock as W, Fragment as J, renderList as Y, normalizeClass as G, toDisplayString as h, normalizeStyle as ne, createTextVNode as c, withModifiers as re, createCommentVNode as X, mergeModels as de } from "vue";
2
- import { useMessage as ue, useDialog as ce, NDrawer as ve, NDrawerContent as pe, NTabs as me, NTabPane as j, NRadioGroup as K, NRadioButton as M, NColorPicker as fe, NSwitch as H, NButton as O, NSlider as q, NInput as ge } from "naive-ui";
3
- import { defineStore as ye } from "pinia";
4
- const he = [
1
+ import { ref as d, computed as F, watch as $, defineComponent as oe, useModel as le, onUnmounted as ie, openBlock as R, createBlock as ae, unref as l, withCtx as n, createVNode as a, createElementVNode as t, createElementBlock as W, Fragment as K, renderList as G, normalizeClass as Y, toDisplayString as h, normalizeStyle as ne, createTextVNode as c, withModifiers as re, createCommentVNode as Z } from "vue";
2
+ import { useMessage as de, useDialog as ue, NDrawer as ce, NDrawerContent as ve, NTabs as pe, NTabPane as j, NRadioGroup as J, NRadioButton as M, NColorPicker as me, NSwitch as H, NButton as I, NSlider as q, NInput as ge } from "naive-ui";
3
+ import { defineStore as fe } from "pinia";
4
+ const ye = [
5
5
  { name: "拂晓蓝", value: "#409eff" },
6
6
  { name: "薄暮红", value: "#f5222d" },
7
7
  { name: "火山橙", value: "#fa541c" },
@@ -10,7 +10,7 @@ const he = [
10
10
  { name: "明青", value: "#13c2c2" },
11
11
  { name: "极客蓝", value: "#2f54eb" },
12
12
  { name: "酱紫", value: "#722ed1" }
13
- ], be = [
13
+ ], he = [
14
14
  {
15
15
  name: "科技蓝",
16
16
  icon: "💙",
@@ -41,7 +41,7 @@ const he = [
41
41
  icon: "❤️",
42
42
  primaryColor: "#f5222d"
43
43
  }
44
- ], Ot = [
44
+ ], Wt = [
45
45
  {
46
46
  mode: "side",
47
47
  label: "左侧菜单",
@@ -78,16 +78,16 @@ const he = [
78
78
  description: "卡片式布局风格",
79
79
  icon: "i-mdi:card-outline"
80
80
  }
81
- ], we = {
81
+ ], be = {
82
82
  small: "4px",
83
83
  medium: "6px",
84
84
  large: "8px"
85
- }, xe = {
85
+ }, we = {
86
86
  fade: "fade-transform",
87
87
  slide: "fade-slide",
88
88
  zoom: "fade-zoom",
89
89
  none: ""
90
- }, m = {
90
+ }, v = {
91
91
  // 外观
92
92
  themeMode: "light",
93
93
  primaryColor: "#409eff",
@@ -109,74 +109,74 @@ const he = [
109
109
  headerHeight: 56,
110
110
  // 高级
111
111
  enableHotkeys: !0,
112
- version: "1.0.0"
113
- }, Lt = he.map((b) => b.value);
112
+ version: "2.0.2"
113
+ }, xe = ye.map((b) => b.value);
114
114
  function Q(b, u) {
115
- const v = parseInt(b.replace("#", ""), 16), s = Math.min(255, Math.max(0, (v >> 16) + u)), w = Math.min(255, Math.max(0, (v >> 8 & 255) + u)), f = Math.min(255, Math.max(0, (v & 255) + u));
116
- return `#${(s << 16 | w << 8 | f).toString(16).padStart(6, "0")}`;
115
+ const p = parseInt(b.replace("#", ""), 16), s = Math.min(255, Math.max(0, (p >> 16) + u)), w = Math.min(255, Math.max(0, (p >> 8 & 255) + u)), g = Math.min(255, Math.max(0, (p & 255) + u));
116
+ return `#${(s << 16 | w << 8 | g).toString(16).padStart(6, "0")}`;
117
117
  }
118
- function Z(b = {}) {
119
- const { defaults: u = {}, onThemeModeChange: v } = b, s = {
120
- ...m,
118
+ function X(b = {}) {
119
+ const { defaults: u = {}, onThemeModeChange: p } = b, s = {
120
+ ...v,
121
121
  ...u
122
122
  };
123
- return ye("settings", () => {
124
- const w = d(s.themeMode), f = d(s.primaryColor), x = d(s.borderRadius), g = d(s.transitionType), y = d(s.enableTransition), k = d(s.layoutMode), p = d(s.collapsed || !1), L = d(s.fixedHeader), V = d(s.showBreadcrumb), S = d(s.showBreadcrumbIcon), I = d(s.showTagsView), E = d(s.tagsViewHeight), P = d(s.tagsViewStyle), N = d(s.showFooter), _ = d(s.sidebarWidth), B = d(
123
+ return fe("settings", () => {
124
+ const w = d(s.themeMode), g = d(s.primaryColor), x = d(s.borderRadius), f = d(s.transitionType), y = d(s.enableTransition), k = d(s.layoutMode), m = d(s.collapsed), O = d(s.fixedHeader), V = d(s.showBreadcrumb), S = d(s.showBreadcrumbIcon), P = d(s.showTagsView), B = d(s.tagsViewHeight), N = d(s.tagsViewStyle), L = d(s.showFooter), U = d(s.sidebarWidth), _ = d(
125
125
  s.sidebarCollapsedWidth
126
- ), U = d(s.headerHeight), A = d(s.enableHotkeys), z = d(s.version), D = $(
127
- () => we[x.value]
128
- ), i = $(() => xe[g.value]), e = $(
129
- () => y.value && g.value !== "none"
130
- ), o = $(() => ({
126
+ ), E = d(s.headerHeight), D = d(s.enableHotkeys), z = d(s.version), A = F(
127
+ () => be[x.value]
128
+ ), i = F(() => we[f.value]), e = F(
129
+ () => y.value && f.value !== "none"
130
+ ), o = F(() => ({
131
131
  themeMode: w.value,
132
- primaryColor: f.value,
132
+ primaryColor: g.value,
133
133
  borderRadius: x.value,
134
- transitionType: g.value,
134
+ transitionType: f.value,
135
135
  enableTransition: y.value,
136
136
  layoutMode: k.value,
137
- collapsed: p.value,
138
- fixedHeader: L.value,
137
+ collapsed: m.value,
138
+ fixedHeader: O.value,
139
139
  showBreadcrumb: V.value,
140
140
  showBreadcrumbIcon: S.value,
141
- showTagsView: I.value,
142
- tagsViewHeight: E.value,
143
- tagsViewStyle: P.value,
144
- showFooter: N.value,
145
- sidebarWidth: _.value,
146
- sidebarCollapsedWidth: B.value,
147
- headerHeight: U.value,
148
- enableHotkeys: A.value,
141
+ showTagsView: P.value,
142
+ tagsViewHeight: B.value,
143
+ tagsViewStyle: N.value,
144
+ showFooter: L.value,
145
+ sidebarWidth: U.value,
146
+ sidebarCollapsedWidth: _.value,
147
+ headerHeight: E.value,
148
+ enableHotkeys: D.value,
149
149
  version: z.value
150
150
  })), C = () => {
151
151
  if (typeof document > "u") return;
152
152
  const r = document.documentElement;
153
- r.style.setProperty("--primary-color", f.value), r.style.setProperty(
153
+ r.style.setProperty("--primary-color", g.value), r.style.setProperty(
154
154
  "--primary-color-hover",
155
- Q(f.value, 10)
155
+ Q(g.value, 10)
156
156
  ), r.style.setProperty(
157
157
  "--primary-color-pressed",
158
- Q(f.value, -10)
159
- ), r.style.setProperty("--border-radius", D.value), r.style.setProperty("--sidebar-width", `${_.value}px`), r.style.setProperty(
158
+ Q(g.value, -10)
159
+ ), r.style.setProperty("--border-radius", A.value), r.style.setProperty("--sidebar-width", `${U.value}px`), r.style.setProperty(
160
160
  "--sidebar-collapsed-width",
161
- `${B.value}px`
162
- ), r.style.setProperty("--header-height", `${U.value}px`), r.style.setProperty("--tags-view-height", `${E.value}px`);
161
+ `${_.value}px`
162
+ ), r.style.setProperty("--header-height", `${E.value}px`), r.style.setProperty("--tags-view-height", `${B.value}px`);
163
163
  }, T = async (r) => {
164
- f.value = r.primaryColor, r.settings && (r.settings.borderRadius && (x.value = r.settings.borderRadius), r.settings.transitionType && (g.value = r.settings.transitionType), r.settings.showBreadcrumb !== void 0 && (V.value = r.settings.showBreadcrumb), r.settings.showTagsView !== void 0 && (I.value = r.settings.showTagsView), r.settings.tagsViewStyle && (P.value = r.settings.tagsViewStyle));
164
+ g.value = r.primaryColor, r.settings && (r.settings.borderRadius && (x.value = r.settings.borderRadius), r.settings.transitionType && (f.value = r.settings.transitionType), r.settings.showBreadcrumb !== void 0 && (V.value = r.settings.showBreadcrumb), r.settings.showTagsView !== void 0 && (P.value = r.settings.showTagsView), r.settings.tagsViewStyle && (N.value = r.settings.tagsViewStyle));
165
165
  }, ee = () => {
166
- w.value = s.themeMode, f.value = s.primaryColor, x.value = s.borderRadius, g.value = s.transitionType, y.value = s.enableTransition, k.value = s.layoutMode, p.value = s.collapsed || !1, L.value = s.fixedHeader, V.value = s.showBreadcrumb, S.value = s.showBreadcrumbIcon, I.value = s.showTagsView, E.value = s.tagsViewHeight, P.value = s.tagsViewStyle, N.value = s.showFooter, _.value = s.sidebarWidth, B.value = s.sidebarCollapsedWidth, U.value = s.headerHeight, A.value = s.enableHotkeys;
166
+ w.value = s.themeMode, g.value = s.primaryColor, x.value = s.borderRadius, f.value = s.transitionType, y.value = s.enableTransition, k.value = s.layoutMode, m.value = s.collapsed, O.value = s.fixedHeader, V.value = s.showBreadcrumb, S.value = s.showBreadcrumbIcon, P.value = s.showTagsView, B.value = s.tagsViewHeight, N.value = s.tagsViewStyle, L.value = s.showFooter, U.value = s.sidebarWidth, _.value = s.sidebarCollapsedWidth, E.value = s.headerHeight, D.value = s.enableHotkeys;
167
167
  }, te = async (r) => {
168
- w.value = r, v && await v(r);
168
+ w.value = r, p && await p(r);
169
169
  }, se = () => {
170
- p.value = !p.value;
170
+ m.value = !m.value;
171
171
  };
172
- return F(
172
+ return $(
173
173
  [
174
- f,
175
- D,
176
- _,
177
- B,
174
+ g,
175
+ A,
178
176
  U,
179
- E
177
+ _,
178
+ E,
179
+ B
180
180
  ],
181
181
  () => {
182
182
  C();
@@ -185,26 +185,26 @@ function Z(b = {}) {
185
185
  ), {
186
186
  // 状态
187
187
  themeMode: w,
188
- primaryColor: f,
188
+ primaryColor: g,
189
189
  borderRadius: x,
190
- transitionType: g,
190
+ transitionType: f,
191
191
  enableTransition: y,
192
192
  layoutMode: k,
193
- collapsed: p,
194
- fixedHeader: L,
193
+ collapsed: m,
194
+ fixedHeader: O,
195
195
  showBreadcrumb: V,
196
196
  showBreadcrumbIcon: S,
197
- showTagsView: I,
198
- tagsViewHeight: E,
199
- tagsViewStyle: P,
200
- showFooter: N,
201
- sidebarWidth: _,
202
- sidebarCollapsedWidth: B,
203
- headerHeight: U,
204
- enableHotkeys: A,
197
+ showTagsView: P,
198
+ tagsViewHeight: B,
199
+ tagsViewStyle: N,
200
+ showFooter: L,
201
+ sidebarWidth: U,
202
+ sidebarCollapsedWidth: _,
203
+ headerHeight: E,
204
+ enableHotkeys: D,
205
205
  version: z,
206
206
  // 计算属性
207
- borderRadiusValue: D,
207
+ borderRadiusValue: A,
208
208
  transitionName: i,
209
209
  shouldEnableTransition: e,
210
210
  settingsState: o,
@@ -217,16 +217,7 @@ function Z(b = {}) {
217
217
  };
218
218
  });
219
219
  }
220
- const Ce = Z(), Te = [
221
- "#409eff",
222
- "#f5222d",
223
- "#fa541c",
224
- "#faad14",
225
- "#52c41a",
226
- "#13c2c2",
227
- "#2f54eb",
228
- "#722ed1"
229
- ], ke = [
220
+ const Ce = X(), Te = [
230
221
  {
231
222
  label: "左侧菜单(默认)",
232
223
  value: "side",
@@ -289,33 +280,31 @@ const Ce = Z(), Te = [
289
280
  <rect x="32" y="24" width="24" height="20" rx="2" fill="currentColor" fill-opacity="0.4"/>
290
281
  `
291
282
  }
292
- ], Se = { class: "settings-section" }, Me = { class: "preset-grid" }, Re = ["onClick"], He = { class: "preset-icon" }, Ve = { class: "preset-name" }, Ee = { class: "preset-color" }, _e = { class: "settings-section" }, Be = { class: "settings-section" }, Ue = { class: "color-picker-wrapper" }, We = { class: "color-value" }, Oe = { class: "settings-section" }, Le = { class: "settings-section" }, Ie = { class: "flex items-center justify-between mb-2" }, Pe = { class: "settings-section" }, Ne = { class: "settings-section" }, Ae = { class: "layout-grid" }, De = ["onClick"], $e = { class: "layout-screenshot" }, Fe = {
283
+ ], ke = { class: "settings-section" }, Se = { class: "preset-grid" }, Me = ["onClick"], Re = { class: "preset-icon" }, He = { class: "preset-name" }, Ve = { class: "preset-color" }, Be = { class: "settings-section" }, Ue = { class: "settings-section" }, _e = { class: "color-picker-wrapper" }, Ee = { class: "color-value" }, We = { class: "settings-section" }, Ie = { class: "settings-section" }, Oe = { class: "flex items-center justify-between mb-2" }, Pe = { class: "settings-section" }, Ne = { class: "settings-section" }, Le = { class: "layout-grid" }, De = ["onClick"], Ae = { class: "layout-screenshot" }, Fe = {
293
284
  class: "layout-svg",
294
285
  viewBox: "0 0 56 48",
295
286
  fill: "none",
296
287
  xmlns: "http://www.w3.org/2000/svg"
297
- }, ze = ["innerHTML"], je = { class: "layout-label" }, Ke = {
288
+ }, $e = ["innerHTML"], ze = { class: "layout-label" }, je = {
298
289
  key: 0,
299
290
  class: "badge-soon"
300
- }, Je = { class: "settings-section" }, Ye = { class: "setting-item" }, Ge = { class: "setting-item" }, Xe = { class: "setting-item" }, qe = { class: "setting-item" }, Qe = { class: "settings-section" }, Ze = { class: "slider-item" }, et = { class: "slider-label" }, tt = { class: "slider-value" }, st = { class: "slider-item" }, ot = { class: "slider-label" }, lt = { class: "slider-value" }, it = { class: "settings-section" }, at = { class: "settings-section" }, nt = { class: "action-buttons-grid" }, rt = { class: "settings-section" }, dt = { class: "action-buttons-grid" }, ut = { class: "settings-section" }, ct = { class: "setting-item" }, vt = { class: "setting-item" }, pt = { class: "settings-section" }, mt = { class: "setting-item" }, ft = {
291
+ }, Je = { class: "settings-section" }, Ke = { class: "setting-item" }, Ge = { class: "setting-item" }, Ye = { class: "setting-item" }, Ze = { class: "setting-item" }, qe = { class: "settings-section" }, Qe = { class: "slider-item" }, Xe = { class: "slider-label" }, et = { class: "slider-value" }, tt = { class: "slider-item" }, st = { class: "slider-label" }, ot = { class: "slider-value" }, lt = { class: "settings-section" }, it = { class: "settings-section" }, at = { class: "action-buttons-grid" }, nt = { class: "settings-section" }, rt = { class: "action-buttons-grid" }, dt = { class: "settings-section" }, ut = { class: "setting-item" }, ct = { class: "setting-item" }, vt = { class: "settings-section" }, pt = { class: "setting-item" }, mt = {
301
292
  key: 0,
302
293
  class: "mt-2"
303
- }, gt = { class: "settings-section" }, yt = { class: "system-info" }, ht = { class: "info-item" }, bt = { class: "info-value" }, wt = { class: "info-item" }, xt = { class: "info-value" }, Ct = { class: "info-item" }, Tt = { class: "info-value" }, kt = { class: "info-item" }, St = { class: "info-value" }, Mt = { class: "info-item" }, Rt = { class: "info-value" }, Ht = { class: "info-item" }, Vt = { class: "info-value" }, Et = /* @__PURE__ */ oe({
294
+ }, gt = { class: "settings-section" }, ft = { class: "system-info" }, yt = { class: "info-item" }, ht = { class: "info-value" }, bt = { class: "info-item" }, wt = { class: "info-value" }, xt = { class: "info-item" }, Ct = { class: "info-value" }, Tt = { class: "info-item" }, kt = { class: "info-value" }, St = { class: "info-item" }, Mt = { class: "info-value" }, Rt = { class: "info-item" }, Ht = { class: "info-value" }, Vt = /* @__PURE__ */ oe({
304
295
  __name: "index",
305
- props: /* @__PURE__ */ de({
306
- storageKey: {}
307
- }, {
296
+ props: {
308
297
  show: { type: Boolean, default: !1 },
309
298
  showModifiers: {}
310
- }),
299
+ },
311
300
  emits: ["update:show"],
312
301
  setup(b) {
313
- const u = ue(), v = ce(), s = Ce(), w = le(b, "show"), f = d("appearance"), x = d(!1), g = d(!1), y = d(!1), k = d("Robot Admin");
314
- let p = null;
315
- const L = (i) => {
316
- p && (document.body.removeChild(p), p = null);
302
+ const u = de(), p = ue(), s = Ce(), w = le(b, "show"), g = d("appearance"), x = d(!1), f = d(!1), y = d(!1), k = d("Robot Admin");
303
+ let m = null;
304
+ const O = (i) => {
305
+ m && (document.body.removeChild(m), m = null);
317
306
  const e = document.createElement("canvas"), o = e.getContext("2d");
318
- e.width = 200, e.height = 150, o.font = "14px Microsoft JhengHei", o.fillStyle = "rgba(120, 120, 120, 0.15)", o.rotate(-20 * Math.PI / 180), o.fillText(i, 0, 80), p = document.createElement("div"), p.style.cssText = `
307
+ e.width = 200, e.height = 150, o.font = "14px Microsoft JhengHei", o.fillStyle = "rgba(120, 120, 120, 0.15)", o.rotate(-20 * Math.PI / 180), o.fillText(i, 0, 80), m = document.createElement("div"), m.style.cssText = `
319
308
  position: fixed;
320
309
  top: 0;
321
310
  left: 0;
@@ -326,20 +315,20 @@ const Ce = Z(), Te = [
326
315
  background-repeat: repeat;
327
316
  z-index: 9999;
328
317
  user-select: none;
329
- `, document.body.appendChild(p);
318
+ `, document.body.appendChild(m);
330
319
  }, V = () => {
331
- p && (document.body.removeChild(p), p = null);
320
+ m && (document.body.removeChild(m), m = null);
332
321
  };
333
- F(x, (i) => {
322
+ $(x, (i) => {
334
323
  document.documentElement.classList.toggle("gray-mode", i);
335
- }), F(g, (i) => {
324
+ }), $(f, (i) => {
336
325
  document.documentElement.classList.toggle("color-weak-mode", i);
337
- }), F(y, (i) => {
338
- i ? L(k.value) : V();
339
- }), F(k, (i) => {
340
- y.value && L(i);
326
+ }), $(y, (i) => {
327
+ i ? O(k.value) : V();
328
+ }), $(k, (i) => {
329
+ y.value && O(i);
341
330
  });
342
- const S = $(() => {
331
+ const S = F(() => {
343
332
  const i = navigator.userAgent;
344
333
  let e = "Unknown", o = "Unknown";
345
334
  return i.includes("Chrome") ? e = "Chrome" : i.includes("Firefox") ? e = "Firefox" : i.includes("Safari") ? e = "Safari" : i.includes("Edge") && (e = "Edge"), i.includes("Windows") ? o = "Windows" : i.includes("Mac") ? o = "macOS" : i.includes("Linux") ? o = "Linux" : i.includes("Android") ? o = "Android" : i.includes("iOS") && (o = "iOS"), {
@@ -348,22 +337,22 @@ const Ce = Z(), Te = [
348
337
  resolution: `${window.screen.width} × ${window.screen.height}`,
349
338
  pixelRatio: window.devicePixelRatio + "x",
350
339
  language: navigator.language,
351
- timezone: "XIAn"
340
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
352
341
  };
353
342
  });
354
343
  ie(() => {
355
344
  V();
356
345
  });
357
- const I = (i, e) => {
346
+ const P = (i, e) => {
358
347
  e || (s.layoutMode = i);
359
- }, E = (i) => s.primaryColor === i.primaryColor, P = (i) => {
348
+ }, B = (i) => s.primaryColor === i.primaryColor, N = (i) => {
360
349
  s.applyPreset(i), u.success(`已应用「${i.name}」主题方案`);
361
- }, N = () => {
362
- s.themeMode = m.themeMode, s.primaryColor = m.primaryColor, s.borderRadius = m.borderRadius, s.transitionType = m.transitionType, s.enableTransition = m.enableTransition, u.success("已恢复外观默认设置");
350
+ }, L = () => {
351
+ s.themeMode = v.themeMode, s.primaryColor = v.primaryColor, s.borderRadius = v.borderRadius, s.transitionType = v.transitionType, s.enableTransition = v.enableTransition, u.success("已恢复外观默认设置");
352
+ }, U = () => {
353
+ s.layoutMode = v.layoutMode, s.fixedHeader = v.fixedHeader, s.showBreadcrumb = v.showBreadcrumb, s.showBreadcrumbIcon = v.showBreadcrumbIcon, s.showTagsView = v.showTagsView, s.tagsViewHeight = v.tagsViewHeight, s.tagsViewStyle = v.tagsViewStyle, s.showFooter = v.showFooter, s.sidebarWidth = v.sidebarWidth, s.sidebarCollapsedWidth = v.sidebarCollapsedWidth, s.headerHeight = v.headerHeight, u.success("已恢复布局默认设置");
363
354
  }, _ = () => {
364
- s.layoutMode = m.layoutMode, s.showBreadcrumb = m.showBreadcrumb, s.showBreadcrumbIcon = m.showBreadcrumbIcon, s.showTagsView = m.showTagsView, s.showFooter = m.showFooter, s.sidebarWidth = m.sidebarWidth, s.sidebarCollapsedWidth = m.sidebarCollapsedWidth, s.headerHeight = m.headerHeight, s.tagsViewHeight = m.tagsViewHeight, u.success("已恢复布局默认设置");
365
- }, B = () => {
366
- v.warning({
355
+ p.warning({
367
356
  title: "确认重置",
368
357
  content: "确定要恢复默认配置吗?此操作不可撤销。",
369
358
  positiveText: "确认",
@@ -372,8 +361,8 @@ const Ce = Z(), Te = [
372
361
  s.resetSettings(), u.success("已恢复默认配置");
373
362
  }
374
363
  });
375
- }, U = () => {
376
- v.warning({
364
+ }, E = () => {
365
+ p.warning({
377
366
  title: "确认清除",
378
367
  content: "确定要清除浏览器缓存吗?",
379
368
  positiveText: "确认",
@@ -385,13 +374,13 @@ const Ce = Z(), Te = [
385
374
  }), sessionStorage.clear(), u.success("缓存已清除");
386
375
  }
387
376
  });
388
- }, A = () => {
377
+ }, D = () => {
389
378
  location.reload();
390
379
  }, z = () => {
391
380
  const i = {
392
381
  settings: s.settingsState,
393
382
  gray: x.value,
394
- colorWeak: g.value,
383
+ colorWeak: f.value,
395
384
  watermark: {
396
385
  enabled: y.value,
397
386
  text: k.value
@@ -401,20 +390,20 @@ const Ce = Z(), Te = [
401
390
  type: "application/json"
402
391
  }), o = URL.createObjectURL(e), C = document.createElement("a");
403
392
  C.href = o, C.download = `robot-admin-config-${Date.now()}.json`, C.click(), URL.revokeObjectURL(o), u.success("配置已导出");
404
- }, D = () => {
393
+ }, A = () => {
405
394
  const i = document.createElement("input");
406
395
  i.type = "file", i.accept = "application/json", i.onchange = async (e) => {
407
396
  const o = e.target.files?.[0];
408
397
  if (o)
409
398
  try {
410
399
  const C = await o.text(), T = JSON.parse(C);
411
- T.settings && Object.assign(s, T.settings), T.gray !== void 0 && (x.value = T.gray), T.colorWeak !== void 0 && (g.value = T.colorWeak), T.watermark && (y.value = T.watermark.enabled, k.value = T.watermark.text), u.success("配置已导入");
400
+ T.settings && s.$patch(T.settings), T.gray !== void 0 && (x.value = T.gray), T.colorWeak !== void 0 && (f.value = T.colorWeak), T.watermark && (y.value = T.watermark.enabled, k.value = T.watermark.text), u.success("配置已导入");
412
401
  } catch {
413
402
  u.error("配置文件格式错误");
414
403
  }
415
404
  }, i.click();
416
405
  };
417
- return (i, e) => (R(), ae(l(ve), {
406
+ return (i, e) => (R(), ae(l(ce), {
418
407
  show: w.value,
419
408
  "onUpdate:show": e[16] || (e[16] = (o) => w.value = o),
420
409
  width: 380,
@@ -423,14 +412,14 @@ const Ce = Z(), Te = [
423
412
  "block-scroll": !1
424
413
  }, {
425
414
  default: n(() => [
426
- a(l(pe), {
415
+ a(l(ve), {
427
416
  title: "⚙️ 布局配置",
428
417
  closable: ""
429
418
  }, {
430
419
  default: n(() => [
431
- a(l(me), {
432
- value: f.value,
433
- "onUpdate:value": e[15] || (e[15] = (o) => f.value = o),
420
+ a(l(pe), {
421
+ value: g.value,
422
+ "onUpdate:value": e[15] || (e[15] = (o) => g.value = o),
434
423
  animated: "",
435
424
  class: "settings-tabs"
436
425
  }, {
@@ -440,27 +429,27 @@ const Ce = Z(), Te = [
440
429
  tab: "🎨 外观"
441
430
  }, {
442
431
  default: n(() => [
443
- t("div", Se, [
444
- t("div", Me, [
445
- (R(!0), W(J, null, Y(l(be), (o) => (R(), W("div", {
432
+ t("div", ke, [
433
+ t("div", Se, [
434
+ (R(!0), W(K, null, G(l(he), (o) => (R(), W("div", {
446
435
  key: o.name,
447
- class: G(["preset-card", { active: E(o) }]),
448
- onClick: (C) => P(o)
436
+ class: Y(["preset-card", { active: B(o) }]),
437
+ onClick: (C) => N(o)
449
438
  }, [
450
- t("div", He, h(o.icon), 1),
451
- t("div", Ve, h(o.name), 1),
452
- t("div", Ee, [
439
+ t("div", Re, h(o.icon), 1),
440
+ t("div", He, h(o.name), 1),
441
+ t("div", Ve, [
453
442
  t("span", {
454
443
  class: "color-dot",
455
444
  style: ne({ backgroundColor: o.primaryColor })
456
445
  }, null, 4)
457
446
  ])
458
- ], 10, Re))), 128))
447
+ ], 10, Me))), 128))
459
448
  ])
460
449
  ]),
461
- t("div", _e, [
450
+ t("div", Be, [
462
451
  e[20] || (e[20] = t("div", { class: "section-title" }, "主题模式", -1)),
463
- a(l(K), {
452
+ a(l(J), {
464
453
  value: l(s).themeMode,
465
454
  "onUpdate:value": e[0] || (e[0] = (o) => l(s).themeMode = o),
466
455
  class: "mode-group"
@@ -491,22 +480,22 @@ const Ce = Z(), Te = [
491
480
  _: 1
492
481
  }, 8, ["value"])
493
482
  ]),
494
- t("div", Be, [
483
+ t("div", Ue, [
495
484
  e[21] || (e[21] = t("div", { class: "section-title" }, "主题色", -1)),
496
- t("div", Ue, [
497
- a(l(fe), {
485
+ t("div", _e, [
486
+ a(l(me), {
498
487
  value: l(s).primaryColor,
499
488
  "onUpdate:value": e[1] || (e[1] = (o) => l(s).primaryColor = o),
500
489
  "show-alpha": !1,
501
- swatches: l(Te),
490
+ swatches: l(xe),
502
491
  actions: ["confirm"]
503
492
  }, null, 8, ["value", "swatches"]),
504
- t("span", We, h(l(s).primaryColor), 1)
493
+ t("span", Ee, h(l(s).primaryColor), 1)
505
494
  ])
506
495
  ]),
507
- t("div", Oe, [
496
+ t("div", We, [
508
497
  e[25] || (e[25] = t("div", { class: "section-title" }, "圆角大小", -1)),
509
- a(l(K), {
498
+ a(l(J), {
510
499
  value: l(s).borderRadius,
511
500
  "onUpdate:value": e[2] || (e[2] = (o) => l(s).borderRadius = o),
512
501
  class: "radius-group"
@@ -534,16 +523,16 @@ const Ce = Z(), Te = [
534
523
  _: 1
535
524
  }, 8, ["value"])
536
525
  ]),
537
- t("div", Le, [
526
+ t("div", Ie, [
538
527
  e[31] || (e[31] = t("div", { class: "section-title" }, "页面动画", -1)),
539
- t("div", Ie, [
528
+ t("div", Oe, [
540
529
  e[26] || (e[26] = t("span", { class: "text-sm" }, "启用动画", -1)),
541
530
  a(l(H), {
542
531
  value: l(s).enableTransition,
543
532
  "onUpdate:value": e[3] || (e[3] = (o) => l(s).enableTransition = o)
544
533
  }, null, 8, ["value"])
545
534
  ]),
546
- a(l(K), {
535
+ a(l(J), {
547
536
  value: l(s).transitionType,
548
537
  "onUpdate:value": e[4] || (e[4] = (o) => l(s).transitionType = o),
549
538
  disabled: !l(s).enableTransition,
@@ -579,10 +568,10 @@ const Ce = Z(), Te = [
579
568
  }, 8, ["value", "disabled"])
580
569
  ]),
581
570
  t("div", Pe, [
582
- a(l(O), {
571
+ a(l(I), {
583
572
  block: "",
584
573
  secondary: "",
585
- onClick: N
574
+ onClick: L
586
575
  }, {
587
576
  icon: n(() => [...e[32] || (e[32] = [
588
577
  t("span", { class: "i-mdi:restore" }, null, -1)
@@ -603,32 +592,32 @@ const Ce = Z(), Te = [
603
592
  default: n(() => [
604
593
  t("div", Ne, [
605
594
  e[34] || (e[34] = t("div", { class: "section-title" }, "布局模式", -1)),
606
- t("div", Ae, [
607
- (R(!0), W(J, null, Y(l(ke), (o) => (R(), W("div", {
595
+ t("div", Le, [
596
+ (R(!0), W(K, null, G(l(Te), (o) => (R(), W("div", {
608
597
  key: o.value,
609
- class: G(["layout-item", {
598
+ class: Y(["layout-item", {
610
599
  active: l(s).layoutMode === o.value,
611
600
  disabled: o.disabled
612
601
  }]),
613
- onClick: re((C) => I(o.value, o.disabled), ["stop"])
602
+ onClick: re((C) => P(o.value, o.disabled), ["stop"])
614
603
  }, [
615
- t("div", $e, [
604
+ t("div", Ae, [
616
605
  (R(), W("svg", Fe, [
617
606
  t("g", {
618
607
  innerHTML: o.svg
619
- }, null, 8, ze)
608
+ }, null, 8, $e)
620
609
  ]))
621
610
  ]),
622
- t("div", je, [
611
+ t("div", ze, [
623
612
  c(h(o.label) + " ", 1),
624
- o.disabled ? (R(), W("span", Ke, "敬请期待")) : X("", !0)
613
+ o.disabled ? (R(), W("span", je, "敬请期待")) : Z("", !0)
625
614
  ])
626
615
  ], 10, De))), 128))
627
616
  ])
628
617
  ]),
629
618
  t("div", Je, [
630
619
  e[39] || (e[39] = t("div", { class: "section-title" }, "界面元素", -1)),
631
- t("div", Ye, [
620
+ t("div", Ke, [
632
621
  e[35] || (e[35] = t("span", null, "显示面包屑", -1)),
633
622
  a(l(H), {
634
623
  value: l(s).showBreadcrumb,
@@ -643,14 +632,14 @@ const Ce = Z(), Te = [
643
632
  disabled: !l(s).showBreadcrumb
644
633
  }, null, 8, ["value", "disabled"])
645
634
  ]),
646
- t("div", Xe, [
635
+ t("div", Ye, [
647
636
  e[37] || (e[37] = t("span", null, "显示标签页", -1)),
648
637
  a(l(H), {
649
638
  value: l(s).showTagsView,
650
639
  "onUpdate:value": e[7] || (e[7] = (o) => l(s).showTagsView = o)
651
640
  }, null, 8, ["value"])
652
641
  ]),
653
- t("div", qe, [
642
+ t("div", Ze, [
654
643
  e[38] || (e[38] = t("span", null, "显示页脚", -1)),
655
644
  a(l(H), {
656
645
  value: l(s).showFooter,
@@ -658,12 +647,12 @@ const Ce = Z(), Te = [
658
647
  }, null, 8, ["value"])
659
648
  ])
660
649
  ]),
661
- t("div", Qe, [
650
+ t("div", qe, [
662
651
  e[42] || (e[42] = t("div", { class: "section-title" }, "尺寸调整", -1)),
663
- t("div", Ze, [
664
- t("div", et, [
652
+ t("div", Qe, [
653
+ t("div", Xe, [
665
654
  e[40] || (e[40] = t("span", null, "侧边栏宽度", -1)),
666
- t("span", tt, h(l(s).sidebarWidth) + "px", 1)
655
+ t("span", et, h(l(s).sidebarWidth) + "px", 1)
667
656
  ]),
668
657
  a(l(q), {
669
658
  value: l(s).sidebarWidth,
@@ -674,10 +663,10 @@ const Ce = Z(), Te = [
674
663
  marks: { 180: "180", 220: "220", 280: "280" }
675
664
  }, null, 8, ["value"])
676
665
  ]),
677
- t("div", st, [
678
- t("div", ot, [
666
+ t("div", tt, [
667
+ t("div", st, [
679
668
  e[41] || (e[41] = t("span", null, "头部高度", -1)),
680
- t("span", lt, h(l(s).headerHeight) + "px", 1)
669
+ t("span", ot, h(l(s).headerHeight) + "px", 1)
681
670
  ]),
682
671
  a(l(q), {
683
672
  value: l(s).headerHeight,
@@ -689,11 +678,11 @@ const Ce = Z(), Te = [
689
678
  }, null, 8, ["value"])
690
679
  ])
691
680
  ]),
692
- t("div", it, [
693
- a(l(O), {
681
+ t("div", lt, [
682
+ a(l(I), {
694
683
  block: "",
695
684
  secondary: "",
696
- onClick: _
685
+ onClick: U
697
686
  }, {
698
687
  icon: n(() => [...e[43] || (e[43] = [
699
688
  t("span", { class: "i-mdi:restore" }, null, -1)
@@ -712,12 +701,12 @@ const Ce = Z(), Te = [
712
701
  tab: "🔧 功能"
713
702
  }, {
714
703
  default: n(() => [
715
- t("div", at, [
704
+ t("div", it, [
716
705
  e[49] || (e[49] = t("div", { class: "section-title" }, "缓存管理", -1)),
717
- t("div", nt, [
718
- a(l(O), {
706
+ t("div", at, [
707
+ a(l(I), {
719
708
  secondary: "",
720
- onClick: U
709
+ onClick: E
721
710
  }, {
722
711
  icon: n(() => [...e[45] || (e[45] = [
723
712
  t("span", { class: "i-mdi:delete-sweep" }, null, -1)
@@ -727,9 +716,9 @@ const Ce = Z(), Te = [
727
716
  ]),
728
717
  _: 1
729
718
  }),
730
- a(l(O), {
719
+ a(l(I), {
731
720
  secondary: "",
732
- onClick: A
721
+ onClick: D
733
722
  }, {
734
723
  icon: n(() => [...e[47] || (e[47] = [
735
724
  t("span", { class: "i-mdi:refresh" }, null, -1)
@@ -741,10 +730,10 @@ const Ce = Z(), Te = [
741
730
  })
742
731
  ])
743
732
  ]),
744
- t("div", rt, [
733
+ t("div", nt, [
745
734
  e[56] || (e[56] = t("div", { class: "section-title" }, "配置管理", -1)),
746
- t("div", dt, [
747
- a(l(O), {
735
+ t("div", rt, [
736
+ a(l(I), {
748
737
  secondary: "",
749
738
  onClick: z
750
739
  }, {
@@ -756,9 +745,9 @@ const Ce = Z(), Te = [
756
745
  ]),
757
746
  _: 1
758
747
  }),
759
- a(l(O), {
748
+ a(l(I), {
760
749
  secondary: "",
761
- onClick: D
750
+ onClick: A
762
751
  }, {
763
752
  icon: n(() => [...e[52] || (e[52] = [
764
753
  t("span", { class: "i-mdi:upload" }, null, -1)
@@ -769,12 +758,12 @@ const Ce = Z(), Te = [
769
758
  _: 1
770
759
  })
771
760
  ]),
772
- a(l(O), {
761
+ a(l(I), {
773
762
  block: "",
774
763
  type: "error",
775
764
  secondary: "",
776
765
  class: "mt-2",
777
- onClick: B
766
+ onClick: _
778
767
  }, {
779
768
  icon: n(() => [...e[54] || (e[54] = [
780
769
  t("span", { class: "i-mdi:restore" }, null, -1)
@@ -785,9 +774,9 @@ const Ce = Z(), Te = [
785
774
  _: 1
786
775
  })
787
776
  ]),
788
- t("div", ut, [
777
+ t("div", dt, [
789
778
  e[59] || (e[59] = t("div", { class: "section-title" }, "系统模式", -1)),
790
- t("div", ct, [
779
+ t("div", ut, [
791
780
  e[57] || (e[57] = t("div", { class: "setting-label" }, [
792
781
  t("span", null, "灰色模式"),
793
782
  t("span", { class: "setting-desc" }, "用于哀悼日场景")
@@ -797,61 +786,61 @@ const Ce = Z(), Te = [
797
786
  "onUpdate:value": e[11] || (e[11] = (o) => x.value = o)
798
787
  }, null, 8, ["value"])
799
788
  ]),
800
- t("div", vt, [
789
+ t("div", ct, [
801
790
  e[58] || (e[58] = t("div", { class: "setting-label" }, [
802
791
  t("span", null, "色弱模式"),
803
792
  t("span", { class: "setting-desc" }, "提供无障碍访问支持")
804
793
  ], -1)),
805
794
  a(l(H), {
806
- value: g.value,
807
- "onUpdate:value": e[12] || (e[12] = (o) => g.value = o)
795
+ value: f.value,
796
+ "onUpdate:value": e[12] || (e[12] = (o) => f.value = o)
808
797
  }, null, 8, ["value"])
809
798
  ])
810
799
  ]),
811
- t("div", pt, [
800
+ t("div", vt, [
812
801
  e[61] || (e[61] = t("div", { class: "section-title" }, "水印设置", -1)),
813
- t("div", mt, [
802
+ t("div", pt, [
814
803
  e[60] || (e[60] = t("span", null, "启用水印", -1)),
815
804
  a(l(H), {
816
805
  value: y.value,
817
806
  "onUpdate:value": e[13] || (e[13] = (o) => y.value = o)
818
807
  }, null, 8, ["value"])
819
808
  ]),
820
- y.value ? (R(), W("div", ft, [
809
+ y.value ? (R(), W("div", mt, [
821
810
  a(l(ge), {
822
811
  value: k.value,
823
812
  "onUpdate:value": e[14] || (e[14] = (o) => k.value = o),
824
813
  placeholder: "请输入水印内容",
825
814
  size: "small"
826
815
  }, null, 8, ["value"])
827
- ])) : X("", !0)
816
+ ])) : Z("", !0)
828
817
  ]),
829
818
  t("div", gt, [
830
819
  e[68] || (e[68] = t("div", { class: "section-title" }, "系统信息", -1)),
831
- t("div", yt, [
832
- t("div", ht, [
820
+ t("div", ft, [
821
+ t("div", yt, [
833
822
  e[62] || (e[62] = t("span", { class: "info-label" }, "浏览器", -1)),
834
- t("span", bt, h(S.value.browser), 1)
823
+ t("span", ht, h(S.value.browser), 1)
835
824
  ]),
836
- t("div", wt, [
825
+ t("div", bt, [
837
826
  e[63] || (e[63] = t("span", { class: "info-label" }, "操作系统", -1)),
838
- t("span", xt, h(S.value.os), 1)
827
+ t("span", wt, h(S.value.os), 1)
839
828
  ]),
840
- t("div", Ct, [
829
+ t("div", xt, [
841
830
  e[64] || (e[64] = t("span", { class: "info-label" }, "屏幕分辨率", -1)),
842
- t("span", Tt, h(S.value.resolution), 1)
831
+ t("span", Ct, h(S.value.resolution), 1)
843
832
  ]),
844
- t("div", kt, [
833
+ t("div", Tt, [
845
834
  e[65] || (e[65] = t("span", { class: "info-label" }, "设备像素比", -1)),
846
- t("span", St, h(S.value.pixelRatio), 1)
835
+ t("span", kt, h(S.value.pixelRatio), 1)
847
836
  ]),
848
- t("div", Mt, [
837
+ t("div", St, [
849
838
  e[66] || (e[66] = t("span", { class: "info-label" }, "语言", -1)),
850
- t("span", Rt, h(S.value.language), 1)
839
+ t("span", Mt, h(S.value.language), 1)
851
840
  ]),
852
- t("div", Ht, [
841
+ t("div", Rt, [
853
842
  e[67] || (e[67] = t("span", { class: "info-label" }, "时区", -1)),
854
- t("span", Vt, h(S.value.timezone), 1)
843
+ t("span", Ht, h(S.value.timezone), 1)
855
844
  ])
856
845
  ])
857
846
  ])
@@ -868,27 +857,28 @@ const Ce = Z(), Te = [
868
857
  _: 1
869
858
  }, 8, ["show"]));
870
859
  }
871
- }), _t = (b, u) => {
872
- const v = b.__vccOpts || b;
860
+ }), Bt = (b, u) => {
861
+ const p = b.__vccOpts || b;
873
862
  for (const [s, w] of u)
874
- v[s] = w;
875
- return v;
876
- }, It = /* @__PURE__ */ _t(Et, [["__scopeId", "data-v-a6b98153"]]);
877
- function Pt(b, u = {}) {
878
- const v = Z(u);
879
- return v().syncCSSVariables(), v;
863
+ p[s] = w;
864
+ return p;
865
+ }, It = /* @__PURE__ */ Bt(Vt, [["__scopeId", "data-v-f8cba7b1"]]);
866
+ function Ot(b, u = {}) {
867
+ const p = X(u);
868
+ return p().syncCSSVariables(), p;
880
869
  }
881
870
  export {
882
- we as BORDER_RADIUS_MAP,
883
- Lt as COLOR_SWATCHES,
884
- m as DEFAULT_SETTINGS,
885
- Ot as LAYOUT_MODES,
886
- he as PRESET_COLORS,
871
+ be as BORDER_RADIUS_MAP,
872
+ xe as COLOR_SWATCHES,
873
+ v as DEFAULT_SETTINGS,
874
+ Wt as LAYOUT_MODES,
875
+ ye as PRESET_COLORS,
887
876
  It as SettingsDrawer,
888
- be as THEME_PRESETS,
889
- xe as TRANSITION_MAP,
890
- Z as createSettingsStore,
891
- Pt as setupLayout,
877
+ he as THEME_PRESETS,
878
+ we as TRANSITION_MAP,
879
+ Q as adjustColor,
880
+ X as createSettingsStore,
881
+ Ot as setupLayout,
892
882
  Ce as useSettingsStore
893
883
  };
894
884
  //# sourceMappingURL=index.js.map