<template>
  <el-dialog
    :title="dialogTitle"
    :visible.sync="dialogVisible"
    width="80%"
    @close="reportClose"
  >
    <iframe :src="src" style="width: 100%; height: 70vh; border: none" />
  </el-dialog>
</template>

<script>
import Iframe from "./Iframe.vue";
export default {
  name: "ReportPrint",
  components: {
    Iframe,
  },
  props: {},
  data() {
    return {
      dialogVisible: false,
      dialogTitle: "",
      src: "",
    };
  },
  methods: {
    /** 打开弹窗 */
    open(printSrc, title) {
      this.dialogVisible = true;
      this.dialogTitle = title;
      this.src = printSrc;
    },
    reportClose() {
      this.$emit("refresh");
    },
  },
};
</script>
