feat:四象限拖拽,文字限行

This commit is contained in:
1708-huayu 2025-07-11 19:00:06 +08:00
parent 4b32486a5f
commit fdd657a1b3
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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={{