diff --git a/src/views/sponeScreen/waterFlood/pumpProcess.vue b/src/views/sponeScreen/waterFlood/pumpProcess.vue index 3e26f3b..04ade75 100644 --- a/src/views/sponeScreen/waterFlood/pumpProcess.vue +++ b/src/views/sponeScreen/waterFlood/pumpProcess.vue @@ -140,7 +140,7 @@ // 获取数据 function getData() { let params = { - stationCode: props.pumpObj.pumpCode, //'BZKFDJG' + stationCode: pumpObj.value.pumpCode, //'BZKFDJG' }; realtimeDataList(params).then(res => { let datas = res.data || {}; @@ -175,11 +175,26 @@ } onMounted(() => { - getData(); - // 定时刷新 - timer.value = setInterval(() => { + if (pumpObj.value.pumpCode == 'hdbz') { + // 假数据,演示用 + realYW.value = 5.19; + pumpList.value = [ + { status: '运行', dl: '88.1A', hour: '33:32:20' }, + { status: '运行', dl: '78.1A', hour: '33:32:20' }, + { status: '运行', dl: '79.1A', hour: '51:30:20' }, + { status: '运行', dl: '45.1A', hour: '04:32:20' }, + { status: '停止', dl: '', hour: '' }, + ]; + mainWater.value = true; + pumpObj.value.rainpump = JSON.stringify({ collectionOut: '东护城河' }); + detailObj.value.tt = '2024-08-20 12:20:32'; + } else { getData(); - }, 5 * 60 * 1000); + // 定时刷新 + timer.value = setInterval(() => { + getData(); + }, 5 * 60 * 1000); + } }); onBeforeUnmount(() => { diff --git a/src/views/sponeScreen/waterFlood/pumpProcess.vue b/src/views/sponeScreen/waterFlood/pumpProcess.vue index 3e26f3b..04ade75 100644 --- a/src/views/sponeScreen/waterFlood/pumpProcess.vue +++ b/src/views/sponeScreen/waterFlood/pumpProcess.vue @@ -140,7 +140,7 @@ // 获取数据 function getData() { let params = { - stationCode: props.pumpObj.pumpCode, //'BZKFDJG' + stationCode: pumpObj.value.pumpCode, //'BZKFDJG' }; realtimeDataList(params).then(res => { let datas = res.data || {}; @@ -175,11 +175,26 @@ } onMounted(() => { - getData(); - // 定时刷新 - timer.value = setInterval(() => { + if (pumpObj.value.pumpCode == 'hdbz') { + // 假数据,演示用 + realYW.value = 5.19; + pumpList.value = [ + { status: '运行', dl: '88.1A', hour: '33:32:20' }, + { status: '运行', dl: '78.1A', hour: '33:32:20' }, + { status: '运行', dl: '79.1A', hour: '51:30:20' }, + { status: '运行', dl: '45.1A', hour: '04:32:20' }, + { status: '停止', dl: '', hour: '' }, + ]; + mainWater.value = true; + pumpObj.value.rainpump = JSON.stringify({ collectionOut: '东护城河' }); + detailObj.value.tt = '2024-08-20 12:20:32'; + } else { getData(); - }, 5 * 60 * 1000); + // 定时刷新 + timer.value = setInterval(() => { + getData(); + }, 5 * 60 * 1000); + } }); onBeforeUnmount(() => { diff --git a/vite.config.js b/vite.config.js index 24dcf41..ea36ec6 100644 --- a/vite.config.js +++ b/vite.config.js @@ -7,8 +7,8 @@ const Timestamp = new Date().getTime(); //随机时间戳 // const targetUrl = 'http://192.168.16.254:7200'; //孙逢时 -const targetUrl = 'http://192.168.20.52:7300'; //杨辉 -// const targetUrl = 'https://server2.wh-nf.cn:8082/prod-api'; //线上 +// const targetUrl = 'http://192.168.20.52:7300'; //杨辉 +const targetUrl = 'https://server2.wh-nf.cn:8082/prod-api'; //线上 // https://vitejs.dev/config/ export default defineConfig(({ mode, command }) => {