修改路由

master
夜笙歌 2 years ago
parent 76a99b2d02
commit 84ff613e36

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save