@qy_better_lib/pc 0.2.7 → 0.2.9
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/@qy_better_lib/pc.min.js +1 -1
- package/lib/contextMenu/index.d.ts +0 -1
- package/lib/contextMenu/src/index.vue.d.ts +18 -7
- package/lib/contextMenu/src/index.vue.js +21 -23
- package/lib/describeView/index.d.ts +0 -1
- package/lib/describeView/src/index.vue.d.ts +17 -10
- package/lib/describeView/src/index.vue.js +15 -15
- package/lib/index.d.ts +0 -1
- package/lib/tableExtend/index.d.ts +0 -1
- package/lib/tableExtend/props.d.ts +7 -3
- package/lib/tableExtend/props.js +5 -0
- package/lib/tableExtend/src/colVisible.vue.js +41 -41
- package/lib/tableExtend/src/index.vue.d.ts +45 -18
- package/lib/tableExtend/src/index.vue.js +85 -76
- package/lib/tableExtend/src/valueCol.vue.d.ts +1 -1
- package/lib/tableExtend/src/valueCol.vue.js +4 -4
- package/lib/tableExtend/type.d.ts +0 -1
- package/lib/tableExtend/useTable.d.ts +2 -3
- package/lib/tableExtend/useTable.js +45 -53
- package/lib/textButton/index.d.ts +0 -1
- package/lib/textButton/src/index.vue.d.ts +12 -4
- package/lib/textButton/src/index.vue.js +5 -5
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +30 -30
- package/package.json +10 -10
|
@@ -1,8 +1,33 @@
|
|
|
1
|
+
import { TableColumn, TableAttr } from './../type';
|
|
1
2
|
import { DefineComponent, ExtractPropTypes, PropType, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
-
import { TableAttr, TableColumn } from './../type';
|
|
3
3
|
declare function clearSelection(): void;
|
|
4
4
|
declare function toggleRowSelection(row: any): void;
|
|
5
|
-
declare
|
|
5
|
+
declare function __VLS_template(): {
|
|
6
|
+
attrs: Partial<{}>;
|
|
7
|
+
slots: Partial<Record<`col_${string}`, (_: {
|
|
8
|
+
index: any;
|
|
9
|
+
data: any;
|
|
10
|
+
}) => any>> & Partial<Record<`header_${string}`, (_: {
|
|
11
|
+
data: TableColumn;
|
|
12
|
+
}) => any>> & {
|
|
13
|
+
'tool-left'?(_: {}): any;
|
|
14
|
+
'tool-right'?(_: {}): any;
|
|
15
|
+
expand?(_: {
|
|
16
|
+
index: any;
|
|
17
|
+
data: any;
|
|
18
|
+
}): any;
|
|
19
|
+
operatColumn?(_: {}): any;
|
|
20
|
+
empty?(_: {}): any;
|
|
21
|
+
'bottom-left'?(_: {}): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {
|
|
24
|
+
tableExtendRef: HTMLDivElement;
|
|
25
|
+
tableRef: unknown;
|
|
26
|
+
};
|
|
27
|
+
rootEl: HTMLDivElement;
|
|
28
|
+
};
|
|
29
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
30
|
+
declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
6
31
|
options: {
|
|
7
32
|
type: PropType<TableAttr>;
|
|
8
33
|
default: () => {};
|
|
@@ -12,10 +37,14 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropType
|
|
|
12
37
|
default: never[];
|
|
13
38
|
};
|
|
14
39
|
tableColums: {
|
|
15
|
-
type: PropType< TableColumn
|
|
40
|
+
type: PropType<Array< TableColumn>>;
|
|
16
41
|
default: () => never[];
|
|
17
42
|
};
|
|
18
43
|
tableLoading: BooleanConstructor;
|
|
44
|
+
expand: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: () => boolean;
|
|
47
|
+
};
|
|
19
48
|
selectionCol: {
|
|
20
49
|
type: BooleanConstructor;
|
|
21
50
|
default: () => boolean;
|
|
@@ -36,7 +65,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropType
|
|
|
36
65
|
};
|
|
37
66
|
total: NumberConstructor;
|
|
38
67
|
sizeList: {
|
|
39
|
-
type: PropType<number
|
|
68
|
+
type: PropType<Array<number>>;
|
|
40
69
|
default: () => number[];
|
|
41
70
|
};
|
|
42
71
|
autoHeight: {
|
|
@@ -68,10 +97,14 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropType
|
|
|
68
97
|
default: never[];
|
|
69
98
|
};
|
|
70
99
|
tableColums: {
|
|
71
|
-
type: PropType< TableColumn
|
|
100
|
+
type: PropType<Array< TableColumn>>;
|
|
72
101
|
default: () => never[];
|
|
73
102
|
};
|
|
74
103
|
tableLoading: BooleanConstructor;
|
|
104
|
+
expand: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: () => boolean;
|
|
107
|
+
};
|
|
75
108
|
selectionCol: {
|
|
76
109
|
type: BooleanConstructor;
|
|
77
110
|
default: () => boolean;
|
|
@@ -92,7 +125,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropType
|
|
|
92
125
|
};
|
|
93
126
|
total: NumberConstructor;
|
|
94
127
|
sizeList: {
|
|
95
|
-
type: PropType<number
|
|
128
|
+
type: PropType<Array<number>>;
|
|
96
129
|
default: () => number[];
|
|
97
130
|
};
|
|
98
131
|
autoHeight: {
|
|
@@ -115,24 +148,18 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropType
|
|
|
115
148
|
options: TableAttr;
|
|
116
149
|
tableData: unknown[];
|
|
117
150
|
tableLoading: boolean;
|
|
151
|
+
expand: boolean;
|
|
118
152
|
selectionCol: boolean;
|
|
119
153
|
indexCol: boolean;
|
|
120
154
|
isSetColumn: boolean;
|
|
121
155
|
sizeList: number[];
|
|
122
156
|
autoHeight: boolean;
|
|
123
157
|
autoPagination: boolean;
|
|
124
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
}) => any>> & {
|
|
130
|
-
"tool-left"?(_: {}): any;
|
|
131
|
-
"tool-right"?(_: {}): any;
|
|
132
|
-
operatColumn?(_: {}): any;
|
|
133
|
-
empty?(_: {}): any;
|
|
134
|
-
"bottom-left"?(_: {}): any;
|
|
135
|
-
}>;
|
|
158
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
159
|
+
tableExtendRef: HTMLDivElement;
|
|
160
|
+
tableRef: unknown;
|
|
161
|
+
}, HTMLDivElement>;
|
|
162
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
136
163
|
export default _default;
|
|
137
164
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
138
165
|
new (): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as G, provide as J, toRef as K, ref as S, watch as
|
|
1
|
+
import { defineComponent as G, provide as J, toRef as K, ref as S, watch as y, onMounted as Q, nextTick as W, resolveComponent as C, resolveDirective as X, createElementBlock as u, openBlock as o, createCommentVNode as n, withDirectives as Y, unref as l, createElementVNode as m, renderSlot as a, createBlock as r, mergeProps as h, withCtx as f, Fragment as $, renderList as Z, createTextVNode as ee, toDisplayString as te, createVNode as z } from "vue";
|
|
2
2
|
import { useI18n as oe } from "vue-i18n";
|
|
3
3
|
import le from "../useTable.js";
|
|
4
4
|
import ne from "../props.js";
|
|
@@ -7,13 +7,13 @@ import re from "./colVisible.vue.js";
|
|
|
7
7
|
const se = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "tool-panel"
|
|
10
|
-
}, ie = { class: "left-panel" },
|
|
10
|
+
}, ie = { class: "left-panel" }, de = { class: "right-panel" }, pe = { class: "default-tool" }, ce = ["innerHTML"], ue = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "required-ident"
|
|
13
13
|
}, fe = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "table-bottom"
|
|
16
|
-
}, ge = { class: "left" },
|
|
16
|
+
}, ge = { class: "left" }, Se = /* @__PURE__ */ G({
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: { ...ne() },
|
|
19
19
|
emits: [
|
|
@@ -24,54 +24,53 @@ const se = {
|
|
|
24
24
|
"rowClick",
|
|
25
25
|
"rowDblClick"
|
|
26
26
|
],
|
|
27
|
-
setup(R, { expose: T, emit:
|
|
28
|
-
const
|
|
29
|
-
selectionOptions:
|
|
30
|
-
tableAttribute:
|
|
31
|
-
pagination:
|
|
32
|
-
hasPagination:
|
|
27
|
+
setup(R, { expose: T, emit: x }) {
|
|
28
|
+
const s = R, p = x, { t: D } = oe(), {
|
|
29
|
+
selectionOptions: v,
|
|
30
|
+
tableAttribute: P,
|
|
31
|
+
pagination: i,
|
|
32
|
+
hasPagination: w,
|
|
33
33
|
columnConfig: _,
|
|
34
34
|
colSettingList: I,
|
|
35
35
|
showToolPanel: L,
|
|
36
|
-
showBottomPanel: N
|
|
37
|
-
|
|
38
|
-
} = le(P);
|
|
36
|
+
showBottomPanel: N
|
|
37
|
+
} = le(D);
|
|
39
38
|
J("table-extend", {
|
|
40
|
-
tableProps:
|
|
41
|
-
tableColums: K(
|
|
39
|
+
tableProps: s,
|
|
40
|
+
tableColums: K(s, "tableColums"),
|
|
42
41
|
columnConfig: _
|
|
43
42
|
});
|
|
44
|
-
const B = S(),
|
|
45
|
-
|
|
46
|
-
() =>
|
|
43
|
+
const B = S(), c = S(null), k = S(!1);
|
|
44
|
+
y(
|
|
45
|
+
() => s.tableColums,
|
|
47
46
|
() => {
|
|
48
|
-
_.showColumn =
|
|
47
|
+
_.showColumn = s.tableColums;
|
|
49
48
|
}
|
|
50
|
-
),
|
|
51
|
-
() =>
|
|
49
|
+
), y(
|
|
50
|
+
() => i.pageIndex,
|
|
52
51
|
(e) => {
|
|
53
52
|
if (e && e > 0) {
|
|
54
53
|
if (k.value) {
|
|
55
54
|
k.value = !1;
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
|
-
p("currentChange", e),
|
|
57
|
+
p("currentChange", e), c.value.setScrollTop(0);
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
|
-
),
|
|
62
|
-
() =>
|
|
60
|
+
), y(
|
|
61
|
+
() => i.pageSize,
|
|
63
62
|
(e) => {
|
|
64
|
-
e && e > 0 && (k.value = !0,
|
|
63
|
+
e && e > 0 && (k.value = !0, i.pageIndex = 1, p("pageSizeChange", e), c.value.setScrollTop(0));
|
|
65
64
|
}
|
|
66
65
|
), Q(() => {
|
|
67
66
|
W(() => {
|
|
68
|
-
|
|
67
|
+
s.tableColums && s.tableColums.length > 0 && (_.showColumn = s.tableColums);
|
|
69
68
|
}).then(() => {
|
|
70
69
|
});
|
|
71
70
|
}), T({
|
|
72
71
|
clearSelection: q,
|
|
73
72
|
toggleRowSelection: U,
|
|
74
|
-
table:
|
|
73
|
+
table: c
|
|
75
74
|
});
|
|
76
75
|
function E(e) {
|
|
77
76
|
p("tableSort", {
|
|
@@ -80,7 +79,7 @@ const se = {
|
|
|
80
79
|
});
|
|
81
80
|
}
|
|
82
81
|
function V(e) {
|
|
83
|
-
|
|
82
|
+
v.rows = e, v.count = e && e.length, p("handleSelectionChange", e);
|
|
84
83
|
}
|
|
85
84
|
function H(e) {
|
|
86
85
|
p("rowClick", e);
|
|
@@ -89,120 +88,130 @@ const se = {
|
|
|
89
88
|
p("rowDblClick", e);
|
|
90
89
|
}
|
|
91
90
|
function q() {
|
|
92
|
-
|
|
93
|
-
(e = d.value) == null || e.clearSelection();
|
|
91
|
+
c.value?.clearSelection();
|
|
94
92
|
}
|
|
95
93
|
function U(e) {
|
|
96
|
-
|
|
97
|
-
(r = d.value) == null || r.toggleRowSelection(e);
|
|
94
|
+
c.value?.toggleRowSelection(e);
|
|
98
95
|
}
|
|
99
|
-
return (e,
|
|
100
|
-
const
|
|
96
|
+
return (e, b) => {
|
|
97
|
+
const g = C("el-table-column"), j = C("el-empty"), A = C("el-table"), F = C("el-pagination"), O = X("loading");
|
|
101
98
|
return o(), u("div", {
|
|
102
99
|
class: "table-extend",
|
|
103
100
|
ref_key: "tableExtendRef",
|
|
104
101
|
ref: B
|
|
105
102
|
}, [
|
|
106
103
|
l(L) ? (o(), u("div", se, [
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
m("div", ie, [
|
|
105
|
+
a(e.$slots, "tool-left")
|
|
109
106
|
]),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
e.isSetColumn ? (o(),
|
|
107
|
+
m("div", de, [
|
|
108
|
+
a(e.$slots, "tool-right"),
|
|
109
|
+
m("div", pe, [
|
|
110
|
+
e.isSetColumn ? (o(), r(re, { key: 0 })) : n("", !0)
|
|
114
111
|
])
|
|
115
112
|
])
|
|
116
|
-
])) :
|
|
117
|
-
Y((o(),
|
|
113
|
+
])) : n("", !0),
|
|
114
|
+
Y((o(), r(A, h({
|
|
118
115
|
ref_key: "tableRef",
|
|
119
|
-
ref:
|
|
120
|
-
}, l(
|
|
116
|
+
ref: c
|
|
117
|
+
}, l(P), {
|
|
121
118
|
data: e.tableData,
|
|
122
119
|
onSortChange: E,
|
|
123
120
|
onSelectionChange: V,
|
|
124
121
|
onRowClick: H,
|
|
125
122
|
onRowDblclick: M
|
|
126
123
|
}), {
|
|
127
|
-
empty:
|
|
128
|
-
|
|
124
|
+
empty: f(() => [
|
|
125
|
+
a(e.$slots, "empty", {}, () => [
|
|
129
126
|
z(j, { "image-size": 60 })
|
|
130
127
|
])
|
|
131
128
|
]),
|
|
132
|
-
default:
|
|
133
|
-
e.selectionCol ? (o(),
|
|
129
|
+
default: f(() => [
|
|
130
|
+
e.selectionCol ? (o(), r(g, {
|
|
134
131
|
key: 0,
|
|
135
132
|
type: "selection",
|
|
136
133
|
width: 48,
|
|
137
134
|
fixed: "left"
|
|
138
|
-
})) :
|
|
139
|
-
e.indexCol ? (o(),
|
|
135
|
+
})) : n("", !0),
|
|
136
|
+
e.indexCol ? (o(), r(g, {
|
|
140
137
|
key: 1,
|
|
141
138
|
type: "index",
|
|
142
139
|
label: "序号",
|
|
143
140
|
width: 58,
|
|
144
141
|
fixed: "left"
|
|
145
|
-
})) :
|
|
142
|
+
})) : n("", !0),
|
|
143
|
+
e.expand ? (o(), r(g, {
|
|
144
|
+
key: 2,
|
|
145
|
+
type: "expand"
|
|
146
|
+
}, {
|
|
147
|
+
default: f(({ row: t, $index: d }) => [
|
|
148
|
+
a(e.$slots, "expand", {
|
|
149
|
+
index: d,
|
|
150
|
+
data: t
|
|
151
|
+
})
|
|
152
|
+
]),
|
|
153
|
+
_: 3
|
|
154
|
+
})) : n("", !0),
|
|
146
155
|
(o(!0), u($, null, Z(l(I), (t) => (o(), u($, {
|
|
147
156
|
key: t.prop
|
|
148
157
|
}, [
|
|
149
|
-
t.isHtml ? (o(),
|
|
158
|
+
t.isHtml ? (o(), r(g, h({
|
|
150
159
|
key: 0,
|
|
151
160
|
ref_for: !0
|
|
152
161
|
}, t), {
|
|
153
|
-
default:
|
|
154
|
-
|
|
155
|
-
innerHTML: t.prop &&
|
|
156
|
-
}, null, 8,
|
|
162
|
+
default: f((d) => [
|
|
163
|
+
m("div", {
|
|
164
|
+
innerHTML: t.prop && d.row[t.prop]
|
|
165
|
+
}, null, 8, ce)
|
|
157
166
|
]),
|
|
158
167
|
_: 2
|
|
159
|
-
}, 1040)) : (o(),
|
|
168
|
+
}, 1040)) : (o(), r(g, h({
|
|
160
169
|
key: 1,
|
|
161
170
|
ref_for: !0
|
|
162
171
|
}, t), {
|
|
163
|
-
default:
|
|
164
|
-
|
|
165
|
-
index:
|
|
166
|
-
data:
|
|
172
|
+
default: f((d) => [
|
|
173
|
+
a(e.$slots, `col_${t.prop}`, {
|
|
174
|
+
index: d.$index,
|
|
175
|
+
data: d.row
|
|
167
176
|
}, () => [
|
|
168
|
-
z(ae, h({ ref_for: !0 }, { row:
|
|
177
|
+
z(ae, h({ ref_for: !0 }, { row: d.row, colCfg: t }), null, 16)
|
|
169
178
|
])
|
|
170
179
|
]),
|
|
171
|
-
header:
|
|
172
|
-
|
|
173
|
-
t.required ? (o(), u("span", ue, "*")) :
|
|
180
|
+
header: f(() => [
|
|
181
|
+
a(e.$slots, `header_${t.prop}`, { data: t }, () => [
|
|
182
|
+
t.required ? (o(), u("span", ue, "*")) : n("", !0),
|
|
174
183
|
ee(" " + te(t.label), 1)
|
|
175
184
|
])
|
|
176
185
|
]),
|
|
177
186
|
_: 2
|
|
178
187
|
}, 1040))
|
|
179
188
|
], 64))), 128)),
|
|
180
|
-
|
|
189
|
+
a(e.$slots, "operatColumn")
|
|
181
190
|
]),
|
|
182
191
|
_: 3
|
|
183
192
|
}, 16, ["data"])), [
|
|
184
193
|
[O, e.tableLoading]
|
|
185
194
|
]),
|
|
186
|
-
l(N) || l(
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
l(N) || l(w) ? (o(), u("div", fe, [
|
|
196
|
+
m("div", ge, [
|
|
197
|
+
a(e.$slots, "bottom-left")
|
|
189
198
|
]),
|
|
190
|
-
l(
|
|
199
|
+
l(w) ? (o(), r(F, {
|
|
191
200
|
key: 0,
|
|
192
|
-
"current-page": l(
|
|
193
|
-
"onUpdate:currentPage":
|
|
194
|
-
"page-size": l(
|
|
195
|
-
"onUpdate:pageSize":
|
|
201
|
+
"current-page": l(i).pageIndex,
|
|
202
|
+
"onUpdate:currentPage": b[0] || (b[0] = (t) => l(i).pageIndex = t),
|
|
203
|
+
"page-size": l(i).pageSize,
|
|
204
|
+
"onUpdate:pageSize": b[1] || (b[1] = (t) => l(i).pageSize = t),
|
|
196
205
|
"page-sizes": e.sizeList,
|
|
197
206
|
layout: "total,prev,pager,next,sizes,jumper",
|
|
198
207
|
total: e.total,
|
|
199
208
|
background: ""
|
|
200
|
-
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) :
|
|
201
|
-
])) :
|
|
209
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) : n("", !0)
|
|
210
|
+
])) : n("", !0)
|
|
202
211
|
], 512);
|
|
203
212
|
};
|
|
204
213
|
}
|
|
205
214
|
});
|
|
206
215
|
export {
|
|
207
|
-
|
|
216
|
+
Se as default
|
|
208
217
|
};
|
|
@@ -20,5 +20,5 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
20
20
|
}>> & Readonly<{}>, {
|
|
21
21
|
row: Record<string, any>;
|
|
22
22
|
colCfg: Record<string, any>;
|
|
23
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {},
|
|
23
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLSpanElement>;
|
|
24
24
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as l, computed as p,
|
|
1
|
+
import { defineComponent as l, computed as p, createElementBlock as r, openBlock as a, toDisplayString as u } from "vue";
|
|
2
2
|
const f = /* @__PURE__ */ l({
|
|
3
3
|
__name: "valueCol",
|
|
4
4
|
props: {
|
|
@@ -15,10 +15,10 @@ const f = /* @__PURE__ */ l({
|
|
|
15
15
|
},
|
|
16
16
|
setup(n) {
|
|
17
17
|
const c = n, e = p(() => {
|
|
18
|
-
const { row:
|
|
19
|
-
return t
|
|
18
|
+
const { row: o, colCfg: t } = c;
|
|
19
|
+
return o[t.prop];
|
|
20
20
|
});
|
|
21
|
-
return (
|
|
21
|
+
return (o, t) => (a(), r("span", null, u(e.value != null ? e.value : "--"), 1));
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
export {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TableColumn, FileType } from './type';
|
|
2
2
|
import { ComputedRef } from 'vue';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* useTable
|
|
6
5
|
*/
|
|
@@ -28,7 +27,7 @@ export default function useTable(i18nInstance?: (key: string) => string): {
|
|
|
28
27
|
init?: boolean | undefined;
|
|
29
28
|
width?: number | undefined;
|
|
30
29
|
minWidth?: number | undefined;
|
|
31
|
-
showOverflowTooltip?: boolean | Record<string, any> | undefined;
|
|
30
|
+
showOverflowTooltip?: (boolean | Record<string, any>) | undefined;
|
|
32
31
|
sortable?: boolean | undefined;
|
|
33
32
|
fixed?: "left" | "right" | undefined;
|
|
34
33
|
fileType?: FileType | undefined;
|
|
@@ -44,7 +43,7 @@ export default function useTable(i18nInstance?: (key: string) => string): {
|
|
|
44
43
|
init?: boolean | undefined;
|
|
45
44
|
width?: number | undefined;
|
|
46
45
|
minWidth?: number | undefined;
|
|
47
|
-
showOverflowTooltip?: boolean | Record<string, any> | undefined;
|
|
46
|
+
showOverflowTooltip?: (boolean | Record<string, any>) | undefined;
|
|
48
47
|
sortable?: boolean | undefined;
|
|
49
48
|
fixed?: "left" | "right" | undefined;
|
|
50
49
|
fileType?: FileType | undefined;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import { FileType as
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
const i = L(), t = i == null ? void 0 : i.props, C = {
|
|
1
|
+
import { getCurrentInstance as T, computed as n, reactive as r, toRef as p } from "vue";
|
|
2
|
+
import { FileType as I } from "./type.js";
|
|
3
|
+
function P(g) {
|
|
4
|
+
const l = T(), e = l?.props, h = {
|
|
6
5
|
rowKey: "id",
|
|
7
6
|
"element-loading-text": "加载中…",
|
|
8
7
|
"element-loading-background": "rgba(0, 0, 0, 0.2)",
|
|
9
8
|
highlightCurrentRow: !0,
|
|
10
9
|
stripe: !0,
|
|
11
10
|
border: !1
|
|
12
|
-
},
|
|
11
|
+
}, u = {
|
|
13
12
|
headerAlign: void 0,
|
|
14
13
|
align: void 0,
|
|
15
14
|
prop: void 0,
|
|
@@ -19,74 +18,67 @@ function R(u) {
|
|
|
19
18
|
showOverflowTooltip: !1,
|
|
20
19
|
sortable: void 0,
|
|
21
20
|
fixed: void 0
|
|
22
|
-
},
|
|
23
|
-
...
|
|
24
|
-
...Object.keys(
|
|
25
|
-
})),
|
|
21
|
+
}, f = n(() => ({
|
|
22
|
+
...h,
|
|
23
|
+
...Object.keys(e.options).length > 0 ? e.options : {}
|
|
24
|
+
})), w = r({
|
|
26
25
|
count: 0,
|
|
27
26
|
rows: []
|
|
28
|
-
}),
|
|
29
|
-
pageIndex:
|
|
30
|
-
pageSize:
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}), S = g({
|
|
27
|
+
}), d = r({
|
|
28
|
+
pageIndex: e?.paging?.pageIndex ? p(e.paging, "pageIndex") : 1,
|
|
29
|
+
pageSize: e?.paging?.pageSize ? p(e.paging, "pageSize") : 10
|
|
30
|
+
}), b = n(() => {
|
|
31
|
+
const o = e?.paging?.pageIndex > 0 && e?.paging?.pageSize > 0;
|
|
32
|
+
if (!e.autoPagination)
|
|
33
|
+
return o;
|
|
34
|
+
const t = e.tableData.length > (e.total || 0) ? e.tableData.length : e.total || 0;
|
|
35
|
+
return o && t > d.pageSize;
|
|
36
|
+
}), m = r({
|
|
39
37
|
/**是否显示 */
|
|
40
38
|
show: !1,
|
|
41
39
|
/**图片路径 */
|
|
42
40
|
filePathList: [],
|
|
43
41
|
/**显示图片的索引 */
|
|
44
42
|
index: 0
|
|
45
|
-
}),
|
|
43
|
+
}), a = r({
|
|
46
44
|
showColumn: [],
|
|
47
45
|
hiddenColumn: []
|
|
48
|
-
}),
|
|
46
|
+
}), c = n(() => !a.showColumn || a.showColumn.length === 0 ? [
|
|
49
47
|
{
|
|
50
48
|
prop: "default-prop",
|
|
51
49
|
init: !0,
|
|
52
50
|
label: ""
|
|
53
51
|
}
|
|
54
|
-
] :
|
|
55
|
-
if (
|
|
56
|
-
const { baseW:
|
|
57
|
-
|
|
52
|
+
] : a.showColumn.map((t) => {
|
|
53
|
+
if (g && t.langue && (t.label = g(t.langue)), t.autoW) {
|
|
54
|
+
const { baseW: i = 1920 } = t;
|
|
55
|
+
t.width ? t.width = s(t.width || 0, i) : t.minWidth && (t.minWidth = s(t.minWidth || 0, i));
|
|
58
56
|
}
|
|
59
|
-
return { ...
|
|
60
|
-
})),
|
|
61
|
-
|
|
62
|
-
return (((o = (e = i == null ? void 0 : (n = i.slots)["tool-left"]) == null ? void 0 : e.call(n)) == null ? void 0 : o.length) || 0) > 0 || (((b = (w = i == null ? void 0 : (l = i.slots)["tool-right"]) == null ? void 0 : w.call(l)) == null ? void 0 : b.length) || 0) > 0;
|
|
63
|
-
}), P = a(() => {
|
|
64
|
-
var n, e, o;
|
|
65
|
-
return (((o = (e = i == null ? void 0 : (n = i.slots)["tool-left"]) == null ? void 0 : e.call(n)) == null ? void 0 : o.length) || 0) > 0;
|
|
66
|
-
}), z = a(() => f.value.some(
|
|
67
|
-
(n) => n.fileType && n.fileType == v.PICTURE
|
|
57
|
+
return { ...u, ...t };
|
|
58
|
+
})), v = n(() => (l?.slots["tool-left"]?.()?.length || 0) > 0 || (l?.slots["tool-right"]?.()?.length || 0) > 0), C = n(() => (l?.slots["tool-left"]?.()?.length || 0) > 0), x = n(() => c.value.some(
|
|
59
|
+
(o) => o.fileType && o.fileType == I.PICTURE
|
|
68
60
|
));
|
|
69
|
-
function s(
|
|
70
|
-
let
|
|
71
|
-
if (!
|
|
72
|
-
let
|
|
73
|
-
return Number((
|
|
61
|
+
function s(o, t = 1920) {
|
|
62
|
+
let i = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
|
63
|
+
if (!i) return o;
|
|
64
|
+
let W = i / t;
|
|
65
|
+
return Number((o * W).toFixed(3));
|
|
74
66
|
}
|
|
75
67
|
return {
|
|
76
|
-
defColSetting:
|
|
77
|
-
selectionOptions:
|
|
78
|
-
tableAttribute:
|
|
79
|
-
pagination:
|
|
80
|
-
hasPagination:
|
|
81
|
-
imageViewer:
|
|
82
|
-
columnConfig:
|
|
83
|
-
colSettingList:
|
|
84
|
-
showToolPanel:
|
|
85
|
-
showBottomPanel:
|
|
86
|
-
hasImageViewer:
|
|
68
|
+
defColSetting: u,
|
|
69
|
+
selectionOptions: w,
|
|
70
|
+
tableAttribute: f,
|
|
71
|
+
pagination: d,
|
|
72
|
+
hasPagination: b,
|
|
73
|
+
imageViewer: m,
|
|
74
|
+
columnConfig: a,
|
|
75
|
+
colSettingList: c,
|
|
76
|
+
showToolPanel: v,
|
|
77
|
+
showBottomPanel: C,
|
|
78
|
+
hasImageViewer: x,
|
|
87
79
|
auto_size: s
|
|
88
80
|
};
|
|
89
81
|
}
|
|
90
82
|
export {
|
|
91
|
-
|
|
83
|
+
P as default
|
|
92
84
|
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
-
declare
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
3
12
|
type: {
|
|
4
13
|
type: StringConstructor;
|
|
5
14
|
default: string;
|
|
@@ -22,9 +31,8 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<ExtractPropType
|
|
|
22
31
|
}>, {
|
|
23
32
|
type: string;
|
|
24
33
|
disabled: boolean;
|
|
25
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {},
|
|
26
|
-
|
|
27
|
-
}>;
|
|
34
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
36
|
export default _default;
|
|
29
37
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
38
|
new (): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as s, resolveComponent as d,
|
|
1
|
+
import { defineComponent as s, resolveComponent as d, createElementBlock as m, openBlock as o, normalizeClass as u, createBlock as i, createCommentVNode as p, createElementVNode as f, withCtx as b, resolveDynamicComponent as k, withModifiers as x, renderSlot as C } from "vue";
|
|
2
2
|
const B = /* @__PURE__ */ s({
|
|
3
3
|
name: "TextButton",
|
|
4
4
|
__name: "index",
|
|
@@ -36,12 +36,12 @@ const B = /* @__PURE__ */ s({
|
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "text-button-icon"
|
|
38
38
|
}, {
|
|
39
|
-
default:
|
|
40
|
-
(o(), i(
|
|
39
|
+
default: b(() => [
|
|
40
|
+
(o(), i(k(t.icon)))
|
|
41
41
|
]),
|
|
42
42
|
_: 1
|
|
43
|
-
})) :
|
|
44
|
-
|
|
43
|
+
})) : p("", !0),
|
|
44
|
+
f("div", {
|
|
45
45
|
class: "text-button-inner",
|
|
46
46
|
onClick: x(l, ["prevent"])
|
|
47
47
|
}, [
|