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