const nowDateH = new Date().getHours();
const start = nowDateH / 23 * 100 - 30;
export default {
    edit : "All",
    keys : {
        dataInterface: {
            _name: "数据接口配置",
            url: "采集点接口",
            params: {
                _name: "请求参数",
                value: "接口参数名称(需有父级数据关联)"
            },
            dataSource: {
                _name: "数据源结构关联",
                SourceKey: "源数据结构",
                AimsKey: "目标数据结构"
            }
        }
    },
    option : {
        "grid": {
            "left": "6%",
            "right": "8%",
            "bottom": "17%",
            "top": "15%",
            "containLabel": true
        },
        "tooltip": {
            "trigger": "axis",
            "axisPointer": {
                "type": "line",
                "lineStyle": {
                    "color": {
                        "type": "linear",
                        "x": 0,
                        "y": 0,
                        "x2": 0,
                        "y2": 1,
                        "colorStops": [
                            {
                                "offset": 0,
                                "color": "rgba(26, 118, 230, 1)"
                            }, {
                                "offset": 1,
                                "color": "rgba(29, 236, 198, 0)"
                            }
                        ],
                        "global": false
                    }
                }
            },
            "showContent": false,
            "show": false
        },
        "legend": {
            "show": false
        },
        "xAxis": {
            "type": "category",
            "boundaryGap": false,
            "axisLine": {
                "lineStyle": {
                    "color": "rgba(50, 86, 111, 1)"
                },
                "show": false
            },
            "axisTick": {
                "show": false
            },
            axisLabel: {
                color: p => parseInt(p) == nowDateH
                    ? 'rgba(193, 144, 255, 1)'
                    : 'rgba(174, 220, 244, 1)',
                fontSize: 12,
                lineHeight: 12,
                formatter: p => parseInt(p) == nowDateH
                    ? '现在'
                    : p
            },
            data:[]
        },
        "yAxis": {
            "type": "value",
            "name": "",
            "nameTextStyle": {
                "color": "rgba(50, 86, 111, 1)",
                "fontSize": 12
            },
            "axisLine": {
                "show": false
            },
            "axisLabel": {
                "color": "rgba(50, 86, 111, 1)",
                "fontSize": 12,
                "show": false
            },
            "splitLine": {
                "show": false,
                "lineStyle": {
                    "color": "rgba(255, 255, 255, 0.1)"
                }
            },
            "axisTick": {
                "show": false
            }
        },
        "dataZoom": [
            {
                show: true,
                height: 15,
                xAxisIndex: [0],
                // start: start > 50
                //     ? 50
                //     : start,
                // end: start + 60,
                handleSize: '150%',
                handleStyle: {
                    color: "rgba(12, 196, 252, .9)"
                },
                textStyle: {
                    color: "rgba(174, 220, 244, 1)"
                },
                borderColor: "rgba(2, 115, 255, .6)"
            }, {
                type: "inside",
                show: true,
                height: 15
            }
        ],
        "series": [
            {
                "type": "line",
                "smooth": true,
                "symbol": "circle",
                "symbolSize": 10,
                "showSymbol": true,
                "lineStyle": {
                    "normal": {
                        "width": 1
                    }
                },
                "label": {
                    "show": false,
                    "fontSize": 16,
                    "color": "rgba(255, 255, 255, 1)",
                    "position": "right",
                    "padding": [
                        8, 18, 6, 18
                    ],
                    "borderColor": "rgba(8,106,189,1)",
                    "rich": {}
                },
                "areaStyle": {
                    "normal": {
                        "color": {
                            "x": 0,
                            "y": 0,
                            "x2": 0,
                            "y2": 1,
                            "type": "linear",
                            "global": false,
                            "colorStops": [
                                {
                                    "offset": 0,
                                    "color": "rgba(31, 78, 180, 0.8)"
                                }, {
                                    "offset": 1,
                                    "color": "rgba(0,0,0,0)"
                                }
                            ]
                        },
                        "opacity": 0
                    }
                },
                itemStyle: {
                    normal: {
                        color: p => parseInt(p.name) == nowDateH
                        ? 'rgba(193, 144, 255, 1)'
                        : 'rgba(11, 48, 79, 1)',
                        borderColor: "rgba(0, 196, 255, 1)",
                        lineStyle: {
                            color: 'rgba(0, 196, 255, 1)'
                        }
                    }
                },
                "showAllSymbol": true,
                "data": []
            }, {
                "type": "pictorialBar",
                "symbol": "circle",
                itemStyle: {
                    normal: {
                        color: p => parseInt(p.name) == nowDateH
                        ? 'rgba(193, 144, 255, 1)'
                        : 'rgba(11, 48, 79, 1)'
                    }
                },
                "symbolRepeat": true,
                "symbolSize": [
                    3, 3
                ],
                "symbolMargin": 1,
                label: {
                    color: "rgba(174, 220, 244, 1)",
                    fontSize: 14,
                    show: true,
                    position: 'top',
                    formatter: p => `${p.value}`
                },
                data: []
            }
        ]
    },
    data : {
        dataInterface: {
            url: "/htdata/map/findMonitorHourData",
            params: [
                {
                    value: 'authCode'
                }, {
                    value: 'sensorCode'
                }
            ],
            dataSource: [
                {
                    SourceKey: "retBody.x.data",
                    AimsKey: "data.config.xAxis.data"
                },
                {
                    SourceKey: "retBody.chartData.0",
                    AimsKey: "data.config.series.0.data"
                },
                {
                    SourceKey: "retBody.chartData.0",
                    AimsKey: "data.config.series.1.data"
                }
            ]
        },
        config:{
            xAxis:{
                data:[]
            },
            series:[{
                data:[]
            },{
                data:[]
            }]
        }
    }
}