@@ -1431,23 +1431,31 @@ window.ComponentPlane = class {
1431
1431
} , options ) ;
1432
1432
this . FULLSCREEN = false ;
1433
1433
1434
- let width = this . OPTIONS . width ;
1435
- if ( this . OPTIONS . width . toString ( ) . indexOf ( 'px' ) === - 1 && this . OPTIONS . width . toString ( ) . indexOf ( '%' ) === - 1 ) {
1436
- width = window . innerWidth * this . OPTIONS . width ;
1437
- if ( width >= ( window . innerWidth - 18 ) ) width = window . innerWidth - 18 ;
1438
- width += 'px' ;
1439
- }
1440
- let height = this . OPTIONS . height ;
1441
- if ( this . OPTIONS . height . toString ( ) . indexOf ( 'px' ) === - 1 && this . OPTIONS . height . toString ( ) . indexOf ( '%' ) === - 1 ) {
1442
- height = window . innerHeight * this . OPTIONS . height ;
1443
- if ( height >= ( window . innerHeight - 25 ) ) height = window . innerHeight - 25 ;
1444
- height += 'px' ;
1445
- }
1446
- if ( this . OPTIONS . top === 'auto' ) {
1447
- this . OPTIONS . top = ( ( window . innerHeight - parseInt ( height ) - 25 ) / 2 ) + 'px' ;
1448
- }
1449
- this . WIDTH = width ;
1450
- this . HEIGHT = height ;
1434
+ this . _calcWindowSize = function ( ) {
1435
+ let width = this . OPTIONS . width ;
1436
+ let height = this . OPTIONS . height ;
1437
+ let windowX = window . innerWidth ;
1438
+ let windowY = window . innerHeight ;
1439
+ if ( this . PARENT_DOM instanceof HTMLElement ) {
1440
+ windowX = this . PARENT_DOM . clientWidth ;
1441
+ windowY = this . PARENT_DOM . clientHeight ;
1442
+ }
1443
+ if ( this . OPTIONS . width . toString ( ) . indexOf ( 'px' ) === - 1 && this . OPTIONS . width . toString ( ) . indexOf ( '%' ) === - 1 ) {
1444
+ width = windowX * this . OPTIONS . width ;
1445
+ if ( width >= ( windowX - 18 ) ) width = windowX - 18 ;
1446
+ width += 'px' ;
1447
+ }
1448
+ if ( this . OPTIONS . height . toString ( ) . indexOf ( 'px' ) === - 1 && this . OPTIONS . height . toString ( ) . indexOf ( '%' ) === - 1 ) {
1449
+ height = windowY * this . OPTIONS . height ;
1450
+ if ( height >= ( windowY - 25 ) ) height = windowY - 25 ;
1451
+ height += 'px' ;
1452
+ }
1453
+ if ( this . OPTIONS . top === 'auto' ) {
1454
+ this . OPTIONS . top = ( ( windowY - parseInt ( height ) - 25 ) / 2 ) + 'px' ;
1455
+ }
1456
+ this . WIDTH = width ;
1457
+ this . HEIGHT = height ;
1458
+ } ;
1451
1459
1452
1460
this . _appendF = function ( ) {
1453
1461
let F = document . createElement ( 'i' ) ;
@@ -1503,7 +1511,7 @@ window.ComponentPlane = class {
1503
1511
div . insertAdjacentHTML ( 'afterbegin' , dom ) ;
1504
1512
}
1505
1513
this . DOM . querySelector ( '.plane-header' ) . append ( div ) ;
1506
- }
1514
+ } ;
1507
1515
1508
1516
this . _xhrContent = function ( ) {
1509
1517
_component . loading ( this . MODEL_BODY_DOM ) ;
@@ -1625,6 +1633,7 @@ window.ComponentPlane = class {
1625
1633
}
1626
1634
1627
1635
make ( ) {
1636
+ this . _calcWindowSize ( ) ;
1628
1637
let margin = this . OPTIONS . top + ' ' + this . OPTIONS . left ;
1629
1638
let Plane = document . createElement ( 'div' ) ;
1630
1639
Plane . style . width = this . WIDTH ;
@@ -1850,6 +1859,7 @@ window.ComponentCascadeLine = class {
1850
1859
this . DOM . addEventListener ( "contextmenu" , ( e ) => {
1851
1860
e . preventDefault ( ) ;
1852
1861
} ) ;
1862
+ this . DOM . style . position = 'relative' ;
1853
1863
this . HEADER_DOM = this . DOM . querySelector ( `.dot-top` ) ;
1854
1864
this . CONTENT_DOM = this . DOM . querySelector ( `.dot-select` ) ;
1855
1865
this . SEARCH_BOX = this . DOM . querySelector ( `.search-box` ) ;
@@ -1865,9 +1875,8 @@ window.ComponentCascadeLine = class {
1865
1875
url : this . URL + '/create' ,
1866
1876
method : 'GET' ,
1867
1877
data : { } ,
1868
- } ) ;
1869
- this . PLANE_DOM . setParentDom ( this . DOM )
1870
- . bindRequest ( 'button[type="submit"]' , 'click' , {
1878
+ } ) . setParentDom ( this . DOM ) . setTitle ( `<span class="dlp-text title">根添加</span>` ) ;
1879
+ this . PLANE_DOM . bindRequest ( 'button[type="submit"]' , 'click' , {
1871
1880
url :object . URL ,
1872
1881
method :'POST' ,
1873
1882
data :{ key : 0 } ,
@@ -2169,11 +2178,14 @@ window.ComponentCascadeLine = class {
2169
2178
2170
2179
nodeDelete ( dom , data , stack ) {
2171
2180
let object = this ;
2172
- let title = `<span class="dlp-text title" title="${ data . val } ">${ data . val } 删除</span >` ;
2181
+ let title = `<p class="dlp-text title" title="${ data . val } ">${ data . val } 删除</p >` ;
2173
2182
2183
+ let P = document . createElement ( 'div' ) ;
2184
+ P . style = 'width:100%;height:100%;display:flex;align-items:center;justify-content:center;' ;
2174
2185
/*D delete node*/
2175
2186
let D = document . createElement ( 'div' ) ;
2176
- D . className = 'dlp dlp-text dlp-label' ;
2187
+ D . className = 'dlp dlp-button' ;
2188
+ D . style . width = '85%' ;
2177
2189
D . addEventListener ( 'click' , ( ( ) => {
2178
2190
if ( object . submit_block ) return ;
2179
2191
object . submit_block = true ;
@@ -2190,8 +2202,9 @@ window.ComponentCascadeLine = class {
2190
2202
}
2191
2203
} ) ;
2192
2204
} ) ) ;
2193
- D . insertAdjacentHTML ( 'afterbegin' , `<span>${ data . val } </span><i class="right">${ _component . trash } </i>` ) ;
2194
- this . PLANE_DOM = new ComponentPlane ( D ) . setParentDom ( this . DOM ) . setTitle ( title ) ;
2205
+ D . insertAdjacentHTML ( 'afterbegin' , `<p style="width: 100%;text-align: center">${ data . val } </p> <i class="right">${ _component . trash } </i>` ) ;
2206
+ P . append ( D ) ;
2207
+ this . PLANE_DOM = new ComponentPlane ( P , { width :'300px' , height :'65px' , f :false } ) . setParentDom ( this . DOM ) . setTitle ( title ) ;
2195
2208
this . PLANE_DOM . make ( ) ;
2196
2209
}
2197
2210
@@ -2201,37 +2214,39 @@ window.ComponentCascadeLine = class {
2201
2214
let node_data = this . dimensional_data [ stack ] [ index ] ;
2202
2215
let title = `<span class="dlp-text title" title="${ node_data . val } ">${ node_data . val } 迁移到根</span>` ;
2203
2216
2204
- let content = document . createElement ( 'div' ) ;
2217
+ let P = document . createElement ( 'div' ) ;
2218
+ P . style = 'width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction: column;' ;
2205
2219
let M = document . createElement ( 'div' ) ;
2206
- M . className = 'dlp dlp-text dlp-label' ;
2207
- M . insertAdjacentHTML ( 'afterbegin' , `<span>${ node_data . val } </span><i class="right">${ _component . check_circle } </i>` ) ;
2208
- content . insertAdjacentHTML ( 'afterbegin' , `<div class="dlp" style="display: flex">${ _component . node } </div>` ) ;
2209
- content . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 16px!important;">↑</div>` ) ;
2220
+ M . className = 'dlp dlp-button' ;
2221
+ M . style . width = '85%' ;
2222
+ M . insertAdjacentHTML ( 'afterbegin' , `<p style="width: 100%;text-align: center">${ node_data . val } </p><i class="right">${ _component . check_circle } </i>` ) ;
2223
+ P . insertAdjacentHTML ( 'afterbegin' , `<div class="dlp" style="display: flex">${ _component . node } </div>` ) ;
2224
+ P . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 16px!important;">↑</div>` ) ;
2210
2225
let object = this ;
2211
- M . addEventListener ( 'click' , ( ( ) => {
2212
- if ( node_data . stack === 0 ) return object . PLANE_DOM . remove ( ) ;
2213
- if ( object . submit_block ) return ;
2214
- object . submit_block = true ;
2215
- M . querySelector ( '.right' ) . innerHTML = _component . sub_loading ;
2216
- _component . request ( {
2217
- url : this . URL ,
2218
- method : 'GET' ,
2219
- data : { event : 'root' , node_key : node_data . key , node_val : node_data . val } ,
2220
- callback : function ( response ) {
2221
- object . submit_block = false ;
2222
- response = JSON . parse ( response ) ;
2223
- if ( response . code !== 0 ) return _component . alert ( response . message , 3 , null , object . DOM ) ;
2224
- object . nodeRootExec ( dom , node_data ) ;
2225
- object . PLANE_DOM . getDom ( ) . remove ( ) ;
2226
- } , error_callback : function ( ) {
2227
- object . submit_block = false ;
2228
- object . PLANE_DOM . getDom ( ) . remove ( ) ;
2229
- }
2226
+ P . append ( M ) ;
2227
+ this . PLANE_DOM = new ComponentPlane ( P , { width :'300px' , height :'95px' } )
2228
+ . setParentDom ( this . DOM ) . setTitle ( title )
2229
+ . bindEvent ( 'div.dlp-button' , 'click' , ( ) => {
2230
+ if ( node_data . stack === 0 ) return object . PLANE_DOM . remove ( ) ;
2231
+ if ( object . submit_block ) return ;
2232
+ object . submit_block = true ;
2233
+ M . querySelector ( '.right' ) . innerHTML = _component . sub_loading ;
2234
+ _component . request ( {
2235
+ url : this . URL ,
2236
+ method : 'GET' ,
2237
+ data : { event : 'root' , node_key : node_data . key , node_val : node_data . val } ,
2238
+ callback : function ( response ) {
2239
+ object . submit_block = false ;
2240
+ response = JSON . parse ( response ) ;
2241
+ if ( response . code !== 0 ) return _component . alert ( response . message , 3 , null , object . DOM ) ;
2242
+ object . nodeRootExec ( dom , node_data ) ;
2243
+ object . PLANE_DOM . getDom ( ) . remove ( ) ;
2244
+ } , error_callback : function ( ) {
2245
+ object . submit_block = false ;
2246
+ object . PLANE_DOM . getDom ( ) . remove ( ) ;
2247
+ }
2248
+ } ) ;
2230
2249
} ) ;
2231
- } ) ) ;
2232
- content . append ( M ) ;
2233
-
2234
- this . PLANE_DOM = new ComponentPlane ( content ) . setParentDom ( this . DOM ) . setTitle ( title ) ;
2235
2250
this . PLANE_DOM . make ( ) ;
2236
2251
}
2237
2252
@@ -2455,49 +2470,55 @@ window.ComponentCascadeLine = class {
2455
2470
let title = '迁移' ;
2456
2471
if ( aim_node_data . parentNodes . indexOf ( node_data . key ) !== - 1 ) {
2457
2472
event = 'exchange' ;
2458
- title = '迁移. 交换' ;
2473
+ title = '交换' ;
2459
2474
} else {
2460
2475
event = 'migrate' ;
2461
2476
}
2462
2477
if ( ! this . OPTIONS . exchange && event === 'exchange' ) return ;
2463
2478
aim_node . style . removeProperty ( 'background' ) ;
2464
- this . dialog ( `<span class="dlp-text title" title="${ node_data . val } ">${ node_data . val } </span> ${ title } ` , 90 ) ;
2479
+
2480
+ title = `<p class="dlp-text title" title="${ node_data . val } ">${ node_data . val } ${ title } </p>` ;
2481
+ let P = document . createElement ( 'div' ) ;
2482
+ P . style = 'width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction: column;' ;
2465
2483
let M = document . createElement ( 'div' ) ;
2466
2484
let object = this ;
2467
- M . className = 'dlp dlp-text dlp-label' ;
2468
- M . insertAdjacentHTML ( 'afterbegin' , `<span>${ node_data . val } </span><i class="right">${ _component . check_circle } </i>` ) ;
2469
- this . PLANE_BODY . insertAdjacentHTML ( 'afterbegin' , `<div class="dlp dlp-text dlp-label"><span>${ aim_node_data . val } </span></div>` ) ;
2485
+ M . className = 'dlp dlp-button' ;
2486
+ M . style . width = '85%' ;
2487
+ M . insertAdjacentHTML ( 'afterbegin' , `<p style="width: 100%;text-align: center">${ node_data . val } </p><i class="right">${ _component . check_circle } </i>` ) ;
2488
+ P . insertAdjacentHTML ( 'afterbegin' , `<div class="dlp dlp-text dlp-label"><span>${ aim_node_data . val } </span></div>` ) ;
2470
2489
if ( event === 'exchange' ) {
2471
- this . PLANE_BODY . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 16px!important;">⇵</div>` ) ;
2490
+ P . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 16px!important;font-family: cursive;font-weight: bolder ;">⇵</div>` ) ;
2472
2491
} else {
2473
- this . PLANE_BODY . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 16px!important;">↑</div>` ) ;
2492
+ P . insertAdjacentHTML ( 'beforeend' , `<div style="font-size: 16px!important;font-family: cursive;font-weight: bolder ;">↑</div>` ) ;
2474
2493
}
2475
- M . addEventListener ( 'click' , ( ( ) => {
2476
- if ( object . submit_block ) return ;
2477
- object . submit_block = true ;
2478
- M . querySelector ( '.right' ) . innerHTML = _component . sub_loading ;
2479
- _component . request ( {
2480
- url : this . URL ,
2481
- method : 'GET' ,
2482
- data : {
2483
- event : event ,
2484
- node_key : node_data . key ,
2485
- node_val : node_data . val ,
2486
- aim_node_key : aim_node_data . key ,
2487
- aim_node_val : aim_node_data . val
2488
- } , callback : function ( response ) {
2489
- object . submit_block = false ;
2490
- response = JSON . parse ( response ) ;
2491
- if ( response . code !== 0 ) return _component . alert ( response . message , 3 , null , object . DOM ) ;
2492
- if ( event === 'exchange' ) object . nodeExchangeExec ( node , node_data , aim_node , aim_node_data ) ;
2493
- if ( event === 'migrate' ) object . nodeMigrateExec ( node , node_data , aim_node , aim_node_data ) ;
2494
- object . PLANE_DOM . remove ( ) ;
2495
- } , error_callback : function ( ) {
2496
- object . submit_block = false ;
2497
- }
2498
- } ) ;
2499
- } ) ) ;
2500
- this . PLANE_BODY . append ( M ) ;
2494
+ P . append ( M ) ;
2495
+ this . PLANE_DOM = new ComponentPlane ( P , { width :'300px' , height :'95px' , f :false } )
2496
+ . bindEvent ( 'div.dlp-button' , 'click' , ( ) => {
2497
+ if ( object . submit_block ) return ;
2498
+ object . submit_block = true ;
2499
+ M . querySelector ( '.right' ) . innerHTML = _component . sub_loading ;
2500
+ _component . request ( {
2501
+ url : this . URL ,
2502
+ method : 'GET' ,
2503
+ data : {
2504
+ event : event ,
2505
+ node_key : node_data . key ,
2506
+ node_val : node_data . val ,
2507
+ aim_node_key : aim_node_data . key ,
2508
+ aim_node_val : aim_node_data . val
2509
+ } , callback : function ( response ) {
2510
+ object . submit_block = false ;
2511
+ response = JSON . parse ( response ) ;
2512
+ if ( response . code !== 0 ) return _component . alert ( response . message , 3 , null , object . DOM ) ;
2513
+ if ( event === 'exchange' ) object . nodeExchangeExec ( node , node_data , aim_node , aim_node_data ) ;
2514
+ if ( event === 'migrate' ) object . nodeMigrateExec ( node , node_data , aim_node , aim_node_data ) ;
2515
+ object . PLANE_DOM . getDom ( ) . remove ( ) ;
2516
+ } , error_callback : function ( ) {
2517
+ object . submit_block = false ;
2518
+ }
2519
+ } ) ;
2520
+ } ) . setParentDom ( this . DOM ) . setTitle ( title ) ;
2521
+ this . PLANE_DOM . make ( ) ;
2501
2522
}
2502
2523
2503
2524
nodeRootExec ( node , node_data ) {
0 commit comments