廖杰:修复预览模式的隧道切换bug和编辑模式的添加bug
This commit is contained in:
@@ -73,6 +73,7 @@ let fanData;
|
||||
watch(
|
||||
() => params.largeScreen,
|
||||
(now) => {
|
||||
console.log(params.largeScreen);
|
||||
params.largeScreen = now;
|
||||
fanData = (toRaw(params.largeScreen.value)).frequencyChangerList;
|
||||
console.log(fanData);
|
||||
@@ -174,10 +175,10 @@ async function handleMounted() {
|
||||
return
|
||||
} else {
|
||||
console.log(err);
|
||||
// ElMessage({
|
||||
// message: "场景初始化异常---!",
|
||||
// type: "warning",
|
||||
// });
|
||||
ElMessage({
|
||||
message: "场景初始化异常---!",
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,10 +117,10 @@ async function handleMounted() {
|
||||
demo.SignsInf(params.form.tunnelAlias, String(params.tunnelLength))
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
// ElMessage({
|
||||
// message: "场景初始化异常---!",
|
||||
// type: "warning",
|
||||
// });
|
||||
ElMessage({
|
||||
message: "场景初始化异常---!",
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,39 +2,20 @@
|
||||
<div id="edit-dialog">
|
||||
<div class="distance-back">
|
||||
<p>当前距离洞口:{{ pointDistance_str }}</p>
|
||||
<img
|
||||
src="/images/htmlEditDialog/back-icon.png"
|
||||
alt=""
|
||||
@click="handleCancel"
|
||||
/>
|
||||
<img src="/images/htmlEditDialog/back-icon.png" alt="" @click="handleCancel" />
|
||||
</div>
|
||||
<div class="equ-info">当前风压:{{ p }}Pa</div>
|
||||
<div class="setting">
|
||||
<div class="setting-item">
|
||||
<p>传感器类型</p>
|
||||
|
||||
<select-input
|
||||
:options="options"
|
||||
@selectChange="handleTypeChange"
|
||||
placeholder="请选择传感器类型"
|
||||
ref="equipmentType"
|
||||
/>
|
||||
<select-input :options="options" @selectChange="handleTypeChange" placeholder="请选择传感器类型" ref="equipmentType" />
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<p>设备选择</p>
|
||||
<select-input
|
||||
:options="options2"
|
||||
@selectChange="handleEquipmentChange"
|
||||
placeholder="请选择设备"
|
||||
ref="equipment"
|
||||
/>
|
||||
<select-input :options="options2" @selectChange="handleEquipmentChange" placeholder="请选择设备" ref="equipment" />
|
||||
</div>
|
||||
<input-num
|
||||
name="阈值"
|
||||
placeholder="请输入阈值"
|
||||
@inputValue="handelInput"
|
||||
:disabled="isDisabledInputNum"
|
||||
/>
|
||||
<input-num name="阈值" placeholder="请输入阈值" @inputValue="handelInput" :disabled="isDisabledInputNum" />
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button @click="removeEquipment">删除</button>
|
||||
@@ -76,8 +57,7 @@ const modelStore = useModelSceneStore();
|
||||
//计算锚点之间距离
|
||||
const pointDistance_str = computed(
|
||||
() =>
|
||||
`${parseInt(params.pointGap)}米*${params.pointNum}=${
|
||||
parseInt(params.pointGap) * params.pointNum
|
||||
`${parseInt(params.pointGap)}米*${params.pointNum}=${parseInt(params.pointGap) * params.pointNum
|
||||
}米`
|
||||
);
|
||||
|
||||
@@ -187,9 +167,9 @@ function addEquipment() {
|
||||
.addEquipment({ ...toRaw(equipmentSetting.value) }, params.pointGap)
|
||||
.then((res) => {
|
||||
emit("addEquipment", equipmentSetting.value);
|
||||
if (res.code===1000) {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
}else {
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
resetEquipmentSetting();
|
||||
@@ -202,6 +182,7 @@ function addEquipment() {
|
||||
});
|
||||
resetEquipmentSetting();
|
||||
} else {
|
||||
console.log(err);
|
||||
ElMessage({
|
||||
message: "添加异常!",
|
||||
type: "warning",
|
||||
|
||||
@@ -177,7 +177,7 @@ function handleOtherEqu(targetPoint, equipmentInfo) {
|
||||
function handleFanEqu(
|
||||
targetPoint,
|
||||
equipmentInfo,
|
||||
fanData,
|
||||
fanData = 1,
|
||||
speed = Math.random().toFixed(1) * 1000
|
||||
) {
|
||||
// 由于风机比较多,每个风机转速不一直,保存在一个数中遍历
|
||||
@@ -200,35 +200,54 @@ function handleFanEqu(
|
||||
// console.log(targetPoint.info);
|
||||
//风机颜色重新命名
|
||||
if (fanData != 1) {
|
||||
let fan1 = fanData[0].equipmentType
|
||||
let fan2 = fanData[1].equipmentType
|
||||
if (targetPoint.info.typeKey == fan1) {
|
||||
if (fanData[0].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
if (fanData.length == 2) {
|
||||
let fan1 = fanData[0].equipmentType
|
||||
let fan2 = fanData[1].equipmentType
|
||||
if (targetPoint.info.typeKey == fan1) {
|
||||
if (fanData[0].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (fanData[1].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (fanData[1].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
let fan1 = fanData[0].equipmentType
|
||||
if (targetPoint.info.typeKey == fan1) {
|
||||
if (fanData[0].online == false) {
|
||||
this.scene.traverse(function (child) {
|
||||
if (child.id === 1005) {
|
||||
child.traverse(function (obj) {
|
||||
// console.log(obj);
|
||||
// 判断子对象是否是物体,如果是,更改其颜色
|
||||
if (obj.isMesh) {
|
||||
obj.material.color.set(0xFF0000)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
export default function previewtunnelModeInit(equipmentList, fanData) {
|
||||
export default function previewtunnelModeInit(equipmentList, fanData = 1) {
|
||||
//初始化将墙壁隐藏起来
|
||||
// for (let line = 1; line <= 20; line++) {
|
||||
// if (line < 10) {
|
||||
@@ -13,7 +13,7 @@ export default function previewtunnelModeInit(equipmentList, fanData) {
|
||||
// console.log(equipmentList);
|
||||
|
||||
equipmentList.forEach((item) => {
|
||||
this.addEquipment(this.scene.getObjectByName(item.position), item, fanData);
|
||||
this.addEquipment(this.scene.getObjectByName(item.position), item, fanData = 1);
|
||||
});
|
||||
//进行预览和编辑模式的一些操作
|
||||
if (this.isedit == false) {
|
||||
|
||||
@@ -287,6 +287,7 @@ const getList = () => {
|
||||
})
|
||||
}
|
||||
//根据站点id获取隧道信息option
|
||||
|
||||
let largeScreen = computed(() => largeScreenData)
|
||||
const getTunnel = (id) => {
|
||||
getTunnelBySiteId(id).then((res) => {
|
||||
|
||||
Reference in New Issue
Block a user