@pubinfo/module-rbac 2.0.13 → 2.0.15
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/{DynamicRoutesForm-DzOGoyf3.js → DynamicRoutesForm-BU4EAISs.js} +1 -1
- package/dist/{DynamicRoutesForm.vue_vue_type_script_setup_true_lang-lpCaLpPL.js → DynamicRoutesForm.vue_vue_type_script_setup_true_lang-bEqJ03T_.js} +6 -6
- package/dist/{IconSelect-Cco4lJFZ.js → IconSelect-DtNpk3Rj.js} +1 -1
- package/dist/{IconSelect.vue_vue_type_script_setup_true_lang-C9GJFjrV.js → IconSelect.vue_vue_type_script_setup_true_lang-D450SiKg.js} +64 -64
- package/dist/{ImportExport-BD8o7IvB.js → ImportExport-DAe_Sl13.js} +1 -1
- package/dist/{ImportExport.vue_vue_type_script_setup_true_lang-BzdP0ADd.js → ImportExport.vue_vue_type_script_setup_true_lang-CV0DrMvw.js} +1 -1
- package/dist/{LayoutForm-DqDnsQcr.js → LayoutForm-C-vNwp3q.js} +1 -1
- package/dist/{MetaForm-s74FbAc9.js → MetaForm-13JASu7v.js} +133 -104
- package/dist/MetaForm.css +1 -1
- package/dist/{ResourceEdit-CNYAteRE.js → ResourceEdit-D2YFu-Gk.js} +1 -1
- package/dist/{ResourceEdit.vue_vue_type_script_setup_true_lang-BLqs77A8.js → ResourceEdit.vue_vue_type_script_setup_true_lang-Cb0mKIlJ.js} +45 -49
- package/dist/{enum-CjyX3J0o.js → enum-D5iPiZiT.js} +0 -1
- package/dist/{index-BsZjgoZQ.js → index-BPkJOFXE.js} +3 -3
- package/dist/index.js +1507 -1531
- package/dist/index17.css +1 -1
- package/dist/views/resource/model.d.ts +1 -0
- package/package.json +7 -7
- package/src/views/resource/components/DynamicRoutesForm.vue +1 -1
- package/src/views/resource/components/IconSelect.vue +1 -1
- package/src/views/resource/components/MetaForm.vue +11 -0
- package/src/views/resource/components/ResourceEdit.vue +2 -8
- package/src/views/resource/enum.ts +0 -1
- package/src/views/resource/hooks/useMetaForm.ts +2 -0
- package/src/views/resource/index.vue +0 -3
- package/src/views/resource/model.ts +2 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Drawer as ne, Spin as le, Form as re, Row as se, Col as ue, FormItem as ie, Tag as me, RadioGroup as de, Input as pe, InputNumber as fe, Textarea as ce, Switch as _e, Select as ve, Space as ge, Button as be } from "ant-design-vue/es";
|
|
2
2
|
import { DatabaseOutlined as ye } from "@ant-design/icons-vue";
|
|
3
|
-
import { defineComponent as Ne, ref as L, reactive as
|
|
4
|
-
import { message as
|
|
3
|
+
import { defineComponent as Ne, ref as L, reactive as De, computed as E, createBlock as p, openBlock as d, unref as t, isRef as v, withCtx as n, createVNode as o, createCommentVNode as g, createTextVNode as b, toDisplayString as x, createElementBlock as Ie } from "vue";
|
|
4
|
+
import { message as Pe } from "ant-design-vue";
|
|
5
5
|
import { RESOURCE_TYPE as s, PartyLoginModal as Re } from "pubinfo";
|
|
6
6
|
import { u as C } from "./index.js";
|
|
7
7
|
import { d as Ue, p as Ee, e as Ce } from "./ziyuanjiekou-BC65-bFK.js";
|
|
8
8
|
import { D as Te, b as Ae } from "./enum-DkSNwGbC.js";
|
|
9
|
-
import { r as
|
|
10
|
-
import { u as Oe, M as Ve, d as Le } from "./MetaForm-
|
|
11
|
-
import { _ as xe } from "./DynamicRoutesForm.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { _ as ke } from "./IconSelect.vue_vue_type_script_setup_true_lang-
|
|
13
|
-
import we from "./LayoutForm-
|
|
9
|
+
import { r as D, A as I, R as Me } from "./enum-D5iPiZiT.js";
|
|
10
|
+
import { u as Oe, M as Ve, d as Le } from "./MetaForm-13JASu7v.js";
|
|
11
|
+
import { _ as xe } from "./DynamicRoutesForm.vue_vue_type_script_setup_true_lang-bEqJ03T_.js";
|
|
12
|
+
import { _ as ke } from "./IconSelect.vue_vue_type_script_setup_true_lang-D450SiKg.js";
|
|
13
|
+
import we from "./LayoutForm-C-vNwp3q.js";
|
|
14
14
|
import { c as k } from "./cloneDeep-BOLZdR62.js";
|
|
15
15
|
const Se = {
|
|
16
16
|
key: 0,
|
|
@@ -23,7 +23,7 @@ const Se = {
|
|
|
23
23
|
},
|
|
24
24
|
emits: ["submit"],
|
|
25
25
|
setup(w, { expose: S, emit: F }) {
|
|
26
|
-
const B = w, q = F, [
|
|
26
|
+
const B = w, q = F, [P, R] = C(!1), T = L(), e = L({}), f = De({
|
|
27
27
|
title: "",
|
|
28
28
|
record: {},
|
|
29
29
|
initData: {
|
|
@@ -43,7 +43,7 @@ const Se = {
|
|
|
43
43
|
code: [{ required: !0, message: "请输入资源编码", trigger: "blur" }],
|
|
44
44
|
sort: [{ type: "number", required: !0, message: "请输入排序", trigger: "blur" }],
|
|
45
45
|
enable: [{ type: "boolean", required: !0, message: "请选择是否启用", trigger: "change" }]
|
|
46
|
-
},
|
|
46
|
+
}, c = E(() => $(B.dataSource, (r) => r.id === e.value.parentId) ?? {});
|
|
47
47
|
function $(r, a) {
|
|
48
48
|
const m = [...r];
|
|
49
49
|
for (const u of m) {
|
|
@@ -54,32 +54,27 @@ const Se = {
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
const U = E(() => {
|
|
57
|
-
switch (
|
|
57
|
+
switch (c.value?.type) {
|
|
58
58
|
case s.APP:
|
|
59
|
-
case s.MICRO_APP:
|
|
60
59
|
case s.DYNAMIC_APP:
|
|
61
|
-
return
|
|
60
|
+
return D.filter((r) => [s.INDEX, s.MENU, s.IFRAME, s.LINK].includes(r.value));
|
|
62
61
|
case s.INDEX:
|
|
63
|
-
return
|
|
62
|
+
return D.filter((r) => [s.INDEX, s.MENU, s.IFRAME, s.LINK, s.NON_MENU].includes(r.value));
|
|
64
63
|
case s.MENU:
|
|
65
64
|
case s.NON_MENU:
|
|
66
|
-
return
|
|
65
|
+
return D.filter((r) => [s.BUTTON, s.NON_MENU].includes(r.value));
|
|
67
66
|
case s.BUTTON:
|
|
68
67
|
case s.IFRAME:
|
|
69
68
|
case s.LINK:
|
|
70
69
|
return [];
|
|
71
70
|
default:
|
|
72
|
-
return
|
|
73
|
-
s.APP,
|
|
74
|
-
/* RESOURCE_TYPE.MICRO_APP, */
|
|
75
|
-
s.DYNAMIC_APP
|
|
76
|
-
].includes(r.value));
|
|
71
|
+
return D.filter((r) => [s.APP, s.DYNAMIC_APP].includes(r.value));
|
|
77
72
|
}
|
|
78
73
|
}), { show: y, resetIncompatibleOptions: A } = Oe(e), h = E(() => e.value.meta?.iframe || e.value.meta?.link || ""), [K, M] = C(!1);
|
|
79
74
|
async function X(r, a) {
|
|
80
75
|
f.title = r, e.value = k(f.initData), R(!0);
|
|
81
76
|
try {
|
|
82
|
-
if (M(!0), r ===
|
|
77
|
+
if (M(!0), r === I.ADD_CHILD && (e.value.parentId = a?.id, e.value.type = U.value[0].value, A()), r === I.EDIT) {
|
|
83
78
|
const m = await Ue({ id: a?.id });
|
|
84
79
|
m.success && (e.value = m.data ?? {}, e.value.meta = { ...Le, ...m.data?.meta }, A());
|
|
85
80
|
}
|
|
@@ -95,19 +90,19 @@ const Se = {
|
|
|
95
90
|
icon: e.value.icon || void 0
|
|
96
91
|
});
|
|
97
92
|
y.value.dataPermission || (r.enableDataPermission = !1), y.value.devMode && e.value.meta?.isDev && console.warn("开发模式应用的子路由将不会在生产环境中注册到vue-router,请确保这是预期行为。"), r.meta?.cache && r.meta.cacheName && (r.meta.cache = r.meta.cacheName.split(",")), r.meta?.noCache && (r.meta.noCache = r.meta.noCache.split(",")), r.meta?.cache || delete r?.meta?.noCache, delete r?.meta?.cacheName;
|
|
98
|
-
const a = f.title ===
|
|
93
|
+
const a = f.title === I.EDIT ? Ee(r) : Ce({ parentId: "", ...r });
|
|
99
94
|
O(!0), a.then((m) => {
|
|
100
|
-
m?.success && (
|
|
95
|
+
m?.success && (Pe.success(`${f.title}成功!`), R(!1), q("submit"));
|
|
101
96
|
}).finally(() => O(!1));
|
|
102
97
|
});
|
|
103
98
|
}
|
|
104
99
|
return S({
|
|
105
100
|
open: X
|
|
106
101
|
}), (r, a) => {
|
|
107
|
-
const m = ye, u = ie, i = ue, H = me, j = de,
|
|
102
|
+
const m = ye, u = ie, i = ue, H = me, j = de, _ = se, N = pe, J = fe, Q = ce, W = _e, Z = ve, ee = re, te = le, V = be, ae = ge, oe = ne;
|
|
108
103
|
return d(), p(oe, {
|
|
109
|
-
open: t(
|
|
110
|
-
"onUpdate:open": a[15] || (a[15] = (l) =>
|
|
104
|
+
open: t(P),
|
|
105
|
+
"onUpdate:open": a[15] || (a[15] = (l) => v(P) ? P.value = l : null),
|
|
111
106
|
title: t(f).title,
|
|
112
107
|
placement: "right",
|
|
113
108
|
width: 800,
|
|
@@ -121,7 +116,7 @@ const Se = {
|
|
|
121
116
|
onClick: a[13] || (a[13] = (l) => t(R)(!1))
|
|
122
117
|
}, {
|
|
123
118
|
default: n(() => a[17] || (a[17] = [
|
|
124
|
-
|
|
119
|
+
b(" 取消 ")
|
|
125
120
|
])),
|
|
126
121
|
_: 1,
|
|
127
122
|
__: [17]
|
|
@@ -132,7 +127,7 @@ const Se = {
|
|
|
132
127
|
onClick: a[14] || (a[14] = (l) => G())
|
|
133
128
|
}, {
|
|
134
129
|
default: n(() => a[18] || (a[18] = [
|
|
135
|
-
|
|
130
|
+
b(" 提交 ")
|
|
136
131
|
])),
|
|
137
132
|
_: 1,
|
|
138
133
|
__: [18]
|
|
@@ -152,9 +147,9 @@ const Se = {
|
|
|
152
147
|
"label-col": { style: { width: "100px" } }
|
|
153
148
|
}, {
|
|
154
149
|
default: n(() => [
|
|
155
|
-
o(
|
|
150
|
+
o(_, { gutter: 8 }, {
|
|
156
151
|
default: n(() => [
|
|
157
|
-
t(
|
|
152
|
+
t(c)?.name ? (d(), p(i, {
|
|
158
153
|
key: 0,
|
|
159
154
|
span: 24
|
|
160
155
|
}, {
|
|
@@ -162,34 +157,35 @@ const Se = {
|
|
|
162
157
|
o(u, { name: "parentId" }, {
|
|
163
158
|
label: n(() => [
|
|
164
159
|
o(m, { class: "mr-1" }),
|
|
165
|
-
a[16] || (a[16] =
|
|
160
|
+
a[16] || (a[16] = b(" 父资源 "))
|
|
166
161
|
]),
|
|
167
162
|
default: n(() => [
|
|
168
|
-
|
|
163
|
+
b(" " + x(t(c)?.name), 1)
|
|
169
164
|
]),
|
|
170
165
|
_: 1
|
|
171
166
|
})
|
|
172
167
|
]),
|
|
173
168
|
_: 1
|
|
174
|
-
})) :
|
|
169
|
+
})) : g("", !0),
|
|
175
170
|
o(i, { span: 24 }, {
|
|
176
171
|
default: n(() => [
|
|
177
172
|
o(u, {
|
|
178
173
|
label: "资源类型",
|
|
179
|
-
name: "type"
|
|
174
|
+
name: "type",
|
|
175
|
+
tooltip: t(c)?.type ? "" : "动态应用为后端路由,应用为前端路由"
|
|
180
176
|
}, {
|
|
181
177
|
default: n(() => [
|
|
182
|
-
t(f).title === t(
|
|
178
|
+
t(f).title === t(I).EDIT ? (d(), Ie("div", Se, [
|
|
183
179
|
t(e).type ? (d(), p(H, {
|
|
184
180
|
key: 0,
|
|
185
181
|
color: t(Me)[Number(t(e).type)],
|
|
186
182
|
bordered: !1
|
|
187
183
|
}, {
|
|
188
184
|
default: n(() => [
|
|
189
|
-
|
|
185
|
+
b(x(t(U).find((l) => l.value === t(e).type)?.label), 1)
|
|
190
186
|
]),
|
|
191
187
|
_: 1
|
|
192
|
-
}, 8, ["color"])) :
|
|
188
|
+
}, 8, ["color"])) : g("", !0)
|
|
193
189
|
])) : (d(), p(j, {
|
|
194
190
|
key: 1,
|
|
195
191
|
value: t(e).type,
|
|
@@ -200,7 +196,7 @@ const Se = {
|
|
|
200
196
|
}, null, 8, ["value", "options"]))
|
|
201
197
|
]),
|
|
202
198
|
_: 1
|
|
203
|
-
})
|
|
199
|
+
}, 8, ["tooltip"])
|
|
204
200
|
]),
|
|
205
201
|
_: 1
|
|
206
202
|
}),
|
|
@@ -208,7 +204,7 @@ const Se = {
|
|
|
208
204
|
default: n(() => [
|
|
209
205
|
o(ke, {
|
|
210
206
|
modelValue: t(e),
|
|
211
|
-
"onUpdate:modelValue": a[1] || (a[1] = (l) =>
|
|
207
|
+
"onUpdate:modelValue": a[1] || (a[1] = (l) => v(e) ? e.value = l : null)
|
|
212
208
|
}, null, 8, ["modelValue"])
|
|
213
209
|
]),
|
|
214
210
|
_: 1
|
|
@@ -216,7 +212,7 @@ const Se = {
|
|
|
216
212
|
]),
|
|
217
213
|
_: 1
|
|
218
214
|
}),
|
|
219
|
-
o(
|
|
215
|
+
o(_, { gutter: 8 }, {
|
|
220
216
|
default: n(() => [
|
|
221
217
|
o(i, { span: 12 }, {
|
|
222
218
|
default: n(() => [
|
|
@@ -239,8 +235,8 @@ const Se = {
|
|
|
239
235
|
}),
|
|
240
236
|
o(xe, {
|
|
241
237
|
modelValue: t(e),
|
|
242
|
-
"onUpdate:modelValue": a[3] || (a[3] = (l) =>
|
|
243
|
-
parent: t(
|
|
238
|
+
"onUpdate:modelValue": a[3] || (a[3] = (l) => v(e) ? e.value = l : null),
|
|
239
|
+
parent: t(c)
|
|
244
240
|
}, null, 8, ["modelValue", "parent"]),
|
|
245
241
|
o(i, { span: 12 }, {
|
|
246
242
|
default: n(() => [
|
|
@@ -301,7 +297,7 @@ const Se = {
|
|
|
301
297
|
]),
|
|
302
298
|
_: 1
|
|
303
299
|
}),
|
|
304
|
-
t(y).dynamic ? (d(), p(
|
|
300
|
+
t(y).dynamic ? (d(), p(_, {
|
|
305
301
|
key: 0,
|
|
306
302
|
gutter: 8
|
|
307
303
|
}, {
|
|
@@ -336,8 +332,8 @@ const Se = {
|
|
|
336
332
|
})
|
|
337
333
|
]),
|
|
338
334
|
_: 1
|
|
339
|
-
})) :
|
|
340
|
-
o(
|
|
335
|
+
})) : g("", !0),
|
|
336
|
+
o(_, { gutter: 8 }, {
|
|
341
337
|
default: n(() => [
|
|
342
338
|
o(i, { span: 24 }, {
|
|
343
339
|
default: n(() => [
|
|
@@ -364,7 +360,7 @@ const Se = {
|
|
|
364
360
|
]),
|
|
365
361
|
_: 1
|
|
366
362
|
}),
|
|
367
|
-
t(y).dataPermission ? (d(), p(
|
|
363
|
+
t(y).dataPermission ? (d(), p(_, {
|
|
368
364
|
key: 1,
|
|
369
365
|
gutter: 8
|
|
370
366
|
}, {
|
|
@@ -401,20 +397,20 @@ const Se = {
|
|
|
401
397
|
}, null, 8, ["value", "options"])
|
|
402
398
|
]),
|
|
403
399
|
_: 1
|
|
404
|
-
})) :
|
|
400
|
+
})) : g("", !0)
|
|
405
401
|
]),
|
|
406
402
|
_: 1
|
|
407
403
|
})
|
|
408
404
|
]),
|
|
409
405
|
_: 1
|
|
410
|
-
})) :
|
|
406
|
+
})) : g("", !0),
|
|
411
407
|
o(Ve, {
|
|
412
408
|
modelValue: t(e),
|
|
413
|
-
"onUpdate:modelValue": a[11] || (a[11] = (l) =>
|
|
409
|
+
"onUpdate:modelValue": a[11] || (a[11] = (l) => v(e) ? e.value = l : null)
|
|
414
410
|
}, null, 8, ["modelValue"]),
|
|
415
411
|
o(we, {
|
|
416
412
|
modelValue: t(e),
|
|
417
|
-
"onUpdate:modelValue": a[12] || (a[12] = (l) =>
|
|
413
|
+
"onUpdate:modelValue": a[12] || (a[12] = (l) => v(e) ? e.value = l : null)
|
|
418
414
|
}, null, 8, ["modelValue"])
|
|
419
415
|
]),
|
|
420
416
|
_: 1
|
|
@@ -3,7 +3,6 @@ var a = /* @__PURE__ */ ((l) => (l.ROLE_RELATION = "分配查看", l.ADD = "新
|
|
|
3
3
|
const E = ["", "geekblue", "blue", "default", "cyan", "default", "geekblue", "geekblue", "default", "default"], b = [
|
|
4
4
|
{ label: "动态应用", value: e.DYNAMIC_APP },
|
|
5
5
|
{ label: "应用", value: e.APP },
|
|
6
|
-
{ label: "微应用", value: e.MICRO_APP },
|
|
7
6
|
{ label: "目录", value: e.INDEX },
|
|
8
7
|
{ label: "菜单", value: e.MENU },
|
|
9
8
|
{ label: "按钮", value: e.BUTTON },
|
|
@@ -6,10 +6,10 @@ import { Tag as K, Badge as A, message as g, Modal as Y } from "ant-design-vue";
|
|
|
6
6
|
import { useAuth as j, PubinfoIcon as I, RESOURCE_TYPE as T } from "pubinfo";
|
|
7
7
|
import "./index.js";
|
|
8
8
|
import { b as G, c as J } from "./ziyuanjiekou-BC65-bFK.js";
|
|
9
|
-
import { _ as Q } from "./ImportExport.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { _ as W } from "./ResourceEdit.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { _ as Q } from "./ImportExport.vue_vue_type_script_setup_true_lang-CV0DrMvw.js";
|
|
10
|
+
import { _ as W } from "./ResourceEdit.vue_vue_type_script_setup_true_lang-Cb0mKIlJ.js";
|
|
11
11
|
import { _ as Z } from "./RoleRelation.vue_vue_type_script_setup_true_lang-BjEOlM2g.js";
|
|
12
|
-
import { r as L, A as t, R as ee } from "./enum-
|
|
12
|
+
import { r as L, A as t, R as ee } from "./enum-D5iPiZiT.js";
|
|
13
13
|
import { c as te } from "./cloneDeep-BOLZdR62.js";
|
|
14
14
|
const ae = {
|
|
15
15
|
"w-full": "",
|