File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ import { MsgSuccess, MsgConfirm } from '@/utils/message'
175175import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
176176import permissionMap from ' @/permission'
177177import { t } from ' @/locales'
178+ import {cloneDeep } from " lodash" ;
178179const route = useRoute ()
179180const {
180181 params : { id, documentId },
@@ -351,7 +352,12 @@ function openGenerateDialog(row?: any) {
351352}
352353
353354function onEnd(event ? : any , params ? : any , index ? : number ) {
354- const obj = params ?? {
355+ // console.log('onEnd', event, params, index)
356+ const p = cloneDeep (params )
357+ if (p ) {
358+ p .new_position = p .new_position + 1 // 由于拖拽时会将当前段落位置作为新位置,所以需要加1
359+ }
360+ const obj = p ?? {
355361 paragraph_id: paragraphDetail .value [event .newIndex ].id , // 当前拖动的段落ID
356362 new_position: paragraphDetail .value [event .newIndex + 1 ].position , // 新位置的段落位置
357363 }
You can’t perform that action at this time.
0 commit comments