魔墙:修复多次删除其他窗口消失

This commit is contained in:
miao 2023-03-06 15:13:00 +08:00
parent a6842221ad
commit 67d3799550
1 changed files with 88 additions and 100 deletions

View File

@ -856,6 +856,10 @@ export default defineComponent({
const br = 0.6;
const cr = 0.7;
let test_monitor_list: Ref<test_monitor[]> = ref([
// new test_monitor(12, "13", cw, ch, cr)
]);
const initialize = () => {
test_monitor_list.value = [
new test_monitor(0, "01", aw, ah, ar),
new test_monitor(1, "02", aw, ah, ar),
new test_monitor(2, "03", aw, ah, ar),
@ -868,8 +872,8 @@ export default defineComponent({
new test_monitor(9, "10", cw, ch, cr),
new test_monitor(10, "11", cw, ch, cr),
new test_monitor(11, "12", cw, ch, cr),
// new test_monitor(12, "13", cw, ch, cr)
]);
];
};
interface show__Rect {
width: number;
height: number;
@ -896,16 +900,6 @@ export default defineComponent({
output_length.value =
parseInt(settings.wall_col.toString()) *
parseInt(settings.wall_row.toString());
if (output_length.value > WallList.length) {
let num = output_length.value - WallList.length;
while (num > 0) {
let index = WallList.length;
let uuid = (index + 1).toString();
WallList.push(new test_monitor(index, uuid, aw, ah, ar));
num--;
}
getpx();
}
}
const cloud_monitor_list = new MagicWallConfig();
@ -1015,14 +1009,13 @@ export default defineComponent({
const four_point = (item: test_monitor) => {
const wall_dom = wall.value;
let centerx: any, centery: any;
if (item) {
if (wall_dom) {
centerx = (item.centerx / 3840) * wall_dom.offsetWidth;
centery = (item.centery / 2160) * wall_dom.offsetHeight;
}
centerx = Math.round(centerx);
centery = Math.round(centery);
// item.centerx = Math.round((item.centerx));
// item.centery = Math.round(item.centery);
const x2: number = item.currentx + item.w;
const y2: number = item.currenty + item.h;
const x1: number = centerx;
@ -1066,6 +1059,7 @@ export default defineComponent({
];
return point_list;
}
}
};
let offsetHeight = ref(0.0);
let offsetWidth = ref(0.0);
@ -1090,8 +1084,8 @@ export default defineComponent({
item: test_monitor = test_monitor_wall.value[current_index.value]
) => {
const wall_dom = wall.value;
const point_list = four_point(item);
if (wall_dom) {
const point_list = four_point(item);
if (item.angle != 0 && point_list) {
let minx = 0;
point_list.forEach((element) => {
@ -1164,8 +1158,8 @@ export default defineComponent({
item: test_monitor = test_monitor_wall.value[current_index.value]
) => {
const wall_dom = wall.value;
const point_list = four_point(item);
if (wall_dom) {
const point_list = four_point(item);
if (item.angle != 0 && point_list) {
let miny = 0;
point_list.forEach((element) => {
@ -1191,8 +1185,8 @@ export default defineComponent({
item: test_monitor = test_monitor_wall.value[current_index.value]
) => {
const wall_dom = wall.value;
const point_list = four_point(item);
if (wall_dom) {
const point_list = four_point(item);
if (item.angle != 0 && point_list) {
let maxy = 0;
point_list.forEach((element) => {
@ -1343,7 +1337,7 @@ export default defineComponent({
const refresh_all = () => {
refresh_resize(2);
current_index.value = -1;
monitor_list_current_index.value=-1
monitor_list_current_index.value = -1;
percenter.value = last_percenter.value;
multiple_select.value = [];
multiple.value = false;
@ -1422,7 +1416,7 @@ export default defineComponent({
refresh_resize(1);
});
const refresh_magic = (a: any) => {
sort_index.value=[]
sort_index.value = [];
let monitorList: any = [];
$store.commit("setShowMonitorList", monitorList);
if (a) {
@ -1643,9 +1637,7 @@ export default defineComponent({
) as Protocol.SetApplicationConfigRequestEntity;
if (temp.key == "magic_wall_config") {
const a = JSON.parse(temp.value).windows;
if (
true
) {
if (true) {
refresh_magic(a);
}
}
@ -1700,12 +1692,13 @@ export default defineComponent({
console.log(a);
},
async showDialog() {
initialize();
monitor_list_current_index.value = -1;
show_dialog.value = true;
magic_switch.value = true;
sort_index.value = [];
old_sort_index=[]
last_wall.value=[]
old_sort_index = [];
last_wall.value = [];
let client = GlobalData.getInstance().getCurrentClient();
if (client) {
const settings = await GlobalData.getInstance()
@ -2043,21 +2036,17 @@ export default defineComponent({
test_monitor_wall.value.forEach((ele) => {
ele.cmh = Math.round(ele.h / lcm.value);
ele.cmw = Math.round(ele.w / lcm.value);
test_monitor_list.value[ele.id] = JSON.parse(JSON.stringify(ele));
test_monitor_list.value[ele.id].cmh = Number(JSON.stringify(ele.cmh));
test_monitor_list.value[ele.id].cmw = Number(JSON.stringify(ele.cmw));
});
test_monitor_list.value.forEach((element) => {
element.isHide = false;
});
test_monitor_wall.value.forEach((element, i) => {
if (index != i) {
element.isShow = false;
}
});
test_monitor_wall.value = [item];
sort_index.value = [item.uuid];
test_monitor_list.value[item.id].isHide = true;
test_monitor_wall.value[index].isShow = true;
current_index.value = 0;
realtime_upload();
current_index.value = sort_index.value.indexOf(item.uuid);
},
//cache
closeAllWindows() {
@ -2066,14 +2055,13 @@ export default defineComponent({
test_monitor_wall.value.forEach((ele) => {
ele.cmh = Math.round(ele.h / lcm.value);
ele.cmw = Math.round(ele.w / lcm.value);
test_monitor_list.value[ele.id] = JSON.parse(JSON.stringify(ele));
test_monitor_list.value[ele.id].cmh = Number(JSON.stringify(ele.cmh));
test_monitor_list.value[ele.id].cmw = Number(JSON.stringify(ele.cmw));
});
test_monitor_list.value.forEach((element) => {
element.isHide = false;
});
test_monitor_wall.value.forEach((element) => {
element.isShow = false;
});
test_monitor_wall.value = [];
multiple_select.value = [];
realtime_upload();
},