opendb-app-versions.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema
  2. const validator = {
  3. "appid": {
  4. "rules": [{
  5. "required": true
  6. },
  7. {
  8. "format": "string"
  9. }
  10. ],
  11. "label": "AppID"
  12. },
  13. "name": {
  14. "rules": [{
  15. "format": "string"
  16. }],
  17. "label": "应用名称"
  18. },
  19. "title": {
  20. "rules": [{
  21. "format": "string"
  22. }],
  23. "label": "更新标题"
  24. },
  25. "contents": {
  26. "rules": [{
  27. "required": true
  28. },
  29. {
  30. "format": "string"
  31. }
  32. ],
  33. "label": "更新内容"
  34. },
  35. "platform": {
  36. "rules": [{
  37. "required": true
  38. },
  39. /* 此处不校验数据类型,因为platform在发布app端是单选,在发布wgt时可能是多选
  40. {
  41. "format": "array"
  42. }, */
  43. {
  44. "range": [{
  45. "value": "Android",
  46. "text": "安卓"
  47. },
  48. {
  49. "value": "iOS",
  50. "text": "苹果"
  51. }
  52. ]
  53. }
  54. ],
  55. "label": "平台"
  56. },
  57. "type": {
  58. "rules": [{
  59. "required": true
  60. }, {
  61. "format": "string"
  62. },
  63. {
  64. "range": [{
  65. "value": "native_app",
  66. "text": "原生App安装包"
  67. },
  68. {
  69. "value": "wgt",
  70. "text": "wgt资源包"
  71. }
  72. ]
  73. }
  74. ],
  75. "label": "安装包类型"
  76. },
  77. "version": {
  78. "rules": [{
  79. "required": true
  80. },
  81. {
  82. "format": "string"
  83. }
  84. ],
  85. "label": "版本号"
  86. },
  87. "min_uni_version": {
  88. "rules": [{
  89. "format": "string"
  90. }],
  91. "label": "原生App最低版本"
  92. },
  93. "url": {
  94. "rules": [{
  95. "required": true
  96. }, {
  97. "format": "string"
  98. }],
  99. "label": "链接"
  100. },
  101. "stable_publish": {
  102. "rules": [{
  103. "format": "bool"
  104. }],
  105. "label": "上线发行"
  106. },
  107. "create_date": {
  108. "rules": [{
  109. "format": "timestamp"
  110. }],
  111. "label": "上传时间"
  112. },
  113. "is_silently": {
  114. "rules": [{
  115. "format": "bool"
  116. }],
  117. "label": "静默更新",
  118. "defaultValue": false
  119. },
  120. "is_mandatory": {
  121. "rules": [{
  122. "format": "bool"
  123. }],
  124. "label": "强制更新",
  125. "defaultValue": false
  126. },
  127. "store_list": {
  128. "rules": [{
  129. "format": "array"
  130. }],
  131. "label": "应用市场"
  132. },
  133. }
  134. const enumConverter = {
  135. "platform_valuetotext": [{
  136. "value": "Android",
  137. "text": "安卓"
  138. },
  139. {
  140. "value": "iOS",
  141. "text": "苹果"
  142. }
  143. ],
  144. "type_valuetotext": {
  145. "native_app": "原生App安装包",
  146. "wgt": "wgt资源包"
  147. }
  148. }
  149. export {
  150. validator,
  151. enumConverter
  152. }