|
@@ -137,9 +137,11 @@ import formMixin from "../../mixins/form";
|
|
|
import tableColsMixin from "../../mixins/tableCols";
|
|
|
import timeZoneMixin from "../../mixins/timeZone";
|
|
|
import { getQuery } from "@/api/flight";
|
|
|
+import { GeneralDataReception } from "@/api/dataIntegration";
|
|
|
import TableHeaderCell from "@/components/TableHeaderCell";
|
|
|
-import { setTableFilters, throttledExportToExcel } from "@/utils/table";
|
|
|
-
|
|
|
+import { setTableFilters, throttledExportToExcel, timeInZone } from "@/utils/table";
|
|
|
+import { parseTime } from '@/utils/index';
|
|
|
+import { mapGetters } from 'vuex';
|
|
|
export default {
|
|
|
name: "DepartureTerminalView",
|
|
|
components: { Dialog, TimeZoneSelector, TableHeaderCell },
|
|
@@ -290,12 +292,14 @@ export default {
|
|
|
baggageCount: 0,
|
|
|
hasSetTableScroll: false,
|
|
|
table: null,
|
|
|
+ WarningData: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
singleDay () {
|
|
|
return this.startDate === this.endDate;
|
|
|
},
|
|
|
+ ...mapGetters(['timeZone'])
|
|
|
},
|
|
|
mounted () {
|
|
|
this.getAirPortData();
|
|
@@ -308,6 +312,7 @@ export default {
|
|
|
activated () {
|
|
|
this.table.scrollTop = this.scrollTop;
|
|
|
this.getTableData();
|
|
|
+ this.getWarningData();
|
|
|
this.loopEvent = setInterval(this.getTableData, LOOP_INTERVAL.departureTable);
|
|
|
},
|
|
|
deactivated () {
|
|
@@ -353,6 +358,22 @@ export default {
|
|
|
this.$message.error("失败");
|
|
|
}
|
|
|
},
|
|
|
+ async getWarningData () {
|
|
|
+ try {
|
|
|
+ const res = await getQuery({
|
|
|
+ id: DATACONTENT_ID.departureWarningId,
|
|
|
+ dataContent: [],
|
|
|
+ });
|
|
|
+ if (Number(res.code) === 0) {
|
|
|
+ const { listValues } = res.returnData;
|
|
|
+ this.WarningData = listValues;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error("失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
tableRowClassName ({ row, rowIndex }) {
|
|
|
const classes = [];
|
|
|
if (row.flightStatus === "DLY") {
|
|
@@ -417,14 +438,56 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
initTableData (tableData) {
|
|
|
+ const currentTime = new Date();
|
|
|
+ const curTime = this.formatTime(currentTime);
|
|
|
this.leaveCount = 0;
|
|
|
this.baggageCount = 0;
|
|
|
tableData.forEach((item) => {
|
|
|
item["flightCanceled"] = item["flightStatus"] === "CAN" ? 1 : 0;
|
|
|
item["tounLoad"] -= item["OFFCount"];
|
|
|
+ item["exceptions"] = item["preLoad"] - item["boardID"];
|
|
|
if (item["hasTakeOff"] === 1 && !item["flightCanceled"]) {
|
|
|
this.leaveCount++;
|
|
|
}
|
|
|
+ if (item["hasTakeOff"] !== 1 && !item["flightCanceled"] && item["preLoad"] - Math.max(item.loadNumber, item.boardID) > 0) {
|
|
|
+ this.WarningData.forEach(p => {
|
|
|
+ const startTime = this.formatTime(timeInZone((p.startDate ?? '').replace('T', ' '), this.timeZone), 2);
|
|
|
+ const endTime = this.formatTime(timeInZone((p.endDate ?? '').replace('T', ' '), this.timeZone), 2);
|
|
|
+ const planTime = this.formatTime(timeInZone((item.planDepartureTime ?? '').replace('T', ' '), this.timeZone), 2);
|
|
|
+ const capTime = Math.ceil((planTime - curTime) / (1000 * 60));
|
|
|
+ if (Number(startTime) - Number(curTime) < 0 && Number(endTime) - Number(curTime) > 0) {
|
|
|
+ if (p.flightNO != '' && p.flightNO == item.flightNO) {
|
|
|
+ if (capTime - p.warningDuration < 0 && capTime - p.alarmDuration > 0) {
|
|
|
+ item["warning"] = item["preLoad"] - Math.max(item.loadNumber, item.boardID);
|
|
|
+ item["warningState"] = 1;
|
|
|
+ const returnedTarget = Object.assign(item, p);
|
|
|
+ this.sendLog(returnedTarget);
|
|
|
+ }
|
|
|
+ if (capTime - p.alarmDuration < 0) {
|
|
|
+ item["warning"] = item["preLoad"] - Math.max(item.loadNumber, item.boardID);
|
|
|
+ item["warningState"] = 2;
|
|
|
+ const returnedTarget = Object.assign(item, p);
|
|
|
+ this.sendLog(returnedTarget);
|
|
|
+ }
|
|
|
+ } else if (p.flightNO == '' && p.IATACode != '') {
|
|
|
+ if (item.flightNO.substring(0, 2) == p.IATACode) {
|
|
|
+ if (capTime - p.warningDuration < 0 && capTime - p.alarmDuration > 0) {
|
|
|
+ item["warning"] = item["preLoad"] - Math.max(item.loadNumber, item.boardID);
|
|
|
+ item["warningState"] = 1;
|
|
|
+ const returnedTarget = Object.assign(item, p);
|
|
|
+ this.sendLog(returnedTarget);
|
|
|
+ }
|
|
|
+ if (capTime - p.alarmDuration < 0) {
|
|
|
+ item["warning"] = item["preLoad"] - Math.max(item.loadNumber, item.boardID);
|
|
|
+ item["warningState"] = 2;
|
|
|
+ const returnedTarget = Object.assign(item, p);
|
|
|
+ this.sendLog(returnedTarget);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
this.baggageCount = this.baggageCount + item.preLoad;
|
|
|
});
|
|
|
this.tableData = this._.orderBy(tableData, ["hasTakeOff", "planDepartureTime"], ["desc", "asc"]);
|
|
@@ -434,6 +497,35 @@ export default {
|
|
|
this.setTableScroll();
|
|
|
});
|
|
|
},
|
|
|
+ formatTime (date, type = 1) {
|
|
|
+ let time = null;
|
|
|
+ if (type == 1) {
|
|
|
+ time = parseTime(date, "{y}-{m}-{d} {h}:{i}:{s}");
|
|
|
+ } else {
|
|
|
+ time = date;
|
|
|
+ }
|
|
|
+ const newTimt = new Date(time);
|
|
|
+ return newTimt.getTime();
|
|
|
+ },
|
|
|
+ async sendLog (obj) {
|
|
|
+ try {
|
|
|
+ const newObj = {
|
|
|
+ logTime: parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}"),
|
|
|
+ logInfo: obj,
|
|
|
+ flightNO: obj.flightNO,
|
|
|
+ flightDate: obj.flightDate,
|
|
|
+ luggageSN: '',
|
|
|
+ strategyUseID: obj.alarmStrategyID,
|
|
|
+ event: 1
|
|
|
+ }
|
|
|
+ await GeneralDataReception({
|
|
|
+ serviceId: SERVICE_ID.departureScId,
|
|
|
+ dataContent: JSON.stringify(newObj),
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error("失败");
|
|
|
+ }
|
|
|
+ },
|
|
|
setTableScroll () {
|
|
|
if (!this.singleDay || this.hasSetTableScroll || this.leaveCount === 0) {
|
|
|
return;
|
|
@@ -679,6 +771,20 @@ export default {
|
|
|
border: 2px dashed red;
|
|
|
}
|
|
|
}
|
|
|
+ td.cell-tounLoadNew {
|
|
|
+ background: #fcf0b1 !important;
|
|
|
+ position: relative;
|
|
|
+ &::after {
|
|
|
+ content: "";
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ border: 2px dashed #e28913;
|
|
|
+ }
|
|
|
+ }
|
|
|
.el-table__cell.is-hidden > * {
|
|
|
visibility: visible;
|
|
|
}
|