@dazhicheng/ui 1.6.6 → 1.6.8
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/dist/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-form/src/form-render/expandable.js +31 -32
- package/dist/components/tt-form/src/useFormContext.js +1 -1
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-modal/src/utils/resolve-modal-target.js +1 -3
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
- package/dist/components/tt-table/index.d.ts +3 -15
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/Table.vue.d.ts +1 -1
- package/dist/components/tt-table/src/Table.vue.js +3 -3
- package/dist/components/tt-table/src/TableForm.vue.d.ts +0 -9
- package/dist/components/tt-table/src/TableForm.vue.js +175 -167
- package/dist/components/tt-table/src/components/TableAction.vue.d.ts +2 -12
- package/dist/components/tt-table/src/components/TableAction.vue.js +78 -175
- package/dist/components/tt-table/src/hooks/useGridProps.js +64 -60
- package/dist/components/tt-table/src/hooks/useTableData.js +77 -74
- package/dist/components/tt-table/src/hooks/useTableForm.js +22 -23
- package/dist/components/tt-table/src/props.d.ts +0 -5
- package/dist/components/tt-table/src/props.js +22 -31
- package/dist/components/tt-table/src/types/table.d.ts +2 -1
- package/dist/components/tt-table/src/types/tableForm.d.ts +0 -2
- package/dist/components/tt-table/src/utils/table-api.d.ts +2 -1
- package/dist/components/tt-table/src/utils/table-api.js +3 -2
- package/dist/components/tt-table/src/utils/table-form-api.js +14 -15
- package/dist/components/tt-vtable/index.js +54 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +188 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue.js +227 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +32 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +121 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +64 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +97 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +53 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +52 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +35 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +50 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +63 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +126 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +133 -0
- package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +4 -0
- package/dist/components/tt-vtable/src/composables/useVTable.d.ts +41 -0
- package/dist/components/tt-vtable/src/composables/useVTable.js +25 -0
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +13 -0
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +92 -0
- package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +13 -0
- package/dist/components/tt-vtable/src/composables/useVTableRender.js +13 -0
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +10 -0
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +63 -0
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +37 -0
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +133 -0
- package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +8 -0
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +23 -0
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +70 -0
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +38 -0
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +41 -0
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +45 -0
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +73 -0
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +25 -0
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +25 -0
- package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +29 -0
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +36 -0
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +52 -0
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +74 -0
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +232 -0
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +48 -0
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +102 -0
- package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +51 -0
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +40 -0
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +51 -0
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +38 -0
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +57 -0
- package/dist/components/tt-vtable/src/features/records/index.d.ts +3 -0
- package/dist/components/tt-vtable/src/features/records/record-index.d.ts +122 -0
- package/dist/components/tt-vtable/src/features/records/record-index.js +209 -0
- package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +41 -0
- package/dist/components/tt-vtable/src/features/records/useRecordSource.js +249 -0
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +65 -0
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +129 -0
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +60 -0
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +125 -0
- package/dist/components/tt-vtable/src/public/index.d.ts +7 -0
- package/dist/components/tt-vtable/src/public/table-api.d.ts +215 -0
- package/dist/components/tt-vtable/src/public/table-column.d.ts +123 -0
- package/dist/components/tt-vtable/src/public/table-errors.d.ts +26 -0
- package/dist/components/tt-vtable/src/public/table-errors.js +26 -0
- package/dist/components/tt-vtable/src/public/table-events.d.ts +69 -0
- package/dist/components/tt-vtable/src/public/table-props.d.ts +216 -0
- package/dist/components/tt-vtable/src/public/table-slots.d.ts +37 -0
- package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +12 -0
- package/dist/components/tt-vtable/src/runtime/createVTableController.js +238 -0
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +79 -0
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +380 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +129 -115
- package/dist/packages/utils/src/is.js +46 -37
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/dist/assets/svg/action_more.svg.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
import "element-plus";
|
|
3
3
|
import { isString as L, isFunction as N, isObject as Re } from "../../../../packages/utils/src/is.js";
|
|
4
|
-
import { getCurrentInstance as he, shallowRef as J, watch as Q, unref as d, onBeforeUpdate as ve, getCurrentScope as Ce, onScopeDispose as Me,
|
|
4
|
+
import { getCurrentInstance as he, shallowRef as J, watch as Q, toValue as y, unref as d, onBeforeUpdate as ve, getCurrentScope as Ce, onScopeDispose as Me, nextTick as S, isRef as be } from "vue";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
7
7
|
import "xe-utils";
|
|
@@ -53,7 +53,7 @@ const De = /* @__PURE__ */ new Set([
|
|
|
53
53
|
"clearRadioReserve"
|
|
54
54
|
]), ye = /* @__PURE__ */ new Set(["loadData", "reloadData"]);
|
|
55
55
|
function X(l) {
|
|
56
|
-
const f =
|
|
56
|
+
const f = y(l);
|
|
57
57
|
if (f)
|
|
58
58
|
return be(f) ? f.value ?? [] : f;
|
|
59
59
|
}
|
|
@@ -66,7 +66,7 @@ async function ke(l, f, C, g = () => !0) {
|
|
|
66
66
|
}
|
|
67
67
|
function je(l, f, C, g, i) {
|
|
68
68
|
const R = he(), b = J([]), D = J();
|
|
69
|
-
let A = !1,
|
|
69
|
+
let A = !1, u = !1, M = 0, h;
|
|
70
70
|
const q = Symbol("tt-table-emitted-rows-event");
|
|
71
71
|
let Y = 0, m, v = !1, T = 0, U = Promise.resolve();
|
|
72
72
|
function p() {
|
|
@@ -85,7 +85,7 @@ function je(l, f, C, g, i) {
|
|
|
85
85
|
const t = X(i.data);
|
|
86
86
|
return t != null && t.length ? "data" : p() ? "model" : "data";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function E(e) {
|
|
89
89
|
const t = U.then(e);
|
|
90
90
|
return U = t.then(
|
|
91
91
|
() => {
|
|
@@ -96,39 +96,39 @@ function je(l, f, C, g, i) {
|
|
|
96
96
|
}
|
|
97
97
|
function ee(e, t) {
|
|
98
98
|
return new Proxy(e, {
|
|
99
|
-
get(
|
|
100
|
-
return a === q ? t : Reflect.get(
|
|
99
|
+
get(r, a, o) {
|
|
100
|
+
return a === q ? t : Reflect.get(r, a, o);
|
|
101
101
|
},
|
|
102
|
-
set(
|
|
103
|
-
const
|
|
104
|
-
return
|
|
102
|
+
set(r, a, o) {
|
|
103
|
+
const s = Reflect.set(r, a, o);
|
|
104
|
+
return s && t === m && (v = !0), s;
|
|
105
105
|
},
|
|
106
|
-
deleteProperty(
|
|
107
|
-
const
|
|
108
|
-
return
|
|
106
|
+
deleteProperty(r, a) {
|
|
107
|
+
const o = Reflect.deleteProperty(r, a);
|
|
108
|
+
return o && t === m && (v = !0), o;
|
|
109
109
|
},
|
|
110
|
-
defineProperty(
|
|
111
|
-
const
|
|
112
|
-
return
|
|
110
|
+
defineProperty(r, a, o) {
|
|
111
|
+
const s = Reflect.defineProperty(r, a, o);
|
|
112
|
+
return s && t === m && (v = !0), s;
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
function te(e) {
|
|
117
117
|
const t = e == null ? void 0 : e[q], n = m;
|
|
118
118
|
if (n === void 0 || t !== n) return !1;
|
|
119
|
-
const
|
|
120
|
-
return m = void 0, v = !1, !
|
|
119
|
+
const r = v;
|
|
120
|
+
return m = void 0, v = !1, !r;
|
|
121
121
|
}
|
|
122
122
|
function ne(e) {
|
|
123
|
-
|
|
123
|
+
S(() => {
|
|
124
124
|
m === e && (m = void 0, v = !1);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
function V(e) {
|
|
128
|
-
const t =
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
m =
|
|
128
|
+
const t = y(i.api), n = p(), r = Z(), a = r && !t;
|
|
129
|
+
r && (D.value = "model");
|
|
130
|
+
const o = a ? ++Y : void 0, s = o ? ee(e, o) : e;
|
|
131
|
+
m = o, v = !1, b.value = s, (r || !n && !t) && (C.value = s, o && ne(o));
|
|
132
132
|
}
|
|
133
133
|
function k(e) {
|
|
134
134
|
var n;
|
|
@@ -136,33 +136,33 @@ function je(l, f, C, g, i) {
|
|
|
136
136
|
return (e === "visible" ? t == null ? void 0 : t.visibleData : t == null ? void 0 : t.fullData) || [];
|
|
137
137
|
}
|
|
138
138
|
function O(e = "full") {
|
|
139
|
-
return
|
|
139
|
+
return u || !d(f) ? !1 : (h = void 0, V(k(e)), !0);
|
|
140
140
|
}
|
|
141
141
|
function j(e = "full") {
|
|
142
|
-
if (
|
|
142
|
+
if (u || M || !d(b).length && !k(e).length) return;
|
|
143
143
|
if (h) {
|
|
144
144
|
e === "visible" && (h.source = e);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
const t = { inputVersion: T, source: e };
|
|
148
|
-
h = t,
|
|
149
|
-
h === t && (h = void 0, !(
|
|
148
|
+
h = t, S().then(() => {
|
|
149
|
+
h === t && (h = void 0, !(u || M || t.inputVersion !== T) && O(t.source));
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function z() {
|
|
153
153
|
h = void 0;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function re() {
|
|
156
156
|
j();
|
|
157
157
|
}
|
|
158
158
|
async function F(e, t = "full") {
|
|
159
159
|
const n = T;
|
|
160
|
-
return
|
|
161
|
-
if (!
|
|
160
|
+
return E(async () => {
|
|
161
|
+
if (!u) {
|
|
162
162
|
M += 1;
|
|
163
163
|
try {
|
|
164
|
-
const
|
|
165
|
-
return await
|
|
164
|
+
const r = await e();
|
|
165
|
+
return await S(), !u && n === T && O(t), r;
|
|
166
166
|
} finally {
|
|
167
167
|
M -= 1;
|
|
168
168
|
}
|
|
@@ -170,11 +170,11 @@ function je(l, f, C, g, i) {
|
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
const K = /* @__PURE__ */ new WeakMap();
|
|
173
|
-
function
|
|
173
|
+
function oe(e) {
|
|
174
174
|
const t = Reflect.get(e, "getRefMaps");
|
|
175
175
|
if (!N(t)) return;
|
|
176
176
|
const n = Reflect.apply(t, e, []);
|
|
177
|
-
return
|
|
177
|
+
return y(n.refTable);
|
|
178
178
|
}
|
|
179
179
|
function ie(e) {
|
|
180
180
|
if (L(e)) return e;
|
|
@@ -184,72 +184,72 @@ function je(l, f, C, g, i) {
|
|
|
184
184
|
return e.updateData();
|
|
185
185
|
}
|
|
186
186
|
function le(e, t) {
|
|
187
|
-
var n,
|
|
188
|
-
ye.has(e) && t[0] && ((n = i.prepareRows) == null || n.call(i, t[0])), e === "loadTreeChildren" && t[1] && ((
|
|
187
|
+
var n, r;
|
|
188
|
+
ye.has(e) && t[0] && ((n = i.prepareRows) == null || n.call(i, t[0])), e === "loadTreeChildren" && t[1] && ((r = i.prepareRows) == null || r.call(i, t[1]));
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function ue(e) {
|
|
191
191
|
if (!e) return;
|
|
192
192
|
const t = K.get(e);
|
|
193
193
|
if (t) return t;
|
|
194
|
-
const n = /* @__PURE__ */ new Map(),
|
|
195
|
-
get(a,
|
|
196
|
-
let c = Reflect.get(a,
|
|
197
|
-
if (!L(
|
|
198
|
-
const W = xe.has(
|
|
199
|
-
if (!W && !De.has(
|
|
200
|
-
let
|
|
194
|
+
const n = /* @__PURE__ */ new Map(), r = new Proxy(e, {
|
|
195
|
+
get(a, o, s) {
|
|
196
|
+
let c = Reflect.get(a, o, s);
|
|
197
|
+
if (!L(o)) return c;
|
|
198
|
+
const W = xe.has(o);
|
|
199
|
+
if (!W && !De.has(o)) return c;
|
|
200
|
+
let P = a;
|
|
201
201
|
if (!N(c)) {
|
|
202
|
-
const w =
|
|
203
|
-
w && (
|
|
202
|
+
const w = oe(a);
|
|
203
|
+
w && (P = w, c = Reflect.get(w, o));
|
|
204
204
|
}
|
|
205
205
|
if (!N(c)) return c;
|
|
206
|
-
const $ = n.get(
|
|
206
|
+
const $ = n.get(o);
|
|
207
207
|
if ($) return $;
|
|
208
|
-
const me =
|
|
208
|
+
const me = o === "undo" || o === "redo" ? "visible" : "full", G = (...w) => {
|
|
209
209
|
if (W) {
|
|
210
|
-
const B = Reflect.apply(c,
|
|
210
|
+
const B = Reflect.apply(c, P, w);
|
|
211
211
|
return Promise.resolve(B).then((we) => {
|
|
212
212
|
var H;
|
|
213
213
|
return (H = i.onSelectionMutated) == null || H.call(i), we;
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
if (le(
|
|
217
|
-
if (
|
|
216
|
+
if (le(o, w), o === "syncData") return F(() => ae(a));
|
|
217
|
+
if (o === "commitProxy") {
|
|
218
218
|
const B = ie(w[0]);
|
|
219
219
|
if (!Te.has(B || ""))
|
|
220
|
-
return Reflect.apply(c,
|
|
220
|
+
return Reflect.apply(c, P, w);
|
|
221
221
|
}
|
|
222
|
-
return F(() => Reflect.apply(c,
|
|
222
|
+
return F(() => Reflect.apply(c, P, w), me);
|
|
223
223
|
};
|
|
224
|
-
return n.set(
|
|
224
|
+
return n.set(o, G), G;
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
|
-
return K.set(e,
|
|
227
|
+
return K.set(e, r), r;
|
|
228
228
|
}
|
|
229
229
|
async function I(e, t) {
|
|
230
230
|
var c;
|
|
231
|
-
if (
|
|
231
|
+
if (u || !x(t)) return !1;
|
|
232
232
|
const n = d(f);
|
|
233
233
|
if (!n) return !1;
|
|
234
|
-
const { treeConfig:
|
|
234
|
+
const { treeConfig: r, clearTreeExpand: a, mergeCells: o } = d(l), s = n.getTreeExpandRecords();
|
|
235
235
|
M += 1;
|
|
236
236
|
try {
|
|
237
|
-
return (c = i.prepareRows) == null || c.call(i, e), await n.loadData(e),
|
|
237
|
+
return (c = i.prepareRows) == null || c.call(i, e), await n.loadData(e), u || !x(t) || o && (await n.setMergeCells(o), u || !x(t)) || (a ? await n.clearTreeExpand() : s.length && (r != null && r.reserve) && await n.setTreeExpand(s, !0), u || !x(t)) ? !1 : (b.value = e, g("load-data"), !0);
|
|
238
238
|
} finally {
|
|
239
239
|
M -= 1;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
242
|
+
function se(e, t) {
|
|
243
|
+
return E(() => I(e, t));
|
|
244
244
|
}
|
|
245
245
|
function fe(e, t) {
|
|
246
|
-
return
|
|
246
|
+
return E(async () => !await I(e, t) || u || !x(t) ? !1 : (V(e), !0));
|
|
247
247
|
}
|
|
248
248
|
function ce(e, t) {
|
|
249
|
-
return
|
|
250
|
-
var
|
|
251
|
-
if (await
|
|
252
|
-
const n = ((
|
|
249
|
+
return E(async () => {
|
|
250
|
+
var r;
|
|
251
|
+
if (await S(), u || !t()) return !1;
|
|
252
|
+
const n = ((r = d(f)) == null ? void 0 : r.getTableData().fullData) || [];
|
|
253
253
|
return !e.length && !d(b).length && !n.length ? !1 : I(e, t);
|
|
254
254
|
});
|
|
255
255
|
}
|
|
@@ -259,13 +259,16 @@ function je(l, f, C, g, i) {
|
|
|
259
259
|
}
|
|
260
260
|
function pe() {
|
|
261
261
|
const { api: e, data: t } = i;
|
|
262
|
-
if (
|
|
262
|
+
if (y(e)) return;
|
|
263
263
|
if (D.value === "model" && p()) return d(C) || [];
|
|
264
264
|
const n = X(t);
|
|
265
265
|
return n !== void 0 ? n : p() ? d(C) || [] : void 0;
|
|
266
266
|
}
|
|
267
267
|
return D.value = _(), A = p(), Q(
|
|
268
|
-
() =>
|
|
268
|
+
() => {
|
|
269
|
+
if (!y(i.api))
|
|
270
|
+
return p() ? d(C) : void 0;
|
|
271
|
+
},
|
|
269
272
|
() => {
|
|
270
273
|
p() && (D.value = "model");
|
|
271
274
|
},
|
|
@@ -273,10 +276,10 @@ function je(l, f, C, g, i) {
|
|
|
273
276
|
), Q(
|
|
274
277
|
pe,
|
|
275
278
|
(e, t, n) => {
|
|
276
|
-
let
|
|
279
|
+
let r = !0;
|
|
277
280
|
n(() => {
|
|
278
|
-
|
|
279
|
-
}), !te(e) && (T += 1, z(), e && ce(e, () =>
|
|
281
|
+
r = !1;
|
|
282
|
+
}), !te(e) && (T += 1, z(), e && ce(e, () => r).catch((a) => {
|
|
280
283
|
}));
|
|
281
284
|
},
|
|
282
285
|
{ immediate: !0, deep: 1, flush: "post" }
|
|
@@ -284,21 +287,21 @@ function je(l, f, C, g, i) {
|
|
|
284
287
|
const e = p();
|
|
285
288
|
e !== A && (A = e, D.value = _());
|
|
286
289
|
}), Ce() && Me(() => {
|
|
287
|
-
|
|
290
|
+
u = !0, h = void 0, m = void 0, v = !1;
|
|
288
291
|
}), {
|
|
289
292
|
rows: b,
|
|
290
|
-
loadRows:
|
|
293
|
+
loadRows: se,
|
|
291
294
|
applyRows: fe,
|
|
292
295
|
emitRows: V,
|
|
293
296
|
getDataSource: de,
|
|
294
297
|
runDataOperation: F,
|
|
295
298
|
scheduleRowsCommit: j,
|
|
296
299
|
cancelRowsCommit: z,
|
|
297
|
-
onDataChange:
|
|
300
|
+
onDataChange: re,
|
|
298
301
|
commitRows: O,
|
|
299
|
-
createTableInstanceFacade:
|
|
302
|
+
createTableInstanceFacade: ue,
|
|
300
303
|
/** 判断表格作用域是否仍然有效。 */
|
|
301
|
-
isActive: () => !
|
|
304
|
+
isActive: () => !u
|
|
302
305
|
};
|
|
303
306
|
}
|
|
304
307
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "axios";
|
|
2
2
|
import "element-plus";
|
|
3
3
|
import { isFunction as m } from "../../../../packages/utils/src/is.js";
|
|
4
|
-
import { computed as
|
|
4
|
+
import { computed as s, unref as i, toValue as a } from "vue";
|
|
5
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
7
7
|
import "xe-utils";
|
|
@@ -12,12 +12,12 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
|
|
|
12
12
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
13
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
14
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
-
import { omit as
|
|
16
|
-
function
|
|
17
|
-
const f =
|
|
15
|
+
import { omit as u } from "lodash-es";
|
|
16
|
+
function k(n, p, h, l) {
|
|
17
|
+
const f = s(() => {
|
|
18
18
|
const { form: t } = i(n), o = {
|
|
19
19
|
...t == null ? void 0 : t.submitButtonOptions,
|
|
20
|
-
loading: i(
|
|
20
|
+
loading: i(h)
|
|
21
21
|
};
|
|
22
22
|
return {
|
|
23
23
|
...t,
|
|
@@ -25,44 +25,43 @@ function j(n, h, l, d) {
|
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
async function b(t) {
|
|
28
|
-
const o =
|
|
29
|
-
await
|
|
28
|
+
const o = l(), r = { currentPage: 1, pageSize: o == null ? void 0 : o.pageSize };
|
|
29
|
+
await p({ tablePage: r, searchInfo: t });
|
|
30
30
|
}
|
|
31
|
-
async function
|
|
32
|
-
const { handleSearchInfoFn: o, table: r } =
|
|
31
|
+
async function d(t) {
|
|
32
|
+
const { handleSearchInfoFn: o, table: r } = a(n);
|
|
33
33
|
let e = t;
|
|
34
34
|
return m(o) && (e = await o(e) || e), m(r == null ? void 0 : r.beforeFetch) && (e = await r.beforeFetch(e) || e), e;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
const { columnsKey: t, showSetting: o, showSetColumn: r, showRefresh: e, showExport:
|
|
36
|
+
const c = s(() => {
|
|
37
|
+
const { columnsKey: t, showSetting: o, showSetColumn: r, showRefresh: e, showExport: F } = i(n).table || {}, { toolConfig: w } = i(n);
|
|
38
38
|
return {
|
|
39
39
|
columnsKey: t,
|
|
40
40
|
showSetting: o,
|
|
41
41
|
showRefresh: e,
|
|
42
42
|
showSetColumn: r,
|
|
43
|
-
showExport:
|
|
44
|
-
...
|
|
43
|
+
showExport: F,
|
|
44
|
+
...w
|
|
45
45
|
};
|
|
46
|
-
}), g =
|
|
47
|
-
const { table: t = {},
|
|
46
|
+
}), g = s(() => {
|
|
47
|
+
const { table: t = {}, useSearchForm: o, testId: r } = a(n), e = u(i(c), ["tableRowId"]);
|
|
48
48
|
return {
|
|
49
|
-
useSearchForm:
|
|
49
|
+
useSearchForm: o || !1,
|
|
50
50
|
// 数据由 TableForm 单独绑定,不进入表格配置。
|
|
51
|
-
...
|
|
52
|
-
...
|
|
53
|
-
tableRowId: (t == null ? void 0 : t.tableRowId) || o,
|
|
51
|
+
...u(t, ["data"]),
|
|
52
|
+
...e,
|
|
54
53
|
// 继承外层的 testId,如果 table.testId 未设置则使用外层的 testId
|
|
55
|
-
testId: (t == null ? void 0 : t.testId) ||
|
|
56
|
-
beforeFetch:
|
|
54
|
+
testId: (t == null ? void 0 : t.testId) || r,
|
|
55
|
+
beforeFetch: d
|
|
57
56
|
};
|
|
58
57
|
});
|
|
59
58
|
return {
|
|
60
59
|
getFormProps: f,
|
|
61
60
|
submitSearchQuery: b,
|
|
62
61
|
getTableProps: g,
|
|
63
|
-
getTableToolProps:
|
|
62
|
+
getTableToolProps: c
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
65
|
export {
|
|
67
|
-
|
|
66
|
+
k as useTableForm
|
|
68
67
|
};
|
|
@@ -509,11 +509,6 @@ export declare const tableFormProps: {
|
|
|
509
509
|
type: PropType<TtTableToolsProps>;
|
|
510
510
|
default: null;
|
|
511
511
|
};
|
|
512
|
-
/** 表格行id */
|
|
513
|
-
tableRowId: {
|
|
514
|
-
type: StringConstructor;
|
|
515
|
-
default: () => string | undefined;
|
|
516
|
-
};
|
|
517
512
|
/** 表格 testId,用于生成测试标识 */
|
|
518
513
|
testId: {
|
|
519
514
|
type: StringConstructor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { propTypes as
|
|
1
|
+
import { propTypes as t } from "../../../packages/hooks/src/propTypes.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "element-plus";
|
|
4
4
|
import "dayjs";
|
|
@@ -14,12 +14,11 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
|
|
|
14
14
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
15
|
import "lodash-es";
|
|
16
16
|
import "vue-router";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return l()[t];
|
|
17
|
+
import { createSharedTableDefaults as o } from "./table-defaults.js";
|
|
18
|
+
function e(l) {
|
|
19
|
+
return o()[l];
|
|
21
20
|
}
|
|
22
|
-
const
|
|
21
|
+
const a = {
|
|
23
22
|
/** 是否显示分页 */
|
|
24
23
|
showPager: { type: Boolean, default: () => e("showPager") },
|
|
25
24
|
/** 当前页数 field */
|
|
@@ -30,7 +29,7 @@ const r = {
|
|
|
30
29
|
totalField: { type: String, default: () => e("totalField") },
|
|
31
30
|
/** 数据的 field */
|
|
32
31
|
dataField: { type: String, default: () => e("dataField") }
|
|
33
|
-
},
|
|
32
|
+
}, r = {
|
|
34
33
|
/** 是否显示复选框 */
|
|
35
34
|
showCheckbox: { type: Boolean, default: () => e("showCheckbox") },
|
|
36
35
|
/** 是否跨页保持复选框选中状态 */
|
|
@@ -83,7 +82,7 @@ const r = {
|
|
|
83
82
|
type: Function
|
|
84
83
|
// default: () => GlobalConfig.table?.customizeColumn,
|
|
85
84
|
}
|
|
86
|
-
},
|
|
85
|
+
}, p = {
|
|
87
86
|
/** api请求方法 */
|
|
88
87
|
api: {
|
|
89
88
|
type: Function,
|
|
@@ -116,7 +115,7 @@ const r = {
|
|
|
116
115
|
},
|
|
117
116
|
/** 是否滚动加载数据 */
|
|
118
117
|
isScrollFetch: { type: Boolean, default: () => e("isScrollFetch") }
|
|
119
|
-
},
|
|
118
|
+
}, n = {
|
|
120
119
|
/** 是否显示toolbar */
|
|
121
120
|
showToolbar: { type: Boolean, default: () => e("showToolbar") },
|
|
122
121
|
/** 具体某些列排序 field数组 */
|
|
@@ -142,14 +141,14 @@ const r = {
|
|
|
142
141
|
},
|
|
143
142
|
/** 是否显示表格上方 alert */
|
|
144
143
|
showTableAlert: { type: Boolean, default: () => e("showTableAlert") }
|
|
145
|
-
},
|
|
144
|
+
}, x = {
|
|
146
145
|
/**
|
|
147
146
|
* 是否自适应高度
|
|
148
147
|
*
|
|
149
148
|
* 组件方式默认 `true`,与 `table-api.ts` 的 `getDefaultState()` 里 hook 方式默认 `false` 有意不同,
|
|
150
149
|
* 不要统一:改任一边都会改变现有页面的表格高度。因此它不进 `createSharedTableDefaults()`。
|
|
151
150
|
*/
|
|
152
|
-
autoHeight:
|
|
151
|
+
autoHeight: t.bool.def(!0),
|
|
153
152
|
/** 左侧插槽的宽度 */
|
|
154
153
|
leftSlotWidth: { type: Number, default: () => e("leftSlotWidth") },
|
|
155
154
|
/** 右侧插槽的宽度 */
|
|
@@ -200,17 +199,17 @@ const r = {
|
|
|
200
199
|
type: Object
|
|
201
200
|
},
|
|
202
201
|
/** 是否使用搜索form */
|
|
203
|
-
useSearchForm:
|
|
202
|
+
useSearchForm: t.bool.def(!1),
|
|
204
203
|
/** 表格 testId,用于生成测试标识 */
|
|
205
204
|
testId: {
|
|
206
205
|
type: String,
|
|
207
206
|
default: void 0
|
|
208
207
|
},
|
|
208
|
+
...a,
|
|
209
209
|
...r,
|
|
210
210
|
...p,
|
|
211
|
-
...n
|
|
212
|
-
|
|
213
|
-
}, d = {
|
|
211
|
+
...n
|
|
212
|
+
}, i = {
|
|
214
213
|
/** 按键配置项 */
|
|
215
214
|
keyboardConfig: {
|
|
216
215
|
type: Object,
|
|
@@ -231,7 +230,7 @@ const r = {
|
|
|
231
230
|
type: Object,
|
|
232
231
|
default: () => e("radioConfig")
|
|
233
232
|
}
|
|
234
|
-
},
|
|
233
|
+
}, T = {
|
|
235
234
|
/**
|
|
236
235
|
* table参数
|
|
237
236
|
*
|
|
@@ -243,10 +242,10 @@ const r = {
|
|
|
243
242
|
*/
|
|
244
243
|
table: {
|
|
245
244
|
type: Object,
|
|
246
|
-
default: () => ({ ...
|
|
245
|
+
default: () => ({ ...o(), autoHeight: !0, columnsKey: "", useSearchForm: !1 })
|
|
247
246
|
},
|
|
248
247
|
/** 是否使用搜索form */
|
|
249
|
-
useSearchForm:
|
|
248
|
+
useSearchForm: t.bool.def(!0),
|
|
250
249
|
/** BasicFormProps 的配置 */
|
|
251
250
|
form: {
|
|
252
251
|
type: Object,
|
|
@@ -267,14 +266,6 @@ const r = {
|
|
|
267
266
|
type: Object,
|
|
268
267
|
default: null
|
|
269
268
|
},
|
|
270
|
-
/** 表格行id */
|
|
271
|
-
tableRowId: {
|
|
272
|
-
type: String,
|
|
273
|
-
default: () => {
|
|
274
|
-
var t;
|
|
275
|
-
return (t = a.table) == null ? void 0 : t.tableRowId;
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
269
|
/** 表格 testId,用于生成测试标识 */
|
|
279
270
|
testId: {
|
|
280
271
|
type: String,
|
|
@@ -284,7 +275,7 @@ const r = {
|
|
|
284
275
|
tableFormApi: {
|
|
285
276
|
type: Object
|
|
286
277
|
}
|
|
287
|
-
},
|
|
278
|
+
}, j = {
|
|
288
279
|
/** 列配置 */
|
|
289
280
|
columns: {
|
|
290
281
|
type: Array,
|
|
@@ -341,10 +332,10 @@ const r = {
|
|
|
341
332
|
type: String,
|
|
342
333
|
default: "right"
|
|
343
334
|
},
|
|
344
|
-
...
|
|
335
|
+
...i
|
|
345
336
|
};
|
|
346
337
|
export {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
338
|
+
T as tableFormProps,
|
|
339
|
+
j as tableOtherProps,
|
|
340
|
+
x as tableProps
|
|
350
341
|
};
|
|
@@ -492,9 +492,10 @@ export type TtTableMethods<DT = VxeTablePropTypes.Row> = {
|
|
|
492
492
|
reload: (data?: FetchParams) => Promise<void>;
|
|
493
493
|
/**
|
|
494
494
|
* @description: 重新计算高度
|
|
495
|
+
* @param full 是否连列宽一起重算,默认重算
|
|
495
496
|
* @return {*}
|
|
496
497
|
*/
|
|
497
|
-
redoHeight: () => void;
|
|
498
|
+
redoHeight: (full?: boolean) => void;
|
|
498
499
|
/**
|
|
499
500
|
* @description: 设置表格props
|
|
500
501
|
* @param {Partial<TtTableProps>} props 表格props
|
|
@@ -75,9 +75,10 @@ declare class TableApi<Row = any> {
|
|
|
75
75
|
setProps(props: Partial<TtTableProps<Row>>): void;
|
|
76
76
|
/**
|
|
77
77
|
* @description: 重新计算高度
|
|
78
|
+
* @param full 是否连列宽一起重算,默认重算
|
|
78
79
|
* @return {*}
|
|
79
80
|
*/
|
|
80
|
-
redoHeight(): void;
|
|
81
|
+
redoHeight(full?: boolean): void;
|
|
81
82
|
/**
|
|
82
83
|
* @description: 设置表格columns
|
|
83
84
|
* @param {VxeGridPropTypes.Columns<DT>} columns columns
|
|
@@ -135,10 +135,11 @@ class F {
|
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* @description: 重新计算高度
|
|
138
|
+
* @param full 是否连列宽一起重算,默认重算
|
|
138
139
|
* @return {*}
|
|
139
140
|
*/
|
|
140
|
-
redoHeight() {
|
|
141
|
-
this.methods.redoHeight();
|
|
141
|
+
redoHeight(t) {
|
|
142
|
+
this.methods.redoHeight(t);
|
|
142
143
|
}
|
|
143
144
|
/**
|
|
144
145
|
* @description: 设置表格columns
|