魔墙状态主页面右键开窗适应大小

This commit is contained in:
miao 2023-02-23 11:13:01 +08:00
parent 3b84db438f
commit 1b93f2f92a
2 changed files with 91 additions and 90 deletions

View File

@ -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({

View File

@ -93,42 +93,42 @@
style="text-align: center"
>
{{ item.id + 1 }}
</vue3-resize-drag>
<q-popup-proxy
context-menu
@show="
{
last_context_menu_pos_x = $event.layerX;
last_context_menu_pos_y = $event.layerY;
}
"
>
<q-list>
<q-item
:disable="plan_running || !$store.state.power_state"
clickable
v-close-popup
@click="openWindowByLocalFile($event)"
>
<q-item-section avatar>
<q-icon name="open_in_browser" />
</q-item-section>
<q-item-section> {{ $t("open window") }} </q-item-section>
</q-item>
<q-item
:disable="plan_running || !$store.state.power_state"
clickable
v-close-popup
@click="closeAllWindows"
>
<q-item-section avatar>
<q-icon name="close" color="red" />
</q-item-section>
<q-item-section> {{ $t("close all windows") }} </q-item-section>
</q-item>
</q-list>
</q-popup-proxy>
<q-popup-proxy
context-menu
@show="
{
last_context_menu_pos_x = $event.layerX;
last_context_menu_pos_y = $event.layerY;
}
"
>
<q-list>
<q-item
:disable="plan_running || !$store.state.power_state"
clickable
v-close-popup
@click="openWindowByLocalFile(index, $event)"
>
<q-item-section avatar>
<q-icon name="open_in_browser" />
</q-item-section>
<q-item-section> {{ $t("open window") }} </q-item-section>
</q-item>
<q-item
:disable="plan_running || !$store.state.power_state"
clickable
v-close-popup
@click="closeAllWindows"
>
<q-item-section avatar>
<q-icon name="close" color="red" />
</q-item-section>
<q-item-section> {{ $t("close all windows") }} </q-item-section>
</q-item>
</q-list>
</q-popup-proxy>
</vue3-resize-drag>
</div>
</div>
<div
@ -174,7 +174,7 @@
:disable="plan_running || !$store.state.power_state"
clickable
v-close-popup
@click="openWindowByLocalFile($event)"
@click="openWindowByLocalFile(-1, $event)"
>
<q-item-section avatar>
<q-icon name="open_in_browser" />
@ -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,