workingFace.data.ts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { list, modalList, huifengids, beiyong, qita, cheliang, dongshi, juejin, caimei } from './workingFace.api';
  4. export const columns: BasicColumn[] = [
  5. {
  6. title: '系统名称',
  7. dataIndex: 'strname',
  8. width: 120,
  9. },
  10. // {
  11. // title: '系统型号',
  12. // dataIndex: 'strinstallpos',
  13. // width: 100,
  14. // },
  15. {
  16. title: '系统Code',
  17. dataIndex: 'nwindowtype_dictText',
  18. width: 100,
  19. },
  20. {
  21. title: '类型',
  22. dataIndex: 'strtype',
  23. width: 80,
  24. },
  25. {
  26. title: '模型ID',
  27. dataIndex: 'fperheight',
  28. width: 100,
  29. },
  30. {
  31. title: '控制策略',
  32. dataIndex: 'nwindow',
  33. width: 100,
  34. },
  35. {
  36. title: '风向',
  37. width: 150,
  38. dataIndex: 'stationname',
  39. },
  40. ];
  41. export const recycleColumns: BasicColumn[] = [
  42. {
  43. title: '名称',
  44. dataIndex: 'strname',
  45. width: 100,
  46. },
  47. {
  48. title: '是否为常闭型',
  49. dataIndex: 'bnormalclose',
  50. width: 100,
  51. },
  52. ];
  53. export const searchFormSchema: FormSchema[] = [
  54. {
  55. label: '系统类型',
  56. field: 'strtype',
  57. component: 'JDictSelectTag',
  58. colProps: { span: 6 },
  59. componentProps: {
  60. dictCode: 'syskind',
  61. placeholder: '请选择系统型号',
  62. },
  63. },
  64. {
  65. label: '系统名称',
  66. field: 'systemname',
  67. component: 'Input',
  68. colProps: { span: 6 },
  69. },
  70. ];
  71. export const commentFormSchema = (strtype) => {
  72. return [
  73. {
  74. label: '',
  75. field: 'id',
  76. component: 'Input',
  77. show: false,
  78. },
  79. {
  80. label: '系统名称',
  81. field: 'systemname',
  82. component: 'Input',
  83. },
  84. {
  85. label: '系统Code',
  86. field: 'code',
  87. component: 'Input',
  88. },
  89. {
  90. label: '系统类型',
  91. field: 'strtype',
  92. component: 'JDictSelectTag',
  93. defaultValue: strtype,
  94. required: true,
  95. componentProps: {
  96. disabled: true,
  97. dictCode: 'syskind',
  98. placeholder: '请选择系统型号',
  99. },
  100. },
  101. {
  102. label: '模型ID',
  103. field: 'nmodelid',
  104. component: 'ApiSelect',
  105. componentProps: () => {
  106. return {
  107. api: modalList,
  108. resultField: 'records',
  109. labelField: 'strmodelname',
  110. valueField: 'nmodelid',
  111. };
  112. },
  113. },
  114. {
  115. label: '控制策略',
  116. field: 'workmode',
  117. component: 'JDictSelectTag',
  118. componentProps: {
  119. dictCode: 'workmode',
  120. placeholder: '请选择控制策略',
  121. stringToNumber: true,
  122. },
  123. },
  124. {
  125. label: '监测类型',
  126. field: 'monitorflag_dictText',
  127. component: 'JDictSelectTag',
  128. componentProps: {
  129. dictCode: 'monitorflag',
  130. placeholder: '请选择状态',
  131. },
  132. },
  133. {
  134. label: '风向',
  135. field: 'windkind',
  136. component: 'JDictSelectTag',
  137. componentProps: {
  138. dictCode: 'winddir',
  139. placeholder: '请选择风向',
  140. stringToNumber: true,
  141. },
  142. },
  143. {
  144. label: '所属回风系统',
  145. field: 'huifengid',
  146. component: 'ApiSelect',
  147. componentProps: () => {
  148. return {
  149. api: huifengids,
  150. labelField: 'huifeng_name',
  151. valueField: 'id',
  152. resultField: 'obj',
  153. };
  154. },
  155. },
  156. {
  157. label: '关联需风量地点',
  158. field: 'xufengliangid',
  159. component: 'ApiSelect',
  160. componentProps: ({ formModel }) => {
  161. let api;
  162. if (formModel['strtype'] == 'sys_dongshi') {
  163. api = dongshi;
  164. } else if (formModel['strtype'] == 'sys_cheliang') {
  165. api = cheliang;
  166. } else if (formModel['strtype'] == 'sys_surface_juejin') {
  167. api = juejin;
  168. } else if (formModel['strtype'] == 'sys_surface_caimei') {
  169. api = caimei;
  170. } else if (formModel['strtype'] == 'sys_surface_beiyong') {
  171. api = beiyong;
  172. } else if (formModel['strtype'] == 'sys_other') {
  173. api = qita;
  174. }
  175. if (api)
  176. return {
  177. api: api.bind(null, { id: formModel['huifengid'] }),
  178. labelField: 'work_name',
  179. valueField: 'id',
  180. resultField: 'obj',
  181. };
  182. },
  183. },
  184. {
  185. label: '模型类型',
  186. field: 'strsystype',
  187. component: 'JDictSelectTag',
  188. componentProps: ({ formModel }) => {
  189. if (formModel['strtype']) {
  190. console.log('场景类型---->', formModel['strtype']);
  191. return {
  192. dictCode: `${formModel['strtype']}_modal`,
  193. placeholder: '请选择模型类型',
  194. };
  195. }
  196. return {
  197. options: [],
  198. };
  199. },
  200. },
  201. {
  202. label: '是否绑定采空区',
  203. field: 'linkEmptyFlag',
  204. component: 'RadioGroup',
  205. defaultValue: 0,
  206. componentProps: ({ formActionType }) => {
  207. return {
  208. options: [
  209. { label: '绑定采空区', value: 1, key: '1' },
  210. { label: '不绑定', value: 0, key: '2' },
  211. ],
  212. onChange: (e: any) => {
  213. const { updateSchema } = formActionType;
  214. updateSchema({
  215. field: 'linkEmpty',
  216. label: '绑定采空区ID',
  217. component: 'ApiSelect',
  218. show: e.target.value == 1 ? true : false,
  219. componentProps: () => {
  220. return {
  221. api: list.bind(null, { strtype: 'sys_empty', pageSize: 1000 }),
  222. labelField: 'systemname',
  223. valueField: 'id',
  224. resultField: 'records',
  225. };
  226. },
  227. });
  228. },
  229. };
  230. },
  231. },
  232. {
  233. label: '绑定采空区ID',
  234. field: 'linkEmpty',
  235. component: 'ApiSelect',
  236. show: false,
  237. componentProps: () => {
  238. return {
  239. api: list.bind(null, { strtype: 'sys_empty', pageSize: 1000 }),
  240. labelField: 'systemname',
  241. valueField: 'id',
  242. resultField: 'records',
  243. };
  244. },
  245. },
  246. ];
  247. };