import { deviceIcons, stateIcons } from '@/assets/diviceIcon'
export interface monitorNode {
    name?: string;
    id: string;
    monitorName?: string;
    disabled?: boolean; // 可选属性，表示节点是否被禁用
    level?: 2; // 节点的层级，可选属性 1为监测点组级别。2为监测点级别
    monitorType?: number, // 监测类型
    deviceNum?: number | string,
    deviceIp?: number | string,
    devicePort?: number | string,
    positionX?: number | string,
    positionY?: number | string,
}
export interface GroupNode {
    name: string;
    id: string;
    disabled?: boolean; // 可选属性，表示节点是否被禁用
    children?: (GroupNode | monitorNode)[]; // 子节点数组，可选属性
    level: 1; // 节点的层级，可选属性 1为监测点组级别。2为监测点级别
    type?: 'root'; // 节点的类型，可选属性 root为跟节点 root 为根节点
}

export const treeList: GroupNode[] = [
    {
        name: '站点1',
        id: 'global_role',
        disabled: true,
        children: [
            {
                name: '站点1-1',
                disabled: true,
                id: 'global_role1-1',
                children: [
                    {
                        name: 'GIS监测',
                        id: 'GIS1-1-1',
                        disabled: true,
                        children: [
                            {
                                name: 'GIS东1站监测',
                                id: 'GIS1-1-1-1',
                                level: 2,
                                positionX: 53.968072270519315,
                                positionY: 835.9531405092218
                            },
                        ],
                        level: 1,
                    },
                    {
                        name: '铁芯监测',
                        id: 'GIS1-1-2',
                        disabled: true,
                        children: [
                            {
                                name: '铁芯东1站监测',
                                id: 'TX1-1-1-1-3',
                                level: 2,
                            },
                        ],
                        level: 1,
                    },
                ],
                level: 1,
            },
            {
                name: 'GIS东站监测',
                id: 'GIS1-1',
                level: 2,
                positionX: 193.968072270519315,
                positionY: 835.9531405092218
            },
            {
                name: 'GIS西站监测',
                id: 'GIS1-6',
                level: 2,
                positionX: 193.968072270519315,
                positionY: 735.9531405092218
            },
        ],
        type: 'root',
        level: 1,
    },
    {
        name: '站点2',
        disabled: true,
        id: 'global_role1sss',
        children: [
            {
                name: '站点2-1',
                disabled: true,
                id: 'global_role1-2',
                children: [
                    {
                        name: 'GIS监测',
                        id: 'GIS1-2-1',
                        disabled: true,
                        children: [
                            {
                                name: 'GIS东2站监测',
                                id: 'GIS2-1-1-1',
                                level: 2,
                            },
                        ],
                        level: 1,
                    },
                    {
                        name: '铁芯监测',
                        id: 'GIS1-2-2-2',
                        disabled: true,
                        children: [
                            {
                                name: '铁芯东2站监测',
                                id: 'TX2-1-1-1-s',
                                level: 2,
                            },
                        ],
                        level: 1,
                    },
                ],
                level: 1,
            },
        ],
        type: 'root',
        level: 1,
    },
];

export const monitorTypeOptions: { label: string, value: number, url: string }[] = [
    { label: 'UHF', value: 1, url: deviceIcons[1] },
    { label: 'AE', value: 2, url: deviceIcons[2] },
    { label: 'HFCT', value: 3, url: deviceIcons[3] },
    { label: '微水', value: 4, url: deviceIcons[4] },
    { label: 'SF6', value: 5, url: deviceIcons[5] },
    { label: '铁芯', value: 6, url: deviceIcons[6] },
    { label: '直流偏磁', value: 6, url: deviceIcons[7] },
]

export interface stateType {
    value: 'online' | 'offline' | 'alarms' | 'notice',
    text: '离线' | '在线' | '告警' | '注意',
}

export interface RealTimeType {
    id: string,
    monitorType: number,
    monitorName: string,
    createTime: string,
    value: object,
    state: stateType,
    positionX?: number | string,
    positionY?: number | string,
}

