openatc-components 0.0.1 → 0.0.2

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 (154) hide show
  1. package/.babelrc +18 -18
  2. package/.editorconfig +9 -9
  3. package/.eslintignore +5 -5
  4. package/.eslintrc.js +29 -29
  5. package/.postcssrc.js +10 -10
  6. package/README.md +30 -30
  7. package/build/build.js +41 -41
  8. package/build/check-versions.js +54 -54
  9. package/build/package.config.js +58 -58
  10. package/build/package.dev.config.js +25 -25
  11. package/build/package.prod.config.js +60 -60
  12. package/build/utils.js +101 -101
  13. package/build/vue-loader.conf.js +22 -22
  14. package/build/webpack.base.conf.js +109 -109
  15. package/build/webpack.dev.conf.js +95 -95
  16. package/build/webpack.prod.conf.js +149 -149
  17. package/config/dev.env.js +7 -7
  18. package/config/index.js +76 -76
  19. package/config/prod.env.js +4 -4
  20. package/config/test.env.js +7 -7
  21. package/index.html +12 -12
  22. package/package/kisscomps/components/CircleMenu/KissCircleMenu.vue +398 -398
  23. package/package/kisscomps/components/CircleMenu/index.js +2 -2
  24. package/package/kisscomps/components/DashBoard/MakeGradientColor.js +84 -84
  25. package/package/kisscomps/components/DashBoard/dashboard.js +471 -471
  26. package/package/kisscomps/components/DashBoard/dashboard.vue +57 -57
  27. package/package/kisscomps/components/DashBoard/index.js +2 -2
  28. package/package/kisscomps/components/Horizontal/KissHorizontal.vue +146 -146
  29. package/package/kisscomps/components/Horizontal/index.js +2 -2
  30. package/package/kisscomps/components/HorizontalChildren/KissHorizontalChildren.vue +196 -196
  31. package/package/kisscomps/components/HorizontalChildren/index.js +2 -2
  32. package/package/kisscomps/components/KissCircleMenu/CircleMenu.vue +113 -113
  33. package/package/kisscomps/components/KissCircleMenu/index.js +2 -2
  34. package/package/kisscomps/components/KissCircleMenu/style/index.less +1 -1
  35. package/package/kisscomps/components/KissCircleMenu/style/main/core.less +161 -161
  36. package/package/kisscomps/components/KissCircleMenu/style/main/other.less +94 -94
  37. package/package/kisscomps/components/KissCircleMenu/style/mixin/mixin.less +36 -36
  38. package/package/kisscomps/components/KissCircleMenu/style/var/var.less +21 -21
  39. package/package/kisscomps/components/KissCircleMenu/utils/colorRE.js +5 -5
  40. package/package/kisscomps/components/KissMessageBox/KissMessageBox.vue +108 -108
  41. package/package/kisscomps/components/KissMessageBox/index.js +2 -2
  42. package/package/kisscomps/components/KissSearchInput/index.js +2 -2
  43. package/package/kisscomps/components/KissSearchInput/kisssearchinput.vue +77 -77
  44. package/package/kisscomps/components/KissSimulationProgress/KissSimulationProgress.vue +294 -294
  45. package/package/kisscomps/components/KissSimulationProgress/index.js +2 -2
  46. package/package/kisscomps/components/StatusBar/StatusBar.vue +222 -222
  47. package/package/kisscomps/components/StatusBar/index.js +2 -2
  48. package/package/kisscomps/components/TragResize/index.js +2 -2
  49. package/package/kisscomps/components/TragResize/kissdragresize.vue +536 -536
  50. package/package/kisscomps/components/TragResize/util/dom.js +23 -23
  51. package/package/kisscomps/components/TragResize/util/fns.js +3 -3
  52. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.1.vue +320 -320
  53. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +345 -345
  54. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  55. package/package/kisscomps/components/button/index.js +2 -2
  56. package/package/kisscomps/components/button/kissbutton.vue +168 -168
  57. package/package/kisscomps/components/compass3D/compass.vue +180 -180
  58. package/package/kisscomps/components/compass3D/index.js +2 -2
  59. package/package/kisscomps/components/header/index.js +2 -2
  60. package/package/kisscomps/components/header/kissHead.vue +83 -83
  61. package/package/kisscomps/components/horizontalMenu/index.js +2 -2
  62. package/package/kisscomps/components/horizontalMenu/kissHorizontalMenu.vue +254 -254
  63. package/package/kisscomps/components/input/index.js +2 -2
  64. package/package/kisscomps/components/input/kissinput.vue +57 -57
  65. package/package/kisscomps/components/menu/index.js +2 -2
  66. package/package/kisscomps/components/menu/kissmenu.vue +324 -324
  67. package/package/kisscomps/components/mutipletips/Tdrag.js +585 -585
  68. package/package/kisscomps/components/mutipletips/index.js +2 -2
  69. package/package/kisscomps/components/mutipletips/kissmutipletips.vue +192 -192
  70. package/package/kisscomps/components/panel/index.js +2 -2
  71. package/package/kisscomps/components/panel/kissPanel.vue +151 -151
  72. package/package/kisscomps/components/select/chosen.jquery.min.js +3 -3
  73. package/package/kisscomps/components/select/index.js +2 -2
  74. package/package/kisscomps/components/select/kissselect.vue +527 -527
  75. package/package/kisscomps/components/tablebutton/index.js +2 -2
  76. package/package/kisscomps/components/tablebutton/tablebutton.vue +97 -97
  77. package/package/kisscomps/components/timectrl/KissTimeCtrl.vue +67 -67
  78. package/package/kisscomps/components/timectrl/index.js +2 -2
  79. package/package/kisscomps/components/timectrl/timectrl.css +851 -851
  80. package/package/kisscomps/components/tip/Tdrag.js +585 -585
  81. package/package/kisscomps/components/tip/index.js +2 -2
  82. package/package/kisscomps/components/tip/kisstips.1.vue +154 -154
  83. package/package/kisscomps/components/tip/kisstips.vue +154 -154
  84. package/package/kisscomps/components/tip/kisstips.vue.bak +211 -211
  85. package/package/kisscomps/index.js +71 -71
  86. package/package/kissui.js +203 -203
  87. package/package/kissui.min.js +203 -203
  88. package/package.json +1 -1
  89. package/src/App.vue +25 -25
  90. package/src/kisscomps/components/CircleMenu/KissCircleMenu.vue +398 -398
  91. package/src/kisscomps/components/CircleMenu/index.js +2 -2
  92. package/src/kisscomps/components/DashBoard/MakeGradientColor.js +84 -84
  93. package/src/kisscomps/components/DashBoard/dashboard.js +471 -471
  94. package/src/kisscomps/components/DashBoard/dashboard.vue +57 -57
  95. package/src/kisscomps/components/DashBoard/index.js +2 -2
  96. package/src/kisscomps/components/KissCircleMenu/CircleMenu.vue +113 -113
  97. package/src/kisscomps/components/KissCircleMenu/index.js +2 -2
  98. package/src/kisscomps/components/KissCircleMenu/style/index.less +1 -1
  99. package/src/kisscomps/components/KissCircleMenu/style/main/core.less +161 -161
  100. package/src/kisscomps/components/KissCircleMenu/style/main/other.less +94 -94
  101. package/src/kisscomps/components/KissCircleMenu/style/mixin/mixin.less +36 -36
  102. package/src/kisscomps/components/KissCircleMenu/style/var/var.less +21 -21
  103. package/src/kisscomps/components/KissCircleMenu/utils/colorRE.js +5 -5
  104. package/src/kisscomps/components/KissSearchInput/index.js +2 -2
  105. package/src/kisscomps/components/KissSearchInput/kisssearchinput.vue +77 -77
  106. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +193 -0
  107. package/src/kisscomps/components/SchemeConfig/index.js +2 -0
  108. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +214 -0
  109. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +176 -0
  110. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +294 -0
  111. package/src/kisscomps/components/SchemeConfig/schemeconfig.vue +711 -0
  112. package/src/kisscomps/components/StatusBar/StatusBar.vue +222 -222
  113. package/src/kisscomps/components/StatusBar/index.js +2 -2
  114. package/src/kisscomps/components/TragResize/index.js +2 -2
  115. package/src/kisscomps/components/TragResize/kissdragresize.vue +536 -536
  116. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.1.vue +320 -320
  117. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +345 -345
  118. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  119. package/src/kisscomps/components/button/index.js +2 -2
  120. package/src/kisscomps/components/button/kissbutton.vue +168 -168
  121. package/src/kisscomps/components/compass3D/compass.vue +180 -180
  122. package/src/kisscomps/components/compass3D/index.js +2 -2
  123. package/src/kisscomps/components/horizontalMenu/index.js +2 -2
  124. package/src/kisscomps/components/horizontalMenu/kissHorizontalMenu.vue +254 -254
  125. package/src/kisscomps/components/input/index.js +2 -2
  126. package/src/kisscomps/components/input/kissinput.vue +57 -57
  127. package/src/kisscomps/components/menu/index.js +2 -2
  128. package/src/kisscomps/components/menu/kissmenu.vue +324 -324
  129. package/src/kisscomps/components/mutipletips/Tdrag.js +585 -585
  130. package/src/kisscomps/components/mutipletips/index.js +2 -2
  131. package/src/kisscomps/components/mutipletips/kissmutipletips.vue +192 -192
  132. package/src/kisscomps/components/select/chosen.jquery.min.js +3 -3
  133. package/src/kisscomps/components/select/index.js +2 -2
  134. package/src/kisscomps/components/select/kissselect.vue +527 -527
  135. package/src/kisscomps/components/timectrl/KissTimeCtrl.vue +67 -67
  136. package/src/kisscomps/components/timectrl/index.js +2 -2
  137. package/src/kisscomps/components/tip/Tdrag.js +585 -585
  138. package/src/kisscomps/components/tip/index.js +2 -2
  139. package/src/kisscomps/components/tip/kisstips.1.vue +154 -154
  140. package/src/kisscomps/components/tip/kisstips.vue +154 -154
  141. package/src/kisscomps/components/tip/kisstips.vue.bak +211 -211
  142. package/src/kisscomps/index.js +73 -71
  143. package/src/main.js +23 -23
  144. package/src/router/index.js +15 -15
  145. package/src/views/home.1.vue +479 -479
  146. package/src/views/home.vue +196 -196
  147. package/test/e2e/custom-assertions/elementCount.js +27 -27
  148. package/test/e2e/nightwatch.conf.js +46 -46
  149. package/test/e2e/runner.js +48 -48
  150. package/test/e2e/specs/test.js +19 -19
  151. package/test/unit/.eslintrc +7 -7
  152. package/test/unit/jest.conf.js +30 -30
  153. package/test/unit/setup.js +3 -3
  154. package/test/unit/specs/HelloWorld.spec.js +11 -11
