|
@@ -72,7 +72,7 @@ import zhCn from "element-plus/es/locale/lang/zh-cn"
|
|
import { ref, onMounted, reactive } from "vue"
|
|
import { ref, onMounted, reactive } from "vue"
|
|
import { RouterView, RouterLink } from "vue-router"
|
|
import { RouterView, RouterLink } from "vue-router"
|
|
import { request, uploadFile } from "@/utils/request"
|
|
import { request, uploadFile } from "@/utils/request"
|
|
-import { ElMessage, ElButton, ElDialog, ElSelect } from "element-plus"
|
|
|
|
|
|
+import { ElMessage, ElButton, ElDialog, ElSelect, ElLoading } from "element-plus"
|
|
import { createGassControl } from "@/control/gassControl.js"
|
|
import { createGassControl } from "@/control/gassControl.js"
|
|
import emitter from "@/utils/emitter"
|
|
import emitter from "@/utils/emitter"
|
|
|
|
|
|
@@ -451,6 +451,14 @@ function sliderchange(val) {
|
|
fcon.step = count.value
|
|
fcon.step = count.value
|
|
}
|
|
}
|
|
function vtkGridRead() {
|
|
function vtkGridRead() {
|
|
|
|
+ // 创建 loading 实例,绑定到 expleft3 容器
|
|
|
|
+ const loadingInstance = ElLoading.service({
|
|
|
|
+ target: '#expleft1',
|
|
|
|
+ lock: true,
|
|
|
|
+ text: '加载中...',
|
|
|
|
+ background: 'transparent',
|
|
|
|
+ });
|
|
|
|
+
|
|
initVtk();
|
|
initVtk();
|
|
const fcon = vtkObj.fcon
|
|
const fcon = vtkObj.fcon
|
|
aid.value = props.aid
|
|
aid.value = props.aid
|
|
@@ -465,13 +473,31 @@ function vtkGridRead() {
|
|
fcon
|
|
fcon
|
|
.initGemetry(aid.value)
|
|
.initGemetry(aid.value)
|
|
.then((result) => {
|
|
.then((result) => {
|
|
- vtkScalarRead(count.value) //步数
|
|
|
|
|
|
+ vtkScalarRead(count.value, true) //步数
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error('initGemetry 错误:', err);
|
|
})
|
|
})
|
|
- .catch((err) => { })
|
|
|
|
|
|
+ .finally(() => {
|
|
|
|
+ loadingInstance.close(); // 无论成功失败都关闭 loading
|
|
|
|
+ });
|
|
|
|
|
|
- }).catch((err) => { })
|
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
+ console.error('请求错误:', err);
|
|
|
|
+ loadingInstance.close();
|
|
|
|
+ })
|
|
}
|
|
}
|
|
-function vtkScalarRead(step) {
|
|
|
|
|
|
+function vtkScalarRead(step, isshowloading = false) {
|
|
|
|
+ let loadingInstance = null;
|
|
|
|
+ if (isshowloading) {
|
|
|
|
+ // 创建 loading 实例,绑定到 expleft1 容器
|
|
|
|
+ loadingInstance = ElLoading.service({
|
|
|
|
+ target: '#expleft1',
|
|
|
|
+ lock: true,
|
|
|
|
+ text: '加载中...',
|
|
|
|
+ background: 'transparent',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
arr=[];
|
|
arr=[];
|
|
let i=0;
|
|
let i=0;
|
|
const fcon = vtkObj.fcon
|
|
const fcon = vtkObj.fcon
|
|
@@ -498,6 +524,11 @@ function vtkScalarRead(step) {
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
console.log(err)
|
|
console.log(err)
|
|
})
|
|
})
|
|
|
|
+ .finally(() => {
|
|
|
|
+ if (isshowloading) {
|
|
|
|
+ loadingInstance.close(); // 无论成功失败都关闭 loading
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
//深度监视
|
|
//深度监视
|
|
const regionchange=(val)=>{
|
|
const regionchange=(val)=>{
|