substation.data.ts 5.2 KB

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