|
|
@ -7,7 +7,7 @@
|
|
|
|
width="1262px"
|
|
|
|
width="1262px"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="picPannel">
|
|
|
|
<div class="picPannel">
|
|
|
|
<div class="imgbox" v-if="picsrc">
|
|
|
|
<div class="imgbox" v-if="picsrc" v-loading="loading">
|
|
|
|
<img ref="picJpg" :src="picsrc" />
|
|
|
|
<img ref="picJpg" :src="picsrc" />
|
|
|
|
<canvas
|
|
|
|
<canvas
|
|
|
|
id="myCanvas"
|
|
|
|
id="myCanvas"
|
|
|
@ -17,6 +17,7 @@
|
|
|
|
@mouseup="mouseup"
|
|
|
|
@mouseup="mouseup"
|
|
|
|
@mousemove="mousemove"
|
|
|
|
@mousemove="mousemove"
|
|
|
|
></canvas>
|
|
|
|
></canvas>
|
|
|
|
|
|
|
|
<!-- <canvas v-else id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="imgbox" v-else>
|
|
|
|
<div class="imgbox" v-else>
|
|
|
|
<img ref="picJpg" src="../../../../../assets/img/nopic.jpg" />
|
|
|
|
<img ref="picJpg" src="../../../../../assets/img/nopic.jpg" />
|
|
|
@ -110,6 +111,8 @@ export default {
|
|
|
|
markId: "",
|
|
|
|
markId: "",
|
|
|
|
cmdid: "",
|
|
|
|
cmdid: "",
|
|
|
|
photoId: "",
|
|
|
|
photoId: "",
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
nopic: require("@/assets/img/nopic.jpg"),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {},
|
|
|
|
mounted() {},
|
|
|
@ -125,6 +128,7 @@ export default {
|
|
|
|
this.picsrc = obj.path;
|
|
|
|
this.picsrc = obj.path;
|
|
|
|
this.channelId = obj.id;
|
|
|
|
this.channelId = obj.id;
|
|
|
|
this.photoId = obj.photoId;
|
|
|
|
this.photoId = obj.photoId;
|
|
|
|
|
|
|
|
this.restCanvas();
|
|
|
|
this.getcanvansPic(this.pictureData, this.channelId);
|
|
|
|
this.getcanvansPic(this.pictureData, this.channelId);
|
|
|
|
// console.log(this.picsrc);
|
|
|
|
// console.log(this.picsrc);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -139,6 +143,7 @@ export default {
|
|
|
|
this.$parent.terminalList(); //刷新
|
|
|
|
this.$parent.terminalList(); //刷新
|
|
|
|
},
|
|
|
|
},
|
|
|
|
display(val) {
|
|
|
|
display(val) {
|
|
|
|
|
|
|
|
console.log(val);
|
|
|
|
this.isShow = true;
|
|
|
|
this.isShow = true;
|
|
|
|
this.pictureData = val; //获取当前列表数据
|
|
|
|
this.pictureData = val; //获取当前列表数据
|
|
|
|
this.picoptions = val.list; //获取所有通道
|
|
|
|
this.picoptions = val.list; //获取所有通道
|
|
|
@ -152,9 +157,10 @@ export default {
|
|
|
|
this.pictureData = "";
|
|
|
|
this.pictureData = "";
|
|
|
|
this.picoptions = [];
|
|
|
|
this.picoptions = [];
|
|
|
|
this.picvalue = "";
|
|
|
|
this.picvalue = "";
|
|
|
|
|
|
|
|
this.picsrc = "";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getcanvansPic(val, channelid) {
|
|
|
|
getcanvansPic(val, channelid) {
|
|
|
|
//this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
getCoordinate({
|
|
|
|
getCoordinate({
|
|
|
|
channelId: channelid,
|
|
|
|
channelId: channelid,
|
|
|
|
needPic: "0",
|
|
|
|
needPic: "0",
|
|
|
@ -162,7 +168,19 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
this.markId = res.data.markId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (res.data.path !== null) {
|
|
|
|
this.picsrc = res.data.path;
|
|
|
|
this.picsrc = res.data.path;
|
|
|
|
|
|
|
|
if (res.data.list.length !== 0) {
|
|
|
|
|
|
|
|
this.localPoints = res.data.list;
|
|
|
|
|
|
|
|
this.drawline();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.picsrc = this.nopic;
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((err) => {});
|
|
|
|
.catch((err) => {});
|
|
|
|
|
|
|
|
|
|
|
@ -182,10 +200,6 @@ export default {
|
|
|
|
this.canvas.height = this.imgpic.offsetHeight; //设置画布大小
|
|
|
|
this.canvas.height = this.imgpic.offsetHeight; //设置画布大小
|
|
|
|
this.ctx = this.canvas.getContext("2d");
|
|
|
|
this.ctx = this.canvas.getContext("2d");
|
|
|
|
//console.log(localStorage.getItem("piclinePoints"));
|
|
|
|
//console.log(localStorage.getItem("piclinePoints"));
|
|
|
|
|
|
|
|
|
|
|
|
this.localPoints = val.lineList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.drawline();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mousedown(e) {
|
|
|
|
mousedown(e) {
|
|
|
@ -269,6 +283,7 @@ export default {
|
|
|
|
this.ctx.strokeStyle = this.color;
|
|
|
|
this.ctx.strokeStyle = this.color;
|
|
|
|
// 线宽设置,必须放在绘制之前
|
|
|
|
// 线宽设置,必须放在绘制之前
|
|
|
|
this.ctx.lineWidth = this.num;
|
|
|
|
this.ctx.lineWidth = this.num;
|
|
|
|
|
|
|
|
if (this.localPoints.length !== 0) {
|
|
|
|
for (var i = 0; i < this.localPoints.length; i++) {
|
|
|
|
for (var i = 0; i < this.localPoints.length; i++) {
|
|
|
|
this.ctx.moveTo(
|
|
|
|
this.ctx.moveTo(
|
|
|
|
this.localPoints[i].x1 * this.imgpic.width,
|
|
|
|
this.localPoints[i].x1 * this.imgpic.width,
|
|
|
@ -279,6 +294,8 @@ export default {
|
|
|
|
this.localPoints[i].y2 * this.imgpic.height
|
|
|
|
this.localPoints[i].y2 * this.imgpic.height
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// this.ctx.moveTo(x, y);
|
|
|
|
// this.ctx.moveTo(x, y);
|
|
|
|
// this.ctx.lineTo(e.offsetX, e.offsetY);
|
|
|
|
// this.ctx.lineTo(e.offsetX, e.offsetY);
|
|
|
|
|
|
|
|
|
|
|
@ -289,7 +306,6 @@ export default {
|
|
|
|
//点击保存
|
|
|
|
//点击保存
|
|
|
|
saveCanvas() {
|
|
|
|
saveCanvas() {
|
|
|
|
console.log(this.linePoints);
|
|
|
|
console.log(this.linePoints);
|
|
|
|
// localStorage.setItem(this.cmdid, JSON.stringify(this.linePoints));
|
|
|
|
|
|
|
|
updateCoordinate({
|
|
|
|
updateCoordinate({
|
|
|
|
boderWidth: this.num,
|
|
|
|
boderWidth: this.num,
|
|
|
|
channelId: this.channelId,
|
|
|
|
channelId: this.channelId,
|
|
|
@ -299,9 +315,11 @@ export default {
|
|
|
|
list: this.linePoints,
|
|
|
|
list: this.linePoints,
|
|
|
|
termId: this.termId,
|
|
|
|
termId: this.termId,
|
|
|
|
width: this.imgpic.width,
|
|
|
|
width: this.imgpic.width,
|
|
|
|
photoId: this.photoId,
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
this.localPoints = [];
|
|
|
|
|
|
|
|
console.log(this.linePoints);
|
|
|
|
|
|
|
|
console.log("qing");
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
this.$message({
|
|
|
|
this.$message({
|
|
|
|
type: "success",
|
|
|
|
type: "success",
|
|
|
|