@lx-frontend/wrap-element-ui 1.0.26 → 1.0.27

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.
Files changed (113) hide show
  1. package/README.md +4 -54
  2. package/package.json +8 -38
  3. package/src/components/AddMembers/index.vue +149 -0
  4. package/src/components/AuditSteps/index.vue +140 -0
  5. package/src/components/DemoComponent/index.vue +21 -0
  6. package/src/components/EditableTable/README.md +147 -0
  7. package/{dist/vue2/types/components/EditableTable/bizHooks/index.d.ts → src/components/EditableTable/bizHooks/index.ts} +1 -1
  8. package/src/components/EditableTable/bizHooks/useCellHover.ts +72 -0
  9. package/src/components/EditableTable/bizHooks/useColumnHeaderOperation.ts +339 -0
  10. package/src/components/EditableTable/bizHooks/useDefaultOperation.ts +96 -0
  11. package/src/components/EditableTable/bizHooks/useDragSort.ts +291 -0
  12. package/src/components/EditableTable/bizHooks/usePagination.ts +31 -0
  13. package/src/components/EditableTable/bizHooks/useRowBgColor.ts +44 -0
  14. package/src/components/EditableTable/bizHooks/useViewSetting.ts +206 -0
  15. package/src/components/EditableTable/features/bizColorSelect.vue +63 -0
  16. package/src/components/EditableTable/features/bizEditCell.vue +44 -0
  17. package/src/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue +40 -0
  18. package/src/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue +56 -0
  19. package/src/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue +94 -0
  20. package/src/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue +26 -0
  21. package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.ts +131 -0
  22. package/src/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue +115 -0
  23. package/src/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue +39 -0
  24. package/src/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue +50 -0
  25. package/src/components/EditableTable/features/bizTableHeaderPopover/index.vue +160 -0
  26. package/src/components/EditableTable/features/bizTableOperatePopover.vue +67 -0
  27. package/src/components/EditableTable/features/bizViewSettingDialog.vue +137 -0
  28. package/src/components/EditableTable/index.less +820 -0
  29. package/src/components/EditableTable/index.vue +682 -0
  30. package/src/components/EditableTable/pin-top.png +0 -0
  31. package/src/components/EditableTable/types/index.ts +212 -0
  32. package/src/components/Ellipsis/MultilineEllipsis.vue +141 -0
  33. package/src/components/Ellipsis/index.vue +119 -0
  34. package/src/components/LxTable/index.vue +296 -0
  35. package/src/components/PopoverForm/index.vue +66 -0
  36. package/src/components/SearchForm/index.vue +262 -0
  37. package/src/components/SearchForm/types/index.ts +81 -0
  38. package/src/components/SearchSelect/index.vue +153 -0
  39. package/src/components/helper.ts +37 -0
  40. package/src/components/index.ts +24 -0
  41. package/src/components/singleMessage/index.ts +44 -0
  42. package/dist/auto/index.mjs +0 -21
  43. package/dist/auto/types/index.d.ts +0 -9
  44. package/dist/vue2/index.css +0 -1
  45. package/dist/vue2/index.mjs +0 -3017
  46. package/dist/vue2/types/components/AddMembers/index.vue.d.ts +0 -31
  47. package/dist/vue2/types/components/AuditSteps/index.vue.d.ts +0 -46
  48. package/dist/vue2/types/components/DemoComponent/index.vue.d.ts +0 -2
  49. package/dist/vue2/types/components/EditableTable/bizHooks/useCellHover.d.ts +0 -11
  50. package/dist/vue2/types/components/EditableTable/bizHooks/useColumnHeaderOperation.d.ts +0 -34
  51. package/dist/vue2/types/components/EditableTable/bizHooks/useDefaultOperation.d.ts +0 -22
  52. package/dist/vue2/types/components/EditableTable/bizHooks/useDragSort.d.ts +0 -14
  53. package/dist/vue2/types/components/EditableTable/bizHooks/usePagination.d.ts +0 -12
  54. package/dist/vue2/types/components/EditableTable/bizHooks/useRowBgColor.d.ts +0 -15
  55. package/dist/vue2/types/components/EditableTable/bizHooks/useViewSetting.d.ts +0 -26
  56. package/dist/vue2/types/components/EditableTable/features/bizColorSelect.vue.d.ts +0 -25
  57. package/dist/vue2/types/components/EditableTable/features/bizEditCell.vue.d.ts +0 -21
  58. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue.d.ts +0 -21
  59. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue.d.ts +0 -21
  60. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue.d.ts +0 -21
  61. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue.d.ts +0 -21
  62. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.d.ts +0 -48
  63. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue.d.ts +0 -21
  64. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue.d.ts +0 -21
  65. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue.d.ts +0 -23
  66. package/dist/vue2/types/components/EditableTable/features/bizTableHeaderPopover/index.vue.d.ts +0 -311
  67. package/dist/vue2/types/components/EditableTable/features/bizTableOperatePopover.vue.d.ts +0 -32
  68. package/dist/vue2/types/components/EditableTable/features/bizViewSettingDialog.vue.d.ts +0 -30
  69. package/dist/vue2/types/components/EditableTable/index.vue.d.ts +0 -472
  70. package/dist/vue2/types/components/EditableTable/types/index.d.ts +0 -235
  71. package/dist/vue2/types/components/Ellipsis/MultilineEllipsis.vue.d.ts +0 -91
  72. package/dist/vue2/types/components/Ellipsis/index.vue.d.ts +0 -89
  73. package/dist/vue2/types/components/LxTable/index.vue.d.ts +0 -2
  74. package/dist/vue2/types/components/PopoverForm/index.vue.d.ts +0 -50
  75. package/dist/vue2/types/components/SearchForm/index.vue.d.ts +0 -116
  76. package/dist/vue2/types/components/SearchForm/types/index.d.ts +0 -65
  77. package/dist/vue2/types/components/SearchSelect/index.vue.d.ts +0 -53
  78. package/dist/vue2/types/components/helper.d.ts +0 -8
  79. package/dist/vue2/types/components/index.d.ts +0 -12
  80. package/dist/vue2/types/components/singleMessage/index.d.ts +0 -4
  81. package/dist/vue2/types/vue2/index.d.ts +0 -1363
  82. package/dist/vue3/index.css +0 -1
  83. package/dist/vue3/index.mjs +0 -2306
  84. package/dist/vue3/index.mjs.map +0 -1
  85. package/dist/vue3/types/components/EditableTable/features/bizColorSelect.vue.d.ts +0 -31
  86. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizCheckboxFilter.vue.d.ts +0 -23
  87. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizColorRadioFilter.vue.d.ts +0 -23
  88. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizDoubleDatePickerFilter.vue.d.ts +0 -23
  89. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizInputFilter.vue.d.ts +0 -23
  90. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.helper.d.ts +0 -48
  91. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizMonthDayPicker.vue.d.ts +0 -23
  92. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizRadioFilter.vue.d.ts +0 -23
  93. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/BizSortFilter.vue.d.ts +0 -25
  94. package/dist/vue3/types/components/EditableTable/features/bizTableHeaderPopover/index.vue.d.ts +0 -77
  95. package/dist/vue3/types/components/EditableTable/features/bizTableOperatePopover.vue.d.ts +0 -36
  96. package/dist/vue3/types/components/EditableTable/features/bizViewSettingDialog.vue.d.ts +0 -35
  97. package/dist/vue3/types/components/EditableTable/hooks/index.d.ts +0 -9
  98. package/dist/vue3/types/components/EditableTable/hooks/useCellHover.d.ts +0 -19
  99. package/dist/vue3/types/components/EditableTable/hooks/useColumnHeaderOperation.d.ts +0 -37
  100. package/dist/vue3/types/components/EditableTable/hooks/useDefaultOperation.d.ts +0 -22
  101. package/dist/vue3/types/components/EditableTable/hooks/useDragSort.d.ts +0 -15
  102. package/dist/vue3/types/components/EditableTable/hooks/usePagination.d.ts +0 -12
  103. package/dist/vue3/types/components/EditableTable/hooks/useRowBgColor.d.ts +0 -18
  104. package/dist/vue3/types/components/EditableTable/hooks/useRowEdit.d.ts +0 -14
  105. package/dist/vue3/types/components/EditableTable/hooks/useTableRender.d.ts +0 -41
  106. package/dist/vue3/types/components/EditableTable/hooks/useViewSetting.d.ts +0 -26
  107. package/dist/vue3/types/components/EditableTable/index.vue.d.ts +0 -4478
  108. package/dist/vue3/types/components/EditableTable/types.d.ts +0 -419
  109. package/dist/vue3/types/components/helper.d.ts +0 -8
  110. package/dist/vue3/types/index.d.ts +0 -7
  111. package/dist/vue3/types/stories/EditableTable.fake.d.ts +0 -33
  112. package/dist/vue3/types/stories/EditableTable.hook.d.ts +0 -12
  113. package/dist/vue3/types/stories/EditableTable.stories.d.ts +0 -18
