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
d0a3ee91
Commit
d0a3ee91
authored
Jun 24, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
225ddc8e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
65 deletions
+24
-65
UpdateDatasourceModal.jsx
...nage/DatasourceManage/Component/UpdateDatasourceModal.jsx
+5
-5
index.jsx
src/view/Manage/DatasourceManage/index.jsx
+7
-3
SquareItem.jsx
src/view/Manage/Map/Component/SquareItem.jsx
+11
-48
MapContent.jsx
src/view/Manage/Map/MapContent.jsx
+1
-9
No files found.
src/view/Manage/DatasourceManage/Component/UpdateDatasourceModal.jsx
View file @
d0a3ee91
...
...
@@ -242,11 +242,11 @@ const UpdateDatasourceModal = (props) => {
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
sm
:
{
span
:
6
},
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
1
7
},
sm
:
{
span
:
1
6
},
},
};
...
...
@@ -255,13 +255,13 @@ const UpdateDatasourceModal = (props) => {
forceRender
title=
{
action
===
'add'
?
'新增数据源'
:
'修改数据源'
}
visible=
{
visible
}
width=
{
6
00
}
width=
{
7
00
}
onCancel=
{
()
=>
{
onCancel
&&
onCancel
()
}
}
footer=
{
<
Space
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
onOk
(
false
);}
}
loading=
{
confirmLoading
}
>
保存
</
Button
>
<
Button
onClick=
{
()
=>
onCancel
&&
onCancel
()
}
>
返回
</
Button
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
onOk
(
true
);
}
}
loading=
{
validateLoading
}
>
测试连接
</
Button
>
<
Button
onClick=
{
()
=>
onCancel
&&
onCancel
()
}
>
返回
</
Button
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
onOk
(
false
);}
}
loading=
{
confirmLoading
}
>
保存
</
Button
>
</
Space
>
}
>
...
...
src/view/Manage/DatasourceManage/index.jsx
View file @
d0a3ee91
...
...
@@ -7,14 +7,18 @@ import TaskLogsModal from './Component/TaskLogsModal';
import
TaskLogModal
from
'./Component/TaskLogModal'
;
import
UpdateTaskModal
from
'./Component/UpdateTaskModal'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
showMessage
}
from
'../../../util'
;
import
{
showMessage
,
getQueryParam
}
from
'../../../util'
;
import
{
DatasourceContext
}
from
'./Component/ContextManager.js'
;
import
'./index.less'
;
const
{
Option
}
=
Select
;
const
DatasourceManage
=
()
=>
{
const
DatasourceManage
=
(
props
)
=>
{
const
domainId
=
getQueryParam
(
'domainId'
,
props
.
location
.
search
);
const
catalogId
=
getQueryParam
(
'catalogId'
,
props
.
location
.
search
);
const
scopeId
=
getQueryParam
(
'scopeId'
,
props
.
location
.
search
);
const
[
scopes
,
setScopes
]
=
useState
([]);
const
[
selectedScope
,
setSelectedScope
]
=
useState
([]);
...
...
@@ -108,7 +112,7 @@ const DatasourceManage = () => {
})
setScopes
([{
value
:
''
,
label
:
'环境'
,
disabled
:
true
},
...
newScopes
]);
setSelectedScope
(
defaultScope
);
setSelectedScope
(
d
omainId
&&
catalogId
&&
scopeId
?[
Number
(
domainId
),
Number
(
catalogId
),
Number
(
scopeId
)]:
d
efaultScope
);
}
const
getAllDatasources
=
()
=>
{
...
...
src/view/Manage/Map/Component/SquareItem.jsx
View file @
d0a3ee91
...
...
@@ -5,15 +5,6 @@ import { FolderAddOutlined, FileOutlined } from '@ant-design/icons';
import
'./SquareItem.less'
;
const
colors
=
[
// '#BDD2FD',
// '#C2C8D5',
// '#FBE5A2',
// '#F6C3B7',
// '#B6E3F5',
// '#D3C6EA',
// '#FFD8B8',
// '#AAD8D8',
// '#FFD6E7',
'from-orange-400 to-pink-600'
,
'from-fuchsia-500 to-purple-600'
,
'from-purple-500 to-indigo-500'
,
...
...
@@ -21,7 +12,6 @@ const colors = [
'from-green-400 to-cyan-500'
,
'from-yellow-400 to-orange-500'
,
'from-light-blue-400 to-indigo-500'
,
];
class
SquareItem
extends
React
.
Component
{
...
...
@@ -41,56 +31,29 @@ class SquareItem extends React.Component {
render
()
{
const
{
item
,
index
}
=
this
.
props
;
let
assetName
=
''
,
assetCnName
=
''
;
if
(
item
&&
item
.
dbType
===
'Table'
)
{
(
item
.
elements
||
[]).
forEach
((
element
)
=>
{
if
(
element
.
name
===
'中文名称'
)
{
assetCnName
=
element
.
value
;
}
if
(
element
.
name
===
'英文名称'
)
{
assetName
=
element
.
value
;
}
})
}
const
title
=
(
item
.
dbType
===
'Dir'
)
?
(
item
.
dirName
||
''
)
:
(
item
.
cnName
||
''
);
const
content
=
(
item
.
dbType
===
'Dir'
)
?
item
.
tableModelCount
:
(
item
.
enName
||
''
);
return
(
<
div
className=
'map-square-item'
>
{
item
&&
(
item
.
dbType
===
'Dir'
?
<
Card
hoverable
onClick=
{
this
.
onItemClick
}
bordered=
{
false
}
<
Card
hoverable
onClick=
{
this
.
onItemClick
}
bordered=
{
false
}
className=
"overflow-hidden"
// title=
{
// <div className='d-flex pointer' style=
{{
justifyContent
:
'
center
',
alignItems
:
'
center
'
}}
>
//
<
FolderAddOutlined
className=
'mr-3'
/>
//
<
span
className=
'textOverflow'
title=
{
item
.
dirName
||
''
}
>
{
item
.
dirName
||
''
}
</
span
>
//
</
div
>
//
}
// headStyle=
{{
backgroundColor
:
colors
[
index
%
colors
.
length
]
}}
cover=
{
<
div
className=
{
'flex px-4 py-3 bg-gradient-to-br leading-6 font-semibold text-white '
+
colors
[
index
%
colors
.
length
]
}
style=
{
{
justifyContent
:
'center'
,
alignItems
:
'center'
}
}
>
{
/* <span className='flex-none w-8 h-8 rounded-full flex items-center justify-center'> </span> */
}
<
span
className=
'flex-auto self-center textOverflow'
title=
{
item
.
dirName
||
''
}
>
{
item
.
dirName
||
''
}
</
span
>
<
span
className=
'flex-auto self-center textOverflow'
title=
{
title
}
>
{
title
}
</
span
>
<
cite
className=
'flex opacity-75 hover:opacity-100 transition-opacity duration-200'
>
<
FolderAddOutlined
className=
'rounded-full'
style=
{
{
fontSize
:
'1.5em'
}
}
/>
</
cite
>
<
/
div
>
{
(
item
.
dbType
===
'Dir'
)
?
<
FolderAddOutlined
className=
'rounded-full'
style=
{
{
fontSize
:
'1.5em'
}
}
/>
:
<
FileOutlined
className=
'rounded-full'
style=
{
{
fontSize
:
'1.5em'
}
}
/>
}
>
<
div
className=
'text-center textOverflow'
title=
{
item
.
tableModelCount
}
>
{
item
.
tableModelCount
}
</
div
>
</
Card
>
:
<
Card
hoverable
onClick
=
{
this
.
onItemClick
}
title
=
{
<
div
className
=
'flex pointer'
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
FileOutlined
className=
'mr-3'
/>
<
span
>
{
assetCnName
||
''
}
</
span
>
</
cite
>
</
div
>
}
// headStyle=
{
{
backgroundColor
:
colors
[
index
%
colors
.
length
]
}
}
>
<
div
className=
'text-center textOverflow'
title=
{
assetName
||
''
}
>
{
assetName
||
''
}
</
div
>
<
div
className=
'text-center textOverflow'
title=
{
content
}
>
{
content
}
</
div
>
</
Card
>
)
}
</
div
>
);
}
...
...
src/view/Manage/Map/MapContent.jsx
View file @
d0a3ee91
...
...
@@ -88,15 +88,7 @@ class MapContent extends React.Component {
item
.
text
=
item
.
dirName
||
''
;
item
.
id
=
`d
${
parentDirId
}${
item
.
dirId
||
''
}${
index
}
`
;
}
else
{
let
assetCnName
=
''
;
(
item
.
elements
||
[]).
forEach
(
element
=>
{
if
(
element
.
name
===
'中文名称'
)
{
assetCnName
=
element
.
value
;
}
})
item
.
text
=
assetCnName
||
''
;
item
.
text
=
item
.
cnName
||
''
;
item
.
id
=
`t
${
parentDirId
}${
item
.
id
||
''
}${
index
}
`
;
}
...
...
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