xto-fronted 0.4.48 → 0.4.50

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.
@@ -0,0 +1,475 @@
1
+ import { defineComponent as O, ref as N, computed as z, reactive as $, onMounted as Y, openBlock as V, createElementBlock as k, createVNode as a, unref as e, withCtx as o, createElementVNode as n, createTextVNode as m, Fragment as g, renderList as x, toDisplayString as i, createCommentVNode as h } from "vue";
2
+ import { Form as q, FormItem as p, Input as v, Select as F, InputNumber as j, Switch as A } from "@xto/form";
3
+ import { Card as G, Tag as c } from "@xto/data";
4
+ import { Modal as H, Message as J } from "@xto/feedback";
5
+ import { Button as E, Space as D } from "@xto/base";
6
+ import { S as r, M as u, b as K, _ as P } from "./index-DKN4xsXi.js";
7
+ const Q = { class: "menu-page" }, W = { class: "toolbar" }, X = { class: "menu-tree" }, Z = { class: "tree-table" }, ee = { class: "tree-row tree-row--level-0" }, te = ["onClick"], le = ["onClick"], ae = /* @__PURE__ */ O({
8
+ __name: "index",
9
+ setup(ne) {
10
+ const R = [
11
+ {
12
+ id: 1,
13
+ parentId: null,
14
+ name: "Dashboard",
15
+ path: "/dashboard",
16
+ component: "dashboard/index",
17
+ redirect: "",
18
+ icon: "dashboard",
19
+ title: "仪表盘",
20
+ type: u.MENU,
21
+ sort: 1,
22
+ status: r.ENABLED,
23
+ hidden: !1,
24
+ keepAlive: !0
25
+ },
26
+ {
27
+ id: 2,
28
+ parentId: null,
29
+ name: "System",
30
+ path: "/system",
31
+ component: "",
32
+ redirect: "/system/user",
33
+ icon: "setting",
34
+ title: "系统管理",
35
+ type: u.DIRECTORY,
36
+ sort: 2,
37
+ status: r.ENABLED,
38
+ hidden: !1,
39
+ keepAlive: !1,
40
+ children: [
41
+ {
42
+ id: 21,
43
+ parentId: 2,
44
+ name: "SystemUser",
45
+ path: "/system/user",
46
+ component: "system/user/index",
47
+ redirect: "",
48
+ icon: "user",
49
+ title: "用户管理",
50
+ type: u.MENU,
51
+ sort: 1,
52
+ status: r.ENABLED,
53
+ hidden: !1,
54
+ keepAlive: !0
55
+ },
56
+ {
57
+ id: 22,
58
+ parentId: 2,
59
+ name: "SystemRole",
60
+ path: "/system/role",
61
+ component: "system/role/index",
62
+ redirect: "",
63
+ icon: "role",
64
+ title: "角色管理",
65
+ type: u.MENU,
66
+ sort: 2,
67
+ status: r.ENABLED,
68
+ hidden: !1,
69
+ keepAlive: !0
70
+ },
71
+ {
72
+ id: 23,
73
+ parentId: 2,
74
+ name: "SystemMenu",
75
+ path: "/system/menu",
76
+ component: "system/menu/index",
77
+ redirect: "",
78
+ icon: "menu",
79
+ title: "菜单管理",
80
+ type: u.MENU,
81
+ sort: 3,
82
+ status: r.ENABLED,
83
+ hidden: !1,
84
+ keepAlive: !0
85
+ }
86
+ ]
87
+ }
88
+ ], U = N(!1), C = N([]), y = N(!1), S = z(() => s.id ? "编辑菜单" : "新增菜单"), s = $({
89
+ id: 0,
90
+ parentId: null,
91
+ name: "",
92
+ path: "",
93
+ component: "",
94
+ redirect: "",
95
+ icon: "",
96
+ title: "",
97
+ type: u.MENU,
98
+ sort: 0,
99
+ status: r.ENABLED,
100
+ hidden: !1,
101
+ keepAlive: !0
102
+ }), w = {
103
+ name: [
104
+ { required: !0, message: "请输入菜单名称", trigger: "blur" }
105
+ ],
106
+ path: [
107
+ { required: !0, message: "请输入路由路径", trigger: "blur" }
108
+ ],
109
+ title: [
110
+ { required: !0, message: "请输入菜单标题", trigger: "blur" }
111
+ ]
112
+ }, M = N(), I = () => {
113
+ U.value = !0, setTimeout(() => {
114
+ C.value = R, U.value = !1;
115
+ }, 300);
116
+ }, B = (f = null) => {
117
+ Object.assign(s, {
118
+ id: 0,
119
+ parentId: f,
120
+ name: "",
121
+ path: "",
122
+ component: "",
123
+ redirect: "",
124
+ icon: "",
125
+ title: "",
126
+ type: u.MENU,
127
+ sort: 0,
128
+ status: r.ENABLED,
129
+ hidden: !1,
130
+ keepAlive: !0
131
+ }), y.value = !0;
132
+ }, b = (f) => {
133
+ Object.assign(s, f), y.value = !0;
134
+ }, T = async () => {
135
+ var f;
136
+ try {
137
+ await ((f = M.value) == null ? void 0 : f.validate()), J.success(s.id ? "编辑成功" : "新增成功"), y.value = !1, I();
138
+ } catch (t) {
139
+ console.error(t);
140
+ }
141
+ }, L = (f) => ({
142
+ dashboard: "📊",
143
+ system: "⚙️",
144
+ user: "👤",
145
+ role: "👥",
146
+ menu: "📋",
147
+ setting: "🔧"
148
+ })[f || ""] || "📄";
149
+ return Y(() => {
150
+ I();
151
+ }), (f, t) => (V(), k("div", Q, [
152
+ a(e(G), { class: "menu-card" }, {
153
+ default: o(() => [
154
+ n("div", W, [
155
+ a(e(E), {
156
+ type: "primary",
157
+ onClick: t[0] || (t[0] = (l) => B())
158
+ }, {
159
+ default: o(() => [...t[14] || (t[14] = [
160
+ m("新增菜单", -1)
161
+ ])]),
162
+ _: 1
163
+ })
164
+ ]),
165
+ n("div", X, [
166
+ n("table", Z, [
167
+ t[19] || (t[19] = n("thead", null, [
168
+ n("tr", null, [
169
+ n("th", null, "菜单名称"),
170
+ n("th", null, "图标"),
171
+ n("th", null, "路由路径"),
172
+ n("th", null, "类型"),
173
+ n("th", null, "排序"),
174
+ n("th", null, "状态"),
175
+ n("th", null, "操作")
176
+ ])
177
+ ], -1)),
178
+ n("tbody", null, [
179
+ (V(!0), k(g, null, x(C.value, (l) => (V(), k(g, {
180
+ key: l.id
181
+ }, [
182
+ n("tr", ee, [
183
+ n("td", null, [
184
+ n("span", {
185
+ class: "menu-name",
186
+ onClick: (d) => b(l)
187
+ }, i(l.title), 9, te)
188
+ ]),
189
+ n("td", null, i(L(l.icon)), 1),
190
+ n("td", null, i(l.path), 1),
191
+ n("td", null, [
192
+ a(e(c), {
193
+ type: l.type === e(u).DIRECTORY ? "primary" : l.type === e(u).MENU ? "success" : "warning",
194
+ size: "small"
195
+ }, {
196
+ default: o(() => [
197
+ m(i(l.type === e(u).DIRECTORY ? "目录" : l.type === e(u).MENU ? "菜单" : "按钮"), 1)
198
+ ]),
199
+ _: 2
200
+ }, 1032, ["type"])
201
+ ]),
202
+ n("td", null, i(l.sort), 1),
203
+ n("td", null, [
204
+ a(e(c), {
205
+ type: l.status === e(r).ENABLED ? "success" : "danger",
206
+ size: "small"
207
+ }, {
208
+ default: o(() => [
209
+ m(i(l.status === e(r).ENABLED ? "启用" : "禁用"), 1)
210
+ ]),
211
+ _: 2
212
+ }, 1032, ["type"])
213
+ ]),
214
+ n("td", null, [
215
+ a(e(D), null, {
216
+ default: o(() => [
217
+ a(e(E), {
218
+ type: "primary",
219
+ link: "",
220
+ size: "small",
221
+ onClick: (d) => B(l.id)
222
+ }, {
223
+ default: o(() => [...t[15] || (t[15] = [
224
+ m("新增", -1)
225
+ ])]),
226
+ _: 1
227
+ }, 8, ["onClick"]),
228
+ a(e(E), {
229
+ type: "primary",
230
+ link: "",
231
+ size: "small",
232
+ onClick: (d) => b(l)
233
+ }, {
234
+ default: o(() => [...t[16] || (t[16] = [
235
+ m("编辑", -1)
236
+ ])]),
237
+ _: 1
238
+ }, 8, ["onClick"])
239
+ ]),
240
+ _: 2
241
+ }, 1024)
242
+ ])
243
+ ]),
244
+ l.children ? (V(!0), k(g, { key: 0 }, x(l.children, (d) => (V(), k("tr", {
245
+ key: d.id,
246
+ class: "tree-row tree-row--level-1"
247
+ }, [
248
+ n("td", null, [
249
+ t[17] || (t[17] = n("span", { class: "tree-indent" }, null, -1)),
250
+ n("span", {
251
+ class: "menu-name",
252
+ onClick: (_) => b(d)
253
+ }, i(d.title), 9, le)
254
+ ]),
255
+ n("td", null, i(L(d.icon)), 1),
256
+ n("td", null, i(d.path), 1),
257
+ n("td", null, [
258
+ a(e(c), {
259
+ type: d.type === e(u).DIRECTORY ? "primary" : d.type === e(u).MENU ? "success" : "warning",
260
+ size: "small"
261
+ }, {
262
+ default: o(() => [
263
+ m(i(d.type === e(u).DIRECTORY ? "目录" : d.type === e(u).MENU ? "菜单" : "按钮"), 1)
264
+ ]),
265
+ _: 2
266
+ }, 1032, ["type"])
267
+ ]),
268
+ n("td", null, i(d.sort), 1),
269
+ n("td", null, [
270
+ a(e(c), {
271
+ type: d.status === e(r).ENABLED ? "success" : "danger",
272
+ size: "small"
273
+ }, {
274
+ default: o(() => [
275
+ m(i(d.status === e(r).ENABLED ? "启用" : "禁用"), 1)
276
+ ]),
277
+ _: 2
278
+ }, 1032, ["type"])
279
+ ]),
280
+ n("td", null, [
281
+ a(e(D), null, {
282
+ default: o(() => [
283
+ a(e(E), {
284
+ type: "primary",
285
+ link: "",
286
+ size: "small",
287
+ onClick: (_) => b(d)
288
+ }, {
289
+ default: o(() => [...t[18] || (t[18] = [
290
+ m("编辑", -1)
291
+ ])]),
292
+ _: 1
293
+ }, 8, ["onClick"])
294
+ ]),
295
+ _: 2
296
+ }, 1024)
297
+ ])
298
+ ]))), 128)) : h("", !0)
299
+ ], 64))), 128))
300
+ ])
301
+ ])
302
+ ])
303
+ ]),
304
+ _: 1
305
+ }),
306
+ a(e(H), {
307
+ modelValue: y.value,
308
+ "onUpdate:modelValue": t[13] || (t[13] = (l) => y.value = l),
309
+ title: S.value,
310
+ width: "600px"
311
+ }, {
312
+ footer: o(() => [
313
+ a(e(D), null, {
314
+ default: o(() => [
315
+ a(e(E), {
316
+ onClick: t[12] || (t[12] = (l) => y.value = !1)
317
+ }, {
318
+ default: o(() => [...t[20] || (t[20] = [
319
+ m("取消", -1)
320
+ ])]),
321
+ _: 1
322
+ }),
323
+ a(e(E), {
324
+ type: "primary",
325
+ onClick: T
326
+ }, {
327
+ default: o(() => [...t[21] || (t[21] = [
328
+ m("确定", -1)
329
+ ])]),
330
+ _: 1
331
+ })
332
+ ]),
333
+ _: 1
334
+ })
335
+ ]),
336
+ default: o(() => [
337
+ a(e(q), {
338
+ ref_key: "formRef",
339
+ ref: M,
340
+ model: s,
341
+ rules: w,
342
+ "label-width": "80px"
343
+ }, {
344
+ default: o(() => [
345
+ a(e(p), { label: "上级菜单" }, {
346
+ default: o(() => [
347
+ a(e(v), {
348
+ modelValue: s.parentId,
349
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => s.parentId = l),
350
+ placeholder: "上级菜单ID",
351
+ disabled: ""
352
+ }, null, 8, ["modelValue"])
353
+ ]),
354
+ _: 1
355
+ }),
356
+ a(e(p), { label: "菜单类型" }, {
357
+ default: o(() => [
358
+ a(e(F), {
359
+ modelValue: s.type,
360
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => s.type = l),
361
+ options: e(K)
362
+ }, null, 8, ["modelValue", "options"])
363
+ ]),
364
+ _: 1
365
+ }),
366
+ a(e(p), {
367
+ label: "菜单名称",
368
+ prop: "name"
369
+ }, {
370
+ default: o(() => [
371
+ a(e(v), {
372
+ modelValue: s.name,
373
+ "onUpdate:modelValue": t[3] || (t[3] = (l) => s.name = l),
374
+ placeholder: "请输入菜单名称(路由name)"
375
+ }, null, 8, ["modelValue"])
376
+ ]),
377
+ _: 1
378
+ }),
379
+ a(e(p), {
380
+ label: "菜单标题",
381
+ prop: "title"
382
+ }, {
383
+ default: o(() => [
384
+ a(e(v), {
385
+ modelValue: s.title,
386
+ "onUpdate:modelValue": t[4] || (t[4] = (l) => s.title = l),
387
+ placeholder: "请输入菜单标题"
388
+ }, null, 8, ["modelValue"])
389
+ ]),
390
+ _: 1
391
+ }),
392
+ a(e(p), {
393
+ label: "路由路径",
394
+ prop: "path"
395
+ }, {
396
+ default: o(() => [
397
+ a(e(v), {
398
+ modelValue: s.path,
399
+ "onUpdate:modelValue": t[5] || (t[5] = (l) => s.path = l),
400
+ placeholder: "请输入路由路径"
401
+ }, null, 8, ["modelValue"])
402
+ ]),
403
+ _: 1
404
+ }),
405
+ a(e(p), { label: "组件路径" }, {
406
+ default: o(() => [
407
+ a(e(v), {
408
+ modelValue: s.component,
409
+ "onUpdate:modelValue": t[6] || (t[6] = (l) => s.component = l),
410
+ placeholder: "请输入组件路径"
411
+ }, null, 8, ["modelValue"])
412
+ ]),
413
+ _: 1
414
+ }),
415
+ a(e(p), { label: "图标" }, {
416
+ default: o(() => [
417
+ a(e(v), {
418
+ modelValue: s.icon,
419
+ "onUpdate:modelValue": t[7] || (t[7] = (l) => s.icon = l),
420
+ placeholder: "请输入图标名称"
421
+ }, null, 8, ["modelValue"])
422
+ ]),
423
+ _: 1
424
+ }),
425
+ a(e(p), { label: "排序" }, {
426
+ default: o(() => [
427
+ a(e(j), {
428
+ modelValue: s.sort,
429
+ "onUpdate:modelValue": t[8] || (t[8] = (l) => s.sort = l),
430
+ min: 0
431
+ }, null, 8, ["modelValue"])
432
+ ]),
433
+ _: 1
434
+ }),
435
+ a(e(p), { label: "状态" }, {
436
+ default: o(() => [
437
+ a(e(A), {
438
+ modelValue: s.status,
439
+ "onUpdate:modelValue": t[9] || (t[9] = (l) => s.status = l),
440
+ "active-value": e(r).ENABLED,
441
+ "inactive-value": e(r).DISABLED
442
+ }, null, 8, ["modelValue", "active-value", "inactive-value"])
443
+ ]),
444
+ _: 1
445
+ }),
446
+ a(e(p), { label: "隐藏" }, {
447
+ default: o(() => [
448
+ a(e(A), {
449
+ modelValue: s.hidden,
450
+ "onUpdate:modelValue": t[10] || (t[10] = (l) => s.hidden = l)
451
+ }, null, 8, ["modelValue"])
452
+ ]),
453
+ _: 1
454
+ }),
455
+ a(e(p), { label: "缓存" }, {
456
+ default: o(() => [
457
+ a(e(A), {
458
+ modelValue: s.keepAlive,
459
+ "onUpdate:modelValue": t[11] || (t[11] = (l) => s.keepAlive = l)
460
+ }, null, 8, ["modelValue"])
461
+ ]),
462
+ _: 1
463
+ })
464
+ ]),
465
+ _: 1
466
+ }, 8, ["model"])
467
+ ]),
468
+ _: 1
469
+ }, 8, ["modelValue", "title"])
470
+ ]));
471
+ }
472
+ }), pe = /* @__PURE__ */ P(ae, [["__scopeId", "data-v-2a272a68"]]);
473
+ export {
474
+ pe as default
475
+ };
@@ -0,0 +1,142 @@
1
+ import { defineComponent as g, ref as r, resolveComponent as x, openBlock as o, createElementBlock as c, createElementVNode as s, Fragment as d, renderList as m, createBlock as u, unref as l, withCtx as i, normalizeStyle as p, toDisplayString as a, createVNode as n, createTextVNode as q } from "vue";
2
+ import { Card as _, Tag as C, Progress as y } from "@xto/data";
3
+ import { _ as V } from "./index-DKN4xsXi.js";
4
+ const B = { class: "dashboard" }, L = { class: "dashboard__stats" }, N = { class: "stat-card__content" }, S = { class: "stat-card__info" }, w = { class: "stat-card__title" }, z = { class: "dashboard__main" }, E = { class: "quick-links" }, I = { class: "quick-link__icon" }, T = { class: "quick-link__title" }, D = { class: "activity-list" }, F = { class: "activity-item__action" }, P = { class: "activity-item__time" }, U = { class: "system-info" }, j = { class: "system-info__item" }, A = { class: "system-info__item" }, G = /* @__PURE__ */ g({
5
+ __name: "index",
6
+ setup(H) {
7
+ const f = r([
8
+ { title: "用户总数", value: 1234, icon: "👥", color: "#409eff" },
9
+ { title: "今日访问", value: 567, icon: "👀", color: "#67c23a" },
10
+ { title: "订单数量", value: 890, icon: "📦", color: "#e6a23c" },
11
+ { title: "销售金额", value: 123456, icon: "💰", color: "#f56c6c" }
12
+ ]), v = r([
13
+ { user: "张三", action: "登录系统", time: "2分钟前", type: "success" },
14
+ { user: "李四", action: "修改了用户信息", time: "5分钟前", type: "warning" },
15
+ { user: "王五", action: "创建了新订单", time: "10分钟前", type: "info" },
16
+ { user: "赵六", action: "删除了测试数据", time: "30分钟前", type: "danger" },
17
+ { user: "钱七", action: "更新了系统配置", time: "1小时前", type: "primary" }
18
+ ]), k = r([
19
+ { title: "用户管理", path: "/system/user", icon: "👤" },
20
+ { title: "角色管理", path: "/system/role", icon: "👥" },
21
+ { title: "菜单管理", path: "/system/menu", icon: "📋" },
22
+ { title: "系统设置", path: "/system", icon: "⚙️" }
23
+ ]);
24
+ return (J, t) => {
25
+ const b = x("router-link");
26
+ return o(), c("div", B, [
27
+ s("div", L, [
28
+ (o(!0), c(d, null, m(f.value, (e) => (o(), u(l(_), {
29
+ key: e.title,
30
+ class: "stat-card"
31
+ }, {
32
+ default: i(() => [
33
+ s("div", N, [
34
+ s("div", {
35
+ class: "stat-card__icon",
36
+ style: p({ backgroundColor: e.color + "20" })
37
+ }, a(e.icon), 5),
38
+ s("div", S, [
39
+ s("div", w, a(e.title), 1),
40
+ s("div", {
41
+ class: "stat-card__value",
42
+ style: p({ color: e.color })
43
+ }, a(e.value.toLocaleString()), 5)
44
+ ])
45
+ ])
46
+ ]),
47
+ _: 2
48
+ }, 1024))), 128))
49
+ ]),
50
+ s("div", z, [
51
+ n(l(_), { class: "dashboard__quick" }, {
52
+ header: i(() => [...t[0] || (t[0] = [
53
+ s("span", { class: "card-title" }, "快捷入口", -1)
54
+ ])]),
55
+ default: i(() => [
56
+ s("div", E, [
57
+ (o(!0), c(d, null, m(k.value, (e) => (o(), u(b, {
58
+ key: e.path,
59
+ to: e.path,
60
+ class: "quick-link"
61
+ }, {
62
+ default: i(() => [
63
+ s("span", I, a(e.icon), 1),
64
+ s("span", T, a(e.title), 1)
65
+ ]),
66
+ _: 2
67
+ }, 1032, ["to"]))), 128))
68
+ ])
69
+ ]),
70
+ _: 1
71
+ }),
72
+ n(l(_), { class: "dashboard__activity" }, {
73
+ header: i(() => [...t[1] || (t[1] = [
74
+ s("span", { class: "card-title" }, "最近活动", -1)
75
+ ])]),
76
+ default: i(() => [
77
+ s("div", D, [
78
+ (o(!0), c(d, null, m(v.value, (e, h) => (o(), c("div", {
79
+ key: h,
80
+ class: "activity-item"
81
+ }, [
82
+ n(l(C), {
83
+ type: e.type,
84
+ size: "small"
85
+ }, {
86
+ default: i(() => [
87
+ q(a(e.user), 1)
88
+ ]),
89
+ _: 2
90
+ }, 1032, ["type"]),
91
+ s("span", F, a(e.action), 1),
92
+ s("span", P, a(e.time), 1)
93
+ ]))), 128))
94
+ ])
95
+ ]),
96
+ _: 1
97
+ })
98
+ ]),
99
+ n(l(_), { class: "dashboard__system" }, {
100
+ header: i(() => [...t[2] || (t[2] = [
101
+ s("span", { class: "card-title" }, "系统信息", -1)
102
+ ])]),
103
+ default: i(() => [
104
+ s("div", U, [
105
+ t[5] || (t[5] = s("div", { class: "system-info__item" }, [
106
+ s("span", { class: "system-info__label" }, "系统版本"),
107
+ s("span", { class: "system-info__value" }, "v1.0.0")
108
+ ], -1)),
109
+ t[6] || (t[6] = s("div", { class: "system-info__item" }, [
110
+ s("span", { class: "system-info__label" }, "Vue 版本"),
111
+ s("span", { class: "system-info__value" }, "3.4.21")
112
+ ], -1)),
113
+ t[7] || (t[7] = s("div", { class: "system-info__item" }, [
114
+ s("span", { class: "system-info__label" }, "构建工具"),
115
+ s("span", { class: "system-info__value" }, "Vite 5")
116
+ ], -1)),
117
+ t[8] || (t[8] = s("div", { class: "system-info__item" }, [
118
+ s("span", { class: "system-info__label" }, "UI 组件库"),
119
+ s("span", { class: "system-info__value" }, "xto")
120
+ ], -1)),
121
+ s("div", j, [
122
+ t[3] || (t[3] = s("span", { class: "system-info__label" }, "服务器状态", -1)),
123
+ n(l(y), {
124
+ percentage: 75,
125
+ status: "success"
126
+ })
127
+ ]),
128
+ s("div", A, [
129
+ t[4] || (t[4] = s("span", { class: "system-info__label" }, "内存使用", -1)),
130
+ n(l(y), { percentage: 45 })
131
+ ])
132
+ ])
133
+ ]),
134
+ _: 1
135
+ })
136
+ ]);
137
+ };
138
+ }
139
+ }), Q = /* @__PURE__ */ V(G, [["__scopeId", "data-v-44648cb1"]]);
140
+ export {
141
+ Q as default
142
+ };