yy-permission
v1.0.7
Published
权限组件
Downloads
3
Readme
人员权限组件
- 安装依赖
npm i -S yy-permission
- 合并urls
//src/utils/urls.js
import { urls } from "permission-components";
const restUrl = {xxx}
export default Object.assign(urls, restUrl);
- 添加人员状态(需要的话)
//src/utils/constants.js
const PSTATES = {
4: { text: "其他", value: 4 }
};
export { XXX, PSTATES };
// 需要export名为PSTATE的常量
组件内置滚动条 需设置组件外容器高度100%
用户管理:UserManage.vue
- 使用方式
import { UserManage } from "permission-components";
export default { components: { UserManage } };
- 依赖用户拓展字段组件 在项目src/components文件夹下创建UserExt.vue组件
<template>
<div>
<el-col :span="colWidth">
<!-- <el-form-item label="身份证号(拓展信息)" prop="identityNo" :rules="rules.RCN"> -->
<el-form-item label="身份证号(拓展信息)" prop="identityNo">
<el-input v-model="user.identityNo" :disabled="disabled"></el-input>
</el-form-item>
</el-col>
</div>
</template>
<script>
export default {
props: {
user: { type: Object, default: {} },
colWidth: { type: Number, default: 12 },
disabled: { type: Boolean, default: false },
rules: { type: Object, default: () => {} }
},
created() {
this.$set(this.user, "identityNo");
},
data() {return {};}
};
</script>
- 参数说明:
- restKey:发送请求projectConfig下key指 默认值 default
- colWidth:用户表单item宽度 默认12
- dialogWidth:用户表单弹出框宽度 默认 700px
角色管理:RoleManage.vue
- 使用方式
import { RoleManage } from "permission-components";
export default { components: { RoleManage } };
- 参数说明: restKey:发送请求projectConfig下key指 默认值 default
机构管理:DepartManage.vue
- 使用方式
import { DepartManage } from "permission-components";
export default { components: { DepartManage } };
- 参数说明: restKey:发送请求projectConfig下key指 默认值 default
权限管理 :PrivilegeManage.vue
- 使用方式
import { preImg } from "../../../config/project/project.env";
import { PrivilegeManage } from "permission-components";
export default {
components: { PrivilegeManage },
data() {
return { preImg: preImg };
}
};
- 参数说明:
- restKey:发送请求projectConfig下key指 默认值 default
- preImg:图片预览前缀
- uploadKey:文件上传接口urls中的key 默认值 uploadImg(fileUpload/uploadImg)