let jessibucaPlayer = {};
    //var host = location.protocol + '//' + window.location.host;
    var token = Cookies.get('ELADMIN-TOEKN');
    var Axiosx = axios.create({
        headers: { 'Authorization': token }
    });
    Axiosx.interceptors.response.use(
        response => {
            return response
        }, error => {
            console.error(error)
            let code = 0
            try {
                code = error.response.data.status
            } catch (e) {
                if (error.toString().indexOf('Error: timeout') !== -1) {
                    console.error('当前网络不佳')
                    return
                }
            }
            if (!code) {
                console.error('当前网络不佳')
                return
            }
            if (code === 401) {
                alert('登录信息失效，请重新登录')
                window.open(host + '/#/login', '_self')
                return
            }
            if (code === 400) {
                alert('您没有权限使用此功能，请联系管理员开通')
                return
            }
        }
    );

    var host = location.protocol + '//' + (location.hostname === '192.168.3.38' ? '192.168.3.37' : '192.168.13.200') + ':8013';

    var selfHost = location.hostname === '192.168.3.38' ? 'http://192.168.3.38:8057' : location.protocol + '//' + window.location.host;


    // 请求 token 用
    var request = axios.create({});
    request.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';

var gemhoUtil = {
    goToPage: function(url){
        // window.open(url)
        location.href = url
    },

    detailPageMixin: {
        data: function() {
            return {
                // 公共信息 
                selectedMine: {},
                menuObj: menuObj,
                bigScreenDetailMenu: '',
                createTime: ['2024-01-01', '2024-09-30'],
                isReady: false,  // 页面是否准备好  请求完接口变为true

            };
        },
        mounted() {
            window.onresize = () => {
                location.reload()
            }
            
            if (!token) {
                window.open(host + '/#/login', '_self')
                return
            }
            this.bigScreenDetailMenu = window.localStorage.getItem('bigScreenDetailMenu')
            // 当前矿山
            const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
            let noMine = false
            if (!selectedMineJson) {
                noMine = true
            } else {
                const selectedMine = JSON.parse(selectedMineJson)
                this.selectedMine = selectedMine
            }
        },
        methods: {
            goPrePage(url) {
                history.back()
            },
            changeMenu(item) {
                localStorage.setItem('bigScreenDetailMenu', item.name)
                this.bigScreenDetailMenu = item.name
                // 跳转页面
                // window.open(item.url)
                location.href = item.url
            },
        }
    }
}
var menuObj = {
    emergency: {
        menuList: [{
            name: '视频监控',
            url: '/datav/detail/video-monitor.html'
        },{
            name: '变形监控',
            url: '/datav/detail/shape-monitor.html'
        },{
            name: '温度监控',
            url: '/datav/detail/temperature-monitor.html'
        },{
            name: '湿度监控',
            url: '/datav/detail/humidity-monitor.html'
        },{
            name: '风速监控',
            url: '/datav/detail/wind-monitor.html'
        },{
            name: '降水监控',
            url: '/datav/detail/water-monitor.html'
        },{
            name: '人员定位',
            url: '/datav/detail/people-monitor.html',
            subMenu: [{
                name: '人员数据统计',
                url: '/datav/detail/people-monitor.html'
            },{
                name: '人员定位图',
                url: '/datav/detail/people-monitor.html'
            }]
        }],
    },
    natural: {
        menuList: [{
            name: '视频监控',
            url: '/datav/detail/video-monitor.html'
        },{
            name: '矿山全景',
            url: '/datav/detail/shape-monitor.html'
        },{
            name: '资源储备',
            url: '/datav/detail/temperature-monitor.html'
        },{
            name: '水检测',
            url: '/datav/detail/humidity-monitor.html'
        },{
            name: '土监测',
            url: '/datav/detail/wind-monitor.html'
        },{
            name: '地质环境',
            url: '/datav/detail/water-monitor.html'
        },{
            name: '绿色矿山',
            url: '/datav/detail/shape-monitor.html',
        },{
            name: '开发利用',
            url: '/datav/detail/shape-monitor.html',
        },{
            name: '变形监测',
            url: '/datav/detail/shape-monitor.html',
        }],
    },
    water: {
        menuList: [{
            name: '视频监控',
            url: '/datav/detail/video-monitor.html'
        },{
            name: '水土流失',
            url: '/datav/detail/shape-monitor.html'
        },{
            name: '降水监测',
            url: '/datav/detail/water-monitor.html'
        },{
            name: '温度监测',
            url: '/datav/detail/humidity-monitor.html'
        },{
            name: '湿度监控',
            url: '/datav/detail/wind-monitor.html'
        },{
            name: '风速监测',
            url: '/datav/detail/water-monitor.html'
        }],
    },
    shengtai: {
        menuList: [{
            name: '视频监控',
            url: '/datav/detail/video-monitor.html'
        },{
            name: '水土流失',
            url: '/datav/detail/shape-monitor.html'
        },{
            name: '土壤监测',
            url: '/datav/detail/water-monitor.html'
        },{
            name: '噪声监测',
            url: '/datav/detail/humidity-monitor.html'
        },{
            name: '大气监测',
            url: '/datav/detail/wind-monitor.html'
        },{
            name: '烟道监测',
            url: '/datav/detail/water-monitor.html'
        }],
    },
}

