statisticsTabs.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <div class="statistics-tabs">
  3. <el-row
  4. :gutter="16"
  5. type="flex"
  6. >
  7. <el-col
  8. v-for="(tab, index) in newTabList"
  9. :key="index"
  10. :span="4"
  11. >
  12. <el-dropdown
  13. v-if="tab.children && tab.children.length"
  14. placement="bottom"
  15. @command="commandHandler"
  16. >
  17. <div :class="['tab-bar', { 'tab-active': activeIndex === index }]">
  18. <img
  19. class="tab-icon"
  20. :src="activeIndex === index ? activeIcon : defaultIcon"
  21. :alt="tab.title"
  22. />
  23. <el-tooltip
  24. :content="tab.title"
  25. placement="top"
  26. >
  27. <span class="tab-title">{{ tab.title }}</span>
  28. </el-tooltip>
  29. <i class="icon-arrow el-icon-caret-bottom" />
  30. </div>
  31. <el-dropdown-menu slot="dropdown">
  32. <el-dropdown-item
  33. v-for="(childTab, childIndex) in tab.children"
  34. :key="childIndex"
  35. :command="[tab.path, childTab.path]"
  36. >{{ childTab.title }}</el-dropdown-item
  37. >
  38. </el-dropdown-menu>
  39. </el-dropdown>
  40. <div
  41. v-else
  42. :class="[
  43. 'tab-bar tab-bar-single',
  44. { 'tab-active': activeIndex === index },
  45. ]"
  46. @click="clickHandler(tab.path)"
  47. >
  48. <img
  49. class="tab-icon"
  50. :src="activeIndex === index ? activeIcon : defaultIcon"
  51. :alt="tab.title"
  52. />
  53. <el-tooltip
  54. :content="tab.title"
  55. placement="top"
  56. >
  57. <span class="tab-title">{{ tab.title }}</span>
  58. </el-tooltip>
  59. </div>
  60. </el-col>
  61. </el-row>
  62. </div>
  63. </template>
  64. <script>
  65. export default {
  66. name: 'StatisticsTabs',
  67. data() {
  68. return {
  69. defaultIcon: require('@/assets/nav/ic_statistical_top_default.png'),
  70. activeIcon: require('@/assets/nav/ic_statistical_top_check.png'),
  71. tabList: [
  72. // {
  73. // title: '航司行李相关统计',
  74. // path: '/statisticsCharts/airlineCompany',
  75. // roles: ['airline_baggage_statistics'],
  76. // children: [
  77. // {
  78. // path: 'flight',
  79. // title: '航班量统计',
  80. // },
  81. // {
  82. // path: 'baggage',
  83. // title: '行李量统计',
  84. // },
  85. // {
  86. // path: 'baggagePassenger',
  87. // title: '行李旅客量统计',
  88. // },
  89. // {
  90. // path: 'specialBaggage',
  91. // title: '特殊行李量统计',
  92. // },
  93. // {
  94. // path: 'baggageAverage',
  95. // title: '平均行李量统计',
  96. // },
  97. // {
  98. // path: 'abnormalBaggage',
  99. // title: '异常行李量统计',
  100. // },
  101. // {
  102. // path: 'complaintBaggage',
  103. // title: '投诉行李量统计',
  104. // },
  105. // {
  106. // path: 'compensationBaggage',
  107. // title: '赔偿行李量统计',
  108. // },
  109. // {
  110. // path: 'compensation',
  111. // title: '赔偿金额统计',
  112. // },
  113. // ],
  114. // },
  115. // {
  116. // path: '/statisticsCharts/passengerClassification',
  117. // title: '旅客分类统计',
  118. // roles: ['passenger_luggage_classification_statistics'],
  119. // children: [
  120. // {
  121. // path: 'baggage',
  122. // title: '行李量统计',
  123. // },
  124. // {
  125. // path: 'baggagePassenger',
  126. // title: '行李旅客量统计',
  127. // },
  128. // {
  129. // path: 'specialBaggage',
  130. // title: '特殊行李量统计',
  131. // },
  132. // {
  133. // path: 'abnormalBaggage',
  134. // title: '异常行李量统计',
  135. // },
  136. // {
  137. // path: 'complaintBaggage',
  138. // title: '投诉行李量统计',
  139. // },
  140. // {
  141. // path: 'compensationBaggage',
  142. // title: '赔偿行李量统计',
  143. // },
  144. // {
  145. // path: 'compensation',
  146. // title: '赔偿金额统计',
  147. // },
  148. // ],
  149. // },
  150. // {
  151. // path: '/statisticsCharts/flightClassification',
  152. // title: '航班分类相关统计',
  153. // roles: ['statistics_related_to_flight_classification'],
  154. // children: [
  155. // {
  156. // path: 'flight',
  157. // title: '航班量统计',
  158. // },
  159. // {
  160. // path: 'baggage',
  161. // title: '行李量统计',
  162. // },
  163. // {
  164. // path: 'passenger',
  165. // title: '行李旅客量统计',
  166. // },
  167. // ],
  168. // },
  169. // {
  170. // title: '报表统计',
  171. // path: '/statisticsCharts/report',
  172. // roles: ['report_statistics'],
  173. // children: [
  174. // {
  175. // path: 'reportStatistics',
  176. // title: '运送效率报表统计',
  177. // },
  178. // {
  179. // path: 'transitTables',
  180. // title: '中转四个流向统计',
  181. // },
  182. // {
  183. // path: 'transferDirectionTable',
  184. // title: '中转流向明细统计',
  185. // },
  186. // {
  187. // path: 'transferBaggageTable',
  188. // title: '中转行李因素分析统计',
  189. // },
  190. // {
  191. // path: 'baggageProportionTable',
  192. // title: '中转行李比例明细统计',
  193. // },
  194. // {
  195. // path: 'ScanningStatistics',
  196. // title: '航站BRS扫描统计',
  197. // },
  198. // {
  199. // path: 'scanDataTable',
  200. // title: 'Mannual Load扫描数据统计表',
  201. // },
  202. // {
  203. // path: 'rfldTable',
  204. // title: '航易行RFID扫描数据统计表',
  205. // },
  206. // {
  207. // path: 'Percentageofbaggage',
  208. // title: '行李全流程服务水平百分比',
  209. // },
  210. // ],
  211. // },
  212. // {
  213. // title: '特殊赔偿异常分类统计',
  214. // path: '/statisticsCharts/specialClassification',
  215. // roles: ['special_compensation_exception_classification_statistics'],
  216. // children: [
  217. // {
  218. // path: 'special',
  219. // title: '特殊行李分类统计',
  220. // },
  221. // {
  222. // path: 'abnormal',
  223. // title: '异常行李分类统计',
  224. // },
  225. // {
  226. // path: 'compensationBaggage',
  227. // title: '赔偿行李分类统计',
  228. // },
  229. // {
  230. // path: 'compensation',
  231. // title: '赔偿金额分类统计',
  232. // },
  233. // ],
  234. // },
  235. // {
  236. // path: '/statisticsCharts/statisticalAnalysis',
  237. // title: '统计分析',
  238. // roles: ['statistical_analysis'],
  239. // },
  240. {
  241. title: '行李量相关统计',
  242. path: '/statisticsCharts/baggage',
  243. children: [
  244. {
  245. path: 'all',
  246. title: '行李数量统计',
  247. },
  248. {
  249. path: 'company',
  250. title: '航司行李量统计',
  251. },
  252. {
  253. path: 'airline',
  254. title: '航线行李量统计',
  255. },
  256. {
  257. path: 'hour',
  258. title: '行李小时量统计',
  259. },
  260. ],
  261. },
  262. {
  263. path: '/statisticsCharts/node',
  264. title: '扫描节点与位置分析',
  265. roles: ['scanning_node_and_location_analysis'],
  266. },
  267. {
  268. path: '/statisticsCharts/workload',
  269. title: '工作量统计',
  270. roles: ['scanning_node_and_location_analysis'],
  271. },
  272. {
  273. path: '/statisticsCharts/abnormal',
  274. title: '异常行李分析',
  275. roles: ['scanning_node_and_location_analysis'],
  276. },
  277. {
  278. path: '/statisticsCharts/flight',
  279. title: '航班量',
  280. children: [
  281. {
  282. path: 'flightvolume',
  283. title: '航站航班量统计',
  284. },
  285. {
  286. path: 'numberair',
  287. title: '航司航班量统计',
  288. },
  289. {
  290. path: 'volumeof',
  291. title: '航线航班量统计',
  292. }]
  293. },
  294. {
  295. path: '/statisticsCharts/passenger',
  296. title: '行李旅客量',
  297. children: [
  298. {
  299. path: 'terminalpassengers',
  300. title: '航站旅客量',
  301. },
  302. {
  303. path: 'passengerair',
  304. title: '航司旅客量',
  305. },
  306. {
  307. path: 'passengerroute',
  308. title: '航线旅客量',
  309. },
  310. ]
  311. },
  312. {
  313. path: '/statisticsCharts/averagepassengers',
  314. title: '平均旅客行李量',
  315. children: [
  316. {
  317. path: 'averagepassterminal',
  318. title: '航站平均旅客行李量',
  319. },
  320. {
  321. path: 'averagepassairline',
  322. title: '航司平均旅客行李量',
  323. },
  324. {
  325. path: 'averagepassroute',
  326. title: '航线平均旅客行李量',
  327. },
  328. ]
  329. },
  330. {
  331. path: '/statisticsCharts/specialbaggageanalysis',
  332. title: '特殊行李分析',
  333. },
  334. {
  335. path: '/statisticsCharts/transitTables',
  336. title: '中转专项统计',
  337. },
  338. ],
  339. activeIndex: null,
  340. }
  341. },
  342. computed: {
  343. newTabList() {
  344. // const auths = JSON.parse(sessionStorage.getItem('userAuthList'))
  345. // return this.tabList.filter(
  346. // tab => !tab.roles || tab.roles.every(role => auths.includes(role))
  347. // )
  348. return this.tabList
  349. },
  350. },
  351. watch: {
  352. '$route.path': {
  353. handler(path) {
  354. let activeIndex = null
  355. this.newTabList.some((tab, index) => {
  356. if (path.includes(tab.path)) {
  357. activeIndex = index
  358. return true
  359. }
  360. })
  361. this.activeIndex = activeIndex
  362. },
  363. immediate: true,
  364. },
  365. },
  366. methods: {
  367. commandHandler(pathArray) {
  368. if (pathArray.some(path => !path)) {
  369. this.$message.info('开发中')
  370. return
  371. }
  372. this.$router.push({
  373. path: pathArray.join('/'),
  374. })
  375. },
  376. clickHandler(path) {
  377. if (!path) {
  378. this.$message.info('开发中')
  379. return
  380. }
  381. this.$router.push({
  382. path,
  383. })
  384. },
  385. },
  386. }
  387. </script>
  388. <style lang="scss" scoped>
  389. .statistics-tabs {
  390. > .el-row > .el-col {
  391. max-width: 208px;
  392. min-width: 175px;
  393. .el-dropdown {
  394. width: 100%;
  395. }
  396. .tab-bar {
  397. width: 100%;
  398. height: 56px;
  399. background-color: #ffffff;
  400. padding-left: 16px;
  401. padding-right: 16px;
  402. display: flex;
  403. align-items: center;
  404. box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
  405. border-radius: 4px;
  406. &-single {
  407. cursor: pointer;
  408. }
  409. &:not(:last-child) {
  410. margin-right: 16px;
  411. }
  412. .tab-icon {
  413. width: 14px;
  414. height: 14px;
  415. }
  416. .tab-title {
  417. padding-left: 12px;
  418. padding-right: 8px;
  419. font-size: 14px;
  420. font-family: Helvetica, 'Microsoft YaHei';
  421. font-weight: bold;
  422. color: #101116;
  423. letter-spacing: 0;
  424. overflow: hidden;
  425. white-space: nowrap;
  426. text-overflow: ellipsis;
  427. }
  428. &.tab-active {
  429. background-color: #2d67e3;
  430. .tab-title {
  431. color: #ffffff;
  432. }
  433. }
  434. .icon-arrow {
  435. position: absolute;
  436. right: 16px;
  437. color: #101116;
  438. font-size: 14px;
  439. transition: transform 0.3s;
  440. }
  441. &.tab-active .icon-arrow {
  442. color: #ffffff;
  443. }
  444. &:hover .icon-arrow {
  445. transform: rotate(180deg);
  446. }
  447. }
  448. }
  449. }
  450. </style>