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
d7b7482c
Commit
d7b7482c
authored
Jun 10, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update upload and number ui
parent
d1a71d13
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
13 deletions
+38
-13
Table.less
components/apolloTable/component/Table.less
+1
-1
setFormatter.tsx
...onents/apolloTable/component/base/_utils/setFormatter.tsx
+0
-1
index.tsx
components/apolloTable/component/base/edit/number/index.tsx
+6
-2
index.less
components/apolloTable/component/base/edit/upload/index.less
+8
-1
index.tsx
components/apolloTable/component/base/edit/upload/index.tsx
+21
-8
index.tsx
components/apolloTable/component/index.tsx
+2
-0
No files found.
components/apolloTable/component/Table.less
View file @
d7b7482c
...
...
@@ -9,7 +9,7 @@
height: 100%;
.loading {
position: absolute;
top:
50%
;
top:
200px
;
left: 50%;
transform: translate(-50%, -50%);
}
...
...
components/apolloTable/component/base/_utils/setFormatter.tsx
View file @
d7b7482c
...
...
@@ -83,7 +83,6 @@ export const SetFormatter = {
return
[{
value
:
val
,
text
:
val
}];
},
NUMBER
:
(
val
,
config
)
=>
{
debugger
if
(
!
isNumber
(
val
))
return
emptyModel
;
const
{
unit
=
{}
}
=
config
||
{};
// 设置单位
if
(
unit
&&
unit
.
code
===
'wan'
)
{
...
...
components/apolloTable/component/base/edit/number/index.tsx
View file @
d7b7482c
...
...
@@ -5,7 +5,7 @@ import { ApolloNumberProps } from '../editInterface';
import
{
antiAssign
}
from
'../../../../utils/utils'
;
export
const
ApolloNumber
=
(
props
:
ApolloNumberProps
)
=>
{
const
{
onChange
}:
any
=
props
;
const
{
onChange
,
origin
}:
any
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'columnConfig'
,
'onChange'
]);
const
changeValue
=
(
newValue
:
any
)
=>
{
if
(
typeof
onChange
===
'function'
)
{
...
...
@@ -13,5 +13,9 @@ export const ApolloNumber = (props: ApolloNumberProps) => {
}
};
const
{
onEmitChange
,
...
o
}
=
selfProps
;
return
<
InputNumber
className=
{
styles
.
number
}
{
...
o
}
onChange=
{
changeValue
}
/>;
const
style
:
any
=
{};
if
(
origin
===
'editForm'
)
{
style
.
height
=
'32px'
;
}
return
<
InputNumber
className=
{
styles
.
number
}
style=
{
style
}
{
...
o
}
onChange=
{
changeValue
}
/>;
};
components/apolloTable/component/base/edit/upload/index.less
View file @
d7b7482c
...
...
@@ -11,6 +11,10 @@
background: @disabledColor;
border-color: #d9d9d9;
}
&.editForm{
height: auto;
border: none;
}
.add {
cursor: pointer;
font-size: @textFontGen;
...
...
@@ -19,9 +23,12 @@
}
}
.picContainer {
margin-
lef
t: @marginSmX;
margin-
righ
t: @marginSmX;
.pic {
height: 30px;
&.editForm {
height: 100px;
}
}
}
}
...
...
components/apolloTable/component/base/edit/upload/index.tsx
View file @
d7b7482c
...
...
@@ -8,7 +8,7 @@ import Upload from '../../extra/upload';
import
addIcon
from
'../../../../assets/addIcon.png'
;
export
const
ApolloUpload
=
(
props
:
ApolloUploadProps
)
=>
{
const
{
isMultiple
,
onEmitChange
,
onChange
,
disabled
}
=
props
;
const
{
isMultiple
,
onEmitChange
,
onChange
,
disabled
,
origin
}
=
props
;
const
selfProps
=
antiAssign
(
props
,
[
'onChange'
,
'value'
]);
if
(
isMultiple
)
{
selfProps
.
multiple
=
true
;
...
...
@@ -29,6 +29,9 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
// 点击Modal中上传时回调用浏览器弹框,触发onBlur,而此时并不希望触发onBlur,因此在组件内自定义监听
useEffect
(()
=>
{
document
.
addEventListener
(
'click'
,
onBlur
,
false
);
if
(
origin
!==
'editForm'
)
{
toggleUploadDialog
(
true
);
}
return
()
=>
{
document
.
removeEventListener
(
'click'
,
onBlur
,
false
);
};
...
...
@@ -61,23 +64,33 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
e
.
stopPropagation
();
// 阻止事件冒泡
e
.
nativeEvent
.
stopImmediatePropagation
();
};
let
containerClass
=
s
.
container
;
if
(
disabled
)
{
containerClass
=
classNames
(
containerClass
,
s
.
disabled
);
}
if
(
origin
===
'editForm'
)
{
containerClass
=
classNames
(
containerClass
,
s
.
editForm
);
}
return
(
<
div
className=
{
disabled
?
classNames
(
s
.
container
,
s
.
disabled
)
:
s
.
container
}
onClick=
{
onClickContainer
}
>
{
!
disabled
&&
(
<
div
className=
{
s
.
add
}
onClick=
{
toggleUploadDialog
.
bind
(
null
,
true
)
}
>
<
img
alt=
""
className=
{
s
.
addIcon
}
src=
{
addIcon
}
/>
</
div
>
)
}
<
div
className=
{
containerClass
}
onClick=
{
onClickContainer
}
>
{
value
&&
value
.
map
((
item
,
i
)
=>
{
return
(
<
div
key=
{
i
}
className=
{
s
.
picContainer
}
>
<
Tooltip
placement=
"bottom"
title=
{
item
.
name
}
>
<
img
className=
{
s
.
pic
}
src=
{
item
.
thumbUrl
}
/>
<
img
className=
{
origin
===
'editForm'
?
classNames
(
s
.
pic
,
s
.
editForm
)
:
s
.
pic
}
src=
{
item
.
thumbUrl
}
/>
</
Tooltip
>
</
div
>
);
})
}
{
!
disabled
&&
origin
===
'editForm'
&&
(
<
div
className=
{
s
.
add
}
onClick=
{
toggleUploadDialog
.
bind
(
null
,
true
)
}
>
<
img
alt=
""
className=
{
s
.
addIcon
}
src=
{
addIcon
}
/>
</
div
>
)
}
<
Modal
visible=
{
visible
}
title=
"文件上传"
onOk=
{
onOk
}
onCancel=
{
onCancel
}
>
<
div
className=
{
s
.
uploadContainer
}
>
<
Upload
{
...
selfProps
}
value=
{
props
.
value
}
onChange=
{
changeValue
}
/>
...
...
components/apolloTable/component/index.tsx
View file @
d7b7482c
...
...
@@ -78,6 +78,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
headerHeight
,
contentMenu
,
onScroll
,
loadComp
,
}
=
this
.
props
;
const
sortConfig
=
operateConfig
&&
...
...
@@ -116,6 +117,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
rowSelection=
{
rowSelection
}
noDataPlaceholder=
{
noDataPlaceholder
}
contentMenu=
{
contentMenu
}
loadComp=
{
loadComp
}
/>
</
div
>
{
paginationConfig
&&
<
Pagination
{
...
paginationConfig
}
/>
}
...
...
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