@v2coding/ui 0.1.4 → 0.1.8

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/v2coding-ui.esm.js +1452 -679
  3. package/dist/v2coding-ui.min.js +1 -1
  4. package/dist/v2coding-ui.ssr.js +1469 -679
  5. package/package.json +2 -3
  6. package/src/components/dialog/dialog.vue +0 -179
  7. package/src/components/drawer/drawer.vue +0 -523
  8. package/src/components/exports/index.vue +0 -53
  9. package/src/components/exports/remote-exports-dialog.vue +0 -202
  10. package/src/components/field/field.autocomplete.vue +0 -21
  11. package/src/components/field/field.calendar.vue +0 -117
  12. package/src/components/field/field.cascade.vue +0 -233
  13. package/src/components/field/field.checkbox.vue +0 -134
  14. package/src/components/field/field.color.vue +0 -24
  15. package/src/components/field/field.date.vue +0 -145
  16. package/src/components/field/field.icons.vue +0 -123
  17. package/src/components/field/field.number.vue +0 -43
  18. package/src/components/field/field.radio.vue +0 -100
  19. package/src/components/field/field.rate.vue +0 -37
  20. package/src/components/field/field.rich.vue +0 -155
  21. package/src/components/field/field.select.vue +0 -210
  22. package/src/components/field/field.slider.vue +0 -66
  23. package/src/components/field/field.switch.vue +0 -14
  24. package/src/components/field/field.text.vue +0 -66
  25. package/src/components/field/field.timepicker.vue +0 -70
  26. package/src/components/field/field.timeselect.vue +0 -24
  27. package/src/components/field/field.trigger.dialog.vue +0 -50
  28. package/src/components/field/field.trigger.popover.vue +0 -63
  29. package/src/components/field/field.upload.file.vue +0 -241
  30. package/src/components/field/field.upload.image.vue +0 -125
  31. package/src/components/fill-view/fill-view.vue +0 -43
  32. package/src/components/form/form.dialog.vue +0 -174
  33. package/src/components/form/form.drawer.vue +0 -246
  34. package/src/components/form/form.fieldset.vue +0 -110
  35. package/src/components/form/form.item.vue +0 -210
  36. package/src/components/form/form.vue +0 -302
  37. package/src/components/head-menu/head-menu.vue +0 -188
  38. package/src/components/head-menu/menu-item.vue +0 -80
  39. package/src/components/history/history.vue +0 -361
  40. package/src/components/icon/icon.vue +0 -63
  41. package/src/components/minimize/minimize.vue +0 -342
  42. package/src/components/page/page.vue +0 -43
  43. package/src/components/page/search-page.vue +0 -202
  44. package/src/components/provider/provider.vue +0 -15
  45. package/src/components/scroll-view/scroll-view.vue +0 -384
  46. package/src/components/table/column.vue +0 -262
  47. package/src/components/table/table.pagination.vue +0 -71
  48. package/src/components/table/table.select.vue +0 -165
  49. package/src/components/table/table.vue +0 -807
