Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web_component
submodule
Commits
e6f73fe3
Commit
e6f73fe3
authored
Jul 22, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加枚举
parent
2210d571
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Cell.tsx
components/apolloTable/component/Cell.tsx
+7
-3
No files found.
components/apolloTable/component/Cell.tsx
View file @
e6f73fe3
...
@@ -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添加编辑状态
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment