<template>
  <div class="compareWindow">
    <div class="left window">
      <compare-item v-if="articleOriginal.showType!=='pdf'" :id="'detailLeft'" :article="articleOriginal"
                    :compareWindowFlag="compareWindowFlag"/>
      <readPdf v-if="articleOriginal.showType==='pdf'" :article="articleOriginal"/>
    </div>

    <div class="right window" v-if="articleCompare">
      <compare-item v-if="articleCompare.showType!=='pdf'" :id="'detailRight'" :article="articleCompare"
                    :compareWindowFlag="compareWindowFlag"/>
      <readPdf v-if="articleCompare.showType==='pdf'" :article="articleCompare"/>
    </div>

  </div>
</template>

<script>
  export default {
    name: "compareWindow",
    props: {
      articleCompare: Object,
      compareWindowFlag: Boolean
    },
    components: {
      compareItem: () => import('./compareItem'),
      readPdf: () => import('./readPdf')
    },
    data() {
      return {
        articleOriginal: {
          id: this.$route.query.id,
          docSType: this.$route.query.docSType,
          name: this.$route.query.title,
          showType: this.$route.query.fileType,
          url: this.$route.query.pdfSrc
        },
        htmlContentOriginal: undefined,
        htmlContentCompare: undefined,
        catalogueOriginalFlag: false,
        catalogueCompareFlag: false,
        noteFlag: false,
        catalogueOriginal: undefined,
        catalogueCompare: undefined,
        noteOriginal: [],
        noteCompare: []
      }
    },
    watch: {
      '$route.query'(c, o) {
        this.articleOriginal = {
          id: c.id,
          docSType: c.docSType,
          name: c.title
        }
      }
    },
    methods: {},
    mounted() {
      debugger
    }
  }
</script>

<style lang="scss" scoped>
  .compareWindow {
    & > .window {
      background-color: #FFFFFF;
      height: calc(100vh - 30px);
      width: 49.7%;
      margin-top: -40px;
      overflow-x: hidden;
      overflow-y: auto;
    }

    & > .left {
      float: left;
    }

    & > .right {
      float: right;
    }
  }
</style>
