Commit 4fb258dc authored by 纪泽龙's avatar 纪泽龙

提交

parent 8233a107
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"js-beautify": "1.13.0", "js-beautify": "1.13.0",
"js-cookie": "2.2.1", "js-cookie": "2.2.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"moment": "^2.29.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",
......
...@@ -10,16 +10,17 @@ export function listPipe(query) { ...@@ -10,16 +10,17 @@ export function listPipe(query) {
} }
// 查询管道信息列表
// 查询管道信息详细 export function pipeAllInfoList(query) {
export function getPipe(pipeId) {
return request({ return request({
url: '/device/pipe/' + pipeId, url: '/device/pipe/pipeAllInfoList',
method: 'get' method: 'get',
params: query
}) })
} }
// getAllDeviceInfo // getAllDeviceInfo
export function getAllDevice(data) { export function getAllDevice(data) {
......
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2692138 */ font-family: "iconfont"; /* Project id 2692138 */
src: url('//at.alicdn.com/t/font_2692138_odrjf05krdd.woff2?t=1626922957592') format('woff2'), src: url('//at.alicdn.com/t/font_2692138_75daec8zfbv.woff2?t=1627011828763') format('woff2'),
url('//at.alicdn.com/t/font_2692138_odrjf05krdd.woff?t=1626922957592') format('woff'), url('//at.alicdn.com/t/font_2692138_75daec8zfbv.woff?t=1627011828763') format('woff'),
url('//at.alicdn.com/t/font_2692138_odrjf05krdd.ttf?t=1626922957592') format('truetype'); url('//at.alicdn.com/t/font_2692138_75daec8zfbv.ttf?t=1627011828763') format('truetype');
} }
.iconfont { .iconfont {
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-ylb:before {
content: "\e60f";
}
.icon-fmj:before { .icon-fmj:before {
content: "\e608"; content: "\e608";
} }
......
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="top display-default"> <div class="top display-default">
<div class="left text">裕华路地埋管线</div> <div class="left text">{{ obj.pipeName }}</div>
<div class="right text"> <div v-if="!obj.editorPage" class="right text">
<img src="../../assets/images/closeBtn.png" alt="" /> <img src="../../assets/images/closeBtn.png" alt="" />
</div> </div>
</div> </div>
<!-- 设备信息 --> <!-- 设备信息 -->
<div class="eq-content display-default"> <div class="eq-content display-default">
<div class="text-wrapper"> <div class="text-wrapper">
<div class="eq-text">设备编号:<span>aa</span></div> <div :title="obj.pipeName" class="eq-text">
<div class="eq-text">设备名称:<span>裕华路地埋管线</span></div> <span>管道名称:</span>
<div class="eq-text">监测介质:<span>甲烷</span></div> <span>{{ obj.pipeName }}</span>
<div class="eq-text">设备状态:<span>报警</span></div> </div>
<div class="eq-text">用户信息:<span>中厨燃气</span></div> <div class="eq-text">
<span>管道编号:</span>
<span>{{ obj.pipeCode }}</span>
</div>
<div class="eq-text">
<span>管道长度:</span>
<span>{{ `${obj.pipeLength ?obj.pipeLength+'米':""}` }}</span>
</div>
<div class="eq-text">
<span>管道类型:</span>
<span>{{ ["地埋管线", "地表管线"][obj.pipeType] }}</span>
</div>
<div class="eq-text">
<span>管道压力:</span>
<span>{{
["低押", "中压", "次高压", "高压"][obj.pipePressure]
}}</span>
</div>
</div> </div>
<div class="pic"> <div class="pic">
<img src="" alt="" /> <img :src="obj.url" alt="" />
</div> </div>
</div> </div>
<!-- 维修人员 -->
<div class="maintain-content"> <div class="maintain-content">
<div>姓名: <span>高雄</span></div> <div>
<div>电话: <span>13512451234</span></div> 安装日期:<span>{{ obj.installationTime }}</span>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div> </div>
<div>
最后巡检日期:<span>{{ obj.inspectionTime }}</span>
</div>
<div>
备注信息;<span>{{ obj.remarks }}</span>
</div>
</div> </div>
<template v-if="!obj.editorPage"> <template v-if="!obj.editorPage">
<div class="warn-content"> <div class="warn-content">
...@@ -58,7 +82,7 @@ export default { ...@@ -58,7 +82,7 @@ export default {
.top { .top {
width: 100%; width: 100%;
height: 51px; height: 51px;
background-color: #053B6A; background-color: #053b6a;
.text { .text {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
...@@ -74,7 +98,7 @@ export default { ...@@ -74,7 +98,7 @@ export default {
} }
.eq-content { .eq-content {
height: 156px; min-height: 156px;
box-sizing: border-box; box-sizing: border-box;
padding: 13px 16px 13px 22px; padding: 13px 16px 13px 22px;
border-bottom: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
...@@ -88,6 +112,15 @@ export default { ...@@ -88,6 +112,15 @@ export default {
font-weight: 400; font-weight: 400;
color: #1d1d1d; color: #1d1d1d;
opacity: 1; opacity: 1;
& > span {
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
max-width: 100px;
}
} }
} }
.pic { .pic {
...@@ -137,8 +170,7 @@ export default { ...@@ -137,8 +170,7 @@ export default {
} }
} }
.wrapperEditorPage{ .wrapperEditorPage {
} }
.display-default { .display-default {
display: flex; display: flex;
......
...@@ -234,11 +234,11 @@ class gaodeMap { ...@@ -234,11 +234,11 @@ class gaodeMap {
this.polyLines.push(polyline); this.polyLines.push(polyline);
// 信息窗体 // 信息窗体
const dom = createPop(lineInfoWindow, { const dom = createPop(lineInfoWindow, {
obj: { a: 123 ,editorPage:true} obj: { a: 123, editorPage: true }
}); });
console.log("dom", dom.$el); console.log("dom", dom.$el);
let infoWindow = new AMap.InfoWindow({ let infoWindow = new AMap.InfoWindow({
isCustom: true, isCustom: true,
content: dom.$el, content: dom.$el,
...@@ -292,53 +292,55 @@ class gaodeMap { ...@@ -292,53 +292,55 @@ class gaodeMap {
// 坐标导航的宽 // 坐标导航的宽
const leftBar = 100; const leftBar = 100;
// 屏幕可视区的宽高 // 屏幕可视区的宽高
const {clientWidth:windowClientWidth,clientHeight:windowClientHeight} = document.body; const {
clientWidth: windowClientWidth,
clientHeight: windowClientHeight
} = document.body;
// 弹出的信息窗口的宽高 // 弹出的信息窗口的宽高
// const { offsetWidth:infoWindowWidth,offsetHeight:infoWindowHeight} =infoWindow.dom; // const { offsetWidth:infoWindowWidth,offsetHeight:infoWindowHeight} =infoWindow.dom;
// 406,316 // 406,316
const { offsetWidth:infoWindowWidth,offsetHeight:infoWindowHeight} ={offsetWidth:406,offsetHeight:316} const {
offsetWidth: infoWindowWidth,
offsetHeight: infoWindowHeight
} = { offsetWidth: 406, offsetHeight: 316 };
// 鼠标碰到线后的位置 // 鼠标碰到线后的位置
const {clientX:mouseClientX,clientY:mouseClientY} = e.originEvent; const { clientX: mouseClientX, clientY: mouseClientY } = e.originEvent;
// 鼠标到左边界的距离 // 鼠标到左边界的距离
const offsetLeftX= mouseClientX -100; const offsetLeftX = mouseClientX - 100;
// 鼠标到右边界的距离 // 鼠标到右边界的距离
const offsetRightX= windowClientWidth-mouseClientX; const offsetRightX = windowClientWidth - mouseClientX;
const offsetTopY = mouseClientY-81; const offsetTopY = mouseClientY - 81;
const offsetBottomY = windowClientHeight-mouseClientY; const offsetBottomY = windowClientHeight - mouseClientY;
const offsetY = mouseClientY -80 -infoWindowHeight; const offsetY = mouseClientY - 80 - infoWindowHeight;
let X=20,Y=-20; let X = 20,
if(offsetLeftX<=infoWindowWidth){ Y = -20;
console.log("靠左了") if (offsetLeftX <= infoWindowWidth) {
X=20; console.log("靠左了");
}else if(offsetRightX<=infoWindowWidth){ X = 20;
console.log("靠右了") } else if (offsetRightX <= infoWindowWidth) {
X=-infoWindowWidth-20; console.log("靠右了");
X = -infoWindowWidth - 20;
} }
if(offsetTopY<=infoWindowHeight){ if (offsetTopY <= infoWindowHeight) {
console.log("靠上了") console.log("靠上了");
Y=20 Y = 20;
}else if(offsetBottomY<=infoWindowHeight+81){ } else if (offsetBottomY <= infoWindowHeight + 81) {
console.log("靠下了") console.log("靠下了");
Y= -infoWindowHeight-20; Y = -infoWindowHeight - 20;
} }
polyline.setOptions({ strokeColor: "#FF5A67" }); polyline.setOptions({ strokeColor: "#FF5A67" });
infoWindow.setOffset(new AMap.Pixel(X,Y)) infoWindow.setOffset(new AMap.Pixel(X, Y));
infoWindow.open(map, e.lnglat); infoWindow.open(map, e.lnglat);
// const
// const
}); });
polyline.on("mouseout", e => { polyline.on("mouseout", e => {
polyline.setOptions({ strokeColor: "#F7FE38" }); polyline.setOptions({ strokeColor: "#F7FE38" });
infoWindow.close(); infoWindow.close();
}); });
// 计算info的位置 // 计算info的位置
function infoPosition(){ // function infoPosition() {}
}
// polyline.on("rightclick", e => { // polyline.on("rightclick", e => {
// console.log(this.lineType); // console.log(this.lineType);
...@@ -422,7 +424,9 @@ class gaodeMap { ...@@ -422,7 +424,9 @@ class gaodeMap {
newLineAddEvent(obj) { newLineAddEvent(obj) {
obj.polyEditor = new AMap.PolyEditor(map, obj); obj.polyEditor = new AMap.PolyEditor(map, obj);
obj.on("click", () => { obj.on("click", () => {
console.log(this.lineType)
// 获取当前状态 0普通状态,1是正编辑状态 // 获取当前状态 0普通状态,1是正编辑状态
const { isState, type } = obj.getExtData(); const { isState, type } = obj.getExtData();
// 如果不是新线的时候并且没点编辑,点击是无效的 // 如果不是新线的时候并且没点编辑,点击是无效的
if (type != "newLine" && this.lineType != 2) return; if (type != "newLine" && this.lineType != 2) return;
...@@ -434,10 +438,27 @@ class gaodeMap { ...@@ -434,10 +438,27 @@ class gaodeMap {
console.log(opstions); console.log(opstions);
obj.setExtData(opstions); obj.setExtData(opstions);
} else { } else {
this.infoWindowPipelineView({ obj, lineType: type }); // 经纬度
const lnglatsArr = obj.getPath().map(item=>([item.lng,item.lat]));
// 管道总长度
const pipeLength = obj.getLength();
// 传回来的数据 如果是新管道就是空
const lineData = type == "newLine" ? {} : obj.getExtData().lineData;
this.infoWindowPipelineView({ target:obj, lineType: type,lnglatsArr, pipeLength,lineData });
} }
}); });
} }
// 关闭所有已经上传的线的编辑状态
linePolyEditorAllClose() {
this.polyLines.forEach(item => {
item.polyEditor.close();
// let opstions = obj.getExtData();
// opstions.isState = 1;
item.setExtData({isState:0});
item.setOptions({ strokeColor: "#F7FE38" });
});
}
// 传进组件的会调 点确认的时候调 // 传进组件的会调 点确认的时候调
lineOkCallBack(target) { lineOkCallBack(target) {
target.polyEditor.close(); target.polyEditor.close();
...@@ -453,11 +474,17 @@ class gaodeMap { ...@@ -453,11 +474,17 @@ class gaodeMap {
// 上传服务器用的组件 // 上传服务器用的组件
infoWindowPipelineView(options) { infoWindowPipelineView(options) {
// const {} =options;
const notice = createPop(pipelineView, { const notice = createPop(pipelineView, {
title: "管道", title: "管道",
//线是新线还是老线 // 数据
lineType: options.lineType, // lineData: options.lineData,
target: options.obj, // lnglatsArr:options.lnglatsArr,
// pipeLength:options.pipeLength,
// //线是新线还是老线
// lineType: options.lineType,
// target: options.obj,
...options,
//把当前对象当作that传进去 //把当前对象当作that传进去
gaodeMap: this, gaodeMap: this,
lineOkCallBack: this.lineOkCallBack lineOkCallBack: this.lineOkCallBack
......
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
</template> </template>
<script> <script>
import gaodeMap from "utils/gaodeMap.js"; import gaodeMap from "utils/gaodeMap.js";
import {pipeAllInfoList} from "@/api/device/pipe.js"
import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js"; import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js";
export default { export default {
data() { data() {
...@@ -171,6 +172,9 @@ export default { ...@@ -171,6 +172,9 @@ export default {
}, },
mounted() { mounted() {
let gaoMap = new gaodeMap("石家庄"); let gaoMap = new gaodeMap("石家庄");
pipeAllInfoList().then(res=>{
console.log("管道",res);
})
this.gaoMap = gaoMap; this.gaoMap = gaoMap;
let lnglats = [ let lnglats = [
[114.497949, 38.121129], [114.497949, 38.121129],
...@@ -198,6 +202,7 @@ export default { ...@@ -198,6 +202,7 @@ export default {
gaoMap.addMouseTool(); gaoMap.addMouseTool();
}, },
methods: { methods: {
// 左边的Bar修改值
leftBarChange(item){ leftBarChange(item){
// this.leftBarNum= this.leftBarNum != item.value ? item.value:0; // this.leftBarNum= this.leftBarNum != item.value ? item.value:0;
const index = this.leftBarNum.indexOf(item.value); const index = this.leftBarNum.indexOf(item.value);
...@@ -206,7 +211,6 @@ export default { ...@@ -206,7 +211,6 @@ export default {
}else{ }else{
this.leftBarNum.push(item.value) this.leftBarNum.push(item.value)
} }
}, },
addDevice() { addDevice() {
if (this.iconClass == "icon-create") { if (this.iconClass == "icon-create") {
...@@ -217,8 +221,10 @@ export default { ...@@ -217,8 +221,10 @@ export default {
this.createReset(); this.createReset();
} }
} }
if(this.targetNum ==1 && this.createValue ==1){
this.gaoMap.lineType=1;
}
this.deviceType = !this.deviceType; this.deviceType = !this.deviceType;
this.gaoMap.mapOperateType = "add"; this.gaoMap.mapOperateType = "add";
this.gaoMap.removeMarkerDragg(); this.gaoMap.removeMarkerDragg();
}, },
...@@ -228,6 +234,12 @@ export default { ...@@ -228,6 +234,12 @@ export default {
this.iconClass = item.icon; this.iconClass = item.icon;
this.createValue = item.value; this.createValue = item.value;
this.createLabel = item.label; this.createLabel = item.label;
if(this.targetNum==1 && this.createValue==1){
// 0是初始,1是新建 2是编辑 3删除
this.gaoMap.lineType=1;
this.gaoMap.createNewLine();
}
}, },
// 新建按钮还原 // 新建按钮还原
createReset() { createReset() {
...@@ -237,14 +249,20 @@ export default { ...@@ -237,14 +249,20 @@ export default {
}, },
editDevice() { editDevice() {
this.targetNum = this.targetNum != 2 ? 2 : 0; this.targetNum = this.targetNum != 2 ? 2 : 0;
this.gaoMap.lineType=this.targetNum;
console.log(this.gaoMap.lineType)
if(this.targetNum!=2) {
this.gaoMap.linePolyEditorAllClose();
}
this.createReset(); this.createReset();
this.deviceType = false; this.deviceType = false;
this.gaoMap.lineType = 2;
this.gaoMap.mapOperateType = "edit"; this.gaoMap.mapOperateType = "edit";
this.gaoMap.addMarkerDragg(); this.gaoMap.addMarkerDragg();
}, },
deleteDevice() { deleteDevice() {
this.targetNum = this.targetNum != 3 ? 3 : 0; this.targetNum = this.targetNum != 3 ? 3 : 0;
this.gaoMap.lineType=this.targetNum;
this.createReset(); this.createReset();
this.deviceType = false; this.deviceType = false;
this.gaoMap.mapOperateType = "delete"; this.gaoMap.mapOperateType = "delete";
......
...@@ -5929,6 +5929,11 @@ mkdirp@^1.0.4: ...@@ -5929,6 +5929,11 @@ mkdirp@^1.0.4:
resolved "https://registry.nlark.com/mkdirp/download/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" resolved "https://registry.nlark.com/mkdirp/download/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha1-PrXtYmInVteaXw4qIh3+utdcL34= integrity sha1-PrXtYmInVteaXw4qIh3+utdcL34=
moment@^2.29.1:
version "2.29.1"
resolved "https://registry.npm.taobao.org/moment/download/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
integrity sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=
move-concurrently@^1.0.1: move-concurrently@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" resolved "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
......
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