export const RealTimeData: RealTimeType[] = [
    {
        id: 'TX1-1-1-1',
        monitorType: 1,
        monitorName: 'GIS东1站监测',
        createTime: '2024-08-12 16:20:00',
        value: {
            '脉冲数': 100,
            '最大脉冲值': '-10dBm',
            '平均脉冲值': '-20dBm',
        },
        state: {
            value: 'online',
            text: '在线',
        },
        positionX: 53.968072270519315,
        positionY: 835.9531405092218
    },
    {
        id: 'TX1-1-1-1-1',
        monitorType: 4,
        monitorName: '铁芯东1站监测',
        createTime: '2024-08-12 16:20:00',
        value: {
            '温度': '37℃',
            '常压露点': '30℃',
            '带压露点': '40℃',
        },
        state: {
            value: 'offline',
            text: '离线',
        },
        positionX: 353.968072270519315,
        positionY: 135.9531405092218,
    },
    {
        id: 'GIS1-1',
        monitorType: 5,
        monitorName: 'GIS东站监测',
        createTime: '2024-08-12 16:20:00',
        value: {
            'SF6': '100ppm',
            '氧气': '20%',
            'SF61': '100ppm',
        },
        state: {
            value: 'alarms',
            text: '告警',
        },
        positionX: 153.968072270519315,
        positionY: 235.9531405092218
    },
    {
        id: 'GIS1-6',
        monitorType: 6,
        monitorName: 'GIS西站监测',
        createTime: '2024-08-12 16:20:00',
        value: {
            '电流值': '100mA',
            '电流值1': '100mA',
            '电流值2': '100mA',
        },
        state: {
            value: 'notice',
            text: '注意',
        },
        positionX: 653.968072270519315,
        positionY: 535.9531405092218
    },
    {
        id: 'TX2-1-1-1-s',
        monitorType: 6,
        monitorName: '铁芯东2站监测',
        createTime: '2024-08-12 16:20:00',
        value: {
            '总电流值': '100mA',
            '总电流值1': '100mA',
            '总电流值2': '100mA',
        },
        state: {
            value: 'online',
            text: '在线',
        },
        positionX: 353.968072270519315,
        positionY: 735.9531405092218,
    },
    {
        id: 'TX1-1-1-1-2',
        monitorType: 6,
        monitorName: 'GIS东1站监测',
        createTime: '2024-08-12 16:20:00',
        value: {
            '系统频率': '100Hz',
            '基波电压': '10kV',
            '全电流': '16mA',
        },
        state: {
            value: 'online',
            text: '在线',
        },
        positionX: 953.968072270519315,
        positionY: 1035.9531405092218,
    },
    {
        id: 'TX1-1-1-1-2-2',
        monitorType: 6,
        monitorName: 'GIS东1站监测',
        createTime: '2024-08-12 16:20:00',
        value: {
            '系统频率': '100Hz',
            '基波电压': '10kV',
            '全电流': '16mA',
        },
        state: {
            value: 'online',
            text: '在线',
        },
        positionX: 453.968072270519315,
        positionY: 1135.9531405092218,
    },
]

export interface AlarmDataType {
    id: string,
    monitorType: number,
    monitorName: string,
    alarmTime: string,
    state: 'alarm' | 'notice',
    info: string,
}

export const AlarmData: AlarmDataType[] = [
    {
        id: '1',
        monitorType: 1,
        monitorName: 'GIS东1站监测',
        alarmTime: '2024-08-12 16:20:00',
        state: 'alarm',
        info: '报警啦，报警信息11111！！！！！！！！',
    },
    {
        id: '2',
        monitorType: 1,
        monitorName: 'GIS东1站监测',
        alarmTime: '2024-08-12 16:20:00',
        state: 'alarm',
        info: '报警啦，报警信息11111！！！！！！！！',
    },
    {
        id: '3',
        monitorType: 1,
        monitorName: 'GIS东1站监测',
        alarmTime: '2024-08-12 16:20:00',
        state: 'alarm',
        info: '报警啦，报警信息11111！！！！！！！！',
    },
    {
        id: '4',
        monitorType: 1,
        monitorName: 'GIS东1站监测',
        alarmTime: '2024-08-12 16:20:00',
        state: 'alarm',
        info: '报警啦，报警信息11111！！！！！！！！',
    },
    {
        id: '5',
        monitorType: 1,
        monitorName: 'GIS东1站监测',
        alarmTime: '2024-08-12 16:20:00',
        state: 'alarm',
        info: '报警啦，报警信息11111！！！！！！！！',
    },
]