var page_function = {
  components: {
    "soft-item" : httpVueLoader.load("./components/soft_item.vue")
  },
  data: () => {
    return {
      // =========================================== 即時資訊 =================================================
      "VarMenuPage": "system_power_surface",
      "VarMenu": "area",
      "VarPageContainerCss": "",

      DisplayMeter: "",
      MeterOptions: [],
      MeterNames: {},
      FloorNames: {},
      SoftItems: [],

      meterSelected: 'ACM17',

			pageSoftTag: {
			},
			meterOptions: [],

    }
  },
  created() { },
  computed: { },
  watch: {

  },

  async mounted () {
    this.$set(this.WebSetup, "caption", '電力電錶');
    this.MenuSetup.opened = false;
    this.VarMenuIsOverlay = true;

    // this.loadOptions();
		// this.loadSession();

  },

  methods: {
		// 頁面初始完成
		fnInitial(cfg) {
			// console.log(cfg);
			this.IsSoftStartup = true;

			_.each(cfg.meter, (v, k) => {
				let words = v.Name.split("_");
				if (!this.pageSoftTag[words[0]]) {
					this.pageSoftTag[words[0]] = [];
				}
				this.pageSoftTag[words[0]].push(v);
			})
		},
		// Soft通訊數值異動
		fnSoftPointUpdate(rtn) {
			// console.log(rtn);
		},
		loadSession() {
			let temp = sessionStorage.getItem("meter");
			if (temp) {
				this.meterSelected = temp;
				setTimeout(function () {
					sessionStorage.removeItem("meter");
				}, 1000);
			}
		},
		loadOptions() {
			let that = this;
			var params = {
				Action: "LoadOptions",
				Datas: {
				},
			};
			return that.FnWebAPIGet(params).then((res) => {
				if (res.data.result) {
					var resData = res.data.data;
					this.meterOptions = resData;
				} else {
					that.FnNotify("錯誤", "error");
				}
			});
		}

  }
}