Commit 76fe364a authored by 纪泽龙's avatar 纪泽龙

合并jzl

parents 26d35ba5 12125056
...@@ -146,13 +146,13 @@ export default { ...@@ -146,13 +146,13 @@ export default {
} else { } else {
// 显示左侧联动菜单 // 显示左侧联动菜单
path = this.activeRoutes(key); path = this.activeRoutes(key);
console.log(path) console.log(path);
console.log(this.$route.path) console.log(this.$route.path);
if (this.$route.path != path[0].path) { if (this.$route.path != path[0].path) {
if(path[0].path){ if (path[0].path) {
this.$router.push(path[0].path); this.$router.push(path[0].path);
}else{ } else {
if(path[0].path=="" && this.$route.path=="/index") return; if (path[0].path == "" && this.$route.path == "/index") return;
this.$router.push("/index"); this.$router.push("/index");
} }
} }
...@@ -207,6 +207,22 @@ export default { ...@@ -207,6 +207,22 @@ export default {
font-weight: 600; font-weight: 600;
text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.2); text-shadow: 0px 2px 3px rgba(0, 0, 0, 0.2);
padding: 0 5px; padding: 0 5px;
border-bottom: none;
position: relative;
&:after {
content: "";
position: absolute;
width: 2px;
height: 38px;
background: radial-gradient(
circle,
#ffffff 0%,
rgba(255, 255, 255, 0) 100%
);
right: -20px;
top: 21px;
opacity: 1;
}
} }
.el-menu--horizontal > .el-menu-item.is-active { .el-menu--horizontal > .el-menu-item.is-active {
...@@ -219,6 +235,7 @@ export default { ...@@ -219,6 +235,7 @@ export default {
.el-menu--horizontal > .el-submenu .el-submenu__title { .el-menu--horizontal > .el-submenu .el-submenu__title {
height: 50px !important; height: 50px !important;
line-height: 50px !important; line-height: 50px !important;
margin-left:15px;
} }
.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover, .el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus { .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus {
......
...@@ -53,16 +53,30 @@ export const constantRoutes = [ ...@@ -53,16 +53,30 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/error/401'], resolve), component: (resolve) => require(['@/views/error/401'], resolve),
hidden: true hidden: true
}, },
// {
// path: '',
// component: Layout,
// redirect: 'index',
// children: [
// {
// path: 'index',
// component: (resolve) => require(['@/views/index_v1'], resolve),
// name: '首页',
// meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
// }
// ]
// },
// 首页改成地图
{ {
path: '', path: '',
component: Layout, component: Layout,
redirect: 'index', redirect: '/enterprise/mapView',
children: [ children: [
{ {
path: 'index', path: '/enterprise/mapView',
component: (resolve) => require(['@/views/index_v1'], resolve), component: (resolve) => require(['@/views/enterprise/mapView'], resolve),
name: '首页', // name: '首页',
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } // meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
} }
] ]
}, },
......
...@@ -26,7 +26,8 @@ const permission = { ...@@ -26,7 +26,8 @@ const permission = {
path: 'index', path: 'index',
meta: { title: '统计报表', icon: 'dashboard'} meta: { title: '统计报表', icon: 'dashboard'}
}] }]
state.topbarRouters = routes.concat(index); // state.topbarRouters = routes.concat(index);
state.topbarRouters = routes;
}, },
SET_SIDEBAR_ROUTERS: (state, routes) => { SET_SIDEBAR_ROUTERS: (state, routes) => {
state.sidebarRouters = routes; state.sidebarRouters = routes;
......
...@@ -51,6 +51,8 @@ class gaodeMap { ...@@ -51,6 +51,8 @@ class gaodeMap {
view = null; view = null;
handleInfoWindowOpenFunc = null; handleInfoWindowOpenFunc = null;
onceFlag = false;
//构造函数中设置中央点默认值 //构造函数中设置中央点默认值
constructor(center) { constructor(center) {
this.markers = []; this.markers = [];
...@@ -107,6 +109,16 @@ class gaodeMap { ...@@ -107,6 +109,16 @@ class gaodeMap {
this.handleInfoWindowOpenFunc(); this.handleInfoWindowOpenFunc();
this.handleInfoWindowOpenFunc = null; this.handleInfoWindowOpenFunc = null;
} }
// 刚进入页面的时候只调用一次,让左侧的抽屉在地图移动完之后显示
if (!this.onceFlag) {
this.onceFlag = true;
this.view.backFlag = false;
let options = this.myMap.getStatus();
options.scrollWheel = true;
this.myMap.setStatus(options);
}
}); });
this.districtBoundaries(); this.districtBoundaries();
} }
...@@ -237,9 +249,9 @@ class gaodeMap { ...@@ -237,9 +249,9 @@ class gaodeMap {
// // infoWindow.close(); // // infoWindow.close();
// that.workerManInfoWindow = infoWindow; // that.workerManInfoWindow = infoWindow;
// }); // });
marker.markerType=markerType; marker.markerType = markerType;
marker.data = data; marker.data = data;
marker.infoWindow =infoWindow; marker.infoWindow = infoWindow;
marker.on("mouseover", this.wokerManOpen); marker.on("mouseover", this.wokerManOpen);
marker.on("mousedown", e => { marker.on("mousedown", e => {
// console.log(data); // console.log(data);
...@@ -346,17 +358,17 @@ class gaodeMap { ...@@ -346,17 +358,17 @@ class gaodeMap {
return marker; return marker;
} }
wokerManOpen=(e)=> { wokerManOpen = e => {
this.markerType = e.target.markerType; this.markerType = e.target.markerType;
e.target.content = this.getMarketContent( e.target.data); e.target.content = this.getMarketContent(e.target.data);
e.target.infoWindow.setContent(e.target.content); e.target.infoWindow.setContent(e.target.content);
e.target.infoWindow.open(map, e.target.getPosition()); e.target.infoWindow.open(map, e.target.getPosition());
console.log("e.target.getPosition()",e.target.getExtData()) console.log("e.target.getPosition()", e.target.getExtData());
this.boxCollision(e.target.infoWindow.dom); this.boxCollision(e.target.infoWindow.dom);
// that.addCloneDome(e.target, infoWindow); // that.addCloneDome(e.target, infoWindow);
// infoWindow.close(); // infoWindow.close();
this.workerManInfoWindow = e.target.infoWindow; this.workerManInfoWindow = e.target.infoWindow;
} };
// 鼠标移入设备时候实行的函数 // 鼠标移入设备时候实行的函数
infoOpen = e => { infoOpen = e => {
...@@ -724,7 +736,7 @@ class gaodeMap { ...@@ -724,7 +736,7 @@ class gaodeMap {
let path = coordinates ? eval(coordinates) : []; let path = coordinates ? eval(coordinates) : [];
let polyline = new AMap.Polyline({ let polyline = new AMap.Polyline({
path, path,
strokeColor: "#F7FE38", strokeColor: "#2EE7E7",
strokeWeight: 4, strokeWeight: 4,
strokeOpacity: 0.9, strokeOpacity: 0.9,
zIndex: 50, zIndex: 50,
...@@ -748,7 +760,7 @@ class gaodeMap { ...@@ -748,7 +760,7 @@ class gaodeMap {
polyline.on("mouseout", e => { polyline.on("mouseout", e => {
// console.log("polyline.getExtData().lineData.alarmState",polyline.getExtData().lineData.alarmState) // console.log("polyline.getExtData().lineData.alarmState",polyline.getExtData().lineData.alarmState)
if (polyline.getExtData().lineData.alarmState == 1) return; if (polyline.getExtData().lineData.alarmState == 1) return;
polyline.setOptions({ strokeColor: "#F7FE38" }); polyline.setOptions({ strokeColor: "#2EE7E7" });
// infoWindow.close(); // infoWindow.close();
}); });
// 计算info的位置 // 计算info的位置
...@@ -1107,7 +1119,7 @@ class gaodeMap { ...@@ -1107,7 +1119,7 @@ class gaodeMap {
opstions.isState = 0; opstions.isState = 0;
item.setExtData(opstions); item.setExtData(opstions);
let attr = item.getOptions(); let attr = item.getOptions();
attr.strokeColor = "#F7FE38"; attr.strokeColor = "#2EE7E7";
item.setOptions(attr); item.setOptions(attr);
}); });
} }
......
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
// 右下角数据 跟值班人员 // 右下角数据 跟值班人员
this.rightBottomData(); this.rightBottomData();
this.backFlag = false; // this.backFlag = false;
}, },
// 获取地图上的资源 // 获取地图上的资源
...@@ -492,7 +492,7 @@ export default { ...@@ -492,7 +492,7 @@ export default {
options.lineData.alarmId = alarmId; options.lineData.alarmId = alarmId;
options.lineData.orderId = orderId; options.lineData.orderId = orderId;
if (endTime) { if (endTime) {
polyline.setOptions({ strokeColor: "#F7FE38" }); polyline.setOptions({ strokeColor: "#2EE7E7" });
options.lineData.alarmState = 0; options.lineData.alarmState = 0;
// 报警类型 // 报警类型
options.lineData.alarmType = null; options.lineData.alarmType = null;
...@@ -514,6 +514,7 @@ export default { ...@@ -514,6 +514,7 @@ export default {
}); });
} }
console.log("deviceArr", deviceArr);
// 其他设备 // 其他设备
if (deviceArr.length > 0) { if (deviceArr.length > 0) {
deviceArr.forEach((item) => { deviceArr.forEach((item) => {
...@@ -591,8 +592,7 @@ export default { ...@@ -591,8 +592,7 @@ export default {
// "ws://192.168.2.23:8903/gassafety/websocketServer" // "ws://192.168.2.23:8903/gassafety/websocketServer"
// ); // );
this.ws.onopen = (evt) => { this.ws.onopen = (evt) => {
console.log("WebSockets=======gogogog"); console.log("WebSockets开启");
// this.ws.send("WebSockets!=========================");
}; };
this.ws.onmessage = (evt) => { this.ws.onmessage = (evt) => {
console.log("推送", evt); console.log("推送", evt);
...@@ -604,9 +604,6 @@ export default { ...@@ -604,9 +604,6 @@ export default {
this.ws.onclose = () => { this.ws.onclose = () => {
console.log("ws协议关闭"); console.log("ws协议关闭");
}; };
// this.ws.onclose = function (evt) {
// console.log("关闭");
// };
}, },
// 右下角数据 // 右下角数据
...@@ -914,7 +911,7 @@ export default { ...@@ -914,7 +911,7 @@ export default {
no: index, no: index,
userId: item.userId, userId: item.userId,
userName: item.userName, userName: item.userName,
userPhone: item.phone, userPhone: item.phonenumber,
}; };
}); });
console.log("值班人员", workManArr); console.log("值班人员", workManArr);
...@@ -937,11 +934,10 @@ export default { ...@@ -937,11 +934,10 @@ export default {
); );
}); });
item.maxPage = Math.ceil(this.allList[index].length / num); item.maxPage = Math.ceil(this.allList[index].length / num);
}else{ } else {
// 如果为空,就直接把item.list写成[]; // 如果为空,就直接把item.list写成[];
item.list=[]; item.list = [];
} }
}); });
}, },
pageBack(item) { pageBack(item) {
...@@ -1099,8 +1095,9 @@ export default { ...@@ -1099,8 +1095,9 @@ export default {
// 清空左边列表 // 清空左边列表
// this.changeBtnDataClear(); // this.changeBtnDataClear();
// this.gaoMap.placeSearch.search(this.keyWord); // this.gaoMap.placeSearch.search(this.keyWord);
await this.getDeviceInfo({ deviceName: this.keyWord }); this.gaoMap.markers = [];
this.gaoMap.polyLines = []; this.gaoMap.polyLines = [];
await this.getDeviceInfo({ deviceName: this.keyWord });
await this.getPipeList({ pipeName: this.keyWord }); await this.getPipeList({ pipeName: this.keyWord });
// 值班人员 // 值班人员
await this.getInspectorLocations({ userName: this.keyWord }); await this.getInspectorLocations({ userName: this.keyWord });
...@@ -1108,8 +1105,6 @@ export default { ...@@ -1108,8 +1105,6 @@ export default {
// 设备报警 // 设备报警
this.getSelectAlarmDevice(); this.getSelectAlarmDevice();
this.pipeList(); this.pipeList();
console.log(this.changeBtnData);
console.log(this.allList)
} }
}, },
// 清空左边列表 // 清空左边列表
...@@ -1190,6 +1185,7 @@ export default { ...@@ -1190,6 +1185,7 @@ export default {
window.removeEventListener("mousedown", this.barClose); window.removeEventListener("mousedown", this.barClose);
// 关闭scoket // 关闭scoket
if (this.ws) { if (this.ws) {
console.log("socket关闭了");
this.ws.close(); this.ws.close();
this.ws = null; this.ws = null;
} }
...@@ -1205,7 +1201,6 @@ export default { ...@@ -1205,7 +1201,6 @@ export default {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
} }
.btn-wrapper { .btn-wrapper {
position: fixed; position: fixed;
right: 32px; right: 32px;
......
<template>
<div class="dashboard-editor-container">
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" />
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<raddar-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
</div>
</template>
<script>
import PanelGroup from '../../dashboard/PanelGroup'
import LineChart from '../../dashboard/LineChart'
import RaddarChart from '../../dashboard/RaddarChart'
import PieChart from '../../dashboard/PieChart'
import BarChart from '../../dashboard/BarChart'
//报表
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
export default {
name: 'Index',
components: {
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart
},
data() {
return {
lineChartData: lineChartData.newVisitis
}
},
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
}
}
}
</script>
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
@media (max-width:1024px) {
.chart-wrapper {
padding: 8px;
}
}
</style>
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