export const icons = [
    {
        type: "8",
        state: "1",
        path: "psgw_1.png"
    }, {
        type: "8",
        state: "2",
        path: "psgw_2.gif"
    }, {
        type: "8",
        state: "3",
        path: "psgw_3.png"
    }, {
        type: "8",
        state: "4",
        path: "psgw_4.png"
    }, {
        type: "8",
        state: "5",
        path: "psgw_5.png"
    },

    {
        type: "9",
        state: "1",
        path: "dbs_1.png"
    },
    {
        type: "9",
        state: "2",
        path: "dbs_2.gif"
    }, {
        type: "9",
        state: "3",
        path: "dbs_3.png"
    }, {
        type: "9",
        state: "4",
        path: "dbs_4.png"
    }, {
        type: "9",
        state: "5",
        path: "dbs_5.png"
    },

    {
        type: "10",
        state: "1",
        path: "gp_1.png"
    },
    {
        type: "10",
        state: "2",
        path: "gp_2.gif"
    }, {
        type: "10",
        state: "3",
        path: "gp_3.png"
    }, {
        type: "10",
        state: "4",
        path: "gp_4.png"
    }, {
        type: "10",
        state: "5",
        path: "gp_5.png"
    }
]

/**
 * 
 * @param deviceItem 站点数据
 * @returns 返回对应图标
 */
export function getSiteIcon(deviceItem) {
    if (deviceItem.deviceType && deviceItem.siteState) {
        const icon = icons.find(item => {
            return item.type == deviceItem.deviceType && item.state == deviceItem.siteState;
        })
        if (icon && icon.path) return require(`@/views/spectrum/common/images/${icon.path}`);
        else return require("@/views/spectrum/common/images/location.png");
    } else {
        return require("@/views/spectrum/common/images/location.png");
    }
}