<template>
  <div class="layout-container">
    <RcpRightPanel :agentId="agentId" />
    <SelectGBCrossStage :agentid="agentId"></SelectGBCrossStage>
  </div>
</template>
<script>
import {
  setToken
} from '../utils/auth'
import RcpRightPanel from '../kisscomps/components/RcpRightPanel/index.vue'
import SelectGBCrossStage from '../kisscomps/components/SelectGBCrossStage/index.vue'
export default {
  name: 'demo',
  data () {
    return {
      agentId: '16005',
      reqUrl: 'http://192.168.13.103:10003/openatc',
      Token: 'eyJraWQiOiIxNzU5OTk2MDExMTg5IiwidHlwIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTg5MDU3NjAwMCwiaWF0IjoxNzU5MjQ0NDAwfQ.N0igTWJwfGZYzZJX91V1pevh5Xi7-itNgobQcD7vv_k'
    }
  },
  components: {
    RcpRightPanel,
    SelectGBCrossStage
  },
  methods: {
    getTscControl (res) {
      console.log('getTscControl:', res)
    },
    setPropsToken (token) {
      // 获取组件外传入的token，便于独立组件调用接口
      if (token && token !== '') {
        setToken(token)
      }
    },
    handleClickCrossIcon (allChoosedDir, curClickedPhase) {
      console.log('handleClickCrossIcon', allChoosedDir, curClickedPhase)
    }
  },
  created () {
    this.setPropsToken(this.Token)
    this.setDialogWidth()
  },
  mounted () {
    // let _this = this
    // setTimeout(function () {
    //   alert('Hello')
    //   _this.agentId = 'scats1'
    // }, 5 * 1000)
    window.onresize = () => {
      return (() => {
        this.setDialogWidth()
      })()
    }
  },
  destroyed () {
  }
}
</script>
<style lang='scss'>
.layout-container {
  width: 800PX;
}
.layout-container {
  width: 942PX;
  height: 976PX;
  border: 1PX solid green;
}
</style>
<style lang="scss" scoped>
  .text {
    color: #fff;
  }
</style>
