|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div style="cursor: default; position: relative">
|
|
|
+ <div style="cursor: default; position: relative;width: 99%">
|
|
|
<search-bar
|
|
|
@fun="getDisplayType"
|
|
|
:displayType="displayType"
|
|
|
@@ -18,6 +18,7 @@
|
|
|
:xl="6"
|
|
|
v-for="item in equipList"
|
|
|
:key="item.imei"
|
|
|
+ style="margin-bottom:10px;"
|
|
|
>
|
|
|
<el-card class="box-card">
|
|
|
<!-- <span :class="['on-stauts', item.is_online == 1 ? 'on' : 'off']"></span> -->
|
|
|
@@ -395,7 +396,7 @@
|
|
|
v-model="equipContrlForm.clt"
|
|
|
show-input
|
|
|
></el-slider>
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
size="mini"
|
|
|
@click="qingchong"
|
|
|
style="
|
|
|
@@ -406,15 +407,22 @@
|
|
|
color: #fff;
|
|
|
"
|
|
|
>清虫</el-button
|
|
|
- >
|
|
|
+ > -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item class="handAddFormBtn">
|
|
|
- <el-button type="primary" size="mini" @click="equipControlSubm"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="controlActionLoading"
|
|
|
+ size="mini"
|
|
|
+ @click="equipControlSubm"
|
|
|
>确定</el-button
|
|
|
>
|
|
|
- <el-button size="mini" @click="equipControlDialogVisible = false"
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ :loading="controlActionLoading"
|
|
|
+ @click="equipControlDialogVisible = false"
|
|
|
>取消</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
@@ -506,6 +514,7 @@
|
|
|
:options="versionsoptions"
|
|
|
:props="defaultParams"
|
|
|
:clearable="true"
|
|
|
+ filterable
|
|
|
placeholder="请选择隶属组织"
|
|
|
></el-cascader>
|
|
|
</el-form-item>
|
|
|
@@ -513,6 +522,7 @@
|
|
|
<el-select
|
|
|
v-model="ruleForm.point_id"
|
|
|
placeholder="请选择所在监测点"
|
|
|
+ filterable
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in traponsoptions"
|
|
|
@@ -571,6 +581,50 @@
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ class="map_dialog"
|
|
|
+ title="地图选点"
|
|
|
+ :visible.sync="addLocationDialogVisible"
|
|
|
+ width="820px"
|
|
|
+ @closed="addLocationDialogClosed"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :inline="true"
|
|
|
+ :model="locationForm"
|
|
|
+ class="demo-form-inline"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ <el-form-item label="经度">
|
|
|
+ <el-input clearable v-model="locationForm.lng"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="纬度">
|
|
|
+ <el-input clearable v-model="locationForm.lat"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" size="mini" @click="locationSearch"
|
|
|
+ >定位</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入地区检索"
|
|
|
+ v-model="addr"
|
|
|
+ clearable
|
|
|
+ @change="addrChange()"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="amap-demo" id="mapContainer2" style="height: 400px"></div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="addLocationDialogVisible = false" size="mini"
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="addLocationSubm" size="mini"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 批量下发弹框 -->
|
|
|
<el-dialog
|
|
|
@@ -721,6 +775,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { assign } from 'lodash-es';
|
|
|
import SearchBar from '@/components/SearchBar';
|
|
|
import Circulation from '../../../../static/js/equipState_dict.json';
|
|
|
|
|
|
@@ -896,7 +951,15 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
center: [114.05, 22.55],
|
|
|
- releaseTF: false
|
|
|
+ releaseTF: false,
|
|
|
+ addLocationDialogVisible: false,
|
|
|
+ locationForm: {
|
|
|
+ lng: '',
|
|
|
+ lat: ''
|
|
|
+ },
|
|
|
+ addr: '', //搜索栏地址
|
|
|
+ address: '', //地图上标签地址
|
|
|
+ controlActionLoading: false
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -970,6 +1033,7 @@ export default {
|
|
|
this.$refs.screenData.searchVal = this.$route.query.id;
|
|
|
}
|
|
|
this.getEquipList();
|
|
|
+ this.getmon();
|
|
|
},
|
|
|
|
|
|
activated() {
|
|
|
@@ -1351,7 +1415,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
equipControlSubm() {
|
|
|
- let obj = this.equipContrlForm;
|
|
|
+ let obj = assign({}, this.equipContrlForm);
|
|
|
if (obj.st) {
|
|
|
obj.st =
|
|
|
obj.st && obj.st.slice(0, 2).charAt(0) != '0'
|
|
|
@@ -1372,7 +1436,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- console.log(obj);
|
|
|
+ console.log(obj, '--------------------------- device control submit');
|
|
|
+
|
|
|
+ this.controlActionLoading = true;
|
|
|
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
@@ -1382,14 +1448,21 @@ export default {
|
|
|
d_id: this.d_id,
|
|
|
config: JSON.stringify(obj)
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
- if (res.data.message == '') {
|
|
|
- this.$resetMessage.success('设备控制修改成功');
|
|
|
- } else {
|
|
|
- this.$resetMessage.error('设备控制修改失败');
|
|
|
- }
|
|
|
- this.equipControlDialogVisible = false;
|
|
|
- });
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.message == '') {
|
|
|
+ this.$message.success('设备控制修改成功');
|
|
|
+ } else {
|
|
|
+ this.$message.error('设备控制修改失败');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ // 设备控制下发有延迟,延迟一秒关闭
|
|
|
+ setTimeout(() => {
|
|
|
+ this.controlActionLoading = false;
|
|
|
+ this.equipControlDialogVisible = false;
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
},
|
|
|
equipControlDialogClosed() {
|
|
|
this.$refs.equipContrlRef.resetFields();
|
|
|
@@ -1654,6 +1727,148 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ getmon() {
|
|
|
+ //获取监测点列表 组织列表
|
|
|
+ this.$axios({
|
|
|
+ method: 'POST',
|
|
|
+ url: '/api/api_gateway?method=sysmenage.usermanager.org_list',
|
|
|
+ data: this.qs.stringify({
|
|
|
+ page_item: '100000000'
|
|
|
+ })
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res.data.data);
|
|
|
+ // this.versionsoptions = res.data.data.page_list; //组织
|
|
|
+ var arr = res.data.data.page_list; //组织
|
|
|
+ console.log(this.versionsoptions);
|
|
|
+ if (arr[0].parent_name == '根组织') {
|
|
|
+ this.versionsoptions = arr;
|
|
|
+ } else {
|
|
|
+ var obj = {
|
|
|
+ id: arr[0].id,
|
|
|
+ org_name: arr[0].org_name,
|
|
|
+ childrens: []
|
|
|
+ };
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
+ obj.childrens.push(arr[i]);
|
|
|
+ obj.id = arr[0].parent_id;
|
|
|
+ obj.org_name = arr[0].parent_name;
|
|
|
+ }
|
|
|
+ // this.versionsoptions.push(obj);
|
|
|
+ this.versionsoptions = arr;
|
|
|
+ }
|
|
|
+ console.log(
|
|
|
+ this.versionsoptions,
|
|
|
+ '----------------- versionsoptions',
|
|
|
+ obj
|
|
|
+ );
|
|
|
+ this.traponsoptions = res.data.data.point_data;
|
|
|
+ this.inducer_data = res.data.data.inducer_data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ console.log(document.getElementById('mapContainer2'));
|
|
|
+ var map = new AMap.Map('mapContainer2', {
|
|
|
+ center: this.center,
|
|
|
+ resizeEnable: true,
|
|
|
+ zoom: 10,
|
|
|
+ lang: 'en'
|
|
|
+ });
|
|
|
+ AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
|
|
|
+ map.addControl(new AMap.ToolBar());
|
|
|
+ this.geocoder = new AMap.Geocoder({
|
|
|
+ city: '全国',
|
|
|
+ radius: 1000
|
|
|
+ });
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ var marker = new AMap.Marker({
|
|
|
+ position: this.center
|
|
|
+ });
|
|
|
+ console.log(this.center);
|
|
|
+ marker.setMap(map);
|
|
|
+ }, 1000);
|
|
|
+ this.map = map;
|
|
|
+ this.testevent();
|
|
|
+ },
|
|
|
+ addrChange() {
|
|
|
+ //位置搜索
|
|
|
+ var marker = new AMap.Marker();
|
|
|
+ this.geocoder.getLocation(this.addr, (status, result) => {
|
|
|
+ if (status === 'complete' && result.geocodes.length) {
|
|
|
+ var lnglat = result.geocodes[0].location;
|
|
|
+ marker.setPosition(lnglat);
|
|
|
+ this.map.add(marker);
|
|
|
+ this.map.setFitView(marker);
|
|
|
+ this.locationForm = {
|
|
|
+ lat: lnglat.lat,
|
|
|
+ lng: lnglat.lng
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ if (document.getElementsByClassName('el-message').length == 0) {
|
|
|
+ this.$message.error('根据地址查询位置失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 地图点击事件
|
|
|
+ testevent() {
|
|
|
+ this.map.on('click', ev => {
|
|
|
+ var lnglat = [ev.lnglat.lng, ev.lnglat.lat];
|
|
|
+ this.locationForm = { lng: lnglat[0], lat: lnglat[1] };
|
|
|
+ this.map.clearMap();
|
|
|
+ var marker = new AMap.Marker({
|
|
|
+ position: lnglat
|
|
|
+ });
|
|
|
+ marker.setMap(this.map);
|
|
|
+ this.getAddress(lnglat);
|
|
|
+ setTimeout(() => {
|
|
|
+ new AMap.InfoWindow({
|
|
|
+ content: '<h5>' + '当前选中地址' + '</h5>' + this.address,
|
|
|
+ offset: new AMap.Pixel(0, -32)
|
|
|
+ }).open(this.map, lnglat);
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getAddress(lnglat) {
|
|
|
+ AMap.plugin('AMap.Geocoder', () => {
|
|
|
+ this.geocoder.getAddress(lnglat, (status, result) => {
|
|
|
+ if (status === 'complete' && result.info === 'OK') {
|
|
|
+ this.address = result.regeocode.formattedAddress;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addLocationSubm() {
|
|
|
+ //点击确定
|
|
|
+ this.ruleForm.lng = this.locationForm.lng;
|
|
|
+ this.ruleForm.lat = this.locationForm.lat;
|
|
|
+ console.log(this.ruleForm);
|
|
|
+ this.city(
|
|
|
+ this.ToDigital(this.ruleForm.lat),
|
|
|
+ this.ToDigital(this.ruleForm.lng)
|
|
|
+ );
|
|
|
+ this.addLocationDialogVisible = false;
|
|
|
+ },
|
|
|
+ addLocationDialogClosed() {
|
|
|
+ //弹框关闭时
|
|
|
+ // this.locationForm = { lat: "", lng: "" };
|
|
|
+ this.center = [114.05, 22.55];
|
|
|
+ this.map = null;
|
|
|
+ },
|
|
|
+ locationSearch() {
|
|
|
+ if (this.locationForm.lat && this.locationForm.lng) {
|
|
|
+ let lnglat = [this.locationForm.lng, this.locationForm.lat];
|
|
|
+ var marker = new AMap.Marker({
|
|
|
+ position: lnglat
|
|
|
+ });
|
|
|
+ marker.setMap(this.map);
|
|
|
+ } else {
|
|
|
+ if (document.getElementsByClassName('el-message').length == 0) {
|
|
|
+ this.$message.warning('请输入经纬度!');
|
|
|
+ }
|
|
|
+ // return fasle;
|
|
|
+ }
|
|
|
+ },
|
|
|
dingwei() {
|
|
|
if (this.ruleForm.lng != '' && this.ruleForm.lng != 0) {
|
|
|
this.center[0] = this.ToDigital(this.ruleForm.lng);
|
|
|
@@ -1810,8 +2025,7 @@ export default {
|
|
|
this.releaseTF = true;
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- url:
|
|
|
- '/api/api_gateway?method=monitor_manage.cbd_manage.add_device_info',
|
|
|
+ url: '/api/api_gateway?method=forecast.worm_lamp.add_device_info',
|
|
|
data: this.qs.stringify({
|
|
|
org_id: org_id, // 非必传(num) 诱捕器id 修改项
|
|
|
point_id: this.ruleForm.point_id, // 必传(string) 设备编号
|
|
|
@@ -1821,36 +2035,40 @@ export default {
|
|
|
device_name: this.ruleForm.device_name,
|
|
|
city: this.ruleForm.basecity
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
- console.log(res);
|
|
|
- if (res.data.data) {
|
|
|
- // var message = "";
|
|
|
- // if (this.parameter == "add") {
|
|
|
- // // console.log(this.$data.addtitle)
|
|
|
- // message = "添加成功!";
|
|
|
- // } else if (this.parameter == "modify") {
|
|
|
- // message = "修改成功!";
|
|
|
- // }
|
|
|
- if (document.getElementsByClassName('el-message').length == 0) {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '修改成功!',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- }
|
|
|
- this.operationDialogVisible = false;
|
|
|
- this.getEquipList();
|
|
|
- } else {
|
|
|
- if (document.getElementsByClassName('el-message').length == 0) {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '添加失败' + res.data.message,
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.data.data) {
|
|
|
+ // var message = "";
|
|
|
+ // if (this.parameter == "add") {
|
|
|
+ // // console.log(this.$data.addtitle)
|
|
|
+ // message = "添加成功!";
|
|
|
+ // } else if (this.parameter == "modify") {
|
|
|
+ // message = "修改成功!";
|
|
|
+ // }
|
|
|
+ if (document.getElementsByClassName('el-message').length == 0) {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '修改成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.operationDialogVisible = false;
|
|
|
+ this.getEquipList();
|
|
|
+ } else {
|
|
|
+ if (document.getElementsByClassName('el-message').length == 0) {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '添加失败' + res.data.message,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- this.releaseTF = false;
|
|
|
- });
|
|
|
+ this.releaseTF = false;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.releaseTF = false;
|
|
|
+ });
|
|
|
} else {
|
|
|
if (document.getElementsByClassName('el-message').length == 0) {
|
|
|
this.$message({
|
|
|
@@ -2084,6 +2302,24 @@ export default {
|
|
|
color: rgb(23, 187, 137);
|
|
|
}
|
|
|
|
|
|
+.haiguan {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ margin-top: 5px;
|
|
|
+ .haiguan_item {
|
|
|
+ // width: 70px;
|
|
|
+ height: 20px;
|
|
|
+ border: 1px solid #d4d2d2;
|
|
|
+ line-height: 20px;
|
|
|
+ margin-right: 10px;
|
|
|
+ padding: 2px 10px;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+ .haiguan_itemnone {
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.buttonbox {
|
|
|
margin-bottom: 23px;
|
|
|
padding-left: 100px;
|