|
@@ -1,11 +1,31 @@
|
|
|
<template>
|
|
|
<div class="airportInfo">
|
|
|
<div class="variable">
|
|
|
- <StatisticsHeader :title="titleTop" :items="formItems" :data="formData" with-setting :withSetting="false" :withExport="true" @getFormData="getFormData" @export="tableToExcel('table')" />
|
|
|
+ <StatisticsHeader
|
|
|
+ :title="titleTop"
|
|
|
+ :items="formItems"
|
|
|
+ :data="formData"
|
|
|
+ with-setting
|
|
|
+ :withSetting="false"
|
|
|
+ :withExport="true"
|
|
|
+ @getFormData="getFormData"
|
|
|
+ @export="tableToExcel('table')"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <div v-loading="loading" element-loading-text="数据加载中..." class="echart">
|
|
|
+ <div
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-text="数据加载中..."
|
|
|
+ class="echart"
|
|
|
+ >
|
|
|
<!-- <Echarts :id="dataid" :option="tableData" v-if="picShow == true ? true : false" /> -->
|
|
|
- <Tableformbrs ref="table" :searchParams="searchParams" :tableList="tableList" :sort-msg="tableSortMsg" :action="action" :set="set" />
|
|
|
+ <Tableformbrs
|
|
|
+ ref="table"
|
|
|
+ :searchParams="searchParams"
|
|
|
+ :tableList="tableList"
|
|
|
+ :sort-msg="tableSortMsg"
|
|
|
+ :action="action"
|
|
|
+ :set="set"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -16,11 +36,11 @@ import Tableformbrs from "../../components/echart/tableforms.vue";
|
|
|
import StatisticsHeader from "../components/page-head.vue";
|
|
|
import { export_json_to_excel, exportToExcel } from "@/utils/Export2Excel";
|
|
|
import { Query } from "@/api/webApi";
|
|
|
-import { setSortMsg } from '../func'
|
|
|
-import _ from 'lodash'
|
|
|
+import { setSortMsg } from "../func";
|
|
|
+import _ from "lodash";
|
|
|
export default {
|
|
|
name: "ChartsBar",
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
asShow: false,
|
|
@@ -46,7 +66,7 @@ export default {
|
|
|
formData: {
|
|
|
flighttype: "全部",
|
|
|
dateTime: "",
|
|
|
- fttp: ""
|
|
|
+ fttp: "",
|
|
|
},
|
|
|
titleTop: "航班统计",
|
|
|
levelList: [
|
|
@@ -126,23 +146,24 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
searchParams: null,
|
|
|
- tableSortMsg: []
|
|
|
+ tableSortMsg: [],
|
|
|
};
|
|
|
},
|
|
|
- created () {
|
|
|
- const catchMap = sessionStorage.getItem(this.$route.name)
|
|
|
+ created() {
|
|
|
+ const catchMap = sessionStorage.getItem(this.$route.name);
|
|
|
if (catchMap) {
|
|
|
- const { k1, k2, k3, k4 } = JSON.parse(catchMap)
|
|
|
- this.formData = k1
|
|
|
- this.formData.dateTime = [k1.fd1, k1.fd2]
|
|
|
- this.tableList = k2
|
|
|
- this.tableListcop = k2
|
|
|
- this.tableSortMsg = setSortMsg(k3)
|
|
|
- this.searchParams = k4
|
|
|
+ const { k1, k2, k3, k4 } = JSON.parse(catchMap);
|
|
|
+ this.formData = k1;
|
|
|
+ this.formData.dateTime = [k1.fd1, k1.fd2];
|
|
|
+ this.tableList = k2;
|
|
|
+ this.tableListcop = k2;
|
|
|
+ this.tableSortMsg = setSortMsg(k3);
|
|
|
+ this.searchParams = k4;
|
|
|
+ // console.log(this.searchParams, "111111111");
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- getFormData (data) {
|
|
|
+ getFormData(data) {
|
|
|
this.tableData.time = [];
|
|
|
this.tableData.data1 = [];
|
|
|
this.tableData.data2 = [];
|
|
@@ -150,40 +171,40 @@ export default {
|
|
|
{
|
|
|
flighttype: data.flighttype,
|
|
|
fd1: data.dateTime[0],
|
|
|
- fd2: data.dateTime[1]
|
|
|
+ fd2: data.dateTime[1],
|
|
|
},
|
|
|
];
|
|
|
- let typeName = null
|
|
|
+ let typeName = null;
|
|
|
switch (data.fttp) {
|
|
|
case 52221:
|
|
|
- typeName = '国内出港'
|
|
|
+ typeName = "国内出港";
|
|
|
break;
|
|
|
case 52222:
|
|
|
- typeName = '国内进港'
|
|
|
+ typeName = "国内进港";
|
|
|
break;
|
|
|
case 52223:
|
|
|
- typeName = '国际出港'
|
|
|
+ typeName = "国际出港";
|
|
|
break;
|
|
|
case 52224:
|
|
|
- typeName = '国际进港'
|
|
|
+ typeName = "国际进港";
|
|
|
break;
|
|
|
default:
|
|
|
- typeName = '国内出港'
|
|
|
+ typeName = "国内出港";
|
|
|
break;
|
|
|
}
|
|
|
- this.tableSortMsg = setSortMsg(typeName)
|
|
|
+ this.tableSortMsg = setSortMsg(typeName);
|
|
|
this.searchParams = {
|
|
|
typeName,
|
|
|
flighttype: data.flighttype,
|
|
|
fd1: data.dateTime[0],
|
|
|
- fd2: data.dateTime[1]
|
|
|
- }
|
|
|
+ fd2: data.dateTime[1],
|
|
|
+ };
|
|
|
this.getQuery(data.fttp, option, typeName, this.searchParams);
|
|
|
},
|
|
|
//获取表格数据
|
|
|
- async getQuery (id, data, dat, params) {
|
|
|
+ async getQuery(id, data, dat, params) {
|
|
|
try {
|
|
|
- this.loading = true
|
|
|
+ this.loading = true;
|
|
|
const { code, returnData } = await Query({
|
|
|
id: Number(id),
|
|
|
dataContent: data,
|
|
@@ -192,46 +213,46 @@ export default {
|
|
|
this.tableData.time = [];
|
|
|
this.tableData.data1 = [];
|
|
|
this.tableData.data2 = [];
|
|
|
- returnData.forEach(item => {
|
|
|
+ returnData.forEach((item) => {
|
|
|
for (const key in item) {
|
|
|
if (Object.hasOwnProperty.call(item, key)) {
|
|
|
const element = item[key];
|
|
|
- if (key.includes('lv') && !element) {
|
|
|
- item[key] = 0.00
|
|
|
- } else if (!key.includes('lv') && !element) {
|
|
|
- item[key] = 0
|
|
|
+ if (key.includes("lv") && !element) {
|
|
|
+ item[key] = 0.0;
|
|
|
+ } else if (!key.includes("lv") && !element) {
|
|
|
+ item[key] = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
this.tableList = _.cloneDeep(returnData);
|
|
|
this.tableListcop = _.cloneDeep(returnData);
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
const catchMap = {
|
|
|
k1: _.assign(data[0], { fttp: id }),
|
|
|
k2: returnData,
|
|
|
k3: dat,
|
|
|
- k4: params
|
|
|
- }
|
|
|
- sessionStorage.setItem(this.$route.name, JSON.stringify(catchMap))
|
|
|
+ k4: params,
|
|
|
+ };
|
|
|
+ sessionStorage.setItem(this.$route.name, JSON.stringify(catchMap));
|
|
|
} else {
|
|
|
- this.loading = false
|
|
|
- console.log(code)
|
|
|
+ this.loading = false;
|
|
|
+ console.log(code);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
this.page--;
|
|
|
}
|
|
|
},
|
|
|
//导出
|
|
|
- tableToExcel (refName) {
|
|
|
+ tableToExcel(refName) {
|
|
|
import("@/utils/Export2Excel").then((excel) => {
|
|
|
const table = this.$refs[refName].$el.cloneNode(true);
|
|
|
const fileName = `${this.listname}.xlsx`;
|
|
|
- exportToExcel(table, '航班统计', fileName);
|
|
|
+ exportToExcel(table, "航班统计", fileName);
|
|
|
});
|
|
|
},
|
|
|
- upset (data) {
|
|
|
+ upset(data) {
|
|
|
this.picShow = data;
|
|
|
},
|
|
|
},
|