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
47722fe4
Commit
47722fe4
authored
Jan 26, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
维护历史
parent
ea0e0d48
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
21 deletions
+69
-21
datamodel.js
src/model/datamodel.js
+5
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+42
-3
ImportActionIndex.jsx
src/view/Manage/Model/Component/ImportActionIndex.jsx
+3
-0
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+15
-18
No files found.
src/model/datamodel.js
View file @
47722fe4
...
@@ -281,3 +281,7 @@ export function* isSetRootDomainId() {
...
@@ -281,3 +281,7 @@ export function* isSetRootDomainId() {
export
function
*
setRootDomainId
(
payload
)
{
export
function
*
setRootDomainId
(
payload
)
{
return
yield
call
(
datamodelerService
.
setRootDomainId
,
payload
);
return
yield
call
(
datamodelerService
.
setRootDomainId
,
payload
);
}
}
export
function
*
getMaintenanceRecords
(
payload
)
{
return
yield
call
(
datamodelerService
.
getMaintenanceRecords
,
payload
);
}
\ No newline at end of file
src/service/datamodeler.js
View file @
47722fe4
...
@@ -173,6 +173,10 @@ export function setRootDomainId(payload) {
...
@@ -173,6 +173,10 @@ export function setRootDomainId(payload) {
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/setRootDomainId"
,
payload
);
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/setRootDomainId"
,
payload
);
}
}
export
function
getMaintenanceRecords
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/getMaintenanceRecords"
,
payload
);
}
export
function
ddlGenerators
()
{
export
function
ddlGenerators
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerExport/ddlGenerators"
);
return
GetJSON
(
"/datamodeler/easyDataModelerExport/ddlGenerators"
);
}
}
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
47722fe4
...
@@ -3,7 +3,7 @@ import { Form, Input, Row, Col, Descriptions, Select, AutoComplete, Button } fro
...
@@ -3,7 +3,7 @@ import { Form, Input, Row, Col, Descriptions, Select, AutoComplete, Button } fro
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
highlightSearchContentByTerms
,
generateUUID
}
from
'../../../../util'
;
import
{
highlightSearchContentByTerms
,
generateUUID
}
from
'../../../../util'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatch
,
dispatch
Latest
}
from
'../../../../model'
;
import
DebounceInput
from
'./DebounceInput'
;
import
DebounceInput
from
'./DebounceInput'
;
...
@@ -312,6 +312,7 @@ const ImportActionHeader = (props) => {
...
@@ -312,6 +312,7 @@ const ImportActionHeader = (props) => {
const
[
autoTranslate
,
setAutoTranslate
]
=
useState
(
false
);
const
[
autoTranslate
,
setAutoTranslate
]
=
useState
(
false
);
const
[
onlyShowRequireChange
,
setOnlyShowRequireChange
]
=
useState
(
true
);
const
[
onlyShowRequireChange
,
setOnlyShowRequireChange
]
=
useState
(
true
);
const
[
maintenanceRecords
,
setMaintenanceRecords
]
=
useState
(
null
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -339,6 +340,10 @@ const ImportActionHeader = (props) => {
...
@@ -339,6 +340,10 @@ const ImportActionHeader = (props) => {
setAutoTranslate
((
modelerData
.
name
||
''
)
===
''
);
setAutoTranslate
((
modelerData
.
name
||
''
)
===
''
);
if
(
modelerData
)
{
if
(
modelerData
)
{
form
?.
setFieldsValue
(
modelerData
);
form
?.
setFieldsValue
(
modelerData
);
if
((
modelerData
.
id
||
''
)
!==
''
&&
maintenanceRecords
===
null
)
{
getMaintenanceRecords
();
}
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
...
@@ -355,6 +360,20 @@ const ImportActionHeader = (props) => {
...
@@ -355,6 +360,20 @@ const ImportActionHeader = (props) => {
},
},
};
};
const
getMaintenanceRecords
=
()
=>
{
dispatch
({
type
:
'datamodel.getMaintenanceRecords'
,
payload
:
{
params
:
{
id
:
modelerData
.
id
}
},
callback
:
data
=>
{
setMaintenanceRecords
(
data
);
}
})
}
const
onSearch
=
(
searchText
)
=>
{
const
onSearch
=
(
searchText
)
=>
{
const
_searchText
=
searchText
.
replace
(
/ /g
,
''
);
const
_searchText
=
searchText
.
replace
(
/ /g
,
''
);
...
@@ -427,7 +446,7 @@ const ImportActionHeader = (props) => {
...
@@ -427,7 +446,7 @@ const ImportActionHeader = (props) => {
setOnlyShowRequireChange
(
!
onlyShowRequireChange
);
setOnlyShowRequireChange
(
!
onlyShowRequireChange
);
}
}
let
distributionDescription
=
''
,
primaryDescription
=
''
,
partitionsDescription
=
''
,
semiPrimaryDescription
=
''
;
let
distributionDescription
=
''
,
primaryDescription
=
''
,
partitionsDescription
=
''
,
semiPrimaryDescription
=
''
,
maintenanceDescription
=
''
;
if
(
!
editable
&&
modelerData
)
{
if
(
!
editable
&&
modelerData
)
{
//分布
//分布
...
@@ -479,6 +498,18 @@ const ImportActionHeader = (props) => {
...
@@ -479,6 +498,18 @@ const ImportActionHeader = (props) => {
}
}
}
}
if
((
maintenanceRecords
||
[]).
length
>
0
)
{
maintenanceRecords
.
forEach
((
record
,
index
)
=>
{
if
(
index
!==
0
)
{
maintenanceDescription
+=
'/'
;
}
maintenanceDescription
+=
record
;
})
form
.
setFieldsValue
({
maintenanceRecords
:
maintenanceDescription
});
}
return
(
return
(
<
div
className=
'model-import-action-header'
>
<
div
className=
'model-import-action-header'
>
<
div
<
div
...
@@ -692,7 +723,15 @@ const ImportActionHeader = (props) => {
...
@@ -692,7 +723,15 @@ const ImportActionHeader = (props) => {
<
Descriptions
.
Item
label=
"类主键"
>
{
highlightSearchContentByTerms
(
semiPrimaryDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"类主键"
>
{
highlightSearchContentByTerms
(
semiPrimaryDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"加载方式"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataLoadingStrategy
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"加载方式"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataLoadingStrategy
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"更新时间"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataUpdatingTiming
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"更新时间"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataUpdatingTiming
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"维护历史"
>
{
highlightSearchContentByTerms
(
modelerData
.
maintenanceRecords
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"维护历史"
>
<
div
>
{
(
maintenanceRecords
||
[]).
map
((
record
,
index
)
=>
{
return
<
div
key=
{
index
}
>
{
record
||
''
}
</
div
>;
})
}
</
div
>
</
Descriptions
.
Item
>
</
React
.
Fragment
>
</
React
.
Fragment
>
}
}
</
Descriptions
>
</
Descriptions
>
...
...
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
47722fe4
...
@@ -889,6 +889,9 @@ const ImportActionIndex = (props) => {
...
@@ -889,6 +889,9 @@ const ImportActionIndex = (props) => {
rowClassName=
"editable-row"
rowClassName=
"editable-row"
pagination=
{
false
}
pagination=
{
false
}
sticky
sticky
scroll=
{
{
x
:
1200
}
}
/>
/>
</
Form
>
</
Form
>
</
DndProvider
>
</
DndProvider
>
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
47722fe4
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
}
from
'react'
;
import
{
Input
,
Form
,
Typography
,
Button
,
Select
,
Row
,
Col
,
Popover
,
Checkbox
,
Tooltip
,
Table
,
Pagination
,
Space
}
from
'antd'
;
import
{
Input
,
Form
,
Typography
,
Button
,
Select
,
Row
,
Col
,
Popover
,
Checkbox
,
Tooltip
,
Table
,
Pagination
,
Space
}
from
'antd'
;
import
{
CloseOutlined
,
CheckOutlined
,
PlusOutlined
,
MinusOutlined
,
QuestionCircl
eOutlined
}
from
'@ant-design/icons'
;
import
{
CloseOutlined
,
CheckOutlined
,
PlusOutlined
,
QuestionCircleOutlined
,
Delet
eOutlined
}
from
'@ant-design/icons'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
import
update
from
'immutability-helper'
;
import
update
from
'immutability-helper'
;
import
{
useClickAway
}
from
'ahooks'
;
import
{
useClickAway
}
from
'ahooks'
;
import
{
useContextMenu
,
Menu
as
RcMenu
,
Item
as
RcItem
}
from
"react-contexify"
;
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
{
generateUUID
,
highlightSearchContentByTerms
,
showMessage
,
inputWidth
,
paginate
}
from
'../../../../util'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
...
@@ -255,6 +256,7 @@ const ImportActionTable = (props) => {
...
@@ -255,6 +256,7 @@ const ImportActionTable = (props) => {
const
[
englishSuggests
,
setEnglishSuggests
]
=
useState
([]);
const
[
englishSuggests
,
setEnglishSuggests
]
=
useState
([]);
const
[
keywordCondition
,
setKeywordCondition
]
=
useState
({
keyword
:
''
,
needFilter
:
true
});
const
[
keywordCondition
,
setKeywordCondition
]
=
useState
({
keyword
:
''
,
needFilter
:
true
});
const
{
keyword
,
needFilter
}
=
keywordCondition
;
const
{
keyword
,
needFilter
}
=
keywordCondition
;
const
[
tableWidth
,
setTableWidth
]
=
useState
(
0
);
const
[
autoTranslate
,
setAutoTranslate
]
=
useState
(
false
);
const
[
autoTranslate
,
setAutoTranslate
]
=
useState
(
false
);
...
@@ -412,21 +414,8 @@ const ImportActionTable = (props) => {
...
@@ -412,21 +414,8 @@ const ImportActionTable = (props) => {
}
}
const
editLogic
=
(
record
)
=>
{
const
editLogic
=
(
record
)
=>
{
form
.
setFieldsValue
({
form
.
resetFields
();
name
:
''
,
form
.
setFieldsValue
(
record
);
cnName
:
''
,
datatype
:
null
,
nullable
:
null
,
partOfPrimaryKeyLogically
:
null
,
partOfDistributionKey
:
null
,
needAttention
:
null
,
remark
:
''
,
defaultValue
:
''
,
definition
:
''
,
foreignKey
:
null
,
valueRange
:
''
,
...
record
,
});
setEditingKey
(
record
?.
iid
);
setEditingKey
(
record
?.
iid
);
setAutoTranslate
((
record
?.
name
||
''
)
===
''
);
setAutoTranslate
((
record
?.
name
||
''
)
===
''
);
...
@@ -951,7 +940,7 @@ const ImportActionTable = (props) => {
...
@@ -951,7 +940,7 @@ const ImportActionTable = (props) => {
className='mr-3'
className='mr-3'
size='small'
size='small'
type='text'
type='text'
icon={<
MinusOutlined
/>}
icon={<
DeleteOutlined style={{ color: 'red' }}
/>}
onClick={(event) => {
onClick={(event) => {
event.stopPropagation();
event.stopPropagation();
remove(record);
remove(record);
...
@@ -1162,6 +1151,11 @@ const ImportActionTable = (props) => {
...
@@ -1162,6 +1151,11 @@ const ImportActionTable = (props) => {
</Space>
</Space>
</div>
</div>
<div className='mb-3' id="containerId" ref={tableRef}>
<div className='mb-3' id="containerId" ref={tableRef}>
<ResizeObserver
onResize={({ width }) => {
setTableWidth(width);
}}
>
<DndProvider backend={HTML5Backend} >
<DndProvider backend={HTML5Backend} >
<Form form={form} component={false} onValuesChange={onValuesChange}>
<Form form={form} component={false} onValuesChange={onValuesChange}>
<Table
<Table
...
@@ -1219,7 +1213,9 @@ const ImportActionTable = (props) => {
...
@@ -1219,7 +1213,9 @@ const ImportActionTable = (props) => {
pagination={false}
pagination={false}
sticky
sticky
scroll={{
scroll={{
x: 1500
x: 1500,
//解决屏幕尺寸窄时,字段不好横向拖动的问题
y: tableWidth>1500?'100%':450,
}}
}}
expandable={{
expandable={{
columnWidth: 0,
columnWidth: 0,
...
@@ -1252,6 +1248,7 @@ const ImportActionTable = (props) => {
...
@@ -1252,6 +1248,7 @@ const ImportActionTable = (props) => {
/>
/>
</Form>
</Form>
</DndProvider>
</DndProvider>
</ResizeObserver>
{
{
(filterData.length > supportMaxAttributeCountPerPage) && <Pagination
(filterData.length > supportMaxAttributeCountPerPage) && <Pagination
className="text-center mt-3"
className="text-center mt-3"
...
...
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