From 1b93f2f92a46ddea4cba0f9d9e5c59de26a65ef4 Mon Sep 17 00:00:00 2001
From: miao <2514145421@qq.com>
Date: Thu, 23 Feb 2023 11:13:01 +0800
Subject: [PATCH] =?UTF-8?q?=E9=AD=94=E5=A2=99=E7=8A=B6=E6=80=81=E4=B8=BB?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=80=E7=AA=97=E9=80=82?=
=?UTF-8?q?=E5=BA=94=E5=A4=A7=E5=B0=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/FileManageDialog.vue | 1 -
src/pages/WallPage.vue | 180 ++++++++++++++--------------
2 files changed, 91 insertions(+), 90 deletions(-)
diff --git a/src/components/FileManageDialog.vue b/src/components/FileManageDialog.vue
index 7a6b32c..11aa6d2 100644
--- a/src/components/FileManageDialog.vue
+++ b/src/components/FileManageDialog.vue
@@ -919,7 +919,6 @@ export default defineComponent({
const response = await GlobalData.getInstance()
.getCurrentClient()
?.CreateDirectoryFileManager(path.value, data);
- console.log(response);
if (response && response.success) {
refresh_file_list();
$q.notify({
diff --git a/src/pages/WallPage.vue b/src/pages/WallPage.vue
index 4811028..507eb68 100644
--- a/src/pages/WallPage.vue
+++ b/src/pages/WallPage.vue
@@ -93,42 +93,42 @@
style="text-align: center"
>
{{ item.id + 1 }}
-
-
-
-
-
-
-
- {{ $t("open window") }}
-
-
-
-
-
- {{ $t("close all windows") }}
-
-
-
+
+
+
+
+
+
+ {{ $t("open window") }}
+
+
+
+
+
+ {{ $t("close all windows") }}
+
+
+
+
@@ -378,14 +378,15 @@ export default defineComponent({
const area_open_window_rect = ref(new Rect());
let item_witdh = ref(0);
const item_height = ref(0);
- const radians = () => {
+ const radians = (index:number) => {
const test_monitor_list: any = clacMonitor();
if (test_monitor_list) {
- const item = test_monitor_list[current_index.value];
+ const item = test_monitor_list[index];
return /*a*/ (item.angle * Math.PI) / 180;
}
};
const calculateCoordinates = (
+ index:number,
px: number,
py: number,
cx: number,
@@ -393,13 +394,13 @@ export default defineComponent({
) => {
const x =
cx +
- (px - cx) * Math.cos(Number(radians())) -
- (py - cy) * Math.sin(Number(radians()));
+ (px - cx) * Math.cos(Number(radians(index))) -
+ (py - cy) * Math.sin(Number(radians(index)));
const y =
cy +
- (px - cx) * Math.sin(Number(radians())) +
- (py - cy) * Math.cos(Number(radians()));
+ (px - cx) * Math.sin(Number(radians(index))) +
+ (py - cy) * Math.cos(Number(radians(index)));
return { x, y };
};
@@ -423,34 +424,38 @@ export default defineComponent({
});
return test_monitor_list;
};
- const four_point = () => {
+ const four_point = (index:number) => {
const test_monitor_list: any = clacMonitor();
if (test_monitor_list) {
- const item = test_monitor_list[current_index.value];
+ const item = test_monitor_list[index];
item.centerx = parseInt(item.centerx.toString());
item.centery = parseInt(item.centery.toString());
const x2: number = item.currentx + item.w;
const y2: number = item.currenty + item.h;
if (item.angle != 0) {
const point_left_top = calculateCoordinates(
+ index,
item.currentx,
item.currenty,
item.centerx,
item.centery
);
const point_left_bootom = calculateCoordinates(
+ index,
item.currentx,
y2,
item.centerx,
item.centery
);
const point_right_top = calculateCoordinates(
+ index,
x2,
item.currenty,
item.centerx,
item.centery
);
const point_right_bottom = calculateCoordinates(
+ index,
x2,
y2,
item.centerx,
@@ -467,9 +472,9 @@ export default defineComponent({
}
}
};
- const select_x = () => {
- const point_list = four_point();
- const item = $store.state.show_monitor_list[current_index.value];
+ const select_x = (index:number) => {
+ const point_list = four_point(index);
+ const item = $store.state.show_monitor_list[index];
if (item.angle != 0) {
if (point_list) {
let minx = 100000;
@@ -484,8 +489,8 @@ export default defineComponent({
if (wall.value) return item.currentx * wall.value?.clientWidth;
}
};
- const select_y = () => {
- const point_list = four_point();
+ const select_y = (index:number) => {
+ const point_list = four_point(index);
let miny = 100000;
if (point_list) {
point_list.forEach((element) => {
@@ -494,15 +499,15 @@ export default defineComponent({
}
});
}
- const item = $store.state.show_monitor_list[current_index.value];
+ const item = $store.state.show_monitor_list[index];
if (item.angle != 0) {
return miny;
} else {
if (wall.value) return item.currenty * wall.value?.clientHeight;
}
};
- const select_height = () => {
- const point_list = four_point();
+ const select_height = (index:number) => {
+ const point_list = four_point(index);
let maxy = 0;
let miny = 100000;
if (point_list) {
@@ -515,7 +520,7 @@ export default defineComponent({
}
});
}
- const item = $store.state.show_monitor_list[current_index.value];
+ const item = $store.state.show_monitor_list[index];
if (item.angle != 0) {
return maxy - miny;
} else {
@@ -523,8 +528,8 @@ export default defineComponent({
}
};
- const select_width = () => {
- const point_list = four_point();
+ const select_width = (index:number) => {
+ const point_list = four_point(index);
let maxx = 0;
let minx = 100000;
if (point_list) {
@@ -537,7 +542,7 @@ export default defineComponent({
}
});
}
- const item = $store.state.show_monitor_list[current_index.value];
+ const item = $store.state.show_monitor_list[index];
if (item.angle != 0) {
return maxx - minx;
} else {
@@ -1234,25 +1239,18 @@ export default defineComponent({
.getCurrentClient()
?.replaceWindow2(find_window, uuid, true);
} else {
- if (
- $store.state.custom_defines.function_magic_wall
- ) {
- const item =
- $store.state.show_monitor_list[
- current_index.value
- ];
- if (wall.value) {
- x = Number(select_x()) / wall.value.clientWidth;
- y =
- Number(select_y()) / wall.value.clientHeight;
- width =
- Number(select_width()) /
- wall.value.clientWidth;
- height =
- Number(select_height()) /
- wall.value.clientHeight;
- }
- }
+ if ($store.state.custom_defines.function_magic_wall) {
+ const item =
+ $store.state.show_monitor_list[current_index.value];
+ if (wall.value) {
+ x = Number(select_x(current_index.value)) / wall.value.clientWidth;
+ y = Number(select_y(current_index.value)) / wall.value.clientHeight;
+ width =
+ Number(select_width(current_index.value)) / wall.value.clientWidth;
+ height =
+ Number(select_height(current_index.value)) / wall.value.clientHeight;
+ }
+ }
const open_polling_request =
new Protocol.OpenPollingRequestEntity(
uuid,
@@ -1284,19 +1282,15 @@ export default defineComponent({
if (
$store.state.custom_defines.function_magic_wall
) {
- const item =
- $store.state.show_monitor_list[
- current_index.value
- ];
if (wall.value) {
- x = Number(select_x()) / wall.value.clientWidth;
+ x = Number(select_x(current_index.value)) / wall.value.clientWidth;
y =
- Number(select_y()) / wall.value.clientHeight;
+ Number(select_y(current_index.value)) / wall.value.clientHeight;
width =
- Number(select_width()) /
+ Number(select_width(current_index.value)) /
wall.value.clientWidth;
height =
- Number(select_height()) /
+ Number(select_height(current_index.value)) /
wall.value.clientHeight;
}
}
@@ -1495,7 +1489,7 @@ export default defineComponent({
}
}
},
- async openWindowByLocalFile(event: MouseEvent) {
+ async openWindowByLocalFile(index: number, event: MouseEvent) {
if (!wall.value) {
return;
}
@@ -1535,8 +1529,8 @@ export default defineComponent({
.getCurrentClient()
?.addSignalSource(signal_source);
if (wall.value && response && response.success) {
- const cell_width = 1.0 / $store.state.wall_col;
- const cell_height = 1.0 / $store.state.wall_row;
+ let cell_width = 1.0 / $store.state.wall_col;
+ let cell_height = 1.0 / $store.state.wall_row;
const col = Math.floor(
last_context_menu_pos_x.value /
@@ -1549,9 +1543,17 @@ export default defineComponent({
cell_height
);
- const x = col * cell_width;
- const y = row * cell_height;
-
+ let x = col * cell_width;
+ let y = row * cell_height;
+ if ($store.state.custom_defines.function_magic_wall&&index!=-1) {
+ if (wall.value) {
+ x = Number(select_x(index)) / wall.value.clientWidth;
+ y = Number(select_y(index)) / wall.value.clientHeight;
+ cell_width = Number(select_width(index)) / wall.value.clientWidth;
+ cell_height =
+ Number(select_height(index)) / wall.value.clientHeight;
+ }
+ }
if (!isNaN(x) && !isNaN(y)) {
const open_window_request =
new Protocol.OpenWindowRequestEntity(