yuang-framework-ui-pc 1.1.9 → 1.1.11
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/es/ele-admin-layout/index.js +41 -138
- package/es/ele-config-provider/index.js +0 -6
- package/es/ele-drawer/index.d.ts +2 -2
- package/es/ele-loading/index.js +1 -6
- package/es/ele-modal/index.d.ts +2 -2
- package/es/ele-pagination/index.d.ts +2 -0
- package/es/ele-pagination/props.d.ts +1 -0
- package/es/ele-pro-table/index.d.ts +7 -4
- package/es/ele-pro-table/index.js +37 -23
- package/es/ele-pro-table/types.d.ts +11 -3
- package/es/ele-pro-table/util.js +0 -1
- package/es/ele-virtual-table/index.d.ts +11 -0
- package/es/ele-virtual-table/props.d.ts +5 -0
- package/es/ele-watermark/index.js +3 -15
- package/lib/ele-admin-layout/index.cjs +41 -138
- package/lib/ele-config-provider/index.cjs +0 -6
- package/lib/ele-drawer/index.d.ts +2 -2
- package/lib/ele-loading/index.cjs +1 -6
- package/lib/ele-modal/index.d.ts +2 -2
- package/lib/ele-pagination/index.d.ts +2 -0
- package/lib/ele-pagination/props.d.ts +1 -0
- package/lib/ele-pro-table/index.cjs +35 -21
- package/lib/ele-pro-table/index.d.ts +7 -4
- package/lib/ele-pro-table/types.d.ts +11 -3
- package/lib/ele-pro-table/util.cjs +0 -1
- package/lib/ele-virtual-table/index.d.ts +11 -0
- package/lib/ele-virtual-table/props.d.ts +5 -0
- package/lib/ele-watermark/index.cjs +3 -15
- package/package.json +2 -2
|
@@ -8,20 +8,7 @@ import LayoutSkeleton from "./components/layout-skeleton";
|
|
|
8
8
|
import LayoutTabs from "./components/layout-tabs";
|
|
9
9
|
import { adminLayoutProps, adminLayoutEmits, LAYOUT_KEY } from "./props";
|
|
10
10
|
const tabSlots = ["tabTitle", "tabExtra", "tabHome"];
|
|
11
|
-
const ownSlots = [
|
|
12
|
-
"logo",
|
|
13
|
-
"logoTitle",
|
|
14
|
-
"left",
|
|
15
|
-
"right",
|
|
16
|
-
"center",
|
|
17
|
-
"breadcrumb",
|
|
18
|
-
"top",
|
|
19
|
-
"bottom",
|
|
20
|
-
"boxTop",
|
|
21
|
-
"boxBottom",
|
|
22
|
-
"body",
|
|
23
|
-
...tabSlots
|
|
24
|
-
];
|
|
11
|
+
const ownSlots = ["logo", "logoTitle", "left", "right", "center", "breadcrumb", "top", "bottom", "boxTop", "boxBottom", "body", ...tabSlots];
|
|
25
12
|
const _sfc_main = defineComponent({
|
|
26
13
|
name: "EleAdminLayout",
|
|
27
14
|
components: {
|
|
@@ -45,56 +32,26 @@ const _sfc_main = defineComponent({
|
|
|
45
32
|
const contentRef = shallowRef(null);
|
|
46
33
|
const modalsRef = shallowRef(null);
|
|
47
34
|
const isDisableTransition = shallowRef(false);
|
|
48
|
-
const layoutHeight = computed(
|
|
49
|
-
|
|
50
|
-
);
|
|
51
|
-
const isFixedHeader = computed(
|
|
52
|
-
() => !props.fixedBody && props.fixedHeader
|
|
53
|
-
);
|
|
54
|
-
const isFixedSidebar = computed(
|
|
55
|
-
() => !props.fixedBody && props.fixedSidebar
|
|
56
|
-
);
|
|
35
|
+
const layoutHeight = computed(() => typeof props.height === "number" ? `${props.height}px` : props.height);
|
|
36
|
+
const isFixedHeader = computed(() => !props.fixedBody && props.fixedHeader);
|
|
37
|
+
const isFixedSidebar = computed(() => !props.fixedBody && props.fixedSidebar);
|
|
57
38
|
const isTopLayout = computed(() => props.layout === "top");
|
|
58
39
|
const isSideLayout = computed(() => props.layout === "side");
|
|
59
|
-
const isBoxSidebar = computed(
|
|
60
|
-
|
|
61
|
-
);
|
|
62
|
-
const isMixSidebar = computed(
|
|
63
|
-
() => !isTopLayout.value && (props.sidebarLayout === "mix" || isBoxSidebar.value)
|
|
64
|
-
);
|
|
40
|
+
const isBoxSidebar = computed(() => props.sidebarLayout === "box");
|
|
41
|
+
const isMixSidebar = computed(() => !isTopLayout.value && (props.sidebarLayout === "mix" || isBoxSidebar.value));
|
|
65
42
|
const isMobile = computed(() => props.mobile && !isTopLayout.value);
|
|
66
|
-
const isHeaderLogo = computed(
|
|
67
|
-
|
|
68
|
-
);
|
|
69
|
-
const showHeaderMenus = computed(
|
|
70
|
-
() => isTopLayout.value || props.layout === "mix"
|
|
71
|
-
);
|
|
43
|
+
const isHeaderLogo = computed(() => (props.logoInHeader || isTopLayout.value) && !isSideLayout.value && !isMobile.value);
|
|
44
|
+
const showHeaderMenus = computed(() => isTopLayout.value || props.layout === "mix");
|
|
72
45
|
const showHeaderTabs = computed(() => props.tabBar === "header");
|
|
73
|
-
const isDarkHeader = computed(
|
|
74
|
-
|
|
75
|
-
);
|
|
76
|
-
const isPrimaryHeader = computed(
|
|
77
|
-
() => props.headerStyle === "primary"
|
|
78
|
-
);
|
|
46
|
+
const isDarkHeader = computed(() => props.headerStyle === "dark");
|
|
47
|
+
const isPrimaryHeader = computed(() => props.headerStyle === "primary");
|
|
79
48
|
const isButtonTab = computed(() => props.tabStyle === "button");
|
|
80
|
-
const isDarkSidebar = computed(
|
|
81
|
-
|
|
82
|
-
);
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
);
|
|
86
|
-
const isGhostHeader = computed(
|
|
87
|
-
() => !isDarkHeader.value && !isPrimaryHeader.value && showHeaderTabs.value && isButtonTab.value
|
|
88
|
-
);
|
|
89
|
-
const isGhostSidebar = computed(
|
|
90
|
-
() => isGhostHeader.value && !isDarkSidebar.value
|
|
91
|
-
);
|
|
92
|
-
const isCollapseSidebar = computed(
|
|
93
|
-
() => !isMobile.value && props.collapse
|
|
94
|
-
);
|
|
95
|
-
const isCollapseMobile = computed(
|
|
96
|
-
() => isMobile.value && props.collapse
|
|
97
|
-
);
|
|
49
|
+
const isDarkSidebar = computed(() => props.sidebarStyle === "dark");
|
|
50
|
+
const isDarkMixSidebar = computed(() => isMixSidebar.value && !isHeaderLogo.value && isDarkSidebar.value && (isDarkHeader.value || isPrimaryHeader.value));
|
|
51
|
+
const isGhostHeader = computed(() => !isDarkHeader.value && !isPrimaryHeader.value && showHeaderTabs.value && isButtonTab.value);
|
|
52
|
+
const isGhostSidebar = computed(() => isGhostHeader.value && !isDarkSidebar.value);
|
|
53
|
+
const isCollapseSidebar = computed(() => !isMobile.value && props.collapse);
|
|
54
|
+
const isCollapseMobile = computed(() => isMobile.value && props.collapse);
|
|
98
55
|
const getContentEl = () => {
|
|
99
56
|
return contentRef.value;
|
|
100
57
|
};
|
|
@@ -214,36 +171,24 @@ const _sfc_main = defineComponent({
|
|
|
214
171
|
getBodyWrapperEl
|
|
215
172
|
});
|
|
216
173
|
provide(LAYOUT_KEY, layoutProvide);
|
|
217
|
-
watch(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
()
|
|
229
|
-
|
|
230
|
-
startDisableTransitionTimer(() => {
|
|
231
|
-
isDisableTransition.value = false;
|
|
232
|
-
});
|
|
233
|
-
if (layoutProvide.layout !== props.layout) {
|
|
234
|
-
layoutProvide.layout = props.layout;
|
|
235
|
-
}
|
|
236
|
-
if (layoutProvide.maximized !== props.maximized) {
|
|
237
|
-
layoutProvide.maximized = props.maximized;
|
|
238
|
-
}
|
|
239
|
-
if (layoutProvide.fixedHeader !== isFixedHeader.value) {
|
|
240
|
-
layoutProvide.fixedHeader = isFixedHeader.value;
|
|
241
|
-
}
|
|
242
|
-
if (layoutProvide.fixedBody !== props.fixedBody) {
|
|
243
|
-
layoutProvide.fixedBody = props.fixedBody;
|
|
244
|
-
}
|
|
174
|
+
watch([() => props.layout, () => props.sidebarLayout, () => props.fixedSidebar, () => props.fixedBody, () => props.logoInHeader, () => props.maximized, isFixedHeader, isMobile], () => {
|
|
175
|
+
isDisableTransition.value = true;
|
|
176
|
+
startDisableTransitionTimer(() => {
|
|
177
|
+
isDisableTransition.value = false;
|
|
178
|
+
});
|
|
179
|
+
if (layoutProvide.layout !== props.layout) {
|
|
180
|
+
layoutProvide.layout = props.layout;
|
|
181
|
+
}
|
|
182
|
+
if (layoutProvide.maximized !== props.maximized) {
|
|
183
|
+
layoutProvide.maximized = props.maximized;
|
|
184
|
+
}
|
|
185
|
+
if (layoutProvide.fixedHeader !== isFixedHeader.value) {
|
|
186
|
+
layoutProvide.fixedHeader = isFixedHeader.value;
|
|
245
187
|
}
|
|
246
|
-
|
|
188
|
+
if (layoutProvide.fixedBody !== props.fixedBody) {
|
|
189
|
+
layoutProvide.fixedBody = props.fixedBody;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
247
192
|
watch([() => props.sidebarActive, () => props.collapse], () => {
|
|
248
193
|
nextTick(() => {
|
|
249
194
|
sidebarScrollToActive();
|
|
@@ -355,14 +300,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
355
300
|
const _component_LayoutSkeleton = resolveComponent("LayoutSkeleton");
|
|
356
301
|
return openBlock(), createBlock(_component_LayoutSkeleton, {
|
|
357
302
|
isHeaderLogo: _ctx.isHeaderLogo,
|
|
358
|
-
class: normalizeClass([
|
|
359
|
-
{ "is-fixed-body": _ctx.fixedBody },
|
|
360
|
-
{ "is-transition-disabled": _ctx.isDisableTransition },
|
|
361
|
-
{ "is-maximized": _ctx.maximized },
|
|
362
|
-
{ "is-expanded": _ctx.maximized === "expanded" },
|
|
363
|
-
{ "is-mobile": _ctx.isMobile },
|
|
364
|
-
{ "is-collapse": _ctx.isCollapseMobile }
|
|
365
|
-
]),
|
|
303
|
+
class: normalizeClass([{ "is-fixed-body": _ctx.fixedBody }, { "is-transition-disabled": _ctx.isDisableTransition }, { "is-maximized": _ctx.maximized }, { "is-expanded": _ctx.maximized === "expanded" }, { "is-mobile": _ctx.isMobile }, { "is-collapse": _ctx.isCollapseMobile }]),
|
|
366
304
|
style: normalizeStyle({
|
|
367
305
|
minHeight: _ctx.layoutHeight,
|
|
368
306
|
height: _ctx.fixedBody ? _ctx.layoutHeight : void 0
|
|
@@ -371,14 +309,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
371
309
|
head: withCtx(() => [
|
|
372
310
|
!_ctx.isSideLayout ? (openBlock(), createElementBlock("div", {
|
|
373
311
|
key: 0,
|
|
374
|
-
class: normalizeClass([
|
|
375
|
-
"ele-admin-header",
|
|
376
|
-
{ "is-dark": _ctx.isDarkHeader },
|
|
377
|
-
{ "is-primary": _ctx.isPrimaryHeader },
|
|
378
|
-
{ "is-ghost": _ctx.isGhostHeader },
|
|
379
|
-
{ "show-divider": _ctx.tabBar && !_ctx.showHeaderTabs && !_ctx.isButtonTab },
|
|
380
|
-
{ "is-fixed": _ctx.isFixedHeader }
|
|
381
|
-
]),
|
|
312
|
+
class: normalizeClass(["ele-admin-header", { "is-dark": _ctx.isDarkHeader }, { "is-primary": _ctx.isPrimaryHeader }, { "is-ghost": _ctx.isGhostHeader }, { "show-divider": _ctx.tabBar && !_ctx.showHeaderTabs && !_ctx.isButtonTab }, { "is-fixed": _ctx.isFixedHeader }]),
|
|
382
313
|
style: normalizeStyle(_ctx.headerCustomStyle),
|
|
383
314
|
onMouseenter: _cache[0] || (_cache[0] = (...args) => _ctx.handleHeadMouseenter && _ctx.handleHeadMouseenter(...args)),
|
|
384
315
|
onMouseleave: _cache[1] || (_cache[1] = (...args) => _ctx.handleHeadMouseleave && _ctx.handleHeadMouseleave(...args))
|
|
@@ -457,9 +388,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
457
388
|
onTabContextMenu: _ctx.handleTabContextMenu,
|
|
458
389
|
onTabSortChange: _ctx.handleTabSortChange
|
|
459
390
|
}, createSlots({ _: 2 }, [
|
|
460
|
-
renderList(Object.keys(_ctx.$slots).filter(
|
|
461
|
-
(k) => _ctx.tabSlots.includes(k)
|
|
462
|
-
), (name) => {
|
|
391
|
+
renderList(Object.keys(_ctx.$slots).filter((k) => _ctx.tabSlots.includes(k)), (name) => {
|
|
463
392
|
return {
|
|
464
393
|
name,
|
|
465
394
|
fn: withCtx((slotProps) => [
|
|
@@ -476,26 +405,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
476
405
|
side: withCtx(() => [
|
|
477
406
|
!_ctx.isTopLayout ? (openBlock(), createElementBlock("div", {
|
|
478
407
|
key: 0,
|
|
479
|
-
class: normalizeClass([
|
|
480
|
-
"ele-admin-side",
|
|
481
|
-
{ "is-fixed": _ctx.isFixedSidebar },
|
|
482
|
-
{ "show-placeholder": _ctx.isFixedSidebar && _ctx.isHeaderLogo },
|
|
483
|
-
{ "is-collapse": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isCollapseSidebar },
|
|
484
|
-
{ "is-mix": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isMixSidebar },
|
|
485
|
-
{ "is-compact": !_ctx.isMobile && _ctx.compact },
|
|
486
|
-
{ "is-box": !_ctx.isMobile && _ctx.isBoxSidebar }
|
|
487
|
-
]),
|
|
408
|
+
class: normalizeClass(["ele-admin-side", { "is-fixed": _ctx.isFixedSidebar }, { "show-placeholder": _ctx.isFixedSidebar && _ctx.isHeaderLogo }, { "is-collapse": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isCollapseSidebar }, { "is-mix": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isMixSidebar }, { "is-compact": !_ctx.isMobile && _ctx.compact }, { "is-box": !_ctx.isMobile && _ctx.isBoxSidebar }]),
|
|
488
409
|
style: normalizeStyle({ height: _ctx.isFixedSidebar ? _ctx.layoutHeight : void 0 })
|
|
489
410
|
}, [
|
|
490
411
|
_ctx.isMixSidebar ? (openBlock(), createElementBlock("div", {
|
|
491
412
|
key: 0,
|
|
492
|
-
class: normalizeClass([
|
|
493
|
-
"ele-admin-sidebox",
|
|
494
|
-
{ "is-dark": _ctx.isDarkSidebar },
|
|
495
|
-
{ "is-ghost": _ctx.isGhostSidebar },
|
|
496
|
-
{ "show-divider": !_ctx.isCollapseSidebar && !_ctx.isBoxSidebar },
|
|
497
|
-
{ "is-compact": _ctx.compact }
|
|
498
|
-
]),
|
|
413
|
+
class: normalizeClass(["ele-admin-sidebox", { "is-dark": _ctx.isDarkSidebar }, { "is-ghost": _ctx.isGhostSidebar }, { "show-divider": !_ctx.isCollapseSidebar && !_ctx.isBoxSidebar }, { "is-compact": _ctx.compact }]),
|
|
499
414
|
style: normalizeStyle(_ctx.sideboxCustomStyle),
|
|
500
415
|
onMouseenter: _cache[2] || (_cache[2] = (...args) => _ctx.handleBoxMouseEnter && _ctx.handleBoxMouseEnter(...args)),
|
|
501
416
|
onMouseleave: _cache[3] || (_cache[3] = (...args) => _ctx.handleBoxMouseLeave && _ctx.handleBoxMouseLeave(...args))
|
|
@@ -552,13 +467,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
552
467
|
], 38)) : createCommentVNode("", true),
|
|
553
468
|
!_ctx.isBoxSidebar ? (openBlock(), createElementBlock("div", {
|
|
554
469
|
key: 1,
|
|
555
|
-
class: normalizeClass([
|
|
556
|
-
"ele-admin-sidebar",
|
|
557
|
-
{ "is-dark": _ctx.isMixSidebar ? _ctx.isDarkMixSidebar : _ctx.isDarkSidebar },
|
|
558
|
-
{ "is-ghost": _ctx.isGhostSidebar },
|
|
559
|
-
{ "is-mix": _ctx.isMixSidebar },
|
|
560
|
-
{ "is-collapse": _ctx.isCollapseSidebar }
|
|
561
|
-
]),
|
|
470
|
+
class: normalizeClass(["ele-admin-sidebar", { "is-dark": _ctx.isMixSidebar ? _ctx.isDarkMixSidebar : _ctx.isDarkSidebar }, { "is-ghost": _ctx.isGhostSidebar }, { "is-mix": _ctx.isMixSidebar }, { "is-collapse": _ctx.isCollapseSidebar }]),
|
|
562
471
|
style: normalizeStyle(_ctx.sidebarCustomStyle),
|
|
563
472
|
onMouseenter: _cache[4] || (_cache[4] = (...args) => _ctx.handleSideMouseEnter && _ctx.handleSideMouseEnter(...args)),
|
|
564
473
|
onMouseleave: _cache[5] || (_cache[5] = (...args) => _ctx.handleSideMouseLeave && _ctx.handleSideMouseLeave(...args))
|
|
@@ -639,20 +548,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
639
548
|
tabContextMenu: _ctx.tabContextMenu,
|
|
640
549
|
tabContextMenus: _ctx.tabContextMenus,
|
|
641
550
|
tabSortable: _ctx.tabSortable,
|
|
642
|
-
class: normalizeClass([
|
|
643
|
-
{ "is-fixed-home": _ctx.fixedHome },
|
|
644
|
-
{ "is-fixed": _ctx.isFixedHeader },
|
|
645
|
-
{ "is-fixed-top": _ctx.isFixedHeader && (_ctx.isSideLayout || _ctx.maximized) }
|
|
646
|
-
]),
|
|
551
|
+
class: normalizeClass([{ "is-fixed-home": _ctx.fixedHome }, { "is-fixed": _ctx.isFixedHeader }, { "is-fixed-top": _ctx.isFixedHeader && (_ctx.isSideLayout || _ctx.maximized) }]),
|
|
647
552
|
style: normalizeStyle(_ctx.tabsCustomStyle),
|
|
648
553
|
onTabClick: _ctx.handleTabClick,
|
|
649
554
|
onTabRemove: _ctx.handleTabRemove,
|
|
650
555
|
onTabContextMenu: _ctx.handleTabContextMenu,
|
|
651
556
|
onTabSortChange: _ctx.handleTabSortChange
|
|
652
557
|
}, createSlots({ _: 2 }, [
|
|
653
|
-
renderList(Object.keys(_ctx.$slots).filter(
|
|
654
|
-
(k) => _ctx.tabSlots.includes(k)
|
|
655
|
-
), (name) => {
|
|
558
|
+
renderList(Object.keys(_ctx.$slots).filter((k) => _ctx.tabSlots.includes(k)), (name) => {
|
|
656
559
|
return {
|
|
657
560
|
name,
|
|
658
561
|
fn: withCtx((slotProps) => [
|
package/es/ele-drawer/index.d.ts
CHANGED
|
@@ -149,10 +149,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
149
149
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
150
150
|
onClose?: (() => any) | undefined;
|
|
151
151
|
onOpen?: (() => any) | undefined;
|
|
152
|
-
onOpenAutoFocus?: (() => any) | undefined;
|
|
153
|
-
onCloseAutoFocus?: (() => any) | undefined;
|
|
154
152
|
onOpened?: (() => any) | undefined;
|
|
155
153
|
onClosed?: (() => any) | undefined;
|
|
154
|
+
onOpenAutoFocus?: (() => any) | undefined;
|
|
155
|
+
onCloseAutoFocus?: (() => any) | undefined;
|
|
156
156
|
}, {
|
|
157
157
|
size: import('element-plus/es/utils/index').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
158
158
|
title: string;
|
package/es/ele-loading/index.js
CHANGED
|
@@ -42,12 +42,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
42
42
|
!_ctx.isCircle ? withDirectives((openBlock(), createElementBlock("div", {
|
|
43
43
|
key: 0,
|
|
44
44
|
style: normalizeStyle(_ctx.spinnerStyle),
|
|
45
|
-
class: normalizeClass([
|
|
46
|
-
"ele-loading-spinner",
|
|
47
|
-
{ "ele-loading-blur": _ctx.blur },
|
|
48
|
-
{ "ele-loading-small": _ctx.size === "small" },
|
|
49
|
-
{ "ele-loading-large": _ctx.size === "large" }
|
|
50
|
-
])
|
|
45
|
+
class: normalizeClass(["ele-loading-spinner", { "ele-loading-blur": _ctx.blur }, { "ele-loading-small": _ctx.size === "small" }, { "ele-loading-large": _ctx.size === "large" }])
|
|
51
46
|
}, [
|
|
52
47
|
renderSlot(_ctx.$slots, "spinner", {}, () => [
|
|
53
48
|
_hoisted_1
|
package/es/ele-modal/index.d.ts
CHANGED
|
@@ -207,10 +207,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
207
207
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
208
208
|
onClose?: (() => any) | undefined;
|
|
209
209
|
onOpen?: (() => any) | undefined;
|
|
210
|
-
onOpenAutoFocus?: (() => any) | undefined;
|
|
211
|
-
onCloseAutoFocus?: (() => any) | undefined;
|
|
212
210
|
onOpened?: (() => any) | undefined;
|
|
213
211
|
onClosed?: (() => any) | undefined;
|
|
212
|
+
onOpenAutoFocus?: (() => any) | undefined;
|
|
213
|
+
onCloseAutoFocus?: (() => any) | undefined;
|
|
214
214
|
"onUpdate:fullscreen"?: ((_fullscreen: boolean) => any) | undefined;
|
|
215
215
|
}, {
|
|
216
216
|
form: boolean;
|
|
@@ -36,6 +36,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
36
36
|
background: BooleanConstructor;
|
|
37
37
|
disabled: BooleanConstructor;
|
|
38
38
|
hideOnSinglePage: BooleanConstructor;
|
|
39
|
+
appendSizeTo: StringConstructor;
|
|
39
40
|
}, {
|
|
40
41
|
isInfinite: import('vue').ComputedRef<boolean>;
|
|
41
42
|
pageTotal: import('vue').ComputedRef<number | undefined>;
|
|
@@ -83,6 +84,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
83
84
|
background: BooleanConstructor;
|
|
84
85
|
disabled: BooleanConstructor;
|
|
85
86
|
hideOnSinglePage: BooleanConstructor;
|
|
87
|
+
appendSizeTo: StringConstructor;
|
|
86
88
|
}>> & {
|
|
87
89
|
"onUpdate:currentPage"?: ((_currentPage: number) => any) | undefined;
|
|
88
90
|
"onUpdate:pageSize"?: ((_pageSize: number) => any) | undefined;
|
|
@@ -46,6 +46,7 @@ export declare const paginationProps: {
|
|
|
46
46
|
background: BooleanConstructor;
|
|
47
47
|
disabled: BooleanConstructor;
|
|
48
48
|
hideOnSinglePage: BooleanConstructor;
|
|
49
|
+
appendSizeTo: StringConstructor;
|
|
49
50
|
};
|
|
50
51
|
export type PaginationProps = ExtractPropTypes<typeof paginationProps>;
|
|
51
52
|
/**
|
|
@@ -196,7 +196,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
196
196
|
handlePageSizeChange: (pageSize: number) => void;
|
|
197
197
|
handlePageCurrentChange: (page: number) => void;
|
|
198
198
|
reload: ReloadFunction;
|
|
199
|
-
|
|
199
|
+
reset: () => void;
|
|
200
200
|
getTableRef: () => TableViewInstance | undefined;
|
|
201
201
|
getData: () => DataItem[];
|
|
202
202
|
setData: (data: DataItem[]) => void;
|
|
@@ -216,16 +216,19 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
216
216
|
clearFilter: (columnKeys?: string[]) => void;
|
|
217
217
|
doLayout: () => void;
|
|
218
218
|
sort: (prop: string, order: string) => void;
|
|
219
|
-
scrollTo: (options: number | ScrollToOptions, yCoord
|
|
219
|
+
scrollTo: (options: number | ScrollToOptions, yCoord?: number) => void;
|
|
220
220
|
setScrollTop: (top?: number) => void;
|
|
221
|
-
setScrollLeft: (left
|
|
221
|
+
setScrollLeft: (left? /** 表格当前的排序筛选搜索参数 */: number) => void;
|
|
222
222
|
setCurrentRowKey: (key?: import('../ele-data-table/types').DataKey | null) => void;
|
|
223
223
|
getCurrentRow: () => DataItem | undefined;
|
|
224
224
|
setSelectedRows: (rows?: DataItem[]) => void;
|
|
225
|
-
setSelectedRowKeys: (keys?: import('../ele-data-table/types').DataKey[], rows
|
|
225
|
+
setSelectedRowKeys: (keys?: import('../ele-data-table/types').DataKey[], rows?: DataItem[]) => void;
|
|
226
226
|
toggleRowExpansionAll: (expanded?: boolean) => void;
|
|
227
227
|
updateSelectedAndChecked: () => void;
|
|
228
228
|
updateKeyChildren: (key?: import('../ele-data-table/types').DataKey | null, rows?: DataItem[]) => void;
|
|
229
|
+
isShowTable: Ref<{
|
|
230
|
+
valueOf: () => boolean;
|
|
231
|
+
}>;
|
|
229
232
|
toolsSlotExcludes: string[];
|
|
230
233
|
tableSlotExcludes: string[];
|
|
231
234
|
pageSlotExcludes: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, shallowRef, computed, watch, onMounted, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, mergeProps as mergeProps$1, createSlots, renderSlot, createCommentVNode, renderList, createElementBlock, normalizeStyle } from "vue";
|
|
1
|
+
import { defineComponent, ref, shallowRef, computed, watch, onMounted, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, mergeProps as mergeProps$1, createSlots, renderSlot, createCommentVNode, renderList, createElementBlock, Fragment, normalizeStyle } from "vue";
|
|
2
2
|
import { pick, getValue } from "../utils/core";
|
|
3
3
|
import { useGlobalProps } from "../ele-config-provider/receiver";
|
|
4
4
|
import EleLoading from "../ele-loading/index";
|
|
@@ -9,7 +9,7 @@ import EleDataTable from "../ele-data-table/index";
|
|
|
9
9
|
import EleVirtualTable from "../ele-virtual-table/index";
|
|
10
10
|
import EleToolbar from "../ele-toolbar/index";
|
|
11
11
|
import TableTools from "./components/table-tools";
|
|
12
|
-
import { getDefaultFilter, getTablePage, getTableLimit, getTableSize, getRowKey, getPaginationProps, mergeProps, cacheColWidth, getInitCacheColumns,
|
|
12
|
+
import { getDefaultFilter, getTablePage, getTableLimit, getTableSize, getRowKey, getPaginationProps, mergeProps, cacheColWidth, getInitCacheColumns, sortData, getRequestOrderParamList, getRequestPageParam, getRequestFilters, reloadData, getResponseResult, getResponseName, isAutoAmend } from "./util";
|
|
13
13
|
import { proTableProps, proTableEmits } from "./props";
|
|
14
14
|
const ownSlots = ["default", "toolbar", "tools", "footer"];
|
|
15
15
|
const toolsSlotExcludes = [...ownSlots, "empty", "append"];
|
|
@@ -28,6 +28,7 @@ const _sfc_main = defineComponent({
|
|
|
28
28
|
props: proTableProps,
|
|
29
29
|
emits: proTableEmits,
|
|
30
30
|
setup(props, { emit }) {
|
|
31
|
+
const isShowTable = ref(true);
|
|
31
32
|
const events = useEmits(emit);
|
|
32
33
|
const methods = useMethods(() => getTableRef());
|
|
33
34
|
const globalProps = useGlobalProps("table");
|
|
@@ -144,7 +145,7 @@ const _sfc_main = defineComponent({
|
|
|
144
145
|
style: tableMaximized.value ? { zIndex } : void 0
|
|
145
146
|
};
|
|
146
147
|
});
|
|
147
|
-
const
|
|
148
|
+
const load = (option, parent, resolve) => {
|
|
148
149
|
if (option) {
|
|
149
150
|
if (option.currentPage) {
|
|
150
151
|
tablePage.value = option.currentPage;
|
|
@@ -198,6 +199,18 @@ const _sfc_main = defineComponent({
|
|
|
198
199
|
resolve && console.error(e);
|
|
199
200
|
});
|
|
200
201
|
};
|
|
202
|
+
const reload = (option, parent, resolve) => {
|
|
203
|
+
load(option, parent, resolve);
|
|
204
|
+
};
|
|
205
|
+
const reset = () => {
|
|
206
|
+
methods.doLayout();
|
|
207
|
+
if (props.lazy) {
|
|
208
|
+
isShowTable.value = false;
|
|
209
|
+
nextTick(() => {
|
|
210
|
+
isShowTable.value = true;
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
201
214
|
const requestCallback = (data, totalCount, parent, response, resolve) => {
|
|
202
215
|
var _a;
|
|
203
216
|
if (!Array.isArray(data)) {
|
|
@@ -230,9 +243,9 @@ const _sfc_main = defineComponent({
|
|
|
230
243
|
}
|
|
231
244
|
tableLoading.value = false;
|
|
232
245
|
const result = {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
246
|
+
records: tableData.value,
|
|
247
|
+
currentPage: tablePage.value,
|
|
248
|
+
totalCount: tableTotal.value,
|
|
236
249
|
response
|
|
237
250
|
};
|
|
238
251
|
handleDone(result, parent);
|
|
@@ -328,9 +341,6 @@ const _sfc_main = defineComponent({
|
|
|
328
341
|
emit("update:selections", selection);
|
|
329
342
|
}
|
|
330
343
|
};
|
|
331
|
-
const reloadTable = () => {
|
|
332
|
-
methods.doLayout();
|
|
333
|
-
};
|
|
334
344
|
const getTableRef = () => {
|
|
335
345
|
return tableViewRef.value;
|
|
336
346
|
};
|
|
@@ -347,9 +357,9 @@ const _sfc_main = defineComponent({
|
|
|
347
357
|
const rowKey = tableRowKey.value;
|
|
348
358
|
const data = sortData(props.datasource, tableState.sorter);
|
|
349
359
|
const index2 = data.findIndex((d) => getValue(d, rowKey) === key);
|
|
350
|
-
const
|
|
351
|
-
if (tablePage.value !==
|
|
352
|
-
reload({
|
|
360
|
+
const currentPage = Math.floor(index2 / tableLimit.value) + 1;
|
|
361
|
+
if (tablePage.value !== currentPage) {
|
|
362
|
+
reload({ currentPage });
|
|
353
363
|
}
|
|
354
364
|
};
|
|
355
365
|
const fetch = (callback) => {
|
|
@@ -447,6 +457,7 @@ const _sfc_main = defineComponent({
|
|
|
447
457
|
}
|
|
448
458
|
});
|
|
449
459
|
return {
|
|
460
|
+
isShowTable,
|
|
450
461
|
toolsSlotExcludes,
|
|
451
462
|
tableSlotExcludes,
|
|
452
463
|
pageSlotExcludes,
|
|
@@ -471,7 +482,8 @@ const _sfc_main = defineComponent({
|
|
|
471
482
|
handlePageSizeChange,
|
|
472
483
|
handlePageCurrentChange,
|
|
473
484
|
reload,
|
|
474
|
-
|
|
485
|
+
reset,
|
|
486
|
+
// reloadTable,
|
|
475
487
|
getTableRef,
|
|
476
488
|
getData,
|
|
477
489
|
setData,
|
|
@@ -518,16 +530,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
518
530
|
])
|
|
519
531
|
};
|
|
520
532
|
})
|
|
521
|
-
]), 1040)) : (openBlock(),
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
533
|
+
]), 1040)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
534
|
+
_ctx.isShowTable ? (openBlock(), createBlock(_component_EleDataTable, mergeProps$1({ key: 0 }, _ctx.tableProps, { ref: "tableViewRef" }), createSlots({ _: 2 }, [
|
|
535
|
+
renderList(Object.keys(_ctx.$slots).filter((k) => !_ctx.tableSlotExcludes.includes(k)), (name) => {
|
|
536
|
+
return {
|
|
537
|
+
name,
|
|
538
|
+
fn: withCtx((slotProps) => [
|
|
539
|
+
renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
|
|
540
|
+
])
|
|
541
|
+
};
|
|
542
|
+
})
|
|
543
|
+
]), 1040)) : createCommentVNode("", true)
|
|
544
|
+
], 64)),
|
|
531
545
|
_ctx.paginationProps || _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
532
546
|
key: 3,
|
|
533
547
|
class: "ele-pro-table-footer",
|
|
@@ -80,6 +80,14 @@ export interface ReloadParams {
|
|
|
80
80
|
filter?: Filter;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* 加载方法
|
|
85
|
+
* @param option 刷新参数
|
|
86
|
+
* @param parent 树表格父级数据
|
|
87
|
+
* @param resolve 树表格懒加载方法
|
|
88
|
+
*/
|
|
89
|
+
export type LoadFunction = (option?: ReloadParams, parent?: DataItem, resolve?: ResolveFunction) => void;
|
|
90
|
+
|
|
83
91
|
/**
|
|
84
92
|
* 刷新方法
|
|
85
93
|
* @param option 刷新参数
|
|
@@ -143,11 +151,11 @@ export interface OrderItem {
|
|
|
143
151
|
*/
|
|
144
152
|
export interface DoneParams<T> {
|
|
145
153
|
/** 当前页数据 */
|
|
146
|
-
|
|
154
|
+
records: T[];
|
|
147
155
|
/** 总数量 */
|
|
148
|
-
|
|
156
|
+
totalCount?: PaginationTotal;
|
|
149
157
|
/** 当前页码 */
|
|
150
|
-
|
|
158
|
+
currentPage?: number;
|
|
151
159
|
/** 数据源原始数据 */
|
|
152
160
|
response?: any;
|
|
153
161
|
}
|
package/es/ele-pro-table/util.js
CHANGED
|
@@ -202,7 +202,6 @@ function sortData(datasource, sorter) {
|
|
|
202
202
|
return data;
|
|
203
203
|
}
|
|
204
204
|
function reloadData(datasource, sorter, currentPage, pageSize) {
|
|
205
|
-
debugger;
|
|
206
205
|
const records = sortData(datasource, sorter);
|
|
207
206
|
const totalCount = records.length;
|
|
208
207
|
if (!currentPage || !pageSize) {
|
|
@@ -122,6 +122,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
122
122
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
123
123
|
flexible: BooleanConstructor;
|
|
124
124
|
showOverflowTooltip: import('vue').PropType<boolean | Partial<Pick<import('element-plus').ElTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "popperOptions" | "enterable" | "popperClass" | "appendTo" | "showArrow">> | undefined>;
|
|
125
|
+
appendFilterPanelTo: StringConstructor;
|
|
126
|
+
scrollbarTabindex: {
|
|
127
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
128
|
+
default: undefined;
|
|
129
|
+
};
|
|
125
130
|
}, {
|
|
126
131
|
ownSlots: string[];
|
|
127
132
|
rootRef: Ref<HTMLElement | null>;
|
|
@@ -333,6 +338,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
333
338
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
334
339
|
flexible: BooleanConstructor;
|
|
335
340
|
showOverflowTooltip: import('vue').PropType<boolean | Partial<Pick<import('element-plus').ElTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "popperOptions" | "enterable" | "popperClass" | "appendTo" | "showArrow">> | undefined>;
|
|
341
|
+
appendFilterPanelTo: StringConstructor;
|
|
342
|
+
scrollbarTabindex: {
|
|
343
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
344
|
+
default: undefined;
|
|
345
|
+
};
|
|
336
346
|
}>> & {
|
|
337
347
|
onSelect?: ((_selection: DataItem[], _row: DataItem) => any) | undefined;
|
|
338
348
|
onExpandChange?: ((_row: DataItem, _expanded: boolean) => any) | undefined;
|
|
@@ -371,6 +381,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
371
381
|
tableLayout: "auto" | "fixed";
|
|
372
382
|
scrollbarAlwaysOn: boolean;
|
|
373
383
|
flexible: boolean;
|
|
384
|
+
scrollbarTabindex: string | number;
|
|
374
385
|
sticky: boolean;
|
|
375
386
|
headerEllipsis: boolean;
|
|
376
387
|
slotNormalize: boolean;
|
|
@@ -123,6 +123,11 @@ export declare const virtualTableProps: {
|
|
|
123
123
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
124
124
|
flexible: BooleanConstructor;
|
|
125
125
|
showOverflowTooltip: import('vue').PropType<boolean | Partial<Pick<import('element-plus').ElTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "popperOptions" | "enterable" | "popperClass" | "appendTo" | "showArrow">> | undefined>;
|
|
126
|
+
appendFilterPanelTo: StringConstructor;
|
|
127
|
+
scrollbarTabindex: {
|
|
128
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
129
|
+
default: undefined;
|
|
130
|
+
};
|
|
126
131
|
};
|
|
127
132
|
export type VirtualTableProps = ExtractPropTypes<typeof virtualTableProps>;
|
|
128
133
|
/**
|
|
@@ -95,9 +95,7 @@ const _sfc_main = defineComponent({
|
|
|
95
95
|
};
|
|
96
96
|
const fillTexts = (ctx, drawX, drawY, drawWidth, drawHeight) => {
|
|
97
97
|
const ratio = getPixelRatio();
|
|
98
|
-
const { color, fontSize, fontStyle, fontWeight, fontFamily } = getFont(
|
|
99
|
-
props.font
|
|
100
|
-
);
|
|
98
|
+
const { color, fontSize, fontStyle, fontWeight, fontFamily } = getFont(props.font);
|
|
101
99
|
const mergedFontSize = fontSize * ratio;
|
|
102
100
|
ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${drawHeight}px ${fontFamily}`;
|
|
103
101
|
ctx.fillStyle = color;
|
|
@@ -107,11 +105,7 @@ const _sfc_main = defineComponent({
|
|
|
107
105
|
const content = props.content;
|
|
108
106
|
const contents = Array.isArray(content) ? content : [content];
|
|
109
107
|
contents.forEach((item, index2) => {
|
|
110
|
-
ctx.fillText(
|
|
111
|
-
item ?? "",
|
|
112
|
-
drawX,
|
|
113
|
-
drawY + index2 * (mergedFontSize + props.lineGap * ratio)
|
|
114
|
-
);
|
|
108
|
+
ctx.fillText(item ?? "", drawX, drawY + index2 * (mergedFontSize + props.lineGap * ratio));
|
|
115
109
|
});
|
|
116
110
|
};
|
|
117
111
|
const render = () => {
|
|
@@ -155,13 +149,7 @@ const _sfc_main = defineComponent({
|
|
|
155
149
|
ctx.drawImage(img, drawX, drawY, drawWidth, drawHeight);
|
|
156
150
|
ctx.restore();
|
|
157
151
|
rotateWatermark(ctx, alternateRotateX, alternateRotateY, rotate);
|
|
158
|
-
ctx.drawImage(
|
|
159
|
-
img,
|
|
160
|
-
alternateDrawX,
|
|
161
|
-
alternateDrawY,
|
|
162
|
-
drawWidth,
|
|
163
|
-
drawHeight
|
|
164
|
-
);
|
|
152
|
+
ctx.drawImage(img, alternateDrawX, alternateDrawY, drawWidth, drawHeight);
|
|
165
153
|
updateStyle(canvas.toDataURL(), `${(gapX + markWidth) * SIZE}px`);
|
|
166
154
|
};
|
|
167
155
|
img.crossOrigin = "anonymous";
|
|
@@ -9,20 +9,7 @@ const LayoutSkeleton = require("./components/layout-skeleton");
|
|
|
9
9
|
const LayoutTabs = require("./components/layout-tabs");
|
|
10
10
|
const props = require("./props");
|
|
11
11
|
const tabSlots = ["tabTitle", "tabExtra", "tabHome"];
|
|
12
|
-
const ownSlots = [
|
|
13
|
-
"logo",
|
|
14
|
-
"logoTitle",
|
|
15
|
-
"left",
|
|
16
|
-
"right",
|
|
17
|
-
"center",
|
|
18
|
-
"breadcrumb",
|
|
19
|
-
"top",
|
|
20
|
-
"bottom",
|
|
21
|
-
"boxTop",
|
|
22
|
-
"boxBottom",
|
|
23
|
-
"body",
|
|
24
|
-
...tabSlots
|
|
25
|
-
];
|
|
12
|
+
const ownSlots = ["logo", "logoTitle", "left", "right", "center", "breadcrumb", "top", "bottom", "boxTop", "boxBottom", "body", ...tabSlots];
|
|
26
13
|
const _sfc_main = vue.defineComponent({
|
|
27
14
|
name: "EleAdminLayout",
|
|
28
15
|
components: {
|
|
@@ -46,56 +33,26 @@ const _sfc_main = vue.defineComponent({
|
|
|
46
33
|
const contentRef = vue.shallowRef(null);
|
|
47
34
|
const modalsRef = vue.shallowRef(null);
|
|
48
35
|
const isDisableTransition = vue.shallowRef(false);
|
|
49
|
-
const layoutHeight = vue.computed(
|
|
50
|
-
|
|
51
|
-
);
|
|
52
|
-
const isFixedHeader = vue.computed(
|
|
53
|
-
() => !props$1.fixedBody && props$1.fixedHeader
|
|
54
|
-
);
|
|
55
|
-
const isFixedSidebar = vue.computed(
|
|
56
|
-
() => !props$1.fixedBody && props$1.fixedSidebar
|
|
57
|
-
);
|
|
36
|
+
const layoutHeight = vue.computed(() => typeof props$1.height === "number" ? `${props$1.height}px` : props$1.height);
|
|
37
|
+
const isFixedHeader = vue.computed(() => !props$1.fixedBody && props$1.fixedHeader);
|
|
38
|
+
const isFixedSidebar = vue.computed(() => !props$1.fixedBody && props$1.fixedSidebar);
|
|
58
39
|
const isTopLayout = vue.computed(() => props$1.layout === "top");
|
|
59
40
|
const isSideLayout = vue.computed(() => props$1.layout === "side");
|
|
60
|
-
const isBoxSidebar = vue.computed(
|
|
61
|
-
|
|
62
|
-
);
|
|
63
|
-
const isMixSidebar = vue.computed(
|
|
64
|
-
() => !isTopLayout.value && (props$1.sidebarLayout === "mix" || isBoxSidebar.value)
|
|
65
|
-
);
|
|
41
|
+
const isBoxSidebar = vue.computed(() => props$1.sidebarLayout === "box");
|
|
42
|
+
const isMixSidebar = vue.computed(() => !isTopLayout.value && (props$1.sidebarLayout === "mix" || isBoxSidebar.value));
|
|
66
43
|
const isMobile = vue.computed(() => props$1.mobile && !isTopLayout.value);
|
|
67
|
-
const isHeaderLogo = vue.computed(
|
|
68
|
-
|
|
69
|
-
);
|
|
70
|
-
const showHeaderMenus = vue.computed(
|
|
71
|
-
() => isTopLayout.value || props$1.layout === "mix"
|
|
72
|
-
);
|
|
44
|
+
const isHeaderLogo = vue.computed(() => (props$1.logoInHeader || isTopLayout.value) && !isSideLayout.value && !isMobile.value);
|
|
45
|
+
const showHeaderMenus = vue.computed(() => isTopLayout.value || props$1.layout === "mix");
|
|
73
46
|
const showHeaderTabs = vue.computed(() => props$1.tabBar === "header");
|
|
74
|
-
const isDarkHeader = vue.computed(
|
|
75
|
-
|
|
76
|
-
);
|
|
77
|
-
const isPrimaryHeader = vue.computed(
|
|
78
|
-
() => props$1.headerStyle === "primary"
|
|
79
|
-
);
|
|
47
|
+
const isDarkHeader = vue.computed(() => props$1.headerStyle === "dark");
|
|
48
|
+
const isPrimaryHeader = vue.computed(() => props$1.headerStyle === "primary");
|
|
80
49
|
const isButtonTab = vue.computed(() => props$1.tabStyle === "button");
|
|
81
|
-
const isDarkSidebar = vue.computed(
|
|
82
|
-
|
|
83
|
-
);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
);
|
|
87
|
-
const isGhostHeader = vue.computed(
|
|
88
|
-
() => !isDarkHeader.value && !isPrimaryHeader.value && showHeaderTabs.value && isButtonTab.value
|
|
89
|
-
);
|
|
90
|
-
const isGhostSidebar = vue.computed(
|
|
91
|
-
() => isGhostHeader.value && !isDarkSidebar.value
|
|
92
|
-
);
|
|
93
|
-
const isCollapseSidebar = vue.computed(
|
|
94
|
-
() => !isMobile.value && props$1.collapse
|
|
95
|
-
);
|
|
96
|
-
const isCollapseMobile = vue.computed(
|
|
97
|
-
() => isMobile.value && props$1.collapse
|
|
98
|
-
);
|
|
50
|
+
const isDarkSidebar = vue.computed(() => props$1.sidebarStyle === "dark");
|
|
51
|
+
const isDarkMixSidebar = vue.computed(() => isMixSidebar.value && !isHeaderLogo.value && isDarkSidebar.value && (isDarkHeader.value || isPrimaryHeader.value));
|
|
52
|
+
const isGhostHeader = vue.computed(() => !isDarkHeader.value && !isPrimaryHeader.value && showHeaderTabs.value && isButtonTab.value);
|
|
53
|
+
const isGhostSidebar = vue.computed(() => isGhostHeader.value && !isDarkSidebar.value);
|
|
54
|
+
const isCollapseSidebar = vue.computed(() => !isMobile.value && props$1.collapse);
|
|
55
|
+
const isCollapseMobile = vue.computed(() => isMobile.value && props$1.collapse);
|
|
99
56
|
const getContentEl = () => {
|
|
100
57
|
return contentRef.value;
|
|
101
58
|
};
|
|
@@ -215,36 +172,24 @@ const _sfc_main = vue.defineComponent({
|
|
|
215
172
|
getBodyWrapperEl
|
|
216
173
|
});
|
|
217
174
|
vue.provide(props.LAYOUT_KEY, layoutProvide);
|
|
218
|
-
vue.watch(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
()
|
|
230
|
-
|
|
231
|
-
startDisableTransitionTimer(() => {
|
|
232
|
-
isDisableTransition.value = false;
|
|
233
|
-
});
|
|
234
|
-
if (layoutProvide.layout !== props$1.layout) {
|
|
235
|
-
layoutProvide.layout = props$1.layout;
|
|
236
|
-
}
|
|
237
|
-
if (layoutProvide.maximized !== props$1.maximized) {
|
|
238
|
-
layoutProvide.maximized = props$1.maximized;
|
|
239
|
-
}
|
|
240
|
-
if (layoutProvide.fixedHeader !== isFixedHeader.value) {
|
|
241
|
-
layoutProvide.fixedHeader = isFixedHeader.value;
|
|
242
|
-
}
|
|
243
|
-
if (layoutProvide.fixedBody !== props$1.fixedBody) {
|
|
244
|
-
layoutProvide.fixedBody = props$1.fixedBody;
|
|
245
|
-
}
|
|
175
|
+
vue.watch([() => props$1.layout, () => props$1.sidebarLayout, () => props$1.fixedSidebar, () => props$1.fixedBody, () => props$1.logoInHeader, () => props$1.maximized, isFixedHeader, isMobile], () => {
|
|
176
|
+
isDisableTransition.value = true;
|
|
177
|
+
startDisableTransitionTimer(() => {
|
|
178
|
+
isDisableTransition.value = false;
|
|
179
|
+
});
|
|
180
|
+
if (layoutProvide.layout !== props$1.layout) {
|
|
181
|
+
layoutProvide.layout = props$1.layout;
|
|
182
|
+
}
|
|
183
|
+
if (layoutProvide.maximized !== props$1.maximized) {
|
|
184
|
+
layoutProvide.maximized = props$1.maximized;
|
|
185
|
+
}
|
|
186
|
+
if (layoutProvide.fixedHeader !== isFixedHeader.value) {
|
|
187
|
+
layoutProvide.fixedHeader = isFixedHeader.value;
|
|
246
188
|
}
|
|
247
|
-
|
|
189
|
+
if (layoutProvide.fixedBody !== props$1.fixedBody) {
|
|
190
|
+
layoutProvide.fixedBody = props$1.fixedBody;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
248
193
|
vue.watch([() => props$1.sidebarActive, () => props$1.collapse], () => {
|
|
249
194
|
vue.nextTick(() => {
|
|
250
195
|
sidebarScrollToActive();
|
|
@@ -356,14 +301,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
356
301
|
const _component_LayoutSkeleton = vue.resolveComponent("LayoutSkeleton");
|
|
357
302
|
return vue.openBlock(), vue.createBlock(_component_LayoutSkeleton, {
|
|
358
303
|
isHeaderLogo: _ctx.isHeaderLogo,
|
|
359
|
-
class: vue.normalizeClass([
|
|
360
|
-
{ "is-fixed-body": _ctx.fixedBody },
|
|
361
|
-
{ "is-transition-disabled": _ctx.isDisableTransition },
|
|
362
|
-
{ "is-maximized": _ctx.maximized },
|
|
363
|
-
{ "is-expanded": _ctx.maximized === "expanded" },
|
|
364
|
-
{ "is-mobile": _ctx.isMobile },
|
|
365
|
-
{ "is-collapse": _ctx.isCollapseMobile }
|
|
366
|
-
]),
|
|
304
|
+
class: vue.normalizeClass([{ "is-fixed-body": _ctx.fixedBody }, { "is-transition-disabled": _ctx.isDisableTransition }, { "is-maximized": _ctx.maximized }, { "is-expanded": _ctx.maximized === "expanded" }, { "is-mobile": _ctx.isMobile }, { "is-collapse": _ctx.isCollapseMobile }]),
|
|
367
305
|
style: vue.normalizeStyle({
|
|
368
306
|
minHeight: _ctx.layoutHeight,
|
|
369
307
|
height: _ctx.fixedBody ? _ctx.layoutHeight : void 0
|
|
@@ -372,14 +310,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
372
310
|
head: vue.withCtx(() => [
|
|
373
311
|
!_ctx.isSideLayout ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
374
312
|
key: 0,
|
|
375
|
-
class: vue.normalizeClass([
|
|
376
|
-
"ele-admin-header",
|
|
377
|
-
{ "is-dark": _ctx.isDarkHeader },
|
|
378
|
-
{ "is-primary": _ctx.isPrimaryHeader },
|
|
379
|
-
{ "is-ghost": _ctx.isGhostHeader },
|
|
380
|
-
{ "show-divider": _ctx.tabBar && !_ctx.showHeaderTabs && !_ctx.isButtonTab },
|
|
381
|
-
{ "is-fixed": _ctx.isFixedHeader }
|
|
382
|
-
]),
|
|
313
|
+
class: vue.normalizeClass(["ele-admin-header", { "is-dark": _ctx.isDarkHeader }, { "is-primary": _ctx.isPrimaryHeader }, { "is-ghost": _ctx.isGhostHeader }, { "show-divider": _ctx.tabBar && !_ctx.showHeaderTabs && !_ctx.isButtonTab }, { "is-fixed": _ctx.isFixedHeader }]),
|
|
383
314
|
style: vue.normalizeStyle(_ctx.headerCustomStyle),
|
|
384
315
|
onMouseenter: _cache[0] || (_cache[0] = (...args) => _ctx.handleHeadMouseenter && _ctx.handleHeadMouseenter(...args)),
|
|
385
316
|
onMouseleave: _cache[1] || (_cache[1] = (...args) => _ctx.handleHeadMouseleave && _ctx.handleHeadMouseleave(...args))
|
|
@@ -458,9 +389,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
458
389
|
onTabContextMenu: _ctx.handleTabContextMenu,
|
|
459
390
|
onTabSortChange: _ctx.handleTabSortChange
|
|
460
391
|
}, vue.createSlots({ _: 2 }, [
|
|
461
|
-
vue.renderList(Object.keys(_ctx.$slots).filter(
|
|
462
|
-
(k) => _ctx.tabSlots.includes(k)
|
|
463
|
-
), (name) => {
|
|
392
|
+
vue.renderList(Object.keys(_ctx.$slots).filter((k) => _ctx.tabSlots.includes(k)), (name) => {
|
|
464
393
|
return {
|
|
465
394
|
name,
|
|
466
395
|
fn: vue.withCtx((slotProps) => [
|
|
@@ -477,26 +406,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
477
406
|
side: vue.withCtx(() => [
|
|
478
407
|
!_ctx.isTopLayout ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
479
408
|
key: 0,
|
|
480
|
-
class: vue.normalizeClass([
|
|
481
|
-
"ele-admin-side",
|
|
482
|
-
{ "is-fixed": _ctx.isFixedSidebar },
|
|
483
|
-
{ "show-placeholder": _ctx.isFixedSidebar && _ctx.isHeaderLogo },
|
|
484
|
-
{ "is-collapse": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isCollapseSidebar },
|
|
485
|
-
{ "is-mix": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isMixSidebar },
|
|
486
|
-
{ "is-compact": !_ctx.isMobile && _ctx.compact },
|
|
487
|
-
{ "is-box": !_ctx.isMobile && _ctx.isBoxSidebar }
|
|
488
|
-
]),
|
|
409
|
+
class: vue.normalizeClass(["ele-admin-side", { "is-fixed": _ctx.isFixedSidebar }, { "show-placeholder": _ctx.isFixedSidebar && _ctx.isHeaderLogo }, { "is-collapse": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isCollapseSidebar }, { "is-mix": !_ctx.isMobile && !_ctx.isBoxSidebar && _ctx.isMixSidebar }, { "is-compact": !_ctx.isMobile && _ctx.compact }, { "is-box": !_ctx.isMobile && _ctx.isBoxSidebar }]),
|
|
489
410
|
style: vue.normalizeStyle({ height: _ctx.isFixedSidebar ? _ctx.layoutHeight : void 0 })
|
|
490
411
|
}, [
|
|
491
412
|
_ctx.isMixSidebar ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
492
413
|
key: 0,
|
|
493
|
-
class: vue.normalizeClass([
|
|
494
|
-
"ele-admin-sidebox",
|
|
495
|
-
{ "is-dark": _ctx.isDarkSidebar },
|
|
496
|
-
{ "is-ghost": _ctx.isGhostSidebar },
|
|
497
|
-
{ "show-divider": !_ctx.isCollapseSidebar && !_ctx.isBoxSidebar },
|
|
498
|
-
{ "is-compact": _ctx.compact }
|
|
499
|
-
]),
|
|
414
|
+
class: vue.normalizeClass(["ele-admin-sidebox", { "is-dark": _ctx.isDarkSidebar }, { "is-ghost": _ctx.isGhostSidebar }, { "show-divider": !_ctx.isCollapseSidebar && !_ctx.isBoxSidebar }, { "is-compact": _ctx.compact }]),
|
|
500
415
|
style: vue.normalizeStyle(_ctx.sideboxCustomStyle),
|
|
501
416
|
onMouseenter: _cache[2] || (_cache[2] = (...args) => _ctx.handleBoxMouseEnter && _ctx.handleBoxMouseEnter(...args)),
|
|
502
417
|
onMouseleave: _cache[3] || (_cache[3] = (...args) => _ctx.handleBoxMouseLeave && _ctx.handleBoxMouseLeave(...args))
|
|
@@ -553,13 +468,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
553
468
|
], 38)) : vue.createCommentVNode("", true),
|
|
554
469
|
!_ctx.isBoxSidebar ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
555
470
|
key: 1,
|
|
556
|
-
class: vue.normalizeClass([
|
|
557
|
-
"ele-admin-sidebar",
|
|
558
|
-
{ "is-dark": _ctx.isMixSidebar ? _ctx.isDarkMixSidebar : _ctx.isDarkSidebar },
|
|
559
|
-
{ "is-ghost": _ctx.isGhostSidebar },
|
|
560
|
-
{ "is-mix": _ctx.isMixSidebar },
|
|
561
|
-
{ "is-collapse": _ctx.isCollapseSidebar }
|
|
562
|
-
]),
|
|
471
|
+
class: vue.normalizeClass(["ele-admin-sidebar", { "is-dark": _ctx.isMixSidebar ? _ctx.isDarkMixSidebar : _ctx.isDarkSidebar }, { "is-ghost": _ctx.isGhostSidebar }, { "is-mix": _ctx.isMixSidebar }, { "is-collapse": _ctx.isCollapseSidebar }]),
|
|
563
472
|
style: vue.normalizeStyle(_ctx.sidebarCustomStyle),
|
|
564
473
|
onMouseenter: _cache[4] || (_cache[4] = (...args) => _ctx.handleSideMouseEnter && _ctx.handleSideMouseEnter(...args)),
|
|
565
474
|
onMouseleave: _cache[5] || (_cache[5] = (...args) => _ctx.handleSideMouseLeave && _ctx.handleSideMouseLeave(...args))
|
|
@@ -640,20 +549,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
640
549
|
tabContextMenu: _ctx.tabContextMenu,
|
|
641
550
|
tabContextMenus: _ctx.tabContextMenus,
|
|
642
551
|
tabSortable: _ctx.tabSortable,
|
|
643
|
-
class: vue.normalizeClass([
|
|
644
|
-
{ "is-fixed-home": _ctx.fixedHome },
|
|
645
|
-
{ "is-fixed": _ctx.isFixedHeader },
|
|
646
|
-
{ "is-fixed-top": _ctx.isFixedHeader && (_ctx.isSideLayout || _ctx.maximized) }
|
|
647
|
-
]),
|
|
552
|
+
class: vue.normalizeClass([{ "is-fixed-home": _ctx.fixedHome }, { "is-fixed": _ctx.isFixedHeader }, { "is-fixed-top": _ctx.isFixedHeader && (_ctx.isSideLayout || _ctx.maximized) }]),
|
|
648
553
|
style: vue.normalizeStyle(_ctx.tabsCustomStyle),
|
|
649
554
|
onTabClick: _ctx.handleTabClick,
|
|
650
555
|
onTabRemove: _ctx.handleTabRemove,
|
|
651
556
|
onTabContextMenu: _ctx.handleTabContextMenu,
|
|
652
557
|
onTabSortChange: _ctx.handleTabSortChange
|
|
653
558
|
}, vue.createSlots({ _: 2 }, [
|
|
654
|
-
vue.renderList(Object.keys(_ctx.$slots).filter(
|
|
655
|
-
(k) => _ctx.tabSlots.includes(k)
|
|
656
|
-
), (name) => {
|
|
559
|
+
vue.renderList(Object.keys(_ctx.$slots).filter((k) => _ctx.tabSlots.includes(k)), (name) => {
|
|
657
560
|
return {
|
|
658
561
|
name,
|
|
659
562
|
fn: vue.withCtx((slotProps) => [
|
|
@@ -149,10 +149,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
149
149
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
150
150
|
onClose?: (() => any) | undefined;
|
|
151
151
|
onOpen?: (() => any) | undefined;
|
|
152
|
-
onOpenAutoFocus?: (() => any) | undefined;
|
|
153
|
-
onCloseAutoFocus?: (() => any) | undefined;
|
|
154
152
|
onOpened?: (() => any) | undefined;
|
|
155
153
|
onClosed?: (() => any) | undefined;
|
|
154
|
+
onOpenAutoFocus?: (() => any) | undefined;
|
|
155
|
+
onCloseAutoFocus?: (() => any) | undefined;
|
|
156
156
|
}, {
|
|
157
157
|
size: import('element-plus/es/utils/index').EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
158
158
|
title: string;
|
|
@@ -43,12 +43,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
43
43
|
!_ctx.isCircle ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
44
44
|
key: 0,
|
|
45
45
|
style: vue.normalizeStyle(_ctx.spinnerStyle),
|
|
46
|
-
class: vue.normalizeClass([
|
|
47
|
-
"ele-loading-spinner",
|
|
48
|
-
{ "ele-loading-blur": _ctx.blur },
|
|
49
|
-
{ "ele-loading-small": _ctx.size === "small" },
|
|
50
|
-
{ "ele-loading-large": _ctx.size === "large" }
|
|
51
|
-
])
|
|
46
|
+
class: vue.normalizeClass(["ele-loading-spinner", { "ele-loading-blur": _ctx.blur }, { "ele-loading-small": _ctx.size === "small" }, { "ele-loading-large": _ctx.size === "large" }])
|
|
52
47
|
}, [
|
|
53
48
|
vue.renderSlot(_ctx.$slots, "spinner", {}, () => [
|
|
54
49
|
_hoisted_1
|
package/lib/ele-modal/index.d.ts
CHANGED
|
@@ -207,10 +207,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
207
207
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
208
208
|
onClose?: (() => any) | undefined;
|
|
209
209
|
onOpen?: (() => any) | undefined;
|
|
210
|
-
onOpenAutoFocus?: (() => any) | undefined;
|
|
211
|
-
onCloseAutoFocus?: (() => any) | undefined;
|
|
212
210
|
onOpened?: (() => any) | undefined;
|
|
213
211
|
onClosed?: (() => any) | undefined;
|
|
212
|
+
onOpenAutoFocus?: (() => any) | undefined;
|
|
213
|
+
onCloseAutoFocus?: (() => any) | undefined;
|
|
214
214
|
"onUpdate:fullscreen"?: ((_fullscreen: boolean) => any) | undefined;
|
|
215
215
|
}, {
|
|
216
216
|
form: boolean;
|
|
@@ -36,6 +36,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
36
36
|
background: BooleanConstructor;
|
|
37
37
|
disabled: BooleanConstructor;
|
|
38
38
|
hideOnSinglePage: BooleanConstructor;
|
|
39
|
+
appendSizeTo: StringConstructor;
|
|
39
40
|
}, {
|
|
40
41
|
isInfinite: import('vue').ComputedRef<boolean>;
|
|
41
42
|
pageTotal: import('vue').ComputedRef<number | undefined>;
|
|
@@ -83,6 +84,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
83
84
|
background: BooleanConstructor;
|
|
84
85
|
disabled: BooleanConstructor;
|
|
85
86
|
hideOnSinglePage: BooleanConstructor;
|
|
87
|
+
appendSizeTo: StringConstructor;
|
|
86
88
|
}>> & {
|
|
87
89
|
"onUpdate:currentPage"?: ((_currentPage: number) => any) | undefined;
|
|
88
90
|
"onUpdate:pageSize"?: ((_pageSize: number) => any) | undefined;
|
|
@@ -46,6 +46,7 @@ export declare const paginationProps: {
|
|
|
46
46
|
background: BooleanConstructor;
|
|
47
47
|
disabled: BooleanConstructor;
|
|
48
48
|
hideOnSinglePage: BooleanConstructor;
|
|
49
|
+
appendSizeTo: StringConstructor;
|
|
49
50
|
};
|
|
50
51
|
export type PaginationProps = ExtractPropTypes<typeof paginationProps>;
|
|
51
52
|
/**
|
|
@@ -29,6 +29,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
29
29
|
props: props.proTableProps,
|
|
30
30
|
emits: props.proTableEmits,
|
|
31
31
|
setup(props2, { emit }) {
|
|
32
|
+
const isShowTable = vue.ref(true);
|
|
32
33
|
const events = util.useEmits(emit);
|
|
33
34
|
const methods = util.useMethods(() => getTableRef());
|
|
34
35
|
const globalProps = receiver.useGlobalProps("table");
|
|
@@ -145,7 +146,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
145
146
|
style: tableMaximized.value ? { zIndex } : void 0
|
|
146
147
|
};
|
|
147
148
|
});
|
|
148
|
-
const
|
|
149
|
+
const load = (option, parent, resolve) => {
|
|
149
150
|
if (option) {
|
|
150
151
|
if (option.currentPage) {
|
|
151
152
|
tablePage.value = option.currentPage;
|
|
@@ -199,6 +200,18 @@ const _sfc_main = vue.defineComponent({
|
|
|
199
200
|
resolve && console.error(e);
|
|
200
201
|
});
|
|
201
202
|
};
|
|
203
|
+
const reload = (option, parent, resolve) => {
|
|
204
|
+
load(option, parent, resolve);
|
|
205
|
+
};
|
|
206
|
+
const reset = () => {
|
|
207
|
+
methods.doLayout();
|
|
208
|
+
if (props2.lazy) {
|
|
209
|
+
isShowTable.value = false;
|
|
210
|
+
vue.nextTick(() => {
|
|
211
|
+
isShowTable.value = true;
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
};
|
|
202
215
|
const requestCallback = (data, totalCount, parent, response, resolve) => {
|
|
203
216
|
var _a;
|
|
204
217
|
if (!Array.isArray(data)) {
|
|
@@ -231,9 +244,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
231
244
|
}
|
|
232
245
|
tableLoading.value = false;
|
|
233
246
|
const result = {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
247
|
+
records: tableData.value,
|
|
248
|
+
currentPage: tablePage.value,
|
|
249
|
+
totalCount: tableTotal.value,
|
|
237
250
|
response
|
|
238
251
|
};
|
|
239
252
|
handleDone(result, parent);
|
|
@@ -329,9 +342,6 @@ const _sfc_main = vue.defineComponent({
|
|
|
329
342
|
emit("update:selections", selection);
|
|
330
343
|
}
|
|
331
344
|
};
|
|
332
|
-
const reloadTable = () => {
|
|
333
|
-
methods.doLayout();
|
|
334
|
-
};
|
|
335
345
|
const getTableRef = () => {
|
|
336
346
|
return tableViewRef.value;
|
|
337
347
|
};
|
|
@@ -348,9 +358,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
348
358
|
const rowKey = tableRowKey.value;
|
|
349
359
|
const data = util$1.sortData(props2.datasource, tableState.sorter);
|
|
350
360
|
const index2 = data.findIndex((d) => core.getValue(d, rowKey) === key);
|
|
351
|
-
const
|
|
352
|
-
if (tablePage.value !==
|
|
353
|
-
reload({
|
|
361
|
+
const currentPage = Math.floor(index2 / tableLimit.value) + 1;
|
|
362
|
+
if (tablePage.value !== currentPage) {
|
|
363
|
+
reload({ currentPage });
|
|
354
364
|
}
|
|
355
365
|
};
|
|
356
366
|
const fetch = (callback) => {
|
|
@@ -448,6 +458,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
448
458
|
}
|
|
449
459
|
});
|
|
450
460
|
return {
|
|
461
|
+
isShowTable,
|
|
451
462
|
toolsSlotExcludes,
|
|
452
463
|
tableSlotExcludes,
|
|
453
464
|
pageSlotExcludes,
|
|
@@ -472,7 +483,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
472
483
|
handlePageSizeChange,
|
|
473
484
|
handlePageCurrentChange,
|
|
474
485
|
reload,
|
|
475
|
-
|
|
486
|
+
reset,
|
|
487
|
+
// reloadTable,
|
|
476
488
|
getTableRef,
|
|
477
489
|
getData,
|
|
478
490
|
setData,
|
|
@@ -519,16 +531,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
519
531
|
])
|
|
520
532
|
};
|
|
521
533
|
})
|
|
522
|
-
]), 1040)) : (vue.openBlock(), vue.
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
534
|
+
]), 1040)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
535
|
+
_ctx.isShowTable ? (vue.openBlock(), vue.createBlock(_component_EleDataTable, vue.mergeProps({ key: 0 }, _ctx.tableProps, { ref: "tableViewRef" }), vue.createSlots({ _: 2 }, [
|
|
536
|
+
vue.renderList(Object.keys(_ctx.$slots).filter((k) => !_ctx.tableSlotExcludes.includes(k)), (name) => {
|
|
537
|
+
return {
|
|
538
|
+
name,
|
|
539
|
+
fn: vue.withCtx((slotProps) => [
|
|
540
|
+
vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotProps || {})))
|
|
541
|
+
])
|
|
542
|
+
};
|
|
543
|
+
})
|
|
544
|
+
]), 1040)) : vue.createCommentVNode("", true)
|
|
545
|
+
], 64)),
|
|
532
546
|
_ctx.paginationProps || _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
533
547
|
key: 3,
|
|
534
548
|
class: "ele-pro-table-footer",
|
|
@@ -196,7 +196,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
196
196
|
handlePageSizeChange: (pageSize: number) => void;
|
|
197
197
|
handlePageCurrentChange: (page: number) => void;
|
|
198
198
|
reload: ReloadFunction;
|
|
199
|
-
|
|
199
|
+
reset: () => void;
|
|
200
200
|
getTableRef: () => TableViewInstance | undefined;
|
|
201
201
|
getData: () => DataItem[];
|
|
202
202
|
setData: (data: DataItem[]) => void;
|
|
@@ -216,16 +216,19 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
216
216
|
clearFilter: (columnKeys?: string[]) => void;
|
|
217
217
|
doLayout: () => void;
|
|
218
218
|
sort: (prop: string, order: string) => void;
|
|
219
|
-
scrollTo: (options: number | ScrollToOptions, yCoord
|
|
219
|
+
scrollTo: (options: number | ScrollToOptions, yCoord?: number) => void;
|
|
220
220
|
setScrollTop: (top?: number) => void;
|
|
221
|
-
setScrollLeft: (left
|
|
221
|
+
setScrollLeft: (left? /** 表格当前的排序筛选搜索参数 */: number) => void;
|
|
222
222
|
setCurrentRowKey: (key?: import('../ele-data-table/types').DataKey | null) => void;
|
|
223
223
|
getCurrentRow: () => DataItem | undefined;
|
|
224
224
|
setSelectedRows: (rows?: DataItem[]) => void;
|
|
225
|
-
setSelectedRowKeys: (keys?: import('../ele-data-table/types').DataKey[], rows
|
|
225
|
+
setSelectedRowKeys: (keys?: import('../ele-data-table/types').DataKey[], rows?: DataItem[]) => void;
|
|
226
226
|
toggleRowExpansionAll: (expanded?: boolean) => void;
|
|
227
227
|
updateSelectedAndChecked: () => void;
|
|
228
228
|
updateKeyChildren: (key?: import('../ele-data-table/types').DataKey | null, rows?: DataItem[]) => void;
|
|
229
|
+
isShowTable: Ref<{
|
|
230
|
+
valueOf: () => boolean;
|
|
231
|
+
}>;
|
|
229
232
|
toolsSlotExcludes: string[];
|
|
230
233
|
tableSlotExcludes: string[];
|
|
231
234
|
pageSlotExcludes: string[];
|
|
@@ -80,6 +80,14 @@ export interface ReloadParams {
|
|
|
80
80
|
filter?: Filter;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* 加载方法
|
|
85
|
+
* @param option 刷新参数
|
|
86
|
+
* @param parent 树表格父级数据
|
|
87
|
+
* @param resolve 树表格懒加载方法
|
|
88
|
+
*/
|
|
89
|
+
export type LoadFunction = (option?: ReloadParams, parent?: DataItem, resolve?: ResolveFunction) => void;
|
|
90
|
+
|
|
83
91
|
/**
|
|
84
92
|
* 刷新方法
|
|
85
93
|
* @param option 刷新参数
|
|
@@ -143,11 +151,11 @@ export interface OrderItem {
|
|
|
143
151
|
*/
|
|
144
152
|
export interface DoneParams<T> {
|
|
145
153
|
/** 当前页数据 */
|
|
146
|
-
|
|
154
|
+
records: T[];
|
|
147
155
|
/** 总数量 */
|
|
148
|
-
|
|
156
|
+
totalCount?: PaginationTotal;
|
|
149
157
|
/** 当前页码 */
|
|
150
|
-
|
|
158
|
+
currentPage?: number;
|
|
151
159
|
/** 数据源原始数据 */
|
|
152
160
|
response?: any;
|
|
153
161
|
}
|
|
@@ -204,7 +204,6 @@ function sortData(datasource, sorter) {
|
|
|
204
204
|
return data;
|
|
205
205
|
}
|
|
206
206
|
function reloadData(datasource, sorter, currentPage, pageSize) {
|
|
207
|
-
debugger;
|
|
208
207
|
const records = sortData(datasource, sorter);
|
|
209
208
|
const totalCount = records.length;
|
|
210
209
|
if (!currentPage || !pageSize) {
|
|
@@ -122,6 +122,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
122
122
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
123
123
|
flexible: BooleanConstructor;
|
|
124
124
|
showOverflowTooltip: import('vue').PropType<boolean | Partial<Pick<import('element-plus').ElTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "popperOptions" | "enterable" | "popperClass" | "appendTo" | "showArrow">> | undefined>;
|
|
125
|
+
appendFilterPanelTo: StringConstructor;
|
|
126
|
+
scrollbarTabindex: {
|
|
127
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
128
|
+
default: undefined;
|
|
129
|
+
};
|
|
125
130
|
}, {
|
|
126
131
|
ownSlots: string[];
|
|
127
132
|
rootRef: Ref<HTMLElement | null>;
|
|
@@ -333,6 +338,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
333
338
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
334
339
|
flexible: BooleanConstructor;
|
|
335
340
|
showOverflowTooltip: import('vue').PropType<boolean | Partial<Pick<import('element-plus').ElTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "popperOptions" | "enterable" | "popperClass" | "appendTo" | "showArrow">> | undefined>;
|
|
341
|
+
appendFilterPanelTo: StringConstructor;
|
|
342
|
+
scrollbarTabindex: {
|
|
343
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
344
|
+
default: undefined;
|
|
345
|
+
};
|
|
336
346
|
}>> & {
|
|
337
347
|
onSelect?: ((_selection: DataItem[], _row: DataItem) => any) | undefined;
|
|
338
348
|
onExpandChange?: ((_row: DataItem, _expanded: boolean) => any) | undefined;
|
|
@@ -371,6 +381,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
371
381
|
tableLayout: "auto" | "fixed";
|
|
372
382
|
scrollbarAlwaysOn: boolean;
|
|
373
383
|
flexible: boolean;
|
|
384
|
+
scrollbarTabindex: string | number;
|
|
374
385
|
sticky: boolean;
|
|
375
386
|
headerEllipsis: boolean;
|
|
376
387
|
slotNormalize: boolean;
|
|
@@ -123,6 +123,11 @@ export declare const virtualTableProps: {
|
|
|
123
123
|
scrollbarAlwaysOn: BooleanConstructor;
|
|
124
124
|
flexible: BooleanConstructor;
|
|
125
125
|
showOverflowTooltip: import('vue').PropType<boolean | Partial<Pick<import('element-plus').ElTooltipProps, "offset" | "transition" | "placement" | "effect" | "showAfter" | "hideAfter" | "popperOptions" | "enterable" | "popperClass" | "appendTo" | "showArrow">> | undefined>;
|
|
126
|
+
appendFilterPanelTo: StringConstructor;
|
|
127
|
+
scrollbarTabindex: {
|
|
128
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
129
|
+
default: undefined;
|
|
130
|
+
};
|
|
126
131
|
};
|
|
127
132
|
export type VirtualTableProps = ExtractPropTypes<typeof virtualTableProps>;
|
|
128
133
|
/**
|
|
@@ -96,9 +96,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
96
96
|
};
|
|
97
97
|
const fillTexts = (ctx, drawX, drawY, drawWidth, drawHeight) => {
|
|
98
98
|
const ratio = util.getPixelRatio();
|
|
99
|
-
const { color, fontSize, fontStyle, fontWeight, fontFamily } = util.getFont(
|
|
100
|
-
props2.font
|
|
101
|
-
);
|
|
99
|
+
const { color, fontSize, fontStyle, fontWeight, fontFamily } = util.getFont(props2.font);
|
|
102
100
|
const mergedFontSize = fontSize * ratio;
|
|
103
101
|
ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${drawHeight}px ${fontFamily}`;
|
|
104
102
|
ctx.fillStyle = color;
|
|
@@ -108,11 +106,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
108
106
|
const content = props2.content;
|
|
109
107
|
const contents = Array.isArray(content) ? content : [content];
|
|
110
108
|
contents.forEach((item, index2) => {
|
|
111
|
-
ctx.fillText(
|
|
112
|
-
item ?? "",
|
|
113
|
-
drawX,
|
|
114
|
-
drawY + index2 * (mergedFontSize + props2.lineGap * ratio)
|
|
115
|
-
);
|
|
109
|
+
ctx.fillText(item ?? "", drawX, drawY + index2 * (mergedFontSize + props2.lineGap * ratio));
|
|
116
110
|
});
|
|
117
111
|
};
|
|
118
112
|
const render = () => {
|
|
@@ -156,13 +150,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
156
150
|
ctx.drawImage(img, drawX, drawY, drawWidth, drawHeight);
|
|
157
151
|
ctx.restore();
|
|
158
152
|
util.rotateWatermark(ctx, alternateRotateX, alternateRotateY, rotate);
|
|
159
|
-
ctx.drawImage(
|
|
160
|
-
img,
|
|
161
|
-
alternateDrawX,
|
|
162
|
-
alternateDrawY,
|
|
163
|
-
drawWidth,
|
|
164
|
-
drawHeight
|
|
165
|
-
);
|
|
153
|
+
ctx.drawImage(img, alternateDrawX, alternateDrawY, drawWidth, drawHeight);
|
|
166
154
|
updateStyle(canvas.toDataURL(), `${(gapX + markWidth) * SIZE}px`);
|
|
167
155
|
};
|
|
168
156
|
img.crossOrigin = "anonymous";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yuang-framework-ui-pc",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite --host --config vite.global.ts --mode dev",
|
|
@@ -188,6 +188,6 @@
|
|
|
188
188
|
"repository": "",
|
|
189
189
|
"license": "",
|
|
190
190
|
"dependencies": {
|
|
191
|
-
"yuang-framework-ui-common": "^1.0.
|
|
191
|
+
"yuang-framework-ui-common": "^1.0.40"
|
|
192
192
|
}
|
|
193
193
|
}
|