substation.data.ts 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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: 'Input',
  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: 'InputNumber',
  170. },
  171. {
  172. label: '系统缓存点表下标',
  173. field: 'plcTable',
  174. component: 'Input',
  175. },
  176. {
  177. label: '是否从0开始',
  178. field: 'isZeroStart',
  179. component: 'RadioGroup',
  180. defaultValue: 1,
  181. componentProps: () => {
  182. return {
  183. options: [
  184. { label: '是', value: 1, key: '1' },
  185. { label: '否', value: 0, key: '2' },
  186. ],
  187. };
  188. },
  189. },
  190. {
  191. label: '请求方式',
  192. field: 'reqtype',
  193. component: 'JDictSelectTag',
  194. componentProps: {
  195. dictCode: 'reqtype',
  196. placeholder: '请选择请求方式',
  197. },
  198. },
  199. {
  200. label: 'reqHeader请求头',
  201. field: 'reqHeader',
  202. component: 'Input',
  203. },
  204. {
  205. label: '请求参数或读取文件名',
  206. field: 'reqparam',
  207. component: 'Input',
  208. },
  209. {
  210. label: '数据属性字段(json中数据列表的字段-)',
  211. field: 'dataproperty',
  212. component: 'Input',
  213. },
  214. {
  215. label: 'ID字段',
  216. field: 'idcode',
  217. component: 'Input',
  218. },
  219. {
  220. label: '名称code',
  221. field: 'namecode',
  222. component: 'Input',
  223. },
  224. {
  225. label: '连接用户名',
  226. field: 'remoteUser',
  227. component: 'Input',
  228. },
  229. {
  230. label: '连接密码',
  231. field: 'remotePass',
  232. component: 'Input',
  233. },
  234. {
  235. label: '数据格式化',
  236. field: 'dataformat',
  237. component: 'Input',
  238. },
  239. {
  240. label: '字符串分割符',
  241. field: 'splitchar',
  242. component: 'Input',
  243. },
  244. {
  245. label: '控制请求地址',
  246. field: 'controlStrip',
  247. component: 'Input',
  248. },
  249. {
  250. label: '控制请求类型',
  251. field: 'controlReqtype',
  252. component: 'JDictSelectTag',
  253. componentProps: {
  254. dictCode: 'reqtype',
  255. placeholder: '请选择控制请求方式',
  256. },
  257. },
  258. {
  259. label: '控制请求Header',
  260. field: 'controlHeader',
  261. component: 'Input',
  262. },
  263. {
  264. label: '控制请求参数',
  265. field: 'controlReqparam',
  266. component: 'Input',
  267. },
  268. {
  269. label: '登录地址',
  270. field: 'loginUrl',
  271. component: 'Input',
  272. },
  273. {
  274. label: '登录结果解析(返回的token读取字段)',
  275. field: 'loginResult',
  276. component: 'Input',
  277. },
  278. {
  279. label: '备注',
  280. field: 'strremark',
  281. component: 'InputTextArea',
  282. },
  283. ];
  284. export const historyColumns: BasicColumn[] = [
  285. {
  286. title: '名称',
  287. dataIndex: 'devicename',
  288. key: 'devicename',
  289. width: 120,
  290. align: 'center',
  291. },
  292. {
  293. title: '安装位置',
  294. dataIndex: 'stationname',
  295. key: 'stationname',
  296. width: 120,
  297. align: 'center',
  298. },
  299. {
  300. title: '开始报警时间',
  301. dataIndex: 'starttime',
  302. key: 'starttime',
  303. width: 120,
  304. align: 'center',
  305. },
  306. {
  307. title: '结束报警时间',
  308. dataIndex: 'endtime',
  309. key: 'endtime',
  310. width: 120,
  311. align: 'center',
  312. },
  313. {
  314. title: '报警状态',
  315. dataIndex: 'nwartype_dictText',
  316. key: 'nwartype_dictText',
  317. width: 120,
  318. align: 'center',
  319. },
  320. ];