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