This commit is contained in:
@@ -184,6 +184,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted } from 'vue'
|
||||
import { MenuTypeEnum, MenuWidth } from '@/enums/appEnum'
|
||||
import { useSettingStore } from '@/store/modules/setting'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
@@ -264,9 +265,18 @@
|
||||
initLanguage()
|
||||
if (hasAuth(NOTIFICATION_PERMISSIONS.page)) {
|
||||
void notificationStore.refreshUnreadCount().catch(() => undefined)
|
||||
unreadTimer = window.setInterval(() => {
|
||||
void notificationStore.refreshUnreadCount().catch(() => undefined)
|
||||
}, 30_000)
|
||||
}
|
||||
})
|
||||
|
||||
let unreadTimer: number | undefined
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (unreadTimer !== undefined) window.clearInterval(unreadTimer)
|
||||
})
|
||||
|
||||
const { isFullscreen, toggle: toggleFullscreen } = useFullscreen()
|
||||
|
||||
const toggleFullScreen = () => {
|
||||
|
||||
@@ -128,12 +128,12 @@
|
||||
return
|
||||
}
|
||||
try {
|
||||
const targetResponse = await NotificationService.getTarget(item.id)
|
||||
const readResponse = await notificationStore.markRead(item.id)
|
||||
if (readResponse.code !== 0) {
|
||||
ElMessage.error(readResponse.msg || '标记已读失败')
|
||||
return
|
||||
}
|
||||
const targetResponse = await NotificationService.getTarget(item.id)
|
||||
if (targetResponse.code !== 0 || !targetResponse.data) {
|
||||
ElMessage.info(item.body || '该通知暂无可跳转目标')
|
||||
return
|
||||
|
||||
@@ -473,7 +473,7 @@ export interface AssetWalletResponse {
|
||||
resource_type?: string // 资源类型:iot_card 或 device
|
||||
balance?: number // 总余额(分)
|
||||
frozen_balance?: number // 冻结余额(分)
|
||||
available_balance?: number // 可用余额 = balance - frozen_balance(分)
|
||||
available_balance?: number // 后端返回的可用余额(分),前端不得自行计算
|
||||
currency?: string // 币种,目前固定 CNY
|
||||
status?: number // 钱包状态:1-正常 2-冻结 3-关闭
|
||||
status_text?: string // 状态文本
|
||||
@@ -607,6 +607,5 @@ export interface AssetOperationLogsResponse {
|
||||
export interface AssetOperationLogsParams {
|
||||
page?: number // 页码,默认1
|
||||
page_size?: number // 每页条数,默认20,最大100
|
||||
operation_type?: string // 操作类型
|
||||
result_status?: 'success' | 'failed' | 'denied' // 执行结果
|
||||
}
|
||||
|
||||
@@ -4,20 +4,6 @@
|
||||
<div class="card-header">
|
||||
<span class="header-title">操作审计日志</span>
|
||||
<div class="filter-section">
|
||||
<ElSelect
|
||||
v-model="filterForm.operation_type"
|
||||
placeholder="操作类型"
|
||||
clearable
|
||||
class="operation-type-select"
|
||||
@change="handleFilterChange"
|
||||
>
|
||||
<ElOption
|
||||
v-for="option in operationTypeOptions"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
</ElSelect>
|
||||
<ElSelect
|
||||
v-model="filterForm.result_status"
|
||||
placeholder="执行结果"
|
||||
@@ -169,34 +155,6 @@
|
||||
|
||||
type DisplayItem = ChangeItem | MessageItem
|
||||
|
||||
const operationTypeOptions = [
|
||||
{ label: '设备WiFi设置', value: 'device_set_wifi' },
|
||||
{ label: '设备切卡', value: 'device_switch_card' },
|
||||
{ label: '设备切卡模式', value: 'device_switch_mode' },
|
||||
{ label: '设备停机', value: 'device_stop' },
|
||||
{ label: '设备复机', value: 'device_start' },
|
||||
{ label: '设备重启', value: 'device_reboot' },
|
||||
{ label: '设备重置', value: 'device_reset' },
|
||||
{ label: '设备分配', value: 'device_allocate' },
|
||||
{ label: '设备回收', value: 'device_recall' },
|
||||
{ label: '设备绑卡', value: 'device_bind_card' },
|
||||
{ label: '设备解绑卡', value: 'device_unbind_card' },
|
||||
{ label: '卡分配', value: 'card_allocate' },
|
||||
{ label: '卡回收', value: 'card_recall' },
|
||||
{ label: '卡停机', value: 'card_stop' },
|
||||
{ label: '卡复机', value: 'card_start' },
|
||||
{ label: '手动停卡', value: 'card_manual_stop' },
|
||||
{ label: '手动复机', value: 'card_manual_start' },
|
||||
{ label: '自动停卡', value: 'card_auto_stop' },
|
||||
{ label: '自动复机', value: 'card_auto_start' },
|
||||
{ label: '卡轮询状态', value: 'card_polling_status' },
|
||||
{ label: '资产轮询状态', value: 'asset_polling_status' },
|
||||
{ label: '实名策略', value: 'asset_realname_policy' },
|
||||
{ label: '实名状态', value: 'asset_realname_status' },
|
||||
{ label: '轮询开关', value: 'asset_polling' },
|
||||
{ label: 'IoT卡导入任务', value: 'iot_card_import_task_create' }
|
||||
] as const
|
||||
|
||||
const operationTypeTagMap: Record<string, TagType> = {
|
||||
device_set_wifi: 'primary',
|
||||
device_switch_card: 'success',
|
||||
@@ -309,7 +267,6 @@
|
||||
})
|
||||
|
||||
const filterForm = reactive({
|
||||
operation_type: '',
|
||||
result_status: '' as ResultStatus
|
||||
})
|
||||
|
||||
@@ -321,7 +278,6 @@
|
||||
const res = await AssetService.getOperationLogs(props.assetIdentifier, {
|
||||
page: pagination.page,
|
||||
page_size: pagination.page_size,
|
||||
operation_type: filterForm.operation_type || undefined,
|
||||
result_status: filterForm.result_status || undefined
|
||||
})
|
||||
if (res.code === 0 && res.data) {
|
||||
@@ -342,7 +298,6 @@
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
filterForm.operation_type = ''
|
||||
filterForm.result_status = ''
|
||||
pagination.page = 1
|
||||
loadLogs()
|
||||
|
||||
@@ -197,12 +197,12 @@
|
||||
|
||||
const handleNotificationClick = async (item: NotificationItem) => {
|
||||
try {
|
||||
const targetResponse = await NotificationService.getTarget(item.id)
|
||||
const readResponse = await notificationStore.markRead(item.id)
|
||||
if (readResponse.code !== 0) {
|
||||
ElMessage.error(readResponse.msg || '标记已读失败')
|
||||
return
|
||||
}
|
||||
const targetResponse = await NotificationService.getTarget(item.id)
|
||||
if (targetResponse.code !== 0 || !targetResponse.data) {
|
||||
ElMessage.info(item.body || '该通知暂无可跳转目标')
|
||||
await loadNotifications()
|
||||
|
||||
Reference in New Issue
Block a user