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
de226945
Commit
de226945
authored
Nov 30, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
48bcae95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
56 deletions
+65
-56
ImportActionIndex.jsx
src/view/Manage/Model/Component/ImportActionIndex.jsx
+65
-56
No files found.
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
de226945
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
,
useContext
,
useMemo
}
from
'react'
;
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
,
useContext
,
useMemo
}
from
'react'
;
import
{
Input
,
Form
,
Typography
,
Button
,
Select
,
Row
,
Col
,
Popover
,
Checkbox
,
Tooltip
,
Table
,
Space
}
from
'antd'
;
import
{
Input
,
Form
,
Typography
,
Button
,
Select
,
Row
,
Col
,
Popover
,
Checkbox
,
Tooltip
,
Table
,
Space
}
from
'antd'
;
import
{
DeleteOutlined
,
CloseOutlined
,
CheckOutlined
,
PlusOutlined
,
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
DeleteOutlined
,
CloseOutlined
,
CheckOutlined
,
PlusOutlined
,
QuestionCircleOutlined
,
DownOutlined
,
UpOutlined
}
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'
;
...
@@ -352,6 +352,7 @@ const ImportActionIndex = (props) => {
...
@@ -352,6 +352,7 @@ const ImportActionIndex = (props) => {
const
[
filterData
,
setFilterData
]
=
useState
([]);
const
[
filterData
,
setFilterData
]
=
useState
([]);
const
[
insertIndex
,
setInsertIndex
]
=
useState
(
0
);
const
[
insertIndex
,
setInsertIndex
]
=
useState
(
0
);
const
[
currentItem
,
setCurrentItem
]
=
useState
(
null
);
const
[
currentItem
,
setCurrentItem
]
=
useState
(
null
);
const
[
isCollapse
,
setCollapse
]
=
React
.
useState
(
true
)
const
{
indexIsEditingFunction
}
=
useContext
(
EditModelContext
);
const
{
indexIsEditingFunction
}
=
useContext
(
EditModelContext
);
...
@@ -818,6 +819,13 @@ const ImportActionIndex = (props) => {
...
@@ -818,6 +819,13 @@ const ImportActionIndex = (props) => {
<
QuestionCircleOutlined
className=
'pointer'
/>
<
QuestionCircleOutlined
className=
'pointer'
/>
</
Popover
>
</
Popover
>
}
}
{
isCollapse
?
<
Button
type=
'primary'
size=
'small'
onClick=
{
()
=>
{
setCollapse
(
!
isCollapse
)
}
}
>
展开
<
DownOutlined
/></
Button
>
:
<
Button
type=
'primary'
size=
'small'
onClick=
{
()
=>
{
setCollapse
(
!
isCollapse
)
}
}
>
收起
<
UpOutlined
/></
Button
>
}
</
Space
>
</
Space
>
<
Space
>
<
Space
>
{
{
...
@@ -836,68 +844,69 @@ const ImportActionIndex = (props) => {
...
@@ -836,68 +844,69 @@ const ImportActionIndex = (props) => {
</
div
>
</
div
>
</
Space
>
</
Space
>
</
div
>
</
div
>
<
div
className=
'mb-3'
id=
"containerId"
ref=
{
tableRef
}
>
{
<
DndProvider
backend=
{
HTML5Backend
}
>
!
isCollapse
&&
<
div
className=
'mb-3'
id=
"containerId"
ref=
{
tableRef
}
>
<
Form
form=
{
form
}
component=
{
false
}
onValuesChange=
{
onValuesChange
}
>
<
DndProvider
backend=
{
HTML5Backend
}
>
<
Table
<
Form
form=
{
form
}
component=
{
false
}
onValuesChange=
{
onValuesChange
}
>
components=
{
{
<
Table
body
:
{
components=
{
{
cell
:
EditableCell
,
body
:
{
//编辑或者搜索状态下不允许拖动
cell
:
EditableCell
,
row
:
(
editable
&&
editingKey
===
null
&&
keyword
===
''
)?
DragableBodyRow
:
null
,
//编辑或者搜索状态下不允许拖动
},
row
:
(
editable
&&
editingKey
===
null
&&
keyword
===
''
)?
DragableBodyRow
:
null
,
}
}
},
onRow=
{
(
record
,
index
)
=>
{
}
}
let
rowParams
=
{
onRow=
{
(
record
,
index
)
=>
{
index
,
let
rowParams
=
{
};
index
,
if
(
editable
)
{
rowParams
=
{...
rowParams
,
onContextMenu
:
event
=>
{
setCurrentItem
(
record
);
displayMenu
(
event
);
}
};
};
if
(
!
isEditing
(
record
))
{
if
(
editable
)
{
rowParams
=
{...
rowParams
,
onClick
:
(
event
)
=>
{
rowParams
=
{...
rowParams
,
onContextMenu
:
event
=>
{
event
.
stopPropagation
();
setCurrentItem
(
record
);
edit
(
record
);
displayMenu
(
event
);
}
};
if
(
!
isEditing
(
record
))
{
rowParams
=
{...
rowParams
,
onClick
:
(
event
)
=>
{
event
.
stopPropagation
();
edit
(
record
);
}
}
}
}
if
(
keyword
.
length
===
0
)
{
if
(
keyword
.
length
===
0
)
{
rowParams
=
{...
rowParams
,
moveRow
};
rowParams
=
{...
rowParams
,
moveRow
};
}
}
}
}
}
}
return
rowParams
;
return
rowParams
;
}
}
}
}
dataSource=
{
filterData
||
[]
}
dataSource=
{
filterData
||
[]
}
columns=
{
mergedColumns
()
}
columns=
{
mergedColumns
()
}
size=
'small'
size=
'small'
rowKey=
'name'
rowKey=
'name'
rowClassName=
"editable-row"
rowClassName=
"editable-row"
pagination=
{
false
}
pagination=
{
false
}
sticky
sticky
scroll=
{
{
scroll=
{
{
x
:
1200
x
:
1200
}
}
}
}
/>
/>
</
Form
>
</
Form
>
</
DndProvider
>
</
DndProvider
>
</
div
>
<
RcMenu
id=
{
MENU_ID
}
>
}
{
<
RcMenu
id=
{
MENU_ID
}
>
(
menuData
??[]).
map
(
item
=>
(
{
<
RcItem
key=
{
item
.
key
}
id=
{
item
.
key
}
onClick=
{
handleItemClick
}
>
(
menuData
??[]).
map
(
item
=>
(
{
item
.
title
}
<
RcItem
key=
{
item
.
key
}
id=
{
item
.
key
}
onClick=
{
handleItemClick
}
>
</
RcItem
>
{
item
.
title
}
))
</
RcItem
>
}
))
</
RcMenu
>
}
</
div
>
</
RcMenu
>
</
div
>
</
div
>
);
);
};
};
...
...
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