zhihao-ui 1.2.23 → 1.2.24
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.
|
@@ -51,7 +51,7 @@ const Ht = (g, c = {}, a = !0, f, m, y = (t) => t) => {
|
|
|
51
51
|
let e = await g(y({ ...t.searchInitParam, ...t.totalParam }));
|
|
52
52
|
if (f && (e = await f(e)), t.tableData = a ? e.list : e, a) {
|
|
53
53
|
const { currentPage: i, pageSize: s, total: l } = e;
|
|
54
|
-
|
|
54
|
+
U({ page: i, size: s, total: l });
|
|
55
55
|
}
|
|
56
56
|
} catch (T) {
|
|
57
57
|
m && m(T);
|
|
@@ -64,7 +64,7 @@ const Ht = (g, c = {}, a = !0, f, m, y = (t) => t) => {
|
|
|
64
64
|
for (const e in t.searchParam)
|
|
65
65
|
(t.searchParam[e] || t.searchParam[e] === !1 || t.searchParam[e] === 0) && (T[e] = t.searchParam[e]);
|
|
66
66
|
Object.assign(t.totalParam, T, a ? b.value : {});
|
|
67
|
-
},
|
|
67
|
+
}, U = (T) => {
|
|
68
68
|
Object.assign(t.pageable, T);
|
|
69
69
|
}, R = () => {
|
|
70
70
|
t.pageable.page = 1, h(), n().then();
|
|
@@ -110,7 +110,7 @@ function Jt(g, c, a) {
|
|
|
110
110
|
return kt(m) || m === "" ? f : m;
|
|
111
111
|
}
|
|
112
112
|
const Ve = Jt;
|
|
113
|
-
function
|
|
113
|
+
function K(g) {
|
|
114
114
|
const c = g.split(".");
|
|
115
115
|
return c.length == 1 ? g : c[c.length - 1];
|
|
116
116
|
}
|
|
@@ -184,7 +184,7 @@ const ae = (g, c) => {
|
|
|
184
184
|
const e = y.value.label, i = y.value.value, s = y.value.children, l = (z = a.column.search) == null ? void 0 : z.el;
|
|
185
185
|
let v = ((k = a.column.search) == null ? void 0 : k.props) ?? {};
|
|
186
186
|
return l === "tree-select" && (v = { ...v, props: { ...v.props, label: e, children: s }, nodeKey: i }), l === "cascader" && (v = { ...v, props: { ...v.props, label: e, value: i, children: s } }), v;
|
|
187
|
-
}),
|
|
187
|
+
}), U = O(() => {
|
|
188
188
|
var s, l, v, z, k, P, _;
|
|
189
189
|
const e = a.column.search;
|
|
190
190
|
return ["datetimerange", "daterange", "monthrange"].includes((s = e == null ? void 0 : e.props) == null ? void 0 : s.type) || (l = e == null ? void 0 : e.props) != null && l.isRange ? {
|
|
@@ -194,7 +194,7 @@ const ae = (g, c) => {
|
|
|
194
194
|
} : { placeholder: ((P = e == null ? void 0 : e.props) == null ? void 0 : P.placeholder) ?? ((_ = e == null ? void 0 : e.el) != null && _.includes("input") ? "请输入" : "请选择") };
|
|
195
195
|
}), R = O(() => {
|
|
196
196
|
var v, z;
|
|
197
|
-
const e = a.column.search, i = m.value[(e == null ? void 0 : e.key) ??
|
|
197
|
+
const e = a.column.search, i = m.value[(e == null ? void 0 : e.key) ?? K(a.column.prop)], s = e == null ? void 0 : e.el, l = (v = e == null ? void 0 : e.props) == null ? void 0 : v.placeholder;
|
|
198
198
|
if (e != null && e.width)
|
|
199
199
|
if (Tt(e == null ? void 0 : e.width)) {
|
|
200
200
|
if (e == null ? void 0 : e.width(i))
|
|
@@ -206,10 +206,10 @@ const ae = (g, c) => {
|
|
|
206
206
|
let _ = n.value;
|
|
207
207
|
const $ = [];
|
|
208
208
|
if (i.forEach((D) => {
|
|
209
|
-
const
|
|
210
|
-
$.push(
|
|
211
|
-
const G =
|
|
212
|
-
_ =
|
|
209
|
+
const j = _.find((ve) => ve[y.value.value] === D);
|
|
210
|
+
$.push(j ? j[y.value.label] : D);
|
|
211
|
+
const G = j[y.value.children] ?? n.value;
|
|
212
|
+
_ = j ? G : [];
|
|
213
213
|
}), (z = e == null ? void 0 : e.props) != null && z.multiple) {
|
|
214
214
|
const G = ae($[0]) + 42;
|
|
215
215
|
return i.length > 1 ? G + 26 + ae("+ " + (i.length - 1)) + "px" : G + "px";
|
|
@@ -235,8 +235,8 @@ const ae = (g, c) => {
|
|
|
235
235
|
if (((l = (s = (i = a.column) == null ? void 0 : i.search) == null ? void 0 : s.props) == null ? void 0 : l.type) === "daterange") {
|
|
236
236
|
const { searchParam: D } = Ae(a);
|
|
237
237
|
if (e != null && e.length) {
|
|
238
|
-
const
|
|
239
|
-
D.value[
|
|
238
|
+
const j = ((k = (z = (v = a.column) == null ? void 0 : v.search) == null ? void 0 : z.props) == null ? void 0 : k.beginTime) || "beginTime", G = (($ = (_ = (P = a.column) == null ? void 0 : P.search) == null ? void 0 : _.props) == null ? void 0 : $.endTime) || "endTime";
|
|
239
|
+
D.value[j] = e[0], D.value[G] = e[1];
|
|
240
240
|
} else
|
|
241
241
|
delete D.value.beginTime, delete D.value.endTime;
|
|
242
242
|
}
|
|
@@ -248,11 +248,11 @@ const ae = (g, c) => {
|
|
|
248
248
|
return (e, i) => {
|
|
249
249
|
var s, l, v, z, k, P, _;
|
|
250
250
|
return S(), L("div", ea, [
|
|
251
|
-
(S(), F(de(((s = e.column.search) == null ? void 0 : s.render) ?? `el-${(l = e.column.search) == null ? void 0 : l.el}`), J({ ...h.value, ...
|
|
252
|
-
modelValue: m.value[((v = e.column.search) == null ? void 0 : v.key) ?? p(
|
|
251
|
+
(S(), F(de(((s = e.column.search) == null ? void 0 : s.render) ?? `el-${(l = e.column.search) == null ? void 0 : l.el}`), J({ ...h.value, ...U.value, searchParam: m.value, clearable: x.value, ...W.value }, {
|
|
252
|
+
modelValue: m.value[((v = e.column.search) == null ? void 0 : v.key) ?? p(K)(e.column.prop)],
|
|
253
253
|
"onUpdate:modelValue": i[0] || (i[0] = ($) => {
|
|
254
254
|
var D;
|
|
255
|
-
return m.value[((D = e.column.search) == null ? void 0 : D.key) ?? p(
|
|
255
|
+
return m.value[((D = e.column.search) == null ? void 0 : D.key) ?? p(K)(e.column.prop)] = $;
|
|
256
256
|
}),
|
|
257
257
|
modelModifiers: { trim: !0 },
|
|
258
258
|
data: ((z = e.column.search) == null ? void 0 : z.el) === "tree-select" ? b.value : [],
|
|
@@ -264,8 +264,8 @@ const ae = (g, c) => {
|
|
|
264
264
|
default: C(() => {
|
|
265
265
|
var $;
|
|
266
266
|
return [
|
|
267
|
-
(($ = e.column.search) == null ? void 0 : $.el) === "select" ? (S(!0), L(H, { key: 0 }, he(b.value, (D,
|
|
268
|
-
key:
|
|
267
|
+
(($ = e.column.search) == null ? void 0 : $.el) === "select" ? (S(!0), L(H, { key: 0 }, he(b.value, (D, j) => (S(), F(de("el-option"), {
|
|
268
|
+
key: j,
|
|
269
269
|
label: D[y.value.label] ?? "",
|
|
270
270
|
value: D[y.value.value]
|
|
271
271
|
}, null, 8, ["label", "value"]))), 128)) : A(e.$slots, "default", { key: 1 }, void 0, !0)
|
|
@@ -458,15 +458,15 @@ const da = /* @__PURE__ */ ne({
|
|
|
458
458
|
}), {
|
|
459
459
|
default: (h) => {
|
|
460
460
|
var R, W, x;
|
|
461
|
-
let
|
|
461
|
+
let U;
|
|
462
462
|
if (n._children) return n._children.map((V) => b(V));
|
|
463
463
|
if (n.render) return n.render(h);
|
|
464
464
|
if (n.prop === "operation") {
|
|
465
|
-
if (!f[
|
|
465
|
+
if (!f[K(n.prop)]) {
|
|
466
466
|
a.value.width = 0;
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
|
-
const V = ((W = (R = f[
|
|
469
|
+
const V = ((W = (R = f[K(n.prop)](h)) == null ? void 0 : R.at(0)) == null ? void 0 : W.children) || [], T = (P) => Array.from(P).map((_) => {
|
|
470
470
|
var $, D;
|
|
471
471
|
return (($ = _.type) == null ? void 0 : $.name) === "ElButton" && _.children !== "v-if" ? _ : (D = _.children) != null && D.length ? T(_.children) : null;
|
|
472
472
|
}).filter(Boolean).flat(), e = T(V), i = (P) => {
|
|
@@ -484,8 +484,8 @@ const da = /* @__PURE__ */ ne({
|
|
|
484
484
|
const P = Math.ceil(i(e));
|
|
485
485
|
let _ = P;
|
|
486
486
|
return c.customColumn && (_ = e.length ? e.length === 1 ? P + 30 : P : 50), s(_), w("div", {
|
|
487
|
-
class: "operation-container"
|
|
488
|
-
}, [
|
|
487
|
+
class: "operation-container all-action"
|
|
488
|
+
}, [f[K(n.prop)](h)]);
|
|
489
489
|
}
|
|
490
490
|
const l = [], v = e.slice(0, 2), z = w(ke, {
|
|
491
491
|
link: !0,
|
|
@@ -509,10 +509,10 @@ const da = /* @__PURE__ */ ne({
|
|
|
509
509
|
class: "operation-container"
|
|
510
510
|
}, [l]);
|
|
511
511
|
}
|
|
512
|
-
return f[
|
|
512
|
+
return f[K(n.prop)] ? f[K(n.prop)](h) : n.tag ? w(He, {
|
|
513
513
|
type: t(n, h)
|
|
514
|
-
}, _e(
|
|
515
|
-
default: () => [
|
|
514
|
+
}, _e(U = y(n, h)) ? U : {
|
|
515
|
+
default: () => [U]
|
|
516
516
|
}) : n.click && y(n, h) !== ee ? w("span", {
|
|
517
517
|
class: "el-link el-link--primary scan-link",
|
|
518
518
|
onClick: function() {
|
|
@@ -522,7 +522,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
522
522
|
class: ((x = Qt(ce(h.row, n.prop), m.value.get(n.prop))) == null ? void 0 : x.state) || "text"
|
|
523
523
|
}, [n.formatter ? n.formatter(h.row, h.column, h.row[n.prop], h.$index) : y(n, h)]);
|
|
524
524
|
},
|
|
525
|
-
header: (h) => n.headerRender ? n.headerRender(h) : f[`${
|
|
525
|
+
header: (h) => n.headerRender ? n.headerRender(h) : f[`${K(n.prop)}Header`] ? f[`${K(n.prop)}Header`](h) : n.label
|
|
526
526
|
})]);
|
|
527
527
|
return (n, h) => (S(), F(b, Ne(We(a.value)), null, 16));
|
|
528
528
|
}
|
|
@@ -540,7 +540,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
540
540
|
},
|
|
541
541
|
emits: ["close", "submit", "dragSort"],
|
|
542
542
|
setup(g, { expose: c, emit: a }) {
|
|
543
|
-
const f = M(), m = M(!1), y = g, t = M([]), b = M((/* @__PURE__ */ new Date()).getTime()), n = M(!1), h = M(),
|
|
543
|
+
const f = M(), m = M(!1), y = g, t = M([]), b = M((/* @__PURE__ */ new Date()).getTime()), n = M(!1), h = M(), U = (i) => {
|
|
544
544
|
t.value = i, n.value = !0, fe(() => {
|
|
545
545
|
V();
|
|
546
546
|
});
|
|
@@ -579,7 +579,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
579
579
|
n.value = !1;
|
|
580
580
|
};
|
|
581
581
|
return c({
|
|
582
|
-
openColSetting:
|
|
582
|
+
openColSetting: U
|
|
583
583
|
}), (i, s) => (S(), L("div", pa, [
|
|
584
584
|
w(xt, {
|
|
585
585
|
modelValue: n.value,
|
|
@@ -760,7 +760,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
760
760
|
var u;
|
|
761
761
|
(u = o.querySelector("input")) == null || u.focus();
|
|
762
762
|
}
|
|
763
|
-
}, y = je(), t = g, b = M(), n = ["selection", "radio", "index", "expand", "sort", "input"], h = M(t.isShowSearch),
|
|
763
|
+
}, y = je(), t = g, b = M(), n = ["selection", "radio", "index", "expand", "sort", "input"], h = M(t.isShowSearch), U = M(""), R = M({}), W = M(t.maxHeight || "1000px"), { selectionChange: x, selectedList: V, selectedListIds: T, isSelected: e } = Zt(t.rowKey, t.selectChangeCallback), {
|
|
764
764
|
loading: i,
|
|
765
765
|
tableData: s,
|
|
766
766
|
pageable: l,
|
|
@@ -771,21 +771,21 @@ const da = /* @__PURE__ */ ne({
|
|
|
771
771
|
reset: _,
|
|
772
772
|
handleSizeChange: $,
|
|
773
773
|
handleCurrentChange: D
|
|
774
|
-
} = Ht(t.requestApi, t.initParam, t.pagination, t.dataCallback, t.requestError, t.handleParam),
|
|
774
|
+
} = Ht(t.requestApi, t.initParam, t.pagination, t.dataCallback, t.requestError, t.handleParam), j = (o) => {
|
|
775
775
|
function u(it) {
|
|
776
776
|
return it.replace(/[A-Z]/g, (ct) => "_" + ct.toLowerCase());
|
|
777
777
|
}
|
|
778
778
|
const d = {
|
|
779
779
|
ascending: "asc",
|
|
780
780
|
descending: "desc"
|
|
781
|
-
}, { prop: r, order: E } = o,
|
|
781
|
+
}, { prop: r, order: E } = o, N = u(K(r)), ie = d[E];
|
|
782
782
|
v.value = {
|
|
783
783
|
...v.value,
|
|
784
|
-
sortKey:
|
|
784
|
+
sortKey: N,
|
|
785
785
|
sortOrder: ie
|
|
786
786
|
}, l.value.page = 1, P();
|
|
787
787
|
}, G = () => b.value.clearSelection(), ve = () => b.value.clearSort(), Te = M(!1), $e = () => {
|
|
788
|
-
at(), st(), t.requestAuto && k(), t.data && (l.value.total = t.data.length);
|
|
788
|
+
at(), t.customColumn && st(), t.requestAuto && k(), t.data && (l.value.total = t.data.length);
|
|
789
789
|
};
|
|
790
790
|
mt(() => {
|
|
791
791
|
$e(), fe(() => {
|
|
@@ -823,9 +823,9 @@ const da = /* @__PURE__ */ ne({
|
|
|
823
823
|
}).sort((u, d) => u.search.order - d.search.order);
|
|
824
824
|
});
|
|
825
825
|
(Le = Be.value) == null || Le.forEach((o, u) => {
|
|
826
|
-
var E,
|
|
826
|
+
var E, N, ie;
|
|
827
827
|
o.search.order = ((E = o.search) == null ? void 0 : E.order) ?? u + 2;
|
|
828
|
-
const d = ((
|
|
828
|
+
const d = ((N = o.search) == null ? void 0 : N.key) ?? K(o.prop), r = (ie = o.search) == null ? void 0 : ie.defaultValue;
|
|
829
829
|
r != null && (z.value[d] = r, v.value[d] = r);
|
|
830
830
|
});
|
|
831
831
|
const be = a, et = () => {
|
|
@@ -899,7 +899,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
899
899
|
return c({
|
|
900
900
|
element: b,
|
|
901
901
|
tableData: re,
|
|
902
|
-
radio:
|
|
902
|
+
radio: U,
|
|
903
903
|
pageable: l,
|
|
904
904
|
searchParam: v,
|
|
905
905
|
searchInitParam: z,
|
|
@@ -993,7 +993,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
993
993
|
"tooltip-options": { showArrow: !1, placement: "bottom-start", offset: t.offset ? t.offset : -20 }
|
|
994
994
|
}, _t(o.$attrs), {
|
|
995
995
|
onSelectionChange: p(x),
|
|
996
|
-
onSortChange: u[1] || (u[1] = (r) => t.onSortChange ? t.onSortChange(r) :
|
|
996
|
+
onSortChange: u[1] || (u[1] = (r) => t.onSortChange ? t.onSortChange(r) : j(r))
|
|
997
997
|
}), {
|
|
998
998
|
append: C(() => [
|
|
999
999
|
A(o.$slots, "append", {}, void 0, !0)
|
|
@@ -1047,7 +1047,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
1047
1047
|
E.row.$showInput ? (S(), L("div", Ma, [
|
|
1048
1048
|
Ce(w(p(Je), {
|
|
1049
1049
|
modelValue: se.value,
|
|
1050
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
1050
|
+
"onUpdate:modelValue": u[0] || (u[0] = (N) => se.value = N),
|
|
1051
1051
|
min: 0,
|
|
1052
1052
|
controls: !1
|
|
1053
1053
|
}, null, 8, ["modelValue"]), [
|
|
@@ -1056,7 +1056,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
1056
1056
|
w(p(Se), {
|
|
1057
1057
|
underline: !1,
|
|
1058
1058
|
type: "primary",
|
|
1059
|
-
onClick: (
|
|
1059
|
+
onClick: (N) => ot(E.row, String(r.prop), r.blurCallback),
|
|
1060
1060
|
class: "ml-5"
|
|
1061
1061
|
}, {
|
|
1062
1062
|
default: C(() => u[3] || (u[3] = [
|
|
@@ -1067,7 +1067,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
1067
1067
|
w(p(Se), {
|
|
1068
1068
|
type: "primary",
|
|
1069
1069
|
underline: !1,
|
|
1070
|
-
onClick: (
|
|
1070
|
+
onClick: (N) => lt(E.row),
|
|
1071
1071
|
class: "ml-5"
|
|
1072
1072
|
}, {
|
|
1073
1073
|
default: C(() => u[4] || (u[4] = [
|
|
@@ -1086,7 +1086,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
1086
1086
|
w(p(Se), {
|
|
1087
1087
|
underline: !1,
|
|
1088
1088
|
class: "text d-flex inline-input-text pointer",
|
|
1089
|
-
onClick: (
|
|
1089
|
+
onClick: (N) => nt(E.row, r.prop)
|
|
1090
1090
|
}, {
|
|
1091
1091
|
default: C(() => u[2] || (u[2] = [
|
|
1092
1092
|
B("i", { class: "iconfont icon-edit" }, null, -1)
|
|
@@ -1116,8 +1116,8 @@ const da = /* @__PURE__ */ ne({
|
|
|
1116
1116
|
}, pe({ _: 2 }, [
|
|
1117
1117
|
he(Object.keys(o.$slots), (E) => ({
|
|
1118
1118
|
name: E,
|
|
1119
|
-
fn: C((
|
|
1120
|
-
A(o.$slots, E, J({ ref_for: !0 },
|
|
1119
|
+
fn: C((N) => [
|
|
1120
|
+
A(o.$slots, E, J({ ref_for: !0 }, N), void 0, !0)
|
|
1121
1121
|
])
|
|
1122
1122
|
}))
|
|
1123
1123
|
]), 1032, ["column", "custom-column"])) : I("", !0)
|
|
@@ -1154,7 +1154,7 @@ const da = /* @__PURE__ */ ne({
|
|
|
1154
1154
|
}, 8, ["locale"]);
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
|
-
}), Oa = /* @__PURE__ */ le(Fa, [["__scopeId", "data-v-
|
|
1157
|
+
}), Oa = /* @__PURE__ */ le(Fa, [["__scopeId", "data-v-7a9dee77"]]), Na = qt(Oa);
|
|
1158
1158
|
export {
|
|
1159
1159
|
Na as Z
|
|
1160
1160
|
};
|
package/dist/es/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { Z as c } from "./DetailHeader-C13bJw_K.js";
|
|
|
18
18
|
import { Z as g } from "./DiyDataTable-DHGMMFO9.js";
|
|
19
19
|
import { D as R } from "./DiyDataTable-DHGMMFO9.js";
|
|
20
20
|
import { Z as B } from "./Map-DhceUygQ.js";
|
|
21
|
-
import { Z as x } from "./Table-
|
|
21
|
+
import { Z as x } from "./Table-CQjp8H9A.js";
|
|
22
22
|
const A = [
|
|
23
23
|
d,
|
|
24
24
|
r,
|