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/vue2/tm-table.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var G = Object.defineProperty, Y = Object.defineProperties;
|
|
2
|
+
var X = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var S = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
4
|
+
var D = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var O = (t, e, i) => e in t ? G(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, u = (t, e) => {
|
|
6
|
+
for (var i in e || (e = {}))
|
|
7
|
+
D.call(e, i) && O(t, i, e[i]);
|
|
8
8
|
if (S)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
9
|
+
for (var i of S(e))
|
|
10
|
+
A.call(e, i) && O(t, i, e[i]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
for (var
|
|
16
|
-
|
|
12
|
+
}, m = (t, e) => Y(t, X(e));
|
|
13
|
+
var R = (t, e) => {
|
|
14
|
+
var i = {};
|
|
15
|
+
for (var s in t)
|
|
16
|
+
D.call(t, s) && e.indexOf(s) < 0 && (i[s] = t[s]);
|
|
17
17
|
if (t != null && S)
|
|
18
|
-
for (var
|
|
19
|
-
e.indexOf(
|
|
20
|
-
return
|
|
18
|
+
for (var s of S(t))
|
|
19
|
+
e.indexOf(s) < 0 && A.call(t, s) && (i[s] = t[s]);
|
|
20
|
+
return i;
|
|
21
21
|
};
|
|
22
22
|
import "vue";
|
|
23
|
-
import
|
|
24
|
-
const x = (t) => t,
|
|
23
|
+
import y from "sortablejs";
|
|
24
|
+
const x = (t) => t, p = () => "mini", Z = {
|
|
25
25
|
today: "今天",
|
|
26
26
|
yesterday: "昨天",
|
|
27
27
|
last7days: "最近7天",
|
|
@@ -60,7 +60,7 @@ const x = (t) => t, f = () => "mini", X = {
|
|
|
60
60
|
cancelTop: "取消置顶",
|
|
61
61
|
copySuccess: "复制成功",
|
|
62
62
|
copyFailed: "复制失败"
|
|
63
|
-
},
|
|
63
|
+
}, ee = {
|
|
64
64
|
today: "Today",
|
|
65
65
|
yesterday: "Yesterday",
|
|
66
66
|
last7days: "Last 7 days",
|
|
@@ -100,198 +100,38 @@ const x = (t) => t, f = () => "mini", X = {
|
|
|
100
100
|
copySuccess: "Copy successfully",
|
|
101
101
|
copyFailed: "Copy failed"
|
|
102
102
|
};
|
|
103
|
-
var
|
|
104
|
-
const
|
|
105
|
-
"zh-CN":
|
|
106
|
-
"en-US":
|
|
103
|
+
var M;
|
|
104
|
+
const te = {
|
|
105
|
+
"zh-CN": Z,
|
|
106
|
+
"en-US": ee
|
|
107
107
|
};
|
|
108
108
|
let v = { value: "zh-CN" };
|
|
109
109
|
{
|
|
110
110
|
const t = require("vue");
|
|
111
|
-
t.observable || (
|
|
111
|
+
t.observable || (M = t.default) != null && M.observable ? v = t.default.observable(v) : v = new t({
|
|
112
112
|
data() {
|
|
113
113
|
return { currentLang: v };
|
|
114
114
|
}
|
|
115
115
|
}).$data.currentLang;
|
|
116
116
|
}
|
|
117
|
-
const
|
|
117
|
+
const ie = (t) => {
|
|
118
118
|
var e;
|
|
119
|
-
return ((e =
|
|
119
|
+
return ((e = te[v.value]) == null ? void 0 : e[t]) || t;
|
|
120
120
|
}, k = (t) => {
|
|
121
121
|
v.value = t;
|
|
122
|
-
},
|
|
123
|
-
t:
|
|
122
|
+
}, g = () => ({
|
|
123
|
+
t: ie,
|
|
124
124
|
setLang: k,
|
|
125
125
|
currentLang: v
|
|
126
126
|
});
|
|
127
|
-
function
|
|
127
|
+
function d(t, e, i, s, a, l, n, o) {
|
|
128
128
|
var r = typeof t == "function" ? t.options : t;
|
|
129
|
-
return e && (r.render = e, r.staticRenderFns =
|
|
129
|
+
return e && (r.render = e, r.staticRenderFns = i, r._compiled = !0), l && (r._scopeId = "data-v-" + l), {
|
|
130
130
|
exports: t,
|
|
131
131
|
options: r
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
const se =
|
|
135
|
-
name: "TmSelectFilter",
|
|
136
|
-
props: {
|
|
137
|
-
[w]: {
|
|
138
|
-
type: [String, Number, Array],
|
|
139
|
-
default: ""
|
|
140
|
-
},
|
|
141
|
-
field: {
|
|
142
|
-
type: [String, Number],
|
|
143
|
-
default: ""
|
|
144
|
-
},
|
|
145
|
-
options: {
|
|
146
|
-
type: [Array, Function],
|
|
147
|
-
default: () => []
|
|
148
|
-
},
|
|
149
|
-
labelOptions: {
|
|
150
|
-
type: Array,
|
|
151
|
-
default: () => []
|
|
152
|
-
},
|
|
153
|
-
props: {
|
|
154
|
-
type: Object,
|
|
155
|
-
default: () => ({
|
|
156
|
-
label: "label",
|
|
157
|
-
value: "value"
|
|
158
|
-
})
|
|
159
|
-
},
|
|
160
|
-
filterable: {
|
|
161
|
-
type: Boolean,
|
|
162
|
-
default: !0
|
|
163
|
-
},
|
|
164
|
-
clearable: {
|
|
165
|
-
type: Boolean,
|
|
166
|
-
default: !0
|
|
167
|
-
},
|
|
168
|
-
collapseTags: {
|
|
169
|
-
type: Boolean,
|
|
170
|
-
default: !0
|
|
171
|
-
},
|
|
172
|
-
multiple: {
|
|
173
|
-
type: Boolean,
|
|
174
|
-
default: !1
|
|
175
|
-
},
|
|
176
|
-
showCheckAll: {
|
|
177
|
-
type: Boolean,
|
|
178
|
-
default: !0
|
|
179
|
-
},
|
|
180
|
-
placeholder: {
|
|
181
|
-
type: String,
|
|
182
|
-
default: ""
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
data() {
|
|
186
|
-
return {
|
|
187
|
-
t: b().t,
|
|
188
|
-
isVue2: se,
|
|
189
|
-
isVue3: ie,
|
|
190
|
-
getDefaultSize: f,
|
|
191
|
-
optionsList: [],
|
|
192
|
-
loading: !1,
|
|
193
|
-
indeterminate: !1,
|
|
194
|
-
checkAll: !1,
|
|
195
|
-
activedSelect: ""
|
|
196
|
-
};
|
|
197
|
-
},
|
|
198
|
-
computed: {
|
|
199
|
-
computedValue: {
|
|
200
|
-
get() {
|
|
201
|
-
return this[w];
|
|
202
|
-
},
|
|
203
|
-
set(t) {
|
|
204
|
-
this.$emit(ae, t), this.$emit("change", t);
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
fieldValue: {
|
|
208
|
-
get() {
|
|
209
|
-
return this.field;
|
|
210
|
-
},
|
|
211
|
-
set(t) {
|
|
212
|
-
this.$emit("field-change", t);
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
propMap() {
|
|
216
|
-
return {
|
|
217
|
-
label: this.props.label || "label",
|
|
218
|
-
value: this.props.value || "value"
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
watch: {
|
|
223
|
-
[w](t) {
|
|
224
|
-
!this.multiple || !this.showCheckAll || (t.length === 0 ? (this.checkAll = !1, this.indeterminate = !1) : t.length === this.optionsList.length ? (this.checkAll = !0, this.indeterminate = !1) : this.indeterminate = !0);
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
created() {
|
|
228
|
-
this.initOptions();
|
|
229
|
-
},
|
|
230
|
-
methods: {
|
|
231
|
-
async initOptions() {
|
|
232
|
-
if (Array.isArray(this.options))
|
|
233
|
-
this.optionsList = this.options;
|
|
234
|
-
else if (typeof this.options == "function")
|
|
235
|
-
try {
|
|
236
|
-
this.loading = !0;
|
|
237
|
-
const t = await this.options();
|
|
238
|
-
Array.isArray(t) && (this.optionsList = t);
|
|
239
|
-
} catch (t) {
|
|
240
|
-
console.error(t);
|
|
241
|
-
} finally {
|
|
242
|
-
this.loading = !1;
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
handleCheckAll(t) {
|
|
246
|
-
this.indeterminate = !1;
|
|
247
|
-
let e = [];
|
|
248
|
-
t && (e = this.optionsList.map((s) => s[this.propMap.value])), this.computedValue = e;
|
|
249
|
-
},
|
|
250
|
-
setActivedSelect(t) {
|
|
251
|
-
this.activedSelect = t;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
var ne = function() {
|
|
256
|
-
var e = this, s = e._self._c;
|
|
257
|
-
return s("div", { staticClass: "advanced-select", class: { hasField: e.labelOptions && e.labelOptions.length > 0 } }, [e.labelOptions && e.labelOptions.length > 0 ? s("el-select", { staticClass: "field-select", class: `field-select--${e.isVue2 ? "v2" : "v3"}`, style: `z-index:${e.activedSelect === "left" ? 2 : 0}`, attrs: { size: e.getDefaultSize() }, on: { focus: function(i) {
|
|
258
|
-
return e.setActivedSelect("left");
|
|
259
|
-
} }, model: { value: e.fieldValue, callback: function(i) {
|
|
260
|
-
e.fieldValue = i;
|
|
261
|
-
}, expression: "fieldValue" } }, e._l(e.labelOptions, function(i) {
|
|
262
|
-
return s("el-option", { key: i.value, attrs: { label: i.label, value: i.value } });
|
|
263
|
-
}), 1) : e._e(), s("el-select", e._g(e._b({ ref: "select", staticClass: "select", class: `select--${e.isVue3 ? "v3" : "v2"}`, style: `z-index:${e.activedSelect === "right" ? 2 : 0}`, attrs: { loading: e.loading }, on: { focus: function(i) {
|
|
264
|
-
return e.setActivedSelect("right");
|
|
265
|
-
} }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
266
|
-
return [e.isVue3 && e.multiple && e.showCheckAll ? s("el-checkbox", { staticStyle: { width: "100%", height: "20px", "padding-left": "10px" }, attrs: { indeterminate: e.indeterminate, size: e.getDefaultSize() }, on: { change: e.handleCheckAll }, model: { value: e.checkAll, callback: function(i) {
|
|
267
|
-
e.checkAll = i;
|
|
268
|
-
}, expression: "checkAll" } }, [e._v(e._s(e.t("all")))]) : e._e()];
|
|
269
|
-
}, proxy: !0 }]), model: { value: e.computedValue, callback: function(i) {
|
|
270
|
-
e.computedValue = i;
|
|
271
|
-
}, expression: "computedValue" } }, "el-select", y(u({}, e.$attrs), {
|
|
272
|
-
size: e.getDefaultSize(),
|
|
273
|
-
filterable: e.filterable,
|
|
274
|
-
clearable: e.clearable,
|
|
275
|
-
collapseTags: e.collapseTags,
|
|
276
|
-
multiple: e.multiple,
|
|
277
|
-
placeholder: e.placeholder,
|
|
278
|
-
loading: e.loading
|
|
279
|
-
}), !1), e.isVue2 ? e.$listeners : {}), [e.isVue2 && e.multiple && e.showCheckAll ? s("div", { staticClass: "check-all-option" }, [s("el-checkbox", { staticStyle: { width: "100%" }, attrs: { indeterminate: e.indeterminate, size: e.getDefaultSize() }, on: { change: e.handleCheckAll }, model: { value: e.checkAll, callback: function(i) {
|
|
280
|
-
e.checkAll = i;
|
|
281
|
-
}, expression: "checkAll" } }, [e._v(e._s(e.t("all")))])], 1) : e._e(), e._l(e.optionsList, function(i) {
|
|
282
|
-
return s("el-option", { key: i[e.propMap.value], attrs: { label: i[e.propMap.label], value: i[e.propMap.value], disabled: i.disabled } }, [e._t("option", function() {
|
|
283
|
-
return [e._v(e._s(i[e.propMap.label]))];
|
|
284
|
-
}, { item: i })], 2);
|
|
285
|
-
})], 2)], 1);
|
|
286
|
-
}, re = [], oe = /* @__PURE__ */ c(
|
|
287
|
-
le,
|
|
288
|
-
ne,
|
|
289
|
-
re,
|
|
290
|
-
!1,
|
|
291
|
-
null,
|
|
292
|
-
"467dcdd3"
|
|
293
|
-
);
|
|
294
|
-
const R = oe.exports, ue = {
|
|
134
|
+
const se = {
|
|
295
135
|
name: "BaseIcon",
|
|
296
136
|
props: {
|
|
297
137
|
path: {
|
|
@@ -310,18 +150,18 @@ const R = oe.exports, ue = {
|
|
|
310
150
|
}
|
|
311
151
|
}
|
|
312
152
|
};
|
|
313
|
-
var
|
|
314
|
-
var e = this,
|
|
315
|
-
return
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
153
|
+
var ae = function() {
|
|
154
|
+
var e = this, i = e._self._c;
|
|
155
|
+
return i("i", { staticClass: "tm-icon", on: { click: e.handleClick } }, [i("svg", { style: { color: e.color }, attrs: { width: e.size, height: e.size, viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg" } }, [i("path", { attrs: { d: e.path } })])]);
|
|
156
|
+
}, le = [], ne = /* @__PURE__ */ d(
|
|
157
|
+
se,
|
|
158
|
+
ae,
|
|
159
|
+
le,
|
|
320
160
|
!1,
|
|
321
161
|
null,
|
|
322
162
|
"1c30ca93"
|
|
323
163
|
);
|
|
324
|
-
const
|
|
164
|
+
const re = ne.exports, oe = {
|
|
325
165
|
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",
|
|
326
166
|
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",
|
|
327
167
|
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",
|
|
@@ -333,13 +173,13 @@ const pe = he.exports, fe = {
|
|
|
333
173
|
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",
|
|
334
174
|
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",
|
|
335
175
|
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"
|
|
336
|
-
},
|
|
337
|
-
const
|
|
338
|
-
name:
|
|
176
|
+
}, f = Object.entries(oe).reduce((t, [e, i]) => {
|
|
177
|
+
const s = `${e}Icon`, a = {
|
|
178
|
+
name: s,
|
|
339
179
|
props: {
|
|
340
180
|
path: {
|
|
341
181
|
type: String,
|
|
342
|
-
default:
|
|
182
|
+
default: i
|
|
343
183
|
},
|
|
344
184
|
size: {
|
|
345
185
|
type: [String, Number]
|
|
@@ -349,7 +189,7 @@ const pe = he.exports, fe = {
|
|
|
349
189
|
}
|
|
350
190
|
},
|
|
351
191
|
render(l) {
|
|
352
|
-
return l(
|
|
192
|
+
return l(re, {
|
|
353
193
|
props: this.$props,
|
|
354
194
|
on: {
|
|
355
195
|
click: () => this.$emit("click")
|
|
@@ -358,11 +198,11 @@ const pe = he.exports, fe = {
|
|
|
358
198
|
}
|
|
359
199
|
};
|
|
360
200
|
return a.install = (l) => {
|
|
361
|
-
l.component(
|
|
201
|
+
l.component(s, a);
|
|
362
202
|
}, t[e] = a, t;
|
|
363
|
-
}, {}),
|
|
364
|
-
|
|
365
|
-
const
|
|
203
|
+
}, {}), ue = f.menu, de = f.refresh, ce = f.move;
|
|
204
|
+
f["column-setting"];
|
|
205
|
+
const he = f.more, pe = f["fixed-left"], fe = f["fixed-right"], me = f.upload, ge = f.download, be = f.delete, H = f.copy, { t: z } = g(), ye = !0, ve = !1, Ce = {
|
|
366
206
|
name: "TmEllipsisText",
|
|
367
207
|
components: {
|
|
368
208
|
CopyIcon: H
|
|
@@ -398,8 +238,8 @@ const ye = p.more, ve = p["fixed-left"], Ce = p["fixed-right"], xe = p.upload, _
|
|
|
398
238
|
},
|
|
399
239
|
data() {
|
|
400
240
|
return {
|
|
401
|
-
isVue2:
|
|
402
|
-
isVue3:
|
|
241
|
+
isVue2: ye,
|
|
242
|
+
isVue3: ve,
|
|
403
243
|
isOverflow: !1,
|
|
404
244
|
currentLines: 1,
|
|
405
245
|
resizeObserver: null
|
|
@@ -445,7 +285,7 @@ const ye = p.more, ve = p["fixed-left"], Ce = p["fixed-right"], xe = p.upload, _
|
|
|
445
285
|
});
|
|
446
286
|
},
|
|
447
287
|
performOverflowCheck() {
|
|
448
|
-
var
|
|
288
|
+
var c;
|
|
449
289
|
const t = this.$refs.textEl;
|
|
450
290
|
if (!t) return;
|
|
451
291
|
const e = getComputedStyle(t);
|
|
@@ -455,15 +295,15 @@ const ye = p.more, ve = p["fixed-left"], Ce = p["fixed-right"], xe = p.upload, _
|
|
|
455
295
|
});
|
|
456
296
|
return;
|
|
457
297
|
}
|
|
458
|
-
const
|
|
298
|
+
const i = t.scrollHeight, s = t.scrollWidth, a = t.clientHeight, l = t.clientWidth, n = 1, o = i > a + n, r = s > l + n;
|
|
459
299
|
if (o || r) {
|
|
460
300
|
this.isOverflow = !0;
|
|
461
|
-
const
|
|
462
|
-
this.currentLines = Math.ceil(
|
|
301
|
+
const b = parseFloat(e.lineHeight) || 16;
|
|
302
|
+
this.currentLines = Math.ceil(i / b);
|
|
463
303
|
} else {
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
466
|
-
const Q =
|
|
304
|
+
const b = t.getBoundingClientRect(), _ = (c = t.parentElement) == null ? void 0 : c.getBoundingClientRect();
|
|
305
|
+
if (_) {
|
|
306
|
+
const Q = b.height > _.height || b.width > _.width;
|
|
467
307
|
this.isOverflow = Q;
|
|
468
308
|
} else
|
|
469
309
|
this.isOverflow = !1;
|
|
@@ -482,60 +322,406 @@ const ye = p.more, ve = p["fixed-left"], Ce = p["fixed-right"], xe = p.upload, _
|
|
|
482
322
|
} catch (t) {
|
|
483
323
|
console.warn("Failed to setup ResizeObserver:", t);
|
|
484
324
|
}
|
|
485
|
-
});
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
// 清理 ResizeObserver
|
|
328
|
+
cleanupResizeObserver() {
|
|
329
|
+
if (this.resizeObserver)
|
|
330
|
+
try {
|
|
331
|
+
this.resizeObserver.disconnect();
|
|
332
|
+
} catch (t) {
|
|
333
|
+
console.warn("Failed to disconnect ResizeObserver:", t);
|
|
334
|
+
} finally {
|
|
335
|
+
this.resizeObserver = null;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
handleCopy() {
|
|
339
|
+
navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(this.text).then(() => {
|
|
340
|
+
this.$message.success(z("copySuccess"));
|
|
341
|
+
}).catch(() => {
|
|
342
|
+
this.fallbackCopy();
|
|
343
|
+
}) : this.fallbackCopy();
|
|
344
|
+
},
|
|
345
|
+
fallbackCopy() {
|
|
346
|
+
const t = document.createElement("textarea");
|
|
347
|
+
t.value = this.text, t.style.position = "fixed", t.style.left = "-999999px", t.style.top = "-999999px", document.body.appendChild(t), t.focus(), t.select();
|
|
348
|
+
try {
|
|
349
|
+
document.execCommand("copy"), this.$message.success(z("copySuccess"));
|
|
350
|
+
} catch (e) {
|
|
351
|
+
this.$message.error(z("copyFailed"));
|
|
352
|
+
}
|
|
353
|
+
document.body.removeChild(t);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
var _e = function() {
|
|
358
|
+
var e = this, i = e._self._c;
|
|
359
|
+
return i("el-tooltip", e._b({ attrs: { disabled: e.tooltipDisabled, content: e.text, effect: "dark", placement: "top" } }, "el-tooltip", {
|
|
360
|
+
[e.isVue2 ? "open-delay" : "show-after"]: 300
|
|
361
|
+
}, !1), [i("div", { staticClass: "ellipsis-text-container" }, [i("div", { ref: "textEl", staticClass: "ellipsis-text", style: e.textStyle }, [e._v(" " + e._s(e.text) + " ")]), i("div", { staticClass: "toolbar", class: { multiline: e.currentLines > 1 && e.lines > 1 } }, [e.copyable ? i("CopyIcon", { staticClass: "icon-item", on: { click: e.handleCopy } }) : e._e()], 1)])]);
|
|
362
|
+
}, xe = [], Se = /* @__PURE__ */ d(
|
|
363
|
+
Ce,
|
|
364
|
+
_e,
|
|
365
|
+
xe,
|
|
366
|
+
!1,
|
|
367
|
+
null,
|
|
368
|
+
"a51a2011"
|
|
369
|
+
);
|
|
370
|
+
const F = Se.exports, $e = {
|
|
371
|
+
name: "RenderVue2",
|
|
372
|
+
inheritAttrs: !1,
|
|
373
|
+
props: {
|
|
374
|
+
renderFn: {
|
|
375
|
+
type: Function,
|
|
376
|
+
required: !0
|
|
377
|
+
},
|
|
378
|
+
data: {
|
|
379
|
+
type: [Object, Array, String, Number, Boolean],
|
|
380
|
+
default: void 0
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
render(t) {
|
|
384
|
+
try {
|
|
385
|
+
if (!this.renderFn || typeof this.renderFn != "function")
|
|
386
|
+
return console.warn("[RenderComponent] renderFn must be a function"), null;
|
|
387
|
+
const e = m(u({}, this.data || {}), {
|
|
388
|
+
$attrs: this.$attrs,
|
|
389
|
+
$listeners: this.$listeners
|
|
390
|
+
}), i = this.renderFn.toString(), s = /\(\s*h\s*[,)]/.test(i) || this.renderFn.length >= 1;
|
|
391
|
+
process.env.NODE_ENV;
|
|
392
|
+
let a;
|
|
393
|
+
return s ? a = this.renderFn(t, e) : a = this.renderFn(m(u({}, e), { h: t })), a;
|
|
394
|
+
} catch (e) {
|
|
395
|
+
return console.error("[RenderComponent] Error in render function:", e), process.env.NODE_ENV === "development" ? t("div", {
|
|
396
|
+
style: {
|
|
397
|
+
color: "red",
|
|
398
|
+
border: "1px solid red",
|
|
399
|
+
padding: "8px",
|
|
400
|
+
borderRadius: "4px",
|
|
401
|
+
fontSize: "12px"
|
|
402
|
+
}
|
|
403
|
+
}, `RenderComponent Error: ${e.message}`) : null;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}, Te = null, we = null;
|
|
407
|
+
var Fe = /* @__PURE__ */ d(
|
|
408
|
+
$e,
|
|
409
|
+
Te,
|
|
410
|
+
we,
|
|
411
|
+
!1,
|
|
412
|
+
null,
|
|
413
|
+
null
|
|
414
|
+
);
|
|
415
|
+
const ze = Fe.exports, Le = !0, Ve = !1, ke = {
|
|
416
|
+
name: "FormItemLayout",
|
|
417
|
+
components: {
|
|
418
|
+
EllipsisText: F,
|
|
419
|
+
RenderComponent: ze
|
|
420
|
+
},
|
|
421
|
+
props: {
|
|
422
|
+
// 布局方向
|
|
423
|
+
direction: {
|
|
424
|
+
type: String,
|
|
425
|
+
default: "horizontal",
|
|
426
|
+
// 'horizontal' | 'vertical'
|
|
427
|
+
validator: (t) => ["horizontal", "vertical"].includes(t)
|
|
428
|
+
},
|
|
429
|
+
// 尺寸配置
|
|
430
|
+
labelWidth: {
|
|
431
|
+
type: [String, Number],
|
|
432
|
+
default: 120
|
|
433
|
+
},
|
|
434
|
+
inputWidth: {
|
|
435
|
+
type: [String, Number],
|
|
436
|
+
default: 240
|
|
437
|
+
},
|
|
438
|
+
// Label 配置
|
|
439
|
+
label: {
|
|
440
|
+
type: [String, Function, Object, Array],
|
|
441
|
+
default: ""
|
|
442
|
+
},
|
|
443
|
+
labelOptions: {
|
|
444
|
+
type: Array,
|
|
445
|
+
default: () => []
|
|
446
|
+
},
|
|
447
|
+
field: {
|
|
448
|
+
type: [String, Number],
|
|
449
|
+
default: ""
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
data() {
|
|
453
|
+
return {
|
|
454
|
+
t: g().t,
|
|
455
|
+
isVue2: Le,
|
|
456
|
+
isVue3: Ve,
|
|
457
|
+
getDefaultSize: p
|
|
458
|
+
};
|
|
459
|
+
},
|
|
460
|
+
computed: {
|
|
461
|
+
hasLabel() {
|
|
462
|
+
return this.labelOptions && this.labelOptions.length || this.label;
|
|
463
|
+
},
|
|
464
|
+
// 容器样式
|
|
465
|
+
containerStyle() {
|
|
466
|
+
const t = {};
|
|
467
|
+
if (this.direction === "horizontal") {
|
|
468
|
+
const e = this.hasLabel ? this.parsedLabelWidth + this.parsedInputWidth : this.parsedInputWidth;
|
|
469
|
+
t.width = `${e}px`;
|
|
470
|
+
} else
|
|
471
|
+
t.width = `${this.parsedInputWidth}px`;
|
|
472
|
+
return t;
|
|
473
|
+
},
|
|
474
|
+
// Label 样式
|
|
475
|
+
labelStyle() {
|
|
476
|
+
const t = {};
|
|
477
|
+
return this.direction === "horizontal" ? t.width = `${this.parsedLabelWidth}px` : t.width = `${this.parsedInputWidth}px`, t;
|
|
478
|
+
},
|
|
479
|
+
// Input 样式
|
|
480
|
+
inputStyle() {
|
|
481
|
+
return {
|
|
482
|
+
width: `${this.parsedInputWidth}px`
|
|
483
|
+
};
|
|
484
|
+
},
|
|
485
|
+
// 解析后的 labelWidth
|
|
486
|
+
parsedLabelWidth() {
|
|
487
|
+
return typeof this.labelWidth == "string" ? parseInt(this.labelWidth) : this.labelWidth;
|
|
488
|
+
},
|
|
489
|
+
// 解析后的 inputWidth
|
|
490
|
+
parsedInputWidth() {
|
|
491
|
+
return typeof this.inputWidth == "string" ? parseInt(this.inputWidth) : this.inputWidth;
|
|
492
|
+
},
|
|
493
|
+
fieldValue: {
|
|
494
|
+
get() {
|
|
495
|
+
return this.field;
|
|
496
|
+
},
|
|
497
|
+
set(t) {
|
|
498
|
+
this.$emit("field-change", t);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
watch: {
|
|
503
|
+
labelOptions: {
|
|
504
|
+
handler(t) {
|
|
505
|
+
t && t.length > 0 && !this.field && this.$emit("field-change", t[0].value);
|
|
506
|
+
},
|
|
507
|
+
deep: !0,
|
|
508
|
+
immediate: !0
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
methods: {
|
|
512
|
+
handleFieldChange(t) {
|
|
513
|
+
this.$emit("field-change", t);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
var Oe = function() {
|
|
518
|
+
var e = this, i = e._self._c;
|
|
519
|
+
return i("div", { staticClass: "form-item-layout", class: {
|
|
520
|
+
"form-item-layout--horizontal": e.direction === "horizontal",
|
|
521
|
+
"form-item-layout--vertical": e.direction === "vertical"
|
|
522
|
+
}, style: e.containerStyle }, [e.hasLabel ? i("div", { staticClass: "form-item-label", style: e.labelStyle }, [e.labelOptions && e.labelOptions.length ? i("el-select", { staticClass: "label-select", attrs: { placeholder: e.t("selectPlaceholder"), size: e.getDefaultSize() }, on: { change: e.handleFieldChange }, model: { value: e.fieldValue, callback: function(s) {
|
|
523
|
+
e.fieldValue = s;
|
|
524
|
+
}, expression: "fieldValue" } }, e._l(e.labelOptions, function(s) {
|
|
525
|
+
return i("el-option", { key: s.value, attrs: { label: s.label, value: s.value } });
|
|
526
|
+
}), 1) : e.label ? [typeof e.label == "string" ? i("div", { staticClass: "label-text" }, [i("EllipsisText", { attrs: { text: e.label, lines: 2 } })], 1) : typeof e.label == "function" ? i("div", { staticClass: "label-render" }, [i("RenderComponent", { attrs: { "render-fn": e.label } })], 1) : e._e()] : e._e()], 2) : e._e(), i("div", { staticClass: "form-item-input", style: e.inputStyle }, [e._t("default")], 2)]);
|
|
527
|
+
}, De = [], Ae = /* @__PURE__ */ d(
|
|
528
|
+
ke,
|
|
529
|
+
Oe,
|
|
530
|
+
De,
|
|
531
|
+
!1,
|
|
532
|
+
null,
|
|
533
|
+
"9b2a82ac"
|
|
534
|
+
);
|
|
535
|
+
const C = Ae.exports, Re = !0, Me = !1, $ = "value", He = "input", Ee = {
|
|
536
|
+
name: "TmSelectFilter",
|
|
537
|
+
components: {
|
|
538
|
+
FormItemLayout: C
|
|
539
|
+
},
|
|
540
|
+
props: {
|
|
541
|
+
[$]: {
|
|
542
|
+
type: [String, Number, Array],
|
|
543
|
+
default: ""
|
|
544
|
+
},
|
|
545
|
+
field: {
|
|
546
|
+
type: [String, Number],
|
|
547
|
+
default: ""
|
|
548
|
+
},
|
|
549
|
+
options: {
|
|
550
|
+
type: [Array, Function],
|
|
551
|
+
default: () => []
|
|
552
|
+
},
|
|
553
|
+
labelOptions: {
|
|
554
|
+
type: Array,
|
|
555
|
+
default: () => []
|
|
556
|
+
},
|
|
557
|
+
label: {
|
|
558
|
+
type: [String, Function, Object, Array],
|
|
559
|
+
default: null
|
|
560
|
+
},
|
|
561
|
+
props: {
|
|
562
|
+
type: Object,
|
|
563
|
+
default: () => ({
|
|
564
|
+
label: "label",
|
|
565
|
+
value: "value"
|
|
566
|
+
})
|
|
567
|
+
},
|
|
568
|
+
filterable: {
|
|
569
|
+
type: Boolean,
|
|
570
|
+
default: !0
|
|
571
|
+
},
|
|
572
|
+
clearable: {
|
|
573
|
+
type: Boolean,
|
|
574
|
+
default: !0
|
|
575
|
+
},
|
|
576
|
+
collapseTags: {
|
|
577
|
+
type: Boolean,
|
|
578
|
+
default: !0
|
|
579
|
+
},
|
|
580
|
+
multiple: {
|
|
581
|
+
type: Boolean,
|
|
582
|
+
default: !1
|
|
583
|
+
},
|
|
584
|
+
showCheckAll: {
|
|
585
|
+
type: Boolean,
|
|
586
|
+
default: !0
|
|
587
|
+
},
|
|
588
|
+
placeholder: {
|
|
589
|
+
type: String,
|
|
590
|
+
default: ""
|
|
591
|
+
},
|
|
592
|
+
valueOnClear: {
|
|
593
|
+
type: [String, Number, Boolean, Array, Function],
|
|
594
|
+
default: void 0
|
|
595
|
+
},
|
|
596
|
+
// FormItemLayout 配置参数
|
|
597
|
+
labelWidth: {
|
|
598
|
+
type: [String, Number],
|
|
599
|
+
default: void 0
|
|
600
|
+
},
|
|
601
|
+
inputWidth: {
|
|
602
|
+
type: [String, Number],
|
|
603
|
+
default: void 0
|
|
604
|
+
},
|
|
605
|
+
direction: {
|
|
606
|
+
type: String,
|
|
607
|
+
default: void 0,
|
|
608
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
data() {
|
|
612
|
+
return {
|
|
613
|
+
t: g().t,
|
|
614
|
+
isVue2: Re,
|
|
615
|
+
isVue3: Me,
|
|
616
|
+
getDefaultSize: p,
|
|
617
|
+
optionsList: [],
|
|
618
|
+
loading: !1,
|
|
619
|
+
indeterminate: !1,
|
|
620
|
+
checkAll: !1
|
|
621
|
+
};
|
|
622
|
+
},
|
|
623
|
+
computed: {
|
|
624
|
+
computedValue: {
|
|
625
|
+
get() {
|
|
626
|
+
return this[$];
|
|
627
|
+
},
|
|
628
|
+
set(t) {
|
|
629
|
+
let e = t;
|
|
630
|
+
if (this.multiple && Array.isArray(t) && t.length === 0 && this.valueOnClear !== void 0) {
|
|
631
|
+
const i = this[$];
|
|
632
|
+
Array.isArray(i) && i.length > 0 && (e = typeof this.valueOnClear == "function" ? this.valueOnClear() : this.valueOnClear);
|
|
633
|
+
}
|
|
634
|
+
this.$emit(He, e), this.$emit("change", e);
|
|
635
|
+
}
|
|
486
636
|
},
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
637
|
+
propMap() {
|
|
638
|
+
return {
|
|
639
|
+
label: this.props.label || "label",
|
|
640
|
+
value: this.props.value || "value"
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
watch: {
|
|
645
|
+
[$](t) {
|
|
646
|
+
!this.multiple || !this.showCheckAll || (t.length === 0 ? (this.checkAll = !1, this.indeterminate = !1) : t.length === this.optionsList.length ? (this.checkAll = !0, this.indeterminate = !1) : this.indeterminate = !0);
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
created() {
|
|
650
|
+
this.initOptions();
|
|
651
|
+
},
|
|
652
|
+
methods: {
|
|
653
|
+
handleFieldChange(t) {
|
|
654
|
+
this.$emit("field-change", t);
|
|
655
|
+
},
|
|
656
|
+
async initOptions() {
|
|
657
|
+
if (Array.isArray(this.options))
|
|
658
|
+
this.optionsList = this.options;
|
|
659
|
+
else if (typeof this.options == "function")
|
|
490
660
|
try {
|
|
491
|
-
this.
|
|
661
|
+
this.loading = !0;
|
|
662
|
+
const t = await this.options();
|
|
663
|
+
Array.isArray(t) && (this.optionsList = t);
|
|
492
664
|
} catch (t) {
|
|
493
|
-
console.
|
|
665
|
+
console.error(t);
|
|
494
666
|
} finally {
|
|
495
|
-
this.
|
|
667
|
+
this.loading = !1;
|
|
496
668
|
}
|
|
497
669
|
},
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
this.fallbackCopy();
|
|
503
|
-
}) : this.fallbackCopy();
|
|
670
|
+
handleCheckAll(t) {
|
|
671
|
+
this.indeterminate = !1;
|
|
672
|
+
let e = [];
|
|
673
|
+
t && (e = this.optionsList.map((i) => i[this.propMap.value])), this.computedValue = e;
|
|
504
674
|
},
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
this.$message.error(V("copyFailed"));
|
|
675
|
+
handleClear() {
|
|
676
|
+
if (this.valueOnClear !== void 0) {
|
|
677
|
+
const t = typeof this.valueOnClear == "function" ? this.valueOnClear() : this.valueOnClear;
|
|
678
|
+
this.$nextTick(() => {
|
|
679
|
+
this.computedValue = t;
|
|
680
|
+
});
|
|
512
681
|
}
|
|
513
|
-
document.body.removeChild(t);
|
|
514
682
|
}
|
|
515
683
|
}
|
|
516
684
|
};
|
|
517
|
-
var
|
|
518
|
-
var e = this,
|
|
519
|
-
return
|
|
520
|
-
[e.
|
|
521
|
-
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
685
|
+
var We = function() {
|
|
686
|
+
var e = this, i = e._self._c;
|
|
687
|
+
return i("FormItemLayout", { attrs: { label: e.label, "label-options": e.labelOptions, field: e.field, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction }, on: { "field-change": e.handleFieldChange } }, [i("el-select", e._g(e._b({ ref: "select", staticClass: "select", attrs: { loading: e.loading }, on: { clear: e.handleClear }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
688
|
+
return [e.isVue3 && e.multiple && e.showCheckAll ? i("el-checkbox", { staticStyle: { width: "100%", height: "20px", "padding-left": "10px" }, attrs: { indeterminate: e.indeterminate, size: e.getDefaultSize() }, on: { change: e.handleCheckAll }, model: { value: e.checkAll, callback: function(s) {
|
|
689
|
+
e.checkAll = s;
|
|
690
|
+
}, expression: "checkAll" } }, [e._v(e._s(e.t("all")))]) : e._e()];
|
|
691
|
+
}, proxy: !0 }]), model: { value: e.computedValue, callback: function(s) {
|
|
692
|
+
e.computedValue = s;
|
|
693
|
+
}, expression: "computedValue" } }, "el-select", m(u({}, e.$attrs), {
|
|
694
|
+
size: e.getDefaultSize(),
|
|
695
|
+
filterable: e.filterable,
|
|
696
|
+
clearable: e.clearable,
|
|
697
|
+
collapseTags: e.collapseTags,
|
|
698
|
+
multiple: e.multiple,
|
|
699
|
+
placeholder: e.placeholder,
|
|
700
|
+
loading: e.loading
|
|
701
|
+
}), !1), e.isVue2 ? e.$listeners : {}), [e.isVue2 && e.multiple && e.showCheckAll ? i("div", { staticClass: "check-all-option" }, [i("el-checkbox", { staticStyle: { width: "100%" }, attrs: { indeterminate: e.indeterminate, size: e.getDefaultSize() }, on: { change: e.handleCheckAll }, model: { value: e.checkAll, callback: function(s) {
|
|
702
|
+
e.checkAll = s;
|
|
703
|
+
}, expression: "checkAll" } }, [e._v(e._s(e.t("all")))])], 1) : e._e(), e._l(e.optionsList, function(s) {
|
|
704
|
+
return i("el-option", { key: s[e.propMap.value], attrs: { label: s[e.propMap.label], value: s[e.propMap.value], disabled: s.disabled } }, [e._t("option", function() {
|
|
705
|
+
return [e._v(e._s(s[e.propMap.label]))];
|
|
706
|
+
}, { item: s })], 2);
|
|
707
|
+
})], 2)], 1);
|
|
708
|
+
}, Ie = [], Ne = /* @__PURE__ */ d(
|
|
709
|
+
Ee,
|
|
710
|
+
We,
|
|
711
|
+
Ie,
|
|
526
712
|
!1,
|
|
527
713
|
null,
|
|
528
|
-
"
|
|
714
|
+
"b85e9ccb"
|
|
529
715
|
);
|
|
530
|
-
const
|
|
716
|
+
const E = Ne.exports, Pe = {
|
|
531
717
|
name: "TmAdvancedInputFilter",
|
|
532
718
|
components: {
|
|
533
|
-
MoreIcon:
|
|
534
|
-
|
|
719
|
+
MoreIcon: he,
|
|
720
|
+
FormItemLayout: C
|
|
535
721
|
},
|
|
536
722
|
props: {
|
|
537
723
|
label: {
|
|
538
|
-
type: String,
|
|
724
|
+
type: [String, Function, Object, Array],
|
|
539
725
|
default: ""
|
|
540
726
|
},
|
|
541
727
|
value: {
|
|
@@ -557,14 +743,26 @@ const _ = ze.exports, ke = !0, Le = !1, Oe = {
|
|
|
557
743
|
labelOptions: {
|
|
558
744
|
type: Array,
|
|
559
745
|
default: () => []
|
|
746
|
+
},
|
|
747
|
+
// FormItemLayout 配置参数
|
|
748
|
+
labelWidth: {
|
|
749
|
+
type: [String, Number],
|
|
750
|
+
default: void 0
|
|
751
|
+
},
|
|
752
|
+
inputWidth: {
|
|
753
|
+
type: [String, Number],
|
|
754
|
+
default: void 0
|
|
755
|
+
},
|
|
756
|
+
direction: {
|
|
757
|
+
type: String,
|
|
758
|
+
default: void 0,
|
|
759
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
560
760
|
}
|
|
561
761
|
},
|
|
562
762
|
data() {
|
|
563
763
|
return {
|
|
564
|
-
t:
|
|
565
|
-
|
|
566
|
-
isVue2: ke,
|
|
567
|
-
getDefaultSize: f,
|
|
764
|
+
t: g().t,
|
|
765
|
+
getDefaultSize: p,
|
|
568
766
|
getCompatSize: x,
|
|
569
767
|
exactValue: "",
|
|
570
768
|
inputValue: "",
|
|
@@ -573,17 +771,6 @@ const _ = ze.exports, ke = !0, Le = !1, Oe = {
|
|
|
573
771
|
};
|
|
574
772
|
},
|
|
575
773
|
computed: {
|
|
576
|
-
width() {
|
|
577
|
-
return this.labelOptions && this.labelOptions.length || this.label ? "305px" : "200px";
|
|
578
|
-
},
|
|
579
|
-
fieldValue: {
|
|
580
|
-
get() {
|
|
581
|
-
return this.field;
|
|
582
|
-
},
|
|
583
|
-
set(t) {
|
|
584
|
-
this.$emit("field-change", t);
|
|
585
|
-
}
|
|
586
|
-
},
|
|
587
774
|
// 是否显示精确搜索按钮,根据当前选中的option或全局设置决定
|
|
588
775
|
shouldShowMultiple() {
|
|
589
776
|
return this.currentOptionMultiple !== null ? this.currentOptionMultiple : this.multiple;
|
|
@@ -594,19 +781,6 @@ const _ = ze.exports, ke = !0, Le = !1, Oe = {
|
|
|
594
781
|
}
|
|
595
782
|
},
|
|
596
783
|
watch: {
|
|
597
|
-
labelOptions: {
|
|
598
|
-
handler(t) {
|
|
599
|
-
t && t.length > 0 && (this.field || this.$emit("field-change", t[0].value), this.updateCurrentOptionMultiple());
|
|
600
|
-
},
|
|
601
|
-
deep: !0,
|
|
602
|
-
immediate: !0
|
|
603
|
-
},
|
|
604
|
-
field: {
|
|
605
|
-
handler() {
|
|
606
|
-
this.updateCurrentOptionMultiple();
|
|
607
|
-
},
|
|
608
|
-
immediate: !0
|
|
609
|
-
},
|
|
610
784
|
isExactMode(t) {
|
|
611
785
|
t ? this.$emit("value-change", this.exactValue) : this.$emit("value-change", this.inputValue);
|
|
612
786
|
},
|
|
@@ -652,40 +826,27 @@ const _ = ze.exports, ke = !0, Le = !1, Oe = {
|
|
|
652
826
|
this.updateCurrentOptionMultiple();
|
|
653
827
|
}
|
|
654
828
|
};
|
|
655
|
-
var
|
|
656
|
-
var e = this,
|
|
657
|
-
return
|
|
658
|
-
e.
|
|
659
|
-
},
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
} },
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
[e.isVue3 ? "visible" : "value"]: e.isExactMode,
|
|
669
|
-
placement: "bottom-end",
|
|
670
|
-
width: 260,
|
|
671
|
-
trigger: "click"
|
|
672
|
-
}, !1), {
|
|
673
|
-
[e.isVue3 ? "update:visible" : "input"]: e.handleVisibleChange
|
|
674
|
-
}), [s("div", { staticClass: "popover-content" }, [s("p", { staticClass: "popover-subtitle" }, [e._v(e._s(e.t("accurateSearchTips")))]), s("el-input", { staticStyle: { "font-size": "12px" }, attrs: { size: e.getDefaultSize(), type: "textarea", rows: 8, placeholder: e.t("accurateSearchPlaceholder") }, model: { value: e.exactValue, callback: function(i) {
|
|
675
|
-
e.exactValue = i;
|
|
676
|
-
}, expression: "exactValue" } }), s("div", { staticClass: "popover-footer" }, [s("el-button", { staticStyle: { float: "left" }, attrs: { size: e.getCompatSize("mini") }, on: { click: e.handleClear } }, [e._v(e._s(e.t("clear")))]), s("el-button", { attrs: { size: e.getCompatSize("mini") }, on: { click: e.handlePopoverClose } }, [e._v(e._s(e.t("cancel")))]), s("el-button", { attrs: { type: "primary", size: e.getCompatSize("mini") }, on: { click: e.handleExactSearch } }, [e._v(e._s(e.t("search")))])], 1)], 1)]) : e._e()], 1)], 1);
|
|
677
|
-
}, Me = [], Ae = /* @__PURE__ */ c(
|
|
678
|
-
Oe,
|
|
679
|
-
De,
|
|
680
|
-
Me,
|
|
829
|
+
var Be = function() {
|
|
830
|
+
var e = this, i = e._self._c;
|
|
831
|
+
return i("FormItemLayout", { attrs: { label: e.label, "label-options": e.labelOptions, field: e.field, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction }, on: { "field-change": e.handlefieldChange } }, [i("el-input", { staticClass: "advanced-input", attrs: { size: e.getDefaultSize(), placeholder: e.placeholder, clearable: "" }, nativeOn: { keyup: function(s) {
|
|
832
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.handleEnter.apply(null, arguments);
|
|
833
|
+
} }, model: { value: e.inputValue, callback: function(s) {
|
|
834
|
+
e.inputValue = s;
|
|
835
|
+
}, expression: "inputValue" } }, [e.shouldShowMultiple ? i("el-popover", { attrs: { slot: "append", value: e.isExactMode, placement: "bottom-end", width: 260, trigger: "click" }, on: { input: e.handleVisibleChange }, slot: "append" }, [i("div", { staticClass: "popover-content" }, [i("p", { staticClass: "popover-subtitle" }, [e._v(e._s(e.t("accurateSearchTips")))]), i("el-input", { staticStyle: { "font-size": "12px" }, attrs: { size: e.getDefaultSize(), type: "textarea", rows: 8, placeholder: e.t("accurateSearchPlaceholder") }, model: { value: e.exactValue, callback: function(s) {
|
|
836
|
+
e.exactValue = s;
|
|
837
|
+
}, expression: "exactValue" } }), i("div", { staticClass: "popover-footer" }, [i("el-button", { staticStyle: { float: "left" }, attrs: { size: e.getCompatSize("mini") }, on: { click: e.handleClear } }, [e._v(e._s(e.t("clear")))]), i("el-button", { attrs: { size: e.getCompatSize("mini") }, on: { click: e.handlePopoverClose } }, [e._v(e._s(e.t("cancel")))]), i("el-button", { attrs: { type: "primary", size: e.getCompatSize("mini") }, on: { click: e.handleExactSearch } }, [e._v(e._s(e.t("search")))])], 1)], 1), i("template", { slot: "reference" }, [i("MoreIcon", { staticStyle: { cursor: "pointer" } })], 1)], 2) : e._e()], 1)], 1);
|
|
838
|
+
}, je = [], Ue = /* @__PURE__ */ d(
|
|
839
|
+
Pe,
|
|
840
|
+
Be,
|
|
841
|
+
je,
|
|
681
842
|
!1,
|
|
682
843
|
null,
|
|
683
|
-
"
|
|
844
|
+
"7182656b"
|
|
684
845
|
);
|
|
685
|
-
const
|
|
846
|
+
const W = Ue.exports, { t: h } = g(), Je = !0, Ke = !1, qe = "value", Qe = {
|
|
686
847
|
name: "TmAdvancedDateFilter",
|
|
687
848
|
components: {
|
|
688
|
-
|
|
849
|
+
FormItemLayout: C
|
|
689
850
|
},
|
|
690
851
|
props: {
|
|
691
852
|
value: {
|
|
@@ -713,7 +874,7 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
713
874
|
default: () => []
|
|
714
875
|
},
|
|
715
876
|
label: {
|
|
716
|
-
type: String,
|
|
877
|
+
type: [String, Function, Object, Array],
|
|
717
878
|
default: ""
|
|
718
879
|
},
|
|
719
880
|
type: {
|
|
@@ -792,6 +953,20 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
792
953
|
pastOnly: {
|
|
793
954
|
type: Boolean,
|
|
794
955
|
default: !1
|
|
956
|
+
},
|
|
957
|
+
// FormItemLayout 配置参数
|
|
958
|
+
labelWidth: {
|
|
959
|
+
type: [String, Number],
|
|
960
|
+
default: void 0
|
|
961
|
+
},
|
|
962
|
+
inputWidth: {
|
|
963
|
+
type: [String, Number],
|
|
964
|
+
default: void 0
|
|
965
|
+
},
|
|
966
|
+
direction: {
|
|
967
|
+
type: String,
|
|
968
|
+
default: void 0,
|
|
969
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
795
970
|
}
|
|
796
971
|
},
|
|
797
972
|
computed: {
|
|
@@ -809,11 +984,6 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
809
984
|
if (this.isRangeType)
|
|
810
985
|
return this.endPlaceholder !== void 0 ? this.endPlaceholder : h("endDate");
|
|
811
986
|
},
|
|
812
|
-
// 计算日期选择器样式
|
|
813
|
-
computedDatePickerStyle() {
|
|
814
|
-
const t = this.labelOptions && this.labelOptions.length > 0, e = this.label && !this.isRangeType && (!this.labelOptions || this.labelOptions.length === 0);
|
|
815
|
-
return t ? "width: 206px" : e ? "width: 200px" : "width: 306px";
|
|
816
|
-
},
|
|
817
987
|
computedFormat() {
|
|
818
988
|
const t = "yyyy";
|
|
819
989
|
return this.format ? this.format : this.type === "year" ? t : this.type === "month" ? `${t}-MM` : this.type === "date" ? `${t}-MM-dd` : this.type === "dates" ? `${t}-MM-dd` : this.type === "months" ? `${t}-MM` : this.type === "years" ? t : this.type === "week" ? `${t}-MM-WW` : this.type === "datetime" ? `${t}-MM-dd HH:mm:ss` : this.type === "datetimerange" ? `${t}-MM-dd HH:mm:ss` : this.type === "daterange" ? `${t}-MM-dd` : this.type === "monthrange" ? `${t}-MM` : "";
|
|
@@ -825,44 +995,44 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
825
995
|
t.shortcuts = this.shortcuts.length > 0 ? this.shortcuts : [
|
|
826
996
|
{
|
|
827
997
|
text: h("today"),
|
|
828
|
-
onClick(
|
|
829
|
-
const
|
|
830
|
-
e && (a.setHours(0, 0, 0, 0),
|
|
998
|
+
onClick(i) {
|
|
999
|
+
const s = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
1000
|
+
e && (a.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999)), i.$emit("pick", [a, s]);
|
|
831
1001
|
}
|
|
832
1002
|
},
|
|
833
1003
|
{
|
|
834
1004
|
text: h("yesterday"),
|
|
835
|
-
onClick(
|
|
836
|
-
const
|
|
837
|
-
a.setTime(a.getTime() - 3600 * 1e3 * 24),
|
|
1005
|
+
onClick(i) {
|
|
1006
|
+
const s = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
1007
|
+
a.setTime(a.getTime() - 3600 * 1e3 * 24), s.setTime(s.getTime() - 3600 * 1e3 * 24), e && (a.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999)), i.$emit("pick", [a, s]);
|
|
838
1008
|
}
|
|
839
1009
|
},
|
|
840
1010
|
{
|
|
841
1011
|
text: h("last7days"),
|
|
842
|
-
onClick(
|
|
843
|
-
const
|
|
844
|
-
a.setTime(a.getTime() - 3600 * 1e3 * 24 * 7), e && (a.setHours(0, 0, 0, 0),
|
|
1012
|
+
onClick(i) {
|
|
1013
|
+
const s = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
1014
|
+
a.setTime(a.getTime() - 3600 * 1e3 * 24 * 7), e && (a.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999)), i.$emit("pick", [a, s]);
|
|
845
1015
|
}
|
|
846
1016
|
},
|
|
847
1017
|
{
|
|
848
1018
|
text: h("last30days"),
|
|
849
|
-
onClick(
|
|
850
|
-
const
|
|
851
|
-
a.setTime(a.getTime() - 3600 * 1e3 * 24 * 30), e && (a.setHours(0, 0, 0, 0),
|
|
1019
|
+
onClick(i) {
|
|
1020
|
+
const s = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
1021
|
+
a.setTime(a.getTime() - 3600 * 1e3 * 24 * 30), e && (a.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999)), i.$emit("pick", [a, s]);
|
|
852
1022
|
}
|
|
853
1023
|
},
|
|
854
1024
|
{
|
|
855
1025
|
text: h("thisMonth"),
|
|
856
|
-
onClick(
|
|
857
|
-
const
|
|
858
|
-
a.setDate(1), e && (a.setHours(0, 0, 0, 0),
|
|
1026
|
+
onClick(i) {
|
|
1027
|
+
const s = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
1028
|
+
a.setDate(1), e && (a.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999)), i.$emit("pick", [a, s]);
|
|
859
1029
|
}
|
|
860
1030
|
},
|
|
861
1031
|
{
|
|
862
1032
|
text: h("lastMonth"),
|
|
863
|
-
onClick(
|
|
864
|
-
const
|
|
865
|
-
a.setMonth(a.getMonth() - 1), a.setDate(1),
|
|
1033
|
+
onClick(i) {
|
|
1034
|
+
const s = /* @__PURE__ */ new Date(), a = /* @__PURE__ */ new Date();
|
|
1035
|
+
a.setMonth(a.getMonth() - 1), a.setDate(1), s.setDate(0), e && (a.setHours(0, 0, 0, 0), s.setHours(23, 59, 59, 999)), i.$emit("pick", [a, s]);
|
|
866
1036
|
}
|
|
867
1037
|
}
|
|
868
1038
|
];
|
|
@@ -879,43 +1049,43 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
879
1049
|
{
|
|
880
1050
|
text: h("today"),
|
|
881
1051
|
value: () => {
|
|
882
|
-
const e = /* @__PURE__ */ new Date(),
|
|
883
|
-
return t && (
|
|
1052
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1053
|
+
return t && (i.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [i, e];
|
|
884
1054
|
}
|
|
885
1055
|
},
|
|
886
1056
|
{
|
|
887
1057
|
text: h("yesterday"),
|
|
888
1058
|
value: () => {
|
|
889
|
-
const e = /* @__PURE__ */ new Date(),
|
|
890
|
-
return
|
|
1059
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1060
|
+
return i.setTime(i.getTime() - 3600 * 1e3 * 24), e.setTime(e.getTime() - 3600 * 1e3 * 24), t && (i.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [i, e];
|
|
891
1061
|
}
|
|
892
1062
|
},
|
|
893
1063
|
{
|
|
894
1064
|
text: h("last7days"),
|
|
895
1065
|
value: () => {
|
|
896
|
-
const e = /* @__PURE__ */ new Date(),
|
|
897
|
-
return
|
|
1066
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1067
|
+
return i.setTime(i.getTime() - 3600 * 1e3 * 24 * 7), t && (i.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [i, e];
|
|
898
1068
|
}
|
|
899
1069
|
},
|
|
900
1070
|
{
|
|
901
1071
|
text: h("last30days"),
|
|
902
1072
|
value: () => {
|
|
903
|
-
const e = /* @__PURE__ */ new Date(),
|
|
904
|
-
return
|
|
1073
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1074
|
+
return i.setTime(i.getTime() - 3600 * 1e3 * 24 * 30), t && (i.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [i, e];
|
|
905
1075
|
}
|
|
906
1076
|
},
|
|
907
1077
|
{
|
|
908
1078
|
text: h("thisMonth"),
|
|
909
1079
|
value: () => {
|
|
910
|
-
const e = /* @__PURE__ */ new Date(),
|
|
911
|
-
return
|
|
1080
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1081
|
+
return i.setDate(1), t && (i.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [i, e];
|
|
912
1082
|
}
|
|
913
1083
|
},
|
|
914
1084
|
{
|
|
915
1085
|
text: h("lastMonth"),
|
|
916
1086
|
value: () => {
|
|
917
|
-
const e = /* @__PURE__ */ new Date(),
|
|
918
|
-
return
|
|
1087
|
+
const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1088
|
+
return i.setMonth(i.getMonth() - 1), i.setDate(1), e.setDate(0), t && (i.setHours(0, 0, 0, 0), e.setHours(23, 59, 59, 999)), [i, e];
|
|
919
1089
|
}
|
|
920
1090
|
}
|
|
921
1091
|
];
|
|
@@ -933,12 +1103,12 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
933
1103
|
if (this.type === "datetimerange" && Array.isArray(t))
|
|
934
1104
|
return t.map((e) => {
|
|
935
1105
|
if (typeof e == "string") {
|
|
936
|
-
const
|
|
1106
|
+
const i = /* @__PURE__ */ new Date(), [s, a, l] = e.split(":").map(Number);
|
|
937
1107
|
return new Date(
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
1108
|
+
i.getFullYear(),
|
|
1109
|
+
i.getMonth(),
|
|
1110
|
+
i.getDate(),
|
|
1111
|
+
s,
|
|
942
1112
|
a,
|
|
943
1113
|
l || 0
|
|
944
1114
|
);
|
|
@@ -946,13 +1116,13 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
946
1116
|
return e;
|
|
947
1117
|
});
|
|
948
1118
|
if (this.type === "datetime" && typeof t == "string") {
|
|
949
|
-
const e = /* @__PURE__ */ new Date(), [
|
|
1119
|
+
const e = /* @__PURE__ */ new Date(), [i, s, a] = t.split(":").map(Number);
|
|
950
1120
|
return new Date(
|
|
951
1121
|
e.getFullYear(),
|
|
952
1122
|
e.getMonth(),
|
|
953
1123
|
e.getDate(),
|
|
954
|
-
s,
|
|
955
1124
|
i,
|
|
1125
|
+
s,
|
|
956
1126
|
a || 0
|
|
957
1127
|
);
|
|
958
1128
|
}
|
|
@@ -961,26 +1131,22 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
961
1131
|
},
|
|
962
1132
|
dateValue() {
|
|
963
1133
|
return this.isRangeType ? this.start || this.end ? [this.start, this.end] : this.value : this.value;
|
|
964
|
-
},
|
|
965
|
-
fieldValue: {
|
|
966
|
-
get() {
|
|
967
|
-
return this.field;
|
|
968
|
-
},
|
|
969
|
-
set(t) {
|
|
970
|
-
this.$emit("field-change", t);
|
|
971
|
-
}
|
|
972
1134
|
}
|
|
973
1135
|
},
|
|
974
1136
|
data() {
|
|
975
1137
|
return {
|
|
976
1138
|
t: h,
|
|
977
|
-
isVue2:
|
|
978
|
-
isVue3:
|
|
979
|
-
getDefaultSize:
|
|
980
|
-
valueField:
|
|
1139
|
+
isVue2: Je,
|
|
1140
|
+
isVue3: Ke,
|
|
1141
|
+
getDefaultSize: p,
|
|
1142
|
+
valueField: qe
|
|
981
1143
|
};
|
|
982
1144
|
},
|
|
983
1145
|
methods: {
|
|
1146
|
+
// 处理字段变化事件
|
|
1147
|
+
handleFieldChange(t) {
|
|
1148
|
+
this.$emit("field-change", t);
|
|
1149
|
+
},
|
|
984
1150
|
// 处理日期变化事件
|
|
985
1151
|
handleDateChange(t) {
|
|
986
1152
|
this.isRangeType ? (this.$emit("value-change", t), t && Array.isArray(t) && t.length === 2 ? (this.$emit("start-change", t), this.$emit("end-change", t)) : (this.$emit("start-change", []), this.$emit("end-change", []))) : this.$emit("value-change", t);
|
|
@@ -993,40 +1159,24 @@ const E = Ae.exports, { t: h } = b(), Re = !0, He = !1, Ee = "value", Ie = {
|
|
|
993
1159
|
handleFocus(t) {
|
|
994
1160
|
this.$emit("focus", t);
|
|
995
1161
|
}
|
|
996
|
-
},
|
|
997
|
-
watch: {
|
|
998
|
-
labelOptions: {
|
|
999
|
-
handler(t) {
|
|
1000
|
-
t && t.length > 0 && !this.field && this.$emit("field-change", t[0].value);
|
|
1001
|
-
},
|
|
1002
|
-
deep: !0,
|
|
1003
|
-
immediate: !0
|
|
1004
|
-
}
|
|
1005
1162
|
}
|
|
1006
1163
|
};
|
|
1007
|
-
var
|
|
1008
|
-
var e = this,
|
|
1009
|
-
return
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1015
|
-
] }, [e.labelOptions && e.labelOptions.length > 0 ? s("el-select", { staticStyle: { width: "100px" }, attrs: { size: e.getDefaultSize() }, model: { value: e.fieldValue, callback: function(i) {
|
|
1016
|
-
e.fieldValue = i;
|
|
1017
|
-
}, expression: "fieldValue" } }, e._l(e.labelOptions, function(i) {
|
|
1018
|
-
return s("el-option", { key: i.value, attrs: { label: i.label, value: i.value } });
|
|
1019
|
-
}), 1) : e.label ? s("div", { staticClass: "date-label" }, [s("EllipsisText", { attrs: { text: e.label, lines: 2 } })], 1) : e._e(), e.isVue2 ? s("el-date-picker", { style: e.computedDatePickerStyle, attrs: { value: e.dateValue, type: e.type, size: e.getDefaultSize(), "range-separator": e.rangeSeparator, "start-placeholder": e.computedStartPlaceholder, "end-placeholder": e.computedEndPlaceholder, placeholder: e.placeholder, "picker-options": e.computedPickerOptions, format: e.computedFormat, "value-format": e.computedFormat, disabled: e.disabled, clearable: e.clearable, readonly: e.readonly, editable: e.editable, align: e.align, "popper-class": e.popperClass, "default-value": e.defaultValue, "default-time": e.computedDefaultTime }, on: { input: e.handleDateChange, change: e.handleDateChange, blur: e.handleBlur, focus: e.handleFocus } }) : s("el-date-picker", { style: e.computedDatePickerStyle, attrs: { "model-value": e.dateValue, type: e.type, size: e.getDefaultSize(), "range-separator": e.rangeSeparator, "start-placeholder": e.computedStartPlaceholder, "end-placeholder": e.computedEndPlaceholder, placeholder: e.placeholder, shortcuts: e.computedShortcuts, "disabled-date": e.computedDisabledDate, format: e.computedFormat, "value-format": e.computedFormat, disabled: e.disabled, clearable: e.clearable, readonly: e.readonly, editable: e.editable, teleported: !1, "popper-class": e.popperClass, "default-value": e.defaultValue, "default-time": e.computedDefaultTime }, on: { "update:model-value": e.handleDateChange, change: e.handleDateChange, blur: e.handleBlur, focus: e.handleFocus } })], 1);
|
|
1020
|
-
}, We = [], Be = /* @__PURE__ */ c(
|
|
1021
|
-
Ie,
|
|
1022
|
-
Pe,
|
|
1023
|
-
We,
|
|
1164
|
+
var Ge = function() {
|
|
1165
|
+
var e = this, i = e._self._c;
|
|
1166
|
+
return i("FormItemLayout", { attrs: { label: e.label, "label-options": e.labelOptions, field: e.field, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction }, on: { "field-change": e.handleFieldChange } }, [i("el-date-picker", { staticClass: "date-picker", attrs: { value: e.dateValue, type: e.type, size: e.getDefaultSize(), "range-separator": e.rangeSeparator, "start-placeholder": e.computedStartPlaceholder, "end-placeholder": e.computedEndPlaceholder, placeholder: e.placeholder, "picker-options": e.computedPickerOptions, format: e.computedFormat, "value-format": e.computedFormat, disabled: e.disabled, clearable: e.clearable, readonly: e.readonly, editable: e.editable, align: e.align, "popper-class": e.popperClass, "default-value": e.defaultValue, "default-time": e.computedDefaultTime }, on: { input: e.handleDateChange, change: e.handleDateChange, blur: e.handleBlur, focus: e.handleFocus } })], 1);
|
|
1167
|
+
}, Ye = [], Xe = /* @__PURE__ */ d(
|
|
1168
|
+
Qe,
|
|
1169
|
+
Ge,
|
|
1170
|
+
Ye,
|
|
1024
1171
|
!1,
|
|
1025
1172
|
null,
|
|
1026
|
-
"
|
|
1173
|
+
"db170108"
|
|
1027
1174
|
);
|
|
1028
|
-
const I =
|
|
1175
|
+
const I = Xe.exports, Ze = !0, et = {
|
|
1029
1176
|
name: "TmCascaderFilter",
|
|
1177
|
+
components: {
|
|
1178
|
+
FormItemLayout: C
|
|
1179
|
+
},
|
|
1030
1180
|
props: {
|
|
1031
1181
|
value: {
|
|
1032
1182
|
type: [String, Number, Array],
|
|
@@ -1036,6 +1186,10 @@ const I = Be.exports, Ne = !0, Ue = {
|
|
|
1036
1186
|
type: [Array, Function],
|
|
1037
1187
|
default: () => []
|
|
1038
1188
|
},
|
|
1189
|
+
label: {
|
|
1190
|
+
type: [String, Function, Object, Array],
|
|
1191
|
+
default: null
|
|
1192
|
+
},
|
|
1039
1193
|
props: {
|
|
1040
1194
|
type: Object,
|
|
1041
1195
|
default: () => ({
|
|
@@ -1064,12 +1218,26 @@ const I = Be.exports, Ne = !0, Ue = {
|
|
|
1064
1218
|
placeholder: {
|
|
1065
1219
|
type: String,
|
|
1066
1220
|
default: ""
|
|
1221
|
+
},
|
|
1222
|
+
// FormItemLayout 配置参数
|
|
1223
|
+
labelWidth: {
|
|
1224
|
+
type: [String, Number],
|
|
1225
|
+
default: void 0
|
|
1226
|
+
},
|
|
1227
|
+
inputWidth: {
|
|
1228
|
+
type: [String, Number],
|
|
1229
|
+
default: void 0
|
|
1230
|
+
},
|
|
1231
|
+
direction: {
|
|
1232
|
+
type: String,
|
|
1233
|
+
default: void 0,
|
|
1234
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
1067
1235
|
}
|
|
1068
1236
|
},
|
|
1069
1237
|
data() {
|
|
1070
1238
|
return {
|
|
1071
|
-
isVue2:
|
|
1072
|
-
getDefaultSize:
|
|
1239
|
+
isVue2: Ze,
|
|
1240
|
+
getDefaultSize: p,
|
|
1073
1241
|
selectedValue: this.value,
|
|
1074
1242
|
optionsList: [],
|
|
1075
1243
|
loading: !1
|
|
@@ -1084,7 +1252,7 @@ const I = Be.exports, Ne = !0, Ue = {
|
|
|
1084
1252
|
};
|
|
1085
1253
|
},
|
|
1086
1254
|
cascaderProps() {
|
|
1087
|
-
return
|
|
1255
|
+
return m(u({}, this.props), {
|
|
1088
1256
|
expandTrigger: this.props.expandTrigger || "hover"
|
|
1089
1257
|
});
|
|
1090
1258
|
}
|
|
@@ -1122,15 +1290,15 @@ const I = Be.exports, Ne = !0, Ue = {
|
|
|
1122
1290
|
}
|
|
1123
1291
|
}
|
|
1124
1292
|
};
|
|
1125
|
-
var
|
|
1126
|
-
var e = this,
|
|
1127
|
-
return
|
|
1293
|
+
var tt = function() {
|
|
1294
|
+
var e = this, i = e._self._c;
|
|
1295
|
+
return i("FormItemLayout", { attrs: { label: e.label, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction } }, [i("div", { staticClass: "cascader" }, [i("el-cascader", e._g(e._b({ ref: "cascader", scopedSlots: e._u([{ key: "default", fn: function({ node: s, data: a }) {
|
|
1128
1296
|
return [e._t("default", function() {
|
|
1129
|
-
return [
|
|
1130
|
-
}, { node:
|
|
1131
|
-
} }], null, !0), model: { value: e.selectedValue, callback: function(
|
|
1132
|
-
e.selectedValue =
|
|
1133
|
-
}, expression: "selectedValue" } }, "el-cascader",
|
|
1297
|
+
return [i("span", [e._v(e._s(a[e.propMap.label]))])];
|
|
1298
|
+
}, { node: s, data: a })];
|
|
1299
|
+
} }], null, !0), model: { value: e.selectedValue, callback: function(s) {
|
|
1300
|
+
e.selectedValue = s;
|
|
1301
|
+
}, expression: "selectedValue" } }, "el-cascader", m(u({}, e.$attrs), {
|
|
1134
1302
|
size: e.getDefaultSize(),
|
|
1135
1303
|
filterable: e.filterable,
|
|
1136
1304
|
clearable: e.clearable,
|
|
@@ -1140,17 +1308,20 @@ var je = function() {
|
|
|
1140
1308
|
placeholder: e.placeholder,
|
|
1141
1309
|
options: e.optionsList,
|
|
1142
1310
|
loading: e.loading
|
|
1143
|
-
}), !1), e.isVue2 ? e.$listeners : {}));
|
|
1144
|
-
},
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1311
|
+
}), !1), e.isVue2 ? e.$listeners : {}))], 1)]);
|
|
1312
|
+
}, it = [], st = /* @__PURE__ */ d(
|
|
1313
|
+
et,
|
|
1314
|
+
tt,
|
|
1315
|
+
it,
|
|
1148
1316
|
!1,
|
|
1149
1317
|
null,
|
|
1150
|
-
|
|
1318
|
+
"012b1d19"
|
|
1151
1319
|
);
|
|
1152
|
-
const
|
|
1320
|
+
const N = st.exports, at = !0, lt = !1, nt = {
|
|
1153
1321
|
name: "TmRadioFilter",
|
|
1322
|
+
components: {
|
|
1323
|
+
FormItemLayout: C
|
|
1324
|
+
},
|
|
1154
1325
|
props: {
|
|
1155
1326
|
value: {
|
|
1156
1327
|
type: [String, Number],
|
|
@@ -1175,13 +1346,31 @@ const P = Ke.exports, Qe = !0, qe = !1, Ge = {
|
|
|
1175
1346
|
type: [String, Number],
|
|
1176
1347
|
default: 200
|
|
1177
1348
|
// 默认宽度200px,如果有选项超过4个时使用305px
|
|
1349
|
+
},
|
|
1350
|
+
label: {
|
|
1351
|
+
type: [String, Function, Object, Array],
|
|
1352
|
+
default: null
|
|
1353
|
+
},
|
|
1354
|
+
// FormItemLayout 配置参数
|
|
1355
|
+
labelWidth: {
|
|
1356
|
+
type: [String, Number],
|
|
1357
|
+
default: void 0
|
|
1358
|
+
},
|
|
1359
|
+
inputWidth: {
|
|
1360
|
+
type: [String, Number],
|
|
1361
|
+
default: void 0
|
|
1362
|
+
},
|
|
1363
|
+
direction: {
|
|
1364
|
+
type: String,
|
|
1365
|
+
default: void 0,
|
|
1366
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
1178
1367
|
}
|
|
1179
1368
|
},
|
|
1180
1369
|
data() {
|
|
1181
1370
|
return {
|
|
1182
|
-
isVue2:
|
|
1183
|
-
isVue3:
|
|
1184
|
-
getDefaultSize:
|
|
1371
|
+
isVue2: at,
|
|
1372
|
+
isVue3: lt,
|
|
1373
|
+
getDefaultSize: p,
|
|
1185
1374
|
selectedValue: this.value,
|
|
1186
1375
|
optionsList: [],
|
|
1187
1376
|
loading: !1
|
|
@@ -1193,19 +1382,6 @@ const P = Ke.exports, Qe = !0, qe = !1, Ge = {
|
|
|
1193
1382
|
label: this.props.label || "label",
|
|
1194
1383
|
value: this.props.value || "value"
|
|
1195
1384
|
};
|
|
1196
|
-
},
|
|
1197
|
-
// 判断是否需要使用较宽的布局(超过4个选项)
|
|
1198
|
-
hasWideOptions() {
|
|
1199
|
-
return this.optionsList.length > 4;
|
|
1200
|
-
},
|
|
1201
|
-
// 计算每个按钮的宽度,确保填满容器
|
|
1202
|
-
calculateItemWidth() {
|
|
1203
|
-
if (!this.optionsList.length) return {};
|
|
1204
|
-
const e = `${(this.hasWideOptions ? 305 : 200) / this.optionsList.length}px`;
|
|
1205
|
-
return {
|
|
1206
|
-
width: e,
|
|
1207
|
-
flex: `0 0 ${e}`
|
|
1208
|
-
};
|
|
1209
1385
|
}
|
|
1210
1386
|
},
|
|
1211
1387
|
watch: {
|
|
@@ -1241,35 +1417,33 @@ const P = Ke.exports, Qe = !0, qe = !1, Ge = {
|
|
|
1241
1417
|
}
|
|
1242
1418
|
}
|
|
1243
1419
|
};
|
|
1244
|
-
var
|
|
1245
|
-
var e = this,
|
|
1246
|
-
return
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
"tm-radio--v2": e.isVue2
|
|
1250
|
-
} }, [s("el-radio-group", e._g(e._b({ ref: "radioGroup", model: { value: e.selectedValue, callback: function(i) {
|
|
1251
|
-
e.selectedValue = i;
|
|
1252
|
-
}, expression: "selectedValue" } }, "el-radio-group", y(u({}, e.$attrs), {
|
|
1420
|
+
var rt = function() {
|
|
1421
|
+
var e = this, i = e._self._c;
|
|
1422
|
+
return i("FormItemLayout", { attrs: { label: e.label, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction } }, [i("el-radio-group", e._g(e._b({ ref: "radioGroup", staticClass: "radio-group", model: { value: e.selectedValue, callback: function(s) {
|
|
1423
|
+
e.selectedValue = s;
|
|
1424
|
+
}, expression: "selectedValue" } }, "el-radio-group", m(u({}, e.$attrs), {
|
|
1253
1425
|
size: e.getDefaultSize()
|
|
1254
|
-
}), !1), e.isVue2 ? e.$listeners : {}), [e.$slots.default ? [e._t("default")] : e._l(e.optionsList, function(
|
|
1255
|
-
return
|
|
1256
|
-
[e.isVue3 ? "value" : "label"]:
|
|
1257
|
-
disabled:
|
|
1258
|
-
style: e.calculateItemWidth
|
|
1426
|
+
}), !1), e.isVue2 ? e.$listeners : {}), [e.$slots.default ? [e._t("default")] : e._l(e.optionsList, function(s) {
|
|
1427
|
+
return i("el-radio-button", e._b({ key: s[e.propMap.value], staticStyle: { flex: "1" } }, "el-radio-button", {
|
|
1428
|
+
[e.isVue3 ? "value" : "label"]: s[e.propMap.value],
|
|
1429
|
+
disabled: s.disabled
|
|
1259
1430
|
}, !1), [e._t("option", function() {
|
|
1260
|
-
return [e._v(e._s(
|
|
1261
|
-
}, { item:
|
|
1431
|
+
return [e._v(e._s(s[e.propMap.label]))];
|
|
1432
|
+
}, { item: s })], 2);
|
|
1262
1433
|
})], 2)], 1);
|
|
1263
|
-
},
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1434
|
+
}, ot = [], ut = /* @__PURE__ */ d(
|
|
1435
|
+
nt,
|
|
1436
|
+
rt,
|
|
1437
|
+
ot,
|
|
1267
1438
|
!1,
|
|
1268
1439
|
null,
|
|
1269
|
-
"
|
|
1440
|
+
"328c915e"
|
|
1270
1441
|
);
|
|
1271
|
-
const
|
|
1442
|
+
const P = ut.exports, dt = !0, ct = !1, ht = {
|
|
1272
1443
|
name: "TmCheckboxFilter",
|
|
1444
|
+
components: {
|
|
1445
|
+
FormItemLayout: C
|
|
1446
|
+
},
|
|
1273
1447
|
props: {
|
|
1274
1448
|
value: {
|
|
1275
1449
|
type: Array,
|
|
@@ -1290,17 +1464,30 @@ const W = Ze.exports, et = !0, tt = !1, st = {
|
|
|
1290
1464
|
type: String,
|
|
1291
1465
|
default: "mini"
|
|
1292
1466
|
},
|
|
1293
|
-
|
|
1467
|
+
label: {
|
|
1468
|
+
type: [String, Function, Object, Array],
|
|
1469
|
+
default: null
|
|
1470
|
+
},
|
|
1471
|
+
// FormItemLayout 配置参数
|
|
1472
|
+
labelWidth: {
|
|
1294
1473
|
type: [String, Number],
|
|
1295
|
-
default:
|
|
1296
|
-
|
|
1474
|
+
default: void 0
|
|
1475
|
+
},
|
|
1476
|
+
inputWidth: {
|
|
1477
|
+
type: [String, Number],
|
|
1478
|
+
default: void 0
|
|
1479
|
+
},
|
|
1480
|
+
direction: {
|
|
1481
|
+
type: String,
|
|
1482
|
+
default: void 0,
|
|
1483
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
1297
1484
|
}
|
|
1298
1485
|
},
|
|
1299
1486
|
data() {
|
|
1300
1487
|
return {
|
|
1301
|
-
isVue2:
|
|
1302
|
-
isVue3:
|
|
1303
|
-
getDefaultSize:
|
|
1488
|
+
isVue2: dt,
|
|
1489
|
+
isVue3: ct,
|
|
1490
|
+
getDefaultSize: p,
|
|
1304
1491
|
selectedValue: this.value || [],
|
|
1305
1492
|
optionsList: [],
|
|
1306
1493
|
loading: !1
|
|
@@ -1312,21 +1499,6 @@ const W = Ze.exports, et = !0, tt = !1, st = {
|
|
|
1312
1499
|
label: this.props.label || "label",
|
|
1313
1500
|
value: this.props.value || "value"
|
|
1314
1501
|
};
|
|
1315
|
-
},
|
|
1316
|
-
// 判断是否需要使用较宽的布局(超过4个选项)
|
|
1317
|
-
hasWideOptions() {
|
|
1318
|
-
return this.optionsList.length > 4;
|
|
1319
|
-
},
|
|
1320
|
-
// 计算每个按钮的宽度,确保填满容器
|
|
1321
|
-
calculateItemWidth() {
|
|
1322
|
-
if (!this.optionsList.length) return {};
|
|
1323
|
-
const t = Math.ceil(
|
|
1324
|
-
this.optionsList.length / (this.hasWideOptions ? 6 : 4)
|
|
1325
|
-
), e = Math.ceil(this.optionsList.length / t), i = `${(this.hasWideOptions ? 305 : 200) / e}px`;
|
|
1326
|
-
return {
|
|
1327
|
-
width: i,
|
|
1328
|
-
flex: `0 0 ${i}`
|
|
1329
|
-
};
|
|
1330
1502
|
}
|
|
1331
1503
|
},
|
|
1332
1504
|
watch: {
|
|
@@ -1362,67 +1534,64 @@ const W = Ze.exports, et = !0, tt = !1, st = {
|
|
|
1362
1534
|
}
|
|
1363
1535
|
}
|
|
1364
1536
|
};
|
|
1365
|
-
var
|
|
1366
|
-
var e = this,
|
|
1367
|
-
return
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
"tm-checkbox--v2": e.isVue2
|
|
1371
|
-
} }, [s("el-checkbox-group", e._g(e._b({ ref: "checkboxGroup", model: { value: e.selectedValue, callback: function(i) {
|
|
1372
|
-
e.selectedValue = i;
|
|
1373
|
-
}, expression: "selectedValue" } }, "el-checkbox-group", y(u({}, e.$attrs), {
|
|
1537
|
+
var pt = function() {
|
|
1538
|
+
var e = this, i = e._self._c;
|
|
1539
|
+
return i("FormItemLayout", { attrs: { label: e.label, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction } }, [i("div", { staticClass: "checkbox-content" }, [i("el-checkbox-group", e._g(e._b({ ref: "checkboxGroup", model: { value: e.selectedValue, callback: function(s) {
|
|
1540
|
+
e.selectedValue = s;
|
|
1541
|
+
}, expression: "selectedValue" } }, "el-checkbox-group", m(u({}, e.$attrs), {
|
|
1374
1542
|
size: e.getDefaultSize()
|
|
1375
|
-
}), !1), e.isVue2 ? e.$listeners : {}), [e.$slots.default ? [e._t("default")] : e._l(e.optionsList, function(
|
|
1376
|
-
return
|
|
1377
|
-
[e.isVue3 ? "value" : "label"]:
|
|
1378
|
-
disabled:
|
|
1379
|
-
style: e.calculateItemWidth
|
|
1543
|
+
}), !1), e.isVue2 ? e.$listeners : {}), [e.$slots.default ? [e._t("default")] : e._l(e.optionsList, function(s) {
|
|
1544
|
+
return i("el-checkbox-button", e._b({ key: s[e.propMap.value], staticStyle: { flex: "1" } }, "el-checkbox-button", {
|
|
1545
|
+
[e.isVue3 ? "value" : "label"]: s[e.propMap.value],
|
|
1546
|
+
disabled: s.disabled
|
|
1380
1547
|
}, !1), [e._t("option", function() {
|
|
1381
|
-
return [e._v(e._s(
|
|
1382
|
-
}, { item:
|
|
1383
|
-
})], 2)], 1);
|
|
1384
|
-
},
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1548
|
+
return [e._v(e._s(s[e.propMap.label]))];
|
|
1549
|
+
}, { item: s })], 2);
|
|
1550
|
+
})], 2)], 1)]);
|
|
1551
|
+
}, ft = [], mt = /* @__PURE__ */ d(
|
|
1552
|
+
ht,
|
|
1553
|
+
pt,
|
|
1554
|
+
ft,
|
|
1388
1555
|
!1,
|
|
1389
1556
|
null,
|
|
1390
|
-
"
|
|
1557
|
+
"0ac1259e"
|
|
1391
1558
|
);
|
|
1392
|
-
const B =
|
|
1559
|
+
const B = mt.exports, gt = !0, bt = {
|
|
1393
1560
|
name: "TmSwitchFilter",
|
|
1561
|
+
components: {
|
|
1562
|
+
FormItemLayout: C
|
|
1563
|
+
},
|
|
1394
1564
|
props: {
|
|
1395
1565
|
value: {
|
|
1396
1566
|
type: Boolean,
|
|
1397
1567
|
default: !1
|
|
1398
1568
|
},
|
|
1399
1569
|
label: {
|
|
1400
|
-
type: String,
|
|
1570
|
+
type: [String, Function, Object, Array],
|
|
1401
1571
|
default: ""
|
|
1572
|
+
},
|
|
1573
|
+
// FormItemLayout 配置参数
|
|
1574
|
+
labelWidth: {
|
|
1575
|
+
type: [String, Number],
|
|
1576
|
+
default: void 0
|
|
1577
|
+
},
|
|
1578
|
+
inputWidth: {
|
|
1579
|
+
type: [String, Number],
|
|
1580
|
+
default: void 0
|
|
1581
|
+
},
|
|
1582
|
+
direction: {
|
|
1583
|
+
type: String,
|
|
1584
|
+
default: void 0,
|
|
1585
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
1402
1586
|
}
|
|
1403
1587
|
},
|
|
1404
1588
|
data() {
|
|
1405
1589
|
return {
|
|
1406
|
-
isVue2:
|
|
1407
|
-
getDefaultSize:
|
|
1590
|
+
isVue2: gt,
|
|
1591
|
+
getDefaultSize: p,
|
|
1408
1592
|
switchValue: this.value
|
|
1409
1593
|
};
|
|
1410
1594
|
},
|
|
1411
|
-
computed: {
|
|
1412
|
-
// 根据文本长度计算容器宽度类
|
|
1413
|
-
containerWidthClass() {
|
|
1414
|
-
const t = (l) => {
|
|
1415
|
-
if (!l) return 0;
|
|
1416
|
-
let n = 0;
|
|
1417
|
-
for (let o = 0; o < l.length; o++) {
|
|
1418
|
-
const r = l.charAt(o);
|
|
1419
|
-
n += /[\u4e00-\u9fa5]/.test(r) ? 2 : 1;
|
|
1420
|
-
}
|
|
1421
|
-
return n;
|
|
1422
|
-
}, e = t(this.$attrs["active-text"]), s = t(this.$attrs["inactive-text"]), i = t(this.$attrs.label), a = e + s + i;
|
|
1423
|
-
return a > 20 ? "wide-container" : a > 6 ? "medium-container" : "narrow-container";
|
|
1424
|
-
}
|
|
1425
|
-
},
|
|
1426
1595
|
watch: {
|
|
1427
1596
|
value: {
|
|
1428
1597
|
immediate: !0,
|
|
@@ -1435,20 +1604,20 @@ const B = lt.exports, nt = !0, rt = {
|
|
|
1435
1604
|
}
|
|
1436
1605
|
}
|
|
1437
1606
|
};
|
|
1438
|
-
var
|
|
1439
|
-
var e = this,
|
|
1440
|
-
return
|
|
1441
|
-
e.switchValue =
|
|
1442
|
-
}, expression: "switchValue" } }, "el-switch", e.$attrs, !1), e.isVue2 ? e.$listeners : {}))], 1);
|
|
1443
|
-
},
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1607
|
+
var yt = function() {
|
|
1608
|
+
var e = this, i = e._self._c;
|
|
1609
|
+
return i("FormItemLayout", { attrs: { label: e.label, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction } }, [i("div", { staticClass: "switch-content" }, [i("el-switch", e._g(e._b({ ref: "switch", attrs: { size: e.getDefaultSize() }, model: { value: e.switchValue, callback: function(s) {
|
|
1610
|
+
e.switchValue = s;
|
|
1611
|
+
}, expression: "switchValue" } }, "el-switch", e.$attrs, !1), e.isVue2 ? e.$listeners : {}))], 1)]);
|
|
1612
|
+
}, vt = [], Ct = /* @__PURE__ */ d(
|
|
1613
|
+
bt,
|
|
1614
|
+
yt,
|
|
1615
|
+
vt,
|
|
1447
1616
|
!1,
|
|
1448
1617
|
null,
|
|
1449
|
-
"
|
|
1618
|
+
"5ca0dc56"
|
|
1450
1619
|
);
|
|
1451
|
-
const
|
|
1620
|
+
const j = Ct.exports, _t = {
|
|
1452
1621
|
name: "DynamicSlot",
|
|
1453
1622
|
props: {
|
|
1454
1623
|
name: {
|
|
@@ -1468,28 +1637,28 @@ const N = ct.exports, dt = {
|
|
|
1468
1637
|
{
|
|
1469
1638
|
let r = (n = l.$scopedSlots) == null ? void 0 : n[this.name];
|
|
1470
1639
|
if (!r && ((o = l.$slots) != null && o[this.name])) {
|
|
1471
|
-
const
|
|
1472
|
-
r = () =>
|
|
1640
|
+
const c = l.$slots[this.name];
|
|
1641
|
+
r = () => c;
|
|
1473
1642
|
}
|
|
1474
1643
|
return r;
|
|
1475
1644
|
}
|
|
1476
|
-
},
|
|
1645
|
+
}, i = (l) => {
|
|
1477
1646
|
var n;
|
|
1478
1647
|
return l ? ((n = l.$options) == null ? void 0 : n.name) === "TmTable" : !1;
|
|
1479
1648
|
};
|
|
1480
|
-
let
|
|
1481
|
-
if (!
|
|
1649
|
+
let s = e(this.$parent);
|
|
1650
|
+
if (!s) {
|
|
1482
1651
|
let l = (a = this.$parent) == null ? void 0 : a.$parent;
|
|
1483
|
-
for (; l && !
|
|
1484
|
-
if (
|
|
1485
|
-
|
|
1652
|
+
for (; l && !s; ) {
|
|
1653
|
+
if (i(l)) {
|
|
1654
|
+
s = e(l);
|
|
1486
1655
|
break;
|
|
1487
1656
|
}
|
|
1488
1657
|
l = l.$parent;
|
|
1489
1658
|
}
|
|
1490
1659
|
}
|
|
1491
|
-
if (
|
|
1492
|
-
const l = typeof
|
|
1660
|
+
if (s) {
|
|
1661
|
+
const l = typeof s == "function" ? s(this.slotProps) : s;
|
|
1493
1662
|
{
|
|
1494
1663
|
if (!l) return null;
|
|
1495
1664
|
if (Array.isArray(l)) {
|
|
@@ -1506,16 +1675,16 @@ const N = ct.exports, dt = {
|
|
|
1506
1675
|
}
|
|
1507
1676
|
return null;
|
|
1508
1677
|
}
|
|
1509
|
-
},
|
|
1510
|
-
var
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1678
|
+
}, xt = null, St = null;
|
|
1679
|
+
var $t = /* @__PURE__ */ d(
|
|
1680
|
+
_t,
|
|
1681
|
+
xt,
|
|
1682
|
+
St,
|
|
1514
1683
|
!1,
|
|
1515
1684
|
null,
|
|
1516
1685
|
null
|
|
1517
1686
|
);
|
|
1518
|
-
const
|
|
1687
|
+
const Tt = $t.exports, { t: wt } = g(), Ft = !0, zt = !1, Lt = [
|
|
1519
1688
|
"date",
|
|
1520
1689
|
"daterange",
|
|
1521
1690
|
"datetime",
|
|
@@ -1527,17 +1696,17 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1527
1696
|
"years",
|
|
1528
1697
|
"week",
|
|
1529
1698
|
"monthrange"
|
|
1530
|
-
],
|
|
1699
|
+
], Vt = {
|
|
1531
1700
|
name: "TmTableSearch",
|
|
1532
1701
|
components: {
|
|
1533
|
-
TmSelect:
|
|
1534
|
-
TmAdvancedInput:
|
|
1702
|
+
TmSelect: E,
|
|
1703
|
+
TmAdvancedInput: W,
|
|
1535
1704
|
TmAdvancedDate: I,
|
|
1536
|
-
TmCascader:
|
|
1537
|
-
TmRadio:
|
|
1705
|
+
TmCascader: N,
|
|
1706
|
+
TmRadio: P,
|
|
1538
1707
|
TmCheckbox: B,
|
|
1539
|
-
TmSwitch:
|
|
1540
|
-
DynamicSlot:
|
|
1708
|
+
TmSwitch: j,
|
|
1709
|
+
DynamicSlot: Tt
|
|
1541
1710
|
},
|
|
1542
1711
|
props: {
|
|
1543
1712
|
disabled: {
|
|
@@ -1551,16 +1720,30 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1551
1720
|
searchForm: {
|
|
1552
1721
|
type: Object,
|
|
1553
1722
|
default: () => ({})
|
|
1723
|
+
},
|
|
1724
|
+
// FormItemLayout 全局配置参数
|
|
1725
|
+
labelWidth: {
|
|
1726
|
+
type: [String, Number],
|
|
1727
|
+
default: void 0
|
|
1728
|
+
},
|
|
1729
|
+
inputWidth: {
|
|
1730
|
+
type: [String, Number],
|
|
1731
|
+
default: void 0
|
|
1732
|
+
},
|
|
1733
|
+
direction: {
|
|
1734
|
+
type: String,
|
|
1735
|
+
default: void 0,
|
|
1736
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
1554
1737
|
}
|
|
1555
1738
|
},
|
|
1556
1739
|
data() {
|
|
1557
1740
|
return {
|
|
1558
|
-
t:
|
|
1559
|
-
isVue2:
|
|
1560
|
-
isVue3:
|
|
1741
|
+
t: wt,
|
|
1742
|
+
isVue2: Ft,
|
|
1743
|
+
isVue3: zt,
|
|
1561
1744
|
getCompatSize: x,
|
|
1562
|
-
getDefaultSize:
|
|
1563
|
-
DATE_TYPES:
|
|
1745
|
+
getDefaultSize: p,
|
|
1746
|
+
DATE_TYPES: Lt,
|
|
1564
1747
|
// 用于存储初始默认值,重置时恢复
|
|
1565
1748
|
defaultValues: {}
|
|
1566
1749
|
};
|
|
@@ -1573,6 +1756,13 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1573
1756
|
set(t) {
|
|
1574
1757
|
this.$emit("update:search-form", t);
|
|
1575
1758
|
}
|
|
1759
|
+
},
|
|
1760
|
+
// 合并参数的方法:单独配置 > 全局配置 > 默认值
|
|
1761
|
+
getLayoutProps() {
|
|
1762
|
+
return (t) => {
|
|
1763
|
+
const e = {};
|
|
1764
|
+
return t.labelWidth !== void 0 ? e.labelWidth = t.labelWidth : this.labelWidth !== void 0 && (e.labelWidth = this.labelWidth), t.inputWidth !== void 0 ? e.inputWidth = t.inputWidth : this.inputWidth !== void 0 && (e.inputWidth = this.inputWidth), t.direction !== void 0 ? e.direction = t.direction : this.direction !== void 0 && (e.direction = this.direction), e;
|
|
1765
|
+
};
|
|
1576
1766
|
}
|
|
1577
1767
|
},
|
|
1578
1768
|
mounted() {
|
|
@@ -1587,37 +1777,37 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1587
1777
|
const t = this.$slots.default;
|
|
1588
1778
|
return t ? this.isVue2 ? !!t : t()[0].children.length > 0 : !1;
|
|
1589
1779
|
},
|
|
1590
|
-
handleUpdate(t, e,
|
|
1591
|
-
const
|
|
1592
|
-
|
|
1593
|
-
[
|
|
1780
|
+
handleUpdate(t, e, i) {
|
|
1781
|
+
const s = this.getFieldValue(t, i);
|
|
1782
|
+
s && this.$emit("update:search-form", m(u({}, this.computedSearchForm), {
|
|
1783
|
+
[s]: e
|
|
1594
1784
|
}));
|
|
1595
1785
|
},
|
|
1596
1786
|
handleUpdateDate(t, e) {
|
|
1597
|
-
const
|
|
1598
|
-
|
|
1787
|
+
const i = e || [], s = this.getFieldValue(t, "start"), a = this.getFieldValue(t, "end"), l = this.getFieldValue(t, "value"), n = {};
|
|
1788
|
+
s && (n[s] = i[0]), a && (n[a] = i[1]), l && (n[l] = i), this.$emit("update:search-form", u(u({}, this.computedSearchForm), n));
|
|
1599
1789
|
},
|
|
1600
1790
|
getFieldValue(t, e) {
|
|
1601
1791
|
if (typeof t == "string")
|
|
1602
1792
|
return t;
|
|
1603
1793
|
if (t.fields && e in t.fields) {
|
|
1604
|
-
const
|
|
1605
|
-
if (typeof
|
|
1606
|
-
return
|
|
1607
|
-
if (Array.isArray(
|
|
1608
|
-
return
|
|
1609
|
-
if (
|
|
1610
|
-
return
|
|
1794
|
+
const i = t.fields[e];
|
|
1795
|
+
if (typeof i == "string")
|
|
1796
|
+
return i;
|
|
1797
|
+
if (Array.isArray(i))
|
|
1798
|
+
return i[0];
|
|
1799
|
+
if (i && typeof i == "object")
|
|
1800
|
+
return i.name;
|
|
1611
1801
|
}
|
|
1612
1802
|
},
|
|
1613
1803
|
// 获取字段默认值(仅支持新的fields结构)
|
|
1614
1804
|
getFieldDefault(t, e) {
|
|
1615
1805
|
if (t.fields && e in t.fields) {
|
|
1616
|
-
const
|
|
1617
|
-
if (Array.isArray(
|
|
1618
|
-
return
|
|
1619
|
-
if (
|
|
1620
|
-
return
|
|
1806
|
+
const i = t.fields[e];
|
|
1807
|
+
if (Array.isArray(i) && i.length > 1)
|
|
1808
|
+
return i[1];
|
|
1809
|
+
if (i && typeof i == "object" && "default" in i)
|
|
1810
|
+
return i.default;
|
|
1621
1811
|
}
|
|
1622
1812
|
},
|
|
1623
1813
|
// 检查是否存在对应名称的插槽
|
|
@@ -1625,12 +1815,12 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1625
1815
|
const e = "$scopedSlots";
|
|
1626
1816
|
if (this[e][t])
|
|
1627
1817
|
return !0;
|
|
1628
|
-
let
|
|
1629
|
-
for (;
|
|
1630
|
-
const a =
|
|
1631
|
-
if (
|
|
1818
|
+
let s = this.$parent;
|
|
1819
|
+
for (; s; ) {
|
|
1820
|
+
const a = s[e];
|
|
1821
|
+
if (s.$options.name === "TmTable" && (a != null && a[t]))
|
|
1632
1822
|
return !0;
|
|
1633
|
-
|
|
1823
|
+
s = s.$parent;
|
|
1634
1824
|
}
|
|
1635
1825
|
return !1;
|
|
1636
1826
|
},
|
|
@@ -1640,38 +1830,38 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1640
1830
|
const t = {};
|
|
1641
1831
|
this.searchColumns.forEach((e) => {
|
|
1642
1832
|
if (typeof e == "string" || !e.fields) return;
|
|
1643
|
-
const
|
|
1833
|
+
const i = this.getFieldValue(e, "value"), s = this.getFieldValue(e, "label");
|
|
1644
1834
|
if (e.type === "input" && e.labelOptions && e.labelOptions.length > 0) {
|
|
1645
1835
|
const l = e.labelOptions[0];
|
|
1646
|
-
if (
|
|
1647
|
-
if (
|
|
1648
|
-
t[
|
|
1836
|
+
if (s)
|
|
1837
|
+
if (s in this.computedSearchForm)
|
|
1838
|
+
t[s] = this.computedSearchForm[s];
|
|
1649
1839
|
else {
|
|
1650
1840
|
const n = this.getFieldDefault(e, "label");
|
|
1651
|
-
n !== void 0 ? t[
|
|
1841
|
+
n !== void 0 ? t[s] = n : l && l.value !== void 0 && (t[s] = l.value);
|
|
1652
1842
|
}
|
|
1653
|
-
|
|
1843
|
+
i && !(i in this.computedSearchForm) && (t[i] = "");
|
|
1654
1844
|
} else if (this.isDateType(e.type) && e.labelOptions && e.labelOptions.length > 0) {
|
|
1655
1845
|
const l = e.labelOptions[0];
|
|
1656
|
-
if (
|
|
1657
|
-
if (
|
|
1658
|
-
t[
|
|
1846
|
+
if (i && !(i in this.computedSearchForm) && (t[i] = []), s)
|
|
1847
|
+
if (s in this.computedSearchForm)
|
|
1848
|
+
t[s] = this.computedSearchForm[s];
|
|
1659
1849
|
else {
|
|
1660
1850
|
const n = this.getFieldDefault(e, "label");
|
|
1661
|
-
n !== void 0 ? t[
|
|
1851
|
+
n !== void 0 ? t[s] = n : l && l.value !== void 0 && (t[s] = l.value);
|
|
1662
1852
|
}
|
|
1663
1853
|
} else if (e.type === "select" && e.labelOptions && e.labelOptions.length > 0) {
|
|
1664
1854
|
const l = e.labelOptions[0];
|
|
1665
|
-
if (
|
|
1666
|
-
if (
|
|
1667
|
-
t[
|
|
1855
|
+
if (i && !(i in this.computedSearchForm) && (t[i] = e.multiple ? [] : ""), s)
|
|
1856
|
+
if (s in this.computedSearchForm)
|
|
1857
|
+
t[s] = this.computedSearchForm[s];
|
|
1668
1858
|
else {
|
|
1669
1859
|
const n = this.getFieldDefault(e, "label");
|
|
1670
|
-
n !== void 0 ? t[
|
|
1860
|
+
n !== void 0 ? t[s] = n : l && l.value !== void 0 && (t[s] = l.value);
|
|
1671
1861
|
}
|
|
1672
1862
|
}
|
|
1673
1863
|
const a = this.getFieldDefault(e, "value");
|
|
1674
|
-
if (
|
|
1864
|
+
if (i && a !== void 0 && !(i in this.computedSearchForm) ? this.isDateType(e.type) && !Array.isArray(a) ? t[i] = [] : e.type === "checkbox" && !Array.isArray(a) ? t[i] = a ? [a] : [] : e.type === "switch" && typeof a != "boolean" ? t[i] = !!a : t[i] = a : i && !(i in this.computedSearchForm) && (e.type === "checkbox" ? t[i] = [] : e.type === "switch" && (t[i] = !1)), this.isDateType(e.type)) {
|
|
1675
1865
|
const l = this.getFieldValue(e, "start"), n = this.getFieldValue(e, "end"), o = this.getFieldDefault(e, "start"), r = this.getFieldDefault(e, "end");
|
|
1676
1866
|
l && o !== void 0 && !(l in this.computedSearchForm) && (t[l] = o), n && r !== void 0 && !(n in this.computedSearchForm) && (t[n] = r);
|
|
1677
1867
|
}
|
|
@@ -1693,30 +1883,30 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1693
1883
|
}
|
|
1694
1884
|
}
|
|
1695
1885
|
};
|
|
1696
|
-
var
|
|
1697
|
-
var e = this,
|
|
1698
|
-
return
|
|
1699
|
-
return [typeof
|
|
1700
|
-
e.$set(e.computedSearchForm, e.getFieldValue(
|
|
1701
|
-
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }) : e._e(),
|
|
1702
|
-
e.$set(e.computedSearchForm, e.getFieldValue(
|
|
1703
|
-
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }) : e._e(),
|
|
1704
|
-
e.$set(e.computedSearchForm, e.getFieldValue(
|
|
1705
|
-
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }) : e._e(),
|
|
1706
|
-
e.$set(e.computedSearchForm, e.getFieldValue(
|
|
1707
|
-
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }) : e._e(),
|
|
1708
|
-
e.$set(e.computedSearchForm, e.getFieldValue(
|
|
1709
|
-
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }) : e._e()], 1)]] : [
|
|
1710
|
-
})] : e._e(),
|
|
1711
|
-
},
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1886
|
+
var kt = function() {
|
|
1887
|
+
var e = this, i = e._self._c;
|
|
1888
|
+
return i("div", { staticClass: "table-search", class: `table-search--${e.isVue2 ? "v2" : "v3"}` }, [i("div", { staticClass: "search-content" }, [e.hasDefaultSlot() ? e._t("default") : e.searchColumns && e.searchColumns.length ? [e._l(e.searchColumns, function(s, a) {
|
|
1889
|
+
return [typeof s == "string" ? i("div", { key: `str-${s}-${a}`, staticClass: "search-item" }, [i("dynamic-slot", { key: s, attrs: { name: `search-${s}`, "slot-props": { searchForm: e.searchForm } } })], 1) : i("div", { key: `obj-${a}`, staticClass: "search-item" }, [s.fields ? [e.hasSearchSlot(`search-${e.getFieldValue(s, "value")}`) ? [i("dynamic-slot", { key: e.getFieldValue(s, "value"), attrs: { name: `search-${e.getFieldValue(s, "value")}`, "slot-props": { searchForm: e.searchForm, col: s } } })] : [i("div", { key: e.getFieldValue(s, "value") || `col-${a}`, staticStyle: { display: "flex" } }, [s.type === "input" ? i("tm-advanced-input", e._b({ attrs: { label: s.label, value: e.computedSearchForm[e.getFieldValue(s, "value")], field: e.computedSearchForm[e.getFieldValue(s, "label")], multiple: s.multiple, labelOptions: s.labelOptions, placeholder: s.placeholder }, on: { "value-change": (l) => e.handleUpdate(s, l, "value"), "field-change": (l) => e.handleUpdate(s, l, "label"), search: e.handleSearch } }, "tm-advanced-input", e.getLayoutProps(s), !1)) : e._e(), e.isDateType(s.type) ? i("tm-advanced-date", e._b({ attrs: { type: s.type, label: s.label, value: e.computedSearchForm[e.getFieldValue(s, "value")], field: e.computedSearchForm[e.getFieldValue(s, "label")], start: e.computedSearchForm[e.getFieldValue(s, "start")], end: e.computedSearchForm[e.getFieldValue(s, "end")], labelOptions: s.labelOptions, "start-placeholder": s.startPlaceholder, "end-placeholder": s.endPlaceholder, placeholder: s.placeholder, "range-separator": s.rangeSeparator, disabled: s.disabled, clearable: s.clearable, readonly: s.readonly, editable: s.editable, align: s.align, "popper-class": s.popperClass, "default-value": s.defaultValue, "default-time": s.defaultTime, shortcuts: s.shortcuts, "past-only": s.pastOnly, format: s.format }, on: { "field-change": (l) => e.handleUpdate(s, l, "label"), "value-change": (l) => e.handleUpdateDate(s, l), "start-change": (l) => e.handleUpdateDate(s, l), "end-change": (l) => e.handleUpdateDate(s, l) } }, "tm-advanced-date", e.getLayoutProps(s), !1)) : e._e(), s.type === "select" ? i("tm-select", e._b({ attrs: { label: s.label, field: e.computedSearchForm[e.getFieldValue(s, "label")], options: s.options, labelOptions: s.labelOptions, placeholder: s.placeholder, multiple: s.multiple, "show-check-all": s.checkAll, "value-on-clear": s.valueOnClear, clearable: s.clearable }, on: { "field-change": (l) => e.handleUpdate(s, l, "label") }, model: { value: e.computedSearchForm[e.getFieldValue(s, "value")], callback: function(l) {
|
|
1890
|
+
e.$set(e.computedSearchForm, e.getFieldValue(s, "value"), l);
|
|
1891
|
+
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }, "tm-select", e.getLayoutProps(s), !1)) : e._e(), s.type === "cascader" ? i("tm-cascader", e._b({ attrs: { label: s.label, options: s.options, labelOptions: s.labelOptions, props: s.props, placeholder: s.placeholder, "show-check-all": s.checkAll }, model: { value: e.computedSearchForm[e.getFieldValue(s, "value")], callback: function(l) {
|
|
1892
|
+
e.$set(e.computedSearchForm, e.getFieldValue(s, "value"), l);
|
|
1893
|
+
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }, "tm-cascader", e.getLayoutProps(s), !1)) : e._e(), s.type === "radio" ? i("tm-radio", e._b({ attrs: { label: s.label, options: s.options, props: s.props }, model: { value: e.computedSearchForm[e.getFieldValue(s, "value")], callback: function(l) {
|
|
1894
|
+
e.$set(e.computedSearchForm, e.getFieldValue(s, "value"), l);
|
|
1895
|
+
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }, "tm-radio", e.getLayoutProps(s), !1)) : e._e(), s.type === "checkbox" ? i("tm-checkbox", e._b({ attrs: { label: s.label, options: s.options, props: s.props }, model: { value: e.computedSearchForm[e.getFieldValue(s, "value")], callback: function(l) {
|
|
1896
|
+
e.$set(e.computedSearchForm, e.getFieldValue(s, "value"), l);
|
|
1897
|
+
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }, "tm-checkbox", e.getLayoutProps(s), !1)) : e._e(), s.type === "switch" ? i("tm-switch", e._b({ attrs: { "active-text": s.activeText, "inactive-text": s.inactiveText, label: s.label, "active-color": s.activeColor, "inactive-color": s.inactiveColor }, model: { value: e.computedSearchForm[e.getFieldValue(s, "value")], callback: function(l) {
|
|
1898
|
+
e.$set(e.computedSearchForm, e.getFieldValue(s, "value"), l);
|
|
1899
|
+
}, expression: "computedSearchForm[getFieldValue(col, 'value')]" } }, "tm-switch", e.getLayoutProps(s), !1)) : e._e()], 1)]] : [i("div", { key: `error-${a}`, staticClass: "search-error-message" }, [e._v(" 缺少 fields 配置,无法渲染此组件 ")])]], 2)];
|
|
1900
|
+
})] : e._e(), i("div", { staticClass: "search-actions" }, [i("el-button", { attrs: { type: "primary", size: e.getDefaultSize() }, on: { click: e.handleSearch } }, [e._v(e._s(e.t("query")))]), i("el-button", { attrs: { size: e.getDefaultSize() }, on: { click: e.handleReset } }, [e._v(e._s(e.t("reset")))])], 1)], 2)]);
|
|
1901
|
+
}, Ot = [], Dt = /* @__PURE__ */ d(
|
|
1902
|
+
Vt,
|
|
1903
|
+
kt,
|
|
1904
|
+
Ot,
|
|
1715
1905
|
!1,
|
|
1716
1906
|
null,
|
|
1717
|
-
"
|
|
1907
|
+
"4c4fd376"
|
|
1718
1908
|
);
|
|
1719
|
-
const U =
|
|
1909
|
+
const U = Dt.exports, At = !0, Rt = {
|
|
1720
1910
|
name: "TablePagination",
|
|
1721
1911
|
props: {
|
|
1722
1912
|
current: {
|
|
@@ -1738,7 +1928,7 @@ const U = St.exports, Tt = !0, $t = {
|
|
|
1738
1928
|
},
|
|
1739
1929
|
data() {
|
|
1740
1930
|
return {
|
|
1741
|
-
isVue2:
|
|
1931
|
+
isVue2: At,
|
|
1742
1932
|
getCompatSize: x
|
|
1743
1933
|
};
|
|
1744
1934
|
},
|
|
@@ -1751,22 +1941,22 @@ const U = St.exports, Tt = !0, $t = {
|
|
|
1751
1941
|
}
|
|
1752
1942
|
}
|
|
1753
1943
|
};
|
|
1754
|
-
var
|
|
1755
|
-
var e = this,
|
|
1756
|
-
return
|
|
1757
|
-
return e.$emit("update:current",
|
|
1758
|
-
}, "update:page-size": function(
|
|
1759
|
-
return e.$emit("update:pageSize",
|
|
1944
|
+
var Mt = function() {
|
|
1945
|
+
var e = this, i = e._self._c;
|
|
1946
|
+
return i("div", { staticClass: "tm-pagination" }, [i("el-pagination", e._g(e._b({ staticStyle: { "text-align": "right" }, attrs: { "current-page": e.current, "page-size": e.pageSize, total: e.total, "page-sizes": [10, 20, 50, 100, 300, 500, 1e3, 2e3], size: e.getCompatSize("mini"), layout: "total, sizes, prev, pager, next, jumper" }, on: { "size-change": e.handleSizeChange, "update:current-page": function(s) {
|
|
1947
|
+
return e.$emit("update:current", s);
|
|
1948
|
+
}, "update:page-size": function(s) {
|
|
1949
|
+
return e.$emit("update:pageSize", s);
|
|
1760
1950
|
}, "current-change": e.handleCurrentChange } }, "el-pagination", e.$attrs, !1), e.isVue2 ? e.$listeners : {}))], 1);
|
|
1761
|
-
},
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1951
|
+
}, Ht = [], Et = /* @__PURE__ */ d(
|
|
1952
|
+
Rt,
|
|
1953
|
+
Mt,
|
|
1954
|
+
Ht,
|
|
1765
1955
|
!1,
|
|
1766
1956
|
null,
|
|
1767
1957
|
"4dbdf6e7"
|
|
1768
1958
|
);
|
|
1769
|
-
const
|
|
1959
|
+
const Wt = Et.exports, It = {
|
|
1770
1960
|
name: "TmTableMenu",
|
|
1771
1961
|
props: {
|
|
1772
1962
|
size: {
|
|
@@ -1775,20 +1965,20 @@ const zt = Ft.exports, kt = {
|
|
|
1775
1965
|
}
|
|
1776
1966
|
}
|
|
1777
1967
|
};
|
|
1778
|
-
var
|
|
1779
|
-
var e = this,
|
|
1780
|
-
return
|
|
1781
|
-
},
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1968
|
+
var Nt = function() {
|
|
1969
|
+
var e = this, i = e._self._c;
|
|
1970
|
+
return i("div", { staticClass: "tm-table-menu", attrs: { size: "small", inline: "" } }, [i("div", { staticClass: "left" }, [e._t("left")], 2), i("div", { staticClass: "right" }, [e._t("right")], 2)]);
|
|
1971
|
+
}, Pt = [], Bt = /* @__PURE__ */ d(
|
|
1972
|
+
It,
|
|
1973
|
+
Nt,
|
|
1974
|
+
Pt,
|
|
1785
1975
|
!1,
|
|
1786
1976
|
null,
|
|
1787
1977
|
"579dd2c3"
|
|
1788
1978
|
);
|
|
1789
|
-
const
|
|
1979
|
+
const jt = Bt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, L = (t, e) => {
|
|
1790
1980
|
t && (t.data || (t.data = {}), t.data.attrs || (t.data.attrs = {}), typeof e == "object" && Object.assign(t.data.attrs, e));
|
|
1791
|
-
},
|
|
1981
|
+
}, w = {
|
|
1792
1982
|
// 默认实现:使用localStorage获取配置
|
|
1793
1983
|
getTableConfig(t) {
|
|
1794
1984
|
try {
|
|
@@ -1816,21 +2006,21 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1816
2006
|
return Promise.reject(e);
|
|
1817
2007
|
}
|
|
1818
2008
|
}
|
|
1819
|
-
},
|
|
1820
|
-
t && (typeof t.getTableConfig == "function" && (
|
|
1821
|
-
}, { t:
|
|
1822
|
-
formatter: (t, e,
|
|
1823
|
-
},
|
|
2009
|
+
}, Ut = (t) => w.getTableConfig(t.key), Jt = (t) => w.setTableConfig(t), Kt = (t) => {
|
|
2010
|
+
t && (typeof t.getTableConfig == "function" && (w.getTableConfig = t.getTableConfig), typeof t.setTableConfig == "function" && (w.setTableConfig = t.setTableConfig));
|
|
2011
|
+
}, { t: qt } = g(), Qt = !0, Gt = !1, Yt = {
|
|
2012
|
+
formatter: (t, e, i, s) => [void 0, null, ""].includes(i) ? "-" : i
|
|
2013
|
+
}, Xt = {
|
|
1824
2014
|
name: "TmColumnConfig",
|
|
1825
2015
|
components: {
|
|
1826
|
-
MoveIcon:
|
|
1827
|
-
FixedLeftIcon:
|
|
1828
|
-
FixedRightIcon:
|
|
1829
|
-
UploadIcon:
|
|
1830
|
-
DownloadIcon:
|
|
1831
|
-
DeleteIcon:
|
|
1832
|
-
MenuIcon:
|
|
1833
|
-
tmEllipsisText:
|
|
2016
|
+
MoveIcon: ce,
|
|
2017
|
+
FixedLeftIcon: pe,
|
|
2018
|
+
FixedRightIcon: fe,
|
|
2019
|
+
UploadIcon: me,
|
|
2020
|
+
DownloadIcon: ge,
|
|
2021
|
+
DeleteIcon: be,
|
|
2022
|
+
MenuIcon: ue,
|
|
2023
|
+
tmEllipsisText: F
|
|
1834
2024
|
},
|
|
1835
2025
|
props: {
|
|
1836
2026
|
// 表格列数据,从$slots.default传入
|
|
@@ -1867,10 +2057,10 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1867
2057
|
},
|
|
1868
2058
|
data() {
|
|
1869
2059
|
return {
|
|
1870
|
-
t:
|
|
1871
|
-
isVue2:
|
|
1872
|
-
isVue3:
|
|
1873
|
-
getDefaultSize:
|
|
2060
|
+
t: qt,
|
|
2061
|
+
isVue2: Qt,
|
|
2062
|
+
isVue3: Gt,
|
|
2063
|
+
getDefaultSize: p,
|
|
1874
2064
|
getCompatSize: x,
|
|
1875
2065
|
buttonType: { type: "text" },
|
|
1876
2066
|
afterOpenDelay: { "open-delay": 300 },
|
|
@@ -1942,9 +2132,9 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1942
2132
|
* 用于兼容旧版JS环境中不支持findLastIndex的情况
|
|
1943
2133
|
*/
|
|
1944
2134
|
findLastIndex(t, e) {
|
|
1945
|
-
for (let
|
|
1946
|
-
if (e(t[
|
|
1947
|
-
return
|
|
2135
|
+
for (let i = t.length - 1; i >= 0; i--)
|
|
2136
|
+
if (e(t[i], i, t))
|
|
2137
|
+
return i;
|
|
1948
2138
|
return -1;
|
|
1949
2139
|
},
|
|
1950
2140
|
/**
|
|
@@ -1963,18 +2153,18 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1963
2153
|
processOriginalColumns() {
|
|
1964
2154
|
const t = this.columns || [];
|
|
1965
2155
|
let e = {};
|
|
1966
|
-
this.defaultColumnsConfig = t.filter((
|
|
1967
|
-
const
|
|
1968
|
-
return !(!
|
|
1969
|
-
}).map((
|
|
1970
|
-
const a = T(
|
|
1971
|
-
|
|
2156
|
+
this.defaultColumnsConfig = t.filter((i) => {
|
|
2157
|
+
const s = T(i);
|
|
2158
|
+
return !(!s.prop || this.ignoredColumnConfigTypes.includes(s.type));
|
|
2159
|
+
}).map((i, s) => {
|
|
2160
|
+
const a = T(i), l = u(u({}, Yt), a);
|
|
2161
|
+
L(i, l), a.prop && (e[a.prop] = i);
|
|
1972
2162
|
const n = a.hasOwnProperty("visible") ? a.visible !== !1 : !0;
|
|
1973
2163
|
return {
|
|
1974
2164
|
prop: a.prop,
|
|
1975
2165
|
// label: attrs.label, // 移除label,避免国际化导致比较不一致
|
|
1976
2166
|
fixed: a.fixed || "",
|
|
1977
|
-
sort:
|
|
2167
|
+
sort: s,
|
|
1978
2168
|
cancellable: a.hasOwnProperty("cancellable") ? a.cancellable : !0,
|
|
1979
2169
|
visible: n
|
|
1980
2170
|
};
|
|
@@ -1982,13 +2172,13 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
1982
2172
|
},
|
|
1983
2173
|
// 加载列配置
|
|
1984
2174
|
loadColumnConfig() {
|
|
1985
|
-
|
|
2175
|
+
Ut({
|
|
1986
2176
|
key: this.computedTableKey
|
|
1987
2177
|
}).then((t) => {
|
|
1988
|
-
var
|
|
2178
|
+
var i;
|
|
1989
2179
|
if (t.data.code !== 200) return;
|
|
1990
|
-
let e = JSON.parse(((
|
|
1991
|
-
e.columnsConfig && JSON.stringify(this.defaultColumnsConfig) === JSON.stringify(e.defaultColumnsConfig) ? this.tableColumns = e.columnsConfig.map((
|
|
2180
|
+
let e = JSON.parse(((i = t.data) == null ? void 0 : i.data) || null) || {};
|
|
2181
|
+
e.columnsConfig && JSON.stringify(this.defaultColumnsConfig) === JSON.stringify(e.defaultColumnsConfig) ? this.tableColumns = e.columnsConfig.map((s) => u({}, s)) : this.tableColumns = this.defaultColumnsConfig.map((s) => u({}, s)), this.processedColumns = this.applyColumnConfig(this.tableColumns), this.isConfigLoaded = !0, this.$emit("complete", {
|
|
1992
2182
|
columns: this.processedColumns,
|
|
1993
2183
|
isInitialLoad: !0
|
|
1994
2184
|
});
|
|
@@ -2000,30 +2190,30 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2000
2190
|
});
|
|
2001
2191
|
},
|
|
2002
2192
|
applyColumnConfig(t, e = !1) {
|
|
2003
|
-
let
|
|
2193
|
+
let i = this.columns.filter((a) => {
|
|
2004
2194
|
const l = T(a);
|
|
2005
2195
|
return this.ignoredColumnConfigTypes.includes(l.type);
|
|
2006
|
-
}),
|
|
2196
|
+
}), s = [];
|
|
2007
2197
|
return [...t].sort((a, l) => {
|
|
2008
2198
|
const n = a.sort !== void 0 ? a.sort : 1 / 0, o = l.sort !== void 0 ? l.sort : 1 / 0;
|
|
2009
2199
|
return n - o;
|
|
2010
2200
|
}).forEach((a) => {
|
|
2011
2201
|
if (a.prop) {
|
|
2012
2202
|
let l = this.columnMap[a.prop];
|
|
2013
|
-
l && (
|
|
2203
|
+
l && (L(l, {
|
|
2014
2204
|
fixed: a.fixed || void 0,
|
|
2015
2205
|
visible: a.visible
|
|
2016
|
-
}), (!e && a.visible || e) &&
|
|
2206
|
+
}), (!e && a.visible || e) && s.push(l));
|
|
2017
2207
|
}
|
|
2018
|
-
}),
|
|
2019
|
-
|
|
2020
|
-
}), [...
|
|
2208
|
+
}), i.forEach((a) => {
|
|
2209
|
+
L(a, { visible: !0 });
|
|
2210
|
+
}), [...i, ...s];
|
|
2021
2211
|
},
|
|
2022
2212
|
crateSortable() {
|
|
2023
2213
|
const t = this.$refs.sortListRef;
|
|
2024
2214
|
if (!t) return;
|
|
2025
2215
|
this.sortable && (this.sortable.destroy(), this.sortable = null);
|
|
2026
|
-
const e = new
|
|
2216
|
+
const e = new y(t, {
|
|
2027
2217
|
ghostClass: "blue-background-class",
|
|
2028
2218
|
animation: 150,
|
|
2029
2219
|
// 动画持续时间,毫秒
|
|
@@ -2039,30 +2229,30 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2039
2229
|
// 当克隆元素隐藏时删除它
|
|
2040
2230
|
group: "columns",
|
|
2041
2231
|
dragClass: "sortable-drag",
|
|
2042
|
-
onStart: ({ item:
|
|
2043
|
-
const
|
|
2044
|
-
(l) => l.prop ===
|
|
2232
|
+
onStart: ({ item: i }) => {
|
|
2233
|
+
const s = i.getAttribute("data-prop"), a = this.sortedTableColumns.find(
|
|
2234
|
+
(l) => l.prop === s
|
|
2045
2235
|
);
|
|
2046
|
-
this.isDraggingFrozen = a && a.fixed === "left", this.isDraggingFrozenRight = a && a.fixed === "right", this.draggedItemIndex = Array.from(t.children).indexOf(
|
|
2236
|
+
this.isDraggingFrozen = a && a.fixed === "left", this.isDraggingFrozenRight = a && a.fixed === "right", this.draggedItemIndex = Array.from(t.children).indexOf(i), i.classList.add("sortable-drag");
|
|
2047
2237
|
},
|
|
2048
|
-
onMove: (
|
|
2049
|
-
const { target:
|
|
2050
|
-
if (!
|
|
2238
|
+
onMove: (i) => {
|
|
2239
|
+
const { target: s, related: a } = i;
|
|
2240
|
+
if (!s || !a)
|
|
2051
2241
|
return !1;
|
|
2052
|
-
const l = a ? a.getAttribute("data-prop") : null, n = l ? this.sortedTableColumns.find((
|
|
2053
|
-
return this.isDraggingFrozen && !o || this.isDraggingFrozenRight && !r || !this.isDraggingFrozen && !this.isDraggingFrozenRight && (o || r) ? (
|
|
2054
|
-
|
|
2242
|
+
const l = a ? a.getAttribute("data-prop") : null, n = l ? this.sortedTableColumns.find((c) => c.prop === l) : null, o = n && n.fixed === "left", r = n && n.fixed === "right";
|
|
2243
|
+
return this.isDraggingFrozen && !o || this.isDraggingFrozenRight && !r || !this.isDraggingFrozen && !this.isDraggingFrozenRight && (o || r) ? (s.classList.add("no-drop-zone"), !1) : (document.querySelectorAll(".no-drop-zone").forEach((c) => {
|
|
2244
|
+
c.classList.remove("no-drop-zone");
|
|
2055
2245
|
}), !0);
|
|
2056
2246
|
},
|
|
2057
|
-
onEnd: ({ item:
|
|
2058
|
-
if (
|
|
2247
|
+
onEnd: ({ item: i, newIndex: s, oldIndex: a }) => {
|
|
2248
|
+
if (s === void 0 || a === void 0 || s < 0 || a < 0 || s >= this.sortedTableColumns.length || a >= this.sortedTableColumns.length)
|
|
2059
2249
|
return;
|
|
2060
|
-
document.querySelectorAll(".no-drop-zone").forEach((
|
|
2061
|
-
|
|
2062
|
-
}),
|
|
2063
|
-
const l = this.sortedTableColumns[a], n = l.fixed === "left", o = l.fixed === "right", r =
|
|
2064
|
-
let
|
|
2065
|
-
if (n ? (r && r.fixed !== "left" ||
|
|
2250
|
+
document.querySelectorAll(".no-drop-zone").forEach((_) => {
|
|
2251
|
+
_.classList.remove("no-drop-zone");
|
|
2252
|
+
}), i.classList.remove("sortable-drag");
|
|
2253
|
+
const l = this.sortedTableColumns[a], n = l.fixed === "left", o = l.fixed === "right", r = s > 0 ? this.sortedTableColumns[s - 1] : null, c = s < this.sortedTableColumns.length - 1 ? this.sortedTableColumns[s + 1] : null;
|
|
2254
|
+
let b = !1;
|
|
2255
|
+
if (n ? (r && r.fixed !== "left" || c && c.fixed === "right") && (b = !0) : o ? (r && r.fixed !== "right" || c && c.fixed !== "right") && (b = !0) : (r && r.fixed === "right" || c && c.fixed === "left") && (b = !0), b) {
|
|
2066
2256
|
this.rollbackSort();
|
|
2067
2257
|
return;
|
|
2068
2258
|
}
|
|
@@ -2077,8 +2267,8 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2077
2267
|
updateSortAfterDrag() {
|
|
2078
2268
|
const t = this.$refs.sortListRef;
|
|
2079
2269
|
if (!t) return;
|
|
2080
|
-
Array.from(t.children || []).filter((
|
|
2081
|
-
this.sortedTableColumns.some((a) => a.prop ===
|
|
2270
|
+
Array.from(t.children || []).filter((i) => i && i.dataset && i.dataset.prop).map((i) => i.dataset.prop).forEach((i, s) => {
|
|
2271
|
+
this.sortedTableColumns.some((a) => a.prop === i ? (a.sort = s, !0) : !1);
|
|
2082
2272
|
}), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns);
|
|
2083
2273
|
},
|
|
2084
2274
|
// 移除了handleSearch方法,改用计算属性filteredSortedTableColumns
|
|
@@ -2117,10 +2307,10 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2117
2307
|
document.removeEventListener("mouseup", window.sortableGlobalMouseUp), document.removeEventListener(
|
|
2118
2308
|
"mousemove",
|
|
2119
2309
|
window.sortableGlobalMouseMove
|
|
2120
|
-
), typeof
|
|
2310
|
+
), typeof y != "undefined" && y.utils && (document.removeEventListener(
|
|
2121
2311
|
"mousemove",
|
|
2122
|
-
|
|
2123
|
-
), document.removeEventListener("mouseup",
|
|
2312
|
+
y.utils.throttleCall
|
|
2313
|
+
), document.removeEventListener("mouseup", y.utils.throttleCall));
|
|
2124
2314
|
} catch (t) {
|
|
2125
2315
|
}
|
|
2126
2316
|
},
|
|
@@ -2139,92 +2329,92 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2139
2329
|
canMoveTop(t, e) {
|
|
2140
2330
|
if (e === 0) return !1;
|
|
2141
2331
|
if (t.fixed === "left") {
|
|
2142
|
-
const
|
|
2143
|
-
return
|
|
2332
|
+
const i = this.sortedTableColumns[e - 1];
|
|
2333
|
+
return i && i.fixed === "left";
|
|
2144
2334
|
}
|
|
2145
2335
|
if (!t.fixed) {
|
|
2146
|
-
const
|
|
2147
|
-
return
|
|
2336
|
+
const i = this.sortedTableColumns[e - 1];
|
|
2337
|
+
return i && i.fixed === "left" ? !1 : i && !i.fixed;
|
|
2148
2338
|
}
|
|
2149
2339
|
return t.fixed === "right";
|
|
2150
2340
|
},
|
|
2151
2341
|
// 修改置顶方法,确保右侧固定列置顶时会取消固定
|
|
2152
2342
|
moveTop(t, e) {
|
|
2153
|
-
const
|
|
2343
|
+
const i = this.sortedTableColumns, s = t.prop;
|
|
2154
2344
|
if (t.fixed === "right" && (t.fixed = ""), t.fixed === "left")
|
|
2155
|
-
|
|
2345
|
+
i.unshift(i.splice(e, 1)[0]);
|
|
2156
2346
|
else {
|
|
2157
2347
|
const a = this.findLastIndex(
|
|
2158
2348
|
this.sortedTableColumns,
|
|
2159
2349
|
(l) => l.fixed === "left"
|
|
2160
2350
|
);
|
|
2161
|
-
|
|
2351
|
+
i.splice(
|
|
2162
2352
|
a + 1,
|
|
2163
2353
|
0,
|
|
2164
|
-
|
|
2354
|
+
i.splice(e, 1)[0]
|
|
2165
2355
|
);
|
|
2166
2356
|
}
|
|
2167
2357
|
this.updateSortValues(), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns), this.$nextTick(() => {
|
|
2168
2358
|
const a = this.$refs.sortListRef;
|
|
2169
2359
|
if (a) {
|
|
2170
2360
|
const l = Array.from(a.children).find(
|
|
2171
|
-
(n) => n.dataset && n.dataset.prop ===
|
|
2361
|
+
(n) => n.dataset && n.dataset.prop === s
|
|
2172
2362
|
);
|
|
2173
2363
|
l && l.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
2174
2364
|
}
|
|
2175
2365
|
});
|
|
2176
2366
|
},
|
|
2177
2367
|
frozenLeftHandle(t) {
|
|
2178
|
-
const e = this.sortedTableColumns,
|
|
2179
|
-
if (
|
|
2180
|
-
const
|
|
2368
|
+
const e = this.sortedTableColumns, i = e.splice(t, 1)[0];
|
|
2369
|
+
if (i.fixed = i.fixed === "left" ? "" : "left", i.fixed === "left") {
|
|
2370
|
+
const s = this.findLastIndex(
|
|
2181
2371
|
this.sortedTableColumns,
|
|
2182
2372
|
(a) => a.fixed === "left"
|
|
2183
2373
|
);
|
|
2184
|
-
e.splice(
|
|
2374
|
+
e.splice(s + 1, 0, i);
|
|
2185
2375
|
} else {
|
|
2186
|
-
const
|
|
2376
|
+
const s = this.findLastIndex(
|
|
2187
2377
|
this.sortedTableColumns,
|
|
2188
2378
|
(a) => a.fixed === "left"
|
|
2189
2379
|
);
|
|
2190
|
-
e.splice(
|
|
2380
|
+
e.splice(s + 1, 0, i);
|
|
2191
2381
|
}
|
|
2192
2382
|
this.updateSortValues(), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns);
|
|
2193
2383
|
},
|
|
2194
2384
|
frozenRightHandle(t) {
|
|
2195
|
-
const e = this.sortedTableColumns,
|
|
2196
|
-
if (
|
|
2197
|
-
const
|
|
2385
|
+
const e = this.sortedTableColumns, i = e.splice(t, 1)[0];
|
|
2386
|
+
if (i.fixed = i.fixed === "right" ? "" : "right", i.fixed === "right") {
|
|
2387
|
+
const s = e.findIndex(
|
|
2198
2388
|
(a) => a.fixed === "right"
|
|
2199
2389
|
);
|
|
2200
|
-
|
|
2390
|
+
s === -1 ? e.push(i) : e.splice(s, 0, i);
|
|
2201
2391
|
} else {
|
|
2202
|
-
const
|
|
2392
|
+
const s = e.findIndex(
|
|
2203
2393
|
(a) => a.fixed === "right"
|
|
2204
2394
|
);
|
|
2205
|
-
|
|
2395
|
+
s === -1 ? e.push(i) : e.splice(s, 0, i);
|
|
2206
2396
|
}
|
|
2207
2397
|
this.updateSortValues(), this.columnsCopy = JSON.parse(JSON.stringify(this.sortedTableColumns)), this.$emit("on-sort-change", this.sortedTableColumns);
|
|
2208
2398
|
},
|
|
2209
2399
|
onSave() {
|
|
2210
2400
|
var e;
|
|
2211
2401
|
this.updateSortValues();
|
|
2212
|
-
const t = (e = this.tableColumns) == null ? void 0 : e.map((
|
|
2213
|
-
const
|
|
2214
|
-
(o) => o.prop ===
|
|
2402
|
+
const t = (e = this.tableColumns) == null ? void 0 : e.map((i) => {
|
|
2403
|
+
const s = this.sortedTableColumns.find(
|
|
2404
|
+
(o) => o.prop === i.prop
|
|
2215
2405
|
);
|
|
2216
|
-
|
|
2217
|
-
const n =
|
|
2218
|
-
return
|
|
2406
|
+
s && (i.sort = s.sort, i.fixed = s.fixed, i.visible = s.visible);
|
|
2407
|
+
const n = i, { label: a } = n;
|
|
2408
|
+
return R(n, ["label"]);
|
|
2219
2409
|
});
|
|
2220
|
-
|
|
2410
|
+
Jt({
|
|
2221
2411
|
key: this.computedTableKey,
|
|
2222
2412
|
info: JSON.stringify({
|
|
2223
2413
|
columnsConfig: t,
|
|
2224
2414
|
defaultColumnsConfig: this.defaultColumnsConfig
|
|
2225
2415
|
})
|
|
2226
|
-
}).then((
|
|
2227
|
-
|
|
2416
|
+
}).then((i) => {
|
|
2417
|
+
i.data.code === 200 && (this.processedColumns = this.applyColumnConfig(t, !0), this.$emit("complete", {
|
|
2228
2418
|
columns: this.processedColumns,
|
|
2229
2419
|
isInitialLoad: !1
|
|
2230
2420
|
}), this.$message.success(this.t("saveSuccess")), this.popoverVisible = !1);
|
|
@@ -2244,58 +2434,58 @@ const Mt = Dt.exports, T = (t) => t ? t.data && t.data.attrs || {} : {}, F = (t,
|
|
|
2244
2434
|
beforeDestroy() {
|
|
2245
2435
|
this.sortable && (this.sortable.destroy(), this.sortable = null);
|
|
2246
2436
|
try {
|
|
2247
|
-
document.removeEventListener("mouseup", window.sortableGlobalMouseUp), document.removeEventListener("mousemove", window.sortableGlobalMouseMove), typeof
|
|
2437
|
+
document.removeEventListener("mouseup", window.sortableGlobalMouseUp), document.removeEventListener("mousemove", window.sortableGlobalMouseMove), typeof y != "undefined" && y.utils && (document.removeEventListener("mousemove", y.utils.throttleCall), document.removeEventListener("mouseup", y.utils.throttleCall));
|
|
2248
2438
|
} catch (t) {
|
|
2249
2439
|
}
|
|
2250
2440
|
}
|
|
2251
2441
|
};
|
|
2252
|
-
var
|
|
2253
|
-
var e = this,
|
|
2254
|
-
return
|
|
2255
|
-
return [
|
|
2442
|
+
var Zt = function() {
|
|
2443
|
+
var e = this, i = e._self._c;
|
|
2444
|
+
return i("el-popover", e._g(e._b({ attrs: { "popper-class": "column-config-popover", width: 680, "show-arrow": !1, placement: e.placement, trigger: "click" }, on: { show: e.handlePopoverShow, hide: e.handlePopoverHide }, scopedSlots: e._u([{ key: "reference", fn: function() {
|
|
2445
|
+
return [i("div", { staticStyle: { display: "inline-block", "margin-left": "10px" } }, [i("el-tooltip", e._b({ attrs: { content: e.t("columnSetting"), placement: "top" } }, "el-tooltip", e.afterOpenDelay, !1), [i("el-button", { ref: "operationRef", attrs: { size: e.getDefaultSize(), circle: "" } }, [i("MenuIcon")], 1)], 1)], 1)];
|
|
2256
2446
|
}, proxy: !0 }]) }, "el-popover", {
|
|
2257
2447
|
[e.isVue3 ? "visible" : "value"]: e.popoverVisible
|
|
2258
2448
|
}, !1), {
|
|
2259
2449
|
[e.isVue3 ? "update:visible" : "input"]: e.handleVisibleChange
|
|
2260
|
-
}), [e.popoverVisible ?
|
|
2261
|
-
return [
|
|
2262
|
-
e.$set(
|
|
2263
|
-
}, expression: "col.visible" } }, [
|
|
2264
|
-
})], 2)])]),
|
|
2265
|
-
e.keyWord =
|
|
2266
|
-
}, expression: "keyWord" } })], 1), e.showFixedLimitTips ?
|
|
2267
|
-
return
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
], attrs: { "data-prop":
|
|
2272
|
-
|
|
2273
|
-
} } }, "el-button", e.buttonType, !1), [
|
|
2274
|
-
return e.moveTop(
|
|
2275
|
-
} } }, "el-button", e.buttonType, !1), [
|
|
2450
|
+
}), [e.popoverVisible ? i("div", { staticClass: "container" }, [i("div", { staticClass: "main-container" }, [i("div", { staticClass: "left-content" }, [i("div", { staticClass: "title" }, [i("span", [e._v(e._s(e.t("SelectableFields")) + "(" + e._s(e.tableColumns.length) + ")")]), i("el-button", e._b({ staticStyle: { "margin-left": "10px" }, on: { click: e.handleSelectAll } }, "el-button", e.buttonType, !1), [e._v(e._s(e.t("all")))])], 1), i("div", { staticClass: "option-list" }, [i("div", { staticStyle: { height: "100%", "overflow-y": "auto" } }, [e._l(e.tableColumns, function(s, a) {
|
|
2451
|
+
return [s.prop ? i("div", { key: a + s.prop, staticStyle: { width: "110px", display: "inline-block" } }, [i("el-checkbox", { staticClass: "el-checkbox", attrs: { disabled: !s.cancellable, label: s.prop, value: s.prop }, model: { value: s.visible, callback: function(l) {
|
|
2452
|
+
e.$set(s, "visible", l);
|
|
2453
|
+
}, expression: "col.visible" } }, [i("TmEllipsisText", { attrs: { width: "80px", text: e.getColumnLabel(s.prop) } })], 1)], 1) : e._e()];
|
|
2454
|
+
})], 2)])]), i("div", { staticClass: "right-content" }, [i("div", { staticClass: "search-box" }, [i("el-input", { staticClass: "search-input", attrs: { size: e.getCompatSize("small"), clearable: "", placeholder: e.t("search") }, model: { value: e.keyWord, callback: function(s) {
|
|
2455
|
+
e.keyWord = s;
|
|
2456
|
+
}, expression: "keyWord" } })], 1), e.showFixedLimitTips ? i("div", { staticClass: "tips" }) : e._e(), i("div", { ref: "sortListRef", staticClass: "sort-list" }, e._l(e.filteredSortedTableColumns, function(s, a) {
|
|
2457
|
+
return i("div", { key: s.prop, staticClass: "sort-item-wrapper", class: [
|
|
2458
|
+
s.fixed === "left" ? "frozen" : "",
|
|
2459
|
+
s.fixed === "right" ? "frozenRight" : "",
|
|
2460
|
+
s.fixed ? "" : "noFrozen"
|
|
2461
|
+
], attrs: { "data-prop": s.prop } }, [s.visible ? i("div", { staticClass: "sort-item" }, [i("div", { staticClass: "row-title" }, [i("MoveIcon", { staticStyle: { "flex-shrink": "0" } }), i("TmEllipsisText", { attrs: { text: e.getColumnLabel(s.prop) } })], 1), i("div", { staticClass: "operation-btns" }, [s.cancellable ? i("el-tooltip", e._b({ attrs: { content: e.t("cancel"), placement: "top" } }, "el-tooltip", e.afterOpenDelay, !1), [i("el-button", e._b({ staticClass: "iconfont-button delete-button", attrs: { size: e.getCompatSize("mini") }, on: { click: function(l) {
|
|
2462
|
+
s.visible = !1;
|
|
2463
|
+
} } }, "el-button", e.buttonType, !1), [i("DeleteIcon")], 1)], 1) : e._e(), e.canMoveTop(s, a) ? i("el-tooltip", e._b({ attrs: { content: e.t("top"), placement: "top" } }, "el-tooltip", e.afterOpenDelay, !1), [i("el-button", e._b({ staticClass: "iconfont-button top-button", attrs: { size: e.getCompatSize("mini") }, on: { click: function(l) {
|
|
2464
|
+
return e.moveTop(s, a);
|
|
2465
|
+
} } }, "el-button", e.buttonType, !1), [i("UploadIcon")], 1)], 1) : e._e(), s.fixed !== "right" ? i("el-tooltip", e._b({ attrs: { content: s.fixed === "left" ? e.t("cancelLeftFixed") : e.t("leftFixed"), placement: "top" } }, "el-tooltip", e.afterOpenDelay, !1), [i("el-button", e._b({ staticClass: "iconfont-button left-fixed-btn", class: { "active-fixed": s.fixed === "left" }, attrs: { size: e.getCompatSize("mini"), disabled: s.fixed !== "left" && e.isThanMaxFrozen }, on: { click: function(l) {
|
|
2276
2466
|
return e.frozenLeftHandle(a);
|
|
2277
|
-
} } }, "el-button", e.buttonType, !1), [
|
|
2467
|
+
} } }, "el-button", e.buttonType, !1), [i("FixedLeftIcon")], 1)], 1) : e._e(), s.fixed !== "left" ? i("el-tooltip", e._b({ attrs: { content: s.fixed === "right" ? e.t("cancelRightFixed") : e.t("rightFixed"), placement: "top" } }, "el-tooltip", e.afterOpenDelay, !1), [i("el-button", e._b({ staticClass: "iconfont-button right-fixed-btn", class: { "active-fixed": s.fixed === "right" }, attrs: { size: e.getCompatSize("mini"), disabled: s.fixed !== "right" && e.isThanMaxRightFrozen }, on: { click: function(l) {
|
|
2278
2468
|
return e.frozenRightHandle(a);
|
|
2279
|
-
} } }, "el-button", e.buttonType, !1), [
|
|
2280
|
-
}), 0)])]),
|
|
2469
|
+
} } }, "el-button", e.buttonType, !1), [i("FixedRightIcon")], 1)], 1) : e._e()], 1)]) : e._e()]);
|
|
2470
|
+
}), 0)])]), i("div", { staticClass: "footer" }, [i("div", { staticClass: "footer-left" }, [i("el-button", { attrs: { size: e.getCompatSize("mini") }, on: { click: e.handleRestoreDefault } }, [e._v(e._s(e.t("restoreDefault")))])], 1), i("div", { staticClass: "footer-right" }, [i("el-button", { attrs: { size: e.getCompatSize("mini") }, on: { click: function(s) {
|
|
2281
2471
|
e.popoverVisible = !1;
|
|
2282
|
-
} } }, [e._v(e._s(e.t("cancel")))]),
|
|
2283
|
-
},
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2472
|
+
} } }, [e._v(e._s(e.t("cancel")))]), i("el-button", { attrs: { size: e.getCompatSize("mini"), type: "primary" }, on: { click: e.onSave } }, [e._v(e._s(e.t("saveAndApply")))])], 1)])]) : e._e()]);
|
|
2473
|
+
}, ei = [], ti = /* @__PURE__ */ d(
|
|
2474
|
+
Xt,
|
|
2475
|
+
Zt,
|
|
2476
|
+
ei,
|
|
2287
2477
|
!1,
|
|
2288
2478
|
null,
|
|
2289
2479
|
"127cbd33"
|
|
2290
2480
|
);
|
|
2291
|
-
const
|
|
2481
|
+
const ii = ti.exports, si = !0, ai = !1, li = {
|
|
2292
2482
|
name: "TmTable",
|
|
2293
2483
|
components: {
|
|
2294
2484
|
TableSearch: U,
|
|
2295
|
-
TablePagination:
|
|
2296
|
-
TableMenu:
|
|
2297
|
-
ColumnConfig:
|
|
2298
|
-
RefreshIcon:
|
|
2485
|
+
TablePagination: Wt,
|
|
2486
|
+
TableMenu: jt,
|
|
2487
|
+
ColumnConfig: ii,
|
|
2488
|
+
RefreshIcon: de,
|
|
2299
2489
|
// 用于渲染VNode的组件
|
|
2300
2490
|
ColumnRenderer: {
|
|
2301
2491
|
props: ["vnode"],
|
|
@@ -2385,15 +2575,29 @@ const Jt = jt.exports, Kt = !0, Qt = !1, qt = {
|
|
|
2385
2575
|
searchForm: {
|
|
2386
2576
|
type: Object,
|
|
2387
2577
|
default: () => ({})
|
|
2578
|
+
},
|
|
2579
|
+
// FormItemLayout 全局配置参数
|
|
2580
|
+
labelWidth: {
|
|
2581
|
+
type: [String, Number],
|
|
2582
|
+
default: void 0
|
|
2583
|
+
},
|
|
2584
|
+
inputWidth: {
|
|
2585
|
+
type: [String, Number],
|
|
2586
|
+
default: void 0
|
|
2587
|
+
},
|
|
2588
|
+
direction: {
|
|
2589
|
+
type: String,
|
|
2590
|
+
default: void 0,
|
|
2591
|
+
validator: (t) => !t || ["horizontal", "vertical"].includes(t)
|
|
2388
2592
|
}
|
|
2389
2593
|
},
|
|
2390
2594
|
data() {
|
|
2391
2595
|
return {
|
|
2392
|
-
getDefaultSize:
|
|
2596
|
+
getDefaultSize: p,
|
|
2393
2597
|
getCompatSize: x,
|
|
2394
|
-
isVue3:
|
|
2395
|
-
isVue2:
|
|
2396
|
-
t:
|
|
2598
|
+
isVue3: ai,
|
|
2599
|
+
isVue2: si,
|
|
2600
|
+
t: g().t,
|
|
2397
2601
|
tableData: [],
|
|
2398
2602
|
tableLoading: !1,
|
|
2399
2603
|
columnsLoading: !1,
|
|
@@ -2483,10 +2687,10 @@ const Jt = jt.exports, Kt = !0, Qt = !1, qt = {
|
|
|
2483
2687
|
current: this.paginationInfo.current
|
|
2484
2688
|
},
|
|
2485
2689
|
params: this.searchForm
|
|
2486
|
-
}), { list: e, total:
|
|
2690
|
+
}), { list: e, total: i, pageSize: s, current: a } = t;
|
|
2487
2691
|
this.tableData = e;
|
|
2488
2692
|
let l = u({}, this.paginationInfo);
|
|
2489
|
-
|
|
2693
|
+
i !== void 0 && (l.total = i), a !== void 0 && (l.current = a), s !== void 0 && (l.pageSize = s), this.paginationInfo = l;
|
|
2490
2694
|
} catch (t) {
|
|
2491
2695
|
} finally {
|
|
2492
2696
|
this.tableLoading = !1;
|
|
@@ -2498,8 +2702,8 @@ const Jt = jt.exports, Kt = !0, Qt = !1, qt = {
|
|
|
2498
2702
|
this.isAutoHeight() ? this.$nextTick(() => {
|
|
2499
2703
|
const t = this.$refs.table, e = this.$refs.tmPagination;
|
|
2500
2704
|
if (!t) return;
|
|
2501
|
-
const
|
|
2502
|
-
this.tableHeight = document.documentElement.clientHeight -
|
|
2705
|
+
const i = t.$el, s = e && e.$el && e.$el.offsetHeight || 0;
|
|
2706
|
+
this.tableHeight = document.documentElement.clientHeight - i.offsetTop - s - this.calcHeight;
|
|
2503
2707
|
}) : this.tableHeight = this.height, this.refreshTable();
|
|
2504
2708
|
},
|
|
2505
2709
|
// 处理查询
|
|
@@ -2534,24 +2738,24 @@ const Jt = jt.exports, Kt = !0, Qt = !1, qt = {
|
|
|
2534
2738
|
}
|
|
2535
2739
|
}
|
|
2536
2740
|
};
|
|
2537
|
-
var
|
|
2538
|
-
var e = this,
|
|
2539
|
-
return
|
|
2741
|
+
var ni = function() {
|
|
2742
|
+
var e = this, i = e._self._c;
|
|
2743
|
+
return i("div", { ref: "tablePage", staticClass: "tm-table" }, [e.searchColumns && e.searchColumns.length > 0 ? i("table-search", { ref: "search", attrs: { disabled: e.pageLoading, "search-columns": e.searchColumns, "search-form": e.searchForm, "label-width": e.labelWidth, "input-width": e.inputWidth, direction: e.direction }, on: { search: e.search, reset: e.reset, "update:search-form": e.handleUpdateSearchForm } }, [e._t("search")], 2) : e._e(), e._t("between-search-menu"), e.showMenu ? i("table-menu", { scopedSlots: e._u([{ key: "left", fn: function() {
|
|
2540
2744
|
return [e._t("menu-left")];
|
|
2541
2745
|
}, proxy: !0 }, { key: "right", fn: function() {
|
|
2542
|
-
return [e._t("menu-right"), e.refreshButton && typeof e.data == "function" ?
|
|
2543
|
-
}, proxy: !0 }], null, !0) }) : e._e(),
|
|
2544
|
-
return
|
|
2545
|
-
}), 1), e.computedShowPagination ?
|
|
2546
|
-
},
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2746
|
+
return [e._t("menu-right"), e.refreshButton && typeof e.data == "function" ? i("el-tooltip", e._b({ attrs: { content: e.t("refresh"), placement: "top" } }, "el-tooltip", e.afterOpenDelay, !1), [i("el-button", { attrs: { circle: "", size: e.getDefaultSize() }, on: { click: e.handleRefresh } }, [i("RefreshIcon")], 1)], 1) : e._e(), e.columnSettingButton ? i("ColumnConfig", { attrs: { maxFixedLeftQuantity: e.maxFixedLeftQuantity, maxFixedRightQuantity: e.maxFixedRightQuantity, tableKey: e.computedTableKey, columns: e.originalColumns }, on: { complete: e.handleColumnConfigComplete } }) : e._e()];
|
|
2747
|
+
}, proxy: !0 }], null, !0) }) : e._e(), e._t("between-menu-table"), i("el-table", e._g(e._b({ directives: [{ name: "loading", rawName: "v-loading", value: e.pageLoading, expression: "pageLoading" }], key: e.tableReload, ref: "table", attrs: { data: e.tableData, height: e.tableHeight, size: e.getCompatSize("mini") }, on: { "selection-change": e.handleSelectionChange } }, "el-table", m(u({}, e.$attrs), { border: e.border }), !1), e.isVue2 ? e.$listeners : {}), e._l(e.displayColumns, function(s) {
|
|
2748
|
+
return i("columnRenderer", { key: e.isVue3 ? s.id : s.data.attrs.prop, attrs: { vnode: s } });
|
|
2749
|
+
}), 1), e._t("between-table-pagination"), e.computedShowPagination ? i("table-pagination", { ref: "tmPagination", attrs: { "page-size": e.paginationInfo.pageSize, current: e.paginationInfo.current, total: e.paginationInfo.total, disabled: e.tableLoading }, on: { "size-change": e.handleSizeChange, "current-change": e.handleCurrentChange } }) : e._e(), e._t("after-pagination")], 2);
|
|
2750
|
+
}, ri = [], oi = /* @__PURE__ */ d(
|
|
2751
|
+
li,
|
|
2752
|
+
ni,
|
|
2753
|
+
ri,
|
|
2550
2754
|
!1,
|
|
2551
2755
|
null,
|
|
2552
|
-
"
|
|
2756
|
+
"5c3f3820"
|
|
2553
2757
|
);
|
|
2554
|
-
const
|
|
2758
|
+
const J = oi.exports, ui = !0, di = !1, ci = {
|
|
2555
2759
|
name: "TmTableColumn",
|
|
2556
2760
|
inheritAttrs: !1,
|
|
2557
2761
|
computed: {
|
|
@@ -2564,8 +2768,8 @@ const j = Xt.exports, Zt = !0, es = !1, ts = {
|
|
|
2564
2768
|
},
|
|
2565
2769
|
data() {
|
|
2566
2770
|
return {
|
|
2567
|
-
isVue2:
|
|
2568
|
-
isVue3:
|
|
2771
|
+
isVue2: ui,
|
|
2772
|
+
isVue3: di
|
|
2569
2773
|
};
|
|
2570
2774
|
},
|
|
2571
2775
|
created() {
|
|
@@ -2575,22 +2779,22 @@ const j = Xt.exports, Zt = !0, es = !1, ts = {
|
|
|
2575
2779
|
});
|
|
2576
2780
|
}
|
|
2577
2781
|
};
|
|
2578
|
-
var
|
|
2579
|
-
var e = this,
|
|
2580
|
-
return e.isVisible ?
|
|
2782
|
+
var hi = function() {
|
|
2783
|
+
var e = this, i = e._self._c;
|
|
2784
|
+
return e.isVisible ? i("el-table-column", e._g(e._b({ scopedSlots: e._u([e._l(e.slots, function(s, a) {
|
|
2581
2785
|
return { key: a, fn: function(l) {
|
|
2582
2786
|
return [e._t(a, null, null, l)];
|
|
2583
2787
|
} };
|
|
2584
2788
|
})], null, !0) }, "el-table-column", e.$attrs, !1), e.isVue2 ? e.$listeners : {})) : e._e();
|
|
2585
|
-
},
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2789
|
+
}, pi = [], fi = /* @__PURE__ */ d(
|
|
2790
|
+
ci,
|
|
2791
|
+
hi,
|
|
2792
|
+
pi,
|
|
2589
2793
|
!1,
|
|
2590
2794
|
null,
|
|
2591
2795
|
null
|
|
2592
2796
|
);
|
|
2593
|
-
const
|
|
2797
|
+
const K = fi.exports, { t: V } = g(), mi = {
|
|
2594
2798
|
name: "TmAdvancedEllipsisText",
|
|
2595
2799
|
components: {
|
|
2596
2800
|
CopyIcon: H
|
|
@@ -2710,7 +2914,7 @@ const J = as.exports, { t: z } = b(), ls = {
|
|
|
2710
2914
|
},
|
|
2711
2915
|
handleCopy() {
|
|
2712
2916
|
navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(this.originalText).then(() => {
|
|
2713
|
-
this.$message.success(
|
|
2917
|
+
this.$message.success(V("copySuccess"));
|
|
2714
2918
|
}).catch(() => {
|
|
2715
2919
|
this.fallbackCopy();
|
|
2716
2920
|
}) : this.fallbackCopy();
|
|
@@ -2719,33 +2923,33 @@ const J = as.exports, { t: z } = b(), ls = {
|
|
|
2719
2923
|
const t = document.createElement("textarea");
|
|
2720
2924
|
t.value = this.originalText, t.style.position = "fixed", t.style.left = "-999999px", t.style.top = "-999999px", document.body.appendChild(t), t.focus(), t.select();
|
|
2721
2925
|
try {
|
|
2722
|
-
document.execCommand("copy"), this.$message.success(
|
|
2926
|
+
document.execCommand("copy"), this.$message.success(V("copySuccess"));
|
|
2723
2927
|
} catch (e) {
|
|
2724
|
-
this.$message.error(
|
|
2928
|
+
this.$message.error(V("copyFailed"));
|
|
2725
2929
|
}
|
|
2726
2930
|
document.body.removeChild(t);
|
|
2727
2931
|
},
|
|
2728
2932
|
getTextContent() {
|
|
2729
|
-
return this.$slots.default ? this.$slots.default.map((e) => e.text ? e.text : e.children && typeof e.children == "string" ? e.children : e.children && Array.isArray(e.children) ? e.children.map((
|
|
2933
|
+
return this.$slots.default ? this.$slots.default.map((e) => e.text ? e.text : e.children && typeof e.children == "string" ? e.children : e.children && Array.isArray(e.children) ? e.children.map((i) => i.text || "").join("") : "").join("") : this.text || "";
|
|
2730
2934
|
},
|
|
2731
2935
|
calculateLineHeight() {
|
|
2732
2936
|
const t = this.$refs.containerRef;
|
|
2733
2937
|
if (!t) return;
|
|
2734
2938
|
const e = window.getComputedStyle(t);
|
|
2735
2939
|
this.containerWidth = t.offsetWidth;
|
|
2736
|
-
const
|
|
2737
|
-
if (
|
|
2738
|
-
this.setMeasureElementStyle(
|
|
2940
|
+
const i = this.$refs.measureRef;
|
|
2941
|
+
if (i) {
|
|
2942
|
+
this.setMeasureElementStyle(i, {
|
|
2739
2943
|
width: this.containerWidth + "px",
|
|
2740
2944
|
wordBreak: "break-all",
|
|
2741
2945
|
whiteSpace: "normal"
|
|
2742
|
-
}),
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2946
|
+
}), i.textContent = "测", i.offsetHeight;
|
|
2947
|
+
const s = i.offsetHeight;
|
|
2948
|
+
i.innerHTML = "", this.lineHeight = s;
|
|
2745
2949
|
} else {
|
|
2746
|
-
const
|
|
2747
|
-
if (
|
|
2748
|
-
this.lineHeight = parseInt(
|
|
2950
|
+
const s = e.lineHeight;
|
|
2951
|
+
if (s && s !== "normal")
|
|
2952
|
+
this.lineHeight = parseInt(s);
|
|
2749
2953
|
else {
|
|
2750
2954
|
const a = parseInt(e.fontSize);
|
|
2751
2955
|
this.lineHeight = a * 1.2;
|
|
@@ -2774,7 +2978,7 @@ const J = as.exports, { t: z } = b(), ls = {
|
|
|
2774
2978
|
if (this.getTextHeight(t) <= e)
|
|
2775
2979
|
this.frontLines = [], this.lastLineText = t, this.isLastLineEllipsis = this.checkIfTextOverflows(t);
|
|
2776
2980
|
else {
|
|
2777
|
-
const
|
|
2981
|
+
const s = this.lineHeight * (this.rows - 1), a = this.findTextForHeight(t, s);
|
|
2778
2982
|
this.frontLines = this.splitTextToLines(a);
|
|
2779
2983
|
const l = t.substring(a.length);
|
|
2780
2984
|
this.lastLineText = l, this.isLastLineEllipsis = l.length > 0 && this.checkIfTextOverflows(l);
|
|
@@ -2785,28 +2989,28 @@ const J = as.exports, { t: z } = b(), ls = {
|
|
|
2785
2989
|
findTextForHeight(t, e) {
|
|
2786
2990
|
if (this.getTextHeight(t) <= e)
|
|
2787
2991
|
return t;
|
|
2788
|
-
let
|
|
2789
|
-
for (;
|
|
2790
|
-
const l = Math.floor((
|
|
2791
|
-
this.getTextHeight(n) <= e ? (a = n,
|
|
2992
|
+
let i = 0, s = t.length, a = "";
|
|
2993
|
+
for (; i <= s; ) {
|
|
2994
|
+
const l = Math.floor((i + s) / 2), n = t.substring(0, l);
|
|
2995
|
+
this.getTextHeight(n) <= e ? (a = n, i = l + 1) : s = l - 1;
|
|
2792
2996
|
}
|
|
2793
2997
|
return a;
|
|
2794
2998
|
},
|
|
2795
2999
|
splitTextToLines(t) {
|
|
2796
3000
|
if (!t) return [];
|
|
2797
3001
|
const e = [];
|
|
2798
|
-
let
|
|
2799
|
-
for (;
|
|
2800
|
-
const
|
|
2801
|
-
if (
|
|
2802
|
-
e.push(
|
|
3002
|
+
let i = t;
|
|
3003
|
+
for (; i.length > 0; ) {
|
|
3004
|
+
const s = this.findTextForHeight(i, this.lineHeight);
|
|
3005
|
+
if (s.length === 0) break;
|
|
3006
|
+
e.push(s), i = i.substring(s.length);
|
|
2803
3007
|
}
|
|
2804
3008
|
return e;
|
|
2805
3009
|
},
|
|
2806
3010
|
checkIfTextOverflows(t) {
|
|
2807
3011
|
if (!t) return !1;
|
|
2808
|
-
const e = this.getTextWidth(t),
|
|
2809
|
-
return e >
|
|
3012
|
+
const e = this.getTextWidth(t), i = this.shouldShowToolbar && this.hasToolbarContent ? this.getToolbarWidth() : 0, s = this.containerWidth - i - 5;
|
|
3013
|
+
return e > s;
|
|
2810
3014
|
},
|
|
2811
3015
|
getToolbarWidth() {
|
|
2812
3016
|
let t = 0;
|
|
@@ -2825,15 +3029,15 @@ const J = as.exports, { t: z } = b(), ls = {
|
|
|
2825
3029
|
measureText(t, e = {}) {
|
|
2826
3030
|
if (!this.$refs.containerRef || !this.$refs.measureRef)
|
|
2827
3031
|
return 0;
|
|
2828
|
-
const
|
|
2829
|
-
this.setMeasureElementStyle(
|
|
2830
|
-
const a = e.whiteSpace === "nowrap" ?
|
|
2831
|
-
return
|
|
3032
|
+
const i = this.$refs.measureRef, s = i.style.cssText;
|
|
3033
|
+
this.setMeasureElementStyle(i, e), i.textContent = t, i.offsetHeight;
|
|
3034
|
+
const a = e.whiteSpace === "nowrap" ? i.offsetWidth : i.offsetHeight;
|
|
3035
|
+
return i.style.cssText = s, i.innerHTML = "", a;
|
|
2832
3036
|
},
|
|
2833
3037
|
setMeasureElementStyle(t, e = {}) {
|
|
2834
|
-
const
|
|
2835
|
-
t.style.cssText = "", t.style.position = "absolute", t.style.left = "-9999px", t.style.top = "-9999px", t.style.visibility = "hidden", t.style.pointerEvents = "none", t.style.zIndex = "-1", t.style.fontSize =
|
|
2836
|
-
t.style[
|
|
3038
|
+
const i = window.getComputedStyle(this.$refs.containerRef);
|
|
3039
|
+
t.style.cssText = "", t.style.position = "absolute", t.style.left = "-9999px", t.style.top = "-9999px", t.style.visibility = "hidden", t.style.pointerEvents = "none", t.style.zIndex = "-1", t.style.fontSize = i.fontSize, t.style.fontFamily = i.fontFamily, t.style.fontWeight = i.fontWeight, t.style.lineHeight = i.lineHeight, t.style.letterSpacing = i.letterSpacing, t.style.wordSpacing = i.wordSpacing, t.style.padding = "0", t.style.margin = "0", t.style.border = "none", t.style.boxSizing = "border-box", Object.entries(e).forEach(([s, a]) => {
|
|
3040
|
+
t.style[s] = a;
|
|
2837
3041
|
});
|
|
2838
3042
|
},
|
|
2839
3043
|
handleMouseEnter() {
|
|
@@ -2846,8 +3050,8 @@ const J = as.exports, { t: z } = b(), ls = {
|
|
|
2846
3050
|
typeof ResizeObserver != "undefined" && (this.resizeObserver = new ResizeObserver((t) => {
|
|
2847
3051
|
const e = t[0];
|
|
2848
3052
|
if (e) {
|
|
2849
|
-
const
|
|
2850
|
-
Math.abs(
|
|
3053
|
+
const i = e.contentRect.width;
|
|
3054
|
+
Math.abs(i - this.containerWidth) > 1 && requestAnimationFrame(() => {
|
|
2851
3055
|
this.calculateLineHeight(), this.calculateLayout();
|
|
2852
3056
|
});
|
|
2853
3057
|
}
|
|
@@ -2872,59 +3076,59 @@ const J = as.exports, { t: z } = b(), ls = {
|
|
|
2872
3076
|
}
|
|
2873
3077
|
}
|
|
2874
3078
|
};
|
|
2875
|
-
var
|
|
2876
|
-
var e = this,
|
|
2877
|
-
return
|
|
3079
|
+
var gi = function() {
|
|
3080
|
+
var e = this, i = e._self._c;
|
|
3081
|
+
return i("div", { ref: "containerRef", staticClass: "tm-ellipsis-text", style: e.containerStyle, on: { mouseenter: e.handleMouseEnter, mouseleave: e.handleMouseLeave } }, [e.showTooltip && e.isLastLineEllipsis ? i("el-tooltip", e._b({ attrs: { content: e.originalText, disabled: !e.showTooltip || !e.isLastLineEllipsis, placement: "top" } }, "el-tooltip", {
|
|
2878
3082
|
[e.isVue2 ? "open-delay" : "show-after"]: 300
|
|
2879
|
-
}, !1), [
|
|
2880
|
-
return
|
|
2881
|
-
}),
|
|
2882
|
-
return
|
|
2883
|
-
}),
|
|
2884
|
-
},
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
3083
|
+
}, !1), [i("div", { staticClass: "tm-ellipsis-text-wrapper" }, [e._l(e.frontLines, function(s, a) {
|
|
3084
|
+
return i("div", { key: "front-" + a, staticClass: "tm-ellipsis-line", domProps: { innerHTML: e._s(s) } });
|
|
3085
|
+
}), i("div", { staticClass: "tm-ellipsis-last-line" }, [i("div", { staticClass: "tm-ellipsis-text-part", domProps: { innerHTML: e._s(e.lastLineText) } }), e.shouldShowToolbar && e.hasToolbarContent ? i("div", { staticClass: "tm-ellipsis-toolbar-part" }, [e.copyable ? i("CopyIcon", { staticClass: "icon-item", on: { click: e.handleCopy } }) : e._e(), e._t("toolbar")], 2) : e._e()])], 2)]) : i("div", { staticClass: "tm-ellipsis-text-wrapper" }, [e._l(e.frontLines, function(s, a) {
|
|
3086
|
+
return i("div", { key: "front-" + a, staticClass: "tm-ellipsis-line", domProps: { innerHTML: e._s(s) } });
|
|
3087
|
+
}), i("div", { staticClass: "tm-ellipsis-last-line" }, [i("div", { staticClass: "tm-ellipsis-text-part", domProps: { innerHTML: e._s(e.lastLineText) } }), e.shouldShowToolbar && e.hasToolbarContent ? i("div", { staticClass: "tm-ellipsis-toolbar-part" }, [e.copyable ? i("CopyIcon", { staticClass: "icon-item", on: { click: e.handleCopy } }) : e._e(), e._t("toolbar")], 2) : e._e()])], 2), i("div", { ref: "measureRef", staticClass: "tm-ellipsis-measure" })], 1);
|
|
3088
|
+
}, bi = [], yi = /* @__PURE__ */ d(
|
|
3089
|
+
mi,
|
|
3090
|
+
gi,
|
|
3091
|
+
bi,
|
|
2888
3092
|
!1,
|
|
2889
3093
|
null,
|
|
2890
|
-
"
|
|
3094
|
+
"14f27c2e"
|
|
2891
3095
|
);
|
|
2892
|
-
const
|
|
3096
|
+
const q = yi.exports, vi = {
|
|
2893
3097
|
install(t, e = {}) {
|
|
2894
|
-
[
|
|
3098
|
+
[J, K, F, q].forEach((i) => t.component(i.name, i)), e.tableConfigProvider && Kt(e.tableConfigProvider), e.lang && k(e.lang || "zh-CN");
|
|
2895
3099
|
}
|
|
2896
|
-
},
|
|
2897
|
-
install:
|
|
2898
|
-
Table:
|
|
2899
|
-
Column:
|
|
3100
|
+
}, Ci = {
|
|
3101
|
+
install: vi.install,
|
|
3102
|
+
Table: J,
|
|
3103
|
+
Column: K,
|
|
2900
3104
|
Search: U,
|
|
2901
|
-
Select:
|
|
2902
|
-
AdvancedInput:
|
|
3105
|
+
Select: E,
|
|
3106
|
+
AdvancedInput: W,
|
|
2903
3107
|
AdvancedDate: I,
|
|
2904
|
-
Cascader:
|
|
2905
|
-
Radio:
|
|
3108
|
+
Cascader: N,
|
|
3109
|
+
Radio: P,
|
|
2906
3110
|
Checkbox: B,
|
|
2907
|
-
Switch:
|
|
2908
|
-
EllipsisText:
|
|
2909
|
-
AdvancedEllipsisText:
|
|
3111
|
+
Switch: j,
|
|
3112
|
+
EllipsisText: F,
|
|
3113
|
+
AdvancedEllipsisText: q,
|
|
2910
3114
|
setLang: k,
|
|
2911
|
-
useLocale:
|
|
3115
|
+
useLocale: g
|
|
2912
3116
|
};
|
|
2913
|
-
typeof window != "undefined" && window.Vue &&
|
|
3117
|
+
typeof window != "undefined" && window.Vue && Ci.install(window.Vue);
|
|
2914
3118
|
export {
|
|
2915
3119
|
I as AdvancedDate,
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
3120
|
+
q as AdvancedEllipsisText,
|
|
3121
|
+
W as AdvancedInput,
|
|
3122
|
+
N as Cascader,
|
|
2919
3123
|
B as Checkbox,
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
3124
|
+
K as Column,
|
|
3125
|
+
F as EllipsisText,
|
|
3126
|
+
P as Radio,
|
|
2923
3127
|
U as Search,
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
3128
|
+
E as Select,
|
|
3129
|
+
j as Switch,
|
|
3130
|
+
J as Table,
|
|
3131
|
+
Ci as default,
|
|
2928
3132
|
k as setLang,
|
|
2929
|
-
|
|
3133
|
+
g as useLocale
|
|
2930
3134
|
};
|