|
@ -1,21 +1,15 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="app-container"> |
|
|
<div class="app-container"> |
|
|
<el-row class="container-main" :gutter="20"> |
|
|
<el-row class="container-main" :gutter="20"> |
|
|
<!--侧边部门数据--> |
|
|
|
|
|
|
|
|
<!--左侧树状数据--> |
|
|
<el-col class="container-left" :xs="9" :sm="6" :md="5" :lg="4" :xl="4"> |
|
|
<el-col class="container-left" :xs="9" :sm="6" :md="5" :lg="4" :xl="4"> |
|
|
<span class="right-top-line" /> |
|
|
<span class="right-top-line" /> |
|
|
<span class="left-bottom-line" /> |
|
|
<span class="left-bottom-line" /> |
|
|
<div class="head-container" style="color:#fff"> |
|
|
<div class="head-container" style="color:#fff"> |
|
|
档案门类 |
|
|
档案门类 |
|
|
</div> |
|
|
</div> |
|
|
<el-tree |
|
|
|
|
|
:data="deptDatas" |
|
|
|
|
|
:load="getDeptDatas" |
|
|
|
|
|
:props="defaultProps" |
|
|
|
|
|
:expand-on-click-node="false" |
|
|
|
|
|
lazy |
|
|
|
|
|
@node-click="handleNodeClick" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-tree ref="archivesTree" v-loading="crud.loading" :data="crud.data" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current @node-click="handleNodeClick" /> |
|
|
|
|
|
|
|
|
</el-col> |
|
|
</el-col> |
|
|
<!--用户数据--> |
|
|
<!--用户数据--> |
|
|
<el-col class="container-right" :xs="15" :sm="18" :md="19" :lg="20" :xl="20"> |
|
|
<el-col class="container-right" :xs="15" :sm="18" :md="19" :lg="20" :xl="20"> |
|
@ -96,19 +90,20 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
|
|
|
import { getDepts, getDeptSuperior } from '@/api/system/dept' |
|
|
|
|
|
import CRUD, { presenter, header, crud } from '@crud/crud' |
|
|
import CRUD, { presenter, header, crud } from '@crud/crud' |
|
|
import rrOperation from '@crud/RR.operation' |
|
|
import rrOperation from '@crud/RR.operation' |
|
|
import pagination from '@crud/Pagination' |
|
|
import pagination from '@crud/Pagination' |
|
|
import data1 from '../lendManage/data1.json' |
|
|
import data1 from '../lendManage/data1.json' |
|
|
|
|
|
import crudCategory from '@/api/category/category' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
// name: 'User', |
|
|
|
|
|
|
|
|
name: 'RecycleBin', |
|
|
components: { rrOperation, pagination }, |
|
|
components: { rrOperation, pagination }, |
|
|
cruds() { |
|
|
cruds() { |
|
|
return CRUD({ |
|
|
return CRUD({ |
|
|
title: '用户', |
|
|
|
|
|
url: 'api/users', |
|
|
|
|
|
|
|
|
title: '门类', |
|
|
|
|
|
url: 'api/archives-type/menu', |
|
|
|
|
|
crudMethod: { ...crudCategory }, |
|
|
optShow: { |
|
|
optShow: { |
|
|
add: false, |
|
|
add: false, |
|
|
edit: false, |
|
|
edit: false, |
|
@ -131,7 +126,9 @@ export default { |
|
|
depts: [], |
|
|
depts: [], |
|
|
deptDatas: [], |
|
|
deptDatas: [], |
|
|
level: 3, |
|
|
level: 3, |
|
|
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' } |
|
|
|
|
|
|
|
|
// defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' } |
|
|
|
|
|
defaultProps: { children: 'children', label: 'cnName' } |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -142,62 +139,9 @@ export default { |
|
|
getData() { |
|
|
getData() { |
|
|
this.tableData = data1.rows |
|
|
this.tableData = data1.rows |
|
|
}, |
|
|
}, |
|
|
// 获取左侧部门数据 |
|
|
|
|
|
getDeptDatas(node, resolve) { |
|
|
|
|
|
const sort = 'id,desc' |
|
|
|
|
|
const params = { sort: sort } |
|
|
|
|
|
if (typeof node !== 'object') { |
|
|
|
|
|
if (node) { |
|
|
|
|
|
params['name'] = node |
|
|
|
|
|
} |
|
|
|
|
|
} else if (node.level !== 0) { |
|
|
|
|
|
params['pid'] = node.data.id |
|
|
|
|
|
} |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
getDepts(params).then(res => { |
|
|
|
|
|
if (resolve) { |
|
|
|
|
|
resolve(res.content) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.deptDatas = res.content |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, 100) |
|
|
|
|
|
}, |
|
|
|
|
|
getDepts() { |
|
|
|
|
|
getDepts({ enabled: true }).then(res => { |
|
|
|
|
|
this.depts = res.content.map(function(obj) { |
|
|
|
|
|
if (obj.hasChildren) { |
|
|
|
|
|
obj.children = null |
|
|
|
|
|
} |
|
|
|
|
|
return obj |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
getSupDepts(deptId) { |
|
|
|
|
|
getDeptSuperior(deptId).then(res => { |
|
|
|
|
|
const date = res.content |
|
|
|
|
|
this.buildDepts(date) |
|
|
|
|
|
this.depts = date |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
buildDepts(depts) { |
|
|
|
|
|
depts.forEach(data => { |
|
|
|
|
|
if (data.children) { |
|
|
|
|
|
this.buildDepts(data.children) |
|
|
|
|
|
} |
|
|
|
|
|
if (data.hasChildren && !data.children) { |
|
|
|
|
|
data.children = null |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 切换部门 |
|
|
|
|
|
|
|
|
// 切换菜单 |
|
|
handleNodeClick(data) { |
|
|
handleNodeClick(data) { |
|
|
if (data.pid === 0) { |
|
|
|
|
|
this.query.deptId = null |
|
|
|
|
|
} else { |
|
|
|
|
|
this.query.deptId = data.id |
|
|
|
|
|
} |
|
|
|
|
|
this.crud.toQuery() |
|
|
|
|
|
|
|
|
console.log(data) |
|
|
}, |
|
|
}, |
|
|
// 彻底删除 |
|
|
// 彻底删除 |
|
|
handleDelete() { |
|
|
handleDelete() { |
|
|