Skip to content

表格禁用勾选后,点击全选还是会选中 #5466

@ttnzhang

Description

@ttnzhang
版本号:3.5.5
前端版本:vue3
问题描述:表格某列禁止勾选后,点击表头全部勾选还是会选中。
截图&代码:

rowSelection: {
type: 'checkbox',
getCheckboxProps(record: Recordable) {
if (record.processStatus == 'approve' && record.stageStatus!='publicity') {
return { disabled: false };
} else {
return { disabled: true };
}
},
onChange(keys,rows){
console.log(keys)
console.log(rows)
}
},

GK9E$63~AHB94D1 8QAIGPE

官方vue3演示版 组件&功能>树形表格 有同样的问题

友情提示(为了提高issue处理效率):

  • 未按格式要求发帖,会被直接删掉;
  • 描述过于简单或模糊,导致无法处理的,会被直接删掉;
  • 请自己初判问题描述是否清楚,是否方便我们调查处理;
  • 针对问题请说明是Online在线功能(需说明用的主题模板),还是生成的代码功能;

Activity

zhangdaiscott

zhangdaiscott commented on Oct 13, 2023

@zhangdaiscott
Member

zy

liaozhiyang

liaozhiyang commented on Oct 17, 2023

@liaozhiyang
Contributor

已修复,下一版本发布。
你本地可按如下更改
src/components/Table/src/hooks/useCustomSelection.tsx
const flattedData = computed(() => {
const data = flattenData(tableData.value, childrenColumnName.value);
const rowSelection = propsRef.value.rowSelection;
if (rowSelection?.type === 'checkbox' && rowSelection.getCheckboxProps) {
for (let i = 0, len = data.length; i < len; i++) {
const record = data[i];
const result = rowSelection.getCheckboxProps(record);
if (result.disabled) {
data.splice(i, 1);
i--;
len--;
}
}
}
return data;
});
image
image

src/components/Table/src/components/CustomSelectHeader.vue
image

liwenpmz

liwenpmz commented on Jan 4, 2024

@liwenpmz

@zhangdaiscott 打包后会出现样式问题

liwenpmz

liwenpmz commented on Jan 4, 2024

@liwenpmz

打包后 全选按钮样式不生效 @zhangdaiscott

liwenpmz

liwenpmz commented on Jan 4, 2024

@liwenpmz

image

zhangdaiscott

zhangdaiscott commented on Jan 4, 2024

@zhangdaiscott
Member

好像是vue版本号问题,固定版本号就好了

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zhangdaiscott@liaozhiyang@ttnzhang@liwenpmz

        Issue actions

          表格禁用勾选后,点击全选还是会选中 · Issue #5466 · jeecgboot/JeecgBoot