<template>
  <div class="c_box">
    <div class="choice_box" v-if="checkJson">
      <div class="title" style="display: flex;">
        <span style="min-width: fit-content;">{{ tindex + 1 + '、' }}</span>
        <span>{{ checkJson.title }}</span>
      </div>
      <div
        class="detail"
        v-if="checkJson.detail"
        v-html="checkJson.detail"
        style="color: #00000099;margin-top: 5px;"
      ></div>

      <div style="margin-top: 10px;">
        <el-date-picker
          :readonly="checktype == 2"
          v-model="checkJson.answer2"
          type="date"
					:editable="false"
          format="yyyy 年 MM 月 dd 日"
          value-format="yyyy年MM月dd日"
          placeholder="年/月/日"
        >
        </el-date-picker>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    tindex: {
      type: Number
    },
    cJson: {
      type: Object
    },
    checktype: {
      type: Number,
      default: 1
    },
    see: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      option: {
        1: { name: '附件' }
      },
      userid: this.$route.query.userid,
      checkJson: undefined,
      progress: 0,
      yy: '',
      isFinishSize: 0,
      proVisible: false,
      isAllSize: 0,
      wurl: '',
      isTong: false
    }
  },
  watch: {
    checkJson: {
      handler(newValue) {
        this.$emit('update:cJson', newValue)
      },
      deep: true
    }
  },
  methods: {
    depthCopy(s) {
      let t = JSON.parse(JSON.stringify(s))
      if (!t.answer2.length) {
        t.answer2 = ''
      }
      return t
    }
  },
  mounted() {
    console.log('this.checkJson', this.cJson)
    // console.log('this.checkJson', this.cJson == true)
    // return
    this.checkJson = this.cJson ? this.depthCopy(this.cJson) : undefined
  }
}
</script>

<style scoped>
.c_box {
  width: 100%;
  position: relative;
  overflow: unset;
}

/* .mask {
    position: absolute;
    height: 100%;
    width: 100%;
    z-index: 2;
} */

.choice_box {
  white-space: pre-line;
}

.choice_box > .title {
  font-weight: bold;
  width: 100%;
  word-break: break-all;
  font-size: 16px;
}
</style>
