From bbeb0802312aaa4e09c142da1391a21afae064c7 Mon Sep 17 00:00:00 2001
From: lxd <1004405501@qq.com>
Date: Mon, 1 Sep 2025 12:03:59 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0VIP=E5=88=B0=E6=9C=9F?=
=?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/devices/DetailsForm.vue | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/views/devices/DetailsForm.vue b/src/views/devices/DetailsForm.vue
index f3081a98f..41337ad63 100644
--- a/src/views/devices/DetailsForm.vue
+++ b/src/views/devices/DetailsForm.vue
@@ -46,7 +46,7 @@
{{ formData.isvip === 1 ? '是' : '否' }}
- {{ formData.vipendtime }}
+ {{ formatVipEndTime(formData.vipendtime) }}
@@ -62,6 +62,7 @@ import { DeviceApi } from '@/api/device'
import { ElMessage } from 'element-plus'
import type { DeviceVO } from '@/api/device'
import { regionData, codeToText } from 'element-china-area-data'
+import { formatDate } from '@/utils/formatTime'
defineOptions({ name: 'DeviceDetailsForm' })
@@ -87,6 +88,17 @@ const getDeviceStatusName = (status: string | number) => {
return statusMap[status] || '未知状态'
}
+// 格式化VIP到期时间
+const formatVipEndTime = (time: string | number | Date) => {
+ if (!time) return '未设置'
+ // 如果是时间戳,转换为Date对象
+ if (typeof time === 'number') {
+ return formatDate(new Date(time), 'YYYY-MM-DD HH:mm:ss')
+ }
+ // 如果是字符串或Date对象,直接格式化
+ return formatDate(new Date(time), 'YYYY-MM-DD HH:mm:ss')
+}
+
const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中