xt-element-ui 2.1.6 → 2.1.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/docs/components/base/xt-badge.md +0 -2
- package/docs/components/base/xt-bar.md +5 -32
- package/docs/components/base/xt-button.md +0 -2
- package/docs/components/base/xt-card-item.md +0 -2
- package/docs/components/base/xt-card.md +17 -19
- package/docs/components/base/xt-chart.md +5 -31
- package/docs/components/base/xt-config-provider.md +0 -2
- package/docs/components/base/xt-date-picker.md +267 -269
- package/docs/components/base/xt-flex-box.md +25 -25
- package/docs/components/base/xt-form-schema.md +0 -2
- package/docs/components/base/xt-grid-box.md +0 -2
- package/docs/components/base/xt-icon.md +0 -2
- package/docs/components/base/xt-input.md +0 -2
- package/docs/components/base/xt-line.md +4 -30
- package/docs/components/base/xt-list.md +0 -2
- package/docs/components/base/xt-map-provider.md +0 -2
- package/docs/components/base/xt-map.md +0 -2
- package/docs/components/base/xt-multi.md +5 -44
- package/docs/components/base/xt-page.md +17 -6
- package/docs/components/base/xt-pie.md +5 -30
- package/docs/components/base/xt-progress.md +0 -2
- package/docs/components/base/xt-scroll-arrow.md +0 -2
- package/docs/components/base/xt-select-tree.md +0 -2
- package/docs/components/base/xt-step-price.md +0 -2
- package/docs/components/base/xt-table.md +2 -2
- package/docs/components/base/xt-tabs.md +0 -2
- package/docs/components/base/xt-text.md +0 -2
- package/docs/components/base/xt-time.md +0 -2
- package/docs/components/base/xt-transfer-tree.md +0 -2
- package/docs/components/base/xt-upload.md +11 -8
- package/package.json +2 -1
- package/src/components/xt-badge/style/index.scss +0 -22
- package/src/components/xt-chart/XtBar.vue +0 -3
- package/src/components/xt-layout/ExFieldset.vue +4 -4
- package/src/components/xt-page/index.vue +148 -75
- package/src/components/xt-progress/style/index.scss +0 -14
- package/src/components/xt-tab-pane/index.js +10 -0
- package/src/components/{xt-tabs/TabPane.vue → xt-tab-pane/index.vue} +14 -1
- package/src/components/xt-table/XtTableCell.vue +2 -2
- package/src/components/xt-table/index.vue +5 -7
- package/src/components/xt-tabs/index.js +1 -3
- package/src/components/xt-tabs/index.vue +303 -44
- package/src/components/xt-tabs/style/index.scss +0 -40
- package/src/components/xt-text/style/index.scss +0 -15
- package/src/components/xt-upload/index.vue +12 -6
- package/src/enhance/index.scss +13 -0
- package/src/index.js +2 -0
- package/src/styles/theme/colors.scss +0 -44
- package/src/styles/theme/dark-variables.scss +0 -29
- package/lib/demo.html +0 -10
- package/lib/index.common.js +0 -120529
- package/lib/index.css +0 -1
- package/lib/index.umd.js +0 -120539
- package/lib/index.umd.min.js +0 -1
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="xt-tabs" :class="[
|
|
3
|
-
`xt-tabs--${
|
|
4
|
-
{ 'xt-tabs--card': type === 'card' }
|
|
2
|
+
<div ref="tabsWrap" class="xt-tabs" :class="[
|
|
3
|
+
`xt-tabs--${actualPosition}`,
|
|
4
|
+
{ 'xt-tabs--card': type === 'card' },
|
|
5
|
+
{ 'xt-tabs--border-card': type === 'border-card' },
|
|
6
|
+
{ 'xt-tabs--editable': editable }
|
|
5
7
|
]">
|
|
6
|
-
<div class="xt-tabs__header">
|
|
7
|
-
<div class="xt-tabs__nav">
|
|
8
|
+
<div class="xt-tabs__header" ref="tabsHeader">
|
|
9
|
+
<div class="xt-tabs__nav" ref="tabsNav">
|
|
8
10
|
<div
|
|
9
11
|
v-for="(pane, index) in panes"
|
|
10
12
|
:key="pane.name"
|
|
11
13
|
class="xt-tabs__nav-item"
|
|
12
|
-
:class="{
|
|
13
|
-
|
|
14
|
+
:class="{
|
|
15
|
+
'xt-tabs__nav-item--active': activeName === pane.name,
|
|
16
|
+
'xt-tabs__nav-item--disabled': pane.disabled
|
|
17
|
+
}"
|
|
18
|
+
@click="handleTabClick(pane)"
|
|
14
19
|
>
|
|
15
20
|
<span class="xt-tabs__nav-link">{{ pane.label }}</span>
|
|
21
|
+
<span
|
|
22
|
+
v-if="(closable || pane.closable) && !editable"
|
|
23
|
+
class="xt-tabs__close"
|
|
24
|
+
@click.stop="handleTabRemove(pane.name)"
|
|
25
|
+
>×</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div
|
|
28
|
+
v-if="addable || editable"
|
|
29
|
+
class="xt-tabs__nav-item xt-tabs__nav-item--add"
|
|
30
|
+
@click="handleTabAdd"
|
|
31
|
+
>
|
|
32
|
+
<span>+</span>
|
|
16
33
|
</div>
|
|
17
34
|
</div>
|
|
18
35
|
<div class="xt-tabs__nav-indicator" :style="indicatorStyle"></div>
|
|
19
36
|
</div>
|
|
20
37
|
|
|
21
38
|
<div class="xt-tabs__content">
|
|
22
|
-
<
|
|
23
|
-
<div
|
|
24
|
-
v-for="(pane, index) in panes"
|
|
25
|
-
:key="pane.name"
|
|
26
|
-
class="xt-tabs__pane"
|
|
27
|
-
v-show="activeName === pane.name"
|
|
28
|
-
>
|
|
29
|
-
<slot :name="pane.name"></slot>
|
|
30
|
-
</div>
|
|
31
|
-
</transition>
|
|
39
|
+
<slot></slot>
|
|
32
40
|
</div>
|
|
33
41
|
</div>
|
|
34
42
|
</template>
|
|
@@ -43,13 +51,29 @@ export default {
|
|
|
43
51
|
},
|
|
44
52
|
type: {
|
|
45
53
|
type: String,
|
|
46
|
-
default: '
|
|
47
|
-
validator: (val) => ['default', 'card'].includes(val)
|
|
54
|
+
default: 'card',
|
|
55
|
+
validator: (val) => ['default', 'card', 'border-card'].includes(val)
|
|
48
56
|
},
|
|
49
57
|
position: {
|
|
50
58
|
type: String,
|
|
51
59
|
default: 'top',
|
|
52
60
|
validator: (val) => ['top', 'bottom', 'left', 'right'].includes(val)
|
|
61
|
+
},
|
|
62
|
+
tabPosition: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: ''
|
|
65
|
+
},
|
|
66
|
+
closable: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
addable: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: false
|
|
73
|
+
},
|
|
74
|
+
editable: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: false
|
|
53
77
|
}
|
|
54
78
|
},
|
|
55
79
|
data() {
|
|
@@ -58,56 +82,291 @@ export default {
|
|
|
58
82
|
activeName: this.value
|
|
59
83
|
}
|
|
60
84
|
},
|
|
61
|
-
watch: {
|
|
62
|
-
value(val) {
|
|
63
|
-
this.activeName = val
|
|
64
|
-
},
|
|
65
|
-
activeName(val) {
|
|
66
|
-
this.$emit('input', val)
|
|
67
|
-
this.$emit('change', val)
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
85
|
computed: {
|
|
86
|
+
actualPosition() {
|
|
87
|
+
return this.tabPosition || this.position
|
|
88
|
+
},
|
|
71
89
|
indicatorStyle() {
|
|
72
90
|
const activeIndex = this.panes.findIndex(p => p.name === this.activeName)
|
|
73
|
-
if (activeIndex === -1) return { display: 'none' }
|
|
91
|
+
if (activeIndex === -1 || !this.$refs.tabsNav) return { display: 'none' }
|
|
74
92
|
|
|
75
|
-
const navItems = this.$
|
|
93
|
+
const navItems = this.$refs.tabsNav.querySelectorAll('.xt-tabs__nav-item:not(.xt-tabs__nav-item--add)')
|
|
76
94
|
if (!navItems || navItems.length === 0) return { display: 'none' }
|
|
77
95
|
|
|
78
96
|
const activeItem = navItems[activeIndex]
|
|
79
|
-
return {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
97
|
+
if (!activeItem) return { display: 'none' }
|
|
98
|
+
|
|
99
|
+
const pos = this.actualPosition
|
|
100
|
+
const base = { transition: 'all 0.3s ease' }
|
|
101
|
+
if (pos === 'top' || pos === 'bottom') {
|
|
102
|
+
return {
|
|
103
|
+
...base,
|
|
104
|
+
left: `${activeItem.offsetLeft}px`,
|
|
105
|
+
width: `${activeItem.offsetWidth}px`,
|
|
106
|
+
height: '2px',
|
|
107
|
+
bottom: pos === 'top' ? 0 : 'auto',
|
|
108
|
+
top: pos === 'bottom' ? 0 : 'auto',
|
|
109
|
+
display: 'block'
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
return {
|
|
113
|
+
...base,
|
|
114
|
+
top: `${activeItem.offsetTop}px`,
|
|
115
|
+
height: `${activeItem.offsetHeight}px`,
|
|
116
|
+
width: '2px',
|
|
117
|
+
left: pos === 'left' ? 'auto' : 0,
|
|
118
|
+
right: pos === 'right' ? 0 : 'auto',
|
|
119
|
+
display: 'block'
|
|
120
|
+
}
|
|
83
121
|
}
|
|
84
122
|
}
|
|
85
123
|
},
|
|
124
|
+
watch: {
|
|
125
|
+
value(val) {
|
|
126
|
+
this.activeName = val
|
|
127
|
+
},
|
|
128
|
+
activeName(val) {
|
|
129
|
+
this.$emit('input', val)
|
|
130
|
+
this.$emit('change', val)
|
|
131
|
+
this.$nextTick(() => this.$forceUpdate())
|
|
132
|
+
},
|
|
133
|
+
panes: {
|
|
134
|
+
handler() {
|
|
135
|
+
this.$nextTick(() => this.$forceUpdate())
|
|
136
|
+
},
|
|
137
|
+
deep: true
|
|
138
|
+
}
|
|
139
|
+
},
|
|
86
140
|
methods: {
|
|
87
|
-
handleTabClick(
|
|
88
|
-
|
|
141
|
+
handleTabClick(pane) {
|
|
142
|
+
if (pane.disabled) return
|
|
143
|
+
this.activeName = pane.name
|
|
144
|
+
this.$emit('tab-click', pane)
|
|
145
|
+
},
|
|
146
|
+
handleTabRemove(name) {
|
|
147
|
+
this.$emit('tab-remove', name)
|
|
148
|
+
this.$emit('edit', name, 'remove')
|
|
149
|
+
const index = this.panes.findIndex(p => p.name === name)
|
|
150
|
+
if (index > -1) {
|
|
151
|
+
this.panes.splice(index, 1)
|
|
152
|
+
if (this.activeName === name && this.panes.length > 0) {
|
|
153
|
+
this.activeName = this.panes[0].name
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
handleTabAdd() {
|
|
158
|
+
this.$emit('tab-add')
|
|
159
|
+
this.$emit('edit', null, 'add')
|
|
89
160
|
},
|
|
90
161
|
addPane(pane) {
|
|
91
|
-
|
|
162
|
+
const exist = this.panes.some(p => p.name === pane.name)
|
|
163
|
+
if (!exist) {
|
|
92
164
|
this.panes.push(pane)
|
|
93
165
|
if (!this.activeName && this.panes.length === 1) {
|
|
94
166
|
this.activeName = pane.name
|
|
95
167
|
}
|
|
168
|
+
this.$nextTick(() => this.$forceUpdate())
|
|
96
169
|
}
|
|
97
170
|
},
|
|
98
171
|
removePane(name) {
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
101
|
-
this.panes.splice(
|
|
172
|
+
const idx = this.panes.findIndex(p => p.name === name)
|
|
173
|
+
if (idx > -1) {
|
|
174
|
+
this.panes.splice(idx, 1)
|
|
175
|
+
this.$nextTick(() => this.$forceUpdate())
|
|
102
176
|
}
|
|
177
|
+
},
|
|
178
|
+
collectPanes() {
|
|
179
|
+
this.panes = []
|
|
180
|
+
this.$children.forEach(child => {
|
|
181
|
+
if (child.$options.name === 'XtTabPane') {
|
|
182
|
+
this.addPane({
|
|
183
|
+
name: child.name,
|
|
184
|
+
label: child.label,
|
|
185
|
+
disabled: child.disabled,
|
|
186
|
+
closable: child.closable
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
})
|
|
103
190
|
}
|
|
104
191
|
},
|
|
105
192
|
mounted() {
|
|
106
|
-
this.$
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
193
|
+
this.$nextTick(() => {
|
|
194
|
+
this.collectPanes()
|
|
195
|
+
this.$watch(() => this.$children, () => {
|
|
196
|
+
this.collectPanes()
|
|
197
|
+
}, { flush: 'post' })
|
|
110
198
|
})
|
|
111
199
|
}
|
|
112
200
|
}
|
|
113
201
|
</script>
|
|
202
|
+
|
|
203
|
+
<style lang="scss" scoped>
|
|
204
|
+
.xt-tabs {
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
|
|
208
|
+
&--top, &--bottom {
|
|
209
|
+
flex-direction: column;
|
|
210
|
+
.xt-tabs__header {
|
|
211
|
+
width: 100%;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&--left, &--right {
|
|
216
|
+
flex-direction: row;
|
|
217
|
+
.xt-tabs__header {
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
width: auto;
|
|
220
|
+
}
|
|
221
|
+
.xt-tabs__nav {
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
}
|
|
224
|
+
.xt-tabs__nav-indicator {
|
|
225
|
+
width: 2px;
|
|
226
|
+
height: auto;
|
|
227
|
+
}
|
|
228
|
+
.xt-tabs__content {
|
|
229
|
+
border-left: 1px solid #dcdfe6;
|
|
230
|
+
border-top: none;
|
|
231
|
+
}
|
|
232
|
+
&--right .xt-tabs__content {
|
|
233
|
+
border-left: none;
|
|
234
|
+
border-right: 1px solid #dcdfe6;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&--top .xt-tabs__nav-indicator {
|
|
239
|
+
bottom: 0;
|
|
240
|
+
}
|
|
241
|
+
&--bottom .xt-tabs__nav-indicator {
|
|
242
|
+
top: 0;
|
|
243
|
+
}
|
|
244
|
+
&--left .xt-tabs__nav-indicator {
|
|
245
|
+
right: 0;
|
|
246
|
+
}
|
|
247
|
+
&--right .xt-tabs__nav-indicator {
|
|
248
|
+
left: 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&--card {
|
|
252
|
+
.xt-tabs__header {
|
|
253
|
+
margin-bottom: -1px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.xt-tabs__nav-item {
|
|
257
|
+
border: 1px solid transparent;
|
|
258
|
+
border-bottom: none;
|
|
259
|
+
background: #f5f7fa;
|
|
260
|
+
|
|
261
|
+
&--active {
|
|
262
|
+
background: #fff;
|
|
263
|
+
border-color: #dcdfe6;
|
|
264
|
+
border-bottom-color: #fff;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
&--left, &--right {
|
|
268
|
+
.xt-tabs__nav-item {
|
|
269
|
+
border-bottom: 1px solid transparent;
|
|
270
|
+
border-right: none;
|
|
271
|
+
}
|
|
272
|
+
.xt-tabs__nav-item--active {
|
|
273
|
+
border-right-color: #fff;
|
|
274
|
+
border-bottom-color: #dcdfe6;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&--border-card {
|
|
280
|
+
border: 1px solid #dcdfe6;
|
|
281
|
+
border-radius: 4px;
|
|
282
|
+
overflow: hidden;
|
|
283
|
+
|
|
284
|
+
.xt-tabs__nav-item--active {
|
|
285
|
+
background: #ecf5ff;
|
|
286
|
+
color: #409eff;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&--editable {
|
|
291
|
+
.xt-tabs__close {
|
|
292
|
+
display: inline-block;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.xt-tabs__header {
|
|
298
|
+
position: relative;
|
|
299
|
+
display: flex;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.xt-tabs__nav {
|
|
303
|
+
display: flex;
|
|
304
|
+
flex-wrap: nowrap;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.xt-tabs__nav-item {
|
|
308
|
+
position: relative;
|
|
309
|
+
padding: 12px 20px;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
font-size: 14px;
|
|
312
|
+
color: #606266;
|
|
313
|
+
transition: all 0.3s;
|
|
314
|
+
white-space: nowrap;
|
|
315
|
+
|
|
316
|
+
&--active {
|
|
317
|
+
color: #409eff;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
&--disabled {
|
|
321
|
+
cursor: not-allowed;
|
|
322
|
+
color: #c0c4cc;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
&--add {
|
|
326
|
+
color: #909399;
|
|
327
|
+
font-size: 20px;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
&:hover:not(.xt-tabs__nav-item--disabled) {
|
|
331
|
+
color: #409eff;
|
|
332
|
+
background-color: #ecf5ff;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.xt-tabs__nav-link {
|
|
337
|
+
display: inline-block;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.xt-tabs__close {
|
|
341
|
+
display: none;
|
|
342
|
+
margin-left: 8px;
|
|
343
|
+
font-size: 16px;
|
|
344
|
+
line-height: 1;
|
|
345
|
+
color: #909399;
|
|
346
|
+
vertical-align: middle;
|
|
347
|
+
|
|
348
|
+
&:hover {
|
|
349
|
+
color: #f56c6c;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.xt-tabs__nav-indicator {
|
|
354
|
+
position: absolute;
|
|
355
|
+
height: 2px;
|
|
356
|
+
background-color: #409eff;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.xt-tabs__content {
|
|
360
|
+
flex: 1;
|
|
361
|
+
padding: 16px;
|
|
362
|
+
border-top: 1px solid #dcdfe6;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.xt-tabs--border-card .xt-tabs__content {
|
|
366
|
+
border-top: none;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.xt-tabs__pane {
|
|
370
|
+
min-height: 40px;
|
|
371
|
+
}
|
|
372
|
+
</style>
|
|
@@ -155,43 +155,3 @@
|
|
|
155
155
|
opacity: 0;
|
|
156
156
|
transform: translateY(-10px);
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
[data-theme='dark'], html.dark {
|
|
160
|
-
.xt-tabs__header {
|
|
161
|
-
border-color: $xt-dark-color-border;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.xt-tabs--card .xt-tabs__header {
|
|
165
|
-
background: $xt-dark-color-bg-secondary;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.xt-tabs--card .xt-tabs__nav-item--active {
|
|
169
|
-
background: $xt-dark-color-bg-primary;
|
|
170
|
-
border-color: $xt-dark-color-border;
|
|
171
|
-
border-bottom-color: $xt-dark-color-bg-primary;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.xt-tabs--left .xt-tabs__header {
|
|
175
|
-
border-color: $xt-dark-color-border;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.xt-tabs--right .xt-tabs__header {
|
|
179
|
-
border-color: $xt-dark-color-border;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.xt-tabs__nav-item {
|
|
183
|
-
color: $xt-dark-color-text-secondary;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.xt-tabs__nav-item:hover {
|
|
187
|
-
color: $xt-dark-color-primary;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.xt-tabs__nav-item--active {
|
|
191
|
-
color: $xt-dark-color-primary;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.xt-tabs--card .xt-tabs__content {
|
|
195
|
-
border-color: $xt-dark-color-border;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
@@ -93,18 +93,3 @@
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// 暗色主题
|
|
97
|
-
[data-theme='dark'], html.dark {
|
|
98
|
-
.xt-text--primary {
|
|
99
|
-
color: $xt-dark-color-primary;
|
|
100
|
-
}
|
|
101
|
-
.xt-text--success {
|
|
102
|
-
color: $xt-dark-color-success;
|
|
103
|
-
}
|
|
104
|
-
.xt-text--warning {
|
|
105
|
-
color: $xt-dark-color-warning;
|
|
106
|
-
}
|
|
107
|
-
.xt-text--danger {
|
|
108
|
-
color: $xt-dark-color-danger;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<XtFlexBox type="inline-flex" gap="5px">
|
|
3
3
|
<el-upload
|
|
4
4
|
v-if="action"
|
|
5
5
|
ref="uploadFile"
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
:show-file-list="false"
|
|
14
14
|
:auto-upload="autoUpload"
|
|
15
15
|
:before-upload="uploadBefore"
|
|
16
|
-
accept="
|
|
16
|
+
:accept="accept"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
18
|
+
<span style="font-size: 20px;padding: 20px;background:#f0f0f1;color:#409EFF" :style="{padding: plusPx / 2 + 'px',cursor:disabled ? 'not-allowed':'pointer'}">
|
|
19
|
+
<slot><i :class="icon"></i></slot>
|
|
20
|
+
</span>
|
|
19
21
|
</el-upload>
|
|
20
|
-
<
|
|
22
|
+
<XtFlexBox class="el-upload-list el-upload-list--picture-card" gap="5px" wrap="wrap" style="flex: 1" v-if="fileList!==null&&fileList.length>0">
|
|
21
23
|
<li v-for="(ite,index) in fileList" :key="index" class="el-upload-list__item is-ready" style="margin: 0;width:62px;height: 62px;" :style="{ width: (plusPx + 22)+ 'px',height: (plusPx + 22)+ 'px'}">
|
|
22
24
|
<el-image class="el-upload-list__item-thumbnail" :src="YSSQP+'/'+ite" alt="" @click="clickHandler" />
|
|
23
25
|
<span class="el-upload-list__item-actions" @click="preShowPicture(ite, index)">
|
|
@@ -29,11 +31,11 @@
|
|
|
29
31
|
</span>
|
|
30
32
|
</span>
|
|
31
33
|
</li>
|
|
32
|
-
</
|
|
34
|
+
</XtFlexBox>
|
|
33
35
|
<template v-if="preview">
|
|
34
36
|
<ImageViewer v-if="previewVisible" :z-index="3000" :base-url="baseUrl + '/'" :infiniteLoop="false" :initial-index="imageIndex" :url-list="allFileList || fileList" :on-close="closeViewer" />
|
|
35
37
|
</template>
|
|
36
|
-
</
|
|
38
|
+
</XtFlexBox>
|
|
37
39
|
</template>
|
|
38
40
|
<script>
|
|
39
41
|
import ImageViewer from "./preview.vue";
|
|
@@ -111,6 +113,10 @@ export default {
|
|
|
111
113
|
// 当前图片在图片库中预览
|
|
112
114
|
allFileList: {
|
|
113
115
|
type: Array
|
|
116
|
+
},
|
|
117
|
+
icon: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: "el-icon-camera"
|
|
114
120
|
}
|
|
115
121
|
},
|
|
116
122
|
data() {
|
package/src/index.js
CHANGED
|
@@ -31,6 +31,7 @@ import XtMapProvider from './components/xt-map-provider'
|
|
|
31
31
|
import XtGridBox from './components/xt-grid-box'
|
|
32
32
|
import XtGridItem from './components/xt-grid-item'
|
|
33
33
|
import XtProgress from './components/xt-progress'
|
|
34
|
+
import XtTabPane from './components/xt-tab-pane'
|
|
34
35
|
import XtTabs from './components/xt-tabs'
|
|
35
36
|
import XtBadge from './components/xt-badge'
|
|
36
37
|
import XtDatePicker from './components/xt-date-picker'
|
|
@@ -66,6 +67,7 @@ const components = [
|
|
|
66
67
|
XtGridBox,
|
|
67
68
|
XtGridItem,
|
|
68
69
|
XtProgress,
|
|
70
|
+
XtTabPane,
|
|
69
71
|
XtTabs,
|
|
70
72
|
XtBadge,
|
|
71
73
|
XtDatePicker,
|
|
@@ -55,47 +55,3 @@ $xt-color-info-light-8: #e0e1e2; // 信息色浅色 80%
|
|
|
55
55
|
$xt-color-info-light-9: #f0f0f0; // 信息色浅色 90%
|
|
56
56
|
$xt-color-info-dark-2: #7a7c80; // 信息色深色 20%
|
|
57
57
|
|
|
58
|
-
// ============================
|
|
59
|
-
// 暗色主题渐变色系(参考 Element Plus)
|
|
60
|
-
// ============================
|
|
61
|
-
|
|
62
|
-
// Primary 暗色主题渐变色系
|
|
63
|
-
$xt-dark-color-primary-light-3: #336eb9; // 主色暗色 30%
|
|
64
|
-
$xt-dark-color-primary-light-5: #2a598a; // 主色暗色 50%
|
|
65
|
-
$xt-dark-color-primary-light-7: #213d5b; // 主色暗色 70%
|
|
66
|
-
$xt-dark-color-primary-light-8: #1d3043; // 主色暗色 80%
|
|
67
|
-
$xt-dark-color-primary-light-9: #18222b; // 主色暗色 90%
|
|
68
|
-
$xt-dark-color-primary-dark-2: #66b1ff; // 主色亮色 20%
|
|
69
|
-
|
|
70
|
-
// Success 暗色主题渐变色系
|
|
71
|
-
$xt-dark-color-success-light-3: #4e8e2f; // 成功色暗色 30%
|
|
72
|
-
$xt-dark-color-success-light-5: #3e6b27; // 成功色暗色 50%
|
|
73
|
-
$xt-dark-color-success-light-7: #2d481f; // 成功色暗色 70%
|
|
74
|
-
$xt-dark-color-success-light-8: #25371c; // 成功色暗色 80%
|
|
75
|
-
$xt-dark-color-success-light-9: #1c2518; // 成功色暗色 90%
|
|
76
|
-
$xt-dark-color-success-dark-2: #85ce61; // 成功色亮色 20%
|
|
77
|
-
|
|
78
|
-
// Warning 暗色主题渐变色系
|
|
79
|
-
$xt-dark-color-warning-light-3: #a77730; // 警告色暗色 30%
|
|
80
|
-
$xt-dark-color-warning-light-5: #7d5b28; // 警告色暗色 50%
|
|
81
|
-
$xt-dark-color-warning-light-7: #533f20; // 警告色暗色 70%
|
|
82
|
-
$xt-dark-color-warning-light-8: #3e301c; // 警告色暗色 80%
|
|
83
|
-
$xt-dark-color-warning-light-9: #292218; // 警告色暗色 90%
|
|
84
|
-
$xt-dark-color-warning-dark-2: #ebb563; // 警告色亮色 20%
|
|
85
|
-
|
|
86
|
-
// Danger 暗色主题渐变色系
|
|
87
|
-
$xt-dark-color-danger-light-3: #b25252; // 危险色暗色 30%
|
|
88
|
-
$xt-dark-color-danger-light-5: #854040; // 危险色暗色 50%
|
|
89
|
-
$xt-dark-color-danger-light-7: #582e2e; // 危险色暗色 70%
|
|
90
|
-
$xt-dark-color-danger-light-8: #412626; // 危险色暗色 80%
|
|
91
|
-
$xt-dark-color-danger-light-9: #2a1d1d; // 危险色暗色 90%
|
|
92
|
-
$xt-dark-color-danger-dark-2: #f78989; // 危险色亮色 20%
|
|
93
|
-
|
|
94
|
-
// Info 暗色主题渐变色系
|
|
95
|
-
$xt-dark-color-info-light-3: #6b6d71; // 信息色暗色 30%
|
|
96
|
-
$xt-dark-color-info-light-5: #525457; // 信息色暗色 50%
|
|
97
|
-
$xt-dark-color-info-light-7: #393a3c; // 信息色暗色 70%
|
|
98
|
-
$xt-dark-color-info-light-8: #2d2d2f; // 信息色暗色 80%
|
|
99
|
-
$xt-dark-color-info-light-9: #202121; // 信息色暗色 90%
|
|
100
|
-
$xt-dark-color-info-dark-2: #a6a9ad; // 信息色亮色 20%
|
|
101
|
-
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
$xt-dark-color-primary: #0a7be0; // 暗色主题主色调
|
|
2
|
-
$xt-dark-color-success: #4BC376; // 暗色主题成功颜色
|
|
3
|
-
$xt-dark-color-warning: #E6B61e; // 暗色主题警告颜色
|
|
4
|
-
$xt-dark-color-danger: #c13737; // 暗色主题危险颜色
|
|
5
|
-
$xt-dark-color-info: #3f4249; // 暗色主题信息文字颜色
|
|
6
|
-
|
|
7
|
-
$xt-dark-color-text-primary: rgba(255, 255, 255, 0.95); // 暗色主题主要文字颜色
|
|
8
|
-
$xt-dark-color-text-regular: rgba(255, 255, 255, 0.8); // 暗色主题常规文字颜色
|
|
9
|
-
$xt-dark-color-text-secondary: rgba(255, 255, 255, 0.6); // 暗色主题次要文字颜色
|
|
10
|
-
$xt-dark-color-text-placeholder: rgba(255, 255, 255, 0.4); // 暗色主题占位符文字颜色
|
|
11
|
-
$xt-dark-color-text-disabled: rgba(255, 255, 255, 0.3); // 暗色主题禁用状态文字颜色
|
|
12
|
-
|
|
13
|
-
$xt-dark-color-bg-primary: #1f1f1f; // 暗色主题主背景色
|
|
14
|
-
$xt-dark-color-bg-secondary: #2d2d2d; // 暗色主题次要背景色
|
|
15
|
-
$xt-dark-color-bg-hover: #3d3d3d; // 暗色主题悬停背景色
|
|
16
|
-
$xt-dark-color-bg-container: #1f1f1f; // 暗色主题容器背景色
|
|
17
|
-
$xt-dark-color-bg-overlay: #2d2d2d; // 暗色主题浮层背景色
|
|
18
|
-
|
|
19
|
-
$xt-dark-color-border: #434343; // 暗色主题边框颜色
|
|
20
|
-
$xt-dark-color-border-light: #3d3d3d; // 暗色主题边框浅色
|
|
21
|
-
$xt-dark-color-border-lighter: #3d3d3d; // 暗色主题边框更浅色
|
|
22
|
-
$xt-dark-color-border-extra-light: #434343; // 暗色主题边框极浅色
|
|
23
|
-
|
|
24
|
-
// 暗色主题按钮颜色
|
|
25
|
-
$xt-dark-button-primary-bg: #1e40af; // 暗色主题主按钮背景色
|
|
26
|
-
$xt-dark-button-success-bg: #166534; // 暗色主题成功按钮背景色
|
|
27
|
-
$xt-dark-button-warning-bg: #78350f; // 暗色主题警告按钮背景色
|
|
28
|
-
$xt-dark-button-danger-bg: #991b1b; // 暗色主题危险按钮背景色
|
|
29
|
-
$xt-dark-button-info-bg: #374151; // 暗色主题信息按钮背景色
|