Merge branch 'bthg-dev' of http://192.168.34.160:8023/admin/zhgdyun into bthg-dev
This commit is contained in:
commit
aab8d920aa
@ -1000,7 +1000,7 @@ export default {
|
|||||||
propsList: {
|
propsList: {
|
||||||
value: 'itemId',
|
value: 'itemId',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
children: 'list',
|
children: 'children',
|
||||||
// checkStrictly: true,
|
// checkStrictly: true,
|
||||||
emitPath: false
|
emitPath: false
|
||||||
},
|
},
|
||||||
@ -2182,6 +2182,21 @@ export default {
|
|||||||
pieChart.resize();
|
pieChart.resize();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
recursion(array){
|
||||||
|
// 递归 筛选出节点的id
|
||||||
|
return array.map(item => {
|
||||||
|
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
|
||||||
|
item.children = this.recursion(item.children);
|
||||||
|
return {
|
||||||
|
...item
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
children: null,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
//获取摄像机列表
|
//获取摄像机列表
|
||||||
getVideoItemList() {
|
getVideoItemList() {
|
||||||
let data = {
|
let data = {
|
||||||
@ -2211,17 +2226,19 @@ export default {
|
|||||||
console.log('摄像头列表', res);
|
console.log('摄像头列表', res);
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.videoList = res.result.videoList
|
this.videoList = res.result.videoList
|
||||||
.filter(item => item.list.length > 0)
|
.filter(item => item.children.length > 0)
|
||||||
.map(item => {
|
.map(item => {
|
||||||
|
item.children = this.recursion(item.children);
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
itemId: item.id
|
itemId: item.id
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
console.log(2112333, this.videoList)
|
||||||
this.videoList.some(item => {
|
this.videoList.some(item => {
|
||||||
if (item.list.length > 0) {
|
if (item.children.length > 0) {
|
||||||
this.videoId = item.list[0].itemId;
|
this.videoId = item.children[0].itemId;
|
||||||
this.getVideo(item.list[0].itemId);
|
this.getVideo(item.children[0].itemId);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
this.videoId = '';
|
this.videoId = '';
|
||||||
@ -2231,14 +2248,35 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
fuzzySearchTree(treeData, keyword, key = "name", result = []) {
|
||||||
|
for (const node of treeData) {
|
||||||
|
const newNode = { ...node };
|
||||||
|
// 检查当前节点是否匹配关键词
|
||||||
|
if (node[key] && node[key].includes(keyword)) {
|
||||||
|
console.log(777777777777, newNode);
|
||||||
|
result.push(newNode);
|
||||||
|
} else if (node.children && node.children.length > 0) {
|
||||||
|
// 递归查询子节点
|
||||||
|
const childrenResult = this.fuzzySearchTree(node.children, keyword, key, result);
|
||||||
|
// if (childrenResult.length > 0) {
|
||||||
|
// newNode.children = childrenResult;
|
||||||
|
// // result.push(newNode);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
//选择的视频
|
//选择的视频
|
||||||
getVideo(val) {
|
getVideo(val) {
|
||||||
this.videoList.forEach(item => {
|
const searchResult = this.fuzzySearchTree(this.videoList, val, "itemId");
|
||||||
const find = item.list.find(ele => ele.itemId == val);
|
console.log(88888, searchResult);
|
||||||
if (find) {
|
this.selectList = searchResult;
|
||||||
this.selectList = [find];
|
// this.videoList.forEach(item => {
|
||||||
}
|
// const find = item.children.find(ele => ele.itemId == val);
|
||||||
});
|
// if (find) {
|
||||||
|
// this.selectList = [find];
|
||||||
|
// }
|
||||||
|
// });
|
||||||
// for (let i = 0; i < this.videoList.length; i++) {
|
// for (let i = 0; i < this.videoList.length; i++) {
|
||||||
// if (val == this.videoList[i].itemId) {
|
// if (val == this.videoList[i].itemId) {
|
||||||
// this.selectList = [this.videoList[i]];
|
// this.selectList = [this.videoList[i]];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user