修复pad端预案运行时还能开窗的BUG并添加相应提示
This commit is contained in:
parent
9b68fa58a5
commit
40a1705c07
|
@ -476,4 +476,5 @@ export default {
|
|||
"the current browser does not support full screen": "当前浏览器不支持全屏",
|
||||
_SOFT_PAD_LOGIN_TITLE_: "软件管理平台",
|
||||
welcome: "欢迎",
|
||||
"plan running! can't open window!": "预案正在运行!不能开窗!",
|
||||
};
|
||||
|
|
|
@ -608,160 +608,172 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
const onDropSignalSourceOrPolliong = (evt: _IDropToWall) => {
|
||||
if (evt && evt.data) {
|
||||
// const x =
|
||||
// evt.pos.x -
|
||||
// (wall.value.parentElement?.offsetLeft ?? 0) -
|
||||
// wall_content.value.offsetLeft;
|
||||
// const y =
|
||||
// evt.pos.y -
|
||||
// (wall.value.parentElement?.offsetTop ?? 0) -
|
||||
// wall_content.value.offsetTop;
|
||||
if (!plan_running.value) {
|
||||
if (evt && evt.data) {
|
||||
// const x =
|
||||
// evt.pos.x -
|
||||
// (wall.value.parentElement?.offsetLeft ?? 0) -
|
||||
// wall_content.value.offsetLeft;
|
||||
// const y =
|
||||
// evt.pos.y -
|
||||
// (wall.value.parentElement?.offsetTop ?? 0) -
|
||||
// wall_content.value.offsetTop;
|
||||
|
||||
let dom = document.elementFromPoint(
|
||||
evt.pos.x,
|
||||
evt.pos.y
|
||||
) as HTMLElement;
|
||||
let dom = document.elementFromPoint(
|
||||
evt.pos.x,
|
||||
evt.pos.y
|
||||
) as HTMLElement;
|
||||
|
||||
const signal_sources = GlobalData.getInstance().signal_source.filter(
|
||||
(item) => (item as any)?.uuid == evt.data.uuid
|
||||
);
|
||||
const signal_sources = GlobalData.getInstance().signal_source.filter(
|
||||
(item) => (item as any)?.uuid == evt.data.uuid
|
||||
);
|
||||
|
||||
// 有可能是窗口的子节点收到了拖拽信息,需要找到真正的窗口节点来判断
|
||||
if (dom) {
|
||||
const temp = find_parent_dom(dom, ["wall_item_flag", "window_flag"]);
|
||||
if (temp) {
|
||||
dom = temp;
|
||||
}
|
||||
}
|
||||
|
||||
if (dom) {
|
||||
if (dom.classList.contains("wall_item_flag")) {
|
||||
// 开窗
|
||||
// 不知道为什么有1像素的差别
|
||||
const x = dom.offsetLeft / wall_content.value.clientWidth;
|
||||
const y = dom.offsetTop / wall_content.value.clientHeight;
|
||||
const width = dom.offsetWidth / wall_content.value.clientWidth;
|
||||
const height = dom.offsetHeight / wall_content.value.clientHeight;
|
||||
|
||||
switch (evt.type) {
|
||||
case "polling":
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openPolling(
|
||||
new Protocol.OpenPollingRequestEntity(
|
||||
evt.data.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
)
|
||||
);
|
||||
break;
|
||||
case "signal_source" /**OpenPollingRequestEntity */:
|
||||
if (signal_sources.length) {
|
||||
const signal_source = signal_sources[0];
|
||||
if (signal_source) {
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openWindow(
|
||||
new Protocol.OpenWindowRequestEntity(
|
||||
signal_source.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
// 有可能是窗口的子节点收到了拖拽信息,需要找到真正的窗口节点来判断
|
||||
if (dom) {
|
||||
const temp = find_parent_dom(dom, [
|
||||
"wall_item_flag",
|
||||
"window_flag",
|
||||
]);
|
||||
if (temp) {
|
||||
dom = temp;
|
||||
}
|
||||
} else if (dom.classList.contains("window_flag")) {
|
||||
// 拖拽信号源替换窗口 后面还有一处替换窗口
|
||||
const rep_uuid = dom.getAttribute("uuid");
|
||||
if (rep_uuid) {
|
||||
let window = $store.state.windows.find(
|
||||
(item) => item.uuid == rep_uuid
|
||||
);
|
||||
if (window) {
|
||||
let client = GlobalData.getInstance().getCurrentClient();
|
||||
if (client) {
|
||||
let x = window.x;
|
||||
let y = window.y;
|
||||
let width = window.width;
|
||||
let height = window.height;
|
||||
}
|
||||
|
||||
client.closeWindow(window.window_id);
|
||||
const open_window_request =
|
||||
new Protocol.OpenPollingRequestEntity(
|
||||
evt.data.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
if (dom) {
|
||||
if (dom.classList.contains("wall_item_flag")) {
|
||||
// 开窗
|
||||
// 不知道为什么有1像素的差别
|
||||
const x = dom.offsetLeft / wall_content.value.clientWidth;
|
||||
const y = dom.offsetTop / wall_content.value.clientHeight;
|
||||
const width = dom.offsetWidth / wall_content.value.clientWidth;
|
||||
const height = dom.offsetHeight / wall_content.value.clientHeight;
|
||||
|
||||
switch (evt.type) {
|
||||
case "polling":
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openPolling(
|
||||
new Protocol.OpenPollingRequestEntity(
|
||||
evt.data.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
)
|
||||
);
|
||||
open_window_request.muted = window.muted;
|
||||
open_window_request.volume = window.volume;
|
||||
open_window_request.paused = window.paused;
|
||||
open_window_request.play_speed = window.play_speed;
|
||||
|
||||
setTimeout(() => {
|
||||
if (!window) {
|
||||
return;
|
||||
break;
|
||||
case "signal_source" /**OpenPollingRequestEntity */:
|
||||
if (signal_sources.length) {
|
||||
const signal_source = signal_sources[0];
|
||||
if (signal_source) {
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openWindow(
|
||||
new Protocol.OpenWindowRequestEntity(
|
||||
signal_source.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
)
|
||||
);
|
||||
}
|
||||
switch (evt.type) {
|
||||
case "polling":
|
||||
{
|
||||
const open_polling_request =
|
||||
new Protocol.OpenPollingRequestEntity(
|
||||
evt.data.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
);
|
||||
open_polling_request.muted = window.muted;
|
||||
open_polling_request.volume = window.volume;
|
||||
open_polling_request.paused = window.paused;
|
||||
open_polling_request.play_speed = window.play_speed;
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openPolling(open_polling_request);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (dom.classList.contains("window_flag")) {
|
||||
// 拖拽信号源替换窗口 后面还有一处替换窗口
|
||||
const rep_uuid = dom.getAttribute("uuid");
|
||||
if (rep_uuid) {
|
||||
let window = $store.state.windows.find(
|
||||
(item) => item.uuid == rep_uuid
|
||||
);
|
||||
if (window) {
|
||||
let client = GlobalData.getInstance().getCurrentClient();
|
||||
if (client) {
|
||||
let x = window.x;
|
||||
let y = window.y;
|
||||
let width = window.width;
|
||||
let height = window.height;
|
||||
|
||||
break;
|
||||
case "signal_source":
|
||||
{
|
||||
if (signal_sources.length) {
|
||||
const signal_source = signal_sources[0];
|
||||
if (signal_source) {
|
||||
const open_window_request =
|
||||
new Protocol.OpenWindowRequestEntity(
|
||||
signal_source.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
);
|
||||
open_window_request.muted = window.muted;
|
||||
open_window_request.volume = window.volume;
|
||||
open_window_request.paused = window.paused;
|
||||
open_window_request.play_speed =
|
||||
window.play_speed;
|
||||
client?.openWindow(open_window_request);
|
||||
client.closeWindow(window.window_id);
|
||||
const open_window_request =
|
||||
new Protocol.OpenPollingRequestEntity(
|
||||
evt.data.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
);
|
||||
open_window_request.muted = window.muted;
|
||||
open_window_request.volume = window.volume;
|
||||
open_window_request.paused = window.paused;
|
||||
open_window_request.play_speed = window.play_speed;
|
||||
|
||||
setTimeout(() => {
|
||||
if (!window) {
|
||||
return;
|
||||
}
|
||||
switch (evt.type) {
|
||||
case "polling":
|
||||
{
|
||||
const open_polling_request =
|
||||
new Protocol.OpenPollingRequestEntity(
|
||||
evt.data.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
);
|
||||
open_polling_request.muted = window.muted;
|
||||
open_polling_request.volume = window.volume;
|
||||
open_polling_request.paused = window.paused;
|
||||
open_polling_request.play_speed = window.play_speed;
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openPolling(open_polling_request);
|
||||
}
|
||||
|
||||
break;
|
||||
case "signal_source":
|
||||
{
|
||||
if (signal_sources.length) {
|
||||
const signal_source = signal_sources[0];
|
||||
if (signal_source) {
|
||||
const open_window_request =
|
||||
new Protocol.OpenWindowRequestEntity(
|
||||
signal_source.uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
);
|
||||
open_window_request.muted = window.muted;
|
||||
open_window_request.volume = window.volume;
|
||||
open_window_request.paused = window.paused;
|
||||
open_window_request.play_speed =
|
||||
window.play_speed;
|
||||
client?.openWindow(open_window_request);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}, 50);
|
||||
break;
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$q.notify({
|
||||
type: "warning",
|
||||
message: $t.t("plan running! can't open window!"),
|
||||
position: "top",
|
||||
timeout: 1500,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -708,6 +708,16 @@ export default defineComponent({
|
|||
target.classList.remove("drag-enter");
|
||||
}
|
||||
|
||||
if (plan_running.value) {
|
||||
$q.notify({
|
||||
type: "warning",
|
||||
message: $t.t("plan running! can't open window!"),
|
||||
position: "top",
|
||||
timeout: 1500,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const type = e.dataTransfer?.getData("type");
|
||||
const uuid = e.dataTransfer?.getData("uuid");
|
||||
if (uuid && uuid.length > 0 && type && type.length > 0) {
|
||||
|
|
Loading…
Reference in New Issue