import { i18n } from './index.js'
//初始化图表options
// GIS
let PRPDGIS = '';

// GIL
let PRPDGIL = '';
let GIL1 = '';
let GIL2 = '';
let GIL3 = '';
let GIL4 = '';

// 电缆局放
let CPD = '', CPD1 = '';
export const loadOption = () => {
    CPD = {
        backgroundColor: '#ffffff',
        title: {
            //  text: '幅值趋势图' ,
            left: 'center',
            top: 5,
            textStyle: {
                fontSize: 16,
                color: '#000000'
            }
        },
        // animation: false,
        tooltip: {
            show: false,
        },
        color: ["#35C822", '#1f8ffd', '#fd1f44', '#ff9933', '#660099'],
        legend: {
            left: 'center',
            top: 10,
            data: ['脉冲最大值', '脉冲数量'],
            textStyle: {
                color: "#92A3A8",
                fontsize: 5
            },
            // selected: {
            //   "Discharge phase": false,
            //   "放电相位": false,
            //   "фаза разряда": false,
            // },
            type: 'scroll',
            width: '50%'
        },
        tooltip: {
             trigger: 'axis',
            //trigger: 'item',
            axisPointer: {
              type: 'cross',
              animation: false,
              label: {
                backgroundColor: '#92A3A8'
              }
            }
  
          },
        xAxis: [{
            type: 'category',
            data:[],
            axisLine: {
              lineStyle: {
                color: '#92A3A8'
              }
            },
            axisLabel: { //调整x轴的lable
              textStyle: {
                color: '#92A3A8'
              }
            },
            offset: -20,

        }],
        yAxis: [{
            type: 'value',
            min: -80,
            max: 0,
            name: 'dBm',
            nameLocation: 'end',
            splitNumber: 1,
            // nameGap:'30',
            // interval:10,
            axisLine: {
                lineStyle: { color: '#000000', opacity: 0.1 }
            },
            axisPointer: {
                lineStyle: { color: '#000000' },
                lineStyle: { color: '#000000' },
            },
        },
        {
            type: 'value',
            min: 0,
            max: 3600,
            position: 'right',
            name: '',
            nameLocation: 'end',
            splitNumber: 1,
            // nameGap:'30',
            // interval:10,
            axisLine: {
                lineStyle: { color: '#000000', opacity: 0.1 }
            },
            axisPointer: {
                lineStyle: { color: '#000000' },
                lineStyle: { color: '#000000' },
            },
        }],
        dataZoom: [{
            show: false,
            realtime: true,
            start: 0,
            end: 100,
            // backgroundColor:'#d'
            textStyle: {
                color: "#92A3A8"
            },
        }, {
            type: 'inside',
            realtime: true,
            start: 5,
            end: 85
        }],
        axisPointer: {
            show: true,
            snap: true,
            lineStyle: {
                type: 'dashed',
            },
            label: {
                show: true,
                margin: 6,
                backgroundColor: '#556',
                color: '#fff'
            },
        },
        grid: {
            left: 28,
            right: 42,
            bottom: 18,
            top: 30,
            x: 0,
            y: 0,
            x2: 0,
            y2: 0,
            // borderWidth: 1,
            show: false,
            containLabel: true
        },
        series: [{
            name: '脉冲最大值',
            type: 'line',
            data:[],
            //data: [['9:01:01', -20], ['9:01:02', -22], ['9:01:03', -24], ['9:01:04', -26], ['9:01:05', -20], ['9:01:06', -28]],
            smooth: true,
            showSymbol: false,
            symbolSize: 1,
            animation: false,
            itemStyle: {
                color: "#1f8ffd",
            },
            yAxisIndex: 0,
            areaStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#1f8ffd'
                }, {
                    offset: 0.8,
                    color: 'rgba(87,114,199, 0)'
                }], false),
                shadowColor: 'rgba(0, 0, 0, 0.1)',
                shadowBlur: 10,
                origin: 'start',
            },
           // symbol: 'circle',
            itemStyle: {
                color: '#1f8ffd',
                borderColor: 'rgba(31, 143, 253,0.57)',
                borderWidth: 12
            },
        },
        {
            name: '脉冲数量',
            type: 'line',
            data:[],
            //data: [['9:01:01', 3100], ['9:01:02', 3000], ['9:01:03', 3105], ['9:01:04', 3108], ['9:01:05', 3105], ['9:01:06', 2580]],
            smooth: true,
            showSymbol: false,
            symbolSize: 1,
            showAllSymbol: true,
            animation: false,
            itemStyle: {
                color: "#fd1f44",
            },
            yAxisIndex: 1,
            areaStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#fd1f44'
                }, {
                    offset: 0.8,
                    color: 'rgba(87,114,199, 0)'
                }], false),
                shadowColor: 'rgba(0, 0, 0, 0.1)',
                shadowBlur: 10,
                origin: 'start',
            },
            symbol: 'circle',
            itemStyle: {
                color: '#fd1f44',
                borderColor: 'rgba(253, 31, 68,0.57)',
                borderWidth: 12
            },
        }]
    };
    GIL1 = {
        backgroundColor: '#000d13',
        title: {
            text: '飞行',
            left: 'center',
            top: 5,
            textStyle: {
                fontSize: 16,
                color: 'rgba(255, 255, 255, 0.7)'
            }
        },
        // animation: false,
        visualMap: [{
            type: 'continuous',
            seriesIndex: 0,
            type: 'piecewise',
            // dimension :2,
            pieces: [
                /*{min: 16,color: '#820404'},
                {min: 11, max: 15,color: '#f00'},
                {min: 6, max: 10,color: '#ff9900'},
                {min: 0,max: 5,color: '#ffff00'}*/
                { min: 15, color: '#d94e5d' },
                { min: 11, max: 14, color: '#e28b4a' },
                { min: 8, max: 10, color: '#eac736' },
                { min: 6, max: 7, color: '#9db578' },
                { min: 4, max: 5, color: '#50a3ba' },
                { min: 0, max: 3, color: '#0082df' }
            ],
            formatter: function (value, value2) {
                if (value2 == "Infinity") {
                    return (value - 1) + "+";
                }
                return value2;
                // return "";
            },
            itemWidth: 10,
            orient: "vertical",
            // inRange: {
            //     color: ['#313695','#9db578', '#fdae61', '#a50026']
            // },
            // splitNumber: 5,
            textStyle: {
                show: false,
                color: '#fff',
            },
            // itemHeight:80,
            right: 0,
            top: 30,
            // min:1,
            // max:15,
            calculable: true,
            hoverLink: false,
            // inverse:true,
            // itemWidth:2,
            textGap: 1,
            orient: "vertical",
            // inRange: {
            //     color: ['#0082df','#eac736', '#d94e5d', '#ee0000']
            // },
            // inRange: {
            //   color: ['#ffff00', '#ffcc00', '#ff9900','#ff6600','#ff3300','#ff0000']
            // },
        }],
        tooltip: {
            show: false,
        },
        toolbox: {
            show: true,
            orient: 'horizontal',
            top: 0,
            right: 0,
            showTitle: false,
            iconStyle: {
                borderColor: '#fff'
            },
            emphasis: {
                show: false,
                iconStyle: {
                    borderColor: '#fff'
                }
            },
            feature: {
                mark: { show: true },
                saveAsImage: { show: true }
            }
        },
        xAxis: [{
            type: 'value',
            min: 0,
            max: 1000,
            // splitNumber:4,
            // interval:90,
            name: '时间' + '（ms）',
            nameLocation: 'center',
            nameGap: '20',
            axisLine: {
                lineStyle: { color: '#fff', opacity: 0.1 }
            },
            axisPointer: {
                lineStyle: { color: '#fff' },
                label: {
                    precision: 0
                }
            },
        }],
        yAxis: [{
            type: 'value',
            min: 0,
            max: 100,
            // splitNumber:4,
            name: 'mV',
            nameLocation: 'end',
            // nameGap:'30',
            // interval:10,
            axisLine: {
                lineStyle: { color: '#fff', opacity: 0.1 }
            },
            axisPointer: {
                lineStyle: { color: '#fff' },
                lineStyle: { color: '#fff' },
            },
        }],
        axisPointer: {
            show: false,
            snap: true,
            lineStyle: {
                type: 'dashed',
            },
            label: {
                show: true,
                margin: 6,
                backgroundColor: '#556',
                textStyle: {
                    color: '#fff'
                }
            },
        },
        grid: {
            left: 60,
            right: 60,
            bottom: 40,
            top: 40,
            x: 0,
            y: 0,
            x2: 0,
            y2: 0,
            borderWidth: 1
        },
        series: [{
            name: 'price-area',
            type: 'scatter',
            symbolSize: 2,
            progressive: 0,
            animation: false,
            large: true,        // 大规模散点图
            itemStyle: {
                color: "#0082df",
            },
            largeThreshold: 10,

        }, {
            name: 'price-area',
            type: 'scatter',
            symbolSize: 2,
            progressive: 0,
            animation: false,
            large: true,        // 大规模散点图
            itemStyle: {
                color: "#50a3ba",
            },
            largeThreshold: 10,

        }, {
            name: 'price-area',
            type: 'scatter',
            symbolSize: 2,
            progressive: 0,
            animation: false,
            large: true,        // 大规模散点图
            itemStyle: {
                color: "#9db578",
            },
            largeThreshold: 10,

        }, {
            name: 'price-area',
            type: 'scatter',
            symbolSize: 2,
            progressive: 0,
            animation: false,
            large: true,        // 大规模散点图
            itemStyle: {
                color: "#eac736",
            },
            largeThreshold: 10,

        }, {
            name: 'price-area',
            type: 'scatter',
            symbolSize: 2,
            progressive: 0,
            animation: false,
            large: true,        // 大规模散点图
            itemStyle: {
                color: "#e28b4a",
            },
            largeThreshold: 10,

        }, {
            name: 'price-area',
            type: 'scatter',
            symbolSize: 2,
            progressive: 0,
            animation: false,
            large: true,        // 大规模散点图
            itemStyle: {
                color: "#d94e5d",
            },
            largeThreshold: 10,
        }]
    };
    GIL2 = {
        backgroundColor: '#000d13',
        title: {
            text: '相位',
            left: 'center',
            top: 5,
            textStyle: {
                fontSize: 16,
                color: 'rgba(255, 255, 255, 0.7)'
            }
        },
        // animation: false,
        tooltip: {
            show: false,
        },
        toolbox: {
            show: true,
            orient: 'horizontal',
            top: 0,
            right: 0,
            showTitle: false,
            iconStyle: {
                borderColor: '#fff'
            },
            emphasis: {
                show: false,
                iconStyle: {
                    borderColor: '#fff'
                }
            },
            feature: {
                mark: { show: true },
                saveAsImage: { show: true }
            }
        },
        xAxis: [{
            type: 'value',
            min: 0,
            max: 1000,
            // splitNumber:4,
            // interval:90,
            name: '时间' + '（ms）',
            nameLocation: 'center',
            nameGap: '20',
            axisLine: {
                lineStyle: { color: '#fff', opacity: 0.1 }
            },
            axisPointer: {
                lineStyle: { color: '#fff' },
                label: {
                    precision: 0
                }
            },
        }],
        yAxis: [{
            type: 'value',
            min: 0,
            max: 100,
            name: 'mV',
            nameLocation: 'end',
            // splitNumber:4,
            // nameGap:'30',
            // interval:10,
            axisLine: {
                lineStyle: { color: '#fff', opacity: 0.1 }
            },
            axisPointer: {
                lineStyle: { color: '#fff' },
                lineStyle: { color: '#fff' },
            },
        }],
        axisPointer: {
            show: false,
            snap: true,
            lineStyle: {
                type: 'dashed',
            },
            label: {
                show: true,
                margin: 6,
                backgroundColor: '#556',
                textStyle: {
                    color: '#fff'
                }
            },
        },
        grid: {
            left: 70,
            right: 50,
            bottom: 40,
            top: 40,
            x: 0,
            y: 0,
            x2: 0,
            y2: 0,
            borderWidth: 1
        },
        series: [{
            name: 'line',
            type: 'line',
            data: [],
            smooth: true,
            showSymbol: false,
            symbolSize: 1,
            animation: false,
            itemStyle: {
                color: "#5772c7",
            },
            areaStyle: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: 'rgba(87,114,199, 0.3)'
                }, {
                    offset: 0.8,
                    color: 'rgba(87,114,199, 0)'
                }], false),
                shadowColor: 'rgba(0, 0, 0, 0.1)',
                shadowBlur: 10,
                origin: 'start',
            },
            symbol: 'circle',
            itemStyle: {
                color: 'rgb(87,114,199)',
                borderColor: 'rgba(87,114,199,0.27)',
                borderWidth: 12
            },
        }]
    };
    GIL3 = {
        title: [
            {
                textBaseline: "middle",
                left: '15%',
                top: "10%",
                text: " mV",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
            {
                textBaseline: "middle",
                left: '15%',
                top: "60%",
                text: " mV",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
            {
                textBaseline: "middle",
                right: '10',
                top: "35%",
                text: "",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
            {
                textBaseline: "middle",
                right: '10',
                top: "85%",
                text: "",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
        ],
        xAxis: [
            {
                type: "value",
                min: '0',
                max: '100',
                interval: 900000000,
                // show:false,
                position: 'top',
                gridIndex: 0,
                axisLabel: {
                    showMaxLabel: true,
                    color: '#fff'
                },
                axisLine: {
                    lineStyle: { color: '#fff', opacity: 0.1 }
                },
            },
            {
                type: "value",
                show: false,
                gridIndex: 1,
            },
            {
                type: "value",
                min: '0',
                max: '100',
                interval: 900000000,
                // show:false,
                position: 'top',
                gridIndex: 2,
                axisLabel: {
                    showMaxLabel: true,
                    color: '#fff'
                },
                axisLine: {
                    lineStyle: { color: '#fff', opacity: 0.1 }
                },
            },
            {
                type: "value",
                show: false,
                gridIndex: 3,
            },
        ],
        yAxis: [
            {
                type: "category",
                show: false,
                axisLine: {
                    onZero: false
                },
                gridIndex: 0,
            },
            {
                type: "value",
                gridIndex: 1,
                // min:'0',
                // max:'150',
                show: false
            },
            {
                type: "category",
                show: false,
                gridIndex: 2,
            },
            {
                type: "value",
                // min:'0',
                // max:'150',
                gridIndex: 3,
                show: false
            },
        ],
        grid: [
            {
                height: "15%",
                top: "20%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2,
            },
            {
                height: "15%",
                top: "35%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2
            },
            {
                height: "15%",
                top: "70%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2
            },
            {
                height: "15%",
                top: "85%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2
            },
        ],
        visualMap: [
            {
                type: "continuous",
                seriesIndex: 0,
                min: 0,
                max: 100,
                show: false,
                itemWidth: 5,
                orient: "vertical",
                dimension: 0,
                inRange: {
                    color: ['#00ee00', '#eeee00', '#ee0000', '#4e0211']
                },
            },
            {
                type: "continuous",
                seriesIndex: 2,
                min: 0,
                max: 100,
                show: false,
                itemWidth: 5,
                dimension: 0,
                orient: "horizontal",
                inRange: {
                    color: ['#00ee00', '#eeee00', '#ee0000', '#4e0211']
                },
            },
        ],
        series: [
            {
                type: "bar",
                xAxisIndex: 0,
                yAxisIndex: 0,
                barWidth: '100%',
                data: [],
            },
            {
                type: "line",
                xAxisIndex: 1,
                yAxisIndex: 1,
                symbol: "none",
                smooth: true,
                showSymbol: false,
                lineStyle: {
                    color: "#00d4c7"
                },
                areaStyle: {

                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: 'rgba(0, 136, 212, 0.8)'
                    }, {
                        offset: 0.8,
                        color: 'rgba(0, 136, 212, 0.3)'
                    }], false),
                    shadowColor: 'rgba(0, 0, 0, 0.1)',
                    shadowBlur: 10

                },
                data: [],
            },
            {
                type: "bar",
                xAxisIndex: 2,
                yAxisIndex: 2,
                barWidth: '100%',
                data: [],
            },
            {
                type: "line",
                xAxisIndex: 3,
                yAxisIndex: 3,
                symbol: "none",
                smooth: true,
                showSymbol: false,
                lineStyle: {
                    color: "#00d4c7"
                },
                areaStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0,
                        color: 'rgba(0, 136, 212, 0.8)'
                    }, {
                        offset: 0.8,
                        color: 'rgba(0, 136, 212, 0.3)'
                    }], false),
                    shadowColor: 'rgba(0, 0, 0, 0.1)',
                    shadowBlur: 10
                },
                data: [],
            },
        ],
    }
    GIL4 = {
        title: [
            {
                textBaseline: "middle",
                left: '15%',
                top: "10%",
                text: "1 mV",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
            {
                textBaseline: "middle",
                left: '15%',
                top: "60%",
                text: "2 mV",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
            {
                textBaseline: "middle",
                right: '10',
                top: "35%",
                text: "",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
            {
                textBaseline: "middle",
                right: '10',
                top: "85%",
                text: "",
                textStyle: {
                    color: '#fff',
                    fontSize: '12px'
                }
            },
        ],
        xAxis: [
            {
                type: "value",
                min: '0',
                max: '100',
                interval: 900000000,
                // inverse:true,
                // show:false,
                position: 'top',
                gridIndex: 0,
                axisLabel: {
                    showMaxLabel: true,
                    color: '#fff'
                },
                axisLine: {
                    lineStyle: { color: '#fff', opacity: 0.1 }
                },
            },
            {
                type: "value",
                show: false,
                gridIndex: 1,
            },
            {
                type: "value",
                min: '0',
                max: '100',
                interval: 900000000,
                // inverse:true,
                // show:false,
                position: 'top',
                gridIndex: 2,
                axisLabel: {
                    showMaxLabel: true,
                    color: '#fff'
                },
                axisLine: {
                    lineStyle: { color: '#fff', opacity: 0.1 }
                },
            },
            {
                type: "value",
                show: false,
                gridIndex: 3,
            },
        ],
        yAxis: [
            {
                type: "category",
                show: false,
                axisLine: {
                    onZero: false
                },
                gridIndex: 0,
            },
            {
                type: "value",
                gridIndex: 1,
                // inverse:true,
                // min:'0',
                // max:'150',
                show: false
            },
            {
                type: "category",
                show: false,
                gridIndex: 2,
            },
            {
                type: "value",
                gridIndex: 3,
                // inverse:true,
                // min:'0',
                // max:'150',
                show: false
            },
        ],
        grid: [
            {
                height: "15%",
                top: "20%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2,
            },
            {
                height: "15%",
                top: "35%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2
            },
            {
                height: "15%",
                top: "70%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2
            },
            {
                height: "15%",
                top: "85%",
                right: "60",
                show: true,
                borderColor: "#eee",
                borderWidth: 2
            },
        ],
        visualMap: [
            {
                type: "continuous",
                seriesIndex: 0,
                min: 0,
                max: 100,
                show: false,
                itemWidth: 5,
                orient: "vertical",
                dimension: 0,
                inRange: {
                    // color: ['#00ee00','#eeee00', '#ee0000', '#4e0211']
                    color: ['#00d4c7', '#0092f6', '#7e075f', '#ee0000']
                },
            },
            {
                type: "continuous",
                seriesIndex: 2,
                min: 0,
                max: 100,
                show: false,
                itemWidth: 5,
                dimension: 0,
                orient: "horizontal",
                inRange: {
                    // color: ['#00ee00','#eeee00', '#ee0000', '#4e0211']
                    color: ['#00d4c7', '#0092f6', '#7e075f', '#ee0000']
                },
            },
        ],
        series: [
            {
                type: "bar",
                xAxisIndex: 0,
                yAxisIndex: 0,
                itemStyle: {
                    color: "#7e075f"
                },
                barWidth: '100%',
                data: [],
            },
            {
                type: "line",
                xAxisIndex: 1,
                yAxisIndex: 1,
                symbol: "none",
                smooth: true,
                showSymbol: false,
                lineStyle: {
                    color: "#00d4c7"
                },
                areaStyle: {
                    color: "#0092f6"
                },
                data: [],
            },
            {
                type: "bar",
                xAxisIndex: 2,
                yAxisIndex: 2,
                itemStyle: {
                    color: "#7e075f"
                },
                barWidth: '100%',
                data: [],
            },
            {
                type: "line",
                xAxisIndex: 3,
                yAxisIndex: 3,
                symbol: "none",
                smooth: true,
                showSymbol: false,
                lineStyle: {
                    color: "#00d4c7"
                },
                areaStyle: {
                    color: "#0092f6"
                },
                data: [],
            },
        ],

    };
}
export { PRPDGIS, PRPDGIL, GIL1, GIL2, GIL3, GIL4, CPD, CPD1 }