@chewel611/naive-ui-plus 0.0.26 → 0.0.28
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/index.js +833 -731
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/es/components.d.ts +1 -0
- package/es/components.js +15 -13
- package/es/index.js +21 -19
- package/es/layout/PLayout.css +1 -1
- package/es/layout/PLayout.vue.js +1 -1
- package/es/layout/PLayout.vue2.js +11 -9
- package/es/layout/store.d.ts +4 -1
- package/es/layout/store.js +8 -5
- package/es/page/PPage.d.ts +48 -0
- package/es/page/PPage.vue.js +87 -0
- package/es/page/PPage.vue2.js +4 -0
- package/es/page/index.d.ts +66 -0
- package/es/page/index.js +6 -0
- package/es/table/PTable.vue.js +151 -136
- package/es/table/typing.d.ts +1 -0
- package/lib/components.cjs +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/index.cjs +1 -1
- package/lib/layout/PLayout.css +1 -1
- package/lib/layout/PLayout.vue.cjs +1 -1
- package/lib/layout/PLayout.vue2.cjs +1 -1
- package/lib/layout/store.cjs +1 -1
- package/lib/layout/store.d.ts +4 -1
- package/lib/page/PPage.d.ts +48 -0
- package/lib/page/PPage.vue.cjs +1 -0
- package/lib/page/PPage.vue2.cjs +1 -0
- package/lib/page/index.cjs +1 -0
- package/lib/page/index.d.ts +66 -0
- package/lib/table/PTable.vue.cjs +1 -1
- package/lib/table/typing.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const PPagePlugin: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
icon: {
|
|
4
|
+
type: ObjectConstructor;
|
|
5
|
+
required: false;
|
|
6
|
+
default: () => import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
};
|
|
8
|
+
title: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
subtitle: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
required: false;
|
|
15
|
+
};
|
|
16
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
17
|
+
icon: Record<string, any>;
|
|
18
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
19
|
+
P: {};
|
|
20
|
+
B: {};
|
|
21
|
+
D: {};
|
|
22
|
+
C: {};
|
|
23
|
+
M: {};
|
|
24
|
+
Defaults: {};
|
|
25
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
26
|
+
icon: {
|
|
27
|
+
type: ObjectConstructor;
|
|
28
|
+
required: false;
|
|
29
|
+
default: () => import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
};
|
|
31
|
+
title: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
subtitle: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: false;
|
|
38
|
+
};
|
|
39
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
40
|
+
icon: Record<string, any>;
|
|
41
|
+
}>;
|
|
42
|
+
__isFragment?: never;
|
|
43
|
+
__isTeleport?: never;
|
|
44
|
+
__isSuspense?: never;
|
|
45
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
46
|
+
icon: {
|
|
47
|
+
type: ObjectConstructor;
|
|
48
|
+
required: false;
|
|
49
|
+
default: () => import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
50
|
+
};
|
|
51
|
+
title: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
subtitle: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
required: false;
|
|
58
|
+
};
|
|
59
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
60
|
+
icon: Record<string, any>;
|
|
61
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
62
|
+
$slots: {
|
|
63
|
+
search?(_: {}): any;
|
|
64
|
+
default?(_: {}): any;
|
|
65
|
+
};
|
|
66
|
+
}) & import('vue').Plugin;
|
package/es/page/index.js
ADDED
package/es/table/PTable.vue.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useDialog as ye, useMessage as we, NCard as
|
|
2
|
-
import { defineComponent as Oe, ref as c, computed as K, unref as
|
|
3
|
-
import { PlusSquareOutlined as
|
|
4
|
-
import { resetObject as
|
|
5
|
-
import { cloneDeep as
|
|
6
|
-
const
|
|
1
|
+
import { useDialog as ye, useMessage as we, NCard as be, NDataTable as ke, NModal as Ce, NSpace as Se, NButton as C, NTooltip as De, NIcon as T, NDropdown as Me } from "naive-ui";
|
|
2
|
+
import { defineComponent as Oe, ref as c, computed as K, unref as d, onMounted as xe, openBlock as v, createBlock as H, withCtx as n, createElementVNode as S, createElementBlock as j, renderSlot as I, createCommentVNode as D, createVNode as s, normalizeStyle as X, createTextVNode as $, toDisplayString as Ee, h as N, toRaw as y } from "vue";
|
|
3
|
+
import { PlusSquareOutlined as Be, DeleteOutlined as Te, ReloadOutlined as $e, MoreOutlined as Ne } from "@vicons/antd";
|
|
4
|
+
import { resetObject as Re } from "../utils/helper.js";
|
|
5
|
+
import { cloneDeep as ze } from "lodash";
|
|
6
|
+
const Le = { class: "text-lg font-medium" }, _e = { id: "data-content" }, He = {
|
|
7
7
|
key: 0,
|
|
8
|
-
class: "rounded-lg bg-gray-50 flex flex-row gap-2 items-center justify-end p-
|
|
9
|
-
},
|
|
8
|
+
class: "rounded-lg bg-gray-50 flex flex-row gap-2 items-center justify-end p-4 mb-4"
|
|
9
|
+
}, je = { key: 1 }, Ie = { key: 2 }, Ue = /* @__PURE__ */ Oe({
|
|
10
10
|
__name: "PTable",
|
|
11
11
|
props: {
|
|
12
|
+
title: {},
|
|
12
13
|
idField: { default: "id" },
|
|
13
14
|
item: { default: {} },
|
|
14
15
|
columns: {},
|
|
@@ -23,27 +24,27 @@ const ze = { id: "data-content" }, Le = {
|
|
|
23
24
|
onSave: {},
|
|
24
25
|
onDelete: {}
|
|
25
26
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const P = c(null), J = ye(), w = we(),
|
|
27
|
+
setup(f, { expose: Y }) {
|
|
28
|
+
const P = c(null), J = ye(), w = we(), M = c(!1), O = c([]), x = c([]), p = c(null), h = c(!1), b = c(!1), E = c(!1), W = c({}), g = c({
|
|
28
29
|
page: 1,
|
|
29
30
|
itemCount: 0,
|
|
30
31
|
pageSize: 10,
|
|
31
32
|
pageSizes: [10, 20, 30, 50],
|
|
32
33
|
showSizePicker: !0,
|
|
33
34
|
onChange: async (e) => {
|
|
34
|
-
|
|
35
|
+
g.value.page = e, await m();
|
|
35
36
|
},
|
|
36
37
|
onUpdatePageSize: async (e) => {
|
|
37
|
-
|
|
38
|
+
g.value.pageSize = e, await m();
|
|
38
39
|
}
|
|
39
|
-
}), o =
|
|
40
|
+
}), o = f, Q = (e) => {
|
|
40
41
|
const t = (l) => {
|
|
41
42
|
const a = [];
|
|
42
|
-
return e && e.forEach((
|
|
43
|
-
|
|
44
|
-
label:
|
|
45
|
-
key:
|
|
46
|
-
props: { onClick: () =>
|
|
43
|
+
return e && e.forEach((r) => {
|
|
44
|
+
r.key !== "edit" && r.key !== "delete" && a.push({
|
|
45
|
+
label: r.name,
|
|
46
|
+
key: r.key,
|
|
47
|
+
props: { onClick: () => r.action(l) }
|
|
47
48
|
});
|
|
48
49
|
}), a;
|
|
49
50
|
};
|
|
@@ -73,7 +74,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
73
74
|
default: () => N(
|
|
74
75
|
C,
|
|
75
76
|
{ size: "small", type: "primary" },
|
|
76
|
-
{ default: () => ["操作", N(
|
|
77
|
+
{ default: () => ["操作", N(T, () => N(Ne))] }
|
|
77
78
|
)
|
|
78
79
|
}
|
|
79
80
|
);
|
|
@@ -97,7 +98,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
97
98
|
Q(t)
|
|
98
99
|
] : [{ type: "selection", fixed: "left" }, ...e];
|
|
99
100
|
}), ee = async () => {
|
|
100
|
-
await
|
|
101
|
+
await m();
|
|
101
102
|
}, te = (e) => {
|
|
102
103
|
A([e]);
|
|
103
104
|
}, oe = () => {
|
|
@@ -112,198 +113,212 @@ const ze = { id: "data-content" }, Le = {
|
|
|
112
113
|
onPositiveClick: async () => {
|
|
113
114
|
if (o.onDelete)
|
|
114
115
|
try {
|
|
115
|
-
await o.onDelete(e) ? (
|
|
116
|
+
await o.onDelete(e) ? (m(), w.success("删除成功")) : w.error("删除失败");
|
|
116
117
|
} catch (t) {
|
|
117
118
|
w.error(t.message);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
});
|
|
121
122
|
}, le = () => {
|
|
122
|
-
|
|
123
|
+
p.value = null, F();
|
|
123
124
|
}, ne = async (e) => {
|
|
124
|
-
|
|
125
|
-
o.onGet && (
|
|
125
|
+
p.value = ze(e), F(p.value, async () => {
|
|
126
|
+
o.onGet && (p.value = await o.onGet(e[o.idField])), Object.assign(o.item, p.value);
|
|
126
127
|
});
|
|
127
128
|
}, V = async () => {
|
|
128
129
|
if (o.onSave)
|
|
129
130
|
try {
|
|
130
|
-
E.value = !0, (h.value ? await o.onSave(void 0, y(o.item)) : await o.onSave(
|
|
131
|
+
E.value = !0, (h.value ? await o.onSave(void 0, y(o.item)) : await o.onSave(p.value[o.idField], y(o.item))) && (B(), await m());
|
|
131
132
|
} catch (e) {
|
|
132
133
|
w.error(e.message);
|
|
133
134
|
} finally {
|
|
134
135
|
E.value = !1;
|
|
135
136
|
}
|
|
136
137
|
}, F = async (e, t) => {
|
|
137
|
-
o.onOpenModal?.(e), await t?.(), e ? (h.value = !1,
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
}, R = () =>
|
|
141
|
-
if (!
|
|
142
|
-
|
|
138
|
+
o.onOpenModal?.(e), await t?.(), e ? (h.value = !1, b.value = !0) : (b.value = !1, h.value = !0);
|
|
139
|
+
}, B = () => {
|
|
140
|
+
p.value = null, Re(o.item), Object.assign(o.item, { ...y(W.value) }), o.onCloseModal?.(o.item), h.value = !1, b.value = !1;
|
|
141
|
+
}, R = () => O.value ? x.value.filter((t) => O.value.includes(t.id)).map((t) => y(t)) : [], ae = () => R()[0], se = () => y(x.value), m = async () => {
|
|
142
|
+
if (!M.value) {
|
|
143
|
+
M.value = !0;
|
|
143
144
|
try {
|
|
144
145
|
if (o.onLoad) {
|
|
145
146
|
var { data: e, total: t } = await o.onLoad(
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
g.value.page,
|
|
148
|
+
g.value.pageSize
|
|
148
149
|
);
|
|
149
|
-
|
|
150
|
+
x.value = e, g.value.itemCount = t;
|
|
150
151
|
}
|
|
151
152
|
} catch (l) {
|
|
152
153
|
w.error(l.message);
|
|
153
154
|
} finally {
|
|
154
|
-
|
|
155
|
+
M.value = !1;
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}, ie = K(() => {
|
|
158
|
-
const e =
|
|
159
|
+
const e = d(P);
|
|
159
160
|
if (!e) return;
|
|
160
|
-
const t = e?.$el, l = t.querySelector(".n-data-table-thead "), { bottomIncludeBody: a } = re(l),
|
|
161
|
-
let u =
|
|
162
|
-
const
|
|
161
|
+
const t = e?.$el, l = t.querySelector(".n-data-table-thead "), { bottomIncludeBody: a } = re(l), r = 48;
|
|
162
|
+
let u = 12, i = 24;
|
|
163
|
+
const k = t.querySelector(
|
|
163
164
|
".n-data-table__pagination"
|
|
164
165
|
);
|
|
165
|
-
if (
|
|
166
|
-
const z =
|
|
166
|
+
if (k) {
|
|
167
|
+
const z = k.offsetHeight;
|
|
167
168
|
u += z || 0;
|
|
168
169
|
} else
|
|
169
170
|
u += 28;
|
|
170
|
-
return a - (
|
|
171
|
+
return a - (r + u + i);
|
|
171
172
|
}), de = (e) => !e || !e.getBoundingClientRect ? 0 : e.getBoundingClientRect(), re = (e) => {
|
|
172
|
-
const t = document.documentElement, l = t.scrollLeft, a = t.scrollTop,
|
|
173
|
+
const t = document.documentElement, l = t.scrollLeft, a = t.scrollTop, r = t.clientLeft, u = t.clientTop, i = window.pageXOffset, k = window.pageYOffset, U = de(e), {
|
|
173
174
|
left: z,
|
|
174
175
|
top: ue,
|
|
175
176
|
width: fe,
|
|
176
177
|
height: pe
|
|
177
|
-
} = U, ge = (
|
|
178
|
+
} = U, ge = (i || l) - (r || 0), me = (k || a) - (u || 0), he = z + i, ve = ue + k, L = he - ge, _ = ve - me, q = window.document.documentElement.clientWidth, G = window.document.documentElement.clientHeight;
|
|
178
179
|
return {
|
|
179
180
|
left: L,
|
|
180
|
-
top:
|
|
181
|
+
top: _,
|
|
181
182
|
right: q - fe - L,
|
|
182
|
-
bottom: G - pe -
|
|
183
|
+
bottom: G - pe - _,
|
|
183
184
|
rightIncludeBody: q - L,
|
|
184
|
-
bottomIncludeBody: G -
|
|
185
|
+
bottomIncludeBody: G - _
|
|
185
186
|
};
|
|
186
187
|
}, ce = () => {
|
|
187
188
|
W.value = { ...y(o.item) };
|
|
188
189
|
};
|
|
189
|
-
return
|
|
190
|
-
ce(), await
|
|
190
|
+
return xe(async () => {
|
|
191
|
+
ce(), await m();
|
|
191
192
|
}), Y({
|
|
192
193
|
getData: se,
|
|
193
194
|
getSelectedRow: ae,
|
|
194
195
|
getSelectedRows: R,
|
|
195
|
-
closeModal:
|
|
196
|
-
refreshData:
|
|
196
|
+
closeModal: B,
|
|
197
|
+
refreshData: m,
|
|
197
198
|
resetPage: () => {
|
|
198
|
-
|
|
199
|
+
g.value.page = 1;
|
|
199
200
|
}
|
|
200
201
|
}), (e, t) => {
|
|
201
|
-
const l = De, a =
|
|
202
|
-
return v(),
|
|
203
|
-
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
bordered: !1
|
|
202
|
+
const l = De, a = Se, r = ke, u = Ce;
|
|
203
|
+
return v(), H(d(be), {
|
|
204
|
+
bordered: !1,
|
|
205
|
+
"content-class": "!p-0",
|
|
206
|
+
"header-class": "!px-0 !pt-0"
|
|
207
207
|
}, {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
header: n(() => [
|
|
209
|
+
s(a, {
|
|
210
|
+
justify: "space-between",
|
|
211
|
+
align: "center",
|
|
212
|
+
class: "w-full"
|
|
212
213
|
}, {
|
|
213
|
-
trigger: n(() => [
|
|
214
|
-
s(r(B), {
|
|
215
|
-
size: "18",
|
|
216
|
-
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
217
|
-
onClick: le
|
|
218
|
-
}, {
|
|
219
|
-
default: n(() => [
|
|
220
|
-
s(r(xe))
|
|
221
|
-
]),
|
|
222
|
-
_: 1
|
|
223
|
-
})
|
|
224
|
-
]),
|
|
225
|
-
default: n(() => [
|
|
226
|
-
t[3] || (t[3] = T("span", null, "新增", -1))
|
|
227
|
-
]),
|
|
228
|
-
_: 1
|
|
229
|
-
})),
|
|
230
|
-
m.hiddenDelete ? S("", !0) : (v(), _(l, {
|
|
231
|
-
key: 1,
|
|
232
|
-
trigger: "hover"
|
|
233
|
-
}, {
|
|
234
|
-
trigger: n(() => [
|
|
235
|
-
s(r(B), {
|
|
236
|
-
size: "18",
|
|
237
|
-
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
238
|
-
onClick: oe
|
|
239
|
-
}, {
|
|
240
|
-
default: n(() => [
|
|
241
|
-
s(r(Be))
|
|
242
|
-
]),
|
|
243
|
-
_: 1
|
|
244
|
-
})
|
|
245
|
-
]),
|
|
246
214
|
default: n(() => [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
_: 1
|
|
250
|
-
})),
|
|
251
|
-
s(l, { trigger: "hover" }, {
|
|
252
|
-
trigger: n(() => [
|
|
253
|
-
s(r(B), {
|
|
254
|
-
size: "18",
|
|
255
|
-
class: "cursor-pointer hover:text-blue-600",
|
|
256
|
-
onClick: ee
|
|
257
|
-
}, {
|
|
215
|
+
S("span", Le, Ee(f.title), 1),
|
|
216
|
+
s(a, null, {
|
|
258
217
|
default: n(() => [
|
|
259
|
-
|
|
218
|
+
f.hiddenAdd ? D("", !0) : (v(), H(l, {
|
|
219
|
+
key: 0,
|
|
220
|
+
trigger: "hover"
|
|
221
|
+
}, {
|
|
222
|
+
trigger: n(() => [
|
|
223
|
+
s(d(T), {
|
|
224
|
+
size: "18",
|
|
225
|
+
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
226
|
+
onClick: le
|
|
227
|
+
}, {
|
|
228
|
+
default: n(() => [
|
|
229
|
+
s(d(Be))
|
|
230
|
+
]),
|
|
231
|
+
_: 1
|
|
232
|
+
})
|
|
233
|
+
]),
|
|
234
|
+
default: n(() => [
|
|
235
|
+
t[3] || (t[3] = S("span", null, "新增", -1))
|
|
236
|
+
]),
|
|
237
|
+
_: 1
|
|
238
|
+
})),
|
|
239
|
+
f.hiddenDelete ? D("", !0) : (v(), H(l, {
|
|
240
|
+
key: 1,
|
|
241
|
+
trigger: "hover"
|
|
242
|
+
}, {
|
|
243
|
+
trigger: n(() => [
|
|
244
|
+
s(d(T), {
|
|
245
|
+
size: "18",
|
|
246
|
+
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
247
|
+
onClick: oe
|
|
248
|
+
}, {
|
|
249
|
+
default: n(() => [
|
|
250
|
+
s(d(Te))
|
|
251
|
+
]),
|
|
252
|
+
_: 1
|
|
253
|
+
})
|
|
254
|
+
]),
|
|
255
|
+
default: n(() => [
|
|
256
|
+
t[4] || (t[4] = S("span", null, "删除", -1))
|
|
257
|
+
]),
|
|
258
|
+
_: 1
|
|
259
|
+
})),
|
|
260
|
+
s(l, { trigger: "hover" }, {
|
|
261
|
+
trigger: n(() => [
|
|
262
|
+
s(d(T), {
|
|
263
|
+
size: "18",
|
|
264
|
+
class: "cursor-pointer hover:text-blue-600",
|
|
265
|
+
onClick: ee
|
|
266
|
+
}, {
|
|
267
|
+
default: n(() => [
|
|
268
|
+
s(d($e))
|
|
269
|
+
]),
|
|
270
|
+
_: 1
|
|
271
|
+
})
|
|
272
|
+
]),
|
|
273
|
+
default: n(() => [
|
|
274
|
+
t[5] || (t[5] = S("span", null, "刷新", -1))
|
|
275
|
+
]),
|
|
276
|
+
_: 1
|
|
277
|
+
})
|
|
260
278
|
]),
|
|
261
279
|
_: 1
|
|
262
280
|
})
|
|
263
281
|
]),
|
|
264
|
-
default: n(() => [
|
|
265
|
-
t[5] || (t[5] = T("span", null, "刷新", -1))
|
|
266
|
-
]),
|
|
267
282
|
_: 1
|
|
268
283
|
})
|
|
269
284
|
]),
|
|
270
285
|
default: n(() => [
|
|
271
|
-
|
|
272
|
-
e.$slots.toolbar ? (v(), j("div",
|
|
286
|
+
S("div", _e, [
|
|
287
|
+
e.$slots.toolbar ? (v(), j("div", He, [
|
|
273
288
|
I(e.$slots, "toolbar")
|
|
274
|
-
])) :
|
|
275
|
-
s(
|
|
289
|
+
])) : D("", !0),
|
|
290
|
+
s(r, {
|
|
276
291
|
remote: "",
|
|
277
292
|
ref_key: "$table",
|
|
278
293
|
ref: P,
|
|
279
|
-
"checked-row-keys":
|
|
280
|
-
"onUpdate:checkedRowKeys": t[0] || (t[0] = (
|
|
294
|
+
"checked-row-keys": O.value,
|
|
295
|
+
"onUpdate:checkedRowKeys": t[0] || (t[0] = (i) => O.value = i),
|
|
281
296
|
"max-height": ie.value,
|
|
282
|
-
loading:
|
|
297
|
+
loading: M.value,
|
|
283
298
|
bordered: !1,
|
|
284
299
|
"single-line": !1,
|
|
285
300
|
columns: Z.value,
|
|
286
|
-
data:
|
|
287
|
-
pagination:
|
|
288
|
-
"row-key": (
|
|
301
|
+
data: x.value,
|
|
302
|
+
pagination: g.value,
|
|
303
|
+
"row-key": (i) => i[f.idField]
|
|
289
304
|
}, null, 8, ["checked-row-keys", "max-height", "loading", "columns", "data", "pagination", "row-key"]),
|
|
290
|
-
e.$slots.addModal ? (v(), j("div",
|
|
305
|
+
e.$slots.addModal ? (v(), j("div", je, [
|
|
291
306
|
s(u, {
|
|
292
307
|
title: "新增",
|
|
293
308
|
preset: "card",
|
|
294
309
|
show: h.value,
|
|
295
|
-
"onUpdate:show": t[1] || (t[1] = (
|
|
310
|
+
"onUpdate:show": t[1] || (t[1] = (i) => h.value = i),
|
|
296
311
|
"header-class": "bg-gray-50",
|
|
297
312
|
closable: !1,
|
|
298
313
|
"close-on-esc": !1,
|
|
299
314
|
"mask-closable": !1,
|
|
300
315
|
draggable: !0,
|
|
301
|
-
style: X({ width: `${
|
|
316
|
+
style: X({ width: `${f.modalWidth}px` })
|
|
302
317
|
}, {
|
|
303
318
|
action: n(() => [
|
|
304
|
-
s(
|
|
319
|
+
s(a, { justify: "end" }, {
|
|
305
320
|
default: n(() => [
|
|
306
|
-
s(
|
|
321
|
+
s(d(C), {
|
|
307
322
|
type: "primary",
|
|
308
323
|
loading: E.value,
|
|
309
324
|
onClick: V
|
|
@@ -313,7 +328,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
313
328
|
])]),
|
|
314
329
|
_: 1
|
|
315
330
|
}, 8, ["loading"]),
|
|
316
|
-
s(
|
|
331
|
+
s(d(C), { onClick: B }, {
|
|
317
332
|
default: n(() => [...t[7] || (t[7] = [
|
|
318
333
|
$("取消", -1)
|
|
319
334
|
])]),
|
|
@@ -328,24 +343,24 @@ const ze = { id: "data-content" }, Le = {
|
|
|
328
343
|
]),
|
|
329
344
|
_: 3
|
|
330
345
|
}, 8, ["show", "style"])
|
|
331
|
-
])) :
|
|
332
|
-
e.$slots.editModal ? (v(), j("div",
|
|
346
|
+
])) : D("", !0),
|
|
347
|
+
e.$slots.editModal ? (v(), j("div", Ie, [
|
|
333
348
|
s(u, {
|
|
334
349
|
title: "编辑",
|
|
335
|
-
show:
|
|
336
|
-
"onUpdate:show": t[2] || (t[2] = (
|
|
350
|
+
show: b.value,
|
|
351
|
+
"onUpdate:show": t[2] || (t[2] = (i) => b.value = i),
|
|
337
352
|
preset: "card",
|
|
338
353
|
"header-class": "bg-gray-50",
|
|
339
354
|
closable: !1,
|
|
340
355
|
"close-on-esc": !1,
|
|
341
356
|
"mask-closable": !1,
|
|
342
357
|
draggable: !0,
|
|
343
|
-
style: X({ width: `${
|
|
358
|
+
style: X({ width: `${f.modalWidth}px` })
|
|
344
359
|
}, {
|
|
345
360
|
action: n(() => [
|
|
346
|
-
s(
|
|
361
|
+
s(a, { justify: "end" }, {
|
|
347
362
|
default: n(() => [
|
|
348
|
-
s(
|
|
363
|
+
s(d(C), {
|
|
349
364
|
type: "primary",
|
|
350
365
|
loading: E.value,
|
|
351
366
|
onClick: V
|
|
@@ -355,7 +370,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
355
370
|
])]),
|
|
356
371
|
_: 1
|
|
357
372
|
}, 8, ["loading"]),
|
|
358
|
-
s(
|
|
373
|
+
s(d(C), { onClick: B }, {
|
|
359
374
|
default: n(() => [...t[9] || (t[9] = [
|
|
360
375
|
$("取消", -1)
|
|
361
376
|
])]),
|
|
@@ -370,7 +385,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
370
385
|
]),
|
|
371
386
|
_: 3
|
|
372
387
|
}, 8, ["show", "style"])
|
|
373
|
-
])) :
|
|
388
|
+
])) : D("", !0)
|
|
374
389
|
])
|
|
375
390
|
]),
|
|
376
391
|
_: 3
|
|
@@ -379,5 +394,5 @@ const ze = { id: "data-content" }, Le = {
|
|
|
379
394
|
}
|
|
380
395
|
});
|
|
381
396
|
export {
|
|
382
|
-
|
|
397
|
+
Ue as default
|
|
383
398
|
};
|
package/es/table/typing.d.ts
CHANGED
package/lib/components.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./table/index.cjs"),i=require("./layout/index.cjs"),n=require("./application/index.cjs"),u=require("./modal/index.cjs"),r=require("./languages/index.cjs"),t=require("./redirect/index.cjs"),l=require("./iframe/index.cjs"),e=require("./error/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./table/index.cjs"),i=require("./layout/index.cjs"),n=require("./application/index.cjs"),u=require("./modal/index.cjs"),r=require("./languages/index.cjs"),t=require("./redirect/index.cjs"),l=require("./iframe/index.cjs"),o=require("./page/index.cjs"),e=require("./error/index.cjs"),g=require("./oidc/index.cjs");exports.PTable=P.PTablePlugin;exports.PEmptyLayout=i.PEmptyLayoutPlugin;exports.PLayout=i.PLayoutPlugin;exports.PApplication=n.PApplicationPlugin;exports.PModal=u.PModalPlugin;exports.PLanguage=r.PLanguagePlugin;exports.PRedirect=t.PRedirectPlugin;exports.PIframe=l.PIframePlugin;exports.PPage=o.PPagePlugin;exports.P403=e.P403Plugin;exports.P404=e.P404Plugin;exports.P500=e.P500Plugin;exports.POidc=g.POidcPlugin;
|
package/lib/components.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export { PModalPlugin as PModal } from './modal';
|
|
|
5
5
|
export { PLanguagePlugin as PLanguage } from './languages';
|
|
6
6
|
export { PRedirectPlugin as PRedirect } from './redirect';
|
|
7
7
|
export { PIframePlugin as PIframe } from './iframe';
|
|
8
|
+
export { PPagePlugin as PPage } from './page';
|
|
8
9
|
export { P500Plugin as P500, P404Plugin as P404, P403Plugin as P403, } from './error';
|
|
9
10
|
export { POidcPlugin as POidc } from './oidc';
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./components.cjs"),u=require("./layout/index.cjs"),P=require("./languages/index.cjs"),s=require("./oidc/index.cjs"),e=require("./error/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./components.cjs"),u=require("./layout/index.cjs"),P=require("./languages/index.cjs"),s=require("./oidc/index.cjs"),e=require("./error/index.cjs"),a=require("./application/index.cjs"),l=require("./iframe/index.cjs"),c=require("./modal/index.cjs"),g=require("./page/index.cjs"),d=require("./redirect/index.cjs"),q=require("./table/index.cjs"),$=require("./languages/store.cjs"),x=require("./layout/store.cjs"),L=require("./oidc/store.cjs"),t=(i,r)=>(Object.values(o).forEach(n=>{n.install&&i.use(n)}),r?.(),i),y={install:t};exports.PEmptyLayout=u.PEmptyLayoutPlugin;exports.PLayout=u.PLayoutPlugin;exports.PLanguage=P.PLanguagePlugin;exports.POidc=s.POidcPlugin;exports.P403=e.P403Plugin;exports.P404=e.P404Plugin;exports.P500=e.P500Plugin;exports.PApplication=a.PApplicationPlugin;exports.PIframe=l.PIframePlugin;exports.PModal=c.PModalPlugin;exports.PPage=g.PPagePlugin;exports.PRedirect=d.PRedirectPlugin;exports.PTable=q.PTablePlugin;exports.useLanguageStore=$.useLanguageStore;exports.useLayoutStore=x.useLayoutStore;exports.useOidcStore=L.useOidcStore;exports.default=y;exports.install=t;
|
package/lib/layout/PLayout.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.layout[data-v-
|
|
1
|
+
.layout[data-v-0bac2e7d]{display:flex;flex-direction:row;flex:auto}.layout-default-background[data-v-0bac2e7d]{background:#f5f7f9}.layout .layout-sider[data-v-0bac2e7d]{min-height:100vh;box-shadow:2px 0 8px #1d23290d;position:relative;z-index:13;transition:all .2s ease-in-out}.layout .layout-sider-fix[data-v-0bac2e7d]{position:fixed;top:0;left:0}.layout .ant-layout[data-v-0bac2e7d]{overflow:hidden}.layout .layout-right-fix[data-v-0bac2e7d]{overflow-x:hidden;padding-left:200px;min-height:100vh;transition:all .2s ease-in-out}.layout .layout-content[data-v-0bac2e7d]{flex:auto;min-height:100vh}.layout .n-layout-header.n-layout-header--absolute-positioned[data-v-0bac2e7d]{z-index:11}.layout-content-main[data-v-0bac2e7d]{margin:0 5px 5px;position:relative;padding-top:64px}.layout-content-main-fix[data-v-0bac2e7d]{padding-top:64px}.main-view-fix[data-v-0bac2e7d]{padding-top:45px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./PLayout.vue2.cjs");;/* empty css */const t=require("../_virtual/_plugin-vue_export-helper.cjs"),u=t.default(e.default,[["__scopeId","data-v-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./PLayout.vue2.cjs");;/* empty css */const t=require("../_virtual/_plugin-vue_export-helper.cjs"),u=t.default(e.default,[["__scopeId","data-v-0bac2e7d"]]);exports.default=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("naive-ui"),e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("naive-ui"),e=require("vue"),n=require("./sider/PLogo.vue.cjs"),s=require("./header/PHeader.vue.cjs"),u=require("./content/PContent.vue.cjs"),c=require("./content/PTabs.vue.cjs"),i=require("./sider/PMenus.vue.cjs"),d=require("./store.cjs"),_={class:"layout-content-main layout-content-main-fix"},f={class:"main-view main-view-fix"},p=e.defineComponent({__name:"PLayout",setup(g){const a=d.useLayoutStore(),o=e.ref(!1),r=()=>{o.value=!0,e.nextTick(()=>o.value=!1)};return e.provide("reloadPage",r),(N,v)=>{const l=t.NBackTop;return e.openBlock(),e.createBlock(e.unref(t.NLayout),{"has-sider":"",class:"layout",position:"absolute"},{default:e.withCtx(()=>[e.createVNode(e.unref(t.NLayoutSider),{class:"layout-sider",inverted:"","show-trigger":"bar",position:"absolute","collapse-mode":"width","trigger-class":"!-right-5","collapsed-trigger-class":"!-right-5",collapsed:e.unref(a).state.collapsed,"native-scrollbar":!1,"collapsed-width":64,onCollapse:e.unref(a).collapse,onExpand:e.unref(a).collapse},{default:e.withCtx(()=>[e.createVNode(e.unref(t.NFlex),{vertical:""},{default:e.withCtx(()=>[e.createVNode(n.default),e.createVNode(i.default)]),_:1})]),_:1},8,["collapsed","onCollapse","onExpand"]),e.createVNode(e.unref(t.NLayout),null,{default:e.withCtx(()=>[e.createVNode(e.unref(t.NLayoutHeader),{position:"absolute"},{default:e.withCtx(()=>[e.createVNode(s.default)]),_:1}),e.createVNode(e.unref(t.NLayoutContent),{class:"layout-content layout-default-background"},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(c.default),e.createElementVNode("div",f,[e.createVNode(u.default,{loading:o.value},null,8,["loading"])])])]),_:1}),e.createVNode(l,{right:20,class:"z-50"})]),_:1})]),_:1})}}});exports.default=p;
|
package/lib/layout/store.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("pinia"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("pinia"),n=require("vue"),i=["Redirect","RedirectSon","login"],c=o.defineStore("p-layout",()=>{const e=n.reactive({collapsed:!1,title:"输入项目名称",logo:"https://picsum.photos/id/1/100/100",avatar:"",uid:"",uname:"",tabs:[],cacheTabs:!1,enableLanguage:!1});return{state:e,initTabs:t=>{t.sort((s,a)=>(a.meta.affix?1:0)-(s.meta.affix?1:0)),e.tabs=t},addTab:t=>i.includes(t.name)?!1:(e.tabs?.some(a=>a.fullPath==t.fullPath)||e.tabs?.push(t),!0),closeCurrentTab:t=>{const s=e.tabs.findIndex(a=>a.fullPath==t.fullPath);e.tabs.splice(s,1)},closeAllTabs:()=>{e.tabs=e.tabs.filter(t=>t?.meta?.affix??!1)},closeOtherTabs:t=>{e.tabs=e.tabs.filter(s=>s.fullPath==t.fullPath||(s?.meta?.affix??!1))},closeLeftTabs:t=>{const s=e.tabs.findIndex(a=>a.fullPath==t.fullPath);e.tabs=e.tabs.filter((a,l)=>l>=s||(a?.meta?.affix??!1))},closeRightTabs:t=>{const s=e.tabs.findIndex(a=>a.fullPath==t.fullPath);e.tabs=e.tabs.filter((a,l)=>l<=s||(a?.meta?.affix??!1))},collapse:()=>{e.collapsed=!e.collapsed},setTitle:t=>{e.title=t},setLogo:t=>{e.logo=t},setUser:(t,s)=>{e.uid=t,e.uname=s},setSettingPages:t=>{e.settingPages=t},setLogout:t=>{e.logout=t},enableLanguage:t=>{e.enableLanguage=t}}});exports.useLayoutStore=c;
|
package/lib/layout/store.d.ts
CHANGED
|
@@ -6995,6 +6995,7 @@ export declare const useLayoutStore: import('pinia').StoreDefinition<"p-layout",
|
|
|
6995
6995
|
title: string;
|
|
6996
6996
|
}[]) => void;
|
|
6997
6997
|
setLogout: (logout: () => Promise<void>) => void;
|
|
6998
|
+
enableLanguage: (enable: boolean) => void;
|
|
6998
6999
|
}, "state">, Pick<{
|
|
6999
7000
|
state: {
|
|
7000
7001
|
title: string;
|
|
@@ -13991,6 +13992,7 @@ export declare const useLayoutStore: import('pinia').StoreDefinition<"p-layout",
|
|
|
13991
13992
|
title: string;
|
|
13992
13993
|
}[]) => void;
|
|
13993
13994
|
setLogout: (logout: () => Promise<void>) => void;
|
|
13995
|
+
enableLanguage: (enable: boolean) => void;
|
|
13994
13996
|
}, never>, Pick<{
|
|
13995
13997
|
state: {
|
|
13996
13998
|
title: string;
|
|
@@ -20987,4 +20989,5 @@ export declare const useLayoutStore: import('pinia').StoreDefinition<"p-layout",
|
|
|
20987
20989
|
title: string;
|
|
20988
20990
|
}[]) => void;
|
|
20989
20991
|
setLogout: (logout: () => Promise<void>) => void;
|
|
20990
|
-
|
|
20992
|
+
enableLanguage: (enable: boolean) => void;
|
|
20993
|
+
}, "enableLanguage" | "initTabs" | "addTab" | "closeCurrentTab" | "closeAllTabs" | "closeOtherTabs" | "closeLeftTabs" | "closeRightTabs" | "collapse" | "setTitle" | "setLogo" | "setUser" | "setSettingPages" | "setLogout">>;
|