|
@@ -35,8 +35,8 @@
|
|
|
</el-slider>
|
|
|
<div class="tanniu">
|
|
|
<div><el-image :src="t1" fit="contain" @click="Prev"></el-image></div>
|
|
|
- <div v-show="suspendshow"><el-image :src="t2" fit="contain" @click="play(500)"></el-image></div>
|
|
|
- <div v-show="playshow"><el-image :src="t3" fit="contain" @click="play(500)"></el-image></div>
|
|
|
+ <!-- <div v-show="suspendshow"><el-image :src="t2" fit="contain" @click="play(500)"></el-image></div>
|
|
|
+ <div v-show="playshow"><el-image :src="t3" fit="contain" @click="play(500)"></el-image></div> -->
|
|
|
<div><el-image :src="t4" fit="contain" @click="increment"></el-image></div>
|
|
|
|
|
|
</div>
|
|
@@ -155,6 +155,10 @@ let initFlag=false;
|
|
|
let aid = ref()
|
|
|
let vtkObj = {}
|
|
|
let max, min;
|
|
|
+
|
|
|
+// 定义一个全局 loading 变量(只创建一个)
|
|
|
+let scalarLoadingInstance = null;
|
|
|
+
|
|
|
watch(
|
|
|
() => [formInline.value.region, count.value, aid.value],
|
|
|
(newVal, oldVal) => {
|
|
@@ -165,7 +169,7 @@ watch(
|
|
|
console.log("步数改变", newVal[1], oldVal[1]);
|
|
|
if (vtkObj.fcon) {
|
|
|
console.log(count.value);
|
|
|
- vtkScalarRead(count.value); //步数
|
|
|
+ vtkScalarRead(count.value, true); //步数
|
|
|
}
|
|
|
}
|
|
|
if (newVal[0] != oldVal[0]) {
|
|
@@ -488,10 +492,15 @@ function vtkGridRead() {
|
|
|
})
|
|
|
}
|
|
|
function vtkScalarRead(step, isshowloading = false) {
|
|
|
- let loadingInstance = null;
|
|
|
+ // 如果已有 loading,则先关闭
|
|
|
+ if (scalarLoadingInstance) {
|
|
|
+ scalarLoadingInstance.close();
|
|
|
+ scalarLoadingInstance = null;
|
|
|
+ }
|
|
|
+
|
|
|
if (isshowloading) {
|
|
|
// 创建 loading 实例,绑定到 expleft1 容器
|
|
|
- loadingInstance = ElLoading.service({
|
|
|
+ scalarLoadingInstance = ElLoading.service({
|
|
|
target: '#expleft1',
|
|
|
lock: true,
|
|
|
text: '加载中...',
|
|
@@ -526,7 +535,8 @@ function vtkScalarRead(step, isshowloading = false) {
|
|
|
})
|
|
|
.finally(() => {
|
|
|
if (isshowloading) {
|
|
|
- loadingInstance.close(); // 无论成功失败都关闭 loading
|
|
|
+ scalarLoadingInstance?.close(); // 无论成功失败都关闭 loading
|
|
|
+ scalarLoadingInstance = null; // 清除全局 loading 变量
|
|
|
}
|
|
|
});
|
|
|
}
|