完善前端显示字段;去掉开放测试接口

This commit is contained in:
BBIT-Kai
2026-05-27 11:45:57 +08:00
parent a716c481da
commit bf87c09803
28 changed files with 327 additions and 213 deletions
+39 -23
View File
@@ -66,15 +66,6 @@
class="task-filter"
@update:value="loadTasks(1)"
/>
<n-select
v-model:value="taskRunMode"
clearable
size="small"
placeholder="全部模式"
:options="runModeOptions"
class="task-filter"
@update:value="loadTasks(1)"
/>
<n-button size="small" :loading="taskLoading" @click="loadTasks(taskPage)">
<template #icon><n-icon :component="RefreshCw" /></template>
刷新
@@ -122,7 +113,6 @@ const taskPageSize = ref(20)
const taskTotal = ref(0)
const taskStatus = ref<string | null>(null)
const taskSourceType = ref<string | null>(null)
const taskRunMode = ref<string | null>(null)
const statusOptions = [
{ label: '待处理', value: 'PENDING' },
@@ -134,14 +124,35 @@ const statusOptions = [
const sourceTypeOptions = [
{ label: '单笔', value: 'SINGLE' },
{ label: '批量', value: 'BATCH' },
{ label: '测试', value: 'TEST' }
{ label: '批量', value: 'BATCH' }
]
const runModeOptions = [
{ label: '生产', value: 'REAL' },
{ label: '模拟', value: 'SIMULATED' }
]
const queueStatusLabelMap: Record<string, string> = {
RUNNING: '运行中',
PAUSED: '已暂停'
}
const taskStatusLabelMap: Record<string, string> = {
PENDING: '待处理',
PROCESSING: '处理中',
SUCCESS: '成功',
FAILED: '失败',
WAITING_AUTH: '需认证'
}
const taskTypeLabelMap: Record<string, string> = {
ISSUE_BLUE: '蓝票开具',
QUERY_BLUE: '蓝票查询'
}
const sourceTypeLabelMap: Record<string, string> = {
SINGLE: '单笔',
BATCH: '批量'
}
function labelOf(map: Record<string, string>, value?: string | null) {
return value ? map[value] || value : '-'
}
const totals = computed(() =>
rows.value.reduce(
@@ -177,7 +188,11 @@ const columns: DataTableColumns<OpenInvoiceTaskOverviewItem> = [
key: 'status',
width: 110,
render: (row) =>
h(NTag, { type: statusTagType(row.status), size: 'small' }, { default: () => row.status })
h(
NTag,
{ type: statusTagType(row.status), size: 'small' },
{ default: () => labelOf(queueStatusLabelMap, row.status) }
)
},
{ title: '待处理', key: 'pending', width: 90 },
{ title: '处理中', key: 'processing', width: 90 },
@@ -265,15 +280,18 @@ function rowProps(row: OpenInvoiceTaskOverviewItem) {
const taskColumns: DataTableColumns<OpenInvoiceTaskItem> = [
{ title: '票号', key: 'invoiceReqSerialNo', minWidth: 170 },
{ title: '任务', key: 'taskType', width: 120 },
{ title: '来源', key: 'sourceType', width: 90 },
{ title: '模式', key: 'runMode', width: 90 },
{ title: '任务', key: 'taskType', width: 120, render: (row) => labelOf(taskTypeLabelMap, row.taskType) },
{ title: '来源', key: 'sourceType', width: 90, render: (row) => labelOf(sourceTypeLabelMap, row.sourceType) },
{
title: '状态',
key: 'status',
width: 110,
render: (row) =>
h(NTag, { type: statusTagType(row.status), size: 'small' }, { default: () => row.status })
h(
NTag,
{ type: statusTagType(row.status), size: 'small' },
{ default: () => labelOf(taskStatusLabelMap, row.status) }
)
},
{ title: 'PT码', key: 'ptCode', width: 90 },
{ title: '错误', key: 'errorMessage', minWidth: 260, ellipsis: { tooltip: true } },
@@ -307,7 +325,6 @@ async function loadTasks(page = 1) {
digitalAccountId: selected.value.digitalAccountId,
status: taskStatus.value,
sourceType: taskSourceType.value,
runMode: taskRunMode.value,
page,
pageSize: taskPageSize.value
})
@@ -326,7 +343,6 @@ function openDrawer(row: OpenInvoiceTaskOverviewItem) {
drawerVisible.value = true
taskStatus.value = null
taskSourceType.value = null
taskRunMode.value = null
loadTasks(1)
}