<template>
  <el-dialog
    :title="$t1('预览')"
    :append-to-body="true"
    :modal-append-to-body="falseValue"
    :close-on-click-modal="falseValue"
    :visible.sync="showDialog"
    :modal="falseValue"
    custom-class="dialog-style h5view-dialog"
    width="500px"
    top="0px"
    v-el-drag-dialog
    v-el-dialog-center
    :fullscreen="false"
  >
    <div class="cont" style="height: calc(100vh - 73px);">
      <render ref="render" :isPreview="true"></render>
    </div>
  </el-dialog>
</template>

<script>
import render from "./render";

export default {
  name: "previewDialog",
  components: {render},
  created() {

  },
  mounted() {

  },
  data() {
    return {
      showDialog: false,
      falseValue: false
    };
  },
  methods: {
    init(row) {
      if (!row.data) {
        return
      }
      this.showDialog = true;
      this.$nextTick(() => {
        let json = JSON.parse(row.data);
        this.$refs.render.init({
          code: row.code,
          billSetting: row,
          wfEnabled: true
        }, true);
      })
    }
  }
}
</script>

<style scoped>

</style>
