调试模式无论如何开放输出板设置

This commit is contained in:
fangxiang 2022-08-30 10:26:10 +08:00
parent d203a7d1f5
commit d68a776a36
4 changed files with 49 additions and 3 deletions

View File

@ -105,6 +105,43 @@ export default defineComponent({
console.log(e); console.log(e);
} }
EventBus.getInstance().on(EventNamesDefine.CheckDebug, () => {
const to_normal_url = () => {
const p1 = window.location.href.indexOf("?debug");
const p2 = window.location.href.indexOf("#");
const p3 = window.location.href.substring(0, p1);
const p4 = window.location.href.substring(p2);
window.location.href = p3 + p4;
};
if ($store.state.advanced_debug) {
const pwd = Math.floor(Math.random() * (999999 - 100000 + 1) + 100000);
$q.dialog({
title: "PWD?",
message: pwd + "?",
prompt: {
model: "",
type: "text", // optional
},
persistent: true,
cancel: true,
})
.onOk((data: string) => {
try {
const v = parseInt(data.replace(/-/g, "").trim());
if (pwd * pwd * pwd * new Date().getUTCHours() == v) {
return;
}
} catch (e) {
console.log(e);
}
to_normal_url();
})
.onCancel(() => {
to_normal_url();
});
}
});
window.onresize = (evt: any) => window.onresize = (evt: any) =>
EventBus.getInstance().emit(EventNamesDefine.WindowResize, evt); EventBus.getInstance().emit(EventNamesDefine.WindowResize, evt);

View File

@ -35,4 +35,5 @@ export namespace EventNamesDefine {
export const DropToWall = "onDropToWall"; export const DropToWall = "onDropToWall";
export const RefreshJointActionEquipmentList = export const RefreshJointActionEquipmentList =
"onRefreshJointActionEquipmentList"; "onRefreshJointActionEquipmentList";
export const CheckDebug = "CheckDebug";
} }

View File

@ -56,7 +56,7 @@
:disable="loading" :disable="loading"
/> />
<q-tab <q-tab
v-if="$store.state.isLedPlayer()" v-if="$store.state.isLedPlayer() || $store.state.advanced_debug"
name="graphics" name="graphics"
no-caps no-caps
icon="img:new_icon/graphics_setting.png" icon="img:new_icon/graphics_setting.png"
@ -82,7 +82,9 @@
:disable="loading" :disable="loading"
/> />
<q-tab <q-tab
v-if="function_output_board_attribute" v-if="
function_output_board_attribute || $store.state.advanced_debug
"
name="output_board" name="output_board"
no-caps no-caps
icon="save" icon="save"
@ -767,7 +769,9 @@
<q-tab-panel <q-tab-panel
name="output_board" name="output_board"
class="_panel" class="_panel"
v-if="function_output_board_attribute" v-if="
function_output_board_attribute || $store.state.advanced_debug
"
> >
<q-card class="fit"> <q-card class="fit">
<q-card-section> <q-card-section>

View File

@ -143,6 +143,10 @@ export default defineComponent({
show_back.value = true; show_back.value = true;
}); });
if ($store.state.advanced_debug) {
EventBus.getInstance().emit(EventNamesDefine.CheckDebug);
}
return { return {
landspace, landspace,
show_back, show_back,