(function () {
    const gethost = () => {
        let host = window.location.host;
        // let host = '120.202.38.15:8081';
        // host = '120.202.38.15:8081';
        console.log(host)
        if (host.indexOf("localhost") != -1 || host.indexOf("137.65") != -1) {
            host = '120.202.38.15:8081';
            // host = '10.10.21.8';
        }
        return host;
    };
    window.host = gethost();
    window.config = {
        // "ioSocketUrl": "http://192.168.137.212:4553",
        // "ioSocketUrl": "http://192.168.136.234:4553",
        // "ioSocketUrl": "http://192.168.132.204:4553",
        // "ioSocketUrl": "http://192.168.132.204:4553",
        // "mesUrl": "http://120.202.38.15:8081/gateway",
        // "mesUrl": "http://192.168.132.204/gateway",
        // "ioSocketUrl": "http://10.10.21.73:4553",
        // "ioSocketUrl": "http://192.168.136.213:4553",
        // "ioSocketUrl": "http://120.202.38.15:8081/",
        mesHost: "http://" + gethost(),
        ioSocketUrl: "http://" + gethost(),
        mesUrl: "http://" + gethost() + "/gateway",
        edgeQueryUrl: "http://" + gethost() + "/iot/edge/application/api",
        edgeUrl: "http://" + gethost() + "/iot/edge/cxf/rongtong-edge-application",
        edgewsUrl: "ws://" + gethost() + "/rongtong-edge-application-ws/",
        equipservice: "/gateway/md-mdm-deploy-v1/md/bmEquipment",
        ImgUrl: "/console/fs/file/viewimage?fileCode=",
        refreshInterval: 15000,
        packagingOperaConfig: {
            reloadTime: 60 * 1000,
        },
        equipmentConfig: {
            equipAbnormalNext: 4000, // 设备异常监控翻页时间
            equipListNext: 4000, // 设备运行状态翻页时间
            equipListSpan: 4, // 设备运行状态栅格值，24分：如设置 4 则每行展示 24/4 = 6 个
            equipItemLength: 6, // 设备运行状态卡片内容条数
        },
        planBoard: {
            productTableNext: 4000,
        },
        planDailyConfig: {
            reloadTime: 5000, // 计划看板轮询时间
            isSocket: true, // 是否使用socket服务
        },
        // 质量看板
        qualityBoard: {
            threeDayRejectTableNext: 4000, // 近三天不良率表格翻页时间
            taskRemindTableNext: 4000, // 任务提醒表格翻页时间
        },
        // 工序总图看板
        processBoard: {
            workCenter: "L7车间",
            reloadTime: 300000, //整体刷新时间
            taskTableNext: 10000, //表格翻页时间
            energyParams: [ //能耗参数
                {
                    name: "电",
                    unit: "KW/h",
                    values: [
                        {name: "当月累计用量", value: 0},
                        {name: "今日用量", value: 0},
                    ],
                },
                {
                    name: "水",
                    unit: "KG",
                    values: [
                        {name: "当月累计用量", value: 0},
                        {name: "今日用量", value: 0},
                    ],
                },
                {
                    name: "气",
                    unit: "m³",
                    values: [
                        {name: "当月累计用量", value: 0},
                        {name: "今日用量", value: 0},
                    ],
                },
            ],
            pages: {
                // 键名对应路由 screen/processBoard?pid={key}
                // 同时对应图片 /img/processBg/{key}.png
                title: "工序总图",
                withChart: {}
            },
        },
        processItem: {
            reloadTime: 300000, //整体刷新时间
            cardAutoNext: 5000, //卡片轮播时间间隔
            //能耗参数
            energyParams: [
                {
                    name: "电",
                    unit: "KW/h",
                    values: [
                        {name: "当月累计用量", value: 0},
                        {name: "今日用量", value: 0},
                    ],
                },
                {
                    name: "水",
                    unit: "KG",
                    values: [
                        {name: "当月累计用量", value: 0},
                        {name: "今日用量", value: 0},
                    ],
                },
                {
                    name: "气",
                    unit: "m³",
                    values: [
                        {name: "当月累计用量", value: 0},
                        {name: "今日用量", value: 0},
                    ],
                },
            ],
            // 设备OEE数据配置
            OEEParams: [
                {
                    name: "当日OEE", // 标题
                    values: [], // 依次：时间, 性能, 良品 百分比值 必须填三个
                    result: "0", // 图形中间值
                },
                {
                    name: "当月OEE",
                    values: [],
                    result: "0",
                },
            ],
            pages: {
                "L7-TL": {
                    title: "投料",
                    withChart: {},
                },
                "L7-YH": {
                    title: "预混",
                    withChart: {},
                },
                "L7-CM": {
                    title: "粗磨",
                    withChart: {},
                },
                "L7-XM": {
                    title: "细磨",
                    withChart: {},
                },
                "L7-PWGZ": {
                    title: "喷雾干燥",
                    withChart: {},
                },
                "L7-SJ": {
                    title: "烧结",
                    withChart: {},
                },
                "L7-FS": {
                    title: "粉碎",
                    withChart: {},
                },
                "L7-CC": {
                    title: "除磁",
                    withChart: {},
                },
                "L7-HL": {
                    title: "混料",
                    withChart: {},
                },
                "L7-BZ": {
                    title: "包装",
                    withChart: {},
                },
            }
        }
    };
})();
