@qy_better_lib/pc 0.1.2 → 0.1.4
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/lib/contextMenu/src/index.vue.d.ts +71 -0
- package/lib/contextMenu/src/index.vue.js +108 -0
- package/lib/contextMenu/src/index.vue2.js +4 -0
- package/lib/tableExtend/src/colVisible.vue.d.ts +3 -0
- package/lib/tableExtend/src/colVisible.vue.js +103 -0
- package/lib/tableExtend/src/colVisible.vue2.js +4 -0
- package/lib/tableExtend/src/index.vue.d.ts +117 -0
- package/lib/tableExtend/src/index.vue.js +177 -0
- package/lib/tableExtend/src/index.vue2.js +4 -0
- package/lib/tableExtend/src/valueCol.vue.d.ts +24 -0
- package/lib/tableExtend/src/valueCol.vue.js +26 -0
- package/lib/tableExtend/src/valueCol.vue2.js +4 -0
- package/lib/textButton/src/index.vue.d.ts +31 -0
- package/lib/textButton/src/index.vue.js +39 -0
- package/lib/textButton/src/index.vue2.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { PropType, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 右键菜单显示
|
|
5
|
+
*/
|
|
6
|
+
declare function show(e: any): Promise<void>;
|
|
7
|
+
declare function hide(): void;
|
|
8
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropTypes<{
|
|
9
|
+
visible: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: () => boolean;
|
|
12
|
+
};
|
|
13
|
+
position: {
|
|
14
|
+
type: PropType<{
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}>;
|
|
18
|
+
default: () => void;
|
|
19
|
+
};
|
|
20
|
+
options: {
|
|
21
|
+
type: PropType<Record<string, any>>;
|
|
22
|
+
default: never[];
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
}>, {
|
|
26
|
+
hide: typeof hide;
|
|
27
|
+
show: typeof show;
|
|
28
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
29
|
+
menuClick: (...args: any[]) => void;
|
|
30
|
+
"update:visible": (...args: any[]) => void;
|
|
31
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
32
|
+
visible: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: () => boolean;
|
|
35
|
+
};
|
|
36
|
+
position: {
|
|
37
|
+
type: PropType<{
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}>;
|
|
41
|
+
default: () => void;
|
|
42
|
+
};
|
|
43
|
+
options: {
|
|
44
|
+
type: PropType<Record<string, any>>;
|
|
45
|
+
default: never[];
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
}>> & Readonly<{
|
|
49
|
+
onMenuClick?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
"onUpdate:visible"?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
}>, {
|
|
52
|
+
options: Record<string, any>;
|
|
53
|
+
visible: boolean;
|
|
54
|
+
position: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
};
|
|
58
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
59
|
+
items?(_: {
|
|
60
|
+
data: {
|
|
61
|
+
item: any;
|
|
62
|
+
options: Record<string, any>;
|
|
63
|
+
};
|
|
64
|
+
}): any;
|
|
65
|
+
}>;
|
|
66
|
+
export default _default;
|
|
67
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineComponent as M, ref as h, reactive as X, watch as $, nextTick as m, onMounted as D, onBeforeUnmount as L, resolveComponent as N, openBlock as i, createBlock as _, Teleport as P, withDirectives as S, createElementBlock as a, normalizeStyle as T, createElementVNode as C, Fragment as b, renderList as V, renderSlot as Y, createTextVNode as H, toDisplayString as O, unref as R, createCommentVNode as W } from "vue";
|
|
2
|
+
import { ClickOutside as j } from "@qy_better_lib/core";
|
|
3
|
+
const q = { class: "contextmenu-wrap" }, z = { class: "contextmenu-items" }, A = ["onClick"], G = /* @__PURE__ */ M({
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
visible: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: () => !1
|
|
9
|
+
},
|
|
10
|
+
position: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => {
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
options: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: [],
|
|
18
|
+
required: !0
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
emits: ["menuClick", "update:visible"],
|
|
22
|
+
setup(u, { expose: g, emit: B }) {
|
|
23
|
+
const v = u, y = B;
|
|
24
|
+
g({
|
|
25
|
+
hide: p,
|
|
26
|
+
show: d
|
|
27
|
+
});
|
|
28
|
+
const l = h(!1), s = h(null), c = X({
|
|
29
|
+
left: 0,
|
|
30
|
+
top: 0
|
|
31
|
+
});
|
|
32
|
+
$(() => v.visible, (e) => {
|
|
33
|
+
e && (l.value = !0, m(() => {
|
|
34
|
+
k(v.position);
|
|
35
|
+
}));
|
|
36
|
+
}, {
|
|
37
|
+
immediate: !0
|
|
38
|
+
}), D(() => {
|
|
39
|
+
var e;
|
|
40
|
+
(e = s.value) == null || e.addEventListener("contextmenu", d);
|
|
41
|
+
}), L(() => {
|
|
42
|
+
x();
|
|
43
|
+
});
|
|
44
|
+
function x() {
|
|
45
|
+
var e;
|
|
46
|
+
(e = s.value) == null || e.removeEventListener("contextmenu", d);
|
|
47
|
+
}
|
|
48
|
+
function E(e) {
|
|
49
|
+
y("menuClick", e), p();
|
|
50
|
+
}
|
|
51
|
+
async function d(e) {
|
|
52
|
+
e.preventDefault(), l.value = !0, await m();
|
|
53
|
+
const { pageX: o, pageY: t } = e;
|
|
54
|
+
k({ x: o, y: t });
|
|
55
|
+
}
|
|
56
|
+
function k(e) {
|
|
57
|
+
const { clientWidth: o, clientHeight: t } = s.value;
|
|
58
|
+
!o || !t || (c.top = `${w("Y", e.y || 0, t)}px`, c.left = `${w("X", e.x || 0, o)}px`);
|
|
59
|
+
}
|
|
60
|
+
function p() {
|
|
61
|
+
x(), l.value = !1, m(() => {
|
|
62
|
+
y("update:visible", !1);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function w(e, o, t) {
|
|
66
|
+
const n = e === "X" ? window.innerWidth : window.innerHeight, f = e === "X" ? window.scrollX : window.scrollY;
|
|
67
|
+
let r = o - f;
|
|
68
|
+
return r + t > n && (r = Math.max(0, r - t)), r + f;
|
|
69
|
+
}
|
|
70
|
+
return (e, o) => {
|
|
71
|
+
const t = N("el-divider");
|
|
72
|
+
return i(), _(P, { to: "body" }, [
|
|
73
|
+
l.value ? S((i(), a("div", {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: "contextmenu",
|
|
76
|
+
style: T({ top: c.top, left: c.left }),
|
|
77
|
+
ref_key: "contextMenuRef",
|
|
78
|
+
ref: s
|
|
79
|
+
}, [
|
|
80
|
+
C("div", q, [
|
|
81
|
+
C("ul", z, [
|
|
82
|
+
(i(!0), a(b, null, V(u.options, (n) => (i(), a(b, {
|
|
83
|
+
key: n.key
|
|
84
|
+
}, [
|
|
85
|
+
(n == null ? void 0 : n.type) == "divider" ? (i(), _(t, { key: 0 })) : (i(), a("li", {
|
|
86
|
+
key: 1,
|
|
87
|
+
class: "contextmenu-item",
|
|
88
|
+
onClick: (f) => E(n)
|
|
89
|
+
}, [
|
|
90
|
+
Y(e.$slots, "items", {
|
|
91
|
+
data: { item: n, options: u.options }
|
|
92
|
+
}, () => [
|
|
93
|
+
H(O(n.label), 1)
|
|
94
|
+
])
|
|
95
|
+
], 8, A))
|
|
96
|
+
], 64))), 128))
|
|
97
|
+
])
|
|
98
|
+
])
|
|
99
|
+
], 4)), [
|
|
100
|
+
[R(j), p]
|
|
101
|
+
]) : W("", !0)
|
|
102
|
+
]);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
export {
|
|
107
|
+
G as default
|
|
108
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineComponent as A, inject as E, ref as v, computed as h, resolveComponent as i, openBlock as r, createBlock as F, withCtx as c, createVNode as t, createElementVNode as g, createTextVNode as k, createElementBlock as x, Fragment as $, renderList as j, toDisplayString as y, normalizeClass as b } from "vue";
|
|
2
|
+
const z = { class: "set-column-list-wrap" }, D = { class: "fixed-wrap" }, T = /* @__PURE__ */ A({
|
|
3
|
+
__name: "colVisible",
|
|
4
|
+
setup(I) {
|
|
5
|
+
const n = E("table-extend"), s = v(!0), m = v(!1), f = h(() => n && n.columnConfig.showColumn.map((l) => l.prop) || []), a = h(() => (n == null ? void 0 : n.tableColums.value) || []);
|
|
6
|
+
function V(l) {
|
|
7
|
+
l ? n && (n.columnConfig.showColumn = a.value) : n && (n.columnConfig.showColumn = []);
|
|
8
|
+
}
|
|
9
|
+
function w(l) {
|
|
10
|
+
if (n) {
|
|
11
|
+
n.columnConfig.showColumn = a.value.filter((u) => l.includes(u.prop));
|
|
12
|
+
const e = l.length;
|
|
13
|
+
s.value = e === a.value.length, m.value = e > 0 && e < a.value.length;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function p(l, e) {
|
|
17
|
+
e.fixed === l ? e.fixed = void 0 : e.fixed = l;
|
|
18
|
+
}
|
|
19
|
+
return (l, e) => {
|
|
20
|
+
const u = i("Setting"), d = i("el-icon"), _ = i("el-checkbox"), C = i("Upload"), U = i("el-divider"), B = i("el-checkbox-group"), N = i("el-popover");
|
|
21
|
+
return r(), F(N, {
|
|
22
|
+
placement: "bottom",
|
|
23
|
+
title: "列显示设置",
|
|
24
|
+
width: 220
|
|
25
|
+
}, {
|
|
26
|
+
reference: c(() => [
|
|
27
|
+
t(d, null, {
|
|
28
|
+
default: c(() => [
|
|
29
|
+
t(u)
|
|
30
|
+
]),
|
|
31
|
+
_: 1
|
|
32
|
+
})
|
|
33
|
+
]),
|
|
34
|
+
default: c(() => [
|
|
35
|
+
g("div", z, [
|
|
36
|
+
t(_, {
|
|
37
|
+
indeterminate: m.value,
|
|
38
|
+
modelValue: s.value,
|
|
39
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => s.value = o),
|
|
40
|
+
onChange: V
|
|
41
|
+
}, {
|
|
42
|
+
default: c(() => e[2] || (e[2] = [
|
|
43
|
+
k("全选 ")
|
|
44
|
+
])),
|
|
45
|
+
_: 1
|
|
46
|
+
}, 8, ["indeterminate", "modelValue"]),
|
|
47
|
+
t(B, {
|
|
48
|
+
class: "set-column-check-group",
|
|
49
|
+
modelValue: f.value,
|
|
50
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => f.value = o),
|
|
51
|
+
onChange: w
|
|
52
|
+
}, {
|
|
53
|
+
default: c(() => [
|
|
54
|
+
(r(!0), x($, null, j(a.value, (o) => (r(), x("div", {
|
|
55
|
+
class: "group-item",
|
|
56
|
+
key: o.prop
|
|
57
|
+
}, [
|
|
58
|
+
t(_, {
|
|
59
|
+
class: "set-column-check",
|
|
60
|
+
label: o.prop
|
|
61
|
+
}, {
|
|
62
|
+
default: c(() => [
|
|
63
|
+
k(y(o.label), 1)
|
|
64
|
+
]),
|
|
65
|
+
_: 2
|
|
66
|
+
}, 1032, ["label"]),
|
|
67
|
+
g("div", D, [
|
|
68
|
+
t(d, {
|
|
69
|
+
class: b(["fixed-icon", o.fixed === "left" && "active"]),
|
|
70
|
+
title: "固定到左边",
|
|
71
|
+
onClick: (S) => p("left", o)
|
|
72
|
+
}, {
|
|
73
|
+
default: c(() => [
|
|
74
|
+
t(C)
|
|
75
|
+
]),
|
|
76
|
+
_: 2
|
|
77
|
+
}, 1032, ["class", "onClick"]),
|
|
78
|
+
t(U, { direction: "vertical" }),
|
|
79
|
+
t(d, {
|
|
80
|
+
class: b(["fixed-icon", o.fixed === "right" && "active"]),
|
|
81
|
+
title: "固定到右边",
|
|
82
|
+
onClick: (S) => p("right", o)
|
|
83
|
+
}, {
|
|
84
|
+
default: c(() => [
|
|
85
|
+
t(C)
|
|
86
|
+
]),
|
|
87
|
+
_: 2
|
|
88
|
+
}, 1032, ["class", "onClick"])
|
|
89
|
+
])
|
|
90
|
+
]))), 128))
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["modelValue"])
|
|
94
|
+
])
|
|
95
|
+
]),
|
|
96
|
+
_: 1
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export {
|
|
102
|
+
T as default
|
|
103
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { TableAttr, TableColumn } from './../type';
|
|
3
|
+
declare function clearSelection(): void;
|
|
4
|
+
declare function toggleRowSelection(row: any): void;
|
|
5
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropTypes<{
|
|
6
|
+
options: {
|
|
7
|
+
type: PropType<TableAttr>;
|
|
8
|
+
default: () => {};
|
|
9
|
+
};
|
|
10
|
+
tableData: {
|
|
11
|
+
type: ArrayConstructor;
|
|
12
|
+
default: never[];
|
|
13
|
+
};
|
|
14
|
+
tableColums: {
|
|
15
|
+
type: PropType< TableColumn[]>;
|
|
16
|
+
default: () => never[];
|
|
17
|
+
};
|
|
18
|
+
tableLoading: BooleanConstructor;
|
|
19
|
+
selectionCol: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: () => boolean;
|
|
22
|
+
};
|
|
23
|
+
indexCol: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: () => boolean;
|
|
26
|
+
};
|
|
27
|
+
isSetColumn: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: () => boolean;
|
|
30
|
+
};
|
|
31
|
+
paging: {
|
|
32
|
+
type: PropType<{
|
|
33
|
+
pageIndex: number;
|
|
34
|
+
pageSize: number;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
total: NumberConstructor;
|
|
38
|
+
sizeList: {
|
|
39
|
+
type: PropType<number[]>;
|
|
40
|
+
default: () => number[];
|
|
41
|
+
};
|
|
42
|
+
}>, {
|
|
43
|
+
clearSelection: typeof clearSelection;
|
|
44
|
+
toggleRowSelection: typeof toggleRowSelection;
|
|
45
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
46
|
+
tableSort: (...args: any[]) => void;
|
|
47
|
+
handleSelectionChange: (...args: any[]) => void;
|
|
48
|
+
currentChange: (...args: any[]) => void;
|
|
49
|
+
pageSizeChange: (...args: any[]) => void;
|
|
50
|
+
rowClick: (...args: any[]) => void;
|
|
51
|
+
rowDblClick: (...args: any[]) => void;
|
|
52
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
53
|
+
options: {
|
|
54
|
+
type: PropType<TableAttr>;
|
|
55
|
+
default: () => {};
|
|
56
|
+
};
|
|
57
|
+
tableData: {
|
|
58
|
+
type: ArrayConstructor;
|
|
59
|
+
default: never[];
|
|
60
|
+
};
|
|
61
|
+
tableColums: {
|
|
62
|
+
type: PropType< TableColumn[]>;
|
|
63
|
+
default: () => never[];
|
|
64
|
+
};
|
|
65
|
+
tableLoading: BooleanConstructor;
|
|
66
|
+
selectionCol: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: () => boolean;
|
|
69
|
+
};
|
|
70
|
+
indexCol: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: () => boolean;
|
|
73
|
+
};
|
|
74
|
+
isSetColumn: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: () => boolean;
|
|
77
|
+
};
|
|
78
|
+
paging: {
|
|
79
|
+
type: PropType<{
|
|
80
|
+
pageIndex: number;
|
|
81
|
+
pageSize: number;
|
|
82
|
+
}>;
|
|
83
|
+
};
|
|
84
|
+
total: NumberConstructor;
|
|
85
|
+
sizeList: {
|
|
86
|
+
type: PropType<number[]>;
|
|
87
|
+
default: () => number[];
|
|
88
|
+
};
|
|
89
|
+
}>> & Readonly<{
|
|
90
|
+
onTableSort?: ((...args: any[]) => any) | undefined;
|
|
91
|
+
onHandleSelectionChange?: ((...args: any[]) => any) | undefined;
|
|
92
|
+
onCurrentChange?: ((...args: any[]) => any) | undefined;
|
|
93
|
+
onPageSizeChange?: ((...args: any[]) => any) | undefined;
|
|
94
|
+
onRowClick?: ((...args: any[]) => any) | undefined;
|
|
95
|
+
onRowDblClick?: ((...args: any[]) => any) | undefined;
|
|
96
|
+
}>, {
|
|
97
|
+
tableColums: TableColumn[];
|
|
98
|
+
options: TableAttr;
|
|
99
|
+
tableData: unknown[];
|
|
100
|
+
tableLoading: boolean;
|
|
101
|
+
selectionCol: boolean;
|
|
102
|
+
indexCol: boolean;
|
|
103
|
+
isSetColumn: boolean;
|
|
104
|
+
sizeList: number[];
|
|
105
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, Partial<Record<`col_${string}`, (_: {
|
|
106
|
+
data: any;
|
|
107
|
+
}) => any>> & {
|
|
108
|
+
"tool-left"?(_: {}): any;
|
|
109
|
+
"tool-right"?(_: {}): any;
|
|
110
|
+
operatColumn?(_: {}): any;
|
|
111
|
+
}>;
|
|
112
|
+
export default _default;
|
|
113
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
114
|
+
new (): {
|
|
115
|
+
$slots: S;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { defineComponent as F, provide as O, toRef as q, ref as y, watch as k, onMounted as G, nextTick as J, resolveComponent as f, resolveDirective as K, openBlock as o, createElementBlock as m, createElementVNode as p, renderSlot as C, createBlock as r, createCommentVNode as u, withDirectives as Q, mergeProps as b, unref as i, withCtx as h, createVNode as z, Fragment as v, renderList as W } from "vue";
|
|
2
|
+
import { useI18n as X } from "vue-i18n";
|
|
3
|
+
import Y from "../useTable.js";
|
|
4
|
+
import Z from "../props.js";
|
|
5
|
+
import ee from "./valueCol.vue.js";
|
|
6
|
+
import te from "./colVisible.vue.js";
|
|
7
|
+
const oe = { class: "table-extend" }, ne = { class: "tool-panel" }, le = { class: "left-panel" }, ae = { class: "right-panel" }, re = { class: "default-tool" }, ie = ["innerHTML"], fe = /* @__PURE__ */ F({
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: { ...Z() },
|
|
10
|
+
emits: [
|
|
11
|
+
"tableSort",
|
|
12
|
+
"handleSelectionChange",
|
|
13
|
+
"currentChange",
|
|
14
|
+
"pageSizeChange",
|
|
15
|
+
"rowClick",
|
|
16
|
+
"rowDblClick"
|
|
17
|
+
],
|
|
18
|
+
setup(D, { expose: R, emit: T }) {
|
|
19
|
+
const n = D, s = T, { t: $ } = X(), {
|
|
20
|
+
selectionOptions: w,
|
|
21
|
+
tableAttribute: I,
|
|
22
|
+
pagination: l,
|
|
23
|
+
hasPagination: L,
|
|
24
|
+
columnConfig: _,
|
|
25
|
+
colSettingList: P
|
|
26
|
+
} = Y($);
|
|
27
|
+
O("table-extend", {
|
|
28
|
+
tableProps: n,
|
|
29
|
+
tableColums: q(n, "tableColums"),
|
|
30
|
+
columnConfig: _
|
|
31
|
+
});
|
|
32
|
+
const c = y(null), S = y(!1);
|
|
33
|
+
k(
|
|
34
|
+
() => n.tableColums,
|
|
35
|
+
() => {
|
|
36
|
+
_.showColumn = n.tableColums;
|
|
37
|
+
}
|
|
38
|
+
), k(
|
|
39
|
+
() => l.pageIndex,
|
|
40
|
+
(e) => {
|
|
41
|
+
if (e && e > 0) {
|
|
42
|
+
if (S.value) {
|
|
43
|
+
S.value = !1;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
s("currentChange", e), c.value.setScrollTop(0);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
), k(
|
|
50
|
+
() => l.pageSize,
|
|
51
|
+
(e) => {
|
|
52
|
+
e && e > 0 && (S.value = !0, l.pageIndex = 1, s("pageSizeChange", e), c.value.setScrollTop(0));
|
|
53
|
+
}
|
|
54
|
+
), G(() => {
|
|
55
|
+
J(() => {
|
|
56
|
+
n.tableColums && n.tableColums.length > 0 && (_.showColumn = n.tableColums);
|
|
57
|
+
});
|
|
58
|
+
}), R({
|
|
59
|
+
clearSelection: M,
|
|
60
|
+
toggleRowSelection: V
|
|
61
|
+
});
|
|
62
|
+
function x(e) {
|
|
63
|
+
s("tableSort", {
|
|
64
|
+
sortName: e.prop,
|
|
65
|
+
sortType: e.order === "descending" ? "desc" : e.order === "ascending" ? "asc" : ""
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function N(e) {
|
|
69
|
+
w.rows = e, w.count = e && e.length, s("handleSelectionChange", e);
|
|
70
|
+
}
|
|
71
|
+
function B(e) {
|
|
72
|
+
s("rowClick", e);
|
|
73
|
+
}
|
|
74
|
+
function H(e) {
|
|
75
|
+
s("rowDblClick", e);
|
|
76
|
+
}
|
|
77
|
+
function M() {
|
|
78
|
+
var e;
|
|
79
|
+
(e = c.value) == null || e.clearSelection();
|
|
80
|
+
}
|
|
81
|
+
function V(e) {
|
|
82
|
+
var a;
|
|
83
|
+
(a = c.value) == null || a.toggleRowSelection(e);
|
|
84
|
+
}
|
|
85
|
+
return (e, a) => {
|
|
86
|
+
const d = f("el-table-column"), E = f("el-empty"), U = f("el-table"), j = f("el-pagination"), A = K("loading");
|
|
87
|
+
return o(), m("div", oe, [
|
|
88
|
+
p("div", ne, [
|
|
89
|
+
p("div", le, [
|
|
90
|
+
C(e.$slots, "tool-left")
|
|
91
|
+
]),
|
|
92
|
+
p("div", ae, [
|
|
93
|
+
C(e.$slots, "tool-right"),
|
|
94
|
+
p("div", re, [
|
|
95
|
+
e.isSetColumn ? (o(), r(te, { key: 0 })) : u("", !0)
|
|
96
|
+
])
|
|
97
|
+
])
|
|
98
|
+
]),
|
|
99
|
+
Q((o(), r(U, b({
|
|
100
|
+
ref_key: "tableRef",
|
|
101
|
+
ref: c
|
|
102
|
+
}, i(I), {
|
|
103
|
+
data: e.tableData,
|
|
104
|
+
onSortChange: x,
|
|
105
|
+
onSelectionChange: N,
|
|
106
|
+
onRowClick: B,
|
|
107
|
+
onRowDblclick: H
|
|
108
|
+
}), {
|
|
109
|
+
empty: h(() => [
|
|
110
|
+
z(E, { "image-size": 60 })
|
|
111
|
+
]),
|
|
112
|
+
default: h(() => [
|
|
113
|
+
e.selectionCol ? (o(), r(d, {
|
|
114
|
+
key: 0,
|
|
115
|
+
type: "selection",
|
|
116
|
+
width: "48",
|
|
117
|
+
fixed: "left"
|
|
118
|
+
})) : u("", !0),
|
|
119
|
+
e.indexCol ? (o(), r(d, {
|
|
120
|
+
key: 1,
|
|
121
|
+
type: "index",
|
|
122
|
+
width: "58",
|
|
123
|
+
fixed: "left"
|
|
124
|
+
})) : u("", !0),
|
|
125
|
+
(o(!0), m(v, null, W(i(P), (t) => (o(), m(v, {
|
|
126
|
+
key: t.prop
|
|
127
|
+
}, [
|
|
128
|
+
t.isHtml ? (o(), r(d, b({
|
|
129
|
+
key: 0,
|
|
130
|
+
ref_for: !0
|
|
131
|
+
}, t), {
|
|
132
|
+
default: h((g) => [
|
|
133
|
+
p("div", {
|
|
134
|
+
innerHTML: t.prop && g.row[t.prop]
|
|
135
|
+
}, null, 8, ie)
|
|
136
|
+
]),
|
|
137
|
+
_: 2
|
|
138
|
+
}, 1040)) : (o(), m(v, { key: 1 }, [
|
|
139
|
+
t.init ? (o(), r(d, b({
|
|
140
|
+
key: 0,
|
|
141
|
+
ref_for: !0
|
|
142
|
+
}, t), {
|
|
143
|
+
default: h((g) => [
|
|
144
|
+
C(e.$slots, `col_${t.prop}`, {
|
|
145
|
+
data: g.row
|
|
146
|
+
}, () => [
|
|
147
|
+
z(ee, b({ ref_for: !0 }, { row: g.row, colCfg: t }), null, 16)
|
|
148
|
+
])
|
|
149
|
+
]),
|
|
150
|
+
_: 2
|
|
151
|
+
}, 1040)) : u("", !0)
|
|
152
|
+
], 64))
|
|
153
|
+
], 64))), 128)),
|
|
154
|
+
C(e.$slots, "operatColumn")
|
|
155
|
+
]),
|
|
156
|
+
_: 3
|
|
157
|
+
}, 16, ["data"])), [
|
|
158
|
+
[A, e.tableLoading]
|
|
159
|
+
]),
|
|
160
|
+
i(L) ? (o(), r(j, {
|
|
161
|
+
key: 0,
|
|
162
|
+
background: "",
|
|
163
|
+
"current-page": i(l).pageIndex,
|
|
164
|
+
"onUpdate:currentPage": a[0] || (a[0] = (t) => i(l).pageIndex = t),
|
|
165
|
+
"page-size": i(l).pageSize,
|
|
166
|
+
"onUpdate:pageSize": a[1] || (a[1] = (t) => i(l).pageSize = t),
|
|
167
|
+
"page-sizes": e.sizeList,
|
|
168
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
169
|
+
total: e.total
|
|
170
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) : u("", !0)
|
|
171
|
+
]);
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
export {
|
|
176
|
+
fe as default
|
|
177
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
3
|
+
row: {
|
|
4
|
+
type: ObjectConstructor;
|
|
5
|
+
default: () => void;
|
|
6
|
+
};
|
|
7
|
+
colCfg: {
|
|
8
|
+
type: ObjectConstructor;
|
|
9
|
+
default: () => void;
|
|
10
|
+
};
|
|
11
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
12
|
+
row: {
|
|
13
|
+
type: ObjectConstructor;
|
|
14
|
+
default: () => void;
|
|
15
|
+
};
|
|
16
|
+
colCfg: {
|
|
17
|
+
type: ObjectConstructor;
|
|
18
|
+
default: () => void;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{}>, {
|
|
21
|
+
row: Record<string, any>;
|
|
22
|
+
colCfg: Record<string, any>;
|
|
23
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent as l, computed as p, openBlock as r, createElementBlock as u, toDisplayString as a } from "vue";
|
|
2
|
+
const f = /* @__PURE__ */ l({
|
|
3
|
+
__name: "valueCol",
|
|
4
|
+
props: {
|
|
5
|
+
row: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => {
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
colCfg: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => {
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(n) {
|
|
17
|
+
const c = n, e = p(() => {
|
|
18
|
+
const { row: t, colCfg: o } = c;
|
|
19
|
+
return t[o.prop];
|
|
20
|
+
});
|
|
21
|
+
return (t, o) => (r(), u("span", null, a(e.value != null ? e.value : "--"), 1));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
f as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropTypes<{
|
|
3
|
+
type: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
validator: (val: string) => boolean;
|
|
7
|
+
};
|
|
8
|
+
disabled: BooleanConstructor;
|
|
9
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
10
|
+
click: (...args: any[]) => void;
|
|
11
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
12
|
+
type: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
validator: (val: string) => boolean;
|
|
16
|
+
};
|
|
17
|
+
disabled: BooleanConstructor;
|
|
18
|
+
}>> & Readonly<{
|
|
19
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
type: string;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, {
|
|
24
|
+
default?(_: {}): any;
|
|
25
|
+
}>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent as a, openBlock as s, createElementBlock as l, normalizeClass as c, withModifiers as d, renderSlot as u } from "vue";
|
|
2
|
+
const f = /* @__PURE__ */ a({
|
|
3
|
+
name: "TextButton",
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
type: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: "primary",
|
|
9
|
+
validator: (e) => [
|
|
10
|
+
"default",
|
|
11
|
+
"primary",
|
|
12
|
+
"success",
|
|
13
|
+
"warning",
|
|
14
|
+
"info",
|
|
15
|
+
"danger"
|
|
16
|
+
].includes(e)
|
|
17
|
+
},
|
|
18
|
+
disabled: Boolean
|
|
19
|
+
},
|
|
20
|
+
emits: ["click"],
|
|
21
|
+
setup(e, { emit: n }) {
|
|
22
|
+
const i = e, o = n;
|
|
23
|
+
function r(t) {
|
|
24
|
+
i.disabled || o("click", t);
|
|
25
|
+
}
|
|
26
|
+
return (t, m) => (s(), l("div", {
|
|
27
|
+
class: c(["text-button", [
|
|
28
|
+
`text-button-${e.type}`,
|
|
29
|
+
e.disabled && "is-disabled"
|
|
30
|
+
]]),
|
|
31
|
+
onClick: d(r, ["prevent", "stop"])
|
|
32
|
+
}, [
|
|
33
|
+
u(t.$slots, "default")
|
|
34
|
+
], 2));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
f as default
|
|
39
|
+
};
|