@dazhicheng/ui 1.5.231 → 1.5.233
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.
|
@@ -89,7 +89,7 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
89
89
|
],
|
|
90
90
|
setup(te, { expose: oe, emit: re }) {
|
|
91
91
|
var H, W, U;
|
|
92
|
-
const u = te,
|
|
92
|
+
const u = te, w = re, A = Ee(), { prefixCls: R } = He("table-form"), y = Oe();
|
|
93
93
|
let t = u.tableFormApi;
|
|
94
94
|
if (!t) {
|
|
95
95
|
t = new ot(u);
|
|
@@ -117,7 +117,7 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
117
117
|
t.tableApi.reload,
|
|
118
118
|
t.tableApi.getLoading,
|
|
119
119
|
t.tableApi.getPagination,
|
|
120
|
-
|
|
120
|
+
w
|
|
121
121
|
), { run: be } = K(
|
|
122
122
|
async () => {
|
|
123
123
|
const e = await r.getValues();
|
|
@@ -143,7 +143,8 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
143
143
|
},
|
|
144
144
|
showCollapseButton: !0,
|
|
145
145
|
collapsed: !0,
|
|
146
|
-
collapseTriggerResize: !0
|
|
146
|
+
collapseTriggerResize: !0,
|
|
147
|
+
collapsedRows: 3
|
|
147
148
|
}), { initCustomSetting: ve, saveColumns: Ce } = Ye({
|
|
148
149
|
getTableProps: d,
|
|
149
150
|
tableMethods: t.tableApi,
|
|
@@ -153,7 +154,7 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
153
154
|
};
|
|
154
155
|
ee.forEach((e) => {
|
|
155
156
|
const o = je.camelCase(e);
|
|
156
|
-
j[o] = (...s) =>
|
|
157
|
+
j[o] = (...s) => w(e, ...s);
|
|
157
158
|
});
|
|
158
159
|
const Se = {
|
|
159
160
|
...j
|
|
@@ -170,7 +171,7 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
170
171
|
o
|
|
171
172
|
)) : {}), e.table && t.tableApi.setState(e.table), e.form && (r == null || r.setState(e.form));
|
|
172
173
|
}
|
|
173
|
-
const { run:
|
|
174
|
+
const { run: we } = K(
|
|
174
175
|
async (e) => {
|
|
175
176
|
r.isMounted && a(S).useSearchForm ? r.validate().then(async (o) => {
|
|
176
177
|
if (o.valid) {
|
|
@@ -198,10 +199,10 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
198
199
|
setTableProps: t.tableApi.setState,
|
|
199
200
|
setFormProps: r.setState,
|
|
200
201
|
setProps: Te,
|
|
201
|
-
reload:
|
|
202
|
+
reload: we,
|
|
202
203
|
selectedKeys: g(() => T(t.tableApi.selectedKeys))
|
|
203
204
|
};
|
|
204
|
-
async function
|
|
205
|
+
async function ye() {
|
|
205
206
|
const { tableRefreshBefore: e } = S.value;
|
|
206
207
|
e && Le(e) && await e(), E.reload();
|
|
207
208
|
}
|
|
@@ -209,40 +210,40 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
209
210
|
var f, m;
|
|
210
211
|
const o = ((m = (f = S.value) == null ? void 0 : f.table) == null ? void 0 : m.columns) || [], s = new Map(o.map((n) => [n.field, n])), l = e.checkedModel.map((n) => s.get(n)).filter(Boolean);
|
|
211
212
|
if (e.isExport) {
|
|
212
|
-
|
|
213
|
+
w("export", e.checkedModel, e.modalApi);
|
|
213
214
|
return;
|
|
214
215
|
}
|
|
215
216
|
e.modalApi.setModalProps({
|
|
216
217
|
confirmLoading: !0
|
|
217
218
|
}), d.value.useHttpCache && await Ce(JSON.stringify(e.checkedModel)), t.tableApi.setTableColumns(l), e.modalApi.setModalProps({
|
|
218
219
|
confirmLoading: !1
|
|
219
|
-
}), e.modalApi.closeModal(),
|
|
220
|
+
}), e.modalApi.closeModal(), w("set-columns", l);
|
|
220
221
|
}
|
|
221
222
|
function D(e = !1) {
|
|
222
223
|
var m, n, h, b, F, P, I, M;
|
|
223
224
|
const { notSetColumnField: o, columns: s } = a(d), l = (b = (h = (n = ((m = t.tableApi.getTableInstance()) == null ? void 0 : m.getTableColumn()) || []) == null ? void 0 : n.visibleColumn) == null ? void 0 : h.map((i) => i.field)) == null ? void 0 : b.filter(Boolean), f = ((P = (F = a(s)) == null ? void 0 : F.filter((i) => i.visible === !0 || i.visible === void 0)) == null ? void 0 : P.map((i) => i.field)) || [];
|
|
224
|
-
(I =
|
|
225
|
+
(I = y.value) == null || I.openModal({
|
|
225
226
|
columns: (T(s) || []).filter((i) => i.visible !== !1),
|
|
226
227
|
displayFields: e ? f : l,
|
|
227
228
|
disabledColumnField: o || []
|
|
228
|
-
}), (M =
|
|
229
|
+
}), (M = y.value) == null || M.setModalProps({
|
|
229
230
|
title: "列设置"
|
|
230
231
|
});
|
|
231
232
|
}
|
|
232
233
|
function N(e = !1) {
|
|
233
234
|
var m, n, h, b, F, P, I, M;
|
|
234
235
|
const { notSetColumnField: o, columns: s } = a(d), l = (b = (h = (n = ((m = t.tableApi.getTableInstance()) == null ? void 0 : m.getTableColumn()) || []) == null ? void 0 : n.visibleColumn) == null ? void 0 : h.map((i) => i.field)) == null ? void 0 : b.filter(Boolean), f = ((P = (F = a(s)) == null ? void 0 : F.filter((i) => i.visible === !0 || i.visible === void 0)) == null ? void 0 : P.map((i) => i.field)) || [];
|
|
235
|
-
(I =
|
|
236
|
+
(I = y.value) == null || I.openModal({
|
|
236
237
|
columns: (T(s) || []).filter((i) => i.visible !== !1),
|
|
237
238
|
displayFields: e ? f : l,
|
|
238
239
|
disabledColumnField: o || [],
|
|
239
240
|
isExport: !0
|
|
240
|
-
}), (M =
|
|
241
|
+
}), (M = y.value) == null || M.setModalProps({
|
|
241
242
|
title: "自定义导出"
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
Qe({ formInstance: r }), q(() => {
|
|
245
|
-
c &&
|
|
246
|
+
c && w("register", E, c == null ? void 0 : c.uid), setTimeout(() => {
|
|
246
247
|
ve();
|
|
247
248
|
}, 16);
|
|
248
249
|
}), O(
|
|
@@ -336,7 +337,7 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
336
337
|
name: "toolbar_tools",
|
|
337
338
|
fn: v(() => [
|
|
338
339
|
$(Ge, Z(a(fe), {
|
|
339
|
-
onOnRefresh:
|
|
340
|
+
onOnRefresh: ye,
|
|
340
341
|
onOnExport: N,
|
|
341
342
|
onOnColumnsSetting: D
|
|
342
343
|
}), {
|
|
@@ -357,7 +358,7 @@ const rt = ["data-testid"], st = ["data-testid"], Mo = /* @__PURE__ */ Me({
|
|
|
357
358
|
], 2),
|
|
358
359
|
$(Ue, {
|
|
359
360
|
ref_key: "tableColumnModalRef",
|
|
360
|
-
ref:
|
|
361
|
+
ref: y,
|
|
361
362
|
"open-export": N,
|
|
362
363
|
"open-column": D,
|
|
363
364
|
onOnSubmit: Fe
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as oe, useAttrs as ne, ref as I, inject as M, computed as
|
|
1
|
+
import { defineComponent as oe, useAttrs as ne, ref as I, inject as M, computed as c, unref as r, toRaw as W, h as re, onMounted as ie, nextTick as le, createElementBlock as u, openBlock as l, normalizeClass as B, createVNode as T, createBlock as b, createCommentVNode as f, withCtx as m, Fragment as v, renderList as P, renderSlot as se, withDirectives as z, mergeProps as ae, normalizeStyle as D, toDisplayString as j, createElementVNode as de, withModifiers as ue, createSlots as ce, createTextVNode as pe } from "vue";
|
|
2
2
|
import { propTypes as y } from "../../../../packages/hooks/src/propTypes.js";
|
|
3
3
|
import { useDesign as fe } from "../../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
@@ -50,8 +50,8 @@ const Ie = { key: 1 }, Be = ["onClick"], Ue = /* @__PURE__ */ oe({
|
|
|
50
50
|
setup(S) {
|
|
51
51
|
const i = S, x = ne(), { prefixCls: $ } = fe("table-action"), g = I(!1), L = M(
|
|
52
52
|
"tableIdContext",
|
|
53
|
-
|
|
54
|
-
), U = M(ke, void 0), q =
|
|
53
|
+
c(() => "")
|
|
54
|
+
), U = M(ke, void 0), q = c(() => {
|
|
55
55
|
if (i.rowIndex !== void 0 && i.rowIndex !== null)
|
|
56
56
|
return i.rowIndex;
|
|
57
57
|
const t = r(U);
|
|
@@ -71,7 +71,7 @@ const Ie = { key: 1 }, Be = ["onClick"], Ue = /* @__PURE__ */ oe({
|
|
|
71
71
|
let e = !0;
|
|
72
72
|
return ge(o) && (e = o), ye(o) && (e = o(t)), e;
|
|
73
73
|
}
|
|
74
|
-
const G =
|
|
74
|
+
const G = c(() => (W(i.actions) || []).filter((t) => F(t)).slice(0, i.showBtnNums)), w = c(() => (W(i.actions) || []).filter((t) => F(t)).slice(i.showBtnNums)), H = c(() => r(w).length > 0), X = c(() => "left flex items-center"), Y = c(() => {
|
|
75
75
|
const t = document.getElementsByTagName("body")[0], o = window.getComputedStyle(t).fontFamily, e = w.value.map((s) => we(s.label, "12px", o) + 22), n = Math.max(...e);
|
|
76
76
|
return n > i.popoverWidth ? n : i.popoverWidth;
|
|
77
77
|
});
|
|
@@ -104,17 +104,17 @@ const Ie = { key: 1 }, Be = ["onClick"], Ue = /* @__PURE__ */ oe({
|
|
|
104
104
|
t.forEach((e) => {
|
|
105
105
|
const n = e.closest(".vxe-table");
|
|
106
106
|
if (!n) return;
|
|
107
|
-
const s = e.getBoundingClientRect(), a = Math.round(s.top), d = o.get(n) || /* @__PURE__ */ new Map(),
|
|
108
|
-
|
|
107
|
+
const s = e.getBoundingClientRect(), a = Math.round(s.top), d = o.get(n) || /* @__PURE__ */ new Map(), p = d.get(a) || [];
|
|
108
|
+
p.push(e), d.set(a, p), o.set(n, d);
|
|
109
109
|
}), o.forEach((e) => {
|
|
110
110
|
e.forEach((n) => {
|
|
111
111
|
const s = n.sort((a, d) => {
|
|
112
|
-
const
|
|
112
|
+
const p = a.closest(".vxe-table"), k = d.closest(".vxe-table"), R = p != null && p.classList.contains("is--fixed-right") ? 1 : 0, _ = k != null && k.classList.contains("is--fixed-right") ? 1 : 0;
|
|
113
113
|
return R !== _ ? _ - R : d.getBoundingClientRect().left - a.getBoundingClientRect().left;
|
|
114
114
|
})[0];
|
|
115
115
|
n.forEach((a) => {
|
|
116
116
|
a.querySelectorAll("[data-table-action-button]").forEach((d) => {
|
|
117
|
-
|
|
117
|
+
d.tabIndex = a === s ? 0 : -1;
|
|
118
118
|
});
|
|
119
119
|
});
|
|
120
120
|
});
|
|
@@ -228,10 +228,10 @@ const Ie = { key: 1 }, Be = ["onClick"], Ue = /* @__PURE__ */ oe({
|
|
|
228
228
|
type: e.type || "primary",
|
|
229
229
|
style: D({ color: e.color }),
|
|
230
230
|
"data-testid": h(e.label || "")
|
|
231
|
-
},
|
|
231
|
+
}, ce({
|
|
232
232
|
default: m(() => [
|
|
233
233
|
e.label ? (l(), u(v, { key: 0 }, [
|
|
234
|
-
|
|
234
|
+
pe(j(e.label), 1)
|
|
235
235
|
], 64)) : f("", !0)
|
|
236
236
|
]),
|
|
237
237
|
_: 2
|