workingFace.data.ts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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_other') {
  165. api = qita;
  166. } else if (formModel['strtype'] == 'sys_cheliang') {
  167. api = cheliang;
  168. } else if (formModel['strtype'] == 'sys_surface_juejin') {
  169. api = juejin;
  170. } else if (formModel['strtype'] == 'sys_surface_caimei') {
  171. api = caimei;
  172. } else if (formModel['strtype'] == 'sys_surface_beiyong') {
  173. api = beiyong;
  174. }
  175. return {
  176. api: api.bind(null, { id: formModel['huifengid'] }),
  177. labelField: 'work_name',
  178. valueField: 'id',
  179. resultField: 'obj',
  180. };
  181. },
  182. },
  183. {
  184. label: '模型类型',
  185. field: 'strsystype',
  186. component: 'JDictSelectTag',
  187. componentProps: ({ formModel }) => {
  188. if (formModel['strtype']) {
  189. console.log('场景类型---->', formModel['strtype']);
  190. return {
  191. dictCode: `${formModel['strtype']}_modal`,
  192. placeholder: '请选择模型类型',
  193. };
  194. }
  195. return {
  196. options: [],
  197. };
  198. },
  199. },
  200. {
  201. label: '是否绑定采空区',
  202. field: 'linkEmptyFlag',
  203. component: 'RadioGroup',
  204. defaultValue: 0,
  205. componentProps: ({ formActionType }) => {
  206. return {
  207. options: [
  208. { label: '绑定采空区', value: 1, key: '1' },
  209. { label: '不绑定', value: 0, key: '2' },
  210. ],
  211. onChange: (e: any) => {
  212. const { updateSchema } = formActionType;
  213. updateSchema({
  214. field: 'linkEmpty',
  215. label: '绑定采空区ID',
  216. component: 'ApiSelect',
  217. show: e.target.value == 1 ? true : false,
  218. componentProps: () => {
  219. return {
  220. api: list.bind(null, { strtype: 'sys_empty', pageSize: 1000 }),
  221. labelField: 'systemname',
  222. valueField: 'id',
  223. resultField: 'records',
  224. };
  225. },
  226. });
  227. },
  228. };
  229. },
  230. },
  231. {
  232. label: '绑定采空区ID',
  233. field: 'linkEmpty',
  234. component: 'ApiSelect',
  235. show: false,
  236. componentProps: () => {
  237. return {
  238. api: list.bind(null, { strtype: 'sys_empty', pageSize: 1000 }),
  239. labelField: 'systemname',
  240. valueField: 'id',
  241. resultField: 'records',
  242. };
  243. },
  244. },
  245. ];
  246. };