| | |
| | | import OperaBookingsDetailWindow from '@/views/meeting/components/OperaBookingsDetailWindow' |
| | | import { findList } from '@/api/meeting/rooms' |
| | | import { getSystemDictData } from '@/api/system/dictData' |
| | | import { fetchTree } from '@/api/system/department' |
| | | import { fetchList } from '@/api/business/company' |
| | | import { cancelById, bookingsDetail } from '@/api/meeting/bookings' |
| | | export default { |
| | | name: 'Bookings', |
| | |
| | | isdeleted: '', |
| | | remark: '', |
| | | name: '', |
| | | roomId: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | content: '' |
| | |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | fetchTree() |
| | | fetchList(1) |
| | | .then(res => { |
| | | this.department = this.newTree(res) |
| | | }) |
| | |
| | | }, |
| | | methods: { |
| | | newTree(tree) { |
| | | if(tree ==null){ |
| | | return [] |
| | | } |
| | | return tree.map(item => { |
| | | let newItem = {...item} |
| | | if (item.children.length == 0) { |
| | | if(newItem){ |
| | | newItem.children=newItem.childList |
| | | } |
| | | if (item.children && item.children.length == 0) { |
| | | this.$delete( newItem, 'children' ) |
| | | } else { |
| | | newItem.children = this.newTree(newItem.children) |