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
395c6459
Commit
395c6459
authored
Jun 17, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update edit select,search,assoSearch ui
parent
ed000638
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
index.less
components/apolloTable/component/base/edit/search/index.less
+5
-0
styles.less
...onents/apolloTable/component/base/edit/select/styles.less
+3
-0
index.tsx
...lloTable/component/base/extra/associationSearch/index.tsx
+14
-7
No files found.
components/apolloTable/component/base/edit/search/index.less
View file @
395c6459
...
...
@@ -5,5 +5,10 @@
width: 100%;
min-height: 100%;
border-radius: 0;
display: flex;
align-items: center;
}
:global(.ant-select-selection__rendered){
width: 100%;
}
}
components/apolloTable/component/base/edit/select/styles.less
View file @
395c6459
...
...
@@ -12,4 +12,7 @@
display: flex;
align-items: center;
}
:global(.ant-select-selection__rendered){
width: 100%;
}
}
components/apolloTable/component/base/extra/associationSearch/index.tsx
View file @
395c6459
...
...
@@ -2,7 +2,6 @@ import React from 'react';
import
{
Spin
,
Select
}
from
'antd'
;
import
lodash
from
'lodash'
;
import
{
Consumer
}
from
'../../../context'
;
import
s
from
'./index.less'
;
interface
Props
{
initDataType
?:
undefined
|
'onfocus'
;
// 初始化请求方式
...
...
@@ -20,6 +19,12 @@ interface Props {
};
}
enum
Loaded
{
Init
=
'init'
,
Has
=
'has'
,
Empty
=
'empty'
,
}
interface
State
{
value
:
any
;
data
:
any
[];
...
...
@@ -28,6 +33,7 @@ interface State {
initData
:
any
[];
searchStr
:
string
;
canFocus
:
boolean
;
loaded
:
Loaded
;
}
class
AssociationSearch
extends
React
.
Component
<
Props
,
State
>
{
...
...
@@ -42,6 +48,7 @@ class AssociationSearch extends React.Component<Props, State> {
initData
:
[],
searchStr
:
''
,
canFocus
:
true
,
loaded
:
Loaded
.
Init
,
};
}
...
...
@@ -89,7 +96,7 @@ class AssociationSearch extends React.Component<Props, State> {
}
else
{
data
=
Array
.
isArray
(
dataSource
)
?
dataSource
:
[];
}
this
.
setState
({
data
,
fetching
:
false
});
this
.
setState
({
data
,
loaded
:
data
.
length
>
0
?
Loaded
.
Has
:
Loaded
.
Empty
,
fetching
:
false
});
};
onSearch
=
(
val
:
string
)
=>
{
...
...
@@ -207,23 +214,23 @@ class AssociationSearch extends React.Component<Props, State> {
}
};
notFoundContent
=
(
locale
)
=>
{
const
{
data
,
fetching
,
value
}
=
this
.
state
;
notFoundContent
=
(
locale
:
any
)
=>
{
const
{
fetching
,
loaded
}
=
this
.
state
;
if
(
fetching
)
{
return
<
Spin
size=
"small"
/>;
}
if
(
!
data
||
data
.
length
===
0
)
{
if
(
loaded
===
Loaded
.
Empty
)
{
return
<
span
style=
{
{
fontSize
:
'12px'
}
}
>
{
locale
.
notFoundContent
}
</
span
>;
}
return
null
;
};
render
()
{
const
{
data
,
fetching
,
value
}
=
this
.
state
;
const
{
data
,
value
}
=
this
.
state
;
const
{
selfCom
,
autoFocus
,
onChange
,
...
rest
}
=
this
.
props
;
return
(
<
Consumer
>
{
({
locale
})
=>
{
{
({
locale
}
:
any
)
=>
{
return
(
<
Select
filterOption=
{
false
}
...
...
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