workdesktop-ai 1.2.1 → 1.2.3

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.
Files changed (115) hide show
  1. package/CHANGELOG.md +190 -190
  2. package/dist/chunks/Path-pIP0JQ0c.mjs +245 -0
  3. package/dist/chunks/Path-pIP0JQ0c.mjs.map +1 -0
  4. package/dist/chunks/Station-BTP0SbBg.mjs +818 -0
  5. package/dist/chunks/Station-BTP0SbBg.mjs.map +1 -0
  6. package/dist/index.esm.js +2 -2
  7. package/dist/index.umd.js +19 -19
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/path/index.mjs +1 -1
  10. package/dist/path/style.css +1 -1
  11. package/dist/station/index.mjs +1 -1
  12. package/dist/station/style.css +1 -1
  13. package/dist/style.css +1 -1
  14. package/dist/types/src/components/buttons/ApiButton.vue.d.ts +134 -0
  15. package/dist/types/src/components/buttons/ConfirmButton.vue.d.ts +169 -0
  16. package/dist/types/src/components/buttons/DialogButton.vue.d.ts +167 -0
  17. package/dist/types/src/components/buttons/DrawerButton.vue.d.ts +186 -0
  18. package/dist/types/src/components/buttons/PopconfirmButton.vue.d.ts +317 -0
  19. package/dist/types/src/components/buttons/PromptButton.vue.d.ts +180 -0
  20. package/dist/types/src/components/buttons/RouteButton.vue.d.ts +122 -0
  21. package/dist/types/src/components/buttons/TipsButton.vue.d.ts +66 -0
  22. package/dist/types/src/components/buttons/useApiAction.d.ts +20 -0
  23. package/dist/types/src/components/common/props.d.ts +122 -0
  24. package/dist/types/src/components/containers/Drawer.vue.d.ts +172 -0
  25. package/dist/types/src/components/containers/Iframe.vue.d.ts +81 -0
  26. package/dist/types/src/components/containers/containerContext.d.ts +15 -0
  27. package/dist/types/src/components/containers/useContainerController.d.ts +24 -0
  28. package/dist/types/src/components/containers/useIframeContainer.d.ts +20 -0
  29. package/dist/types/src/components/core/Requester.vue.d.ts +41 -0
  30. package/dist/types/src/components/data/datagrid/DataGrid.vue.d.ts +542 -0
  31. package/dist/types/src/components/data/datagrid/useColumnSettings.d.ts +62 -0
  32. package/dist/types/src/components/data/editable-grid/EditableGrid.vue.d.ts +586 -0
  33. package/dist/types/src/components/data/viewer/Viewer.vue.d.ts +187 -0
  34. package/dist/types/src/components/form/FormItem.vue.d.ts +62 -0
  35. package/dist/types/src/components/form/SearchItem.vue.d.ts +62 -0
  36. package/dist/types/src/components/form/SearchPanel.vue.d.ts +167 -0
  37. package/dist/types/src/components/form/data-form/DataForm.vue.d.ts +311 -0
  38. package/dist/types/src/components/index.d.ts +32 -0
  39. package/dist/types/src/components/inputs/AutoComplete.vue.d.ts +166 -0
  40. package/dist/types/src/components/inputs/CheckboxList.vue.d.ts +166 -0
  41. package/dist/types/src/components/inputs/RadioList.vue.d.ts +166 -0
  42. package/dist/types/src/components/inputs/Select.vue.d.ts +176 -0
  43. package/dist/types/src/components/inputs/Switch.vue.d.ts +116 -0
  44. package/dist/types/src/components/inputs/useOptionsLoader.d.ts +32 -0
  45. package/dist/types/src/components/layout/Station.vue.d.ts +313 -0
  46. package/dist/types/src/components/layout/StationMenuNode.vue.d.ts +20 -0
  47. package/dist/types/src/components/layout/types.d.ts +67 -0
  48. package/dist/types/src/components/styles/Panel.vue.d.ts +94 -0
  49. package/dist/types/src/components/styles/Path.vue.d.ts +103 -0
  50. package/dist/types/src/components/styles/Tips.vue.d.ts +60 -0
  51. package/dist/types/src/components/upload/ImageUpload.vue.d.ts +176 -0
  52. package/dist/types/src/components/upload/Upload.vue.d.ts +235 -0
  53. package/dist/types/src/entries/api-button.d.ts +9 -0
  54. package/dist/types/src/entries/auto-complete.d.ts +9 -0
  55. package/dist/types/src/entries/checkbox-list.d.ts +9 -0
  56. package/dist/types/src/entries/components-map.d.ts +8 -0
  57. package/dist/types/src/entries/confirm-button.d.ts +9 -0
  58. package/dist/types/src/entries/data-form.d.ts +9 -0
  59. package/dist/types/src/entries/data-grid.d.ts +9 -0
  60. package/dist/types/src/entries/dialog-button.d.ts +9 -0
  61. package/dist/types/src/entries/drawer-button.d.ts +9 -0
  62. package/dist/types/src/entries/drawer.d.ts +9 -0
  63. package/dist/types/src/entries/editable-grid.d.ts +9 -0
  64. package/dist/types/src/entries/form-item.d.ts +9 -0
  65. package/dist/types/src/entries/iframe.d.ts +9 -0
  66. package/dist/types/src/entries/image-upload.d.ts +9 -0
  67. package/dist/types/src/entries/panel.d.ts +9 -0
  68. package/dist/types/src/entries/path.d.ts +9 -0
  69. package/dist/types/src/entries/prompt-button.d.ts +9 -0
  70. package/dist/types/src/entries/radio-list.d.ts +9 -0
  71. package/dist/types/src/entries/requester.d.ts +9 -0
  72. package/dist/types/src/entries/route-button.d.ts +9 -0
  73. package/dist/types/src/entries/search-item.d.ts +9 -0
  74. package/dist/types/src/entries/search-panel.d.ts +9 -0
  75. package/dist/types/src/entries/select.d.ts +9 -0
  76. package/dist/types/src/entries/station.d.ts +9 -0
  77. package/dist/types/src/entries/switch.d.ts +9 -0
  78. package/dist/types/src/entries/tips-button.d.ts +9 -0
  79. package/dist/types/src/entries/tips.d.ts +9 -0
  80. package/dist/types/src/entries/upload.d.ts +9 -0
  81. package/dist/types/src/entries/viewer.d.ts +9 -0
  82. package/dist/types/src/index.d.ts +24 -0
  83. package/dist/types/src/lib/composables/useConfig.d.ts +19 -0
  84. package/dist/types/src/lib/composables/useDataGrid.d.ts +69 -0
  85. package/dist/types/src/lib/composables/useEventBus.d.ts +16 -0
  86. package/dist/types/src/lib/composables/useGlobalState.d.ts +5 -0
  87. package/dist/types/src/lib/composables/useRequest.d.ts +42 -0
  88. package/dist/types/src/lib/configs/default-config.d.ts +6 -0
  89. package/dist/types/src/lib/core/config.d.ts +28 -0
  90. package/dist/types/src/lib/core/http.d.ts +100 -0
  91. package/dist/types/src/lib/core/linkage.d.ts +48 -0
  92. package/dist/types/src/lib/core/skins/apple.d.ts +3 -0
  93. package/dist/types/src/lib/core/skins/business.d.ts +3 -0
  94. package/dist/types/src/lib/core/skins/chinese.d.ts +3 -0
  95. package/dist/types/src/lib/core/skins/cool.d.ts +3 -0
  96. package/dist/types/src/lib/core/skins/cyberpunk.d.ts +3 -0
  97. package/dist/types/src/lib/core/skins/default.d.ts +3 -0
  98. package/dist/types/src/lib/core/skins/fashion.d.ts +3 -0
  99. package/dist/types/src/lib/core/skins/flat.d.ts +3 -0
  100. package/dist/types/src/lib/core/skins/governance.d.ts +3 -0
  101. package/dist/types/src/lib/core/skins/index.d.ts +15 -0
  102. package/dist/types/src/lib/core/skins/tech.d.ts +3 -0
  103. package/dist/types/src/lib/core/skins/types.d.ts +19 -0
  104. package/dist/types/src/lib/core/station-linkage.d.ts +72 -0
  105. package/dist/types/src/lib/core/theme.d.ts +11 -0
  106. package/dist/types/src/lib/core/utils.d.ts +28 -0
  107. package/dist/types/src/lib/install.d.ts +11 -0
  108. package/dist/types/src/types/config.d.ts +130 -0
  109. package/dist/types/src/types/index.d.ts +4 -0
  110. package/dist/types/vite.config.d.ts +7 -0
  111. package/package.json +7 -2
  112. package/dist/chunks/Path-C_oyo6Dg.mjs +0 -200
  113. package/dist/chunks/Path-C_oyo6Dg.mjs.map +0 -1
  114. package/dist/chunks/Station-DLV19USa.mjs +0 -780
  115. package/dist/chunks/Station-DLV19USa.mjs.map +0 -1
