|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div v-show="isexpdialog" class="dialog_class4 bgcolor tianjia foter_l tianjia">
|
|
|
<div class="expcontent">
|
|
|
- <h1 class="headertiele">一维瓦斯爆炸演化</h1>
|
|
|
+ <h1 class="headertiele">{{ titleName }}</h1>
|
|
|
<div class="exp">
|
|
|
<div class="expleft" id="expleft1"></div>
|
|
|
<div class="expright">
|
|
@@ -74,6 +74,8 @@ import { RouterView, RouterLink } from "vue-router"
|
|
|
import { request, uploadFile } from "@/utils/request"
|
|
|
import { ElMessage, ElButton, ElDialog, ElSelect } from "element-plus"
|
|
|
import { createGassControl } from "@/control/gassControl.js"
|
|
|
+import emitter from "@/utils/emitter"
|
|
|
+
|
|
|
import t1 from "@/assets/img/t1.png"
|
|
|
import t2 from "@/assets/img/t2.png"
|
|
|
import t3 from "@/assets/img/t3.png"
|
|
@@ -100,8 +102,27 @@ const strResultFormatlist = ref([])
|
|
|
const formInline = ref({
|
|
|
user: "11",
|
|
|
region: "Pressure",
|
|
|
+ name: "压力",
|
|
|
date: ""
|
|
|
})
|
|
|
+
|
|
|
+const titleName = ref("一维瓦斯爆炸演化")
|
|
|
+
|
|
|
+const nameMap = {
|
|
|
+ Pressure: '压力',
|
|
|
+ Temperatura: '温度',
|
|
|
+ Velocity: '速度',
|
|
|
+ O2: '氧气质量分数',
|
|
|
+ CO2: '二氧化碳质量分数',
|
|
|
+ H2O: '水蒸气质量分数',
|
|
|
+ // HC: '碳氢化合物',
|
|
|
+ // Soot: '烟尘',
|
|
|
+ // NOx: '氮氧化物',
|
|
|
+ // CO: '一氧化碳',
|
|
|
+ CH4: '甲烷质量分数',
|
|
|
+ N2: '氮气质量分数'
|
|
|
+};
|
|
|
+
|
|
|
let newMap = new Map([
|
|
|
["Temperature", "(℃)"],
|
|
|
["Pressure", "(Pa)"],
|
|
@@ -198,8 +219,18 @@ onMounted(() => {
|
|
|
light.setIntensity(3.0) // 强度为1.0
|
|
|
vtkObj.renderWindow.getRenderer().addLight(light)
|
|
|
|
|
|
+ emitter.on("pipeName", handleTitleName)
|
|
|
+})
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ emitter.off("pipeName", handleTitleName)
|
|
|
})
|
|
|
|
|
|
+function handleTitleName(name) {
|
|
|
+ console.log("接收到的管道名称:", name);
|
|
|
+ titleName.value = `${name}(灾源点巷道)局部图`;
|
|
|
+}
|
|
|
+
|
|
|
function initVtk() {
|
|
|
|
|
|
}
|
|
@@ -250,7 +281,8 @@ function vtkShow() {
|
|
|
mapper.setInputData(fcon.polydata)
|
|
|
getMinMax(scalarArray)
|
|
|
mapper.setScalarRange(parseFloat(min.toFixed(3)), parseFloat(max.toFixed(3))) //设置范围
|
|
|
- scalarBarActor.setAxisLabel(formInline.value.region)
|
|
|
+ // scalarBarActor.setAxisLabel(formInline.value.region)//英文
|
|
|
+ scalarBarActor.setAxisLabel(formInline.value.name)//用中文
|
|
|
|
|
|
mapper.clearColorArrays() //强制重建颜色
|
|
|
actor.getProperty().setOpacity(count.value) //设置错误的透明度使得页面重新加载 不设置不刷新页面
|
|
@@ -396,6 +428,7 @@ function vtkScalarRead(step) {
|
|
|
arr=[];
|
|
|
let i=0;
|
|
|
const fcon = vtkObj.fcon
|
|
|
+ console.log('fcon:',fcon);
|
|
|
fcon
|
|
|
.getScalrsByStep(step)
|
|
|
.then((result) => {
|
|
@@ -403,15 +436,16 @@ function vtkScalarRead(step) {
|
|
|
strResultFormatlist.value = [];
|
|
|
fcon.scalar.forEach((value, key) => {
|
|
|
//arr.push(key)
|
|
|
- i=i+1
|
|
|
- strResultFormatlist.value.push({
|
|
|
- id: i,
|
|
|
- name:key ,
|
|
|
- value:key ,
|
|
|
-
|
|
|
+ if (nameMap[key]) {
|
|
|
+ i=i+1
|
|
|
+ strResultFormatlist.value.push({
|
|
|
+ id: i,
|
|
|
+ name:nameMap[key] || key ,
|
|
|
+ value:key ,
|
|
|
});
|
|
|
+ }
|
|
|
})
|
|
|
- console.log(strResultFormatlist.value);
|
|
|
+ console.log('strResultFormatlist:',strResultFormatlist.value);
|
|
|
vtkShow()
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -421,6 +455,7 @@ function vtkScalarRead(step) {
|
|
|
//深度监视
|
|
|
const regionchange=(val)=>{
|
|
|
formInline.value.region=val;
|
|
|
+ formInline.value.name=nameMap[val] || val;
|
|
|
}
|
|
|
const quding=()=>{
|
|
|
isexpdialog.value=false;
|