| | |
| | | }) |
| | | } |
| | | |
| | | export const getDeptLazyTree = (parentId) => { |
| | | return request({ |
| | | url: '/api/blade-jfpts/catalogs/catalogs/lazy-tree', |
| | | method: 'get', |
| | | params: { |
| | | parentId |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, remove, update, add, getclient} from "@/api/client/client"; |
| | | import {getList, remove, update, add, getclient,getDeptLazyTree} from "@/api/client/client"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentId = (node.level === 0) ? 0 : node.data.id; |
| | | |
| | | getDeptLazyTree(parentId).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }); |
| | | }, |
| | | addBtn: false, |
| | | menu: false, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |