environment.ts 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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: 0,
  12. width: 500,
  13. height: 400,
  14. value: 20,
  15. name: '董事办公室',
  16. type: 'office',
  17. lamp: 'all', //灯的不同状态会显示 不同的颜色
  18. air: 'part',
  19. curtain: 'part',
  20. //device 到时候需要生成
  21. //当前设备的状态status :all全部开启 part部分开启 close全都关闭
  22. //还有设备类型type :包括air lamp curtain
  23. device: [
  24. { type: 'lamp', status: 'close' },
  25. { type: 'air', status: 'part' },
  26. { type: 'curtain', status: 'all' },
  27. ],
  28. timeList: ['08:00-16:00', '08:00-16:00'],
  29. //normalRun: 22, overtimeWork: 22, overtimeBook: 22,
  30. runTimeStatus: 'normalRun',
  31. },
  32. {
  33. left: 500,
  34. top: 0,
  35. width: 500,
  36. height: 400,
  37. value: 25,
  38. name: '休息区',
  39. type: 'rest',
  40. lamp: 'part',
  41. air: 'close',
  42. curtain: 'close',
  43. device: [
  44. { type: 'lamp', status: 'close' },
  45. { type: 'air', status: 'close' },
  46. ],
  47. runTimeStatus: 'overtimeWork',
  48. },
  49. {
  50. left: 1000,
  51. top: 0,
  52. width: 500,
  53. height: 400,
  54. value: 28,
  55. name: '会议室',
  56. type: 'meeting',
  57. lamp: 'close',
  58. device: [
  59. { type: 'lamp', status: 'all' },
  60. { type: 'air', status: 'part' },
  61. { type: 'curtain', status: 'part' },
  62. ],
  63. runTimeStatus: 'overtimeBook',
  64. },
  65. {
  66. left: 0,
  67. top: 400,
  68. width: 500,
  69. height: 400,
  70. value: 16,
  71. name: '第一办公区',
  72. type: 'work',
  73. lamp: 'all',
  74. curtain: 'all',
  75. device: [
  76. { type: 'lamp', status: 'all' },
  77. { type: 'curtain', status: 'all' },
  78. ],
  79. },
  80. {
  81. left: 500,
  82. top: 400,
  83. width: 500,
  84. height: 400,
  85. value: 20,
  86. name: '收发室',
  87. type: 'letter',
  88. air: 'close',
  89. curtain: 'part',
  90. device: [{ type: 'lamp', status: 'all' }],
  91. },
  92. {
  93. left: 1000,
  94. top: 400,
  95. width: 500,
  96. height: 400,
  97. value: 23,
  98. name: '走廊',
  99. type: 'walk',
  100. lamp: 'close',
  101. air: 'part',
  102. curtain: 'close',
  103. device: [
  104. { type: 'lamp', status: 'part' },
  105. { type: 'air', status: 'close' },
  106. { type: 'curtain', status: 'close' },
  107. ],
  108. },
  109. {
  110. left: 0,
  111. top: 800,
  112. width: 500,
  113. height: 400,
  114. value: 16,
  115. name: '第一办公区',
  116. type: 'work',
  117. lamp: 'close',
  118. air: 'all',
  119. curtain: 'part',
  120. device: [
  121. { type: 'lamp', status: 'close' },
  122. { type: 'air', status: 'close' },
  123. { type: 'curtain', status: 'close' },
  124. ],
  125. },
  126. {
  127. left: 500,
  128. top: 800,
  129. width: 500,
  130. height: 400,
  131. value: 20,
  132. name: '收发室',
  133. type: 'letter',
  134. lamp: 'all',
  135. curtain: 'all',
  136. device: [
  137. { type: 'lamp', status: 'part' },
  138. { type: 'air', status: 'part' },
  139. { type: 'curtain', status: 'part' },
  140. ],
  141. },
  142. {
  143. left: 1000,
  144. top: 800,
  145. width: 500,
  146. height: 400,
  147. value: 23,
  148. name: '走廊',
  149. type: 'walk',
  150. device: [],
  151. lamp: 'all',
  152. air: 'all',
  153. curtain: 'all',
  154. },
  155. {
  156. left: 1500,
  157. top: 0,
  158. width: 500,
  159. height: 400,
  160. value: 20,
  161. name: '董事办公室',
  162. type: 'office',
  163. lamp: 'close',
  164. air: 'part',
  165. curtain: 'close',
  166. device: [{ type: 'curtain', status: 'all' }],
  167. },
  168. {
  169. left: 2000,
  170. top: 0,
  171. width: 500,
  172. height: 400,
  173. value: 25,
  174. name: '休息区',
  175. type: 'rest',
  176. lamp: 'part',
  177. air: 'part',
  178. curtain: 'part',
  179. device: [
  180. { type: 'lamp', status: 'all' },
  181. { type: 'air', status: 'all' },
  182. { type: 'curtain', status: 'all' },
  183. ],
  184. },
  185. {
  186. left: 2500,
  187. top: 0,
  188. width: 500,
  189. height: 400,
  190. value: 28,
  191. name: '会议室',
  192. type: 'meeting',
  193. curtain: 'all',
  194. device: [
  195. { type: 'lamp', status: 'all' },
  196. { type: 'air', status: 'close' },
  197. { type: 'curtain', status: 'part' },
  198. ],
  199. },
  200. {
  201. left: 1500,
  202. top: 400,
  203. width: 500,
  204. height: 400,
  205. value: 16,
  206. name: '第一办公区',
  207. type: 'work',
  208. lamp: 'all',
  209. air: 'all',
  210. device: [
  211. { type: 'lamp', status: 'all' },
  212. { type: 'air', status: 'part' },
  213. { type: 'curtain', status: 'close' },
  214. ],
  215. },
  216. {
  217. left: 2000,
  218. top: 400,
  219. width: 500,
  220. height: 400,
  221. value: 20,
  222. name: '收发室',
  223. type: 'letter',
  224. lamp: 'close',
  225. curtain: 'all',
  226. device: [
  227. { type: 'lamp', status: 'close' },
  228. { type: 'air', status: 'close' },
  229. { type: 'curtain', status: 'part' },
  230. ],
  231. },
  232. {
  233. left: 2500,
  234. top: 400,
  235. width: 500,
  236. height: 400,
  237. value: 23,
  238. name: '走廊',
  239. type: 'walk',
  240. lamp: 'all',
  241. air: 'part',
  242. curtain: 'all',
  243. device: [
  244. { type: 'lamp', status: 'part' },
  245. { type: 'air', status: 'close' },
  246. { type: 'curtain', status: 'all' },
  247. ],
  248. },
  249. {
  250. left: 1500,
  251. top: 800,
  252. width: 500,
  253. height: 400,
  254. value: 16,
  255. name: '第一办公区',
  256. type: 'work',
  257. device: [{ type: 'curtain', status: 'all' }],
  258. },
  259. {
  260. left: 2000,
  261. top: 800,
  262. width: 500,
  263. height: 400,
  264. value: 20,
  265. name: '收发室',
  266. type: 'letter',
  267. device: [
  268. { type: 'lamp', status: 'all' },
  269. { type: 'air', status: 'all' },
  270. { type: 'curtain', status: 'all' },
  271. ],
  272. },
  273. {
  274. left: 2500,
  275. top: 800,
  276. width: 500,
  277. height: 400,
  278. value: 23,
  279. name: '走廊',
  280. type: 'walk',
  281. lamp: 'part',
  282. air: 'part',
  283. curtain: 'all',
  284. device: [
  285. { type: 'lamp', status: 'all' },
  286. { type: 'air', status: 'all' },
  287. { type: 'curtain', status: 'all' },
  288. ],
  289. },
  290. ],
  291. success: true,
  292. });
  293. },
  294. 'POST /api/environment/Building': (req: Request, res: Response) => {
  295. res.send({
  296. data: [
  297. { name: '11#', id: '11111' },
  298. { name: '22#', id: '22222' },
  299. { name: '33#', id: '33333' },
  300. { name: '44#', id: '444444' },
  301. ],
  302. success: true,
  303. });
  304. },
  305. 'POST /api/environment/Floor': (req: Request, res: Response) => {
  306. res.send({
  307. data: [
  308. { name: 'F1', id: 'ffff1' },
  309. { name: 'F2', id: 'ffff2' },
  310. { name: 'F3', id: 'ffff3' },
  311. { name: 'F4', id: 'ffff4' },
  312. { name: 'F5', id: 'ffff5' },
  313. { name: 'F6', id: 'ffff6' },
  314. { name: 'F7', id: 'ffff7' },
  315. { name: 'F8', id: 'ffff8' },
  316. ],
  317. success: true,
  318. });
  319. },
  320. };