export interface NavItemType {
    label: string
    value: string
    code?: string
    type?: 'page' | 'webview'
    navigate?: UniApp.NavigateToOptions
}

// APP V4.x token
const AppV4Token =
    'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxODI3NDA2MjAxOCIsImV4cCI6NDg0ODEyNDk5OSwidXVpZCI6InV1aWRfMTIzNDU2IiwibG9naW5hcmVhIjoiIiwiY3JlYXRlZCI6MTY5MjQ1MTM5OTY2OX0.8Lug15AFsQ6tIEsv_-kIprJA4Nz7XzkoWPC1N3k0ZmuOFhzVAzdDndG0VucXlu3uh444cT-OPGGfVaqPNDpXRg'

// 实况监测
export const liveModules: NavItemType[] = [
    {
        label: '降水监测',
        value: 'rain-m',
        navigate: {
            url: '/pages/business/monitor/rain/index',
        },
    },
    {
        label: '气温监测',
        value: 'tem-m',
        navigate: {
            url: '/pages/business/monitor/tem/index',
        },
    },
    {
        label: '大风监测',
        value: 'wind-m',
        // type: 'webview',
        navigate: {
            url: '/pages/business/monitor/wind/index',
            // url: 'https://www.baidu.com',
        },
    },
    {
        label: '相对湿度',
        value: 'humidness-m',
    },
    {
        label: '雷达拼图',
        value: 'radar-m',
    },
    {
        label: '强对流',
        value: 'light-m',
        type: 'webview',
        navigate: {
            // url: `https://hntq.zhijietianqi.com/h5/web/monitoringOfLive/new-severe-weather.v3.html?app=5&token=${AppV4Token}`,
            url: `http://127.0.0.1:8080/web/monitoringOfLive/new-severe-weather.v3.html?app=5&token=${AppV4Token}`,
        },
    },
    {
        label: '冰雪天气',
        value: 'iceSnow-m',
    },
    {
        label: '形势场',
        value: 'situation-field-m',
    },
    {
        label: '台风监测',
        value: 'typhoon-m',
    },
    {
        label: '卫星云图',
        value: 'satellite-m',
    },
    {
        label: '环境监测',
        value: 'envir-m',
    },
    {
        label: '水情监测',
        value: 'water-m',
        type: 'webview',
        navigate: {
            /**
             * 支持链接中配置三个参数
             * app: 5 代表从 APP V5 进入，必传
             * token: V4 版本后端生成的一个长期有效 Token，固定值，必传
             * open: true 代表可以从嵌入的页面打开新页面，默认为 false，非必传（注意：打开的子页面也进行了重写适配，一般来说不用担心出现意外情况，但注意进行简单测试）
             */
            url: `https://hntq.zhijietianqi.com/h5/web/monitoringOfLive/waterRegimenMap.v3.html?app=5&token=${AppV4Token}`,
            // url: `http://127.0.0.1:8080/web/monitoringOfLive/waterRegimenMap.v3.html?app=5&open=true&token=${AppV4Token}`,
        },
    },
    {
        label: '山洪风险',
        value: 'torrents-m',
    },
    {
        label: '面雨量/流域风险',
        value: 'areal-rainfall-m',
    },
    {
        label: '地质灾害',
        value: 'geology-disaster-m',
    },
    {
        label: '森林火险',
        value: 'forest-m',
    },
]

// 预报信息
export const forecastModules: NavItemType[] = [
    {
        label: '降水预报',
        value: 'rain-f',
        type: 'webview',
        navigate: {
            url: `http://127.0.0.1:8080/web/forecastInfo/rainfallInfo.html?app=5&token=${AppV4Token}`,
        },
    },
    {
        label: '气温预报',
        value: 'tem-f',
    },
    {
        label: '网格预报',
        value: 'grid-f',
    },
    {
        label: '环境预报',
        value: 'envir-f',
    },
    {
        label: '大雾预报',
        value: 'fog-f',
    },
    {
        label: '面雨量/流域风险',
        value: 'areal-rainfall-f',
    },
    {
        label: '山洪风险',
        value: 'torrents-f',
    },
    {
        label: '地质灾害',
        value: 'geology-disaster-f',
    },
    {
        label: '森林火险',
        value: 'forest-fire-f',
    },
]

// 气候
export const climateModules: NavItemType[] = [
    {
        label: '降水统计',
        value: 'rain-c',
    },
    {
        label: '气温统计',
        value: 'tem-c',
    },
    {
        label: '气候服务产品',
        value: 'service-product-c',
    },
    {
        label: '中期气候',
        value: 'metaphase-climate-c',
    },
    {
        label: '气象干旱',
        value: 'drought-c',
    },
]

// 天气
export const weatherModules: NavItemType[] = [
    {
        label: '会商材料',
        value: 'meeting-materials-w',
    },
    {
        label: '模式产品',
        value: 'pattern-product-w',
    },
    {
        label: '重要过程',
        value: 'important-process-w',
    },
    {
        label: '值排班',
        value: 'be-onduty-w',
    },
]
