<template>
  <div>
    <el-tooltip
      v-for="item in msg"
      :key="item.name"
      :content="item.name"
      placement="bottom"
      effect="light"
    >
      <span >
        <i
          v-if="item.disabled"
          :id="item.id"
          :class="item.type"
          class="margin-right-5 iconfont"
          style="color:#999;cursor:not-allowed;"
        />
        <i
          v-else
          :id="item.id"
          :class="item.type"
          class="margin-right-5 iconfont icons"
          :style="{'color':optColor}"
          @click="_iconClick(item.name,item.componentName)"
        />
      </span>
    </el-tooltip>
  </div>
</template>
<script>
export default {
  props: ['msg', 'id', 'rowData', 'rowIndex'],
  data() {
    return {}
  },
  computed: {
    // 操作列的颜色跟随主题变化（默认是蓝色主题）
    optColor() {
      return this.$store.state.themeColor
    }
  },
  methods: {
    // 操作按钮点击事件
    _iconClick(name, componentName) {
      this.$emit(
        'on-result-change',
        name,
        this.rowData,
        componentName,
        this.rowIndex
      )
    }
  }
}
</script>
