Browse Source

实时视图-更换查询模板

zhongxiaoyu 2 years ago
parent
commit
a3c761b61c

+ 13 - 18
public/config.js

@@ -135,27 +135,22 @@ var DATACONTENT_ID = {
 
   /***-----综合可视化------***/
   // 航站
-  departureAirport: 1803507, // 国内出港航站
-  internationalDepartureAirport: 1803508, // 国际出港航站
-  arrivalAirport: 1803505, // 国内进港航站
-  internationalArrivalAirport: 1803506, // 国际进港航站
+  departureAirport: 1803524, // 国内出港航站
+  internationalDepartureAirport: 1803525, // 国际出港航站
+  arrivalAirport: 1803522, // 国内进港航站
+  internationalArrivalAirport: 1803523, // 国际进港航站
   // 航班
-  departureFlightInfo: 1803511, // 国内离港航班基础信息
-  departureFlightContainer: 1803512, // 国内离港航班集装器
-  departureFlightWaybill: 1803513, // 国内离港航班运单
-  internationalDepartureFlightInfo: 1803511, // 国际离港航班基础信息
-  internationalDepartureFlightContainer: 1803512, // 国际离港航班集装器
-  internationalDepartureFlightWaybill: 1803513, // 国际离港航班运单
-  arrivalFlightInfo: 1803509, // 国内进港航班基础信息
-  arrivalFlightWaybill: 1803510, // 国内进港航班运单
-  internationalArrivalFlightInfo: 1803509, // 国际进港航班基础信息
-  internationalArrivalFlightWaybill: 1803510, // 国际进港航班运单
+  departureFlightInfo: 1803528, // 离港航班基础信息
+  departureFlightWaybill: 1803529, // 离港航班运单
+  departureFlightContainer: 1803530, // 离港航班集装器
+  arrivalFlightInfo: 1803526, // 进港航班基础信息
+  arrivalFlightWaybill: 1803527, // 进港航班运单
   airportNameZh: 1803517, // 机场中文名
-  departureContainerWaybill: 1803518, // 离港航班-集装器内运单
-  arrivalContainerWaybill: 1803519, // 进港航班-集装器内运单
+  departureContainerWaybill: 1803531, // 离港航班-集装器内运单
+  // arrivalContainerWaybill: 1803519, // 进港航班-集装器内运单
   // 运单
-  waybillInfo: 1803514, // 运单基础信息
-  waybillGoods: 1803515, // 运单节点跟踪
+  waybillInfo: 1803520, // 运单基础信息
+  waybillGoods: 1803521, // 运单节点跟踪
   // 货物
   goodsInfo: 100008, // 货物基础信息
   goodsAirline: 100009, // 货物航段

+ 8 - 2
src/views/realTime/components/FlightView/index.vue

@@ -130,7 +130,10 @@ const {
   tableColumns: containerTableColumns,
   tableData: containerTableData,
   getTableData: getContainerTableData,
-} = useTable(`${props.name}Container`, dataContent)
+} = useTable(
+  `${isDeparture.value ? 'Departure' : 'Arrival'}FlightContainer`,
+  Array(3).fill(dataContent).flat()
+)
 const waybillTableFormatter = (row, column, cellValue, index) => {
   if (column.property.includes('Time') && typeof cellValue === 'string') {
     return cellValue.replace('T', '\n')
@@ -142,7 +145,10 @@ const {
   tableColumns: waybillTableColumns,
   tableData: waybillTableData,
   getTableData: getWaybillTableData,
-} = useTable(`${props.name}Waybill`, dataContent)
+} = useTable(
+  `${isDeparture.value ? 'Departure' : 'Arrival'}FlightWaybill`,
+  dataContent
+)
 
 useLoop([getFlightInfo, getContainerTableData, getWaybillTableData], 'flight')
 

+ 1 - 1
src/views/realTime/components/FlightView/useFlightInfo.ts

@@ -191,7 +191,7 @@ export function useFlightInfo(name: string, dataContent: CommonValue[]) {
       } = await Query({
         id:
           DATACONTENT_ID[
-            name.slice(0, 1).toLowerCase() + name.slice(1) + 'Info'
+            `${name.includes('Departure') ? 'departure' : 'arrival'}FlightInfo`
           ],
         dataContent,
       })

+ 7 - 7
src/views/realTime/components/WaybillView/index.vue

@@ -120,20 +120,20 @@ const props = defineProps({
 })
 
 const route = useRoute()
-const { waybillNO } = route.query
+const { flightDate, waybillNO } = route.query
+const dataContent = [flightDate, waybillNO] as string[]
 
 const {
   waybillInfoItems,
   waybillInfo,
   computedWaybillInfo,
   getWaybillInfo,
-} = useWaybillInfo(props.name, [waybillNO as string])
+} = useWaybillInfo(props.name, dataContent)
 
-const {
-  tableColumns,
-  tableData: trackData,
-  getTableData,
-} = useTable(`${props.name}Goods`, [waybillNO as string])
+const { tableColumns, tableData: trackData, getTableData } = useTable(
+  `${props.name}Goods`,
+  dataContent
+)
 
 useLoop([getWaybillInfo, getTableData], 'waybill')
 

+ 1 - 0
src/views/realTime/hooks/useTableCellClick.ts

@@ -15,6 +15,7 @@ export function useTableCellClick(tableName?: string) {
           router.push({
             path: `${route.path.split('/').slice(0, -1).join('/')}/waybill`,
             query: {
+              flightDate: route.query.flightDate,
               waybillNO: row.stockCode,
             },
           })