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
8e4946ef
Commit
8e4946ef
authored
Jan 16, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
岗位新增关联关系
parent
8d657bef
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
157 additions
and
121 deletions
+157
-121
assetmanage.js
src/model/assetmanage.js
+2
-2
dataassetmanager.js
src/service/dataassetmanager.js
+2
-2
axios.js
src/util/axios.js
+9
-9
index.js
src/util/index.js
+2
-2
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+1
-1
AssetDetailDrawer.jsx
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
+2
-2
select-asset.jsx
src/view/Manage/AssetManage/Component/select-asset.jsx
+132
-89
select-data-service.jsx
...view/Manage/AssetManage/Component/select-data-service.jsx
+7
-14
No files found.
src/model/assetmanage.js
View file @
8e4946ef
...
...
@@ -107,8 +107,8 @@ export function* deletePersonalCustomDirectory(payload) {
export
function
*
existDataAsset
(
payload
)
{
return
yield
call
(
service
.
existDataAsset
,
payload
);
}
export
function
*
queryAllDirectoryAsTree
()
{
return
yield
call
(
service
.
queryAllDirectoryAsTree
);
export
function
*
queryAllDirectoryAsTree
(
payload
)
{
return
yield
call
(
service
.
queryAllDirectoryAsTree
,
payload
);
}
export
function
*
queryDirectoryTreeByMetadataId
(
payload
)
{
return
yield
call
(
service
.
queryDirectoryTreeByMetadataId
,
payload
);
...
...
src/service/dataassetmanager.js
View file @
8e4946ef
...
...
@@ -136,8 +136,8 @@ export function existDataAsset(payload) {
return
GetJSON
(
"/dataassetmanager/directoryApi/existDataAsset"
,
payload
);
}
export
function
queryAllDirectoryAsTree
()
{
return
GetJSON
(
"/dataassetmanager/directoryApi/queryAllDirectoryAsTree"
);
export
function
queryAllDirectoryAsTree
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/directoryApi/queryAllDirectoryAsTree"
,
payload
);
}
export
function
queryDirectoryTreeByMetadataId
(
payload
)
{
...
...
src/util/axios.js
View file @
8e4946ef
...
...
@@ -124,7 +124,7 @@ export function Get(url, params) {
const
templateType
=
getTemplateType
();
return
textplain
.
get
(
url
,
{
params
:
{
...
params
,
templateType
},
cancelToken
params
:
{
templateType
,
...
params
},
cancelToken
}).
then
(
callback
)
...
...
@@ -135,7 +135,7 @@ export function GetJSON(url, params) {
const
templateType
=
getTemplateType
();
return
instance
.
get
(
url
,
{
params
:
{
...
params
,
templateType
},
cancelToken
,
params
:
{
templateType
,
...
params
},
cancelToken
,
validateStatus
:
false
}).
then
(
callback
...
...
@@ -147,7 +147,7 @@ export const GetJSONRaw = (url, params) => {
const
templateType
=
getTemplateType
();
return
instanceRow
.
get
(
url
,
{
params
:
{
...
params
,
templateType
},
cancelToken
,
params
:
{
templateType
,
...
params
},
cancelToken
,
validateStatus
:
false
}).
then
(
callback
...
...
@@ -159,7 +159,7 @@ export function Delete(url, params) {
const
templateType
=
getTemplateType
();
return
instance
.
delete
(
url
,
{
params
:
{
...
params
,
templateType
},
cancelToken
,
params
:
{
templateType
,
...
params
},
cancelToken
,
}).
then
(
callback
)
...
...
@@ -171,11 +171,11 @@ export function PostJSON(url, payload) {
const
templateType
=
getTemplateType
();
return
IsArr
(
data
)
?
instance
.
post
(
url
,
data
,
{
params
:
{
...
params
,
templateType
},
cancelToken
params
:
{
templateType
,
...
params
},
cancelToken
}).
then
(
callback
)
:
instance
.
post
(
url
,
null
,
{
params
:
{
...
params
,
templateType
},
data
,
cancelToken
params
:
{
templateType
,
...
params
},
data
,
cancelToken
}).
then
(
callback
)
...
...
@@ -187,7 +187,7 @@ export function Post(url, payload) {
const
templateType
=
getTemplateType
();
return
textplain
.
post
(
url
,
null
,
{
params
:
{
...
params
,
templateType
},
data
,
cancelToken
params
:
{
templateType
,
...
params
},
data
,
cancelToken
}).
then
(
callback
)
...
...
@@ -202,7 +202,7 @@ export function PostFile(url, payload) {
formData
.
append
(
'file'
,
file
);
});
return
fileplain
.
post
(
url
,
formData
,
{
params
:
{
...
params
,
templateType
}
}
).
then
(
return
fileplain
.
post
(
url
,
formData
,
{
params
:
{
templateType
,
...
params
}
}
).
then
(
callback
)
}
...
...
@@ -221,7 +221,7 @@ export const callFetchRaw = (method, url, options) => {
return
axios
.
request
({
method
,
url
,
params
:
{
...
params
,
templateType
},
params
:
{
templateType
,
...
params
},
...
config
,
...
reqConfig
})
...
...
src/util/index.js
View file @
8e4946ef
...
...
@@ -401,6 +401,5 @@ export function getDataModelerRole(user) {
}
export
function
isPostAsset
(
templateType
)
{
//zcx todo
return
false
return
templateType
===
'post'
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
8e4946ef
...
...
@@ -1335,7 +1335,7 @@ const AssetAction = (props) => {
</Spin>
{
isPostAsset(assets?.templateType) ? <
PostRelation /
> : <React.Fragment>
isPostAsset(assets?.templateType) ? <
div className='mt-2'><PostRelation /></div
> : <React.Fragment>
<div>
<Divider orientation='left'>字段级资产目录信息</Divider>
</div>
...
...
src/view/Manage/AssetManage/Component/AssetDetailDrawer.jsx
View file @
8e4946ef
...
...
@@ -4,7 +4,7 @@ import { Drawer, Form } from 'antd';
import
AssetAction
from
'./AssetAction'
;
const
AssetDetailDrawer
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
id
,
dirId
,
reference
}
=
props
;
const
{
onCancel
,
visible
,
id
,
dirId
,
reference
,
readonly
=
false
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
...
...
@@ -21,7 +21,7 @@ const AssetDetailDrawer = (props) => {
}
}
>
{
visible
&&
<
AssetAction
reference=
{
reference
}
form=
{
form
}
id=
{
id
}
dirId=
{
dirId
}
action=
'detail'
onChange=
{
()
=>
{
visible
&&
<
AssetAction
reference=
{
reference
}
form=
{
form
}
id=
{
id
}
dirId=
{
dirId
}
action=
'detail'
readonly=
{
readonly
}
onChange=
{
()
=>
{
onCancel
?.(
true
);
}
}
/>
}
...
...
src/view/Manage/AssetManage/Component/select-asset.jsx
View file @
8e4946ef
import
React
from
'react'
import
{
Row
,
Col
,
Spin
,
Tree
,
Input
,
Tooltip
,
Typography
,
Select
,
Pagination
}
from
'antd'
import
{
Row
,
Col
,
Spin
,
Tree
,
Input
,
Tooltip
,
Typography
,
Select
,
Pagination
,
Space
,
Button
}
from
'antd'
import
produce
from
'immer'
import
{
useDebounceEffect
}
from
"ahooks"
import
classnames
from
'classnames'
...
...
@@ -7,6 +7,7 @@ import classnames from 'classnames'
import
Table
from
'../../ResizeableTable'
import
{
dispatch
}
from
'../../../../model'
import
{
AssetItem
}
from
'./AssetTable'
import
AssetDetailDrawer
from
"./AssetDetailDrawer"
;
import
'./select-asset.less'
...
...
@@ -33,6 +34,11 @@ const FC = (props) => {
const
[
expandedKeys
,
setExpandedKeys
]
=
React
.
useState
([])
const
[
autoExpandParent
,
setAutoExpandParent
]
=
React
.
useState
(
false
)
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
detailParams
,
setDetailParams
]
=
React
.
useState
({
visible
:
false
,
id
:
undefined
,
dirId
:
undefined
,
})
React
.
useEffect
(()
=>
{
getUsers
()
...
...
@@ -81,6 +87,24 @@ const FC = (props) => {
return
undefined
},
[
treeData
])
const
actionCol
=
{
title
:
'操作'
,
dataIndex
:
'action'
,
width
:
80
,
render
:
(
_
,
record
)
=>
{
return
(
<
Space
>
<
a
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
onDetailClick
(
record
);
}
}
>
详情
</
a
>
</
Space
>
)
}
}
const
[
columns
,
tableData
,
total
]
=
React
.
useMemo
(()
=>
{
let
[
newColumns
,
newTableData
]
=
[[],
[]]
...
...
@@ -146,7 +170,7 @@ const FC = (props) => {
}
}
return
[
newColumns
,
newTableData
,
data
?.
total
??
0
]
return
[
[...
newColumns
,
actionCol
]
,
newTableData
,
data
?.
total
??
0
]
},
[
elements
,
data
,
loadingElements
,
users
])
const
setArgsByParams
=
React
.
useCallback
((
params
)
=>
{
...
...
@@ -257,102 +281,121 @@ const FC = (props) => {
setNode
(
selectedNodes
[
0
])
}
const
onDetailClick
=
(
record
)
=>
{
setDetailParams
({
visible
:
true
,
id
:
record
?.
id
,
dirId
:
record
?.
dirId
,
})
}
return
(
<
div
className=
'post-select-asset'
>
<
Row
>
<
Col
span=
{
4
}
>
<
Select
size=
'small'
loading=
{
loadingTemplates
}
value=
{
currentTemplate
?.
type
}
onChange=
{
(
val
)
=>
{
if
(
val
)
{
const
index
=
(
templates
??[]).
findIndex
(
item
=>
item
.
type
===
val
)
if
(
index
!==
-
1
)
{
setCurrentTemplate
(
templates
[
index
])
setNode
()
<
Row
>
<
Col
span=
{
4
}
>
<
Select
size=
'small'
loading=
{
loadingTemplates
}
value=
{
currentTemplate
?.
type
}
onChange=
{
(
val
)
=>
{
if
(
val
)
{
const
index
=
(
templates
??[]).
findIndex
(
item
=>
item
.
type
===
val
)
if
(
index
!==
-
1
)
{
setCurrentTemplate
(
templates
[
index
])
setNode
()
}
else
{
setCurrentTemplate
()
setNode
()
}
}
else
{
setCurrentTemplate
()
setNode
()
}
}
else
{
setCurrentTemplate
()
setNode
()
}
}
}
style=
{
{
width
:
100
,
marginBottom
:
10
}
}
>
{
(
templates
??[]).
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
<
Spin
spinning=
{
loadingTreeData
}
>
<
Tree
className=
'tree'
showLine
showIcon=
{
false
}
autoExpandParent=
{
autoExpandParent
}
treeData=
{
treeData1
}
selectedKeys=
{
node
?[
node
.
nodeId
]:[]
}
expandedKeys=
{
expandedKeys
}
onSelect=
{
onTreeSelect
}
onExpand=
{
onTreeExpand
}
/>
</
Spin
>
</
Col
>
<
Col
span=
{
20
}
>
<
div
style=
{
{
display
:
'flex'
,
padding
:
'0px 0px 15px'
,
alignItems
:
'center'
,
justifyContent
:
'flex-end'
,
}
}
>
<
Input
size=
"middle"
placeholder=
"请输入资产目录要素值"
value=
{
args
.
keyword
}
bordered=
{
true
}
allowClear
onChange=
{
(
e
)
=>
{
setArgsByParams
({
keyword
:
e
.
target
.
value
,
page
:
1
})
}
}
style=
{
{
width
:
200
}
}
/>
</
div
>
<
Table
size=
'small'
rowKey=
'id'
extraColWidth=
{
32
}
loading=
{
loading
||
loadingElements
}
columns=
{
columns
}
dataSource=
{
tableData
}
pagination=
{
false
}
rowSelection=
{
{
selectedRowKeys
:
(
selectedRows
??[]).
map
(
item
=>
item
.
id
),
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
setSelectedRows
(
selectedRows
)
},
}
}
scroll=
{
{
y
:
'calc(80vh - 170px)'
}
}
/>
{
(
total
!==
0
)
&&
<
Pagination
style=
{
{
textAlign
:
'center'
,
marginTop
:
15
,
}
}
showSizeChanger
onChange=
{
(
page
,
size
)
=>
{
setArgsByParams
({
page
,
size
})
style=
{
{
width
:
100
,
marginBottom
:
10
}
}
>
{
(
templates
??[]).
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
type
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
<
Spin
spinning=
{
loadingTreeData
}
>
<
Tree
className=
'tree'
showLine
showIcon=
{
false
}
autoExpandParent=
{
autoExpandParent
}
treeData=
{
treeData1
}
selectedKeys=
{
node
?[
node
.
nodeId
]:[]
}
expandedKeys=
{
expandedKeys
}
onSelect=
{
onTreeSelect
}
onExpand=
{
onTreeExpand
}
/>
</
Spin
>
</
Col
>
<
Col
span=
{
20
}
>
<
div
style=
{
{
display
:
'flex'
,
padding
:
'0px 0px 15px'
,
alignItems
:
'center'
,
justifyContent
:
'flex-end'
,
}
}
>
<
Input
size=
"middle"
placeholder=
"请输入资产目录要素值"
value=
{
args
.
keyword
}
bordered=
{
true
}
allowClear
onChange=
{
(
e
)
=>
{
setArgsByParams
({
keyword
:
e
.
target
.
value
,
page
:
1
})
}
}
style=
{
{
width
:
200
}
}
/>
</
div
>
<
Table
size=
'small'
rowKey=
'id'
extraColWidth=
{
32
}
loading=
{
loading
||
loadingElements
}
columns=
{
columns
}
dataSource=
{
tableData
}
pagination=
{
false
}
rowSelection=
{
{
selectedRowKeys
:
(
selectedRows
??[]).
map
(
item
=>
item
.
id
),
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
setSelectedRows
(
selectedRows
)
},
}
}
current=
{
args
.
page
}
pageSize=
{
args
.
size
}
defaultCurrent=
{
1
}
total=
{
total
}
showTotal=
{
()
=>
`共${total??0}项`
}
scroll=
{
{
y
:
'calc(80vh - 170px)'
}
}
/>
}
</
Col
>
</
Row
>
{
(
total
!==
0
)
&&
<
Pagination
style=
{
{
textAlign
:
'center'
,
marginTop
:
15
,
}
}
showSizeChanger
onChange=
{
(
page
,
size
)
=>
{
setArgsByParams
({
page
,
size
})
}
}
current=
{
args
.
page
}
pageSize=
{
args
.
size
}
defaultCurrent=
{
1
}
total=
{
total
}
showTotal=
{
()
=>
`共${total??0}项`
}
/>
}
</
Col
>
</
Row
>
<
AssetDetailDrawer
{
...
detailParams
}
readonly=
{
true
}
onCancel=
{
()
=>
{
setDetailParams
({
visible
:
false
,
id
:
undefined
,
dirId
:
undefined
,
})
}
}
/>
</
div
>
)
}
...
...
src/view/Manage/AssetManage/Component/select-data-service.jsx
View file @
8e4946ef
...
...
@@ -37,10 +37,6 @@ const FC = (props) => {
const
[
autoExpandParent
,
setAutoExpandParent
]
=
React
.
useState
(
false
)
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
countMap
,
setCount
]
=
React
.
useState
()
const
[
detailParams
,
setDetailParams
]
=
React
.
useState
({
visible
:
false
,
id
:
undefined
,
})
const
app
=
React
.
useContext
(
AppContext
)
...
...
@@ -108,13 +104,13 @@ const FC = (props) => {
render
:
(
_
,
record
)
=>
{
return
(
<
Space
>
<
Button
type=
'link'
size=
'small'
onClick=
{
()
=>
{
onDetailClick
(
record
)
}
}
style=
{
{
padding
:
0
}
}
>
<
a
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
onDetailClick
(
record
);
}
}
>
详情
</
Button
>
</
Space
>
</
a
>
</
Space
>
)
}
}
...
...
@@ -274,10 +270,7 @@ const FC = (props) => {
}
const
onDetailClick
=
(
record
)
=>
{
setDetailParams
({
visible
:
true
,
id
:
record
?.
id
,
})
app
?.
openDetail
?.({
service
:
record
,
isOnlyEnding
:
true
})
}
return
(
...
...
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