@@ -1,780 +0,0 @@
1
- import { defineComponent as Oe, resolveComponent as m, openBlock as o, createElementBlock as _, Fragment as N, renderList as O, createBlock as s, withCtx as l, createVNode as d, resolveDynamicComponent as G, createCommentVNode as k, createElementVNode as y, toDisplayString as A, getCurrentInstance as dt, computed as p, ref as L, watch as Be, onMounted as ct, onUnmounted as ft, normalizeClass as H, renderSlot as M, withDirectives as We, vShow as De, unref as x, createTextVNode as T, withModifiers as _t, KeepAlive as vt } from "vue";
2
- import * as Ve from "@element-plus/icons-vue";
3
- import { Fold as pt, Expand as yt, ArrowUp as ht, ArrowDown as ze, Refresh as Ke, Setting as Le, Close as gt } from "@element-plus/icons-vue";
4
- import { f as kt } from "./props-DAytpx7D.mjs";
5
- import { a as mt, n as ue } from "./station-linkage-D54-_iyL.mjs";
6
- import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
7
- const wt = /* @__PURE__ */ Oe({
8
- name: "StationMenuNode",
9
- __name: "StationMenuNode",
10
- props: {
11
- /** 归一化后的菜单项(带 _key) */
12
- items: { type: Array, default: () => [] }
13
- },
14
- emits: ["select"],
15
- setup(u, { emit: X }) {
16
- const F = X;
17
- function r(w) {
18
- return w ? typeof w == "string" ? Ve[w] || null : w : null;
19
- }
20
- function g(w) {
21
- w.disabled || F("select", w);
22
- }
23
- function h(w) {
24
- F("select", w);
25
- }
26
- return (w, R) => {
27
- const B = m("el-icon"), W = m("station-menu-node", !0), V = m("el-sub-menu"), P = m("el-badge"), Y = m("el-menu-item");
28
- return o(!0), _(N, null, O(u.items, (v) => (o(), _(N, {
29
- key: v._key
30
- }, [
31
- v.children && v.children.length ? (o(), s(V, {
32
- key: 0,
33
- index: v._key
34
- }, {
35
- title: l(() => [
36
- r(v.icon) ? (o(), s(B, { key: 0 }, {
37
- default: l(() => [
38
- (o(), s(G(r(v.icon))))
39
- ]),
40
- _: 2
41
- }, 1024)) : k("", !0),
42
- y("span", null, A(v.title), 1)
43
- ]),
44
- default: l(() => [
45
- d(W, {
46
- items: v.children,
47
- onSelect: h
48
- }, null, 8, ["items"])
49
- ]),
50
- _: 2
51
- }, 1032, ["index"])) : (o(), s(Y, {
52
- key: 1,
53
- index: v._key,
54
- disabled: v.disabled,
55
- onClick: (re) => g(v)
56
- }, {
57
- default: l(() => [
58
- r(v.icon) ? (o(), s(B, { key: 0 }, {
59
- default: l(() => [
60
- (o(), s(G(r(v.icon))))
61
- ]),
62
- _: 2
63
- }, 1024)) : k("", !0),
64
- y("span", null, A(v.title), 1),
65
- v.badge !== void 0 && v.badge !== "" ? (o(), s(P, {
66
- key: 1,
67
- value: v.badge,
68
- class: "wd-station__menu-badge"
69
- }, null, 8, ["value"])) : k("", !0)
70
- ]),
71
- _: 2
72
- }, 1032, ["index", "disabled", "onClick"]))
73
- ], 64))), 128);
74
- };
75
- }
76
- }), Q = /* @__PURE__ */ Fe(wt, [["__scopeId", "data-v-a003600a"]]), bt = { class: "wd-station__main" }, Ct = { class: "wd-station__header" }, St = { class: "wd-station__header-left" }, Mt = {
77
- key: 1,
78
- class: "wd-station__logo wd-station__logo--header"
79
- }, xt = { class: "wd-station__logo-title" }, At = { class: "wd-station__user" }, $t = { class: "wd-station__user-name" }, It = { class: "wd-station__header-center" }, Tt = {
80
- key: 0,
81
- class: "wd-station__nav"
82
- }, Nt = ["onClick"], Et = {
83
- key: 1,
84
- class: "wd-station__header-title"
85
- }, Gt = { class: "wd-station__header-right" }, Bt = { class: "wd-station__user" }, Wt = { class: "wd-station__user-name" }, Dt = {
86
- key: 0,
87
- class: "wd-station__top-menu"
88
- }, zt = {
89
- key: 1,
90
- class: "wd-station__tabs-bar"
91
- }, Kt = ["onClick"], Lt = { class: "wd-station__tabs-more" }, Ot = { class: "wd-station__content" }, Vt = { class: "wd-station__footer" }, Ft = {
92
- key: 0,
93
- class: "wd-station__footer-info"
94
- }, Rt = {
95
- key: 1,
96
- class: "wd-station__footer-copyright"
97
- }, Pt = /* @__PURE__ */ Oe({
98
- name: "WdStation",
99
- __name: "Station",
100
- props: {
101
- ...kt,
102
- /** 系统标题(logo 区 / headerMode=title 时的头部标题) */
103
- title: { type: String, default: "" },
104
- /** logo 图标(@element-plus/icons-vue 名称字符串,或直接传组件) */
105
- logo: { type: [String, Object], default: "" },
106
- /** 分组菜单结构(优先),支持 JSON 字符串 */
107
- menuGroups: { type: [Array, String], default: void 0 },
108
- /** 扁平菜单结构(带 group/groupKey 字段按出现顺序归组),支持 JSON 字符串 */
109
- menus: { type: [Array, String], default: void 0 },
110
- /** 头部中央模式:nav=分导台 / title=标题(此时侧边渲染全量菜单并带组标题)/ both=分导台+标题并存(顶部显示分导台,侧边按分组标题渲染全量菜单) */
111
- headerMode: { type: String, default: "nav" },
112
- /** 菜单位置:side=左侧 / top=顶部 / none=不启用 */
113
- menuMode: { type: String, default: "side" },
114
- /** 内容方式:page=单页 / tabs=多标签 */
115
- contentMode: { type: String, default: "page" },
116
- /** 路由适配:auto=自动检测 $router / router / html */
117
- routerMode: { type: String, default: "auto" },
118
- /** 是否显示折叠按钮 */
119
- collapsible: { type: Boolean, default: !0 },
120
- /** 折叠状态(v-model:collapsed) */
121
- collapsed: { type: Boolean, default: !1 },
122
- /** 当前分组 key(v-model:active-group) */
123
- activeGroup: { type: String, default: "" },
124
- /** 当前菜单 key(v-model:active-menu) */
125
- activeMenu: { type: String, default: "" },
126
- /** 已开启标签(v-model:open-tabs,受控) */
127
- openTabs: { type: Array, default: void 0 },
128
- /** 用户名(有值显示用户下拉,无值显示登录按钮) */
129
- userName: { type: String, default: "" },
130
- /** 用户头像地址 */
131
- userAvatar: { type: String, default: "" },
132
- /** 版权信息 */
133
- copyright: { type: String, default: "" },
134
- /** 底部动态信息(v-model:footer-info) */
135
- footerInfo: { type: String, default: "" },
136
- /** router 模式内容区 keep-alive */
137
- keepAlive: { type: Boolean, default: !1 },
138
- /** 工具栏点位配置:refresh/settings/user/login 各自 left/right/none,支持 JSON 字符串 */
139
- toolbarConfig: { type: [Object, String], default: void 0 }
140
- },
141
- emits: [
142
- "update:collapsed",
143
- "update:active-group",
144
- "update:active-menu",
145
- "update:open-tabs",
146
- "update:footer-info",
147
- "group-change",
148
- "menu-select",
149
- "tab-click",
150
- "tab-close",
151
- "refresh",
152
- "login",
153
- "logout",
154
- "settings"
155
- ],
156
- setup(u, { expose: X, emit: F }) {
157
- var Ce, Se, Me, xe, Ae, $e, Ie, Te, Ne, Ee;
158
- const r = u, g = F, h = dt(), w = ((Ce = h == null ? void 0 : h.proxy) == null ? void 0 : Ce.$router) || ((xe = (Me = (Se = h == null ? void 0 : h.appContext) == null ? void 0 : Se.config) == null ? void 0 : Me.globalProperties) == null ? void 0 : xe.$router), R = ((Ae = h == null ? void 0 : h.proxy) == null ? void 0 : Ae.$route) || ((Te = (Ie = ($e = h == null ? void 0 : h.appContext) == null ? void 0 : $e.config) == null ? void 0 : Ie.globalProperties) == null ? void 0 : Te.$route), B = (Ee = (Ne = h == null ? void 0 : h.appContext) == null ? void 0 : Ne.components) == null ? void 0 : Ee.RouterView, W = p(() => r.routerMode === "html" ? !1 : r.routerMode === "router" ? !0 : !!w);
159
- function V(e, t) {
160
- if (e == null || e === "") return t;
161
- if (typeof e != "string") return e;
162
- try {
163
- return JSON.parse(e);
164
- } catch (n) {
165
- return console.error("[WorkDesktop] WdStation JSON 解析失败,已回退默认值:", n), t;
166
- }
167
- }
168
- function P(e, t) {
169
- return e.map((n) => ({
170
- ...n,
171
- _key: n._key || `${t}:${n.name || n.path || n.title}`,
172
- children: n.children && n.children.length ? P(n.children, t) : void 0
173
- }));
174
- }
175
- function Y(e) {
176
- const t = [], n = /* @__PURE__ */ new Map();
177
- return e.forEach((f) => {
178
- const a = f.groupKey || f.group || "default";
179
- n.has(a) || (n.set(a, {
180
- key: a,
181
- title: f.group || (a === "default" ? "默认" : a),
182
- icon: f.groupIcon,
183
- menus: []
184
- }), t.push(a)), n.get(a).menus.push(f);
185
- }), t.map((f) => n.get(f));
186
- }
187
- let v = !1;
188
- function re(e) {
189
- if (v) return;
190
- const t = (n, f) => {
191
- n.forEach((a) => {
192
- f > 2 && !v && (v = !0, console.warn("[WorkDesktop] WdStation: 菜单层级建议不超过两层,当前已超出(仍按原样渲染)")), a.children && a.children.length && t(a.children, f + 1);
193
- });
194
- };
195
- e.forEach((n) => t(n.menus, 1));
196
- }
197
- const $ = p(() => {
198
- const e = V(r.menuGroups, null);
199
- let t;
200
- if (Array.isArray(e) && e.length)
201
- t = e.map((n) => ({ key: n.key, title: n.title, icon: n.icon, menus: n.menus || [] }));
202
- else {
203
- const n = V(r.menus, []);
204
- t = Y(Array.isArray(n) ? n : []);
205
- }
206
- return t = t.map((n) => ({ ...n, menus: P(n.menus, n.key) })), re(t), t;
207
- }), Z = L(""), de = p(
208
- () => {
209
- var e;
210
- return r.activeGroup || Z.value || ((e = $.value[0]) == null ? void 0 : e.key) || "";
211
- }
212
- ), Re = p(() => r.headerMode !== "title" && $.value.length > 1), Pe = p(
213
- () => $.value.find((e) => e.key === de.value) || $.value[0]
214
- ), ce = p(() => {
215
- var e;
216
- return ((e = Pe.value) == null ? void 0 : e.menus) || [];
217
- });
218
- function Je(e) {
219
- Z.value = e, g("update:active-group", e);
220
- const t = $.value.find((n) => n.key === e);
221
- t && g("group-change", { key: t.key, title: t.title }), ue(r.filter);
222
- }
223
- const ee = L("");
224
- Be(
225
- () => r.activeMenu,
226
- (e) => {
227
- e && (ee.value = e);
228
- }
229
- );
230
- const b = p(() => r.activeMenu || ee.value);
231
- function D(e) {
232
- ee.value = e, g("update:active-menu", e), ue(r.filter);
233
- }
234
- function J(e) {
235
- D(e._key), g("menu-select", e), r.contentMode === "tabs" && oe(e), W.value && e.path && w.push(e.path);
236
- }
237
- function te(e, t) {
238
- e.forEach((n) => {
239
- t(n), n.children && n.children.length && te(n.children, t);
240
- });
241
- }
242
- function je(e) {
243
- for (const t of $.value) {
244
- let n = null;
245
- if (te(t.menus, (f) => {
246
- !n && f.path === e && (n = f);
247
- }), n) return { group: t, item: n };
248
- }
249
- return null;
250
- }
251
- Be(
252
- () => R == null ? void 0 : R.path,
253
- (e) => {
254
- if (!e || !W.value) return;
255
- const t = je(e);
256
- t && (Z.value = t.group.key, D(t.item._key));
257
- },
258
- { immediate: !0 }
259
- );
260
- const fe = L([]), _e = p(() => r.openTabs !== void 0), I = p(
261
- () => _e.value ? r.openTabs : fe.value
262
- );
263
- function ne(e) {
264
- _e.value || (fe.value = e), g("update:open-tabs", e);
265
- }
266
- function oe(e) {
267
- const t = e._key || e.key;
268
- t && (I.value.find((n) => n.key === t) || ne([...I.value, { key: t, title: e.title, path: e.path, affix: e.affix }]), D(t));
269
- }
270
- function le(e) {
271
- const t = I.value, n = t.findIndex((c) => c.key === e);
272
- if (n < 0) return;
273
- const f = t[n];
274
- if (f.affix) return;
275
- const a = t.filter((c) => c.key !== e);
276
- if (ne(a), g("tab-close", { ...f }), b.value === e) {
277
- const c = a[n] || a[n - 1];
278
- c && D(c.key);
279
- }
280
- }
281
- function Ue(e) {
282
- D(e.key), g("tab-click", { ...e }), W.value && e.path && w.push(e.path);
283
- }
284
- function se(e) {
285
- const t = I.value, n = t.filter((c, S) => e(c, S) && !c.affix);
286
- if (!n.length) return;
287
- const f = new Set(n.map((c) => c.key)), a = t.filter((c) => !f.has(c.key));
288
- if (ne(a), n.forEach((c) => g("tab-close", { ...c })), !a.find((c) => c.key === b.value)) {
289
- const c = t.findIndex((E) => E.key === b.value), S = a[Math.min(c, a.length - 1)];
290
- S && D(S.key);
291
- }
292
- }
293
- function qe() {
294
- le(b.value);
295
- }
296
- function He() {
297
- const e = I.value.findIndex((t) => t.key === b.value);
298
- e < 0 || se((t, n) => n < e);
299
- }
300
- function Qe() {
301
- se((e) => e.key !== b.value);
302
- }
303
- function Xe() {
304
- se(() => !0);
305
- }
306
- const Ye = p(() => {
307
- const e = I.value.find((t) => t.key === b.value);
308
- return !!e && !e.affix;
309
- }), Ze = p(() => {
310
- const e = I.value.findIndex((t) => t.key === b.value);
311
- return e > 0 && I.value.slice(0, e).some((t) => !t.affix);
312
- }), et = p(
313
- () => I.value.some((e) => !e.affix && e.key !== b.value)
314
- ), tt = p(() => I.value.some((e) => !e.affix)), ve = p(() => {
315
- const e = V(r.toolbarConfig, {}) || {};
316
- return {
317
- refresh: e.refresh || "right",
318
- settings: e.settings || "right",
319
- user: e.user || "right",
320
- login: e.login || "right"
321
- };
322
- }), j = p(() => r.userName ? "user" : "login"), nt = p(() => {
323
- const e = [], t = ve.value;
324
- return t.refresh === "left" && e.push("refresh"), t.settings === "left" && e.push("settings"), t[j.value] === "left" && e.push(j.value), e;
325
- }), ot = p(() => {
326
- const e = [], t = ve.value;
327
- return t.refresh === "right" && e.push("refresh"), t.settings === "right" && e.push("settings"), t[j.value] === "right" && e.push(j.value), e;
328
- }), pe = p(() => r.userName ? r.userName.charAt(0) : "");
329
- function ye() {
330
- g("settings");
331
- }
332
- function he() {
333
- g("login");
334
- }
335
- function ge() {
336
- g("logout");
337
- }
338
- const ke = L(!1), C = p(() => r.collapsed || ke.value);
339
- function lt() {
340
- ke.value = !C.value, g("update:collapsed", C.value);
341
- }
342
- const me = L(0);
343
- function U() {
344
- me.value += 1, g("refresh");
345
- }
346
- const we = L("");
347
- function st(e) {
348
- we.value = e, g("update:footer-info", e);
349
- }
350
- const be = p(() => we.value || r.footerInfo);
351
- function at(e) {
352
- for (const t of $.value) {
353
- const n = [], f = (a, c) => {
354
- for (const S of a) {
355
- if (S._key === e)
356
- return n.push(...c, S), !0;
357
- if (S.children && S.children.length && f(S.children, [...c, S])) return !0;
358
- }
359
- return !1;
360
- };
361
- if (f(t.menus, []))
362
- return {
363
- chain: [
364
- { title: t.title, icon: t.icon },
365
- ...n.map((a) => ({ title: a.title, path: a.path, icon: a.icon }))
366
- ]
367
- };
368
- }
369
- return null;
370
- }
371
- function it() {
372
- var e;
373
- return b.value ? ((e = at(b.value)) == null ? void 0 : e.chain) || [] : [];
374
- }
375
- let q = null;
376
- ct(() => {
377
- q = mt({ filter: r.filter, setFooterInfo: st, refresh: U, getActiveMenuChain: it }), ue(r.filter), r.contentMode === "tabs" && $.value.forEach(
378
- (e) => te(e.menus, (t) => {
379
- t.affix && oe(t);
380
- })
381
- );
382
- }), ft(() => {
383
- q == null || q();
384
- });
385
- function z(e) {
386
- return e ? typeof e == "string" ? Ve[e] || null : e : null;
387
- }
388
- return X({ refresh: U, openTab: oe, closeTab: le }), (e, t) => {
389
- const n = m("el-icon"), f = m("el-menu-item-group"), a = m("el-menu"), c = m("el-scrollbar"), S = m("el-avatar"), E = m("el-dropdown-item"), ae = m("el-dropdown-menu"), ie = m("el-dropdown"), Ge = m("el-button"), ut = m("el-tab-pane"), rt = m("el-tabs");
390
- return o(), _("div", {
391
- class: H(["wd-station", { "is-collapsed": C.value }])
392
- }, [
393
- u.menuMode === "side" ? (o(), _("aside", {
394
- key: 0,
395
- class: H(["wd-station__aside", { "is-collapsed": C.value }])
396
- }, [
397
- y("div", {
398
- class: H(["wd-station__logo", { "is-collapsed": C.value }])
399
- }, [
400
- M(e.$slots, "logo", { collapsed: C.value }, () => [
401
- z(u.logo) ? (o(), s(n, {
402
- key: 0,
403
- class: "wd-station__logo-icon"
404
- }, {
405
- default: l(() => [
406
- (o(), s(G(z(u.logo))))
407
- ]),
408
- _: 1
409
- })) : k("", !0),
410
- We(y("span", { class: "wd-station__logo-title" }, A(u.title), 513), [
411
- [De, !C.value]
412
- ])
413
- ], !0)
414
- ], 2),
415
- M(e.$slots, "menu-top", { collapsed: C.value }, void 0, !0),
416
- d(c, { class: "wd-station__menu-scroll" }, {
417
- default: l(() => [
418
- d(a, {
419
- class: "wd-station__menu",
420
- collapse: C.value,
421
- "default-active": b.value
422
- }, {
423
- default: l(() => {
424
- var i;
425
- return [
426
- u.headerMode === "title" || u.headerMode === "both" ? (o(), _(N, { key: 0 }, [
427
- $.value.length > 1 ? (o(!0), _(N, { key: 0 }, O($.value, (K) => (o(), s(f, {
428
- key: K.key,
429
- title: K.title
430
- }, {
431
- default: l(() => [
432
- d(Q, {
433
- items: K.menus,
434
- onSelect: J
435
- }, null, 8, ["items"])
436
- ]),
437
- _: 2
438
- }, 1032, ["title"]))), 128)) : (o(), s(Q, {
439
- key: 1,
440
- items: ((i = $.value[0]) == null ? void 0 : i.menus) || [],
441
- onSelect: J
442
- }, null, 8, ["items"]))
443
- ], 64)) : (o(), s(Q, {
444
- key: 1,
445
- items: ce.value,
446
- onSelect: J
447
- }, null, 8, ["items"]))
448
- ];
449
- }),
450
- _: 1
451
- }, 8, ["collapse", "default-active"])
452
- ]),
453
- _: 1
454
- }),
455
- M(e.$slots, "menu-bottom", { collapsed: C.value }, void 0, !0)
456
- ], 2)) : k("", !0),
457
- y("div", bt, [
458
- y("header", Ct, [
459
- y("div", St, [
460
- u.collapsible && u.menuMode !== "none" ? (o(), s(n, {
461
- key: 0,
462
- class: "wd-station__collapse",
463
- onClick: lt
464
- }, {
465
- default: l(() => [
466
- u.menuMode === "side" && !C.value ? (o(), s(x(pt), { key: 0 })) : u.menuMode === "side" ? (o(), s(x(yt), { key: 1 })) : C.value ? (o(), s(x(ze), { key: 3 })) : (o(), s(x(ht), { key: 2 }))
467
- ]),
468
- _: 1
469
- })) : k("", !0),
470
- u.menuMode !== "side" ? (o(), _("div", Mt, [
471
- M(e.$slots, "logo", { collapsed: C.value }, () => [
472
- z(u.logo) ? (o(), s(n, {
473
- key: 0,
474
- class: "wd-station__logo-icon"
475
- }, {
476
- default: l(() => [
477
- (o(), s(G(z(u.logo))))
478
- ]),
479
- _: 1
480
- })) : k("", !0),
481
- y("span", xt, A(u.title), 1)
482
- ], !0)
483
- ])) : k("", !0),
484
- (o(!0), _(N, null, O(nt.value, (i) => (o(), _(N, { key: i }, [
485
- i === "refresh" ? (o(), s(n, {
486
- key: 0,
487
- "data-tool": "refresh",
488
- class: "wd-station__tool",
489
- onClick: U
490
- }, {
491
- default: l(() => [
492
- d(x(Ke))
493
- ]),
494
- _: 1
495
- })) : i === "settings" ? (o(), s(n, {
496
- key: 1,
497
- "data-tool": "settings",
498
- class: "wd-station__tool",
499
- onClick: ye
500
- }, {
501
- default: l(() => [
502
- d(x(Le))
503
- ]),
504
- _: 1
505
- })) : i === "user" ? (o(), s(ie, {
506
- key: 2,
507
- "data-tool": "user",
508
- class: "wd-station__tool",
509
- trigger: "click"
510
- }, {
511
- dropdown: l(() => [
512
- d(ae, null, {
513
- default: l(() => [
514
- d(E, { onClick: ge }, {
515
- default: l(() => [...t[0] || (t[0] = [
516
- T("退出登录", -1)
517
- ])]),
518
- _: 1
519
- })
520
- ]),
521
- _: 1
522
- })
523
- ]),
524
- default: l(() => [
525
- y("span", At, [
526
- d(S, {
527
- size: 24,
528
- src: u.userAvatar || void 0
529
- }, {
530
- default: l(() => [
531
- T(A(pe.value), 1)
532
- ]),
533
- _: 1
534
- }, 8, ["src"]),
535
- y("span", $t, A(u.userName), 1)
536
- ])
537
- ]),
538
- _: 1
539
- })) : i === "login" ? (o(), s(Ge, {
540
- key: 3,
541
- "data-tool": "login",
542
- size: "small",
543
- onClick: he
544
- }, {
545
- default: l(() => [...t[1] || (t[1] = [
546
- T("登录", -1)
547
- ])]),
548
- _: 1
549
- })) : k("", !0)
550
- ], 64))), 128)),
551
- M(e.$slots, "header-left", {}, void 0, !0)
552
- ]),
553
- y("div", It, [
554
- Re.value ? (o(), _("nav", Tt, [
555
- (o(!0), _(N, null, O($.value, (i) => (o(), _("span", {
556
- key: i.key,
557
- class: H(["wd-station__nav-item", { "is-active": i.key === de.value }]),
558
- onClick: (K) => Je(i.key)
559
- }, [
560
- z(i.icon) ? (o(), s(n, { key: 0 }, {
561
- default: l(() => [
562
- (o(), s(G(z(i.icon))))
563
- ]),
564
- _: 2
565
- }, 1024)) : k("", !0),
566
- T(" " + A(i.title), 1)
567
- ], 10, Nt))), 128))
568
- ])) : (o(), _("span", Et, A(u.title), 1)),
569
- M(e.$slots, "header-center", {}, void 0, !0)
570
- ]),
571
- y("div", Gt, [
572
- M(e.$slots, "header-right", {}, void 0, !0),
573
- (o(!0), _(N, null, O(ot.value, (i) => (o(), _(N, { key: i }, [
574
- i === "refresh" ? (o(), s(n, {
575
- key: 0,
576
- "data-tool": "refresh",
577
- class: "wd-station__tool",
578
- onClick: U
579
- }, {
580
- default: l(() => [
581
- d(x(Ke))
582
- ]),
583
- _: 1
584
- })) : i === "settings" ? (o(), s(n, {
585
- key: 1,
586
- "data-tool": "settings",
587
- class: "wd-station__tool",
588
- onClick: ye
589
- }, {
590
- default: l(() => [
591
- d(x(Le))
592
- ]),
593
- _: 1
594
- })) : i === "user" ? (o(), s(ie, {
595
- key: 2,
596
- "data-tool": "user",
597
- class: "wd-station__tool",
598
- trigger: "click"
599
- }, {
600
- dropdown: l(() => [
601
- d(ae, null, {
602
- default: l(() => [
603
- d(E, { onClick: ge }, {
604
- default: l(() => [...t[2] || (t[2] = [
605
- T("退出登录", -1)
606
- ])]),
607
- _: 1
608
- })
609
- ]),
610
- _: 1
611
- })
612
- ]),
613
- default: l(() => [
614
- y("span", Bt, [
615
- d(S, {
616
- size: 24,
617
- src: u.userAvatar || void 0
618
- }, {
619
- default: l(() => [
620
- T(A(pe.value), 1)
621
- ]),
622
- _: 1
623
- }, 8, ["src"]),
624
- y("span", Wt, A(u.userName), 1)
625
- ])
626
- ]),
627
- _: 1
628
- })) : i === "login" ? (o(), s(Ge, {
629
- key: 3,
630
- "data-tool": "login",
631
- size: "small",
632
- onClick: he
633
- }, {
634
- default: l(() => [...t[3] || (t[3] = [
635
- T("登录", -1)
636
- ])]),
637
- _: 1
638
- })) : k("", !0)
639
- ], 64))), 128))
640
- ])
641
- ]),
642
- u.menuMode === "top" ? We((o(), _("div", Dt, [
643
- M(e.$slots, "top-menu-left", {}, void 0, !0),
644
- d(a, {
645
- mode: "horizontal",
646
- "default-active": b.value
647
- }, {
648
- default: l(() => [
649
- d(Q, {
650
- items: ce.value,
651
- onSelect: J
652
- }, null, 8, ["items"])
653
- ]),
654
- _: 1
655
- }, 8, ["default-active"]),
656
- M(e.$slots, "top-menu-right", {}, void 0, !0)
657
- ], 512)), [
658
- [De, !C.value]
659
- ]) : k("", !0),
660
- u.contentMode === "tabs" ? (o(), _("div", zt, [
661
- M(e.$slots, "tabs-left", {}, void 0, !0),
662
- d(rt, {
663
- "model-value": b.value,
664
- type: "card",
665
- class: "wd-station__tabs"
666
- }, {
667
- default: l(() => [
668
- (o(!0), _(N, null, O(I.value, (i) => (o(), s(ut, {
669
- key: i.key,
670
- name: i.key
671
- }, {
672
- label: l(() => [
673
- y("span", {
674
- class: "wd-station__tab-label",
675
- onClick: (K) => Ue(i)
676
- }, A(i.title), 9, Kt),
677
- i.affix ? k("", !0) : (o(), s(n, {
678
- key: 0,
679
- class: "wd-station__tab-close",
680
- onClick: _t((K) => le(i.key), ["stop"])
681
- }, {
682
- default: l(() => [
683
- d(x(gt))
684
- ]),
685
- _: 1
686
- }, 8, ["onClick"]))
687
- ]),
688
- _: 2
689
- }, 1032, ["name"]))), 128))
690
- ]),
691
- _: 1
692
- }, 8, ["model-value"]),
693
- d(ie, {
694
- class: "wd-station__tabs-actions",
695
- trigger: "click"
696
- }, {
697
- dropdown: l(() => [
698
- d(ae, null, {
699
- default: l(() => [
700
- d(E, {
701
- disabled: !Ye.value,
702
- onClick: qe
703
- }, {
704
- default: l(() => [...t[4] || (t[4] = [
705
- T("关闭当前标签", -1)
706
- ])]),
707
- _: 1
708
- }, 8, ["disabled"]),
709
- d(E, {
710
- disabled: !Ze.value,
711
- onClick: He
712
- }, {
713
- default: l(() => [...t[5] || (t[5] = [
714
- T("关闭左侧标签", -1)
715
- ])]),
716
- _: 1
717
- }, 8, ["disabled"]),
718
- d(E, {
719
- disabled: !et.value,
720
- onClick: Qe
721
- }, {
722
- default: l(() => [...t[6] || (t[6] = [
723
- T("关闭其他标签", -1)
724
- ])]),
725
- _: 1
726
- }, 8, ["disabled"]),
727
- d(E, {
728
- disabled: !tt.value,
729
- onClick: Xe
730
- }, {
731
- default: l(() => [...t[7] || (t[7] = [
732
- T("关闭所有标签", -1)
733
- ])]),
734
- _: 1
735
- }, 8, ["disabled"])
736
- ]),
737
- _: 1
738
- })
739
- ]),
740
- default: l(() => [
741
- y("span", Lt, [
742
- d(n, null, {
743
- default: l(() => [
744
- d(x(ze))
745
- ]),
746
- _: 1
747
- })
748
- ])
749
- ]),
750
- _: 1
751
- }),
752
- M(e.$slots, "tabs-right", {}, void 0, !0)
753
- ])) : k("", !0),
754
- y("main", Ot, [
755
- (o(), _("div", {
756
- key: me.value,
757
- class: "wd-station__content-inner"
758
- }, [
759
- W.value && x(B) ? (o(), _(N, { key: 0 }, [
760
- u.keepAlive ? (o(), s(vt, { key: 0 }, [
761
- (o(), s(G(x(B))))
762
- ], 1024)) : (o(), s(G(x(B)), { key: 1 }))
763
- ], 64)) : M(e.$slots, "default", {}, void 0, !0, 1)
764
- ]))
765
- ]),
766
- y("footer", Vt, [
767
- M(e.$slots, "footer", {}, () => [
768
- be.value ? (o(), _("span", Ft, A(be.value), 1)) : k("", !0),
769
- u.copyright ? (o(), _("span", Rt, A(u.copyright), 1)) : k("", !0)
770
- ], !0)
771
- ])
772
- ])
773
- ], 2);
774
- };
775
- }
776
- }), Qt = /* @__PURE__ */ Fe(Pt, [["__scopeId", "data-v-0884c1d0"]]);
777
- export {
778
- Qt as W
779
- };
780
- //# sourceMappingURL=Station-DLV19USa.mjs.map