修改接口参数

dev
夜笙歌 1 year ago
parent 4ec98dc1f2
commit c710cb4e1b

@ -4,7 +4,7 @@ import request from '@/utils/request'
export function alarmStats(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/alarmStats/1',
url: '/business/monitorPlatform/alarmStats/'+query,
method: 'get',
})
}
@ -12,7 +12,7 @@ export function alarmStats(query) {
export function subDevice(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/subDevice/1',
url: '/business/monitorPlatform/subDevice/'+query,
method: 'get',
})
}
@ -28,7 +28,7 @@ export function getAlarmInfos(query) {
export function ElectronicNumVo(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/ElectronicNumVo/1',
url: '/business/monitorPlatform/ElectronicNumVo/'+query,
method: 'get',
})
}

@ -1,18 +1,18 @@
import request from '@/utils/request'
// 树
export function treeList(query) {
export function treeList(query=0) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/treeList/1',
url: '/business/monitorPlatform/treeList/'+query,
method: 'get',
})
}
// 中下
export function selectDeviceByDeviceModeByMonitorUnitId(query) {
export function selectDeviceByDeviceModeByMonitorUnitId(query=0,data=0) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/selectDevicesByMonitorUnitId/1/1',
url: '/business/monitorPlatform/selectDevicesByMonitorUnitId/'+query+'/'+data,
method: 'get',
data:query
})
@ -27,10 +27,10 @@ export function selectDeviceModeFunctionByFunctionType(query) {
})
}
// 中上
export function getMonitorById(query) {
export function getMonitorById(query=0) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/getMonitorById/1',
url: '/business/monitorPlatform/getMonitorById/'+query,
method: 'get',
data:query
})

@ -5,13 +5,7 @@ export function selectLatestDataByDeviceMode(query) {
return request({
url: '/business/monitorPlatform/selectLatestDataByDeviceMode',
method: 'post',
data: {
"sceneId": 1,
"deviceModeId": 1,
"startTime": 1222222222222,
"offset": 0,
"limit": 10
}
data: query
})
}
@ -21,8 +15,6 @@ export function getDeviceModesBySceneId(data) {
return request({
url: '/business/monitorPlatform/getDeviceModesBySceneId',
method: 'post',
data: {
"sceneId": 1,
}
data:data
})
}

@ -4,7 +4,7 @@ import request from '@/utils/request'
export function getDeviceInfo(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/getDeviceInfo/1',
url: '/business/monitorPlatform/getDeviceInfo/'+query,
method: 'get',
})
}
@ -14,13 +14,7 @@ export function getHistoryData(query) {
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/getHistoryData',
method: 'post',
data:{
"sceneId": 1,
"deviceId": 2,
"offset": 0,
"limit": 5,
"startTime": 1266666666666
}
data:query
})
}
@ -28,7 +22,7 @@ export function getHistoryData(query) {
export function getLinkDevices(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/getLinkDevices/1',
url: '/business/monitorPlatform/getLinkDevices/'+query,
method: 'get',
})
}

