gy-ui-plus 1.0.6 → 1.0.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.
- package/README.md +3 -3
- package/dist/gy-ui-plus.es.js +1764 -1839
- package/dist/gy-ui-plus.umd.js +2 -2
- package/package.json +12 -11
- package/packages/button/src/index.vue +41 -0
- package/packages/button/src/type.ts +11 -0
- package/packages/index.ts +5 -3
- package/packages/layout-page/index.ts +4 -0
- package/packages/layout-page/src/index.vue +75 -0
- package/packages/layout-page/style/index.ts +1 -0
- package/packages/layout-page/style/layout-page.scss +37 -0
- package/packages/table/index.ts +5 -0
- package/packages/table/src/GyTableColumn.vue +100 -0
- package/packages/table/src/index.vue +1073 -0
- package/packages/table/src/operator.vue +203 -0
- package/packages/table/src/renderCol.vue +20 -0
- package/packages/table/src/renderHeader.vue +18 -0
- package/packages/table/src/singleEdit.vue +352 -0
- package/packages/table/src/singleEditCell.vue +301 -0
- package/packages/table/src/tableProps.ts +146 -0
- package/packages/{gy-table → table}/src/useExpose.ts +15 -15
- package/packages/table/style/index.ts +1 -0
- package/packages/table/style/table.scss +348 -0
- package/dist/gy-ui-plus.css +0 -1
- package/packages/gy-button/src/index.vue +0 -29
- package/packages/gy-table/index.ts +0 -8
- package/packages/gy-table/src/TTableColumn.vue +0 -140
- package/packages/gy-table/src/index.vue +0 -1205
- package/packages/gy-table/src/operator.vue +0 -246
- package/packages/gy-table/src/renderCol.vue +0 -24
- package/packages/gy-table/src/renderHeader.vue +0 -18
- package/packages/gy-table/src/singleEdit.vue +0 -406
- package/packages/gy-table/src/singleEditCell.vue +0 -337
- package/packages/gy-table/src/tableProps.ts +0 -174
- package/packages/gy-table/style/table.scss +0 -368
- /package/packages/{gy-button → button}/index.ts +0 -0
- /package/packages/{gy-table → table}/src/ColumnSet.vue +0 -0
- /package/packages/{gy-table → table}/src/useVirtualized.ts +0 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
.t-table {
|
|
2
|
+
z-index: 0;
|
|
3
|
+
background-color: var(--el-bg-color);
|
|
4
|
+
|
|
5
|
+
.el-table__header-wrapper {
|
|
6
|
+
.el-table__header {
|
|
7
|
+
margin: 0;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.el-table__body-wrapper {
|
|
12
|
+
.el-table__body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.el-pagination {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
align-items: center;
|
|
21
|
+
margin-top: 10px;
|
|
22
|
+
// margin-right: 60px;
|
|
23
|
+
margin-right: calc(2% - 20px);
|
|
24
|
+
background-color: var(--el-bg-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// ttable过长省略号
|
|
28
|
+
.el-table {
|
|
29
|
+
.el-tooltip {
|
|
30
|
+
div {
|
|
31
|
+
-webkit-box-sizing: border-box;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
word-break: break-all;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.single_edit_cell {
|
|
39
|
+
overflow: visible;
|
|
40
|
+
margin-bottom: 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.single_edit_cell {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
|
|
47
|
+
.slot_edit_name {
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 多级表头过长省略号
|
|
54
|
+
.multile_head_column {
|
|
55
|
+
.el-table__row {
|
|
56
|
+
.el-tooltip {
|
|
57
|
+
div {
|
|
58
|
+
-webkit-box-sizing: border-box;
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
text-overflow: ellipsis;
|
|
62
|
+
word-break: break-all;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 单元格编辑且无规则校验
|
|
69
|
+
.el-table {
|
|
70
|
+
.cell {
|
|
71
|
+
div {
|
|
72
|
+
-webkit-box-sizing: border-box;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
text-overflow: ellipsis;
|
|
76
|
+
word-break: break-all;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.single_edit_cell {
|
|
80
|
+
overflow: visible;
|
|
81
|
+
margin-bottom: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 单元格编辑有规则校验
|
|
87
|
+
.el-table {
|
|
88
|
+
.cell {
|
|
89
|
+
.t_edit_cell_form_rules {
|
|
90
|
+
.single_edit_cell {
|
|
91
|
+
margin-bottom: 15px;
|
|
92
|
+
|
|
93
|
+
.el-form-item__content {
|
|
94
|
+
overflow: visible;
|
|
95
|
+
|
|
96
|
+
.el-form-item__error {
|
|
97
|
+
overflow: visible;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.el-table {
|
|
108
|
+
.cell {
|
|
109
|
+
.click_edit {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
line-height: 1;
|
|
113
|
+
|
|
114
|
+
.el-icon {
|
|
115
|
+
margin-left: 2px;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.el-table--border th:first-child .cell,
|
|
122
|
+
.el-table--border td:first-child .cell {
|
|
123
|
+
padding-left: 5px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.header_wrap {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
|
|
130
|
+
.toolbar_top {
|
|
131
|
+
flex: 1;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: flex-end;
|
|
135
|
+
|
|
136
|
+
.toolbar {
|
|
137
|
+
display: flex;
|
|
138
|
+
justify-content: flex-end;
|
|
139
|
+
width: 100%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.el-button--small {
|
|
143
|
+
height: 32px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.el-button--success {
|
|
147
|
+
background-color: #355db4;
|
|
148
|
+
border: 1px solid #355db4;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.header_title {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
flex: 1;
|
|
156
|
+
font-size: 16px;
|
|
157
|
+
font-weight: bold;
|
|
158
|
+
line-height: 35px;
|
|
159
|
+
margin-left: 10px;
|
|
160
|
+
color: var(--el-text-color-primary);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.title-tip {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
padding-left: 10px;
|
|
168
|
+
font-size: 14px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.marginBttom {
|
|
172
|
+
margin-bottom: -8px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// 单选样式
|
|
176
|
+
.radioStyle {
|
|
177
|
+
.el-radio {
|
|
178
|
+
.el-radio__label {
|
|
179
|
+
display: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
|
|
183
|
+
box-shadow: none;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
tbody {
|
|
188
|
+
.el-table__row {
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// 复制功能样式
|
|
195
|
+
.cursor {
|
|
196
|
+
tbody {
|
|
197
|
+
.el-table__row {
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 行拖动
|
|
204
|
+
.row_sort {
|
|
205
|
+
tbody {
|
|
206
|
+
.el-table__row {
|
|
207
|
+
cursor: move;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.row_sort_none {
|
|
213
|
+
tbody {
|
|
214
|
+
.el-table__row {
|
|
215
|
+
cursor: default;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.row_drag {
|
|
219
|
+
cursor: move;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// treeTable样式
|
|
225
|
+
.tree_style {
|
|
226
|
+
.el-table__body-wrapper {
|
|
227
|
+
.el-table__body {
|
|
228
|
+
.cell {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
|
|
232
|
+
.el-table__expand-icon {
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
justify-content: center;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// 选中行样式
|
|
243
|
+
.highlightCurrentRow {
|
|
244
|
+
.current-row {
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
|
|
247
|
+
>td.el-table__cell {
|
|
248
|
+
background-color: var(--el-table-current-row-bg-color);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.el-table--scrollable-y .el-table__body-wrapper {
|
|
254
|
+
overflow-x: auto;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.handle_wrap {
|
|
258
|
+
position: sticky;
|
|
259
|
+
z-index: 10;
|
|
260
|
+
right: 0;
|
|
261
|
+
bottom: -8px;
|
|
262
|
+
margin: 0 -8px -8px;
|
|
263
|
+
padding: 12px 16px;
|
|
264
|
+
background-color: var(--el-bg-color);
|
|
265
|
+
border-top: 1px solid var(--el-table-border);
|
|
266
|
+
|
|
267
|
+
.el-btn {
|
|
268
|
+
margin-left: 8px;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.operator {
|
|
273
|
+
.operator_btn {
|
|
274
|
+
.oper_more_dropdown {
|
|
275
|
+
margin-left: 8px;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.column_set {
|
|
282
|
+
.title {
|
|
283
|
+
font-weight: bold;
|
|
284
|
+
font-size: 14px;
|
|
285
|
+
display: flex;
|
|
286
|
+
justify-content: center;
|
|
287
|
+
align-items: center;
|
|
288
|
+
padding: 10px 10px 0 10px;
|
|
289
|
+
color: var(--el-text-color-primary);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.el-dropdown-menu {
|
|
293
|
+
padding: 0;
|
|
294
|
+
font-size: 14px;
|
|
295
|
+
|
|
296
|
+
.el-dropdown-menu__item {
|
|
297
|
+
display: flex;
|
|
298
|
+
flex-direction: column;
|
|
299
|
+
align-items: flex-start;
|
|
300
|
+
padding: 0;
|
|
301
|
+
|
|
302
|
+
.t_table_column_setting_dropdown {
|
|
303
|
+
display: flex;
|
|
304
|
+
flex-direction: column;
|
|
305
|
+
max-height: 400px;
|
|
306
|
+
overflow-y: auto;
|
|
307
|
+
width: 100%;
|
|
308
|
+
padding: 0 10px 0 12px;
|
|
309
|
+
gap: 10px;
|
|
310
|
+
|
|
311
|
+
&:hover {
|
|
312
|
+
background-color: transparent;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.el-tree-node {
|
|
316
|
+
.el-tree-node__content {
|
|
317
|
+
padding: 10px;
|
|
318
|
+
cursor: default;
|
|
319
|
+
|
|
320
|
+
&:hover {
|
|
321
|
+
color: var(--el-color-primary);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.el-tree-node__expand-icon {
|
|
325
|
+
display: none;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.el-tree-node__label {
|
|
329
|
+
display: inline-block;
|
|
330
|
+
cursor: move;
|
|
331
|
+
width: 100%;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.el-dropdown-menu__item:not(.is-disabled):hover {
|
|
339
|
+
background-color: transparent;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.oper_more_dropdown_menu {
|
|
345
|
+
.el-dropdown-menu__item {
|
|
346
|
+
padding: 5px 16px;
|
|
347
|
+
}
|
|
348
|
+
}
|
package/dist/gy-ui-plus.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@charset "UTF-8";.t-table[data-v-09defa6b]{z-index:0;background-color:var(--el-bg-color);margin-top:8px;flex:1 1 auto;min-height:0;overflow:hidden;box-sizing:border-box}.t-table .el-table__header-wrapper[data-v-09defa6b]{height:auto}.t-table .el-table__header-wrapper .el-table__header[data-v-09defa6b]{margin:0}.t-table .el-table__body-wrapper[data-v-09defa6b]{overflow:auto}.t-table .el-table__body-wrapper .el-table__body[data-v-09defa6b]{margin:0}.t-table .el-table[data-v-09defa6b]{height:100%}.t-table .el-table__inner-wrapper[data-v-09defa6b]{height:100%;display:flex;flex-direction:column;min-height:0}.t-table .el-table__header-wrapper[data-v-09defa6b]{flex:0 0 auto}.t-table .el-table__body-wrapper[data-v-09defa6b]{flex:1 1 auto;min-height:0;overflow:auto}.t-table .pagination_wrap[data-v-09defa6b]{width:100%;height:40px;background-color:#fff}.t-table .el-pagination[data-v-09defa6b]{display:flex;justify-content:flex-end;align-items:center;margin-top:10px}.t-table .el-table .el-tooltip div[data-v-09defa6b]{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;word-break:break-all}.t-table .el-table .el-tooltip .single_edit_cell[data-v-09defa6b]{overflow:visible;margin-bottom:0}.t-table .el-table .single_edit_cell[data-v-09defa6b]{cursor:pointer}.t-table .el-table .single_edit_cell .slot_edit_name[data-v-09defa6b]{width:100%}.t-table .multile_head_column .el-table__row .el-tooltip div[data-v-09defa6b],.t-table .el-table .cell div[data-v-09defa6b]{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;word-break:break-all}.t-table .el-table .cell .single_edit_cell[data-v-09defa6b]{overflow:visible;margin-bottom:0}.t-table .el-table .cell .t_edit_cell_form_rules .single_edit_cell[data-v-09defa6b]{margin-bottom:15px}.t-table .el-table .cell .click_edit[data-v-09defa6b]{display:flex;align-items:center;line-height:1}.t-table .el-table .cell .click_edit .el-icon[data-v-09defa6b]{margin-left:2px}.t-table .el-table--border th:first-child .cell[data-v-09defa6b],.t-table .el-table--border td:first-child .cell[data-v-09defa6b]{padding-left:5px}.t-table .header_wrap[data-v-09defa6b]{display:flex;align-items:center}.t-table .header_wrap .toolbar_top[data-v-09defa6b]{flex:1;display:flex;align-items:center;justify-content:flex-end}.t-table .header_wrap .toolbar_top .toolbar[data-v-09defa6b]{display:flex;justify-content:flex-end;width:100%}.t-table .header_wrap .toolbar_top .el-button--small[data-v-09defa6b]{height:32px}.t-table .header_wrap .toolbar_top .el-button--success[data-v-09defa6b]{background-color:#355db4;border:1px solid #355db4}.t-table .header_wrap .header_title[data-v-09defa6b]{display:flex;align-items:center;flex:1;font-size:16px;font-weight:700;line-height:35px;margin-left:10px;color:var(--el-text-color-primary)}.t-table .title-tip[data-v-09defa6b]{display:flex;align-items:center;padding-left:10px;font-size:14px}.t-table .marginBttom[data-v-09defa6b]{margin-bottom:-8px}.t-table .radioStyle .el-radio .el-radio__label[data-v-09defa6b]{display:none}.t-table .radioStyle .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner[data-v-09defa6b]{box-shadow:none}.t-table .radioStyle tbody .el-table__row[data-v-09defa6b],.t-table .cursor tbody .el-table__row[data-v-09defa6b]{cursor:pointer}.t-table .row_sort tbody .el-table__row[data-v-09defa6b]{cursor:move}.t-table .row_sort_none tbody .el-table__row[data-v-09defa6b]{cursor:default}.t-table .row_sort_none tbody .row_drag[data-v-09defa6b]{cursor:move}.t-table .tree_style .el-table__body-wrapper .el-table__body .cell[data-v-09defa6b]{display:flex;align-items:center}.t-table .tree_style .el-table__body-wrapper .el-table__body .cell .el-table__expand-icon[data-v-09defa6b]{display:flex;align-items:center;justify-content:center}.t-table .highlightCurrentRow .current-row[data-v-09defa6b]{cursor:pointer}.t-table .highlightCurrentRow .current-row>td.el-table__cell[data-v-09defa6b]{background-color:var(--el-table-current-row-bg-color)}.t-table .el-table--scrollable-y .el-table__body-wrapper[data-v-09defa6b]{overflow-x:auto}.t-table .handle_wrap[data-v-09defa6b]{position:sticky;z-index:10;right:0;bottom:-8px;margin:0 -8px -8px;padding:12px 16px;background-color:var(--el-bg-color);border-top:1px solid var(--el-table-border)}.t-table .handle_wrap .el-btn[data-v-09defa6b],.t-table .operator .operator_btn .oper_more_dropdown[data-v-09defa6b]{margin-left:8px}.column_set .title[data-v-09defa6b]{font-weight:700;font-size:14px;display:flex;justify-content:center;align-items:center;padding:10px 10px 0;color:var(--el-text-color-primary)}.column_set .el-dropdown-menu[data-v-09defa6b]{padding:0;font-size:14px}.column_set .el-dropdown-menu .el-dropdown-menu__item[data-v-09defa6b]{display:flex;flex-direction:column;align-items:flex-start;padding:0}.column_set .el-dropdown-menu .el-dropdown-menu__item .t_table_column_setting_dropdown[data-v-09defa6b]{display:flex;flex-direction:column;max-height:400px;overflow-y:auto;width:100%;padding:0 10px 0 12px;gap:10px}.column_set .el-dropdown-menu .el-dropdown-menu__item .t_table_column_setting_dropdown[data-v-09defa6b]:hover{background-color:transparent}.column_set .el-dropdown-menu .el-dropdown-menu__item .t_table_column_setting_dropdown .el-tree-node .el-tree-node__content[data-v-09defa6b]{padding:10px;cursor:default}.column_set .el-dropdown-menu .el-dropdown-menu__item .t_table_column_setting_dropdown .el-tree-node .el-tree-node__content[data-v-09defa6b]:hover{color:var(--el-color-primary)}.column_set .el-dropdown-menu .el-dropdown-menu__item .t_table_column_setting_dropdown .el-tree-node .el-tree-node__content .el-tree-node__expand-icon[data-v-09defa6b]{display:none}.column_set .el-dropdown-menu .el-dropdown-menu__item .t_table_column_setting_dropdown .el-tree-node .el-tree-node__content .el-tree-node__label[data-v-09defa6b]{display:inline-block;cursor:move;width:100%}.column_set .el-dropdown-menu .el-dropdown-menu__item[data-v-09defa6b]:not(.is-disabled):hover{background-color:transparent}.oper_more_dropdown_menu .el-dropdown-menu__item[data-v-09defa6b]{padding:5px 16px}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-button v-bind="$attrs" @click="handleClick">
|
|
3
|
-
<slot />
|
|
4
|
-
</el-button>
|
|
5
|
-
</template>
|
|
6
|
-
<script lang="ts">
|
|
7
|
-
export default {
|
|
8
|
-
name: 'JButton',
|
|
9
|
-
}
|
|
10
|
-
</script>
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { ref } from 'vue'
|
|
13
|
-
const props = defineProps({
|
|
14
|
-
time: {
|
|
15
|
-
type: Number,
|
|
16
|
-
default: 1000,
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
// 抛出事件
|
|
20
|
-
const emits = defineEmits(['click'])
|
|
21
|
-
const record = ref(0)
|
|
22
|
-
const handleClick = () => {
|
|
23
|
-
const newTime = new Date()
|
|
24
|
-
if (newTime.getTime() - record.value > props.time) {
|
|
25
|
-
emits('click')
|
|
26
|
-
}
|
|
27
|
-
record.value = new Date().getTime()
|
|
28
|
-
}
|
|
29
|
-
</script>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-table-column
|
|
3
|
-
v-if="
|
|
4
|
-
typeof item.isShowCol == 'function'
|
|
5
|
-
? item.isShowCol(item)
|
|
6
|
-
: !item.isShowCol
|
|
7
|
-
"
|
|
8
|
-
:prop="item.prop"
|
|
9
|
-
:label="item.label"
|
|
10
|
-
:type="item.type"
|
|
11
|
-
:align="item.align || align"
|
|
12
|
-
:min-width="item['min-width'] || item.minWidth"
|
|
13
|
-
:width="item.width"
|
|
14
|
-
:fixed="item.fixed"
|
|
15
|
-
>
|
|
16
|
-
<template #header v-if="item.renderHeader">
|
|
17
|
-
<render-header :column="item" :render="item.renderHeader" />
|
|
18
|
-
</template>
|
|
19
|
-
<template v-for="(val, index) of item.children">
|
|
20
|
-
<t-table-column
|
|
21
|
-
v-if="val.children"
|
|
22
|
-
:key="index"
|
|
23
|
-
:item="val"
|
|
24
|
-
v-bind="$attrs"
|
|
25
|
-
>
|
|
26
|
-
<template v-for="(_index, name) in slots" v-slot:[name]="data">
|
|
27
|
-
<slot :name="name" v-bind="data"></slot>
|
|
28
|
-
</template>
|
|
29
|
-
</t-table-column>
|
|
30
|
-
<el-table-column
|
|
31
|
-
v-else
|
|
32
|
-
:key="val.prop"
|
|
33
|
-
:prop="val.prop"
|
|
34
|
-
:label="val.label"
|
|
35
|
-
:min-width="val['min-width'] || val.minWidth"
|
|
36
|
-
:width="val.width"
|
|
37
|
-
:sortable="val.sortable || val.sort || sortable"
|
|
38
|
-
:align="val.align || align"
|
|
39
|
-
:fixed="val.fixed"
|
|
40
|
-
:formatter="val.formatter"
|
|
41
|
-
v-if="
|
|
42
|
-
typeof val.isShowCol == 'function'
|
|
43
|
-
? val.isShowCol(val)
|
|
44
|
-
: !val.isShowCol
|
|
45
|
-
"
|
|
46
|
-
v-bind="{
|
|
47
|
-
'show-overflow-tooltip': true,
|
|
48
|
-
...val.bind,
|
|
49
|
-
...$attrs,
|
|
50
|
-
}"
|
|
51
|
-
>
|
|
52
|
-
<template #header v-if="val.renderHeader">
|
|
53
|
-
<render-header :column="val" :render="val.renderHeader" />
|
|
54
|
-
</template>
|
|
55
|
-
<template #default="scope">
|
|
56
|
-
<!-- render渲染 -->
|
|
57
|
-
<template v-if="val.render">
|
|
58
|
-
<render-col
|
|
59
|
-
:column="val"
|
|
60
|
-
:row="scope.row"
|
|
61
|
-
:render="val.render"
|
|
62
|
-
:index="scope.$index"
|
|
63
|
-
/>
|
|
64
|
-
</template>
|
|
65
|
-
<!-- 自定义插槽 -->
|
|
66
|
-
<template v-if="val.slotNameMerge">
|
|
67
|
-
<slot :name="val.slotNameMerge" :scope="scope"></slot>
|
|
68
|
-
</template>
|
|
69
|
-
<!-- 单个单元格编辑 -->
|
|
70
|
-
<template v-if="val.canEdit">
|
|
71
|
-
<single-edit-cell
|
|
72
|
-
:isShowRules="false"
|
|
73
|
-
:configEdit="val.configEdit"
|
|
74
|
-
v-model="scope.row[val.prop]"
|
|
75
|
-
:prop="val.prop"
|
|
76
|
-
:scope="scope"
|
|
77
|
-
@handleEvent="
|
|
78
|
-
({ type, val }) =>
|
|
79
|
-
emits(
|
|
80
|
-
'handleEvent',
|
|
81
|
-
type,
|
|
82
|
-
val,
|
|
83
|
-
scope.$index
|
|
84
|
-
)
|
|
85
|
-
"
|
|
86
|
-
v-bind="$attrs"
|
|
87
|
-
>
|
|
88
|
-
<template
|
|
89
|
-
v-for="(_index, name) in slots"
|
|
90
|
-
v-slot:[name]="data"
|
|
91
|
-
>
|
|
92
|
-
<slot :name="name" v-bind="data"></slot>
|
|
93
|
-
</template>
|
|
94
|
-
</single-edit-cell>
|
|
95
|
-
</template>
|
|
96
|
-
<div
|
|
97
|
-
v-if="
|
|
98
|
-
!val.render &&
|
|
99
|
-
!val.slotNameMerge &&
|
|
100
|
-
!val.canEdit &&
|
|
101
|
-
!val.formatter
|
|
102
|
-
"
|
|
103
|
-
>
|
|
104
|
-
{{ scope.row[val.prop] }}
|
|
105
|
-
</div>
|
|
106
|
-
</template>
|
|
107
|
-
</el-table-column>
|
|
108
|
-
</template>
|
|
109
|
-
</el-table-column>
|
|
110
|
-
</template>
|
|
111
|
-
|
|
112
|
-
<script setup lang="ts">
|
|
113
|
-
import SingleEditCell from "./singleEditCell.vue";
|
|
114
|
-
import RenderCol from "./renderCol.vue";
|
|
115
|
-
import RenderHeader from "./renderHeader.vue";
|
|
116
|
-
import { useSlots } from "vue";
|
|
117
|
-
defineOptions({
|
|
118
|
-
name: "TTableColumn",
|
|
119
|
-
});
|
|
120
|
-
defineProps({
|
|
121
|
-
item: {
|
|
122
|
-
type: Object,
|
|
123
|
-
default: () => {
|
|
124
|
-
return {};
|
|
125
|
-
},
|
|
126
|
-
required: true,
|
|
127
|
-
},
|
|
128
|
-
align: {
|
|
129
|
-
type: String,
|
|
130
|
-
default: "center",
|
|
131
|
-
},
|
|
132
|
-
sortable: {
|
|
133
|
-
type: [Boolean, String],
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
// 抛出事件
|
|
137
|
-
const emits = defineEmits(["handleEvent"]);
|
|
138
|
-
// 获取所有插槽
|
|
139
|
-
const slots = useSlots();
|
|
140
|
-
</script>
|