business.ts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. export const loginModuleLabels: Record<UnionKey.LoginModule, string> = {
  2. 'pwd-login': '账密登录',
  3. 'code-login': '手机验证码登录',
  4. register: '注册',
  5. 'reset-pwd': '重置密码',
  6. 'bind-wechat': '微信绑定'
  7. };
  8. export const userRoleLabels: Record<Auth.RoleType, string> = {
  9. super: '超级管理员',
  10. admin: '管理员',
  11. user: '普通用户'
  12. };
  13. export const userRoleOptions: Common.OptionWithKey<Auth.RoleType>[] = [
  14. { value: 'super', label: userRoleLabels.super },
  15. { value: 'admin', label: userRoleLabels.admin },
  16. { value: 'user', label: userRoleLabels.user }
  17. ];
  18. /** 用户性别 */
  19. export const genderLabels: Record<UserManagement.GenderKey, string> = {
  20. 0: '女',
  21. 1: '男'
  22. };
  23. export const genderOptions: Common.OptionWithKey<UserManagement.GenderKey>[] = [
  24. { value: '0', label: genderLabels['0'] },
  25. { value: '1', label: genderLabels['1'] }
  26. ];
  27. /** 用户状态 */
  28. export const userStatusLabels: Record<UserManagement.UserStatusKey, string> = {
  29. 1: '启用',
  30. 2: '禁用',
  31. 3: '冻结',
  32. 4: '软删除'
  33. };
  34. export const userStatusOptions: Common.OptionWithKey<UserManagement.UserStatusKey>[] = [
  35. { value: '1', label: userStatusLabels['1'] },
  36. { value: '2', label: userStatusLabels['2'] },
  37. { value: '3', label: userStatusLabels['3'] },
  38. { value: '4', label: userStatusLabels['4'] }
  39. ];
  40. /**
  41. * 0 无效类型
  42. * 1 日期类型
  43. * 2 时间类型
  44. * 3 字符串
  45. * 4 小数类型
  46. * 5 bool类型
  47. * 6 整数类型
  48. */
  49. export const fieldTypeLabels: Record<BackgroundField.FieldTypeKey, string> = {
  50. 0: '无效类型',
  51. 1: '日期类型',
  52. 2: '时间类型',
  53. 3: '字符串',
  54. 4: '小数类型',
  55. 5: '布尔类型',
  56. 6: '整数类型'
  57. };
  58. export const fieldTypeOptions: Common.OptionWithKey<BackgroundField.FieldTypeKey>[] = [
  59. { value: 1, label: fieldTypeLabels['1'] },
  60. { value: 2, label: fieldTypeLabels['2'] },
  61. { value: 3, label: fieldTypeLabels['3'] },
  62. { value: 4, label: fieldTypeLabels['4'] },
  63. { value: 5, label: fieldTypeLabels['5'] },
  64. { value: 6, label: fieldTypeLabels['6'] }
  65. ];
  66. /**
  67. * 组件类型
  68. * 0 单行文本
  69. * 1 多行文本
  70. * 2 下拉框
  71. * 3 单选框
  72. * 4 多选框
  73. * 5 日期选择器
  74. * 6 时间选择器
  75. * 7 开关
  76. */
  77. export const componentsTypeLabels: Record<BackgroundField.ComponentsTypeKey, string> = {
  78. 0: '单行文本',
  79. 1: '多行文本',
  80. 2: '下拉框',
  81. 3: '单选框',
  82. 4: '多选框',
  83. 5: '日期选择器',
  84. 6: '时间选择器',
  85. 7: '开关'
  86. };
  87. export const componentsTypeOptions: Common.OptionWithKey<BackgroundField.ComponentsTypeKey>[] = [
  88. { value: 0, label: componentsTypeLabels['0'] },
  89. { value: 1, label: componentsTypeLabels['1'] },
  90. { value: 2, label: componentsTypeLabels['2'] },
  91. { value: 3, label: componentsTypeLabels['3'] },
  92. { value: 4, label: componentsTypeLabels['4'] },
  93. { value: 5, label: componentsTypeLabels['5'] },
  94. { value: 6, label: componentsTypeLabels['6'] }
  95. ];
  96. export const EventIsShowLabels: Record<BackgroundEvent.IsShowKey, string> = {
  97. 0: '无效',
  98. 1: '是',
  99. 2: '否'
  100. };
  101. export const EventIsShowOptions: Common.OptionWithKey<BackgroundEvent.IsShowKey>[] = [
  102. { value: 0, label: EventIsShowLabels['0'] },
  103. { value: 1, label: EventIsShowLabels['1'] },
  104. { value: 2, label: EventIsShowLabels['2'] }
  105. ];
  106. export const IndicatorsIsShowLabels: Record<BackgroundIndicators.IsShowKey, string> = {
  107. 0: '无效',
  108. 1: '是',
  109. 2: '否'
  110. };
  111. export const IndicatorsOptions: Common.OptionWithKey<BackgroundEvent.IsShowKey>[] = [
  112. { value: 0, label: IndicatorsIsShowLabels['0'] },
  113. { value: 1, label: IndicatorsIsShowLabels['1'] },
  114. { value: 2, label: IndicatorsIsShowLabels['2'] }
  115. ];
  116. export const EditSelectBoxIsShow: Common.OptionWithKey<number>[] = [
  117. { label: '是', value: 1 },
  118. { label: '否', value: 2 }
  119. ];
  120. export const EditSelectBoxShowLine: Common.OptionWithKey<number>[] = [
  121. { label: '1行', value: 1 },
  122. { label: '2行', value: 2 },
  123. { label: '3行', value: 3 }
  124. ];
  125. export const EditSelectBoxDataSource: Common.OptionWithKey<number>[] = [
  126. { label: '录入', value: 1 },
  127. { label: '自动生成', value: 2 }
  128. ];
  129. export const EditSelectBoxTriggerOperation: Common.OptionWithKey<number>[] = [
  130. { label: '新增', value: 1 },
  131. { label: '删除', value: 2 }
  132. ];
  133. export const EditSelectBoxStartTime: Common.OptionWithKey<number>[] = [
  134. { label: '等于当天', value: 1 },
  135. { label: '大于当天', value: 2 },
  136. { label: '大于等于当天', value: 3 }
  137. ];
  138. export const WorkflowIsShowLabels: Record<BackgroundWorkflow.IsShowKey, string> = {
  139. 0: '无效',
  140. 1: '是',
  141. 2: '否'
  142. };
  143. export const MqttPastureIsGroupLabels: Record<ApiMqttPasture.IsGroupKey, string> = {
  144. 0: '无效',
  145. 1: '是',
  146. 2: '否'
  147. };
  148. export const MqttPastureIsGroupOptions: Common.OptionWithKey<ApiMqttPasture.IsGroupKey>[] = [
  149. { value: 1, label: MqttPastureIsGroupLabels['1'] },
  150. { value: 2, label: MqttPastureIsGroupLabels['2'] }
  151. ];
  152. /** 主题动作 */
  153. export const userTopicAccessLabel: Record<ApiMqttUser.IsAccessKey, string> = {
  154. 1: '发布',
  155. 2: '订阅',
  156. 3: '发布订阅'
  157. };
  158. export const UserTopicAccessOptions: Common.OptionWithKey<ApiMqttUser.IsAccessKey>[] = [
  159. { value: 1, label: userTopicAccessLabel['1'] },
  160. { value: 2, label: userTopicAccessLabel['2'] },
  161. { value: 3, label: userTopicAccessLabel['3'] }
  162. ];
  163. /** 主题动作 */
  164. export const topicAccessLabel: Record<ApiMqttTopic.AccessKey, string> = {
  165. 1: '订阅',
  166. 2: '发布'
  167. };
  168. export const TopicAccessOptions: Common.OptionWithKey<ApiMqttTopic.AccessKey>[] = [
  169. { value: 1, label: topicAccessLabel['1'] },
  170. { value: 2, label: topicAccessLabel['2'] }
  171. ];