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
5a27c7e9
Commit
5a27c7e9
authored
Jul 27, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update edit props
parent
38f5407a
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
209 additions
and
70 deletions
+209
-70
index.tsx
...onents/apolloTable/component/base/edit/cascader/index.tsx
+12
-1
index.tsx
components/apolloTable/component/base/edit/date/index.tsx
+12
-3
index.tsx
...nents/apolloTable/component/base/edit/dateRange/index.tsx
+14
-3
index.tsx
components/apolloTable/component/base/edit/input/index.tsx
+32
-17
index.tsx
components/apolloTable/component/base/edit/number/index.tsx
+23
-5
index.tsx
components/apolloTable/component/base/edit/rate/index.tsx
+9
-1
index.tsx
components/apolloTable/component/base/edit/search/index.tsx
+12
-1
index.tsx
components/apolloTable/component/base/edit/select/index.tsx
+11
-1
index.tsx
...nents/apolloTable/component/base/edit/text-link/index.tsx
+23
-8
styles.less
...nts/apolloTable/component/base/edit/text-link/styles.less
+4
-1
index.tsx
...nts/apolloTable/component/base/edit/text-select/index.tsx
+8
-1
index.tsx
...onents/apolloTable/component/base/edit/textarea/index.tsx
+22
-17
styles.less
...ents/apolloTable/component/base/edit/textarea/styles.less
+4
-1
index.tsx
...nts/apolloTable/component/base/edit/tree-select/index.tsx
+9
-1
index.tsx
components/apolloTable/component/base/edit/upload/index.tsx
+14
-9
No files found.
components/apolloTable/component/base/edit/cascader/index.tsx
View file @
5a27c7e9
...
@@ -17,7 +17,18 @@ export const ApolloCascader = (props: ApolloCascaderProps) => {
...
@@ -17,7 +17,18 @@ export const ApolloCascader = (props: ApolloCascaderProps) => {
onChange
,
onChange
,
request
,
request
,
}
=
props
;
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'requestCode'
,
'request'
,
'fieldNames'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'requestCode'
,
'request'
,
'fieldNames'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getCalendarContainer'
,
'origin'
,
]);
const
[
options
,
setOptions
]
=
React
.
useState
([]);
const
[
options
,
setOptions
]
=
React
.
useState
([]);
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
const
fetchData
=
async
()
=>
{
const
fetchData
=
async
()
=>
{
...
...
components/apolloTable/component/base/edit/date/index.tsx
View file @
5a27c7e9
...
@@ -6,7 +6,15 @@ import styles from './styles.less';
...
@@ -6,7 +6,15 @@ import styles from './styles.less';
export
const
ApolloDate
=
(
props
:
any
)
=>
{
export
const
ApolloDate
=
(
props
:
any
)
=>
{
const
{
origin
,
onChange
,
showTime
}
=
props
;
const
{
origin
,
onChange
,
showTime
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'columnConfig'
]);
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'columnConfig'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getPopupContainer'
,
'origin'
,
]);
const
isOpen
=
useRef
();
const
isOpen
=
useRef
();
const
changeValue
=
(
date
,
dateString
)
=>
{
const
changeValue
=
(
date
,
dateString
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
if
(
typeof
onChange
===
'function'
)
{
...
@@ -25,7 +33,7 @@ export const ApolloDate = (props: any) => {
...
@@ -25,7 +33,7 @@ export const ApolloDate = (props: any) => {
onBlurFn
(
props
);
onBlurFn
(
props
);
}
}
};
};
return
(
origin
===
'editForm'
?
return
origin
===
'editForm'
?
(
<
DatePicker
<
DatePicker
className=
{
styles
.
date
}
className=
{
styles
.
date
}
// value={inputVal}
// value={inputVal}
...
@@ -34,7 +42,8 @@ export const ApolloDate = (props: any) => {
...
@@ -34,7 +42,8 @@ export const ApolloDate = (props: any) => {
{
...
selfProps
}
{
...
selfProps
}
onChange=
{
changeValue
}
onChange=
{
changeValue
}
onOpenChange=
{
showTime
?
timeOnBlurFn
:
dateOnBlurFn
}
onOpenChange=
{
showTime
?
timeOnBlurFn
:
dateOnBlurFn
}
/>
:
/>
)
:
(
<
DatePicker
<
DatePicker
className=
{
styles
.
date
}
className=
{
styles
.
date
}
dropdownClassName=
{
styles
.
dropdownClassName
}
dropdownClassName=
{
styles
.
dropdownClassName
}
...
...
components/apolloTable/component/base/edit/dateRange/index.tsx
View file @
5a27c7e9
...
@@ -7,7 +7,17 @@ import styles from './styles.less';
...
@@ -7,7 +7,17 @@ import styles from './styles.less';
const
{
RangePicker
}
=
DatePicker
;
const
{
RangePicker
}
=
DatePicker
;
export
const
ApolloDateRange
=
(
props
:
any
)
=>
{
export
const
ApolloDateRange
=
(
props
:
any
)
=>
{
const
{
onChange
,
placeholder
,
showTime
,
beginDatePlaceholder
,
endDatePlaceholder
,
origin
}
=
props
;
const
{
onChange
,
placeholder
,
showTime
,
beginDatePlaceholder
,
endDatePlaceholder
,
origin
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'columnConfig'
]);
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'columnConfig'
,
'beginDatePlaceholder'
,
'endDatePlaceholder'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getPopupContainer'
,
'origin'
,
]);
const
isOpen
=
useRef
();
const
isOpen
=
useRef
();
const
changeValue
=
(
date
,
dateString
)
=>
{
const
changeValue
=
(
date
,
dateString
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
if
(
typeof
onChange
===
'function'
)
{
...
@@ -26,7 +36,7 @@ export const ApolloDateRange = (props: any) => {
...
@@ -26,7 +36,7 @@ export const ApolloDateRange = (props: any) => {
onBlurFn
(
props
);
onBlurFn
(
props
);
}
}
};
};
return
(
origin
===
'editForm'
?
return
origin
===
'editForm'
?
(
<
RangePicker
<
RangePicker
className=
{
styles
.
date
}
className=
{
styles
.
date
}
dropdownClassName=
{
styles
.
dropdownClassName
}
dropdownClassName=
{
styles
.
dropdownClassName
}
...
@@ -35,7 +45,8 @@ export const ApolloDateRange = (props: any) => {
...
@@ -35,7 +45,8 @@ export const ApolloDateRange = (props: any) => {
placeholder=
{
[
beginDatePlaceholder
||
placeholder
,
endDatePlaceholder
||
placeholder
]
}
placeholder=
{
[
beginDatePlaceholder
||
placeholder
,
endDatePlaceholder
||
placeholder
]
}
onChange=
{
changeValue
}
onChange=
{
changeValue
}
onOpenChange=
{
showTime
?
timeOnBlurFn
:
dateOnBlurFn
}
onOpenChange=
{
showTime
?
timeOnBlurFn
:
dateOnBlurFn
}
/>
:
/>
)
:
(
<
RangePicker
<
RangePicker
className=
{
styles
.
date
}
className=
{
styles
.
date
}
dropdownClassName=
{
styles
.
dropdownClassName
}
dropdownClassName=
{
styles
.
dropdownClassName
}
...
...
components/apolloTable/component/base/edit/input/index.tsx
View file @
5a27c7e9
...
@@ -8,8 +8,19 @@ import { Consumer } from '../../../context';
...
@@ -8,8 +8,19 @@ import { Consumer } from '../../../context';
export
const
ApolloInput
=
(
props
:
ApolloInputProps
)
=>
{
export
const
ApolloInput
=
(
props
:
ApolloInputProps
)
=>
{
const
{
maxLength
,
onChange
,
value
,
style
,
origin
}
=
props
;
const
{
maxLength
,
onChange
,
value
,
style
,
origin
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'style'
,
'onEmitChange'
]);
const
selfProps
=
antiAssign
(
props
,
[
const
[
inputVal
,
setInputVal
]
=
useState
(
value
)
'columnConfig'
,
'onChange'
,
'style'
,
'onEmitChange'
,
'rowData'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getPopupContainer'
,
'getCalendarContainer'
,
]);
const
[
inputVal
,
setInputVal
]
=
useState
(
value
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setInputVal
(
value
);
setInputVal
(
value
);
},
[
value
]);
},
[
value
]);
...
@@ -42,8 +53,8 @@ export const ApolloInput = (props: ApolloInputProps) => {
...
@@ -42,8 +53,8 @@ export const ApolloInput = (props: ApolloInputProps) => {
{
({
locale
})
=>
{
{
({
locale
})
=>
{
return
(
return
(
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
{
{
origin
===
'editForm'
?
(
origin
===
'editForm'
?
<
Input
<
Input
className=
{
styles
.
input
}
className=
{
styles
.
input
}
style=
{
newStyle
}
style=
{
newStyle
}
{
...
selfProps
}
{
...
selfProps
}
...
@@ -51,22 +62,26 @@ export const ApolloInput = (props: ApolloInputProps) => {
...
@@ -51,22 +62,26 @@ export const ApolloInput = (props: ApolloInputProps) => {
onBlur=
{
inputOnBlurFn
}
onBlur=
{
inputOnBlurFn
}
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
changeValue
(
e
.
target
.
value
);
changeValue
(
e
.
target
.
value
);
setInputVal
(
e
.
target
.
value
)
setInputVal
(
e
.
target
.
value
)
;
}
}
}
}
/>
:
<
Input
/>
className=
{
styles
.
input
}
)
:
(
style=
{
newStyle
}
<
Input
{
...
selfProps
}
className=
{
styles
.
input
}
onChange=
{
(
e
)
=>
{
style=
{
newStyle
}
changeValue
(
e
.
target
.
value
);
{
...
selfProps
}
}
}
onChange=
{
(
e
)
=>
{
/>
changeValue
(
e
.
target
.
value
);
}
}
}
/>
)
}
{
!!
maxLength
&&
(
{
!!
maxLength
&&
(
<
span
className=
{
styles
.
wordNumber
}
style=
{
wordNumStyle
}
>
{
`${locale.alreadyInput} ${
<
span
className=
{
styles
.
wordNumber
}
style=
{
wordNumStyle
}
>
(value || '').length
{
`${locale.alreadyInput} ${
}/${maxLength}`
}
</
span
>
(value || '').length
}/${maxLength}`
}
</
span
>
)
}
)
}
</
div
>
</
div
>
);
);
...
...
components/apolloTable/component/base/edit/number/index.tsx
View file @
5a27c7e9
...
@@ -7,8 +7,17 @@ import { antiAssign } from '../../../../utils/utils';
...
@@ -7,8 +7,17 @@ import { antiAssign } from '../../../../utils/utils';
export
const
ApolloNumber
=
(
props
:
ApolloNumberProps
)
=>
{
export
const
ApolloNumber
=
(
props
:
ApolloNumberProps
)
=>
{
const
{
onChange
,
origin
,
value
}:
any
=
props
;
const
{
onChange
,
origin
,
value
}:
any
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
]);
const
selfProps
=
antiAssign
(
props
,
[
const
[
inputVal
,
setInputVal
]
=
useState
(
value
)
'columnConfig'
,
'onChange'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getCalendarContainer'
,
'getCalendarContainer'
,
'origin'
,
]);
const
[
inputVal
,
setInputVal
]
=
useState
(
value
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setInputVal
(
value
);
setInputVal
(
value
);
},
[
value
]);
},
[
value
]);
...
@@ -28,7 +37,16 @@ export const ApolloNumber = (props: ApolloNumberProps) => {
...
@@ -28,7 +37,16 @@ export const ApolloNumber = (props: ApolloNumberProps) => {
onBlurFn
(
props
);
onBlurFn
(
props
);
}
}
};
};
return
origin
===
'editForm'
?
return
origin
===
'editForm'
?
(
<
InputNumber
value=
{
inputVal
}
onBlur=
{
inputOnBlurFn
}
className=
{
styles
.
number
}
style=
{
style
}
{
...
o
}
onChange=
{
changeValue
}
/>
<
InputNumber
:
<
InputNumber
className=
{
styles
.
number
}
style=
{
style
}
{
...
o
}
onChange=
{
changeValue
}
/>;
value=
{
inputVal
}
onBlur=
{
inputOnBlurFn
}
className=
{
styles
.
number
}
style=
{
style
}
{
...
o
}
onChange=
{
changeValue
}
/>
)
:
(
<
InputNumber
className=
{
styles
.
number
}
style=
{
style
}
{
...
o
}
onChange=
{
changeValue
}
/>
);
};
};
components/apolloTable/component/base/edit/rate/index.tsx
View file @
5a27c7e9
...
@@ -6,7 +6,15 @@ import { ApolloRateProps } from '../editInterface';
...
@@ -6,7 +6,15 @@ import { ApolloRateProps } from '../editInterface';
export
const
ApolloRate
=
(
props
:
ApolloRateProps
)
=>
{
export
const
ApolloRate
=
(
props
:
ApolloRateProps
)
=>
{
const
{
onChange
}
=
props
;
const
{
onChange
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getCalendarContainer'
,
'getCalendarContainer'
,
]);
const
changeValue
=
(
value
)
=>
{
const
changeValue
=
(
value
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
if
(
typeof
onChange
===
'function'
)
{
...
...
components/apolloTable/component/base/edit/search/index.tsx
View file @
5a27c7e9
...
@@ -8,7 +8,18 @@ import s from './index.less';
...
@@ -8,7 +8,18 @@ import s from './index.less';
export
const
ApolloSearch
=
(
props
:
ApolloSearchProps
)
=>
{
export
const
ApolloSearch
=
(
props
:
ApolloSearchProps
)
=>
{
const
{
onChange
,
maxCount
,
isMultiple
,
request
}
=
props
;
const
{
onChange
,
maxCount
,
isMultiple
,
request
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'isMultiple'
,
'options'
,
'request'
,
'maxCount'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'isMultiple'
,
'options'
,
'request'
,
'maxCount'
,
'request'
,
'tableId'
,
'cellRenderProps'
,
'getCalendarContainer'
,
]);
const
isOpen
:
any
=
useRef
();
const
isOpen
:
any
=
useRef
();
if
(
isMultiple
)
{
if
(
isMultiple
)
{
selfProps
.
mode
=
'multiple'
;
selfProps
.
mode
=
'multiple'
;
...
...
components/apolloTable/component/base/edit/select/index.tsx
View file @
5a27c7e9
...
@@ -7,7 +7,17 @@ import styles from './styles.less';
...
@@ -7,7 +7,17 @@ import styles from './styles.less';
export
const
ApolloSelect
=
(
props
:
ApolloSelectProps
)
=>
{
export
const
ApolloSelect
=
(
props
:
ApolloSelectProps
)
=>
{
const
{
options
=
[],
onChange
,
isMultiple
,
maxPopHeight
}
=
props
;
const
{
options
=
[],
onChange
,
isMultiple
,
maxPopHeight
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'isMultiple'
,
'options'
,
'maxPopHeight'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'isMultiple'
,
'options'
,
'maxPopHeight'
,
'request'
,
'tableId'
,
'cellRenderProps'
,
'getCalendarContainer'
,
]);
const
isOpen
:
any
=
useRef
();
const
isOpen
:
any
=
useRef
();
if
(
isMultiple
)
{
if
(
isMultiple
)
{
...
...
components/apolloTable/component/base/edit/text-link/index.tsx
View file @
5a27c7e9
...
@@ -9,7 +9,22 @@ import { Consumer } from '../../../context';
...
@@ -9,7 +9,22 @@ import { Consumer } from '../../../context';
export
const
ApolloTextLink
=
(
props
:
ApolloTextAreaProps
)
=>
{
export
const
ApolloTextLink
=
(
props
:
ApolloTextAreaProps
)
=>
{
const
{
maxLength
,
onChange
,
value
,
onEmitChange
,
columnConfig
,
origin
}
=
props
;
const
{
maxLength
,
onChange
,
value
,
onEmitChange
,
columnConfig
,
origin
}
=
props
;
const
{
columnChsName
}
=
columnConfig
;
const
{
columnChsName
}
=
columnConfig
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'value'
,
'cutLength'
,
'getDetail'
,
'rowData'
,
'onEmitChange'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'value'
,
'cutLength'
,
'getDetail'
,
'rowData'
,
'onEmitChange'
,
'isMultiple'
,
'origin'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getPopupContainer'
,
'getCalendarContainer'
,
]);
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -18,7 +33,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
...
@@ -18,7 +33,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
getMore
();
getMore
();
}
}
},
[
value
]);
},
[
value
]);
const
[
inputVal
,
setInputVal
]
=
useState
(
value
)
const
[
inputVal
,
setInputVal
]
=
useState
(
value
)
;
useEffect
(()
=>
{
useEffect
(()
=>
{
setInputVal
(
value
);
setInputVal
(
value
);
},
[
value
]);
},
[
value
]);
...
@@ -49,14 +64,14 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
...
@@ -49,14 +64,14 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
onEmitChange
(
value
);
onEmitChange
(
value
);
}
}
setVisible
(
false
);
setVisible
(
false
);
}
}
;
const
confirmChange
=
()
=>
{
const
confirmChange
=
()
=>
{
if
(
typeof
onEmitChange
===
'function'
)
{
if
(
typeof
onEmitChange
===
'function'
)
{
onEmitChange
(
curValue
);
onEmitChange
(
curValue
);
}
}
setVisible
(
false
);
setVisible
(
false
);
}
}
;
const
getMore
=
async
()
=>
{
const
getMore
=
async
()
=>
{
setVisible
(
true
);
setVisible
(
true
);
...
@@ -75,7 +90,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
...
@@ -75,7 +90,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
onBlur=
{
inputOnBlurFn
}
onBlur=
{
inputOnBlurFn
}
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
changeValue
(
e
);
changeValue
(
e
);
setInputVal
(
e
.
target
.
value
)
setInputVal
(
e
.
target
.
value
)
;
}
}
}
}
/>
/>
{
!!
maxLength
&&
(
{
!!
maxLength
&&
(
...
@@ -87,7 +102,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
...
@@ -87,7 +102,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
);
);
}
}
}
}
</
Consumer
>
</
Consumer
>
)
)
;
}
}
return
(
return
(
...
@@ -96,9 +111,9 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
...
@@ -96,9 +111,9 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
return
(
return
(
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
<
Input
<
Input
{
...
selfProps
}
className=
{
styles
.
cellInput
}
style=
{
selfProps
.
style
}
value=
{
value
}
value=
{
value
}
onChange=
{
changeValue
}
/>
/>
<
Modal
visible=
{
visible
}
title=
{
columnChsName
}
onCancel=
{
hide
}
onOk=
{
confirmChange
}
>
<
Modal
visible=
{
visible
}
title=
{
columnChsName
}
onCancel=
{
hide
}
onOk=
{
confirmChange
}
>
<
Input
.
TextArea
<
Input
.
TextArea
...
...
components/apolloTable/component/base/edit/text-link/styles.less
View file @
5a27c7e9
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
color: #e1e1e1;
color: #e1e1e1;
font-size: 12px;
font-size: 12px;
}
}
.cellInput{
user-select: none;
}
}
}
.input {
.input {
padding-bottom: 18px;
padding-bottom: 18px;
...
@@ -23,4 +26,4 @@
...
@@ -23,4 +26,4 @@
bottom: 80px;
bottom: 80px;
color: #e1e1e1;
color: #e1e1e1;
font-size: 12px;
font-size: 12px;
}
}
\ No newline at end of file
components/apolloTable/component/base/edit/text-select/index.tsx
View file @
5a27c7e9
...
@@ -7,7 +7,14 @@ import s from './index.less';
...
@@ -7,7 +7,14 @@ import s from './index.less';
export
const
ApolloInputSearch
=
(
props
:
ApolloInputSearchProps
)
=>
{
export
const
ApolloInputSearch
=
(
props
:
ApolloInputSearchProps
)
=>
{
const
{
onChange
,
request
}
=
props
;
const
{
onChange
,
request
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'request'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'request'
,
'tableId'
,
'cellRenderProps'
,
'getCalendarContainer'
,
]);
const
isOpen
=
useRef
();
const
isOpen
=
useRef
();
const
changeValue
=
(
value
:
any
)
=>
{
const
changeValue
=
(
value
:
any
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
if
(
typeof
onChange
===
'function'
)
{
...
...
components/apolloTable/component/base/edit/textarea/index.tsx
View file @
5a27c7e9
...
@@ -9,7 +9,20 @@ import { Consumer } from '../../../context';
...
@@ -9,7 +9,20 @@ import { Consumer } from '../../../context';
export
const
ApolloTextArea
=
(
props
:
ApolloTextAreaProps
)
=>
{
export
const
ApolloTextArea
=
(
props
:
ApolloTextAreaProps
)
=>
{
const
{
maxLength
,
onChange
,
value
,
getDetail
,
rowData
,
onEmitChange
,
columnConfig
,
origin
}
=
props
;
const
{
maxLength
,
onChange
,
value
,
getDetail
,
rowData
,
onEmitChange
,
columnConfig
,
origin
}
=
props
;
const
{
columnChsName
}
=
columnConfig
;
const
{
columnChsName
}
=
columnConfig
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'value'
,
'cutLength'
,
'getDetail'
,
'rowData'
,
'onEmitChange'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'value'
,
'cutLength'
,
'getDetail'
,
'onEmitChange'
,
'rowData'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getPopupContainer'
,
'getCalendarContainer'
,
]);
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -18,12 +31,8 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
...
@@ -18,12 +31,8 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
getMore
();
getMore
();
}
}
},
[
value
]);
},
[
value
]);
// useEffect(() => {
// if (value && value.length === cutLength) {
const
[
inputVal
,
setInputVal
]
=
useState
(
value
);
// getMore();
// }
// }, []);
const
[
inputVal
,
setInputVal
]
=
useState
(
value
)
useEffect
(()
=>
{
useEffect
(()
=>
{
setInputVal
(
value
);
setInputVal
(
value
);
},
[
value
]);
},
[
value
]);
...
@@ -48,14 +57,14 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
...
@@ -48,14 +57,14 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
onEmitChange
(
value
);
onEmitChange
(
value
);
}
}
setVisible
(
false
);
setVisible
(
false
);
}
}
;
const
confirmChange
=
()
=>
{
const
confirmChange
=
()
=>
{
if
(
typeof
onEmitChange
===
'function'
)
{
if
(
typeof
onEmitChange
===
'function'
)
{
onEmitChange
(
curValue
);
onEmitChange
(
curValue
);
}
}
setVisible
(
false
);
setVisible
(
false
);
}
}
;
const
getMore
=
async
()
=>
{
const
getMore
=
async
()
=>
{
if
(
getDetail
&&
rowData
)
{
if
(
getDetail
&&
rowData
)
{
...
@@ -79,8 +88,8 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
...
@@ -79,8 +88,8 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
value=
{
inputVal
}
value=
{
inputVal
}
onBlur=
{
inputOnBlurFn
}
onBlur=
{
inputOnBlurFn
}
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
changeValue
(
e
)
changeValue
(
e
)
;
setInputVal
(
e
.
target
.
value
)
setInputVal
(
e
.
target
.
value
)
;
}
}
}
}
/>
/>
...
@@ -93,7 +102,7 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
...
@@ -93,7 +102,7 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
);
);
}
}
}
}
</
Consumer
>
</
Consumer
>
)
)
;
}
}
return
(
return
(
...
@@ -101,11 +110,7 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
...
@@ -101,11 +110,7 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
{
({
locale
})
=>
{
{
({
locale
})
=>
{
return
(
return
(
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
<
Input
<
Input
className=
{
styles
.
cellInput
}
style=
{
selfProps
.
style
}
value=
{
value
}
/>
{
...
selfProps
}
value=
{
value
}
onChange=
{
changeValue
}
/>
<
Modal
visible=
{
visible
}
title=
{
columnChsName
}
onCancel=
{
hide
}
onOk=
{
confirmChange
}
>
<
Modal
visible=
{
visible
}
title=
{
columnChsName
}
onCancel=
{
hide
}
onOk=
{
confirmChange
}
>
<
Input
.
TextArea
<
Input
.
TextArea
className=
{
styles
.
input
}
className=
{
styles
.
input
}
...
...
components/apolloTable/component/base/edit/textarea/styles.less
View file @
5a27c7e9
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
color: #e1e1e1;
color: #e1e1e1;
font-size: 12px;
font-size: 12px;
}
}
.cellInput{
user-select: none;
}
}
}
.input {
.input {
padding-bottom: 18px;
padding-bottom: 18px;
...
@@ -23,4 +26,4 @@
...
@@ -23,4 +26,4 @@
bottom: 80px;
bottom: 80px;
color: #e1e1e1;
color: #e1e1e1;
font-size: 12px;
font-size: 12px;
}
}
\ No newline at end of file
components/apolloTable/component/base/edit/tree-select/index.tsx
View file @
5a27c7e9
...
@@ -6,7 +6,15 @@ import s from './index.less';
...
@@ -6,7 +6,15 @@ import s from './index.less';
export
const
ApolloTreeSelect
=
(
props
:
ApolloTreeSelectProps
)
=>
{
export
const
ApolloTreeSelect
=
(
props
:
ApolloTreeSelectProps
)
=>
{
const
{
onChange
,
isMultiple
}
=
props
;
const
{
onChange
,
isMultiple
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'isMultiple'
]);
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
,
'isMultiple'
,
'request'
,
'tableId'
,
'cellRenderProps'
,
'getCalendarContainer'
,
]);
const
changeValue
=
(
value
)
=>
{
const
changeValue
=
(
value
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
if
(
typeof
onChange
===
'function'
)
{
...
...
components/apolloTable/component/base/edit/upload/index.tsx
View file @
5a27c7e9
...
@@ -6,11 +6,21 @@ import { antiAssign } from '../../../../utils/utils';
...
@@ -6,11 +6,21 @@ import { antiAssign } from '../../../../utils/utils';
import
s
from
'./index.less'
;
import
s
from
'./index.less'
;
import
{
onBlurFn
}
from
'../onBlurFn'
;
import
{
onBlurFn
}
from
'../onBlurFn'
;
import
Upload
from
'../../extra/upload'
;
import
Upload
from
'../../extra/upload'
;
import
addIcon
from
'../../../../assets/addIcon.png'
;
export
const
ApolloUpload
=
(
props
:
ApolloUploadProps
)
=>
{
export
const
ApolloUpload
=
(
props
:
ApolloUploadProps
)
=>
{
const
{
isMultiple
,
onEmitChange
,
onChange
,
disabled
,
origin
}
=
props
;
const
{
isMultiple
,
onEmitChange
,
onChange
,
disabled
,
origin
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'value'
]);
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'value'
,
'onEmitChange'
,
'tableId'
,
'cellRenderProps'
,
'maxPopHeight'
,
'getPopupContainer'
,
'getCalendarContainer'
,
'isMultiple'
,
'origin'
,
]);
if
(
isMultiple
)
{
if
(
isMultiple
)
{
selfProps
.
multiple
=
true
;
selfProps
.
multiple
=
true
;
}
else
{
}
else
{
...
@@ -22,7 +32,7 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
...
@@ -22,7 +32,7 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
const
changeValue
=
(
value
)
=>
{
const
changeValue
=
(
value
)
=>
{
setValue
(
value
);
setValue
(
value
);
setEmptyVal
([]);
setEmptyVal
([]);
onBlurFn
({
...
props
,
value
})
onBlurFn
({
...
props
,
value
})
;
};
};
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
refHelper
=
useRef
(
visible
);
const
refHelper
=
useRef
(
visible
);
...
@@ -58,7 +68,6 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
...
@@ -58,7 +68,6 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
onChange
(
value
);
onChange
(
value
);
}
}
toggleUploadDialog
(
false
);
toggleUploadDialog
(
false
);
};
};
const
onCancel
=
()
=>
{
const
onCancel
=
()
=>
{
if
(
typeof
onEmitChange
===
'function'
)
{
if
(
typeof
onEmitChange
===
'function'
)
{
...
@@ -83,10 +92,7 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
...
@@ -83,10 +92,7 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
return
(
return
(
<
div
key=
{
i
}
className=
{
s
.
picContainer
}
>
<
div
key=
{
i
}
className=
{
s
.
picContainer
}
>
<
Tooltip
placement=
"bottom"
title=
{
item
.
name
}
>
<
Tooltip
placement=
"bottom"
title=
{
item
.
name
}
>
<
img
<
img
className=
{
classNames
(
s
.
pic
,
s
.
editForm
)
}
src=
{
item
.
thumbUrl
}
/>
className=
{
classNames
(
s
.
pic
,
s
.
editForm
)
}
src=
{
item
.
thumbUrl
}
/>
</
Tooltip
>
</
Tooltip
>
</
div
>
</
div
>
);
);
...
@@ -106,7 +112,6 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
...
@@ -106,7 +112,6 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
return
(
return
(
<
div
key=
{
i
}
className=
{
s
.
picContainer
}
>
<
div
key=
{
i
}
className=
{
s
.
picContainer
}
>
<
Tooltip
placement=
"bottom"
title=
{
item
.
name
}
>
<
Tooltip
placement=
"bottom"
title=
{
item
.
name
}
>
<
img
<
img
className=
{
origin
===
'editForm'
?
classNames
(
s
.
pic
,
s
.
editForm
)
:
s
.
pic
}
className=
{
origin
===
'editForm'
?
classNames
(
s
.
pic
,
s
.
editForm
)
:
s
.
pic
}
src=
{
item
.
thumbUrl
}
src=
{
item
.
thumbUrl
}
...
...
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