@lx-frontend/wrap-element-ui 1.0.1-beta.6 → 1.0.1-beta.7
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/package.json +1 -1
- package/src/components/EditableTable/bizHooks/index.ts +17 -0
- package/src/components/EditableTable/{useColumnHeaderOperation.ts → bizHooks/useColumnHeaderOperation.ts} +6 -6
- package/src/components/EditableTable/{useDefaultOperation.ts → bizHooks/useDefaultOperation.ts} +1 -1
- package/src/components/EditableTable/{useDragSort.ts → bizHooks/useDragSort.ts} +1 -1
- package/src/components/EditableTable/{usePagination.ts → bizHooks/usePagination.ts} +1 -1
- package/src/components/EditableTable/{useRowBgColor.ts → bizHooks/useRowBgColor.ts} +7 -7
- package/src/components/EditableTable/{useViewSetting.ts → bizHooks/useViewSetting.ts} +64 -65
- package/src/components/EditableTable/{viewColorSelect.vue → features/bizColorSelect.vue} +3 -3
- package/src/components/EditableTable/features/bizEditCell.vue +44 -0
- package/src/components/EditableTable/features/bizTableHeaderPopover.vue +202 -0
- package/src/components/EditableTable/features/bizViewSettingDialog.vue +137 -0
- package/src/components/EditableTable/index.less +13 -4
- package/src/components/EditableTable/index.vue +76 -331
- package/src/components/EditableTable/{types.ts → types/index.ts} +116 -116
- /package/src/components/EditableTable/{useCellHover.ts → bizHooks/useCellHover.ts} +0 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
title="显示设置"
|
|
4
|
+
:visible.sync="viewSettingVisible"
|
|
5
|
+
width="750px"
|
|
6
|
+
top="12vh"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
append-to-body
|
|
9
|
+
custom-class="view-setting__dialog"
|
|
10
|
+
>
|
|
11
|
+
<div class="view-setting__content">
|
|
12
|
+
<div class="view-setting__content-left">
|
|
13
|
+
<div class="view-setting__checkbox-wrapper">
|
|
14
|
+
<el-checkbox-group v-model="columnsToBeShown">
|
|
15
|
+
<el-checkbox
|
|
16
|
+
v-for="item in props.columnConfig"
|
|
17
|
+
:key="item.label"
|
|
18
|
+
:label="item.prop"
|
|
19
|
+
:disabled="item.isAlwaysShow"
|
|
20
|
+
>
|
|
21
|
+
<div class="view-setting__content-left-item">
|
|
22
|
+
{{ item.label }}
|
|
23
|
+
</div>
|
|
24
|
+
</el-checkbox>
|
|
25
|
+
</el-checkbox-group>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="view-setting__content-right">
|
|
29
|
+
<div class="view-setting__content-right-title">
|
|
30
|
+
已选择
|
|
31
|
+
<div class="view-setting__selected-count">
|
|
32
|
+
{{ columnsToBeShown.length }}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="view-setting__content-right-frize">
|
|
36
|
+
冻结前
|
|
37
|
+
<el-input
|
|
38
|
+
class="view-setting__content-right-input"
|
|
39
|
+
:value="tempLeftFixedColumnCount"
|
|
40
|
+
@input="handleInputTempLeftFixedColumnCount"
|
|
41
|
+
/>
|
|
42
|
+
列
|
|
43
|
+
</div>
|
|
44
|
+
<div class="view-setting__content-right-selected">
|
|
45
|
+
<div
|
|
46
|
+
v-for="(item, index) in viewSettingDragSortOptions"
|
|
47
|
+
:key="item.prop"
|
|
48
|
+
class="view-setting__selected-item view-setting-draggable-item"
|
|
49
|
+
>
|
|
50
|
+
<div class="view-setting__selected-item-left">
|
|
51
|
+
<div
|
|
52
|
+
class="view-setting-drag-target view-setting__icon-wrapper"
|
|
53
|
+
:data-index="index"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
class="view-setting-drag-target editable-table-drag-icon"
|
|
57
|
+
:data-index="index"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="view-setting__selected-item-name">
|
|
61
|
+
{{ item.label }}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div
|
|
65
|
+
:class="['view-setting__selected-item-close', item.isAlwaysShow ? 'view-setting__selected-item-close--disabled' : '']"
|
|
66
|
+
@click="handleColumnClose(item)"
|
|
67
|
+
>
|
|
68
|
+
<i class="el-icon-close" />
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<template #footer>
|
|
75
|
+
<el-button @click="handleViewSettingClose">
|
|
76
|
+
取消
|
|
77
|
+
</el-button>
|
|
78
|
+
<el-button
|
|
79
|
+
type="primary"
|
|
80
|
+
@click="handleViewSettingConfirm"
|
|
81
|
+
>
|
|
82
|
+
确认
|
|
83
|
+
</el-button>
|
|
84
|
+
</template>
|
|
85
|
+
</el-dialog>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script setup lang="ts">
|
|
89
|
+
import { toRefs } from 'vue';
|
|
90
|
+
import { useViewSetting } from '../bizHooks'
|
|
91
|
+
import { IColumnConfig, IProps } from '../types';
|
|
92
|
+
|
|
93
|
+
const emit = defineEmits<{
|
|
94
|
+
(e: 'update:leftFixedColumnCount', val: number): void
|
|
95
|
+
(e: 'update:showingColumns', val: string[]): void
|
|
96
|
+
(e: 'update:viewSettingDragSortOptions', val: IColumnConfig[]): void
|
|
97
|
+
(e: 'tableDoLayout'): void
|
|
98
|
+
}>()
|
|
99
|
+
|
|
100
|
+
const _props = defineProps<{
|
|
101
|
+
actualColumns: IColumnConfig[]
|
|
102
|
+
viewSettingDragSortOptions: IColumnConfig[]
|
|
103
|
+
showingColumns: string[]
|
|
104
|
+
props: IProps
|
|
105
|
+
}>()
|
|
106
|
+
|
|
107
|
+
const {
|
|
108
|
+
actualColumns,
|
|
109
|
+
showingColumns,
|
|
110
|
+
viewSettingDragSortOptions,
|
|
111
|
+
} = toRefs(_props)
|
|
112
|
+
|
|
113
|
+
const {
|
|
114
|
+
columnsToBeShown,
|
|
115
|
+
viewSettingVisible,
|
|
116
|
+
tempLeftFixedColumnCount,
|
|
117
|
+
handleInputTempLeftFixedColumnCount,
|
|
118
|
+
handleViewSettingShow,
|
|
119
|
+
handleViewSettingClose,
|
|
120
|
+
handleViewSettingConfirm
|
|
121
|
+
} = useViewSetting({
|
|
122
|
+
showingColumns,
|
|
123
|
+
actualColumns,
|
|
124
|
+
viewSettingDragSortOptions,
|
|
125
|
+
props: _props.props,
|
|
126
|
+
emit,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const handleColumnClose = (item) => {
|
|
130
|
+
if (item.isAlwaysShow) return;
|
|
131
|
+
columnsToBeShown.value = columnsToBeShown.value.filter(c => c !== item.prop);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
defineExpose({
|
|
135
|
+
open: handleViewSettingShow
|
|
136
|
+
})
|
|
137
|
+
</script>
|
|
@@ -198,13 +198,19 @@
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
& .cell {
|
|
201
|
-
font-size:
|
|
201
|
+
font-size: 12px;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
.el-table__fixed-body-wrapper {
|
|
206
206
|
background: #fff;
|
|
207
207
|
}
|
|
208
|
+
|
|
209
|
+
.el-checkbox__input.is-checked .el-checkbox__inner,
|
|
210
|
+
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
|
211
|
+
background: @--theme-blue--;
|
|
212
|
+
border-color: @--theme-blue--;
|
|
213
|
+
}
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
.view-setting {
|
|
@@ -525,8 +531,8 @@
|
|
|
525
531
|
|
|
526
532
|
.el-checkbox__input.is-checked .el-checkbox__inner,
|
|
527
533
|
.el-radio__input.is-checked .el-radio__inner {
|
|
528
|
-
background:
|
|
529
|
-
border-color:
|
|
534
|
+
background: @--theme-blue--;
|
|
535
|
+
border-color: @--theme-blue--;
|
|
530
536
|
}
|
|
531
537
|
}
|
|
532
538
|
|
|
@@ -642,7 +648,7 @@
|
|
|
642
648
|
|
|
643
649
|
.editable-table {
|
|
644
650
|
& table th {
|
|
645
|
-
font-size:
|
|
651
|
+
font-size: 12px;
|
|
646
652
|
font-weight: bold;
|
|
647
653
|
}
|
|
648
654
|
|
|
@@ -650,6 +656,9 @@
|
|
|
650
656
|
font-size: 12px;
|
|
651
657
|
color: #13161b;
|
|
652
658
|
}
|
|
659
|
+
.el-table th > .cell {
|
|
660
|
+
color: #5b6984
|
|
661
|
+
}
|
|
653
662
|
}
|
|
654
663
|
|
|
655
664
|
.no-inner-cell-border {
|