|
|
|
|
@ -219,16 +219,14 @@
|
|
|
|
|
<el-form-item >
|
|
|
|
|
<el-button type="primary" class="queryBtn" @click="queryCamera">查询</el-button>
|
|
|
|
|
<el-button type="warning" icon="Refresh" @click="refreshCamera(currentNvrDetail)" plain :loading="refreshLoading">同步通道</el-button>
|
|
|
|
|
<el-button type="danger" icon="Delete" @click="handleBatchDel" plain :loading="deleteBatchLoading">批量删除</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- 通道列表 -->
|
|
|
|
|
<el-table :data="channelData"
|
|
|
|
|
height="350"
|
|
|
|
|
style="width: 100%" @selection-change="handleBatchChannel"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
:row-key="(row: any)=>row.id"
|
|
|
|
|
size="small" >
|
|
|
|
|
<el-table-column type="selection" width="20"/>
|
|
|
|
|
<el-table-column prop="name" label="名称" width="280" align="center"/>
|
|
|
|
|
<el-table-column prop="cameraNo" label="摄像机编号" width="100" align="center"/>
|
|
|
|
|
<el-table-column prop="channelId" label="通道号" width="180" align="center" />
|
|
|
|
|
@ -414,7 +412,6 @@ import {handleAlgTask} from "@/api/modules/monitor/channel";
|
|
|
|
|
import {getAlgorithmTaskByCameraId} from "@/api/modules/monitor/algorithmTask";
|
|
|
|
|
import type {AlgorithmTaskVO, AlgTaskConfigDto} from "@/api/types/edgebox/EdgeBox";
|
|
|
|
|
import DataSync from "@/views/sysmonitortree/sysMonitorTree/components/DataSync.vue";
|
|
|
|
|
import {fa} from "element-plus/es/locale";
|
|
|
|
|
const refreshLoading=ref(false);
|
|
|
|
|
const playLoading = ref(false);
|
|
|
|
|
const filterText = ref('');
|
|
|
|
|
@ -727,7 +724,7 @@ const handleSubmit=async ()=>{
|
|
|
|
|
}else {
|
|
|
|
|
ElMessage.success("修改失败");
|
|
|
|
|
// 重置数据
|
|
|
|
|
ruleFormRef.value.resetFields();
|
|
|
|
|
editCameraDialog.cameraForm={};
|
|
|
|
|
}
|
|
|
|
|
}catch(error)
|
|
|
|
|
{
|
|
|
|
|
@ -740,45 +737,8 @@ const handleEditClose=()=>{
|
|
|
|
|
editCameraDialog.editVisible=false;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const cameraIds=[] as number[];
|
|
|
|
|
const deleteBatchLoading = ref(false);
|
|
|
|
|
// 表格多选点击事件
|
|
|
|
|
const handleBatchChannel=(data: CameraRow[])=>{
|
|
|
|
|
ids.length=0;
|
|
|
|
|
for(let i=0;i<data.length;i++)
|
|
|
|
|
{
|
|
|
|
|
cameraIds.push(data[i].id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 批量删除摄像头
|
|
|
|
|
const handleBatchDel = async () => {
|
|
|
|
|
try {
|
|
|
|
|
if (cameraIds.length === 0) {
|
|
|
|
|
ElMessage.warning('请选择要删除的摄像机');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await ElMessageBox.confirm('确定要删除这些摄像机吗?', '删除确认', {
|
|
|
|
|
confirmButtonText: '确定删除',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
});
|
|
|
|
|
deleteBatchLoading.value = true;
|
|
|
|
|
await removeCameraApi({ ids: cameraIds });
|
|
|
|
|
ElMessage.success('删除成功');
|
|
|
|
|
deleteBatchLoading.value = false;
|
|
|
|
|
await getChannelPage();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// 5. 捕获取消操作或接口报错
|
|
|
|
|
if (error === 'cancel') {
|
|
|
|
|
// 用户点击了取消按钮
|
|
|
|
|
ElMessage.info('已取消删除');
|
|
|
|
|
deleteBatchLoading.value = false;
|
|
|
|
|
} else {
|
|
|
|
|
deleteBatchLoading.value = false;
|
|
|
|
|
console.log(error)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleEditDel = async (data: CameraRow) => {
|
|
|
|
|
try {
|
|
|
|
|
await ElMessageBox.confirm('确定要删除该摄像机吗?', '删除确认', {
|
|
|
|
|
|