修改后台问题

master
夜笙歌 2 months ago
parent d5e8c950e8
commit 7e8b434406

@ -83,3 +83,11 @@ export function getModeFunctionParametersByModeFunctionId(modeFunctionId) {
}) })
} }
export function getDeviceByModel(data) {
return request({
url: '/business/device/getDeviceByModel',
method: 'get',
params:data
})
}

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<!-- <app-main/>--> <!-- <app-main/>-->
<router-view> </router-view> <router-view> </router-view>
<div style="z-index: 99999;"> <div style="z-index: 99999;">
<BoardTopNav/> <BoardTopNav/>

@ -77,15 +77,18 @@
<div :style='"background-color:" + ((index % 2 === 0)? "#053460":"#032d57") '> <div :style='"background-color:" + ((index % 2 === 0)? "#053460":"#032d57") '>
<div <div
class="scrollTable"> class="scrollTable">
{{ item.value1 }} {{ item.no }}
</div> </div>
<div <div
class="scrollTable"> class="scrollTable">
{{ item.value2 }} {{ item.alarmInfoType === '1' ? '设备报警' : '' }}
{{ item.alarmInfoType === '2' ? '监控单元报警' : '' }}
{{ item.alarmInfoType === '3' ? '离线报警' : '' }}
{{ item.alarmInfoType === '4' ? '电子围栏' : '' }}
</div> </div>
<div <div
class="scrollTable"> class="scrollTable">
{{ item.value3 }} {{ 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(item)"></el-button> <el-button v-if="item.status === '0'" size="mini" type="primary" @click="dispose(item)"></el-button>
@ -308,6 +311,7 @@ import green from '@/assets/board/GPS/green.png'
import {handleAlarmInfo} from "@/api/board/index"; import {handleAlarmInfo} from "@/api/board/index";
import {selectBeaconDevicesHistory} from "../../../api/board/GPS"; import {selectBeaconDevicesHistory} from "../../../api/board/GPS";
import {selectMonitorElectronic} from "../../../api/board"; import {selectMonitorElectronic} from "../../../api/board";
import gif from "@/assets/board/index/dot.png";
let map = null let map = null
let polyEditor = null let polyEditor = null
@ -401,12 +405,39 @@ export default {
await this.getTable2Data() await this.getTable2Data()
}, },
dispose(e) { dispose(e) {
this.warInfo = e this.warInfo = e
this.textarea = '' this.textarea = ''
this.isDispose = true this.isDispose = true
this.disposeNo = e.no this.disposeNo = e.no
}, },
disposeThis() {
handleAlarmInfo({
alarmInfoId: this.disposeNo,
alarmInfoField: this.textarea,
ifDisposalAll: 0,
}).then(e => {
this.isDispose = false
this.$message({
type: 'success',
message: '已处理!'
});
this.setAlarmInfos()
})
},
disposeAll() {
handleAlarmInfo({
alarmInfoId: this.disposeNo,
alarmInfoField: this.textarea,
ifDisposalAll: 1,
}).then(e => {
this.$message({
type: 'success',
message: '已处理!'
});
this.isDispose = false
this.setAlarmInfos()
})
},
createMap() { createMap() {
map = new AMap.Map('map', { map = new AMap.Map('map', {
// mapStyle: 'amap://styles/blue', // mapStyle: 'amap://styles/blue',
@ -481,9 +512,10 @@ export default {
const {rows: data} = await getAlarmInfos({"sceneId": this.$store.getters.sceneId}) const {rows: data} = await getAlarmInfos({"sceneId": this.$store.getters.sceneId})
this.table1Data = data.map((e, i) => { this.table1Data = data.map((e, i) => {
return { return {
value1: e.alarmInfoId, ...e,
value2: e.alarmTypeName, no: e.alarmInfoId,
value3: e.monitorUnitName, type: e.alarmTypeName,
location: e.monitorUnitName,
status: e.handleStatus status: e.handleStatus
} }
}) })
@ -515,19 +547,55 @@ export default {
async getTable2Data() { async getTable2Data() {
const {data} = await selectDeviceLatitudeAndLongitude(this.$store.getters.sceneId) const {data} = await selectDeviceLatitudeAndLongitude(this.$store.getters.sceneId)
this.table2Data = data this.table2Data = data
console.log(data)
data.forEach(e => { data.forEach(e => {
this.setMarker(e) if (e.alarmElectronFence) {
this.setMarker1(e)
} else {
this.setMarker(e)
}
}) })
}, },
setMarker(e) { setMarker(e) {
let marker = new AMap.Marker({
position: [e.longitude, e.latitude], // [116.39, 39.9]
title: `信息\n经度${e.longitude}\n纬度${e.latitude}\n名称${e.deviceLocation}\n备注${e.remark}`,
offset: new AMap.Pixel(-20, -40),
content: `<div>
<img src="${gif}" alt="" width=" 40px" style="animation:an1 2s ease-in-out infinite;" >
</div>`
});
marker.on('click', async () => {
if (polygons.length > 0 || circles.length > 0) {
map.remove(polygons)
map.remove(circles)
map.remove(texts)
polygons = []
circles = []
return
}
const {data} = await selectMonitorElectronic(e.deviceId)
data.map(e => e.hwFenceAreaList).flat(1).forEach(e => {
if (e.areaShapeFlag === '1') {
this.setPolygon(e.areaRange.split('_').map(e => e.split(',').map(v => parseFloat(v))))
}
if (e.areaShapeFlag === '2') {
let arr = e.areaRange.split(',')
this.setCircle([arr[0], arr[1]], arr[2])
}
})
})
map.add(marker);
},
setMarker1(e) {
let marker = new AMap.Marker({ let marker = new AMap.Marker({
position: [e.longitude, e.latitude], // [116.39, 39.9] position: [e.longitude, e.latitude], // [116.39, 39.9]
title: `信息\n经度${e.longitude}\n纬度${e.latitude}\n名称${e.deviceLocation}\n备注${e.remark}`, title: `信息\n经度${e.longitude}\n纬度${e.latitude}\n名称${e.deviceLocation}\n备注${e.remark}`,
offset: new AMap.Pixel(-15, -30), offset: new AMap.Pixel(-15, -30),
content: `<div > content: `<div >
<svg t="1718261114618" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4305" style="width: 30px;height: 30px;"> <svg t="1718261114618" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4305" style="width: 30px;height: 30px;">
<path d="M512 64.5c-180.5 0-326.9 146.4-326.9 326.9 0 63.3 18 122.3 49.2 172.4 1.1 2 2.1 4 3.2 5.9 34.9 58.2 113.9 128.8 165.5 194.5 66.3 84.4 93.2 158 93.2 158 1.6 1.4 13.1 35.6 15.1 35.8 2.5 0.2 12.6-34 14.5-35.8 0 0 22-69.2 83.7-146.6 56-70.1 142.8-145.7 177-206 0.9-1.6 1.8-3.3 2.6-5 31.5-50.2 49.7-109.6 49.7-173.3 0.1-180.5-146.3-326.8-326.8-326.8z" fill="${(e.ifAlarm === '1') ? '#3D93FD' : '#ff0000'}" p-id="4306"> <path d="M512 64.5c-180.5 0-326.9 146.4-326.9 326.9 0 63.3 18 122.3 49.2 172.4 1.1 2 2.1 4 3.2 5.9 34.9 58.2 113.9 128.8 165.5 194.5 66.3 84.4 93.2 158 93.2 158 1.6 1.4 13.1 35.6 15.1 35.8 2.5 0.2 12.6-34 14.5-35.8 0 0 22-69.2 83.7-146.6 56-70.1 142.8-145.7 177-206 0.9-1.6 1.8-3.3 2.6-5 31.5-50.2 49.7-109.6 49.7-173.3 0.1-180.5-146.3-326.8-326.8-326.8z" fill="#ff0000" p-id="4306">
</path> </path>
</svg> </svg>

@ -61,37 +61,42 @@
</div> </div>
<div class="right"> <div class="right">
<div v-for="(i,k) in acquisitionList" class="item"> <div v-for="(i,k) in acquisitionList" class="item">
<div class="iconBg"></div> <!-- <div class="iconBg"></div>-->
<div <!-- <div-->
class="icon"> <!-- class="icon">-->
<el-image <!-- <el-image-->
v-if="i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]" <!-- v-if="i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]"-->
:preview-src-list="[i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]]" <!-- :preview-src-list="[i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]]"-->
:src="i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]" <!-- :src="i.deviceDataMap[Object.keys(i.deviceDataMap).find(e=> i.deviceDataMap[e].toString().includes('http'))]"-->
style="width: 100%; height: 100%"> <!-- style="width: 100%; height: 100%">-->
</el-image> <!-- </el-image>-->
<el-image <!-- <el-image-->
v-else-if="i.devicePic" <!-- v-else-if="i.devicePic"-->
:src="i.devicePic" <!-- :src="i.devicePic"-->
style="width: 100%; height: 100%"> <!-- style="width: 100%; height: 100%">-->
</el-image> <!-- </el-image>-->
<el-image <!-- <el-image-->
v-else <!-- v-else-->
:src="defaultImg1" <!-- :src="defaultImg1"-->
style="width: 100%; height: 100%"> <!-- style="width: 100%; height: 100%">-->
</el-image> <!-- </el-image>-->
</div> <!-- </div>-->
<div class="rightBg"> <div class="rightBg">
<div class="index">{{ k + 1 }}</div> <div class="index">{{ k + 1 }}</div>
<div class="title">{{ i.deviceName }}</div> <div class="title">{{ i.deviceName }}</div>
<div style="position: absolute;left: 24%;top: 0px;width: 55%;height: 100%;"> <div style="position: absolute;left: 27%;top: 0px;width: 45%;height: 100%;">
<div <div
v-for="val in Object.keys(i.deviceDataMap).slice(0,6).filter(e=> !(i.deviceDataMap[e].toString().includes('http')))" v-for="val in Object.keys(i.deviceDataMap).slice(0,6).filter(e=> !(i.deviceDataMap[e].toString().includes('http')))"
:style="'height:'+(Object.keys(i.deviceDataMap).length<4 ? '100%':'50%')" class="infoItem"> :style="'width:'+(Object.keys(i.deviceDataMap).length<=2 ? '100%':'50%')" class="infoItem">
<div class="span">{{ val }}:</div> <div class="span">{{ val }}:</div>
<div class="spanBg"></div> <div class="spanBg"></div>
<div class="num">{{ i.deviceDataMap[val] }}</div> <div class="num">{{ i.deviceDataMap[val] }}</div>
</div> </div>
<div class="infoItem">
<div class="span"> 时间 :</div>
<div class="spanBg"></div>
<div class="num">{{ i.updateTime }}</div>
</div>
</div> </div>
<div class="btn"> <div class="btn">
@ -143,6 +148,10 @@
:prop="i" :prop="i"
:label="historyTh[i]" :label="historyTh[i]"
width="180"> width="180">
<template slot-scope="scope">
<div v-if="historyTh[i] === '时间'">{{ parseTime(scope.row['ts']) }}</div>
<div v-else>{{ scope.row[historyTh[i]] }}</div>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -410,7 +419,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.historyData = data.tableDataInfo.rows this.historyData = data.tableDataInfo.rows
this.historyTh = data.mapName this.historyTh = data.mapName
if(Object.keys(data.mapName).includes('ts')){ if (Object.keys(data.mapName).includes('ts')) {
this.historyTh.ts = '时间' this.historyTh.ts = '时间'
} }
console.log(this.historyTh) console.log(this.historyTh)
@ -598,10 +607,14 @@ export default {
height: 44%; height: 44%;
color: #1684c2; color: #1684c2;
padding: 2vh 0 0 1vw; padding: 2vh 0 0 1vw;
display: flex;
flex-direction: column;
justify-content: space-around;
p { p {
width: 100%;
margin: 0; margin: 0;
line-height: 10vh; flex: 1;
font-size: 0.9vw; font-size: 0.9vw;
} }
} }
@ -717,7 +730,7 @@ export default {
position: relative; position: relative;
width: 50%; width: 50%;
margin-bottom: 12px; margin-bottom: 12px;
height: 9vh; height: 11vh;
padding: 0.5vh 0; padding: 0.5vh 0;
display: inline-block; display: inline-block;
@ -749,9 +762,9 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
position: absolute; position: absolute;
top: 16%; top: 16%;
left: calc(10% + 8vh); left: 1vw;
width: calc(90% - 8vh); width: calc(100% - 1vw);
height: 8vh; height: 10vh;
.index { .index {
position: absolute; position: absolute;
@ -771,17 +784,19 @@ export default {
.title { .title {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 12%; left: 12.5%;
color: #1facf4; color: #1facf4;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
font-size: 0.6vw; font-size: 0.6vw;
} }
.infoItem { .infoItem {
white-space: nowrap;
display: inline-block; display: inline-block;
position: relative; position: relative;
width: 3vw; //width: 3vw;
height: 50%; width: 50%;
height: 33%;
.spanBg { .spanBg {
//background-image: url("~@/assets/board/equipment/icon.png"); //background-image: url("~@/assets/board/equipment/icon.png");
@ -796,19 +811,23 @@ export default {
} }
.span { .span {
position: absolute; //position: absolute;
bottom: 55%; bottom: 55%;
left: 12%; left: 12%;
color: #f4f4f4; color: #f4f4f4;
font-size: 0.5vw; font-size: 0.7vw;
display: inline-block;
line-height: calc(11vh / 3);
} }
.num { .num {
position: absolute; //position: absolute;
display: inline-block;
line-height: calc(11vh / 3);
top: 55%; top: 55%;
left: 12%; left: 12%;
color: #f4f4f4; color: #f4f4f4;
font-size: 0.5vw; font-size: 0.7vw;
} }
} }

@ -103,7 +103,9 @@
title="历史" title="历史"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="90%"> width="90%">
<Sensor :dialogData="dialogData"/> <div class="dialog">
<Sensor :dialogData="dialogData"/>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -291,8 +293,6 @@ export default {
} }
.table { .table {
/deep/ .el-table { /deep/ .el-table {
background-color: #0000; background-color: #0000;
} }
@ -322,4 +322,12 @@ export default {
width: 6.5vw; width: 6.5vw;
overflow: hidden; overflow: hidden;
} }
/deep/ .el-dialog:not(.is-fullscreen) {
margin-top: 1vh !important;
}
.dialog{
.container{
height: 86vh;
}
}
</style> </style>

@ -120,7 +120,10 @@
{{ item.no }} {{ item.no }}
</div> </div>
<div class="scrollTable" style="width: 25%"> <div class="scrollTable" style="width: 25%">
{{ item.type }} {{ item.alarmInfoType === '1' ? '设备报警' : '' }}
{{ item.alarmInfoType === '2' ? '监控单元报警' : '' }}
{{ item.alarmInfoType === '3' ? '离线报警' : '' }}
{{ item.alarmInfoType === '4' ? '电子围栏' : '' }}
</div> </div>
<div class="scrollTable" style="width: 25%"> <div class="scrollTable" style="width: 25%">
{{ item.location }} {{ item.location }}
@ -136,14 +139,15 @@
<div class="exTable"> <div class="exTable">
<el-date-picker <el-date-picker
style="width: calc(100% - 140px)" style="width: calc(100% - 114px)"
size="mini"
v-model="exTableTime" v-model="exTableTime"
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
<el-button type="primary" @click="exTable" style="margin-left: 8px">导出告警信息</el-button> <el-button size="mini" type="primary" @click="exTable" style="margin-left: 8px">导出告警信息</el-button>
</div> </div>
<div v-if="isMap"> <div v-if="isMap">
<Chart ref="mapChart" class="mapChart"></Chart> <Chart ref="mapChart" class="mapChart"></Chart>
@ -389,6 +393,9 @@ let polygons = []
let circles = [] let circles = []
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
let time1 = null
let time2 = null
const isJSON = (str) => { const isJSON = (str) => {
try { try {
JSON.parse(str); JSON.parse(str);
@ -478,7 +485,8 @@ export default {
y: "center", y: "center",
width: '100px', width: '100px',
textStyle: { textStyle: {
color: '#fff' color: '#fff',
fontSize: 0.6 * vw
} }
}, },
tooltip: { tooltip: {
@ -489,7 +497,7 @@ export default {
{ {
type: "pie", type: "pie",
radius: ["45%", "76%"], radius: ["45%", "76%"],
center: ["35%", "50%"], center: ["25%", "50%"],
encode: { encode: {
itemName: "group", itemName: "group",
value: "占比", value: "占比",
@ -507,7 +515,7 @@ export default {
{ {
type: "pie", type: "pie",
radius: ["75%", "90%"], radius: ["75%", "90%"],
center: ["35%", "50%"], center: ["25%", "50%"],
encode: { encode: {
itemName: "group", itemName: "group",
value: "占比", value: "占比",
@ -575,9 +583,9 @@ export default {
// let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`) // let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`)
let {msg} = await getMapData({areaCode: this.code}) let {msg} = await getMapData({areaCode: this.code})
let data let data
if(isJSON(msg)){ if (isJSON(msg)) {
data = JSON.parse(msg) data = JSON.parse(msg)
}else{ } else {
data = '' data = ''
} }
let mapData = this.code === 100000 ? ChinaMapData : data let mapData = this.code === 100000 ? ChinaMapData : data
@ -952,9 +960,9 @@ export default {
// let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`) // let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`)
let {msg} = await getMapData({areaCode: this.code}) let {msg} = await getMapData({areaCode: this.code})
let data let data
if(isJSON(msg)){ if (isJSON(msg)) {
data = JSON.parse(msg) data = JSON.parse(msg)
}else{ } else {
data = '' data = ''
} }
mapData = this.cityJson[params.dataIndex].properties.adcode === 100000 ? ChinaMapData : data mapData = this.cityJson[params.dataIndex].properties.adcode === 100000 ? ChinaMapData : data
@ -997,9 +1005,9 @@ export default {
let {msg} = await getMapData({areaCode: this.code}) let {msg} = await getMapData({areaCode: this.code})
let data let data
if(isJSON(msg)){ if (isJSON(msg)) {
data = JSON.parse(msg) data = JSON.parse(msg)
}else{ } else {
data = '' data = ''
} }
mapData = this.code === 100000 ? ChinaMapData : data mapData = this.code === 100000 ? ChinaMapData : data
@ -1030,12 +1038,12 @@ export default {
<path fill="${(e.ifAlarm === '1') ? '#3D93FD' : '#ff0000'}" d="M512 64.5c-180.5 0-326.9 146.4-326.9 326.9 0 63.3 18 122.3 49.2 172.4 1.1 2 2.1 4 3.2 5.9 34.9 58.2 113.9 128.8 165.5 194.5 66.3 84.4 93.2 158 93.2 158 1.6 1.4 13.1 35.6 15.1 35.8 2.5 0.2 12.6-34 14.5-35.8 0 0 22-69.2 83.7-146.6 56-70.1 142.8-145.7 177-206 0.9-1.6 1.8-3.3 2.6-5 31.5-50.2 49.7-109.6 49.7-173.3 0.1-180.5-146.3-326.8-326.8-326.8z" p-id="4306"> <path fill="${(e.ifAlarm === '1') ? '#3D93FD' : '#ff0000'}" d="M512 64.5c-180.5 0-326.9 146.4-326.9 326.9 0 63.3 18 122.3 49.2 172.4 1.1 2 2.1 4 3.2 5.9 34.9 58.2 113.9 128.8 165.5 194.5 66.3 84.4 93.2 158 93.2 158 1.6 1.4 13.1 35.6 15.1 35.8 2.5 0.2 12.6-34 14.5-35.8 0 0 22-69.2 83.7-146.6 56-70.1 142.8-145.7 177-206 0.9-1.6 1.8-3.3 2.6-5 31.5-50.2 49.7-109.6 49.7-173.3 0.1-180.5-146.3-326.8-326.8-326.8z" p-id="4306">
</path></svg></div>` </path></svg></div>`
}); });
marker.on('click', async () => { marker.on('rightclick', async () => {
if (markerIds.includes(e.deviceId)) { // if (markerIds.includes(e.deviceId)) {
return // return
} else { // } else {
markerIds.push(e.deviceId) // markerIds.push(e.deviceId)
} // }
const {data} = await selectMonitorElectronic(e.deviceId) const {data} = await selectMonitorElectronic(e.deviceId)
data.map(e => e.hwFenceAreaList).flat(1).forEach(e => { data.map(e => e.hwFenceAreaList).flat(1).forEach(e => {
if (e.areaShapeFlag === '1') { if (e.areaShapeFlag === '1') {
@ -1065,12 +1073,12 @@ export default {
<img src="${gif}" alt="" width=" 40px" style="animation:an1 2s ease-in-out infinite;" > <img src="${gif}" alt="" width=" 40px" style="animation:an1 2s ease-in-out infinite;" >
</div>` </div>`
}); });
marker.on('click', async () => { marker.on('rightclick', async () => {
if (markerIds.includes(e.deviceId)) { // if (markerIds.includes(e.deviceId)) {
return // return
} else { // } else {
markerIds.push(e.deviceId) // markerIds.push(e.deviceId)
} // }
const {data} = await selectMonitorElectronic(e.deviceId) const {data} = await selectMonitorElectronic(e.deviceId)
data.map(e => e.hwFenceAreaList).flat(1).forEach(e => { data.map(e => e.hwFenceAreaList).flat(1).forEach(e => {
if (e.areaShapeFlag === '1') { if (e.areaShapeFlag === '1') {
@ -1091,18 +1099,31 @@ export default {
map.add(marker); map.add(marker);
markers.push(marker) markers.push(marker)
}, },
setMarker2(e) { setMarker2(e, bl) {
if (!bl) {
if (time1) {
clearInterval(time1)
}
time1 = null
time1 = setInterval(() => {
this.setMarker2(e, true)
}, 5000)
}
map.remove(markers) map.remove(markers)
map.remove(polygons) map.remove(polygons)
map.remove(circles) map.remove(circles)
markers = [] markers = []
e.forEach(v => { e.forEach(v => {
console.log(v)
console.log(this.options)
let arr = this.options.filter(r => r.value.deviceId === v) || [] let arr = this.options.filter(r => r.value.deviceId === v) || []
if (arr.length > 0) { if (arr.length > 0) {
this.setMarker1(arr[0].value) this.setMarker1(arr[0].value)
} }
}) })
map.setFitView(markers) if(!bl){
map.setFitView(markers)
}
}, },
getDeviceInfo() { getDeviceInfo() {
this.$router.push({path: '/board/equipment', query: {monitorUnitId: this.monitorUnitId}}) this.$router.push({path: '/board/equipment', query: {monitorUnitId: this.monitorUnitId}})
@ -1159,16 +1180,24 @@ export default {
}) })
map.setFitView(markers) map.setFitView(markers)
}, },
async searchMap1(name) { async searchMap1(name, e) {
// if(!e){
if (time2) {
clearInterval(time2)
}
time2 = null
time2 = setInterval(async () => {
const {data} = await selectDeviceByName({name: name})
this.markerData = data
}, 5000)
// }
const {data} = await selectDeviceByName({name: name})
this.value = [] this.value = []
map.remove(markers) map.remove(markers)
map.remove(polygons) map.remove(polygons)
map.remove(circles) map.remove(circles)
markers = [] markers = []
this.loading = true; this.loading = true;
const {data} = await selectDeviceByName({name: name})
this.markerData = data
console.log(data)
this.loading = false; this.loading = false;
let option = [] let option = []
data.forEach(e => { data.forEach(e => {
@ -1260,7 +1289,16 @@ export default {
padding: 0 12px; padding: 0 12px;
position: absolute; position: absolute;
top: 17%; top: 17%;
left: 15%; right: 76.3%;
font-size: 0.8vw;
p {
display: block;
max-width: 10vw;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
.chart1Table { .chart1Table {
@ -1341,7 +1379,7 @@ export default {
.exTable { .exTable {
position: absolute; position: absolute;
top: 46%; bottom: 50%;
left: 76.3%; left: 76.3%;
width: 21%; width: 21%;
/*transform: translateX(-50%);*/ /*transform: translateX(-50%);*/

@ -551,15 +551,14 @@ export default {
position: relative; position: relative;
color: #1fabf3; color: #1fabf3;
font-size: 1.5vh; font-size: 1.5vh;
height: 100%; width: 50%;
height: 50%;
white-space: nowrap; white-space: nowrap;
display: inline-block; display: inline-block;
height: 100%;
margin-right: 12px;
vertical-align: top; vertical-align: top;
.info1 { .info1 {
position: relative; display: inline-block;
line-height: 8.5vh; line-height: 8.5vh;
color: #fffc; color: #fffc;
font-size: 15px; font-size: 15px;
@ -568,7 +567,7 @@ export default {
} }
.info2 { .info2 {
position: relative; display: inline-block;
line-height: 8.5vh; line-height: 8.5vh;
color: #fff color: #fff
} }
@ -584,5 +583,6 @@ export default {
position: absolute; position: absolute;
left: 60vh; left: 60vh;
height: 100%; height: 100%;
width: 33%;
} }
</style> </style>

@ -22,7 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item label="报警级别" prop="alarmLevelId"> <el-form-item label="报警级别" prop="alarmLevelId" v-if="false">
<el-select v-model="queryParams.alarmLevelId" placeholder="请选择报警级别" clearable> <el-select v-model="queryParams.alarmLevelId" placeholder="请选择报警级别" clearable>
<el-option <el-option
v-for="(alarmLevel, index) in alarmLevels" v-for="(alarmLevel, index) in alarmLevels"
@ -184,11 +184,32 @@
/> />
<!-- 添加或修改报警规则对话框 --> <!-- 添加或修改报警规则对话框 -->
<el-dialog :title="title" :visible.sync="open" width="660px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="660px" append-to-body :before-close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="130px" > <el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="规则名称" prop="alarmRuleName"> <el-form-item label="规则名称" prop="alarmRuleName">
<el-input v-model="form.alarmRuleName" placeholder="请输入规则名称" style="width: 240px"/> <el-input v-model="form.alarmRuleName" placeholder="请输入规则名称" style="width: 240px"/>
</el-form-item> </el-form-item>
<el-form-item label="报警级别" prop="alarmLevelId" v-if="false">
<el-select v-model="form.alarmLevelId" placeholder="请选择报警级别" style="width: 240px">
<el-option
v-for="(alarmLevel, index) in editedAlarmLevels"
:key="index"
:label="alarmLevel.alarmLevelName"
:value="alarmLevel.alarmLevelId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报警类型" prop="alarmTypeId">
<el-select v-model="form.alarmTypeId" placeholder="请选择报警类型" style="width: 240px">
<el-option
v-for="(alarmType, index) in editedAlarmTypes"
:key="index"
:label="alarmType.alarmTypeName"
:value="alarmType.alarmTypeId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属场景" prop="sceneId"> <el-form-item label="所属场景" prop="sceneId">
<el-select v-model="form.sceneId" placeholder="请选择所属场景" @input="editedSceneChange" <el-select v-model="form.sceneId" placeholder="请选择所属场景" @input="editedSceneChange"
@ -204,75 +225,43 @@
</el-form-item> </el-form-item>
<el-form-item label="设备模型" prop="deviceModeId">
<el-form-item label="报警级别" prop="alarmLevelId"> <el-select v-model="form.deviceModeId" placeholder="请选择设备模型" style="width: 240px" @change="modelChange">
<el-select v-model="form.alarmLevelId" placeholder="请选择报警级别" style="width: 240px">
<el-option <el-option
v-for="(alarmLevel, index) in editedAlarmLevels" v-for="(i, index) in models"
:key="index" :key="index"
:label="alarmLevel.alarmLevelName" :label="i.deviceModeName "
:value="alarmLevel.alarmLevelId" :value="i.deviceModeId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="报警类型" prop="alarmTypeId">
<el-select v-model="form.alarmTypeId" placeholder="请选择报警类型" style="width: 240px"> <el-form-item label="设备" prop="ruleDeviceIds">
<el-select v-model="form.ruleDeviceIds" multiple placeholder="请选择设备" :disabled="editedDisabled"
@input="editedDeviceChange" style="width: 240px">
<el-option <el-option
v-for="(alarmType, index) in editedAlarmTypes" v-for="(device, index) in devicesOptions"
:key="index" :key="index"
:label="alarmType.alarmTypeName" :label="device.deviceName"
:value="alarmType.alarmTypeId" :value="device.deviceId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="触发时间间隔" prop="triggerTimeFrame"> <el-form-item label="设备属性" prop="ruleModeFunctionIdentifier">
<el-input v-model="form.triggerTimeFrame" placeholder="请输入时间(分)" style="width: 240px"/> <el-select v-model="form.ruleModeFunctionIdentifier" placeholder="请选择设备属性"
</el-form-item> :disabled="editedDisabled" style="width: 240px">
<el-form-item label="告警联系人" prop="phoneNumbers">
<el-select v-model="form.phoneNumbers" placeholder="请选择告警联系人" style="width: 240px">
<el-option <el-option
v-for="(i, index) in phoneList" v-for="(deviceModeFunction, index) in editedDeviceModeAttributes"
:key="index" :key="index"
:label="i.nickName +'('+ i.phonenumber+')'" :label="deviceModeFunction.functionName"
:value="i.phonenumber" :value="deviceModeFunction.functionIdentifier"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="触发时间间隔" prop="triggerTimeFrame">
<el-row> <el-input v-model="form.triggerTimeFrame" placeholder="请输入时间(分)" style="width: 240px"/>
<el-col :span="12"> </el-form-item>
<el-form-item label="设备" prop="ruleDeviceId">
<el-select v-model="form.ruleDeviceId" placeholder="请选择设备" :disabled="editedDisabled"
@input="editedDeviceChange" style="width: 180px">
<el-option
v-for="(device, index) in editedDevices"
:key="index"
:label="device.deviceName"
:value="device.deviceId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备属性" prop="ruleModeFunctionIdentifier">
<el-select v-model="form.ruleModeFunctionIdentifier" placeholder="请选择设备属性"
:disabled="editedDisabled" style="width: 180px">
<el-option
v-for="(deviceModeFunction, index) in editedDeviceModeAttributes"
:key="index"
:label="deviceModeFunction.functionName"
:value="deviceModeFunction.functionIdentifier"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="触发条件" prop="triggerCondition"> <el-form-item label="触发条件" prop="triggerCondition">
<el-select v-model="form.triggerCondition" placeholder="请选择触发条件" @input="triggerConditionChange" <el-select v-model="form.triggerCondition" placeholder="请选择触发条件" @input="triggerConditionChange"
:disabled="editedDisabled" style="width: 240px"> :disabled="editedDisabled" style="width: 240px">
@ -285,20 +274,15 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="A值" prop="triggerDataA">
<el-input v-model="form.triggerDataA" placeholder="请输入A值" :disabled="editedDisabled" style="width: 180px"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="B值" prop="triggerDataB" v-if="triggerDataBVisible">
<el-input v-model="form.triggerDataB" placeholder="请输入B值" :disabled="editedDisabled" style="width: 180px"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="A值" prop="triggerDataA">
<el-input v-model="form.triggerDataA" placeholder="请输入A值" :disabled="editedDisabled"
style="width: 240px"/>
</el-form-item>
<el-form-item label="B值" prop="triggerDataB" v-if="triggerDataBVisible">
<el-input v-model="form.triggerDataB" placeholder="请输入B值" :disabled="editedDisabled"
style="width: 240px"/>
</el-form-item>
<el-form-item label="状态" prop="alarmRuleStatus"> <el-form-item label="状态" prop="alarmRuleStatus">
<el-radio-group v-model="form.alarmRuleStatus">" <el-radio-group v-model="form.alarmRuleStatus">"
<el-radio <el-radio
@ -377,6 +361,18 @@
</el-form-item> </el-form-item>
<el-form-item label="告警联系人" prop="phoneNumbers">
<el-input v-model="form.phoneNumbers" type="text" placeholder="请输入内容" style="width: 240px"/>
<!-- <el-select v-model="form.phoneNumbers" placeholder="请选择告警联系人" style="width: 240px">-->
<!-- <el-option-->
<!-- v-for="(i, index) in phoneList"-->
<!-- :key="index"-->
<!-- :label="i.nickName +'('+ i.phonenumber+')'"-->
<!-- :value="i.phonenumber"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="描述" prop="remark"> <el-form-item label="描述" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item> </el-form-item>
@ -461,8 +457,17 @@
<script> <script>
import { import {
listAlarmRule, getAlarmRule, delAlarmRule, addAlarmRule, updateAlarmRule, listAlarmRule,
getScenes, getEditedScenes, getSelectListBySceneId, getDeviceModeByDeviceId, getModeFunctionParametersByModeFunctionId getAlarmRule,
delAlarmRule,
addAlarmRule,
updateAlarmRule,
getScenes,
getEditedScenes,
getSelectListBySceneId,
getDeviceModeByDeviceId,
getModeFunctionParametersByModeFunctionId,
getDeviceByModel
} from "@/api/business/alarmRule"; } from "@/api/business/alarmRule";
import {addDeviceModeFunction} from "@/api/business/deviceModeFunction"; import {addDeviceModeFunction} from "@/api/business/deviceModeFunction";
import {listUser} from "../../../api/system/user"; import {listUser} from "../../../api/system/user";
@ -478,6 +483,8 @@ export default {
DATA_MORE_THAN_A_AND_LESS_THAN_B: 3,//AB DATA_MORE_THAN_A_AND_LESS_THAN_B: 3,//AB
DATA_LESS_THAN_A_OR_MORE_THAN_B: 4,//AB DATA_LESS_THAN_A_OR_MORE_THAN_B: 4,//AB
LINK_FLAG_YES: "1", LINK_FLAG_YES: "1",
models: [],
devicesOptions: [],
// //
loading: true, loading: true,
// //
@ -532,13 +539,13 @@ export default {
sceneId: [ sceneId: [
{required: true, message: "所属场景不能为空", trigger: "change"} {required: true, message: "所属场景不能为空", trigger: "change"}
], ],
alarmLevelId: [ // alarmLevelId: [
{required: true, message: "报警级别不能为空", trigger: "change"} // {required: true, message: "", trigger: "change"}
], // ],
alarmTypeId: [ alarmTypeId: [
{required: true, message: "报警类型不能为空", trigger: "change"} {required: true, message: "报警类型不能为空", trigger: "change"}
], ],
ruleDeviceId: [ ruleDeviceIds: [
{ {
required: true, required: true,
message: "设备不能为空", message: "设备不能为空",
@ -599,11 +606,12 @@ export default {
alarmRuleFlag: "1", alarmRuleFlag: "1",
editedScenes: [], editedScenes: [],
editedDisabled: true, editedDisabled: false,
sceneDisabled: true, sceneDisabled: false,
editedAlarmLevels: [], editedAlarmLevels: [],
editedAlarmTypes: [], editedAlarmTypes: [],
editedDevices: [], editedDevices: [],
editedModels: [],
editedDeviceModeAttributes: [], editedDeviceModeAttributes: [],
editedDeviceModeServices: [], editedDeviceModeServices: [],
@ -633,6 +641,11 @@ export default {
this.getPhoneList() this.getPhoneList()
}, },
methods: { methods: {
modelChange(modelId) {
getDeviceByModel({modelId: modelId}).then(e => {
this.devicesOptions = e.data
})
},
getPhoneList() { getPhoneList() {
listUser({ listUser({
pageNum: 1, pageNum: 1,
@ -659,6 +672,7 @@ export default {
// //
reset() { reset() {
this.editedDeviceModeAttributes = []; this.editedDeviceModeAttributes = [];
this.models = []
this.editedDevices = []; this.editedDevices = [];
this.editedAlarmTypes = []; this.editedAlarmTypes = [];
this.editedAlarmLevels = []; this.editedAlarmLevels = [];
@ -672,10 +686,11 @@ export default {
alarmLevelId: null, alarmLevelId: null,
alarmTypeId: null, alarmTypeId: null,
ruleType: '2', ruleType: '2',
ruleDeviceId: null,
ruleFunctionTotal: null, ruleFunctionTotal: null,
linkFlag: "0", linkFlag: "0",
alarmRuleStatus: "1", alarmRuleStatus: "1",
ruleDeviceId: null,
ruleDeviceIds: [],
alarmPushFlag: "0", alarmPushFlag: "0",
alarmPushContent: null, alarmPushContent: null,
alarmRecoverContent: null, alarmRecoverContent: null,
@ -691,7 +706,7 @@ export default {
triggerDataB: null, triggerDataB: null,
}; };
this.hwAlarmRuleDetailList = []; this.hwAlarmRuleDetailList = [];
this.resetForm("form"); // this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -722,20 +737,29 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.sceneDisabled = true; this.sceneDisabled = false;
this.getEditedScenes(); this.getEditedScenes();
const alarmRuleId = row.alarmRuleId || this.ids const alarmRuleId = row.alarmRuleId || this.ids
getAlarmRule(alarmRuleId).then(response => { getAlarmRule(alarmRuleId).then(response => {
console.log(response.data.ruleDeviceId)
this.form = response.data; this.form = response.data;
this.editedDisabled = response.data.alarmInfoFlag === "1"; this.editedDisabled = response.data.alarmInfoFlag === "1";
this.getEditedSelectListBySceneId(this.form.sceneId); this.getEditedSelectListBySceneId(this.form.sceneId);
this.getDeviceModeByDeviceId(this.form.ruleDeviceId); this.getDeviceModeByDeviceId(response.data.ruleDeviceId);
this.triggerDataBVisibleJudge(this.form.triggerCondition); this.triggerDataBVisibleJudge(this.form.triggerCondition);
this.alarmRuleLinkData = response.data.hwAlarmRuleLinkList; this.alarmRuleLinkData = response.data.hwAlarmRuleLinkList;
this.alarmRuleLinkVisible = response.data.linkFlag === this.LINK_FLAG_YES; this.alarmRuleLinkVisible = response.data.linkFlag === this.LINK_FLAG_YES;
this.open = true; this.open = true;
this.title = "修改报警规则"; this.title = "修改报警规则";
getSelectListBySceneId(response.data.sceneId).then(e => {
this.models = e.data["models"];
})
getDeviceByModel({modelId: response.data.deviceModeId}).then(e => {
console.log(e.data)
this.devicesOptions = e.data
})
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -851,6 +875,7 @@ export default {
getEditedSelectListBySceneId(sceneId) { getEditedSelectListBySceneId(sceneId) {
getSelectListBySceneId(sceneId).then(response => { getSelectListBySceneId(sceneId).then(response => {
this.models = response.data["models"];
this.editedDevices = response.data["devices"]; this.editedDevices = response.data["devices"];
this.editedAlarmTypes = response.data["alarmTypes"]; this.editedAlarmTypes = response.data["alarmTypes"];
this.editedAlarmLevels = response.data["alarmLevels"]; this.editedAlarmLevels = response.data["alarmLevels"];
@ -858,12 +883,14 @@ export default {
}, },
editedSceneChange(sceneId) { editedSceneChange(sceneId) {
this.models = []
this.editedDevices = []; this.editedDevices = [];
this.editedAlarmTypes = []; this.editedAlarmTypes = [];
this.editedAlarmLevels = []; this.editedAlarmLevels = [];
this.editedDeviceModeAttributes = []; this.editedDeviceModeAttributes = [];
this.form.alarmTypeId = null; this.form.alarmTypeId = null;
this.form.alarmLevelId = null; this.form.alarmLevelId = null;
this.form.ruleDeviceIds = []
this.form.ruleDeviceId = null; this.form.ruleDeviceId = null;
this.form.ruleModeFunctionIdentifier = null; this.form.ruleModeFunctionIdentifier = null;
this.alarmRuleLinkData = []; this.alarmRuleLinkData = [];
@ -881,8 +908,10 @@ export default {
}, },
editedDeviceChange(deviceId) { editedDeviceChange(deviceId) {
if (Array.isArray(deviceId) ? deviceId?.[0] : deviceId) {
this.getDeviceModeByDeviceId(Array.isArray(deviceId) ? deviceId?.[0] : deviceId);
}
this.form.ruleModeFunctionIdentifier = null; this.form.ruleModeFunctionIdentifier = null;
this.getDeviceModeByDeviceId(deviceId);
}, },
triggerDataBVisibleJudge(triggerCondition) { triggerDataBVisibleJudge(triggerCondition) {
@ -911,7 +940,7 @@ export default {
this.alarmRuleLinkForm.linkDeviceFunctionId = null; this.alarmRuleLinkForm.linkDeviceFunctionId = null;
const selectedOption = this.editedDevices.find(option => option.deviceId === deviceId); const selectedOption = this.editedDevices.find(option => option.deviceId === deviceId);
this.alarmRuleLinkForm.linkDeviceName = selectedOption.deviceName; this.alarmRuleLinkForm.linkDeviceName = selectedOption.deviceName;
this.getDeviceModeServicesByDeviceId(deviceId); this.getDeviceModeServicesByDeviceId(deviceId?.[0]);
}, },
editedLinkDeviceModeServiceChange(modeFunctionId) { editedLinkDeviceModeServiceChange(modeFunctionId) {

@ -667,11 +667,11 @@ export default {
rules: { rules: {
deviceCode: [ deviceCode: [
{required: true, message: "设备编号不能为空", trigger: "blur"}, {required: true, message: "设备编号不能为空", trigger: "blur"},
{ // {
pattern: /^[a-z0-9_]+$/, // pattern: /^[a-z0-9_]+$/,
message: "2-20个字符由小写字母、数字或下划线组成", // message: "2-20线",
trigger: "blur" // trigger: "blur"
} // }
], ],
deviceName: [ deviceName: [
{required: true, message: "设备名称不能为空", trigger: "blur"} {required: true, message: "设备名称不能为空", trigger: "blur"}
@ -860,9 +860,9 @@ export default {
this.reset(); this.reset();
const deviceId = row.deviceId || this.ids const deviceId = row.deviceId || this.ids
getDevice(deviceId).then(response => { getDevice(deviceId).then(response => {
if (response.data.deviceStatus === this.DEVICE_STATUS_PUBLISHED) { // if (response.data.deviceStatus === this.DEVICE_STATUS_PUBLISHED) {
this.confirmBtnVisible = false; // this.confirmBtnVisible = false;
} // }
if (response.data.devicePic != null) { if (response.data.devicePic != null) {
let previewFile = {}; let previewFile = {};

@ -91,6 +91,7 @@
:class="{hide: this.fileList.length >= 1}" :class="{hide: this.fileList.length >= 1}"
> >
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload> </el-upload>
<!-- 上传提示 --> <!-- 上传提示 -->

@ -6,7 +6,7 @@
<el-input v-model="form.electronicFenceName" placeholder="请输入电子围栏名称"/> <el-input v-model="form.electronicFenceName" placeholder="请输入电子围栏名称"/>
</el-form-item> </el-form-item>
<el-form-item label="所属场景" prop="sceneId"> <el-form-item label="所属场景" prop="sceneId">
<el-select v-model="form.sceneId" placeholder="请选择" :disabled="sceneDisable"> <el-select v-model="form.sceneId" placeholder="请选择" @input="editedSceneChange">
<el-option <el-option
v-for="(scene, index) in editedScenes" v-for="(scene, index) in editedScenes"
:key="index" :key="index"
@ -16,6 +16,29 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备模型" prop="deviceModeId">
<el-select v-model="form.deviceModeId" placeholder="请选择设备模型" @change="modelChange">
<el-option
v-for="(i, index) in models"
:key="index"
:label="i.deviceModeName "
:value="i.deviceModeId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备" prop="deviceId">
<el-select v-model="form.deviceId" placeholder="请选择设备">
<el-option
v-for="(device, index) in devicesOptions"
:key="index"
:label="device.deviceName"
:value="device.deviceId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="触发状态" prop="triggerStatus"> <el-form-item label="触发状态" prop="triggerStatus">
<el-select v-model="form.triggerStatus" placeholder="请选择触发状态"> <el-select v-model="form.triggerStatus" placeholder="请选择触发状态">
<el-option <el-option
@ -56,6 +79,7 @@ import {
gcj02towgs84, gcj02towgs84,
wgs84togcj02 wgs84togcj02
} from '@/utils/coordtransform' } from '@/utils/coordtransform'
import {getDeviceByModel, getSelectListBySceneId} from "@/api/business/alarmRule";
let map = null let map = null
let polyEditor = null let polyEditor = null
@ -69,6 +93,8 @@ export default {
data1: '', data1: '',
data2: '' data2: ''
}, },
models: [],
devicesOptions: [],
// //
editedScenes: [], editedScenes: [],
sceneDisable: true, sceneDisable: true,
@ -202,7 +228,7 @@ export default {
}) })
let thisPolygon = new AMap.Polygon({path: e, extData: {id: id}}); let thisPolygon = new AMap.Polygon({path: e, extData: {id: id}});
thisPolygon.on('dblclick', () => { thisPolygon.on('dblclick', () => {
if(this.alarmInfoFlag === "1"){ if (this.alarmInfoFlag === "1") {
this.$modal.msgWarning("电子围栏已经有报警信息,不能修改电子围栏区域") this.$modal.msgWarning("电子围栏已经有报警信息,不能修改电子围栏区域")
return; return;
} }
@ -210,7 +236,7 @@ export default {
polyEditor.open(); polyEditor.open();
}) })
thisPolygon.on('rightclick', () => { thisPolygon.on('rightclick', () => {
if(this.alarmInfoFlag === "1"){ if (this.alarmInfoFlag === "1") {
this.$modal.msgWarning("电子围栏已经有报警信息,不能删除电子围栏区域") this.$modal.msgWarning("电子围栏已经有报警信息,不能删除电子围栏区域")
return; return;
} }
@ -226,7 +252,7 @@ export default {
e.center = [lng, lat] e.center = [lng, lat]
let thisCircle = new AMap.Circle({center: e.center, radius: e.radius, extData: {id: id}}); let thisCircle = new AMap.Circle({center: e.center, radius: e.radius, extData: {id: id}});
thisCircle.on('dblclick', () => { thisCircle.on('dblclick', () => {
if(this.alarmInfoFlag === "1"){ if (this.alarmInfoFlag === "1") {
this.$modal.msgWarning("电子围栏已经有报警信息,不能修改电子围栏区域") this.$modal.msgWarning("电子围栏已经有报警信息,不能修改电子围栏区域")
return; return;
} }
@ -234,7 +260,7 @@ export default {
CircleEditor.open(); CircleEditor.open();
}) })
thisCircle.on('rightclick', () => { thisCircle.on('rightclick', () => {
if(this.alarmInfoFlag === "1"){ if (this.alarmInfoFlag === "1") {
this.$modal.msgWarning("电子围栏已经有报警信息,不能删除电子围栏区域") this.$modal.msgWarning("电子围栏已经有报警信息,不能删除电子围栏区域")
return; return;
} }
@ -299,6 +325,19 @@ export default {
let circleAreaList = JSON.parse(response.data.circleAreaListStr) let circleAreaList = JSON.parse(response.data.circleAreaListStr)
let polygonAreaListArr = JSON.parse(response.data.polygonAreaListStr) let polygonAreaListArr = JSON.parse(response.data.polygonAreaListStr)
if (response.data.sceneId) {
getSelectListBySceneId(response.data.sceneId).then(response => {
this.models = response.data["models"];
})
}
if (response.data.deviceModeId) {
getDeviceByModel({modelId: response.data.deviceModeId}).then(e => {
this.devicesOptions = e.data
})
}
polygonAreaListArr.forEach(e1 => { polygonAreaListArr.forEach(e1 => {
let polygonAreaListJson = JSON.parse(e1); let polygonAreaListJson = JSON.parse(e1);
let polyJsonArr = JSON.parse(polygonAreaListJson["polyJsonArr"]); let polyJsonArr = JSON.parse(polygonAreaListJson["polyJsonArr"]);
@ -353,6 +392,25 @@ export default {
this.$tab.closeOpenPage(obj); this.$tab.closeOpenPage(obj);
}, },
editedSceneChange(sceneId) {
this.$set(this.form, 'deviceModeId', null)
this.$set(this.form, 'deviceId', null)
this.models = []
this.devicesOptions = []
getSelectListBySceneId(sceneId).then(response => {
this.models = response.data["models"];
})
},
modelChange(modelId) {
this.$set(this.form, 'deviceId', null)
this.devicesOptions = []
console.log(this.form)
getDeviceByModel({modelId: modelId}).then(e => {
this.devicesOptions = e.data
})
},
} }
}; };

@ -9,16 +9,40 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="所属场景" prop="sceneId"> <el-form-item label="所属场景" prop="sceneId" >
<el-select v-model="queryParams.sceneId" placeholder="请选择" clearable> <el-select v-model="queryParams.sceneId" placeholder="请选择" @input="editedSceneChange">
<el-option <el-option
v-for="(scene, index) in scenes" v-for="(scene, index) in scenes"
:key="index" :key="index"
:label="scene.sceneName" :label="scene.sceneName"
:value="scene.sceneId" :value="scene.sceneId"
:disabled="scene.selectedDisable && scene.selectedDisable == 1"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备模型" prop="deviceModeId">
<el-select v-model="queryParams.deviceModeId" placeholder="请选择设备模型" @change="modelChange">
<el-option
v-for="(i, index) in models"
:key="index"
:label="i.deviceModeName "
:value="i.deviceModeId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备" prop="deviceId">
<el-select v-model="queryParams.deviceId" placeholder="请选择设备">
<el-option
v-for="(device, index) in devicesOptions"
:key="index"
:label="device.deviceName"
:value="device.deviceId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="触发状态" prop="sceneId"> <el-form-item label="触发状态" prop="sceneId">
<el-select v-model="queryParams.triggerStatus" placeholder="请选择触发状态" clearable> <el-select v-model="queryParams.triggerStatus" placeholder="请选择触发状态" clearable>
<el-option <el-option
@ -31,7 +55,6 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -125,12 +148,15 @@
<script> <script>
import { listElectronicFence, getElectronicFence, delElectronicFence, addElectronicFence, updateElectronicFence } from "@/api/business/electronicFence"; import { listElectronicFence, getElectronicFence, delElectronicFence, addElectronicFence, updateElectronicFence } from "@/api/business/electronicFence";
import {getScenes} from "@/api/business/device"; import {getScenes} from "@/api/business/device";
import {getDeviceByModel, getSelectListBySceneId} from "@/api/business/alarmRule";
export default { export default {
name: "ElectronicFence", name: "ElectronicFence",
dicts: ['hw_fence_trigger_status','hw_fence_type'], dicts: ['hw_fence_trigger_status','hw_fence_type'],
data() { data() {
return { return {
models:[],
devicesOptions:[],
// //
loading: true, loading: true,
// //
@ -303,7 +329,25 @@ export default {
this.download('business/electronicFence/export', { this.download('business/electronicFence/export', {
...this.queryParams ...this.queryParams
}, `electronicFence_${new Date().getTime()}.xlsx`) }, `electronicFence_${new Date().getTime()}.xlsx`)
} },
editedSceneChange(sceneId) {
this.$set(this.queryParams,'deviceModeId',null)
this.$set(this.queryParams,'deviceId',null)
this.models = []
this.devicesOptions = []
getSelectListBySceneId(sceneId).then(response => {
this.models = response.data["models"];
})
},
modelChange(modelId) {
this.$set(this.queryParams,'deviceId',null)
this.devicesOptions = []
getDeviceByModel({modelId: modelId}).then(e => {
this.devicesOptions = e.data
})
},
} }
}; };
</script> </script>

@ -112,7 +112,7 @@
<el-input v-model="form.monitorUnitName" placeholder="请输入监控单元名称"/> <el-input v-model="form.monitorUnitName" placeholder="请输入监控单元名称"/>
</el-form-item> </el-form-item>
<el-form-item label="所属场景" prop="sceneId"> <el-form-item label="所属场景" prop="sceneId">
<el-select v-model="form.sceneId" placeholder="请选择" :disabled="sceneDisable" @input="editedSceneChange"> <el-select v-model="form.sceneId" placeholder="请选择" @input="editedSceneChange" style="width: 100%">
<el-option <el-option
v-for="(scene, index) in editedScenes" v-for="(scene, index) in editedScenes"
:key="index" :key="index"
@ -128,7 +128,7 @@
placeholder="请选择父级监控单元"/> placeholder="请选择父级监控单元"/>
</el-form-item> </el-form-item>
<el-form-item label="监控单元类型" prop="monitorUnitTypeId"> <el-form-item label="监控单元类型" prop="monitorUnitTypeId">
<el-select v-model="form.monitorUnitTypeId" placeholder="请选择"> <el-select v-model="form.monitorUnitTypeId" placeholder="请选择" style="width: 100%">
<el-option <el-option
v-for="(monitorUnitType, index) in editedMonitorUnitTypes" v-for="(monitorUnitType, index) in editedMonitorUnitTypes"
:key="index" :key="index"
@ -167,6 +167,7 @@
:on-preview="handlePictureCardPreview" :on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= 1}" :class="{hide: this.fileList.length >= 1}"
> >
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>

@ -9,7 +9,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="虚拟标识" prop="vitualFlag"> <el-form-item label="虚拟标识" prop="vitualFlag" v-if="false">
<el-select v-model="queryParams.vitualFlag" placeholder="请选择虚拟标识" clearable> <el-select v-model="queryParams.vitualFlag" placeholder="请选择虚拟标识" clearable>
<el-option <el-option
v-for="dict in dict.type.hw_unit_type_vitual_flag" v-for="dict in dict.type.hw_unit_type_vitual_flag"
@ -76,7 +76,7 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="类型ID" align="center" prop="monitorUnitTypeId" /> <el-table-column label="类型ID" align="center" prop="monitorUnitTypeId" />
<el-table-column label="类型名称" align="center" prop="monitorUnitTypeName" /> <el-table-column label="类型名称" align="center" prop="monitorUnitTypeName" />
<el-table-column label="虚拟标识" align="center" prop="vitualFlag" > <el-table-column label="虚拟标识" align="center" prop="vitualFlag" v-if="false">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.hw_unit_type_vitual_flag" :value="scope.row.vitualFlag"/> <dict-tag :options="dict.type.hw_unit_type_vitual_flag" :value="scope.row.vitualFlag"/>
</template> </template>
@ -118,7 +118,7 @@
<el-input v-model="form.monitorUnitTypeName" placeholder="请输入监控单元类型名称" /> <el-input v-model="form.monitorUnitTypeName" placeholder="请输入监控单元类型名称" />
</el-form-item> </el-form-item>
<el-form-item label="所属场景" prop="sceneId"> <el-form-item label="所属场景" prop="sceneId">
<el-select v-model="form.sceneId" placeholder="请选择" :disabled="sceneDisable"> <el-select v-model="form.sceneId" placeholder="请选择" >
<el-option <el-option
v-for="(scene, index) in editedScenes" v-for="(scene, index) in editedScenes"
:key="index" :key="index"
@ -129,7 +129,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="虚拟标识" prop="vitualFlag"> <el-form-item label="虚拟标识" prop="vitualFlag" v-if="false">
<el-radio-group v-model="form.vitualFlag"> <el-radio-group v-model="form.vitualFlag">
<el-radio <el-radio
v-for="dict in dict.type.hw_unit_type_vitual_flag" v-for="dict in dict.type.hw_unit_type_vitual_flag"
@ -205,9 +205,9 @@ export default {
monitorUnitTypeName: [ monitorUnitTypeName: [
{ required: true, message: "监控单元类型名称不能为空", trigger: "blur" } { required: true, message: "监控单元类型名称不能为空", trigger: "blur" }
], ],
vitualFlag: [ // vitualFlag: [
{ required: true, message: "虚拟标识不能为空", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
], // ],
sceneId: [ sceneId: [
{ required: true, message: "所属场景不能为空", trigger: "blur" } { required: true, message: "所属场景不能为空", trigger: "blur" }
], ],

@ -32,7 +32,7 @@
</el-form-item> </el-form-item>
<el-form-item label="默认标识" prop="defaultFlag"> <el-form-item label="默认标识" prop="defaultFlag" v-if="false">
<el-select v-model="queryParams.defaultFlag" placeholder="请选择" clearable> <el-select v-model="queryParams.defaultFlag" placeholder="请选择" clearable>
<el-option <el-option
v-for="dict in dict.type.hw_scene_default_flag" v-for="dict in dict.type.hw_scene_default_flag"
@ -107,7 +107,7 @@
<el-table-column label="场景名称" align="center" prop="sceneName"/> <el-table-column label="场景名称" align="center" prop="sceneName"/>
<el-table-column label="所属租户" align="center" prop="tenantName"/> <el-table-column label="所属租户" align="center" prop="tenantName"/>
<el-table-column label="场景类型" align="center" prop="sceneModeName"/> <el-table-column label="场景类型" align="center" prop="sceneModeName"/>
<el-table-column label="默认标识" align="center" prop="defaultFlag"> <el-table-column label="默认标识" align="center" prop="defaultFlag" v-if="false">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.hw_scene_default_flag" :value="scope.row.defaultFlag"/> <dict-tag :options="dict.type.hw_scene_default_flag" :value="scope.row.defaultFlag"/>
</template> </template>
@ -171,7 +171,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="默认标识" prop="defaultFlag"> <el-form-item label="默认标识" prop="defaultFlag" v-if="false">
<el-radio-group v-model="form.defaultFlag"> <el-radio-group v-model="form.defaultFlag">
<el-radio <el-radio
v-for="dict in dict.type.hw_scene_default_flag" v-for="dict in dict.type.hw_scene_default_flag"
@ -194,10 +194,10 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="场景账号" prop="modeAccount"> <el-form-item label="场景账号" prop="modeAccount">
<el-input v-model="form.modeAccount" placeholder="自动生成" disabled/> <el-input v-model="form.modeAccount" placeholder="自动生成" />
</el-form-item> </el-form-item>
<el-form-item label="场景密码" prop="modeKey"> <el-form-item label="场景密码" prop="modeKey">
<el-input v-model="form.modeKey" placeholder="自动生成" disabled/> <el-input v-model="form.modeKey" placeholder="自动生成" />
</el-form-item> </el-form-item>
<el-form-item label="保存周期(天)" prop="preserveTime"> <el-form-item label="保存周期(天)" prop="preserveTime">
@ -227,6 +227,7 @@
:class="{hide: this.fileList.length >= 1}" :class="{hide: this.fileList.length >= 1}"
> >
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload> </el-upload>
<!-- 上传提示 --> <!-- 上传提示 -->
@ -311,7 +312,7 @@ export default {
open: false, open: false,
sceneModes: [], sceneModes: [],
tenants: [], tenants: [],
editedDisable: true, editedDisable: false,
confirmDisabled: false, confirmDisabled: false,
// //
queryParams: { queryParams: {
@ -345,9 +346,9 @@ export default {
sceneModeId: [ sceneModeId: [
{required: true, message: "场景类型不能为空", trigger: "change"} {required: true, message: "场景类型不能为空", trigger: "change"}
], ],
defaultFlag: [ // defaultFlag: [
{required: true, message: "默认标识不能为空", trigger: "change"} // {required: true, message: "", trigger: "change"}
], // ],
authMode: [ authMode: [
{required: true, message: "认证方式不能为空", trigger: "change"} {required: true, message: "认证方式不能为空", trigger: "change"}
], ],
@ -453,7 +454,7 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.editedDisable = true; // this.editedDisable = true;
this.confirmDisabled = false; this.confirmDisabled = false;
const sceneId = row.sceneId || this.ids const sceneId = row.sceneId || this.ids
getScene(sceneId).then(response => { getScene(sceneId).then(response => {

@ -344,4 +344,4 @@ export default {
} }
} }
}; };
</script> </script>

@ -10,7 +10,16 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="权限字符" prop="roleKey"> <el-form-item label="所属租户" prop="tenantId">
<el-input
v-model="queryParams.tenantId"
placeholder="请输入所属租户"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="权限字符" prop="roleKey" v-if="false">
<el-input <el-input
v-model="queryParams.roleKey" v-model="queryParams.roleKey"
placeholder="请输入权限字符" placeholder="请输入权限字符"
@ -94,7 +103,7 @@
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="角色编号" prop="roleId" width="120"/> <el-table-column label="角色编号" prop="roleId" width="120"/>
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150"/> <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150"/> <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" v-if="false"/>
<el-table-column label="显示顺序" prop="roleSort" width="100"/> <el-table-column label="显示顺序" prop="roleSort" width="100"/>
<el-table-column label="所属租户" prop="tenantName" width="100"/> <el-table-column label="所属租户" prop="tenantName" width="100"/>
<el-table-column label="状态" align="center" width="100"> <el-table-column label="状态" align="center" width="100">
@ -160,7 +169,17 @@
<el-form-item label="角色名称" prop="roleName"> <el-form-item label="角色名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入角色名称"/> <el-input v-model="form.roleName" placeholder="请输入角色名称"/>
</el-form-item> </el-form-item>
<el-form-item prop="roleKey"> <el-form-item label="所属租户" prop="tenantId">
<el-select v-model="form.tenantId" placeholder="请选择" clearable>
<el-option
v-for="(tenant, index) in tenants"
:key="index"
:label="tenant.tenantName"
:value="tenant.tenantId"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="roleKey" v-if="false">
<span slot="label"> <span slot="label">
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top"> <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
<i class="el-icon-question"></i> <i class="el-icon-question"></i>
@ -216,7 +235,7 @@
<el-input v-model="form.roleName" :disabled="true"/> <el-input v-model="form.roleName" :disabled="true"/>
</el-form-item> </el-form-item>
<el-form-item label="权限字符"> <el-form-item label="权限字符">
<el-input v-model="form.roleKey" :disabled="true"/> <el-input v-model="form.roleKey" :disabled="true" v-if="false"/>
</el-form-item> </el-form-item>
<el-form-item label="权限范围"> <el-form-item label="权限范围">
<el-select v-model="form.dataScope" @change="dataScopeSelectChange"> <el-select v-model="form.dataScope" @change="dataScopeSelectChange">
@ -267,6 +286,7 @@ import {
deptTreeSelect deptTreeSelect
} from "@/api/system/role"; } from "@/api/system/role";
import {treeselect as menuTreeselect, roleMenuTreeselect} from "@/api/system/menu"; import {treeselect as menuTreeselect, roleMenuTreeselect} from "@/api/system/menu";
import {getTenants} from "@/api/system/user";
export default { export default {
name: "Role", name: "Role",
@ -287,6 +307,8 @@ export default {
total: 0, total: 0,
// //
roleList: [], roleList: [],
//
tenants: [],
// //
title: "", title: "",
// //
@ -335,7 +357,9 @@ export default {
status: undefined status: undefined
}, },
// //
form: {}, form: {
roleKey:'iot'
},
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "label" label: "label"
@ -345,9 +369,12 @@ export default {
roleName: [ roleName: [
{required: true, message: "角色名称不能为空", trigger: "blur"} {required: true, message: "角色名称不能为空", trigger: "blur"}
], ],
roleKey: [ tenantId:[
{required: true, message: "权限字符不能为空", trigger: "blur"} {required: true, message: "所属租户不能为空", trigger: "blur"}
], ],
// roleKey: [
// {required: true, message: "", trigger: "blur"}
// ],
roleSort: [ roleSort: [
{required: true, message: "角色顺序不能为空", trigger: "blur"} {required: true, message: "角色顺序不能为空", trigger: "blur"}
] ]
@ -356,9 +383,18 @@ export default {
}; };
}, },
created() { created() {
this.getTenants();
this.getList(); this.getList();
}, },
methods: { methods: {
/** 获取租户信息列表 */
getTenants() {
getTenants().then(response => {
if (response.data !== undefined) {
this.tenants = response.data;
}
});
},
/** 查询角色列表 */ /** 查询角色列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -440,7 +476,7 @@ export default {
this.form = { this.form = {
roleId: undefined, roleId: undefined,
roleName: undefined, roleName: undefined,
roleKey: undefined, roleKey: "iot",
roleSort: 0, roleSort: 0,
status: "0", status: "0",
menuIds: [], menuIds: [],

Loading…
Cancel
Save