This commit is contained in:
Iruka 2025-02-20 17:46:20 +08:00
parent e791a00f58
commit b867eb5cf3

View File

@ -158,7 +158,8 @@
:show-arrow="false" v-for="(item, index) in dc.wo" :open="woloaded && woloaded[index].open" :show-arrow="false" v-for="(item, index) in dc.wo" :open="woloaded && woloaded[index].open"
v-show="(dc.forward && item.isOpened) || (!dc.forward && !item.isHidden)"> v-show="(dc.forward && item.isOpened) || (!dc.forward && !item.isHidden)">
<template v-slot:title> <template v-slot:title>
<view class="sf-title fixed" @click.stop="handleCollapseClick(index)"> <view class="sf-title fixed" @click.stop="handleCollapseClick($event, index)"
:ref="`item${index}`">
<view class="iconfont icon-diefa icon"></view> <view class="iconfont icon-diefa icon"></view>
<view class="text" style="min-width: 25px;"> <view class="text" style="min-width: 25px;">
{{ item.showName || item.branchCanalCode }} {{ item.showName || item.branchCanalCode }}
@ -398,10 +399,13 @@
v-if="dc.dataObj[child.dataKey].btnObj.open2.work"> v-if="dc.dataObj[child.dataKey].btnObj.open2.work">
<span <span
v-if="dc.countdownObj[`${child.dataKey}_open2`]"> v-if="dc.countdownObj[`${child.dataKey}_open2`]">
({{ dc.countdownObj[`${child.dataKey}_open2`] }}) ({{
dc.countdownObj[`${child.dataKey}_open2`]
}})
</span> </span>
<span v-else class="timeout"> <span v-else class="timeout">
{{ dc.timeoutObj[`${child.dataKey}_open2`] }} {{ dc.timeoutObj[`${child.dataKey}_open2`]
}}
</span> </span>
</span> </span>
<span class="name" <span class="name"
@ -445,10 +449,13 @@
v-if="dc.dataObj[child.dataKey].btnObj.open4.work"> v-if="dc.dataObj[child.dataKey].btnObj.open4.work">
<span <span
v-if="dc.countdownObj[`${child.dataKey}_open4`]"> v-if="dc.countdownObj[`${child.dataKey}_open4`]">
({{ dc.countdownObj[`${child.dataKey}_open4`] }}) ({{
dc.countdownObj[`${child.dataKey}_open4`]
}})
</span> </span>
<span v-else class="timeout"> <span v-else class="timeout">
{{ dc.timeoutObj[`${child.dataKey}_open4`] }} {{ dc.timeoutObj[`${child.dataKey}_open4`]
}}
</span> </span>
</span> </span>
<span class="name" <span class="name"
@ -762,13 +769,13 @@
getApp().mqttSubscribes(e); getApp().mqttSubscribes(e);
}, },
// //
handleCollapseClick(index) { handleCollapseClick(e, index) {
if (!this.woloaded) { if (!this.woloaded) {
let woloaded = {}; let woloaded = {};
this.dc.wo.forEach((_item, _index) => { this.dc.wo.forEach((_item, _index) => {
let time = 10; let time = 20;
if (_item.children && _item.children.length) { if (_item.children && _item.children.length) {
time = _item.children.length * 10 time = _item.children.length * 20
} }
woloaded[_index] = { woloaded[_index] = {
loaded: false, loaded: false,
@ -791,13 +798,18 @@
this.woloaded[index].loaded = true; this.woloaded[index].loaded = true;
} }
this.woloaded[index].open = true; this.woloaded[index].open = true;
this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
this.$refs.collapseRef.resize(); this.$refs.collapseRef.resize();
this.$nextTick(() => {
uni.hideLoading(); uni.hideLoading();
this.scrollToCollapseItem(index); uni.pageScrollTo({
}, this.woloaded[index].time) scrollTop: e.touches[0].pageY - 150,
duration: 50 //
}); });
});
// this.scrollToCollapseItem(index);
}, this.woloaded[index].time)
}, },
// //
scrollToCollapseItem(index) { scrollToCollapseItem(index) {