equTotal.vue 6.4 KB

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