|
|
|
@ -4,7 +4,6 @@ import {FormControl} from '@angular/forms';
|
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
|
import { CacheTokenService } from '../../http-interceptors/cache-token.service' |
|
|
|
|
import format from 'date-fns/format'; |
|
|
|
|
import {CdkDragDrop, moveItemInArray} from '@angular/cdk/drag-drop'; |
|
|
|
|
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; |
|
|
|
|
import {FlatTreeControl} from '@angular/cdk/tree'; |
|
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
@ -169,17 +168,6 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
drop(event: CdkDragDrop<string[]>) {//拖拽函数
|
|
|
|
|
moveItemInArray(this.dataSource, event.previousIndex, event.currentIndex); |
|
|
|
|
this.dataSource.forEach((item, index) => { |
|
|
|
|
item.order = index; |
|
|
|
|
}) |
|
|
|
|
const a = [...this.dataSource]; |
|
|
|
|
this.dataSource = []; |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.dataSource = a; |
|
|
|
|
}, 10); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|