Commit 39bd4f73 authored by 李苏's avatar 李苏 💬

模型溯源后隐藏不涉及模型后,可以再重置后再次隐藏

parent 3f8cf9e4
......@@ -2,7 +2,7 @@
* @Description:
* @Author: lisu lisu@gavelinfo.com
* @LastEditors: lisu lisu@gavelinfo.com
* @LastEditTime: 2024-10-31 17:18:17
* @LastEditTime: 2024-11-07 15:40:00
* @FilePath: /zghywpc-vue/src/views/yhlywsytst/yhlywsytst/index.vue
-->
<template>
......@@ -357,7 +357,7 @@
<el-button style="background-color: rgba(7,32,96,0.0);border: 1px solid #68D8FE; color: #68D8FE;"
size="mini" @click="sypc()" type="primary">排查</el-button>
<el-button style="background-color: rgba(7,32,96,0.0);border: 1px solid #68D8FE; color: #68D8FE;"
size="mini" @click="czmx()" type="primary">重置</el-button>
size="mini" @click="czmx()" type="primary">{{czmxzt=='A'?'重置':'隐藏'}} </el-button>
<el-button @click="savePdf()"
style="background-color: rgba(7,32,96,0.0);border: 1px solid #68D8FE; color: #68D8FE;" size="mini"
type="primary">日志</el-button>
......@@ -596,7 +596,9 @@
},
data() {
return {
/* 最近的排查信息*/
lastRes:{},
czmxzt:'A',
showLeft:false,
/* 材质辅助输入*/
cztypeConfig: {
......@@ -729,18 +731,36 @@
this.showDialog = true
},
czmx() {
this.viewer.scene.traverse((model) => {
if (model.isMesh) {
model.visible = true
}
});
if (this.allFlowObject.length) {
this.allFlowObject.forEach((item) => {
item.removeFromParent();
/* A 代表初始状态 和查询后状态*/
if(this.czmxzt=='A'){
this.viewer.scene.traverse((model) => {
if (model.isMesh) {
model.visible = true
}
});
this.allFlowObject = [];
if (this.allFlowObject.length) {
this.allFlowObject.forEach((item) => {
item.removeFromParent();
});
this.allFlowObject = [];
}
if(Object.keys(this.lastRes).length==0){
this.$warning('暂无最近的溯源数据')
}else{
this.czmxzt='B'
}
}else{
/* 如果是B的话代表 模型处理过,还原回去了*/
this.sypcMethods2(this.lastRes)
this.czmxzt='A'
}
},
/* xsqbmx相关设置废除*/
xsqbmx() {
......@@ -787,68 +807,49 @@
link.target = '_blank'; // 在新标签页中打开
link.click();
link.remove()
// const downloadLink = document.createElement('a');
// downloadLink.href = linkSource;
// downloadLink.target = '_blank'
// const fileName = '排除日志.pdf';
// downloadLink.download = fileName;
// downloadLink.click();
// downloadLink.remove()
} else {
this.$warning('请溯源后,再保存为排查日志')
}
},
sypcMethods2(res){
let sbxxList = res.data.records.kshSbInfos || []
const sbxxCodeList = sbxxList.map(item => item.sbxxCode)
this.viewer.scene.traverse((model) => {
if (model.isMesh) {
let isbh = false
sbxxCodeList.forEach(item => {
if (model.name.includes(item)) {
isbh = true
}
})
if (isbh) {
model.visible = true
} else {
if (model.name && model.name != '地面') {
model.visible = false
}
}
}
});
},
sypcMethods(res) {
// function byteStringToUint8Array(byteString) {
// const byteArray = new Uint8Array(byteString.length);
// for (let i = 0; i < byteString.length; i++) {
// byteArray[i] = byteString.charCodeAt(i);
// }
// return byteArray;
// }
// let byteArray =byteStringToUint8Array(res.data.records.pdfBytes)
// const blob = new Blob([byteArray], { type: 'application/pdf' });
// const url = URL.createObjectURL(blob);
// const a = document.createElement('a');
// a.href = url;
// a.download = 'document.pdf'; // 设置下载文件名
// // 触发下载
// document.body.appendChild(a);
// a.click();
// a.remove()
this.lastRes=res
this.pdfBytes = res.data.records.pdfBytes
let gnwz=res.data.records.gnwz
/* -
-*/
let sbxxList = res.data.records.kshSbInfos || []
let zbInfos = res.data.records.zbInfos || []
/* 进行标记设备*/
this.$success(`已标记${sbxxList.length}个设备`)
const sbxxCodeList = sbxxList.map(item => item.sbxxCode)
/* 匹配设备信息length==0 */
if (sbxxCodeList.length == 0) {
return
}
/* 解决 先缓存选中色,后渲染黄色,默认选中时颜色不对
bug: 1默认还原为原色
2.高亮为黄色触发默认选中(黄色存储在另一个队列)
3.默认选中会还原上一个颜色
4.还原为原色,触发选中。变为选中色,清除为原色,覆盖了亮色
*/
if (sbxxCodeList.length != 0) {
this.reMaterialQue.forEach(item => {
item.revert()
})
}
this.reMaterialQue.splice(0, this.reMaterialQue.length)
/* 分割,在渲染高亮清空选中的*/
this.viewer.scene.traverse((model) => {
if (model.isMesh) {
let isbh = false
......@@ -857,7 +858,6 @@
isbh = true
}
})
if (isbh) {
model.visible = true
let jzReMaterialQueItem = {
......@@ -876,7 +876,6 @@
})
} else {
/* 隐藏其他设备*/
if (model.name && model.name != '地面') {
model.visible = false
}
......@@ -971,6 +970,8 @@
this.loading = true
this.loadingText = '正在处理,请稍等。'
/* 展示重置模型*/
this.czmxzt='A'
/* 如果流动特性只能从高到底*/
if(this.sypcQueryParams.ldtx=='B'){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment