index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949
  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">
  55. <div id="chartRankOneMb" style="width:200px;height:240px;"></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">
  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">
  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)" v-bind:class="regionInShowOne?'df_on':''">游船视图</a>
  109. <a @click="tabClick(2)" v-bind:class="regionInShowTwo?'df_on':''">游客视图</a>
  110. </div>
  111. <div class="regionIn_tab2 one" v-show="regionInShowOne">
  112. <div class="borp">
  113. <!--游船视图页面-->
  114. <div id="map" style="margin-top: 50px; width: 740px; height: 620px"></div>
  115. <!-- <baidu-map style="margin-top: 50px" :mapStyle="{style : 'midnight'}" class="region_tab2"-->
  116. <!-- :center="{lng: 126.84031, lat: 43.658648}" :zoom="12" :scroll-wheel-zoom="true"-->
  117. <!-- @ready="handler">-->
  118. <!-- </baidu-map>-->
  119. </div>
  120. </div>
  121. <div class="regionIn_tab2 two" v-show="regionInShowTwo">
  122. <div class="wholeCountry">
  123. <h4>当日平台总成交额 </h4>
  124. <div class="money">
  125. <span>{{ getFirstDigit(0) }}</span>
  126. <span>{{ getFirstDigit(1) }}</span>
  127. <span>{{ getFirstDigit(2) }}</span>
  128. <span>{{ getFirstDigit(3) }}</span>
  129. <span>{{ getFirstDigit(4) }}</span>
  130. <span>{{ getFirstDigit(5) }}</span>
  131. <span>{{ getFirstDigit(6) }}</span>
  132. <span>{{ getFirstDigit(7) }}</span>
  133. </div>
  134. <div class="_count">当日累计总游客数
  135. <ins>{{ peopleNum }}</ins>
  136. </div>
  137. </div>
  138. <div class="map">
  139. <div id="mapByPerson" style="width: 740px;height: 426px"></div>
  140. </div>
  141. </div>
  142. </div>
  143. <!--通知公告结束-->
  144. </div>
  145. <div class="moddlebot">
  146. <div class="ProvinceData">
  147. <h3 class="PartTitle">客源地省份排名</h3>
  148. <div class="Saleschart">
  149. <div id="chartRankOneCity" style="width: 250px;height:200px;"></div>
  150. </div>
  151. </div>
  152. <div class="AgeData">
  153. <h3 class="PartTitle">游客年龄比例</h3>
  154. <div class="Saleschart">
  155. <div id="chartRankOneAge" style="width: 200px;height:200px;padding: 0"></div>
  156. </div>
  157. </div>
  158. <div class="GenderData">
  159. <h3 class="PartTitle">游客男女比例</h3>
  160. <div class="GenderChart">
  161. <div class="genderBili">
  162. <div class="man">
  163. <i class="icon_man"></i>
  164. <strong> 男士60%</strong>
  165. </div>
  166. <div class="woman">
  167. <i class="icon_woman"></i>
  168. <strong> 女士40%</strong>
  169. </div>
  170. <div class="_line">
  171. <div class="_line_man" style="width:60%;"></div>
  172. <div class="_line_woman" style="width:40%;"></div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <div class="right">
  180. <div class="OTA_ranking">
  181. <ul>
  182. <li>
  183. <img src="@/assets/images/piao.png"/>
  184. <em>今日售票数</em>
  185. <h2>5684</h2>
  186. <i>张</i>
  187. </li>
  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/people.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. </ul>
  207. </div>
  208. <div class="Forecast">
  209. <h3 class="PartTitle">停车场概况统计</h3>
  210. <div class="ForecastData">
  211. <div class="Forecastchart">
  212. <div id="chartRankOnePark" style="width: 250px;height:250px"></div>
  213. </div>
  214. <ul class="stopList">
  215. <li>
  216. <span>总车位数</span>
  217. <span>1600</span>
  218. </li>
  219. <li>
  220. <span>当日停车费营收</span>
  221. <span>600</span>
  222. </li>
  223. <li>
  224. <span>当月停车费营收</span>
  225. <span>1600</span>
  226. </li>
  227. </ul>
  228. </div>
  229. </div>
  230. <div class="paymentCount">
  231. <h3 class="PartTitle">近一个月平台购票渠道和支付方式统计</h3>
  232. <div class="Saleschart">
  233. <div id="chartRankOnePay1" style="width: 250px;height:210px;display: inline-block"></div>
  234. <div id="chartRankOnePay2" style="width: 250px;height:210px;display: inline-block"></div>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. </template>
  241. <script>
  242. import * as echarts from 'echarts'
  243. import {getMap} from "@/api/ship/diqiu";
  244. import {getShipRoute} from "@/api/ship/shipMapping";
  245. export default {
  246. name: "songhuaIndex",
  247. data() {
  248. return {
  249. moreMeunSmalLeft_1: false,
  250. moreMeunSmalLeft_2: false,
  251. moreMeunSmalLeft_3: false,
  252. regionInShowOne: false,
  253. regionInShowTwo: true,
  254. money: 15389740,
  255. peopleNum: 234856,
  256. dataSource: [],
  257. map:[]
  258. }
  259. },
  260. mounted() {
  261. //近一个月排行
  262. this.chartRankOneMonthGet();
  263. //近一年销售
  264. this.chartRankOneSaleGet();
  265. //客源地省份
  266. this.chartRankOneCityGet();
  267. //游客年龄
  268. this.chartRankOneAgeGet();
  269. //支付方式与购买渠道
  270. this.chartRankOnePayGet();
  271. //停车场
  272. this.chartRankOneParkGet();
  273. //人流量排行
  274. this.chartRankOneMbsGet();
  275. //地图
  276. this.getMapByPerson();
  277. let _this = this;
  278. setInterval(function () {
  279. _this.money += Math.round(Math.random() * 100);
  280. _this.peopleNum += Math.round(Math.random() * 100);
  281. }, 3000)
  282. },
  283. created() {
  284. // this.selectShipRoute()
  285. this.handler();
  286. },
  287. methods: {
  288. //地图
  289. handler() {
  290. getShipRoute().then(res => {
  291. if (res.code == 200) {
  292. this.dataSource = res.data
  293. this.map = new BMap.Map('map'); // 创建Map实例
  294. this.map.centerAndZoom(new BMap.Point(126.607589,43.802168), 11); // 初始化地图,设置中心点坐标和地图级别
  295. this.map.enableScrollWheelZoom(true);
  296. let mapStyle ={
  297. style : 'midnight',
  298. };
  299. this.map.setMapStyle(mapStyle);
  300. let marker;
  301. let polyline;
  302. let opts;
  303. let dataList = this.dataSource
  304. for (let i = 0; i < dataList.length; i++) {
  305. let pointArray = [];
  306. for (let j = 0; j < dataList[i].polylinePath.length; j++) {
  307. pointArray.push(new BMap.Point(dataList[i].polylinePath[j].lng, dataList[i].polylinePath[j].lat))
  308. }
  309. polyline = new BMap.Polyline(pointArray, {strokeColor: dataList[i].color, strokeWeight: 5, strokeOpacity: 0.5}); //创建折线
  310. // 创建小船图标
  311. var myIcon = new BMap.Icon(require("@/assets/images/ship.png"), new BMap.Size(52, 26));
  312. marker = new BMap.Marker(new BMap.Point(dataList[i].polylinePath[0].lng, dataList[i].polylinePath[0].lat),{icon:myIcon}); // 创建点
  313. opts = {
  314. width: 100, // 信息窗口宽度
  315. height: 80, // 信息窗口高度
  316. title: "游船信息", // 信息窗口标题
  317. }
  318. // marker添加点击事件
  319. marker.addEventListener('mouseover', function () {
  320. this.map.openInfoWindow(new BMap.InfoWindow("游船名称:" + dataList[i].shipName + "</br>" + "游船型号:" + dataList[i].shipType + "</br>" + "驱动类型:" + dataList[i].propulsion + "</br>", opts), new BMap.Point(dataList[i].polylinePath[0].lng, dataList[i].polylinePath[0].lat));
  321. });
  322. marker.addEventListener('mouseout', function () {
  323. this.map.closeInfoWindow();
  324. });
  325. this.map.addOverlay(polyline);
  326. this.map.addOverlay(marker);
  327. }
  328. } else {
  329. this.$modal.msgError("查询失败");
  330. }
  331. })
  332. },
  333. selectShipRoute() {
  334. getShipRoute().then(res => {
  335. if (res.code == 200) {
  336. this.dataSource = res.data
  337. console.log("this.dataSource", this.dataSource)
  338. } else {
  339. this.$modal.msgError("查询失败");
  340. }
  341. })
  342. },
  343. //https://echarts.apache.org/examples/zh/editor.html?c=line-stack
  344. chartRankOneMonthGet() {
  345. let option = {
  346. legend: {
  347. textStyle: {
  348. color: 'white' // Set legend text color to white
  349. },
  350. right: '0' // Align legend to the right
  351. },
  352. tooltip: {},
  353. dataset: {
  354. source: [
  355. ['product', '本月', '上月'],
  356. ['动物园', 100, 150],
  357. ['五龙潭', 55, 85],
  358. ['三清观', 65, 88],
  359. ['植物园', 88, 15]
  360. ]
  361. },
  362. xAxis: {type: 'category'},
  363. yAxis: {},
  364. // Declare several bar series, each will be mapped
  365. // to a column of dataset.source by default.
  366. series: [{
  367. type: 'bar',
  368. barWidth: '15%',
  369. itemStyle: {
  370. normal: {
  371. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  372. offset: 0,
  373. color: '#fe6f66'
  374. }, {
  375. offset: 1,
  376. color: '#f09a62'
  377. }]),
  378. },
  379. },
  380. },
  381. {
  382. type: 'bar',
  383. barWidth: '15%',
  384. itemStyle: {
  385. normal: {
  386. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  387. offset: 0,
  388. color: '#4ac1d6'
  389. }, {
  390. offset: 1,
  391. color: '#50d496'
  392. }]),
  393. }
  394. },
  395. }]
  396. };
  397. let myChart = this.$echarts.init(document.getElementById("chartRankOneMonth"));
  398. myChart.setOption(option);
  399. },
  400. chartRankOneAgeGet() {
  401. let option = {
  402. series: [
  403. {
  404. name: '人员比例',
  405. type: 'pie',
  406. radius: ['40%', '70%'],
  407. avoidLabelOverlap: true,
  408. label: {
  409. show: false,
  410. position: 'center'
  411. },
  412. emphasis: {
  413. label: {
  414. show: true,
  415. fontSize: 14,
  416. fontWeight: 'bold',
  417. formatter:'{b}:{c}\n {d}%',
  418. }
  419. },
  420. labelLine: {
  421. show: false
  422. },
  423. data: [
  424. {name: '60岁以上', value: 16},
  425. {name: '40-60岁之间', value: 25},
  426. {name: '18岁之内', value: 18},
  427. {name: '18-40岁之间', value: 36}
  428. ]
  429. }
  430. ]
  431. };
  432. let myChart = this.$echarts.init(document.getElementById("chartRankOneAge"));
  433. myChart.setOption(option);
  434. },
  435. //https://echarts.apache.org/examples/zh/editor.html?c=gauge-multi-title
  436. chartRankOneParkGet() {
  437. const gaugeData = [
  438. {
  439. value: 85,
  440. name: '已占用车位数',
  441. title: {
  442. offsetCenter: ['0%', '70%']
  443. },
  444. detail: {
  445. offsetCenter: ['0%', '105%']
  446. },
  447. }
  448. ];
  449. let option = {
  450. series: [
  451. {
  452. type: 'gauge',
  453. anchor: {
  454. show: true,
  455. showAbove: true,
  456. size: 18,
  457. itemStyle: {
  458. color: '#fff'
  459. }
  460. },
  461. axisLine: {
  462. lineStyle: {
  463. width: 6,
  464. color: [
  465. [0.3, '#e3ce67'],
  466. [0.7, '#2a86b6'],
  467. [1, '#42c51d']
  468. ]
  469. }
  470. },
  471. pointer: {
  472. 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',
  473. width: 8,
  474. length: '80%',
  475. offsetCenter: [0, '8%']
  476. },
  477. progress: {
  478. show: true,
  479. overlap: true,
  480. roundCap: true
  481. },
  482. data: gaugeData,
  483. title: {
  484. fontSize: 14
  485. },
  486. detail: {
  487. width: 40,
  488. height: 14,
  489. fontSize: 14,
  490. color: '#fff',
  491. backgroundColor: 'inherit',
  492. borderRadius: 3,
  493. formatter: '{value}%'
  494. }
  495. }
  496. ]
  497. };
  498. setInterval(function () {
  499. gaugeData[0].value = +(Math.random() * 100).toFixed(2);
  500. myChart.setOption({
  501. series: [
  502. {
  503. data: gaugeData
  504. }
  505. ]
  506. });
  507. }, 2000);
  508. let myChart = this.$echarts.init(document.getElementById("chartRankOnePark"));
  509. myChart.setOption(option);
  510. },
  511. chartRankOneSaleGet() {
  512. let option = {
  513. tooltip: {
  514. trigger: 'axis'
  515. },
  516. grid: {
  517. left: '3%',
  518. right: '4%',
  519. bottom: '3%',
  520. containLabel: true
  521. },
  522. xAxis: {
  523. type: 'category',
  524. boundaryGap: false,
  525. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月']
  526. },
  527. yAxis: {
  528. type: 'value'
  529. },
  530. series: [
  531. {
  532. name: '景区1',
  533. type: 'line',
  534. stack: 'Total',
  535. data: [120, 132, 101, 134, 90, 230, 210]
  536. },
  537. {
  538. name: '景区2',
  539. type: 'line',
  540. stack: 'Total',
  541. data: [220, 182, 191, 234, 290, 330, 310]
  542. },
  543. {
  544. name: '景区3',
  545. type: 'line',
  546. stack: 'Total',
  547. data: [150, 232, 201, 154, 190, 330, 410]
  548. },
  549. {
  550. name: '景区4',
  551. type: 'line',
  552. stack: 'Total',
  553. data: [320, 332, 301, 334, 390, 330, 320]
  554. },
  555. {
  556. name: '景区5',
  557. type: 'line',
  558. stack: 'Total',
  559. data: [820, 932, 901, 934, 1290, 1330, 1320]
  560. }
  561. ]
  562. };
  563. let myChart = this.$echarts.init(document.getElementById("chartRankOneSale"));
  564. myChart.setOption(option);
  565. },
  566. //https://echarts.apache.org/examples/zh/editor.html?c=bar-y-category
  567. chartRankOneCityGet() {
  568. let option = {
  569. grid: {
  570. left: "2%",
  571. right: "2%",
  572. bottom: "2%",
  573. top: "2%",
  574. containLabel: true,
  575. },
  576. xAxis: {
  577. show: false,
  578. type: "value",
  579. },
  580. yAxis: [
  581. {
  582. type: "category",
  583. inverse: true,
  584. axisLabel: {
  585. show: true,
  586. textStyle: {
  587. fontSize: 20,
  588. color: "rgba(255, 255, 255, 0.8)",
  589. },
  590. formatter: function (name) {
  591. return name + ": ";
  592. },
  593. },
  594. splitLine: {
  595. show: false,
  596. },
  597. axisTick: {
  598. show: false,
  599. },
  600. axisLine: {
  601. show: false,
  602. },
  603. data: [
  604. "湖北省",
  605. "广东省",
  606. "江西省",
  607. "广西省",
  608. "湖南省",
  609. ],
  610. },
  611. {
  612. type: "category",
  613. inverse: true,
  614. axisTick: "none",
  615. axisLine: "none",
  616. show: false,
  617. axisLabel: {
  618. textStyle: {
  619. fontSize: 13,
  620. color: "rgba(255, 255, 255, 0.8)",
  621. padding: [0, 0, 0, 10],
  622. },
  623. formatter: function (value) {
  624. return value
  625. .toLocaleString()
  626. .toString()
  627. .replace(/(\d)(?=(?:\d{3}[+]?)+$)/g, "$1,");
  628. },
  629. },
  630. data: [60, 30, 10, 8, 5],
  631. },
  632. ],
  633. series: [
  634. {
  635. name: "车辆",
  636. type: "bar",
  637. zlevel: 1, //通过 zlevel 设置层级
  638. barWidth: 20,
  639. itemStyle: {
  640. normal: {
  641. barBorderRadius: 10,
  642. color: function (params) {//柱状图设置不同颜色
  643. // 给出颜色组
  644. var colorList = ["#ee6767", "#92cc76", "#fac859", "#4a77dd", "#ba77fd"];
  645. return colorList[params.dataIndex]
  646. },
  647. },
  648. },
  649. label: {
  650. show: true,
  651. position: 'right',
  652. formatter: '{c}%' // 显示数值和百分比
  653. },
  654. data: [60, 30, 10, 8, 5],
  655. },
  656. {
  657. name: "背景",
  658. type: "bar",
  659. barWidth: 20,
  660. barGap: "-100%", //两条柱状图重合
  661. data: [100, 100, 100, 100, 100],
  662. itemStyle: {
  663. normal: {
  664. color: "rgba(108, 254, 255, 0.3)",
  665. barBorderRadius: 10,
  666. },
  667. },
  668. },
  669. ],
  670. };
  671. let myChart = this.$echarts.init(document.getElementById("chartRankOneCity"));
  672. myChart.setOption(option);
  673. },
  674. //https://ppchart.com/#/今日各考场承载总考生数
  675. chartRankOnePayGet() {
  676. var scale = 1;
  677. var echartData = [
  678. {
  679. value: 2154,
  680. name: "自助端",
  681. },
  682. {
  683. value: 3854,
  684. name: "微信端",
  685. },
  686. {
  687. value: 3515,
  688. name: "窗口端",
  689. },
  690. {
  691. value: 3515,
  692. name: "其他",
  693. }
  694. ];
  695. var rich = {
  696. yellow: {
  697. color: "#ffc72b",
  698. fontSize: 12 * scale,
  699. padding: [5, 4],
  700. align: "center",
  701. },
  702. total: {
  703. color: "#ffc72b",
  704. fontSize: 12 * scale,
  705. align: "center",
  706. },
  707. white: {
  708. color: "#fff",
  709. align: "center",
  710. fontSize: 12 * scale,
  711. padding: [21, 0],
  712. },
  713. blue: {
  714. color: "#49dff0",
  715. fontSize: 12 * scale,
  716. align: "center",
  717. },
  718. hr: {
  719. borderColor: "#0b5263",
  720. width: "100%",
  721. borderWidth: 1,
  722. height: 0,
  723. },
  724. };
  725. let option = {
  726. // backgroundColor: "#031f2d",
  727. tooltip: {},
  728. graphic: {
  729. type: 'text',
  730. left: 'center',
  731. top: 'center',
  732. style: {
  733. text: '购票渠道',
  734. textAlign: 'center',
  735. fill: 'white',
  736. width: 30,
  737. height: 30,
  738. fontSize: 14
  739. }
  740. },
  741. series: [
  742. {
  743. name: "购票渠道",
  744. type: "pie",
  745. radius: ["32%", "40%"],
  746. hoverAnimation: false,
  747. color: ["#c487ee", "#deb140", "#49dff0", "#034079", "#6f81da", "#00ffb4"],
  748. label: {
  749. normal: {
  750. formatter: function (params, ticket, callback) {
  751. var total = 0;
  752. var percent = 0;
  753. echartData.forEach(function (value, index, array) {
  754. total += value.value;
  755. });
  756. percent = ((params.value / total) * 100).toFixed(1);
  757. return (
  758. "{white|" +
  759. params.name +
  760. "}\n{hr|}\n{yellow|" +
  761. params.value +
  762. "}\n{blue|" +
  763. percent +
  764. "%}"
  765. );
  766. },
  767. rich: rich,
  768. },
  769. },
  770. labelLine: {
  771. normal: {
  772. length: 20 * scale,
  773. length2: 0,
  774. lineStyle: {
  775. color: "#0b5263",
  776. },
  777. },
  778. },
  779. data: echartData,
  780. },
  781. ],
  782. };
  783. let myChart1 = this.$echarts.init(document.getElementById("chartRankOnePay1"));
  784. let myChart2 = this.$echarts.init(document.getElementById("chartRankOnePay2"));
  785. myChart1.setOption(option);
  786. myChart2.setOption(option);
  787. },
  788. //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
  789. chartRankOneMbsGet() {
  790. let option = {
  791. grid: {
  792. left: "0%",
  793. right: "0%",
  794. bottom: "0%",
  795. top: "0%",
  796. containLabel: true,
  797. },
  798. // tooltip: {
  799. // trigger: "axis",
  800. // axisPointer: {
  801. // type: "shadow",
  802. // },
  803. // confine: true,
  804. // textStyle: {
  805. // fontSize: 12,
  806. // color: "rgba(255, 255, 255, 0.8)",
  807. // },
  808. // formatter: function (params) {
  809. // return (
  810. // params[0].name +
  811. // "<br/>" +
  812. // "<span style='display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background:linear-gradient(90deg, #388CFF 0% ,#6CFEFF 100%)'></span>" +
  813. // params[0].seriesName +
  814. // " : " +
  815. // params[0].value
  816. // .toLocaleString()
  817. // .toString()
  818. // .replace(/(\d)(?=(?:\d{3}[+]?)+$)/g, "$1,") +
  819. // " 辆/天"
  820. // );
  821. // },
  822. // },
  823. xAxis: {
  824. show: false,
  825. type: "value",
  826. },
  827. yAxis: [
  828. {
  829. type: "category",
  830. inverse: true,
  831. axisLabel: {
  832. show: true,
  833. textStyle: {
  834. fontSize: 12,
  835. color: "rgba(255, 255, 255, 0.8)",
  836. backgroundColor: "#061731",
  837. width: 200,
  838. height: 30,
  839. align: 'center',
  840. },
  841. formatter: function (name) {
  842. return name + " ";
  843. },
  844. },
  845. splitLine: {
  846. show: false,
  847. },
  848. axisTick: {
  849. show: false,
  850. },
  851. axisLine: {
  852. show: false,
  853. },
  854. data: [],
  855. },
  856. ],
  857. series: [
  858. {
  859. name: "车辆",
  860. type: "bar",
  861. zlevel: 1, //通过 zlevel 设置层级
  862. barWidth: 15,
  863. itemStyle: {
  864. normal: {
  865. barBorderRadius: 10,
  866. // 渐变色
  867. // color: "rgba(108, 254, 255, 0.3)",
  868. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  869. {
  870. offset: 0,
  871. color: "#388CFF",
  872. },
  873. {
  874. offset: 1,
  875. color: "#6CFEFF",
  876. },
  877. ]),
  878. },
  879. },
  880. label: {
  881. show: true,
  882. position: 'right',
  883. formatter: '{c}%' // 显示数值和百分比
  884. },
  885. data: [60, 35, 20, 8, 5],
  886. },
  887. {
  888. name: "背景",
  889. type: "bar",
  890. barWidth: 15,
  891. barGap: "-100%", //两条柱状图重合
  892. data: [100, 100, 100, 100, 100],
  893. itemStyle: {
  894. normal: {
  895. color: "rgba(108, 254, 255, 0.3)",
  896. barBorderRadius: 10,
  897. },
  898. },
  899. },
  900. ],
  901. };
  902. let myChart = this.$echarts.init(document.getElementById("chartRankOneMb"));
  903. myChart.setOption(option);
  904. },
  905. getMapByPerson() {
  906. let option = getMap();
  907. let myChart = this.$echarts.init(document.getElementById("mapByPerson"));
  908. myChart.setOption(option);
  909. },
  910. tabClick(state) {
  911. let that=this
  912. if (state == 1) {
  913. this.regionInShowOne = true;
  914. this.regionInShowTwo = false;
  915. setTimeout(that.aaa(),1000
  916. )
  917. } else {
  918. this.regionInShowOne = false;
  919. this.regionInShowTwo = true;
  920. }
  921. },
  922. getFirstDigit(num) {
  923. return Number(String(this.money).charAt(num));
  924. },
  925. aaa(){
  926. this.map.panTo(new BMap.Point(126.607581,43.802168)); // 初始化地图,设置中心点坐标和地图级别
  927. }
  928. },
  929. }
  930. </script>
  931. <style lang="scss" scoped>
  932. @import "@/assets/styles/shh_body.scss";
  933. @import "@/assets/styles/shh_index.scss";
  934. </style>