@94ai/nf-table 100.1.44 → 100.1.46
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 +92 -120
- package/lib/nf-column-check-dialog.vue.d.ts +9 -0
- package/lib/nf-column-check-drawer.vue.d.ts +12 -12
- package/lib/nf-table.cjs.js +87 -77
- package/lib/nf-table.esm-bundler.js +87 -77
- package/lib/nf-table.vue.d.ts +32 -42
- package/package/nf-column-check-dialog.vue +6 -1
- package/package/nf-column-check-drawer.vue +17 -14
- package/package/nf-table.vue +53 -30
- package/package.json +8 -8
package/lib/nf-table.vue.d.ts
CHANGED
|
@@ -49,14 +49,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
49
49
|
type: import("vue-demi").PropType<string[]>;
|
|
50
50
|
default: undefined;
|
|
51
51
|
};
|
|
52
|
-
dragCached: {
|
|
53
|
-
type: import("vue-demi").PropType<boolean>;
|
|
54
|
-
default: boolean;
|
|
55
|
-
};
|
|
56
|
-
emptyImageSize: {
|
|
57
|
-
type: import("vue-demi").PropType<number>;
|
|
58
|
-
default: number;
|
|
59
|
-
};
|
|
60
52
|
searchFormAttrs: {
|
|
61
53
|
type: import("vue-demi").PropType<NfSearchFormAttributes>;
|
|
62
54
|
default: () => {};
|
|
@@ -85,6 +77,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
85
77
|
type: import("vue-demi").PropType<NfTableActionBtnAttributes[]>;
|
|
86
78
|
default: () => never[];
|
|
87
79
|
};
|
|
80
|
+
dragCached: {
|
|
81
|
+
type: import("vue-demi").PropType<boolean>;
|
|
82
|
+
default: boolean;
|
|
83
|
+
};
|
|
84
|
+
emptyImageSize: {
|
|
85
|
+
type: import("vue-demi").PropType<number>;
|
|
86
|
+
default: number;
|
|
87
|
+
};
|
|
88
88
|
calHeight: {
|
|
89
89
|
type: import("vue-demi").PropType<boolean>;
|
|
90
90
|
default: boolean;
|
|
@@ -157,15 +157,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
157
157
|
type: import("vue-demi").PropType<string>;
|
|
158
158
|
default: string;
|
|
159
159
|
};
|
|
160
|
-
|
|
161
|
-
type: import("vue-demi").PropType<string>;
|
|
162
|
-
default: string;
|
|
163
|
-
};
|
|
164
|
-
columnCheckConfirmText: {
|
|
160
|
+
columnCheckBasicFieldDesc: {
|
|
165
161
|
type: import("vue-demi").PropType<string>;
|
|
166
162
|
default: string;
|
|
167
163
|
};
|
|
168
|
-
|
|
164
|
+
columnCheckWidth: {
|
|
169
165
|
type: import("vue-demi").PropType<string>;
|
|
170
166
|
default: string;
|
|
171
167
|
};
|
|
@@ -237,10 +233,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
237
233
|
type: import("vue-demi").PropType<string>;
|
|
238
234
|
default: string;
|
|
239
235
|
};
|
|
240
|
-
columnCheckBasicFieldDesc: {
|
|
241
|
-
type: import("vue-demi").PropType<string>;
|
|
242
|
-
default: string;
|
|
243
|
-
};
|
|
244
236
|
columnCheckGetCheckedLengthDesc: {
|
|
245
237
|
type: import("vue-demi").PropType<Function>;
|
|
246
238
|
default: (length: any) => string;
|
|
@@ -275,6 +267,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
275
267
|
type: import("vue-demi").PropType<boolean>;
|
|
276
268
|
default: boolean;
|
|
277
269
|
};
|
|
270
|
+
searchForm: {
|
|
271
|
+
type: import("vue-demi").PropType<any>;
|
|
272
|
+
required: true;
|
|
273
|
+
};
|
|
278
274
|
}, {
|
|
279
275
|
clearFilter: () => void;
|
|
280
276
|
sort: (prop: any, order: any) => void;
|
|
@@ -350,7 +346,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
350
346
|
calcTableHeight: () => void;
|
|
351
347
|
syncLocalShowColumnToCookies: () => void;
|
|
352
348
|
syncCookiesToLocalShowColumn: () => Promise<void>;
|
|
353
|
-
syncCookiesToTableColumn: (readCached?: boolean) => Promise<void>;
|
|
349
|
+
syncCookiesToTableColumn: (readCached?: boolean, init?: boolean) => Promise<void>;
|
|
354
350
|
elTableRefKey: import("vue-demi").Ref<number>;
|
|
355
351
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
356
352
|
fieldsChange: (event: string[]) => void;
|
|
@@ -404,14 +400,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
404
400
|
type: import("vue-demi").PropType<string[]>;
|
|
405
401
|
default: undefined;
|
|
406
402
|
};
|
|
407
|
-
dragCached: {
|
|
408
|
-
type: import("vue-demi").PropType<boolean>;
|
|
409
|
-
default: boolean;
|
|
410
|
-
};
|
|
411
|
-
emptyImageSize: {
|
|
412
|
-
type: import("vue-demi").PropType<number>;
|
|
413
|
-
default: number;
|
|
414
|
-
};
|
|
415
403
|
searchFormAttrs: {
|
|
416
404
|
type: import("vue-demi").PropType<NfSearchFormAttributes>;
|
|
417
405
|
default: () => {};
|
|
@@ -440,6 +428,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
440
428
|
type: import("vue-demi").PropType<NfTableActionBtnAttributes[]>;
|
|
441
429
|
default: () => never[];
|
|
442
430
|
};
|
|
431
|
+
dragCached: {
|
|
432
|
+
type: import("vue-demi").PropType<boolean>;
|
|
433
|
+
default: boolean;
|
|
434
|
+
};
|
|
435
|
+
emptyImageSize: {
|
|
436
|
+
type: import("vue-demi").PropType<number>;
|
|
437
|
+
default: number;
|
|
438
|
+
};
|
|
443
439
|
calHeight: {
|
|
444
440
|
type: import("vue-demi").PropType<boolean>;
|
|
445
441
|
default: boolean;
|
|
@@ -512,15 +508,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
512
508
|
type: import("vue-demi").PropType<string>;
|
|
513
509
|
default: string;
|
|
514
510
|
};
|
|
515
|
-
|
|
516
|
-
type: import("vue-demi").PropType<string>;
|
|
517
|
-
default: string;
|
|
518
|
-
};
|
|
519
|
-
columnCheckConfirmText: {
|
|
511
|
+
columnCheckBasicFieldDesc: {
|
|
520
512
|
type: import("vue-demi").PropType<string>;
|
|
521
513
|
default: string;
|
|
522
514
|
};
|
|
523
|
-
|
|
515
|
+
columnCheckWidth: {
|
|
524
516
|
type: import("vue-demi").PropType<string>;
|
|
525
517
|
default: string;
|
|
526
518
|
};
|
|
@@ -592,10 +584,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
592
584
|
type: import("vue-demi").PropType<string>;
|
|
593
585
|
default: string;
|
|
594
586
|
};
|
|
595
|
-
columnCheckBasicFieldDesc: {
|
|
596
|
-
type: import("vue-demi").PropType<string>;
|
|
597
|
-
default: string;
|
|
598
|
-
};
|
|
599
587
|
columnCheckGetCheckedLengthDesc: {
|
|
600
588
|
type: import("vue-demi").PropType<Function>;
|
|
601
589
|
default: (length: any) => string;
|
|
@@ -630,6 +618,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
630
618
|
type: import("vue-demi").PropType<boolean>;
|
|
631
619
|
default: boolean;
|
|
632
620
|
};
|
|
621
|
+
searchForm: {
|
|
622
|
+
type: import("vue-demi").PropType<any>;
|
|
623
|
+
required: true;
|
|
624
|
+
};
|
|
633
625
|
}>>, {
|
|
634
626
|
background: string;
|
|
635
627
|
columns: NfTableColumnAttributes[] | any;
|
|
@@ -643,8 +635,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
643
635
|
text: string;
|
|
644
636
|
selectEmptyWarningTips: string;
|
|
645
637
|
showColumn: string[];
|
|
646
|
-
dragCached: boolean;
|
|
647
|
-
emptyImageSize: number;
|
|
648
638
|
searchFormAttrs: NfSearchFormAttributes;
|
|
649
639
|
searchFormEvents: Partial<Record<NfSearchFormEventKey, Function>>;
|
|
650
640
|
tableAttrs: ElTableAttributes;
|
|
@@ -652,6 +642,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
652
642
|
pageAttrs: ElPaginationAttributes;
|
|
653
643
|
pageEvents: Partial<Record<ElPaginationEventKey, Function>>;
|
|
654
644
|
actionBarOptList: NfTableActionBtnAttributes[];
|
|
645
|
+
dragCached: boolean;
|
|
646
|
+
emptyImageSize: number;
|
|
655
647
|
calHeight: boolean;
|
|
656
648
|
columnPosition: 'free' | 'embed';
|
|
657
649
|
checkMode: 'dialog' | 'drawer';
|
|
@@ -670,9 +662,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
670
662
|
columnCheckTitle: string;
|
|
671
663
|
columnCheckCancelButtonText: string;
|
|
672
664
|
columnCheckConfirmButtonText: string;
|
|
665
|
+
columnCheckBasicFieldDesc: string;
|
|
673
666
|
columnCheckWidth: string;
|
|
674
|
-
columnCheckConfirmText: string;
|
|
675
|
-
columnCheckCancelText: string;
|
|
676
667
|
columnCheckModalAppendToBody: boolean;
|
|
677
668
|
columnCheckModal: boolean;
|
|
678
669
|
columnCheckFullscreen: boolean;
|
|
@@ -690,7 +681,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
|
|
|
690
681
|
columnCheckFixedLeftDesc: string;
|
|
691
682
|
columnCheckClearDesc: string;
|
|
692
683
|
columnCheckNoFixedDesc: string;
|
|
693
|
-
columnCheckBasicFieldDesc: string;
|
|
694
684
|
columnCheckGetCheckedLengthDesc: Function;
|
|
695
685
|
columnCheckGetAllCheckDesc: Function;
|
|
696
686
|
loading: boolean;
|
|
@@ -74,6 +74,7 @@ const props = withDefaults(defineProps<{
|
|
|
74
74
|
width?: string,
|
|
75
75
|
confirmText?: string
|
|
76
76
|
cancelText?: string
|
|
77
|
+
basicFieldDesc?: string
|
|
77
78
|
tableColumns?: Record<string, any>[],
|
|
78
79
|
modalAppendToBody?: boolean,
|
|
79
80
|
modal?: boolean,
|
|
@@ -95,6 +96,10 @@ const props = withDefaults(defineProps<{
|
|
|
95
96
|
show: false,
|
|
96
97
|
width: '600px',
|
|
97
98
|
title: '设置显示字段',
|
|
99
|
+
/**
|
|
100
|
+
* 默认category分类标题
|
|
101
|
+
*/
|
|
102
|
+
basicFieldDesc: '基础字段',
|
|
98
103
|
cancelText: '取 消',
|
|
99
104
|
confirmText: '保 存',
|
|
100
105
|
tableColumns: () => [],
|
|
@@ -139,7 +144,7 @@ const fields = computed(() => {
|
|
|
139
144
|
const obj: Record<string, any> = {}
|
|
140
145
|
props.tableColumns.filter(item => !item.destory).map(item => {
|
|
141
146
|
if (!item.type) {
|
|
142
|
-
const key = item.category ||
|
|
147
|
+
const key = item.category || props.basicFieldDesc
|
|
143
148
|
if (!obj[key]) {
|
|
144
149
|
obj[key] = []
|
|
145
150
|
}
|
|
@@ -145,35 +145,38 @@ const instance = getCurrentInstance()?.proxy
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
const props = withDefaults(defineProps<{
|
|
148
|
-
selectEmptyWarningTips?: string,
|
|
149
|
-
// 源序列
|
|
150
|
-
tableColumns?: Record<string, any>[],
|
|
151
|
-
storageKey?: string
|
|
152
|
-
operationPropKey?: string
|
|
153
|
-
/**
|
|
154
|
-
* 列编辑显示开关
|
|
155
|
-
*/
|
|
156
|
-
columnEdit?: boolean,
|
|
157
148
|
searchPlaceholder?: string
|
|
158
149
|
fixedLeftDesc?: string
|
|
159
150
|
clearDesc?: string
|
|
160
151
|
noFixedDesc?: string
|
|
152
|
+
/**
|
|
153
|
+
* 默认category分类标题
|
|
154
|
+
*/
|
|
161
155
|
basicFieldDesc?: string
|
|
156
|
+
selectEmptyWarningTips?: string
|
|
162
157
|
getCheckedLengthDesc?: Function
|
|
163
158
|
getAllCheckDesc?: Function
|
|
159
|
+
/**
|
|
160
|
+
* 列编辑显示开关
|
|
161
|
+
*/
|
|
162
|
+
columnEdit?: boolean,
|
|
163
|
+
// 源序列
|
|
164
|
+
tableColumns?: Record<string, any>[],
|
|
165
|
+
storageKey?: string
|
|
166
|
+
operationPropKey?: string
|
|
164
167
|
}>(), {
|
|
165
|
-
columnEdit: false,
|
|
166
168
|
selectEmptyWarningTips: '请选择至少一个选项',
|
|
167
|
-
tableColumns: () => [],
|
|
168
|
-
storageKey: 'nf-table-columns-cached-key',
|
|
169
|
-
operationPropKey: 'operation',
|
|
170
169
|
searchPlaceholder: '搜索',
|
|
171
170
|
fixedLeftDesc: '固定在左侧',
|
|
172
171
|
clearDesc: '清除',
|
|
173
172
|
noFixedDesc: '不固定',
|
|
174
173
|
basicFieldDesc: '基础字段',
|
|
175
174
|
getCheckedLengthDesc: (length) => '已选(' + length + ')',
|
|
176
|
-
getAllCheckDesc: (length) => '全选(' + length + ')'
|
|
175
|
+
getAllCheckDesc: (length) => '全选(' + length + ')',
|
|
176
|
+
tableColumns: () => [],
|
|
177
|
+
columnEdit: false,
|
|
178
|
+
storageKey: 'nf-table-columns-cached-key',
|
|
179
|
+
operationPropKey: 'operation',
|
|
177
180
|
})
|
|
178
181
|
|
|
179
182
|
// 获取当前缓存中的动态数据列
|
package/package/nf-table.vue
CHANGED
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
ref="nfSearchFormRef"
|
|
6
6
|
v-bind="searchFormAttrs"
|
|
7
7
|
v-on="searchFormEvents"
|
|
8
|
-
:operation-prop-key="operationPropKey"
|
|
9
|
-
:storage-key="searchFormStorageKey"
|
|
10
|
-
:property="priority"
|
|
11
|
-
:select-empty-warning-tips="selectEmptyWarningTips"
|
|
12
8
|
>
|
|
13
9
|
<template v-for="item in (nfSearchFormRef?.renderSearchFormItemOptions || [])">
|
|
14
10
|
<!-- 定制化SearchItem?提示-->
|
|
@@ -458,16 +454,16 @@
|
|
|
458
454
|
</div>
|
|
459
455
|
</div>
|
|
460
456
|
<column-check-dialog
|
|
461
|
-
|
|
457
|
+
:title="columnCheckTitle"
|
|
458
|
+
:confirm-text="columnCheckConfirmButtonText"
|
|
459
|
+
:cancel-text="columnCheckCancelButtonText"
|
|
460
|
+
:basic-field-desc="columnCheckBasicFieldDesc"
|
|
461
|
+
|
|
462
462
|
:show.sync="nfColumCheckDialogVisible"
|
|
463
463
|
:table-columns="columns"
|
|
464
464
|
:column-edit="columnEdit"
|
|
465
465
|
:storage-key="storageKey"
|
|
466
|
-
@save="fieldsConfirm"
|
|
467
|
-
:title="columnCheckTitle"
|
|
468
466
|
:width="columnCheckWidth"
|
|
469
|
-
:confirm-text="columnCheckConfirmText"
|
|
470
|
-
:cancel-text="columnCheckCancelText"
|
|
471
467
|
:modal-append-to-body="columnCheckModalAppendToBody"
|
|
472
468
|
:modal="columnCheckModal"
|
|
473
469
|
:fullscreen="columnCheckFullscreen"
|
|
@@ -481,23 +477,28 @@
|
|
|
481
477
|
:before-close="columnCheckBeforeClose"
|
|
482
478
|
:center="columnCheckCenter"
|
|
483
479
|
:destroy-on-close="columnCheckDestroyOnClose"
|
|
484
|
-
ref="columnCheckDialog"
|
|
485
480
|
:operation-prop-key="operationPropKey"
|
|
481
|
+
|
|
482
|
+
v-if="nfColumCheckDialogVisible && checkMode === 'dialog'"
|
|
483
|
+
ref="columnCheckDialog"
|
|
484
|
+
@save="fieldsConfirm"
|
|
486
485
|
>
|
|
487
486
|
<slot slot="tableColumnEditDialogTitle" name="title"></slot>
|
|
488
487
|
<slot slot="tableColumnEditDialogFooter" name="footer"></slot>
|
|
489
488
|
</column-check-dialog>
|
|
490
489
|
<nf-drawer
|
|
491
|
-
ref="columnCheckNfDrawer"
|
|
492
|
-
size="680px"
|
|
493
|
-
v-if="checkMode === 'drawer'"
|
|
494
490
|
:title="columnCheckTitle"
|
|
495
491
|
:cancel-button-text="columnCheckCancelButtonText"
|
|
496
492
|
:confirm-button-text="columnCheckConfirmButtonText"
|
|
493
|
+
|
|
494
|
+
ref="columnCheckNfDrawer"
|
|
495
|
+
size="680px"
|
|
497
496
|
:visible.sync="nfColumCheckDialogVisible"
|
|
498
497
|
:tabs="columnCheckTabs"
|
|
499
498
|
:destroy-on-close="true"
|
|
500
499
|
:currentTab="columnCheckCurrentTab"
|
|
500
|
+
|
|
501
|
+
v-if="checkMode === 'drawer'"
|
|
501
502
|
@confirm="columnCheckConfirm"
|
|
502
503
|
@changeTab="(done) => $emit('changeTab', done)"
|
|
503
504
|
@cancel="(name) => $emit('cancel', name)"
|
|
@@ -510,14 +511,15 @@
|
|
|
510
511
|
:clear-desc="columnCheckClearDesc"
|
|
511
512
|
:no-fixed-desc="columnCheckNoFixedDesc"
|
|
512
513
|
:basic-field-desc="columnCheckBasicFieldDesc"
|
|
513
|
-
:
|
|
514
|
+
:select-empty-warning-tips="selectEmptyWarningTips"
|
|
514
515
|
:get-checked-length-desc="columnCheckGetCheckedLengthDesc"
|
|
515
516
|
:get-all-check-desc="columnCheckGetAllCheckDesc"
|
|
516
|
-
:operation-prop-key="operationPropKey"
|
|
517
517
|
ref="columnCheckDrawer"
|
|
518
|
+
|
|
519
|
+
:column-edit="columnEdit"
|
|
520
|
+
:operation-prop-key="operationPropKey"
|
|
518
521
|
:storage-key="storageKey"
|
|
519
522
|
:table-columns="columns"
|
|
520
|
-
:select-empty-warning-tips="selectEmptyWarningTips"
|
|
521
523
|
/>
|
|
522
524
|
</nf-drawer>
|
|
523
525
|
</div>
|
|
@@ -561,8 +563,6 @@ import { ITabItem } from '@94ai/nf-drawer/lib/types'
|
|
|
561
563
|
import { CachedManager } from '@94ai/common-utils'
|
|
562
564
|
|
|
563
565
|
const props = withDefaults(defineProps<{
|
|
564
|
-
dragCached?: boolean,
|
|
565
|
-
emptyImageSize?: number,
|
|
566
566
|
data?: Record<string, any>[],
|
|
567
567
|
columns?: NfTableColumnAttributes[] | any,
|
|
568
568
|
searchFormAttrs?: NfSearchFormAttributes,
|
|
@@ -572,6 +572,14 @@ const props = withDefaults(defineProps<{
|
|
|
572
572
|
pageAttrs?: ElPaginationAttributes,
|
|
573
573
|
pageEvents?: Partial<Record<ElPaginationEventKey, Function>>,
|
|
574
574
|
actionBarOptList?: NfTableActionBtnAttributes[],
|
|
575
|
+
/**
|
|
576
|
+
* 开启表格列拖拽缓存记录
|
|
577
|
+
*/
|
|
578
|
+
dragCached?: boolean,
|
|
579
|
+
/**
|
|
580
|
+
* 表格空数据时空组件size
|
|
581
|
+
*/
|
|
582
|
+
emptyImageSize?: number,
|
|
575
583
|
/**
|
|
576
584
|
* 固定窗口满屏table自动计算table高度
|
|
577
585
|
*/
|
|
@@ -609,12 +617,11 @@ const props = withDefaults(defineProps<{
|
|
|
609
617
|
columnCheckTitle?: string,
|
|
610
618
|
columnCheckCancelButtonText?: string,
|
|
611
619
|
columnCheckConfirmButtonText?: string,
|
|
620
|
+
columnCheckBasicFieldDesc?: string
|
|
612
621
|
/**
|
|
613
622
|
* 列编辑dialog模式
|
|
614
623
|
*/
|
|
615
624
|
columnCheckWidth?: string,
|
|
616
|
-
columnCheckConfirmText?: string
|
|
617
|
-
columnCheckCancelText?: string
|
|
618
625
|
columnCheckModalAppendToBody?: boolean,
|
|
619
626
|
columnCheckModal?: boolean,
|
|
620
627
|
columnCheckFullscreen?: boolean,
|
|
@@ -635,7 +642,6 @@ const props = withDefaults(defineProps<{
|
|
|
635
642
|
columnCheckFixedLeftDesc?: string
|
|
636
643
|
columnCheckClearDesc?: string
|
|
637
644
|
columnCheckNoFixedDesc?: string
|
|
638
|
-
columnCheckBasicFieldDesc?: string
|
|
639
645
|
columnCheckGetCheckedLengthDesc?: Function
|
|
640
646
|
columnCheckGetAllCheckDesc?: Function
|
|
641
647
|
columnCheckTabs?: ITabItem[],
|
|
@@ -662,10 +668,15 @@ const props = withDefaults(defineProps<{
|
|
|
662
668
|
* 操作列属性key
|
|
663
669
|
*/
|
|
664
670
|
operationPropKey?: string
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* searchForm属性
|
|
675
|
+
*/
|
|
676
|
+
searchForm
|
|
665
677
|
}>(), {
|
|
666
678
|
dragCached: true,
|
|
667
679
|
emptyImageSize: 145,
|
|
668
|
-
selectEmptyWarningTips: '请选择至少一个选项',
|
|
669
680
|
priority: 'cached',
|
|
670
681
|
storageKey: 'nf-table-columns-cached-key',
|
|
671
682
|
searchFormStorageKey: 'nf-search-form-columns-cached-key',
|
|
@@ -700,14 +711,10 @@ const props = withDefaults(defineProps<{
|
|
|
700
711
|
columnDisplayBtnCircle: false,
|
|
701
712
|
columnDisplayBtnLoading: false,
|
|
702
713
|
columnDisplayBtnDisabled: false,
|
|
703
|
-
columnDisplayBtnText: '设置列表字段',
|
|
704
714
|
columnDisplayBtnClass: '',
|
|
705
715
|
alwaysShowPage: true,
|
|
706
716
|
operationPropKey: 'operation',
|
|
707
|
-
columnCheckTitle: '设置显示字段',
|
|
708
717
|
columnCheckWidth: '600px',
|
|
709
|
-
columnCheckConfirmText: '保 存',
|
|
710
|
-
columnCheckCancelText: '取 消',
|
|
711
718
|
columnCheckModalAppendToBody: true,
|
|
712
719
|
columnCheckModal: true,
|
|
713
720
|
columnCheckFullscreen: false,
|
|
@@ -721,6 +728,9 @@ const props = withDefaults(defineProps<{
|
|
|
721
728
|
columnCheckBeforeClose: undefined,
|
|
722
729
|
columnCheckCenter: false,
|
|
723
730
|
columnCheckDestroyOnClose: false,
|
|
731
|
+
selectEmptyWarningTips: '请选择至少一个选项',
|
|
732
|
+
columnDisplayBtnText: '设置列表字段',
|
|
733
|
+
columnCheckTitle: '设置显示字段',
|
|
724
734
|
columnCheckCancelButtonText: '取消',
|
|
725
735
|
columnCheckConfirmButtonText: '确定',
|
|
726
736
|
columnCheckSearchPlaceholder: '搜索',
|
|
@@ -909,6 +919,9 @@ const initCachedData = async () => {
|
|
|
909
919
|
console.log(e)
|
|
910
920
|
}
|
|
911
921
|
}
|
|
922
|
+
if (props.dragCached) {
|
|
923
|
+
await CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`)
|
|
924
|
+
}
|
|
912
925
|
}
|
|
913
926
|
|
|
914
927
|
const getMinWidth = (column) => {
|
|
@@ -924,7 +937,7 @@ const getMinWidth = (column) => {
|
|
|
924
937
|
|
|
925
938
|
const tableColumns = ref<NfTableColumnAttributes[]>([])
|
|
926
939
|
const elTableRefKey = ref(Date.now())
|
|
927
|
-
const syncCookiesToTableColumn = async (readCached = true) => {
|
|
940
|
+
const syncCookiesToTableColumn = async (readCached = true, init = false) => {
|
|
928
941
|
props.columns._skip = true
|
|
929
942
|
const columns = props.columns!.map((item, index) => {
|
|
930
943
|
const attr = (item.attr || {}) as ElTableColumnAttributes
|
|
@@ -932,6 +945,13 @@ const syncCookiesToTableColumn = async (readCached = true) => {
|
|
|
932
945
|
if (!attr['min-width'] && item.label) {
|
|
933
946
|
attr['min-width'] = String(getMinWidth(item)) + 'px'
|
|
934
947
|
}
|
|
948
|
+
if (init && props.dragCached) {
|
|
949
|
+
const prop = item.prop || item.attr?.prop
|
|
950
|
+
let columnWidth = CachedManager.syncCachedGet(`${props.storageKey}$drag-column-width`) || {}
|
|
951
|
+
if (columnWidth[prop]) { // 读取缓存
|
|
952
|
+
attr.width = columnWidth[prop]
|
|
953
|
+
}
|
|
954
|
+
}
|
|
935
955
|
item.attr = {
|
|
936
956
|
...item.attr,
|
|
937
957
|
...attr
|
|
@@ -981,7 +1001,7 @@ const syncCookiesToTableColumn = async (readCached = true) => {
|
|
|
981
1001
|
}
|
|
982
1002
|
const initColumn = async () => {
|
|
983
1003
|
await initCachedData()
|
|
984
|
-
syncCookiesToTableColumn()
|
|
1004
|
+
syncCookiesToTableColumn(true, true)
|
|
985
1005
|
}
|
|
986
1006
|
|
|
987
1007
|
initColumn()
|
|
@@ -1109,8 +1129,11 @@ const headerDragend = async (newWidth, oldWidth, column, event) => {
|
|
|
1109
1129
|
if (newWidth < minWidth) {
|
|
1110
1130
|
column.width = minWidth
|
|
1111
1131
|
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1132
|
+
if (props.dragCached) { // 记录缓存
|
|
1133
|
+
const columnCachedData = await CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`) || {}
|
|
1134
|
+
columnCachedData[column.property] = column.width
|
|
1135
|
+
await CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, columnCachedData)
|
|
1136
|
+
}
|
|
1114
1137
|
await props.tableEvents['header-dragend']?.(newWidth, oldWidth, column, event)
|
|
1115
1138
|
}
|
|
1116
1139
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-table",
|
|
3
|
-
"version": "100.1.
|
|
3
|
+
"version": "100.1.46",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,12 +14,12 @@
|
|
|
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-button": "^100.1.
|
|
19
|
-
"@94ai/nf-drawer": "^100.1.
|
|
20
|
-
"@94ai/nf-message": "^100.1.
|
|
21
|
-
"@94ai/nf-search-form": "^100.1.
|
|
22
|
-
"@94ai/nf-theme-chalk": "^100.1.
|
|
17
|
+
"@94ai/common-utils": "^100.1.46",
|
|
18
|
+
"@94ai/nf-button": "^100.1.46",
|
|
19
|
+
"@94ai/nf-drawer": "^100.1.46",
|
|
20
|
+
"@94ai/nf-message": "^100.1.46",
|
|
21
|
+
"@94ai/nf-search-form": "^100.1.46",
|
|
22
|
+
"@94ai/nf-theme-chalk": "^100.1.46",
|
|
23
23
|
"idb-keyval": "^6.2.1",
|
|
24
24
|
"vue-demi": "^0.14.5",
|
|
25
25
|
"vuedraggable": "^2.24.3"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"types": "lib/index.d.ts",
|
|
38
38
|
"main": "lib/nf-table.cjs.js",
|
|
39
39
|
"module": "lib/nf-table.esm-bundler.js",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "973015068469dd15957725356a490d6339d28409"
|
|
41
41
|
}
|