fix config notice display
This commit is contained in:
@@ -717,7 +717,7 @@ document.querySelector("#delete-line").addEventListener("click", async () => {
|
||||
if (!company || !line) return showError(new Error("请先选择公司和产线"));
|
||||
const confirmation = await requestModelName({
|
||||
title: "确认删除产线",
|
||||
message: `删除产线 ${line.name} 后将清理关联业务数据。请输入完整 deviceId 以确认。`,
|
||||
message: `删除产线 ${line.name} 后将删除该产线关联的模型、辨识数据、容积配置、通知与许可证记录(已撤销)。请输入完整 deviceId 以确认。`,
|
||||
value: "",
|
||||
confirmLabel: "删除产线",
|
||||
danger: true,
|
||||
@@ -744,7 +744,7 @@ document.querySelector("#delete-company").addEventListener("click", async () =>
|
||||
if (!company) return showError(new Error("请先选择公司"));
|
||||
const confirmation = await requestModelName({
|
||||
title: "确认删除公司",
|
||||
message: `删除公司 ${company.name} 前必须先删除其产线与许可证。请输入公司编码以确认。`,
|
||||
message: `删除公司 ${company.name} 会级联删除其下所有产线及关联模型、辨识数据、容积配置、通知与许可证记录(有效许可证会阻止删除)。请输入公司编码以确认。`,
|
||||
value: "",
|
||||
confirmLabel: "删除公司",
|
||||
danger: true,
|
||||
@@ -1151,14 +1151,24 @@ function renderNotifications() {
|
||||
}
|
||||
|
||||
async function acknowledgeNotification(notification) {
|
||||
const result = await runBusy("正在确认提醒", () => window.reinloop.acknowledgeNotification({
|
||||
deviceId: notification.deviceId,
|
||||
notificationId: notification.notificationId,
|
||||
credentials: credentials()
|
||||
}));
|
||||
if (!result) return false;
|
||||
setStatus("正在确认提醒", "busy");
|
||||
try {
|
||||
await window.reinloop.acknowledgeNotification({
|
||||
deviceId: notification.deviceId,
|
||||
notificationId: notification.notificationId,
|
||||
credentials: credentials()
|
||||
});
|
||||
} catch (error) {
|
||||
const message = String(error?.message || error)
|
||||
.replace(/^Error invoking remote method '[^']+': Error: /, "");
|
||||
if (!message.includes("Panel 通知不存在")) {
|
||||
showError(error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
state.notifications = state.notifications.filter((item) => item.notificationId !== notification.notificationId);
|
||||
renderNotifications();
|
||||
setStatus("提醒已关闭", "success");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user