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

feat(web): 自定义规则卡条件树 UI + 字段类型分类 + 字段注释排版

把单条 el-table 行(含 1 个 el-input 关键字)重写为 div + CSS Grid 4 列布局。

- 字段类型 → 比较符映射(前端镜像 web/core/rule_types.py)
  - NUMERIC_TYPES_FRONT / DATE_TYPES_FRONT / TEXT_TYPES_FRONT 三集合
  - classifyField(dataType) → text/numeric/date/unknown
  - COMPARATORS_FRONT / INPUT_HINT_FRONT 按字段类分发
  - fieldClassTagType(dataType) → 数值 warning / 日期 info / 字符 success

- 全新递归组件 <condition-tree>
  - app.component('condition-tree', { name: 'ConditionTree', ... })
  - props: node(默认空 group) / column / dataType / depth
  - 渲染:group 节点显示 AND/OR radio + 项数 + 「+ 子条件 / + 嵌套组」按钮
  - 渲染:leaf 节点显示 comparator select + value input + × 删除
  - emits: change / remove

- 列表 div 替代 el-table
  - 4 列 grid:规则名称 / 对象·字段·类型 / 条件树 / 操作
  - .field-block 容器:表名 + 表注释 / 字段名 + 类型 + 字段注释 inline 排
  - .field-block--field dashed border-top 视觉分隔两行

- addCustomRule 改造
  - 透传 row.data_type / row.column_type(决定可用比较符)
  - 初始化 group = { kind: 'group', op: 'AND', children: [] }
  - table_comment 兜底查 tableSummary(字段行 row 不带)
  - 自动展开卡片(customConfigCollapsed = false)

- buildCustomRulesForSubmit 改读新结构
  - hasValidLeaf(node) 递归判断:跳过空树
  - 输出包含 {rule_name, table_name, column_name, data_type, group_op, group}

- 修复 2 个调试 bug
  - fieldClassTagType 是模块作用域函数,模板调用须 setup() return 出来
  - <condition-tree> props.node 加 default 兜底,避免 rule.group undefined 渲染崩溃
parent 0967e522
This diff is collapsed.
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