BUG 20240827 5

This commit is contained in:
2024-08-28 01:24:31 +08:00
parent 08fc69dd60
commit 3fb3dc6ab9
2 changed files with 26 additions and 8 deletions

View File

@@ -25,14 +25,25 @@ export default {
}) })
}, },
}, },
watch: {
'form.interval'(v) {
this.$set(this.$multipleStoreBoard.search, 'interval', v)
},
'form.changeWay'(v) {
this.$set(this.$multipleStoreBoard.search, 'changeWay', v)
if (v == '0') {
this.form.interval = null
}
}
},
created() { created() {
this.getOptions().then(() => { this.getOptions().then(() => {
setTimeout(() => { setTimeout(() => {
const {dayjs} = window const {dayjs} = window
const hourNum = new Date().getHours(), groupCodeList = "" const hourNum = new Date().getHours(), groupCodeList = "", interval = 60000
const currentDate = dayjs().format("YYYYMMDD") const currentDate = dayjs().format("YYYYMMDD")
this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate} this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate, interval}
this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate}) this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate, interval})
}, 500) }, 500)
}) })
}, },
@@ -69,10 +80,13 @@ export default {
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="切换方式"> <el-form-item label="切换方式">
<el-select v-model="form.changeWay" clearable placeholder="全部" @change="v=>$multipleStoreBoard.search.changeWay=v"> <el-select v-model="form.changeWay" clearable placeholder="全部">
<el-option v-for="item in changeWayOps" :key="item.value" :label="item.label" :value="item.value"/> <el-option v-for="item in changeWayOps" :key="item.value" :label="item.label" :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="切换间隔" v-if="form.changeWay==1">
<el-input-number :controls="false" :min="0" v-model="form.interval" clearable placeholder="单位:毫秒"/>
</el-form-item>
</el-form> </el-form>
</template> </template>

View File

@@ -63,8 +63,12 @@ export default {
}, },
watch: { watch: {
search: { search: {
immediate: true, deep: true, handler() { immediate: true, deep: true, handler(v) {
this.getData() this.getData().then(() => {
if (v.interval > 0 && v.changeWay == '1') {
this.$refs.carousel?.$forceUpdate()
}
})
} }
} }
}, },
@@ -73,7 +77,7 @@ export default {
const {$http, $waitFor} = window const {$http, $waitFor} = window
const {groupCodeList, type, compareDate} = this.search const {groupCodeList, type, compareDate} = this.search
console.log("筛选条件:", this.search) console.log("筛选条件:", this.search)
$waitFor($http && (type != 3 || compareDate)).then(() => this.getStores()) return $waitFor($http && (type != 3 || compareDate)).then(() => this.getStores())
.then(codes => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]).then(() => codes)) .then(codes => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]).then(() => codes))
.then((codes = []) => { .then((codes = []) => {
this.stores = codes?.map(storeCode => { this.stores = codes?.map(storeCode => {
@@ -171,7 +175,7 @@ export default {
<template> <template>
<section class="AppStoresTable" @click="dialog=false"> <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="60000"> <el-carousel ref="carousel" indicator-position="outside" :height="height" :autoplay="search.changeWay==1" @change="v=>curI=(v||0)" :interval="search.interval">
<el-carousel-item v-for="(group,i) in storeList" :key="i"> <el-carousel-item v-for="(group,i) in storeList" :key="i">
<div class="layout"> <div class="layout">
<div class="store" v-for="store in group" :key="store.storeCode"> <div class="store" v-for="store in group" :key="store.storeCode">