<template>
  <div>
    <el-popover
      word-wrap
      trigger="click"
      placement="bottom-start"
      :title="titleStr"
      width="70"
      @show="routeToRule"
    >
      <el-button
        slot="reference"
        type="text"
      >点击查看详情</el-button>
      <div v-if="flag" style="color:#333;padding:5px;text-align:center">未知</div>

    </el-popover>
  </div>
</template>

<script>
export default {
  name: 'RuleAssociate',
  components: {},
  props: {
    ruleId: {
      type: String,
      default: function() {
        return ''
      }
    },
    alertSource: {
      type: String,
      default: function() {
        return ''
      }
    }
  },
  data() {
    return {
      titleStr: null,
      flag: false
    }
  },
  computed: {},
  watch: {},
  mounted() { },
  methods: {
    routeToRule() {
      if (this.ruleId != 'null' && this.ruleId != '-1') {
        this.$router.push({ name: 'alarmStrategyInfo', params: { oper: 'detail', id: this.ruleId }})
      } else {
        this.flag = true
      }
    }
  }
}
</script>
