File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -652,6 +652,20 @@ <h5><a href="details.html?name={{$value.name}}&package_type={{$value.package_typ
652652 notInArray1 . forEach ( element => {
653653 providerList . push ( element )
654654 } ) ;
655+
656+ // 查找ID为10的元素
657+ var itemToMove = providerList . find ( item => item . _id === 10 ) ;
658+
659+ if ( itemToMove ) {
660+ // 移除该元素
661+ var indexToRemove = providerList . indexOf ( itemToMove ) ;
662+ providerList . splice ( indexToRemove , 1 ) ;
663+
664+ // 插入到新位置
665+ var newIndex = 1 ; // 目标索引位置
666+ providerList . splice ( newIndex , 0 , itemToMove ) ;
667+ }
668+
655669 }
656670
657671 } ) ;
Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ <h5><a href="details.html?name={{$value.name}}&package_type={{$value.package_typ
527527
528528 window . location . href = objectSerialize ( obj )
529529 }
530-
530+
531531 function setBaseList ( listData , idName , name ) {
532532 var attrString = "" ;
533533 var keys = [ {
@@ -756,6 +756,19 @@ <h5><a href="details.html?name={{$value.name}}&package_type={{$value.package_typ
756756 notInArray1 . forEach ( element => {
757757 providerList . push ( element )
758758 } ) ;
759+
760+ // 查找ID为10的元素
761+ var itemToMove = providerList . find ( item => item . _id === 10 ) ;
762+
763+ if ( itemToMove ) {
764+ // 移除该元素
765+ var indexToRemove = providerList . indexOf ( itemToMove ) ;
766+ providerList . splice ( indexToRemove , 1 ) ;
767+
768+ // 插入到新位置
769+ var newIndex = 1 ; // 目标索引位置
770+ providerList . splice ( newIndex , 0 , itemToMove ) ;
771+ }
759772 }
760773
761774 } ) ;
You can’t perform that action at this time.
0 commit comments