魔墙:增加翻译,修复虚拟窗口选中,修改角度坐标会乱选中窗口,添加魔墙的显示器列表宽高信息,增加恢复时恢复显示器列表信息

This commit is contained in:
miao 2023-03-07 17:35:35 +08:00
parent 7a0842ea24
commit b2f2805247
5 changed files with 108 additions and 70 deletions

View File

@ -710,6 +710,17 @@ export default class ClientConnection {
)
);
}
public setMagicWallList(list:any) {
this.ws?.send(
JSON.stringify(
new Protocol.SetApplicationConfigRequestEntity(
0,
"magic_list",
typeof (list) == 'string' ? list : JSON.stringify(list)
)
)
);
}
public setConfigure(k: string, v: string) {
this.ws?.send(

View File

@ -124,9 +124,22 @@
min="0"
v-model="test_monitor_wall[current_index].angle"
@keydown="testLog($event)"
oninput="if(value<0)value=0;if(value>360)value=360;"
hint=""
@update:model-value="changeAngle()"
:rules="[
(val) =>
(val != null &&
val != undefined &&
val.toString().length > 0) ||
$t('Please type something'),
(val) =>
parseInt(val) >= 0 ||
$t('the number must be greater than 0'),
(val) =>
parseInt(val) <= 360 ||
$t('the number must be greater than 360'),
]"
lazy-rules
>
<template v-slot:append>
<span class="input_append">°</span>
@ -921,7 +934,7 @@ export default defineComponent({
),
h: element.h / wall_dom.offsetHeight,
w: element.w / wall_dom.offsetWidth,
angle: parseInt(element.angle.toString()),
angle: Number(element.angle.toString()) ?? 0,
initial_h: element.InitialH,
initial_w: element.InitialW,
percenter: per,
@ -943,7 +956,7 @@ export default defineComponent({
currenty: element.currenty / wall_dom.offsetHeight,
h: element.h / wall_dom.offsetHeight,
w: element.w / wall_dom.offsetWidth,
angle: parseInt(element.angle.toString()),
angle: Number(element.angle.toString()) ?? 0,
centerx: element.centerx / 3840,
centery: element.centery / 2160,
});
@ -1250,6 +1263,11 @@ export default defineComponent({
const moveMonitor = (item: test_monitor, rect: show__Rect) => {
//
const wall_dom = wall.value;
const temp_index = sort_index.value.findIndex((v: any) => v == item.uuid);
if (temp_index != -1) {
sort_index.value.splice(temp_index, 1);
sort_index.value.push(item.uuid);
}
if (item.angle != 0) {
exceedrange(item);
} else if (wall_dom) {
@ -1274,7 +1292,9 @@ export default defineComponent({
((item.currenty + item.h / 2) / wall_dom?.offsetHeight) * 2160
);
}
test_monitor_wall.value=ordination(JSON.parse(JSON.stringify(test_monitor_wall.value)))
realtime_upload();
item.active=true
};
const exceedrange = (item: test_monitor) => {
const wall_dom = wall.value;
@ -1342,15 +1362,7 @@ export default defineComponent({
multiple_select.value = [];
multiple.value = false;
loading.value = false;
// test_monitor_list.value.forEach((element) => {
// element.isHide = false;
// element.isactive=false;
// });
// last_wall.value.forEach((element) => {
// element.isShow = true;
// test_monitor_wall.value.push(JSON.parse(JSON.stringify(element)));
// test_monitor_list.value[element.id].isHide = true;
// });
test_monitor_list.value = JSON.parse(list_magic);
realtime_upload(last_wall.value, last_percenter.value, 2);
};
let sort_index: any = ref([]);
@ -1358,11 +1370,11 @@ export default defineComponent({
const ordination = (wall_list: any, sort: any = sort_index.value) => {
let temp_list: test_monitor[] = [];
wall_list.forEach((ele: any, index: number) => {
let i = sort.indexOf(ele.uuid);
temp_list[i] = wall_list[index];
});
current_index.value = wall_list.length - 1;
return temp_list;
};
const refresh_resize = (a: number) => {
@ -1470,6 +1482,7 @@ export default defineComponent({
);
item.angle = element.angle;
item.isShow = true;
item.active=false;
test_monitor_wall.value.push(JSON.parse(JSON.stringify(item)));
sort_index.value.push(test_monitor_list.value[element.index].uuid);
@ -1616,6 +1629,7 @@ export default defineComponent({
}
realtime_upload();
};
let list_magic: any = [];
EventBus.getInstance().on(
EventNamesDefine.NotifyMessage,
(notify: NotifyMessage) => {
@ -1704,11 +1718,17 @@ export default defineComponent({
const settings = await GlobalData.getInstance()
.getCurrentClient()
?.getOutputBoardSetting();
const response = await client.getMagicWallConfig();
const wall_dom = wall.value;
const SetMagicWallGridState = await client.setMagicWallGridState(
magic_switch.value
);
list_magic = (await client.getApplicationSettins())?.config
?.magic_list;
if (list_magic) {
test_monitor_list.value = JSON.parse(list_magic);
}
if (wall_dom) {
offsetHeight.value = wall_dom.offsetHeight;
offsetWidth.value = wall_dom.offsetWidth;
@ -1771,6 +1791,7 @@ export default defineComponent({
);
item.angle = element.angle;
item.isShow = true;
item.active=false
test_monitor_wall.value.push(JSON.parse(JSON.stringify(item)));
last_wall.value.push(JSON.parse(JSON.stringify(item)));
sort_index.value.push(
@ -1779,11 +1800,7 @@ export default defineComponent({
old_sort_index.push(
test_monitor_list.value[element.index].uuid
);
test_monitor_list.value.forEach((ele) => {
if (element.index == ele.id) {
ele.isHide = true;
}
});
test_monitor_list.value[element.index].isHide = true;
});
if (a.length == 1) {
current_index.value = 0;
@ -1833,7 +1850,7 @@ export default defineComponent({
),
h: element.h / wall_dom.offsetHeight,
w: element.w / wall_dom.offsetWidth,
angle: parseInt(element.angle.toString()),
angle: Number(element.angle.toString()) ?? 0,
initial_h: element.InitialH,
initial_w: element.InitialW,
percenter: percenter.value,
@ -1843,7 +1860,9 @@ export default defineComponent({
}
});
const setMagic = await client.setMagicWallConfig(cloud_monitor_list);
client.setMagicWallList(
JSON.parse(JSON.stringify(test_monitor_list.value))
);
if (setMagic?.success) {
let monitorList: any = [];
test_monitor_wall.value.forEach((element, index) => {
@ -1854,7 +1873,7 @@ export default defineComponent({
currenty: element.currenty / wall_dom.offsetHeight,
h: element.h / wall_dom.offsetHeight,
w: element.w / wall_dom.offsetWidth,
angle: parseInt(element.angle.toString()),
angle: Number(element.angle.toString()) ?? 0,
centerx: element.centerx / 3840,
centery: element.centery / 2160,
});

View File

@ -1,48 +1,49 @@
import { AdvancedIpAddressEntity } from "./AdvancedIpAddressEntity";
export default class ApplicationConfigEntity {
user_name: string = "admin";
password: string = "";
auto_ip_address: string = "";
ip_address: string = "";
gateway: string = "";
mac_address: string = "";
subnet_mask: string = "";
dns1 = "";
dns2 = "";
ip_list: AdvancedIpAddressEntity[] = [];
use_ntp: string = "";
ntp_server: string = "";
ntp_sync_delay: string = "";
time_zone: number = 21;
wall_row: number = 1;
wall_col: number = 1;
tcp_port: string = "";
udp_port: string = "";
websocket_port: string = "";
httpserver_port: string = "";
root_fs_upload_path: string = "";
media_upload_dir: string = "";
power_on_plan: string = "";
graphics_brightness: number = 100;
graphics_contrast: number = 100;
graphics_hue: number = 100;
device_rotate: number = 0;
system_volume: number = 100;
system_muted: number = 0;
output_audio_card: string = "";
application_data_dir: string = "";
runtime_os: string = "";
registered: boolean = false;
hdmi_in_decode_type_1: string | undefined;
hdmi_in_audio_device_1: string | undefined;
hw_version: string | undefined;
device_hdmi_output_count = 1;
video_suffix_filter: string | null = "";
image_suffix_filter: string | null = "";
special_video_layout_rotation: string | undefined = "0";
device_hdmi_rotation: number = 0;
cloud_server_address = "";
cloud_server_verify_key = "";
cloud_server_use_wss = "0";
cloud_server_enable = "0";
}
import { AdvancedIpAddressEntity } from "./AdvancedIpAddressEntity";
export default class ApplicationConfigEntity {
user_name: string = "admin";
password: string = "";
auto_ip_address: string = "";
ip_address: string = "";
gateway: string = "";
mac_address: string = "";
subnet_mask: string = "";
dns1 = "";
dns2 = "";
ip_list: AdvancedIpAddressEntity[] = [];
use_ntp: string = "";
ntp_server: string = "";
ntp_sync_delay: string = "";
time_zone: number = 21;
wall_row: number = 1;
wall_col: number = 1;
tcp_port: string = "";
udp_port: string = "";
websocket_port: string = "";
httpserver_port: string = "";
root_fs_upload_path: string = "";
media_upload_dir: string = "";
power_on_plan: string = "";
graphics_brightness: number = 100;
graphics_contrast: number = 100;
graphics_hue: number = 100;
device_rotate: number = 0;
system_volume: number = 100;
system_muted: number = 0;
output_audio_card: string = "";
application_data_dir: string = "";
runtime_os: string = "";
registered: boolean = false;
hdmi_in_decode_type_1: string | undefined;
hdmi_in_audio_device_1: string | undefined;
hw_version: string | undefined;
device_hdmi_output_count = 1;
video_suffix_filter: string | null = "";
image_suffix_filter: string | null = "";
special_video_layout_rotation: string | undefined = "0";
device_hdmi_rotation: number = 0;
cloud_server_address = "";
cloud_server_verify_key = "";
cloud_server_use_wss = "0";
cloud_server_enable = "0";
magic_list:any=[]
}

View File

@ -57,7 +57,10 @@ export default {
Accept: "Accept",
"move speed": "Move Speed",
"y offset": "Y Offset",
"the number must be greater than 0": "the number must be greater than 0",
"the number must be greater than 0": "The Number Must Be Greater Than 0",
"the number must be less than 2160":"The Number Must Be Less Than 2160",
"the number must be less than 3840":"The Number Must Be Less Than 3840",
"the number must be greater than 360":"The Number Must Be Less Than 360",
"pos x": "X Position",
"pos y": "Y Position",
width: "Width",

View File

@ -489,7 +489,11 @@ export default {
"full screen window": "全屏",
"restore window size": "恢复",
"the number must be greater than 0": "数字必须大于0",
"the number must be less than 2160":"数字必须小于等于2160",
"the number must be less than 3840":"数字必须小于等于3840",
"the number must be greater than 1": "数字必须大于1",
"the number must be greater than 360":"数字必须小于等于360",
X: "X坐标",
Y: "Y坐标",
"edit window rect": "窗口大小调整",