删除资源时添加对话框确认
This commit is contained in:
parent
cf98b9ba08
commit
f645d98b02
|
@ -217,28 +217,8 @@ export default defineComponent({
|
|||
loga(a: any) {
|
||||
console.log(a);
|
||||
},
|
||||
async deleteItem(
|
||||
evt: PointerEvent | null,
|
||||
is_group: boolean,
|
||||
uuid: string
|
||||
) {
|
||||
let success = false;
|
||||
if (is_group) {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteModeGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
} else {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteMode(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
}
|
||||
|
||||
deleteItem(evt: PointerEvent | null, is_group: boolean, uuid: string) {
|
||||
const show_tooltip = (success: boolean) => {
|
||||
$q.notify({
|
||||
color: success ? "positive" : "negative",
|
||||
icon: success ? "done" : "warning",
|
||||
|
@ -247,6 +227,59 @@ export default defineComponent({
|
|||
position: "top",
|
||||
timeout: 1500,
|
||||
});
|
||||
};
|
||||
let success = false;
|
||||
if (is_group) {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t(
|
||||
"delete group should be delete all child! do you want to delete this group?"
|
||||
),
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteModeGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
} else {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t("do you want to delete the item") + "?",
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteMode(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
}
|
||||
},
|
||||
callMode(item: ModeEntity) {
|
||||
GlobalData.getInstance().getCurrentClient()?.callMode(item.uuid);
|
||||
|
|
|
@ -224,28 +224,8 @@ export default defineComponent({
|
|||
loga(a: any) {
|
||||
console.log(a);
|
||||
},
|
||||
async deleteItem(
|
||||
evt: MouseEvent | null,
|
||||
is_group: boolean,
|
||||
uuid: string
|
||||
) {
|
||||
let success = false;
|
||||
if (is_group) {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePlanGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
} else {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePlan(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
}
|
||||
|
||||
deleteItem(evt: MouseEvent | null, is_group: boolean, uuid: string) {
|
||||
const show_tooltip = (success: boolean) => {
|
||||
$q.notify({
|
||||
color: success ? "positive" : "negative",
|
||||
icon: success ? "done" : "warning",
|
||||
|
@ -254,6 +234,60 @@ export default defineComponent({
|
|||
position: "top",
|
||||
timeout: 1500,
|
||||
});
|
||||
};
|
||||
if (is_group) {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t(
|
||||
"delete group should be delete all child! do you want to delete this group?"
|
||||
),
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let success = false;
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePlanGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
} else {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t("do you want to delete the item") + "?",
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let success = false;
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePlan(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
}
|
||||
},
|
||||
runPlan(item: PlanEntity) {
|
||||
if (!$store.state.power_state) {
|
||||
|
|
|
@ -177,27 +177,8 @@ export default defineComponent({
|
|||
loga(a: any) {
|
||||
console.log(a);
|
||||
},
|
||||
async deleteItem(
|
||||
evt: PointerEvent | null,
|
||||
is_group: boolean,
|
||||
uuid: string
|
||||
) {
|
||||
let success = false;
|
||||
if (is_group) {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePollingGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
} else {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePolling(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
}
|
||||
deleteItem(evt: PointerEvent | null, is_group: boolean, uuid: string) {
|
||||
const show_tooltip = (success: boolean) => {
|
||||
$q.notify({
|
||||
color: success ? "positive" : "negative",
|
||||
icon: success ? "done" : "warning",
|
||||
|
@ -206,6 +187,62 @@ export default defineComponent({
|
|||
position: "top",
|
||||
timeout: 1500,
|
||||
});
|
||||
};
|
||||
if (is_group) {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t(
|
||||
"delete group should be delete all child! do you want to delete this group?"
|
||||
),
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let success = false;
|
||||
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePollingGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
} else {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t("do you want to delete the item") + "?",
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let success = false;
|
||||
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deletePolling(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
}
|
||||
},
|
||||
onDragStart(e: DragEvent, node: PollingTreeItemEntity) {
|
||||
e.dataTransfer?.setData("uuid", node.uuid);
|
||||
|
|
|
@ -318,28 +318,8 @@ export default defineComponent({
|
|||
getItemIcon(item_type: string) {
|
||||
return Common.getSignalSourceIcon(item_type);
|
||||
},
|
||||
async deleteItem(
|
||||
evt: PointerEvent | null,
|
||||
is_group: boolean,
|
||||
uuid: string
|
||||
) {
|
||||
let success = false;
|
||||
if (is_group) {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteSignalSourceGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
} else {
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteSignalSource(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
}
|
||||
|
||||
deleteItem(evt: PointerEvent | null, is_group: boolean, uuid: string) {
|
||||
const show_tooltip = (success: boolean) => {
|
||||
$q.notify({
|
||||
color: success ? "positive" : "negative",
|
||||
icon: success ? "done" : "warning",
|
||||
|
@ -348,12 +328,64 @@ export default defineComponent({
|
|||
position: "top",
|
||||
timeout: 1500,
|
||||
});
|
||||
};
|
||||
if (is_group) {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t(
|
||||
"delete group should be delete all child! do you want to delete this group?"
|
||||
),
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
updateContextMenu() {
|
||||
lossy_pic.value =
|
||||
(GlobalData.getInstance().applicationConfig?.hdmi_in_decode_type_1 ??
|
||||
"NV12") == "NV12";
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let success = false;
|
||||
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteSignalSourceGroup(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
} else {
|
||||
$q.dialog({
|
||||
title: $t.t("Confirm"),
|
||||
message: $t.t("do you want to delete the item") + "?",
|
||||
ok: {
|
||||
label: $t.t("ok"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
cancel: {
|
||||
label: $t.t("cancel"),
|
||||
noCaps: true,
|
||||
flat: true,
|
||||
},
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
let success = false;
|
||||
|
||||
let response = await GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.deleteSignalSource(uuid);
|
||||
if (response) {
|
||||
success = response.success;
|
||||
}
|
||||
show_tooltip(success);
|
||||
});
|
||||
}
|
||||
},
|
||||
updateContextMenu() {},
|
||||
async setHdmiInDecodeType(index: number, type: string) {
|
||||
let success = false;
|
||||
|
||||
|
|
|
@ -332,4 +332,7 @@ export default {
|
|||
"send power off command": "Send Power Off Command",
|
||||
"set subtitle success": "Set OSD Success",
|
||||
"stop polling": "Stop Signal Loop",
|
||||
"delete group should be delete all child! do you want to delete this group?":
|
||||
"Delete Group Should Be Delete All Child! Do You Want To Delete This Group?",
|
||||
"do you want to delete the item": "Do You Want To Delete The Item",
|
||||
};
|
||||
|
|
|
@ -609,4 +609,7 @@ export default {
|
|||
real: "实际",
|
||||
"current real": "当前实际",
|
||||
"the port number must be between 0 and 65535": "端口号只能在0~65535之间",
|
||||
"delete group should be delete all child! do you want to delete this group?":
|
||||
"删除组会删除组里面所有的子项目! 确定要删除该组吗?",
|
||||
"do you want to delete the item": "确定删除该项目吗",
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue