调整顶部菜单布局

去除冗余窗口右键
尝试修复拖拽信号源失败的BUG(点击空白墙复现)
This commit is contained in:
fangxiang 2022-02-10 19:39:15 +08:00
parent 7cfee35383
commit 3c3a31571a
4 changed files with 77 additions and 21 deletions

View File

@ -18,7 +18,7 @@
v-close-popup v-close-popup
:disable="$props.disable" :disable="$props.disable"
@click="$emit('edit_volume', $props.window.window_id)" @click="$emit('edit_volume', $props.window.window_id)"
v-if="!$props.window.muted && is_audo_player_window" v-if="false && !$props.window.muted && is_audo_player_window"
> >
<q-item-section> {{ $t("edit volume") }} </q-item-section> <q-item-section> {{ $t("edit volume") }} </q-item-section>
</q-item> </q-item>
@ -27,7 +27,7 @@
v-close-popup v-close-popup
:disable="$props.disable" :disable="$props.disable"
@click="$emit('mute_unmute', $props.window.window_id)" @click="$emit('mute_unmute', $props.window.window_id)"
v-if="is_audo_player_window" v-if="false && is_audo_player_window"
> >
<q-item-section> <q-item-section>
{{ $props.window.muted ? $t("unmute") : $t("mute") }} {{ $props.window.muted ? $t("unmute") : $t("mute") }}
@ -60,6 +60,7 @@
<q-item-section> {{ $t("close all windwos") }} </q-item-section> <q-item-section> {{ $t("close all windwos") }} </q-item-section>
</q-item> </q-item>
<q-item <q-item
v-if="false"
clickable clickable
v-close-popup v-close-popup
:disable="$props.disable" :disable="$props.disable"
@ -70,6 +71,7 @@
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item <q-item
v-if="false"
clickable clickable
v-close-popup v-close-popup
:disable="$props.disable" :disable="$props.disable"

View File

@ -314,6 +314,6 @@ export default {
"font name": "字体", "font name": "字体",
"font color": "字体颜色", "font color": "字体颜色",
"new signal source": "新建信号源", "new signal source": "新建信号源",
"lower window": "窗口置底", "lower window": "置底窗口",
"top window": "窗口置顶", "top window": "置顶窗口",
}; };

View File

@ -2,6 +2,7 @@
<div> <div>
<q-toolbar style="background-color: #3e9acd" class="shadow-2 text-white"> <q-toolbar style="background-color: #3e9acd" class="shadow-2 text-white">
<q-btn-dropdown <q-btn-dropdown
v-if="false"
v-touch-hold:10000.mouse="handleHold" v-touch-hold:10000.mouse="handleHold"
:disable-dropdown="!show_advanced_menu" :disable-dropdown="!show_advanced_menu"
stretch stretch
@ -25,6 +26,24 @@
</q-item> </q-item>
</q-list> </q-list>
</q-btn-dropdown> </q-btn-dropdown>
<q-btn-dropdown
stretch
flat
icon="devices"
:label="$store.state.device_ip_address"
class="q-mr-sm"
>
<q-list>
<q-item clickable v-close-popup @click="logout">
<q-item-section avatar> <q-icon name="logout" /> </q-item-section>
<q-item-section>
{{ $t("logout") }}
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<q-separator vertical inset /> <q-separator vertical inset />
<q-btn <q-btn
@ -86,6 +105,26 @@
@click="lowerWindow" @click="lowerWindow"
/> />
<q-btn
stretch
flat
stack
icon="close"
:label="$t('close this window')"
class="q-mr-sm"
@click="closeCurrentWindow"
/>
<q-btn
stretch
flat
stack
icon="clear_all"
:label="$t('close all windwos')"
class="q-mr-sm"
@click="closeAllWindows"
/>
<q-btn <q-btn
stretch stretch
flat flat
@ -138,6 +177,18 @@
{{ $t("database export") }} {{ $t("database export") }}
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item
clickable
v-close-popup
@click="$refs.upgrade_dialog.showDialog()"
>
<q-item-section avatar>
<q-icon name="system_update" />
</q-item-section>
<q-item-section>
{{ $t("upgrade") }}
</q-item-section>
</q-item>
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
@ -163,23 +214,6 @@
{{ $store.state.fan_temp.toFixed(1) }} {{ $store.state.fan_temp.toFixed(1) }}
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator vertical inset />
<q-btn-dropdown
stretch
flat
icon="devices"
:label="$store.state.device_ip_address"
class="q-mr-sm"
>
<q-list>
<q-item clickable v-close-popup @click="logout">
<q-item-section avatar> <q-icon name="logout" /> </q-item-section>
<q-item-section>
{{ $t("logout") }}
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</q-toolbar> </q-toolbar>
</div> </div>
<grid-setting-dialog ref="grid_setting_dialog" /> <grid-setting-dialog ref="grid_setting_dialog" />
@ -311,6 +345,25 @@ export default defineComponent({
?.lowerWindow(window.window_id); ?.lowerWindow(window.window_id);
} }
}, },
closeCurrentWindow() {
const window = $store.state.windows.find(
(element) => element && element.uuid == $store.state.selected_window
);
if (window) {
GlobalData.getInstance()
.getCurrentClient()
?.closeWindow(window.window_id);
}
},
closeAllWindows() {
for (const window of $store.state.windows) {
if (window) {
GlobalData.getInstance()
.getCurrentClient()
?.closeWindow(window.window_id);
}
}
},
logout() { logout() {
SessionStorage.clear(); SessionStorage.clear();
window.location.reload(); window.location.reload();

View File

@ -671,6 +671,7 @@ export default defineComponent({
}, },
onWallGridsClick(e: MouseEvent) { onWallGridsClick(e: MouseEvent) {
e.stopPropagation();
EventBus.getInstance().emit(EventNamesDefine.UnSelectAllWindows); EventBus.getInstance().emit(EventNamesDefine.UnSelectAllWindows);
$store.commit("setSelectedWindow", ""); $store.commit("setSelectedWindow", "");
}, },