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
cddb0f88
Commit
cddb0f88
authored
Apr 08, 2025
by
fanyj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tijiao
parent
96b3b9d3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
166 additions
and
2 deletions
+166
-2
craco.config.js
craco.config.js
+4
-0
App.js
src/App.js
+18
-1
assetsActionManageService.ts
src/services/assetsActionManageService.ts
+9
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+55
-1
AssetColumnDetail.tsx
src/view/Manage/AssetManage/Component/AssetColumnDetail.tsx
+80
-0
No files found.
craco.config.js
View file @
cddb0f88
...
@@ -63,6 +63,10 @@ module.exports = {
...
@@ -63,6 +63,10 @@ module.exports = {
target
:
proxyurl
,
target
:
proxyurl
,
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
'/data-quality'
:
{
target
:
proxyurl
,
changeOrigin
:
true
,
},
},
},
// historyApiFallback: true,
// historyApiFallback: true,
// hot: false,
// hot: false,
...
...
src/App.js
View file @
cddb0f88
...
@@ -24,6 +24,7 @@ import DataServiceDetail from './view/Manage/Pdata/Component/ServiceDetail';
...
@@ -24,6 +24,7 @@ import DataServiceDetail from './view/Manage/Pdata/Component/ServiceDetail';
import
GrantedDataServiceList
from
'./view/Manage/Pdata/Component/GrantedList'
;
import
GrantedDataServiceList
from
'./view/Manage/Pdata/Component/GrantedList'
;
import
AssetTask
from
'./view/Manage/AssetTask'
;
import
AssetTask
from
'./view/Manage/AssetTask'
;
import
AssetEvaluate
from
'./view/Manage/AssetEvaluate'
;
import
AssetEvaluate
from
'./view/Manage/AssetEvaluate'
;
import
AssetColumnDetail
from
'./view/Manage/AssetManage/Component/AssetColumnDetail'
;
import
{
AssetBrowseReference
,
AssetDraftReference
,
AssetMountReference
}
from
'./util/constant'
;
import
{
AssetBrowseReference
,
AssetDraftReference
,
AssetMountReference
}
from
'./util/constant'
;
...
@@ -66,13 +67,16 @@ export class App extends React.Component {
...
@@ -66,13 +67,16 @@ export class App extends React.Component {
const
{
setGlobalState
,
onGlobalStateChange
}
=
this
.
props
;
const
{
setGlobalState
,
onGlobalStateChange
}
=
this
.
props
;
const
{
hostParams
}
=
this
.
state
;
const
{
hostParams
}
=
this
.
state
;
let
message
=
''
,
id
=
''
,
terms
=
[];
let
message
=
''
,
id
=
''
,
terms
=
[]
,
type
=
''
;
if
(
hostParams
)
{
if
(
hostParams
)
{
message
=
hostParams
.
message
||
''
;
message
=
hostParams
.
message
||
''
;
id
=
hostParams
.
id
||
''
;
id
=
hostParams
.
id
||
''
;
type
=
hostParams
.
type
||
''
;
terms
=
hostParams
.
terms
||
[];
terms
=
hostParams
.
terms
||
[];
}
}
console
.
log
(
hostParams
)
if
(
message
===
'showDataModelDetail'
)
{
if
(
message
===
'showDataModelDetail'
)
{
return
(
return
(
<
AppContext
.
Provider
value
=
{{
<
AppContext
.
Provider
value
=
{{
...
@@ -101,6 +105,19 @@ export class App extends React.Component {
...
@@ -101,6 +105,19 @@ export class App extends React.Component {
);
);
}
}
if
(
message
===
'showAssetColumnDetail'
){
return
(
<
AppContext
.
Provider
value
=
{{
env
:
hostParams
?.
env
,
user
:
hostParams
?.
user
,
setGlobalState
,
onGlobalStateChange
}}
>
<
AssetColumnDetail
id
=
{
id
}
type
=
{
type
}
/
>
<
/AppContext.Provider
>
);
}
if
(
message
===
'showAssetTree'
)
{
if
(
message
===
'showAssetTree'
)
{
return
(
return
(
<
AppContext
.
Provider
value
=
{{
<
AppContext
.
Provider
value
=
{{
...
...
src/services/assetsActionManageService.ts
View file @
cddb0f88
...
@@ -47,6 +47,15 @@ class AssetsActionManageService{
...
@@ -47,6 +47,15 @@ class AssetsActionManageService{
})
})
}
}
async
getAssetColumnDetail
(
payload
:
any
,
autotip
=
false
){
let
result
=
await
request
({
url
:
`
${
asset
}
/dataAssetColumnApi/getDataAssetColumnDetail`
,
method
:
"post"
,
data
:
qs
.
stringify
(
payload
)
},
autotip
).
then
(
data
=>
{
return
data
;
}).
catch
(
error
=>
{
return
error
})
return
result
;
}
}
}
export
default
new
AssetsActionManageService
()
export
default
new
AssetsActionManageService
()
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
cddb0f88
...
@@ -28,6 +28,7 @@ import './AssetAction.less';
...
@@ -28,6 +28,7 @@ import './AssetAction.less';
import
MatchMetaInfo
from
'./MatchMetaInfo'
;
import
MatchMetaInfo
from
'./MatchMetaInfo'
;
import
{
useGetModalInfoAndAction
}
from
'@/hooks/common'
;
import
{
useGetModalInfoAndAction
}
from
'@/hooks/common'
;
import
AssetsCompareModal
from
'./AssetsCompareModal'
;
import
AssetsCompareModal
from
'./AssetsCompareModal'
;
import
TagCell
,
{
TagSelectPopup
}
from
'./tag-help'
const
AssetAction
=
React
.
forwardRef
(
function
(
props
,
ref
)
{
const
AssetAction
=
React
.
forwardRef
(
function
(
props
,
ref
)
{
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
reference
,
readonly
=
false
,
permissionId
,
catalog
,
template
}
=
props
;
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
reference
,
readonly
=
false
,
permissionId
,
catalog
,
template
}
=
props
;
...
@@ -69,6 +70,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -69,6 +70,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
const
[
isStructured
,
setStructured
]
=
useState
();
const
[
isStructured
,
setStructured
]
=
useState
();
const
[
businessElements
,
setBusinessElements
]
=
useState
();
const
[
businessElements
,
setBusinessElements
]
=
useState
();
const
[
businessColumns
,
setBusinessColumns
]
=
useState
();
const
[
businessColumns
,
setBusinessColumns
]
=
useState
();
const
[
resoureTagMap
,
setResourceTagMap
]
=
useState
()
console
.
log
(
'refence'
,
reference
)
console
.
log
(
'refence'
,
reference
)
...
@@ -92,6 +94,9 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -92,6 +94,9 @@ const AssetAction = React.forwardRef(function (props, ref) {
console
.
log
(
assets
)
console
.
log
(
assets
)
if
(
assets
?.
metadataId
)
if
(
assets
?.
metadataId
)
setSelectData
({
metadataId
:
assets
.
metadataId
,
metadataPath
:
assets
.
metadataPath
})
setSelectData
({
metadataId
:
assets
.
metadataId
,
metadataPath
:
assets
.
metadataPath
})
if
(
assets
.
length
){
getResourceTag
()
}
},[
assets
])
},[
assets
])
React
.
useImperativeHandle
(
ref
,
()
=>
({
React
.
useImperativeHandle
(
ref
,
()
=>
({
...
@@ -160,6 +165,54 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -160,6 +165,54 @@ const AssetAction = React.forwardRef(function (props, ref) {
},
},
];
];
const
tagCol
=
{
title
:
'标签'
,
dataIndex
:
'tag'
,
width
:
360
,
className
:
'table-tag-cell'
,
render
:
(
_
,
record
)
=>
{
console
.
log
(
record
)
return
(
<
div
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
<
TagCell
id=
{
record
.
id
}
did=
{
record
.
dirId
}
type=
{
record
?.
columnType
}
tags=
{
resoureTagMap
?.[
record
.
id
]
}
onChange=
{
(
val
)
=>
{
setResourceTagMap
((
prevResourceTagMap
)
=>
{
return
produce
(
prevResourceTagMap
||
{},
(
draft
)
=>
{
draft
[
record
.
id
]
=
val
})
})
}
}
/>
</
div
>
)
}
}
const
getResourceTag
=
()
=>
{
const
ids
=
(
assets
??[]).
map
(
item
=>
item
.
_id
)
if
(
ids
.
length
>
0
)
{
dispatch
({
type
:
'tag.getResourceTagIn'
,
payload
:
{
params
:
{
resourceIds
:
ids
,
includeAll
:
true
,
includePrivate
:
true
}
},
callback
:
data
=>
{
setResourceTagMap
(
data
?.
data
)
}
});
}
else
{
setResourceTagMap
()
}
}
const
businessActionCol
=
{
const
businessActionCol
=
{
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
...
@@ -242,6 +295,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -242,6 +295,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
{
item
.
name
}
{
item
.
name
}
</
span
>,
</
span
>,
dataIndex
:
item
.
enName
,
dataIndex
:
item
.
enName
,
width
:
160
,
ellipsis
:
true
,
ellipsis
:
true
,
render
:
(
text
,
record
,
index
)
=>
{
render
:
(
text
,
record
,
index
)
=>
{
let
value
=
''
let
value
=
''
...
@@ -311,7 +365,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
...
@@ -311,7 +365,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
newCols
.
push
(
businessActionCol
)
newCols
.
push
(
businessActionCol
)
}
}
return
newCols
return
[...
newCols
,
tagCol
]
},
[
currentAction
,
isStructured
,
columns
,
businessColumns
,
businessActionCol
])
},
[
currentAction
,
isStructured
,
columns
,
businessColumns
,
businessActionCol
])
const
[
tableData
,
total
]
=
useMemo
(()
=>
{
const
[
tableData
,
total
]
=
useMemo
(()
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetColumnDetail.tsx
0 → 100644
View file @
cddb0f88
import
{
assetsActionManageService
}
from
"@/services"
import
{
httpUtil
}
from
"@/utils"
import
{
useSetState
}
from
"ahooks"
import
React
,
{
useEffect
}
from
"react"
import
{
Descriptions
,
Spin
}
from
"antd"
const
AssetColumnDetail
:
React
.
FC
<
any
>=
(
props
)
=>
{
const
{
id
,
type
}
=
props
const
[
state
,
setState
]
=
useSetState
({
loading
:
true
,
attrs
:[]
})
const
[
open
,
setOpen
]
=
useSetState
({
openshowmore
:
true
,
showmore
:
true
})
useEffect
(()
=>
{
if
(
id
&&
type
){
getDetialInfo
()
}
},[
id
,
type
])
const
getDetialInfo
=
async
()
=>
{
setState
({
loading
:
true
})
const
result
:
any
=
await
assetsActionManageService
.
getAssetColumnDetail
({
columnId
:
id
,
columnType
:
type
})
if
(
httpUtil
.
checkSuccess
(
result
,
1
)){
setState
({
loading
:
false
,
attrs
:
result
.
data
?.
columnValueList
||
[]})
}
else
{
httpUtil
.
showError
(
result
,
1
)
setState
({
loading
:
false
,
attrs
:[]})
}
}
return
(
<
div
>
<
h2
>
资产字段信息
</
h2
>
<
Spin
spinning=
{
state
.
loading
}
>
<
Descriptions
column=
{
2
}
size=
"small"
bordered=
{
false
}
>
{
state
.
attrs
.
map
((
item
:
any
,
key
:
number
)
=>
{
if
(
key
<
6
){
return
(
<
Descriptions
.
Item
span=
{
1
}
key=
{
key
}
label=
{
item
?.
cnName
}
>
{
item
?.
value
}
</
Descriptions
.
Item
>
)
}
else
{
if
(
open
.
openshowmore
){
if
(
open
.
showmore
){
return
(
<
Descriptions
.
Item
span=
{
1
}
key=
{
key
}
label=
{
item
?.
cnName
}
>
{
item
?.
value
}
</
Descriptions
.
Item
>
)
}
else
{
return
null
}
}
else
{
return
(
<
Descriptions
.
Item
span=
{
1
}
key=
{
key
}
label=
{
item
.
cnName
}
>
{
item
?.
value
}
</
Descriptions
.
Item
>
)
}
}
})
}
</
Descriptions
>
</
Spin
>
</
div
>
)
}
export
default
AssetColumnDetail
\ 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