business_overview.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <div class="body-wrapper">
  3. <div style="width: 100%;display: flex;justify-content: space-between;">
  4. <div style="width: 33%;height: 400px;">
  5. <h4 style="color: white">车场数量</h4>
  6. <piechart
  7. class="model-pie-body"
  8. id="chart1"
  9. :radiusArr="['30%', '70%']"
  10. :roseType = "false"
  11. :colorArr="modelPieColor"
  12. :labelFormat="['{name|{b}}', '{sub|{@value} {d}%}', '{hr|}']"
  13. :dataset="modelData"
  14. :encode="{ itemName: 'name', value: 'value' }"
  15. />
  16. </div>
  17. <div style="width: 33%;height: 400px;">
  18. <h4 style="color: white">设备情况</h4>
  19. <barchart
  20. class="side-chart"
  21. :autoStop="false"
  22. :colorArr="['#ffd201', '#00eacb', '#01b4ff', '#5d78ff']"
  23. legendIcon="react"
  24. :bottom="30"
  25. :xlabelFormat="xLabelFormat"
  26. :top="60"
  27. yAxisName="(个)"
  28. :tooltip="tooltipFormat"
  29. :dataset="modelData2"
  30. :encode="[
  31. {x: 'month', y: 'hs', seriesName: '在线'},
  32. {x: 'month', y: 'cs', seriesName: '离线'}]"
  33. :labelSize="15"
  34. id="fxdqhszzt"
  35. />
  36. </div>
  37. <div style="width: 33%;height: 400px;">
  38. <h4 style="color: white">事件数据</h4>
  39. <el-table :data="tableData" style="background: #2a2a2a;border-color: #333;">
  40. <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
  41. </el-table-column>
  42. </el-table>
  43. <div class="table-pagination">
  44. <el-pagination :background="false" layout="total, prev, pager, next" :total="total" @current-change="handlePageChange"
  45. :current-page.sync="pageNum" :page-size.sync="pageSize">
  46. </el-pagination>
  47. </div>
  48. </div>
  49. <br>
  50. </div>
  51. <br>
  52. <br>
  53. <div style="width: 100%;display: flex;justify-content: space-between;">
  54. <div style="width: 33%;height: 400px;">
  55. <div align="center" style="color: white">停车趋势</div>
  56. <linechart
  57. :autoStop="false"
  58. :top="30"
  59. :bottom="30"
  60. :left="40"
  61. :legendTop="0"
  62. yAxisName="(%)"
  63. :dataset="linedata"
  64. :tooltipFormat="lineTooltipFormat1"
  65. :encode="[
  66. { x: 'month', y: 'lastAmount', seriesName: '停车总时长(时)',bool:'true' },
  67. ]"
  68. id="sxcyfzqk1"
  69. />
  70. </div>
  71. <div style="width: 33%;height: 400px;">
  72. <div align="center" style="color: white">泊位周转趋势</div>
  73. <linechart
  74. :autoStop="false"
  75. :top="30"
  76. :bottom="30"
  77. :left="40"
  78. :legendTop="0"
  79. yAxisName="(%)"
  80. :dataset="linedata2"
  81. :tooltipFormat="lineTooltipFormat1"
  82. :encode="[
  83. { x: 'month', y: 'lastAmount', seriesName: '当日平均周转次数',bool:'true' },
  84. ]"
  85. id="bwzzqs"
  86. />
  87. </div>
  88. <div style="width: 33%;height: 400px;">
  89. <div align="center" style="color: white">泊位利用率趋势</div>
  90. <linechart
  91. :autoStop="false"
  92. :top="30"
  93. :bottom="30"
  94. :left="40"
  95. :legendTop="0"
  96. yAxisName="(%)"
  97. :dataset="linedata3"
  98. :tooltipFormat="lineTooltipFormat1"
  99. :encode="[
  100. { x: 'month', y: 'lastAmount', seriesName: '当日平均利用率(%)',bool:'true' },
  101. ]"
  102. id="bwlylqs"
  103. />
  104. </div>
  105. </div>
  106. <br>
  107. <br>
  108. <div style="width: 100%;display: flex;justify-content: space-between;">
  109. <div style="width: 33%;height: 400px;">
  110. <div align="center" style="color: white">实缴趋势</div>
  111. <linechart
  112. :autoStop="false"
  113. :top="30"
  114. :bottom="30"
  115. :left="40"
  116. :legendTop="0"
  117. yAxisName="(%)"
  118. :dataset="linedata4"
  119. :tooltipFormat="lineTooltipFormat1"
  120. :encode="[
  121. { x: 'month', y: 'lastAmount', seriesName: '实缴率(%)',bool:'true' },
  122. ]"
  123. id="sjqs"
  124. />
  125. </div>
  126. <div style="width: 33%;height: 400px;">
  127. <div align="center" style="color: white">泊位实时占用率</div>
  128. <linechart
  129. :autoStop="false"
  130. :top="30"
  131. :bottom="30"
  132. :left="40"
  133. :legendTop="0"
  134. yAxisName="(%)"
  135. :dataset="linedata5"
  136. :tooltipFormat="lineTooltipFormat1"
  137. :encode="[
  138. { x: 'month', y: 'lastAmount', seriesName: '实时占用率',bool:'true' },
  139. ]"
  140. id="bwsszyl"
  141. />
  142. </div>
  143. <div style="width: 33%;height: 400px;">
  144. <h4 style="color: white">动态信息监控</h4>
  145. <el-table :data="tableData2" style="background: #2a2a2a;border-color: #333;">
  146. <el-table-column v-for="(item, index) in columns2" :key="index" :label="item.label" :prop="item.key">
  147. </el-table-column>
  148. </el-table>
  149. <div class="table-pagination">
  150. <el-pagination :background="false" layout="total, prev, pager, next" :total="total2" @current-change="handlePageChange2"
  151. :current-page.sync="pageNum2" :page-size.sync="pageSize2">
  152. </el-pagination>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </template>
  158. <script>
  159. import piechart from "@/components/pieChart";
  160. import barchart from "@/components/barChart";
  161. import linechart from "@/components/lineChart";
  162. import api from "@/api/article_z";
  163. import api_l from "@/api/article_liao";
  164. export default {
  165. components: {
  166. piechart,
  167. barchart,
  168. linechart
  169. },
  170. data() {
  171. return {
  172. columns: [
  173. {
  174. label: '设备名称',
  175. key: 'deviceName'
  176. },
  177. {
  178. label: '状态',
  179. key: 'deviceState'
  180. }
  181. ],
  182. columns2: [
  183. {
  184. label: '车牌号',
  185. key: 'plateNo'
  186. },
  187. {
  188. label: '车辆类型',
  189. key: 'carTypeName'
  190. }
  191. ],
  192. modelPieColor: ["#2E8B57","#9078f8","#00FFFF","#DAA520","#20B2AA"],
  193. modelData: [],
  194. modelPieColor2: ["#2E8B57","#9078f8","#00FFFF","#DAA520","#20B2AA"],
  195. modelData2: [{
  196. "mouth": "市图书馆停车场",
  197. "hs": 6053,
  198. "cs": 1921
  199. },
  200. {
  201. "mouth": "中山公园停车场",
  202. "hs": 6033,
  203. "cs": 3766
  204. },
  205. {
  206. "mouth": "天地广场停车场",
  207. "hs": 2258,
  208. "cs": 2513
  209. }],
  210. modelPieColor3: ["#2E8B57","#9078f8","#00FFFF","#DAA520","#20B2AA"],
  211. modelData3: [],
  212. tableData: [],
  213. tableData2: [],
  214. linedata:[{
  215. "mouth": "星期一",
  216. "lastAmount": 14
  217. },
  218. {
  219. "mouth": "星期二",
  220. "lastAmount": 46
  221. },
  222. {
  223. "mouth": "星期三",
  224. "lastAmount": 59
  225. },],
  226. linedata2:[],
  227. linedata3:[],
  228. linedata4:[],
  229. linedata5:[],
  230. total: 0,
  231. pageSize: 5,
  232. pageNum: 1,
  233. total2: 0,
  234. pageSize2: 5,
  235. pageNum2: 1,
  236. radio: '2',
  237. dialogVisible: false,
  238. selRow: {},
  239. }
  240. },
  241. mounted() {
  242. this.dashBusinessOverviewStat1()
  243. this.dashBusinessOverviewStat2()
  244. this.dashBusinessOverviewStat3()
  245. this.dashBusinessOverviewStat4()
  246. this.dashBusinessOverviewStat5()
  247. this.dashBusinessOverviewStat6()
  248. this.dashBusinessOverviewStat7()
  249. this.getTableData2()
  250. const {pageNum, pageSize} = this
  251. let that = this
  252. let params4 = {current: pageNum, size: pageSize}
  253. let requestList = [api.queryEquipmentRunning_Sxt(), api.queryEquipmentRunning_Zj(),api.queryEquipmentRunning_Mwxsq(), api.sbyxjcList(params4)];
  254. Promise.all(requestList).then(res => {
  255. //that.modelData = res[0].data || []
  256. //that.modelData2 = res[1].data || []
  257. that.modelData3 = res[2].data || []
  258. this.tableData = res[3].data.records || []
  259. this.total = res[3].data.total || 0
  260. })
  261. },
  262. watch: {
  263. },
  264. methods: {
  265. dashAccessDataAnalysisStat1(){
  266. api_l.dashAccessDataAnalysisStat1().then(res =>{
  267. this.bardata = res.data
  268. })
  269. },
  270. handlePageChange() {
  271. this.getTableData()
  272. },
  273. handlePageChange2() {
  274. this.getTableData2()
  275. },
  276. getTableData() {
  277. const {pageNum, pageSize} = this
  278. api.sbyxjcList({current: pageNum, size: pageSize}).then(res => {
  279. this.tableData = res.data.records || []
  280. this.total = res.data.total
  281. })
  282. },
  283. getTableData2() {
  284. const {pageNum2, pageSize2} = this
  285. api_l.dashBusinessOverviewInfoPage({current: pageNum2, size: pageSize2}).then(res => {
  286. this.tableData2 = res.data.records || []
  287. this.total2 = res.data.total
  288. })
  289. },
  290. dashBusinessOverviewStat1(){
  291. api_l.dashBusinessOverviewStat1().then(res => {
  292. this.modelData=res.data;
  293. })
  294. },
  295. dashBusinessOverviewStat2(){
  296. api_l.dashBusinessOverviewStat2().then(res => {
  297. this.modelData2=res.data;
  298. })
  299. },
  300. dashBusinessOverviewStat3(){
  301. api_l.dashBusinessOverviewStat3().then(res => {
  302. this.linedata=res.data;
  303. })
  304. },
  305. dashBusinessOverviewStat4(){
  306. api_l.dashBusinessOverviewStat4().then(res => {
  307. this.linedata2=res.data;
  308. })
  309. },
  310. dashBusinessOverviewStat5(){
  311. api_l.dashBusinessOverviewStat5().then(res => {
  312. this.linedata3=res.data;
  313. })
  314. },
  315. dashBusinessOverviewStat6(){
  316. api_l.dashBusinessOverviewStat6().then(res => {
  317. this.linedata4=res.data;
  318. })
  319. },
  320. dashBusinessOverviewStat7(){
  321. api_l.dashBusinessOverviewStat7().then(res => {
  322. this.linedata5=res.data;
  323. })
  324. },
  325. lineTooltipFormat1(params) {
  326. const data = params[0].data;
  327. return `<div class="line-tooltip">
  328. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  329. params[0].data.lastAmount || "--"
  330. }(%)</div>`;
  331. },
  332. tooltipFormat(params) {
  333. const type = params[0].seriesType;
  334. const data = params[0].data;
  335. // ${params[0].name || "--"}月:
  336. return `<div class="line-tooltip">
  337. <div>${params[0].seriesName}: ${
  338. params[0].data.hs || "--"}个</div>
  339. <div>${params[1].seriesName}: ${
  340. params[0].data.cs || "--"}个</div>
  341. </div>`;
  342. },
  343. xLabelFormat(name) {
  344. const nameArr = []
  345. for (let i = 0; i < name.length; i += 7) {
  346. nameArr.push(name.substring(i, i + 7))
  347. }
  348. return nameArr.join('\n');
  349. },
  350. }
  351. }
  352. </script>
  353. <style lang="scss" scoped>
  354. .body-wrapper {
  355. padding: 20px;
  356. background: #0c0c0c;
  357. .button-block{
  358. text-align: right;
  359. margin-bottom: 20px;
  360. }
  361. .table-pagination{
  362. text-align: right;
  363. }
  364. .search-card{
  365. font-size: 24px;
  366. font-weight: bold;
  367. color: #3498db;
  368. margin-bottom: 20px;
  369. .input-wrapper{
  370. width: 36%;
  371. }
  372. }
  373. }
  374. .audit-dialog{
  375. .mg-bt{
  376. margin-bottom: 24px;
  377. }
  378. .label{
  379. text-align: right;
  380. }
  381. }
  382. </style>