BUG 20240827 5
This commit is contained in:
@@ -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() {
|
||||
this.getOptions().then(() => {
|
||||
setTimeout(() => {
|
||||
const {dayjs} = window
|
||||
const hourNum = new Date().getHours(), groupCodeList = ""
|
||||
const hourNum = new Date().getHours(), groupCodeList = "", interval = 60000
|
||||
const currentDate = dayjs().format("YYYYMMDD")
|
||||
this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate}
|
||||
this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate})
|
||||
this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate, interval}
|
||||
this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate, interval})
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
@@ -69,10 +80,13 @@ export default {
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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-select>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -63,8 +63,12 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
search: {
|
||||
immediate: true, deep: true, handler() {
|
||||
this.getData()
|
||||
immediate: true, deep: true, handler(v) {
|
||||
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 {groupCodeList, type, compareDate} = 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 = []) => {
|
||||
this.stores = codes?.map(storeCode => {
|
||||
@@ -171,7 +175,7 @@ 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="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">
|
||||
<div class="layout">
|
||||
<div class="store" v-for="store in group" :key="store.storeCode">
|
||||
|
||||
Reference in New Issue
Block a user