substation.data.ts 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { rules } from '/@/utils/helper/validator';
  4. import { render } from '/@/utils/common/renderUtils';
  5. export const columns: BasicColumn[] = [
  6. {
  7. title: '名称',
  8. dataIndex: 'strname',
  9. width: 120,
  10. },
  11. {
  12. title: '安装位置',
  13. dataIndex: 'strinstallpos',
  14. width: 100,
  15. },
  16. {
  17. title: '读取数据方式',
  18. dataIndex: 'strtype',
  19. width: 100,
  20. },
  21. {
  22. title: '分站IP地址',
  23. dataIndex: 'strip',
  24. width: 100,
  25. },
  26. {
  27. title: '链接状态',
  28. dataIndex: 'linkstatus',
  29. width: 100,
  30. },
  31. {
  32. title: '备注',
  33. width: 150,
  34. dataIndex: 'strremark',
  35. },
  36. ];
  37. export const recycleColumns: BasicColumn[] = [
  38. {
  39. title: '名称',
  40. dataIndex: 'strname',
  41. width: 100,
  42. },
  43. {
  44. title: '安装位置',
  45. dataIndex: 'strinstallpos',
  46. width: 100,
  47. },
  48. {
  49. title: '链接状态',
  50. dataIndex: 'linkstatus',
  51. width: 80,
  52. customRender: render.renderAvatar,
  53. },
  54. ];
  55. export const searchFormSchema: FormSchema[] = [
  56. {
  57. label: '监测类型',
  58. field: 'monitorparam',
  59. component: 'MTreeSelect',
  60. componentProps: {
  61. virtual: false,
  62. },
  63. colProps: { span: 6 },
  64. },
  65. {
  66. label: '安装位置',
  67. field: 'strinstallpos',
  68. component: 'Input',
  69. colProps: { span: 6 },
  70. },
  71. {
  72. label: '链接状态',
  73. field: 'linkstatus',
  74. component: 'JDictSelectTag',
  75. componentProps: {
  76. dictCode: 'user_status',
  77. placeholder: '请选择读写类型',
  78. stringToNumber: true,
  79. },
  80. colProps: { span: 6 },
  81. },
  82. ];
  83. export const formSchema: FormSchema[] = [
  84. {
  85. label: '',
  86. field: 'id',
  87. component: 'Input',
  88. show: false,
  89. },
  90. {
  91. label: '名称',
  92. field: 'strname',
  93. component: 'Input',
  94. required: true,
  95. },
  96. {
  97. label: '安装位置',
  98. field: 'strinstallpos',
  99. component: 'Input',
  100. required: true,
  101. },
  102. {
  103. label: '读取数据方式',
  104. field: 'strtype',
  105. component: 'JDictSelectTag',
  106. required: true,
  107. componentProps: ({ formModel, formActionType, schema }) => {
  108. return {
  109. dictCode: 'getdatatype',
  110. placeholder: '请选择分站用途',
  111. onChange: (e: any) => {
  112. const { updateSchema } = formActionType;
  113. if (e == 'plc' || e == 'modbus') {
  114. updateSchema({
  115. field: 'plcType',
  116. show: true,
  117. });
  118. } else {
  119. updateSchema({
  120. field: 'plcType',
  121. show: false,
  122. });
  123. if (e == 'http') {
  124. updateSchema({
  125. label: '请求参数或读取文件名',
  126. field: 'reqparam',
  127. component: 'Input',
  128. required: false,
  129. show: true,
  130. });
  131. }
  132. }
  133. },
  134. };
  135. },
  136. },
  137. {
  138. label: '监测类型',
  139. field: 'monitorparam',
  140. component: 'MTreeSelect',
  141. componentProps: {
  142. virtual: false,
  143. },
  144. },
  145. {
  146. label: '分站IP或请求地址',
  147. field: 'strip',
  148. component: 'Input',
  149. required: true,
  150. },
  151. {
  152. label: '分站端口',
  153. field: 'nport',
  154. component: 'InputNumber',
  155. },
  156. {
  157. label: 'PLC类型',
  158. field: 'plcType',
  159. component: 'JDictSelectTag',
  160. show: true,
  161. componentProps: {
  162. dictCode: 'plcType',
  163. placeholder: '请选择PLC类型',
  164. },
  165. },
  166. {
  167. label: '分站站号',
  168. field: 'code ',
  169. component: 'Input',
  170. },
  171. {
  172. label: '系统缓存点表下标',
  173. field: 'plcTable',
  174. component: 'Input',
  175. },
  176. {
  177. label: '请求方式',
  178. field: 'reqtype',
  179. component: 'JDictSelectTag',
  180. componentProps: {
  181. dictCode: 'reqtype',
  182. placeholder: '请选择请求方式',
  183. },
  184. },
  185. {
  186. label: 'reqHeader请求头',
  187. field: 'reqHeader',
  188. component: 'Input',
  189. },
  190. {
  191. label: '请求参数或读取文件名',
  192. field: 'reqparam',
  193. component: 'Input',
  194. },
  195. {
  196. label: '数据属性字段(json中数据列表的字段-)',
  197. field: 'dataproperty',
  198. component: 'Input',
  199. },
  200. {
  201. label: 'ID字段',
  202. field: 'idcode',
  203. component: 'Input',
  204. },
  205. {
  206. label: '名称code',
  207. field: 'namecode',
  208. component: 'Input',
  209. },
  210. {
  211. label: '连接用户名',
  212. field: 'remoteUser',
  213. component: 'Input',
  214. },
  215. {
  216. label: '连接密码',
  217. field: 'remotePass',
  218. component: 'Input',
  219. },
  220. {
  221. label: '数据格式化',
  222. field: 'dataformat',
  223. component: 'Input',
  224. },
  225. {
  226. label: '字符串分割符',
  227. field: 'splitchar',
  228. component: 'Input',
  229. },
  230. {
  231. label: '控制请求地址',
  232. field: 'controlStrip',
  233. component: 'Input',
  234. },
  235. {
  236. label: '控制请求类型',
  237. field: 'controlReqtype',
  238. component: 'JDictSelectTag',
  239. componentProps: {
  240. dictCode: 'reqtype',
  241. placeholder: '请选择控制请求方式',
  242. },
  243. },
  244. {
  245. label: '控制请求Header',
  246. field: 'controlHeader',
  247. component: 'Input',
  248. },
  249. {
  250. label: '控制请求参数',
  251. field: 'controlReqparam',
  252. component: 'Input',
  253. },
  254. {
  255. label: '登录地址',
  256. field: 'loginUrl',
  257. component: 'Input',
  258. },
  259. {
  260. label: '登录结果解析(返回的token读取字段)',
  261. field: 'loginResult',
  262. component: 'Input',
  263. },
  264. {
  265. label: '备注',
  266. field: 'strremark',
  267. component: 'InputTextArea',
  268. },
  269. ];