最近公司某一项目的手机端,新增需求:table中的附件要可以编辑,并且是在特定条件下可编辑,其他仅做展示效果。
查阅官方文档,没有发现是否隐藏这一属性,通过css控制样式感觉也比较麻烦,后面发现可以通过过滤来控制
效果图:
不可编辑、仅展示
可编辑
实现代码(主要是相关的columns):
const [detailList, setDetailList] = useState([]) // 明细信息
const [sealList, setSealList] = useState([]); // 上传的范印
const [editId, setEditId] = useState(''); // 修改范印的数据id
const columns = [
// {} ...
{
title: getIntl({
id: 'sealFileId' }), // 范印
dataIndex: 'sealFileSuffix',
key: 'sealFileSuffix',
render: (val, params