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
c81a183f
Commit
c81a183f
authored
Aug 05, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
警告
parent
e8639c6e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
35 deletions
+16
-35
DefineTable.jsx
src/view/Manage/DataMaster/Define/Component/DefineTable.jsx
+2
-0
UpdateField.jsx
src/view/Manage/DataMaster/Define/Component/UpdateField.jsx
+4
-2
UpdateTemplateModal.jsx
...anage/DataMaster/Define/Component/UpdateTemplateModal.jsx
+1
-0
ManageTable.jsx
src/view/Manage/DataMaster/Manage/Component/ManageTable.jsx
+3
-7
ManageTree.jsx
src/view/Manage/DataMaster/Manage/Component/ManageTree.jsx
+5
-26
UpdateDataMasterModal.jsx
...age/DataMaster/Manage/Component/UpdateDataMasterModal.jsx
+1
-0
No files found.
src/view/Manage/DataMaster/Define/Component/DefineTable.jsx
View file @
c81a183f
...
...
@@ -31,6 +31,7 @@ const DefineTable = (props) => {
useEffect
(()
=>
{
setCheckedKeys
([]);
setPagination
({...
pagination
,
pageNum
:
1
});
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
nodeId
])
useEffect
(()
=>
{
...
...
@@ -40,6 +41,7 @@ const DefineTable = (props) => {
}
else
{
getTemplates
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
,
pagination
])
const
columns
=
useMemo
(()
=>
{
...
...
src/view/Manage/DataMaster/Define/Component/UpdateField.jsx
View file @
c81a183f
...
...
@@ -7,11 +7,10 @@ import { DndProvider } from 'react-dnd';
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
import
DebounceInput
from
"../../../Model/Component/DebounceInput"
;
import
{
inputWidth
,
generateUUID
}
from
"../../../../../util"
;
import
{
inputWidth
}
from
"../../../../../util"
;
import
{
DragableBodyRow
,
DatatypeInput
}
from
"../../../Model/Component/ImportActionTable"
;
import
{
dispatch
}
from
"../../../../../model"
;
import
{
EditTemplateContext
}
from
"./UpdateTemplateModal"
;
import
{
getAllFileds
}
from
"../../../../../model/datamodel"
;
const
InputDebounce
=
DebounceInput
(
300
)(
Input
);
...
...
@@ -245,6 +244,7 @@ const UpdateField = (props) => {
getFileds();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible, template])
const columns = useMemo(() => {
...
...
@@ -255,6 +255,7 @@ const UpdateField = (props) => {
}
return newColumns;
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [editable, data, editingKey]);
useClickAway(() => {
...
...
@@ -495,6 +496,7 @@ const UpdateField = (props) => {
dataRef.current = newData;
onChange && onChange(newData);
},
//eslint-disable-next-line react-hooks/exhaustive-deps
[data],
);
...
...
src/view/Manage/DataMaster/Define/Component/UpdateTemplateModal.jsx
View file @
c81a183f
...
...
@@ -23,6 +23,7 @@ export const UpdateTemplateModal = (props) => {
form
?.
setFieldsValue
({
name
:
template
?.
name
||
''
,
cnName
:
template
?.
cnName
||
''
,
comment
:
template
?.
comment
||
''
});
setFields
([]);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
])
const
title
=
useMemo
(()
=>
{
...
...
src/view/Manage/DataMaster/Manage/Component/ManageTable.jsx
View file @
c81a183f
...
...
@@ -61,6 +61,7 @@ const ManageTable = (props) => {
useEffect
(()
=>
{
setCheckedKeys
([]);
setPagination
({...
pagination
,
pageNum
:
1
});
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
nodeId
])
useEffect
(()
=>
{
...
...
@@ -71,6 +72,7 @@ const ManageTable = (props) => {
}
else
{
getFiledsAndDatas
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
,
pagination
])
const
getFiledsAndDatas
=
()
=>
{
...
...
@@ -123,12 +125,6 @@ const ManageTable = (props) => {
setIsDataMasterModalVisible
(
true
);
}
const
onItemClick
=
(
record
)
=>
{
setAction
(
'detail'
);
setCurrentData
(
record
);
setIsDataMasterModalVisible
(
true
);
}
const
onDataMasterModalCancel
=
(
refresh
=
false
)
=>
{
setIsDataMasterModalVisible
(
false
);
...
...
@@ -193,7 +189,7 @@ const ManageTable = (props) => {
<
Button
onClick=
{
onAddClick
}
>
新建
</
Button
>
</
Space
>
<
Space
>
<
Tooltip
title=
{
(
checkedKeys
||
[]).
length
===
0
?
'请先选择
模版
'
:
''
}
>
<
Tooltip
title=
{
(
checkedKeys
||
[]).
length
===
0
?
'请先选择
主数据
'
:
''
}
>
<
Button
onClick=
{
onBatchDeleteClick
}
disabled=
{
(
checkedKeys
||
[]).
length
===
0
}
loading=
{
deleteLoading
}
>
删除
</
Button
>
</
Tooltip
>
</
Space
>
...
...
src/view/Manage/DataMaster/Manage/Component/ManageTree.jsx
View file @
c81a183f
import
{
useEffect
,
useMemo
,
useState
,
useRef
}
from
'react'
;
import
{
Tooltip
,
Spin
,
AutoComplete
,
Tree
,
Modal
}
from
'antd'
;
import
{
PlusOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
Tooltip
,
Spin
,
AutoComplete
,
Tree
}
from
'antd'
;
import
{
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
dispatch
}
from
'../../../../../model'
;
import
{
highlightSearchContentByTerms
,
showMessage
}
from
'../../../../../util'
;
import
{
highlightSearchContentByTerms
}
from
'../../../../../util'
;
import
'../../Define/Component/DefineTree.less'
;
...
...
@@ -67,25 +67,6 @@ const ManageTree = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
data
])
const
selectNode
=
useMemo
(()
=>
{
const
generateList
=
(
data
,
list
)
=>
{
(
data
||
[]).
forEach
(
node
=>
{
list
.
push
({...
node
});
if
(
node
.
children
)
{
generateList
(
node
.
children
,
list
);
}
});
};
const
newTreeList
=
[];
generateList
(
data
,
newTreeList
);
const
filterNodes
=
newTreeList
.
filter
(
item
=>
selectedKeys
.
indexOf
(
item
.
_id
)
!==-
1
);
return
(
filterNodes
||
[]).
length
>
0
?
filterNodes
[
0
]:{};
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
data
,
selectedKeys
])
const
getTreeNodes
=
()
=>
{
setLoading
(
true
);
dispatch
({
...
...
@@ -130,7 +111,7 @@ const ManageTree = (props) => {
if
(
isModelNode
(
option
.
key
))
{
onTreeSelect
([
option
.
key
]);
}
setExpandedKeys
(
Array
.
from
(
new
Set
([...
expandedKeys
,
option
.
key
])));
setAutoExpandParent
(
true
);
};
...
...
@@ -159,14 +140,12 @@ const ManageTree = (props) => {
}
const
isModelNode
=
(
value
)
=>
{
return
((
value
||
[]
).
indexOf
(
'Model='
)
!==
-
1
);
return
((
value
||
''
).
indexOf
(
'Model='
)
!==
-
1
);
}
const
findFirstModelNode
=
(
values
)
=>
{
const
generateList
=
(
data
,
list
)
=>
{
(
data
||
[]).
forEach
(
node
=>
{
const
{
_id
,
name
}
=
node
;
list
.
push
(
node
);
if
(
node
.
children
)
{
generateList
(
node
.
children
,
list
);
...
...
src/view/Manage/DataMaster/Manage/Component/UpdateDataMasterModal.jsx
View file @
c81a183f
...
...
@@ -30,6 +30,7 @@ const UpdateDataMasterModal = (props) => {
form
?.
setFieldsValue
(
newFieldsValue
);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
,
data
,
fields
])
const
title
=
useMemo
(()
=>
{
...
...
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