|
1 | 1 | <template> |
2 | | -<div style="height:100%; background: #f8f8f9"> |
3 | | - <Card style="height:100%"> |
| 2 | +<div style="height:100%"> |
| 3 | + <Card> |
4 | 4 | <div class="split"> |
5 | 5 | <Split v-model="offset"> |
6 | 6 | <div slot="left" class="split-pane"> |
@@ -443,52 +443,48 @@ export default { |
443 | 443 | } |
444 | 444 | }) |
445 | 445 | }, |
446 | | - handleChange (newTargetKeys) { |
| 446 | + handleChange (newTargetKeys, direction, moveKeys) { |
447 | 447 | this.targetKeys = newTargetKeys |
448 | | - if (this.editTransfer === 'user') { |
449 | | - operationRoleUser( |
450 | | - { role_id: this.role_id, user_list: this.targetKeys }, |
451 | | - 'post' |
452 | | - ).then(res => { |
453 | | - if (res.data.code === 0) { |
454 | | - this.$Message.success(`${res.data.msg}`) |
455 | | - } else { |
456 | | - this.$Message.error(`${res.data.msg}`) |
457 | | - } |
458 | | - }) |
| 448 | + let methodType = "post" |
| 449 | + if (direction === "left") { |
| 450 | + methodType = "delete" |
| 451 | + } |
| 452 | + if (this.editTransfer === 'user') { |
| 453 | + operationRoleUser( { role_id: this.role_id, user_list: moveKeys }, methodType |
| 454 | + ).then(res => { |
| 455 | + if (res.data.code === 0) { |
| 456 | + this.$Message.success(`${res.data.msg}`) |
| 457 | + } else { |
| 458 | + this.$Message.error(`${res.data.msg}`) |
| 459 | + } |
| 460 | + }) |
459 | 461 | } else if (this.editTransfer === 'component') { |
460 | | - operationRoleComponent( |
461 | | - { role_id: this.role_id, comp_list: this.targetKeys }, |
462 | | - 'post' |
463 | | - ).then(res => { |
464 | | - if (res.data.code === 0) { |
465 | | - this.$Message.success(`${res.data.msg}`) |
466 | | - } else { |
467 | | - this.$Message.error(`${res.data.msg}`) |
468 | | - } |
469 | | - }) |
| 462 | + operationRoleComponent( { role_id: this.role_id, comp_list: moveKeys }, methodType |
| 463 | + ).then(res => { |
| 464 | + if (res.data.code === 0) { |
| 465 | + this.$Message.success(`${res.data.msg}`) |
| 466 | + } else { |
| 467 | + this.$Message.error(`${res.data.msg}`) |
| 468 | + } |
| 469 | + }) |
470 | 470 | } else if (this.editTransfer === 'menu') { |
471 | | - operationRoleMenu( |
472 | | - { role_id: this.role_id, menu_list: this.targetKeys }, |
473 | | - 'post' |
| 471 | + operationRoleMenu({ role_id: this.role_id, menu_list: moveKeys}, methodType |
474 | 472 | ).then(res => { |
475 | | - if (res.data.code === 0) { |
476 | | - this.$Message.success(`${res.data.msg}`) |
477 | | - } else { |
478 | | - this.$Message.error(`${res.data.msg}`) |
479 | | - } |
480 | | - }) |
| 473 | + if (res.data.code === 0) { |
| 474 | + this.$Message.success(`${res.data.msg}`) |
| 475 | + } else { |
| 476 | + this.$Message.error(`${res.data.msg}`) |
| 477 | + } |
| 478 | + }) |
481 | 479 | } else if (this.editTransfer === 'func') { |
482 | | - operationRoleFunc( |
483 | | - { role_id: this.role_id, func_list: this.targetKeys }, |
484 | | - 'post' |
485 | | - ).then(res => { |
486 | | - if (res.data.code === 0) { |
487 | | - this.$Message.success(`${res.data.msg}`) |
488 | | - } else { |
489 | | - this.$Message.error(`${res.data.msg}`) |
490 | | - } |
491 | | - }) |
| 480 | + operationRoleFunc( { role_id: this.role_id, func_list: moveKeys }, methodType |
| 481 | + ).then(res => { |
| 482 | + if (res.data.code === 0) { |
| 483 | + this.$Message.success(`${res.data.msg}`) |
| 484 | + } else { |
| 485 | + this.$Message.error(`${res.data.msg}`) |
| 486 | + } |
| 487 | + }) |
492 | 488 | } else { |
493 | 489 | this.$Message.error('你在修改个锤子呀') |
494 | 490 | } |
|
0 commit comments