role.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (c) 2018-2025, lengleng All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the pig4cloud.com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: lengleng (wangiegie@gmail.com)
  16. */
  17. import { rule } from "@/util/validateRules";
  18. export const tableOption = {
  19. border: true,
  20. index: true,
  21. indexLabel: '序号',
  22. stripe: true,
  23. menuAlign: 'center',
  24. searchShow: false,
  25. editBtn: false,
  26. delBtn: false,
  27. align: 'center',
  28. addBtn: false,
  29. viewBtn: true,
  30. column: [{
  31. label: '角色名称',
  32. prop: 'roleName',
  33. span: 24,
  34. rules: [
  35. { required: true, message: '角色名称不能为空', trigger: 'blur' },
  36. { min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur' }
  37. ]
  38. }, {
  39. width: 120,
  40. label: '角色标识',
  41. prop: 'roleCode',
  42. span: 24,
  43. editDisabled: true,
  44. rules: [
  45. { required: true, message: '角色标识不能为空', trigger: 'blur' },
  46. { min: 3, max: 20, message: '长度在 3 到 20 个字符', trigger: 'blur'},
  47. { validator: rule.validatorKey, trigger: 'blur'}
  48. ]
  49. }, {
  50. width: 150,
  51. label: '角色描述',
  52. prop: 'roleDesc',
  53. overHidden: true,
  54. type: 'textarea',
  55. span: 24,
  56. row: true,
  57. minRows: 2,
  58. rules: [
  59. { max: 128, message: '长度在 128 个字符内', trigger: 'blur' }
  60. ]
  61. }, {
  62. width: 180,
  63. label: '数据权限',
  64. prop: 'dsType',
  65. type: 'select',
  66. span: 24,
  67. rules: [
  68. { required: true, message: '请选择数据权限类型', trigger: 'blur'}
  69. ],
  70. dicData: [{
  71. label: '全部',
  72. value: 0
  73. }, {
  74. label: '自定义',
  75. value: 1
  76. }, {
  77. label: '本级及子级',
  78. value: 2
  79. }, {
  80. label: '本级',
  81. value: 3
  82. }]
  83. }, {
  84. label: '',
  85. prop: 'dsScope',
  86. formslot: true,
  87. showClomnu: false,
  88. hide: true
  89. }, {
  90. label: '创建时间',
  91. prop: 'createTime',
  92. type: 'datetime',
  93. format: 'yyyy-MM-dd HH:mm',
  94. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  95. editDisplay: false,
  96. addDisplay: false,
  97. span: 24
  98. }]
  99. }