页面驻留,状态保持

This commit is contained in:
aixianling
2024-09-02 09:38:32 +08:00
parent 3fb3dc6ab9
commit b7c422cc7b
2 changed files with 6 additions and 3 deletions

View File

@@ -68,6 +68,7 @@ Vue.prototype.$marketBoard = Vue.observable({
search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"}
})
Vue.prototype.$multipleStoreBoard = Vue.observable({
carouselIndex:0,
search: {"groupCodeList": [], "hourNum": "", type: "1"}
})
Vue.prototype.$storeBoard = Vue.observable({

View File

@@ -123,8 +123,9 @@ export default {
}
})
},
gotoDetail(store) {
gotoDetail(store, i) {
this.$storeBoard.search.storeCode = store.storeCode
this.$multipleStoreBoard.carouselIndex = i
this.$marketBoard.screenId = 'a90522ef-869b-40ea-8542-d1fc9674a1e8'
},
getTableData(item = {}, tag) {
@@ -175,11 +176,12 @@ export default {
<template>
<section class="AppStoresTable" @click="dialog=false">
<el-carousel ref="carousel" indicator-position="outside" :height="height" :autoplay="search.changeWay==1" @change="v=>curI=(v||0)" :interval="search.interval">
<el-carousel ref="carousel" indicator-position="outside" :height="height" :autoplay="search.changeWay==1" @change="v=>curI=(v||0)" :interval="search.interval"
:initial-index="$multipleStoreBoard.carouselIndex">
<el-carousel-item v-for="(group,i) in storeList" :key="i">
<div class="layout">
<div class="store" v-for="store in group" :key="store.storeCode">
<div class="headerTitle" v-text="store.storeName" @click="gotoDetail(store)"/>
<div class="headerTitle" v-text="store.storeName" @click="gotoDetail(store,i)"/>
<el-carousel indicator-position="none" height="250px" @change="v=>$set(curJ,store.storeCode,v||0)" :autoplay="false">
<el-carousel-item v-for="(url,j) in store.camera" :key="[i,j].join('_')">
<hls-player v-if="`${i}_${j}`==`${curI}_${curJ[store.storeCode]}`" :id="`hls_player_${store.storeCode}_${i}_${j}`" :url="url"/>