增加重置所有

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="col-1"></div>
<div class="col-8 q-pt-md">
<div
ref="div"
style="width: 100%; background-color: aquamarine; height: 100%"
>
<div ref="div" style="width: 100%; background-color: aquamarine; height: 100%">
<div style="position: absolute">
<vue3ResizeDrag
:isActive="isactivearray[0]"
v-if="isshowarray[0]"
: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 :isActive="isactivearray[0]" v-if="isshowarray[0]" :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
:isActive="isactivearray[1]"
v-if="isshowarray[1]"
: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 :isActive="isactivearray[1]" v-if="isshowarray[1]" :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
:isActive="isactivearray[2]"
v-if="isshowarray[2]"
: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 :isActive="isactivearray[2]" v-if="isshowarray[2]" :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
:isActive="isactivearray[3]"
v-if="isshowarray[3]"
: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 :isActive="isactivearray[3]" v-if="isshowarray[3]" :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
:isActive="isactivearray[4]"
v-if="isshowarray[4]"
: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 :isActive="isactivearray[4]" v-if="isshowarray[4]" :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
:isActive="isactivearray[5]"
v-if="isshowarray[5]"
: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 :isActive="isactivearray[5]" v-if="isshowarray[5]" :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
:isActive="isactivearray[6]"
v-if="isshowarray[6]"
: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 :isActive="isactivearray[6]" v-if="isshowarray[6]" :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
:isActive="isactivearray[7]"
v-if="isshowarray[7]"
: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 :isActive="isactivearray[7]" v-if="isshowarray[7]" :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
:isActive="isactivearray[8]"
v-if="isshowarray[8]"
: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 :isActive="isactivearray[8]" v-if="isshowarray[8]" :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
:isActive="isactivearray[9]"
v-if="isshowarray[9]"
: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 :isActive="isactivearray[9]" v-if="isshowarray[9]" :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>
</div>
</div>
@ -136,22 +53,9 @@
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<q-input
@focus="isactivearray[0] = false"
filled
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'"
/>
<q-input @focus="isactivearray[0] = false" filled 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>
@ -159,22 +63,9 @@
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<q-input
@focus="isactivearray[1] = false"
filled
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'"
/>
<q-input @focus="isactivearray[1] = false" filled 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>
@ -182,22 +73,9 @@
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<q-input
@focus="isactivearray[2] = false"
filled
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'"
/>
<q-input @focus="isactivearray[2] = false" filled 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>
@ -205,22 +83,9 @@
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<q-input
@focus="isactivearray[3] = false"
filled
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'"
/>
<q-input @focus="isactivearray[3] = false" filled 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>
@ -228,22 +93,9 @@
<div class="row">
<div class="col-2"></div>
<div class="col-8">
<q-input
@focus="isactivearray[4] = false"
filled
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'"
/>
<q-input @focus="isactivearray[4] = false" filled 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>
@ -253,98 +105,33 @@
<div class="col-11">
<div class="row">
<div class="col-1">
<q-input
filled
@focus="isactivearray[5] = false"
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'"
/>
<q-input filled @focus="isactivearray[5] = false" 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 class="col-1"></div>
<div class="col-1">
<q-input
filled
@focus="isactivearray[6] = false"
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'"
/>
<q-input filled @focus="isactivearray[6] = false" 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 class="col-1"></div>
<div class="col-1">
<q-input
filled
@focus="isactivearray[7] = false"
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'"
/>
<q-input filled @focus="isactivearray[7] = false" 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 class="col-1"></div>
<div class="col-1">
<q-input
filled
@focus="isactivearray[8] = false"
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'"
/>
<q-input filled @focus="isactivearray[8] = false" 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 class="col-1"></div>
<div class="col-1">
<q-input
filled
@focus="isactivearray[9] = false"
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'"
/>
<q-input filled @focus="isactivearray[9] = false" 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 class="col-1"></div>
<div class="col-1 q-pt-xl">
@ -360,7 +147,9 @@
</div>
</template>
<style scoped></style>
<style scoped>
</style>
<script lang="ts">
import {
defineComponent,
@ -668,24 +457,26 @@ export default defineComponent({
onMounted(() => {
window.onresize = () => {
return (() => {
initialization();
Proportion.value.x = config.width / (div.value.offsetWidth - 25);
Proportion.value.y = config.height / (div.value.offsetHeight - 25);
let Width = (div.value.offsetWidth - 25) / 4;
let Height = (div.value.offsetHeight - 25) / 4;
for (
let index = 0;
index < config.hor_density.length + config.ver_density.length;
index++
) {
if (index < 5) {
point_postion[index].y = default_location[index].y =
Height * index;
point_postion[index].x = default_location[index].x = Width * 2;
} else {
point_postion[index].y = default_location[index].y = Height * 2;
point_postion[index].x = default_location[index].x =
Width * (index - 5);
if (div != null) {
initialization();
Proportion.value.x = config.width / (div.value.offsetWidth - 25);
Proportion.value.y = config.height / (div.value.offsetHeight - 25);
let Width = (div.value.offsetWidth - 25) / 4;
let Height = (div.value.offsetHeight - 25) / 4;
for (
let index = 0;
index < config.hor_density.length + config.ver_density.length;
index++
) {
if (index < 5) {
point_postion[index].y = default_location[index].y =
Height * index;
point_postion[index].x = default_location[index].x = Width * 2;
} else {
point_postion[index].y = default_location[index].y = Height * 2;
point_postion[index].x = default_location[index].x =
Width * (index - 5);
}
}
}
})();

View File

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

View File

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

View File

@ -424,5 +424,6 @@ export default {
"resetall":"reset all",
"save config":"save config",
"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":"重置所有",
"save config":"保存配置",
"Whether to enable integration":"是否启用融合",
"Whether to hide the desktop":"是否隐藏桌面"
"Whether to hide the desktop":"是否隐藏桌面",
"resetall config":"重置所有配置",
};