@ -4,7 +4,7 @@ import request from '@/utils/request'
export function sceneAllNums(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/sceneAllNums/1',
url: '/business/monitorPlatform/sceneAllNums/'+query,
method: 'get',
})
}
@ -13,7 +13,7 @@ export function sceneAllNums(query) {
export function getLimitSubMonitorUnit(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/limitSubMonitorUnit/1',
url: '/business/monitorPlatform/limitSubMonitorUnit/'+query,
method: 'get',
})
}
@ -22,7 +22,7 @@ export function getLimitSubMonitorUnit(query) {
export function getAlarmCountGroupAlarmType(query) {
return request({
// baseURL:'/monitoring-api',
url: '/business/monitorPlatform/getAlarmCountGroupAlarmType/1',
url: '/business/monitorPlatform/getAlarmCountGroupAlarmType/'+query,
method: 'get',
})
}

@ -2,7 +2,7 @@
<div>
<div class="title">智慧物联监控平台</div>
<div>
<div :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%" @click="toLink('index')" v-if="isIndex">
<div v-if="isIndex" :class="`menu ${nowMenu==='1'? 'menuClick' :''}`" style="left: 2%" @click="toLink('index')">
<span>
监控主页
</span>
@ -13,7 +13,8 @@
{{ name }} <i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="i in selectSecnesList" :command="{router:i.router,name:i.sceneName}">{{
<el-dropdown-item v-for="i in selectSecnesList" :key="i.sceneId"
:command="{router:i.router,name:i.sceneName}">{{
i.sceneName
}}
</el-dropdown-item>
@ -53,7 +54,8 @@ export default {
return {
selectSecnesList: [],
name: '智慧场景',
isIndex : true
isIndex: true,
sceneId: 0,
}
},
props: {
@ -63,16 +65,23 @@ export default {
},
},
mounted() {
async mounted() {
await this.setSelectSecnes()
if (this.$store.state.user.permissions.includes('business:monitor:index') || this.$store.state.user.permissions.includes('*:*:*')) {
this.isIndex = true
} else {
this.isIndex = false
}
this.setSelectSecnes()
if (this.$route.name === 'SmartScene') {
if (this.$route.query?.name) {
this.name = this.$route.query?.name
} else {
let routerData = this.selectSecnesList.find(e => e.sceneId === this.sceneId)
await this.$router.push({
path: "/board/" + (routerData.router || 'smartScene'),
query: {name: routerData.sceneName}
});
}
}
},
@ -80,7 +89,13 @@ export default {
async setSelectSecnes() {
const {data} = await selectSecnes()
this.selectSecnesList = data
let defaultSceneId = data.find(e => e.defaultFlag === '1').sceneId
this.sceneId = defaultSceneId
this.$emit('sceneIdChange',defaultSceneId);
},
// sceneIdChange(){
//
// },
toLink(e) {
this.$router.push({path: "/board/" + e});
},
@ -89,7 +104,6 @@ export default {
this.$router.push({path: "/board/" + (e.router || 'smartScene'), query: {name: e.name}});
},
toIndex() {
console.log(123)
this.$router.push({path: "/index"});
}
}

@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="2"></BoardTopNav>
<BoardTopNav nowMenu="2" @sceneIdChange="sceneIdChange"></BoardTopNav>
<Chart ref="chart1" class="chart1"></Chart>
<div class="table1">
<div style="background-color: #094170">
@ -133,17 +133,24 @@ export default {
boundaryGap: [0, 0.01],
},
},
table1Data: []
table1Data: [],
sceneId: 0,
}
},
mounted() {
this.createMap()
this.getAlarmStats()
this.getAubDevice()
this.setAlarmInfos()
this.setElectronicNumVo()
},
methods: {
sceneIdChange(e) {
this.sceneId = e
this.getData()
},
async getData() {
await this.createMap()
await this.getAlarmStats()
await this.getAubDevice()
await this.setAlarmInfos()
await this.setElectronicNumVo()
},
dispose() {
this.$confirm('该问题已处理?', '提示', {
confirmButtonText: '确定',
@ -167,12 +174,12 @@ export default {
center: [113.4, 23.35],
});
},
setMarker(position) {
let marker =new AMap.Marker({
position: position,
icon: red,
setPolygon(position) {
let e = position.map(val => {
return [val.longitude, val.latitude]
})
map.add(marker)
let thisPolygon = new AMap.Polygon({path: e});
map.add(thisPolygon)
map.setFitView()
},
setCircle(center, radius) {
@ -191,7 +198,7 @@ export default {
map.setFitView()
},
async getAlarmStats() {
const {data} = await alarmStats()
const {data} = await alarmStats(this.sceneId)
let option1 = {
...this.chart1Option,
yAxis: {
@ -239,10 +246,10 @@ export default {
this.$refs.chart1.setData(option1)
},
async getAubDevice() {
let data = await subDevice()
let data = await subDevice(this.sceneId)
this.num1 = data.deviceNum
this.num2 = data.onlineDeviceNum
this.num3 = data.subSum
this.num2 = data.subSum
this.num3 = data.onlineDeviceNum
},
async setAlarmInfos() {
const {rows: data} = await getAlarmInfos()
@ -256,13 +263,10 @@ export default {
})
},
async setElectronicNumVo() {
const {data} = await ElectronicNumVo()
console.log(data)
const {data} = await ElectronicNumVo(this.sceneId)
data.forEach(e => {
if (e.areaPoints?.length > 0) {
e.areaPoints.forEach(val => {
this.setMarker([val.longitude,val.latitude])
})
this.setPolygon(e.areaPoints)
}
if (e.centerPoint) {
this.setCircle([e.centerPoint.longitude, e.centerPoint.latitude], e.radius)

@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="3"></BoardTopNav>
<BoardTopNav @sceneIdChange="sceneIdChange" nowMenu="3"></BoardTopNav>
<div class="title">福建省电力公司</div>
<div class="tree">
@ -104,16 +104,23 @@ export default {
treeData: [],
controlList: [],
acquisitionList: [],
MonitorInfo: {}
MonitorInfo: {},
sceneId: 0,
}
},
mounted() {
this.getTree()
this.getDevice()
this.getRightDevice()
this.setMonitorById()
async mounted() {
},
methods: {
sceneIdChange(e){
this.sceneId = e
this.getData()
},
async getData() {
await this.getTree()
await this.getDevice()
await this.getRightDevice()
await this.setMonitorById()
},
switchChange(e) {
this.$confirm((this.controlList[e].deviceType === '1' ? '关闭' : '开启') + '该设备?', '提示', {
confirmButtonText: '确定',
@ -133,8 +140,7 @@ export default {
});
},
async getTree() {
const {data} = await treeList()
console.log(data)
const {data} = await treeList(this.sceneId)
this.treeData = data
},
treeClick(e) {
@ -145,21 +151,20 @@ export default {
}
},
async getDevice(e) {
const {data} = await selectDeviceByDeviceModeByMonitorUnitId({monitorUnitId: e})
const {data} = await selectDeviceByDeviceModeByMonitorUnitId(this.sceneId, e)
this.controlList = data.control
this.acquisitionList = data.acquisition
},
async getRightDevice(e) {
const data = await selectDeviceModeFunctionByFunctionType({
"sceneId": 1,
"sceneId": this.sceneId,
"deviceModeId": 1,
"startTime": 1222222222222,
"offset": 0,
"limit": 1
})
},
async setMonitorById() {
const {data} = await getMonitorById()
const {data} = await getMonitorById(this.sceneId)
this.MonitorInfo = data
}
}

@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="3"></BoardTopNav>
<BoardTopNav @sceneIdChange="sceneIdChange" nowMenu="3"></BoardTopNav>
<div class="leftMenu">
<div v-for="i in deviceList" class="item">
<span>{{ i.deviceModeName }}</span>
@ -96,16 +96,24 @@ export default {
},
maxHeight: 0,
tableData: [],
deviceList:[]
deviceList:[],
sceneId: 0,
}
},
mounted() {
this.maxHeight = this.$refs.right.clientHeight - this.$refs.search.clientHeight - this.$refs.pagination.clientHeight - 12
this.tableShow = true
this.setSelectLatestDataByDeviceMode()
this.setDeviceModesBySceneId()
t
},
methods: {
sceneIdChange(e){
this.sceneId = e
this.getData()
},
async getData() {
await this.setSelectLatestDataByDeviceMode()
await this.setDeviceModesBySceneId()
},
setStyle(e) {
if (e.rowIndex % 2 === 0) {
return {textAlign: 'center', backgroundColor: '#08406f', color: '#05aaba'}
@ -114,12 +122,20 @@ export default {
}
},
async setSelectLatestDataByDeviceMode(){
const {data} = await selectLatestDataByDeviceMode()
this.tableData = data.latestData.rows
const {data} = await selectLatestDataByDeviceMode({
"sceneId": this.sceneId,
"deviceModeId": 1,
"startTime": 1222222222222,
"offset": 0,
"limit": 10
})
this.tableData = data.latestData?.rows || []
console.log(this.tableData)
},
async setDeviceModesBySceneId(){
const {data} = await getDeviceModesBySceneId()
const {data} = await getDeviceModesBySceneId( {
"sceneId": this.sceneId,
})
this.deviceList = data
}
}

@ -1,16 +1,16 @@
<template>
<div class="container">
<div class="centerImg"></div>
<BoardTopNav nowMenu="4"></BoardTopNav>
<BoardTopNav @sceneIdChange="sceneIdChange" nowMenu="4"></BoardTopNav>
<div class="collapse">
<div style="margin-bottom: 24px">
<el-collapse v-model="activeName" accordion>
<el-collapse accordion>
<el-collapse-item name="1">
<template slot="title">
<div class="itemBg">
<div class="icon"></div>
<div class="icon1"></div>
<div :style="'background-image: url('+topData.devicePic+')'" class="icon2"></div>
<div :style="'background-image: url('+(topData&&topData.devicePic)+')'" class="icon2"></div>
<div class="title"> {{ topData.monitorUnitName }}</div>
<div class="info">
<div class="info1">所属区域</div>
@ -73,7 +73,7 @@
</el-collapse>
</div>
<el-collapse v-model="activeName" accordion>
<el-collapse accordion>
<el-collapse-item v-for="i in bottomData">
<template slot="title">
<div class="itemBg">
@ -118,15 +118,22 @@ export default {
topData: {},
bottomData: [],
radio: '日统计报表',
tableData: []
tableData: [],
sceneId:0
}
},
mounted() {
this.setDeviceInfo()
this.setHistoryData()
this.setLinkDevices()
},
methods: {
sceneIdChange(e){
this.sceneId = e
this.getData()
},
async getData() {
await this.setDeviceInfo()
await this.setLinkDevices()
await this.setHistoryData()
},
setStyle(e) {
if (e.rowIndex % 2 === 0) {
return {textAlign: 'center', backgroundColor: '#08406f', color: '#05aaba'}
@ -135,12 +142,18 @@ export default {
}
},
async setDeviceInfo() {
const {data} = await getDeviceInfo()
this.topData = data
const {data} = await getDeviceInfo(this.sceneId)
this.topData = data || {}
},
async setHistoryData() {
const {data} = await getHistoryData()
this.tableData = data.historyData.rows.map((e, i) => {
const {data} = await getHistoryData({
"sceneId": this.sceneId,
"deviceId": 2,
"offset": 0,
"limit": 5,
"startTime": 1266666666666
})
this.tableData = (data?.historyData?.rows || []).map((e, i) => {
return {
...e,
...data.deviceDataColumns[i]
@ -148,8 +161,7 @@ export default {
})
},
async setLinkDevices() {
const {data} = await getLinkDevices()
console.log(data)
const {data} = await getLinkDevices(this.sceneId)
this.bottomData = data
}
}

@ -1,6 +1,6 @@
<template>
<div class="container">
<BoardTopNav nowMenu="2"></BoardTopNav>
<BoardTopNav @sceneIdChange="sceneIdChange" nowMenu="2"></BoardTopNav>
<div class="num1">{{ num1 }}</div>
<div class="num2">{{ num2 }}</div>
<div class="title1">监控单元</div>
@ -121,23 +121,30 @@ export default {
singleWidth: 0, // (0) direction => 2/3
waitTime: 0,
},
table1Data: []
table1Data: [],
sceneId:0
}
},
mounted() {
this.setAllNum()
this.setLimitSubMonitorUnit()
this.setAlarmCountGroupAlarmType()
this.setAlarmInfos()
},
methods: {
sceneIdChange(e){
this.sceneId = e
this.getData()
},
async getData() {
await this.setAllNum()
await this.setLimitSubMonitorUnit()
await this.setAlarmCountGroupAlarmType()
await this.setAlarmInfos()
},
async setAllNum() {
const {subSum, sum} = await sceneAllNums()
const {subSum, sum} = await sceneAllNums(this.sceneId)
this.num1 = subSum
this.num2 = sum
},
async setLimitSubMonitorUnit() {
const data = await getLimitSubMonitorUnit()
const data = await getLimitSubMonitorUnit(this.sceneId)
this.LimitSubMonitorUnitList = data.rows
this.tableData = data.rows.slice(0, 4)
this.total = data.total
@ -146,7 +153,7 @@ export default {
this.tableData = this.LimitSubMonitorUnitList.slice(4 * (e - 1), 4 * (e - 1) + 4)
},
async setAlarmCountGroupAlarmType() {
let {data: data} = await getAlarmCountGroupAlarmType()
let {data: data} = await getAlarmCountGroupAlarmType(this.sceneId)
data.sort((a, b) => {
return b.alarmCount - a.alarmCount
})

Loading…
Cancel
Save