邓洁 : 大屏信息接口对接
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
//大屏获取设备信息
|
||||
export const getLargeScreen = (tunnelId) => {
|
||||
return request({
|
||||
url: `/tunnel/large/screen/equipment/${tunnelId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//大屏信息接口
|
||||
export const getLargeScreenInfo = () => {
|
||||
return request({
|
||||
url: '/tunnel/large/screen/info',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
import * as three from "three";
|
||||
import ThreeDScene from "./sceneClass/demo.js";
|
||||
import DevInfo from "./displayInfoComp/DevInfo.vue";
|
||||
import editDialog from "./editEquComp/editDialog.vue";
|
||||
import EditDialog from "./editEquComp/editDialog.vue";
|
||||
|
||||
// 导入模模型加载器
|
||||
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
|
||||
@@ -223,7 +223,7 @@ function handleCancel() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scope>
|
||||
<style lang="scss" scoped>
|
||||
#scene {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
|
||||
@@ -11,24 +11,43 @@
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
default: 0
|
||||
},
|
||||
list: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
})
|
||||
watch(() => props.list, (now) => {
|
||||
let newArr=[]
|
||||
btnList.value.forEach((btnList) => {
|
||||
now.forEach((item) => {
|
||||
if (btnList.route==item) {
|
||||
newArr.push(btnList)
|
||||
}
|
||||
})
|
||||
})
|
||||
btnList.value=newArr
|
||||
}, {deep: true});
|
||||
const emit = defineEmits(["update:modelValue", "select"]);
|
||||
const btnList = ref([
|
||||
{
|
||||
route: '/site',
|
||||
icon: 'sp_icon_zdgl.png',
|
||||
name: '站点管理'
|
||||
},
|
||||
{
|
||||
route: '/tunnel',
|
||||
icon: 'sp_icon_sdgl.png',
|
||||
name: '隧道管理'
|
||||
},
|
||||
{
|
||||
route: '/user',
|
||||
icon: 'sp_icon_yhgl.png',
|
||||
name: '用户管理'
|
||||
},
|
||||
{
|
||||
route: '/system',
|
||||
icon: 'sp_icon_xtgl.png',
|
||||
name: '系统管理'
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div id="main">
|
||||
<div class="box-top">
|
||||
<manage-btn v-model="selectIndex" @select="manageSelect" />
|
||||
<manage-btn v-model="selectIndex" @select="manageSelect" :list="routeList"/>
|
||||
<div class="tunnel-title"></div>
|
||||
<manage-length class="tunnel-length"></manage-length>
|
||||
<div class="top-right">
|
||||
@@ -75,7 +75,7 @@
|
||||
<el-carousel height="150px" type="card" ref="tunnelBtn" :autoplay="false">
|
||||
<div class="btn">
|
||||
<el-carousel-item v-for="item in tunnelList" :key="item.value">
|
||||
{{ item.name }}
|
||||
{{ item.label }}
|
||||
</el-carousel-item>
|
||||
</div>
|
||||
</el-carousel>
|
||||
@@ -98,7 +98,7 @@ import { dateFormat } from "@/utils/date.js";
|
||||
import { onMounted } from "vue";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { useAuthStore } from "@/store/userstore.js";
|
||||
import { getLargeScreen } from "@/api/largeScreen";
|
||||
import { getLargeScreen,getLargeScreenInfo } from "@/api/largeScreen";
|
||||
import {ElMessageBox} from "element-plus";
|
||||
|
||||
const authStore = useAuthStore();
|
||||
@@ -111,32 +111,8 @@ const currentSite = ref("松江站");
|
||||
const currentUser = ref("admin");
|
||||
const currentDate = ref(dateFormat());
|
||||
const tunnelBtn = ref();
|
||||
const tunnelList = ref([
|
||||
{
|
||||
value: 0,
|
||||
name: "一号隧道",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
name: "二号隧道",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
name: "三号隧道",
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
name: "四号隧道",
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
name: "五号隧道",
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
name: "六号隧道",
|
||||
},
|
||||
]);
|
||||
const tunnelList = ref([]);
|
||||
const routeList = ref([]);
|
||||
let socket = reactive("");
|
||||
const serialNumber = ref("SC00DY00GH00ELBT");
|
||||
let token = getToken();
|
||||
@@ -154,9 +130,19 @@ onMounted(() => {
|
||||
nextTick(() => {
|
||||
showFan.value = true;
|
||||
});
|
||||
getOtherInfo()
|
||||
getScreenInfo();
|
||||
});
|
||||
|
||||
const getOtherInfo = async () => {
|
||||
await getLargeScreenInfo().then((res) => {
|
||||
if (res?.code === 1000) {
|
||||
routeList.value=res.data.routeList
|
||||
currentSite.value=res.data.siteOption[0].label
|
||||
tunnelList.value=res.data.tunnelOption
|
||||
}
|
||||
});
|
||||
};
|
||||
const getScreenInfo = async () => {
|
||||
await getLargeScreen(1).then((res) => {
|
||||
if (res?.code === 1000) {
|
||||
|
||||
Reference in New Issue
Block a user