xto-fronted 0.9.0 → 0.9.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-BTlDtwrl.js → index-C3AlXquT.js} +1 -1
- package/dist/{index-C4XoKbUh.js → index-CW3IiVm8.js} +1157 -1155
- package/dist/{index-BL_15V_t.js → index-D5ZqtqTW.js} +1 -1
- package/dist/{index-Bv0RBhQX.js → index-DWJW3Fh8.js} +1 -1
- package/dist/{index-Biperpfs.js → index-TQslB33m.js} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -1
- package/src/stores/app.ts +15 -10
|
@@ -3,7 +3,7 @@ import { Form as S, FormItem as c, Input as x, Select as W, Switch as U } from "
|
|
|
3
3
|
import { Tag as X, Pagination as Y } from "@xto/data";
|
|
4
4
|
import { Popconfirm as Z, Modal as ee, Message as C } from "@xto/feedback";
|
|
5
5
|
import { Space as D, Button as g } from "@xto/base";
|
|
6
|
-
import { S as d, a as te, _ as le } from "./index-
|
|
6
|
+
import { S as d, a as te, _ as le } from "./index-CW3IiVm8.js";
|
|
7
7
|
const se = { class: "user-page" }, ae = { class: "search-section" }, oe = { class: "table-section" }, ne = { class: "table-toolbar" }, ie = { class: "toolbar-left" }, de = { class: "toolbar-right" }, re = { class: "table-count" }, ue = { class: "table-wrapper" }, me = { class: "data-table" }, ce = { key: 0 }, pe = { key: 1 }, ve = { class: "col-id" }, fe = { class: "id-badge" }, he = { class: "col-user" }, ge = { class: "user-info" }, ke = { class: "user-avatar" }, _e = { class: "user-detail" }, ye = { class: "user-nickname" }, xe = { class: "user-username" }, be = { class: "col-contact" }, Ve = { class: "contact-info" }, Ee = { class: "contact-email" }, Be = { class: "contact-phone" }, Ce = { class: "col-roles" }, De = { class: "role-tags" }, Le = { class: "col-status" }, Ae = { class: "status-switch" }, we = { class: "col-time" }, ze = { class: "time-text" }, Ne = { class: "col-actions" }, Se = { class: "pagination-wrapper" }, Ue = { class: "status-field" }, Me = { class: "status-label" }, Te = /* @__PURE__ */ R({
|
|
8
8
|
__name: "index",
|
|
9
9
|
setup(Fe) {
|
|
@@ -3,7 +3,7 @@ import { Form as N, FormItem as v, Input as x, Select as Q, Switch as S } from "
|
|
|
3
3
|
import { Tag as W, Pagination as X } from "@xto/data";
|
|
4
4
|
import { Popconfirm as Y, Modal as Z, Message as C } from "@xto/feedback";
|
|
5
5
|
import { Space as L, Button as f } from "@xto/base";
|
|
6
|
-
import { S as d, a as ee, _ as te } from "./index-
|
|
6
|
+
import { S as d, a as ee, _ as te } from "./index-CW3IiVm8.js";
|
|
7
7
|
const le = { class: "role-page" }, se = { class: "search-section" }, oe = { class: "table-section" }, ae = { class: "table-toolbar" }, ne = { class: "toolbar-left" }, ie = { class: "toolbar-right" }, de = { class: "table-count" }, re = { class: "table-wrapper" }, ue = { class: "data-table" }, ce = { key: 0 }, pe = { key: 1 }, me = { class: "col-id" }, ve = { class: "id-badge" }, fe = { class: "col-name" }, ge = { class: "role-name" }, ye = { class: "col-code" }, _e = { class: "col-desc" }, ke = { class: "desc-text" }, he = { class: "col-status" }, xe = { class: "status-switch" }, Ve = { class: "col-time" }, Ee = { class: "time-text" }, be = { class: "col-actions" }, Be = { class: "pagination-wrapper" }, Ce = { class: "status-field" }, Le = { class: "status-label" }, De = /* @__PURE__ */ P({
|
|
8
8
|
__name: "index",
|
|
9
9
|
setup(we) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as f, ref as l, resolveComponent as g, openBlock as o, createElementBlock as a, createElementVNode as s, Fragment as n, renderList as c, normalizeStyle as M, toDisplayString as i, normalizeClass as v, createBlock as w, withCtx as x, createVNode as r, unref as d } from "vue";
|
|
2
2
|
import { Progress as u } from "@xto/data";
|
|
3
|
-
import { _ as b } from "./index-
|
|
3
|
+
import { _ as b } from "./index-CW3IiVm8.js";
|
|
4
4
|
const Z = { class: "dashboard" }, C = { class: "stats-section" }, U = { class: "stat-icon" }, q = ["d"], B = { class: "stat-content" }, F = { class: "stat-title" }, V = { class: "stat-value" }, L = {
|
|
5
5
|
key: 0,
|
|
6
6
|
viewBox: "0 0 24 24",
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as a, c as t, G as o, d as r, e as n, H as u, L as i, i as p, M as l, b as g, f as T, g as d, h as R, S as c, a as f, j as h, T as S, k as U, l as k, m, n as A, o as M, p as y, q as C, r as x, s as L, t as D, u as b, v as B, w as I, x as F, y as G, z as P, A as v, B as E, C as w, D as O, E as H, I as N, J as j, K as q, N as z } from "./index-
|
|
1
|
+
import { F as a, c as t, G as o, d as r, e as n, H as u, L as i, i as p, M as l, b as g, f as T, g as d, h as R, S as c, a as f, j as h, T as S, k as U, l as k, m, n as A, o as M, p as y, q as C, r as x, s as L, t as D, u as b, v as B, w as I, x as F, y as G, z as P, A as v, B as E, C as w, D as O, E as H, I as N, J as j, K as q, N as z } from "./index-CW3IiVm8.js";
|
|
2
2
|
import { O as K, b as X, D as Q, c as V, a as W, d as Y, e as Z, f as _, g as $, J as ee, A as se, h as ae, H as te, G as oe, P as re, i as ne, j as ue, Q as ie, R as pe, k as le, l as ge, z as Te, B as de, S as Re, T as ce, m as fe, n as he, o as Se, C as Ue, U as ke, L as me, V as Ae, I as Me, y as ye, W as Ce, p as xe, q as Le, r as De, s as be, X as Be, Y as Ie, K as Fe, M as Ge, Z as Pe, _ as ve, $ as Ee, N as we, a0 as Oe, a1 as He, E as Ne, a2 as je, u as qe, t as ze, v as Je, w as Ke, x as Xe, F as Qe } from "./user-B0q24FmO.js";
|
|
3
3
|
export {
|
|
4
4
|
a as Footer,
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -51,8 +51,10 @@ export async function createXtoApp(config: Partial<XtoConfig>) {
|
|
|
51
51
|
|
|
52
52
|
// 拉取服务端按应用配置的界面默认值(免登录接口,xto-admin「界面设置」维护)
|
|
53
53
|
// 必须在 store 首次实例化前完成,失败/超时静默降级为内置默认
|
|
54
|
+
// H5 独立页(如扫码进入的移动端申请页)不使用 Layout/换肤体系,跳过该请求
|
|
55
|
+
const isH5Page = typeof window !== 'undefined' && window.location.pathname.includes('/h5/')
|
|
54
56
|
const resolvedAppId = config.appId || getAppId()
|
|
55
|
-
if (resolvedAppId) {
|
|
57
|
+
if (resolvedAppId && !isH5Page) {
|
|
56
58
|
try {
|
|
57
59
|
const uiConfig = await Promise.race([
|
|
58
60
|
getAppUiConfig(resolvedAppId),
|
package/src/stores/app.ts
CHANGED
|
@@ -24,14 +24,17 @@ function readUserPreference<T>(key: string): T | undefined {
|
|
|
24
24
|
return value === null || value === ('' as unknown as T) ? undefined : value
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
// 服务端按应用下发的默认值(xto-admin 界面配置),仅在用户未显式设置时生效
|
|
28
|
-
const serverUi = getServerUiConfig()
|
|
29
|
-
const serverFeatures = serverUi.features || {}
|
|
30
|
-
|
|
31
27
|
// 重置时需要清掉的用户偏好键(isCollapsed 属个人习惯,不随默认值重置)
|
|
32
28
|
const PREFERENCE_KEYS = ['layout', 'primaryColor', 'theme', 'isDark', 'showTabs', 'showBreadcrumb', 'showFooter'] as const
|
|
33
29
|
|
|
30
|
+
// 注意:服务端界面配置必须在 store setup 内读取(getServerUiConfig())。
|
|
31
|
+
// 本模块经 index.ts 静态导出,若在模块顶层取值会在 createXtoApp 拉取配置前固化成空对象。
|
|
32
|
+
|
|
34
33
|
export const useAppStore = defineStore('app', () => {
|
|
34
|
+
// 服务端按应用下发的默认值(在首次 useAppStore() 时读取,此时 createXtoApp 已完成配置拉取)
|
|
35
|
+
const serverUi = getServerUiConfig()
|
|
36
|
+
const serverFeatures = serverUi.features || {}
|
|
37
|
+
|
|
35
38
|
// 状态(优先级:用户本地偏好 > 服务端按应用默认 > 内置默认)
|
|
36
39
|
const appName = ref<string>(local.get<string>('appName') || 'XTO App')
|
|
37
40
|
const indexPath = ref<string>(local.get<string>('indexPath') || '/dashboard')
|
|
@@ -161,13 +164,15 @@ export const useAppStore = defineStore('app', () => {
|
|
|
161
164
|
// 恢复默认:清掉本地偏好,回到服务端按应用配置(无配置则回内置默认)
|
|
162
165
|
const resetToServerDefaults = () => {
|
|
163
166
|
PREFERENCE_KEYS.forEach((key) => local.remove(key))
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
const ui = getServerUiConfig()
|
|
168
|
+
const features = ui.features || {}
|
|
169
|
+
layout.value = ui.layout ?? 'sidebar'
|
|
170
|
+
primaryColor.value = ui.primaryColor ?? '#4F46E5'
|
|
171
|
+
theme.value = ui.theme ?? 'light'
|
|
167
172
|
isDark.value = theme.value === 'dark'
|
|
168
|
-
showTabs.value =
|
|
169
|
-
showFooter.value =
|
|
170
|
-
showBreadcrumb.value =
|
|
173
|
+
showTabs.value = features.showTabs ?? true
|
|
174
|
+
showFooter.value = features.showFooter ?? true
|
|
175
|
+
showBreadcrumb.value = features.showBreadcrumb ?? true
|
|
171
176
|
applyThemeClass()
|
|
172
177
|
applyPrimaryColorVars(primaryColor.value)
|
|
173
178
|
}
|