@@ -1,2306 +0,0 @@
1
- import { ref as M, watch as be, computed as oe, onMounted as Ye, onBeforeUnmount as Xe, nextTick as _e, defineComponent as le, toRefs as Ve, openBlock as g, createBlock as G, unref as r, isRef as $e, withCtx as T, createVNode as j, createTextVNode as X, createElementVNode as F, createElementBlock as O, Fragment as J, renderList as re, toDisplayString as q, normalizeClass as Se, resolveComponent as Z, normalizeStyle as ke, mergeProps as de, renderSlot as ne, createCommentVNode as ee, resolveDynamicComponent as wt, normalizeProps as St, guardReactiveProps as Ct, useSlots as xt, resolveDirective as kt, withDirectives as $t, createSlots as Ae } from "vue";
2
- import { ElDialog as Et, ElButton as we, ElCheckboxGroup as Pt, ElCheckbox as Dt, ElInput as qe, ElIcon as Je, ElConfigProvider as Rt, ElTable as Tt, ElTableColumn as ye, ElSelect as Ft, ElOption as Vt, ElDatePicker as Lt, ElPagination as Ot } from "element-plus";
3
- import { Close as It, Setting as At } from "@element-plus/icons-vue";
4
- import fe from "dayjs";
5
- import './index.css';/*! Element Plus v2.13.7 */
6
- var Mt = {
7
- name: "zh-cn",
8
- el: {
9
- breadcrumb: { label: "面包屑" },
10
- colorpicker: {
11
- confirm: "确定",
12
- clear: "清空",
13
- defaultLabel: "颜色选择器",
14
- description: "当前颜色 {color},按 Enter 键选择新颜色",
15
- alphaLabel: "选择透明度的值",
16
- alphaDescription: "透明度 {alpha}, 当前颜色 {color}",
17
- hueLabel: "选择色相值",
18
- hueDescription: "色相 {hue}, 当前颜色 {color}",
19
- svLabel: "选择饱和度与明度的值",
20
- svDescription: "饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",
21
- predefineDescription: "选择 {value} 作为颜色"
22
- },
23
- datepicker: {
24
- now: "此刻",
25
- today: "今天",
26
- cancel: "取消",
27
- clear: "清空",
28
- confirm: "确定",
29
- dateTablePrompt: "使用方向键与 Enter 键可选择日期",
30
- monthTablePrompt: "使用方向键与 Enter 键可选择月份",
31
- yearTablePrompt: "使用方向键与 Enter 键可选择年份",
32
- selectedDate: "已选日期",
33
- selectDate: "选择日期",
34
- selectTime: "选择时间",
35
- startDate: "开始日期",
36
- startTime: "开始时间",
37
- endDate: "结束日期",
38
- endTime: "结束时间",
39
- prevYear: "前一年",
40
- nextYear: "后一年",
41
- prevMonth: "上个月",
42
- nextMonth: "下个月",
43
- year: "年",
44
- month1: "1 月",
45
- month2: "2 月",
46
- month3: "3 月",
47
- month4: "4 月",
48
- month5: "5 月",
49
- month6: "6 月",
50
- month7: "7 月",
51
- month8: "8 月",
52
- month9: "9 月",
53
- month10: "10 月",
54
- month11: "11 月",
55
- month12: "12 月",
56
- weeks: {
57
- sun: "日",
58
- mon: "一",
59
- tue: "二",
60
- wed: "三",
61
- thu: "四",
62
- fri: "五",
63
- sat: "六"
64
- },
65
- weeksFull: {
66
- sun: "星期日",
67
- mon: "星期一",
68
- tue: "星期二",
69
- wed: "星期三",
70
- thu: "星期四",
71
- fri: "星期五",
72
- sat: "星期六"
73
- },
74
- months: {
75
- jan: "一月",
76
- feb: "二月",
77
- mar: "三月",
78
- apr: "四月",
79
- may: "五月",
80
- jun: "六月",
81
- jul: "七月",
82
- aug: "八月",
83
- sep: "九月",
84
- oct: "十月",
85
- nov: "十一月",
86
- dec: "十二月"
87
- }
88
- },
89
- inputNumber: {
90
- decrease: "减少数值",
91
- increase: "增加数值"
92
- },
93
- select: {
94
- loading: "加载中",
95
- noMatch: "无匹配数据",
96
- noData: "无数据",
97
- placeholder: "请选择"
98
- },
99
- mention: { loading: "加载中" },
100
- dropdown: { toggleDropdown: "切换下拉选项" },
101
- cascader: {
102
- noMatch: "无匹配数据",
103
- loading: "加载中",
104
- placeholder: "请选择",
105
- noData: "暂无数据"
106
- },
107
- pagination: {
108
- goto: "前往",
109
- pagesize: "条/页",
110
- total: "共 {total} 条",
111
- pageClassifier: "页",
112
- page: "页",
113
- prev: "上一页",
114
- next: "下一页",
115
- currentPage: "第 {pager} 页",
116
- prevPages: "向前 {pager} 页",
117
- nextPages: "向后 {pager} 页",
118
- deprecationWarning: "你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"
119
- },
120
- dialog: { close: "关闭此对话框" },
121
- drawer: { close: "关闭此对话框" },
122
- messagebox: {
123
- title: "提示",
124
- confirm: "确定",
125
- cancel: "取消",
126
- error: "输入的数据不合法!",
127
- close: "关闭此对话框"
128
- },
129
- upload: {
130
- deleteTip: "按 Delete 键可删除",
131
- delete: "删除",
132
- preview: "查看图片",
133
- continue: "继续上传"
134
- },
135
- slider: {
136
- defaultLabel: "滑块介于 {min} 至 {max}",
137
- defaultRangeStartLabel: "选择起始值",
138
- defaultRangeEndLabel: "选择结束值"
139
- },
140
- table: {
141
- emptyText: "暂无数据",
142
- confirmFilter: "筛选",
143
- resetFilter: "重置",
144
- clearFilter: "全部",
145
- sumText: "合计",
146
- selectAllLabel: "选择所有行",
147
- selectRowLabel: "选择当前行",
148
- expandRowLabel: "展开当前行",
149
- collapseRowLabel: "收起当前行",
150
- sortLabel: "按 {column} 排序",
151
- filterLabel: "按 {column} 过滤"
152
- },
153
- tag: { close: "关闭此标签" },
154
- tour: {
155
- next: "下一步",
156
- previous: "上一步",
157
- finish: "结束导览",
158
- close: "关闭此对话框"
159
- },
160
- tree: { emptyText: "暂无数据" },
161
- transfer: {
162
- noMatch: "无匹配数据",
163
- noData: "无数据",
164
- titles: ["列表 1", "列表 2"],
165
- filterPlaceholder: "请输入搜索内容",
166
- noCheckedFormat: "共 {total} 项",
167
- hasCheckedFormat: "已选 {checked}/{total} 项"
168
- },
169
- image: { error: "加载失败" },
170
- pageHeader: { title: "返回" },
171
- popconfirm: {
172
- confirmButtonText: "确定",
173
- cancelButtonText: "取消"
174
- },
175
- carousel: {
176
- leftArrow: "上一张幻灯片",
177
- rightArrow: "下一张幻灯片",
178
- indicator: "幻灯片切换至索引 {index}"
179
- }
180
- }
181
- };
182
- function zt(e, i) {
183
- const l = M(e.currentPage || 1), o = M(e.pageSize || 10);
184
- return be(
185
- () => e.currentPage,
186
- (a) => {
187
- a !== void 0 && (l.value = a);
188
- }
189
- ), be(
190
- () => e.pageSize,
191
- (a) => {
192
- a !== void 0 && (o.value = a);
193
- }
194
- ), {
195
- currentPage: l,
196
- pageSize: o,
197
- handlePageChange: (a) => {
198
- l.value = a, i("update:currentPage", a), i("page-change", { page: a, size: o.value });
199
- },
200
- handleSizeChange: (a) => {
201
- o.value = a, i("update:pageSize", a), i("page-change", { page: 1, size: a });
202
- }
203
- };
204
- }
205
- function Bt(e, i, l) {
206
- return {
207
- renderedColumns: oe(() => i.value.map((t) => e.columns.find((s) => s.prop === t)).filter(Boolean).map((t, s) => ({
208
- ...t,
209
- // 设置固定列
210
- fixed: s < l.value ? "left" : t == null ? void 0 : t.fixed
211
- }))),
212
- hasSlot: (t) => !!t.slotName,
213
- hasEditSlot: (t) => !!t.editSlotName,
214
- hasHoverSlot: (t) => !!t.hoverSlotName,
215
- formatCellValue: (t, s, k) => {
216
- const _ = t[s.prop];
217
- return s.formatter ? s.formatter(t, s, _, k) : _;
218
- }
219
- };
220
- }
221
- var xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
222
- function Qe(e) {
223
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
224
- }
225
- function Nt(e) {
226
- var i = typeof e;
227
- return e != null && (i == "object" || i == "function");
228
- }
229
- var Le = Nt, jt = typeof xe == "object" && xe && xe.Object === Object && xe, Ut = jt, Ht = Ut, Wt = typeof self == "object" && self && self.Object === Object && self, Gt = Ht || Wt || Function("return this")(), Ze = Gt, Kt = Ze, Yt = function() {
230
- return Kt.Date.now();
231
- }, Xt = Yt, qt = /\s/;
232
- function Jt(e) {
233
- for (var i = e.length; i-- && qt.test(e.charAt(i)); )
234
- ;
235
- return i;
236
- }
237
- var Qt = Jt, Zt = Qt, eo = /^\s+/;
238
- function to(e) {
239
- return e && e.slice(0, Zt(e) + 1).replace(eo, "");
240
- }
241
- var oo = to, ao = Ze, no = ao.Symbol, et = no, Me = et, tt = Object.prototype, lo = tt.hasOwnProperty, ro = tt.toString, he = Me ? Me.toStringTag : void 0;
242
- function io(e) {
243
- var i = lo.call(e, he), l = e[he];
244
- try {
245
- e[he] = void 0;
246
- var o = !0;
247
- } catch {
248
- }
249
- var c = ro.call(e);
250
- return o && (i ? e[he] = l : delete e[he]), c;
251
- }
252
- var so = io, uo = Object.prototype, co = uo.toString;
253
- function po(e) {
254
- return co.call(e);
255
- }
256
- var fo = po, ze = et, vo = so, go = fo, mo = "[object Null]", bo = "[object Undefined]", Be = ze ? ze.toStringTag : void 0;
257
- function yo(e) {
258
- return e == null ? e === void 0 ? bo : mo : Be && Be in Object(e) ? vo(e) : go(e);
259
- }
260
- var ho = yo;
261
- function _o(e) {
262
- return e != null && typeof e == "object";
263
- }
264
- var wo = _o, So = ho, Co = wo, xo = "[object Symbol]";
265
- function ko(e) {
266
- return typeof e == "symbol" || Co(e) && So(e) == xo;
267
- }
268
- var $o = ko, Eo = oo, Ne = Le, Po = $o, je = 0 / 0, Do = /^[-+]0x[0-9a-f]+$/i, Ro = /^0b[01]+$/i, To = /^0o[0-7]+$/i, Fo = parseInt;
269
- function Vo(e) {
270
- if (typeof e == "number")
271
- return e;
272
- if (Po(e))
273
- return je;
274
- if (Ne(e)) {
275
- var i = typeof e.valueOf == "function" ? e.valueOf() : e;
276
- e = Ne(i) ? i + "" : i;
277
- }
278
- if (typeof e != "string")
279
- return e === 0 ? e : +e;
280
- e = Eo(e);
281
- var l = Ro.test(e);
282
- return l || To.test(e) ? Fo(e.slice(2), l ? 2 : 8) : Do.test(e) ? je : +e;
283
- }
284
- var Lo = Vo, Oo = Le, Re = Xt, Ue = Lo, Io = "Expected a function", Ao = Math.max, Mo = Math.min;
285
- function zo(e, i, l) {
286
- var o, c, b, a, n, t, s = 0, k = !1, _ = !1, S = !0;
287
- if (typeof e != "function")
288
- throw new TypeError(Io);
289
- i = Ue(i) || 0, Oo(l) && (k = !!l.leading, _ = "maxWait" in l, b = _ ? Ao(Ue(l.maxWait) || 0, i) : b, S = "trailing" in l ? !!l.trailing : S);
290
- function E(A) {
291
- var p = o, D = c;
292
- return o = c = void 0, s = A, a = e.apply(D, p), a;
293
- }
294
- function N(A) {
295
- return s = A, n = setTimeout(m, i), k ? E(A) : a;
296
- }
297
- function V(A) {
298
- var p = A - t, D = A - s, y = i - p;
299
- return _ ? Mo(y, b - D) : y;
300
- }
301
- function f(A) {
302
- var p = A - t, D = A - s;
303
- return t === void 0 || p >= i || p < 0 || _ && D >= b;
304
- }
305
- function m() {
306
- var A = Re();
307
- if (f(A))
308
- return $(A);
309
- n = setTimeout(m, V(A));
310
- }
311
- function $(A) {
312
- return n = void 0, S && o ? E(A) : (o = c = void 0, a);
313
- }
314
- function U() {
315
- n !== void 0 && clearTimeout(n), s = 0, o = t = c = n = void 0;
316
- }
317
- function H() {
318
- return n === void 0 ? a : $(Re());
319
- }
320
- function K() {
321
- var A = Re(), p = f(A);
322
- if (o = arguments, c = this, t = A, p) {
323
- if (n === void 0)
324
- return N(t);
325
- if (_)
326
- return clearTimeout(n), n = setTimeout(m, i), E(t);
327
- }
328
- return n === void 0 && (n = setTimeout(m, i)), a;
329
- }
330
- return K.cancel = U, K.flush = H, K;
331
- }
332
- var ot = zo;
333
- const Bo = /* @__PURE__ */ Qe(ot);
334
- var No = ot, jo = Le, Uo = "Expected a function";
335
- function Ho(e, i, l) {
336
- var o = !0, c = !0;
337
- if (typeof e != "function")
338
- throw new TypeError(Uo);
339
- return jo(l) && (o = "leading" in l ? !!l.leading : o, c = "trailing" in l ? !!l.trailing : c), No(e, i, {
340
- leading: o,
341
- maxWait: i,
342
- trailing: c
343
- });
344
- }
345
- var Wo = Ho;
346
- const at = /* @__PURE__ */ Qe(Wo);
347
- function Go({
348
- props: e,
349
- emit: i,
350
- viewSettingDragSortOptions: l,
351
- currentPage: o,
352
- pageSize: c,
353
- beforeDragStart: b,
354
- currScope: a,
355
- tableDomRef: n
356
- }) {
357
- const t = M({}), s = M(!1), k = M("row"), _ = M(!1);
358
- Ye(() => {
359
- n.value.$el.addEventListener("mousedown", () => {
360
- _.value = !0;
361
- }), document.addEventListener("mousedown", S), document.addEventListener("mousemove", E), document.addEventListener("mouseup", N);
362
- }), Xe(() => {
363
- n.value.$el.removeEventListener(
364
- "mousedown",
365
- () => _.value = !0
366
- ), document.removeEventListener("mousedown", S), document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", N);
367
- });
368
- const S = (p) => {
369
- var y;
370
- s.value = !0;
371
- const D = p.target;
372
- if (!(typeof ((y = D.dataset) == null ? void 0 : y.index) > "u")) {
373
- if ([...D.classList].includes("row-drag-target")) {
374
- if (k.value = "row", !_.value)
375
- return;
376
- V(p, +D.dataset.index);
377
- }
378
- [...D.classList].includes("editable-table-view-setting-drag-target") && (k.value = "view-setting", U(p, +D.dataset.index));
379
- }
380
- }, E = (p) => {
381
- !s.value || typeof t.value.draggingIndex > "u" || A(p);
382
- }, N = (p) => {
383
- _.value = !1, s.value = !1, !(typeof t.value.draggingIndex > "u") && (k.value === "row" && $(p, a.value), k.value === "view-setting" && K());
384
- }, V = (p, D) => {
385
- if (!b())
386
- return;
387
- const y = [
388
- ...document.getElementsByClassName("custom-row-classname")
389
- ], R = [];
390
- for (let d = 0; d < y.length; d++) {
391
- const u = y[d], C = ([...u.classList].find(
392
- (h) => h.startsWith("custom-row-classname-")
393
- ) ?? "").split("-").pop() ?? "NaN";
394
- typeof +C == "number" && (R[+C] = R[+C] || [], R[+C].push(u));
395
- }
396
- t.value.isDragging = !0, t.value.rowDoms = R, t.value.draggingIndex = +D, t.value.rowsRange = [], t.value.startPosition = {
397
- x: p.clientX,
398
- y: p.clientY
399
- };
400
- const I = e.dragSemiRange ?? 15;
401
- for (const d of Object.keys(R).map(Number)) {
402
- if (d < D - I || d > D + I) {
403
- t.value.rowsRange[d] = void 0;
404
- continue;
405
- }
406
- const u = R[d];
407
- if (u.forEach((h) => h.style.setProperty("position", "relative")), d !== t.value.draggingIndex)
408
- u.forEach(
409
- (h) => h.style.setProperty("transition", "transform 0.25s ease")
410
- );
411
- else {
412
- u.forEach((x) => x.style.setProperty("z-index", "100"));
413
- const h = u.map((x) => x.querySelectorAll("td")).reduce((x, z) => [...x, ...z], []).filter((x) => x.classList.contains("is-hidden"));
414
- t.value.hiddenTds = h, h.forEach((x) => x.classList.remove("is-hidden"));
415
- const L = document.createElement("div");
416
- L.style.position = "fixed", L.style.top = "0", L.style.left = "0", L.style.right = "0", L.style.bottom = "0", L.style.zIndex = "999", L.style.cursor = "grabbing", document.body.appendChild(L), t.value.fullScreenDiv = L;
417
- }
418
- const C = u[0].getBoundingClientRect();
419
- t.value.rowsRange = t.value.rowsRange || [], t.value.rowsRange[d] = [C.top, C.bottom];
420
- }
421
- }, f = (p, D) => {
422
- if (!t.value.rowsRange || typeof t.value.draggingIndex > "u" || typeof e.dragSemiRange > "u")
423
- return;
424
- const y = t.value.draggingIndex - e.dragSemiRange <= 0 ? 0 : t.value.draggingIndex - e.dragSemiRange, R = t.value.draggingIndex + e.dragSemiRange >= t.value.rowsRange.length ? t.value.rowsRange.length - 1 : t.value.draggingIndex + e.dragSemiRange;
425
- if (!p)
426
- return -1;
427
- if (D <= p[y][0])
428
- return y;
429
- if (D >= p[R][1])
430
- return R;
431
- for (let I = y; I <= R; I++) {
432
- const [d, u] = p[I];
433
- if (D > d && D < u)
434
- return I;
435
- }
436
- return -1;
437
- }, m = () => {
438
- var R, I, d;
439
- const p = t.value.rowDoms || [], D = t.value.draggingIndex ?? -1, y = e.dragSemiRange ?? 15;
440
- for (const u of Object.keys(p).map(Number)) {
441
- if (u < D - y || u > D + y)
442
- continue;
443
- p[u].forEach((h) => {
444
- h.style.removeProperty("position"), h.style.removeProperty("transition"), h.style.removeProperty("transform"), h.style.removeProperty("z-index");
445
- });
446
- }
447
- (I = (R = t.value.fullScreenDiv) == null ? void 0 : R.parentNode) == null || I.removeChild(
448
- t.value.fullScreenDiv
449
- ), (d = t.value.hiddenTds) == null || d.forEach(
450
- (u) => u.classList.add("is-hidden")
451
- ), t.value = {}, a.value = null;
452
- }, $ = (p, D) => {
453
- var x, z, Y, ue, ve, ie, ce, Ee, Pe, Ce;
454
- if (!D)
455
- return;
456
- const { draggingIndex: y = 0, dropIndex: R = y } = t.value, I = t.value.rowDoms || [], d = t.value.draggingIndex ?? -1, u = e.dragSemiRange ?? 15;
457
- for (const ge of Object.keys(I).map(Number)) {
458
- if (ge < d - u || ge > d + u)
459
- continue;
460
- I[ge].forEach((se) => {
461
- se.style.removeProperty("position"), se.style.removeProperty("transition"), se.style.removeProperty("transform"), se.style.removeProperty("z-index");
462
- });
463
- }
464
- (x = t.value.fullScreenDiv) != null && x.parentNode && t.value.fullScreenDiv.parentNode.removeChild(
465
- t.value.fullScreenDiv
466
- ), (z = t.value.hiddenTds) == null || z.forEach(
467
- (ge) => ge.classList.add("is-hidden")
468
- ), { ...t.value }, t.value = {}, a.value = null;
469
- const C = ((ve = (ue = (Y = D.store) == null ? void 0 : Y.states) == null ? void 0 : ue.data) == null ? void 0 : ve.value) || ((ce = (ie = D.store) == null ? void 0 : ie.states) == null ? void 0 : ce.data) || [];
470
- if (!Array.isArray(C) || C.length === 0) {
471
- console.warn("无法获取表格数据");
472
- return;
473
- }
474
- const h = C[y];
475
- if (!h) {
476
- console.warn("无法找到拖拽的行数据");
477
- return;
478
- }
479
- const L = [
480
- ...C.slice(0, +y),
481
- ...C.slice(y + 1)
482
- ];
483
- L.splice(R, 0, h), ((Ce = (Pe = (Ee = D.store) == null ? void 0 : Ee.states) == null ? void 0 : Pe.data) == null ? void 0 : Ce.value) !== void 0 ? D.store.states.data.value = L : D.store.states.data = L, i("row-drag-drop", {
484
- row: h,
485
- fromIndex: y,
486
- toIndex: R,
487
- page: o.value,
488
- size: c.value
489
- });
490
- }, U = (p, D) => {
491
- const y = [
492
- ...document.getElementsByClassName(
493
- "editable-table-view-setting-draggable-item"
494
- )
495
- ].reduce((R, I, d) => ({ ...R, [d]: [I] }), {});
496
- t.value.isDragging = !0, t.value.rowDoms = y, t.value.draggingIndex = +D, t.value.startPosition = {
497
- x: p.clientX,
498
- y: p.clientY
499
- };
500
- for (const R of Object.keys(y).map(Number)) {
501
- const I = y[R];
502
- I.forEach((u) => {
503
- u.style.setProperty("position", "relative");
504
- }), R !== t.value.draggingIndex && I.forEach(
505
- (u) => u.style.setProperty("transition", "transform 0.25s ease")
506
- );
507
- const d = I[0].getBoundingClientRect();
508
- t.value.rowsRange = t.value.rowsRange || [], t.value.rowsRange.push([d.top, d.bottom]);
509
- }
510
- }, H = (p) => {
511
- if (!t.value.isDragging)
512
- return;
513
- const { y: D = 0 } = t.value.startPosition || {}, { draggingIndex: y = -1, rowDoms: R = {} } = t.value, I = R == null ? void 0 : R[y ?? 0];
514
- for (let x = 0; x < I.length; x++) {
515
- const z = I[x];
516
- z == null || z.style.setProperty("transform", `translateY(${p.clientY - D}px)`);
517
- }
518
- const d = f(
519
- t.value.rowsRange,
520
- p.clientY
521
- );
522
- if (typeof d != "number")
523
- return;
524
- const [u, C] = t.value.rowsRange[y];
525
- t.value.dropIndex = d;
526
- const h = C - u, L = e.dragSemiRange ?? 15;
527
- for (const x of Object.keys(R).map(Number)) {
528
- if (x < y - L || x > y + L || y === x)
529
- continue;
530
- const z = R[x];
531
- d < y ? x >= d && x < y ? z.forEach(
532
- (Y) => Y.style.setProperty("transform", `translateY(${h}px)`)
533
- ) : z.forEach((Y) => Y.style.removeProperty("transform")) : d > y ? x <= d && x > y ? z.forEach(
534
- (Y) => Y.style.setProperty("transform", `translateY(${-h}px)`)
535
- ) : z.forEach((Y) => Y.style.removeProperty("transform")) : z.forEach((Y) => Y.style.removeProperty("transform"));
536
- }
537
- }, K = () => {
538
- const { draggingIndex: p = 0, dropIndex: D = p } = t.value, y = l.value[p], R = [
539
- ...l.value.slice(0, p),
540
- ...l.value.slice(p + 1)
541
- ];
542
- R.splice(D, 0, y), l.value = R, m();
543
- }, A = at(H, 10);
544
- }
545
- function nt({ colorList: e, emit: i }) {
546
- const l = (a) => {
547
- var n;
548
- return a ? (n = e.find((t) => +t.id == +a)) == null ? void 0 : n.default : !0;
549
- }, o = (a, n = "bg") => {
550
- var t;
551
- return ((t = e.find((s) => +s.id == +a)) == null ? void 0 : t[`${n}Color`]) || "";
552
- };
553
- return {
554
- isDefaultColor: l,
555
- getColorById: o,
556
- setRowStyle: (a) => {
557
- const n = a.row;
558
- return {
559
- backgroundColor: n.__static_bg_color__ ?? (n.colorId ? o(n.colorId) : "")
560
- };
561
- },
562
- handleColorChange: async (a, n) => {
563
- const { row: t, $index: s } = n;
564
- t && (t.colorId = +a), i("row-bg-change", {
565
- colorId: +a,
566
- row: t,
567
- rowIndex: s
568
- });
569
- }
570
- };
571
- }
572
- function Ko(e) {
573
- const i = M({ rowIndex: -1, columnProperty: "" }), l = M(!1);
574
- Ye(() => {
575
- e.value.$el.addEventListener("mouseleave", c), document.addEventListener("wheel", n);
576
- }), Xe(() => {
577
- e.value.$el.removeEventListener("mouseleave", c), document.removeEventListener("wheel", n);
578
- });
579
- const o = ({ column: k, rowIndex: _ }) => k.property ? `hoving-cell-(${k.property})-(${_})` : "", c = () => {
580
- i.value = {
581
- rowIndex: -1,
582
- columnProperty: ""
583
- };
584
- };
585
- let b = null;
586
- const n = at(() => {
587
- l.value = !0, clearTimeout(b), b = setTimeout(() => {
588
- l.value = !1;
589
- }, 100);
590
- }, 50), s = Bo((k, _, S, E) => {
591
- var m;
592
- if (l.value)
593
- return;
594
- let N = E.target, V = "";
595
- for (; N && N !== ((m = e.value) == null ? void 0 : m.$el); ) {
596
- const $ = [...N.classList].find((U) => /hoving-cell-\(\w+\)-\(\d+\)/.test(U));
597
- if ($) {
598
- V = $;
599
- break;
600
- }
601
- N = N.parentElement;
602
- }
603
- if (!V)
604
- return;
605
- const f = V.match(/hoving-cell-\((\w+)\)-\((\d+)\)/);
606
- !f || f.length < 3 || (i.value = {
607
- rowIndex: +f[2],
608
- columnProperty: f[1]
609
- });
610
- }, 10);
611
- return {
612
- hoveringCellInfo: i,
613
- setCellClassName: o,
614
- debouncedHoverHandler: s
615
- };
616
- }
617
- function Yo({ emit: e, pageSize: i, props: l, tableDomRef: o, hasExpandRow: c }) {
618
- const b = M(null), a = M({}), n = M(-1), t = (V, f) => {
619
- e("row-delete", {
620
- row: V,
621
- index: f,
622
- page: l.currentPage,
623
- size: i.value
624
- }), s();
625
- }, s = () => {
626
- var V;
627
- (V = b.value) == null || V.forEach((f) => f == null ? void 0 : f.doClose());
628
- }, k = () => {
629
- var V;
630
- c && ((V = o.value) == null || V.data.forEach((f) => {
631
- var m;
632
- (m = o.value) == null || m.toggleRowExpansion(f, !1);
633
- }));
634
- };
635
- return {
636
- operationPopoverRef: b,
637
- editingRowData: a,
638
- editingRowIndex: n,
639
- handleDelete: t,
640
- closeAllExpandedRows: k,
641
- handleEdit: (V) => {
642
- k();
643
- const { row: f, $index: m } = V;
644
- a.value = { ...f }, n.value = m, e("row-edit", { row: f, index: m, page: l.currentPage, size: i.value }), s();
645
- },
646
- handleEditSave: (V) => {
647
- n.value = -1;
648
- const f = {};
649
- for (const m of Object.keys(V))
650
- V[m] !== a.value[m] && (f[m] = a.value[m]);
651
- e("row-edit-save", {
652
- page: l.currentPage,
653
- size: i.value,
654
- row: V,
655
- changedData: f
656
- }), a.value = {};
657
- },
658
- handleEditCancel: (V) => {
659
- n.value = -1, a.value = {}, e("row-edit-cancel", { row: V, page: l.currentPage, size: i.value });
660
- },
661
- handleRowPinToTop: (V) => {
662
- var K, A, p, D, y;
663
- const { row: f, $index: m, store: $ } = V, U = ((A = (K = $ == null ? void 0 : $.states) == null ? void 0 : K.data) == null ? void 0 : A.value) || ((p = $ == null ? void 0 : $.states) == null ? void 0 : p.data) || [];
664
- if (!Array.isArray(U) || U.length === 0) {
665
- console.warn("无法获取表格数据");
666
- return;
667
- }
668
- const H = [
669
- ...U.slice(0, m),
670
- ...U.slice(m + 1)
671
- ];
672
- H.unshift({ ...f, isPinned: !0 }), ((y = (D = $ == null ? void 0 : $.states) == null ? void 0 : D.data) == null ? void 0 : y.value) !== void 0 ? $.states.data.value = H : $.states.data = H, e("row-pin-to-top", { row: f, rawIndex: m, page: l.currentPage, size: i.value }), s();
673
- }
674
- };
675
- }
676
- function Xo({
677
- props: e,
678
- tableDomRef: i,
679
- emit: l,
680
- showingColumns: o
681
- }) {
682
- const c = M(!1), b = M(null), a = M(""), n = M(""), t = M(""), s = M({}), k = M({}), _ = M([]), S = M([]), E = oe(() => Object.keys(k.value).some((d) => {
683
- const u = k.value[d];
684
- return Array.isArray(u) ? u.length : u;
685
- })), N = ({
686
- isColumnSortable: d,
687
- filters: u
688
- }) => d || u && Array.isArray(u) && u.length > 0;
689
- be(
690
- () => e.columnConfig,
691
- (d) => {
692
- d == null || d.forEach((u) => y(u)), k.value = { ...s.value };
693
- },
694
- { immediate: !0 }
695
- );
696
- const V = (d) => {
697
- const { columns: u, data: C } = d, h = [];
698
- return u.forEach((L, x) => {
699
- var z, Y;
700
- if (x === 0) {
701
- h[x] = "合计";
702
- return;
703
- }
704
- if (!S.value.includes(L.property))
705
- h[x] = "";
706
- else {
707
- const ue = C.map((ce) => ce[L.property]), ie = (((Y = (z = e.columnConfig) == null ? void 0 : z.find((ce) => ce.prop === L.property)) == null ? void 0 : Y.summaryMethod) ?? (() => ""))(ue);
708
- h[x] = typeof ie == "number" ? String(ie) : ie;
709
- }
710
- }), h;
711
- }, f = ({ prop: d, filters: u, _sortable: C }) => {
712
- const L = u && Array.isArray(u) && u.length > 0 && (u == null ? void 0 : u.some((z) => {
713
- var Y;
714
- if (z.type === "dateRange") {
715
- const [ue, ve] = z.prop;
716
- return !!(s.value[ue] || s.value[ve]);
717
- }
718
- return z.type === "select" && z.multiple ? !!((Y = s.value[z.prop]) != null && Y.length) : z.type === "slot" ? typeof z.isActive == "function" && z.isActive() : !!s.value[z.prop];
719
- })), x = Array.isArray(C) ? C.some((z) => z.prop === a.value) : a.value === d;
720
- return L || x || S.value.includes(d);
721
- }, m = (d) => {
722
- $(d.prop), k.value = { ...s.value }, n.value = b.value || "", t.value = a.value || "", _.value = [...S.value];
723
- }, $ = (d) => {
724
- document.querySelectorAll("span[data-popper-name]").forEach((u) => {
725
- var C, h;
726
- (!d || d !== u.dataset.prop) && ((h = (C = u == null ? void 0 : u.__vue__) == null ? void 0 : C.doClose) == null || h.call(C));
727
- });
728
- }, U = (d, u) => {
729
- n.value = d, t.value = u;
730
- }, H = oe(() => {
731
- var u;
732
- const d = {};
733
- return (u = e.columnConfig) == null || u.forEach((C) => {
734
- d[C.prop] = C;
735
- }), d;
736
- }), K = () => {
737
- const d = {}, u = (C) => {
738
- C.filter(
739
- (h) => h.type !== "slot"
740
- ).forEach((h) => {
741
- if (h.type === "dateRange") {
742
- const [L, x] = h.prop;
743
- d[L] = s.value[L], d[x] = s.value[x];
744
- } else
745
- d[h.prop] = s.value[h.prop];
746
- });
747
- };
748
- if (o.value.forEach((C) => {
749
- const { filters: h = [] } = H.value[C];
750
- u(h);
751
- }), e.colorFilterConfig) {
752
- const { filters: C = [] } = e.colorFilterConfig;
753
- u(C);
754
- }
755
- Object.keys(d).forEach((C) => {
756
- d[C] === void 0 && delete d[C];
757
- }), l("search", {
758
- ...d,
759
- page: 1
760
- });
761
- }, A = async (d) => {
762
- var h, L;
763
- const u = (d.filters ?? []).filter(
764
- (x) => x.type === "input"
765
- );
766
- u.some(
767
- (x) => x.validator && !x.validator(k.value[x.prop].trim())
768
- ) || (u.forEach((x) => {
769
- k.value[x.prop] || (k.value[x.prop] = "");
770
- }), S.value = [..._.value], a.value = t.value || "", b.value = n.value || null, a.value && (e.localSort ? (c.value = !0, await _e(), (h = i.value) == null || h.sort(a.value, b.value), c.value = !1) : l("sort-change", { order: b.value, prop: a.value })), s.value = { ...k.value }, K(), $(), await _e(), (L = i.value) == null || L.doLayout());
771
- }, p = () => {
772
- var d;
773
- a.value = "", b.value = null, e.localSort ? (d = i.value) == null || d.clearSort() : l("sort-change", { order: null, prop: "" });
774
- }, D = (d) => {
775
- var C, h;
776
- ((C = e.columnConfig) == null ? void 0 : C.find(
777
- (L) => Array.isArray(L.sortable) ? L.sortable.some((x) => x.prop === d.prop) : L.prop === d.prop
778
- )) && (a.value = d.prop, b.value = d.order, e.localSort && ((h = i.value) == null || h.sort(d.prop, d.order)));
779
- };
780
- function y(d) {
781
- (d.filters || []).filter(
782
- (u) => u.type !== "slot"
783
- ).forEach((u) => {
784
- if (u.type === "select")
785
- u.defaultValue ? s.value[u.prop] = u.defaultValue : s.value[u.prop] = u.multiple ? [] : "";
786
- else if (u.type === "dateRange") {
787
- const [C, h] = u.prop;
788
- s.value[C] = "", s.value[h] = "";
789
- } else
790
- s.value[u.prop] = "";
791
- });
792
- }
793
- return {
794
- setSort: D,
795
- clearSort: p,
796
- setSearchParams: (d) => {
797
- const u = {};
798
- [e.colorFilterConfig, ...e.columnConfig ?? []].forEach(
799
- (C) => {
800
- ((C == null ? void 0 : C.filters) ?? []).filter(
801
- (h) => h.type !== "slot"
802
- ).forEach((h) => {
803
- if (h.type === "dateRange") {
804
- const [L, x] = h.prop;
805
- u[L] = d[L], u[x] = d[x];
806
- } else
807
- h.type === "select" && h.multiple ? u[h.prop] = d[h.prop] ?? h.defaultValue ?? [] : u[h.prop] = d[h.prop] ?? "";
808
- });
809
- }
810
- ), s.value = { ...s.value, ...u };
811
- },
812
- isColumnHeadActive: f,
813
- handleHeaderPopoverShow: m,
814
- handleSort: U,
815
- handleHeaderOperationConfirm: A,
816
- handleHeaderOperationReset: async (d) => {
817
- var u;
818
- a.value && (Array.isArray(d._sortable) ? d._sortable.some((C) => C.prop === a.value) : a.value === d.prop) && p(), S.value = S.value.filter(
819
- (C) => C !== d.prop
820
- ), y(d), K(), $(), await _e(), (u = i.value) == null || u.doLayout();
821
- },
822
- summaryList: S,
823
- tableSummaryMethod: V,
824
- filteredValue: s,
825
- showColumnHeadSortIcon: N,
826
- tempSortProp: t,
827
- tempFilteredValue: k,
828
- tempSummaryList: _,
829
- tempSortType: n,
830
- sortProp: a,
831
- isColumnFiltering: E,
832
- inSorting: c
833
- };
834
- }
835
- const Te = {
836
- 0: {
837
- migration: (e, i) => ({
838
- config: {
839
- fields: i.reduce((l, o) => (l[o.prop] = {
840
- hidden: !e.showingColumns.find((c) => c === o.prop),
841
- order: e.showingColumns.findIndex((c) => c === o.prop) ?? 0
842
- }, l), {}),
843
- leftFixedColumnCount: e.leftFixedColumnCount
844
- },
845
- schemaVersion: 1
846
- }),
847
- nextSchemaVersion: 1
848
- }
849
- };
850
- function lt({
851
- showingColumns: e,
852
- actualColumns: i,
853
- props: l,
854
- viewSettingDragSortOptions: o,
855
- emit: c
856
- }) {
857
- const b = M([]), a = M(!1), n = M(0), t = M(0), s = (f) => c("update:showingColumns", f), k = oe(
858
- () => `@lx-frontend/wrap-element-ui/table_setting_cloumns/${l.settingStorgeKey || (location.pathname === "/" ? location.hash : location.pathname)}`
859
- ), _ = async () => {
860
- await _e();
861
- const f = l.settingStorgeMigrationConfigs ?? [], m = f.length, $ = m ? f[m - 1].version.to : void 0;
862
- localStorage.setItem(
863
- k.value,
864
- JSON.stringify({
865
- config: {
866
- fields: l.columnConfig.reduce((U, H, K) => {
867
- const A = e.value.findIndex(
868
- (p) => p === H.prop
869
- );
870
- return U[H.prop] = {
871
- hidden: !e.value.find((p) => p === H.prop),
872
- order: A === -1 ? K : A
873
- }, U;
874
- }, {}),
875
- leftFixedColumnCount: n.value
876
- },
877
- version: $,
878
- schemaVersion: 1
879
- })
880
- );
881
- }, S = () => {
882
- c("update:viewSettingDragSortOptions", [
883
- ...i.value.filter((f) => (f == null ? void 0 : f.prop) !== "$$operation")
884
- ]), t.value = n.value, a.value = !0, b.value = [...e.value];
885
- }, E = () => {
886
- a.value = !1;
887
- }, N = async () => {
888
- a.value = !1, s(o.value.map((f) => f.prop)), n.value = t.value, await _(), c("tableDoLayout");
889
- }, V = (f) => {
890
- const m = Number(f);
891
- isNaN(m) || (t.value = Math.max(
892
- 0,
893
- Math.min(b.value.length, Math.floor(m))
894
- ));
895
- };
896
- return be(
897
- () => l.columnConfig,
898
- async (f) => {
899
- var U;
900
- const m = localStorage.getItem(k.value), $ = () => s(
901
- f.filter((H) => !H.defaultHide).map((H) => H.prop)
902
- );
903
- if (!m)
904
- $(), n.value = l.leftFixedCount;
905
- else
906
- try {
907
- const H = (p) => {
908
- const D = (p == null ? void 0 : p.schemaVersion) ?? 0;
909
- if (Te[D]) {
910
- let y = Te[D].migration(p, f);
911
- const R = (l.settingStorgeMigrationConfigs ?? []).filter((I) => (I.schemaVersion ?? 1) === y.schemaVersion);
912
- return R.length && (y = R.reduce(
913
- (I, d) => ({
914
- ...d.migration(I.config, f),
915
- schemaVersion: y.schemaVersion
916
- }),
917
- y
918
- )), Te[D].nextSchemaVersion ? H(y) : y;
919
- } else {
920
- const y = (l.settingStorgeMigrationConfigs ?? []).filter((I) => (I.schemaVersion ?? 1) === p.schemaVersion), R = y.findIndex(
921
- (I) => I.version.form === p.version
922
- );
923
- if (R > -1)
924
- for (let I = R; I < y.length; I++)
925
- p = y[I].migration(p.config, f);
926
- return p;
927
- }
928
- }, K = H(
929
- JSON.parse(m)
930
- );
931
- s(
932
- f.filter((p) => K.config.fields[p.prop] ? !K.config.fields[p.prop].hidden : !p.defaultHide).sort((p, D) => {
933
- var y, R;
934
- return (((y = K.config.fields[p.prop]) == null ? void 0 : y.order) ?? 0) - (((R = K.config.fields[D.prop]) == null ? void 0 : R.order) ?? 0);
935
- }).map((p) => p.prop)
936
- );
937
- const A = Number(
938
- (U = K == null ? void 0 : K.config) == null ? void 0 : U.leftFixedColumnCount
939
- );
940
- n.value = isNaN(A) ? l.leftFixedCount : A, _();
941
- } catch (H) {
942
- console.error(H), localStorage.removeItem(k.value), $();
943
- }
944
- },
945
- { immediate: !0 }
946
- ), be(
947
- b,
948
- (f, m) => {
949
- if (f.length === (m == null ? void 0 : m.length))
950
- return;
951
- const $ = /* @__PURE__ */ new Map();
952
- l.columnConfig.forEach((U) => $.set(U.prop, U)), c(
953
- "update:viewSettingDragSortOptions",
954
- f.map((U) => $.get(U))
955
- ), t.value > f.length && (t.value = f.length);
956
- },
957
- { immediate: !0 }
958
- ), be(
959
- o,
960
- (f, m) => {
961
- !f.length || f.length !== (m == null ? void 0 : m.length) || (b.value = f.map(($) => $.prop));
962
- },
963
- { deep: !0 }
964
- ), be(
965
- n,
966
- (f) => c("update:leftFixedColumnCount", f),
967
- { immediate: !0 }
968
- ), {
969
- columnsToBeShown: b,
970
- viewSettingVisible: a,
971
- leftFixedColumnCount: n,
972
- tempLeftFixedColumnCount: t,
973
- handleInputTempLeftFixedColumnCount: V,
974
- handleViewSettingShow: S,
975
- handleViewSettingClose: E,
976
- handleViewSettingConfirm: N
977
- };
978
- }
979
- const qo = { class: "editable-table-view-setting__content" }, Jo = { class: "editable-table-view-setting__content-left" }, Qo = { class: "editable-table-view-setting__checkbox-wrapper" }, Zo = { class: "editable-table-view-setting__content-left-item" }, ea = { class: "editable-table-view-setting__content-right" }, ta = { class: "editable-table-view-setting__content-right-title" }, oa = { class: "editable-table-view-setting__selected-count" }, aa = { class: "editable-table-view-setting__content-right-frize" }, na = { class: "editable-table-view-setting__content-right-selected" }, la = { class: "editable-table-view-setting__selected-item-left" }, ra = ["data-index"], ia = ["data-index"], sa = { class: "editable-table-view-setting__selected-item-name" }, da = ["onClick"], ua = /* @__PURE__ */ le({
980
- __name: "bizViewSettingDialog",
981
- props: {
982
- actualColumns: {},
983
- viewSettingDragSortOptions: {},
984
- showingColumns: {},
985
- props: {}
986
- },
987
- emits: ["update:leftFixedColumnCount", "update:showingColumns", "update:viewSettingDragSortOptions", "tableDoLayout"],
988
- setup(e, { expose: i, emit: l }) {
989
- const o = l, c = e, { actualColumns: b, showingColumns: a, viewSettingDragSortOptions: n } = Ve(c), {
990
- columnsToBeShown: t,
991
- viewSettingVisible: s,
992
- tempLeftFixedColumnCount: k,
993
- handleInputTempLeftFixedColumnCount: _,
994
- handleViewSettingShow: S,
995
- handleViewSettingClose: E,
996
- handleViewSettingConfirm: N
997
- } = lt({
998
- showingColumns: a,
999
- actualColumns: b,
1000
- viewSettingDragSortOptions: n,
1001
- props: c.props,
1002
- emit: o
1003
- }), V = (f) => {
1004
- f.alwaysShow || f.isAlwaysShow || (t.value = t.value.filter(
1005
- (m) => m !== f.prop
1006
- ));
1007
- };
1008
- return i({
1009
- open: S
1010
- }), (f, m) => (g(), G(r(Et), {
1011
- title: "显示设置",
1012
- modelValue: r(s),
1013
- "onUpdate:modelValue": m[1] || (m[1] = ($) => $e(s) ? s.value = $ : null),
1014
- width: "750px",
1015
- top: "12vh",
1016
- "close-on-click-modal": !1,
1017
- modal: !0,
1018
- "modal-append-to-body": !0,
1019
- "append-to-body": "",
1020
- "destroy-on-close": "",
1021
- "custom-class": "editable-table-view-setting__dialog"
1022
- }, {
1023
- footer: T(() => [
1024
- j(r(we), { onClick: r(E) }, {
1025
- default: T(() => [...m[5] || (m[5] = [
1026
- X(" 取消 ", -1)
1027
- ])]),
1028
- _: 1
1029
- }, 8, ["onClick"]),
1030
- j(r(we), {
1031
- type: "primary",
1032
- onClick: r(N)
1033
- }, {
1034
- default: T(() => [...m[6] || (m[6] = [
1035
- X(" 确认 ", -1)
1036
- ])]),
1037
- _: 1
1038
- }, 8, ["onClick"])
1039
- ]),
1040
- default: T(() => [
1041
- F("div", qo, [
1042
- F("div", Jo, [
1043
- F("div", Qo, [
1044
- j(r(Pt), {
1045
- modelValue: r(t),
1046
- "onUpdate:modelValue": m[0] || (m[0] = ($) => $e(t) ? t.value = $ : null)
1047
- }, {
1048
- default: T(() => [
1049
- (g(!0), O(J, null, re(e.props.columnConfig, ($) => (g(), G(r(Dt), {
1050
- key: $.label,
1051
- label: $.prop,
1052
- disabled: $.alwaysShow || $.isAlwaysShow
1053
- }, {
1054
- default: T(() => [
1055
- F("div", Zo, q($.label), 1)
1056
- ]),
1057
- _: 2
1058
- }, 1032, ["label", "disabled"]))), 128))
1059
- ]),
1060
- _: 1
1061
- }, 8, ["modelValue"])
1062
- ])
1063
- ]),
1064
- F("div", ea, [
1065
- F("div", ta, [
1066
- m[2] || (m[2] = X(" 已选择 ", -1)),
1067
- F("div", oa, q(r(t).length), 1)
1068
- ]),
1069
- F("div", aa, [
1070
- m[3] || (m[3] = X(" 冻结前 ", -1)),
1071
- j(r(qe), {
1072
- class: "editable-table-view-setting__content-right-input",
1073
- value: r(k),
1074
- onInput: r(_)
1075
- }, null, 8, ["value", "onInput"]),
1076
- m[4] || (m[4] = X(" 列 ", -1))
1077
- ]),
1078
- F("div", na, [
1079
- (g(!0), O(J, null, re(r(n), ($, U) => (g(), O("div", {
1080
- key: $.prop,
1081
- class: "editable-table-view-setting__selected-item editable-table-view-setting-draggable-item"
1082
- }, [
1083
- F("div", la, [
1084
- F("div", {
1085
- class: "editable-table-view-setting-drag-target editable-table-view-setting__icon-wrapper",
1086
- "data-index": U
1087
- }, [
1088
- F("div", {
1089
- class: "editable-table-view-setting-drag-target editable-table-drag-icon",
1090
- "data-index": U
1091
- }, null, 8, ia)
1092
- ], 8, ra),
1093
- F("div", sa, q($.label), 1)
1094
- ]),
1095
- F("div", {
1096
- class: Se([
1097
- "editable-table-view-setting__selected-item-close",
1098
- $.alwaysShow || $.isAlwaysShow ? "editable-table-view-setting__selected-item-close--disabled" : ""
1099
- ]),
1100
- onClick: (H) => V($)
1101
- }, [
1102
- j(r(Je), null, {
1103
- default: T(() => [
1104
- j(r(It))
1105
- ]),
1106
- _: 1
1107
- })
1108
- ], 10, da)
1109
- ]))), 128))
1110
- ])
1111
- ])
1112
- ])
1113
- ]),
1114
- _: 1
1115
- }, 8, ["modelValue"]));
1116
- }
1117
- }), ca = { class: "color-list" }, pa = ["onClick"], fa = {
1118
- key: 0,
1119
- class: "editable-table__color-icon"
1120
- }, va = /* @__PURE__ */ le({
1121
- __name: "bizColorSelect",
1122
- props: {
1123
- colorList: {},
1124
- scope: {}
1125
- },
1126
- emits: ["row-bg-change"],
1127
- setup(e, { emit: i }) {
1128
- const l = e, o = i, { getColorById: c, isDefaultColor: b, handleColorChange: a } = nt({
1129
- colorList: l.colorList,
1130
- emit: o
1131
- }), n = M(!1), t = (s) => {
1132
- n.value = !1, a(s, l.scope);
1133
- };
1134
- return (s, k) => {
1135
- const _ = Z("el-popover");
1136
- return g(), G(_, {
1137
- visible: n.value,
1138
- placement: "right",
1139
- trigger: "click",
1140
- "popper-class": "editable-table-color-popover",
1141
- "onUpdate:visible": k[0] || (k[0] = (S) => n.value = S)
1142
- }, {
1143
- reference: T(() => [
1144
- r(b)(e.scope.row.colorId) ? (g(), O("div", fa)) : (g(), O("div", {
1145
- key: 1,
1146
- class: "editable-table__selected-color",
1147
- style: ke({ backgroundColor: r(c)(e.scope.row.colorId, "sample") })
1148
- }, null, 4))
1149
- ]),
1150
- default: T(() => [
1151
- F("div", ca, [
1152
- (g(!0), O(J, null, re(e.colorList, (S) => (g(), O("div", {
1153
- key: S.id,
1154
- class: "color-list__item",
1155
- style: ke({ backgroundColor: S.sampleColor }),
1156
- onClick: (E) => t(S.id)
1157
- }, [
1158
- F("span", {
1159
- style: ke({ color: S.textColor })
1160
- }, q(S.name), 5)
1161
- ], 12, pa))), 128))
1162
- ])
1163
- ]),
1164
- _: 1
1165
- }, 8, ["visible"]);
1166
- };
1167
- }
1168
- });
1169
- const ga = { class: "editable-table-sort-filter__filter" }, ma = { class: "editable-table-sort-filter__filter-title" }, ba = /* @__PURE__ */ le({
1170
- __name: "BizCheckboxFilter",
1171
- props: {
1172
- config: {},
1173
- tempFilteredValue: {}
1174
- },
1175
- emits: ["update:tempFilteredValue"],
1176
- setup(e, { emit: i }) {
1177
- const l = i;
1178
- return (o, c) => {
1179
- const b = Z("el-checkbox"), a = Z("el-checkbox-group");
1180
- return g(), O("div", ga, [
1181
- F("div", ma, q(e.config.label || "筛选"), 1),
1182
- j(a, {
1183
- class: "editable-table-sort-filter__filter-checkbox-group",
1184
- value: e.tempFilteredValue[e.config.prop],
1185
- onInput: c[0] || (c[0] = (n) => l("update:tempFilteredValue", e.config.prop, n))
1186
- }, {
1187
- default: T(() => [
1188
- (g(!0), O(J, null, re(e.config.options, (n) => (g(), G(b, {
1189
- key: n.value,
1190
- label: n.value,
1191
- title: n.text,
1192
- class: "editable-table-sort-filter__filter-checkbox"
1193
- }, {
1194
- default: T(() => [
1195
- X(q(n.text), 1)
1196
- ]),
1197
- _: 2
1198
- }, 1032, ["label", "title"]))), 128))
1199
- ]),
1200
- _: 1
1201
- }, 8, ["value"])
1202
- ]);
1203
- };
1204
- }
1205
- }), ya = { class: "editable-table-sort-filter__filter" }, ha = { class: "editable-table-sort-filter__filter-title" }, _a = { class: "color-option" }, wa = /* @__PURE__ */ le({
1206
- __name: "BizColorRadioFilter",
1207
- props: {
1208
- config: {},
1209
- tempFilteredValue: {}
1210
- },
1211
- emits: ["update:tempFilteredValue"],
1212
- setup(e, { emit: i }) {
1213
- const l = i;
1214
- return (o, c) => {
1215
- const b = Z("el-radio"), a = Z("el-radio-group");
1216
- return g(), O("div", ya, [
1217
- F("div", ha, q(e.config.label || "筛选"), 1),
1218
- j(a, {
1219
- style: { display: "flex", "flex-direction": "column", gap: "6px" },
1220
- value: e.tempFilteredValue[e.config.prop],
1221
- onInput: c[0] || (c[0] = (n) => l("update:tempFilteredValue", e.config.prop, n))
1222
- }, {
1223
- default: T(() => [
1224
- (g(!0), O(J, null, re(e.config.options, (n) => (g(), G(b, {
1225
- key: n.value,
1226
- label: n.value,
1227
- title: n.text
1228
- }, {
1229
- default: T(() => [
1230
- F("span", _a, [
1231
- F("span", {
1232
- class: "icon",
1233
- style: ke({ background: n.color })
1234
- }, null, 4),
1235
- F("span", null, q(n.text), 1)
1236
- ])
1237
- ]),
1238
- _: 2
1239
- }, 1032, ["label", "title"]))), 128))
1240
- ]),
1241
- _: 1
1242
- }, 8, ["value"])
1243
- ]);
1244
- };
1245
- }
1246
- });
1247
- const rt = (e, i) => {
1248
- const l = e.__vccOpts || e;
1249
- for (const [o, c] of i)
1250
- l[o] = c;
1251
- return l;
1252
- }, Sa = /* @__PURE__ */ rt(wa, [["__scopeId", "data-v-d071ae2e"]]);
1253
- function He(e, i = 0) {
1254
- return {
1255
- disabledDate: (l) => {
1256
- if (!e)
1257
- return !1;
1258
- const o = fe(l), c = o.isAfter(fe(e), "day");
1259
- return i ? c || o.isBefore(fe(e).subtract(i - 1, "day"), "day") : c;
1260
- }
1261
- };
1262
- }
1263
- function We(e, i = 0) {
1264
- return {
1265
- disabledDate: (l) => {
1266
- if (!e)
1267
- return !1;
1268
- const o = fe(l), c = o.isBefore(fe(e), "day");
1269
- return i ? c || o.isAfter(fe(e).add(i - 1, "day"), "day") : c;
1270
- }
1271
- };
1272
- }
1273
- const Ca = { class: "editable-table-sort-filter__sort" }, xa = { class: "editable-table-sort-filter__search-title" }, ka = { class: "editable-table-sort-filter__date-picker-content" }, $a = /* @__PURE__ */ le({
1274
- __name: "BizDoubleDatePickerFilter",
1275
- props: {
1276
- config: {},
1277
- tempFilteredValue: {}
1278
- },
1279
- emits: ["update:tempFilteredValue"],
1280
- setup(e, { emit: i }) {
1281
- const l = e, { config: o, tempFilteredValue: c } = Ve(l), b = i, a = {
1282
- valueFormat: "yyyy-MM-dd",
1283
- format: "yyyy-MM-dd",
1284
- type: "date",
1285
- size: "small",
1286
- editable: !1
1287
- }, n = oe(() => {
1288
- var _;
1289
- return "pickerOptions" in o.value && ((_ = o.value.pickerOptions) != null && _.start) ? o.value.pickerOptions.start : "limit" in o.value ? He(
1290
- c.value[o.value.prop[1]],
1291
- o.value.limit
1292
- ) : He(
1293
- c.value[o.value.prop[1]]
1294
- );
1295
- }), t = oe(() => {
1296
- var _;
1297
- return "pickerOptions" in o.value && ((_ = o.value.pickerOptions) != null && _.end) ? o.value.pickerOptions.end : "limit" in o.value ? We(
1298
- c.value[o.value.prop[0]],
1299
- o.value.limit
1300
- ) : We(
1301
- c.value[o.value.prop[0]]
1302
- );
1303
- }), s = (_) => {
1304
- b("update:tempFilteredValue", o.value.prop[0], _ || "");
1305
- }, k = (_) => {
1306
- b("update:tempFilteredValue", o.value.prop[1], _ || "");
1307
- };
1308
- return (_, S) => {
1309
- const E = Z("el-date-picker");
1310
- return g(), O("div", Ca, [
1311
- F("div", xa, q(r(o).label || "筛选"), 1),
1312
- F("div", ka, [
1313
- j(E, de(a, {
1314
- placeholder: "开始日期",
1315
- value: r(c)[r(o).prop[0]],
1316
- "picker-options": n.value,
1317
- onInput: s
1318
- }), null, 16, ["value", "picker-options"]),
1319
- j(E, de(a, {
1320
- placeholder: "结束日期",
1321
- value: r(c)[r(o).prop[1]],
1322
- "picker-options": t.value,
1323
- onInput: k
1324
- }), null, 16, ["value", "picker-options"])
1325
- ])
1326
- ]);
1327
- };
1328
- }
1329
- }), Ea = { class: "editable-table-sort-filter__search" }, Pa = { class: "editable-table-sort-filter__search-title" }, Da = /* @__PURE__ */ le({
1330
- __name: "BizInputFilter",
1331
- props: {
1332
- config: {},
1333
- tempFilteredValue: {}
1334
- },
1335
- emits: ["update:tempFilteredValue"],
1336
- setup(e, { emit: i }) {
1337
- const l = i;
1338
- return (o, c) => {
1339
- const b = Z("el-input");
1340
- return g(), O("div", Ea, [
1341
- F("div", Pa, q(e.config.label || "搜索"), 1),
1342
- j(b, {
1343
- class: "editable-table-sort-filter__search-input",
1344
- placeholder: e.config.placeholder || "请输入内容",
1345
- value: e.tempFilteredValue[e.config.prop],
1346
- onInput: c[0] || (c[0] = (a) => l("update:tempFilteredValue", e.config.prop, a))
1347
- }, null, 8, ["placeholder", "value"])
1348
- ]);
1349
- };
1350
- }
1351
- }), Ra = [
1352
- { month: 1, day: 31 },
1353
- { month: 2, day: 29 },
1354
- { month: 3, day: 31 },
1355
- { month: 4, day: 30 },
1356
- { month: 5, day: 31 },
1357
- { month: 6, day: 30 },
1358
- { month: 7, day: 31 },
1359
- { month: 8, day: 31 },
1360
- { month: 9, day: 30 },
1361
- { month: 10, day: 31 },
1362
- { month: 11, day: 30 },
1363
- { month: 12, day: 31 }
1364
- ];
1365
- function Fe() {
1366
- return Ra.map(
1367
- (e) => ({
1368
- value: e.month.toString(),
1369
- label: `${e.month}月`,
1370
- children: Array.from(
1371
- { length: e.day },
1372
- (i, l) => ({ value: `${l + 1}`, label: `${l + 1}日` })
1373
- )
1374
- })
1375
- );
1376
- }
1377
- function Ge({
1378
- date: e = [],
1379
- isStartDate: i = !1,
1380
- digits: l = 3
1381
- }) {
1382
- return Fe().map(
1383
- (a) => {
1384
- const n = a.children.map(
1385
- (s) => {
1386
- const k = fe([2024, a.value, s.value].join("-"));
1387
- let _ = !1;
1388
- if (e.length > 0) {
1389
- const S = fe([2024, ...e].join("-"));
1390
- if (i) {
1391
- const E = S.add(l * 30 - 1, "day");
1392
- E.year() > 2024 ? _ = k.isAfter(E.subtract(366, "day"), "day") && k.isBefore(S, "day") : _ = k.isAfter(E, "day") || k.isBefore(S, "day");
1393
- } else {
1394
- const E = S.subtract(l * 30 - 1, "day");
1395
- E.year() < 2024 ? _ = k.isBefore(E.add(366, "day"), "day") && k.isAfter(S, "day") : _ = k.isBefore(E, "day") || k.isAfter(S, "day");
1396
- }
1397
- }
1398
- return {
1399
- ...s,
1400
- disabled: _
1401
- };
1402
- }
1403
- ), t = n.every((s) => s.disabled);
1404
- return {
1405
- ...a,
1406
- disabled: t,
1407
- children: n
1408
- };
1409
- }
1410
- );
1411
- }
1412
- function Ta(e) {
1413
- return e.map(
1414
- (i) => i.padStart(2, "0")
1415
- ).join("-");
1416
- }
1417
- const Fa = { class: "editable-table-sort-filter__sort" }, Va = { class: "editable-table-sort-filter__search-title" }, La = { class: "editable-table-sort-filter__date-picker-content" }, Oa = /* @__PURE__ */ le({
1418
- __name: "BizMonthDayPicker",
1419
- props: {
1420
- config: {},
1421
- tempFilteredValue: {}
1422
- },
1423
- emits: ["update:tempFilteredValue"],
1424
- setup(e, { emit: i }) {
1425
- const l = e, { config: o, tempFilteredValue: c } = Ve(l), b = i, a = (S) => S ? S.split("-").map((E) => String(Number(E))) : [], n = oe(() => {
1426
- const { prop: S } = o.value;
1427
- return a(c.value[S[0]]);
1428
- }), t = oe(() => {
1429
- const { prop: S } = o.value;
1430
- return a(c.value[S[1]]);
1431
- }), s = oe(() => t.value.length === 0 ? Fe() : Ge({
1432
- date: t.value,
1433
- isStartDate: !1,
1434
- digits: o.value.limit
1435
- })), k = oe(() => n.value.length === 0 ? Fe() : Ge({
1436
- date: n.value,
1437
- isStartDate: !0,
1438
- digits: o.value.limit
1439
- })), _ = (S, E) => {
1440
- const N = E.length === 0 ? "" : Ta(E);
1441
- b("update:tempFilteredValue", S, N);
1442
- };
1443
- return (S, E) => {
1444
- const N = Z("el-cascader");
1445
- return g(), O("div", Fa, [
1446
- F("div", Va, q(r(o).label || "筛选"), 1),
1447
- F("div", La, [
1448
- j(N, {
1449
- clearable: "",
1450
- value: n.value,
1451
- separator: "",
1452
- size: "small",
1453
- placeholder: "开始日期",
1454
- "popper-class": "month-day-picker",
1455
- options: s.value,
1456
- onChange: E[0] || (E[0] = (V) => _(r(o).prop[0], V))
1457
- }, null, 8, ["value", "options"]),
1458
- j(N, {
1459
- clearable: "",
1460
- value: t.value,
1461
- separator: "",
1462
- size: "small",
1463
- placeholder: "结束日期",
1464
- "popper-class": "month-day-picker",
1465
- options: k.value,
1466
- onChange: E[1] || (E[1] = (V) => _(r(o).prop[1], V))
1467
- }, null, 8, ["value", "options"])
1468
- ])
1469
- ]);
1470
- };
1471
- }
1472
- }), Ia = { class: "editable-table-sort-filter__sort" }, Aa = { class: "editable-table-sort-filter__sort-title" }, Ma = { class: "editable-table-sort-filter__sort-btns" }, za = /* @__PURE__ */ le({
1473
- __name: "BizSortFilter",
1474
- props: {
1475
- column: {},
1476
- tempSortType: {},
1477
- tempSortProp: {}
1478
- },
1479
- emits: ["update:sort"],
1480
- setup(e, { emit: i }) {
1481
- const l = e, o = i, c = (a, n) => l.tempSortType === a && l.tempSortProp === n, b = oe(() => Array.isArray(l.column._sortable) ? l.column._sortable : [{ ...l.column, label: "排序" }]);
1482
- return (a, n) => {
1483
- const t = Z("el-button");
1484
- return g(), O("div", Ia, [
1485
- (g(!0), O(J, null, re(b.value, (s) => (g(), O("div", {
1486
- key: s.prop
1487
- }, [
1488
- F("div", Aa, q(s.label || "排序"), 1),
1489
- F("div", Ma, [
1490
- j(t, {
1491
- class: Se([
1492
- "editable-table-sort-filter__sort-btn",
1493
- c("ascending", s.prop) && "editable-table-sort-filter__sort-btn--active"
1494
- ]),
1495
- onClick: () => o("update:sort", "ascending", s.prop)
1496
- }, {
1497
- default: T(() => [...n[0] || (n[0] = [
1498
- X(" 升序 ", -1)
1499
- ])]),
1500
- _: 1
1501
- }, 8, ["class", "onClick"]),
1502
- j(t, {
1503
- class: Se([
1504
- "editable-table-sort-filter__sort-btn",
1505
- c("descending", s.prop) && "editable-table-sort-filter__sort-btn--active"
1506
- ]),
1507
- onClick: () => o("update:sort", "descending", s.prop)
1508
- }, {
1509
- default: T(() => [...n[1] || (n[1] = [
1510
- X(" 降序 ", -1)
1511
- ])]),
1512
- _: 1
1513
- }, 8, ["class", "onClick"])
1514
- ])
1515
- ]))), 128))
1516
- ]);
1517
- };
1518
- }
1519
- }), Ba = { class: "editable-table-sort-filter__filter" }, Na = { class: "editable-table-sort-filter__filter-title" }, ja = /* @__PURE__ */ le({
1520
- __name: "BizRadioFilter",
1521
- props: {
1522
- config: {},
1523
- tempFilteredValue: {}
1524
- },
1525
- emits: ["update:tempFilteredValue"],
1526
- setup(e, { emit: i }) {
1527
- const l = i;
1528
- return (o, c) => {
1529
- const b = Z("el-radio"), a = Z("el-radio-group");
1530
- return g(), O("div", Ba, [
1531
- F("div", Na, q(e.config.label || "筛选"), 1),
1532
- j(a, {
1533
- style: { display: "flex", "flex-direction": "column", gap: "6px" },
1534
- value: e.tempFilteredValue[e.config.prop],
1535
- onInput: c[0] || (c[0] = (n) => l("update:tempFilteredValue", e.config.prop, n))
1536
- }, {
1537
- default: T(() => [
1538
- (g(!0), O(J, null, re(e.config.options, (n) => (g(), G(b, {
1539
- key: n.value,
1540
- label: n.value,
1541
- title: n.text
1542
- }, {
1543
- default: T(() => [
1544
- X(q(n.text), 1)
1545
- ]),
1546
- _: 2
1547
- }, 1032, ["label", "title"]))), 128))
1548
- ]),
1549
- _: 1
1550
- }, 8, ["value"])
1551
- ]);
1552
- };
1553
- }
1554
- }), Ua = { class: "editable-table-sort-filter" }, Ha = { class: "editable-table-sort-filter__column-title" }, Wa = { class: "editable-table-sort-filter__item" }, Ga = {
1555
- key: 1,
1556
- class: "editable-table-sort-filter__item editable-table-sort-filter__filter"
1557
- }, Ka = { class: "editable-table-sort-filter__footer" }, Ke = /* @__PURE__ */ le({
1558
- __name: "index",
1559
- props: {
1560
- headActive: { type: Boolean },
1561
- column: {},
1562
- tempSummaryList: {},
1563
- tempSortType: {},
1564
- tempSortProp: {},
1565
- tempFilteredValue: {}
1566
- },
1567
- emits: ["update:tempFilteredValue", "update:tempSummaryList", "update:sort", "popover-show", "reset", "confirm"],
1568
- setup(e, { expose: i, emit: l }) {
1569
- const o = l, c = {
1570
- /** 输入框 */
1571
- input: Da,
1572
- /** 日期范围 */
1573
- doubleDatePicker: $a,
1574
- /** 单选框 */
1575
- radio: ja,
1576
- /** 复选框 */
1577
- checkbox: ba,
1578
- /** 月日选择器 */
1579
- monthDayPicker: Oa,
1580
- /** 颜色选择器 */
1581
- colorRadio: Sa
1582
- }, b = M(null);
1583
- function a(n, t) {
1584
- o("update:tempFilteredValue", n, t);
1585
- }
1586
- return i({
1587
- close: () => {
1588
- var n;
1589
- (n = b.value) == null || n.doClose();
1590
- }
1591
- }), (n, t) => {
1592
- const s = Z("el-checkbox"), k = Z("el-checkbox-group"), _ = Z("el-button"), S = Z("el-popover");
1593
- return g(), G(S, {
1594
- ref_key: "popoverRef",
1595
- ref: b,
1596
- placement: "bottom",
1597
- trigger: "click",
1598
- "popper-class": "editable-table-sort-filter",
1599
- "data-popper-name": "editable-table-sort-filter",
1600
- "data-prop": e.column.prop,
1601
- onShow: t[4] || (t[4] = () => o("popover-show"))
1602
- }, {
1603
- reference: T(() => [
1604
- ne(n.$slots, "custom", {}, () => [
1605
- F("span", {
1606
- class: Se([
1607
- "editable-table__sort-reference",
1608
- e.headActive && "editable-table__sort-reference--active"
1609
- ])
1610
- }, [
1611
- X(q(e.column.label) + " ", 1),
1612
- F("div", {
1613
- class: Se([
1614
- "editable-table__sort-icon",
1615
- e.headActive && "editable-table__sort-icon--active"
1616
- ])
1617
- }, null, 2)
1618
- ], 2)
1619
- ])
1620
- ]),
1621
- default: T(() => [
1622
- F("div", Ua, [
1623
- F("div", Ha, q(e.column.label), 1),
1624
- F("div", Wa, [
1625
- e.column.isColumnSortable ? (g(), G(za, {
1626
- key: 0,
1627
- column: e.column,
1628
- "temp-sort-prop": e.tempSortProp,
1629
- "temp-sort-type": e.tempSortType,
1630
- "onUpdate:sort": t[0] || (t[0] = (E, N) => o("update:sort", E, N))
1631
- }, null, 8, ["column", "temp-sort-prop", "temp-sort-type"])) : ee("", !0)
1632
- ]),
1633
- e.column.filters ? (g(!0), O(J, { key: 0 }, re(e.column.filters, (E, N) => (g(), O("div", {
1634
- key: N,
1635
- class: "editable-table-sort-filter__item editable-table__filter-group__filter"
1636
- }, [
1637
- E.type === "slot" ? ne(n.$slots, E.slotName, { key: 0 }) : (g(), G(wt(c[E.type]), {
1638
- key: 1,
1639
- config: E,
1640
- "temp-filtered-value": e.tempFilteredValue,
1641
- "onUpdate:tempFilteredValue": a
1642
- }, null, 40, ["config", "temp-filtered-value"]))
1643
- ]))), 128)) : ee("", !0),
1644
- e.column.summary ? (g(), O("div", Ga, [
1645
- t[5] || (t[5] = F("div", { class: "editable-table-sort-filter__filter-title" }, "统计", -1)),
1646
- j(k, {
1647
- class: "editable-table-sort-filter__filter-checkbox-group",
1648
- value: e.tempSummaryList,
1649
- onInput: t[1] || (t[1] = (E) => o("update:tempSummaryList", E))
1650
- }, {
1651
- default: T(() => [
1652
- j(s, {
1653
- label: e.column.prop,
1654
- class: "editable-table-sort-filter__filter-checkbox"
1655
- }, {
1656
- default: T(() => [
1657
- ne(n.$slots, "summay-item", St(Ct(e.column)), () => [
1658
- X(q(e.column.label), 1)
1659
- ])
1660
- ]),
1661
- _: 3
1662
- }, 8, ["label"])
1663
- ]),
1664
- _: 3
1665
- }, 8, ["value"])
1666
- ])) : ee("", !0),
1667
- F("div", Ka, [
1668
- j(_, {
1669
- class: "editable-table-sort-filter__reset-btn",
1670
- onClick: t[2] || (t[2] = () => o("reset"))
1671
- }, {
1672
- default: T(() => [...t[6] || (t[6] = [
1673
- X(" 重置 ", -1)
1674
- ])]),
1675
- _: 1
1676
- }),
1677
- j(_, {
1678
- class: "editable-table-sort-filter__confirm-btn",
1679
- type: "primary",
1680
- onClick: t[3] || (t[3] = () => o("confirm"))
1681
- }, {
1682
- default: T(() => [...t[7] || (t[7] = [
1683
- X(" 确定 ", -1)
1684
- ])]),
1685
- _: 1
1686
- })
1687
- ])
1688
- ])
1689
- ]),
1690
- _: 3
1691
- }, 8, ["data-prop"]);
1692
- };
1693
- }
1694
- }), Ya = { class: "editable-table-operation-popover__operation-reference btn-pointer" }, Xa = { class: "editable-table-operation-popover__operation" }, qa = /* @__PURE__ */ le({
1695
- __name: "bizTableOperatePopover",
1696
- props: {
1697
- defaultOperations: {},
1698
- scope: {}
1699
- },
1700
- emits: ["edit", "delete", "rowPinToTop"],
1701
- setup(e, { expose: i, emit: l }) {
1702
- const o = l, c = M(null);
1703
- return i({
1704
- doClose: () => {
1705
- var b, a;
1706
- return (a = (b = c.value) == null ? void 0 : b.doClose) == null ? void 0 : a.call(b);
1707
- }
1708
- }), (b, a) => {
1709
- const n = Z("el-button"), t = Z("el-popover");
1710
- return g(), G(t, {
1711
- ref_key: "operationPopoverRef",
1712
- ref: c,
1713
- placement: "bottom",
1714
- trigger: "click",
1715
- "popper-class": "editable-table-operation-popover"
1716
- }, {
1717
- reference: T(() => [
1718
- F("div", Ya, [
1719
- j(n, { class: "editable-table-operation-popover__operation-btn" }, {
1720
- default: T(() => [...a[3] || (a[3] = [
1721
- X(" 操作 ", -1)
1722
- ])]),
1723
- _: 1
1724
- })
1725
- ])
1726
- ]),
1727
- default: T(() => [
1728
- F("div", Xa, [
1729
- e.defaultOperations.includes("delete") ? (g(), O("div", {
1730
- key: 0,
1731
- class: "editable-table-operation-popover__operation-item btn-pointer",
1732
- onClick: a[0] || (a[0] = () => o("delete"))
1733
- }, " 删除 ")) : ee("", !0),
1734
- e.defaultOperations.includes("edit") ? (g(), O("div", {
1735
- key: 1,
1736
- class: "editable-table-operation-popover__operation-item btn-pointer",
1737
- onClick: a[1] || (a[1] = () => o("edit"))
1738
- }, " 编辑 ")) : ee("", !0),
1739
- e.defaultOperations.includes("top") ? (g(), O("div", {
1740
- key: 2,
1741
- class: "editable-table-operation-popover__operation-item btn-pointer",
1742
- onClick: a[2] || (a[2] = () => o("rowPinToTop"))
1743
- }, " 置顶 ")) : ee("", !0),
1744
- ne(b.$slots, "default")
1745
- ])
1746
- ]),
1747
- _: 3
1748
- }, 512);
1749
- };
1750
- }
1751
- });
1752
- const Ja = { class: "editable-table" }, Qa = {
1753
- key: 0,
1754
- class: "editable-table__toolbar"
1755
- }, Za = ["data-index", "onMousedown"], en = ["data-index"], tn = {
1756
- key: 1,
1757
- class: "editable-table__color-icon"
1758
- }, on = {
1759
- key: 1,
1760
- class: "editable-table-operation-popover__save-cancel"
1761
- }, an = {
1762
- key: 1,
1763
- class: "editable-table__pagination"
1764
- }, nn = /* @__PURE__ */ le({
1765
- name: "EditableTable",
1766
- inheritAttrs: !1,
1767
- __name: "index",
1768
- props: {
1769
- data: { default: () => [] },
1770
- columns: { default: () => [] },
1771
- total: { default: 0 },
1772
- showIndex: { type: Boolean, default: !1 },
1773
- showSelection: { type: Boolean, default: !1 },
1774
- showExpand: { type: Boolean, default: !1 },
1775
- draggable: { type: Boolean, default: !1 },
1776
- loading: { type: Boolean, default: !1 },
1777
- operations: { default: () => [] },
1778
- colorOptions: { default: () => [] },
1779
- colorFilterConfig: { default: void 0 },
1780
- hideColumnSetting: { type: Boolean, default: !1 },
1781
- columnSettingKey: { default: "" },
1782
- settingStorgeKey: { default: "" },
1783
- leftFixedCount: { default: 1 },
1784
- currentPage: { default: 1 },
1785
- pageSize: { default: 10 },
1786
- pageSizes: { default: () => [10, 20, 50, 100] },
1787
- dragRange: { default: 15 },
1788
- dragSemiRange: {},
1789
- localSort: { type: Boolean },
1790
- localFilter: { type: Boolean },
1791
- columnConfig: { default: () => [] },
1792
- settingStorgeMigrationConfigs: {},
1793
- dataList: { default: () => [] },
1794
- rowDragAble: { type: Boolean, default: !1 },
1795
- colorList: { default: () => [] },
1796
- defaultOperations: { default: () => [] },
1797
- hideViewSettingBtn: { type: Boolean, default: !1 },
1798
- hasExpandRow: { type: Boolean, default: !1 }
1799
- },
1800
- emits: ["selection-change", "update:currentPage", "update:pageSize", "page-change", "sort-change", "filter-change", "search", "row-edit", "row-edit-save", "row-edit-cancel", "row-delete", "row-pin", "row-pin-to-top", "row-drag", "row-drag-drop", "row-color-change", "row-bg-change", "row-dblclick"],
1801
- setup(e, { expose: i, emit: l }) {
1802
- const o = e, c = M(
1803
- null
1804
- ), b = () => {
1805
- var P;
1806
- (P = c.value) == null || P.open();
1807
- }, a = l, n = xt(), t = oe(() => {
1808
- var P, w, te, W;
1809
- return {
1810
- ...o,
1811
- columnConfig: (P = o.columns) != null && P.length ? o.columns : o.columnConfig || [],
1812
- settingStorgeKey: o.columnSettingKey || o.settingStorgeKey,
1813
- dragSemiRange: o.dragRange || o.dragSemiRange,
1814
- dataList: (w = o.data) != null && w.length ? o.data : o.dataList || [],
1815
- rowDragAble: o.draggable || o.rowDragAble,
1816
- colorList: (te = o.colorOptions) != null && te.length ? o.colorOptions : o.colorList || [],
1817
- defaultOperations: (W = o.operations) != null && W.length ? o.operations : o.defaultOperations || [],
1818
- hideViewSettingBtn: o.hideColumnSetting || o.hideViewSettingBtn,
1819
- showExpand: o.showExpand || o.hasExpandRow
1820
- };
1821
- }), s = M(), k = M(null), _ = M([]), S = M(0), E = M([]), { currentPage: N, pageSize: V, handlePageChange: f, handleSizeChange: m } = zt(o, a), $ = async () => {
1822
- var P;
1823
- await _e(), (P = s.value) == null || P.doLayout();
1824
- }, {
1825
- setSort: U,
1826
- clearSort: H,
1827
- setSearchParams: K,
1828
- isColumnHeadActive: A,
1829
- handleSort: p,
1830
- handleHeaderPopoverShow: D,
1831
- handleHeaderOperationConfirm: y,
1832
- handleHeaderOperationReset: R,
1833
- summaryList: I,
1834
- tableSummaryMethod: d,
1835
- filteredValue: u,
1836
- showColumnHeadSortIcon: C,
1837
- sortProp: h,
1838
- tempFilteredValue: L,
1839
- tempSummaryList: x,
1840
- tempSortType: z,
1841
- tempSortProp: Y,
1842
- isColumnFiltering: ue,
1843
- inSorting: ve
1844
- } = Xo({
1845
- tableDomRef: s,
1846
- props: t.value,
1847
- emit: a,
1848
- showingColumns: _
1849
- }), ie = oe(() => {
1850
- const P = [];
1851
- let w = S.value;
1852
- for (const te of _.value) {
1853
- const W = t.value.columnConfig.find(
1854
- (v) => v.prop === te
1855
- );
1856
- if (!W)
1857
- continue;
1858
- const ae = { ...W };
1859
- ae.isColumnSortable = !!W.sortable, ae.sortable = ve.value ? !!W.sortable : !1, ae._sortable = W.sortable, w > 0 ? (ae.fixed = "left", w--) : ae.fixed = void 0, P.push(ae);
1860
- }
1861
- return t.value.defaultOperations && t.value.defaultOperations.length > 0 && P.push({
1862
- label: "操作",
1863
- prop: "$$operation",
1864
- minWidth: "100px",
1865
- fixed: "right"
1866
- }), P;
1867
- }), ce = (P, w) => {
1868
- switch (P) {
1869
- case "update:leftFixedColumnCount":
1870
- S.value = w;
1871
- break;
1872
- case "update:showingColumns":
1873
- _.value = w;
1874
- break;
1875
- case "update:viewSettingDragSortOptions":
1876
- E.value = w;
1877
- break;
1878
- case "tableDoLayout":
1879
- $();
1880
- break;
1881
- }
1882
- };
1883
- lt({
1884
- showingColumns: _,
1885
- actualColumns: ie,
1886
- props: t.value,
1887
- viewSettingDragSortOptions: E,
1888
- emit: ce
1889
- });
1890
- const { hasSlot: Ee, hasEditSlot: Pe, formatCellValue: Ce } = Bt(
1891
- o,
1892
- _,
1893
- S
1894
- ), {
1895
- operationPopoverRef: ge,
1896
- editingRowData: pe,
1897
- editingRowIndex: se,
1898
- handleDelete: st,
1899
- closeAllExpandedRows: dt,
1900
- handleEdit: ut,
1901
- handleEditSave: ct,
1902
- handleEditCancel: pt,
1903
- handleRowPinToTop: ft
1904
- } = Yo({
1905
- emit: a,
1906
- tableDomRef: s,
1907
- pageSize: V,
1908
- props: o,
1909
- hasExpandRow: t.value.showExpand
1910
- }), { setRowStyle: vt } = nt({
1911
- colorList: t.value.colorList || [],
1912
- emit: a
1913
- }), gt = ({ row: P, rowIndex: w }) => [
1914
- "custom-row-classname",
1915
- `custom-row-classname-${w}`,
1916
- P.isPinned ? "custom-row-classname-pinned" : ""
1917
- ].join(" "), { hoveringCellInfo: Oe, setCellClassName: mt, debouncedHoverHandler: bt } = Ko(s), yt = () => (se.value = -1, h.value ? (console.warn("已有列正在排序,不允许拖拽。"), !1) : ue.value ? (console.warn("已有列正在筛选,不允许拖拽。"), !1) : !0);
1918
- Go({
1919
- props: t.value,
1920
- emit: a,
1921
- viewSettingDragSortOptions: E,
1922
- beforeDragStart: yt,
1923
- currScope: k,
1924
- currentPage: N,
1925
- pageSize: V,
1926
- tableDomRef: s
1927
- });
1928
- const ht = (P) => {
1929
- a("selection-change", P);
1930
- }, _t = (P) => {
1931
- const {
1932
- editType: w,
1933
- editSlotName: te,
1934
- editOptions: W,
1935
- slotName: ae,
1936
- hoverSlotName: v,
1937
- formatter: me,
1938
- filters: B,
1939
- showFilterIcon: Q,
1940
- summary: Ie,
1941
- summaryMethod: rn,
1942
- alwaysShow: sn,
1943
- defaultHide: dn,
1944
- isColumnSortable: un,
1945
- _sortable: cn,
1946
- ...De
1947
- } = P;
1948
- return Array.isArray(De.sortable) && (De.sortable = !1), De;
1949
- };
1950
- return i({
1951
- tableRef: s,
1952
- clearSelection: () => {
1953
- var P;
1954
- return (P = s.value) == null ? void 0 : P.clearSelection();
1955
- },
1956
- toggleRowSelection: (P, w) => {
1957
- var te;
1958
- return (te = s.value) == null ? void 0 : te.toggleRowSelection(P, w);
1959
- },
1960
- toggleAllSelection: () => {
1961
- var P;
1962
- return (P = s.value) == null ? void 0 : P.toggleAllSelection();
1963
- },
1964
- setCurrentRow: (P) => {
1965
- var w;
1966
- return (w = s.value) == null ? void 0 : w.setCurrentRow(P);
1967
- },
1968
- clearSort: () => {
1969
- var P;
1970
- return (P = s.value) == null ? void 0 : P.clearSort();
1971
- },
1972
- clearFilter: (P) => {
1973
- var w;
1974
- return (w = s.value) == null ? void 0 : w.clearFilter(P);
1975
- },
1976
- doLayout: () => {
1977
- var P;
1978
- return (P = s.value) == null ? void 0 : P.doLayout();
1979
- },
1980
- sort: (P, w) => {
1981
- var te;
1982
- return (te = s.value) == null ? void 0 : te.sort(P, w);
1983
- },
1984
- // 新增暴露方法
1985
- setSort: U,
1986
- setSearchParams: K,
1987
- closeAllExpandedRows: dt
1988
- }), (P, w) => {
1989
- const te = kt("loading");
1990
- return g(), G(r(Rt), { locale: r(Mt) }, {
1991
- default: T(() => [
1992
- F("div", Ja, [
1993
- t.value.hideViewSettingBtn ? ee("", !0) : (g(), O("div", Qa, [
1994
- j(r(we), { onClick: b }, {
1995
- default: T(() => [
1996
- j(r(Je), null, {
1997
- default: T(() => [
1998
- j(r(At))
1999
- ]),
2000
- _: 1
2001
- }),
2002
- w[14] || (w[14] = X(" 显示设置 ", -1))
2003
- ]),
2004
- _: 1
2005
- })
2006
- ])),
2007
- j(ua, {
2008
- ref_key: "bizViewSettingDialogRef",
2009
- ref: c,
2010
- props: t.value,
2011
- "actual-columns": ie.value,
2012
- "showing-columns": _.value,
2013
- "view-setting-drag-sort-options": E.value,
2014
- "onUpdate:leftFixedColumnCount": w[0] || (w[0] = (W) => {
2015
- S.value = W;
2016
- }),
2017
- "onUpdate:showingColumns": w[1] || (w[1] = (W) => {
2018
- _.value = W;
2019
- }),
2020
- "onUpdate:viewSettingDragSortOptions": w[2] || (w[2] = (W) => {
2021
- E.value = W;
2022
- }),
2023
- onTableDoLayout: $
2024
- }, null, 8, ["props", "actual-columns", "showing-columns", "view-setting-drag-sort-options"]),
2025
- $t((g(), G(r(Tt), de({
2026
- ref_key: "tableRef",
2027
- ref: s,
2028
- data: t.value.dataList,
2029
- "row-style": r(vt),
2030
- "row-class-name": gt,
2031
- "cell-class-name": r(mt),
2032
- "show-summary": r(I).length > 0,
2033
- "summary-method": r(d)
2034
- }, P.$attrs, {
2035
- onSelectionChange: ht,
2036
- onCellMouseEnter: r(bt),
2037
- onHeaderDragend: $,
2038
- onRowDblclick: w[11] || (w[11] = (W, ae, v) => a("row-dblclick", { row: W, column: ae, event: v }))
2039
- }), {
2040
- default: T(() => {
2041
- var W, ae;
2042
- return [
2043
- t.value.rowDragAble ? (g(), G(r(ye), {
2044
- key: 0,
2045
- width: "30",
2046
- "class-name": "editable-table__drag-cell",
2047
- fixed: S.value > 0 ? "left" : !1
2048
- }, {
2049
- default: T((v) => [
2050
- F("div", {
2051
- class: "row-drag-target editable-table__drag-icon",
2052
- "data-index": v.$index,
2053
- onMousedown: (me) => k.value = v
2054
- }, [
2055
- F("div", {
2056
- "data-index": v.$index,
2057
- class: "row-drag-target editable-table-drag-icon"
2058
- }, null, 8, en)
2059
- ], 40, Za)
2060
- ]),
2061
- _: 1
2062
- }, 8, ["fixed"])) : ee("", !0),
2063
- t.value.showExpand ? (g(), G(r(ye), {
2064
- key: 1,
2065
- type: "expand",
2066
- fixed: S.value > 0 ? "left" : !1,
2067
- "class-name": "no-inner-cell-border"
2068
- }, {
2069
- default: T((v) => [
2070
- ne(P.$slots, "expand", {
2071
- row: v.row,
2072
- $index: v.$index
2073
- }, void 0, !0)
2074
- ]),
2075
- _: 3
2076
- }, 8, ["fixed"])) : ee("", !0),
2077
- e.showIndex ? (g(), G(r(ye), {
2078
- key: 2,
2079
- type: "index",
2080
- fixed: S.value > 0 ? "left" : !1,
2081
- width: "60",
2082
- align: "center"
2083
- }, null, 8, ["fixed"])) : ee("", !0),
2084
- t.value.colorList && t.value.colorList.length > 0 ? (g(), G(r(ye), {
2085
- key: 3,
2086
- width: "40px",
2087
- "class-name": "editable-table__color-column no-inner-cell-border",
2088
- fixed: S.value > 0 ? "left" : !1,
2089
- "filtered-value": Array.isArray(r(u)[(W = e.colorFilterConfig) == null ? void 0 : W.prop]) ? r(u)[(ae = e.colorFilterConfig) == null ? void 0 : ae.prop] : []
2090
- }, {
2091
- header: T(() => [
2092
- e.colorFilterConfig ? (g(), G(Ke, {
2093
- key: 0,
2094
- "head-active": r(A)(e.colorFilterConfig),
2095
- column: e.colorFilterConfig,
2096
- "temp-summary-list": r(x),
2097
- "temp-sort-prop": r(Y),
2098
- "temp-sort-type": r(z),
2099
- "temp-filtered-value": r(L),
2100
- "onUpdate:tempSummaryList": w[3] || (w[3] = (v) => x.value = v),
2101
- "onUpdate:tempFilteredValue": w[4] || (w[4] = (v, me) => r(L)[v] = me),
2102
- onPopoverShow: w[5] || (w[5] = () => r(D)(e.colorFilterConfig)),
2103
- "onUpdate:sort": r(p),
2104
- onReset: w[6] || (w[6] = () => r(R)(e.colorFilterConfig)),
2105
- onConfirm: w[7] || (w[7] = () => r(y)(e.colorFilterConfig))
2106
- }, {
2107
- custom: T(() => [...w[15] || (w[15] = [
2108
- F("div", { class: "editable-table__color-icon" }, null, -1)
2109
- ])]),
2110
- _: 1
2111
- }, 8, ["head-active", "column", "temp-summary-list", "temp-sort-prop", "temp-sort-type", "temp-filtered-value", "onUpdate:sort"])) : (g(), O("div", tn))
2112
- ]),
2113
- default: T((v) => [
2114
- j(va, {
2115
- "color-list": t.value.colorList,
2116
- scope: v,
2117
- onRowBgChange: w[8] || (w[8] = (me) => a("row-bg-change", me))
2118
- }, null, 8, ["color-list", "scope"])
2119
- ]),
2120
- _: 1
2121
- }, 8, ["fixed", "filtered-value"])) : ee("", !0),
2122
- e.showSelection ? (g(), G(r(ye), {
2123
- key: 4,
2124
- type: "selection",
2125
- width: "45",
2126
- align: "center"
2127
- })) : ee("", !0),
2128
- (g(!0), O(J, null, re(ie.value, (v, me) => (g(), G(r(ye), de({
2129
- key: v.prop + me,
2130
- resizable: "",
2131
- "class-name": "editable-table__data-column",
2132
- "filtered-value": Array.isArray(r(u)[v.prop]) ? r(u)[v.prop] : []
2133
- }, { ref_for: !0 }, _t(v)), Ae({
2134
- default: T((B) => [
2135
- v.prop === "$$operation" ? (g(), O(J, { key: 0 }, [
2136
- r(se) !== B.$index ? (g(), G(qa, {
2137
- key: 0,
2138
- ref_for: !0,
2139
- ref_key: "operationPopoverRef",
2140
- ref: ge,
2141
- "default-operations": t.value.defaultOperations,
2142
- scope: B,
2143
- onEdit: () => r(ut)(B),
2144
- onDelete: () => r(st)(B.row, B.$index),
2145
- onRowPinToTop: () => r(ft)(B)
2146
- }, {
2147
- default: T(() => [
2148
- ne(P.$slots, "custom-operation", de({ ref_for: !0 }, B), void 0, !0)
2149
- ]),
2150
- _: 2
2151
- }, 1032, ["default-operations", "scope", "onEdit", "onDelete", "onRowPinToTop"])) : (g(), O("div", on, [
2152
- j(r(we), {
2153
- type: "primary",
2154
- size: "small",
2155
- onClick: (Q) => r(ct)(B.row)
2156
- }, {
2157
- default: T(() => [...w[16] || (w[16] = [
2158
- X(" 保存 ", -1)
2159
- ])]),
2160
- _: 1
2161
- }, 8, ["onClick"]),
2162
- j(r(we), {
2163
- size: "small",
2164
- onClick: (Q) => r(pt)(B.row)
2165
- }, {
2166
- default: T(() => [...w[17] || (w[17] = [
2167
- X(" 取消 ", -1)
2168
- ])]),
2169
- _: 1
2170
- }, 8, ["onClick"])
2171
- ]))
2172
- ], 64)) : r(se) !== -1 ? (g(), O(J, { key: 1 }, [
2173
- r(se) === B.$index && v.editType ? (g(), O(J, { key: 0 }, [
2174
- v.editType === "input" ? (g(), G(r(qe), {
2175
- key: 0,
2176
- modelValue: r(pe)[v.prop],
2177
- "onUpdate:modelValue": (Q) => r(pe)[v.prop] = Q
2178
- }, null, 8, ["modelValue", "onUpdate:modelValue"])) : v.editType === "select" ? (g(), G(r(Ft), {
2179
- key: 1,
2180
- modelValue: r(pe)[v.prop],
2181
- "onUpdate:modelValue": (Q) => r(pe)[v.prop] = Q
2182
- }, {
2183
- default: T(() => [
2184
- (g(!0), O(J, null, re(v.editOptions, (Q) => (g(), G(r(Vt), {
2185
- key: Q.value,
2186
- label: Q.label,
2187
- value: Q.value
2188
- }, null, 8, ["label", "value"]))), 128))
2189
- ]),
2190
- _: 2
2191
- }, 1032, ["modelValue", "onUpdate:modelValue"])) : v.editType === "date" ? (g(), G(r(Lt), {
2192
- key: 2,
2193
- modelValue: r(pe)[v.prop],
2194
- "onUpdate:modelValue": (Q) => r(pe)[v.prop] = Q,
2195
- type: "date"
2196
- }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ee("", !0)
2197
- ], 64)) : v.editSlotName && B.$index === r(se) ? ne(P.$slots, v.editSlotName, {
2198
- key: 1,
2199
- row: r(pe),
2200
- column: v,
2201
- $index: B.$index
2202
- }, void 0, !0) : (g(), O(J, { key: 2 }, [
2203
- X(q(v.formatter ? v.formatter(
2204
- B.row,
2205
- v,
2206
- B.row[v.prop],
2207
- B.$index
2208
- ) : B.row[v.prop]), 1)
2209
- ], 64))
2210
- ], 64)) : v.hoverSlotName ? (g(), O(J, { key: 2 }, [
2211
- B.$index === r(Oe).rowIndex && v.prop === r(Oe).columnProperty ? ne(P.$slots, v.hoverSlotName, de({
2212
- key: 0,
2213
- ref_for: !0
2214
- }, B), void 0, !0) : v.slotName ? ne(P.$slots, v.slotName, de({
2215
- key: 1,
2216
- ref_for: !0
2217
- }, B), void 0, !0) : (g(), O(J, { key: 2 }, [
2218
- X(q(v.formatter ? v.formatter(
2219
- B.row,
2220
- v,
2221
- B.row[v.prop],
2222
- B.$index
2223
- ) : B.row[v.prop]), 1)
2224
- ], 64))
2225
- ], 64)) : (g(), O(J, { key: 3 }, [
2226
- v.slotName ? ne(P.$slots, v.slotName, de({
2227
- key: 0,
2228
- ref_for: !0
2229
- }, B), void 0, !0) : (g(), O(J, { key: 1 }, [
2230
- X(q(r(Ce)(B.row, v, B.$index)), 1)
2231
- ], 64))
2232
- ], 64))
2233
- ]),
2234
- _: 2
2235
- }, [
2236
- r(C)(v) ? {
2237
- name: "header",
2238
- fn: T(() => [
2239
- j(Ke, {
2240
- "head-active": r(A)(v),
2241
- column: v,
2242
- "temp-summary-list": r(x),
2243
- "temp-sort-prop": r(Y),
2244
- "temp-sort-type": r(z),
2245
- "temp-filtered-value": r(L),
2246
- "onUpdate:tempSummaryList": w[9] || (w[9] = (B) => x.value = B),
2247
- "onUpdate:tempFilteredValue": w[10] || (w[10] = (B, Q) => r(L)[B] = Q),
2248
- onPopoverShow: () => r(D)(v),
2249
- "onUpdate:sort": r(p),
2250
- onReset: () => r(R)(v),
2251
- onConfirm: () => r(y)(v)
2252
- }, Ae({
2253
- "summay-item": T(() => [
2254
- ne(P.$slots, v.prop + "-summay-item", de({ ref_for: !0 }, v), () => [
2255
- X(q(v.label), 1)
2256
- ], !0)
2257
- ]),
2258
- _: 2
2259
- }, [
2260
- re(r(n), (B, Q) => ({
2261
- name: Q,
2262
- fn: T((Ie) => [
2263
- ne(P.$slots, Q, de({ ref_for: !0 }, Ie || v), void 0, !0)
2264
- ])
2265
- }))
2266
- ]), 1032, ["head-active", "column", "temp-summary-list", "temp-sort-prop", "temp-sort-type", "temp-filtered-value", "onPopoverShow", "onUpdate:sort", "onReset", "onConfirm"])
2267
- ]),
2268
- key: "0"
2269
- } : void 0
2270
- ]), 1040, ["filtered-value"]))), 128))
2271
- ];
2272
- }),
2273
- _: 3
2274
- }, 16, ["data", "row-style", "cell-class-name", "show-summary", "summary-method", "onCellMouseEnter"])), [
2275
- [te, e.loading]
2276
- ]),
2277
- e.total ? (g(), O("div", an, [
2278
- j(r(Ot), {
2279
- "current-page": r(N),
2280
- "onUpdate:currentPage": w[12] || (w[12] = (W) => $e(N) ? N.value = W : null),
2281
- "page-size": r(V),
2282
- "onUpdate:pageSize": w[13] || (w[13] = (W) => $e(V) ? V.value = W : null),
2283
- total: e.total,
2284
- "page-sizes": e.pageSizes,
2285
- layout: P.paginationLayout,
2286
- onCurrentChange: r(f),
2287
- onSizeChange: r(m)
2288
- }, null, 8, ["current-page", "page-size", "total", "page-sizes", "layout", "onCurrentChange", "onSizeChange"])
2289
- ])) : ee("", !0)
2290
- ])
2291
- ]),
2292
- _: 3
2293
- }, 8, ["locale"]);
2294
- };
2295
- }
2296
- });
2297
- const it = /* @__PURE__ */ rt(nn, [["__scopeId", "data-v-95d9d35d"]]), ln = (e) => {
2298
- e.component("EditableTable", it);
2299
- };
2300
- it.install = ln;
2301
- export {
2302
- it as EditableTable,
2303
- it as default,
2304
- ln as install
2305
- };
2306
- //# sourceMappingURL=index.mjs.map