substation.data.ts 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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') {
  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. isSearch: 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. show: false,
  187. },
  188. {
  189. label: '请求参数或读取文件名',
  190. field: 'reqparam',
  191. component: 'Input',
  192. },
  193. {
  194. label: '数据属性字段(json中数据列表的字段-)',
  195. field: 'dataproperty',
  196. component: 'Input',
  197. },
  198. {
  199. label: 'ID字段',
  200. field: 'idcode',
  201. component: 'Input',
  202. },
  203. {
  204. label: '名称code',
  205. field: 'namecode',
  206. component: 'Input',
  207. },
  208. {
  209. label: '连接用户名',
  210. field: 'remoteUser',
  211. component: 'Input',
  212. },
  213. {
  214. label: '连接密码',
  215. field: 'remotePass',
  216. component: 'Input',
  217. },
  218. {
  219. label: '数据格式化',
  220. field: 'dataformat',
  221. component: 'Input',
  222. },
  223. {
  224. label: '字符串分割符',
  225. field: 'splitchar',
  226. component: 'Input',
  227. },
  228. {
  229. label: '控制请求地址',
  230. field: 'control_strip',
  231. component: 'Input',
  232. },
  233. {
  234. label: '控制请求类型',
  235. field: 'control_reqtype',
  236. component: 'JDictSelectTag',
  237. componentProps: {
  238. dictCode: 'reqtype',
  239. placeholder: '请选择控制请求方式',
  240. },
  241. },
  242. {
  243. label: '控制请求Header',
  244. field: 'control_header',
  245. component: 'Input',
  246. },
  247. {
  248. label: '控制请求参数',
  249. field: 'control_reqparam',
  250. component: 'Input',
  251. },
  252. {
  253. label: '登录地址',
  254. field: 'login_url',
  255. component: 'Input',
  256. },
  257. {
  258. label: '登录结果解析(返回的token读取字段)',
  259. field: 'loginResult',
  260. component: 'Input',
  261. },
  262. {
  263. label: '备注',
  264. field: 'strremark',
  265. component: 'InputTextArea',
  266. },
  267. ];