<template>
  <assetsTypeOne :pageType="$route.query.pageType" :audit="$route.query.pageType == 'change' ? true : false" :isModdle="true" :id="$route.query.id" v-if="$route.query.type == 0" />
  <assetsTypeTwo :pageType="$route.query.pageType" :audit="$route.query.pageType == 'change' ? true : false" :isModdle="true" :id="$route.query.id" v-else-if="$route.query.type == 1" />
  <assetsTypeThree :pageType="$route.query.pageType" :audit="$route.query.pageType == 'change' ? true : false" :isModdle="true" :id="$route.query.id" v-else-if="$route.query.type == 2" />
  <assetsTypeFour :pageType="$route.query.pageType" :audit="$route.query.pageType == 'change' ? true : false" :isModdle="true" :id="$route.query.id" v-else-if="$route.query.type == 3" />
  <assetsTypeFive :pageType="$route.query.pageType" :audit="$route.query.pageType == 'change' ? true : false" :isModdle="true" :id="$route.query.id" v-else-if="$route.query.type == 4" />
</template>
<script>
// web资产
import assetsTypeOne from "@/views/components/myAssetsType/index.vue"
// 小程序资产
import assetsTypeTwo from "@/views/components/myAssetsType/index_v1.vue"
// 公众号资产
import assetsTypeThree from "@/views/components/myAssetsType/index_v2.vue"
// 电子邮件资产
import assetsTypeFour from "@/views/components/myAssetsType/index_v3.vue"
// 移动应用系统
import assetsTypeFive from "@/views/components/myAssetsType/index_v4.vue"
export default {
  name: "AssetsAuth",
  components:{
    assetsTypeOne,
    assetsTypeTwo,
    assetsTypeThree,
    assetsTypeFour,
    assetsTypeFive,
  },
  data() {
    return {
    }
  },
  beforeRouteEnter(to,from,next){
    to.meta.type = to.query.type
    if(to.meta.pageType == 'look') {
      to.meta.title = '查看资产'
    } else if(to.meta.pageType == 'change'){
      to.meta.title = '审批资产'
    }
    // if(to.meta.type == 0) {
    //   to.meta.activeMenu = "/assetRecord/myWebAssets"
    // } else if(to.meta.type == 1) {
    //   to.meta.activeMenu = "/assetRecord/myProgram"
    // } else if(to.meta.type == 2) {
    //   to.meta.activeMenu = "/assetRecord/myOfficialAccount"
    // } else if(to.meta.type == 3) {
    //   to.meta.activeMenu = "/assetRecord/myEmail"
    // } else if(to.meta.type == 4) {
    //   to.meta.activeMenu = "/assetRecord/myMobileApplication"
    // }
    next();
  },
}
</script>
