export const splitScreen = {
    data() {
        return {
            radio:1,
            height:null,
            height2:null,
            positionList:[
                {
                    label:'tab展示',
                    value:1
                },
                {
                    label:'上边展示',
                    value:2
                },
                {
                    label:'下边展示',
                    value:3
                },
                {
                    label:'左边展示',
                    value:4
                },
                {
                    label:'右边展示',
                    value:5
                },
            ],
            activeMenu2:'',
        }
    },
    watch:{
        activeMenu2(){
            this.radio = 1
            this.changePosition(this.radio)
          },
    },
    mounted() {
        this.$nextTick(()=>{
            this.$set(this,'height',document.getElementsByClassName('el-main')[0].offsetHeight-200 + 'px')
            this.height2 = this.height
         })
    },
    methods: {
        ending(val){
            this.activeMenu2 = val
            return false
          },
        //修改附图展示方式
    changePosition(val){
        var dom = document.getElementsByClassName('dom')
        var height = document.getElementsByClassName('patent-articles-content-left')[0].offsetHeight+20
        // console.log(height)
        var left1 = document.getElementsByClassName('left1')
        var mid1 = document.getElementsByClassName('mid1')
        switch(val){
          case 1://tab展示
            dom[0].style.flexDirection = ''
            this.height = document.getElementsByClassName('el-main')[0].offsetHeight-200 + 'px'
            this.$nextTick(()=>{
              left1[0].style.width = '100%'
            })
            break;
          case 2://上边展示
            dom[0].style.flexDirection = 'column-reverse'
            this.height = (height - 300) + 'px'
            this.$nextTick(()=>{
              mid1[0].style.width = '100%'
              left1[0].style.width = '100%'
            })
            break;
          case 3://下边展示
            dom[0].style.flexDirection = 'column'
            this.height = (height - 400) + 'px'
            this.$nextTick(()=>{
              mid1[0].style.width = '100%'
              left1[0].style.width = '100%'
            })
            break;
          case 4://左边展示
            dom[0].style.flexDirection = 'row-reverse'
            this.height = (height) + 'px'
            break;
          case 5://右边展示
            dom[0].style.flexDirection = 'row'
            this.height = (height) + 'px'
            break;    
        }
      },
    },
}
export const splitScreen1 = {
    data() {
        return {
            radio:1,
            height:null,
            height2:null,
            positionList:[
                {
                    label:'tab展示',
                    value:1
                },
                {
                    label:'上边展示',
                    value:2
                },
                {
                    label:'下边展示',
                    value:3
                },
                {
                    label:'左边展示',
                    value:4
                },
                {
                    label:'右边展示',
                    value:5
                },
            ],
            activeMenu2:'',
        }
    },
    watch:{
        activeMenu2(){
            this.radio = 1
            this.changePosition(this.radio)
          },
    },
    mounted() {
      this.$nextTick(() => {
          if (document.getElementsByClassName('patent-articles-content-left').length>0) {
             this.$set(this,'height',document.getElementsByClassName('el-main')[0].offsetHeight-200 + 'px')
          }
            if(this.height == '20px'){
                this.$set(this,'height',document.getElementsByClassName('el-main')[0].offsetHeight-200 + 'px')
                this.height2 = this.height
            }
         })
    },
    methods: {
        ending(val){
            this.activeMenu2 = val
            return false
          },
        //修改附图展示方式
        changePosition(val){
            var dom = document.getElementsByClassName('dom1')
            var height = document.getElementsByClassName('patent-articles-content-left1')[0].offsetHeight + 20
            // var left1 = document.getElementsByClassName('left1')
            // var mid1 = document.getElementsByClassName('mid1')
            // console.log(left1)
            switch(val){
              case 1://tab展示
                dom[0].style.flexDirection = ''
                this.height = document.getElementsByClassName('el-main')[0].offsetHeight-200 + 'px'
                // this.$nextTick(()=>{
                //   left1[0].style.width = '100%'
                // })
                break;
              case 2://上边展示
                dom[0].style.flexDirection = 'column-reverse'
                this.height = (height - 300) + 'px'
                // this.$nextTick(()=>{
                //   mid1[0].style.width = '100%'
                //   left1[0].style.width = '100%'
                // })
                break;
              case 3://下边展示
                dom[0].style.flexDirection = 'column'
                this.height = (height - 400) + 'px'
                // this.$nextTick(()=>{
                //   mid1[0].style.width = '100%'
                //   left1[0].style.width = '100%'
                // })
                break;
              case 4://左边展示
                dom[0].style.flexDirection = 'row-reverse'
                this.height = (height) + 'px'
                break;
              case 5://右边展示
                dom[0].style.flexDirection = 'row'
                this.height = (height) + 'px'
                break;    
            }
          },
    },
}