index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. <template>
  2. <div class="body">
  3. <div class="header">
  4. <h1 class="header_title">松花湖景区通</h1>
  5. <span class="time">2024年4月23日 星期二 上午 9:51:54</span>
  6. </div>
  7. <div class="container">
  8. <div class="left">
  9. <div class="Visitorsflowrate">
  10. <div class="all_title">
  11. <h3 class="PartTitle">景区人流量排行榜TOP5</h3>
  12. <div class="selectDate" data-objname="ticketType">
  13. <span class="_selectData">2020年04月</span>
  14. <a class="icon_more" @click="moreMeunSmalLeft_1 = !moreMeunSmalLeft_1;"> &gt; </a>
  15. <div class="_moreMenu" v-if="moreMeunSmalLeft_1">
  16. <ul>
  17. <li class="change" data-date="2020-04">2020年04月</li>
  18. <li data-date="2020-03">2020年03月</li>
  19. <li data-date="2020-02">2020年02月</li>
  20. <li data-date="2020-01">2020年01月</li>
  21. <li data-date="2019-12">2019年12月</li>
  22. </ul>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="ticketType">
  27. <div class="ticketLeft">
  28. <h4 class="tableTitle">景区排名</h4>
  29. <ul>
  30. <li>
  31. <em>1</em>
  32. <span>成人票</span>
  33. </li>
  34. <li>
  35. <em>2</em>
  36. <span>儿童票</span>
  37. </li>
  38. <li>
  39. <em>3</em>
  40. <span>大门票+船票</span>
  41. </li>
  42. <li>
  43. <em>4</em>
  44. <span>免费票</span>
  45. </li>
  46. <li>
  47. <em>5</em>
  48. <span>亲子套票</span>
  49. </li>
  50. </ul>
  51. </div>
  52. <div class="ticketRight">
  53. <h4 class="tableTitle">景区排名</h4>
  54. <div class="chart bor">
  55. <div id="chartRankOneMb" style="width: 190px;height:190px;"></div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="TouristData">
  61. <div class="all_title">
  62. <h3 class="PartTitle">景区近一个月游客排行榜TOP5</h3>
  63. <div class="selectDate" data-objname="ticketType">
  64. <span class="_selectData">2020年04月</span>
  65. <a class="icon_more" @click="moreMeunSmalLeft_2 = !moreMeunSmalLeft_2;"> &gt; </a>
  66. <div class="_moreMenu" v-if="moreMeunSmalLeft_2">
  67. <ul>
  68. <li class="change" data-date="2020-04">2020年04月</li>
  69. <li data-date="2020-03">2020年03月</li>
  70. <li data-date="2020-02">2020年02月</li>
  71. <li data-date="2020-01">2020年01月</li>
  72. <li data-date="2019-12">2019年12月</li>
  73. </ul>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="Tourischart bor">
  78. <div id="chartRankOneMonth" style="width: 500px;height:300px;"></div>
  79. </div>
  80. </div>
  81. <div class="SalesTrend">
  82. <div class="all_title">
  83. <h3 class="PartTitle">景区近一年销售趋势排行榜TOP5</h3>
  84. <div class="selectDate" data-objname="ticketType">
  85. <span class="_selectData">2020年04月</span>
  86. <a class="icon_more" @click="moreMeunSmalLeft_3 = !moreMeunSmalLeft_3;"> &gt; </a>
  87. <div class="_moreMenu" v-if="moreMeunSmalLeft_3">
  88. <ul>
  89. <li class="change" data-date="2020-04">2020年04月</li>
  90. <li data-date="2020-03">2020年03月</li>
  91. <li data-date="2020-02">2020年02月</li>
  92. <li data-date="2020-01">2020年01月</li>
  93. <li data-date="2019-12">2019年12月</li>
  94. </ul>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="Saleschart bor">
  99. <div id="chartRankOneSale" style="width: 500px;height:220px;"></div>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="center">
  104. <div class="regionData">
  105. <!--通知公告选项卡开始-->
  106. <div class="region_tab2">
  107. <div class="div_tab2">
  108. <a @click="tabClick(1)">游船视图</a>
  109. <a @click="tabClick(2)">游客视图</a>
  110. </div>
  111. <div class="regionIn_tab2 one" v-if="regionInShowOne">
  112. <div class="borp">
  113. <!--游船视图页面-->
  114. <baidu-map style="margin-top: 50px" :mapStyle="{style : 'midnight'}" class="region_tab2"
  115. :center="{lng: 126.91531, lat: 43.610448}" :zoom="11" :scroll-wheel-zoom="true">
  116. <bm-polyline v-for="item in dataSource" :path="item.polylinePath" :stroke-color="item.color"
  117. :stroke-opacity="0.5" :stroke-weight="10"
  118. :editing="false" @click="clickMap(item.shipName)">
  119. </bm-polyline>
  120. <bm-marker v-for="item in dataSource" :position="item.polylinePath.length - 1" :dragging="false">
  121. <bm-label :content="item.shipName" :labelStyle="{color: 'red', fontSize : '10px'}"
  122. :offset="{width: -35, height: 30}"/>
  123. </bm-marker>
  124. </baidu-map>
  125. </div>
  126. </div>
  127. <div class="regionIn_tab2 two" v-if="regionInShowTwo">
  128. <div class="wholeCountry">
  129. <h4>当日平台总成交额 </h4>
  130. <div class="money">
  131. <span>{{ getFirstDigit(0) }}</span>
  132. <span>{{ getFirstDigit(1) }}</span>
  133. <span>{{ getFirstDigit(2) }}</span>
  134. <span>{{ getFirstDigit(3) }}</span>
  135. <span>{{ getFirstDigit(4) }}</span>
  136. <span>{{ getFirstDigit(5) }}</span>
  137. <span>{{ getFirstDigit(6) }}</span>
  138. <span>{{ getFirstDigit(7) }}</span>
  139. </div>
  140. <div class="_count">当日累计总游客数
  141. <ins>{{ peopleNum }}</ins>
  142. </div>
  143. </div>
  144. <div class="map bor">
  145. <div id="mapByPerson" style="width: 740px;height: 426px"></div>
  146. </div>
  147. </div>
  148. </div>
  149. <!--通知公告结束-->
  150. </div>
  151. <div class="moddlebot">
  152. <div class="ProvinceData">
  153. <h3 class="PartTitle">客源地省份排名</h3>
  154. <div class="Saleschart bor">
  155. <div id="chartRankOneCity" style="width: 200px;height:200px;"></div>
  156. </div>
  157. </div>
  158. <div class="AgeData">
  159. <h3 class="PartTitle">游客年龄比例</h3>
  160. <div class="Saleschart bor">
  161. <div id="chartRankOneAge" style="width: 200px;height:200px;padding: 0"></div>
  162. </div>
  163. </div>
  164. <div class="GenderData">
  165. <h3 class="PartTitle">游客男女比例</h3>
  166. <div class="GenderChart">
  167. <div class="genderBili">
  168. <div class="man">
  169. <i class="icon_man"></i>
  170. <strong> 男士60%</strong>
  171. </div>
  172. <div class="woman">
  173. <i class="icon_woman"></i>
  174. <strong> 女士40%</strong>
  175. </div>
  176. <div class="_line">
  177. <div class="_line_man" style="width:60%;"></div>
  178. <div class="_line_woman" style="width:40%;"></div>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. <div class="right">
  186. <div class="OTA_ranking">
  187. <ul>
  188. <li>
  189. <img src="@/assets/images/piao.png"/>
  190. <em>今日售票数</em>
  191. <h2>5684</h2>
  192. <i>张</i>
  193. </li>
  194. <li>
  195. <img src="@/assets/images/piao.png"/>
  196. <em>今日退票数</em>
  197. <h2>5684</h2>
  198. <i>张</i>
  199. </li>
  200. <li>
  201. <img src="@/assets/images/people.png"/>
  202. <em>今日入园数</em>
  203. <h2>5684</h2>
  204. <i>张</i>
  205. </li>
  206. <li>
  207. <img src="@/assets/images/people.png"/>
  208. <em>在园人数</em>
  209. <h2>5684</h2>
  210. <i>张</i>
  211. </li>
  212. </ul>
  213. </div>
  214. <div class="Forecast">
  215. <h3 class="PartTitle">停车场概况统计</h3>
  216. <div class="ForecastData">
  217. <div class="Forecastchart bor">
  218. <div id="chartRankOnePark" style="width: 250px;height:250px"></div>
  219. </div>
  220. <ul class="stopList">
  221. <li>
  222. <span>总车位数</span>
  223. <span>1600</span>
  224. </li>
  225. <li>
  226. <span>当日停车费营收</span>
  227. <span>600</span>
  228. </li>
  229. <li>
  230. <span>当月停车费营收</span>
  231. <span>1600</span>
  232. </li>
  233. </ul>
  234. </div>
  235. </div>
  236. <div class="paymentCount">
  237. <h3 class="PartTitle">近一个月平台购票渠道和支付方式统计</h3>
  238. <div class="Saleschart bor">
  239. <div id="chartRankOnePay1" style="width: 250px;height:210px;display: inline-block"></div>
  240. <div id="chartRankOnePay2" style="width: 250px;height:210px;display: inline-block"></div>
  241. </div>
  242. </div>
  243. </div>
  244. </div>
  245. </div>
  246. </template>
  247. <script>
  248. import * as echarts from 'echarts'
  249. import {getMap, getMapPromise} from "@/api/ship/diqiu";
  250. import {getShipRoute} from "@/api/ship/shipMapping";
  251. export default {
  252. name: "songhuaIndex",
  253. data() {
  254. return {
  255. moreMeunSmalLeft_1: false,
  256. moreMeunSmalLeft_2: false,
  257. moreMeunSmalLeft_3: false,
  258. regionInShowOne: false,
  259. regionInShowTwo: true,
  260. money: 15389740,
  261. peopleNum: 234856,
  262. dataSource: [
  263. {
  264. shipName: "泰坦尼克号",
  265. color: "ivory",
  266. polylinePath: [
  267. {lng: 126.91531, lat: 43.610448},
  268. {lng: 128.91531, lat: 45.610448},
  269. {lng: 130.91531, lat: 46.610448}
  270. ],
  271. },
  272. {
  273. shipName: "威尼斯",
  274. color: "#003399",
  275. polylinePath: [
  276. {lng: 146.91531, lat: 53.610448},
  277. {lng: 138.91531, lat: 25.610448},
  278. {lng: 140.91531, lat: 16.610448}
  279. ],
  280. }
  281. ],
  282. }
  283. },
  284. mounted() {
  285. //近一个月排行
  286. this.chartRankOneMonthGet();
  287. //近一年销售
  288. this.chartRankOneSaleGet();
  289. //客源地省份
  290. this.chartRankOneCityGet();
  291. //游客年龄
  292. this.chartRankOneAgeGet();
  293. //支付方式与购买渠道
  294. this.chartRankOnePayGet();
  295. //停车场
  296. this.chartRankOneParkGet();
  297. //人流量排行
  298. this.chartRankOneMbsGet();
  299. //地图
  300. this.getMapByPerson();
  301. let _this = this;
  302. setInterval(function () {
  303. _this.money += Math.round(Math.random() * 100);
  304. _this.peopleNum += Math.round(Math.random() * 100);
  305. }, 3000)
  306. },
  307. created() {
  308. this.selectShipRoute()
  309. },
  310. methods: {
  311. clickMap(e) {
  312. alert(e)
  313. },
  314. selectShipRoute() {
  315. // getShipRoute().then(res => {
  316. // if (res.code == 200) {
  317. // this.dataSource = res.data
  318. // console.log("this.dataSource", this.dataSource)
  319. // } else {
  320. // this.$modal.msgError("查询失败");
  321. // }
  322. // })
  323. },
  324. //https://echarts.apache.org/examples/zh/editor.html?c=line-stack
  325. chartRankOneMonthGet() {
  326. let option = {
  327. legend: {
  328. textStyle: {
  329. color: 'white' // Set legend text color to white
  330. },
  331. right: '0' // Align legend to the right
  332. },
  333. tooltip: {},
  334. dataset: {
  335. source: [
  336. ['product', '本月', '上月'],
  337. ['动物园', 100, 150],
  338. ['五龙潭', 55, 85],
  339. ['三清观', 65, 88],
  340. ['植物园', 88, 15]
  341. ]
  342. },
  343. xAxis: {type: 'category'},
  344. yAxis: {},
  345. // Declare several bar series, each will be mapped
  346. // to a column of dataset.source by default.
  347. series: [{type: 'bar'}, {type: 'bar'}]
  348. };
  349. let myChart = this.$echarts.init(document.getElementById("chartRankOneMonth"));
  350. myChart.setOption(option);
  351. },
  352. chartRankOneAgeGet() {
  353. let option = {
  354. tooltip: {},
  355. series: [
  356. {
  357. name: '人员比例',
  358. type: 'pie',
  359. radius: ['40%', '70%'],
  360. avoidLabelOverlap: true,
  361. label: {
  362. show: false,
  363. position: 'center'
  364. },
  365. emphasis: {
  366. label: {
  367. show: true,
  368. fontSize: 14,
  369. fontWeight: 'bold'
  370. }
  371. },
  372. labelLine: {
  373. show: false
  374. },
  375. data: [
  376. {name: '60岁以上', value: 20},
  377. {name: '40-60岁之间', value: 30},
  378. {name: '18岁之内', value: 30},
  379. {name: '18-40岁之间', value: 20}
  380. ]
  381. }
  382. ]
  383. };
  384. let myChart = this.$echarts.init(document.getElementById("chartRankOneAge"));
  385. myChart.setOption(option);
  386. },
  387. //https://echarts.apache.org/examples/zh/editor.html?c=gauge-multi-title
  388. chartRankOneParkGet() {
  389. const gaugeData = [
  390. {
  391. value: 85,
  392. name: '已占用车位数',
  393. title: {
  394. offsetCenter: ['0%', '70%']
  395. },
  396. detail: {
  397. offsetCenter: ['0%', '105%']
  398. }
  399. }
  400. ];
  401. let option = {
  402. series: [
  403. {
  404. type: 'gauge',
  405. anchor: {
  406. show: true,
  407. showAbove: true,
  408. size: 18,
  409. itemStyle: {
  410. color: '#FAC858'
  411. }
  412. },
  413. axisLine: {
  414. lineStyle: {
  415. width: 6,
  416. color: [
  417. [0.3, '#e3ce67'],
  418. [0.7, '#2a86b6'],
  419. [1, '#42c51d']
  420. ]
  421. }
  422. },
  423. pointer: {
  424. icon: 'path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z',
  425. width: 8,
  426. length: '80%',
  427. offsetCenter: [0, '8%']
  428. },
  429. progress: {
  430. show: true,
  431. overlap: true,
  432. roundCap: true
  433. },
  434. data: gaugeData,
  435. title: {
  436. fontSize: 14
  437. },
  438. detail: {
  439. width: 40,
  440. height: 14,
  441. fontSize: 14,
  442. color: '#fff',
  443. backgroundColor: 'inherit',
  444. borderRadius: 3,
  445. formatter: '{value}%'
  446. }
  447. }
  448. ]
  449. };
  450. setInterval(function () {
  451. gaugeData[0].value = +(Math.random() * 100).toFixed(2);
  452. myChart.setOption({
  453. series: [
  454. {
  455. data: gaugeData
  456. }
  457. ]
  458. });
  459. }, 2000);
  460. let myChart = this.$echarts.init(document.getElementById("chartRankOnePark"));
  461. myChart.setOption(option);
  462. },
  463. chartRankOneSaleGet() {
  464. let option = {
  465. tooltip: {
  466. trigger: 'axis'
  467. },
  468. grid: {
  469. left: '3%',
  470. right: '4%',
  471. bottom: '3%',
  472. containLabel: true
  473. },
  474. xAxis: {
  475. type: 'category',
  476. boundaryGap: false,
  477. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月']
  478. },
  479. yAxis: {
  480. type: 'value'
  481. },
  482. series: [
  483. {
  484. name: '景区1',
  485. type: 'line',
  486. stack: 'Total',
  487. data: [120, 132, 101, 134, 90, 230, 210]
  488. },
  489. {
  490. name: '景区2',
  491. type: 'line',
  492. stack: 'Total',
  493. data: [220, 182, 191, 234, 290, 330, 310]
  494. },
  495. {
  496. name: '景区3',
  497. type: 'line',
  498. stack: 'Total',
  499. data: [150, 232, 201, 154, 190, 330, 410]
  500. },
  501. {
  502. name: '景区4',
  503. type: 'line',
  504. stack: 'Total',
  505. data: [320, 332, 301, 334, 390, 330, 320]
  506. },
  507. {
  508. name: '景区5',
  509. type: 'line',
  510. stack: 'Total',
  511. data: [820, 932, 901, 934, 1290, 1330, 1320]
  512. }
  513. ]
  514. };
  515. let myChart = this.$echarts.init(document.getElementById("chartRankOneSale"));
  516. myChart.setOption(option);
  517. },
  518. //https://echarts.apache.org/examples/zh/editor.html?c=bar-y-category
  519. chartRankOneCityGet() {
  520. let option = {
  521. color: ['#1890FF'],
  522. tooltip: {},
  523. textStyle: {
  524. show: false,
  525. fontSize: 14,
  526. fontStyle: 'normal',
  527. fontWeight: 'bold'
  528. },
  529. grid: {
  530. top: '5%',
  531. left: '2%',
  532. right: '4%',
  533. bottom: '2%',
  534. containLabel: true,
  535. borderWidth: 0
  536. },
  537. xAxis: {
  538. type: 'value',
  539. // max:50,
  540. axisLine: {
  541. show: false,
  542. lineStyle: {
  543. color: '#fefef',
  544. },
  545. },
  546. axisLabel: {
  547. show: false,
  548. interval: 0,
  549. formatter: '{value} %' // 给每个数值添加%
  550. }
  551. },
  552. yAxis: {
  553. axisLine: {
  554. show: false,
  555. lineStyle: {
  556. color: 'white',
  557. },
  558. },
  559. type: 'category',
  560. data: [
  561. '北京',
  562. '澳门',
  563. '香港',
  564. '长春',
  565. '新建'
  566. ]
  567. },
  568. series: [
  569. {
  570. itemStyle: {
  571. normal: {
  572. color: function (params) {
  573. // build a color map as your need.
  574. var colorList = [
  575. '#27727B',
  576. '#27727B',
  577. '#FCCE10',
  578. '#E87C25',
  579. '#C1232B'
  580. ];
  581. return colorList[params.dataIndex];
  582. },
  583. label: {
  584. show: false,
  585. position: 'right',
  586. formatter: '{c}%' //这是关键,在需要的地方加上就行了
  587. },
  588. //设置柱子圆角
  589. barBorderRadius: [0, 20, 20, 0]
  590. },
  591. backgroundStyle: {
  592. color: '#EBEEF5'
  593. }
  594. },
  595. data: [444, 555, 666, 777, 888],
  596. type: 'bar',
  597. barWidth: 10 //柱图宽度
  598. }
  599. ]
  600. };
  601. let myChart = this.$echarts.init(document.getElementById("chartRankOneCity"));
  602. myChart.setOption(option);
  603. },
  604. //https://ppchart.com/#/今日各考场承载总考生数
  605. chartRankOnePayGet() {
  606. var scale = 1;
  607. var echartData = [
  608. {
  609. value: 2154,
  610. name: "微信",
  611. },
  612. {
  613. value: 3854,
  614. name: "现金",
  615. },
  616. {
  617. value: 3515,
  618. name: "支付宝",
  619. },
  620. {
  621. value: 3515,
  622. name: "银联",
  623. }
  624. ];
  625. var rich = {
  626. yellow: {
  627. color: "#ffc72b",
  628. fontSize: 12 * scale,
  629. padding: [5, 4],
  630. align: "center",
  631. },
  632. total: {
  633. color: "#ffc72b",
  634. fontSize: 12 * scale,
  635. align: "center",
  636. },
  637. white: {
  638. color: "#fff",
  639. align: "center",
  640. fontSize: 12 * scale,
  641. padding: [21, 0],
  642. },
  643. blue: {
  644. color: "#49dff0",
  645. fontSize: 12 * scale,
  646. align: "center",
  647. },
  648. hr: {
  649. borderColor: "#0b5263",
  650. width: "100%",
  651. borderWidth: 1,
  652. height: 0,
  653. },
  654. };
  655. let option = {
  656. backgroundColor: "#031f2d",
  657. tooltip: {},
  658. graphic: {
  659. type: 'text',
  660. left: 'center',
  661. top: 'center',
  662. style: {
  663. text: '支付方式',
  664. textAlign: 'center',
  665. fill: 'white',
  666. width: 30,
  667. height: 30,
  668. fontSize: 14
  669. }
  670. },
  671. series: [
  672. {
  673. name: "支付方式",
  674. type: "pie",
  675. radius: ["32%", "40%"],
  676. hoverAnimation: false,
  677. color: ["#c487ee", "#deb140", "#49dff0", "#034079", "#6f81da", "#00ffb4"],
  678. label: {
  679. normal: {
  680. formatter: function (params, ticket, callback) {
  681. var total = 0;
  682. var percent = 0;
  683. echartData.forEach(function (value, index, array) {
  684. total += value.value;
  685. });
  686. percent = ((params.value / total) * 100).toFixed(1);
  687. return (
  688. "{white|" +
  689. params.name +
  690. "}\n{hr|}\n{yellow|" +
  691. params.value +
  692. "}\n{blue|" +
  693. percent +
  694. "%}"
  695. );
  696. },
  697. rich: rich,
  698. },
  699. },
  700. labelLine: {
  701. normal: {
  702. length: 20 * scale,
  703. length2: 0,
  704. lineStyle: {
  705. color: "#0b5263",
  706. },
  707. },
  708. },
  709. data: echartData,
  710. },
  711. ],
  712. };
  713. let myChart1 = this.$echarts.init(document.getElementById("chartRankOnePay1"));
  714. let myChart2 = this.$echarts.init(document.getElementById("chartRankOnePay2"));
  715. myChart1.setOption(option);
  716. myChart2.setOption(option);
  717. },
  718. //https://blog.csdn.net/qq_43519782/article/details/118707267?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522171393938516800186569476%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=171393938516800186569476&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-9-118707267-null-null.142^v100^pc_search_result_base4&utm_term=%E6%A8%AA%E5%90%91%E6%9F%B1%E5%9B%BE%E9%87%8D%E5%90%88&spm=1018.2226.3001.4187
  719. chartRankOneMbsGet() {
  720. let option = {
  721. grid: {
  722. left: "2%",
  723. right: "2%",
  724. bottom: "2%",
  725. top: "2%",
  726. containLabel: true,
  727. },
  728. tooltip: {
  729. trigger: "axis",
  730. axisPointer: {
  731. type: "shadow",
  732. },
  733. confine: true,
  734. textStyle: {
  735. fontSize: 13,
  736. color: "rgba(255, 255, 255, 0.8)",
  737. },
  738. formatter: function (params) {
  739. return (
  740. params[0].name +
  741. "<br/>" +
  742. "<span style='display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background:linear-gradient(90deg, #388CFF 0% ,#6CFEFF 100%)'></span>" +
  743. params[0].seriesName +
  744. " : " +
  745. params[0].value
  746. .toLocaleString()
  747. .toString()
  748. .replace(/(\d)(?=(?:\d{3}[+]?)+$)/g, "$1,") +
  749. " 辆/天"
  750. );
  751. },
  752. },
  753. xAxis: {
  754. show: false,
  755. type: "value",
  756. },
  757. yAxis: [
  758. {
  759. type: "category",
  760. inverse: true,
  761. axisLabel: {
  762. show: true,
  763. textStyle: {
  764. fontSize: 20,
  765. color: "rgba(255, 255, 255, 0.8)",
  766. },
  767. formatter: function (name) {
  768. return name + ": ";
  769. },
  770. },
  771. splitLine: {
  772. show: false,
  773. },
  774. axisTick: {
  775. show: false,
  776. },
  777. axisLine: {
  778. show: false,
  779. },
  780. data: [
  781. "香榭丽",
  782. "拉斯维",
  783. "格林",
  784. "密歇根",
  785. "格拉西",
  786. ],
  787. },
  788. {
  789. type: "category",
  790. inverse: true,
  791. axisTick: "none",
  792. axisLine: "none",
  793. show: true,
  794. axisLabel: {
  795. textStyle: {
  796. fontSize: 13,
  797. color: "rgba(255, 255, 255, 0.8)",
  798. padding: [0, 0, 0, 10],
  799. },
  800. formatter: function (value) {
  801. return value
  802. .toLocaleString()
  803. .toString()
  804. .replace(/(\d)(?=(?:\d{3}[+]?)+$)/g, "$1,");
  805. },
  806. },
  807. data: [50000, 22000, 10000, 5000, 2000],
  808. },
  809. ],
  810. series: [
  811. {
  812. name: "车辆",
  813. type: "bar",
  814. zlevel: 1, //通过 zlevel 设置层级
  815. barWidth: 10,
  816. itemStyle: {
  817. normal: {
  818. barBorderRadius: 10,
  819. // 渐变色
  820. // color: "rgba(108, 254, 255, 0.3)",
  821. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  822. {
  823. offset: 0,
  824. color: "#388CFF",
  825. },
  826. {
  827. offset: 1,
  828. color: "#6CFEFF",
  829. },
  830. ]),
  831. },
  832. },
  833. data: [50000, 22000, 10000, 5000, 2000],
  834. },
  835. {
  836. name: "背景",
  837. type: "bar",
  838. barWidth: 10,
  839. barGap: "-100%", //两条柱状图重合
  840. data: [50000, 50000, 50000, 50000, 50000],
  841. itemStyle: {
  842. normal: {
  843. color: "rgba(108, 254, 255, 0.3)",
  844. barBorderRadius: 10,
  845. },
  846. },
  847. },
  848. ],
  849. };
  850. let myChart = this.$echarts.init(document.getElementById("chartRankOneMb"));
  851. myChart.setOption(option);
  852. },
  853. getMapByPerson() {
  854. getMapPromise()
  855. .then((result) => {
  856. let myChart = this.$echarts.init(document.getElementById("mapByPerson"));
  857. myChart.setOption(result);
  858. })
  859. .catch((error) => {
  860. console.error(error);
  861. });
  862. },
  863. tabClick(state) {
  864. if (state == 1) {
  865. this.regionInShowOne = true;
  866. this.regionInShowTwo = false;
  867. } else {
  868. this.regionInShowOne = false;
  869. this.regionInShowTwo = true;
  870. this.getMapByPerson()
  871. }
  872. },
  873. getFirstDigit(num) {
  874. return Number(String(this.money).charAt(num));
  875. }
  876. },
  877. }
  878. </script>
  879. <style lang="scss" scoped>
  880. @import "@/assets/styles/shh_body.scss";
  881. @import "@/assets/styles/shh_index.scss";
  882. </style>