最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue點擊Dashboard不同內容 跳轉到同一表格的實例

 更新時間:2020年11月13日 11:33:26   作者:Yilia-Feng  
這篇文章主要介紹了vue點擊Dashboard不同內容 跳轉到同一表格的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

1.點擊跳轉寫法

點擊頁面內容:優(yōu)先級

<router-link :to='{ path: "/cases/case",query: { priorityId: 0 ,type:"priorityId"}}' style="color: #515a6e;">優(yōu)先級</router-link>

點擊頁面內容:狀態(tài)

<router-link :to='{ path: "/cases/case",query: { status: 0 ,type:"status"}}' style="color: #515a6e;">狀態(tài)</router-link>

點擊echarts柱狀

this.chartEvent.on('click',function (param) {
   that.$router.push({
     path: '/cases/case',
     query: { createdTime: param.name,type:"createdTime" }
   });
 })

2.表格分頁寫法(不同跳轉 顯示不同傳參)

注:由于該頁面下拉框也有相應的優(yōu)先級篩選條件 所有寫了兩層if判斷了一下

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
  };
  // 優(yōu)先級
  if((this.$route.query.type == 'priorityId')&&(pageTicketDate.priorityId=='')){
    pageTicketDate.priorityId=this.$route.query.priorityId;
  }

  // 狀態(tài)
  if((this.$route.query.type == 'status')&&(pageTicketDate.status=='')){
    pageTicketDate.status=this.$route.query.status;
  }

  //創(chuàng)建時間
  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商品組件頁面GoodsInfo.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不同內容 跳轉到同一表格的實例就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關文章

  • el-form表單實現校驗的示例代碼

    el-form表單實現校驗的示例代碼

    本文主要介紹了el-form表單實現校驗的示例代碼,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2024-07-07
  • 使用Vue封裝一個可隨時暫停啟動無需擔心副作用的定時器

    使用Vue封裝一個可隨時暫停啟動無需擔心副作用的定時器

    這篇文章主要為大家詳細介紹了如何使用Vue封裝一個可隨時暫停啟動無需擔心副作用的定時器,感興趣的小伙伴可以跟隨小編一起學習一下
    2024-11-11
  • Vue3 setup語法糖銷毀一個或多個定時器(setTimeout/setInterval)

    Vue3 setup語法糖銷毀一個或多個定時器(setTimeout/setInterval)

    這篇文章主要給大家介紹了關于Vue3 setup語法糖銷毀一個或多個定時器(setTimeout/setInterval)的相關資料,vue是單頁面應用,路由切換后,定時器并不會自動關閉,需要手動清除,當頁面被銷毀時,清除定時器即可,需要的朋友可以參考下
    2023-10-10
  • Vue2.0系列之過濾器的使用

    Vue2.0系列之過濾器的使用

    這篇文章主要介紹了Vue2.0系列之過濾器的使用,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-03-03
  • vue實現echarts餅圖/柱狀圖點擊事件實例

    vue實現echarts餅圖/柱狀圖點擊事件實例

    echarts原生提供了相應的API,只需要在配置好echarts之后綁定相應的事件即可,下面這篇文章主要給大家介紹了關于vue實現echarts餅圖/柱狀圖點擊事件的相關資料,需要的朋友可以參考下
    2023-06-06
  • vuex 中插件的編寫案例解析

    vuex 中插件的編寫案例解析

    Vuex 的 store 接受 plugins 選項,這個選項暴露出每次 mutation 的鉤子。Vuex 插件就是一個函數,這篇文章主要介紹了vuex 中插件的編寫案例,本文通過實例代碼給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-06-06
  • vue中echarts點擊事件點擊一次多次觸發(fā)問題

    vue中echarts點擊事件點擊一次多次觸發(fā)問題

    這篇文章主要介紹了vue中echarts點擊事件點擊一次多次觸發(fā)問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-06-06
  • Vue實現簡單的拖拽效果

    Vue實現簡單的拖拽效果

    這篇文章主要為大家詳細介紹了Vue實現簡單的拖拽效果,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-08-08
  • Vue首評加載速度及白屏時間優(yōu)化詳解

    Vue首評加載速度及白屏時間優(yōu)化詳解

    這篇文章主要介紹了vue項目優(yōu)化首評加載速度,以及白屏時間過久的問題,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2022-09-09
  • vue 限制input只能輸入正數的操作

    vue 限制input只能輸入正數的操作

    這篇文章主要介紹了vue 限制input只能輸入正數的操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-08-08

最新評論

临汾市| 济源市| 古田县| 阿拉善左旗| 邛崃市| 水城县| 广元市| 蒲江县| 阳新县| 康平县| 酉阳| 丁青县| 合作市| 南宫市| 剑河县| 岗巴县| 昌图县| 思茅市| 郸城县| 页游| 连平县| 南京市| 剑川县| 乌兰浩特市| 多伦县| 长泰县| 江北区| 阿城市| 平阴县| 凤山县| 滦南县| 清河县| 德惠市| 东明县| 石泉县| 丹凤县| 台南市| 徐水县| 天气| 皋兰县| 广宗县|