@@ -1,807 +0,0 @@
1
- <template>
2
- <div class="ui-table" v-loading="realLoading">
3
- <div class="ui-table-select-bar" v-show="hasSearchBar && searchBarVisible">
4
- <slot name="search-bar"/>
5
- </div>
6
- <div class="ui-table-tool-bar" v-if="hasToolbar">
7
- <slot name="tool-bar"/>
8
- </div>
9
- <div v-if="hasAlert" class="ui-table-alert">
10
- <i class="el-icon-info"></i>
11
- <slot name="alert">
12
- 已选择 {{ selection.length }} 条.
13
- <el-button type="text" @click="clearSelection">清空</el-button>
14
- </slot>
15
- </div>
16
- <div style="position: relative;z-index: 1;">
17
- <div v-if="privateTools && privateTools.length > 0" class="private-tools">
18
- <div v-for="(tool, i) in privateTools" :key="i" class="tool">
19
- <component :is="tool"></component>
20
- </div>
21
- </div>
22
- </div>
23
- <fill-view>
24
- <el-table
25
- ref="table"
26
- height="100%"
27
- :data="realData"
28
- :border="border"
29
- :class="tableCls"
30
- v-bind="$attrs"
31
- v-on="$listeners"
32
- @selection-change="onSelectionChange"
33
- @row-click="onRowClick"
34
- @row-dblclick="onRowDblClick"
35
- @cell-dblclick="onCellDbClick"
36
- @select-all="onSelectAll"
37
- @select="onSelect"
38
- >
39
- <slot></slot>
40
- <component v-for="(column, i) in columns" :key="i" :is="column.componentName || 'ui-table-column'" v-bind="column" v-on="column.listeners"></component>
41
- <template v-slot:empty>
42
- <div class="ui-table-empty">暂无数据</div>
43
- </template>
44
- </el-table>
45
- </fill-view>
46
- <div v-show="hasPagination" class="footer-bar">
47
- <slot name="footer-bar"/>
48
- </div>
49
- <remote-exports-dialog :visible.sync="exportsVisible" :current-page="remoteData && remoteData.no" :total-page="remoteData && remoteData.totalPages" v-bind-table:table @exports="onRemoteExports"/>
50
- </div>
51
- </template>
52
- <script>
53
- import FillView from '../fill-view/fill-view';
54
- import ExportsMixin from '../exports/mixin';
55
- import RemoteExportsDialog from '../exports/remote-exports-dialog';
56
-
57
- let tableIdSeed = 1;
58
-
59
- export default {
60
- name: 'ui-table',
61
- provide() {
62
- return {
63
- uiTable: this,
64
- };
65
- },
66
- mixins: [ExportsMixin],
67
- props: {
68
- url: String,
69
- data: Array,
70
- params: {
71
- type: Object,
72
- default: () => ({}),
73
- },
74
- loading: Boolean,
75
- searchBarInitVisible: {
76
- type: Boolean,
77
- default: true,
78
- },
79
- initLoad: {
80
- type: Boolean,
81
- default: true,
82
- },
83
- showButton: {
84
- type: Boolean,
85
- default: true,
86
- },
87
- alert: Boolean,
88
- privateTools: {
89
- type: Array,
90
- default() {
91
- // return ['refresh', 'columns'];
92
- return ['columns'];
93
- },
94
- },
95
- columns: Array,
96
- border: {
97
- type: Boolean,
98
- default: false,
99
- },
100
- tableCls: String,
101
- editValid: {
102
- type: Function,
103
- default: () => void 0,
104
- },
105
- editCellValid: {
106
- type: Function,
107
- default: () => void 0,
108
- },
109
- selectionMode: {
110
- type: String,
111
- validator: (val) => ['single', 'multiple'].includes(val),
112
- default: 'single',
113
- },
114
- onSelect: {
115
- type: Function,
116
- default: () => void 0,
117
- },
118
- changeLoadedData: {
119
- type: Function,
120
- default: (res) => res,
121
- },
122
- rowSelect: {
123
- type: Boolean,
124
- default: true,
125
- },
126
- },
127
- data() {
128
- this.tablePageParams = {}; // tablePageParams 不用监听
129
- return {
130
- selection: [],
131
- cols: [],
132
- remoteData: null,
133
- searchBar: null,
134
- pagination: null,
135
- remoteLoading: false,
136
- exportsVisible: false,
137
- searchBarVisible: this.searchBarInitVisible,
138
- isTree: false, // 当前 table 是否含有 tree 列(用于: 含有 tree 时所有的列取消排序)
139
- editData: null,
140
- editPosition: null,
141
- };
142
- },
143
- computed: {
144
- hasSearchBar() {
145
- return !!this.searchBar;
146
- },
147
- hasToolbar() {
148
- if (this.showButton === false) {
149
- return false;
150
- }
151
- return !!this.$scopedSlots['tool-bar'];
152
- },
153
- hasAlert() {
154
- if (!this.alert) {
155
- return false;
156
- }
157
- return !!this.cols.find((column) => column.type === 'selection');
158
- },
159
- hasPagination() {
160
- return !!this.pagination;
161
- },
162
- realData() {
163
- if (this.remoteData) {
164
- if (this.hasPagination) {
165
- return this.remoteData.data;
166
- }
167
- return this.remoteData;
168
- }
169
- return this.data;
170
- },
171
- realLoading() {
172
- if (this.loading) {
173
- return true;
174
- }
175
- return this.remoteLoading;
176
- },
177
- controlColumns() {
178
- return this.cols.filter((column) => !['selection', 'action'].includes(column.type));
179
- },
180
- },
181
- watch: {
182
- url() {
183
- this.reload();
184
- },
185
- params() {
186
- this.reload();
187
- },
188
- async realData() {
189
- await this.$nextTick();
190
- setTimeout(() => {
191
- this.doLayout();
192
- }, 200);
193
- },
194
- },
195
- created() {
196
- this.uiTableId = 'ui-table_' + tableIdSeed++;
197
- this.listeners = {
198
- func: () => void 0,
199
- register: (func) => {
200
- this.listeners.func = func;
201
- },
202
- trigger: (...args) => {
203
- this.listeners.func(...args);
204
- },
205
- };
206
- },
207
- mounted() {
208
- this.init();
209
- this.$root.$on('resize', this.onResize);
210
- this.onResize();
211
- },
212
- beforeDestroy() {
213
- this.$root.$off('resize', this.onResize);
214
- },
215
- methods: {
216
- getExported() {
217
- return {
218
- // table methods
219
- clearSelection: this.$refs.table.clearSelection,
220
- toggleRowSelection: this.$refs.table.toggleRowSelection,
221
- toggleAllSelection: this.$refs.table.toggleAllSelection,
222
- toggleRowExpansion: this.$refs.table.toggleRowExpansion,
223
- setCurrentRow: this.$refs.table.setCurrentRow,
224
- clearSort: this.$refs.table.clearSort,
225
- clearFilter: this.$refs.table.clearFilter,
226
- doLayout: this.$refs.table.doLayout,
227
- sort: this.$refs.table.sort,
228
- // current component methods
229
- reload: this.reload,
230
- getSelection: this.getSelection,
231
- getColumns: this.getColumns,
232
- editRow: this.editRow,
233
- };
234
- },
235
- init() {
236
- if (this.hasSearchBar) {
237
- // 在 searchBar 中执行加载数据方法
238
- return;
239
- }
240
- this.initLoad && this.reload();
241
- },
242
- onResize() {
243
- this.doLayout();
244
- },
245
- resetTableParams() {
246
- this.initPaginationParams();
247
- },
248
- changePage(params = {}) {
249
- this.tablePageParams = params;
250
- this.reload();
251
- },
252
- reload(params) {
253
- if (!this.url) {
254
- return;
255
- }
256
- if (this.remoteLoading) {
257
- return;
258
- }
259
- this.fetchData(params).then((res) => {
260
- if (this.hasPagination) {
261
- const { data, totalPages, no } = res;
262
- if (Array.isArray(data) && data.length <= 0 && no !== 1) {
263
- this.tablePageParams.no = totalPages;
264
- this.reload(params);
265
- return;
266
- }
267
- }
268
- this.remoteData = this.changeLoadedData(res);
269
- this.$emit('loaded', res);
270
- });
271
- },
272
- getSelection() {
273
- return this.selection;
274
- },
275
- getColumns() {
276
- return this.$refs.table.columns.map(column => column.property).filter(Boolean);
277
- },
278
- getHeaders() {
279
- const getAllHeaders = (columns, parents = []) => {
280
- return columns.reduce((headers, column) => {
281
- if (column.children) {
282
- const _parents = [...parents];
283
- column.label && _parents.push(column.label);
284
- headers.push(...getAllHeaders(column.children, [..._parents]));
285
- } else {
286
- column.property && column.label && headers.push([...parents, column.label]);
287
- }
288
- return headers;
289
- }, []);
290
- };
291
- return getAllHeaders(this.$refs.table.store.states.originColumns);
292
- },
293
- getSearchParams() {
294
- if (this.searchBar) {
295
- return this.searchBar.getSearchParams();
296
- }
297
- return {};
298
- },
299
- doLayout() {
300
- this.$refs.table && this.$refs.table.doLayout();
301
- },
302
- setCurrentRow(row) {
303
- this.$refs.table.setCurrentRow(row);
304
- },
305
- editRow(index) {
306
- const editable = this.cols.some(col => col.editable);
307
- if (!editable) {
308
- return;
309
- }
310
- const rowData = this.$refs.table.tableData[index];
311
- this.editData = JSON.parse(JSON.stringify(rowData));
312
- this.editPosition = {
313
- rowIndex: index,
314
- };
315
- },
316
- /**
317
- * @private
318
- */
319
- fetchData(params) {
320
- this.remoteLoading = true;
321
- const searchParams = this.getSearchParams();
322
- return this.$axios.get(this.url, {
323
- params: Object.assign({}, this.tablePageParams, searchParams, this.params, params || {}),
324
- ...(this.hasPagination ? {} : {fallback: Array}), // list table 期望返回数组(网络请求错误时默认期望返回 Result)
325
- }).then((r) => {
326
- this.remoteLoading = false;
327
- if (r.success) {
328
- return Promise.resolve(r.data);
329
- }
330
- return Promise.resolve(this.hasPagination ? {no: 1, size: 0, data: [], total: 0, totalPages: 1} : []);
331
- }).catch(() => {
332
- this.remoteLoading = false;
333
- return Promise.resolve(this.hasPagination ? {no: 1, size: 0, data: [], total: 0, totalPages: 1} : []);
334
- });
335
- },
336
- /**
337
- * @private
338
- */
339
- registerSearchBar(searchBar) {
340
- this.searchBar = searchBar;
341
- },
342
- /**
343
- * @private
344
- */
345
- registerPagination(pagination) {
346
- this.pagination = pagination;
347
- this.initPaginationParams();
348
- },
349
- /**
350
- * @private
351
- */
352
- unRegisterPagination() {
353
- this.removePaginationParams();
354
- this.pagination = null;
355
- },
356
- /**
357
- * @private
358
- */
359
- initPaginationParams() {
360
- if (!this.pagination) {
361
- return;
362
- }
363
- this.tablePageParams = this.pagination.getInitParams();
364
- },
365
- removePaginationParams() {
366
- if (!this.pagination) {
367
- return;
368
- }
369
- this.tablePageParams = {};
370
- },
371
- /**
372
- * @private
373
- */
374
- clearSelection() {
375
- this.$refs.table.clearSelection();
376
- },
377
- /**
378
- * Events
379
- */
380
- toggleSearchBarVisible() {
381
- this.searchBarVisible = !this.searchBarVisible;
382
- },
383
- toggleControlColumn(i) {
384
- const column = this.controlColumns[i];
385
- if (!column) {
386
- return;
387
- }
388
- column.visible = !column.visible;
389
- },
390
- onSelectionChange(selection) {
391
- let selects = selection;
392
- if (this.selectionMode === 'single') {
393
- const tableStoreStates = this.$refs.table.store.states;
394
- const isAllSelected = tableStoreStates.isAllSelected;
395
- const tableSelection = tableStoreStates.selection;
396
- if (isAllSelected && (tableStoreStates.data || []).length === tableStoreStates.selection.length) {
397
- selects = [];
398
- selection.forEach(row => {
399
- const i = tableSelection.indexOf(row);
400
- i !== -1 && tableSelection.splice(i, 1);
401
- this.$refs.table.toggleRowSelection(row, false);
402
- });
403
- } else {
404
- selects = selection.slice(selection.length - 1, selection.length);
405
- selection.slice(0, selection.length - 1).forEach(row => {
406
- const i = tableSelection.indexOf(row);
407
- i !== -1 && tableSelection.splice(i, 1);
408
- this.$refs.table.toggleRowSelection(row, false);
409
- });
410
- }
411
- }
412
- this.selection = selects;
413
- },
414
- onRowClick(row) {
415
- if (!this.rowSelect) {
416
- return;
417
- }
418
- const currentRowIndex = this.$refs.table.tableData.indexOf(row);
419
- if (this.editPosition && this.editPosition.rowIndex === currentRowIndex) {
420
- return;
421
- }
422
- this.$refs.table.toggleRowSelection(row);
423
- },
424
- onRowDblClick(row) {
425
- this.$emit('select-change', [row]);
426
- },
427
- onCellDbClick(row, column) {
428
- const col = this.cols.find(c => c.columnId === column.id);
429
- if (!col.editable) {
430
- return;
431
- }
432
- const currentRowIndex = this.$refs.table.tableData.indexOf(row);
433
- // row edit
434
- if (this.editPosition && !this.editPosition.columnId && this.editPosition.rowIndex === currentRowIndex) {
435
- return;
436
- }
437
- if (this.editPosition && this.editPosition.rowIndex === currentRowIndex && this.editPosition.columnId === column.id) {
438
- return;
439
- }
440
- this.editPosition = {
441
- rowIndex: currentRowIndex,
442
- columnId: column.id,
443
- prop: column.property,
444
- };
445
- this.editData = JSON.parse(JSON.stringify(row));
446
- },
447
- onSelectAll() {
448
- if (this.selectionMode === 'single') {
449
- this.$refs.table.clearSelection();
450
- }
451
- },
452
- /**
453
- * @private
454
- */
455
- addColumn(column) {
456
- const isAdded = this.cols.some((c) => c.id === column.id);
457
- if (isAdded) {
458
- return;
459
- }
460
- this.cols.push(Object.freeze({
461
- id: column.id,
462
- type: column.type,
463
- label: column.label,
464
- visible: column.visible !== false,
465
- editable: column.editable,
466
- instance: column.instance,
467
- columnId: '',
468
- }));
469
- if (column.type === 'tree') {
470
- this.isTree = true;
471
- }
472
- },
473
- removeColumn(columnId) {
474
- const index = this.cols.findIndex((c) => c.id === columnId);
475
- if (index === -1) {
476
- return;
477
- }
478
- this.cols.splice(index, 1);
479
- },
480
- updateColumnId(id, columnId) {
481
- const index = this.cols.findIndex((c) => c.id === id);
482
- if (index === -1) {
483
- return;
484
- }
485
- this.cols.splice(index, 1, Object.freeze({...this.cols[index], columnId}));
486
- },
487
- updateColumnVisible(id, visible) {
488
- const index = this.cols.findIndex((c) => c.id === id);
489
- if (index === -1) {
490
- return;
491
- }
492
- this.cols.splice(index, 1, Object.freeze({...this.cols[index], visible}));
493
- },
494
- /**
495
- * @private
496
- */
497
- getVisible(id) {
498
- const column = this.cols.find((column) => column.id === id);
499
- if (!column) {
500
- return true;
501
- }
502
- return column.visible !== false;
503
- },
504
- getTableDom() {
505
- const table = this.$el.querySelector('.el-table').cloneNode(true);
506
- table.querySelector('.el-table__fixed').remove(); // 删除左边fixed
507
- table.querySelector('.el-table__fixed-right').remove(); // 删除右边fixed
508
- Array.from(table.querySelectorAll('.ui-table-column-action')).forEach(node => node.remove()); // 删除操作列
509
- Array.from(table.querySelectorAll('.ui-table-column-selection')).forEach(node => node.remove()); // 删除选择列
510
- return table;
511
- },
512
- cancelEdit() {
513
- this.editData = null;
514
- this.editPosition = null;
515
- },
516
- saveEdit() {
517
- const valid = this.editValid(this.editData);
518
- if (valid === false) {
519
- return;
520
- }
521
- this.$emit('edit-row', this.editData);
522
- this.$refs.table.tableData.splice(this.editPosition.rowIndex, 1, this.editData);
523
- this.cancelEdit();
524
- },
525
- saveEditCell() {
526
- const columnProp = this.editPosition.prop;
527
- const originalValue = this.$refs.table.tableData[this.editPosition.rowIndex][columnProp];
528
- const cellValue = this.editData[columnProp];
529
- if (originalValue === cellValue) {
530
- this.cancelEdit();
531
- return;
532
- }
533
- const valid = this.editCellValid(cellValue, this.editData, columnProp);
534
- if (valid === false) {
535
- return;
536
- }
537
- this.$emit('edit-cell', cellValue, this.editData, columnProp);
538
- this.$refs.table.tableData.splice(this.editPosition.rowIndex, 1, this.editData);
539
- this.cancelEdit();
540
- },
541
- exportEntity(url = '', filename = '文件.xlsx') {
542
- if (!url) {
543
- console.error(`请指定 export api 请求地址`);
544
- return;
545
- }
546
-
547
- const searchParams = this.getSearchParams();
548
- const columns = this.getColumns();
549
- const headers = this.getHeaders();
550
- this.$axios.download(url, filename, {params: {...searchParams, columns: columns.join(','), headers: JSON.stringify(headers)}});
551
- },
552
- exportsLocal(filename) {
553
- if (!this.$refs.table) {
554
- return;
555
- }
556
- return this.exportsTable(filename, this.$refs.table);
557
- },
558
- exportsRemote(filename) {
559
- this.exportsVisible = true;
560
- this.listeners.register((params) => {
561
- const {start, end, columns} = params;
562
- const loading = this.$loading({
563
- lock: true,
564
- text: 'Loading',
565
- spinner: 'el-icon-loading',
566
- background: 'rgba(0, 0, 0, 0.7)',
567
- });
568
- const searchParams = this.getSearchParams();
569
- const requestParams = {...searchParams, no: 1, size: end * this.tablePageParams.size};
570
- this.$axios.get(this.url, {params: requestParams}).then(result => {
571
- loading.close();
572
- const {data = []} = result.data || {};
573
- const list = data.slice((start - 1) * this.tablePageParams.size);
574
- this.exports(list, filename, columns);
575
- }).catch(() => {
576
- loading.close();
577
- this.$message.error('导出失败');
578
- });
579
- });
580
- },
581
- onRemoteExports(params) {
582
- this.listeners.trigger(params);
583
- },
584
- // print() {
585
- // this.$print(this.getTableDom());
586
- // },
587
- // excel() {
588
- // const wb = XLSX.utils.table_to_book(this.getTableDom());
589
- // const wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: true, type: 'array'});
590
- // try {
591
- // FileSaver.saveAs(new Blob([wbout], {type: 'application/octet-stream'}), 'sheetjs.xlsx');
592
- // } catch (e) {
593
- // console.error(e, wbout);
594
- // }
595
- // return wbout;
596
- // },
597
- },
598
- components: {
599
- FillView,
600
- RemoteExportsDialog,
601
- Refresh: {
602
- render(createElement) {
603
- return createElement('el-tooltip', {props: {content: '刷新'}}, [
604
- createElement('el-button', {
605
- props: {icon: 'el-icon-refresh', size: 'mini', circle: true},
606
- on: {click: this.$parent.reload},
607
- }),
608
- ]);
609
- },
610
- },
611
- Exports: {
612
- render(createElement) {
613
- return createElement('el-tooltip', {props: {content: '导出Excel'}}, [
614
- createElement('el-button', {
615
- props: {icon: 'el-icon-download', size: 'mini', circle: true},
616
- on: {click: this.$parent.exportsRemote},
617
- }),
618
- ]);
619
- },
620
- },
621
- Columns: {
622
- render(createElement) {
623
- const {controlColumns, updateColumnVisible} = this.$parent;
624
- // 非固定宽度列
625
- const scalableColumns = controlColumns.filter(col => {
626
- const colInstance = col.instance;
627
- return !colInstance.realWidth && colInstance.minWidth && !colInstance.realFixed;
628
- });
629
- const visibleScalableColumns = scalableColumns.filter(c => c.visible);
630
- let disabledColumn;
631
- if (visibleScalableColumns.length <= 1) {
632
- disabledColumn = visibleScalableColumns[0];
633
- }
634
- // 通过其它方式把 非固定宽度列 全部隐藏. 这里需要满足至少展示一个 非固定宽度列
635
- if (visibleScalableColumns.length <= 0) {
636
- const defaultVisibleColumn = scalableColumns[0]
637
- defaultVisibleColumn && updateColumnVisible(defaultVisibleColumn.id, true);
638
- }
639
- return createElement('el-dropdown', {props: {trigger: 'click', hideOnClick: false}}, [
640
- createElement('el-tooltip', {props: {content: '设置显示列'}}, [
641
- createElement('el-button', {props: {icon: 'el-icon-more', circle: true, size: 'mini'}})
642
- ]),
643
- createElement('el-dropdown-menu', {slot: 'dropdown'}, controlColumns.map((column, i) => {
644
- return createElement('el-dropdown-item', {key: i}, [
645
- createElement('el-checkbox', {
646
- props: {value: column.visible, disabled: column === disabledColumn},
647
- on: {
648
- input: () => {
649
- updateColumnVisible(column.id, !column.visible);
650
- this.$parent.$nextTick(() => {
651
- this.$parent.doLayout();
652
- });
653
- },
654
- },
655
- }, [
656
- createElement('span', {attrs: {class: 'column-label'}}, [column.label]),
657
- ]),
658
- ]);
659
- })),
660
- ]);
661
- },
662
- },
663
- Search: {
664
- render(createElement) {
665
- if (!this.$parent.hasSearchBar) {
666
- return null;
667
- }
668
- return createElement('el-tooltip', {props: {content: this.$parent.searchBarVisible ? '隐藏查询区域' : '显示查询区域'}}, [
669
- createElement('el-button', {
670
- props: {icon: 'el-icon-search', circle: true},
671
- on: {click: this.$parent.toggleSearchBarVisible},
672
- }),
673
- ]);
674
- },
675
- },
676
- },
677
- };
678
- </script>
679
- <style lang="less">
680
- .ui-table {
681
- flex: 1;
682
- display: flex;
683
- flex-direction: column;
684
- z-index: 0;
685
- background-color: #fff;
686
- padding: 15px 20px;
687
-
688
- .ui-table-select-bar {
689
- flex: none;
690
-
691
- .ui-table-select {
692
- position: relative;
693
- padding-right: 100px;
694
-
695
- &.has-reset {
696
- padding-right: 200px;
697
- }
698
-
699
- .submit-item {
700
- position: absolute;
701
- top: 0;
702
- right: 0;
703
- margin-right: 0;
704
- margin-bottom: 0;
705
- }
706
- }
707
-
708
- .el-input {
709
- width: 200px;
710
- }
711
- }
712
-
713
- .ui-table-tool-bar {
714
- padding: 10px 0;
715
- flex: none;
716
- display: flex;
717
- flex-wrap: wrap;
718
- align-items: center;
719
- flex-direction: row;
720
- background-color: #fff;
721
- }
722
-
723
- .private-tools {
724
- z-index: 1;
725
- position: absolute;
726
- top: 8px;
727
- right: 5px;
728
- display: flex;
729
- flex-direction: row;
730
- padding-left: 20px;
731
-
732
- .tool + .tool {
733
- margin-left: 5px;
734
- }
735
-
736
- .el-button.el-tooltip {
737
- background: rgba(255, 255, 255, 0.6);
738
- backdrop-filter: blur(3px);
739
- box-shadow: 0 0 3px #999;
740
- }
741
- }
742
-
743
- .ui-table-alert {
744
- margin-bottom: 10px;
745
- border: 1px solid #b3d8ff;
746
- background-color: #ecf5ff;
747
- border-radius: 3px;
748
- padding: 8px 10px;
749
-
750
- .el-icon-info {
751
- color: #409eff;
752
- margin-right: 6px;
753
- }
754
-
755
- .el-button--text {
756
- padding: 0;
757
- margin-left: 10px;
758
- }
759
- }
760
-
761
- .el-table {
762
- flex: 1;
763
- border: 1px solid #EBEEF5;
764
- border-bottom: none;
765
- z-index: 0;
766
- }
767
-
768
- .footer-bar {
769
- flex: none;
770
- display: block;
771
- padding: 20px 15px 15px;
772
- background-color: #fff;
773
-
774
- .el-pagination {
775
- text-align: right;
776
- padding: 0;
777
- }
778
- }
779
-
780
- .ui-table-empty {
781
- padding-top: 110px;
782
- background: url("../../assets/svg/empty.svg") center top no-repeat;
783
- background-size: auto 100px;
784
- color: rgba(0, 0, 0, 0.65);
785
- font-size: 14px;
786
- line-height: 22px;
787
- text-align: center;
788
- }
789
- }
790
-
791
- .column-label {
792
- width: 80px;
793
- display: inline-block;
794
- vertical-align: middle;
795
- overflow: hidden;
796
- text-overflow: ellipsis;
797
- white-space: nowrap;
798
- }
799
-
800
- .ui-table-column-action {
801
- .el-button {
802
- box-shadow: none;
803
- padding: 0;
804
- line-height: inherit;
805
- }
806
- }
807
- </style>