增加重置所有

This commit is contained in:
shefengchun 2023-01-14 17:00:48 +08:00
parent e76fc75f48
commit c52654e124
5 changed files with 117 additions and 356 deletions

View File

@ -2,130 +2,47 @@
<div class="row"> <div class="row">
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-8 q-pt-md"> <div class="col-8 q-pt-md">
<div <div ref="div" style="width: 100%; background-color: aquamarine; height: 100%">
ref="div"
style="width: 100%; background-color: aquamarine; height: 100%"
>
<div style="position: absolute"> <div style="position: absolute">
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[0]" v-if="isshowarray[0]" :w="30" :h="20" :x="point_postion[0].x"
:isActive="isactivearray[0]" :y="point_postion[0].y" @mousedown="isactivearray[0] = true" :isResizable="false"
v-if="isshowarray[0]" @moveHandler="moveHandler($event, 0)"><span>v1</span>
:w="30"
:h="20"
:x="point_postion[0].x"
:y="point_postion[0].y"
@mousedown="isactivearray[0] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 0)"
><span>v1</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[1]" v-if="isshowarray[1]" :w="30" :h="20" :x="point_postion[1].x"
:isActive="isactivearray[1]" :y="point_postion[1].y" @mousedown="isactivearray[1] = true" :isResizable="false"
v-if="isshowarray[1]" @moveHandler="moveHandler($event, 1)"><span>v2</span>
:w="30"
:h="20"
:x="point_postion[1].x"
:y="point_postion[1].y"
@mousedown="isactivearray[1] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 1)"
><span>v2</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[2]" v-if="isshowarray[2]" :w="30" :h="20" :x="point_postion[2].x"
:isActive="isactivearray[2]" :y="point_postion[2].y" @mousedown="isactivearray[2] = true" :isResizable="false"
v-if="isshowarray[2]" @moveHandler="moveHandler($event, 2)"><span>v3</span>
:w="30"
:h="20"
:x="point_postion[2].x"
:y="point_postion[2].y"
@mousedown="isactivearray[2] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 2)"
><span>v3</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[3]" v-if="isshowarray[3]" :w="30" :h="20" :x="point_postion[3].x"
:isActive="isactivearray[3]" :y="point_postion[3].y" @mousedown="isactivearray[3] = true" :isResizable="false"
v-if="isshowarray[3]" @moveHandler="moveHandler($event, 3)"><span>v4</span>
:w="30"
:h="20"
:x="point_postion[3].x"
:y="point_postion[3].y"
@mousedown="isactivearray[3] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 3)"
><span>v4</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[4]" v-if="isshowarray[4]" :w="30" :h="20" :x="point_postion[4].x"
:isActive="isactivearray[4]" :y="point_postion[4].y" @mousedown="isactivearray[4] = true" :isResizable="false"
v-if="isshowarray[4]" @moveHandler="moveHandler($event, 4)"><span>v5</span>
:w="30"
:h="20"
:x="point_postion[4].x"
:y="point_postion[4].y"
@mousedown="isactivearray[4] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 4)"
><span>v5</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[5]" v-if="isshowarray[5]" :w="30" :h="20" :x="point_postion[5].x"
:isActive="isactivearray[5]" :y="point_postion[5].y" @mousedown="isactivearray[5] = true" :isResizable="false"
v-if="isshowarray[5]" @moveHandler="moveHandler($event, 5)"><span>h1</span>
:w="30"
:h="20"
:x="point_postion[5].x"
:y="point_postion[5].y"
@mousedown="isactivearray[5] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 5)"
><span>h1</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[6]" v-if="isshowarray[6]" :w="30" :h="20" :x="point_postion[6].x"
:isActive="isactivearray[6]" :y="point_postion[6].y" @mousedown="isactivearray[6] = true" :isResizable="false"
v-if="isshowarray[6]" @moveHandler="moveHandler($event, 6)"><span>h2</span>
:w="30"
:h="20"
:x="point_postion[6].x"
:y="point_postion[6].y"
@mousedown="isactivearray[6] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 6)"
><span>h2</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[7]" v-if="isshowarray[7]" :w="30" :h="20" :x="point_postion[7].x"
:isActive="isactivearray[7]" :y="point_postion[7].y" @mousedown="isactivearray[7] = true" :isResizable="false"
v-if="isshowarray[7]" @moveHandler="moveHandler($event, 7)"><span>h3</span>
:w="30"
:h="20"
:x="point_postion[7].x"
:y="point_postion[7].y"
@mousedown="isactivearray[7] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 7)"
><span>h3</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[8]" v-if="isshowarray[8]" :w="30" :h="20" :x="point_postion[8].x"
:isActive="isactivearray[8]" :y="point_postion[8].y" @mousedown="isactivearray[8] = true" :isResizable="false"
v-if="isshowarray[8]" @moveHandler="moveHandler($event, 8)"><span>h4</span>
:w="30"
:h="20"
:x="point_postion[8].x"
:y="point_postion[8].y"
@mousedown="isactivearray[8] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 8)"
><span>h4</span>
</vue3ResizeDrag> </vue3ResizeDrag>
<vue3ResizeDrag <vue3ResizeDrag :isActive="isactivearray[9]" v-if="isshowarray[9]" :w="35" :h="20" :x="point_postion[9].x"
:isActive="isactivearray[9]" :y="point_postion[9].y" @mousedown="isactivearray[9] = true" :isResizable="false"
v-if="isshowarray[9]" @moveHandler="moveHandler($event, 9)"><span>h5</span>
:w="35"
:h="20"
:x="point_postion[9].x"
:y="point_postion[9].y"
@mousedown="isactivearray[9] = true"
:isResizable="false"
@moveHandler="moveHandler($event, 9)"
><span>h5</span>
</vue3ResizeDrag> </vue3ResizeDrag>
</div> </div>
</div> </div>
@ -136,22 +53,9 @@
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-2"></div>
<div class="col-8"> <div class="col-8">
<q-input <q-input @focus="isactivearray[0] = false" filled type="number" class="q-pt-md" :dense="true"
@focus="isactivearray[0] = false" v-model="value[0].y" label="y" lazy-rules />
filled <q-btn color="white" @click="reset(0)" text-color="black" :label="$t('reset') + ' v1'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[0].y"
label="y"
lazy-rules
/>
<q-btn
color="white"
@click="reset(0)"
text-color="black"
:label="$t('reset') + ' v1'"
/>
</div> </div>
</div> </div>
</div> </div>
@ -159,22 +63,9 @@
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-2"></div>
<div class="col-8"> <div class="col-8">
<q-input <q-input @focus="isactivearray[1] = false" filled type="number" class="q-pt-md" :dense="true"
@focus="isactivearray[1] = false" v-model="value[1].y" label="y" lazy-rules />
filled <q-btn color="white" @click="reset(1)" text-color="black" :label="$t('reset') + ' v2'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[1].y"
label="y"
lazy-rules
/>
<q-btn
color="white"
@click="reset(1)"
text-color="black"
:label="$t('reset') + ' v2'"
/>
</div> </div>
</div> </div>
</div> </div>
@ -182,22 +73,9 @@
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-2"></div>
<div class="col-8"> <div class="col-8">
<q-input <q-input @focus="isactivearray[2] = false" filled type="number" class="q-pt-md" :dense="true"
@focus="isactivearray[2] = false" v-model="value[2].y" label="y" lazy-rules />
filled <q-btn color="white" @click="reset(2)" text-color="black" :label="$t('reset') + ' v3'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[2].y"
label="y"
lazy-rules
/>
<q-btn
color="white"
@click="reset(2)"
text-color="black"
:label="$t('reset') + ' v3'"
/>
</div> </div>
</div> </div>
</div> </div>
@ -205,22 +83,9 @@
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-2"></div>
<div class="col-8"> <div class="col-8">
<q-input <q-input @focus="isactivearray[3] = false" filled type="number" class="q-pt-md" :dense="true"
@focus="isactivearray[3] = false" v-model="value[3].y" label="y" lazy-rules />
filled <q-btn color="white" @click="reset(3)" text-color="black" :label="$t('reset') + ' v4'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[3].y"
label="y"
lazy-rules
/>
<q-btn
color="white"
@click="reset(3)"
text-color="black"
:label="$t('reset') + ' v4'"
/>
</div> </div>
</div> </div>
</div> </div>
@ -228,22 +93,9 @@
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-2"></div>
<div class="col-8"> <div class="col-8">
<q-input <q-input @focus="isactivearray[4] = false" filled type="number" class="q-pt-md" :dense="true"
@focus="isactivearray[4] = false" v-model="value[4].y" label="y" lazy-rules />
filled <q-btn color="white" @click="reset(4)" text-color="black" :label="$t('reset') + ' v5'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[4].y"
label="y"
lazy-rules
/>
<q-btn
color="white"
@click="reset(4)"
text-color="black"
:label="$t('reset') + ' v5'"
/>
</div> </div>
</div> </div>
</div> </div>
@ -253,98 +105,33 @@
<div class="col-11"> <div class="col-11">
<div class="row"> <div class="row">
<div class="col-1"> <div class="col-1">
<q-input <q-input filled @focus="isactivearray[5] = false" type="number" class="q-pt-md" :dense="true"
filled v-model="value[5].x" label="x" lazy-rules />
@focus="isactivearray[5] = false" <q-btn color="white" @click="reset(5)" text-color="black" :label="$t('reset') + ' h1'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[5].x"
label="x"
lazy-rules
/>
<q-btn
color="white"
@click="reset(5)"
text-color="black"
:label="$t('reset') + ' h1'"
/>
</div> </div>
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-1"> <div class="col-1">
<q-input <q-input filled @focus="isactivearray[6] = false" type="number" class="q-pt-md" :dense="true"
filled v-model="value[6].x" label="x" lazy-rules />
@focus="isactivearray[6] = false" <q-btn color="white" @click="reset(6)" text-color="black" :label="$t('reset') + ' h2'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[6].x"
label="x"
lazy-rules
/>
<q-btn
color="white"
@click="reset(6)"
text-color="black"
:label="$t('reset') + ' h2'"
/>
</div> </div>
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-1"> <div class="col-1">
<q-input <q-input filled @focus="isactivearray[7] = false" type="number" class="q-pt-md" :dense="true"
filled v-model="value[7].x" label="x" lazy-rules />
@focus="isactivearray[7] = false" <q-btn color="white" @click="reset(7)" text-color="black" :label="$t('reset') + ' h3'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[7].x"
label="x"
lazy-rules
/>
<q-btn
color="white"
@click="reset(7)"
text-color="black"
:label="$t('reset') + ' h3'"
/>
</div> </div>
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-1"> <div class="col-1">
<q-input <q-input filled @focus="isactivearray[8] = false" type="number" class="q-pt-md" :dense="true"
filled v-model="value[8].x" label="x" lazy-rules />
@focus="isactivearray[8] = false" <q-btn color="white" @click="reset(8)" text-color="black" :label="$t('reset') + ' h4'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[8].x"
label="x"
lazy-rules
/>
<q-btn
color="white"
@click="reset(8)"
text-color="black"
:label="$t('reset') + ' h4'"
/>
</div> </div>
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-1"> <div class="col-1">
<q-input <q-input filled @focus="isactivearray[9] = false" type="number" class="q-pt-md" :dense="true"
filled v-model="value[9].x" label="x" lazy-rules />
@focus="isactivearray[9] = false" <q-btn color="white" @click="reset(9)" text-color="black" :label="$t('reset') + ' h5'" />
type="number"
class="q-pt-md"
:dense="true"
v-model="value[9].x"
label="x"
lazy-rules
/>
<q-btn
color="white"
@click="reset(9)"
text-color="black"
:label="$t('reset') + ' h5'"
/>
</div> </div>
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-1 q-pt-xl"> <div class="col-1 q-pt-xl">
@ -360,7 +147,9 @@
</div> </div>
</template> </template>
<style scoped></style> <style scoped>
</style>
<script lang="ts"> <script lang="ts">
import { import {
defineComponent, defineComponent,
@ -668,24 +457,26 @@ export default defineComponent({
onMounted(() => { onMounted(() => {
window.onresize = () => { window.onresize = () => {
return (() => { return (() => {
initialization(); if (div != null) {
Proportion.value.x = config.width / (div.value.offsetWidth - 25); initialization();
Proportion.value.y = config.height / (div.value.offsetHeight - 25); Proportion.value.x = config.width / (div.value.offsetWidth - 25);
let Width = (div.value.offsetWidth - 25) / 4; Proportion.value.y = config.height / (div.value.offsetHeight - 25);
let Height = (div.value.offsetHeight - 25) / 4; let Width = (div.value.offsetWidth - 25) / 4;
for ( let Height = (div.value.offsetHeight - 25) / 4;
let index = 0; for (
index < config.hor_density.length + config.ver_density.length; let index = 0;
index++ index < config.hor_density.length + config.ver_density.length;
) { index++
if (index < 5) { ) {
point_postion[index].y = default_location[index].y = if (index < 5) {
Height * index; point_postion[index].y = default_location[index].y =
point_postion[index].x = default_location[index].x = Width * 2; Height * index;
} else { point_postion[index].x = default_location[index].x = Width * 2;
point_postion[index].y = default_location[index].y = Height * 2; } else {
point_postion[index].x = default_location[index].x = point_postion[index].y = default_location[index].y = Height * 2;
Width * (index - 5); point_postion[index].x = default_location[index].x =
Width * (index - 5);
}
} }
} }
})(); })();

View File

@ -625,7 +625,7 @@ export default defineComponent({
window.onresize = () => { window.onresize = () => {
return (() => { return (() => {
ste_status.value = 1; ste_status.value = 1;
setpoa(); if(div!=null)setpoa();
setTimeout(() => { setTimeout(() => {
ste_status.value = 0; ste_status.value = 0;

View File

@ -1,15 +1,11 @@
<template> <template>
<q-dialog <q-dialog persistent v-model="show_dialog" @keydown="
persistent
v-model="show_dialog"
@keydown="
(evt: any) => { (evt: any) => {
if (evt.keyCode == 27) { if (evt.keyCode == 27) {
show_dialog = false; show_dialog = false;
} }
} }
" ">
>
<q-card class="" style="max-width: 90vw"> <q-card class="" style="max-width: 90vw">
<q-form> <q-form>
<q-card-section class="q-ma-none q-pa-sm"> <q-card-section class="q-ma-none q-pa-sm">
@ -19,14 +15,7 @@
</div> </div>
<q-space /> <q-space />
<q-btn <q-btn flat round icon="close" color="red" @click="clear()" v-close-popup>
flat
round
icon="close"
color="red"
@click="clear()"
v-close-popup
>
<q-tooltip> <q-tooltip>
{{ $t("close") }} {{ $t("close") }}
</q-tooltip> </q-tooltip>
@ -38,36 +27,25 @@
<q-separator /> <q-separator />
<!-- height: 80vh --> <!-- height: 80vh -->
<q-card-section class="scroll" style="width: 80vw"> <q-card-section class="scroll" style="width: 80vw">
<div <div class="row" style="border: 1px solid #b0bec5; text-align: center">
class="row"
style="border: 1px solid #b0bec5; text-align: center"
>
<div class="col-3" style="border-right: 1px solid #b0bec5"> <div class="col-3" style="border-right: 1px solid #b0bec5">
<p class="text-center">{{ $t("Projector") }}</p> <p class="text-center">{{ $t("Projector") }}</p>
<!-- row 在前col在后 --> <!-- row 在前col在后 -->
<div v-for="(item, index_row) in config.row"> <div v-for="(item, index_row) in config.row">
<projector-item <projector-item v-for="(item, index_col) in config.col" class="w-100" :llabel="
v-for="(item, index_col) in config.col" $t('Projector') + (index_row * config.col + index_col + 1)
class="w-100" " :lvalue="index_row + '/' + index_col"></projector-item>
:llabel="
$t('Projector') + (index_row * config.col + index_col + 1)
"
:lvalue="index_row + '/' + index_col"
></projector-item>
</div> </div>
<div class="col-12" style="text-align: center"> <div class="col-12" style="text-align: center">
{{ $t("Whether to enable integration") {{
$t("Whether to enable integration")
}}<q-checkbox v-model="EnableBlending" /> }}<q-checkbox v-model="EnableBlending" />
</div> </div>
</div> </div>
<div class="col-9"> <div class="col-9">
<div class="q-ta-md"> <div class="q-ta-md">
<q-btn-toggle <q-btn-toggle :disable="!$store.state.enablefusion" no-caps v-model="options" toggle-color="primary"
:disable="!$store.state.enablefusion"
no-caps
v-model="options"
toggle-color="primary"
:options="[ :options="[
{ label: $t('FusionLocale'), value: 'FusionLocale' }, { label: $t('FusionLocale'), value: 'FusionLocale' },
{ {
@ -83,11 +61,10 @@
value: 'DensityCorrection', value: 'DensityCorrection',
}, },
// { label: $t('GridSettings'), value: 'GridSettings' }, // { label: $t('GridSettings'), value: 'GridSettings' },
]" ]" />
/>
</div> </div>
<div style="min-height: 72vh"> <div style="min-height: 72vh">
<component :is="options" /> <component :is="options" />
</div> </div>
</div> </div>
</div> </div>
@ -96,29 +73,14 @@
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions align="right">
<span>{{ $t("Whether to hide the desktop") }}</span <span>{{ $t("Whether to hide the desktop") }}</span><q-checkbox style="justify-content: flex-start"
><q-checkbox v-model="hide_desktop_value" @click="send_hide_desktop" />
style="justify-content: flex-start" <div class="q-space" data-v-39efcd1f=""></div>
v-model="hide_desktop_value" <q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall config')" />
@click="send_hide_desktop"
/>
<div class="q-space" data-v-39efcd1f=""></div> <div class="q-space" data-v-39efcd1f=""></div>
<q-btn <q-btn flat :label="$t('Cancel')" no-caps color="primary" v-close-popup
flat @click="$store.commit('setSelectedProjector', '0/0')" />
:label="$t('Cancel')" <q-btn flat :label="$t('save config')" no-caps color="primary" @click="save" v-close-popup />
no-caps
color="primary"
v-close-popup
@click="$store.commit('setSelectedProjector', '0/0')"
/>
<q-btn
flat
:label="$t('save config')"
no-caps
color="primary"
@click="save"
v-close-popup
/>
</q-card-actions> </q-card-actions>
</q-form> </q-form>
</q-card> </q-card>
@ -182,6 +144,9 @@ export default defineComponent({
const send_hide_desktop = () => { const send_hide_desktop = () => {
set?.SetBlendingOption(0, hide_desktop_value.value ? 1 : 0); set?.SetBlendingOption(0, hide_desktop_value.value ? 1 : 0);
}; };
const resetall=()=>{
set?.ResetBlendingConfig()
}
const config = ref({ col: 0, row: 0 }); const config = ref({ col: 0, row: 0 });
const EnableBlending = ref(false); const EnableBlending = ref(false);
let optionsstr = ref(); let optionsstr = ref();
@ -230,13 +195,12 @@ export default defineComponent({
}; };
const getconfig = () => { const getconfig = () => {
try { try {
set?.GetBlendingConfig("").then((res) => {});
set?.GetBlendingConfig("").then((res) => { set?.GetBlendingConfig("").then((res) => {
let tmp = JSON.parse(res ? res.config : ""); let tmp = JSON.parse(res ? res.config : "");
$store.commit("setEnablefusion", tmp.enable); $store.commit("setEnablefusion", tmp.enable);
$store.commit("setfusion_configuration", res?.config); $store.commit("setfusion_configuration", res?.config);
}); });
} catch (error) {} } catch (error) { }
}; };
const clear = () => { const clear = () => {
$store.commit("setSelectedProjector", "0/0"); $store.commit("setSelectedProjector", "0/0");
@ -266,11 +230,14 @@ export default defineComponent({
}, 1000); }, 1000);
}); });
onMounted(() => { onMounted(() => {
set?.GetBlendingConfig("").then((res) => { setTimeout(() => {
set?.GetBlendingConfig("").then((res) => {
let tmp = JSON.parse(res ? res.config : ""); let tmp = JSON.parse(res ? res.config : "");
hide_desktop_id.value = tmp.options[0]; hide_desktop_id.value = tmp.options[0];
hide_desktop_value.value = tmp.options[1] == 0 ? false : true; hide_desktop_value.value = tmp.options[1] == 0 ? false : true;
console.log(tmp)
}); });
}, 1000);
}); });
return { return {
send_hide_desktop, send_hide_desktop,
@ -283,6 +250,7 @@ export default defineComponent({
EnableBlending, EnableBlending,
config, config,
save, save,
resetall
}; };
}, },
}); });

View File

@ -424,5 +424,6 @@ export default {
"resetall":"reset all", "resetall":"reset all",
"save config":"save config", "save config":"save config",
"Whether to enable integration":"Whether to enable integration", "Whether to enable integration":"Whether to enable integration",
"Whether to hide the desktop":"Whether to hide the desktop" "Whether to hide the desktop":"Whether to hide the desktop",
"resetall config":"resetall config",
}; };

View File

@ -693,5 +693,6 @@ export default {
"resetall":"重置所有", "resetall":"重置所有",
"save config":"保存配置", "save config":"保存配置",
"Whether to enable integration":"是否启用融合", "Whether to enable integration":"是否启用融合",
"Whether to hide the desktop":"是否隐藏桌面" "Whether to hide the desktop":"是否隐藏桌面",
"resetall config":"重置所有配置",
}; };