cameraDetailInfo.deviceCameras[scope.
i
n
d
e
x
]
.
s
h
e
l
v
e
s
S
n
∣
∣
d
e
v
i
c
e
C
a
m
e
r
a
s
[
s
c
o
p
e
.
index] .shelvesSn || deviceCameras[scope.
index].shelvesSn∣∣deviceCameras[scope.index].cameraLevel !==
cameraDetailInfo.deviceCameras[scope.$index].cameraLevel
? true
: false)
"
script>
import { get } from “http”;
import { runInThisContext } from “vm”;
import Vue from “vue”;
export default {
props: {
visible: Boolean,
warehouseSn: String,
cameraDetailInfo:{
type: Object,
default:{}
}
},
data() {
return {
shelvesList: [], //货架编号
levelList: [],
deviceCameras: []
};
},
watch: {
cameraDetailInfo: {
handler(newVal, oldVal) {
if (newVal !== null && oldVal !== null) {
this.deviceCameras = JSON.parse(
JSON.stringify(this.cameraDetailInfo.deviceCameras)
)
this.deviceCameras.map(item =>{
item.levelList=[]
this.shelvesList.map(shelve=>{
if(shelve.shelvesSn === item.shelvesSn){
item.levelList = shelve.levels
}
})
})
}
}
}
},
computed: {
// deviceCameras() {
// return this.cameraDetailInfo === null
// ? []
// : this.cameraDetailInfo.deviceCameras;
// },
‘deviceCameras[scope.$index].shelvesSn’(){
return this.allowProp = true
}
},
created() {
this.getSelectShelfList();
},
methods: {
//获取下拉列表
getSelectShelfList() {
this.$api.shelf
.shelvesSelectList({ houseSn: this.warehouseSn })
.then(({ code, data }) => {
if (code === 0) {
this.shelvesList = data;
this.shelvesList.unshift({
shelvesSn: “”,
levels: “”
});
}
});
},
changeShelvesSn(val, index) {
if (val === “”) {
this.deviceCameras[index].cameraLevel = “”;
// this.levelList[index] = “”;
return;
}
//shelvesList 它是里面包含了shelvesSn 和 levels的数组
//selectedShelf:选中货架编号
let selectedShelf = this.shelvesList.filter(
item => item.shelvesSn === val
);
if (selectedShelf && selectedShelf.length > 0) {
//货架层数组
// this.levelList[index] =
// (selectedShelf.length > 0 && selectedShelf[0].levels) || [];
//默认层
this.deviceCameras[index].levelList = selectedShelf[0].levels
this.deviceCameras[index].cameraLevel = this.levelList[0] > 0 ? 1 : “”;
}
},
refreshCamera(cameraSn, imgDeviceSn, cameraLevel, shelvesSn) {
this.KaTeX parse error: Expected '}', got 'EOF' at end of input: … === 0) { this.message({
message: this.KaTeX parse error: Expected 'EOF', got '}' at position 42: …ype: "success" }̲); } else { ret…api.device
.deleteCameraDetail({ cameraSn: cameraSn, imageSn: imgDeviceSn })
.then(({ code, msg }) => {
if (code === 0) {
this.KaTeX parse error: Expected 'EOF', got '}' at position 128: …直接用index的方式就好了 }̲ }); }, //关闭 ha…parent.handleCloseCameraDialog();
},
//关闭按钮
handleOk() {
this.$parent.handleCloseCameraDialog();
}
}
};
我的难点在于
不知道将对应的层数怎样将它展示出来
这个后端给的结构是这样的
思路:定义一个选中的变量,然后里面从this.shelvesList.filter过滤掉,里面的shelvesSn 就是change里面的val,然后让 v-for里面的this.deviceCameras[index].levelList = selectedShelf[0].levels
意思就是绑定的=选中的层数
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数同学面临毕业设计项目选题时,很多人都会感到无从下手,尤其是对于计算机专业的学生来说,选择一个合适的题目尤为重要。因为毕业设计不仅是我们在大学四年学习的一个总结,更是展示自己能力的重要机会。
因此收集整理了一份《2024年计算机毕业设计项目大全》,初衷也很简单,就是希望能够帮助提高效率,同时减轻大家的负担。
既有Java、Web、PHP、也有C、小程序、Python等项目供你选择,真正体系化!
由于项目比较多,这里只是将部分目录截图出来,每个节点里面都包含素材文档、项目源码、讲解视频
如果你觉得这些内容对你有帮助,可以添加VX:vip1024c (备注项目大全获取)
12515875436)]
既有Java、Web、PHP、也有C、小程序、Python等项目供你选择,真正体系化!
由于项目比较多,这里只是将部分目录截图出来,每个节点里面都包含素材文档、项目源码、讲解视频
如果你觉得这些内容对你有帮助,可以添加VX:vip1024c (备注项目大全获取)
[外链图片转存中…(img-CZjmcWze-1712515875436)]