@@ -1,196 +1,196 @@
1
- <template>
2
- <div :style="bgStyle" :ref="domName">
3
- <div class="horizontalconimg">
4
- <slot name="leftslot"></slot>
5
- </div>
6
- <div class="horizontalcontext">
7
- <div class="horizontalContextBox" v-for="(data, index) in dataList" :key="index">
8
- <div class="horizontal">
9
- <el-progress :color="data.color" :percentage="data.horizontalWidth" :show-text="false"></el-progress>
10
- </div>
11
- <div class="hor_num"><span :style="rightNum">{{data.value}}</span></div>
12
- </div>
13
- <div class="hor_text">{{this.name}}</div>
14
- </div>
15
- </div>
16
- </template>
17
- <script>
18
- export default {
19
- name: 'kiss-horizontalchildren',
20
- props: {
21
- dataList: {
22
- type: Array,
23
- default: () => {
24
- return []
25
- }
26
- },
27
- name: {
28
- type: String,
29
- default: null
30
- },
31
- // value: {
32
- // type: Number,
33
- // default: 0
34
- // },
35
- // color: {
36
- // type: String,
37
- // default: '#43b4cf'
38
- // },
39
- // maxNum: { // 最大数值
40
- // type: Number,
41
- // default: 1
42
- // },
43
- horizontalDistance: { // 上下两个的间距
44
- type: String,
45
- default: '3px'
46
- },
47
- mainwidth: {
48
- type: String,
49
- default: '400px'
50
- },
51
- mainheight: {
52
- type: String,
53
- default: '25px'
54
- },
55
- display: { // 是否展示右侧数值
56
- type: Boolean,
57
- default: true
58
- },
59
- backColor: { // 背景色。默认没有背景,可用rgba形式加背景色的透明度。
60
- type: String,
61
- default: 'rgba(0, 0, 0, 0)'
62
- }
63
- },
64
- data () {
65
- return {
66
- bgStyle: {
67
- 'position': 'relative',
68
- 'marginBottom': '',
69
- 'width': '',
70
- 'height': ''
71
- },
72
- rightNum: {
73
- 'line-height': '80%',
74
- 'color': '#fff',
75
- 'display': 'block',
76
- 'font-size': '13px'
77
- },
78
- horizontalWidth: 0,
79
- domName: 'progress'
80
- }
81
- },
82
- watch: {
83
- dataList: {
84
- handler: function (val) {
85
- this.getDatalist()
86
- },
87
- deep: true
88
- }
89
- },
90
- methods: {
91
- isShowrightnum () {
92
- if (this.display) return
93
- this.rightNum.display = 'none'
94
- },
95
- getDatalist () {
96
- if (this.display) {
97
- if (!this.dataList.length) return
98
- this.dataList.forEach(ele => {
99
- if (ele.value > ele.maxNum) {
100
- ele.horizontalWidth = 80
101
- } else {
102
- ele.horizontalWidth = ele.value / ele.maxNum * 80 // 如果展示右侧数字的话,横条的最大长度占80%
103
- }
104
- if (ele.color === undefined) {
105
- ele.color = '#43b4cf'
106
- }
107
- })
108
- } else {
109
- if (!this.dataList.length) return
110
- this.dataList.forEach(ele => {
111
- if (ele.value > ele.maxNum) {
112
- ele.horizontalWidth = 100
113
- } else {
114
- ele.horizontalWidth = ele.value / ele.maxNum * 100 // 如果不展示右侧数字的话,横条的最大长度占100%
115
- }
116
- if (ele.color === undefined) {
117
- ele.color = '#43b4cf'
118
- }
119
- })
120
- }
121
- },
122
- changeBackColor () {
123
- const domName = this.domName
124
- // 设置背景色
125
- const clsObjs = this.$refs[domName].getElementsByClassName('el-progress-bar__outer')
126
- for (var i = 0; i < clsObjs.length; i++) {
127
- clsObjs[i].style.backgroundColor = this.backColor
128
- }
129
- }
130
- },
131
- created () {
132
- this.domName = `progress_${Math.random()}`
133
- },
134
- mounted () {
135
- this.bgStyle.width = this.mainwidth
136
- this.bgStyle.height = this.mainheight
137
- this.bgStyle.marginBottom = this.horizontalDistance
138
- this.changeBackColor()
139
- this.getDatalist()
140
- this.isShowrightnum()
141
- }
142
- }
143
- </script>
144
- <style scoped>
145
- .horizontalstyle {
146
- float: left;
147
- margin: 0px auto;
148
- padding: 0px;
149
- /* width: 20%; */
150
- height: 15%;
151
- /* background: red; */
152
- overflow: hidden;
153
- margin-top: 0%;
154
- border-top-right-radius: 5px;
155
- border-bottom-right-radius: 5px;
156
- width:100px;
157
- transition: width 1s;
158
- -moz-transition: width 1s; /* Firefox 4 */
159
- -webkit-transition: width 1s; /* Safari 和 Chrome */
160
- -o-transition: width 1s; /* Opera */
161
- }
162
- .horizontalcontext {
163
- float: left;
164
- width: 85%;
165
- }
166
- .horizontalconimg {
167
- float: left;
168
- margin-right: 6px;
169
- /* min-width: 34px;
170
- min-height: 30px; */
171
- }
172
- .horizontal {
173
- float: left;
174
- width: 80%;
175
- }
176
- .horizontalContextBox {
177
- overflow: hidden;
178
- margin-bottom: 5px;
179
- position: relative;
180
- min-height:10px;
181
- }
182
- .hor_num {
183
- /*float: left;
184
- width: 10%;*/
185
- margin-left: 15px;
186
- position: absolute;
187
- right: 0;
188
- }
189
- .hor_text {
190
- margin-top: -5px;
191
- color: #bbb;
192
- font-size: 10px;
193
- margin-top: 2px;
194
- text-align: left;
195
- }
196
- </style>
1
+ <template>
2
+ <div :style="bgStyle" :ref="domName">
3
+ <div class="horizontalconimg">
4
+ <slot name="leftslot"></slot>
5
+ </div>
6
+ <div class="horizontalcontext">
7
+ <div class="horizontalContextBox" v-for="(data, index) in dataList" :key="index">
8
+ <div class="horizontal">
9
+ <el-progress :color="data.color" :percentage="data.horizontalWidth" :show-text="false"></el-progress>
10
+ </div>
11
+ <div class="hor_num"><span :style="rightNum">{{data.value}}</span></div>
12
+ </div>
13
+ <div class="hor_text">{{this.name}}</div>
14
+ </div>
15
+ </div>
16
+ </template>
17
+ <script>
18
+ export default {
19
+ name: 'kiss-horizontalchildren',
20
+ props: {
21
+ dataList: {
22
+ type: Array,
23
+ default: () => {
24
+ return []
25
+ }
26
+ },
27
+ name: {
28
+ type: String,
29
+ default: null
30
+ },
31
+ // value: {
32
+ // type: Number,
33
+ // default: 0
34
+ // },
35
+ // color: {
36
+ // type: String,
37
+ // default: '#43b4cf'
38
+ // },
39
+ // maxNum: { // 最大数值
40
+ // type: Number,
41
+ // default: 1
42
+ // },
43
+ horizontalDistance: { // 上下两个的间距
44
+ type: String,
45
+ default: '3px'
46
+ },
47
+ mainwidth: {
48
+ type: String,
49
+ default: '400px'
50
+ },
51
+ mainheight: {
52
+ type: String,
53
+ default: '25px'
54
+ },
55
+ display: { // 是否展示右侧数值
56
+ type: Boolean,
57
+ default: true
58
+ },
59
+ backColor: { // 背景色。默认没有背景,可用rgba形式加背景色的透明度。
60
+ type: String,
61
+ default: 'rgba(0, 0, 0, 0)'
62
+ }
63
+ },
64
+ data () {
65
+ return {
66
+ bgStyle: {
67
+ 'position': 'relative',
68
+ 'marginBottom': '',
69
+ 'width': '',
70
+ 'height': ''
71
+ },
72
+ rightNum: {
73
+ 'line-height': '80%',
74
+ 'color': '#fff',
75
+ 'display': 'block',
76
+ 'font-size': '13px'
77
+ },
78
+ horizontalWidth: 0,
79
+ domName: 'progress'
80
+ }
81
+ },
82
+ watch: {
83
+ dataList: {
84
+ handler: function (val) {
85
+ this.getDatalist()
86
+ },
87
+ deep: true
88
+ }
89
+ },
90
+ methods: {
91
+ isShowrightnum () {
92
+ if (this.display) return
93
+ this.rightNum.display = 'none'
94
+ },
95
+ getDatalist () {
96
+ if (this.display) {
97
+ if (!this.dataList.length) return
98
+ this.dataList.forEach(ele => {
99
+ if (ele.value > ele.maxNum) {
100
+ ele.horizontalWidth = 80
101
+ } else {
102
+ ele.horizontalWidth = ele.value / ele.maxNum * 80 // 如果展示右侧数字的话,横条的最大长度占80%
103
+ }
104
+ if (ele.color === undefined) {
105
+ ele.color = '#43b4cf'
106
+ }
107
+ })
108
+ } else {
109
+ if (!this.dataList.length) return
110
+ this.dataList.forEach(ele => {
111
+ if (ele.value > ele.maxNum) {
112
+ ele.horizontalWidth = 100
113
+ } else {
114
+ ele.horizontalWidth = ele.value / ele.maxNum * 100 // 如果不展示右侧数字的话,横条的最大长度占100%
115
+ }
116
+ if (ele.color === undefined) {
117
+ ele.color = '#43b4cf'
118
+ }
119
+ })
120
+ }
121
+ },
122
+ changeBackColor () {
123
+ const domName = this.domName
124
+ // 设置背景色
125
+ const clsObjs = this.$refs[domName].getElementsByClassName('el-progress-bar__outer')
126
+ for (var i = 0; i < clsObjs.length; i++) {
127
+ clsObjs[i].style.backgroundColor = this.backColor
128
+ }
129
+ }
130
+ },
131
+ created () {
132
+ this.domName = `progress_${Math.random()}`
133
+ },
134
+ mounted () {
135
+ this.bgStyle.width = this.mainwidth
136
+ this.bgStyle.height = this.mainheight
137
+ this.bgStyle.marginBottom = this.horizontalDistance
138
+ this.changeBackColor()
139
+ this.getDatalist()
140
+ this.isShowrightnum()
141
+ }
142
+ }
143
+ </script>
144
+ <style scoped>
145
+ .horizontalstyle {
146
+ float: left;
147
+ margin: 0px auto;
148
+ padding: 0px;
149
+ /* width: 20%; */
150
+ height: 15%;
151
+ /* background: red; */
152
+ overflow: hidden;
153
+ margin-top: 0%;
154
+ border-top-right-radius: 5px;
155
+ border-bottom-right-radius: 5px;
156
+ width:100px;
157
+ transition: width 1s;
158
+ -moz-transition: width 1s; /* Firefox 4 */
159
+ -webkit-transition: width 1s; /* Safari 和 Chrome */
160
+ -o-transition: width 1s; /* Opera */
161
+ }
162
+ .horizontalcontext {
163
+ float: left;
164
+ width: 85%;
165
+ }
166
+ .horizontalconimg {
167
+ float: left;
168
+ margin-right: 6px;
169
+ /* min-width: 34px;
170
+ min-height: 30px; */
171
+ }
172
+ .horizontal {
173
+ float: left;
174
+ width: 80%;
175
+ }
176
+ .horizontalContextBox {
177
+ overflow: hidden;
178
+ margin-bottom: 5px;
179
+ position: relative;
180
+ min-height:10px;
181
+ }
182
+ .hor_num {
183
+ /*float: left;
184
+ width: 10%;*/
185
+ margin-left: 15px;
186
+ position: absolute;
187
+ right: 0;
188
+ }
189
+ .hor_text {
190
+ margin-top: -5px;
191
+ color: #bbb;
192
+ font-size: 10px;
193
+ margin-top: 2px;
194
+ text-align: left;
195
+ }
196
+ </style>
@@ -1,2 +1,2 @@
1
- import KissHorizontalChildren from './KissHorizontalChildren.vue'
2
- export default KissHorizontalChildren
1
+ import KissHorizontalChildren from './KissHorizontalChildren.vue'
2
+ export default KissHorizontalChildren
@@ -1,113 +1,113 @@
1
- <template>
2
- <div id='CircleMenu'>
3
- <div :class="type" :animate='animate'>
4
- <div class="oy-mask-black" v-show="MaskToggle" v-if="mask==='black'" @click="toggle"></div>
5
- <div class="oy-mask-white" v-show="MaskToggle" v-if="mask==='white'" @click="toggle"></div>
6
- <div class="oy-menu-group" :class="{'open':open}">
7
- <button class="oy-menu-btn btn-toggle" :class="{'oy-menu-btn-Circle':circle}" :style='{}' @click="toggle">
8
- <i class="icon-bars" v-if="btn"></i>
9
- <slot name="item_btn"></slot>
10
- </button>
11
- <div class="btn-list">
12
- <div class="oy-menu-item oy-menu-item_1 yellow" :class="AnimateClass" :style='{background:Item1Color}' v-show="number > 1 && number < 5">
13
- <slot name="item_1"></slot>
14
- </div>
15
- <div class="oy-menu-item oy-menu-item_2 purple" :class="AnimateClass" :style='{background:Item2Color}' v-show="number > 1 && number < 5">
16
- <slot name="item_2"></slot>
17
- </div>
18
- <div class="oy-menu-item oy-menu-item_3 green" :class="AnimateClass" :style='{background:Item3Color}' v-show="isShow">
19
- <slot name="item_3"></slot>
20
- </div>
21
- <div class="oy-menu-item oy-menu-item_4 blue" :class="AnimateClass" :style='{background:Item4Color}' v-show="number === 4">
22
- <slot name="item_4"></slot>
23
- </div>
24
- </div>
25
- </div>
26
- </div>
27
- </div>
28
- </template>
29
-
30
- <script>
31
- import { isColors } from './utils/colorRE.js'
32
- export default {
33
- name: 'CirleMenu',
34
- props: {
35
- type: {
36
- type: String,
37
- required: true
38
- },
39
- number: {
40
- type: Number,
41
- required: true,
42
- validator: function (value) {
43
- return value > 1 && value < 5
44
- }
45
- },
46
- animate: String,
47
- mask: String,
48
- circle: Boolean,
49
- btn: Boolean,
50
- colors: Array
51
- },
52
- data () {
53
- return {
54
- open: false,
55
- toggleAnimate: false,
56
- MaskToggle: false,
57
- BtnColor: '',
58
- Item1Color: '',
59
- Item2Color: '',
60
- Item3Color: '',
61
- Item4Color: ''
62
- }
63
- },
64
- methods: {
65
- toggle () {
66
- this.open = !this.open
67
- this.toggleAnimate = !this.toggleAnimate
68
- this.MaskToggle = !this.MaskToggle
69
- }
70
- },
71
- computed: {
72
- AnimateClass () {
73
- return this.toggleAnimate ? this.animate : ''
74
- },
75
- isShow () {
76
- if (this.number === 3) {
77
- if (this.type === 'middle' || this.type === 'middle-around') {
78
- console.error("when type is 'middle' or 'middle-around',this number can not 3 ---VueCircleMenu")
79
- } else {
80
- return true
81
- }
82
- } else if (this.number === 4) {
83
- return true
84
- } else {
85
- return false
86
- }
87
- }
88
- },
89
- mounted () {
90
- if (this.colors) {
91
- if (this.colors.every(isColors) && this.colors.length === 5) {
92
- for (let i = 0, length = this.colors.length; i < length; i++) {
93
- this.BtnColor = this.colors[0]
94
- this.Item1Color = this.colors[1]
95
- this.Item2Color = this.colors[2]
96
- this.Item3Color = this.colors[3]
97
- this.Item4Color = this.colors[4]
98
- }
99
- } else {
100
- console.error('this Array of colors must be hexcolor or rgbcolor and Array length must be 5 ---VueCircleMenu')
101
- }
102
- } else {
103
- return {}
104
- }
105
- }
106
- }
107
- </script>
108
-
109
- <style lang="less">
110
-
111
- @import './style/index.less';
112
-
113
- </style>
1
+ <template>
2
+ <div id='CircleMenu'>
3
+ <div :class="type" :animate='animate'>
4
+ <div class="oy-mask-black" v-show="MaskToggle" v-if="mask==='black'" @click="toggle"></div>
5
+ <div class="oy-mask-white" v-show="MaskToggle" v-if="mask==='white'" @click="toggle"></div>
6
+ <div class="oy-menu-group" :class="{'open':open}">
7
+ <button class="oy-menu-btn btn-toggle" :class="{'oy-menu-btn-Circle':circle}" :style='{}' @click="toggle">
8
+ <i class="icon-bars" v-if="btn"></i>
9
+ <slot name="item_btn"></slot>
10
+ </button>
11
+ <div class="btn-list">
12
+ <div class="oy-menu-item oy-menu-item_1 yellow" :class="AnimateClass" :style='{background:Item1Color}' v-show="number > 1 && number < 5">
13
+ <slot name="item_1"></slot>
14
+ </div>
15
+ <div class="oy-menu-item oy-menu-item_2 purple" :class="AnimateClass" :style='{background:Item2Color}' v-show="number > 1 && number < 5">
16
+ <slot name="item_2"></slot>
17
+ </div>
18
+ <div class="oy-menu-item oy-menu-item_3 green" :class="AnimateClass" :style='{background:Item3Color}' v-show="isShow">
19
+ <slot name="item_3"></slot>
20
+ </div>
21
+ <div class="oy-menu-item oy-menu-item_4 blue" :class="AnimateClass" :style='{background:Item4Color}' v-show="number === 4">
22
+ <slot name="item_4"></slot>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import { isColors } from './utils/colorRE.js'
32
+ export default {
33
+ name: 'CirleMenu',
34
+ props: {
35
+ type: {
36
+ type: String,
37
+ required: true
38
+ },
39
+ number: {
40
+ type: Number,
41
+ required: true,
42
+ validator: function (value) {
43
+ return value > 1 && value < 5
44
+ }
45
+ },
46
+ animate: String,
47
+ mask: String,
48
+ circle: Boolean,
49
+ btn: Boolean,
50
+ colors: Array
51
+ },
52
+ data () {
53
+ return {
54
+ open: false,
55
+ toggleAnimate: false,
56
+ MaskToggle: false,
57
+ BtnColor: '',
58
+ Item1Color: '',
59
+ Item2Color: '',
60
+ Item3Color: '',
61
+ Item4Color: ''
62
+ }
63
+ },
64
+ methods: {
65
+ toggle () {
66
+ this.open = !this.open
67
+ this.toggleAnimate = !this.toggleAnimate
68
+ this.MaskToggle = !this.MaskToggle
69
+ }
70
+ },
71
+ computed: {
72
+ AnimateClass () {
73
+ return this.toggleAnimate ? this.animate : ''
74
+ },
75
+ isShow () {
76
+ if (this.number === 3) {
77
+ if (this.type === 'middle' || this.type === 'middle-around') {
78
+ console.error("when type is 'middle' or 'middle-around',this number can not 3 ---VueCircleMenu")
79
+ } else {
80
+ return true
81
+ }
82
+ } else if (this.number === 4) {
83
+ return true
84
+ } else {
85
+ return false
86
+ }
87
+ }
88
+ },
89
+ mounted () {
90
+ if (this.colors) {
91
+ if (this.colors.every(isColors) && this.colors.length === 5) {
92
+ for (let i = 0, length = this.colors.length; i < length; i++) {
93
+ this.BtnColor = this.colors[0]
94
+ this.Item1Color = this.colors[1]
95
+ this.Item2Color = this.colors[2]
96
+ this.Item3Color = this.colors[3]
97
+ this.Item4Color = this.colors[4]
98
+ }
99
+ } else {
100
+ console.error('this Array of colors must be hexcolor or rgbcolor and Array length must be 5 ---VueCircleMenu')
101
+ }
102
+ } else {
103
+ return {}
104
+ }
105
+ }
106
+ }
107
+ </script>
108
+
109
+ <style lang="less">
110
+
111
+ @import './style/index.less';
112
+
113
+ </style>
@@ -1,2 +1,2 @@
1
- import CircleMenu from './CircleMenu.vue'
2
- export default CircleMenu
1
+ import CircleMenu from './CircleMenu.vue'
2
+ export default CircleMenu
@@ -1,2 +1,2 @@
1
- @import "./main/core.less";
1
+ @import "./main/core.less";
2
2
  @import "./main/other.less";