123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- import { filterRoutes, generteMenus } from '@/utils/route'
- import router from '@/router'
- export const handleDisabled = (arr) => {
- arr.forEach((item) => {
- delete item.disabled
- if (item.children.length > 0) {
- handleDisabled(item.children)
- }
- })
- }
- export const Addrolerules = {
- roleName: [
- { required: true, message: '请填写角色名称', trigger: 'blur' },
- { min: 1, max: 15, message: '长度在1到15个字符', trigger: 'blur' }
- ],
- roleKey: [
- { required: true, message: '请填写角色标识', trigger: 'blur' },
- {
- type: 'string',
- pattern: /^[a-zA-Z]{1,15}$/g,
- message: '请输入1到15位的英文字母',
- trigger: 'blur'
- }
- ],
- remark: [{ message: '请填写角色描述', trigger: 'blur' }]
- }
- export const columns = (_this) => {
- return [
- {
- prop: 'roleKey',
- label: '角色标识',
- align: 'center'
- },
- {
- prop: 'roleName',
- label: '角色名称'
- },
- {
- prop: 'createTime',
- label: '创建时间'
- },
- {
- button: true,
- label: '操作',
- width: '200px',
- group: [
- {
- name: '配置菜单',
- type: 'text',
- round: false,
- plain: false,
- onClick: (row, index, scope) => {
- _this.menuClick(scope)
- }
- },
- {
- name: '编辑',
- type: 'text',
- round: false,
- plain: false,
- onClick: (row, index, scope) => {
- _this.edit(scope)
- }
- },
- {
- name: '删除',
- type: 'text',
- round: false,
- plain: false,
- onClick: (row, index, scope) => {
- _this.handRemove(row)
- }
- }
- ]
- }
- ]
- }
- export const options = {
- stripe: false, // 斑马纹
- mutiSelect: false, // 多选框
- index: false, // 显示序号, 多选则 mutiSelect
- loading: false, // 表格动画
- border: true,
- initTable: true, // 是否一挂载就加载数据
- height: 'calc(100vh - 345px)',
- cursor: 'pointer' // 行鼠标形状
- }
- export const rightColumns = (_this) => {
- return [
- {
- prop: 'nickName',
- label: '用户名称',
- align: 'center'
- },
- {
- prop: 'userName',
- label: '登录账号'
- },
- {
- prop: 'deptName',
- label: '所属组织机构'
- },
- {
- prop: 'majorName',
- label: '所属专业'
- },
- {
- prop: 'sex',
- label: '性别',
- width: '80px',
- render: (h, params) => {
- if (params.row.sex == 1) {
- return h('span', '男')
- } else {
- return h('span', '女')
- }
- }
- }
- ]
- }
- export const rightOptions = {
- stripe: false, // 斑马纹
- mutiSelect: true, // 多选框
- index: false, // 显示序号, 多选则 mutiSelect
- loading: false, // 表格动画
- border: true,
- initTable: false, // 是否一挂载就加载数据
- height: 'calc(100vh - 355px)'
- }
|