From ac346f929c8a17664d42505ec5f9f7e0a4537cb0 Mon Sep 17 00:00:00 2001 From: oneao Date: Sun, 30 Aug 2026 21:14:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(module-management):=20=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E5=BC=80=E5=85=B3=E7=94=B1=20Switch=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=20Checkbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与「启用」列的表格勾选交互保持一致,视觉更轻。 --- .../components/ParticipationCell.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/code/fms/fms-vue/src/views/system/module-management/components/ParticipationCell.js b/code/fms/fms-vue/src/views/system/module-management/components/ParticipationCell.js index 4c671cfd..1e16eb71 100644 --- a/code/fms/fms-vue/src/views/system/module-management/components/ParticipationCell.js +++ b/code/fms/fms-vue/src/views/system/module-management/components/ParticipationCell.js @@ -1,29 +1,26 @@ /** - * 字段参与开关单元格(h 渲染函数):ui Switch 居中渲染,点击切换参与状态。 + * 字段参与勾选单元格(h 渲染函数):ui Checkbox 居中渲染,勾选切换参与状态。 * 供字段定义面板 FmsTable 的 表单/列表/查询 三列 customCell 使用。 * 表格 cell 由 h() 动态渲染、不受 scoped 样式约束,样式放独立 scss 随本模块全局引入。 */ import { h } from 'vue' -import { Switch } from '@/components/ui' +import { Checkbox } from '@/components/ui' import './participation-cell.scss' /** * @param {object} opts * @param {(row: object) => boolean} opts.isOn 该行当前是否参与 - * @param {(row: object) => void} opts.onToggle 点击开关 - * @param {string} opts.title 开关提示文案(如「参与列表显示」) + * @param {(row: object) => void} opts.onToggle 勾选切换 + * @param {string} opts.title 提示文案(如「参与列表显示」) */ export function createParticipationCell({ isOn, onToggle, title }) { return ({ row }) => h('div', { class: 'mm-part-cell' }, [ - h(Switch, { + h(Checkbox, { modelValue: isOn(row), title, 'aria-label': title, - onClick: (event) => { - event.stopPropagation() - onToggle(row) - }, + onChange: () => onToggle(row), }), ]) }