gy-ui-plus 1.0.0

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,368 @@
1
+ .t-table {
2
+ z-index: 0;
3
+ background-color: var(--el-bg-color);
4
+ margin-top: 8px;
5
+ flex: 1 1 auto;
6
+ min-height: 0;
7
+ overflow: hidden;
8
+ // padding-bottom: 46px;
9
+ box-sizing: border-box;
10
+ .el-table__header-wrapper {
11
+ height: auto;
12
+ .el-table__header {
13
+ margin: 0;
14
+ }
15
+ }
16
+
17
+ .el-table__body-wrapper {
18
+ overflow: auto;
19
+ .el-table__body {
20
+ margin: 0;
21
+ }
22
+ }
23
+
24
+ /* 让表格高度与 t-table 等高 */
25
+ .el-table {
26
+ height: 100%;
27
+ }
28
+ .el-table__inner-wrapper {
29
+ height: 100%;
30
+ display: flex;
31
+ flex-direction: column;
32
+ min-height: 0;
33
+ }
34
+ .el-table__header-wrapper {
35
+ flex: 0 0 auto;
36
+ }
37
+ .el-table__body-wrapper {
38
+ flex: 1 1 auto;
39
+ min-height: 0;
40
+ overflow: auto;
41
+ }
42
+ .pagination_wrap {
43
+ width: 100%;
44
+ height: 40px;
45
+ background-color: #fff;
46
+ }
47
+ .el-pagination {
48
+ display: flex;
49
+ justify-content: flex-end;
50
+ align-items: center;
51
+ margin-top: 10px;
52
+ // margin-right: 60px;
53
+ // margin-right: calc(2% - 20px);
54
+ // background-color: var(--el-bg-color);
55
+ }
56
+
57
+ // ttable过长省略号
58
+ .el-table {
59
+ .el-tooltip {
60
+ div {
61
+ -webkit-box-sizing: border-box;
62
+ box-sizing: border-box;
63
+ overflow: hidden;
64
+ text-overflow: ellipsis;
65
+ word-break: break-all;
66
+ }
67
+
68
+ .single_edit_cell {
69
+ overflow: visible;
70
+ margin-bottom: 0;
71
+ }
72
+ }
73
+
74
+ .single_edit_cell {
75
+ cursor: pointer;
76
+
77
+ .slot_edit_name {
78
+ width: 100%;
79
+ }
80
+ }
81
+ }
82
+
83
+ // 多级表头过长省略号
84
+ .multile_head_column {
85
+ .el-table__row {
86
+ .el-tooltip {
87
+ div {
88
+ -webkit-box-sizing: border-box;
89
+ box-sizing: border-box;
90
+ overflow: hidden;
91
+ text-overflow: ellipsis;
92
+ word-break: break-all;
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+ // 单元格编辑且无规则校验
99
+ .el-table {
100
+ .cell {
101
+ div {
102
+ -webkit-box-sizing: border-box;
103
+ box-sizing: border-box;
104
+ overflow: hidden;
105
+ text-overflow: ellipsis;
106
+ word-break: break-all;
107
+ }
108
+
109
+ .single_edit_cell {
110
+ overflow: visible;
111
+ margin-bottom: 0;
112
+ }
113
+ }
114
+ }
115
+
116
+ // 单元格编辑有规则校验
117
+ .el-table {
118
+ .cell {
119
+ .t_edit_cell_form_rules {
120
+ .single_edit_cell {
121
+ margin-bottom: 15px;
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ .el-table {
128
+ .cell {
129
+ .click_edit {
130
+ display: flex;
131
+ align-items: center;
132
+ line-height: 1;
133
+
134
+ .el-icon {
135
+ margin-left: 2px;
136
+ }
137
+ }
138
+ }
139
+ }
140
+
141
+ .el-table--border th:first-child .cell,
142
+ .el-table--border td:first-child .cell {
143
+ padding-left: 5px;
144
+ }
145
+
146
+ .header_wrap {
147
+ display: flex;
148
+ align-items: center;
149
+
150
+ .toolbar_top {
151
+ flex: 1;
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: flex-end;
155
+
156
+ .toolbar {
157
+ display: flex;
158
+ justify-content: flex-end;
159
+ width: 100%;
160
+ }
161
+
162
+ .el-button--small {
163
+ height: 32px;
164
+ }
165
+
166
+ .el-button--success {
167
+ background-color: #355db4;
168
+ border: 1px solid #355db4;
169
+ }
170
+ }
171
+
172
+ .header_title {
173
+ display: flex;
174
+ align-items: center;
175
+ flex: 1;
176
+ font-size: 16px;
177
+ font-weight: bold;
178
+ line-height: 35px;
179
+ margin-left: 10px;
180
+ color: var(--el-text-color-primary);
181
+ }
182
+ }
183
+
184
+ .title-tip {
185
+ display: flex;
186
+ align-items: center;
187
+ padding-left: 10px;
188
+ font-size: 14px;
189
+ }
190
+
191
+ .marginBttom {
192
+ margin-bottom: -8px;
193
+ }
194
+
195
+ // 单选样式
196
+ .radioStyle {
197
+ .el-radio {
198
+ .el-radio__label {
199
+ display: none;
200
+ }
201
+
202
+ &:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
203
+ box-shadow: none;
204
+ }
205
+ }
206
+
207
+ tbody {
208
+ .el-table__row {
209
+ cursor: pointer;
210
+ }
211
+ }
212
+ }
213
+
214
+ // 复制功能样式
215
+ .cursor {
216
+ tbody {
217
+ .el-table__row {
218
+ cursor: pointer;
219
+ }
220
+ }
221
+ }
222
+
223
+ // 行拖动
224
+ .row_sort {
225
+ tbody {
226
+ .el-table__row {
227
+ cursor: move;
228
+ }
229
+ }
230
+ }
231
+
232
+ .row_sort_none {
233
+ tbody {
234
+ .el-table__row {
235
+ cursor: default;
236
+ }
237
+
238
+ .row_drag {
239
+ cursor: move;
240
+ }
241
+ }
242
+ }
243
+
244
+ // treeTable样式
245
+ .tree_style {
246
+ .el-table__body-wrapper {
247
+ .el-table__body {
248
+ .cell {
249
+ display: flex;
250
+ align-items: center;
251
+
252
+ .el-table__expand-icon {
253
+ display: flex;
254
+ align-items: center;
255
+ justify-content: center;
256
+ }
257
+ }
258
+ }
259
+ }
260
+ }
261
+
262
+ // 选中行样式
263
+ .highlightCurrentRow {
264
+ .current-row {
265
+ cursor: pointer;
266
+
267
+ > td.el-table__cell {
268
+ background-color: var(--el-table-current-row-bg-color);
269
+ }
270
+ }
271
+ }
272
+
273
+ .el-table--scrollable-y .el-table__body-wrapper {
274
+ overflow-x: auto;
275
+ }
276
+
277
+ .handle_wrap {
278
+ position: sticky;
279
+ z-index: 10;
280
+ right: 0;
281
+ bottom: -8px;
282
+ margin: 0 -8px -8px;
283
+ padding: 12px 16px;
284
+ background-color: var(--el-bg-color);
285
+ border-top: 1px solid var(--el-table-border);
286
+
287
+ .el-btn {
288
+ margin-left: 8px;
289
+ }
290
+ }
291
+
292
+ .operator {
293
+ .operator_btn {
294
+ .oper_more_dropdown {
295
+ margin-left: 8px;
296
+ }
297
+ }
298
+ }
299
+ }
300
+
301
+ .column_set {
302
+ .title {
303
+ font-weight: bold;
304
+ font-size: 14px;
305
+ display: flex;
306
+ justify-content: center;
307
+ align-items: center;
308
+ padding: 10px 10px 0 10px;
309
+ color: var(--el-text-color-primary);
310
+ }
311
+
312
+ .el-dropdown-menu {
313
+ padding: 0;
314
+ font-size: 14px;
315
+
316
+ .el-dropdown-menu__item {
317
+ display: flex;
318
+ flex-direction: column;
319
+ align-items: flex-start;
320
+ padding: 0;
321
+
322
+ .t_table_column_setting_dropdown {
323
+ display: flex;
324
+ flex-direction: column;
325
+ max-height: 400px;
326
+ overflow-y: auto;
327
+ width: 100%;
328
+ padding: 0 10px 0 12px;
329
+ gap: 10px;
330
+
331
+ &:hover {
332
+ background-color: transparent;
333
+ }
334
+
335
+ .el-tree-node {
336
+ .el-tree-node__content {
337
+ padding: 10px;
338
+ cursor: default;
339
+
340
+ &:hover {
341
+ color: var(--el-color-primary);
342
+ }
343
+
344
+ .el-tree-node__expand-icon {
345
+ display: none;
346
+ }
347
+
348
+ .el-tree-node__label {
349
+ display: inline-block;
350
+ cursor: move;
351
+ width: 100%;
352
+ }
353
+ }
354
+ }
355
+ }
356
+ }
357
+
358
+ .el-dropdown-menu__item:not(.is-disabled):hover {
359
+ background-color: transparent;
360
+ }
361
+ }
362
+ }
363
+
364
+ .oper_more_dropdown_menu {
365
+ .el-dropdown-menu__item {
366
+ padding: 5px 16px;
367
+ }
368
+ }
@@ -0,0 +1,21 @@
1
+ import { App, Plugin } from 'vue'
2
+
3
+ type SFCWithInstall<T> = T & Plugin
4
+
5
+ export const withInstall = <T, E extends Record<string, any>>(
6
+ main: T,
7
+ extra?: E
8
+ ) => {
9
+ ;(main as SFCWithInstall<T>).install = (app: App) => {
10
+ for (const comp of [main, ...Object.values(extra ?? {})]) {
11
+ app.component(comp.name, comp)
12
+ }
13
+ }
14
+ if (extra) {
15
+ for (const [compName, comp] of Object.entries(extra)) {
16
+ ;(main as Record<string, any>)[compName] = comp
17
+ }
18
+ }
19
+ // 将 T 断言为具体的类型 T & plugin & Record<string, any>
20
+ return main as SFCWithInstall<T> & E
21
+ }