<template>
  <el-dialog center="" title="详情" :visible.sync="dialogVisible" width="60%">
    <div class="detail-info">
      <el-descriptions border :column="1">
        <el-descriptions-item label="预警类型">
          {{ detailInfo.$warnType }}
        </el-descriptions-item>
        <el-descriptions-item label="预警对象">
          {{ detailInfo.targetInfo }}
        </el-descriptions-item>
        <el-descriptions-item label="预警信息">
          {{ detailInfo.message }}
        </el-descriptions-item>
      </el-descriptions>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { supervisionWarnReadApi } from "@/api/riskEventWarningSettings.js";
export default {
  data() {
    return {
      dialogVisible: false,
      detailInfo: {}
    };
  },
  methods: {
    detail(row) {
      this.detailInfo = row;
      if (!row.read) {
        this.supervisionWarnRead();
      }

      this.dialogVisible = true;
    },
    async supervisionWarnRead() {
      let obj = {
        warnId: this.detailInfo.warnId
      };
      await supervisionWarnReadApi(obj);
    }
  }
};
</script>

<style lang="scss" scoped></style>
