zhihao-ui 1.2.23 → 1.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as Z, useModel as z, ref as D, openBlock as n, createBlock as v, unref as s, withCtx as p, createVNode as g, createElementBlock as h, Fragment as C, renderList as P, normalizeClass as V, toDisplayString as y, renderSlot as R, createTextVNode as x, createCommentVNode as k, createElementVNode as c, mergeModels as X } from "vue";
|
|
2
2
|
import { D as $ } from "./DatePicker-BrD1XS6-.js";
|
|
3
|
-
import { d as
|
|
3
|
+
import { d as E, e as A, f as j, g as K, i as b, j as T, k as G, l as F, E as M } from "./vendor-gTOtiVzA.js";
|
|
4
4
|
import { _ as J } from "./Button-Va8xfPJd.js";
|
|
5
5
|
import { w as Q } from "./utils-D-zYpBSZ.js";
|
|
6
6
|
var m = /* @__PURE__ */ ((f) => (f.AUTOCOMPLETE = "autocomplete", f.FORMAT = "format", f.TEXT = "text", f))(m || {});
|
|
@@ -24,25 +24,25 @@ const Y = { key: 0 }, ee = {
|
|
|
24
24
|
setup(f, { expose: S }) {
|
|
25
25
|
const u = f, d = z(f, "rawData"), l = D([]), U = () => {
|
|
26
26
|
if (d.value.length === u.maxRowLength) {
|
|
27
|
-
|
|
27
|
+
E({
|
|
28
28
|
message: `最多添加${u.maxRowLength}行`,
|
|
29
29
|
type: "warning"
|
|
30
30
|
});
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
let
|
|
34
|
-
u.beforeAddRow && (
|
|
33
|
+
let a = {};
|
|
34
|
+
u.beforeAddRow && (a = u.beforeAddRow(d.value)), d.value.push(a);
|
|
35
35
|
}, I = () => {
|
|
36
36
|
if (l.value.filter((e) => e.isAdd).length >= u.maxColLength) {
|
|
37
|
-
|
|
37
|
+
E({
|
|
38
38
|
message: `最多添加${u.maxColLength}列`,
|
|
39
39
|
type: "warning"
|
|
40
40
|
});
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const t = String(Date.now());
|
|
44
44
|
l.value.push({
|
|
45
|
-
prop:
|
|
45
|
+
prop: t,
|
|
46
46
|
label: "",
|
|
47
47
|
isEditHeader: !0,
|
|
48
48
|
isAdd: !0,
|
|
@@ -50,22 +50,22 @@ const Y = { key: 0 }, ee = {
|
|
|
50
50
|
minWidth: 150,
|
|
51
51
|
headerMaxlength: 15
|
|
52
52
|
});
|
|
53
|
-
}, O = (
|
|
54
|
-
l.value.splice(
|
|
55
|
-
delete e[
|
|
53
|
+
}, O = (a, t) => {
|
|
54
|
+
l.value.splice(a, 1), d.value.forEach((e) => {
|
|
55
|
+
delete e[t.prop];
|
|
56
56
|
});
|
|
57
|
-
}, q = (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}), d.value.splice(
|
|
61
|
-
}, B = (
|
|
62
|
-
|
|
63
|
-
e.completeList.filter((o) => o.includes(
|
|
57
|
+
}, q = (a) => {
|
|
58
|
+
a === 0 && l.value.forEach((t) => {
|
|
59
|
+
t.isSameData && (d.value[1][t.prop] = d.value[0][t.prop]);
|
|
60
|
+
}), d.value.splice(a, 1);
|
|
61
|
+
}, B = (a, t, e) => {
|
|
62
|
+
t(
|
|
63
|
+
e.completeList.filter((o) => o.includes(a)).map((o) => ({ value: o }))
|
|
64
64
|
);
|
|
65
|
-
}, H = (
|
|
65
|
+
}, H = (a) => [
|
|
66
66
|
{
|
|
67
|
-
validator: (
|
|
68
|
-
if (!l.value[
|
|
67
|
+
validator: (t, e, o) => {
|
|
68
|
+
if (!l.value[a].label) {
|
|
69
69
|
o(new Error("请输入表头"));
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
@@ -74,29 +74,29 @@ const Y = { key: 0 }, ee = {
|
|
|
74
74
|
message: "请输入表头",
|
|
75
75
|
trigger: ["blur", "change"]
|
|
76
76
|
}
|
|
77
|
-
], N = (
|
|
78
|
-
const
|
|
79
|
-
return
|
|
77
|
+
], N = (a) => {
|
|
78
|
+
const t = [];
|
|
79
|
+
return a.required && t.push({
|
|
80
80
|
required: !0,
|
|
81
|
-
message: "请输入" +
|
|
82
|
-
trigger:
|
|
83
|
-
}),
|
|
81
|
+
message: "请输入" + a.label,
|
|
82
|
+
trigger: a.slot ? void 0 : "blur"
|
|
83
|
+
}), a.varidate && t.push({
|
|
84
84
|
validator: (e, o, r) => {
|
|
85
|
-
const i =
|
|
85
|
+
const i = a.varidate(o);
|
|
86
86
|
i !== !0 ? r(new Error(i)) : r();
|
|
87
87
|
},
|
|
88
|
-
trigger:
|
|
89
|
-
}),
|
|
90
|
-
}, W = (
|
|
91
|
-
let e =
|
|
92
|
-
return
|
|
88
|
+
trigger: a.slot ? void 0 : "blur"
|
|
89
|
+
}), t;
|
|
90
|
+
}, W = (a, t) => {
|
|
91
|
+
let e = a;
|
|
92
|
+
return t.isSameData && (e = d.value[0] || $), t.formatter ? t.showFormatter ? t.type === m.FORMAT ? t.showFormatter(t.formatter(e)) : t.showFormatter(e[t.prop]) : t.formatter(e[t.prop]) : e[t.prop] || $;
|
|
93
93
|
}, _ = D();
|
|
94
94
|
return S({
|
|
95
95
|
/** 初始化数据 */
|
|
96
|
-
initData: (
|
|
97
|
-
console.log("initData",
|
|
98
|
-
for (const e in
|
|
99
|
-
if (!
|
|
96
|
+
initData: (a, t) => {
|
|
97
|
+
console.log("initData", a, t), a = A(a) || [], a.length === 0 && a.push({}), t = [...t];
|
|
98
|
+
for (const e in a[0])
|
|
99
|
+
if (!t.some(
|
|
100
100
|
(o) => o.prop === e
|
|
101
101
|
)) {
|
|
102
102
|
const o = Date.now() + e, r = e.split(L);
|
|
@@ -105,7 +105,7 @@ const Y = { key: 0 }, ee = {
|
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
107
|
const i = Number(r[1]);
|
|
108
|
-
|
|
108
|
+
t[i] = {
|
|
109
109
|
prop: e,
|
|
110
110
|
isEditHeader: !0,
|
|
111
111
|
label: r[0],
|
|
@@ -115,60 +115,61 @@ const Y = { key: 0 }, ee = {
|
|
|
115
115
|
headerMaxlength: 15
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
d.value =
|
|
118
|
+
d.value = a, l.value = t;
|
|
119
119
|
},
|
|
120
120
|
/** 获取数据 */
|
|
121
121
|
getData: async () => {
|
|
122
122
|
await _.value.validate();
|
|
123
|
-
for (const
|
|
124
|
-
const e = l.value[
|
|
123
|
+
for (const t in l.value) {
|
|
124
|
+
const e = l.value[t];
|
|
125
125
|
for (const o of l.value)
|
|
126
126
|
if (e.prop !== o.prop && e.label === o.label) {
|
|
127
|
-
|
|
127
|
+
E({
|
|
128
128
|
message: "所有列的表头不可重复",
|
|
129
129
|
type: "warning"
|
|
130
130
|
});
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
for (const
|
|
136
|
-
const e = t
|
|
134
|
+
const a = A(d.value);
|
|
135
|
+
for (const t in a) {
|
|
136
|
+
const e = a[t];
|
|
137
137
|
for (const o in l.value) {
|
|
138
138
|
const r = l.value[o];
|
|
139
|
-
if (r.isSameData &&
|
|
139
|
+
if (r.isSameData && t !== "0" && (e[r.prop] = a[0][r.prop]), r.varidate && !r.varidate(e[r.prop]))
|
|
140
140
|
return;
|
|
141
141
|
if (r.isAdd) {
|
|
142
|
+
delete e[r.prop];
|
|
142
143
|
const i = r.label + L + o;
|
|
143
|
-
e[i] = e[r.prop]
|
|
144
|
+
e[i] = e[r.prop];
|
|
144
145
|
}
|
|
145
146
|
r.formatter && r.type === m.FORMAT && (e[r.prop] = r.formatter(e));
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
|
-
return console.log("DiyDataTable 获取数据",
|
|
149
|
-
data:
|
|
149
|
+
return console.log("DiyDataTable 获取数据", a, l.value), {
|
|
150
|
+
data: a,
|
|
150
151
|
columns: l.value
|
|
151
152
|
};
|
|
152
153
|
},
|
|
153
154
|
/** 更新列配置数据 */
|
|
154
|
-
updateColumn: (
|
|
155
|
-
const e = l.value[
|
|
156
|
-
if (l.value[
|
|
155
|
+
updateColumn: (a, t) => {
|
|
156
|
+
const e = l.value[a].prop;
|
|
157
|
+
if (l.value[a] = t, e !== t.prop)
|
|
157
158
|
for (const o of d.value)
|
|
158
|
-
o[
|
|
159
|
+
o[t.prop] = o[e], delete o[e];
|
|
159
160
|
},
|
|
160
161
|
/** 重置默认列配置数据 */
|
|
161
|
-
resetColumns: (
|
|
162
|
-
const e = l.value.filter((r) => !r.isAdd).reduce((r, i) => (
|
|
162
|
+
resetColumns: (a) => {
|
|
163
|
+
const e = l.value.filter((r) => !r.isAdd).reduce((r, i) => (a.some((w) => w.prop === i.prop) || r.push(i.prop), r), []);
|
|
163
164
|
d.value.forEach((r) => {
|
|
164
165
|
e.forEach((i) => {
|
|
165
166
|
delete r[i];
|
|
166
167
|
});
|
|
167
168
|
});
|
|
168
|
-
const o =
|
|
169
|
-
l.value = [...
|
|
169
|
+
const o = a.filter((r) => r.isAdd);
|
|
170
|
+
l.value = [...a, ...o];
|
|
170
171
|
}
|
|
171
|
-
}), (
|
|
172
|
+
}), (a, t) => (n(), v(s(j), {
|
|
172
173
|
class: "diy-data-table",
|
|
173
174
|
model: f.rawData,
|
|
174
175
|
ref_key: "formRef",
|
|
@@ -177,28 +178,28 @@ const Y = { key: 0 }, ee = {
|
|
|
177
178
|
default: p(() => [
|
|
178
179
|
g(s(K), { data: d.value }, {
|
|
179
180
|
default: p(() => [
|
|
180
|
-
g(s(
|
|
181
|
+
g(s(b), {
|
|
181
182
|
type: "index",
|
|
182
183
|
label: "序号",
|
|
183
184
|
width: "132",
|
|
184
185
|
fixed: "left"
|
|
185
186
|
}),
|
|
186
|
-
(n(!0), h(C, null, P(l.value, (e, o) => (n(), v(s(
|
|
187
|
+
(n(!0), h(C, null, P(l.value, (e, o) => (n(), v(s(b), {
|
|
187
188
|
key: e.key || o,
|
|
188
189
|
prop: e.prop,
|
|
189
190
|
label: e.label,
|
|
190
191
|
width: e.width,
|
|
191
|
-
"min-width": e.minWidth ||
|
|
192
|
+
"min-width": e.minWidth || a.defaultMinWidth,
|
|
192
193
|
fixed: e.fixed
|
|
193
194
|
}, {
|
|
194
195
|
header: p(() => [
|
|
195
|
-
|
|
196
|
+
a.isEdit ? e.isEditHeader ? (n(), h("div", ee, [
|
|
196
197
|
g(s(T), {
|
|
197
198
|
prop: `columns.${o}`,
|
|
198
199
|
rules: H(o)
|
|
199
200
|
}, {
|
|
200
201
|
default: p(() => [
|
|
201
|
-
g(s(
|
|
202
|
+
g(s(F), {
|
|
202
203
|
modelValue: e.label,
|
|
203
204
|
"onUpdate:modelValue": (r) => e.label = r,
|
|
204
205
|
maxlength: e.headerMaxlength || 20,
|
|
@@ -234,11 +235,11 @@ const Y = { key: 0 }, ee = {
|
|
|
234
235
|
placeholder: e.placeholder || "请输入",
|
|
235
236
|
"fetch-suggestions": (i, w) => B(i, w, e),
|
|
236
237
|
maxlength: e.maxlength || 20
|
|
237
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : e.slot ? R(
|
|
238
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : e.slot ? R(a.$slots, e.slot, {
|
|
238
239
|
key: 2,
|
|
239
240
|
row: r.row,
|
|
240
241
|
$index: r.$index
|
|
241
|
-
}, void 0, !0) : (n(), v(s(
|
|
242
|
+
}, void 0, !0) : (n(), v(s(F), {
|
|
242
243
|
key: 3,
|
|
243
244
|
modelValue: r.row[e.prop],
|
|
244
245
|
"onUpdate:modelValue": (i) => r.row[e.prop] = i,
|
|
@@ -249,7 +250,7 @@ const Y = { key: 0 }, ee = {
|
|
|
249
250
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "formatter", "parser", "maxlength"]))
|
|
250
251
|
]),
|
|
251
252
|
_: 2
|
|
252
|
-
}, 1032, ["prop", "rules", "class"])) : e.slot ? R(
|
|
253
|
+
}, 1032, ["prop", "rules", "class"])) : e.slot ? R(a.$slots, e.slot, {
|
|
253
254
|
key: 1,
|
|
254
255
|
row: r.row,
|
|
255
256
|
$index: r.$index
|
|
@@ -259,30 +260,30 @@ const Y = { key: 0 }, ee = {
|
|
|
259
260
|
]),
|
|
260
261
|
_: 2
|
|
261
262
|
}, 1032, ["prop", "label", "width", "min-width", "fixed"]))), 128)),
|
|
262
|
-
u.isEdit ? (n(), v(s(
|
|
263
|
+
u.isEdit ? (n(), v(s(b), {
|
|
263
264
|
key: 0,
|
|
264
265
|
width: "150",
|
|
265
266
|
fixed: "right"
|
|
266
267
|
}, {
|
|
267
268
|
header: p(() => [
|
|
268
269
|
c("div", re, [
|
|
269
|
-
g(s(
|
|
270
|
+
g(s(M), {
|
|
270
271
|
type: "primary",
|
|
271
272
|
link: "",
|
|
272
273
|
onClick: U
|
|
273
274
|
}, {
|
|
274
|
-
default: p(() =>
|
|
275
|
+
default: p(() => t[0] || (t[0] = [
|
|
275
276
|
c("i", { class: "iconfont icon-Frame1" }, null, -1),
|
|
276
277
|
x("增行")
|
|
277
278
|
])),
|
|
278
279
|
_: 1
|
|
279
280
|
}),
|
|
280
|
-
g(s(
|
|
281
|
+
g(s(M), {
|
|
281
282
|
type: "primary",
|
|
282
283
|
link: "",
|
|
283
284
|
onClick: I
|
|
284
285
|
}, {
|
|
285
|
-
default: p(() =>
|
|
286
|
+
default: p(() => t[1] || (t[1] = [
|
|
286
287
|
c("i", { class: "iconfont icon-Frame-11" }, null, -1),
|
|
287
288
|
x("增列")
|
|
288
289
|
])),
|
|
@@ -308,7 +309,7 @@ const Y = { key: 0 }, ee = {
|
|
|
308
309
|
_: 3
|
|
309
310
|
}, 8, ["model"]));
|
|
310
311
|
}
|
|
311
|
-
}), se = /* @__PURE__ */ J(ie, [["__scopeId", "data-v-
|
|
312
|
+
}), se = /* @__PURE__ */ J(ie, [["__scopeId", "data-v-a8cfe06d"]]), he = Q(se);
|
|
312
313
|
export {
|
|
313
314
|
m as D,
|
|
314
315
|
he as Z
|
|
@@ -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
|
@@ -15,10 +15,10 @@ import { Z as T } from "./PageHeadPanel-BWjWkx8n.js";
|
|
|
15
15
|
import { Z as b } from "./ToolTips-Bw2lHQxC.js";
|
|
16
16
|
import { Z as d } from "./BaseInfo-DCB7xgRw.js";
|
|
17
17
|
import { Z as c } from "./DetailHeader-C13bJw_K.js";
|
|
18
|
-
import { Z as g } from "./DiyDataTable-
|
|
19
|
-
import { D as R } from "./DiyDataTable-
|
|
18
|
+
import { Z as g } from "./DiyDataTable-BqAwjS3F.js";
|
|
19
|
+
import { D as R } from "./DiyDataTable-BqAwjS3F.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,
|