| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="5"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | | <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" /> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <basic-container> |
| | | <avue-crud |
| | | :addBtn="false" |
| | |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | import NProgress from 'nprogress'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | import { getDeptLazyTree } from '@/api/system/dept'; |
| | | export default { |
| | | data() { |
| | | var that = this; |
| | | return { |
| | | treeOption: { |
| | | nodeKey: 'id', |
| | | 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, |
| | | size: 'small', |
| | | props: { |
| | | labelText: '标题', |
| | | label: 'title', |
| | | value: 'value', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | treeData: [], |
| | | treePropsConfig: { |
| | | value: 'id', |
| | | label: 'title', |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | initData(tenantId) { |
| | | axios({ |
| | | url: 'blade-system/dept/tree', |
| | | method: 'get' |
| | | }).then( |
| | | res => { |
| | | //const column = this.findObject(this.option.column, 'parentId'); |
| | | //column.dicData = res.data.data; |
| | | } |
| | | ); |
| | | nodeClick(data) { |
| | | this.treeDeptId = data.id; |
| | | this.mypage.current = 1; |
| | | this.onLoad(this.page); |
| | | }, |
| | | handleAdd() { |
| | | this.machineTitle = "新增"; |
| | |
| | | machineGroupCode: this.search.machineGroupName, |
| | | current: this.mypage.current, |
| | | size: this.mypage.size, |
| | | deptId: this.treeDeptId |
| | | } |
| | | axios({ |
| | | url: '/blade-mdm/machine/page', |