web
4 天以前 8e38cc8536cfda9b6bda8548d63778cbf5f4d634
src/views/screen/flow/shebei/index.vue
@@ -2,11 +2,10 @@
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; //图片前缀
const menuList = ref([])
const deviceList = ref([])
@@ -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,9 +88,9 @@
                            :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>
                    <el-button style="margin-left: 0" v-if="userType === '1'" @click="router.push('/monitorList')"><el-icon><Plus /></el-icon>新增</el-button>
                </div>
                <div class="tool-r" @click="handleFullScreen">
                    <img src="@/assets/images/flow/fullscreen.png" />
@@ -107,7 +105,7 @@
                            <div>{{item.facilityCode}}</div>
                        </div>
                        <div class="item-img">
                            <img v-if="item.image" :src="VITE_APP_IMG_BASEURL + item.image" alt="" />
                            <img v-if="item.facilityUrl" :src="imgBaseUrl + item.facilityUrl" alt="" />
                        </div>
                        <div class="item-info">
                            <div class="online">设备在线状态: <span :style="{color: item.isOnline ? '#56d12c' : '#bababa'}">{{item.isOnline ? '在线' : '掉线'}}</span></div>
@@ -123,7 +121,7 @@
                            <div>{{item.facilityCode}}</div>
                        </div>
                        <div class="item-img">
                            <img v-if="item.image" :src="VITE_APP_IMG_BASEURL + item.image" alt="" />
                            <img v-if="item.facilityUrl" :src="imgBaseUrl + item.facilityUrl" alt="" />
                        </div>
                        <div class="item-info">
                            <div class="online">设备在线状态: <span :style="{color: item.isOnline ? '#56d12c' : '#bababa'}">{{item.isOnline ? '在线' : '掉线'}}</span></div>
@@ -139,7 +137,7 @@
                            <div>{{item.facilityCode}}</div>
                        </div>
                        <div class="item-img">
                            <img v-if="item.image" :src="VITE_APP_IMG_BASEURL + item.image" alt="" />
                            <img v-if="item.facilityUrl" :src="imgBaseUrl + item.facilityUrl" alt="" />
                        </div>
                        <div class="item-info">
                            <div class="online">设备在线状态: <span :style="{color: item.isOnline ? '#56d12c' : '#bababa'}">{{item.isOnline ? '在线' : '掉线'}}</span></div>
@@ -195,7 +193,6 @@
        flex-shrink: 0;
        width: 80%;
        height: 100%;
        background: linear-gradient( 180deg, #91BDDB 0%, rgba(102, 102, 102, 0.5) 100%);
        .monitor-tool{
            width: 100%;
            height: 60px;
@@ -224,6 +221,7 @@
        .monitor-box{
            height: calc(100% - 60px);
            padding-top: 10px;
            background: linear-gradient(180deg, #91BDDB 0%, rgba(102, 102, 102, 0.5) 100%);
            .list{
                height: 100%;
                padding: 0 30px;