@aplus-frontend/ui 0.6.3 → 0.6.5
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/interface.d.ts +23 -3
- package/es/src/ap-form/item-group/index.vue.mjs +33 -27
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +36 -32
- package/es/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
- package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +70 -72
- package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
- package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +16 -24
- package/es/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
- package/es/src/ap-form/search-form/hooks/use-sorter.mjs +42 -0
- package/es/src/ap-form/search-form/index.vue.d.ts +6 -3
- package/es/src/ap-form/search-form/index.vue.mjs +101 -91
- package/es/src/ap-grid/index.vue.mjs +219 -201
- package/es/src/ap-grid/interface.d.ts +17 -1
- package/es/src/ap-table/ap-table.vue.d.ts +4 -0
- package/es/src/ap-table/ap-table.vue2.mjs +223 -205
- package/es/src/ap-table/constants.d.ts +2 -2
- package/es/src/ap-table/context.d.ts +4 -0
- package/es/src/ap-table/context.mjs +21 -21
- package/es/src/ap-table/interface.d.ts +17 -1
- package/es/src/ap-table/utils.d.ts +2 -2
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
- package/es/src/business/ap-table-modal/index.d.ts +13 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
- package/es/src/business/ap-view/ap-view.vue2.mjs +107 -109
- package/es/src/business/ap-view/components/main-button-content.vue2.mjs +72 -71
- package/es/src/business/ap-view/interface.d.ts +4 -0
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/es/src/business/hooks/usePageListApTable.d.ts +4 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-form/interface.d.ts +23 -3
- package/lib/src/ap-form/item-group/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/lib/src/ap-form/search-form/components/popover-filter.vue2.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
- package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
- package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.js +1 -1
- package/lib/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
- package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -0
- package/lib/src/ap-form/search-form/index.vue.d.ts +6 -3
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +17 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +4 -0
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +2 -2
- package/lib/src/ap-table/context.d.ts +4 -0
- package/lib/src/ap-table/context.js +1 -1
- package/lib/src/ap-table/interface.d.ts +17 -1
- package/lib/src/ap-table/utils.d.ts +2 -2
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
- package/lib/src/business/ap-table-modal/index.d.ts +13 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +4 -0
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/lib/src/business/hooks/usePageListApTable.d.ts +4 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ap-form/ap-form-item.css +4 -0
- package/theme/ap-form/ap-form-item.less +4 -0
- package/theme/ap-form/index.css +4 -0
- package/theme/ap-form/search-form.css +4 -0
- package/theme/ap-grid/index.css +19 -0
- package/theme/ap-grid/index.less +14 -0
- package/theme/ap-table/ap-table.css +4 -0
- package/theme/ap-table-modal/index.css +4 -0
- package/theme/editable-table/index.css +4 -0
- package/theme/index.css +19 -0
|
@@ -2,6 +2,7 @@ import { ColumnsType } from '@aplus-frontend/antdv/es/table';
|
|
|
2
2
|
import { ComputedRef, InjectionKey } from 'vue';
|
|
3
3
|
import { ApTableContextRenderConfig, ApTableProps } from './interface';
|
|
4
4
|
import { Recordable } from '../type';
|
|
5
|
+
import { ApFormSearchFormPopoverSorterItem } from '../ap-form';
|
|
5
6
|
type TableSize = ApTableProps['size'];
|
|
6
7
|
type ApTableContextProps<RecordType> = {
|
|
7
8
|
/**
|
|
@@ -31,6 +32,9 @@ type ApTableContextProps<RecordType> = {
|
|
|
31
32
|
setSearchFormValues?: (values: Partial<Recordable>) => void;
|
|
32
33
|
submit?: () => void;
|
|
33
34
|
reset?: () => void;
|
|
35
|
+
getSearchFormSorterItems?: () => ApFormSearchFormPopoverSorterItem[];
|
|
36
|
+
setSearchFormSorterItems?: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
37
|
+
resetSearchFormSorterItems: () => void;
|
|
34
38
|
};
|
|
35
39
|
export declare const ApTableContextKey: InjectionKey<ApTableContextProps<any>>;
|
|
36
40
|
export declare function useProvideApTable<ModelType>(state: ApTableContextProps<ModelType>): void;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { provide as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
|
|
1
|
+
import { provide as s, inject as a, computed as o } from "vue";
|
|
2
|
+
const t = Symbol("apTableContextKey");
|
|
3
|
+
function n(r) {
|
|
4
|
+
s(t, r);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const e = () => {
|
|
7
|
+
};
|
|
8
|
+
function c() {
|
|
9
|
+
return a(t, {
|
|
10
|
+
columns: o(() => []),
|
|
11
|
+
updateColumns: e,
|
|
12
|
+
size: o(() => "middle"),
|
|
13
|
+
updateSize: e,
|
|
14
14
|
dataSource: void 0,
|
|
15
15
|
renderConfig: void 0,
|
|
16
16
|
getSearchFormValues: () => {
|
|
17
17
|
},
|
|
18
|
-
setSearchFormValues:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
setSearchFormValues: e,
|
|
19
|
+
submit: e,
|
|
20
|
+
reset: e,
|
|
21
|
+
getSearchFormSorterItems: () => [],
|
|
22
|
+
setSearchFormSorterItems: e,
|
|
23
|
+
resetSearchFormSorterItems: e
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
t as ApTableContextKey,
|
|
28
|
+
c as useInjectApTable,
|
|
29
|
+
n as useProvideApTable
|
|
30
30
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ColumnType, TableProps, ColumnsType } from '@aplus-frontend/antdv/es/table';
|
|
2
2
|
import { CompareFn, SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
|
|
3
|
-
import { ApFormItemProps, ApFormSearchFormProps } from '../ap-form';
|
|
3
|
+
import { ApFormItemProps, ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form';
|
|
4
4
|
import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextPasswordProps, ApFormItemTextProps, ApFormItemTreeSelectProps } from '../ap-form/items/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
6
|
import { ComputedRef, CSSProperties, VNode } from 'vue';
|
|
@@ -406,6 +406,22 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
406
406
|
* @returns
|
|
407
407
|
*/
|
|
408
408
|
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
409
|
+
/**
|
|
410
|
+
* 获取查询排序
|
|
411
|
+
* @returns
|
|
412
|
+
*/
|
|
413
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
414
|
+
/**
|
|
415
|
+
* 设置查询表单排序
|
|
416
|
+
* @param sortedItems
|
|
417
|
+
* @returns
|
|
418
|
+
*/
|
|
419
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
420
|
+
/**
|
|
421
|
+
* 重设查询表单排序
|
|
422
|
+
* @returns
|
|
423
|
+
*/
|
|
424
|
+
resetSearchFormSorterItems: () => void;
|
|
409
425
|
};
|
|
410
426
|
export type ApTableContextRenderConfig = {
|
|
411
427
|
color: string;
|
|
@@ -141,8 +141,8 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
141
141
|
readonly bordered?: boolean | undefined;
|
|
142
142
|
readonly suffix?: any;
|
|
143
143
|
readonly focused?: boolean | undefined;
|
|
144
|
-
readonly placeholder?: string | number | undefined;
|
|
145
144
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
145
|
+
readonly placeholder?: string | number | undefined;
|
|
146
146
|
readonly defaultValue?: string | number | undefined;
|
|
147
147
|
readonly id?: string | undefined;
|
|
148
148
|
readonly autocomplete?: string | undefined;
|
|
@@ -352,8 +352,8 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
|
|
|
352
352
|
readonly bordered?: boolean | undefined;
|
|
353
353
|
readonly suffix?: any;
|
|
354
354
|
readonly focused?: boolean | undefined;
|
|
355
|
-
readonly placeholder?: string | number | undefined;
|
|
356
355
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
356
|
+
readonly placeholder?: string | number | undefined;
|
|
357
357
|
readonly defaultValue?: string | number | undefined;
|
|
358
358
|
readonly id?: string | undefined;
|
|
359
359
|
readonly autocomplete?: string | undefined;
|
|
@@ -2,6 +2,7 @@ import { OpenOptions, UseCreateTableModalProps, OpenReturnType } from '../interf
|
|
|
2
2
|
import { Recordable } from '../../../type';
|
|
3
3
|
import { TableColumnsType } from '@aplus-frontend/antdv';
|
|
4
4
|
import { InternalPagingType } from '../../../ap-table/hooks/use-table-paging-ng';
|
|
5
|
+
import { ApFormSearchFormPopoverSorterItem } from '../../..';
|
|
5
6
|
export declare function useCreateTableModal(props: UseCreateTableModalProps): {
|
|
6
7
|
readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
|
|
7
8
|
readonly closeModal: () => void;
|
|
@@ -37,6 +38,9 @@ export declare function useCreateTableModal(props: UseCreateTableModalProps): {
|
|
|
37
38
|
};
|
|
38
39
|
getPaging: () => InternalPagingType;
|
|
39
40
|
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
41
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
42
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
43
|
+
resetSearchFormSorterItems: () => void;
|
|
40
44
|
} | null | undefined;
|
|
41
45
|
readonly isDestroyed: true;
|
|
42
46
|
};
|
|
@@ -2,6 +2,7 @@ import { ApTableModalProps, OpenOptions } from '../interface';
|
|
|
2
2
|
import { Recordable } from '../../../type';
|
|
3
3
|
import { TableColumnsType } from '@aplus-frontend/antdv';
|
|
4
4
|
import { InternalPagingType } from '../../../ap-table/hooks/use-table-paging-ng';
|
|
5
|
+
import { ApFormSearchFormPopoverSorterItem } from '../../..';
|
|
5
6
|
/** 函数式调用弹框表格 */
|
|
6
7
|
export declare function useTableModal<TableRowType = Record<string, any>>(props: ApTableModalProps<TableRowType>): {
|
|
7
8
|
reloadApTableData: () => void;
|
|
@@ -35,6 +36,9 @@ export declare function useTableModal<TableRowType = Record<string, any>>(props:
|
|
|
35
36
|
};
|
|
36
37
|
getPaging: () => InternalPagingType;
|
|
37
38
|
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
39
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
40
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
41
|
+
resetSearchFormSorterItems: () => void;
|
|
38
42
|
} | null | undefined;
|
|
39
43
|
isDestroyed: true;
|
|
40
44
|
open: (options?: OpenOptions) => Promise<void>;
|
|
@@ -2,6 +2,7 @@ import { OpenOptions, UseTableSelectModalProps } from '../interface';
|
|
|
2
2
|
import { Recordable } from '../../../type';
|
|
3
3
|
import { TableColumnsType } from '@aplus-frontend/antdv';
|
|
4
4
|
import { InternalPagingType } from '../../../ap-table/hooks/use-table-paging-ng';
|
|
5
|
+
import { ApFormSearchFormPopoverSorterItem } from '../../..';
|
|
5
6
|
export declare function useTableSelectModal<TableRowType = Record<string, any>>(props: UseTableSelectModalProps<TableRowType>): {
|
|
6
7
|
reloadApTableData: () => void;
|
|
7
8
|
resetApTableData: () => void;
|
|
@@ -34,6 +35,9 @@ export declare function useTableSelectModal<TableRowType = Record<string, any>>(
|
|
|
34
35
|
};
|
|
35
36
|
getPaging: () => InternalPagingType;
|
|
36
37
|
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
38
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
39
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
40
|
+
resetSearchFormSorterItems: () => void;
|
|
37
41
|
} | null | undefined;
|
|
38
42
|
isDestroyed: true;
|
|
39
43
|
open: (selected?: any[], options?: OpenOptions) => Promise<{
|
|
@@ -4,6 +4,7 @@ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicP
|
|
|
4
4
|
import { ApTableModalProps, OpenOptions, OpenReturnType } from './interface';
|
|
5
5
|
import { Recordable } from '../../type';
|
|
6
6
|
import { TableColumnsType } from '@aplus-frontend/antdv';
|
|
7
|
+
import { ApFormSearchFormPopoverSorterItem } from '../..';
|
|
7
8
|
import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
@@ -49,6 +50,9 @@ declare const ApTableModal: {
|
|
|
49
50
|
current: number;
|
|
50
51
|
pageSize: number;
|
|
51
52
|
}>, refreshImmediately?: boolean) => void;
|
|
53
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
54
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
55
|
+
resetSearchFormSorterItems: () => void;
|
|
52
56
|
} | null;
|
|
53
57
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
54
58
|
finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => any;
|
|
@@ -105,6 +109,9 @@ declare const ApTableModal: {
|
|
|
105
109
|
};
|
|
106
110
|
y: undefined;
|
|
107
111
|
};
|
|
112
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
113
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
114
|
+
resetSearchFormSorterItems: () => void;
|
|
108
115
|
}> | null;
|
|
109
116
|
}, any, ComponentProvideOptions, {
|
|
110
117
|
P: {};
|
|
@@ -153,6 +160,9 @@ declare const ApTableModal: {
|
|
|
153
160
|
current: number;
|
|
154
161
|
pageSize: number;
|
|
155
162
|
}>, refreshImmediately?: boolean) => void;
|
|
163
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
164
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
165
|
+
resetSearchFormSorterItems: () => void;
|
|
156
166
|
} | null;
|
|
157
167
|
}, {}, {}, {}, {
|
|
158
168
|
mask: boolean;
|
|
@@ -209,6 +219,9 @@ declare const ApTableModal: {
|
|
|
209
219
|
};
|
|
210
220
|
getPaging: () => InternalPagingType;
|
|
211
221
|
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
222
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
223
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
224
|
+
resetSearchFormSorterItems: () => void;
|
|
212
225
|
} | null;
|
|
213
226
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
214
227
|
finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => any;
|
|
@@ -3,6 +3,7 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
3
3
|
import { Recordable } from '../../type';
|
|
4
4
|
import { TableColumnsType } from '@aplus-frontend/antdv';
|
|
5
5
|
import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
|
|
6
|
+
import { ApFormSearchFormPopoverSorterItem } from '../..';
|
|
6
7
|
type __VLS_Props = ApTableModalProps;
|
|
7
8
|
declare const _default: DefineComponent<__VLS_Props, {
|
|
8
9
|
open: <T>(selected?: any[], options?: OpenOptions) => Promise<OpenReturnType<T>>;
|
|
@@ -36,6 +37,9 @@ declare const _default: DefineComponent<__VLS_Props, {
|
|
|
36
37
|
};
|
|
37
38
|
getPaging: () => InternalPagingType;
|
|
38
39
|
setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
|
|
40
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
41
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
42
|
+
resetSearchFormSorterItems: () => void;
|
|
39
43
|
} | null;
|
|
40
44
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
41
45
|
finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => any;
|
|
@@ -94,6 +98,9 @@ declare const _default: DefineComponent<__VLS_Props, {
|
|
|
94
98
|
};
|
|
95
99
|
y: undefined;
|
|
96
100
|
};
|
|
101
|
+
getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
|
|
102
|
+
setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
|
|
103
|
+
resetSearchFormSorterItems: () => void;
|
|
97
104
|
}> | null;
|
|
98
105
|
}, any>;
|
|
99
106
|
export default _default;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Q, computed as B, ref as K, createVNode as N, watch as X, createBlock as Z, openBlock as S, unref as b, mergeProps as U, withCtx as R, createElementVNode as C, normalizeClass as O } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { ApBatchActionGroup as
|
|
3
|
+
import D from "./icons/line-down.vue.mjs";
|
|
4
|
+
import { ApBatchActionGroup as ee } from "../ap-batch-action-group/index.mjs";
|
|
5
5
|
import "./components/main-button-content.vue.mjs";
|
|
6
6
|
import "./components/menu-list-content.vue.mjs";
|
|
7
|
-
import { useViewProvide as
|
|
8
|
-
import { useInjectApTable as
|
|
9
|
-
import { SYSTEM_VIEW_KEY as
|
|
10
|
-
import { isValid as
|
|
11
|
-
import "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import oe from "./components/main-button-content.vue2.mjs";
|
|
7
|
+
import { useViewProvide as te } from "./hooks/use-view-provide.mjs";
|
|
8
|
+
import { useInjectApTable as ie } from "../../ap-table/context.mjs";
|
|
9
|
+
import { SYSTEM_VIEW_KEY as c } from "./utils/enum.mjs";
|
|
10
|
+
import { isValid as se } from "@aplus-frontend/utils";
|
|
11
|
+
import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import { useLocale as oe } from "../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import me from "./components/main-button-content.vue2.mjs";
|
|
16
15
|
import ne from "./components/menu-list-content.vue2.mjs";
|
|
17
|
-
|
|
18
|
-
const xe = /* @__PURE__ */ q({
|
|
16
|
+
const _e = /* @__PURE__ */ Q({
|
|
19
17
|
name: "ApView",
|
|
20
18
|
__name: "ap-view",
|
|
21
19
|
props: {
|
|
@@ -35,57 +33,63 @@ const xe = /* @__PURE__ */ q({
|
|
|
35
33
|
}
|
|
36
34
|
},
|
|
37
35
|
setup(E, {
|
|
38
|
-
expose:
|
|
36
|
+
expose: k
|
|
39
37
|
}) {
|
|
40
|
-
const
|
|
41
|
-
b
|
|
42
|
-
} =
|
|
43
|
-
t:
|
|
44
|
-
} =
|
|
45
|
-
viewKey:
|
|
46
|
-
viewName:
|
|
38
|
+
const a = E, A = le("viewCacheOption"), {
|
|
39
|
+
b: g
|
|
40
|
+
} = re("ap-view"), {
|
|
41
|
+
t: L
|
|
42
|
+
} = oe(), v = B(() => ({
|
|
43
|
+
viewKey: c,
|
|
44
|
+
viewName: L("ap.apView.systemView")
|
|
47
45
|
})), {
|
|
48
|
-
getSearchFormValues:
|
|
49
|
-
setSearchFormValues:
|
|
50
|
-
submit:
|
|
51
|
-
reset:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
getSearchFormValues: P,
|
|
47
|
+
setSearchFormValues: T,
|
|
48
|
+
submit: j,
|
|
49
|
+
reset: G,
|
|
50
|
+
getSearchFormSorterItems: $,
|
|
51
|
+
setSearchFormSorterItems: Y,
|
|
52
|
+
resetSearchFormSorterItems: z
|
|
53
|
+
} = ie(), M = K(!1), F = K(!1), V = K("");
|
|
54
|
+
let d = !1, _ = !1;
|
|
55
|
+
const W = {
|
|
55
56
|
dropdownType: "dropdown",
|
|
56
|
-
content:
|
|
57
|
-
maxViewNum:
|
|
57
|
+
content: N(me, {
|
|
58
|
+
maxViewNum: a.maxViewNum
|
|
58
59
|
}, null)
|
|
59
|
-
},
|
|
60
|
+
}, r = K([v.value]), q = B(() => r.value.map((t) => ({
|
|
60
61
|
id: t.viewKey,
|
|
61
|
-
content:
|
|
62
|
+
content: N(ne, {
|
|
62
63
|
view: t
|
|
63
64
|
}, null)
|
|
64
65
|
}))), e = {
|
|
65
|
-
getSearchFormValues:
|
|
66
|
-
setSearchFormValues:
|
|
67
|
-
submit:
|
|
68
|
-
reset:
|
|
69
|
-
|
|
66
|
+
getSearchFormValues: P,
|
|
67
|
+
setSearchFormValues: T,
|
|
68
|
+
submit: j,
|
|
69
|
+
reset: G,
|
|
70
|
+
getSearchFormSorterItems: $,
|
|
71
|
+
setSearchFormSorterItems: Y,
|
|
72
|
+
resetSearchFormSorterItems: z,
|
|
73
|
+
...a.saveDataSource
|
|
70
74
|
}, s = {
|
|
71
|
-
...
|
|
72
|
-
...
|
|
73
|
-
},
|
|
74
|
-
if (
|
|
75
|
-
return
|
|
76
|
-
if ((
|
|
77
|
-
return
|
|
78
|
-
const t =
|
|
79
|
-
return (t == null ? void 0 : t.viewKey) ??
|
|
80
|
-
},
|
|
75
|
+
...A.value,
|
|
76
|
+
...a.viewCacheOption
|
|
77
|
+
}, I = () => {
|
|
78
|
+
if (a.isDefaultSystemView)
|
|
79
|
+
return c;
|
|
80
|
+
if ((a.isFirstDefaultSystemView || _) && d)
|
|
81
|
+
return c;
|
|
82
|
+
const t = r.value.find((i) => i.isDefault);
|
|
83
|
+
return (t == null ? void 0 : t.viewKey) ?? c;
|
|
84
|
+
}, w = (t) => {
|
|
81
85
|
V.value = t;
|
|
82
|
-
const i =
|
|
86
|
+
const i = r.value.find((l) => l.viewKey === V.value);
|
|
83
87
|
i && setTimeout(() => {
|
|
84
|
-
var l,
|
|
85
|
-
i.viewKey ===
|
|
86
|
-
...Object.fromEntries(Object.keys(((
|
|
87
|
-
...((
|
|
88
|
-
}), (
|
|
88
|
+
var l, o, m, f, n, u, y, x, h;
|
|
89
|
+
i.viewKey === c ? ((l = e == null ? void 0 : e.resetSearchFormSorterItems) == null || l.call(e), d ? (o = e == null ? void 0 : e.submit) == null || o.call(e) : (m = e == null ? void 0 : e.reset) == null || m.call(e)) : ((u = e == null ? void 0 : e.setSearchFormValues) == null || u.call(e, {
|
|
90
|
+
...Object.fromEntries(Object.keys(((f = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : f.call(e)) ?? {}).map((J) => [J, void 0])) ?? {},
|
|
91
|
+
...((n = i.viewConfig) == null ? void 0 : n.searchForm) ?? {}
|
|
92
|
+
}), (x = e == null ? void 0 : e.setSearchFormSorterItems) == null || x.call(e, ((y = i.viewConfig) == null ? void 0 : y.sorterItems) ?? []), (h = e == null ? void 0 : e.submit) == null || h.call(e)), d = !1;
|
|
89
93
|
});
|
|
90
94
|
}, p = {
|
|
91
95
|
getViewList: async (t) => {
|
|
@@ -93,118 +97,112 @@ const xe = /* @__PURE__ */ q({
|
|
|
93
97
|
try {
|
|
94
98
|
const {
|
|
95
99
|
tableKey: l
|
|
96
|
-
} = t,
|
|
100
|
+
} = t, o = await ((i = s == null ? void 0 : s.getViewList) == null ? void 0 : i.call(s, {
|
|
97
101
|
tableKey: l
|
|
98
102
|
}));
|
|
99
|
-
return
|
|
103
|
+
return r.value = [v.value, ...o ?? []], w(I()), r.value;
|
|
100
104
|
} catch {
|
|
101
|
-
return
|
|
105
|
+
return r.value = [v.value], w(c), r.value;
|
|
102
106
|
}
|
|
103
107
|
},
|
|
104
108
|
addView: async (t) => {
|
|
105
|
-
var
|
|
109
|
+
var n;
|
|
106
110
|
const {
|
|
107
111
|
tableKey: i,
|
|
108
112
|
viewKey: l,
|
|
109
|
-
viewName:
|
|
110
|
-
isDefault:
|
|
113
|
+
viewName: o,
|
|
114
|
+
isDefault: m,
|
|
111
115
|
viewConfig: f
|
|
112
116
|
} = t;
|
|
113
|
-
await ((
|
|
117
|
+
await ((n = s == null ? void 0 : s.addView) == null ? void 0 : n.call(s, {
|
|
114
118
|
tableKey: i,
|
|
115
119
|
viewKey: l,
|
|
116
|
-
viewName:
|
|
117
|
-
isDefault:
|
|
120
|
+
viewName: o,
|
|
121
|
+
isDefault: m,
|
|
118
122
|
viewConfig: f
|
|
119
|
-
})),
|
|
123
|
+
})), m && (r.value = r.value.map((u) => ({
|
|
120
124
|
...u,
|
|
121
125
|
isDefault: !1
|
|
122
|
-
}))),
|
|
126
|
+
}))), r.value = [...r.value, {
|
|
123
127
|
viewKey: l,
|
|
124
|
-
viewName:
|
|
125
|
-
isDefault:
|
|
128
|
+
viewName: o,
|
|
129
|
+
isDefault: m,
|
|
126
130
|
viewConfig: f
|
|
127
|
-
}],
|
|
131
|
+
}], w(l);
|
|
128
132
|
},
|
|
129
133
|
changeView: async (t) => {
|
|
130
134
|
var u;
|
|
131
135
|
const {
|
|
132
136
|
tableKey: i,
|
|
133
137
|
viewKey: l,
|
|
134
|
-
viewName:
|
|
135
|
-
isDefault:
|
|
138
|
+
viewName: o,
|
|
139
|
+
isDefault: m,
|
|
136
140
|
viewConfig: f
|
|
137
141
|
} = t;
|
|
138
142
|
await ((u = s == null ? void 0 : s.changeView) == null ? void 0 : u.call(s, {
|
|
139
143
|
tableKey: i,
|
|
140
144
|
viewKey: l,
|
|
141
|
-
viewName:
|
|
142
|
-
isDefault:
|
|
145
|
+
viewName: o,
|
|
146
|
+
isDefault: m,
|
|
143
147
|
viewConfig: f
|
|
144
|
-
})),
|
|
148
|
+
})), m && (r.value = r.value.map((y) => ({
|
|
145
149
|
...y,
|
|
146
150
|
isDefault: !1
|
|
147
151
|
})));
|
|
148
|
-
const
|
|
149
|
-
|
|
152
|
+
const n = r.value.find((y) => y.viewKey === l);
|
|
153
|
+
n && (n.viewName = o, n.isDefault = m, n.viewConfig = f), w(l);
|
|
150
154
|
},
|
|
151
155
|
removeView: async (t) => {
|
|
152
|
-
var
|
|
156
|
+
var o;
|
|
153
157
|
const {
|
|
154
158
|
tableKey: i,
|
|
155
159
|
viewKey: l
|
|
156
160
|
} = t;
|
|
157
|
-
await ((
|
|
161
|
+
await ((o = s == null ? void 0 : s.removeView) == null ? void 0 : o.call(s, {
|
|
158
162
|
tableKey: i,
|
|
159
163
|
viewKey: l
|
|
160
|
-
})),
|
|
164
|
+
})), r.value = r.value.filter((m) => m.viewKey !== l), l === V.value && w(I());
|
|
161
165
|
}
|
|
162
|
-
},
|
|
163
|
-
tableKey:
|
|
166
|
+
}, H = {
|
|
167
|
+
tableKey: a.tableKey,
|
|
164
168
|
currentViewKey: V,
|
|
165
|
-
changeCurrentViewKey:
|
|
166
|
-
popoverOpen:
|
|
167
|
-
menuOpen:
|
|
168
|
-
viewList:
|
|
169
|
+
changeCurrentViewKey: w,
|
|
170
|
+
popoverOpen: M,
|
|
171
|
+
menuOpen: F,
|
|
172
|
+
viewList: r,
|
|
169
173
|
viewListCRUD: p,
|
|
170
174
|
saveDataSource: e
|
|
171
175
|
};
|
|
172
|
-
|
|
173
|
-
const {
|
|
174
|
-
has: W
|
|
175
|
-
} = ae(), A = (t) => {
|
|
176
|
-
F = t;
|
|
177
|
-
}, h = (t) => {
|
|
176
|
+
return te(H), X(() => a.tableKey, (t) => {
|
|
178
177
|
var i;
|
|
179
|
-
|
|
178
|
+
se(t) && (d = !0, (i = p == null ? void 0 : p.getViewList) == null || i.call(p, {
|
|
180
179
|
tableKey: t
|
|
181
180
|
}));
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}), (t, i) => (X(), Q(K(D), Z({
|
|
181
|
+
}, {
|
|
182
|
+
immediate: !0
|
|
183
|
+
}), k({
|
|
184
|
+
setFirstDefaultSystemView: (t) => {
|
|
185
|
+
_ = t;
|
|
186
|
+
}
|
|
187
|
+
}), (t, i) => (S(), Z(b(ee), U({
|
|
190
188
|
...t.$attrs
|
|
191
189
|
}, {
|
|
192
|
-
open:
|
|
193
|
-
"onUpdate:open": i[0] || (i[0] = (l) =>
|
|
194
|
-
class: [
|
|
195
|
-
"button-props":
|
|
196
|
-
"menu-list":
|
|
197
|
-
"overlay-class-name": [
|
|
190
|
+
open: F.value,
|
|
191
|
+
"onUpdate:open": i[0] || (i[0] = (l) => F.value = l),
|
|
192
|
+
class: [b(g)()],
|
|
193
|
+
"button-props": W,
|
|
194
|
+
"menu-list": q.value,
|
|
195
|
+
"overlay-class-name": [b(g)("overlay")],
|
|
198
196
|
trigger: "click",
|
|
199
197
|
placement: "bottom"
|
|
200
198
|
}), {
|
|
201
|
-
icon:
|
|
202
|
-
class:
|
|
203
|
-
}, [
|
|
199
|
+
icon: R(() => [C("div", {
|
|
200
|
+
class: O([b(g)("icon")])
|
|
201
|
+
}, [N(D)], 2)]),
|
|
204
202
|
_: 1
|
|
205
203
|
}, 16, ["open", "class", "menu-list", "overlay-class-name"]));
|
|
206
204
|
}
|
|
207
205
|
});
|
|
208
206
|
export {
|
|
209
|
-
|
|
207
|
+
_e as default
|
|
210
208
|
};
|