新型管道消毒机前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

429 lines
9.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. // 登陆
  2. export const loginJSON = (userid, passwd) => {
  3. return {
  4. command: 'login',
  5. messageId: 'login',
  6. userid,
  7. passwd,
  8. }
  9. }
  10. // 退出登陆
  11. export const logoutJSON = {
  12. command: 'unlogin',
  13. messageId: 'unlogin',
  14. }
  15. // 改密码
  16. export const chpasswdJSON = (userId, newpasswd, passwd) => {
  17. return {
  18. command: 'chpasswd',
  19. messageId: 'chpasswd',
  20. userId,
  21. newpasswd,
  22. passwd,
  23. }
  24. }
  25. // 关机
  26. export const shutdownJSON = {
  27. command: 'shutdown',
  28. messageId: 'shutdown',
  29. delayms: 1000 * 5,
  30. }
  31. // 开始消毒
  32. export const startDisinfectionJSON = (
  33. loglevel,
  34. roomVolume,
  35. envirVal,
  36. airInletProportionalValve,
  37. airOutletProportionalValve,
  38. ) => {
  39. return {
  40. command: 'startDisinfection',
  41. messageId: 'startDisinfection',
  42. loglevel,
  43. roomVolume,
  44. envirVal,
  45. airInletProportionalValve,
  46. airOutletProportionalValve,
  47. }
  48. }
  49. export const continueDisinfectionJSON = {
  50. command: 'continueDisinfection',
  51. messageId: 'continueDisinfection',
  52. }
  53. // 停止消毒
  54. export const stopDisinfectionJSON = {
  55. command: 'stopDisinfection',
  56. messageId: 'stopDisinfection',
  57. }
  58. export const pauseDisinfectionJSON = {
  59. command: 'pauseDisinfection',
  60. messageId: 'pauseDisinfection',
  61. }
  62. // 获取当前设备的状态信息
  63. export const getStateJSON = {
  64. command: 'getState',
  65. messageId: 'getState',
  66. }
  67. export const getAllUserJSON = {
  68. command: 'getAllUser',
  69. messageId: 'getAllUser',
  70. }
  71. export const getAllSettingJSON = {
  72. command: 'getAllSetting',
  73. messageId: 'getAllSetting',
  74. }
  75. export const getAllRecordsJSON = disinfection_id => {
  76. return {
  77. command: 'getAllRecords',
  78. messageId: 'getAllRecords',
  79. disinfection_id,
  80. }
  81. }
  82. export const setSettingValJSON = (settingName, settingVal) => {
  83. return {
  84. command: 'setSettingVal',
  85. messageId: 'setSettingVal',
  86. settingName,
  87. settingVal,
  88. }
  89. }
  90. // RealtimeSensorDataReport
  91. // 实时传感器信息上报
  92. // 控制加液体泵转动 1 控制喷液体泵转动 2
  93. export const liquidpumpctrlJSON = (num, speed) => {
  94. return {
  95. command: 'exceCanCmd',
  96. cancmd: `pumpctrl_c1004 ${num} 300 ${speed}`, // 1 泵编号 300 是加速度, 1000是转速
  97. }
  98. }
  99. // 空压机
  100. export const someAirSwitchJSON = (num, flag) => {
  101. return {
  102. command: 'exceCanCmd',
  103. cancmd: `writeio ${num} ${flag}`,
  104. }
  105. }
  106. export const startReplenishingFluidsJSON = stopAt => {
  107. return {
  108. command: 'startReplenishingFluids',
  109. messageId: 'startReplenishingFluids',
  110. stopAt,
  111. }
  112. }
  113. export const stopReplenishingFluidsJSON = {
  114. command: 'stopReplenishingFluids',
  115. messageId: 'stopReplenishingFluids',
  116. }
  117. export const startDrainingJSON = {
  118. command: 'startDraining',
  119. messageId: 'startDraining',
  120. }
  121. export const stopDrainingJSON = {
  122. command: 'stopDraining',
  123. messageId: 'stopDraining',
  124. }
  125. export const addLiquidCtrlJSON = (num, speed, power) => {
  126. return {
  127. command: 'exceCanCmd',
  128. cancmd: `pumpctrl_c1004 ${num} 300 ${speed} 1 ${power}`,
  129. }
  130. }
  131. export const test_replenishingFluidsPumpCtrJSON = (ctrl, speed) => {
  132. return {
  133. command: 'test_replenishingFluidsPumpCtrl',
  134. messageId: 'test_replenishingFluidsPumpCtrl',
  135. ctrl,
  136. speed,
  137. }
  138. }
  139. export const sprayLiquidPump_open_for_testJSON = (ctrl, speed) => {
  140. return {
  141. command: 'test_sprayLiquidPumpCtrl',
  142. messageId: 'test_sprayLiquidPumpCtrl',
  143. ctrl,
  144. speed,
  145. }
  146. }
  147. export const updateDateJSON = (year, month, day) => {
  148. return {
  149. command: 'updateDate',
  150. messageId: 'updateDate',
  151. year,
  152. month,
  153. day,
  154. }
  155. }
  156. export const updateTimeJSON = (hour, min, second) => {
  157. return {
  158. command: 'updateTime',
  159. messageId: 'updateTime',
  160. hour,
  161. min,
  162. second,
  163. }
  164. }
  165. export const changeDisinfectionParameterJSON = data => {
  166. return {
  167. command: 'changeDisinfectionParameter',
  168. messageId: 'changeDisinfectionParameter',
  169. ...data,
  170. }
  171. }
  172. export const addUserJson = (uid, passwd) => {
  173. return {
  174. command: 'addUser',
  175. messageId: 'addUser',
  176. uid,
  177. passwd,
  178. permission_level: 3,
  179. }
  180. }
  181. export const delUserJSON = id => {
  182. return {
  183. command: 'delUser',
  184. messageId: 'delUser',
  185. id,
  186. }
  187. }
  188. export const updateUserPermissionLevelJSON = (id, permission_level) => {
  189. return {
  190. command: 'updateUserPermissionLevel',
  191. messageId: 'updateUserPermissionLevel',
  192. id,
  193. permission_level,
  194. }
  195. }
  196. export const exportUserBehaviorRecordJSON = {
  197. command: 'exportUserBehaviorRecord',
  198. messageId: 'exportUserBehaviorRecord',
  199. }
  200. export const exportDisinfectionRecordJSON = {
  201. command: 'exportDisinfectionRecord',
  202. messageId: 'exportDisinfectionRecord',
  203. }
  204. export const cleanDisinfectionRecordJSON = {
  205. command: 'cleanDisinfectionRecord',
  206. messageId: 'cleanDisinfectionRecord',
  207. }
  208. export const cleanUserBehaviorRecordJSON = {
  209. command: 'cleanUserBehaviorRecord',
  210. messageId: 'cleanUserBehaviorRecord',
  211. }
  212. export const getUserBehaviorRecordDescJSON = (page, page_size) => {
  213. return {
  214. command: 'getUserBehaviorRecordDescJson',
  215. page,
  216. page_size,
  217. messageId: 'getUserBehaviorRecordDescJson',
  218. }
  219. }
  220. // 配方
  221. export const getAllFormulaJSON = {
  222. command: 'getAllFormula',
  223. messageId: 'getAllFormula',
  224. }
  225. // 更新配方字段
  226. export const updateFormulaJSON = (column, val, id) => {
  227. return {
  228. command: 'updateFormula',
  229. messageId: 'updateFormula',
  230. column,
  231. val,
  232. id,
  233. }
  234. }
  235. // 删除配方
  236. export const delFormulaJSON = id => {
  237. return {
  238. command: 'delFormula',
  239. messageId: 'delFormula',
  240. id,
  241. }
  242. }
  243. // 添加配方 是不是少了log
  244. export const addFormulaJSON = data => {
  245. return {
  246. command: 'addFormula',
  247. messageId: 'addFormula',
  248. ...data,
  249. }
  250. }
  251. // 执行配方
  252. export const startFormulaJSON = id => {
  253. return { command: 'startFormula', messageId: 'startFormula', id }
  254. }
  255. export const updateSettingInRunInfectionJSON = (column, val) => {
  256. return {
  257. command: 'changeDisinfectionParameter',
  258. messageId: 'changeDisinfectionParameter',
  259. [column]: val,
  260. }
  261. }
  262. export const getDisinfectionConfigJSON = {
  263. command: 'getDisinfectionConfig',
  264. messageId: 'getDisinfectionConfig',
  265. }
  266. export const updateAllFormulaJSON = data => {
  267. return {
  268. command: 'updateFormula2',
  269. messageId: 'updateFormula2',
  270. ...data,
  271. }
  272. }
  273. // 获取本机历史数据
  274. export const getAllLocalHistoryData = {
  275. command: 'disinfectionLogsGetList',
  276. messageId: 'disinfectionLogsGetList',
  277. }
  278. // 根据消毒id获取本次消毒所有详细信息
  279. export const getDetailInfoById = id => {
  280. return {
  281. command: 'disinfectionLogsGetRecord',
  282. messageId: 'disinfectionLogsGetRecord',
  283. disinfectionLogName: id,
  284. }
  285. }
  286. // 新空压机接口
  287. export const airCompressor_setStateJSON = params => {
  288. return {
  289. command: 'DeviceIOControlService.airCompressor_setState',
  290. messageId: 'airCompressor_setState',
  291. params,
  292. }
  293. }
  294. // 空压机通道
  295. export const airCompressor_channelCtrlJSON = params => {
  296. return {
  297. command: 'DeviceIOControlService.airCompressor_channelCtrl',
  298. messageId: 'airCompressor_channelCtrl',
  299. params,
  300. }
  301. }
  302. // 空气阀入口
  303. export const AirInletProportionalValve_setStateJSON = params => {
  304. return {
  305. command: 'DeviceIOControlService.AirInletProportionalValve_setState',
  306. messageId: 'AirInletProportionalValve_setState',
  307. params,
  308. }
  309. }
  310. // 空气阀出口
  311. export const AirOutletProportionalValve_setStateJSON = params => {
  312. return {
  313. command: 'DeviceIOControlService.AirOutletProportionalValve_setState',
  314. messageId: 'AirOutletProportionalValve_setState',
  315. params,
  316. }
  317. }
  318. // 获取上阀门的信息
  319. export const airInletProportionalValve_getStateJSON = {
  320. command: 'DeviceIOControlService.AirInletProportionalValve_getState',
  321. messageId: 'AirInletProportionalValve_getState',
  322. }
  323. // 获取出口阀门的信息
  324. export const AirOutletProportionalValve_getStateJSON = {
  325. command: 'DeviceIOControlService.AirOutletProportionalValve_getState',
  326. messageId: 'airOutletProportionalValve_getState',
  327. }
  328. // 新接口
  329. // 空压机选通阀切换到通道2(空气) 空压机选通阀切换到通道1 (入气口)
  330. export const airCompressorChannelSelectJSON = params => {
  331. return {
  332. command: 'DeviceIOControlService.airCompressor_channelSelect',
  333. messageId: 'airCompressor_channelSelect',
  334. params,
  335. }
  336. }
  337. // 空压机电子阀1 0关闭通道 1打开通道
  338. export const airCompressorSetValve1JSON = params => {
  339. return {
  340. command: 'DeviceIOControlService.airCompressor_setValve1',
  341. messageId: 'airCompressor_setValve1',
  342. params,
  343. }
  344. }
  345. // 空压机电子阀2 0关闭通道 1打开通道
  346. export const airCompressorSetValve2JSON = params => {
  347. return {
  348. command: 'DeviceIOControlService.airCompressor_setValve2',
  349. messageId: 'airCompressor_setValve2',
  350. params,
  351. }
  352. }
  353. // 获取当前压力值
  354. export const airCompressorGetPressureDirectJSON = {
  355. command: 'DeviceIOControlService.airCompressor_getPressureDirect',
  356. messageId: 'airCompressor_getPressureDirect',
  357. }
  358. export const airCompressorGetPressureDirectIntervalJSON = {
  359. command: 'DeviceIOControlService.airCompressor_getPressureDirect',
  360. messageId: 'airCompressor_getPressureDirect_interval',
  361. }
  362. export const airProportionalValveIsBusyJSON = {
  363. command: 'DeviceIOControlService.AirProportionalValve_isBusy',
  364. messageId: 'AirProportionalValve_isBusy',
  365. }
  366. export const AirInOutletProportionalValve_setStateJSON = params => {
  367. return {
  368. command: 'DeviceIOControlService.AirProportionalValve_setState',
  369. messageId: 'AirProportionalValve_setState',
  370. params,
  371. }
  372. }