sh-chart 1.2.0 → 2.1.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.
Files changed (84) hide show
  1. package/package.json +2 -2
  2. package/packages/components/global-components/mixin/autoResize.js +152 -0
  3. package/packages/components/global-components/sh-border/components/border1.vue +70 -0
  4. package/packages/components/global-components/sh-border/components/border10.vue +54 -0
  5. package/packages/components/global-components/sh-border/components/border11.vue +207 -0
  6. package/packages/components/global-components/sh-border/components/border12.vue +112 -0
  7. package/packages/components/global-components/sh-border/components/border13.vue +50 -0
  8. package/packages/components/global-components/sh-border/components/border2.vue +50 -0
  9. package/packages/components/global-components/sh-border/components/border3.vue +53 -0
  10. package/packages/components/global-components/sh-border/components/border4.vue +95 -0
  11. package/packages/components/global-components/sh-border/components/border5.vue +64 -0
  12. package/packages/components/global-components/sh-border/components/border6.vue +60 -0
  13. package/packages/components/global-components/sh-border/components/border7.vue +57 -0
  14. package/packages/components/global-components/sh-border/components/border8.vue +75 -0
  15. package/packages/components/global-components/sh-border/components/border9.vue +92 -0
  16. package/packages/components/global-components/sh-border/index.vue +73 -0
  17. package/packages/components/global-components/sh-border/mixin/border.js +62 -0
  18. package/packages/components/global-components/sh-charts/config/config.js +58 -0
  19. package/packages/components/global-components/sh-charts/index.vue +169 -0
  20. package/packages/components/global-components/sh-decoration/components/decoration1.vue +81 -0
  21. package/packages/components/global-components/sh-decoration/components/decoration10.vue +80 -0
  22. package/packages/components/global-components/sh-decoration/components/decoration11.vue +63 -0
  23. package/packages/components/global-components/sh-decoration/components/decoration12.vue +171 -0
  24. package/packages/components/global-components/sh-decoration/components/decoration2.vue +78 -0
  25. package/packages/components/global-components/sh-decoration/components/decoration3.vue +65 -0
  26. package/packages/components/global-components/sh-decoration/components/decoration4.vue +72 -0
  27. package/packages/components/global-components/sh-decoration/components/decoration5.vue +96 -0
  28. package/packages/components/global-components/sh-decoration/components/decoration6.vue +84 -0
  29. package/packages/components/global-components/sh-decoration/components/decoration7.vue +31 -0
  30. package/packages/components/global-components/sh-decoration/components/decoration8.vue +32 -0
  31. package/packages/components/global-components/sh-decoration/components/decoration9.vue +63 -0
  32. package/packages/components/global-components/sh-decoration/index.vue +71 -0
  33. package/packages/components/global-components/sh-decoration/mixin/decoration.js +69 -0
  34. package/packages/components/global-components/sh-screen-header/components/header1.vue +228 -0
  35. package/packages/components/global-components/sh-screen-header/components/header2.vue +285 -0
  36. package/packages/components/global-components/sh-screen-header/components/header3.vue +452 -0
  37. package/packages/components/global-components/sh-screen-header/components/header4.vue +544 -0
  38. package/packages/components/global-components/sh-screen-header/components/header5.vue +291 -0
  39. package/packages/components/global-components/sh-screen-header/components/header6.vue +206 -0
  40. package/packages/components/global-components/sh-screen-header/index.vue +50 -0
  41. package/packages/components/global-components/sh-screen-header/mixin/header.js +62 -0
  42. package/packages/components/global-components/sh-spin/index.vue +44 -0
  43. package/packages/components/index.js +24 -0
  44. package/packages/echarts/index.js +94 -0
  45. package/packages/echarts/map/110000.json +1 -0
  46. package/packages/echarts/map/120000.json +1 -0
  47. package/packages/echarts/map/130000.json +1 -0
  48. package/packages/echarts/map/140000.json +1 -0
  49. package/packages/echarts/map/150000.json +1 -0
  50. package/packages/echarts/map/210000.json +1 -0
  51. package/packages/echarts/map/220000.json +1 -0
  52. package/packages/echarts/map/230000.json +1 -0
  53. package/packages/echarts/map/310000.json +1 -0
  54. package/packages/echarts/map/320000.json +1 -0
  55. package/packages/echarts/map/330000.json +1 -0
  56. package/packages/echarts/map/340000.json +1 -0
  57. package/packages/echarts/map/350000.json +1 -0
  58. package/packages/echarts/map/360000.json +1 -0
  59. package/packages/echarts/map/370000.json +1 -0
  60. package/packages/echarts/map/410000.json +1 -0
  61. package/packages/echarts/map/420000.json +1 -0
  62. package/packages/echarts/map/430000.json +1 -0
  63. package/packages/echarts/map/440000.json +1 -0
  64. package/packages/echarts/map/450000.json +1 -0
  65. package/packages/echarts/map/460000.json +1 -0
  66. package/packages/echarts/map/500000.json +1 -0
  67. package/packages/echarts/map/510000.json +1 -0
  68. package/packages/echarts/map/520000.json +1 -0
  69. package/packages/echarts/map/530000.json +1 -0
  70. package/packages/echarts/map/540000.json +1 -0
  71. package/packages/echarts/map/610000.json +1 -0
  72. package/packages/echarts/map/620000.json +1 -0
  73. package/packages/echarts/map/630000.json +1 -0
  74. package/packages/echarts/map/640000.json +1 -0
  75. package/packages/echarts/map/650000.json +1 -0
  76. package/packages/echarts/map/710000.json +1 -0
  77. package/packages/echarts/map/china.json +1 -0
  78. package/packages/echarts/theme/dark.js +128 -0
  79. package/packages/echarts/theme/infographic.js +181 -0
  80. package/packages/echarts/theme/macarons.js +194 -0
  81. package/packages/echarts/theme/roma.js +66 -0
  82. package/packages/echarts/theme/shine.js +136 -0
  83. package/packages/echarts/theme/vintage.js +11 -0
  84. package/packages/index.js +31 -0
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-decoration-3">
3
+ <svg :width="`${svgWH[0]}px`" :height="`${svgWH[1]}px`" :style="`transform:scale(${svgScale[0]},${svgScale[1]});`">
4
+ <template v-for="(point, i) in points" :key="i">
5
+ <rect v-if="Math.random() > 0.6" :fill="mergedColor[0]" :x="point[0] - halfPointSideLength" :y="point[1] - halfPointSideLength" :width="pointSideLength" :height="pointSideLength">
6
+ <animate attributeName="fill" :values="`${mergedColor.join(';')}`" :dur="Math.random() + 1 + 's'" :begin="Math.random() * 2" repeatCount="indefinite" />
7
+ </rect>
8
+ </template>
9
+ </svg>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import mixin from '../mixin/decoration'
15
+ export default {
16
+ name: 'ShDecoration3',
17
+ mixins: [mixin],
18
+ data() {
19
+ const pointSideLength = 7
20
+ return {
21
+ svgWH: [300, 35],
22
+
23
+ svgScale: [1, 1],
24
+
25
+ rowNum: 2,
26
+ rowPoints: 25,
27
+
28
+ pointSideLength,
29
+ halfPointSideLength: pointSideLength / 2,
30
+
31
+ points: []
32
+ }
33
+ },
34
+ methods: {
35
+ calcSVGData() {
36
+ const { calcPointsPosition, calcScale } = this
37
+ calcPointsPosition()
38
+ calcScale()
39
+ },
40
+ calcPointsPosition() {
41
+ const { svgWH, rowNum, rowPoints } = this
42
+ const [w, h] = svgWH
43
+ const horizontalGap = w / (rowPoints + 1)
44
+ const verticalGap = h / (rowNum + 1)
45
+ let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]))
46
+ this.points = points.reduce((all, item) => [...all, ...item], [])
47
+ },
48
+ calcScale() {
49
+ const { width, height, svgWH } = this
50
+ const [w, h] = svgWH
51
+ this.svgScale = [width / w, height / h]
52
+ }
53
+ }
54
+ }
55
+ </script>
56
+
57
+ <style scoped lang="scss">
58
+ .sh-decoration-3 {
59
+ width: 100%;
60
+ height: 100%;
61
+ svg {
62
+ transform-origin: left top;
63
+ }
64
+ }
65
+ </style>
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-decoration-4">
3
+ <div
4
+ :class="`container ${reverse ? 'reverse' : 'normal'}`"
5
+ :style="reverse ? `width:${width}px;height:5px;animation-duration:${dur}s` : `width:5px;height:${height}px;animation-duration:${dur}s`">
6
+ <svg :width="reverse ? width : 5" :height="reverse ? 5 : height">
7
+ <polyline :stroke="mergedColor[0]" :points="reverse ? `0, 2.5 ${width}, 2.5` : `2.5, 0 2.5, ${height}`" />
8
+ <polyline
9
+ class="bold-line"
10
+ :stroke="mergedColor[1]"
11
+ stroke-width="3"
12
+ stroke-dasharray="20, 80"
13
+ stroke-dashoffset="-30"
14
+ :points="reverse ? `0, 2.5 ${width}, 2.5` : `2.5, 0 2.5, ${height}`" />
15
+ </svg>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import mixin from '../mixin/decoration'
22
+ export default {
23
+ name: 'ShDecoration4',
24
+ mixins: [mixin]
25
+ }
26
+ </script>
27
+
28
+ <style scoped lang="scss">
29
+ .sh-decoration-4 {
30
+ position: relative;
31
+ width: 100%;
32
+ height: 100%;
33
+ .container {
34
+ display: flex;
35
+ overflow: hidden;
36
+ position: absolute;
37
+ flex: 1;
38
+ }
39
+ .normal {
40
+ animation: ani-height ease-in-out infinite;
41
+ left: 50%;
42
+ margin-left: -2px;
43
+ }
44
+ .reverse {
45
+ animation: ani-width ease-in-out infinite;
46
+ top: 50%;
47
+ margin-top: -2px;
48
+ }
49
+ @keyframes ani-height {
50
+ 0% {
51
+ height: 0%;
52
+ }
53
+ 70% {
54
+ height: 100%;
55
+ }
56
+ 100% {
57
+ height: 100%;
58
+ }
59
+ }
60
+ @keyframes ani-width {
61
+ 0% {
62
+ width: 0%;
63
+ }
64
+ 70% {
65
+ width: 100%;
66
+ }
67
+ 100% {
68
+ width: 100%;
69
+ }
70
+ }
71
+ }
72
+ </style>
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-decoration-5">
3
+ <svg :width="width" :height="height">
4
+ <polyline fill="transparent" :stroke="mergedColor[0]" stroke-width="3" :points="line1Points">
5
+ <animate
6
+ attributeName="stroke-dasharray"
7
+ attributeType="XML"
8
+ :from="`0, ${line1Length / 2}, 0, ${line1Length / 2}`"
9
+ :to="`0, 0, ${line1Length}, 0`"
10
+ :dur="`${dur}s`"
11
+ begin="0s"
12
+ calcMode="spline"
13
+ keyTimes="0;1"
14
+ keySplines="0.4,1,0.49,0.98"
15
+ repeatCount="indefinite" />
16
+ </polyline>
17
+ <polyline fill="transparent" :stroke="mergedColor[1]" stroke-width="2" :points="line2Points">
18
+ <animate
19
+ attributeName="stroke-dasharray"
20
+ attributeType="XML"
21
+ :from="`0, ${line2Length / 2}, 0, ${line2Length / 2}`"
22
+ :to="`0, 0, ${line2Length}, 0`"
23
+ :dur="`${dur}s`"
24
+ begin="0s"
25
+ calcMode="spline"
26
+ keyTimes="0;1"
27
+ keySplines=".4,1,.49,.98"
28
+ repeatCount="indefinite" />
29
+ </polyline>
30
+ </svg>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import mixin from '../mixin/decoration'
36
+ export default {
37
+ name: 'ShDecoration5',
38
+ mixins: [mixin],
39
+ props: {
40
+ dur: {
41
+ type: Number,
42
+ default: 1.2
43
+ }
44
+ },
45
+ data() {
46
+ return {
47
+ line1Points: '',
48
+ line2Points: '',
49
+ line1Length: 0,
50
+ line2Length: 0
51
+ }
52
+ },
53
+ methods: {
54
+ calcSVGData() {
55
+ const { width, height } = this
56
+
57
+ let line1Points = [
58
+ [0, height * 0.2],
59
+ [width * 0.18, height * 0.2],
60
+ [width * 0.2, height * 0.4],
61
+ [width * 0.25, height * 0.4],
62
+ [width * 0.27, height * 0.6],
63
+ [width * 0.72, height * 0.6],
64
+ [width * 0.75, height * 0.4],
65
+ [width * 0.8, height * 0.4],
66
+ [width * 0.82, height * 0.2],
67
+ [width, height * 0.2]
68
+ ]
69
+
70
+ let line2Points = [
71
+ [width * 0.3, height * 0.8],
72
+ [width * 0.7, height * 0.8]
73
+ ]
74
+
75
+ const line1Length = this.getPolylineLength(line1Points)
76
+ const line2Length = this.getPolylineLength(line2Points)
77
+
78
+ line1Points = line1Points.map(point => point.join(',')).join(' ')
79
+ line2Points = line2Points.map(point => point.join(',')).join(' ')
80
+
81
+ this.line1Points = line1Points
82
+ this.line2Points = line2Points
83
+
84
+ this.line1Length = line1Length
85
+ this.line2Length = line2Length
86
+ }
87
+ }
88
+ }
89
+ </script>
90
+
91
+ <style scoped lang="scss">
92
+ .sh-decoration-5 {
93
+ width: 100%;
94
+ height: 100%;
95
+ }
96
+ </style>
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-decoration-6">
3
+ <svg :width="`${svgWH[0]}px`" :height="`${svgWH[1]}px`" :style="`transform:scale(${svgScale[0]},${svgScale[1]});`">
4
+ <template v-for="(point, i) in points" :key="i">
5
+ <rect :fill="mergedColor[Math.random() > 0.5 ? 0 : 1]" :x="point[0] - halfRectWidth" :y="point[1] - heights[i] / 2" :width="rectWidth" :height="heights[i]">
6
+ <animate
7
+ attributeName="y"
8
+ :values="`${point[1] - minHeights[i] / 2};${point[1] - heights[i] / 2};${point[1] - minHeights[i] / 2}`"
9
+ :dur="`${randoms[i]}s`"
10
+ keyTimes="0;0.5;1"
11
+ calcMode="spline"
12
+ keySplines="0.42,0,0.58,1;0.42,0,0.58,1"
13
+ begin="0s"
14
+ repeatCount="indefinite" />
15
+ <animate
16
+ attributeName="height"
17
+ :values="`${minHeights[i]};${heights[i]};${minHeights[i]}`"
18
+ :dur="`${randoms[i]}s`"
19
+ keyTimes="0;0.5;1"
20
+ calcMode="spline"
21
+ keySplines="0.42,0,0.58,1;0.42,0,0.58,1"
22
+ begin="0s"
23
+ repeatCount="indefinite" />
24
+ </rect>
25
+ </template>
26
+ </svg>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import mixin from '../mixin/decoration'
32
+ export default {
33
+ name: 'ShDecoration6',
34
+ mixins: [mixin],
35
+ data() {
36
+ const rectWidth = 7
37
+ return {
38
+ svgWH: [300, 35],
39
+ svgScale: [1, 1],
40
+ rowNum: 1,
41
+ rowPoints: 40,
42
+ rectWidth,
43
+ halfRectWidth: rectWidth / 2,
44
+ points: [],
45
+ heights: [],
46
+ minHeights: [],
47
+ randoms: []
48
+ }
49
+ },
50
+ methods: {
51
+ calcSVGData() {
52
+ const { calcPointsPosition, calcScale } = this
53
+ calcPointsPosition()
54
+ calcScale()
55
+ },
56
+ calcPointsPosition() {
57
+ const { svgWH, rowNum, rowPoints, randomExtend } = this
58
+ const [w, h] = svgWH
59
+ const horizontalGap = w / (rowPoints + 1)
60
+ const verticalGap = h / (rowNum + 1)
61
+ let points = new Array(rowNum).fill(0).map((foo, i) => new Array(rowPoints).fill(0).map((foo, j) => [horizontalGap * (j + 1), verticalGap * (i + 1)]))
62
+ this.points = points.reduce((all, item) => [...all, ...item], [])
63
+ const heights = (this.heights = new Array(rowNum * rowPoints).fill(0).map(foo => (Math.random() > 0.8 ? randomExtend(0.7 * h, h) : randomExtend(0.2 * h, 0.5 * h))))
64
+ this.minHeights = new Array(rowNum * rowPoints).fill(0).map((foo, i) => heights[i] * Math.random())
65
+ this.randoms = new Array(rowNum * rowPoints).fill(0).map(foo => Math.random() + 1.5)
66
+ },
67
+ calcScale() {
68
+ const { width, height, svgWH } = this
69
+ const [w, h] = svgWH
70
+ this.svgScale = [width / w, height / h]
71
+ }
72
+ }
73
+ }
74
+ </script>
75
+
76
+ <style scoped lang="scss">
77
+ .sh-decoration-6 {
78
+ width: 100%;
79
+ height: 100%;
80
+ svg {
81
+ transform-origin: left top;
82
+ }
83
+ }
84
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-decoration-7">
3
+ <svg width="21px" height="20px">
4
+ <polyline stroke-width="4" fill="transparent" :stroke="mergedColor[0]" points="10, 0 19, 10 10, 20" />
5
+ <polyline stroke-width="2" fill="transparent" :stroke="mergedColor[1]" points="2, 0 11, 10 2, 20" />
6
+ </svg>
7
+ <slot></slot>
8
+ <svg width="21px" height="20px">
9
+ <polyline stroke-width="4" fill="transparent" :stroke="mergedColor[0]" points="11, 0 2, 10 11, 20" />
10
+ <polyline stroke-width="2" fill="transparent" :stroke="mergedColor[1]" points="19, 0 10, 10 19, 20" />
11
+ </svg>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ import mixin from '../mixin/decoration'
17
+ export default {
18
+ name: 'ShDecoration7',
19
+ mixins: [mixin]
20
+ }
21
+ </script>
22
+
23
+ <style scoped lang="scss">
24
+ .sh-decoration-7 {
25
+ display: flex;
26
+ width: 100%;
27
+ height: 100%;
28
+ justify-content: center;
29
+ align-items: center;
30
+ }
31
+ </style>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-decoration-8">
3
+ <svg :width="width" :height="height">
4
+ <polyline :stroke="mergedColor[0]" stroke-width="2" fill="transparent" :points="`${xPos(0)}, 0 ${xPos(30)}, ${height / 2}`" />
5
+ <polyline :stroke="mergedColor[0]" stroke-width="2" fill="transparent" :points="`${xPos(20)}, 0 ${xPos(50)}, ${height / 2} ${xPos(width)}, ${height / 2}`" />
6
+ <polyline :stroke="mergedColor[1]" fill="transparent" stroke-width="3" :points="`${xPos(0)}, ${height - 3}, ${xPos(200)}, ${height - 3}`" />
7
+ </svg>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ import mixin from '../mixin/decoration'
13
+ export default {
14
+ name: 'ShDecoration8',
15
+ mixins: [mixin],
16
+ methods: {
17
+ xPos (pos) {
18
+ const { reverse, width } = this
19
+ if (!reverse) return pos
20
+ return width - pos
21
+ }
22
+ }
23
+ }
24
+ </script>
25
+
26
+ <style scoped lang="scss">
27
+ .sh-decoration-8 {
28
+ display: flex;
29
+ width: 100%;
30
+ height: 100%;
31
+ }
32
+ </style>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <div :ref="ref" class="sh-decoration-9">
3
+ <svg :width="`${svgWH[0]}px`" :height="`${svgWH[1]}px`" :style="`transform:scale(${svgScale[0]},${svgScale[1]});`">
4
+ <defs><polygon :id="polygonId" points="15, 46.5, 21, 47.5, 21, 52.5, 15, 53.5" /></defs>
5
+ <circle cx="50" cy="50" r="45" fill="transparent" :stroke="mergedColor[1]" stroke-width="10" stroke-dasharray="80, 100, 30, 100">
6
+ <animateTransform attributeName="transform" type="rotate" values="0 50 50;360 50 50" :dur="`${dur}s`" repeatCount="indefinite" />
7
+ </circle>
8
+ <circle cx="50" cy="50" r="45" fill="transparent" :stroke="mergedColor[0]" stroke-width="6" stroke-dasharray="50, 66, 100, 66">
9
+ <animateTransform attributeName="transform" type="rotate" values="0 50 50;-360 50 50" :dur="`${dur}s`" repeatCount="indefinite" />
10
+ </circle>
11
+ <circle cx="50" cy="50" r="38" fill="transparent" :stroke="fade(mergedColor[1] || defaultColor[1], 30)" stroke-width="1" stroke-dasharray="5, 1" />
12
+ <use v-for="(foo, i) in new Array(20).fill(0)" :key="i" :xlink:href="`#${polygonId}`" :stroke="mergedColor[1]" :fill="Math.random() > 0.4 ? 'transparent' : mergedColor[0]">
13
+ <animateTransform attributeName="transform" type="rotate" values="0 50 50;360 50 50" :dur="`${dur}s`" :begin="`${(i * dur) / 20}s`" repeatCount="indefinite" />
14
+ </use>
15
+ <circle cx="50" cy="50" r="26" fill="transparent" :stroke="fade(mergedColor[1] || defaultColor[1], 30)" stroke-width="1" stroke-dasharray="5, 1" />
16
+ </svg>
17
+
18
+ <slot></slot>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import mixin from '../mixin/decoration'
24
+ export default {
25
+ name: 'ShDecoration9',
26
+ mixins: [mixin],
27
+ data() {
28
+ return {
29
+ svgWH: [100, 100],
30
+ svgScale: [1, 1]
31
+ }
32
+ },
33
+ computed: {
34
+ polygonId() {
35
+ return `decoration-9-polygon-${this.decorationId}`
36
+ }
37
+ },
38
+ methods: {
39
+ calcScale() {
40
+ const { width, height, svgWH } = this
41
+ const [w, h] = svgWH
42
+ this.svgScale = [width / w, height / h]
43
+ }
44
+ }
45
+ }
46
+ </script>
47
+
48
+ <style scoped lang="scss">
49
+ .sh-decoration-9 {
50
+ position: relative;
51
+ width: 100%;
52
+ height: 100%;
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: center;
56
+ svg {
57
+ position: absolute;
58
+ left: 0px;
59
+ top: 0px;
60
+ transform-origin: left top;
61
+ }
62
+ }
63
+ </style>
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <component :is="decorationName" class="sh-decoration" v-bind="$props">
3
+ <slot></slot>
4
+ </component>
5
+ </template>
6
+
7
+ <script>
8
+ import decoration1 from './components/decoration1'
9
+ import decoration2 from './components/decoration2'
10
+ import decoration3 from './components/decoration3'
11
+ import decoration4 from './components/decoration4'
12
+ import decoration5 from './components/decoration5'
13
+ import decoration6 from './components/decoration6'
14
+ import decoration7 from './components/decoration7'
15
+ import decoration8 from './components/decoration8'
16
+ import decoration9 from './components/decoration9'
17
+ import decoration10 from './components/decoration10'
18
+ import decoration11 from './components/decoration11'
19
+ import decoration12 from './components/decoration12'
20
+ export default {
21
+ name: 'ShDecoration',
22
+ components: {
23
+ decoration1,
24
+ decoration2,
25
+ decoration3,
26
+ decoration4,
27
+ decoration5,
28
+ decoration6,
29
+ decoration7,
30
+ decoration8,
31
+ decoration9,
32
+ decoration10,
33
+ decoration11,
34
+ decoration12
35
+ },
36
+ props: {
37
+ type: {
38
+ type: [String, Number],
39
+ default: '1'
40
+ },
41
+ color: {
42
+ type: Array,
43
+ default() {
44
+ return []
45
+ }
46
+ },
47
+ backgroundColor: {
48
+ type: String,
49
+ default: 'transparent'
50
+ },
51
+ dur: {
52
+ type: Number,
53
+ default: 3
54
+ },
55
+ reverse: {
56
+ type: Boolean,
57
+ default: false
58
+ }
59
+ },
60
+ computed: {
61
+ decorationType() {
62
+ return +this.type > 0 && +this.type < 13 ? this.type : 1
63
+ },
64
+ decorationName() {
65
+ return `decoration${this.decorationType}`
66
+ }
67
+ }
68
+ }
69
+ </script>
70
+
71
+ <style lang="scss" scoped></style>
@@ -0,0 +1,69 @@
1
+ import autoResize from '../../mixin/autoResize'
2
+ export default {
3
+ mixins: [autoResize],
4
+ props: {
5
+ type: {
6
+ type: [String, Number],
7
+ default: '1'
8
+ },
9
+ color: {
10
+ type: Array,
11
+ default() {
12
+ return []
13
+ }
14
+ },
15
+ backgroundColor: {
16
+ type: String,
17
+ default: 'transparent'
18
+ },
19
+ dur: {
20
+ type: Number,
21
+ default: 3
22
+ },
23
+ reverse: {
24
+ type: Boolean,
25
+ default: false
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ defaultColors: [
31
+ ['#fff', '#0de7c2'],
32
+ ['#3faacb', '#fff'],
33
+ ['#7acaec', 'transparent'],
34
+ ['rgba(255, 255, 255, 0.3)', 'rgba(255, 255, 255, 0.3)'],
35
+ ['#3f96a5', '#3f96a5'],
36
+ ['#7acaec', '#7acaec'],
37
+ ['#1dc1f5', '#1dc1f5'],
38
+ ['#3f96a5', '#3f96a5'],
39
+ ['rgba(3, 166, 224, 0.8)', 'rgba(3, 166, 224, 0.5)'],
40
+ ['#00c2ff', 'rgba(0, 194, 255, 0.3)'],
41
+ ['#1a98fc', '#2cf7fe'],
42
+ ['#2783ce', '#2cf7fe']
43
+ ]
44
+ }
45
+ },
46
+ computed: {
47
+ ref() {
48
+ return `sh-decoration-${this.type}`
49
+ },
50
+ decorationId() {
51
+ return this.uuid()
52
+ },
53
+ mergedColor() {
54
+ let defaultColor = this.defaultColors[this.type - 1]
55
+ return this.deepMerge(defaultColor, this.color)
56
+ }
57
+ },
58
+ methods: {
59
+ afterAutoResizeMixinInit() {
60
+ const { calcSVGData } = this
61
+ calcSVGData && calcSVGData()
62
+ },
63
+ onResize() {
64
+ const { calcSVGData } = this
65
+ calcSVGData && calcSVGData()
66
+ }
67
+ },
68
+ mounted() {}
69
+ }