@94ai/nf-table 100.1.17 → 100.1.19
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/lib/index.d.ts +60 -60
- package/lib/nf-column-check-dialog.vue.d.ts +18 -18
- package/lib/nf-column-check-drawer.vue.d.ts +1 -1
- package/lib/nf-table.cjs.js +21 -48
- package/lib/nf-table.esm-bundler.js +24 -51
- package/lib/nf-table.vue.d.ts +23 -23
- package/package/nf-column-check-dialog.vue +3 -3
- package/package/nf-column-check-drawer.vue +3 -3
- package/package/nf-table.vue +17 -10
- package/package.json +6 -6
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { PluginObject } from 'vue-demi';
|
|
2
2
|
declare const _default: import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{}, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
3
|
+
background: {
|
|
4
|
+
type: import("vue-demi").PropType<string>;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
columns: {
|
|
8
|
+
type: import("vue-demi").PropType<any>;
|
|
9
|
+
default: () => never[];
|
|
10
|
+
};
|
|
3
11
|
data: {
|
|
4
12
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
5
13
|
default: () => never[];
|
|
@@ -32,14 +40,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
32
40
|
type: import("vue-demi").PropType<string>;
|
|
33
41
|
default: undefined;
|
|
34
42
|
};
|
|
35
|
-
background: {
|
|
36
|
-
type: import("vue-demi").PropType<string>;
|
|
37
|
-
default: undefined;
|
|
38
|
-
};
|
|
39
|
-
columns: {
|
|
40
|
-
type: import("vue-demi").PropType<any>;
|
|
41
|
-
default: () => never[];
|
|
42
|
-
};
|
|
43
43
|
selectEmptyWarningTips: {
|
|
44
44
|
type: import("vue-demi").PropType<string>;
|
|
45
45
|
default: string;
|
|
@@ -263,6 +263,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
263
263
|
default: boolean;
|
|
264
264
|
};
|
|
265
265
|
}>>, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
266
|
+
background: {
|
|
267
|
+
type: import("vue-demi").PropType<string>;
|
|
268
|
+
default: undefined;
|
|
269
|
+
};
|
|
270
|
+
columns: {
|
|
271
|
+
type: import("vue-demi").PropType<any>;
|
|
272
|
+
default: () => never[];
|
|
273
|
+
};
|
|
266
274
|
data: {
|
|
267
275
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
268
276
|
default: () => never[];
|
|
@@ -295,14 +303,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
295
303
|
type: import("vue-demi").PropType<string>;
|
|
296
304
|
default: undefined;
|
|
297
305
|
};
|
|
298
|
-
background: {
|
|
299
|
-
type: import("vue-demi").PropType<string>;
|
|
300
|
-
default: undefined;
|
|
301
|
-
};
|
|
302
|
-
columns: {
|
|
303
|
-
type: import("vue-demi").PropType<any>;
|
|
304
|
-
default: () => never[];
|
|
305
|
-
};
|
|
306
306
|
selectEmptyWarningTips: {
|
|
307
307
|
type: import("vue-demi").PropType<string>;
|
|
308
308
|
default: string;
|
|
@@ -529,6 +529,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
529
529
|
fieldsChange: (event: string[]) => void;
|
|
530
530
|
"update:showColumn": (event: string[] | undefined) => void;
|
|
531
531
|
}, {
|
|
532
|
+
background: string;
|
|
533
|
+
columns: any;
|
|
532
534
|
data: Record<string, any>[];
|
|
533
535
|
columnEdit: boolean;
|
|
534
536
|
operationPropKey: string;
|
|
@@ -537,8 +539,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
537
539
|
customClass: string;
|
|
538
540
|
body: boolean;
|
|
539
541
|
text: string;
|
|
540
|
-
background: string;
|
|
541
|
-
columns: any;
|
|
542
542
|
selectEmptyWarningTips: string;
|
|
543
543
|
showColumn: string[];
|
|
544
544
|
searchFormAttrs: import("./types").NfSearchFormAttributes;
|
|
@@ -594,6 +594,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
594
594
|
spinner: string;
|
|
595
595
|
alwaysShowPage: boolean;
|
|
596
596
|
}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
597
|
+
background: {
|
|
598
|
+
type: import("vue-demi").PropType<string>;
|
|
599
|
+
default: undefined;
|
|
600
|
+
};
|
|
601
|
+
columns: {
|
|
602
|
+
type: import("vue-demi").PropType<any>;
|
|
603
|
+
default: () => never[];
|
|
604
|
+
};
|
|
597
605
|
data: {
|
|
598
606
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
599
607
|
default: () => never[];
|
|
@@ -626,14 +634,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
626
634
|
type: import("vue-demi").PropType<string>;
|
|
627
635
|
default: undefined;
|
|
628
636
|
};
|
|
629
|
-
background: {
|
|
630
|
-
type: import("vue-demi").PropType<string>;
|
|
631
|
-
default: undefined;
|
|
632
|
-
};
|
|
633
|
-
columns: {
|
|
634
|
-
type: import("vue-demi").PropType<any>;
|
|
635
|
-
default: () => never[];
|
|
636
|
-
};
|
|
637
637
|
selectEmptyWarningTips: {
|
|
638
638
|
type: import("vue-demi").PropType<string>;
|
|
639
639
|
default: string;
|
|
@@ -913,7 +913,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
913
913
|
resizable?: boolean | undefined;
|
|
914
914
|
formatter?: Function | undefined;
|
|
915
915
|
'show-overflow-tooltip'?: boolean | undefined;
|
|
916
|
-
align?: "
|
|
916
|
+
align?: "left" | "right" | "center" | undefined;
|
|
917
917
|
'class-name'?: string | undefined;
|
|
918
918
|
'label-class-name'?: string | undefined;
|
|
919
919
|
selectable?: Function | undefined;
|
|
@@ -922,16 +922,24 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
922
922
|
text?: string | number | undefined;
|
|
923
923
|
value?: string | number | undefined;
|
|
924
924
|
}[] | undefined;
|
|
925
|
-
'filter-placement'?: "
|
|
925
|
+
'filter-placement'?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
926
926
|
'filter-multiple'?: boolean | undefined;
|
|
927
927
|
'filter-method'?: Function | undefined;
|
|
928
928
|
'filtered-value'?: string[] | undefined;
|
|
929
929
|
} | undefined;
|
|
930
930
|
}[]>;
|
|
931
|
-
syncLocalShowColumnToCookies: () =>
|
|
931
|
+
syncLocalShowColumnToCookies: () => void;
|
|
932
932
|
syncCookiesToLocalShowColumn: () => Promise<void>;
|
|
933
933
|
syncCookiesToTableColumn: (readCached?: boolean) => Promise<void>;
|
|
934
934
|
}> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
|
|
935
|
+
background: {
|
|
936
|
+
type: import("vue-demi").PropType<string>;
|
|
937
|
+
default: undefined;
|
|
938
|
+
};
|
|
939
|
+
columns: {
|
|
940
|
+
type: import("vue-demi").PropType<any>;
|
|
941
|
+
default: () => never[];
|
|
942
|
+
};
|
|
935
943
|
data: {
|
|
936
944
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
937
945
|
default: () => never[];
|
|
@@ -964,14 +972,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
964
972
|
type: import("vue-demi").PropType<string>;
|
|
965
973
|
default: undefined;
|
|
966
974
|
};
|
|
967
|
-
background: {
|
|
968
|
-
type: import("vue-demi").PropType<string>;
|
|
969
|
-
default: undefined;
|
|
970
|
-
};
|
|
971
|
-
columns: {
|
|
972
|
-
type: import("vue-demi").PropType<any>;
|
|
973
|
-
default: () => never[];
|
|
974
|
-
};
|
|
975
975
|
selectEmptyWarningTips: {
|
|
976
976
|
type: import("vue-demi").PropType<string>;
|
|
977
977
|
default: string;
|
|
@@ -1195,6 +1195,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1195
1195
|
default: boolean;
|
|
1196
1196
|
};
|
|
1197
1197
|
}>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
1198
|
+
background: {
|
|
1199
|
+
type: import("vue-demi").PropType<string>;
|
|
1200
|
+
default: undefined;
|
|
1201
|
+
};
|
|
1202
|
+
columns: {
|
|
1203
|
+
type: import("vue-demi").PropType<any>;
|
|
1204
|
+
default: () => never[];
|
|
1205
|
+
};
|
|
1198
1206
|
data: {
|
|
1199
1207
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
1200
1208
|
default: () => never[];
|
|
@@ -1227,14 +1235,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1227
1235
|
type: import("vue-demi").PropType<string>;
|
|
1228
1236
|
default: undefined;
|
|
1229
1237
|
};
|
|
1230
|
-
background: {
|
|
1231
|
-
type: import("vue-demi").PropType<string>;
|
|
1232
|
-
default: undefined;
|
|
1233
|
-
};
|
|
1234
|
-
columns: {
|
|
1235
|
-
type: import("vue-demi").PropType<any>;
|
|
1236
|
-
default: () => never[];
|
|
1237
|
-
};
|
|
1238
1238
|
selectEmptyWarningTips: {
|
|
1239
1239
|
type: import("vue-demi").PropType<string>;
|
|
1240
1240
|
default: string;
|
|
@@ -1514,7 +1514,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1514
1514
|
resizable?: boolean | undefined;
|
|
1515
1515
|
formatter?: Function | undefined;
|
|
1516
1516
|
'show-overflow-tooltip'?: boolean | undefined;
|
|
1517
|
-
align?: "
|
|
1517
|
+
align?: "left" | "right" | "center" | undefined;
|
|
1518
1518
|
'class-name'?: string | undefined;
|
|
1519
1519
|
'label-class-name'?: string | undefined;
|
|
1520
1520
|
selectable?: Function | undefined;
|
|
@@ -1523,19 +1523,21 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1523
1523
|
text?: string | number | undefined;
|
|
1524
1524
|
value?: string | number | undefined;
|
|
1525
1525
|
}[] | undefined;
|
|
1526
|
-
'filter-placement'?: "
|
|
1526
|
+
'filter-placement'?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
1527
1527
|
'filter-multiple'?: boolean | undefined;
|
|
1528
1528
|
'filter-method'?: Function | undefined;
|
|
1529
1529
|
'filtered-value'?: string[] | undefined;
|
|
1530
1530
|
} | undefined;
|
|
1531
1531
|
}[]>;
|
|
1532
|
-
syncLocalShowColumnToCookies: () =>
|
|
1532
|
+
syncLocalShowColumnToCookies: () => void;
|
|
1533
1533
|
syncCookiesToLocalShowColumn: () => Promise<void>;
|
|
1534
1534
|
syncCookiesToTableColumn: (readCached?: boolean) => Promise<void>;
|
|
1535
1535
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
1536
1536
|
fieldsChange: (event: string[]) => void;
|
|
1537
1537
|
"update:showColumn": (event: string[] | undefined) => void;
|
|
1538
1538
|
}, string, {
|
|
1539
|
+
background: string;
|
|
1540
|
+
columns: any;
|
|
1539
1541
|
data: Record<string, any>[];
|
|
1540
1542
|
columnEdit: boolean;
|
|
1541
1543
|
operationPropKey: string;
|
|
@@ -1544,8 +1546,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1544
1546
|
customClass: string;
|
|
1545
1547
|
body: boolean;
|
|
1546
1548
|
text: string;
|
|
1547
|
-
background: string;
|
|
1548
|
-
columns: any;
|
|
1549
1549
|
selectEmptyWarningTips: string;
|
|
1550
1550
|
showColumn: string[];
|
|
1551
1551
|
searchFormAttrs: import("./types").NfSearchFormAttributes;
|
|
@@ -1602,6 +1602,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1602
1602
|
alwaysShowPage: boolean;
|
|
1603
1603
|
}> & {
|
|
1604
1604
|
props: {
|
|
1605
|
+
background: {
|
|
1606
|
+
type: import("vue-demi").PropType<string>;
|
|
1607
|
+
default: undefined;
|
|
1608
|
+
};
|
|
1609
|
+
columns: {
|
|
1610
|
+
type: import("vue-demi").PropType<any>;
|
|
1611
|
+
default: () => never[];
|
|
1612
|
+
};
|
|
1605
1613
|
data: {
|
|
1606
1614
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
1607
1615
|
default: () => never[];
|
|
@@ -1634,14 +1642,6 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1634
1642
|
type: import("vue-demi").PropType<string>;
|
|
1635
1643
|
default: undefined;
|
|
1636
1644
|
};
|
|
1637
|
-
background: {
|
|
1638
|
-
type: import("vue-demi").PropType<string>;
|
|
1639
|
-
default: undefined;
|
|
1640
|
-
};
|
|
1641
|
-
columns: {
|
|
1642
|
-
type: import("vue-demi").PropType<any>;
|
|
1643
|
-
default: () => never[];
|
|
1644
|
-
};
|
|
1645
1645
|
selectEmptyWarningTips: {
|
|
1646
1646
|
type: import("vue-demi").PropType<string>;
|
|
1647
1647
|
default: string;
|
|
@@ -1942,7 +1942,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1942
1942
|
resizable?: boolean | undefined;
|
|
1943
1943
|
formatter?: Function | undefined;
|
|
1944
1944
|
'show-overflow-tooltip'?: boolean | undefined;
|
|
1945
|
-
align?: "
|
|
1945
|
+
align?: "left" | "right" | "center" | undefined;
|
|
1946
1946
|
'class-name'?: string | undefined;
|
|
1947
1947
|
'label-class-name'?: string | undefined;
|
|
1948
1948
|
selectable?: Function | undefined;
|
|
@@ -1951,7 +1951,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
1951
1951
|
text?: string | number | undefined;
|
|
1952
1952
|
value?: string | number | undefined;
|
|
1953
1953
|
}[] | undefined;
|
|
1954
|
-
'filter-placement'?: "
|
|
1954
|
+
'filter-placement'?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
1955
1955
|
'filter-multiple'?: boolean | undefined;
|
|
1956
1956
|
'filter-method'?: Function | undefined;
|
|
1957
1957
|
'filtered-value'?: string[] | undefined;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineComponent<{
|
|
2
|
+
top: {
|
|
3
|
+
type: import("vue-demi").PropType<string>;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
width: {
|
|
7
|
+
type: import("vue-demi").PropType<string>;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
2
10
|
columnEdit: {
|
|
3
11
|
type: import("vue-demi").PropType<boolean>;
|
|
4
12
|
default: boolean;
|
|
@@ -19,10 +27,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
19
27
|
type: import("vue-demi").PropType<string>;
|
|
20
28
|
default: string;
|
|
21
29
|
};
|
|
22
|
-
width: {
|
|
23
|
-
type: import("vue-demi").PropType<string>;
|
|
24
|
-
default: string;
|
|
25
|
-
};
|
|
26
30
|
confirmText: {
|
|
27
31
|
type: import("vue-demi").PropType<string>;
|
|
28
32
|
default: string;
|
|
@@ -47,10 +51,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
47
51
|
type: import("vue-demi").PropType<boolean>;
|
|
48
52
|
default: boolean;
|
|
49
53
|
};
|
|
50
|
-
top: {
|
|
51
|
-
type: import("vue-demi").PropType<string>;
|
|
52
|
-
default: string;
|
|
53
|
-
};
|
|
54
54
|
appendToBody: {
|
|
55
55
|
type: import("vue-demi").PropType<boolean>;
|
|
56
56
|
default: boolean;
|
|
@@ -91,6 +91,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
91
91
|
"update:show": (event: boolean) => void;
|
|
92
92
|
save: (event: Record<string, any>) => void;
|
|
93
93
|
}, string, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
94
|
+
top: {
|
|
95
|
+
type: import("vue-demi").PropType<string>;
|
|
96
|
+
default: string;
|
|
97
|
+
};
|
|
98
|
+
width: {
|
|
99
|
+
type: import("vue-demi").PropType<string>;
|
|
100
|
+
default: string;
|
|
101
|
+
};
|
|
94
102
|
columnEdit: {
|
|
95
103
|
type: import("vue-demi").PropType<boolean>;
|
|
96
104
|
default: boolean;
|
|
@@ -111,10 +119,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
111
119
|
type: import("vue-demi").PropType<string>;
|
|
112
120
|
default: string;
|
|
113
121
|
};
|
|
114
|
-
width: {
|
|
115
|
-
type: import("vue-demi").PropType<string>;
|
|
116
|
-
default: string;
|
|
117
|
-
};
|
|
118
122
|
confirmText: {
|
|
119
123
|
type: import("vue-demi").PropType<string>;
|
|
120
124
|
default: string;
|
|
@@ -139,10 +143,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
139
143
|
type: import("vue-demi").PropType<boolean>;
|
|
140
144
|
default: boolean;
|
|
141
145
|
};
|
|
142
|
-
top: {
|
|
143
|
-
type: import("vue-demi").PropType<string>;
|
|
144
|
-
default: string;
|
|
145
|
-
};
|
|
146
146
|
appendToBody: {
|
|
147
147
|
type: import("vue-demi").PropType<boolean>;
|
|
148
148
|
default: boolean;
|
|
@@ -180,19 +180,19 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
180
180
|
default: boolean;
|
|
181
181
|
};
|
|
182
182
|
}>>, {
|
|
183
|
+
top: string;
|
|
184
|
+
width: string;
|
|
183
185
|
columnEdit: boolean;
|
|
184
186
|
operationPropKey: string;
|
|
185
187
|
storageKey: string;
|
|
186
188
|
show: boolean;
|
|
187
189
|
title: string;
|
|
188
|
-
width: string;
|
|
189
190
|
confirmText: string;
|
|
190
191
|
cancelText: string;
|
|
191
192
|
tableColumns: Record<string, any>[];
|
|
192
193
|
modalAppendToBody: boolean;
|
|
193
194
|
modal: boolean;
|
|
194
195
|
fullscreen: boolean;
|
|
195
|
-
top: string;
|
|
196
196
|
appendToBody: boolean;
|
|
197
197
|
lockScroll: boolean;
|
|
198
198
|
customClass: string;
|
|
@@ -44,7 +44,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
44
44
|
default: (length: any) => string;
|
|
45
45
|
};
|
|
46
46
|
}, {
|
|
47
|
-
syncTableColumnsToCookies: () =>
|
|
47
|
+
syncTableColumnsToCookies: () => Record<string, any>;
|
|
48
48
|
setFields: (tableColumns: any) => void;
|
|
49
49
|
updateColumn: () => void;
|
|
50
50
|
handleSearch: (str: any) => void;
|
package/lib/nf-table.cjs.js
CHANGED
|
@@ -1,44 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vueDemi = require("vue-demi");
|
|
4
|
-
const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
|
|
5
4
|
const commonUtils = require("@94ai/common-utils");
|
|
5
|
+
const vue2RuntimeHelpers = require("@94ai/vue2-runtime-helpers");
|
|
6
6
|
const elementUi = require("element-ui");
|
|
7
7
|
const NfMessage = require("@94ai/nf-message");
|
|
8
|
-
function promisifyRequest(request) {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
request.oncomplete = request.onsuccess = () => resolve(request.result);
|
|
11
|
-
request.onabort = request.onerror = () => reject(request.error);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
function createStore(dbName, storeName) {
|
|
15
|
-
const request = indexedDB.open(dbName);
|
|
16
|
-
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
|
|
17
|
-
const dbp = promisifyRequest(request);
|
|
18
|
-
return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
|
|
19
|
-
}
|
|
20
|
-
let defaultGetStoreFunc;
|
|
21
|
-
function defaultGetStore() {
|
|
22
|
-
if (!defaultGetStoreFunc) {
|
|
23
|
-
defaultGetStoreFunc = createStore("keyval-store", "keyval");
|
|
24
|
-
}
|
|
25
|
-
return defaultGetStoreFunc;
|
|
26
|
-
}
|
|
27
|
-
function get(key, customStore = defaultGetStore()) {
|
|
28
|
-
return customStore("readonly", (store) => promisifyRequest(store.get(key)));
|
|
29
|
-
}
|
|
30
|
-
function set(key, value, customStore = defaultGetStore()) {
|
|
31
|
-
return customStore("readwrite", (store) => {
|
|
32
|
-
store.put(value, key);
|
|
33
|
-
return promisifyRequest(store.transaction);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function del(key, customStore = defaultGetStore()) {
|
|
37
|
-
return customStore("readwrite", (store) => {
|
|
38
|
-
store.delete(key);
|
|
39
|
-
return promisifyRequest(store.transaction);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
8
|
const __sfc_main$2 = vueDemi.defineComponent({
|
|
43
9
|
name: "NfColumnCheckDialog"
|
|
44
10
|
});
|
|
@@ -211,7 +177,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
|
|
|
211
177
|
}
|
|
212
178
|
return fields2;
|
|
213
179
|
});
|
|
214
|
-
const submit =
|
|
180
|
+
const submit = () => {
|
|
215
181
|
visible.value = false;
|
|
216
182
|
const columnState = {};
|
|
217
183
|
props.tableColumns.map((i, index2) => {
|
|
@@ -225,7 +191,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
|
|
|
225
191
|
});
|
|
226
192
|
emit("save", tableData.value);
|
|
227
193
|
if (props.columnEdit) {
|
|
228
|
-
|
|
194
|
+
commonUtils.CachedManager.syncCachedSet(props.storageKey, columnState);
|
|
229
195
|
}
|
|
230
196
|
};
|
|
231
197
|
const addInitValue = () => {
|
|
@@ -5477,7 +5443,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5477
5443
|
}
|
|
5478
5444
|
updateColumn();
|
|
5479
5445
|
};
|
|
5480
|
-
const syncTableColumnsToCookies =
|
|
5446
|
+
const syncTableColumnsToCookies = () => {
|
|
5481
5447
|
var _a2;
|
|
5482
5448
|
const newTableColumns = [...fixedColumn.value, ...unFixedColumn.value];
|
|
5483
5449
|
if (newTableColumns.filter((item) => !item.type && item.prop !== props.operationPropKey && !item.initHidden).length === 0) {
|
|
@@ -5511,7 +5477,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5511
5477
|
obj[i.prop] = !columnState[i.prop].initHidden;
|
|
5512
5478
|
});
|
|
5513
5479
|
if (props.columnEdit) {
|
|
5514
|
-
|
|
5480
|
+
commonUtils.CachedManager.syncCachedSet(props.storageKey, columnState);
|
|
5515
5481
|
}
|
|
5516
5482
|
return obj;
|
|
5517
5483
|
};
|
|
@@ -6293,7 +6259,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6293
6259
|
}, {
|
|
6294
6260
|
immediate: true
|
|
6295
6261
|
});
|
|
6296
|
-
const syncLocalShowColumnToCookies =
|
|
6262
|
+
const syncLocalShowColumnToCookies = () => {
|
|
6297
6263
|
if (props.columnEdit) {
|
|
6298
6264
|
const columnState = {};
|
|
6299
6265
|
props.columns.map((i, index2) => {
|
|
@@ -6306,7 +6272,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6306
6272
|
index: index2
|
|
6307
6273
|
};
|
|
6308
6274
|
});
|
|
6309
|
-
|
|
6275
|
+
commonUtils.CachedManager.syncCachedSet(props.storageKey, columnState);
|
|
6310
6276
|
}
|
|
6311
6277
|
};
|
|
6312
6278
|
const syncShowItemToInitHidden = () => {
|
|
@@ -6327,7 +6293,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6327
6293
|
const syncCookiesToLocalShowColumn = async () => {
|
|
6328
6294
|
if (props.columnEdit) {
|
|
6329
6295
|
try {
|
|
6330
|
-
let columnState =
|
|
6296
|
+
let columnState = commonUtils.CachedManager.syncCachedGet(props.storageKey);
|
|
6297
|
+
if (!columnState) {
|
|
6298
|
+
columnState = await commonUtils.CachedManager.asyncCachedGet(props.storageKey);
|
|
6299
|
+
}
|
|
6331
6300
|
if (columnState) {
|
|
6332
6301
|
if (typeof columnState === "string") {
|
|
6333
6302
|
columnState = JSON.parse(columnState);
|
|
@@ -6350,16 +6319,18 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6350
6319
|
var _a2, _b;
|
|
6351
6320
|
if (props.columnEdit) {
|
|
6352
6321
|
try {
|
|
6353
|
-
|
|
6322
|
+
let cached = commonUtils.CachedManager.syncCachedGet(props.storageKey);
|
|
6323
|
+
if (!cached) {
|
|
6324
|
+
cached = await commonUtils.CachedManager.asyncCachedGet(props.storageKey);
|
|
6325
|
+
}
|
|
6354
6326
|
const cachedPriority = props.priority === "cached";
|
|
6355
6327
|
if (cachedPriority ? cached : (_a2 = localShowColumn.value) == null ? void 0 : _a2.length) {
|
|
6356
|
-
cachedPriority ? await syncCookiesToLocalShowColumn() :
|
|
6328
|
+
cachedPriority ? await syncCookiesToLocalShowColumn() : syncLocalShowColumnToCookies();
|
|
6357
6329
|
} else if (cachedPriority ? (_b = localShowColumn.value) == null ? void 0 : _b.length : cached) {
|
|
6358
|
-
cachedPriority ?
|
|
6330
|
+
cachedPriority ? syncLocalShowColumnToCookies() : await syncCookiesToLocalShowColumn();
|
|
6359
6331
|
}
|
|
6360
6332
|
} catch (e) {
|
|
6361
6333
|
console.log(e);
|
|
6362
|
-
await del(props.storageKey);
|
|
6363
6334
|
}
|
|
6364
6335
|
}
|
|
6365
6336
|
};
|
|
@@ -6396,7 +6367,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6396
6367
|
});
|
|
6397
6368
|
if (readCached && props.columnEdit) {
|
|
6398
6369
|
try {
|
|
6399
|
-
let columnState =
|
|
6370
|
+
let columnState = commonUtils.CachedManager.syncCachedGet(props.storageKey);
|
|
6371
|
+
if (!columnState) {
|
|
6372
|
+
columnState = await commonUtils.CachedManager.asyncCachedGet(props.storageKey);
|
|
6373
|
+
}
|
|
6400
6374
|
props.columns._skip = true;
|
|
6401
6375
|
if (columnState) {
|
|
6402
6376
|
if (typeof columnState === "string") {
|
|
@@ -6419,7 +6393,6 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6419
6393
|
}
|
|
6420
6394
|
} catch (e) {
|
|
6421
6395
|
console.log(e);
|
|
6422
|
-
await del(props.storageKey);
|
|
6423
6396
|
}
|
|
6424
6397
|
}
|
|
6425
6398
|
await vueDemi.nextTick();
|
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
import { defineComponent, getCurrentInstance, ref, computed, onMounted, onBeforeMount, watch, nextTick, set
|
|
1
|
+
import { defineComponent, getCurrentInstance, ref, computed, onMounted, onBeforeMount, watch, nextTick, set } from "vue-demi";
|
|
2
|
+
import { CachedManager, deepClone } from "@94ai/common-utils";
|
|
2
3
|
import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
|
|
3
|
-
import { deepClone } from "@94ai/common-utils";
|
|
4
4
|
import { Loading } from "element-ui";
|
|
5
5
|
import NfMessage from "@94ai/nf-message";
|
|
6
|
-
function promisifyRequest(request) {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
request.oncomplete = request.onsuccess = () => resolve(request.result);
|
|
9
|
-
request.onabort = request.onerror = () => reject(request.error);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
function createStore(dbName, storeName) {
|
|
13
|
-
const request = indexedDB.open(dbName);
|
|
14
|
-
request.onupgradeneeded = () => request.result.createObjectStore(storeName);
|
|
15
|
-
const dbp = promisifyRequest(request);
|
|
16
|
-
return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
|
|
17
|
-
}
|
|
18
|
-
let defaultGetStoreFunc;
|
|
19
|
-
function defaultGetStore() {
|
|
20
|
-
if (!defaultGetStoreFunc) {
|
|
21
|
-
defaultGetStoreFunc = createStore("keyval-store", "keyval");
|
|
22
|
-
}
|
|
23
|
-
return defaultGetStoreFunc;
|
|
24
|
-
}
|
|
25
|
-
function get(key, customStore = defaultGetStore()) {
|
|
26
|
-
return customStore("readonly", (store) => promisifyRequest(store.get(key)));
|
|
27
|
-
}
|
|
28
|
-
function set(key, value, customStore = defaultGetStore()) {
|
|
29
|
-
return customStore("readwrite", (store) => {
|
|
30
|
-
store.put(value, key);
|
|
31
|
-
return promisifyRequest(store.transaction);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function del(key, customStore = defaultGetStore()) {
|
|
35
|
-
return customStore("readwrite", (store) => {
|
|
36
|
-
store.delete(key);
|
|
37
|
-
return promisifyRequest(store.transaction);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
6
|
const __sfc_main$2 = defineComponent({
|
|
41
7
|
name: "NfColumnCheckDialog"
|
|
42
8
|
});
|
|
@@ -209,7 +175,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
|
|
|
209
175
|
}
|
|
210
176
|
return fields2;
|
|
211
177
|
});
|
|
212
|
-
const submit =
|
|
178
|
+
const submit = () => {
|
|
213
179
|
visible.value = false;
|
|
214
180
|
const columnState = {};
|
|
215
181
|
props.tableColumns.map((i, index2) => {
|
|
@@ -223,7 +189,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
|
|
|
223
189
|
});
|
|
224
190
|
emit("save", tableData.value);
|
|
225
191
|
if (props.columnEdit) {
|
|
226
|
-
|
|
192
|
+
CachedManager.syncCachedSet(props.storageKey, columnState);
|
|
227
193
|
}
|
|
228
194
|
};
|
|
229
195
|
const addInitValue = () => {
|
|
@@ -5475,7 +5441,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5475
5441
|
}
|
|
5476
5442
|
updateColumn();
|
|
5477
5443
|
};
|
|
5478
|
-
const syncTableColumnsToCookies =
|
|
5444
|
+
const syncTableColumnsToCookies = () => {
|
|
5479
5445
|
var _a2;
|
|
5480
5446
|
const newTableColumns = [...fixedColumn.value, ...unFixedColumn.value];
|
|
5481
5447
|
if (newTableColumns.filter((item) => !item.type && item.prop !== props.operationPropKey && !item.initHidden).length === 0) {
|
|
@@ -5509,7 +5475,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
|
|
|
5509
5475
|
obj[i.prop] = !columnState[i.prop].initHidden;
|
|
5510
5476
|
});
|
|
5511
5477
|
if (props.columnEdit) {
|
|
5512
|
-
|
|
5478
|
+
CachedManager.syncCachedSet(props.storageKey, columnState);
|
|
5513
5479
|
}
|
|
5514
5480
|
return obj;
|
|
5515
5481
|
};
|
|
@@ -6291,7 +6257,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6291
6257
|
}, {
|
|
6292
6258
|
immediate: true
|
|
6293
6259
|
});
|
|
6294
|
-
const syncLocalShowColumnToCookies =
|
|
6260
|
+
const syncLocalShowColumnToCookies = () => {
|
|
6295
6261
|
if (props.columnEdit) {
|
|
6296
6262
|
const columnState = {};
|
|
6297
6263
|
props.columns.map((i, index2) => {
|
|
@@ -6304,7 +6270,7 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6304
6270
|
index: index2
|
|
6305
6271
|
};
|
|
6306
6272
|
});
|
|
6307
|
-
|
|
6273
|
+
CachedManager.syncCachedSet(props.storageKey, columnState);
|
|
6308
6274
|
}
|
|
6309
6275
|
};
|
|
6310
6276
|
const syncShowItemToInitHidden = () => {
|
|
@@ -6325,7 +6291,10 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6325
6291
|
const syncCookiesToLocalShowColumn = async () => {
|
|
6326
6292
|
if (props.columnEdit) {
|
|
6327
6293
|
try {
|
|
6328
|
-
let columnState =
|
|
6294
|
+
let columnState = CachedManager.syncCachedGet(props.storageKey);
|
|
6295
|
+
if (!columnState) {
|
|
6296
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey);
|
|
6297
|
+
}
|
|
6329
6298
|
if (columnState) {
|
|
6330
6299
|
if (typeof columnState === "string") {
|
|
6331
6300
|
columnState = JSON.parse(columnState);
|
|
@@ -6348,16 +6317,18 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6348
6317
|
var _a2, _b;
|
|
6349
6318
|
if (props.columnEdit) {
|
|
6350
6319
|
try {
|
|
6351
|
-
|
|
6320
|
+
let cached = CachedManager.syncCachedGet(props.storageKey);
|
|
6321
|
+
if (!cached) {
|
|
6322
|
+
cached = await CachedManager.asyncCachedGet(props.storageKey);
|
|
6323
|
+
}
|
|
6352
6324
|
const cachedPriority = props.priority === "cached";
|
|
6353
6325
|
if (cachedPriority ? cached : (_a2 = localShowColumn.value) == null ? void 0 : _a2.length) {
|
|
6354
|
-
cachedPriority ? await syncCookiesToLocalShowColumn() :
|
|
6326
|
+
cachedPriority ? await syncCookiesToLocalShowColumn() : syncLocalShowColumnToCookies();
|
|
6355
6327
|
} else if (cachedPriority ? (_b = localShowColumn.value) == null ? void 0 : _b.length : cached) {
|
|
6356
|
-
cachedPriority ?
|
|
6328
|
+
cachedPriority ? syncLocalShowColumnToCookies() : await syncCookiesToLocalShowColumn();
|
|
6357
6329
|
}
|
|
6358
6330
|
} catch (e) {
|
|
6359
6331
|
console.log(e);
|
|
6360
|
-
await del(props.storageKey);
|
|
6361
6332
|
}
|
|
6362
6333
|
}
|
|
6363
6334
|
};
|
|
@@ -6387,14 +6358,17 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6387
6358
|
delete item.attr.prop;
|
|
6388
6359
|
delete item.attr.label;
|
|
6389
6360
|
item._index = index2;
|
|
6390
|
-
set
|
|
6391
|
-
set
|
|
6361
|
+
set(item, "initHidden", item.initHidden);
|
|
6362
|
+
set(item, "destory", item.destory);
|
|
6392
6363
|
item.__index = index2;
|
|
6393
6364
|
return item;
|
|
6394
6365
|
});
|
|
6395
6366
|
if (readCached && props.columnEdit) {
|
|
6396
6367
|
try {
|
|
6397
|
-
let columnState =
|
|
6368
|
+
let columnState = CachedManager.syncCachedGet(props.storageKey);
|
|
6369
|
+
if (!columnState) {
|
|
6370
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey);
|
|
6371
|
+
}
|
|
6398
6372
|
props.columns._skip = true;
|
|
6399
6373
|
if (columnState) {
|
|
6400
6374
|
if (typeof columnState === "string") {
|
|
@@ -6417,7 +6391,6 @@ __sfc_main.setup = (__props, __ctx) => {
|
|
|
6417
6391
|
}
|
|
6418
6392
|
} catch (e) {
|
|
6419
6393
|
console.log(e);
|
|
6420
|
-
await del(props.storageKey);
|
|
6421
6394
|
}
|
|
6422
6395
|
}
|
|
6423
6396
|
await nextTick();
|
package/lib/nf-table.vue.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { NfTableColumnAttributes, ElTableAttributes, ElTableEventKey, ElPaginationEventKey, ElPaginationAttributes, NfSearchFormAttributes, NfSearchFormEventKey, NfTableActionBtnAttributes } from './types';
|
|
2
2
|
import { ITabItem } from '@94ai/nf-drawer/lib/types';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineComponent<{
|
|
4
|
+
background: {
|
|
5
|
+
type: import("vue-demi").PropType<string>;
|
|
6
|
+
default: undefined;
|
|
7
|
+
};
|
|
8
|
+
columns: {
|
|
9
|
+
type: import("vue-demi").PropType<any>;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
4
12
|
data: {
|
|
5
13
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
6
14
|
default: () => never[];
|
|
@@ -33,14 +41,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
33
41
|
type: import("vue-demi").PropType<string>;
|
|
34
42
|
default: undefined;
|
|
35
43
|
};
|
|
36
|
-
background: {
|
|
37
|
-
type: import("vue-demi").PropType<string>;
|
|
38
|
-
default: undefined;
|
|
39
|
-
};
|
|
40
|
-
columns: {
|
|
41
|
-
type: import("vue-demi").PropType<any>;
|
|
42
|
-
default: () => never[];
|
|
43
|
-
};
|
|
44
44
|
selectEmptyWarningTips: {
|
|
45
45
|
type: import("vue-demi").PropType<string>;
|
|
46
46
|
default: string;
|
|
@@ -320,7 +320,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
320
320
|
resizable?: boolean | undefined;
|
|
321
321
|
formatter?: Function | undefined;
|
|
322
322
|
'show-overflow-tooltip'?: boolean | undefined;
|
|
323
|
-
align?: "
|
|
323
|
+
align?: "left" | "right" | "center" | undefined;
|
|
324
324
|
'class-name'?: string | undefined;
|
|
325
325
|
'label-class-name'?: string | undefined;
|
|
326
326
|
selectable?: Function | undefined;
|
|
@@ -329,19 +329,27 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
329
329
|
text?: string | number | undefined;
|
|
330
330
|
value?: string | number | undefined;
|
|
331
331
|
}[] | undefined;
|
|
332
|
-
'filter-placement'?: "
|
|
332
|
+
'filter-placement'?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
333
333
|
'filter-multiple'?: boolean | undefined;
|
|
334
334
|
'filter-method'?: Function | undefined;
|
|
335
335
|
'filtered-value'?: string[] | undefined;
|
|
336
336
|
} | undefined;
|
|
337
337
|
}[]>;
|
|
338
|
-
syncLocalShowColumnToCookies: () =>
|
|
338
|
+
syncLocalShowColumnToCookies: () => void;
|
|
339
339
|
syncCookiesToLocalShowColumn: () => Promise<void>;
|
|
340
340
|
syncCookiesToTableColumn: (readCached?: boolean) => Promise<void>;
|
|
341
341
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
342
342
|
fieldsChange: (event: string[]) => void;
|
|
343
343
|
"update:showColumn": (event: string[] | undefined) => void;
|
|
344
344
|
}, string, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
345
|
+
background: {
|
|
346
|
+
type: import("vue-demi").PropType<string>;
|
|
347
|
+
default: undefined;
|
|
348
|
+
};
|
|
349
|
+
columns: {
|
|
350
|
+
type: import("vue-demi").PropType<any>;
|
|
351
|
+
default: () => never[];
|
|
352
|
+
};
|
|
345
353
|
data: {
|
|
346
354
|
type: import("vue-demi").PropType<Record<string, any>[]>;
|
|
347
355
|
default: () => never[];
|
|
@@ -374,14 +382,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
374
382
|
type: import("vue-demi").PropType<string>;
|
|
375
383
|
default: undefined;
|
|
376
384
|
};
|
|
377
|
-
background: {
|
|
378
|
-
type: import("vue-demi").PropType<string>;
|
|
379
|
-
default: undefined;
|
|
380
|
-
};
|
|
381
|
-
columns: {
|
|
382
|
-
type: import("vue-demi").PropType<any>;
|
|
383
|
-
default: () => never[];
|
|
384
|
-
};
|
|
385
385
|
selectEmptyWarningTips: {
|
|
386
386
|
type: import("vue-demi").PropType<string>;
|
|
387
387
|
default: string;
|
|
@@ -605,6 +605,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
605
605
|
default: boolean;
|
|
606
606
|
};
|
|
607
607
|
}>>, {
|
|
608
|
+
background: string;
|
|
609
|
+
columns: NfTableColumnAttributes[] | any;
|
|
608
610
|
data: Record<string, any>[];
|
|
609
611
|
columnEdit: boolean;
|
|
610
612
|
operationPropKey: string;
|
|
@@ -613,8 +615,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
613
615
|
customClass: string;
|
|
614
616
|
body: boolean;
|
|
615
617
|
text: string;
|
|
616
|
-
background: string;
|
|
617
|
-
columns: NfTableColumnAttributes[] | any;
|
|
618
618
|
selectEmptyWarningTips: string;
|
|
619
619
|
showColumn: string[];
|
|
620
620
|
searchFormAttrs: NfSearchFormAttributes;
|
|
@@ -745,7 +745,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
745
745
|
resizable?: boolean | undefined;
|
|
746
746
|
formatter?: Function | undefined;
|
|
747
747
|
'show-overflow-tooltip'?: boolean | undefined;
|
|
748
|
-
align?: "
|
|
748
|
+
align?: "left" | "right" | "center" | undefined;
|
|
749
749
|
'class-name'?: string | undefined;
|
|
750
750
|
'label-class-name'?: string | undefined;
|
|
751
751
|
selectable?: Function | undefined;
|
|
@@ -754,7 +754,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
754
754
|
text?: string | number | undefined;
|
|
755
755
|
value?: string | number | undefined;
|
|
756
756
|
}[] | undefined;
|
|
757
|
-
'filter-placement'?: "
|
|
757
|
+
'filter-placement'?: "bottom" | "left" | "right" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end" | undefined;
|
|
758
758
|
'filter-multiple'?: boolean | undefined;
|
|
759
759
|
'filter-method'?: Function | undefined;
|
|
760
760
|
'filtered-value'?: string[] | undefined;
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
onMounted,
|
|
61
61
|
ref
|
|
62
62
|
} from 'vue-demi'
|
|
63
|
-
import {
|
|
63
|
+
import { CachedManager } from '@94ai/common-utils'
|
|
64
64
|
|
|
65
65
|
const props = withDefaults(defineProps<{
|
|
66
66
|
/**
|
|
@@ -156,7 +156,7 @@ const fields = computed(() => {
|
|
|
156
156
|
return fields
|
|
157
157
|
})
|
|
158
158
|
|
|
159
|
-
const submit =
|
|
159
|
+
const submit = () => {
|
|
160
160
|
visible.value = false
|
|
161
161
|
const columnState = {}
|
|
162
162
|
props.tableColumns.map((i, index) => {
|
|
@@ -169,7 +169,7 @@ const submit = async () => {
|
|
|
169
169
|
})
|
|
170
170
|
emit('save', tableData.value)
|
|
171
171
|
if (props.columnEdit) {
|
|
172
|
-
|
|
172
|
+
CachedManager.syncCachedSet(props.storageKey, columnState)
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
getCurrentInstance,
|
|
140
140
|
} from 'vue-demi'
|
|
141
141
|
import { deepClone } from '@94ai/common-utils'
|
|
142
|
-
import {
|
|
142
|
+
import { CachedManager } from '@94ai/common-utils'
|
|
143
143
|
|
|
144
144
|
const instance = getCurrentInstance()?.proxy
|
|
145
145
|
|
|
@@ -354,7 +354,7 @@ const handleFixed = (v, prop) => {
|
|
|
354
354
|
/**
|
|
355
355
|
* 确定
|
|
356
356
|
*/
|
|
357
|
-
const syncTableColumnsToCookies =
|
|
357
|
+
const syncTableColumnsToCookies = () => {
|
|
358
358
|
const newTableColumns = [...fixedColumn.value, ...unFixedColumn.value]
|
|
359
359
|
if (newTableColumns.filter(item => !item.type && item.prop !== props.operationPropKey && !item.initHidden).length === 0) {
|
|
360
360
|
// @ts-ignore
|
|
@@ -385,7 +385,7 @@ const syncTableColumnsToCookies = async () => {
|
|
|
385
385
|
obj[i.prop] = !columnState[i.prop].initHidden
|
|
386
386
|
})
|
|
387
387
|
if (props.columnEdit) {
|
|
388
|
-
|
|
388
|
+
CachedManager.syncCachedSet(props.storageKey, columnState)
|
|
389
389
|
}
|
|
390
390
|
return obj
|
|
391
391
|
}
|
package/package/nf-table.vue
CHANGED
|
@@ -564,7 +564,7 @@ import {
|
|
|
564
564
|
NfTableActionBtnAttributes
|
|
565
565
|
} from './types'
|
|
566
566
|
import { ITabItem } from '@94ai/nf-drawer/lib/types'
|
|
567
|
-
import {
|
|
567
|
+
import { CachedManager } from '@94ai/common-utils'
|
|
568
568
|
|
|
569
569
|
const props = withDefaults(defineProps<{
|
|
570
570
|
data?: Record<string, any>[],
|
|
@@ -831,7 +831,7 @@ watch(() => localShowColumn.value?.length, () => {
|
|
|
831
831
|
immediate: true
|
|
832
832
|
})
|
|
833
833
|
|
|
834
|
-
const syncLocalShowColumnToCookies =
|
|
834
|
+
const syncLocalShowColumnToCookies = () => {
|
|
835
835
|
if (props.columnEdit) {
|
|
836
836
|
const columnState = {}
|
|
837
837
|
props.columns.map((i, index) => {
|
|
@@ -843,7 +843,7 @@ const syncLocalShowColumnToCookies = async () => {
|
|
|
843
843
|
index
|
|
844
844
|
}
|
|
845
845
|
})
|
|
846
|
-
|
|
846
|
+
CachedManager.syncCachedSet(props.storageKey, columnState)
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
849
|
|
|
@@ -864,7 +864,10 @@ const syncShowItemToInitHidden = () => {
|
|
|
864
864
|
const syncCookiesToLocalShowColumn = async () => {
|
|
865
865
|
if (props.columnEdit) {
|
|
866
866
|
try {
|
|
867
|
-
let columnState: string | NfTableColumnAttributes | undefined =
|
|
867
|
+
let columnState: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
|
|
868
|
+
if (!columnState) {
|
|
869
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey)
|
|
870
|
+
}
|
|
868
871
|
if (columnState) {
|
|
869
872
|
if (typeof columnState === 'string') {
|
|
870
873
|
columnState = JSON.parse(columnState)
|
|
@@ -888,16 +891,18 @@ const initCachedData = async () => {
|
|
|
888
891
|
if (props.columnEdit) {
|
|
889
892
|
// 同步缓存参数
|
|
890
893
|
try {
|
|
891
|
-
|
|
894
|
+
let cached: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
|
|
895
|
+
if (!cached) {
|
|
896
|
+
cached = await CachedManager.asyncCachedGet(props.storageKey)
|
|
897
|
+
}
|
|
892
898
|
const cachedPriority = props.priority === 'cached'
|
|
893
899
|
if (cachedPriority ? cached : localShowColumn.value?.length) {
|
|
894
|
-
cachedPriority ? await syncCookiesToLocalShowColumn() :
|
|
900
|
+
cachedPriority ? await syncCookiesToLocalShowColumn() : syncLocalShowColumnToCookies()
|
|
895
901
|
} else if (cachedPriority ? localShowColumn.value?.length : cached) {
|
|
896
|
-
cachedPriority ?
|
|
902
|
+
cachedPriority ? syncLocalShowColumnToCookies() : await syncCookiesToLocalShowColumn()
|
|
897
903
|
}
|
|
898
904
|
} catch (e) {
|
|
899
905
|
console.log(e)
|
|
900
|
-
await del(props.storageKey)
|
|
901
906
|
}
|
|
902
907
|
}
|
|
903
908
|
}
|
|
@@ -942,7 +947,10 @@ const syncCookiesToTableColumn = async (readCached = true) => {
|
|
|
942
947
|
if (readCached && props.columnEdit) {
|
|
943
948
|
// 读取缓存 Column 配置
|
|
944
949
|
try {
|
|
945
|
-
let columnState: string | NfTableColumnAttributes | undefined =
|
|
950
|
+
let columnState: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
|
|
951
|
+
if (!columnState) {
|
|
952
|
+
columnState = await CachedManager.asyncCachedGet(props.storageKey)
|
|
953
|
+
}
|
|
946
954
|
props.columns._skip = true
|
|
947
955
|
if (columnState) {
|
|
948
956
|
if (typeof columnState === 'string') {
|
|
@@ -963,7 +971,6 @@ const syncCookiesToTableColumn = async (readCached = true) => {
|
|
|
963
971
|
}
|
|
964
972
|
} catch (e) {
|
|
965
973
|
console.log(e)
|
|
966
|
-
await del(props.storageKey)
|
|
967
974
|
}
|
|
968
975
|
}
|
|
969
976
|
await nextTick()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-table",
|
|
3
|
-
"version": "100.1.
|
|
3
|
+
"version": "100.1.19",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/common-utils": "^100.1.
|
|
18
|
-
"@94ai/nf-drawer": "^100.1.
|
|
19
|
-
"@94ai/nf-message": "^100.1.
|
|
20
|
-
"@94ai/nf-search-form": "^100.1.
|
|
21
|
-
"@94ai/nf-theme-chalk": "^100.1.
|
|
17
|
+
"@94ai/common-utils": "^100.1.19",
|
|
18
|
+
"@94ai/nf-drawer": "^100.1.19",
|
|
19
|
+
"@94ai/nf-message": "^100.1.19",
|
|
20
|
+
"@94ai/nf-search-form": "^100.1.19",
|
|
21
|
+
"@94ai/nf-theme-chalk": "^100.1.19",
|
|
22
22
|
"idb-keyval": "^6.2.1",
|
|
23
23
|
"vue-demi": "^0.14.5",
|
|
24
24
|
"vuedraggable": "^2.24.3"
|