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
728c2b95
Commit
728c2b95
authored
Jun 04, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update apolloTable detail tag ui
parent
5e44ff54
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
transferAttr.tsx
...onents/apolloTable/component/base/_utils/transferAttr.tsx
+5
-0
config.tsx
components/apolloTable/component/base/config.tsx
+1
-2
index.less
components/apolloTable/component/base/detail/tag/index.less
+8
-6
index.tsx
components/apolloTable/component/base/detail/tag/index.tsx
+7
-2
No files found.
components/apolloTable/component/base/_utils/transferAttr.tsx
View file @
728c2b95
...
@@ -27,6 +27,11 @@ export const transferAttr = (columnType, columnAttrObj) => {
...
@@ -27,6 +27,11 @@ export const transferAttr = (columnType, columnAttrObj) => {
columnAttrObj
.
format
=
columnAttrObj
.
format
.
replace
(
/y/g
,
'Y'
).
replace
(
/d/g
,
'D'
);
columnAttrObj
.
format
=
columnAttrObj
.
format
.
replace
(
/y/g
,
'Y'
).
replace
(
/d/g
,
'D'
);
columnAttrObj
.
showTime
=
/H|m|s/
.
test
(
columnAttrObj
.
format
);
columnAttrObj
.
showTime
=
/H|m|s/
.
test
(
columnAttrObj
.
format
);
break
;
break
;
case
'13'
:
if
(
columnAttrObj
.
isMultiple
)
{
columnAttrObj
.
mode
=
'multiple'
;
}
break
;
default
:
default
:
break
;
break
;
}
}
...
...
components/apolloTable/component/base/config.tsx
View file @
728c2b95
...
@@ -112,8 +112,7 @@ export const config: any = {
...
@@ -112,8 +112,7 @@ export const config: any = {
cellComp
:
CellContainer
(
ApolloMultipleSelect
),
cellComp
:
CellContainer
(
ApolloMultipleSelect
),
componentAttr
:
{
componentAttr
:
{
labelInValue
:
true
,
labelInValue
:
true
,
mode
:
'tags'
,
mode
:
'multiple'
,
maxTagCount
:
3
,
},
},
getFormatter
:
GetFormatter
.
MULTIPLE_SELECT
,
getFormatter
:
GetFormatter
.
MULTIPLE_SELECT
,
setFormatter
:
SetFormatter
.
MULTIPLE_SELECT
,
setFormatter
:
SetFormatter
.
MULTIPLE_SELECT
,
...
...
components/apolloTable/component/base/detail/tag/index.less
View file @
728c2b95
...
@@ -14,17 +14,19 @@
...
@@ -14,17 +14,19 @@
.item {
.item {
margin-right: 10px;
margin-right: 10px;
background: #e9eef9;
background: #e9eef9;
border-radius: @borderRadius;
border-radius: 12px;
&.multi {
border-radius: @borderRadius;
}
.itemBgTxt {
.itemBgTxt {
height: 24px;
height: 24px;
padding: 5px 10px;
padding: 5px 10px;
line-height: 1;
line-height: 1;
font-size: 14px;
font-size: 14px;
color: #2e67c5;
color: @textGeneralColor;
}
&:last-child {
&:last-child {
margin-right: 0;
margin-right: 0;
}
}
}
}
}
}
}
...
...
components/apolloTable/component/base/detail/tag/index.tsx
View file @
728c2b95
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
{
Popover
}
from
'antd'
;
import
{
Popover
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
s
from
'./index.less'
;
import
s
from
'./index.less'
;
import
extendIcon
from
'../../../../assets/extend.png'
;
import
extendIcon
from
'../../../../assets/extend.png'
;
export
const
Tags
=
(
props
:
any
)
=>
{
export
const
Tags
=
(
props
:
any
)
=>
{
const
{
value
,
origin
,
componentAttr
}
=
props
;
const
{
value
,
origin
,
componentAttr
}
=
props
;
if
(
!
Array
.
isArray
(
value
)
||
value
.
length
===
0
)
return
null
;
if
(
!
Array
.
isArray
(
value
)
||
value
.
length
===
0
)
return
null
;
const
{
options
}
=
componentAttr
||
{};
const
{
options
,
mode
}
=
componentAttr
||
{};
const
[
dotVisible
,
setDotVisible
]
=
useState
(
false
);
const
[
dotVisible
,
setDotVisible
]
=
useState
(
false
);
const
outer
=
useRef
(
null
);
const
outer
=
useRef
(
null
);
const
inner
=
useRef
(
null
);
const
inner
=
useRef
(
null
);
...
@@ -41,7 +42,11 @@ export const Tags = (props: any) => {
...
@@ -41,7 +42,11 @@ export const Tags = (props: any) => {
color
=
obj
.
color
||
'e9eef9'
;
color
=
obj
.
color
||
'e9eef9'
;
}
}
return
(
return
(
<
span
key=
{
index
}
className=
{
s
.
item
}
style=
{
{
...
itemStyle
,
background
:
`#${color}`
}
}
>
<
span
key=
{
index
}
className=
{
mode
===
'multiple'
?
classNames
(
s
.
item
,
s
.
multi
)
:
s
.
item
}
style=
{
{
...
itemStyle
,
background
:
`#${color}`
}
}
>
<
div
className=
{
s
.
itemBgTxt
}
>
{
item
.
text
}
</
div
>
<
div
className=
{
s
.
itemBgTxt
}
>
{
item
.
text
}
</
div
>
</
span
>
</
span
>
);
);
...
...
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