<template>
  <div>
    <el-tooltip
      v-for="item in msg"
      :key="item.name"
      :content="item.name"
      placement="bottom"
      effect="light"
    >
      <span v-if="item.disabled">
        <i
          v-if="$showBtn(item.id)"
          :id="item.id"
          :class="item.type"
          class="margin-right-5 icons iconfont"
           :style="objStyle"></i>
      </span>
      <span v-else>
        <i
          v-if="$showBtn(item.id)"
          :id="item.id"
          :class="item.type"
          class="margin-right-5 icons iconfont"
          @click="_iconClick(item.name,item.componentName)"></i>
      </span>
    </el-tooltip>
  </div>
</template>
<script>
export default {
  // props: {
  //   msg: null,  //任何类型
  //   id: null,
  //   rowData: null
  // },
  props: ['msg', 'id', 'rowData', 'rowIndex'],
  data() {
    return {
      objStyle: {
        color: '#999',
        cursor: 'not-allowed'
      }
    }
  },
  methods: {
    // 操作按钮点击事件
    _iconClick(name, componentName) {
      this.$emit(
        'on-result-change',
        name,
        this.rowData,
        this.rowIndex,
        componentName
      )
    }
  }
}
</script>
<style scoped>
.margin-right-5 {
  margin-right: 5px;
}
</style>
