export const TabInCurrentMixin = {
  props: {
    isSysRouteTabRoot: Boolean
  },
  methods: {
    addFormInCurrentTab(options, refreshParentFunc) {
      if (this.isSysRouteTabRoot) {
        this.$refs.formInCurrent.addForm(options, refreshParentFunc)
      } else {
        this.$emit("addFormInCurrentTab", options, refreshParentFunc)
      }
    },
    editFormInCurrentTab(options, refreshParentFunc) {
      if (this.isSysRouteTabRoot) {
        this.$refs.formInCurrent.editForm(options, refreshParentFunc)
      } else {
        this.$emit("editFormInCurrentTab", options, refreshParentFunc)
      }
    },
    detailFormInCurrentTab(options, refreshParentFunc) {
      if (this.isSysRouteTabRoot) {
        this.$refs.formInCurrent.detailForm(options, refreshParentFunc)
      } else {
        this.$emit("detailFormInCurrentTab", options, refreshParentFunc)
      }
    }
  }
}
