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
1acd88f6
Commit
1acd88f6
authored
Jun 29, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revise tag
parent
d75f9bf8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
44 deletions
+104
-44
Cell.tsx
components/apolloTable/component/Cell.tsx
+0
-1
index.less
components/apolloTable/component/base/detail/tag/index.less
+1
-1
index.tsx
components/apolloTable/component/base/detail/tag/index.tsx
+103
-42
No files found.
components/apolloTable/component/Cell.tsx
View file @
1acd88f6
...
...
@@ -56,7 +56,6 @@ const Cell = (props: CellProps) => {
const
changeCellData
=
(
changedValue
:
any
,
option
?:
any
)
=>
{};
const
emitChangeCellData
=
(
changedValue
:
any
,
optionValue
:
any
)
=>
{
let
temp
:
CellDataProps
[]
=
[];
debugger
cellData
.
map
((
item
:
CellDataProps
)
=>
{
temp
.
push
({
text
:
item
.
text
,
value
:
item
.
value
});
});
...
...
components/apolloTable/component/base/detail/tag/index.less
View file @
1acd88f6
...
...
@@ -7,7 +7,7 @@
align-items: center;
.outContainer {
display: flex;
width:
100%
;
width:
calc(100% - 30px)
;
overflow: hidden;
.innerContainer {
display: flex;
...
...
components/apolloTable/component/base/detail/tag/index.tsx
View file @
1acd88f6
...
...
@@ -2,6 +2,7 @@ import React, { useState, useRef, useEffect } from 'react';
import
{
Popover
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
s
from
'./index.less'
;
import
IconFont
from
'@/submodule/components/IconFont'
;
export
const
Tags
=
(
props
:
any
)
=>
{
const
{
value
,
origin
,
componentAttr
}
=
props
;
...
...
@@ -32,36 +33,6 @@ export const Tags = (props: any) => {
}
return
(
<
div
className=
{
s
.
container
}
>
{
dotVisible
&&
mode
===
'multiple'
&&
(
<
Popover
// trigger="click"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
}
}
placement=
"left"
overlayClassName=
{
s
.
popContainer
}
content=
{
<
div
className=
{
s
.
popContent
}
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
}
}
>
{
value
.
map
((
item
,
index
)
=>
{
let
color
=
''
;
if
(
options
&&
Array
.
isArray
(
options
)
&&
options
.
length
>
0
)
{
const
obj
=
options
.
find
((
ls
)
=>
ls
.
id
===
item
.
value
)
||
{};
color
=
obj
.
color
||
'e9eef9'
;
}
return
(
<
span
className=
{
s
.
popItem
}
key=
{
index
}
style=
{
{
background
:
`#${color}`
}
}
>
<
div
className=
{
s
.
popItemBgTxt
}
>
{
item
.
text
}
</
div
>
</
span
>
);
})
}
</
div
>
}
>
<
div
className=
{
s
.
outContainer
}
ref=
{
outer
}
style=
{
outStyle
}
>
<
div
className=
{
s
.
innerContainer
}
ref=
{
inner
}
style=
{
innerStyle
}
>
{
value
.
map
((
item
,
index
)
=>
{
...
...
@@ -73,7 +44,7 @@ export const Tags = (props: any) => {
return
(
<
span
key=
{
index
}
className=
{
classNames
(
s
.
item
,
mode
===
'multiple'
&&
s
.
multi
)
}
className=
{
mode
===
'multiple'
?
classNames
(
s
.
item
,
s
.
multi
)
:
s
.
item
}
style=
{
{
...
itemStyle
,
background
:
`#${color}`
}
}
>
<
div
className=
{
s
.
itemBgTxt
}
>
{
item
.
text
}
</
div
>
...
...
@@ -82,11 +53,21 @@ export const Tags = (props: any) => {
})
}
</
div
>
</
div
>
</
Popover
>
)
}
{
!
dotVisible
&&
(
<
div
className=
{
s
.
outContainer
}
ref=
{
outer
}
style=
{
outStyle
}
>
<
div
className=
{
s
.
innerContainer
}
ref=
{
inner
}
style=
{
innerStyle
}
>
{
dotVisible
&&
mode
===
'multiple'
&&
(
<
Popover
trigger=
"click"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
}
}
placement=
"left"
overlayClassName=
{
s
.
popContainer
}
content=
{
<
div
className=
{
s
.
popContent
}
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
}
}
>
{
value
.
map
((
item
,
index
)
=>
{
let
color
=
''
;
if
(
options
&&
Array
.
isArray
(
options
)
&&
options
.
length
>
0
)
{
...
...
@@ -94,19 +75,99 @@ export const Tags = (props: any) => {
color
=
obj
.
color
||
'e9eef9'
;
}
return
(
<
span
key=
{
index
}
className=
{
classNames
(
s
.
item
,
mode
===
'multiple'
&&
s
.
multi
)
}
style=
{
{
...
itemStyle
,
background
:
`#${color}`
}
}
>
<
div
className=
{
s
.
itemBgTxt
}
>
{
item
.
text
}
</
div
>
<
span
className=
{
s
.
popItem
}
key=
{
index
}
style=
{
{
background
:
`#${color}`
}
}
>
<
div
className=
{
s
.
popItemBgTxt
}
>
{
item
.
text
}
</
div
>
</
span
>
);
})
}
</
div
>
}
>
<
div
className=
{
s
.
moreBtn
}
>
<
IconFont
type=
"iconzhankai1"
/>
</
div
>
</
Popover
>
)
}
</
div
>
// <div className={s.container}>
// {dotVisible && mode === 'multiple' && (
// <Popover
// // trigger="click"
// onClick={(e) => {
// debugger
// e.stopPropagation();
// }}
// placement="left"
// overlayClassName={s.popContainer}
// content={
// <div
// className={s.popContent}
// onClick={(e) => {
// debugger
// e.stopPropagation();
// }}
// >
// {value.map((item, index) => {
// let color = '';
// if (options && Array.isArray(options) && options.length > 0) {
// const obj = options.find((ls) => ls.id === item.value) || {};
// color = obj.color || 'e9eef9';
// }
// return (
// <span className={s.popItem} key={index} style={{ background: `#${color}` }}>
// <div className={s.popItemBgTxt}>{item.text}</div>
// </span>
// );
// })}
// </div>
// }
// >
// <div className={s.outContainer} ref={outer} style={outStyle}>
// <div className={s.innerContainer} ref={inner} style={innerStyle}>
// {value.map((item, index) => {
// let color = '';
// if (options && Array.isArray(options) && options.length > 0) {
// const obj = options.find((ls) => ls.id === item.value) || {};
// color = obj.color || 'e9eef9';
// }
// return (
// <span
// key={index}
// className={classNames(s.item, mode === 'multiple' && s.multi)}
// style={{ ...itemStyle, background: `#${color}` }}
// >
// <div className={s.itemBgTxt}>{item.text}</div>
// </span>
// );
// })}
// </div>
// </div>
// </Popover>
// )}
// {!dotVisible && (
// <div className={s.outContainer} ref={outer} style={outStyle}>
// <div className={s.innerContainer} ref={inner} style={innerStyle}>
// {value.map((item, index) => {
// let color = '';
// if (options && Array.isArray(options) && options.length > 0) {
// const obj = options.find((ls) => ls.id === item.value) || {};
// color = obj.color || 'e9eef9';
// }
// return (
// <span
// key={index}
// className={classNames(s.item, mode === 'multiple' && s.multi)}
// style={{ ...itemStyle, background: `#${color}` }}
// >
// <div className={s.itemBgTxt}>{item.text}</div>
// </span>
// );
// })}
// </div>
// </div>
// )}
// </div>
);
};
export
default
Tags
;
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