subMatch.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. const checkPhone = (rule, value, callback) => {
  2. if (!value) {
  3. callback(new Error('请输入联系方式'))
  4. } else {
  5. const reg = /^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\d{8}$/
  6. if (reg.test(value)) {
  7. callback()
  8. } else {
  9. return callback(new Error('请输入正确的电话'))
  10. }
  11. }
  12. }
  13. export const tableOption = {
  14. border: true,
  15. index: true,
  16. indexLabel: '序号',
  17. stripe: true,
  18. menuAlign: 'center',
  19. align: 'center',
  20. refreshBtn: false,
  21. showClomnuBtn: false,
  22. searchMenuSpan: 6,
  23. searchSize: 'mini',
  24. menuWidth: 140,
  25. column: [{
  26. fixed: true,
  27. label: 'id',
  28. prop: 'id',
  29. hide: true,
  30. editDisplay: false,
  31. addDisplay: false
  32. }, {
  33. fixed: true,
  34. label: '分赛名称',
  35. prop: 'name',
  36. search: true,
  37. span: 24,
  38. rules: [{
  39. required: true,
  40. message: '请输入分赛名称'
  41. }
  42. ]
  43. },{
  44. label: '主办单位',
  45. prop: 'organizer',
  46. value: '',
  47. span: 24,
  48. rules: [{
  49. required: true,
  50. message: '请输入主办单位'
  51. },
  52. {
  53. min: 3,
  54. max: 20,
  55. message: '长度在 3 到 20 个字符',
  56. trigger: 'blur'
  57. },
  58. ]
  59. }, {
  60. label: '大赛地址',
  61. prop: 'addr',
  62. value: '',
  63. type: 'textarea',
  64. span: 24,
  65. showColumn: false,
  66. rules: [{
  67. required: true,
  68. message: '请输入大赛地址'
  69. },
  70. {
  71. min: 3,
  72. max: 20,
  73. message: '长度在 3 到 20 个字符',
  74. trigger: 'blur'
  75. },
  76. ]
  77. },{
  78. label: '联 系 人',
  79. prop: 'contactUsername',
  80. rules: [{
  81. required: true,
  82. message: '请输入联系人姓名'
  83. },
  84. {
  85. min: 2,
  86. max: 20,
  87. message: '长度在 2 到 20 个字符',
  88. trigger: 'blur'
  89. },
  90. ]
  91. },{
  92. label: '联系电话',
  93. prop: 'contactPhone',
  94. addDisplay: true,
  95. editDisplay: true,
  96. rules: [{
  97. required: true,
  98. message: '手机号不能为空',
  99. trigger: 'blur'
  100. }, {
  101. validator: checkPhone,
  102. trigger: 'blur'
  103. }]
  104. }, {
  105. label: '开始时间',
  106. prop: 'beginTime',
  107. type: 'datetime',
  108. format: 'yyyy-MM-dd HH:mm:ss',
  109. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  110. addDisplay: true,
  111. showColumn: true,
  112. rules: [{
  113. required: true,
  114. message: '请选择开始时间'
  115. }]
  116. }, {
  117. label: '结束时间',
  118. prop: 'endTime',
  119. type: 'datetime',
  120. format: 'yyyy-MM-dd HH:mm:ss',
  121. addDisplay: true,
  122. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  123. showColumn: true,
  124. rules: [{
  125. required: true,
  126. message: '请选择结束时间'
  127. }]
  128. },{
  129. label: '项目上限',
  130. prop: 'maxNum',
  131. type: 'number',
  132. addDisplay: true,
  133. editDisplay: true,
  134. rules: [{
  135. required: true,
  136. message: '请输入项目上限'
  137. }]
  138. },
  139. {
  140. label: '二级分赛',
  141. prop: 'hasChildMatch',
  142. type: 'radio',
  143. slot: true,
  144. border: true,
  145. addDisplay: true,
  146. editDisplay: true,
  147. showColumn: false,
  148. rules: [{
  149. required: true,
  150. message: '请选择是否可以创建二级分赛',
  151. trigger: 'blur'
  152. }],
  153. dicData: [{
  154. label: '允许',
  155. value: 0
  156. }, {
  157. label: '不允许',
  158. value: 1
  159. }]
  160. }
  161. ]
  162. }
  163. export const tableDictItemOption = {
  164. border: true,
  165. index: true,
  166. indexLabel: '序号',
  167. stripe: true,
  168. menuAlign: 'center',
  169. align: 'center',
  170. refreshBtn: false,
  171. showClomnuBtn: false,
  172. searchSize: 'mini',
  173. column: [{
  174. fixed: true,
  175. label: 'id',
  176. prop: 'id',
  177. hide: true,
  178. editDisplay: false,
  179. addDisplay: false
  180. }, {
  181. label: '赛道名称',
  182. prop: 'name',
  183. }, {
  184. width: 150,
  185. label: '最大项目数',
  186. prop: 'maxNum',
  187. rules: [{
  188. required: true,
  189. message: '请输入数据值',
  190. trigger: 'blur'
  191. }]
  192. },]
  193. }