xt-element-ui 1.3.4 → 2.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.
- package/CHANGELOG.md +37 -20
- package/README.md +39 -35
- package/docs/README.md +25 -15
- package/docs/components/base/xt-badge.md +139 -0
- package/docs/components/base/xt-bar.md +182 -0
- package/docs/components/base/xt-card-item.md +12 -12
- package/docs/components/base/xt-chart.md +183 -0
- package/docs/components/base/xt-date-picker.md +111 -0
- package/docs/components/base/xt-icon.md +154 -0
- package/docs/components/base/xt-line.md +145 -0
- package/docs/components/base/xt-multi.md +278 -0
- package/docs/components/base/xt-page.md +84 -0
- package/docs/components/base/xt-pie.md +175 -0
- package/docs/components/base/xt-progress.md +134 -0
- package/docs/components/base/xt-select-tree.md +141 -0
- package/docs/components/base/xt-table.md +344 -0
- package/docs/components/base/xt-tabs.md +197 -0
- package/docs/components/base/xt-upload.md +85 -0
- package/lib/index.common.js +885 -828
- package/lib/index.css +1 -1
- package/lib/index.umd.js +890 -834
- package/lib/index.umd.min.js +5 -5
- package/package.json +1 -1
- package/src/components/index.scss +11 -8
- package/src/components/xt-badge/index.js +7 -0
- package/src/components/xt-badge/index.vue +71 -0
- package/src/components/xt-badge/style/index.scss +88 -0
- package/src/components/xt-button/index.js +8 -8
- package/src/components/xt-button/index.vue +43 -73
- package/src/components/xt-button/style/index.scss +51 -787
- package/src/components/xt-card/index.js +7 -8
- package/src/components/xt-card/index.vue +61 -21
- package/src/components/xt-card/style/index.scss +56 -32
- package/src/components/xt-card-item/index.vue +7 -7
- package/src/components/xt-chart/index.js +8 -0
- package/src/components/{ex-chart → xt-chart}/index.vue +13 -13
- package/src/components/{ex-chart → xt-chart}/pieList.vue +1 -1
- package/src/components/{ex-chart → xt-chart}/theme/dark.js +4 -1
- package/src/components/{ex-chart → xt-chart}/utils.js +1 -1
- package/src/components/xt-config-provider/index.vue +1 -1
- package/src/components/xt-date-picker/index.js +8 -0
- package/src/components/{ex-date-picker → xt-date-picker}/index.vue +1 -1
- package/src/components/xt-icon/index.js +8 -0
- package/src/components/{ex-icon → xt-icon}/index.vue +4 -4
- package/src/components/xt-layout/ExFieldset.vue +1 -1
- package/src/components/xt-page/index.js +8 -0
- package/src/components/{ex-page → xt-page}/index.vue +1 -1
- package/src/components/xt-progress/index.js +7 -0
- package/src/components/xt-progress/index.vue +103 -0
- package/src/components/xt-progress/style/index.scss +119 -0
- package/src/components/xt-select-tree/index.js +8 -0
- package/src/components/{ex-select-tree → xt-select-tree}/index.vue +1 -1
- package/src/components/{ex-table/ExTableCell.vue → xt-table/XtTableCell.vue} +1 -1
- package/src/components/xt-table/index.js +8 -0
- package/src/components/{ex-table → xt-table}/index.vue +6 -6
- package/src/components/xt-tabs/TabPane.vue +36 -0
- package/src/components/xt-tabs/index.js +10 -0
- package/src/components/xt-tabs/index.vue +113 -0
- package/src/components/xt-tabs/style/index.scss +197 -0
- package/src/components/xt-text/index.vue +15 -1
- package/src/components/xt-text/style/index.scss +18 -0
- package/src/components/xt-upload/index.js +8 -0
- package/src/index.js +24 -31
- package/src/utils/index.js +1 -1
- package/docs/components/extend/ex-bar.md +0 -68
- package/docs/components/extend/ex-button.md +0 -62
- package/docs/components/extend/ex-card.md +0 -86
- package/docs/components/extend/ex-chart.md +0 -463
- package/docs/components/extend/ex-date-picker.md +0 -0
- package/docs/components/extend/ex-icon.md +0 -189
- package/docs/components/extend/ex-line.md +0 -71
- package/docs/components/extend/ex-multi.md +0 -156
- package/docs/components/extend/ex-page.md +0 -0
- package/docs/components/extend/ex-pie.md +0 -70
- package/docs/components/extend/ex-select-tree.md +0 -210
- package/docs/components/extend/ex-table.md +0 -591
- package/docs/components/extend/ex-upload.md +0 -134
- package/src/components/ex-button/index.js +0 -8
- package/src/components/ex-button/index.vue +0 -67
- package/src/components/ex-button/style/index.scss +0 -67
- package/src/components/ex-card/index.js +0 -7
- package/src/components/ex-card/index.vue +0 -68
- package/src/components/ex-card/style/index.scss +0 -73
- package/src/components/ex-chart/index.js +0 -8
- package/src/components/ex-date-picker/index.js +0 -8
- package/src/components/ex-icon/index.js +0 -8
- package/src/components/ex-page/index.js +0 -8
- package/src/components/ex-select-tree/index.js +0 -8
- package/src/components/ex-table/index.js +0 -8
- package/src/components/ex-upload/index.js +0 -8
- package/src/config/element-registry.js +0 -136
- /package/src/components/{ex-chart/ExBar.vue → xt-chart/XtBar.vue} +0 -0
- /package/src/components/{ex-chart/ExLine.vue → xt-chart/XtLine.vue} +0 -0
- /package/src/components/{ex-chart/ExMulti.vue → xt-chart/XtMulti.vue} +0 -0
- /package/src/components/{ex-chart/ExPie.vue → xt-chart/XtPie.vue} +0 -0
- /package/src/components/{ex-chart → xt-chart}/theme/white.js +0 -0
- /package/src/components/{ex-date-picker → xt-date-picker}/SearchDate.vue +0 -0
- /package/src/components/{ex-date-picker → xt-date-picker}/quarter.vue +0 -0
- /package/src/components/{ex-icon → xt-icon}/style/index.scss +0 -0
- /package/src/components/{ex-table → xt-table}/VirtualElTable.vue +0 -0
- /package/src/components/{ex-table → xt-table}/virtualScrollData.js +0 -0
- /package/src/components/{ex-upload → xt-upload}/index.vue +0 -0
- /package/src/components/{ex-upload → xt-upload}/preview.vue +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import XtCard from './index.vue'
|
|
2
|
-
|
|
3
|
-
XtCard.install = function (Vue) {
|
|
4
|
-
Vue.component(XtCard.name, XtCard)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default XtCard
|
|
8
|
-
export { XtCard }
|
|
1
|
+
import XtCard from './index.vue'
|
|
2
|
+
|
|
3
|
+
XtCard.install = function (Vue) {
|
|
4
|
+
Vue.component(XtCard.name, XtCard)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default XtCard
|
|
@@ -1,28 +1,68 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
<slot>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
2
|
+
<el-card
|
|
3
|
+
class="ex-card"
|
|
4
|
+
:class="cardClasses"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
7
|
+
<template #header v-if="$slots.header || title">
|
|
8
|
+
<slot name="header">{{ title }}</slot>
|
|
9
|
+
</template>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</el-card>
|
|
14
12
|
</template>
|
|
13
|
+
|
|
15
14
|
<script>
|
|
16
15
|
export default {
|
|
17
|
-
name:
|
|
16
|
+
name: 'XtCard',
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
inject: {
|
|
19
|
+
xtConfig: {
|
|
20
|
+
default: () => ({
|
|
21
|
+
theme: 'light',
|
|
22
|
+
size: 'medium',
|
|
23
|
+
primaryColor: '#1890ff'
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
},
|
|
18
27
|
props: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
title: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
shadow: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'always',
|
|
35
|
+
validator: (val) => ['always', 'hover', 'never'].includes(val)
|
|
36
|
+
},
|
|
37
|
+
bordered: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
bodyClass: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ''
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: null,
|
|
48
|
+
validator: (val) => !val || ['small', 'medium', 'large'].includes(val)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
finalSize() {
|
|
53
|
+
// 优先使用组件自身的 size,其次继承 XtConfigProvider 的 size,最后使用默认值
|
|
54
|
+
return this.size || this.xtConfig.size || 'medium'
|
|
55
|
+
},
|
|
56
|
+
cardClasses() {
|
|
57
|
+
return [
|
|
58
|
+
`ex-card-${this.shadow}`,
|
|
59
|
+
`ex-card-${this.finalSize}`,
|
|
60
|
+
{
|
|
61
|
+
'ex-card-no-border': !this.bordered,
|
|
62
|
+
[this.bodyClass]: this.bodyClass
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
26
66
|
}
|
|
27
67
|
}
|
|
28
|
-
</script>
|
|
68
|
+
</script>
|
|
@@ -1,49 +1,73 @@
|
|
|
1
|
+
// XtCard 组件样式
|
|
2
|
+
@import '../../../styles/element-theme.scss';
|
|
1
3
|
@import '../../../styles/variables.scss';
|
|
2
4
|
|
|
3
|
-
.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
.ex-card {
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
transition: all 0.3s;
|
|
8
|
+
font-size: var(--ex-card-font-size, 14px);
|
|
9
|
+
background-color: var(--el-bg-color-block, #ffffff);
|
|
10
|
+
color: var(--el-text-color-primary, #303133);
|
|
11
|
+
border-color: var(--el-border-color, #303133);
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
.el-card__header {
|
|
14
|
+
padding: var(--ex-card-header-padding, 16px 20px);
|
|
15
|
+
border-bottom: 1px solid var(--el-border-color, #ebeef5);
|
|
16
|
+
background-color: var(--el-bg-color-block-head, #ffffff);
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.el-card__body {
|
|
21
|
+
padding: var(--ex-card-body-padding, 20px);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ex-card-small {
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
|
|
28
|
+
.el-card__header {
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
}
|
|
14
31
|
}
|
|
15
32
|
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
.ex-card-medium {
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
|
|
36
|
+
.el-card__header {
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
}
|
|
21
39
|
}
|
|
22
40
|
|
|
23
|
-
.
|
|
24
|
-
|
|
41
|
+
.ex-card-large {
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
|
|
44
|
+
.el-card__header {
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
}
|
|
25
47
|
}
|
|
26
48
|
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
font-weight: 600;
|
|
30
|
-
color: var(--xt-color-primary, #1890ff);
|
|
49
|
+
.ex-card-always {
|
|
50
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
31
51
|
}
|
|
32
52
|
|
|
33
|
-
.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
.ex-card-hover {
|
|
54
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
|
|
58
|
+
}
|
|
37
59
|
}
|
|
38
60
|
|
|
39
|
-
.
|
|
40
|
-
|
|
61
|
+
.ex-card-never {
|
|
62
|
+
box-shadow: none;
|
|
63
|
+
border: 1px solid var(--el-border-color, #ebeef5);
|
|
41
64
|
}
|
|
42
65
|
|
|
43
|
-
.
|
|
44
|
-
|
|
66
|
+
.ex-card-no-border {
|
|
67
|
+
border: none;
|
|
68
|
+
|
|
69
|
+
.el-card__header {
|
|
70
|
+
border-bottom: none;
|
|
71
|
+
}
|
|
45
72
|
}
|
|
46
73
|
|
|
47
|
-
.xt-card.noPadding .card__body {
|
|
48
|
-
padding: 0;
|
|
49
|
-
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<xt-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<xt-card class="xt-card-item" :bordered="false" :class="{ [`is-${type}`]: type ? true : false}">
|
|
3
|
+
<xt-flex-box content="between">
|
|
4
|
+
<div >
|
|
5
|
+
<div><xt-text bold size="extra-large">{{ title }}</xt-text></div>
|
|
6
6
|
<xt-text bold size="large" v-model="value" format="thousand" :type="type" :decimals="0"></xt-text>
|
|
7
7
|
<div style="margin: 5px 0;">
|
|
8
8
|
<xt-text size="small">较昨日</xt-text>
|
|
9
9
|
<xt-text v-model="change" format="normal" :type="diff > 0 ? 'success' : 'danger'" :suffix="diff > 0 ? '↑' : '↓'"></xt-text>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
|
-
<div style="
|
|
12
|
+
<div style="height: 100%;">
|
|
13
13
|
<slot name="icon">
|
|
14
|
-
<xt-text size="extra-large" :type="type"><
|
|
14
|
+
<xt-text size="extra-large" :type="type"><xt-icon name="el-icon-user" :size="48" ></xt-icon></xt-text>
|
|
15
15
|
</slot>
|
|
16
16
|
</div>
|
|
17
17
|
</xt-flex-box>
|
|
18
|
-
</
|
|
18
|
+
</xt-card>
|
|
19
19
|
</template>
|
|
20
20
|
<script>
|
|
21
21
|
export default {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
2
|
+
<xt-bar v-if="type=='bar'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-bar>
|
|
3
|
+
<xt-line v-else-if="type=='line'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-line>
|
|
4
|
+
<xt-pie v-else-if="type=='pie'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-pie>
|
|
5
|
+
<xt-multi v-else-if="type=='multi'" v-bind="$attrs" :theme="myTheme" :size="mySize"></xt-multi>
|
|
6
6
|
</template>
|
|
7
7
|
<script>
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import XtBar from "./XtBar.vue"
|
|
9
|
+
import XtLine from "./XtLine.vue"
|
|
10
|
+
import XtPie from "./XtPie.vue"
|
|
11
|
+
import XtMulti from "./XtMulti.vue"
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
|
-
name: "
|
|
14
|
+
name: "XtChart",
|
|
15
15
|
components: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
XtBar,
|
|
17
|
+
XtLine,
|
|
18
|
+
XtPie,
|
|
19
|
+
XtMulti
|
|
20
20
|
},
|
|
21
21
|
props: {
|
|
22
22
|
theme: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="pieLBox">
|
|
3
3
|
<div class="left">
|
|
4
|
-
<
|
|
4
|
+
<XtPie class="chart-box" :chart-data="chartData" :showLegend="false" :showLabel="false" :colors="colors"></XtPie>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="right">
|
|
7
7
|
<div v-for="(item, index) in chartData" :key="index" class="box">
|
|
@@ -14,6 +14,9 @@ export default {
|
|
|
14
14
|
color: "#ffffff"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
+
axisLabel: {
|
|
18
|
+
color: "#ffffff"
|
|
19
|
+
},
|
|
17
20
|
line: {
|
|
18
21
|
itemStyle: {
|
|
19
22
|
},
|
|
@@ -24,7 +27,7 @@ export default {
|
|
|
24
27
|
bar: {
|
|
25
28
|
itemStyle: {
|
|
26
29
|
borderRadius: 4
|
|
27
|
-
}
|
|
30
|
+
},
|
|
28
31
|
},
|
|
29
32
|
pie: {
|
|
30
33
|
roseType: "radius",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<script>
|
|
17
17
|
const customPrefixes = {}
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
name: '
|
|
19
|
+
const XtIcon = {
|
|
20
|
+
name: 'XtIcon',
|
|
21
21
|
inheritAttrs: false,
|
|
22
22
|
|
|
23
23
|
props: {
|
|
@@ -139,13 +139,13 @@ const ExIcon = {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
XtIcon.registerPrefix = function (prefix) {
|
|
143
143
|
if (prefix && typeof prefix === 'string') {
|
|
144
144
|
customPrefixes[prefix] = true
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
export default
|
|
148
|
+
export default XtIcon
|
|
149
149
|
</script>
|
|
150
150
|
|
|
151
151
|
<style lang="scss" scoped>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="xt-progress" :class="[
|
|
3
|
+
`xt-progress--${type}`,
|
|
4
|
+
`xt-progress--${size}`
|
|
5
|
+
]">
|
|
6
|
+
<div v-if="type === 'line'" class="xt-progress__bar">
|
|
7
|
+
<div
|
|
8
|
+
class="xt-progress__bar-inner"
|
|
9
|
+
:style="{ width: `${percentage}%`, backgroundColor: color }"
|
|
10
|
+
>
|
|
11
|
+
<transition name="xt-progress-fade">
|
|
12
|
+
<div v-if="showText" class="xt-progress__bar-text">{{ percentage }}%</div>
|
|
13
|
+
</transition>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div v-else-if="type === 'circle'" class="xt-progress__circle">
|
|
18
|
+
<svg :width="circleSize" :height="circleSize" class="xt-progress__circle-svg">
|
|
19
|
+
<circle
|
|
20
|
+
class="xt-progress__circle-bg"
|
|
21
|
+
:cx="circleSize / 2"
|
|
22
|
+
:cy="circleSize / 2"
|
|
23
|
+
:r="circleRadius"
|
|
24
|
+
fill="none"
|
|
25
|
+
:stroke="bgColor"
|
|
26
|
+
:stroke-width="strokeWidth"
|
|
27
|
+
/>
|
|
28
|
+
<circle
|
|
29
|
+
class="xt-progress__circle-bar"
|
|
30
|
+
:cx="circleSize / 2"
|
|
31
|
+
:cy="circleSize / 2"
|
|
32
|
+
:r="circleRadius"
|
|
33
|
+
fill="none"
|
|
34
|
+
:stroke="color"
|
|
35
|
+
:stroke-width="strokeWidth"
|
|
36
|
+
:stroke-dasharray="circleLength"
|
|
37
|
+
:stroke-dashoffset="circleOffset"
|
|
38
|
+
stroke-linecap="round"
|
|
39
|
+
transform="rotate(-90 ${circleSize / 2} ${circleSize / 2})"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
<div v-if="showText" class="xt-progress__circle-text">
|
|
43
|
+
<span class="xt-progress__circle-percent">{{ percentage }}%</span>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div v-if="showText && type === 'line'" class="xt-progress__text">{{ percentage }}%</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
export default {
|
|
53
|
+
name: 'XtProgress',
|
|
54
|
+
props: {
|
|
55
|
+
percentage: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 0,
|
|
58
|
+
validator: (val) => val >= 0 && val <= 100
|
|
59
|
+
},
|
|
60
|
+
type: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'line',
|
|
63
|
+
validator: (val) => ['line', 'circle'].includes(val)
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'medium',
|
|
68
|
+
validator: (val) => ['small', 'medium', 'large'].includes(val)
|
|
69
|
+
},
|
|
70
|
+
color: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: '#1890ff'
|
|
73
|
+
},
|
|
74
|
+
bgColor: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: '#ebeef5'
|
|
77
|
+
},
|
|
78
|
+
showText: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: true
|
|
81
|
+
},
|
|
82
|
+
strokeWidth: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: 6
|
|
85
|
+
},
|
|
86
|
+
circleSize: {
|
|
87
|
+
type: Number,
|
|
88
|
+
default: 120
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
computed: {
|
|
92
|
+
circleRadius() {
|
|
93
|
+
return (this.circleSize - this.strokeWidth) / 2
|
|
94
|
+
},
|
|
95
|
+
circleLength() {
|
|
96
|
+
return 2 * Math.PI * this.circleRadius
|
|
97
|
+
},
|
|
98
|
+
circleOffset() {
|
|
99
|
+
return this.circleLength * (1 - this.percentage / 100)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@import '../../../styles/variables.scss';
|
|
2
|
+
|
|
3
|
+
.xt-progress {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.xt-progress__bar {
|
|
9
|
+
flex: 1;
|
|
10
|
+
height: 6px;
|
|
11
|
+
background: $xt-color-border-light;
|
|
12
|
+
border-radius: 3px;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.xt-progress--small .xt-progress__bar {
|
|
18
|
+
height: 4px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.xt-progress--large .xt-progress__bar {
|
|
22
|
+
height: 8px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.xt-progress__bar-inner {
|
|
26
|
+
height: 100%;
|
|
27
|
+
border-radius: 3px;
|
|
28
|
+
transition: width 0.3s ease;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.xt-progress__bar-text {
|
|
33
|
+
position: absolute;
|
|
34
|
+
right: -30px;
|
|
35
|
+
top: 50%;
|
|
36
|
+
transform: translateY(-50%);
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
color: $xt-color-text-secondary;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.xt-progress__text {
|
|
42
|
+
margin-left: 10px;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
color: $xt-color-text-secondary;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.xt-progress--small .xt-progress__text {
|
|
48
|
+
font-size: 12px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.xt-progress--large .xt-progress__text {
|
|
52
|
+
font-size: 16px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.xt-progress__circle {
|
|
56
|
+
position: relative;
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.xt-progress__circle-svg {
|
|
63
|
+
transform: rotate(-90deg);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.xt-progress__circle-bg {
|
|
67
|
+
transition: stroke 0.3s ease;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.xt-progress__circle-bar {
|
|
71
|
+
transition: stroke-dashoffset 0.6s ease;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.xt-progress__circle-text {
|
|
75
|
+
position: absolute;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.xt-progress__circle-percent {
|
|
83
|
+
font-size: 16px;
|
|
84
|
+
font-weight: 500;
|
|
85
|
+
color: $xt-color-text-primary;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.xt-progress--small .xt-progress__circle-percent {
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.xt-progress--large .xt-progress__circle-percent {
|
|
93
|
+
font-size: 20px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.xt-progress-fade-enter-active,
|
|
97
|
+
.xt-progress-fade-leave-active {
|
|
98
|
+
transition: opacity 0.3s ease;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.xt-progress-fade-enter,
|
|
102
|
+
.xt-progress-fade-leave-to {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
[data-theme='dark'], html.dark {
|
|
107
|
+
.xt-progress__bar {
|
|
108
|
+
background: $xt-dark-color-border;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.xt-progress__bar-text,
|
|
112
|
+
.xt-progress__text {
|
|
113
|
+
color: $xt-dark-color-text-secondary;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.xt-progress__circle-percent {
|
|
117
|
+
color: $xt-dark-color-text-primary;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
import Emitter from "element-ui/lib/mixins/emitter";
|
|
57
57
|
import { addResizeListener, removeResizeListener } from "element-ui/lib/utils/resize-event";
|
|
58
58
|
export default {
|
|
59
|
-
name: "
|
|
59
|
+
name: "XtSelectTree",
|
|
60
60
|
mixins: [Emitter],
|
|
61
61
|
inheritAttrs: false,
|
|
62
62
|
model: {
|