主动拍照

menu1.0
fanluyan 9 months ago
parent 75a7740ab4
commit 0b954ced79

@ -277,8 +277,12 @@ export default {
},
mounted() {
console.log("我是图片列表", this.terminalPhoto);
this.changeBigPic(this.terminalPhoto[0], 0);
// console.log(this.terminalPhoto[0].path);
if (this.terminalPhoto) {
this.changeBigPic(this.terminalPhoto[0], 0);
//
}
//console.log(this.terminalPhoto[0]);
},
watch: {
terminalPhoto: {
@ -421,56 +425,62 @@ export default {
},
//
changeBigPic(data, i) {
this.picDataAlarm = data;
this.srcList = [];
this.localPoints = [];
this.activeSmall = i;
this.mediaType = data.mediaType;
this.currentPicPath = data.path;
this.srcList.push(data.path);
if (data.width != undefined) {
this.radioPx = data.width + "x" + data.height;
} else {
this.radioPx = "";
}
if (data.fileSize !== undefined) {
const sizeInBytes = data.fileSize;
const sizeInMB = sizeInBytes / (1024 * 1024);
const sizeInKB = sizeInBytes / 1024;
if (data) {
console.log("aaaaaaaaaaaaaaaaaaaaa", data.mediaType);
this.mediaType = data.mediaType !== null ? data.mediaType : 0;
if (sizeInMB >= 1) {
this.fileSize = `${sizeInMB.toFixed(2)}M`; // 1MBMB
this.picDataAlarm = data;
this.srcList = [];
this.localPoints = [];
this.activeSmall = i;
this.currentPicPath = data.path;
this.srcList.push(data.path);
if (data.width != undefined) {
this.radioPx = data.width + "x" + data.height;
} else {
this.fileSize = `${sizeInKB.toFixed(0)}K`; // 1MBKB
this.radioPx = "";
}
} else {
this.fileSize = ""; // data.fileSize
}
if (data.fileSize !== undefined) {
const sizeInBytes = data.fileSize;
const sizeInMB = sizeInBytes / (1024 * 1024);
const sizeInKB = sizeInBytes / 1024;
// console.log(data.channelId);
if (data.channelId) {
this.getPointList(data);
}
const items = this.$refs.scrollBox.querySelectorAll(".smallPic");
const selectedItem = items[i];
const selectedItemLeft = selectedItem.offsetLeft;
const scrollContainer = this.$refs.scrollBox;
const scrollContainerWidth = scrollContainer.offsetWidth;
const selectedItemWidth = selectedItem.offsetWidth;
if (sizeInMB >= 1) {
this.fileSize = `${sizeInMB.toFixed(2)}M`; // 1MBMB
} else {
this.fileSize = `${sizeInKB.toFixed(0)}K`; // 1MBKB
}
} else {
this.fileSize = ""; // data.fileSize
}
// console.log(data.channelId);
if (data.channelId) {
this.getPointList(data);
}
const items = this.$refs.scrollBox.querySelectorAll(".smallPic");
const selectedItem = items[i];
const selectedItemLeft = selectedItem.offsetLeft;
const scrollContainer = this.$refs.scrollBox;
const scrollContainerWidth = scrollContainer.offsetWidth;
const selectedItemWidth = selectedItem.offsetWidth;
//
let scrollDistance =
selectedItemLeft - (scrollContainerWidth - selectedItemWidth) / 2;
if (scrollDistance < 0) {
scrollDistance = 0;
} else if (
scrollDistance + scrollContainerWidth >
scrollContainer.scrollWidth
) {
scrollDistance = scrollContainer.scrollWidth - scrollContainerWidth;
//
let scrollDistance =
selectedItemLeft - (scrollContainerWidth - selectedItemWidth) / 2;
if (scrollDistance < 0) {
scrollDistance = 0;
} else if (
scrollDistance + scrollContainerWidth >
scrollContainer.scrollWidth
) {
scrollDistance = scrollContainer.scrollWidth - scrollContainerWidth;
}
// scrollLeft
scrollContainer.scrollLeft = scrollDistance;
}
// scrollLeft
scrollContainer.scrollLeft = scrollDistance;
},
loadImage() {
console.log("loading");

@ -111,6 +111,7 @@ export default {
setTermFn(val) {
setTermCamera({
termId: this.termId,
channelId: this.pzchannelId,
list: val,
})
.then((res) => {
@ -239,7 +240,7 @@ export default {
}).then((res) => {
console.log(res.data);
console.log(this.picNum);
console.log(this.pzchannelId)
console.log(this.pzchannelId);
if (res.data == true && this.picNum < 10) {
// console.log(this.$parent.$parent);
this.$parent.$parent.getPhotoList(
@ -266,15 +267,15 @@ export default {
});
},
clearFn() {
console.log("我要取消了轮巡")
console.log("我要取消了轮巡");
clearInterval(this.statusTimer);
this.statusTimer = null;
this.statusNum = 0;
this.picLoading = false;
console.log("我要取消了轮巡1111111111111111111111111111111")
console.log("我要取消了轮巡1111111111111111111111111111111");
clearInterval(this.picPimer);
this.picPimer = null;
this.picNum = 0;
this.picPimer = null;
this.picNum = 0;
},
},
destroyed() {

Loading…
Cancel
Save