Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
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
zhaochengxiang
szse
Commits
502b57cd
Commit
502b57cd
authored
Apr 17, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型详情标签
parent
da25e539
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
155 additions
and
5 deletions
+155
-5
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+2
-5
tag-item.jsx
src/view/Manage/Model/Component/tag-item.jsx
+153
-0
No files found.
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
502b57cd
...
@@ -8,8 +8,7 @@ import { highlightSearchContentByTerms, generateUUID, IsArr } from '../../../../
...
@@ -8,8 +8,7 @@ import { highlightSearchContentByTerms, generateUUID, IsArr } from '../../../../
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
import
Rule
from
'../../ModelConfig/Component/rule-readonly'
;
import
Rule
from
'../../ModelConfig/Component/rule-readonly'
;
import
DebounceInput
from
'./DebounceInput'
;
import
DebounceInput
from
'./DebounceInput'
;
import
DataQuality
,
{
DataQualityFeignTagList
}
from
'../../../QianKun/data-quality'
import
TagItem
from
'./tag-item'
import
TagCell
from
'./tag-help'
import
'./ImportActionHeader.less'
;
import
'./ImportActionHeader.less'
;
import
{
importActionSubject
}
from
'./ImportAction'
;
import
{
importActionSubject
}
from
'./ImportAction'
;
...
@@ -432,8 +431,7 @@ const ImportActionHeader = (props) => {
...
@@ -432,8 +431,7 @@ const ImportActionHeader = (props) => {
label=
"标签"
label=
"标签"
style=
{
{
marginBottom
}
}
style=
{
{
marginBottom
}
}
>
>
<
div
style=
{
{
width
:
360
}
}
>
<
TagItem
<
TagCell
id=
{
modelerData
?.
id
}
id=
{
modelerData
?.
id
}
type=
'model'
type=
'model'
tags=
{
resoureTagMap
?.[
modelerData
?.
id
]
}
tags=
{
resoureTagMap
?.[
modelerData
?.
id
]
}
...
@@ -445,7 +443,6 @@ const ImportActionHeader = (props) => {
...
@@ -445,7 +443,6 @@ const ImportActionHeader = (props) => {
})
})
}
}
}
}
/>
/>
</
div
>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
}
}
...
...
src/view/Manage/Model/Component/tag-item.jsx
0 → 100644
View file @
502b57cd
import
React
,
{
useEffect
}
from
'react'
import
{
Tooltip
,
Tag
,
Typography
,
Space
,
Button
,
Modal
,
Spin
,
Select
,
}
from
'antd'
import
{
EllipsisOutlined
,
PlusOutlined
,
}
from
'@ant-design/icons'
import
produce
from
'immer'
import
{
showMessage
}
from
'../../../../util'
import
{
dispatch
}
from
'../../../../model'
import
{
AppContext
}
from
'../../../../App'
import
{
TagRender
,
TagSelectPopup
}
from
'./tag-help'
const
FC
=
({
type
,
id
,
did
,
tags
,
onChange
})
=>
{
const
[
data
,
setData
]
=
React
.
useState
([])
const
[
tagSelectPopupParams
,
setTagSelectPopupParams
]
=
React
.
useState
({
visible
:
false
,
type
:
undefined
,
items
:
undefined
,
})
useEffect
(()
=>
{
setData
(
tags
)
},
[
tags
])
const
storageChange
=
(
e
)
=>
{
if
(
e
.
key
===
'tagChangeEvent'
&&
e
.
id
===
id
)
{
getTags
()
}
}
React
.
useEffect
(()
=>
{
window
?.
addEventListener
(
"storage"
,
storageChange
)
return
()
=>
{
window
?.
removeEventListener
(
"storage"
,
storageChange
)
}
},
[
type
,
id
])
const
getTags
=
()
=>
{
dispatch
({
type
:
'tag.getResourceTagIn'
,
payload
:
{
params
:
{
resourceIds
:
id
,
includeAll
:
true
,
includePrivate
:
true
}
},
callback
:
data
=>
{
setData
(
data
?.
data
?.[
`
${
id
}
`
]);
onChange
?.(
data
?.
data
?.[
`
${
id
}
`
]);
}
});
}
return
(
<
React
.
Fragment
>
<
TagCell
value=
{
data
}
onChange=
{
(
val
)
=>
{
getTags
()
}
}
onAdd=
{
(
val
)
=>
{
setTagSelectPopupParams
({
visible
:
true
,
type
,
items
:
[{
resourceId
:
id
,
catalogId
:
did
,
type
,
}]
})
}
}
/>
<
TagSelectPopup
onCancel=
{
()
=>
{
setTagSelectPopupParams
({
visible
:
false
,
type
:
undefined
,
items
:
undefined
})
}
}
onChange=
{
(
val
)
=>
{
getTags
()
}
}
{
...
tagSelectPopupParams
}
/>
</
React
.
Fragment
>
)
}
export
default
FC
function
TagCell
({
value
,
readonly
=
false
,
onChange
,
onAdd
})
{
const
maxShowCount
=
3
const
[
haveMore
,
_value
]
=
React
.
useMemo
(()
=>
{
return
[(
value
??[]).
length
>
maxShowCount
,
(
value
??[]).
slice
(
0
,
maxShowCount
)]
},
[
value
])
const
onClose
=
(
e
,
tag
)
=>
{
e
.
preventDefault
()
if
(
tag
?.
id
)
{
dispatch
({
type
:
'tag.deleteTags'
,
payload
:
{
tagInResourceIds
:
tag
?.
id
},
callback
:
()
=>
{
showMessage
(
'success'
,
'删除成功'
);
onChange
?.()
}
})
}
}
return
(
<
Space
size=
{
4
}
>
{
_value
?.
map
((
item
,
index
)
=>
<
TagRender
key=
{
item
.
id
}
data=
{
item
}
closable=
{
!
readonly
&&
item
?.
deleteAble
}
onClose=
{
(
e
)
=>
{
onClose
(
e
,
item
)
}
}
style=
{
{
marginRight
:
0
}
}
/>)
}
{
haveMore
&&
<
Tooltip
title=
{
<
Space
wrap=
{
true
}
>
{
value
?.
map
((
item
,
index
)
=>
<
TagRender
key=
{
item
.
id
}
data=
{
item
}
closable=
{
!
readonly
&&
item
?.
deleteAble
}
onClose=
{
(
e
)
=>
{
onClose
(
e
,
item
)
}
}
/>)
}
</
Space
>
}
>
<
Button
size=
'small'
icon=
{
<
EllipsisOutlined
/>
}
></
Button
>
</
Tooltip
>
}
{
!
readonly
&&
<
Button
size=
'small'
icon=
{
<
PlusOutlined
/>
}
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
()
onAdd
?.()
}
}
></
Button
>
}
</
Space
>
)
}
\ No newline at end of file
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