@aplus-frontend/ui 0.1.26 → 0.1.27
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-download/ap-download.vue.d.ts +7 -3
- package/es/src/ap-download/ap-download.vue.mjs +50 -35
- package/es/src/ap-download/interface.d.ts +3 -11
- package/es/src/ap-download/style/ap-download.css +3 -0
- package/es/src/ap-table/ap-table.vue.mjs +231 -183
- package/es/src/ap-table/components/interface.d.ts +33 -1
- package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
- package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
- package/es/src/ap-table/components/setting/utils.d.ts +17 -0
- package/es/src/ap-table/components/setting/utils.mjs +48 -0
- package/es/src/ap-table/components/style/setting/modal.css +39 -0
- package/es/src/ap-table/components/style/setting/select-group.css +7 -0
- package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/es/src/ap-table/components/style/setting/sorter.css +26 -0
- package/es/src/ap-table/constants.d.ts +31 -8
- package/es/src/ap-table/constants.mjs +41 -53
- package/es/src/ap-table/context.d.ts +31 -0
- package/es/src/ap-table/context.mjs +20 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
- package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
- package/es/src/ap-table/interface.d.ts +51 -1
- package/es/src/ap-table/style/ap-table.css +29 -1
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/ap-table/utils.mjs +82 -82
- package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +45 -42
- package/es/src/business/ap-attachment/style.css +2 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/es/src/business/index.d.ts +1 -1
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/locale/lang/en.mjs +14 -0
- package/es/src/locale/lang/zh-cn.mjs +14 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/es/src/theme/ap-download/ap-download.css +3 -0
- package/es/src/theme/ap-table/ap-table.css +29 -1
- package/es/src/theme/ap-table/setting/modal.css +39 -0
- package/es/src/theme/ap-table/setting/select-group.css +7 -0
- package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/es/src/theme/ap-table/setting/sorter.css +26 -0
- package/es/src/theme/css-var/index.mjs +22 -12
- package/lib/src/ap-download/ap-download.vue.d.ts +7 -3
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +3 -11
- package/lib/src/ap-download/style/ap-download.css +3 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/interface.d.ts +33 -1
- package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
- package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -0
- package/lib/src/ap-table/components/style/setting/modal.css +39 -0
- package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
- package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
- package/lib/src/ap-table/constants.d.ts +31 -8
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/context.d.ts +31 -0
- package/lib/src/ap-table/context.js +1 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
- package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +51 -1
- package/lib/src/ap-table/style/ap-table.css +29 -1
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style.css +2 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +2 -2
- package/lib/src/business/index.d.ts +1 -1
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/lib/src/theme/ap-download/ap-download.css +3 -0
- package/lib/src/theme/ap-table/ap-table.css +29 -1
- package/lib/src/theme/ap-table/setting/modal.css +39 -0
- package/lib/src/theme/ap-table/setting/select-group.css +7 -0
- package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/lib/src/theme/ap-table/setting/sorter.css +26 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +3 -2
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { ApForm as
|
|
5
|
-
import { noRenderAsFormItemValueList as
|
|
1
|
+
import { defineComponent as Re, useSlots as ve, ref as P, computed as s, unref as l, createVNode as p, Fragment as U, watchEffect as Ce, watch as G, openBlock as f, createElementBlock as T, normalizeClass as m, normalizeStyle as M, mergeProps as h, createSlots as J, withCtx as b, renderList as Q, createBlock as X, resolveDynamicComponent as Te, renderSlot as w, createCommentVNode as Y, createElementVNode as I, h as Fe, normalizeProps as Be, guardReactiveProps as xe } from "vue";
|
|
2
|
+
import { Typography as ke, Divider as ze, Button as Pe, Table as Ie } from "ant-design-vue";
|
|
3
|
+
import { useToken as Ne } from "ant-design-vue/es/theme/internal";
|
|
4
|
+
import { ApForm as Le } from "../ap-form/index.mjs";
|
|
5
|
+
import { noRenderAsFormItemValueList as Z } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { useTablePaging as
|
|
8
|
-
import { omit as
|
|
7
|
+
import { useTablePaging as Ee } from "./hooks/use-table-paging.mjs";
|
|
8
|
+
import { omit as _, isUndefined as g, isBoolean as Ke } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
|
-
import { apColumnToColumn as
|
|
11
|
-
import
|
|
12
|
-
import { getRawDisplayValue as
|
|
13
|
-
import
|
|
14
|
-
import { isDef as
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
|
|
10
|
+
import { apColumnToColumn as Oe, getTableTitle as Ve, getTableRenderType as je, getTableRenderProps as Ae, getTableCellRenderNode as We, getColumnOrder as ee, updateFormProps as $e, getFieldProps as De, getPlaceholder as He, getSearchFormItemRenderNode as qe, objectToString as Ue } from "./utils.mjs";
|
|
11
|
+
import Ge from "./hooks/use-table-content-height.mjs";
|
|
12
|
+
import { getRawDisplayValue as Me } from "../editable-table/utils.mjs";
|
|
13
|
+
import Je from "./hooks/use-table-row-selection.mjs";
|
|
14
|
+
import { isDef as Qe } from "../utils/index.mjs";
|
|
15
|
+
import { SettingOutlined as Xe } from "@ant-design/icons-vue";
|
|
16
|
+
import "./components/setting/modal/index.vue.mjs";
|
|
17
|
+
import { useProvideApTable as Ye } from "./context.mjs";
|
|
18
|
+
import { useLocale as Ze } from "../config-provider/hooks/use-locale.mjs";
|
|
19
|
+
import { useNamespace as _e } from "../config-provider/hooks/use-namespace.mjs";
|
|
20
|
+
import { useGlobalConfig as ea } from "../config-provider/hooks/use-global-config.mjs";
|
|
21
|
+
import aa from "./components/setting/modal/index.vue2.mjs";
|
|
22
|
+
const Ca = /* @__PURE__ */ Re({
|
|
19
23
|
name: "ApTable",
|
|
20
24
|
__name: "ap-table",
|
|
21
25
|
props: {
|
|
@@ -133,246 +137,290 @@ const ua = /* @__PURE__ */ pe({
|
|
|
133
137
|
columnResizable: {
|
|
134
138
|
type: Boolean,
|
|
135
139
|
default: !1
|
|
140
|
+
},
|
|
141
|
+
settings: {
|
|
142
|
+
type: [Boolean, Object],
|
|
143
|
+
default: void 0
|
|
136
144
|
}
|
|
137
145
|
},
|
|
138
|
-
setup(
|
|
139
|
-
expose:
|
|
146
|
+
setup(ae, {
|
|
147
|
+
expose: oe
|
|
140
148
|
}) {
|
|
141
|
-
const
|
|
142
|
-
let
|
|
143
|
-
const
|
|
144
|
-
t:
|
|
145
|
-
} =
|
|
146
|
-
e:
|
|
147
|
-
b:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
const a = ae;
|
|
150
|
+
let N = 0;
|
|
151
|
+
const S = ve(), [, te] = Ne(), {
|
|
152
|
+
t: re
|
|
153
|
+
} = Ze(), {
|
|
154
|
+
e: F,
|
|
155
|
+
b: i,
|
|
156
|
+
be: L
|
|
157
|
+
} = _e("ap-table"), E = ea("valueTypeMap"), {
|
|
158
|
+
height: le,
|
|
159
|
+
contentRef: ne
|
|
160
|
+
} = Ge(), B = P(a.size), u = P([]), K = P([]);
|
|
161
|
+
Ye({
|
|
162
|
+
columns: s(() => u.value),
|
|
163
|
+
columnsBackup: s(() => K.value),
|
|
164
|
+
size: s(() => B.value),
|
|
165
|
+
updateColumns(e) {
|
|
166
|
+
u.value = e;
|
|
167
|
+
},
|
|
168
|
+
updateSize(e) {
|
|
169
|
+
B.value = e;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const se = () => {
|
|
152
173
|
var t;
|
|
153
|
-
let
|
|
154
|
-
function o(r) {
|
|
174
|
+
let e = ((t = a.columns) == null ? void 0 : t.filter((r) => !r.hideInTable)) || [];
|
|
175
|
+
function o(r, d) {
|
|
155
176
|
return r.map((n) => ({
|
|
156
|
-
resizable:
|
|
157
|
-
...
|
|
158
|
-
|
|
177
|
+
resizable: Qe(n.resizable) ? n.resizable : a.columnResizable,
|
|
178
|
+
..._(Oe(n), ["ellipsis"]),
|
|
179
|
+
fixed: d ? d.fixed : n.fixed,
|
|
180
|
+
title: Ve(n, L("table-header", "title"), S.headerCell, l(te).colorPrimary),
|
|
159
181
|
customRender({
|
|
160
|
-
value:
|
|
161
|
-
...
|
|
182
|
+
value: c,
|
|
183
|
+
...y
|
|
162
184
|
}) {
|
|
163
|
-
var
|
|
164
|
-
const
|
|
185
|
+
var H, q;
|
|
186
|
+
const $ = je(n), be = Ae({
|
|
165
187
|
...n,
|
|
166
|
-
valueType:
|
|
188
|
+
valueType: $
|
|
167
189
|
}, {
|
|
168
|
-
value:
|
|
169
|
-
...
|
|
170
|
-
}),
|
|
171
|
-
value:
|
|
172
|
-
...
|
|
173
|
-
})) ||
|
|
174
|
-
value:
|
|
175
|
-
...
|
|
176
|
-
})]) :
|
|
177
|
-
let
|
|
178
|
-
return n.customRender && (
|
|
179
|
-
value:
|
|
180
|
-
...
|
|
190
|
+
value: c,
|
|
191
|
+
...y
|
|
192
|
+
}), we = We($, be, y.record, l(E)), D = ((H = n.renderText) == null ? void 0 : H.call(n, {
|
|
193
|
+
value: c,
|
|
194
|
+
...y
|
|
195
|
+
})) || c, Se = n.renderText ? p(U, null, [(q = n.renderText) == null ? void 0 : q.call(n, {
|
|
196
|
+
value: c,
|
|
197
|
+
...y
|
|
198
|
+
})]) : we;
|
|
199
|
+
let z = ge(n, D, Se);
|
|
200
|
+
return n.customRender && (z = n.customRender({
|
|
201
|
+
value: c,
|
|
202
|
+
...y,
|
|
181
203
|
column: n,
|
|
182
|
-
originalNode:
|
|
183
|
-
originalText:
|
|
184
|
-
})),
|
|
204
|
+
originalNode: z,
|
|
205
|
+
originalText: D
|
|
206
|
+
})), z;
|
|
185
207
|
},
|
|
186
|
-
children: o(n.children || [])
|
|
208
|
+
children: o(n.children || [], d || n)
|
|
187
209
|
}));
|
|
188
210
|
}
|
|
189
|
-
return o(
|
|
211
|
+
return o(e);
|
|
190
212
|
};
|
|
191
|
-
|
|
192
|
-
|
|
213
|
+
Ce(() => {
|
|
214
|
+
const e = se();
|
|
215
|
+
u.value = e, K.value = e;
|
|
193
216
|
});
|
|
194
|
-
const
|
|
195
|
-
var
|
|
196
|
-
return
|
|
197
|
-
let
|
|
198
|
-
return
|
|
217
|
+
const O = s(() => {
|
|
218
|
+
var e, o, t;
|
|
219
|
+
return N++, ((t = (o = (e = a.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !Z.includes(r.valueType))) == null ? void 0 : o.sort((r, d) => {
|
|
220
|
+
let n = ee(r.order);
|
|
221
|
+
return ee(d.order) - n;
|
|
199
222
|
})) == null ? void 0 : t.map((r) => {
|
|
200
|
-
const
|
|
223
|
+
const d = $e(r, De(r.fieldProps, {})), n = {
|
|
201
224
|
...r,
|
|
202
225
|
fieldProps: {
|
|
203
226
|
label: r.title,
|
|
204
227
|
name: r.dataIndex,
|
|
205
|
-
...
|
|
228
|
+
...d || {},
|
|
206
229
|
// 格式化placeholder
|
|
207
|
-
placeholder:
|
|
208
|
-
_signal:
|
|
230
|
+
placeholder: He(re, r.valueType, d == null ? void 0 : d.placeholder),
|
|
231
|
+
_signal: N
|
|
209
232
|
},
|
|
210
233
|
renderNode: void 0
|
|
211
234
|
};
|
|
212
|
-
return
|
|
235
|
+
return n.renderNode = qe(n, l(E)), n;
|
|
213
236
|
})) || [];
|
|
214
|
-
}),
|
|
215
|
-
rowSelection:
|
|
216
|
-
selectedRows:
|
|
217
|
-
...
|
|
218
|
-
} =
|
|
219
|
-
...
|
|
220
|
-
rowKey:
|
|
221
|
-
dataSource:
|
|
237
|
+
}), de = s(() => l(u).filter((e) => e.sorter === !0).map((e) => e.dataIndex).filter(Boolean)), ue = s(() => l(u).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex).filter(Boolean)), ie = s(() => g(a.dataSource) ? C.value.records : a.dataSource), {
|
|
238
|
+
rowSelection: R,
|
|
239
|
+
selectedRows: x,
|
|
240
|
+
...v
|
|
241
|
+
} = Je({
|
|
242
|
+
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
243
|
+
rowKey: a.rowKey,
|
|
244
|
+
dataSource: ie
|
|
222
245
|
}), {
|
|
223
|
-
formRef:
|
|
224
|
-
submit:
|
|
225
|
-
reset:
|
|
226
|
-
tableProps:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
} =
|
|
230
|
-
async request(
|
|
246
|
+
formRef: k,
|
|
247
|
+
submit: V,
|
|
248
|
+
reset: j,
|
|
249
|
+
tableProps: A,
|
|
250
|
+
data: C,
|
|
251
|
+
setDataSource: ce
|
|
252
|
+
} = Ee({
|
|
253
|
+
async request(e) {
|
|
231
254
|
var t, r;
|
|
232
|
-
!
|
|
233
|
-
|
|
234
|
-
|
|
255
|
+
if (!R.value.preserveSelectedRowKeys && g(a.dataSource) && v.clearAll(), !g(a.dataSource))
|
|
256
|
+
return {
|
|
257
|
+
data: a.dataSource || [],
|
|
258
|
+
total: a.dataSource.length || 0
|
|
259
|
+
};
|
|
260
|
+
const o = await ((t = a.request) == null ? void 0 : t.call(a, e));
|
|
261
|
+
return (r = a.onLoad) == null || r.call(a, (o == null ? void 0 : o.data) || []), {
|
|
235
262
|
data: (o == null ? void 0 : o.data) || [],
|
|
236
263
|
total: (o == null ? void 0 : o.total) || 0
|
|
237
264
|
};
|
|
238
265
|
},
|
|
239
|
-
filterFields:
|
|
240
|
-
sortFields:
|
|
241
|
-
defaultParams:
|
|
242
|
-
defaultData:
|
|
243
|
-
manual:
|
|
244
|
-
defaultCurrent:
|
|
245
|
-
defaultPageSize:
|
|
246
|
-
formatParams:
|
|
247
|
-
showLessItems:
|
|
248
|
-
showTotal:
|
|
249
|
-
}),
|
|
266
|
+
filterFields: ue,
|
|
267
|
+
sortFields: de,
|
|
268
|
+
defaultParams: a.params,
|
|
269
|
+
defaultData: a.defaultData,
|
|
270
|
+
manual: a.manual,
|
|
271
|
+
defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
|
|
272
|
+
defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
|
|
273
|
+
formatParams: a.beforeSearchSubmit,
|
|
274
|
+
showLessItems: a.pagination ? a.pagination.showLessItems : void 0,
|
|
275
|
+
showTotal: a.pagination ? a.pagination.showTotal : void 0
|
|
276
|
+
}), pe = s(() => {
|
|
250
277
|
var o, t;
|
|
251
|
-
if (
|
|
278
|
+
if (a.adaptive && (C.value.total > 0 || ((o = a.dataSource) == null ? void 0 : o.length)))
|
|
252
279
|
return {
|
|
253
|
-
y: l(
|
|
254
|
-
x: ((t =
|
|
280
|
+
y: l(le),
|
|
281
|
+
x: ((t = a.scroll) == null ? void 0 : t.x) || "100%"
|
|
255
282
|
};
|
|
256
|
-
if (
|
|
257
|
-
return
|
|
258
|
-
}),
|
|
259
|
-
var
|
|
260
|
-
if (
|
|
261
|
-
return
|
|
262
|
-
if ((
|
|
283
|
+
if (a.scroll)
|
|
284
|
+
return a.scroll;
|
|
285
|
+
}), fe = s(() => {
|
|
286
|
+
var e;
|
|
287
|
+
if (a.tableLayout)
|
|
288
|
+
return a.tableLayout;
|
|
289
|
+
if ((e = a.columns) != null && e.some((o) => o.ellipsis))
|
|
263
290
|
return "fixed";
|
|
264
|
-
}),
|
|
265
|
-
var
|
|
266
|
-
const
|
|
267
|
-
...a,
|
|
268
|
-
dataSource: e.dataSource,
|
|
269
|
-
onChange: e.onChange
|
|
270
|
-
}, t = l(C);
|
|
291
|
+
}), W = s(() => {
|
|
292
|
+
var t;
|
|
293
|
+
const e = l(A), o = l(R);
|
|
271
294
|
return {
|
|
295
|
+
...a,
|
|
272
296
|
...e,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
...t,
|
|
297
|
+
rowSelection: a.rowSelection === !0 || ((t = a.rowSelection) == null ? void 0 : t.mode) === "internal" ? {
|
|
298
|
+
...o,
|
|
276
299
|
// tips 如果是前端分页,则默认会走缓存
|
|
277
|
-
preserveSelectedRowKeys:
|
|
278
|
-
} :
|
|
279
|
-
loading:
|
|
280
|
-
pagination:
|
|
281
|
-
scroll: l(
|
|
300
|
+
preserveSelectedRowKeys: g(a.dataSource) ? o.preserveSelectedRowKeys : !0
|
|
301
|
+
} : a.rowSelection,
|
|
302
|
+
loading: g(a.loading) ? e.loading : a.loading,
|
|
303
|
+
pagination: a.pagination === !1 ? !1 : e.pagination,
|
|
304
|
+
scroll: l(pe)
|
|
282
305
|
};
|
|
283
|
-
}),
|
|
284
|
-
function
|
|
285
|
-
if (
|
|
306
|
+
}), me = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
|
|
307
|
+
function ge(e, o, t) {
|
|
308
|
+
if (Z.includes(e.valueType))
|
|
286
309
|
return t;
|
|
287
|
-
const r =
|
|
288
|
-
return
|
|
289
|
-
copyable:
|
|
310
|
+
const r = Ue(o);
|
|
311
|
+
return e.copyable || e.ellipsis ? p(ke.Paragraph, {
|
|
312
|
+
copyable: e.copyable ? {
|
|
290
313
|
text: r,
|
|
291
314
|
tooltip: !1
|
|
292
315
|
} : !1,
|
|
293
|
-
ellipsis:
|
|
316
|
+
ellipsis: e.ellipsis ? Ke(e.ellipsis) ? {
|
|
294
317
|
tooltip: r
|
|
295
318
|
} : {
|
|
296
|
-
...
|
|
319
|
+
...e.ellipsis,
|
|
297
320
|
tooltip: r
|
|
298
321
|
} : !1,
|
|
299
|
-
content:
|
|
322
|
+
content: e.ellipsis ? Me(e, o) : t
|
|
300
323
|
}, null) : t;
|
|
301
324
|
}
|
|
302
|
-
|
|
325
|
+
G(() => l(C).loading, (e) => {
|
|
303
326
|
var o;
|
|
304
|
-
(o =
|
|
327
|
+
(o = a.onLoadingChange) == null || o.call(a, e);
|
|
328
|
+
}), G(() => a.dataSource, (e) => {
|
|
329
|
+
e != null && e.length && ce(e);
|
|
330
|
+
}, {
|
|
331
|
+
immediate: !0
|
|
305
332
|
});
|
|
306
|
-
function
|
|
333
|
+
function ye(e) {
|
|
307
334
|
var o, t, r;
|
|
308
|
-
(r = (t = (o =
|
|
335
|
+
(r = (t = (o = k.value) == null ? void 0 : o.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
|
|
309
336
|
}
|
|
310
|
-
function
|
|
311
|
-
var
|
|
312
|
-
return (t = (o = (
|
|
337
|
+
function he() {
|
|
338
|
+
var e, o, t;
|
|
339
|
+
return (t = (o = (e = k.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : t.call(o, !0);
|
|
313
340
|
}
|
|
314
|
-
return
|
|
315
|
-
submit: () =>
|
|
316
|
-
reset: () =>
|
|
317
|
-
setSearchFormValues:
|
|
318
|
-
getSearchFormValues:
|
|
319
|
-
dataSource:
|
|
341
|
+
return oe({
|
|
342
|
+
submit: () => V(),
|
|
343
|
+
reset: () => j(),
|
|
344
|
+
setSearchFormValues: ye,
|
|
345
|
+
getSearchFormValues: he,
|
|
346
|
+
dataSource: s(() => l(C).records),
|
|
320
347
|
rowSelection: {
|
|
321
|
-
selectedRows:
|
|
322
|
-
...
|
|
348
|
+
selectedRows: s(() => l(x)),
|
|
349
|
+
...v
|
|
323
350
|
}
|
|
324
|
-
}), (
|
|
325
|
-
class:
|
|
326
|
-
}, [l(
|
|
351
|
+
}), (e, o) => (f(), T("div", {
|
|
352
|
+
class: m(me.value)
|
|
353
|
+
}, [l(g)(e.dataSource) && e.searchForm !== !1 && O.value.length > 0 ? (f(), T("div", {
|
|
327
354
|
key: 0,
|
|
328
|
-
class:
|
|
329
|
-
style:
|
|
330
|
-
}, [
|
|
355
|
+
class: m(e.card ? l(F)("search-wrapper") : null),
|
|
356
|
+
style: M(e.searchFormWrapperStyle)
|
|
357
|
+
}, [p(l(Le).SearchForm, h(e.searchForm || {}, {
|
|
331
358
|
ref_key: "formRef",
|
|
332
|
-
ref:
|
|
359
|
+
ref: k,
|
|
333
360
|
"custom-reset": "",
|
|
334
|
-
onSubmit: l(
|
|
335
|
-
onReset: l(
|
|
336
|
-
"submit-loading": l(
|
|
337
|
-
}),
|
|
338
|
-
default: b(() => [(
|
|
361
|
+
onSubmit: l(V),
|
|
362
|
+
onReset: l(j),
|
|
363
|
+
"submit-loading": l(A).loading
|
|
364
|
+
}), J({
|
|
365
|
+
default: b(() => [(f(!0), T(U, null, Q(O.value, (t) => (f(), X(Te(t.renderNode), h({
|
|
339
366
|
key: t.dataIndex,
|
|
340
367
|
ref_for: !0
|
|
341
368
|
}, t.fieldProps || {}, {
|
|
342
369
|
span: t.span
|
|
343
370
|
}), null, 16, ["span"]))), 128))]),
|
|
344
371
|
_: 2
|
|
345
|
-
}, [
|
|
372
|
+
}, [S.searchFormExtra ? {
|
|
346
373
|
name: "extra",
|
|
347
|
-
fn: b(() => [
|
|
374
|
+
fn: b(() => [w(e.$slots, "searchFormExtra")]),
|
|
348
375
|
key: "0"
|
|
349
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
376
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : Y("", !0), I("div", {
|
|
350
377
|
ref_key: "contentRef",
|
|
351
|
-
ref:
|
|
352
|
-
class:
|
|
353
|
-
style:
|
|
354
|
-
}, [
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
class: l(
|
|
359
|
-
},
|
|
360
|
-
"
|
|
361
|
-
|
|
362
|
-
|
|
378
|
+
ref: ne,
|
|
379
|
+
class: m([l(F)("table-wrapper"), e.card ? l(F)("table-wrapper-card") : null]),
|
|
380
|
+
style: M(e.tableWrapperStyle)
|
|
381
|
+
}, [I("div", {
|
|
382
|
+
class: m(l(i)("header-wrapper"))
|
|
383
|
+
}, [e.settings ? (f(), T("div", {
|
|
384
|
+
key: 0,
|
|
385
|
+
class: m(l(i)("header"))
|
|
386
|
+
}, [I("div", {
|
|
387
|
+
class: m(l(L)("header", "title"))
|
|
388
|
+
}, [w(e.$slots, "title", h({
|
|
389
|
+
selectedRows: l(x),
|
|
390
|
+
selectedRowKeys: l(R).selectedRowKeys
|
|
391
|
+
}, v))], 2), S.title ? (f(), X(l(ze), {
|
|
392
|
+
key: 0,
|
|
393
|
+
type: "vertical"
|
|
394
|
+
})) : Y("", !0), p(aa, {
|
|
395
|
+
config: e.settings === !0 ? {} : e.settings
|
|
396
|
+
}, {
|
|
397
|
+
trigger: b(() => [p(l(Pe), {
|
|
398
|
+
icon: Fe(l(Xe))
|
|
399
|
+
}, null, 8, ["icon"])]),
|
|
400
|
+
_: 1
|
|
401
|
+
}, 8, ["config"])], 2)) : w(e.$slots, "title", h({
|
|
402
|
+
key: 1,
|
|
403
|
+
selectedRows: l(x),
|
|
404
|
+
selectedRowKeys: l(R).selectedRowKeys
|
|
405
|
+
}, v))], 2), p(l(Ie), h({
|
|
406
|
+
class: l(i)("table")
|
|
407
|
+
}, W.value, {
|
|
408
|
+
size: B.value,
|
|
409
|
+
"table-layout": fe.value,
|
|
410
|
+
columns: u.value,
|
|
363
411
|
onResizeColumn: o[0] || (o[0] = (t, r) => r.width = t)
|
|
364
|
-
}),
|
|
365
|
-
summary: b(() => [
|
|
366
|
-
columns:
|
|
367
|
-
records:
|
|
412
|
+
}), J({
|
|
413
|
+
summary: b(() => [w(e.$slots, "summary", {
|
|
414
|
+
columns: u.value,
|
|
415
|
+
records: W.value.dataSource
|
|
368
416
|
})]),
|
|
369
417
|
_: 2
|
|
370
|
-
}, [
|
|
418
|
+
}, [Q(l(_)(S, ["title", "searchFormExtra", "headerCell"]), (t, r) => ({
|
|
371
419
|
name: r,
|
|
372
|
-
fn: b((
|
|
373
|
-
}))]), 1040, ["class", "
|
|
420
|
+
fn: b((d) => [w(e.$slots, r, Be(xe(d || {})))])
|
|
421
|
+
}))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
|
|
374
422
|
}
|
|
375
423
|
});
|
|
376
424
|
export {
|
|
377
|
-
|
|
425
|
+
Ca as default
|
|
378
426
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValueEnum } from '../interface';
|
|
1
|
+
import { ApColumnState, ApTableSettingType, ValueEnum } from '../interface';
|
|
2
2
|
export type ApTablePaginationProps = {
|
|
3
3
|
/** dataSource的总数量 */
|
|
4
4
|
total?: number;
|
|
@@ -29,3 +29,35 @@ export type ApTableStatusProps = {
|
|
|
29
29
|
*/
|
|
30
30
|
value?: any;
|
|
31
31
|
};
|
|
32
|
+
export type ApTableSettingModalProps = {
|
|
33
|
+
/**
|
|
34
|
+
* 表格列配置
|
|
35
|
+
*/
|
|
36
|
+
config?: ApTableSettingType;
|
|
37
|
+
};
|
|
38
|
+
export type Key = string | number;
|
|
39
|
+
export type ApTableSettingTreeSelectProps = {
|
|
40
|
+
/**
|
|
41
|
+
* 表格状态
|
|
42
|
+
*/
|
|
43
|
+
value: ApColumnState[];
|
|
44
|
+
};
|
|
45
|
+
export type ApTableSettingSelectGroupProps = {
|
|
46
|
+
/**
|
|
47
|
+
* 二级选中状态(v-model)
|
|
48
|
+
*/
|
|
49
|
+
value: ApColumnState;
|
|
50
|
+
};
|
|
51
|
+
export type ApTableSettingSorterProps = ApTableSettingTreeSelectProps & {
|
|
52
|
+
onReset: () => void;
|
|
53
|
+
};
|
|
54
|
+
export type SortableItemProps = {
|
|
55
|
+
value: ApColumnState;
|
|
56
|
+
'onUpdate:value'?: (nextVal: ApColumnState) => void;
|
|
57
|
+
};
|
|
58
|
+
export type SortableItemMetaProps = {
|
|
59
|
+
value: ApColumnState;
|
|
60
|
+
'onUpdate:value'?: (nextVal: ApColumnState) => void;
|
|
61
|
+
level?: 1 | 2;
|
|
62
|
+
open?: boolean;
|
|
63
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%3e%3cg%3e%3cpath%20d='M5.2485869375,6C4.7454835375,6,4.4657799375,6.581959,4.7800659375,6.974817L7.5316909375000005,10.414349999999999C7.7718909375,10.714590000000001,8.2285409375,10.714590000000001,8.4687309375,10.414349999999999L11.2203609375,6.974817C11.5346409375,6.581959,11.254940937499999,6,10.751840937499999,6L5.2485869375,6Z'%20fill='%23182948'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
e as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const t = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%3e%3cg%20transform='matrix(0,1,-1,0,16,-16)'%3e%3cg%20transform='matrix(1,0,0,-1,0,20)'%3e%3cpath%20d='M21.2485869375,10C20.7454835375,10,20.4657799375,10.581959,20.7800659375,10.974817L23.5316909375,14.414349999999999C23.7718909375,14.714590000000001,24.2285409375,14.714590000000001,24.4687309375,14.414349999999999L27.2203609375,10.974817C27.5346409375,10.581959,27.2549409375,10,26.7518409375,10L21.2485869375,10Z'%20fill='%23182948'%20fill-opacity='1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
t as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ApTableSettingModalProps } from '../../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
type TableSettingModalSlots = {
|
|
4
|
+
trigger: any;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
slots: Readonly<TableSettingModalSlots> & TableSettingModalSlots;
|
|
8
|
+
refs: {};
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: DefineComponent<__VLS_TypePropsToOption<ApTableSettingModalProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApTableSettingModalProps>>>, {}, {}>;
|
|
13
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
type __VLS_TypePropsToOption<T> = {
|
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
+
} : {
|
|
20
|
+
type: PropType<T[K]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|