index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. <template>
  2. <div class="dashboard">
  3. <div class="dashboard_top">
  4. <div class="dashboard_top_all">
  5. <select-box ref="checkAlls" defaultValue="全国" @selectChange="selectChange" :options="checkAlls" />
  6. </div>
  7. <div class="dashboard_top_title">
  8. <div class="dashboard_top_title_txt">行李全流程跟踪监管系统</div>
  9. <div class="shade shade_1"></div>
  10. <div class="shade shade_2"></div>
  11. <div class="shade shade_3"></div>
  12. </div>
  13. <div class="dashboard_top_times">
  14. <el-date-picker @change="timesChange" style="margin-left: 10px;margin-top: 8px;" v-model="dateTimes" size="small" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  15. </div>
  16. </div>
  17. <div class="dashboard_bottom">
  18. <div class="dashboard_bottom_left">
  19. <dv-border-box-7 :color="colors" v-loading="airportAccessLoading" element-loading-text="拼命加载中" class="dashboard_bottom_left_box">
  20. <div class="box_title">机场接入数据量排行</div>
  21. <div class="box_content">
  22. <select-box ref="checkAccess" class="box_content_select" size="mini" defaultValue="总数据条数" @selectChange="checkAccessChange" :options="checkAccess" />
  23. <bar-charts id="airportAccessCharts" :option="airportAccess" />
  24. </div>
  25. </dv-border-box-7>
  26. <dv-border-box-7 :color="colors" v-loading="airportLuggageLoading" element-loading-text="拼命加载中" class="dashboard_bottom_left_box">
  27. <div class="box_title">机场行李运力排行</div>
  28. <div class="box_content">
  29. <select-box ref="checkLuggage" class="box_content_select" size="mini" defaultValue="总行李量" @selectChange="checkLuggageChange" :options="checkLuggage" />
  30. <bar-charts id="airportLuggageCharts" :option="airportLuggage" />
  31. </div>
  32. </dv-border-box-7>
  33. <dv-border-box-7 :color="colors" v-loading="airportNodesLoading" element-loading-text="拼命加载中" class="dashboard_bottom_left_box">
  34. <div class="box_title">机场节点覆盖率排行</div>
  35. <div class="box_content">
  36. <select-box ref="checkNodes" class="box_content_select" size="mini" defaultValue="基本节点" @selectChange="checkNodesChange" :options="checkNodes" />
  37. <bar-charts id="airportNodeCharts" :option="airportNodes" />
  38. </div>
  39. </dv-border-box-7>
  40. <dv-border-box-7 :color="colors" class="dashboard_bottom_left_box">
  41. <div class="box_title">航司接入数据量排行</div>
  42. </dv-border-box-7>
  43. </div>
  44. <div class="dashboard_bottom_center">
  45. <dv-border-box-7 :color="colors" v-loading="mapOverviewLoading" element-loading-text="拼命加载中" class="dashboard_bottom_center_box1">
  46. <div class="box_title">机场行李跟踪系统建设总贤</div>
  47. <div class="mapOverview">
  48. <div class="mapOverview_list">
  49. <span class="mapOverview_list_icon icon1"></span>
  50. <span class="mapOverview_list_txt">已建 {{mapOverviewItem.build}}家</span>
  51. </div>
  52. <div class="mapOverview_list">
  53. <span class="mapOverview_list_icon icon2"></span>
  54. <span class="mapOverview_list_txt">在建 {{mapOverviewItem.building}}家</span>
  55. </div>
  56. <div class="mapOverview_list">
  57. <span class="mapOverview_list_icon icon3"></span>
  58. <span class="mapOverview_list_txt">未建 {{mapOverviewItem.not_build}}家</span>
  59. </div>
  60. </div>
  61. <div class="box_content">
  62. <map-charts id="mapCharts" :option="mapOverview" />
  63. </div>
  64. </dv-border-box-7>
  65. <dv-border-box-7 :color="colors" v-loading="scatterPlotLoading" element-loading-text="拼命加载中" class="dashboard_bottom_center_box2">
  66. <div class="box_title">小时行李峰值</div>
  67. <div class="box_content">
  68. <plot-charts id="plotsCharts" :option="scatterPlot" />
  69. </div>
  70. </dv-border-box-7>
  71. </div>
  72. <div class="dashboard_bottom_right">
  73. <dv-border-box-7 :color="colors" v-loading="airportStogLoading" element-loading-text="拼命加载中" class="dashboard_bottom_left_box">
  74. <div class="box_title">航班量</div>
  75. <div class="box_content">
  76. <pie-charts id="stogCharts" :option="airportStog" />
  77. </div>
  78. </dv-border-box-7>
  79. <dv-border-box-7 :color="colors" v-loading="overallAccessLoading" element-loading-text="拼命加载中" class="dashboard_bottom_left_box">
  80. <div class="box_title">总体接入数据量</div>
  81. <div class="box_content">
  82. <pie-charts id="stogChartss" :option="overallAccess" />
  83. </div>
  84. </dv-border-box-7>
  85. <dv-border-box-7 :color="colors" v-loading="luggageStackLoading" element-loading-text="拼命加载中" class="dashboard_bottom_left_box">
  86. <div class="box_title">行李量</div>
  87. <div class="box_content">
  88. <stack-charts id="stackCharts" :option="luggageStack" />
  89. </div>
  90. </dv-border-box-7>
  91. <dv-border-box-7 :color="colors" v-loading="fligtPlotLoading" element-loading-text="拼命加载中" class="dashboard_bottom_left_box">
  92. <div class="box_title">小时航班量峰值</div>
  93. <div class="box_content">
  94. <plot-charts id="fligtCharts" :option="fligtPlot" />
  95. </div>
  96. </dv-border-box-7>
  97. </div>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. import selectBox from './components/boxs'
  103. import barCharts from './components/echart/commonChartsBar.vue'
  104. import mapCharts from './components/echart/commonChartsChinaMap.vue'
  105. import plotCharts from './components/echart/commonChartscok.vue'
  106. import pieCharts from './components/echart/commonChartsLine.vue'
  107. import stackCharts from './components/echart/commonChartsck.vue'
  108. import { barOption, airportName, colors, checkAlls, checkLuggage, checkNodes, checkAccess, mapOption, pieOption, scatterOption, LuggageOption } from './utils'
  109. import { Query } from '@/api/webApi'
  110. import { parseTime } from '@/utils'
  111. const defaultTime = new Date().getTime() - 24 * 60 * 60 * 1000
  112. const defaultTimeFormat = parseTime(defaultTime, '{y}-{m}-{d}')
  113. export default {
  114. name: 'DashboardSystem',
  115. components: { selectBox, barCharts, mapCharts, plotCharts, pieCharts, stackCharts },
  116. data () {
  117. return {
  118. colors: ['#92c1ef'],
  119. checkAlls: checkAlls,
  120. checkAccess: checkAccess,
  121. checkLuggage: checkLuggage,
  122. checkNodes: checkNodes,
  123. dateTimes: ['2024-04-01', '2024-04-15'],
  124. airportAccess: _.cloneDeep(barOption),
  125. airportAccessLoading: false,
  126. airportLuggage: _.cloneDeep(barOption),
  127. airportLuggageLoading: false,
  128. airportNodes: _.cloneDeep(barOption),
  129. airportNodesLoading: false,
  130. mapOverview: _.cloneDeep(mapOption),
  131. mapOverviewLoading: false,
  132. scatterPlot: _.cloneDeep(scatterOption),
  133. scatterPlotLoading: false,
  134. airportStog: _.cloneDeep(pieOption),
  135. airportStogLoading: false,
  136. overallAccess: _.cloneDeep(pieOption),
  137. overallAccessLoading: false,
  138. luggageStack: _.cloneDeep(LuggageOption),
  139. luggageStackLoading: false,
  140. fligtPlot: _.cloneDeep(scatterOption),
  141. fligtPlotLoading: false,
  142. mapOverviewItem: {
  143. build: 0,
  144. building: 0,
  145. not_build: 0
  146. }
  147. }
  148. },
  149. methods: {
  150. formatChartsData (series, targets) {
  151. try {
  152. const ndatas = [...series]
  153. if (!ndatas.length) return
  154. ndatas.forEach((item, index) => {
  155. item = Object.assign(item, targets[index])
  156. })
  157. return ndatas
  158. } catch (error) {
  159. console.log(error)
  160. }
  161. },
  162. getChecksValue (name) {
  163. return this.$refs[name].value
  164. },
  165. selectChange (val) {
  166. if (!val) return
  167. this.pageInit()
  168. },
  169. //机场接入数据量排行下拉
  170. checkAccessChange (val) {
  171. if (!val) return
  172. this.setAirportAccess(val)
  173. },
  174. //机场行李运力排行下拉
  175. checkLuggageChange (val) {
  176. if (!val) return
  177. this.setAirportLuggage(val)
  178. },
  179. //机场节点覆盖率排行下拉
  180. checkNodesChange (val) {
  181. if (!val) return
  182. this.setAirportNodes(val)
  183. },
  184. timesChange (times) {
  185. if (!times.length) return
  186. this.pageInit()
  187. },
  188. formatBarData (arrs) {
  189. if (!arrs.length) return
  190. const ndatas = []
  191. const narrs = _.cloneDeep(arrs)
  192. narrs.forEach(item => {
  193. ndatas.push(item.data)
  194. })
  195. const newArray = ndatas.reverse()[0].map((col, i) => ndatas.map(row => row[i]))
  196. narrs.forEach((item, index) => {
  197. item.data = newArray[index]
  198. })
  199. return narrs
  200. },
  201. //机场接入数据排行
  202. async setAirportAccess (tag = '总数据条数') {
  203. try {
  204. this.airportAccessLoading = true
  205. const {
  206. code,
  207. returnData
  208. } = await Query({
  209. serviceId: SERVICE_ID.airportAccessId,
  210. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国', order_rules: this.getChecksValue('checkAccess') || tag },
  211. event: '0',
  212. })
  213. if (String(code) !== '0') {
  214. throw new Error('获取数据失败')
  215. }
  216. const ndatas = [...returnData].splice(0, 5)
  217. const ntargets = []
  218. const names = []
  219. if (!ndatas.length) return
  220. ndatas.map(({ airport, bpm_messages, bsm_messages, flight_messages, exception_messages, non_standard_messages_total }) => {
  221. const nitems = [this.formatNumberData(bpm_messages), this.formatNumberData(bsm_messages), this.formatNumberData(flight_messages), this.formatNumberData(exception_messages), this.formatNumberData(non_standard_messages_total)]
  222. names.push(airport)
  223. ntargets.push({
  224. emphasis: {
  225. focus: 'series'
  226. },
  227. data: nitems,
  228. type: 'bar',
  229. barWidth: 10
  230. })
  231. })
  232. this.airportAccess.yAxis.data = names?.reverse()
  233. ntargets.map((item, index) => {
  234. item.name = airportName[index]
  235. item.color = colors[index]
  236. if (item.name != '不符合规范数据') item.stack = 'totals'
  237. })
  238. this.airportAccess.title.subtext = '单位:万条'
  239. this.airportAccess.series = this.formatBarData(ntargets)
  240. } catch (error) {
  241. console.log(error)
  242. }
  243. this.airportAccessLoading = false
  244. },
  245. //机场接入数据排行
  246. async setAirportLuggage (tag = '总行李量') {
  247. this.airportLuggageLoading = true
  248. try {
  249. const {
  250. code,
  251. returnData
  252. } = await Query({
  253. serviceId: SERVICE_ID.airportLuggageId,
  254. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国', order_rules: this.getChecksValue('checkLuggage') || tag },
  255. event: '0',
  256. })
  257. if (String(code) !== '0') {
  258. throw new Error('获取数据失败')
  259. }
  260. const ndatas = [...returnData].splice(0, 5)
  261. const ntargets = []
  262. const names = []
  263. const nluggages = ['离港行李量', '进港行李量', '中转行李量']
  264. if (!ndatas.length) return
  265. ndatas.map(({ airport, in_bag, out_bag, transfer_bag }) => {
  266. const nitems = [this.formatNumberData(out_bag), this.formatNumberData(in_bag), this.formatNumberData(transfer_bag)]
  267. names.push(airport)
  268. ntargets.push({
  269. emphasis: {
  270. focus: 'series'
  271. },
  272. data: nitems,
  273. type: 'bar',
  274. barWidth: 10
  275. })
  276. })
  277. this.airportLuggage.yAxis.data = names?.reverse()
  278. ntargets.map((item, index) => {
  279. item.name = nluggages[index]
  280. item.color = colors[index]
  281. item.stack = 'totals'
  282. })
  283. this.airportLuggage.title.subtext = '单位:万件'
  284. this.airportLuggage.series = this.formatBarData(ntargets)
  285. } catch (error) {
  286. console.log(error)
  287. }
  288. this.airportLuggageLoading = false
  289. },
  290. //机场节点覆盖率排行
  291. async setAirportNodes (tag = '基本节点') {
  292. this.airportNodesLoading = true
  293. try {
  294. const {
  295. code,
  296. returnData
  297. } = await Query({
  298. serviceId: SERVICE_ID.airportNodesId,
  299. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国', order_rules: this.getChecksValue('checkNodes') || tag },
  300. event: '0',
  301. })
  302. if (String(code) !== '0') {
  303. throw new Error('获取数据失败')
  304. }
  305. const ndatas = [...returnData].splice(0, 5)
  306. const ntargets = []
  307. const names = []
  308. const nodes = ['标准内节点', '标准外节点', '基本节点']
  309. if (!ndatas.length) return
  310. ndatas.map(({ airport, basic_nodes, in_standard_nodes, not_in_standard_nodes }) => {
  311. const nitems = [in_standard_nodes, not_in_standard_nodes, basic_nodes]
  312. names.push(airport)
  313. ntargets.push({
  314. emphasis: {
  315. focus: 'series'
  316. },
  317. data: nitems,
  318. type: 'bar',
  319. barWidth: 10
  320. })
  321. })
  322. this.airportNodes.yAxis.data = names?.reverse()
  323. ntargets.map((item, index) => {
  324. item.name = nodes[index]
  325. item.color = colors[index]
  326. if (item.name != '基本节点') {
  327. item.stack = 'totals'
  328. } else {
  329. item.color = '#b39ddb'
  330. }
  331. })
  332. this.airportNodes.title.subtext = '单位:个'
  333. this.airportNodes.series = this.formatBarData(ntargets)
  334. } catch (error) {
  335. console.log(error)
  336. }
  337. this.airportNodesLoading = false
  338. },
  339. //机场节点覆盖率排行
  340. async setLuggageStack () {
  341. this.luggageStackLoading = true
  342. try {
  343. const {
  344. code,
  345. returnData
  346. } = await Query({
  347. serviceId: SERVICE_ID.pelLuggageId,
  348. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国' },
  349. event: '0',
  350. })
  351. if (String(code) !== '0') {
  352. throw new Error('获取数据失败')
  353. }
  354. const ndatas = [...returnData]
  355. const ntargets = []
  356. if (!ndatas.length) return
  357. ndatas.map(({ flightAttr, in_bag, notnormal_bag, out_bag, special_bag, total_bag, transfer_bag }) => {
  358. const nitems = [this.formatNumberData(total_bag), this.formatNumberData(out_bag), this.formatNumberData(in_bag), this.formatNumberData(transfer_bag), this.formatNumberData(notnormal_bag), this.formatNumberData(special_bag)]
  359. ntargets.push({
  360. name: flightAttr,
  361. data: nitems,
  362. type: 'bar',
  363. barWidth: 15,
  364. stack: 'total'
  365. })
  366. })
  367. this.luggageStack.title.subtext = '单位:万件'
  368. this.luggageStack.series = ntargets
  369. } catch (error) {
  370. console.log(error)
  371. }
  372. this.luggageStackLoading = false
  373. },
  374. formatNumberData (targetNum) {
  375. return _.floor((Number(targetNum) / 10000), 4)
  376. },
  377. //机场行李跟踪系统建设总览
  378. async setMapOverview () {
  379. this.mapOverviewLoading = true
  380. try {
  381. const {
  382. code,
  383. returnData
  384. } = await Query({
  385. serviceId: SERVICE_ID.airportTotalId,
  386. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国' },
  387. event: '0',
  388. })
  389. if (String(code) !== '0') {
  390. throw new Error('获取数据失败')
  391. }
  392. const ndatas = [...returnData]
  393. if (!ndatas.length) return
  394. ndatas.map(item => {
  395. item.name = item.province
  396. item.value = item.out_bag
  397. })
  398. this.mapOverview.series[0].data = ndatas
  399. } catch (error) {
  400. console.log(error)
  401. }
  402. this.mapOverviewLoading = false
  403. },
  404. //机场行李跟踪系统建设总览-建立情况
  405. async setMapOverviewTotals () {
  406. try {
  407. const {
  408. code,
  409. returnData
  410. } = await Query({
  411. serviceId: SERVICE_ID.pelestablishId,
  412. dataContent: {},
  413. event: '0',
  414. })
  415. if (String(code) !== '0') {
  416. throw new Error('获取数据失败')
  417. }
  418. const ndatas = [...returnData]
  419. if (!ndatas.length) return
  420. this.mapOverviewItem = ndatas[0]
  421. return
  422. } catch (error) {
  423. console.log(error)
  424. }
  425. },
  426. formatPlotData (times, arrs) {
  427. const ndatas = []
  428. for (let i = 0; i < times.length; i++) {
  429. const ctime = times[i]
  430. for (let j = 0; j < arrs.length; j++) {
  431. const point = arrs[j][i]
  432. ndatas.push([ctime, j, point || 0])
  433. }
  434. }
  435. return ndatas
  436. },
  437. //小时行李峰值
  438. async setScatterPlot () {
  439. this.scatterPlotLoading = true
  440. try {
  441. const {
  442. code,
  443. returnData
  444. } = await Query({
  445. serviceId: SERVICE_ID.hourLuggageId,
  446. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国' },
  447. event: '0',
  448. })
  449. if (String(code) !== '0') {
  450. throw new Error('获取数据失败')
  451. }
  452. const ndatas = [...returnData]
  453. const times = []
  454. const ntargets = []
  455. if (!ndatas.length) return
  456. ndatas.map(({ arrival, check_in, hour_of_day, loading, on_boarding, security_check, sorting, transit }) => {
  457. const nitems = [check_in, security_check, sorting, loading, on_boarding, transit, arrival]
  458. times.push(hour_of_day)
  459. ntargets.push(nitems)
  460. })
  461. const hours = [...times]
  462. // prettier-ignore
  463. const days = [
  464. '值机', '安检', '分拣',
  465. '装车', '装机', '中转', '到达'
  466. ];
  467. // prettier-ignore
  468. const data = this.formatPlotData(times, ntargets)
  469. const title = []
  470. const singleAxis = []
  471. const series = []
  472. function formatDataItem (number) {
  473. const nnumber = Number(number)
  474. if (nnumber <= 10) {
  475. return nnumber
  476. }
  477. if (nnumber > 10 && nnumber <= 100) {
  478. return nnumber / 10
  479. }
  480. if (nnumber > 100 && nnumber <= 1000) {
  481. return nnumber / 100
  482. }
  483. if (nnumber > 1000 && nnumber <= 10000) {
  484. return nnumber / 1000
  485. }
  486. if (nnumber > 10000 && nnumber <= 100000) {
  487. return nnumber / 10000
  488. }
  489. }
  490. days.forEach(function (day, idx) {
  491. title.push({
  492. textBaseline: 'middle',
  493. top: ((idx + 0.5) * 100) / 7 + '%',
  494. left: '3%',
  495. text: day,
  496. textStyle: {
  497. color: '#666',
  498. fontSize: 14,
  499. fontWeight: 300
  500. }
  501. });
  502. singleAxis.push({
  503. left: '12%',
  504. top: 0,
  505. bottom: 120,
  506. type: 'category',
  507. boundaryGap: false,
  508. data: hours,
  509. top: (idx * 100) / 7 + 5 + '%',
  510. height: 100 / 7 - 10 + '%',
  511. axisLabel: {
  512. interval: 2
  513. },
  514. axisTick: {
  515. show: false
  516. },
  517. axisLabel: { show: false },
  518. axisLine: {
  519. show: true,
  520. lineStyle: {
  521. color: '#ddd'
  522. }
  523. },
  524. });
  525. series.push({
  526. singleAxisIndex: idx,
  527. coordinateSystem: 'singleAxis',
  528. type: 'scatter',
  529. data: [],
  530. symbolSize: function (dataItem) {
  531. return dataItem[1] * 4;
  532. }
  533. });
  534. });
  535. data.forEach(function (dataItem) {
  536. if (series[dataItem[0]]) {
  537. series[dataItem[0]].data.push([dataItem[1], formatDataItem(dataItem[2])]);
  538. }
  539. });
  540. this.scatterPlot.title = title
  541. this.scatterPlot.singleAxis = singleAxis
  542. this.scatterPlot.series = series
  543. } catch (error) {
  544. console.log(error)
  545. }
  546. this.scatterPlotLoading = false
  547. },
  548. //小时航班量峰值
  549. async setFligtPlot () {
  550. this.fligtPlotLoading = true
  551. try {
  552. const {
  553. code,
  554. returnData
  555. } = await Query({
  556. serviceId: SERVICE_ID.hourFlightId,
  557. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国' },
  558. event: '0',
  559. })
  560. if (String(code) !== '0') {
  561. throw new Error('获取数据失败')
  562. }
  563. const ndatas = [...returnData]
  564. const times = []
  565. const ntargets = []
  566. if (!ndatas.length) return
  567. ndatas.map(({ actual_departure_flights, cancelled_flights, delayed_flights, estimated_departure_flights, flights_with_baggage, hour_of_day }) => {
  568. const nitems = [estimated_departure_flights, actual_departure_flights, delayed_flights, cancelled_flights, flights_with_baggage]
  569. times.push(hour_of_day)
  570. ntargets.push(nitems)
  571. })
  572. const hours = [...times]
  573. // prettier-ignore
  574. const days = [
  575. '预计起飞', '实际起飞', '延误',
  576. '取消', '有行李'];
  577. // prettier-ignore
  578. const data = this.formatPlotData(times, ntargets)
  579. const title = []
  580. const singleAxis = []
  581. const series = []
  582. function formatDataItem (number) {
  583. const nnumber = Number(number)
  584. if (nnumber <= 10) {
  585. return nnumber
  586. }
  587. if (nnumber > 10 && nnumber <= 100) {
  588. return nnumber / 10
  589. }
  590. if (nnumber > 100 && nnumber <= 1000) {
  591. return nnumber / 100
  592. }
  593. if (nnumber > 1000 && nnumber <= 10000) {
  594. return nnumber / 1000
  595. }
  596. if (nnumber > 10000 && nnumber <= 100000) {
  597. return nnumber / 10000
  598. }
  599. }
  600. days.forEach(function (day, idx) {
  601. title.push({
  602. textBaseline: 'middle',
  603. top: ((idx + 0.5) * 100) / 7 + '%',
  604. left: '3%',
  605. text: day,
  606. textStyle: {
  607. color: '#666',
  608. fontSize: 14,
  609. fontWeight: 300
  610. }
  611. });
  612. singleAxis.push({
  613. left: '12%',
  614. top: 0,
  615. bottom: 120,
  616. type: 'category',
  617. boundaryGap: false,
  618. data: hours,
  619. top: (idx * 100) / 7 + 5 + '%',
  620. height: 100 / 7 - 10 + '%',
  621. axisLabel: {
  622. interval: 2
  623. },
  624. axisTick: {
  625. show: false
  626. },
  627. axisLabel: { show: false },
  628. axisLine: {
  629. show: true,
  630. lineStyle: {
  631. color: '#ddd'
  632. }
  633. },
  634. });
  635. series.push({
  636. singleAxisIndex: idx,
  637. coordinateSystem: 'singleAxis',
  638. type: 'scatter',
  639. data: [],
  640. symbolSize: function (dataItem) {
  641. return dataItem[1] * 4;
  642. }
  643. });
  644. });
  645. data.forEach(function (dataItem) {
  646. if (series[dataItem[0]]) {
  647. series[dataItem[0]].data.push([dataItem[1], formatDataItem(dataItem[2])]);
  648. }
  649. });
  650. this.fligtPlot.title = title
  651. this.fligtPlot.singleAxis = singleAxis
  652. this.fligtPlot.series = series
  653. } catch (error) {
  654. console.log(error)
  655. }
  656. this.fligtPlotLoading = false
  657. },
  658. //航班量
  659. async setAirportStog () {
  660. this.airportStogLoading = true
  661. try {
  662. const {
  663. code,
  664. returnData
  665. } = await Query({
  666. serviceId: SERVICE_ID.pelFlightId,
  667. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国' },
  668. event: '0',
  669. })
  670. if (String(code) !== '0') {
  671. throw new Error('获取数据失败')
  672. }
  673. const ndatas = [...returnData]
  674. if (!ndatas.length) return
  675. const { canfly, dlyfly, domfly, havebagfly, intfly, nohavebagfly, norfly, totalfly } = ndatas[0]
  676. this.airportStog.legend.data = ['国内航班总量', '国际航班总量', '正常航班量', '延误航班量', '取消航班量', '有行李航班量', '无行李航班量']
  677. this.airportStog.series[0].data = [{ name: '无行李航班量', value: nohavebagfly }, { name: '有行李航班量', value: havebagfly }]
  678. this.airportStog.series[0].color = ['#660066', '#993399']
  679. this.airportStog.series[1].data = [{ name: '正常航班量', value: norfly }, { name: '延误航班量', value: dlyfly }, { name: '取消航班量', value: canfly }]
  680. this.airportStog.series[1].color = ['#6666ff', '#3333ff', '#0000ff']
  681. this.airportStog.series[2].data = [{ name: '国内航班总量', value: domfly }, { name: '国际航班总量', value: intfly }]
  682. this.airportStog.series[2].color = ['#00cc33', '#33ff66']
  683. this.airportStog.series[3].data = [{ name: '航班总量', value: totalfly }]
  684. this.airportStog.series[3].color = ['#fff']
  685. } catch (error) {
  686. console.log(error)
  687. }
  688. this.airportStogLoading = false
  689. },
  690. //总体接入数据量
  691. async setoverallAccess () {
  692. this.overallAccessLoading = true
  693. try {
  694. const {
  695. code,
  696. returnData
  697. } = await Query({
  698. serviceId: SERVICE_ID.pelTotalId,
  699. dataContent: { fd1: this.dateTimes[0], fd2: this.dateTimes[1], area: this.getChecksValue('checkAlls') || '全国' },
  700. event: '0',
  701. })
  702. if (String(code) !== '0') {
  703. throw new Error('获取数据失败')
  704. }
  705. const ndatas = [...returnData]
  706. if (!ndatas.length) return
  707. const { bpm_messages, bsm_messages, flight_messages, total_messages, exception_messages, non_standard_messages_total, standard_messages_total } = ndatas[0]
  708. this.overallAccess.legend.data = ['BPM', 'BSM', '航班数据', '异常行李数据', '不符合规范数据', '符合规范数据']
  709. this.overallAccess.series[0].data = [{ name: '不符合规范数据', value: non_standard_messages_total }, { name: '符合规范数据', value: standard_messages_total }]
  710. this.overallAccess.series[0].color = ['#660066', '#993399']
  711. this.overallAccess.series[1].data = [{ name: 'BPM', value: bpm_messages }, { name: 'BSM', value: bsm_messages }, { name: '航班数据', value: flight_messages }, { name: '异常行李数据', value: exception_messages }]
  712. this.overallAccess.series[1].color = ['#0000ff', '#6666ff', '#3333ff', '#000066']
  713. this.overallAccess.series[2].data = [{ name: '', value: 0 }]
  714. this.overallAccess.series[2].color = ['#fff']
  715. this.overallAccess.series[3].data = [{ name: '数据总量', value: total_messages }]
  716. this.overallAccess.series[3].color = ['#fff']
  717. } catch (error) {
  718. console.log(error)
  719. }
  720. this.overallAccessLoading = false
  721. },
  722. pageInit () {
  723. this.setAirportAccess()
  724. this.setAirportLuggage()
  725. this.setAirportNodes()
  726. this.setLuggageStack()
  727. this.setFligtPlot()
  728. this.setScatterPlot()
  729. this.setAirportStog()
  730. this.setoverallAccess()
  731. this.setMapOverview()
  732. this.setMapOverviewTotals()
  733. }
  734. },
  735. mounted () {
  736. this.pageInit()
  737. }
  738. }
  739. </script>
  740. <style lang="scss" scoped>
  741. $height: 25%;
  742. $w100: 100%;
  743. $w25: 25%;
  744. $s20: 20px;
  745. $bg: #074fb8;
  746. .dashboard {
  747. padding: $s20;
  748. height: calc(100vh - 80px);
  749. width: $w100;
  750. background-color: #fff;
  751. .mapOverview {
  752. position: absolute;
  753. left: 7%;
  754. top: 10%;
  755. font-size: 14px;
  756. color: #696969;
  757. &_list {
  758. margin-top: 5px;
  759. &_icon {
  760. display: inline-block;
  761. width: 11px;
  762. height: 11px;
  763. margin-right: 6px;
  764. }
  765. .icon1 {
  766. background-color: #4fc267;
  767. }
  768. .icon2 {
  769. background-color: #ffcc80;
  770. }
  771. .icon3 {
  772. background-color: #656565;
  773. }
  774. }
  775. }
  776. .box_title {
  777. background-color: $bg;
  778. color: #fff;
  779. font-size: 16px;
  780. font-weight: 600;
  781. clip-path: polygon(6% 0, 100% 0%, 97% 100%, -45% 160%);
  782. position: absolute;
  783. left: 2px;
  784. top: 2px;
  785. z-index: 10;
  786. line-height: 28px;
  787. padding: 0 20px;
  788. }
  789. .box_content {
  790. position: relative;
  791. width: 100%;
  792. height: 100%;
  793. &_select {
  794. position: absolute;
  795. left: 10px;
  796. top: 40px;
  797. z-index: 20;
  798. width: 90px;
  799. }
  800. }
  801. &_top {
  802. line-height: 50px;
  803. display: flex;
  804. justify-content: space-between;
  805. &_all {
  806. width: $w25;
  807. }
  808. &_title {
  809. color: #fff;
  810. margin: 0 $s20;
  811. width: calc(50% - 40px);
  812. display: flex;
  813. &_txt {
  814. width: 60%;
  815. margin-left: 15%;
  816. background-color: $bg;
  817. text-align: center;
  818. font-size: 22px;
  819. font-weight: 600;
  820. clip-path: polygon(6% 0, 100% 0%, 97% 100%, 0% 160%);
  821. }
  822. .shade {
  823. width: 30px;
  824. height: 50px;
  825. background-color: $bg;
  826. clip-path: polygon(60% 0, 100% 0%, 40% 100%, 0% 100%);
  827. }
  828. .shade_2 {
  829. background-color: rgba($color: $bg, $alpha: 0.7);
  830. }
  831. .shade_3 {
  832. background-color: rgba($color: $bg, $alpha: 0.3);
  833. }
  834. }
  835. &_times {
  836. width: $w25;
  837. display: flex;
  838. }
  839. }
  840. &_bottom {
  841. overflow-y: scroll;
  842. overflow-x: hidden;
  843. height: calc(100% - 50px);
  844. display: flex;
  845. justify-content: space-between;
  846. width: $w100;
  847. &_left {
  848. width: $w25;
  849. &_box {
  850. height: $height;
  851. margin-top: $s20;
  852. position: relative;
  853. }
  854. }
  855. &_right {
  856. width: $w25;
  857. }
  858. &_center {
  859. margin: 0 $s20;
  860. width: calc(50% - 40px);
  861. &_box1 {
  862. height: calc(75% + 40px);
  863. margin-top: 20px;
  864. }
  865. &_box2 {
  866. height: 25%;
  867. margin-top: 20px;
  868. }
  869. }
  870. }
  871. }
  872. </style>