<template>
  <el-button
    type="primary"
    plain
    class="button-sty"
    icon="el-icon-set-up"
    @click="openHistoryDialog"
  >
    {{ $t1("查看历史版本") }}
    <ftHistoryDialog
      v-if="historyDialogVisible"
      :visiable.sync="historyDialogVisible"
      :objType="objType"
      :objCode="objCode"
      :relationCode="relationCode"
      @reverCallback="reverCallback"
    />
  </el-button>
</template>
<script>
export default {
  name: "historyButton",
  props: {
    objType: {
      type: String,
      default: null,
    },
    objCode: {
      type: String,
      default: null,
    },
    relationCode: {
      type: String,
      default: null,
    },
  },
  components: {
    ftHistoryDialog: () =>
      import("@base/views/bd/setting/formVersion/ftHistoryDialog.vue"),
  },
  data() {
    return {
      historyDialogVisible: false,
    };
  },
  methods: {
    openHistoryDialog() {
      this.historyDialogVisible = true;
    },
    reverCallback() {
      this.$emit("reverCallback");
    },
  },
};
</script>
