berth_road_out.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div class="body-wrapper">
  3. <div style="display: flex; justify-content: space-between;">
  4. <div style="width: 50%; height: 300px">
  5. <div align="center" style="color: white">泊位饱和度</div>
  6. <barchart
  7. class="side-chart"
  8. :autoStop="false"
  9. :colorArr="['#ffd201', '#00eacb', '#01b4ff', '#5d78ff']"
  10. legendIcon="react"
  11. :bottom="30"
  12. :xlabelFormat="xLabelFormat"
  13. :top="60"
  14. yAxisName="(个)"
  15. :tooltip="tooltipFormat"
  16. :dataset="bardata"
  17. :encode="[
  18. {x: 'month', y: 'hs', seriesName: '占用'},
  19. {x: 'month', y: 'cs', seriesName: '空闲'}]"
  20. :labelSize="15"
  21. id="fxdqhszzt"
  22. />
  23. </div>
  24. <div style="width: 50%; height: 300px">
  25. <div align="center" style="color: white">泊位周转率</div>
  26. <linechart
  27. :autoStop="false"
  28. :top="30"
  29. :bottom="30"
  30. :left="40"
  31. :legendTop="0"
  32. yAxisName="(%)"
  33. :dataset="linedata1"
  34. :tooltipFormat="lineTooltipFormat1"
  35. :encode="[
  36. { x: 'month', y: 'lastAmount', seriesName: '泊位周转率',bool:'true' },
  37. ]"
  38. id="sxcyfzqk1"
  39. />
  40. </div>
  41. </div>
  42. <div style="display: flex; justify-content: space-between;margin-top: 5%">
  43. <div style="width: 50%; height: 300px;">
  44. <div align="center" style="color: white">特殊车辆进场占比</div>
  45. <piechart
  46. class="model-pie-body"
  47. id="chart1"
  48. :roseType="false"
  49. :radiusArr="['30%', '70%']"
  50. :colorArr="modelPieColor"
  51. :labelFormat="['{name|{b}}', '{sub|{d}%}', '{hr|}']"
  52. :dataset="modelData.list"
  53. :encode="{ itemName: 'name', value: 'value' }"
  54. />
  55. </div>
  56. <div style="width: 50%; height: 300px">
  57. <div align="center" style="color: white">泊位营收分析</div>
  58. <linechart
  59. :autoStop="false"
  60. :top="30"
  61. :bottom="30"
  62. :left="40"
  63. :legendTop="0"
  64. yAxisName="(元)"
  65. :dataset="linedata"
  66. :tooltipFormat="lineTooltipFormat"
  67. :encode="[
  68. { x: 'month', y: 'lastYearAmount', seriesName: '泊位收入',bool:'true' },
  69. { x: 'month', y: 'thisYearAmount', seriesName: '总体收入',bool:'true' },
  70. ]"
  71. id="sxcyfzqk"
  72. />
  73. </div>
  74. </div>
  75. <div style="display: flex; justify-content: space-between;margin-top: 5%">
  76. <div style="width: 50%; height: 300px;padding-left: 25px">
  77. <div align="center" style="color: white">车辆进出场趋势</div>
  78. <linechart
  79. :autoStop="false"
  80. :top="30"
  81. :bottom="30"
  82. :left="40"
  83. :legendTop="0"
  84. yAxisName="(%)"
  85. :dataset="linedata2"
  86. :tooltipFormat="lineTooltipFormat2"
  87. :encode="[
  88. { x: 'month', y: 'lastYearAmount', seriesName: '进流率',bool:'true' },
  89. { x: 'month', y: 'thisYearAmount', seriesName: '出流率',bool:'true' },
  90. ]"
  91. id="sxcyfzqk2"
  92. />
  93. </div>
  94. <div style="width: 50%; height: 300px;margin-top: 5%;">
  95. <div align="center" style="font-family: Arial, Helvetica, sans-serif">
  96. <h4 style="color: rgb(47, 178, 77);">路段泊位饱和度合理性分析</h4>
  97. <h5 style="margin-top: 5px;color: rgb(49, 97, 0);">检测到周末泊位较饱和,建议适当增加泊位</h5>
  98. <h5 style="margin-top: 5px;color: rgb(49, 97, 0);">检测到周末泊位周转率低,建议适当增加长时段停车费用</h5>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </template>
  104. <script>
  105. import piechart from "@/components/pieChart";
  106. import linechart from "@/components/lineChart";
  107. import barchart from "@/components/barChart";
  108. import vtable from "@/components/vtableNew";
  109. import api from "@/api/article_liao";
  110. export default {
  111. components: {
  112. piechart,
  113. linechart,
  114. barchart,
  115. vtable
  116. },
  117. data() {
  118. return {
  119. modelPieColor: ["#4382f6", "#9078f8", "#79a7db", "#FF9800"],
  120. modelData: {
  121. list: []
  122. },
  123. linedata: [],
  124. linedata1: [],
  125. linedata2: [],
  126. bardata: [],
  127. }
  128. },
  129. mounted() {
  130. this.dashBertRroadOutStat1()
  131. this.dashBertRroadOutStat2()
  132. this.dashBertRroadOutStat3()
  133. this.dashBertRroadOutStat4()
  134. this.dashBertRroadOutStat5()
  135. },
  136. watch: {
  137. },
  138. methods: {
  139. lineTooltipFormat1(params) {
  140. const data = params[0].data;
  141. return `<div class="line-tooltip">
  142. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  143. params[0].data.lastAmount || "--"
  144. }(%)</div>`;
  145. },
  146. lineTooltipFormat(params) {
  147. const data = params[0].data;
  148. return `<div class="line-tooltip">
  149. <div style="color: ${params[1].color}">${params[1].seriesName}: ${
  150. params[0].data.thisYearAmount || "--"
  151. }(元)</div>
  152. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  153. params[0].data.lastYearAmount || "--"
  154. }(元)</div>
  155. </div>`;
  156. },
  157. lineTooltipFormat2(params) {
  158. const data = params[0].data;
  159. return `<div class="line-tooltip">
  160. <div style="color: ${params[1].color}">${params[1].seriesName}: ${
  161. params[0].data.thisYearAmount || "--"
  162. }(%)</div>
  163. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  164. params[0].data.lastYearAmount || "--"
  165. }(%)</div>
  166. </div>`;
  167. },
  168. xLabelFormat(name) {
  169. const nameArr = []
  170. for(let i=0; i<name.length; i+=7) {
  171. nameArr.push(name.substring(i, i+7))
  172. }
  173. return nameArr.join('\n');
  174. },
  175. tooltipFormat(params) {
  176. const type = params[0].seriesType;
  177. const data = params[0].data;
  178. // ${params[0].name || "--"}月:
  179. return `<div class="line-tooltip">
  180. <div>${params[0].seriesName}: ${
  181. params[0].data.hs || "--"}个</div>
  182. <div>${params[1].seriesName}: ${
  183. params[0].data.cs || "--"}个</div>
  184. </div>`;
  185. },
  186. dashBertRroadOutStat1(){
  187. api.dashBertRroadOutStat1().then(res =>{
  188. this.bardata = res.data
  189. })
  190. },
  191. dashBertRroadOutStat2(){
  192. api.dashBertRroadOutStat2().then(res =>{
  193. this.linedata1 = res.data
  194. })
  195. },
  196. dashBertRroadOutStat3(){
  197. api.dashBertRroadOutStat3().then(res =>{
  198. this.modelData.list = res.data
  199. })
  200. },
  201. dashBertRroadOutStat4(){
  202. api.dashBertRroadOutStat4().then(res =>{
  203. this.linedata = res.data
  204. })
  205. },
  206. dashBertRroadOutStat5(){
  207. api.dashBertRroadOutStat5().then(res =>{
  208. this.linedata2 = res.data
  209. })
  210. },
  211. }
  212. }
  213. </script>
  214. <style lang="scss" scoped>
  215. .body-wrapper {
  216. width: 100%;
  217. height: 100%;
  218. box-sizing: border-box;
  219. background: #0c0c0c;
  220. }
  221. .model-pie-body {
  222. width: 100%;
  223. height: 99%;
  224. }
  225. </style>