Browse Source

实时视图对接口

zhongxiaoyu 2 years ago
parent
commit
15cf061e50

+ 30 - 21
public/demo.js

@@ -1,12 +1,12 @@
 /* url配置 */
 /* url配置 */
 const PLATFROM_CONFIG = {
 const PLATFROM_CONFIG = {
-  baseNewUrl: "http://120.26.64.82:8093/", //登录前的http请求地址
-  baseUrl: "http://120.26.64.82:8095/", // 4A-http请求地址
-  appKeyString: "9inu7zpllz1folzsljm498dcpi0lsog1", //appSecret
-  appId: "q7kdjmmaf0kerwpf", //appid
-  baseURLCA: "http://10.211.67.163:16300", // 登录后的http请求地址-测试
-  baggageMessageURL: "/openApi/query",
-};
+  baseNewUrl: 'http://120.26.64.82:8093/', //登录前的http请求地址
+  baseUrl: 'http://120.26.64.82:8095/', // 4A-http请求地址
+  appKeyString: '9inu7zpllz1folzsljm498dcpi0lsog1', //appSecret
+  appId: 'q7kdjmmaf0kerwpf', //appid
+  baseURLCA: 'http://10.211.67.163:16300', // 登录后的http请求地址-测试
+  baggageMessageURL: '/openApi/query',
+}
 
 
 /* 轮询间隔 */
 /* 轮询间隔 */
 const LOOP_INTERVAL = {
 const LOOP_INTERVAL = {
@@ -14,7 +14,7 @@ const LOOP_INTERVAL = {
   internationalDepartureAirport: 30 * 1000,
   internationalDepartureAirport: 30 * 1000,
   arrivalAirport: 30 * 1000,
   arrivalAirport: 30 * 1000,
   internationalArrivalAirport: 30 * 1000,
   internationalArrivalAirport: 30 * 1000,
-};
+}
 
 
 const DATACONTENT_ID = {
 const DATACONTENT_ID = {
   /***-----登录------***/
   /***-----登录------***/
@@ -144,17 +144,26 @@ const DATACONTENT_ID = {
   // containerBaggage: 18027,
   // containerBaggage: 18027,
 
 
   /***-----综合可视化------***/
   /***-----综合可视化------***/
-  departureAirport: 1803446, // 国内出港航站
-  internationalDepartureAirport: 1803447, // 国际出港航站
-  arrivalAirport: 1803448, // 国内进港航站
-  internationalArrivalAirport: 1803449, // 国际进港航站
-  flightInfo: 100001, // 航班基础信息
-  flightContainer: 100002, // 航班容器列表
-  flightWaybill: 100003, // 航班运单列表
-  waybillInfo: 100004, // 运单基础信息
-  waybillAirline: 100005, // 运单航段
-  waybillTrack: 100006, // 运单节点跟踪
-  waybillGoods: 100007, // 运单货物列表
+  // 航站
+  departureAirport: 1803507, // 国内出港航站
+  internationalDepartureAirport: 1803508, // 国际出港航站
+  arrivalAirport: 1803505, // 国内进港航站
+  internationalArrivalAirport: 1803506, // 国际进港航站
+  // 航班
+  departureFlightInfo: 1803511, // 国内离港航班基础信息
+  departureFlightContainer: 1803512, // 国内离港航班集装器
+  departureFlightWaybill: 1803513, // 国内离港航班运单
+  internationalDepartureFlightInfo: 1803511, // 国际离港航班基础信息
+  internationalDepartureFlightContainer: 1803512, // 国际离港航班集装器
+  internationalDepartureFlightWaybill: 1803513, // 国际离港航班运单
+  arrivalFlightInfo: 1803509, // 国内进港航班基础信息
+  arrivalFlightWaybill: 1803510, // 国内进港航班运单
+  internationalArrivalFlightInfo: 1803509, // 国际进港航班基础信息
+  internationalArrivalFlightWaybill: 1803510, // 国际进港航班运单
+  // 运单
+  waybillInfo: 1803514, // 运单基础信息
+  waybillGoods: 1803515, // 运单节点跟踪
+  // 货物
   goodsInfo: 100008, // 货物基础信息
   goodsInfo: 100008, // 货物基础信息
   goodsAirline: 100009, // 货物航段
   goodsAirline: 100009, // 货物航段
   goodsTrack: 100010, // 货物节点跟踪
   goodsTrack: 100010, // 货物节点跟踪
@@ -222,7 +231,7 @@ const DATACONTENT_ID = {
   nodeExportAirline: 1805, // 节点统计导出-航线
   nodeExportAirline: 1805, // 节点统计导出-航线
   nodeExportAirport: 1805, // 节点统计导出-航站
   nodeExportAirport: 1805, // 节点统计导出-航站
   nodeAxisDesc: 90, // 节点统计指示器名称解释
   nodeAxisDesc: 90, // 节点统计指示器名称解释
-};
+}
 
 
 const SERVICE_ID = {
 const SERVICE_ID = {
   /***-----账号管理------***/
   /***-----账号管理------***/
@@ -257,4 +266,4 @@ const SERVICE_ID = {
 
 
   /***-----离港管理------***/
   /***-----离港管理------***/
   departureScId: 8011, //发送报警预警日志信息
   departureScId: 8011, //发送报警预警日志信息
-};
+}

+ 2 - 2
src/components/table/index.vue

@@ -24,8 +24,8 @@
       </div>
       </div>
       <div class="foot right Delfoot">
       <div class="foot right Delfoot">
-        <el-button size="medium" class="r24" @click="tableRemove" type="danger">删除</el-button>
-        <el-button size="medium" @click="rmFlag = false">取消</el-button>
+        <el-button size="default" class="r24" @click="tableRemove" type="danger">删除</el-button>
+        <el-button size="default" @click="rmFlag = false">取消</el-button>
       </div>
       </div>
     </div>
     </div>
   </Dialog>
   </Dialog>

+ 1 - 1
src/layout/components/NavBarTop/index.vue

@@ -11,7 +11,7 @@
         <el-avatar class="appNav-avatar" :size="25" :src="imgUrl" @error="errorHandler">
         <el-avatar class="appNav-avatar" :size="25" :src="imgUrl" @error="errorHandler">
           <img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" />
           <img src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png" />
         </el-avatar>
         </el-avatar>
-        <el-dropdown trigger="click" size="medium">
+        <el-dropdown trigger="click" size="default">
           <div class="avatar-wrapper">
           <div class="avatar-wrapper">
             <span class="name">{{name}}</span>
             <span class="name">{{name}}</span>
             <ArrowDownBold style="width: 1.2em; height: 1.3em;" />
             <ArrowDownBold style="width: 1.2em; height: 1.3em;" />

+ 22 - 6
src/views/realTime/components/AirportView/index.vue

@@ -5,12 +5,12 @@
       <div class="airport-count">
       <div class="airport-count">
         <CountBox
         <CountBox
           :count-number="tableDataCount.waybillCount"
           :count-number="tableDataCount.waybillCount"
-          label="预计装载总运单数"
+          :label="isDeparture ? '预计装载总运单数' : '预计卸载总运单数'"
         />
         />
         <CountBox
         <CountBox
           v-show="goodsCountFlag"
           v-show="goodsCountFlag"
           :count-number="tableDataCount.goodsCount"
           :count-number="tableDataCount.goodsCount"
-          label="预计装载总件数"
+          :label="isDeparture ? '预计装载总件数' : '预计卸载总件数'"
         />
         />
       </div>
       </div>
       <div class="airport-settings">
       <div class="airport-settings">
@@ -36,7 +36,7 @@
             :data="dealedTableData"
             :data="dealedTableData"
             :width="width"
             :width="width"
             :height="height"
             :height="height"
-            :fixed="name.includes('Departure')"
+            :fixed="isDeparture"
             :footer-height="60"
             :footer-height="60"
             :row-class="rowClassV2"
             :row-class="rowClassV2"
             :cell-props="cellPropsGetter"
             :cell-props="cellPropsGetter"
@@ -56,7 +56,9 @@
                 class="el-table-v2__cell-text"
                 class="el-table-v2__cell-text"
                 @click="cellClickHandlerV2(slot)"
                 @click="cellClickHandlerV2(slot)"
               >
               >
-                {{ slot.rowData[slot.column.columnName] }}
+                <el-tooltip :content="slot.rowData[slot.column.columnName]">
+                  {{ slot.rowData[slot.column.columnName] }}
+                </el-tooltip>
               </div>
               </div>
             </template>
             </template>
             <template #footer>
             <template #footer>
@@ -103,6 +105,8 @@ const props = defineProps({
   },
   },
 })
 })
 
 
