From 8b6603d015c7b143f7ee2d6beae227981f94bbde Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Thu, 17 Dec 2020 20:30:55 +0800 Subject: [PATCH] fix bug --- components/apolloTable/component/Cell.tsx | 15 ++++++++------- .../component/base/detail/text-link/index.tsx | 5 +++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/components/apolloTable/component/Cell.tsx b/components/apolloTable/component/Cell.tsx index c873ab3..012c447 100644 --- a/components/apolloTable/component/Cell.tsx +++ b/components/apolloTable/component/Cell.tsx @@ -238,17 +238,18 @@ const Cell = (props: CellProps) => { const style: any = {}; const { dynamicCellConfigDTO } = columnData || {}; + // 不可编辑状态(无编辑权限、列只读、行锁定、单元格只读) + const disabled = + !cellEditable || + readOnlyFlag || + record.isLocked || + (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag); + transferColumn.disabled = disabled; const detail = (
{ - // 不可编辑状态(无编辑权限、列只读、行锁定、单元格只读) - if ( - !cellEditable || - readOnlyFlag || - record.isLocked || - (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag) - ) { + if (disabled) { return false; } // 获取当前节点的选中状态 diff --git a/components/apolloTable/component/base/detail/text-link/index.tsx b/components/apolloTable/component/base/detail/text-link/index.tsx index 80b11d4..c796245 100644 --- a/components/apolloTable/component/base/detail/text-link/index.tsx +++ b/components/apolloTable/component/base/detail/text-link/index.tsx @@ -5,7 +5,8 @@ import s from './index.less'; import IconFont from '@/submodule/components/IconFont'; export const ApolloTextLinkDetail = (props: any) => { - const { value, origin, formatter, changeEdit, columnConfig } = props; + const { value, origin, formatter, changeEdit, columnConfig, componentAttr } = props; + const { disabled } = componentAttr; const newValue = formatter ? formatter(value) : value; if (!newValue) return null; // 以逗号分隔 @@ -123,7 +124,7 @@ export const ApolloTextLinkDetail = (props: any) => { )}
- {origin !== 'detailForm' && ( + {origin !== 'detailForm' && !disabled && (
{ -- 2.21.0