feat:四象限拖拽,文字限行
This commit is contained in:
parent
4b32486a5f
commit
fdd657a1b3
|
@ -60,6 +60,12 @@ export default function Layout({children}: { children: React.ReactNode }) {
|
|||
list.splice(addIndex,0,item)
|
||||
return list;
|
||||
}
|
||||
const moveItemByIndex = (list:DataType[],sourceIndex:number,destinationIndex:number)=>{
|
||||
const result = Array.from(list);
|
||||
const [removed] = result.splice(sourceIndex, 1);
|
||||
result.splice(destinationIndex, 0, removed);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 处理拖拽结束事件
|
||||
const onDragEnd = async (result: DropResult) => {
|
||||
|
@ -89,6 +95,10 @@ export default function Layout({children}: { children: React.ReactNode }) {
|
|||
nextId=destinationList[destination.index+1].id
|
||||
}
|
||||
}
|
||||
if (source.droppableId=="3"){setImportUrgent(moveItemByIndex(importUrgent,source.index,destination.index))}
|
||||
if (source.droppableId=="2"){setNotImportUrgent(moveItemByIndex(notImportUrgent,source.index,destination.index))}
|
||||
if (source.droppableId=="1"){setImportNotUrgent(moveItemByIndex(importNotUrgent,source.index,destination.index))}
|
||||
if (source.droppableId=="0"){setNotImportNotUrgent(moveItemByIndex(notImportNotUrgent,source.index,destination.index))}
|
||||
}else {
|
||||
if (destination.index!=0){
|
||||
preId=destinationList[destination.index-1].id
|
||||
|
|
|
@ -98,7 +98,7 @@ export const DroppableTable = React.memo((props: DroppableTableProps) => {
|
|||
<div style={{width: '45%', boxSizing: 'border-box', minWidth: 0}}
|
||||
className='displayFlexRow'>
|
||||
<Tooltip placement="topLeft" title={record.description}>
|
||||
<div className='displayFlexRow'>{record.description}</div>
|
||||
<div className='displayFlexRow text-ellipsis'>{record.description}</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div style={{
|
||||
|
|
Loading…
Reference in New Issue