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
5c4f848b
Commit
5c4f848b
authored
Mar 30, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据地图问题修改
parent
de0be0e4
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
108 additions
and
26 deletions
+108
-26
index.less
src/index.less
+13
-1
axios.js
src/util/axios.js
+3
-0
Relation.jsx
src/view/Manage/Map/Component/Relation.jsx
+0
-2
SquareItem.jsx
src/view/Manage/Map/Component/SquareItem.jsx
+4
-2
SquareItem.less
src/view/Manage/Map/Component/SquareItem.less
+14
-0
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+9
-4
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+38
-0
ImportActionIndex.jsx
src/view/Manage/Model/Component/ImportActionIndex.jsx
+11
-7
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+16
-10
No files found.
src/index.less
View file @
5c4f848b
...
...
@@ -62,11 +62,23 @@ code {
color: white;
}
div[id^='__qiankun_microapp_wrapper_'] {
height: 100%;
}
//ant design
.ant-layout {
background-color: #eee !important;
}
.ant-tabs-content {
.yy-tabs-content-holder {
height: 100% !important;
}
.yy-tabs-content {
height: 100% !important;
overflow: auto !important;
}
src/util/axios.js
View file @
5c4f848b
...
...
@@ -89,7 +89,10 @@ export const SetSource = function (source) {
const
callback
=
resp
=>
{
if
(
resp
.
status
===
401
)
{
message
.
warning
(
"session过期,请重新登录!"
);
//外网
window
.
location
.
href
=
"/center-home/view/login"
//内网
// window.location.href="/api/auth/login"
return
null
;
}
else
if
(
resp
.
status
!==
200
)
{
...
...
src/view/Manage/Map/Component/Relation.jsx
View file @
5c4f848b
...
...
@@ -45,7 +45,6 @@ class Relation extends React.Component {
componentDidMount
()
{
const
{
type
,
loadMoreData
}
=
this
.
props
;
setTimeout
(()
=>
{
const
container
=
document
.
getElementById
(
`container
${
type
||
''
}
`
);
if
(
!
container
)
return
;
...
...
@@ -222,7 +221,6 @@ class Relation extends React.Component {
graph
.
changeSize
(
container
.
scrollWidth
,
container
.
scrollHeight
);
};
}
},
100
);
}
...
...
src/view/Manage/Map/Component/SquareItem.jsx
View file @
5c4f848b
import
React
from
'react'
;
import
{
Card
}
from
'antd'
;
import
'./SquareItem.less'
;
class
SquareItem
extends
React
.
Component
{
onItemClick
=
()
=>
{
...
...
@@ -18,7 +20,7 @@ class SquareItem extends React.Component {
render
()
{
const
{
item
}
=
this
.
props
;
return
(
<>
<
div
className=
'map-square-item'
>
{
item
&&
(
item
.
dbType
===
'Dir'
?
<
Card
title=
{
...
...
@@ -38,7 +40,7 @@ class SquareItem extends React.Component {
</
Card
>
)
}
</>
</
div
>
);
}
}
...
...
src/view/Manage/Map/Component/SquareItem.less
0 → 100644
View file @
5c4f848b
.map-square-item {
.yy-card-head {
background-color: #ff4d4f !important;
.yy-card-head-title {
color: #fff !important;
:hover {
color: #1890ff;
}
}
}
}
\ No newline at end of file
src/view/Manage/Model/Component/ImportAction.jsx
View file @
5c4f848b
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Alert
}
from
'antd'
;
import
ImportActionHeader
from
'./ImportActionHeader'
;
import
ImportActionTable
from
'./ImportActionTable'
;
import
ImportActionIndex
from
'./ImportActionIndex'
;
...
...
@@ -21,7 +22,8 @@ for (let i = 0; i < 20; i++) {
});
}
const
ImportAction
=
()
=>
{
const
ImportAction
=
(
props
)
=>
{
const
{
action
}
=
props
;
const
[
tableData
,
setTableData
]
=
useState
([...
originData
]);
const
[
indexData
,
setIndexData
]
=
useState
([]);
const
[
fileds
,
setFileds
]
=
useState
([]);
...
...
@@ -61,14 +63,17 @@ const ImportAction = () => {
return
(
<>
<
Alert
{
<
ImportActionHeader
editable=
{
action
!==
'detail'
}
/>
}
{
action
!==
'detail'
&&
<
Alert
message=
"表格可以通过拖拽来排序"
type=
"info"
closable
className=
'mb-3'
/>
<
ImportActionTable
data=
{
tableData
}
onChange=
{
onTableChange
}
/>
<
ImportActionIndex
data=
{
indexData
}
fileds=
{
fileds
}
onChange=
{
onIndexChange
}
/>
}
<
ImportActionTable
data=
{
tableData
}
onChange=
{
onTableChange
}
editable=
{
action
!==
'detail'
}
/>
<
ImportActionIndex
data=
{
indexData
}
fileds=
{
fileds
}
onChange=
{
onIndexChange
}
editable=
{
action
!==
'detail'
}
/>
</>
);
};
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
0 → 100644
View file @
5c4f848b
import
React
from
'react'
;
import
{
Form
,
Input
,
Row
,
Col
}
from
'antd'
;
const
ImportActionHeader
=
(
props
)
=>
{
const
{
editable
}
=
props
;
return
(
<
Form
// {...layout}
name=
"basic"
>
<
Row
gutter=
{
10
}
>
<
Col
span=
{
12
}
>
<
Form
.
Item
label=
"模型名称"
name=
"name"
rules=
{
[{
required
:
true
,
message
:
'请输入模型名称!'
}]
}
>
<
Input
disabled=
{
editable
}
/>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
12
}
>
<
Form
.
Item
label=
"模型描述"
name=
"desc"
disabled=
{
editable
}
rules=
{
[{
required
:
true
,
message
:
'请输入模型描述!'
}]
}
>
<
Input
disabled=
{
editable
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Form
>
)
}
export
default
ImportActionHeader
;
\ No newline at end of file
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
5c4f848b
...
...
@@ -6,7 +6,7 @@ import update from 'immutability-helper';
const
{
Option
}
=
Select
;
const
type
=
'DragableBodyRow'
;
const
type
=
'Dragable
Index
BodyRow'
;
const
modes
=
[
'主键索引'
,
...
...
@@ -127,7 +127,7 @@ const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) =>
};
const
ImportActionIndex
=
(
props
)
=>
{
const
{
data
,
fileds
,
onChange
}
=
props
;
const
{
data
,
fileds
,
onChange
,
editable
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
editingKey
,
setEditingKey
]
=
useState
(
''
);
const
[
suggests
,
setSuggests
]
=
useState
([]);
...
...
@@ -245,8 +245,10 @@ const ImportActionIndex = (props) => {
title
:
'操作'
,
dataIndex
:
'action'
,
render
:
(
_
,
record
)
=>
{
const
editable
=
isEditing
(
record
);
return
editable
?
(
if
(
!
editable
)
return
null
;
return
isEditing
(
record
)
?
(
<>
<
Typography
.
Link
className=
'mr-3'
disabled=
{
editingKey
===
''
}
onClick=
{
()
=>
save
()
}
>
保存
...
...
@@ -307,9 +309,11 @@ const ImportActionIndex = (props) => {
return
(
<>
<
Divider
>
数据表索引
</
Divider
>
<
div
className=
'd-flex mb-3'
>
{
editable
&&
<
div
className=
'd-flex mb-3'
>
<
Button
type=
"primary"
onClick=
{
onAddClick
}
style=
{
{
marginLeft
:
'auto'
}
}
disabled=
{
editingKey
!==
''
}
>
新增行
</
Button
>
</
div
>
}
<
DndProvider
backend=
{
HTML5Backend
}
>
<
Form
form=
{
form
}
component=
{
false
}
>
<
Table
...
...
@@ -317,11 +321,11 @@ const ImportActionIndex = (props) => {
body
:
{
cell
:
EditableCell
,
//编辑状态下不允许拖动
row
:
editingKey
===
''
?
DragableBodyRow
:
null
,
row
:
(
editable
&&
editingKey
===
''
)
?
DragableBodyRow
:
null
,
},
}
}
onRow=
{
(
record
,
index
)
=>
{
if
(
editingKey
!==
''
)
return
null
;
if
(
!
editable
||
editingKey
!==
''
)
return
null
;
return
{
index
,
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
5c4f848b
...
...
@@ -4,7 +4,7 @@ import { DndProvider, useDrag, useDrop } from 'react-dnd';
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
import
update
from
'immutability-helper'
;
const
type
=
'DragableBodyRow'
;
const
type
=
'Dragable
Table
BodyRow'
;
const
EditableCell
=
({
editing
,
...
...
@@ -91,7 +91,7 @@ const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) =>
};
const
ImportActionTable
=
(
props
)
=>
{
const
{
data
,
onChange
}
=
props
;
const
{
data
,
onChange
,
editable
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
editingKey
,
setEditingKey
]
=
useState
(
''
);
const
[
recommends
,
setRecommends
]
=
useState
([]);
...
...
@@ -100,7 +100,8 @@ const ImportActionTable = (props) => {
const
isEditing
=
(
record
)
=>
record
.
key
===
editingKey
;
const
onAddClick
=
()
=>
{
const
newData
=
[{},
...
data
];
//test
const
newData
=
[{
key
:
-
1
},
...
data
];
onChange
&&
onChange
(
newData
);
edit
(
newData
[
0
]);
...
...
@@ -128,9 +129,11 @@ const ImportActionTable = (props) => {
const
cancel
=
()
=>
{
const
newData
=
[...
data
];
const
item
=
newData
[
editingKey
];
const
index
=
newData
.
findIndex
((
item
)
=>
editingKey
===
item
.
key
);
const
item
=
newData
[
index
];
if
(
!
item
.
name
||
item
.
name
===
''
)
{
newData
.
splice
(
editingKey
,
1
);
newData
.
splice
(
index
,
1
);
onChange
&&
onChange
(
newData
);
}
...
...
@@ -283,8 +286,9 @@ const ImportActionTable = (props) => {
title
:
'操作'
,
dataIndex
:
'action'
,
render
:
(
_
,
record
)
=>
{
const
editable
=
isEditing
(
record
);
return
editable
?
(
if
(
!
editable
)
return
null
;
return
isEditing
(
record
)
?
(
<>
<
Typography
.
Link
className=
'mr-3'
disabled=
{
editingKey
===
''
}
onClick=
{
()
=>
save
()
}
>
保存
...
...
@@ -344,9 +348,11 @@ const ImportActionTable = (props) => {
return
(
<>
<
Divider
>
数据表结构
</
Divider
>
<
div
className=
'd-flex mb-3'
>
{
editable
&&
<
div
className=
'd-flex mb-3'
>
<
Button
type=
"primary"
onClick=
{
onAddClick
}
style=
{
{
marginLeft
:
'auto'
}
}
disabled=
{
editingKey
!==
''
}
>
新增行
</
Button
>
</
div
>
}
<
DndProvider
backend=
{
HTML5Backend
}
>
<
Form
form=
{
form
}
component=
{
false
}
onValuesChange=
{
onValuesChange
}
>
<
Table
...
...
@@ -354,11 +360,11 @@ const ImportActionTable = (props) => {
body
:
{
cell
:
EditableCell
,
//编辑状态下不允许拖动
row
:
editingKey
===
''
?
DragableBodyRow
:
null
,
row
:
(
editable
&&
editingKey
===
''
)
?
DragableBodyRow
:
null
,
},
}
}
onRow=
{
(
record
,
index
)
=>
{
if
(
editingKey
!==
''
)
return
null
;
if
(
!
editable
||
editingKey
!==
''
)
return
null
;
return
{
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