@@ -1166,7 +1166,7 @@ window.ComponentCascadeLine = class {
1166
1166
} ) ;
1167
1167
1168
1168
for ( let D of this . DOM . querySelectorAll ( 'i.right' ) ) {
1169
- this . nodeMovement ( D ) ;
1169
+ this . nodeMigrate ( D ) ;
1170
1170
}
1171
1171
}
1172
1172
@@ -1688,7 +1688,7 @@ window.ComponentCascadeLine = class {
1688
1688
DOM . click ( ) ;
1689
1689
}
1690
1690
1691
- nodeMovement ( dom ) {
1691
+ nodeMigrate ( dom ) {
1692
1692
let D = dom . parentNode ;
1693
1693
let object = this ;
1694
1694
let aim = null ;
@@ -1729,22 +1729,7 @@ window.ComponentCascadeLine = class {
1729
1729
stack = parseInt ( D . getAttribute ( 'data-stack' ) ) ;
1730
1730
index = parseInt ( D . getAttribute ( 'data-k' ) ) ;
1731
1731
let node_data = object . dimensional_data [ stack ] [ index ] ;
1732
- object . dialog ( `<span class="dlp-text title" title="${ node_data . val } ">${ node_data . val } </span> 迁移` , 90 ) ;
1733
- let M = document . createElement ( 'div' ) ;
1734
- M . className = 'dlp dlp-text dlp-label' ;
1735
- M . addEventListener ( 'click' , ( ( ) => {
1736
- if ( object . submit_block ) return ;
1737
- object . submit_block = true ;
1738
-
1739
- } ) ) ;
1740
- M . insertAdjacentHTML ( 'afterbegin' , `<span>${ node_data . val } </span><i class="right">${ _component . check_circle } </i>` ) ;
1741
- object . PLANE_BODY . insertAdjacentHTML ( 'afterbegin' , `<div class="dlp dlp-text dlp-label"><span>${ aim_node_data . val } </span></div>` ) ;
1742
- if ( aim_node_data . parentNodes . indexOf ( node_data . key ) !== - 1 ) {
1743
- object . PLANE_BODY . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 20px!important;">⇵</div>` ) ;
1744
- } else {
1745
- object . PLANE_BODY . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 18px!important;">↑</div>` ) ;
1746
- }
1747
- object . PLANE_BODY . append ( M ) ;
1732
+ object . nodeMigrateConfirm ( node_data , aim_node_data ) ;
1748
1733
}
1749
1734
}
1750
1735
dom . addEventListener ( 'mousedown' , ( ) => {
@@ -1766,5 +1751,39 @@ window.ComponentCascadeLine = class {
1766
1751
}
1767
1752
} ) ;
1768
1753
}
1754
+
1755
+ nodeMigrateConfirm ( node_data , aim_node_data ) {
1756
+ this . dialog ( `<span class="dlp-text title" title="${ node_data . val } ">${ node_data . val } </span> 迁移` , 90 ) ;
1757
+ let M = document . createElement ( 'div' ) ;
1758
+ let object = this ;
1759
+ M . className = 'dlp dlp-text dlp-label' ;
1760
+ M . insertAdjacentHTML ( 'afterbegin' , `<span>${ node_data . val } </span><i class="right">${ _component . check_circle } </i>` ) ;
1761
+ this . PLANE_BODY . insertAdjacentHTML ( 'afterbegin' , `<div class="dlp dlp-text dlp-label"><span>${ aim_node_data . val } </span></div>` ) ;
1762
+ let event ;
1763
+ if ( aim_node_data . parentNodes . indexOf ( node_data . key ) !== - 1 ) {
1764
+ this . PLANE_BODY . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 20px!important;">⇵</div>` ) ;
1765
+ event = 'exchange' ;
1766
+ } else {
1767
+ this . PLANE_BODY . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 18px!important;">↑</div>` ) ;
1768
+ event = 'migrate' ;
1769
+ }
1770
+ M . addEventListener ( 'click' , ( ( ) => {
1771
+ if ( this . submit_block ) return ;
1772
+ this . submit_block = true ;
1773
+ M . querySelector ( '.right' ) . innerHTML = _component . sub_loading ;
1774
+ _component . request ( this . URL , 'GET' , { event :event , node_key :node_data . key , aim_node_key :aim_node_data . key } , function ( response ) {
1775
+ object . submit_block = false ;
1776
+ if ( response . code !== 0 ) return _component . alert ( response . message , 3 ) ;
1777
+ object . nodeMigrateExec ( ) ;
1778
+ } , function ( ) {
1779
+ object . submit_block = false ;
1780
+ } ) ;
1781
+ } ) ) ;
1782
+ this . PLANE_BODY . append ( M ) ;
1783
+ }
1784
+
1785
+ nodeMigrateExec ( ) {
1786
+
1787
+ }
1769
1788
} ;
1770
1789
0 commit comments