/*
*  @description: 开标大厅普通查数据库版和redis版路由配置
  @Modifier: haoFx
  @routerPath:
  @date: 2020/4/2-16:48
  * */
export const bidOpeningRedisConfigMixin = {
  data() {
    return {
      // 进入解密页面路由
      decryptionPath: {
        packagePath: '', // 分包
        noPackagePath: '', // 不分包
        bidOpeningTodayPath: ''// 开标大厅菜单路由
      }
    }
  },
  watch: {
    $route() {
      // 区分是否是redis版本 配置进入分包不分包路由不同
      this.initBidOpeningRedisType()
    }
  },
  created() {
    // 区分是否是redis版本 配置进入分包不分包路由不同
    this.initBidOpeningRedisType()
  },
  methods: {
    // 区分是否是redis版本 配置进入分包不分包路由不同 是否redis版本 00是 01否
    initBidOpeningRedisType() {
      if (this.$route.meta.redisType) {
        sessionStorage.setItem('redisConfigType', this.$route.meta.redisType)
      }
      this.redisType = sessionStorage.getItem('redisConfigType')
      let routerPath = {}
      // redis版本路由
      if (this.redisType === '01') {
        routerPath = {
          packagePath: '/bidOpeningHall/packageBidOpeningDecryption',
          noPackagePath: '/bidOpeningHall/noPackageBidOpeningDecryption',
          bidOpeningTodayPath: '/bidOpeningHall/bidOpeningTodayList'
        }
      } else {
        routerPath = {
          packagePath: '/bidOpeningHallRedis/packageBidOpeningDecryptionRedis',
          noPackagePath: '/bidOpeningHallRedis/noPackageBidOpeningDecryptionRedis',
          bidOpeningTodayPath: '/bidOpeningHallRedis/bidOpeningTodayList'
        }
      }
      this.decryptionPath = routerPath
    }
  }
}
