一键误报没选择给提示

This commit is contained in:
joylink_zhaoerwei 2023-11-01 13:39:08 +08:00
parent 9a5bc59184
commit 9edfdfa935

View File

@ -369,19 +369,23 @@ function updateSelect() {
function batchHandle() {
lineNetStore.closeAllAlarmInfoDialog = true;
const params = selected.value.map((item) => item.id);
$q.dialog({
message: `已选择${params.length}条数据,确定一键误报吗?`,
cancel: true,
}).onOk(async () => {
try {
await recordFailAlarmInfoById(params).then(() => {
tableRef.value.requestServerInteraction();
selected.value = [];
});
} catch (err) {
errorNotify('一键误报失败:', err);
}
});
if (!params.length) {
errorNotify('没有选择需要一键误报的数据', '');
} else {
$q.dialog({
message: `已选择${params.length}条数据,确定一键误报吗?`,
cancel: true,
}).onOk(async () => {
try {
await recordFailAlarmInfoById(params).then(() => {
tableRef.value.requestServerInteraction();
selected.value = [];
});
} catch (err) {
errorNotify('一键误报失败:', err);
}
});
}
}
const searchDialog = ref(false);