bbb copy.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <div class="left-charts">
  3. <div class="left-chart-item">
  4. <dv-charts class="item-chart" :option="option" />
  5. <div class="item-chart-word zongshu">用户总数</div>
  6. </div>
  7. <div class="left-chart-item">
  8. <dv-charts class="item-chart" :option="option1" />
  9. <div class="item-chart-word zaixianshu">绑定设备</div>
  10. </div>
  11. <div class="left-chart-item">
  12. <dv-charts class="item-chart" :option="option2" />
  13. <div class="item-chart-word lixianshu">绑定用户数</div>
  14. </div>
  15. <div class="left-chart-item">
  16. <dv-charts class="item-chart" :option="option3" />
  17. <div class="item-chart-word gaojingshu">设备活跃度</div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { count, alarm } from "@/api/system/datav";
  23. export default {
  24. name: "BottomCharts",
  25. props: {
  26. number: {
  27. type: Number,
  28. default: 0,
  29. },
  30. data:{
  31. type:Object,
  32. default:{},
  33. }
  34. },
  35. components: {
  36. },
  37. data() {
  38. return {
  39. // userTotal:0,
  40. option: {
  41. series: [
  42. {
  43. type: "gauge",
  44. startAngle: -Math.PI / 2,
  45. endAngle: Math.PI * 1.5,
  46. arcLineWidth: 10,
  47. radius:'80%',
  48. data: [
  49. {
  50. name: "itemA",
  51. value: this.number,
  52. // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
  53. gradient: ["#01dcdf"],
  54. },
  55. ],
  56. axisLabel: {
  57. show: false,
  58. },
  59. axisTick: {
  60. show: false,
  61. },
  62. pointer: {
  63. show: false,
  64. },
  65. dataItemStyle: {
  66. lineCap: "round",
  67. },
  68. details: {
  69. show: true,
  70. formatter: "{value}",
  71. style: {
  72. fill: "#1ed3e5",
  73. fontSize: 30,
  74. },
  75. },
  76. },
  77. ],
  78. },
  79. option1: {
  80. series: [
  81. {
  82. type: "gauge",
  83. startAngle: -Math.PI / 2,
  84. endAngle: Math.PI * 1.5,
  85. arcLineWidth: 10,
  86. radius:'80%',
  87. data: [
  88. {
  89. name: "itemA",
  90. value: this.data.bindDevice,
  91. // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
  92. gradient: ["#33faaa"],
  93. },
  94. ],
  95. axisLabel: {
  96. show: false,
  97. },
  98. axisTick: {
  99. show: false,
  100. },
  101. pointer: {
  102. show: false,
  103. },
  104. dataItemStyle: {
  105. lineCap: "round",
  106. },
  107. details: {
  108. show: true,
  109. formatter: "{value}",
  110. style: {
  111. fill: "#1ed3e5",
  112. fontSize: 30,
  113. },
  114. },
  115. },
  116. ],
  117. },
  118. option2: {
  119. series: [
  120. {
  121. type: "gauge",
  122. startAngle: -Math.PI / 2,
  123. endAngle: Math.PI * 1.5,
  124. arcLineWidth: 10,
  125. radius:'80%',
  126. data: [
  127. {
  128. name: "itemA",
  129. value: this.data.bindUser,
  130. // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
  131. gradient: ["#f7ac20"],
  132. },
  133. ],
  134. axisLabel: {
  135. show: false,
  136. },
  137. axisTick: {
  138. show: false,
  139. },
  140. pointer: {
  141. show: false,
  142. },
  143. dataItemStyle: {
  144. lineCap: "round",
  145. },
  146. details: {
  147. show: true,
  148. formatter: "{value}",
  149. style: {
  150. fill: "#1ed3e5",
  151. fontSize: 30,
  152. },
  153. },
  154. },
  155. ],
  156. },
  157. option3: {
  158. series: [
  159. {
  160. type: "gauge",
  161. startAngle: -Math.PI / 2,
  162. endAngle: Math.PI * 1.5,
  163. arcLineWidth: 10,
  164. radius:'80%',
  165. data: [
  166. {
  167. name: "itemA",
  168. value: this.data.deviceOnline,
  169. // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
  170. gradient: ["#f93496", "#f61967","#f2053e"],
  171. },
  172. ],
  173. axisLabel: {
  174. show: false,
  175. },
  176. axisTick: {
  177. show: false,
  178. },
  179. pointer: {
  180. show: false,
  181. },
  182. dataItemStyle: {
  183. lineCap: "round",
  184. },
  185. details: {
  186. show: true,
  187. formatter: "{value}",
  188. style: {
  189. fill: "#1ed3e5",
  190. fontSize: 30,
  191. },
  192. },
  193. animationFrame: 10,
  194. },
  195. ],
  196. },
  197. };
  198. },
  199. };
  200. </script>
  201. <style lang="scss">
  202. .left-charts {
  203. width: 100%;
  204. height: 80%;
  205. display: flex;
  206. position: relative;
  207. .left-chart-item {
  208. width: 25%;
  209. height: 100%;
  210. box-sizing: border-box;
  211. text-align: center;
  212. .item-chart {
  213. height: calc(100% - 80px);
  214. position: relative;
  215. }
  216. .item-chart-word{
  217. font-size: 20px;
  218. margin-top: 15px;
  219. font-weight: bold;
  220. }
  221. .zongshu{
  222. color:rgb(0, 253, 250);
  223. }
  224. .zaixianshu{
  225. color:rgb(7, 247, 168);
  226. }
  227. .lixianshu{
  228. color:rgb(227, 179, 55);
  229. }
  230. .gaojingshu{
  231. color:rgb(245, 2, 61);
  232. }
  233. }
  234. }
  235. </style>