device.data.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { list } from '../substationTabel/substation.api';
  4. import { listF } from './device.api';
  5. import { getAutoScrollContainer } from '/@/utils/common/compUtils';
  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: '风筒长度(m)',
  19. dataIndex: 'flength',
  20. width: 100,
  21. },
  22. {
  23. title: '风筒直径(m)',
  24. dataIndex: 'fclearwidth',
  25. width: 80,
  26. },
  27. {
  28. title: '风机类型',
  29. dataIndex: 'ntype_dictText',
  30. width: 100,
  31. },
  32. {
  33. title: '所属分站',
  34. width: 150,
  35. dataIndex: 'stationname',
  36. },
  37. ];
  38. export const recycleColumns: BasicColumn[] = [
  39. {
  40. title: '名称',
  41. dataIndex: 'strname',
  42. width: 100,
  43. },
  44. {
  45. title: '是否为常闭型',
  46. dataIndex: 'bnormalclose',
  47. width: 100,
  48. },
  49. ];
  50. export const searchFormSchema: FormSchema[] = [
  51. {
  52. label: '设备类型',
  53. field: 'strtype',
  54. component: 'JDictSelectTag',
  55. componentProps: {
  56. dictCode: '',
  57. placeholder: '请选择设备类型',
  58. },
  59. colProps: { span: 6 },
  60. },
  61. {
  62. label: '安装位置',
  63. field: 'strinstallpos',
  64. component: 'Input',
  65. colProps: { span: 6 },
  66. },
  67. {
  68. label: '所属分站',
  69. field: 'nsubstationid',
  70. component: 'ApiSelect',
  71. colProps: { span: 6 },
  72. componentProps: {
  73. api: list,
  74. labelField: 'strname',
  75. valueField: 'id',
  76. },
  77. },
  78. ];
  79. export const searchFormSchemaF: FormSchema[] = [
  80. {
  81. label: '设备类型',
  82. field: 'devId',
  83. component: 'ApiSelect',
  84. colProps: { span: 6 },
  85. componentProps: {
  86. api: listF.bind(null, { devicekind: 'footageGas' }),
  87. labelField: 'strname',
  88. valueField: 'id',
  89. resultField: 'records',
  90. },
  91. },
  92. {
  93. field: 'starttime',
  94. label: '日期',
  95. component: 'DatePicker',
  96. componentProps: {
  97. showTime: false,
  98. valueFormat: 'YYYY-MM-DD',
  99. getPopupContainer: getAutoScrollContainer,
  100. },
  101. colProps: {
  102. span: 4,
  103. },
  104. },
  105. ];
  106. export const formSchema: FormSchema[] = [
  107. {
  108. label: '',
  109. field: 'id',
  110. component: 'Input',
  111. show: false,
  112. },
  113. {
  114. label: '名称',
  115. field: 'strname',
  116. component: 'Input',
  117. },
  118. {
  119. label: '安装位置',
  120. field: 'strinstallpos',
  121. component: 'Input',
  122. },
  123. {
  124. label: '风筒长度(m)',
  125. field: 'flength',
  126. component: 'InputNumber',
  127. },
  128. {
  129. label: '风筒直径(m)',
  130. field: 'fclearwidth',
  131. component: 'InputNumber',
  132. },
  133. {
  134. label: '风机类型',
  135. field: 'ntype',
  136. component: 'JDictSelectTag',
  137. componentProps: {
  138. dictCode: 'fantype',
  139. placeholder: '请选择状态',
  140. // stringToNumber: true,
  141. },
  142. },
  143. {
  144. label: '所属分站',
  145. field: 'nsubstationid',
  146. component: 'ApiSelect',
  147. componentProps: {
  148. api: list,
  149. labelField: 'strname',
  150. valueField: 'id',
  151. },
  152. },
  153. {
  154. label: '点表',
  155. field: 'strtype',
  156. component: 'JDictSelectTag',
  157. required: true,
  158. componentProps: {
  159. dictCode: 'fanlocalkind',
  160. placeholder: '请选择状态',
  161. },
  162. },
  163. {
  164. label: '监测类型',
  165. field: 'monitorflag_dictText',
  166. component: 'JDictSelectTag',
  167. componentProps: {
  168. dictCode: 'monitorflag',
  169. placeholder: '请选择状态',
  170. },
  171. },
  172. {
  173. label: '是否模拟数据',
  174. field: 'testflag',
  175. component: 'RadioGroup',
  176. defaultValue: 1,
  177. componentProps: () => {
  178. return {
  179. options: [
  180. { label: '是', value: 1, key: '1' },
  181. { label: '否', value: 0, key: '2' },
  182. ],
  183. };
  184. },
  185. },
  186. ];