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' }, ], timeList: ['08:00-16:00', '08:00-16:00'], //normalRun: 22, overtimeWork: 22, overtimeBook: 22, runTimeStatus: 'normalRun', }, { 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' }, ], runTimeStatus: 'overtimeWork', }, { 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' }, ], runTimeStatus: 'overtimeBook', }, { 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, }); }, 'POST /api/environment/Building': (req: Request, res: Response) => { res.send({ data: [ { name: '11#', id: '11111' }, { name: '22#', id: '22222' }, { name: '33#', id: '33333' }, { name: '44#', id: '444444' }, ], success: true, }); }, 'POST /api/environment/Floor': (req: Request, res: Response) => { res.send({ data: [ { name: 'F1', id: 'ffff1' }, { name: 'F2', id: 'ffff2' }, { name: 'F3', id: 'ffff3' }, { name: 'F4', id: 'ffff4' }, { name: 'F5', id: 'ffff5' }, { name: 'F6', id: 'ffff6' }, { name: 'F7', id: 'ffff7' }, { name: 'F8', id: 'ffff8' }, ], success: true, }); }, };