fix : 隧道ws数据
This commit is contained in:
@@ -82,6 +82,7 @@ let dataZoomTop = reactive('87%')
|
||||
let chartData = reactive([])
|
||||
const chooseDayRef = ref();
|
||||
const chooseMonthRef = ref();
|
||||
const itemInfo = ref();
|
||||
const windSpeed = ref(0)
|
||||
const windSpeedUnit = ref('m/s')
|
||||
const windDirection = ref(null)
|
||||
@@ -109,7 +110,7 @@ watch(() => props.windSpeed, (now) => {
|
||||
watch(() => props.list, (now) => {
|
||||
airList.value?.forEach(item => {
|
||||
now.forEach(newItem => {
|
||||
if (newItem.equipmentId === 11) {//风向传感器
|
||||
if (newItem.equipmentType === "windDirection") {//风向传感器
|
||||
windDirection.value = newItem.value
|
||||
}
|
||||
if (item.equipmentId === newItem.equipmentId) {
|
||||
|
||||
@@ -24,9 +24,9 @@ const length = ref(null);
|
||||
const value = ref(null);
|
||||
const point = ref(null);
|
||||
const isWaring = ref();
|
||||
// watch(() => params.wp.value, () => {
|
||||
// setValue();
|
||||
// });
|
||||
watch(() => params.wp.value, () => {
|
||||
setValue(params.wp.value);
|
||||
});
|
||||
onMounted(() => {
|
||||
if (params.wp !== undefined) {
|
||||
setValue();
|
||||
@@ -36,8 +36,14 @@ onMounted(() => {
|
||||
const getImageUrl = (name) => {
|
||||
return new URL(`../../../../assets/images/airInfo/${name}`, import.meta.url).href
|
||||
}
|
||||
const setValue = () => {
|
||||
let width = (params.wp.value * length.value.offsetWidth) / params.wp.max;
|
||||
const setValue = (realValue) => {
|
||||
let newValue=''
|
||||
if(realValue){
|
||||
newValue=realValue
|
||||
}else{
|
||||
newValue=params.wp.value
|
||||
}
|
||||
let width = (newValue * length.value.offsetWidth) / params.wp.max;
|
||||
value.value.style.width = `${width}px`;
|
||||
let flag = (params.wp.point * length.value.offsetWidth) / params.wp.max;
|
||||
point.value.style.left = `${flag}px`;
|
||||
@@ -51,7 +57,7 @@ const setValue = () => {
|
||||
value.value.style.background =
|
||||
"linear-gradient(270deg, #38CAFB 0%, #E9D726 100%)";
|
||||
}
|
||||
isWaring.value = params.wp.value < params.wp.point;
|
||||
isWaring.value = newValue < params.wp.point;
|
||||
}else {
|
||||
if (width >= flag) {
|
||||
value.value.style.background =
|
||||
@@ -60,14 +66,13 @@ const setValue = () => {
|
||||
value.value.style.background =
|
||||
"linear-gradient(270deg, #38CAFB 0%, #E9D726 100%)";
|
||||
}
|
||||
isWaring.value = params.wp.value >= params.wp.point;
|
||||
isWaring.value = newValue >= params.wp.point;
|
||||
}
|
||||
|
||||
}
|
||||
// let isWaring = computed(() => {
|
||||
// return params.wp.value >= params.wp.point;
|
||||
// });
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -73,6 +73,7 @@ const params = defineProps([
|
||||
"deviceData",
|
||||
"devRealtimeData",
|
||||
"simulateData",
|
||||
"tunnelAlias",
|
||||
]);
|
||||
|
||||
// hover到设备回显参数
|
||||
@@ -153,7 +154,7 @@ async function handleMounted() {
|
||||
demo.pointsVisible(false); //隐藏附着点
|
||||
TunnelSceneSimulateRender(data);
|
||||
// 初始化标牌信息
|
||||
renderRoadPlane({ nickname: "隧道名称", length: 10000 });
|
||||
renderRoadPlane({ nickname: params.tunnelAlias, length: params.tunnelLength });
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user