fix: update some files
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m44s
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
value-format="YYYY-MM-DDTHH:mm:ssZ"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
:clearable="false"
|
||||
@change="handleDateRangeChange"
|
||||
/>
|
||||
</ElFormItem>
|
||||
</ElCol>
|
||||
@@ -19,10 +21,10 @@
|
||||
<ElFormItem>
|
||||
<ElSelect v-model="query.provider" clearable placeholder="请选择提供方">
|
||||
<ElOption
|
||||
v-for="item in overview?.providers || []"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
v-for="item in providerOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
@@ -31,10 +33,10 @@
|
||||
<ElFormItem>
|
||||
<ElSelect v-model="query.direction" clearable placeholder="请选择方向">
|
||||
<ElOption
|
||||
v-for="item in overview?.directions || []"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
v-for="item in directionOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
@@ -43,10 +45,10 @@
|
||||
<ElFormItem>
|
||||
<ElSelect v-model="query.result" clearable placeholder="请选择结果">
|
||||
<ElOption
|
||||
v-for="item in overview?.results || []"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
v-for="item in resultOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
@@ -231,9 +233,12 @@
|
||||
import { AuditService } from '@/api/modules'
|
||||
import type {
|
||||
AuditNamedCount,
|
||||
IntegrationDirection,
|
||||
IntegrationListItem,
|
||||
IntegrationOverview,
|
||||
IntegrationQuery
|
||||
IntegrationProvider,
|
||||
IntegrationQuery,
|
||||
IntegrationResult
|
||||
} from '@/types/api'
|
||||
import { auditResultDisplay, integrationCategoryMeta } from '@/utils/business/audit'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
@@ -243,11 +248,39 @@
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
const headerColumns = ref([])
|
||||
const dateRange = ref<string[]>([])
|
||||
const dateRange = ref<string[]>(createDefaultDateRange())
|
||||
const query = reactive<IntegrationQuery>({ page: 1, page_size: 20 })
|
||||
const overview = ref<IntegrationOverview>()
|
||||
const items = ref<IntegrationListItem[]>([])
|
||||
const total = ref(0)
|
||||
const providerOptions: Array<{ label: string; value: IntegrationProvider }> = [
|
||||
{ label: '中国电信', value: 'ctcc' },
|
||||
{ label: '中国移动', value: 'cmcc' },
|
||||
{ label: '中国联通', value: 'cucc' },
|
||||
{ label: '微信支付', value: 'wechat_pay' },
|
||||
{ label: '支付宝', value: 'alipay' },
|
||||
{ label: '富友', value: 'fuiou' },
|
||||
{ label: '企业微信', value: 'wecom' },
|
||||
{ label: '设备网关', value: 'gateway' }
|
||||
]
|
||||
const directionOptions: Array<{ label: string; value: IntegrationDirection }> = [
|
||||
{ label: '入站', value: 'inbound' },
|
||||
{ label: '出站', value: 'outbound' }
|
||||
]
|
||||
const resultOptions: Array<{ label: string; value: IntegrationResult }> = [
|
||||
{ label: '待处理', value: 'pending' },
|
||||
{ label: '成功', value: 'success' },
|
||||
{ label: '失败', value: 'failed' },
|
||||
{ label: '结果未知', value: 'unknown' },
|
||||
{ label: '未找到', value: 'not_found' },
|
||||
{ label: '无效载荷', value: 'invalid_payload' },
|
||||
{ label: '冲突', value: 'conflict' },
|
||||
{ label: '已忽略', value: 'ignored' },
|
||||
{ label: '已合并', value: 'merged' },
|
||||
{ label: '已限频', value: 'rate_limited' },
|
||||
{ label: '已提前完成', value: 'completed' },
|
||||
{ label: '已取消', value: 'cancelled' }
|
||||
]
|
||||
const aggregateChartData = (values: AuditNamedCount[]) => {
|
||||
const totals = new Map<string, AuditNamedCount>()
|
||||
values.forEach((item) => {
|
||||
@@ -261,9 +294,21 @@
|
||||
const providerChartData = computed(() => aggregateChartData(overview.value?.providers || []))
|
||||
const directionChartData = computed(() => aggregateChartData(overview.value?.directions || []))
|
||||
const resultChartData = computed(() => aggregateChartData(overview.value?.results || []))
|
||||
function createDefaultDateRange() {
|
||||
const end = new Date()
|
||||
const start = new Date(end.getTime() - 24 * 60 * 60 * 1000)
|
||||
const format = (date: Date) => date.toISOString().replace(/\.\d{3}Z$/, 'Z')
|
||||
return [format(start), format(end)]
|
||||
}
|
||||
|
||||
const handleDateRangeChange = (value: string[] | null) => {
|
||||
if (!value || value.length !== 2) dateRange.value = createDefaultDateRange()
|
||||
}
|
||||
|
||||
const syncDates = () => {
|
||||
query.created_from = dateRange.value?.[0] || undefined
|
||||
query.created_to = dateRange.value?.[1] || undefined
|
||||
if (dateRange.value.length !== 2) dateRange.value = createDefaultDateRange()
|
||||
query.created_from = dateRange.value[0]
|
||||
query.created_to = dateRange.value[1]
|
||||
}
|
||||
const loadList = async () => {
|
||||
syncDates()
|
||||
|
||||
Reference in New Issue
Block a user