diff --git a/components/apolloTable/component/Cell.tsx b/components/apolloTable/component/Cell.tsx index 10fe985a9758087518b8bc361b717e65ccb1bc83..771d167137403702972d496e923e040abd91da5b 100644 --- a/components/apolloTable/component/Cell.tsx +++ b/components/apolloTable/component/Cell.tsx @@ -14,6 +14,10 @@ import expandIcon from '../assets/extend.png'; import { transferAttr } from './base/_utils/transferAttr'; import { emptyModel } from '@/submodule/components/apolloTable/component/base/_utils/setFormatter'; +enum EDIT_STATUS { + 'FREE', // 空闲 + 'EDITING', // 编辑中 +} const Cell = (props: CellProps) => { const { columnConfig, @@ -64,7 +68,7 @@ const Cell = (props: CellProps) => { if (_.isEqual(temp, changedValue)) { setStatus('detail'); if (typeof onEmitMsg === 'function') { - onEmitMsg({ status: 'free' }); + onEmitMsg({ status: EDIT_STATUS.FREE }); } return; } @@ -104,7 +108,7 @@ const Cell = (props: CellProps) => { } setStatus('detail'); if (typeof onEmitMsg === 'function') { - onEmitMsg({ status: 'free' }); + onEmitMsg({ status: EDIT_STATUS.FREE }); } }; // 添加行hover样式 @@ -240,7 +244,7 @@ const Cell = (props: CellProps) => { // 当前已选中,则进入编辑状态 setStatus('edit'); if (typeof onEmitMsg === 'function') { - onEmitMsg({ rowId: record.id, columnName, status: 'editing' }); + onEmitMsg({ rowId: record.id, columnName, status: EDIT_STATUS.EDITING }); } if (dom) { // 给当前dom添加编辑状态