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
1915cab8
Commit
1915cab8
authored
Sep 29, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型目录
parent
fdd01c14
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
112 additions
and
10 deletions
+112
-10
datamodel.js
src/model/datamodel.js
+9
-0
user.js
src/model/user.js
+3
-0
datamodeler.js
src/service/datamodeler.js
+10
-2
user.js
src/service/user.js
+5
-0
ModelTree.jsx
src/view/Manage/Model/Component/ModelTree.jsx
+78
-4
StartFlowModal.jsx
src/view/Manage/Model/Component/StartFlowModal.jsx
+6
-1
index.jsx
src/view/Manage/Model/index.jsx
+1
-3
No files found.
src/model/datamodel.js
View file @
1915cab8
...
@@ -241,3 +241,11 @@ export function* compare(payload) {
...
@@ -241,3 +241,11 @@ export function* compare(payload) {
export
function
*
getDataModelByVersionId
(
payload
)
{
export
function
*
getDataModelByVersionId
(
payload
)
{
return
yield
call
(
datamodelerService
.
getDataModelByVersionId
,
payload
);
return
yield
call
(
datamodelerService
.
getDataModelByVersionId
,
payload
);
}
}
export
function
*
isSetRootDomainId
()
{
return
yield
call
(
datamodelerService
.
isSetRootDomainId
);
}
export
function
*
setRootDomainId
(
payload
)
{
return
yield
call
(
datamodelerService
.
setRootDomainId
,
payload
);
}
\ No newline at end of file
src/model/user.js
View file @
1915cab8
...
@@ -12,3 +12,6 @@ export function* signin(payload) {
...
@@ -12,3 +12,6 @@ export function* signin(payload) {
export
function
*
signout
()
{
export
function
*
signout
()
{
return
yield
call
(
service
.
signout
);
return
yield
call
(
service
.
signout
);
}
}
export
function
*
getDomains
()
{
return
yield
call
(
service
.
getDomains
);
}
src/service/datamodeler.js
View file @
1915cab8
import
{
PostFile
,
GetJSON
,
PostJSON
,
Post
}
from
"../util/axios"
import
{
PostFile
,
GetJSON
,
PostJSON
,
Post
,
Get
}
from
"../util/axios"
export
function
loadDataModelCatalog
()
{
export
function
loadDataModelCatalog
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/loadDataModelCatalog"
);
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/loadDataModelCatalog"
);
...
@@ -141,6 +141,14 @@ export function getDataModelByVersionId(payload) {
...
@@ -141,6 +141,14 @@ export function getDataModelByVersionId(payload) {
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/getDataModelByVersionId"
,
payload
);
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/getDataModelByVersionId"
,
payload
);
}
}
export
function
isSetRootDomainId
()
{
return
Get
(
"/datamodeler/easyDataModelerCURD/isSetRootDomainId"
);
}
export
function
setRootDomainId
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/setRootDomainId"
,
payload
);
}
export
function
ddlGenerators
()
{
export
function
ddlGenerators
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerExport/ddlGenerators"
);
return
GetJSON
(
"/datamodeler/easyDataModelerExport/ddlGenerators"
);
}
}
...
@@ -182,7 +190,7 @@ export function recommandEnglishWords(payload) {
...
@@ -182,7 +190,7 @@ export function recommandEnglishWords(payload) {
}
}
export
function
startFlow
(
payload
)
{
export
function
startFlow
(
payload
)
{
return
Post
JSON
(
"/datamodeler/easyDataModelerWorkflowSupport/startModelFlow"
,
payload
);
return
Post
(
"/datamodeler/easyDataModelerWorkflowSupport/startModelFlow"
,
payload
);
}
}
export
function
getDatasourcesByEnv
(
payload
)
{
export
function
getDatasourcesByEnv
(
payload
)
{
...
...
src/service/user.js
View file @
1915cab8
...
@@ -17,4 +17,8 @@ export function queryRoles() {
...
@@ -17,4 +17,8 @@ export function queryRoles() {
export
function
queryUserSystem
(
payload
)
{
export
function
queryUserSystem
(
payload
)
{
return
GetJSON
(
"/authservice/personal/grantedScopes"
,
payload
);
return
GetJSON
(
"/authservice/personal/grantedScopes"
,
payload
);
}
export
function
getDomains
()
{
return
GetJSON
(
"/authservice/domains"
);
}
}
\ No newline at end of file
src/view/Manage/Model/Component/ModelTree.jsx
View file @
1915cab8
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
{
Tooltip
,
Tree
,
Modal
,
Spin
,
Dropdown
,
Menu
}
from
"antd"
;
import
{
Tooltip
,
Tree
,
Modal
,
Spin
,
Dropdown
,
Menu
,
Button
}
from
"antd"
;
import
{
PlusOutlined
,
EditOutlined
,
SyncOutlined
,
DeleteOutlined
,
ImportOutlined
,
UnorderedListOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
EditOutlined
,
SyncOutlined
,
DeleteOutlined
,
ImportOutlined
,
UnorderedListOutlined
}
from
'@ant-design/icons'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
...
@@ -34,6 +34,10 @@ const ModelTree = (props) => {
...
@@ -34,6 +34,10 @@ const ModelTree = (props) => {
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
([]);
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
([]);
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
false
);
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
false
);
const
[
viewSelectedKey
,
setViewSelectedKey
]
=
useState
(
viewModes
[
0
].
key
);
const
[
viewSelectedKey
,
setViewSelectedKey
]
=
useState
(
viewModes
[
0
].
key
);
const
[
isSetRootId
,
setIsSetRootId
]
=
useState
(
true
);
const
[
disableSync
,
setDisableSync
]
=
useState
(
true
);
const
[
domains
,
setDomains
]
=
useState
([]);
const
[
domainSelectedKey
,
setDomainSelectedKey
]
=
useState
(
''
);
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
@@ -44,6 +48,11 @@ const ModelTree = (props) => {
...
@@ -44,6 +48,11 @@ const ModelTree = (props) => {
itemRef
.
current
=
null
;
itemRef
.
current
=
null
;
useEffect
(()
=>
{
useEffect
(()
=>
{
getShowSyncAndDomains
();
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
useEffect
(()
=>
{
if
(
refrence
===
'recatalog'
)
{
if
(
refrence
===
'recatalog'
)
{
getDirTreeData
();
getDirTreeData
();
}
else
{
}
else
{
...
@@ -78,6 +87,26 @@ const ModelTree = (props) => {
...
@@ -78,6 +87,26 @@ const ModelTree = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
])
},
[
keyword
])
const
getShowSyncAndDomains
=
()
=>
{
dispatch
({
type
:
'datamodel.isSetRootDomainId'
,
callback
:
data
=>
{
if
(
data
===
'false'
)
{
dispatch
({
type
:
'user.getDomains'
,
callback
:
_data
=>
{
setDomains
(
_data
||
[]);
setIsSetRootId
(
false
);
}
});
}
else
{
setIsSetRootId
(
true
);
setDisableSync
(
false
);
}
}
});
}
const
getDataModelLocationThenGetDirTreeData
=
()
=>
{
const
getDataModelLocationThenGetDirTreeData
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
dispatch
({
dispatch
({
...
@@ -239,6 +268,25 @@ const ModelTree = (props) => {
...
@@ -239,6 +268,25 @@ const ModelTree = (props) => {
}
}
}
}
const
onSyncClick
=
({
key
})
=>
{
setDomainSelectedKey
(
key
);
dispatch
({
type
:
'datamodel.setRootDomainId'
,
payload
:
{
params
:
{
domainId
:
key
}
},
callback
:
()
=>
{
setIsSetRootId
(
true
);
setDisableSync
(
false
);
getDirTreeData
();
}
});
}
const
onTreeSelect
=
(
keys
,
data
)
=>
{
const
onTreeSelect
=
(
keys
,
data
)
=>
{
if
((
keys
||
[]).
length
===
0
)
{
if
((
keys
||
[]).
length
===
0
)
{
...
@@ -328,6 +376,18 @@ const ModelTree = (props) => {
...
@@ -328,6 +376,18 @@ const ModelTree = (props) => {
</
Menu
>
</
Menu
>
);
);
const
syncMenu
=
(
<
Menu
selectedKeys=
{
[
domainSelectedKey
]
}
onClick=
{
onSyncClick
}
>
{
domains
&&
domains
.
map
(
domain
=>
{
return
(
<
Menu
.
Item
key=
{
domain
.
domainId
}
value=
{
domain
.
domainId
}
>
{
domain
.
domainName
}
</
Menu
.
Item
>
)
})
}
</
Menu
>
);
const
classes
=
classnames
(
'model-tree'
,
{
const
classes
=
classnames
(
'model-tree'
,
{
'model-tree-recatalog'
:
(
refrence
===
'recatalog'
)
'model-tree-recatalog'
:
(
refrence
===
'recatalog'
)
});
});
...
@@ -371,9 +431,23 @@ const ModelTree = (props) => {
...
@@ -371,9 +431,23 @@ const ModelTree = (props) => {
</
Tooltip
>
</
Tooltip
>
)
)
}
}
<
Tooltip
title=
"刷新目录"
className=
'ml-4'
>
<
SyncOutlined
onClick=
{
refresh
}
style=
{
{
fontSize
:
16
,
cursor
:
'pointer'
}
}
/>
{
</
Tooltip
>
((
viewSelectedKey
!==
'dir'
)
||
(
viewSelectedKey
===
'dir'
&&
isSetRootId
))
&&
<
Tooltip
title=
"刷新目录"
className=
'ml-4'
>
<
Button
type=
'text'
icon=
{
<
SyncOutlined
/>
}
disabled=
{
viewSelectedKey
===
'dir'
&&
disableSync
}
size=
'small'
onClick=
{
refresh
}
/>
</
Tooltip
>
}
{
(
viewSelectedKey
===
'dir'
)
&&
!
isSetRootId
&&
(
<
Dropdown
overlay=
{
syncMenu
}
placement=
"bottomLeft"
>
<
Tooltip
title=
"同步目录"
className=
'ml-4'
>
<
SyncOutlined
className=
'ml-4'
style=
{
{
fontSize
:
16
,
cursor
:
'pointer'
}
}
/>
</
Tooltip
>
</
Dropdown
>
)
}
{
{
viewSelectedKey
===
'dir'
&&
(
viewSelectedKey
===
'dir'
&&
(
<
Tooltip
title=
"删除目录"
className=
'ml-4'
>
<
Tooltip
title=
"删除目录"
className=
'ml-4'
>
...
...
src/view/Manage/Model/Component/StartFlowModal.jsx
View file @
1915cab8
...
@@ -3,6 +3,7 @@ import { Modal, Form, Input } from 'antd';
...
@@ -3,6 +3,7 @@ import { Modal, Form, Input } from 'antd';
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
showNotifaction
}
from
'../../../../util'
;
const
StartFlowModal
=
(
props
)
=>
{
const
StartFlowModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
ids
}
=
props
;
const
{
visible
,
onCancel
,
ids
}
=
props
;
...
@@ -40,9 +41,13 @@ const StartFlowModal = (props) => {
...
@@ -40,9 +41,13 @@ const StartFlowModal = (props) => {
flowDesc
:
values
?.
desc
flowDesc
:
values
?.
desc
}
}
},
},
callback
:
()
=>
{
callback
:
data
=>
{
reset
();
reset
();
if
((
data
||
''
)
!==
''
)
{
showNotifaction
(
'送审提示'
,
data
,
5
);
}
LocalStorage
.
set
(
'modelChange'
,
!
(
LocalStorage
.
get
(
'modelChange'
)
||
false
));
LocalStorage
.
set
(
'modelChange'
,
!
(
LocalStorage
.
get
(
'modelChange'
)
||
false
));
onCancel
&&
onCancel
(
true
);
onCancel
&&
onCancel
(
true
);
},
},
...
...
src/view/Manage/Model/index.jsx
View file @
1915cab8
...
@@ -136,9 +136,7 @@ class Model extends React.Component {
...
@@ -136,9 +136,7 @@ class Model extends React.Component {
easyDataModelerStateCatalogId
:
catalogId
easyDataModelerStateCatalogId
:
catalogId
},
},
callback
:
data
=>
{
callback
:
data
=>
{
this
.
setState
({
loadingTableData
:
false
,
tableData
:
data
.
easyDataModelerDataModels
||
[]
},
()
=>
{
this
.
setState
({
loadingTableData
:
false
,
tableData
:
data
.
easyDataModelerDataModels
||
[],
filterTableData
:
data
.
easyDataModelerDataModels
||
[]
});
this
.
setFilterData
();
});
},
},
error
:
()
=>
{
error
:
()
=>
{
this
.
setState
({
loadingTableData
:
false
});
this
.
setState
({
loadingTableData
:
false
});
...
...
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