xto-fronted 0.8.1 → 0.8.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/App.vue.d.ts +2 -0
- package/dist/api/auth.d.ts +8 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.js +26 -0
- package/dist/api/system.d.ts +16 -0
- package/dist/api/user.d.ts +13 -0
- package/dist/api.d.ts +2 -0
- package/dist/components/Layout/Footer.vue.d.ts +2 -0
- package/dist/components/Layout/Header.vue.d.ts +5 -0
- package/dist/components/Layout/MixTopMenu.vue.d.ts +10 -0
- package/dist/components/Layout/Sidebar.vue.d.ts +13 -0
- package/dist/components/Layout/SidebarMenuItem.vue.d.ts +5 -0
- package/dist/components/Layout/Tabs.vue.d.ts +2 -0
- package/dist/components/Layout/TopMenu.vue.d.ts +10 -0
- package/dist/components/Layout/index.vue.d.ts +7 -0
- package/dist/composables/useApp.d.ts +30 -0
- package/dist/composables/useAuth.d.ts +6 -0
- package/dist/composables/useForm.d.ts +20 -0
- package/dist/composables/useI18n.d.ts +30 -0
- package/dist/composables/useTable.d.ts +29 -0
- package/dist/directives/permission.d.ts +4 -0
- package/dist/enums/index.d.ts +32 -0
- package/dist/index-BUv4yAZa.js +249 -0
- package/dist/index-BiqG4wL6.js +693 -0
- package/dist/index-CbWQsbvq.js +515 -0
- package/dist/index-DGwrd6c8.js +3233 -0
- package/dist/index-WdqGX2ME.js +479 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +99 -0
- package/dist/main.d.ts +0 -0
- package/dist/router/dynamicRoutes.d.ts +30 -0
- package/dist/router/guards.d.ts +17 -0
- package/dist/router/index.d.ts +6 -0
- package/dist/router/layoutRoute.d.ts +23 -0
- package/dist/router/staticRoutes.d.ts +2 -0
- package/dist/stores/app.d.ts +99 -0
- package/dist/stores/auth.d.ts +41 -0
- package/dist/stores/index.d.ts +10 -0
- package/dist/stores/locale.d.ts +42 -0
- package/dist/stores/menu.d.ts +83 -0
- package/dist/stores/user.d.ts +101 -0
- package/dist/style.css +1 -0
- package/dist/user-77I_qZ8j.js +1186 -0
- package/dist/utils/auth.d.ts +27 -0
- package/dist/utils/config.d.ts +51 -0
- package/dist/utils/permission.d.ts +17 -0
- package/dist/utils/request.d.ts +34 -0
- package/dist/utils/storage.d.ts +24 -0
- package/dist/views/dashboard/index.vue.d.ts +2 -0
- package/dist/views/error/403.vue.d.ts +2 -0
- package/dist/views/error/404.vue.d.ts +2 -0
- package/dist/views/login/index.vue.d.ts +4 -0
- package/dist/views/system/menu/index.vue.d.ts +4 -0
- package/dist/views/system/role/index.vue.d.ts +4 -0
- package/dist/views/system/user/index.vue.d.ts +4 -0
- package/package.json +4 -3
- package/dist/assets/404-CY9lyBR9.css +0 -1
- package/dist/assets/404-CrEsfqtj.js +0 -1
- package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +0 -1
- package/dist/assets/index-B8nBpy4E.js +0 -1
- package/dist/assets/index-BRR97dc6.js +0 -1
- package/dist/assets/index-BchLHHD-.css +0 -1
- package/dist/assets/index-BgU3HbjQ.css +0 -1
- package/dist/assets/index-BqdOxC5B.css +0 -1
- package/dist/assets/index-CLoZtSK2.js +0 -1
- package/dist/assets/index-CkkPiTqE.css +0 -1
- package/dist/assets/index-Cpnd7UnC.js +0 -1
- package/dist/assets/index-Cv0DrTS-.js +0 -1
- package/dist/assets/index-D2kfHtV2.css +0 -1
- package/dist/assets/index-DZHiLIP4.css +0 -1
- package/dist/assets/index-DqSiKlWQ.js +0 -1
- package/dist/assets/index-MvUmFZ7W.css +0 -1
- package/dist/assets/index-tlMkJQ1U.js +0 -2
- package/dist/assets/index-yH64PBmh.js +0 -1
- package/dist/assets/vendor-CWD9azq9.js +0 -16
- package/dist/assets/vue-vendor-DPUDwD81.js +0 -29
- package/dist/assets/xto-base-CzY-OLba.css +0 -1
- package/dist/assets/xto-base-S7v-4JRL.js +0 -1
- package/dist/assets/xto-business-ClDUYOqW.css +0 -1
- package/dist/assets/xto-core-CYfxJQ6k.js +0 -1
- package/dist/assets/xto-data-CAFnD72s.js +0 -1
- package/dist/assets/xto-data-D9f39fBv.css +0 -1
- package/dist/assets/xto-feedback-CgD78aUG.js +0 -1
- package/dist/assets/xto-feedback-a2I9QN4T.css +0 -1
- package/dist/assets/xto-form-DK8siTEV.css +0 -1
- package/dist/assets/xto-form-DjKbHEb9.js +0 -1
- package/dist/assets/xto-layout-Bh9dSMYc.css +0 -1
- package/dist/assets/xto-navigation-S9LTvyP5.css +0 -1
- package/dist/assets/xto-navigation-p1HtLM39.js +0 -1
- package/dist/index.html +0 -28
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { defineComponent as P, ref as m, reactive as A, computed as O, onMounted as j, openBlock as _, createElementBlock as k, createElementVNode as e, createVNode as o, unref as l, withCtx as a, withKeys as q, createTextVNode as u, toDisplayString as c, Fragment as K, renderList as G, normalizeClass as J } from "vue";
|
|
2
|
+
import { Form as N, FormItem as v, Input as x, Select as Q, Switch as S } from "@xto/form";
|
|
3
|
+
import { Tag as W, Pagination as X } from "@xto/data";
|
|
4
|
+
import { Popconfirm as Y, Modal as Z, Message as C } from "@xto/feedback";
|
|
5
|
+
import { Space as L, Button as f } from "@xto/base";
|
|
6
|
+
import { S as d, a as ee, _ as te } from "./index-DGwrd6c8.js";
|
|
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
|
+
__name: "index",
|
|
9
|
+
setup(we) {
|
|
10
|
+
const z = [
|
|
11
|
+
{ id: 1, name: "超级管理员", code: "admin", description: "拥有所有权限", status: d.ENABLED, permissions: ["*"], createTime: "2024-01-01 10:00:00" },
|
|
12
|
+
{ id: 2, name: "编辑", code: "editor", description: "内容编辑权限", status: d.ENABLED, permissions: ["user:read", "user:write"], createTime: "2024-01-02 10:00:00" },
|
|
13
|
+
{ id: 3, name: "访客", code: "viewer", description: "只读权限", status: d.ENABLED, permissions: ["user:read"], createTime: "2024-01-03 10:00:00" }
|
|
14
|
+
], V = m(!1), E = m([]), b = m(0), g = m(1), h = m(10), r = A({
|
|
15
|
+
keyword: "",
|
|
16
|
+
status: void 0
|
|
17
|
+
}), y = m(!1), M = O(() => i.id ? "编辑角色" : "新增角色"), i = A({
|
|
18
|
+
id: 0,
|
|
19
|
+
name: "",
|
|
20
|
+
code: "",
|
|
21
|
+
description: "",
|
|
22
|
+
status: d.ENABLED,
|
|
23
|
+
permissions: []
|
|
24
|
+
}), U = {
|
|
25
|
+
name: [
|
|
26
|
+
{ required: !0, message: "请输入角色名称", trigger: "blur" }
|
|
27
|
+
],
|
|
28
|
+
code: [
|
|
29
|
+
{ required: !0, message: "请输入角色编码", trigger: "blur" }
|
|
30
|
+
]
|
|
31
|
+
}, D = m(), p = () => {
|
|
32
|
+
V.value = !0, setTimeout(() => {
|
|
33
|
+
let n = [...z];
|
|
34
|
+
r.keyword && (n = n.filter(
|
|
35
|
+
(t) => t.name.includes(r.keyword) || t.code.includes(r.keyword)
|
|
36
|
+
)), r.status !== void 0 && (n = n.filter((t) => t.status === r.status)), b.value = n.length, E.value = n.slice((g.value - 1) * h.value, g.value * h.value), V.value = !1;
|
|
37
|
+
}, 300);
|
|
38
|
+
}, w = () => {
|
|
39
|
+
g.value = 1, p();
|
|
40
|
+
}, T = () => {
|
|
41
|
+
r.keyword = "", r.status = void 0, g.value = 1, p();
|
|
42
|
+
}, F = () => {
|
|
43
|
+
Object.assign(i, {
|
|
44
|
+
id: 0,
|
|
45
|
+
name: "",
|
|
46
|
+
code: "",
|
|
47
|
+
description: "",
|
|
48
|
+
status: d.ENABLED,
|
|
49
|
+
permissions: []
|
|
50
|
+
}), y.value = !0;
|
|
51
|
+
}, I = (n) => {
|
|
52
|
+
Object.assign(i, n), y.value = !0;
|
|
53
|
+
}, H = (n) => {
|
|
54
|
+
C.success("删除成功"), p();
|
|
55
|
+
}, R = async () => {
|
|
56
|
+
var n;
|
|
57
|
+
try {
|
|
58
|
+
await ((n = D.value) == null ? void 0 : n.validate()), C.success(i.id ? "编辑成功" : "新增成功"), y.value = !1, p();
|
|
59
|
+
} catch (t) {
|
|
60
|
+
console.error(t);
|
|
61
|
+
}
|
|
62
|
+
}, $ = (n) => {
|
|
63
|
+
C.success(`已${n.status === d.ENABLED ? "启用" : "禁用"}角色 ${n.name}`);
|
|
64
|
+
};
|
|
65
|
+
return j(() => {
|
|
66
|
+
p();
|
|
67
|
+
}), (n, t) => (_(), k("div", le, [
|
|
68
|
+
e("div", se, [
|
|
69
|
+
o(l(N), {
|
|
70
|
+
model: r,
|
|
71
|
+
inline: "",
|
|
72
|
+
class: "search-form"
|
|
73
|
+
}, {
|
|
74
|
+
default: a(() => [
|
|
75
|
+
o(l(v), { label: "关键词" }, {
|
|
76
|
+
default: a(() => [
|
|
77
|
+
o(l(x), {
|
|
78
|
+
modelValue: r.keyword,
|
|
79
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => r.keyword = s),
|
|
80
|
+
placeholder: "角色名称/编码",
|
|
81
|
+
clearable: "",
|
|
82
|
+
onKeyup: q(w, ["enter"])
|
|
83
|
+
}, null, 8, ["modelValue"])
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
}),
|
|
87
|
+
o(l(v), { label: "状态" }, {
|
|
88
|
+
default: a(() => [
|
|
89
|
+
o(l(Q), {
|
|
90
|
+
modelValue: r.status,
|
|
91
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => r.status = s),
|
|
92
|
+
options: l(ee),
|
|
93
|
+
placeholder: "请选择",
|
|
94
|
+
clearable: ""
|
|
95
|
+
}, null, 8, ["modelValue", "options"])
|
|
96
|
+
]),
|
|
97
|
+
_: 1
|
|
98
|
+
}),
|
|
99
|
+
o(l(v), null, {
|
|
100
|
+
default: a(() => [
|
|
101
|
+
o(l(L), null, {
|
|
102
|
+
default: a(() => [
|
|
103
|
+
o(l(f), {
|
|
104
|
+
type: "primary",
|
|
105
|
+
onClick: w
|
|
106
|
+
}, {
|
|
107
|
+
icon: a(() => [...t[10] || (t[10] = [
|
|
108
|
+
e("svg", {
|
|
109
|
+
viewBox: "0 0 24 24",
|
|
110
|
+
fill: "none",
|
|
111
|
+
stroke: "currentColor",
|
|
112
|
+
"stroke-width": "2"
|
|
113
|
+
}, [
|
|
114
|
+
e("circle", {
|
|
115
|
+
cx: "11",
|
|
116
|
+
cy: "11",
|
|
117
|
+
r: "8"
|
|
118
|
+
}),
|
|
119
|
+
e("path", { d: "M21 21l-4.35-4.35" })
|
|
120
|
+
], -1)
|
|
121
|
+
])]),
|
|
122
|
+
default: a(() => [
|
|
123
|
+
t[11] || (t[11] = u(" 搜索 ", -1))
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}),
|
|
127
|
+
o(l(f), { onClick: T }, {
|
|
128
|
+
icon: a(() => [...t[12] || (t[12] = [
|
|
129
|
+
e("svg", {
|
|
130
|
+
viewBox: "0 0 24 24",
|
|
131
|
+
fill: "none",
|
|
132
|
+
stroke: "currentColor",
|
|
133
|
+
"stroke-width": "2"
|
|
134
|
+
}, [
|
|
135
|
+
e("path", { d: "M3 12a9 9 0 109-9 9.75 9.75 0 00-6.74 2.74L3 8" }),
|
|
136
|
+
e("path", { d: "M3 3v5h5" })
|
|
137
|
+
], -1)
|
|
138
|
+
])]),
|
|
139
|
+
default: a(() => [
|
|
140
|
+
t[13] || (t[13] = u(" 重置 ", -1))
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
})
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
})
|
|
147
|
+
]),
|
|
148
|
+
_: 1
|
|
149
|
+
})
|
|
150
|
+
]),
|
|
151
|
+
_: 1
|
|
152
|
+
}, 8, ["model"])
|
|
153
|
+
]),
|
|
154
|
+
e("div", oe, [
|
|
155
|
+
e("div", ae, [
|
|
156
|
+
e("div", ne, [
|
|
157
|
+
o(l(f), {
|
|
158
|
+
type: "primary",
|
|
159
|
+
onClick: F
|
|
160
|
+
}, {
|
|
161
|
+
icon: a(() => [...t[14] || (t[14] = [
|
|
162
|
+
e("svg", {
|
|
163
|
+
viewBox: "0 0 24 24",
|
|
164
|
+
fill: "none",
|
|
165
|
+
stroke: "currentColor",
|
|
166
|
+
"stroke-width": "2"
|
|
167
|
+
}, [
|
|
168
|
+
e("line", {
|
|
169
|
+
x1: "12",
|
|
170
|
+
y1: "5",
|
|
171
|
+
x2: "12",
|
|
172
|
+
y2: "19"
|
|
173
|
+
}),
|
|
174
|
+
e("line", {
|
|
175
|
+
x1: "5",
|
|
176
|
+
y1: "12",
|
|
177
|
+
x2: "19",
|
|
178
|
+
y2: "12"
|
|
179
|
+
})
|
|
180
|
+
], -1)
|
|
181
|
+
])]),
|
|
182
|
+
default: a(() => [
|
|
183
|
+
t[15] || (t[15] = u(" 新增角色 ", -1))
|
|
184
|
+
]),
|
|
185
|
+
_: 1
|
|
186
|
+
})
|
|
187
|
+
]),
|
|
188
|
+
e("div", ie, [
|
|
189
|
+
e("span", de, "共 " + c(b.value) + " 条数据", 1)
|
|
190
|
+
])
|
|
191
|
+
]),
|
|
192
|
+
e("div", re, [
|
|
193
|
+
e("table", ue, [
|
|
194
|
+
t[22] || (t[22] = e("thead", null, [
|
|
195
|
+
e("tr", null, [
|
|
196
|
+
e("th", { class: "col-id" }, "ID"),
|
|
197
|
+
e("th", { class: "col-name" }, "角色名称"),
|
|
198
|
+
e("th", { class: "col-code" }, "角色编码"),
|
|
199
|
+
e("th", { class: "col-desc" }, "描述"),
|
|
200
|
+
e("th", { class: "col-status" }, "状态"),
|
|
201
|
+
e("th", { class: "col-time" }, "创建时间"),
|
|
202
|
+
e("th", { class: "col-actions" }, "操作")
|
|
203
|
+
])
|
|
204
|
+
], -1)),
|
|
205
|
+
e("tbody", null, [
|
|
206
|
+
V.value ? (_(), k("tr", ce, [...t[16] || (t[16] = [
|
|
207
|
+
e("td", {
|
|
208
|
+
colspan: "7",
|
|
209
|
+
class: "loading-cell"
|
|
210
|
+
}, [
|
|
211
|
+
e("div", { class: "loading-content" }, [
|
|
212
|
+
e("div", { class: "loading-spinner" }),
|
|
213
|
+
e("span", null, "加载中...")
|
|
214
|
+
])
|
|
215
|
+
], -1)
|
|
216
|
+
])])) : E.value.length === 0 ? (_(), k("tr", pe, [...t[17] || (t[17] = [
|
|
217
|
+
e("td", {
|
|
218
|
+
colspan: "7",
|
|
219
|
+
class: "empty-cell"
|
|
220
|
+
}, [
|
|
221
|
+
e("div", { class: "empty-content" }, [
|
|
222
|
+
e("svg", {
|
|
223
|
+
viewBox: "0 0 64 41",
|
|
224
|
+
fill: "none"
|
|
225
|
+
}, [
|
|
226
|
+
e("g", { transform: "translate(0 1)" }, [
|
|
227
|
+
e("ellipse", {
|
|
228
|
+
fill: "#f5f5f5",
|
|
229
|
+
cx: "32",
|
|
230
|
+
cy: "33",
|
|
231
|
+
rx: "32",
|
|
232
|
+
ry: "7"
|
|
233
|
+
}),
|
|
234
|
+
e("g", {
|
|
235
|
+
stroke: "var(--xto-color-text-placeholder, #A9AEB8)",
|
|
236
|
+
"stroke-width": "2"
|
|
237
|
+
}, [
|
|
238
|
+
e("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }),
|
|
239
|
+
e("path", {
|
|
240
|
+
d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35H11.95C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
|
|
241
|
+
fill: "var(--xto-fill-color, #F2F3F5)"
|
|
242
|
+
})
|
|
243
|
+
])
|
|
244
|
+
])
|
|
245
|
+
]),
|
|
246
|
+
e("span", null, "暂无数据")
|
|
247
|
+
])
|
|
248
|
+
], -1)
|
|
249
|
+
])])) : (_(!0), k(K, { key: 2 }, G(E.value, (s) => (_(), k("tr", {
|
|
250
|
+
key: s.id,
|
|
251
|
+
class: "data-row"
|
|
252
|
+
}, [
|
|
253
|
+
e("td", me, [
|
|
254
|
+
e("span", ve, c(s.id), 1)
|
|
255
|
+
]),
|
|
256
|
+
e("td", fe, [
|
|
257
|
+
e("span", ge, c(s.name), 1)
|
|
258
|
+
]),
|
|
259
|
+
e("td", ye, [
|
|
260
|
+
o(l(W), {
|
|
261
|
+
type: "primary",
|
|
262
|
+
size: "small"
|
|
263
|
+
}, {
|
|
264
|
+
default: a(() => [
|
|
265
|
+
u(c(s.code), 1)
|
|
266
|
+
]),
|
|
267
|
+
_: 2
|
|
268
|
+
}, 1024)
|
|
269
|
+
]),
|
|
270
|
+
e("td", _e, [
|
|
271
|
+
e("span", ke, c(s.description), 1)
|
|
272
|
+
]),
|
|
273
|
+
e("td", he, [
|
|
274
|
+
e("div", xe, [
|
|
275
|
+
o(l(S), {
|
|
276
|
+
"model-value": s.status === l(d).ENABLED,
|
|
277
|
+
"onUpdate:modelValue": (B) => {
|
|
278
|
+
s.status = B ? l(d).ENABLED : l(d).DISABLED, $(s);
|
|
279
|
+
}
|
|
280
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
281
|
+
e("span", {
|
|
282
|
+
class: J(["status-text", { enabled: s.status === l(d).ENABLED }])
|
|
283
|
+
}, c(s.status === l(d).ENABLED ? "已启用" : "已禁用"), 3)
|
|
284
|
+
])
|
|
285
|
+
]),
|
|
286
|
+
e("td", Ve, [
|
|
287
|
+
e("span", Ee, c(s.createTime), 1)
|
|
288
|
+
]),
|
|
289
|
+
e("td", be, [
|
|
290
|
+
o(l(L), { class: "action-buttons" }, {
|
|
291
|
+
default: a(() => [
|
|
292
|
+
o(l(f), {
|
|
293
|
+
type: "primary",
|
|
294
|
+
link: "",
|
|
295
|
+
size: "small",
|
|
296
|
+
onClick: (B) => I(s)
|
|
297
|
+
}, {
|
|
298
|
+
icon: a(() => [...t[18] || (t[18] = [
|
|
299
|
+
e("svg", {
|
|
300
|
+
viewBox: "0 0 24 24",
|
|
301
|
+
fill: "none",
|
|
302
|
+
stroke: "currentColor",
|
|
303
|
+
"stroke-width": "2"
|
|
304
|
+
}, [
|
|
305
|
+
e("path", { d: "M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7" }),
|
|
306
|
+
e("path", { d: "M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
307
|
+
], -1)
|
|
308
|
+
])]),
|
|
309
|
+
default: a(() => [
|
|
310
|
+
t[19] || (t[19] = u(" 编辑 ", -1))
|
|
311
|
+
]),
|
|
312
|
+
_: 1
|
|
313
|
+
}, 8, ["onClick"]),
|
|
314
|
+
o(l(Y), {
|
|
315
|
+
title: "确定删除该角色吗?",
|
|
316
|
+
onConfirm: (B) => H(s.id)
|
|
317
|
+
}, {
|
|
318
|
+
default: a(() => [
|
|
319
|
+
o(l(f), {
|
|
320
|
+
type: "danger",
|
|
321
|
+
link: "",
|
|
322
|
+
size: "small"
|
|
323
|
+
}, {
|
|
324
|
+
icon: a(() => [...t[20] || (t[20] = [
|
|
325
|
+
e("svg", {
|
|
326
|
+
viewBox: "0 0 24 24",
|
|
327
|
+
fill: "none",
|
|
328
|
+
stroke: "currentColor",
|
|
329
|
+
"stroke-width": "2"
|
|
330
|
+
}, [
|
|
331
|
+
e("polyline", { points: "3,6 5,6 21,6" }),
|
|
332
|
+
e("path", { d: "M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" }),
|
|
333
|
+
e("line", {
|
|
334
|
+
x1: "10",
|
|
335
|
+
y1: "11",
|
|
336
|
+
x2: "10",
|
|
337
|
+
y2: "17"
|
|
338
|
+
}),
|
|
339
|
+
e("line", {
|
|
340
|
+
x1: "14",
|
|
341
|
+
y1: "11",
|
|
342
|
+
x2: "14",
|
|
343
|
+
y2: "17"
|
|
344
|
+
})
|
|
345
|
+
], -1)
|
|
346
|
+
])]),
|
|
347
|
+
default: a(() => [
|
|
348
|
+
t[21] || (t[21] = u(" 删除 ", -1))
|
|
349
|
+
]),
|
|
350
|
+
_: 1
|
|
351
|
+
})
|
|
352
|
+
]),
|
|
353
|
+
_: 1
|
|
354
|
+
}, 8, ["onConfirm"])
|
|
355
|
+
]),
|
|
356
|
+
_: 2
|
|
357
|
+
}, 1024)
|
|
358
|
+
])
|
|
359
|
+
]))), 128))
|
|
360
|
+
])
|
|
361
|
+
])
|
|
362
|
+
]),
|
|
363
|
+
e("div", Be, [
|
|
364
|
+
o(l(X), {
|
|
365
|
+
"current-page": g.value,
|
|
366
|
+
"onUpdate:currentPage": t[2] || (t[2] = (s) => g.value = s),
|
|
367
|
+
"page-size": h.value,
|
|
368
|
+
"onUpdate:pageSize": t[3] || (t[3] = (s) => h.value = s),
|
|
369
|
+
total: b.value,
|
|
370
|
+
"page-sizes": [10, 20, 50, 100],
|
|
371
|
+
layout: "total, sizes, prev, pager, next",
|
|
372
|
+
onCurrentChange: p,
|
|
373
|
+
onSizeChange: p
|
|
374
|
+
}, null, 8, ["current-page", "page-size", "total"])
|
|
375
|
+
])
|
|
376
|
+
]),
|
|
377
|
+
o(l(Z), {
|
|
378
|
+
modelValue: y.value,
|
|
379
|
+
"onUpdate:modelValue": t[9] || (t[9] = (s) => y.value = s),
|
|
380
|
+
title: M.value,
|
|
381
|
+
width: "520px",
|
|
382
|
+
class: "role-modal"
|
|
383
|
+
}, {
|
|
384
|
+
footer: a(() => [
|
|
385
|
+
o(l(L), null, {
|
|
386
|
+
default: a(() => [
|
|
387
|
+
o(l(f), {
|
|
388
|
+
onClick: t[8] || (t[8] = (s) => y.value = !1)
|
|
389
|
+
}, {
|
|
390
|
+
default: a(() => [...t[23] || (t[23] = [
|
|
391
|
+
u("取消", -1)
|
|
392
|
+
])]),
|
|
393
|
+
_: 1
|
|
394
|
+
}),
|
|
395
|
+
o(l(f), {
|
|
396
|
+
type: "primary",
|
|
397
|
+
onClick: R
|
|
398
|
+
}, {
|
|
399
|
+
default: a(() => [...t[24] || (t[24] = [
|
|
400
|
+
u("确定", -1)
|
|
401
|
+
])]),
|
|
402
|
+
_: 1
|
|
403
|
+
})
|
|
404
|
+
]),
|
|
405
|
+
_: 1
|
|
406
|
+
})
|
|
407
|
+
]),
|
|
408
|
+
default: a(() => [
|
|
409
|
+
o(l(N), {
|
|
410
|
+
ref_key: "formRef",
|
|
411
|
+
ref: D,
|
|
412
|
+
model: i,
|
|
413
|
+
rules: U,
|
|
414
|
+
"label-width": "80px",
|
|
415
|
+
class: "role-form"
|
|
416
|
+
}, {
|
|
417
|
+
default: a(() => [
|
|
418
|
+
o(l(v), {
|
|
419
|
+
label: "角色名称",
|
|
420
|
+
prop: "name"
|
|
421
|
+
}, {
|
|
422
|
+
default: a(() => [
|
|
423
|
+
o(l(x), {
|
|
424
|
+
modelValue: i.name,
|
|
425
|
+
"onUpdate:modelValue": t[4] || (t[4] = (s) => i.name = s),
|
|
426
|
+
placeholder: "请输入角色名称"
|
|
427
|
+
}, null, 8, ["modelValue"])
|
|
428
|
+
]),
|
|
429
|
+
_: 1
|
|
430
|
+
}),
|
|
431
|
+
o(l(v), {
|
|
432
|
+
label: "角色编码",
|
|
433
|
+
prop: "code"
|
|
434
|
+
}, {
|
|
435
|
+
default: a(() => [
|
|
436
|
+
o(l(x), {
|
|
437
|
+
modelValue: i.code,
|
|
438
|
+
"onUpdate:modelValue": t[5] || (t[5] = (s) => i.code = s),
|
|
439
|
+
placeholder: "请输入角色编码"
|
|
440
|
+
}, null, 8, ["modelValue"])
|
|
441
|
+
]),
|
|
442
|
+
_: 1
|
|
443
|
+
}),
|
|
444
|
+
o(l(v), { label: "描述" }, {
|
|
445
|
+
default: a(() => [
|
|
446
|
+
o(l(x), {
|
|
447
|
+
modelValue: i.description,
|
|
448
|
+
"onUpdate:modelValue": t[6] || (t[6] = (s) => i.description = s),
|
|
449
|
+
placeholder: "请输入描述"
|
|
450
|
+
}, null, 8, ["modelValue"])
|
|
451
|
+
]),
|
|
452
|
+
_: 1
|
|
453
|
+
}),
|
|
454
|
+
o(l(v), { label: "状态" }, {
|
|
455
|
+
default: a(() => [
|
|
456
|
+
e("div", Ce, [
|
|
457
|
+
o(l(S), {
|
|
458
|
+
modelValue: i.status,
|
|
459
|
+
"onUpdate:modelValue": t[7] || (t[7] = (s) => i.status = s),
|
|
460
|
+
"active-value": l(d).ENABLED,
|
|
461
|
+
"inactive-value": l(d).DISABLED
|
|
462
|
+
}, null, 8, ["modelValue", "active-value", "inactive-value"]),
|
|
463
|
+
e("span", Le, c(i.status === l(d).ENABLED ? "启用" : "禁用"), 1)
|
|
464
|
+
])
|
|
465
|
+
]),
|
|
466
|
+
_: 1
|
|
467
|
+
})
|
|
468
|
+
]),
|
|
469
|
+
_: 1
|
|
470
|
+
}, 8, ["model"])
|
|
471
|
+
]),
|
|
472
|
+
_: 1
|
|
473
|
+
}, 8, ["modelValue", "title"])
|
|
474
|
+
]));
|
|
475
|
+
}
|
|
476
|
+
}), Te = /* @__PURE__ */ te(De, [["__scopeId", "data-v-e4ca047d"]]);
|
|
477
|
+
export {
|
|
478
|
+
Te as default
|
|
479
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LocaleCode } from '@xto/core/locale';
|
|
2
|
+
export interface XtoConfig {
|
|
3
|
+
appName?: string;
|
|
4
|
+
appId?: string;
|
|
5
|
+
clientId?: string;
|
|
6
|
+
apiBaseUrl?: string;
|
|
7
|
+
basePath?: string;
|
|
8
|
+
indexPath?: string;
|
|
9
|
+
loginPath?: string;
|
|
10
|
+
locale?: LocaleCode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 初始化 XTO 应用
|
|
14
|
+
* 在项目入口文件中调用此函数设置应用配置
|
|
15
|
+
*
|
|
16
|
+
* @param config 应用配置
|
|
17
|
+
* @returns Promise,等待运行时配置加载完成
|
|
18
|
+
*/
|
|
19
|
+
export declare function createXtoApp(config: Partial<XtoConfig>): Promise<{
|
|
20
|
+
config: {
|
|
21
|
+
appName: string;
|
|
22
|
+
appId: string;
|
|
23
|
+
clientId: string;
|
|
24
|
+
apiBaseUrl: string;
|
|
25
|
+
basePath: string;
|
|
26
|
+
indexPath: string;
|
|
27
|
+
loginPath: string;
|
|
28
|
+
locale: LocaleCode;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
export { default as Layout } from './components/Layout/index.vue';
|
|
32
|
+
export { default as Header } from './components/Layout/Header.vue';
|
|
33
|
+
export { default as Sidebar } from './components/Layout/Sidebar.vue';
|
|
34
|
+
export { default as Tabs } from './components/Layout/Tabs.vue';
|
|
35
|
+
export { default as Footer } from './components/Layout/Footer.vue';
|
|
36
|
+
export { default as Login } from './views/login/index.vue';
|
|
37
|
+
export { default as NotFound } from './views/error/404.vue';
|
|
38
|
+
export { default as Forbidden } from './views/error/403.vue';
|
|
39
|
+
export * from './composables/useApp';
|
|
40
|
+
export * from './composables/useAuth';
|
|
41
|
+
export * from './composables/useForm';
|
|
42
|
+
export * from './composables/useTable';
|
|
43
|
+
export * from './composables/useI18n';
|
|
44
|
+
export * from './utils/auth';
|
|
45
|
+
export * from './utils/permission';
|
|
46
|
+
export * from './utils/request';
|
|
47
|
+
export * from './utils/storage';
|
|
48
|
+
export * from './utils/config';
|
|
49
|
+
export * from './stores/app';
|
|
50
|
+
export * from './stores/auth';
|
|
51
|
+
export * from './stores/menu';
|
|
52
|
+
export * from './stores/user';
|
|
53
|
+
export * from './stores/locale';
|
|
54
|
+
export { default as router, resetRouter } from './router';
|
|
55
|
+
export * from './router/staticRoutes';
|
|
56
|
+
export * from './router/dynamicRoutes';
|
|
57
|
+
export { createLayoutRoute, createRouter } from './router/layoutRoute';
|
|
58
|
+
export { setupRouterGuards } from './router/guards';
|
|
59
|
+
export * from './api/auth';
|
|
60
|
+
export * from './api/system';
|
|
61
|
+
export * from './api/user';
|
|
62
|
+
export * from './enums';
|
|
63
|
+
export { default as permissionDirective } from './directives/permission';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
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 T, f as d, g, h as R, S as c, a as h, j as k, T as f, k as S, l as U, m, n as A, o as M, p as y, q as x, r as L, s as C, t as D, u as b, v as I, w as B, x as F, y as G, z as E, A as P, B as O, C as v, D as w, E as H, I as N, J as j, K as q, N as z } from "./index-DGwrd6c8.js";
|
|
2
|
+
import { K, b as X, B as Q, c as V, a as W, d as Y, e as Z, f as _, g as $, G as ee, y as se, E as ae, D as te, L as oe, h as re, i as ne, M as ue, N as ie, j as pe, k as le, z as Te, O as de, P as ge, l as Re, m as ce, n as he, A as ke, Q as fe, I as Se, R as Ue, F as me, x as Ae, S as Me, o as ye, p as xe, r as Le, q as Ce, T as De, U as be, H as Ie, J as Be, V as Fe, W as Ge, X as Ee, Y as Pe, Z as Oe, C as ve, _ as we, u as He, s as Ne, t as je, v as qe, w as ze } from "./user-77I_qZ8j.js";
|
|
3
|
+
export {
|
|
4
|
+
a as Footer,
|
|
5
|
+
t as Forbidden,
|
|
6
|
+
o as Gender,
|
|
7
|
+
r as GenderOptions,
|
|
8
|
+
n as GenderText,
|
|
9
|
+
u as Header,
|
|
10
|
+
i as Layout,
|
|
11
|
+
p as Login,
|
|
12
|
+
l as MenuType,
|
|
13
|
+
T as MenuTypeOptions,
|
|
14
|
+
d as MenuTypeText,
|
|
15
|
+
g as NotFound,
|
|
16
|
+
R as Sidebar,
|
|
17
|
+
c as Status,
|
|
18
|
+
h as StatusOptions,
|
|
19
|
+
k as StatusText,
|
|
20
|
+
f as Tabs,
|
|
21
|
+
K as appConfig,
|
|
22
|
+
X as batchDeleteUsers,
|
|
23
|
+
Q as clearToken,
|
|
24
|
+
S as createLayoutRoute,
|
|
25
|
+
V as createMenu,
|
|
26
|
+
W as createRole,
|
|
27
|
+
U as createRouter,
|
|
28
|
+
m as createTranslator,
|
|
29
|
+
Y as createUser,
|
|
30
|
+
A as createXtoApp,
|
|
31
|
+
M as defaultDynamicRoutes,
|
|
32
|
+
Z as deleteMenu,
|
|
33
|
+
_ as deleteRole,
|
|
34
|
+
$ as deleteUser,
|
|
35
|
+
ee as getApiBaseUrl,
|
|
36
|
+
se as getAppId,
|
|
37
|
+
ae as getBasePath,
|
|
38
|
+
te as getClientId,
|
|
39
|
+
oe as getCode,
|
|
40
|
+
re as getMenuList,
|
|
41
|
+
ne as getMenuTree,
|
|
42
|
+
ue as getRefreshTime,
|
|
43
|
+
ie as getRefreshToken,
|
|
44
|
+
pe as getRoleDetail,
|
|
45
|
+
le as getRoleList,
|
|
46
|
+
Te as getToken,
|
|
47
|
+
de as getTokenExpire,
|
|
48
|
+
ge as getTokenType,
|
|
49
|
+
Re as getUserDetail,
|
|
50
|
+
ce as getUserInfo,
|
|
51
|
+
he as getUserList,
|
|
52
|
+
y as hasPermission,
|
|
53
|
+
x as hasRole,
|
|
54
|
+
ke as hasToken,
|
|
55
|
+
fe as http,
|
|
56
|
+
Se as initAppConfig,
|
|
57
|
+
L as isAdmin,
|
|
58
|
+
Ue as isTokenExpired,
|
|
59
|
+
C as layoutRoute,
|
|
60
|
+
me as loadRuntimeConfig,
|
|
61
|
+
Ae as local,
|
|
62
|
+
Me as localStorageUtil,
|
|
63
|
+
ye as login,
|
|
64
|
+
xe as logout,
|
|
65
|
+
D as mockMenuData,
|
|
66
|
+
b as permissionDirective,
|
|
67
|
+
Le as refreshToken,
|
|
68
|
+
Ce as resetPassword,
|
|
69
|
+
I as resetRouter,
|
|
70
|
+
B as router,
|
|
71
|
+
De as session,
|
|
72
|
+
be as sessionStorageUtil,
|
|
73
|
+
Ie as setApiBaseUrl,
|
|
74
|
+
Be as setBasePath,
|
|
75
|
+
Fe as setCode,
|
|
76
|
+
Ge as setRefreshTime,
|
|
77
|
+
Ee as setRefreshToken,
|
|
78
|
+
Pe as setToken,
|
|
79
|
+
Oe as setTokenExpire,
|
|
80
|
+
ve as setTokenInfo,
|
|
81
|
+
we as setTokenType,
|
|
82
|
+
F as setupRouterGuards,
|
|
83
|
+
G as staticRoutes,
|
|
84
|
+
He as updateMenu,
|
|
85
|
+
Ne as updateRole,
|
|
86
|
+
je as updateRoleStatus,
|
|
87
|
+
qe as updateUser,
|
|
88
|
+
ze as updateUserStatus,
|
|
89
|
+
E as useApp,
|
|
90
|
+
P as useAppStore,
|
|
91
|
+
O as useAuth,
|
|
92
|
+
v as useAuthStore,
|
|
93
|
+
w as useForm,
|
|
94
|
+
H as useI18n,
|
|
95
|
+
N as useLocaleStore,
|
|
96
|
+
j as useMenuStore,
|
|
97
|
+
q as useTable,
|
|
98
|
+
z as useUserStore
|
|
99
|
+
};
|
package/dist/main.d.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
export declare const layoutRoute: RouteRecordRaw;
|
|
3
|
+
export declare const defaultDynamicRoutes: RouteRecordRaw[];
|
|
4
|
+
export declare const mockMenuData: ({
|
|
5
|
+
menuCode: string;
|
|
6
|
+
menuName: string;
|
|
7
|
+
menuUrl: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
closable: boolean;
|
|
10
|
+
isDefault: boolean;
|
|
11
|
+
isOut: boolean;
|
|
12
|
+
children?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
menuCode: string;
|
|
15
|
+
menuName: string;
|
|
16
|
+
menuUrl: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
closable: boolean;
|
|
19
|
+
isDefault: boolean;
|
|
20
|
+
isOut: boolean;
|
|
21
|
+
children: {
|
|
22
|
+
menuCode: string;
|
|
23
|
+
menuName: string;
|
|
24
|
+
menuUrl: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
closable: boolean;
|
|
27
|
+
isDefault: boolean;
|
|
28
|
+
isOut: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
})[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Router } from 'vue-router';
|
|
2
|
+
interface RouterGuardOptions {
|
|
3
|
+
whiteList?: string[];
|
|
4
|
+
loginPath?: string;
|
|
5
|
+
homePath?: string;
|
|
6
|
+
appId?: string;
|
|
7
|
+
fetchUserInfo?: () => Promise<any>;
|
|
8
|
+
fetchMenu?: () => Promise<any>;
|
|
9
|
+
onLoginSuccess?: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 设置路由守卫
|
|
13
|
+
* @param router 路由实例
|
|
14
|
+
* @param options 配置选项
|
|
15
|
+
*/
|
|
16
|
+
export declare function setupRouterGuards(router: Router, options?: RouterGuardOptions): void;
|
|
17
|
+
export {};
|