|
|
@@ -110,11 +110,11 @@
|
|
|
<span>{{ parseTime(scope.row.qwCreateTime) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="最后同步时间" width="160" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.syncTime) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+<!-- <el-table-column label="最后同步时间" width="160" align="center">-->
|
|
|
+<!-- <template slot-scope="scope">-->
|
|
|
+<!-- <span>{{ parseTime(scope.row.syncTime) }}</span>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </el-table-column>-->
|
|
|
<el-table-column label="操作" align="center" width="220" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
@@ -415,6 +415,55 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 格式化时间 */
|
|
|
+ parseTime(time, pattern) {
|
|
|
+ if (arguments.length === 0 || !time) {
|
|
|
+ return '-'
|
|
|
+ }
|
|
|
+ const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
|
|
+ let date
|
|
|
+ if (typeof time === 'object') {
|
|
|
+ date = time
|
|
|
+ } else {
|
|
|
+ if ((typeof time === 'string')) {
|
|
|
+ if ((/^[0-9]+$/.test(time))) {
|
|
|
+ // 如果是纯数字字符串,转为数字
|
|
|
+ time = parseInt(time)
|
|
|
+ } else {
|
|
|
+ // 处理 "2026-03-19T14:05:41.000+0800" 格式
|
|
|
+ time = time.replace(/-/g, '/') // 将 ISO 格式转换为兼容格式
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((typeof time === 'number') && (time.toString().length === 10)) {
|
|
|
+ time = time * 1000
|
|
|
+ }
|
|
|
+ date = new Date(time)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果日期无效
|
|
|
+ if (isNaN(date.getTime())) {
|
|
|
+ return '-'
|
|
|
+ }
|
|
|
+
|
|
|
+ const formatObj = {
|
|
|
+ y: date.getFullYear(),
|
|
|
+ m: date.getMonth() + 1,
|
|
|
+ d: date.getDate(),
|
|
|
+ h: date.getHours(),
|
|
|
+ i: date.getMinutes(),
|
|
|
+ s: date.getSeconds(),
|
|
|
+ a: date.getDay()
|
|
|
+ }
|
|
|
+ const timeStr = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
|
|
+ const value = formatObj[key]
|
|
|
+ // 补零
|
|
|
+ if (key === 'y') {
|
|
|
+ return value.toString()
|
|
|
+ }
|
|
|
+ return ('00' + value).substr(-2)
|
|
|
+ })
|
|
|
+ return timeStr
|
|
|
+ },
|
|
|
/** 处理用户选择变化 - 同步更新所有相关字段 */
|
|
|
handleUserSelectionChange(selectedIds) {
|
|
|
|