From a8dd05927a7ca3b34f7729604744a24375f3549f Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期四, 10 四月 2025 17:28:34 +0800 Subject: [PATCH] fix:修改设备接口 --- src/utils/request.js | 4 + .env.development | 1 src/api/screen/shebei/index.js | 22 +++++++++++ src/views/screen/flow/shebei/index.vue | 10 ++--- src/api/screen/monitor/index.js | 13 ++++++ src/views/screen/temperature/monitor/index.vue | 11 ++++- src/views/screen/temperature/shebei/index.vue | 8 +-- 7 files changed, 53 insertions(+), 16 deletions(-) diff --git a/.env.development b/.env.development index c742c27..540224b 100644 --- a/.env.development +++ b/.env.development @@ -9,7 +9,6 @@ VITE_APP_IMG_BASEURL='http://192.168.0.200:8036/upload' # 金川接口 - # VITE_APP_PUBLIC_REQUEST_API = 'http://113.250.189.120:8030' # VITE_APP_PUBLIC_REQUEST_API = 'http://113.250.189.120:8036' #后端本地 VITE_APP_PUBLIC_REQUEST_API = 'http://192.168.0.200:8036' diff --git a/src/api/screen/monitor/index.js b/src/api/screen/monitor/index.js new file mode 100644 index 0000000..84429ea --- /dev/null +++ b/src/api/screen/monitor/index.js @@ -0,0 +1,13 @@ +import { publicRequest } from "@/utils/request.js"; + + +/** + * 设置水温监控点 + */ +export const setTempMonitor = (data) => { + return publicRequest({ + url: '/waterTemperature/editIntervalTime', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/screen/shebei/index.js b/src/api/screen/shebei/index.js index 2bff914..0487766 100644 --- a/src/api/screen/shebei/index.js +++ b/src/api/screen/shebei/index.js @@ -12,6 +12,17 @@ } /** + * 获取水温所有设备 + */ +export const getTempShebeiList = (params) => { + return publicRequest({ + url: 'waterTemperature/getFacilityAll', + method: 'get', + params + }) +} + +/** * 获取流量设备菜单 */ export const getFlowMenu = () => { @@ -19,4 +30,15 @@ url: 'waterFlow/getFacilityList', method: 'get', }) +} + +/** + * 获取流量所有设备 + */ +export const getFlowShebeiList = (params) => { + return publicRequest({ + url: 'waterFlow/getFacilityAll', + method: 'get', + params + }) } \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js index 052c672..dc7c3f5 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,6 +1,6 @@ import axios from 'axios' import { ElNotification , ElMessageBox, ElMessage, ElLoading } from 'element-plus' -import { getToken } from '@/utils/auth' +import {getToken, removeToken} from '@/utils/auth' import errorCode from '@/utils/errorCode' import { tansParams, blobValidate } from '@/utils/ruoyi' import cache from '@/plugins/cache' @@ -91,6 +91,8 @@ isRelogin.show = true; ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { isRelogin.show = false; + removeToken() + window.location.reload(); // useUserStore().logOut().then(() => { // location.href = '/index'; // }) diff --git a/src/views/screen/flow/shebei/index.vue b/src/views/screen/flow/shebei/index.vue index 5b383c1..1aab8e1 100644 --- a/src/views/screen/flow/shebei/index.vue +++ b/src/views/screen/flow/shebei/index.vue @@ -2,8 +2,7 @@ import {ref, onMounted} from "vue"; import {getUserType} from '@/utils/auth.js' import facilityApi from "@/api/facility/index"; -import { getFlowMenu } from '@/api/screen/shebei/index.js' -import setPostParams from "@/utils/searchParams.js"; +import { getFlowMenu, getFlowShebeiList } from '@/api/screen/shebei/index.js' import { useRouter } from "vue-router"; const router = useRouter(); const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL; //图片前缀 @@ -29,9 +28,8 @@ // 获取设备 const getDataList = () => { - let postParam = setPostParams() - facilityApi().search({ ...postParam, keywords: searchVal.value }).then(res => { - deviceList.value = res.data.list + getFlowShebeiList({ facilityName: searchVal.value }).then(res => { + deviceList.value = res.data }) } @@ -90,7 +88,7 @@ :value="item.value" /> </el-select> - <el-input v-model="searchVal" style="width: 20rem" placeholder="请输入设备名称" /> + <el-input v-model="searchVal" style="width: 20rem" placeholder="请输入设备名称" clearable /> <el-button @click="getDataList"><el-icon><Search /></el-icon>搜索</el-button> <el-button style="margin-left: 0" v-if="userType === '1'" @click="router.push('/facilityList')"><el-icon><Plus /></el-icon>新增</el-button> </div> diff --git a/src/views/screen/temperature/monitor/index.vue b/src/views/screen/temperature/monitor/index.vue index 931e196..290654a 100644 --- a/src/views/screen/temperature/monitor/index.vue +++ b/src/views/screen/temperature/monitor/index.vue @@ -1,6 +1,7 @@ <script setup> import {ref} from "vue"; import {getUserType} from '@/utils/auth.js' + import {setTempMonitor } from '@/api/screen/monitor/index.js' const userType = ref(getUserType()) const monitorRef = ref() @@ -20,6 +21,10 @@ jilu: '', shuju: '' }) + + const setMonitorData = () => { + + } // 全屏操作 const handleFullScreen = () => { @@ -141,9 +146,9 @@ </div> </div> <div class="item-btn"><el-button size="large" type="success">批量应用</el-button></div> - <div class="item-error"> - <img src="@/assets/images/warning.png" /> - </div> +<!-- <div class="item-error">--> +<!-- <img src="@/assets/images/warning.png" />--> +<!-- </div>--> </div> <div class="item"> <div class="item-t">电站进水口水温监测点</div> diff --git a/src/views/screen/temperature/shebei/index.vue b/src/views/screen/temperature/shebei/index.vue index 3ce6d4e..d6158a2 100644 --- a/src/views/screen/temperature/shebei/index.vue +++ b/src/views/screen/temperature/shebei/index.vue @@ -1,9 +1,8 @@ <script setup> import {ref, onMounted} from "vue"; import facilityApi from "@/api/facility/index"; -import { getTemperatureMenu } from '@/api/screen/shebei/index.js' +import { getTemperatureMenu, getTempShebeiList } from '@/api/screen/shebei/index.js' import {getUserType} from '@/utils/auth.js' -import setPostParams from "@/utils/searchParams.js"; import {useRouter} from "vue-router"; const router = useRouter(); const imgBaseUrl = import.meta.env.VITE_APP_IMG_BASEURL; //图片前缀 @@ -29,9 +28,8 @@ // 获取设备 const getDataList = () => { - let postParam = setPostParams() - facilityApi().search({ ...postParam, keywords: searchVal.value }).then(res => { - deviceList.value = res.data.list + getTempShebeiList({ facilityName: searchVal.value }).then(res => { + deviceList.value = res.data }) } -- Gitblit v1.9.3