Commit 2bceaa79 authored by 纪泽龙's avatar 纪泽龙

右上角数据列表以及滚动,数据报警器列表分页添加

parent e3fa3d90
...@@ -13,8 +13,12 @@ export function detectorUserList(query) { ...@@ -13,8 +13,12 @@ export function detectorUserList(query) {
// 查询报警器用户下的报警器 // 查询报警器用户下的报警器
export function getdetectorInfoList(query) { export function getdetectorInfoList(query) {
return request({ return request({
url: '/detector/detectorInfo/detectorInfoList', url: '/detector/detectorInfo/list',
method: 'get', method: 'get',
params: query params: {
pageNum:1,
pageSize:20,
...query
}
}) })
} }
...@@ -220,6 +220,75 @@ ...@@ -220,6 +220,75 @@
} }
} }
} }
// center下的分页
.center {
.el-pagination {
button:disabled {
background-color: rgba(0, 0, 0, 0);
}
.el-pager li {
background-color: rgba(0, 0, 0, 0);
color: #fff;
cursor: pointer;
&.active {
color: #1890ff;
}
&:hover {
color: #7bf8f4;
}
}
.btn-prev,
.el-pagination .btn-next {
background-color: rgba(0, 0, 0, 0);
}
}
.el-pagination .btn-prev,
.el-pagination .btn-next {
background-color: rgba(0, 0, 0, 0);
}
// 禁用状态的左箭头
button[disabled] {
&:hover {
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #909399 !important;
}
}
}
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #909399;
}
}
}
button {
&:hover {
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #7bf8f4 !important;
}
}
}
}
// 平常状态下的
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #ffffff;
}
}
.el-pagination__jump{
color:#fff;
}
.el-input__inner{
background-color:rgba(0,0,0,0);
border-color:#1890ff;
color: #fff;
}
}
// gis地图里抽屉的搜索样式 // gis地图里抽屉的搜索样式
.search-input { .search-input {
.el-input__inner { .el-input__inner {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</div> </div>
<div class="table-top"> <div class="table-top">
<div> <div>
联系人: <span v-un-content>{{ data.username }}</span> 联系人: <span v-un-content>{{ data.linkMan }}</span>
</div> </div>
<div> <div>
联系电话:<span v-un-content>{{ data.phone }}</span> 联系电话:<span v-un-content>{{ data.phone }}</span>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<div class="table-list"> <div class="table-list">
<div class="thead"> <div class="thead">
<div class="theadtop">设备类型</div> <div class="theadtop">用户类型</div>
<div>设备数量</div> <div>设备数量</div>
<div>在线设备</div> <div>在线设备</div>
<div>离线设备</div> <div>离线设备</div>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<div class="last">报警中</div> <div class="last">报警中</div>
</div> </div>
<div class="tbody"> <div class="tbody">
<div class="theadtop">{{ userTypeName[data.userType] }}</div> <div class="theadtop">{{ this.userTypeName[data.userType] }}</div>
<div>{{ data.detectorCount }}</div> <div>{{ data.detectorCount }}</div>
<div>{{ data.onLineNum }}</div> <div>{{ data.onLineNum }}</div>
<div>{{ data.offLineNum }}</div> <div>{{ data.offLineNum }}</div>
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}, },
data() { data() {
return { return {
userTypeName: ["家用报警器", "商用报警器", "工业报警器"], userTypeName: ['',"家用报警器", "商用报警器", "工业报警器"],
}; };
}, },
mounted() { mounted() {
......
...@@ -387,6 +387,15 @@ class gaodeMap { ...@@ -387,6 +387,15 @@ class gaodeMap {
// 报警器用户下的独立报警器 // 报警器用户下的独立报警器
if (DEVICE_TYPE.DETECTOR_ONLY == markerType) { if (DEVICE_TYPE.DETECTOR_ONLY == markerType) {
// 如果报警器用户下的单一报警器 // 如果报警器用户下的单一报警器
let oldLng = [];
// 先记录当前的this.detcetorMarker
if (this.detcetorMarker) {
oldLng = [
this.detcetorMarker.data.longitude,
this.detcetorMarker.data.latitude
];
}
// 如果this.detcetorMarker有值就删了 // 如果this.detcetorMarker有值就删了
this.clearDetectorOnlyOpen(); this.clearDetectorOnlyOpen();
...@@ -402,10 +411,16 @@ class gaodeMap { ...@@ -402,10 +411,16 @@ class gaodeMap {
this.detectorOpenInfoWindow && this.detectorOpenInfoWindow.close(); this.detectorOpenInfoWindow && this.detectorOpenInfoWindow.close();
this.detectorOnlyOpenInfowindow && this.detectorOnlyOpenInfowindow &&
this.detectorOnlyOpenInfowindow.close(); this.detectorOnlyOpenInfowindow.close();
// 因为报警器会出现同一位置的情况,如果是同一个位置,直接显示infoWindow,
// 如果不是同一位置,移动完了在显示
if (oldLng[0] == data.longitude && oldLng[1] == data.latitude) {
this.detectorOnlyOpen(e);
} else {
// 回调,先移动,后展示infowindow // 回调,先移动,后展示infowindow
this.handleInfoWindowOpenFunc = () => { this.handleInfoWindowOpenFunc = () => {
this.detectorOnlyOpen(e); this.detectorOnlyOpen(e);
}; };
}
this.panTo([data.longitude, data.latitude - this.view.lntPosition]); this.panTo([data.longitude, data.latitude - this.view.lntPosition]);
marker.on("mousedown", this.detectorOnlyOpen); marker.on("mousedown", this.detectorOnlyOpen);
...@@ -1497,16 +1512,19 @@ class gaodeMap { ...@@ -1497,16 +1512,19 @@ class gaodeMap {
}); });
} }
// 报警器的显示隐藏 // 报警器的显示隐藏
detctorMakeShow(userId, bool) { detctorMakeShow(userType, bool) {
this.detectors this.detectors
.filter(item => { .filter(item => {
return item.getExtData().userId == userId; return item.getExtData().userType == userType;
}) })
.forEach(item => { ?.forEach(item => {
bool ? item.show() : item.hide(); bool ? item.show() : item.hide();
// 如果独立报警器存在,且属于自身 // 如果有报警器,就让报警器一起隐藏
if (this.detcetorMarker &&this.detcetorMarker.data.detectorId==item.data.userId) { if (
bool?this.detcetorMarker.show():this.detcetorMarker.hide(); this.detcetorMarker &&
this.detcetorMarker.data.userId == item.data.userId
) {
bool ? this.detcetorMarker.show() : this.detcetorMarker.hide();
} }
}); });
} }
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
<!-- :height="tableHeight" --> <!-- :height="tableHeight" -->
<el-table-column prop="detectorName" label="设备名称" width="100"> <el-table-column prop="detectorName" label="设备名称" width="100">
<template slot-scope="scope">
<div v-un-content>{{ scope.row.detectorName }}</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="detectorCode" label="设备编号" width="200"> <el-table-column prop="detectorCode" label="设备编号" width="200">
</el-table-column> </el-table-column>
...@@ -54,6 +57,16 @@ ...@@ -54,6 +57,16 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div>
<el-pagination
@current-change="handleCurrentChangvale"
:page-size="pageSize"
layout="prev, pager, next, jumper"
:total="total"
:hide-on-single-page="total<=pageSize"
>
</el-pagination>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -72,6 +85,15 @@ export default { ...@@ -72,6 +85,15 @@ export default {
show: { show: {
type: Boolean, type: Boolean,
}, },
userId: {
type: [Number,String],
},
total:{
type:Number,
},
pageSize:{
type:Number,
}
}, },
data() { data() {
return { return {
...@@ -98,16 +120,22 @@ export default { ...@@ -98,16 +120,22 @@ export default {
}, },
watch: { watch: {
// 当组件显示的时候 // 当组件显示的时候
show(bol) { detcetorList(newData) {
console.log(bol); // console.log(bol);
if (bol) { // if (bol) {
console.log(this.detcetorList); console.log(newData);
this.tableData = [...this.detcetorList]; this.tableData = [...newData];
} // }
}, },
}, },
methods: { methods: {
handleSizeChange(val) {
console.log(val);
},
handleCurrentChangvale(val) {
this.$parent.getDetectorInfoList({userId:this.userId,pageNum:val,pageSize:this.pageSize})
},
close() { close() {
this.fade = "fade"; this.fade = "fade";
this.$parent.centerShow = false; this.$parent.centerShow = false;
......
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
<div class="wrapper rightPic"> <div class="wrapper rightPic">
<div class="math"> <div class="math">
<div> <div>
<span>{{ rightPicData.totalNum }}</span <span>{{ rightPicData.alarmNum }}</span
>报警总数 >报警总数
</div> </div>
<div> <div>
<span>{{ rightPicData.handledNum }}</span <span>{{ rightPicData.onlineNum }}</span
>已处理 >在线设备
</div> </div>
<div> <div>
<span>{{ rightPicData.noHandeldNum }}</span <span>{{ rightPicData.offlineNum }}</span
>未处理 >离线设备
</div> </div>
</div> </div>
<div class="left"> <div class="left">
<div class="bottom right-bottom-data-left"> <div class="bottom right-bottom-data-left" @mouseover="tableEnter" @mouseout="timerAni">
<el-table <el-table
size="mini" size="mini"
:data="tableData" :data="tableData"
...@@ -95,9 +95,10 @@ export default { ...@@ -95,9 +95,10 @@ export default {
this.tableData = [...newData.pageData]; this.tableData = [...newData.pageData];
// } // }
// this.tableData = [...newData.pageData]; // this.tableData = [...newData.pageData];
// 列表容器 // 列表容器
this.$nextTick(() => {
this.getScrollHeight(); this.getScrollHeight();
});
}, },
}, },
...@@ -118,7 +119,6 @@ export default { ...@@ -118,7 +119,6 @@ export default {
const { height: heightSelect } = select.getBoundingClientRect(); const { height: heightSelect } = select.getBoundingClientRect();
// 滚动条的高度 = 列表高度-列表容器高度 // 滚动条的高度 = 列表高度-列表容器高度
this.scrollHeight = heightSelect - heightWrapper; this.scrollHeight = heightSelect - heightWrapper;
this.timerAni(); this.timerAni();
}, },
timerAni() { timerAni() {
...@@ -132,6 +132,10 @@ export default { ...@@ -132,6 +132,10 @@ export default {
selectWrap.scrollTop += 1; selectWrap.scrollTop += 1;
}, 100); }, 100);
}, },
tableEnter() {
console.log(123);
clearInterval(this.timer);
},
}, },
}; };
</script> </script>
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
:list="rightBototmData" :list="rightBototmData"
/> />
<!-- 右边 --> <!-- 右边 -->
<RightPic :rightPicData="rightPicData" v-show="RightPicShow" ref="RightPic" l /> <RightPic :rightPicData="rightPicData" v-show="RightPicShow" ref="RightPic"/>
<!-- 报警工单 --> <!-- 报警工单 -->
<CreateWork <CreateWork
ref="CreateWork" ref="CreateWork"
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
@callback="CreateWorkTroubleCallBack" @callback="CreateWorkTroubleCallBack"
/> />
<!-- 报警用户的报警器列表 --> <!-- 报警用户的报警器列表 -->
<Center :show="centerShow" ref="center" :detcetorList="detcetorList" /> <Center :show="centerShow" ref="center" :detcetorList="detcetorList" :userId="centerUserId" :total="centerTotal" :pageSize="20"/>
<!-- 当报警列表隐藏时,这个显示,点击就让Center回来 --> <!-- 当报警列表隐藏时,这个显示,点击就让Center回来 -->
<div <div
@click=" @click="
...@@ -347,8 +347,8 @@ ...@@ -347,8 +347,8 @@
<div class="list-wrapper"> <div class="list-wrapper">
<div class="thead"> <div class="thead">
<div class="no"></div> <div class="no"></div>
<div class="code">设备名称</div> <div class="code">用户名称</div>
<div class="name">设备地址</div> <div class="name">用户地址</div>
</div> </div>
<div <div
class="deviceList" class="deviceList"
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
> >
<div class="no">{{ iten.no + 1 }}</div> <div class="no">{{ iten.no + 1 }}</div>
<div :title="iten.deviceName" class="code"> <div :title="iten.deviceName" class="code">
{{ iten.deviceName + `999` }} {{ iten.deviceName }}
</div> </div>
<div :title="iten.deviceAddress" class="name"> <div :title="iten.deviceAddress" class="name">
{{ iten.deviceAddress ? iten.deviceAddress : "-" }} {{ iten.deviceAddress ? iten.deviceAddress : "-" }}
...@@ -543,7 +543,7 @@ export default { ...@@ -543,7 +543,7 @@ export default {
type: "8", type: "8",
value: 11, value: 11,
icon: "icon-jiayong", icon: "icon-jiayong",
label: "家用报警器", label: "家用报警器用户",
nowPage: 1, nowPage: 1,
maxPage: 99, maxPage: 99,
list: [], list: [],
...@@ -552,7 +552,7 @@ export default { ...@@ -552,7 +552,7 @@ export default {
type: "9", type: "9",
value: 12, value: 12,
icon: "icon-shangye", icon: "icon-shangye",
label: "商用报警器", label: "商用报警器用户",
nowPage: 1, nowPage: 1,
maxPage: 99, maxPage: 99,
list: [], list: [],
...@@ -561,7 +561,7 @@ export default { ...@@ -561,7 +561,7 @@ export default {
type: "10", type: "10",
value: 13, value: 13,
icon: "icon-gongye", icon: "icon-gongye",
label: "工业报警器", label: "工业报警器用户",
nowPage: 1, nowPage: 1,
maxPage: 99, maxPage: 99,
list: [], list: [],
...@@ -598,7 +598,12 @@ export default { ...@@ -598,7 +598,12 @@ export default {
// 右下角的圆 // 右下角的圆
circleShow: false, circleShow: false,
circleNum: 0, circleNum: 0,
// 报警列表的数据
detcetorList: [], detcetorList: [],
// 报警列表的总数据,分页用的
centerTotal:0,
// 这是center列表翻页时候用的userId
centerUserId:99,
lntPosition: 0, lntPosition: 0,
//右上角数据 //右上角数据
rightPicData:{}, rightPicData:{},
...@@ -845,7 +850,10 @@ export default { ...@@ -845,7 +850,10 @@ export default {
return getdetectorInfoList(queryParams).then((res) => { return getdetectorInfoList(queryParams).then((res) => {
console.log("queryParams", res); console.log("queryParams", res);
if (res.code == 200) { if (res.code == 200) {
this.detcetorList = res.data; this.detcetorList = res.rows;
this.centerUserId = queryParams.userId;
// 总数据
this.centerTotal = res.total;
this.$refs.center.fade = "fade"; this.$refs.center.fade = "fade";
this.centerShow = true; this.centerShow = true;
// 传递回去 // 传递回去
...@@ -2632,7 +2640,7 @@ input[type="radio"] { ...@@ -2632,7 +2640,7 @@ input[type="radio"] {
.diviceNum { .diviceNum {
color: #fff; color: #fff;
position: absolute; position: absolute;
left: 180px; left: 210px;
top: 12px; top: 12px;
} }
} }
......
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