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
8cc1752f
Commit
8cc1752f
authored
Nov 29, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
右键
parent
195484da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
68 deletions
+24
-68
ImportActionIndex.jsx
src/view/Manage/Model/Component/ImportActionIndex.jsx
+24
-54
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+0
-14
No files found.
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
8cc1752f
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
,
useContext
}
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
}
from
'@ant-design/icons'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
...
@@ -418,6 +418,14 @@ const ImportActionIndex = (props) => {
...
@@ -418,6 +418,14 @@ const ImportActionIndex = (props) => {
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keywordCondition
])
},
[
keywordCondition
])
const
menuData
=
useMemo
(()
=>
{
return
[
{
title
:
'在上方插入行'
,
key
:
'up'
},
{
title
:
'在下方插入行'
,
key
:
'down'
},
{
title
:
'删除'
,
key
:
'delete'
},
]
},
[])
const
isEditing
=
(
record
)
=>
record
.
name
===
editingKey
;
const
isEditing
=
(
record
)
=>
record
.
name
===
editingKey
;
...
@@ -438,7 +446,7 @@ const ImportActionIndex = (props) => {
...
@@ -438,7 +446,7 @@ const ImportActionIndex = (props) => {
})
})
}
}
const
insertToFront
=
(
record
)
=>
{
const
onInsertToFrontClick
=
(
record
)
=>
{
save
().
then
(
result
=>
{
save
().
then
(
result
=>
{
if
(
result
)
{
if
(
result
)
{
...
@@ -475,7 +483,7 @@ const ImportActionIndex = (props) => {
...
@@ -475,7 +483,7 @@ const ImportActionIndex = (props) => {
})
})
}
}
const
insertToBa
ck
=
(
record
)
=>
{
const
onInsertToBackCli
ck
=
(
record
)
=>
{
save
().
then
(
result
=>
{
save
().
then
(
result
=>
{
if
(
result
)
{
if
(
result
)
{
setKeywordCondition
({
keyword
:
''
,
needFilter
:
false
});
setKeywordCondition
({
keyword
:
''
,
needFilter
:
false
});
...
@@ -540,7 +548,7 @@ const ImportActionIndex = (props) => {
...
@@ -540,7 +548,7 @@ const ImportActionIndex = (props) => {
onChange
&&
onChange
(
newData
);
onChange
&&
onChange
(
newData
);
}
}
const
remove
=
(
record
)
=>
{
const
onRemoveClick
=
(
record
)
=>
{
if
(
record
.
name
===
''
)
{
if
(
record
.
name
===
''
)
{
const
newData
=
[...
dataRef
.
current
];
const
newData
=
[...
dataRef
.
current
];
...
@@ -738,50 +746,9 @@ const ImportActionIndex = (props) => {
...
@@ -738,50 +746,9 @@ const ImportActionIndex = (props) => {
},
},
];
];
const
editableColumn
=
[
...
columns
,
{
title
:
'操作'
,
dataIndex
:
'action'
,
width
:
180
,
render
:
(
_
,
record
)
=>
{
if
(
!
editable
)
return
null
;
return
(
<
React
.
Fragment
>
<
Button
className=
'mr-3'
size=
'small'
type=
'text'
icon=
{
<
PlusOutlined
/>
}
onClick=
{
(
event
)
=>
{
event
.
stopPropagation
();
insertToFront
(
record
);
}
}
/>
<
Button
className=
'mr-3'
size=
'small'
type=
'text'
icon=
{
<
DeleteOutlined
style=
{
{
color
:
'red'
}
}
/>
}
onClick=
{
(
event
)
=>
{
event
.
stopPropagation
();
remove
(
record
);
}
}
/>
</
React
.
Fragment
>
)
},
},
]
const
mergedColumns
=
()
=>
{
const
mergedColumns
=
()
=>
{
if
(
editable
)
{
if
(
editable
)
{
return
columns
.
map
((
col
)
=>
{
let
_columns
=
editableColumn
;
return
_columns
.
map
((
col
)
=>
{
if
(
!
col
.
editable
)
{
if
(
!
col
.
editable
)
{
return
col
;
return
col
;
}
}
...
@@ -833,9 +800,11 @@ const ImportActionIndex = (props) => {
...
@@ -833,9 +800,11 @@ const ImportActionIndex = (props) => {
const
key
=
event
.
currentTarget
.
id
;
const
key
=
event
.
currentTarget
.
id
;
if
(
key
===
'up'
)
{
if
(
key
===
'up'
)
{
insertToFront
(
currentItem
);
onInsertToFrontClick
(
currentItem
);
}
else
if
(
key
===
'down'
)
{
}
else
if
(
key
===
'down'
)
{
insertToBack
(
currentItem
);
onInsertToBackClick
(
currentItem
);
}
else
if
(
key
===
'delete'
)
{
onRemoveClick
(
currentItem
);
}
}
}
}
...
@@ -920,12 +889,13 @@ const ImportActionIndex = (props) => {
...
@@ -920,12 +889,13 @@ const ImportActionIndex = (props) => {
</
DndProvider
>
</
DndProvider
>
<
RcMenu
id=
{
MENU_ID
}
>
<
RcMenu
id=
{
MENU_ID
}
>
<
RcItem
id=
"up"
onClick=
{
handleItemClick
}
>
{
在上方插入行
(
menuData
??[]).
map
(
item
=>
(
</
RcItem
>
<
RcItem
key=
{
item
.
key
}
id=
{
item
.
key
}
onClick=
{
handleItemClick
}
>
<
RcItem
id=
"down"
onClick=
{
handleItemClick
}
>
{
item
.
title
}
在下方插入行
</
RcItem
>
</
RcItem
>
))
}
</
RcMenu
>
</
RcMenu
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
8cc1752f
...
@@ -1303,20 +1303,6 @@ export const ImportActionTable = (props) => {
...
@@ -1303,20 +1303,6 @@ export const ImportActionTable = (props) => {
</RcItem>
</RcItem>
))
))
}
}
{/* <RcItem id="up" onClick={handleItemClick}>
在上方插入行
</RcItem>
<RcItem id="down" onClick={handleItemClick}>
在下方插入行
</RcItem>
{
(originAction!=='flow') && <RcItem id="attention" onClick={handleItemClick}>
{currentItem?.needAttention ? '取消送审关注': '送审关注'}
</RcItem>
}
<RcItem id="delete" onClick={handleItemClick}>
删除
</RcItem> */}
</RcMenu>
</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