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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
250 additions
and
96 deletions
+250
-96
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
+93
-96
postion-relation.jsx
src/view/Manage/AssetManage/Component/postion-relation.jsx
+18
-0
No files found.
src/model/assetmanage.js
View file @
a9159b22
...
@@ -381,4 +381,8 @@ export function* saveAsDraft(payload) {
...
@@ -381,4 +381,8 @@ export function* saveAsDraft(payload) {
export
function
*
addSubscribe
(
payload
)
{
export
function
*
addSubscribe
(
payload
)
{
return
yield
call
(
service
.
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
...
@@ -363,4 +363,8 @@ export function saveAsDraft(payload) {
...
@@ -363,4 +363,8 @@ export function saveAsDraft(payload) {
export
function
addSubscribe
(
payload
)
{
export
function
addSubscribe
(
payload
)
{
return
PostJSON
(
"/informationmanagement/subscribe/add"
,
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) {
...
@@ -399,3 +399,7 @@ export function getDataModelerRole(user) {
return
''
;
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"
...
@@ -10,6 +10,7 @@ import { isSzseEnv, showMessage } from "../../../util"
import
{
AssetItem
}
from
"../AssetManage/Component/AssetTable"
import
{
AssetItem
}
from
"../AssetManage/Component/AssetTable"
import
UpdateAsset
from
"../AssetManage/Component/AssetDetailDrawer"
import
UpdateAsset
from
"../AssetManage/Component/AssetDetailDrawer"
import
{
AssetDraftReference
}
from
"../../../util/constant"
import
{
AssetDraftReference
}
from
"../../../util/constant"
import
StartProcess
from
"./start-process"
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
const
specialCol
=
[
'数据关键用户'
,
'业务数据owner'
,
'it责任人'
,
'创建人'
,
'更新人'
]
...
@@ -35,6 +36,10 @@ const FC = (props) => {
...
@@ -35,6 +36,10 @@ const FC = (props) => {
id
:
undefined
,
id
:
undefined
,
dirId
:
undefined
,
dirId
:
undefined
,
})
})
const
[
startProcessParams
,
setStartProcessParams
]
=
React
.
useState
({
visible
:
false
,
items
:
undefined
,
})
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
@@ -297,6 +302,13 @@ const FC = (props) => {
...
@@ -297,6 +302,13 @@ const FC = (props) => {
})
})
}
}
const onStartProcessClick = () => {
setStartProcessParams({
visible: true,
items: selectedRows
})
}
const onDeletesClick = () => {
const onDeletesClick = () => {
modal.confirm({
modal.confirm({
title: '是否确认删除选中的资产目录',
title: '是否确认删除选中的资产目录',
...
@@ -346,6 +358,9 @@ const FC = (props) => {
...
@@ -346,6 +358,9 @@ const FC = (props) => {
</Tooltip>
</Tooltip>
}
}
<Tooltip title={((selectedRows??[]).length === 0) ? '请先选择资产' : ''}>
<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>
<Button onClick={onDeletesClick} disabled={(selectedRows??[]).length === 0}>删除</Button>
</Tooltip>
</Tooltip>
</Space>
</Space>
...
@@ -436,6 +451,17 @@ const FC = (props) => {
...
@@ -436,6 +451,17 @@ const FC = (props) => {
refresh && getDrafts()
refresh && getDrafts()
}}
}}
/>
/>
<StartProcess
{...startProcessParams}
onCancel={(refresh) => {
setStartProcessParams({
visible: false,
items: undefined
})
refresh && getDrafts()
}}
/>
{contextHolder}
{contextHolder}
</div>
</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';
...
@@ -7,7 +7,7 @@ import produce from 'immer';
import
MetadataInfo
from
'./MetadataInfo'
;
import
MetadataInfo
from
'./MetadataInfo'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
highlightSearchContentByTerms
,
showMessage
,
paginate
}
from
'../../../../util'
;
import
{
highlightSearchContentByTerms
,
showMessage
,
paginate
,
isPostionAsset
}
from
'../../../../util'
;
import
{
AppContext
,
appId
}
from
'../../../../App'
;
import
{
AppContext
,
appId
}
from
'../../../../App'
;
import
Tag
from
'../../Tag'
;
import
Tag
from
'../../Tag'
;
import
Separate
from
'./Separate'
;
import
Separate
from
'./Separate'
;
...
@@ -23,6 +23,7 @@ import { checkDataAssetEditable } from '../../../../service/dataassetmanager';
...
@@ -23,6 +23,7 @@ import { checkDataAssetEditable } from '../../../../service/dataassetmanager';
import
download
from
'../../../../util/download'
;
import
download
from
'../../../../util/download'
;
import
SelectStandard
from
'./SelectStandard'
;
import
SelectStandard
from
'./SelectStandard'
;
import
AttributeMaintain
from
'./AttributeMaintain'
;
import
AttributeMaintain
from
'./AttributeMaintain'
;
import
PostionRelation
from
'./postion-relation'
;
import
'./AssetAction.less'
;
import
'./AssetAction.less'
;
...
@@ -623,8 +624,10 @@ const AssetAction = (props) => {
...
@@ -623,8 +624,10 @@ const AssetAction = (props) => {
let
metadataValue
=
data
?.
elements
[
metadataIndex
].
value
;
let
metadataValue
=
data
?.
elements
[
metadataIndex
].
value
;
try
{
try
{
setMetadata
(
JSON
.
parse
(
metadataValue
));
setMetadata
(
JSON
.
parse
(
metadataValue
));
getMetadataAttributes
();
if
(
!
isPostionAsset
(
data
?.
templateType
))
{
getMetadataStandardList
();
getMetadataAttributes
();
getMetadataStandardList
();
}
}
catch
(
error
)
{
}
catch
(
error
)
{
}
}
...
@@ -1307,105 +1310,99 @@ const AssetAction = (props) => {
...
@@ -1307,105 +1310,99 @@ const AssetAction = (props) => {
</Form>
</Form>
</Spin>
</Spin>
<div>
{
<Divider orientation='left'>字段级资产目录信息</Divider>
isPostionAsset(assets?.templateType) ? <PostionRelation /> : <React.Fragment>
</div>
<div>
<Divider orientation='left'>字段级资产目录信息</Divider>
<Space style={{ marginLeft: 'auto' }}>
</div>
{
<Space style={{ marginLeft: 'auto' }}>
(reference===AssetManageReference||(reference!==AssetDraftReference&&canEdit)) && <React.Fragment>
{
{
isMetadataEdit ? <React.Fragment>
(reference===AssetManageReference||(reference!==AssetDraftReference&&canEdit)) && <React.Fragment>
<Button onClick={() => {
{
setMetadataEdit(false)
isMetadataEdit ? <React.Fragment>
}}>
<Button onClick={() => {
取消
</Button>
<Button onClick={() => {
setLoadingMetadataColumnList(true)
dispatch({
type: 'assetmanage.batchUpdateAttributes',
payload: {
data: modifyMetadataColumnList
},
callback: () => {
setLoadingMetadataColumnList(false)
setMetadataEdit(false)
setMetadataEdit(false)
getMetadataAttributes()
}}>
},
取消
error: () => {
</Button>
setLoadingMetadataColumnList(false)
<Button onClick={() => {
setLoadingMetadataColumnList(true)
dispatch({
type: 'assetmanage.batchUpdateAttributes',
payload: {
data: modifyMetadataColumnList
},
callback: () => {
setLoadingMetadataColumnList(false)
setMetadataEdit(false)
getMetadataAttributes()
},
error: () => {
setLoadingMetadataColumnList(false)
}
})
}}>
保存
</Button>
</React.Fragment> : <Button onClick={() => {
setModifyMetadataColumnList(metadataColumnList)
setMetadataEdit(true)
}}>
编辑
</Button>
}
<Button
onClick={() => {
if (metadata?.metadataTableId) {
setAttributeMaintainParam({
visible: true,
metadataId: metadata?.metadataTableId
});
} else {
showMessage("warn","该资产目录没有关联元数据信息");
}
}
}
)
}
}
}}
>
>
保存
字段级维护
</Button>
</Button>
</React.Fragment> : <Button onClick={() => {
</React.Fragment>
setModifyMetadataColumnList(metadataColumnList)
setMetadataEdit(true)
}}>
编辑
</Button>
}
}
<Button
<Input size="middle"
onClick={() => {
placeholder={assets?.templateType==='mdg'?'搜索中英文名称/业务定义':'搜索中英文名称/业务规则'}
if (metadata?.metadataTableId) {
value={keyword}
setAttributeMaintainParam({
bordered={true} allowClear
visible: true,
style={{ width: 200 }}
metadataId: metadata?.metadataTableId
onChange={(e) => {
});
setPagination({...paginate, pageNum: 1})
} else {
setKeyword(e.target.value)
showMessage("warn","该资产目录没有关联元数据信息");
}} />
}
</Space>
}}
>
字段级维护
</Button>
</React.Fragment>
}
<Input size="middle"
placeholder={assets?.templateType==='mdg'?'搜索中英文名称/业务定义':'搜索中英文名称/业务规则'}
value={keyword}
bordered={true} allowClear
style={{ width: 200 }}
onChange={(e) => {
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
<Table
className='mt-3'
className='mt-3'
loading={loadingMetadataColumnList}
loading={loadingMetadataColumnList}
columns={cols??[]}
columns={cols??[]}
rowKey='_id'
rowKey='_id'
dataSource={tableData||[]}
dataSource={tableData||[]}
pagination={{
pagination={{
position: ['bottomLeft'],
position: ['bottomLeft'],
size: 'small',
size: 'small',
total: (metadataColumnList||[]).length,
total: (metadataColumnList||[]).length,
showTotal: (total) => `
共
$
{
total
}
项
`,
showTotal: (total) => `
共
$
{
total
}
项
`,
showSizeChanger: true,
showSizeChanger: true,
current: pageNum,
current: pageNum,
pageSize,
pageSize,
onChange: (_pageNum, _pageSize) => {
onChange: (_pageNum, _pageSize) => {
setPagination({ pageNum: _pageNum||1, pageSize: _pageSize || 20 });
setPagination({ pageNum: _pageNum||1, pageSize: _pageSize || 20 });
},
},
onShowSizeChange: (_pageNum, _pageSize) => {
onShowSizeChange: (_pageNum, _pageSize) => {
setPagination({ pageNum: _pageNum||1, pageSize: _pageSize || 20 });
setPagination({ pageNum: _pageNum||1, pageSize: _pageSize || 20 });
},
},
}}
}}
/>
/>
</React.Fragment>
}
<SelectStandard
<SelectStandard
visible={selectStandardParam.visible}
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