Browse Source

"20230131-0201管理端修改建议"部分修改

zhongxiaoyu 2 years ago
parent
commit
8abd2d16b2

+ 1 - 1
public/nodeCode.js

@@ -1,4 +1,4 @@
-window.NODE_CODE = {
+var NODE_CODE = {
   NEW: '获取运单',
   DEH: '收运核单',
   ACC_CHECK: '查验',

+ 25 - 8
src/components/ColumnSet/index.vue

@@ -98,12 +98,28 @@ const submitHandler = () => {
   dialogHide()
 }
 
-const { savedColumnKeysMap, saveColumnKeys } = useTableSettingsStore()
+const {
+  savedHiddenColumnKeysMap,
+  saveHiddenColumnKeys,
+} = useTableSettingsStore()
 const route = useRoute()
 
 const checkedSubmit = () => {
   emits('checkedSubmit', checkedColumnKeys.value)
-  saveColumnKeys(checkedColumnKeys.value)
+  updateHiddenColumnKeys()
+}
+
+const updateHiddenColumnKeys = () => {
+  const hiddenColumnKeys = needShowColumns.value.reduce(
+    (keys: string[], { columnName }) => {
+      if (!checkedColumnKeys.value.includes(columnName)) {
+        keys.push(columnName)
+      }
+      return keys
+    },
+    []
+  )
+  saveHiddenColumnKeys(hiddenColumnKeys)
 }
 
 const columnGroups = computed(() => {
@@ -147,12 +163,13 @@ const checkedColumnKeys = computed<string[]>(() => {
 const fullTableName = route.path + (props.name ? `/${props.name}` : '')
 
 watch(needShowColumns, defaultColumns => {
-  const savedColumnKeys = savedColumnKeysMap[fullTableName]
-  const columns = savedColumnKeys
-    ? defaultColumns.filter(column =>
-        savedColumnKeys.includes(column.columnName)
-      )
-    : defaultColumns
+  const savedHiddenColumnKeys = savedHiddenColumnKeysMap[fullTableName]
+  const columns = defaultColumns.filter(column => {
+    if (savedHiddenColumnKeys) {
+      return !savedHiddenColumnKeys.includes(column.columnName)
+    }
+    return !column.defaultHidden
+  })
 
   if (inGroup.value) {
     checkedGroups.value = {}

+ 6 - 6
src/router/routes/routes-file-six.ts

@@ -316,12 +316,12 @@ const ActualTimeRoutes = {
         },
       ],
     },
-    {
-      path: '/realTime/trackMap',
-      name: 'TrackMap',
-      meta: { title: '轨迹地图', roles: ['track_map_page'] },
-      component: () => import('@/views/realTime/trackMap/index.vue'),
-    },
+    // {
+    //   path: '/realTime/trackMap',
+    //   name: 'TrackMap',
+    //   meta: { title: '轨迹地图', roles: ['track_map_page'] },
+    //   component: () => import('@/views/realTime/trackMap/index.vue'),
+    // },
   ],
 }
 

+ 8 - 8
src/store/tableSettings.ts

@@ -7,15 +7,15 @@ interface FilterValues {
 export const useTableSettingsStore = defineStore('tableSettings', () => {
   const route = useRoute()
 
-  const savedColumnKeysMap = ref<{ [fullTableName: string]: string[] }>(
-    JSON.parse(localStorage.getItem('savedColumnKeysMap') ?? '{}')
+  const savedHiddenColumnKeysMap = ref<{ [fullTableName: string]: string[] }>(
+    JSON.parse(localStorage.getItem('savedHiddenColumnKeysMap') ?? '{}')
   )
-  const saveColumnKeys = (columnKeys: string[] = [], tableName?: string) => {
+  const saveHiddenColumnKeys = (columnKeys: string[] = [], tableName?: string) => {
     const fullTableName = route.path + (tableName ? `/${tableName}` : '')
-    savedColumnKeysMap.value[fullTableName] = columnKeys
+    savedHiddenColumnKeysMap.value[fullTableName] = columnKeys
     localStorage.setItem(
-      'savedColumnKeysMap',
-      JSON.stringify(savedColumnKeysMap.value)
+      'savedHiddenColumnKeysMap',
+      JSON.stringify(savedHiddenColumnKeysMap.value)
     )
   }
 
@@ -35,8 +35,8 @@ export const useTableSettingsStore = defineStore('tableSettings', () => {
   }
 
   return {
-    savedColumnKeysMap,
-    saveColumnKeys,
+    savedHiddenColumnKeysMap,
+    saveHiddenColumnKeys,
     savedTableFilterValueMap,
     saveTableFilterValues,
   }

+ 15 - 3
src/views/realTime/components/AirportView/index.vue

@@ -124,11 +124,23 @@ const { tableColumns, tableData, getTableData } = useAirportTable(
 )
 
 const finishedCount = ref(0)
-const { warningRules, getWarningRules } = useFlightState(props.name, tableData, finishedCount)
 
-useLoop([getWarningRules, getTableData], 'airport', [formData])
+const { warningRules, getWarningRules } = useFlightState(
+  props.name,
+  tableData,
+  finishedCount
+)
+
+useLoop(
+  [
+    // getWarningRules,
+    getTableData,
+  ],
+  'airport',
+  [formData]
+)
 
-const countFlag = ref(true)
+const countFlag = ref(false)
 const { tableColumnFormatter, tableDataFormatter } = useFormatter(countFlag)
 
 const UTCFlag = ref(true)

+ 23 - 18
src/views/realTime/components/AirportView/useAirportTable.ts

@@ -57,6 +57,7 @@ const columnGroupsMap: {
           columnName: 'lastflightNO',
           columnLabel: '前序航班',
           fixed: true,
+          defaultHidden: true,
         },
         {
           columnName: 'acLandingTime',
@@ -107,11 +108,11 @@ const columnGroupsMap: {
         // },
         {
           columnName: 'checks',
-          columnLabel: '查\n(拒运/查验)',
+          columnLabel: '收运核查\n(拒运/查验)',
         },
         {
           columnName: 'checkTime',
-          columnLabel: '查验时间',
+          columnLabel: '收运核查\n时间',
         },
         {
           columnName: 'securityYes',
@@ -162,26 +163,26 @@ const columnGroupsMap: {
         //   columnName: 'requestDepotJoinTime',
         //   columnLabel: '发起货站交接\n时间',
         // },
-        {
-          columnName: 'depotJoin',
-          columnLabel: '货站交接\n(板卡/件)',
-        },
-        {
-          columnName: 'depotJoinTime',
-          columnLabel: '货站交接\n时间',
-        },
+        // {
+        //   columnName: 'depotJoin',
+        //   columnLabel: '货站交接\n(板卡/件)',
+        // },
+        // {
+        //   columnName: 'depotJoinTime',
+        //   columnLabel: '货站交接\n时间',
+        // },
         {
           columnName: 'resure',
-          columnLabel: '运输前复核\n(板卡/件)',
+          columnLabel: '交接复核\n(板卡/件)',
         },
         {
           columnName: 'resureTime',
-          columnLabel: '运输前复核\n时间',
+          columnLabel: '交接复核\n时间',
         },
         // {
         //   columnName: 'planeDown',
         //   columnLabel: '机下交接\n(板卡/件)',
-        //   columnDescribe: '根据运输前复核计算所得',
+        //   columnDescribe: '根据交接复核计算所得',
         // },
         {
           columnName: 'planeDownTime',
@@ -194,6 +195,7 @@ const columnGroupsMap: {
         {
           columnName: 'loadPlaneSureTime',
           columnLabel: '装机完成\n时间',
+          defaultHidden: true,
         },
         // {
         //   columnName: 'loadPlane',
@@ -254,7 +256,7 @@ const columnGroupsMap: {
         },
         {
           columnName: 'target',
-          columnLabel: '目的站',
+          columnLabel: '航程',
           needFilters: 1,
         },
         {
@@ -419,10 +421,12 @@ const columnGroupsMap: {
         {
           columnName: 'enterCustoms',
           columnLabel: '海关中控\n(运单/件)',
+          defaultHidden: true,
         },
         {
           columnName: 'enterCustomsTime',
           columnLabel: '海关中控\n时间',
+          defaultHidden: true,
         },
         {
           columnName: 'passCustoms',
@@ -531,16 +535,16 @@ const columnGroupsMap: {
         // },
         {
           columnName: 'resure',
-          columnLabel: '运输前复核\n(板卡/件)',
+          columnLabel: '交接复核\n(板卡/件)',
         },
         {
           columnName: 'resureTime',
-          columnLabel: '运输前复核\n时间',
+          columnLabel: '交接复核\n时间',
         },
         // {
         //   columnName: 'planeDown',
         //   columnLabel: '机下交接\n(板卡/件)',
-        //   columnDescribe: '根据运输前复核计算所得',
+        //   columnDescribe: '根据交接复核计算所得',
         // },
         {
           columnName: 'planeDownTime',
@@ -553,6 +557,7 @@ const columnGroupsMap: {
         {
           columnName: 'loadPlaneSureTime',
           columnLabel: '装机完成\n时间',
+          defaultHidden: true,
         },
         // {
         //   columnName: 'loadPlane',
@@ -605,7 +610,7 @@ const columnGroupsMap: {
         },
         {
           columnName: 'target',
-          columnLabel: '目的站',
+          columnLabel: '航程',
           needFilters: 1,
         },
         {

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

@@ -145,7 +145,17 @@ const tableFormatter: CommonTableFormatter = (
   column,
   cellValue,
   index
-) => {
+  ) => {
+  if (column.property === 'execResult') {
+    const execResult = Number(cellValue)
+    if (Number.isNaN(execResult)) {
+      return cellValue
+    }
+    if (props.name === 'InternationalDepartureFlight') {
+      return execResult ? '通过' : '异常'
+    }
+    return execResult ? '通过' : '未通过'
+  }
   const value = String(cellValue ?? '').trim()
   if (
     column.property.includes('Time') ||

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

@@ -41,7 +41,7 @@ const flightInfoItemsMap = {
         showOverflowTooltip: true,
       },
       {
-        label: '货站已交接集装器',
+        label: '交接复核集装器',
         key: 'depotJoin',
       },
       {
@@ -52,10 +52,10 @@ const flightInfoItemsMap = {
         label: '拉下集装器/货物数',
         key: 'pull',
       },
-      {
-        label: '集装器数量',
-        key: 'stowage',
-      },
+      // {
+      //   label: '集装器数量',
+      //   key: 'stowage',
+      // },
     ],
     [
       {