File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -444,15 +444,18 @@ function openGenerateDialog(row?: any) {
444444}
445445
446446function onEnd(event ? : any , params ? : any , index ? : number ) {
447- // console.log('onEnd', event, params, index)
447+ console .log (' onEnd' , event , params , index )
448+ if (event && event .newIndex === event .oldIndex ) {
449+ // 没有移动
450+ return
451+ }
448452 const p = cloneDeep (params )
449453 if (p ) {
450454 p .new_position = p .new_position + 1 // 由于拖拽时会将当前段落位置作为新位置,所以需要加1
451455 }
452456 const obj = p ?? {
453457 paragraph_id: paragraphDetail .value [event .newIndex ].id , // 当前拖动的段落ID
454- new_position:
455- paragraphDetail .value [event .newIndex + 1 ]?.position || paragraphDetail .value .length , // 新位置的段落位置
458+ new_position: event .newIndex + 1 ,
456459 }
457460 // console.log(paragraphDetail.value[event.newIndex], obj)
458461 loadSharedApi ({ type: ' paragraph' , systemType: apiType .value }).putAdjustPosition (
You can’t perform that action at this time.
0 commit comments