environment.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. import { AlignLeftOutlined } from '@ant-design/icons';
  2. import { Request, Response } from 'express';
  3. export default {
  4. // 支持值为 Object 和 Array
  5. 'POST /api/environment/map': (req: Request, res: Response) => {
  6. //debugger;
  7. res.send({
  8. data: [
  9. {
  10. left: 0,
  11. top: 400,
  12. width: 500,
  13. height: 400,
  14. Tdb: 27,
  15. RH: 27,
  16. CO2: 27,
  17. PM2d5: 27,
  18. HCHO: 27,
  19. localName: '第一办公区',
  20. roomFuncType: 'work',
  21. lamp: 'all',
  22. curtain: 'all',
  23. air: 'all',
  24. device: [
  25. { type: 'lamp', status: 'all' },
  26. { type: 'curtain', status: 'all' },
  27. ],
  28. },
  29. {
  30. left: 500,
  31. top: 400,
  32. width: 500,
  33. height: 400,
  34. Tdb: 27,
  35. RH: 27,
  36. CO2: 27,
  37. PM2d5: 27,
  38. HCHO: 27,
  39. localName: '收发室',
  40. roomFuncType: 'letter',
  41. air: 'all',
  42. curtain: 'all',
  43. lamp: 'all',
  44. device: [{ type: 'lamp', status: 'all' }],
  45. },
  46. {
  47. left: 1000,
  48. top: 400,
  49. width: 500,
  50. height: 400,
  51. Tdb: 27,
  52. RH: 27,
  53. CO2: 27,
  54. PM2d5: 27,
  55. HCHO: 27,
  56. localName: '走廊',
  57. roomFuncType: 'walk',
  58. lamp: 'all',
  59. air: 'all',
  60. curtain: 'all',
  61. device: [
  62. { type: 'lamp', status: 'part' },
  63. { type: 'air', status: 'close' },
  64. { type: 'curtain', status: 'close' },
  65. ],
  66. },
  67. {
  68. left: 0,
  69. top: 800,
  70. width: 500,
  71. height: 400,
  72. Tdb: 27,
  73. RH: 27,
  74. CO2: 27,
  75. PM2d5: 27,
  76. HCHO: 27,
  77. localName: '第一办公区',
  78. roomFuncType: 'work',
  79. lamp: 'all',
  80. air: 'all',
  81. curtain: 'all',
  82. device: [
  83. { type: 'lamp', status: 'close' },
  84. { type: 'air', status: 'close' },
  85. { type: 'curtain', status: 'close' },
  86. ],
  87. },
  88. {
  89. left: 500,
  90. top: 800,
  91. width: 500,
  92. height: 400,
  93. Tdb: 27,
  94. RH: 27,
  95. CO2: 27,
  96. PM2d5: 27,
  97. HCHO: 27,
  98. localName: '收发室',
  99. roomFuncType: 'letter',
  100. lamp: 'all',
  101. curtain: 'all',
  102. device: [
  103. { type: 'lamp', status: 'part' },
  104. { type: 'air', status: 'part' },
  105. { type: 'curtain', status: 'part' },
  106. ],
  107. },
  108. {
  109. left: 1000,
  110. top: 800,
  111. width: 500,
  112. height: 400,
  113. Tdb: 27,
  114. RH: 27,
  115. CO2: 27,
  116. PM2d5: 27,
  117. HCHO: 27,
  118. localName: '走廊',
  119. roomFuncType: 'walk',
  120. device: [],
  121. lamp: 'all',
  122. air: 'all',
  123. curtain: 'all',
  124. },
  125. {
  126. left: 1500,
  127. top: 0,
  128. width: 500,
  129. height: 400,
  130. Tdb: 27,
  131. RH: 27,
  132. CO2: 27,
  133. PM2d5: 27,
  134. HCHO: 27,
  135. localName: '董事办公室',
  136. roomFuncType: 'office',
  137. lamp: 'all',
  138. air: 'all',
  139. curtain: 'all',
  140. device: [{ type: 'curtain', status: 'all' }],
  141. },
  142. {
  143. left: 2000,
  144. top: 0,
  145. width: 500,
  146. height: 400,
  147. Tdb: 27,
  148. RH: 27,
  149. CO2: 27,
  150. PM2d5: 27,
  151. HCHO: 27,
  152. localName: '休息区',
  153. roomFuncType: 'rest',
  154. lamp: 'all',
  155. air: 'all',
  156. curtain: 'all',
  157. device: [
  158. { type: 'lamp', status: 'all' },
  159. { type: 'air', status: 'all' },
  160. { type: 'curtain', status: 'all' },
  161. ],
  162. },
  163. {
  164. left: 2500,
  165. top: 0,
  166. width: 500,
  167. height: 400,
  168. Tdb: 27,
  169. RH: 27,
  170. CO2: 27,
  171. PM2d5: 27,
  172. HCHO: 27,
  173. localName: '会议室',
  174. roomFuncType: 'meeting',
  175. curtain: 'all',
  176. device: [
  177. { type: 'lamp', status: 'all' },
  178. { type: 'air', status: 'close' },
  179. { type: 'curtain', status: 'part' },
  180. ],
  181. },
  182. {
  183. left: 1500,
  184. top: 400,
  185. width: 500,
  186. height: 400,
  187. Tdb: 27,
  188. RH: 27,
  189. CO2: 27,
  190. PM2d5: 27,
  191. HCHO: 27,
  192. localName: '第一办公区',
  193. roomFuncType: 'work',
  194. lamp: 'all',
  195. air: 'all',
  196. device: [
  197. { type: 'lamp', status: 'all' },
  198. { type: 'air', status: 'part' },
  199. { type: 'curtain', status: 'close' },
  200. ],
  201. },
  202. {
  203. left: 2000,
  204. top: 400,
  205. width: 500,
  206. height: 400,
  207. Tdb: 27,
  208. RH: 27,
  209. CO2: 27,
  210. PM2d5: 27,
  211. HCHO: 27,
  212. localName: '收发室',
  213. roomFuncType: 'letter',
  214. lamp: 'all',
  215. curtain: 'all',
  216. device: [
  217. { type: 'lamp', status: 'close' },
  218. { type: 'air', status: 'close' },
  219. { type: 'curtain', status: 'part' },
  220. ],
  221. },
  222. ],
  223. // data: [
  224. // {
  225. // left: 0,
  226. // top: 0,
  227. // width: 500,
  228. // height: 400,
  229. // Tdb: 17,
  230. // RH: 26,
  231. // CO2: 2800,
  232. // PM2d5: 28,
  233. // HCHO: 0.01,
  234. // localName: '董事办公室',
  235. // roomFuncType: 'office',
  236. // lamp: 'all', //灯的不同状态会显示 不同的颜色
  237. // air: 'part',
  238. // curtain: 'part',
  239. // //device 到时候需要生成
  240. // //当前设备的状态status :all全部开启 part部分开启 close全都关闭
  241. // //还有设备类型type :包括air lamp curtain
  242. // device: [
  243. // { type: 'lamp', status: 'close' },
  244. // { type: 'air', status: 'part' },
  245. // { type: 'curtain', status: 'all' },
  246. // ],
  247. // timeList: ['08:00-16:00', '08:00-16:00'],
  248. // // normalRun
  249. // // overtimeWork
  250. // // overtimeBook
  251. // runTimeStatus: 'normalRun',
  252. // },
  253. // {
  254. // left: 500,
  255. // top: 0,
  256. // width: 500,
  257. // height: 400,
  258. // Tdb: 25,
  259. // RH: 65,
  260. // CO2: 1008,
  261. // PM2d5: 38,
  262. // HCHO: 0.03,
  263. // localName: '休息区',
  264. // roomFuncType: 'rest',
  265. // lamp: 'part',
  266. // air: 'close',
  267. // curtain: 'close',
  268. // device: [
  269. // { type: 'lamp', status: 'close' },
  270. // { type: 'air', status: 'close' },
  271. // ],
  272. // runTimeStatus: 'overtimeWork',
  273. // },
  274. // {
  275. // left: 1000,
  276. // top: 0,
  277. // width: 500,
  278. // height: 400,
  279. // Tdb: 20,
  280. // RH: 53,
  281. // CO2: 1808,
  282. // PM2d5: 88,
  283. // HCHO: 0.06,
  284. // localName: '会议室',
  285. // roomFuncType: 'meeting',
  286. // lamp: 'close',
  287. // device: [
  288. // { type: 'lamp', status: 'all' },
  289. // { type: 'air', status: 'part' },
  290. // { type: 'curtain', status: 'part' },
  291. // ],
  292. // runTimeStatus: 'overtimeBook',
  293. // },
  294. // {
  295. // left: 0,
  296. // top: 400,
  297. // width: 500,
  298. // height: 400,
  299. // Tdb: 27,
  300. // RH: 37,
  301. // CO2: 28,
  302. // PM2d5: 68,
  303. // HCHO: 0.1,
  304. // localName: '第一办公区',
  305. // roomFuncType: 'work',
  306. // lamp: 'all',
  307. // curtain: 'all',
  308. // device: [
  309. // { type: 'lamp', status: 'all' },
  310. // { type: 'curtain', status: 'all' },
  311. // ],
  312. // },
  313. // {
  314. // left: 500,
  315. // top: 400,
  316. // width: 500,
  317. // height: 400,
  318. // Tdb: 30,
  319. // RH: 26,
  320. // CO2: 28,
  321. // PM2d5: 28,
  322. // HCHO: 0.17,
  323. // localName: '收发室',
  324. // roomFuncType: 'letter',
  325. // air: 'close',
  326. // curtain: 'part',
  327. // device: [{ type: 'lamp', status: 'all' }],
  328. // },
  329. // {
  330. // left: 1000,
  331. // top: 400,
  332. // width: 500,
  333. // height: 400,
  334. // Tdb: 12,
  335. // RH: 26,
  336. // CO2: 28,
  337. // PM2d5: 28,
  338. // HCHO: 39,
  339. // localName: '走廊',
  340. // roomFuncType: 'walk',
  341. // lamp: 'close',
  342. // air: 'part',
  343. // curtain: 'close',
  344. // device: [
  345. // { type: 'lamp', status: 'part' },
  346. // { type: 'air', status: 'close' },
  347. // { type: 'curtain', status: 'close' },
  348. // ],
  349. // },
  350. // {
  351. // left: 0,
  352. // top: 800,
  353. // width: 500,
  354. // height: 400,
  355. // Tdb: 25,
  356. // RH: 26,
  357. // CO2: 28,
  358. // PM2d5: 28,
  359. // HCHO: 39,
  360. // localName: '第一办公区',
  361. // roomFuncType: 'work',
  362. // lamp: 'close',
  363. // air: 'all',
  364. // curtain: 'part',
  365. // device: [
  366. // { type: 'lamp', status: 'close' },
  367. // { type: 'air', status: 'close' },
  368. // { type: 'curtain', status: 'close' },
  369. // ],
  370. // },
  371. // {
  372. // left: 500,
  373. // top: 800,
  374. // width: 500,
  375. // height: 400,
  376. // Tdb: 25,
  377. // RH: 26,
  378. // CO2: 2000,
  379. // PM2d5: 28,
  380. // HCHO: 39,
  381. // localName: '收发室',
  382. // roomFuncType: 'letter',
  383. // lamp: 'all',
  384. // curtain: 'all',
  385. // device: [
  386. // { type: 'lamp', status: 'part' },
  387. // { type: 'air', status: 'part' },
  388. // { type: 'curtain', status: 'part' },
  389. // ],
  390. // },
  391. // {
  392. // left: 1000,
  393. // top: 800,
  394. // width: 500,
  395. // height: 400,
  396. // Tdb: 25,
  397. // RH: 26,
  398. // CO2: 28,
  399. // PM2d5: 28,
  400. // HCHO: 39,
  401. // localName: '走廊',
  402. // roomFuncType: 'walk',
  403. // device: [],
  404. // lamp: 'all',
  405. // air: 'all',
  406. // curtain: 'all',
  407. // },
  408. // {
  409. // left: 1500,
  410. // top: 0,
  411. // width: 500,
  412. // height: 400,
  413. // Tdb: 25,
  414. // RH: 26,
  415. // CO2: 28,
  416. // PM2d5: 28,
  417. // HCHO: 39,
  418. // localName: '董事办公室',
  419. // roomFuncType: 'office',
  420. // lamp: 'close',
  421. // air: 'part',
  422. // curtain: 'close',
  423. // device: [{ type: 'curtain', status: 'all' }],
  424. // },
  425. // {
  426. // left: 2000,
  427. // top: 0,
  428. // width: 500,
  429. // height: 400,
  430. // Tdb: 25,
  431. // RH: 26,
  432. // CO2: 28,
  433. // PM2d5: 28,
  434. // HCHO: 39,
  435. // localName: '休息区',
  436. // roomFuncType: 'rest',
  437. // lamp: 'part',
  438. // air: 'part',
  439. // curtain: 'part',
  440. // device: [
  441. // { type: 'lamp', status: 'all' },
  442. // { type: 'air', status: 'all' },
  443. // { type: 'curtain', status: 'all' },
  444. // ],
  445. // },
  446. // {
  447. // left: 2500,
  448. // top: 0,
  449. // width: 500,
  450. // height: 400,
  451. // Tdb: 25,
  452. // RH: 26,
  453. // CO2: 2000,
  454. // PM2d5: 28,
  455. // HCHO: 39,
  456. // localName: '会议室',
  457. // roomFuncType: 'meeting',
  458. // curtain: 'all',
  459. // device: [
  460. // { type: 'lamp', status: 'all' },
  461. // { type: 'air', status: 'close' },
  462. // { type: 'curtain', status: 'part' },
  463. // ],
  464. // },
  465. // {
  466. // left: 1500,
  467. // top: 400,
  468. // width: 500,
  469. // height: 400,
  470. // Tdb: 25,
  471. // RH: 26,
  472. // CO2: 28,
  473. // PM2d5: 28,
  474. // HCHO: 39,
  475. // localName: '第一办公区',
  476. // roomFuncType: 'work',
  477. // lamp: 'all',
  478. // air: 'all',
  479. // device: [
  480. // { type: 'lamp', status: 'all' },
  481. // { type: 'air', status: 'part' },
  482. // { type: 'curtain', status: 'close' },
  483. // ],
  484. // },
  485. // {
  486. // left: 2000,
  487. // top: 400,
  488. // width: 500,
  489. // height: 400,
  490. // Tdb: 25,
  491. // RH: 26,
  492. // CO2: 2000,
  493. // PM2d5: 28,
  494. // HCHO: 39,
  495. // localName: '收发室',
  496. // roomFuncType: 'letter',
  497. // lamp: 'close',
  498. // curtain: 'all',
  499. // device: [
  500. // { type: 'lamp', status: 'close' },
  501. // { type: 'air', status: 'close' },
  502. // { type: 'curtain', status: 'part' },
  503. // ],
  504. // },
  505. // {
  506. // left: 2500,
  507. // top: 400,
  508. // width: 500,
  509. // height: 400,
  510. // Tdb: 25,
  511. // RH: 26,
  512. // CO2: 28,
  513. // PM2d5: 28,
  514. // HCHO: 39,
  515. // localName: '走廊',
  516. // roomFuncType: 'walk',
  517. // lamp: 'all',
  518. // air: 'part',
  519. // curtain: 'all',
  520. // device: [
  521. // { type: 'lamp', status: 'part' },
  522. // { type: 'air', status: 'close' },
  523. // { type: 'curtain', status: 'all' },
  524. // ],
  525. // },
  526. // {
  527. // left: 1500,
  528. // top: 800,
  529. // width: 500,
  530. // height: 400,
  531. // Tdb: 25,
  532. // RH: 26,
  533. // CO2: 2000,
  534. // PM2d5: 28,
  535. // HCHO: 39,
  536. // localName: '第一办公区',
  537. // roomFuncType: 'work',
  538. // device: [{ type: 'curtain', status: 'all' }],
  539. // },
  540. // {
  541. // left: 2000,
  542. // top: 800,
  543. // width: 500,
  544. // height: 400,
  545. // Tdb: 25,
  546. // RH: 26,
  547. // CO2: 2000,
  548. // PM2d5: 28,
  549. // HCHO: 39,
  550. // localName: '收发室',
  551. // roomFuncType: 'letter',
  552. // device: [
  553. // { type: 'lamp', status: 'all' },
  554. // { type: 'air', status: 'all' },
  555. // { type: 'curtain', status: 'all' },
  556. // ],
  557. // },
  558. // {
  559. // left: 2500,
  560. // top: 800,
  561. // width: 500,
  562. // height: 400,
  563. // Tdb: 25,
  564. // RH: 26,
  565. // CO2: 700,
  566. // PM2d5: 28,
  567. // HCHO: 39,
  568. // localName: '走廊',
  569. // roomFuncType: 'walk',
  570. // lamp: 'part',
  571. // air: 'part',
  572. // curtain: 'all',
  573. // device: [
  574. // { type: 'lamp', status: 'all' },
  575. // { type: 'air', status: 'all' },
  576. // { type: 'curtain', status: 'all' },
  577. // ],
  578. // },
  579. // ],
  580. success: true,
  581. });
  582. },
  583. 'POST /api/environment/Building': (req: Request, res: Response) => {
  584. res.send({
  585. data: [
  586. { localName: '11#', id: '11111' },
  587. { localName: '22#', id: '22222' },
  588. { localName: '33#', id: '33333' },
  589. { localName: '44#', id: '444444' },
  590. ],
  591. success: true,
  592. });
  593. },
  594. 'POST /api/environment/Floor': (req: Request, res: Response) => {
  595. res.send({
  596. data: [
  597. { localName: 'F1', id: 'ffff1' },
  598. { localName: 'F2', id: 'ffff2' },
  599. { localName: 'F3', id: 'ffff3' },
  600. { localName: 'F4', id: 'ffff4' },
  601. { localName: 'F5', id: 'ffff5' },
  602. { localName: 'F6', id: 'ffff6' },
  603. { localName: 'F7', id: 'ffff7' },
  604. { localName: 'F8', id: 'ffff8' },
  605. ],
  606. success: true,
  607. });
  608. },
  609. };