修改路由

dev
夜笙歌 1 year ago
parent 76a99b2d02
commit 84ff613e36

@ -44,3 +44,13 @@ export function getDeviceOperations(query) {
method: 'get',
})
}
// 问题处理
export function handleAlarmInfo(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/handleAlarmInfo',
method: 'put',
data:query
})
}

@ -2,7 +2,8 @@
<div>
<div class="title">智慧物联监控平台</div>
<div>
<div v-if="isIndex" :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%" @click="toLink('index')">
<div v-if="isIndex" :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%"
@click="toLink('index','1')">
<span>
监控主页
</span>
@ -21,12 +22,13 @@
</el-dropdown-menu>
</el-dropdown>
</div>
<div :class="`menu ${nowMenu==='3'? 'menuClick' :''}`" style="left: 16%" @click="toLink('equipment')">
<div :class="`menu ${nowMenu==='3'? 'menuClick' :''}`" style="left: 16%" @click="toLink('equipment','3')">
<span>
设备监测
</span>
</div>
<div :class="`menu ${nowMenu==='4'? 'menuClick' :''}`" style="left: 23%" @click="toLink('equipmentMonitoring')">
<div :class="`menu ${nowMenu==='4'? 'menuClick' :''}`" style="left: 23%"
@click="toLink('equipmentMonitoring','4')">
<span>
传感器汇总
</span>
@ -50,24 +52,26 @@ import {
} from '@/api/board/nav'
export default {
name: 'BoardTopNav',
data() {
return {
selectSecnesList: [],
name: '智慧场景',
isIndex: true,
sceneId: this.$store.getters.sceneId,
nowMenu: '1'
}
},
props: {
nowMenu: {
type: String,
default: '1'
},
},
// props: {
// nowMenu: {
// type: String,
// default: '1'
// },
// },
async mounted() {
if (this.$route.name === 'SmartScene' || this.$route.name === 'GPS' || this.$route.name === 'index' || this.$store.getters.sceneId) {
}else{
} else {
await this.$router.replace({path: "/board/index"});
}
await this.setSelectSecnes()
@ -101,20 +105,20 @@ export default {
this.sceneId = data.find(e => e.sceneName === this.$route.query.name).sceneId
this.name = data.find(e => e.sceneName === this.$route.query.name).sceneName
}
this.$emit('sceneIdChange', this.sceneId);
if (this.name === '智慧场景' && this.$store.getters.sceneId) {
this.name = data.find(e => e.sceneId === this.$store.getters.sceneId).sceneName
}
await this.$store.dispatch('app/setSceneId', this.sceneId)
},
// sceneIdChange(){
//
// },
toLink(e) {
toLink(e, nowMenu) {
this.nowMenu = nowMenu
this.$router.replace({path: "/board/" + e});
},
async dropdownLink(e) {
async dropdownLink(e,) {
this.nowMenu = '2'
await this.$store.dispatch('app/setSceneId', e.sceneId)
this.$emit('sceneIdChange', e.sceneId);
this.name = e.name
this.$router.replace({path: "/board/" + (e.router || 'smartScene'), query: {name: e.name}});
await this.$router.replace({path: "/board/" + (e.router || 'smartScene'), query: {name: e.name}});
},
toIndex() {
this.$router.replace({path: "/index"});

@ -1,16 +1,22 @@
<template>
<div>
<app-main/>
<!-- <app-main/>-->
<router-view> </router-view>
<div style="z-index: 99999;">
<BoardTopNav/>
</div>
</div>
</template>
<script>
import {AppMain} from './components'
import BoardTopNav from "@/components/BoardTopNav";
export default {
name: 'BoardIndex',
components: {
AppMain,
BoardTopNav
},
}
</script>

@ -1,7 +1,6 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="2" @sceneIdChange="sceneIdChange"></BoardTopNav>
<Chart ref="chart1" class="chart1"></Chart>
<div class="table1">
<div style="background-color: #094170">
@ -43,7 +42,7 @@
{{ item.value3 }}
</div>
<div class="scrollTable" style="width: 25%">
<el-button v-if="item.status === '0'" size="mini" type="primary" @click="dispose"></el-button>
<el-button v-if="item.status === '0'" size="mini" type="primary" @click="dispose(item)"></el-button>
<span v-else></span>
</div>
</div>
@ -66,7 +65,6 @@
<script>
import Chart from "@/components/Charts/Chart";
import BoardTopNav from '@/components/BoardTopNav'
import vueSeamlessScroll from "vue-seamless-scroll";
import * as echarts from 'echarts';
import {
@ -77,6 +75,7 @@ import {
} from '@/api/board/GPS'
import red from '@/assets/board/GPS/red.png'
import green from '@/assets/board/GPS/green.png'
import {handleAlarmInfo} from "@/api/board/index";
let map = null
let polyEditor = null
@ -84,7 +83,6 @@ export default {
components: {
Chart,
vueSeamlessScroll,
BoardTopNav
},
data() {
return {
@ -137,13 +135,10 @@ export default {
sceneId: 0,
}
},
mounted() {
async mounted() {
await this.getData()
},
methods: {
sceneIdChange(e) {
this.sceneId = e
this.getData()
},
async getData() {
await this.createMap()
await this.getAlarmStats()
@ -151,16 +146,28 @@ export default {
await this.setAlarmInfos()
await this.setElectronicNumVo()
},
dispose() {
dispose(e) {
this.$confirm('该问题已处理?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '已处理!'
});
handleAlarmInfo({
alarmInfoId:e.no
}).then(e=>{
if(e.code === 200){
this.$message({
type: 'success',
message: '已处理!'
});
this.setTable3()
}else{
this.$message({
type: 'info',
message: '网络错误'
});
}
})
}).catch(() => {
this.$message({
type: 'info',

@ -1,7 +1,6 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="3"></BoardTopNav>
<div class="leftMenu">
<div v-for="i in 10" class="item">
<span>温度传感器</span>
@ -27,11 +26,9 @@
<script>
import BoardTopNav from '@/components/BoardTopNav'
export default {
components: {
BoardTopNav
},
data() {
return {

@ -2,7 +2,6 @@
<div class="container">
<div class="title1">监控单元</div>
<div class="centerImg"></div>
<BoardTopNav ref="boardTopNav" nowMenu="3" @sceneIdChange="sceneIdChange"></BoardTopNav>
<div class="title">监控单元</div>
<div class="tree">
@ -63,11 +62,11 @@
<div class="rightBg">
<div class="title">{{ i.deviceName }}</div>
<div style="position: absolute;left: 24%;top: 0px;width: 75%;height: 100%;">
<div v-for="val in Object.keys(i.deviceDataMaps[0])" class="infoItem">
<div class="span">{{ val }}:</div>
<div class="spanBg"></div>
<div class="num">{{ i.deviceDataMaps[0][val] }}</div>
</div>
<!-- <div v-for="val in Object.keys(i.deviceDataMaps[0])" class="infoItem">-->
<!-- <div class="span">{{ val }}:</div>-->
<!-- <div class="spanBg"></div>-->
<!-- <div class="num">{{ i.deviceDataMaps[0][val] }}</div>-->
<!-- </div>-->
</div>
<div class="btn">
<div class="btnC" style="top: 50%">
@ -89,12 +88,10 @@ import {
getMonitorById
} from '@/api/board/equipment'
import BoardTopNav from '@/components/BoardTopNav'
let getDeviceInterval = null
export default {
components: {
BoardTopNav
},
data() {
return {
@ -113,14 +110,14 @@ export default {
}
},
async mounted() {
await this.getData()
this.sceneId = this.$store.getters.sceneId
if(this.$route.query.monitorUnitId){
this.deviceId = this.$route.query.monitorUnitId
await this.treeClick({id:this.$route.query.monitorUnitId})
}
},
methods: {
sceneIdChange(e) {
this.sceneId = e
this.getData()
},
async getData() {
await this.getTree()
},
@ -163,7 +160,6 @@ export default {
},
async getDevice(e) {
const {data} = await selectDevicesByMonitorUnitId(e, this.$store.getters.sceneId)
console.log(data)
this.deviceId = e
this.controlList = data.control
this.acquisitionList = data.acquisition
@ -441,7 +437,7 @@ export default {
.btnC {
position: absolute;
left: 50%;
transform: translate(-50%, 50%);
transform: translate(-50%, -50%);
}
}
}

@ -1,9 +1,8 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav @sceneIdChange="sceneIdChange" nowMenu="4"></BoardTopNav>
<div class="leftMenu">
<div v-for="i in deviceList" class="item">
<div v-for="i in deviceList" class="item" @click="getRightData(i)">
<span>{{ i.deviceModeName }}</span>
</div>
</div>
@ -76,7 +75,7 @@
</el-table>
</div>
<div ref="pagination" style="margin-top: 12px;height: 36px;">
<el-pagination :total="1000" background layout="prev, pager, next" style="display: inline-block;float:right;">
<el-pagination :current-page="offset" :total="total" background layout="prev, pager, next" style="display: inline-block;float:right;">
</el-pagination>
</div>
</div>
@ -88,11 +87,9 @@ import {
selectLatestDataByDeviceMode,
getDeviceModesBySceneId,
} from '@/api/board/equipmentMonitoring'
import BoardTopNav from '@/components/BoardTopNav'
export default {
components: {
BoardTopNav
},
data() {
return {
@ -106,20 +103,27 @@ export default {
tableData: [],
deviceList:[],
sceneId: 0,
offset:0,
limit:10,
total:0
}
},
mounted() {
async mounted() {
this.maxHeight = this.$refs.right.clientHeight - this.$refs.search.clientHeight - this.$refs.pagination.clientHeight - 12
this.tableShow = true
t
await this.getData()
},
methods: {
sceneIdChange(e){
this.sceneId = e
this.getData()
async getRightData(e){
await this.setSelectLatestDataByDeviceMode({
"sceneId": this.$store.getters.sceneId,
"deviceModeId": e.deviceModeId,
"startTime": 0,
"offset": this.offset,
"limit": 10
})
},
async getData() {
await this.setSelectLatestDataByDeviceMode()
await this.setDeviceModesBySceneId()
},
setStyle(e) {
@ -129,15 +133,10 @@ export default {
return {textAlign: 'center', backgroundColor: '#063468', color: '#05aaba'}
}
},
async setSelectLatestDataByDeviceMode(){
const {data} = await selectLatestDataByDeviceMode({
"sceneId": this.$store.getters.sceneId,
"deviceModeId": 1,
"startTime": 1222222222222,
"offset": 0,
"limit": 10
})
async setSelectLatestDataByDeviceMode(e){
const {data} = await selectLatestDataByDeviceMode(e)
this.tableData = data.latestData || []
this.total=data.total
},
async setDeviceModesBySceneId(){
const {data} = await getDeviceModesBySceneId( {

@ -2,7 +2,6 @@
<div class="container">
<div class="centerImg"></div>
<div class="title">监控单元统计</div>
<BoardTopNav nowMenu="1" @sceneIdChange="sceneIdChange"></BoardTopNav>
<Chart ref="chart1" class="chart1"></Chart>
<div class="chart1Right">
<p v-for="(i,k) in chart1Data.slice(0,4)" :key="k" :style="'color:'+ chart1Color[k]">{{ i.name }}</p>
@ -126,7 +125,7 @@
{{ item.location }}
</div>
<div class="scrollTable" style="width: 25%">
<el-button v-if="item.status === '0'" size="mini" type="primary" @click="dispose"></el-button>
<el-button v-if="item.status === '0'" size="mini" type="primary" @click="dispose(item)"></el-button>
<span v-else></span>
</div>
</div>
@ -139,21 +138,20 @@
<script>
import Chart from "@/components/Charts/Chart";
import vueSeamlessScroll from "vue-seamless-scroll";
import BoardTopNav from '@/components/BoardTopNav'
import * as echarts from 'echarts';
import {
monitorUnitPercentage,
monitorPercentage,
allNums,
getAlarmInfos,
getDeviceOperations
getDeviceOperations,
handleAlarmInfo
} from '@/api/board/index'
export default {
components: {
vueSeamlessScroll,
Chart,
BoardTopNav,
},
data() {
@ -433,16 +431,29 @@ export default {
}
this.$refs.chart3.setData(option3)
},
dispose() {
dispose(e) {
console.log(e)
this.$confirm('该问题已处理?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '已处理!'
});
handleAlarmInfo({
alarmInfoId:e.no
}).then(e=>{
if(e.code === 200){
this.$message({
type: 'success',
message: '已处理!'
});
this.setTable3()
}else{
this.$message({
type: 'info',
message: '网络错误'
});
}
})
}).catch(() => {
this.$message({
type: 'info',

@ -1,7 +1,6 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav @sceneIdChange="sceneIdChange" nowMenu="4"></BoardTopNav>
<div class="collapse">
<div style="margin-bottom: 24px">
<el-collapse accordion>
@ -107,11 +106,9 @@ import {
getHistoryData,
getLinkDevices
} from '@/api/board/senso'
import BoardTopNav from '@/components/BoardTopNav'
export default {
components: {
BoardTopNav
},
data() {
return {
@ -122,13 +119,10 @@ export default {
sceneId:0
}
},
mounted() {
async mounted() {
await this.getData()
},
methods: {
sceneIdChange(e){
this.sceneId = e
this.getData()
},
async getData() {
await this.setDeviceInfo()
await this.setLinkDevices()

@ -1,10 +1,11 @@
<template>
<div class="container">
<BoardTopNav @sceneIdChange="sceneIdChange" nowMenu="2"></BoardTopNav>
<div class="num1">{{ num1 }}</div>
<div class="num2">{{ num2 }}</div>
<div class="title1">监控单元</div>
<div class="title2">传感器</div>
<div class="titleA1">监控单元</div>
<div class="titleA2">告警信息</div>
<div v-for="(i,k) in alarmCountGroupAlarmType" :class="'num'+(k+3)">
{{ i.alarmCount }}
</div>
@ -60,9 +61,9 @@
</vue-seamless-scroll>
</div>
<div class="right">
<el-row>
<el-col v-for="i in tableData" :key="i.monitorUnitId" :span="12">
<div class="item">
<el-row style="min-height: 75vh;">
<el-col v-for="i in tableData" :key="i.monitorUnitId" :span="12" >
<div class="item" @click="toMonitor(i)">
<div class="titleBg"></div>
<div class="title">
<span style="margin-right: 28px;"> {{ i.monitorUnitName }} </span>
@ -83,7 +84,6 @@
<script>
import vueSeamlessScroll from "vue-seamless-scroll";
import BoardTopNav from '@/components/BoardTopNav'
import {
sceneAllNums,
getLimitSubMonitorUnit,
@ -94,7 +94,6 @@ import {
export default {
components: {
vueSeamlessScroll,
BoardTopNav
},
data() {
return {
@ -119,12 +118,26 @@ export default {
sceneId:0
}
},
computed: {
jtData() {
return this.$store.getters.sceneId;
}
},
watch:{
jtData:{
handler() {
this.getData(this.$store.getters.sceneId)
},
deep: true,
immediate: true
}
},
mounted() {
this.getData(this.$store.getters.sceneId)
},
methods: {
sceneIdChange(e){
this.sceneId = e
this.getData(e)
toMonitor(e){
this.$router.push({path:'/board/equipment',query:{monitorUnitId:e.monitorUnitId}})
},
async getData(e) {
await this.setAllNum(e)
@ -347,19 +360,20 @@ export default {
color: #fff;
}
.title9 {
.titleA1{
position: absolute;
top: 61%;
left: 26.1%;
top: 13%;
left: 74.3%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;
}
.title10 {
.titleA2{
position: absolute;
top: 13%;
left: 74.3%;
top: 61%;
left: 26.1%;
transform: translate(-50%, -50%);
font-size: 1vw;
color: #fff;

Loading…
Cancel
Save