放大缩放按钮,修复开窗后会选中下面的窗口的BUG

This commit is contained in:
fangxiang 2022-02-12 10:38:40 +08:00
parent e1b1ec4ee7
commit 65886030b9
4 changed files with 33 additions and 28 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "media_player_client", "name": "media_player_client",
"version": "1.2.1", "version": "1.2.2",
"description": "A Quasar Framework app", "description": "A Quasar Framework app",
"productName": "MediaPlayerClient", "productName": "MediaPlayerClient",
"author": "fangxiang <fangxiang@cloudview.work>", "author": "fangxiang <fangxiang@cloudview.work>",

View File

@ -6,6 +6,7 @@
? 'window_selected' ? 'window_selected'
: 'window_normal' : 'window_normal'
" "
@mousedown="onMouseDown"
@click="onClick" @click="onClick"
:style="{ :style="{
background: $props.window.client_color, background: $props.window.client_color,
@ -277,6 +278,11 @@ export default defineComponent({
is_clock_window, is_clock_window,
calc_is_audio_player_window, calc_is_audio_player_window,
onMouseDown(evt: MouseEvent) {
if (evt.ctrlKey) {
ctrl_press_flag = true;
}
},
onClick(evt: MouseEvent) { onClick(evt: MouseEvent) {
if (ctrl_press_flag) { if (ctrl_press_flag) {
ctrl_press_flag = false; ctrl_press_flag = false;

View File

@ -26,12 +26,13 @@
$store.state.windows_sort.findIndex((element) => element == item.uuid) $store.state.windows_sort.findIndex((element) => element == item.uuid)
" "
:isActive="item.uuid == $store.state.selected_window" :isActive="item.uuid == $store.state.selected_window"
:resizeIconSize="14"
:isGuide="true" :isGuide="true"
v-for="(item, index) in windows" v-for="(item, index) in windows"
:key="index" :key="index"
style="background: red; position: fixed"
@resizeEndHandler="resizeWindow(item.window_id, $event)" @resizeEndHandler="resizeWindow(item.window_id, $event)"
@moveEndHandler="moveWindow(item.window_id, $event)" @moveEndHandler="moveWindow(item.window_id, $event)"
style="position: fixed"
> >
<window <window
@close_this_window="closeWindow" @close_this_window="closeWindow"
@ -393,18 +394,18 @@ export default defineComponent({
); );
if (window) { if (window) {
// , // ,
// $store.commit("setWindowPropertys", [ $store.commit("setWindowPropertys", [
// { {
// window, window,
// property_name: "x", property_name: "x",
// value: (temp.x ?? 0) + __temp__size_a__, value: (temp.x ?? 0) + __temp__size_a__,
// }, },
// { {
// window, window,
// property_name: "y", property_name: "y",
// value: (temp.y ?? 0) + __temp__size_a__, value: (temp.y ?? 0) + __temp__size_a__,
// }, },
// ]); ]);
setTimeout(() => { setTimeout(() => {
$store.commit("setWindowPropertys", [ $store.commit("setWindowPropertys", [
@ -432,18 +433,18 @@ export default defineComponent({
(item) => item.window_id == temp.window_id (item) => item.window_id == temp.window_id
); );
if (window) { if (window) {
// $store.commit("setWindowPropertys", [ $store.commit("setWindowPropertys", [
// { {
// window, window,
// property_name: "width", property_name: "width",
// value: (temp.width ?? 0) + __temp__size_a__, value: (temp.width ?? 0) + __temp__size_a__,
// }, },
// { {
// window, window,
// property_name: "height", property_name: "height",
// value: (temp.width ?? 0) + __temp__size_a__, value: (temp.width ?? 0) + __temp__size_a__,
// }, },
// ]); ]);
setTimeout(() => { setTimeout(() => {
$store.commit("setWindowPropertys", [ $store.commit("setWindowPropertys", [
@ -610,7 +611,6 @@ export default defineComponent({
}; };
const resizeWindow = (window_id: number, evt: any) => { const resizeWindow = (window_id: number, evt: any) => {
console.log(evt);
evt.width = evt.width ?? 0; evt.width = evt.width ?? 0;
evt.height = evt.height ?? 0; evt.height = evt.height ?? 0;
evt.left = evt.left ?? 0; evt.left = evt.left ?? 0;

View File

@ -96,7 +96,6 @@ const itemResize = (
style.left = style.back_left; style.left = style.back_left;
style.top = style.back_top; style.top = style.back_top;
} else { } else {
console.log(style);
emit("resizeEndHandler", { emit("resizeEndHandler", {
// 抬起事件回调 // 抬起事件回调
el: target, el: target,