123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- 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,
- });
- },
- };
|