Commit 93682c78 authored by 纪泽龙's avatar 纪泽龙

优化

parent 2c0ca401
...@@ -31,11 +31,11 @@ const permission = { ...@@ -31,11 +31,11 @@ const permission = {
const index = [ const index = [
{ {
path: "", path: "",
meta: { title: "Gis地图", icon: "dashboard" }, meta: { title: "GIS地图", icon: "dashboard" },
children: [ children: [
{ {
path: "enterprise/mapView", path: "enterprise/mapView",
meta: { title: "Gis地图", icon: "dashboard" } meta: { title: "GIS地图", icon: "dashboard" }
} }
] ]
} }
......
...@@ -53,8 +53,8 @@ class gaodeMap { ...@@ -53,8 +53,8 @@ class gaodeMap {
showLabel: true, showLabel: true,
// labelzIndex: 110, // labelzIndex: 110,
pitch: 8, pitch: 8,
zoom: 9 zoom: 9,
//mapStyle: 'amap://styles/darkblue', // mapStyle: 'amap://styles/darkblue',
// mapStyle: 'amap://styles/3b679a15f448a4740ba2ff7524e1a4ae', // mapStyle: 'amap://styles/3b679a15f448a4740ba2ff7524e1a4ae',
}); });
this.myMap = map; this.myMap = map;
......
...@@ -117,7 +117,7 @@ class gaodeMap { ...@@ -117,7 +117,7 @@ class gaodeMap {
if (this.handleInfoWindowOpenFunc) { if (this.handleInfoWindowOpenFunc) {
this.handleInfoWindowOpenFunc(); this.handleInfoWindowOpenFunc();
this.handleInfoWindowOpenFunc = null; this.handleInfoWindowOpenFunc = null;
this.leftListClick=false; this.leftListClick = false;
} }
// 刚进入页面的时候只调用一次,让左侧的抽屉在地图移动完之后显示 // 刚进入页面的时候只调用一次,让左侧的抽屉在地图移动完之后显示
...@@ -216,6 +216,8 @@ class gaodeMap { ...@@ -216,6 +216,8 @@ class gaodeMap {
options.scrollWheel = true; options.scrollWheel = true;
map.setStatus(options); map.setStatus(options);
}); });
this.infoWindowMove(infoWindow);
let marker = new AMap.Marker({ let marker = new AMap.Marker({
position: [data.longitude, data.latitude], position: [data.longitude, data.latitude],
map: map, map: map,
...@@ -1011,6 +1013,25 @@ class gaodeMap { ...@@ -1011,6 +1013,25 @@ class gaodeMap {
this.markerPassedPolylineInfoWindow && this.markerPassedPolylineInfoWindow &&
this.markerPassedPolylineInfoWindow.close(); this.markerPassedPolylineInfoWindow.close();
} }
// infoWindow的拖拽
infoWindowMove(infoWindow) {
let disX, disY,dom;
infoWindow.on("mousedown", e => {
dom = e.target.dom;
// const a = dom.offsetTop + 20;
// dom.style.top = a + "px";
// console.log(dom.offsetTop);
// console.log(e.originEvent.clientY);
// console.log(dom.offsetLeft);
// console.log(e.originEvent.clientX);
disX = dom.offsetTop - e.originEvent.clientX;
disY = dom.offsetLeft - e.originEvent.clientY;
window.addEventListener("mousemove",(e)=>{
})
});
}
// 关闭转化到vue的dom // 关闭转化到vue的dom
removeCloneDom() { removeCloneDom() {
// 线 // 线
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row v-if="$route.query.back">
<el-col :span="24" style="padding-left: 15px">
<div style="height: 45px" @click="$router.go(-1)">
<el-button
size="medium"
type="text"
style="font-size: 18px; color: rgb(7, 63, 112); float: left"
>返回
</el-button>
<div style="float: left; margin-top: 8px; margin-left: 5px">
<img
src="../../../assets/logo/fanhui.png"
style="width: 25px"
alt=""
/>
</div>
</div>
</el-col>
</el-row>
<el-form <el-form
:model="queryParams" :model="queryParams"
ref="queryForm" ref="queryForm"
...@@ -71,30 +90,80 @@ ...@@ -71,30 +90,80 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="deviceAlarmList" @selection-change="handleSelectionChange" > <el-table
<el-table-column label="设备名称" align="center" prop="deviceName" width="280px"/> v-loading="loading"
<el-table-column label="设备编号" align="center" prop="deviceCode" width="240px"/> :data="deviceAlarmList"
<el-table-column label="设备类型" align="center" prop="deviceType"/> @selection-change="handleSelectionChange"
>
<el-table-column
label="设备名称"
align="center"
prop="deviceName"
width="280px"
/>
<el-table-column
label="设备编号"
align="center"
prop="deviceCode"
width="240px"
/>
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="报警类型" align="center" prop="alarmType" /> <el-table-column label="报警类型" align="center" prop="alarmType" />
<el-table-column label="报警值" align="center" prop="alarmValue" width="150px"/> <el-table-column
<el-table-column label="报警开始时间" align="center" prop="startTime" width="220px"/> label="报警值"
<el-table-column label="报警结束时间" align="center" prop="endTime" width="220px"> align="center"
prop="alarmValue"
width="150px"
/>
<el-table-column
label="报警开始时间"
align="center"
prop="startTime"
width="220px"
/>
<el-table-column
label="报警结束时间"
align="center"
prop="endTime"
width="220px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.endTime == null || scope.row.endTime == ''">-</span> <span v-if="scope.row.endTime == null || scope.row.endTime == ''"
<span v-if="scope.row.endTime != null && scope.row.endTime != ''">{{scope.row.endTime}}</span> >-</span
>
<span v-if="scope.row.endTime != null && scope.row.endTime != ''">{{
scope.row.endTime
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="处理状态" align="center" prop="dealStatus" width="150px"> <el-table-column
label="处理状态"
align="center"
prop="dealStatus"
width="150px"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.orderId == null || scope.row.orderId == ''">未生成工单</span> <span v-if="scope.row.orderId == null || scope.row.orderId == ''"
<span v-if="(scope.row.dealStatus == null || scope.row.dealStatus == '') && >未生成工单</span
scope.row.orderId != null && scope.row.orderId != ''">暂未处理</span> >
<span
v-if="
(scope.row.dealStatus == null || scope.row.dealStatus == '') &&
scope.row.orderId != null &&
scope.row.orderId != ''
"
>暂未处理</span
>
<span v-if="scope.row.dealStatus == 1">不需处理</span> <span v-if="scope.row.dealStatus == 1">不需处理</span>
<span v-if="scope.row.dealStatus == 2">已处理完成</span> <span v-if="scope.row.dealStatus == 2">已处理完成</span>
<span v-if="scope.row.dealStatus == 3">未处理完成</span> <span v-if="scope.row.dealStatus == 3">未处理完成</span>
</template> </template>
</el-table-column> </el-table-column>
<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 <el-button
size="normal" size="normal"
...@@ -102,7 +171,8 @@ ...@@ -102,7 +171,8 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleIssue(scope.row)" @click="handleIssue(scope.row)"
v-hasPermi="['workOrder:basicsInfo:add']" v-hasPermi="['workOrder:basicsInfo:add']"
v-if="scope.row.orderId == '' || scope.row.orderId == null"> v-if="scope.row.orderId == '' || scope.row.orderId == null"
>
生成工单 生成工单
</el-button> </el-button>
<el-button <el-button
...@@ -110,7 +180,8 @@ ...@@ -110,7 +180,8 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="showDetail(scope.row)" @click="showDetail(scope.row)"
v-hasPermi="['dataMonitoring:deviceAlarm:query']"> v-hasPermi="['dataMonitoring:deviceAlarm:query']"
>
详情 详情
</el-button> </el-button>
</template> </template>
...@@ -118,11 +189,12 @@ ...@@ -118,11 +189,12 @@
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList"
/>
<!-- 添加工单信息对话框 --> <!-- 添加工单信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
...@@ -137,10 +209,22 @@ ...@@ -137,10 +209,22 @@
<font>{{ form.alarmValue }}</font> <font>{{ form.alarmValue }}</font>
</el-form-item> </el-form-item>
<el-form-item label="工单名称" prop="orderName"> <el-form-item label="工单名称" prop="orderName">
<el-input v-model="form.orderName" placeholder="请输入工单名称" style="width: 590px" /> <el-input
v-model="form.orderName"
placeholder="请输入工单名称"
style="width: 590px"
/>
</el-form-item> </el-form-item>
<el-form-item label="指定执行人员" prop="appointInspector"> <el-form-item label="指定执行人员" prop="appointInspector">
<el-select v-model="form.appointInspector" placeholder="请选择执行人员" clearable filterable size="small" @change="setUserId" style="width: 590px"> <el-select
v-model="form.appointInspector"
placeholder="请选择执行人员"
clearable
filterable
size="small"
@change="setUserId"
style="width: 590px"
>
<el-option <el-option
v-for="item in inspector" v-for="item in inspector"
:key="item.userId" :key="item.userId"
...@@ -150,7 +234,12 @@ ...@@ -150,7 +234,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="工单描述" prop="remarks"> <el-form-item label="工单描述" prop="remarks">
<el-input type="textarea" v-model="form.remarks" placeholder="请输入工单描述" style="width: 590px" /> <el-input
type="textarea"
v-model="form.remarks"
placeholder="请输入工单描述"
style="width: 590px"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -162,9 +251,12 @@ ...@@ -162,9 +251,12 @@
</template> </template>
<script> <script>
import { listDeviceAlarm, getDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm"; import {
import { addBasicsInfo } from "@/api/workOrder/basicsInfo"; listDeviceAlarm,
import { inspectorList } from "@/api/system/user"; getDeviceAlarm,
} from "@/api/dataMonitoring/deviceAlarm";
import { addBasicsInfo } from "@/api/workOrder/basicsInfo";
import { inspectorList } from "@/api/system/user";
export default { export default {
name: "DeviceAlarm", name: "DeviceAlarm",
...@@ -172,7 +264,7 @@ export default { ...@@ -172,7 +264,7 @@ export default {
data() { data() {
return { return {
// 判断是从哪里来的,如果是地图里来的,则可以返回 // 判断是从哪里来的,如果是地图里来的,则可以返回
fromGisMap:false, fromGisMap: false,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 导出遮罩层 // 导出遮罩层
...@@ -241,11 +333,11 @@ export default { ...@@ -241,11 +333,11 @@ export default {
beforeRouteEnter: (to, from, next) => { beforeRouteEnter: (to, from, next) => {
next((vm) => { next((vm) => {
// 如果是从地图里来的 // 如果是从地图里来的
if(from.path=="/enterprise/mapView"){ if (from.path == "/enterprise/mapView") {
// console.log(123) // console.log(123)
vm.fromGisMap=true; vm.fromGisMap = true;
}else{ } else {
vm.fromGisMap=false; vm.fromGisMap = false;
} }
}); });
}, },
...@@ -302,9 +394,9 @@ export default { ...@@ -302,9 +394,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.alarmId) this.ids = selection.map((item) => item.alarmId);
this.single = selection.length !== 1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 下发按钮操作 */ /** 下发按钮操作 */
handleIssue(row) { handleIssue(row) {
...@@ -334,12 +426,12 @@ export default { ...@@ -334,12 +426,12 @@ export default {
/** 详细信息跳转 */ /** 详细信息跳转 */
showDetail(row) { showDetail(row) {
this.$router.push({ this.$router.push({
path: '/dataMonitoring/alarmdetail', path: "/dataMonitoring/alarmdetail",
query: { query: {
alarmId: row.alarmId, alarmId: row.alarmId,
deviceType:row.deviceType deviceType: row.deviceType,
} },
}) //带参跳转 }); //带参跳转
}, },
}, },
}; };
......
...@@ -28,21 +28,34 @@ ...@@ -28,21 +28,34 @@
style="width: 100%" style="width: 100%"
height="170" height="170"
> >
<el-table-column prop="deviceCode" label="设备编号" width="100"> <el-table-column prop="deviceCode" label="设备编号" width="100">
</el-table-column> </el-table-column>
<el-table-column prop="deviceName" label="设备名称" width=""> <el-table-column prop="deviceName" label="设备名称" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="alarmType" label="报警类型" width="80"> <el-table-column prop="alarmType" label="报警类型" width="">
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="报警开始时间" width="170"> <el-table-column prop="createTime" label="报警开始时间" width="">
</el-table-column>
<el-table-column label="处理状态" align="center" prop="dealStatus">
<template slot-scope="scope">
<span v-if="scope.row.orderId == null || scope.row.orderId == ''"
>未生成工单</span
>
<span v-else-if="!scope.row.dealStatus && scope.row.orderId"
>暂未处理</span
>
<span v-else-if="scope.row.dealStatus == 1">不需处理</span>
<span v-else-if="scope.row.dealStatus == 2">已处理完成</span>
<span v-else-if="scope.row.dealStatus == 3">未处理完成</span>
<span v-else> - </span>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="alarmValue" label="报警内容" width="100"> <el-table-column prop="alarmValue" label="报警内容" width="100">
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<template v-for="(item, index) in list"> <template v-for="(item, index) in list">
<div <div
...@@ -95,6 +108,7 @@ export default { ...@@ -95,6 +108,7 @@ export default {
4: "icon-ylbgs", 4: "icon-ylbgs",
99: "icon-gdcd", 99: "icon-gdcd",
}, },
tableData: [ tableData: [
{ {
deviceCode: "2016-05-03", deviceCode: "2016-05-03",
...@@ -158,12 +172,12 @@ export default { ...@@ -158,12 +172,12 @@ export default {
return this.iconList[item.type]; return this.iconList[item.type];
}, },
moreClick() { moreClick() {
this.$router.push("/dataMonitoring/deviceAlarm"); this.$router.push("/dataMonitoring/deviceAlarm?back=1");
// route.push(`dataMonitoring/deviceAlarm`) // route.push(`dataMonitoring/deviceAlarm`)
}, },
repeatClick() { repeatClick() {
// this.tableData=[]; // this.tableData=[];
if(this.repeatFinshed) return; if (this.repeatFinshed) return;
this.getList(true); this.getList(true);
}, },
getList(bool) { getList(bool) {
...@@ -176,14 +190,18 @@ export default { ...@@ -176,14 +190,18 @@ export default {
deviceName, deviceName,
alarmType, alarmType,
createTime, createTime,
dealStatus,
alarmValue, alarmValue,
orderId,
} = item; } = item;
return { return {
deviceCode, deviceCode,
deviceName, deviceName,
alarmType, alarmType,
createTime, createTime,
dealStatus,
alarmValue, alarmValue,
orderId,
}; };
}); });
this.tableData = arr; this.tableData = arr;
...@@ -242,7 +260,7 @@ export default { ...@@ -242,7 +260,7 @@ export default {
} }
.repeat2 { .repeat2 {
margin-left: 20px; margin-left: 20px;
color:#67c23a; color: #67c23a;
} }
.more { .more {
float: right; float: right;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment