<template>
  <div class="app-container">
    <div class="headTitle">综合安全生产平台</div>
    <div class="title" v-for="(i,k) in title"
         :style="'top:'+(titlePosition[k]&&titlePosition[k].top||0)+'%;left:'+(titlePosition[k]&&titlePosition[k].left||0)+'%'">
      {{ i }}
    </div>
    <!--每日人力出勤-->
    <div class="manpowerAttendance" id="manpowerAttendance">
      <Chart ref="manpowerAttendance"></Chart>
    </div>

    <!--IQC-->
    <div class="IQC" id="IQC">
      <div style="background-color: #094170">
        <div class="scrollTableItem" style="font-weight: bold;">
          编号
        </div>
        <div class="scrollTableItem" style="font-weight: bold;width: 33.3%">
          型号
        </div>
        <div class="scrollTableItem" style="font-weight: bold;">
          计划数量
        </div>
        <div class="scrollTableItem" style="font-weight: bold;">
          完成数量
        </div>
        <div class="scrollTableItem" style="font-weight: bold;">
          差异值
        </div>
      </div>
      <vue-seamless-scroll
        :class-option="scrollTableOption"
        :data="scrollTableData"
        class="case-item"
        style="height: calc(100% - 35px);overflow: hidden;"
      >
        <div
          v-for="(item, index) in scrollTableData"
          :key="index"

        >
          <div :style='"background-color:" + ((index % 2 === 0)? "#053460":"#032d57") '>
            <div
              class="scrollTableItem">
              {{ item.value1 }}
            </div>
            <div
              class="scrollTableItem" style="width: 33.3%">
              A-{{ item.value2 }}
            </div>
            <div
              class="scrollTableItem">
              {{ item.value3 }}
            </div>
            <div
              class="scrollTableItem">
              {{ item.value4 }}
            </div>
            <div
              class="scrollTableItem">
              {{ item.value5 }}
            </div>
          </div>
        </div>
      </vue-seamless-scroll>
    </div>

    <!--生产效率-->
    <div class="productionEfficiency" id="productionEfficiency">
      <Chart ref="productionEfficiency"></Chart>
    </div>


    <!--周质量分析-->
    <div class="equipmentPowerOne" id="equipmentPowerOne">
      <Chart ref="equipmentPowerOne"></Chart>
    </div>
    <div class="equipmentPowerTwo" id="equipmentPowerTwo">
      <Chart ref="equipmentPowerTwo"></Chart>
    </div>
    <div class="equipmentPowerThree" id="equipmentPowerThree">
      <Chart ref="equipmentPowerThree"></Chart>
    </div>
    <div class="equipmentPowerFour" id="equipmentPowerFour">
      <Chart ref="equipmentPowerFour"></Chart>
    </div>
    <div class="equipmentPowerFive" id="equipmentPowerFive">
      <Chart ref="equipmentPowerFive"></Chart>
    </div>


    <div class="topLeft" id="topLeft">
      <Chart ref="topLeft"></Chart>
    </div>

    <div v-html="safeDayHtml"></div>
  </div>
</template>

<script>
import vueSeamlessScroll from "vue-seamless-scroll";
import Chart from "../../../components/board/Chart";
import * as echarts from 'echarts'
import {getData} from "@/api/board/getData";

