var page_function = {
  components: {},
  data() {
    return {
      VarMenuPage: "system_power",
      VarMenu: "area",
      VarPageContainerCss: "padding:0px",

      deviceKey: "製程動力", // Var_Config 設定檔 對應的key
      fromPage: "system_power.php", //  從哪個頁面來的
      data_group: "電力", //  隸屬於device_item 內的哪一個群組
      previousPage: true,
      previousPageName: "電力系統",

      billboard: {
        item01: {
          show: true, //	要不要顯示此區塊
          title: "製程動力", //	標題
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "",  
          showButton: true,
          button: {
            //	標題同一列的按鈕功能
            item01: {
              show: true, //	要不要顯示此按鈕
              label: "長條圖", //	標題 (標示定義名稱)
              icon: "leaderboard", //	按鈕圖樣
              linkto: "chart_bar.php", //	轉跳頁面 定義為 null 不會觸發
              params: { options: "製程動力" , item_type: "電力"}, //	轉跳頁面後面帶參數
            },
            item02: {
              show: true,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "製程動力" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "5",
          left: "41",
          width: "340",
        },
        item02: {
          show: true,
          title: "中式生產線",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "中式生產線" , item_type: "電力"},
            },
            item02: {
              show: true,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "中式生產線" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "18",
          left: "1",
          width: "340",
        },
        "44": {
          show: true,
          title: "1PC蒸煮區",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 44",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PC蒸煮區" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PC蒸煮區" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "28.5",
          left: "1",
          width: "340",
        },
        "58": {
          show: true,
          title: "1PE罐頭封罐機、遠紅外線",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 58",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PE罐頭封罐機、遠紅外線" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PE罐頭封罐機、遠紅外線" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "39",
          left: "1",
          width: "340",
        },
        "54": {
          show: true,
          title: "1PG罐頭加工區、殺菌釜",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 54",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PG罐頭加工區、殺菌釜" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PG罐頭加工區、殺菌釜" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "49.5",
          left: "1",
          width: "340",
        },
        "52": {
          show: true,
          title: "1PE-1金瑛發煮鍋、吊車",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 52",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PE-1金瑛發煮鍋、吊車" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PE-1金瑛發煮鍋、吊車" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "60",
          left: "1",
          width: "340",
        },
        "51": {
          show: true,
          title: "BLP大地下室",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 51",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "BLP大地下室" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "BLP大地下室" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "70.5",
          left: "1",
          width: "340",
        },
        "60": {
          show: true,
          title: "緊急動力電源台電ATS",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 60",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "緊急動力電源台電ATS" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "緊急動力電源台電ATS" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "81",
          left: "1",
          width: "340",
        },
        "43": {
          show: true,
          title: "醬油槽區",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 43",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "醬油槽區" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "醬油槽區" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "91.5",
          left: "1",
          width: "340",
        },
        item10: {
          show: true,
          title: "西式生產線",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "西式生產線" , item_type: "電力"},
            },
            item02: {
              show: true,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "西式生產線" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "18",
          left: "21",
          width: "340",
        },
        "46": {
          show: true,
          title: "1PA大調理區",
          title_style: "background: linear-gradient(to right, #246ab5 5% , #1565c0 50% , #115eaa 95%);",  //  標體底色
          caption : "ID = 46",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PA大調理區" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PA大調理區" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "30",
          left: "21",
          width: "320",
        },
        "45": {
          show: true,
          title: "1PB切割區",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 45",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PB切割區" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PB切割區" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "40",
          left: "21",
          width: "320",
        },
        "57": {
          show: true,
          title: "1PD烘烤區1",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 57",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PD烘烤區1" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PD烘烤區1" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "50",
          left: "21",
          width: "320",
        },
        "62": {
          show: true,
          title: "EPB烘烤室3Ø220V電源",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 62",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "EPB烘烤室3Ø220V電源" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "EPB烘烤室3Ø220V電源" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "60",
          left: "21",
          width: "320",
        },
        item15: {
          show: true,
          title: "糕餅生產線",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "糕餅生產線", item_type: "電力" },
            },
            item02: {
              show: true,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "糕餅生產線", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "18",
          left: "41.5",
          width: "320",
        },
        "59": {
          show: true,
          title: "1PJ糕餅調理室",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 59",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PJ糕餅調理室", item_type: "電力" },
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PJ糕餅調理室", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "30",
          left: "41",
          width: "320",
        },
        "50": {
          show: true,
          title: "1PK糕餅瓦斯隧道爐",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 50",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PK糕餅瓦斯隧道爐", item_type: "電力" },
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PK糕餅瓦斯隧道爐", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "40",
          left: "41",
          width: "320",
        },
        "49": {
          show: true,
          title: "1PL糕餅走道",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 49",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PL糕餅走道" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PL糕餅走道", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "50",
          left: "41",
          width: "320",
        },
        "48": {
          show: true,
          title: "1PM糕餅旋轉烤爐",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 48",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PM糕餅旋轉烤爐" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PM糕餅旋轉烤爐", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "60",
          left: "41",
          width: "320",
        },
        item20: {
          show: true,
          title: "包裝生產線",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "包裝生產線", item_type: "電力"},
            },
            item02: {
              show: true,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "包裝生產線", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "18",
          left: "61.5",
          width: "320",
        },
        "53": {
          show: true,
          title: "1PF香腸包裝區",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 53",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "1PF香腸包裝區" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "1PF香腸包裝區" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "30",
          left: "61",
          width: "320",
        },
        "29": {
          show: true,
          title: "RAC5肉鬆包裝區",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 29",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "RAC5肉鬆包裝區" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "RAC5肉鬆包裝區" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "40",
          left: "61",
          width: "320",
        },
        "47": {
          show: true,
          title: "脆片包裝作業區",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 47",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "脆片包裝作業區" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "脆片包裝作業區" , item_type: "電力"},
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "50",
          left: "61",
          width: "320",
        },
        item24: {
          show: true,
          title: "燒臘生產線",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "燒臘生產線" , item_type: "電力"},
            },
            item02: {
              show: true,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "燒臘生產線", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "18",
          left: "81.5",
          width: "320",
        },
        "36": {
          show: true,
          title: "MP滷味廠",
          title_style: "background: linear-gradient(to right, #1c48ae 5% , #102e72 50% , #0c255c 95%);",  
          caption : "ID = 36",  
          showButton: true,
          button: {
            item01: {
              show: true,
              label: "長條圖",
              icon: "leaderboard",
              linkto: "chart_bar.php",
              params: { options: "MP滷味廠" , item_type: "電力"},
            },
            item02: {
              show: false,
              label: "圓餅圖",
              icon: "pie_chart",
              linkto: "chart_pie.php",
              params: { options: "MP滷味廠", item_type: "電力" },
            },
          },
          data: {
            item01: {
              show: true,
              label: "今日用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item02: {
              show: true,
              label: "本月用電",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "度",
              icon: "bolt",
            },
            item03: {
              show: true,
              label: "即時功率",
              isDBValue: true,
              DBvalue: 0,
              isSoft: true,
              SoftValue: "",
              unit: "kW",
              icon: "bolt",
            },
          },
          top: "30",
          left: "81",
          width: "320",
        },
      },

      //	線條 => 定義 class 如果是line_h要設定height的長度(px)，width設為0，反之是line_w要設定width的長度(px)，height設為0
      line: [
        {
          show: true,
          class: "line_h",
          top: "14.5",
          left: "51.50",
          width: "0",
          height: "30",
          contect: "製程動力到其他設備", //	註解這條線是什麼意思
          showArrow: false, //	要不要顯示箭頭
          arrow: { class: "", top: "0", left: "0" }, //	箭頭微調 (px) 方向設定 arrow right、left、up、down
        },
        {
          show: true,
          class: "line_w",
          top: "16",
          left: "9.75",
          width: "1540",
          height: "0",
          showArrow: false,
          arrow: { class: "", top: "0", left: "0" },
          contect: "製程動力到其他設備",
        },
        {
          show: true,
          class: "line_h",
          top: "16",
          left: "9.75",
          width: "0",
          height: "35",
          showArrow: false,
          arrow: { class: "arrow down", top: "20", left: "-6" },
          contect: "製程動力到中式生產線",
        },
        {
          show: true,
          class: "line_h",
          top: "16",
          left: "29.75",
          width: "0",
          height: "35",
          showArrow: false,
          arrow: { class: "arrow down", top: "20", left: "-6" },
          contect: "製程動力到西式生產線",
        },
        {
          show: true,
          class: "line_h",
          top: "16",
          left: "49.75",
          width: "0",
          height: "35",
          showArrow: false,
          arrow: { class: "arrow down", top: "20", left: "-6" },
          contect: "製程動力到糕餅生產線",
        },
        {
          show: true,
          class: "line_h",
          top: "16",
          left: "69.75",
          width: "0",
          height: "35",
          showArrow: false,
          arrow: { class: "arrow down", top: "20", left: "-6" },
          contect: "製程動力到包裝生產線",
        },
        {
          show: true,
          class: "line_h",
          top: "16",
          left: "89.75",
          width: "0",
          height: "35",
          showArrow: false,
          arrow: { class: "arrow down", top: "20", left: "-6" },
          contect: "製程動力到燒臘生產線",
        },
        /*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
        {
          show: true,
          class: "line_w",
          top: "22.5",
          left: "18",
          width: "30",
          height: "0",
          showArrow: false,
          arrow: { class: "", top: "-6", left: "-6" },
          contect: "中式生產線到子設備",
        },
        {
          show: true,
          class: "line_h",
          top: "22.5",
          left: "19.5",
          width: "0",
          height: "1282",
          showArrow: false,
          arrow: { class: "", top: "20", left: "-6" },
          contect: "中式生產線到子設備",
        },
        {
          show: true,
          class: "line_w",
          top: "35.5",
          left: "17.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "中式生產線 => 1PC蒸煮區",
        },
        {
          show: true,
          class: "line_w",
          top: "45.5",
          left: "17.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "中式生產線 => 1PE罐頭封罐機、遠紅外線",
        },
        {
          show: true,
          class: "line_w",
          top: "55.5",
          left: "17.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "中式生產線 => 1PG罐頭加工區、殺菌釜",
        },
        {
          show: true,
          class: "line_w",
          top: "65.5",
          left: "17.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "中式生產線 => 1PE-1金瑛發煮鍋、吊車",
        },
        {
          show: true,
          class: "line_w",
          top: "75.5",
          left: "17.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "中式生產線 => BLP大地下室",
        },
        {
          show: true,
          class: "line_w",
          top: "85.5",
          left: "17.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "中式生產線 => 緊急動力電源台電ATS",
        },
        {
          show: true,
          class: "line_w",
          top: "95.75",
          left: "17.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "中式生產線 => 醬油槽區",
        },
        /*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
        {
          show: true,
          class: "line_w",
          top: "22.5",
          left: "38",
          width: "30",
          height: "0",
          showArrow: false,
          arrow: { class: "", top: "-6", left: "-6" },
          contect: "西式生產線到子設備",
        },
        {
          show: true,
          class: "line_h",
          top: "22.5",
          left: "39.5",
          width: "0",
          height: "754",
          showArrow: false,
          arrow: { class: "", top: "20", left: "-6" },
          contect: "西式生產線到子設備",
        },
        {
          show: true,
          class: "line_w",
          top: "35.5",
          left: "37.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "西式生產線 => 1PA大調理區",
        },
        {
          show: true,
          class: "line_w",
          top: "45.5",
          left: "37.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "西式生產線 => 1PB切割區",
        },
        {
          show: true,
          class: "line_w",
          top: "55.5",
          left: "37.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "西式生產線 => 1PD烘烤區1",
        },
        {
          show: true,
          class: "line_w",
          top: "65.5",
          left: "37.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "西式生產線 => EPB烘烤室3Ø220V電源",
        },
        /*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
        {
          show: true,
          class: "line_w",
          top: "22.5",
          left: "58",
          width: "30",
          height: "0",
          showArrow: false,
          arrow: { class: "", top: "-6", left: "-6" },
          contect: "糕餅生產線到子設備",
        },
        {
          show: true,
          class: "line_h",
          top: "22.5",
          left: "59.5",
          width: "0",
          height: "754",
          showArrow: false,
          arrow: { class: "", top: "20", left: "-6" },
          contect: "糕餅生產線到子設備",
        },
        {
          show: true,
          class: "line_w",
          top: "35.5",
          left: "57.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "糕餅生產線 => 1PJ糕餅調理室",
        },
        {
          show: true,
          class: "line_w",
          top: "45.5",
          left: "57.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "糕餅生產線 => 1PK糕餅瓦斯隧道爐",
        },
        {
          show: true,
          class: "line_w",
          top: "55.5",
          left: "57.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "糕餅生產線 => 1PL糕餅走道",
        },
        {
          show: true,
          class: "line_w",
          top: "65.5",
          left: "57.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "糕餅生產線 => 1PM糕餅旋轉烤爐",
        },
        /*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
        {
          show: true,
          class: "line_w",
          top: "22.5",
          left: "78",
          width: "30",
          height: "0",
          showArrow: false,
          arrow: { class: "", top: "-6", left: "-6" },
          contect: "包裝生產線到子設備",
        },
        {
          show: true,
          class: "line_h",
          top: "22.5",
          left: "79.5",
          width: "0",
          height: "579",
          showArrow: false,
          arrow: { class: "", top: "20", left: "-6" },
          contect: "包裝生產線到子設備",
        },
        {
          show: true,
          class: "line_w",
          top: "35.5",
          left: "77.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "包裝生產線 => 1PF香腸包裝區",
        },
        {
          show: true,
          class: "line_w",
          top: "45.5",
          left: "77.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "包裝生產線 => RAC5肉鬆包裝區",
        },
        {
          show: true,
          class: "line_w",
          top: "55.5",
          left: "77.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "包裝生產線 => 脆片包裝作業區",
        },
        /*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
        {
          show: true,
          class: "line_w",
          top: "22.5",
          left: "98",
          width: "30",
          height: "0",
          showArrow: false,
          arrow: { class: "", top: "-6", left: "-6" },
          contect: "燒臘生產線到子設備",
        },
        {
          show: true,
          class: "line_h",
          top: "22.5",
          left: "99.5",
          width: "0",
          height: "230",
          showArrow: false,
          arrow: { class: "", top: "20", left: "-6" },
          contect: "燒臘生產線到子設備",
        },
        {
          show: true,
          class: "line_w",
          top: "35.5",
          left: "97.5",
          width: "40",
          height: "0",
          showArrow: false,
          arrow: { class: "arrow left", top: "-6", left: "2" },
          contect: "燒臘生產線 => 1PJ糕餅調理室",
        },
      ],
    };
  },

  computed: {},
  watch: {},

  mounted() {
    this.$set(this.WebSetup, "caption", "電力系統 - 製程動力");
    this.MenuSetup.opened = false;
    this.VarMenuIsOverlay = false;
    // this.deviceKey = new URLSearchParams(window.location.search).get("options");
    // this.fromPage = new URLSearchParams(window.location.search).get("from_page");
    this.loadPageData();
    this.sysNowTime();
  },
  methods: {
    sysNowTime () {
      let that = this;
      setInterval(function () {
        that.loadPageData();
      }, 60000);
    },
    loadPageData() {
      _.each(this.billboard, (item, key) => {
        _.each(item['data'], (data, data_key) => {
          data['DBvalue'] = 0
        })
      })
      var tempData = [];
      this.get_options_id(tempData, this.deviceKey, this.data_group);
      var params = {
        Action: "LoadPageData",
        Datas: { id_list: _.join(tempData) },
        menu_page: "system_power",
      };
      this.FnWebAPIGet(params)
        .then((res) => {
          var resData = res.data.data;
          var groupByIdData = _.groupBy(resData , 'ID')
          //  基本內容塞值
          _.each(this.billboard , (item , key) => {
            if (!_.isNil(groupByIdData[key])) {
              _.each(item['data'] , (data ,data_key) => {
                //  今日用電
                if ( data_key == "item01" && data['isDBValue']  ){
                  data['DBvalue'] = this.FnRoundToDecimal(!_.isNil(groupByIdData[key][0]['today_kwh']) ? groupByIdData[key][0]['today_kwh'] : 0, 2) 
                }
                //  本月用電
                if ( data_key == "item02" && data['isDBValue'] ){
                  data['DBvalue'] = this.FnRoundToDecimal(!_.isNil(groupByIdData[key][0]['month_kwh']) ? groupByIdData[key][0]['month_kwh'] : 0, 2) 
                }
                //  即時功率
                if ( data_key == "item03" && data['isDBValue'] ){
                  data['DBvalue'] = this.FnRoundToDecimal(!_.isNil(groupByIdData[key][0]['now_max_kw']) ? groupByIdData[key][0]['now_max_kw'] : 0, 2)  
                }
              })
            } else {
              //  客製內容
              _.each(item['data'], (data , data_key) => {
                //  中式生產線
                if ( key == "item02" && data['isDBValue'] ) {
                  _.each(this.treeMap('電力', '中式生產線') , (id) => {
                    if (data_key == "item01" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['today_kwh']) ? groupByIdData[id['value']][0]['today_kwh'] : 0 , 2) 
                    }
                    if (data_key == "item02" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['month_kwh']) ? groupByIdData[id['value']][0]['month_kwh'] : 0 , 2) 
                    } 
                    if (data_key == "item03" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['now_max_kw']) ? groupByIdData[id['value']][0]['now_max_kw'] : 0 , 2)  
                    } 
                  }) 
                }
                //  西式生產線
                if ( key == "item10" && data['isDBValue'] ) {
                  _.each(this.treeMap('電力', '西式生產線') , (id) => {
                    if (data_key == "item01" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['today_kwh']) ? groupByIdData[id['value']][0]['today_kwh'] : 0 , 2) 
                    }
                    if (data_key == "item02" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['month_kwh']) ? groupByIdData[id['value']][0]['month_kwh'] : 0 , 2) 
                    } 
                    if (data_key == "item03" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['now_max_kw']) ? groupByIdData[id['value']][0]['now_max_kw'] : 0 , 2)  
                    } 
                  }) 
                }
                //  糕餅生產線
                if ( key == "item15" && data['isDBValue'] ) {
                  _.each(this.treeMap('電力', '糕餅生產線') , (id) => {
                    if (data_key == "item01" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['today_kwh']) ? groupByIdData[id['value']][0]['today_kwh'] : 0 , 2) 
                    }
                    if (data_key == "item02" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['month_kwh']) ? groupByIdData[id['value']][0]['month_kwh'] : 0 , 2) 
                    } 
                    if (data_key == "item03" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['now_max_kw']) ? groupByIdData[id['value']][0]['now_max_kw'] : 0 , 2)  
                    } 
                  }) 
                }
                //  包裝生產線
                if ( key == "item20" && data['isDBValue'] ) {
                  _.each(this.treeMap('電力', '包裝生產線') , (id) => {
                    if (data_key == "item01" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['today_kwh']) ? groupByIdData[id['value']][0]['today_kwh'] : 0 , 2) 
                    }
                    if (data_key == "item02" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['month_kwh']) ? groupByIdData[id['value']][0]['month_kwh'] : 0 , 2) 
                    } 
                    if (data_key == "item03" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['now_max_kw']) ? groupByIdData[id['value']][0]['now_max_kw'] : 0 , 2)  
                    } 
                  }) 
                }
                //  燒臘生產線
                if ( key == "item24" && data['isDBValue'] ) {
                  _.each(this.treeMap('電力', '燒臘生產線') , (id) => {
                    if (data_key == "item01" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['today_kwh']) ? groupByIdData[id['value']][0]['today_kwh'] : 0 , 2) 
                    }
                    if (data_key == "item02" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['month_kwh']) ? groupByIdData[id['value']][0]['month_kwh'] : 0 , 2) 
                    } 
                    if (data_key == "item03" && data['isDBValue'] && !_.isNil(groupByIdData[id['value']]) ) {
                      data['DBvalue'] += this.FnRoundToDecimal(!_.isNil(groupByIdData[id['value']][0]['now_max_kw']) ? groupByIdData[id['value']][0]['now_max_kw'] : 0 , 2)  
                    } 
                  }) 
                }
              })
            }
          })
          //  客製內容
          //  製程動力加總
          this.billboard['item01']['data']['item01']['DBvalue'] = this.FnRoundToDecimal(this.billboard['item02']['data']['item01']['DBvalue'] + this.billboard['item10']['data']['item01']['DBvalue'] + this.billboard['item15']['data']['item01']['DBvalue'] + this.billboard['item20']['data']['item01']['DBvalue'] + this.billboard['item24']['data']['item01']['DBvalue'], 2)
          this.billboard['item01']['data']['item02']['DBvalue'] = this.FnRoundToDecimal(this.billboard['item02']['data']['item02']['DBvalue'] + this.billboard['item10']['data']['item02']['DBvalue'] + this.billboard['item15']['data']['item02']['DBvalue'] + this.billboard['item20']['data']['item02']['DBvalue'] + this.billboard['item24']['data']['item02']['DBvalue'], 2)
          this.billboard['item01']['data']['item03']['DBvalue'] = this.FnRoundToDecimal(this.billboard['item02']['data']['item03']['DBvalue'] + this.billboard['item10']['data']['item03']['DBvalue'] + this.billboard['item15']['data']['item03']['DBvalue'] + this.billboard['item20']['data']['item03']['DBvalue'] + this.billboard['item24']['data']['item03']['DBvalue'], 2)
          //  數據格式化
          _.each(this.billboard , (detail) => {
            _.each(detail['data'] , (item)=> {
              item['DBvalue'] = this.FnFormatNumber(item['DBvalue'], 1 )
            })
          })
        })
        .catch((err) => {
          console.log(err);
        });
    },
    //樹狀陣列平扁化
    get_options_id(array, key, group) {
      var that = this;
      device_item[group][key]["options"].forEach((el) => {
        if (!isNaN(Number(el.value, 10))) {
          array.push(el.value);
        }
        if (device_item.hasOwnProperty(el.label)) {
          return that.get_options_id(array, el.label, group);
        }
      });
    },
    //  樹狀爸爸
    treeMap (item_type, keyWord) {
      return _.map(device_item[item_type][keyWord]['options'] , (item ) => {
        return {  "value" : item['value'] } 
      })
    }

  },
};
