@@ -301,12 +301,15 @@ function componentLine(name,columns,data) {
301
301
dom . getElementsByClassName ( 'JsonTableInsert' ) [ 0 ] . appendChild ( i ) ;
302
302
}
303
303
304
- function componentPlane ( url , method = 'POST' ) {
304
+ function componentPlane ( url , xhr_url = '' , method = 'POST' ) {
305
+ if ( xhr_url == '' ) {
306
+ xhr_url = url ;
307
+ }
305
308
let Form = {
306
- make :function ( url ) {
309
+ make :function ( ) {
307
310
this . _clear ( ) ;
308
311
this . _createModal ( ) ;
309
- this . _createBox ( url ) ;
312
+ this . _createBox ( ) ;
310
313
} ,
311
314
_clear :function ( ) {
312
315
this . _modalBodyNode = null ;
@@ -320,25 +323,25 @@ function componentPlane(url,method='POST'){
320
323
_boxBodyNode : null ,
321
324
_tableNode : null ,
322
325
_loadingNode :null ,
323
- _request : function ( url ) {
326
+ _request : function ( ) {
324
327
this . _loading ( ) ;
325
328
_componentMegaBlock . _request ( url , 'GET' , { } , function ( response ) {
326
329
Form . _loading ( true ) ;
327
330
$ ( '.modal-body' ) . append ( response ) ;
328
331
if ( $ ( '.modal-body button[type="submit"]' ) ) {
329
332
$ ( '.modal-body button[type="submit"]' ) . click ( function ( ) {
330
- Form . _submitEvent ( this , url )
333
+ Form . _submitEvent ( this )
331
334
} ) ;
332
335
}
333
336
} ) ;
334
337
} ,
335
- _submitEvent :function ( obj , url ) {
338
+ _submitEvent :function ( obj ) {
336
339
obj . setAttribute ( 'disabled' , 'disabled' ) ;
337
340
obj . innerText = '提交中...' ;
338
341
let form = Form . _modalBodyNode . getElementsByTagName ( 'form' ) [ 0 ] ;
339
342
let formdata = new FormData ( form ) ;
340
343
341
- _componentMegaBlock . _request ( url , method , formdata , function ( response ) {
344
+ _componentMegaBlock . _request ( xhr_url , method , formdata , function ( response ) {
342
345
if ( response . code == 0 ) {
343
346
window . location . reload ( ) ;
344
347
} else {
@@ -349,7 +352,7 @@ function componentPlane(url,method='POST'){
349
352
}
350
353
} ) ;
351
354
} ,
352
- _createBox : function ( url ) {
355
+ _createBox : function ( ) {
353
356
let box = document . createElement ( "div" ) ;
354
357
box . className = "box grid-box" ;
355
358
let box_body = document . createElement ( "div" ) ;
@@ -358,7 +361,7 @@ function componentPlane(url,method='POST'){
358
361
box . append ( box_body ) ;
359
362
this . _boxNode = box ;
360
363
this . _boxBodyNode = box_body ;
361
- this . _request ( url ) ;
364
+ this . _request ( ) ;
362
365
return ;
363
366
} ,
364
367
_loading : function ( remove = false ) {
@@ -428,8 +431,4 @@ function componentPlane(url,method='POST'){
428
431
}
429
432
} ;
430
433
Form . make ( url )
431
- }
432
-
433
-
434
-
435
-
434
+ }
0 commit comments