@@ -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
@@ -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 ? '是' : '否'
@@ -165,7 +165,7 @@ watch(
@@ -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] ?? ''