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
a9159b22
Commit
a9159b22
authored
Jan 16, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产草稿申请
parent
38ae998f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
165 additions
and
11 deletions
+165
-11
assetmanage.js
src/model/assetmanage.js
+5
-0
dataassetmanager.js
src/service/dataassetmanager.js
+5
-0
index.js
src/util/index.js
+5
-0
index.jsx
src/view/Manage/AssetDraft/index.jsx
+26
-0
start-process.jsx
src/view/Manage/AssetDraft/start-process.jsx
+98
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+8
-11
postion-relation.jsx
src/view/Manage/AssetManage/Component/postion-relation.jsx
+18
-0
No files found.
src/model/assetmanage.js
View file @
a9159b22
...
...
@@ -382,3 +382,7 @@ export function* saveAsDraft(payload) {
export
function
*
addSubscribe
(
payload
)
{
return
yield
call
(
service
.
addSubscribe
,
payload
);
}
export
function
*
startProcess
(
payload
)
{
return
yield
call
(
service
.
startProcess
,
payload
);
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
a9159b22
...
...
@@ -364,3 +364,7 @@ export function saveAsDraft(payload) {
export
function
addSubscribe
(
payload
)
{
return
PostJSON
(
"/informationmanagement/subscribe/add"
,
payload
)
}
export
function
startProcess
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/flowApi/startProcess"
,
payload
)
}
\ No newline at end of file
src/util/index.js
View file @
a9159b22
...
...
@@ -399,3 +399,7 @@ export function getDataModelerRole(user) {
return
''
;
}
export
function
isPostionAsset
(
templateType
)
{
return
false
}
\ No newline at end of file
src/view/Manage/AssetDraft/index.jsx
View file @
a9159b22
...
...
@@ -10,6 +10,7 @@ import { isSzseEnv, showMessage } from "../../../util"
import
{
AssetItem
}
from
"../AssetManage/Component/AssetTable"
import
UpdateAsset
from
"../AssetManage/Component/AssetDetailDrawer"
import
{
AssetDraftReference
}
from
"../../../util/constant"
import
StartProcess
from
"./start-process"
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
...
...
@@ -35,6 +36,10 @@ const FC = (props) => {
id
:
undefined
,
dirId
:
undefined
,
})
const
[
startProcessParams
,
setStartProcessParams
]
=
React
.
useState
({
visible
:
false
,
items
:
undefined
,
})
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
...
@@ -297,6 +302,13 @@ const FC = (props) => {
})
}
const onStartProcessClick = () => {
setStartProcessParams({
visible: true,
items: selectedRows
})
}
const onDeletesClick = () => {
modal.confirm({
title: '是否确认删除选中的资产目录',
...
...
@@ -346,6 +358,9 @@ const FC = (props) => {
</Tooltip>
}
<Tooltip title={((selectedRows??[]).length === 0) ? '请先选择资产' : ''}>
<Button onClick={onStartProcessClick} disabled={(selectedRows??[]).length === 0}>申请</Button>
</Tooltip>
<Tooltip title={((selectedRows??[]).length === 0) ? '请先选择资产' : ''}>
<Button onClick={onDeletesClick} disabled={(selectedRows??[]).length === 0}>删除</Button>
</Tooltip>
</Space>
...
...
@@ -436,6 +451,17 @@ const FC = (props) => {
refresh && getDrafts()
}}
/>
<StartProcess
{...startProcessParams}
onCancel={(refresh) => {
setStartProcessParams({
visible: false,
items: undefined
})
refresh && getDrafts()
}}
/>
{contextHolder}
</div>
)
...
...
src/view/Manage/AssetDraft/start-process.jsx
0 → 100644
View file @
a9159b22
import
React
,
{
useState
}
from
'react'
import
{
Modal
,
Form
,
Input
,
Spin
,
Button
}
from
'antd'
import
{
dispatch
}
from
'../../../model'
import
{
showMessage
}
from
'../../../util'
const
FC
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
items
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
6
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
14
},
},
};
const
close
=
(
refresh
=
false
)
=>
{
setWaiting
(
false
)
onCancel
?.(
refresh
)
}
const
save
=
async
()
=>
{
try
{
const
values
=
await
form
.
validateFields
()
setWaiting
(
true
)
dispatch
({
type
:
'assetmanage.startProcess'
,
payload
:
{
params
:
{
...
values
,
},
data
:
(
items
??[]).
map
(
item
=>
item
.
id
)
},
callback
:
()
=>
{
showMessage
(
'success'
,
'申请成功!'
)
close
(
true
)
},
error
:
()
=>
{
setWaiting
(
false
)
}
})
}
catch
(
errInfo
)
{
}
}
const
footer
=
React
.
useMemo
(()
=>
{
return
[
<
Button
key=
{
'cancel'
}
onClick=
{
()
=>
close
()
}
>
取消
</
Button
>,
<
Button
key=
{
'save'
}
type=
'primary'
disabled=
{
waiting
}
onClick=
{
()
=>
save
()
}
>
保存
</
Button
>
]
},
[
close
,
save
,
waiting
])
return
(
<
Modal
destroyOnClose
visible=
{
visible
}
title=
'申请'
width=
{
520
}
bodyStyle=
{
{
overflowX
:
'auto'
,
maxHeight
:
'80vh'
}
}
footer=
{
footer
}
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
waiting
}
>
<
Form
labelAlign=
'left'
{
...
formItemLayout
}
form=
{
form
}
>
<
Form
.
Item
label=
'申请原因'
name=
'reason'
rules=
{
[{
required
:
true
,
message
:
'请填写申请原因'
}]
}
>
<
Input
.
TextArea
placeholder=
'请在申请原因栏中描述用途说明以及必要性'
rows=
{
4
}
/>
</
Form
.
Item
>
</
Form
>
</
Spin
>
</
Modal
>
);
}
export
default
FC
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
a9159b22
...
...
@@ -7,7 +7,7 @@ import produce from 'immer';
import
MetadataInfo
from
'./MetadataInfo'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
highlightSearchContentByTerms
,
showMessage
,
paginate
}
from
'../../../../util'
;
import
{
highlightSearchContentByTerms
,
showMessage
,
paginate
,
isPostionAsset
}
from
'../../../../util'
;
import
{
AppContext
,
appId
}
from
'../../../../App'
;
import
Tag
from
'../../Tag'
;
import
Separate
from
'./Separate'
;
...
...
@@ -23,6 +23,7 @@ import { checkDataAssetEditable } from '../../../../service/dataassetmanager';
import
download
from
'../../../../util/download'
;
import
SelectStandard
from
'./SelectStandard'
;
import
AttributeMaintain
from
'./AttributeMaintain'
;
import
PostionRelation
from
'./postion-relation'
;
import
'./AssetAction.less'
;
...
...
@@ -623,8 +624,10 @@ const AssetAction = (props) => {
let
metadataValue
=
data
?.
elements
[
metadataIndex
].
value
;
try
{
setMetadata
(
JSON
.
parse
(
metadataValue
));
if
(
!
isPostionAsset
(
data
?.
templateType
))
{
getMetadataAttributes
();
getMetadataStandardList
();
}
}
catch
(
error
)
{
}
...
...
@@ -1308,10 +1311,11 @@ const AssetAction = (props) => {
</Spin>
{
isPostionAsset(assets?.templateType) ? <PostionRelation /> : <React.Fragment>
<div>
<Divider orientation='left'>字段级资产目录信息</Divider>
</div>
<Space style={{ marginLeft: 'auto' }}>
{
(reference===AssetManageReference||(reference!==AssetDraftReference&&canEdit)) && <React.Fragment>
...
...
@@ -1373,15 +1377,6 @@ const AssetAction = (props) => {
setPagination({...paginate, pageNum: 1})
setKeyword(e.target.value)
}} />
{/* {
(reference===AssetManageReference||canEdit) && <Button type='primary' onClick={() => {
uploadRef.current?.chooseFile()
}}>导入</Button>
} */}
{/* <Button type='primary' onClick={() => {
uploadRef.current?.chooseFile()
}}>导入</Button>
<Button type='primary' onClick={onExportClick}>导出</Button> */}
</Space>
<Table
...
...
@@ -1406,6 +1401,8 @@ const AssetAction = (props) => {
},
}}
/>
</React.Fragment>
}
<SelectStandard
visible={selectStandardParam.visible}
...
...
src/view/Manage/AssetManage/Component/postion-relation.jsx
0 → 100644
View file @
a9159b22
import
React
from
'react'
import
{
Tabs
}
from
'antd'
const
FC
=
(
props
)
=>
{
const
[
activeKey
,
setActiveKey
]
=
React
.
useState
(
'asset'
)
return
(
<
div
>
<
Tabs
activeKey=
{
activeKey
}
onChange=
{
(
val
)
=>
{
setActiveKey
(
val
)
}
}
>
<
Tabs
.
TabPane
tab=
'关联资产'
key=
'asset'
/>
<
Tabs
.
TabPane
tab=
'关联服务'
key=
'service'
/>
</
Tabs
>
</
div
>
)
}
export
default
FC
\ 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