@opentiny/vue-search-box 2.27.0 → 2.27.1
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/index.css +404 -0
- package/{es/index.es.js → index.js} +840 -808
- package/index.js.map +1 -0
- package/package.json +6 -4
- package/es/index.es.js.map +0 -1
- package/lib/index.cjs.js +0 -2
- package/lib/index.cjs.js.map +0 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
import './index.css';
|
|
1
2
|
import { defineComponent as X, $prefix as pe, $props as J, setup as ue } from "@opentiny/vue-common";
|
|
2
|
-
import
|
|
3
|
+
import Oe from "@opentiny/vue-tag";
|
|
3
4
|
import _e from "@opentiny/vue-input";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
5
|
+
import Fe from "@opentiny/vue-dropdown";
|
|
6
|
+
import Ae from "@opentiny/vue-dropdown-menu";
|
|
6
7
|
import ye from "@opentiny/vue-button";
|
|
7
|
-
import
|
|
8
|
+
import Be from "@opentiny/vue-tooltip";
|
|
8
9
|
import xe from "@opentiny/vue-date-picker";
|
|
9
|
-
import
|
|
10
|
+
import ze from "@opentiny/vue-form";
|
|
10
11
|
import we from "@opentiny/vue-form-item";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { iconSearch as
|
|
12
|
+
import je from "@opentiny/vue-popover";
|
|
13
|
+
import He from "@opentiny/vue-select";
|
|
14
|
+
import Ge from "@opentiny/vue-option";
|
|
15
|
+
import { iconSearch as Ke, iconClose as Ue, iconHelpQuery as qe } from "@opentiny/vue-icon";
|
|
15
16
|
import Ie from "@opentiny/vue-dropdown-item";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
17
|
+
import Ze from "@opentiny/vue-checkbox";
|
|
18
|
+
import Ye from "@opentiny/vue-checkbox-group";
|
|
19
|
+
import We from "@opentiny/vue-loading";
|
|
20
|
+
const Qe = (a, e, t, s = "0") => {
|
|
20
21
|
if (typeof a == "string" && typeof s == "string" && ke(e)) {
|
|
21
22
|
let n = a.length - e;
|
|
22
23
|
if (n > 0)
|
|
@@ -25,13 +26,13 @@ const We = (a, e, t, s = "0") => {
|
|
|
25
26
|
const r = [];
|
|
26
27
|
for (n = Math.abs(n) / s.length; n > 0; n--)
|
|
27
28
|
r.push(s);
|
|
28
|
-
const
|
|
29
|
-
return t ? a +
|
|
29
|
+
const c = r.join("");
|
|
30
|
+
return t ? a + c : c + a;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
const
|
|
33
|
+
}, Xe = Object.prototype.toString, Je = Object.prototype.hasOwnProperty, et = Je.toString;
|
|
34
|
+
et.call(Object);
|
|
35
|
+
const tt = {
|
|
35
36
|
"[object Error]": "error",
|
|
36
37
|
"[object Object]": "object",
|
|
37
38
|
"[object RegExp]": "regExp",
|
|
@@ -42,13 +43,13 @@ const et = {
|
|
|
42
43
|
"[object String]": "string",
|
|
43
44
|
"[object Number]": "number",
|
|
44
45
|
"[object Boolean]": "boolean"
|
|
45
|
-
},
|
|
46
|
+
}, at = (a) => a == null, nt = (a) => at(a) ? String(a) : tt[Xe.call(a)] || "object", ke = (a) => typeof a == "number" && isFinite(a), rt = (a) => nt(a) === "date", Ve = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], st = new RegExp(
|
|
46
47
|
"^(\\d{4})(/|-)(((0)?[1-9])|(1[0-2]))((/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1])))?( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"
|
|
47
|
-
), rt = new RegExp(
|
|
48
|
-
"^(((0)?[1-9])|(1[0-2]))(/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1]))?(/|-)?(\\d{4})( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"
|
|
49
48
|
), ot = new RegExp(
|
|
49
|
+
"^(((0)?[1-9])|(1[0-2]))(/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1]))?(/|-)?(\\d{4})( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"
|
|
50
|
+
), lt = new RegExp(
|
|
50
51
|
"^(\\d{4})-(((0)?[1-9])|(1[0-2]))-(((0)?[1-9])|([1-2][0-9])|(3[0-1]))T(((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?(Z|([+-])((0)?[0-9]|1[0-9]|20|21|22|23):?([0-5]?[0-9]))$"
|
|
51
|
-
),
|
|
52
|
+
), it = {
|
|
52
53
|
"y{1,4}": /y{1,4}/,
|
|
53
54
|
"M{1,2}": /M{1,2}/,
|
|
54
55
|
"d{1,2}": /d{1,2}/,
|
|
@@ -66,68 +67,68 @@ const et = {
|
|
|
66
67
|
MINUTE: 59,
|
|
67
68
|
SECOND: 59,
|
|
68
69
|
MILLISECOND: 999
|
|
69
|
-
},
|
|
70
|
+
}, ct = "-12:00,-11:00,-10:00,-09:30,-08:00,-07:00,-06:00,-05:00,-04:30,-04:00,-03:30,-02:00,-01:00", pt = "-00:00,+00:00,+01:00,+02:00,+03:00,+03:30,+04:00,+04:30,+05:00,+05:30,+05:45,+06:00", ut = "+06:30,+07:00,+08:00,+09:00,+10:00,+10:30,+11:00,+11:30,+12:00,+12:45,+13:00,+14:00", dt = [].concat(ct.split(","), pt.split(","), ut.split(",")), mt = (a) => {
|
|
70
71
|
const e = 0 - a.getTimezoneOffset() / 60;
|
|
71
72
|
let t;
|
|
72
73
|
return e === 0 ? t = "Z" : e > 0 ? t = "+" + (e > 10 ? e : "0" + e) + "00" : t = (e < -10 ? e : "-0" + -e) + "00", t;
|
|
73
|
-
},
|
|
74
|
-
let
|
|
75
|
-
if (
|
|
76
|
-
return new Date(a, e, t, s, n, r,
|
|
77
|
-
},
|
|
74
|
+
}, Te = (a) => a % 400 === 0 || a % 4 === 0 && a % 100 !== 0, Ce = (a) => a > z.MILLISECOND ? Number(String(a).substring(0, 3)) : a, de = ({ year: a, month: e, date: t, hours: s, minutes: n, seconds: r, milliseconds: c }) => {
|
|
75
|
+
let i = Ve[e];
|
|
76
|
+
if (Te(a) && e === 1 && (i += 1), t <= i)
|
|
77
|
+
return new Date(a, e, t, s, n, r, Ce(c));
|
|
78
|
+
}, ft = (a) => {
|
|
78
79
|
if (a.length === 23) {
|
|
79
|
-
const e = Number(a[1]), t = a[3] - 1, s = Number(a[9] || 1), n = a[15] || 0, r = a[17] || 0,
|
|
80
|
+
const e = Number(a[1]), t = a[3] - 1, s = Number(a[9] || 1), n = a[15] || 0, r = a[17] || 0, c = a[20] || 0, i = a[22] || 0;
|
|
80
81
|
return de({
|
|
81
82
|
date: s,
|
|
82
83
|
year: e,
|
|
83
84
|
hours: n,
|
|
84
85
|
month: t,
|
|
85
|
-
seconds:
|
|
86
|
+
seconds: c,
|
|
86
87
|
minutes: r,
|
|
87
|
-
milliseconds:
|
|
88
|
+
milliseconds: i
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
|
-
},
|
|
91
|
+
}, ht = (a) => {
|
|
91
92
|
if (a.length === 22) {
|
|
92
|
-
const e = Number(a[12]), t = a[1] - 1, s = Number(a[6] || 1), n = a[14] || 0, r = a[16] || 0,
|
|
93
|
+
const e = Number(a[12]), t = a[1] - 1, s = Number(a[6] || 1), n = a[14] || 0, r = a[16] || 0, c = a[19] || 0, i = a[21] || 0;
|
|
93
94
|
return de({
|
|
94
95
|
year: e,
|
|
95
96
|
month: t,
|
|
96
97
|
date: s,
|
|
97
98
|
hours: n,
|
|
98
99
|
minutes: r,
|
|
99
|
-
seconds:
|
|
100
|
-
milliseconds:
|
|
100
|
+
seconds: c,
|
|
101
|
+
milliseconds: i
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
|
-
},
|
|
104
|
+
}, vt = (a) => {
|
|
104
105
|
if (a.length !== 25)
|
|
105
106
|
return;
|
|
106
|
-
const e = Number(a[1]), t = a[2] - 1, s = Number(a[6]), n = new Date(e, t, s).getTimezoneOffset(), r = a[12] || 0,
|
|
107
|
-
let
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
if (
|
|
111
|
-
if (
|
|
112
|
-
|
|
107
|
+
const e = Number(a[1]), t = a[2] - 1, s = Number(a[6]), n = new Date(e, t, s).getTimezoneOffset(), r = a[12] || 0, c = a[14] || 0, i = a[17] || 0, l = a[19] || 0;
|
|
108
|
+
let u = a[20];
|
|
109
|
+
const m = a[21], o = a[22] || 0, f = a[24] || 0;
|
|
110
|
+
let d = Ve[t], p, b;
|
|
111
|
+
if (Te(e) && t === 1 && (d += 1), s <= d) {
|
|
112
|
+
if (u === "Z")
|
|
113
|
+
p = r - n / 60, b = c;
|
|
113
114
|
else {
|
|
114
|
-
if (
|
|
115
|
+
if (u.includes(":") || (u = u.substr(0, 3) + ":" + u.substr(3)), !dt.includes(u))
|
|
115
116
|
return;
|
|
116
|
-
|
|
117
|
+
p = m === "+" ? r - o - n / 60 : Number(r) + Number(o) - n / 60, b = m === "+" ? c - f : Number(c) + Number(f);
|
|
117
118
|
}
|
|
118
|
-
return new Date(e, t, s,
|
|
119
|
+
return new Date(e, t, s, p, b, i, Ce(l));
|
|
119
120
|
}
|
|
120
|
-
},
|
|
121
|
-
[st,
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
],
|
|
125
|
-
for (let e = 0, t =
|
|
126
|
-
const s =
|
|
121
|
+
}, se = [
|
|
122
|
+
[st, ft],
|
|
123
|
+
[ot, ht],
|
|
124
|
+
[lt, vt]
|
|
125
|
+
], bt = (a) => {
|
|
126
|
+
for (let e = 0, t = se.length; e < t; e++) {
|
|
127
|
+
const s = se[e][0].exec(a);
|
|
127
128
|
if (s && s.length > 0)
|
|
128
|
-
return
|
|
129
|
+
return se[e][1](s);
|
|
129
130
|
}
|
|
130
|
-
},
|
|
131
|
+
}, gt = (a, e, t) => {
|
|
131
132
|
if (t)
|
|
132
133
|
switch (t) {
|
|
133
134
|
case "yyyy":
|
|
@@ -160,56 +161,56 @@ const et = {
|
|
|
160
161
|
a[6] = e;
|
|
161
162
|
break;
|
|
162
163
|
}
|
|
163
|
-
},
|
|
164
|
+
}, _t = (a, e) => {
|
|
164
165
|
const t = [0, -1, 0, 0, 0, 0];
|
|
165
166
|
if (a.length !== e.length)
|
|
166
167
|
return t;
|
|
167
168
|
let s = 0, n = 0;
|
|
168
|
-
for (let r = 0,
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
let
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
-
const o = e.indexOf(
|
|
175
|
-
|
|
169
|
+
for (let r = 0, c = a.length; r < c; r++) {
|
|
170
|
+
const i = a.substr(r, 1), l = isNaN(Number(i)) || (i == null ? void 0 : i.trim()) === "";
|
|
171
|
+
if (l && i === e.substr(r, 1) || r === c - 1) {
|
|
172
|
+
let u, m;
|
|
173
|
+
if (l) {
|
|
174
|
+
u = a.substring(s, r), s = r + 1;
|
|
175
|
+
const o = e.indexOf(i, n);
|
|
176
|
+
m = e.substring(n, o === -1 ? e.length : o), n = o + 1;
|
|
176
177
|
} else
|
|
177
|
-
|
|
178
|
-
(
|
|
178
|
+
u = a.substring(s, c), m = e.substring(n, c);
|
|
179
|
+
(u.length === m.length || u) && gt(t, u, m);
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
return t;
|
|
182
|
-
}, U = (a, e, t) => isNaN(a) || a < e || a > t,
|
|
183
|
+
}, U = (a, e, t) => isNaN(a) || a < e || a > t, yt = ({ year: a, month: e, date: t, hours: s, minutes: n, seconds: r, milliseconds: c }) => U(a, 0, z.YEAR) || U(e, 0, z.MONTH) || U(t, 0, z.DATE) || U(s, 0, z.HOUR) || U(n, 0, z.MINUTE) || U(r, 0, z.SECOND) || U(c, 0, z.MILLISECOND), xt = (a, e) => {
|
|
183
184
|
if (typeof e == "string") {
|
|
184
|
-
const t =
|
|
185
|
-
return
|
|
185
|
+
const t = _t(a, e), s = Number(t[0]), n = Number(t[1]), r = Number(t[2] || 1), c = Number(t[3] || 0), i = Number(t[4] || 0), l = Number(t[5] || 0), u = Number(t[6] || 0);
|
|
186
|
+
return yt({
|
|
186
187
|
year: s,
|
|
187
188
|
month: n,
|
|
188
189
|
date: r,
|
|
189
|
-
hours:
|
|
190
|
-
minutes:
|
|
191
|
-
seconds:
|
|
192
|
-
milliseconds:
|
|
190
|
+
hours: c,
|
|
191
|
+
minutes: i,
|
|
192
|
+
seconds: l,
|
|
193
|
+
milliseconds: u
|
|
193
194
|
}) ? void 0 : de({
|
|
194
195
|
year: s,
|
|
195
196
|
date: r,
|
|
196
197
|
month: n,
|
|
197
|
-
minutes:
|
|
198
|
-
hours:
|
|
199
|
-
milliseconds:
|
|
200
|
-
seconds:
|
|
198
|
+
minutes: i,
|
|
199
|
+
hours: c,
|
|
200
|
+
milliseconds: u,
|
|
201
|
+
seconds: l
|
|
201
202
|
});
|
|
202
203
|
} else
|
|
203
|
-
return
|
|
204
|
+
return bt(a);
|
|
204
205
|
}, Se = (a, e, t) => {
|
|
205
206
|
let s;
|
|
206
|
-
if (ke(a) ? s = new Date(a) : typeof a == "string" && (s =
|
|
207
|
+
if (ke(a) ? s = new Date(a) : typeof a == "string" && (s = xt(a, e)), t) {
|
|
207
208
|
const n = t && Se(t) || new Date(1, 1, 1, 0, 0, 0);
|
|
208
209
|
return s && s < n ? n : s;
|
|
209
210
|
}
|
|
210
211
|
return s;
|
|
211
212
|
}, le = function(a, e = "yyyy/MM/dd hh:mm:ss") {
|
|
212
|
-
if (
|
|
213
|
+
if (rt(a)) {
|
|
213
214
|
if (typeof e == "string") {
|
|
214
215
|
const t = {
|
|
215
216
|
"y{1,4}": a.getFullYear(),
|
|
@@ -220,11 +221,11 @@ const et = {
|
|
|
220
221
|
"m{1,2}": a.getMinutes(),
|
|
221
222
|
"s{1,2}": a.getSeconds(),
|
|
222
223
|
"S{1,3}": a.getMilliseconds(),
|
|
223
|
-
"Z{1,1}":
|
|
224
|
+
"Z{1,1}": mt(a)
|
|
224
225
|
};
|
|
225
226
|
return Object.keys(t).forEach((s) => {
|
|
226
|
-
const n = e.match(
|
|
227
|
-
s && n && n.length && (e = e.replace(n[0], s === "Z{1,1}" ? t[s] :
|
|
227
|
+
const n = e.match(it[s]);
|
|
228
|
+
s && n && n.length && (e = e.replace(n[0], s === "Z{1,1}" ? t[s] : Qe(t[s].toString(), n[0].length)));
|
|
228
229
|
}), e;
|
|
229
230
|
}
|
|
230
231
|
} else if (typeof a == "string" && arguments.length >= 2) {
|
|
@@ -233,7 +234,7 @@ const et = {
|
|
|
233
234
|
const s = Se(a, e);
|
|
234
235
|
return s ? le(s, t) : "";
|
|
235
236
|
}
|
|
236
|
-
},
|
|
237
|
+
}, k = (a, e = !0) => {
|
|
237
238
|
e ? a.visibleTimer = setTimeout(() => {
|
|
238
239
|
a.visible = !0;
|
|
239
240
|
}, 0) : (clearTimeout(a.visibleTimer), a.visibleTimer = null, a.visible = !1);
|
|
@@ -243,7 +244,7 @@ const et = {
|
|
|
243
244
|
a.popoverVisible = e;
|
|
244
245
|
const { dropdownRef: t } = a.instance;
|
|
245
246
|
e && t.state.visible && (clearTimeout(Number(t.state.timeout)), t.state.timeout = null, t.state.visible = !1);
|
|
246
|
-
},
|
|
247
|
+
}, wt = (a, e = 200) => {
|
|
247
248
|
let t = null;
|
|
248
249
|
const s = function(...n) {
|
|
249
250
|
t && clearTimeout(t), t = setTimeout(() => {
|
|
@@ -253,7 +254,7 @@ const et = {
|
|
|
253
254
|
return s.cancel = () => {
|
|
254
255
|
t && (clearTimeout(t), t = null);
|
|
255
256
|
}, s;
|
|
256
|
-
},
|
|
257
|
+
}, B = (a) => parseFloat(a).toString() !== "NaN", j = (a) => {
|
|
257
258
|
const e = Array.isArray(a) ? [] : {};
|
|
258
259
|
if (a && typeof a == "object") {
|
|
259
260
|
const t = Object.keys(a);
|
|
@@ -270,506 +271,506 @@ const et = {
|
|
|
270
271
|
return e.forEach((s) => {
|
|
271
272
|
delete t[s];
|
|
272
273
|
}), t;
|
|
273
|
-
},
|
|
274
|
+
}, O = (a, e, t = "") => {
|
|
274
275
|
const { valueMap: s, prevItem: n } = a, r = (n.label || t) + e;
|
|
275
276
|
return s.has(r);
|
|
276
277
|
}, te = (a) => {
|
|
277
278
|
a.propItem = {}, a.inputValue = "";
|
|
278
279
|
}, R = ({ emit: a, state: e, nextTick: t, ...s }) => {
|
|
279
280
|
Q(e, !1);
|
|
280
|
-
const { tagList: n = null, index: r = -1, newTag:
|
|
281
|
-
if (
|
|
281
|
+
const { tagList: n = null, index: r = -1, newTag: c = null, newValue: i = null, oldValue: l = null, isEdit: u } = s;
|
|
282
|
+
if (u || te(e), !n && r === -1 && !i)
|
|
282
283
|
return;
|
|
283
|
-
const
|
|
284
|
+
const m = l || j(e.innerModelValue);
|
|
284
285
|
let o = [];
|
|
285
|
-
|
|
286
|
+
i ? o = [...i] : r !== -1 ? (o = [...e.innerModelValue], c ? o.splice(r, 1, c) : o.splice(r, 1)) : o = [...e.innerModelValue, ...n], e.innerModelValue = o, a("update:modelValue", j(o)), a("change", j(o), m);
|
|
286
287
|
}, H = (a) => a, G = (a, e, t) => {
|
|
287
288
|
const s = e.idMapKey || a.idMapKey;
|
|
288
289
|
return t && t[s] !== void 0 ? { [s]: t[s] } : null;
|
|
289
290
|
};
|
|
290
|
-
function
|
|
291
|
+
function It({ props: a, state: e, emit: t, nextTick: s }) {
|
|
291
292
|
let n = j(e.inputValue);
|
|
292
|
-
const r = (
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
const o =
|
|
293
|
+
const r = (u) => {
|
|
294
|
+
if (u) {
|
|
295
|
+
const m = e.recordItems.find((o) => o.label === u.label);
|
|
296
|
+
if (m && m.options) {
|
|
297
|
+
const o = m.options.find((f) => f.label === u.value);
|
|
297
298
|
o && (o.isChecked = !1);
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
};
|
|
301
302
|
return {
|
|
302
|
-
deleteTag: (
|
|
303
|
-
|
|
304
|
-
const
|
|
305
|
-
R({ emit: t, state: e, nextTick: s, newValue:
|
|
303
|
+
deleteTag: (u) => {
|
|
304
|
+
k(e, !1), r(u);
|
|
305
|
+
const m = a.modelValue.filter((o) => o !== u);
|
|
306
|
+
R({ emit: t, state: e, nextTick: s, newValue: m });
|
|
306
307
|
},
|
|
307
308
|
clearTag: () => {
|
|
308
|
-
|
|
309
|
+
k(e, !1), a.modelValue.forEach((u) => r(u)), e.propItem = {}, e.inputValue = "", R({ emit: t, state: e, nextTick: s, newValue: [] }), t("clear");
|
|
309
310
|
},
|
|
310
311
|
backspaceDeleteTag: () => {
|
|
311
|
-
var
|
|
312
|
+
var u, m, o;
|
|
312
313
|
if (!e.inputValue) {
|
|
313
314
|
if (e.propItem.label) {
|
|
314
315
|
e.propItem = {};
|
|
315
316
|
return;
|
|
316
317
|
}
|
|
317
318
|
if (n === "" && e.inputValue === "") {
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
r(a.modelValue[
|
|
321
|
-
const
|
|
322
|
-
R({ emit: t, state: e, nextTick: s, newValue:
|
|
319
|
+
k(e, !1);
|
|
320
|
+
const f = a.modelValue.length - 1;
|
|
321
|
+
r(a.modelValue[f]);
|
|
322
|
+
const d = e.innerModelValue.slice(0, a.modelValue.length - 1);
|
|
323
|
+
R({ emit: t, state: e, nextTick: s, newValue: d });
|
|
323
324
|
}
|
|
324
|
-
n = e.inputValue, (o = (
|
|
325
|
+
n = e.inputValue, (o = (m = (u = e == null ? void 0 : e.instance) == null ? void 0 : u.refs) == null ? void 0 : m.inputRef) != null && o.$el && e.instance.refs.inputRef.$el.click();
|
|
325
326
|
}
|
|
326
327
|
}
|
|
327
328
|
};
|
|
328
329
|
}
|
|
329
|
-
const
|
|
330
|
-
const { prevItem: s, inputEditValue: n } = e, { operators: r } = s,
|
|
331
|
-
let
|
|
332
|
-
if (await a.$refs.formRef.validateField(["inputEditValue"], (
|
|
333
|
-
|
|
334
|
-
}),
|
|
335
|
-
let
|
|
336
|
-
const
|
|
330
|
+
const kt = async (a, e, t) => {
|
|
331
|
+
const { prevItem: s, inputEditValue: n } = e, { operators: r } = s, c = ee(s);
|
|
332
|
+
let i = null, l = !0;
|
|
333
|
+
if (await a.$refs.formRef.validateField(["inputEditValue"], (u) => {
|
|
334
|
+
u && (l = !1);
|
|
335
|
+
}), l) {
|
|
336
|
+
let u = null;
|
|
337
|
+
const m = e.operatorValue && r ? { operator: e.operatorValue } : null;
|
|
337
338
|
let o = n;
|
|
338
|
-
const
|
|
339
|
+
const f = {};
|
|
339
340
|
if (Array.isArray(n))
|
|
340
|
-
|
|
341
|
-
const
|
|
342
|
-
if (o = o ? `${o} | ${
|
|
343
|
-
const h = G(t, s,
|
|
344
|
-
|
|
341
|
+
f.options = [], o = "", n.forEach((d) => {
|
|
342
|
+
const p = e.currentEditValue.find((h) => h.label === d), b = (p == null ? void 0 : p.label) || d;
|
|
343
|
+
if (o = o ? `${o} | ${b}` : b, p) {
|
|
344
|
+
const h = G(t, s, p);
|
|
345
|
+
f.options.push({ label: b, ...h });
|
|
345
346
|
} else
|
|
346
|
-
|
|
347
|
+
f.options.push({ label: b });
|
|
347
348
|
});
|
|
348
349
|
else if (Array.isArray(e.currentEditValue)) {
|
|
349
|
-
const
|
|
350
|
-
|
|
350
|
+
const d = e.currentEditValue.find((p) => p.label === o);
|
|
351
|
+
u = G(t, s, d);
|
|
351
352
|
}
|
|
352
|
-
|
|
353
|
+
i = H({ ...c, label: e.selectValue, ...m, value: o, ...u, ...f });
|
|
353
354
|
}
|
|
354
|
-
return
|
|
355
|
+
return i;
|
|
355
356
|
}, De = async (a, e, t) => {
|
|
356
|
-
const { prevItem: s } = e, n = `min${s.field}`, r = `max${s.field}`,
|
|
357
|
-
let
|
|
358
|
-
if (await a.$refs.formRef.validateField(
|
|
359
|
-
o && (
|
|
360
|
-
}),
|
|
361
|
-
const { field: o, label:
|
|
362
|
-
let
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
357
|
+
const { prevItem: s } = e, n = `min${s.field}`, r = `max${s.field}`, c = e[n], i = e[r], l = [n, r];
|
|
358
|
+
let u = !0, m = null;
|
|
359
|
+
if (await a.$refs.formRef.validateField(l, (o) => {
|
|
360
|
+
o && (u = !1);
|
|
361
|
+
}), u) {
|
|
362
|
+
const { field: o, label: f, unit: d, type: p, operators: b } = s, h = d ? `${f}(${d})` : f;
|
|
363
|
+
let v = "";
|
|
364
|
+
c && i ? v = `${c}-${i}` : v = c ? `≥${c}` : `≤${i}`;
|
|
365
|
+
const x = G(t, s, s), T = e.operatorValue && b ? { operator: e.operatorValue } : null;
|
|
366
|
+
m = H({ type: p, field: o, label: h, value: v, ...x, start: c, end: i, ...T });
|
|
366
367
|
}
|
|
367
|
-
return
|
|
368
|
+
return m;
|
|
368
369
|
}, ie = async (a, e, t, s) => {
|
|
369
|
-
const { prevItem: n, startDate: r, endDate:
|
|
370
|
-
let
|
|
371
|
-
if (s ? (
|
|
372
|
-
|
|
370
|
+
const { prevItem: n, startDate: r, endDate: c, startDateTime: i, endDateTime: l } = e;
|
|
371
|
+
let u = null, m = null, o = !0, f = null, d = null;
|
|
372
|
+
if (s ? (u = i, m = l, d = ["startDateTime", "endDateTime"]) : (u = r, m = c, d = ["startDate", "endDate"]), await a.$refs.formRef.validateField(d, (p) => {
|
|
373
|
+
p && (o = !1);
|
|
373
374
|
}), o) {
|
|
374
|
-
const { operators:
|
|
375
|
+
const { operators: p } = n, b = ee(n);
|
|
375
376
|
let h = "";
|
|
376
|
-
if (
|
|
377
|
-
if (
|
|
377
|
+
if (u && m) {
|
|
378
|
+
if (u > m)
|
|
378
379
|
return;
|
|
379
|
-
|
|
380
|
+
u === m ? h = u : h = `${u}-${m}`;
|
|
380
381
|
} else
|
|
381
|
-
h =
|
|
382
|
-
const
|
|
383
|
-
|
|
382
|
+
h = u ? `≥${u}` : `≤${m}`;
|
|
383
|
+
const v = G(t, n, n), x = e.operatorValue && p ? { operator: e.operatorValue } : null;
|
|
384
|
+
f = H({ ...b, value: h, start: u, end: m, ...v, ...x });
|
|
384
385
|
}
|
|
385
|
-
return
|
|
386
|
+
return f;
|
|
386
387
|
}, Me = (a, e, t) => {
|
|
387
|
-
const { prevItem: s } = a, { field: n, start: r, end:
|
|
388
|
-
(a.curMinNumVar !==
|
|
389
|
-
const { curMinNumVar: o, curMaxNumVar:
|
|
390
|
-
|
|
391
|
-
validator: (
|
|
392
|
-
const
|
|
393
|
-
!
|
|
394
|
-
}
|
|
395
|
-
}, a.formRules[
|
|
396
|
-
validator: (
|
|
397
|
-
const
|
|
398
|
-
!_ &&
|
|
399
|
-
}
|
|
400
|
-
}) : a.formRules[
|
|
401
|
-
validator: (
|
|
402
|
-
const
|
|
403
|
-
|
|
388
|
+
const { prevItem: s } = a, { field: n, start: r, end: c, min: i = s.min, max: l = s.max } = e, u = `min${n}`, m = `max${n}`;
|
|
389
|
+
(a.curMinNumVar !== u || a.curMaxNumVar !== m) && (delete a[a.curMinNumVar], delete a[a.curMaxNumVar], delete a.formRules[a.curMinNumVar], delete a.formRules[a.curMaxNumVar], a.curMinNumVar = u, a.curMaxNumVar = m), a[a.curMinNumVar] = r, a[a.curMaxNumVar] = c;
|
|
390
|
+
const { curMinNumVar: o, curMaxNumVar: f } = a, d = B(i), p = B(l);
|
|
391
|
+
d || p ? (a.formRules[o] = {
|
|
392
|
+
validator: (b, h, v) => {
|
|
393
|
+
const x = B(h);
|
|
394
|
+
!x && B(a[f]) || x && (d && !p && h >= i || !d && p && h <= l || h >= i && h <= l) ? v() : (a.numberShowMessage = !!(h || a[f]), v(new Error(t("tvp.tvpSearchbox.rangeMinErr", [i, l]))));
|
|
395
|
+
}
|
|
396
|
+
}, a.formRules[f] = {
|
|
397
|
+
validator: (b, h, v) => {
|
|
398
|
+
const x = B(a[o]), T = x && i < a[o] ? Number(a[o]) : i, g = B(T), _ = B(h);
|
|
399
|
+
!_ && x || _ && (g && !p && h >= T || !g && p && h <= l || h >= T && h <= l) ? v() : v(!_ && !x ? new Error(t("tvp.tvpSearchbox.rangeNumberTitle")) : new Error(t("tvp.tvpSearchbox.rangeMaxErr")));
|
|
400
|
+
}
|
|
401
|
+
}) : a.formRules[f] = {
|
|
402
|
+
validator: (b, h, v) => {
|
|
403
|
+
const x = a[o], T = B(h), g = B(x);
|
|
404
|
+
T && !g || !T && g || T && g && h >= Number(x) ? v() : v(!T && !g ? new Error(t("tvp.tvpSearchbox.rangeNumberTitle")) : new Error(t("tvp.tvpSearchbox.rangeMaxErr")));
|
|
404
405
|
}
|
|
405
406
|
};
|
|
406
407
|
};
|
|
407
|
-
function
|
|
408
|
-
const
|
|
409
|
-
var
|
|
410
|
-
const { start: _, end:
|
|
411
|
-
if (t.backupList = g.options,
|
|
408
|
+
function Vt({ props: a, emit: e, state: t, t: s, format: n, nextTick: r, vm: c, cancelHandleInput: i }) {
|
|
409
|
+
const l = c || t.instance, u = (g) => {
|
|
410
|
+
var C, w, S;
|
|
411
|
+
const { start: _, end: I, type: y } = g;
|
|
412
|
+
if (t.backupList = g.options, y === "numRange")
|
|
412
413
|
Me(t, g, s);
|
|
413
|
-
else if (
|
|
414
|
+
else if (y === "dateRange") {
|
|
414
415
|
const { dateRangeFormat: V } = t;
|
|
415
416
|
if (!t.startDate && _) {
|
|
416
|
-
const
|
|
417
|
-
t.startDate = t.endDate <
|
|
417
|
+
const D = n(_, V);
|
|
418
|
+
t.startDate = t.endDate < D ? null : D;
|
|
418
419
|
}
|
|
419
|
-
if (!t.endDate &&
|
|
420
|
-
const
|
|
421
|
-
t.endDate =
|
|
420
|
+
if (!t.endDate && I) {
|
|
421
|
+
const D = n(I, V);
|
|
422
|
+
t.endDate = D < t.startDate ? null : D;
|
|
422
423
|
}
|
|
423
|
-
} else if (
|
|
424
|
+
} else if (y === "datetimeRange") {
|
|
424
425
|
const { datetimeRangeFormat: V } = t;
|
|
425
426
|
if (!t.startDateTime && _) {
|
|
426
|
-
const
|
|
427
|
-
t.startDateTime = t.endDateTime <
|
|
427
|
+
const D = n(_, V);
|
|
428
|
+
t.startDateTime = t.endDateTime < D ? null : D;
|
|
428
429
|
}
|
|
429
|
-
if (!t.endDateTime &&
|
|
430
|
-
const
|
|
431
|
-
t.endDateTime =
|
|
430
|
+
if (!t.endDateTime && I) {
|
|
431
|
+
const D = n(I, V);
|
|
432
|
+
t.endDateTime = D < t.startDateTime ? null : D;
|
|
432
433
|
}
|
|
433
434
|
} else
|
|
434
|
-
t.backupList &&
|
|
435
|
-
|
|
435
|
+
t.backupList && y === "checkbox" && (t.filterList = t.backupList, t.checkboxGroup = [], (C = t.backupList) == null || C.forEach((V) => {
|
|
436
|
+
O(t, V.label) && t.checkboxGroup.push(`${g.label}${V.label}`), V.isFilter = !1;
|
|
436
437
|
}));
|
|
437
|
-
|
|
438
|
-
V.isFilter = !1, V.isChecked =
|
|
439
|
-
})), t.currentOperators = null, !t.backupList && !["dateRange", "datetimeRange", "numRange", "custom"].includes(
|
|
440
|
-
},
|
|
441
|
-
var
|
|
442
|
-
const { field: _, label:
|
|
443
|
-
t.propItem = { ...t.propItem, label:
|
|
444
|
-
const
|
|
438
|
+
y !== "checkbox" && ((w = t.backupList) != null && w.length) && ((S = t.backupList) == null || S.forEach((V) => {
|
|
439
|
+
V.isFilter = !1, V.isChecked = O(t, V.label);
|
|
440
|
+
})), t.currentOperators = null, !t.backupList && !["dateRange", "datetimeRange", "numRange", "custom"].includes(y) ? k(t, !1) : k(t);
|
|
441
|
+
}, m = (g) => {
|
|
442
|
+
var w;
|
|
443
|
+
const { field: _, label: I } = g;
|
|
444
|
+
t.propItem = { ...t.propItem, label: I }, e("first-level-select", _);
|
|
445
|
+
const y = (w = l.$refs) == null ? void 0 : w.inputRef;
|
|
445
446
|
t.prevItem = g, t.backupPrevItem = g;
|
|
446
|
-
const { operators:
|
|
447
|
-
|
|
447
|
+
const { operators: C } = g;
|
|
448
|
+
C != null && C.length ? (t.operatorValue = "", t.currentOperators = C, k(t)) : (t.operatorValue = ":", u(g)), t.inputValue = "", y.focus();
|
|
448
449
|
}, o = (g) => {
|
|
449
|
-
t.operatorValue = g,
|
|
450
|
-
},
|
|
451
|
-
const { replace:
|
|
452
|
-
let
|
|
453
|
-
if (
|
|
454
|
-
const K = { label:
|
|
455
|
-
if (
|
|
456
|
-
const ae = `${t.innerModelValue[
|
|
457
|
-
|
|
450
|
+
t.operatorValue = g, u(t.prevItem);
|
|
451
|
+
}, f = (g, _, I, y) => {
|
|
452
|
+
const { replace: C, operators: w, mergeTag: S } = g, V = ee(g), { indexMap: D } = t, M = D.get(I), E = G(a, g, _), A = t.operatorValue && w ? { operator: t.operatorValue } : null;
|
|
453
|
+
let P = null;
|
|
454
|
+
if (S) {
|
|
455
|
+
const K = { label: y, ...E };
|
|
456
|
+
if (M >= 0) {
|
|
457
|
+
const ae = `${t.innerModelValue[M].value} | ${y}`, ne = [...t.innerModelValue[M].options, K];
|
|
458
|
+
P = H({ ...t.innerModelValue[M], value: ae, options: ne });
|
|
458
459
|
} else
|
|
459
|
-
|
|
460
|
+
P = H({ ...V, label: I, value: y, options: [K] });
|
|
460
461
|
} else
|
|
461
|
-
|
|
462
|
-
if (
|
|
462
|
+
P = H({ ...V, label: I, value: y, ...E, ...A });
|
|
463
|
+
if (O(t, y, I)) {
|
|
463
464
|
te(t);
|
|
464
465
|
return;
|
|
465
466
|
}
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
let
|
|
469
|
-
if ((
|
|
467
|
+
k(t, !1);
|
|
468
|
+
const L = j(t.innerModelValue);
|
|
469
|
+
let F = [];
|
|
470
|
+
if ((C || S) && M >= 0) {
|
|
470
471
|
const K = [...t.innerModelValue];
|
|
471
|
-
K.splice(
|
|
472
|
+
K.splice(M, 1), F = [...K, P];
|
|
472
473
|
} else
|
|
473
|
-
|
|
474
|
-
R({ emit: e, state: t, newValue:
|
|
475
|
-
},
|
|
474
|
+
F = [...t.innerModelValue, P];
|
|
475
|
+
R({ emit: e, state: t, newValue: F, oldValue: L });
|
|
476
|
+
}, d = (g) => {
|
|
476
477
|
var _;
|
|
477
|
-
(_ = t.propItem) != null && _.label ?
|
|
478
|
-
},
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
const { prevItem:
|
|
482
|
-
if (!
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
},
|
|
478
|
+
(_ = t.propItem) != null && _.label ? p({ label: g }) : x();
|
|
479
|
+
}, p = (g, _ = !1) => {
|
|
480
|
+
var w;
|
|
481
|
+
k(t, !1), _ && (t.prevItem = g, t.backupPrevItem = g);
|
|
482
|
+
const { prevItem: I } = t, y = g.value || g.label, C = (w = l.$refs) == null ? void 0 : w.inputRef;
|
|
483
|
+
if (!O(t, y)) {
|
|
484
|
+
const S = t.propItem.label || g.label;
|
|
485
|
+
f(I, g, S, y);
|
|
486
|
+
}
|
|
487
|
+
C.focus();
|
|
488
|
+
}, b = (g, _) => {
|
|
488
489
|
if (g.label) {
|
|
489
490
|
if (!_.options)
|
|
490
491
|
return;
|
|
491
|
-
if (!a.modelValue.find((
|
|
492
|
-
const
|
|
493
|
-
|
|
492
|
+
if (!a.modelValue.find((y) => y.value === _.options[0].label)) {
|
|
493
|
+
const y = _.label, C = _.options && _.options[0].label;
|
|
494
|
+
f(_, _.options[0], y, C);
|
|
494
495
|
return;
|
|
495
496
|
}
|
|
496
497
|
} else
|
|
497
498
|
e("search", t.innerModelValue);
|
|
498
|
-
}, h = (g, _,
|
|
499
|
-
var
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
},
|
|
503
|
-
var
|
|
499
|
+
}, h = (g, _, I) => {
|
|
500
|
+
var C;
|
|
501
|
+
const y = (C = t.backupList) == null ? void 0 : C.find((w) => w.label === I);
|
|
502
|
+
f(g, y, _.label, I);
|
|
503
|
+
}, v = (g, _, I) => {
|
|
504
|
+
var y, C;
|
|
504
505
|
if (_.label) {
|
|
505
|
-
const { regexp:
|
|
506
|
-
if (
|
|
507
|
-
for (const
|
|
508
|
-
|
|
506
|
+
const { regexp: w, replace: S, type: V, mergeTag: D } = I, M = V !== "checkbox" && S || V === "checkbox" && D ? [g] : g.split(a.splitInputValue);
|
|
507
|
+
if (w)
|
|
508
|
+
for (const E of M)
|
|
509
|
+
w.test(E) && h(I, _, E);
|
|
509
510
|
else
|
|
510
|
-
for (const
|
|
511
|
-
h(
|
|
511
|
+
for (const E of M)
|
|
512
|
+
h(I, _, E);
|
|
512
513
|
} else {
|
|
513
|
-
const { items:
|
|
514
|
-
const { regexp:
|
|
515
|
-
return
|
|
516
|
-
}) || (
|
|
517
|
-
(
|
|
518
|
-
const
|
|
519
|
-
|
|
514
|
+
const { items: w, defaultField: S } = a, V = w.find((L) => {
|
|
515
|
+
const { regexp: F } = L;
|
|
516
|
+
return F && F.test(t.inputValue);
|
|
517
|
+
}) || (S ? w.find((L) => L.field === S) : t.allTypeAttri), { replace: D, type: M, mergeTag: E } = V, A = M !== "checkbox" && D || M === "checkbox" && E ? [g] : g.split(a.splitInputValue);
|
|
518
|
+
(y = V == null ? void 0 : V.options) != null && y.length && (t.backupList = [...V.options], (C = t.backupList) == null || C.forEach((L) => {
|
|
519
|
+
const F = L.value || L.label;
|
|
520
|
+
A.includes(F) && (L.isChecked = !0);
|
|
520
521
|
}));
|
|
521
|
-
const
|
|
522
|
-
for (const
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
},
|
|
526
|
-
const { inputValue: g, propItem: _, prevItem:
|
|
527
|
-
if (
|
|
528
|
-
|
|
522
|
+
const P = V.label;
|
|
523
|
+
for (const L of A)
|
|
524
|
+
f(V, {}, P, L);
|
|
525
|
+
}
|
|
526
|
+
}, x = () => {
|
|
527
|
+
const { inputValue: g, propItem: _, prevItem: I } = t;
|
|
528
|
+
if (i && i(), k(t, !1), !g)
|
|
529
|
+
b(_, I);
|
|
529
530
|
else {
|
|
530
|
-
const { maxlength:
|
|
531
|
-
if (
|
|
532
|
-
e("exceed",
|
|
531
|
+
const { maxlength: y } = a;
|
|
532
|
+
if (y && y < g.length) {
|
|
533
|
+
e("exceed", y);
|
|
533
534
|
return;
|
|
534
535
|
}
|
|
535
|
-
|
|
536
|
+
v(g, _, I);
|
|
536
537
|
}
|
|
537
538
|
};
|
|
538
|
-
return { selectPropItem:
|
|
539
|
+
return { selectPropItem: m, selectRadioItem: p, selectInputValue: d, createTag: x, helpClick: () => {
|
|
539
540
|
e("help");
|
|
540
541
|
}, setOperator: o };
|
|
541
542
|
}
|
|
542
|
-
const
|
|
543
|
+
const Tt = (a) => a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), oe = (a, e) => {
|
|
543
544
|
const t = [];
|
|
544
545
|
let s = 0, n;
|
|
545
546
|
for (; (n = a.exec(e)) !== null; ) {
|
|
546
|
-
const r = n.index,
|
|
547
|
-
r > s && t.push(e.slice(s, r)), t.push(e.slice(r,
|
|
547
|
+
const r = n.index, c = a.lastIndex;
|
|
548
|
+
r > s && t.push(e.slice(s, r)), t.push(e.slice(r, c)), s = c;
|
|
548
549
|
}
|
|
549
550
|
return s < e.length && t.push(e.slice(s)), t;
|
|
550
551
|
};
|
|
551
|
-
function
|
|
552
|
-
const n = async (
|
|
553
|
-
e.potentialOptions = await a.potentialOptions.getMatchList(
|
|
554
|
-
},
|
|
555
|
-
var _, y,
|
|
556
|
-
const { recordItems: o, propItem:
|
|
557
|
-
if (
|
|
558
|
-
t("exceed",
|
|
552
|
+
function Ct({ props: a, state: e, emit: t, nextTick: s }) {
|
|
553
|
+
const n = async (m) => {
|
|
554
|
+
e.potentialOptions = await a.potentialOptions.getMatchList(m), k(e, !0);
|
|
555
|
+
}, c = wt((m) => {
|
|
556
|
+
var _, I, y, C;
|
|
557
|
+
const { recordItems: o, propItem: f } = e, d = typeof m == "string" ? m : m && m.target && typeof m.target.value == "string" ? m.target.value : e.inputValue || "", p = (_ = String(d)) == null ? void 0 : _.trim(), { maxlength: b } = a;
|
|
558
|
+
if (b && b < p.length) {
|
|
559
|
+
t("exceed", b);
|
|
559
560
|
return;
|
|
560
561
|
}
|
|
561
|
-
if (
|
|
562
|
-
|
|
562
|
+
if (p.length === 0) {
|
|
563
|
+
k(e);
|
|
563
564
|
return;
|
|
564
565
|
}
|
|
565
|
-
Object.keys(e.matchItems).forEach((
|
|
566
|
-
e.matchItems[
|
|
566
|
+
Object.keys(e.matchItems).forEach((w) => {
|
|
567
|
+
e.matchItems[w].attr = [], e.matchItems[w].attrValue = [];
|
|
567
568
|
});
|
|
568
|
-
const h =
|
|
569
|
-
if (
|
|
570
|
-
e.propItem = { ...e.propItem, label:
|
|
569
|
+
const h = Tt(p), v = new RegExp(h, "i"), x = f.label || !h ? null : o.find((w) => w.type === "map" && v.test(w.label));
|
|
570
|
+
if (x) {
|
|
571
|
+
e.propItem = { ...e.propItem, label: x.label }, e.inputValue = "", e.prevItem = x, e.backupPrevItem = x, e.backupList = x.options || [];
|
|
571
572
|
return;
|
|
572
573
|
}
|
|
573
|
-
e.filterList = (
|
|
574
|
-
const
|
|
574
|
+
e.filterList = (I = e.backupList) == null ? void 0 : I.filter((w) => v.test(w.label) ? (delete w.isFilter, O(e, w.label) && e.checkboxGroup.push(`${e.prevItem.label}${w.label}`), !0) : (w.isFilter = !0, !1));
|
|
575
|
+
const T = new RegExp(h, "ig"), g = p.toLowerCase();
|
|
575
576
|
if (e.propItem.label) {
|
|
576
|
-
(y = e.backupList) == null || y.forEach((
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
}), (
|
|
577
|
+
(y = e.backupList) == null || y.forEach((w) => {
|
|
578
|
+
w.hightlighStr = g;
|
|
579
|
+
const S = w.label;
|
|
580
|
+
v.test(S) ? (w.match = oe(T, S), w.isFilter = !1) : w.isFilter = !0;
|
|
581
|
+
}), (C = e.backupList) != null && C.length || p ? k(e) : k(e, !1);
|
|
581
582
|
return;
|
|
582
583
|
}
|
|
583
|
-
for (const
|
|
584
|
-
const { options:
|
|
585
|
-
if (
|
|
586
|
-
const
|
|
587
|
-
e.matchItems[
|
|
584
|
+
for (const w of o) {
|
|
585
|
+
const { options: S = [], groupKey: V = "0", ...D } = w, M = D.label;
|
|
586
|
+
if (v.test(M)) {
|
|
587
|
+
const E = oe(T, M);
|
|
588
|
+
e.matchItems[V].attr.push({ ...w, match: E, hightlighStr: g });
|
|
588
589
|
}
|
|
589
|
-
for (const
|
|
590
|
-
const
|
|
591
|
-
if (
|
|
592
|
-
const
|
|
593
|
-
e.matchItems[
|
|
590
|
+
for (const E of S) {
|
|
591
|
+
const A = e.propItem.label ? M : `${M}:${E.label}`;
|
|
592
|
+
if (v.test(A)) {
|
|
593
|
+
const P = oe(T, A);
|
|
594
|
+
e.matchItems[V].attrValue.push({
|
|
595
|
+
...E,
|
|
594
596
|
...D,
|
|
595
|
-
|
|
596
|
-
options: T,
|
|
597
|
+
options: S,
|
|
597
598
|
hightlighStr: g,
|
|
598
|
-
value:
|
|
599
|
-
match:
|
|
599
|
+
value: E.label,
|
|
600
|
+
match: P
|
|
600
601
|
});
|
|
601
602
|
}
|
|
602
603
|
}
|
|
603
604
|
}
|
|
604
|
-
h && a.potentialOptions && a.potentialOptions.getMatchList ? n(h) :
|
|
605
|
-
}, 500),
|
|
606
|
-
|
|
607
|
-
},
|
|
608
|
-
var
|
|
609
|
-
(
|
|
605
|
+
h && a.potentialOptions && a.potentialOptions.getMatchList ? n(h) : k(e);
|
|
606
|
+
}, 500), i = () => {
|
|
607
|
+
c.cancel && c.cancel();
|
|
608
|
+
}, l = () => {
|
|
609
|
+
var m;
|
|
610
|
+
(m = e.backupList) == null || m.forEach((o) => o.isFilter && delete o.isFilter);
|
|
610
611
|
};
|
|
611
612
|
return {
|
|
612
|
-
handleInput:
|
|
613
|
-
selectFirstMap: (
|
|
614
|
-
var
|
|
615
|
-
const { options:
|
|
616
|
-
if (
|
|
617
|
-
|
|
618
|
-
const
|
|
619
|
-
h.isChecked =
|
|
613
|
+
handleInput: c,
|
|
614
|
+
selectFirstMap: (m, o) => {
|
|
615
|
+
var b;
|
|
616
|
+
const { options: f } = m, { prevItem: d, propItem: p } = e;
|
|
617
|
+
if (f)
|
|
618
|
+
k(e, !1), e.propItem = { ...e.propItem, value: `${m.label}=` }, e.isShowTagKey = !1, e.inputValue = "", e.backupList = m.options || [], l(), (b = e.backupList) == null || b.forEach((h) => {
|
|
619
|
+
const v = p.value + h.label;
|
|
620
|
+
h.isChecked = O(e, v);
|
|
620
621
|
});
|
|
621
622
|
else {
|
|
622
|
-
if (
|
|
623
|
+
if (m.isChecked)
|
|
623
624
|
return;
|
|
624
|
-
|
|
625
|
-
const { field: h, type:
|
|
625
|
+
k(e, !1), e.isShowTagKey = !0, l();
|
|
626
|
+
const { field: h, type: v } = d, x = p.value + m.label, T = G(a, d, m), _ = [H({ type: v, field: h, label: p.label, value: x, ...T })];
|
|
626
627
|
R({ emit: t, state: e, nextTick: s, tagList: _ });
|
|
627
628
|
}
|
|
628
|
-
o &&
|
|
629
|
+
o && k(e);
|
|
629
630
|
},
|
|
630
|
-
cancelHandleInput:
|
|
631
|
+
cancelHandleInput: i
|
|
631
632
|
};
|
|
632
633
|
}
|
|
633
|
-
function
|
|
634
|
+
function St({ props: a, state: e, emit: t, nextTick: s }) {
|
|
634
635
|
return {
|
|
635
636
|
selectCheckbox: (r) => {
|
|
636
|
-
var
|
|
637
|
-
|
|
638
|
-
const { checkboxGroup:
|
|
637
|
+
var m, o;
|
|
638
|
+
k(e, !1);
|
|
639
|
+
const { checkboxGroup: c, prevItem: i, propItem: l } = e, u = ee(i);
|
|
639
640
|
if (r) {
|
|
640
|
-
const
|
|
641
|
-
if (
|
|
642
|
-
let
|
|
643
|
-
const
|
|
644
|
-
if (g !== void 0 && e.innerModelValue.splice(g, 1), (
|
|
645
|
-
const { label:
|
|
646
|
-
if (
|
|
641
|
+
const f = [], d = j(e.innerModelValue), { mergeTag: p, operators: b, label: h } = i;
|
|
642
|
+
if (p) {
|
|
643
|
+
let v = "";
|
|
644
|
+
const x = [], { indexMap: T } = e, g = T.get(h);
|
|
645
|
+
if (g !== void 0 && e.innerModelValue.splice(g, 1), (m = e.backupList) == null || m.forEach((_) => {
|
|
646
|
+
const { label: I } = _, y = `${h}${I}`;
|
|
647
|
+
if (c.includes(y)) {
|
|
647
648
|
delete _.isFilter;
|
|
648
|
-
const
|
|
649
|
-
|
|
649
|
+
const w = G(a, i, _), S = { label: _.label, ...w };
|
|
650
|
+
v += v ? ` | ${I}` : I, x.push(S);
|
|
650
651
|
}
|
|
651
|
-
}),
|
|
652
|
-
const _ = { ...
|
|
653
|
-
|
|
652
|
+
}), x.length > 0) {
|
|
653
|
+
const _ = { ...u, value: v, options: x };
|
|
654
|
+
f.push(_);
|
|
654
655
|
}
|
|
655
656
|
} else {
|
|
656
|
-
const { valueMap:
|
|
657
|
-
if ((o = e.backupList) == null || o.forEach((
|
|
658
|
-
const { label: g } =
|
|
659
|
-
if (
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
} else if (!
|
|
663
|
-
|
|
664
|
-
const
|
|
665
|
-
|
|
657
|
+
const { valueMap: v } = e, x = [];
|
|
658
|
+
if ((o = e.backupList) == null || o.forEach((T) => {
|
|
659
|
+
const { label: g } = T, _ = `${h}${g}`, I = c.includes(_);
|
|
660
|
+
if (I && !O(e, g)) {
|
|
661
|
+
const y = G(a, i, T), C = e.operatorValue && b ? { operator: e.operatorValue } : null, w = H({ ...u, label: l.label, value: g, ...y, ...C });
|
|
662
|
+
f.push(w), T.isChecked = !0;
|
|
663
|
+
} else if (!I && O(e, g)) {
|
|
664
|
+
T.isChecked = !1;
|
|
665
|
+
const y = v.get(_);
|
|
666
|
+
x.push(y);
|
|
666
667
|
}
|
|
667
|
-
}),
|
|
668
|
-
const
|
|
669
|
-
R({ emit: t, state: e, nextTick: s, newValue:
|
|
668
|
+
}), x.length) {
|
|
669
|
+
const T = e.innerModelValue.filter((g, _) => g && !x.includes(_));
|
|
670
|
+
R({ emit: t, state: e, nextTick: s, newValue: T, oldValue: d });
|
|
670
671
|
return;
|
|
671
672
|
}
|
|
672
673
|
}
|
|
673
|
-
R({ emit: t, state: e, nextTick: s, tagList:
|
|
674
|
+
R({ emit: t, state: e, nextTick: s, tagList: f, oldValue: d });
|
|
674
675
|
} else
|
|
675
|
-
e.propItem = { ...
|
|
676
|
+
e.propItem = { ...l, label: "" }, e.inputValue = "";
|
|
676
677
|
}
|
|
677
678
|
};
|
|
678
679
|
}
|
|
679
|
-
function
|
|
680
|
+
function Dt({ props: a, state: e, emit: t, nextTick: s, vm: n }) {
|
|
680
681
|
const r = n || e.instance;
|
|
681
682
|
return {
|
|
682
|
-
onConfirmDate: async (
|
|
683
|
-
if (!
|
|
683
|
+
onConfirmDate: async (u, m = !1) => {
|
|
684
|
+
if (!u) {
|
|
684
685
|
e.propItem = { label: "" };
|
|
685
686
|
return;
|
|
686
687
|
}
|
|
687
|
-
const o = await ie(r, e, a,
|
|
688
|
+
const o = await ie(r, e, a, m);
|
|
688
689
|
if (o) {
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
|
|
690
|
+
k(e, !1);
|
|
691
|
+
const f = a.modelValue.filter((d) => d.type !== o.type || d.field !== o.field);
|
|
692
|
+
f.push(o), R({ emit: t, state: e, nextTick: s, newValue: f });
|
|
692
693
|
} else
|
|
693
|
-
|
|
694
|
+
k(e);
|
|
694
695
|
},
|
|
695
|
-
handleDateShow: () =>
|
|
696
|
-
pickerOptions: (
|
|
696
|
+
handleDateShow: () => k(e),
|
|
697
|
+
pickerOptions: (u, m = "") => ({
|
|
697
698
|
disabledDate(o) {
|
|
698
|
-
const { maxTimeLength:
|
|
699
|
-
if (
|
|
700
|
-
if (
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
return h <
|
|
704
|
-
} else if (!
|
|
705
|
-
const
|
|
706
|
-
return h <
|
|
699
|
+
const { maxTimeLength: f = 0, min: d, max: p } = e.prevItem, b = e[m], h = o.getTime();
|
|
700
|
+
if (f > 0)
|
|
701
|
+
if (d || p)
|
|
702
|
+
if (m && b) {
|
|
703
|
+
const v = new Date(b).getTime(), x = !d && p ? v - f : Math.max(d.getTime(), v - f);
|
|
704
|
+
return h < x || h > v;
|
|
705
|
+
} else if (!m && u) {
|
|
706
|
+
const v = new Date(u).getTime(), x = d && !p ? v + f : Math.min(p.getTime(), v + f);
|
|
707
|
+
return h < v || h > x;
|
|
707
708
|
} else
|
|
708
|
-
return
|
|
709
|
-
else if (
|
|
710
|
-
const
|
|
711
|
-
return h <
|
|
712
|
-
} else if (!
|
|
713
|
-
const
|
|
714
|
-
return h <
|
|
709
|
+
return d && h < d.getTime() || p && h > p.getTime();
|
|
710
|
+
else if (m && b) {
|
|
711
|
+
const v = new Date(b).getTime(), x = v - f;
|
|
712
|
+
return h < x || h > v;
|
|
713
|
+
} else if (!m && u) {
|
|
714
|
+
const v = new Date(u).getTime(), x = v + f;
|
|
715
|
+
return h < v || h > x;
|
|
715
716
|
} else
|
|
716
717
|
return !1;
|
|
717
|
-
else if (
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
720
|
-
return
|
|
721
|
-
} else if (!
|
|
722
|
-
const
|
|
723
|
-
return h <
|
|
718
|
+
else if (d || p)
|
|
719
|
+
if (m && b) {
|
|
720
|
+
const v = new Date(b).getTime();
|
|
721
|
+
return d && h < d.getTime() || h > v;
|
|
722
|
+
} else if (!m && u) {
|
|
723
|
+
const v = new Date(u).getTime();
|
|
724
|
+
return h < v || p && h > p.getTime();
|
|
724
725
|
} else
|
|
725
|
-
return h <
|
|
726
|
-
else if (
|
|
727
|
-
const
|
|
728
|
-
return h >
|
|
729
|
-
} else if (!
|
|
730
|
-
const
|
|
731
|
-
return h <
|
|
726
|
+
return h < d || h > p;
|
|
727
|
+
else if (m && b) {
|
|
728
|
+
const v = new Date(b).getTime();
|
|
729
|
+
return h > v;
|
|
730
|
+
} else if (!m && u) {
|
|
731
|
+
const v = new Date(u).getTime();
|
|
732
|
+
return h < v;
|
|
732
733
|
} else
|
|
733
734
|
return !1;
|
|
734
735
|
}
|
|
735
736
|
})
|
|
736
737
|
};
|
|
737
738
|
}
|
|
738
|
-
function
|
|
739
|
-
const
|
|
740
|
-
if (!
|
|
739
|
+
function Mt({ props: a, state: e, t, emit: s, nextTick: n, vm: r }) {
|
|
740
|
+
const c = r || e.instance, i = async (m) => {
|
|
741
|
+
if (!m) {
|
|
741
742
|
e.propItem = { ...e.propItem, label: "" };
|
|
742
743
|
return;
|
|
743
744
|
}
|
|
744
|
-
const o = await De(
|
|
745
|
+
const o = await De(c, e, a);
|
|
745
746
|
if (o) {
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
|
|
747
|
+
k(e, !1);
|
|
748
|
+
const f = a.modelValue.filter((d) => d.type !== o.type || d.field !== o.field);
|
|
749
|
+
f.push(o), R({ emit: s, state: e, nextTick: n, newValue: f });
|
|
749
750
|
} else
|
|
750
|
-
|
|
751
|
-
},
|
|
752
|
-
const { maxTimeLength:
|
|
751
|
+
k(e);
|
|
752
|
+
}, l = (m, o, f) => {
|
|
753
|
+
const { maxTimeLength: d = 0 } = m;
|
|
753
754
|
return {
|
|
754
755
|
[o]: {
|
|
755
|
-
validator: (
|
|
756
|
-
|
|
756
|
+
validator: (p, b, h) => {
|
|
757
|
+
d > 0 && !b ? h(new Error(t("tvp.tvpSearchbox.notBeNull"))) : !b && !e[f] ? h(new Error(t("tvp.tvpSearchbox.rangeDateTitle"))) : h();
|
|
757
758
|
}
|
|
758
759
|
},
|
|
759
|
-
[
|
|
760
|
-
validator: (
|
|
761
|
-
|
|
760
|
+
[f]: {
|
|
761
|
+
validator: (p, b, h) => {
|
|
762
|
+
d > 0 && !b ? h(new Error(t("tvp.tvpSearchbox.notBeNull"))) : !b && !e[o] ? h(new Error(t("tvp.tvpSearchbox.rangeDateTitle"))) : h();
|
|
762
763
|
}
|
|
763
764
|
}
|
|
764
765
|
};
|
|
765
766
|
};
|
|
766
767
|
return {
|
|
767
768
|
initFormRule: () => {
|
|
768
|
-
let
|
|
769
|
-
a.items.forEach((
|
|
770
|
-
|
|
769
|
+
let m = {}, o = {};
|
|
770
|
+
a.items.forEach((f) => {
|
|
771
|
+
f.type === "dateRange" && (m = l(f, "startDate", "endDate")), f.type === "datetimeRange" && (o = l(f, "startDateTime", "endDateTime"));
|
|
771
772
|
}), e.formRules = {
|
|
772
|
-
...
|
|
773
|
+
...m,
|
|
773
774
|
...o
|
|
774
775
|
}, a.editable && (e.formRules.inputEditValue = {
|
|
775
776
|
required: !0,
|
|
@@ -777,115 +778,132 @@ function Dt({ props: a, state: e, t, emit: s, nextTick: n, vm: r }) {
|
|
|
777
778
|
trigger: ["change", "blur"]
|
|
778
779
|
});
|
|
779
780
|
},
|
|
780
|
-
sizeChange:
|
|
781
|
+
sizeChange: i
|
|
781
782
|
};
|
|
782
783
|
}
|
|
783
|
-
function
|
|
784
|
-
const
|
|
785
|
-
var
|
|
786
|
-
const { operator:
|
|
787
|
-
if (
|
|
788
|
-
if (
|
|
789
|
-
Me(e,
|
|
790
|
-
else if (
|
|
784
|
+
function Et({ props: a, state: e, t, nextTick: s, format: n, emit: r, vm: c }) {
|
|
785
|
+
const i = (d) => {
|
|
786
|
+
var I;
|
|
787
|
+
const { operator: p, value: b, start: h, end: v } = d, { options: x, operators: T, type: g, mergeTag: _ } = e.prevItem;
|
|
788
|
+
if (g !== "custom") {
|
|
789
|
+
if (g === "numRange")
|
|
790
|
+
Me(e, d, t);
|
|
791
|
+
else if (g === "dateRange") {
|
|
791
792
|
const { dateRangeFormat: y } = e;
|
|
792
|
-
e.startDate = n(
|
|
793
|
-
} else if (
|
|
793
|
+
e.startDate = n(h, y), e.endDate = n(v, y);
|
|
794
|
+
} else if (g === "datetimeRange") {
|
|
794
795
|
const { datetimeRangeFormat: y } = e;
|
|
795
|
-
e.startDateTime = n(
|
|
796
|
+
e.startDateTime = n(h, y), e.endDateTime = n(v, y);
|
|
796
797
|
} else {
|
|
797
|
-
if (
|
|
798
|
-
const y = ((
|
|
798
|
+
if (_) {
|
|
799
|
+
const y = ((I = d.options) == null ? void 0 : I.flatMap((C) => C.label)) || [];
|
|
799
800
|
e.inputEditValue = y, e.currentEditSelectTags = y;
|
|
800
801
|
} else
|
|
801
|
-
e.inputEditValue = Array.isArray(
|
|
802
|
-
e.currentEditValue =
|
|
802
|
+
e.inputEditValue = Array.isArray(b) ? b.join(",") : b || "";
|
|
803
|
+
e.currentEditValue = x;
|
|
803
804
|
}
|
|
804
|
-
e.operatorValue =
|
|
805
|
+
e.operatorValue = p, e.currentOperators = T;
|
|
805
806
|
}
|
|
807
|
+
}, l = async () => {
|
|
808
|
+
var h, v;
|
|
809
|
+
if (!((v = (h = e.instance) == null ? void 0 : h.$refs) != null && v.formRef))
|
|
810
|
+
return;
|
|
811
|
+
const { prevItem: d } = e;
|
|
812
|
+
let p = [];
|
|
813
|
+
if (d.type === "numRange" ? p = [e.curMinNumVar, e.curMaxNumVar] : d.type === "dateRange" ? p = ["startDate", "endDate"] : d.type === "datetimeRange" ? p = ["startDateTime", "endDateTime"] : ["custom", "map"].includes(d.type) || (p = ["inputEditValue"]), (p == null ? void 0 : p.length) === 0) {
|
|
814
|
+
e.hasFormError = !1;
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
let b = !1;
|
|
818
|
+
await e.instance.$refs.formRef.validateField(p, (x) => {
|
|
819
|
+
x && (b = !0);
|
|
820
|
+
}), e.hasFormError = b;
|
|
806
821
|
};
|
|
807
822
|
return {
|
|
808
|
-
editTag: (
|
|
809
|
-
if (!a.editable ||
|
|
823
|
+
editTag: (d, p, b) => {
|
|
824
|
+
if (!a.editable || d.type && d.type === "map")
|
|
810
825
|
return;
|
|
811
|
-
|
|
812
|
-
const
|
|
826
|
+
k(e, !1), e.popoverVisible = !1;
|
|
827
|
+
const h = b.target.classList.contains("tiny-tag") ? b.target : b.srcElement.parentElement;
|
|
813
828
|
s(() => {
|
|
814
|
-
const { popoverRef:
|
|
815
|
-
|
|
816
|
-
}), e.prevItem = e.recordItems.find((
|
|
829
|
+
const { popoverRef: v } = e.instance.$refs;
|
|
830
|
+
v.state.referenceElm = h, v.state.popperElm && (v.state.popperElm.style.display = "none"), v.doDestroy(), e.popoverVisible = !0, l();
|
|
831
|
+
}), e.prevItem = e.recordItems.find((v) => v.field === d.field), !e.prevItem && (e.prevItem = d), e.selectValue = d.label, e.currentModelValueIndex = p, r("tagClick", d), i(d);
|
|
817
832
|
},
|
|
818
|
-
confirmEditTag: async (
|
|
819
|
-
if (!
|
|
833
|
+
confirmEditTag: async (d) => {
|
|
834
|
+
if (!d) {
|
|
820
835
|
e.popoverVisible = !1;
|
|
821
836
|
return;
|
|
822
837
|
}
|
|
823
|
-
const { prevItem:
|
|
824
|
-
let
|
|
825
|
-
|
|
838
|
+
const { prevItem: p, currentModelValueIndex: b } = e;
|
|
839
|
+
let h = null;
|
|
840
|
+
p.type === "numRange" ? h = await De(e.instance, e, a) : p.type === "dateRange" ? h = await ie(e.instance, e, a, !1) : p.type === "datetimeRange" ? h = await ie(e.instance, e, a, !0) : h = await kt(e.instance, e, a), h ? (k(e, !1), e.popoverVisible = !1, R({ emit: r, state: e, nextTick: s, index: b, newTag: h, isEdit: !0 })) : e.popoverVisible = !0, e.currentEditValue = [];
|
|
826
841
|
},
|
|
827
|
-
selectPropChange: (
|
|
828
|
-
|
|
842
|
+
selectPropChange: (d, p) => {
|
|
843
|
+
p || (e.prevItem = d, i(d), s(() => {
|
|
844
|
+
l();
|
|
845
|
+
}));
|
|
829
846
|
},
|
|
830
|
-
selectItemIsDisable: (
|
|
831
|
-
var
|
|
832
|
-
if (
|
|
847
|
+
selectItemIsDisable: (d) => {
|
|
848
|
+
var b, h, v, x;
|
|
849
|
+
if (d.type && d.type === "map")
|
|
833
850
|
return !0;
|
|
834
|
-
if ((
|
|
835
|
-
return ((
|
|
836
|
-
const
|
|
837
|
-
return e.prevItem.type &&
|
|
838
|
-
}
|
|
851
|
+
if ((b = e.prevItem) != null && b.operators || d.operators)
|
|
852
|
+
return ((h = e.prevItem.operators) == null ? void 0 : h.length) !== ((v = d.operators) == null ? void 0 : v.length);
|
|
853
|
+
const p = ["radio", "checkbox"];
|
|
854
|
+
return e.prevItem.type && p.includes(e.prevItem.type) ? d.type ? !p.includes(d.type) : !1 : ((x = e.prevItem) == null ? void 0 : x.type) !== d.type;
|
|
855
|
+
},
|
|
856
|
+
checkFormValidation: l
|
|
839
857
|
};
|
|
840
858
|
}
|
|
841
|
-
function
|
|
842
|
-
const s = (
|
|
843
|
-
|
|
844
|
-
const { prevItem:
|
|
845
|
-
if (
|
|
846
|
-
const
|
|
847
|
-
R({ emit: e, state: a, nextTick: t, newTag:
|
|
859
|
+
function $t({ state: a, emit: e, nextTick: t }) {
|
|
860
|
+
const s = (c) => {
|
|
861
|
+
k(a, !1);
|
|
862
|
+
const { prevItem: i, indexMap: l } = a, { replace: u, label: m } = i, o = [];
|
|
863
|
+
if (u && l.has(m)) {
|
|
864
|
+
const f = l.get(m), d = { ...i, ...c };
|
|
865
|
+
R({ emit: e, state: a, nextTick: t, newTag: d, index: f });
|
|
848
866
|
return;
|
|
849
867
|
} else
|
|
850
|
-
!
|
|
851
|
-
|
|
852
|
-
}) :
|
|
868
|
+
!u && Array.isArray(c) ? c.forEach((f) => {
|
|
869
|
+
O(a, f.value) || o.push({ ...i, ...f });
|
|
870
|
+
}) : O(a, c.value) || o.push({ ...i, ...c });
|
|
853
871
|
R({ emit: e, state: a, nextTick: t, tagList: o });
|
|
854
872
|
};
|
|
855
873
|
return {
|
|
856
|
-
handleConfirm: (
|
|
857
|
-
if (!
|
|
858
|
-
te(a),
|
|
874
|
+
handleConfirm: (c) => {
|
|
875
|
+
if (!c) {
|
|
876
|
+
te(a), k(a, !1);
|
|
859
877
|
return;
|
|
860
878
|
}
|
|
861
|
-
s(
|
|
879
|
+
s(c);
|
|
862
880
|
},
|
|
863
|
-
handleEditConfirm: (
|
|
864
|
-
if (!
|
|
881
|
+
handleEditConfirm: (c) => {
|
|
882
|
+
if (!c) {
|
|
865
883
|
Q(a, !1);
|
|
866
884
|
return;
|
|
867
885
|
}
|
|
868
|
-
s(
|
|
886
|
+
s(c);
|
|
869
887
|
}
|
|
870
888
|
};
|
|
871
889
|
}
|
|
872
890
|
function Lt({ props: a, state: e }) {
|
|
873
891
|
return {
|
|
874
892
|
initItems: () => {
|
|
875
|
-
e.groupItems = {}, e.recordItems.forEach((
|
|
876
|
-
var
|
|
877
|
-
const { groupKey:
|
|
878
|
-
if (e.groupItems[
|
|
879
|
-
const { options:
|
|
880
|
-
e.prevItem =
|
|
881
|
-
const { label:
|
|
882
|
-
|
|
883
|
-
})),
|
|
893
|
+
e.groupItems = {}, e.recordItems.forEach((i) => {
|
|
894
|
+
var u;
|
|
895
|
+
const { groupKey: l = "0" } = i;
|
|
896
|
+
if (e.groupItems[l] ? e.groupItems[l].push({ ...i }) : (e.groupItems[l] = [{ ...i }], e.matchItems[l] = { attr: [], attrValue: [] }), e.prevItem && i.field === e.prevItem.field && i !== e.prevItem) {
|
|
897
|
+
const { options: m, type: o } = i;
|
|
898
|
+
e.prevItem = i, m != null && m.length && (e.backupList = m), o === "checkbox" && (e.filterList = e.backupList, e.checkboxGroup = [], (u = e.backupList) == null || u.forEach((f) => {
|
|
899
|
+
const { label: d } = f;
|
|
900
|
+
O(e, d) && e.checkboxGroup.push(`${i.label}${d}`), f.isFilter = !1;
|
|
901
|
+
})), k(e, i.field === e.prevItem.field && i !== e.prevItem);
|
|
884
902
|
}
|
|
885
903
|
});
|
|
886
904
|
},
|
|
887
905
|
watchOutsideClick: () => {
|
|
888
|
-
a.editable && Q(e, !1), e.isMouseDown = !1,
|
|
906
|
+
a.editable && Q(e, !1), e.isMouseDown = !1, k(e, !1);
|
|
889
907
|
},
|
|
890
908
|
watchMouseDown: () => {
|
|
891
909
|
e.isMouseDown = !0;
|
|
@@ -893,10 +911,10 @@ function Lt({ props: a, state: e }) {
|
|
|
893
911
|
watchMouseMove: () => {
|
|
894
912
|
e.isMouseDown && (e.isMouseDown = !1);
|
|
895
913
|
},
|
|
896
|
-
handleClick: (
|
|
897
|
-
var
|
|
898
|
-
const { backupPrevItem:
|
|
899
|
-
|
|
914
|
+
handleClick: (i) => {
|
|
915
|
+
var m;
|
|
916
|
+
const { backupPrevItem: l, prevItem: u } = e;
|
|
917
|
+
i.stopPropagation(), a.editable && (e.popoverVisible = !1, e.currentEditValue = [], e.propItem.label && l && l !== u && (e.prevItem = l)), e.hasBackupList && (((m = e.backupList) == null ? void 0 : m.length) === 0 || !e.backupList) && !e.inputValue || a.items.length === 0 ? k(e, !1) : k(e);
|
|
900
918
|
}
|
|
901
919
|
};
|
|
902
920
|
}
|
|
@@ -941,7 +959,7 @@ const Ee = {
|
|
|
941
959
|
initUse: "搜索"
|
|
942
960
|
}
|
|
943
961
|
}
|
|
944
|
-
},
|
|
962
|
+
}, $e = {
|
|
945
963
|
tvp: {
|
|
946
964
|
tvpSearchbox: {
|
|
947
965
|
defaultPlaceholder: "Select attribute filtering or enter keywords",
|
|
@@ -984,17 +1002,17 @@ const Ee = {
|
|
|
984
1002
|
}
|
|
985
1003
|
}, W = "zh-CN", q = {
|
|
986
1004
|
"zh-CN": Ee,
|
|
987
|
-
"en-US":
|
|
1005
|
+
"en-US": $e
|
|
988
1006
|
};
|
|
989
|
-
let
|
|
990
|
-
const
|
|
991
|
-
|
|
1007
|
+
let $ = null;
|
|
1008
|
+
const Nt = (a) => {
|
|
1009
|
+
$ = a;
|
|
992
1010
|
}, me = () => {
|
|
993
1011
|
var a, e, t, s, n;
|
|
994
|
-
if ((t = (e = (a =
|
|
995
|
-
return
|
|
996
|
-
if ((s =
|
|
997
|
-
return
|
|
1012
|
+
if ((t = (e = (a = $ == null ? void 0 : $.config) == null ? void 0 : a.globalProperties) == null ? void 0 : e.$i18n) != null && t.locale)
|
|
1013
|
+
return $.config.globalProperties.$i18n.locale;
|
|
1014
|
+
if ((s = $ == null ? void 0 : $.$i18n) != null && s.locale)
|
|
1015
|
+
return $.$i18n.locale;
|
|
998
1016
|
if (typeof navigator < "u") {
|
|
999
1017
|
const r = navigator.language || ((n = navigator.languages) == null ? void 0 : n[0]);
|
|
1000
1018
|
if (r)
|
|
@@ -1002,36 +1020,36 @@ const $t = (a) => {
|
|
|
1002
1020
|
}
|
|
1003
1021
|
return W;
|
|
1004
1022
|
}, ce = (a) => q[a] || q[W], N = (a, e = {}) => {
|
|
1005
|
-
var
|
|
1023
|
+
var c, i;
|
|
1006
1024
|
if (!a)
|
|
1007
1025
|
return "";
|
|
1008
|
-
if ((
|
|
1026
|
+
if ((i = (c = $ == null ? void 0 : $.config) == null ? void 0 : c.globalProperties) != null && i.$t)
|
|
1009
1027
|
try {
|
|
1010
|
-
const
|
|
1011
|
-
if (
|
|
1012
|
-
return
|
|
1013
|
-
} catch (
|
|
1014
|
-
console.warn("[TinySearchBox] i18n translation failed:",
|
|
1028
|
+
const l = $.config.globalProperties.$t(a, e);
|
|
1029
|
+
if (l && l !== a)
|
|
1030
|
+
return l;
|
|
1031
|
+
} catch (l) {
|
|
1032
|
+
console.warn("[TinySearchBox] i18n translation failed:", l);
|
|
1015
1033
|
}
|
|
1016
|
-
if (
|
|
1034
|
+
if ($ != null && $.$t)
|
|
1017
1035
|
try {
|
|
1018
|
-
const
|
|
1019
|
-
if (
|
|
1020
|
-
return
|
|
1021
|
-
} catch (
|
|
1022
|
-
console.warn("[TinySearchBox] i18n translation failed:",
|
|
1036
|
+
const l = $.$t(a, e);
|
|
1037
|
+
if (l && l !== a)
|
|
1038
|
+
return l;
|
|
1039
|
+
} catch (l) {
|
|
1040
|
+
console.warn("[TinySearchBox] i18n translation failed:", l);
|
|
1023
1041
|
}
|
|
1024
1042
|
const t = me(), s = ce(t), n = a.split(".");
|
|
1025
1043
|
let r = s;
|
|
1026
|
-
for (const
|
|
1027
|
-
if (r && typeof r == "object" &&
|
|
1028
|
-
r = r[
|
|
1044
|
+
for (const l of n)
|
|
1045
|
+
if (r && typeof r == "object" && l in r)
|
|
1046
|
+
r = r[l];
|
|
1029
1047
|
else {
|
|
1030
1048
|
if (t !== W) {
|
|
1031
1049
|
r = ce(W);
|
|
1032
|
-
for (const
|
|
1033
|
-
if (r && typeof r == "object" &&
|
|
1034
|
-
r = r[
|
|
1050
|
+
for (const m of n)
|
|
1051
|
+
if (r && typeof r == "object" && m in r)
|
|
1052
|
+
r = r[m];
|
|
1035
1053
|
else {
|
|
1036
1054
|
r = a;
|
|
1037
1055
|
break;
|
|
@@ -1040,24 +1058,24 @@ const $t = (a) => {
|
|
|
1040
1058
|
r = a;
|
|
1041
1059
|
break;
|
|
1042
1060
|
}
|
|
1043
|
-
return typeof r == "string" && Object.keys(e).length > 0 ? r.replace(/\{(\w+)\}/g, (
|
|
1044
|
-
},
|
|
1061
|
+
return typeof r == "string" && Object.keys(e).length > 0 ? r.replace(/\{(\w+)\}/g, (l, u) => e[u] !== void 0 ? e[u] : l) : typeof r == "string" ? r : a;
|
|
1062
|
+
}, Rt = (a, e = {}) => a.map((t) => N(t, e)), Pt = (a) => a in q, Ot = () => Object.keys(q), Ft = (a, e) => {
|
|
1045
1063
|
q[a] = e;
|
|
1046
|
-
},
|
|
1064
|
+
}, At = (a) => {
|
|
1047
1065
|
a !== W && delete q[a];
|
|
1048
|
-
},
|
|
1066
|
+
}, Bt = {
|
|
1049
1067
|
t: N,
|
|
1050
1068
|
zhCN: Ee,
|
|
1051
|
-
enUS:
|
|
1052
|
-
tArray:
|
|
1053
|
-
setGlobalApp:
|
|
1069
|
+
enUS: $e,
|
|
1070
|
+
tArray: Rt,
|
|
1071
|
+
setGlobalApp: Nt,
|
|
1054
1072
|
getCurrentLocale: me,
|
|
1055
1073
|
getLocaleMessages: ce,
|
|
1056
|
-
isLocaleSupported:
|
|
1057
|
-
getSupportedLocales:
|
|
1058
|
-
addLocale:
|
|
1059
|
-
removeLocale:
|
|
1060
|
-
},
|
|
1074
|
+
isLocaleSupported: Pt,
|
|
1075
|
+
getSupportedLocales: Ot,
|
|
1076
|
+
addLocale: Ft,
|
|
1077
|
+
removeLocale: At
|
|
1078
|
+
}, zt = [
|
|
1061
1079
|
"t",
|
|
1062
1080
|
"state",
|
|
1063
1081
|
"isShowClose",
|
|
@@ -1084,11 +1102,11 @@ const $t = (a) => {
|
|
|
1084
1102
|
"handleEditConfirm",
|
|
1085
1103
|
"showDropdown",
|
|
1086
1104
|
"showPopover"
|
|
1087
|
-
],
|
|
1088
|
-
const
|
|
1105
|
+
], jt = ({ reactive: a, computed: e, api: t, i18n: s, watch: n, props: r, emit: c, vm: i }) => {
|
|
1106
|
+
const l = a({
|
|
1089
1107
|
innerModelValue: [...r.modelValue],
|
|
1090
1108
|
placeholder: r.emptyPlaceholder || N("tvp.tvpSearchbox.addPlaceholder"),
|
|
1091
|
-
emitter:
|
|
1109
|
+
emitter: c,
|
|
1092
1110
|
recordItems: [],
|
|
1093
1111
|
groupItems: {},
|
|
1094
1112
|
inputValue: "",
|
|
@@ -1127,124 +1145,127 @@ const $t = (a) => {
|
|
|
1127
1145
|
currentEditSelectTags: [],
|
|
1128
1146
|
visible: !1,
|
|
1129
1147
|
visibleTimer: null,
|
|
1130
|
-
|
|
1131
|
-
|
|
1148
|
+
hasFormError: !1,
|
|
1149
|
+
// 表单校验错误状态
|
|
1150
|
+
hasBackupList: e(() => l.propItem.label && [void 0, "radio", "checkbox", "map"].includes(l.prevItem.type)),
|
|
1151
|
+
isIndeterminate: e(() => l.checkboxGroup.length > 0 && l.checkboxGroup.length !== l.filterList.length),
|
|
1132
1152
|
checkAll: e({
|
|
1133
|
-
get: () =>
|
|
1134
|
-
set: (
|
|
1135
|
-
|
|
1153
|
+
get: () => l.checkboxGroup.length && l.checkboxGroup.length === l.filterList.length,
|
|
1154
|
+
set: (u) => {
|
|
1155
|
+
u ? l.checkboxGroup = l.filterList.flatMap((m) => `${l.prevItem.label}${m.label}`) : l.checkboxGroup = [];
|
|
1136
1156
|
}
|
|
1137
1157
|
})
|
|
1138
1158
|
});
|
|
1139
|
-
return
|
|
1140
|
-
},
|
|
1141
|
-
const o = {},
|
|
1142
|
-
return
|
|
1159
|
+
return l;
|
|
1160
|
+
}, Ht = (a, { getCurrentInstance: e, onMounted: t, onBeforeUnmount: s, computed: n, reactive: r, watch: c }, { emit: i, nextTick: l, refs: u, vm: m }) => {
|
|
1161
|
+
const o = {}, f = a.emitter ? a.emitter.emit : i, d = jt({ reactive: r, computed: n, api: o, i18n: Bt, watch: c, props: a, emit: f, vm: m });
|
|
1162
|
+
return Gt({ api: o, state: d, t: N, props: a, emit: f, nextTick: l, vm: m, computed: n }), Kt({ watch: c, state: d, props: a, api: o, nextTick: l, vm: m }), d.instance = m, t(() => {
|
|
1143
1163
|
typeof document < "u" && (document.addEventListener("click", o.watchOutsideClick), document.addEventListener("mousedown", o.watchMouseDown), document.addEventListener("mousemove", o.watchMouseMove));
|
|
1144
1164
|
}), s(() => {
|
|
1145
|
-
typeof document < "u" && (document.removeEventListener("click", o.watchOutsideClick), document.removeEventListener("mousedown", o.watchMouseDown), document.removeEventListener("mousemove", o.watchMouseMove),
|
|
1165
|
+
typeof document < "u" && (document.removeEventListener("click", o.watchOutsideClick), document.removeEventListener("mousedown", o.watchMouseDown), document.removeEventListener("mousemove", o.watchMouseMove), d.localeCheckInterval && (clearInterval(d.localeCheckInterval), d.localeCheckInterval = null));
|
|
1146
1166
|
}), o;
|
|
1147
|
-
},
|
|
1148
|
-
const { deleteTag:
|
|
1149
|
-
selectInputValue:
|
|
1150
|
-
selectPropItem:
|
|
1151
|
-
selectRadioItem:
|
|
1152
|
-
setOperator:
|
|
1153
|
-
selectCheckbox:
|
|
1154
|
-
sizeChange:
|
|
1155
|
-
onConfirmDate:
|
|
1156
|
-
selectFirstMap:
|
|
1157
|
-
handleDateShow:
|
|
1158
|
-
}),
|
|
1167
|
+
}, Gt = ({ api: a, state: e, t, props: s, emit: n, nextTick: r, vm: c, computed: i }) => {
|
|
1168
|
+
const { deleteTag: l, clearTag: u, backspaceDeleteTag: m } = It({ props: s, state: e, emit: n, nextTick: r }), { editTag: o, confirmEditTag: f, selectPropChange: d, selectItemIsDisable: p, checkFormValidation: b } = Et({ props: s, state: e, t, nextTick: r, format: le, emit: n, vm: c }), { handleInput: h, selectFirstMap: v, cancelHandleInput: x } = Ct({ props: s, state: e, emit: n, nextTick: r }), { selectPropItem: T, selectRadioItem: g, selectInputValue: _, createTag: I, helpClick: y, setOperator: C } = Vt({ props: s, emit: n, state: e, t, format: le, nextTick: r, vm: c, cancelHandleInput: x }), { selectCheckbox: w } = St({ props: s, state: e, emit: n, nextTick: r }), { onConfirmDate: S, handleDateShow: V, pickerOptions: D } = Dt({ props: s, state: e, emit: n, nextTick: r, vm: c }), { sizeChange: M, initFormRule: E } = Mt({ props: s, state: e, t, emit: n, nextTick: r, vm: c }), { handleConfirm: A, handleEditConfirm: P } = $t({ state: e, emit: n, nextTick: r }), { initItems: L, watchOutsideClick: F, watchMouseDown: K, watchMouseMove: ae, handleClick: ne } = Lt({ props: s, state: e }), Le = i(() => s.modelValue.length || e.propItem.label || e.inputValue), Ne = () => ({
|
|
1169
|
+
selectInputValue: _,
|
|
1170
|
+
selectPropItem: T,
|
|
1171
|
+
selectRadioItem: g,
|
|
1172
|
+
setOperator: C,
|
|
1173
|
+
selectCheckbox: w,
|
|
1174
|
+
sizeChange: M,
|
|
1175
|
+
onConfirmDate: S,
|
|
1176
|
+
selectFirstMap: v,
|
|
1177
|
+
handleDateShow: V
|
|
1178
|
+
}), re = (Z) => {
|
|
1159
1179
|
e.placeholder = Z;
|
|
1160
1180
|
};
|
|
1161
|
-
s.modelValue.length > 0,
|
|
1181
|
+
s.modelValue.length > 0, re(t("tvp.tvpSearchbox.addPlaceholder")), Object.assign(a, {
|
|
1162
1182
|
t,
|
|
1163
1183
|
state: e,
|
|
1164
|
-
isShowClose:
|
|
1165
|
-
deleteTag:
|
|
1184
|
+
isShowClose: Le,
|
|
1185
|
+
deleteTag: l,
|
|
1166
1186
|
editTag: o,
|
|
1167
|
-
backspaceDeleteTag:
|
|
1168
|
-
createTag:
|
|
1169
|
-
clearTag:
|
|
1187
|
+
backspaceDeleteTag: m,
|
|
1188
|
+
createTag: I,
|
|
1189
|
+
clearTag: u,
|
|
1170
1190
|
helpClick: y,
|
|
1171
|
-
handleInput:
|
|
1172
|
-
handleClick:
|
|
1173
|
-
handleEvents: (Z,
|
|
1174
|
-
const he =
|
|
1175
|
-
typeof he[Z] == "function" ? he[Z](
|
|
1191
|
+
handleInput: h,
|
|
1192
|
+
handleClick: ne,
|
|
1193
|
+
handleEvents: (Z, Re, Pe) => {
|
|
1194
|
+
const he = Ne();
|
|
1195
|
+
typeof he[Z] == "function" ? he[Z](Re, Pe) : console.warn(`[TinySearchBox] Unknown event: ${Z}`);
|
|
1176
1196
|
},
|
|
1177
|
-
pickerOptions:
|
|
1197
|
+
pickerOptions: D,
|
|
1178
1198
|
resetInput: te,
|
|
1179
|
-
selectItemIsDisable:
|
|
1180
|
-
selectPropChange:
|
|
1181
|
-
confirmEditTag:
|
|
1182
|
-
handleConfirm:
|
|
1183
|
-
handleEditConfirm:
|
|
1184
|
-
showDropdown:
|
|
1199
|
+
selectItemIsDisable: p,
|
|
1200
|
+
selectPropChange: d,
|
|
1201
|
+
confirmEditTag: f,
|
|
1202
|
+
handleConfirm: A,
|
|
1203
|
+
handleEditConfirm: P,
|
|
1204
|
+
showDropdown: k,
|
|
1185
1205
|
showPopover: Q,
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1206
|
+
checkFormValidation: b,
|
|
1207
|
+
setPlaceholder: re,
|
|
1208
|
+
initItems: L,
|
|
1209
|
+
initFormRule: E,
|
|
1210
|
+
watchOutsideClick: F,
|
|
1211
|
+
watchMouseDown: K,
|
|
1212
|
+
watchMouseMove: ae
|
|
1192
1213
|
});
|
|
1193
|
-
},
|
|
1194
|
-
var
|
|
1195
|
-
const
|
|
1214
|
+
}, Kt = ({ watch: a, state: e, props: t, api: s, nextTick: n, vm: r }) => {
|
|
1215
|
+
var m;
|
|
1216
|
+
const c = () => {
|
|
1196
1217
|
var o;
|
|
1197
1218
|
if (e.propItem.label) {
|
|
1198
|
-
const { placeholder:
|
|
1199
|
-
|
|
1219
|
+
const { placeholder: f, type: d } = e.prevItem;
|
|
1220
|
+
f ? s.setPlaceholder(f) : d === "map" ? s.setPlaceholder(N("tvp.tvpSearchbox.tagPlaceholder")) : (o = e.backupList) != null && o.length ? s.setPlaceholder(N("tvp.tvpSearchbox.dynamicPlaceholder", { newValue: e.propItem.label })) : s.setPlaceholder(N("tvp.tvpSearchbox.addPlaceholder"));
|
|
1200
1221
|
} else
|
|
1201
1222
|
s.setPlaceholder(N("tvp.tvpSearchbox.addPlaceholder"));
|
|
1202
|
-
},
|
|
1203
|
-
var o,
|
|
1204
|
-
return (o = r == null ? void 0 : r.$i18n) != null && o.locale ? r.$i18n.locale : (
|
|
1223
|
+
}, i = () => {
|
|
1224
|
+
var o, f, d;
|
|
1225
|
+
return (o = r == null ? void 0 : r.$i18n) != null && o.locale ? r.$i18n.locale : (d = (f = r == null ? void 0 : r.proxy) == null ? void 0 : f.$i18n) != null && d.locale ? r.proxy.$i18n.locale : me();
|
|
1205
1226
|
};
|
|
1206
|
-
let
|
|
1227
|
+
let l = i();
|
|
1207
1228
|
if (r != null && r.$i18n)
|
|
1208
1229
|
try {
|
|
1209
1230
|
r.$watch(
|
|
1210
1231
|
() => r.$i18n.locale,
|
|
1211
1232
|
(o) => {
|
|
1212
|
-
o !==
|
|
1233
|
+
o !== l && (l = o, c());
|
|
1213
1234
|
},
|
|
1214
1235
|
{ immediate: !1 }
|
|
1215
1236
|
);
|
|
1216
1237
|
} catch (o) {
|
|
1217
1238
|
console.warn("[TinySearchBox] Unable to watch i18n.locale via vm.$watch:", o);
|
|
1218
1239
|
}
|
|
1219
|
-
if ((
|
|
1240
|
+
if ((m = r == null ? void 0 : r.proxy) != null && m.$i18n)
|
|
1220
1241
|
try {
|
|
1221
1242
|
a(
|
|
1222
1243
|
() => r.proxy.$i18n.locale,
|
|
1223
1244
|
(o) => {
|
|
1224
|
-
o !==
|
|
1245
|
+
o !== l && (l = o, c());
|
|
1225
1246
|
},
|
|
1226
1247
|
{ immediate: !1 }
|
|
1227
1248
|
);
|
|
1228
1249
|
} catch (o) {
|
|
1229
1250
|
console.warn("[TinySearchBox] Unable to watch i18n.locale via watch:", o);
|
|
1230
1251
|
}
|
|
1231
|
-
const
|
|
1232
|
-
const o =
|
|
1233
|
-
o !==
|
|
1252
|
+
const u = () => {
|
|
1253
|
+
const o = i();
|
|
1254
|
+
o !== l && (l = o, c());
|
|
1234
1255
|
};
|
|
1235
|
-
typeof window < "u" && (e.localeCheckInterval = setInterval(
|
|
1256
|
+
typeof window < "u" && (e.localeCheckInterval = setInterval(u, 200)), a(
|
|
1236
1257
|
() => t.modelValue,
|
|
1237
1258
|
() => {
|
|
1238
|
-
|
|
1259
|
+
u();
|
|
1239
1260
|
}
|
|
1240
1261
|
), a(
|
|
1241
1262
|
() => t.items,
|
|
1242
1263
|
(o) => {
|
|
1243
|
-
const
|
|
1264
|
+
const f = e.visible, d = e.prevItem && e.prevItem.field;
|
|
1244
1265
|
e.recordItems = j(o), s.initItems(), s.initFormRule(), n(() => {
|
|
1245
|
-
if (s.initItems(), s.initFormRule(),
|
|
1246
|
-
const
|
|
1247
|
-
e.prevItem =
|
|
1266
|
+
if (s.initItems(), s.initFormRule(), f && e.propItem.label) {
|
|
1267
|
+
const p = e.recordItems.find((b) => b.field === d) || e.prevItem;
|
|
1268
|
+
e.prevItem = p || {}, e.backupList = p && p.options ? [...p.options] : [], e.filterList = e.backupList ? [...e.backupList] : [], k(e);
|
|
1248
1269
|
}
|
|
1249
1270
|
});
|
|
1250
1271
|
},
|
|
@@ -1263,35 +1284,52 @@ const $t = (a) => {
|
|
|
1263
1284
|
), a(
|
|
1264
1285
|
() => e.popoverVisible,
|
|
1265
1286
|
(o) => {
|
|
1266
|
-
!o && !e.inputEditValue.length && (e.prevItem && e.prevItem.mergeTag ? e.inputEditValue = Array.isArray(e.currentEditSelectTags) ? e.currentEditSelectTags : [] : e.inputEditValue = Array.isArray(e.currentEditSelectTags) ? e.currentEditSelectTags.join(",") : e.currentEditSelectTags || "");
|
|
1287
|
+
!o && !e.inputEditValue.length && (e.prevItem && e.prevItem.mergeTag ? e.inputEditValue = Array.isArray(e.currentEditSelectTags) ? e.currentEditSelectTags : [] : e.inputEditValue = Array.isArray(e.currentEditSelectTags) ? e.currentEditSelectTags.join(",") : e.currentEditSelectTags || ""), o || (e.hasFormError = !1);
|
|
1267
1288
|
},
|
|
1268
1289
|
{
|
|
1269
1290
|
immediate: !0
|
|
1270
1291
|
}
|
|
1292
|
+
), a(
|
|
1293
|
+
() => {
|
|
1294
|
+
const o = {
|
|
1295
|
+
inputEditValue: e.inputEditValue,
|
|
1296
|
+
startDate: e.startDate,
|
|
1297
|
+
endDate: e.endDate,
|
|
1298
|
+
startDateTime: e.startDateTime,
|
|
1299
|
+
endDateTime: e.endDateTime
|
|
1300
|
+
};
|
|
1301
|
+
return e.curMinNumVar && e.curMaxNumVar && (o[e.curMinNumVar] = e[e.curMinNumVar], o[e.curMaxNumVar] = e[e.curMaxNumVar]), o;
|
|
1302
|
+
},
|
|
1303
|
+
() => {
|
|
1304
|
+
e.popoverVisible && n(() => {
|
|
1305
|
+
s.checkFormValidation();
|
|
1306
|
+
});
|
|
1307
|
+
},
|
|
1308
|
+
{ deep: !0 }
|
|
1271
1309
|
), a(
|
|
1272
1310
|
() => e.propItem.label,
|
|
1273
1311
|
(o) => {
|
|
1274
|
-
|
|
1312
|
+
c();
|
|
1275
1313
|
}
|
|
1276
1314
|
), a(
|
|
1277
1315
|
() => t.modelValue,
|
|
1278
1316
|
(o) => {
|
|
1279
1317
|
if (o) {
|
|
1280
|
-
if (e.indexMap.clear(), e.valueMap.clear(), o.forEach((
|
|
1281
|
-
var
|
|
1282
|
-
const
|
|
1283
|
-
e.indexMap.set(
|
|
1284
|
-
const
|
|
1285
|
-
e.valueMap.set(
|
|
1318
|
+
if (e.indexMap.clear(), e.valueMap.clear(), o.forEach((f, d) => {
|
|
1319
|
+
var b;
|
|
1320
|
+
const p = `${f.label}${f.value}`;
|
|
1321
|
+
e.indexMap.set(f.label, d), e.valueMap.set(p, d), ((b = f.options) == null ? void 0 : b.length) > 0 && f.options.forEach((h) => {
|
|
1322
|
+
const v = `${f.label}${h.label}`;
|
|
1323
|
+
e.valueMap.set(v, d);
|
|
1286
1324
|
});
|
|
1287
1325
|
}), Q(e, !1), o.length === 0 && s.setPlaceholder(N("tvp.tvpSearchbox.addPlaceholder")), t.editable && !e.inputEditValue.length && o[0]) {
|
|
1288
|
-
const
|
|
1289
|
-
if ((e.recordItems.find((
|
|
1290
|
-
const
|
|
1291
|
-
e.inputEditValue =
|
|
1326
|
+
const f = o[0];
|
|
1327
|
+
if ((e.recordItems.find((p) => p.field === f.field) || f).mergeTag && f.options) {
|
|
1328
|
+
const p = f.options.flatMap((b) => b.label) || [];
|
|
1329
|
+
e.inputEditValue = p, e.currentEditSelectTags = p;
|
|
1292
1330
|
} else {
|
|
1293
|
-
const
|
|
1294
|
-
e.inputEditValue = Array.isArray(
|
|
1331
|
+
const p = f.value;
|
|
1332
|
+
e.inputEditValue = Array.isArray(p) ? p.join(",") : p || "";
|
|
1295
1333
|
}
|
|
1296
1334
|
}
|
|
1297
1335
|
e.innerModelValue = [...o];
|
|
@@ -1303,192 +1341,192 @@ const $t = (a) => {
|
|
|
1303
1341
|
}
|
|
1304
1342
|
);
|
|
1305
1343
|
};
|
|
1306
|
-
var
|
|
1307
|
-
var a = this,
|
|
1308
|
-
return
|
|
1344
|
+
var Ut = function() {
|
|
1345
|
+
var a, e, t = this, s = t.$createElement, n = t._self._c || s;
|
|
1346
|
+
return n("div", {
|
|
1309
1347
|
attrs: {
|
|
1310
1348
|
tiny_mode: "pc"
|
|
1311
1349
|
}
|
|
1312
|
-
}, [
|
|
1350
|
+
}, [n("tiny-dropdown-item", {
|
|
1313
1351
|
directives: [{
|
|
1314
1352
|
name: "show",
|
|
1315
1353
|
rawName: "v-show",
|
|
1316
|
-
value:
|
|
1354
|
+
value: t.state.inputValue.trim(),
|
|
1317
1355
|
expression: "state.inputValue.trim()"
|
|
1318
1356
|
}],
|
|
1319
1357
|
staticClass: "tvp-search-box__filter-item tvp-search-box__dropdown-item tvp-search-box__dropdown-item-init",
|
|
1320
1358
|
attrs: {
|
|
1321
1359
|
"item-data": {
|
|
1322
|
-
label:
|
|
1360
|
+
label: t.state.inputValue
|
|
1323
1361
|
}
|
|
1324
1362
|
},
|
|
1325
1363
|
on: {
|
|
1326
1364
|
"item-click": function() {
|
|
1327
|
-
return
|
|
1365
|
+
return t.selectInputValue(t.state.inputValue);
|
|
1328
1366
|
}
|
|
1329
1367
|
}
|
|
1330
|
-
}, [
|
|
1368
|
+
}, [n("span", [t._v(" " + t._s(t.t("tvp.tvpSearchbox.initUse")) + """ + t._s(t.state.inputValue) + """)])]), n("div", {
|
|
1331
1369
|
directives: [{
|
|
1332
1370
|
name: "show",
|
|
1333
1371
|
rawName: "v-show",
|
|
1334
|
-
value: !
|
|
1335
|
-
expression: "!state.propItem.label && state.inputValue
|
|
1372
|
+
value: !t.state.propItem.label && ((a = t.state.inputValue) === null || a === void 0 ? void 0 : a.trim()),
|
|
1373
|
+
expression: "!state.propItem.label && state.inputValue?.trim()"
|
|
1336
1374
|
}]
|
|
1337
|
-
}, [
|
|
1338
|
-
return
|
|
1339
|
-
key:
|
|
1340
|
-
}, [
|
|
1375
|
+
}, [t._l(t.state.matchItems, function(r, c) {
|
|
1376
|
+
return n("div", {
|
|
1377
|
+
key: c
|
|
1378
|
+
}, [r.attr.length ? n("div", [n("span", {
|
|
1341
1379
|
staticClass: "tvp-search-box__filter-type"
|
|
1342
|
-
}, [
|
|
1343
|
-
return
|
|
1344
|
-
key:
|
|
1380
|
+
}, [t._v(t._s(c === "0" ? t.t("tvp.tvpSearchbox.attributeType") : c))]), t._l(r.attr, function(i, l) {
|
|
1381
|
+
return n("tiny-dropdown-item", {
|
|
1382
|
+
key: i.label + l,
|
|
1345
1383
|
staticClass: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
|
|
1346
1384
|
attrs: {
|
|
1347
|
-
"item-data":
|
|
1385
|
+
"item-data": i
|
|
1348
1386
|
},
|
|
1349
1387
|
on: {
|
|
1350
1388
|
"item-click": function() {
|
|
1351
|
-
return
|
|
1389
|
+
return t.selectPropItem(i);
|
|
1352
1390
|
}
|
|
1353
1391
|
}
|
|
1354
|
-
}, [
|
|
1355
|
-
return
|
|
1356
|
-
key:
|
|
1357
|
-
}, [
|
|
1392
|
+
}, [n("span", t._l(i.match, function(u) {
|
|
1393
|
+
return n("span", {
|
|
1394
|
+
key: u
|
|
1395
|
+
}, [u.toLowerCase() === i.hightlighStr ? n("span", {
|
|
1358
1396
|
staticClass: "tvp-search-box__text-highlight"
|
|
1359
|
-
}, [
|
|
1397
|
+
}, [t._v(t._s(u))]) : n("span", [t._v(t._s(u))])]);
|
|
1360
1398
|
}), 0)]);
|
|
1361
|
-
})], 2) :
|
|
1399
|
+
})], 2) : t._e(), r.attrValue.length ? [n("span", {
|
|
1362
1400
|
staticClass: "tvp-search-box__filter-type"
|
|
1363
|
-
}, [
|
|
1364
|
-
return
|
|
1365
|
-
key:
|
|
1401
|
+
}, [t._v(t._s(t.t("tvp.tvpSearchbox.propertyValue", [c === "0" ? t.t("tvp.tvpSearchbox.attributeType") : c])))]), t._l(r.attrValue, function(i, l) {
|
|
1402
|
+
return n("tiny-dropdown-item", {
|
|
1403
|
+
key: i.label + l,
|
|
1366
1404
|
staticClass: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
|
|
1367
1405
|
attrs: {
|
|
1368
|
-
disabled:
|
|
1369
|
-
"item-data":
|
|
1406
|
+
disabled: i.isChecked,
|
|
1407
|
+
"item-data": i
|
|
1370
1408
|
},
|
|
1371
1409
|
on: {
|
|
1372
1410
|
"item-click": function() {
|
|
1373
|
-
return
|
|
1411
|
+
return t.selectRadioItem(i, !0);
|
|
1374
1412
|
}
|
|
1375
1413
|
}
|
|
1376
|
-
}, [
|
|
1377
|
-
return
|
|
1378
|
-
key:
|
|
1379
|
-
}, [
|
|
1414
|
+
}, [n("span", t._l(i.match, function(u) {
|
|
1415
|
+
return n("span", {
|
|
1416
|
+
key: u
|
|
1417
|
+
}, [u.toLowerCase() === i.hightlighStr ? n("span", {
|
|
1380
1418
|
staticClass: "tvp-search-box__text-highlight"
|
|
1381
|
-
}, [
|
|
1419
|
+
}, [t._v(t._s(u))]) : n("span", [t._v(t._s(u))])]);
|
|
1382
1420
|
}), 0)]);
|
|
1383
|
-
})] :
|
|
1384
|
-
}),
|
|
1421
|
+
})] : t._e()], 2);
|
|
1422
|
+
}), n("div", {
|
|
1385
1423
|
directives: [{
|
|
1386
1424
|
name: "show",
|
|
1387
1425
|
rawName: "v-show",
|
|
1388
|
-
value:
|
|
1426
|
+
value: t.state.potentialOptions,
|
|
1389
1427
|
expression: "state.potentialOptions"
|
|
1390
1428
|
}]
|
|
1391
|
-
}, [
|
|
1429
|
+
}, [n("span", {
|
|
1392
1430
|
staticClass: "tvp-search-box__filter-type"
|
|
1393
|
-
}, [
|
|
1431
|
+
}, [t._v(t._s(t.t("tvp.tvpSearchbox.matched")))]), n("div", {
|
|
1394
1432
|
staticClass: "tvp-search-box__potential-box",
|
|
1395
1433
|
attrs: {
|
|
1396
1434
|
id: "potential-loading"
|
|
1397
1435
|
}
|
|
1398
|
-
}, [
|
|
1399
|
-
return
|
|
1400
|
-
key:
|
|
1436
|
+
}, [t.state.potentialOptions ? n("div", t._l(t.state.potentialOptions, function(r, c) {
|
|
1437
|
+
return n("tiny-dropdown-item", {
|
|
1438
|
+
key: r.label + c,
|
|
1401
1439
|
staticClass: "tvp-search-box__filter-item tvp-search-box__dropdown-item",
|
|
1402
1440
|
attrs: {
|
|
1403
|
-
"item-data":
|
|
1441
|
+
"item-data": r
|
|
1404
1442
|
},
|
|
1405
1443
|
on: {
|
|
1406
1444
|
"item-click": function() {
|
|
1407
|
-
return
|
|
1445
|
+
return t.selectRadioItem(r, !0);
|
|
1408
1446
|
}
|
|
1409
1447
|
}
|
|
1410
|
-
}, [
|
|
1448
|
+
}, [t._v(" " + t._s(r.label) + ": "), n("span", {
|
|
1411
1449
|
staticClass: "tvp-search-box__text-highlight"
|
|
1412
|
-
}, [
|
|
1413
|
-
}), 1) :
|
|
1450
|
+
}, [t._v(t._s(r.value))])]);
|
|
1451
|
+
}), 1) : t._e()])])], 2), n("div", {
|
|
1414
1452
|
directives: [{
|
|
1415
1453
|
name: "show",
|
|
1416
1454
|
rawName: "v-show",
|
|
1417
|
-
value:
|
|
1418
|
-
expression: "state.visible && !state.propItem.label && !state.inputValue
|
|
1455
|
+
value: t.state.visible && !t.state.propItem.label && !((e = t.state.inputValue) !== null && e !== void 0 && e.trim()),
|
|
1456
|
+
expression: "state.visible && !state.propItem.label && !state.inputValue?.trim()"
|
|
1419
1457
|
}],
|
|
1420
1458
|
staticClass: "tvp-search-box__first-panel"
|
|
1421
|
-
},
|
|
1422
|
-
return
|
|
1423
|
-
key:
|
|
1424
|
-
}, [
|
|
1459
|
+
}, t._l(t.state.groupItems, function(r, c) {
|
|
1460
|
+
return n("div", {
|
|
1461
|
+
key: c
|
|
1462
|
+
}, [r.length ? n("span", {
|
|
1425
1463
|
staticClass: "tvp-search-box__filter-type"
|
|
1426
|
-
}, [
|
|
1427
|
-
return
|
|
1428
|
-
key: (
|
|
1464
|
+
}, [t._v(t._s(c === "0" ? t.t("tvp.tvpSearchbox.attributeType") : c))]) : t._e(), t._l(r, function(i, l) {
|
|
1465
|
+
return n("tiny-dropdown-item", {
|
|
1466
|
+
key: (i.field || i.label) + l,
|
|
1429
1467
|
staticClass: "tvp-search-box__dropdown-item",
|
|
1430
1468
|
attrs: {
|
|
1431
|
-
"item-data":
|
|
1469
|
+
"item-data": i
|
|
1432
1470
|
},
|
|
1433
1471
|
on: {
|
|
1434
1472
|
"item-click": function() {
|
|
1435
|
-
return
|
|
1473
|
+
return t.selectPropItem(i);
|
|
1436
1474
|
}
|
|
1437
1475
|
}
|
|
1438
|
-
}, [
|
|
1476
|
+
}, [n("span", {
|
|
1439
1477
|
attrs: {
|
|
1440
|
-
title:
|
|
1478
|
+
title: i.label
|
|
1441
1479
|
}
|
|
1442
|
-
}, [
|
|
1480
|
+
}, [t._v(t._s(i.label))])]);
|
|
1443
1481
|
})], 2);
|
|
1444
1482
|
}), 0)], 1);
|
|
1445
|
-
},
|
|
1446
|
-
function fe(a, e, t, s, n, r,
|
|
1447
|
-
var
|
|
1448
|
-
e && (
|
|
1449
|
-
var
|
|
1450
|
-
if (
|
|
1451
|
-
|
|
1483
|
+
}, qt = [];
|
|
1484
|
+
function fe(a, e, t, s, n, r, c, i) {
|
|
1485
|
+
var l = typeof a == "function" ? a.options : a;
|
|
1486
|
+
e && (l.render = e, l.staticRenderFns = t, l._compiled = !0), s && (l.functional = !0), r && (l._scopeId = "data-v-" + r);
|
|
1487
|
+
var u;
|
|
1488
|
+
if (c ? (u = function(f) {
|
|
1489
|
+
f = f || // cached call
|
|
1452
1490
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
1453
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
1454
|
-
},
|
|
1491
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !f && typeof __VUE_SSR_CONTEXT__ < "u" && (f = __VUE_SSR_CONTEXT__), n && n.call(this, f), f && f._registeredComponents && f._registeredComponents.add(c);
|
|
1492
|
+
}, l._ssrRegister = u) : n && (u = i ? function() {
|
|
1455
1493
|
n.call(
|
|
1456
1494
|
this,
|
|
1457
|
-
(
|
|
1495
|
+
(l.functional ? this.parent : this).$root.$options.shadowRoot
|
|
1458
1496
|
);
|
|
1459
|
-
} : n),
|
|
1460
|
-
if (
|
|
1461
|
-
|
|
1462
|
-
var
|
|
1463
|
-
|
|
1464
|
-
return
|
|
1497
|
+
} : n), u)
|
|
1498
|
+
if (l.functional) {
|
|
1499
|
+
l._injectStyles = u;
|
|
1500
|
+
var m = l.render;
|
|
1501
|
+
l.render = function(d, p) {
|
|
1502
|
+
return u.call(p), m(d, p);
|
|
1465
1503
|
};
|
|
1466
1504
|
} else {
|
|
1467
|
-
var o =
|
|
1468
|
-
|
|
1505
|
+
var o = l.beforeCreate;
|
|
1506
|
+
l.beforeCreate = o ? [].concat(o, u) : [u];
|
|
1469
1507
|
}
|
|
1470
1508
|
return {
|
|
1471
1509
|
exports: a,
|
|
1472
|
-
options:
|
|
1510
|
+
options: l
|
|
1473
1511
|
};
|
|
1474
1512
|
}
|
|
1475
|
-
const
|
|
1476
|
-
const s = a.handleEvents || a.events || ((
|
|
1477
|
-
t("events",
|
|
1513
|
+
const Zt = (a, e, { emit: t }) => {
|
|
1514
|
+
const s = a.handleEvents || a.events || ((i, l, u) => {
|
|
1515
|
+
t("events", i, l, u);
|
|
1478
1516
|
});
|
|
1479
1517
|
return {
|
|
1480
|
-
selectInputValue: (
|
|
1481
|
-
s("selectInputValue",
|
|
1518
|
+
selectInputValue: (i) => {
|
|
1519
|
+
s("selectInputValue", i);
|
|
1482
1520
|
},
|
|
1483
|
-
selectPropItem: (
|
|
1484
|
-
s("selectPropItem",
|
|
1521
|
+
selectPropItem: (i) => {
|
|
1522
|
+
s("selectPropItem", i);
|
|
1485
1523
|
},
|
|
1486
|
-
selectRadioItem: (
|
|
1487
|
-
s("selectRadioItem",
|
|
1524
|
+
selectRadioItem: (i, l) => {
|
|
1525
|
+
s("selectRadioItem", i, l);
|
|
1488
1526
|
},
|
|
1489
1527
|
t: N
|
|
1490
1528
|
};
|
|
1491
|
-
},
|
|
1529
|
+
}, Yt = ["selectInputValue", "selectPropItem", "selectRadioItem", "t"], Wt = X({
|
|
1492
1530
|
name: pe + "SearchBoxFirstLevelPanel",
|
|
1493
1531
|
components: {
|
|
1494
1532
|
TinyDropdownItem: Ie
|
|
@@ -1514,27 +1552,27 @@ const qt = (a, e, { emit: t }) => {
|
|
|
1514
1552
|
},
|
|
1515
1553
|
emits: ["events"],
|
|
1516
1554
|
setup(a, e) {
|
|
1517
|
-
return ue({ props: a, context: e, renderless:
|
|
1555
|
+
return ue({ props: a, context: e, renderless: Zt, api: Yt });
|
|
1518
1556
|
}
|
|
1519
1557
|
}), ve = {};
|
|
1520
|
-
var
|
|
1521
|
-
|
|
1522
|
-
Kt,
|
|
1558
|
+
var Qt = /* @__PURE__ */ fe(
|
|
1559
|
+
Wt,
|
|
1523
1560
|
Ut,
|
|
1561
|
+
qt,
|
|
1524
1562
|
!1,
|
|
1525
|
-
|
|
1563
|
+
Xt,
|
|
1526
1564
|
null,
|
|
1527
1565
|
null,
|
|
1528
1566
|
null
|
|
1529
1567
|
);
|
|
1530
|
-
function
|
|
1568
|
+
function Xt(a) {
|
|
1531
1569
|
for (let e in ve)
|
|
1532
1570
|
this[e] = ve[e];
|
|
1533
1571
|
}
|
|
1534
|
-
const
|
|
1535
|
-
return
|
|
1572
|
+
const Jt = /* @__PURE__ */ function() {
|
|
1573
|
+
return Qt.exports;
|
|
1536
1574
|
}();
|
|
1537
|
-
var
|
|
1575
|
+
var ea = function() {
|
|
1538
1576
|
var a, e = this, t = e.$createElement, s = e._self._c || t;
|
|
1539
1577
|
return s("div", {
|
|
1540
1578
|
attrs: {
|
|
@@ -1594,12 +1632,12 @@ var Jt = function() {
|
|
|
1594
1632
|
attrs: {
|
|
1595
1633
|
title: n.label
|
|
1596
1634
|
}
|
|
1597
|
-
}, e._l(n.match, function(
|
|
1635
|
+
}, e._l(n.match, function(c) {
|
|
1598
1636
|
return s("span", {
|
|
1599
|
-
key:
|
|
1600
|
-
}, [
|
|
1637
|
+
key: c
|
|
1638
|
+
}, [c.toLowerCase() === n.hightlighStr ? s("span", {
|
|
1601
1639
|
staticClass: "tvp-search-box__text-highlight"
|
|
1602
|
-
}, [e._v(e._s(
|
|
1640
|
+
}, [e._v(e._s(c))]) : s("span", [e._v(e._s(c))])]);
|
|
1603
1641
|
}), 0) : s("span", {
|
|
1604
1642
|
attrs: {
|
|
1605
1643
|
title: n.label
|
|
@@ -1945,44 +1983,44 @@ var Jt = function() {
|
|
|
1945
1983
|
}
|
|
1946
1984
|
}, [e._v(e._s(n.label))])]);
|
|
1947
1985
|
})], 2) : e._e()]);
|
|
1948
|
-
},
|
|
1949
|
-
const
|
|
1950
|
-
const { computed: s } = e, n = a.handleEvents || a.events || ((
|
|
1951
|
-
t("events",
|
|
1952
|
-
}), r = (
|
|
1953
|
-
n("setOperator",
|
|
1954
|
-
},
|
|
1955
|
-
n("selectRadioItem",
|
|
1956
|
-
},
|
|
1957
|
-
n("selectCheckbox",
|
|
1958
|
-
},
|
|
1959
|
-
n("sizeChange",
|
|
1960
|
-
},
|
|
1961
|
-
n("onConfirmDate",
|
|
1962
|
-
},
|
|
1963
|
-
n("selectFirstMap",
|
|
1964
|
-
}, o = (
|
|
1965
|
-
n("handleDateShow",
|
|
1966
|
-
},
|
|
1967
|
-
var
|
|
1968
|
-
return a.state.hasBackupList && ((
|
|
1969
|
-
}),
|
|
1970
|
-
var
|
|
1971
|
-
return (
|
|
1986
|
+
}, ta = [];
|
|
1987
|
+
const aa = (a, e, { emit: t }) => {
|
|
1988
|
+
const { computed: s } = e, n = a.handleEvents || a.events || ((p, b, h) => {
|
|
1989
|
+
t("events", p, b, h);
|
|
1990
|
+
}), r = (p) => {
|
|
1991
|
+
n("setOperator", p);
|
|
1992
|
+
}, c = (p) => {
|
|
1993
|
+
n("selectRadioItem", p);
|
|
1994
|
+
}, i = (p) => {
|
|
1995
|
+
n("selectCheckbox", p);
|
|
1996
|
+
}, l = (p) => {
|
|
1997
|
+
n("sizeChange", p);
|
|
1998
|
+
}, u = (p, b) => {
|
|
1999
|
+
n("onConfirmDate", p, b);
|
|
2000
|
+
}, m = (p, b) => {
|
|
2001
|
+
n("selectFirstMap", p, b);
|
|
2002
|
+
}, o = (p) => {
|
|
2003
|
+
n("handleDateShow", p);
|
|
2004
|
+
}, f = s(() => {
|
|
2005
|
+
var p;
|
|
2006
|
+
return a.state.hasBackupList && ((p = a.state.backupList) == null ? void 0 : p.length) === 0;
|
|
2007
|
+
}), d = s(() => {
|
|
2008
|
+
var p;
|
|
2009
|
+
return (p = a.state.backupList) == null ? void 0 : p.find((b) => !b.isFilter);
|
|
1972
2010
|
});
|
|
1973
2011
|
return {
|
|
1974
2012
|
setOperator: r,
|
|
1975
|
-
selectRadioItem:
|
|
1976
|
-
selectCheckbox:
|
|
1977
|
-
sizeChange:
|
|
1978
|
-
onConfirmDate:
|
|
1979
|
-
selectFirstMap:
|
|
2013
|
+
selectRadioItem: c,
|
|
2014
|
+
selectCheckbox: i,
|
|
2015
|
+
sizeChange: l,
|
|
2016
|
+
onConfirmDate: u,
|
|
2017
|
+
selectFirstMap: m,
|
|
1980
2018
|
handleDateShow: o,
|
|
1981
|
-
isLoading:
|
|
1982
|
-
showCheckBoxList:
|
|
2019
|
+
isLoading: f,
|
|
2020
|
+
showCheckBoxList: d,
|
|
1983
2021
|
t: N
|
|
1984
2022
|
};
|
|
1985
|
-
},
|
|
2023
|
+
}, na = [
|
|
1986
2024
|
"setOperator",
|
|
1987
2025
|
"selectRadioItem",
|
|
1988
2026
|
"selectCheckbox",
|
|
@@ -1993,20 +2031,20 @@ const ta = (a, e, { emit: t }) => {
|
|
|
1993
2031
|
"isLoading",
|
|
1994
2032
|
"showCheckBoxList",
|
|
1995
2033
|
"t"
|
|
1996
|
-
],
|
|
2034
|
+
], ra = X({
|
|
1997
2035
|
name: pe + "SearchBoxSecondLevelPanel",
|
|
1998
2036
|
emits: ["events"],
|
|
1999
2037
|
components: {
|
|
2000
2038
|
TinyFormItem: we,
|
|
2001
2039
|
TinyDropdownItem: Ie,
|
|
2002
|
-
TinyCheckbox:
|
|
2003
|
-
TinyCheckboxGroup:
|
|
2040
|
+
TinyCheckbox: Ze,
|
|
2041
|
+
TinyCheckboxGroup: Ye,
|
|
2004
2042
|
TinyDatePicker: xe,
|
|
2005
2043
|
TinyInput: _e,
|
|
2006
2044
|
TinyButton: ye
|
|
2007
2045
|
},
|
|
2008
2046
|
directives: {
|
|
2009
|
-
loading:
|
|
2047
|
+
loading: We.directive
|
|
2010
2048
|
},
|
|
2011
2049
|
props: {
|
|
2012
2050
|
...J,
|
|
@@ -2029,27 +2067,27 @@ const ta = (a, e, { emit: t }) => {
|
|
|
2029
2067
|
}
|
|
2030
2068
|
},
|
|
2031
2069
|
setup(a, e) {
|
|
2032
|
-
return ue({ props: a, context: e, renderless:
|
|
2070
|
+
return ue({ props: a, context: e, renderless: aa, api: na });
|
|
2033
2071
|
}
|
|
2034
2072
|
}), be = {};
|
|
2035
2073
|
var sa = /* @__PURE__ */ fe(
|
|
2036
|
-
|
|
2037
|
-
Jt,
|
|
2074
|
+
ra,
|
|
2038
2075
|
ea,
|
|
2076
|
+
ta,
|
|
2039
2077
|
!1,
|
|
2040
|
-
|
|
2078
|
+
oa,
|
|
2041
2079
|
null,
|
|
2042
2080
|
null,
|
|
2043
2081
|
null
|
|
2044
2082
|
);
|
|
2045
|
-
function
|
|
2083
|
+
function oa(a) {
|
|
2046
2084
|
for (let e in be)
|
|
2047
2085
|
this[e] = be[e];
|
|
2048
2086
|
}
|
|
2049
|
-
const
|
|
2087
|
+
const la = /* @__PURE__ */ function() {
|
|
2050
2088
|
return sa.exports;
|
|
2051
2089
|
}();
|
|
2052
|
-
const
|
|
2090
|
+
const ia = X({
|
|
2053
2091
|
model: {
|
|
2054
2092
|
prop: "modelValue",
|
|
2055
2093
|
event: "update:modelValue"
|
|
@@ -2110,39 +2148,32 @@ const la = X({
|
|
|
2110
2148
|
default: ""
|
|
2111
2149
|
}
|
|
2112
2150
|
},
|
|
2113
|
-
emits: [
|
|
2114
|
-
"update:modelValue",
|
|
2115
|
-
"change",
|
|
2116
|
-
"search",
|
|
2117
|
-
"exceed",
|
|
2118
|
-
"first-level-select",
|
|
2119
|
-
"clear"
|
|
2120
|
-
],
|
|
2151
|
+
emits: ["update:modelValue", "change", "search", "exceed", "first-level-select", "clear"],
|
|
2121
2152
|
components: {
|
|
2122
|
-
TinyTag:
|
|
2153
|
+
TinyTag: Oe,
|
|
2123
2154
|
TinyInput: _e,
|
|
2124
|
-
TinyDropdown:
|
|
2125
|
-
TinyDropdownMenu:
|
|
2155
|
+
TinyDropdown: Fe,
|
|
2156
|
+
TinyDropdownMenu: Ae,
|
|
2126
2157
|
TinyButton: ye,
|
|
2127
|
-
TinyTooltip:
|
|
2158
|
+
TinyTooltip: Be,
|
|
2128
2159
|
TinyDatePicker: xe,
|
|
2129
|
-
TinyForm:
|
|
2160
|
+
TinyForm: ze,
|
|
2130
2161
|
TinyFormItem: we,
|
|
2131
|
-
TinyPopover:
|
|
2132
|
-
TinySelect:
|
|
2133
|
-
TinyOption:
|
|
2134
|
-
TinySearchBoxFirstLevelPanel:
|
|
2135
|
-
TinySearchBoxSecondLevelPanel:
|
|
2162
|
+
TinyPopover: je,
|
|
2163
|
+
TinySelect: He,
|
|
2164
|
+
TinyOption: Ge,
|
|
2165
|
+
TinySearchBoxFirstLevelPanel: Jt,
|
|
2166
|
+
TinySearchBoxSecondLevelPanel: la,
|
|
2136
2167
|
// 图标组件
|
|
2137
|
-
TinyIconSearch:
|
|
2138
|
-
TinyIconClose:
|
|
2139
|
-
TinyIconHelpQuery:
|
|
2168
|
+
TinyIconSearch: Ke(),
|
|
2169
|
+
TinyIconClose: Ue(),
|
|
2170
|
+
TinyIconHelpQuery: qe()
|
|
2140
2171
|
},
|
|
2141
2172
|
setup(a, e) {
|
|
2142
|
-
return ue({ props: a, context: e, renderless:
|
|
2173
|
+
return ue({ props: a, context: e, renderless: Ht, api: zt });
|
|
2143
2174
|
}
|
|
2144
2175
|
});
|
|
2145
|
-
var
|
|
2176
|
+
var ca = function() {
|
|
2146
2177
|
var a, e, t = this, s = t.$createElement, n = t._self._c || s;
|
|
2147
2178
|
return n("div", {
|
|
2148
2179
|
class: ["tvp-search-box", t.size === "small" ? "tvp-search-box--small" : ""],
|
|
@@ -2153,9 +2184,9 @@ var ia = function() {
|
|
|
2153
2184
|
}
|
|
2154
2185
|
}, [n("tiny-icon-search", {
|
|
2155
2186
|
staticClass: "tvp-search-box__prefix"
|
|
2156
|
-
}), t._l(t.modelValue, function(r,
|
|
2187
|
+
}), t._l(t.modelValue, function(r, c) {
|
|
2157
2188
|
return n("tiny-tag", {
|
|
2158
|
-
key: r.field +
|
|
2189
|
+
key: r.field + c,
|
|
2159
2190
|
staticClass: "tvp-search-box__tag",
|
|
2160
2191
|
class: t.editable && r.type !== "map" ? "tvp-search-box__tag-editor" : "",
|
|
2161
2192
|
attrs: {
|
|
@@ -2163,11 +2194,11 @@ var ia = function() {
|
|
|
2163
2194
|
title: `${r.label} ${r.operator || ":"} ${r.value}`
|
|
2164
2195
|
},
|
|
2165
2196
|
on: {
|
|
2166
|
-
close: function(
|
|
2197
|
+
close: function(i) {
|
|
2167
2198
|
return t.deleteTag(r);
|
|
2168
2199
|
},
|
|
2169
|
-
click: function(
|
|
2170
|
-
return
|
|
2200
|
+
click: function(i) {
|
|
2201
|
+
return i.stopPropagation(), t.editTag(r, c, i);
|
|
2171
2202
|
}
|
|
2172
2203
|
}
|
|
2173
2204
|
}, [n("span", {
|
|
@@ -2217,7 +2248,7 @@ var ia = function() {
|
|
|
2217
2248
|
scopedSlots: t._u([{
|
|
2218
2249
|
key: "dropdown",
|
|
2219
2250
|
fn: function() {
|
|
2220
|
-
var r,
|
|
2251
|
+
var r, c, i;
|
|
2221
2252
|
return [n("tiny-dropdown-menu", {
|
|
2222
2253
|
style: {
|
|
2223
2254
|
"max-height": t.panelMaxHeight
|
|
@@ -2227,8 +2258,8 @@ var ia = function() {
|
|
|
2227
2258
|
"popper-class": "tvp-search-box__dropdown-menu"
|
|
2228
2259
|
},
|
|
2229
2260
|
on: {
|
|
2230
|
-
mouseup: function(
|
|
2231
|
-
return
|
|
2261
|
+
mouseup: function(l) {
|
|
2262
|
+
return l.stopPropagation(), (function() {
|
|
2232
2263
|
}).apply(null, arguments);
|
|
2233
2264
|
}
|
|
2234
2265
|
}
|
|
@@ -2236,10 +2267,10 @@ var ia = function() {
|
|
|
2236
2267
|
directives: [{
|
|
2237
2268
|
name: "show",
|
|
2238
2269
|
rawName: "v-show",
|
|
2239
|
-
value: !t.state.propItem.label || t.state.inputValue.trim(),
|
|
2240
|
-
expression: "!state.propItem.label || state.inputValue
|
|
2270
|
+
value: !t.state.propItem.label || ((r = t.state.inputValue) === null || r === void 0 ? void 0 : r.trim()),
|
|
2271
|
+
expression: "!state.propItem.label || state.inputValue?.trim()"
|
|
2241
2272
|
}]
|
|
2242
|
-
}, [(
|
|
2273
|
+
}, [(c = t.state.instance) !== null && c !== void 0 && c.slots["first-panel"] ? t._t("first-panel", null, null, {
|
|
2243
2274
|
state: t.state,
|
|
2244
2275
|
handleEvents: t.handleEvents
|
|
2245
2276
|
}) : n("TinySearchBoxFirstLevelPanel", {
|
|
@@ -2254,7 +2285,7 @@ var ia = function() {
|
|
|
2254
2285
|
value: t.state.propItem.label,
|
|
2255
2286
|
expression: "state.propItem.label"
|
|
2256
2287
|
}]
|
|
2257
|
-
}, [(
|
|
2288
|
+
}, [(i = t.state.instance) !== null && i !== void 0 && i.slots["second-panel"] ? t._t("second-panel", null, null, {
|
|
2258
2289
|
state: t.state,
|
|
2259
2290
|
pickerOptions: t.pickerOptions,
|
|
2260
2291
|
handleEvents: t.handleEvents,
|
|
@@ -2272,7 +2303,7 @@ var ia = function() {
|
|
|
2272
2303
|
}) : n("div", {
|
|
2273
2304
|
staticClass: "tvp-search-box__panel-box",
|
|
2274
2305
|
on: {
|
|
2275
|
-
click: function(
|
|
2306
|
+
click: function(l) {
|
|
2276
2307
|
return t.showDropdown(t.state);
|
|
2277
2308
|
}
|
|
2278
2309
|
}
|
|
@@ -2418,7 +2449,7 @@ var ia = function() {
|
|
|
2418
2449
|
disabled: t.selectItemIsDisable(r)
|
|
2419
2450
|
},
|
|
2420
2451
|
on: {
|
|
2421
|
-
click: function(
|
|
2452
|
+
click: function(c) {
|
|
2422
2453
|
t.selectPropChange(r, t.selectItemIsDisable(r));
|
|
2423
2454
|
}
|
|
2424
2455
|
}
|
|
@@ -2641,7 +2672,8 @@ var ia = function() {
|
|
|
2641
2672
|
}
|
|
2642
2673
|
}, [t._v(" " + t._s(t.t("tvp.tvpSearchbox.cancel")) + " ")]), n("tiny-button", {
|
|
2643
2674
|
attrs: {
|
|
2644
|
-
size: "mini"
|
|
2675
|
+
size: "mini",
|
|
2676
|
+
disabled: t.state.hasFormError
|
|
2645
2677
|
},
|
|
2646
2678
|
on: {
|
|
2647
2679
|
click: function(r) {
|
|
@@ -2656,25 +2688,25 @@ var ia = function() {
|
|
|
2656
2688
|
},
|
|
2657
2689
|
onConfirm: t.handleEditConfirm
|
|
2658
2690
|
})], 2)], 2)] : t._e()], 2)], 2);
|
|
2659
|
-
},
|
|
2691
|
+
}, pa = [];
|
|
2660
2692
|
const ge = {};
|
|
2661
|
-
var
|
|
2662
|
-
la,
|
|
2693
|
+
var ua = /* @__PURE__ */ fe(
|
|
2663
2694
|
ia,
|
|
2664
2695
|
ca,
|
|
2696
|
+
pa,
|
|
2665
2697
|
!1,
|
|
2666
|
-
|
|
2698
|
+
da,
|
|
2667
2699
|
null,
|
|
2668
2700
|
null,
|
|
2669
2701
|
null
|
|
2670
2702
|
);
|
|
2671
|
-
function
|
|
2703
|
+
function da(a) {
|
|
2672
2704
|
for (let e in ge)
|
|
2673
2705
|
this[e] = ge[e];
|
|
2674
2706
|
}
|
|
2675
|
-
const
|
|
2676
|
-
return
|
|
2677
|
-
}(),
|
|
2707
|
+
const ma = /* @__PURE__ */ function() {
|
|
2708
|
+
return ua.exports;
|
|
2709
|
+
}(), fa = {
|
|
2678
2710
|
...J,
|
|
2679
2711
|
tiny_mode: {
|
|
2680
2712
|
type: String,
|
|
@@ -2752,21 +2784,21 @@ const da = /* @__PURE__ */ function() {
|
|
|
2752
2784
|
}
|
|
2753
2785
|
}, Y = X({
|
|
2754
2786
|
name: pe + "SearchBox",
|
|
2755
|
-
props:
|
|
2756
|
-
...
|
|
2757
|
-
}),
|
|
2787
|
+
props: fa,
|
|
2788
|
+
...ma
|
|
2789
|
+
}), ha = "3.27.1";
|
|
2758
2790
|
Y.install = function(a) {
|
|
2759
2791
|
a.component(Y.name, Y);
|
|
2760
2792
|
};
|
|
2761
|
-
Y.version =
|
|
2793
|
+
Y.version = ha;
|
|
2762
2794
|
window && typeof window < "u" && window.Vue && Y.install(window.Vue);
|
|
2763
2795
|
export {
|
|
2764
|
-
|
|
2765
|
-
|
|
2796
|
+
Jt as TinySearchBoxFirstLevelPanel,
|
|
2797
|
+
la as TinySearchBoxSecondLevelPanel,
|
|
2766
2798
|
Y as default,
|
|
2767
|
-
|
|
2768
|
-
|
|
2799
|
+
$e as enUS,
|
|
2800
|
+
Nt as setGlobalApp,
|
|
2769
2801
|
N as t,
|
|
2770
2802
|
Ee as zhCN
|
|
2771
2803
|
};
|
|
2772
|
-
//# sourceMappingURL=index.
|
|
2804
|
+
//# sourceMappingURL=index.js.map
|