<template>
  <Dialog
    title="问题详情"
    :visible="dialogVisible"
    width="8rem"
    @change-visible="changeVisible"
    :destroy-on-close="true"
  >
    <div class="scores">
      <div class="score-title">
        <div class="title">问题信息</div>
        <div
          class="got-score"
          :style="{ color: data.question_status == 1 ? '#DF3333' : '#30B34F' }"
        >
          {{ data.question_status_str }}
        </div>
      </div>
      <div class="score-detail">
        <div class="w-100">工程名称：{{ data.project_name }}</div>
        <div class="w-100">所在地址：{{ data.address }}</div>
        <div class="w-100">
          负责人：{{ data.person_name }} / {{ data.person_mobile }}
        </div>
        <div class="w-100">标段名称：{{ data.lot_project_name }}</div>
        <div class="w-100">所属机构：{{ data.c_company_name }}</div>
        <div class="w-100">所属单位：{{ data.units_company_name }}</div>
        <div class="w-100">问题分类：{{ data.category_name }}</div>
        <div class="w-100">问题等级：{{ data.question_level_str }}</div>
        <div class="w-100">问题种类：{{ data.question_type_str }}</div>
        <div class="w-100">处理状态：{{ data.question_status_str }}</div>
        <div class="w-100">法规依据：{{ data.legal_basis }}</div>
        <div class="w-100">系统问题描述：{{ data.system_question }}</div>
        <div class="w-100">用户问题描述：{{ data.user_question }}</div>
      </div>
    </div>
  </Dialog>
</template>
  <script>
import { getZFJGQuestionDetail } from "@/api/dataStatis";
export default {
  name: "QuestionDetail",
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    questionId: {
      type: [String, Number],
      default: "",
    },
  },
  data() {
    return {
      data: {},
    };
  },
  computed: {
    dialogVisible: {
      get() {
        return this.visible;
      },
      set(val) {
        this.$emit("change-visible", val);
      },
    },
  },
  methods: {
    changeVisible(val) {
      this.dialogVisible = val;
    },
    getData() {
      getZFJGQuestionDetail(this.questionId).then((res) => {
        this.data = res.data;
      });
    },
  },
  mounted() {},
  watch: {
    visible(val) {
      if (val) {
        this.getData();
      }
    },
  },
};
</script>
  <style lang="less" scoped>
.project-name {
  line-height: 50px;
  padding: 0 10px;
  background: #12407f;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #60fff6;
  font-size: 14px;
  .count {
    font-size: 20px;
    font-weight: bold;
    vertical-align: top;
  }
  img {
    width: 20px;
    vertical-align: top;
    margin: 15px 10px;
  }
}
.scores {
  margin-bottom: 10px;
}
.score-title {
  background: #16488b;
  padding: 0 24px;
  line-height: 40px;
  display: flex;
  justify-content: space-between;
  .title {
    font-size: 14px;
    color: #60fff6;
    font-weight: bold;
    position: relative;
    &::before {
      position: absolute;
      content: "";
      width: 3px;
      height: 16px;
      background: #60fff6;
      left: -12px;
      top: 50%;
      transform: translateY(-50%);
    }
  }
  .got-score {
    color: #d9d9d9;
    font-size: 14px;
  }
}
.score-detail {
  background: #0c3163;
  border: 1px solid #1f4c89;
  border-top: 0;
  padding: 12px 20px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.w-100 {
  width: 100%;
  text-align: left;
  color: #d9d9d9;
  font-size: 14px;
  line-height: 28px;
}
::v-deep .el-dialog .el-dialog__body {
  min-height: 400px !important;
  height: inherit !important;
}
</style>