优化字典显示,用户管理增加左树右表

dev
smallchill 6 years ago
parent 02de800cce
commit 6588d5953d
  1. 6
      src/api/system/user.js
  2. 1
      src/const/system/dict.js
  3. 1
      src/const/system/dictbiz.js
  4. 2
      src/const/user/info.js
  5. 2
      src/views/system/dict.vue
  6. 2
      src/views/system/dictbiz.vue
  7. 8
      src/views/system/param.vue
  8. 65
      src/views/system/user.vue

@ -1,16 +1,18 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const getList = (current, size, params) => { export const getList = (current, size, params, deptId) => {
return request({ return request({
url: '/api/blade-user/list', url: '/api/blade-user/page',
method: 'get', method: 'get',
params: { params: {
...params, ...params,
current, current,
size, size,
deptId,
} }
}) })
} }
export const remove = (ids) => { export const remove = (ids) => {
return request({ return request({
url: '/api/blade-user/remove', url: '/api/blade-user/remove',

@ -44,6 +44,7 @@ export const optionParent = {
type: "number", type: "number",
align: "right", align: "right",
width: 80, width: 80,
hide: true,
rules: [ rules: [
{ {
required: true, required: true,

@ -44,6 +44,7 @@ export const optionParent = {
type: "number", type: "number",
align: "right", align: "right",
width: 80, width: 80,
hide: true,
rules: [ rules: [
{ {
required: true, required: true,

@ -13,7 +13,7 @@ export default {
url: 'link', url: 'link',
}, },
canvasOption: { canvasOption: {
text: '', text: ' ',
ratio: 0.1 ratio: 0.1
}, },
action: '/api/blade-resource/oss/endpoint/put-file', action: '/api/blade-resource/oss/endpoint/put-file',

@ -1,5 +1,4 @@
<template> <template>
<div>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<basic-container> <basic-container>
@ -95,7 +94,6 @@
</basic-container> </basic-container>
</el-col> </el-col>
</el-row> </el-row>
</div>
</template> </template>
<script> <script>

@ -1,5 +1,4 @@
<template> <template>
<div>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<basic-container> <basic-container>
@ -95,7 +94,6 @@
</basic-container> </basic-container>
</el-col> </el-col>
</el-row> </el-row>
</div>
</template> </template>
<script> <script>

@ -47,8 +47,8 @@
total: 0 total: 0
}, },
option: { option: {
height:'auto', height: 'auto',
calcHeight:350, calcHeight: 350,
tip: false, tip: false,
border: true, border: true,
index: true, index: true,
@ -189,10 +189,10 @@
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}); });
}, },
currentChange(currentPage){ currentChange(currentPage) {
this.page.currentPage = currentPage; this.page.currentPage = currentPage;
}, },
sizeChange(pageSize){ sizeChange(pageSize) {
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
refreshChange() { refreshChange() {

@ -1,4 +1,11 @@
<template> <template>
<el-row>
<el-col :span="5">
<basic-container>
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
</basic-container>
</el-col>
<el-col :span="19">
<basic-container> <basic-container>
<avue-crud :option="option" <avue-crud :option="option"
:table-loading="loading" :table-loading="loading"
@ -44,6 +51,8 @@
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </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;
});
} }
} }
}; };

Loading…
Cancel
Save