zhongxiaoyu 2 роки тому
батько
коміт
e24b8afd72

+ 199 - 124
src/views/statisticsCharts/components/statisticsHeader.vue

@@ -77,6 +77,13 @@
           @click="getData"
         >{{ buttonText }}</el-button>
       </el-form-item>
+      <el-form-item v-if="withExport">
+        <img
+          src="../../../assets/nav/ic_export.png"
+          class="btn-icon-only"
+          @click="exportClickHandler"
+        >
+      </el-form-item>
     </el-form>
   </div>
 </template>
@@ -101,6 +108,10 @@ export default {
     buttonText: {
       type: String,
       default: '查询'
+    },
+    withExport: {
+      type: Boolean,
+      default: true
     }
   },
   data() {
@@ -143,13 +154,13 @@ export default {
             }
           ],
           changeHandler(value) {
-            this.getInOrOut(value)
-            this.formData.airline = ''
+            this.formData.inOrOut = ''
+            this.formData.interval = ''
             this.formData.company = ''
+            this.formData.airline = ''
             this.formData.airport = ''
             this.formData.terminal = ''
-            this.formData.interval = ''
-            this.formData.inOrOut = ''
+            this.setInOrOutOptions(value)
             this.formItems[4].disabled = true
             this.formItems[5].disabled = true
             this.formItems[6].disabled = true
@@ -217,6 +228,8 @@ export default {
           filterable: true,
           clearable: true,
           disabled: true,
+          queryId: DATACONTENT_ID.AirlineId,
+          setKey: 'a2',
           options: []
         },
         {
@@ -226,6 +239,8 @@ export default {
           filterable: true,
           clearable: true,
           disabled: true,
+          queryId: DATACONTENT_ID.AreaId,
+          setKey: 'a5',
           options: []
         },
         {
@@ -236,6 +251,8 @@ export default {
           clearable: true,
           // multiple: true,
           disabled: true,
+          queryId: DATACONTENT_ID.AirportId,
+          setKey: 'a2',
           options: []
         },
         {
@@ -248,6 +265,8 @@ export default {
           },
           clearable: true,
           disabled: true,
+          queryId: DATACONTENT_ID.TerminalId,
+          setKey: 'a2',
           options: []
         }
       ]
@@ -271,21 +290,8 @@ export default {
   },
   created() {
     this.formItems.forEach(item => {
-      switch (item.prop) {
-        case 'airline':
-          this.getAirline()
-          break
-        case 'company':
-          this.getCompany()
-          break
-        case 'airport':
-          this.getAirport()
-          break
-        case 'terminal':
-          this.getTerminal()
-          break
-        default:
-          break
+      if (item.queryId && item.setKey) {
+        this.getOptions(item.queryId, item.setKey, item.prop)
       }
     })
   },
@@ -297,128 +303,191 @@ export default {
       // console.log(this.formData)
       this.$emit('getFormData', this.formData)
     },
-    async getInOrOut(data) {
-      try {
-        const res = await Query({
-          id: DATACONTENT_ID.inOrOutId,
-          dataContent: [data]
-        })
-        if (res.code === '0') {
-          const arr = []
-          for (let i = 0; i < res.returnData.listValues.length; i++) {
-            arr.push({
-              label: res.returnData.listValues[i].a5,
-              value: res.returnData.listValues[i].a5
-            })
-          }
-          const theItem = this.formItems.find(item => item.prop === 'inOrOut')
-          theItem && (theItem.options = arr)
-        } else {
-          this.$message.error(res.message)
-        }
-      } catch (error) {
-        console.log('出错了', error)
-      }
-    },
-    async getAirline() {
-      try {
-        const res = await Query({
-          id: DATACONTENT_ID.AirlineId,
-          dataContent: []
-        })
-        if (res.code === '0') {
-          const arr = []
-          for (let i = 0; i < res.returnData.listValues.length; i++) {
-            arr.push({
-              label: res.returnData.listValues[i].a2,
-              value: res.returnData.listValues[i].a2
-            })
-          }
-          const theItem = this.formItems.find(item => item.prop === 'airline')
-          theItem && (theItem.options = arr)
-        } else {
-          this.$message.error(res.message)
-        }
-      } catch (error) {
-        console.log('出错了', error)
-      }
-    },
-    async getCompany() {
-      try {
-        const res = await Query({
-          id: DATACONTENT_ID.AreaId,
-          dataContent: []
-        })
-        if (res.code === '0') {
-          const arr = []
-          for (let i = 0; i < res.returnData.listValues.length; i++) {
-            arr.push({
-              label: res.returnData.listValues[i].a4,
-              value: res.returnData.listValues[i].a4
-            })
-          }
-          const theItem = this.formItems.find(item => item.prop === 'company')
-          theItem && (theItem.options = arr)
-        } else {
-          this.$message.error(res.message)
-        }
-      } catch (error) {
-        console.log('出错了', error)
-      }
+    exportClickHandler() {
+      this.$emit('export')
+      this.$message.info('开发中')
     },
-    async getAirport() {
-      try {
-        const res = await Query({
-          id: DATACONTENT_ID.AirportId,
-          dataContent: []
-        })
-        if (res.code === '0') {
-          const arr = []
-          for (let i = 0; i < res.returnData.listValues.length; i++) {
-            arr.push({
-              label: res.returnData.listValues[i].a2,
-              value: res.returnData.listValues[i].a2
-            })
-          }
-          const theItem = this.formItems.find(item => item.prop === 'airport')
-          theItem && (theItem.options = arr)
-        } else {
-          this.$message.error(res.message)
-        }
-      } catch (error) {
-        console.log('出错了', error)
+    setInOrOutOptions(range) {
+      const theInOrOutItem = this.formItems.find(item => item.prop === 'inOrOut')
+      switch (range) {
+        case '全部':
+        case '航线':
+          theInOrOutItem.options = [
+            {
+              label: '全部',
+              value: '全部'
+            }
+          ]
+          this.formData.inOrOut = '全部'
+          this.formItems[1].disabled = true
+          break
+        case '基地分公司':
+        case '航站':
+        case '航站楼':
+          theInOrOutItem.options = [
+            {
+              value: '全部',
+              label: '全部'
+            },
+            {
+              value: '进港',
+              label: '进港'
+            },
+            {
+              value: '离港',
+              label: '离港'
+            }
+          ]
+          this.formItems[1].disabled = false
+          break
+        default:
+          theInOrOutItem.options = []
+          this.formItems[1].disabled = false
+          break
       }
     },
-    async getTerminal() {
+    async getOptions(queryId, setKey, prop) {
       try {
-        const res = await Query({
-          id: DATACONTENT_ID.TerminalId,
+        const { code, returnData, message } = await Query({
+          id: queryId,
           dataContent: []
         })
-        if (res.code === '0') {
-          const arr = []
-          for (let i = 0; i < res.returnData.listValues.length; i++) {
-            arr.push({
-              label: res.returnData.listValues[i].a2,
-              value: res.returnData.listValues[i].a2
-            })
-          }
-          const theItem = this.formItems.find(item => item.prop === 'terminal')
-          theItem && (theItem.options = arr)
+        if (Number(code) === 0) {
+          const arr = returnData.listValues.map(element => ({
+            label: element[setKey],
+            value: element[setKey]
+          }))
+          const theItem = this.formItems.find(item => item.prop === prop)
+          theItem.options = arr
         } else {
-          this.$message.error(res.message)
+          this.$message.error(message)
         }
       } catch (error) {
         console.log('出错了', error)
       }
     }
+    // async getInOrOut(data) {
+    //   try {
+    //     const res = await Query({
+    //       id: DATACONTENT_ID.inOrOutId,
+    //       dataContent: [data]
+    //     })
+    //     if (res.code === '0') {
+    //       const arr = []
+    //       for (let i = 0; i < res.returnData.listValues.length; i++) {
+    //         arr.push({
+    //           label: res.returnData.listValues[i].a5,
+    //           value: res.returnData.listValues[i].a5
+    //         })
+    //       }
+    //       const theItem = this.formItems.find(item => item.prop === 'inOrOut')
+    //       theItem && (theItem.options = arr)
+    //     } else {
+    //       this.$message.error(res.message)
+    //     }
+    //   } catch (error) {
+    //     console.log('出错了', error)
+    //   }
+    // },
+    // async getAirline() {
+    //   try {
+    //     const res = await Query({
+    //       id: DATACONTENT_ID.AirlineId,
+    //       dataContent: []
+    //     })
+    //     if (res.code === '0') {
+    //       const arr = []
+    //       for (let i = 0; i < res.returnData.listValues.length; i++) {
+    //         arr.push({
+    //           label: res.returnData.listValues[i].a2,
+    //           value: res.returnData.listValues[i].a2
+    //         })
+    //       }
+    //       const theItem = this.formItems.find(item => item.prop === 'airline')
+    //       theItem && (theItem.options = arr)
+    //     } else {
+    //       this.$message.error(res.message)
+    //     }
+    //   } catch (error) {
+    //     console.log('出错了', error)
+    //   }
+    // },
+    // async getCompany() {
+    //   try {
+    //     const res = await Query({
+    //       id: DATACONTENT_ID.AreaId,
+    //       dataContent: []
+    //     })
+    //     if (res.code === '0') {
+    //       const arr = []
+    //       for (let i = 0; i < res.returnData.listValues.length; i++) {
+    //         arr.push({
+    //           label: res.returnData.listValues[i].a4,
+    //           value: res.returnData.listValues[i].a4
+    //         })
+    //       }
+    //       const theItem = this.formItems.find(item => item.prop === 'company')
+    //       theItem && (theItem.options = arr)
+    //     } else {
+    //       this.$message.error(res.message)
+    //     }
+    //   } catch (error) {
+    //     console.log('出错了', error)
+    //   }
+    // },
+    // async getAirport() {
+    //   try {
+    //     const res = await Query({
+    //       id: DATACONTENT_ID.AirportId,
+    //       dataContent: []
+    //     })
+    //     if (res.code === '0') {
+    //       const arr = []
+    //       for (let i = 0; i < res.returnData.listValues.length; i++) {
+    //         arr.push({
+    //           label: res.returnData.listValues[i].a2,
+    //           value: res.returnData.listValues[i].a2
+    //         })
+    //       }
+    //       const theItem = this.formItems.find(item => item.prop === 'airport')
+    //       theItem && (theItem.options = arr)
+    //     } else {
+    //       this.$message.error(res.message)
+    //     }
+    //   } catch (error) {
+    //     console.log('出错了', error)
+    //   }
+    // },
+    // async getTerminal() {
+    //   try {
+    //     const res = await Query({
+    //       id: DATACONTENT_ID.TerminalId,
+    //       dataContent: []
+    //     })
+    //     if (res.code === '0') {
+    //       const arr = []
+    //       for (let i = 0; i < res.returnData.listValues.length; i++) {
+    //         arr.push({
+    //           label: res.returnData.listValues[i].a2,
+    //           value: res.returnData.listValues[i].a2
+    //         })
+    //       }
+    //       const theItem = this.formItems.find(item => item.prop === 'terminal')
+    //       theItem && (theItem.options = arr)
+    //     } else {
+    //       this.$message.error(res.message)
+    //     }
+    //   } catch (error) {
+    //     console.log('出错了', error)
+    //   }
+    // }
   }
 }
 </script>
 
 <style lang="scss" scoped>
 .flight-statistics-header {
-  padding-top: 14px;
+  padding-top: 24px;
   min-height: 80px;
   display: flex;
   justify-content: space-between;
@@ -454,7 +523,8 @@ export default {
       &:not(:last-child) {
         margin-right: 8px;
       }
-      &:nth-last-child(2) {
+      &:nth-last-child(2),
+      &:nth-last-child(3) {
         margin-right: 16px;
       }
       .el-form-item__content {
@@ -520,6 +590,11 @@ export default {
           border-radius: 4px;
           font-family: Helvetica, 'Microsoft YaHei';
         }
+        .btn-icon-only {
+          width: 32px;
+          height: 32px;
+          cursor: pointer;
+        }
       }
     }
   }

+ 64 - 56
src/views/statisticsCharts/views/baggageStatisticsCharts.vue

@@ -6,7 +6,6 @@
     >
       <StatisticsHeader
         title="行李统计"
-        :items="[]"
         @getFormData="getFormData"
       />
     </div>
@@ -62,7 +61,7 @@ export default {
           }
         },
         grid: {
-          top: '10%',
+          top: '15%',
           left: '5%',
           right: '5%',
           bottom: '5%'
@@ -90,7 +89,6 @@ export default {
           {
             min: 0,
             max: 60000,
-            // interval: 5000,
             splitLine: {
               lineStyle: {
                 type: 'dashed',
@@ -111,7 +109,6 @@ export default {
           {
             min: -0.3,
             max: 0.5,
-            interval: 0.1,
             axisLabel: {
               formatter: value => (value * 100).toFixed(2) + '%',
               fontFamily: 'Helvetica, "Microsoft YaHei"',
@@ -135,11 +132,11 @@ export default {
             itemStyle: {
               color: '#6682B5'
             },
+            barWidth: 40,
             label: {
               show: true,
               position: 'top'
             },
-            barWidth: 40,
             data: []
           },
           {
@@ -204,7 +201,6 @@ export default {
     }
   },
   mounted() {
-    this.getData()
     this.setChartHeight()
     this.myChart = this.$echarts.init(document.getElementById('chart'))
     this.myChart.setOption(this.options)
@@ -228,72 +224,84 @@ export default {
     getFormData(data) {
       this.getData(data)
     },
-    // 243 时间类型 查询范围 开始时间  结束时间  进离岗  航线/航站/航站楼
-    // 244 时间类型 开始时间  结束时间  进离岗  基地分公司
     async getData(data) {
-      // let id
-      // let params = []
-      // if (data.range === '') {
-      //   this.$message.warning('请先选择统计范围')
-      //   return
-      // }
-      // if (data.inOrOut === '') {
-      //   this.$message.warning('请先选择进离岗')
-      //   return
-      // }
-      // if (data.interval === '') {
-      //   this.$message.warning('请先选择统计时间维度')
-      //   return
-      // }
-      // if (data.dateTime === '') {
-      //   this.$message.warning('请先选择统计时间范围')
-      //   return
-      // }
-      // if (data.range === '基地分公司') {
-      //   id = DATACONTENT_ID.byAreaId
-      //   params = [data.interval, data.dateTime[0], data.dateTime[1], data.inOrOut, data.company]
-      // } else if (data.range !== '基地分公司' && data.range !== '') {
-      //   id = DATACONTENT_ID.byOtherId
-      //   params = [data.interval, data.range, data.dateTime[0], data.dateTime[1], data.inOrOut]
-      //   if (data.airline === '' && data.airport === '' && data.terminal === '') {
-      //     params.push('全部')
-      //   }
-      //   if (data.airline !== '') {
-      //     params.push(data.airline)
-      //   }
-      //   if (data.airport !== '') {
-      //     params.push(data.airport)
-      //   }
-      //   if (data.terminal !== '') {
-      //     params.push(data.terminal)
-      //   }
-      // }
+      let id
+      let params = []
+      if (data.range === '') {
+        this.$message.warning('请先选择统计范围')
+        return
+      } else if (data.range === '航线' && !data.airline) {
+        this.$message.warning('请先选择航线')
+        return
+      } else if (data.range === '航站' && !data.airport) {
+        this.$message.warning('请先选择航站')
+        return
+      } else if (data.range === '基地分公司' && !data.company) {
+        this.$message.warning('请先选择基地分公司')
+        return
+      }
+      if (data.inOrOut === '') {
+        this.$message.warning('请先选择进离港')
+        return
+      }
+      if (data.interval === '') {
+        this.$message.warning('请先选择统计时间维度')
+        return
+      }
+      if (data.dateTime === '') {
+        this.$message.warning('请先选择统计时间范围')
+        return
+      }
+      if (data.range === '基地分公司') {
+        id = DATACONTENT_ID.byAreaId
+        params = [data.interval, data.company, data.inOrOut, data.dateTime[0], data.dateTime[1]]
+      } else if (data.range !== '基地分公司' && data.range !== '') {
+        id = DATACONTENT_ID.byOtherId
+        params = [data.interval, data.range, data.inOrOut, data.dateTime[0], data.dateTime[1]]
+        if (data.airline === '' && data.airport === '' && data.terminal === '') {
+          params.splice(2, 0, '全部')
+        }
+        if (data.airline !== '') {
+          params.splice(2, 0, data.airline)
+        }
+        if (data.airport !== '') {
+          params.splice(2, 0, data.airport)
+        }
+        if (data.terminal !== '') {
+          params.splice(2, 0, data.terminal)
+        }
+      }
       try {
         const res = await Query({
-          id: DATACONTENT_ID.baggageStatistics,
-          dataContent: []
+          id: id,
+          dataContent: params
         })
         if (res.code === '0') {
           const dateArr = []
           const dataArr = []
           const chainArr = [0]
           for (let i = 0; i < res.returnData.listValues.length; i++) {
-            dateArr.push(res.returnData.listValues[i].a3)
-            dataArr.push(res.returnData.listValues[i].count)
+            dateArr.push(res.returnData.listValues[i].A)
+            dataArr.push(res.returnData.listValues[i]['sum(a9)'])
             if (i > 0) {
-              chainArr.push(
-                (res.returnData.listValues[i].count - res.returnData.listValues[i - 1].count) /
-                  res.returnData.listValues[i - 1].count
-              )
+              if (res.returnData.listValues[i - 1]['sum(a9)'] > 0) {
+                chainArr.push(
+                  (res.returnData.listValues[i]['sum(a9)'] - res.returnData.listValues[i - 1]['sum(a9)']) /
+                    res.returnData.listValues[i - 1]['sum(a9)']
+                )
+              } else {
+                chainArr.push(0)
+              }
             }
           }
-          const max = Math.max(...dataArr) + 1000
+          let max = Math.max(...dataArr)
+          max = Math.ceil(max / 10) * 10
           this.options.yAxis[0].max = max
           this.options.xAxis.data = dateArr
           this.options.series[0].data = dataArr
           this.options.series[2].data = chainArr
-          this.options.yAxis[1].min = (Math.min(...chainArr) - 0.2).toFixed(2)
-          this.options.yAxis[1].max = (Math.max(...chainArr) + 0.2).toFixed(2)
+          this.options.yAxis[1].min = (Math.min(...chainArr) - 0.1).toFixed(2)
+          this.options.yAxis[1].max = (Math.max(...chainArr) + 0.1).toFixed(2)
           this.resizeHandler()
         } else {
           this.$message.error(res.message)

+ 32 - 23
src/views/statisticsCharts/views/flightStatisticsCharts.vue

@@ -53,7 +53,7 @@ export default {
           data: [
             '航班量数量',
             // '航班量同比',
-            '航班量环比',
+            '航班量环比'
           ],
           textStyle: {
             fontFamily: 'Helvetica, "Microsoft YaHei"',
@@ -61,7 +61,7 @@ export default {
           }
         },
         grid: {
-          top: '10%',
+          top: '15%',
           left: '5%',
           right: '5%',
           bottom: '5%'
@@ -89,7 +89,6 @@ export default {
           {
             min: 0,
             max: 60000,
-            // interval: 5000,
             splitLine: {
               lineStyle: {
                 type: 'dashed',
@@ -110,7 +109,6 @@ export default {
           {
             min: -0.3,
             max: 0.5,
-            interval: 0.1,
             axisLabel: {
               formatter: value => (value * 100).toFixed(2) + '%',
               fontFamily: 'Helvetica, "Microsoft YaHei"',
@@ -188,7 +186,7 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['sidebar', 'permission_routes'])
+    ...mapGetters(['sidebar'])
   },
   watch: {
     // 监听数据变化 重绘图形
@@ -203,7 +201,6 @@ export default {
     }
   },
   mounted() {
-    console.log(this.permission_routes)
     this.setChartHeight()
     this.myChart = this.$echarts.init(document.getElementById('chart'))
     this.myChart.setOption(this.options)
@@ -227,17 +224,24 @@ export default {
     getFormData(data) {
       this.getData(data)
     },
-    // 243 时间类型 查询范围 开始时间  结束时间  进离岗  航线/航站/航站楼
-    // 244 时间类型 开始时间  结束时间  进离岗  基地分公司
     async getData(data) {
       let id
       let params = []
       if (data.range === '') {
         this.$message.warning('请先选择统计范围')
         return
+      } else if (data.range === '航线' && !data.airline) {
+        this.$message.warning('请先选择航线')
+        return
+      } else if (data.range === '航站' && !data.airport) {
+        this.$message.warning('请先选择航站')
+        return
+      } else if (data.range === '基地分公司' && !data.company) {
+        this.$message.warning('请先选择基地分公司')
+        return
       }
       if (data.inOrOut === '') {
-        this.$message.warning('请先选择进离岗')
+        this.$message.warning('请先选择进离')
         return
       }
       if (data.interval === '') {
@@ -250,21 +254,21 @@ export default {
       }
       if (data.range === '基地分公司') {
         id = DATACONTENT_ID.byAreaId
-        params = [data.interval, data.dateTime[0], data.dateTime[1], data.inOrOut, data.company]
+        params = [data.interval, data.company, data.inOrOut, data.dateTime[0], data.dateTime[1]]
       } else if (data.range !== '基地分公司' && data.range !== '') {
         id = DATACONTENT_ID.byOtherId
-        params = [data.interval, data.range, data.dateTime[0], data.dateTime[1], data.inOrOut]
+        params = [data.interval, data.range, data.inOrOut, data.dateTime[0], data.dateTime[1]]
         if (data.airline === '' && data.airport === '' && data.terminal === '') {
-          params.push('全部')
+          params.splice(2, 0, '全部')
         }
         if (data.airline !== '') {
-          params.push(data.airline)
+          params.splice(2, 0, data.airline)
         }
         if (data.airport !== '') {
-          params.push(data.airport)
+          params.splice(2, 0, data.airport)
         }
         if (data.terminal !== '') {
-          params.push(data.terminal)
+          params.splice(2, 0, data.terminal)
         }
       }
       try {
@@ -278,21 +282,26 @@ export default {
           const chainArr = [0]
           for (let i = 0; i < res.returnData.listValues.length; i++) {
             dateArr.push(res.returnData.listValues[i].A)
-            dataArr.push(res.returnData.listValues[i].count)
+            dataArr.push(res.returnData.listValues[i]['sum(a9)'])
             if (i > 0) {
-              chainArr.push(
-                (res.returnData.listValues[i].count - res.returnData.listValues[i - 1].count) /
-                  res.returnData.listValues[i - 1].count
-              )
+              if (res.returnData.listValues[i - 1]['sum(a9)'] > 0) {
+                chainArr.push(
+                  (res.returnData.listValues[i]['sum(a9)'] - res.returnData.listValues[i - 1]['sum(a9)']) /
+                    res.returnData.listValues[i - 1]['sum(a9)']
+                )
+              } else {
+                chainArr.push(0)
+              }
             }
           }
-          const max = Math.max(...dataArr) + 1000
+          let max = Math.max(...dataArr)
+          max = Math.ceil(max / 10) * 10
           this.options.yAxis[0].max = max
           this.options.xAxis.data = dateArr
           this.options.series[0].data = dataArr
           this.options.series[2].data = chainArr
-          this.options.yAxis[1].min = (Math.min(...chainArr) - 0.2).toFixed(2)
-          this.options.yAxis[1].max = (Math.max(...chainArr) + 0.2).toFixed(2)
+          this.options.yAxis[1].min = (Math.min(...chainArr) - 0.1).toFixed(2)
+          this.options.yAxis[1].max = (Math.max(...chainArr) + 0.1).toFixed(2)
           this.resizeHandler()
         } else {
           this.$message.error(res.message)

+ 211 - 47
src/views/statisticsCharts/views/nodeStatisticsCharts.vue

@@ -15,9 +15,20 @@
     <div class="statstics-content">
       <div
         id="chart"
-        class="flight-statistics-chart"
+        class="node-statistics-chart"
         :style="{ height: chartHeight }"
       />
+      <div
+        v-if="tooltips.length"
+        class="node-tooltip"
+      >
+        <div class="node-tooltip-title">节点扫描率</div>
+        <div
+          v-for="tooltip in tooltips"
+          :key="tooltip.label"
+          class="node-tooltip-content"
+        ><span>{{ tooltip.label }}:</span><span>{{ tooltip.ratio }}</span></div>
+      </div>
     </div>
   </div>
 </template>
@@ -30,6 +41,7 @@ export default {
   name: 'FlightStatisticsCharts',
   components: { StatisticsHeader },
   data() {
+    const that = this
     return {
       formData: {
         range: '',
@@ -43,25 +55,14 @@ export default {
           prop: 'range',
           inputType: 'select',
           placeholder: '请选择统计范围',
-          options: [
-            {
-              value: '全部',
-              label: '全部'
-            },
-            {
-              value: '航线',
-              label: '航线'
-            },
-            {
-              value: '航站',
-              label: '航站'
-            }
-          ],
+          options: [],
+          queryId: DATACONTENT_ID.nodeRangeId,
+          setKey: 'a1',
           changeHandler(value) {
-            this.getInOrOut(value)
             this.formData.airline = ''
             this.formData.airport = ''
             this.formData.inOrOut = ''
+            that.setInOrOutOptions(value)
             this.formItems[1].disabled = true
             this.formItems[2].disabled = true
             switch (value) {
@@ -83,6 +84,8 @@ export default {
           filterable: true,
           clearable: true,
           disabled: true,
+          queryId: DATACONTENT_ID.nodeAirlineId,
+          setKey: 'a2',
           options: []
         },
         {
@@ -93,6 +96,8 @@ export default {
           clearable: true,
           // multiple: true,
           disabled: true,
+          queryId: DATACONTENT_ID.nodeAirportId,
+          setKey: 'a2',
           options: []
         },
         {
@@ -114,10 +119,20 @@ export default {
       debounceTime: 300,
       chartHeight: '70vh',
       options: {
-        legend: {
-          top: 32,
-          right: 32,
-          data: ['离港', '进港']
+        // legend: {
+        //   top: 32,
+        //   right: 32,
+        //   height: 14,
+        //   itemWidth: 14,
+        //   itemHeight: 14,
+        //   icon: 'rect',
+        //   textStyle: {
+        //     fontSize: 14
+        //   },
+        //   data: ['离港', '进港']
+        // },
+        tooltip: {
+          trigger: 'item'
         },
         label: {
           show: true,
@@ -126,7 +141,40 @@ export default {
           }
         },
         radar: {
-          indicator: [],
+          indicator: [
+            {
+              name: '行李总件数',
+              max: 10000
+            },
+            {
+              name: '值机件数',
+              max: 10000
+            },
+            {
+              name: '安检件数',
+              max: 10000
+            },
+            {
+              name: '分拣件数',
+              max: 10000
+            },
+            {
+              name: '装车件数',
+              max: 10000
+            },
+            {
+              name: '装机件数',
+              max: 10000
+            },
+            {
+              name: '卸机件数',
+              max: 10000
+            },
+            {
+              name: '到达件数',
+              max: 10000
+            }
+          ],
           axisName: {
             padding: 10,
             color: '#303133',
@@ -135,7 +183,7 @@ export default {
         },
         series: [
           {
-            name: '',
+            name: 'nodeRadar',
             type: 'radar',
             areaStyle: {
               color: '#6897D8'
@@ -152,7 +200,37 @@ export default {
             data: []
           }
         ]
-      }
+      },
+      tooltips: [
+        {
+          label: '值机',
+          ratio: '0%'
+        },
+        {
+          label: '安检',
+          ratio: '0%'
+        },
+        {
+          label: '分拣',
+          ratio: '0%'
+        },
+        {
+          label: '装车',
+          ratio: '0%'
+        },
+        {
+          label: '装机',
+          ratio: '0%'
+        },
+        {
+          label: '卸机',
+          ratio: '0%'
+        },
+        {
+          label: '到达',
+          ratio: '0%'
+        }
+      ]
     }
   },
   computed: {
@@ -174,7 +252,7 @@ export default {
   mounted() {
     this.setChartHeight()
     this.myChart = this.$echarts.init(document.getElementById('chart'))
-    // this.myChart.setOption(this.options)
+    this.myChart.setOption(this.options)
     // 监听页面缩放
     window.addEventListener('resize', this.setChartHeight)
     window.addEventListener('resize', this._.debounce(this.resizeHandler, this.debounceTime))
@@ -195,10 +273,46 @@ export default {
     getFormData(data) {
       this.getData(data)
     },
-    // 243 时间类型 查询范围 开始时间  结束时间  进离港  航线/航站/航站楼
-    // 244 时间类型 开始时间  结束时间  进离港  基地分公司
+    setInOrOutOptions(range) {
+      const theInOrOutItem = this.formItems.find(item => item.prop === 'inOrOut')
+      switch (range) {
+        case '全部':
+        case '航线':
+          theInOrOutItem.options = [
+            {
+              label: '全部',
+              value: '全部'
+            }
+          ]
+          this.formData.inOrOut = '全部'
+          this.formItems[3].disabled = true
+          break
+        case '航站':
+          theInOrOutItem.options = [
+            {
+              value: '进港',
+              label: '进港'
+            },
+            {
+              value: '离港',
+              label: '离港'
+            }
+          ]
+          this.formItems[3].disabled = false
+          break
+        default:
+          theInOrOutItem.options = []
+          this.formItems[3].disabled = false
+          break
+      }
+    },
     async getData(data) {
       const params = []
+      let queryId
+      if (data.range === '') {
+        this.$message.warning('请先选择统计范围')
+        return
+      }
       if (data.range === '航线' && data.airline === '') {
         this.$message.warning('请先选择航线')
         return
@@ -207,50 +321,76 @@ export default {
         this.$message.warning('请先选择航站')
         return
       }
-      if (data.inOrOut === '') {
-        this.$message.warning('请先选择进离港')
-        return
+      switch (data.inOrOut) {
+        case '全部':
+          queryId = DATACONTENT_ID.nodeAllId
+          break
+        case '进港':
+          queryId = DATACONTENT_ID.nodeInId
+          break
+        case '离港':
+          queryId = DATACONTENT_ID.nodeOutId
+          break
+        default:
+          this.$message.warning('请先选择统计时间范围')
+          return
       }
       if (data.dateTime === '') {
         this.$message.warning('请先选择统计时间范围')
         return
       }
-      const id = DATACONTENT_ID.nodeStatistics
+      params.push(data.range, data.inOrOut, data.dateTime[0], data.dateTime[1])
       if (data.range === '航线') {
-        params.push(data.airline)
+        params.splice(1, 0, data.airline)
       } else if (data.range === '航站') {
-        params.push(data.airport)
+        params.splice(1, 0, data.airport)
       } else {
-        params.push('全部')
+        params.splice(1, 0, '全部')
       }
-      params.push(data.inOrOut, data.dateTime[0], data.dateTime[1])
       try {
         const res = await Query({
-          id: id,
+          id: queryId,
           dataContent: params
         })
-        if (res.code === '0') {
-          const map = {
-            L: '离港',
-            X: '进港',
-            T: '中转'
+        if (Number(res.code) === 0) {
+          if (!res.returnData.listValues.length) {
+            this.options.series[0].data = []
+            this.tooltips.forEach(tooltip => (tooltip.ratio = '0%'))
+            return
           }
           const labels = Object.keys(res.returnData.listValues[0])
           const datas = Object.values(res.returnData.listValues[0])
           const max = Math.max(...datas)
-          this.options.legend.data = [map[data.inOrOut]]
-          this.options.radar.indicator = labels.map(item => {
+          this.options.radar.indicator = labels.map(label => {
             return {
-              name: item,
+              name: label,
               max
             }
           })
           this.options.series[0].data = [
             {
               value: datas,
-              name: map[data.inOrOut]
+              name: data.inOrOut
             }
           ]
+          this.tooltips = labels.reduce((pre, curr, index) => {
+            if (!curr.includes('总')) {
+              return [
+                ...pre,
+                {
+                  label: curr.slice(0, 2),
+                  ratio: (datas[index] / max).toFixed(4) * 100 + '%'
+                }
+              ]
+            } else {
+              return pre
+            }
+          }, [])
+          // .map((label, index) => ({
+          //   label: label.replace('件数', ''),
+          //   ratio: (datas[index] / max).toFixed(2) * 100 + '%'
+          // }))
+          // .filter(element => !element.label.includes('总'))
         } else {
           this.$message.error(res.message)
         }
@@ -281,9 +421,33 @@ export default {
 .statstics-wrapper {
   .statstics-content {
     background-color: #fff;
-  }
-  .flight-statistics-chart {
-    width: 100%;
+    position: relative;
+    .node-tooltip {
+      width: 90px;
+      position: absolute;
+      bottom: 48px;
+      left: 64px;
+      z-index: 100;
+      font-size: 14px;
+      font-family: Helvetica, 'Microsoft YaHei';
+      color: #303133;
+      .node-tooltip-title {
+        line-height: 14px;
+        margin-bottom: 30px;
+        font-weight: bold;
+      }
+      .node-tooltip-content {
+        line-height: 14px;
+        display: flex;
+        justify-content: space-between;
+        &:not(:last-child) {
+          margin-bottom: 21px;
+        }
+      }
+    }
+    .node-statistics-chart {
+      width: 100%;
+    }
   }
 }
 </style>