<template>
  <risp-template :reportTitle="reportTitle" :baseInfo="baseInfo" class="timeline-risp-common-page">
    <template>
      <div class="diogose-con" v-if="curDiagnosis.length">
        <div class="pat-diagnosis-content">
          <div class="diagnosis-itme" v-for="(ele, index) in curDiagnosis" :key="index">
            <span class="diagnosis-title">{{ ele.title }}</span>
            <span class="diagnosis-value">
              <span v-if="index === 0">{{ ele.value || "无" }}</span>
              <template v-else>
                <span
                  v-for="(item,iIndex) of ele.value"
                  :key="iIndex"
                >{{item.bodys}} {{((iIndex + 1 ) >= ele.value.length) ? '' : ','}}</span>
              </template>
            </span>
          </div>
        </div>
      </div>
      <div class="">
        <div v-if="rispReport.type==='5' || rispReport.type==='6'">
          <rispTct v-if="rispReport.type==='5'"  :jsonData="rispReport.jsonData" :lensSeen="rispReport.lensSeen" />
          <LensSeen v-if="rispReport.type==='6'"  :lensSeen="rispReport.lensSeen"  />
        </div>
        <div class="item-con" v-else>
          <div class="val-title" v-if="!isFrozen">{{rispReport.type==='4'?'原医疗机构名称切片号':'肉眼所见'}}：</div>
          <div class="val-text" v-if="!isFrozen">
            <div class="sampling-Info">{{ generallySeen }}</div>
          </div>
        </div>
        <div class="item-con">
          <div class="val-title">病理诊断：</div>
          <div class="val-text">
            <div class="diagose-Info" v-for="(item, index) of verdict" :key="index">{{ item }}</div>
          </div>
        </div>
      </div>
    </template>
  </risp-template>
</template>

<script>
import RispTemplate from "../risp-template.vue";
import rispTct from "../rispTct/index.vue";
import LensSeen from "../rispTct/lensSeen.vue";
import commonMixin from './commonMixin'
export default {
  name: "risp-report-common",
  mixins:[commonMixin],
  components: {
    RispTemplate,
    rispTct,
    LensSeen
  },
  props: {
    curDiagnosis: {
      type: Array,
      default: () => []
    },
    generallySeen: {
      type: String,
      default: ""
    },
    verdict: {
      type:  Array,
      default: ()=>[],
    },
    rispData: Object,
    baseInfo: Array,
    rispReport: Object
  },
  computed: {
    ptitle() {
      if (this.rispReport.type === "5") {
        return "报告意见：";
      }
      if (this.rispReport.type === "6") {
        return "诊断意见：";
      }
      return "病理诊断：";
    },
  },

  // provide() {
  //   return {
  //     rispDatas: this.rispData,
  //     rispReports: this.rispReport,
  //   };
  // },
};
</script>

<style lang="less" scoped>
@import "./common.less";

.diogose-con {
  border-bottom: 1px solid #333;

  .diagnosis-itme {
    line-height: 30px;
    font-size: 14px;
    color: #000;
  }
}
.item-con {
    margin-top: 24px;
}

@media print {
  .diogose-con {
    .diagnosis-itme {
    line-height: 40px;
    font-size: 18px;
    color: #000;
      font-family: "SimSun";
  }
  }
}
</style>