tm-table 1.1.13 → 1.2.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,32 +1,32 @@
1
- var _e = Object.defineProperty, xe = Object.defineProperties;
2
- var Se = Object.getOwnPropertyDescriptors;
3
- var q = Object.getOwnPropertySymbols;
4
- var ae = Object.prototype.hasOwnProperty, ne = Object.prototype.propertyIsEnumerable;
5
- var se = (e, l, t) => l in e ? _e(e, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[l] = t, T = (e, l) => {
6
- for (var t in l || (l = {}))
7
- ae.call(l, t) && se(e, t, l[t]);
8
- if (q)
9
- for (var t of q(l))
10
- ne.call(l, t) && se(e, t, l[t]);
1
+ var Le = Object.defineProperty, ke = Object.defineProperties;
2
+ var Oe = Object.getOwnPropertyDescriptors;
3
+ var Q = Object.getOwnPropertySymbols;
4
+ var ae = Object.prototype.hasOwnProperty, oe = Object.prototype.propertyIsEnumerable;
5
+ var ne = (e, i, t) => i in e ? Le(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, T = (e, i) => {
6
+ for (var t in i || (i = {}))
7
+ ae.call(i, t) && ne(e, t, i[t]);
8
+ if (Q)
9
+ for (var t of Q(i))
10
+ oe.call(i, t) && ne(e, t, i[t]);
11
11
  return e;
12
- }, B = (e, l) => xe(e, Se(l));
13
- var oe = (e, l) => {
12
+ }, W = (e, i) => ke(e, Oe(i));
13
+ var re = (e, i) => {
14
14
  var t = {};
15
- for (var a in e)
16
- ae.call(e, a) && l.indexOf(a) < 0 && (t[a] = e[a]);
17
- if (e != null && q)
18
- for (var a of q(e))
19
- l.indexOf(a) < 0 && ne.call(e, a) && (t[a] = e[a]);
15
+ for (var n in e)
16
+ ae.call(e, n) && i.indexOf(n) < 0 && (t[n] = e[n]);
17
+ if (e != null && Q)
18
+ for (var n of Q(e))
19
+ i.indexOf(n) < 0 && oe.call(e, n) && (t[n] = e[n]);
20
20
  return t;
21
21
  };
22
- import { ref as Te, resolveComponent as d, createElementBlock as p, openBlock as r, normalizeClass as A, createBlock as m, createCommentVNode as b, createVNode as g, normalizeStyle as N, withCtx as f, Fragment as k, renderList as M, mergeProps as x, toHandlers as E, createTextVNode as L, toDisplayString as S, renderSlot as F, createElementVNode as y, h as Ve, withKeys as we, resolveDirective as ze, withDirectives as ke, createSlots as Fe, normalizeProps as Le, guardReactiveProps as Oe } from "vue";
23
- import P from "sortablejs";
24
- const re = {
22
+ import { ref as De, createElementBlock as g, openBlock as r, normalizeStyle as U, createElementVNode as b, h as me, resolveComponent as u, createBlock as m, mergeProps as _, withCtx as f, toDisplayString as w, normalizeClass as X, createCommentVNode as v, defineComponent as Me, useAttrs as Ae, useSlots as He, computed as ue, resolveDynamicComponent as Re, Fragment as k, renderList as D, createVNode as p, renderSlot as x, toHandlers as I, createTextVNode as L, withKeys as Ee, createSlots as ge, resolveDirective as Ie, withDirectives as We, normalizeProps as Pe, guardReactiveProps as Ne } from "vue";
23
+ import E from "sortablejs";
24
+ const de = {
25
25
  mini: "small",
26
26
  small: "small",
27
27
  default: "default",
28
28
  large: "large"
29
- }, K = (e) => re[e] || re.default, I = () => "default", De = {
29
+ }, K = (e) => de[e] || de.default, M = () => "default", Be = {
30
30
  today: "今天",
31
31
  yesterday: "昨天",
32
32
  last7days: "最近7天",
@@ -65,7 +65,7 @@ const re = {
65
65
  cancelTop: "取消置顶",
66
66
  copySuccess: "复制成功",
67
67
  copyFailed: "复制失败"
68
- }, Me = {
68
+ }, Ue = {
69
69
  today: "Today",
70
70
  yesterday: "Yesterday",
71
71
  last7days: "Last 7 days",
@@ -104,240 +104,27 @@ const re = {
104
104
  cancelTop: "Cancel top",
105
105
  copySuccess: "Copy successfully",
106
106
  copyFailed: "Copy failed"
107
- }, Ae = {
108
- "zh-CN": De,
109
- "en-US": Me
107
+ }, je = {
108
+ "zh-CN": Be,
109
+ "en-US": Ue
110
110
  };
111
- let X = { value: "zh-CN" };
112
- X = Te("zh-CN");
113
- const He = (e) => {
114
- var l;
115
- return ((l = Ae[X.value]) == null ? void 0 : l[e]) || e;
116
- }, ie = (e) => {
117
- X.value = e;
118
- }, W = () => ({
119
- t: He,
120
- setLang: ie,
121
- currentLang: X
122
- }), V = (e, l) => {
111
+ let Z = { value: "zh-CN" };
112
+ Z = De("zh-CN");
113
+ const Je = (e) => {
114
+ var i;
115
+ return ((i = je[Z.value]) == null ? void 0 : i[e]) || e;
116
+ }, se = (e) => {
117
+ Z.value = e;
118
+ }, R = () => ({
119
+ t: Je,
120
+ setLang: se,
121
+ currentLang: Z
122
+ }), V = (e, i) => {
123
123
  const t = e.__vccOpts || e;
124
- for (const [a, i] of l)
125
- t[a] = i;
124
+ for (const [n, l] of i)
125
+ t[n] = l;
126
126
  return t;
127
- }, Re = !1, Ee = !0, Z = "modelValue", Ie = "update:modelValue", Pe = {
128
- name: "TmSelectFilter",
129
- props: {
130
- [Z]: {
131
- type: [String, Number, Array],
132
- default: ""
133
- },
134
- field: {
135
- type: [String, Number],
136
- default: ""
137
- },
138
- options: {
139
- type: [Array, Function],
140
- default: () => []
141
- },
142
- labelOptions: {
143
- type: Array,
144
- default: () => []
145
- },
146
- props: {
147
- type: Object,
148
- default: () => ({
149
- label: "label",
150
- value: "value"
151
- })
152
- },
153
- filterable: {
154
- type: Boolean,
155
- default: !0
156
- },
157
- clearable: {
158
- type: Boolean,
159
- default: !0
160
- },
161
- collapseTags: {
162
- type: Boolean,
163
- default: !0
164
- },
165
- multiple: {
166
- type: Boolean,
167
- default: !1
168
- },
169
- showCheckAll: {
170
- type: Boolean,
171
- default: !0
172
- },
173
- placeholder: {
174
- type: String,
175
- default: ""
176
- }
177
- },
178
- data() {
179
- return {
180
- t: W().t,
181
- isVue2: Re,
182
- isVue3: Ee,
183
- getDefaultSize: I,
184
- optionsList: [],
185
- loading: !1,
186
- indeterminate: !1,
187
- checkAll: !1,
188
- activedSelect: ""
189
- };
190
- },
191
- computed: {
192
- computedValue: {
193
- get() {
194
- return this[Z];
195
- },
196
- set(e) {
197
- this.$emit(Ie, e), this.$emit("change", e);
198
- }
199
- },
200
- fieldValue: {
201
- get() {
202
- return this.field;
203
- },
204
- set(e) {
205
- this.$emit("field-change", e);
206
- }
207
- },
208
- propMap() {
209
- return {
210
- label: this.props.label || "label",
211
- value: this.props.value || "value"
212
- };
213
- }
214
- },
215
- watch: {
216
- [Z](e) {
217
- !this.multiple || !this.showCheckAll || (e.length === 0 ? (this.checkAll = !1, this.indeterminate = !1) : e.length === this.optionsList.length ? (this.checkAll = !0, this.indeterminate = !1) : this.indeterminate = !0);
218
- }
219
- },
220
- created() {
221
- this.initOptions();
222
- },
223
- methods: {
224
- async initOptions() {
225
- if (Array.isArray(this.options))
226
- this.optionsList = this.options;
227
- else if (typeof this.options == "function")
228
- try {
229
- this.loading = !0;
230
- const e = await this.options();
231
- Array.isArray(e) && (this.optionsList = e);
232
- } catch (e) {
233
- console.error(e);
234
- } finally {
235
- this.loading = !1;
236
- }
237
- },
238
- handleCheckAll(e) {
239
- this.indeterminate = !1;
240
- let l = [];
241
- e && (l = this.optionsList.map((t) => t[this.propMap.value])), this.computedValue = l;
242
- },
243
- setActivedSelect(e) {
244
- this.activedSelect = e;
245
- }
246
- }
247
- }, We = {
248
- key: 0,
249
- class: "check-all-option"
250
- };
251
- function Be(e, l, t, a, i, s) {
252
- const n = d("el-option"), h = d("el-select"), u = d("el-checkbox");
253
- return r(), p("div", {
254
- class: A(["advanced-select", { hasField: t.labelOptions && t.labelOptions.length > 0 }])
255
- }, [
256
- t.labelOptions && t.labelOptions.length > 0 ? (r(), m(h, {
257
- key: 0,
258
- size: i.getDefaultSize(),
259
- class: A(["field-select", `field-select--${i.isVue2 ? "v2" : "v3"}`]),
260
- modelValue: s.fieldValue,
261
- "onUpdate:modelValue": l[0] || (l[0] = (c) => s.fieldValue = c),
262
- onFocus: l[1] || (l[1] = (c) => s.setActivedSelect("left")),
263
- style: N(`z-index:${i.activedSelect === "left" ? 2 : 0}`)
264
- }, {
265
- default: f(() => [
266
- (r(!0), p(k, null, M(t.labelOptions, (c) => (r(), m(n, {
267
- key: c.value,
268
- label: c.label,
269
- value: c.value
270
- }, null, 8, ["label", "value"]))), 128))
271
- ]),
272
- _: 1
273
- }, 8, ["size", "class", "modelValue", "style"])) : b("", !0),
274
- g(h, x({
275
- ref: "select",
276
- class: ["select", `select--${i.isVue3 ? "v3" : "v2"}`],
277
- onFocus: l[4] || (l[4] = (c) => s.setActivedSelect("right")),
278
- style: `z-index:${i.activedSelect === "right" ? 2 : 0}`,
279
- modelValue: s.computedValue,
280
- "onUpdate:modelValue": l[5] || (l[5] = (c) => s.computedValue = c)
281
- }, B(T({}, e.$attrs), {
282
- size: i.getDefaultSize(),
283
- filterable: t.filterable,
284
- clearable: t.clearable,
285
- collapseTags: t.collapseTags,
286
- multiple: t.multiple,
287
- placeholder: t.placeholder,
288
- loading: i.loading
289
- }), E(i.isVue2 ? e.$listeners : {}), { loading: i.loading }), {
290
- header: f(() => [
291
- i.isVue3 && t.multiple && t.showCheckAll ? (r(), m(u, {
292
- key: 0,
293
- modelValue: i.checkAll,
294
- "onUpdate:modelValue": l[3] || (l[3] = (c) => i.checkAll = c),
295
- indeterminate: i.indeterminate,
296
- size: i.getDefaultSize(),
297
- onChange: s.handleCheckAll,
298
- style: { width: "100%", height: "20px", "padding-left": "10px" }
299
- }, {
300
- default: f(() => [
301
- L(S(i.t("all")), 1)
302
- ]),
303
- _: 1
304
- }, 8, ["modelValue", "indeterminate", "size", "onChange"])) : b("", !0)
305
- ]),
306
- default: f(() => [
307
- i.isVue2 && t.multiple && t.showCheckAll ? (r(), p("div", We, [
308
- g(u, {
309
- style: { width: "100%" },
310
- modelValue: i.checkAll,
311
- "onUpdate:modelValue": l[2] || (l[2] = (c) => i.checkAll = c),
312
- indeterminate: i.indeterminate,
313
- size: i.getDefaultSize(),
314
- onChange: s.handleCheckAll
315
- }, {
316
- default: f(() => [
317
- L(S(i.t("all")), 1)
318
- ]),
319
- _: 1
320
- }, 8, ["modelValue", "indeterminate", "size", "onChange"])
321
- ])) : b("", !0),
322
- (r(!0), p(k, null, M(i.optionsList, (c) => (r(), m(n, {
323
- key: c[s.propMap.value],
324
- label: c[s.propMap.label],
325
- value: c[s.propMap.value],
326
- disabled: c.disabled
327
- }, {
328
- default: f(() => [
329
- F(e.$slots, "option", { item: c }, () => [
330
- L(S(c[s.propMap.label]), 1)
331
- ], !0)
332
- ]),
333
- _: 2
334
- }, 1032, ["label", "value", "disabled"]))), 128))
335
- ]),
336
- _: 3
337
- }, 16, ["class", "style", "modelValue", "loading"])
338
- ], 2);
339
- }
340
- const ue = /* @__PURE__ */ V(Pe, [["render", Be], ["__scopeId", "data-v-467dcdd3"]]), Ne = {
127
+ }, Ke = {
341
128
  name: "BaseIcon",
342
129
  props: {
343
130
  path: {
@@ -354,24 +141,24 @@ const ue = /* @__PURE__ */ V(Pe, [["render", Be], ["__scopeId", "data-v-467dcdd3
354
141
  handleClick() {
355
142
  }
356
143
  }
357
- }, Ue = ["width", "height"], je = ["d"];
358
- function Je(e, l, t, a, i, s) {
359
- return r(), p("i", {
144
+ }, Qe = ["width", "height"], qe = ["d"];
145
+ function Ye(e, i, t, n, l, s) {
146
+ return r(), g("i", {
360
147
  class: "tm-icon",
361
- onClick: l[0] || (l[0] = (...n) => s.handleClick && s.handleClick(...n))
148
+ onClick: i[0] || (i[0] = (...o) => s.handleClick && s.handleClick(...o))
362
149
  }, [
363
- (r(), p("svg", {
150
+ (r(), g("svg", {
364
151
  width: t.size,
365
152
  height: t.size,
366
- style: N({ color: t.color }),
153
+ style: U({ color: t.color }),
367
154
  viewBox: "0 0 1024 1024",
368
155
  xmlns: "http://www.w3.org/2000/svg"
369
156
  }, [
370
- y("path", { d: t.path }, null, 8, je)
371
- ], 12, Ue))
157
+ b("path", { d: t.path }, null, 8, qe)
158
+ ], 12, Qe))
372
159
  ]);
373
160
  }
374
- const Ke = /* @__PURE__ */ V(Ne, [["render", Je], ["__scopeId", "data-v-1c30ca93"]]), Qe = {
161
+ const Ge = /* @__PURE__ */ V(Ke, [["render", Ye], ["__scopeId", "data-v-1c30ca93"]]), Xe = {
375
162
  menu: "M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z",
376
163
  more: "M76.92892277 192.94787572h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758116H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758116s23.20379058 46.40758118 46.40758264 46.40758118zM941.27013031 465.59241882H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758118h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758118zM941.27013031 825.25117589H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758264h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758264s-23.20379058-46.40758118-46.40758118-46.40758118z",
377
164
  refresh: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z",
@@ -383,9 +170,9 @@ const Ke = /* @__PURE__ */ V(Ne, [["render", Je], ["__scopeId", "data-v-1c30ca93
383
170
  download: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z",
384
171
  delete: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32",
385
172
  copy: "M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"
386
- }, H = Object.entries(Qe).reduce((e, [l, t]) => {
387
- const a = `${l}Icon`, i = {
388
- name: a,
173
+ }, A = Object.entries(Xe).reduce((e, [i, t]) => {
174
+ const n = `${i}Icon`, l = {
175
+ name: n,
389
176
  props: {
390
177
  path: {
391
178
  type: String,
@@ -399,18 +186,18 @@ const Ke = /* @__PURE__ */ V(Ne, [["render", Je], ["__scopeId", "data-v-1c30ca93
399
186
  }
400
187
  },
401
188
  render(s) {
402
- return Ve(Ke, this.$props);
189
+ return me(Ge, this.$props);
403
190
  }
404
191
  };
405
- return i.install = (s) => {
406
- s.component(a, i);
407
- }, e[l] = i, e;
408
- }, {}), qe = H.menu, Ye = H.refresh, Ge = H.move;
409
- H["column-setting"];
410
- const Xe = H.more, Ze = H["fixed-left"], $e = H["fixed-right"], et = H.upload, tt = H.download, lt = H.delete, de = H.copy, { t: $ } = W(), it = !1, st = !0, at = {
192
+ return l.install = (s) => {
193
+ s.component(n, l);
194
+ }, e[i] = l, e;
195
+ }, {}), Ze = A.menu, $e = A.refresh, et = A.move;
196
+ A["column-setting"];
197
+ const tt = A.more, it = A["fixed-left"], lt = A["fixed-right"], st = A.upload, nt = A.download, at = A.delete, be = A.copy, { t: ee } = R(), ot = !1, rt = !0, ut = {
411
198
  name: "TmEllipsisText",
412
199
  components: {
413
- CopyIcon: de
200
+ CopyIcon: be
414
201
  },
415
202
  props: {
416
203
  text: {
@@ -443,8 +230,8 @@ const Xe = H.more, Ze = H["fixed-left"], $e = H["fixed-right"], et = H.upload, t
443
230
  },
444
231
  data() {
445
232
  return {
446
- isVue2: it,
447
- isVue3: st,
233
+ isVue2: ot,
234
+ isVue3: rt,
448
235
  isOverflow: !1,
449
236
  currentLines: 1,
450
237
  resizeObserver: null
@@ -455,10 +242,10 @@ const Xe = H.more, Ze = H["fixed-left"], $e = H["fixed-right"], et = H.upload, t
455
242
  return !this.showTooltip || !this.isOverflow;
456
243
  },
457
244
  textStyle() {
458
- const e = typeof this.width == "number" ? `${this.width}px` : this.width, l = typeof this.maxWidth == "number" ? `${this.maxWidth}px` : this.maxWidth;
245
+ const e = typeof this.width == "number" ? `${this.width}px` : this.width, i = typeof this.maxWidth == "number" ? `${this.maxWidth}px` : this.maxWidth;
459
246
  return {
460
247
  width: e,
461
- maxWidth: l,
248
+ maxWidth: i,
462
249
  lineHeight: this.lineHeight,
463
250
  display: "-webkit-inline-box",
464
251
  overflow: "hidden",
@@ -490,26 +277,26 @@ const Xe = H.more, Ze = H["fixed-left"], $e = H["fixed-right"], et = H.upload, t
490
277
  });
491
278
  },
492
279
  performOverflowCheck() {
493
- var c;
280
+ var h;
494
281
  const e = this.$refs.textEl;
495
282
  if (!e) return;
496
- const l = getComputedStyle(e);
497
- if (!l.width || l.width === "0px") {
283
+ const i = getComputedStyle(e);
284
+ if (!i.width || i.width === "0px") {
498
285
  this.$nextTick(() => {
499
286
  this.performOverflowCheck();
500
287
  });
501
288
  return;
502
289
  }
503
- const t = e.scrollHeight, a = e.scrollWidth, i = e.clientHeight, s = e.clientWidth, n = 1, h = t > i + n, u = a > s + n;
504
- if (h || u) {
290
+ const t = e.scrollHeight, n = e.scrollWidth, l = e.clientHeight, s = e.clientWidth, o = 1, c = t > l + o, d = n > s + o;
291
+ if (c || d) {
505
292
  this.isOverflow = !0;
506
- const C = parseFloat(l.lineHeight) || 16;
507
- this.currentLines = Math.ceil(t / C);
293
+ const y = parseFloat(i.lineHeight) || 16;
294
+ this.currentLines = Math.ceil(t / y);
508
295
  } else {
509
- const C = e.getBoundingClientRect(), O = (c = e.parentElement) == null ? void 0 : c.getBoundingClientRect();
510
- if (O) {
511
- const D = C.height > O.height || C.width > O.width;
512
- this.isOverflow = D;
296
+ const y = e.getBoundingClientRect(), F = (h = e.parentElement) == null ? void 0 : h.getBoundingClientRect();
297
+ if (F) {
298
+ const O = y.height > F.height || y.width > F.width;
299
+ this.isOverflow = O;
513
300
  } else
514
301
  this.isOverflow = !1;
515
302
  this.currentLines = 1;
@@ -542,7 +329,7 @@ const Xe = H.more, Ze = H["fixed-left"], $e = H["fixed-right"], et = H.upload, t
542
329
  },
543
330
  handleCopy() {
544
331
  navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(this.text).then(() => {
545
- this.$message.success($("copySuccess"));
332
+ this.$message.success(ee("copySuccess"));
546
333
  }).catch(() => {
547
334
  this.fallbackCopy();
548
335
  }) : this.fallbackCopy();
@@ -551,54 +338,478 @@ const Xe = H.more, Ze = H["fixed-left"], $e = H["fixed-right"], et = H.upload, t
551
338
  const e = document.createElement("textarea");
552
339
  e.value = this.text, e.style.position = "fixed", e.style.left = "-999999px", e.style.top = "-999999px", document.body.appendChild(e), e.focus(), e.select();
553
340
  try {
554
- document.execCommand("copy"), this.$message.success($("copySuccess"));
555
- } catch (l) {
556
- this.$message.error($("copyFailed"));
341
+ document.execCommand("copy"), this.$message.success(ee("copySuccess"));
342
+ } catch (i) {
343
+ this.$message.error(ee("copyFailed"));
557
344
  }
558
345
  document.body.removeChild(e);
559
346
  }
560
347
  }
561
- }, nt = { class: "ellipsis-text-container" };
562
- function ot(e, l, t, a, i, s) {
563
- const n = d("CopyIcon"), h = d("el-tooltip");
564
- return r(), m(h, x({
348
+ }, dt = { class: "ellipsis-text-container" };
349
+ function ct(e, i, t, n, l, s) {
350
+ const o = u("CopyIcon"), c = u("el-tooltip");
351
+ return r(), m(c, _({
565
352
  disabled: s.tooltipDisabled,
566
353
  content: t.text,
567
354
  effect: "dark",
568
355
  placement: "top"
569
356
  }, {
570
- [i.isVue2 ? "open-delay" : "show-after"]: 300
357
+ [l.isVue2 ? "open-delay" : "show-after"]: 300
571
358
  }), {
572
359
  default: f(() => [
573
- y("div", nt, [
574
- y("div", {
360
+ b("div", dt, [
361
+ b("div", {
575
362
  ref: "textEl",
576
363
  class: "ellipsis-text",
577
- style: N(s.textStyle)
578
- }, S(t.text), 5),
579
- y("div", {
580
- class: A(["toolbar", { multiline: i.currentLines > 1 && t.lines > 1 }])
364
+ style: U(s.textStyle)
365
+ }, w(t.text), 5),
366
+ b("div", {
367
+ class: X(["toolbar", { multiline: l.currentLines > 1 && t.lines > 1 }])
581
368
  }, [
582
- t.copyable ? (r(), m(n, {
369
+ t.copyable ? (r(), m(o, {
583
370
  key: 0,
584
371
  class: "icon-item",
585
372
  onClick: s.handleCopy
586
- }, null, 8, ["onClick"])) : b("", !0)
373
+ }, null, 8, ["onClick"])) : v("", !0)
587
374
  ], 2)
588
375
  ])
589
376
  ]),
590
- _: 1
591
- }, 16, ["disabled", "content"]);
377
+ _: 1
378
+ }, 16, ["disabled", "content"]);
379
+ }
380
+ const $ = /* @__PURE__ */ V(ut, [["render", ct], ["__scopeId", "data-v-a51a2011"]]);
381
+ var ht = Object.defineProperty, ft = Object.defineProperties, pt = Object.getOwnPropertyDescriptors, ce = Object.getOwnPropertySymbols, mt = Object.prototype.hasOwnProperty, gt = Object.prototype.propertyIsEnumerable, he = (e, i, t) => i in e ? ht(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, fe = (e, i) => {
382
+ for (var t in i || (i = {}))
383
+ mt.call(i, t) && he(e, t, i[t]);
384
+ if (ce)
385
+ for (var t of ce(i))
386
+ gt.call(i, t) && he(e, t, i[t]);
387
+ return e;
388
+ }, pe = (e, i) => ft(e, pt(i));
389
+ const bt = {
390
+ name: "RenderVue3",
391
+ inheritAttrs: !1
392
+ }, yt = /* @__PURE__ */ Me(pe(fe({}, bt), {
393
+ props: {
394
+ renderFn: { type: Function },
395
+ data: {}
396
+ },
397
+ setup(e) {
398
+ const i = e, t = Ae(), n = He(), l = ue(() => pe(fe({}, i.data || {}), {
399
+ $attrs: t,
400
+ $slots: n
401
+ })), s = ue(() => {
402
+ try {
403
+ if (!i.renderFn || typeof i.renderFn != "function")
404
+ return console.warn("[RenderComponent] renderFn must be a function"), null;
405
+ const o = i.renderFn.toString(), c = /\(\s*h\s*[,)]/.test(o) || i.renderFn.length >= 1;
406
+ let d;
407
+ return c ? d = i.renderFn(me, l.value) : d = i.renderFn(l.value), d;
408
+ } catch (o) {
409
+ return console.error("[RenderComponent] Error in render function:", o), null;
410
+ }
411
+ });
412
+ return (o, c) => (r(), m(Re(s.value)));
413
+ }
414
+ })), vt = !1, Ct = !0, _t = {
415
+ name: "FormItemLayout",
416
+ components: {
417
+ EllipsisText: $,
418
+ RenderComponent: yt
419
+ },
420
+ props: {
421
+ // 布局方向
422
+ direction: {
423
+ type: String,
424
+ default: "horizontal",
425
+ // 'horizontal' | 'vertical'
426
+ validator: (e) => ["horizontal", "vertical"].includes(e)
427
+ },
428
+ // 尺寸配置
429
+ labelWidth: {
430
+ type: [String, Number],
431
+ default: 120
432
+ },
433
+ inputWidth: {
434
+ type: [String, Number],
435
+ default: 240
436
+ },
437
+ // Label 配置
438
+ label: {
439
+ type: [String, Function, Object, Array],
440
+ default: ""
441
+ },
442
+ labelOptions: {
443
+ type: Array,
444
+ default: () => []
445
+ },
446
+ field: {
447
+ type: [String, Number],
448
+ default: ""
449
+ }
450
+ },
451
+ data() {
452
+ return {
453
+ t: R().t,
454
+ isVue2: vt,
455
+ isVue3: Ct,
456
+ getDefaultSize: M
457
+ };
458
+ },
459
+ computed: {
460
+ hasLabel() {
461
+ return this.labelOptions && this.labelOptions.length || this.label;
462
+ },
463
+ // 容器样式
464
+ containerStyle() {
465
+ const e = {};
466
+ if (this.direction === "horizontal") {
467
+ const i = this.hasLabel ? this.parsedLabelWidth + this.parsedInputWidth : this.parsedInputWidth;
468
+ e.width = `${i}px`;
469
+ } else
470
+ e.width = `${this.parsedInputWidth}px`;
471
+ return e;
472
+ },
473
+ // Label 样式
474
+ labelStyle() {
475
+ const e = {};
476
+ return this.direction === "horizontal" ? e.width = `${this.parsedLabelWidth}px` : e.width = `${this.parsedInputWidth}px`, e;
477
+ },
478
+ // Input 样式
479
+ inputStyle() {
480
+ return {
481
+ width: `${this.parsedInputWidth}px`
482
+ };
483
+ },
484
+ // 解析后的 labelWidth
485
+ parsedLabelWidth() {
486
+ return typeof this.labelWidth == "string" ? parseInt(this.labelWidth) : this.labelWidth;
487
+ },
488
+ // 解析后的 inputWidth
489
+ parsedInputWidth() {
490
+ return typeof this.inputWidth == "string" ? parseInt(this.inputWidth) : this.inputWidth;
491
+ },
492
+ fieldValue: {
493
+ get() {
494
+ return this.field;
495
+ },
496
+ set(e) {
497
+ this.$emit("field-change", e);
498
+ }
499
+ }
500
+ },
501
+ watch: {
502
+ labelOptions: {
503
+ handler(e) {
504
+ e && e.length > 0 && !this.field && this.$emit("field-change", e[0].value);
505
+ },
506
+ deep: !0,
507
+ immediate: !0
508
+ }
509
+ },
510
+ methods: {
511
+ handleFieldChange(e) {
512
+ this.$emit("field-change", e);
513
+ }
514
+ }
515
+ }, St = {
516
+ key: 0,
517
+ class: "label-text"
518
+ }, xt = {
519
+ key: 1,
520
+ class: "label-render"
521
+ };
522
+ function Tt(e, i, t, n, l, s) {
523
+ const o = u("el-option"), c = u("el-select"), d = u("EllipsisText"), h = u("RenderComponent");
524
+ return r(), g("div", {
525
+ class: X(["form-item-layout", {
526
+ "form-item-layout--horizontal": t.direction === "horizontal",
527
+ "form-item-layout--vertical": t.direction === "vertical"
528
+ }]),
529
+ style: U(s.containerStyle)
530
+ }, [
531
+ s.hasLabel ? (r(), g("div", {
532
+ key: 0,
533
+ class: "form-item-label",
534
+ style: U(s.labelStyle)
535
+ }, [
536
+ t.labelOptions && t.labelOptions.length ? (r(), m(c, {
537
+ key: 0,
538
+ modelValue: s.fieldValue,
539
+ "onUpdate:modelValue": i[0] || (i[0] = (y) => s.fieldValue = y),
540
+ placeholder: l.t("selectPlaceholder"),
541
+ size: l.getDefaultSize(),
542
+ class: "label-select",
543
+ onChange: s.handleFieldChange
544
+ }, {
545
+ default: f(() => [
546
+ (r(!0), g(k, null, D(t.labelOptions, (y) => (r(), m(o, {
547
+ key: y.value,
548
+ label: y.label,
549
+ value: y.value
550
+ }, null, 8, ["label", "value"]))), 128))
551
+ ]),
552
+ _: 1
553
+ }, 8, ["modelValue", "placeholder", "size", "onChange"])) : t.label ? (r(), g(k, { key: 1 }, [
554
+ typeof t.label == "string" ? (r(), g("div", St, [
555
+ p(d, {
556
+ text: t.label,
557
+ lines: 2
558
+ }, null, 8, ["text"])
559
+ ])) : typeof t.label == "function" ? (r(), g("div", xt, [
560
+ p(h, { "render-fn": t.label }, null, 8, ["render-fn"])
561
+ ])) : v("", !0)
562
+ ], 64)) : v("", !0)
563
+ ], 4)) : v("", !0),
564
+ b("div", {
565
+ class: "form-item-input",
566
+ style: U(s.inputStyle)
567
+ }, [
568
+ x(e.$slots, "default", {}, void 0, !0)
569
+ ], 4)
570
+ ], 6);
571
+ }
572
+ const P = /* @__PURE__ */ V(_t, [["render", Tt], ["__scopeId", "data-v-e75cd736"]]), wt = !1, Vt = !0, q = "modelValue", Ft = "update:modelValue", zt = {
573
+ name: "TmSelectFilter",
574
+ components: {
575
+ FormItemLayout: P
576
+ },
577
+ props: {
578
+ [q]: {
579
+ type: [String, Number, Array],
580
+ default: ""
581
+ },
582
+ field: {
583
+ type: [String, Number],
584
+ default: ""
585
+ },
586
+ options: {
587
+ type: [Array, Function],
588
+ default: () => []
589
+ },
590
+ labelOptions: {
591
+ type: Array,
592
+ default: () => []
593
+ },
594
+ label: {
595
+ type: [String, Function, Object, Array],
596
+ default: null
597
+ },
598
+ props: {
599
+ type: Object,
600
+ default: () => ({
601
+ label: "label",
602
+ value: "value"
603
+ })
604
+ },
605
+ filterable: {
606
+ type: Boolean,
607
+ default: !0
608
+ },
609
+ clearable: {
610
+ type: Boolean,
611
+ default: !0
612
+ },
613
+ collapseTags: {
614
+ type: Boolean,
615
+ default: !0
616
+ },
617
+ multiple: {
618
+ type: Boolean,
619
+ default: !1
620
+ },
621
+ showCheckAll: {
622
+ type: Boolean,
623
+ default: !0
624
+ },
625
+ placeholder: {
626
+ type: String,
627
+ default: ""
628
+ },
629
+ valueOnClear: {
630
+ type: [String, Number, Boolean, Array, Function],
631
+ default: void 0
632
+ },
633
+ // FormItemLayout 配置参数
634
+ labelWidth: {
635
+ type: [String, Number],
636
+ default: void 0
637
+ },
638
+ inputWidth: {
639
+ type: [String, Number],
640
+ default: void 0
641
+ },
642
+ direction: {
643
+ type: String,
644
+ default: void 0,
645
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
646
+ }
647
+ },
648
+ data() {
649
+ return {
650
+ t: R().t,
651
+ isVue2: wt,
652
+ isVue3: Vt,
653
+ getDefaultSize: M,
654
+ optionsList: [],
655
+ loading: !1,
656
+ indeterminate: !1,
657
+ checkAll: !1
658
+ };
659
+ },
660
+ computed: {
661
+ computedValue: {
662
+ get() {
663
+ return this[q];
664
+ },
665
+ set(e) {
666
+ let i = e;
667
+ if (this.multiple && Array.isArray(e) && e.length === 0 && this.valueOnClear !== void 0) {
668
+ const t = this[q];
669
+ Array.isArray(t) && t.length > 0 && (i = typeof this.valueOnClear == "function" ? this.valueOnClear() : this.valueOnClear);
670
+ }
671
+ this.$emit(Ft, i), this.$emit("change", i);
672
+ }
673
+ },
674
+ propMap() {
675
+ return {
676
+ label: this.props.label || "label",
677
+ value: this.props.value || "value"
678
+ };
679
+ }
680
+ },
681
+ watch: {
682
+ [q](e) {
683
+ !this.multiple || !this.showCheckAll || (e.length === 0 ? (this.checkAll = !1, this.indeterminate = !1) : e.length === this.optionsList.length ? (this.checkAll = !0, this.indeterminate = !1) : this.indeterminate = !0);
684
+ }
685
+ },
686
+ created() {
687
+ this.initOptions();
688
+ },
689
+ methods: {
690
+ handleFieldChange(e) {
691
+ this.$emit("field-change", e);
692
+ },
693
+ async initOptions() {
694
+ if (Array.isArray(this.options))
695
+ this.optionsList = this.options;
696
+ else if (typeof this.options == "function")
697
+ try {
698
+ this.loading = !0;
699
+ const e = await this.options();
700
+ Array.isArray(e) && (this.optionsList = e);
701
+ } catch (e) {
702
+ console.error(e);
703
+ } finally {
704
+ this.loading = !1;
705
+ }
706
+ },
707
+ handleCheckAll(e) {
708
+ this.indeterminate = !1;
709
+ let i = [];
710
+ e && (i = this.optionsList.map((t) => t[this.propMap.value])), this.computedValue = i;
711
+ },
712
+ handleClear() {
713
+ if (this.valueOnClear !== void 0) {
714
+ const e = typeof this.valueOnClear == "function" ? this.valueOnClear() : this.valueOnClear;
715
+ this.$nextTick(() => {
716
+ this.computedValue = e;
717
+ });
718
+ }
719
+ }
720
+ }
721
+ }, Lt = {
722
+ key: 0,
723
+ class: "check-all-option"
724
+ };
725
+ function kt(e, i, t, n, l, s) {
726
+ const o = u("el-checkbox"), c = u("el-option"), d = u("el-select"), h = u("FormItemLayout");
727
+ return r(), m(h, {
728
+ label: t.label,
729
+ "label-options": t.labelOptions,
730
+ field: t.field,
731
+ onFieldChange: s.handleFieldChange,
732
+ "label-width": t.labelWidth,
733
+ "input-width": t.inputWidth,
734
+ direction: t.direction
735
+ }, {
736
+ default: f(() => [
737
+ p(d, _({
738
+ ref: "select",
739
+ class: "select",
740
+ onClear: s.handleClear,
741
+ modelValue: s.computedValue,
742
+ "onUpdate:modelValue": i[2] || (i[2] = (y) => s.computedValue = y)
743
+ }, W(T({}, e.$attrs), {
744
+ size: l.getDefaultSize(),
745
+ filterable: t.filterable,
746
+ clearable: t.clearable,
747
+ collapseTags: t.collapseTags,
748
+ multiple: t.multiple,
749
+ placeholder: t.placeholder,
750
+ loading: l.loading
751
+ }), I(l.isVue2 ? e.$listeners : {}), { loading: l.loading }), {
752
+ header: f(() => [
753
+ l.isVue3 && t.multiple && t.showCheckAll ? (r(), m(o, {
754
+ key: 0,
755
+ modelValue: l.checkAll,
756
+ "onUpdate:modelValue": i[1] || (i[1] = (y) => l.checkAll = y),
757
+ indeterminate: l.indeterminate,
758
+ size: l.getDefaultSize(),
759
+ onChange: s.handleCheckAll,
760
+ style: { width: "100%", height: "20px", "padding-left": "10px" }
761
+ }, {
762
+ default: f(() => [
763
+ L(w(l.t("all")), 1)
764
+ ]),
765
+ _: 1
766
+ }, 8, ["modelValue", "indeterminate", "size", "onChange"])) : v("", !0)
767
+ ]),
768
+ default: f(() => [
769
+ l.isVue2 && t.multiple && t.showCheckAll ? (r(), g("div", Lt, [
770
+ p(o, {
771
+ style: { width: "100%" },
772
+ modelValue: l.checkAll,
773
+ "onUpdate:modelValue": i[0] || (i[0] = (y) => l.checkAll = y),
774
+ indeterminate: l.indeterminate,
775
+ size: l.getDefaultSize(),
776
+ onChange: s.handleCheckAll
777
+ }, {
778
+ default: f(() => [
779
+ L(w(l.t("all")), 1)
780
+ ]),
781
+ _: 1
782
+ }, 8, ["modelValue", "indeterminate", "size", "onChange"])
783
+ ])) : v("", !0),
784
+ (r(!0), g(k, null, D(l.optionsList, (y) => (r(), m(c, {
785
+ key: y[s.propMap.value],
786
+ label: y[s.propMap.label],
787
+ value: y[s.propMap.value],
788
+ disabled: y.disabled
789
+ }, {
790
+ default: f(() => [
791
+ x(e.$slots, "option", { item: y }, () => [
792
+ L(w(y[s.propMap.label]), 1)
793
+ ], !0)
794
+ ]),
795
+ _: 2
796
+ }, 1032, ["label", "value", "disabled"]))), 128))
797
+ ]),
798
+ _: 3
799
+ }, 16, ["onClear", "modelValue", "loading"])
800
+ ]),
801
+ _: 3
802
+ }, 8, ["label", "label-options", "field", "onFieldChange", "label-width", "input-width", "direction"]);
592
803
  }
593
- const Q = /* @__PURE__ */ V(at, [["render", ot], ["__scopeId", "data-v-0979131f"]]), rt = !1, ut = !0, dt = {
804
+ const ye = /* @__PURE__ */ V(zt, [["render", kt], ["__scopeId", "data-v-b85e9ccb"]]), Ot = {
594
805
  name: "TmAdvancedInputFilter",
595
806
  components: {
596
- MoreIcon: Xe,
597
- EllipsisText: Q
807
+ MoreIcon: tt,
808
+ FormItemLayout: P
598
809
  },
599
810
  props: {
600
811
  label: {
601
- type: String,
812
+ type: [String, Function, Object, Array],
602
813
  default: ""
603
814
  },
604
815
  value: {
@@ -620,14 +831,26 @@ const Q = /* @__PURE__ */ V(at, [["render", ot], ["__scopeId", "data-v-0979131f"
620
831
  labelOptions: {
621
832
  type: Array,
622
833
  default: () => []
834
+ },
835
+ // FormItemLayout 配置参数
836
+ labelWidth: {
837
+ type: [String, Number],
838
+ default: void 0
839
+ },
840
+ inputWidth: {
841
+ type: [String, Number],
842
+ default: void 0
843
+ },
844
+ direction: {
845
+ type: String,
846
+ default: void 0,
847
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
623
848
  }
624
849
  },
625
850
  data() {
626
851
  return {
627
- t: W().t,
628
- isVue3: ut,
629
- isVue2: rt,
630
- getDefaultSize: I,
852
+ t: R().t,
853
+ getDefaultSize: M,
631
854
  getCompatSize: K,
632
855
  exactValue: "",
633
856
  inputValue: "",
@@ -636,17 +859,6 @@ const Q = /* @__PURE__ */ V(at, [["render", ot], ["__scopeId", "data-v-0979131f"
636
859
  };
637
860
  },
638
861
  computed: {
639
- width() {
640
- return this.labelOptions && this.labelOptions.length || this.label ? "305px" : "200px";
641
- },
642
- fieldValue: {
643
- get() {
644
- return this.field;
645
- },
646
- set(e) {
647
- this.$emit("field-change", e);
648
- }
649
- },
650
862
  // 是否显示精确搜索按钮,根据当前选中的option或全局设置决定
651
863
  shouldShowMultiple() {
652
864
  return this.currentOptionMultiple !== null ? this.currentOptionMultiple : this.multiple;
@@ -657,19 +869,6 @@ const Q = /* @__PURE__ */ V(at, [["render", ot], ["__scopeId", "data-v-0979131f"
657
869
  }
658
870
  },
659
871
  watch: {
660
- labelOptions: {
661
- handler(e) {
662
- e && e.length > 0 && (this.field || this.$emit("field-change", e[0].value), this.updateCurrentOptionMultiple());
663
- },
664
- deep: !0,
665
- immediate: !0
666
- },
667
- field: {
668
- handler() {
669
- this.updateCurrentOptionMultiple();
670
- },
671
- immediate: !0
672
- },
673
872
  isExactMode(e) {
674
873
  e ? this.$emit("value-change", this.exactValue) : this.$emit("value-change", this.inputValue);
675
874
  },
@@ -714,120 +913,100 @@ const Q = /* @__PURE__ */ V(at, [["render", ot], ["__scopeId", "data-v-0979131f"
714
913
  created() {
715
914
  this.updateCurrentOptionMultiple();
716
915
  }
717
- }, ct = {
718
- key: 1,
719
- class: "input-label"
720
- }, ht = { class: "popover-content" }, ft = { class: "popover-subtitle" }, pt = { class: "popover-footer" };
721
- function mt(e, l, t, a, i, s) {
722
- const n = d("el-option"), h = d("el-select"), u = d("EllipsisText"), c = d("el-input"), C = d("el-button"), O = d("MoreIcon"), D = d("el-popover");
723
- return r(), p("div", {
724
- class: A(["tm-advanced-input", `tm-advanced-input--${i.isVue3 ? "v3" : "v2"}`]),
725
- style: N({ width: s.width })
726
- }, [
727
- t.labelOptions && t.labelOptions.length ? (r(), m(h, {
728
- key: 0,
729
- modelValue: s.fieldValue,
730
- "onUpdate:modelValue": l[0] || (l[0] = (w) => s.fieldValue = w),
731
- placeholder: i.t("selectPlaceholder"),
732
- style: { width: "100px", "flex-shrink": "0" },
733
- size: i.getDefaultSize(),
734
- class: "left-select",
735
- onChange: s.handlefieldChange
736
- }, {
737
- default: f(() => [
738
- (r(!0), p(k, null, M(t.labelOptions, (w) => (r(), m(n, {
739
- key: w.value,
740
- label: w.label,
741
- value: w.value
742
- }, null, 8, ["label", "value"]))), 128))
743
- ]),
744
- _: 1
745
- }, 8, ["modelValue", "placeholder", "size", "onChange"])) : t.label ? (r(), p("div", ct, [
746
- g(u, {
747
- text: t.label,
748
- lines: 2
749
- }, null, 8, ["text"])
750
- ])) : b("", !0),
751
- g(c, {
752
- modelValue: i.inputValue,
753
- "onUpdate:modelValue": l[2] || (l[2] = (w) => i.inputValue = w),
754
- size: i.getDefaultSize(),
755
- placeholder: t.placeholder,
756
- onKeyup: we(s.handleEnter, ["enter", "native"]),
757
- clearable: "",
758
- class: A(["right-input", { "has-label": t.labelOptions && t.labelOptions.length }])
759
- }, {
760
- default: f(() => [
761
- s.shouldShowMultiple ? (r(), m(D, x({
762
- key: 0,
763
- slot: "append"
764
- }, {
765
- [i.isVue3 ? "visible" : "value"]: i.isExactMode,
766
- placement: "bottom-end",
767
- width: 260,
768
- trigger: "click"
769
- }, E({
770
- [i.isVue3 ? "update:visible" : "input"]: s.handleVisibleChange
771
- })), {
772
- reference: f(() => [
773
- g(O, { style: { cursor: "pointer" } })
774
- ]),
775
- default: f(() => [
776
- y("div", ht, [
777
- y("p", ft, S(i.t("accurateSearchTips")), 1),
778
- g(c, {
779
- size: i.getDefaultSize(),
780
- type: "textarea",
781
- rows: 8,
782
- modelValue: i.exactValue,
783
- "onUpdate:modelValue": l[1] || (l[1] = (w) => i.exactValue = w),
784
- placeholder: i.t("accurateSearchPlaceholder"),
785
- style: { "font-size": "12px" }
786
- }, null, 8, ["size", "modelValue", "placeholder"]),
787
- y("div", pt, [
788
- g(C, {
789
- style: { float: "left" },
790
- size: i.getCompatSize("mini"),
791
- onClick: s.handleClear
792
- }, {
793
- default: f(() => [
794
- L(S(i.t("clear")), 1)
795
- ]),
796
- _: 1
797
- }, 8, ["size", "onClick"]),
798
- g(C, {
799
- size: i.getCompatSize("mini"),
800
- onClick: s.handlePopoverClose
801
- }, {
802
- default: f(() => [
803
- L(S(i.t("cancel")), 1)
804
- ]),
805
- _: 1
806
- }, 8, ["size", "onClick"]),
807
- g(C, {
808
- type: "primary",
809
- size: i.getCompatSize("mini"),
810
- onClick: s.handleExactSearch
811
- }, {
812
- default: f(() => [
813
- L(S(i.t("search")), 1)
814
- ]),
815
- _: 1
816
- }, 8, ["size", "onClick"])
817
- ])
818
- ])
916
+ }, Dt = { class: "popover-content" }, Mt = { class: "popover-subtitle" }, At = { class: "popover-footer" };
917
+ function Ht(e, i, t, n, l, s) {
918
+ const o = u("el-input"), c = u("el-button"), d = u("MoreIcon"), h = u("el-popover"), y = u("FormItemLayout");
919
+ return r(), m(y, {
920
+ label: t.label,
921
+ "label-options": t.labelOptions,
922
+ field: t.field,
923
+ onFieldChange: s.handlefieldChange,
924
+ "label-width": t.labelWidth,
925
+ "input-width": t.inputWidth,
926
+ direction: t.direction
927
+ }, {
928
+ default: f(() => [
929
+ p(o, {
930
+ modelValue: l.inputValue,
931
+ "onUpdate:modelValue": i[1] || (i[1] = (F) => l.inputValue = F),
932
+ size: l.getDefaultSize(),
933
+ placeholder: t.placeholder,
934
+ onKeyup: Ee(s.handleEnter, ["enter", "native"]),
935
+ clearable: "",
936
+ class: "advanced-input"
937
+ }, ge({ _: 2 }, [
938
+ s.shouldShowMultiple ? {
939
+ name: "append",
940
+ fn: f(() => [
941
+ p(h, {
942
+ visible: l.isExactMode,
943
+ placement: "bottom-end",
944
+ width: 260,
945
+ trigger: "click",
946
+ "onUpdate:visible": s.handleVisibleChange
947
+ }, {
948
+ reference: f(() => [
949
+ p(d, { style: { cursor: "pointer" } })
950
+ ]),
951
+ default: f(() => [
952
+ b("div", Dt, [
953
+ b("p", Mt, w(l.t("accurateSearchTips")), 1),
954
+ p(o, {
955
+ size: l.getDefaultSize(),
956
+ type: "textarea",
957
+ rows: 8,
958
+ modelValue: l.exactValue,
959
+ "onUpdate:modelValue": i[0] || (i[0] = (F) => l.exactValue = F),
960
+ placeholder: l.t("accurateSearchPlaceholder"),
961
+ style: { "font-size": "12px" }
962
+ }, null, 8, ["size", "modelValue", "placeholder"]),
963
+ b("div", At, [
964
+ p(c, {
965
+ style: { float: "left" },
966
+ size: l.getCompatSize("mini"),
967
+ onClick: s.handleClear
968
+ }, {
969
+ default: f(() => [
970
+ L(w(l.t("clear")), 1)
971
+ ]),
972
+ _: 1
973
+ }, 8, ["size", "onClick"]),
974
+ p(c, {
975
+ size: l.getCompatSize("mini"),
976
+ onClick: s.handlePopoverClose
977
+ }, {
978
+ default: f(() => [
979
+ L(w(l.t("cancel")), 1)
980
+ ]),
981
+ _: 1
982
+ }, 8, ["size", "onClick"]),
983
+ p(c, {
984
+ type: "primary",
985
+ size: l.getCompatSize("mini"),
986
+ onClick: s.handleExactSearch
987
+ }, {
988
+ default: f(() => [
989
+ L(w(l.t("search")), 1)
990
+ ]),
991
+ _: 1
992
+ }, 8, ["size", "onClick"])
993
+ ])
994
+ ])
995
+ ]),
996
+ _: 1
997
+ }, 8, ["visible", "onUpdate:visible"])
819
998
  ]),
820
- _: 1
821
- }, 16)) : b("", !0)
822
- ]),
823
- _: 1
824
- }, 8, ["modelValue", "size", "placeholder", "onKeyup", "class"])
825
- ], 6);
999
+ key: "0"
1000
+ } : void 0
1001
+ ]), 1032, ["modelValue", "size", "placeholder", "onKeyup"])
1002
+ ]),
1003
+ _: 1
1004
+ }, 8, ["label", "label-options", "field", "onFieldChange", "label-width", "input-width", "direction"]);
826
1005
  }
827
- const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac"]]), { t: z } = W(), gt = !1, bt = !0, yt = "modelValue", vt = {
1006
+ const ve = /* @__PURE__ */ V(Ot, [["render", Ht], ["__scopeId", "data-v-1a69f415"]]), { t: z } = R(), Rt = !1, Et = !0, It = "modelValue", Wt = {
828
1007
  name: "TmAdvancedDateFilter",
829
1008
  components: {
830
- EllipsisText: Q
1009
+ FormItemLayout: P
831
1010
  },
832
1011
  props: {
833
1012
  value: {
@@ -855,7 +1034,7 @@ const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac
855
1034
  default: () => []
856
1035
  },
857
1036
  label: {
858
- type: String,
1037
+ type: [String, Function, Object, Array],
859
1038
  default: ""
860
1039
  },
861
1040
  type: {
@@ -934,6 +1113,20 @@ const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac
934
1113
  pastOnly: {
935
1114
  type: Boolean,
936
1115
  default: !1
1116
+ },
1117
+ // FormItemLayout 配置参数
1118
+ labelWidth: {
1119
+ type: [String, Number],
1120
+ default: void 0
1121
+ },
1122
+ inputWidth: {
1123
+ type: [String, Number],
1124
+ default: void 0
1125
+ },
1126
+ direction: {
1127
+ type: String,
1128
+ default: void 0,
1129
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
937
1130
  }
938
1131
  },
939
1132
  computed: {
@@ -951,60 +1144,55 @@ const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac
951
1144
  if (this.isRangeType)
952
1145
  return this.endPlaceholder !== void 0 ? this.endPlaceholder : z("endDate");
953
1146
  },
954
- // 计算日期选择器样式
955
- computedDatePickerStyle() {
956
- const e = this.labelOptions && this.labelOptions.length > 0, l = this.label && !this.isRangeType && (!this.labelOptions || this.labelOptions.length === 0);
957
- return e ? "width: 206px" : l ? "width: 200px" : "width: 306px";
958
- },
959
1147
  computedFormat() {
960
1148
  const e = "YYYY";
961
1149
  return this.format ? this.format : this.type === "year" ? e : this.type === "month" ? `${e}-MM` : this.type === "date" ? `${e}-MM-DD` : this.type === "dates" ? `${e}-MM-DD` : this.type === "months" ? `${e}-MM` : this.type === "years" ? e : this.type === "week" ? `${e}-MM-WW` : this.type === "datetime" ? `${e}-MM-DD HH:mm:ss` : this.type === "datetimerange" ? `${e}-MM-DD HH:mm:ss` : this.type === "daterange" ? `${e}-MM-DD` : this.type === "monthrange" ? `${e}-MM` : "";
962
1150
  },
963
1151
  computedPickerOptions() {
964
1152
  const e = {};
965
- if (this.pastOnly && (e.disabledDate = (l) => l.getTime() > Date.now()), ["daterange", "datetimerange"].includes(this.type)) {
966
- const l = this.type === "datetimerange";
1153
+ if (this.pastOnly && (e.disabledDate = (i) => i.getTime() > Date.now()), ["daterange", "datetimerange"].includes(this.type)) {
1154
+ const i = this.type === "datetimerange";
967
1155
  e.shortcuts = this.shortcuts.length > 0 ? this.shortcuts : [
968
1156
  {
969
1157
  text: z("today"),
970
1158
  onClick(t) {
971
- const a = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
972
- l && (i.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999)), t.$emit("pick", [i, a]);
1159
+ const n = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1160
+ i && (l.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999)), t.$emit("pick", [l, n]);
973
1161
  }
974
1162
  },
975
1163
  {
976
1164
  text: z("yesterday"),
977
1165
  onClick(t) {
978
- const a = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
979
- i.setTime(i.getTime() - 3600 * 1e3 * 24), a.setTime(a.getTime() - 3600 * 1e3 * 24), l && (i.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999)), t.$emit("pick", [i, a]);
1166
+ const n = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1167
+ l.setTime(l.getTime() - 3600 * 1e3 * 24), n.setTime(n.getTime() - 3600 * 1e3 * 24), i && (l.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999)), t.$emit("pick", [l, n]);
980
1168
  }
981
1169
  },
982
1170
  {
983
1171
  text: z("last7days"),
984
1172
  onClick(t) {
985
- const a = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
986
- i.setTime(i.getTime() - 3600 * 1e3 * 24 * 7), l && (i.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999)), t.$emit("pick", [i, a]);
1173
+ const n = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1174
+ l.setTime(l.getTime() - 3600 * 1e3 * 24 * 7), i && (l.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999)), t.$emit("pick", [l, n]);
987
1175
  }
988
1176
  },
989
1177
  {
990
1178
  text: z("last30days"),
991
1179
  onClick(t) {
992
- const a = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
993
- i.setTime(i.getTime() - 3600 * 1e3 * 24 * 30), l && (i.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999)), t.$emit("pick", [i, a]);
1180
+ const n = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1181
+ l.setTime(l.getTime() - 3600 * 1e3 * 24 * 30), i && (l.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999)), t.$emit("pick", [l, n]);
994
1182
  }
995
1183
  },
996
1184
  {
997
1185
  text: z("thisMonth"),
998
1186
  onClick(t) {
999
- const a = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1000
- i.setDate(1), l && (i.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999)), t.$emit("pick", [i, a]);
1187
+ const n = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1188
+ l.setDate(1), i && (l.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999)), t.$emit("pick", [l, n]);
1001
1189
  }
1002
1190
  },
1003
1191
  {
1004
1192
  text: z("lastMonth"),
1005
1193
  onClick(t) {
1006
- const a = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1007
- i.setMonth(i.getMonth() - 1), i.setDate(1), a.setDate(0), l && (i.setHours(0, 0, 0, 0), a.setHours(23, 59, 59, 999)), t.$emit("pick", [i, a]);
1194
+ const n = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1195
+ l.setMonth(l.getMonth() - 1), l.setDate(1), n.setDate(0), i && (l.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999)), t.$emit("pick", [l, n]);
1008
1196
  }
1009
1197
  }
1010
1198
  ];
@@ -1021,43 +1209,43 @@ const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac
1021
1209
  {
1022
1210
  text: z("today"),
1023
1211
  value: () => {
1024
- const l = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1025
- return e && (t.setHours(0, 0, 0, 0), l.setHours(23, 59, 59, 999)), [t, l];
1212
+ const i = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1213
+ return e && (t.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), [t, i];
1026
1214
  }
1027
1215
  },
1028
1216
  {
1029
1217
  text: z("yesterday"),
1030
1218
  value: () => {
1031
- const l = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1032
- return t.setTime(t.getTime() - 3600 * 1e3 * 24), l.setTime(l.getTime() - 3600 * 1e3 * 24), e && (t.setHours(0, 0, 0, 0), l.setHours(23, 59, 59, 999)), [t, l];
1219
+ const i = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1220
+ return t.setTime(t.getTime() - 3600 * 1e3 * 24), i.setTime(i.getTime() - 3600 * 1e3 * 24), e && (t.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), [t, i];
1033
1221
  }
1034
1222
  },
1035
1223
  {
1036
1224
  text: z("last7days"),
1037
1225
  value: () => {
1038
- const l = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1039
- return t.setTime(t.getTime() - 3600 * 1e3 * 24 * 7), e && (t.setHours(0, 0, 0, 0), l.setHours(23, 59, 59, 999)), [t, l];
1226
+ const i = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1227
+ return t.setTime(t.getTime() - 3600 * 1e3 * 24 * 7), e && (t.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), [t, i];
1040
1228
  }
1041
1229
  },
1042
1230
  {
1043
1231
  text: z("last30days"),
1044
1232
  value: () => {
1045
- const l = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1046
- return t.setTime(t.getTime() - 3600 * 1e3 * 24 * 30), e && (t.setHours(0, 0, 0, 0), l.setHours(23, 59, 59, 999)), [t, l];
1233
+ const i = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1234
+ return t.setTime(t.getTime() - 3600 * 1e3 * 24 * 30), e && (t.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), [t, i];
1047
1235
  }
1048
1236
  },
1049
1237
  {
1050
1238
  text: z("thisMonth"),
1051
1239
  value: () => {
1052
- const l = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1053
- return t.setDate(1), e && (t.setHours(0, 0, 0, 0), l.setHours(23, 59, 59, 999)), [t, l];
1240
+ const i = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1241
+ return t.setDate(1), e && (t.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), [t, i];
1054
1242
  }
1055
1243
  },
1056
1244
  {
1057
1245
  text: z("lastMonth"),
1058
1246
  value: () => {
1059
- const l = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1060
- return t.setMonth(t.getMonth() - 1), t.setDate(1), l.setDate(0), e && (t.setHours(0, 0, 0, 0), l.setHours(23, 59, 59, 999)), [t, l];
1247
+ const i = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
1248
+ return t.setMonth(t.getMonth() - 1), t.setDate(1), i.setDate(0), e && (t.setHours(0, 0, 0, 0), i.setHours(23, 59, 59, 999)), [t, i];
1061
1249
  }
1062
1250
  }
1063
1251
  ];
@@ -1073,29 +1261,29 @@ const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac
1073
1261
  return e;
1074
1262
  if (e) {
1075
1263
  if (this.type === "datetimerange" && Array.isArray(e))
1076
- return e.map((l) => {
1077
- if (typeof l == "string") {
1078
- const t = /* @__PURE__ */ new Date(), [a, i, s] = l.split(":").map(Number);
1264
+ return e.map((i) => {
1265
+ if (typeof i == "string") {
1266
+ const t = /* @__PURE__ */ new Date(), [n, l, s] = i.split(":").map(Number);
1079
1267
  return new Date(
1080
1268
  t.getFullYear(),
1081
1269
  t.getMonth(),
1082
1270
  t.getDate(),
1083
- a,
1084
- i,
1271
+ n,
1272
+ l,
1085
1273
  s || 0
1086
1274
  );
1087
1275
  }
1088
- return l;
1276
+ return i;
1089
1277
  });
1090
1278
  if (this.type === "datetime" && typeof e == "string") {
1091
- const l = /* @__PURE__ */ new Date(), [t, a, i] = e.split(":").map(Number);
1279
+ const i = /* @__PURE__ */ new Date(), [t, n, l] = e.split(":").map(Number);
1092
1280
  return new Date(
1093
- l.getFullYear(),
1094
- l.getMonth(),
1095
- l.getDate(),
1281
+ i.getFullYear(),
1282
+ i.getMonth(),
1283
+ i.getDate(),
1096
1284
  t,
1097
- a,
1098
- i || 0
1285
+ n,
1286
+ l || 0
1099
1287
  );
1100
1288
  }
1101
1289
  return e;
@@ -1103,26 +1291,22 @@ const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac
1103
1291
  },
1104
1292
  dateValue() {
1105
1293
  return this.isRangeType ? this.start || this.end ? [this.start, this.end] : this.value : this.value;
1106
- },
1107
- fieldValue: {
1108
- get() {
1109
- return this.field;
1110
- },
1111
- set(e) {
1112
- this.$emit("field-change", e);
1113
- }
1114
1294
  }
1115
1295
  },
1116
1296
  data() {
1117
1297
  return {
1118
1298
  t: z,
1119
- isVue2: gt,
1120
- isVue3: bt,
1121
- getDefaultSize: I,
1122
- valueField: yt
1299
+ isVue2: Rt,
1300
+ isVue3: Et,
1301
+ getDefaultSize: M,
1302
+ valueField: It
1123
1303
  };
1124
1304
  },
1125
1305
  methods: {
1306
+ // 处理字段变化事件
1307
+ handleFieldChange(e) {
1308
+ this.$emit("field-change", e);
1309
+ },
1126
1310
  // 处理日期变化事件
1127
1311
  handleDateChange(e) {
1128
1312
  this.isRangeType ? (this.$emit("value-change", e), e && Array.isArray(e) && e.length === 2 ? (this.$emit("start-change", e), this.$emit("end-change", e)) : (this.$emit("start-change", []), this.$emit("end-change", []))) : this.$emit("value-change", e);
@@ -1135,108 +1319,55 @@ const ce = /* @__PURE__ */ V(dt, [["render", mt], ["__scopeId", "data-v-6b474dac
1135
1319
  handleFocus(e) {
1136
1320
  this.$emit("focus", e);
1137
1321
  }
1138
- },
1139
- watch: {
1140
- labelOptions: {
1141
- handler(e) {
1142
- e && e.length > 0 && !this.field && this.$emit("field-change", e[0].value);
1143
- },
1144
- deep: !0,
1145
- immediate: !0
1146
- }
1147
1322
  }
1148
- }, Ct = {
1149
- key: 1,
1150
- class: "date-label"
1151
1323
  };
1152
- function _t(e, l, t, a, i, s) {
1153
- const n = d("el-option"), h = d("el-select"), u = d("EllipsisText"), c = d("el-date-picker");
1154
- return r(), p("div", {
1155
- class: A(["tm-date-picker", [
1156
- `tm-date-picker--${i.isVue3 ? "v3" : "v2"}`,
1157
- {
1158
- "has-select": t.labelOptions && t.labelOptions.length > 0,
1159
- "has-label": t.label && !s.isRangeType && (!t.labelOptions || t.labelOptions.length === 0)
1160
- }
1161
- ]])
1162
- }, [
1163
- t.labelOptions && t.labelOptions.length > 0 ? (r(), m(h, {
1164
- key: 0,
1165
- modelValue: s.fieldValue,
1166
- "onUpdate:modelValue": l[0] || (l[0] = (C) => s.fieldValue = C),
1167
- size: i.getDefaultSize(),
1168
- style: { width: "100px" }
1169
- }, {
1170
- default: f(() => [
1171
- (r(!0), p(k, null, M(t.labelOptions, (C) => (r(), m(n, {
1172
- key: C.value,
1173
- label: C.label,
1174
- value: C.value
1175
- }, null, 8, ["label", "value"]))), 128))
1176
- ]),
1177
- _: 1
1178
- }, 8, ["modelValue", "size"])) : t.label ? (r(), p("div", Ct, [
1179
- g(u, {
1180
- text: t.label,
1181
- lines: 2
1182
- }, null, 8, ["text"])
1183
- ])) : b("", !0),
1184
- i.isVue2 ? (r(), m(c, {
1185
- key: 2,
1186
- value: s.dateValue,
1187
- type: t.type,
1188
- size: i.getDefaultSize(),
1189
- "range-separator": t.rangeSeparator,
1190
- "start-placeholder": s.computedStartPlaceholder,
1191
- "end-placeholder": s.computedEndPlaceholder,
1192
- placeholder: t.placeholder,
1193
- "picker-options": s.computedPickerOptions,
1194
- style: N(s.computedDatePickerStyle),
1195
- format: s.computedFormat,
1196
- "value-format": s.computedFormat,
1197
- disabled: t.disabled,
1198
- clearable: t.clearable,
1199
- readonly: t.readonly,
1200
- editable: t.editable,
1201
- align: t.align,
1202
- "popper-class": t.popperClass,
1203
- "default-value": t.defaultValue,
1204
- "default-time": s.computedDefaultTime,
1205
- onInput: s.handleDateChange,
1206
- onChange: s.handleDateChange,
1207
- onBlur: s.handleBlur,
1208
- onFocus: s.handleFocus
1209
- }, null, 8, ["value", "type", "size", "range-separator", "start-placeholder", "end-placeholder", "placeholder", "picker-options", "style", "format", "value-format", "disabled", "clearable", "readonly", "editable", "align", "popper-class", "default-value", "default-time", "onInput", "onChange", "onBlur", "onFocus"])) : (r(), m(c, {
1210
- key: 3,
1211
- "model-value": s.dateValue,
1212
- type: t.type,
1213
- size: i.getDefaultSize(),
1214
- "range-separator": t.rangeSeparator,
1215
- "start-placeholder": s.computedStartPlaceholder,
1216
- "end-placeholder": s.computedEndPlaceholder,
1217
- placeholder: t.placeholder,
1218
- shortcuts: s.computedShortcuts,
1219
- "disabled-date": s.computedDisabledDate,
1220
- style: N(s.computedDatePickerStyle),
1221
- format: s.computedFormat,
1222
- "value-format": s.computedFormat,
1223
- disabled: t.disabled,
1224
- clearable: t.clearable,
1225
- readonly: t.readonly,
1226
- editable: t.editable,
1227
- teleported: !1,
1228
- "popper-class": t.popperClass,
1229
- "default-value": t.defaultValue,
1230
- "default-time": s.computedDefaultTime,
1231
- "onUpdate:modelValue": s.handleDateChange,
1232
- onChange: s.handleDateChange,
1233
- onBlur: s.handleBlur,
1234
- onFocus: s.handleFocus
1235
- }, null, 8, ["model-value", "type", "size", "range-separator", "start-placeholder", "end-placeholder", "placeholder", "shortcuts", "disabled-date", "style", "format", "value-format", "disabled", "clearable", "readonly", "editable", "popper-class", "default-value", "default-time", "onUpdate:modelValue", "onChange", "onBlur", "onFocus"]))
1236
- ], 2);
1324
+ function Pt(e, i, t, n, l, s) {
1325
+ const o = u("el-date-picker"), c = u("FormItemLayout");
1326
+ return r(), m(c, {
1327
+ label: t.label,
1328
+ "label-options": t.labelOptions,
1329
+ field: t.field,
1330
+ onFieldChange: s.handleFieldChange,
1331
+ "label-width": t.labelWidth,
1332
+ "input-width": t.inputWidth,
1333
+ direction: t.direction
1334
+ }, {
1335
+ default: f(() => [
1336
+ p(o, {
1337
+ "model-value": s.dateValue,
1338
+ type: t.type,
1339
+ size: l.getDefaultSize(),
1340
+ "range-separator": t.rangeSeparator,
1341
+ "start-placeholder": s.computedStartPlaceholder,
1342
+ "end-placeholder": s.computedEndPlaceholder,
1343
+ placeholder: t.placeholder,
1344
+ shortcuts: s.computedShortcuts,
1345
+ "disabled-date": s.computedDisabledDate,
1346
+ class: "date-picker",
1347
+ format: s.computedFormat,
1348
+ "value-format": s.computedFormat,
1349
+ disabled: t.disabled,
1350
+ clearable: t.clearable,
1351
+ readonly: t.readonly,
1352
+ editable: t.editable,
1353
+ teleported: !1,
1354
+ "popper-class": t.popperClass,
1355
+ "default-value": t.defaultValue,
1356
+ "default-time": s.computedDefaultTime,
1357
+ "onUpdate:modelValue": s.handleDateChange,
1358
+ onChange: s.handleDateChange,
1359
+ onBlur: s.handleBlur,
1360
+ onFocus: s.handleFocus
1361
+ }, null, 8, ["model-value", "type", "size", "range-separator", "start-placeholder", "end-placeholder", "placeholder", "shortcuts", "disabled-date", "format", "value-format", "disabled", "clearable", "readonly", "editable", "popper-class", "default-value", "default-time", "onUpdate:modelValue", "onChange", "onBlur", "onFocus"])
1362
+ ]),
1363
+ _: 1
1364
+ }, 8, ["label", "label-options", "field", "onFieldChange", "label-width", "input-width", "direction"]);
1237
1365
  }
1238
- const he = /* @__PURE__ */ V(vt, [["render", _t], ["__scopeId", "data-v-7d46d46b"]]), xt = !1, St = {
1366
+ const Ce = /* @__PURE__ */ V(Wt, [["render", Pt], ["__scopeId", "data-v-6d9d8fa1"]]), Nt = !1, Bt = {
1239
1367
  name: "TmCascaderFilter",
1368
+ components: {
1369
+ FormItemLayout: P
1370
+ },
1240
1371
  props: {
1241
1372
  value: {
1242
1373
  type: [String, Number, Array],
@@ -1246,6 +1377,10 @@ const he = /* @__PURE__ */ V(vt, [["render", _t], ["__scopeId", "data-v-7d46d46b
1246
1377
  type: [Array, Function],
1247
1378
  default: () => []
1248
1379
  },
1380
+ label: {
1381
+ type: [String, Function, Object, Array],
1382
+ default: null
1383
+ },
1249
1384
  props: {
1250
1385
  type: Object,
1251
1386
  default: () => ({
@@ -1274,12 +1409,26 @@ const he = /* @__PURE__ */ V(vt, [["render", _t], ["__scopeId", "data-v-7d46d46b
1274
1409
  placeholder: {
1275
1410
  type: String,
1276
1411
  default: ""
1412
+ },
1413
+ // FormItemLayout 配置参数
1414
+ labelWidth: {
1415
+ type: [String, Number],
1416
+ default: void 0
1417
+ },
1418
+ inputWidth: {
1419
+ type: [String, Number],
1420
+ default: void 0
1421
+ },
1422
+ direction: {
1423
+ type: String,
1424
+ default: void 0,
1425
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
1277
1426
  }
1278
1427
  },
1279
1428
  data() {
1280
1429
  return {
1281
- isVue2: xt,
1282
- getDefaultSize: I,
1430
+ isVue2: Nt,
1431
+ getDefaultSize: M,
1283
1432
  selectedValue: this.value,
1284
1433
  optionsList: [],
1285
1434
  loading: !1
@@ -1294,7 +1443,7 @@ const he = /* @__PURE__ */ V(vt, [["render", _t], ["__scopeId", "data-v-7d46d46b
1294
1443
  };
1295
1444
  },
1296
1445
  cascaderProps() {
1297
- return B(T({}, this.props), {
1446
+ return W(T({}, this.props), {
1298
1447
  expandTrigger: this.props.expandTrigger || "hover"
1299
1448
  });
1300
1449
  }
@@ -1321,49 +1470,62 @@ const he = /* @__PURE__ */ V(vt, [["render", _t], ["__scopeId", "data-v-7d46d46b
1321
1470
  if (typeof e == "function")
1322
1471
  try {
1323
1472
  this.loading = !0;
1324
- const l = await e();
1325
- Array.isArray(l) && (this.optionsList = l);
1326
- } catch (l) {
1327
- console.error(l);
1473
+ const i = await e();
1474
+ Array.isArray(i) && (this.optionsList = i);
1475
+ } catch (i) {
1476
+ console.error(i);
1328
1477
  } finally {
1329
1478
  this.loading = !1;
1330
1479
  }
1331
1480
  else Array.isArray(e) && (this.optionsList = e);
1332
1481
  }
1333
1482
  }
1334
- };
1335
- function Tt(e, l, t, a, i, s) {
1336
- const n = d("el-cascader");
1337
- return r(), m(n, x({
1338
- ref: "cascader",
1339
- class: ["tm-cascader", `tm-cascader--${i.isVue2 ? "v2" : "v3"}`],
1340
- modelValue: i.selectedValue,
1341
- "onUpdate:modelValue": l[0] || (l[0] = (h) => i.selectedValue = h),
1342
- style: { width: "200px" }
1343
- }, B(T({}, e.$attrs), {
1344
- size: i.getDefaultSize(),
1345
- filterable: t.filterable,
1346
- clearable: t.clearable,
1347
- collapseTags: t.collapseTags,
1348
- collapseTagsTooltip: t.collapseTagsTooltip,
1349
- props: s.cascaderProps,
1350
- placeholder: t.placeholder,
1351
- options: i.optionsList,
1352
- loading: i.loading
1353
- }), E(i.isVue2 ? e.$listeners : {})), {
1354
- default: f(({ node: h, data: u }) => [
1355
- F(e.$slots, "default", {
1356
- node: h,
1357
- data: u
1358
- }, () => [
1359
- y("span", null, S(u[s.propMap.label]), 1)
1483
+ }, Ut = { class: "cascader" };
1484
+ function jt(e, i, t, n, l, s) {
1485
+ const o = u("el-cascader"), c = u("FormItemLayout");
1486
+ return r(), m(c, {
1487
+ label: t.label,
1488
+ "label-width": t.labelWidth,
1489
+ "input-width": t.inputWidth,
1490
+ direction: t.direction
1491
+ }, {
1492
+ default: f(() => [
1493
+ b("div", Ut, [
1494
+ p(o, _({
1495
+ ref: "cascader",
1496
+ modelValue: l.selectedValue,
1497
+ "onUpdate:modelValue": i[0] || (i[0] = (d) => l.selectedValue = d)
1498
+ }, W(T({}, e.$attrs), {
1499
+ size: l.getDefaultSize(),
1500
+ filterable: t.filterable,
1501
+ clearable: t.clearable,
1502
+ collapseTags: t.collapseTags,
1503
+ collapseTagsTooltip: t.collapseTagsTooltip,
1504
+ props: s.cascaderProps,
1505
+ placeholder: t.placeholder,
1506
+ options: l.optionsList,
1507
+ loading: l.loading
1508
+ }), I(l.isVue2 ? e.$listeners : {})), {
1509
+ default: f(({ node: d, data: h }) => [
1510
+ x(e.$slots, "default", {
1511
+ node: d,
1512
+ data: h
1513
+ }, () => [
1514
+ b("span", null, w(h[s.propMap.label]), 1)
1515
+ ], !0)
1516
+ ]),
1517
+ _: 3
1518
+ }, 16, ["modelValue"])
1360
1519
  ])
1361
1520
  ]),
1362
1521
  _: 3
1363
- }, 16, ["class", "modelValue"]);
1522
+ }, 8, ["label", "label-width", "input-width", "direction"]);
1364
1523
  }
1365
- const fe = /* @__PURE__ */ V(St, [["render", Tt]]), Vt = !1, wt = !0, zt = {
1524
+ const _e = /* @__PURE__ */ V(Bt, [["render", jt], ["__scopeId", "data-v-7cde104c"]]), Jt = !1, Kt = !0, Qt = {
1366
1525
  name: "TmRadioFilter",
1526
+ components: {
1527
+ FormItemLayout: P
1528
+ },
1367
1529
  props: {
1368
1530
  value: {
1369
1531
  type: [String, Number],
@@ -1388,13 +1550,31 @@ const fe = /* @__PURE__ */ V(St, [["render", Tt]]), Vt = !1, wt = !0, zt = {
1388
1550
  type: [String, Number],
1389
1551
  default: 200
1390
1552
  // 默认宽度200px,如果有选项超过4个时使用305px
1553
+ },
1554
+ label: {
1555
+ type: [String, Function, Object, Array],
1556
+ default: null
1557
+ },
1558
+ // FormItemLayout 配置参数
1559
+ labelWidth: {
1560
+ type: [String, Number],
1561
+ default: void 0
1562
+ },
1563
+ inputWidth: {
1564
+ type: [String, Number],
1565
+ default: void 0
1566
+ },
1567
+ direction: {
1568
+ type: String,
1569
+ default: void 0,
1570
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
1391
1571
  }
1392
1572
  },
1393
1573
  data() {
1394
1574
  return {
1395
- isVue2: Vt,
1396
- isVue3: wt,
1397
- getDefaultSize: I,
1575
+ isVue2: Jt,
1576
+ isVue3: Kt,
1577
+ getDefaultSize: M,
1398
1578
  selectedValue: this.value,
1399
1579
  optionsList: [],
1400
1580
  loading: !1
@@ -1406,19 +1586,6 @@ const fe = /* @__PURE__ */ V(St, [["render", Tt]]), Vt = !1, wt = !0, zt = {
1406
1586
  label: this.props.label || "label",
1407
1587
  value: this.props.value || "value"
1408
1588
  };
1409
- },
1410
- // 判断是否需要使用较宽的布局(超过4个选项)
1411
- hasWideOptions() {
1412
- return this.optionsList.length > 4;
1413
- },
1414
- // 计算每个按钮的宽度,确保填满容器
1415
- calculateItemWidth() {
1416
- if (!this.optionsList.length) return {};
1417
- const l = `${(this.hasWideOptions ? 305 : 200) / this.optionsList.length}px`;
1418
- return {
1419
- width: l,
1420
- flex: `0 0 ${l}`
1421
- };
1422
1589
  }
1423
1590
  },
1424
1591
  watch: {
@@ -1443,10 +1610,10 @@ const fe = /* @__PURE__ */ V(St, [["render", Tt]]), Vt = !1, wt = !0, zt = {
1443
1610
  if (typeof e == "function")
1444
1611
  try {
1445
1612
  this.loading = !0;
1446
- const l = await e();
1447
- Array.isArray(l) && (this.optionsList = l);
1448
- } catch (l) {
1449
- console.error(l);
1613
+ const i = await e();
1614
+ Array.isArray(i) && (this.optionsList = i);
1615
+ } catch (i) {
1616
+ console.error(i);
1450
1617
  } finally {
1451
1618
  this.loading = !1;
1452
1619
  }
@@ -1454,44 +1621,49 @@ const fe = /* @__PURE__ */ V(St, [["render", Tt]]), Vt = !1, wt = !0, zt = {
1454
1621
  }
1455
1622
  }
1456
1623
  };
1457
- function kt(e, l, t, a, i, s) {
1458
- const n = d("el-radio-button"), h = d("el-radio-group");
1459
- return r(), p("div", {
1460
- class: A(["tm-radio", {
1461
- "wide-mode": s.hasWideOptions,
1462
- "tm-radio--v3": i.isVue3,
1463
- "tm-radio--v2": i.isVue2
1464
- }])
1465
- }, [
1466
- g(h, x({
1467
- ref: "radioGroup",
1468
- modelValue: i.selectedValue,
1469
- "onUpdate:modelValue": l[0] || (l[0] = (u) => i.selectedValue = u)
1470
- }, B(T({}, e.$attrs), {
1471
- size: i.getDefaultSize()
1472
- }), E(i.isVue2 ? e.$listeners : {})), {
1473
- default: f(() => [
1474
- e.$slots.default ? F(e.$slots, "default", { key: 0 }, void 0, !0) : (r(!0), p(k, { key: 1 }, M(i.optionsList, (u) => (r(), m(n, x({ ref_for: !0 }, {
1475
- [i.isVue3 ? "value" : "label"]: u[s.propMap.value],
1476
- disabled: u.disabled,
1477
- style: s.calculateItemWidth
1478
- }, {
1479
- key: u[s.propMap.value]
1480
- }), {
1481
- default: f(() => [
1482
- F(e.$slots, "option", { item: u }, () => [
1483
- L(S(u[s.propMap.label]), 1)
1484
- ], !0)
1485
- ]),
1486
- _: 2
1487
- }, 1040))), 128))
1488
- ]),
1489
- _: 3
1490
- }, 16, ["modelValue"])
1491
- ], 2);
1624
+ function qt(e, i, t, n, l, s) {
1625
+ const o = u("el-radio-button"), c = u("el-radio-group"), d = u("FormItemLayout");
1626
+ return r(), m(d, {
1627
+ label: t.label,
1628
+ "label-width": t.labelWidth,
1629
+ "input-width": t.inputWidth,
1630
+ direction: t.direction
1631
+ }, {
1632
+ default: f(() => [
1633
+ p(c, _({
1634
+ ref: "radioGroup",
1635
+ modelValue: l.selectedValue,
1636
+ "onUpdate:modelValue": i[0] || (i[0] = (h) => l.selectedValue = h)
1637
+ }, W(T({}, e.$attrs), {
1638
+ size: l.getDefaultSize()
1639
+ }), { class: "radio-group" }, I(l.isVue2 ? e.$listeners : {})), {
1640
+ default: f(() => [
1641
+ e.$slots.default ? x(e.$slots, "default", { key: 0 }, void 0, !0) : (r(!0), g(k, { key: 1 }, D(l.optionsList, (h) => (r(), m(o, _({ ref_for: !0 }, {
1642
+ [l.isVue3 ? "value" : "label"]: h[s.propMap.value],
1643
+ disabled: h.disabled
1644
+ }, {
1645
+ style: { flex: "1" },
1646
+ key: h[s.propMap.value]
1647
+ }), {
1648
+ default: f(() => [
1649
+ x(e.$slots, "option", { item: h }, () => [
1650
+ L(w(h[s.propMap.label]), 1)
1651
+ ], !0)
1652
+ ]),
1653
+ _: 2
1654
+ }, 1040))), 128))
1655
+ ]),
1656
+ _: 3
1657
+ }, 16, ["modelValue"])
1658
+ ]),
1659
+ _: 3
1660
+ }, 8, ["label", "label-width", "input-width", "direction"]);
1492
1661
  }
1493
- const pe = /* @__PURE__ */ V(zt, [["render", kt], ["__scopeId", "data-v-61fed13d"]]), Ft = !1, Lt = !0, Ot = {
1662
+ const Se = /* @__PURE__ */ V(Qt, [["render", qt], ["__scopeId", "data-v-44b00fff"]]), Yt = !1, Gt = !0, Xt = {
1494
1663
  name: "TmCheckboxFilter",
1664
+ components: {
1665
+ FormItemLayout: P
1666
+ },
1495
1667
  props: {
1496
1668
  value: {
1497
1669
  type: Array,
@@ -1512,17 +1684,30 @@ const pe = /* @__PURE__ */ V(zt, [["render", kt], ["__scopeId", "data-v-61fed13d
1512
1684
  type: String,
1513
1685
  default: "mini"
1514
1686
  },
1515
- width: {
1687
+ label: {
1688
+ type: [String, Function, Object, Array],
1689
+ default: null
1690
+ },
1691
+ // FormItemLayout 配置参数
1692
+ labelWidth: {
1516
1693
  type: [String, Number],
1517
- default: 200
1518
- // 默认宽度200px,如果有选项超过4个时使用305px
1694
+ default: void 0
1695
+ },
1696
+ inputWidth: {
1697
+ type: [String, Number],
1698
+ default: void 0
1699
+ },
1700
+ direction: {
1701
+ type: String,
1702
+ default: void 0,
1703
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
1519
1704
  }
1520
1705
  },
1521
1706
  data() {
1522
1707
  return {
1523
- isVue2: Ft,
1524
- isVue3: Lt,
1525
- getDefaultSize: I,
1708
+ isVue2: Yt,
1709
+ isVue3: Gt,
1710
+ getDefaultSize: M,
1526
1711
  selectedValue: this.value || [],
1527
1712
  optionsList: [],
1528
1713
  loading: !1
@@ -1534,21 +1719,6 @@ const pe = /* @__PURE__ */ V(zt, [["render", kt], ["__scopeId", "data-v-61fed13d
1534
1719
  label: this.props.label || "label",
1535
1720
  value: this.props.value || "value"
1536
1721
  };
1537
- },
1538
- // 判断是否需要使用较宽的布局(超过4个选项)
1539
- hasWideOptions() {
1540
- return this.optionsList.length > 4;
1541
- },
1542
- // 计算每个按钮的宽度,确保填满容器
1543
- calculateItemWidth() {
1544
- if (!this.optionsList.length) return {};
1545
- const e = Math.ceil(
1546
- this.optionsList.length / (this.hasWideOptions ? 6 : 4)
1547
- ), l = Math.ceil(this.optionsList.length / e), a = `${(this.hasWideOptions ? 305 : 200) / l}px`;
1548
- return {
1549
- width: a,
1550
- flex: `0 0 ${a}`
1551
- };
1552
1722
  }
1553
1723
  },
1554
1724
  watch: {
@@ -1573,87 +1743,92 @@ const pe = /* @__PURE__ */ V(zt, [["render", kt], ["__scopeId", "data-v-61fed13d
1573
1743
  if (typeof e == "function")
1574
1744
  try {
1575
1745
  this.loading = !0;
1576
- const l = await e();
1577
- Array.isArray(l) && (this.optionsList = l);
1578
- } catch (l) {
1579
- console.error(l);
1746
+ const i = await e();
1747
+ Array.isArray(i) && (this.optionsList = i);
1748
+ } catch (i) {
1749
+ console.error(i);
1580
1750
  } finally {
1581
1751
  this.loading = !1;
1582
1752
  }
1583
1753
  else Array.isArray(e) && (this.optionsList = e);
1584
1754
  }
1585
1755
  }
1586
- };
1587
- function Dt(e, l, t, a, i, s) {
1588
- const n = d("el-checkbox-button"), h = d("el-checkbox-group");
1589
- return r(), p("div", {
1590
- class: A(["tm-checkbox", {
1591
- "wide-mode": s.hasWideOptions,
1592
- "tm-checkbox--v3": i.isVue3,
1593
- "tm-checkbox--v2": i.isVue2
1594
- }])
1595
- }, [
1596
- g(h, x({
1597
- ref: "checkboxGroup",
1598
- modelValue: i.selectedValue,
1599
- "onUpdate:modelValue": l[0] || (l[0] = (u) => i.selectedValue = u)
1600
- }, B(T({}, e.$attrs), {
1601
- size: i.getDefaultSize()
1602
- }), E(i.isVue2 ? e.$listeners : {})), {
1603
- default: f(() => [
1604
- e.$slots.default ? F(e.$slots, "default", { key: 0 }, void 0, !0) : (r(!0), p(k, { key: 1 }, M(i.optionsList, (u) => (r(), m(n, x({
1605
- key: u[s.propMap.value]
1606
- }, { ref_for: !0 }, {
1607
- [i.isVue3 ? "value" : "label"]: u[s.propMap.value],
1608
- disabled: u.disabled,
1609
- style: s.calculateItemWidth
1610
- }), {
1756
+ }, Zt = { class: "checkbox-content" };
1757
+ function $t(e, i, t, n, l, s) {
1758
+ const o = u("el-checkbox-button"), c = u("el-checkbox-group"), d = u("FormItemLayout");
1759
+ return r(), m(d, {
1760
+ label: t.label,
1761
+ "label-width": t.labelWidth,
1762
+ "input-width": t.inputWidth,
1763
+ direction: t.direction
1764
+ }, {
1765
+ default: f(() => [
1766
+ b("div", Zt, [
1767
+ p(c, _({
1768
+ ref: "checkboxGroup",
1769
+ modelValue: l.selectedValue,
1770
+ "onUpdate:modelValue": i[0] || (i[0] = (h) => l.selectedValue = h)
1771
+ }, W(T({}, e.$attrs), {
1772
+ size: l.getDefaultSize()
1773
+ }), I(l.isVue2 ? e.$listeners : {})), {
1611
1774
  default: f(() => [
1612
- F(e.$slots, "option", { item: u }, () => [
1613
- L(S(u[s.propMap.label]), 1)
1614
- ], !0)
1775
+ e.$slots.default ? x(e.$slots, "default", { key: 0 }, void 0, !0) : (r(!0), g(k, { key: 1 }, D(l.optionsList, (h) => (r(), m(o, _({
1776
+ key: h[s.propMap.value]
1777
+ }, { ref_for: !0 }, {
1778
+ [l.isVue3 ? "value" : "label"]: h[s.propMap.value],
1779
+ disabled: h.disabled
1780
+ }, { style: { flex: "1" } }), {
1781
+ default: f(() => [
1782
+ x(e.$slots, "option", { item: h }, () => [
1783
+ L(w(h[s.propMap.label]), 1)
1784
+ ], !0)
1785
+ ]),
1786
+ _: 2
1787
+ }, 1040))), 128))
1615
1788
  ]),
1616
- _: 2
1617
- }, 1040))), 128))
1618
- ]),
1619
- _: 3
1620
- }, 16, ["modelValue"])
1621
- ], 2);
1789
+ _: 3
1790
+ }, 16, ["modelValue"])
1791
+ ])
1792
+ ]),
1793
+ _: 3
1794
+ }, 8, ["label", "label-width", "input-width", "direction"]);
1622
1795
  }
1623
- const me = /* @__PURE__ */ V(Ot, [["render", Dt], ["__scopeId", "data-v-b44866b1"]]), Mt = !1, At = {
1796
+ const xe = /* @__PURE__ */ V(Xt, [["render", $t], ["__scopeId", "data-v-d9e8a314"]]), ei = !1, ti = {
1624
1797
  name: "TmSwitchFilter",
1798
+ components: {
1799
+ FormItemLayout: P
1800
+ },
1625
1801
  props: {
1626
1802
  value: {
1627
1803
  type: Boolean,
1628
1804
  default: !1
1629
1805
  },
1630
1806
  label: {
1631
- type: String,
1807
+ type: [String, Function, Object, Array],
1632
1808
  default: ""
1809
+ },
1810
+ // FormItemLayout 配置参数
1811
+ labelWidth: {
1812
+ type: [String, Number],
1813
+ default: void 0
1814
+ },
1815
+ inputWidth: {
1816
+ type: [String, Number],
1817
+ default: void 0
1818
+ },
1819
+ direction: {
1820
+ type: String,
1821
+ default: void 0,
1822
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
1633
1823
  }
1634
1824
  },
1635
1825
  data() {
1636
1826
  return {
1637
- isVue2: Mt,
1638
- getDefaultSize: I,
1827
+ isVue2: ei,
1828
+ getDefaultSize: M,
1639
1829
  switchValue: this.value
1640
1830
  };
1641
1831
  },
1642
- computed: {
1643
- // 根据文本长度计算容器宽度类
1644
- containerWidthClass() {
1645
- const e = (s) => {
1646
- if (!s) return 0;
1647
- let n = 0;
1648
- for (let h = 0; h < s.length; h++) {
1649
- const u = s.charAt(h);
1650
- n += /[\u4e00-\u9fa5]/.test(u) ? 2 : 1;
1651
- }
1652
- return n;
1653
- }, l = e(this.$attrs["active-text"]), t = e(this.$attrs["inactive-text"]), a = e(this.$attrs.label), i = l + t + a;
1654
- return i > 20 ? "wide-container" : i > 6 ? "medium-container" : "narrow-container";
1655
- }
1656
- },
1657
1832
  watch: {
1658
1833
  value: {
1659
1834
  immediate: !0,
@@ -1665,26 +1840,30 @@ const me = /* @__PURE__ */ V(Ot, [["render", Dt], ["__scopeId", "data-v-b44866b1
1665
1840
  this.$emit("input", e), this.$emit("change", e);
1666
1841
  }
1667
1842
  }
1668
- }, Ht = {
1669
- key: 0,
1670
- class: "switch-label"
1671
- };
1672
- function Rt(e, l, t, a, i, s) {
1673
- const n = d("el-switch");
1674
- return r(), p("div", {
1675
- class: A(["tm-switch", s.containerWidthClass])
1676
- }, [
1677
- t.label ? (r(), p("span", Ht, S(t.label), 1)) : b("", !0),
1678
- g(n, x({
1679
- ref: "switch",
1680
- modelValue: i.switchValue,
1681
- "onUpdate:modelValue": l[0] || (l[0] = (h) => i.switchValue = h)
1682
- }, e.$attrs, E(i.isVue2 ? e.$listeners : {}), {
1683
- size: i.getDefaultSize()
1684
- }), null, 16, ["modelValue", "size"])
1685
- ], 2);
1843
+ }, ii = { class: "switch-content" };
1844
+ function li(e, i, t, n, l, s) {
1845
+ const o = u("el-switch"), c = u("FormItemLayout");
1846
+ return r(), m(c, {
1847
+ label: t.label,
1848
+ "label-width": t.labelWidth,
1849
+ "input-width": t.inputWidth,
1850
+ direction: t.direction
1851
+ }, {
1852
+ default: f(() => [
1853
+ b("div", ii, [
1854
+ p(o, _({
1855
+ ref: "switch",
1856
+ modelValue: l.switchValue,
1857
+ "onUpdate:modelValue": i[0] || (i[0] = (d) => l.switchValue = d)
1858
+ }, e.$attrs, I(l.isVue2 ? e.$listeners : {}), {
1859
+ size: l.getDefaultSize()
1860
+ }), null, 16, ["modelValue", "size"])
1861
+ ])
1862
+ ]),
1863
+ _: 1
1864
+ }, 8, ["label", "label-width", "input-width", "direction"]);
1686
1865
  }
1687
- const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f"]]), Et = {
1866
+ const Te = /* @__PURE__ */ V(ti, [["render", li], ["__scopeId", "data-v-5ca0dc56"]]), si = {
1688
1867
  name: "DynamicSlot",
1689
1868
  props: {
1690
1869
  name: {
@@ -1697,28 +1876,28 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1697
1876
  }
1698
1877
  },
1699
1878
  render(e) {
1700
- var i;
1701
- const l = (s) => {
1702
- var n;
1703
- return s ? (n = s.$slots) == null ? void 0 : n[this.name] : null;
1879
+ var l;
1880
+ const i = (s) => {
1881
+ var o;
1882
+ return s ? (o = s.$slots) == null ? void 0 : o[this.name] : null;
1704
1883
  }, t = (s) => {
1705
- var n, h, u, c;
1706
- return s ? ((h = (n = s.$) == null ? void 0 : n.type) == null ? void 0 : h.name) === "TmTable" || ((c = (u = s.$) == null ? void 0 : u.type) == null ? void 0 : c.__name) === "TmTable" : !1;
1884
+ var o, c, d, h;
1885
+ return s ? ((c = (o = s.$) == null ? void 0 : o.type) == null ? void 0 : c.name) === "TmTable" || ((h = (d = s.$) == null ? void 0 : d.type) == null ? void 0 : h.__name) === "TmTable" : !1;
1707
1886
  };
1708
- let a = l(this.$parent);
1709
- if (!a) {
1710
- let s = (i = this.$parent) == null ? void 0 : i.$parent;
1711
- for (; s && !a; ) {
1887
+ let n = i(this.$parent);
1888
+ if (!n) {
1889
+ let s = (l = this.$parent) == null ? void 0 : l.$parent;
1890
+ for (; s && !n; ) {
1712
1891
  if (t(s)) {
1713
- a = l(s);
1892
+ n = i(s);
1714
1893
  break;
1715
1894
  }
1716
1895
  s = s.$parent;
1717
1896
  }
1718
1897
  }
1719
- return a ? typeof a == "function" ? a(this.slotProps) : a : null;
1898
+ return n ? typeof n == "function" ? n(this.slotProps) : n : null;
1720
1899
  }
1721
- }, { t: It } = W(), Pt = !1, Wt = !0, Bt = [
1900
+ }, { t: ni } = R(), ai = !1, oi = !0, ri = [
1722
1901
  "date",
1723
1902
  "daterange",
1724
1903
  "datetime",
@@ -1730,17 +1909,17 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1730
1909
  "years",
1731
1910
  "week",
1732
1911
  "monthrange"
1733
- ], Nt = {
1912
+ ], ui = {
1734
1913
  name: "TmTableSearch",
1735
1914
  components: {
1736
- TmSelect: ue,
1737
- TmAdvancedInput: ce,
1738
- TmAdvancedDate: he,
1739
- TmCascader: fe,
1740
- TmRadio: pe,
1741
- TmCheckbox: me,
1742
- TmSwitch: ge,
1743
- DynamicSlot: Et
1915
+ TmSelect: ye,
1916
+ TmAdvancedInput: ve,
1917
+ TmAdvancedDate: Ce,
1918
+ TmCascader: _e,
1919
+ TmRadio: Se,
1920
+ TmCheckbox: xe,
1921
+ TmSwitch: Te,
1922
+ DynamicSlot: si
1744
1923
  },
1745
1924
  props: {
1746
1925
  disabled: {
@@ -1754,16 +1933,30 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1754
1933
  searchForm: {
1755
1934
  type: Object,
1756
1935
  default: () => ({})
1936
+ },
1937
+ // FormItemLayout 全局配置参数
1938
+ labelWidth: {
1939
+ type: [String, Number],
1940
+ default: void 0
1941
+ },
1942
+ inputWidth: {
1943
+ type: [String, Number],
1944
+ default: void 0
1945
+ },
1946
+ direction: {
1947
+ type: String,
1948
+ default: void 0,
1949
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
1757
1950
  }
1758
1951
  },
1759
1952
  data() {
1760
1953
  return {
1761
- t: It,
1762
- isVue2: Pt,
1763
- isVue3: Wt,
1954
+ t: ni,
1955
+ isVue2: ai,
1956
+ isVue3: oi,
1764
1957
  getCompatSize: K,
1765
- getDefaultSize: I,
1766
- DATE_TYPES: Bt,
1958
+ getDefaultSize: M,
1959
+ DATE_TYPES: ri,
1767
1960
  // 用于存储初始默认值,重置时恢复
1768
1961
  defaultValues: {}
1769
1962
  };
@@ -1776,6 +1969,13 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1776
1969
  set(e) {
1777
1970
  this.$emit("update:search-form", e);
1778
1971
  }
1972
+ },
1973
+ // 合并参数的方法:单独配置 > 全局配置 > 默认值
1974
+ getLayoutProps() {
1975
+ return (e) => {
1976
+ const i = {};
1977
+ return e.labelWidth !== void 0 ? i.labelWidth = e.labelWidth : this.labelWidth !== void 0 && (i.labelWidth = this.labelWidth), e.inputWidth !== void 0 ? i.inputWidth = e.inputWidth : this.inputWidth !== void 0 && (i.inputWidth = this.inputWidth), e.direction !== void 0 ? i.direction = e.direction : this.direction !== void 0 && (i.direction = this.direction), i;
1978
+ };
1779
1979
  }
1780
1980
  },
1781
1981
  mounted() {
@@ -1790,21 +1990,21 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1790
1990
  const e = this.$slots.default;
1791
1991
  return e ? this.isVue2 ? !!e : e()[0].children.length > 0 : !1;
1792
1992
  },
1793
- handleUpdate(e, l, t) {
1794
- const a = this.getFieldValue(e, t);
1795
- a && this.$emit("update:search-form", B(T({}, this.computedSearchForm), {
1796
- [a]: l
1993
+ handleUpdate(e, i, t) {
1994
+ const n = this.getFieldValue(e, t);
1995
+ n && this.$emit("update:search-form", W(T({}, this.computedSearchForm), {
1996
+ [n]: i
1797
1997
  }));
1798
1998
  },
1799
- handleUpdateDate(e, l) {
1800
- const t = l || [], a = this.getFieldValue(e, "start"), i = this.getFieldValue(e, "end"), s = this.getFieldValue(e, "value"), n = {};
1801
- a && (n[a] = t[0]), i && (n[i] = t[1]), s && (n[s] = t), this.$emit("update:search-form", T(T({}, this.computedSearchForm), n));
1999
+ handleUpdateDate(e, i) {
2000
+ const t = i || [], n = this.getFieldValue(e, "start"), l = this.getFieldValue(e, "end"), s = this.getFieldValue(e, "value"), o = {};
2001
+ n && (o[n] = t[0]), l && (o[l] = t[1]), s && (o[s] = t), this.$emit("update:search-form", T(T({}, this.computedSearchForm), o));
1802
2002
  },
1803
- getFieldValue(e, l) {
2003
+ getFieldValue(e, i) {
1804
2004
  if (typeof e == "string")
1805
2005
  return e;
1806
- if (e.fields && l in e.fields) {
1807
- const t = e.fields[l];
2006
+ if (e.fields && i in e.fields) {
2007
+ const t = e.fields[i];
1808
2008
  if (typeof t == "string")
1809
2009
  return t;
1810
2010
  if (Array.isArray(t))
@@ -1814,9 +2014,9 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1814
2014
  }
1815
2015
  },
1816
2016
  // 获取字段默认值(仅支持新的fields结构)
1817
- getFieldDefault(e, l) {
1818
- if (e.fields && l in e.fields) {
1819
- const t = e.fields[l];
2017
+ getFieldDefault(e, i) {
2018
+ if (e.fields && i in e.fields) {
2019
+ const t = e.fields[i];
1820
2020
  if (Array.isArray(t) && t.length > 1)
1821
2021
  return t[1];
1822
2022
  if (t && typeof t == "object" && "default" in t)
@@ -1825,15 +2025,15 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1825
2025
  },
1826
2026
  // 检查是否存在对应名称的插槽
1827
2027
  hasSearchSlot(e) {
1828
- const l = "$slots";
1829
- if (this[l][e])
2028
+ const i = "$slots";
2029
+ if (this[i][e])
1830
2030
  return !0;
1831
- let a = this.$parent;
1832
- for (; a; ) {
1833
- const i = a[l];
1834
- if (a.$options.name === "TmTable" && (i != null && i[e]))
2031
+ let n = this.$parent;
2032
+ for (; n; ) {
2033
+ const l = n[i];
2034
+ if (n.$options.name === "TmTable" && (l != null && l[e]))
1835
2035
  return !0;
1836
- a = a.$parent;
2036
+ n = n.$parent;
1837
2037
  }
1838
2038
  return !1;
1839
2039
  },
@@ -1841,42 +2041,42 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1841
2041
  initDefaultValues() {
1842
2042
  if (!this.searchColumns || !this.searchColumns.length) return;
1843
2043
  const e = {};
1844
- this.searchColumns.forEach((l) => {
1845
- if (typeof l == "string" || !l.fields) return;
1846
- const t = this.getFieldValue(l, "value"), a = this.getFieldValue(l, "label");
1847
- if (l.type === "input" && l.labelOptions && l.labelOptions.length > 0) {
1848
- const s = l.labelOptions[0];
1849
- if (a)
1850
- if (a in this.computedSearchForm)
1851
- e[a] = this.computedSearchForm[a];
2044
+ this.searchColumns.forEach((i) => {
2045
+ if (typeof i == "string" || !i.fields) return;
2046
+ const t = this.getFieldValue(i, "value"), n = this.getFieldValue(i, "label");
2047
+ if (i.type === "input" && i.labelOptions && i.labelOptions.length > 0) {
2048
+ const s = i.labelOptions[0];
2049
+ if (n)
2050
+ if (n in this.computedSearchForm)
2051
+ e[n] = this.computedSearchForm[n];
1852
2052
  else {
1853
- const n = this.getFieldDefault(l, "label");
1854
- n !== void 0 ? e[a] = n : s && s.value !== void 0 && (e[a] = s.value);
2053
+ const o = this.getFieldDefault(i, "label");
2054
+ o !== void 0 ? e[n] = o : s && s.value !== void 0 && (e[n] = s.value);
1855
2055
  }
1856
2056
  t && !(t in this.computedSearchForm) && (e[t] = "");
1857
- } else if (this.isDateType(l.type) && l.labelOptions && l.labelOptions.length > 0) {
1858
- const s = l.labelOptions[0];
1859
- if (t && !(t in this.computedSearchForm) && (e[t] = []), a)
1860
- if (a in this.computedSearchForm)
1861
- e[a] = this.computedSearchForm[a];
2057
+ } else if (this.isDateType(i.type) && i.labelOptions && i.labelOptions.length > 0) {
2058
+ const s = i.labelOptions[0];
2059
+ if (t && !(t in this.computedSearchForm) && (e[t] = []), n)
2060
+ if (n in this.computedSearchForm)
2061
+ e[n] = this.computedSearchForm[n];
1862
2062
  else {
1863
- const n = this.getFieldDefault(l, "label");
1864
- n !== void 0 ? e[a] = n : s && s.value !== void 0 && (e[a] = s.value);
2063
+ const o = this.getFieldDefault(i, "label");
2064
+ o !== void 0 ? e[n] = o : s && s.value !== void 0 && (e[n] = s.value);
1865
2065
  }
1866
- } else if (l.type === "select" && l.labelOptions && l.labelOptions.length > 0) {
1867
- const s = l.labelOptions[0];
1868
- if (t && !(t in this.computedSearchForm) && (e[t] = l.multiple ? [] : ""), a)
1869
- if (a in this.computedSearchForm)
1870
- e[a] = this.computedSearchForm[a];
2066
+ } else if (i.type === "select" && i.labelOptions && i.labelOptions.length > 0) {
2067
+ const s = i.labelOptions[0];
2068
+ if (t && !(t in this.computedSearchForm) && (e[t] = i.multiple ? [] : ""), n)
2069
+ if (n in this.computedSearchForm)
2070
+ e[n] = this.computedSearchForm[n];
1871
2071
  else {
1872
- const n = this.getFieldDefault(l, "label");
1873
- n !== void 0 ? e[a] = n : s && s.value !== void 0 && (e[a] = s.value);
2072
+ const o = this.getFieldDefault(i, "label");
2073
+ o !== void 0 ? e[n] = o : s && s.value !== void 0 && (e[n] = s.value);
1874
2074
  }
1875
2075
  }
1876
- const i = this.getFieldDefault(l, "value");
1877
- if (t && i !== void 0 && !(t in this.computedSearchForm) ? this.isDateType(l.type) && !Array.isArray(i) ? e[t] = [] : l.type === "checkbox" && !Array.isArray(i) ? e[t] = i ? [i] : [] : l.type === "switch" && typeof i != "boolean" ? e[t] = !!i : e[t] = i : t && !(t in this.computedSearchForm) && (l.type === "checkbox" ? e[t] = [] : l.type === "switch" && (e[t] = !1)), this.isDateType(l.type)) {
1878
- const s = this.getFieldValue(l, "start"), n = this.getFieldValue(l, "end"), h = this.getFieldDefault(l, "start"), u = this.getFieldDefault(l, "end");
1879
- s && h !== void 0 && !(s in this.computedSearchForm) && (e[s] = h), n && u !== void 0 && !(n in this.computedSearchForm) && (e[n] = u);
2076
+ const l = this.getFieldDefault(i, "value");
2077
+ if (t && l !== void 0 && !(t in this.computedSearchForm) ? this.isDateType(i.type) && !Array.isArray(l) ? e[t] = [] : i.type === "checkbox" && !Array.isArray(l) ? e[t] = l ? [l] : [] : i.type === "switch" && typeof l != "boolean" ? e[t] = !!l : e[t] = l : t && !(t in this.computedSearchForm) && (i.type === "checkbox" ? e[t] = [] : i.type === "switch" && (e[t] = !1)), this.isDateType(i.type)) {
2078
+ const s = this.getFieldValue(i, "start"), o = this.getFieldValue(i, "end"), c = this.getFieldDefault(i, "start"), d = this.getFieldDefault(i, "end");
2079
+ s && c !== void 0 && !(s in this.computedSearchForm) && (e[s] = c), o && d !== void 0 && !(o in this.computedSearchForm) && (e[o] = d);
1880
2080
  }
1881
2081
  }), this.defaultValues = e, this.$emit("update:search-form", T(T({}, e), this.computedSearchForm));
1882
2082
  },
@@ -1895,151 +2095,153 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
1895
2095
  this.$emit("update:search-form", T({}, this.defaultValues)), this.$emit("reset");
1896
2096
  }
1897
2097
  }
1898
- }, Ut = { class: "search-content" }, jt = { class: "search-actions" };
1899
- function Jt(e, l, t, a, i, s) {
1900
- const n = d("dynamic-slot"), h = d("tm-advanced-input"), u = d("tm-advanced-date"), c = d("tm-select"), C = d("tm-cascader"), O = d("tm-radio"), D = d("tm-checkbox"), w = d("tm-switch"), U = d("el-button");
1901
- return r(), p("div", {
1902
- class: A(["table-search", `table-search--${i.isVue2 ? "v2" : "v3"}`])
2098
+ }, di = { class: "search-content" }, ci = { class: "search-actions" };
2099
+ function hi(e, i, t, n, l, s) {
2100
+ const o = u("dynamic-slot"), c = u("tm-advanced-input"), d = u("tm-advanced-date"), h = u("tm-select"), y = u("tm-cascader"), F = u("tm-radio"), O = u("tm-checkbox"), j = u("tm-switch"), N = u("el-button");
2101
+ return r(), g("div", {
2102
+ class: X(["table-search", `table-search--${l.isVue2 ? "v2" : "v3"}`])
1903
2103
  }, [
1904
- y("div", Ut, [
1905
- s.hasDefaultSlot() ? F(e.$slots, "default", { key: 0 }, void 0, !0) : t.searchColumns && t.searchColumns.length ? (r(!0), p(k, { key: 1 }, M(t.searchColumns, (o, R) => (r(), p(k, null, [
1906
- typeof o == "string" ? (r(), p("div", {
1907
- key: `str-${o}-${R}`,
2104
+ b("div", di, [
2105
+ s.hasDefaultSlot() ? x(e.$slots, "default", { key: 0 }, void 0, !0) : t.searchColumns && t.searchColumns.length ? (r(!0), g(k, { key: 1 }, D(t.searchColumns, (a, H) => (r(), g(k, null, [
2106
+ typeof a == "string" ? (r(), g("div", {
2107
+ key: `str-${a}-${H}`,
1908
2108
  class: "search-item"
1909
2109
  }, [
1910
- (r(), m(n, {
1911
- name: `search-${o}`,
2110
+ (r(), m(o, {
2111
+ name: `search-${a}`,
1912
2112
  "slot-props": { searchForm: t.searchForm },
1913
- key: o
2113
+ key: a
1914
2114
  }, null, 8, ["name", "slot-props"]))
1915
- ])) : (r(), p("div", {
1916
- key: `obj-${R}`,
2115
+ ])) : (r(), g("div", {
2116
+ key: `obj-${H}`,
1917
2117
  class: "search-item"
1918
2118
  }, [
1919
- o.fields ? (r(), p(k, { key: 0 }, [
1920
- s.hasSearchSlot(`search-${s.getFieldValue(o, "value")}`) ? (r(), m(n, {
1921
- name: `search-${s.getFieldValue(o, "value")}`,
1922
- "slot-props": { searchForm: t.searchForm, col: o },
1923
- key: s.getFieldValue(o, "value")
1924
- }, null, 8, ["name", "slot-props"])) : (r(), p("div", {
2119
+ a.fields ? (r(), g(k, { key: 0 }, [
2120
+ s.hasSearchSlot(`search-${s.getFieldValue(a, "value")}`) ? (r(), m(o, {
2121
+ name: `search-${s.getFieldValue(a, "value")}`,
2122
+ "slot-props": { searchForm: t.searchForm, col: a },
2123
+ key: s.getFieldValue(a, "value")
2124
+ }, null, 8, ["name", "slot-props"])) : (r(), g("div", {
1925
2125
  style: { display: "flex" },
1926
- key: s.getFieldValue(o, "value") || `col-${R}`
2126
+ key: s.getFieldValue(a, "value") || `col-${H}`
1927
2127
  }, [
1928
- o.type === "input" ? (r(), m(h, {
2128
+ a.type === "input" ? (r(), m(c, _({
1929
2129
  key: 0,
1930
- label: o.label,
1931
- value: s.computedSearchForm[s.getFieldValue(o, "value")],
1932
- field: s.computedSearchForm[s.getFieldValue(o, "label")],
1933
- onValueChange: (_) => s.handleUpdate(o, _, "value"),
1934
- onFieldChange: (_) => s.handleUpdate(o, _, "label"),
1935
- multiple: o.multiple,
1936
- labelOptions: o.labelOptions,
1937
- placeholder: o.placeholder,
2130
+ label: a.label,
2131
+ value: s.computedSearchForm[s.getFieldValue(a, "value")],
2132
+ field: s.computedSearchForm[s.getFieldValue(a, "label")],
2133
+ onValueChange: (S) => s.handleUpdate(a, S, "value"),
2134
+ onFieldChange: (S) => s.handleUpdate(a, S, "label"),
2135
+ multiple: a.multiple,
2136
+ labelOptions: a.labelOptions,
2137
+ placeholder: a.placeholder,
1938
2138
  onSearch: s.handleSearch
1939
- }, null, 8, ["label", "value", "field", "onValueChange", "onFieldChange", "multiple", "labelOptions", "placeholder", "onSearch"])) : b("", !0),
1940
- s.isDateType(o.type) ? (r(), m(u, {
2139
+ }, { ref_for: !0 }, s.getLayoutProps(a)), null, 16, ["label", "value", "field", "onValueChange", "onFieldChange", "multiple", "labelOptions", "placeholder", "onSearch"])) : v("", !0),
2140
+ s.isDateType(a.type) ? (r(), m(d, _({
1941
2141
  key: 1,
1942
- type: o.type,
1943
- label: o.label,
1944
- value: s.computedSearchForm[s.getFieldValue(o, "value")],
1945
- field: s.computedSearchForm[s.getFieldValue(o, "label")],
1946
- start: s.computedSearchForm[s.getFieldValue(o, "start")],
1947
- end: s.computedSearchForm[s.getFieldValue(o, "end")],
1948
- onFieldChange: (_) => s.handleUpdate(o, _, "label"),
1949
- onValueChange: (_) => s.handleUpdateDate(o, _),
1950
- onStartChange: (_) => s.handleUpdateDate(o, _),
1951
- onEndChange: (_) => s.handleUpdateDate(o, _),
1952
- labelOptions: o.labelOptions,
1953
- "start-placeholder": o.startPlaceholder,
1954
- "end-placeholder": o.endPlaceholder,
1955
- placeholder: o.placeholder,
1956
- "range-separator": o.rangeSeparator,
1957
- disabled: o.disabled,
1958
- clearable: o.clearable,
1959
- readonly: o.readonly,
1960
- editable: o.editable,
1961
- align: o.align,
1962
- "popper-class": o.popperClass,
1963
- "default-value": o.defaultValue,
1964
- "default-time": o.defaultTime,
1965
- shortcuts: o.shortcuts,
1966
- "past-only": o.pastOnly,
1967
- format: o.format
1968
- }, null, 8, ["type", "label", "value", "field", "start", "end", "onFieldChange", "onValueChange", "onStartChange", "onEndChange", "labelOptions", "start-placeholder", "end-placeholder", "placeholder", "range-separator", "disabled", "clearable", "readonly", "editable", "align", "popper-class", "default-value", "default-time", "shortcuts", "past-only", "format"])) : b("", !0),
1969
- o.type === "select" ? (r(), m(c, {
2142
+ type: a.type,
2143
+ label: a.label,
2144
+ value: s.computedSearchForm[s.getFieldValue(a, "value")],
2145
+ field: s.computedSearchForm[s.getFieldValue(a, "label")],
2146
+ start: s.computedSearchForm[s.getFieldValue(a, "start")],
2147
+ end: s.computedSearchForm[s.getFieldValue(a, "end")],
2148
+ onFieldChange: (S) => s.handleUpdate(a, S, "label"),
2149
+ onValueChange: (S) => s.handleUpdateDate(a, S),
2150
+ onStartChange: (S) => s.handleUpdateDate(a, S),
2151
+ onEndChange: (S) => s.handleUpdateDate(a, S),
2152
+ labelOptions: a.labelOptions,
2153
+ "start-placeholder": a.startPlaceholder,
2154
+ "end-placeholder": a.endPlaceholder,
2155
+ placeholder: a.placeholder,
2156
+ "range-separator": a.rangeSeparator,
2157
+ disabled: a.disabled,
2158
+ clearable: a.clearable,
2159
+ readonly: a.readonly,
2160
+ editable: a.editable,
2161
+ align: a.align,
2162
+ "popper-class": a.popperClass,
2163
+ "default-value": a.defaultValue,
2164
+ "default-time": a.defaultTime,
2165
+ shortcuts: a.shortcuts,
2166
+ "past-only": a.pastOnly,
2167
+ format: a.format
2168
+ }, { ref_for: !0 }, s.getLayoutProps(a)), null, 16, ["type", "label", "value", "field", "start", "end", "onFieldChange", "onValueChange", "onStartChange", "onEndChange", "labelOptions", "start-placeholder", "end-placeholder", "placeholder", "range-separator", "disabled", "clearable", "readonly", "editable", "align", "popper-class", "default-value", "default-time", "shortcuts", "past-only", "format"])) : v("", !0),
2169
+ a.type === "select" ? (r(), m(h, _({
1970
2170
  key: 2,
1971
- label: o.label,
1972
- modelValue: s.computedSearchForm[s.getFieldValue(o, "value")],
1973
- "onUpdate:modelValue": (_) => s.computedSearchForm[s.getFieldValue(o, "value")] = _,
1974
- field: s.computedSearchForm[s.getFieldValue(o, "label")],
1975
- options: o.options,
1976
- labelOptions: o.labelOptions,
1977
- placeholder: o.placeholder,
1978
- multiple: o.multiple,
1979
- "show-check-all": o.checkAll,
1980
- onFieldChange: (_) => s.handleUpdate(o, _, "label")
1981
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "field", "options", "labelOptions", "placeholder", "multiple", "show-check-all", "onFieldChange"])) : b("", !0),
1982
- o.type === "cascader" ? (r(), m(C, {
2171
+ label: a.label,
2172
+ modelValue: s.computedSearchForm[s.getFieldValue(a, "value")],
2173
+ "onUpdate:modelValue": (S) => s.computedSearchForm[s.getFieldValue(a, "value")] = S,
2174
+ field: s.computedSearchForm[s.getFieldValue(a, "label")],
2175
+ options: a.options,
2176
+ labelOptions: a.labelOptions,
2177
+ placeholder: a.placeholder,
2178
+ multiple: a.multiple,
2179
+ "show-check-all": a.checkAll,
2180
+ "value-on-clear": a.valueOnClear,
2181
+ clearable: a.clearable,
2182
+ onFieldChange: (S) => s.handleUpdate(a, S, "label")
2183
+ }, { ref_for: !0 }, s.getLayoutProps(a)), null, 16, ["label", "modelValue", "onUpdate:modelValue", "field", "options", "labelOptions", "placeholder", "multiple", "show-check-all", "value-on-clear", "clearable", "onFieldChange"])) : v("", !0),
2184
+ a.type === "cascader" ? (r(), m(y, _({
1983
2185
  key: 3,
1984
- modelValue: s.computedSearchForm[s.getFieldValue(o, "value")],
1985
- "onUpdate:modelValue": (_) => s.computedSearchForm[s.getFieldValue(o, "value")] = _,
1986
- label: o.label,
1987
- options: o.options,
1988
- labelOptions: o.labelOptions,
1989
- props: o.props,
1990
- placeholder: o.placeholder,
1991
- "show-check-all": o.checkAll
1992
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "options", "labelOptions", "props", "placeholder", "show-check-all"])) : b("", !0),
1993
- o.type === "radio" ? (r(), m(O, {
2186
+ modelValue: s.computedSearchForm[s.getFieldValue(a, "value")],
2187
+ "onUpdate:modelValue": (S) => s.computedSearchForm[s.getFieldValue(a, "value")] = S,
2188
+ label: a.label,
2189
+ options: a.options,
2190
+ labelOptions: a.labelOptions,
2191
+ props: a.props,
2192
+ placeholder: a.placeholder,
2193
+ "show-check-all": a.checkAll
2194
+ }, { ref_for: !0 }, s.getLayoutProps(a)), null, 16, ["modelValue", "onUpdate:modelValue", "label", "options", "labelOptions", "props", "placeholder", "show-check-all"])) : v("", !0),
2195
+ a.type === "radio" ? (r(), m(F, _({
1994
2196
  key: 4,
1995
- modelValue: s.computedSearchForm[s.getFieldValue(o, "value")],
1996
- "onUpdate:modelValue": (_) => s.computedSearchForm[s.getFieldValue(o, "value")] = _,
1997
- label: o.label,
1998
- options: o.options,
1999
- props: o.props
2000
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "options", "props"])) : b("", !0),
2001
- o.type === "checkbox" ? (r(), m(D, {
2197
+ modelValue: s.computedSearchForm[s.getFieldValue(a, "value")],
2198
+ "onUpdate:modelValue": (S) => s.computedSearchForm[s.getFieldValue(a, "value")] = S,
2199
+ label: a.label,
2200
+ options: a.options,
2201
+ props: a.props
2202
+ }, { ref_for: !0 }, s.getLayoutProps(a)), null, 16, ["modelValue", "onUpdate:modelValue", "label", "options", "props"])) : v("", !0),
2203
+ a.type === "checkbox" ? (r(), m(O, _({
2002
2204
  key: 5,
2003
- modelValue: s.computedSearchForm[s.getFieldValue(o, "value")],
2004
- "onUpdate:modelValue": (_) => s.computedSearchForm[s.getFieldValue(o, "value")] = _,
2005
- label: o.label,
2006
- options: o.options,
2007
- props: o.props
2008
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "options", "props"])) : b("", !0),
2009
- o.type === "switch" ? (r(), m(w, {
2205
+ modelValue: s.computedSearchForm[s.getFieldValue(a, "value")],
2206
+ "onUpdate:modelValue": (S) => s.computedSearchForm[s.getFieldValue(a, "value")] = S,
2207
+ label: a.label,
2208
+ options: a.options,
2209
+ props: a.props
2210
+ }, { ref_for: !0 }, s.getLayoutProps(a)), null, 16, ["modelValue", "onUpdate:modelValue", "label", "options", "props"])) : v("", !0),
2211
+ a.type === "switch" ? (r(), m(j, _({
2010
2212
  key: 6,
2011
- modelValue: s.computedSearchForm[s.getFieldValue(o, "value")],
2012
- "onUpdate:modelValue": (_) => s.computedSearchForm[s.getFieldValue(o, "value")] = _,
2013
- "active-text": o.activeText,
2014
- "inactive-text": o.inactiveText,
2015
- label: o.label,
2016
- "active-color": o.activeColor,
2017
- "inactive-color": o.inactiveColor
2018
- }, null, 8, ["modelValue", "onUpdate:modelValue", "active-text", "inactive-text", "label", "active-color", "inactive-color"])) : b("", !0)
2213
+ modelValue: s.computedSearchForm[s.getFieldValue(a, "value")],
2214
+ "onUpdate:modelValue": (S) => s.computedSearchForm[s.getFieldValue(a, "value")] = S,
2215
+ "active-text": a.activeText,
2216
+ "inactive-text": a.inactiveText,
2217
+ label: a.label,
2218
+ "active-color": a.activeColor,
2219
+ "inactive-color": a.inactiveColor
2220
+ }, { ref_for: !0 }, s.getLayoutProps(a)), null, 16, ["modelValue", "onUpdate:modelValue", "active-text", "inactive-text", "label", "active-color", "inactive-color"])) : v("", !0)
2019
2221
  ]))
2020
- ], 64)) : (r(), p("div", {
2021
- key: `error-${R}`,
2222
+ ], 64)) : (r(), g("div", {
2223
+ key: `error-${H}`,
2022
2224
  class: "search-error-message"
2023
2225
  }, " 缺少 fields 配置,无法渲染此组件 "))
2024
2226
  ]))
2025
- ], 64))), 256)) : b("", !0),
2026
- y("div", jt, [
2027
- g(U, {
2227
+ ], 64))), 256)) : v("", !0),
2228
+ b("div", ci, [
2229
+ p(N, {
2028
2230
  type: "primary",
2029
- size: i.getDefaultSize(),
2231
+ size: l.getDefaultSize(),
2030
2232
  onClick: s.handleSearch
2031
2233
  }, {
2032
2234
  default: f(() => [
2033
- L(S(i.t("query")), 1)
2235
+ L(w(l.t("query")), 1)
2034
2236
  ]),
2035
2237
  _: 1
2036
2238
  }, 8, ["size", "onClick"]),
2037
- g(U, {
2038
- size: i.getDefaultSize(),
2239
+ p(N, {
2240
+ size: l.getDefaultSize(),
2039
2241
  onClick: s.handleReset
2040
2242
  }, {
2041
2243
  default: f(() => [
2042
- L(S(i.t("reset")), 1)
2244
+ L(w(l.t("reset")), 1)
2043
2245
  ]),
2044
2246
  _: 1
2045
2247
  }, 8, ["size", "onClick"])
@@ -2047,7 +2249,7 @@ function Jt(e, l, t, a, i, s) {
2047
2249
  ])
2048
2250
  ], 2);
2049
2251
  }
2050
- const be = /* @__PURE__ */ V(Nt, [["render", Jt], ["__scopeId", "data-v-85117d96"]]), Kt = !1, Qt = {
2252
+ const we = /* @__PURE__ */ V(ui, [["render", hi], ["__scopeId", "data-v-4c4fd376"]]), fi = !1, pi = {
2051
2253
  name: "TablePagination",
2052
2254
  props: {
2053
2255
  current: {
@@ -2069,7 +2271,7 @@ const be = /* @__PURE__ */ V(Nt, [["render", Jt], ["__scopeId", "data-v-85117d96
2069
2271
  },
2070
2272
  data() {
2071
2273
  return {
2072
- isVue2: Kt,
2274
+ isVue2: fi,
2073
2275
  getCompatSize: K
2074
2276
  };
2075
2277
  },
@@ -2081,26 +2283,26 @@ const be = /* @__PURE__ */ V(Nt, [["render", Jt], ["__scopeId", "data-v-85117d96
2081
2283
  this.$emit("current-change", e);
2082
2284
  }
2083
2285
  }
2084
- }, qt = { class: "tm-pagination" };
2085
- function Yt(e, l, t, a, i, s) {
2086
- const n = d("el-pagination");
2087
- return r(), p("div", qt, [
2088
- g(n, x(e.$attrs, E(i.isVue2 ? e.$listeners : {}), {
2286
+ }, mi = { class: "tm-pagination" };
2287
+ function gi(e, i, t, n, l, s) {
2288
+ const o = u("el-pagination");
2289
+ return r(), g("div", mi, [
2290
+ p(o, _(e.$attrs, I(l.isVue2 ? e.$listeners : {}), {
2089
2291
  style: { "text-align": "right" },
2090
2292
  "current-page": t.current,
2091
2293
  "page-size": t.pageSize,
2092
2294
  total: t.total,
2093
2295
  "page-sizes": [10, 20, 50, 100, 300, 500, 1e3, 2e3],
2094
- size: i.getCompatSize("mini"),
2296
+ size: l.getCompatSize("mini"),
2095
2297
  layout: "total, sizes, prev, pager, next, jumper",
2096
2298
  onSizeChange: s.handleSizeChange,
2097
- "onUpdate:currentPage": l[0] || (l[0] = (h) => e.$emit("update:current", h)),
2098
- "onUpdate:pageSize": l[1] || (l[1] = (h) => e.$emit("update:pageSize", h)),
2299
+ "onUpdate:currentPage": i[0] || (i[0] = (c) => e.$emit("update:current", c)),
2300
+ "onUpdate:pageSize": i[1] || (i[1] = (c) => e.$emit("update:pageSize", c)),
2099
2301
  onCurrentChange: s.handleCurrentChange
2100
2302
  }), null, 16, ["current-page", "page-size", "total", "size", "onSizeChange", "onCurrentChange"])
2101
2303
  ]);
2102
2304
  }
2103
- const Gt = /* @__PURE__ */ V(Qt, [["render", Yt], ["__scopeId", "data-v-4dbdf6e7"]]), Xt = {
2305
+ const bi = /* @__PURE__ */ V(pi, [["render", gi], ["__scopeId", "data-v-4dbdf6e7"]]), yi = {
2104
2306
  name: "TmTableMenu",
2105
2307
  props: {
2106
2308
  size: {
@@ -2108,36 +2310,36 @@ const Gt = /* @__PURE__ */ V(Qt, [["render", Yt], ["__scopeId", "data-v-4dbdf6e7
2108
2310
  default: "mini"
2109
2311
  }
2110
2312
  }
2111
- }, Zt = {
2313
+ }, vi = {
2112
2314
  size: "small",
2113
2315
  class: "tm-table-menu",
2114
2316
  inline: ""
2115
- }, $t = { class: "left" }, el = { class: "right" };
2116
- function tl(e, l, t, a, i, s) {
2117
- return r(), p("div", Zt, [
2118
- y("div", $t, [
2119
- F(e.$slots, "left", {}, void 0, !0)
2317
+ }, Ci = { class: "left" }, _i = { class: "right" };
2318
+ function Si(e, i, t, n, l, s) {
2319
+ return r(), g("div", vi, [
2320
+ b("div", Ci, [
2321
+ x(e.$slots, "left", {}, void 0, !0)
2120
2322
  ]),
2121
- y("div", el, [
2122
- F(e.$slots, "right", {}, void 0, !0)
2323
+ b("div", _i, [
2324
+ x(e.$slots, "right", {}, void 0, !0)
2123
2325
  ])
2124
2326
  ]);
2125
2327
  }
2126
- const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3"]]), Y = (e) => e ? e.props || {} : {}, ee = (e, l) => {
2127
- e && (e.props || (e.props = {}), typeof l == "object" && Object.assign(e.props, l));
2328
+ const xi = /* @__PURE__ */ V(yi, [["render", Si], ["__scopeId", "data-v-579dd2c3"]]), Y = (e) => e ? e.props || {} : {}, te = (e, i) => {
2329
+ e && (e.props || (e.props = {}), typeof i == "object" && Object.assign(e.props, i));
2128
2330
  }, G = {
2129
2331
  // 默认实现:使用localStorage获取配置
2130
2332
  getTableConfig(e) {
2131
2333
  try {
2132
- const l = localStorage.getItem(`tm-table-config-${e}`);
2334
+ const i = localStorage.getItem(`tm-table-config-${e}`);
2133
2335
  return Promise.resolve({
2134
2336
  data: {
2135
2337
  code: 200,
2136
- data: l
2338
+ data: i
2137
2339
  }
2138
2340
  });
2139
- } catch (l) {
2140
- return Promise.reject(l);
2341
+ } catch (i) {
2342
+ return Promise.reject(i);
2141
2343
  }
2142
2344
  },
2143
2345
  // 默认实现:使用localStorage保存配置
@@ -2149,25 +2351,25 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2149
2351
  message: "success"
2150
2352
  }
2151
2353
  });
2152
- } catch (l) {
2153
- return Promise.reject(l);
2354
+ } catch (i) {
2355
+ return Promise.reject(i);
2154
2356
  }
2155
2357
  }
2156
- }, il = (e) => G.getTableConfig(e.key), sl = (e) => G.setTableConfig(e), al = (e) => {
2358
+ }, Ti = (e) => G.getTableConfig(e.key), wi = (e) => G.setTableConfig(e), Vi = (e) => {
2157
2359
  e && (typeof e.getTableConfig == "function" && (G.getTableConfig = e.getTableConfig), typeof e.setTableConfig == "function" && (G.setTableConfig = e.setTableConfig));
2158
- }, { t: nl } = W(), ol = !1, rl = !0, ul = {
2159
- formatter: (e, l, t, a) => [void 0, null, ""].includes(t) ? "-" : t
2160
- }, dl = {
2360
+ }, { t: Fi } = R(), zi = !1, Li = !0, ki = {
2361
+ formatter: (e, i, t, n) => [void 0, null, ""].includes(t) ? "-" : t
2362
+ }, Oi = {
2161
2363
  name: "TmColumnConfig",
2162
2364
  components: {
2163
- MoveIcon: Ge,
2164
- FixedLeftIcon: Ze,
2165
- FixedRightIcon: $e,
2166
- UploadIcon: et,
2167
- DownloadIcon: tt,
2168
- DeleteIcon: lt,
2169
- MenuIcon: qe,
2170
- tmEllipsisText: Q
2365
+ MoveIcon: et,
2366
+ FixedLeftIcon: it,
2367
+ FixedRightIcon: lt,
2368
+ UploadIcon: st,
2369
+ DownloadIcon: nt,
2370
+ DeleteIcon: at,
2371
+ MenuIcon: Ze,
2372
+ tmEllipsisText: $
2171
2373
  },
2172
2374
  props: {
2173
2375
  // 表格列数据,从$slots.default传入
@@ -2204,10 +2406,10 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2204
2406
  },
2205
2407
  data() {
2206
2408
  return {
2207
- t: nl,
2208
- isVue2: ol,
2209
- isVue3: rl,
2210
- getDefaultSize: I,
2409
+ t: Fi,
2410
+ isVue2: zi,
2411
+ isVue3: Li,
2412
+ getDefaultSize: M,
2211
2413
  getCompatSize: K,
2212
2414
  buttonType: { link: !0, type: "primary" },
2213
2415
  afterOpenDelay: { "show-after": 300 },
@@ -2278,9 +2480,9 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2278
2480
  * 查找数组中满足条件的最后一个元素的索引
2279
2481
  * 用于兼容旧版JS环境中不支持findLastIndex的情况
2280
2482
  */
2281
- findLastIndex(e, l) {
2483
+ findLastIndex(e, i) {
2282
2484
  for (let t = e.length - 1; t >= 0; t--)
2283
- if (l(e[t], t, e))
2485
+ if (i(e[t], t, e))
2284
2486
  return t;
2285
2487
  return -1;
2286
2488
  },
@@ -2299,33 +2501,33 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2299
2501
  // 处理原始列数据
2300
2502
  processOriginalColumns() {
2301
2503
  const e = this.columns || [];
2302
- let l = {};
2504
+ let i = {};
2303
2505
  this.defaultColumnsConfig = e.filter((t) => {
2304
- const a = Y(t);
2305
- return !(!a.prop || this.ignoredColumnConfigTypes.includes(a.type));
2306
- }).map((t, a) => {
2307
- const i = Y(t), s = T(T({}, ul), i);
2308
- ee(t, s), i.prop && (l[i.prop] = t);
2309
- const n = i.hasOwnProperty("visible") ? i.visible !== !1 : !0;
2506
+ const n = Y(t);
2507
+ return !(!n.prop || this.ignoredColumnConfigTypes.includes(n.type));
2508
+ }).map((t, n) => {
2509
+ const l = Y(t), s = T(T({}, ki), l);
2510
+ te(t, s), l.prop && (i[l.prop] = t);
2511
+ const o = l.hasOwnProperty("visible") ? l.visible !== !1 : !0;
2310
2512
  return {
2311
- prop: i.prop,
2513
+ prop: l.prop,
2312
2514
  // label: attrs.label, // 移除label,避免国际化导致比较不一致
2313
- fixed: i.fixed || "",
2314
- sort: a,
2315
- cancellable: i.hasOwnProperty("cancellable") ? i.cancellable : !0,
2316
- visible: n
2515
+ fixed: l.fixed || "",
2516
+ sort: n,
2517
+ cancellable: l.hasOwnProperty("cancellable") ? l.cancellable : !0,
2518
+ visible: o
2317
2519
  };
2318
- }), this.columnMap = l;
2520
+ }), this.columnMap = i;
2319
2521
  },
2320
2522
  // 加载列配置
2321
2523
  loadColumnConfig() {
2322
- il({
2524
+ Ti({
2323
2525
  key: this.computedTableKey
2324
2526
  }).then((e) => {
2325
2527
  var t;
2326
2528
  if (e.data.code !== 200) return;
2327
- let l = JSON.parse(((t = e.data) == null ? void 0 : t.data) || null) || {};
2328
- l.columnsConfig && JSON.stringify(this.defaultColumnsConfig) === JSON.stringify(l.defaultColumnsConfig) ? this.tableColumns = l.columnsConfig.map((a) => T({}, a)) : this.tableColumns = this.defaultColumnsConfig.map((a) => T({}, a)), this.processedColumns = this.applyColumnConfig(this.tableColumns), this.isConfigLoaded = !0, this.$emit("complete", {
2529
+ let i = JSON.parse(((t = e.data) == null ? void 0 : t.data) || null) || {};
2530
+ i.columnsConfig && JSON.stringify(this.defaultColumnsConfig) === JSON.stringify(i.defaultColumnsConfig) ? this.tableColumns = i.columnsConfig.map((n) => T({}, n)) : this.tableColumns = this.defaultColumnsConfig.map((n) => T({}, n)), this.processedColumns = this.applyColumnConfig(this.tableColumns), this.isConfigLoaded = !0, this.$emit("complete", {
2329
2531
  columns: this.processedColumns,
2330
2532
  isInitialLoad: !0
2331
2533
  });
@@ -2336,31 +2538,31 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2336
2538
  });
2337
2539
  });
2338
2540
  },
2339
- applyColumnConfig(e, l = !1) {
2340
- let t = this.columns.filter((i) => {
2341
- const s = Y(i);
2541
+ applyColumnConfig(e, i = !1) {
2542
+ let t = this.columns.filter((l) => {
2543
+ const s = Y(l);
2342
2544
  return this.ignoredColumnConfigTypes.includes(s.type);
2343
- }), a = [];
2344
- return [...e].sort((i, s) => {
2345
- const n = i.sort !== void 0 ? i.sort : 1 / 0, h = s.sort !== void 0 ? s.sort : 1 / 0;
2346
- return n - h;
2347
- }).forEach((i) => {
2348
- if (i.prop) {
2349
- let s = this.columnMap[i.prop];
2350
- s && (ee(s, {
2351
- fixed: i.fixed || void 0,
2352
- visible: i.visible
2353
- }), (!l && i.visible || l) && a.push(s));
2545
+ }), n = [];
2546
+ return [...e].sort((l, s) => {
2547
+ const o = l.sort !== void 0 ? l.sort : 1 / 0, c = s.sort !== void 0 ? s.sort : 1 / 0;
2548
+ return o - c;
2549
+ }).forEach((l) => {
2550
+ if (l.prop) {
2551
+ let s = this.columnMap[l.prop];
2552
+ s && (te(s, {
2553
+ fixed: l.fixed || void 0,
2554
+ visible: l.visible
2555
+ }), (!i && l.visible || i) && n.push(s));
2354
2556
  }
2355
- }), t.forEach((i) => {
2356
- ee(i, { visible: !0 });
2357
- }), [...t, ...a];
2557
+ }), t.forEach((l) => {
2558
+ te(l, { visible: !0 });
2559
+ }), [...t, ...n];
2358
2560
  },
2359
2561
  crateSortable() {
2360
2562
  const e = this.$refs.sortListRef;
2361
2563
  if (!e) return;
2362
2564
  this.sortable && (this.sortable.destroy(), this.sortable = null);
2363
- const l = new P(e, {
2565
+ const i = new E(e, {
2364
2566
  ghostClass: "blue-background-class",
2365
2567
  animation: 150,
2366
2568
  // 动画持续时间,毫秒
@@ -2377,36 +2579,36 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2377
2579
  group: "columns",
2378
2580
  dragClass: "sortable-drag",
2379
2581
  onStart: ({ item: t }) => {
2380
- const a = t.getAttribute("data-prop"), i = this.sortedTableColumns.find(
2381
- (s) => s.prop === a
2582
+ const n = t.getAttribute("data-prop"), l = this.sortedTableColumns.find(
2583
+ (s) => s.prop === n
2382
2584
  );
2383
- this.isDraggingFrozen = i && i.fixed === "left", this.isDraggingFrozenRight = i && i.fixed === "right", this.draggedItemIndex = Array.from(e.children).indexOf(t), t.classList.add("sortable-drag");
2585
+ this.isDraggingFrozen = l && l.fixed === "left", this.isDraggingFrozenRight = l && l.fixed === "right", this.draggedItemIndex = Array.from(e.children).indexOf(t), t.classList.add("sortable-drag");
2384
2586
  },
2385
2587
  onMove: (t) => {
2386
- const { target: a, related: i } = t;
2387
- if (!a || !i)
2588
+ const { target: n, related: l } = t;
2589
+ if (!n || !l)
2388
2590
  return !1;
2389
- const s = i ? i.getAttribute("data-prop") : null, n = s ? this.sortedTableColumns.find((c) => c.prop === s) : null, h = n && n.fixed === "left", u = n && n.fixed === "right";
2390
- return this.isDraggingFrozen && !h || this.isDraggingFrozenRight && !u || !this.isDraggingFrozen && !this.isDraggingFrozenRight && (h || u) ? (a.classList.add("no-drop-zone"), !1) : (document.querySelectorAll(".no-drop-zone").forEach((c) => {
2391
- c.classList.remove("no-drop-zone");
2591
+ const s = l ? l.getAttribute("data-prop") : null, o = s ? this.sortedTableColumns.find((h) => h.prop === s) : null, c = o && o.fixed === "left", d = o && o.fixed === "right";
2592
+ return this.isDraggingFrozen && !c || this.isDraggingFrozenRight && !d || !this.isDraggingFrozen && !this.isDraggingFrozenRight && (c || d) ? (n.classList.add("no-drop-zone"), !1) : (document.querySelectorAll(".no-drop-zone").forEach((h) => {
2593
+ h.classList.remove("no-drop-zone");
2392
2594
  }), !0);
2393
2595
  },
2394
- onEnd: ({ item: t, newIndex: a, oldIndex: i }) => {
2395
- if (a === void 0 || i === void 0 || a < 0 || i < 0 || a >= this.sortedTableColumns.length || i >= this.sortedTableColumns.length)
2596
+ onEnd: ({ item: t, newIndex: n, oldIndex: l }) => {
2597
+ if (n === void 0 || l === void 0 || n < 0 || l < 0 || n >= this.sortedTableColumns.length || l >= this.sortedTableColumns.length)
2396
2598
  return;
2397
- document.querySelectorAll(".no-drop-zone").forEach((O) => {
2398
- O.classList.remove("no-drop-zone");
2599
+ document.querySelectorAll(".no-drop-zone").forEach((F) => {
2600
+ F.classList.remove("no-drop-zone");
2399
2601
  }), t.classList.remove("sortable-drag");
2400
- const s = this.sortedTableColumns[i], n = s.fixed === "left", h = s.fixed === "right", u = a > 0 ? this.sortedTableColumns[a - 1] : null, c = a < this.sortedTableColumns.length - 1 ? this.sortedTableColumns[a + 1] : null;
2401
- let C = !1;
2402
- if (n ? (u && u.fixed !== "left" || c && c.fixed === "right") && (C = !0) : h ? (u && u.fixed !== "right" || c && c.fixed !== "right") && (C = !0) : (u && u.fixed === "right" || c && c.fixed === "left") && (C = !0), C) {
2602
+ const s = this.sortedTableColumns[l], o = s.fixed === "left", c = s.fixed === "right", d = n > 0 ? this.sortedTableColumns[n - 1] : null, h = n < this.sortedTableColumns.length - 1 ? this.sortedTableColumns[n + 1] : null;
2603
+ let y = !1;
2604
+ if (o ? (d && d.fixed !== "left" || h && h.fixed === "right") && (y = !0) : c ? (d && d.fixed !== "right" || h && h.fixed !== "right") && (y = !0) : (d && d.fixed === "right" || h && h.fixed === "left") && (y = !0), y) {
2403
2605
  this.rollbackSort();
2404
2606
  return;
2405
2607
  }
2406
2608
  this.updateSortAfterDrag();
2407
2609
  }
2408
2610
  });
2409
- this.sortable = l;
2611
+ this.sortable = i;
2410
2612
  },
2411
2613
  rollbackSort() {
2412
2614
  this.sortedTableColumns = JSON.parse(JSON.stringify(this.columnsCopy));
@@ -2414,8 +2616,8 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2414
2616
  updateSortAfterDrag() {
2415
2617
  const e = this.$refs.sortListRef;
2416
2618
  if (!e) return;
2417
- Array.from(e.children || []).filter((t) => t && t.dataset && t.dataset.prop).map((t) => t.dataset.prop).forEach((t, a) => {
2418
- this.sortedTableColumns.some((i) => i.prop === t ? (i.sort = a, !0) : !1);
2619
+ Array.from(e.children || []).filter((t) => t && t.dataset && t.dataset.prop).map((t) => t.dataset.prop).forEach((t, n) => {
2620
+ this.sortedTableColumns.some((l) => l.prop === t ? (l.sort = n, !0) : !1);
2419
2621
  }), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns);
2420
2622
  },
2421
2623
  // 移除了handleSearch方法,改用计算属性filteredSortedTableColumns
@@ -2424,13 +2626,13 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2424
2626
  },
2425
2627
  // 初始化排序后的列数据
2426
2628
  initSortedTableColumns() {
2427
- this.tableColumns.forEach((e, l) => {
2428
- e.sort === void 0 && (e.sort = l);
2429
- }), this.sortedTableColumns = [...this.tableColumns].sort((e, l) => e.fixed === "left" && l.fixed !== "left" ? -1 : e.fixed !== "left" && l.fixed === "left" || e.fixed === "right" && l.fixed !== "right" ? 1 : e.fixed !== "right" && l.fixed === "right" ? -1 : e.sort - l.sort);
2629
+ this.tableColumns.forEach((e, i) => {
2630
+ e.sort === void 0 && (e.sort = i);
2631
+ }), this.sortedTableColumns = [...this.tableColumns].sort((e, i) => e.fixed === "left" && i.fixed !== "left" ? -1 : e.fixed !== "left" && i.fixed === "left" || e.fixed === "right" && i.fixed !== "right" ? 1 : e.fixed !== "right" && i.fixed === "right" ? -1 : e.sort - i.sort);
2430
2632
  },
2431
2633
  setPlacement() {
2432
- const l = this.$refs.operationRef.$el.getBoundingClientRect();
2433
- (window.innerHeight || document.documentElement.clientHeight) - (l.bottom - window.scrollY) > 512 ? this.placement = "bottom" : this.placement = "left";
2634
+ const i = this.$refs.operationRef.$el.getBoundingClientRect();
2635
+ (window.innerHeight || document.documentElement.clientHeight) - (i.bottom - window.scrollY) > 512 ? this.placement = "bottom" : this.placement = "left";
2434
2636
  },
2435
2637
  handleVisibleChange(e) {
2436
2638
  this.popoverVisible = e;
@@ -2442,7 +2644,7 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2442
2644
  "mousemove",
2443
2645
  window.sortableGlobalMouseMove
2444
2646
  );
2445
- } catch (l) {
2647
+ } catch (i) {
2446
2648
  }
2447
2649
  })(), this.$nextTick(() => {
2448
2650
  this.crateSortable();
@@ -2454,107 +2656,107 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2454
2656
  document.removeEventListener("mouseup", window.sortableGlobalMouseUp), document.removeEventListener(
2455
2657
  "mousemove",
2456
2658
  window.sortableGlobalMouseMove
2457
- ), typeof P != "undefined" && P.utils && (document.removeEventListener(
2659
+ ), typeof E != "undefined" && E.utils && (document.removeEventListener(
2458
2660
  "mousemove",
2459
- P.utils.throttleCall
2460
- ), document.removeEventListener("mouseup", P.utils.throttleCall));
2661
+ E.utils.throttleCall
2662
+ ), document.removeEventListener("mouseup", E.utils.throttleCall));
2461
2663
  } catch (e) {
2462
2664
  }
2463
2665
  },
2464
2666
  handleSelectAll() {
2465
- const e = this.tableColumns.some((l) => !l.visible);
2466
- this.tableColumns.forEach((l) => {
2467
- l.cancellable && (l.visible = e);
2667
+ const e = this.tableColumns.some((i) => !i.visible);
2668
+ this.tableColumns.forEach((i) => {
2669
+ i.cancellable && (i.visible = e);
2468
2670
  });
2469
2671
  },
2470
2672
  handleRestoreDefault() {
2471
2673
  this.tableColumns = JSON.parse(JSON.stringify(this.defaultColumnsConfig)), this.sortedTableColumns = [...this.tableColumns].sort(
2472
- (e, l) => e.sort - l.sort
2674
+ (e, i) => e.sort - i.sort
2473
2675
  );
2474
2676
  },
2475
2677
  // 判断是否可以置顶
2476
- canMoveTop(e, l) {
2477
- if (l === 0) return !1;
2678
+ canMoveTop(e, i) {
2679
+ if (i === 0) return !1;
2478
2680
  if (e.fixed === "left") {
2479
- const t = this.sortedTableColumns[l - 1];
2681
+ const t = this.sortedTableColumns[i - 1];
2480
2682
  return t && t.fixed === "left";
2481
2683
  }
2482
2684
  if (!e.fixed) {
2483
- const t = this.sortedTableColumns[l - 1];
2685
+ const t = this.sortedTableColumns[i - 1];
2484
2686
  return t && t.fixed === "left" ? !1 : t && !t.fixed;
2485
2687
  }
2486
2688
  return e.fixed === "right";
2487
2689
  },
2488
2690
  // 修改置顶方法,确保右侧固定列置顶时会取消固定
2489
- moveTop(e, l) {
2490
- const t = this.sortedTableColumns, a = e.prop;
2691
+ moveTop(e, i) {
2692
+ const t = this.sortedTableColumns, n = e.prop;
2491
2693
  if (e.fixed === "right" && (e.fixed = ""), e.fixed === "left")
2492
- t.unshift(t.splice(l, 1)[0]);
2694
+ t.unshift(t.splice(i, 1)[0]);
2493
2695
  else {
2494
- const i = this.findLastIndex(
2696
+ const l = this.findLastIndex(
2495
2697
  this.sortedTableColumns,
2496
2698
  (s) => s.fixed === "left"
2497
2699
  );
2498
2700
  t.splice(
2499
- i + 1,
2701
+ l + 1,
2500
2702
  0,
2501
- t.splice(l, 1)[0]
2703
+ t.splice(i, 1)[0]
2502
2704
  );
2503
2705
  }
2504
2706
  this.updateSortValues(), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns), this.$nextTick(() => {
2505
- const i = this.$refs.sortListRef;
2506
- if (i) {
2507
- const s = Array.from(i.children).find(
2508
- (n) => n.dataset && n.dataset.prop === a
2707
+ const l = this.$refs.sortListRef;
2708
+ if (l) {
2709
+ const s = Array.from(l.children).find(
2710
+ (o) => o.dataset && o.dataset.prop === n
2509
2711
  );
2510
2712
  s && s.scrollIntoView({ behavior: "smooth", block: "nearest" });
2511
2713
  }
2512
2714
  });
2513
2715
  },
2514
2716
  frozenLeftHandle(e) {
2515
- const l = this.sortedTableColumns, t = l.splice(e, 1)[0];
2717
+ const i = this.sortedTableColumns, t = i.splice(e, 1)[0];
2516
2718
  if (t.fixed = t.fixed === "left" ? "" : "left", t.fixed === "left") {
2517
- const a = this.findLastIndex(
2719
+ const n = this.findLastIndex(
2518
2720
  this.sortedTableColumns,
2519
- (i) => i.fixed === "left"
2721
+ (l) => l.fixed === "left"
2520
2722
  );
2521
- l.splice(a + 1, 0, t);
2723
+ i.splice(n + 1, 0, t);
2522
2724
  } else {
2523
- const a = this.findLastIndex(
2725
+ const n = this.findLastIndex(
2524
2726
  this.sortedTableColumns,
2525
- (i) => i.fixed === "left"
2727
+ (l) => l.fixed === "left"
2526
2728
  );
2527
- l.splice(a + 1, 0, t);
2729
+ i.splice(n + 1, 0, t);
2528
2730
  }
2529
2731
  this.updateSortValues(), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns);
2530
2732
  },
2531
2733
  frozenRightHandle(e) {
2532
- const l = this.sortedTableColumns, t = l.splice(e, 1)[0];
2734
+ const i = this.sortedTableColumns, t = i.splice(e, 1)[0];
2533
2735
  if (t.fixed = t.fixed === "right" ? "" : "right", t.fixed === "right") {
2534
- const a = l.findIndex(
2535
- (i) => i.fixed === "right"
2736
+ const n = i.findIndex(
2737
+ (l) => l.fixed === "right"
2536
2738
  );
2537
- a === -1 ? l.push(t) : l.splice(a, 0, t);
2739
+ n === -1 ? i.push(t) : i.splice(n, 0, t);
2538
2740
  } else {
2539
- const a = l.findIndex(
2540
- (i) => i.fixed === "right"
2741
+ const n = i.findIndex(
2742
+ (l) => l.fixed === "right"
2541
2743
  );
2542
- a === -1 ? l.push(t) : l.splice(a, 0, t);
2744
+ n === -1 ? i.push(t) : i.splice(n, 0, t);
2543
2745
  }
2544
2746
  this.updateSortValues(), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns);
2545
2747
  },
2546
2748
  onSave() {
2547
- var l;
2749
+ var i;
2548
2750
  this.updateSortValues();
2549
- const e = (l = this.tableColumns) == null ? void 0 : l.map((t) => {
2550
- const a = this.sortedTableColumns.find(
2551
- (h) => h.prop === t.prop
2751
+ const e = (i = this.tableColumns) == null ? void 0 : i.map((t) => {
2752
+ const n = this.sortedTableColumns.find(
2753
+ (c) => c.prop === t.prop
2552
2754
  );
2553
- a && (t.sort = a.sort, t.fixed = a.fixed, t.visible = a.visible);
2554
- const n = t, { label: i } = n;
2555
- return oe(n, ["label"]);
2755
+ n && (t.sort = n.sort, t.fixed = n.fixed, t.visible = n.visible);
2756
+ const o = t, { label: l } = o;
2757
+ return re(o, ["label"]);
2556
2758
  });
2557
- sl({
2759
+ wi({
2558
2760
  key: this.computedTableKey,
2559
2761
  info: JSON.stringify({
2560
2762
  columnsConfig: e,
@@ -2569,8 +2771,8 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2569
2771
  },
2570
2772
  // 直接更新排序值,不依赖DOM结构
2571
2773
  updateSortValues() {
2572
- this.sortedTableColumns.forEach((e, l) => {
2573
- e.sort = l;
2774
+ this.sortedTableColumns.forEach((e, i) => {
2775
+ e.sort = i;
2574
2776
  });
2575
2777
  }
2576
2778
  },
@@ -2581,50 +2783,50 @@ const ll = /* @__PURE__ */ V(Xt, [["render", tl], ["__scopeId", "data-v-579dd2c3
2581
2783
  beforeDestroy() {
2582
2784
  this.sortable && (this.sortable.destroy(), this.sortable = null);
2583
2785
  try {
2584
- document.removeEventListener("mouseup", window.sortableGlobalMouseUp), document.removeEventListener("mousemove", window.sortableGlobalMouseMove), typeof P != "undefined" && P.utils && (document.removeEventListener("mousemove", P.utils.throttleCall), document.removeEventListener("mouseup", P.utils.throttleCall));
2786
+ document.removeEventListener("mouseup", window.sortableGlobalMouseUp), document.removeEventListener("mousemove", window.sortableGlobalMouseMove), typeof E != "undefined" && E.utils && (document.removeEventListener("mousemove", E.utils.throttleCall), document.removeEventListener("mouseup", E.utils.throttleCall));
2585
2787
  } catch (e) {
2586
2788
  }
2587
2789
  }
2588
- }, cl = {
2790
+ }, Di = {
2589
2791
  key: 0,
2590
2792
  class: "container"
2591
- }, hl = { class: "main-container" }, fl = { class: "left-content" }, pl = { class: "title" }, ml = { class: "option-list" }, gl = { style: { height: "100%", "overflow-y": "auto" } }, bl = { class: "right-content" }, yl = { class: "search-box" }, vl = {
2793
+ }, Mi = { class: "main-container" }, Ai = { class: "left-content" }, Hi = { class: "title" }, Ri = { class: "option-list" }, Ei = { style: { height: "100%", "overflow-y": "auto" } }, Ii = { class: "right-content" }, Wi = { class: "search-box" }, Pi = {
2592
2794
  key: 0,
2593
2795
  class: "tips"
2594
- }, Cl = {
2796
+ }, Ni = {
2595
2797
  class: "sort-list",
2596
2798
  ref: "sortListRef"
2597
- }, _l = ["data-prop"], xl = {
2799
+ }, Bi = ["data-prop"], Ui = {
2598
2800
  key: 0,
2599
2801
  class: "sort-item"
2600
- }, Sl = { class: "row-title" }, Tl = { class: "operation-btns" }, Vl = { class: "footer" }, wl = { class: "footer-left" }, zl = { class: "footer-right" }, kl = { style: { display: "inline-block", "margin-left": "10px" } };
2601
- function Fl(e, l, t, a, i, s) {
2602
- const n = d("el-button"), h = d("TmEllipsisText"), u = d("el-checkbox"), c = d("el-input"), C = d("MoveIcon"), O = d("DeleteIcon"), D = d("el-tooltip"), w = d("UploadIcon"), U = d("FixedLeftIcon"), o = d("FixedRightIcon"), R = d("MenuIcon"), _ = d("el-popover");
2603
- return r(), m(_, x({ "popper-class": "column-config-popover" }, {
2604
- [i.isVue3 ? "visible" : "value"]: i.popoverVisible
2605
- }, E({
2606
- [i.isVue3 ? "update:visible" : "input"]: s.handleVisibleChange
2802
+ }, ji = { class: "row-title" }, Ji = { class: "operation-btns" }, Ki = { class: "footer" }, Qi = { class: "footer-left" }, qi = { class: "footer-right" }, Yi = { style: { display: "inline-block", "margin-left": "10px" } };
2803
+ function Gi(e, i, t, n, l, s) {
2804
+ const o = u("el-button"), c = u("TmEllipsisText"), d = u("el-checkbox"), h = u("el-input"), y = u("MoveIcon"), F = u("DeleteIcon"), O = u("el-tooltip"), j = u("UploadIcon"), N = u("FixedLeftIcon"), a = u("FixedRightIcon"), H = u("MenuIcon"), S = u("el-popover");
2805
+ return r(), m(S, _({ "popper-class": "column-config-popover" }, {
2806
+ [l.isVue3 ? "visible" : "value"]: l.popoverVisible
2807
+ }, I({
2808
+ [l.isVue3 ? "update:visible" : "input"]: s.handleVisibleChange
2607
2809
  }), {
2608
2810
  width: 680,
2609
2811
  "show-arrow": !1,
2610
- placement: i.placement,
2812
+ placement: l.placement,
2611
2813
  trigger: "click",
2612
2814
  onShow: s.handlePopoverShow,
2613
2815
  onHide: s.handlePopoverHide
2614
2816
  }), {
2615
2817
  reference: f(() => [
2616
- y("div", kl, [
2617
- g(D, x({
2618
- content: i.t("columnSetting")
2619
- }, i.afterOpenDelay, { placement: "top" }), {
2818
+ b("div", Yi, [
2819
+ p(O, _({
2820
+ content: l.t("columnSetting")
2821
+ }, l.afterOpenDelay, { placement: "top" }), {
2620
2822
  default: f(() => [
2621
- g(n, {
2622
- size: i.getDefaultSize(),
2823
+ p(o, {
2824
+ size: l.getDefaultSize(),
2623
2825
  ref: "operationRef",
2624
2826
  circle: ""
2625
2827
  }, {
2626
2828
  default: f(() => [
2627
- g(R)
2829
+ p(H)
2628
2830
  ]),
2629
2831
  _: 1
2630
2832
  }, 8, ["size"])
@@ -2634,229 +2836,229 @@ function Fl(e, l, t, a, i, s) {
2634
2836
  ])
2635
2837
  ]),
2636
2838
  default: f(() => [
2637
- i.popoverVisible ? (r(), p("div", cl, [
2638
- y("div", hl, [
2639
- y("div", fl, [
2640
- y("div", pl, [
2641
- y("span", null, S(i.t("SelectableFields")) + "(" + S(i.tableColumns.length) + ")", 1),
2642
- g(n, x({ style: { "margin-left": "10px" } }, i.buttonType, { onClick: s.handleSelectAll }), {
2839
+ l.popoverVisible ? (r(), g("div", Di, [
2840
+ b("div", Mi, [
2841
+ b("div", Ai, [
2842
+ b("div", Hi, [
2843
+ b("span", null, w(l.t("SelectableFields")) + "(" + w(l.tableColumns.length) + ")", 1),
2844
+ p(o, _({ style: { "margin-left": "10px" } }, l.buttonType, { onClick: s.handleSelectAll }), {
2643
2845
  default: f(() => [
2644
- L(S(i.t("all")), 1)
2846
+ L(w(l.t("all")), 1)
2645
2847
  ]),
2646
2848
  _: 1
2647
2849
  }, 16, ["onClick"])
2648
2850
  ]),
2649
- y("div", ml, [
2650
- y("div", gl, [
2651
- (r(!0), p(k, null, M(i.tableColumns, (v, j) => (r(), p(k, null, [
2652
- v.prop ? (r(), p("div", {
2851
+ b("div", Ri, [
2852
+ b("div", Ei, [
2853
+ (r(!0), g(k, null, D(l.tableColumns, (C, B) => (r(), g(k, null, [
2854
+ C.prop ? (r(), g("div", {
2653
2855
  style: { width: "110px", display: "inline-block" },
2654
- key: j + v.prop
2856
+ key: B + C.prop
2655
2857
  }, [
2656
- g(u, {
2657
- disabled: !v.cancellable,
2858
+ p(d, {
2859
+ disabled: !C.cancellable,
2658
2860
  class: "el-checkbox",
2659
- modelValue: v.visible,
2660
- "onUpdate:modelValue": (J) => v.visible = J,
2661
- label: v.prop,
2662
- value: v.prop
2861
+ modelValue: C.visible,
2862
+ "onUpdate:modelValue": (J) => C.visible = J,
2863
+ label: C.prop,
2864
+ value: C.prop
2663
2865
  }, {
2664
2866
  default: f(() => [
2665
- g(h, {
2867
+ p(c, {
2666
2868
  width: "80px",
2667
- text: s.getColumnLabel(v.prop)
2869
+ text: s.getColumnLabel(C.prop)
2668
2870
  }, null, 8, ["text"])
2669
2871
  ]),
2670
2872
  _: 2
2671
2873
  }, 1032, ["disabled", "modelValue", "onUpdate:modelValue", "label", "value"])
2672
- ])) : b("", !0)
2874
+ ])) : v("", !0)
2673
2875
  ], 64))), 256))
2674
2876
  ])
2675
2877
  ])
2676
2878
  ]),
2677
- y("div", bl, [
2678
- y("div", yl, [
2679
- g(c, {
2680
- size: i.getCompatSize("small"),
2879
+ b("div", Ii, [
2880
+ b("div", Wi, [
2881
+ p(h, {
2882
+ size: l.getCompatSize("small"),
2681
2883
  class: "search-input",
2682
2884
  clearable: "",
2683
- placeholder: i.t("search"),
2684
- modelValue: i.keyWord,
2685
- "onUpdate:modelValue": l[0] || (l[0] = (v) => i.keyWord = v)
2885
+ placeholder: l.t("search"),
2886
+ modelValue: l.keyWord,
2887
+ "onUpdate:modelValue": i[0] || (i[0] = (C) => l.keyWord = C)
2686
2888
  }, null, 8, ["size", "placeholder", "modelValue"])
2687
2889
  ]),
2688
- s.showFixedLimitTips ? (r(), p("div", vl)) : b("", !0),
2689
- y("div", Cl, [
2690
- (r(!0), p(k, null, M(s.filteredSortedTableColumns, (v, j) => (r(), p("div", {
2691
- class: A(["sort-item-wrapper", [
2692
- v.fixed === "left" ? "frozen" : "",
2693
- v.fixed === "right" ? "frozenRight" : "",
2694
- v.fixed ? "" : "noFrozen"
2890
+ s.showFixedLimitTips ? (r(), g("div", Pi)) : v("", !0),
2891
+ b("div", Ni, [
2892
+ (r(!0), g(k, null, D(s.filteredSortedTableColumns, (C, B) => (r(), g("div", {
2893
+ class: X(["sort-item-wrapper", [
2894
+ C.fixed === "left" ? "frozen" : "",
2895
+ C.fixed === "right" ? "frozenRight" : "",
2896
+ C.fixed ? "" : "noFrozen"
2695
2897
  ]]),
2696
- "data-prop": v.prop,
2697
- key: v.prop
2898
+ "data-prop": C.prop,
2899
+ key: C.prop
2698
2900
  }, [
2699
- v.visible ? (r(), p("div", xl, [
2700
- y("div", Sl, [
2701
- g(C, { style: { "flex-shrink": "0" } }),
2702
- g(h, {
2703
- text: s.getColumnLabel(v.prop)
2901
+ C.visible ? (r(), g("div", Ui, [
2902
+ b("div", ji, [
2903
+ p(y, { style: { "flex-shrink": "0" } }),
2904
+ p(c, {
2905
+ text: s.getColumnLabel(C.prop)
2704
2906
  }, null, 8, ["text"])
2705
2907
  ]),
2706
- y("div", Tl, [
2707
- v.cancellable ? (r(), m(D, x({
2908
+ b("div", Ji, [
2909
+ C.cancellable ? (r(), m(O, _({
2708
2910
  key: 0,
2709
- content: i.t("cancel"),
2911
+ content: l.t("cancel"),
2710
2912
  placement: "top"
2711
- }, { ref_for: !0 }, i.afterOpenDelay), {
2913
+ }, { ref_for: !0 }, l.afterOpenDelay), {
2712
2914
  default: f(() => [
2713
- g(n, x({ ref_for: !0 }, i.buttonType, {
2714
- size: i.getCompatSize("mini"),
2915
+ p(o, _({ ref_for: !0 }, l.buttonType, {
2916
+ size: l.getCompatSize("mini"),
2715
2917
  class: "iconfont-button delete-button",
2716
- onClick: (J) => v.visible = !1
2918
+ onClick: (J) => C.visible = !1
2717
2919
  }), {
2718
2920
  default: f(() => [
2719
- g(O)
2921
+ p(F)
2720
2922
  ]),
2721
2923
  _: 2
2722
2924
  }, 1040, ["size", "onClick"])
2723
2925
  ]),
2724
2926
  _: 2
2725
- }, 1040, ["content"])) : b("", !0),
2726
- s.canMoveTop(v, j) ? (r(), m(D, x({
2927
+ }, 1040, ["content"])) : v("", !0),
2928
+ s.canMoveTop(C, B) ? (r(), m(O, _({
2727
2929
  key: 1,
2728
- content: i.t("top"),
2930
+ content: l.t("top"),
2729
2931
  placement: "top"
2730
- }, { ref_for: !0 }, i.afterOpenDelay), {
2932
+ }, { ref_for: !0 }, l.afterOpenDelay), {
2731
2933
  default: f(() => [
2732
- g(n, x({ ref_for: !0 }, i.buttonType, {
2733
- size: i.getCompatSize("mini"),
2934
+ p(o, _({ ref_for: !0 }, l.buttonType, {
2935
+ size: l.getCompatSize("mini"),
2734
2936
  class: "iconfont-button top-button",
2735
- onClick: (J) => s.moveTop(v, j)
2937
+ onClick: (J) => s.moveTop(C, B)
2736
2938
  }), {
2737
2939
  default: f(() => [
2738
- g(w)
2940
+ p(j)
2739
2941
  ]),
2740
2942
  _: 2
2741
2943
  }, 1040, ["size", "onClick"])
2742
2944
  ]),
2743
2945
  _: 2
2744
- }, 1040, ["content"])) : b("", !0),
2745
- v.fixed !== "right" ? (r(), m(D, x({
2946
+ }, 1040, ["content"])) : v("", !0),
2947
+ C.fixed !== "right" ? (r(), m(O, _({
2746
2948
  key: 2,
2747
- content: v.fixed === "left" ? i.t("cancelLeftFixed") : i.t("leftFixed"),
2949
+ content: C.fixed === "left" ? l.t("cancelLeftFixed") : l.t("leftFixed"),
2748
2950
  placement: "top"
2749
- }, { ref_for: !0 }, i.afterOpenDelay), {
2951
+ }, { ref_for: !0 }, l.afterOpenDelay), {
2750
2952
  default: f(() => [
2751
- g(n, x({ ref_for: !0 }, i.buttonType, {
2752
- size: i.getCompatSize("mini"),
2753
- class: ["iconfont-button left-fixed-btn", { "active-fixed": v.fixed === "left" }],
2754
- onClick: (J) => s.frozenLeftHandle(j),
2755
- disabled: v.fixed !== "left" && s.isThanMaxFrozen
2953
+ p(o, _({ ref_for: !0 }, l.buttonType, {
2954
+ size: l.getCompatSize("mini"),
2955
+ class: ["iconfont-button left-fixed-btn", { "active-fixed": C.fixed === "left" }],
2956
+ onClick: (J) => s.frozenLeftHandle(B),
2957
+ disabled: C.fixed !== "left" && s.isThanMaxFrozen
2756
2958
  }), {
2757
2959
  default: f(() => [
2758
- g(U)
2960
+ p(N)
2759
2961
  ]),
2760
2962
  _: 2
2761
2963
  }, 1040, ["size", "class", "onClick", "disabled"])
2762
2964
  ]),
2763
2965
  _: 2
2764
- }, 1040, ["content"])) : b("", !0),
2765
- v.fixed !== "left" ? (r(), m(D, x({
2966
+ }, 1040, ["content"])) : v("", !0),
2967
+ C.fixed !== "left" ? (r(), m(O, _({
2766
2968
  key: 3,
2767
- content: v.fixed === "right" ? i.t("cancelRightFixed") : i.t("rightFixed"),
2969
+ content: C.fixed === "right" ? l.t("cancelRightFixed") : l.t("rightFixed"),
2768
2970
  placement: "top"
2769
- }, { ref_for: !0 }, i.afterOpenDelay), {
2971
+ }, { ref_for: !0 }, l.afterOpenDelay), {
2770
2972
  default: f(() => [
2771
- g(n, x({ ref_for: !0 }, i.buttonType, {
2772
- size: i.getCompatSize("mini"),
2773
- class: ["iconfont-button right-fixed-btn", { "active-fixed": v.fixed === "right" }],
2774
- onClick: (J) => s.frozenRightHandle(j),
2775
- disabled: v.fixed !== "right" && s.isThanMaxRightFrozen
2973
+ p(o, _({ ref_for: !0 }, l.buttonType, {
2974
+ size: l.getCompatSize("mini"),
2975
+ class: ["iconfont-button right-fixed-btn", { "active-fixed": C.fixed === "right" }],
2976
+ onClick: (J) => s.frozenRightHandle(B),
2977
+ disabled: C.fixed !== "right" && s.isThanMaxRightFrozen
2776
2978
  }), {
2777
2979
  default: f(() => [
2778
- g(o)
2980
+ p(a)
2779
2981
  ]),
2780
2982
  _: 2
2781
2983
  }, 1040, ["size", "class", "onClick", "disabled"])
2782
2984
  ]),
2783
2985
  _: 2
2784
- }, 1040, ["content"])) : b("", !0)
2986
+ }, 1040, ["content"])) : v("", !0)
2785
2987
  ])
2786
- ])) : b("", !0)
2787
- ], 10, _l))), 128))
2988
+ ])) : v("", !0)
2989
+ ], 10, Bi))), 128))
2788
2990
  ], 512)
2789
2991
  ])
2790
2992
  ]),
2791
- y("div", Vl, [
2792
- y("div", wl, [
2793
- g(n, {
2794
- size: i.getCompatSize("mini"),
2993
+ b("div", Ki, [
2994
+ b("div", Qi, [
2995
+ p(o, {
2996
+ size: l.getCompatSize("mini"),
2795
2997
  onClick: s.handleRestoreDefault
2796
2998
  }, {
2797
2999
  default: f(() => [
2798
- L(S(i.t("restoreDefault")), 1)
3000
+ L(w(l.t("restoreDefault")), 1)
2799
3001
  ]),
2800
3002
  _: 1
2801
3003
  }, 8, ["size", "onClick"])
2802
3004
  ]),
2803
- y("div", zl, [
2804
- g(n, {
2805
- size: i.getCompatSize("mini"),
2806
- onClick: l[1] || (l[1] = (v) => i.popoverVisible = !1)
3005
+ b("div", qi, [
3006
+ p(o, {
3007
+ size: l.getCompatSize("mini"),
3008
+ onClick: i[1] || (i[1] = (C) => l.popoverVisible = !1)
2807
3009
  }, {
2808
3010
  default: f(() => [
2809
- L(S(i.t("cancel")), 1)
3011
+ L(w(l.t("cancel")), 1)
2810
3012
  ]),
2811
3013
  _: 1
2812
3014
  }, 8, ["size"]),
2813
- g(n, {
2814
- size: i.getCompatSize("mini"),
3015
+ p(o, {
3016
+ size: l.getCompatSize("mini"),
2815
3017
  type: "primary",
2816
3018
  onClick: s.onSave
2817
3019
  }, {
2818
3020
  default: f(() => [
2819
- L(S(i.t("saveAndApply")), 1)
3021
+ L(w(l.t("saveAndApply")), 1)
2820
3022
  ]),
2821
3023
  _: 1
2822
3024
  }, 8, ["size", "onClick"])
2823
3025
  ])
2824
3026
  ])
2825
- ])) : b("", !0)
3027
+ ])) : v("", !0)
2826
3028
  ]),
2827
3029
  _: 1
2828
3030
  }, 16, ["placement", "onShow", "onHide"]);
2829
3031
  }
2830
- const Ll = /* @__PURE__ */ V(dl, [["render", Fl], ["__scopeId", "data-v-127cbd33"]]), Ol = !1, Dl = !0;
3032
+ const Xi = /* @__PURE__ */ V(Oi, [["render", Gi], ["__scopeId", "data-v-127cbd33"]]), Zi = !1, $i = !0;
2831
3033
  function le(e) {
2832
3034
  if (!Array.isArray(e))
2833
3035
  return e;
2834
- const l = [];
3036
+ const i = [];
2835
3037
  for (const t of e)
2836
3038
  if (t)
2837
3039
  if (typeof t.type == "symbol" && t.children) {
2838
- let a = t.children;
2839
- if (typeof a == "function")
3040
+ let n = t.children;
3041
+ if (typeof n == "function")
2840
3042
  continue;
2841
- if (Array.isArray(a)) {
2842
- const i = le(a);
2843
- l.push(...i);
3043
+ if (Array.isArray(n)) {
3044
+ const l = le(n);
3045
+ i.push(...l);
2844
3046
  } else {
2845
- const i = le([a]);
2846
- l.push(...i);
3047
+ const l = le([n]);
3048
+ i.push(...l);
2847
3049
  }
2848
3050
  } else
2849
- l.push(t);
2850
- return l;
3051
+ i.push(t);
3052
+ return i;
2851
3053
  }
2852
- const Ml = {
3054
+ const el = {
2853
3055
  name: "TmTable",
2854
3056
  components: {
2855
- TableSearch: be,
2856
- TablePagination: Gt,
2857
- TableMenu: ll,
2858
- ColumnConfig: Ll,
2859
- RefreshIcon: Ye,
3057
+ TableSearch: we,
3058
+ TablePagination: bi,
3059
+ TableMenu: xi,
3060
+ ColumnConfig: Xi,
3061
+ RefreshIcon: $e,
2860
3062
  // 用于渲染VNode的组件
2861
3063
  ColumnRenderer: {
2862
3064
  props: ["vnode"],
@@ -2942,15 +3144,29 @@ const Ml = {
2942
3144
  searchForm: {
2943
3145
  type: Object,
2944
3146
  default: () => ({})
3147
+ },
3148
+ // FormItemLayout 全局配置参数
3149
+ labelWidth: {
3150
+ type: [String, Number],
3151
+ default: void 0
3152
+ },
3153
+ inputWidth: {
3154
+ type: [String, Number],
3155
+ default: void 0
3156
+ },
3157
+ direction: {
3158
+ type: String,
3159
+ default: void 0,
3160
+ validator: (e) => !e || ["horizontal", "vertical"].includes(e)
2945
3161
  }
2946
3162
  },
2947
3163
  data() {
2948
3164
  return {
2949
- getDefaultSize: I,
3165
+ getDefaultSize: M,
2950
3166
  getCompatSize: K,
2951
- isVue3: Dl,
2952
- isVue2: Ol,
2953
- t: W().t,
3167
+ isVue3: $i,
3168
+ isVue2: Zi,
3169
+ t: R().t,
2954
3170
  tableData: [],
2955
3171
  tableLoading: !1,
2956
3172
  columnsLoading: !1,
@@ -3044,10 +3260,10 @@ const Ml = {
3044
3260
  current: this.paginationInfo.current
3045
3261
  },
3046
3262
  params: this.searchForm
3047
- }), { list: l, total: t, pageSize: a, current: i } = e;
3048
- this.tableData = l;
3263
+ }), { list: i, total: t, pageSize: n, current: l } = e;
3264
+ this.tableData = i;
3049
3265
  let s = T({}, this.paginationInfo);
3050
- t !== void 0 && (s.total = t), i !== void 0 && (s.current = i), a !== void 0 && (s.pageSize = a), this.paginationInfo = s;
3266
+ t !== void 0 && (s.total = t), l !== void 0 && (s.current = l), n !== void 0 && (s.pageSize = n), this.paginationInfo = s;
3051
3267
  } catch (e) {
3052
3268
  } finally {
3053
3269
  this.tableLoading = !1;
@@ -3057,10 +3273,10 @@ const Ml = {
3057
3273
  // 获取表格高度
3058
3274
  getTableHeight() {
3059
3275
  this.isAutoHeight() ? this.$nextTick(() => {
3060
- const e = this.$refs.table, l = this.$refs.tmPagination;
3276
+ const e = this.$refs.table, i = this.$refs.tmPagination;
3061
3277
  if (!e) return;
3062
- const t = e.$el, a = l && l.$el && l.$el.offsetHeight || 0;
3063
- this.tableHeight = document.documentElement.clientHeight - t.offsetTop - a - this.calcHeight;
3278
+ const t = e.$el, n = i && i.$el && i.$el.offsetHeight || 0;
3279
+ this.tableHeight = document.documentElement.clientHeight - t.offsetTop - n - this.calcHeight;
3064
3280
  }) : this.tableHeight = this.height, this.refreshTable();
3065
3281
  },
3066
3282
  // 处理查询
@@ -3094,14 +3310,14 @@ const Ml = {
3094
3310
  this.tableReload++;
3095
3311
  }
3096
3312
  }
3097
- }, Al = {
3313
+ }, tl = {
3098
3314
  class: "tm-table",
3099
3315
  ref: "tablePage"
3100
3316
  };
3101
- function Hl(e, l, t, a, i, s) {
3102
- const n = d("table-search"), h = d("RefreshIcon"), u = d("el-button"), c = d("el-tooltip"), C = d("ColumnConfig"), O = d("table-menu"), D = d("columnRenderer"), w = d("el-table"), U = d("table-pagination"), o = ze("loading");
3103
- return r(), p("div", Al, [
3104
- t.searchColumns && t.searchColumns.length > 0 ? (r(), m(n, {
3317
+ function il(e, i, t, n, l, s) {
3318
+ const o = u("table-search"), c = u("RefreshIcon"), d = u("el-button"), h = u("el-tooltip"), y = u("ColumnConfig"), F = u("table-menu"), O = u("columnRenderer"), j = u("el-table"), N = u("table-pagination"), a = Ie("loading");
3319
+ return r(), g("div", tl, [
3320
+ t.searchColumns && t.searchColumns.length > 0 ? (r(), m(o, {
3105
3321
  key: 0,
3106
3322
  ref: "search",
3107
3323
  onSearch: s.search,
@@ -3109,79 +3325,86 @@ function Hl(e, l, t, a, i, s) {
3109
3325
  "onUpdate:searchForm": s.handleUpdateSearchForm,
3110
3326
  disabled: s.pageLoading,
3111
3327
  "search-columns": t.searchColumns,
3112
- "search-form": t.searchForm
3328
+ "search-form": t.searchForm,
3329
+ "label-width": t.labelWidth,
3330
+ "input-width": t.inputWidth,
3331
+ direction: t.direction
3113
3332
  }, {
3114
3333
  default: f(() => [
3115
- F(e.$slots, "search", {}, void 0, !0)
3334
+ x(e.$slots, "search", {}, void 0, !0)
3116
3335
  ]),
3117
3336
  _: 3
3118
- }, 8, ["onSearch", "onReset", "onUpdate:searchForm", "disabled", "search-columns", "search-form"])) : b("", !0),
3119
- t.showMenu ? (r(), m(O, { key: 1 }, {
3337
+ }, 8, ["onSearch", "onReset", "onUpdate:searchForm", "disabled", "search-columns", "search-form", "label-width", "input-width", "direction"])) : v("", !0),
3338
+ x(e.$slots, "between-search-menu", {}, void 0, !0),
3339
+ t.showMenu ? (r(), m(F, { key: 1 }, {
3120
3340
  left: f(() => [
3121
- F(e.$slots, "menu-left", {}, void 0, !0)
3341
+ x(e.$slots, "menu-left", {}, void 0, !0)
3122
3342
  ]),
3123
3343
  right: f(() => [
3124
- F(e.$slots, "menu-right", {}, void 0, !0),
3125
- t.refreshButton && typeof t.data == "function" ? (r(), m(c, x({
3344
+ x(e.$slots, "menu-right", {}, void 0, !0),
3345
+ t.refreshButton && typeof t.data == "function" ? (r(), m(h, _({
3126
3346
  key: 0,
3127
- content: i.t("refresh"),
3347
+ content: l.t("refresh"),
3128
3348
  placement: "top"
3129
- }, i.afterOpenDelay), {
3349
+ }, l.afterOpenDelay), {
3130
3350
  default: f(() => [
3131
- g(u, {
3351
+ p(d, {
3132
3352
  onClick: s.handleRefresh,
3133
3353
  circle: "",
3134
- size: i.getDefaultSize()
3354
+ size: l.getDefaultSize()
3135
3355
  }, {
3136
3356
  default: f(() => [
3137
- g(h)
3357
+ p(c)
3138
3358
  ]),
3139
3359
  _: 1
3140
3360
  }, 8, ["onClick", "size"])
3141
3361
  ]),
3142
3362
  _: 1
3143
- }, 16, ["content"])) : b("", !0),
3144
- t.columnSettingButton ? (r(), m(C, {
3363
+ }, 16, ["content"])) : v("", !0),
3364
+ t.columnSettingButton ? (r(), m(y, {
3145
3365
  key: 1,
3146
3366
  maxFixedLeftQuantity: t.maxFixedLeftQuantity,
3147
3367
  maxFixedRightQuantity: t.maxFixedRightQuantity,
3148
3368
  tableKey: s.computedTableKey,
3149
- columns: i.originalColumns,
3369
+ columns: l.originalColumns,
3150
3370
  onComplete: s.handleColumnConfigComplete
3151
- }, null, 8, ["maxFixedLeftQuantity", "maxFixedRightQuantity", "tableKey", "columns", "onComplete"])) : b("", !0)
3371
+ }, null, 8, ["maxFixedLeftQuantity", "maxFixedRightQuantity", "tableKey", "columns", "onComplete"])) : v("", !0)
3152
3372
  ]),
3153
3373
  _: 3
3154
- })) : b("", !0),
3155
- ke((r(), m(w, x({ ref: "table" }, B(T({}, e.$attrs), { border: t.border }), E(i.isVue2 ? e.$listeners : {}), {
3156
- data: i.tableData,
3157
- height: i.tableHeight,
3158
- size: i.getCompatSize("mini"),
3374
+ })) : v("", !0),
3375
+ x(e.$slots, "between-menu-table", {}, void 0, !0),
3376
+ We((r(), m(j, _({ ref: "table" }, W(T({}, e.$attrs), { border: t.border }), I(l.isVue2 ? e.$listeners : {}), {
3377
+ data: l.tableData,
3378
+ height: l.tableHeight,
3379
+ size: l.getCompatSize("mini"),
3159
3380
  onSelectionChange: s.handleSelectionChange,
3160
- key: i.tableReload
3381
+ key: l.tableReload
3161
3382
  }), {
3162
3383
  default: f(() => [
3163
- (r(!0), p(k, null, M(i.displayColumns, (R) => (r(), m(D, {
3164
- vnode: R,
3165
- key: i.isVue3 ? R.id : R.data.attrs.prop
3384
+ (r(!0), g(k, null, D(l.displayColumns, (H) => (r(), m(O, {
3385
+ vnode: H,
3386
+ key: l.isVue3 ? H.id : H.data.attrs.prop
3166
3387
  }, null, 8, ["vnode"]))), 128))
3167
3388
  ]),
3168
3389
  _: 1
3169
3390
  }, 16, ["data", "height", "size", "onSelectionChange"])), [
3170
- [o, s.pageLoading]
3391
+ [a, s.pageLoading]
3171
3392
  ]),
3172
- s.computedShowPagination ? (r(), m(U, {
3393
+ x(e.$slots, "between-table-pagination", {}, void 0, !0),
3394
+ s.computedShowPagination ? (r(), m(N, {
3173
3395
  key: 2,
3174
3396
  ref: "tmPagination",
3175
- "page-size": i.paginationInfo.pageSize,
3176
- current: i.paginationInfo.current,
3177
- total: i.paginationInfo.total,
3178
- disabled: i.tableLoading,
3397
+ "page-size": l.paginationInfo.pageSize,
3398
+ current: l.paginationInfo.current,
3399
+ total: l.paginationInfo.total,
3400
+ disabled: l.tableLoading,
3179
3401
  onSizeChange: s.handleSizeChange,
3180
3402
  onCurrentChange: s.handleCurrentChange
3181
- }, null, 8, ["page-size", "current", "total", "disabled", "onSizeChange", "onCurrentChange"])) : b("", !0)
3403
+ }, null, 8, ["page-size", "current", "total", "disabled", "onSizeChange", "onCurrentChange"])) : v("", !0),
3404
+ x(e.$slots, "after-pagination", {}, void 0, !0)
3182
3405
  ], 512);
3183
3406
  }
3184
- const ye = /* @__PURE__ */ V(Ml, [["render", Hl], ["__scopeId", "data-v-8db1f265"]]), Rl = !1, El = !0, Il = {
3407
+ const Ve = /* @__PURE__ */ V(el, [["render", il], ["__scopeId", "data-v-5c3f3820"]]), ll = !1, sl = !0, nl = {
3185
3408
  name: "TmTableColumn",
3186
3409
  inheritAttrs: !1,
3187
3410
  computed: {
@@ -3194,8 +3417,8 @@ const ye = /* @__PURE__ */ V(Ml, [["render", Hl], ["__scopeId", "data-v-8db1f265
3194
3417
  },
3195
3418
  data() {
3196
3419
  return {
3197
- isVue2: Rl,
3198
- isVue3: El
3420
+ isVue2: ll,
3421
+ isVue3: sl
3199
3422
  };
3200
3423
  },
3201
3424
  created() {
@@ -3205,21 +3428,21 @@ const ye = /* @__PURE__ */ V(Ml, [["render", Hl], ["__scopeId", "data-v-8db1f265
3205
3428
  });
3206
3429
  }
3207
3430
  };
3208
- function Pl(e, l, t, a, i, s) {
3209
- const n = d("el-table-column");
3210
- return s.isVisible ? (r(), m(n, x({ key: 0 }, e.$attrs, E(i.isVue2 ? e.$listeners : {})), Fe({ _: 2 }, [
3211
- M(s.slots, (h, u) => ({
3212
- name: u,
3213
- fn: f((c) => [
3214
- F(e.$slots, u, Le(Oe(c)))
3431
+ function al(e, i, t, n, l, s) {
3432
+ const o = u("el-table-column");
3433
+ return s.isVisible ? (r(), m(o, _({ key: 0 }, e.$attrs, I(l.isVue2 ? e.$listeners : {})), ge({ _: 2 }, [
3434
+ D(s.slots, (c, d) => ({
3435
+ name: d,
3436
+ fn: f((h) => [
3437
+ x(e.$slots, d, Pe(Ne(h)))
3215
3438
  ])
3216
3439
  }))
3217
- ]), 1040)) : b("", !0);
3440
+ ]), 1040)) : v("", !0);
3218
3441
  }
3219
- const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3442
+ const Fe = /* @__PURE__ */ V(nl, [["render", al]]), { t: ie } = R(), ol = {
3220
3443
  name: "TmAdvancedEllipsisText",
3221
3444
  components: {
3222
- CopyIcon: de
3445
+ CopyIcon: be
3223
3446
  },
3224
3447
  props: {
3225
3448
  rows: {
@@ -3336,7 +3559,7 @@ const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3336
3559
  },
3337
3560
  handleCopy() {
3338
3561
  navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(this.originalText).then(() => {
3339
- this.$message.success(te("copySuccess"));
3562
+ this.$message.success(ie("copySuccess"));
3340
3563
  }).catch(() => {
3341
3564
  this.fallbackCopy();
3342
3565
  }) : this.fallbackCopy();
@@ -3345,23 +3568,23 @@ const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3345
3568
  const e = document.createElement("textarea");
3346
3569
  e.value = this.originalText, e.style.position = "fixed", e.style.left = "-999999px", e.style.top = "-999999px", document.body.appendChild(e), e.focus(), e.select();
3347
3570
  try {
3348
- document.execCommand("copy"), this.$message.success(te("copySuccess"));
3349
- } catch (l) {
3350
- this.$message.error(te("copyFailed"));
3571
+ document.execCommand("copy"), this.$message.success(ie("copySuccess"));
3572
+ } catch (i) {
3573
+ this.$message.error(ie("copyFailed"));
3351
3574
  }
3352
3575
  document.body.removeChild(e);
3353
3576
  },
3354
3577
  getTextContent() {
3355
3578
  if (this.$slots.default) {
3356
3579
  const e = this.$slots.default;
3357
- return e().map((l) => typeof l.children == "string" ? l.children : Array.isArray(l.children) ? l.children.map((t) => t.children || "").join("") : "").join("");
3580
+ return e().map((i) => typeof i.children == "string" ? i.children : Array.isArray(i.children) ? i.children.map((t) => t.children || "").join("") : "").join("");
3358
3581
  }
3359
3582
  return this.text || "";
3360
3583
  },
3361
3584
  calculateLineHeight() {
3362
3585
  const e = this.$refs.containerRef;
3363
3586
  if (!e) return;
3364
- const l = window.getComputedStyle(e);
3587
+ const i = window.getComputedStyle(e);
3365
3588
  this.containerWidth = e.offsetWidth;
3366
3589
  const t = this.$refs.measureRef;
3367
3590
  if (t) {
@@ -3370,15 +3593,15 @@ const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3370
3593
  wordBreak: "break-all",
3371
3594
  whiteSpace: "normal"
3372
3595
  }), t.textContent = "测", t.offsetHeight;
3373
- const a = t.offsetHeight;
3374
- t.innerHTML = "", this.lineHeight = a;
3596
+ const n = t.offsetHeight;
3597
+ t.innerHTML = "", this.lineHeight = n;
3375
3598
  } else {
3376
- const a = l.lineHeight;
3377
- if (a && a !== "normal")
3378
- this.lineHeight = parseInt(a);
3599
+ const n = i.lineHeight;
3600
+ if (n && n !== "normal")
3601
+ this.lineHeight = parseInt(n);
3379
3602
  else {
3380
- const i = parseInt(l.fontSize);
3381
- this.lineHeight = i * 1.2;
3603
+ const l = parseInt(i.fontSize);
3604
+ this.lineHeight = l * 1.2;
3382
3605
  }
3383
3606
  }
3384
3607
  },
@@ -3400,43 +3623,43 @@ const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3400
3623
  if (this.rows === 1)
3401
3624
  this.frontLines = [], this.lastLineText = e, this.isLastLineEllipsis = this.checkIfTextOverflows(e);
3402
3625
  else {
3403
- const l = this.lineHeight;
3404
- if (this.getTextHeight(e) <= l)
3626
+ const i = this.lineHeight;
3627
+ if (this.getTextHeight(e) <= i)
3405
3628
  this.frontLines = [], this.lastLineText = e, this.isLastLineEllipsis = this.checkIfTextOverflows(e);
3406
3629
  else {
3407
- const a = this.lineHeight * (this.rows - 1), i = this.findTextForHeight(e, a);
3408
- this.frontLines = this.splitTextToLines(i);
3409
- const s = e.substring(i.length);
3630
+ const n = this.lineHeight * (this.rows - 1), l = this.findTextForHeight(e, n);
3631
+ this.frontLines = this.splitTextToLines(l);
3632
+ const s = e.substring(l.length);
3410
3633
  this.lastLineText = s, this.isLastLineEllipsis = s.length > 0 && this.checkIfTextOverflows(s);
3411
3634
  }
3412
3635
  }
3413
3636
  this.isCalculating = !1;
3414
3637
  },
3415
- findTextForHeight(e, l) {
3416
- if (this.getTextHeight(e) <= l)
3638
+ findTextForHeight(e, i) {
3639
+ if (this.getTextHeight(e) <= i)
3417
3640
  return e;
3418
- let t = 0, a = e.length, i = "";
3419
- for (; t <= a; ) {
3420
- const s = Math.floor((t + a) / 2), n = e.substring(0, s);
3421
- this.getTextHeight(n) <= l ? (i = n, t = s + 1) : a = s - 1;
3641
+ let t = 0, n = e.length, l = "";
3642
+ for (; t <= n; ) {
3643
+ const s = Math.floor((t + n) / 2), o = e.substring(0, s);
3644
+ this.getTextHeight(o) <= i ? (l = o, t = s + 1) : n = s - 1;
3422
3645
  }
3423
- return i;
3646
+ return l;
3424
3647
  },
3425
3648
  splitTextToLines(e) {
3426
3649
  if (!e) return [];
3427
- const l = [];
3650
+ const i = [];
3428
3651
  let t = e;
3429
3652
  for (; t.length > 0; ) {
3430
- const a = this.findTextForHeight(t, this.lineHeight);
3431
- if (a.length === 0) break;
3432
- l.push(a), t = t.substring(a.length);
3653
+ const n = this.findTextForHeight(t, this.lineHeight);
3654
+ if (n.length === 0) break;
3655
+ i.push(n), t = t.substring(n.length);
3433
3656
  }
3434
- return l;
3657
+ return i;
3435
3658
  },
3436
3659
  checkIfTextOverflows(e) {
3437
3660
  if (!e) return !1;
3438
- const l = this.getTextWidth(e), t = this.shouldShowToolbar && this.hasToolbarContent ? this.getToolbarWidth() : 0, a = this.containerWidth - t - 5;
3439
- return l > a;
3661
+ const i = this.getTextWidth(e), t = this.shouldShowToolbar && this.hasToolbarContent ? this.getToolbarWidth() : 0, n = this.containerWidth - t - 5;
3662
+ return i > n;
3440
3663
  },
3441
3664
  getToolbarWidth() {
3442
3665
  let e = 0;
@@ -3452,18 +3675,18 @@ const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3452
3675
  getTextWidth(e) {
3453
3676
  return this.measureText(e, { whiteSpace: "nowrap" });
3454
3677
  },
3455
- measureText(e, l = {}) {
3678
+ measureText(e, i = {}) {
3456
3679
  if (!this.$refs.containerRef || !this.$refs.measureRef)
3457
3680
  return 0;
3458
- const t = this.$refs.measureRef, a = t.style.cssText;
3459
- this.setMeasureElementStyle(t, l), t.textContent = e, t.offsetHeight;
3460
- const i = l.whiteSpace === "nowrap" ? t.offsetWidth : t.offsetHeight;
3461
- return t.style.cssText = a, t.innerHTML = "", i;
3681
+ const t = this.$refs.measureRef, n = t.style.cssText;
3682
+ this.setMeasureElementStyle(t, i), t.textContent = e, t.offsetHeight;
3683
+ const l = i.whiteSpace === "nowrap" ? t.offsetWidth : t.offsetHeight;
3684
+ return t.style.cssText = n, t.innerHTML = "", l;
3462
3685
  },
3463
- setMeasureElementStyle(e, l = {}) {
3686
+ setMeasureElementStyle(e, i = {}) {
3464
3687
  const t = window.getComputedStyle(this.$refs.containerRef);
3465
- e.style.cssText = "", e.style.position = "absolute", e.style.left = "-9999px", e.style.top = "-9999px", e.style.visibility = "hidden", e.style.pointerEvents = "none", e.style.zIndex = "-1", e.style.fontSize = t.fontSize, e.style.fontFamily = t.fontFamily, e.style.fontWeight = t.fontWeight, e.style.lineHeight = t.lineHeight, e.style.letterSpacing = t.letterSpacing, e.style.wordSpacing = t.wordSpacing, e.style.padding = "0", e.style.margin = "0", e.style.border = "none", e.style.boxSizing = "border-box", Object.entries(l).forEach(([a, i]) => {
3466
- e.style[a] = i;
3688
+ e.style.cssText = "", e.style.position = "absolute", e.style.left = "-9999px", e.style.top = "-9999px", e.style.visibility = "hidden", e.style.pointerEvents = "none", e.style.zIndex = "-1", e.style.fontSize = t.fontSize, e.style.fontFamily = t.fontFamily, e.style.fontWeight = t.fontWeight, e.style.lineHeight = t.lineHeight, e.style.letterSpacing = t.letterSpacing, e.style.wordSpacing = t.wordSpacing, e.style.padding = "0", e.style.margin = "0", e.style.border = "none", e.style.boxSizing = "border-box", Object.entries(i).forEach(([n, l]) => {
3689
+ e.style[n] = l;
3467
3690
  });
3468
3691
  },
3469
3692
  handleMouseEnter() {
@@ -3474,9 +3697,9 @@ const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3474
3697
  },
3475
3698
  setupResizeObserver() {
3476
3699
  typeof ResizeObserver != "undefined" && (this.resizeObserver = new ResizeObserver((e) => {
3477
- const l = e[0];
3478
- if (l) {
3479
- const t = l.contentRect.width;
3700
+ const i = e[0];
3701
+ if (i) {
3702
+ const t = i.contentRect.width;
3480
3703
  Math.abs(t - this.containerWidth) > 1 && requestAnimationFrame(() => {
3481
3704
  this.calculateLineHeight(), this.calculateLayout();
3482
3705
  });
@@ -3501,119 +3724,119 @@ const ve = /* @__PURE__ */ V(Il, [["render", Pl]]), { t: te } = W(), Wl = {
3501
3724
  this.tableRowElement && (this.tableRowElement.removeEventListener("mouseenter", this.handleMouseEnter), this.tableRowElement.removeEventListener("mouseleave", this.handleMouseLeave), this.tableRowElement = null);
3502
3725
  }
3503
3726
  }
3504
- }, Bl = { class: "tm-ellipsis-text-wrapper" }, Nl = ["innerHTML"], Ul = { class: "tm-ellipsis-last-line" }, jl = ["innerHTML"], Jl = {
3727
+ }, rl = { class: "tm-ellipsis-text-wrapper" }, ul = ["innerHTML"], dl = { class: "tm-ellipsis-last-line" }, cl = ["innerHTML"], hl = {
3505
3728
  key: 0,
3506
3729
  class: "tm-ellipsis-toolbar-part"
3507
- }, Kl = {
3730
+ }, fl = {
3508
3731
  key: 1,
3509
3732
  class: "tm-ellipsis-text-wrapper"
3510
- }, Ql = ["innerHTML"], ql = { class: "tm-ellipsis-last-line" }, Yl = ["innerHTML"], Gl = {
3733
+ }, pl = ["innerHTML"], ml = { class: "tm-ellipsis-last-line" }, gl = ["innerHTML"], bl = {
3511
3734
  key: 0,
3512
3735
  class: "tm-ellipsis-toolbar-part"
3513
- }, Xl = {
3736
+ }, yl = {
3514
3737
  ref: "measureRef",
3515
3738
  class: "tm-ellipsis-measure"
3516
3739
  };
3517
- function Zl(e, l, t, a, i, s) {
3518
- const n = d("CopyIcon"), h = d("el-tooltip");
3519
- return r(), p("div", {
3740
+ function vl(e, i, t, n, l, s) {
3741
+ const o = u("CopyIcon"), c = u("el-tooltip");
3742
+ return r(), g("div", {
3520
3743
  ref: "containerRef",
3521
- style: N(s.containerStyle),
3744
+ style: U(s.containerStyle),
3522
3745
  class: "tm-ellipsis-text",
3523
- onMouseenter: l[0] || (l[0] = (...u) => s.handleMouseEnter && s.handleMouseEnter(...u)),
3524
- onMouseleave: l[1] || (l[1] = (...u) => s.handleMouseLeave && s.handleMouseLeave(...u))
3746
+ onMouseenter: i[0] || (i[0] = (...d) => s.handleMouseEnter && s.handleMouseEnter(...d)),
3747
+ onMouseleave: i[1] || (i[1] = (...d) => s.handleMouseLeave && s.handleMouseLeave(...d))
3525
3748
  }, [
3526
- t.showTooltip && i.isLastLineEllipsis ? (r(), m(h, x({
3749
+ t.showTooltip && l.isLastLineEllipsis ? (r(), m(c, _({
3527
3750
  key: 0,
3528
- content: i.originalText,
3529
- disabled: !t.showTooltip || !i.isLastLineEllipsis
3751
+ content: l.originalText,
3752
+ disabled: !t.showTooltip || !l.isLastLineEllipsis
3530
3753
  }, {
3531
- [i.isVue2 ? "open-delay" : "show-after"]: 300
3754
+ [l.isVue2 ? "open-delay" : "show-after"]: 300
3532
3755
  }, { placement: "top" }), {
3533
3756
  default: f(() => [
3534
- y("div", Bl, [
3535
- (r(!0), p(k, null, M(i.frontLines, (u, c) => (r(), p("div", {
3536
- key: "front-" + c,
3757
+ b("div", rl, [
3758
+ (r(!0), g(k, null, D(l.frontLines, (d, h) => (r(), g("div", {
3759
+ key: "front-" + h,
3537
3760
  class: "tm-ellipsis-line",
3538
- innerHTML: u
3539
- }, null, 8, Nl))), 128)),
3540
- y("div", Ul, [
3541
- y("div", {
3761
+ innerHTML: d
3762
+ }, null, 8, ul))), 128)),
3763
+ b("div", dl, [
3764
+ b("div", {
3542
3765
  class: "tm-ellipsis-text-part",
3543
- innerHTML: i.lastLineText
3544
- }, null, 8, jl),
3545
- s.shouldShowToolbar && s.hasToolbarContent ? (r(), p("div", Jl, [
3546
- t.copyable ? (r(), m(n, {
3766
+ innerHTML: l.lastLineText
3767
+ }, null, 8, cl),
3768
+ s.shouldShowToolbar && s.hasToolbarContent ? (r(), g("div", hl, [
3769
+ t.copyable ? (r(), m(o, {
3547
3770
  key: 0,
3548
3771
  class: "icon-item",
3549
3772
  onClick: s.handleCopy
3550
- }, null, 8, ["onClick"])) : b("", !0),
3551
- F(e.$slots, "toolbar", {}, void 0, !0)
3552
- ])) : b("", !0)
3773
+ }, null, 8, ["onClick"])) : v("", !0),
3774
+ x(e.$slots, "toolbar", {}, void 0, !0)
3775
+ ])) : v("", !0)
3553
3776
  ])
3554
3777
  ])
3555
3778
  ]),
3556
3779
  _: 3
3557
- }, 16, ["content", "disabled"])) : (r(), p("div", Kl, [
3558
- (r(!0), p(k, null, M(i.frontLines, (u, c) => (r(), p("div", {
3559
- key: "front-" + c,
3780
+ }, 16, ["content", "disabled"])) : (r(), g("div", fl, [
3781
+ (r(!0), g(k, null, D(l.frontLines, (d, h) => (r(), g("div", {
3782
+ key: "front-" + h,
3560
3783
  class: "tm-ellipsis-line",
3561
- innerHTML: u
3562
- }, null, 8, Ql))), 128)),
3563
- y("div", ql, [
3564
- y("div", {
3784
+ innerHTML: d
3785
+ }, null, 8, pl))), 128)),
3786
+ b("div", ml, [
3787
+ b("div", {
3565
3788
  class: "tm-ellipsis-text-part",
3566
- innerHTML: i.lastLineText
3567
- }, null, 8, Yl),
3568
- s.shouldShowToolbar && s.hasToolbarContent ? (r(), p("div", Gl, [
3569
- t.copyable ? (r(), m(n, {
3789
+ innerHTML: l.lastLineText
3790
+ }, null, 8, gl),
3791
+ s.shouldShowToolbar && s.hasToolbarContent ? (r(), g("div", bl, [
3792
+ t.copyable ? (r(), m(o, {
3570
3793
  key: 0,
3571
3794
  class: "icon-item",
3572
3795
  onClick: s.handleCopy
3573
- }, null, 8, ["onClick"])) : b("", !0),
3574
- F(e.$slots, "toolbar", {}, void 0, !0)
3575
- ])) : b("", !0)
3796
+ }, null, 8, ["onClick"])) : v("", !0),
3797
+ x(e.$slots, "toolbar", {}, void 0, !0)
3798
+ ])) : v("", !0)
3576
3799
  ])
3577
3800
  ])),
3578
- y("div", Xl, null, 512)
3801
+ b("div", yl, null, 512)
3579
3802
  ], 36);
3580
3803
  }
3581
- const Ce = /* @__PURE__ */ V(Wl, [["render", Zl], ["__scopeId", "data-v-16643222"]]), $l = {
3582
- install(e, l = {}) {
3583
- [ye, ve, Q, Ce].forEach((t) => e.component(t.name, t)), l.tableConfigProvider && al(l.tableConfigProvider), l.lang && ie(l.lang || "zh-CN");
3804
+ const ze = /* @__PURE__ */ V(ol, [["render", vl], ["__scopeId", "data-v-14f27c2e"]]), Cl = {
3805
+ install(e, i = {}) {
3806
+ [Ve, Fe, $, ze].forEach((t) => e.component(t.name, t)), i.tableConfigProvider && Vi(i.tableConfigProvider), i.lang && se(i.lang || "zh-CN");
3584
3807
  }
3585
- }, ei = {
3586
- install: $l.install,
3587
- Table: ye,
3588
- Column: ve,
3589
- Search: be,
3590
- Select: ue,
3591
- AdvancedInput: ce,
3592
- AdvancedDate: he,
3593
- Cascader: fe,
3594
- Radio: pe,
3595
- Checkbox: me,
3596
- Switch: ge,
3597
- EllipsisText: Q,
3598
- AdvancedEllipsisText: Ce,
3599
- setLang: ie,
3600
- useLocale: W
3808
+ }, _l = {
3809
+ install: Cl.install,
3810
+ Table: Ve,
3811
+ Column: Fe,
3812
+ Search: we,
3813
+ Select: ye,
3814
+ AdvancedInput: ve,
3815
+ AdvancedDate: Ce,
3816
+ Cascader: _e,
3817
+ Radio: Se,
3818
+ Checkbox: xe,
3819
+ Switch: Te,
3820
+ EllipsisText: $,
3821
+ AdvancedEllipsisText: ze,
3822
+ setLang: se,
3823
+ useLocale: R
3601
3824
  };
3602
- typeof window != "undefined" && window.Vue && ei.install(window.Vue);
3825
+ typeof window != "undefined" && window.Vue && _l.install(window.Vue);
3603
3826
  export {
3604
- he as AdvancedDate,
3605
- Ce as AdvancedEllipsisText,
3606
- ce as AdvancedInput,
3607
- fe as Cascader,
3608
- me as Checkbox,
3609
- ve as Column,
3610
- Q as EllipsisText,
3611
- pe as Radio,
3612
- be as Search,
3613
- ue as Select,
3614
- ge as Switch,
3615
- ye as Table,
3616
- ei as default,
3617
- ie as setLang,
3618
- W as useLocale
3827
+ Ce as AdvancedDate,
3828
+ ze as AdvancedEllipsisText,
3829
+ ve as AdvancedInput,
3830
+ _e as Cascader,
3831
+ xe as Checkbox,
3832
+ Fe as Column,
3833
+ $ as EllipsisText,
3834
+ Se as Radio,
3835
+ we as Search,
3836
+ ye as Select,
3837
+ Te as Switch,
3838
+ Ve as Table,
3839
+ _l as default,
3840
+ se as setLang,
3841
+ R as useLocale
3619
3842
  };