substation.data.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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: 'monitorparam',
  102. component: 'MTreeSelect',
  103. componentProps: {
  104. isSearch: false
  105. },
  106. },
  107. {
  108. label: '分站站号',
  109. field: 'code ',
  110. component: 'Input',
  111. },
  112. {
  113. label: '分站IP地址',
  114. field: 'strip',
  115. component: 'Input',
  116. required: true,
  117. },
  118. {
  119. label: '分站端口',
  120. field: 'nport',
  121. component: 'InputNumber',
  122. },
  123. {
  124. label: '读取数据方式',
  125. field: 'strtype',
  126. component: 'JDictSelectTag',
  127. required: true,
  128. componentProps: ({ formModel, formActionType, schema }) => {
  129. return {
  130. dictCode: 'getdatatype',
  131. placeholder: '请选择分站用途',
  132. onChange: (e: any) => {
  133. const { updateSchema } = formActionType;
  134. if (e == 'plc') {
  135. updateSchema({
  136. field: 'plcType',
  137. show: true,
  138. });
  139. } else {
  140. updateSchema({
  141. field: 'plcType',
  142. show: false,
  143. });
  144. if (e == 'http') {
  145. updateSchema({
  146. label: 'reqHeader请求头',
  147. field: 'reqparam',
  148. component: 'Input',
  149. required: true,
  150. show: true,
  151. });
  152. }
  153. }
  154. },
  155. };
  156. },
  157. },
  158. {
  159. label: 'PLC类型',
  160. field: 'plcType',
  161. component: 'JDictSelectTag',
  162. show: true,
  163. componentProps: {
  164. dictCode: 'plcType',
  165. placeholder: '请选择PLC类型',
  166. },
  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: '数据属性字段',
  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: 'dataformat',
  211. component: 'Input',
  212. },
  213. {
  214. label: '字符串分割符',
  215. field: 'splitchar',
  216. component: 'Input',
  217. },
  218. {
  219. label: '连接用户名',
  220. field: 'remoteUser',
  221. component: 'Input',
  222. },
  223. {
  224. label: '连接密码',
  225. field: 'remotePass',
  226. component: 'Input',
  227. },
  228. {
  229. label: '图层ID',
  230. field: 'nlayerid',
  231. component: 'Input',
  232. },
  233. {
  234. label: '备注',
  235. field: 'strremark',
  236. component: 'InputTextArea',
  237. },
  238. ];