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
5efdec64
Commit
5efdec64
authored
Jun 08, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1885c41c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
7 deletions
+31
-7
Cell.tsx
components/apolloTable/component/Cell.tsx
+1
-0
index.tsx
...onents/apolloTable/component/base/edit/textarea/index.tsx
+29
-7
styles.less
...ents/apolloTable/component/base/edit/textarea/styles.less
+1
-0
No files found.
components/apolloTable/component/Cell.tsx
View file @
5efdec64
...
@@ -263,6 +263,7 @@ const Cell = (props: CellProps) => {
...
@@ -263,6 +263,7 @@ const Cell = (props: CellProps) => {
{
...
newProps
}
{
...
newProps
}
columnConfig=
{
columnConfig
}
columnConfig=
{
columnConfig
}
onChange=
{
changeCellData
}
onChange=
{
changeCellData
}
rowData=
{
record
}
onEmitChange=
{
(
changedValue
:
any
,
optionValue
:
any
)
=>
{
onEmitChange=
{
(
changedValue
:
any
,
optionValue
:
any
)
=>
{
const
value
=
setFormat
(
editConfig
,
columnConfig
,
changedValue
,
optionValue
);
const
value
=
setFormat
(
editConfig
,
columnConfig
,
changedValue
,
optionValue
);
emitChangeCellData
(
value
,
optionValue
);
emitChangeCellData
(
value
,
optionValue
);
...
...
components/apolloTable/component/base/edit/textarea/index.tsx
View file @
5efdec64
import
React
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Input
}
from
'antd'
;
import
{
Input
}
from
'antd'
;
import
styles
from
'./styles.less'
;
import
styles
from
'./styles.less'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
...
@@ -6,8 +6,17 @@ import { ApolloTextAreaProps } from '../editInterface';
...
@@ -6,8 +6,17 @@ import { ApolloTextAreaProps } from '../editInterface';
import
{
Consumer
}
from
'../../../context'
;
import
{
Consumer
}
from
'../../../context'
;
export
const
ApolloTextArea
=
(
props
:
ApolloTextAreaProps
)
=>
{
export
const
ApolloTextArea
=
(
props
:
ApolloTextAreaProps
)
=>
{
const
{
maxLength
,
onChange
,
value
}
=
props
;
const
{
maxLength
,
onChange
,
value
,
cutLength
,
getDetail
,
rowData
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'value'
]);
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
useEffect
(()
=>
{
setCurValue
(
value
);
},
[
value
]);
useEffect
(()
=>
{
if
(
value
.
length
===
cutLength
)
{
getMore
();
}
},
[]);
const
changeValue
=
(
e
)
=>
{
const
changeValue
=
(
e
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
if
(
typeof
onChange
===
'function'
)
{
...
@@ -15,16 +24,29 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
...
@@ -15,16 +24,29 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
}
}
};
};
const
getMore
=
async
()
=>
{
let
newValue
=
await
getDetail
({
rowId
:
rowData
.
id
});
if
(
newValue
)
{
newValue
=
newValue
[
0
]
&&
newValue
[
0
].
value
;
setCurValue
(
newValue
);
}
};
return
(
return
(
<
Consumer
>
<
Consumer
>
{
({
locale
})
=>
{
{
({
locale
})
=>
{
return
(
return
(
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
<
Input
.
TextArea
className=
{
styles
.
input
}
{
...
selfProps
}
onChange=
{
changeValue
}
/>
<
Input
.
TextArea
className=
{
styles
.
input
}
{
...
selfProps
}
value=
{
curValue
}
onChange=
{
changeValue
}
/>
{
!!
maxLength
&&
(
{
!!
maxLength
&&
(
<
span
className=
{
styles
.
wordNumber
}
>
{
`${locale.alreadyInput} ${
<
span
className=
{
styles
.
wordNumber
}
>
(value || '').length
{
`${locale.alreadyInput} ${(curValue || '').length}/${maxLength}`
}
}/${maxLength}`
}
</
span
>
</
span
>
)
}
)
}
</
div
>
</
div
>
);
);
...
...
components/apolloTable/component/base/edit/textarea/styles.less
View file @
5efdec64
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
left: 0;
left: 0;
.input {
.input {
padding-bottom: 18px;
padding-bottom: 18px;
max-height: 500px !important;
}
}
.wordNumber {
.wordNumber {
position: absolute;
position: absolute;
...
...
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