|
|
@@ -133,18 +133,49 @@ async function handleSubmit() { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
watch( |
|
|
|
() => visibleDormitory.value, |
|
|
|
newVal => |
|
|
|
nextTick(() => { |
|
|
|
if (newVal) { |
|
|
|
getCreamaList(); |
|
|
|
} |
|
|
|
}), |
|
|
|
{ deep: true, immediate: true } |
|
|
|
); |
|
|
|
/** 关闭表单*/ |
|
|
|
function onClose() { |
|
|
|
visibleDormitory.value = false; |
|
|
|
getCreamaList(); |
|
|
|
// getCreamaList(); |
|
|
|
} |
|
|
|
onMounted(() => { |
|
|
|
getCreamaList(); |
|
|
|
}); |
|
|
|
const getCreamaList = () => { |
|
|
|
userManageDormitoryApi.getBuildCameraList().then((res: any) => { |
|
|
|
console.log(sysDormitoryProps.record, 89); |
|
|
|
|
|
|
|
creamaData.value = res.data; |
|
|
|
let dormitoryData = sysDormitoryProps.record; |
|
|
|
let insObj = reactive({ |
|
|
|
sensorId: "", |
|
|
|
sensorName: "" |
|
|
|
}); |
|
|
|
let outObj = reactive({ |
|
|
|
sensorId: "", |
|
|
|
sensorName: "" |
|
|
|
}); |
|
|
|
if (dormitoryData.insCameraId) { |
|
|
|
insObj.sensorId = dormitoryData.insCameraId; |
|
|
|
insObj.sensorName = dormitoryData.insCameraName; |
|
|
|
creamaData.value.push(insObj); |
|
|
|
} |
|
|
|
if (dormitoryData.outCameraId && dormitoryData.insCameraId != dormitoryData.outCameraId) { |
|
|
|
outObj.sensorId = dormitoryData.outCameraId; |
|
|
|
outObj.sensorName = dormitoryData.outCameraName; |
|
|
|
creamaData.value.push(outObj); |
|
|
|
} |
|
|
|
console.log(creamaData.value); |
|
|
|
}); |
|
|
|
}; |
|
|
|
// 暴露给父组件的方法 |
|
|
|