|
@@ -73,6 +73,11 @@
|
|
<template v-if="column.dataIndex === 'nextDueDate'">
|
|
<template v-if="column.dataIndex === 'nextDueDate'">
|
|
{{ formatTimestamp(record.nextDueDate) }}
|
|
{{ formatTimestamp(record.nextDueDate) }}
|
|
</template>
|
|
</template>
|
|
|
|
+ <template v-if="column.dataIndex === 'status'">
|
|
|
|
+ <a-tag :color="getStatusColor(record.expiredAt)" style="font-weight: bold;">
|
|
|
|
+ {{ getStatusText(record.expiredAt) }}
|
|
|
|
+ </a-tag>
|
|
|
|
+ </template>
|
|
<template v-if="column.dataIndex === 'action'">
|
|
<template v-if="column.dataIndex === 'action'">
|
|
<a-button type="link" size="small" @click="handleSingleRecover(record)">恢复</a-button>
|
|
<a-button type="link" size="small" @click="handleSingleRecover(record)">恢复</a-button>
|
|
<a-button type="link" size="small" @click="handleSingleSync(record)">同步</a-button>
|
|
<a-button type="link" size="small" @click="handleSingleSync(record)">同步</a-button>
|
|
@@ -159,7 +164,13 @@ const columns = [
|
|
sorter: true
|
|
sorter: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '下次到期时间',
|
|
|
|
|
|
+ title: '状态',
|
|
|
|
+ dataIndex: 'status',
|
|
|
|
+ width: 100,
|
|
|
|
+ align: 'center'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '实际套餐到期时间',
|
|
dataIndex: 'nextDueDate',
|
|
dataIndex: 'nextDueDate',
|
|
width: 180,
|
|
width: 180,
|
|
sorter: true
|
|
sorter: true
|
|
@@ -194,6 +205,22 @@ const formatTimestamp = (timestamp) => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 获取状态文本
|
|
|
|
+const getStatusText = (expiredAt) => {
|
|
|
|
+ if (!expiredAt) return '未知'
|
|
|
|
+ const now = Date.now()
|
|
|
|
+ const expiredTime = expiredAt * 1000
|
|
|
|
+ return expiredTime < now ? '已过期' : '未过期'
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 获取状态颜色
|
|
|
|
+const getStatusColor = (expiredAt) => {
|
|
|
|
+ if (!expiredAt) return 'default'
|
|
|
|
+ const now = Date.now()
|
|
|
|
+ const expiredTime = expiredAt * 1000
|
|
|
|
+ return expiredTime < now ? 'red' : 'green'
|
|
|
|
+}
|
|
|
|
+
|
|
// 获取数据
|
|
// 获取数据
|
|
const fetchData = async () => {
|
|
const fetchData = async () => {
|
|
loading.value = true
|
|
loading.value = true
|
|
@@ -282,7 +309,7 @@ const handleRecover = () => {
|
|
}
|
|
}
|
|
|
|
|
|
const response = await recoverWaf({
|
|
const response = await recoverWaf({
|
|
- hostIds: selectedRowKeys.value,
|
|
|
|
|
|
+ hostIds: selectedRecords.map(item => item.hostId),
|
|
uid: uids[0]
|
|
uid: uids[0]
|
|
})
|
|
})
|
|
|
|
|
|
@@ -327,7 +354,7 @@ const handleSyncTime = () => {
|
|
}
|
|
}
|
|
|
|
|
|
const response = await syncExecuteRenewalActions({
|
|
const response = await syncExecuteRenewalActions({
|
|
- hostIds: selectedRowKeys.value,
|
|
|
|
|
|
+ hostIds: selectedRecords.map(item => item.hostId),
|
|
uid: uids[0]
|
|
uid: uids[0]
|
|
})
|
|
})
|
|
|
|
|
|
@@ -356,7 +383,7 @@ const handleSingleRecover = (record) => {
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
try {
|
|
try {
|
|
const response = await recoverWaf({
|
|
const response = await recoverWaf({
|
|
- hostIds: [record.id],
|
|
|
|
|
|
+ hostIds: [record.hostId],
|
|
uid: record.uid
|
|
uid: record.uid
|
|
})
|
|
})
|
|
|
|
|
|
@@ -382,7 +409,7 @@ const handleSingleSync = (record) => {
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
try {
|
|
try {
|
|
const response = await syncExecuteRenewalActions({
|
|
const response = await syncExecuteRenewalActions({
|
|
- hostIds: [record.id],
|
|
|
|
|
|
+ hostIds: [record.hostId],
|
|
uid: record.uid
|
|
uid: record.uid
|
|
})
|
|
})
|
|
|
|
|