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
9d4af7fd
Commit
9d4af7fd
authored
Feb 17, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换ownerowner
parent
a161ac14
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
210 additions
and
2 deletions
+210
-2
pds.js
src/model/pds.js
+5
-0
pds.js
src/service/pds.js
+3
-1
ExchangeOwner.jsx
src/view/Manage/Model/Component/ExchangeOwner.jsx
+119
-0
ExchangeOwner.less
src/view/Manage/Model/Component/ExchangeOwner.less
+6
-0
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+16
-1
SelectUsers.jsx
src/view/Manage/Model/Component/SelectUsers.jsx
+61
-0
No files found.
src/model/pds.js
View file @
9d4af7fd
...
...
@@ -99,4 +99,8 @@ export function* release(payload) {
export
function
*
getSmartBiUrl
(
payload
)
{
return
yield
call
(
pds
.
getSmartBiUrl
,
payload
)
}
export
function
*
getOwners
()
{
return
yield
call
(
pds
.
getOwners
)
}
\ No newline at end of file
src/service/pds.js
View file @
9d4af7fd
...
...
@@ -100,5 +100,7 @@ export function getSmartBiUrl(payload) {
return
Get
(
`/
${
payload
.
url
}
`
);
}
export
function
getOwners
()
{
return
GetJSON
(
"/informationmanagement/userData/findAll"
)
}
src/view/Manage/Model/Component/ExchangeOwner.jsx
0 → 100644
View file @
9d4af7fd
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Modal
,
Button
,
Form
,
Descriptions
,
Space
,
Spin
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
SelectUsers
from
'./SelectUsers'
;
import
'./ExchangeOwner.less'
;
const
FC
=
({
visible
,
id
,
onCancel
})
=>
{
const
[
service
,
setService
]
=
useState
(
undefined
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
owners
,
setOwners
]
=
useState
(
undefined
);
const
[
currentOwner
,
setCurrentOwner
]
=
useState
(
undefined
);
useEffect
(()
=>
{
if
(
visible
)
{
getService
();
getOwners
();
}
},
[
visible
,
id
])
const
getService
=
()
=>
{
setLoading
(
true
);
dispatch
({
type
:
'pds.getDataService'
,
payload
:
{
id
},
callback
:
(
data
)
=>
{
setLoading
(
false
);
setService
(
data
);
setCurrentOwner
(
data
?.
provider
?.
owner
);
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
const
getOwners
=
()
=>
{
dispatch
({
type
:
'pds.getOwners'
,
callback
:
(
data
)
=>
{
setOwners
(
data
);
},
error
:
()
=>
{
}
})
}
const
onOwnerChange
=
(
value
)
=>
{
setCurrentOwner
(
value
);
}
const
cancel
=
()
=>
{
reset
();
onCancel
?.();
}
const
onOk
=
()
=>
{
onCancel
?.(
true
);
}
const
reset
=
()
=>
{
setService
(
undefined
);
setLoading
(
false
);
}
const
footer
=
[
<
Button
key=
"0"
onClick=
{
cancel
}
>
取消
</
Button
>,
<
Button
key=
"1"
type=
"primary"
onClick=
{
onOk
}
>
确定
</
Button
>,
];
return
(
<
Modal
className=
'exchange-owner'
forceRender
visible=
{
visible
}
title=
'替换Owner'
width=
{
800
}
onCancel=
{
cancel
}
footer=
{
footer
}
>
<
Spin
spinning=
{
loading
}
>
<
Descriptions
title=
{
<
Space
>
<
div
style=
{
{
height
:
18
,
width
:
3
,
background
:
'rgb(2, 105, 172)'
}
}
></
div
>
<
div
>
基本信息
</
div
>
</
Space
>
}
>
<
Descriptions
.
Item
label=
"数据服务名称"
>
{
service
?.
name
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"数据服务技术名称"
>
{
service
?.
cnName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"数据服务描述"
>
{
service
?.
remark
}
</
Descriptions
.
Item
>
</
Descriptions
>
<
Descriptions
title=
{
<
Space
>
<
div
style=
{
{
height
:
18
,
width
:
3
,
background
:
'rgb(2, 105, 172)'
}
}
></
div
>
<
div
>
提供方信息
</
div
>
</
Space
>
}
/>
<
Space
>
<
div
>
数据提供服务方Owner:
</
div
>
<
div
style=
{
{
width
:
200
}
}
>
<
SelectUsers
type=
'edit'
users=
{
owners
}
value=
{
currentOwner
}
onChange=
{
onOwnerChange
}
/>
</
div
>
</
Space
>
</
Spin
>
</
Modal
>
)
}
export
default
FC
;
\ No newline at end of file
src/view/Manage/Model/Component/ExchangeOwner.less
0 → 100644
View file @
9d4af7fd
.exchange-owner {
.yy-descriptions-header {
margin-bottom: 5px;
}
}
\ No newline at end of file
src/view/Manage/Model/Component/ModelTable.jsx
View file @
9d4af7fd
...
...
@@ -8,6 +8,7 @@ import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"
import
ResizeObserver
from
'rc-resize-observer'
;
import
ServiceDetail
from
'./ServiceDetailModal'
;
import
SampleModal
from
'./SampleModal'
;
import
ExchangeOwnerModal
from
'./ExchangeOwner'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
,
getQueryParam
,
paginate
,
isSzseEnv
,
formatDate
,
getDataModelerRole
}
from
'../../../../util'
;
...
...
@@ -146,7 +147,7 @@ const ModelTable = (props) => {
const
[
subData
,
setSubData
]
=
useState
([]);
const
[
serviceDetailParams
,
setServiceDetailParams
]
=
useState
({
visible
:
false
,
id
:
''
})
const
[
sampleParams
,
setSampleParams
]
=
useState
({
visible
:
false
,
service
:
undefined
});
const
[
exchangeOwnerParams
,
setExchangeOwnerParams
]
=
useState
({
visible
:
false
,
id
:
undefined
});
const
app
=
useContext
(
AppContext
);
...
...
@@ -785,6 +786,8 @@ const ModelTable = (props) => {
window.open(data)
}
})
} else if (key === 'exchangeOwner') {
setExchangeOwnerParams({ visible: true, id: currentItem?.id });
}
}
...
...
@@ -796,6 +799,12 @@ const ModelTable = (props) => {
setSampleParams({ visible: false, service: undefined });
}
const onExchangeOwnerClose = (refresh = false) => {
setExchangeOwnerParams({ visible: false, id: undefined });
refresh && onChange?.();
}
const mergedColumns = () => {
let newColumns = [...columns];
// if ((modelId||'')==='' && (view==='state'||(keyword||'')!=='')) {
...
...
@@ -961,6 +970,11 @@ const ModelTable = (props) => {
跳转至电子表格
</RcItem>
}
{
getDataModelerRole(user)!==DataModelerRoleReader && view!=='grant' && <RcItem id="exchangeOwner" onClick={handleItemClick}>
替换Owner
</RcItem>
}
{/* {
getDataModelerRole(user)!==DataModelerRoleReader &¤tItem?.deployable && <RcItem id='createTable' onClick={handleItemClick}>
建表
...
...
@@ -970,6 +984,7 @@ const ModelTable = (props) => {
</RcMenu>
<ServiceDetail visible={serviceDetailParams.visible} id={serviceDetailParams.id} onClose={onServiceDetailClose} />
<SampleModal visible={sampleParams.visible} service={sampleParams.service} onCancel={onSampleClose} />
<ExchangeOwnerModal visible={exchangeOwnerParams.visible} id={exchangeOwnerParams.id} onCancel={onExchangeOwnerClose} />
{ contextHolder }
</div>
...
...
src/view/Manage/Model/Component/SelectUsers.jsx
0 → 100755
View file @
9d4af7fd
import
React
from
"react"
import
{
Select
}
from
"antd"
const
{
Option
}
=
Select
const
SelectUser
:
React
.
FC
=
(
props
)
=>
{
const
{
value
,
onChange
,
users
,
type
,}
=
props
const
change
=
(
value
)
=>
{
onChange
&&
onChange
(
value
)
}
if
(
type
===
'edit'
){
return
(
<
Select
style=
{
{
width
:
'100%'
}
}
showSearch
value=
{
value
}
onChange=
{
change
}
allowClear
filterOption=
{
(
inputvalue
,
option
)
=>
{
if
(
inputvalue
){
console
.
log
(
option
)
try
{
if
(
option
.
children
.
includes
(
inputvalue
)
||
option
.
value
.
includes
(
inputvalue
)){
return
true
}
else
{
return
false
}
}
catch
(
error
)
{
return
true
}
}
else
{
return
true
}
}
}
>
{
users
?.
map
((
item
)
=>
{
return
(
<
Option
vlaue=
{
item
.
pernr
}
key=
{
item
.
pernr
}
>
{
`${item.nachn}(${item.pernr})`
}
</
Option
>
)
})
}
</
Select
>
)
}
else
if
(
type
===
'detail'
){
try
{
const
user
=
users
?.
filter
((
item
)
=>
(
item
.
pernr
===
value
))
return
`
${
user
[
0
].
nachn
}
(
${
user
[
0
].
pernr
}
)`
}
catch
(
error
)
{
return
value
}
}
else
{
return
null
}
}
export
default
SelectUser
\ 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