@94ai/nf-table 3.1.13

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.
@@ -0,0 +1,1353 @@
1
+ <template>
2
+ <div class="nf-table" ref="nfTableRef">
3
+ <slot name="searchBox" ref="searchBox">
4
+ <nf-search-form
5
+ ref="nfSearchFormRef"
6
+ v-bind="searchFormAttrs"
7
+ v-on="searchFormEvents"
8
+ >
9
+ <template v-for="item in (nfSearchFormRef?.renderSearchFormItemOptions || [])">
10
+ <!-- 定制化SearchItem?提示-->
11
+ <template v-if="item.tooltip?.slot">
12
+ <slot :name="item.tooltip.slot" :slot="item.tooltip.slot" />
13
+ </template>
14
+ <!-- 定制化SearchItem插槽-->
15
+ <template v-if="item.slot">
16
+ <slot :name="item.slot" :slot="item.slot" />
17
+ </template>
18
+ </template>
19
+ <slot name="btnBox" slot="btnBox" />
20
+ <slot name="searchFormColumnEditDialogTitle" slot="dialogTitle" />
21
+ <slot name="searchFormColumnEditDialogFooter" slot="dialogFooter" />
22
+ </nf-search-form>
23
+ </slot>
24
+ <div class="nf-table-content" ref="nfTableContent">
25
+ <slot name="columnEdit" v-if="columnEdit && columnPosition === 'free'">
26
+ <nf-button @click="nfColumCheckDialogVisible = true"
27
+ :class="(columnDisplayBtnClass || '') + ' nf-column-display'"
28
+ :type="columnDisplayBtnType"
29
+ :plain="columnDisplayBtnPlain"
30
+ :icon="columnDisplayBtnIcon"
31
+ :size="columnDisplayBtnSize"
32
+ :round="columnDisplayBtnRound"
33
+ :circle="columnDisplayBtnCircle"
34
+ :loading="columnDisplayBtnLoading"
35
+ :disabled="columnDisplayBtnDisabled"
36
+ >
37
+ {{ columnDisplayBtnText }}
38
+ </nf-button>
39
+ </slot>
40
+ <el-table
41
+ ref="elTableRef"
42
+ :class="{'nf-table-container': true, 'nf-default-table-border': !tableAttrs?.border }"
43
+ :data="showData"
44
+ :fit="tableAttrer?.fit ?? true"
45
+ :height="elTableHeight"
46
+ v-bind="tableAttrer"
47
+ v-on="tableEventer"
48
+ :key="elTableRefKey"
49
+ >
50
+ <template v-for="column in tableColumns">
51
+ <template v-if="isShow(column)">
52
+ <el-table-column
53
+ v-if="column.type"
54
+ :key="column.key || column.prop || column.type"
55
+ :type="column.type"
56
+ :label="column.label"
57
+ v-bind="column.attr"
58
+ />
59
+ <template v-else>
60
+ <el-table-column
61
+ v-if="column.attr&&column.attr.formatter"
62
+ :key="column.key || column.prop"
63
+ :prop="column.prop"
64
+ :label="column.label"
65
+ v-bind="column.attr"
66
+ >
67
+ <slot v-if="column.singleHeadMutiColSlot" :name="column.singleHeadMutiColSlot" />
68
+ <template slot="header" slot-scope="scope">
69
+ <template v-if="column.headerSlot">
70
+ <slot :name="column.headerSlot" :$index="scope.$index" :column="scope.column" />
71
+ </template>
72
+ <span v-else>
73
+ {{ column.label }}
74
+ </span>
75
+ </template>
76
+ </el-table-column>
77
+ <el-table-column v-else :key="column.key || column.prop" :prop="column.prop" :label="column.label"
78
+ v-bind="column.attr">
79
+ <slot v-if="column.singleHeadMutiColSlot" :name="column.singleHeadMutiColSlot" />
80
+ <template slot="header" slot-scope="scope">
81
+ <template v-if="column.headerSlot">
82
+ <slot :name="column.headerSlot" :$index="scope.$index" :column="scope.column" />
83
+ </template>
84
+ <span v-else>
85
+ {{ column.label }}
86
+ </span>
87
+
88
+ <slot name="operationIconColumnCheck" :column="column"
89
+ v-if="column.prop === operationPropKey && columnEdit && columnPosition === 'embed'">
90
+ <el-tooltip
91
+ popper-class="actionTooltipRef"
92
+ placement="top"
93
+ effect="dark"
94
+ :content="columnDisplayBtnText">
95
+ <i class="iconfont icon-liebiao_xianshiliemu operation-icon-column-check"
96
+ @click="nfColumCheckDialogVisible = true"
97
+ />
98
+ </el-tooltip>
99
+ </slot>
100
+
101
+ </template>
102
+ <template slot-scope="scope">
103
+ <render-component v-if="column.render" :render="column.render" :row="scope.row" />
104
+ <template v-else>
105
+ <slot v-if="column.slot" :name="column.slot" :row="scope.row" :index="scope.$index" />
106
+ <template v-else>
107
+ <template v-if="column.prop === operationPropKey && !hasOperationSlot">
108
+ <nf-button
109
+ :size="item.size || 'mini'"
110
+ :type="item.type || 'text'"
111
+ :disabled="item.disabled"
112
+ :loading="item.loading"
113
+ :class="item.class"
114
+ :plain="item.plain"
115
+ :icon="item.icon"
116
+ :round="item.round"
117
+ :circle="item.circle"
118
+ :style="item.style"
119
+ v-for="(item, index) in column.operationList"
120
+ v-on="item.events"
121
+ :key="item.key || index"
122
+ >{{ item.text }}
123
+ </nf-button>
124
+ </template>
125
+ <span v-else>{{ scope.row[column.prop] }}</span>
126
+ </template>
127
+ </template>
128
+ </template>
129
+ </el-table-column>
130
+ </template>
131
+ </template>
132
+ </template>
133
+ <slot name="append" slot="append"></slot>
134
+ <slot name="empty" slot="empty">
135
+ <nf-empty slot="empty" :image-size="emptyImageSize"></nf-empty>
136
+ </slot>
137
+ </el-table>
138
+ <div ref="nfTableActionContainerRef" class="nf-action-box nf-clearfix">
139
+ <slot name="actionBar" ref="nfTableActionBarRef">
140
+ <template v-if="actionBarOptList?.length && !hasActionBarSlot">
141
+ <template v-for="(item, index) in actionBarOptList">
142
+ <nf-button
143
+ :key="item.key || index"
144
+ v-if="item.element === 'el-button'"
145
+ :size="item.size || 'mini'"
146
+ :type="item.type || 'text'"
147
+ :disabled="item.disabled"
148
+ :loading="item.loading"
149
+ :class="item.class"
150
+ :plain="item.plain"
151
+ :icon="item.icon"
152
+ :round="item.round"
153
+ :circle="item.circle"
154
+ :style="{...(item.style || {}), marginRight: '10px'}"
155
+ v-on="item.events"
156
+ >{{ item.value }}
157
+ </nf-button>
158
+ <el-checkbox
159
+ :key="item.key || index"
160
+ v-model="item.value"
161
+ :class="item.class"
162
+ :label="item.label"
163
+ :true-label="item['true-label']"
164
+ :false-label="item['false-label']"
165
+ :disabled="item.disabled"
166
+ :border="item.border"
167
+ :size="item.size"
168
+ :name="item.name"
169
+ :checked="item.checked"
170
+ :indeterminate="item.indeterminate"
171
+ :style="{...(item.style || {}), marginRight: '10px'}"
172
+ v-if="item.element === 'el-checkbox'"
173
+ v-on="item.events"
174
+ >{{ item.text }}
175
+ </el-checkbox>
176
+ <el-checkbox-group
177
+ :key="item.key || index"
178
+ v-model="item.value"
179
+ :class="item.class"
180
+ :label="item.label"
181
+ :true-label="item['true-label']"
182
+ :false-label="item['false-label']"
183
+ :disabled="item.disabled"
184
+ :border="item.border"
185
+ :size="item.size"
186
+ :name="item.name"
187
+ :checked="item.checked"
188
+ :indeterminate="item.indeterminate"
189
+ :style="{...(item.style || {}), marginRight: '10px'}"
190
+ v-if="item.element === 'el-checkbox-group'"
191
+ v-on="item.events"
192
+ >
193
+ <template v-if="item.children?.length">
194
+ <template
195
+ v-for="(itemChildren, j) in item.children"
196
+ >
197
+ <el-checkbox
198
+ :key="itemChildren.key || j"
199
+ v-model="itemChildren.value"
200
+ :class="itemChildren.class"
201
+ :label="itemChildren.label"
202
+ :true-label="itemChildren['true-label']"
203
+ :false-label="itemChildren['false-label']"
204
+ :disabled="itemChildren.disabled"
205
+ :border="itemChildren.border"
206
+ :size="itemChildren.size"
207
+ :name="itemChildren.name"
208
+ :checked="itemChildren.checked"
209
+ :indeterminate="itemChildren.indeterminate"
210
+ :style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '10px'}"
211
+ v-if="itemChildren.element === 'el-checkbox'"
212
+ v-on="itemChildren.events"
213
+ >{{ item.text }}
214
+ </el-checkbox>
215
+ <el-checkbox-button
216
+ :key="itemChildren.key || j"
217
+ v-model="itemChildren.value"
218
+ :class="itemChildren.class"
219
+ :label="itemChildren.label"
220
+ :true-label="itemChildren['true-label']"
221
+ :false-label="itemChildren['false-label']"
222
+ :disabled="itemChildren.disabled"
223
+ :border="itemChildren.border"
224
+ :size="itemChildren.size"
225
+ :name="itemChildren.name"
226
+ :checked="itemChildren.checked"
227
+ :indeterminate="itemChildren.indeterminate"
228
+ :style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '10px'}"
229
+ v-if="itemChildren.element === 'el-checkbox-button'"
230
+ v-on="itemChildren.events"
231
+ >{{ item.text }}
232
+ </el-checkbox-button>
233
+ </template>
234
+ </template>
235
+ </el-checkbox-group>
236
+ <el-checkbox-button
237
+ :key="item.key || index"
238
+ v-model="item.value"
239
+ :class="item.class"
240
+ :label="item.label"
241
+ :true-label="item['true-label']"
242
+ :false-label="item['false-label']"
243
+ :disabled="item.disabled"
244
+ :border="item.border"
245
+ :size="item.size"
246
+ :name="item.name"
247
+ :checked="item.checked"
248
+ :indeterminate="item.indeterminate"
249
+ :style="{...(item.style || {}), marginRight: '10px'}"
250
+ v-if="item.element === 'el-checkbox-button'"
251
+ v-on="item.events"
252
+ >{{ item.text }}
253
+ </el-checkbox-button>
254
+ <el-radio
255
+ :key="item.key || index"
256
+ v-model="item.value"
257
+ :label="item.label"
258
+ :disabled="item.disabled"
259
+ :border="item.border"
260
+ :name="item.name"
261
+ :size="item.size"
262
+ :class="item.class"
263
+ :style="{...(item.style || {}), marginRight: '10px'}"
264
+ v-if="item.element === 'el-radio'"
265
+ v-on="item.events"
266
+ >{{ item.text }}
267
+ </el-radio>
268
+ <el-radio-group
269
+ :key="item.key || index"
270
+ v-model="item.value"
271
+ :disabled="item.disabled"
272
+ :size="item.size"
273
+ :class="item.class"
274
+ :text-color="item['text-color']"
275
+ :fill="item['fill']"
276
+ :style="{...(item.style || {}), marginRight: '10px'}"
277
+ v-if="item.element === 'el-radio-group'"
278
+ v-on="item.events"
279
+ >
280
+ <template v-if="item.children?.length">
281
+ <template
282
+ v-for="(itemChildren, j) in item.children"
283
+ >
284
+ <el-radio
285
+ :key="itemChildren.key || j"
286
+ v-model="itemChildren.value"
287
+ :label="itemChildren.label"
288
+ :disabled="itemChildren.disabled"
289
+ :border="itemChildren.border"
290
+ :name="itemChildren.name"
291
+ :size="itemChildren.size"
292
+ :class="itemChildren.class"
293
+ :style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '10px'}"
294
+ v-if="itemChildren.element === 'el-radio'"
295
+ v-on="itemChildren.events"
296
+ >{{ item.text }}
297
+ </el-radio>
298
+ <el-radio-button
299
+ :key="itemChildren.key || j"
300
+ v-model="itemChildren.value"
301
+ :label="itemChildren.label"
302
+ :disabled="itemChildren.disabled"
303
+ :border="itemChildren.border"
304
+ :name="itemChildren.name"
305
+ :size="itemChildren.size"
306
+ :class="itemChildren.class"
307
+ :style="{...(itemChildren.style || {}), marginRight: j === 0 ? 0 : '10px'}"
308
+ v-if="itemChildren.element === 'el-radio-button'"
309
+ v-on="itemChildren.events"
310
+ >{{ item.text }}
311
+ </el-radio-button>
312
+ </template>
313
+ </template>
314
+ </el-radio-group>
315
+ <el-radio-button
316
+ :key="item.key || index"
317
+ v-model="item.value"
318
+ :label="item.label"
319
+ :disabled="item.disabled"
320
+ :border="item.border"
321
+ :name="item.name"
322
+ :size="item.size"
323
+ :class="item.class"
324
+ :style="{...(item.style || {}), marginRight: '10px'}"
325
+ v-if="item.element === 'el-radio-button'"
326
+ v-on="item.events"
327
+ >{{ item.text }}
328
+ </el-radio-button>
329
+ <el-input
330
+ :key="item.key || index"
331
+ v-model="item.value"
332
+ :class="item.class"
333
+ :show-word-limit="item['show-word-limit']"
334
+ :show-password="item['show-password']"
335
+ :prefix-icon="item['prefix-icon']"
336
+ :suffix-icon="item['suffix-icon']"
337
+ :validate-event="item['validate-event']"
338
+ :type="item.type"
339
+ :placeholder="item.placeholder"
340
+ :disabled="item.disabled"
341
+ :size="item.size"
342
+ :name="item.name"
343
+ :max="item.max"
344
+ :min="item.min"
345
+ :step="item.step"
346
+ :label="item.label"
347
+ :maxlength="item.maxlength"
348
+ :minlength="item.minlength"
349
+ :clearable="item.clearable"
350
+ :rows="item.rows"
351
+ :autosize="item.autosize"
352
+ :autocomplete="item.autocomplete"
353
+ :readonly="item.readonly"
354
+ :resize="item.resize"
355
+ :autofocus="item.autofocus"
356
+ :form="item.form"
357
+ :tabindex="item.tabindex"
358
+ :style="{...(item.style || {}), marginRight: '10px'}"
359
+ v-if="item.element === 'el-input'"
360
+ v-on="item.events"
361
+ >
362
+ <slot v-if="item.slot?.prefix" :name="item.slot.prefix" slot="prefix" />
363
+ <slot v-if="item.slot?.suffix" :name="item.slot.suffix" slot="suffix" />
364
+ <slot v-if="item.slot?.prepend" :name="item.slot.prepend" slot="prepend" />
365
+ <slot v-if="item.slot?.append" :name="item.slot.append" slot="append" />
366
+ </el-input>
367
+ <el-autocomplete
368
+ :key="item.key || index"
369
+ v-model="item.value"
370
+ :class="item.class"
371
+ :style="{...(item.style || {}), marginRight: '10px'}"
372
+ :value-key="item['value-key']"
373
+ :fetch-suggestions="item['fetch-suggestions']"
374
+ :popper-class="item['popper-class']"
375
+ :trigger-on-focus="item['trigger-on-focus']"
376
+ :select-when-unmatched="item['select-when-unmatched']"
377
+ :hide-loading="item['hide-loading']"
378
+ :popper-append-to-body="item['popper-append-to-body']"
379
+ :highlight-first-item="item['highlight-first-item']"
380
+ :prefix-icon="item['prefix-icon']"
381
+ :suffix-icon="item['suffix-icon']"
382
+ :placeholder="item.placeholder"
383
+ :disabled="item.disabled"
384
+ :debounce="item.debounce"
385
+ :placement="item.placement"
386
+ :label="item.label"
387
+ :name="item.name"
388
+ v-if="item.element === 'el-autocomplete'"
389
+ v-on="item.events"
390
+ >
391
+ <slot v-if="item.slot?.prefix" :name="item.slot.prefix" slot="prefix" />
392
+ <slot v-if="item.slot?.suffix" :name="item.slot.suffix" slot="suffix" />
393
+ <slot v-if="item.slot?.prepend" :name="item.slot.prepend" slot="prepend" />
394
+ <slot v-if="item.slot?.append" :name="item.slot.append" slot="append" />
395
+ </el-autocomplete>
396
+ <el-switch
397
+ :key="item.key || index"
398
+ v-model="item.value"
399
+ :disabled="item.disabled"
400
+ :width="item.width"
401
+ :name="item.name"
402
+ :active-icon-class="item['active-icon-class']"
403
+ :inactive-icon-class="item['inactive-icon-class']"
404
+ :active-text="item['active-text']"
405
+ :inactive-text="item['inactive-text']"
406
+ :active-value="item['active-value']"
407
+ :inactive-value="item['inactive-value']"
408
+ :active-color="item['active-color']"
409
+ :inactive-color="item['inactive-color']"
410
+ :validate-event="item['validate-event']"
411
+ :class="item.class"
412
+ :style="{...(item.style || {}), marginRight: '10px'}"
413
+ v-if="item.element === 'el-switch'"
414
+ v-on="item.events"
415
+ >{{ item.text }}
416
+ </el-switch>
417
+ <el-input-number
418
+ :key="item.key || index"
419
+ v-model="item.value"
420
+ :class="item.class"
421
+ :min="item.min"
422
+ :max="item.max"
423
+ :step="item.step"
424
+ :step-strictly="item['step-strictly']"
425
+ :precision="item.precision"
426
+ :size="item.size"
427
+ :disabled="item.disabled"
428
+ :controls="item.controls"
429
+ :controls-position="item['controls-position']"
430
+ :name="item.name"
431
+ :label="item.label"
432
+ :placeholder="item.placeholder"
433
+ :style="{...(item.style || {}), marginRight: '10px'}"
434
+ v-if="item.element === 'el-input-number'"
435
+ v-on="item.events"
436
+ ></el-input-number>
437
+ <span
438
+ :key="item.key || index"
439
+ :class="item.class"
440
+ v-if="item.element === 'text'"
441
+ :style="{...(item.style || {}), marginRight: '10px'}"
442
+ v-on="item.events"
443
+ v-bind="item.attr"
444
+ >
445
+ {{ item.value }}
446
+ </span>
447
+ </template>
448
+ </template>
449
+ </slot>
450
+ <slot name="pagination">
451
+ <el-pagination ref="nfTablePaginationRef" v-if="renderPage" v-bind="pageAttrer" v-on="pageEvents"
452
+ class="nf-pagination-box nf-fr" />
453
+ </slot>
454
+ </div>
455
+ </div>
456
+ <column-check-dialog
457
+ :title="columnCheckTitle"
458
+ :confirm-text="columnCheckConfirmButtonText"
459
+ :cancel-text="columnCheckCancelButtonText"
460
+ :basic-field-desc="columnCheckBasicFieldDesc"
461
+
462
+ :show.sync="nfColumCheckDialogVisible"
463
+ :table-columns="columns"
464
+ :column-edit="columnEdit"
465
+ :storage-key="storageKey"
466
+ :width="columnCheckWidth"
467
+ :modal-append-to-body="columnCheckModalAppendToBody"
468
+ :modal="columnCheckModal"
469
+ :fullscreen="columnCheckFullscreen"
470
+ :top="columnCheckTop"
471
+ :append-to-body="columnCheckAppendToBody"
472
+ :lock-scroll="columnCheckLockScroll"
473
+ :custom-class="columnCheckCustomClass"
474
+ :close-onlick-modal="columnCheckCloseOnlickModal"
475
+ :close-on-press-escape="columnCheckCloseOnPressEscape"
476
+ :show-close="columnCheckShowClose"
477
+ :before-close="columnCheckBeforeClose"
478
+ :center="columnCheckCenter"
479
+ :destroy-on-close="columnCheckDestroyOnClose"
480
+ :operation-prop-key="operationPropKey"
481
+
482
+ v-if="nfColumCheckDialogVisible && checkMode === 'dialog'"
483
+ ref="columnCheckDialog"
484
+ @save="fieldsConfirm"
485
+ >
486
+ <slot slot="tableColumnEditDialogTitle" name="title"></slot>
487
+ <slot slot="tableColumnEditDialogFooter" name="footer"></slot>
488
+ </column-check-dialog>
489
+ <nf-drawer
490
+ :title="columnCheckTitle"
491
+ :cancel-button-text="columnCheckCancelButtonText"
492
+ :confirm-button-text="columnCheckConfirmButtonText"
493
+
494
+ ref="columnCheckNfDrawer"
495
+ size="680px"
496
+ :visible.sync="nfColumCheckDialogVisible"
497
+ :tabs="columnCheckTabs"
498
+ :destroy-on-close="true"
499
+ :currentTab="columnCheckCurrentTab"
500
+
501
+ v-if="checkMode === 'drawer'"
502
+ @confirm="columnCheckConfirm"
503
+ @changeTab="(done) => $emit('changeTab', done)"
504
+ @cancel="(name) => $emit('cancel', name)"
505
+ >
506
+ <slot slot="tableColumnEditDialogTitle" name="title" />
507
+ <slot slot="tableColumnEditDialogFooter" name="footer" />
508
+ <column-check-drawer
509
+ :search-placeholder="columnCheckSearchPlaceholder"
510
+ :fixed-left-desc="columnCheckFixedLeftDesc"
511
+ :clear-desc="columnCheckClearDesc"
512
+ :no-fixed-desc="columnCheckNoFixedDesc"
513
+ :basic-field-desc="columnCheckBasicFieldDesc"
514
+ :select-empty-warning-tips="selectEmptyWarningTips"
515
+ :get-checked-length-desc="columnCheckGetCheckedLengthDesc"
516
+ :get-all-check-desc="columnCheckGetAllCheckDesc"
517
+ ref="columnCheckDrawer"
518
+
519
+ :column-edit="columnEdit"
520
+ :operation-prop-key="operationPropKey"
521
+ :storage-key="storageKey"
522
+ :table-columns="columns"
523
+ />
524
+ </nf-drawer>
525
+ </div>
526
+ </template>
527
+
528
+ <script lang="ts">
529
+ import { defineComponent } from 'vue-demi'
530
+
531
+ export default defineComponent({
532
+ name: 'nf-table'
533
+ })
534
+ </script>
535
+
536
+ <script lang="ts" setup>
537
+ import ColumnCheckDialog from './nf-column-check-dialog.vue'
538
+ import ColumnCheckDrawer from './nf-column-check-drawer.vue'
539
+ import RenderComponent from './nf-render-component.vue'
540
+ import { Loading } from 'element-ui'
541
+ import {
542
+ computed,
543
+ getCurrentInstance,
544
+ nextTick,
545
+ onMounted,
546
+ onBeforeMount,
547
+ ref,
548
+ watch,
549
+ set
550
+ } from 'vue-demi'
551
+ import {
552
+ NfTableColumnAttributes,
553
+ ElTableColumnAttributes,
554
+ ElTableAttributes,
555
+ ElTableEventKey,
556
+ ElPaginationEventKey,
557
+ ElPaginationAttributes,
558
+ NfSearchFormAttributes,
559
+ NfSearchFormEventKey,
560
+ NfTableActionBtnAttributes
561
+ } from './types'
562
+ import { ITabItem } from '@94ai/nf-drawer/lib/types'
563
+ import { CachedManager } from '@94ai/common-utils'
564
+
565
+ const props = withDefaults(defineProps<{
566
+ data?: Record<string, any>[],
567
+ columns?: NfTableColumnAttributes[] | any,
568
+ searchFormAttrs?: NfSearchFormAttributes,
569
+ searchFormEvents?: Partial<Record<NfSearchFormEventKey, Function>>,
570
+ tableAttrs?: ElTableAttributes,
571
+ tableEvents?: Partial<Record<ElTableEventKey, Function>>,
572
+ pageAttrs?: ElPaginationAttributes,
573
+ pageEvents?: Partial<Record<ElPaginationEventKey, Function>>,
574
+ actionBarOptList?: NfTableActionBtnAttributes[],
575
+ /**
576
+ * 开启表格列拖拽缓存记录
577
+ */
578
+ dragCached?: boolean,
579
+ /**
580
+ * 表格空数据时空组件size
581
+ */
582
+ emptyImageSize?: number,
583
+ /**
584
+ * 固定窗口满屏table自动计算table高度
585
+ */
586
+ calHeight?: boolean,
587
+ /**
588
+ * 列编辑显示开关
589
+ */
590
+ columnEdit?: boolean,
591
+ columnPosition?: 'free' | 'embed',
592
+ checkMode?: 'dialog' | 'drawer',
593
+ priority?: 'cached' | 'value',
594
+ storageKey?: string
595
+ searchFormStorageKey?: string
596
+ /**
597
+ * 列编辑要显示的表格项字段
598
+ */
599
+ showColumn?: string[],
600
+ selectEmptyWarningTips?: string,
601
+ /**
602
+ * 列编辑按钮修饰
603
+ */
604
+ columnDisplayBtnClass?: string,
605
+ columnDisplayBtnIcon?: string,
606
+ columnDisplayBtnType?: string,
607
+ columnDisplayBtnPlain?: boolean,
608
+ columnDisplayBtnSize?: string,
609
+ columnDisplayBtnRound?: boolean,
610
+ columnDisplayBtnCircle?: boolean,
611
+ columnDisplayBtnLoading?: boolean,
612
+ columnDisplayBtnDisabled?: boolean,
613
+ columnDisplayBtnText?: string,
614
+ /**
615
+ * 列编辑dialog/drawer模式
616
+ */
617
+ columnCheckTitle?: string,
618
+ columnCheckCancelButtonText?: string,
619
+ columnCheckConfirmButtonText?: string,
620
+ columnCheckBasicFieldDesc?: string
621
+ /**
622
+ * 列编辑dialog模式
623
+ */
624
+ columnCheckWidth?: string,
625
+ columnCheckModalAppendToBody?: boolean,
626
+ columnCheckModal?: boolean,
627
+ columnCheckFullscreen?: boolean,
628
+ columnCheckTop?: string,
629
+ columnCheckAppendToBody?: boolean,
630
+ columnCheckLockScroll?: boolean,
631
+ columnCheckCustomClass?: string,
632
+ columnCheckCloseOnlickModal?: boolean,
633
+ columnCheckCloseOnPressEscape?: boolean,
634
+ columnCheckShowClose?: boolean,
635
+ columnCheckBeforeClose?: Function,
636
+ columnCheckCenter?: boolean,
637
+ columnCheckDestroyOnClose?: boolean,
638
+ /**
639
+ * 列编辑drawer模式
640
+ */
641
+ columnCheckSearchPlaceholder?: string
642
+ columnCheckFixedLeftDesc?: string
643
+ columnCheckClearDesc?: string
644
+ columnCheckNoFixedDesc?: string
645
+ columnCheckGetCheckedLengthDesc?: any
646
+ columnCheckGetAllCheckDesc?: any
647
+ columnCheckTabs?: ITabItem[],
648
+ columnCheckCurrentTab?: string,
649
+
650
+ /**
651
+ * 表格loading
652
+ */
653
+ loading?: boolean,
654
+ target?: HTMLElement,
655
+ body?: boolean,
656
+ fullscreen?: boolean,
657
+ lock?: boolean,
658
+ text?: string,
659
+ spinner?: string,
660
+ background?: string,
661
+ customClass?: string,
662
+
663
+ /**
664
+ * 分页
665
+ */
666
+ alwaysShowPage?: boolean,
667
+ /**
668
+ * 操作列属性key
669
+ */
670
+ operationPropKey?: string
671
+
672
+ }>(), {
673
+ dragCached: true,
674
+ emptyImageSize: 145,
675
+ priority: 'cached',
676
+ storageKey: 'nf-table-columns-cached-key',
677
+ searchFormStorageKey: 'nf-search-form-columns-cached-key',
678
+ checkMode: 'drawer',
679
+ data: () => [],
680
+ columns: () => [],
681
+ searchFormAttrs: () => ({}),
682
+ tableAttrs: () => ({}),
683
+ pageAttrs: () => ({}),
684
+ searchFormEvents: () => ({}),
685
+ tableEvents: () => ({}),
686
+ pageEvents: () => ({}),
687
+ actionBarOptList: () => [],
688
+ calHeight: false,
689
+ columnEdit: false,
690
+ columnPosition: 'embed',
691
+ showColumn: undefined,
692
+ loading: false,
693
+ target: undefined,
694
+ body: false,
695
+ fullscreen: false,
696
+ lock: true,
697
+ text: undefined,
698
+ spinner: undefined,
699
+ background: undefined,
700
+ customClass: undefined,
701
+ columnDisplayBtnIcon: 'el-icon-plus',
702
+ columnDisplayBtnType: 'primary',
703
+ columnDisplayBtnPlain: true,
704
+ columnDisplayBtnSize: 'mini',
705
+ columnDisplayBtnRound: false,
706
+ columnDisplayBtnCircle: false,
707
+ columnDisplayBtnLoading: false,
708
+ columnDisplayBtnDisabled: false,
709
+ columnDisplayBtnClass: '',
710
+ alwaysShowPage: true,
711
+ operationPropKey: 'operation',
712
+ columnCheckWidth: '600px',
713
+ columnCheckModalAppendToBody: true,
714
+ columnCheckModal: true,
715
+ columnCheckFullscreen: false,
716
+ columnCheckTop: '15vh',
717
+ columnCheckAppendToBody: false,
718
+ columnCheckLockScroll: true,
719
+ columnCheckCustomClass: '',
720
+ columnCheckCloseOnlickModal: true,
721
+ columnCheckCloseOnPressEscape: true,
722
+ columnCheckShowClose: true,
723
+ columnCheckBeforeClose: undefined,
724
+ columnCheckCenter: false,
725
+ columnCheckDestroyOnClose: false,
726
+ selectEmptyWarningTips: '请选择至少一个选项',
727
+ columnDisplayBtnText: '设置列表字段',
728
+ columnCheckTitle: '设置显示字段',
729
+ columnCheckCancelButtonText: '取消',
730
+ columnCheckConfirmButtonText: '确定',
731
+ columnCheckSearchPlaceholder: '搜索',
732
+ columnCheckFixedLeftDesc: '固定在左侧',
733
+ columnCheckClearDesc: '清除',
734
+ columnCheckNoFixedDesc: '不固定',
735
+ columnCheckBasicFieldDesc: '基础字段',
736
+ columnCheckGetCheckedLengthDesc: (length) => '已选(' + length + ')',
737
+ columnCheckGetAllCheckDesc: (length) => '全选(' + length + ')'
738
+ })
739
+
740
+ const emit = defineEmits<{
741
+ (e: 'fieldsChange', event: string[]): void
742
+ (e: 'update:showColumn', event: string[] | undefined): void
743
+ }>()
744
+
745
+ const instance = getCurrentInstance()?.proxy
746
+ const elTableRef = ref()
747
+ const nfTableActionContainerRef = ref()
748
+ const nfTablePaginationRef = ref()
749
+ const nfTableActionBarRef = ref()
750
+ const nfTableRef = ref()
751
+ const nfTableContent = ref()
752
+ const nfSearchFormRef = ref()
753
+ const columnCheckDrawer = ref()
754
+ const columnCheckDialog = ref()
755
+ const columnCheckNfDrawer = ref()
756
+ const elTableHeight = ref()
757
+ const nfColumCheckDialogVisible = ref(false)
758
+
759
+ /**
760
+ * 处理前端分页和后端分页
761
+ */
762
+ const showData = computed(() => {
763
+ const pageSize = props.pageAttrs['page-size']
764
+ const currentPage = props.pageAttrs['current-page'] || 1
765
+ const noTotal = typeof props.pageAttrs.total === 'undefined'
766
+ if (!pageSize || !noTotal) return props.data
767
+ if (props.data.length > pageSize) {
768
+ return props.data.slice((currentPage - 1) * pageSize, currentPage * pageSize)
769
+ } else {
770
+ return props.data
771
+ }
772
+ })
773
+ /**
774
+ * 定制按钮
775
+ */
776
+ const hasOperationSlot = computed(() => {
777
+ return instance?.$slots.operation
778
+ })
779
+ const hasActionBarSlot = computed(() => {
780
+ return instance?.$slots.actionBar
781
+ })
782
+
783
+
784
+ const loadingInstance = ref()
785
+ watch(() => {
786
+ return props.loading
787
+ }, async () => {
788
+ if (props.loading) {
789
+ await nextTick()
790
+ const {
791
+ target,
792
+ lock,
793
+ fullscreen,
794
+ text,
795
+ spinner,
796
+ background,
797
+ customClass
798
+ } = props
799
+ loadingInstance.value = Loading.service({
800
+ target: target || elTableRef.value?.$el.parentNode || document.body,
801
+ lock,
802
+ fullscreen,
803
+ text,
804
+ spinner,
805
+ background,
806
+ customClass
807
+ })
808
+ } else {
809
+ loadingInstance.value?.close()
810
+ }
811
+ }, {
812
+ immediate: true
813
+ })
814
+ // 同步用户参数
815
+ const initLocalShow = (init = false) => {
816
+ if (!init) {
817
+ props.columns._skip = true
818
+ }
819
+ const result = props.columns.filter(item => {
820
+ const prop = item.prop || item.attr?.prop
821
+ if (props.showColumn?.includes(prop!)) {
822
+ item.initHidden = false
823
+ }
824
+ return !item.initHidden
825
+ }).map(item => item.prop! || item.attr?.prop!)
826
+ if (!init) {
827
+ nextTick(() => {
828
+ props.columns._skip = false
829
+ })
830
+ }
831
+ if (result.length) {
832
+ return result
833
+ }
834
+ return props.columns.map(item => item.prop! || item.attr?.prop!)
835
+ }
836
+ const localShowColumn = ref<string[]>(initLocalShow(true))
837
+ watch(() => localShowColumn.value?.length, () => {
838
+ emit('update:showColumn', localShowColumn.value)
839
+ }, {
840
+ immediate: true
841
+ })
842
+
843
+ const syncLocalShowColumnToCookies = () => {
844
+ if (props.columnEdit) {
845
+ const columnState = {}
846
+ props.columns.map((i, index) => {
847
+ const prop = i.prop || i.attr?.prop
848
+ columnState[prop!] = {
849
+ initHidden: i.initHidden || false,
850
+ fixed: i.attr?.fixed || false,
851
+ prop,
852
+ index
853
+ }
854
+ })
855
+ return CachedManager.syncCachedSet(props.storageKey, columnState)
856
+ }
857
+ }
858
+
859
+ const syncShowItemToInitHidden = () => {
860
+ props.columns._skip = true
861
+ props.columns.forEach(item => {
862
+ const prop = item.prop || item.attr?.prop
863
+ if (localShowColumn.value?.includes(prop!)) {
864
+ item.initHidden = false
865
+ } else {
866
+ item.initHidden = true
867
+ }
868
+ })
869
+ nextTick(() => {
870
+ props.columns._skip = false
871
+ })
872
+ }
873
+ const syncCookiesToLocalShowColumn = async () => {
874
+ if (props.columnEdit) {
875
+ try {
876
+ let columnState: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
877
+ if (!columnState) {
878
+ columnState = await CachedManager.asyncCachedGet(props.storageKey)
879
+ }
880
+ if (columnState) {
881
+ if (typeof columnState === 'string') {
882
+ columnState = JSON.parse(columnState)
883
+ }
884
+ const showColumnItems: string[] = []
885
+ for (const key in columnState as NfTableColumnAttributes) {
886
+ if (!columnState![key].initHidden) {
887
+ showColumnItems.push(columnState![key].prop)
888
+ }
889
+ }
890
+ localShowColumn.value = showColumnItems
891
+ syncShowItemToInitHidden()
892
+ }
893
+ } catch (e) {
894
+ console.log(e)
895
+ }
896
+ }
897
+ }
898
+
899
+ const initCachedData = async () => {
900
+ if (props.columnEdit) {
901
+ // 同步缓存参数
902
+ try {
903
+ let cached: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
904
+ if (!cached) {
905
+ cached = await CachedManager.asyncCachedGet(props.storageKey)
906
+ }
907
+ const cachedPriority = props.priority === 'cached'
908
+ if (cachedPriority ? cached : localShowColumn.value?.length) {
909
+ cachedPriority ? await syncCookiesToLocalShowColumn() : await syncLocalShowColumnToCookies()
910
+ } else if (cachedPriority ? localShowColumn.value?.length : cached) {
911
+ cachedPriority ? await syncLocalShowColumnToCookies() : await syncCookiesToLocalShowColumn()
912
+ }
913
+ } catch (e) {
914
+ console.log(e)
915
+ }
916
+ }
917
+ if (props.dragCached) {
918
+ await CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`)
919
+ }
920
+ }
921
+
922
+ const getMinWidth = (column) => {
923
+ if (column.label?.indexOf('$$') === 0) {
924
+ const value = Number(column.label.replace('$$'))
925
+ if (!Number.isNaN(value) && value) {
926
+ return value
927
+ }
928
+ }
929
+ const fs = 14
930
+ const label = column.label
931
+ const char = label.match(/[\u2E80-\u9FFF]/g)
932
+ const charLen = char ? char.length : 0
933
+ const num = label.match(/\d|\./g)
934
+ const numLen = num ? num.length : 0
935
+ const otherLen = label.length - charLen - numLen
936
+ return fs * (charLen * 1 + numLen * 0.7 + otherLen * 0.58) + 20 + (column.sortable ? 24 : 0)
937
+ }
938
+
939
+ const tableColumns = ref<NfTableColumnAttributes[]>([])
940
+ const elTableRefKey = ref(Date.now())
941
+ const syncCookiesToTableColumn = async (readCached = true, init = false) => {
942
+ props.columns._skip = true
943
+ const columns = props.columns!.map((item, index) => {
944
+ const attr = (item.attr || {}) as ElTableColumnAttributes
945
+ // 区分中文、数字、其他字符
946
+ if (!attr['min-width'] && item.label) {
947
+ attr['min-width'] = String(getMinWidth(item)) + 'px'
948
+ }
949
+ if (init && props.dragCached) {
950
+ const prop = item.prop || item.attr?.prop
951
+ let columnWidth = CachedManager.syncCachedGet(`${props.storageKey}$drag-column-width`) || {}
952
+ if (columnWidth[prop]) { // 读取缓存
953
+ attr.width = columnWidth[prop]
954
+ }
955
+ }
956
+ item.attr = {
957
+ ...item.attr,
958
+ ...attr
959
+ } as ElTableColumnAttributes
960
+ delete item.attr.prop
961
+ delete item.attr.label
962
+ item._index = index
963
+ set(item, 'initHidden', item.initHidden)
964
+ set(item, 'destory', item.destory)
965
+ item.__index = index
966
+ return item
967
+ })
968
+ if (readCached && props.columnEdit) {
969
+ // 读取缓存 Column 配置
970
+ try {
971
+ let columnState: string | NfTableColumnAttributes | undefined = CachedManager.syncCachedGet(props.storageKey)
972
+ if (!columnState) {
973
+ columnState = await CachedManager.asyncCachedGet(props.storageKey)
974
+ }
975
+ props.columns._skip = true
976
+ if (columnState) {
977
+ if (typeof columnState === 'string') {
978
+ columnState = JSON.parse(columnState)
979
+ }
980
+ for (const key in columnState as NfTableColumnAttributes) {
981
+ const state = columnState![key]
982
+ columns.every(i => {
983
+ if (i.prop === key) {
984
+ i.initHidden = state.initHidden
985
+ i.attr ? i.attr['fixed'] = state.fixed : i.attr = { fixed: state.fixed }
986
+ i._index = state.index
987
+ return false
988
+ }
989
+ return true
990
+ })
991
+ }
992
+ }
993
+ } catch (e) {
994
+ console.log(e)
995
+ }
996
+ }
997
+ tableColumns.value = columns.sort((a, b) => a._index! - b._index! < 0 ? -1 : a._index! - b._index! > 0 ? 1 : 0)
998
+ nextTick(() => {
999
+ props.columns._skip = false
1000
+ })
1001
+ elTableRefKey.value = Date.now()
1002
+ }
1003
+ const initColumn = async () => {
1004
+ await initCachedData()
1005
+ syncCookiesToTableColumn(true, true)
1006
+ }
1007
+
1008
+ initColumn()
1009
+
1010
+ onBeforeMount(() => {
1011
+ watch(() => {
1012
+ return props.columns
1013
+ }, async () => {
1014
+ if (props.columns._skip) {
1015
+ return
1016
+ }
1017
+ localShowColumn.value = initLocalShow()
1018
+ await syncCookiesToTableColumn()
1019
+ }, {
1020
+ deep: true
1021
+ })
1022
+ })
1023
+
1024
+ const tableAttrer = computed(() => {
1025
+ const obj: Record<string, any> = {
1026
+ 'header-cell-style': {
1027
+ 'text-align': 'left',
1028
+ 'background': '#F5F7FA',
1029
+ 'height': '48px',
1030
+ 'color': '#303133',
1031
+ 'font-size': '14px'
1032
+
1033
+ },
1034
+ 'cell-style': { 'text-align': 'left' },
1035
+ resizable: true,
1036
+ border: true,
1037
+ ...props.tableAttrs
1038
+ }
1039
+ delete obj.data
1040
+ return obj
1041
+ })
1042
+
1043
+ const tableEventer = computed(() => {
1044
+ const obj: Record<string, any> = {
1045
+ ...props.tableEvents,
1046
+ 'header-dragend': headerDragend
1047
+ }
1048
+ return obj
1049
+ })
1050
+
1051
+ const pageSizes = ref([10, 20, 30, 40, 50, 100, 200])
1052
+ const initPageSizes = () => {
1053
+ const pageSizeArr = props.pageAttrs['page-sizes']
1054
+ if (props.pageAttrs['page-size']! < (pageSizeArr?.length ? pageSizeArr[0] : 10)) {
1055
+ pageSizes.value.unshift(props.pageAttrs['page-size']!)
1056
+ }
1057
+ }
1058
+
1059
+ const showPage = computed(() => {
1060
+ return showData.value.length > props.pageAttrs['page-size']!
1061
+ })
1062
+
1063
+ const renderPage = computed(() => {
1064
+ return props.alwaysShowPage || showPage.value
1065
+ })
1066
+
1067
+ initPageSizes()
1068
+
1069
+ const pageAttrer = computed(() => {
1070
+ return {
1071
+ background: false,
1072
+ layout: 'total, sizes, prev, pager, next, jumper',
1073
+ 'page-sizes': pageSizes.value,
1074
+ total: typeof props.pageAttrs.total === 'undefined' ? props.data?.length : undefined,
1075
+ ...props.pageAttrs
1076
+ }
1077
+ })
1078
+
1079
+ const isShow = (row: Record<string, any>) => {
1080
+ if (row.type) {
1081
+ return true
1082
+ }
1083
+ return !row.initHidden && !row.destory
1084
+ }
1085
+
1086
+ const resetNfSearchFormModel = () => {
1087
+ nfSearchFormRef.value?.resetNfSearchFormModel()
1088
+ }
1089
+ const onNfSearchFormValidate = (callback) => {
1090
+ nfSearchFormRef.value?.onNfSearchFormValidate(callback)
1091
+ }
1092
+ const onNfSearchFormSearch = () => {
1093
+ nfSearchFormRef.value?.onNfSearchFormSearch()
1094
+ }
1095
+ const onNfSearchFormExport = () => {
1096
+ nfSearchFormRef.value?.onNfSearchFormExport()
1097
+ }
1098
+
1099
+ const clearSelection = () => {
1100
+ elTableRef.value?.clearSelection()
1101
+ }
1102
+ const toggleRowSelection = (row: Record<string, any>, selected: boolean) => {
1103
+ elTableRef.value?.toggleRowSelection(row, selected)
1104
+ }
1105
+ const toggleAllSelection = () => {
1106
+ elTableRef.value?.toggleAllSelection()
1107
+ }
1108
+ const toggleRowExpansion = (row: Record<string, any>, expanded: boolean) => {
1109
+ elTableRef.value?.toggleRowExpansion(row, expanded)
1110
+ }
1111
+ const setCurrentRow = (row: Record<string, any>) => {
1112
+ elTableRef.value?.setCurrentRow(row)
1113
+ }
1114
+ const clearSort = () => {
1115
+ elTableRef.value?.clearSort()
1116
+ }
1117
+ const clearFilter = () => {
1118
+ elTableRef.value?.clearFilter()
1119
+ }
1120
+ const doLayout = () => {
1121
+ elTableRef.value?.doLayout?.()
1122
+ }
1123
+ const sort = (prop, order) => {
1124
+ elTableRef.value?.sort(prop, order)
1125
+ }
1126
+
1127
+ const headerDragend = async (newWidth, oldWidth, column, event) => {
1128
+ await nextTick()
1129
+ const minWidth = getMinWidth(column)
1130
+ if (newWidth < minWidth) {
1131
+ column.width = minWidth
1132
+ }
1133
+ if (props.dragCached) { // 记录缓存
1134
+ const columnCachedData = await CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`) || {}
1135
+ columnCachedData[column.property] = column.width
1136
+ await CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, columnCachedData)
1137
+ }
1138
+ await props.tableEvents['header-dragend']?.(newWidth, oldWidth, column, event)
1139
+ }
1140
+
1141
+ async function clearDragCached() {
1142
+ await CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, null)
1143
+ }
1144
+
1145
+ async function clearColumnEditCached() {
1146
+ await CachedManager.asyncCachedSet(props.storageKey, null)
1147
+ }
1148
+
1149
+ const columnCheckConfirmFeedback = (value: Record<string, any>) => {
1150
+ if (!props.columnEdit) {
1151
+ const itemsList: string[] = []
1152
+ for (const key in value) {
1153
+ if (value[key]) {
1154
+ itemsList.push(key)
1155
+ }
1156
+ }
1157
+ localShowColumn.value = itemsList
1158
+ syncShowItemToInitHidden()
1159
+ }
1160
+ }
1161
+
1162
+ /**
1163
+ * 弹框确定
1164
+ * @param { Object } value
1165
+ */
1166
+ const fieldsConfirm = async (value) => {
1167
+ columnCheckConfirmFeedback(value)
1168
+ await syncCookiesToLocalShowColumn()
1169
+ await syncCookiesToTableColumn()
1170
+ emit('fieldsChange', localShowColumn.value)
1171
+ }
1172
+ /**
1173
+ * 抽屉确定
1174
+ * @param { Function } cb
1175
+ * @param { Function } error
1176
+ */
1177
+ const columnCheckConfirm = async (cb, error) => {
1178
+ try {
1179
+ const value = columnCheckDrawer.value.syncTableColumnsToCookies()
1180
+ columnCheckConfirmFeedback(value)
1181
+ await syncCookiesToLocalShowColumn()
1182
+ await syncCookiesToTableColumn()
1183
+ emit('fieldsChange', localShowColumn.value)
1184
+ cb()
1185
+ } catch (e) {
1186
+ error()
1187
+ console.log(e)
1188
+ }
1189
+ }
1190
+
1191
+ /**
1192
+ * 计算表格高度
1193
+ */
1194
+ const calcTableHeight = () => {
1195
+ if (
1196
+ props.calHeight && nfTableContent.value
1197
+ ) {
1198
+ const tableContentH = nfTableContent.value?.offsetHeight
1199
+ const actionH = nfTableActionContainerRef.value.offsetHeight
1200
+ const h = tableContentH - actionH
1201
+ if (h > 0) {
1202
+ elTableHeight.value = h
1203
+ }
1204
+ } else {
1205
+ elTableHeight.value = props.tableAttrs?.height
1206
+ }
1207
+ }
1208
+
1209
+ onMounted(() => {
1210
+ calcTableHeight()
1211
+ props.columns.forEach(i => {
1212
+ if (i.singleHeadMutiColSlot) {
1213
+ console.log('🔅 ~ onMounted ~ props.columns:', props.columns)
1214
+ }
1215
+ })
1216
+ })
1217
+
1218
+
1219
+ defineExpose({
1220
+ /**
1221
+ * 表格clearFilter
1222
+ */
1223
+ clearFilter,
1224
+ /**
1225
+ * 表格sort
1226
+ */
1227
+ sort,
1228
+ /**
1229
+ * 表格doLayout
1230
+ */
1231
+ doLayout,
1232
+ /**
1233
+ * 表格clearSort
1234
+ */
1235
+ clearSort,
1236
+ /**
1237
+ * 表格setCurrentRow
1238
+ */
1239
+ setCurrentRow,
1240
+ /**
1241
+ * 表格toggleRowExpansion
1242
+ */
1243
+ toggleRowExpansion,
1244
+ /**
1245
+ * 表格toggleAllSelection
1246
+ */
1247
+ toggleAllSelection,
1248
+ /**
1249
+ * 表格toggleRowSelection
1250
+ */
1251
+ toggleRowSelection,
1252
+ /**
1253
+ * 表格clearSelection
1254
+ */
1255
+ clearSelection,
1256
+ /**
1257
+ * 表单重置
1258
+ */
1259
+ resetNfSearchFormModel,
1260
+ /**
1261
+ * 表单验证
1262
+ */
1263
+ onNfSearchFormValidate,
1264
+ /**
1265
+ * 表单搜索
1266
+ */
1267
+ onNfSearchFormSearch,
1268
+ /**
1269
+ * 表单导出
1270
+ */
1271
+ onNfSearchFormExport,
1272
+ /**
1273
+ * 表格nf-table ref(div)
1274
+ */
1275
+ nfTableRef,
1276
+ /**
1277
+ * 表格el-table ref
1278
+ */
1279
+ elTableRef,
1280
+ /**
1281
+ * 表格actionBar ref(div)
1282
+ */
1283
+ nfTableActionContainerRef,
1284
+ /**
1285
+ * 表格actionBar ref(slot)
1286
+ */
1287
+ nfTableActionBarRef,
1288
+ /**
1289
+ * 表格pagination ref
1290
+ */
1291
+ nfTablePaginationRef,
1292
+ /**
1293
+ * 表单nf-search-form ref
1294
+ */
1295
+ nfSearchFormRef,
1296
+ /**
1297
+ * loadingInstance
1298
+ */
1299
+ loadingInstance,
1300
+ /**
1301
+ * 列编辑dialog/drawer显示/隐藏
1302
+ */
1303
+ nfColumCheckDialogVisible,
1304
+ /**
1305
+ * 列编辑nf-drawer ref
1306
+ */
1307
+ columnCheckNfDrawer,
1308
+ /**
1309
+ * 列编辑column-check-dialog ref
1310
+ */
1311
+ columnCheckDialog,
1312
+ /**
1313
+ * 列编辑column-check-drawer ref
1314
+ */
1315
+ columnCheckDrawer,
1316
+ /**
1317
+ * showItems同步props.formOptions[i].initHidden
1318
+ */
1319
+ syncShowItemToInitHidden,
1320
+ /**
1321
+ * 分页数据(处理前端分页和后端分页)
1322
+ */
1323
+ showData,
1324
+ /**
1325
+ * 列编辑显示的列prop
1326
+ */
1327
+ localShowColumn,
1328
+ /**
1329
+ * 渲染表格项数据
1330
+ */
1331
+ tableColumns,
1332
+ /**
1333
+ * 计算表格高度
1334
+ */
1335
+ calcTableHeight,
1336
+ /**
1337
+ * 列编辑同步组件到cookies
1338
+ */
1339
+ syncLocalShowColumnToCookies,
1340
+ /**
1341
+ * 列编辑同步cookies到组件localShowItems
1342
+ */
1343
+ syncCookiesToLocalShowColumn,
1344
+ /**
1345
+ * 列编辑同步cookies到组件渲染数据
1346
+ */
1347
+ syncCookiesToTableColumn,
1348
+ elTableRefKey,
1349
+ clearDragCached,
1350
+ clearColumnEditCached
1351
+ })
1352
+
1353
+ </script>