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.
- package/README.md +215 -31
- package/dist/vue2/tm-table.css +1 -1
- package/dist/vue2/tm-table.es.js +1063 -859
- package/dist/vue2/tm-table.umd.js +1 -1
- package/dist/vue3/tm-table.css +1 -1
- package/dist/vue3/tm-table.es.js +1664 -1441
- package/dist/vue3/tm-table.umd.js +1 -1
- package/package.json +44 -44
package/dist/vue3/tm-table.es.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var ae = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
6
|
-
for (var t in
|
|
7
|
-
ae.call(
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
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
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, W = (e, i) => ke(e, Oe(i));
|
|
13
|
+
var re = (e, i) => {
|
|
14
14
|
var t = {};
|
|
15
|
-
for (var
|
|
16
|
-
ae.call(e,
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var
|
|
19
|
-
|
|
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
|
|
23
|
-
import
|
|
24
|
-
const
|
|
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) =>
|
|
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
|
-
},
|
|
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
|
-
},
|
|
108
|
-
"zh-CN":
|
|
109
|
-
"en-US":
|
|
107
|
+
}, je = {
|
|
108
|
+
"zh-CN": Be,
|
|
109
|
+
"en-US": Ue
|
|
110
110
|
};
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
var
|
|
115
|
-
return ((
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
t:
|
|
120
|
-
setLang:
|
|
121
|
-
currentLang:
|
|
122
|
-
}), V = (e,
|
|
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 [
|
|
125
|
-
t[
|
|
124
|
+
for (const [n, l] of i)
|
|
125
|
+
t[n] = l;
|
|
126
126
|
return t;
|
|
127
|
-
},
|
|
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
|
-
},
|
|
358
|
-
function
|
|
359
|
-
return r(),
|
|
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:
|
|
148
|
+
onClick: i[0] || (i[0] = (...o) => s.handleClick && s.handleClick(...o))
|
|
362
149
|
}, [
|
|
363
|
-
(r(),
|
|
150
|
+
(r(), g("svg", {
|
|
364
151
|
width: t.size,
|
|
365
152
|
height: t.size,
|
|
366
|
-
style:
|
|
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
|
-
|
|
371
|
-
], 12,
|
|
157
|
+
b("path", { d: t.path }, null, 8, qe)
|
|
158
|
+
], 12, Qe))
|
|
372
159
|
]);
|
|
373
160
|
}
|
|
374
|
-
const
|
|
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
|
-
},
|
|
387
|
-
const
|
|
388
|
-
name:
|
|
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
|
|
189
|
+
return me(Ge, this.$props);
|
|
403
190
|
}
|
|
404
191
|
};
|
|
405
|
-
return
|
|
406
|
-
s.component(
|
|
407
|
-
}, e[
|
|
408
|
-
}, {}),
|
|
409
|
-
|
|
410
|
-
const
|
|
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:
|
|
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:
|
|
447
|
-
isVue3:
|
|
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,
|
|
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:
|
|
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
|
|
280
|
+
var h;
|
|
494
281
|
const e = this.$refs.textEl;
|
|
495
282
|
if (!e) return;
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
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,
|
|
504
|
-
if (
|
|
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
|
|
507
|
-
this.currentLines = Math.ceil(t /
|
|
293
|
+
const y = parseFloat(i.lineHeight) || 16;
|
|
294
|
+
this.currentLines = Math.ceil(t / y);
|
|
508
295
|
} else {
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
this.isOverflow =
|
|
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(
|
|
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(
|
|
555
|
-
} catch (
|
|
556
|
-
this.$message.error(
|
|
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
|
-
},
|
|
562
|
-
function
|
|
563
|
-
const
|
|
564
|
-
return r(), m(
|
|
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
|
-
[
|
|
357
|
+
[l.isVue2 ? "open-delay" : "show-after"]: 300
|
|
571
358
|
}), {
|
|
572
359
|
default: f(() => [
|
|
573
|
-
|
|
574
|
-
|
|
360
|
+
b("div", dt, [
|
|
361
|
+
b("div", {
|
|
575
362
|
ref: "textEl",
|
|
576
363
|
class: "ellipsis-text",
|
|
577
|
-
style:
|
|
578
|
-
},
|
|
579
|
-
|
|
580
|
-
class:
|
|
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(
|
|
369
|
+
t.copyable ? (r(), m(o, {
|
|
583
370
|
key: 0,
|
|
584
371
|
class: "icon-item",
|
|
585
372
|
onClick: s.handleCopy
|
|
586
|
-
}, null, 8, ["onClick"])) :
|
|
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
|
|
804
|
+
const ye = /* @__PURE__ */ V(zt, [["render", kt], ["__scopeId", "data-v-b85e9ccb"]]), Ot = {
|
|
594
805
|
name: "TmAdvancedInputFilter",
|
|
595
806
|
components: {
|
|
596
|
-
MoreIcon:
|
|
597
|
-
|
|
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:
|
|
628
|
-
|
|
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
|
-
},
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
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
|
-
|
|
821
|
-
}
|
|
822
|
-
]),
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
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
|
|
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
|
-
|
|
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 = (
|
|
966
|
-
const
|
|
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
|
|
972
|
-
|
|
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
|
|
979
|
-
|
|
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
|
|
986
|
-
|
|
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
|
|
993
|
-
|
|
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
|
|
1000
|
-
|
|
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
|
|
1007
|
-
|
|
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
|
|
1025
|
-
return e && (t.setHours(0, 0, 0, 0),
|
|
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
|
|
1032
|
-
return t.setTime(t.getTime() - 3600 * 1e3 * 24),
|
|
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
|
|
1039
|
-
return t.setTime(t.getTime() - 3600 * 1e3 * 24 * 7), e && (t.setHours(0, 0, 0, 0),
|
|
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
|
|
1046
|
-
return t.setTime(t.getTime() - 3600 * 1e3 * 24 * 30), e && (t.setHours(0, 0, 0, 0),
|
|
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
|
|
1053
|
-
return t.setDate(1), e && (t.setHours(0, 0, 0, 0),
|
|
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
|
|
1060
|
-
return t.setMonth(t.getMonth() - 1), t.setDate(1),
|
|
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((
|
|
1077
|
-
if (typeof
|
|
1078
|
-
const t = /* @__PURE__ */ new Date(), [
|
|
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
|
-
|
|
1084
|
-
|
|
1271
|
+
n,
|
|
1272
|
+
l,
|
|
1085
1273
|
s || 0
|
|
1086
1274
|
);
|
|
1087
1275
|
}
|
|
1088
|
-
return
|
|
1276
|
+
return i;
|
|
1089
1277
|
});
|
|
1090
1278
|
if (this.type === "datetime" && typeof e == "string") {
|
|
1091
|
-
const
|
|
1279
|
+
const i = /* @__PURE__ */ new Date(), [t, n, l] = e.split(":").map(Number);
|
|
1092
1280
|
return new Date(
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1281
|
+
i.getFullYear(),
|
|
1282
|
+
i.getMonth(),
|
|
1283
|
+
i.getDate(),
|
|
1096
1284
|
t,
|
|
1097
|
-
|
|
1098
|
-
|
|
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:
|
|
1120
|
-
isVue3:
|
|
1121
|
-
getDefaultSize:
|
|
1122
|
-
valueField:
|
|
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
|
|
1153
|
-
const
|
|
1154
|
-
return r(),
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
},
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
"range-separator":
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
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
|
|
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:
|
|
1282
|
-
getDefaultSize:
|
|
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
|
|
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
|
|
1325
|
-
Array.isArray(
|
|
1326
|
-
} catch (
|
|
1327
|
-
console.error(
|
|
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
|
|
1336
|
-
const
|
|
1337
|
-
return r(), m(
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
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
|
-
},
|
|
1522
|
+
}, 8, ["label", "label-width", "input-width", "direction"]);
|
|
1364
1523
|
}
|
|
1365
|
-
const
|
|
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:
|
|
1396
|
-
isVue3:
|
|
1397
|
-
getDefaultSize:
|
|
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
|
|
1447
|
-
Array.isArray(
|
|
1448
|
-
} catch (
|
|
1449
|
-
console.error(
|
|
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
|
|
1458
|
-
const
|
|
1459
|
-
return r(),
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
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
|
|
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
|
-
|
|
1687
|
+
label: {
|
|
1688
|
+
type: [String, Function, Object, Array],
|
|
1689
|
+
default: null
|
|
1690
|
+
},
|
|
1691
|
+
// FormItemLayout 配置参数
|
|
1692
|
+
labelWidth: {
|
|
1516
1693
|
type: [String, Number],
|
|
1517
|
-
default:
|
|
1518
|
-
|
|
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:
|
|
1524
|
-
isVue3:
|
|
1525
|
-
getDefaultSize:
|
|
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
|
|
1577
|
-
Array.isArray(
|
|
1578
|
-
} catch (
|
|
1579
|
-
console.error(
|
|
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
|
|
1588
|
-
const
|
|
1589
|
-
return r(),
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
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
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
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
|
-
_:
|
|
1617
|
-
},
|
|
1618
|
-
])
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1789
|
+
_: 3
|
|
1790
|
+
}, 16, ["modelValue"])
|
|
1791
|
+
])
|
|
1792
|
+
]),
|
|
1793
|
+
_: 3
|
|
1794
|
+
}, 8, ["label", "label-width", "input-width", "direction"]);
|
|
1622
1795
|
}
|
|
1623
|
-
const
|
|
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:
|
|
1638
|
-
getDefaultSize:
|
|
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
|
-
},
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
},
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
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
|
|
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
|
|
1701
|
-
const
|
|
1702
|
-
var
|
|
1703
|
-
return s ? (
|
|
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
|
|
1706
|
-
return s ? ((
|
|
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
|
|
1709
|
-
if (!
|
|
1710
|
-
let s = (
|
|
1711
|
-
for (; s && !
|
|
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
|
-
|
|
1892
|
+
n = i(s);
|
|
1714
1893
|
break;
|
|
1715
1894
|
}
|
|
1716
1895
|
s = s.$parent;
|
|
1717
1896
|
}
|
|
1718
1897
|
}
|
|
1719
|
-
return
|
|
1898
|
+
return n ? typeof n == "function" ? n(this.slotProps) : n : null;
|
|
1720
1899
|
}
|
|
1721
|
-
}, { t:
|
|
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
|
-
],
|
|
1912
|
+
], ui = {
|
|
1734
1913
|
name: "TmTableSearch",
|
|
1735
1914
|
components: {
|
|
1736
|
-
TmSelect:
|
|
1737
|
-
TmAdvancedInput:
|
|
1738
|
-
TmAdvancedDate:
|
|
1739
|
-
TmCascader:
|
|
1740
|
-
TmRadio:
|
|
1741
|
-
TmCheckbox:
|
|
1742
|
-
TmSwitch:
|
|
1743
|
-
DynamicSlot:
|
|
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:
|
|
1762
|
-
isVue2:
|
|
1763
|
-
isVue3:
|
|
1954
|
+
t: ni,
|
|
1955
|
+
isVue2: ai,
|
|
1956
|
+
isVue3: oi,
|
|
1764
1957
|
getCompatSize: K,
|
|
1765
|
-
getDefaultSize:
|
|
1766
|
-
DATE_TYPES:
|
|
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,
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1796
|
-
[
|
|
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,
|
|
1800
|
-
const t =
|
|
1801
|
-
|
|
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,
|
|
2003
|
+
getFieldValue(e, i) {
|
|
1804
2004
|
if (typeof e == "string")
|
|
1805
2005
|
return e;
|
|
1806
|
-
if (e.fields &&
|
|
1807
|
-
const t = e.fields[
|
|
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,
|
|
1818
|
-
if (e.fields &&
|
|
1819
|
-
const t = e.fields[
|
|
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
|
|
1829
|
-
if (this[
|
|
2028
|
+
const i = "$slots";
|
|
2029
|
+
if (this[i][e])
|
|
1830
2030
|
return !0;
|
|
1831
|
-
let
|
|
1832
|
-
for (;
|
|
1833
|
-
const
|
|
1834
|
-
if (
|
|
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
|
-
|
|
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((
|
|
1845
|
-
if (typeof
|
|
1846
|
-
const t = this.getFieldValue(
|
|
1847
|
-
if (
|
|
1848
|
-
const s =
|
|
1849
|
-
if (
|
|
1850
|
-
if (
|
|
1851
|
-
e[
|
|
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
|
|
1854
|
-
|
|
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(
|
|
1858
|
-
const s =
|
|
1859
|
-
if (t && !(t in this.computedSearchForm) && (e[t] = []),
|
|
1860
|
-
if (
|
|
1861
|
-
e[
|
|
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
|
|
1864
|
-
|
|
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 (
|
|
1867
|
-
const s =
|
|
1868
|
-
if (t && !(t in this.computedSearchForm) && (e[t] =
|
|
1869
|
-
if (
|
|
1870
|
-
e[
|
|
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
|
|
1873
|
-
|
|
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
|
|
1877
|
-
if (t &&
|
|
1878
|
-
const s = this.getFieldValue(
|
|
1879
|
-
s &&
|
|
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
|
-
},
|
|
1899
|
-
function
|
|
1900
|
-
const
|
|
1901
|
-
return r(),
|
|
1902
|
-
class:
|
|
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
|
-
|
|
1905
|
-
s.hasDefaultSlot() ?
|
|
1906
|
-
typeof
|
|
1907
|
-
key: `str-${
|
|
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(
|
|
1911
|
-
name: `search-${
|
|
2110
|
+
(r(), m(o, {
|
|
2111
|
+
name: `search-${a}`,
|
|
1912
2112
|
"slot-props": { searchForm: t.searchForm },
|
|
1913
|
-
key:
|
|
2113
|
+
key: a
|
|
1914
2114
|
}, null, 8, ["name", "slot-props"]))
|
|
1915
|
-
])) : (r(),
|
|
1916
|
-
key: `obj-${
|
|
2115
|
+
])) : (r(), g("div", {
|
|
2116
|
+
key: `obj-${H}`,
|
|
1917
2117
|
class: "search-item"
|
|
1918
2118
|
}, [
|
|
1919
|
-
|
|
1920
|
-
s.hasSearchSlot(`search-${s.getFieldValue(
|
|
1921
|
-
name: `search-${s.getFieldValue(
|
|
1922
|
-
"slot-props": { searchForm: t.searchForm, col:
|
|
1923
|
-
key: s.getFieldValue(
|
|
1924
|
-
}, null, 8, ["name", "slot-props"])) : (r(),
|
|
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(
|
|
2126
|
+
key: s.getFieldValue(a, "value") || `col-${H}`
|
|
1927
2127
|
}, [
|
|
1928
|
-
|
|
2128
|
+
a.type === "input" ? (r(), m(c, _({
|
|
1929
2129
|
key: 0,
|
|
1930
|
-
label:
|
|
1931
|
-
value: s.computedSearchForm[s.getFieldValue(
|
|
1932
|
-
field: s.computedSearchForm[s.getFieldValue(
|
|
1933
|
-
onValueChange: (
|
|
1934
|
-
onFieldChange: (
|
|
1935
|
-
multiple:
|
|
1936
|
-
labelOptions:
|
|
1937
|
-
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,
|
|
1940
|
-
s.isDateType(
|
|
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:
|
|
1943
|
-
label:
|
|
1944
|
-
value: s.computedSearchForm[s.getFieldValue(
|
|
1945
|
-
field: s.computedSearchForm[s.getFieldValue(
|
|
1946
|
-
start: s.computedSearchForm[s.getFieldValue(
|
|
1947
|
-
end: s.computedSearchForm[s.getFieldValue(
|
|
1948
|
-
onFieldChange: (
|
|
1949
|
-
onValueChange: (
|
|
1950
|
-
onStartChange: (
|
|
1951
|
-
onEndChange: (
|
|
1952
|
-
labelOptions:
|
|
1953
|
-
"start-placeholder":
|
|
1954
|
-
"end-placeholder":
|
|
1955
|
-
placeholder:
|
|
1956
|
-
"range-separator":
|
|
1957
|
-
disabled:
|
|
1958
|
-
clearable:
|
|
1959
|
-
readonly:
|
|
1960
|
-
editable:
|
|
1961
|
-
align:
|
|
1962
|
-
"popper-class":
|
|
1963
|
-
"default-value":
|
|
1964
|
-
"default-time":
|
|
1965
|
-
shortcuts:
|
|
1966
|
-
"past-only":
|
|
1967
|
-
format:
|
|
1968
|
-
}, null,
|
|
1969
|
-
|
|
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:
|
|
1972
|
-
modelValue: s.computedSearchForm[s.getFieldValue(
|
|
1973
|
-
"onUpdate:modelValue": (
|
|
1974
|
-
field: s.computedSearchForm[s.getFieldValue(
|
|
1975
|
-
options:
|
|
1976
|
-
labelOptions:
|
|
1977
|
-
placeholder:
|
|
1978
|
-
multiple:
|
|
1979
|
-
"show-check-all":
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
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(
|
|
1985
|
-
"onUpdate:modelValue": (
|
|
1986
|
-
label:
|
|
1987
|
-
options:
|
|
1988
|
-
labelOptions:
|
|
1989
|
-
props:
|
|
1990
|
-
placeholder:
|
|
1991
|
-
"show-check-all":
|
|
1992
|
-
}, null,
|
|
1993
|
-
|
|
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(
|
|
1996
|
-
"onUpdate:modelValue": (
|
|
1997
|
-
label:
|
|
1998
|
-
options:
|
|
1999
|
-
props:
|
|
2000
|
-
}, null,
|
|
2001
|
-
|
|
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(
|
|
2004
|
-
"onUpdate:modelValue": (
|
|
2005
|
-
label:
|
|
2006
|
-
options:
|
|
2007
|
-
props:
|
|
2008
|
-
}, null,
|
|
2009
|
-
|
|
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(
|
|
2012
|
-
"onUpdate:modelValue": (
|
|
2013
|
-
"active-text":
|
|
2014
|
-
"inactive-text":
|
|
2015
|
-
label:
|
|
2016
|
-
"active-color":
|
|
2017
|
-
"inactive-color":
|
|
2018
|
-
}, null,
|
|
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(),
|
|
2021
|
-
key: `error-${
|
|
2222
|
+
], 64)) : (r(), g("div", {
|
|
2223
|
+
key: `error-${H}`,
|
|
2022
2224
|
class: "search-error-message"
|
|
2023
2225
|
}, " 缺少 fields 配置,无法渲染此组件 "))
|
|
2024
2226
|
]))
|
|
2025
|
-
], 64))), 256)) :
|
|
2026
|
-
|
|
2027
|
-
|
|
2227
|
+
], 64))), 256)) : v("", !0),
|
|
2228
|
+
b("div", ci, [
|
|
2229
|
+
p(N, {
|
|
2028
2230
|
type: "primary",
|
|
2029
|
-
size:
|
|
2231
|
+
size: l.getDefaultSize(),
|
|
2030
2232
|
onClick: s.handleSearch
|
|
2031
2233
|
}, {
|
|
2032
2234
|
default: f(() => [
|
|
2033
|
-
L(
|
|
2235
|
+
L(w(l.t("query")), 1)
|
|
2034
2236
|
]),
|
|
2035
2237
|
_: 1
|
|
2036
2238
|
}, 8, ["size", "onClick"]),
|
|
2037
|
-
|
|
2038
|
-
size:
|
|
2239
|
+
p(N, {
|
|
2240
|
+
size: l.getDefaultSize(),
|
|
2039
2241
|
onClick: s.handleReset
|
|
2040
2242
|
}, {
|
|
2041
2243
|
default: f(() => [
|
|
2042
|
-
L(
|
|
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
|
|
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:
|
|
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
|
-
},
|
|
2085
|
-
function
|
|
2086
|
-
const
|
|
2087
|
-
return r(),
|
|
2088
|
-
|
|
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:
|
|
2296
|
+
size: l.getCompatSize("mini"),
|
|
2095
2297
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
2096
2298
|
onSizeChange: s.handleSizeChange,
|
|
2097
|
-
"onUpdate:currentPage":
|
|
2098
|
-
"onUpdate:pageSize":
|
|
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
|
|
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
|
-
},
|
|
2313
|
+
}, vi = {
|
|
2112
2314
|
size: "small",
|
|
2113
2315
|
class: "tm-table-menu",
|
|
2114
2316
|
inline: ""
|
|
2115
|
-
},
|
|
2116
|
-
function
|
|
2117
|
-
return r(),
|
|
2118
|
-
|
|
2119
|
-
|
|
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
|
-
|
|
2122
|
-
|
|
2323
|
+
b("div", _i, [
|
|
2324
|
+
x(e.$slots, "right", {}, void 0, !0)
|
|
2123
2325
|
])
|
|
2124
2326
|
]);
|
|
2125
2327
|
}
|
|
2126
|
-
const
|
|
2127
|
-
e && (e.props || (e.props = {}), typeof
|
|
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
|
|
2334
|
+
const i = localStorage.getItem(`tm-table-config-${e}`);
|
|
2133
2335
|
return Promise.resolve({
|
|
2134
2336
|
data: {
|
|
2135
2337
|
code: 200,
|
|
2136
|
-
data:
|
|
2338
|
+
data: i
|
|
2137
2339
|
}
|
|
2138
2340
|
});
|
|
2139
|
-
} catch (
|
|
2140
|
-
return Promise.reject(
|
|
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 (
|
|
2153
|
-
return Promise.reject(
|
|
2354
|
+
} catch (i) {
|
|
2355
|
+
return Promise.reject(i);
|
|
2154
2356
|
}
|
|
2155
2357
|
}
|
|
2156
|
-
},
|
|
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:
|
|
2159
|
-
formatter: (e,
|
|
2160
|
-
},
|
|
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:
|
|
2164
|
-
FixedLeftIcon:
|
|
2165
|
-
FixedRightIcon:
|
|
2166
|
-
UploadIcon:
|
|
2167
|
-
DownloadIcon:
|
|
2168
|
-
DeleteIcon:
|
|
2169
|
-
MenuIcon:
|
|
2170
|
-
tmEllipsisText:
|
|
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:
|
|
2208
|
-
isVue2:
|
|
2209
|
-
isVue3:
|
|
2210
|
-
getDefaultSize:
|
|
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,
|
|
2483
|
+
findLastIndex(e, i) {
|
|
2282
2484
|
for (let t = e.length - 1; t >= 0; t--)
|
|
2283
|
-
if (
|
|
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
|
|
2504
|
+
let i = {};
|
|
2303
2505
|
this.defaultColumnsConfig = e.filter((t) => {
|
|
2304
|
-
const
|
|
2305
|
-
return !(!
|
|
2306
|
-
}).map((t,
|
|
2307
|
-
const
|
|
2308
|
-
|
|
2309
|
-
const
|
|
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:
|
|
2513
|
+
prop: l.prop,
|
|
2312
2514
|
// label: attrs.label, // 移除label,避免国际化导致比较不一致
|
|
2313
|
-
fixed:
|
|
2314
|
-
sort:
|
|
2315
|
-
cancellable:
|
|
2316
|
-
visible:
|
|
2515
|
+
fixed: l.fixed || "",
|
|
2516
|
+
sort: n,
|
|
2517
|
+
cancellable: l.hasOwnProperty("cancellable") ? l.cancellable : !0,
|
|
2518
|
+
visible: o
|
|
2317
2519
|
};
|
|
2318
|
-
}), this.columnMap =
|
|
2520
|
+
}), this.columnMap = i;
|
|
2319
2521
|
},
|
|
2320
2522
|
// 加载列配置
|
|
2321
2523
|
loadColumnConfig() {
|
|
2322
|
-
|
|
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
|
|
2328
|
-
|
|
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,
|
|
2340
|
-
let t = this.columns.filter((
|
|
2341
|
-
const s = Y(
|
|
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
|
-
}),
|
|
2344
|
-
return [...e].sort((
|
|
2345
|
-
const
|
|
2346
|
-
return
|
|
2347
|
-
}).forEach((
|
|
2348
|
-
if (
|
|
2349
|
-
let s = this.columnMap[
|
|
2350
|
-
s && (
|
|
2351
|
-
fixed:
|
|
2352
|
-
visible:
|
|
2353
|
-
}), (!
|
|
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((
|
|
2356
|
-
|
|
2357
|
-
}), [...t, ...
|
|
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
|
|
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
|
|
2381
|
-
(s) => s.prop ===
|
|
2582
|
+
const n = t.getAttribute("data-prop"), l = this.sortedTableColumns.find(
|
|
2583
|
+
(s) => s.prop === n
|
|
2382
2584
|
);
|
|
2383
|
-
this.isDraggingFrozen =
|
|
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:
|
|
2387
|
-
if (!
|
|
2588
|
+
const { target: n, related: l } = t;
|
|
2589
|
+
if (!n || !l)
|
|
2388
2590
|
return !1;
|
|
2389
|
-
const s =
|
|
2390
|
-
return this.isDraggingFrozen && !
|
|
2391
|
-
|
|
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:
|
|
2395
|
-
if (
|
|
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((
|
|
2398
|
-
|
|
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[
|
|
2401
|
-
let
|
|
2402
|
-
if (
|
|
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 =
|
|
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,
|
|
2418
|
-
this.sortedTableColumns.some((
|
|
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,
|
|
2428
|
-
e.sort === void 0 && (e.sort =
|
|
2429
|
-
}), this.sortedTableColumns = [...this.tableColumns].sort((e,
|
|
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
|
|
2433
|
-
(window.innerHeight || document.documentElement.clientHeight) - (
|
|
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 (
|
|
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
|
|
2659
|
+
), typeof E != "undefined" && E.utils && (document.removeEventListener(
|
|
2458
2660
|
"mousemove",
|
|
2459
|
-
|
|
2460
|
-
), document.removeEventListener("mouseup",
|
|
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((
|
|
2466
|
-
this.tableColumns.forEach((
|
|
2467
|
-
|
|
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,
|
|
2674
|
+
(e, i) => e.sort - i.sort
|
|
2473
2675
|
);
|
|
2474
2676
|
},
|
|
2475
2677
|
// 判断是否可以置顶
|
|
2476
|
-
canMoveTop(e,
|
|
2477
|
-
if (
|
|
2678
|
+
canMoveTop(e, i) {
|
|
2679
|
+
if (i === 0) return !1;
|
|
2478
2680
|
if (e.fixed === "left") {
|
|
2479
|
-
const t = this.sortedTableColumns[
|
|
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[
|
|
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,
|
|
2490
|
-
const t = this.sortedTableColumns,
|
|
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(
|
|
2694
|
+
t.unshift(t.splice(i, 1)[0]);
|
|
2493
2695
|
else {
|
|
2494
|
-
const
|
|
2696
|
+
const l = this.findLastIndex(
|
|
2495
2697
|
this.sortedTableColumns,
|
|
2496
2698
|
(s) => s.fixed === "left"
|
|
2497
2699
|
);
|
|
2498
2700
|
t.splice(
|
|
2499
|
-
|
|
2701
|
+
l + 1,
|
|
2500
2702
|
0,
|
|
2501
|
-
t.splice(
|
|
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
|
|
2506
|
-
if (
|
|
2507
|
-
const s = Array.from(
|
|
2508
|
-
(
|
|
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
|
|
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
|
|
2719
|
+
const n = this.findLastIndex(
|
|
2518
2720
|
this.sortedTableColumns,
|
|
2519
|
-
(
|
|
2721
|
+
(l) => l.fixed === "left"
|
|
2520
2722
|
);
|
|
2521
|
-
|
|
2723
|
+
i.splice(n + 1, 0, t);
|
|
2522
2724
|
} else {
|
|
2523
|
-
const
|
|
2725
|
+
const n = this.findLastIndex(
|
|
2524
2726
|
this.sortedTableColumns,
|
|
2525
|
-
(
|
|
2727
|
+
(l) => l.fixed === "left"
|
|
2526
2728
|
);
|
|
2527
|
-
|
|
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
|
|
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
|
|
2535
|
-
(
|
|
2736
|
+
const n = i.findIndex(
|
|
2737
|
+
(l) => l.fixed === "right"
|
|
2536
2738
|
);
|
|
2537
|
-
|
|
2739
|
+
n === -1 ? i.push(t) : i.splice(n, 0, t);
|
|
2538
2740
|
} else {
|
|
2539
|
-
const
|
|
2540
|
-
(
|
|
2741
|
+
const n = i.findIndex(
|
|
2742
|
+
(l) => l.fixed === "right"
|
|
2541
2743
|
);
|
|
2542
|
-
|
|
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
|
|
2749
|
+
var i;
|
|
2548
2750
|
this.updateSortValues();
|
|
2549
|
-
const e = (
|
|
2550
|
-
const
|
|
2551
|
-
(
|
|
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
|
-
|
|
2554
|
-
const
|
|
2555
|
-
return
|
|
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
|
-
|
|
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,
|
|
2573
|
-
e.sort =
|
|
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
|
|
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
|
-
},
|
|
2790
|
+
}, Di = {
|
|
2589
2791
|
key: 0,
|
|
2590
2792
|
class: "container"
|
|
2591
|
-
},
|
|
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
|
-
},
|
|
2796
|
+
}, Ni = {
|
|
2595
2797
|
class: "sort-list",
|
|
2596
2798
|
ref: "sortListRef"
|
|
2597
|
-
},
|
|
2799
|
+
}, Bi = ["data-prop"], Ui = {
|
|
2598
2800
|
key: 0,
|
|
2599
2801
|
class: "sort-item"
|
|
2600
|
-
},
|
|
2601
|
-
function
|
|
2602
|
-
const
|
|
2603
|
-
return r(), m(
|
|
2604
|
-
[
|
|
2605
|
-
},
|
|
2606
|
-
[
|
|
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:
|
|
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
|
-
|
|
2617
|
-
|
|
2618
|
-
content:
|
|
2619
|
-
},
|
|
2818
|
+
b("div", Yi, [
|
|
2819
|
+
p(O, _({
|
|
2820
|
+
content: l.t("columnSetting")
|
|
2821
|
+
}, l.afterOpenDelay, { placement: "top" }), {
|
|
2620
2822
|
default: f(() => [
|
|
2621
|
-
|
|
2622
|
-
size:
|
|
2823
|
+
p(o, {
|
|
2824
|
+
size: l.getDefaultSize(),
|
|
2623
2825
|
ref: "operationRef",
|
|
2624
2826
|
circle: ""
|
|
2625
2827
|
}, {
|
|
2626
2828
|
default: f(() => [
|
|
2627
|
-
|
|
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
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
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(
|
|
2846
|
+
L(w(l.t("all")), 1)
|
|
2645
2847
|
]),
|
|
2646
2848
|
_: 1
|
|
2647
2849
|
}, 16, ["onClick"])
|
|
2648
2850
|
]),
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
(r(!0),
|
|
2652
|
-
|
|
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:
|
|
2856
|
+
key: B + C.prop
|
|
2655
2857
|
}, [
|
|
2656
|
-
|
|
2657
|
-
disabled: !
|
|
2858
|
+
p(d, {
|
|
2859
|
+
disabled: !C.cancellable,
|
|
2658
2860
|
class: "el-checkbox",
|
|
2659
|
-
modelValue:
|
|
2660
|
-
"onUpdate:modelValue": (J) =>
|
|
2661
|
-
label:
|
|
2662
|
-
value:
|
|
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
|
-
|
|
2867
|
+
p(c, {
|
|
2666
2868
|
width: "80px",
|
|
2667
|
-
text: s.getColumnLabel(
|
|
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
|
-
])) :
|
|
2874
|
+
])) : v("", !0)
|
|
2673
2875
|
], 64))), 256))
|
|
2674
2876
|
])
|
|
2675
2877
|
])
|
|
2676
2878
|
]),
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
size:
|
|
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:
|
|
2684
|
-
modelValue:
|
|
2685
|
-
"onUpdate:modelValue":
|
|
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(),
|
|
2689
|
-
|
|
2690
|
-
(r(!0),
|
|
2691
|
-
class:
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
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":
|
|
2697
|
-
key:
|
|
2898
|
+
"data-prop": C.prop,
|
|
2899
|
+
key: C.prop
|
|
2698
2900
|
}, [
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
text: s.getColumnLabel(
|
|
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
|
-
|
|
2707
|
-
|
|
2908
|
+
b("div", Ji, [
|
|
2909
|
+
C.cancellable ? (r(), m(O, _({
|
|
2708
2910
|
key: 0,
|
|
2709
|
-
content:
|
|
2911
|
+
content: l.t("cancel"),
|
|
2710
2912
|
placement: "top"
|
|
2711
|
-
}, { ref_for: !0 },
|
|
2913
|
+
}, { ref_for: !0 }, l.afterOpenDelay), {
|
|
2712
2914
|
default: f(() => [
|
|
2713
|
-
|
|
2714
|
-
size:
|
|
2915
|
+
p(o, _({ ref_for: !0 }, l.buttonType, {
|
|
2916
|
+
size: l.getCompatSize("mini"),
|
|
2715
2917
|
class: "iconfont-button delete-button",
|
|
2716
|
-
onClick: (J) =>
|
|
2918
|
+
onClick: (J) => C.visible = !1
|
|
2717
2919
|
}), {
|
|
2718
2920
|
default: f(() => [
|
|
2719
|
-
|
|
2921
|
+
p(F)
|
|
2720
2922
|
]),
|
|
2721
2923
|
_: 2
|
|
2722
2924
|
}, 1040, ["size", "onClick"])
|
|
2723
2925
|
]),
|
|
2724
2926
|
_: 2
|
|
2725
|
-
}, 1040, ["content"])) :
|
|
2726
|
-
s.canMoveTop(
|
|
2927
|
+
}, 1040, ["content"])) : v("", !0),
|
|
2928
|
+
s.canMoveTop(C, B) ? (r(), m(O, _({
|
|
2727
2929
|
key: 1,
|
|
2728
|
-
content:
|
|
2930
|
+
content: l.t("top"),
|
|
2729
2931
|
placement: "top"
|
|
2730
|
-
}, { ref_for: !0 },
|
|
2932
|
+
}, { ref_for: !0 }, l.afterOpenDelay), {
|
|
2731
2933
|
default: f(() => [
|
|
2732
|
-
|
|
2733
|
-
size:
|
|
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(
|
|
2937
|
+
onClick: (J) => s.moveTop(C, B)
|
|
2736
2938
|
}), {
|
|
2737
2939
|
default: f(() => [
|
|
2738
|
-
|
|
2940
|
+
p(j)
|
|
2739
2941
|
]),
|
|
2740
2942
|
_: 2
|
|
2741
2943
|
}, 1040, ["size", "onClick"])
|
|
2742
2944
|
]),
|
|
2743
2945
|
_: 2
|
|
2744
|
-
}, 1040, ["content"])) :
|
|
2745
|
-
|
|
2946
|
+
}, 1040, ["content"])) : v("", !0),
|
|
2947
|
+
C.fixed !== "right" ? (r(), m(O, _({
|
|
2746
2948
|
key: 2,
|
|
2747
|
-
content:
|
|
2949
|
+
content: C.fixed === "left" ? l.t("cancelLeftFixed") : l.t("leftFixed"),
|
|
2748
2950
|
placement: "top"
|
|
2749
|
-
}, { ref_for: !0 },
|
|
2951
|
+
}, { ref_for: !0 }, l.afterOpenDelay), {
|
|
2750
2952
|
default: f(() => [
|
|
2751
|
-
|
|
2752
|
-
size:
|
|
2753
|
-
class: ["iconfont-button left-fixed-btn", { "active-fixed":
|
|
2754
|
-
onClick: (J) => s.frozenLeftHandle(
|
|
2755
|
-
disabled:
|
|
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
|
-
|
|
2960
|
+
p(N)
|
|
2759
2961
|
]),
|
|
2760
2962
|
_: 2
|
|
2761
2963
|
}, 1040, ["size", "class", "onClick", "disabled"])
|
|
2762
2964
|
]),
|
|
2763
2965
|
_: 2
|
|
2764
|
-
}, 1040, ["content"])) :
|
|
2765
|
-
|
|
2966
|
+
}, 1040, ["content"])) : v("", !0),
|
|
2967
|
+
C.fixed !== "left" ? (r(), m(O, _({
|
|
2766
2968
|
key: 3,
|
|
2767
|
-
content:
|
|
2969
|
+
content: C.fixed === "right" ? l.t("cancelRightFixed") : l.t("rightFixed"),
|
|
2768
2970
|
placement: "top"
|
|
2769
|
-
}, { ref_for: !0 },
|
|
2971
|
+
}, { ref_for: !0 }, l.afterOpenDelay), {
|
|
2770
2972
|
default: f(() => [
|
|
2771
|
-
|
|
2772
|
-
size:
|
|
2773
|
-
class: ["iconfont-button right-fixed-btn", { "active-fixed":
|
|
2774
|
-
onClick: (J) => s.frozenRightHandle(
|
|
2775
|
-
disabled:
|
|
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
|
-
|
|
2980
|
+
p(a)
|
|
2779
2981
|
]),
|
|
2780
2982
|
_: 2
|
|
2781
2983
|
}, 1040, ["size", "class", "onClick", "disabled"])
|
|
2782
2984
|
]),
|
|
2783
2985
|
_: 2
|
|
2784
|
-
}, 1040, ["content"])) :
|
|
2986
|
+
}, 1040, ["content"])) : v("", !0)
|
|
2785
2987
|
])
|
|
2786
|
-
])) :
|
|
2787
|
-
], 10,
|
|
2988
|
+
])) : v("", !0)
|
|
2989
|
+
], 10, Bi))), 128))
|
|
2788
2990
|
], 512)
|
|
2789
2991
|
])
|
|
2790
2992
|
]),
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
size:
|
|
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(
|
|
3000
|
+
L(w(l.t("restoreDefault")), 1)
|
|
2799
3001
|
]),
|
|
2800
3002
|
_: 1
|
|
2801
3003
|
}, 8, ["size", "onClick"])
|
|
2802
3004
|
]),
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
size:
|
|
2806
|
-
onClick:
|
|
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(
|
|
3011
|
+
L(w(l.t("cancel")), 1)
|
|
2810
3012
|
]),
|
|
2811
3013
|
_: 1
|
|
2812
3014
|
}, 8, ["size"]),
|
|
2813
|
-
|
|
2814
|
-
size:
|
|
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(
|
|
3021
|
+
L(w(l.t("saveAndApply")), 1)
|
|
2820
3022
|
]),
|
|
2821
3023
|
_: 1
|
|
2822
3024
|
}, 8, ["size", "onClick"])
|
|
2823
3025
|
])
|
|
2824
3026
|
])
|
|
2825
|
-
])) :
|
|
3027
|
+
])) : v("", !0)
|
|
2826
3028
|
]),
|
|
2827
3029
|
_: 1
|
|
2828
3030
|
}, 16, ["placement", "onShow", "onHide"]);
|
|
2829
3031
|
}
|
|
2830
|
-
const
|
|
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
|
|
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
|
|
2839
|
-
if (typeof
|
|
3040
|
+
let n = t.children;
|
|
3041
|
+
if (typeof n == "function")
|
|
2840
3042
|
continue;
|
|
2841
|
-
if (Array.isArray(
|
|
2842
|
-
const
|
|
2843
|
-
|
|
3043
|
+
if (Array.isArray(n)) {
|
|
3044
|
+
const l = le(n);
|
|
3045
|
+
i.push(...l);
|
|
2844
3046
|
} else {
|
|
2845
|
-
const
|
|
2846
|
-
|
|
3047
|
+
const l = le([n]);
|
|
3048
|
+
i.push(...l);
|
|
2847
3049
|
}
|
|
2848
3050
|
} else
|
|
2849
|
-
|
|
2850
|
-
return
|
|
3051
|
+
i.push(t);
|
|
3052
|
+
return i;
|
|
2851
3053
|
}
|
|
2852
|
-
const
|
|
3054
|
+
const el = {
|
|
2853
3055
|
name: "TmTable",
|
|
2854
3056
|
components: {
|
|
2855
|
-
TableSearch:
|
|
2856
|
-
TablePagination:
|
|
2857
|
-
TableMenu:
|
|
2858
|
-
ColumnConfig:
|
|
2859
|
-
RefreshIcon:
|
|
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:
|
|
3165
|
+
getDefaultSize: M,
|
|
2950
3166
|
getCompatSize: K,
|
|
2951
|
-
isVue3:
|
|
2952
|
-
isVue2:
|
|
2953
|
-
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:
|
|
3048
|
-
this.tableData =
|
|
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),
|
|
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,
|
|
3276
|
+
const e = this.$refs.table, i = this.$refs.tmPagination;
|
|
3061
3277
|
if (!e) return;
|
|
3062
|
-
const t = e.$el,
|
|
3063
|
-
this.tableHeight = document.documentElement.clientHeight - t.offsetTop -
|
|
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
|
-
},
|
|
3313
|
+
}, tl = {
|
|
3098
3314
|
class: "tm-table",
|
|
3099
3315
|
ref: "tablePage"
|
|
3100
3316
|
};
|
|
3101
|
-
function
|
|
3102
|
-
const
|
|
3103
|
-
return r(),
|
|
3104
|
-
t.searchColumns && t.searchColumns.length > 0 ? (r(), m(
|
|
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
|
-
|
|
3334
|
+
x(e.$slots, "search", {}, void 0, !0)
|
|
3116
3335
|
]),
|
|
3117
3336
|
_: 3
|
|
3118
|
-
}, 8, ["onSearch", "onReset", "onUpdate:searchForm", "disabled", "search-columns", "search-form"])) :
|
|
3119
|
-
|
|
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
|
-
|
|
3341
|
+
x(e.$slots, "menu-left", {}, void 0, !0)
|
|
3122
3342
|
]),
|
|
3123
3343
|
right: f(() => [
|
|
3124
|
-
|
|
3125
|
-
t.refreshButton && typeof t.data == "function" ? (r(), m(
|
|
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:
|
|
3347
|
+
content: l.t("refresh"),
|
|
3128
3348
|
placement: "top"
|
|
3129
|
-
},
|
|
3349
|
+
}, l.afterOpenDelay), {
|
|
3130
3350
|
default: f(() => [
|
|
3131
|
-
|
|
3351
|
+
p(d, {
|
|
3132
3352
|
onClick: s.handleRefresh,
|
|
3133
3353
|
circle: "",
|
|
3134
|
-
size:
|
|
3354
|
+
size: l.getDefaultSize()
|
|
3135
3355
|
}, {
|
|
3136
3356
|
default: f(() => [
|
|
3137
|
-
|
|
3357
|
+
p(c)
|
|
3138
3358
|
]),
|
|
3139
3359
|
_: 1
|
|
3140
3360
|
}, 8, ["onClick", "size"])
|
|
3141
3361
|
]),
|
|
3142
3362
|
_: 1
|
|
3143
|
-
}, 16, ["content"])) :
|
|
3144
|
-
t.columnSettingButton ? (r(), m(
|
|
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:
|
|
3369
|
+
columns: l.originalColumns,
|
|
3150
3370
|
onComplete: s.handleColumnConfigComplete
|
|
3151
|
-
}, null, 8, ["maxFixedLeftQuantity", "maxFixedRightQuantity", "tableKey", "columns", "onComplete"])) :
|
|
3371
|
+
}, null, 8, ["maxFixedLeftQuantity", "maxFixedRightQuantity", "tableKey", "columns", "onComplete"])) : v("", !0)
|
|
3152
3372
|
]),
|
|
3153
3373
|
_: 3
|
|
3154
|
-
})) :
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
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:
|
|
3381
|
+
key: l.tableReload
|
|
3161
3382
|
}), {
|
|
3162
3383
|
default: f(() => [
|
|
3163
|
-
(r(!0),
|
|
3164
|
-
vnode:
|
|
3165
|
-
key:
|
|
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
|
-
[
|
|
3391
|
+
[a, s.pageLoading]
|
|
3171
3392
|
]),
|
|
3172
|
-
|
|
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":
|
|
3176
|
-
current:
|
|
3177
|
-
total:
|
|
3178
|
-
disabled:
|
|
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"])) :
|
|
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
|
|
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:
|
|
3198
|
-
isVue3:
|
|
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
|
|
3209
|
-
const
|
|
3210
|
-
return s.isVisible ? (r(), m(
|
|
3211
|
-
|
|
3212
|
-
name:
|
|
3213
|
-
fn: f((
|
|
3214
|
-
|
|
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)) :
|
|
3440
|
+
]), 1040)) : v("", !0);
|
|
3218
3441
|
}
|
|
3219
|
-
const
|
|
3442
|
+
const Fe = /* @__PURE__ */ V(nl, [["render", al]]), { t: ie } = R(), ol = {
|
|
3220
3443
|
name: "TmAdvancedEllipsisText",
|
|
3221
3444
|
components: {
|
|
3222
|
-
CopyIcon:
|
|
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(
|
|
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(
|
|
3349
|
-
} catch (
|
|
3350
|
-
this.$message.error(
|
|
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((
|
|
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
|
|
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
|
|
3374
|
-
t.innerHTML = "", this.lineHeight =
|
|
3596
|
+
const n = t.offsetHeight;
|
|
3597
|
+
t.innerHTML = "", this.lineHeight = n;
|
|
3375
3598
|
} else {
|
|
3376
|
-
const
|
|
3377
|
-
if (
|
|
3378
|
-
this.lineHeight = parseInt(
|
|
3599
|
+
const n = i.lineHeight;
|
|
3600
|
+
if (n && n !== "normal")
|
|
3601
|
+
this.lineHeight = parseInt(n);
|
|
3379
3602
|
else {
|
|
3380
|
-
const
|
|
3381
|
-
this.lineHeight =
|
|
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
|
|
3404
|
-
if (this.getTextHeight(e) <=
|
|
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
|
|
3408
|
-
this.frontLines = this.splitTextToLines(
|
|
3409
|
-
const s = e.substring(
|
|
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,
|
|
3416
|
-
if (this.getTextHeight(e) <=
|
|
3638
|
+
findTextForHeight(e, i) {
|
|
3639
|
+
if (this.getTextHeight(e) <= i)
|
|
3417
3640
|
return e;
|
|
3418
|
-
let t = 0,
|
|
3419
|
-
for (; t <=
|
|
3420
|
-
const s = Math.floor((t +
|
|
3421
|
-
this.getTextHeight(
|
|
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
|
|
3646
|
+
return l;
|
|
3424
3647
|
},
|
|
3425
3648
|
splitTextToLines(e) {
|
|
3426
3649
|
if (!e) return [];
|
|
3427
|
-
const
|
|
3650
|
+
const i = [];
|
|
3428
3651
|
let t = e;
|
|
3429
3652
|
for (; t.length > 0; ) {
|
|
3430
|
-
const
|
|
3431
|
-
if (
|
|
3432
|
-
|
|
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
|
|
3657
|
+
return i;
|
|
3435
3658
|
},
|
|
3436
3659
|
checkIfTextOverflows(e) {
|
|
3437
3660
|
if (!e) return !1;
|
|
3438
|
-
const
|
|
3439
|
-
return
|
|
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,
|
|
3678
|
+
measureText(e, i = {}) {
|
|
3456
3679
|
if (!this.$refs.containerRef || !this.$refs.measureRef)
|
|
3457
3680
|
return 0;
|
|
3458
|
-
const t = this.$refs.measureRef,
|
|
3459
|
-
this.setMeasureElementStyle(t,
|
|
3460
|
-
const
|
|
3461
|
-
return t.style.cssText =
|
|
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,
|
|
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(
|
|
3466
|
-
e.style[
|
|
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
|
|
3478
|
-
if (
|
|
3479
|
-
const t =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
3730
|
+
}, fl = {
|
|
3508
3731
|
key: 1,
|
|
3509
3732
|
class: "tm-ellipsis-text-wrapper"
|
|
3510
|
-
},
|
|
3733
|
+
}, pl = ["innerHTML"], ml = { class: "tm-ellipsis-last-line" }, gl = ["innerHTML"], bl = {
|
|
3511
3734
|
key: 0,
|
|
3512
3735
|
class: "tm-ellipsis-toolbar-part"
|
|
3513
|
-
},
|
|
3736
|
+
}, yl = {
|
|
3514
3737
|
ref: "measureRef",
|
|
3515
3738
|
class: "tm-ellipsis-measure"
|
|
3516
3739
|
};
|
|
3517
|
-
function
|
|
3518
|
-
const
|
|
3519
|
-
return r(),
|
|
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:
|
|
3744
|
+
style: U(s.containerStyle),
|
|
3522
3745
|
class: "tm-ellipsis-text",
|
|
3523
|
-
onMouseenter:
|
|
3524
|
-
onMouseleave:
|
|
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 &&
|
|
3749
|
+
t.showTooltip && l.isLastLineEllipsis ? (r(), m(c, _({
|
|
3527
3750
|
key: 0,
|
|
3528
|
-
content:
|
|
3529
|
-
disabled: !t.showTooltip || !
|
|
3751
|
+
content: l.originalText,
|
|
3752
|
+
disabled: !t.showTooltip || !l.isLastLineEllipsis
|
|
3530
3753
|
}, {
|
|
3531
|
-
[
|
|
3754
|
+
[l.isVue2 ? "open-delay" : "show-after"]: 300
|
|
3532
3755
|
}, { placement: "top" }), {
|
|
3533
3756
|
default: f(() => [
|
|
3534
|
-
|
|
3535
|
-
(r(!0),
|
|
3536
|
-
key: "front-" +
|
|
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:
|
|
3539
|
-
}, null, 8,
|
|
3540
|
-
|
|
3541
|
-
|
|
3761
|
+
innerHTML: d
|
|
3762
|
+
}, null, 8, ul))), 128)),
|
|
3763
|
+
b("div", dl, [
|
|
3764
|
+
b("div", {
|
|
3542
3765
|
class: "tm-ellipsis-text-part",
|
|
3543
|
-
innerHTML:
|
|
3544
|
-
}, null, 8,
|
|
3545
|
-
s.shouldShowToolbar && s.hasToolbarContent ? (r(),
|
|
3546
|
-
t.copyable ? (r(), m(
|
|
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"])) :
|
|
3551
|
-
|
|
3552
|
-
])) :
|
|
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(),
|
|
3558
|
-
(r(!0),
|
|
3559
|
-
key: "front-" +
|
|
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:
|
|
3562
|
-
}, null, 8,
|
|
3563
|
-
|
|
3564
|
-
|
|
3784
|
+
innerHTML: d
|
|
3785
|
+
}, null, 8, pl))), 128)),
|
|
3786
|
+
b("div", ml, [
|
|
3787
|
+
b("div", {
|
|
3565
3788
|
class: "tm-ellipsis-text-part",
|
|
3566
|
-
innerHTML:
|
|
3567
|
-
}, null, 8,
|
|
3568
|
-
s.shouldShowToolbar && s.hasToolbarContent ? (r(),
|
|
3569
|
-
t.copyable ? (r(), m(
|
|
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"])) :
|
|
3574
|
-
|
|
3575
|
-
])) :
|
|
3796
|
+
}, null, 8, ["onClick"])) : v("", !0),
|
|
3797
|
+
x(e.$slots, "toolbar", {}, void 0, !0)
|
|
3798
|
+
])) : v("", !0)
|
|
3576
3799
|
])
|
|
3577
3800
|
])),
|
|
3578
|
-
|
|
3801
|
+
b("div", yl, null, 512)
|
|
3579
3802
|
], 36);
|
|
3580
3803
|
}
|
|
3581
|
-
const
|
|
3582
|
-
install(e,
|
|
3583
|
-
[
|
|
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
|
-
},
|
|
3586
|
-
install:
|
|
3587
|
-
Table:
|
|
3588
|
-
Column:
|
|
3589
|
-
Search:
|
|
3590
|
-
Select:
|
|
3591
|
-
AdvancedInput:
|
|
3592
|
-
AdvancedDate:
|
|
3593
|
-
Cascader:
|
|
3594
|
-
Radio:
|
|
3595
|
-
Checkbox:
|
|
3596
|
-
Switch:
|
|
3597
|
-
EllipsisText:
|
|
3598
|
-
AdvancedEllipsisText:
|
|
3599
|
-
setLang:
|
|
3600
|
-
useLocale:
|
|
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 &&
|
|
3825
|
+
typeof window != "undefined" && window.Vue && _l.install(window.Vue);
|
|
3603
3826
|
export {
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
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
|
};
|