修改地图标点

master
夜笙歌 3 months ago
parent 7e8b434406
commit 135f53f331

@ -53,6 +53,14 @@ export function selectComparison(data) {
params:data params:data
}) })
} }
// 传感器属性
export function selectAttributeByUnitId(query) {
return request({
url: '/business/hwMonitorUnitAttribute/selectAttributeByUnitId',
method: 'get',
params: query
})
}
// 历史记录 // 历史记录

@ -80,3 +80,38 @@ export function getEditedMonitorUnits(query) {
}) })
} }
// 新增属性
export function addUnitAttribute(data) {
return request({
url: '/business/hwMonitorUnitAttribute/addUnitAttribute',
method: 'post',
data: data
})
}
// 查询属性
export function selectAttributeByUnitId(query) {
return request({
url: '/business/hwMonitorUnitAttribute/selectAttributeByUnitId',
method: 'get',
params: query
})
}
// 更新属性
export function updateAttributeByUniitId(data) {
return request({
url: '/business/hwMonitorUnitAttribute/updateAttributeByUniitId',
method: 'post',
data: data
})
}
// 删除属性
export function deleteAttributeByUniitId(query) {
return request({
url: '/business/hwMonitorUnitAttribute/deleteAttributeByUniitId/'+query,
method: 'delete',
// params: query
})
}

