fix(devicePreset): 修改删除预置位接口参数及调用方式

refactor(securitySurveillance): 添加项目ID参数到监控列表请求
style(camera): 注释掉未使用的设备操作按钮代码
This commit is contained in:
tcy
2025-09-24 17:52:51 +08:00
parent 64c538775f
commit b7c716509d
4 changed files with 65 additions and 53 deletions

View File

@ -91,7 +91,7 @@
><el-icon><Plus /></el-icon>新增</el-button
>
</el-col> -->
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button type="success" :disabled="single" @click="handleUpdate(null)"
v-auth="'api/v1/system/ys7Devices/edit'"><el-icon>
<Edit />
@ -102,13 +102,13 @@
v-auth="'api/v1/system/ys7Devices/delete'"><el-icon>
<Delete />
</el-icon>删除</el-button>
</el-col>
</el-col>
<el-col :span="1.5">
<el-button type="warning" :disabled="multiple" @click="onLinkProject(null)"
v-auth="'api/v1/system/ys7Devices/add'"><el-icon>
<Link />
</el-icon>设备分配</el-button>
</el-col>
</el-col>-->
</el-row>
</div>
<el-table v-loading="loading" :data="tableData.data" @selection-change="handleSelectionChange">
@ -245,6 +245,7 @@ const ys7DevicesList = () => {
getMonitoringList({
pageStart: state.tableData.param.pageNum,
pageSize: state.tableData.param.pageSize,
isflow: false
}).then((res: any) => {
let list = res.data.object ?? [];
state.tableData.data = list.map((item) => {
@ -285,40 +286,40 @@ const handleSelectionChange = (selection: any[]) => {
// };
// 删除
const handleDelete = (row?: Ys7DeviceVO) => {
let msg = row ? `此操作将永久删除数据,是否继续?` : '你确定要删除所选数据?';
let id = row ? [row.id] : state.ids;
// const handleDelete = (row?: any) => {
// let msg = row ? `此操作将永久删除数据,是否继续?` : '你确定要删除所选数据?';
// let id = row ? [row.id] : state.ids;
if (id.length === 0) {
ElMessage.error('请选择要删除的数据。');
return;
}
// if (id.length === 0) {
// ElMessage.error('请选择要删除的数据。');
// return;
// }
ElMessageBox.confirm(msg, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
delYs7Device(id).then(() => {
ElMessage.success('删除成功');
ys7DevicesList();
});
})
.catch(() => { });
};
// ElMessageBox.confirm(msg, '提示', {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// type: 'warning'
// })
// .then(() => {
// delYs7Device(id).then(() => {
// ElMessage.success('删除成功');
// ys7DevicesList();
// });
// })
// .catch(() => { });
// };
// 绑定项目
const onLinkProject = (row?: Ys7DeviceVO) => {
let serials = row ? [row.deviceSerial] : state.ids;
// const onLinkProject = (row?: Ys7DeviceVO) => {
// let serials = row ? [row.deviceSerial] : state.ids;
if (serials.length === 0) {
ElMessage.error('请选择要绑定项目的设备');
return;
}
let info = { serials, row };
bindProRef.value.openDialog(toRaw(info));
};
// if (serials.length === 0) {
// ElMessage.error('请选择要绑定项目的设备');
// return;
// }
// let info = { serials, row };
// bindProRef.value.openDialog(toRaw(info));
// };
// 添加预置位
const addPreset = (row: any) => {
@ -326,20 +327,20 @@ const addPreset = (row: any) => {
};
// 开关加密
const encryptChange = (row: Ys7DeviceVO | any) => {
row.enctyptLoading = true;
// const action = row.videoEncrypted === 0 ? 1 : 0;
console.log(row.videoEncrypted);
// const encryptChange = (row: any) => {
// row.enctyptLoading = true;
// // const action = row.videoEncrypted === 0 ? 1 : 0;
// console.log(row.videoEncrypted);
toggleEncrypt({ videoEncrypted: row.videoEncrypted, id: row.id })
.then(() => {
proxy?.$modal.msgSuccess(row.videoEncrypted === 0 ? '关闭成功' : '开启成功');
})
.finally(() => {
row.enctyptLoading = false;
ys7DevicesList();
});
};
// toggleEncrypt({ videoEncrypted: row.videoEncrypted, id: row.id })
// .then(() => {
// proxy?.$modal.msgSuccess(row.videoEncrypted === 0 ? '关闭成功' : '开启成功');
// })
// .finally(() => {
// row.enctyptLoading = false;
// ys7DevicesList();
// });
// };
//监听项目id刷新数据
// const listeningProject = watch(