Browse Source

Merge branch 'master' of http://120.26.64.82:3000/BFFE/CABaggageData2.0

zhaoke 2 years ago
parent
commit
21ac9dc78c

+ 1 - 0
public/config.js

@@ -99,6 +99,7 @@ const DATACONTENT_ID = {
   nodeAllId: 1175, // 获取节点统计雷达图-全部
   nodeInId: 1176, // 获取节点统计雷达图-进港
   nodeOutId: 1177, // 获取节点统计雷达图-离港
+  nodeAxisNameId: 90
 }
 
 const SERVICE_ID = {

+ 14 - 1
src/router/index.js

@@ -87,8 +87,21 @@ const createRouter = () =>
 
 const router = createRouter()
 
+router.beforeEach((to, from, next) => {
+  if (from.path.includes('flight') && from.query.flightNO && from.query.flightDate) {
+    store.dispatch('keepAlive/savePage', from)
+  }
+  if (to.path.includes('flight') && from.path.includes('baggage') && (!to.query.flightNO || !to.query.flightDate)) {
+    const savedPage = store.getters.savedPages.find(savedPage => savedPage.name === to.name)
+    if (savedPage) {
+      next(savedPage.fullPath)
+    }
+  }
+  next()
+})
+
 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
-export function resetRouter () {
+export function resetRouter() {
   const newRouter = createRouter()
   router.matcher = newRouter.matcher // reset router
 }

+ 2 - 1
src/store/getters.js

@@ -31,6 +31,7 @@ const getters = {
   permission_routes: state => state.permission.routes,
   queryForm: state => state.app.queryForm,
   timeZone: state => state.timeZone.currentTimeZone,
-  clickedCells: state => state.keepAlive.clickedCells
+  clickedCells: state => state.keepAlive.clickedCells,
+  savedPages: state => state.keepAlive.savedPages
 }
 export default getters

+ 14 - 1
src/store/modules/keepAlive.js

@@ -8,7 +8,8 @@
  */
 
 const state = {
-  clickedCells: JSON.parse(sessionStorage.getItem('clickedCells')) || []
+  clickedCells: JSON.parse(sessionStorage.getItem('clickedCells')) || [],
+  savedPages: JSON.parse(sessionStorage.getItem('savedPages')) || []
 }
 
 const mutations = {
@@ -18,12 +19,24 @@ const mutations = {
         item[key] === cell[key]
       })
     ) || (state.clickedCells.push(cell), sessionStorage.setItem('clickedCells', JSON.stringify(state.clickedCells)))
+  },
+  SAVE_PAGE(state, { name, query, fullPath }) {
+    const index = state.savedPages.findIndex(savedPage => savedPage.name === name)
+    if (index > -1) {
+      state.savedPages = state.savedPages.splice(index, 1, { name, query, fullPath })
+    } else {
+      state.savedPages.push({ name, query, fullPath })
+    }
+    sessionStorage.setItem('savedPages', JSON.stringify(state.savedPages))
   }
 }
 
 const actions = {
   addClickedCell({ commit }, cell) {
     commit('ADD_CLICKED_CELL', cell)
+  },
+  savePage({ commit }, page) {
+    commit('SAVE_PAGE', page)
   }
 }
 

+ 4 - 2
src/views/advancedQuery/views/advancedHome.vue

