equTotal.vue 5.5 KB

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