更新一点点
This commit is contained in:
@@ -73,7 +73,7 @@ async function handleMounted() {
|
||||
demo = new ThreeDScene(three, content.value);
|
||||
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
|
||||
demo.isedit = params.isedit;
|
||||
demo.loadModel(GLTFLoader, "./assets/tunnelModel/chanel.gltf");
|
||||
let tunnelasync = await demo.loadModel(GLTFLoader, "./assets/tunnelModel/chanel.gltf");
|
||||
demo.addOrbitControls(OrbitControls);
|
||||
demo.addTween(TWEEN);
|
||||
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);
|
||||
@@ -87,13 +87,12 @@ async function handleMounted() {
|
||||
|
||||
// 初始化设备模型
|
||||
try {
|
||||
//在这加载隧道
|
||||
const map = new Map();
|
||||
map.set("equ_fan", await loadModel("/devicesModel/model2.obj"));
|
||||
map.set("equ_sensors", await loadModel("/devicesModel/sensors.obj"));
|
||||
|
||||
// 给对象初加载设备模型
|
||||
demo.initDevicesModel(map);
|
||||
await Promise.all([map.get("equ_fan"), map.get("equ_sensors")]);
|
||||
demo.tunnelModeInit();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
@@ -242,14 +241,16 @@ function previewEquInfProcess() {
|
||||
let tunnelThreeConfig = demo.ThreeConfig.data.tunnelThreeConfig
|
||||
for (const equipment of tunnelThreeConfig) {
|
||||
if (equipment.pointName == targetP.name) {
|
||||
console.log(equipmentType);
|
||||
console.log(equipmentName);
|
||||
console.log(equipmentValue);
|
||||
equipmentType.value = equipment.equipmentType
|
||||
equipmentName.value = equipment.equipmentName
|
||||
equipmentValue.value = equipment.equipmentValue
|
||||
console.log(equipmentType.value);
|
||||
console.log(equipmentName.value);
|
||||
console.log(equipmentValue.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// let equipmentType = reactive(previewEquInfProcess().equipmentType)
|
||||
|
||||
@@ -72,8 +72,7 @@ async function handleMounted() {
|
||||
demo = new ThreeDScene(three, content.value);
|
||||
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
|
||||
demo.isedit = params.isedit;
|
||||
|
||||
demo.loadModel(GLTFLoader, "./assets/tunnelModel/chanel.gltf");
|
||||
let tunnelasync = await demo.loadModel(GLTFLoader, "./assets/tunnelModel/chanel.gltf");
|
||||
demo.addOrbitControls(OrbitControls);
|
||||
demo.addTween(TWEEN);
|
||||
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);
|
||||
|
||||
@@ -9,18 +9,18 @@
|
||||
<div class="setting-item">
|
||||
<p>传感器类型</p>
|
||||
<el-select v-model="equipmentSetting.equipmentType" :fit-input-width="true" filterable clearable
|
||||
:placeholder="equipmentTypeInf.value" disabled>
|
||||
:placeholder="params.equipmentType" disabled>
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<p>设备选择</p>
|
||||
<el-select v-model="equipmentSetting.chooseEquipment" :fit-input-width="true" filterable clearable
|
||||
:placeholder="equipmentNameInf.value" disabled>
|
||||
:placeholder="params.equipmentValue" disabled>
|
||||
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<input-num name="阈值" :placeholder="equipmentValueInf.value" @inputValue="handelInput"
|
||||
<input-num name="阈值" :placeholder="params.equipmentValue" @inputValue="handelInput"
|
||||
:disabled="isDisabledInputNum" />
|
||||
</div>
|
||||
<div class="btn">
|
||||
@@ -50,18 +50,20 @@ const params = defineProps(["pointNum", "pointGap", "equipmentType", "equipmentN
|
||||
// 当前风压
|
||||
let p = ref(57);
|
||||
|
||||
function EquInf() {
|
||||
// 发射事件给tunnel父组件
|
||||
emit("EquInf");
|
||||
}
|
||||
// function EquInf() {
|
||||
// // 发射事件给tunnel父组件
|
||||
// emit("EquInf");
|
||||
// }
|
||||
|
||||
console.log(params.equipmentType);
|
||||
console.log(params.equipmentName);
|
||||
console.log(params.equipmentValue);
|
||||
// console.log(params.equipmentType);
|
||||
// console.log(params.equipmentName);
|
||||
// console.log(params.equipmentValue);
|
||||
|
||||
let equipmentTypeInf = ref(params.equipmentType)
|
||||
let equipmentNameInf = ref(params.equipmentName)
|
||||
let equipmentValueInf = ref(params.equipmentValue)
|
||||
|
||||
|
||||
// let equipmentTypeInf = ref(params.equipmentType)
|
||||
// let equipmentNameInf = ref(params.equipmentName)
|
||||
// let equipmentValueInf = ref(params.equipmentValue)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
import { saveState, resetState } from "./viewBack";
|
||||
import addFunction from "./addEvent";
|
||||
import { addEquipment, removeEquipment } from "./editEquipment";
|
||||
import tunnelModeInit from "./tunnelInit"
|
||||
import { Group } from "three/examples/jsm/libs/tween.module";
|
||||
export default class Demo {
|
||||
// 摄像机看向位置
|
||||
@@ -26,6 +27,7 @@ export default class Demo {
|
||||
this._resetState = resetState;
|
||||
this.addEquipment = addEquipment;
|
||||
this.removeEquipment = removeEquipment;
|
||||
this.tunnelModeInit = tunnelModeInit;
|
||||
|
||||
// 外部可添加函数
|
||||
this.addFunction = addFunction;
|
||||
@@ -509,28 +511,4 @@ export default class Demo {
|
||||
msg: "dda"
|
||||
}
|
||||
tunnelConfigEquipment = this.ThreeConfig.data.tunnelThreeConfig
|
||||
tunnelModeInit() {
|
||||
for (const item of this.tunnelConfigEquipment) {
|
||||
//使用api取拿到附着点
|
||||
let pointmodel = this.scene.getObjectByName(item.pointName)
|
||||
pointmodel.hasDevice;
|
||||
let formInfo = {
|
||||
equipmentType: item.equipmentType, //设备类型
|
||||
chooseEquipment: item.equipmentName, //设备选择(设备名称)
|
||||
threshold: item.equipmentValue, //阈值
|
||||
}
|
||||
this.addEquipment(pointmodel, formInfo);
|
||||
}
|
||||
//进行预览和编辑模式的一些操作
|
||||
if (this.isedit == false) {
|
||||
this.scene.traverse(function (item) {
|
||||
if (item.name.includes('point')) {
|
||||
if (item.hasDevice == false) {
|
||||
item.visible = false
|
||||
item.layers.set(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
export default function tunnelModeInit() {
|
||||
for (const item of this.tunnelConfigEquipment) {
|
||||
//使用api取拿到附着点
|
||||
let pointmodel = this.scene.getObjectByName(item.pointName)
|
||||
pointmodel.hasDevice;
|
||||
let formInfo = {
|
||||
equipmentType: item.equipmentType, //设备类型
|
||||
chooseEquipment: item.equipmentName, //设备选择(设备名称)
|
||||
threshold: item.equipmentValue, //阈值
|
||||
}
|
||||
this.addEquipment(pointmodel, formInfo);
|
||||
}
|
||||
//进行预览和编辑模式的一些操作
|
||||
if (this.isedit == false) {
|
||||
this.scene.traverse(function (item) {
|
||||
if (item.name.includes('point')) {
|
||||
if (item.hasDevice == false) {
|
||||
item.visible = false
|
||||
item.layers.set(-1)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user