diff --git a/.env.development b/.env.development index d59e51c..043d5bc 100644 --- a/.env.development +++ b/.env.development @@ -3,5 +3,5 @@ VITE_BASE_URL='/api' # VITE_BASE_URL='http://192.168.101.7:8000' -#VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api' +#VITE_BASE_WSURL='ws://tunnel.feashow.com/api' VITE_BASE_WSURL='/websocket' diff --git a/.env.production b/.env.production index 4c27cb7..c545c78 100644 --- a/.env.production +++ b/.env.production @@ -4,5 +4,5 @@ VITE_TITLE='fateverse' VITE_BASE_URL='/api' -#VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api' +#VITE_BASE_WSURL='ws://tunnel.feashow.com/api' VITE_BASE_WSURL='/websocket' diff --git a/package.json b/package.json index 8f2339d..58f53c4 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.3.1", - "autofit.js": "^3.0.4", + "autofit.js": "^3.2.1", "axios": "^1.4.0", "csv-exportor": "^1.0.2", "echarts": "^5.4.2", diff --git a/src/api/largeScreen.js b/src/api/largeScreen.js index f914bb3..92c62d3 100644 --- a/src/api/largeScreen.js +++ b/src/api/largeScreen.js @@ -38,7 +38,7 @@ export const getEchartsInfo = (id,time,type,startTime,endTime) => { // 有害气体echarts数据 export const getBadGasEchartsInfo = (id,time,type,startTime,endTime) => { return request({ - url: '/tunnel/large/screen/echarts/gas/sensor/', + url: '/tunnel/large/screen/echarts/gas/sensor', method: 'get', params: { id: id, @@ -128,3 +128,59 @@ export const deleteAlarmSate = (tunnelAlarmIdList) => { method: 'delete' }) } +// 传感器模拟echarts数据 +export const getSimulationEchartsInfo = (id,time,type,startTime,endTime) => { + return request({ + url: '/tunnel/simulation/large/screen/echarts/sensor', + method: 'get', + params: { + id: id, + time: time, + type: type, + startTime:startTime, + endTime:endTime, + } + }) +} +// 有害气体模拟echarts数据 +export const getSimulationBadGasEchartsInfo = (id,time,type,startTime,endTime) => { + return request({ + url: '/tunnel/simulation/large/screen/echarts/gas/sensor', + method: 'get', + params: { + id: id, + time: time, + type: type, + startTime:startTime, + endTime:endTime, + } + }) +} +//开始 模拟 +export const startSimulation = (projectId) => { + return request({ + url: `/tunnel/simulation/start/${projectId}`, + method: 'get' + }) +} +//模拟状态 +export const simulationState = (projectId) => { + return request({ + url: `/tunnel/simulation/state/${projectId}`, + method: 'get' + }) +} +// 结束模拟 +export const endSimulation = (projectId) => { + return request({ + url: `/tunnel/simulation/stop/${projectId}`, + method: 'get' + }) +} +//模拟爆破 +export const blastingSimulation = (projectId,level) => { + return request({ + url: `/tunnel/simulation/blasting/${projectId}/${level}`, + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/tunnelManage.js b/src/api/tunnelManage.js index c9e0472..14042b4 100644 --- a/src/api/tunnelManage.js +++ b/src/api/tunnelManage.js @@ -84,3 +84,54 @@ export const getSerialNumberOnUse = (tunnelId) => { } }) } + + +//模拟隧道 +export const getSimulateTunnelList = (params) => { + return request({ + url: '/tunnel/simulate', + method: 'get', + params + }) +} +export const getSimulateTunnelDetail = (projectId) => { + return request({ + url: `/tunnel/simulate/${projectId}`, + method: 'get' + }) +} +export const addSimulateTunnel = (data) => { + return request({ + url: '/tunnel/simulate', + method: 'post', + data + }) +} + +export const editSimulateTunnel = (data) => { + return request({ + url: '/tunnel/simulate/edit', + method: 'post', + data + }) +} + +export const editSimulateEquipment = (data) => { + return request({ + url: '/tunnel/simulate', + method: 'put', + data + }) +} +export const deleteSimulateTunnel = (projectIdList) => { + return request({ + url: `/tunnel/simulate/${projectIdList}`, + method: 'delete' + }) +} +export const getScreenSimulateTunnel = (projectId) => { + return request({ + url: `/tunnel/simulate/equipment/${projectId}`, + method: 'get' + }) +} \ No newline at end of file diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index 94b3b54..5e6cef9 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -36,10 +36,10 @@
导出
- + @@ -62,7 +62,7 @@ import ItemInfo from "./childComps/ItemInfo.vue"; import TimeRangeBtn from "@/components/timeRangeBtn/index.vue" import * as echarts from 'echarts'; -import {getEchartsInfo} from "@/api/largeScreen"; +import {getEchartsInfo, getSimulationEchartsInfo} from "@/api/largeScreen"; import ChooseDay from "@/components/chooseDates/index.vue" import ChooseMonth from "@/components/chooseMonth/index.vue" import elementResizeDetectorMaker from "element-resize-detector"; @@ -74,13 +74,15 @@ let myEcharts = reactive({}); const props = defineProps({ list: Array, windSpeed: Array, - airData: Array + airData: Array, + isSimulate: Boolean, }); const isFullScreen = ref(false); 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) @@ -94,11 +96,12 @@ const dialogTitle = ref('风速') const openDialogId = ref(0) const airList = ref([]) const timeList = ref(["年", "月", "日"]); -const selectTimeButton = ref(2); +const timeSimulateList = ref(["日"]); const isWindSpeedVisited = ref(false); const showSpeedLoading = ref(false) const clickMonth = ref('') const clickDay = ref('') +const selectTimeButton = ref(props.isSimulate?0:2); watch(() => props.windSpeed, (now) => { now.forEach(newItem => { windSpeed.value =newItem.value @@ -107,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) { @@ -248,29 +251,56 @@ const getChartInfo = (equipmentId, type = 'day', time = '', flag, startTime, end } } }) - getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { - if (res?.code === 1000) { - showSpeedLoading.value = false - chartData = res.data - nextTick(() => { - if (flag) { - const fanChart = document.getElementById('containerWind') - const erd = elementResizeDetectorMaker(); - erd.listenTo(document.getElementById('airDialog'), (element) => { - fanChart.style.height = element.offsetHeight - 140 + 'px' - myEcharts.resize(); - }); - if (isFullScreen.value) { - initChart(res.data.dates, res.data.values, dataZoomTop) + if(props.isSimulate){ + + getSimulationEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showSpeedLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('containerWind') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('airDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() } - } else { - shrinkScreen() - } - }) - } else { - loadingText.value = res.msg - } - }) + }) + } else { + loadingText.value = res.msg + } + }) + }else{ + getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showSpeedLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('containerWind') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('airDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() + } + }) + } else { + loadingText.value = res.msg + } + }) + } nextTick(() => { loadingText.value = '加载中...' }) 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; // }); - diff --git a/src/components/content/tunnelScene/TunnelSceneSimulate.vue b/src/components/content/tunnelScene/TunnelSceneSimulate.vue new file mode 100644 index 0000000..8004e9a --- /dev/null +++ b/src/components/content/tunnelScene/TunnelSceneSimulate.vue @@ -0,0 +1,481 @@ + + + + + diff --git a/src/components/content/tunnelScene/sceneClass/demo.js b/src/components/content/tunnelScene/sceneClass/demo.js index db94b11..571de53 100644 --- a/src/components/content/tunnelScene/sceneClass/demo.js +++ b/src/components/content/tunnelScene/sceneClass/demo.js @@ -10,11 +10,11 @@ import { import { saveState, resetState } from "./viewBack"; import addFunction from "./addEvent"; import { editTunnelInit } from "./editTunnelInit"; -import { addEquipment, removeEquipment } from "./editEquipment"; +import { addEquipment, removeEquipment,clearTunnelEquipments } from "./editEquipment"; import previewtunnelModeInit from "./previewTunnelInit"; import { StreetSignTag } from "./utils/StreetSignTag/StreetSignTag.js"; -// import { fa } from "element-plus/es/locale/index.js"; -// import { ref } from "vue"; +import { realTimeRenderData } from "./realTimeRerender"; + export default class Demo { // 摄像机看向位置s origin = null; @@ -35,7 +35,8 @@ export default class Demo { this.removeEquipment = removeEquipment; this.previewtunnelModeInit = previewtunnelModeInit; this.editTunnelInit = editTunnelInit; - + this.realTimeRenderData = realTimeRenderData; + this.clearTunnelEquipments = clearTunnelEquipments; // 外部可添加函数 this.addFunction = addFunction; this.THREE = three; @@ -205,7 +206,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 轨道控制器 @@ -253,7 +259,9 @@ export default class Demo { const raycaster = new this.THREE.Raycaster(); raycaster.setFromCamera(mouse, this.camera); const intersects = raycaster.intersectObjects(hoverModels); + if (intersects.length > 0) { + if(Object.keys(intersects[0].object).includes('enableHover') && !intersects[0].object.enableHover)return; if (!this.preHover) { this.preHover = intersects[0].object; } else { @@ -328,6 +336,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(); @@ -354,7 +363,6 @@ export default class Demo { this.CSS2Renderer = new CSS2Renderer(); this.CSS2Renderer.setSize(window.innerWidth, window.innerHeight - 100); this.CSS2Renderer.render(this.scene, this.camera); - this.mountedElement.appendChild(this.CSS2Renderer.domElement); // 初始化html标签 diff --git a/src/components/content/tunnelScene/sceneClass/editEquipment/index.js b/src/components/content/tunnelScene/sceneClass/editEquipment/index.js index 674d5ed..a969b50 100644 --- a/src/components/content/tunnelScene/sceneClass/editEquipment/index.js +++ b/src/components/content/tunnelScene/sceneClass/editEquipment/index.js @@ -1,4 +1,4 @@ -import Demo from "../demo"; +import { eq } from "lodash"; import EquipmentTag from "../utils/EquipmentTag"; /** * @@ -34,7 +34,7 @@ function addEquipment(targetPoint, formInfo, fanData) { } //判断墙是否已经存在,如果存在的话,就不管,添加则无效嘛(就是说只能添加一面墙,如果存在一面墙,则不管了) -let hasWall = false +let hasWall = false; let wallHang = 0; // function handleValveEqu(targetPoint, equipmentInfo) { @@ -49,8 +49,15 @@ function handleOtherEqu(targetPoint, equipmentInfo) { equMesh.position.copy(worldP); //设备添加标签 - const tag = EquipmentTag(equipmentInfo.equipmentName); + const param = `${equipmentInfo.data || "--"} ${equipmentInfo.unit || "-"}`; //渲染设备参数(data)和单位(unit) + const tag = EquipmentTag(equipmentInfo.equipmentName, param); equMesh.getObjectByName("tag").material = tag; + this.deviceModels.push({ + tagSpriteId: equMesh.getObjectByName("tag").id, + equipmentId: equipmentInfo.equipmentId, + objId: equMesh.id, + }); + this.realTimeRenderData(231321); if (/tr$/.test(targetPoint.name)) { equMesh.rotation.z = -Math.PI / 2; equMesh.rotation.y -= Math.PI / 4; @@ -195,11 +202,10 @@ function handleFanEqu( if (item.isMesh) { item.material = item.material.clone(); } - }) + }); // equMesh.geometry = this.equMap.get("equ_fan").geometry.clone(); // console.log(equMesh); - const worldP = targetPoint.getWorldPosition(new this.THREE.Vector3()); equMesh.position.copy(worldP); equMesh.translateY(-0.6); @@ -213,15 +219,13 @@ function handleFanEqu( ...equipmentInfo, }; //我们把风机的附着点挂在原型上,这样应该可以进行处理 - if (targetPoint.info.equipmentName.slice(0, 1) == '1') { - this.scene.Fan1targetPoint = targetPoint + if (targetPoint.info.equipmentName.slice(0, 1) == "1") { + this.scene.Fan1targetPoint = targetPoint; } else { - this.scene.Fan2targetPoint = targetPoint + this.scene.Fan2targetPoint = targetPoint; } //这里感觉情况改变风机的颜色 - changeFanColor(fanData, targetPoint, this.scene) - - + changeFanColor(fanData, targetPoint, this.scene); // 定义风机旋转 const fanLeaf = equMesh.getObjectByName("fan_leafs"); @@ -233,6 +237,11 @@ function handleFanEqu( fanLeaf.rotation.z = obj.rotation; }); this.fanSpinArray.push(fanSpin); + this.deviceModels.push({ + tagSpriteId: "", + equipmentId: equipmentInfo.equipmentId, + objId: equMesh.id, + }); } // 删除传感器 @@ -240,7 +249,6 @@ function removeEquipment(targetPoint) { //删除设备这里需要再进行处理,就是根据附着点(附着点一定保存了当前添加设备的信息了)判断是不是分压阀,然后继续一样的隐藏 if (!targetPoint.hasDevice) return; - //删除我们这里使用行数来判断,即是不是删除到了我们的那一行呢? //如果删除到了我们那行的话,我们必须将行的数组从中去掉已存在的数据,然后将附着点列表中也去除这个点,然后将墙设置为false来让下次使用 @@ -286,8 +294,6 @@ function removeEquipment(targetPoint) { // } // deleteItem(Allhang, Number(lineIndex)) - - console.log("测试是不是删除了"); const mesh = this.scene.getObjectById(targetPoint.info.id); this.scene.remove(mesh); @@ -298,13 +304,12 @@ function removeEquipment(targetPoint) { } export { addEquipment, removeEquipment }; - function deleteItem(array, item) { let index = array.indexOf(item); if (index !== -1) { array.splice(index, 1); } - return array + return array; } // 这里是改变风机颜色的代码 @@ -315,7 +320,7 @@ function changeFanColor(fanData, targetPoint, scene) { //if保证存在风机(即有长度再进行遍历) for (let i = 0; i < fanData.length; i++) { //先做匹配操作 - let fanType = fanData[i].equipmentType + let fanType = fanData[i].equipmentType; //有符合条件的风机进来了 if (targetPoint.info.typeKey == fanType) { //下面进行变色需要的逻辑判断了 @@ -327,9 +332,9 @@ function changeFanColor(fanData, targetPoint, scene) { // console.log(obj); // 判断子对象是否是物体,如果是,更改其颜色 if (obj.isMesh) { - obj.material.color.set(0xFF0000) + obj.material.color.set(0xff0000); } - }) + }); } }); } else { @@ -342,9 +347,9 @@ function changeFanColor(fanData, targetPoint, scene) { // console.log(obj); // 判断子对象是否是物体,如果是,更改其颜色 if (obj.isMesh) { - obj.material.color.set(0x008000) + obj.material.color.set(0x008000); } - }) + }); } }); } else { @@ -356,4 +361,21 @@ function changeFanColor(fanData, targetPoint, scene) { } } } -} \ No newline at end of file +} + +export function clearTunnelEquipments() { + if (this.group) this.scene.remove(this.group); + if (this.scene.getObjectByName("boxHelper")) { + const preModel = this.scene.getObjectByName("boxHelper"); + this.scene.remove(preModel); + } + this.scene.traverse(function (point) { + if (/^point/.test(point.name)) { + point.hasDevice = false; + } + }); + this.deviceModels.forEach((deviceModel) => { + this.scene.remove(this.scene.getObjectById(deviceModel.objId)); + }); + this.deviceModels = []; +} diff --git a/src/components/content/tunnelScene/sceneClass/editTunnelInit/index.js b/src/components/content/tunnelScene/sceneClass/editTunnelInit/index.js index b460c9c..7df7d7d 100644 --- a/src/components/content/tunnelScene/sceneClass/editTunnelInit/index.js +++ b/src/components/content/tunnelScene/sceneClass/editTunnelInit/index.js @@ -1,6 +1,16 @@ export function editTunnelInit(equipmentList) { + // 清空设备 + this.clearTunnelEquipments(); //初始化将墙壁隐藏起来 equipmentList.forEach((item) => { - this.addEquipment(this.scene.getObjectByName(item.position), item, 1); + // 根据定位获取附着点信息 + const target = this.scene.getObjectByName(item.position); + this.addEquipment(target, item, 1); + }); + this.scene.traverse(function (point) { + if (/^point/.test(point.name)) { + point.enableHover = + equipmentList.findIndex((item) => item.position === point.name) >= 0; + } }); } diff --git a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js index 7d39f34..e0b34a9 100644 --- a/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js +++ b/src/components/content/tunnelScene/sceneClass/handleRLclick/handleLhover.js @@ -1,4 +1,5 @@ export function handleLHover(targetPoint) { + // if(Object.keys(targetPoint).includes('enableHover') && !targetPoint.enableHover)return; if (this.tag3CSS2DObj.element.style.opacity != '1') { // 保存进入状态 this._saveState(); 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(); //获取附着点的世界坐标系 diff --git a/src/components/content/tunnelScene/sceneClass/previewTunnelInit/index.js b/src/components/content/tunnelScene/sceneClass/previewTunnelInit/index.js index 4664584..d9d4cbf 100644 --- a/src/components/content/tunnelScene/sceneClass/previewTunnelInit/index.js +++ b/src/components/content/tunnelScene/sceneClass/previewTunnelInit/index.js @@ -11,7 +11,6 @@ export default function previewtunnelModeInit(equipmentList, fanData) { // } // } // console.log(equipmentList); - equipmentList.forEach((item) => { this.addEquipment(this.scene.getObjectByName(item.position), item, fanData); }); diff --git a/src/components/content/tunnelScene/sceneClass/realTimeRerender/index.js b/src/components/content/tunnelScene/sceneClass/realTimeRerender/index.js new file mode 100644 index 0000000..d492222 --- /dev/null +++ b/src/components/content/tunnelScene/sceneClass/realTimeRerender/index.js @@ -0,0 +1,5 @@ +export function realTimeRenderData(realTimeData) { + this.deviceModels.forEach((deviceModel) => { + this.scene.getObjectById(deviceModel.tagSpriteId); + }); +} diff --git a/src/components/content/usedEle/UsedEle.vue b/src/components/content/usedEle/UsedEle.vue index e8298c5..3a1f2fc 100644 --- a/src/components/content/usedEle/UsedEle.vue +++ b/src/components/content/usedEle/UsedEle.vue @@ -233,20 +233,21 @@ const changeNum = (item) => { } } const setValueA = () => { - if (electricityConsumptionMonthly.value === 0 || length.value === null) { + if (electricityConsumptionMonthly.value === 0 || length.value === null||electricityConsumptionMonthly.value<0) { valueA.value.style.height = `0px`; } - let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) / 200000; + let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) / 1000000; valueA.value.style.height = `${width}px`; } const setValueB = () => { - if (monthlySavings.value === 0 || length.value === null) { + if (monthlySavings.value === 0 || length.value === null||monthlySavings.value<0) { valueB.value.style.height = `0px`; } - let width = (monthlySavings.value * length.value?.offsetHeight) / 200000; + let width = (monthlySavings.value * length.value?.offsetHeight) / 1000000; valueB.value.style.height = `${width}px`; } const getBasicData = (data) => { + if(!data)return; electricityConsumptionMonthly.value = data.electricityConsumptionCount monthlySavings.value = data.conserveElectricityCount } diff --git a/src/components/content/windPressure/WindPressureList.vue b/src/components/content/windPressure/WindPressureList.vue index b8272c2..94e4b05 100644 --- a/src/components/content/windPressure/WindPressureList.vue +++ b/src/components/content/windPressure/WindPressureList.vue @@ -26,10 +26,10 @@
导出
- + @@ -52,7 +52,7 @@ import WindPressureItem from "./childComps/WindPressureItem.vue"; import TimeRangeBtn from "@/components/timeRangeBtn/index.vue" import * as echarts from 'echarts'; -import {getEchartsInfo} from "@/api/largeScreen"; +import {getEchartsInfo, getSimulationEchartsInfo} from "@/api/largeScreen"; import ChooseDay from "@/components/chooseDates/index.vue" import ChooseMonth from "@/components/chooseMonth/index.vue" import elementResizeDetectorMaker from "element-resize-detector"; @@ -63,6 +63,7 @@ const props = defineProps({ list: Array, winData: Array, loading: Number, + isSimulate: Boolean, }); const loadingText = ref('加载中...') const chooseDayRef = ref(); @@ -70,7 +71,7 @@ const chooseMonthRef = ref(); const windSort = ref(1) const windSortId = ref(1) const timeList = ref(["年", "月", "日"]); -const selectTimeButton = ref(2); +const timeSimulateList = ref(["日"]); const isVisited = ref(false); const isFullScreen = ref(false); let chartData = reactive([]) @@ -80,6 +81,7 @@ let myEcharts = reactive({}); const wpList = ref([]); const clickMonth = ref('') const clickDay = ref('') +const selectTimeButton = ref(props.isSimulate?0:2); watch(() => props.list, (now) => { wpList.value.forEach(item => { now.forEach(newItem => { @@ -201,29 +203,57 @@ const getWindInfo = (equipmentId, type = 'day', time = '', flag, startTime, endT } } }) - getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { - if (res?.code === 1000) { - showLoading.value = false - chartData = res.data - nextTick(() => { - if (flag) { - const fanChart = document.getElementById('container') - const erd = elementResizeDetectorMaker(); - erd.listenTo(document.getElementById('windDialog'), (element) => { - fanChart.style.height = element.offsetHeight - 140 + 'px' - myEcharts.resize(); - }); - if (isFullScreen.value) { - initChart(res.data.dates, res.data.values, dataZoomTop) + if(props.isSimulate) { + getSimulationEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('container') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('windDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() } - } else { - shrinkScreen() - } - }) - } else { - loadingText.value = res.msg - } - }) + }) + } else { + loadingText.value = res.msg + } + }) + + }else{ + getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => { + if (res?.code === 1000) { + showLoading.value = false + chartData = res.data + nextTick(() => { + if (flag) { + const fanChart = document.getElementById('container') + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById('windDialog'), (element) => { + fanChart.style.height = element.offsetHeight - 140 + 'px' + myEcharts.resize(); + }); + if (isFullScreen.value) { + initChart(res.data.dates, res.data.values, dataZoomTop) + } + } else { + shrinkScreen() + } + }) + } else { + loadingText.value = res.msg + } + }) + + } nextTick(() => { loadingText.value = '加载中...' }) diff --git a/src/components/deviceManage/index.vue b/src/components/deviceManage/index.vue new file mode 100644 index 0000000..15ca2c9 --- /dev/null +++ b/src/components/deviceManage/index.vue @@ -0,0 +1,738 @@ + + + + + diff --git a/src/components/manageBtn/index.vue b/src/components/manageBtn/index.vue index 08f1ac2..f18182e 100644 --- a/src/components/manageBtn/index.vue +++ b/src/components/manageBtn/index.vue @@ -51,10 +51,11 @@ const btnList = ref([ // icon: 'sp_icon_xtgl.png', // name: '系统管理' // }, - // { - // icon: 'sp_icon_mngl.png', - // name: '模拟仿真' - // }, + { + route: '/simulate', + icon: 'sp_icon_mngl.png', + name: '模拟仿真' + }, ]) const newList=ref([]) const selectButton = ref(props.modelValue); diff --git a/src/store/modelSceneStore.js b/src/store/modelSceneStore.js index 9999244..d70e7e0 100644 --- a/src/store/modelSceneStore.js +++ b/src/store/modelSceneStore.js @@ -44,7 +44,7 @@ export const useModelSceneStore = defineStore("modelSceneData", () => { return new Promise((resolve, reject) => { initSceneData(tunnelId) .then((res) => { - console.info("🚀 ~method:initSceneData -----", res) + // console.info("🚀 ~method:initSceneData -----", res) serialNumber.value=res.data.serialNumber serialNumberPrefix.value=res.data.serialNumberPrefix tunnelGatewayDtoList.value=res.data.tunnelGatewayVoList diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index e737004..e7633ad 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -76,7 +76,7 @@ const handleSend = () => { const initWebSocket = () => { // let wsUrl = `ws://192.168.31.176:9000/websocket/debug/${token}/${serialNumber.value}` // let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`; - let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/debug/${token}/${serialNumber.value}` + let wsUrl = `ws://tunnel.feashow.com/api/wstunnel/websocket/debug/${token}/${serialNumber.value}` console.log(wsUrl) socket = new WebSocket(wsUrl) //连接发生错误的回调方法 diff --git a/src/views/tunnel-simulate/index.vue b/src/views/tunnel-simulate/index.vue index 5b8137a..f3cf7fe 100644 --- a/src/views/tunnel-simulate/index.vue +++ b/src/views/tunnel-simulate/index.vue @@ -1,13 +1,14 @@