export default {
  components: {
    vueSeamlessScroll,
    Chart
  },
  name: "Liner",
  data() {
    return {
      title: [
        '产量统计',
        '三日订单执行情况',
        '班组 6s 排行榜',
        '周生产型号统计',
        '周质量分析',
        '安全生产',
      ],
      titlePosition: [
        {
          top: 11.5,
          left: 5.5
        },
        {
          top: 11.5,
          left: 32
        },
        {
          top: 11.5,
          left: 73.5
        },
        {
          top: 55.4,
          left: 5.5
        },
        {
          top: 55.4,
          left: 32
        },
        {
          top: 55.4,
          left: 73.6
        },
      ],
      scrollTableOption: {
        step: 0.5, // 数值越大速度滚动越快
        limitMoveNum: 5, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 0,
      },
      scrollTableData: [],
      safeDayHtml: null
    }
  },
  mounted() {
    getData().then(e => {
      this.scrollTableData = e.table8
    })
    let min = Math.ceil(Math.min(...[61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],))
    let max = Math.ceil(Math.max(...[61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],))
    const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100

    this.$refs.manpowerAttendance.setData({
      color: ['#33a2fe', '#33a2fe', '#33a2fe', '#33a2fe', '#33a2fe'],
      grid: {
        top: "20%",
        bottom: "15%",
        right: "5%"
      },
      dataZoom: [],
      xAxis: {
        margin: 10,
        nameTextStyle: {
          color: '#c0c3cd',
          padding: [0, 0, -10, 0],
          fontSize: 14,
        },
        axisLabel: {
          color: '#c0c3cd', //X轴文字
          fontSize: 14,
          interval: 0,
          margin: 20,
          rotate: -20,
        },
        axisTick: {
          lineStyle: {
            color: '#0B1535',
            width: 1,
          },
          show: false,
        },
        splitLine: {
          show: false,
        },
        axisLine: {
          lineStyle: {
            color: '#384267',
            width: 1,
            type: 'dashed',
          },
          show: true,
        },
        data: ['人A', '人B', '人C', '人D', '人E', '人F', '人G', '人H'],
        type: 'category',
      },
      yAxis: {
        type: 'value',
        nameTextStyle: {
          color: '#c0c3cd',
          padding: [0, 0, -10, 0],
          fontSize: 14,
        },
        axisLabel: {
          color: '#c0c3cd', //Y轴文字
          fontSize: 14,
        },
        axisTick: {
          lineStyle: {
            color: '#384267',
            width: 1,
          },
          show: true,
        },
        splitLine: {
          show: true,
          lineStyle: {
            color: '#384267',
            type: 'line',
          },
        },
        axisLine: {
          lineStyle: {
            color: '#fff',
            width: 1,
            type: 'line',
          },
          show: false,
        },
      },
      series: [
        {
          data: [60, 55, 45, 42, 40, 40, 39, 38],
          type: 'pictorialBar',
          barMaxWidth: 'auto',
          barWidth: 1.5 * vw,
          symbol: 'rect',
          itemStyle: {
            color: function (val) {
              if ([60, 55, 45, 42, 40, 40, 39, 38].length - val.dataIndex === 1) {
                return 'red'
              } else if ([60, 55, 45, 42, 40, 40, 39, 38].length - val.dataIndex === 2) {
                return 'yellow'

              } else {
                return '#35AAFE'
              }
            }
          },
          label: {
            normal: {
              show: true,
              position: "top",
              textStyle: {
                color: "#a8aab0",
                fontStyle: "normal",
                fontFamily: "微软雅黑",
                fontSize: 0.75 * vw,
              },
            },
          }
        },
        {
          data: [60, 55, 45, 42, 40, 40, 39, 38],
          type: 'pictorialBar',
          barWidth: 1.5 * vw,
          symbolPosition: 'end',
          symbol: 'diamond',
          itemStyle: {
            color: function (val) {
              if ([60, 55, 45, 42, 40, 40, 39, 38].length - val.dataIndex === 1) {
                return 'red'
              } else if ([60, 55, 45, 42, 40, 40, 39, 38].length - val.dataIndex === 2) {
                return 'yellow'
              } else {
                return '#66c8ff'
              }
            }
          },
          symbolOffset: ['0%', '-50%'],
          symbolSize: [1.5 * vw, 10],
          zlevel: 4,
        },
        {
          data: [60, 55, 45, 42, 40, 40, 39, 38].map(val => 1),
          type: 'pictorialBar',
          barWidth: 1.5 * vw,
          symbolPosition: 'end',
          symbol: 'diamond',
          itemStyle: {
            color: function (val) {
              if ([60, 55, 45, 42, 40, 40, 39, 38].length - val.dataIndex === 1) {
                return 'red'
              } else if ([60, 55, 45, 42, 40, 40, 39, 38].length - val.dataIndex === 2) {
                return 'yellow'

              } else {
                return '#66c8ff'
              }
            }
          },
          symbolOffset: ['0%', '-20%'],
          symbolSize: [1.5 * vw, 10],
          zlevel: 4,
        },
        // {
        //   type: 'pictorialBar',
        //   name: 'pictorial element',
        //   symbol: function (val, index) {
        //     // return 'image://' + 'http://10.100.70.5:9090/' + data.yImg[index.dataIndex]
        //   },
        //   symbolSize: [40, 40],
        //   z: 10,
        //   data: [60, 55, 45, 42, 40, 40, 39, 38].map(val => {
        //     return {
        //       value: val,
        //       symbolPosition: 'end',
        //       symbolOffset: [0, '-190%']
        //     }
        //   })
        // },
      ]
    })
    this.$refs.topLeft.setData({
      grid: {
        top: "20%",
        left: "1%",
        right: "5%",
        bottom: "1%",
        containLabel: true,
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow'
        }
      },
      legend: {
        right: '0',
        data: ['计划', '实际'],
        textStyle: {
          fontSize: 0.75 * vw,
          color: "#F1F1F3",
        },
      },
      xAxis: [
        {
          type: 'category',
          axisTick: {show: false},
          axisLabel: {
            rotate: -20,
            margin: 20,
            textStyle: {
              fontSize: 0.75 * vw,
              color: "#F1F1F3",
            },
          },
          data: ['A-01', 'A-02', 'A-03', 'A-04', 'A-05', 'A-06', 'A-07']
        }
      ],
      yAxis: [
        {
          axisLabel: {
            textStyle: {
              fontSize: 0.75 * vw,
              color: "#F1F1F3",
            },
          },
          splitLine: {
            lineStyle: {
              color: "rgba(255,255,255,0.1)",
            },
          },
          type: 'value'
        }
      ],
      series: [
        {
          name: '计划',
          type: 'bar',
          barGap: 0,
          emphasis: {
            focus: 'series'
          },
          barWidth: '30%',
          barMaxWidth: '50px',
          itemStyle: {
            //图形样式
            normal: {
              color: true ? '#db8151' : "#64BCEC",
            },
          },
          label: {
            show: true,
            position: "top",
            formatter: `{c}${''}`,
            textStyle: {
              color: "rgba(255,255,255,0.5)",
              fontSize: 0.75 * vw
            },
          },
          data: [22, 52, 55, 12, 35, 44, 66],
        },
        {
          name: '实际',
          type: 'bar',
          emphasis: {
            focus: 'series'
          },
          barWidth: '30%',
          barMaxWidth: '50px',
          barGap: '40%',
          label: {
            show: true,
            position: "top",
            formatter: `{c}${''}`,
            textStyle: {
              color: "rgba(255,255,255,0.5)",
              fontSize: 0.75 * vw
            },
          },
          itemStyle: {
            //图形样式
            normal: {
              color: true ? '#9ce375' : "#4FD3B9",
            },
          },
          data: [32, 42, 50, 22, 30, 40, 52],
        },
      ]
    })
    this.$refs.productionEfficiency.setData({
      grid: {
        top: "10%",
        left: '10%',
        right: "5%",
        bottom: '15%',
        // containLabel: true
      },
      dataZoom: [],
      xAxis: {
        data: ["A-1", "A-2", "A-3", "A-4", "A-5", "A-6", "A-7"],
        axisLine: {
          lineStyle: {
            color: "#0177d4",
          },
        },
        axisLabel: {
          color: "#fff",
          fontSize: 0.5 * vw,
          interval: 0,
          rotate: -20,
        },
      },
      yAxis: {
        nameTextStyle: {
          color: "#fff",
          fontSize: 16,
        },
        axisLine: {
          lineStyle: {
            color: "#0177d4",
          },
        },
        axisLabel: {
          color: "#fff",
          fontSize: 16,
        },
        splitLine: {
          show: false,
          lineStyle: {
            color: "#0177d4",
          },
        },
      },
      series: [
        {
          type: "bar",
          barWidth: 1 * vw,
          itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(
                0,
                0,
                0,
                1,
                [
                  {
                    offset: 0,
                    color: "#00b0ff",
                  },
                  {
                    offset: 0.8,
                    color: "#7052f4",
                  },
                ],
                false
              ),
            },
          },
          label: {
            show: true,
            position: "top",
            textStyle: {
              color: "#fff",
              fontSize: 0.75 * vw
            },
          },
          data: [12, 20, 11, 30, 14, 80, 50],
        },
      ],
    })
    this.$refs.equipmentPowerOne.setData({
      grid: {
        top: '28%',
        left: '5%',
        right: '5%',
        bottom: '0%',
        containLabel: true,
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow',
          label: {
            show: true,
          },
        },
      },
      legend: {
        top: '5%',
        itemWidth: 20,
        itemHeight: 10,
        itemStyle: {
          borderWidth: 1,
          borderHeight: 1,
        },
        formatter: function (val) {
          return `${val}     `
        },
        textStyle: {
          fontSize: 0.75 * vw,
          color: function () {

          },
        },
      },
      xAxis: {
        type: 'category',
        data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        axisLine: {
          show: true,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          show: true,
          textStyle: {
            color: '#ffffff', //X轴文字颜色
          },
        },
      },
      yAxis: [
        {
          name: '合格率',
          min: (min - 2 < 0) ? 0 : min - 2,
          max: (max + 2 > 100) ? 100 : max + 2,
          type: 'value',
          nameTextStyle: {
            color: '#fff',
          },
          splitLine: {
            show: false,
            lineStyle: {
              color: '#eeeeee',
            },
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: true,
            interval: 0,
            textStyle: {
              color: '#ffffff',
            },
          },
        },
      ],
      series: [
        {
          name: "内胆检漏",
          type: 'line',
          smooth: false,
          showAllSymbol: true, //显示所有图形。
          symbol: 'circle', //标记的图形为实心圆
          symbolSize: 4, //标记的大小
          itemStyle: {
            //折线拐点标志的样式
            color: '#389af4',
            borderWidth: '2',
            borderColor: '#389af4',
          },
          lineStyle: {
            color: '#389af4',
          },
          label: {
            //图形上的文本标签
            normal: {
              formatter: `{c}${''}`,
              show: true,
              position: "top",
              textStyle: {
                color: '#389af4',
                fontStyle: "normal",
                fontFamily: "微软雅黑",
                fontSize: 0.5 * vw,
              },
            },
          },
          data: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],
        },
      ]
    })
    this.$refs.equipmentPowerTwo.setData({
      grid: {
        top: '28%',
        left: '5%',
        right: '5%',
        bottom: '0%',
        containLabel: true,
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow',
          label: {
            show: true,
          },
        },
      },
      legend: {
        top: '5%',
        itemWidth: 20,
        itemHeight: 10,
        itemStyle: {
          borderWidth: 1,
          borderHeight: 1,
        },
        formatter: function (val) {
          return `${val}     `
        },
        textStyle: {
          fontSize: 0.75 * vw,
          color: function () {

          },
        },
      },
      xAxis: {
        type: 'category',
        data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        axisLine: {
          show: true,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          show: true,
          textStyle: {
            color: '#ffffff', //X轴文字颜色
          },
        },
      },
      yAxis: [
        {
          name: '合格率',
          min: (min - 2 < 0) ? 0 : min - 2,
          max: (max + 2 > 100) ? 100 : max + 2,
          type: 'value',
          nameTextStyle: {
            color: '#fff',
          },
          splitLine: {
            show: false,
            lineStyle: {
              color: '#eeeeee',
            },
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: true,
            interval: 0,
            textStyle: {
              color: '#ffffff',
            },
          },
        },
      ],
      series: [
        {
          name: "安全检测",
          type: 'line',
          smooth: false,
          showAllSymbol: true, //显示所有图形。
          symbol: 'circle', //标记的图形为实心圆
          symbolSize: 4, //标记的大小
          itemStyle: {
            //折线拐点标志的样式
            color: '#ff8c37',
            borderWidth: '2',
            borderColor: '#ff8c37',
          },
          lineStyle: {
            color: '#ff8c37',
          },
          label: {
            //图形上的文本标签
            normal: {
              formatter: `{c}${''}`,
              show: true,
              position: "top",
              textStyle: {
                color: '#ff8c37',
                fontStyle: "normal",
                fontFamily: "微软雅黑",
                fontSize: 0.5 * vw,
              },
            },
          },
          data: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],
        },
      ]
    })
    this.$refs.equipmentPowerThree.setData({
      grid: {
        top: '28%',
        left: '5%',
        right: '5%',
        bottom: '0%',
        containLabel: true,
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow',
          label: {
            show: true,
          },
        },
      },
      legend: {
        top: '5%',
        itemWidth: 20,
        itemHeight: 10,
        itemStyle: {
          borderWidth: 1,
          borderHeight: 1,
        },
        formatter: function (val) {
          return `${val}     `
        },
        textStyle: {
          fontSize: 0.75 * vw,
          color: function () {

          },
        },
      },
      xAxis: {
        type: 'category',
        data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        axisLine: {
          show: true,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          show: true,
          textStyle: {
            color: '#ffffff', //X轴文字颜色
          },
        },
      },
      yAxis: [
        {
          name: '合格率',
          min: (min - 2 < 0) ? 0 : min - 2,
          max: (max + 2 > 100) ? 100 : max + 2,
          type: 'value',
          nameTextStyle: {
            color: '#fff',
          },
          splitLine: {
            show: false,
            lineStyle: {
              color: '#eeeeee',
            },
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: true,
            interval: 0,
            textStyle: {
              color: '#ffffff',
            },
          },
        },
      ],
      series: [
        {
          name: "成品检漏",
          type: 'line',
          smooth: false,
          showAllSymbol: true, //显示所有图形。
          symbol: 'circle', //标记的图形为实心圆
          symbolSize: 4, //标记的大小
          itemStyle: {
            //折线拐点标志的样式
            color: '#ffc257',
            borderWidth: '2',
            borderColor: '#ffc257',
          },
          lineStyle: {
            color: '#ffc257',
          },
          label: {
            //图形上的文本标签
            normal: {
              formatter: `{c}${''}`,
              show: true,
              position: "top",
              textStyle: {
                color: '#ffc257',
                fontStyle: "normal",
                fontFamily: "微软雅黑",
                fontSize: 0.5 * vw,
              },
            },
          },
          data: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],
        },
      ]
    })
    this.$refs.equipmentPowerFour.setData({
      grid: {
        top: '28%',
        left: '5%',
        right: '5%',
        bottom: '0%',
        containLabel: true,
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow',
          label: {
            show: true,
          },
        },
      },
      legend: {
        top: '5%',
        itemWidth: 20,
        itemHeight: 10,
        itemStyle: {
          borderWidth: 1,
          borderHeight: 1,
        },
        formatter: function (val) {
          return `${val}     `
        },
        textStyle: {
          fontSize: 0.75 * vw,
          color: function () {

          },
        },
      },
      xAxis: {
        type: 'category',
        data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        axisLine: {
          show: true,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          show: true,
          textStyle: {
            color: '#ffffff', //X轴文字颜色
          },
        },
      },
      yAxis: [
        {
          name: '合格率',
          min: (min - 2 < 0) ? 0 : min - 2,
          max: (max + 2 > 100) ? 100 : max + 2,
          type: 'value',
          nameTextStyle: {
            color: '#fff',
          },
          splitLine: {
            show: false,
            lineStyle: {
              color: '#eeeeee',
            },
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: true,
            interval: 0,
            textStyle: {
              color: '#ffffff',
            },
          },
        },
      ],
      series: [
        {
          name: "测温性能",
          type: 'line',
          smooth: false,
          showAllSymbol: true, //显示所有图形。
          symbol: 'circle', //标记的图形为实心圆
          symbolSize: 4, //标记的大小
          itemStyle: {
            //折线拐点标志的样式
            color: '#fd6f97',
            borderWidth: '2',
            borderColor: '#fd6f97',
          },
          lineStyle: {
            color: '#fd6f97',
          },
          label: {
            //图形上的文本标签
            normal: {
              formatter: `{c}${''}`,
              show: true,
              position: "top",
              textStyle: {
                color: '#fd6f97',
                fontStyle: "normal",
                fontFamily: "微软雅黑",
                fontSize: 0.5 * vw,
              },
            },
          },
          data: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],
        },
      ]
    })
    this.$refs.equipmentPowerFive.setData({
      grid: {
        top: '28%',
        left: '5%',
        right: '5%',
        bottom: '0%',
        containLabel: true,
      },
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow',
          label: {
            show: true,
          },
        },
      },
      legend: {
        top: '5%',
        itemWidth: 20,
        itemHeight: 10,
        itemStyle: {
          borderWidth: 1,
          borderHeight: 1,
        },
        formatter: function (val) {
          return `${val}     `
        },
        textStyle: {
          fontSize: 0.75 * vw,
          color: function () {

          },
        },
      },
      xAxis: {
        type: 'category',
        data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        axisLine: {
          show: true,
        },
        axisTick: {
          show: false,
        },
        axisLabel: {
          show: true,
          textStyle: {
            color: '#ffffff', //X轴文字颜色
          },
        },
      },
      yAxis: [
        {
          name: '合格率',
          min: (min - 2 < 0) ? 0 : min - 2,
          max: (max + 2 > 100) ? 100 : max + 2,
          type: 'value',
          nameTextStyle: {
            color: '#fff',
          },
          splitLine: {
            show: false,
            lineStyle: {
              color: '#eeeeee',
            },
          },
          axisTick: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: true,
            interval: 0,
            textStyle: {
              color: '#ffffff',
            },
          },
        },
      ],
      series: [
        {
          name: "成品外观",
          type: 'line',
          smooth: false,
          showAllSymbol: true, //显示所有图形。
          symbol: 'circle', //标记的图形为实心圆
          symbolSize: 4, //标记的大小
          itemStyle: {
            //折线拐点标志的样式
            color: '#a181fc',
            borderWidth: '2',
            borderColor: '#a181fc',
          },
          lineStyle: {
            color: '#a181fc',
          },
          label: {
            //图形上的文本标签
            normal: {
              formatter: `{c}${''}`,
              show: true,
              position: "top",
              textStyle: {
                color: '#a181fc',
                fontStyle: "normal",
                fontFamily: "微软雅黑",
                fontSize: 0.5 * vw,
              },
            },
          },
          data: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],
        },
      ]
    })
    this.day()
  },
  methods: {

    day() {
      const today = () => {
        const currentYear = new Date().getFullYear().toString();
        const hasTimestamp = new Date() - new Date(currentYear) + (8 * 60 * 60 * 1000);
        const hasDays = Math.ceil(hasTimestamp / 86400000);
        return hasDays
      }
      this.safeDayHtml = `
    <span style="position: absolute;top: 66%;left: 84%;white-space:nowrap;color: #CBE6F7;font-size: 1.3vw;font-weight:600;transform: translateX(-50%);letter-spacing: 0.3vw">${new Date().getFullYear().toString()}年连续安全生产天数</span>
    <span style="position: absolute;top: 74%;left: 84%;color: #08F580;font-size: 2.5vw;transform: translateX(-50%);letter-spacing: 0.3vw">${today()}<span style="font-size: 0.5vw">天</span> </span>
    <span style="position: absolute;top: 89%;left: 84%;color: #CBE6F7;font-size: 1vw;transform: translateX(-50%);letter-spacing: 0.3vw">智能互联工厂</span>
    `
    }
  }
}
</script>
<style scoped>
.app-container {
  background-image: url("../../../assets/board/week.jpg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.headTitle {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translate(-50%, -100%);
  font-size: 1.5vw;
  color: #d6eaed;
  letter-spacing: 10px;
}

.title {
  position: absolute;
  transform: translateY(-50%);
  color: #dddddd;
  font-size: 1vw;
  letter-spacing: 2px;
}

.manpowerAttendance {
  position: absolute;
  width: 25%;
  height: 35%;
  top: 15%;
  left: 71.5%;
}

.IQC {
  position: absolute;
  width: 40%;
  height: 35%;
  top: 15%;
  left: 30%;
}

.productionEfficiency {
  position: absolute;
  width: 25%;
  height: 35%;
  top: 60%;
  left: 3%;
}

.topLeft {
  position: absolute;
  width: 25%;
  height: 34%;
  top: 15.5%;
  left: 3.5%;
}

.equipmentPowerOne {
  position: absolute;
  width: 13%;
  height: 16%;
  top: 60%;
  left: 30.5%;
}

.equipmentPowerTwo {
  position: absolute;
  width: 13%;
  height: 16%;
  top: 60%;
  left: 43.5%;
}

.equipmentPowerThree {
  position: absolute;
  width: 13%;
  height: 16%;
  top: 60%;
  left: 56.5%;
}

.equipmentPowerFour {
  position: absolute;
  width: 19%;
  height: 16%;
  top: 76%;
  left: 30.5%;
}

.equipmentPowerFive {
  position: absolute;
  width: 19%;
  height: 16%;
  top: 76%;
  left: 49.5%;
}

.scrollTableItem {
  color: rgb(185, 186, 192);
  margin: auto 0px;
  padding: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  display: inline-block;
  width: 16.6%;
}
</style>
