vue에서 Dashboard를 누르면 다른 내용이 같은 표로 이동하는 실례

1. 점프 쓰기 클릭
페이지 내용 클릭: 우선 순위
우선 순위
페이지 내용: 상태 클릭
상태
echarts 기둥 모양 클릭

this.chartEvent.on('click',function (param) {
   that.$router.push({
     path: '/cases/case',
     query: { createdTime: param.name,type:"createdTime" }
   });
 })
2. 표 페이지 나누기 쓰기
주: 이 페이지 밑에 있는 상자도 상응하는 우선순위 선별 조건이 있기 때문에 두 겹으로 썼습니다.

getData: function(){
  // CaseSearch 
  eventBus.$on('ticketEntityId',function(val){
    tableCaseVue.ticketEntityId=val;
  })
  eventBus.$on('companyId',function(val){
    tableCaseVue.companyId=val;
  })
  eventBus.$on('priorityId',function(val){
    tableCaseVue.priorityId=val;
  })
  eventBus.$on('status',function(val){
    tableCaseVue.status=val;
  })
  eventBus.$on('ticketCategory',function(val){
    tableCaseVue.ticketCategory=val;
  })

  var pageTicketDate = {
    "pageNum": this.current,
    "pageSize": this.pageSize,
    "priorityId":tableCaseVue.priorityId,
    "status":tableCaseVue.status,
    "ticketEntityId":tableCaseVue.ticketEntityId,
    "companyId":tableCaseVue.companyId,
    "ticketCategory":tableCaseVue.ticketCategory
  };
  //  
  if((this.$route.query.type == 'priorityId')&&(pageTicketDate.priorityId=='')){
    pageTicketDate.priorityId=this.$route.query.priorityId;
  }

  //  
  if((this.$route.query.type == 'status')&&(pageTicketDate.status=='')){
    pageTicketDate.status=this.$route.query.status;
  }

  // 
  if (this.$route.query.type == 'createdTime') {
    pageTicketDate.createdTime = this.$route.query.createdTime;
  }

  // 
  if (this.$route.query.type == 'currentMonth') {
    pageTicketDate.currentMonth = this.$route.query.currentMonth;
  }

  if(pageTicketDate.ticketEntityId||pageTicketDate.companyId||pageTicketDate.priorityId||pageTicketDate.status||pageTicketDate.ticketCategory){
    pageTicketDate.ticketEntityId=tableCaseVue.ticketEntityId;
    pageTicketDate.companyId=tableCaseVue.companyId;
    pageTicketDate.priorityId=tableCaseVue.priorityId;
    pageTicketDate.status=tableCaseVue.status;
    pageTicketDate.ticketCategory=tableCaseVue.ticketCategory;
    pageTicketDate.createdTime='';
    pageTicketDate.currentMonth='';
  }

  this.$api.ticket.pageTicket(pageTicketDate)
  .then(res => {
    this.tableCaseDate = res.data.records;
    for(var i=0;i<this.tableCaseDate.length;i++){
      //  
      if(this.tableCaseDate[i].waitTime!=undefined){
        this.tableCaseDate[i].waitTime=this.tableCaseDate[i].waitTime+' ';
      }
      //  
      if(this.tableCaseDate[i].handleTime!=undefined){
        this.tableCaseDate[i].handleTime=this.tableCaseDate[i].handleTime+' ';
      }
      //  
      if(this.tableCaseDate[i].finishTime!=undefined){
        this.tableCaseDate[i].finishTime=this.tableCaseDate[i].finishTime;
      }else{
        this.tableCaseDate[i].finishTime='N/A';
      }
    }
    //  
    this.current = res.data.current;
    //  
    this.dataTotal = res.data.total;
  });
}
보충 지식: vue 클릭 세부 정보 페이지로 이동
1 상품 구성 요소 페이지 Goods Info.vue (이 구성 요소를 클릭하여 상세 페이지로 이동)

<template>
<div class="goods-info" @click="goGoodsPage()">
<div class="goods-image">
<img v-lazy="goodsImage">
</div>
<div class="goods-name">{{goodsName}}</div>
<div class="goods-price">¥{{ goodsPrice.toFixed(2) }}</div>
</div>
</template>

<script>
export default {
name: "goodsInfo",
//  
props: ["goodsImage", "goodsName", "goodsPrice", "goodsId"],
data() {
return {};
},
methods: {
goGoodsPage() {
//  Goods.vue ,name Goods.vue name 
this.$router.push({name:"goods",query:{goodsId:this.goodsId}})
}
}
};
</script>

<style lang="scss" scoped>
.goods-info {
padding-bottom: 0.2rem;
.goods-image {
text-align: center;
img{
width: 95%;vertical-align: middle;
}
}
.goods-name {
padding: 0 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.goods-price {
text-align: center;
color: #e5017d;
}
}
</style>
2 상품 상세 정보 페이지 Goods.vue(상품 구성 요소 수신 페이지 GoodsInfo.vue에서 전송된 goodsId)

<template>
 <div> </div>
</template>

<script>
import url from "@/urlApi.js";
export default {
 name: "goods",
 data() {
  return {
   goodsId: ""
  };
 },
 created () {
   //  GoodsInfo.vue goodsId
   this.goodsId = this.$route.query.goodsId
   console.log(this.goodsId)
   this.getGoodsInfo();
 },
 methods: {
  getGoodsInfo() {
   let that = this;
   this.$http
    .post(url.getDetailGoodsInfo,{goodsId: that.goodsId})
    .then(response => {
      // goodsId 
      console.log(response)
    })
    .catch(error => {

    });
  }
 }
};
</script>

<style lang="scss" scoped>
</style

상기 vue가 Dashboard를 누르면 서로 다른 내용이 같은 표로 넘어가는 실례는 바로 편집자가 여러분에게 공유한 모든 내용입니다. 참고도 해주시고 저희도 많이 사랑해 주세요.

좋은 웹페이지 즐겨찾기