Commit e68c46a8 authored by Data Governance Dev's avatar Data Governance Dev

refactor(web): 自定义规则 icon 换 Operation + 卡片 header 点击折叠

- 自定义规则卡 icon:MagicStick SVG 渲染不出来 → 改用 Operation(扳手+齿轮,贴合自定义规则语义)
- 4 个卡片 header 点击折叠:连接数据库 / 分析配置 / 自定义规则 / 数据字典浏览器
  - CSS 加 .collapsible-header { cursor: pointer; user-select: none; } + hover 灰底
  - 整个 .card-header 是点击区,@click 切换折叠
  - 内部按钮加 @click.stop 防止冒泡(全选/清空/反选/折叠 按钮)
- 分析进度 / 分析结果 卡片无折叠按钮,本轮不动
parent d83cf947
......@@ -48,6 +48,14 @@
- header padding 减小(18px → 6px)
- 卡片间距缩小(20px → 8px)
注:这是 inline <style> 全局 CSS(不是 Vue SFC),不能用 :deep() —— 直接写选择器即可 */
/* 卡片 header 可点击切换折叠(整个 header 是点击区,按钮需 .stop 阻止冒泡) */
.collapsible-header {
cursor: pointer;
user-select: none;
}
.collapsible-header:hover {
background-color: #f5f7fa;
}
.section-card.is-collapsed .el-card__header {
padding: 6px 20px !important;
}
......@@ -261,14 +269,14 @@
<!-- 卡片 1:连接数据库 -->
<el-card class="section-card" :class="{ 'is-collapsed': connectionCollapsed }" shadow="hover">
<template #header>
<div class="card-header">
<div class="card-header collapsible-header" @click="connectionCollapsed = !connectionCollapsed">
<el-icon><Connection /></el-icon>
<span class="card-title">连接数据库</span>
<div style="margin-left: auto">
<el-button
size="small"
text
@click="connectionCollapsed = !connectionCollapsed"
@click.stop="connectionCollapsed = !connectionCollapsed"
>
<el-icon>
<component :is="connectionCollapsed ? 'Expand' : 'Fold'" />
......@@ -350,14 +358,14 @@
<!-- 卡片 2:分析配置 + 启动 -->
<el-card v-if="connected && dataDict.length > 0" class="section-card" :class="{ 'is-collapsed': analysisConfigCollapsed }" shadow="hover">
<template #header>
<div class="card-header">
<div class="card-header collapsible-header" @click="analysisConfigCollapsed = !analysisConfigCollapsed">
<el-icon><Setting /></el-icon>
<span class="card-title">分析配置</span>
<div style="margin-left: auto">
<el-button
size="small"
text
@click="analysisConfigCollapsed = !analysisConfigCollapsed"
@click.stop="analysisConfigCollapsed = !analysisConfigCollapsed"
>
<el-icon>
<component :is="analysisConfigCollapsed ? 'Expand' : 'Fold'" />
......@@ -520,16 +528,16 @@
<!-- 卡片 2.5:自定义规则(点下方数据字典浏览器字段表右侧 + 号累积) -->
<el-card v-if="connected && dataDict.length > 0" class="section-card" :class="{ 'is-collapsed': customConfigCollapsed }" shadow="hover">
<template #header>
<div class="card-header">
<el-icon><MagicStick /></el-icon>
<div class="card-header collapsible-header" @click="customConfigCollapsed = !customConfigCollapsed">
<el-icon><Operation /></el-icon>
<span class="card-title">自定义规则</span>
<span class="dict-status">已添加 <strong style="color: #409eff">{{ customRules.length }}</strong> 项</span>
<div style="margin-left: auto">
<el-button size="small" @click="clearCustomRules" :disabled="customRules.length === 0">清空</el-button>
<el-button size="small" @click.stop="clearCustomRules" :disabled="customRules.length === 0">清空</el-button>
<el-button
size="small"
text
@click="customConfigCollapsed = !customConfigCollapsed"
@click.stop="customConfigCollapsed = !customConfigCollapsed"
>
<el-icon>
<component :is="customConfigCollapsed ? 'Expand' : 'Fold'" />
......@@ -627,7 +635,7 @@
<!-- 卡片 3:数据字典浏览器(连接成功后才有数据) -->
<el-card v-if="connected && dataDict.length > 0" class="section-card" :class="{ 'is-collapsed': dataDictCollapsed }" shadow="hover">
<template #header>
<div class="card-header">
<div class="card-header collapsible-header" @click="dataDictCollapsed = !dataDictCollapsed">
<el-icon><Document /></el-icon>
<span class="card-title">数据字典浏览器</span>
<span class="dict-status">
......@@ -635,13 +643,13 @@
(已勾选 <strong style="color: #409eff">{{ form.tables.length }}</strong> 张)
</span>
<div style="margin-left: auto">
<el-button size="small" @click="selectAllTables" :disabled="form.tables.length === tablesAll.length">全选</el-button>
<el-button size="small" @click="selectNoTables" :disabled="form.tables.length === 0">清空</el-button>
<el-button size="small" @click="selectTablesInvert">反选</el-button>
<el-button size="small" @click.stop="selectAllTables" :disabled="form.tables.length === tablesAll.length">全选</el-button>
<el-button size="small" @click.stop="selectNoTables" :disabled="form.tables.length === 0">清空</el-button>
<el-button size="small" @click.stop="selectTablesInvert">反选</el-button>
<el-button
size="small"
text
@click="dataDictCollapsed = !dataDictCollapsed"
@click.stop="dataDictCollapsed = !dataDictCollapsed"
>
<el-icon>
<component :is="dataDictCollapsed ? 'Expand' : 'Fold'" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment