<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"><span>工程名称：</span><div>{{ data.project_name }}</div></div>
        <div class="w-100"><span>所在地址：</span><div>{{ data.address }}</div></div>
        <div class="w-100">
          <span>负责人：</span><div>{{ data.person_name }} / {{ data.person_mobile }}</div>
        </div> 
        <div class="w-100"><span>标段名称：</span><div>{{ data.lot_project_name }}</div></div>
        <div class="w-100"><span>所属机构：</span><div>{{ data.c_company_name }}</div></div>
        <div class="w-100"><span>所属单位：</span><div>{{ data.units_company_name }}</div></div>
        <div class="w-100"><span>问题分类：</span><div>{{ data.category_name }}</div></div>
        <div class="w-100"><span>问题等级：</span><div>{{ data.question_level_str }}</div></div>
        <div class="w-100"><span>问题种类：</span><div>{{ data.question_type_str }}</div></div>
        <div class="w-100"><span>处理状态：</span><div>{{ data.question_status_str }}</div></div>
        <div class="w-100"><span>法规依据：</span><div>{{ data.legal_basis }}</div></div>
        <div class="w-100"><span>系统问题描述：</span><div>{{ data.system_question }}</div></div>
        <div class="w-100"><span>用户问题描述：</span><div>{{ data.user_question }}</div></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;
  display: flex;
  span{
    color: #b2bfcf;
    white-space: nowrap;
  }
}
::v-deep .el-dialog .el-dialog__body {
  min-height: 400px !important;
  height: inherit !important;
}
</style>