Ver Fonte

时间格式化

xusl há 11 meses atrás
pai
commit
723e8b7483

+ 2 - 1
ipp-ap/src/const/crud/nwp.js

@@ -1,3 +1,4 @@
+import moment11 from 'moment'
 export const tableOption = {
   "border": true,
   "index": true,
@@ -25,7 +26,7 @@ export const tableOption = {
     "width":150,
     formatter: (row, column, cellValue, index) => {
       const date = new Date(cellValue);
-      return date.toLocaleString(); // 转换为本地时间并显示
+      return moment11(date).format('YYYY-MM-DD HH:mm:ss'); // 转换为本地时间并显示
     }
   }
     // ,

+ 2 - 1
ipp-ap/src/const/crud/windtowerstatusdata.js

@@ -1,3 +1,4 @@
+import moment11 from 'moment'
 export const tableOption = {
   "border": true,
   "index": true,
@@ -30,7 +31,7 @@ export const tableOption = {
       "prop": "time",
       formatter: (row, column, cellValue, index) => {
         const date = new Date(cellValue);
-        return date.toLocaleString(); // 转换为本地时间并显示
+        return moment11(date).format('YYYY-MM-DD HH:mm:ss'); // 转换为本地时间并显示
       }
     }
     , {