<template>
  <a href="javascript:void(0);" class="a-link" @click="openHistoryDialog">
    <el-tooltip
      :enterable="false"
      effect="dark"
      :content="$t1('查看历史版本')"
      placement="top"
      popper-class="tooltip-skin"
    >
      <i class="el-icon-set-up">
        <ftHistoryDialog
          v-if="historyDialogVisible"
          :visiable.sync="historyDialogVisible"
          :objType="objType"
          :objCode="objCode"
          :relationCode="relationCode"
          @reverCallback="reverCallback"
        />
      </i>
    </el-tooltip>
  </a>
</template>
<script>
export default {
  name: "historyLink",
  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>
