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.
@@ -1,237 +1,48 @@
1
- import { defineComponent as z, createElementBlock as m, openBlock as s, createElementVNode as b, useSlots as M, useAttrs as R, ref as N, shallowRef as I, onMounted as V, watch as W, onBeforeUnmount as j, resolveComponent as d, createCommentVNode as p, createVNode as E, createBlock as C, renderSlot as g, mergeProps as q, withCtx as o, createTextVNode as P, toDisplayString as G, unref as A } from "vue";
2
- import Y from "sortablejs";
3
- import { _ as O } from "../GBranched-vnLlYOl9.mjs";
4
- var U = /* @__PURE__ */ z({
5
- name: "ArrowDown",
6
- __name: "arrow-down",
7
- setup(c) {
8
- return (w, r) => (s(), m("svg", {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- viewBox: "0 0 1024 1024"
11
- }, [
12
- b("path", {
13
- fill: "currentColor",
14
- d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 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.59 30.59 0 0 0-42.752 0z"
15
- })
16
- ]));
17
- }
18
- }), J = U, K = /* @__PURE__ */ z({
19
- name: "Operation",
20
- __name: "operation",
21
- setup(c) {
22
- return (w, r) => (s(), m("svg", {
23
- xmlns: "http://www.w3.org/2000/svg",
24
- viewBox: "0 0 1024 1024"
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
- }, eu = { key: 1 }, tu = { class: "g-dropdown-link" }, au = /* @__PURE__ */ z({
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(c, { emit: w }) {
249
- const r = c, F = w, T = (u) => {
250
- F("update:pageSize", u);
251
- }, L = (u) => {
252
- F("update:currentPage", u);
253
- }, x = M(), S = (u) => !!x[u], f = R(), $ = (u) => {
254
- const e = !!f["page-size"], n = !!f["current-page"];
255
- if (e && n) {
256
- const a = Number(f["page-size"] || 10), t = Number(f["current-page"] || 1);
257
- return u + 1 + a * (t - 1);
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 u;
260
- }, D = N(null), h = I(null), H = (u = 20) => new Promise((e) => {
261
- let n = 0;
262
- const a = () => {
263
- if (!D.value) {
264
- e(null);
265
- return;
266
- }
267
- const t = D.value.$el.querySelectorAll("tbody");
268
- for (let i = 0; i < t.length; i++)
269
- if (t[i].querySelectorAll("tr").length > 0) {
270
- e(t[i]);
271
- return;
272
- }
273
- if (++n >= u) {
274
- e(null);
275
- return;
276
- }
277
- setTimeout(a, 500);
278
- };
279
- a();
280
- }), k = async () => {
281
- if (D.value)
282
- try {
283
- const u = await H();
284
- if (!u) {
285
- console.error("未找到包含数据行的 tbody 元素");
286
- return;
287
- }
288
- h.value?.destroy?.(), h.value = new Y(u, {
289
- // 拖拽的元素选择器
290
- draggable: "tr",
291
- // 拖拽的触发元素选择器
292
- handle: ".g-drag-icon",
293
- // 拖拽动画时长
294
- animation: 200,
295
- // 拖拽时占位元素的类名
296
- ghostClass: "g-sortable-ghost",
297
- // 禁用 Sortable 的默认拖拽反馈
298
- forceFallback: !0,
299
- onStart: function(e) {
300
- e.item.classList.add("dragging");
301
- },
302
- onEnd: async function(e) {
303
- e.item.classList.remove("dragging");
304
- const { oldIndex: n, newIndex: a } = e;
305
- if (n === void 0 || a === void 0) {
306
- console.error("无效的索引值");
307
- return;
308
- }
309
- const t = [...r.data], [i] = t.splice(n, 1);
310
- if (t.splice(a, 0, i), r.dragSortProps.length === 0) {
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 V(() => {
330
- r.dragSort && k();
331
- }), W(() => r.data, () => {
332
- r.dragSort && k();
333
- }), j(() => {
334
- h.value?.destroy?.(), h.value = null;
335
- }), (u, e) => {
336
- const n = d("el-icon"), a = d("el-table-column"), t = d("el-dropdown-menu"), i = d("el-dropdown"), _ = d("el-table"), v = d("el-pagination"), B = d("el-config-provider");
337
- return s(), m("div", Z, [
338
- u.$slots.action ? (s(), m("div", uu, [
339
- g(u.$slots, "action", {}, void 0, !0)
340
- ])) : p("", !0),
341
- E(_, q({
342
- data: u.data || []
343
- }, u.$attrs, {
344
- size: u.size,
345
- stripe: "",
346
- ref_key: "tableRef",
347
- ref: D,
348
- class: ["g-table-main", `g-table-main--${u.size}`]
349
- }), {
350
- empty: o(() => [
351
- u.$slots.empty ? g(u.$slots, "empty", { key: 0 }, void 0, !0) : (s(), m("span", eu, "暂无数据"))
352
- ]),
353
- default: o(() => [
354
- u.dragSort ? (s(), C(a, {
355
- key: 0,
356
- label: "序号",
357
- width: "65"
358
- }, {
359
- default: o((l) => [
360
- b("div", null, [
361
- P(G($(l.$index)) + " ", 1),
362
- E(n, { class: "g-drag-icon" }, {
363
- default: o(() => [
364
- E(A(Q))
365
- ]),
366
- _: 1
367
- })
368
- ])
369
- ]),
370
- _: 1
371
- })) : p("", !0),
372
- g(u.$slots, "default", {}, void 0, !0),
373
- S("operations") ? (s(), C(a, {
374
- key: 1,
375
- fixed: "right",
376
- label: u.operationLabel || "操作",
377
- width: u.operaWidth
378
- }, {
379
- default: o((l) => [
380
- g(u.$slots, "operations", {
381
- row: l.row,
382
- index: l.$index
383
- }, void 0, !0),
384
- S("more") ? (s(), C(i, {
385
- key: 0,
386
- size: "small",
387
- style: { "vertical-align": "baseline" }
388
- }, {
389
- dropdown: o(() => [
390
- E(t, null, {
391
- default: o(() => [
392
- g(u.$slots, "more", {
393
- row: l.row,
394
- index: l.$index
395
- }, void 0, !0)
396
- ]),
397
- _: 2
398
- }, 1024)
399
- ]),
400
- default: o(() => [
401
- b("span", tu, [
402
- e[0] || (e[0] = P(" 更多 ")),
403
- E(n, null, {
404
- default: o(() => [
405
- E(A(J))
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
- _: 1
408
- })
272
+ _: 2
273
+ }, 1024)) : u("", !0)
409
274
  ])
410
- ]),
411
- _: 2
412
- }, 1024)) : p("", !0)
413
- ]),
414
- _: 3
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
- _: 1
437
- }, 8, ["locale"])) : p("", !0)
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
- }), y = /* @__PURE__ */ O(au, [["__scopeId", "data-v-90ad3ecc"]]);
442
- y.install = (c) => {
443
- c.component(y.name, y);
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
- y as GTable,
447
- y as default
305
+ K as GTable,
306
+ K as default
448
307
  };