@chewel611/naive-ui-plus 0.0.27 → 0.0.29
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 +795 -700
- 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/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 +147 -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/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
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 Ee, 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 xe, 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([]), E = c([]), g = c(null), h = c(!1), b = c(!1), x = c(!1), W = c({}), p = 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
|
-
p.value.page = e, await
|
|
35
|
+
p.value.page = e, await m();
|
|
35
36
|
},
|
|
36
37
|
onUpdatePageSize: async (e) => {
|
|
37
|
-
p.value.pageSize = e, await
|
|
38
|
+
p.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,200 +113,210 @@ 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
|
+
g.value = null, F();
|
|
123
124
|
}, ne = async (e) => {
|
|
124
|
-
|
|
125
|
-
o.onGet && (
|
|
125
|
+
g.value = ze(e), F(g.value, async () => {
|
|
126
|
+
o.onGet && (g.value = await o.onGet(e[o.idField])), Object.assign(o.item, g.value);
|
|
126
127
|
});
|
|
127
128
|
}, V = async () => {
|
|
128
129
|
if (o.onSave)
|
|
129
130
|
try {
|
|
130
|
-
|
|
131
|
+
x.value = !0, (h.value ? await o.onSave(void 0, y(o.item)) : await o.onSave(g.value[o.idField], y(o.item))) && (B(), await m());
|
|
131
132
|
} catch (e) {
|
|
132
133
|
w.error(e.message);
|
|
133
134
|
} finally {
|
|
134
|
-
|
|
135
|
+
x.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
|
+
g.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 ? E.value.filter((t) => O.value.includes(t.id)).map((t) => y(t)) : [], ae = () => R()[0], se = () => y(E.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
|
p.value.page,
|
|
147
148
|
p.value.pageSize
|
|
148
149
|
);
|
|
149
|
-
|
|
150
|
+
E.value = e, p.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
|
-
height:
|
|
177
|
-
} = U,
|
|
177
|
+
height: ge
|
|
178
|
+
} = U, pe = (i || l) - (r || 0), me = (k || a) - (u || 0), he = z + i, ve = ue + k, L = he - pe, _ = 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 -
|
|
183
|
+
bottom: G - ge - _,
|
|
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
190
|
return Ee(async () => {
|
|
190
|
-
ce(), await
|
|
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
|
p.value.page = 1;
|
|
199
200
|
}
|
|
200
201
|
}), (e, t) => {
|
|
201
|
-
const l = De, a =
|
|
202
|
-
return v(),
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"header-extra": n(() => [
|
|
209
|
-
m.hiddenAdd ? S("", !0) : (v(), _(l, {
|
|
210
|
-
key: 0,
|
|
211
|
-
trigger: "hover"
|
|
202
|
+
const l = De, a = Se, r = ke, u = Ce;
|
|
203
|
+
return v(), H(d(be), { bordered: !1 }, {
|
|
204
|
+
header: n(() => [
|
|
205
|
+
s(a, {
|
|
206
|
+
justify: "space-between",
|
|
207
|
+
align: "center",
|
|
208
|
+
class: "w-full"
|
|
212
209
|
}, {
|
|
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
210
|
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
|
-
}, {
|
|
211
|
+
S("span", Le, xe(f.title), 1),
|
|
212
|
+
s(a, null, {
|
|
258
213
|
default: n(() => [
|
|
259
|
-
|
|
214
|
+
f.hiddenAdd ? D("", !0) : (v(), H(l, {
|
|
215
|
+
key: 0,
|
|
216
|
+
trigger: "hover"
|
|
217
|
+
}, {
|
|
218
|
+
trigger: n(() => [
|
|
219
|
+
s(d(T), {
|
|
220
|
+
size: "18",
|
|
221
|
+
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
222
|
+
onClick: le
|
|
223
|
+
}, {
|
|
224
|
+
default: n(() => [
|
|
225
|
+
s(d(Be))
|
|
226
|
+
]),
|
|
227
|
+
_: 1
|
|
228
|
+
})
|
|
229
|
+
]),
|
|
230
|
+
default: n(() => [
|
|
231
|
+
t[3] || (t[3] = S("span", null, "新增", -1))
|
|
232
|
+
]),
|
|
233
|
+
_: 1
|
|
234
|
+
})),
|
|
235
|
+
f.hiddenDelete ? D("", !0) : (v(), H(l, {
|
|
236
|
+
key: 1,
|
|
237
|
+
trigger: "hover"
|
|
238
|
+
}, {
|
|
239
|
+
trigger: n(() => [
|
|
240
|
+
s(d(T), {
|
|
241
|
+
size: "18",
|
|
242
|
+
class: "mr-1 cursor-pointer hover:text-blue-600",
|
|
243
|
+
onClick: oe
|
|
244
|
+
}, {
|
|
245
|
+
default: n(() => [
|
|
246
|
+
s(d(Te))
|
|
247
|
+
]),
|
|
248
|
+
_: 1
|
|
249
|
+
})
|
|
250
|
+
]),
|
|
251
|
+
default: n(() => [
|
|
252
|
+
t[4] || (t[4] = S("span", null, "删除", -1))
|
|
253
|
+
]),
|
|
254
|
+
_: 1
|
|
255
|
+
})),
|
|
256
|
+
s(l, { trigger: "hover" }, {
|
|
257
|
+
trigger: n(() => [
|
|
258
|
+
s(d(T), {
|
|
259
|
+
size: "18",
|
|
260
|
+
class: "cursor-pointer hover:text-blue-600",
|
|
261
|
+
onClick: ee
|
|
262
|
+
}, {
|
|
263
|
+
default: n(() => [
|
|
264
|
+
s(d($e))
|
|
265
|
+
]),
|
|
266
|
+
_: 1
|
|
267
|
+
})
|
|
268
|
+
]),
|
|
269
|
+
default: n(() => [
|
|
270
|
+
t[5] || (t[5] = S("span", null, "刷新", -1))
|
|
271
|
+
]),
|
|
272
|
+
_: 1
|
|
273
|
+
})
|
|
260
274
|
]),
|
|
261
275
|
_: 1
|
|
262
276
|
})
|
|
263
277
|
]),
|
|
264
|
-
default: n(() => [
|
|
265
|
-
t[5] || (t[5] = T("span", null, "刷新", -1))
|
|
266
|
-
]),
|
|
267
278
|
_: 1
|
|
268
279
|
})
|
|
269
280
|
]),
|
|
270
281
|
default: n(() => [
|
|
271
|
-
|
|
272
|
-
e.$slots.toolbar ? (v(), j("div",
|
|
282
|
+
S("div", _e, [
|
|
283
|
+
e.$slots.toolbar ? (v(), j("div", He, [
|
|
273
284
|
I(e.$slots, "toolbar")
|
|
274
|
-
])) :
|
|
275
|
-
s(
|
|
285
|
+
])) : D("", !0),
|
|
286
|
+
s(r, {
|
|
276
287
|
remote: "",
|
|
277
288
|
ref_key: "$table",
|
|
278
289
|
ref: P,
|
|
279
|
-
"checked-row-keys":
|
|
280
|
-
"onUpdate:checkedRowKeys": t[0] || (t[0] = (
|
|
290
|
+
"checked-row-keys": O.value,
|
|
291
|
+
"onUpdate:checkedRowKeys": t[0] || (t[0] = (i) => O.value = i),
|
|
281
292
|
"max-height": ie.value,
|
|
282
|
-
loading:
|
|
293
|
+
loading: M.value,
|
|
283
294
|
bordered: !1,
|
|
284
295
|
"single-line": !1,
|
|
285
296
|
columns: Z.value,
|
|
286
|
-
data:
|
|
297
|
+
data: E.value,
|
|
287
298
|
pagination: p.value,
|
|
288
|
-
"row-key": (
|
|
299
|
+
"row-key": (i) => i[f.idField]
|
|
289
300
|
}, null, 8, ["checked-row-keys", "max-height", "loading", "columns", "data", "pagination", "row-key"]),
|
|
290
|
-
e.$slots.addModal ? (v(), j("div",
|
|
301
|
+
e.$slots.addModal ? (v(), j("div", je, [
|
|
291
302
|
s(u, {
|
|
292
303
|
title: "新增",
|
|
293
304
|
preset: "card",
|
|
294
305
|
show: h.value,
|
|
295
|
-
"onUpdate:show": t[1] || (t[1] = (
|
|
306
|
+
"onUpdate:show": t[1] || (t[1] = (i) => h.value = i),
|
|
296
307
|
"header-class": "bg-gray-50",
|
|
297
308
|
closable: !1,
|
|
298
309
|
"close-on-esc": !1,
|
|
299
310
|
"mask-closable": !1,
|
|
300
311
|
draggable: !0,
|
|
301
|
-
style: X({ width: `${
|
|
312
|
+
style: X({ width: `${f.modalWidth}px` })
|
|
302
313
|
}, {
|
|
303
314
|
action: n(() => [
|
|
304
|
-
s(
|
|
315
|
+
s(a, { justify: "end" }, {
|
|
305
316
|
default: n(() => [
|
|
306
|
-
s(
|
|
317
|
+
s(d(C), {
|
|
307
318
|
type: "primary",
|
|
308
|
-
loading:
|
|
319
|
+
loading: x.value,
|
|
309
320
|
onClick: V
|
|
310
321
|
}, {
|
|
311
322
|
default: n(() => [...t[6] || (t[6] = [
|
|
@@ -313,7 +324,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
313
324
|
])]),
|
|
314
325
|
_: 1
|
|
315
326
|
}, 8, ["loading"]),
|
|
316
|
-
s(
|
|
327
|
+
s(d(C), { onClick: B }, {
|
|
317
328
|
default: n(() => [...t[7] || (t[7] = [
|
|
318
329
|
$("取消", -1)
|
|
319
330
|
])]),
|
|
@@ -328,26 +339,26 @@ const ze = { id: "data-content" }, Le = {
|
|
|
328
339
|
]),
|
|
329
340
|
_: 3
|
|
330
341
|
}, 8, ["show", "style"])
|
|
331
|
-
])) :
|
|
332
|
-
e.$slots.editModal ? (v(), j("div",
|
|
342
|
+
])) : D("", !0),
|
|
343
|
+
e.$slots.editModal ? (v(), j("div", Ie, [
|
|
333
344
|
s(u, {
|
|
334
345
|
title: "编辑",
|
|
335
|
-
show:
|
|
336
|
-
"onUpdate:show": t[2] || (t[2] = (
|
|
346
|
+
show: b.value,
|
|
347
|
+
"onUpdate:show": t[2] || (t[2] = (i) => b.value = i),
|
|
337
348
|
preset: "card",
|
|
338
349
|
"header-class": "bg-gray-50",
|
|
339
350
|
closable: !1,
|
|
340
351
|
"close-on-esc": !1,
|
|
341
352
|
"mask-closable": !1,
|
|
342
353
|
draggable: !0,
|
|
343
|
-
style: X({ width: `${
|
|
354
|
+
style: X({ width: `${f.modalWidth}px` })
|
|
344
355
|
}, {
|
|
345
356
|
action: n(() => [
|
|
346
|
-
s(
|
|
357
|
+
s(a, { justify: "end" }, {
|
|
347
358
|
default: n(() => [
|
|
348
|
-
s(
|
|
359
|
+
s(d(C), {
|
|
349
360
|
type: "primary",
|
|
350
|
-
loading:
|
|
361
|
+
loading: x.value,
|
|
351
362
|
onClick: V
|
|
352
363
|
}, {
|
|
353
364
|
default: n(() => [...t[8] || (t[8] = [
|
|
@@ -355,7 +366,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
355
366
|
])]),
|
|
356
367
|
_: 1
|
|
357
368
|
}, 8, ["loading"]),
|
|
358
|
-
s(
|
|
369
|
+
s(d(C), { onClick: B }, {
|
|
359
370
|
default: n(() => [...t[9] || (t[9] = [
|
|
360
371
|
$("取消", -1)
|
|
361
372
|
])]),
|
|
@@ -370,7 +381,7 @@ const ze = { id: "data-content" }, Le = {
|
|
|
370
381
|
]),
|
|
371
382
|
_: 3
|
|
372
383
|
}, 8, ["show", "style"])
|
|
373
|
-
])) :
|
|
384
|
+
])) : D("", !0)
|
|
374
385
|
])
|
|
375
386
|
]),
|
|
376
387
|
_: 3
|
|
@@ -379,5 +390,5 @@ const ze = { id: "data-content" }, Le = {
|
|
|
379
390
|
}
|
|
380
391
|
});
|
|
381
392
|
export {
|
|
382
|
-
|
|
393
|
+
Ue as default
|
|
383
394
|
};
|
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;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
search?(_: {}): any;
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
12
|
+
icon: {
|
|
13
|
+
type: ObjectConstructor;
|
|
14
|
+
required: false;
|
|
15
|
+
default: () => import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
};
|
|
17
|
+
title: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
subtitle: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
required: false;
|
|
24
|
+
};
|
|
25
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, 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
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
42
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("naive-ui"),e=require("vue"),i=require("@vicons/antd"),d={class:"border border-gray-100 rounded-lg"},u={class:"text-xl font-semibold text-gray-800"},p={class:"text-sm text-gray-500 mt-1"},m=e.defineComponent({__name:"PPage",props:{icon:{type:Object,required:!1,default:()=>i.AlertOutlined},title:{type:String,required:!0},subtitle:{type:String,required:!1}},setup(l){const t=l;return(o,_)=>{const a=n.NIcon,s=n.NAvatar,c=n.NSpace,r=n.NCard;return e.openBlock(),e.createElementBlock("div",d,[t.title?(e.openBlock(),e.createBlock(r,{key:0,class:"mb-4",bordered:!1,"content-class":"py-4"},{default:e.withCtx(()=>[e.createVNode(c,{align:"center",justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(c,{align:"center",size:16},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createBlock(s,{key:0,size:48,class:"bg-linear-to-br from-blue-500 to-indigo-600"},{default:e.withCtx(()=>[e.createVNode(a,{size:24,component:t.icon,color:"#fff"},null,8,["component"])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("div",u,e.toDisplayString(t.title),1),e.createElementVNode("div",p,e.toDisplayString(t.subtitle??t.title+"主页"),1)])]),_:1})]),_:1})]),_:1})):e.createCommentVNode("",!0),o.$slots.search?(e.openBlock(),e.createBlock(r,{key:1,class:"mb-4",bordered:!1,"content-class":"py-4"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"search")]),_:3})):e.createCommentVNode("",!0),o.$slots.default?(e.openBlock(),e.createBlock(r,{key:2,bordered:!1,"content-class":"!py-0"},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3})):e.createCommentVNode("",!0)])}}});exports.default=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./PPage.vue.cjs");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./PPage.vue.cjs"),t=require("../utils/install.cjs"),u=t.withInstall(e.default);exports.PPagePlugin=u;
|
|
@@ -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;
|