@@ -291,11 +248,12 @@ import {
editEquipment,
getTunnelDetail,
getOtherSensorSerialNumberOptions,
- getWindPressureSerialNumberOptions
+ getWindPressureSerialNumberOptions, getSimulateTunnelDetail, editSimulateEquipment
} from "@/api/tunnelManage";
import TunnelTitle from "@/components/tunnelTitle/index.vue";
import {debounce} from 'lodash'
import {defineEmits} from "vue";
+import {startSimulation} from "@/api/largeScreen.js";
const router = useRouter()
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
@@ -316,44 +274,7 @@ const siteId = ref(0)
const emit = defineEmits([
"cancel"
]);
-const getWindPressureOptions = async () => {
- let {data, code, msg} = await getWindPressureSerialNumberOptions(tunnelId)
- if (code === 1000) {
- // windPressureDataSerialNumberOptions.value= data
- return data
- } else {
- ElMessage.error(msg)
- }
-}
-const getOtherSensorOptions = async () => {
- let {data, code, msg} = await getOtherSensorSerialNumberOptions(tunnelId)
- if (code === 1000) {
- otherSensorSerialNumberOptions.value = data
- } else {
- ElMessage.error(msg)
- }
-}
-getOtherSensorOptions()
-const clearWinDataSelectedOption = () => {
- winDataSelectedOption.value = []
-}
-const changeWindDataSerialNumber = (value, options) => {
- // console.info("🚀 ~method:changeWindDataSerialNumber -----", value,options)
- options?.forEach(item => {
- if (item.value == value) {
- // console.info("🚀 ~method:item.label -----", item.label)
- if (item.label.indexOf('PLC') >= 0) {
- winDataSelectedOption.value = []
- } else {
- winDataSelectedOption.value.push(value)
- }
- }
- })
-}
-const serialNumberOptionDisabled = (item) => {
- return winDataSelectedOption.value.indexOf(item.value) >= 0;
-}
const changeData = (item) => {
return {
equipmentId: item.equipmentId,
@@ -368,7 +289,7 @@ const changeData = (item) => {
const editEquip = debounce(() => {
const loading = ElLoading.service({
lock: true,
- text: '修改中...',
+ text: '开始模拟中',
background: 'rgba(0, 0, 0, 0.7)',
customClass: 'allLoading'
})
@@ -407,23 +328,23 @@ const editEquip = debounce(() => {
newSensor.push(changeData(item))
})
const basicData = {
- tunnelId: tunnelId,
+ projectId: tunnelId,
acquisitionList: newFrequency,
frequencyChangerList: newFan,
windPressureSensorList: newWind,
sensorList: newSensor,
- // shuntList: editFenLiuData.value,
}
- // console.info("🚀 ~ file:index method: line:478 -----",basicData)
- editEquipment(basicData).then(res => {
+ console.info("🚀 ~ file:index method: line:478 -----",basicData)
+ editSimulateEquipment(basicData).then(async res => {
if (res.code === 1000) {
loading.close()
- ElMessage.success('修改成功')
- router.push('/tunnel/' + siteId.value + '/' + type + '/' + userId)
+ // ElMessage.success('开始模拟')
+ let res= await startSimulation(tunnelId)
+ console.log('res',res)
+ emit('submit')
} else {
ElMessage.error(res.msg)
loading.close()
-
}
})
}, 100)
@@ -433,32 +354,24 @@ const handleChangeMenu = (e) => {
}
const getList = async () => {
- const windPressureOption = await getWindPressureOptions()
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass: 'allLoading'
})
- await getEquipmentList(tunnelId).then(res => {
+ await getSimulateTunnelDetail(tunnelId).then(res => {
if (res.code === 1000) {
- fanData.value = res.data.frequencyChangerList
- res.data.windPressureSensorList?.forEach(item => {
+ fanData.value = res.data.equipmentList.frequencyChangerList
+ res.data.equipmentList.windPressureSensorList?.forEach(item => {
item.offset = item.offset + 4000
})
- winData.value = res.data.windPressureSensorList
- winData.value?.forEach(item => {
- for (const equipmentId in windPressureOption) {
- if (item.equipmentId == equipmentId) {
- item.serialNumberOption = windPressureOption[equipmentId]
- }
- }
- })
- res.data.sensorList?.forEach(item => {
+ winData.value = res.data.equipmentList.windPressureSensorList
+ res.data.equipmentList.sensorList?.forEach(item => {
item.offset = item.offset + 4000
})
- otherData.value = res.data.sensorList
- res.data.acquisitionList.map(item => {
+ otherData.value = res.data.equipmentList.sensorList
+ res.data.equipmentList.acquisitionList?.map(item => {
item.acquisitionPeriod = item.acquisitionPeriod / 1000
if (item.typeKey === 'frequency') {
fanFrequency.value = item.acquisitionPeriod
@@ -472,14 +385,6 @@ const getList = async () => {
loading.close()
})
}
-const getTunnel = () => {
- getTunnelDetail(tunnelId).then((res) => {
- if (res?.code === 1000) {
- siteId.value = res.data.siteId
- }
- });
-}
-getTunnel()
getList()
-
diff --git a/src/views/device-manage/index-or.vue b/src/views/device-manage/index-or.vue
deleted file mode 100644
index cd181e9..0000000
--- a/src/views/device-manage/index-or.vue
+++ /dev/null
@@ -1,860 +0,0 @@
-
-
-
-
-
- {{ tunnelName }}
-
-
-
-
-
-
-
-
- 风机
-
-
- 风压
-
-
- 其他传感器
-
-
-
-
-
-
-
-
-
风机设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
风压设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
其他传感器设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
分流器设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/device-manage/index-origanl.vue b/src/views/device-manage/index-origanl.vue
deleted file mode 100644
index 2fc22e5..0000000
--- a/src/views/device-manage/index-origanl.vue
+++ /dev/null
@@ -1,860 +0,0 @@
-
-
-
-
-
- {{ tunnelName }}
-
-
-
-
-
-
-
-
- 风机
-
-
- 风压
-
-
- 其他传感器
-
-
-
-
-
-
-
-
-
风机设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
风压设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
其他传感器设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
分流器设备管理
-
- 采集频率
-
-
- 秒/次
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/edit/edit-new.vue b/src/views/edit/edit-new.vue
deleted file mode 100644
index f1eed0f..0000000
--- a/src/views/edit/edit-new.vue
+++ /dev/null
@@ -1,415 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/edit/edit-or.vue b/src/views/edit/edit-or.vue
deleted file mode 100644
index 2a964b3..0000000
--- a/src/views/edit/edit-or.vue
+++ /dev/null
@@ -1,342 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/edit/edit-orignal.vue b/src/views/edit/edit-orignal.vue
deleted file mode 100644
index 7aef199..0000000
--- a/src/views/edit/edit-orignal.vue
+++ /dev/null
@@ -1,342 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/tunnel-manage/index-new.vue b/src/views/tunnel-manage/index-new.vue
deleted file mode 100644
index a947744..0000000
--- a/src/views/tunnel-manage/index-new.vue
+++ /dev/null
@@ -1,1093 +0,0 @@
-
-
-
-
-
- {{ siteName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 添加
-
-
- 全选
-
-
- 删除
-
-
-
-
-
-
- {{ item.tunnelName }}
- 施工长度{{ item.constructionLength }}米 隧道长度{{ item.totalLength }}米
-
- 默认
-
-
-
-
-
-
-
-
-
-
-
-
{{ equItem.name }}:{{ item.tunnelEquipmentAmountInfo[equItem.type] }}
-
-
-
-
-
-
-
-
-
- 暂无图纸~ 请前往站点管理上传图纸~
-
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/tunnel-manage/index-or.vue b/src/views/tunnel-manage/index-or.vue
deleted file mode 100644
index 546da3f..0000000
--- a/src/views/tunnel-manage/index-or.vue
+++ /dev/null
@@ -1,1060 +0,0 @@
-
-
-
-
-
- {{ siteName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 添加
-
-
- 全选
-
-
- 删除
-
-
-
-
-
-
- {{ item.tunnelName }}
- 施工长度{{ item.constructionLength }}米 隧道长度{{ item.totalLength }}米
-
- 默认
-
-
-
-
-
-
-
-
-
-
-
-
{{ equItem.name }}:{{ item.tunnelEquipmentAmountInfo[equItem.type] }}
-
-
-
-
-
-
-
-
-
- 暂无图纸~ 请前往站点管理上传图纸~
-
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/tunnel-manage/index-origanl.vue b/src/views/tunnel-manage/index-origanl.vue
deleted file mode 100644
index 8a122fb..0000000
--- a/src/views/tunnel-manage/index-origanl.vue
+++ /dev/null
@@ -1,1060 +0,0 @@
-
-
-
-
-
- {{ siteName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 添加
-
-
- 全选
-
-
- 删除
-
-
-
-
-
-
- {{ item.tunnelName }}
- 施工长度{{ item.constructionLength }}米 隧道长度{{ item.totalLength }}米
-
- 默认
-
-
-
-
-
-
-
-
-
-
-
-
{{ equItem.name }}:{{ item.tunnelEquipmentAmountInfo[equItem.type] }}
-
-
-
-
-
-
-
-
-
- 暂无图纸~ 请前往站点管理上传图纸~
-
-
-
-
-
- {{ title }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
-
-
-
-
-
- Hz
-
-
-
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue
index c4c54b8..2e68df5 100644
--- a/src/views/tunnel-simulate/index.vue
+++ b/src/views/tunnel-simulate/index.vue
@@ -2,46 +2,31 @@
-
+
隧道总长度: {{ tunnelLength }}米
开始模拟
-
结束模拟
+
+ 模拟爆破
+ 结束模拟
+
-
- 当前站点:
{{ currentSite }}
-
-
-
-
- {{ item.label }}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
你好!{{ currentUser }}
今天是:{{ currentDate }}
@@ -49,17 +34,19 @@
-
+
+
+
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
@@ -101,6 +89,7 @@
@@ -108,12 +97,14 @@
v-if="showFan"
:list="socketData.sensor"
:windSpeed="socketData.windSpeed"
+ :isSimulate="true"
:air-data="largeScreenData"
/>
@@ -121,24 +112,6 @@
-
-
-
-
-
- {{ item.label }}
-
-
-
-
-
diff --git a/src/components/content/tunnelScene/TunnelSceneSimulate.vue b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
index 985573a..171180b 100644
--- a/src/components/content/tunnelScene/TunnelSceneSimulate.vue
+++ b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
@@ -3,40 +3,40 @@
-
-
- 是否确定删除该设备
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -89,6 +89,7 @@ const params = defineProps([
"deviceData",
"devRealtimeData",
"simulateData",
+ "tunnelAlias",
]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
let isedit = ref(params.isedit);
@@ -111,7 +112,7 @@ onMounted(handleMounted);
// 挂载后回调
async function handleMounted() {
- const doms = [info.value.$el, edit.value.$el];
+ const doms = [info.value.$el];//edit.value.$el
demo = new ThreeDScene(three, content.value);
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
// "../../../../public/tunnelModel/chanel-have-wall-now-use.gltf"
@@ -125,8 +126,8 @@ async function handleMounted() {
demo.addTween(TWEEN);
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);
demo.setDistance(10);
- lClickCallback(demo); //绑定左键回调
- rClickCallback(demo); //绑定右键回调
+ // lClickCallback(demo); //绑定左键回调
+ // rClickCallback(demo); //绑定右键回调
//加载HDR背景图片
demo.loadBackground(hdrLoader, backColorSet);
@@ -142,19 +143,6 @@ async function handleMounted() {
// params.tunnelId,
// params.form
// );
- //todo 父组件传的设备数据params.deviceData
- // const newModelList=[...params.deviceData.frequencyChangerList,...params.deviceData.windPressureSensorList, ...params.deviceData.sensorList]
- // newModelList.map((item,index1)=>{
- // const index=index1+1
- // item.threshold=""
- // if(index
({
...item,
+ data:'10',
equipmentType: item.equipmentType.startsWith("frequency")
? "frequency"
: "sensor",
}));
+ console.log('modeData',modeData)
demo.editTunnelInit(modeData);
// 初始化标牌信息
- demo.SignsInf("dsadsa", String(params.tunnelLength));
+ demo.SignsInf(params.tunnelAlias, String(params.tunnelLength));
} catch (err) {}
}
diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue
index 2295741..85bd0ad 100644
--- a/src/views/tunnel-simulate/index.vue
+++ b/src/views/tunnel-simulate/index.vue
@@ -2,11 +2,11 @@
-
+
隧道总长度: {{ tunnelLength }}米
开始模拟开始模拟
模拟爆破
@@ -36,17 +36,19 @@
@@ -60,22 +62,22 @@
@@ -89,35 +91,35 @@
报警时间:
@@ -143,33 +145,33 @@
-
-
+
+
@@ -178,87 +180,87 @@
{{ scope.row.lookupStatus ? "已读" : "未读" }}
+ >{{ scope.row.lookupStatus ? "已读" : "未读" }}
详情
+ type="primary"
+ size="mini"
+ style="font-weight: bold"
+ @click="handleView(scope.row)"
+ link
+ >详情
删除
+ type="danger"
+ size="mini"
+ v-if="roleKey !== 'administrator'"
+ @click="handleDelete(scope.row)"
+ link
+ >删除
@@ -278,9 +280,9 @@ import AirInfo from "@/components/content/airInfo/AirInfo.vue";
import BadGasInfo from "@/components/content/badGasInfo/BadGasInfo.vue";
import ManageBtn from "@/components/manageBtn/index.vue";
import TunnelTitle from "@/components/tunnelTitle/index.vue";
-import { dateFormat } from "@/utils/date.js";
-import { getToken } from "@/utils/auth";
-import { useAuthStore } from "@/store/userstore.js";
+import {dateFormat} from "@/utils/date.js";
+import {getToken} from "@/utils/auth";
+import {useAuthStore} from "@/store/userstore.js";
import {
getLargeScreen,
getLargeScreenInfo,
@@ -292,15 +294,15 @@ import {
endSimulation,
blastingSimulation,
} from "@/api/largeScreen";
-import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
-import { getUserInfo } from "@/api/login";
-import { initSceneData } from "@/api/tunnelScene";
+import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
+import {getUserInfo} from "@/api/login";
+import {initSceneData} from "@/api/tunnelScene";
import {
getScreenSimulateTunnel,
getSimulateTunnelDetail,
getTunnelList,
} from "@/api/tunnelManage";
-import { debounce } from "lodash";
+import {debounce} from "lodash";
const authStore = useAuthStore();
const router = useRouter();
@@ -308,6 +310,7 @@ const previewId = reactive(router.currentRoute.value.params.tunnelId);
const siteId = reactive(router.currentRoute.value.params.siteId);
const tunnelIdFlag = reactive(router.currentRoute.value.params.tunnelId);
const selectIndex = ref(-1);
+const previewRef = ref();
const isVisited = ref(false);
const isDetailVisited = ref(false);
const showFan = ref(false);
@@ -338,6 +341,7 @@ const tunnelBtn = ref();
const tunnelList = ref([]);
const tunnelId = ref(0);
const tunnelLength = ref(0);
+const tunnelAlias = ref('');
const constructionLength = ref(0);
const routeList = ref([]);
let socket = reactive("");
@@ -419,6 +423,9 @@ const submitDevice = () => {
showDevice.value = false;
getScreenInfo(previewId);
// initWebSocket()
+ nextTick(() => {
+ previewRef.value.rerender()
+ })
};
const simulatedBlasting = async () => {
await blastingSimulation(previewId, 10);
@@ -555,6 +562,7 @@ const getBasicData = (id) => {
getSimulateTunnelDetail(id).then((res) => {
if (res?.code === 1000) {
tunnelLength.value = res.data.totalLength;
+ tunnelAlias.value = res.data.tunnelAlias;
serialNumber.value = res.data.serialNumber;
constructionLength.value = res.data.constructionLength;
initWebSocket();
@@ -590,13 +598,13 @@ const getScreenInfo = (id) => {
// })
res.data.sensorList.forEach((item) => {
if (
- item.equipmentType === "dust" ||
- item.equipmentType === "carbonDioxide" ||
- item.equipmentType === "carbonMonoxide" ||
- item.equipmentType === "hydrogenSulfide" ||
- item.equipmentType === "sulfurDioxide" ||
- item.equipmentType === "sulfurMonoxide" ||
- item.equipmentType === "nitrogenDioxide"
+ item.equipmentType === "dust" ||
+ item.equipmentType === "carbonDioxide" ||
+ item.equipmentType === "carbonMonoxide" ||
+ item.equipmentType === "hydrogenSulfide" ||
+ item.equipmentType === "sulfurDioxide" ||
+ item.equipmentType === "sulfurMonoxide" ||
+ item.equipmentType === "nitrogenDioxide"
) {
showBadLoading.value = 0;
} else {
From b64d943a5ee973a6999fea678b87fe4d1df53293 Mon Sep 17 00:00:00 2001
From: trp <2477421791@qq.com>
Date: Sun, 29 Dec 2024 19:12:05 +0800
Subject: [PATCH 07/18] =?UTF-8?q?trp:=E9=9A=A7=E9=81=93=E4=BB=BF=E7=9C=9F?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=8E=BB=E9=99=A4=E6=A0=87=E7=AD=BE?=
=?UTF-8?q?=E5=9B=9E=E6=98=BE=E5=92=8C=E9=9A=90=E8=97=8F=E9=99=84=E7=9D=80?=
=?UTF-8?q?=E7=82=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../content/tunnelScene/PreviewScene.vue | 2 +-
.../tunnelScene/TunnelSceneSimulate.vue | 25 +++++++++++--------
.../content/tunnelScene/sceneClass/demo.js | 8 +++++-
.../sceneClass/handleRLclick/handleRclick.js | 1 -
4 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/src/components/content/tunnelScene/PreviewScene.vue b/src/components/content/tunnelScene/PreviewScene.vue
index a85669f..645925f 100644
--- a/src/components/content/tunnelScene/PreviewScene.vue
+++ b/src/components/content/tunnelScene/PreviewScene.vue
@@ -210,7 +210,6 @@ const getTunnel = () => {
getTunnelDetail(params.tunnelId).then((res) => {
if (res?.code === 1000) {
form.value = res.data;
- // console.log(form.value.tunnelAlias);
tunnelAlias = form.value.tunnelAlias;
}
});
@@ -346,6 +345,7 @@ async function handleMounted() {
// console.log(modelList.value);
// console.log("init", params.tunnelId);
demo.previewtunnelModeInit(toRaw(modelList.value), fanData);
+ console.log("prew",modelList.value,fanData)
// setInterval("demo.previewtunnelModeInit(toRaw(modelList.value), fanData)", "1000")
demo.SignsInf(tunnelAlias, String(params.tunnelLen.value));
diff --git a/src/components/content/tunnelScene/TunnelSceneSimulate.vue b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
index 985573a..68331c8 100644
--- a/src/components/content/tunnelScene/TunnelSceneSimulate.vue
+++ b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
@@ -190,12 +190,15 @@ async function handleMounted() {
? "frequency"
: "sensor",
}));
+ demo.enableLeftBtn = false //关闭左键
+ demo.pointsVisible(false);
demo.editTunnelInit(modeData);
// 初始化标牌信息
demo.SignsInf("dsadsa", String(params.tunnelLength));
} catch (err) {}
}
+
// 从新渲染数据
async function rerender() {
try {
@@ -294,9 +297,9 @@ function editDevInfo(
//左键/双击左键回调函数
function lClickCallback(demo) {
- // console.log('左键点击查看信息');
+ console.log('左键点击查看信息');
- //demo动态添加函数,为操作组件内部
+ // demo动态添加函数,为操作组件内部
function displayDevInfo(targetPoint = null) {
hasDevice.value = targetPoint.hasDevice;
if (!targetPoint.info) {
@@ -339,15 +342,15 @@ function rClickCallback(demo) {
function handleAddEqu(formInfo) {
demo.addEquipment(targetP.value, formInfo);
// //将墙壁设置为可以穿透点击
- // for (let line = 1; line <= 20; line++) {
- // if (line < 10) {
- // let wall = 'wall_' + '0' + line
- // this.scene.getObjectByName(wall).layers.set(0)
- // } else if (line >= 10) {
- // let wall = 'wall_' + line
- // this.scene.getObjectByName(wall).layers.set(0)
- // }
- // }
+ for (let line = 1; line <= 20; line++) {
+ if (line < 10) {
+ let wall = 'wall_' + '0' + line
+ this.scene.getObjectByName(wall).layers.set(0)
+ } else if (line >= 10) {
+ let wall = 'wall_' + line
+ this.scene.getObjectByName(wall).layers.set(0)
+ }
+ }
}
const centerDialogVisible = ref(false);
diff --git a/src/components/content/tunnelScene/sceneClass/demo.js b/src/components/content/tunnelScene/sceneClass/demo.js
index b316d85..1673bba 100644
--- a/src/components/content/tunnelScene/sceneClass/demo.js
+++ b/src/components/content/tunnelScene/sceneClass/demo.js
@@ -205,7 +205,12 @@ export default class Demo {
// child.material.emissive = child.material.color
// child.material.emissiveMap = child.material.map
}
-
+ //是否显示附着点
+ pointsVisible(isEnable = true) {
+ this.points.forEach((element) => {
+ element.material.visible = isEnable;
+ });
+ }
// 添加轨道控制器
/**
* @param {Object} OrbitControls 轨道控制器
@@ -328,6 +333,7 @@ export default class Demo {
// 处理点击左右键触发的事件
__handleListenerClickRLEvent(isClickModels, e) {
e.preventDefault();
+ if (!this.enableLeftBtn) return;
clearTimeout(this.EventTimer);
this.EventTimer = setTimeout(() => {
const mouse = new this.THREE.Vector2();
diff --git a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleRclick.js b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleRclick.js
index cf972f4..0f901f8 100644
--- a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleRclick.js
+++ b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleRclick.js
@@ -1,6 +1,5 @@
import toImg from "../utils/EquipmentTag";
export function handleRClick(targetPoint) {
- return;
this.clearTagsObj();
const worldPosition = new this.THREE.Vector3();
//获取附着点的世界坐标系
From bfbf1b51168501d6b7bd99340718cc72526cf718 Mon Sep 17 00:00:00 2001
From: dj <1042039504@qq.com>
Date: Sun, 29 Dec 2024 19:28:12 +0800
Subject: [PATCH 08/18] =?UTF-8?q?fix=20:=20=E4=BC=98=E5=8C=96=E9=9A=A7?=
=?UTF-8?q?=E9=81=93=E6=A8=A1=E6=8B=9F=E9=A6=96=E9=A1=B5=E7=9A=84=E9=9A=A7?=
=?UTF-8?q?=E9=81=93=E9=A2=84=E8=A7=88=E6=A8=A1=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../tunnelScene/TunnelSceneSimulate.vue | 117 ++++++++++--------
src/views/tunnel-simulate/index.vue | 2 +-
2 files changed, 66 insertions(+), 53 deletions(-)
diff --git a/src/components/content/tunnelScene/TunnelSceneSimulate.vue b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
index 171180b..68331c8 100644
--- a/src/components/content/tunnelScene/TunnelSceneSimulate.vue
+++ b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
@@ -3,40 +3,40 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ 是否确定删除该设备
+
+
+
+
+
@@ -89,7 +89,6 @@ const params = defineProps([
"deviceData",
"devRealtimeData",
"simulateData",
- "tunnelAlias",
]); //接收参数看是不是编辑模式,如果是编辑模式,则需要做一些处理
let isedit = ref(params.isedit);
@@ -112,7 +111,7 @@ onMounted(handleMounted);
// 挂载后回调
async function handleMounted() {
- const doms = [info.value.$el];//edit.value.$el
+ const doms = [info.value.$el, edit.value.$el];
demo = new ThreeDScene(three, content.value);
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
// "../../../../public/tunnelModel/chanel-have-wall-now-use.gltf"
@@ -126,8 +125,8 @@ async function handleMounted() {
demo.addTween(TWEEN);
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);
demo.setDistance(10);
- // lClickCallback(demo); //绑定左键回调
- // rClickCallback(demo); //绑定右键回调
+ lClickCallback(demo); //绑定左键回调
+ rClickCallback(demo); //绑定右键回调
//加载HDR背景图片
demo.loadBackground(hdrLoader, backColorSet);
@@ -143,6 +142,19 @@ async function handleMounted() {
// params.tunnelId,
// params.form
// );
+ //todo 父组件传的设备数据params.deviceData
+ // const newModelList=[...params.deviceData.frequencyChangerList,...params.deviceData.windPressureSensorList, ...params.deviceData.sensorList]
+ // newModelList.map((item,index1)=>{
+ // const index=index1+1
+ // item.threshold=""
+ // if(index ({
...item,
- data:'10',
equipmentType: item.equipmentType.startsWith("frequency")
? "frequency"
: "sensor",
}));
- console.log('modeData',modeData)
+ demo.enableLeftBtn = false //关闭左键
+ demo.pointsVisible(false);
demo.editTunnelInit(modeData);
// 初始化标牌信息
- demo.SignsInf(params.tunnelAlias, String(params.tunnelLength));
+ demo.SignsInf("dsadsa", String(params.tunnelLength));
} catch (err) {}
}
+
// 从新渲染数据
async function rerender() {
try {
@@ -284,9 +297,9 @@ function editDevInfo(
//左键/双击左键回调函数
function lClickCallback(demo) {
- // console.log('左键点击查看信息');
+ console.log('左键点击查看信息');
- //demo动态添加函数,为操作组件内部
+ // demo动态添加函数,为操作组件内部
function displayDevInfo(targetPoint = null) {
hasDevice.value = targetPoint.hasDevice;
if (!targetPoint.info) {
@@ -329,15 +342,15 @@ function rClickCallback(demo) {
function handleAddEqu(formInfo) {
demo.addEquipment(targetP.value, formInfo);
// //将墙壁设置为可以穿透点击
- // for (let line = 1; line <= 20; line++) {
- // if (line < 10) {
- // let wall = 'wall_' + '0' + line
- // this.scene.getObjectByName(wall).layers.set(0)
- // } else if (line >= 10) {
- // let wall = 'wall_' + line
- // this.scene.getObjectByName(wall).layers.set(0)
- // }
- // }
+ for (let line = 1; line <= 20; line++) {
+ if (line < 10) {
+ let wall = 'wall_' + '0' + line
+ this.scene.getObjectByName(wall).layers.set(0)
+ } else if (line >= 10) {
+ let wall = 'wall_' + line
+ this.scene.getObjectByName(wall).layers.set(0)
+ }
+ }
}
const centerDialogVisible = ref(false);
diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue
index 85bd0ad..55d5ae2 100644
--- a/src/views/tunnel-simulate/index.vue
+++ b/src/views/tunnel-simulate/index.vue
@@ -46,7 +46,7 @@
id="tunnel-box"
:isedit="false"
:device-data="largeScreenData"
- :tunnelLength="tunnelLength"
+ :tunnelLength="tunnelLen"
:tunnelId="tunnelId"
:tunnelAlias="tunnelAlias"
>
From 8af7a35c69903325b318f79ab886ce5c58881743 Mon Sep 17 00:00:00 2001
From: dj <1042039504@qq.com>
Date: Mon, 30 Dec 2024 22:31:37 +0800
Subject: [PATCH 09/18] =?UTF-8?q?fix=20:=20=E4=BC=98=E5=8C=96=E9=9A=A7?=
=?UTF-8?q?=E9=81=93=E6=A8=A1=E6=8B=9F=E9=A6=96=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/largeScreen.js | 6 +-
src/api/tunnelManage.js | 8 +
src/components/deviceManage/index.vue | 69 ++++---
src/views/tunnel-simulate/index.vue | 235 ++++++----------------
src/views/tunnel-simulate/tunnel-list.vue | 115 ++---------
src/views/tunnel/index.vue | 2 +-
6 files changed, 129 insertions(+), 306 deletions(-)
diff --git a/src/api/largeScreen.js b/src/api/largeScreen.js
index 2e87e5b..8f1f3c7 100644
--- a/src/api/largeScreen.js
+++ b/src/api/largeScreen.js
@@ -160,20 +160,20 @@ export const getSimulationBadGasEchartsInfo = (id,time,type,startTime,endTime) =
export const startSimulation = (projectId) => {
return request({
url: `/tunnel/simulation/start/${projectId}`,
- method: 'post'
+ method: 'get'
})
}
// 结束模拟
export const endSimulation = (projectId) => {
return request({
url: `/tunnel/simulation/stop/${projectId}`,
- method: 'post'
+ method: 'get'
})
}
//模拟爆破
export const blastingSimulation = (projectId,level) => {
return request({
url: `/tunnel/simulation/blasting/${projectId}/${level}`,
- method: 'post'
+ method: 'get'
})
}
\ No newline at end of file
diff --git a/src/api/tunnelManage.js b/src/api/tunnelManage.js
index 680d7bb..14042b4 100644
--- a/src/api/tunnelManage.js
+++ b/src/api/tunnelManage.js
@@ -108,6 +108,14 @@ export const addSimulateTunnel = (data) => {
})
}
+export const editSimulateTunnel = (data) => {
+ return request({
+ url: '/tunnel/simulate/edit',
+ method: 'post',
+ data
+ })
+}
+
export const editSimulateEquipment = (data) => {
return request({
url: '/tunnel/simulate',
diff --git a/src/components/deviceManage/index.vue b/src/components/deviceManage/index.vue
index 7f146b9..15ca2c9 100644
--- a/src/components/deviceManage/index.vue
+++ b/src/components/deviceManage/index.vue
@@ -39,33 +39,33 @@
:header-cell-style="{backgroundColor: '#064B66',color: '#fff',fontSize: '40px',borderBottom: 'none' }"
:cell-style="{textAlign: 'center',borderBottom: 'none'}" :data="fanData">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -113,7 +113,7 @@
:header-cell-style="{backgroundColor: '#064B66',color: '#fff',fontSize: '40px',borderBottom: 'none' }"
:cell-style="{textAlign: 'center',borderBottom: 'none'}" :data="winData">
-
+
@@ -184,7 +184,7 @@
:header-cell-style="{backgroundColor: '#064B66',color: '#fff',fontSize: '40px',borderBottom: 'none' }"
:cell-style="{textAlign: 'center',borderBottom: 'none'}" :data="otherData">
-
+
@@ -334,13 +334,16 @@ const editEquip = debounce(() => {
windPressureSensorList: newWind,
sensorList: newSensor,
}
- console.info("🚀 ~ file:index method: line:478 -----",basicData)
editSimulateEquipment(basicData).then(async res => {
if (res.code === 1000) {
loading.close()
- // ElMessage.success('开始模拟')
- let res= await startSimulation(tunnelId)
- console.log('res',res)
+ let res = await startSimulation(tunnelId)
+ // console.log('res', res)
+ if (res.code === 1000) {
+ ElMessage.success('开始模拟')
+ }else{
+ ElMessage.warning(res.msg)
+ }
emit('submit')
} else {
ElMessage.error(res.msg)
diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue
index 55d5ae2..d7d3643 100644
--- a/src/views/tunnel-simulate/index.vue
+++ b/src/views/tunnel-simulate/index.vue
@@ -1,13 +1,14 @@
+
-
-
+
隧道总长度: {{ tunnelLength }}米
-
开始模拟
+
开始模拟
模拟爆破
结束模拟
@@ -46,9 +47,10 @@
id="tunnel-box"
:isedit="false"
:device-data="largeScreenData"
- :tunnelLength="tunnelLen"
+ :tunnelLength="tunnelLength"
:tunnelId="tunnelId"
:tunnelAlias="tunnelAlias"
+ :devRealtimeData="socketData"
>
@@ -126,148 +128,6 @@
-
-
-
-
报警时间:
- {{ alarmDetail.alarmTime }}
-
-
-
报警内容:
- {{ alarmDetail.alarmContent }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
-
-
-
-
-
- {{ scope.row.lookupStatus ? "已读" : "未读" }}
-
-
-
-
-
- 详情
-
- 删除
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js
index 1b1a510..7d39f34 100644
--- a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js
+++ b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js
@@ -1,5 +1,4 @@
export function handleLHover(targetPoint) {
- this.clearTunnelEquipments()
if (this.tag3CSS2DObj.element.style.opacity != '1') {
// 保存进入状态
this._saveState();
diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue
index d7d3643..19b1899 100644
--- a/src/views/tunnel-simulate/index.vue
+++ b/src/views/tunnel-simulate/index.vue
@@ -283,9 +283,7 @@ const submitDevice = () => {
showDevice.value = false;
getScreenInfo(previewId);
// initWebSocket()
- nextTick(() => {
- previewRef.value.rerender()
- })
+
};
const simulatedBlasting = async () => {
await blastingSimulation(previewId, 10);
@@ -469,6 +467,9 @@ const getScreenInfo = (id) => {
showBadLoading.value = 1;
}
largeScreenData.value = res.data;
+ nextTick(() => {
+ previewRef.value.TunnelSceneSimulateRender(res.data)
+ })
// console.log("largeScreenData.value", largeScreenData.value);
} else {
ElMessage.warning(res.msg);
From 1f83ddfa8e513c2b5179a9032ff290602448f7ec Mon Sep 17 00:00:00 2001
From: dj <1042039504@qq.com>
Date: Thu, 2 Jan 2025 21:35:33 +0800
Subject: [PATCH 13/18] =?UTF-8?q?fix=20:=20=E4=BC=98=E5=8C=96=E9=9A=A7?=
=?UTF-8?q?=E9=81=93=E6=A8=A1=E6=8B=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../content/tunnelScene/TunnelSceneSimulate.vue | 1 +
src/views/tunnel-simulate/index.vue | 12 +++++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/components/content/tunnelScene/TunnelSceneSimulate.vue b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
index aafb6cd..92e5e0f 100644
--- a/src/components/content/tunnelScene/TunnelSceneSimulate.vue
+++ b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
@@ -360,6 +360,7 @@ const ThreeConfig = {
* @param {Object} data 渲染数据格式 [{equipmentId,equipmentName,pointName,equipmentType,equipmentValue}]
*/
function TunnelSceneSimulateRender(data) {
+ console.log('TunnelSceneSimulateRender',data)
if (!demo) return;
const modeData = randomPosition([
...data.frequencyChangerList,
diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue
index 19b1899..3640111 100644
--- a/src/views/tunnel-simulate/index.vue
+++ b/src/views/tunnel-simulate/index.vue
@@ -281,7 +281,7 @@ const cancelDeviceManage = () => {
const submitDevice = () => {
isStartSimulate.value = false;
showDevice.value = false;
- getScreenInfo(previewId);
+ getScreenInfo(previewId,true);
// initWebSocket()
};
@@ -431,7 +431,7 @@ const getBasicData = (id) => {
});
};
-const getScreenInfo = (id) => {
+const getScreenInfo = (id,flag) => {
if (id) {
tunnelId.value = id;
// equipmentOption.value = []
@@ -467,9 +467,11 @@ const getScreenInfo = (id) => {
showBadLoading.value = 1;
}
largeScreenData.value = res.data;
- nextTick(() => {
- previewRef.value.TunnelSceneSimulateRender(res.data)
- })
+ if(flag) {
+ nextTick(() => {
+ previewRef.value.TunnelSceneSimulateRender(res.data)
+ })
+ }
// console.log("largeScreenData.value", largeScreenData.value);
} else {
ElMessage.warning(res.msg);
From 3a2bd596a93e3ea1ebfda541dacaa85b332091d3 Mon Sep 17 00:00:00 2001
From: trp <2477421791@qq.com>
Date: Thu, 2 Jan 2025 21:45:33 +0800
Subject: [PATCH 14/18] =?UTF-8?q?trp:=E6=9C=AC=E5=9C=B0=E6=8F=90=E4=BA=A4?=
=?UTF-8?q?=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/content/tunnelScene/TunnelSceneSimulate.vue | 2 --
.../tunnelScene/sceneClass/handleRLclick/handleLhover.js | 1 -
2 files changed, 3 deletions(-)
diff --git a/src/components/content/tunnelScene/TunnelSceneSimulate.vue b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
index 9b0e436..59a5ea9 100644
--- a/src/components/content/tunnelScene/TunnelSceneSimulate.vue
+++ b/src/components/content/tunnelScene/TunnelSceneSimulate.vue
@@ -392,8 +392,6 @@ function hoverDevEquipmentCallback(targetPointInfo) {
devRealtimeDetail.value.equipmentType =typeKey;
devRealtimeDetail.value.unit = u;
devRealtimeDetail.value.value = 1000; //1000替换为value
-
- demo.clearTunnelEquipments()
}
/**
* @description: 渲染隧道入口提示板信息
diff --git a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js
index 1b1a510..7d39f34 100644
--- a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js
+++ b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js
@@ -1,5 +1,4 @@
export function handleLHover(targetPoint) {
- this.clearTunnelEquipments()
if (this.tag3CSS2DObj.element.style.opacity != '1') {
// 保存进入状态
this._saveState();
From 8460c52d762bd1709dd094cfdf638996aa8c2d81 Mon Sep 17 00:00:00 2001
From: dj <1042039504@qq.com>
Date: Thu, 2 Jan 2025 23:33:37 +0800
Subject: [PATCH 15/18] =?UTF-8?q?fix=20:=20=E9=9A=A7=E9=81=93ws=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/largeScreen.js | 7 +
src/components/content/airInfo/AirInfo.vue | 3 +-
.../content/airInfo/childComps/ItemInfo.vue | 21 +-
.../tunnelScene/TunnelSceneSimulate.vue | 3 +-
src/views/tunnel-simulate/index.vue | 238 ++----------------
5 files changed, 42 insertions(+), 230 deletions(-)
diff --git a/src/api/largeScreen.js b/src/api/largeScreen.js
index 8f1f3c7..92c62d3 100644
--- a/src/api/largeScreen.js
+++ b/src/api/largeScreen.js
@@ -163,6 +163,13 @@ export const startSimulation = (projectId) => {
method: 'get'
})
}
+//模拟状态
+export const simulationState = (projectId) => {
+ return request({
+ url: `/tunnel/simulation/state/${projectId}`,
+ method: 'get'
+ })
+}
// 结束模拟
export const endSimulation = (projectId) => {
return request({
diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue
index cbe10c2..5e6cef9 100644
--- a/src/components/content/airInfo/AirInfo.vue
+++ b/src/components/content/airInfo/AirInfo.vue
@@ -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) {
diff --git a/src/components/content/airInfo/childComps/ItemInfo.vue b/src/components/content/airInfo/childComps/ItemInfo.vue
index b0af8f3..d8a7453 100644
--- a/src/components/content/airInfo/childComps/ItemInfo.vue
+++ b/src/components/content/airInfo/childComps/ItemInfo.vue
@@ -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;
// });
-