import { AlignLeftOutlined } from '@ant-design/icons'; import { Request, Response } from 'express'; export default { // 支持值为 Object 和 Array 'POST /api/environment/map': (req: Request, res: Response) => { debugger; res.send({ data: [ { left: 0, top: 0, width: 500, height: 400, value: 20, name: '董事办公室', type: 'office', lamp: 'all', air: 'part', curtain: 'part', //device 到时候需要生成 //当前设备的状态status all全部开启 part部分开启 close全都关闭 //还有设备类型type 包括air lamp curtain device: [ { type: 'lamp', status: 'close' }, { type: 'air', status: 'part' }, { type: 'curtain', status: 'all' }, ], }, { left: 500, top: 0, width: 500, height: 400, value: 25, name: '休息区', type: 'rest', lamp: 'part', air: 'close', curtain: 'close', device: [ { type: 'lamp', status: 'close' }, { type: 'air', status: 'close' }, ], }, { left: 1000, top: 0, width: 500, height: 400, value: 28, name: '会议室', type: 'meeting', lamp: 'close', device: [ { type: 'lamp', status: 'all' }, { type: 'air', status: 'part' }, { type: 'curtain', status: 'part' }, ], }, { left: 0, top: 400, width: 500, height: 400, value: 16, name: '第一办公区', type: 'work', lamp: 'all', curtain: 'all', device: [ { type: 'lamp', status: 'all' }, { type: 'curtain', status: 'all' }, ], }, { left: 500, top: 400, width: 500, height: 400, value: 20, name: '收发室', type: 'letter', air: 'close', curtain: 'part', device: [{ type: 'lamp', status: 'all' }], }, { left: 1000, top: 400, width: 500, height: 400, value: 23, name: '走廊', type: 'walk', lamp: 'close', air: 'part', curtain: 'close', device: [ { type: 'lamp', status: 'part' }, { type: 'air', status: 'close' }, { type: 'curtain', status: 'close' }, ], }, { left: 0, top: 800, width: 500, height: 400, value: 16, name: '第一办公区', type: 'work', lamp: 'close', air: 'all', curtain: 'part', device: [ { type: 'lamp', status: 'close' }, { type: 'air', status: 'close' }, { type: 'curtain', status: 'close' }, ], }, { left: 500, top: 800, width: 500, height: 400, value: 20, name: '收发室', type: 'letter', lamp: 'all', curtain: 'all', device: [ { type: 'lamp', status: 'part' }, { type: 'air', status: 'part' }, { type: 'curtain', status: 'part' }, ], }, { left: 1000, top: 800, width: 500, height: 400, value: 23, name: '走廊', type: 'walk', device: [], lamp: 'all', air: 'all', curtain: 'all', }, { left: 1500, top: 0, width: 500, height: 400, value: 20, name: '董事办公室', type: 'office', lamp: 'close', air: 'part', curtain: 'close', device: [{ type: 'curtain', status: 'all' }], }, { left: 2000, top: 0, width: 500, height: 400, value: 25, name: '休息区', type: 'rest', lamp: 'part', air: 'part', curtain: 'part', device: [ { type: 'lamp', status: 'all' }, { type: 'air', status: 'all' }, { type: 'curtain', status: 'all' }, ], }, { left: 2500, top: 0, width: 500, height: 400, value: 28, name: '会议室', type: 'meeting', curtain: 'all', device: [ { type: 'lamp', status: 'all' }, { type: 'air', status: 'close' }, { type: 'curtain', status: 'part' }, ], }, { left: 1500, top: 400, width: 500, height: 400, value: 16, name: '第一办公区', type: 'work', lamp: 'all', air: 'all', device: [ { type: 'lamp', status: 'all' }, { type: 'air', status: 'part' }, { type: 'curtain', status: 'close' }, ], }, { left: 2000, top: 400, width: 500, height: 400, value: 20, name: '收发室', type: 'letter', lamp: 'close', curtain: 'all', device: [ { type: 'lamp', status: 'close' }, { type: 'air', status: 'close' }, { type: 'curtain', status: 'part' }, ], }, { left: 2500, top: 400, width: 500, height: 400, value: 23, name: '走廊', type: 'walk', lamp: 'all', air: 'part', curtain: 'all', device: [ { type: 'lamp', status: 'part' }, { type: 'air', status: 'close' }, { type: 'curtain', status: 'all' }, ], }, { left: 1500, top: 800, width: 500, height: 400, value: 16, name: '第一办公区', type: 'work', device: [{ type: 'curtain', status: 'all' }], }, { left: 2000, top: 800, width: 500, height: 400, value: 20, name: '收发室', type: 'letter', device: [ { type: 'lamp', status: 'all' }, { type: 'air', status: 'all' }, { type: 'curtain', status: 'all' }, ], }, { left: 2500, top: 800, width: 500, height: 400, value: 23, name: '走廊', type: 'walk', lamp: 'part', air: 'part', curtain: 'all', device: [ { type: 'lamp', status: 'all' }, { type: 'air', status: 'all' }, { type: 'curtain', status: 'all' }, ], }, ], success: true, }); }, };