<script setup lang="ts">
import HeaderPart from "@/views/customize/components/HeaderPart.vue";
import { useRoute } from "vue-router";
import { getImageUrl } from "@/utils";

// const { b: babyId, i: id, p: isParent, o: isMyRoute } = useRoute().query;
const { p: isParent, o: isMyRoute } = useRoute().query;
function send() {
  // if (singleRecord.value.sendReport) return;
  // if (typeof babyId === "string" && typeof id === "string")
  //   sendSingleRecord({
  //     babyId,
  //     id,
  //     recordType: "1",
  //   });
}

function changeJoinState() {
  // if (singleRecord.value.joinSemester === 1) {
  //   showConfirm.value = true;
  // } else {
  //   joinSemesterReport(singleRecord.value.recordId, 1);
  // }
}

function getTargetStyle(index: number) {
  const style = {
    borderRadius: "0 0 9px 9px",
  };
  if (index === 3) {
    style.borderRadius = "0 0 9px 9px";
  } else {
    style.borderRadius = "0";
  }
  return style;
}

/**
 * 问题记录单次报告
 *
 * http://192.168.1.17:8989/#/customize/ProblemRecord
 */
</script>

<template>
  <div class="problem-record pr">
    <HeaderPart :isParent="isParent" :isMyRoute="isMyRoute" @send="send" @change="changeJoinState" />

    <div class="pr-top">
      <img :src="getImageUrl('problem_title')" alt="" class="pr-top-title" />
      <img :src="getImageUrl('problem_logo')" alt="" class="pr-top-logo" />
    </div>

    <div class="pr-info grid_bgi">
      <div class="pr-info-line">
        <div class="label">
          <div class="label_triangle"></div>
          <div class="label-text">记录教师：</div>
        </div>
        <div class="value">刘老师</div>
      </div>
      <div class="pr-info-line">
        <div class="label">
          <div class="label_triangle"></div>
          <div class="label-text">加入综合报告：</div>
        </div>
        <div class="value">已加入</div>
      </div>
    </div>

    <!--高阶思维评估-->
    <div class="pr-evaluate">
      <img :src="getImageUrl('evaluate_logo')" alt="" class="pr-evaluate-logo" />
      <div v-for="index in 3" :key="index">
        <div class="pr-evaluate-target" :style="getTargetStyle(index)">
          <div class="object">
            <div class="label_triangle"></div>
            <div class="object-label">记录对象：</div>
            <div class="object-text">尚萍萍</div>
          </div>
          <div class="target">
            <div class="target-title">
              <div class="target-title-dot"></div>
              <div class="target-title-text">元认知（3-4岁目标）</div>
            </div>
            <div class="target-content">在成人引导下，能够有意识关注其他学生的作品，讨论喜欢或不喜欢什么。</div>
          </div>
          <div class="target">
            <div class="target-title">
              <div class="target-title-dot"></div>
              <div class="target-title-text">问题解决能力（4-5岁目标）</div>
            </div>
            <div class="target-content">在成人引导下，能够有意识关注其他学生的作品，讨论喜欢或不喜欢什么。</div>
          </div>
        </div>
        <div
          v-if="index !== 3"
          class="pr-evaluate-gap"
          :style="{ backgroundImage: `url(${getImageUrl('evaluate_gap')})` }"
        ></div>
      </div>
    </div>

    <div class="pr-content">
      <div class="pr-content-line">
        <div class="label_triangle"></div>
        <div class="label">记录日期：</div>
        <div class="value">2023-03-23</div>
      </div>
      <div class="pr-content-line">
        <div class="label_triangle"></div>
        <div class="label">层次：</div>
        <div class="value">记忆</div>
      </div>
      <div class="pr-content-line">
        <div class="label_triangle"></div>
        <div class="label">活动形式：</div>
        <div class="value">集体、小组、区角</div>
      </div>
      <img :src="getImageUrl('content_question_logo')" alt="" class="pr-content-logo" />
      <div class="pr-content-question">
        <div class="title flex-center">问题1</div>
        <div class="content">评估了观察、好奇和探索、模仿力与创造力等9个能力，其中3个是新晋观察技能</div>
      </div>
      <img :src="getImageUrl('inquiry_process_logo')" alt="" class="pr-content-logo" />
      <div class="pr-content-process">
        <div class="process">
          <div class="process-title">
            <div class="process-title-dot"></div>
            <div class="process-title-text">观察</div>
          </div>
          <div class="process-content">家长可以和幼儿一起发现生活中有简单模式的</div>
        </div>
      </div>
      <div class="pr-content-images"></div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.pr {
  overflow: hidden;

  &-top {
    position: relative;
    z-index: 2;
    height: 110px;

    &-title {
      position: absolute;
      top: 27px;
      left: 17px;
      width: 200px;
      height: 54px;
    }

    &-logo {
      position: absolute;
      right: -58px;
      top: -8px;
      width: 229px;
      height: 157px;
    }
  }

  &-info {
    padding: 20px 12px;
    margin: 0 auto 32px;
    width: 343px;
    box-shadow: 0 1px 6px 0 rgba(42, 105, 253, 0.16);
    border-radius: 17px 17px 17px 17px;
    border: 4px solid #b6dcff;

    &-line {
      display: flex;
      //align-items: center;

      .label {
        display: flex;
        align-items: center;
        height: 20px;

        &-triangle {
          //margin-top: 4px;
          margin-right: 8px;
          width: 0;
          height: 0;
          border-left: 8px solid #2a69fd;
          border-top: 5px solid transparent;
          border-bottom: 5px solid transparent;
          border-radius: 2px;
        }

        &-text {
          line-height: 20px;
          height: 20px;
          color: #2a69fd;
          font-weight: 600;
          font-size: 14px;
          white-space: nowrap;
        }
      }

      .value {
        flex: 1;
        color: #333;
        font-weight: 500;
        font-size: 14px;
      }
    }

    &-line + &-line {
      margin-top: 16px;
    }
  }

  &-evaluate {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    margin: 0 auto 32px;
    width: 343px;
    background: #ffffff;
    box-shadow: 0 1px 6px 0 rgba(42, 105, 253, 0.16);
    border: 4px solid #b6dcff;
    border-radius: 17px;

    &-logo {
      width: 311px;
      height: 68px;
    }

    &-target {
      padding: 16px 0;
      width: 311px;
      background: #ecf9ff;
      border-radius: 0 0 9px 9px;

      .object {
        display: flex;
        align-items: center;
        margin-left: 16px;

        &-label {
          margin-right: 4px;
          height: 20px;
          font-size: 14px;
          font-family: PingFang SC;
          font-weight: 500;
          color: #2a69fd;
          line-height: 20px;
        }

        &-text {
          font-size: 14px;
          font-family:
            PingFang SC,
            PingFang SC;
          font-weight: 400;
          color: #1a2c5e;
        }
      }

      .target {
        margin-top: 20px;

        &-title {
          display: flex;
          align-items: center;
          margin-left: 16px;
          margin-bottom: 8px;

          &-dot {
            margin-right: 8px;
            width: 6px;
            height: 6px;
            background: #2a69fd;
            border-radius: 50%;
          }

          &-text {
            font-size: 14px;
            font-family:
              PingFang SC,
              PingFang SC;
            font-weight: 600;
            color: #1a2c5e;
          }
        }

        &-content {
          margin-left: 30px;
          width: 265px;
          font-size: 14px;
          font-family:
            PingFang SC,
            PingFang SC;
          font-weight: 400;
          color: #1a2c5e;
        }
      }
    }

    &-gap {
      width: 311px;
      height: 24px;
      background-color: #ecf9ff;
      background-repeat: no-repeat;
      background-size: 100% 100%;
    }
  }

  &-content {
    padding: 24px 16px;
    margin: 0 auto 32px;
    width: 343px;
    background: #ffffff;
    box-shadow: 0 1px 6px 0 rgba(42, 105, 253, 0.16);
    border: 4px solid #b6dcff;
    border-radius: 17px;

    &-line {
      display: flex;
      align-items: center;

      .label {
        font-size: 14px;
        font-family:
          PingFang SC,
          PingFang SC;
        font-weight: 500;
        color: #2a69fd;
      }

      .value {
        font-size: 14px;
        font-family:
          PingFang SC,
          PingFang SC;
        font-weight: 400;
        color: #333333;
      }
    }

    &-line + &-line {
      margin-top: 16px;
    }

    &-logo {
      margin: 20px auto 0;
      width: 311px;
      height: 68px;
    }

    &-question {
      padding: 14px 15px;
      margin: 0 auto;
      //width: 311px;
      background: #fff8f3;
      border-radius: 0 0 9px 9px;
      box-sizing: border-box;

      .title {
        padding: 2px 10px;
        margin-bottom: 8px;
        width: fit-content;
        background: #f08931;
        border-radius: 59px 59px 59px 59px;
        font-size: 12px;
        font-family:
          PingFang SC,
          PingFang SC;
        font-weight: 400;
        color: #ffffff;
      }

      .content {
        width: 279px;
        height: 40px;
        font-size: 14px;
        font-family:
          PingFang SC,
          PingFang SC;
        font-weight: 400;
        color: #1a2c5e;
        line-height: 20px;
      }
    }

    &-process {
      background: #fff5f6;
      border-radius: 0 0 10px 10px;

      .process {
        padding: 16px 0 24px;
        &-title {
          display: flex;
          align-items: center;
          margin-left: 16px;
          margin-bottom: 8px;

          &-dot {
            margin-right: 8px;
            width: 6px;
            height: 6px;
            background: #e42f37;
            border-radius: 50%;
          }

          &-text {
            font-size: 14px;
            font-family:
              PingFang SC,
              PingFang SC;
            font-weight: 600;
            color: #1a2c5e;
            line-height: 20px;
          }
        }

        &-content {
          margin-left: 30px;
          width: 265px;
          font-size: 14px;
          font-family:
            PingFang SC,
            PingFang SC;
          font-weight: 400;
          color: #1a2c5e;
        }
      }

      .process + .process {
        margin-top: 27px;
      }
    }
  }
}
</style>