@ -250,13 +250,16 @@
<template slot="label"> <template slot="label">
告警类型 告警类型
</template> </template>
{{ warInfo.alarmTypeName }} {{ warInfo.alarmInfoType === '1' ? '设备报警' : '' }}
{{ warInfo.alarmInfoType === '2' ? '监控单元报警' : '' }}
{{ warInfo.alarmInfoType === '3' ? '离线报警' : '' }}
{{ warInfo.alarmInfoType === '4' ? '电子围栏' : '' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
告警位置 告警位置
</template> </template>
{{ warInfo.location }} {{ warInfo.monitorUnitName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">

@ -21,10 +21,10 @@
<span>名称</span> <span>名称</span>
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitName }}</span> <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitName }}</span>
</p> </p>
<p> <!-- <p>-->
<span>ID</span> <!-- <span>ID</span>-->
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitId }}</span> <!-- <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitId }}</span>-->
</p> <!-- </p>-->
<p> <p>
<span>状态</span> <span>状态</span>
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitStatus === '1' ? '正常' : '异常' }}</span> <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitStatus === '1' ? '正常' : '异常' }}</span>
@ -33,6 +33,10 @@
<span>类型</span> <span>类型</span>
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitTypeName }}</span> <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitTypeName }}</span>
</p> </p>
<p v-for="i in propList">
<span>{{ i.attributeName }}</span>
<span style="color: #d9dee3">{{ i.attributeValue }}</span>
</p>
</div> </div>
<div v-if="show" <div v-if="show"
:style="'background-image: url('+(MonitorInfo.monitorPic ? MonitorInfo.monitorPic :defaultImg)+');'" :style="'background-image: url('+(MonitorInfo.monitorPic ? MonitorInfo.monitorPic :defaultImg)+');'"
@ -209,7 +213,7 @@ import {
publishControlCommand, publishControlCommand,
selectHistoryAndTrendAnalysis, selectHistoryAndTrendAnalysis,
selectComparison, selectComparison,
exportData exportData, selectAttributeByUnitId
} from '@/api/board/equipment' } from '@/api/board/equipment'
import defaultImg from '@/assets/board/equipment/icon.png' import defaultImg from '@/assets/board/equipment/icon.png'
import defaultImg1 from '@/assets/board/equipment/icon2.png' import defaultImg1 from '@/assets/board/equipment/icon2.png'
@ -236,6 +240,8 @@ export default {
defaultImg2, defaultImg2,
bgImg, bgImg,
bgImg1, bgImg1,
propList: [],
rules: { rules: {
sensor: [ sensor: [
{validator: validatePass, trigger: 'change'} {validator: validatePass, trigger: 'change'}
@ -337,6 +343,7 @@ export default {
this.monitorUnitId = e.id this.monitorUnitId = e.id
await this.getDevice(e.id) await this.getDevice(e.id)
await this.setMonitorById(e) await this.setMonitorById(e)
await this.getPropList(e)
this.show = true this.show = true
if (typeof getDeviceInterval === 'number') { if (typeof getDeviceInterval === 'number') {
clearInterval(getDeviceInterval) clearInterval(getDeviceInterval)
@ -358,6 +365,10 @@ export default {
const {data} = await getMonitorById(e.id) const {data} = await getMonitorById(e.id)
this.MonitorInfo = data this.MonitorInfo = data
}, },
async getPropList(e) {
const {data} = await selectAttributeByUnitId({monitorUnitId: e.id})
this.propList = data
},
toHistory(e, i) { toHistory(e, i) {
// this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}}); // this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}});
this.historyDialog = true this.historyDialog = true

@ -104,7 +104,7 @@
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="90%"> width="90%">
<div class="dialog"> <div class="dialog">
<Sensor :dialogData="dialogData"/> <Sensor :dialogData="dialogData" v-if="dialogVisible"/>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -206,8 +206,6 @@ export default {
this.deviceList = data this.deviceList = data
}, },
toHistory(e, i) { toHistory(e, i) {
console.log(e)
console.log(i)
this.dialogData = {id: e, deviceModeId: i} this.dialogData = {id: e, deviceModeId: i}
this.dialogVisible = true this.dialogVisible = true
@ -318,13 +316,16 @@ export default {
} }
} }
} }
.longText { .longText {
width: 6.5vw; width: 6.5vw;
overflow: hidden; overflow: hidden;
} }
/deep/ .el-dialog:not(.is-fullscreen) { /deep/ .el-dialog:not(.is-fullscreen) {
margin-top: 1vh !important; margin-top: 1vh !important;
} }
.dialog { .dialog {
.container { .container {
height: 86vh; height: 86vh;

@ -249,13 +249,17 @@
<template slot="label"> <template slot="label">
告警类型 告警类型
</template> </template>
{{ warInfo.alarmTypeName }} {{ warInfo.alarmInfoType === '1' ? '设备报警' : '' }}
{{ warInfo.alarmInfoType === '2' ? '监控单元报警' : '' }}
{{ warInfo.alarmInfoType === '3' ? '离线报警' : '' }}
{{ warInfo.alarmInfoType === '4' ? '电子围栏' : '' }}
<!-- {{ warInfo.alarmTypeName }}-->
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
告警位置 告警位置
</template> </template>
{{ warInfo.location }} {{ warInfo.monitorUnitName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">

@ -200,17 +200,6 @@
</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-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"
:disabled="sceneDisabled" style="width: 240px"> :disabled="sceneDisabled" style="width: 240px">
@ -222,7 +211,17 @@
:disabled="scene.selectedDisable && scene.selectedDisable == 1" :disabled="scene.selectedDisable && scene.selectedDisable == 1"
></el-option> ></el-option>
</el-select> </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>
<el-form-item label="设备模型" prop="deviceModeId"> <el-form-item label="设备模型" prop="deviceModeId">
@ -744,7 +743,7 @@ export default {
getAlarmRule(alarmRuleId).then(response => { getAlarmRule(alarmRuleId).then(response => {
console.log(response.data.ruleDeviceId) 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(response.data.ruleDeviceId); this.getDeviceModeByDeviceId(response.data.ruleDeviceId);
this.triggerDataBVisibleJudge(this.form.triggerCondition); this.triggerDataBVisibleJudge(this.form.triggerCondition);

@ -77,6 +77,14 @@
<el-table-column label="监控单元类型" align="center" prop="monitorUnitTypeName"/> <el-table-column label="监控单元类型" align="center" prop="monitorUnitTypeName"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="addProp(scope.row)"
v-hasPermi="['business:monitorUnit:edit']"
>绑定属性
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -199,13 +207,87 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="修改属性" :visible.sync="propDialog" width="500px" append-to-body>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="propAdd"
>新增
</el-button>
</el-col>
</el-row>
<el-table
:data="propList"
>
<el-table-column label="属性名称" prop="attributeName"/>
<el-table-column label="属性值" prop="attributeValue"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="propUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="propDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="propDialog = false;propList = []"> </el-button>
</div>
</el-dialog>
<el-dialog :title="title1" :visible.sync="addPropDialog" width="500px" append-to-body>
<el-form ref="form" :model="propForm" :rules="rules" label-width="108px">
<el-form-item label="id" prop="attributeId" v-if="false">
<el-input v-model="propForm.attributeId"/>
</el-form-item>
<el-form-item label="属性名称" prop="attributeName">
<el-input v-model="propForm.attributeName" placeholder="请输入属性名称"/>
</el-form-item>
<el-form-item label="属性值" prop="attributeValue">
<el-input v-model="propForm.attributeValue" placeholder="请输入属性值"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="propSubmitForm"> </el-button>
<el-button @click="propCancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
listMonitorUnit, getMonitorUnit, delMonitorUnit, addMonitorUnit, updateMonitorUnit listMonitorUnit,
, getMonitorUnitTypes, getScenes, getEditedScenes,getEditedMonitorUnits getMonitorUnit,
delMonitorUnit,
addMonitorUnit,
updateMonitorUnit,
getMonitorUnitTypes,
getScenes,
getEditedScenes,
getEditedMonitorUnits,
addUnitAttribute,
selectAttributeByUnitId,
updateAttributeByUniitId,
deleteAttributeByUniitId
} from "@/api/business/monitorUnit"; } from "@/api/business/monitorUnit";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -241,6 +323,12 @@ export default {
}, },
data() { data() {
return { return {
propDialog: false,
propList: [],
addPropDialog: false,
propForm: {},
title1: '',
propQuery:{},
// //
loading: true, loading: true,
// //
@ -589,6 +677,72 @@ export default {
} }
return strs != '' ? strs.substr(0, strs.length - 1) : ''; return strs != '' ? strs.substr(0, strs.length - 1) : '';
}, },
addProp(e) {
this.propQuery = e
this.propDialog = true
selectAttributeByUnitId({monitorUnitId: e.monitorUnitId}).then(res => {
this.propList = res.data
})
},
propAdd() {
this.addPropDialog = true
this.title1 = '添加属性'
},
propDelete(e){
this.$confirm('确认删除该属性?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteAttributeByUniitId(e.attributeId).then(v=>{
this.$message({
type: 'success',
message: '删除成功!'
});
selectAttributeByUnitId({monitorUnitId: this.propQuery.monitorUnitId}).then(res => {
this.propList = res.data
})
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
propUpdate(e){
this.addPropDialog = true
this.title1 = '修改属性'
this.propForm = JSON.parse(JSON.stringify(e))
},
async propSubmitForm(){
if(this.propForm.attributeId){
await updateAttributeByUniitId({
...this.propForm,
monitorUnitId:this.propQuery.monitorUnitId
}).then(e=>{
this.$modal.msgSuccess("修改成功");
this.addPropDialog = false
this.propForm = {}
})
}else{
await addUnitAttribute({
...this.propForm,
monitorUnitId:this.propQuery.monitorUnitId
}).then(e=>{
this.$modal.msgSuccess("添加成功");
this.addPropDialog = false
this.propForm = {}
})
}
selectAttributeByUnitId({monitorUnitId: this.propQuery.monitorUnitId}).then(res => {
this.propList = res.data
})
},
propCancel(){
this.addPropDialog = false
this.propForm = {}
}
} }
}; };

@ -38,8 +38,12 @@ module.exports = {
// target: `http://127.0.0.1:9080`, // target: `http://127.0.0.1:9080`,
// target: `http://10.11.40.120:9080`, // target: `http://10.11.40.120:9080`,
// target: `http://10.11.43.111:8080`, // target: `http://10.11.43.111:8080`,
target: `http://10.11.43.111:9088`, // target: `http://10.11.41.54:9080`,
// target: `http://175.27.215.92:9080`, // target: `http://175.27.215.92:9080`,
target: `http://124.223.15.102:9080`,
// target: `http://10.11.41.54:9080`,
// target: `http://10.11.40.122:9080`,
// target: `http://10.11.43.177:9080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save