+const isDeparture = props.name.includes('Departure')
+
 const formData = reactive<CommonData>({})
 const formData = reactive<CommonData>({})
 const formDataChangeHandler = (data: CommonData) => {
 const formDataChangeHandler = (data: CommonData) => {
   Object.assign(formData, data)
   Object.assign(formData, data)
@@ -119,8 +123,20 @@ const cellPropsGetter = params => ({
 })
 })
 
 
 const tableDataCount = computed(() => ({
 const tableDataCount = computed(() => ({
-  waybillCount: tableData.value.length,
-  goodsCount: tableData.value.length,
+  waybillCount: tableData.value.reduce((count, current) => {
+    const countValue = current[isDeparture ? 'preLoad' : 'preUnload']
+    if (countValue) {
+      count += Number(String(countValue).split('/')[0])
+    }
+    return count
+  }, 0),
+  goodsCount: tableData.value.reduce((count, current) => {
+    const countValue = current[isDeparture ? 'preLoad' : 'preUnload']
+    if (countValue) {
+      count += Number(String(countValue).split('/')[1])
+    }
+    return count
+  }, 0),
   flightCount: tableData.value.length,
   flightCount: tableData.value.length,
   freightFlightCount: tableData.value.length,
   freightFlightCount: tableData.value.length,
   loadCount: tableData.value.length,
   loadCount: tableData.value.length,

+ 171 - 146
src/views/realTime/components/AirportView/useAirportTable.ts

@@ -17,6 +17,11 @@ const columnGroupsMap: {
     {
     {
       groupName: '航班相关',
       groupName: '航班相关',
       children: [
       children: [
+        {
+          columnName: 'IATACode',
+          columnLabel: '航司',
+          needFilters: 1,
+        },
         {
         {
           columnName: 'flightNO',
           columnName: 'flightNO',
           columnLabel: '航班号',
           columnLabel: '航班号',
@@ -33,7 +38,7 @@ const columnGroupsMap: {
           width: 73,
           width: 73,
         },
         },
         {
         {
-          columnName: 'landingAirport',
+          columnName: 'target',
           columnLabel: '目的站',
           columnLabel: '目的站',
           needFilters: 1,
           needFilters: 1,
         },
         },
@@ -42,11 +47,11 @@ const columnGroupsMap: {
           columnLabel: '停机位',
           columnLabel: '停机位',
         },
         },
         {
         {
-          columnName: 'inFlightNO',
+          columnName: 'lastflightNO',
           columnLabel: '前序航班',
           columnLabel: '前序航班',
         },
         },
         {
         {
-          columnName: 'planLandingTime',
+          columnName: 'acLandingTime',
           columnLabel: '实际降落\n时间',
           columnLabel: '实际降落\n时间',
           width: 73,
           width: 73,
         },
         },
@@ -56,19 +61,19 @@ const columnGroupsMap: {
       groupName: '货站相关',
       groupName: '货站相关',
       children: [
       children: [
         {
         {
-          columnName: 'C1',
+          columnName: 'speCargoInfo',
           columnLabel: '特货信息',
           columnLabel: '特货信息',
         },
         },
         {
         {
-          columnName: 'C2',
+          columnName: 'preLoad',
           columnLabel: '预计装载数\n(运单/件)',
           columnLabel: '预计装载数\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C3',
+          columnName: 'transIn',
           columnLabel: '中转进\n(运单/件)',
           columnLabel: '中转进\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C4',
+          columnName: 'returns',
           columnLabel: '退运\n(板卡/件)',
           columnLabel: '退运\n(板卡/件)',
         },
         },
       ],
       ],
@@ -77,127 +82,127 @@ const columnGroupsMap: {
       groupName: '地服相关',
       groupName: '地服相关',
       children: [
       children: [
         {
         {
-          columnName: 'C5',
+          columnName: 'receiveSure',
           columnLabel: '收运核单\n(运单/件/重量)',
           columnLabel: '收运核单\n(运单/件/重量)',
         },
         },
         {
         {
-          columnName: 'C5_time',
+          columnName: 'receiveSureTime',
           columnLabel: '收运核单\n时间',
           columnLabel: '收运核单\n时间',
         },
         },
         {
         {
-          columnName: 'C5_1',
+          columnName: 'receiveSure_No',
           columnLabel: '核单不通过\n(运单/件/重量)',
           columnLabel: '核单不通过\n(运单/件/重量)',
         },
         },
         {
         {
-          columnName: 'C5_1_time',
+          columnName: 'receiveSureTime_No',
           columnLabel: '核单不通过\n时间',
           columnLabel: '核单不通过\n时间',
         },
         },
         {
         {
-          columnName: 'C6',
+          columnName: 'checks',
           columnLabel: '查验\n(拒运/查验)',
           columnLabel: '查验\n(拒运/查验)',
         },
         },
         {
         {
-          columnName: 'C6_time',
+          columnName: 'checkTime',
           columnLabel: '查验时间',
           columnLabel: '查验时间',
         },
         },
         {
         {
-          columnName: 'C7',
+          columnName: 'securityYes',
           columnLabel: '安检放行\n(运单/件)',
           columnLabel: '安检放行\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C7_time',
+          columnName: 'securityTime',
           columnLabel: '安检放行\n时间',
           columnLabel: '安检放行\n时间',
         },
         },
         {
         {
-          columnName: 'C8',
+          columnName: 'addCargo',
           columnLabel: '加货\n(运单/板卡/件/重量)',
           columnLabel: '加货\n(运单/板卡/件/重量)',
         },
         },
         {
         {
-          columnName: 'C8_time',
+          columnName: 'addCargoTime',
           columnLabel: '加货时间',
           columnLabel: '加货时间',
         },
         },
         {
         {
-          columnName: 'C9',
+          columnName: 'wait',
           columnLabel: '待运区\n(板卡/件)',
           columnLabel: '待运区\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C9_time',
+          columnName: 'waitTime',
           columnLabel: '待运区时间',
           columnLabel: '待运区时间',
         },
         },
         {
         {
-          columnName: 'C10',
+          columnName: 'stowage',
           columnLabel: '预配载\n(板卡/件)',
           columnLabel: '预配载\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C10_time',
+          columnName: 'stowageTime',
           columnLabel: '预配载时间',
           columnLabel: '预配载时间',
         },
         },
         {
         {
-          columnName: 'C11',
+          columnName: 'planJoinTime',
           columnLabel: '计划交接\n时间',
           columnLabel: '计划交接\n时间',
         },
         },
         {
         {
-          columnName: 'C12_0',
+          columnName: 'requestDepotJoin',
           columnLabel: '发起货站交接\n(板卡/件)',
           columnLabel: '发起货站交接\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C12_0_time',
+          columnName: 'requestDepotJoinTime',
           columnLabel: '发起货站交接\n时间',
           columnLabel: '发起货站交接\n时间',
         },
         },
         {
         {
-          columnName: 'C12',
+          columnName: 'depotJoin',
           columnLabel: '货站交接\n(板卡/件)',
           columnLabel: '货站交接\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C12_time',
+          columnName: 'depotJoinTime',
           columnLabel: '货站交接\n时间',
           columnLabel: '货站交接\n时间',
         },
         },
         {
         {
-          columnName: 'C13',
+          columnName: 'resure',
           columnLabel: '运输前复核\n(板卡/件)',
           columnLabel: '运输前复核\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C13_time',
+          columnName: 'resureTime',
           columnLabel: '运输前复核\n时间',
           columnLabel: '运输前复核\n时间',
         },
         },
         {
         {
-          columnName: 'C14',
+          columnName: 'planeDown',
           columnLabel: '机下交接\n(板卡/件)',
           columnLabel: '机下交接\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C14_time',
+          columnName: 'planeDownTime',
           columnLabel: '机下交接\n时间',
           columnLabel: '机下交接\n时间',
         },
         },
         {
         {
-          columnName: 'C15_0',
+          columnName: 'loadPlaneSure',
           columnLabel: '装机单确认\n(板卡/件)',
           columnLabel: '装机单确认\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C15_0_time',
+          columnName: 'loadPlaneSureTime',
           columnLabel: '装机单确认\n时间',
           columnLabel: '装机单确认\n时间',
         },
         },
         {
         {
-          columnName: 'C15',
+          columnName: 'loadPlane',
           columnLabel: '装机\n(板卡/件)',
           columnLabel: '装机\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C15_time',
+          columnName: 'loadPlaneTime',
           columnLabel: '装机时间',
           columnLabel: '装机时间',
         },
         },
         {
         {
-          columnName: 'C16',
+          columnName: 'register',
           columnLabel: '拉下登记\n(板卡/件)',
           columnLabel: '拉下登记\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C16_time',
+          columnName: 'pullRegisterTime',
           columnLabel: '拉下登记\n时间',
           columnLabel: '拉下登记\n时间',
         },
         },
         {
         {
-          columnName: 'C17',
+          columnName: 'pullSure',
           columnLabel: '拉回确认\n(板卡/件)',
           columnLabel: '拉回确认\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C17_time',
+          columnName: 'pullSureTime',
           columnLabel: '拉回确认\n时间',
           columnLabel: '拉回确认\n时间',
         },
         },
       ],
       ],
@@ -207,6 +212,11 @@ const columnGroupsMap: {
     {
     {
       groupName: '航班相关',
       groupName: '航班相关',
       children: [
       children: [
+        {
+          columnName: 'IATACode',
+          columnLabel: '航司',
+          needFilters: 1,
+        },
         {
         {
           columnName: 'flightNO',
           columnName: 'flightNO',
           columnLabel: '航班号',
           columnLabel: '航班号',
@@ -223,7 +233,7 @@ const columnGroupsMap: {
           width: 73,
           width: 73,
         },
         },
         {
         {
-          columnName: 'landingAirport',
+          columnName: 'target',
           columnLabel: '目的站',
           columnLabel: '目的站',
           needFilters: 1,
           needFilters: 1,
         },
         },
@@ -232,11 +242,11 @@ const columnGroupsMap: {
           columnLabel: '停机位',
           columnLabel: '停机位',
         },
         },
         {
         {
-          columnName: 'inFlightNO',
+          columnName: 'lastflightNO',
           columnLabel: '前序航班',
           columnLabel: '前序航班',
         },
         },
         {
         {
-          columnName: 'planLandingTime',
+          columnName: 'acLandingTime',
           columnLabel: '实际降落\n时间',
           columnLabel: '实际降落\n时间',
           width: 73,
           width: 73,
         },
         },
@@ -246,19 +256,19 @@ const columnGroupsMap: {
       groupName: '货站相关',
       groupName: '货站相关',
       children: [
       children: [
         {
         {
-          columnName: 'C1',
+          columnName: 'speCargoInfo',
           columnLabel: '特货信息',
           columnLabel: '特货信息',
         },
         },
         {
         {
-          columnName: 'C2',
+          columnName: 'preLoad',
           columnLabel: '预计装载数\n(运单/件)',
           columnLabel: '预计装载数\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C3',
+          columnName: 'transIn',
           columnLabel: '中转进\n(运单/件)',
           columnLabel: '中转进\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C4',
+          columnName: 'returns1',
           columnLabel: '退运\n(板卡/件)',
           columnLabel: '退运\n(板卡/件)',
         },
         },
       ],
       ],
@@ -267,159 +277,159 @@ const columnGroupsMap: {
       groupName: '地服相关',
       groupName: '地服相关',
       children: [
       children: [
         {
         {
-          columnName: 'C5',
+          columnName: 'enterPark',
           columnLabel: '入园\n(运单/件)',
           columnLabel: '入园\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C5_time',
+          columnName: 'enterParkTime',
           columnLabel: '入园时间',
           columnLabel: '入园时间',
         },
         },
         {
         {
-          columnName: 'C6',
+          columnName: 'enterCustoms',
           columnLabel: '进入海关\n(运单/件)',
           columnLabel: '进入海关\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C6_time',
+          columnName: 'enterCustomsTime',
           columnLabel: '进入海关时间',
           columnLabel: '进入海关时间',
         },
         },
         {
         {
-          columnName: 'C7',
+          columnName: 'passCustoms',
           columnLabel: '海关放行\n(运单/件)',
           columnLabel: '海关放行\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C7_time',
+          columnName: 'passCustomsTime',
           columnLabel: '海关放行\n时间',
           columnLabel: '海关放行\n时间',
         },
         },
         {
         {
-          columnName: 'C8',
+          columnName: 'nopassCustoms',
           columnLabel: '海关不通过\n(运单/件)',
           columnLabel: '海关不通过\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C8_time',
+          columnName: 'nopassCustomsTime',
           columnLabel: '海关不通过\n时间',
           columnLabel: '海关不通过\n时间',
         },
         },
         {
         {
-          columnName: 'C9',
+          columnName: 'receiveSure1',
           columnLabel: '运抵货站\n(运单/件)',
           columnLabel: '运抵货站\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C9_time',
+          columnName: 'receiveSureTime',
           columnLabel: '运抵货站\n时间',
           columnLabel: '运抵货站\n时间',
         },
         },
         {
         {
-          columnName: 'C10',
+          columnName: 'returns2',
           columnLabel: '退运\n(板卡/件)',
           columnLabel: '退运\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C10_time',
+          columnName: 'returnTime',
           columnLabel: '退运时间',
           columnLabel: '退运时间',
         },
         },
         {
         {
-          columnName: 'C11',
+          columnName: 'securityYes',
           columnLabel: '安检放行\n(运单/件)',
           columnLabel: '安检放行\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C11_time',
+          columnName: 'securityTime',
           columnLabel: '安检放行\n时间',
           columnLabel: '安检放行\n时间',
         },
         },
         {
         {
-          columnName: 'C12',
+          columnName: 'receiveSure2',
           columnLabel: '收运核单\n(运单/件)',
           columnLabel: '收运核单\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C12_time',
+          columnName: 'receiveSureResultTime',
           columnLabel: '收运核单\n时间',
           columnLabel: '收运核单\n时间',
         },
         },
         {
         {
-          columnName: 'C13',
+          columnName: 'receiveSure_No',
           columnLabel: '核单不通过\n(运单/件)',
           columnLabel: '核单不通过\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C13_time',
+          columnName: 'receiveSureTime_No',
           columnLabel: '核单不通过\n时间',
           columnLabel: '核单不通过\n时间',
         },
         },
         {
         {
-          columnName: 'C14',
+          columnName: 'tally_out',
           columnLabel: '理货\n(板卡/运单/件)',
           columnLabel: '理货\n(板卡/运单/件)',
         },
         },
         {
         {
-          columnName: 'C14_time',
+          columnName: 'tallyTime_out',
           columnLabel: '理货时间',
           columnLabel: '理货时间',
         },
         },
         {
         {
-          columnName: 'C15',
+          columnName: 'planJoinTime',
           columnLabel: '计划交接\n时间',
           columnLabel: '计划交接\n时间',
         },
         },
         {
         {
-          columnName: 'C16',
+          columnName: 'wait',
           columnLabel: '待运区\n(板卡/件)',
           columnLabel: '待运区\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C16_time',
+          columnName: 'waitTime',
           columnLabel: '待运区\n时间',
           columnLabel: '待运区\n时间',
         },
         },
         {
         {
-          columnName: 'C17',
+          columnName: 'stowage',
           columnLabel: '预配载\n(板卡/件)',
           columnLabel: '预配载\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C17_time',
+          columnName: 'stowageTime',
           columnLabel: '预配载时间',
           columnLabel: '预配载时间',
         },
         },
         {
         {
-          columnName: 'C18',
+          columnName: "concat(requestDepotJoinBoard,'/',requestDepotJoin)",
           columnLabel: '发起货站交接\n(板卡/件)',
           columnLabel: '发起货站交接\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C18_time',
+          columnName: 'requestDepotJoinTime',
           columnLabel: '发起货站交接\n时间',
           columnLabel: '发起货站交接\n时间',
         },
         },
         {
         {
-          columnName: 'C19',
+          columnName: 'depotJoin',
           columnLabel: '货站交接\n(板卡/件)',
           columnLabel: '货站交接\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C19_time',
+          columnName: 'depotJoinTime',
           columnLabel: '货站交接\n时间',
           columnLabel: '货站交接\n时间',
         },
         },
         {
         {
-          columnName: 'C20',
+          columnName: 'resure',
           columnLabel: '运输前复核\n(板卡/件)',
           columnLabel: '运输前复核\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C20_time',
+          columnName: 'resureTime',
           columnLabel: '运输前复核\n时间',
           columnLabel: '运输前复核\n时间',
         },
         },
         {
         {
-          columnName: 'C21',
+          columnName: 'planeDown',
           columnLabel: '机下交接\n(板卡/件)',
           columnLabel: '机下交接\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C21_time',
+          columnName: 'planeDownTime',
           columnLabel: '机下交接\n时间',
           columnLabel: '机下交接\n时间',
         },
         },
         {
         {
-          columnName: 'C22',
+          columnName: "concat(loadPlaneSureBoard,'/',loadPlaneSure)",
           columnLabel: '装机单确认\n(板卡/件)',
           columnLabel: '装机单确认\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C22_time',
+          columnName: 'loadPlaneSureTime',
           columnLabel: '装机单确认\n时间',
           columnLabel: '装机单确认\n时间',
         },
         },
         {
         {
-          columnName: 'C23',
+          columnName: 'loadPlane',
           columnLabel: '装机\n(板卡/件)',
           columnLabel: '装机\n(板卡/件)',
         },
         },
         {
         {
-          columnName: 'C23_time',
+          columnName: 'loadPlaneTime',
           columnLabel: '装机时间',
           columnLabel: '装机时间',
         },
         },
         {
         {
-          columnName: 'C24',
+          columnName: 'register',
           columnLabel: '拉下登记\n(板卡/运单/件)',
           columnLabel: '拉下登记\n(板卡/运单/件)',
         },
         },
         {
         {
-          columnName: 'C24_time',
+          columnName: 'pullregisterTime',
           columnLabel: '拉下登记\n时间',
           columnLabel: '拉下登记\n时间',
         },
         },
       ],
       ],
@@ -429,6 +439,11 @@ const columnGroupsMap: {
     {
     {
       groupName: '航班相关',
       groupName: '航班相关',
       children: [
       children: [
+        {
+          columnName: 'IATACode',
+          columnLabel: '航司',
+          needFilters: 1,
+        },
         {
         {
           columnName: 'flightNO',
           columnName: 'flightNO',
           columnLabel: '航班号',
           columnLabel: '航班号',
@@ -443,7 +458,7 @@ const columnGroupsMap: {
           columnLabel: '降落时间',
           columnLabel: '降落时间',
         },
         },
         {
         {
-          columnName: 'landingAirport',
+          columnName: 'target',
           columnLabel: '目的站',
           columnLabel: '目的站',
           needFilters: 1,
           needFilters: 1,
         },
         },
@@ -457,19 +472,19 @@ const columnGroupsMap: {
       groupName: '货站相关',
       groupName: '货站相关',
       children: [
       children: [
         {
         {
-          columnName: 'C1',
+          columnName: 'speCargoInfo',
           columnLabel: '特货信息',
           columnLabel: '特货信息',
         },
         },
         {
         {
-          columnName: 'C2',
+          columnName: 'preUnLoad',
           columnLabel: '预计卸载数\n(运单/件)',
           columnLabel: '预计卸载数\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C3',
+          columnName: 'transOut',
           columnLabel: '中转出\n(运单/件)',
           columnLabel: '中转出\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C4',
+          columnName: 'receiveDiff',
           columnLabel: '收货差异\n(板卡/件)',
           columnLabel: '收货差异\n(板卡/件)',
         },
         },
       ],
       ],
@@ -477,52 +492,52 @@ const columnGroupsMap: {
     {
     {
       groupName: '地服相关',
       groupName: '地服相关',
       children: [
       children: [
+        // {
+        //   columnName: 'unloadBill',
+        //   columnLabel: '卸机单\n(板/箱/卡)',
+        // },
+        // {
+        //   columnName: 'unloadBillTime',
+        //   columnLabel: '卸机单确认\n时间',
+        // },
         {
         {
-          columnName: 'C5_0',
-          columnLabel: '卸机单\n(板/箱/卡)',
-        },
-        {
-          columnName: 'C5_0_time',
-          columnLabel: '卸机单确认\n时间',
-        },
-        {
-          columnName: 'C5',
+          columnName: 'unLoad',
           columnLabel: '卸机\n(板/箱/卡)',
           columnLabel: '卸机\n(板/箱/卡)',
         },
         },
         {
         {
-          columnName: 'C5_time',
+          columnName: 'unLoadTime',
           columnLabel: '卸机时间',
           columnLabel: '卸机时间',
         },
         },
         {
         {
-          columnName: 'C6',
+          columnName: 'planeDown',
           columnLabel: '机下交接\n(板/箱/卡)',
           columnLabel: '机下交接\n(板/箱/卡)',
         },
         },
         {
         {
-          columnName: 'C6_time',
+          columnName: 'planeDownTime_IN',
           columnLabel: '机下交接\n时间',
           columnLabel: '机下交接\n时间',
         },
         },
         {
         {
-          columnName: 'C7',
+          columnName: 'depotJoin',
           columnLabel: '货站交接\n(板/箱/卡)',
           columnLabel: '货站交接\n(板/箱/卡)',
         },
         },
         {
         {
-          columnName: 'C7_time',
+          columnName: 'depotJoinTime_IN',
           columnLabel: '货站交接\n时间',
           columnLabel: '货站交接\n时间',
         },
         },
         {
         {
-          columnName: 'C8',
+          columnName: 'tally',
           columnLabel: '理货\n(板卡/运单/件/重量)',
           columnLabel: '理货\n(板卡/运单/件/重量)',
         },
         },
         {
         {
-          columnName: 'C8_time',
+          columnName: 'tallyTime_in',
           columnLabel: '理货时间',
           columnLabel: '理货时间',
         },
         },
         {
         {
-          columnName: 'C9',
+          columnName: 'outWarehouse',
           columnLabel: '出库\n(批/运单/件)',
           columnLabel: '出库\n(批/运单/件)',
         },
         },
         {
         {
-          columnName: 'C9_time',
+          columnName: 'outWarehouseTime',
           columnLabel: '出库时间',
           columnLabel: '出库时间',
         },
         },
       ],
       ],
@@ -532,6 +547,11 @@ const columnGroupsMap: {
     {
     {
       groupName: '航班相关',
       groupName: '航班相关',
       children: [
       children: [
+        {
+          columnName: 'IATACode',
+          columnLabel: '航司',
+          needFilters: 1,
+        },
         {
         {
           columnName: 'flightNO',
           columnName: 'flightNO',
           columnLabel: '航班号',
           columnLabel: '航班号',
@@ -546,7 +566,7 @@ const columnGroupsMap: {
           columnLabel: '降落时间',
           columnLabel: '降落时间',
         },
         },
         {
         {
-          columnName: 'landingAirport',
+          columnName: 'target',
           columnLabel: '目的站',
           columnLabel: '目的站',
           needFilters: 1,
           needFilters: 1,
         },
         },
@@ -560,19 +580,19 @@ const columnGroupsMap: {
       groupName: '货站相关',
       groupName: '货站相关',
       children: [
       children: [
         {
         {
-          columnName: 'C1',
+          columnName: 'speCargoInfo',
           columnLabel: '特货信息',
           columnLabel: '特货信息',
         },
         },
         {
         {
-          columnName: 'C2',
+          columnName: 'preUnLoad',
           columnLabel: '预计卸载数\n(运单/件)',
           columnLabel: '预计卸载数\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C3',
+          columnName: 'transOut',
           columnLabel: '中转出\n(运单/件)',
           columnLabel: '中转出\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C4',
+          columnName: 'receiveDiff',
           columnLabel: '收货差异\n(板卡/件)',
           columnLabel: '收货差异\n(板卡/件)',
         },
         },
       ],
       ],
@@ -580,68 +600,68 @@ const columnGroupsMap: {
     {
     {
       groupName: '地服相关',
       groupName: '地服相关',
       children: [
       children: [
-        {
-          columnName: 'C5',
-          columnLabel: '卸机单\n(板/箱/卡)',
-        },
         // {
         // {
-        //   columnName: 'C5_time',
+        //   columnName: 'unloadBill',
+        //   columnLabel: '卸机单\n(板/箱/卡)',
+        // },
+        // {
+        //   columnName: 'unloadBillTime',
         //   columnLabel: '卸机时间',
         //   columnLabel: '卸机时间',
         // },
         // },
         {
         {
-          columnName: 'C6',
+          columnName: 'unLoad',
           columnLabel: '卸机\n(板/箱/卡)',
           columnLabel: '卸机\n(板/箱/卡)',
         },
         },
         {
         {
-          columnName: 'C6_time',
+          columnName: 'unLoadTime',
           columnLabel: '卸机时间',
           columnLabel: '卸机时间',
         },
         },
         {
         {
-          columnName: 'C7',
+          columnName: 'planeDown',
           columnLabel: '机下交接\n(板/箱/卡)',
           columnLabel: '机下交接\n(板/箱/卡)',
         },
         },
         {
         {
-          columnName: 'C7_time',
+          columnName: 'planeDownTime_IN',
           columnLabel: '机下交接\n时间',
           columnLabel: '机下交接\n时间',
         },
         },
         {
         {
-          columnName: 'C8',
+          columnName: 'depotJoin',
           columnLabel: '货站交接\n(板/箱/卡)',
           columnLabel: '货站交接\n(板/箱/卡)',
         },
         },
         {
         {
-          columnName: 'C8_time',
+          columnName: 'depotJoinTime_IN',
           columnLabel: '货站交接\n时间',
           columnLabel: '货站交接\n时间',
         },
         },
         {
         {
-          columnName: 'C9',
+          columnName: 'tally',
           columnLabel: '理货\n(板卡/运单/件/重量)',
           columnLabel: '理货\n(板卡/运单/件/重量)',
         },
         },
         {
         {
-          columnName: 'C9_time',
+          columnName: 'tallyTime_in',
           columnLabel: '理货时间',
           columnLabel: '理货时间',
         },
         },
         {
         {
-          columnName: 'C10',
+          columnName: "concat(passCustomsList_in,'/',passCustoms_in)",
           columnLabel: '海关放行\n(运单/件)',
           columnLabel: '海关放行\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C10_time',
+          columnName: 'passCustomsTime_in',
           columnLabel: '海关放行\n时间',
           columnLabel: '海关放行\n时间',
         },
         },
         {
         {
-          columnName: 'C11',
+          columnName: 'outWarehouse',
           columnLabel: '出库\n(批/运单/件)',
           columnLabel: '出库\n(批/运单/件)',
         },
         },
         {
         {
-          columnName: 'C11_time',
+          columnName: 'outWarehouseTime',
           columnLabel: '出库时间',
           columnLabel: '出库时间',
         },
         },
         {
         {
-          columnName: 'C12',
+          columnName: "concat(punishCustomsList_in,'/',punishCustoms_in)",
           columnLabel: '海关罚没\n(运单/件)',
           columnLabel: '海关罚没\n(运单/件)',
         },
         },
         {
         {
-          columnName: 'C12_time',
+          columnName: 'punishCustomsTime_in',
           columnLabel: '海关罚没\n时间',
           columnLabel: '海关罚没\n时间',
         },
         },
       ],
       ],
@@ -806,12 +826,12 @@ const computedWidth = (column: SimpleColumn) => {
     for (let i = 0; i < len; i++) {
     for (let i = 0; i < len; i++) {
       realLength += line.charCodeAt(i) > 255 ? 2 : 1
       realLength += line.charCodeAt(i) > 255 ? 2 : 1
     }
     }
-    if (width < (realLength + 2) * 6) {
-      width = (realLength + 2) * 6
+    if (width < realLength * 8) {
+      width = realLength * 8
     }
     }
   })
   })
   if (column.needFilters || column.needSort) {
   if (column.needFilters || column.needSort) {
-    width += 6
+    width += 8
   }
   }
   // border
   // border
   return width + 1
   return width + 1
@@ -863,10 +883,15 @@ export default function useAirportTable(name: string, formData: CommonData) {
         flightWarning,
         flightWarning,
         waybillType,
         waybillType,
       } = formData
       } = formData
-      const dataContent = [startDate, endDate, flightStatus, flightWarning]
-      if (name.includes('International')) {
-        dataContent.push(waybillType)
-      }
+      const dataContent = [
+        startDate + ':00',
+        endDate + ':59',
+        // flightStatus,
+        // flightWarning
+      ]
+      // if (name.includes('International')) {
+      //   dataContent.push(waybillType)
+      // }
       const {
       const {
         code,
         code,
         returnData: { columnSet, listValues },
         returnData: { columnSet, listValues },
@@ -910,17 +935,17 @@ export default function useAirportTable(name: string, formData: CommonData) {
     }
     }
   }
   }
 
 
-  // watch(formData, data => {
-  //   stopQuery()
-  //   if (data.startDate && data.endDate) {
-  //     startQuery()
-  //   }
-  // })
-  // onUnmounted(stopQuery)
+  watch(formData, data => {
+    stopQuery()
+    if (data.startDate && data.endDate) {
+      startQuery()
+    }
+  })
+  onUnmounted(stopQuery)
 
 
   onMounted(() => {
   onMounted(() => {
     getTableColumns()
     getTableColumns()
-    getSimulateTableData()
+    // getSimulateTableData()
   })
   })
 
 
   return {
   return {

+ 15 - 7
src/views/realTime/components/FlightView/index.vue

@@ -7,7 +7,7 @@
           <template v-for="(group, index) in flightInfoItems" :key="index">
           <template v-for="(group, index) in flightInfoItems" :key="index">
             <div class="info-box">
             <div class="info-box">
               <div v-for="(item, i) in group" :key="i">
               <div v-for="(item, i) in group" :key="i">
-                {{ item.label }}:{{ flightInfo[item.key] }}
+                {{ item.label }}:{{ computedFlightInfo(item) }}
               </div>
               </div>
             </div>
             </div>
             <div v-if="index < flightInfoItems.length - 1" class="icon-box">
             <div v-if="index < flightInfoItems.length - 1" class="icon-box">
@@ -83,20 +83,28 @@ const props = defineProps({
 })
 })
 
 
 const route = useRoute()
 const route = useRoute()
-const { flightNO, flightDate, departureAirport, landingAirport } = route.query
+const {
+  flightNO,
+  flightDate,
+  // departureAirport,
+  // landingAirport
+} = route.query
 // if (!flightNO || !flightDate) {
 // if (!flightNO || !flightDate) {
 //   router.push('/')
 //   router.push('/')
 // }
 // }
 const dataContent = [
 const dataContent = [
-  flightNO,
   flightDate,
   flightDate,
-  departureAirport,
-  landingAirport,
+  flightNO,
+  // departureAirport,
+  // landingAirport,
 ] as string[]
 ] as string[]
 
 
-const airLine = ref('SZX - CA4120 - NKG')
+const { flightInfoItems, flightInfo, computedFlightInfo } = useFlightInfo(
+  props.name,
+  dataContent
+)
 
 
-const { flightInfoItems, flightInfo } = useFlightInfo(props.name, dataContent)
+const airLine = toRef(flightInfo, 'flightinfo')
 
 
 const {
 const {
   tableColumns: containerTableColumns,
   tableColumns: containerTableColumns,

+ 50 - 33
src/views/realTime/components/FlightView/useFlightInfo.ts

@@ -7,67 +7,67 @@ const flightInfoItemsMap = {
     [
     [
       {
       {
         label: '起飞机场简称',
         label: '起飞机场简称',
-        key: 'C0',
+        getter: info => '',
       },
       },
       {
       {
         label: '日期',
         label: '日期',
-        key: 'C1',
+        getter: info => info.planDepartureTime?.split('T')[0],
       },
       },
       {
       {
         label: '时间',
         label: '时间',
-        key: 'C2',
+        getter: info => info.planDepartureTime?.split('T')[1],
       },
       },
       {
       {
         label: '停机位',
         label: '停机位',
-        key: 'C3',
+        key: 'takeOffStand',
       },
       },
     ],
     ],
     [
     [
       {
       {
         label: '特货信息/货物数',
         label: '特货信息/货物数',
-        key: 'C4',
+        key: 'speCargoInfo',
       },
       },
       {
       {
         label: '托运运单数/货物数',
         label: '托运运单数/货物数',
-        key: 'C5',
+        key: "concat(preLoadList,'/',preLoad)",
       },
       },
       {
       {
         label: '中转进运单/货物数',
         label: '中转进运单/货物数',
-        key: 'C6',
+        key: "concat(transInList,'/',transInList)",
       },
       },
       {
       {
         label: '已配载集装器',
         label: '已配载集装器',
-        key: 'C7',
+        key: 'stowage_Yes',
       },
       },
       {
       {
         label: '货站已交接集装器',
         label: '货站已交接集装器',
-        key: 'C7',
+        key: 'depotJoin',
       },
       },
       {
       {
         label: '已装载集装器/运单/货物数',
         label: '已装载集装器/运单/货物数',
-        key: 'C7',
+        key: 'loadPlane',
       },
       },
       {
       {
         label: '拉下集装器/运单/货物数',
         label: '拉下集装器/运单/货物数',
-        key: 'C8',
+        key: 'pull',
       },
       },
       {
       {
         label: '集装器数量',
         label: '集装器数量',
-        key: 'C9',
+        key: 'stowage',
       },
       },
     ],
     ],
     [
     [
       {
       {
         label: '降落机场简称',
         label: '降落机场简称',
-        key: 'C10',
+        getter: info => '',
       },
       },
       {
       {
         label: '日期',
         label: '日期',
-        key: 'C11',
+        getter: info => info.planLandingTime?.split('T')[0],
       },
       },
       {
       {
         label: '时间',
         label: '时间',
-        key: 'C12',
+        getter: info => info.planLandingTime?.split('T')[1],
       },
       },
     ],
     ],
   ],
   ],
@@ -75,59 +75,59 @@ const flightInfoItemsMap = {
     [
     [
       {
       {
         label: '起飞机场简称',
         label: '起飞机场简称',
-        key: 'C0',
+        getter: info => '',
       },
       },
       {
       {
         label: '日期',
         label: '日期',
-        key: 'C1',
+        getter: info => info.planDepartureTime?.split('T')[0],
       },
       },
       {
       {
         label: '时间',
         label: '时间',
-        key: 'C2',
+        getter: info => info.planDepartureTime?.split('T')[1],
       },
       },
     ],
     ],
     [
     [
       {
       {
         label: '特货信息/货物数',
         label: '特货信息/货物数',
-        key: 'C3',
+        key: 'speCargoInfo',
       },
       },
       {
       {
         label: '卸载运单数/货物数',
         label: '卸载运单数/货物数',
-        key: 'C4',
+        key: "concat(unLoadPlaneList,'/',unLoadPlane)",
       },
       },
       {
       {
         label: '中转进运单/货物数',
         label: '中转进运单/货物数',
-        key: 'C5',
+        key: "concat(transInList,'/',transIn)",
       },
       },
       {
       {
         label: '已卸载集装器',
         label: '已卸载集装器',
-        key: 'C6',
+        key: 'stowage_Yes',
       },
       },
       {
       {
         label: '卸载数量(板/箱/卡)',
         label: '卸载数量(板/箱/卡)',
-        key: 'C7',
+        key: 'unloadPlane',
       },
       },
       {
       {
         label: '货站交接数量(板/箱/卡)',
         label: '货站交接数量(板/箱/卡)',
-        key: 'C8',
+        key: 'pull',
       },
       },
     ],
     ],
     [
     [
       {
       {
         label: '降落机场简称',
         label: '降落机场简称',
-        key: 'C9',
+        getter: info => '',
       },
       },
       {
       {
         label: '日期',
         label: '日期',
-        key: 'C10',
+        getter: info => info.planLandingTime?.split('T')[0],
       },
       },
       {
       {
         label: '时间',
         label: '时间',
-        key: 'C11',
+        getter: info => info.planLandingTime?.split('T')[1],
       },
       },
       {
       {
         label: '停机位',
         label: '停机位',
-        key: 'C12',
+        key: 'landingStand',
       },
       },
     ],
     ],
   ],
   ],
@@ -169,7 +169,9 @@ export default function useFlightInfo(
   name: string,
   name: string,
   dataContent: CommonValue[]
   dataContent: CommonValue[]
 ) {
 ) {
-  const flightInfoItems = ref<{ label: string; key: string }[][]>([])
+  const flightInfoItems = ref<
+    { label: string; key?: string; getter?: (info: any) => string }[][]
+  >([])
   const getFlightInfoItems = () => {
   const getFlightInfoItems = () => {
     flightInfoItems.value =
     flightInfoItems.value =
       flightInfoItemsMap[name.includes('Departure') ? 'departure' : 'arrival']
       flightInfoItemsMap[name.includes('Departure') ? 'departure' : 'arrival']
@@ -184,14 +186,17 @@ export default function useFlightInfo(
         returnData: { listValues },
         returnData: { listValues },
         message,
         message,
       } = await Query({
       } = await Query({
-        id: DATACONTENT_ID.flightInfo,
+        id:
+          DATACONTENT_ID[
+            name.slice(0, 1).toLowerCase() + name.slice(1) + 'Info'
+          ],
         dataContent,
         dataContent,
       })
       })
       if (Number(code) !== 0) {
       if (Number(code) !== 0) {
         throw new Error(message ?? '失败')
         throw new Error(message ?? '失败')
       }
       }
       if (!listValues.length) {
       if (!listValues.length) {
-        ElMessage.error('未查询到航班信息')
+        ElMessage.info('未查询到航班信息')
         return
         return
       }
       }
       Object.assign(flightInfo, listValues[0])
       Object.assign(flightInfo, listValues[0])
@@ -199,6 +204,17 @@ export default function useFlightInfo(
       console.error(error)
       console.error(error)
     }
     }
   }
   }
+
+  const computedFlightInfo = computed(() => item => {
+    if (item.getter) {
+      return item.getter(flightInfo)
+    } else if (item.key) {
+      return flightInfo[item.key]
+    } else {
+      return ''
+    }
+  })
+
   const getSimulateFlightInfo = () => {
   const getSimulateFlightInfo = () => {
     const simulateFlightInfo =
     const simulateFlightInfo =
       simulateFlightInfoMap[
       simulateFlightInfoMap[
@@ -207,12 +223,13 @@ export default function useFlightInfo(
     Object.assign(flightInfo, simulateFlightInfo)
     Object.assign(flightInfo, simulateFlightInfo)
   }
   }
   onMounted(() => {
   onMounted(() => {
-    // getFlightInfo()
-    getSimulateFlightInfo()
+    getFlightInfo()
+    // getSimulateFlightInfo()
   })
   })
 
 
   return {
   return {
     flightInfoItems,
     flightInfoItems,
     flightInfo,
     flightInfo,
+    computedFlightInfo,
   }
   }
 }
 }

+ 52 - 65
src/views/realTime/components/WaybillView/index.vue

@@ -4,7 +4,7 @@
       <div class="waybill-info-title">运单基本信息</div>
       <div class="waybill-info-title">运单基本信息</div>
       <div class="waybill-info-content flex">
       <div class="waybill-info-content flex">
         <div v-for="item in waybillInfoItems" :key="item.key">
         <div v-for="item in waybillInfoItems" :key="item.key">
-          {{ item.label }}:{{ waybillInfo[item.key] }}
+          {{ item.label }}:{{ computedWaybillInfo(item) }}
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
@@ -29,6 +29,7 @@
       </div>
       </div>
     </div>
     </div>
     <div
     <div
+      v-show="trackAirlines.length"
       :style="{
       :style="{
         maxHeight: trackAirlines.length > 1 ? `${208 * 2 + 8}px` : '208px',
         maxHeight: trackAirlines.length > 1 ? `${208 * 2 + 8}px` : '208px',
       }"
       }"
@@ -75,7 +76,7 @@
         :row-class-name="rowClass"
         :row-class-name="rowClass"
         :cell-class-name="cellClass"
         :cell-class-name="cellClass"
         @cell-click="cellClickHandler"
         @cell-click="cellClickHandler"
-        :column-props="{ formatter }"
+        :column-props="{ formatter, minWidth: 75 }"
       />
       />
     </div>
     </div>
   </div>
   </div>
@@ -87,16 +88,14 @@ import Search from '@/components/search/index.vue'
 import Steps from '@/components/steps/index.vue'
 import Steps from '@/components/steps/index.vue'
 import ColumnSet from '../../components/ColumnSet/index.vue'
 import ColumnSet from '../../components/ColumnSet/index.vue'
 import SimpleTable from '@/components/SimpleTable/index.vue'
 import SimpleTable from '@/components/SimpleTable/index.vue'
-import { CommonData } from '~/common'
 import useTrackData from '../../hooks/useTrackData'
 import useTrackData from '../../hooks/useTrackData'
 import useTable from '../../hooks/useTable'
 import useTable from '../../hooks/useTable'
 import useTableColumnSet from '../../hooks/useTableColumnSet'
 import useTableColumnSet from '../../hooks/useTableColumnSet'
 import useTableExport from '../../hooks/useTableExport'
 import useTableExport from '../../hooks/useTableExport'
 import useTableStyle from '../../hooks/useTableStyle'
 import useTableStyle from '../../hooks/useTableStyle'
 import useTableCellClick from '../../hooks/useTableCellClick'
 import useTableCellClick from '../../hooks/useTableCellClick'
-import { Query } from '@/api/webApi'
-import { ElMessage } from 'element-plus'
 import useWaybillInfo from './useWaybillInfo'
 import useWaybillInfo from './useWaybillInfo'
+import { CommonData, CommonValue } from '~/common'
 
 
 const props = defineProps({
 const props = defineProps({
   name: {
   name: {
@@ -106,77 +105,65 @@ const props = defineProps({
 })
 })
 
 
 const route = useRoute()
 const route = useRoute()
+const { waybillNO } = route.query
+
 const {
 const {
-  waybillNO,
-  flightNO,
-  flightDate,
-  departureAirport,
-  landingAirport,
-} = route.query
+  waybillInfoItems,
+  waybillInfo,
+  computedWaybillInfo,
+} = useWaybillInfo(props.name, [waybillNO as string])
 
 
-const { waybillInfoItems, waybillInfo } = useWaybillInfo(props.name, [
+const { tableColumns, tableData: trackData } = useTable(`${props.name}Goods`, [
   waybillNO as string,
   waybillNO as string,
 ])
 ])
 
 
-interface Airline {
-  C0: string // 航班号
-  C1: string // 机场
-  C2: string // 航班日期
-  C3: number // 起飞/降落
-}
-const waybillAirlines = ref<Airline[]>([])
-const getWaybillAirlines = async () => {
-  try {
+const { trackAirlines, trackBoxStyle } = useTrackData(props.name, trackData)
+
+const tableData = computed(() =>
+  trackData.value.reduce((data, current) => {
+    const sameRecord = data.find(record =>
+      ['subCode', 'flightNO', 'flightDate', 'stowageNo', 'CargoNo'].every(
+        key => record[key] === current[key]
+      )
+    )
     const {
     const {
-      code,
-      returnData: { listValues },
-      message,
-    } = await Query<Airline>({
-      id: DATACONTENT_ID.waybillAirline,
-      dataContent: [waybillNO],
-    })
-    if (Number(code) !== 0) {
-      throw new Error(message || '失败')
+      subCode,
+      flightNO,
+      flightDate,
+      LoadingLocation, // 装载机场
+      UnloadingLocation, // 卸载机场
+      stowageNo,
+      CargoNo,
+      pullMark,
+      returnMark,
+      transMark,
+      exceptionCustomsMark,
+      execPosition, // 读取位置
+      nodeCode, // 节点名称
+      ConsignmentItemPackagingQuantityQuantity, // 跟踪节点件数
+      execResult,
+      execTime,
+    } = current
+    if (sameRecord) {
+      sameRecord[
+        String(nodeCode)
+      ] = `${execPosition}\n${execResult}\n${execTime}`
+    } else {
+      data.push({
+        ...current,
+        [String(nodeCode)]: `${execPosition}\n${execResult}\n${execTime}`,
+      })
     }
     }
-    waybillAirlines.value = listValues
-  } catch (error) {
-    console.error(error)
-  }
-}
-// onMounted(() => {
-//   getWaybillAirlines()
-// })
-
-const trackDataContentList = computed(() =>
-  waybillAirlines.value.map(({ C0, C1, C2, C3 }) => ({
-    flightNO: C0,
-    airport: C1,
-    flightDate: C2,
-    isDeparture: C3,
-    dataContent: [waybillNO as string, C0, C1, C2],
-  }))
+    return data
+  }, [] as CommonData[])
 )
 )
-const { trackAirlines, trackBoxStyle } = useTrackData(
-  props.name,
-  trackDataContentList
-)
-
-const dataContent = [
-  waybillNO,
-  flightNO,
-  flightDate,
-  departureAirport,
-  landingAirport,
-] as string[]
-const { tableColumns, tableData } = useTable(`${props.name}Goods`, dataContent)
 
 
 const formatter = (row, column, cellValue, index) => {
 const formatter = (row, column, cellValue, index) => {
-  const array = Array.from({ length: 12 }, (_, i) => `C${i + 5}`)
-  if (array.includes(column.property)) {
-    return String(cellValue ?? '').replaceAll('-', '\n')
-  } else {
-    return cellValue
+  const value = String(cellValue ?? '').split('\n')
+  if (value[2]) {
+    value[2] = value[2].split('T')[1]
   }
   }
+  return value.join('\n')
 }
 }
 
 
 const search = (text: string) => {
 const search = (text: string) => {

+ 33 - 19
src/views/realTime/components/WaybillView/useWaybillInfo.ts

@@ -6,65 +6,65 @@ const waybillInfoItemsMap = {
   internal: [
   internal: [
     {
     {
       label: '运单',
       label: '运单',
-      key: 'C0',
+      key: 'stockCode',
     },
     },
     {
     {
       label: '货代公司',
       label: '货代公司',
-      key: 'C1',
+      key: 'cargoCompany',
     },
     },
     {
     {
       label: '品名',
       label: '品名',
-      key: 'C3',
+      key: 'typeCode',
     },
     },
     {
     {
       label: '特货信息',
       label: '特货信息',
-      key: 'C4',
+      key: 'speCargoInfo',
     },
     },
     {
     {
       label: '始发机场',
       label: '始发机场',
-      key: 'C5',
+      key: 'departureAirport',
     },
     },
     {
     {
       label: '目的机场',
       label: '目的机场',
-      key: 'C6',
+      key: 'arriveAirport',
     },
     },
     {
     {
       label: '货物数量',
       label: '货物数量',
-      key: 'C7',
+      key: 'luggageCount',
     },
     },
     {
     {
       label: '货物总重',
       label: '货物总重',
-      key: 'C8',
+      key: 'weight',
     },
     },
   ],
   ],
   international: [
   international: [
     {
     {
       label: '运单',
       label: '运单',
-      key: 'C0',
+      key: 'stockCode,',
     },
     },
     {
     {
       label: '运单类型',
       label: '运单类型',
-      key: 'C1',
+      key: 'stockType,',
     },
     },
     {
     {
       label: '货代公司',
       label: '货代公司',
-      key: 'C2',
+      key: 'cargoCompany,',
     },
     },
     {
     {
       label: '品名',
       label: '品名',
-      key: 'C3',
+      key: 'typeCode,',
     },
     },
     {
     {
       label: '特货信息',
       label: '特货信息',
-      key: 'C4',
+      key: 'speCargoInfo,',
     },
     },
     {
     {
       label: '始发机场',
       label: '始发机场',
-      key: 'C5',
+      key: 'departureAirport,',
     },
     },
     {
     {
       label: '目的机场',
       label: '目的机场',
-      key: 'C6',
+      key: 'arriveAirport,',
     },
     },
   ],
   ],
 }
 }
@@ -95,7 +95,9 @@ export default function useWaybillInfo(
   name: string,
   name: string,
   dataContent: CommonValue[]
   dataContent: CommonValue[]
 ) {
 ) {
-  const waybillInfoItems = ref<{ label: string; key: string }[]>([])
+  const waybillInfoItems = ref<
+    { label: string; key?: string; getter?: (info: any) => string }[]
+  >([])
   const getWaybillInfoItems = () => {
   const getWaybillInfoItems = () => {
     waybillInfoItems.value =
     waybillInfoItems.value =
       waybillInfoItemsMap[
       waybillInfoItemsMap[
@@ -119,7 +121,7 @@ export default function useWaybillInfo(
         throw new Error(message || '失败')
         throw new Error(message || '失败')
       }
       }
       if (!listValues.length) {
       if (!listValues.length) {
-        ElMessage.error('未查询到运单信息')
+        ElMessage.info('未查询到运单信息')
         return
         return
       }
       }
       Object.assign(waybillInfo, listValues[0])
       Object.assign(waybillInfo, listValues[0])
@@ -127,6 +129,17 @@ export default function useWaybillInfo(
       console.error(error)
       console.error(error)
     }
     }
   }
   }
+
+  const computedWaybillInfo = computed(() => item => {
+    if (item.getter) {
+      return item.getter(waybillInfo)
+    } else if (item.key) {
+      return waybillInfo[item.key]
+    } else {
+      return ''
+    }
+  })
+
   const getSimulateWaybillInfo = () => {
   const getSimulateWaybillInfo = () => {
     const simulateWaybillInfo =
     const simulateWaybillInfo =
       simulateWaybillInfoMap[
       simulateWaybillInfoMap[
@@ -135,11 +148,12 @@ export default function useWaybillInfo(
     Object.assign(waybillInfo, simulateWaybillInfo)
     Object.assign(waybillInfo, simulateWaybillInfo)
   }
   }
   onMounted(() => {
   onMounted(() => {
-    // getWaybillInfo()
-    getSimulateWaybillInfo()
+    getWaybillInfo()
+    // getSimulateWaybillInfo()
   })
   })
   return {
   return {
     waybillInfoItems,
     waybillInfoItems,
     waybillInfo,
     waybillInfo,
+    computedWaybillInfo
   }
   }
 }
 }

+ 202 - 122
src/views/realTime/hooks/useTable.ts

@@ -1,6 +1,14 @@
 import { Query } from '@/api/webApi'
 import { Query } from '@/api/webApi'
 import { CommonValue, CommonData, CommonTableColumn } from '~/common'
 import { CommonValue, CommonData, CommonTableColumn } from '~/common'
 
 
+const idGetter = (name: string) => {
+  if (name.endsWith('WaybillGoods')) {
+    return DATACONTENT_ID.waybillGoods
+  } else {
+    return DATACONTENT_ID[name.slice(0, 1).toLowerCase() + name.slice(1)]
+  }
+}
+
 const tableColumnsMap: {
 const tableColumnsMap: {
   [tableName: string]: ({
   [tableName: string]: ({
     columnLabel: string
     columnLabel: string
@@ -8,125 +16,164 @@ const tableColumnsMap: {
   } & { [x: string]: any })[]
   } & { [x: string]: any })[]
 } = {
 } = {
   DepartureFlightContainer: [
   DepartureFlightContainer: [
-    { columnLabel: '集装器编号', columnName: 'C0', width: 120 },
-    { columnLabel: '运单数', columnName: 'C1', width: 60, needCount: 1 },
-    { columnLabel: '件数', columnName: 'C2', width: 60, needCount: 1 },
+    { columnLabel: '集装器编号', columnName: 'stowageNo', width: 120 },
+    { columnLabel: '运单数', columnName: 'list', width: 60, needCount: 1 },
+    { columnLabel: '件数', columnName: 'number', width: 60, needCount: 1 },
     {
     {
       columnLabel: '理货',
       columnLabel: '理货',
-      columnName: 'C3',
+      columnName: 'tally',
       className: 'cell-filter cell-filter-yellow',
       className: 'cell-filter cell-filter-yellow',
     },
     },
     {
     {
       columnLabel: '拉下',
       columnLabel: '拉下',
-      columnName: 'C4',
+      columnName: 'pull',
       className: 'cell-filter cell-filter-yellow',
       className: 'cell-filter cell-filter-yellow',
     },
     },
     {
     {
       columnLabel: '待运区',
       columnLabel: '待运区',
-      columnName: 'C5',
+      columnName: 'wait',
       className: 'cell-filter cell-filter-yellow',
       className: 'cell-filter cell-filter-yellow',
     },
     },
     {
     {
       columnLabel: '货站交接',
       columnLabel: '货站交接',
-      columnName: 'C6',
+      columnName: 'depot',
       className: 'cell-filter cell-filter-yellow',
       className: 'cell-filter cell-filter-yellow',
     },
     },
     {
     {
       columnLabel: '机下交接',
       columnLabel: '机下交接',
-      columnName: 'C7',
+      columnName: 'planeDown',
       className: 'cell-filter cell-filter-yellow',
       className: 'cell-filter cell-filter-yellow',
     },
     },
     {
     {
       columnLabel: '装机',
       columnLabel: '装机',
-      columnName: 'C8',
+      columnName: 'loadPlane',
       className: 'cell-filter cell-filter-yellow',
       className: 'cell-filter cell-filter-yellow',
     },
     },
   ],
   ],
   DepartureFlightWaybill: [
   DepartureFlightWaybill: [
-    { columnLabel: '运单号', columnName: 'C0', width: 120 },
-    { columnLabel: '集装器数量', columnName: 'C1', needCount: 1 },
+    { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
+    { columnLabel: '集装器数量', columnName: 'stowageNum', needCount: 1 },
     {
     {
       columnLabel: '品名',
       columnLabel: '品名',
-      columnName: 'C2',
+      columnName: 'typeCode',
       width: 160,
       width: 160,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
     },
     },
-    { columnLabel: '特货信息', columnName: 'C3' },
-    { columnLabel: '货物件数', columnName: 'C4', needCount: 1 },
-    { columnLabel: '拉下件数', columnName: 'C5', needCount: 1 },
-    { columnLabel: '退运件数', columnName: 'C6', needCount: 1 },
-    { columnLabel: '最新节点', columnName: 'C7' },
-    { columnLabel: '最新位置', columnName: 'C8' },
-    { columnLabel: '处理结果', columnName: 'C9' },
-    { columnLabel: '处理时间', columnName: 'C10', width: 130 },
-    { columnLabel: '中转进航班号', columnName: 'C11' },
-    { columnLabel: '中转航班降落时间', columnName: 'C12', width: 130 },
-    { columnLabel: '装载序号', columnName: 'C13' },
+    { columnLabel: '特货信息', columnName: 'speCargoInfo' },
+    { columnLabel: '货物件数', columnName: 'luggageCount', needCount: 1 },
+    { columnLabel: '拉下件数', columnName: 'pullNum', needCount: 1 },
+    { columnLabel: '退运件数', columnName: 'returnNum', needCount: 1 },
+    { columnLabel: '最新节点', columnName: 'nodeCode' },
+    { columnLabel: '最新位置', columnName: 'execPosition' },
+    { columnLabel: '处理结果', columnName: 'execResult' },
+    { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
+    { columnLabel: '中转进航班号', columnName: 'inFlightNO' },
+    {
+      columnLabel: '中转航班降落时间',
+      columnName: 'inFlightNOLandTime',
+      width: 130,
+    },
+    { columnLabel: '装载序号', columnName: 'queueNo' },
   ],
   ],
   DepartureWaybillGoods: [
   DepartureWaybillGoods: [
-    { columnLabel: '航班号', columnName: 'C0', needFilters: 1 },
-    { columnLabel: '集装器编号', columnName: 'C1', width: 120, needFilters: 1 },
-    { columnLabel: '货物编码', columnName: 'C2', needFilters: 1 },
-    { columnLabel: '拉下', columnName: 'C3', needFilters: 1 },
-    { columnLabel: '退运', columnName: 'C4', needFilters: 1 },
+    { columnLabel: '航班号', columnName: 'flightNO', needFilters: 1, width: 70 },
+    {
+      columnLabel: '集装器编号',
+      columnName: 'stowageNo',
+      width: 100,
+      needFilters: 1,
+    },
+    { columnLabel: '货物编码', columnName: 'CargoNo', needFilters: 1 },
+    { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1, width: 60 },
+    { columnLabel: '退运', columnName: 'returnMark', needFilters: 1, width: 60 },
     {
     {
       columnLabel: '收货核单',
       columnLabel: '收货核单',
-      columnName: 'C5',
+      columnName: 'DEH',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
-      columnLabel: '安检',
-      columnName: 'C6',
+      columnLabel: '查验',
+      columnName: 'ACC_CHECK',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
-      columnLabel: '理货',
-      columnName: 'C7',
+      columnLabel: '拒运',
+      columnName: 'ACC_CHECK_2',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
-      columnLabel: '拉下',
-      columnName: 'C8',
+      columnLabel: '安检',
+      columnName: '安检',
+      className: 'cell-filter cell-filter-green',
+    },
+    {
+      columnLabel: '加货',
+      columnName: 'ACC_BUP',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
       columnLabel: '待运区',
       columnLabel: '待运区',
-      columnName: 'C9',
+      columnName: 'WAT_LOC',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
       columnLabel: '货站交接',
       columnLabel: '货站交接',
-      columnName: 'C10',
+      columnName: 'CARGOS_DEP_ULD_HANDOVER',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
       columnLabel: '机下交接',
       columnLabel: '机下交接',
-      columnName: 'C11',
+      columnName: '出港货邮',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
       columnLabel: '装机',
       columnLabel: '装机',
-      columnName: 'C12',
+      columnName: '装载完成',
+      className: 'cell-filter cell-filter-green',
+    },
+    {
+      columnLabel: '拉下',
+      columnName: 'CARGOS_OFFLOAD',
+      className: 'cell-filter cell-filter-green',
+    },
+    {
+      columnLabel: '拉回',
+      columnName: 'OFFLOAD_CONFIRM',
+      className: 'cell-filter cell-filter-green',
+    },
+    // {
+    //   columnLabel: '起飞',
+    //   columnName: 'C15',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    {
+      columnLabel: '退运',
+      columnName: 'BILL_RETURN',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
       columnLabel: '卸机',
       columnLabel: '卸机',
-      columnName: 'C13',
+      columnName: 'CARGOS_ARR_HANDOVER',
       className: 'cell-filter cell-filter-cyan',
       className: 'cell-filter cell-filter-cyan',
     },
     },
     {
     {
       columnLabel: '机下交接',
       columnLabel: '机下交接',
-      columnName: 'C14',
+      columnName: 'CARGOS_HANDOVER_STATUS',
       className: 'cell-filter cell-filter-cyan',
       className: 'cell-filter cell-filter-cyan',
     },
     },
     {
     {
       columnLabel: '货站交接',
       columnLabel: '货站交接',
-      columnName: 'C15',
+      columnName: '货站交接',
       className: 'cell-filter cell-filter-cyan',
       className: 'cell-filter cell-filter-cyan',
     },
     },
     {
     {
-      columnLabel: '提取',
-      columnName: 'C16',
+      columnLabel: '理货',
+      columnName: 'IMP_TALLY',
+      className: 'cell-filter cell-filter-cyan',
+    },
+    {
+      columnLabel: '出库',
+      columnName: 'FSU_DLV',
       className: 'cell-filter cell-filter-cyan',
       className: 'cell-filter cell-filter-cyan',
     },
     },
   ],
   ],
@@ -148,90 +195,112 @@ const tableColumnsMap: {
     { columnLabel: '集装器编号', columnName: 'C14' },
     { columnLabel: '集装器编号', columnName: 'C14' },
   ],
   ],
   ArrivalFlightWaybill: [
   ArrivalFlightWaybill: [
-    { columnLabel: '运单号', columnName: 'C0', width: 120 },
+    { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
     {
     {
       columnLabel: '品名',
       columnLabel: '品名',
-      columnName: 'C1',
+      columnName: 'typeCode',
       width: 160,
       width: 160,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
     },
     },
-    { columnLabel: '特货信息', columnName: 'C2', needCount: 1 },
-    { columnLabel: '进港报文货物件数', columnName: 'C3', needCount: 1 },
-    { columnLabel: '进港实际货物件数', columnName: 'C4', needCount: 1 },
-    { columnLabel: '最新节点', columnName: 'C5' },
-    { columnLabel: '最新位置', columnName: 'C6' },
-    { columnLabel: '处理结果', columnName: 'C7' },
-    { columnLabel: '处理时间', columnName: 'C8', width: 130 },
-    { columnLabel: '中转出航班号', columnName: 'C9' },
-    { columnLabel: '中转航班降落时间', columnName: 'C10', width: 130 },
-    { columnLabel: '装载序号', columnName: 'C11' },
-  ],
-  ArrivalWaybillGoods: [
-    { columnLabel: '航班号', columnName: 'C0', needFilters: 1 },
-    { columnLabel: '货物编码', columnName: 'C1', width: 120, needFilters: 1 },
-    { columnLabel: '中转', columnName: 'C2', needFilters: 1 },
-    { columnLabel: '拉下', columnName: 'C3', needFilters: 1 },
-    { columnLabel: '退运', columnName: 'C4', needFilters: 1 },
+    { columnLabel: '特货信息', columnName: 'speCargoInfo', needCount: 1 },
     {
     {
-      columnLabel: '卸机',
-      columnName: 'C5',
-      className: 'cell-filter cell-filter-cyan',
-    },
-    {
-      columnLabel: '机下交接',
-      columnName: 'C6',
-      className: 'cell-filter cell-filter-cyan',
+      columnLabel: '进港报文货物件数',
+      columnName: 'messageCargos_in',
+      needCount: 1,
     },
     },
     {
     {
-      columnLabel: '货站交接',
-      columnName: 'C7',
-      className: 'cell-filter cell-filter-cyan',
+      columnLabel: '进港实际货物件数',
+      columnName: 'acCargos_in',
+      needCount: 1,
     },
     },
+    { columnLabel: '最新节点', columnName: 'nodeCode' },
+    { columnLabel: '最新位置', columnName: 'execPosition' },
+    { columnLabel: '处理结果', columnName: 'execResult' },
+    { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
+    { columnLabel: '中转出航班号', columnName: 'transferFlightNO' },
     {
     {
-      columnLabel: '提取',
-      columnName: 'C8',
-      className: 'cell-filter cell-filter-cyan',
-    },
-    {
-      columnLabel: '收货核单',
-      columnName: 'C9',
-      className: 'cell-filter cell-filter-green',
-    },
-    {
-      columnLabel: '安检',
-      columnName: 'C10',
-      className: 'cell-filter cell-filter-green',
+      columnLabel: '中转航班起飞时间',
+      columnName: 'transferFlightDepTime',
+      width: 130,
     },
     },
+    { columnLabel: '装载序号', columnName: 'queueNo' },
+  ],
+  ArrivalWaybillGoods: [
+    { columnLabel: '航班号', columnName: 'flightNO', needFilters: 1 },
     {
     {
-      columnLabel: '理货',
-      columnName: 'C11',
-      className: 'cell-filter cell-filter-green',
+      columnLabel: '货物编码',
+      columnName: 'CargoNo',
+      width: 120,
+      needFilters: 1,
     },
     },
+    { columnLabel: '中转', columnName: 'transMark', needFilters: 1 },
+    { columnLabel: '拉下', columnName: 'pullMark', needFilters: 1 },
+    { columnLabel: '退运', columnName: 'returnMark', needFilters: 1 },
     {
     {
-      columnLabel: '拉下',
-      columnName: 'C12',
-      className: 'cell-filter cell-filter-green',
+      columnLabel: '卸机',
+      columnName: 'CARGOS_ARR_HANDOVER',
+      className: 'cell-filter cell-filter-cyan',
     },
     },
     {
     {
-      columnLabel: '待运区',
-      columnName: 'C13',
-      className: 'cell-filter cell-filter-green',
+      columnLabel: '机下交接',
+      columnName: 'CARGOS_HANDOVER_STATUS',
+      className: 'cell-filter cell-filter-cyan',
     },
     },
     {
     {
       columnLabel: '货站交接',
       columnLabel: '货站交接',
-      columnName: 'C14',
-      className: 'cell-filter cell-filter-green',
+      columnName: '货站交接',
+      className: 'cell-filter cell-filter-cyan',
     },
     },
     {
     {
-      columnLabel: '机下交接',
-      columnName: 'C15',
-      className: 'cell-filter cell-filter-green',
+      columnLabel: '理货',
+      columnName: 'IMP_TALLY',
+      className: 'cell-filter cell-filter-cyan',
     },
     },
     {
     {
-      columnLabel: '装机',
-      columnName: 'C16',
-      className: 'cell-filter cell-filter-green',
+      columnLabel: '出库',
+      columnName: 'FSU_DLV',
+      className: 'cell-filter cell-filter-cyan',
     },
     },
+    // {
+    //   columnLabel: '收货核单',
+    //   columnName: 'C9',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    // {
+    //   columnLabel: '安检',
+    //   columnName: 'C10',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    // {
+    //   columnLabel: '理货',
+    //   columnName: 'C11',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    // {
+    //   columnLabel: '拉下',
+    //   columnName: 'C12',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    // {
+    //   columnLabel: '待运区',
+    //   columnName: 'C13',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    // {
+    //   columnLabel: '货站交接',
+    //   columnName: 'C14',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    // {
+    //   columnLabel: '机下交接',
+    //   columnName: 'C15',
+    //   className: 'cell-filter cell-filter-green',
+    // },
+    // {
+    //   columnLabel: '装机',
+    //   columnName: 'C16',
+    //   className: 'cell-filter cell-filter-green',
+    // },
   ],
   ],
   ArrivalGoodsFlight: [
   ArrivalGoodsFlight: [
     { columnLabel: '航班号', columnName: 'C0' },
     { columnLabel: '航班号', columnName: 'C0' },
@@ -386,24 +455,35 @@ const tableColumnsMap: {
     { columnLabel: '集装器编号', columnName: 'C14' },
     { columnLabel: '集装器编号', columnName: 'C14' },
   ],
   ],
   InternationalArrivalFlightWaybill: [
   InternationalArrivalFlightWaybill: [
-    { columnLabel: '运单号', columnName: 'C0', width: 120 },
-    { columnLabel: '运单类型', columnName: 'C1' },
+    { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
     {
     {
       columnLabel: '品名',
       columnLabel: '品名',
-      columnName: 'C2',
+      columnName: 'typeCode',
       width: 160,
       width: 160,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
     },
     },
-    { columnLabel: '特货信息', columnName: 'C3' },
-    { columnLabel: '进港报文货物件数', columnName: 'C4', needCount: 1 },
-    { columnLabel: '进港实际货物件数', columnName: 'C5', needCount: 1 },
-    { columnLabel: '最新节点', columnName: 'C6' },
-    { columnLabel: '最新位置', columnName: 'C7' },
-    { columnLabel: '处理结果', columnName: 'C8' },
-    { columnLabel: '处理时间', columnName: 'C9', width: 130 },
-    { columnLabel: '中转出航班号', columnName: 'C10' },
-    { columnLabel: '中转航班起飞时间', columnName: 'C11', width: 130 },
-    { columnLabel: '装载序号', columnName: 'C12' },
+    { columnLabel: '特货信息', columnName: 'speCargoInfo', needCount: 1 },
+    {
+      columnLabel: '进港报文货物件数',
+      columnName: 'messageCargos_in',
+      needCount: 1,
+    },
+    {
+      columnLabel: '进港实际货物件数',
+      columnName: 'acCargos_in',
+      needCount: 1,
+    },
+    { columnLabel: '最新节点', columnName: 'nodeCode' },
+    { columnLabel: '最新位置', columnName: 'execPosition' },
+    { columnLabel: '处理结果', columnName: 'execResult' },
+    { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
+    { columnLabel: '中转出航班号', columnName: 'transferFlightNO' },
+    {
+      columnLabel: '中转航班起飞时间',
+      columnName: 'transferFlightDepTime',
+      width: 130,
+    },
+    { columnLabel: '装载序号', columnName: 'queueNo' },
   ],
   ],
   InternationalArrivalWaybillGoods: [
   InternationalArrivalWaybillGoods: [
     { columnLabel: '航班号', columnName: 'C0', needFilters: 1 },
     { columnLabel: '航班号', columnName: 'C0', needFilters: 1 },
@@ -432,7 +512,7 @@ const tableColumnsMap: {
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
-      columnLabel: '海关',
+      columnLabel: '海关放行',
       columnName: 'C9',
       columnName: 'C9',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
@@ -442,7 +522,7 @@ const tableColumnsMap: {
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
     {
     {
-      columnLabel: '退运',
+      columnLabel: '海关罚没',
       columnName: 'C11',
       columnName: 'C11',
       className: 'cell-filter cell-filter-green',
       className: 'cell-filter cell-filter-green',
     },
     },
@@ -720,7 +800,7 @@ export default function useTable(
         returnData: { listValues },
         returnData: { listValues },
         message,
         message,
       } = await Query<CommonData>({
       } = await Query<CommonData>({
-        id: DATACONTENT_ID[tableName.slice(0, 1).toLocaleLowerCase + tableName.slice(1)],
+        id: idGetter(tableName),
         dataContent,
         dataContent,
       })
       })
       if (Number(code) !== 0) {
       if (Number(code) !== 0) {
@@ -738,8 +818,8 @@ export default function useTable(
   onMounted(() => {
   onMounted(() => {
     if (tableColumnsMap[tableName]) {
     if (tableColumnsMap[tableName]) {
       getTableColumns()
       getTableColumns()
-      // getTableData()
-      getSimulateTableData()
+      getTableData()
+      // getSimulateTableData()
     }
     }
   })
   })
 
 

+ 20 - 50
src/views/realTime/hooks/useTableCellClick.ts

@@ -7,30 +7,15 @@ export default function useTableCellClick(tableName?: string) {
   const cellClickHandler = (row, column, cell, event) => {
   const cellClickHandler = (row, column, cell, event) => {
     if (tableName?.includes('FlightWaybill')) {
     if (tableName?.includes('FlightWaybill')) {
       switch (column.property) {
       switch (column.property) {
-        case 'C0':
+        case 'stockCode':
           router.push({
           router.push({
             path: `${route.path.split('/').slice(0, -1).join('/')}/waybill`,
             path: `${route.path.split('/').slice(0, -1).join('/')}/waybill`,
             query: {
             query: {
-              waybillNO: row.C0,
+              waybillNO: row.stockCode,
             },
             },
           })
           })
           break
           break
-        default:
-          break
-      }
-    }
-    if (tableName === 'DepartureFlightWaybill') {
-      switch (column.property) {
-        case 'C1':
-          ElMessage.info('开发中')
-          break
-        default:
-          break
-      }
-    }
-    if (tableName === 'InternationalDepartureFlightWaybill') {
-      switch (column.property) {
-        case 'C2':
+        case 'stowageNum':
           ElMessage.info('开发中')
           ElMessage.info('开发中')
           break
           break
         default:
         default:
@@ -39,43 +24,28 @@ export default function useTableCellClick(tableName?: string) {
     }
     }
     if (tableName?.includes('FlightContainer')) {
     if (tableName?.includes('FlightContainer')) {
       switch (column.property) {
       switch (column.property) {
-        case 'C0':
+        case 'stowageNo':
           ElMessage.info('开发中')
           ElMessage.info('开发中')
           break
           break
         default:
         default:
           break
           break
       }
       }
     }
     }
-    if (tableName?.includes('DepartureWaybillGoods')) {
-      switch (column.property) {
-        case 'C2':
-          router.push({
-            path: `${route.path.split('/').slice(0, -1).join('/')}/goods`,
-            query: {
-              waybillNO: route.query.waybillNO,
-              goodsNO: row.C2,
-            },
-          })
-          break
-        default:
-          break
-      }
-    }
-    if (tableName?.includes('ArrivalWaybillGoods')) {
-      switch (column.property) {
-        case 'C1':
-          router.push({
-            path: `${route.path.split('/').slice(0, -1).join('/')}/goods`,
-            query: {
-              waybillNO: route.query.waybillNO,
-              goodsNO: row.C1,
-            },
-          })
-          break
-        default:
-          break
-      }
-    }
+    // if (tableName?.includes('WaybillGoods')) {
+    //   switch (column.property) {
+    //     case 'CargoNo':
+    //       router.push({
+    //         path: `${route.path.split('/').slice(0, -1).join('/')}/goods`,
+    //         query: {
+    //           waybillNO: route.query.waybillNO,
+    //           goodsNO: row.CargoNo,
+    //         },
+    //       })
+    //       break
+    //     default:
+    //       break
+    //   }
+    // }
   }
   }
   const cellClickHandlerV2 = ({ column, rowData }: CellSlotProps) => {
   const cellClickHandlerV2 = ({ column, rowData }: CellSlotProps) => {
     if (tableName?.includes('Airport')) {
     if (tableName?.includes('Airport')) {
@@ -84,8 +54,8 @@ export default function useTableCellClick(tableName?: string) {
           router.push({
           router.push({
             path: `${route.path.split('/').slice(0, -1).join('/')}/flight`,
             path: `${route.path.split('/').slice(0, -1).join('/')}/flight`,
             query: {
             query: {
-              flightNO: rowData.flightNO,
               flightDate: rowData.flightDate,
               flightDate: rowData.flightDate,
+              flightNO: rowData.IATACode + rowData.flightNO,
             },
             },
           })
           })
           break
           break

+ 34 - 44
src/views/realTime/hooks/useTableStyle.ts

@@ -18,49 +18,39 @@ type CellClassGetter = (params: {
 export default function useTableStyle(tableName?: string) {
 export default function useTableStyle(tableName?: string) {
   const rowClass = ({ row, rowIndex }) => {
   const rowClass = ({ row, rowIndex }) => {
     const classes: string[] = []
     const classes: string[] = []
-    if (tableName?.includes('FlightContainer')) {
-      if (rowIndex === 1) {
-        classes.push('row-warning')
-      }
-    }
-    if (tableName?.includes('FlightWaybill')) {
-      if (rowIndex === 0) {
-        classes.push('row-alarm')
-      }
-      if (rowIndex === 1) {
-        classes.push('row-warning')
-      }
-    }
+    // if (tableName?.includes('FlightContainer')) {
+    //   if (rowIndex === 1) {
+    //     classes.push('row-warning')
+    //   }
+    // }
+    // if (tableName?.includes('FlightWaybill')) {
+    //   if (rowIndex === 0) {
+    //     classes.push('row-alarm')
+    //   }
+    //   if (rowIndex === 1) {
+    //     classes.push('row-warning')
+    //   }
+    // }
     return classes.join(' ')
     return classes.join(' ')
   }
   }
 
 
   const cellClass = ({ row, column, rowIndex, columnIndex }) => {
   const cellClass = ({ row, column, rowIndex, columnIndex }) => {
     const classes: string[] = []
     const classes: string[] = []
     if (tableName?.includes('FlightContainer')) {
     if (tableName?.includes('FlightContainer')) {
-      if (['C0'].includes(column.property)) {
+      if (['stowageNo'].includes(column.property)) {
         classes.push('cell-click')
         classes.push('cell-click')
       }
       }
     }
     }
     if (tableName?.includes('FlightWaybill')) {
     if (tableName?.includes('FlightWaybill')) {
-      if (['C0'].includes(column.property)) {
-        classes.push('cell-click')
-      }
-    }
-    if (tableName === 'DepartureFlightWaybill') {
-      if (['C1'].includes(column.property)) {
-        classes.push('cell-click')
-      }
-    }
-    if (tableName === 'InternationalDepartureFlightWaybill') {
-      if (['C2'].includes(column.property)) {
-        classes.push('cell-click')
-      }
-    }
-    if (tableName?.includes('DepartureWaybillGoods')) {
-      if (['C2'].includes(column.property)) {
+      if (['stockCode', 'stowageNum'].includes(column.property)) {
         classes.push('cell-click')
         classes.push('cell-click')
       }
       }
     }
     }
+    // if (tableName?.includes('WaybillGoods')) {
+    //   if (['CargoNo'].includes(column.property)) {
+    //     classes.push('cell-click')
+    //   }
+    // }
     if (tableName?.includes('ArrivalWaybillGoods')) {
     if (tableName?.includes('ArrivalWaybillGoods')) {
       if (['C1'].includes(column.property)) {
       if (['C1'].includes(column.property)) {
         classes.push('cell-click')
         classes.push('cell-click')
@@ -71,14 +61,14 @@ export default function useTableStyle(tableName?: string) {
 
 
   const rowClassV2: RowClassGetter = ({ columns, rowData, rowIndex }) => {
   const rowClassV2: RowClassGetter = ({ columns, rowData, rowIndex }) => {
     const classes: string[] = []
     const classes: string[] = []
-    if (tableName?.includes('Airport')) {
-      if (rowIndex <= 1) {
-        classes.push('bg-gray')
-      }
-      if (rowIndex === 1) {
-        classes.push('underline-red')
-      }
-    }
+    // if (tableName?.includes('Airport')) {
+    //   if (rowIndex <= 1) {
+    //     classes.push('bg-gray')
+    //   }
+    //   if (rowIndex === 1) {
+    //     classes.push('underline-red')
+    //   }
+    // }
     return classes.join(' ')
     return classes.join(' ')
   }
   }
 
 
@@ -91,12 +81,12 @@ export default function useTableStyle(tableName?: string) {
     rowIndex,
     rowIndex,
   }) => {
   }) => {
     const classes: string[] = []
     const classes: string[] = []
-    if ((['4/243', '0/6'] as any[]).includes(cellData)) {
-      classes.push('cell-warning')
-    }
-    if ((['5/357'] as any).includes(cellData)) {
-      classes.push('cell-alarm')
-    }
+    // if ((['4/243', '0/6'] as any[]).includes(cellData)) {
+    //   classes.push('cell-warning')
+    // }
+    // if ((['5/357'] as any).includes(cellData)) {
+    //   classes.push('cell-alarm')
+    // }
     if ((['flightNO'] as any).includes(column.dataKey)) {
     if ((['flightNO'] as any).includes(column.dataKey)) {
       classes.push('cell-click')
       classes.push('cell-click')
     }
     }

+ 282 - 347
src/views/realTime/hooks/useTrackData.ts

@@ -1,16 +1,17 @@
-import { ComputedRef, CSSProperties } from 'vue'
-import { CommonValue } from '~/common'
+import { CSSProperties } from 'vue'
+import { CommonData, CommonValue, MaybeRef } from '~/common'
 import { Query } from '@/api/webApi'
 import { Query } from '@/api/webApi'
 
 
 interface TrackNode {
 interface TrackNode {
   name: string
   name: string
+  nodeCode: string
   flag: boolean
   flag: boolean
   labelWidth?: number
   labelWidth?: number
   descriptions: string[]
   descriptions: string[]
 }
 }
 interface TrackAirport {
 interface TrackAirport {
   airport: string
   airport: string
-  isDeparture: number
+  isDeparture: boolean
   trackSteps: TrackNode[]
   trackSteps: TrackNode[]
 }
 }
 interface TrackAirline {
 interface TrackAirline {
@@ -18,412 +19,346 @@ interface TrackAirline {
   flightDate: string
   flightDate: string
   airports: TrackAirport[]
   airports: TrackAirport[]
 }
 }
-interface TrackDataContent {
-  flightNO: string
-  flightDate: string
-  airport: string
-  isDeparture: number
-  dataContent: CommonValue[]
-}
-interface TrackNodeData {
-  C0: CommonValue // 节点名称
-  C1: CommonValue // 节点编号
-  C2: CommonValue // 总件数
-  C3: CommonValue // 时间
-}
 
 
-const simulateTrackNodesMap = {
+const trackNodesMap = {
   departure: [
   departure: [
     {
     {
       name: '收货核单',
       name: '收货核单',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '安检',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '理货',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '待运区',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '货站交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '机下交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'DEH',
     },
     },
     {
     {
-      name: '装机',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-  ],
-  departure2: [
-    {
-      name: '收货核单',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      name: '查验',
+      nodeCode: 'ACC_CHECK',
     },
     },
     {
     {
       name: '安检',
       name: '安检',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: '安检', // 暂无
     },
     },
     {
     {
-      name: '理货',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      name: '加货',
+      nodeCode: 'ACC_BUP',
     },
     },
     {
     {
       name: '待运区',
       name: '待运区',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'WAT_LOC',
     },
     },
     {
     {
       name: '货站交接',
       name: '货站交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'CARGOS_DEP_ULD_HANDOVER',
     },
     },
     {
     {
       name: '机下交接',
       name: '机下交接',
-      flag: false,
-      descriptions: [],
+      nodeCode: '出港货邮',
     },
     },
     {
     {
       name: '装机',
       name: '装机',
-      flag: false,
-      descriptions: [],
-    },
-  ],
-  arrival: [
-    {
-      name: '收货核单',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '机下交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '货站交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '提取',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-  ],
-  arrival2: [
-    {
-      name: '收货核单',
-      flag: false,
-      descriptions: [],
-    },
-    {
-      name: '机下交接',
-      flag: false,
-      descriptions: [],
-    },
-    {
-      name: '货站交接',
-      flag: false,
-      descriptions: [],
-    },
-    {
-      name: '提取',
-      flag: false,
-      descriptions: [],
-    },
-  ],
-  internationalDeparture: [
-    {
-      name: '入园',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '海关',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: '装载完成',
     },
     },
-    {
-      name: '运抵',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '安检',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '收运核单',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '理货',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '拉下',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '待运区',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '货站交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '机下交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '装机',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-  ],
-  internationalDeparture2: [
     {
     {
       name: '拉下',
       name: '拉下',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '待运区',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '货站交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'CARGOS_OFFLOAD',
     },
     },
     {
     {
-      name: '机下交接',
-      flag: false,
-      descriptions: [],
-    },
-    {
-      name: '装机',
-      flag: false,
-      descriptions: [],
-    },
-  ],
-  internationalArrival: [
-    {
-      name: '卸机',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '机下交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '货站交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '理货',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '海关',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
-    },
-    {
-      name: '出库',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      name: '拉回',
+      nodeCode: 'OFFLOAD_CONFIRM',
     },
     },
+    // {
+    //   name: '起飞',
+    //   nodeCode: 'TAKEOFF', // 待定
+    // },
     {
     {
       name: '退运',
       name: '退运',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'BILL_RETURN',
     },
     },
   ],
   ],
-  internationalArrival2: [
+  arrival: [
     {
     {
       name: '卸机',
       name: '卸机',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'CARGOS_ARR_HANDOVER',
     },
     },
     {
     {
       name: '机下交接',
       name: '机下交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'CARGOS_HANDOVER_STATUS',
     },
     },
     {
     {
       name: '货站交接',
       name: '货站交接',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: '货站交接', // 暂无
     },
     },
     {
     {
       name: '理货',
       name: '理货',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      nodeCode: 'IMP_TALLY',
     },
     },
     {
     {
-      name: '运抵',
-      flag: true,
-      descriptions: ['A32', '534件', '通过', '10:25'],
+      name: '出库',
+      nodeCode: 'FSU_DLV',
     },
     },
   ],
   ],
+  internationalDeparture: [],
+  internationalArrival: [],
 }
 }
 
 
 export default function useTrackData(
 export default function useTrackData(
-  trackName: string,
-  trackDataContentList: ComputedRef<TrackDataContent[]>
+  name: string,
+  trackData: MaybeRef<CommonData[]>
 ) {
 ) {
+  const isInternational = name.includes('International')
   const trackAirlines = ref<TrackAirline[]>([])
   const trackAirlines = ref<TrackAirline[]>([])
-  const getTrackAirlines = async () => {
-    try {
-      trackAirlines.value = await trackDataContentList.value.reduce(
-        async (
-          pre,
-          { flightNO, airport, flightDate, isDeparture, dataContent }
-        ) => {
-          const airlines = await pre
-          const trackNodeList = await getTrackData(
-            DATACONTENT_ID[
-              trackName.endsWith('Waybill') ? 'waybillTrack' : 'goodsTrack'
-            ],
-            dataContent
-          )
-          const trackAirport = {
-            airport,
-            isDeparture,
-            trackSteps: trackNodeList.map(({ C0, C1, C2, C3 }) => ({
-              name: String(C0 ?? ''),
-              flag: Boolean(C1 && C2 && C3),
-              descriptions: [
-                String(C1 ?? ''),
-                String(C2 ?? ''),
-                String(C3 ?? ''),
-              ],
-            })),
+
+  const getTrackAirlines = () => {
+    trackAirlines.value = unref(trackData).reduce(
+      (
+        airlines,
+        {
+          flightNO,
+          flightDate,
+          LoadingLocation,
+          UnloadingLocation,
+          nodeCode,
+          execPosition,
+          ConsignmentItemPackagingQuantityQuantity,
+          execResult,
+          execTime,
+        }
+      ) => {
+        const isDeparture = [
+          'DEH',
+          'ACC_CHECK',
+          '安检',
+          'ACC_BUP',
+          'WAT_LOC',
+          'CARGOS_DEP_ULD_HANDOVER',
+          '出港货邮',
+          '装载完成',
+          'CARGOS_OFFLOAD',
+          'OFFLOAD_CONFIRM',
+          'BILL_RETURN',
+        ].includes(String(nodeCode))
+        const airport = isDeparture ? LoadingLocation : UnloadingLocation
+        const trackNode = {
+          flag: Boolean(
+            execPosition ||
+              ConsignmentItemPackagingQuantityQuantity ||
+              execResult ||
+              execTime
+          ),
+          descriptions: [
+            execPosition,
+            ConsignmentItemPackagingQuantityQuantity,
+            execResult,
+            String(execTime ?? '').split('T')[1],
+          ],
+        }
+        const nodeList = trackNodesMap[
+          isDeparture
+            ? isInternational
+              ? 'internationalDeparture'
+              : 'departure'
+            : isInternational
+            ? 'internationalArrival'
+            : 'arrival'
+        ].map(node => {
+          if (node.nodeCode === nodeCode) {
+            return {
+              ...node,
+              ...trackNode,
+            }
+          } else {
+            return {
+              ...node,
+              flag: false,
+              descriptions: [],
+            }
           }
           }
-          const airline = airlines.find(
-            airline =>
-              airline.flightNO === flightNO && airline.flightDate === flightDate
+        })
+        if (!isDeparture) {
+          console.log(trackNode, nodeList)
+        }
+        const airline = airlines.find(
+          airline =>
+            airline.flightNO === flightNO &&
+            airline.flightDate === airline.flightDate
+        )
+        if (airline) {
+          const trackAirport = airline.airports.find(
+            trackAirport => trackAirport.airport === airport
           )
           )
-          if (airline) {
-            airline.airports.push(trackAirport)
+          if (trackAirport) {
+            trackAirport.trackSteps = trackAirport.trackSteps.map(node => {
+              if (node.nodeCode === nodeCode) {
+                node = {
+                  ...node,
+                  ...trackNode,
+                }
+              }
+              return node
+            })
           } else {
           } else {
-            airlines.push({
-              flightNO,
-              flightDate,
-              airports: [trackAirport],
+            airline.airports.push({
+              airport,
+              isDeparture: isDeparture,
+              trackSteps: nodeList,
             })
             })
           }
           }
-          return airlines
-        },
-        Promise.resolve([] as TrackAirline[])
-      )
-    } catch (error) {
-      console.error(error)
-    }
-  }
-  const getTrackData = async (id: number, dataContent: CommonValue[]) => {
-    try {
-      const {
-        code,
-        returnData: { listValues },
-        message,
-      } = await Query<TrackNodeData>({
-        id,
-        dataContent,
-      })
-      if (Number(code) !== 0) {
-        throw new Error(message || '失败')
-      }
-      return listValues
-    } catch (error) {
-      return Promise.reject(error)
-    }
+        } else {
+          airlines.push({
+            flightNO,
+            flightDate,
+            airports: [
+              {
+                airport,
+                isDeparture: isDeparture,
+                trackSteps: nodeList,
+              },
+            ],
+          })
+        }
+        return airlines
+      },
+      [] as TrackAirline[]
+    )
   }
   }
 
 
-  // watch(trackDataContentList, () => {
-  //   getTrackAirlines()
-  // })
-
-  const getSimulateTrackData = () => {
-    const length = trackName.includes('Waybill') ? 2 : 1
-    trackAirlines.value = Array.from({ length }, (_, airlineIndex) => {
-      const length = trackName.includes('International') ? 1 : 2
-      return {
-        flightNO: airlineIndex < 1 ? 'CA1001' : 'CA1003',
-        flightDate: '2022/09/10',
-        airports: Array.from({ length }, (_, airportIndex) => ({
-          airport: airportIndex < 1 ? '深圳机场' : '南京机场',
-          isDeparture: trackName.includes('Departure')
-            ? airportIndex < 1
-              ? 1
-              : 0
-            : airportIndex < 1
-            ? 0
-            : 1,
-          trackSteps: trackName.includes('International')
-            ? trackName.includes('Departure')
-              ? airlineIndex < 1
-                ? simulateTrackNodesMap.internationalDeparture
-                : simulateTrackNodesMap.internationalDeparture2
-              : airlineIndex < 1
-              ? simulateTrackNodesMap.internationalArrival
-              : simulateTrackNodesMap.internationalArrival2
-            : trackName.includes('Departure')
-            ? airlineIndex < 1
-              ? airportIndex < 1
-                ? simulateTrackNodesMap.departure
-                : simulateTrackNodesMap.arrival
-              : airportIndex < 1
-              ? simulateTrackNodesMap.departure2
-              : simulateTrackNodesMap.arrival2
-            : airlineIndex < 1
-            ? airportIndex < 1
-              ? simulateTrackNodesMap.arrival
-              : simulateTrackNodesMap.departure
-            : airportIndex < 1
-            ? simulateTrackNodesMap.arrival2
-            : simulateTrackNodesMap.departure2,
-        })),
-      }
-    })
-  }
-  onMounted(() => {
-    getSimulateTrackData()
+  watch(trackData, () => {
+    getTrackAirlines()
   })
   })
 
 
+  // const getTrackAirlines = async () => {
+  //   try {
+  //     trackAirlines.value = await trackDataContentList.value.reduce(
+  //       async (
+  //         pre,
+  //         { flightNO, airport, flightDate, isDeparture, dataContent }
+  //       ) => {
+  //         const airlines = await pre
+  //         const trackNodeList = await getTrackData(
+  //           DATACONTENT_ID[
+  //             name.slice(0, 1).toLowerCase() + name.slice(1) + 'Track'
+  //           ],
+  //           dataContent
+  //         )
+  //         const trackSteps: TrackNode[] = trackNodesMap[
+  //           isDeparture
+  //             ? isInternational
+  //               ? 'internationalDeparture'
+  //               : 'departure'
+  //             : isInternational
+  //             ? 'internationalArrival'
+  //             : 'arrival'
+  //         ].map(node => {
+  //           const sameNode = trackNodeList.find(
+  //             ({ C0, C1, C2, C3 }) => C0 === node.nodeCode
+  //           )
+  //           if (sameNode) {
+  //             node = {
+  //               ...node,
+  //               flag: true,
+  //               descriptions: [
+  //                 String(sameNode.C1 ?? ''),
+  //                 String(sameNode.C2 ?? ''),
+  //                 String(sameNode.C3 ?? ''),
+  //               ],
+  //             }
+  //           } else {
+  //             node = {
+  //               ...node,
+  //               flag: false,
+  //               descriptions: [],
+  //             }
+  //           }
+  //           return node
+  //         })
+  //         const trackAirport = {
+  //           airport,
+  //           isDeparture,
+  //           trackSteps,
+  //         }
+  //         const airline = airlines.find(
+  //           airline =>
+  //             airline.flightNO === flightNO && airline.flightDate === flightDate
+  //         )
+  //         if (airline) {
+  //           airline.airports.push(trackAirport)
+  //         } else {
+  //           airlines.push({
+  //             flightNO,
+  //             flightDate,
+  //             airports: [trackAirport],
+  //           })
+  //         }
+  //         return airlines
+  //       },
+  //       Promise.resolve([] as TrackAirline[])
+  //     )
+  //   } catch (error) {
+  //     console.error(error)
+  //   }
+  // }
+  // const getTrackData = async (id: number, dataContent: CommonValue[]) => {
+  //   try {
+  //     const {
+  //       code,
+  //       returnData: { listValues },
+  //       message,
+  //     } = await Query<TrackNodeData>({
+  //       id,
+  //       dataContent,
+  //     })
+  //     if (Number(code) !== 0) {
+  //       throw new Error(message || '失败')
+  //     }
+  //     return listValues
+  //   } catch (error) {
+  //     return Promise.reject(error)
+  //   }
+  // }
+
+  // const getSimulateTrackData = () => {
+  //   const length = name.includes('Waybill') ? 2 : 1
+  //   trackAirlines.value = Array.from({ length }, (_, airlineIndex) => {
+  //     const length = name.includes('International') ? 1 : 2
+  //     return {
+  //       flightNO: airlineIndex < 1 ? 'CA1001' : 'CA1003',
+  //       flightDate: '2022/09/10',
+  //       airports: Array.from({ length }, (_, airportIndex) => ({
+  //         airport: airportIndex < 1 ? '深圳机场' : '南京机场',
+  //         isDeparture: name.includes('Departure')
+  //           ? airportIndex < 1
+  //             ? 1
+  //             : 0
+  //           : airportIndex < 1
+  //           ? 0
+  //           : 1,
+  //         trackSteps: name.includes('International')
+  //           ? name.includes('Departure')
+  //             ? airlineIndex < 1
+  //               ? simulateTrackNodesMap.internationalDeparture
+  //               : simulateTrackNodesMap.internationalDeparture2
+  //             : airlineIndex < 1
+  //             ? simulateTrackNodesMap.internationalArrival
+  //             : simulateTrackNodesMap.internationalArrival2
+  //           : name.includes('Departure')
+  //           ? airlineIndex < 1
+  //             ? airportIndex < 1
+  //               ? simulateTrackNodesMap.departure
+  //               : simulateTrackNodesMap.arrival
+  //             : airportIndex < 1
+  //             ? simulateTrackNodesMap.departure2
+  //             : simulateTrackNodesMap.arrival2
+  //           : airlineIndex < 1
+  //           ? airportIndex < 1
+  //             ? simulateTrackNodesMap.arrival
+  //             : simulateTrackNodesMap.departure
+  //           : airportIndex < 1
+  //           ? simulateTrackNodesMap.arrival2
+  //           : simulateTrackNodesMap.departure2,
+  //       })),
+  //     }
+  //   })
+  // }
+  // onMounted(() => {
+  //   getSimulateTrackData()
+  // })
+
   const trackBoxStyle = computed(
   const trackBoxStyle = computed(
     () => (airports: TrackAirport[], index: number) => {
     () => (airports: TrackAirport[], index: number) => {
       const style: CSSProperties = {}
       const style: CSSProperties = {}

+ 1 - 1
src/views/systemSettings/queryTemplate/queryTemplateAdd.vue

@@ -74,7 +74,7 @@
             >
             >
               <el-input
               <el-input
                 v-model="ruleForm.pageRows"
                 v-model="ruleForm.pageRows"
-                size="medium"
+                size="default"
                 placeholder="请输入每页显示行数"
                 placeholder="请输入每页显示行数"
                 type="number"
                 type="number"
                 clearable
                 clearable

+ 1 - 1
src/views/systemSettings/queryTemplate/queryTemplateEdit.vue

@@ -74,7 +74,7 @@
             >
             >
               <el-input
               <el-input
                 v-model="ruleForm.pageRows"
                 v-model="ruleForm.pageRows"
-                size="medium"
+                size="default"
                 placeholder="请输入每页显示行数"
                 placeholder="请输入每页显示行数"
                 type="number"
                 type="number"
                 clearable
                 clearable