✨ 全局支持表格单列文字拖选复制

This commit is contained in:
caojia
2026-10-10 14:22:58 +08:00
parent eeaea52c17
commit b071d76c96
5 changed files with 309 additions and 8 deletions
+10 -6
View File
@@ -1,6 +1,6 @@
<template>
<div class="app-container">
<basic-table ref="tableRef" :columns="columns" :search-columns="searchColumns" :query="listArBillLogs" row-key="logId" :selection="false">
<basic-table :columns="columns" :search-columns="searchColumns" :query="listArBillLogs" row-key="logId" :selection="false">
<template #col-result="{ row }"><el-tag :type="AR_LOG_RESULT_TYPES[row.result] || 'info'">{{ resultText(row.result) }}</el-tag></template>
</basic-table>
</div>
@@ -18,7 +18,6 @@ import {
arEnumLabel
} from '@/constants/ar/enums'
const tableRef = ref()
// 日志筛选值与后端枚举保持一致,展示文案统一由枚举工具转换。
const searchColumns = [
{ label: '对象类型', prop: 'objectType', component: 'select', options: AR_LOG_OBJECT_TYPE_OPTIONS, width: '130px' },
@@ -26,13 +25,18 @@ const searchColumns = [
{ label: '操作来源', prop: 'operationSource', component: 'select', options: AR_LOG_OPERATION_SOURCE_OPTIONS, width: '130px' },
{ label: '结果', prop: 'result', component: 'select', options: AR_LOG_RESULT_OPTIONS, width: '120px' }
]
// 状态变化列同时展示前后状态,便于追踪确认、作废和核销等生命周期操作。
const columns = [
{ label: '对象类型', prop: 'objectType', width: 110, formatter: row => objectTypeText(row.objectType) }, { label: '对象', prop: 'objectDisplay', minWidth: 220, showOverflowTooltip: true, formatter: row => row.objectDisplay || '-' },
{ label: '操作', prop: 'operationType', width: 150, formatter: row => operationText(row.operationType) }, { label: '说明', prop: 'operationDesc', minWidth: 220, showOverflowTooltip: true },
{ label: '状态变化', prop: 'status', width: 160, formatter: row => `${statusText(row.fromStatus)} → ${statusText(row.toStatus)}` }, { label: '操作人', prop: 'operatorName', width: 110 },
{ label: '对象类型', prop: 'objectType', width: 110, formatter: row => objectTypeText(row.objectType) },
{ label: '对象', prop: 'objectDisplay', minWidth: 220, showOverflowTooltip: true, formatter: row => row.objectDisplay || '-' },
{ label: '操作', prop: 'operationType', width: 150, formatter: row => operationText(row.operationType) },
{ label: '说明', prop: 'operationDesc', minWidth: 220, showOverflowTooltip: true },
{ label: '状态变化', prop: 'status', width: 160, formatter: row => `${statusText(row.fromStatus)} → ${statusText(row.toStatus)}` },
{ label: '操作人', prop: 'operatorName', width: 110 },
{ label: '来源', prop: 'operationSource', width: 100, formatter: row => sourceText(row.operationSource) },
{ label: '结果', prop: 'result', width: 90, slot: 'result' }, { label: '时间', prop: 'createTime', width: 170, parseTime: true }
{ label: '结果', prop: 'result', width: 90, slot: 'result' },
{ label: '时间', prop: 'createTime', width: 170, parseTime: true }
]
function objectTypeText(value) { return arEnumLabel(AR_LOG_OBJECT_TYPE_OPTIONS, value) }