@@ -770,7 +770,9 @@ export default {
     queryEntries.forEach(([key, value]) => {
       if (!['startDate', 'endDate', 'singleJump'].includes(key) && (value ?? '') !== '') {
         queryFlag = true
-        this.form[key] = ['unLoad', 'checkIn', 'active', 'transferIn', 'canceled', 'noBSM'].includes(key) ? Number(value) : value
+        this.form[key] = ['unLoad', 'checkIn', 'active', 'transferIn', 'canceled', 'noBSM'].includes(key)
+          ? Number(value)
+          : value
       }
     })
     if (startDate) {
@@ -969,7 +971,7 @@ export default {
     tableFormat(row, column, cellValue) {
       switch (column.property) {
         case 'departureTime':
-          return cellValue.replace('T', ' ')
+          return (cellValue ?? '').replace('T', ' ')
         case 'deleted':
           return cellValue === 'DEL' ? cellValue : ''
         case 'activated':

+ 1 - 1
src/views/baggageManagement/components/arrival/index.vue

@@ -301,7 +301,7 @@ export default {
               sortable: true
             },
             {
-              prop: 'departureTerminal',
+              prop: 'departureAirport',
               label: '起飞航站',
               disc: '指航班执飞航段的起飞航站,以航站三字码显示',
               width: 85,

+ 1 - 1
src/views/baggageManagement/mixins/terminal.js

@@ -427,7 +427,7 @@ export default {
               flightNO: row.flightNO,
               startDate: row.flightDate,
               endDate: row.flightDate,
-              departureStation: row.departureTerminal,
+              departureStation: row.departureAirport,
               destination: this.formData.currentAirport,
               checkIn: 1
             }

+ 50 - 5
src/views/statisticsCharts/views/nodeStatisticsCharts.vue

@@ -8,13 +8,12 @@
         title="扫描节点与位置分析"
         :items="formItems"
         :data="formData"
-        button-text="开始分析"
         @getFormData="getFormData"
       />
     </div>
     <div class="statstics-content">
       <div
-        id="chart"
+        ref="myChart"
         class="node-statistics-chart"
         :style="{ height: chartHeight }"
       />
@@ -181,6 +180,7 @@ export default {
             fontFamily: 'Helvetica, "Microsoft YaHei"'
           }
         },
+        triggerEvent: true,
         series: [
           {
             name: 'nodeRadar',
@@ -230,7 +230,8 @@ export default {
           label: '到达',
           ratio: '0%'
         }
-      ]
+      ],
+      descriptions: {}
     }
   },
   computed: {
@@ -249,16 +250,30 @@ export default {
       this.resizeHandler()
     }
   },
+  created() {
+    this.getTips()
+  },
   mounted() {
+    const that = this
+
     this.setChartHeight()
-    this.myChart = this.$echarts.init(document.getElementById('chart'))
+    this.myChart = this.$echarts.init(this.$refs['myChart'])
     this.myChart.setOption(this.options)
+
     // 监听页面缩放
     window.addEventListener('resize', this.setChartHeight)
     window.addEventListener('resize', this._.debounce(this.resizeHandler, this.debounceTime))
     this.$nextTick(() => {
       this.resizeHandler()
     })
+
+    // 防止修改标签造成的闪烁
+    this.myChart.on('mousedown', this.hideTips)
+    // 修改雷达图标签说明
+    this.myChart.on('mousemove', this.changeTips)
+    this.myChart.on('mouseup', params => {
+      setTimeout(that.changeTips.bind(that, params), 0)
+    })
   },
   beforeDestroy() {
     // 销毁实例和移除监听
@@ -270,6 +285,17 @@ export default {
     }
   },
   methods: {
+    hideTips(params) {
+      if (params.componentType === 'radar') {
+        this.myChart._dom.children[1].style.opacity = 0
+      }
+    },
+    changeTips(params) {
+      const tip = this.myChart._dom.children[1]
+      if (params.componentType === 'radar' && this.descriptions[params.name]) {
+        tip.innerHTML = tip.textContent = this.descriptions[params.name]
+      }
+    },
     getFormData(data) {
       this.getData(data)
     },
@@ -306,6 +332,25 @@ export default {
           break
       }
     },
+    async getTips() {
+      try {
+        const {
+          code,
+          returnData: { listValues },
+          message
+        } = await Query({
+          id: DATACONTENT_ID.nodeAxisNameId,
+          dataContent: []
+        })
+        if (Number(code) === 0 && listValues?.length) {
+          this.descriptions = JSON.parse(listValues[0].jieshi)
+        } else {
+          this.$message.error(message ?? '失败')
+        }
+      } catch (error) {
+        console.log('错误', error)
+      }
+    },
     async getData(data) {
       const params = []
       let queryId
@@ -379,7 +424,7 @@ export default {
                 ...pre,
                 {
                   label: curr.slice(0, 2),
-                  ratio: (datas[index] / max * 100).toFixed(2) + '%'
+                  ratio: ((datas[index] / max) * 100).toFixed(2) + '%'
                 }
               ]
             } else {