mrxy-yk 1.7.8 → 1.8.1
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.
|
@@ -3,7 +3,7 @@ import { UseTableSearchHooksExample } from '../../../hooks/table-search/type';
|
|
|
3
3
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
pages?: Pages;
|
|
6
|
-
tableHook?: UseTableSearchHooksExample<any, any, any, any, any, any>;
|
|
6
|
+
tableHook?: UseTableSearchHooksExample<any, any, any, any, any, any, any>;
|
|
7
7
|
background?: boolean;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ShallowRef, Ref } from 'vue';
|
|
2
2
|
import { UseTableSearchHooksExample, UseTableSearchHooksOptions } from './type';
|
|
3
|
-
export declare function useTableSearchHooks<TD, SP extends Record<string, any>, SHP extends any[], TDP extends any[], TDT extends (Ref<TD[]> | ShallowRef<TD[]>), TDR = void>(options: UseTableSearchHooksOptions<TD, SP, SHP, TDP, TDT, TDR>): UseTableSearchHooksExample<TD, SP, SHP, TDP, TDT, TDR>;
|
|
3
|
+
export declare function useTableSearchHooks<TD, SP extends Record<string, any>, SHP extends any[], DTP extends any[], TDP extends any[], TDT extends (Ref<TD[]> | ShallowRef<TD[]>), TDR = void>(options: UseTableSearchHooksOptions<TD, SP, SHP, DTP, TDP, TDT, TDR>): UseTableSearchHooksExample<TD, SP, SHP, DTP, TDP, TDT, TDR>;
|
|
@@ -35,9 +35,10 @@ function useTableSearchHooks(options) {
|
|
|
35
35
|
let tableRef = null;
|
|
36
36
|
if (typeof ops.tableRef === "string") tableRef = useTemplateRef(ops.tableRef);
|
|
37
37
|
else if (ops.tableRef) tableRef = ops.tableRef;
|
|
38
|
-
function delTableItem(
|
|
39
|
-
if (ops.delTableItem)
|
|
40
|
-
|
|
38
|
+
function delTableItem(...args) {
|
|
39
|
+
if (ops.delTableItem) if (ops.enabledDeleteConfirm === false) ops.delTableItem(...args);
|
|
40
|
+
else ElMessageBox.confirm(ops.deleteConfirmMessage, ops.deleteConfirmTitle).then(() => {
|
|
41
|
+
ops.delTableItem(...args);
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
function setTotal(total) {
|
|
@@ -5,9 +5,10 @@ type UseTableSearchHooksOptions<
|
|
|
5
5
|
TD,
|
|
6
6
|
SP extends Record<string, any>,
|
|
7
7
|
SHP extends any[],
|
|
8
|
+
DTP extends any[],
|
|
8
9
|
TDP extends any[],
|
|
9
10
|
TDT extends (Ref<TD[]> | ShallowRef<TD[]>),
|
|
10
|
-
TDR
|
|
11
|
+
TDR,
|
|
11
12
|
> = {
|
|
12
13
|
// 搜索参数,缺省值ref({})
|
|
13
14
|
searchParams?: SP | Ref<SP>,
|
|
@@ -20,7 +21,9 @@ type UseTableSearchHooksOptions<
|
|
|
20
21
|
// 获取表格数据
|
|
21
22
|
getTableData(...args: TDP): TDR
|
|
22
23
|
// 删除表格项目
|
|
23
|
-
delTableItem?(
|
|
24
|
+
delTableItem?(...args: DTP): void
|
|
25
|
+
// 启用删除确认框,缺省值:true
|
|
26
|
+
enabledDeleteConfirm?: boolean
|
|
24
27
|
// 删除确认框提示内容
|
|
25
28
|
deleteConfirmMessage?: string
|
|
26
29
|
// 删除确认框提示标题
|
|
@@ -31,6 +34,7 @@ type UseTableSearchHooksExample<
|
|
|
31
34
|
TD,
|
|
32
35
|
SP extends Record<string, any>,
|
|
33
36
|
SHP extends any[],
|
|
37
|
+
DTP extends any[],
|
|
34
38
|
TDP extends any[],
|
|
35
39
|
TDT extends (Ref<TD[]> | ShallowRef<TD[]>),
|
|
36
40
|
TDR
|
|
@@ -47,7 +51,7 @@ type UseTableSearchHooksExample<
|
|
|
47
51
|
tableRef?: ShallowRef<TableInstance>
|
|
48
52
|
tableData: TDT
|
|
49
53
|
getTableData(...args: TDP): TDR
|
|
50
|
-
delTableItem(
|
|
54
|
+
delTableItem(...args: DTP): void
|
|
51
55
|
setTotal(total: number): void
|
|
52
56
|
setTableData(tableData: TD[]): void
|
|
53
57
|
searchedParams: ShallowRef<SP>
|