mirror of
https://github.com/chillzhuang/Saber.git
synced 2024-11-22 02:19:32 +08:00
fix dept tree
This commit is contained in:
parent
d0c6870478
commit
e855fc1ef6
@ -48,3 +48,10 @@ export const getDept = (id) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
export const getDeptTree = () => {
|
||||
return request({
|
||||
url: 'api/blade-system/dept/tree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getList, remove, update, add, getDept } from "@/api/system/dept";
|
||||
import {
|
||||
getList,
|
||||
remove,
|
||||
update,
|
||||
add,
|
||||
getDept,
|
||||
getDeptTree
|
||||
} from "@/api/system/dept";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -64,7 +71,7 @@ export default {
|
||||
{
|
||||
label: "上级部门",
|
||||
prop: "parentId",
|
||||
dicUrl: "api/blade-system/dept/tree",
|
||||
dicData: [],
|
||||
type: "tree",
|
||||
hide: true,
|
||||
props: {
|
||||
@ -171,6 +178,11 @@ export default {
|
||||
getList(page.currentPage, page.pageSize, params).then(res => {
|
||||
const data = res.data.data;
|
||||
this.data = data;
|
||||
getDeptTree().then(res => {
|
||||
const data = res.data.data;
|
||||
const index = this.$refs.crud.findColumnIndex("parentId");
|
||||
this.option.column[index].dicData = data;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,8 @@ export default {
|
||||
this.data = data;
|
||||
getDictTree().then(res => {
|
||||
const data = res.data.data;
|
||||
this.option.column[2].dicData = data;
|
||||
const index = this.$refs.crud.findColumnIndex("parentId");
|
||||
this.option.column[index].dicData = data;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user