@aplus-frontend/ui 0.1.15 → 0.1.17
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/index.mjs +99 -95
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +26 -24
- package/es/src/ap-modal/index.d.ts +2 -2
- package/es/src/ap-modal/index.mjs +1 -1
- package/es/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
- package/es/src/ap-modal/utils/createModal.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue.mjs +132 -129
- package/es/src/ap-table/interface.d.ts +19 -13
- package/es/src/ap-table/utils.d.ts +8340 -1
- package/es/src/ap-table/utils.mjs +134 -78
- package/es/src/business/ap-batch-action/index.css +2 -0
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.mjs +4 -0
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +110 -0
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.mjs +4 -0
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +50 -0
- package/es/src/business/ap-batch-action-group/interface.d.ts +41 -0
- package/es/src/business/ap-batch-action-group/interface.mjs +1 -0
- package/es/src/business/ap-image/ApImage.vue.d.ts +65 -0
- package/es/src/business/ap-image/ApImage.vue.mjs +4 -0
- package/es/src/business/ap-image/ApImage.vue2.mjs +56 -0
- package/es/src/business/ap-image/hooks/useOss.d.ts +11 -0
- package/es/src/business/ap-image/hooks/useOss.mjs +37 -0
- package/es/src/business/ap-image/imgs/admin-fallback.jpg.mjs +4 -0
- package/es/src/business/ap-image/imgs/aplus-fallback.jpg.mjs +4 -0
- package/es/src/business/index.d.ts +662 -1
- package/es/src/business/index.mjs +25 -16
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +10 -1
- package/es/src/config-provider/config-provider.mjs +18 -17
- package/es/src/config-provider/constants.d.ts +6 -2
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +20 -1
- package/es/src/editable-table/form-item.vue.mjs +85 -71
- package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -2
- package/es/src/editable-table/hooks/use-get-columns.mjs +32 -32
- package/es/src/editable-table/index.vue.mjs +106 -92
- package/es/src/editable-table/interface.d.ts +7 -13
- package/es/src/editable-table/utils.d.ts +14 -2
- package/es/src/editable-table/utils.mjs +67 -57
- package/es/src/index.mjs +211 -207
- package/es/src/locale/lang/en.mjs +10 -7
- package/es/src/locale/lang/zh-cn.mjs +3 -0
- package/es/src/pro-form/hooks/use-label-width.d.ts +1 -1
- package/es/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/es/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/es/src/theme/ap-batch-action/ap-batch-action.css +2 -0
- package/es/src/utils/ap-trans-data/index.d.ts +9 -10
- package/es/src/utils/ap-trans-data/index.mjs +20 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-modal/index.d.ts +2 -2
- package/lib/src/ap-modal/index.js +1 -1
- package/lib/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
- package/lib/src/ap-modal/utils/createModal.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/interface.d.ts +19 -13
- package/lib/src/ap-table/utils.d.ts +8340 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-batch-action/index.css +2 -0
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.js +1 -0
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -0
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.js +1 -0
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -0
- package/lib/src/business/ap-batch-action-group/interface.d.ts +41 -0
- package/lib/src/business/ap-batch-action-group/interface.js +1 -0
- package/lib/src/business/ap-image/ApImage.vue.d.ts +65 -0
- package/lib/src/business/ap-image/ApImage.vue.js +1 -0
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -0
- package/lib/src/business/ap-image/hooks/useOss.d.ts +11 -0
- package/lib/src/business/ap-image/hooks/useOss.js +1 -0
- package/lib/src/business/ap-image/imgs/admin-fallback.jpg.js +1 -0
- package/lib/src/business/ap-image/imgs/aplus-fallback.jpg.js +1 -0
- package/lib/src/business/index.d.ts +662 -1
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +10 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +6 -2
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +20 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -2
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +7 -13
- package/lib/src/editable-table/utils.d.ts +14 -2
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/pro-form/hooks/use-label-width.d.ts +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -5
- package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -38
- package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
- package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
- package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -14
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -67
- package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
- package/lib/src/theme/ap-batch-action/ap-batch-action.css +2 -0
- package/lib/src/utils/ap-trans-data/index.d.ts +9 -10
- package/lib/src/utils/ap-trans-data/index.js +1 -0
- package/package.json +2 -2
- /package/es/src/ap-modal/{type.mjs → interface.mjs} +0 -0
- /package/lib/src/ap-modal/{type.js → interface.js} +0 -0
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
1
|
+
import { defineComponent as ce, useSlots as pe, computed as d, unref as l, createVNode as u, Fragment as D, watch as fe, openBlock as c, createElementBlock as y, normalizeClass as x, normalizeStyle as F, mergeProps as S, createSlots as j, withCtx as p, renderList as W, createBlock as me, resolveDynamicComponent as ge, renderSlot as v, createCommentVNode as _, createElementVNode as A, toDisplayString as ye, normalizeProps as Se, guardReactiveProps as be } from "vue";
|
|
2
|
+
import { Typography as he, Table as we, Tooltip as Ce } from "ant-design-vue";
|
|
3
3
|
import { useToken as Re } from "ant-design-vue/es/theme/internal";
|
|
4
|
-
import { ApForm as
|
|
5
|
-
import {
|
|
4
|
+
import { ApForm as Te } from "../ap-form/index.mjs";
|
|
5
|
+
import { noRenderAsFormItemValueList as q } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
7
|
import { useTablePaging as xe } from "./hooks/use-table-paging.mjs";
|
|
8
|
-
import { omit as
|
|
8
|
+
import { omit as H, isUndefined as i, isBoolean as Fe } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
10
|
import { QuestionCircleOutlined as ve } from "@ant-design/icons-vue";
|
|
11
|
-
import { apColumnToColumn as
|
|
11
|
+
import { apColumnToColumn as Be, getTableRenderType as Pe, getTableRenderProps as ke, getTableCellRenderNode as Ie, getColumnOrder as $, updateFormProps as Ne, getFieldProps as Le, getPlaceholder as Ee, getSearchFormItemRenderNode as Oe, objectToString as Ve } from "./utils.mjs";
|
|
12
12
|
import Ke from "./hooks/use-table-content-height.mjs";
|
|
13
|
-
import { getRawDisplayValue as
|
|
14
|
-
import
|
|
15
|
-
import { useLocale as
|
|
16
|
-
import { useNamespace as
|
|
17
|
-
|
|
13
|
+
import { getRawDisplayValue as ze } from "../editable-table/utils.mjs";
|
|
14
|
+
import De from "./hooks/use-table-row-selection.mjs";
|
|
15
|
+
import { useLocale as je } from "../config-provider/hooks/use-locale.mjs";
|
|
16
|
+
import { useNamespace as We } from "../config-provider/hooks/use-namespace.mjs";
|
|
17
|
+
import { useGlobalConfig as _e } from "../config-provider/hooks/use-global-config.mjs";
|
|
18
|
+
const Ae = {
|
|
18
19
|
key: 0
|
|
19
|
-
},
|
|
20
|
+
}, na = /* @__PURE__ */ ce({
|
|
20
21
|
name: "ApTable",
|
|
21
22
|
__name: "ap-table",
|
|
22
23
|
props: {
|
|
@@ -132,192 +133,194 @@ const je = {
|
|
|
132
133
|
default: !1
|
|
133
134
|
}
|
|
134
135
|
},
|
|
135
|
-
setup(
|
|
136
|
+
setup(G, {
|
|
136
137
|
expose: M
|
|
137
138
|
}) {
|
|
138
|
-
const o =
|
|
139
|
-
let
|
|
140
|
-
const P =
|
|
139
|
+
const o = G;
|
|
140
|
+
let B = 0;
|
|
141
|
+
const P = pe(), [, Q] = Re(), {
|
|
141
142
|
t: U
|
|
142
|
-
} =
|
|
143
|
+
} = je(), {
|
|
143
144
|
e: b,
|
|
144
145
|
b: f
|
|
145
|
-
} =
|
|
146
|
-
height:
|
|
147
|
-
contentRef:
|
|
148
|
-
} = Ke(), h =
|
|
149
|
-
var
|
|
150
|
-
let e = ((
|
|
146
|
+
} = We("ap-table"), k = _e("valueTypeMap"), {
|
|
147
|
+
height: J,
|
|
148
|
+
contentRef: X
|
|
149
|
+
} = Ke(), h = d(() => {
|
|
150
|
+
var r;
|
|
151
|
+
let e = ((r = o.columns) == null ? void 0 : r.filter((a) => !a.hideInTable)) || [];
|
|
151
152
|
return e = e.map((a) => ({
|
|
152
|
-
...
|
|
153
|
+
...H(Be(a), ["ellipsis"]),
|
|
153
154
|
customRender({
|
|
154
|
-
value:
|
|
155
|
+
value: t,
|
|
155
156
|
...n
|
|
156
157
|
}) {
|
|
157
|
-
var
|
|
158
|
-
const
|
|
158
|
+
var K, z;
|
|
159
|
+
const s = Pe(a), O = ke({
|
|
159
160
|
...a,
|
|
160
|
-
valueType:
|
|
161
|
+
valueType: s
|
|
161
162
|
}, {
|
|
162
|
-
value:
|
|
163
|
+
value: t,
|
|
163
164
|
...n
|
|
164
|
-
}),
|
|
165
|
-
value:
|
|
165
|
+
}), ue = Ie(s, O, n.record, l(k)), V = ((K = a.renderText) == null ? void 0 : K.call(a, {
|
|
166
|
+
value: t,
|
|
166
167
|
...n
|
|
167
|
-
})) ||
|
|
168
|
-
value:
|
|
168
|
+
})) || t, ie = a.renderText ? u(D, null, [(z = a.renderText) == null ? void 0 : z.call(a, {
|
|
169
|
+
value: t,
|
|
169
170
|
...n
|
|
170
|
-
})]) :
|
|
171
|
-
|
|
172
|
-
}), null);
|
|
173
|
-
let T = le(a, K, ue);
|
|
171
|
+
})]) : ue;
|
|
172
|
+
let T = ne(a, V, ie);
|
|
174
173
|
return a.customRender && (T = a.customRender({
|
|
175
|
-
value:
|
|
174
|
+
value: t,
|
|
176
175
|
...n,
|
|
177
176
|
column: a,
|
|
178
177
|
originalNode: T,
|
|
179
|
-
originalText:
|
|
178
|
+
originalText: V
|
|
180
179
|
})), T;
|
|
181
180
|
}
|
|
182
181
|
})), e;
|
|
183
|
-
}), I =
|
|
184
|
-
var e,
|
|
185
|
-
return
|
|
186
|
-
let
|
|
187
|
-
return
|
|
188
|
-
})) == null ? void 0 : a.map((
|
|
189
|
-
const n =
|
|
190
|
-
|
|
191
|
-
...r,
|
|
182
|
+
}), I = d(() => {
|
|
183
|
+
var e, r, a;
|
|
184
|
+
return B++, ((a = (r = (e = o.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !q.includes(t.valueType))) == null ? void 0 : r.sort((t, n) => {
|
|
185
|
+
let s = $(t.order);
|
|
186
|
+
return $(n.order) - s;
|
|
187
|
+
})) == null ? void 0 : a.map((t) => {
|
|
188
|
+
const n = Ne(t, Le(t.fieldProps, {})), s = {
|
|
189
|
+
...t,
|
|
192
190
|
fieldProps: {
|
|
193
|
-
label:
|
|
194
|
-
name:
|
|
191
|
+
label: t.title,
|
|
192
|
+
name: t.dataIndex,
|
|
195
193
|
...n || {},
|
|
196
194
|
// 格式化placeholder
|
|
197
|
-
placeholder:
|
|
198
|
-
_signal:
|
|
199
|
-
}
|
|
195
|
+
placeholder: Ee(U, t.valueType, n == null ? void 0 : n.placeholder),
|
|
196
|
+
_signal: B
|
|
197
|
+
},
|
|
198
|
+
renderNode: void 0
|
|
200
199
|
};
|
|
200
|
+
return s.renderNode = Oe(s, l(k)), s;
|
|
201
201
|
})) || [];
|
|
202
|
-
}),
|
|
202
|
+
}), Y = d(() => l(h).filter((e) => e.sorter === !0).map((e) => e.dataIndex).filter(Boolean)), Z = d(() => l(h).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex).filter(Boolean)), ee = d(() => i(o.dataSource) ? g.value.records : o.dataSource), {
|
|
203
203
|
rowSelection: w,
|
|
204
|
-
selectedRows:
|
|
205
|
-
...
|
|
206
|
-
} =
|
|
204
|
+
selectedRows: N,
|
|
205
|
+
...C
|
|
206
|
+
} = De({
|
|
207
207
|
...o.rowSelection === !0 ? {} : o.rowSelection,
|
|
208
208
|
rowKey: o.rowKey,
|
|
209
|
-
dataSource:
|
|
209
|
+
dataSource: ee
|
|
210
210
|
}), {
|
|
211
|
-
formRef:
|
|
211
|
+
formRef: R,
|
|
212
212
|
submit: L,
|
|
213
213
|
reset: E,
|
|
214
214
|
tableProps: m,
|
|
215
|
-
handleTableChange:
|
|
216
|
-
data:
|
|
215
|
+
handleTableChange: ae,
|
|
216
|
+
data: g
|
|
217
217
|
} = xe({
|
|
218
218
|
async request(e) {
|
|
219
|
-
var a,
|
|
220
|
-
!w.value.preserveSelectedRowKeys &&
|
|
221
|
-
const
|
|
222
|
-
return (
|
|
223
|
-
data: (
|
|
224
|
-
total: (
|
|
219
|
+
var a, t;
|
|
220
|
+
!w.value.preserveSelectedRowKeys && i(o.dataSource) && C.clearAll();
|
|
221
|
+
const r = await ((a = o.request) == null ? void 0 : a.call(o, e));
|
|
222
|
+
return (t = o.onLoad) == null || t.call(o, (r == null ? void 0 : r.data) || []), {
|
|
223
|
+
data: (r == null ? void 0 : r.data) || [],
|
|
224
|
+
total: (r == null ? void 0 : r.total) || 0
|
|
225
225
|
};
|
|
226
226
|
},
|
|
227
|
-
filterFields:
|
|
228
|
-
sortFields:
|
|
227
|
+
filterFields: Z,
|
|
228
|
+
sortFields: Y,
|
|
229
229
|
defaultParams: o.params,
|
|
230
230
|
defaultData: o.defaultData,
|
|
231
231
|
manual: o.manual,
|
|
232
232
|
defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
|
|
233
233
|
defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
|
|
234
234
|
formatParams: o.beforeSearchSubmit
|
|
235
|
-
}),
|
|
235
|
+
}), oe = d(() => {
|
|
236
236
|
var e;
|
|
237
|
-
return o.scroll ? o.scroll : o.adaptive && (
|
|
238
|
-
y: l(
|
|
237
|
+
return o.scroll ? o.scroll : o.adaptive && (g.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
|
|
238
|
+
y: l(J),
|
|
239
239
|
x: "100%"
|
|
240
240
|
} : {
|
|
241
241
|
x: !0
|
|
242
242
|
};
|
|
243
|
-
}),
|
|
243
|
+
}), te = d(() => {
|
|
244
244
|
var e;
|
|
245
245
|
if (o.tableLayout)
|
|
246
246
|
return o.tableLayout;
|
|
247
|
-
if ((e = o.columns) != null && e.some((
|
|
247
|
+
if ((e = o.columns) != null && e.some((r) => r.ellipsis))
|
|
248
248
|
return "fixed";
|
|
249
|
-
}),
|
|
250
|
-
var
|
|
251
|
-
const e = l(m),
|
|
249
|
+
}), re = d(() => {
|
|
250
|
+
var t;
|
|
251
|
+
const e = l(m), r = i(o.dataSource) ? e : {
|
|
252
252
|
...e,
|
|
253
253
|
dataSource: o.dataSource,
|
|
254
254
|
onChange: o.onChange
|
|
255
255
|
}, a = l(w);
|
|
256
256
|
return {
|
|
257
257
|
...o,
|
|
258
|
-
...
|
|
259
|
-
rowSelection: o.rowSelection === !0 || ((
|
|
258
|
+
...r,
|
|
259
|
+
rowSelection: o.rowSelection === !0 || ((t = o.rowSelection) == null ? void 0 : t.mode) === "internal" ? {
|
|
260
260
|
...a,
|
|
261
261
|
// tips 如果是前端分页,则默认会走缓存
|
|
262
|
-
preserveSelectedRowKeys:
|
|
262
|
+
preserveSelectedRowKeys: i(o.dataSource) ? a.preserveSelectedRowKeys : !0
|
|
263
263
|
} : o.rowSelection,
|
|
264
|
-
loading:
|
|
264
|
+
loading: i(o.loading) ? l(m).loading : o.loading,
|
|
265
265
|
pagination: o.pagination === !1 ? !1 : l(m).pagination,
|
|
266
|
-
scroll: l(
|
|
266
|
+
scroll: l(oe)
|
|
267
267
|
};
|
|
268
|
-
}),
|
|
269
|
-
function
|
|
270
|
-
|
|
268
|
+
}), le = d(() => [f(), o.card ? null : f("wrapper"), o.adaptive ? f("adaptive") : null].filter(Boolean));
|
|
269
|
+
function ne(e, r, a) {
|
|
270
|
+
if (q.includes(e.valueType))
|
|
271
|
+
return a;
|
|
272
|
+
const t = Ve(r);
|
|
273
|
+
return e.copyable || e.ellipsis ? u(he.Paragraph, {
|
|
271
274
|
copyable: e.copyable ? {
|
|
272
275
|
text: t,
|
|
273
276
|
tooltip: !1
|
|
274
277
|
} : !1,
|
|
275
|
-
ellipsis: e.ellipsis ?
|
|
278
|
+
ellipsis: e.ellipsis ? Fe(e.ellipsis) ? {
|
|
276
279
|
tooltip: t
|
|
277
280
|
} : {
|
|
278
281
|
...e.ellipsis,
|
|
279
282
|
tooltip: t
|
|
280
283
|
} : !1,
|
|
281
|
-
content: e.ellipsis ?
|
|
284
|
+
content: e.ellipsis ? ze(e, r) : a
|
|
282
285
|
}, null) : a;
|
|
283
286
|
}
|
|
284
|
-
|
|
285
|
-
var
|
|
286
|
-
(
|
|
287
|
+
fe(() => l(g).loading, (e) => {
|
|
288
|
+
var r;
|
|
289
|
+
(r = o.onLoadingChange) == null || r.call(o, e);
|
|
287
290
|
});
|
|
288
|
-
function
|
|
289
|
-
var
|
|
290
|
-
(
|
|
291
|
+
function de(e) {
|
|
292
|
+
var r, a, t;
|
|
293
|
+
(t = (a = (r = R.value) == null ? void 0 : r.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
|
|
291
294
|
}
|
|
292
295
|
function se() {
|
|
293
|
-
var e,
|
|
294
|
-
return (a = (
|
|
296
|
+
var e, r, a;
|
|
297
|
+
return (a = (r = (e = R.value) == null ? void 0 : e.apForm) == null ? void 0 : r.getFieldsValue) == null ? void 0 : a.call(r, !0);
|
|
295
298
|
}
|
|
296
299
|
return M({
|
|
297
300
|
submit: () => L(),
|
|
298
301
|
reset: () => E(),
|
|
299
|
-
setSearchFormValues:
|
|
302
|
+
setSearchFormValues: de,
|
|
300
303
|
getSearchFormValues: se,
|
|
301
|
-
dataSource:
|
|
304
|
+
dataSource: d(() => l(g).records),
|
|
302
305
|
rowSelection: {
|
|
303
|
-
selectedRows:
|
|
304
|
-
...
|
|
306
|
+
selectedRows: d(() => l(N)),
|
|
307
|
+
...C
|
|
305
308
|
}
|
|
306
|
-
}), (e,
|
|
307
|
-
class:
|
|
308
|
-
}, [l(
|
|
309
|
+
}), (e, r) => (c(), y("div", {
|
|
310
|
+
class: x(le.value)
|
|
311
|
+
}, [l(i)(e.dataSource) && e.searchForm !== !1 && I.value.length > 0 ? (c(), y("div", {
|
|
309
312
|
key: 0,
|
|
310
|
-
class:
|
|
311
|
-
style:
|
|
312
|
-
}, [
|
|
313
|
+
class: x(e.card ? l(b)("search-wrapper") : null),
|
|
314
|
+
style: F(e.searchFormWrapperStyle)
|
|
315
|
+
}, [u(l(Te).SearchForm, S(e.searchForm || {}, {
|
|
313
316
|
ref_key: "formRef",
|
|
314
|
-
ref:
|
|
317
|
+
ref: R,
|
|
315
318
|
"custom-reset": "",
|
|
316
319
|
onSubmit: l(L),
|
|
317
320
|
onReset: l(E),
|
|
318
321
|
"submit-loading": l(m).loading
|
|
319
|
-
}),
|
|
320
|
-
default: p(() => [(c(!0),
|
|
322
|
+
}), j({
|
|
323
|
+
default: p(() => [(c(!0), y(D, null, W(I.value, (a) => (c(), me(ge(a.renderNode), S({
|
|
321
324
|
key: a.dataIndex,
|
|
322
325
|
ref_for: !0
|
|
323
326
|
}, a.fieldProps || {}, {
|
|
@@ -326,45 +329,45 @@ const je = {
|
|
|
326
329
|
_: 2
|
|
327
330
|
}, [P.searchFormExtra ? {
|
|
328
331
|
name: "extra",
|
|
329
|
-
fn: p(() => [
|
|
332
|
+
fn: p(() => [v(e.$slots, "searchFormExtra")]),
|
|
330
333
|
key: "0"
|
|
331
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
334
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : _("", !0), A("div", {
|
|
332
335
|
ref_key: "contentRef",
|
|
333
|
-
ref:
|
|
334
|
-
class:
|
|
335
|
-
style:
|
|
336
|
-
}, [
|
|
337
|
-
selectedRows: l(
|
|
336
|
+
ref: X,
|
|
337
|
+
class: x([l(b)("table-wrapper"), e.card ? l(b)("table-wrapper-card") : null]),
|
|
338
|
+
style: F(e.tableWrapperStyle)
|
|
339
|
+
}, [v(e.$slots, "title", S({
|
|
340
|
+
selectedRows: l(N),
|
|
338
341
|
selectedRowKeys: l(w).selectedRowKeys
|
|
339
|
-
},
|
|
342
|
+
}, C)), u(l(we), S({
|
|
340
343
|
class: l(f)("table")
|
|
341
|
-
},
|
|
342
|
-
"table-layout":
|
|
343
|
-
onChange: l(
|
|
344
|
+
}, re.value, {
|
|
345
|
+
"table-layout": te.value,
|
|
346
|
+
onChange: l(ae),
|
|
344
347
|
columns: h.value
|
|
345
|
-
}),
|
|
348
|
+
}), j({
|
|
346
349
|
headerCell: p(({
|
|
347
350
|
column: a,
|
|
348
|
-
title:
|
|
349
|
-
}) => [a.tooltip ? (c(),
|
|
351
|
+
title: t
|
|
352
|
+
}) => [a.tooltip ? (c(), y("span", Ae, [A("span", null, ye(t), 1), u(l(Ce), {
|
|
350
353
|
title: a.tooltip,
|
|
351
354
|
placement: "bottom"
|
|
352
355
|
}, {
|
|
353
|
-
default: p(() => [
|
|
354
|
-
style:
|
|
356
|
+
default: p(() => [u(l(ve), {
|
|
357
|
+
style: F({
|
|
355
358
|
paddingLeft: "4px",
|
|
356
359
|
color: l(Q).colorPrimary
|
|
357
360
|
})
|
|
358
361
|
}, null, 8, ["style"])]),
|
|
359
362
|
_: 2
|
|
360
|
-
}, 1032, ["title"])])) :
|
|
363
|
+
}, 1032, ["title"])])) : _("", !0)]),
|
|
361
364
|
_: 2
|
|
362
|
-
}, [
|
|
363
|
-
name:
|
|
364
|
-
fn: p((n) => [
|
|
365
|
+
}, [W(l(H)(P, ["title", "searchFormExtra"]), (a, t) => ({
|
|
366
|
+
name: t,
|
|
367
|
+
fn: p((n) => [v(e.$slots, t, Se(be(n || {})))])
|
|
365
368
|
}))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
|
|
366
369
|
}
|
|
367
370
|
});
|
|
368
371
|
export {
|
|
369
|
-
|
|
372
|
+
na as default
|
|
370
373
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ColumnType, TableProps } from 'ant-design-vue/es/table';
|
|
2
2
|
import { CompareFn, SortOrder, TableRowSelection } from 'ant-design-vue/es/table/interface';
|
|
3
|
-
import { ApFormSearchFormProps } from '../ap-form';
|
|
3
|
+
import { ApFormItemProps, ApFormSearchFormProps } from '../ap-form';
|
|
4
4
|
import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextPasswordProps, ApFormItemTextProps } from '../ap-form/items/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
6
|
import { ComputedRef, CSSProperties, VNode } from 'vue';
|
|
@@ -67,8 +67,21 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' |
|
|
|
67
67
|
export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<RecordType>, 'selectedRowKeys' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectInvert' | 'onSelectNone'> & {
|
|
68
68
|
mode: 'internal';
|
|
69
69
|
};
|
|
70
|
-
export type
|
|
71
|
-
|
|
70
|
+
export type CommonFieldReturnType = ApFormItemProps & {
|
|
71
|
+
field: Recordable;
|
|
72
|
+
placeholder?: string;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType extends ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType> = ReturnType | ((opt: Partial<{
|
|
76
|
+
value: any;
|
|
77
|
+
text: any;
|
|
78
|
+
record: RecordType;
|
|
79
|
+
index: number;
|
|
80
|
+
renderIndex: number;
|
|
81
|
+
column: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>;
|
|
82
|
+
}>) => ReturnType);
|
|
83
|
+
export type ApColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? ExtraProColumnType<RecordType> & {
|
|
84
|
+
children?: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
|
|
72
85
|
/**
|
|
73
86
|
* 表单项所占据的格子数(1-24格)
|
|
74
87
|
*/
|
|
@@ -100,7 +113,7 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
100
113
|
/**
|
|
101
114
|
* 自定义查询表单渲染
|
|
102
115
|
*/
|
|
103
|
-
customRenderFormItem?: (config: ApColumnType<RecordType
|
|
116
|
+
customRenderFormItem?: (config: ApColumnType<RecordType>) => any;
|
|
104
117
|
/**
|
|
105
118
|
* 自定义渲染文本,和customRender相比,其必须返回字符串,并且后续的渲染(例如copy/ellipsis)都将使用这个值
|
|
106
119
|
*/
|
|
@@ -115,18 +128,11 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
|
|
|
115
128
|
/**
|
|
116
129
|
* 指定值类型(将会用于默认渲染和查询表单生成)
|
|
117
130
|
*/
|
|
118
|
-
valueType?:
|
|
131
|
+
valueType?: MergedValueType;
|
|
119
132
|
/**
|
|
120
133
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
121
134
|
*/
|
|
122
|
-
fieldProps?: ApTableValueFields[ValueType]
|
|
123
|
-
value: any;
|
|
124
|
-
text: any;
|
|
125
|
-
record: RecordType;
|
|
126
|
-
index: number;
|
|
127
|
-
renderIndex: number;
|
|
128
|
-
column: ApColumnType<RecordType, ValueType>;
|
|
129
|
-
}>) => ApTableValueFields[ValueType]);
|
|
135
|
+
fieldProps?: FieldPropsType<Extract<MergedValueType, ValueType> extends never ? CommonFieldReturnType : ApTableValueFields[Extract<MergedValueType, ValueType>], RecordType, ExtraValueType, ValueType, MergedValueType>;
|
|
130
136
|
/**
|
|
131
137
|
* 用于表单项排序的字段
|
|
132
138
|
* @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效
|