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
eead7f2e
Commit
eead7f2e
authored
Jul 24, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产导入
parent
44a09452
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
7 deletions
+75
-7
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
constant.js
src/util/constant.js
+1
-0
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+5
-4
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+23
-1
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+1
-1
select-asset.jsx
src/view/Manage/Model/Component/select-asset.jsx
+37
-1
No files found.
src/model/datamodel.js
View file @
eead7f2e
...
...
@@ -146,6 +146,10 @@ export function* getDraftUsingDDL(payload) {
return
yield
call
(
datamodelerService
.
draftUsingDDL
,
payload
);
}
export
function
*
getDraftUsingMetadataId
(
payload
)
{
return
yield
call
(
datamodelerService
.
draftUsingMetadataId
,
payload
);
}
export
function
*
getConsult
(
payload
)
{
return
yield
call
(
datamodelerService
.
consult
,
payload
);
}
...
...
src/service/datamodeler.js
View file @
eead7f2e
...
...
@@ -98,6 +98,10 @@ export function draftUsingDDL(payload) {
return
PostJSON
(
"/datamodeler/easyDataModelerDesign/draftUsingDDL"
,
payload
);
}
export
function
draftUsingMetadataId
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerDesign/draftUsingMetadataTableId"
,
payload
);
}
//切换模版或者规范时调用
export
function
consult
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerDesign/consult"
,
payload
);
...
...
src/util/constant.js
View file @
eead7f2e
...
...
@@ -10,6 +10,7 @@ export const CatalogId = 'cid';
export
const
RequireId
=
'rid'
;
export
const
ModelerId
=
'mid'
;
export
const
LogicId
=
'logicId'
;
export
const
MetadataId
=
'metadataId'
;
export
const
Hints
=
'hints'
;
export
const
ModelerData
=
'mdata'
;
export
const
DDL
=
'ddl'
;
...
...
src/view/Manage/Model/Component/EditModel.jsx
View file @
eead7f2e
...
...
@@ -7,7 +7,7 @@ import ImportAction from './ImportAction';
import
CatalogModal
from
'./CatalogModal'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
getQueryParam
,
showMessage
,
showNotifaction
}
from
'../../../../util'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
Holder
,
DDL
,
RequireId
,
LogicId
}
from
'../../../../util/constant'
;
import
{
Action
,
CatalogId
,
ModelerId
,
Hints
,
ModelerData
,
PermitCheckOut
,
Editable
,
StateId
,
VersionId
,
Holder
,
DDL
,
RequireId
,
LogicId
,
MetadataId
}
from
'../../../../util/constant'
;
import
HistoryAndVersionDrawer
from
'./HistoryAndVersionDrawer'
;
import
'./EditModel.less'
;
...
...
@@ -25,7 +25,7 @@ const EditModel = (props) => {
const
actionRef
=
useRef
(
''
);
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
holder
,
ddl
,
logicId
,
requireId
}
=
actionData
;
const
{
action
,
catalogId
,
modelerId
,
hints
,
roughModelerData
,
permitCheckOut
,
editable
,
stateId
,
versionId
,
holder
,
ddl
,
logicId
,
metadataId
,
requireId
}
=
actionData
;
const
[
form
]
=
Form
.
useForm
();
...
...
@@ -43,6 +43,7 @@ const EditModel = (props) => {
const
_ddl
=
getQueryParam
(
DDL
,
props
.
location
.
search
);
const
_requireId
=
getQueryParam
(
RequireId
,
props
.
location
.
search
);
const
_logicId
=
getQueryParam
(
LogicId
,
props
.
location
.
search
);
const
_metadataId
=
getQueryParam
(
MetadataId
,
props
.
location
.
search
);
if
(
_logicId
)
{
_action
=
'add'
...
...
@@ -60,7 +61,7 @@ const EditModel = (props) => {
judgeAttributeRepeat
(
_roughModelerData
.
easyDataModelerDataModelAttributes
);
}
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
,
holder
:
_holder
,
ddl
:
_ddl
,
requireId
:
_requireId
,
logicId
:
_logicId
});
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
,
roughModelerData
:
_roughModelerData
,
permitCheckOut
:
(
_permitCheckOut
===
'true'
),
editable
:
(
_editable
===
'true'
),
stateId
:
_stateId
,
versionId
:
_versionId
,
holder
:
_holder
,
ddl
:
_ddl
,
requireId
:
_requireId
,
logicId
:
_logicId
,
metadataId
:
_metadataId
});
actionRef
.
current
=
_action
;
const
interval
=
setInterval
(()
=>
{
...
...
@@ -347,7 +348,7 @@ const EditModel = (props) => {
</div> */
}
<
div
className=
'edit-container'
>
<
div
className=
'edit-container-card'
>
<
ImportAction
hints=
{
hints
}
onChange=
{
onActionChange
}
action=
{
action
}
modelerId=
{
modelerId
}
ddl=
{
ddl
}
form=
{
form
}
terms=
{
terms
}
roughModelerData=
{
roughModelerData
}
permitCheckOut=
{
permitCheckOut
}
stateId=
{
stateId
}
versionId=
{
versionId
}
autoTabKey=
{
autoTabKey
}
logicId=
{
logicId
}
{
...
props
}
/>
<
ImportAction
hints=
{
hints
}
onChange=
{
onActionChange
}
action=
{
action
}
modelerId=
{
modelerId
}
ddl=
{
ddl
}
form=
{
form
}
terms=
{
terms
}
roughModelerData=
{
roughModelerData
}
permitCheckOut=
{
permitCheckOut
}
stateId=
{
stateId
}
versionId=
{
versionId
}
autoTabKey=
{
autoTabKey
}
logicId=
{
logicId
}
metadataId=
{
metadataId
}
{
...
props
}
/>
</
div
>
</
div
>
<
div
className=
'edit-footer'
>
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
eead7f2e
...
...
@@ -15,7 +15,7 @@ import { dispatch } from '../../../../model';
import
'./ImportAction.less'
const
ImportAction
=
React
.
forwardRef
((
props
,
ref
)
=>
{
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
,
ddl
,
roughModelerData
,
versionId
,
permitCheckOut
,
catalogId
,
logicId
}
=
props
;
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
,
ddl
,
roughModelerData
,
versionId
,
permitCheckOut
,
catalogId
,
logicId
,
metadataId
}
=
props
;
const
[
constraints
,
setConstraints
]
=
useState
([]);
const
[
constraint
,
setConstraint
]
=
useState
({});
...
...
@@ -83,6 +83,8 @@ const ImportAction = React.forwardRef((props, ref) => {
getDraft
(
data
?.
length
>
0
?
data
[
0
]:{},
{}
,
hints
);
}
else
if
((
ddl
||
''
).
length
>
0
)
{
getDraftUsingDDL
(
data
?.
length
>
0
?
data
[
0
]:{},
{}
,
ddl
);
}
else
if
(
metadataId
)
{
getDraftUsingMetadataId
(
data
?.
length
>
0
?
data
[
0
]:{},
{}
,
metadataId
);
}
else
if
((
modelerId
||
''
)
!==
''
)
{
getCurrentDataModel
();
}
else
if
(
roughModelerData
)
{
...
...
@@ -202,6 +204,26 @@ const ImportAction = React.forwardRef((props, ref) => {
})
}
const
getDraftUsingMetadataId
=
(
_constraint
,
_template
,
_metadataId
)
=>
{
dispatch
({
type
:
'datamodel.getDraftUsingMetadataId'
,
payload
:
{
data
:
{
metadataTableId
:
_metadataId
,
modelerModelingConstraint
:
_constraint
,
easyDataModelerModelingTemplate
:
_template
}
},
callback
:
data
=>
{
setLoading
(
false
);
getExtraData
(
data
);
},
error
:
()
=>
{
setLoading
(
false
);
}
});
}
const
getDraftUsingDDL
=
(
_constraint
,
_template
,
_ddl
)
=>
{
dispatch
({
type
:
'datamodel.getDraftUsingDDL'
,
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
eead7f2e
...
...
@@ -11,7 +11,7 @@ import { dispatch } from '../../../../model';
import
{
showMessage
,
getQueryParam
,
paginate
,
isSzseEnv
,
formatDate
}
from
'../../../../util'
;
import
{
AnchorId
,
AnchorTimestamp
,
Action
,
CatalogId
,
ModelerId
}
from
'../../../../util/constant'
;
// import Tag from "../../Tag";
import
IframeDrawer
from
'../../ModelConfig/Component/IframeDrawer'
;
import
IframeDrawer
from
'../../ModelConfig/Component/IframeDrawer'
;
import
'./ModelTable.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
...
...
src/view/Manage/Model/Component/select-asset.jsx
View file @
eead7f2e
...
...
@@ -7,10 +7,19 @@ import classnames from 'classnames'
import
Table
from
'../../ResizeableTable'
import
{
dispatch
}
from
'../../../../model'
import
{
AssetItem
}
from
"../../AssetManage/Component/AssetTable"
import
IframeDrawer
from
'../../ModelConfig/Component/IframeDrawer'
;
import
{
Action
,
MetadataId
}
from
"../../../../util/constant"
import
{
showMessage
}
from
"../../../../util"
const
FC
=
({
visible
,
onCancel
})
=>
{
const
[
animated
,
setAnimated
]
=
React
.
useState
(
true
)
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
[
iframeDrawerParams
,
setIframeDrawerParams
]
=
React
.
useState
({
visible
:
false
,
title
:
undefined
,
url
:
undefined
,
})
const
basicRef
=
React
.
useRef
()
React
.
useEffect
(()
=>
{
...
...
@@ -28,7 +37,22 @@ const FC = ({ visible, onCancel }) => {
const
save
=
async
()
=>
{
const
selectedRows
=
basicRef
.
current
?.
selectedRows
if
((
selectedRows
??[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请选择资产'
)
}
else
{
const
asset
=
selectedRows
[
0
]
console
.
log
(
'asset'
,
asset
)
const
metadataTableId
=
asset
[
'资产项'
].
metadataTableId
if
(
metadataTableId
)
{
setIframeDrawerParams
({
visible
:
true
,
title
:
'新增模型'
,
url
:
`/data-govern/data-model-action?
${
Action
}
=add&
${
MetadataId
}
=
${
metadataTableId
}
`
,
})
}
else
{
showMessage
(
'warn'
,
'选中资产没有关联元数据'
)
}
}
}
const
footer
=
React
.
useMemo
(()
=>
{
...
...
@@ -43,6 +67,7 @@ const FC = ({ visible, onCancel }) => {
},
[
close
,
save
])
return
(
<>
<
Modal
title=
'选择资产'
visible=
{
visible
}
...
...
@@ -56,6 +81,17 @@ const FC = ({ visible, onCancel }) => {
!
animated
&&
<
Basic
ref=
{
basicRef
}
/>
}
</
Modal
>
<
IframeDrawer
{
...
iframeDrawerParams
}
onCancel=
{
()
=>
{
setIframeDrawerParams
({
visible
:
false
,
title
:
undefined
,
url
:
undefined
,
})
}
}
/>
</>
)
}
...
...
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