|
@@ -1,254 +1,230 @@
|
|
|
-<!-- 设备管理 -->
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<div class="innerMargin">
|
|
<div class="innerMargin">
|
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
|
- <div style="cursor: default">
|
|
|
|
|
- <div class="search-box">
|
|
|
|
|
- <div class="filter-box">
|
|
|
|
|
- <el-select
|
|
|
|
|
- size="small"
|
|
|
|
|
- v-model="queryInfo.device_type_id"
|
|
|
|
|
- clearable
|
|
|
|
|
- placeholder="请选择设备类型"
|
|
|
|
|
- @change="searchChange()"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option label="杀虫灯" value="2"></el-option>
|
|
|
|
|
- <el-option label="测报灯" value="3"></el-option>
|
|
|
|
|
- <el-option label="智能性诱" value="4"></el-option>
|
|
|
|
|
- <el-option label="环境监测" value="5"></el-option>
|
|
|
|
|
- <el-option label="监控设备" value="6"></el-option>
|
|
|
|
|
- <el-option label="孢子仪" value="7"></el-option>
|
|
|
|
|
- <el-option label="性诱设备" value="8"></el-option>
|
|
|
|
|
- <el-option label="糖醋测报" value="9"></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- <el-input
|
|
|
|
|
- style="cursor: pointer"
|
|
|
|
|
- size="small"
|
|
|
|
|
- clearable
|
|
|
|
|
- @change="searchChange()"
|
|
|
|
|
- placeholder="请输入设备ID"
|
|
|
|
|
- v-model="queryInfo.f_id"
|
|
|
|
|
- >
|
|
|
|
|
- <i slot="suffix" class="el-input__icon el-icon-search"></i>
|
|
|
|
|
- </el-input>
|
|
|
|
|
- </div>
|
|
|
|
|
- <el-date-picker
|
|
|
|
|
|
|
+ <div style="cursor: default">
|
|
|
|
|
+ <div class="search-box">
|
|
|
|
|
+ <div class="filter-box">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ v-model="queryInfo.device_type_id"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ placeholder="请选择设备类型"
|
|
|
|
|
+ @change="searchChange()"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label="杀虫灯" value="2"></el-option>
|
|
|
|
|
+ <el-option label="测报灯" value="3"></el-option>
|
|
|
|
|
+ <el-option label="智能性诱" value="4"></el-option>
|
|
|
|
|
+ <el-option label="环境监测" value="5"></el-option>
|
|
|
|
|
+ <el-option label="监控设备" value="6"></el-option>
|
|
|
|
|
+ <el-option label="孢子仪" value="7"></el-option>
|
|
|
|
|
+ <el-option label="性诱设备" value="8"></el-option>
|
|
|
|
|
+ <el-option label="糖醋测报" value="9"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-input
|
|
|
style="cursor: pointer"
|
|
style="cursor: pointer"
|
|
|
size="small"
|
|
size="small"
|
|
|
- @change="DateChange()"
|
|
|
|
|
- v-model="timeRange"
|
|
|
|
|
- type="daterange"
|
|
|
|
|
- range-separator="至"
|
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
|
- ></el-date-picker>
|
|
|
|
|
- </div>
|
|
|
|
|
- <el-row :gutter="10">
|
|
|
|
|
- <el-col
|
|
|
|
|
- :xs="24"
|
|
|
|
|
- :sm="24"
|
|
|
|
|
- :md="12"
|
|
|
|
|
- :lg="6"
|
|
|
|
|
- :xl="4"
|
|
|
|
|
- v-for="item in dataList"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @change="searchChange()"
|
|
|
|
|
+ placeholder="请输入设备ID"
|
|
|
|
|
+ v-model="queryInfo.f_id"
|
|
|
>
|
|
>
|
|
|
- <el-card class="box-card pad0">
|
|
|
|
|
- <i class="del-icon el-icon-delete" @click="delEquip(item.d_id)"></i>
|
|
|
|
|
- <div class="img-box">
|
|
|
|
|
- <template v-if="item.device_type_id == '2'">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/scdIconOn.png" />
|
|
|
|
|
- <p>杀虫灯</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="item.device_type_id == '3'">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/cbdIconOn.png" />
|
|
|
|
|
- <p>测报灯</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="item.device_type_id == '4'">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/znxyOn.png" />
|
|
|
|
|
- <p>智能性诱</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="item.device_type_id == '5'">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/hjjcIconOn.png" />
|
|
|
|
|
- <p>环境监测</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="item.device_type_id == '6'">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/jkIconOn.png" />
|
|
|
|
|
- <p>监控设备</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="item.device_type_id == '7'">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/bzyIconOn.png" />
|
|
|
|
|
- <p>孢子仪</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="item.device_type_id == '8'">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/xyOn.png" />
|
|
|
|
|
- <p>性诱设备</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="item.device_type_id == 9">
|
|
|
|
|
- <img src="@/assets/images/equipdistribute/tccbOn.png" />
|
|
|
|
|
- <p>糖醋测报</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="detail">
|
|
|
|
|
- <p>
|
|
|
|
|
- 设备ID
|
|
|
|
|
- <span>{{ item.device_id }}</span>
|
|
|
|
|
- </p>
|
|
|
|
|
- <p>
|
|
|
|
|
- 适配用户
|
|
|
|
|
- <span>{{ item.device_user || "无" }}</span>
|
|
|
|
|
- </p>
|
|
|
|
|
- <p>
|
|
|
|
|
- 设备名称
|
|
|
|
|
- <span>{{ item.device_name || "无" }}</span>
|
|
|
|
|
- </p>
|
|
|
|
|
- <p>
|
|
|
|
|
- 位置
|
|
|
|
|
- <span>{{ item.device_location || "无" }}</span>
|
|
|
|
|
- </p>
|
|
|
|
|
- <p>
|
|
|
|
|
- 设备添加时间
|
|
|
|
|
- <span>{{ (item.creat_time * 1000) | formatTime }}</span>
|
|
|
|
|
- </p>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="bottom">
|
|
|
|
|
- <span @click="modifyName(item.device_id, item.device_name)">
|
|
|
|
|
- <i class="el-icon-edit-outline"></i> 修改名称
|
|
|
|
|
- </span>
|
|
|
|
|
- <span @click="addPosition(item.device_id, item.lng, item.lat)">
|
|
|
|
|
- <i class="el-icon-location-outline"></i> 添加位置
|
|
|
|
|
- </span>
|
|
|
|
|
- <span @click="addFault(item.device_id, item.device_type_id)">
|
|
|
|
|
- <i class="el-icon-edit-outline"></i> 故障上报
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-card>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <!-- 暂无数据 -->
|
|
|
|
|
- <div class="expertDiagnosis_referral_units_not" v-if="dataList.length <= 0">
|
|
|
|
|
- <img
|
|
|
|
|
- :src="$imghost + zanwu"
|
|
|
|
|
- alt
|
|
|
|
|
- class="expertDiagnosis_referral_units_notImg"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <i slot="suffix" class="el-input__icon el-icon-search"></i>
|
|
|
|
|
+ </el-input>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-pagination
|
|
|
|
|
- v-if="dataList.length > 0"
|
|
|
|
|
- background
|
|
|
|
|
- layout="prev, pager, next"
|
|
|
|
|
- :page-size="12"
|
|
|
|
|
- :total="totalNum"
|
|
|
|
|
- @current-change="changePage"
|
|
|
|
|
- ></el-pagination>
|
|
|
|
|
- <!-- 添加定位弹框 -->
|
|
|
|
|
- <el-dialog
|
|
|
|
|
- class="map_dialog"
|
|
|
|
|
- title="添加定位"
|
|
|
|
|
- v-if="addLocationDialogVisible"
|
|
|
|
|
- :visible.sync="addLocationDialogVisible"
|
|
|
|
|
- width="800px"
|
|
|
|
|
- top="180px"
|
|
|
|
|
- @closed="addLocationDialogClosed"
|
|
|
|
|
- >
|
|
|
|
|
- <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>
|
|
|
|
|
- <el-amap
|
|
|
|
|
- class="bm-view"
|
|
|
|
|
- vid="amapDemo"
|
|
|
|
|
- :center="center"
|
|
|
|
|
- :amap-manager="amapManager"
|
|
|
|
|
- :zoom="mapZoom"
|
|
|
|
|
- :plugin="plugin"
|
|
|
|
|
- :events='mapEvents'
|
|
|
|
|
- >
|
|
|
|
|
- <el-amap-marker vid="component-marker" v-if="point.length" :position="point" ></el-amap-marker>
|
|
|
|
|
- </el-amap>
|
|
|
|
|
- <!-- <baidu-map
|
|
|
|
|
- class="Bmap"
|
|
|
|
|
- :center="center"
|
|
|
|
|
- :zoom="mapZoom"
|
|
|
|
|
- :scroll-wheel-zoom="true"
|
|
|
|
|
- @ready="handlerBMap"
|
|
|
|
|
- @click="locationPoint"
|
|
|
|
|
- >
|
|
|
|
|
- <bm-marker :position="point" :dragging="true"></bm-marker>
|
|
|
|
|
- </baidu-map> -->
|
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
|
- <el-button @click="addLocationDialogVisible = false">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" @click="addLocationSubm">确 定</el-button>
|
|
|
|
|
- </span>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
- <!-- 故障上报 -->
|
|
|
|
|
- <el-dialog
|
|
|
|
|
- class="map_dialog"
|
|
|
|
|
- title="故障上报"
|
|
|
|
|
- v-if="addFaultDialogVisible"
|
|
|
|
|
- :visible.sync="addFaultDialogVisible"
|
|
|
|
|
- width="500px"
|
|
|
|
|
- top="180px"
|
|
|
|
|
- @closed="addLocationDialogClosed"
|
|
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ style="cursor: pointer"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @change="DateChange()"
|
|
|
|
|
+ v-model="timeRange"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ range-separator="至"
|
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
|
+ ></el-date-picker>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
|
+ <el-col
|
|
|
|
|
+ :xs="24"
|
|
|
|
|
+ :sm="24"
|
|
|
|
|
+ :md="12"
|
|
|
|
|
+ :lg="6"
|
|
|
|
|
+ :xl="4"
|
|
|
|
|
+ v-for="item in dataList"
|
|
|
|
|
+ :key="item.id"
|
|
|
>
|
|
>
|
|
|
- <el-form
|
|
|
|
|
- ref="editFaultform"
|
|
|
|
|
- :rules="editFaultrules"
|
|
|
|
|
- :model="editFault"
|
|
|
|
|
- label-width="80px"
|
|
|
|
|
- >
|
|
|
|
|
- <el-form-item label="设备ID">
|
|
|
|
|
- <el-input v-model="editFault.imei" disabled></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="联系人" prop="user">
|
|
|
|
|
- <el-input v-model="editFault.user"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="联系电话" prop="tel">
|
|
|
|
|
- <el-input
|
|
|
|
|
- type="text"
|
|
|
|
|
- maxlength="11"
|
|
|
|
|
- v-model="editFault.tel"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="故障原因" prop="detail">
|
|
|
|
|
- <el-input type="textarea" v-model="editFault.detail"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
|
- <el-button @click="addFaultDialogVisible = false">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" @click="addFaultSubm">确 定</el-button>
|
|
|
|
|
- </span>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
|
+ <el-card class="box-card pad0">
|
|
|
|
|
+ <i class="del-icon el-icon-delete" @click="delEquip(item.d_id)"></i>
|
|
|
|
|
+ <div class="img-box">
|
|
|
|
|
+ <template v-if="item.device_type_id == '2'">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/scdIconOn.png" />
|
|
|
|
|
+ <p>杀虫灯</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="item.device_type_id == '3'">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/cbdIconOn.png" />
|
|
|
|
|
+ <p>测报灯</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="item.device_type_id == '4'">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/znxyOn.png" />
|
|
|
|
|
+ <p>智能性诱</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="item.device_type_id == '5'">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/hjjcIconOn.png" />
|
|
|
|
|
+ <p>环境监测</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="item.device_type_id == '6'">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/jkIconOn.png" />
|
|
|
|
|
+ <p>监控设备</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="item.device_type_id == '7'">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/bzyIconOn.png" />
|
|
|
|
|
+ <p>孢子仪</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="item.device_type_id == '8'">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/xyOn.png" />
|
|
|
|
|
+ <p>性诱设备</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="item.device_type_id == 9">
|
|
|
|
|
+ <img src="@/assets/images/equipdistribute/tccbOn.png" />
|
|
|
|
|
+ <p>糖醋测报</p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="detail">
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 设备ID
|
|
|
|
|
+ <span>{{ item.device_id }}</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 适配用户
|
|
|
|
|
+ <span>{{ item.device_user || "无" }}</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 设备名称
|
|
|
|
|
+ <span>{{ item.device_name || "无" }}</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 位置
|
|
|
|
|
+ <span>{{ item.device_location || "无" }}</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p>
|
|
|
|
|
+ 设备添加时间
|
|
|
|
|
+ <span>{{ (item.creat_time * 1000) | formatTime }}</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="bottom">
|
|
|
|
|
+ <span @click="modifyName(item.device_id, item.device_name)">
|
|
|
|
|
+ <i class="el-icon-edit-outline"></i> 修改名称
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span @click="addPosition(item.device_id, item.lng, item.lat)">
|
|
|
|
|
+ <i class="el-icon-location-outline"></i> 添加位置
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span @click="addFault(item.device_id, item.device_type_id)">
|
|
|
|
|
+ <i class="el-icon-edit-outline"></i> 故障上报
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <!-- 暂无数据 -->
|
|
|
|
|
+ <div class="expertDiagnosis_referral_units_not" v-if="dataList.length <= 0">
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="$imghost + zanwu"
|
|
|
|
|
+ alt
|
|
|
|
|
+ class="expertDiagnosis_referral_units_notImg"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
- </el-card>
|
|
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ v-if="dataList.length > 0"
|
|
|
|
|
+ background
|
|
|
|
|
+ layout="prev, pager, next, jumper"
|
|
|
|
|
+ :page-size="12"
|
|
|
|
|
+ :total="totalNum"
|
|
|
|
|
+ @current-change="changePage"
|
|
|
|
|
+ ></el-pagination>
|
|
|
|
|
+ <!-- 添加定位弹框 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ class="map_dialog"
|
|
|
|
|
+ title="添加定位"
|
|
|
|
|
+ :visible.sync="addLocationDialogVisible"
|
|
|
|
|
+ width="800px"
|
|
|
|
|
+ top="180px"
|
|
|
|
|
+ @closed="addLocationDialogClosed"
|
|
|
|
|
+ >
|
|
|
|
|
+ <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"></div>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="addLocationDialogVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="addLocationSubm">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <!-- 故障上报 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ class="map_dialog"
|
|
|
|
|
+ title="故障上报"
|
|
|
|
|
+ v-if="addFaultDialogVisible"
|
|
|
|
|
+ :visible.sync="addFaultDialogVisible"
|
|
|
|
|
+ width="500px"
|
|
|
|
|
+ @closed="addLocationDialogClosed"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form
|
|
|
|
|
+ ref="editFaultform"
|
|
|
|
|
+ :rules="editFaultrules"
|
|
|
|
|
+ :model="editFault"
|
|
|
|
|
+ label-width="80px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form-item label="设备ID">
|
|
|
|
|
+ <el-input v-model="editFault.imei" disabled></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="联系人" prop="user">
|
|
|
|
|
+ <el-input v-model="editFault.user"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="联系电话" prop="tel">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ maxlength="11"
|
|
|
|
|
+ v-model="editFault.tel"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="故障原因" prop="detail">
|
|
|
|
|
+ <el-input type="textarea" v-model="editFault.detail"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="addFaultDialogVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="addFaultSubm">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-card>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import VueAMap from "vue-amap";
|
|
|
|
|
-let amapManager = new VueAMap.AMapManager();
|
|
|
|
|
|
|
+import AMap from "AMap";
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
var checkphone = (rule, value, callback) => {
|
|
var checkphone = (rule, value, callback) => {
|
|
@@ -263,7 +239,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
|
- amapManager,
|
|
|
|
|
zanwu: "/images/expertDiagnosis/zanwu.png",
|
|
zanwu: "/images/expertDiagnosis/zanwu.png",
|
|
|
timeRange: "",
|
|
timeRange: "",
|
|
|
queryInfo: {
|
|
queryInfo: {
|
|
@@ -288,56 +263,7 @@ export default {
|
|
|
type: "",
|
|
type: "",
|
|
|
},
|
|
},
|
|
|
device_id: "",
|
|
device_id: "",
|
|
|
- mapZoom: 6,
|
|
|
|
|
- mapEvents: {
|
|
|
|
|
- init: (o) => {
|
|
|
|
|
- // console.log(o.getCenter())
|
|
|
|
|
- // console.log(this.$refs.map.$$getInstance())
|
|
|
|
|
- // o.getCity(result => {
|
|
|
|
|
- // console.log(result)
|
|
|
|
|
- // })
|
|
|
|
|
- },
|
|
|
|
|
- 'moveend': () => {
|
|
|
|
|
- },
|
|
|
|
|
- 'zoomchange': () => {
|
|
|
|
|
- },
|
|
|
|
|
- 'click': (e) => {
|
|
|
|
|
- console.log(this)
|
|
|
|
|
- console.log(e.lnglat)
|
|
|
|
|
- this.point = [e.lnglat.lng,e.lnglat.lat]
|
|
|
|
|
- this.locationForm.lng = e.lnglat.lng;
|
|
|
|
|
- this.locationForm.lat = e.lnglat.lat;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- plugin: [
|
|
|
|
|
- {
|
|
|
|
|
- pName: "ToolBar",
|
|
|
|
|
- events: {
|
|
|
|
|
- init(instance) {
|
|
|
|
|
- console.log(instance);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- pName: "Scale",
|
|
|
|
|
- events: {
|
|
|
|
|
- init(instance) {
|
|
|
|
|
- console.log(instance);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // {
|
|
|
|
|
- // pName: 'MapType',
|
|
|
|
|
- // defaultType: 0,
|
|
|
|
|
- // events: {
|
|
|
|
|
- // init(instance) {
|
|
|
|
|
- // console.log(instance);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- ],
|
|
|
|
|
- point: { lng: "", lat: "" },
|
|
|
|
|
- center: [104.776123,33.118667],
|
|
|
|
|
|
|
+ center: [], //默认地图中心
|
|
|
addLocationDialogVisible: false,
|
|
addLocationDialogVisible: false,
|
|
|
addFaultDialogVisible: false,
|
|
addFaultDialogVisible: false,
|
|
|
editFaultrules: {
|
|
editFaultrules: {
|
|
@@ -345,22 +271,66 @@ export default {
|
|
|
tel: { required: true, validator: checkphone, trigger: "blur" },
|
|
tel: { required: true, validator: checkphone, trigger: "blur" },
|
|
|
detail: { required: true, message: "请输入故障原因", trigger: "blur" },
|
|
detail: { required: true, message: "请输入故障原因", trigger: "blur" },
|
|
|
},
|
|
},
|
|
|
- prompt:'',
|
|
|
|
|
|
|
+ address: "", //地图信息框显示的地址
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
- // window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
|
|
|
|
},
|
|
},
|
|
|
beforeMount() {},
|
|
beforeMount() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
- beforeunloadHandler (e) {
|
|
|
|
|
- alert(1)
|
|
|
|
|
- e = e || window.event
|
|
|
|
|
- if (e) {
|
|
|
|
|
- e.returnValue = '关闭提示'
|
|
|
|
|
- }
|
|
|
|
|
- return '关闭提示'
|
|
|
|
|
|
|
+ init() {
|
|
|
|
|
+ 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();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 地图点击事件
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
//获取设备列表
|
|
//获取设备列表
|
|
|
getList() {
|
|
getList() {
|
|
@@ -402,49 +372,31 @@ export default {
|
|
|
this.getList();
|
|
this.getList();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- //在地图中点击定位
|
|
|
|
|
- locationPoint(e) {
|
|
|
|
|
- let { point } = e;
|
|
|
|
|
- this.point = point;
|
|
|
|
|
- this.locationForm = point;
|
|
|
|
|
- this.map.clearOverlays();
|
|
|
|
|
- this.map.addOverlay(new BMap.Marker(this.point));
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
addrChange() {
|
|
addrChange() {
|
|
|
- this.geocoder = new AMap.Geocoder({
|
|
|
|
|
- city: "全国", //城市设为北京,默认:“全国”
|
|
|
|
|
- });
|
|
|
|
|
- var _this = this;
|
|
|
|
|
- if(!this.addr){
|
|
|
|
|
- this.point = []
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- this.geocoder.getLocation(this.addr, function(status, result) {
|
|
|
|
|
- if (status === 'complete'&&result.geocodes.length) {
|
|
|
|
|
- var lnglat = result.geocodes[0].location
|
|
|
|
|
- _this.point = [lnglat.lng,lnglat.lat];
|
|
|
|
|
- _this.center = [lnglat.lng,lnglat.lat];
|
|
|
|
|
- }else{
|
|
|
|
|
- log.error('根据地址查询位置失败');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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 {
|
|
|
|
|
+ this.$message.error("根据地址查询位置失败");
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 修改设备名称
|
|
// 修改设备名称
|
|
|
modifyName(id, device_name) {
|
|
modifyName(id, device_name) {
|
|
|
let value = device_name;
|
|
let value = device_name;
|
|
|
- this.prompt = this.$prompt("", "修改名字", {
|
|
|
|
|
- customClass: 'picc-message-box', // 必填
|
|
|
|
|
- cancelButtonClass:'cancelPromptButton',
|
|
|
|
|
|
|
+ this.$prompt("", "修改名字", {
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
|
- inputPlaceholder: '请输入设备名称',
|
|
|
|
|
- inputErrorMessage: '输入不能为空',
|
|
|
|
|
- inputValidator: (value)=>{
|
|
|
|
|
- if(value.trim().length < 1){
|
|
|
|
|
- return '输入不能为空'
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- inputValue: device_name,
|
|
|
|
|
|
|
+ inputPlaceholder: device_name,
|
|
|
})
|
|
})
|
|
|
.then(({ value }) => {
|
|
.then(({ value }) => {
|
|
|
if (value) {
|
|
if (value) {
|
|
@@ -468,39 +420,40 @@ export default {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: "info",
|
|
type: "info",
|
|
|
message: "内容不能为空",
|
|
message: "内容不能为空",
|
|
|
- duration:0
|
|
|
|
|
});
|
|
});
|
|
|
- return false;
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
- // this.$message({
|
|
|
|
|
- // type: "info",
|
|
|
|
|
- // message: "取消输入",
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: "info",
|
|
|
|
|
+ message: "取消输入",
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
//通过经纬度搜索定位
|
|
//通过经纬度搜索定位
|
|
|
locationSearch() {
|
|
locationSearch() {
|
|
|
if (this.locationForm.lat && this.locationForm.lng) {
|
|
if (this.locationForm.lat && this.locationForm.lng) {
|
|
|
- this.point = [this.locationForm.lng,this.locationForm.lat];
|
|
|
|
|
- this.center = [this.locationForm.lng,this.locationForm.lat];
|
|
|
|
|
|
|
+ let lnglat = [this.locationForm.lng, this.locationForm.lat];
|
|
|
|
|
+ var marker = new AMap.Marker({
|
|
|
|
|
+ position: lnglat,
|
|
|
|
|
+ });
|
|
|
|
|
+ marker.setMap(this.map);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning("请输入经纬度!");
|
|
|
|
|
+ return fasle;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- handlerBMap({ BMap, map }) {
|
|
|
|
|
- this.BMap = BMap;
|
|
|
|
|
- this.map = map;
|
|
|
|
|
- let point = new BMap.Point(this.point.lng, this.point.lat);
|
|
|
|
|
- map.centerAndZoom(point, 15);
|
|
|
|
|
- },
|
|
|
|
|
//点击“添加定位”按钮
|
|
//点击“添加定位”按钮
|
|
|
addPosition(device_id, lng, lat) {
|
|
addPosition(device_id, lng, lat) {
|
|
|
this.device_id = device_id;
|
|
this.device_id = device_id;
|
|
|
- this.locationForm.lng = lng || 0
|
|
|
|
|
- this.locationForm.lat = lat || 0
|
|
|
|
|
- this.point = [this.locationForm.lng, this.locationForm.lat ];
|
|
|
|
|
- this.center = [this.locationForm.lng, this.locationForm.lat ];
|
|
|
|
|
|
|
+ this.point = [lng, lat];
|
|
|
|
|
+ this.center = [lng, lat];
|
|
|
|
|
+ this.locationForm.lng = lng;
|
|
|
|
|
+ this.locationForm.lat = lat;
|
|
|
this.addLocationDialogVisible = true;
|
|
this.addLocationDialogVisible = true;
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ }, 0);
|
|
|
},
|
|
},
|
|
|
// 故障上报
|
|
// 故障上报
|
|
|
addFault(device_id, type) {
|
|
addFault(device_id, type) {
|
|
@@ -517,12 +470,8 @@ export default {
|
|
|
//关闭定位弹框时调用
|
|
//关闭定位弹框时调用
|
|
|
addLocationDialogClosed() {
|
|
addLocationDialogClosed() {
|
|
|
this.locationForm = { lat: "", lng: "" };
|
|
this.locationForm = { lat: "", lng: "" };
|
|
|
- this.point = [0,0];
|
|
|
|
|
- this.center = [113.271429, 23.135336];
|
|
|
|
|
-
|
|
|
|
|
- // this.map.clearOverlays();
|
|
|
|
|
|
|
+ this.center = [];
|
|
|
this.map = null;
|
|
this.map = null;
|
|
|
- this.BMap = null;
|
|
|
|
|
},
|
|
},
|
|
|
//选择定位点后,提交
|
|
//选择定位点后,提交
|
|
|
addLocationSubm() {
|
|
addLocationSubm() {
|
|
@@ -608,8 +557,8 @@ export default {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: "success",
|
|
type: "success",
|
|
|
message: "删除成功!",
|
|
message: "删除成功!",
|
|
|
- });
|
|
|
|
|
- this.getList()
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ this.getList();
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: "error",
|
|
type: "error",
|
|
@@ -626,16 +575,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- destroyed() {
|
|
|
|
|
- this.timer = setTimeout(function() {
|
|
|
|
|
- let closeBtn = document.body.getElementsByClassName("cancelPromptButton")[0]
|
|
|
|
|
- if(closeBtn){
|
|
|
|
|
- closeBtn.click()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- // window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -718,7 +657,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-.bm-view {
|
|
|
|
|
|
|
+.amap-demo {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 400px;
|
|
height: 400px;
|
|
|
}
|
|
}
|