Commit e6f73fe3 authored by zhangwenshuai's avatar zhangwenshuai

增加枚举

parent 2210d571
...@@ -14,6 +14,10 @@ import expandIcon from '../assets/extend.png'; ...@@ -14,6 +14,10 @@ import expandIcon from '../assets/extend.png';
import { transferAttr } from './base/_utils/transferAttr'; import { transferAttr } from './base/_utils/transferAttr';
import { emptyModel } from '@/submodule/components/apolloTable/component/base/_utils/setFormatter'; import { emptyModel } from '@/submodule/components/apolloTable/component/base/_utils/setFormatter';
enum EDIT_STATUS {
'FREE', // 空闲
'EDITING', // 编辑中
}
const Cell = (props: CellProps) => { const Cell = (props: CellProps) => {
const { const {
columnConfig, columnConfig,
...@@ -64,7 +68,7 @@ const Cell = (props: CellProps) => { ...@@ -64,7 +68,7 @@ const Cell = (props: CellProps) => {
if (_.isEqual(temp, changedValue)) { if (_.isEqual(temp, changedValue)) {
setStatus('detail'); setStatus('detail');
if (typeof onEmitMsg === 'function') { if (typeof onEmitMsg === 'function') {
onEmitMsg({ status: 'free' }); onEmitMsg({ status: EDIT_STATUS.FREE });
} }
return; return;
} }
...@@ -104,7 +108,7 @@ const Cell = (props: CellProps) => { ...@@ -104,7 +108,7 @@ const Cell = (props: CellProps) => {
} }
setStatus('detail'); setStatus('detail');
if (typeof onEmitMsg === 'function') { if (typeof onEmitMsg === 'function') {
onEmitMsg({ status: 'free' }); onEmitMsg({ status: EDIT_STATUS.FREE });
} }
}; };
// 添加行hover样式 // 添加行hover样式
...@@ -240,7 +244,7 @@ const Cell = (props: CellProps) => { ...@@ -240,7 +244,7 @@ const Cell = (props: CellProps) => {
// 当前已选中,则进入编辑状态 // 当前已选中,则进入编辑状态
setStatus('edit'); setStatus('edit');
if (typeof onEmitMsg === 'function') { if (typeof onEmitMsg === 'function') {
onEmitMsg({ rowId: record.id, columnName, status: 'editing' }); onEmitMsg({ rowId: record.id, columnName, status: EDIT_STATUS.EDITING });
} }
if (dom) { if (dom) {
// 给当前dom添加编辑状态 // 给当前dom添加编辑状态
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment