| | |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | > |
| | | <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column> |
| | | <el-table-column prop="deptName" label="部门名称" width="500"></el-table-column> |
| | | <el-table-column prop="orderNum" label="排序" width="200"></el-table-column> |
| | | <el-table-column prop="status" label="状态" width="100"> |
| | | <template slot-scope="scope"> |
| | |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // 是否展开,默认全部展开 |
| | | isExpandAll: true, |
| | | isExpandAll: false, |
| | | // 重新渲染表格状态 |
| | | refreshTable: true, |
| | | // 查询参数 |
| | |
| | | /** 查询部门列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | console.log(this.queryParams, "dddddd") |
| | | listDept(this.queryParams).then(response => { |
| | | this.deptList = this.handleTree(response.data, "deptId"); |
| | | this.loading = false; |
| | | }); |
| | | |
| | | }, |
| | | /** 转换部门数据结构 */ |
| | | normalizer(node) { |
| | |
| | | const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] }; |
| | | this.deptOptions.push(noResultsOptions); |
| | | } |
| | | if (row.parentId === 0) { |
| | | this.deptOptions.push({ |
| | | deptId: 0, |
| | | deptName: '无', |
| | | children: [] |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |