Merge remote-tracking branch 'origin/master'

This commit is contained in:
paidaxing444
2020-04-18 20:08:28 +08:00
11 changed files with 460 additions and 282 deletions

View File

@ -57,6 +57,7 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.parentId != 200"
size="mini"
type="text"
icon="el-icon-edit"
@ -64,6 +65,7 @@
v-hasPermi="['system:dept:edit']"
>修改</el-button>
<el-button
v-if="scope.row.deptId < 200"
size="mini"
type="text"
icon="el-icon-plus"
@ -71,7 +73,7 @@
v-hasPermi="['system:dept:add']"
>新增</el-button>
<el-button
v-if="scope.row.parentId != 0"
v-if="scope.row.parentId != 0 && scope.row.parentId != 200"
size="mini"
type="text"
icon="el-icon-delete"
@ -158,6 +160,7 @@ export default {
components: { Treeselect },
data() {
return {
sh: false,
// 遮罩层
loading: true,
// 表格树数据

View File

@ -107,7 +107,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -137,6 +137,15 @@
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="岗位用途" prop="purp">
<el-radio-group v-model="form.purp">
<el-radio
v-for="dict in purpOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
@ -150,7 +159,14 @@
</template>
<script>
import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/api/system/post";
import {
listPost,
getPost,
delPost,
addPost,
updatePost,
exportPost
} from "@/api/system/post";
export default {
name: "Post",
@ -174,13 +190,16 @@ export default {
open: false,
// 状态数据字典
statusOptions: [],
// 岗位用途
purpOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
postCode: undefined,
postName: undefined,
status: undefined
status: undefined,
purp: undefined
},
// 表单参数
form: {},
@ -203,6 +222,9 @@ export default {
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
this.getDicts("sys_purpose").then(response => {
this.purpOptions = response.data;
});
},
methods: {
/** 查询岗位列表 */
@ -231,6 +253,7 @@ export default {
postName: undefined,
postSort: 0,
status: "0",
purp: "1",
remark: undefined
};
this.resetForm("form");
@ -247,9 +270,9 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.postId)
this.single = selection.length!=1
this.multiple = !selection.length
this.ids = selection.map(item => item.postId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -260,7 +283,7 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const postId = row.postId || this.ids
const postId = row.postId || this.ids;
getPost(postId).then(response => {
this.form = response.data;
this.open = true;
@ -298,29 +321,39 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const postIds = row.postId || this.ids;
this.$confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?', "警告", {
this.$confirm(
'是否确认删除岗位编号为"' + postIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}
)
.then(function() {
return delPost(postIds);
}).then(() => {
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
})
.catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有岗位数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$confirm("是否确认导出所有岗位数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(function() {
return exportPost(queryParams);
}).then(response => {
})
.then(response => {
this.download(response.msg);
}).catch(function() {});
})
.catch(function() {});
}
}
};

View File

@ -173,6 +173,15 @@
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="用途">
<el-radio-group v-model="form.purpose">
<el-radio
v-for="dict in purposeOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="菜单权限">
<el-tree
:data="menuOptions"
@ -233,9 +242,24 @@
</template>
<script>
import { listRole, getRole, delRole, addRole, updateRole, exportRole, dataScope, changeRoleStatus } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
import {
listRole,
getRole,
delRole,
addRole,
updateRole,
exportRole,
dataScope,
changeRoleStatus
} from "@/api/system/role";
import {
treeselect as menuTreeselect,
roleMenuTreeselect
} from "@/api/system/menu";
import {
treeselect as deptTreeselect,
roleDeptTreeselect
} from "@/api/system/dept";
export default {
name: "Role",
@ -263,6 +287,8 @@ export default {
dateRange: [],
// 状态数据字典
statusOptions: [],
// 用途数据字典
purposeOptions: [],
// 数据范围选项
dataScopeOptions: [
{
@ -296,7 +322,8 @@ export default {
pageSize: 10,
roleName: undefined,
roleKey: undefined,
status: undefined
status: undefined,
purpose: undefined
},
// 表单参数
form: {},
@ -323,6 +350,9 @@ export default {
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
this.getDicts("sys_purpose").then(response => {
this.purposeOptions = response.data;
});
},
methods: {
/** 查询角色列表 */
@ -383,15 +413,22 @@ export default {
// 角色状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', "警告", {
this.$confirm(
'确认要"' + text + '""' + row.roleName + '"角色吗?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}
)
.then(function() {
return changeRoleStatus(row.roleId, row.status);
}).then(() => {
})
.then(() => {
this.msgSuccess(text + "成功");
}).catch(function() {
})
.catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
},
@ -418,7 +455,8 @@ export default {
status: "0",
menuIds: [],
deptIds: [],
remark: undefined
remark: undefined,
purpose: "1"
};
this.resetForm("form");
},
@ -435,9 +473,9 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.roleId)
this.single = selection.length!=1
this.multiple = !selection.length
this.ids = selection.map(item => item.roleId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -449,7 +487,7 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const roleId = row.roleId || this.ids
const roleId = row.roleId || this.ids;
this.$nextTick(() => {
this.getRoleMenuTreeselect(roleId);
});
@ -519,29 +557,39 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {
this.$confirm(
'是否确认删除角色编号为"' + roleIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}
)
.then(function() {
return delRole(roleIds);
}).then(() => {
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
})
.catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有角色数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
this.$confirm("是否确认导出所有角色数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(function() {
return exportRole(queryParams);
}).then(response => {
})
.then(response => {
this.download(response.msg);
}).catch(function() {});
})
.catch(function() {});
}
}
};