liufumingren 292e69a6d1 fix: 修复摄像头编辑/操作列数据引用问题
CameraFormDialog: 添加isPopulating标记防止watch清空已填充字段; 兼容row.server.id和row.server_id两种数据结构; 使用append-to-body避免z-index遮挡

OperationCellRenderer: 使用watch捕获row最新值解决slot scope引用失效; 简化buildFormProps参数传递

newcamara/index: 操作列改为直接渲染编辑/删除/预览按钮; 添加getRowById通过ID从listData查找完整行数据

camera/index: 添加isEditingMode标记防止编辑时watch清空字段; 使用formData.id判断创建/编辑模式; dialog添加z-index
2026-07-20 02:24:10 +08:00

918 lines
30 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
╔══════════════════════════════════════════════════════════════╗
║ 【页面模板 v2】— 基于 waveOrder2 架构设计 ║
╚══════════════════════════════════════════════════════════════╝
===== 快速复制使用 =====
1. 复制整个 views/mode/ 文件夹 → 重命名为你的页面名(如 views/order/myPage/)
2. 修改 defineOptions name(如 'MyPage')
3. 编辑 config/template-config.ts:
a. 在 FIELD_DICT 中添加页面字段
b. 在 tabPages 中配置标签页(引用 FIELD_DICT 的 key)
c. 在 TabPageApiConfig 中接入真实接口
4. 在 router/map.ts 中添加路由
===== 页面结构 =====
┌─────────────────────────────────────────────────────────┐
│ TabArea(多标签页切换,可关闭) │
├──────────┬──────────────────────────────────────────────┤
│ ScanBox │ OrderToolbarButtonGroup(工具栏按钮组) │
│ 筛选面板 │ ┌──────────────────────────────────────────┐│
│ │ │ UpperTable(表格) ││
│ │ │ - OperationCellRenderer(操作列) ││
│ │ ├──────────────────────────────────────────┤│
│ │ │ 分隔条(可拖拽) ││
│ │ ├──────────────────────────────────────────┤│
│ │ │ DetailPanel / LogPanel(明细/日志面板) ││
│ │ └──────────────────────────────────────────┘│
└──────────┴──────────────────────────────────────────────┘
-->
<template>
<div class="page-wrapper" :style="{ height: containerHeight }">
<!-- ===== 多标签模式:显示顶部标签栏 ===== -->
<template v-if="PAGE_CONFIG.showTabArea && !PAGE_CONFIG.singlePage">
<div class="tab-section">
<TabArea
:tabs="tabList"
:default-active="activeTabName"
@tab-change="handleTabChange"
/>
</div>
</template>
<!-- ===== 主内容区 ===== -->
<div class="main-container">
<div class="order-sub-container">
<!-- 左侧:ScanBox 筛选面板 -->
<ScanBox
ref="scanBoxRef"
:cache-key="currentScanBoxCacheKey"
width="250px"
:tree-props="{ children: 'children', label: 'label' }"
:auto-submit="false"
:preset-tree="presetTree"
:available-fields="currentScanBoxFields"
@condition-change="handleConditionChange"
@reset="handleConditionReset"
@condition-clear="handleConditionClear"
/>
<!-- 右侧:内容区 -->
<div class="main-content">
<transition name="tab-fade" mode="out-in">
<div :key="activeTabName" class="tab-content-inner">
<!-- 工具栏按钮组 -->
<div class="toolbar">
<div class="toolbar-left">
<OrderToolbarButtonGroup
:buttons="currentToolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
</div>
<!-- 上下分栏区域:详情面板启用时才显示分栏 + 详情 -->
<template v-if="PAGE_CONFIG.enableDetailPanel">
<div class="split-stack" ref="splitStackRef">
<div class="upper-wrapper" :style="detailVisible ? upperPaneStyle : upperPaneFullStyle">
<UpperTable
ref="upperTableRef"
:title="currentTabConfig?.upperTable.title ?? '列表'"
default-align="center"
:enable-column-config="currentTabConfig?.upperTable.enableColumnConfig ?? true"
:column-config-schema-version="1"
:table-id="`template-table-${activeTabName}`"
:data="listData"
:row-key="'id'"
:columns="currentColumns"
table-size="small"
:pagination="pagination"
:show-index="currentTabConfig?.upperTable.showIndex ?? true"
:show-selection="currentTabConfig?.upperTable.showSelection ?? true"
:loading="loading"
:query-time="queryTime"
@current-change="handleRowClick"
@row-click="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="loadData"
@sort-change="handleSortChange"
@selection-change="handleSelectionChange"
>
<!-- 动态列插槽:操作列通过 row['id'] 从 listData 查找完整数据 -->
<template
v-for="(slotConfig, colProp) in currentColumnSlots"
:key="`columnSlots-${colProp}`"
#[`column-${colProp}`]="{ row }"
>
<!-- 操作列:使用 row['id'](slot scope 内可正常访问单属性)查找数据 -->
<template v-if="colProp === 'operation'">
<div class="operation-cell">
<el-button link type="primary" size="small" @click.stop="openCameraForm('edit', getRowById(row['id']))">编辑</el-button>
<el-button link type="danger" size="small" @click.stop="handleDeleteCamera(getRowById(row['id'])!)">删除</el-button>
<el-button link type="success" size="small" @click.stop="handlePreview(getRowById(row['id'])!)">预览</el-button>
</div>
</template>
<!-- 其他列 -->
<ColumnCellRenderer
v-else
:config="slotConfig"
:value="row[colProp]"
/>
</template>
<template #empty>
<div class="empty-tip">{{ currentTabConfig?.upperTable.emptyText ?? '暂无数据' }}</div>
</template>
</UpperTable>
</div>
<!-- 分隔条(可拖拽) -->
<template v-if="detailVisible">
<div
class="pane-resizer"
title="拖动调整列表与详情区域高度"
@mousedown="beginSplitDrag"
/>
<!-- 下半:明细面板 -->
<div v-if="selectedRow" class="lower-level" :style="lowerPaneStyle">
<div class="detail-header">
<el-tabs v-model="activeDetailTab" class="detail-tab">
<el-tab-pane
v-for="tab in currentDetailTabs"
:key="tab.name"
:label="tab.label"
:name="tab.name"
/>
</el-tabs>
</div>
<div class="detail-container">
<component
:is="activeDetailTabComponent"
:row="selectedDetail"
:detail-config="currentDetailConfig"
:api-method="currentDetailTabApiMethod"
/>
</div>
</div>
<!-- 未选中行时的占位 -->
<div v-else class="no-selection" :style="lowerPaneStyle">
<div class="empty-tip">
<p>请从上方列表中选择一项查看详情</p>
</div>
</div>
</template>
</div>
</template>
<!-- 详情面板禁用:表格占满全高 -->
<template v-else>
<div class="upper-wrapper upper-wrapper--full">
<UpperTable
ref="upperTableRef"
:title="currentTabConfig?.upperTable.title ?? '列表'"
default-align="center"
:enable-column-config="currentTabConfig?.upperTable.enableColumnConfig ?? true"
:column-config-schema-version="1"
:table-id="`template-table-${activeTabName}`"
:data="listData"
:row-key="'id'"
:columns="currentColumns"
table-size="small"
:pagination="pagination"
:show-index="currentTabConfig?.upperTable.showIndex ?? true"
:show-selection="currentTabConfig?.upperTable.showSelection ?? false"
:loading="loading"
:query-time="queryTime"
@current-change="handleRowClick"
@row-click="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="loadData"
@sort-change="handleSortChange"
@selection-change="handleSelectionChange"
>
<template
v-for="(slotConfig, colProp) in currentColumnSlots"
:key="`columnSlots-${colProp}`"
#[`column-${colProp}`]="{ row }"
>
<template v-if="colProp === 'operation'">
<div class="operation-cell">
<el-button link type="primary" size="small" @click.stop="openCameraForm('edit', getRowById(row['id']))">编辑</el-button>
<el-button link type="danger" size="small" @click.stop="handleDeleteCamera(getRowById(row['id'])!)">删除</el-button>
<el-button link type="success" size="small" @click.stop="handlePreview(getRowById(row['id'])!)">预览</el-button>
</div>
</template>
<ColumnCellRenderer
v-else
:config="slotConfig"
:value="row[colProp]"
/>
</template>
<template #empty>
<div class="empty-tip">{{ currentTabConfig?.upperTable.emptyText ?? '暂无数据' }}</div>
</template>
</UpperTable>
</div>
</template>
</div>
</transition>
</div>
</div>
</div>
<!-- ===== 功能按钮表单(pages/ 目录下的组件) ===== -->
<CameraFormDialog
v-model:visible="cameraFormVisible"
:row="cameraFormRow"
:mode="cameraFormMode"
@success="handleFormSuccess"
/>
<!-- ===== 预览弹窗 ===== -->
<CameraPreviewDialog v-model="previewVisible" :camera-row="previewCameraRow" />
</div>
</template>
<script setup lang="ts">
// ============================================================
// ★ 摄像头管理页面
// ============================================================
defineOptions({ name: 'NewCamera' })
import { ref, computed, onMounted, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useSettingsStore } from '@/stores/modules/settings'
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import TabArea from './components/TabArea.vue'
import ColumnCellRenderer from './components/ColumnCellRenderer.vue'
import OperationCellRenderer from './components/OperationCellRenderer.vue'
import CameraFormDialog from './pages/CameraFormDialog.vue'
import CameraPreviewDialog from './components/CameraPreviewDialog.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig as OrderToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { del } from '@/api/camera/camera'
import {
PAGE_CONFIG,
tabPages,
resolveTabConfig,
getTabToolbarButtons,
type TabPageConfig,
type DetailTabConfig,
type ToolbarButtonConfig,
} from './config/template-config'
// ============================================================
// 容器高度
// ============================================================
const settingsStore = useSettingsStore()
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
const containerHeight = computed(() =>
shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)'
)
// ============================================================
// 标签页
// ============================================================
const tabList = computed(() =>
tabPages.map((t) => ({ name: t.name, label: t.label }))
)
const activeTabName = ref(tabPages[0]?.name ?? 'tab1')
/** 当前激活标签页的完整配置 */
const currentTabConfig = computed<TabPageConfig | undefined>(() => {
const raw = tabPages.find((t) => t.name === activeTabName.value)
if (!raw) return undefined
return resolveTabConfig(raw)
})
/** 当前 ScanBox 缓存 key */
const currentScanBoxCacheKey = computed(
() => currentTabConfig.value?.scanBoxCacheKey ?? 'template-default'
)
/** 当前 ScanBox 筛选字段 */
const currentScanBoxFields = computed(
() => currentTabConfig.value?.scanBoxFields ?? []
)
/** 当前表格列 */
const currentColumns = computed(
() => currentTabConfig.value?.upperTable.columns ?? []
)
/** 当前列插槽配置 */
const currentColumnSlots = computed(
() => currentTabConfig.value?.columnSlots ?? {}
)
/** 当前明细面板配置 */
const currentDetailConfig = computed(
() => currentTabConfig.value?.detailConfig ?? []
)
/** 当前明细标签页列表 */
const currentDetailTabs = computed<DetailTabConfig[]>(
() => currentTabConfig.value?.detailTabs ?? []
)
/** 当前激活的明细标签页组件 */
const activeDetailTabComponent = computed(() => {
const tab = currentDetailTabs.value.find(
(t) => t.name === activeDetailTab.value
)
return tab?.component ?? null
})
/** 当前激活明细标签页对应的 API 方法 */
const currentDetailTabApiMethod = computed(() => {
const cfg = currentTabConfig.value
if (!cfg?.api) return undefined
const tab = currentDetailTabs.value.find((t) => t.name === activeDetailTab.value)
if (!tab) return undefined
let componentCfg: unknown
switch (tab.componentKey) {
case 'DetailPanel':
componentCfg = cfg.api.detail
break
case 'LogPanel':
componentCfg = cfg.api.log
break
default:
return undefined
}
if (typeof componentCfg === 'function') {
return componentCfg
}
return undefined
})
// ============================================================
// 工具栏按钮系统
// ============================================================
/** 当前标签页的工具栏按钮列表 */
const currentToolbarButtons = computed<OrderToolbarButtonConfig[]>(() => {
const btns = getTabToolbarButtons(activeTabName.value)
return btns.map((btn: ToolbarButtonConfig) => ({
key: btn.key,
label: btn.label,
size: btn.size,
type: btn.type,
plain: btn.plain,
loadingKey: btn.loadingKey,
disabledKey: btn.disabledKey,
action: btn.action,
dynamicLabelKey: btn.dynamicLabelKey,
buttonType: btn.buttonType,
dropdownOptions: btn.dropdownOptions
}))
})
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
noSelection: selectedRows.value.length === 0
}))
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
loading: loading.value,
exportLoading: false
}))
const buttonLabelMap = computed<Record<string, string>>(() => ({
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
}))
const toolbarLayoutKey = computed(() =>
JSON.stringify({
loading: buttonLoadingMap.value,
disabled: buttonDisabledMap.value,
labels: buttonLabelMap.value
})
)
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean(buttonLoadingMap.value[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean(buttonDisabledMap.value[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
if (!dynamicLabelKey) return defaultLabel
return buttonLabelMap.value[dynamicLabelKey] || defaultLabel
}
// ============================================================
// 工具栏动作分发
// ============================================================
const toolbarActionMap: Record<string, () => void> = {
loadData: () => { void loadData() },
openColumnConfigPanel: () => { upperTableRef.value?.openColumnConfig?.() },
toggleDetailVisible: () => { detailVisible.value = !detailVisible.value },
openAddCameraDialog: () => { openCameraForm('create') }
}
function handleToolbarButtonClick(action: string) {
const handler = toolbarActionMap[action]
if (handler) {
handler()
return
}
console.warn('[NewCamera] 未处理的工具栏动作:', action)
}
// ============================================================
// CameraFormDialog 控制
// ============================================================
const cameraFormVisible = ref(false)
const cameraFormMode = ref<'create' | 'edit'>('create')
const cameraFormRow = ref<Record<string, any> | null>(null)
function openCameraForm(mode: 'create' | 'edit', row?: Record<string, any>) {
cameraFormMode.value = mode
cameraFormRow.value = row ?? null
cameraFormVisible.value = true
}
/** 通过 ID 从 listData 中查找完整行数据(解决 slot scope 中 row 引用失效问题) */
function getRowById(id: any): Record<string, any> | undefined {
if (id === undefined || id === null) return undefined
return (listData.value as any[]).find((item: any) => item.id === id)
}
function handleFormSuccess() {
loadData()
}
// ============================================================
// CameraPreviewDialog 控制
// ============================================================
const previewVisible = ref(false)
const previewCameraRow = ref<Record<string, any> | null>(null)
// ============================================================
// 操作列按钮事件处理
// ============================================================
async function handleOperationAction(key: string, row: Record<string, any>) {
switch (key) {
case 'edit':
openCameraForm('edit', row)
break
case 'delete':
await handleDeleteCamera(row)
break
case 'preview':
handlePreview(row)
break
default:
console.warn('[NewCamera] 未处理的操作按钮:', key)
}
}
async function handleDeleteCamera(row: Record<string, any>) {
if (!row.id) return
const name = row.custom_name || row.channel_name || String(row.id)
try {
await ElMessageBox.confirm(`确认删除摄像头「${name}」吗?`, '提示', { type: 'warning' })
} catch {
return
}
try {
const res: any = await del({ id: row.id })
if (res && [0, 1, 200].includes(res.code)) {
ElMessage.success('删除成功')
if (listData.value.length === 1 && pagination.currentPage > 1) {
pagination.currentPage -= 1
}
loadData()
} else {
ElMessage.error(res?.message || '删除失败')
}
} catch {
ElMessage.error('删除失败')
}
}
function handlePreview(row: Record<string, any>) {
previewCameraRow.value = row
previewVisible.value = true
}
// ============================================================
// ★★★ 第二步:接入真实接口 ★★★
// ============================================================
const listData = ref<Record<string, any>[]>([])
const loading = ref(false)
const queryTime = ref(0)
const pagination = reactive({
currentPage: 1,
pageSize: 20,
total: 0
})
const currentSort = reactive({ prop: '', order: '' })
const loadData = async () => {
const cfg = currentTabConfig.value
if (!cfg) return
loading.value = true
const startTime = performance.now()
try {
if (cfg.api) {
// 使用真实接口
const conditions = scanBoxRef.value?.getConditions?.() || {}
const params = cfg.api.buildListParams
? cfg.api.buildListParams({
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
conditions,
sort: currentSort.prop ? { prop: currentSort.prop, order: currentSort.order } : undefined
})
: {
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
where: conditions
}
const res = await cfg.api.list(params)
if (res && [0, 1, 200].includes(res.code)) {
const parsed = cfg.api.parseListResponse
? cfg.api.parseListResponse(res)
: { list: res.data?.list ?? res.list ?? [], total: res.data?.pagination?.total ?? res.total ?? 0 }
listData.value = parsed.list
pagination.total = parsed.total
} else {
throw new Error(res?.message || '接口返回异常')
}
} else {
// ★ 未配置 API 时使用模拟数据(替换为真实接口后删除)
console.log('[NewCamera] 未配置 API,使用空数据。请在 tabPages 中配置 api 字段。')
listData.value = []
pagination.total = 0
}
} catch (e: any) {
console.error('[NewCamera] 加载列表失败:', e)
ElMessage.error(e?.message || '获取列表数据失败')
listData.value = []
pagination.total = 0
} finally {
loading.value = false
queryTime.value = Math.round(performance.now() - startTime)
}
}
// ============================================================
// ScanBox 筛选事件
// ============================================================
const scanBoxRef = ref<any>(null)
const presetTree = ref<any[]>([])
const handleConditionChange = () => {
pagination.currentPage = 1
loadData()
}
const handleConditionReset = () => {
pagination.currentPage = 1
loadData()
}
const handleConditionClear = () => {
pagination.currentPage = 1
loadData()
}
// ============================================================
// UpperTable 事件
// ============================================================
const upperTableRef = ref<any>(null)
const selectedRows = ref<Record<string, any>[]>([])
const handleSortChange = ({ prop, order }: any) => {
currentSort.prop = prop
currentSort.order = order
pagination.currentPage = 1
loadData()
}
const handlePageChange = (page: number) => {
pagination.currentPage = page
loadData()
}
const handlePageSizeChange = (size: number) => {
pagination.pageSize = size
pagination.currentPage = 1
loadData()
}
const handleSelectionChange = (rows: Record<string, any>[]) => {
selectedRows.value = rows
}
// ============================================================
// 明细面板
// ============================================================
const detailVisible = ref(PAGE_CONFIG.enableDetailPanel)
const selectedRow = ref<Record<string, any> | null>(null)
const selectedDetail = ref<Record<string, any> | null>(null)
const activeDetailTab = ref('detail')
const handleRowClick = async (row: Record<string, any>) => {
if (!PAGE_CONFIG.enableDetailPanel) return
const cfg = currentTabConfig.value
if (!cfg) return
selectedRow.value = row
// 根据 DetailPanel 的 api 配置决定数据来源
const detailCfg = cfg.api?.detail
if (typeof detailCfg === 'function') {
try {
const detailRes = await detailCfg({ id: row.id, code: row.code })
if (detailRes && [0, 1, 200].includes(detailRes.code)) {
selectedDetail.value = detailRes.data ?? detailRes
} else {
selectedDetail.value = { ...row }
}
} catch {
selectedDetail.value = { ...row }
}
} else {
// source='list' 或未配置:直接用行数据
selectedDetail.value = { ...row }
}
}
// ============================================================
// 标签页切换
// ============================================================
const handleTabChange = (tabName: string) => {
if (activeTabName.value === tabName) return
activeTabName.value = tabName
pagination.currentPage = 1
currentSort.prop = ''
currentSort.order = ''
selectedRow.value = null
selectedDetail.value = null
selectedRows.value = []
activeDetailTab.value = 'detail'
loadData()
}
// ============================================================
// 分栏拖拽
// ============================================================
const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } =
useVerticalSplitPane({ defaultLowerPercent: 38 })
const upperPaneFullStyle = computed(() => ({
flex: '1 1 auto',
minHeight: '0',
overflow: 'hidden' as const
}))
// ============================================================
// 初始化
// ============================================================
onMounted(() => {
loadData()
})
</script>
<style lang="scss" scoped>
/* ================================================================
整体布局
================================================================ */
.page-wrapper {
position: relative;
width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ================================================================
1. 顶部多标签页
================================================================ */
.tab-section {
flex-shrink: 0;
background: #fff;
border: 1px solid #e8eef7;
border-bottom: none;
border-radius: 6px 6px 0 0;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
overflow: hidden;
}
/* ================================================================
2. 主内容区
================================================================ */
.main-container {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
background: #fff;
border-radius: 0 0 6px 6px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
overflow: hidden;
}
.order-sub-container {
display: flex;
height: 100%;
width: 100%;
background-color: #f0f2f5;
:deep(.scan-box-container) {
flex: 0 0 250px;
flex-shrink: 0;
height: 100%;
}
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
min-width: 0;
}
.tab-content-inner {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
/* ================================================================
3. 工具栏
================================================================ */
.toolbar {
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
min-width: 0;
overflow: hidden;
.toolbar-left {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
gap: 10px;
overflow: hidden;
}
.toolbar-right {
flex: 0 0 auto;
margin-left: 10px;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 10px;
}
}
/* ================================================================
4. 分栏区域
================================================================ */
.split-stack {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
:deep(.el-card__header) {
padding: 2px 12px;
font-size: 13px;
}
}
.upper-wrapper {
flex: 1 1 62%;
min-height: 0;
overflow: hidden;
}
/* 详情面板禁用时,表格占满全高 */
.upper-wrapper--full {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.pane-resizer {
flex-shrink: 0;
height: 5px;
cursor: row-resize;
background-color: #f0f2f5;
border-top: 1px solid #ebeef5;
border-bottom: 1px solid #ebeef5;
transition: background-color 0.2s;
user-select: none;
&:hover {
background-color: #d3d9e3;
}
}
.lower-level {
flex: 1 1 38%;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
:deep(.el-card) {
height: 100%;
display: flex;
flex-direction: column;
}
}
.no-selection {
flex: 1 1 38%;
min-height: 0;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #ebeef5;
border-radius: 4px;
.empty-tip p {
font-size: 14px;
color: #909399;
}
}
/* ================================================================
5. 明细面板
================================================================ */
.detail-header {
flex-shrink: 0;
border-bottom: 1px solid #e8eef7;
background: #fff;
padding: 0 12px;
.detail-tab {
:deep(.el-tabs__header) {
margin-bottom: 0;
}
:deep(.el-tabs__nav-wrap::after) {
height: 1px;
}
}
}
.detail-container {
flex: 1;
overflow: auto;
padding: 12px;
background: #fff;
}
/* ================================================================
6. 过渡动画
================================================================ */
.tab-fade-enter-active,
.tab-fade-leave-active {
transition: opacity 0.2s ease;
opacity: 1;
}
.tab-fade-enter-from,
.tab-fade-leave-to {
opacity: 0;
}
/* ================================================================
7. 空状态
================================================================ */
.empty-tip {
font-size: 13px;
color: #909399;
}
</style>