web
9 天以前 a8dd05927a7ca3b34f7729604744a24375f3549f
fix:修改设备接口
已修改6个文件
已添加1个文件
69 ■■■■ 文件已修改
.env.development 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/screen/monitor/index.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/screen/shebei/index.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/flow/shebei/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/temperature/monitor/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/screen/temperature/shebei/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.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'
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
    })
}
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
    })
}
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';
          // })
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>
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>
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
    })
}