<template>
  <div class="app-container">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>应急预案预览</span>
        <el-button style="float: right; padding: 3px 0" type="text" @click="goBack">返回</el-button>
      </div>
      <div style="height: calc(100vh - 200px);">
        <iframe
          :src="planUrl"
          style="width: 100%; height: 100%; border: none;"
          frameborder="0"
        ></iframe>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "EmergencyPreview",
  data() {
    return {
      planUrl: ''
    };
  },
  created() {
    this.planUrl = this.$route.query.planUrl || '';
    if (!this.planUrl) {
      this.$modal.msgError("预案地址不能为空");
      this.goBack();
    }
  },
  methods: {
    /** 返回 */
    goBack() {
      this.$router.go(-1);
    }
  }
};
</script>

<style scoped>
.box-card {
  height: calc(100vh - 100px);
}
</style>
