geekin-devtoys 0.4.2 → 0.5.0
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/GDropdown/index.js +1 -1
- package/lib/GDropdown/index.mjs +210 -186
- package/lib/GDropdown/style.css +1 -1
- package/lib/GPagination/index.js +1 -0
- package/lib/GPagination/index.mjs +208 -0
- package/lib/GPagination.d.ts +1 -0
- package/lib/GTable/index.js +1 -1
- package/lib/GTable/index.mjs +279 -420
- package/lib/GTable/style.css +1 -1
- package/lib/assets/GPagination.css +1 -0
- package/lib/components/GDropdown/__tests__/index.test.d.ts +1 -0
- package/lib/components/GDropdown/__tests__/slots.tmp.test.d.ts +1 -0
- package/lib/components/GDropdown/index.d.ts +32 -6
- package/lib/components/GPagination/__tests__/index.test.d.ts +1 -0
- package/lib/components/GPagination/icons.d.ts +7 -0
- package/lib/components/GPagination/index.d.ts +30 -0
- package/lib/components/GPagination/types.d.ts +66 -0
- package/lib/components/GProgress/index.d.ts +1 -1
- package/lib/components/GRadio/index.d.ts +1 -1
- package/lib/components/GRing/index.d.ts +1 -1
- package/lib/components/GSegment/index.d.ts +3 -3
- package/lib/components/GSlider/index.d.ts +2 -2
- package/lib/components/GTable/__tests__/index.test.d.ts +1 -0
- package/lib/components/GTable/icons.d.ts +5 -0
- package/lib/components/GTable/index.d.ts +35 -18
- package/lib/components/GTable/types.d.ts +23 -0
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +35 -32
- package/lib/index/style.css +2 -2
- package/lib/index.d.ts +3 -1
- package/package.json +14 -7
package/lib/GTable/index.mjs
CHANGED
|
@@ -1,237 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
b("path", {
|
|
27
|
-
fill: "currentColor",
|
|
28
|
-
d: "M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64z"
|
|
29
|
-
})
|
|
30
|
-
]));
|
|
31
|
-
}
|
|
32
|
-
}), Q = K, X = {
|
|
33
|
-
name: "zh-cn",
|
|
34
|
-
el: {
|
|
35
|
-
breadcrumb: {
|
|
36
|
-
label: "面包屑"
|
|
37
|
-
},
|
|
38
|
-
colorpicker: {
|
|
39
|
-
confirm: "确定",
|
|
40
|
-
clear: "清空",
|
|
41
|
-
defaultLabel: "颜色选择器",
|
|
42
|
-
description: "当前颜色 {color},按 Enter 键选择新颜色",
|
|
43
|
-
alphaLabel: "选择透明度的值",
|
|
44
|
-
alphaDescription: "透明度 {alpha}, 当前颜色 {color}",
|
|
45
|
-
hueLabel: "选择色相值",
|
|
46
|
-
hueDescription: "色相 {hue}, 当前颜色 {color}",
|
|
47
|
-
svLabel: "选择饱和度与明度的值",
|
|
48
|
-
svDescription: "饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",
|
|
49
|
-
predefineDescription: "选择 {value} 作为颜色"
|
|
50
|
-
},
|
|
51
|
-
datepicker: {
|
|
52
|
-
now: "此刻",
|
|
53
|
-
today: "今天",
|
|
54
|
-
cancel: "取消",
|
|
55
|
-
clear: "清空",
|
|
56
|
-
confirm: "确定",
|
|
57
|
-
dateTablePrompt: "使用方向键与 Enter 键可选择日期",
|
|
58
|
-
monthTablePrompt: "使用方向键与 Enter 键可选择月份",
|
|
59
|
-
yearTablePrompt: "使用方向键与 Enter 键可选择年份",
|
|
60
|
-
selectedDate: "已选日期",
|
|
61
|
-
selectDate: "选择日期",
|
|
62
|
-
selectTime: "选择时间",
|
|
63
|
-
startDate: "开始日期",
|
|
64
|
-
startTime: "开始时间",
|
|
65
|
-
endDate: "结束日期",
|
|
66
|
-
endTime: "结束时间",
|
|
67
|
-
prevYear: "前一年",
|
|
68
|
-
nextYear: "后一年",
|
|
69
|
-
prevMonth: "上个月",
|
|
70
|
-
nextMonth: "下个月",
|
|
71
|
-
year: "年",
|
|
72
|
-
month1: "1 月",
|
|
73
|
-
month2: "2 月",
|
|
74
|
-
month3: "3 月",
|
|
75
|
-
month4: "4 月",
|
|
76
|
-
month5: "5 月",
|
|
77
|
-
month6: "6 月",
|
|
78
|
-
month7: "7 月",
|
|
79
|
-
month8: "8 月",
|
|
80
|
-
month9: "9 月",
|
|
81
|
-
month10: "10 月",
|
|
82
|
-
month11: "11 月",
|
|
83
|
-
month12: "12 月",
|
|
84
|
-
weeks: {
|
|
85
|
-
sun: "日",
|
|
86
|
-
mon: "一",
|
|
87
|
-
tue: "二",
|
|
88
|
-
wed: "三",
|
|
89
|
-
thu: "四",
|
|
90
|
-
fri: "五",
|
|
91
|
-
sat: "六"
|
|
92
|
-
},
|
|
93
|
-
weeksFull: {
|
|
94
|
-
sun: "星期日",
|
|
95
|
-
mon: "星期一",
|
|
96
|
-
tue: "星期二",
|
|
97
|
-
wed: "星期三",
|
|
98
|
-
thu: "星期四",
|
|
99
|
-
fri: "星期五",
|
|
100
|
-
sat: "星期六"
|
|
101
|
-
},
|
|
102
|
-
months: {
|
|
103
|
-
jan: "一月",
|
|
104
|
-
feb: "二月",
|
|
105
|
-
mar: "三月",
|
|
106
|
-
apr: "四月",
|
|
107
|
-
may: "五月",
|
|
108
|
-
jun: "六月",
|
|
109
|
-
jul: "七月",
|
|
110
|
-
aug: "八月",
|
|
111
|
-
sep: "九月",
|
|
112
|
-
oct: "十月",
|
|
113
|
-
nov: "十一月",
|
|
114
|
-
dec: "十二月"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
inputNumber: {
|
|
118
|
-
decrease: "减少数值",
|
|
119
|
-
increase: "增加数值"
|
|
120
|
-
},
|
|
121
|
-
select: {
|
|
122
|
-
loading: "加载中",
|
|
123
|
-
noMatch: "无匹配数据",
|
|
124
|
-
noData: "无数据",
|
|
125
|
-
placeholder: "请选择"
|
|
126
|
-
},
|
|
127
|
-
mention: {
|
|
128
|
-
loading: "加载中"
|
|
129
|
-
},
|
|
130
|
-
dropdown: {
|
|
131
|
-
toggleDropdown: "切换下拉选项"
|
|
132
|
-
},
|
|
133
|
-
cascader: {
|
|
134
|
-
noMatch: "无匹配数据",
|
|
135
|
-
loading: "加载中",
|
|
136
|
-
placeholder: "请选择",
|
|
137
|
-
noData: "暂无数据"
|
|
138
|
-
},
|
|
139
|
-
pagination: {
|
|
140
|
-
goto: "前往",
|
|
141
|
-
pagesize: "条/页",
|
|
142
|
-
total: "共 {total} 条",
|
|
143
|
-
pageClassifier: "页",
|
|
144
|
-
page: "页",
|
|
145
|
-
prev: "上一页",
|
|
146
|
-
next: "下一页",
|
|
147
|
-
currentPage: "第 {pager} 页",
|
|
148
|
-
prevPages: "向前 {pager} 页",
|
|
149
|
-
nextPages: "向后 {pager} 页",
|
|
150
|
-
deprecationWarning: "你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"
|
|
151
|
-
},
|
|
152
|
-
dialog: {
|
|
153
|
-
close: "关闭此对话框"
|
|
154
|
-
},
|
|
155
|
-
drawer: {
|
|
156
|
-
close: "关闭此对话框"
|
|
157
|
-
},
|
|
158
|
-
messagebox: {
|
|
159
|
-
title: "提示",
|
|
160
|
-
confirm: "确定",
|
|
161
|
-
cancel: "取消",
|
|
162
|
-
error: "输入的数据不合法!",
|
|
163
|
-
close: "关闭此对话框"
|
|
164
|
-
},
|
|
165
|
-
upload: {
|
|
166
|
-
deleteTip: "按 Delete 键可删除",
|
|
167
|
-
delete: "删除",
|
|
168
|
-
preview: "查看图片",
|
|
169
|
-
continue: "继续上传"
|
|
170
|
-
},
|
|
171
|
-
slider: {
|
|
172
|
-
defaultLabel: "滑块介于 {min} 至 {max}",
|
|
173
|
-
defaultRangeStartLabel: "选择起始值",
|
|
174
|
-
defaultRangeEndLabel: "选择结束值"
|
|
175
|
-
},
|
|
176
|
-
table: {
|
|
177
|
-
emptyText: "暂无数据",
|
|
178
|
-
confirmFilter: "筛选",
|
|
179
|
-
resetFilter: "重置",
|
|
180
|
-
clearFilter: "全部",
|
|
181
|
-
sumText: "合计",
|
|
182
|
-
selectAllLabel: "选择所有行",
|
|
183
|
-
selectRowLabel: "选择当前行",
|
|
184
|
-
expandRowLabel: "展开当前行",
|
|
185
|
-
collapseRowLabel: "收起当前行",
|
|
186
|
-
sortLabel: "按 {column} 排序",
|
|
187
|
-
filterLabel: "按 {column} 过滤"
|
|
188
|
-
},
|
|
189
|
-
tag: {
|
|
190
|
-
close: "关闭此标签"
|
|
191
|
-
},
|
|
192
|
-
tour: {
|
|
193
|
-
next: "下一步",
|
|
194
|
-
previous: "上一步",
|
|
195
|
-
finish: "结束导览",
|
|
196
|
-
close: "关闭此对话框"
|
|
197
|
-
},
|
|
198
|
-
tree: {
|
|
199
|
-
emptyText: "暂无数据"
|
|
200
|
-
},
|
|
201
|
-
transfer: {
|
|
202
|
-
noMatch: "无匹配数据",
|
|
203
|
-
noData: "无数据",
|
|
204
|
-
titles: ["列表 1", "列表 2"],
|
|
205
|
-
filterPlaceholder: "请输入搜索内容",
|
|
206
|
-
noCheckedFormat: "共 {total} 项",
|
|
207
|
-
hasCheckedFormat: "已选 {checked}/{total} 项"
|
|
208
|
-
},
|
|
209
|
-
image: {
|
|
210
|
-
error: "加载失败"
|
|
211
|
-
},
|
|
212
|
-
pageHeader: {
|
|
213
|
-
title: "返回"
|
|
214
|
-
},
|
|
215
|
-
popconfirm: {
|
|
216
|
-
confirmButtonText: "确定",
|
|
217
|
-
cancelButtonText: "取消"
|
|
218
|
-
},
|
|
219
|
-
carousel: {
|
|
220
|
-
leftArrow: "上一张幻灯片",
|
|
221
|
-
rightArrow: "下一张幻灯片",
|
|
222
|
-
indicator: "幻灯片切换至索引 {index}"
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
const Z = { class: "g-table" }, uu = {
|
|
1
|
+
import { h as g, defineComponent as ue, useSlots as de, computed as $, ref as T, onMounted as ce, onBeforeUnmount as ge, createElementBlock as n, openBlock as s, createCommentVNode as u, createElementVNode as d, createBlock as A, renderSlot as f, normalizeClass as z, Fragment as y, renderList as C, normalizeStyle as h, createTextVNode as D, toDisplayString as I, unref as W, withModifiers as U, withCtx as E, createVNode as j, Comment as pe } from "vue";
|
|
2
|
+
import fe from "../GDropdown/index.mjs";
|
|
3
|
+
import ye from "../GPagination/index.mjs";
|
|
4
|
+
import { useReducedMotion as he, motion as me } from "motion-v";
|
|
5
|
+
import { _ as ve } from "../GBranched-vnLlYOl9.mjs";
|
|
6
|
+
const q = {
|
|
7
|
+
viewBox: "0 0 1024 1024",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
width: "1em",
|
|
12
|
+
height: "1em"
|
|
13
|
+
}, be = () => g("svg", q, [
|
|
14
|
+
g("circle", { cx: "384", cy: "256", r: "48" }),
|
|
15
|
+
g("circle", { cx: "640", cy: "256", r: "48" }),
|
|
16
|
+
g("circle", { cx: "384", cy: "512", r: "48" }),
|
|
17
|
+
g("circle", { cx: "640", cy: "512", r: "48" }),
|
|
18
|
+
g("circle", { cx: "384", cy: "768", r: "48" }),
|
|
19
|
+
g("circle", { cx: "640", cy: "768", r: "48" })
|
|
20
|
+
]), ke = () => g("svg", q, [
|
|
21
|
+
g("path", {
|
|
22
|
+
d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
|
|
23
|
+
})
|
|
24
|
+
]), Se = { class: "g-table" }, we = {
|
|
227
25
|
key: 0,
|
|
228
26
|
class: "g-table-action"
|
|
229
|
-
},
|
|
27
|
+
}, _e = { class: "g-table-scroll" }, $e = { class: "g-table-inner" }, ze = {
|
|
28
|
+
key: 0,
|
|
29
|
+
style: { width: "65px" }
|
|
30
|
+
}, Ce = {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "g-table-th"
|
|
33
|
+
}, De = { key: 0 }, Ie = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "g-table-td"
|
|
36
|
+
}, Pe = { class: "g-table-cell" }, Le = ["onMousedown"], Me = ["title"], Be = { class: "g-table-cell" }, Te = { class: "g-dropdown-link" }, Ae = ["onClick"], We = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "g-table-empty"
|
|
39
|
+
}, Ee = { key: 1 }, Ke = /* @__PURE__ */ ue({
|
|
230
40
|
name: "GTable",
|
|
231
|
-
inheritAttrs: !1,
|
|
232
41
|
__name: "index",
|
|
233
42
|
props: {
|
|
234
43
|
data: { default: () => [] },
|
|
44
|
+
columns: { default: () => [] },
|
|
45
|
+
rowKey: {},
|
|
235
46
|
pagination: { type: Boolean, default: !1 },
|
|
236
47
|
operationLabel: { default: "操作" },
|
|
237
48
|
operaWidth: { default: 160 },
|
|
@@ -245,204 +56,252 @@ const Z = { class: "g-table" }, uu = {
|
|
|
245
56
|
size: { default: "default" }
|
|
246
57
|
},
|
|
247
58
|
emits: ["update:currentPage", "update:pageSize", "sorted:data"],
|
|
248
|
-
setup(
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
59
|
+
setup(P, { expose: J, emit: Q }) {
|
|
60
|
+
const i = P, k = Q, X = (e) => {
|
|
61
|
+
k("update:pageSize", e);
|
|
62
|
+
}, Y = (e) => {
|
|
63
|
+
k("update:currentPage", e);
|
|
64
|
+
}, N = de(), L = (e) => !!N[e], V = (e, r) => {
|
|
65
|
+
const t = N[e];
|
|
66
|
+
return t ? Z(t(r)) : !1;
|
|
67
|
+
}, Z = (e) => e == null ? !1 : (Array.isArray(e) ? e.flat(1 / 0) : [e]).some((t) => !!t && typeof t == "object" && "type" in t && t.type !== pe), S = $(() => i.columns ?? []), M = (e, r) => e.key ?? e.dataIndex ?? `__col_${r}`, w = $(() => L("operations") || L("more")), G = (e) => typeof e == "number" ? e : parseFloat(e) || 0, x = (e) => {
|
|
68
|
+
const r = e.width ?? e.minWidth;
|
|
69
|
+
if (r != null)
|
|
70
|
+
return { width: typeof r == "number" ? `${r}px` : r };
|
|
71
|
+
}, ee = $(() => {
|
|
72
|
+
const e = S.value, r = {}, t = {};
|
|
73
|
+
let a = 0;
|
|
74
|
+
e.forEach((l, v) => {
|
|
75
|
+
l.fixed === "left" && (r[v] = a);
|
|
76
|
+
const b = l.width ?? l.minWidth;
|
|
77
|
+
b != null && (a += G(b));
|
|
78
|
+
});
|
|
79
|
+
let o = w.value ? i.operaWidth : 0;
|
|
80
|
+
for (let l = e.length - 1; l >= 0; l--) {
|
|
81
|
+
const v = e[l];
|
|
82
|
+
v.fixed === "right" && (t[l] = o);
|
|
83
|
+
const b = v.width ?? v.minWidth;
|
|
84
|
+
b != null && (o += G(b));
|
|
258
85
|
}
|
|
259
|
-
return
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
F("sorted:data", t);
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
if (r.dragSortProps.length > 0) {
|
|
315
|
-
const _ = t.map((v) => {
|
|
316
|
-
const B = {};
|
|
317
|
-
return r.dragSortProps.forEach((l) => {
|
|
318
|
-
B[l] = v[l];
|
|
319
|
-
}), B;
|
|
320
|
-
});
|
|
321
|
-
F("sorted:data", _);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
} catch (u) {
|
|
326
|
-
console.error("初始化拖拽排序失败:", u);
|
|
327
|
-
}
|
|
86
|
+
return { left: r, right: t };
|
|
87
|
+
}), O = (e) => e.fixed === "left" ? "is-fixed-left" : e.fixed === "right" ? "is-fixed-right" : "", F = (e, r) => {
|
|
88
|
+
const { left: t, right: a } = ee.value;
|
|
89
|
+
if (e.fixed === "left" && t[r] !== void 0)
|
|
90
|
+
return { position: "sticky", left: `${t[r]}px` };
|
|
91
|
+
if (e.fixed === "right" && a[r] !== void 0)
|
|
92
|
+
return { position: "sticky", right: `${a[r]}px` };
|
|
93
|
+
}, R = (e) => ({ position: "sticky", right: `${e}px` }), _ = (e, r, t) => {
|
|
94
|
+
if (e.formatter) {
|
|
95
|
+
const o = e.formatter(r, t);
|
|
96
|
+
return o == null ? "" : String(o);
|
|
97
|
+
}
|
|
98
|
+
if (e.dataIndex == null) return "";
|
|
99
|
+
const a = r[e.dataIndex];
|
|
100
|
+
return a == null ? "" : String(a);
|
|
101
|
+
}, te = (e) => {
|
|
102
|
+
const r = i.pagination ? i.pageSize * (i.currentPage - 1) : 0;
|
|
103
|
+
return e + 1 + r;
|
|
104
|
+
}, ae = he(), re = $(() => !!i.dragSort && !!i.rowKey && !ae.value), oe = {
|
|
105
|
+
layout: { duration: 0.28, ease: [0.32, 0.72, 0, 1] }
|
|
106
|
+
}, B = T(-1), c = T(-1), m = T(-1), se = (e, r) => {
|
|
107
|
+
if (!i.dragSort) {
|
|
108
|
+
r.preventDefault();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
c.value = e, m.value = e, r.dataTransfer?.setData("text/plain", String(e)), r.dataTransfer && (r.dataTransfer.effectAllowed = "move");
|
|
112
|
+
}, ne = (e) => {
|
|
113
|
+
c.value !== -1 && (m.value = e);
|
|
114
|
+
}, le = (e) => {
|
|
115
|
+
if (c.value === -1 || c.value === e) {
|
|
116
|
+
p();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
H(c.value, e), p();
|
|
120
|
+
}, p = () => {
|
|
121
|
+
B.value = -1, c.value = -1, m.value = -1;
|
|
122
|
+
}, H = (e, r) => {
|
|
123
|
+
if (e === r) return;
|
|
124
|
+
const t = [...i.data], [a] = t.splice(e, 1);
|
|
125
|
+
a !== void 0 && (t.splice(r, 0, a), ie(t));
|
|
126
|
+
}, ie = (e) => {
|
|
127
|
+
if (i.dragSortProps.length === 0) {
|
|
128
|
+
k("sorted:data", e);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const r = e.map((t) => {
|
|
132
|
+
const a = {};
|
|
133
|
+
return i.dragSortProps.forEach((o) => {
|
|
134
|
+
a[o] = t[o];
|
|
135
|
+
}), a;
|
|
136
|
+
});
|
|
137
|
+
k("sorted:data", r);
|
|
328
138
|
};
|
|
329
|
-
return
|
|
330
|
-
|
|
331
|
-
}),
|
|
332
|
-
|
|
333
|
-
}),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
])
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
139
|
+
return ce(() => {
|
|
140
|
+
window.addEventListener("mouseup", p);
|
|
141
|
+
}), ge(() => {
|
|
142
|
+
window.removeEventListener("mouseup", p);
|
|
143
|
+
}), J({ reorderData: H }), (e, r) => (s(), n("div", Se, [
|
|
144
|
+
e.$slots.action ? (s(), n("div", we, [
|
|
145
|
+
f(e.$slots, "action", {}, void 0, !0)
|
|
146
|
+
])) : u("", !0),
|
|
147
|
+
d("div", {
|
|
148
|
+
class: z(["g-table-main", `g-table-main--${e.size}`])
|
|
149
|
+
}, [
|
|
150
|
+
d("div", _e, [
|
|
151
|
+
d("table", $e, [
|
|
152
|
+
d("colgroup", null, [
|
|
153
|
+
e.dragSort ? (s(), n("col", ze)) : u("", !0),
|
|
154
|
+
(s(!0), n(y, null, C(S.value, (t, a) => (s(), n("col", {
|
|
155
|
+
key: M(t, a),
|
|
156
|
+
style: h(x(t))
|
|
157
|
+
}, null, 4))), 128)),
|
|
158
|
+
w.value ? (s(), n("col", {
|
|
159
|
+
key: 1,
|
|
160
|
+
style: h({ width: `${e.operaWidth}px` })
|
|
161
|
+
}, null, 4)) : u("", !0)
|
|
162
|
+
]),
|
|
163
|
+
d("thead", null, [
|
|
164
|
+
d("tr", null, [
|
|
165
|
+
e.dragSort ? (s(), n("th", Ce, "序号")) : u("", !0),
|
|
166
|
+
(s(!0), n(y, null, C(S.value, (t, a) => (s(), n("th", {
|
|
167
|
+
key: M(t, a),
|
|
168
|
+
class: z(["g-table-th", [`is-align-${t.align || "left"}`, O(t)]]),
|
|
169
|
+
style: h(F(t, a))
|
|
170
|
+
}, [
|
|
171
|
+
V("headerCell", { column: t, index: a }) ? f(e.$slots, "headerCell", {
|
|
172
|
+
key: 0,
|
|
173
|
+
column: t,
|
|
174
|
+
index: a
|
|
175
|
+
}, void 0, !0) : (s(), n(y, { key: 1 }, [
|
|
176
|
+
D(I(t.title), 1)
|
|
177
|
+
], 64))
|
|
178
|
+
], 6))), 128)),
|
|
179
|
+
w.value ? (s(), n("th", {
|
|
180
|
+
key: 1,
|
|
181
|
+
class: "g-table-th is-operations",
|
|
182
|
+
style: h(R(0))
|
|
183
|
+
}, I(e.operationLabel || "操作"), 5)) : u("", !0)
|
|
184
|
+
])
|
|
185
|
+
]),
|
|
186
|
+
e.data.length ? (s(), n("tbody", De, [
|
|
187
|
+
(s(!0), n(y, null, C(e.data, (t, a) => (s(), A(W(me).tr, {
|
|
188
|
+
key: e.rowKey ? t[e.rowKey] : a,
|
|
189
|
+
class: z(["g-table-tr", {
|
|
190
|
+
"is-dragging": c.value === a,
|
|
191
|
+
"is-drop-before": m.value === a && c.value > a,
|
|
192
|
+
"is-drop-after": m.value === a && c.value < a && c.value !== -1
|
|
193
|
+
}]),
|
|
194
|
+
layout: re.value,
|
|
195
|
+
transition: oe,
|
|
196
|
+
draggable: e.dragSort && B.value === a,
|
|
197
|
+
onDragstart: (o) => se(a, o),
|
|
198
|
+
onDragover: U((o) => ne(a), ["prevent"]),
|
|
199
|
+
onDrop: U((o) => le(a), ["prevent"]),
|
|
200
|
+
onDragend: p
|
|
201
|
+
}, {
|
|
202
|
+
default: E(() => [
|
|
203
|
+
e.dragSort ? (s(), n("td", Ie, [
|
|
204
|
+
d("div", Pe, [
|
|
205
|
+
D(I(te(a)) + " ", 1),
|
|
206
|
+
d("span", {
|
|
207
|
+
class: "g-drag-icon",
|
|
208
|
+
title: "拖动排序",
|
|
209
|
+
onMousedown: (o) => B.value = a,
|
|
210
|
+
onMouseup: p
|
|
211
|
+
}, [
|
|
212
|
+
j(W(be), { class: "g-drag-icon-svg" })
|
|
213
|
+
], 40, Le)
|
|
214
|
+
])
|
|
215
|
+
])) : u("", !0),
|
|
216
|
+
(s(!0), n(y, null, C(S.value, (o, l) => (s(), n("td", {
|
|
217
|
+
key: M(o, l),
|
|
218
|
+
class: z(["g-table-td", [`is-align-${o.align || "left"}`, O(o), { "is-ellipsis": o.ellipsis }]]),
|
|
219
|
+
style: h(F(o, l)),
|
|
220
|
+
title: o.ellipsis ? _(o, t, a) : void 0
|
|
221
|
+
}, [
|
|
222
|
+
V("bodyCell", { column: o, record: t, index: a, text: _(o, t, a) }) ? f(e.$slots, "bodyCell", {
|
|
223
|
+
key: 0,
|
|
224
|
+
column: o,
|
|
225
|
+
record: t,
|
|
226
|
+
index: a,
|
|
227
|
+
text: _(o, t, a)
|
|
228
|
+
}, void 0, !0) : (s(), n(y, { key: 1 }, [
|
|
229
|
+
D(I(_(o, t, a)), 1)
|
|
230
|
+
], 64))
|
|
231
|
+
], 14, Me))), 128)),
|
|
232
|
+
w.value ? (s(), n("td", {
|
|
233
|
+
key: 1,
|
|
234
|
+
class: "g-table-td is-operations",
|
|
235
|
+
style: h(R(0))
|
|
236
|
+
}, [
|
|
237
|
+
d("div", Be, [
|
|
238
|
+
f(e.$slots, "operations", {
|
|
239
|
+
row: t,
|
|
240
|
+
index: a
|
|
241
|
+
}, void 0, !0),
|
|
242
|
+
L("more") ? (s(), A(fe, {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "g-table-more",
|
|
245
|
+
size: "sm",
|
|
246
|
+
align: "right",
|
|
247
|
+
teleported: "",
|
|
248
|
+
"aria-label": "更多操作",
|
|
249
|
+
"surface-color": "var(--el-bg-color-overlay)",
|
|
250
|
+
"highlight-color": "var(--el-color-primary-light-9)",
|
|
251
|
+
"text-color": "var(--el-text-color-primary)",
|
|
252
|
+
"accent-color": "var(--el-color-primary)",
|
|
253
|
+
radius: 6
|
|
254
|
+
}, {
|
|
255
|
+
trigger: E(() => [
|
|
256
|
+
d("span", Te, [
|
|
257
|
+
r[0] || (r[0] = D(" 更多 ")),
|
|
258
|
+
j(W(ke), { class: "el-icon" })
|
|
259
|
+
])
|
|
260
|
+
]),
|
|
261
|
+
menu: E(({ close: o }) => [
|
|
262
|
+
d("div", {
|
|
263
|
+
class: "g-table-more-menu",
|
|
264
|
+
onClick: (l) => o()
|
|
265
|
+
}, [
|
|
266
|
+
f(e.$slots, "more", {
|
|
267
|
+
row: t,
|
|
268
|
+
index: a
|
|
269
|
+
}, void 0, !0)
|
|
270
|
+
], 8, Ae)
|
|
406
271
|
]),
|
|
407
|
-
_:
|
|
408
|
-
})
|
|
272
|
+
_: 2
|
|
273
|
+
}, 1024)) : u("", !0)
|
|
409
274
|
])
|
|
410
|
-
]),
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
]),
|
|
414
|
-
|
|
415
|
-
}, 8, ["label", "width"])) : p("", !0)
|
|
416
|
-
]),
|
|
417
|
-
_: 3
|
|
418
|
-
}, 16, ["data", "size", "class"]),
|
|
419
|
-
u.pagination ? (s(), C(B, {
|
|
420
|
-
key: 1,
|
|
421
|
-
locale: A(X)
|
|
422
|
-
}, {
|
|
423
|
-
default: o(() => [
|
|
424
|
-
E(v, {
|
|
425
|
-
class: "g-pagination-contianer",
|
|
426
|
-
size: "small",
|
|
427
|
-
"current-page": u.currentPage,
|
|
428
|
-
"page-size": u.pageSize,
|
|
429
|
-
total: u.total,
|
|
430
|
-
"page-sizes": u.pageSizes,
|
|
431
|
-
layout: u.layout,
|
|
432
|
-
onSizeChange: T,
|
|
433
|
-
onCurrentChange: L
|
|
434
|
-
}, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout"])
|
|
275
|
+
], 4)) : u("", !0)
|
|
276
|
+
]),
|
|
277
|
+
_: 2
|
|
278
|
+
}, 1032, ["layout", "class", "draggable", "onDragstart", "onDragover", "onDrop"]))), 128))
|
|
279
|
+
])) : u("", !0)
|
|
435
280
|
]),
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
281
|
+
e.data.length ? u("", !0) : (s(), n("div", We, [
|
|
282
|
+
e.$slots.empty ? f(e.$slots, "empty", { key: 0 }, void 0, !0) : (s(), n("span", Ee, "暂无数据"))
|
|
283
|
+
]))
|
|
284
|
+
])
|
|
285
|
+
], 2),
|
|
286
|
+
e.pagination ? (s(), A(ye, {
|
|
287
|
+
key: 1,
|
|
288
|
+
class: "g-pagination-contianer",
|
|
289
|
+
size: "small",
|
|
290
|
+
"current-page": e.currentPage,
|
|
291
|
+
"page-size": e.pageSize,
|
|
292
|
+
total: e.total,
|
|
293
|
+
"page-sizes": e.pageSizes,
|
|
294
|
+
layout: e.layout,
|
|
295
|
+
onSizeChange: X,
|
|
296
|
+
onCurrentChange: Y
|
|
297
|
+
}, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout"])) : u("", !0)
|
|
298
|
+
]));
|
|
440
299
|
}
|
|
441
|
-
}),
|
|
442
|
-
|
|
443
|
-
|
|
300
|
+
}), K = /* @__PURE__ */ ve(Ke, [["__scopeId", "data-v-9feda06a"]]);
|
|
301
|
+
K.install = (P) => {
|
|
302
|
+
P.component(K.name, K);
|
|
444
303
|
};
|
|
445
304
|
export {
|
|
446
|
-
|
|
447
|
-
|
|
305
|
+
K as GTable,
|
|
306
|
+
K as default
|
|
448
307
|
};
|