zhongxiaoyu 2 жил өмнө
parent
commit
08d5724646

+ 1 - 1
src/views/dataQuery/components/DataQueryView/index.vue

@@ -180,7 +180,7 @@ const { filteredColumns, columnChecked } = useTableColumnSet(tableColumns)
 const formatter: CommonTableFormatter = (row, column, cellValue, index) => {
   const value = String(cellValue ?? '').trim()
   if (column.property.includes('Time')) {
-    return value.replace('T', '\n')
+    return value.replace(/(T|\s)+/, '\n')
   }
   return value
 }

+ 4 - 1
src/views/realTime/components/AirportView/useFormatter.ts

@@ -31,7 +31,10 @@ export function useFormatter(flag: Ref<boolean>) {
       }
     }
     if (property.includes('Time') && typeof cellValue === 'string') {
-      return cellValue.trim().slice(5, -3).replace('T', '\n')
+      return cellValue
+        .trim()
+        .slice(5, -3)
+        .replace(/(T|\s)+/, '\n')
     }
     if (property === 'jiahuo') {
       return cellValue ? '是' : '否'

+ 1 - 1
src/views/realTime/components/FlightView/ContainerWaybillDialog.vue

@@ -165,7 +165,7 @@ watch(
 const formatter: CommonTableFormatter = (row, column, cellValue, index) => {
   const value = String(cellValue ?? '').trim()
   if (column.property.includes('Time')) {
-    return value.replace('T', '\n')
+    return value.replace(/(T|\s)+/, '\n')
   }
   return value
 }

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

@@ -168,7 +168,7 @@ const tableFormatter: CommonTableFormatter = (
       'pullSure',
     ].includes(column.property)
   ) {
-    return value.slice(5, -3).replace('T', '\n')
+    return value.slice(5, -3).replace(/(T|\s)+/, '\n')
   }
   if (column.property === 'nodeCode') {
     return NODE_CODE[value] ?? ''