|
|
|
@ -1,49 +1,58 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<basic-container> |
|
|
|
<el-row> |
|
|
|
<avue-crud :option="option" |
|
|
|
<el-col :span="5"> |
|
|
|
:table-loading="loading" |
|
|
|
<basic-container> |
|
|
|
:data="data" |
|
|
|
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/> |
|
|
|
ref="crud" |
|
|
|
</basic-container> |
|
|
|
v-model="form" |
|
|
|
</el-col> |
|
|
|
:permission="permissionList" |
|
|
|
<el-col :span="19"> |
|
|
|
@row-del="rowDel" |
|
|
|
<basic-container> |
|
|
|
@row-update="rowUpdate" |
|
|
|
<avue-crud :option="option" |
|
|
|
@row-save="rowSave" |
|
|
|
:table-loading="loading" |
|
|
|
:before-open="beforeOpen" |
|
|
|
:data="data" |
|
|
|
:page="page" |
|
|
|
ref="crud" |
|
|
|
@search-change="searchChange" |
|
|
|
v-model="form" |
|
|
|
@search-reset="searchReset" |
|
|
|
:permission="permissionList" |
|
|
|
@selection-change="selectionChange" |
|
|
|
@row-del="rowDel" |
|
|
|
@current-change="currentChange" |
|
|
|
@row-update="rowUpdate" |
|
|
|
@size-change="sizeChange" |
|
|
|
@row-save="rowSave" |
|
|
|
@refresh-change="refreshChange" |
|
|
|
:before-open="beforeOpen" |
|
|
|
@on-load="onLoad"> |
|
|
|
:page="page" |
|
|
|
<template slot="menuLeft"> |
|
|
|
@search-change="searchChange" |
|
|
|
<el-button type="danger" |
|
|
|
@search-reset="searchReset" |
|
|
|
size="small" |
|
|
|
@selection-change="selectionChange" |
|
|
|
icon="el-icon-delete" |
|
|
|
@current-change="currentChange" |
|
|
|
plain |
|
|
|
@size-change="sizeChange" |
|
|
|
v-if="permission.user_delete" |
|
|
|
@refresh-change="refreshChange" |
|
|
|
@click="handleDelete">删 除 |
|
|
|
@on-load="onLoad"> |
|
|
|
</el-button> |
|
|
|
<template slot="menuLeft"> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="danger" |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
|
plain |
|
|
|
icon="el-icon-delete" |
|
|
|
v-if="permission.user_reset" |
|
|
|
plain |
|
|
|
icon="el-icon-refresh" |
|
|
|
v-if="permission.user_delete" |
|
|
|
@click="handleReset">密码重置 |
|
|
|
@click="handleDelete">删 除 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<el-button type="primary" |
|
|
|
<template slot-scope="{row}" |
|
|
|
size="small" |
|
|
|
slot="roleId"> |
|
|
|
plain |
|
|
|
<el-tag>{{row.roleName}}</el-tag> |
|
|
|
v-if="permission.user_reset" |
|
|
|
</template> |
|
|
|
icon="el-icon-refresh" |
|
|
|
<template slot-scope="{row}" |
|
|
|
@click="handleReset">密码重置 |
|
|
|
slot="deptId"> |
|
|
|
</el-button> |
|
|
|
<el-tag>{{row.deptName}}</el-tag> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template slot-scope="{row}" |
|
|
|
</avue-crud> |
|
|
|
slot="roleId"> |
|
|
|
</basic-container> |
|
|
|
<el-tag>{{row.roleName}}</el-tag> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
|
|
|
slot="deptId"> |
|
|
|
|
|
|
|
<el-tag>{{row.deptName}}</el-tag> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
</basic-container> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
@ -92,6 +101,27 @@ |
|
|
|
roleTree: [], |
|
|
|
roleTree: [], |
|
|
|
deptTree: [], |
|
|
|
deptTree: [], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
treeDeptId: '', |
|
|
|
|
|
|
|
treeData: [], |
|
|
|
|
|
|
|
treeOption: { |
|
|
|
|
|
|
|
nodeKey: 'id', |
|
|
|
|
|
|
|
addBtn: false, |
|
|
|
|
|
|
|
menu: false, |
|
|
|
|
|
|
|
size: 'small', |
|
|
|
|
|
|
|
formOption: { |
|
|
|
|
|
|
|
labelWidth: 100, |
|
|
|
|
|
|
|
column: [{ |
|
|
|
|
|
|
|
label: '自定义项', |
|
|
|
|
|
|
|
prop: 'test' |
|
|
|
|
|
|
|
}], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
props: { |
|
|
|
|
|
|
|
labelText: '标题', |
|
|
|
|
|
|
|
label: 'title', |
|
|
|
|
|
|
|
value: 'value', |
|
|
|
|
|
|
|
children: 'children' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
option: { |
|
|
|
option: { |
|
|
|
height: 'auto', |
|
|
|
height: 'auto', |
|
|
|
calcHeight: 350, |
|
|
|
calcHeight: 350, |
|
|
|
@ -153,7 +183,7 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "用户昵称", |
|
|
|
label: "用户昵称", |
|
|
|
prop: "name", |
|
|
|
prop: "name", |
|
|
|
search: true, |
|
|
|
hide: true, |
|
|
|
rules: [{ |
|
|
|
rules: [{ |
|
|
|
required: true, |
|
|
|
required: true, |
|
|
|
message: "请输入用户昵称", |
|
|
|
message: "请输入用户昵称", |
|
|
|
@ -163,6 +193,7 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "用户姓名", |
|
|
|
label: "用户姓名", |
|
|
|
prop: "realName", |
|
|
|
prop: "realName", |
|
|
|
|
|
|
|
search: true, |
|
|
|
rules: [{ |
|
|
|
rules: [{ |
|
|
|
required: true, |
|
|
|
required: true, |
|
|
|
message: "请输入用户姓名", |
|
|
|
message: "请输入用户姓名", |
|
|
|
@ -287,7 +318,28 @@ |
|
|
|
return ids.join(","); |
|
|
|
return ids.join(","); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
nodeClick(data) { |
|
|
|
|
|
|
|
this.treeDeptId = data.id; |
|
|
|
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initData() { |
|
|
|
|
|
|
|
getDeptTree().then(res => { |
|
|
|
|
|
|
|
this.treeData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
getDeptTree(this.form.tenantId).then(res => { |
|
|
|
|
|
|
|
const index = this.$refs.crud.findColumnIndex("deptId"); |
|
|
|
|
|
|
|
this.option.column[index].dicData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
getRoleTree(this.form.tenantId).then(res => { |
|
|
|
|
|
|
|
const index = this.$refs.crud.findColumnIndex("roleId"); |
|
|
|
|
|
|
|
this.option.column[index].dicData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
rowSave(row, loading, done) { |
|
|
|
rowSave(row, loading, done) { |
|
|
|
row.deptId = row.deptId.join(","); |
|
|
|
row.deptId = row.deptId.join(","); |
|
|
|
row.roleId = row.roleId.join(","); |
|
|
|
row.roleId = row.roleId.join(","); |
|
|
|
@ -337,6 +389,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchReset() { |
|
|
|
searchReset() { |
|
|
|
this.query = {}; |
|
|
|
this.query = {}; |
|
|
|
|
|
|
|
this.treeDeptId = ''; |
|
|
|
this.onLoad(this.page); |
|
|
|
this.onLoad(this.page); |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchChange(params) { |
|
|
|
searchChange(params) { |
|
|
|
@ -421,21 +474,13 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(page, params = {}) { |
|
|
|
onLoad(page, params = {}) { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => { |
|
|
|
const data = res.data.data; |
|
|
|
const data = res.data.data; |
|
|
|
this.page.total = data.total; |
|
|
|
this.page.total = data.total; |
|
|
|
this.data = data.records; |
|
|
|
this.data = data.records; |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
this.selectionClear(); |
|
|
|
this.selectionClear(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
getDeptTree(this.form.tenantId).then(res => { |
|
|
|
|
|
|
|
const index = this.$refs.crud.findColumnIndex("deptId"); |
|
|
|
|
|
|
|
this.option.column[index].dicData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
getRoleTree(this.form.tenantId).then(res => { |
|
|
|
|
|
|
|
const index = this.$refs.crud.findColumnIndex("roleId"); |
|
|
|
|
|
|
|
this.option.column[index].dicData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|