<template>
  <div class="page-main">
    <!-- <el-button @click="changePage">切换</el-button> -->
    <iframe-page v-if="showIframe" :path="path" />
  </div>
</template>

<script>
import IframePage from "@/components/IframePage";
export default {
  components: { IframePage },
  data() {
    return {
      path: "main",
      basePath: ISMSAdminWeb.path,
      showIframe: true,
    };
  },
  watch: {
    "$route.query.path": {
      handler(newVal, oldVal) {
        this.showIframe = false;
        if (!newVal) {
          // this.path = ISMSAdminWeb.path + "main";
          this.path = this.basePath + "video/cameraConfig";
        } else {
          // this.path = ISMSAdminWeb.path + newVal;
          this.path = this.basePath + newVal;
        }
        this.$nextTick(() => {
          this.showIframe = true;
        });
      },
      deep: true,
      immediate: true,
    },
  },
  methods: {
    // http://localhost:9901/#/page1?path=http://localhost:9528/#/main
    // http://localhost:9901/#/page1?path=http://localhost:9528/#/system/menu
    changePage() {
      this.path = ISMSAdminWeb.path + "system/menu";
    },
  },
};
</script>

<style lang="less" scoped>
.page-main {
  width: 100%;
  height: 100%;
  padding: 100px 30px 0;
  color: #fff;
  font-size: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  // background: #001012;
  // background: ;
  pointer-events: auto;
  // position: absolute;
  // z-index: 3000; // loading层是2000 设置高一些，下拉菜单会盖住loading层
}
</style>
