@aplus-frontend/ui 6.37.0 → 6.39.0
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 +215 -218
- package/es/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/es/src/ag-grid/components/row/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/row/index.vue2.mjs +14 -0
- package/es/src/ag-grid/editable/form-item.vue.mjs +10 -9
- package/es/src/ag-grid/editable/index.vue.mjs +17 -16
- package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
- package/es/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/es/src/ag-grid/hooks/use-row-selection.mjs +81 -68
- package/es/src/ag-grid/index.vue.d.ts +2 -1
- package/es/src/ag-grid/index.vue.mjs +282 -257
- package/es/src/ag-grid/interface.d.ts +54 -3
- package/es/src/ap-action/group/index.vue.mjs +24 -21
- package/es/src/ap-action/item/index.vue2.mjs +28 -20
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
- package/es/src/ap-table/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/es/src/business/ag-grid-modal/constants.mjs +6 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
- package/es/src/business/ag-grid-modal/index.d.ts +2 -0
- package/es/src/business/ag-grid-modal/index.mjs +6 -0
- package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
- package/es/src/business/ag-grid-modal/style/css.js +1 -0
- package/es/src/business/ag-grid-modal/style/index.js +1 -0
- package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/es/src/business/ag-grid-modal/utils.mjs +72 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/index.d.ts +3 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +55 -54
- package/es/src/index.d.ts +0 -1
- package/es/src/index.mjs +280 -284
- package/es/src/path-map.mjs +3 -2
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/lib/src/ag-grid/components/row/index.vue.js +1 -0
- package/lib/src/ag-grid/components/row/index.vue2.js +1 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.js +1 -1
- package/lib/src/ag-grid/index.vue.d.ts +2 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +54 -3
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/constants.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
- package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/index.js +1 -0
- package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
- package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
- package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
- package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/index.d.ts +3 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/index.d.ts +0 -1
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ag-grid/index.css +3 -0
- package/theme/ag-grid-modal/index.css +773 -0
- package/theme/ag-grid-modal/index.less +58 -0
- package/theme/ap-form/ap-form-item.css +3 -0
- package/theme/ap-form/ap-form-item.less +3 -0
- package/theme/ap-form/index.css +3 -0
- package/theme/ap-form/search-form.css +3 -0
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-table/ap-table.css +3 -0
- package/theme/ap-table-modal/index.css +3 -0
- package/theme/ap-upload/index.css +5 -0
- package/theme/ap-upload/multiple-file.css +5 -0
- package/theme/ap-upload/multiple-file.less +6 -0
- package/theme/editable-table/index.css +3 -0
- package/theme/index.css +54 -3
- package/theme/index.less +1 -1
- package/es/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/es/src/work-order-modal/createWorkOrder.mjs +0 -32
- package/es/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/es/src/work-order-modal/help-message.vue.mjs +0 -4
- package/es/src/work-order-modal/help-message.vue2.mjs +0 -36
- package/es/src/work-order-modal/index.d.ts +0 -4
- package/es/src/work-order-modal/index.mjs +0 -8
- package/es/src/work-order-modal/interfaces.d.ts +0 -31
- package/es/src/work-order-modal/interfaces.mjs +0 -9
- package/es/src/work-order-modal/style/css.js +0 -4
- package/es/src/work-order-modal/style/index.js +0 -4
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/es/src/work-order-modal/work-order-modal.vue.mjs +0 -192
- package/es/src/work-order-modal/work-order-modal.vue2.mjs +0 -4
- package/lib/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/lib/src/work-order-modal/createWorkOrder.js +0 -1
- package/lib/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/lib/src/work-order-modal/help-message.vue.js +0 -1
- package/lib/src/work-order-modal/help-message.vue2.js +0 -1
- package/lib/src/work-order-modal/index.d.ts +0 -4
- package/lib/src/work-order-modal/index.js +0 -1
- package/lib/src/work-order-modal/interfaces.d.ts +0 -31
- package/lib/src/work-order-modal/interfaces.js +0 -1
- package/lib/src/work-order-modal/style/css.cjs +0 -4
- package/lib/src/work-order-modal/style/index.cjs +0 -4
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/lib/src/work-order-modal/work-order-modal.vue.js +0 -1
- package/lib/src/work-order-modal/work-order-modal.vue2.js +0 -1
- /package/es/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
- /package/es/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
- /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
- /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
|
@@ -4,7 +4,7 @@ import { TableProps } from '@aplus-frontend/antdv';
|
|
|
4
4
|
import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
6
|
import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
|
|
7
|
-
import { ColDef, GridApi, ICellRendererParams, IRowNode, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowPinnedType, ScrollDirection } from 'ag-grid-community';
|
|
7
|
+
import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection } from 'ag-grid-community';
|
|
8
8
|
import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
|
|
9
9
|
export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
|
|
10
10
|
children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
|
|
@@ -103,6 +103,14 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
103
103
|
* @description 仅限内部使用
|
|
104
104
|
*/
|
|
105
105
|
_requireMark?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* 自定义列表头样式
|
|
108
|
+
*/
|
|
109
|
+
headerStyle?: ColDef<RecordType>['headerStyle'];
|
|
110
|
+
/**
|
|
111
|
+
* 自定表头列类名
|
|
112
|
+
*/
|
|
113
|
+
headerClass?: ColDef<RecordType>['headerClass'];
|
|
106
114
|
} : null;
|
|
107
115
|
export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
|
|
108
116
|
/**
|
|
@@ -123,6 +131,10 @@ export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
123
131
|
* 是否隐藏不可选中的元素
|
|
124
132
|
*/
|
|
125
133
|
hideDisabled?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* 默认选中的行数据(如果没有rowKey将会被过滤掉,如果和defaultSelectedRowKeys同时使用,优先级更低)
|
|
136
|
+
*/
|
|
137
|
+
defaultSelectedRows?: RecordType[];
|
|
126
138
|
};
|
|
127
139
|
export type AgGridVirtualConfig = {
|
|
128
140
|
row?: boolean;
|
|
@@ -135,7 +147,20 @@ export type AgGridSummaryType<RecordType = any> = {
|
|
|
135
147
|
cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType, rowIndex: number) => string | string[]);
|
|
136
148
|
rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
|
|
137
149
|
};
|
|
138
|
-
export type
|
|
150
|
+
export type AgGridCustomRowConfig<RecordType = any> = {
|
|
151
|
+
/**
|
|
152
|
+
* 判断哪些行是自定义渲染行
|
|
153
|
+
* @param params
|
|
154
|
+
* @returns
|
|
155
|
+
*/
|
|
156
|
+
isCustomRow: (params: IsFullWidthRowParams<RecordType>) => boolean;
|
|
157
|
+
/**
|
|
158
|
+
* 行自定义渲染函数
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
render: (params: any) => any;
|
|
162
|
+
};
|
|
163
|
+
export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky' | 'customRow'> & {
|
|
139
164
|
/**
|
|
140
165
|
* 列配置
|
|
141
166
|
*/
|
|
@@ -239,6 +264,13 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
239
264
|
* 指定每一行占据的高度(大量数据展示时的性能优化)
|
|
240
265
|
*/
|
|
241
266
|
rowHeight?: number;
|
|
267
|
+
/**
|
|
268
|
+
* 指定一行占据的高度
|
|
269
|
+
* @since 6.38.0
|
|
270
|
+
* @param params
|
|
271
|
+
* @returns
|
|
272
|
+
*/
|
|
273
|
+
getRowHeight?: (params: RowHeightParams<RecordType>) => number | null | undefined;
|
|
242
274
|
/**
|
|
243
275
|
* 是否使用另外一种渲染器来渲染单元格
|
|
244
276
|
*/
|
|
@@ -282,6 +314,11 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
282
314
|
* @returns
|
|
283
315
|
*/
|
|
284
316
|
onUpdate?: () => void;
|
|
317
|
+
/**
|
|
318
|
+
* 自定义行渲染配置
|
|
319
|
+
* @since 6.37.0
|
|
320
|
+
*/
|
|
321
|
+
customRow?: AgGridCustomRowConfig;
|
|
285
322
|
};
|
|
286
323
|
export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
287
324
|
/**
|
|
@@ -328,11 +365,25 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
328
365
|
rowSelection: {
|
|
329
366
|
selectedRows: ComputedRef<RecordType[]>;
|
|
330
367
|
/**
|
|
331
|
-
* 通过
|
|
368
|
+
* 通过rowKey来选中行
|
|
369
|
+
* 如果是单选模式,只会选择数组中的第一个元素做选中操作
|
|
332
370
|
* @param keys
|
|
333
371
|
* @returns
|
|
334
372
|
*/
|
|
335
373
|
setSelectedRowKeys: (keys: (string | number)[]) => void;
|
|
374
|
+
/**
|
|
375
|
+
* 通过整行数据来选中行
|
|
376
|
+
* 如果是单选模式,只会选择数组中的第一个元素做选中操作
|
|
377
|
+
* @param rows
|
|
378
|
+
* @returns
|
|
379
|
+
*/
|
|
380
|
+
setSelectedRows: (rows: RecordType[]) => void;
|
|
381
|
+
/**
|
|
382
|
+
* 反选中行
|
|
383
|
+
* @param rows
|
|
384
|
+
* @returns
|
|
385
|
+
*/
|
|
386
|
+
unSelectRows: (rows: RecordType[]) => void;
|
|
336
387
|
clearAll: () => void;
|
|
337
388
|
};
|
|
338
389
|
/**
|
|
@@ -5,10 +5,10 @@ import "../item-modal/index.vue2.mjs";
|
|
|
5
5
|
import "../item-popconfirm/index.vue2.mjs";
|
|
6
6
|
import "../item-dropdown/index.vue2.mjs";
|
|
7
7
|
import "../../config-provider/index.mjs";
|
|
8
|
-
import { isUndefined as
|
|
9
|
-
import { useLocale as
|
|
8
|
+
import { isUndefined as F } from "lodash-unified";
|
|
9
|
+
import { useLocale as x } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
10
|
import f from "../item-dropdown/index.vue.mjs";
|
|
11
|
-
import
|
|
11
|
+
import B from "../item-modal/index.vue.mjs";
|
|
12
12
|
import $ from "../item-popconfirm/index.vue.mjs";
|
|
13
13
|
import b from "../item/index.vue2.mjs";
|
|
14
14
|
const q = /* @__PURE__ */ k({
|
|
@@ -22,51 +22,54 @@ const q = /* @__PURE__ */ k({
|
|
|
22
22
|
iconFirst: { type: Boolean }
|
|
23
23
|
},
|
|
24
24
|
setup(_) {
|
|
25
|
-
const r = _, { t: g } =
|
|
25
|
+
const r = _, { t: g } = x(), l = m(
|
|
26
26
|
() => r.actions.filter(
|
|
27
|
-
(
|
|
27
|
+
(t) => t.visible || F(t.visible)
|
|
28
28
|
)
|
|
29
29
|
), d = m(() => c(l).length > r.count), u = m(() => {
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
30
|
+
const t = c(l);
|
|
31
|
+
if (t.length <= r.count)
|
|
32
32
|
return {
|
|
33
|
-
showActions: e
|
|
33
|
+
showActions: t.map((e) => ({
|
|
34
|
+
...e,
|
|
35
|
+
iconFirst: !0
|
|
36
|
+
})),
|
|
34
37
|
menuActions: []
|
|
35
38
|
};
|
|
36
|
-
let i =
|
|
37
|
-
return r.iconFirst && (i = i.map((
|
|
38
|
-
...
|
|
39
|
+
let i = t.slice(0, r.count - 1);
|
|
40
|
+
return r.iconFirst && (i = i.map((e) => ({
|
|
41
|
+
...e,
|
|
39
42
|
iconFirst: !0
|
|
40
43
|
}))), {
|
|
41
44
|
showActions: i,
|
|
42
|
-
menuActions:
|
|
45
|
+
menuActions: t.slice(r.count - 1)
|
|
43
46
|
};
|
|
44
47
|
});
|
|
45
|
-
return (
|
|
48
|
+
return (t, i) => (o(), n(c(w), {
|
|
46
49
|
size: 16,
|
|
47
50
|
align: "center"
|
|
48
51
|
}, {
|
|
49
52
|
default: A(() => [
|
|
50
|
-
(o(!0), a(p, null, v(u.value.showActions, (
|
|
51
|
-
|
|
53
|
+
(o(!0), a(p, null, v(u.value.showActions, (e, h) => (o(), a(p, { key: h }, [
|
|
54
|
+
e.actions ? (o(), n(f, s({
|
|
52
55
|
key: 0,
|
|
53
56
|
ref_for: !0
|
|
54
|
-
},
|
|
57
|
+
}, e), null, 16)) : e.modalProps ? (o(), n(B, s({
|
|
55
58
|
key: 1,
|
|
56
59
|
ref_for: !0
|
|
57
|
-
},
|
|
60
|
+
}, e), null, 16)) : e.popconfirmProps ? (o(), n($, s({
|
|
58
61
|
key: 2,
|
|
59
62
|
ref_for: !0
|
|
60
|
-
},
|
|
63
|
+
}, e), null, 16)) : (o(), n(b, s({
|
|
61
64
|
key: 3,
|
|
62
65
|
ref_for: !0
|
|
63
|
-
},
|
|
66
|
+
}, e), null, 16))
|
|
64
67
|
], 64))), 128)),
|
|
65
68
|
d.value ? (o(), n(f, {
|
|
66
69
|
key: 0,
|
|
67
70
|
actions: u.value.menuActions,
|
|
68
|
-
placement:
|
|
69
|
-
trigger:
|
|
71
|
+
placement: t.placement,
|
|
72
|
+
trigger: t.trigger,
|
|
70
73
|
text: c(g)("ap.common.more")
|
|
71
74
|
}, null, 8, ["actions", "placement", "trigger", "text"])) : y("", !0)
|
|
72
75
|
]),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as C, useSlots as B, createPropsRestProxy as
|
|
1
|
+
import { defineComponent as C, useSlots as B, createPropsRestProxy as h, ref as A, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as F, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as g, isVNode as S, toDisplayString as V } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
|
|
4
|
+
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
5
|
+
import { useNamespace as x } from "../../config-provider/hooks/use-namespace.mjs";
|
|
6
|
+
const D = { key: 1 }, q = /* @__PURE__ */ C({
|
|
6
7
|
name: "ApActionItem",
|
|
7
8
|
__name: "index",
|
|
8
9
|
props: {
|
|
@@ -17,45 +18,52 @@ const D = { key: 1 }, E = /* @__PURE__ */ C({
|
|
|
17
18
|
iconFirst: { type: Boolean, default: !1 }
|
|
18
19
|
},
|
|
19
20
|
setup(o) {
|
|
20
|
-
const s = B(), r =
|
|
21
|
+
const s = B(), r = h(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon"]), { b: k, m: l, e: v } = x("action-item"), c = A(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
|
|
21
22
|
function p(e) {
|
|
22
|
-
|
|
23
|
+
n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
|
|
23
24
|
}
|
|
24
|
-
const i =
|
|
25
|
+
const i = u(() => o.loading || n(c)), b = u(() => [
|
|
25
26
|
k(),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
o.disabled ?
|
|
29
|
-
i.value ?
|
|
27
|
+
l(o.color),
|
|
28
|
+
d.value ? l("icon-first") : null,
|
|
29
|
+
o.disabled ? l("disabled") : null,
|
|
30
|
+
i.value ? l("loading") : null
|
|
30
31
|
].filter(Boolean));
|
|
31
32
|
return (e, I) => y(e.$slots, "trigger", {
|
|
32
33
|
loading: i.value,
|
|
33
34
|
disabled: e.disabled,
|
|
34
35
|
onClick: p
|
|
35
36
|
}, () => [
|
|
36
|
-
e.visible ? (
|
|
37
|
-
class:
|
|
37
|
+
e.visible ? (t(), f("span", F({ key: 0 }, e.$attrs, {
|
|
38
|
+
class: b.value,
|
|
38
39
|
onClick: p
|
|
39
40
|
}), [
|
|
40
|
-
i.value ? (
|
|
41
|
+
i.value ? (t(), m(n($), {
|
|
41
42
|
key: 0,
|
|
42
43
|
"prefix-cls": "btn",
|
|
43
44
|
"exist-icon": !1,
|
|
44
45
|
loading: ""
|
|
45
46
|
})) : a("", !0),
|
|
46
|
-
e.icon || s.icon ? (
|
|
47
|
+
e.icon || s.icon ? (t(), f("span", {
|
|
47
48
|
key: 1,
|
|
48
|
-
class:
|
|
49
|
+
class: N(n(v)("icon-wrapper"))
|
|
49
50
|
}, [
|
|
50
|
-
(n(),
|
|
51
|
+
L(n(w), {
|
|
52
|
+
title: d.value ? e.text : null
|
|
53
|
+
}, {
|
|
54
|
+
default: P(() => [
|
|
55
|
+
(t(), m(g(e.icon || s.icon)))
|
|
56
|
+
]),
|
|
57
|
+
_: 1
|
|
58
|
+
}, 8, ["title"])
|
|
51
59
|
], 2)) : a("", !0),
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
|
|
61
|
+
S(e.text) ? (t(), m(g(e.text), { key: 0 })) : (t(), f("span", D, V(e.text || ""), 1))
|
|
54
62
|
])
|
|
55
63
|
], 16)) : a("", !0)
|
|
56
64
|
]);
|
|
57
65
|
}
|
|
58
66
|
});
|
|
59
67
|
export {
|
|
60
|
-
|
|
68
|
+
q as default
|
|
61
69
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Button as y, Modal as
|
|
3
|
-
import { getSingleVNode as
|
|
4
|
-
import { useInjectApTable as
|
|
1
|
+
import { defineComponent as L, ref as v, unref as e, computed as M, useSlots as P, createVNode as t, cloneVNode as q, createElementBlock as H, openBlock as h, Fragment as J, createBlock as Q, createCommentVNode as W, resolveDynamicComponent as X, withCtx as u, withDirectives as Y, createElementVNode as s, normalizeClass as i, toDisplayString as c, createTextVNode as S, isRef as Z, vShow as ee } from "vue";
|
|
2
|
+
import { Button as y, Modal as te, RadioGroup as le, RadioButton as T, Divider as x } from "@aplus-frontend/antdv";
|
|
3
|
+
import { getSingleVNode as ne } from "../../../../utils/slot.mjs";
|
|
4
|
+
import { useInjectApTable as ae } from "../../../context.mjs";
|
|
5
5
|
import "../tree-select/index.vue.mjs";
|
|
6
|
-
import { useTableColumnState as
|
|
6
|
+
import { useTableColumnState as oe } from "../../../hooks/use-table-column-state.mjs";
|
|
7
7
|
import "../../../../config-provider/index.mjs";
|
|
8
8
|
import "../sorter/index.vue.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { SettingOutlined as
|
|
11
|
-
import { useLocale as
|
|
9
|
+
import se, { customCloneColumnStates as B } from "../utils.mjs";
|
|
10
|
+
import { SettingOutlined as ie } from "@ant-design/icons-vue";
|
|
11
|
+
import { useLocale as ue } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
12
12
|
import { useNamespace as N } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
13
|
+
import re from "../tree-select/index.vue2.mjs";
|
|
14
|
+
import pe from "../sorter/index.vue2.mjs";
|
|
15
|
+
const Be = /* @__PURE__ */ L({
|
|
16
16
|
name: "ApTableSetting",
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
@@ -20,85 +20,86 @@ const Te = /* @__PURE__ */ G({
|
|
|
20
20
|
default: () => ({})
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
columnsBackup:
|
|
26
|
-
size:
|
|
27
|
-
updateSize:
|
|
28
|
-
updateColumns:
|
|
29
|
-
} =
|
|
30
|
-
columnState:
|
|
31
|
-
setColumnState:
|
|
32
|
-
isAllSelected:
|
|
33
|
-
toggleSelectAll:
|
|
34
|
-
columnStateBackup:
|
|
35
|
-
setColumnStateBackup:
|
|
36
|
-
cacheColumnStateIfNeeded:
|
|
37
|
-
} =
|
|
38
|
-
t:
|
|
39
|
-
} =
|
|
23
|
+
setup(_) {
|
|
24
|
+
const m = _, {
|
|
25
|
+
columnsBackup: z,
|
|
26
|
+
size: A,
|
|
27
|
+
updateSize: V,
|
|
28
|
+
updateColumns: w
|
|
29
|
+
} = ae(), d = v(e(A)), R = M(() => m.config.persistenceKey), {
|
|
30
|
+
columnState: n,
|
|
31
|
+
setColumnState: D,
|
|
32
|
+
isAllSelected: O,
|
|
33
|
+
toggleSelectAll: U,
|
|
34
|
+
columnStateBackup: E,
|
|
35
|
+
setColumnStateBackup: I,
|
|
36
|
+
cacheColumnStateIfNeeded: K
|
|
37
|
+
} = oe(m.config, R, []), {
|
|
38
|
+
t: a
|
|
39
|
+
} = ue(), {
|
|
40
40
|
b: f,
|
|
41
41
|
be: g
|
|
42
42
|
} = N("ap-column-setting"), {
|
|
43
|
-
b:
|
|
44
|
-
} = N("ap-table"), r =
|
|
45
|
-
icon: t(
|
|
46
|
-
class:
|
|
47
|
-
}, null),
|
|
43
|
+
b: $
|
|
44
|
+
} = N("ap-table"), r = v(!1), C = v(!1), j = P(), b = ne(j.trigger) || t(y, {
|
|
45
|
+
icon: t(ie, null, null),
|
|
46
|
+
class: $("setting-trigger-button")
|
|
47
|
+
}, null), k = b ? q(b, {
|
|
48
48
|
onClick: () => {
|
|
49
49
|
r.value = !0;
|
|
50
50
|
}
|
|
51
51
|
}) : null;
|
|
52
|
-
function j() {
|
|
53
|
-
w(B(e(U)));
|
|
54
|
-
}
|
|
55
52
|
function F() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
D(B(e(E)));
|
|
54
|
+
}
|
|
55
|
+
function G() {
|
|
56
|
+
w?.(se(e(z), e(n))), V?.(e(d)), r.value = !1;
|
|
57
|
+
const p = B(n.value);
|
|
58
|
+
I(p), K(p), m.config?.onChange?.(p);
|
|
59
59
|
}
|
|
60
|
-
return (p, o) => (
|
|
60
|
+
return (p, o) => (h(), H(J, null, [e(k) ? (h(), Q(X(e(k)), {
|
|
61
61
|
key: 0
|
|
62
|
-
})) :
|
|
62
|
+
})) : W("", !0), t(e(te), {
|
|
63
63
|
open: r.value,
|
|
64
|
-
"onUpdate:open": o[2] || (o[2] = (
|
|
65
|
-
title: e(
|
|
64
|
+
"onUpdate:open": o[2] || (o[2] = (l) => r.value = l),
|
|
65
|
+
title: e(a)("ap.apTable.setting.title"),
|
|
66
66
|
width: 900,
|
|
67
67
|
centered: !0,
|
|
68
68
|
"body-style": {
|
|
69
69
|
padding: "0px !important",
|
|
70
70
|
height: "450px"
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
"after-open-change": (l) => C.value = l,
|
|
73
|
+
onOk: G
|
|
73
74
|
}, {
|
|
74
|
-
default: u(() => [
|
|
75
|
-
class:
|
|
76
|
-
}, [
|
|
77
|
-
class:
|
|
78
|
-
}, [
|
|
79
|
-
class:
|
|
80
|
-
}, [
|
|
81
|
-
class:
|
|
82
|
-
},
|
|
75
|
+
default: u(() => [Y(s("div", {
|
|
76
|
+
class: i(e(f)("wrapper"))
|
|
77
|
+
}, [s("div", {
|
|
78
|
+
class: i(e(f)("left"))
|
|
79
|
+
}, [s("div", {
|
|
80
|
+
class: i(e(g)("left", "header"))
|
|
81
|
+
}, [s("div", null, [s("span", {
|
|
82
|
+
class: i(e(g)("left", "header-tips"))
|
|
83
|
+
}, c(e(a)("ap.apTable.setting.selectAllTip")), 3), t(e(y), {
|
|
83
84
|
type: "link",
|
|
84
85
|
size: "small",
|
|
85
|
-
onClick: e(
|
|
86
|
+
onClick: e(U)
|
|
86
87
|
}, {
|
|
87
|
-
default: u(() => [
|
|
88
|
+
default: u(() => [S(c(e(O) ? e(a)("ap.apTable.setting.unSelectAll") : e(a)("ap.apTable.setting.selectAll")), 1)]),
|
|
88
89
|
_: 1
|
|
89
|
-
}, 8, ["onClick"])]), t(e(
|
|
90
|
+
}, 8, ["onClick"])]), t(e(le), {
|
|
90
91
|
value: d.value,
|
|
91
|
-
"onUpdate:value": o[0] || (o[0] = (
|
|
92
|
+
"onUpdate:value": o[0] || (o[0] = (l) => d.value = l)
|
|
92
93
|
}, {
|
|
93
94
|
default: u(() => [t(e(T), {
|
|
94
95
|
value: "small"
|
|
95
96
|
}, {
|
|
96
|
-
default: u(() => [
|
|
97
|
+
default: u(() => [S(c(e(a)("ap.apTable.setting.sizeSmall")), 1)]),
|
|
97
98
|
_: 1
|
|
98
99
|
}), t(e(T), {
|
|
99
100
|
value: "middle"
|
|
100
101
|
}, {
|
|
101
|
-
default: u(() => [
|
|
102
|
+
default: u(() => [S(c(e(a)("ap.apTable.setting.sizeNormal")), 1)]),
|
|
102
103
|
_: 1
|
|
103
104
|
})]),
|
|
104
105
|
_: 1
|
|
@@ -107,26 +108,26 @@ const Te = /* @__PURE__ */ G({
|
|
|
107
108
|
style: {
|
|
108
109
|
margin: "0px"
|
|
109
110
|
}
|
|
110
|
-
}), t(
|
|
111
|
-
class:
|
|
112
|
-
value: e(
|
|
111
|
+
}), t(re, {
|
|
112
|
+
class: i(e(g)("left", "content")),
|
|
113
|
+
value: e(n)
|
|
113
114
|
}, null, 8, ["class", "value"])], 2), t(e(x), {
|
|
114
115
|
type: "vertical",
|
|
115
116
|
style: {
|
|
116
117
|
height: "100%",
|
|
117
118
|
margin: "0px"
|
|
118
119
|
}
|
|
119
|
-
}),
|
|
120
|
-
class:
|
|
121
|
-
}, [t(
|
|
122
|
-
value: e(
|
|
123
|
-
"onUpdate:value": o[1] || (o[1] = (
|
|
124
|
-
onReset:
|
|
125
|
-
}, null, 8, ["value"])], 2)], 2)]),
|
|
120
|
+
}), s("div", {
|
|
121
|
+
class: i(e(f)("right"))
|
|
122
|
+
}, [t(pe, {
|
|
123
|
+
value: e(n),
|
|
124
|
+
"onUpdate:value": o[1] || (o[1] = (l) => Z(n) ? n.value = l : null),
|
|
125
|
+
onReset: F
|
|
126
|
+
}, null, 8, ["value"])], 2)], 2), [[ee, C.value]])]),
|
|
126
127
|
_: 1
|
|
127
|
-
}, 8, ["open", "title"])], 64));
|
|
128
|
+
}, 8, ["open", "title", "after-open-change"])], 64));
|
|
128
129
|
}
|
|
129
130
|
});
|
|
130
131
|
export {
|
|
131
|
-
|
|
132
|
+
Be as default
|
|
132
133
|
};
|
|
@@ -352,6 +352,12 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
352
352
|
* 查询表单提交
|
|
353
353
|
*/
|
|
354
354
|
submit: () => void;
|
|
355
|
+
/**
|
|
356
|
+
* 表格查询提交(重制页码但查询参数不会重置)
|
|
357
|
+
* @param resetCurrent 是否重置当前页码,默认为`false`
|
|
358
|
+
* @returns
|
|
359
|
+
*/
|
|
360
|
+
submitWith: (resetCurrent?: boolean) => void;
|
|
355
361
|
/**
|
|
356
362
|
* 查询表单重置
|
|
357
363
|
*/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { AgGridExpose } from '../../../ag-grid';
|
|
3
|
+
import { RefreshType } from '../interface';
|
|
4
|
+
interface Options {
|
|
5
|
+
onMounted?: () => void;
|
|
6
|
+
onSelectedRows?: (rows?: any[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface GridApi {
|
|
9
|
+
/** 设置 AgGrid 实例 */
|
|
10
|
+
setInstance: (node: any) => void;
|
|
11
|
+
/** 刷新表格 */
|
|
12
|
+
refresh: (type?: RefreshType) => void;
|
|
13
|
+
/** 获取 AgGrid 实例 */
|
|
14
|
+
getInstance: () => AgGridExpose | undefined;
|
|
15
|
+
/** 设置 AgGrid 选中行 */
|
|
16
|
+
setSelectedRowKeys: (keys: (string | number)[]) => void;
|
|
17
|
+
/** 获取 AgGrid 选中行 */
|
|
18
|
+
getSelectedRows: () => any[] | undefined;
|
|
19
|
+
/** 清空所有选中行 */
|
|
20
|
+
clearAllSelected: () => void;
|
|
21
|
+
/** 清除某一行数据 */
|
|
22
|
+
removeSelected: (record: any) => void;
|
|
23
|
+
/** 设置表格数据length */
|
|
24
|
+
setDataSourceLength: (len: number) => void;
|
|
25
|
+
}
|
|
26
|
+
interface GridApiProvider extends GridApi {
|
|
27
|
+
selectedRows?: ComputedRef<any[]>;
|
|
28
|
+
dataSourceLength?: ComputedRef<number>;
|
|
29
|
+
}
|
|
30
|
+
export declare function useAgGridInstance(options?: Options): [GridApi, any];
|
|
31
|
+
/** 获取上下文中grid的api */
|
|
32
|
+
export declare function useAgGridModalInject(): GridApiProvider | undefined;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ref as o, watch as r, defineComponent as A, provide as h, toRef as a, inject as I } from "vue";
|
|
2
|
+
import { cloneDeep as y } from "lodash-unified";
|
|
3
|
+
const u = Symbol("ag-grid-provider-key");
|
|
4
|
+
function L(n) {
|
|
5
|
+
const t = o(), c = o(), l = o(0), d = (e) => {
|
|
6
|
+
t.value = e;
|
|
7
|
+
}, i = (e) => {
|
|
8
|
+
l.value = e;
|
|
9
|
+
}, v = () => t.value, S = (e = "reset") => {
|
|
10
|
+
t.value && e in t.value && t.value[e]();
|
|
11
|
+
}, w = (e) => {
|
|
12
|
+
t.value?.rowSelection.setSelectedRowKeys(e);
|
|
13
|
+
}, g = () => y(t.value?.rowSelection.selectedRows.value), f = () => t.value?.rowSelection.clearAll(), R = (e) => t.value?.rowSelection.unSelectRows([e]);
|
|
14
|
+
r(t, (e) => {
|
|
15
|
+
e && n?.onMounted?.();
|
|
16
|
+
}), r(
|
|
17
|
+
() => t.value?.rowSelection.selectedRows.value,
|
|
18
|
+
(e) => {
|
|
19
|
+
c.value = e, n?.onSelectedRows?.(e);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
const s = {
|
|
23
|
+
setInstance: d,
|
|
24
|
+
refresh: S,
|
|
25
|
+
getInstance: v,
|
|
26
|
+
setSelectedRowKeys: w,
|
|
27
|
+
getSelectedRows: g,
|
|
28
|
+
clearAllSelected: f,
|
|
29
|
+
removeSelected: R,
|
|
30
|
+
setDataSourceLength: i
|
|
31
|
+
}, p = A({
|
|
32
|
+
setup(e, { slots: m }) {
|
|
33
|
+
return h(u, {
|
|
34
|
+
...s,
|
|
35
|
+
selectedRows: a(() => c.value),
|
|
36
|
+
dataSourceLength: a(
|
|
37
|
+
() => l.value
|
|
38
|
+
)
|
|
39
|
+
}), m.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return [s, p];
|
|
43
|
+
}
|
|
44
|
+
function _() {
|
|
45
|
+
return I(u);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
L as useAgGridInstance,
|
|
49
|
+
_ as useAgGridModalInject
|
|
50
|
+
};
|