样式优化

ds1.0
fanluyan 2 years ago
parent 1f9476a5c3
commit 42a7c92543

@ -192,7 +192,7 @@ export default {
}; };
}, },
mounted() { mounted() {
console.log(this.terminalPhoto); ////console.log(this.terminalPhoto);
this.changeBigPic(this.terminalPhoto[0], 0); this.changeBigPic(this.terminalPhoto[0], 0);
}, },
watch: { watch: {
@ -206,7 +206,7 @@ export default {
}, },
created() { created() {
this.roleUser = localStorage.getItem("role"); this.roleUser = localStorage.getItem("role");
console.log(this.roleUser); ////console.log(this.roleUser);
}, },
methods: { methods: {
@ -244,7 +244,7 @@ export default {
termId: data.termId, termId: data.termId,
}) })
.then((res) => { .then((res) => {
console.log(res); //console.log(res);
this.localPoints = res.data.list; this.localPoints = res.data.list;
this.color = res.data.color; this.color = res.data.color;
this.borderwidth = res.data.boderWidth; this.borderwidth = res.data.boderWidth;
@ -258,12 +258,12 @@ export default {
//线 //线
openLine() { openLine() {
this.flagLine = true; this.flagLine = true;
console.log("我是绘制线缆");
//1 //1
updateMarkEnableStatus({ updateMarkEnableStatus({
status: 1, status: 1,
}).then((res) => { }).then((res) => {
console.log(res); //console.log(res);
}); });
this.drawline(); this.drawline();
}, },
@ -271,38 +271,35 @@ export default {
closeLine() { closeLine() {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.flagLine = false; this.flagLine = false;
console.log("关闭线缆");
//0 //0
updateMarkEnableStatus({ updateMarkEnableStatus({
status: 0, status: 0,
}).then((res) => { }).then((res) => {
console.log(res); //console.log(res);
}); });
}, },
//线 //线
drawline() { drawline() {
this.canvas = this.$refs.myCanvas; this.canvas = this.$refs.myCanvas;
this.imgpic = this.$refs.picJpg; this.imgpic = this.$refs.picJpg;
console.log(this.canvas);
console.log(this.imgpic);
this.canvas.width = this.imgpic.imageWidth; // this.canvas.width = this.imgpic.imageWidth; //
this.canvas.height = this.imgpic.imageHeight; // this.canvas.height = this.imgpic.imageHeight; //
this.ctx = this.canvas.getContext("2d"); this.ctx = this.canvas.getContext("2d");
console.log(this.localPoints);
if (this.flagLine == true) { if (this.flagLine == true) {
this.localPoints = this.localPoints; this.localPoints = this.localPoints;
console.log(this.localPoints);
} else { } else {
this.localPoints = []; this.localPoints = [];
} }
console.log(this.ctx);
this.ctx.beginPath(); this.ctx.beginPath();
//线 //线
this.ctx.strokeStyle = this.color; this.ctx.strokeStyle = this.color;
// 线 // 线
this.ctx.lineWidth = this.borderwidth; this.ctx.lineWidth = this.borderwidth;
console.log(this.ctx.lineWidth, this.ctx.strokeStyle);
console.log(this.localPoints);
if (this.localPoints == null) { if (this.localPoints == null) {
return; return;
} else { } else {
@ -329,22 +326,19 @@ export default {
}, },
// //
leftClick() { leftClick() {
console.log("我点击了左侧按钮", this.activeSmall);
this.activeSmall--; this.activeSmall--;
this.$refs.scrollBox.scrollLeft -= this.$refs.scrollBox.offsetWidth / 5; this.$refs.scrollBox.scrollLeft -= this.$refs.scrollBox.offsetWidth / 5;
this.changeBigPic(this.terminalPhoto[this.activeSmall], this.activeSmall); this.changeBigPic(this.terminalPhoto[this.activeSmall], this.activeSmall);
}, },
rightClick() { rightClick() {
console.log(this.activeSmall);
console.log(this.terminalPhoto.length);
this.activeSmall++; this.activeSmall++;
this.$refs.scrollBox.scrollLeft += this.$refs.scrollBox.offsetWidth / 5; this.$refs.scrollBox.scrollLeft += this.$refs.scrollBox.offsetWidth / 5;
this.changeBigPic(this.terminalPhoto[this.activeSmall], this.activeSmall); this.changeBigPic(this.terminalPhoto[this.activeSmall], this.activeSmall);
}, },
// //
changeBigPic(data, i) { changeBigPic(data, i) {
console.log(data, i); // //console.log(data, i);
console.log("鼠标222222222", this.currentPage, this.activeSmall); // //console.log("222222222", this.currentPage, this.activeSmall);
this.srcList = []; this.srcList = [];
this.localPoints = []; this.localPoints = [];
this.activeSmall = i; this.activeSmall = i;
@ -364,22 +358,21 @@ export default {
// //
handleScroll(e) { handleScroll(e) {
let direction = e.deltaY > 0 ? "down" : "up"; //deltaY let direction = e.deltaY > 0 ? "down" : "up"; //deltaY
console.log(e.deltaY, direction);
if (direction == "down") { if (direction == "down") {
console.log(this.$refs.scrollBox.offsetWidth / 5); this.$refs.scrollBox.scrollLeft +=
this.$refs.scrollBox.scrollLeft += this.$refs.scrollBox.offsetWidth / 5; (this.$refs.scrollBox.offsetWidth / 5) * 3;
} }
if (direction == "up") { if (direction == "up") {
this.$refs.scrollBox.scrollLeft -= this.$refs.scrollBox.offsetWidth / 5; this.$refs.scrollBox.scrollLeft -=
(this.$refs.scrollBox.offsetWidth / 5) * 3;
} }
}, },
// //
smallLeftClick() { smallLeftClick() {
console.log("缩略图箭头左侧");
this.$refs.scrollBox.scrollLeft -= this.$refs.scrollBox.offsetWidth; this.$refs.scrollBox.scrollLeft -= this.$refs.scrollBox.offsetWidth;
}, },
smallRightClick() { smallRightClick() {
console.log("缩略图箭头右侧");
this.$refs.scrollBox.scrollLeft += this.$refs.scrollBox.offsetWidth; this.$refs.scrollBox.scrollLeft += this.$refs.scrollBox.offsetWidth;
}, },
}, },

@ -175,9 +175,8 @@ export default {
console.log(this.zzradio); console.log(this.zzradio);
getdyTreeListJoggle({ type: this.zzradio }) getdyTreeListJoggle({ type: this.zzradio })
.then((res) => { .then((res) => {
console.log(res);
this.lineTreeData = res.data.list; this.lineTreeData = res.data.list;
console.log(this.lineTreeData);
this.onlineNum = res.data.onlineNum; this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum; this.totalNum = res.data.totalNum;
this.currentData = JSON.parse(localStorage.getItem("currentData")); this.currentData = JSON.parse(localStorage.getItem("currentData"));
@ -187,11 +186,9 @@ export default {
this.currentData !== null && this.currentData !== null &&
Object.keys(this.currentData).length !== 0 Object.keys(this.currentData).length !== 0
) { ) {
console.log("aaaa");
this.currentNodekey = this.currentData.id; this.currentNodekey = this.currentData.id;
this.handleNodeClick(this.currentData); this.handleNodeClick(this.currentData);
} else { } else {
console.log("aaaa");
this.currentData = this.lineTreeData[0]; // this.currentData = this.lineTreeData[0]; //
this.currentNodekey = this.lineTreeData[0].id; // this.currentNodekey = this.lineTreeData[0].id; //
this.handleNodeClick(this.currentData); this.handleNodeClick(this.currentData);
@ -208,7 +205,6 @@ export default {
//treenode //treenode
handleNodeClick(data) { handleNodeClick(data) {
console.log(data);
this.currentData = data; this.currentData = data;
// this.scrollView(); // this.scrollView();
this.$store.commit("currentData", this.currentData); //currentDatavuex this.$store.commit("currentData", this.currentData); //currentDatavuex

Loading…
Cancel
Save