修复切换投影仪时发送数据

This commit is contained in:
shefengchun 2023-02-08 17:51:10 +08:00
parent 063d9d8652
commit b00fb02efb
5 changed files with 54 additions and 36 deletions

View File

@ -4,30 +4,30 @@
<div class="col-8 q-pt-md">
<div ref="div" style="width: 100%; background-color: #646464; height: 100%">
<div style="position: absolute">
<Vue3DraggableResizable :class="[options_model_v==index?'action':'']" v-for="(item, index) in config.ver_density.length" :initW="20" :initH="20"
<Vue3DraggableResizable :class="[options_model_v==index?'action':'point']" v-for="(item, index) in config.ver_density.length" :initW="20" :initH="20"
:resizable="false" :x="0" v-model:y="point_postion[index].y" :disabledX="true"
@activated="now_index = index" @dragging="dragStartHandle($event, index, 'v')">
@activated="now_index =options_model_v= index" @click="options_model_v = index" @dragging="dragStartHandle($event, index, 'v')">
<span>v{{
index+ 1
}}</span>
</Vue3DraggableResizable>
<Vue3DraggableResizable :class="[options_model_v==index?'action':'']" v-for="(item, index) in config.ver_density.length" :initW="20" :initH="20"
:resizable="false" :x="max_x_y[0]" v-model:y="point_postion[index].y" @activated="now_index = index"
<Vue3DraggableResizable :class="[options_model_v==index?'action':'point']" v-for="(item, index) in config.ver_density.length" :initW="20" :initH="20"
:resizable="false" :x="max_x_y[0]" @click="options_model_v = index" v-model:y="point_postion[index].y" @activated="now_index =options_model_v= index"
@dragging="dragStartHandle($event, index, 'v')">
<span>v{{
index+ 1
}}</span>
</Vue3DraggableResizable>
<Vue3DraggableResizable :class="[options_model_h==index+5?'action':'']" v-for="(item, index) in config.hor_density.length" :initW="20" :initH="20"
:resizable="false" v-model:x="point_postion[index + 5].x" :y="-20" @activated="now_index = index + 5"
:disabledY="true" @dragging="dragStartHandle($event, index + 5, 'h')">
<Vue3DraggableResizable :class="[options_model_h==index+5?'action':'point']" v-for="(item, index) in config.hor_density.length" :initW="20" :initH="20"
:resizable="false" v-model:x="point_postion[index + 5].x" :y="-20" @activated="now_index =options_model_h = index + 5"
:disabledY="true" @click="options_model_h = index+5 " @dragging="dragStartHandle($event, index, 'h')">
<span>h{{
index+ 1
}}</span>
</Vue3DraggableResizable>
<Vue3DraggableResizable :class="[options_model_h==index+5?'action':'']" v-for="(item, index) in config.hor_density.length" :initW="20" :initH="20"
:resizable="false" v-model:x="point_postion[index + 5].x" @activated="now_index = index + 5"
:y="max_x_y[1] + 20" @dragging="dragStartHandle($event, index + 5, 'h')">
<Vue3DraggableResizable :class="[options_model_h==index+5?'action':'point']" v-for="(item, index) in config.hor_density.length" :initW="20" :initH="20"
:resizable="false" v-model:x="point_postion[index + 5].x" @activated="now_index =options_model_h= index + 5"
:y="max_x_y[1] + 20" @click="options_model_h = index+5" @dragging="dragStartHandle($event, index, 'h')">
<span>h{{
index+ 1
}}</span>
@ -42,7 +42,7 @@
<div class="col-2"></div>
<div class="col-8">
<q-input filled type="number" class="q-pt-md" :dense="true" v-model="value[index].y"
@update:model-value="chang(index, $event)" label="y" lazy-rules />
@update:model-value="chang(index, $event,'v')" label="y" lazy-rules />
<q-btn size="sm" color="white" @click="reset(index)" text-color="black"
:label="$t('reset') + `v${index + 1}`" />
</div>
@ -55,7 +55,7 @@
<div class="box">
<div class="box_son" v-for="(item, index) in 5">
<q-input filled type="number" class="q-pt-md" :dense="true" v-model="value[index + 5].x" label="x"
@update:model-value="chang(index + 5, $event)" lazy-rules />
@update:model-value="chang(index + 5, $event,'h')" lazy-rules />
<q-btn size="sm" color="white" @click="reset(index + 5)" text-color="black"
:label="$t('reset') + `h${index + 1}`" />
</div>
@ -68,10 +68,10 @@
<div>
<div class="row">
<div class="col-1"></div>
<div class="col-2"> <q-select class="q-pt-md" label="水平" :dense="true" filled v-model="options_model_v" :options="options_v" emit-value
<div class="col-2"> <q-select class="q-pt-md" :label="$t('level')" :dense="true" filled v-model="options_model_v" :options="options_v" emit-value
map-options /></div>
<div class="col-2"> <q-input filled type="number" class="q-pt-md" :dense="true"
v-model="value[options_model_v].y" @update:model-value="chang(options_model_v, $event)" lazy-rules />
v-model="value[options_model_v].y" @update:model-value="chang(options_model_v, $event,'v')" lazy-rules />
</div>
<div class="q-pt-md">
<q-btn color="white" @click="reset(options_model_v)" text-color="black" :label="$t('reset')" />
@ -79,13 +79,13 @@
</div>
<div class="row">
<div class="col-1"></div>
<div class="col-2"> <q-select class="q-pt-md" label="垂直" :dense="true" filled v-model="options_model_h" :options="options_h" emit-value
<div class="col-2"> <q-select class="q-pt-md" :label="$t('vertical')" :dense="true" filled v-model="options_model_h" :options="options_h" emit-value
map-options /></div>
<div class="col-2"> <q-input filled type="number" class="q-pt-md" :dense="true"
v-model="value[options_model_h].x" @update:model-value="chang(options_model_h, $event)" lazy-rules />
v-model="value[options_model_h].x" @update:model-value="chang(options_model_h, $event,'h')" lazy-rules />
</div>
<div class="q-pt-md">
<q-btn color="white" @click="reset(options_model_v)" text-color="black" :label="$t('reset')" />
<q-btn color="white" @click="reset(options_model_h)" text-color="black" :label="$t('reset')" />
</div>
</div>
@ -119,7 +119,12 @@
}
.action {
background-color: aqua;
background-color: rgb(27, 180, 111);
border-radius: 50%;
}
.point{
background-color: rgb(186, 245, 245);
border-radius: 50%;
}
</style>
<script lang="ts">
@ -201,17 +206,19 @@ export default defineComponent({
const set_cache: any = ref([]);
const ste_status = ref(0);
const chang = (index: number, $event: any) => {
const chang = (index: number, $event: any,type:string) => {
let x = 0
let y = 0
if (index < 5) {
if (type=='v') {
x = default_location[9].y;
y = Math.ceil((config.height - $event) / Proportion.value.y);
send_configuration(index, $event,'v')
options_model_v.value=index
} else {
x = Math.ceil($event / Proportion.value.x);
y = default_location[0].x;
send_configuration(index-5, $event,'h')
send_configuration(index, $event,'h')
options_model_h.value=index
}
point_postion[index].x = Number(x)
point_postion[index].y = Number(y)
@ -249,7 +256,7 @@ export default defineComponent({
sessionStorage.DensityCorrection = JSON.stringify(set_cache.value);
});
watch(() => now_index, (newval, oldval) => {
now_index.value > 5 ? set?.SetBlendingOption("blending_grids_select_point", `density_h:${now_index.value - 4}`) : set?.SetBlendingOption("blending_grids_select_point", `density_v:${now_index.value + 1}`)
now_index.value > 4 ? set?.SetBlendingOption("blending_grids_select_point", `density_h:${now_index.value - 4}`) : set?.SetBlendingOption("blending_grids_select_point", `density_v:${now_index.value + 1}`)
}, { deep: true })
watch(
() => configselsect,
@ -450,7 +457,7 @@ export default defineComponent({
set?.SetBlendingVerDensity(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
index + 1,
index+1,
Number(value)
);
}
@ -458,7 +465,7 @@ export default defineComponent({
set?.SetBlendingHorDensity(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
index -4,
index-4,
Number(value)
);
}
@ -471,7 +478,7 @@ export default defineComponent({
let obj_y = $event.y
if (type == 'h') {
let x =
config.width / 4 * (index - 5) +
Math.ceil(
(obj_x - default_location[index].x) * Proportion.value.x
);
@ -481,7 +488,8 @@ export default defineComponent({
Math.ceil(
(obj_y - default_location[index].y) * Proportion.value.y
);
value[index].x = x > config.width ? config.width : x && x < 0 ? 0 : x;
console.log(index, x,'h')
value[index+5].x = x > config.width ? config.width : x && x < 0 ? 0 : x;
send_configuration(index, x,'h')
}
if (type == 'v') {

View File

@ -449,6 +449,7 @@ export default defineComponent({
{ deep: true }
);
watch(() => now_index, (newval, oldval) => {
if(ste_status.value == 1)return
set?.SetBlendingOption("blending_grids_select_point", `4:${now_index.value + 1}`)
}, { deep: true })
//

View File

@ -289,6 +289,7 @@ export default defineComponent({
);
const chang = (type: string) => {
if(ste_status.value == 1)return
if (type == "alpha") {
if ($store.state.enablefusion)
set?.setBlendingAlphaParam(
@ -384,7 +385,11 @@ export default defineComponent({
}
};
onMounted(() => {
ste_status.value = 1;
startconfig();
setTimeout(() => {
ste_status.value = 0;
}, 100);
}),
onBeforeUnmount(() => {
sessionStorage.FusionLocale = JSON.stringify(set_cache.value);
@ -393,7 +398,7 @@ export default defineComponent({
watch(
() => array[0].value,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
@ -409,7 +414,7 @@ export default defineComponent({
watch(
() => array[1].value,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
@ -425,7 +430,7 @@ export default defineComponent({
watch(
() => array[2].value,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
@ -441,7 +446,7 @@ export default defineComponent({
watch(
() => array[3].value,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
@ -458,7 +463,7 @@ export default defineComponent({
watch(
() => array[0].isshow,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
@ -473,7 +478,7 @@ export default defineComponent({
watch(
() => array[1].isshow,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
@ -489,7 +494,7 @@ export default defineComponent({
watch(
() => array[2].isshow,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],
@ -505,7 +510,7 @@ export default defineComponent({
watch(
() => array[3].isshow,
(newVal, oldVal) => {
if ($store.state.enablefusion)
if ($store.state.enablefusion&&ste_status.value==0)
set?.SetBlendingOverlap(
$store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1],

View File

@ -450,5 +450,7 @@ export default {
"Please enter a value within the range":"Please enter a value within the range",
"vertical correction":"vertical correction",
"horizontal correction":"horizontal correction",
"line width":"line width"
"line width":"line width",
"level":"level",
"vertical":"vertical"
};

View File

@ -719,5 +719,7 @@ export default {
"Please enter a value within the range":"请输入范围内的值",
"vertical correction":"垂直校正",
"horizontal correction":"水平校正",
"line width":"线宽"
"line width":"线宽",
"level":"水平",
"vertical":"垂直"
};