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
34d576ab
Commit
34d576ab
authored
Jul 21, 2020
by
李晓静
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
2fd4ccc6
14a11859
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
index.tsx
...nents/apolloTable/component/base/edit/text-link/index.tsx
+17
-4
No files found.
components/apolloTable/component/base/edit/text-link/index.tsx
View file @
34d576ab
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Input
,
Modal
}
from
'antd'
;
import
styles
from
'./styles.less'
;
import
{
onBlurFn
}
from
'../onBlurFn'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
import
{
ApolloTextAreaProps
}
from
'../editInterface'
;
import
{
Consumer
}
from
'../../../context'
;
export
const
ApolloTextLink
=
(
props
:
ApolloTextAreaProps
)
=>
{
const
{
maxLength
,
onChange
,
value
,
cutLength
,
getDetail
,
rowData
,
onEmitChange
,
columnConfig
,
origin
}
=
props
;
const
{
maxLength
,
onChange
,
value
,
onEmitChange
,
columnConfig
,
origin
}
=
props
;
const
{
columnChsName
}
=
columnConfig
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'value'
,
'cutLength'
,
'getDetail'
,
'rowData'
,
'onEmitChange'
]);
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
...
...
@@ -17,12 +18,20 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
getMore
();
}
},
[
value
]);
const
[
inputVal
,
setInputVal
]
=
useState
(
value
)
useEffect
(()
=>
{
setInputVal
(
value
);
},
[
value
]);
// useEffect(() => {
// if (value && value.length === cutLength) {
// getMore();
// }
// }, []);
const
inputOnBlurFn
=
()
=>
{
if
(
typeof
onBlurFn
===
'function'
)
{
onBlurFn
(
props
);
}
};
const
changeValue
=
(
e
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
onChange
(
e
.
target
.
value
);
...
...
@@ -62,8 +71,12 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
<
Input
.
TextArea
className=
{
styles
.
inputForm
}
{
...
selfProps
}
value=
{
value
}
onChange=
{
changeValue
}
value=
{
inputVal
}
onBlur=
{
inputOnBlurFn
}
onChange=
{
(
e
)
=>
{
changeValue
(
e
);
setInputVal
(
e
.
target
.
value
)
}
}
/>
{
!!
maxLength
&&
(
<
span
className=
{
styles
.
wordNumberForm
}
>
...
...
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