xt-element-ui 1.1.0 → 1.1.1

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.
Files changed (74) hide show
  1. package/lib/css/2.3f7aa432.css +1 -0
  2. package/lib/css/3.ffcc175d.css +1 -0
  3. package/lib/css/4.9abd1f2b.css +1 -0
  4. package/lib/css/5.1a31ed8a.css +1 -0
  5. package/lib/css/6.c2d0d77e.css +1 -0
  6. package/lib/index.common.0.js +120208 -0
  7. package/lib/index.common.2.js +1053 -0
  8. package/lib/index.common.3.js +996 -0
  9. package/lib/index.common.4.js +1108 -0
  10. package/lib/index.common.5.js +1009 -0
  11. package/lib/index.common.6.js +973 -0
  12. package/lib/index.common.js +8003 -211
  13. package/lib/index.css +1 -1
  14. package/lib/index.umd.0.js +120208 -0
  15. package/lib/index.umd.2.js +1053 -0
  16. package/lib/index.umd.3.js +996 -0
  17. package/lib/index.umd.4.js +1108 -0
  18. package/lib/index.umd.5.js +1009 -0
  19. package/lib/index.umd.6.js +973 -0
  20. package/lib/index.umd.js +8003 -211
  21. package/lib/index.umd.min.0.js +34 -0
  22. package/lib/index.umd.min.2.js +1 -0
  23. package/lib/index.umd.min.3.js +1 -0
  24. package/lib/index.umd.min.4.js +1 -0
  25. package/lib/index.umd.min.5.js +1 -0
  26. package/lib/index.umd.min.6.js +1 -0
  27. package/lib/index.umd.min.js +1 -1
  28. package/package.json +6 -2
  29. package/src/components/button/index.vue +5 -5
  30. package/src/components/button/style/index.scss +743 -90
  31. package/src/components/chart/ExBar.vue +203 -0
  32. package/src/components/chart/ExLine.vue +146 -0
  33. package/src/components/chart/ExMulti.vue +257 -0
  34. package/src/components/chart/ExPie.vue +159 -0
  35. package/src/components/chart/ExTrend.vue +121 -0
  36. package/src/components/chart/index.js +2 -0
  37. package/src/components/chart/index.vue +51 -0
  38. package/src/components/chart/pieList.vue +110 -0
  39. package/src/components/chart/theme/blue.js +91 -0
  40. package/src/components/chart/theme/dark.js +91 -0
  41. package/src/components/chart/theme/orange.js +92 -0
  42. package/src/components/chart/theme/starry.js +106 -0
  43. package/src/components/chart/theme/white.js +110 -0
  44. package/src/components/chart/utils.js +273 -0
  45. package/src/components/config-provider/index.vue +150 -51
  46. package/src/components/config-provider/style/index.scss +2 -2
  47. package/src/components/date-picker/SearchDate.vue +45 -0
  48. package/src/components/date-picker/index.js +2 -0
  49. package/src/components/date-picker/index.vue +131 -0
  50. package/src/components/date-picker/quarter.vue +152 -0
  51. package/src/components/grid-box/index.js +2 -0
  52. package/src/components/grid-box/index.vue +42 -0
  53. package/src/components/layout/BaseCollapse.vue +48 -0
  54. package/src/components/layout/ExFieldset.vue +204 -0
  55. package/src/components/page/index.js +0 -0
  56. package/src/components/page/index.vue +109 -0
  57. package/src/components/select-tree/index.js +0 -0
  58. package/src/components/select-tree/index.vue +386 -0
  59. package/src/components/table/ExCell.vue +27 -0
  60. package/src/components/table/ExColumn.vue +36 -0
  61. package/src/components/table/index.js +2 -0
  62. package/src/components/table/index.vue +731 -0
  63. package/src/components/table/processor.js +380 -0
  64. package/src/components/text/index.vue +79 -2
  65. package/src/components/text/style/index.scss +28 -6
  66. package/src/components/upload/index.js +2 -0
  67. package/src/components/upload/index.vue +225 -0
  68. package/src/components/upload/preview.vue +333 -0
  69. package/src/index.js +11 -2
  70. package/src/styles/css-variables.scss +238 -148
  71. package/src/styles/theme/background.scss +1 -1
  72. package/src/styles/theme/colors.scss +90 -1
  73. package/src/styles/variables.scss +1 -1
  74. package/src/components/button/style/index copy.scss +0 -221
