@aplus-frontend/ui 0.5.22 → 0.5.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.
- package/es/src/ap-form/ap-form.vue.d.ts +2 -2
- package/es/src/ap-form/ap-form.vue2.mjs +124 -124
- package/es/src/ap-form/drawer-form/index.vue.d.ts +5 -5
- package/es/src/ap-form/interface.d.ts +3 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +5 -5
- package/es/src/ap-form/search-form/index.vue.d.ts +5 -5
- package/es/src/ap-grid/editable/form-item.vue.mjs +65 -61
- package/es/src/ap-grid/editable/index.vue.mjs +86 -81
- package/es/src/ap-grid/editable/interface.d.ts +1 -1
- package/es/src/ap-grid/index.vue.mjs +22 -22
- package/es/src/ap-grid/interface.d.ts +4 -0
- package/es/src/ap-grid/utils/table.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +42 -41
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +108 -102
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +3 -3
- package/lib/src/ap-form/ap-form.vue.d.ts +2 -2
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +5 -5
- package/lib/src/ap-form/interface.d.ts +3 -2
- package/lib/src/ap-form/modal-form/index.vue.d.ts +5 -5
- package/lib/src/ap-form/search-form/index.vue.d.ts +5 -5
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/editable/interface.d.ts +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +4 -0
- package/lib/src/ap-grid/utils/table.d.ts +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +3 -3
- package/package.json +6 -6
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApForm as
|
|
3
|
-
import { isArray as
|
|
1
|
+
import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as f, watch as W, nextTick as G, createBlock as K, openBlock as U, mergeProps as g, withCtx as y, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { ApForm as C } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isArray as Z, isUndefined as I, isNumber as m, cloneDeep as M, omit as ee } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { isDef as
|
|
6
|
-
import { useGetEditableColumns as
|
|
5
|
+
import { isDef as w } from "../../utils/index.mjs";
|
|
6
|
+
import { useGetEditableColumns as oe } from "../hooks/use-editable-columns.mjs";
|
|
7
7
|
import "../index.vue2.mjs";
|
|
8
|
-
import { useInjectForm as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
8
|
+
import { useInjectForm as ae } from "../../ap-form/context.mjs";
|
|
9
|
+
import { useNamespace as te } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
import ne from "../index.vue.mjs";
|
|
12
|
+
const ye = /* @__PURE__ */ P({
|
|
13
13
|
name: "EditableGrid",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
@@ -154,105 +154,109 @@ const he = /* @__PURE__ */ O({
|
|
|
154
154
|
setup(x, {
|
|
155
155
|
expose: b
|
|
156
156
|
}) {
|
|
157
|
-
const R =
|
|
157
|
+
const R = A(), l = x, {
|
|
158
158
|
b: B
|
|
159
|
-
} =
|
|
159
|
+
} = te("editable-grid");
|
|
160
160
|
function S(e, o) {
|
|
161
|
-
return
|
|
161
|
+
return Z(o) ? o.reduce((n, t) => n == null ? void 0 : n[t], e) : e == null ? void 0 : e[o];
|
|
162
162
|
}
|
|
163
163
|
const {
|
|
164
164
|
internalInstance: a,
|
|
165
165
|
model: F
|
|
166
|
-
} =
|
|
166
|
+
} = ae(), p = H(l.name), d = h(S(f(F), p.value) || []), N = C.useWatch(p);
|
|
167
167
|
W(() => N.value, async (e) => {
|
|
168
168
|
var o;
|
|
169
|
-
await G(),
|
|
169
|
+
await G(), d.value = e, (o = l.onChange) == null || o.call(l, e);
|
|
170
170
|
}, {
|
|
171
171
|
deep: !0
|
|
172
172
|
});
|
|
173
|
-
const
|
|
173
|
+
const c = h(), v = le("valueTypeMap"), D = oe(l, v);
|
|
174
174
|
function L(e, o) {
|
|
175
175
|
var s;
|
|
176
|
-
const n = ((s =
|
|
177
|
-
if (
|
|
176
|
+
const n = ((s = f(d)) == null ? void 0 : s.length) || 0;
|
|
177
|
+
if (w(l.maxLength) && n >= l.maxLength)
|
|
178
178
|
return;
|
|
179
|
-
const
|
|
180
|
-
m(o) ? l.splice(o, 0, {
|
|
179
|
+
const t = {
|
|
181
180
|
...e || {}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
};
|
|
182
|
+
a == null || a.setFieldValue(l.name, t, !0, (u, r) => {
|
|
183
|
+
console.log("run add", u[r]), u[r] || (u[r] = [t]), I(o) ? u[r].push(t) : u[r].splice(o, 0, t);
|
|
184
|
+
});
|
|
185
185
|
}
|
|
186
186
|
function V(e, o = "suffix") {
|
|
187
|
-
var
|
|
188
|
-
const n = ((
|
|
189
|
-
if (
|
|
187
|
+
var u;
|
|
188
|
+
const n = ((u = f(d)) == null ? void 0 : u.length) || 0, t = m(e) ? e : e.length;
|
|
189
|
+
if (w(l.maxLength) && n + t > l.maxLength)
|
|
190
190
|
return;
|
|
191
|
-
const s =
|
|
192
|
-
|
|
191
|
+
const s = m(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
|
|
192
|
+
a == null || a.setFieldValue(l.name, s, !0, (r, i) => {
|
|
193
|
+
r[i] || (r[i] = [...s]), o === "suffix" ? r[i].push(...s) : r[i].unshift(...s);
|
|
194
|
+
});
|
|
193
195
|
}
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
function T(e) {
|
|
197
|
+
const o = new Set(m(e) ? [e] : e);
|
|
198
|
+
a == null || a.setFieldValue(l.name, void 0, !0, (n, t) => {
|
|
199
|
+
n[t] = n[t].filter((s, u) => !o.has(u));
|
|
200
|
+
});
|
|
198
201
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
202
|
+
function _() {
|
|
203
|
+
return f(d);
|
|
201
204
|
}
|
|
202
|
-
function
|
|
205
|
+
function E(e) {
|
|
203
206
|
var o;
|
|
204
|
-
return (o =
|
|
207
|
+
return (o = f(d)) == null ? void 0 : o[e];
|
|
205
208
|
}
|
|
206
209
|
function k(e, o, n = !0) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
a == null || a.setFieldValue(l.name, null, !0, (t, s) => {
|
|
211
|
+
!t[s] || !t[s][e] || (t[s][e] = {
|
|
212
|
+
...n ? t[s][e] : {},
|
|
213
|
+
...o
|
|
214
|
+
});
|
|
215
|
+
});
|
|
212
216
|
}
|
|
213
217
|
function j(e) {
|
|
214
|
-
a == null || a.setFieldValue(
|
|
218
|
+
a == null || a.setFieldValue(l.name, e);
|
|
215
219
|
}
|
|
216
220
|
function z(e) {
|
|
217
221
|
var n;
|
|
218
|
-
const o = e === "end" ?
|
|
219
|
-
(n =
|
|
222
|
+
const o = e === "end" ? d.value.length - 1 : e;
|
|
223
|
+
(n = c.value) == null || n.scrollToRow(o);
|
|
220
224
|
}
|
|
221
|
-
function
|
|
225
|
+
function O() {
|
|
222
226
|
var e;
|
|
223
|
-
(e = a == null ? void 0 : a.setFieldValue) == null || e.call(a,
|
|
227
|
+
(e = a == null ? void 0 : a.setFieldValue) == null || e.call(a, l.name, []);
|
|
224
228
|
}
|
|
225
229
|
return b({
|
|
226
230
|
add: L,
|
|
227
|
-
remove:
|
|
228
|
-
getRowData:
|
|
229
|
-
getRowsData:
|
|
231
|
+
remove: T,
|
|
232
|
+
getRowData: E,
|
|
233
|
+
getRowsData: _,
|
|
230
234
|
setRowData: k,
|
|
231
235
|
addMultiple: V,
|
|
232
236
|
scrollTo: z,
|
|
233
237
|
setTableData: j,
|
|
234
|
-
clear:
|
|
235
|
-
}), (e, o) => (
|
|
238
|
+
clear: O
|
|
239
|
+
}), (e, o) => (U(), K(f(C).FormItem, g(e.formItem, {
|
|
236
240
|
name: e.name,
|
|
237
241
|
label: e.label
|
|
238
242
|
}), {
|
|
239
|
-
default:
|
|
243
|
+
default: y(() => [$(ne, g(f(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
240
244
|
ref_key: "tableRef",
|
|
241
|
-
ref:
|
|
242
|
-
class:
|
|
243
|
-
columns:
|
|
244
|
-
"data-source":
|
|
245
|
+
ref: c,
|
|
246
|
+
class: f(B)(),
|
|
247
|
+
columns: f(D),
|
|
248
|
+
"data-source": d.value,
|
|
245
249
|
"search-form": !1
|
|
246
|
-
}),
|
|
250
|
+
}), q({
|
|
247
251
|
_: 2
|
|
248
|
-
}, [
|
|
249
|
-
name:
|
|
250
|
-
fn:
|
|
252
|
+
}, [J(R, (n, t) => ({
|
|
253
|
+
name: t,
|
|
254
|
+
fn: y((s) => [Q(e.$slots, t, X(Y(s || {})))])
|
|
251
255
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
252
256
|
_: 3
|
|
253
257
|
}, 16, ["name", "label"]));
|
|
254
258
|
}
|
|
255
259
|
});
|
|
256
260
|
export {
|
|
257
|
-
|
|
261
|
+
ye as default
|
|
258
262
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApForm as
|
|
3
|
-
import { isEqual as ae, isArray as
|
|
1
|
+
import { defineComponent as U, useSlots as $, ref as w, watch as x, unref as u, createBlock as q, openBlock as J, withCtx as h, createVNode as v, mergeProps as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as M, guardReactiveProps as ee } from "vue";
|
|
2
|
+
import { ApForm as g } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isEqual as ae, isArray as R, isUndefined as te, isNumber as y, cloneDeep as le, omit as oe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isDef as
|
|
7
|
-
import { useGetEditableColumns as
|
|
6
|
+
import { isDef as b } from "../../utils/index.mjs";
|
|
7
|
+
import { useGetEditableColumns as ne } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
9
|
+
import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import ie from "../index.vue.mjs";
|
|
13
|
+
const Re = /* @__PURE__ */ U({
|
|
14
14
|
name: "EditableGrid",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
@@ -155,128 +155,133 @@ const we = /* @__PURE__ */ M({
|
|
|
155
155
|
expose: F,
|
|
156
156
|
emit: S
|
|
157
157
|
}) {
|
|
158
|
-
const N =
|
|
158
|
+
const N = $(), t = B, {
|
|
159
159
|
b: V
|
|
160
|
-
} =
|
|
161
|
-
value:
|
|
160
|
+
} = se("editable-grid"), _ = S, C = w(), {
|
|
161
|
+
value: m,
|
|
162
162
|
updateValue: L
|
|
163
|
-
} =
|
|
164
|
-
|
|
163
|
+
} = re(t, _), i = w(), E = ue("valueTypeMap"), c = g.useWatch(t.name, i);
|
|
164
|
+
x(() => c.value, (e) => {
|
|
165
165
|
var a;
|
|
166
166
|
L(e), (a = t.onChange) == null || a.call(t, e);
|
|
167
167
|
}, {
|
|
168
|
-
deep: !0
|
|
169
|
-
|
|
168
|
+
deep: !0,
|
|
169
|
+
flush: "post"
|
|
170
|
+
}), x(m, (e) => {
|
|
170
171
|
var a;
|
|
171
|
-
e !==
|
|
172
|
+
e !== u(c) && (ae(e, u(c)) || (a = i.value) == null || a.setFieldValue(t.name, e));
|
|
172
173
|
}, {
|
|
173
174
|
deep: !0
|
|
174
175
|
});
|
|
175
|
-
const
|
|
176
|
-
function
|
|
176
|
+
const D = ne(t, E);
|
|
177
|
+
function T() {
|
|
177
178
|
var e;
|
|
178
|
-
(e =
|
|
179
|
+
(e = i.value) == null || e.resetFields();
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
return e ? (
|
|
181
|
+
function k(e) {
|
|
182
|
+
return e ? (R(e) ? e : [e]).map((l) => R(l) ? [t.name, ...l] : [t.name, l]) : void 0;
|
|
182
183
|
}
|
|
183
|
-
async function
|
|
184
|
-
var
|
|
185
|
-
const
|
|
186
|
-
return
|
|
184
|
+
async function A(e, a) {
|
|
185
|
+
var o;
|
|
186
|
+
const l = await ((o = i.value) == null ? void 0 : o.validateFields(k(e), a));
|
|
187
|
+
return l == null ? void 0 : l[t.name];
|
|
187
188
|
}
|
|
188
189
|
function j(e, a) {
|
|
189
|
-
var
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
190
|
+
var n, s, r;
|
|
191
|
+
const l = ((n = u(m)) == null ? void 0 : n.length) || 0;
|
|
192
|
+
if (b(t.maxLength) && l >= t.maxLength)
|
|
192
193
|
return;
|
|
193
|
-
const
|
|
194
|
-
g(a) ? l.splice(a, 0, {
|
|
194
|
+
const o = {
|
|
195
195
|
...e || {}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
};
|
|
197
|
+
(r = (s = i.value) == null ? void 0 : s.setFieldValue) == null || r.call(s, t.name, o, !0, (d, f) => {
|
|
198
|
+
console.log("run add", d[f]), d[f] || (d[f] = [o]), te(a) ? d[f].push(o) : d[f].splice(a, 0, o);
|
|
199
|
+
});
|
|
199
200
|
}
|
|
200
201
|
function z(e, a = "suffix") {
|
|
201
|
-
var
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
202
|
+
var s, r, d;
|
|
203
|
+
const l = ((s = u(m)) == null ? void 0 : s.length) || 0, o = y(e) ? e : e.length;
|
|
204
|
+
if (b(t.maxLength) && l + o > t.maxLength)
|
|
204
205
|
return;
|
|
205
|
-
const
|
|
206
|
-
|
|
206
|
+
const n = y(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
|
|
207
|
+
(d = (r = i.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, t.name, n, !0, (f, p) => {
|
|
208
|
+
f[p] || (f[p] = [...n]), a === "suffix" ? f[p].push(...n) : f[p].unshift(...n);
|
|
209
|
+
});
|
|
207
210
|
}
|
|
208
|
-
function
|
|
209
|
-
var l,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
function I(e) {
|
|
212
|
+
var l, o;
|
|
213
|
+
const a = new Set(y(e) ? [e] : e);
|
|
214
|
+
(o = (l = i.value) == null ? void 0 : l.setFieldValue) == null || o.call(l, t.name, void 0, !0, (n, s) => {
|
|
215
|
+
n[s] = n[s].filter((r, d) => !a.has(d));
|
|
216
|
+
});
|
|
213
217
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
218
|
+
function O() {
|
|
219
|
+
return u(m);
|
|
216
220
|
}
|
|
217
|
-
function
|
|
221
|
+
function P(e) {
|
|
218
222
|
var a;
|
|
219
|
-
(a =
|
|
223
|
+
(a = i.value) == null || a.setFieldValue(t.name, e);
|
|
220
224
|
}
|
|
221
|
-
function
|
|
225
|
+
function H(e) {
|
|
222
226
|
var a;
|
|
223
|
-
return (a =
|
|
227
|
+
return (a = u(m)) == null ? void 0 : a[e];
|
|
224
228
|
}
|
|
225
|
-
function W(e, a,
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
function W(e, a, l = !0) {
|
|
230
|
+
var o, n;
|
|
231
|
+
(n = (o = i.value) == null ? void 0 : o.setFieldValue) == null || n.call(o, t.name, null, !0, (s, r) => {
|
|
232
|
+
!s[r] || !s[r][e] || (s[r][e] = {
|
|
233
|
+
...l ? s[r][e] : {},
|
|
234
|
+
...a
|
|
235
|
+
});
|
|
236
|
+
});
|
|
232
237
|
}
|
|
233
238
|
function G(e) {
|
|
234
|
-
var
|
|
235
|
-
const a = e === "end" ?
|
|
236
|
-
(
|
|
239
|
+
var l;
|
|
240
|
+
const a = e === "end" ? m.value.length - 1 : e;
|
|
241
|
+
(l = C.value) == null || l.scrollToRow(a);
|
|
237
242
|
}
|
|
238
243
|
function K() {
|
|
239
244
|
var e, a;
|
|
240
|
-
(a = (e =
|
|
245
|
+
(a = (e = i.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, t.name, []);
|
|
241
246
|
}
|
|
242
247
|
return F({
|
|
243
|
-
resetFields:
|
|
244
|
-
validateFields:
|
|
248
|
+
resetFields: T,
|
|
249
|
+
validateFields: A,
|
|
245
250
|
add: j,
|
|
246
|
-
remove:
|
|
247
|
-
getRowData:
|
|
248
|
-
getRowsData:
|
|
251
|
+
remove: I,
|
|
252
|
+
getRowData: H,
|
|
253
|
+
getRowsData: O,
|
|
249
254
|
setRowData: W,
|
|
250
255
|
addMultiple: z,
|
|
251
256
|
scrollTo: G,
|
|
252
257
|
clear: K,
|
|
253
|
-
setTableData:
|
|
254
|
-
}), (e, a) => (
|
|
258
|
+
setTableData: P
|
|
259
|
+
}), (e, a) => (J(), q(u(g), {
|
|
255
260
|
ref_key: "formRef",
|
|
256
|
-
ref:
|
|
261
|
+
ref: i,
|
|
257
262
|
"initial-values": {
|
|
258
|
-
[t.name]:
|
|
263
|
+
[t.name]: u(m)
|
|
259
264
|
},
|
|
260
265
|
style: {
|
|
261
266
|
height: "100%"
|
|
262
267
|
}
|
|
263
268
|
}, {
|
|
264
|
-
default:
|
|
269
|
+
default: h(() => [v(u(g).FormItem, {
|
|
265
270
|
name: e.name,
|
|
266
271
|
"no-style": ""
|
|
267
272
|
}, {
|
|
268
|
-
default:
|
|
273
|
+
default: h(() => [v(ie, Q(u(oe)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
269
274
|
ref_key: "tableRef",
|
|
270
275
|
ref: C,
|
|
271
|
-
class:
|
|
272
|
-
columns:
|
|
273
|
-
"data-source":
|
|
276
|
+
class: u(V)(),
|
|
277
|
+
columns: u(D),
|
|
278
|
+
"data-source": u(m),
|
|
274
279
|
"search-form": !1
|
|
275
|
-
}),
|
|
280
|
+
}), X({
|
|
276
281
|
_: 2
|
|
277
|
-
}, [
|
|
278
|
-
name:
|
|
279
|
-
fn:
|
|
282
|
+
}, [Y(N, (l, o) => ({
|
|
283
|
+
name: o,
|
|
284
|
+
fn: h((n) => [Z(e.$slots, o, M(ee(n || {})))])
|
|
280
285
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
281
286
|
_: 3
|
|
282
287
|
}, 8, ["name"])]),
|
|
@@ -285,5 +290,5 @@ const we = /* @__PURE__ */ M({
|
|
|
285
290
|
}
|
|
286
291
|
});
|
|
287
292
|
export {
|
|
288
|
-
|
|
293
|
+
Re as default
|
|
289
294
|
};
|
|
@@ -6,7 +6,7 @@ import { DataIndex } from '@aplus-frontend/antdv/es/vc-table/interface';
|
|
|
6
6
|
import { EditableTableExpose } from '../../editable-table';
|
|
7
7
|
import { NamePath } from '@aplus-frontend/antdv/es/form/interface';
|
|
8
8
|
import { ApFormItemProps } from '../../ap-form';
|
|
9
|
-
export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'children' | 'customRender' | 'hideInSearch' | '
|
|
9
|
+
export type EditableGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ApGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'children' | 'customRender' | 'hideInSearch' | 'tooltip' | 'customRenderFormItem' | 'fieldProps'> & {
|
|
10
10
|
children?: EditableGridColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
|
|
11
11
|
/**
|
|
12
12
|
* 在title之后展示一个icon并触发tooltip
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as T, createElementBlock as F, openBlock as s, normalizeStyle as z, normalizeClass as f, createCommentVNode as C, createElementVNode as B, createVNode as U, mergeProps as g, createSlots as G, withCtx as v, Fragment as X, renderList as A, createBlock as
|
|
1
|
+
import { defineComponent as Fe, useSlots as Be, getCurrentInstance as Ie, ref as k, computed as n, unref as o, watch as T, createElementBlock as F, openBlock as s, normalizeStyle as z, normalizeClass as f, createCommentVNode as C, createElementVNode as B, createVNode as U, mergeProps as g, createSlots as G, withCtx as v, Fragment as X, renderList as A, createBlock as c, resolveDynamicComponent as _, renderSlot as V, normalizeProps as J, guardReactiveProps as Pe } from "vue";
|
|
2
2
|
import { VxeTable as Ee, VxeColumn as Q } from "vxe-table";
|
|
3
3
|
import "vxe-table/es/style.css";
|
|
4
4
|
import "vxe-pc-ui/es/style.css";
|
|
@@ -126,11 +126,11 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
126
126
|
var e, l, t;
|
|
127
127
|
return O++, ((t = (l = (e = a.columns) == null ? void 0 : e.filter(
|
|
128
128
|
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !ze.includes(r.valueType)
|
|
129
|
-
)) == null ? void 0 : l.sort((r,
|
|
129
|
+
)) == null ? void 0 : l.sort((r, u) => {
|
|
130
130
|
let y = Z(r.order);
|
|
131
|
-
return Z(
|
|
131
|
+
return Z(u.order) - y;
|
|
132
132
|
})) == null ? void 0 : t.map((r) => {
|
|
133
|
-
const
|
|
133
|
+
const u = Ae(
|
|
134
134
|
r,
|
|
135
135
|
_e(r.fieldProps, {})
|
|
136
136
|
), y = {
|
|
@@ -138,7 +138,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
138
138
|
fieldProps: {
|
|
139
139
|
label: r.title,
|
|
140
140
|
name: r.dataIndex,
|
|
141
|
-
...
|
|
141
|
+
...u || {},
|
|
142
142
|
_signal: O
|
|
143
143
|
},
|
|
144
144
|
renderNode: void 0
|
|
@@ -148,7 +148,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
148
148
|
o(le)
|
|
149
149
|
), y;
|
|
150
150
|
})) || [];
|
|
151
|
-
}),
|
|
151
|
+
}), ue = n(() => [
|
|
152
152
|
d(),
|
|
153
153
|
a.card ? null : d("wrapper"),
|
|
154
154
|
a.adaptive ? d("adaptive") : null,
|
|
@@ -163,7 +163,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
163
163
|
formRef: P,
|
|
164
164
|
submit: j,
|
|
165
165
|
reset: W,
|
|
166
|
-
refresh:
|
|
166
|
+
refresh: ce,
|
|
167
167
|
data: h,
|
|
168
168
|
tableProps: M,
|
|
169
169
|
setDataSource: pe,
|
|
@@ -239,9 +239,9 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
239
239
|
(r = (t = (l = P.value) == null ? void 0 : l.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
|
|
240
240
|
}
|
|
241
241
|
function Re(e = !1) {
|
|
242
|
-
var t, r,
|
|
242
|
+
var t, r, u;
|
|
243
243
|
const l = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
244
|
-
return (
|
|
244
|
+
return (u = (r = (t = P.value) == null ? void 0 : t.apForm) == null ? void 0 : r[l]) == null ? void 0 : u.call(r, !0);
|
|
245
245
|
}
|
|
246
246
|
function N() {
|
|
247
247
|
be.clearAll();
|
|
@@ -269,7 +269,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
269
269
|
(e) => {
|
|
270
270
|
pe(e);
|
|
271
271
|
},
|
|
272
|
-
{ immediate: !0 }
|
|
272
|
+
{ immediate: !0, deep: !0 }
|
|
273
273
|
), T(
|
|
274
274
|
() => o(h).loading,
|
|
275
275
|
(e) => {
|
|
@@ -279,7 +279,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
279
279
|
), re({
|
|
280
280
|
submit: j,
|
|
281
281
|
reset: W,
|
|
282
|
-
refresh:
|
|
282
|
+
refresh: ce,
|
|
283
283
|
setSearchFormValues: xe,
|
|
284
284
|
getSearchFormValues: Re,
|
|
285
285
|
getShowColumns: () => o(i),
|
|
@@ -289,7 +289,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
289
289
|
},
|
|
290
290
|
scrollToRow: ke
|
|
291
291
|
}), (e, l) => (s(), F("div", {
|
|
292
|
-
class: f(
|
|
292
|
+
class: f(ue.value),
|
|
293
293
|
style: z(e.wrapperStyle)
|
|
294
294
|
}, [
|
|
295
295
|
o(b)(e.dataSource) && e.searchForm !== !1 && K.value.length > 0 ? (s(), F("div", {
|
|
@@ -306,7 +306,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
306
306
|
onReset: o(W)
|
|
307
307
|
}), G({
|
|
308
308
|
default: v(() => [
|
|
309
|
-
(s(!0), F(X, null, A(K.value, (t) => (s(),
|
|
309
|
+
(s(!0), F(X, null, A(K.value, (t) => (s(), c(_(t.renderNode.Comp), g({
|
|
310
310
|
key: t.dataIndex,
|
|
311
311
|
item: t,
|
|
312
312
|
ref_for: !0
|
|
@@ -343,7 +343,7 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
343
343
|
B("div", {
|
|
344
344
|
class: f(o(d)("vxe-wrapper"))
|
|
345
345
|
}, [
|
|
346
|
-
(s(),
|
|
346
|
+
(s(), c(o(Ee), g(o(Ke)(a), {
|
|
347
347
|
ref_key: "tableRef",
|
|
348
348
|
ref: p,
|
|
349
349
|
key: o(ie),
|
|
@@ -379,14 +379,14 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
379
379
|
}, null, 8, ["image"])
|
|
380
380
|
]),
|
|
381
381
|
default: v(() => [
|
|
382
|
-
a.expandable ? (s(),
|
|
382
|
+
a.expandable ? (s(), c(o(Q), g({ key: 0 }, o($e)(e.expandable), { fixed: he.value }), {
|
|
383
383
|
content: v((t) => [
|
|
384
|
-
(s(),
|
|
384
|
+
(s(), c(_(a.expandable.renderContent(t))))
|
|
385
385
|
]),
|
|
386
386
|
_: 1
|
|
387
387
|
}, 16, ["fixed"])) : C("", !0),
|
|
388
|
-
a.rowSelection ? (s(),
|
|
389
|
-
(s(!0), F(X, null, A(o(se), (t) => (s(),
|
|
388
|
+
a.rowSelection ? (s(), c(o(Q), J(g({ key: 1 }, o(He)(o(R), i.value))), null, 16)) : C("", !0),
|
|
389
|
+
(s(!0), F(X, null, A(o(se), (t) => (s(), c(_(t), {
|
|
390
390
|
key: t.props.colId
|
|
391
391
|
}))), 128))
|
|
392
392
|
]),
|
|
@@ -394,8 +394,8 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
394
394
|
}, [
|
|
395
395
|
A(o(Ne)(L, ["searchFormExtra"]), (t, r) => ({
|
|
396
396
|
name: r,
|
|
397
|
-
fn: v((
|
|
398
|
-
V(e.$slots, r, J(Pe(
|
|
397
|
+
fn: v((u) => [
|
|
398
|
+
V(e.$slots, r, J(Pe(u || {})))
|
|
399
399
|
])
|
|
400
400
|
}))
|
|
401
401
|
]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "style", "size", "onSortChange", "onFilterChange"]))
|
|
@@ -403,12 +403,12 @@ const ko = /* @__PURE__ */ Fe({
|
|
|
403
403
|
B("div", {
|
|
404
404
|
class: f(o(d)("pagination-wrapper"))
|
|
405
405
|
}, [
|
|
406
|
-
e.sticky ? (s(),
|
|
406
|
+
e.sticky ? (s(), c(o(Ye), {
|
|
407
407
|
key: 0,
|
|
408
408
|
direction: "horizontal",
|
|
409
409
|
"scroll-container": de.value
|
|
410
410
|
}, null, 8, ["scroll-container"])) : C("", !0),
|
|
411
|
-
e.pagination !== !1 ? (s(),
|
|
411
|
+
e.pagination !== !1 ? (s(), c(o(De), g({
|
|
412
412
|
key: 1,
|
|
413
413
|
class: o(d)("pagination")
|
|
414
414
|
}, o(M).pagination, { onChange: o(ve) }), null, 16, ["class", "onChange"])) : C("", !0)
|
|
@@ -234,6 +234,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
234
234
|
export type ApGridVirtualConfig = {
|
|
235
235
|
x?: false | number;
|
|
236
236
|
y?: false | number;
|
|
237
|
+
/**
|
|
238
|
+
* 指定每次渲染更多的数据,值越大渲染耗时就越久
|
|
239
|
+
*/
|
|
240
|
+
oSize?: number;
|
|
237
241
|
};
|
|
238
242
|
export type ApGridColumnProps<RecordType> = {
|
|
239
243
|
column: ApGridColumnType<RecordType>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VxeTableEventProps, VxeTableProps } from 'vxe-table';
|
|
2
2
|
import { ApGridColumnType, ApGridProps, ApGridRowSelection } from '../interface';
|
|
3
3
|
import { RowSelectionType } from '@aplus-frontend/antdv/es/table/interface';
|
|
4
|
-
export declare function toVxeProps<RecordType>(props:
|
|
4
|
+
export declare function toVxeProps<RecordType>(props: ApGridProps): VxeTableProps<RecordType> & VxeTableEventProps<RecordType>;
|
|
5
5
|
export declare function getRowSelectionProps(rowSelection: ApGridRowSelection<any> | true, columns: ApGridColumnType[]): {
|
|
6
6
|
type: RowSelectionType;
|
|
7
7
|
width: string | number;
|