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
ce8a601b
Commit
ce8a601b
authored
Jul 07, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整模型
parent
f75ac5e7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
48 deletions
+69
-48
index.js
src/util/index.js
+2
-2
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+12
-25
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+52
-18
ImportActionIndex.jsx
src/view/Manage/Model/Component/ImportActionIndex.jsx
+1
-1
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+1
-1
index.jsx
src/view/Manage/Model/index.jsx
+1
-1
No files found.
src/util/index.js
View file @
ce8a601b
...
@@ -184,8 +184,8 @@ function highlightSearchContent(content) {
...
@@ -184,8 +184,8 @@ function highlightSearchContent(content) {
}
}
export
function
highlightSearchContentByTerms
(
content
,
terms
)
{
export
function
highlightSearchContentByTerms
(
content
,
terms
)
{
if
(
content
===
null
||
content
===
''
)
return
''
;
if
(
!
content
||
content
===
''
)
return
''
;
if
((
terms
||
[]).
length
===
0
)
return
content
;
if
((
terms
||
[]).
length
===
0
||
typeof
(
content
)
!==
'string'
)
return
content
;
let
processContent
=
content
;
let
processContent
=
content
;
(
terms
||
[]).
forEach
(
term
=>
{
(
terms
||
[]).
forEach
(
term
=>
{
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
ce8a601b
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
S
elect
,
S
pin
}
from
'antd'
;
import
{
Spin
}
from
'antd'
;
import
ImportActionHeader
from
'./ImportActionHeader'
;
import
ImportActionHeader
from
'./ImportActionHeader'
;
import
ImportActionTable
from
'./ImportActionTable'
;
import
ImportActionTable
from
'./ImportActionTable'
;
...
@@ -7,8 +7,6 @@ import ImportActionIndex from './ImportActionIndex';
...
@@ -7,8 +7,6 @@ import ImportActionIndex from './ImportActionIndex';
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
import
{
dispatchLatest
,
dispatch
}
from
'../../../../model'
;
const
{
Option
}
=
Select
;
const
ImportAction
=
(
props
)
=>
{
const
ImportAction
=
(
props
)
=>
{
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
}
=
props
;
const
{
action
,
hints
,
onChange
,
form
,
modelerId
,
terms
}
=
props
;
...
@@ -31,7 +29,8 @@ const ImportAction = (props) => {
...
@@ -31,7 +29,8 @@ const ImportAction = (props) => {
cnName
:
''
,
cnName
:
''
,
name
:
''
,
name
:
''
,
remark
:
''
,
remark
:
''
,
easyDataModelerModelingTemplate
:
''
easyDataModelerModelingConstraint
:
''
,
easyDataModelerModelingTemplate
:
''
,
});
});
}
}
...
@@ -75,6 +74,7 @@ const ImportAction = (props) => {
...
@@ -75,6 +74,7 @@ const ImportAction = (props) => {
cnName
:
data
.
cnName
||
''
,
cnName
:
data
.
cnName
||
''
,
name
:
data
.
name
||
''
,
name
:
data
.
name
||
''
,
remark
:
data
.
remark
||
''
,
remark
:
data
.
remark
||
''
,
easyDataModelerModelingConstraint
:
data
.
easyDataModelerModelingConstraint
||
''
,
easyDataModelerModelingTemplate
:
data
.
easyDataModelerModelingTemplate
||
''
easyDataModelerModelingTemplate
:
data
.
easyDataModelerModelingTemplate
||
''
});
});
onChange
&&
onChange
(
data
||
{});
onChange
&&
onChange
(
data
||
{});
...
@@ -120,6 +120,7 @@ const ImportAction = (props) => {
...
@@ -120,6 +120,7 @@ const ImportAction = (props) => {
cnName
:
data
.
cnName
||
''
,
cnName
:
data
.
cnName
||
''
,
name
:
data
.
name
||
''
,
name
:
data
.
name
||
''
,
remark
:
data
.
remark
||
''
,
remark
:
data
.
remark
||
''
,
easyDataModelerModelingConstraint
:
data
.
easyDataModelerModelingConstraint
||
''
,
easyDataModelerModelingTemplate
:
data
.
easyDataModelerModelingTemplate
||
''
easyDataModelerModelingTemplate
:
data
.
easyDataModelerModelingTemplate
||
''
});
});
}
}
...
@@ -143,6 +144,9 @@ const ImportAction = (props) => {
...
@@ -143,6 +144,9 @@ const ImportAction = (props) => {
if
(
!
currentConstraint
)
return
;
if
(
!
currentConstraint
)
return
;
form
.
setFieldsValue
({
easyDataModelerModelingConstraint
:
currentConstraint
});
const
newModelerData
=
{...
modelerData
,
easyDataModelerModelingConstraint
:
currentConstraint
};
const
newModelerData
=
{...
modelerData
,
easyDataModelerModelingConstraint
:
currentConstraint
};
setModelerData
(
newModelerData
)
setModelerData
(
newModelerData
)
onChange
&&
onChange
(
newModelerData
);
onChange
&&
onChange
(
newModelerData
);
...
@@ -254,27 +258,15 @@ const ImportAction = (props) => {
...
@@ -254,27 +258,15 @@ const ImportAction = (props) => {
}
}
const
container
=
(<>
const
container
=
(<>
{
<
div
className=
'd-flex mb-5'
style=
{
{
alignItems
:
'center'
}
}
>
<
span
style=
{
{
marginLeft
:
'auto'
}
}
>
规范:
</
span
>
<
Select
className=
'ml-3'
value=
{
constraint
.
name
?
constraint
.
name
:
null
}
placeholder=
'请选择规范'
style=
{
{
minWidth
:
100
}
}
onChange=
{
onConstraintChange
}
disabled=
{
action
===
'detail'
}
>
{
(
constraints
||
[]).
map
((
constraint
,
index
)
=>
{
return
(
<
Option
key=
{
index
}
value=
{
constraint
.
name
}
>
{
constraint
.
cnName
||
''
}
</
Option
>
)
})
}
</
Select
>
</
div
>
}
<
ImportActionHeader
<
ImportActionHeader
form=
{
form
}
form=
{
form
}
editable=
{
action
!==
'detail'
}
editable=
{
action
!==
'detail'
}
modelerData=
{
modelerData
||
{}
}
modelerData=
{
modelerData
||
{}
}
constraints=
{
constraints
}
templates=
{
templates
}
templates=
{
templates
}
validateReports=
{
validateReports
}
validateReports=
{
validateReports
}
onTemplateChange=
{
onTemplateChange
}
onTemplateChange=
{
onTemplateChange
}
onConstraintChange=
{
onConstraintChange
}
onChange=
{
onHeaderChange
}
onChange=
{
onHeaderChange
}
terms=
{
terms
}
terms=
{
terms
}
/>
/>
...
@@ -300,14 +292,9 @@ const ImportAction = (props) => {
...
@@ -300,14 +292,9 @@ const ImportAction = (props) => {
</>);
</>);
return
(
return
(
<>
<
Spin
spinning=
{
loading
}
>
{
//container包裹在Spin中,会有谷歌浏览器字段排序拖动不能滚动鼠标的问题,所以加载完成后,直接展示container
loading
?
<
Spin
spinning=
{
loading
}
>
{
container
}
{
container
}
</
Spin
>
:
container
</
Spin
>
}
</>
);
);
};
};
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
ce8a601b
...
@@ -6,6 +6,26 @@ import { dispatch } from '../../../../model';
...
@@ -6,6 +6,26 @@ import { dispatch } from '../../../../model';
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
ConstraintSelect
=
({
value
=
{},
constraints
=
[],
onChange
,
...
restProps
})
=>
{
return
(
<
Select
onChange=
{
onChange
}
value=
{
value
.
name
||
''
}
placeholder=
'请选择规范'
{
...
restProps
}
>
{
(
constraints
||
[])
&&
constraints
.
map
((
constraint
,
index
)
=>
{
return
(
<
Option
key=
{
index
}
value=
{
constraint
.
name
||
''
}
>
{
constraint
.
cnName
||
''
}
</
Option
>
);
})
}
</
Select
>
)
}
const
TemplateSelect
=
({
value
=
{},
templates
=
[],
onChange
,
...
restProps
})
=>
{
const
TemplateSelect
=
({
value
=
{},
templates
=
[],
onChange
,
...
restProps
})
=>
{
return
(
return
(
...
@@ -27,7 +47,7 @@ const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps })
...
@@ -27,7 +47,7 @@ const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps })
}
}
const
ImportActionHeader
=
(
props
)
=>
{
const
ImportActionHeader
=
(
props
)
=>
{
const
{
editable
,
form
,
modelerData
,
templates
,
onTemplateChange
,
validateReports
,
onChange
,
terms
}
=
props
;
const
{
editable
,
form
,
modelerData
,
constraints
,
templates
,
onConstraintChange
,
onTemplateChange
,
validateReports
,
onChange
,
terms
}
=
props
;
const
[
causes
,
setCauses
]
=
useState
([]);
const
[
causes
,
setCauses
]
=
useState
([]);
const
[
options
,
setOptions
]
=
useState
([]);
const
[
options
,
setOptions
]
=
useState
([]);
...
@@ -56,11 +76,11 @@ const ImportActionHeader = (props) => {
...
@@ -56,11 +76,11 @@ const ImportActionHeader = (props) => {
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
labelCol
:
{
xs
:
{
span
:
24
},
xs
:
{
span
:
24
},
sm
:
{
span
:
5
},
sm
:
{
span
:
6
},
},
},
wrapperCol
:
{
wrapperCol
:
{
xs
:
{
span
:
24
},
xs
:
{
span
:
24
},
sm
:
{
span
:
1
9
},
sm
:
{
span
:
1
8
},
},
},
};
};
...
@@ -117,7 +137,7 @@ const ImportActionHeader = (props) => {
...
@@ -117,7 +137,7 @@ const ImportActionHeader = (props) => {
onValuesChange=
{
onValuesChange
}
onValuesChange=
{
onValuesChange
}
>
>
<
Row
gutter=
{
10
}
>
<
Row
gutter=
{
10
}
>
<
Col
span=
{
12
}
>
<
Col
span=
{
8
}
>
<
Form
.
Item
<
Form
.
Item
label=
"中文名称"
label=
"中文名称"
name=
"cnName"
name=
"cnName"
...
@@ -127,7 +147,7 @@ const ImportActionHeader = (props) => {
...
@@ -127,7 +147,7 @@ const ImportActionHeader = (props) => {
<
Input
/>
<
Input
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
12
}
>
<
Col
span=
{
8
}
>
<
Form
.
Item
<
Form
.
Item
label=
"英文名称"
label=
"英文名称"
name=
"name"
name=
"name"
...
@@ -138,9 +158,33 @@ const ImportActionHeader = (props) => {
...
@@ -138,9 +158,33 @@ const ImportActionHeader = (props) => {
{
/* <Input /> */
}
{
/* <Input /> */
}
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
8
}
>
<
Form
.
Item
label=
"描述"
name=
"remark"
labelAlign=
"left"
rules=
{
[{
required
:
true
,
message
:
'请输入描述!'
}]
}
>
<
Input
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Row
>
<
Row
gutter=
{
10
}
>
<
Row
gutter=
{
10
}
>
<
Col
span=
{
12
}
>
<
Col
span=
{
8
}
>
<
Form
.
Item
label=
"规范"
name=
"easyDataModelerModelingConstraint"
labelAlign=
"left"
rules=
{
[{
required
:
true
,
message
:
'请选择规范!'
}]
}
>
<
ConstraintSelect
constraints=
{
constraints
}
onChange=
{
onConstraintChange
}
style=
{
{
width
:
150
}
}
/>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
8
}
>
<
Form
.
Item
<
Form
.
Item
label=
"数据表类型"
label=
"数据表类型"
name=
"easyDataModelerModelingTemplate"
name=
"easyDataModelerModelingTemplate"
...
@@ -154,16 +198,6 @@ const ImportActionHeader = (props) => {
...
@@ -154,16 +198,6 @@ const ImportActionHeader = (props) => {
/>
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
12
}
>
<
Form
.
Item
label=
"描述"
name=
"remark"
labelAlign=
"left"
rules=
{
[{
required
:
true
,
message
:
'请输入描述!'
}]
}
>
<
Input
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Row
>
</
Form
>
</
Form
>
)
:
(
)
:
(
...
@@ -185,9 +219,9 @@ const ImportActionHeader = (props) => {
...
@@ -185,9 +219,9 @@ const ImportActionHeader = (props) => {
</
div
>
</
div
>
}
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"数据表类型"
>
{
modelerData
.
easyDataModelerModelingTemplate
?(
modelerData
.
easyDataModelerModelingTemplate
.
cnName
||
''
):
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"描述"
>
{
highlightSearchContentByTerms
(
modelerData
.
remark
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"描述"
>
{
highlightSearchContentByTerms
(
modelerData
.
remark
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"规范"
>
{
modelerData
.
easyDataModelerModelingConstraint
?(
modelerData
.
easyDataModelerModelingConstraint
.
cnName
||
''
):
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"数据表类型"
>
{
modelerData
.
easyDataModelerModelingTemplate
?(
modelerData
.
easyDataModelerModelingTemplate
.
cnName
||
''
):
''
}
</
Descriptions
.
Item
>
</
Descriptions
>
</
Descriptions
>
)
)
)
)
...
...
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
ce8a601b
...
@@ -652,7 +652,7 @@ const ImportActionIndex = (props) => {
...
@@ -652,7 +652,7 @@ const ImportActionIndex = (props) => {
return
(
return
(
<
div
className=
'model-import-action-index mt-7'
>
<
div
className=
'model-import-action-index mt-7'
>
<
Divider
>
<
Divider
orientation=
'left'
>
<>
<>
<
span
>
数据表索引
</
span
>
<
span
>
数据表索引
</
span
>
{
editable
&&
(
{
editable
&&
(
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
ce8a601b
...
@@ -742,7 +742,7 @@ const ImportActionTable = (props) => {
...
@@ -742,7 +742,7 @@ const ImportActionTable = (props) => {
return
(
return
(
<
div
className=
'model-import-action-table'
>
<
div
className=
'model-import-action-table'
>
<
Divider
>
<
Divider
orientation=
'left'
>
<>
<>
<
span
>
数据表结构
</
span
>
<
span
>
数据表结构
</
span
>
{
editable
&&
(
{
editable
&&
(
...
...
src/view/Manage/Model/index.jsx
View file @
ce8a601b
...
@@ -279,7 +279,7 @@ class Model extends React.Component {
...
@@ -279,7 +279,7 @@ class Model extends React.Component {
</
div
>
</
div
>
<
div
className=
'p-3'
>
<
div
className=
'p-3'
>
{
{
loadingTableData
?
<
Spin
load
ing=
{
loadingTableData
}
>
loadingTableData
?
<
Spin
spinn
ing=
{
loadingTableData
}
>
{
content
}
{
content
}
</
Spin
>
:
content
</
Spin
>
:
content
}
}
...
...
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