@@ -0,0 +1,159 @@
1
+ <template>
2
+ <div ref="piechart" class="pie-box"></div>
3
+ </template>
4
+ <script>
5
+ import EchartsUtil from "./utils";
6
+ export default {
7
+ name: "XtPie",
8
+ props: {
9
+ theme: {},
10
+ size: {
11
+ type: String,
12
+ default: "medium"
13
+ },
14
+ chartData: {
15
+ type: Array,
16
+ default: () => {
17
+ return [
18
+ { value: 53, name: "张三" },
19
+ { value: 10, name: "李四" },
20
+ { value: 60, name: "宋五" }
21
+ ];
22
+ }
23
+ },
24
+ colors: {
25
+ type: Array,
26
+ default: () => { return []; }
27
+ },
28
+ unit: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ showLegend: {
33
+ type: Boolean,
34
+ default: true
35
+ },
36
+ chartMode: {
37
+ type: String,
38
+ default: "dark"
39
+ },
40
+ roseType: {
41
+ type: String,
42
+ default: ""
43
+ },
44
+ showLabel: {
45
+ type: Boolean,
46
+ default: true
47
+ },
48
+ totalLabel: {
49
+ type: String,
50
+ default: "总数"
51
+ }
52
+ },
53
+ data() {
54
+ return {
55
+ myChart: null
56
+ };
57
+ },
58
+ computed: {
59
+ totalNum() {
60
+ return this.chartData.map(it => parseFloat(it.value)).reduce((pre, aft) => { return pre + aft; }, 0);
61
+ }
62
+ },
63
+ watch: {
64
+ chartData: {
65
+ deep: true,
66
+ handler(newVal, oldVal) {
67
+ const _self = this;
68
+ _self.initChart();
69
+ }
70
+ }
71
+ },
72
+ mounted() {
73
+ this.$nextTick(() => {
74
+ this.initChart();
75
+ });
76
+ /* setTimeout(() => {
77
+ this.initChart();
78
+ }, 1000); */
79
+ },
80
+ methods: {
81
+ initChart() {
82
+ const _self = this;
83
+ console.log(this.chartMode);
84
+ // 数据处理
85
+ const option = {
86
+ title: {
87
+ text: `${_self.totalLabel}:${_self.totalNum}`,
88
+ textStyle: {
89
+ color: "#808080",
90
+ fontSize: 20
91
+ },
92
+ // left: "40%",
93
+ // top: "45%",
94
+ top: "middle",
95
+ left: "center"
96
+ },
97
+ tooltip: {
98
+ trigger: "item"
99
+ },
100
+ legend: this.showLegend ? {
101
+ top: "top",
102
+ right: "20",
103
+ type: "scroll",
104
+ textStyle: {
105
+ color: "#808080"
106
+ }
107
+ } : null,
108
+ grid: {
109
+ left: 30,
110
+ right: 0,
111
+ top: 20,
112
+ bottom: 0,
113
+ containLabel: true
114
+ },
115
+ series: [{
116
+ name: _self.unit,
117
+ type: "pie",
118
+ center: ["50%", "50%"],
119
+ roseType: this.roseType,
120
+ radius: ["50%", "65%"],
121
+ minAngle: 5,
122
+ avoidLabelOverlap: true,
123
+ data: _self.chartData.map((item, ind) => {
124
+ const { name, value } = item;
125
+ return {
126
+ value,
127
+ name,
128
+ labelLine: {
129
+ show: this.showLabel
130
+ },
131
+ emphasis: {
132
+ labelLine: {
133
+ show: this.showLabel
134
+ }
135
+ },
136
+ label: {
137
+ show: this.showLabel
138
+ },
139
+ tooltip: {
140
+ formatter: "{b}:{c} ({d}%)",
141
+ position: "inside",
142
+ borderWidth: 1
143
+ }
144
+ };
145
+ })
146
+ }]
147
+ };
148
+ this.myChart = EchartsUtil.init(_self.$refs.piechart, this.theme, option, this.size);
149
+ }
150
+ }
151
+ };
152
+ </script>
153
+ <style lang="scss" scoped>
154
+ .pie-box{
155
+ position: relative;
156
+ height: 100%;
157
+ width: 100%;
158
+ }
159
+ </style>
@@ -0,0 +1,121 @@
1
+ <template>
2
+ <div ref="barchart" class="bar-box" :style="{width:width}"></div>
3
+ </template>
4
+ <script>
5
+ import EchartsUtil from "./utils";
6
+ export default {
7
+ name: "XtTrend",
8
+ props: {
9
+ type: {
10
+ type: String,
11
+ default: "bar"
12
+ },
13
+ theme: {},
14
+ size: {
15
+ type: String,
16
+ default: "medium"
17
+ },
18
+ chartData: {
19
+ type: Array,
20
+ default: () => {
21
+ return [
22
+ { value: 53, label: "正常设备" },
23
+ { value: 10, label: "正常设备" },
24
+ { value: 60, label: "离线设备" }
25
+ ];
26
+ }
27
+ },
28
+ width: {
29
+ type: String,
30
+ default: "100%"
31
+ },
32
+ energyType: {
33
+ type: String,
34
+ default: "m³"
35
+ }
36
+ },
37
+ data() {
38
+ return {
39
+ myChart: null
40
+ };
41
+ },
42
+ watch: {
43
+ type: {
44
+ handler() {
45
+ const _self = this;
46
+ const option = _self.getOption();
47
+ _self.myChart.setOption(option);
48
+ }
49
+ },
50
+ chartData: {
51
+ deep: true,
52
+ handler(newVal, oldVal) {
53
+ const _self = this;
54
+ _self.initChart();
55
+ }
56
+ }
57
+ },
58
+ mounted() {
59
+ this.initChart();
60
+ },
61
+ methods: {
62
+ getOption() {
63
+ const _self = this;
64
+ // 数据处理
65
+ const option = {
66
+ xAxis: {
67
+ type: "category",
68
+ axisTick: {
69
+ show: false,
70
+ splitLine: {
71
+ lineStyle: {
72
+ }
73
+ }
74
+ },
75
+ axisLabel: {
76
+ }
77
+ },
78
+ tooltip: {
79
+ borderWidth: 1,
80
+ trigger: "item"
81
+ },
82
+ grid: {
83
+ top: "10",
84
+ left: "10",
85
+ right: "10",
86
+ bottom: "20"
87
+ },
88
+ yAxis: {
89
+ show: false,
90
+ type: "value"
91
+ },
92
+ series: {
93
+ type: _self.type || "bar",
94
+ areaStyle: {},
95
+ showSymbol: false,
96
+ smooth: true,
97
+ data: _self.chartData.map((item, ind) => {
98
+ const { label, value } = item;
99
+ return {
100
+ value,
101
+ label
102
+ };
103
+ })
104
+ }
105
+ };
106
+ return option;
107
+ },
108
+ initChart() {
109
+ const _self = this;
110
+ // 数据处理
111
+ const option = this.getOption();
112
+ this.myChart = EchartsUtil.init(_self.$refs.barchart, this.theme, option, this.size);
113
+ }
114
+ }
115
+ };
116
+ </script>
117
+ <style lang="scss" scoped>
118
+ .bar-box{
119
+ position: relative;
120
+ }
121
+ </style>
@@ -0,0 +1,2 @@
1
+ import XtChart from './index.vue'
2
+ export default XtChart
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <ex-bar v-if="type=='bar'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-bar>
3
+ <ex-line v-else-if="type=='line'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-line>
4
+ <ex-pie v-else-if="type=='pie'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-pie>
5
+ <ex-multi v-else-if="type=='multi'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-multi>
6
+ <ex-trend v-else-if="type=='trend'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-trend>
7
+ </template>
8
+ <script>
9
+ export default {
10
+ name: "XtChart",
11
+ components: {
12
+ ExBar: () => import("./ExBar.vue"),
13
+ ExLine: () => import("./ExLine.vue"),
14
+ ExPie: () => import("./ExPie.vue"),
15
+ ExMulti: () => import("./ExMulti.vue"),
16
+ ExTrend: () => import("./ExTrend.vue")
17
+ },
18
+ props: {
19
+ theme: {
20
+ type: String,
21
+ default: ""
22
+ },
23
+ size: {
24
+ type: String,
25
+ default: "medium",
26
+ validator: (value) => {
27
+ return ['small', 'medium', 'large'].includes(value)
28
+ }
29
+ },
30
+ type: {
31
+ type: String,
32
+ required: true,
33
+ default: "bar"
34
+ }
35
+ },
36
+ data() {
37
+ return {
38
+ myTheme: this.theme,
39
+ mySize: this.size
40
+ };
41
+ },
42
+ watch: {
43
+ theme(newVal) {
44
+ this.myTheme = newVal;
45
+ },
46
+ size(newVal) {
47
+ this.mySize = newVal;
48
+ }
49
+ }
50
+ };
51
+ </script>
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <div class="pieLBox">
3
+ <div class="left">
4
+ <ExPie class="chart-box" :chart-data="chartData" :showLegend="false" :showLabel="false" :colors="colors"></ExPie>
5
+ </div>
6
+ <div class="right">
7
+ <div v-for="(item, index) in chartData" :key="index" class="box">
8
+ <div class="itH">
9
+ <span class="sign" :style="{background: colors[index]}"></span>
10
+ <span>{{ item.name }}</span>
11
+ <span class="fr">占比</span>
12
+ </div>
13
+ <div class="itB">
14
+ <span class="sign"></span>
15
+ <span>{{ item.value }}</span>
16
+ <span class="fr">{{ parseFloat( item.value * 100 / totalNum ).toFixed(2)+"%" }}</span>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </template>
22
+ <script>
23
+ export default {
24
+ name: "XtPieLine",
25
+ props: {
26
+ chartData: {
27
+ type: Array,
28
+ default: () => {
29
+ return [
30
+ { value: 538, name: "管道" },
31
+ { value: 250, name: "阀门" },
32
+ { value: 60, name: "燃气表" },
33
+ { value: 6, name: "其他" }
34
+ ];
35
+ }
36
+ },
37
+ colors: {
38
+ type: Array,
39
+ default: () => { return ["#F38787", "#B3BFCB", "#2CDEB3", "#A17EE6", "#E57E40", "#409EFF"]; }
40
+ }
41
+ },
42
+ data() {
43
+ return {
44
+ myChart: null
45
+ };
46
+ },
47
+ computed: {
48
+ totalNum() {
49
+ return this.chartData.map(it => parseFloat(it.value)).reduce((pre, aft) => { return pre + aft; }, 0);
50
+ }
51
+ },
52
+ watch: {
53
+ },
54
+ mounted() {
55
+ },
56
+ methods: {
57
+ }
58
+ };
59
+ </script>
60
+ <style lang="scss" scoped>
61
+ .pieLBox{
62
+ display: flex;
63
+ height: 100%;
64
+ width: 100%;
65
+ position: relative;
66
+ @include font_color("fontColor");
67
+ }
68
+ .left{
69
+ flex: 1;
70
+ width: 50%;
71
+ .chart-box{
72
+ height: calc(100% - 20px);
73
+ width: 100%;
74
+ position: relative;
75
+ }
76
+ }
77
+ .right{
78
+ width: 50%;
79
+ height: calc(100% - 20px);
80
+ overflow-y: auto;
81
+ padding: 0px 10px 0 0;
82
+ .box{
83
+ padding-top: 28px;
84
+ padding-bottom: 3px;
85
+ border-bottom: 1px solid rgba(0, 0, 0, .1);
86
+ &:first-child{
87
+ padding-top: 3px;
88
+ }
89
+ &:last-child{
90
+ border-bottom-color: transparent;
91
+ }
92
+ .itH{
93
+ margin-bottom: 20px;
94
+ font-size: 14px;
95
+ .sign{
96
+ display: inline-block;
97
+ width: 12px;
98
+ height: 8px;
99
+ margin-right: 10px;
100
+ }
101
+ }
102
+ .itB{
103
+ font-size: 15px;
104
+ }
105
+ .fr{
106
+ float: right;
107
+ }
108
+ }
109
+ }
110
+ </style>
@@ -0,0 +1,91 @@
1
+ export default {
2
+ color: ["#2CDEB3", "#A17EE6", "#E57E40", "#409EFF"],
3
+ backgroundColor: "#ffffff",
4
+ textStyle: {
5
+ fontFamily: "Microsoft YaHei, sans-serif"
6
+ },
7
+ title: {
8
+ textStyle: {
9
+ color: "#333"
10
+ },
11
+ subtextStyle: {
12
+ color: "#666666"
13
+ }
14
+ },
15
+ line: {
16
+ itemStyle: {
17
+ },
18
+ lineStyle: {
19
+ width: 2
20
+ }
21
+ },
22
+ bar: {
23
+ itemStyle: {
24
+ borderRadius: 4
25
+ }
26
+ },
27
+ pie: {
28
+ roseType: "radius",
29
+ label: {
30
+ color: "#333"
31
+ }
32
+ },
33
+ radar: {
34
+ indicator: {
35
+ color: "#666666"
36
+ }
37
+ },
38
+ map: {
39
+ label: {
40
+ color: "#333"
41
+ },
42
+ itemStyle: {
43
+ borderColor: "#fff"
44
+ }
45
+ },
46
+ gauge: {
47
+ axisLine: {
48
+ lineStyle: {
49
+ color: [[1, "#5470c6"]]
50
+ }
51
+ }
52
+ },
53
+ toolbox: {
54
+ iconStyle: {
55
+ borderColor: "#666666"
56
+ }
57
+ },
58
+ axisLine: {
59
+ lineStyle: {
60
+ color: "#DCDFE6"
61
+ }
62
+ },
63
+ axisTick: {
64
+ lineStyle: {
65
+ color: "#DCDFE6"
66
+ }
67
+ },
68
+ splitLine: {
69
+ lineStyle: {
70
+ color: "#ebeef5"
71
+ }
72
+ },
73
+ splitArea: {
74
+ areaStyle: {
75
+ color: ["#f7f8fa", "#ffffff"]
76
+ }
77
+ },
78
+ legend: {
79
+ textStyle: {
80
+ color: "#666"
81
+ }
82
+ },
83
+ tooltip: {
84
+ backgroundColor: "rgba(255, 255, 255, 0.95)",
85
+ borderColor: "#DCDFE6",
86
+ borderWidth: 1,
87
+ textStyle: {
88
+ color: "#333"
89
+ }
90
+ }
91
+ };
@@ -0,0 +1,91 @@
1
+ export default {
2
+ color: ["#0de7ff", "#a782ff", "#fcdd60", "#0de7ff", "#ffc5a1", "#6291ae", "#13ce66"],
3
+ backgroundColor: "#ffffff",
4
+ textStyle: {
5
+ fontFamily: "Microsoft YaHei, sans-serif"
6
+ },
7
+ title: {
8
+ textStyle: {
9
+ color: "#333"
10
+ },
11
+ subtextStyle: {
12
+ color: "#666666"
13
+ }
14
+ },
15
+ line: {
16
+ itemStyle: {
17
+ },
18
+ lineStyle: {
19
+ width: 2
20
+ }
21
+ },
22
+ bar: {
23
+ itemStyle: {
24
+ borderRadius: 4
25
+ }
26
+ },
27
+ pie: {
28
+ roseType: "radius",
29
+ label: {
30
+ color: "#333"
31
+ }
32
+ },
33
+ radar: {
34
+ indicator: {
35
+ color: "#666666"
36
+ }
37
+ },
38
+ map: {
39
+ label: {
40
+ color: "#333"
41
+ },
42
+ itemStyle: {
43
+ borderColor: "#fff"
44
+ }
45
+ },
46
+ gauge: {
47
+ axisLine: {
48
+ lineStyle: {
49
+ color: [[1, "#5470c6"]]
50
+ }
51
+ }
52
+ },
53
+ toolbox: {
54
+ iconStyle: {
55
+ borderColor: "#666666"
56
+ }
57
+ },
58
+ axisLine: {
59
+ lineStyle: {
60
+ color: "#DCDFE6"
61
+ }
62
+ },
63
+ axisTick: {
64
+ lineStyle: {
65
+ color: "#DCDFE6"
66
+ }
67
+ },
68
+ splitLine: {
69
+ lineStyle: {
70
+ color: "#ebeef5"
71
+ }
72
+ },
73
+ splitArea: {
74
+ areaStyle: {
75
+ color: ["#f7f8fa", "#ffffff"]
76
+ }
77
+ },
78
+ legend: {
79
+ textStyle: {
80
+ color: "#666"
81
+ }
82
+ },
83
+ tooltip: {
84
+ backgroundColor: "rgba(255, 255, 255, 0.95)",
85
+ borderColor: "#DCDFE6",
86
+ borderWidth: 1,
87
+ textStyle: {
88
+ color: "#333"
89
+ }
90
+ }
91
+ };
@@ -0,0 +1,92 @@
1
+ export default {
2
+ color: ["#e69419", "#A5b4da", "#F8792C", "#97bfb4", "#de747b", "#d6bac0", "#e62737", "#f35969", "#f1ccb0", "#b7394e", "#fe9c1c2"],
3
+ backgroundColor: "#ffffff",
4
+ textStyle: {
5
+ fontFamily: "Microsoft YaHei, sans-serif"
6
+ },
7
+ title: {
8
+ textStyle: {
9
+ color: "#333"
10
+ },
11
+ subtextStyle: {
12
+ color: "#666666"
13
+ }
14
+ },
15
+ line: {
16
+ itemStyle: {
17
+ color: "#e69419"
18
+ },
19
+ lineStyle: {
20
+ width: 2
21
+ }
22
+ },
23
+ bar: {
24
+ itemStyle: {
25
+ borderRadius: 4
26
+ }
27
+ },
28
+ pie: {
29
+ roseType: "radius",
30
+ label: {
31
+ color: "#333"
32
+ }
33
+ },
34
+ radar: {
35
+ indicator: {
36
+ color: "#666666"
37
+ }
38
+ },
39
+ map: {
40
+ label: {
41
+ color: "#333"
42
+ },
43
+ itemStyle: {
44
+ borderColor: "#fff"
45
+ }
46
+ },
47
+ gauge: {
48
+ axisLine: {
49
+ lineStyle: {
50
+ color: [[1, "#5470c6"]]
51
+ }
52
+ }
53
+ },
54
+ toolbox: {
55
+ iconStyle: {
56
+ borderColor: "#666666"
57
+ }
58
+ },
59
+ axisLine: {
60
+ lineStyle: {
61
+ color: "#DCDFE6"
62
+ }
63
+ },
64
+ axisTick: {
65
+ lineStyle: {
66
+ color: "#DCDFE6"
67
+ }
68
+ },
69
+ splitLine: {
70
+ lineStyle: {
71
+ color: "#ebeef5"
72
+ }
73
+ },
74
+ splitArea: {
75
+ areaStyle: {
76
+ color: ["#f7f8fa", "#ffffff"]
77
+ }
78
+ },
79
+ legend: {
80
+ textStyle: {
81
+ color: "#666"
82
+ }
83
+ },
84
+ tooltip: {
85
+ backgroundColor: "rgba(255, 255, 255, 0.95)",
86
+ borderColor: "#DCDFE6",
87
+ borderWidth: 1,
88
+ textStyle: {
89
+ color: "#333"
90
+ }
91
+ }
92
+ };