columns.data.ts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { getAllRolesList, getAllTenantList } from './columns.api';
  4. import { rules } from '/@/utils/helper/validator';
  5. import { render } from '/@/utils/common/renderUtils';
  6. export const columns: BasicColumn[] = [
  7. {
  8. title: '名称',
  9. dataIndex: 'strname',
  10. width: 120,
  11. },
  12. {
  13. title: '安装位置',
  14. dataIndex: 'strinstallpos',
  15. width: 100,
  16. },
  17. {
  18. title: '是否为常闭型',
  19. dataIndex: 'bnormalclose',
  20. width: 100,
  21. // customRender: render.renderAvatar,
  22. },
  23. {
  24. title: '净宽',
  25. dataIndex: 'fclearwidth',
  26. width: 80,
  27. // sorter: true,
  28. // customRender: ({ text }) => {
  29. // return render.renderDict(text, 'sex');
  30. // },
  31. },
  32. {
  33. title: '净高',
  34. dataIndex: 'fclearheight',
  35. width: 100,
  36. },
  37. {
  38. title: '风门道数',
  39. dataIndex: 'ndoorcount',
  40. width: 100,
  41. },
  42. {
  43. title: '所属分站',
  44. width: 150,
  45. dataIndex: 'stationname',
  46. },
  47. {
  48. title: '点表',
  49. width: 100,
  50. dataIndex: 'strtype',
  51. },
  52. {
  53. title: '监测类型',
  54. dataIndex: 'monitorflag',
  55. width: 100,
  56. },
  57. {
  58. title: '是否模拟数据',
  59. dataIndex: 'testflag',
  60. width: 100,
  61. },
  62. ];
  63. export const recycleColumns: BasicColumn[] = [
  64. {
  65. title: '名称',
  66. dataIndex: 'strname',
  67. width: 100,
  68. },
  69. {
  70. title: '是否为常闭型',
  71. dataIndex: 'bnormalclose',
  72. width: 100,
  73. },
  74. ];
  75. export const searchFormSchema: FormSchema[] = [
  76. {
  77. label: '名称',
  78. field: 'strname',
  79. component: 'Input',
  80. colProps: { span: 6 },
  81. },
  82. {
  83. label: '安装位置',
  84. field: 'strinstallpos',
  85. component: 'Input',
  86. colProps: { span: 6 },
  87. },
  88. {
  89. label: '是否为常闭型',
  90. field: 'bnormalclose',
  91. component: 'JDictSelectTag',
  92. componentProps: {
  93. dictCode: 'user_status',
  94. placeholder: '请选择读写类型',
  95. stringToNumber: true,
  96. },
  97. colProps: { span: 6 },
  98. },
  99. ];
  100. export const formSchema: FormSchema[] = [
  101. {
  102. label: '',
  103. field: 'id',
  104. component: 'Input',
  105. show: false,
  106. },
  107. {
  108. label: '名称',
  109. field: 'strname',
  110. component: 'Input',
  111. },
  112. {
  113. label: '安装位置',
  114. field: 'strinstallpos',
  115. component: 'Input',
  116. },
  117. {
  118. label: '是否为常闭型',
  119. field: 'bnormalclose',
  120. component: 'RadioGroup',
  121. defaultValue: 1,
  122. componentProps: () => {
  123. return {
  124. options: [
  125. { label: '是', value: 1, key: '1' },
  126. { label: '否', value: 0, key: '2' },
  127. ],
  128. };
  129. },
  130. },
  131. {
  132. label: '净宽',
  133. field: 'fclearwidth',
  134. component: 'Input',
  135. },
  136. {
  137. label: '净高',
  138. field: 'fclearheight',
  139. component: 'Input',
  140. },
  141. {
  142. label: '风门道数',
  143. field: 'ndoorcount',
  144. component: 'Input',
  145. },
  146. {
  147. label: '所属分站',
  148. field: 'stationname',
  149. component: 'JDictSelectTag',
  150. componentProps: {
  151. dictCode: 'user_status',
  152. placeholder: '请选择状态',
  153. stringToNumber: true,
  154. },
  155. },
  156. {
  157. label: '点表',
  158. field: 'strtype',
  159. component: 'JDictSelectTag',
  160. componentProps: {
  161. dictCode: 'user_status',
  162. placeholder: '请选择状态',
  163. stringToNumber: true,
  164. },
  165. },
  166. {
  167. label: '监测类型',
  168. field: 'monitorflag',
  169. component: 'JDictSelectTag',
  170. componentProps: {
  171. dictCode: 'user_status',
  172. placeholder: '请选择状态',
  173. stringToNumber: true,
  174. },
  175. },
  176. {
  177. label: '是否模拟数据',
  178. field: 'testflag',
  179. component: 'RadioGroup',
  180. defaultValue: 1,
  181. componentProps: () => {
  182. return {
  183. options: [
  184. { label: '是', value: 1, key: '1' },
  185. { label: '否', value: 0, key: '2' },
  186. ],
  187. };
  188. },
  189. },
  190. ];
  191. export const formPasswordSchema: FormSchema[] = [
  192. {
  193. label: '用户账号',
  194. field: 'username',
  195. component: 'Input',
  196. componentProps: { readOnly: true },
  197. },
  198. {
  199. label: '登录密码',
  200. field: 'password',
  201. component: 'StrengthMeter',
  202. componentProps: {
  203. placeholder: '请输入登录密码',
  204. },
  205. rules: [
  206. {
  207. required: true,
  208. message: '请输入登录密码',
  209. },
  210. ],
  211. },
  212. {
  213. label: '确认密码',
  214. field: 'confirmPassword',
  215. component: 'InputPassword',
  216. dynamicRules: ({ values }) => rules.confirmPassword(values, true),
  217. },
  218. ];
  219. export const formAgentSchema: FormSchema[] = [
  220. {
  221. label: '',
  222. field: 'id',
  223. component: 'Input',
  224. show: false,
  225. },
  226. {
  227. field: 'userName',
  228. label: '用户名',
  229. component: 'Input',
  230. componentProps: {
  231. readOnly: true,
  232. allowClear: false,
  233. },
  234. },
  235. {
  236. field: 'agentUserName',
  237. label: '代理人用户名',
  238. required: true,
  239. component: 'JSelectUser',
  240. componentProps: {
  241. rowKey: 'username',
  242. labelKey: 'realname',
  243. maxSelectCount: 10,
  244. },
  245. },
  246. {
  247. field: 'startTime',
  248. label: '代理开始时间',
  249. component: 'DatePicker',
  250. required: true,
  251. componentProps: {
  252. showTime: true,
  253. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  254. placeholder: '请选择代理开始时间',
  255. },
  256. },
  257. {
  258. field: 'endTime',
  259. label: '代理结束时间',
  260. component: 'DatePicker',
  261. required: true,
  262. componentProps: {
  263. showTime: true,
  264. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  265. placeholder: '请选择代理结束时间',
  266. },
  267. },
  268. {
  269. field: 'status',
  270. label: '状态',
  271. component: 'JDictSelectTag',
  272. defaultValue: '1',
  273. componentProps: {
  274. dictCode: 'valid_status',
  275. type: 'radioButton',
  276. },
  277. },
  278. ];