摄像头预览之前先判断是否在线

This commit is contained in:
曹磊 2025-11-11 09:48:35 +08:00
parent 2a185ec6c4
commit 474773c966
1 changed files with 19 additions and 8 deletions

View File

@ -65,7 +65,7 @@
<span class="antTitle">画面配置</span>
</span> -->
</p>
</a-card>
</a-col>
<a-col v-if="tableData.total==0" >
@ -102,7 +102,7 @@ import {ref, reactive, createVNode, h, onMounted, watch, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, searchFormSchema } from '../camera.data';
import { list } from '../camera.api';
import {getImageCommon, list} from '../camera.api';
import { useUserStore } from '/@/store/modules/user';
import { useDrawer } from "@/components/Drawer";
import { useRouter } from 'vue-router';
@ -112,7 +112,7 @@ import {ref, reactive, createVNode, h, onMounted, watch, unref} from 'vue';
import { JInput } from '/@/components/Form';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import CameraPictureConfigModal from '/@/views/iot/tplink/camera/components/CameraPictureConfigModal.vue';
const props = defineProps({
data: { type: Object, default: () => ({}) },
@ -156,8 +156,19 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
* 预览
*/
function handlePreview(record: Recordable) {
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
if (record.deviceIndex == null) {
return
}
getImageCommon({
"deviceIndex": record.deviceIndex,
"type": "switch"
}).then(res => {
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
}).catch(res=>{
reload();
});
}
/**
@ -183,7 +194,7 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
cameraPictureConfigModal.value.edit(params);
}
/**
* 左侧树选择后触发
@ -207,7 +218,7 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
tableData.value = res;
});
}
/**
* 重置
*/
@ -216,7 +227,7 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
//
reload();
}
onMounted(() => {
watch(