RoadGrade.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div class="left_four">
  3. <CommonTitle title="道路等级" />
  4. <div class="content">
  5. <div id="chartOne">
  6. </div>
  7. <div class="right">
  8. <div class="top center">
  9. <div class="top_left center">
  10. 面积(万㎡)
  11. </div>
  12. <div class="top_right center">
  13. {{num}}
  14. </div>
  15. </div>
  16. <div class="bottom">
  17. <div class="bottom_item" v-for="item in arr" :key="item.id">
  18. <div class="item_top center">
  19. <div :class="`dot ${item.className1}`">
  20. </div>
  21. <div class="name">
  22. {{item.dldj}}
  23. </div>
  24. <div :class="`percent ${item.className2}`">
  25. {{item.per}}
  26. </div>
  27. </div>
  28. <div class="item_bottom center">
  29. <div class="item_bottom_left">
  30. {{item.dlldcd}}
  31. </div>
  32. <div class="item_bottom_right">
  33. 公里
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script setup>
  43. import {
  44. ref,
  45. onMounted,
  46. nextTick
  47. } from 'vue'
  48. import {
  49. setEchartsPie,getParametricEquation,getPie3D,option,optionArr
  50. } from '../echarts/option.js'
  51. import {
  52. getSelectDldjCount
  53. } from '../service/http.js'
  54. import CommonTitle from "@/views/c-cpns/CommonTitle.vue";
  55. let arr = ref([])
  56. let num = ref(0)
  57. onMounted(() => {
  58. getSelectDldjCount().then(res => {
  59. let total = 0
  60. arr.value = res.data.data.Rows.reverse()
  61. arr.value.forEach(item=>{
  62. total += Number(item.dlldcd)
  63. })
  64. num.value = total.toFixed()
  65. arr.value.forEach(item=>{
  66. item["per"] = ((Number(item.dlldcd)/num.value)*100).toFixed(2) + '%'
  67. if(item.dldj == "快速路"){
  68. item["className1"] = "bg1"
  69. item["className2"] = "color1"
  70. }else if(item.dldj == "主干路"){
  71. item["className1"] = "bg2"
  72. item["className2"] = "color2"
  73. }else if(item.dldj == "次干路"){
  74. item["className1"] = "bg3"
  75. item["className2"] = "color3"
  76. }else{
  77. item["className1"] = "bg4"
  78. item["className2"] = "color4"
  79. }
  80. })
  81. setEchartsPie(document.getElementById("chartOne"))
  82. })
  83. })
  84. </script>
  85. <style lang="scss" scoped>
  86. .center {
  87. display: flex;
  88. justify-content: flex-start;
  89. align-items: center;
  90. }
  91. .center_center{
  92. display: flex;
  93. justify-content: center;
  94. align-items: center;
  95. }
  96. .right_item{
  97. height: 19%;
  98. padding-top: 20px;
  99. box-sizing: border-box;
  100. }
  101. .left_four {
  102. height: 20%;
  103. padding-top: 20px;
  104. box-sizing: border-box;
  105. .content {
  106. height: 80%;
  107. margin: 0;
  108. display: flex;
  109. align-items: center;
  110. #chartOne {
  111. width: 45%;
  112. height: 70%;
  113. background: url("@/assets/imgs/饼图底盘.png") no-repeat;
  114. }
  115. .right{
  116. width: 55%;
  117. height: 100%;
  118. .top{
  119. height: 20%;
  120. .top_left{
  121. font-family: Source Han Sans CN;
  122. font-weight: bold;
  123. font-size: 14px;
  124. color: #FFFFFF;
  125. text-shadow: 0px 4px 2px rgba(0,15,17,0.73);
  126. background: linear-gradient(0deg, #5FB3DD 0%, #FFFFFF 89.7705078125%);
  127. -webkit-background-clip: text;
  128. -webkit-text-fill-color: transparent;
  129. margin-right: 14px;
  130. }
  131. .top_right{
  132. font-family: YouSheBiaoTiHei;
  133. font-weight: bold;
  134. font-size: 18px;
  135. color: #3DA6FE;
  136. text-shadow: 0px 4px 2px rgba(0,15,17,0.73);
  137. background: linear-gradient(0deg, #5FB3DD 0%, #FFFFFF 89.7705078125%);
  138. -webkit-background-clip: text;
  139. -webkit-text-fill-color: transparent;
  140. }
  141. }
  142. .bottom{
  143. height: 80%;
  144. width: 100%;
  145. display: flex;
  146. flex-wrap: wrap;
  147. .bottom_item{
  148. width: 50%;
  149. height: 40%;
  150. margin-bottom: 10px;
  151. .item_top{
  152. height: 50%;
  153. .bg1{
  154. background: #10DCDC;
  155. }
  156. .color1{
  157. color: #50C5C5;
  158. }
  159. .bg2{
  160. background: #67CBFF;
  161. }
  162. .color2{
  163. color: #67CBFF;
  164. }
  165. .bg3{
  166. background: #71EAB4;
  167. }
  168. .color3{
  169. color: #71EAB4;
  170. }
  171. .bg4{
  172. background: #F1B062;
  173. }
  174. .color4{
  175. color: #F1B062;
  176. }
  177. .dot{
  178. width: 4px;
  179. height: 4px;
  180. border-radius: 50%;
  181. margin-right: 9px;
  182. }
  183. .name{
  184. font-family: Microsoft YaHei;
  185. font-weight: 400;
  186. font-size: 13px;
  187. color: #FFFFFF;
  188. margin-right: 5px;
  189. }
  190. .percent{
  191. font-family: YouSheBiaoTiHei;
  192. font-weight: 400;
  193. font-size: 14px;
  194. //background: linear-gradient(0deg, rgba(3,0,0,0.29) 0%, rgba(255,255,255,0.29) 100%);
  195. /* -webkit-background-clip: text;
  196. -webkit-text-fill-color: transparent; */
  197. }
  198. }
  199. .item_bottom{
  200. height: 50%;
  201. margin-left: 13px;
  202. .item_bottom_left{
  203. font-family: YouSheBiaoTiHei;
  204. font-weight: bold;
  205. font-size: 14px;
  206. color: #FFFFFF;
  207. margin-right: 5px;
  208. }
  209. .item_bottom_right{
  210. font-family: Microsoft YaHei;
  211. font-weight: 400;
  212. font-size: 12px;
  213. color: #FFFFFF;
  214. opacity: 0.6;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. </style>