|
|
|
|
@ -169,6 +169,7 @@ export default { |
|
|
|
|
watch: { |
|
|
|
|
detailForm(newVal, oldVal) { |
|
|
|
|
if (JSON.stringify(newVal) != '{}') { |
|
|
|
|
console.log('JSON.stringify(newVal)---------------------->',JSON.stringify(newVal)) |
|
|
|
|
this.deviceList = [] |
|
|
|
|
this.detailForm = newVal |
|
|
|
|
this.addForm = { |
|
|
|
|
@ -192,7 +193,7 @@ export default { |
|
|
|
|
this.drawfiles = [] |
|
|
|
|
this.filesList = this.detailForm.attaches |
|
|
|
|
this.imgList = this.detailForm.attaches |
|
|
|
|
this.detailForm.draws.map(item => { |
|
|
|
|
this.detailForm.draws && this.detailForm.draws.length != 0 && this.detailForm.draws.map(item => { |
|
|
|
|
this.drawList.push({ |
|
|
|
|
name: item.name, |
|
|
|
|
url: item.link |
|
|
|
|
@ -245,9 +246,9 @@ export default { |
|
|
|
|
this.floorArr = [] |
|
|
|
|
this.roomArr = [] |
|
|
|
|
this.tableData = this.getDeepCode(this.detailForm.details, []) |
|
|
|
|
this.changeUnit(this.detailForm.deptId) |
|
|
|
|
this.detailForm.deptId && this.changeUnit(this.detailForm.deptId) |
|
|
|
|
|
|
|
|
|
this.detailForm.attaches.map(item => { |
|
|
|
|
this.detailForm.attaches && this.detailForm.attaches.length != 0 && this.detailForm.attaches.map(item => { |
|
|
|
|
this.imgList.push({ |
|
|
|
|
name: item.name, |
|
|
|
|
url: item.link |
|
|
|
|
@ -257,7 +258,7 @@ export default { |
|
|
|
|
url: item.link |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.detailForm.draws.map(item => { |
|
|
|
|
this.detailForm.draws && this.detailForm.draws.length != 0 && this.detailForm.draws.map(item => { |
|
|
|
|
this.drawList.push({ |
|
|
|
|
name: item.name, |
|
|
|
|
url: item.link |
|
|
|
|
@ -277,7 +278,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getDeepCode(data, arr) { |
|
|
|
|
data.map(item => { |
|
|
|
|
data && data.length != 0 && data.map(item => { |
|
|
|
|
if (item.details.length != 0) { |
|
|
|
|
this.getDeepCode(item.details, arr) |
|
|
|
|
} else { |
|
|
|
|
@ -456,17 +457,14 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 切换实验室 |
|
|
|
|
changeUnit(val) { |
|
|
|
|
console.log('val===========>', val) |
|
|
|
|
console.log('unitData===============>', this.unitData) |
|
|
|
|
this.labId = val |
|
|
|
|
if (this.title == '新建') { |
|
|
|
|
this.addForm.unitName = this.unitData.find(item => item.id == val).title |
|
|
|
|
this.addForm.unitName = this.unitData.find(item => item.id == val) ? this.unitData.find(item => item.id == val).title : '' |
|
|
|
|
this.deviceList.map(item => { |
|
|
|
|
item.disabled = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
getDeepData({ parentId: val }).then(res => { |
|
|
|
|
console.log('res ------------------->', res) |
|
|
|
|
this.floorArr = res.data.data |
|
|
|
|
this.activeFloor = res.data.data.length > 0 ? res.data.data[0].id : '' |
|
|
|
|
getDeepData({ parentId: this.activeFloor }).then(res => { |
|
|
|
|
@ -476,13 +474,11 @@ export default { |
|
|
|
|
if (JSON.stringify(this.detailForm) != '{}') { |
|
|
|
|
console.log(this.activeFloor, this.activeRoom) |
|
|
|
|
this.addForm.tableData = this.tableData.filter(item => item.floorId == this.activeFloor && item.deptId == this.activeRoom) |
|
|
|
|
console.log('addForm==========>', this.addForm.tableData) |
|
|
|
|
let arr1 = this.deviceList.filter(item1 => |
|
|
|
|
this.addForm.tableData.some(item2 => |
|
|
|
|
item1.id == item2.deviceId |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
console.log('arr1==============>', arr1) |
|
|
|
|
this.deviceList.map(item1 => { |
|
|
|
|
item1.disabled = false |
|
|
|
|
arr1.map(item2 => { |
|
|
|
|
|