Browse Source

实时视图-查询模板ID修改

zhongxiaoyu 2 years ago
parent
commit
ae74532a04

+ 22 - 9
public/config.js

@@ -140,17 +140,30 @@ var DATACONTENT_ID = {
   arrivalAirport: 1803522, // 国内进港航站
   internationalArrivalAirport: 1803523, // 国际进港航站
   // 航班
-  departureFlightInfo: 1803528, // 离港航班基础信息
-  departureFlightWaybill: 1803529, // 离港航班运单
-  departureFlightContainer: 1803530, // 离港航班集装器
-  arrivalFlightInfo: 1803526, // 进港航班基础信息
-  arrivalFlightWaybill: 1803527, // 进港航班运单
+  departureFlightInfo: 1803528, // 国内离港航班基础信息
+  departureFlightWaybill: 1803529, // 国内离港航班运单
+  departureFlightContainer: 1803530, // 国内离港航班集装器
+  arrivalFlightInfo: 1803526, // 国内进港航班基础信息
+  arrivalFlightWaybill: 1803527, // 国内进港航班运单
+  internationalDepartureFlightInfo: 1803528, // 国际离港航班基础信息
+  internationalDepartureFlightWaybill: 1803529, // 国际离港航班运单
+  internationalDepartureFlightContainer: 1803530, // 国际离港航班集装器
+  internationalArrivalFlightInfo: 1803526, // 国际进港航班基础信息
+  internationalArrivalFlightWaybill: 1803527, // 国际进港航班运单
+  departureFlightContainerWaybill: 1803531, // 国内离港航班-集装器内运单
+  // arrivalFlightContainerWaybill: 1803519, // 国内进港航班-集装器内运单
+  internationalDepartureFlightContainerWaybill: 1803531, // 国际离港航班-集装器内运单
+  // arrivalFlightContainerWaybill: 1803519, // 国际进港航班-集装器内运单
   airportNameZh: 1803517, // 机场中文名
-  departureContainerWaybill: 1803531, // 离港航班-集装器内运单
-  // arrivalContainerWaybill: 1803519, // 进港航班-集装器内运单
   // 运单
-  waybillInfo: 1803520, // 运单基础信息
-  waybillGoods: 1803521, // 运单节点跟踪
+  departureWaybillInfo: 1803520, // 国内离港运单基础信息
+  departureWaybillGoods: 1803521, // 国内离港运单节点跟踪
+  arrivalWaybillInfo: 1803520, // 国内进港运单基础信息
+  arrivalWaybillGoods: 1803521, // 国内进港运单节点跟踪
+  internationalDepartureWaybillInfo: 1803520, // 国际离港运单基础信息
+  internationalDepartureWaybillGoods: 1803521, // 国际离港运单节点跟踪
+  internationalArrivalWaybillInfo: 1803520, // 国际进港运单基础信息
+  internationalArrivalWaybillGoods: 1803521, // 国际进港运单节点跟踪
   // 货物
   goodsInfo: 100008, // 货物基础信息
   goodsAirline: 100009, // 货物航段

+ 1 - 1
src/views/realTime/components/AirportView/useAirportTable.ts

@@ -542,7 +542,7 @@ const columnGroupsMap: {
         },
         {
           columnName: 'tally',
-          columnLabel: '理货\n(板卡/运单/件/重量)',
+          columnLabel: '理货\n(运单/件/重量)',
         },
         {
           columnName: 'tallyTime_in',

+ 8 - 6
src/views/realTime/components/FlightView/ContainerWaybillDialog.vue

@@ -28,14 +28,14 @@ const props = defineProps({
     type: Boolean,
     required: true,
   },
+  name: {
+    type: String,
+    required: true,
+  },
   dataContent: {
     type: Array as PropType<CommonValue[]>,
     required: true,
   },
-  isDeparture: {
-    type: Boolean,
-    default: true,
-  },
 })
 
 const emit = defineEmits(['update:flag'])
@@ -94,7 +94,7 @@ const msgTitle = computed(() => props.dataContent.join('-'))
 const tableColumns = ref<CommonTableColumn[]>([])
 const getTableColumns = () => {
   tableColumns.value = tableColumnsMap[
-    props.isDeparture ? 'departure' : 'arrival'
+    props.name.includes('Departure') ? 'departure' : 'arrival'
   ].map(column => ({
     columnDescribe: '',
     dataType: '',
@@ -121,7 +121,9 @@ const getTableData = async () => {
     } = await Query<CommonData>({
       id:
         DATACONTENT_ID[
-          `${props.isDeparture ? 'departure' : 'arrival'}ContainerWaybill`
+          `${props.name.slice(0, 1).toLowerCase()}${props.name.slice(
+            1
+          )}ContainerWaybill`
         ],
       dataContent: props.dataContent,
     })

+ 3 - 11
src/views/realTime/components/FlightView/index.vue

@@ -72,8 +72,8 @@
     </div>
     <ContainerWaybillDialog
       v-model:flag="dialogFlag"
+      :name="name"
       :data-content="containerWaybillDataContent"
-      :is-departure="isDeparture"
     />
   </div>
 </template>
@@ -99,8 +99,6 @@ const props = defineProps({
   },
 })
 
-const isDeparture = computed(() => props.name.includes('Departure'))
-
 const route = useRoute()
 const {
   flightNO,
@@ -131,10 +129,7 @@ const {
   tableColumns: containerTableColumns,
   tableData: containerTableData,
   getTableData: getContainerTableData,
-} = useTable(
-  `${isDeparture.value ? 'Departure' : 'Arrival'}FlightContainer`,
-  Array(3).fill(dataContent).flat()
-)
+} = useTable(`${props.name}Container`, Array(3).fill(dataContent).flat())
 const waybillTableFormatter = (row, column, cellValue, index) => {
   if (column.property.includes('Time') && typeof cellValue === 'string') {
     return cellValue.replace('T', '\n')
@@ -146,10 +141,7 @@ const {
   tableColumns: waybillTableColumns,
   tableData: waybillTableData,
   getTableData: getWaybillTableData,
-} = useTable(
-  `${isDeparture.value ? 'Departure' : 'Arrival'}FlightWaybill`,
-  dataContent
-)
+} = useTable(`${props.name}Waybill`, dataContent)
 
 useLoop([getFlightInfo, getContainerTableData, getWaybillTableData], 'flight')
 

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

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

+ 4 - 1
src/views/realTime/components/WaybillView/useWaybillInfo.ts

@@ -96,7 +96,10 @@ export function useWaybillInfo(name: string, dataContent: CommonValue[]) {
         returnData: { listValues },
         message,
       } = await Query<CommonData>({
-        id: DATACONTENT_ID.waybillInfo,
+        id:
+          DATACONTENT_ID[
+            `${name.slice(0, 1).toLowerCase()}${name.slice(1)}Info`
+          ],
         dataContent,
       })
       if (Number(code) !== 0) {

+ 7 - 6
src/views/realTime/hooks/useTable.ts

@@ -2,11 +2,12 @@ import { Query } from '@/api/webApi'
 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)]
-  }
+  // if (name.endsWith('WaybillGoods')) {
+  //   return DATACONTENT_ID.waybillGoods
+  // } else {
+  //   return DATACONTENT_ID[name.slice(0, 1).toLowerCase() + name.slice(1)]
+  // }
+  return DATACONTENT_ID[name.slice(0, 1).toLowerCase() + name.slice(1)]
 }
 
 const tableColumnsMap: {
@@ -413,7 +414,7 @@ const tableColumnsMap: {
     { columnLabel: '运单数', columnName: 'list', width: 60, needCount: 1 },
     { columnLabel: '件数', columnName: 'number', width: 60, needCount: 1 },
     {
-      columnLabel: '货',
+      columnLabel: '货',
       columnName: 'tally',
       className: 'cell-filter cell-filter-yellow',
     },