|
@ -524,25 +524,32 @@ |
|
|
function handleSiteChange(id) { |
|
|
function handleSiteChange(id) { |
|
|
cameraForm.value.siteId = id; |
|
|
cameraForm.value.siteId = id; |
|
|
} |
|
|
} |
|
|
|
|
|
// 站点列表 |
|
|
function changeSiteArr(id) { |
|
|
function changeSiteArr(id) { |
|
|
let lineLen = gData.value.length; |
|
|
let lineLen = gData.value.length; |
|
|
siteArr.value = []; |
|
|
siteArr.value = []; |
|
|
for (let i = 0; i < lineLen; i++) { |
|
|
for (let i = 0; i < lineLen; i++) { |
|
|
let lineData: any = gData.value[i]; |
|
|
for (let j = 0; j < gData.value[i].children?.length; j++) { |
|
|
if (gData.value[i].id === id) { |
|
|
// 单个防区信息 |
|
|
if (lineData.children !== null && lineData.children.length > 0) { |
|
|
let lineData: any = gData.value[i].children[j]; |
|
|
let siteTempArr = lineData.children; |
|
|
if (gData.value[i].children[j].id === id) { |
|
|
for (let j = 0; j < siteTempArr.length; j++) { |
|
|
if (lineData.children !== null && lineData.children.length > 0) { |
|
|
let siteData = siteTempArr[j]; |
|
|
let siteTempArr = lineData.children; |
|
|
siteArr.value.push({ id: siteData.id, name: siteData.name }); |
|
|
for (let k = 0; k < siteTempArr.length; k++) { |
|
|
|
|
|
// 单个站点信息 |
|
|
|
|
|
let siteData = siteTempArr[k]; |
|
|
|
|
|
siteArr.value.push({ id: siteData.id, name: siteData.name }); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
siteArr.value.push({ id: '', name: '' }); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
siteArr.value.push({ id: '', name: '' }); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cameraForm.value.siteId = siteArr.value[0].id; |
|
|
cameraForm.value.siteId = siteArr.value[0].id; |
|
|
cameraForm.value.siteName = siteArr.value[0].name; |
|
|
cameraForm.value.siteName = siteArr.value[0].name; |
|
|
|
|
|
console.log(cameraForm.value); |
|
|
siteNameTemp.value = cameraForm.value.siteName; //改变线路,默认回显该线路的第一个站点 |
|
|
siteNameTemp.value = cameraForm.value.siteName; //改变线路,默认回显该线路的第一个站点 |
|
|
} |
|
|
} |
|
|
// 新增相机 |
|
|
// 新增相机 |
|
@ -857,8 +864,10 @@ |
|
|
function initLineArr() { |
|
|
function initLineArr() { |
|
|
let lineLen = gData.value.length; |
|
|
let lineLen = gData.value.length; |
|
|
for (let i = 0; i < lineLen; i++) { |
|
|
for (let i = 0; i < lineLen; i++) { |
|
|
let lineData = gData.value[i]; |
|
|
for (let j = 0; j < gData.value[i].children?.length; j++) { |
|
|
lineArr.value.push({ id: lineData.id, name: lineData.name }); |
|
|
let lineData = gData.value[i].children[j]; |
|
|
|
|
|
lineArr.value.push({ id: lineData.id, name: lineData.name }); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 取消编辑/新增 |
|
|
// 取消编辑/新增 |
|
|