This commit is contained in:
@@ -16,11 +16,7 @@
|
||||
@refresh="handleRefresh"
|
||||
>
|
||||
<template #left>
|
||||
<ElButton
|
||||
v-if="canCreate"
|
||||
type="primary"
|
||||
@click="openFormDialog('create')"
|
||||
>
|
||||
<ElButton v-if="canCreate" type="primary" @click="openFormDialog('create')">
|
||||
新增规则
|
||||
</ElButton>
|
||||
</template>
|
||||
@@ -121,7 +117,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, h, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox, ElTag, FormInstance, FormRules } from 'element-plus'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { PackageManageService, PackageTrafficAlertService } from '@/api/modules'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
@@ -218,12 +213,6 @@
|
||||
minWidth: 180,
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'real_data_mb',
|
||||
label: '当前真流量额度',
|
||||
width: 150,
|
||||
formatter: (row: PackageTrafficAlertRuleItem) => formatMbToGb(row.real_data_mb)
|
||||
},
|
||||
{
|
||||
prop: 'threshold_percent',
|
||||
label: '预警阈值',
|
||||
@@ -261,7 +250,6 @@
|
||||
|
||||
const columnOptions = [
|
||||
{ label: '套餐名称', prop: 'package_name' },
|
||||
{ label: '当前真流量额度', prop: 'real_data_mb' },
|
||||
{ label: '预警阈值', prop: 'threshold_percent' },
|
||||
{ label: '状态', prop: 'enabled' },
|
||||
{ label: '备注', prop: 'remark' },
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
import type { DetailSection } from '@/components/common/DetailPage.vue'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { normalizeApiError } from '@/utils/business/apiError'
|
||||
import { formatTrafficAlertMb } from '@/utils/business/trafficAlert'
|
||||
import {
|
||||
getTrafficAlertAssetTypeName,
|
||||
getTrafficAlertNotificationStatusOption
|
||||
@@ -78,6 +79,9 @@
|
||||
title: '触发信息',
|
||||
fields: [
|
||||
{ label: '套餐', prop: 'package_name' },
|
||||
{ label: '阈值流量(MB)', prop: 'threshold_mb', formatter: formatTrafficAlertMb },
|
||||
{ label: '已用流量(MB,含加油包)', prop: 'used_mb', formatter: formatTrafficAlertMb },
|
||||
{ label: '总流量(MB,含加油包)', prop: 'limit_mb', formatter: formatTrafficAlertMb },
|
||||
{
|
||||
label: '触发阈值',
|
||||
prop: 'threshold_percent',
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { formatTrafficAlertMb } from '@/utils/business/trafficAlert'
|
||||
import { computed, h, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElButton, ElMessage, ElMessageBox, ElRadio, ElRadioGroup, ElTag } from 'element-plus'
|
||||
@@ -80,7 +81,6 @@
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import { normalizeApiError } from '@/utils/business/apiError'
|
||||
import {
|
||||
AUGUST_PERMISSIONS,
|
||||
TRAFFIC_ALERT_ASSET_TYPE_OPTIONS,
|
||||
@@ -285,10 +285,8 @@
|
||||
formatter: (row: PackageTrafficAlertRecordItem) => {
|
||||
const packageName = row.package_name || '-'
|
||||
if (!canViewDetail.value) return packageName
|
||||
return h(
|
||||
ElButton,
|
||||
{ link: true, type: 'primary', onClick: () => goDetail(row) },
|
||||
() => h('span', { style: { textDecoration: 'underline' } }, packageName)
|
||||
return h(ElButton, { link: true, type: 'primary', onClick: () => goDetail(row) }, () =>
|
||||
h('span', { style: { textDecoration: 'underline' } }, packageName)
|
||||
)
|
||||
}
|
||||
},
|
||||
@@ -343,6 +341,24 @@
|
||||
width: 180,
|
||||
formatter: (row: PackageTrafficAlertRecordItem) => formatDateTime(row.triggered_at)
|
||||
},
|
||||
{
|
||||
prop: 'threshold_mb',
|
||||
label: '阈值流量(MB)',
|
||||
width: 150,
|
||||
formatter: (row: PackageTrafficAlertRecordItem) => formatTrafficAlertMb(row.threshold_mb)
|
||||
},
|
||||
{
|
||||
prop: 'used_mb',
|
||||
label: '已用流量(MB,含加油包)',
|
||||
minWidth: 210,
|
||||
formatter: (row: PackageTrafficAlertRecordItem) => formatTrafficAlertMb(row.used_mb)
|
||||
},
|
||||
{
|
||||
prop: 'limit_mb',
|
||||
label: '总流量(MB,含加油包)',
|
||||
minWidth: 200,
|
||||
formatter: (row: PackageTrafficAlertRecordItem) => formatTrafficAlertMb(row.limit_mb)
|
||||
},
|
||||
{
|
||||
prop: 'notification_status',
|
||||
label: '通知状态',
|
||||
@@ -366,6 +382,9 @@
|
||||
{ label: '资产类型', prop: 'asset_type' },
|
||||
{ label: '资产标识', prop: 'asset_identifier' },
|
||||
{ label: '触发阈值', prop: 'threshold_percent' },
|
||||
{ label: '阈值流量(MB)', prop: 'threshold_mb' },
|
||||
{ label: '已用流量(MB,含加油包)', prop: 'used_mb' },
|
||||
{ label: '总流量(MB,含加油包)', prop: 'limit_mb' },
|
||||
{ label: '触发时间', prop: 'triggered_at' },
|
||||
{ label: '通知状态', prop: 'notification_status' }
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user