Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ttnzhang opened this issue Oct 12, 2023 · 6 comments
Closed

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

ttnzhang opened this issue Oct 12, 2023 · 6 comments

Comments

@ttnzhang
Copy link

版本号: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在线功能(需说明用的主题模板),还是生成的代码功能;
@zhangdaiscott
Copy link
Member

zy

@liaozhiyang
Copy link

已修复,下一版本发布。
你本地可按如下更改
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
Copy link

liwenpmz commented Jan 4, 2024

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

@liwenpmz
Copy link

liwenpmz commented Jan 4, 2024

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

@liwenpmz
Copy link

liwenpmz commented Jan 4, 2024

image

@zhangdaiscott
Copy link
Member

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

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants