environment.ts 17 KB

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