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
5c2b15f7
Commit
5c2b15f7
authored
Feb 17, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存字段时判断重点关注
parent
e73e379c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
20 deletions
+55
-20
index.less
src/index.less
+3
-1
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+11
-14
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+30
-3
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+3
-2
No files found.
src/index.less
View file @
5c2b15f7
...
...
@@ -11,7 +11,9 @@ body {
margin: 0;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-variant: tabular-nums;
line-height: 1.5;
background-color: #fff;
...
...
src/model/datamodel.js
View file @
5c2b15f7
...
...
@@ -162,6 +162,10 @@ export function* suggest(payload) {
return
yield
call
(
datamodelerService
.
suggest
,
payload
);
}
export
function
*
preSaveDataModel
(
payload
)
{
return
yield
call
(
datamodelerService
.
preSaveDataModel
,
payload
);
}
export
function
*
saveDataModel
(
payload
)
{
return
yield
call
(
datamodelerService
.
saveDataModel
,
payload
);
}
...
...
src/service/datamodeler.js
View file @
5c2b15f7
...
...
@@ -116,6 +116,10 @@ export function suggest(payload) {
return
PostJSON
(
"/datamodeler/easyDataModelerDesign/suggest"
,
payload
);
}
export
function
preSaveDataModel
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/preSaveDataModel"
,
payload
);
}
//保存模型
export
function
saveDataModel
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/saveDataModel"
,
payload
);
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
5c2b15f7
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Input
,
Row
,
Col
,
Descriptions
,
Select
,
AutoComplete
,
Button
}
from
'antd'
;
import
{
Form
,
Input
,
Row
,
Col
,
Descriptions
,
Select
,
AutoComplete
,
Button
,
Divider
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
highlightSearchContentByTerms
,
generateUUID
}
from
'../../../../util'
;
...
...
@@ -48,7 +48,7 @@ const ConstraintSelect = ({ value = {}, constraints = [], onChange, ...restProps
return
(
<
Select
onChange=
{
onChange
}
value=
{
value
.
name
||
''
}
value=
{
value
?
.
name
||
''
}
placeholder=
'请选择规范'
{
...
restProps
}
>
...
...
@@ -569,16 +569,22 @@ const ImportActionHeader = (props) => {
name=
"remark"
labelAlign=
"left"
rules=
{
[{
required
:
true
,
message
:
'请输入数据内容!'
}]
}
style=
{
{
marginBottom
:
15
}
}
>
<
TextArea
row=
{
4
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
{
!
onlyShowRequireChange
&&
<
Divider
style=
{
{
margin
:
'0 0 15px'
}
}
/>
}
{
!
onlyShowRequireChange
&&
<
Row
gutter=
{
10
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"生成表类型"
name=
"easyDataModelerModelingTemplate"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
rules=
{
[{
required
:
false
,
message
:
'请选择生成表类型!'
}]
}
>
<
TemplateSelect
...
...
@@ -592,7 +598,6 @@ const ImportActionHeader = (props) => {
label=
"数据表类型"
name=
"tableType"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
Input
/>
</
Form
.
Item
>
...
...
@@ -602,7 +607,6 @@ const ImportActionHeader = (props) => {
label=
"数据平台"
name=
"dataResidence"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
Input
disabled=
{
true
}
/>
</
Form
.
Item
>
...
...
@@ -612,7 +616,6 @@ const ImportActionHeader = (props) => {
label=
"数据情况"
name=
"dataCircumstances"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
Input
/>
</
Form
.
Item
>
...
...
@@ -622,7 +625,6 @@ const ImportActionHeader = (props) => {
label=
"分布键"
name=
"easyDataModelerDistributionKey"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
AttributesSelect
modelerData=
{
modelerData
}
/>
</
Form
.
Item
>
...
...
@@ -632,7 +634,6 @@ const ImportActionHeader = (props) => {
label=
"分区键"
name=
"partition"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
PartitionSelect
modelerData=
{
modelerData
}
partitionTypes=
{
supportedPartitionTypes
}
/>
</
Form
.
Item
>
...
...
@@ -642,7 +643,6 @@ const ImportActionHeader = (props) => {
label=
"主键"
name=
"easyDataModelerPrimaryKey"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
AttributesSelect
modelerData=
{
modelerData
}
/>
</
Form
.
Item
>
...
...
@@ -652,7 +652,6 @@ const ImportActionHeader = (props) => {
label=
"类主键"
name=
"easyDataModelerSemiPrimaryKey"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
AttributesSelect
modelerData=
{
modelerData
}
mode=
'tags'
/>
</
Form
.
Item
>
...
...
@@ -662,7 +661,6 @@ const ImportActionHeader = (props) => {
label=
"加载方式"
name=
"dataLoadingStrategy"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
LoadSelect
/>
</
Form
.
Item
>
...
...
@@ -672,7 +670,6 @@ const ImportActionHeader = (props) => {
label=
"更新时间"
name=
"dataUpdatingTiming"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
UpdateSelect
/>
</
Form
.
Item
>
...
...
@@ -682,12 +679,12 @@ const ImportActionHeader = (props) => {
label=
"维护历史"
name=
"maintenanceRecords"
labelAlign=
"left"
hidden=
{
onlyShowRequireChange
}
>
<
Input
disabled=
{
true
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Row
>
}
</
Form
>
)
:
(
<
Descriptions
column=
{
3
}
>
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
5c2b15f7
...
...
@@ -9,7 +9,7 @@ import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"
import
ResizeObserver
from
'rc-resize-observer'
;
import
{
generateUUID
,
highlightSearchContentByTerms
,
showMessage
,
inputWidth
,
paginate
}
from
'../../../../util'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatch
,
dispatch
Latest
}
from
'../../../../model'
;
import
{
addEventListenerForSidebar
,
removeEventListenerForSidebar
}
from
'./Help'
;
import
{
AppContext
}
from
'../../../../App'
;
import
DebounceInput
from
'./DebounceInput'
;
...
...
@@ -462,6 +462,25 @@ const ImportActionTable = (props) => {
}
}
const
preSaveDataModel
=
(
attribute
)
=>
{
dispatch
({
type
:
'datamodel.preSaveDataModel'
,
payload
:
{
data
:
attribute
},
callback
:
remoteData
=>
{
const
newData
=
[...
data
];
const
index
=
(
newData
||
[]).
findIndex
((
item
)
=>
attribute
.
iid
===
item
.
iid
);
if
(
index
!==
-
1
)
{
newData
.
splice
(
index
,
1
,
remoteData
);
moveRowRef
.
current
.
data
=
newData
;
onChange
&&
onChange
(
newData
,
false
);
}
},
})
}
const
save
=
async
()
=>
{
try
{
...
...
@@ -500,19 +519,27 @@ const ImportActionTable = (props) => {
return
;
}
let
attribute
=
{};
if
(
index
===
-
1
)
{
newData
.
splice
(
insertIndex
,
0
,
{...
row
,
iid
:
editingKey
,
modelingTemplateTag
:
null
});
attribute
=
{...
row
,
iid
:
editingKey
,
modelingTemplateTag
:
null
};
newData
.
splice
(
insertIndex
,
0
,
attribute
);
}
else
{
const
item
=
newData
[
index
];
newData
.
splice
(
index
,
1
,
{
...
item
,
...
row
,
modelingTemplateTag
:
null
});
attribute
=
{
...
item
,
...
row
,
modelingTemplateTag
:
null
};
newData
.
splice
(
index
,
1
,
attribute
);
}
moveRowRef
.
current
.
data
=
newData
;
onChange
&&
onChange
(
newData
,
true
);
if
(
!
attribute
.
needAttention
)
{
preSaveDataModel
(
attribute
);
}
setEditingKey
(
''
);
setSuggests
([]);
setEnglishSuggests
([]);
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
5c2b15f7
...
...
@@ -637,7 +637,7 @@ const ModelTable = (props) => {
);
}
let
disableEdit
=
false
,
disableDelete
=
false
,
editTip
=
''
,
deleteTip
=
''
;
let
disableEdit
=
false
,
disableDelete
=
false
,
editTip
=
''
,
deleteTip
=
''
,
editMenuTitle
=
'编辑'
;
if
(
!
currentItem
?.
editable
&&
currentItem
?.
state
?.
id
!==
'4'
)
{
disableEdit
=
true
;
...
...
@@ -650,6 +650,7 @@ const ModelTable = (props) => {
if
(
!
currentItem
?.
permitCheckOut
&&
currentItem
?.
state
?.
id
===
'4'
)
{
disableEdit
=
true
;
editTip
=
`
${
currentItem
.
holder
||
''
}
正在编辑中, 不允许再编辑`
;
editMenuTitle
=
`编辑(
${
currentItem
.
holder
||
''
}
正在编辑中)`
;
}
if
(
!
currentItem
?.
deletable
)
{
...
...
@@ -718,7 +719,7 @@ const ModelTable = (props) => {
<
RcMenu
id=
{
MENU_ID
}
>
<
RcItem
id=
"edit"
disabled=
{
disableEdit
}
onClick=
{
handleItemClick
}
>
<
Tooltip
title=
{
editTip
}
>
编辑
{
editMenuTitle
}
</
Tooltip
>
</
RcItem
>
<
RcItem
id=
"delete"
disabled=
{
disableDelete
}
onClick=
{
handleItemClick
}
>
...
...
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