<template>
  <div class="top-right-btn">
    <el-row>
      <el-tooltip class="item" effect="dark" :content="!isFullscreen ? '放大':'缩小'" placement="top" v-if="isShowScreenfull">
        <el-button size="mini" circle :icon="!isFullscreen ? 'el-icon-zoom-in':'el-icon-zoom-out'" @click="clickfull()" />
      </el-tooltip>
      <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top" v-if="isshowSearch">
        <el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="刷新" placement="top">
        <el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
      </el-tooltip>
    </el-row>
  </div>
</template>
<script>
export default {
  name: "RightToolbar",
  data() {
    return {
      isFullscreen: false
    };
  },
  props: {
    isshowSearch: {
      type: Boolean,
      default: true,
    },
    showSearch: {
      type: Boolean,
      default: true,
    },
    isShowScreenfull: {  //是否显示放大按钮
      type: Boolean,
      default: false
    }
  },

  methods: {
    //放大元素
    clickfull() {
      this.isFullscreen = !this.isFullscreen
      this.$emit("fullClick", this.isFullscreen)
    },
    //搜索
    toggleSearch() {
      this.$emit("update:showSearch", !this.showSearch);
    },
    //刷新
    refresh() {
      this.$emit("queryTable");
    },
  },
};
</script>
