Browse Source

feat 更新摄像头设备离线 不调用接口

wangqin
qingzhengli 11 months ago
parent
commit
d0bd1f0d64
  1. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/components/CameraControlDialog.vue
  2. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/index.vue

7
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/components/CameraControlDialog.vue

@ -54,7 +54,8 @@ export default {
}, },
props: { props: {
visible: Boolean, visible: Boolean,
deviceId: String deviceId: String,
dialogData: Object
}, },
data() { data() {
return { return {
@ -103,7 +104,9 @@ export default {
}, },
methods: { methods: {
controlClick: throttle(function (type) { controlClick: throttle(function (type) {
controlCamera(this.deviceId, type) if (this.dialogData.deviceState != "0")
controlCamera(this.deviceId, type)
else this.$message.info("设备离线, 无法操作")
}, 150), }, 150),
async handleSwitcherChange(value, data) { async handleSwitcherChange(value, data) {
let str = data.state ? "关闭" : "开启"; let str = data.state ? "关闭" : "开启";

7
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Camera/index.vue

@ -40,7 +40,7 @@
</div> --> </div> -->
</div> </div>
<CameraControlDialog :deviceId="dialogData.iotDeviceId" v-model="controlDialogVisible" /> <CameraControlDialog :deviceId="dialogData.iotDeviceId" :dialogData="dialogData" v-model="controlDialogVisible" />
</Dialog> </Dialog>
</template> </template>
@ -140,7 +140,10 @@ export default {
}, },
methods: { methods: {
controlClick: throttle(function (type) { controlClick: throttle(function (type) {
controlCamera(this.dialogData.iotDeviceId, type, false); // console.log(this.dialogData, "dialogData")
if (this.dialogData.deviceState != "0")
controlCamera(this.dialogData.iotDeviceId, type, false);
else this.$message.info("设备离线, 无法操作")
}, 150), }, 150),
visibleClose(bool) { visibleClose(bool) {
if (bool) return; if (bool) return;

Loading…
Cancel
Save