加入鼠标滚轮交互

This commit is contained in:
shefengchun 2023-02-22 14:33:47 +08:00
parent ba2594addf
commit 52c375fc7d
5 changed files with 207 additions and 18 deletions

View File

@ -63,10 +63,10 @@
<div class="row" v-show="now_v_h == 'vertical'"> <div class="row" v-show="now_v_h == 'vertical'">
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-3 q-px-md"> <q-select class="q-pt-md " :label="$t('vertical')" <div class="col-3 q-px-md" @mousewheel="details_selsect_v"> <q-select class="q-pt-md " :label="$t('vertical')"
@update:model-value="(val) => { options_v = val }" :dense="true" filled v-model="options_model_v" @update:model-value="(val) => { options_v = val }" :dense="true" filled v-model="options_model_v"
:options="options_v" emit-value map-options /></div> :options="options_v" emit-value map-options /></div>
<div class="col-3 q-px-md"> <q-input v-if="value_v[options_model_v]" filled type="number" class="q-pt-md" <div class="col-3 q-px-md" @mousewheel="details_selsect_val($event,'v')" > <q-input v-if="value_v[options_model_v]" filled type="number" class="q-pt-md"
:dense="true" v-model="value_v[options_model_v].y" @update:model-value="chang(options_model_v, $event, 'v')" :dense="true" v-model="value_v[options_model_v].y" @update:model-value="chang(options_model_v, $event, 'v')"
lazy-rules /> lazy-rules />
</div> </div>
@ -90,10 +90,10 @@
<div class="row" v-show="now_v_h == 'level'"> <div class="row" v-show="now_v_h == 'level'">
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-3 q-px-md"> <q-select class="q-pt-md" :label="$t('level')" <div class="col-3 q-px-md" @mousewheel="details_selsect_h"> <q-select class="q-pt-md" :label="$t('level')"
@update:model-value="(val) => { options_h = val }" :dense="true" filled v-model="options_model_h" @update:model-value="(val) => { options_h = val }" :dense="true" filled v-model="options_model_h"
:options="options_h" emit-value map-options /></div> :options="options_h" emit-value map-options /></div>
<div class="col-3 q-px-md"> <q-input v-if="value_h[options_model_h]" filled type="number" class="q-pt-md" <div class="col-3 q-px-md" @mousewheel="details_selsect_val($event,'h')"> <q-input v-if="value_h[options_model_h]" filled type="number" class="q-pt-md"
:dense="true" v-model="value_h[options_model_h].x" @update:model-value="chang(options_model_h, $event, 'h')" :dense="true" v-model="value_h[options_model_h].x" @update:model-value="chang(options_model_h, $event, 'h')"
lazy-rules /> lazy-rules />
</div> </div>
@ -893,6 +893,71 @@ export default defineComponent({
let tmp = now_v_h.value == "vertical" ? "v" : "h" let tmp = now_v_h.value == "vertical" ? "v" : "h"
add_control_points(Number(now_amount.value), tmp); add_control_points(Number(now_amount.value), tmp);
} }
/**
* 滚轮切换
* @param details
*/
const details_selsect_v=(details:any) => {
let spt=details.deltaY/100
if(spt>0){
if(options_model_v.value>=value_v_point.value.length-1){
options_model_v.value=0
}else{
options_model_v.value++
}
}else{
if(options_model_v.value<=0){
options_model_v.value=value_v_point.value.length-1
}else{
options_model_v.value--
}
}
}
const details_selsect_h=(details:any) => {
let spt=details.deltaY/100
if(spt>0){
if(options_model_h.value>=value_h_point.value.length-1){
options_model_h.value=0
}else{
options_model_h.value++
}
}else{
if(options_model_h.value<=0){
options_model_h.value=value_h_point.value.length-1
}else{
options_model_h.value--
}
}
}
/**
* v数据
*/
const details_selsect_val = (details: any, type: string) => {
let spt = details.deltaY / 100
switch (type) {
case 'v':
if (spt > 0) {
value_v.value[options_model_v.value].y++
} else {
value_v.value[options_model_v.value].y--
}
chang(options_model_v.value,value_v.value[options_model_v.value].y,"v")
break;
default:
if (spt > 0) {
value_h.value[options_model_h.value].x++
} else {
value_h.value[options_model_h.value].x--
}
chang(options_model_h.value,value_h.value[options_model_h.value].x,"h")
break;
}
}
defineExpose({ defineExpose({
now_v_h, now_v_h,
options_model_v, options_model_v,
@ -930,7 +995,10 @@ export default defineComponent({
add_dialog, add_dialog,
now_amount, now_amount,
set_cache, set_cache,
resetall_all resetall_all,
details_selsect_h,
details_selsect_v,
details_selsect_val
} }
} }
}) })

View File

@ -19,15 +19,15 @@
<div> <div>
<div class="row"> <div class="row">
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-2 q-px-md"> <q-select class="q-pt-md" :label="$t('point')" :dense="true" filled <div class="col-2 q-px-md" @mouseenter="is_active=true" @mousewheel="details_selsect"> <q-select class="q-pt-md" :label="$t('point')" :dense="true" filled
v-model="options_model" @update:model-value="(val) => { options_model = val }" :options="options" emit-value v-model="options_model" @update:model-value="(val) => { options_model = val }" :options="options" emit-value
map-options /></div> map-options /></div>
<div class="col-2 q-px-md"> <q-input filled type="number" class="q-pt-md" :dense="true" <div class="col-2 q-px-md" @mousewheel="details_selsect_val($event,'x')"> <q-input filled type="number" class="q-pt-md" :dense="true"
v-model="value[options_model].x" @update:model-value="chang(options_model, $event, 'h')" label="x" v-model="value[options_model].x" @update:model-value="chang(options_model, $event, 'h')" label="x"
lazy-rules /> lazy-rules />
</div> </div>
<div class="col-2 q-px-md"> <q-input filled type="number" class="q-pt-md" :dense="true" <div class="col-2 q-px-md" @mousewheel="details_selsect_val($event,'y')"> <q-input filled type="number" class="q-pt-md" :dense="true"
v-model="value[options_model].y" @update:model-value="chang(options_model, $event, 'h')" label="y" v-model="value[options_model].y" @update:model-value="chang(options_model, $event, 'h')" label="y"
lazy-rules /></div> lazy-rules /></div>
<div class="q-pt-md col-2"> <div class="q-pt-md col-2">
@ -358,10 +358,61 @@ export default defineComponent({
} }
} }
/**
* 滚轮切换
* @param details
*/
const is_active=ref(false);
const details_selsect=(details:any) => {
if(is_active){
let spt=details.deltaY/100
if(spt>0){
if(options_model.value>=value_point.value.length-1){
options_model.value=0
}else{
options_model.value++
}
}else{
if(options_model.value<=1){
options_model.value=value_point.value.length-1
}else{
options_model.value--
}
}
}
}
/**
* 滚轮改变数据
*/
const details_selsect_val = (details: any, type: string) => {
let spt = details.deltaY / 100
switch (type) {
case 'x':
if (spt > 0) {
value.value[options_model.value].x++
} else {
value.value[options_model.value].x--
}
break;
default:
if (spt > 0) {
value.value[options_model.value].y++
} else {
value.value[options_model.value].y--
}
break;
}
chang(options_model.value,"","")
}
defineExpose({ defineExpose({
options_model, options_model,
}); });
return { return {
is_active,
details_selsect,
resetall, resetall,
div, div,
max, max,
@ -374,7 +425,8 @@ export default defineComponent({
reset, reset,
value_point_amount, value_point_amount,
chang_point_amount, chang_point_amount,
options options,
details_selsect_val
} }
} }
}) })

View File

@ -257,6 +257,7 @@ export default defineComponent({
const save_set_cache = () => { const save_set_cache = () => {
set_cache.value[selectedprojector.value] = JSON.stringify(array); set_cache.value[selectedprojector.value] = JSON.stringify(array);
}; };
let config = JSON.parse($store.state.fusion_configuration).projectors[0]; let config = JSON.parse($store.state.fusion_configuration).projectors[0];
const configselsect = computed(() => { const configselsect = computed(() => {
return $store.state.selected_projector; return $store.state.selected_projector;
@ -387,11 +388,18 @@ export default defineComponent({
} }
}; };
onMounted(() => { onMounted(() => {
ste_status.value = 1; set?.GetBlendingConfig("").then((res) => {
startconfig(); let tmp = JSON.parse(res ? res.config : "");
setTimeout(() => { config = tmp.projectors[0];
ste_status.value = 1;
startconfig();
setTimeout(() => {
ste_status.value = 0; ste_status.value = 0;
}, 100); }, 100);
})
}), }),
onBeforeUnmount(() => { onBeforeUnmount(() => {
sessionStorage.FusionLocale = JSON.stringify(set_cache.value); sessionStorage.FusionLocale = JSON.stringify(set_cache.value);

View File

@ -38,13 +38,13 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-1"></div> <div class="col-1"></div>
<div class="col-2 q-px-md"> <q-select class="q-pt-md" :label="$t('point')" :dense="true" filled <div class="col-2 q-px-md" @mouseenter="is_active=true" @mousewheel="details_selsect"> <q-select class="q-pt-md" :label="$t('point')" :dense="true" filled
v-model="options_model" @update:model-value="(val) => { options_model = val }" :options="options" emit-value v-model="options_model" @update:model-value="(val) => { options_model = val }" :options="options" emit-value
map-options /></div> map-options /></div>
<div class="col-2 q-px-md"> <q-input v-if="value[options_model]" filled type="number" class="q-pt-md" :dense="true" <div class="col-2 q-px-md" @mousewheel="details_selsect_val($event,'x')"> <q-input v-if="value[options_model]" filled type="number" class="q-pt-md" :dense="true"
v-model="value[options_model].x" @update:model-value="chang(options_model, $event, 'h')" label="x" lazy-rules /> v-model="value[options_model].x" @update:model-value="chang(options_model, $event, 'h')" label="x" lazy-rules />
</div> </div>
<div class="col-2 q-px-md"><q-input v-if="value[options_model]" filled type="number" class="q-pt-md" :dense="true" <div class="col-2 q-px-md" @mousewheel="details_selsect_val($event,'y')"><q-input v-if="value[options_model]" filled type="number" class="q-pt-md" :dense="true"
v-model="value[options_model].y" @update:model-value="chang(options_model, $event, 'h')" label="y" lazy-rules /> v-model="value[options_model].y" @update:model-value="chang(options_model, $event, 'h')" label="y" lazy-rules />
</div> </div>
<div class="q-pt-md col-2"> <div class="q-pt-md col-2">
@ -636,10 +636,62 @@ export default defineComponent({
value_point_amount.value = val ** 2 value_point_amount.value = val ** 2
options_model.value = 1 options_model.value = 1
} }
/**
* 滚轮切换
* @param details
*/
const is_active=ref(false);
const details_selsect=(details:any) => {
if(is_active){
let spt=details.deltaY/100
if(spt>0){
if(options_model.value>=value_point.value.length-1){
options_model.value=0
}else{
options_model.value++
}
}else{
if(options_model.value<=1){
options_model.value=value_point.value.length-1
}else{
options_model.value--
}
}
}
}
/**
* 滚轮改变数据
*/
const details_selsect_val = (details: any, type: string) => {
let spt = details.deltaY / 100
switch (type) {
case 'x':
if (spt > 0) {
value.value[options_model.value].x++
} else {
value.value[options_model.value].x--
}
break;
default:
if (spt > 0) {
value.value[options_model.value].y++
} else {
value.value[options_model.value].y--
}
break;
}
chang(options_model.value,"","")
}
defineExpose({ defineExpose({
options_model, options_model,
}); });
return { return {
is_active,
details_selsect,
resetall_all, resetall_all,
resetall, resetall,
div, div,
@ -661,7 +713,8 @@ export default defineComponent({
add_dialog, add_dialog,
add, add,
now_amount, now_amount,
preview preview,
details_selsect_val
} }
} }
}) })

View File

@ -409,9 +409,11 @@ export default defineComponent({
break; break;
case 'FourPointCalibration': case 'FourPointCalibration':
tmp = '4' tmp = '4'
set?.SetBlendingOption("blending_grids_control_point_count", `4`)
break; break;
case 'SurfaceCorrection': case 'SurfaceCorrection':
tmp = '9' tmp = '9'
//set?.SetBlendingOption("blending_grids_control_point_count", `${child.value!.value_point_amount}`)
set?.SetBlendingOption("blending_grids_select_point", `9:1`) set?.SetBlendingOption("blending_grids_select_point", `9:1`)
break; break;
case 'DensityCorrection': case 'DensityCorrection':
@ -489,11 +491,14 @@ export default defineComponent({
config.value.col = tmp.col; config.value.col = tmp.col;
config.value.row = tmp.row; config.value.row = tmp.row;
$store.commit("setfusion_configuration", res?.config); $store.commit("setfusion_configuration", res?.config);
config.value.col=tmp.col
config.value.row=tmp.row
allconfig = JSON.parse($store.state.fusion_configuration); allconfig = JSON.parse($store.state.fusion_configuration);
if(allconfig.resolution){ if(allconfig.resolution){
for (let index = 0; index < allconfig.resolution.length; index++) { for (let index = 0; index < allconfig.resolution.length; index++) {
if(allconfig.resolution.width==allconfig.projector_width&&allconfig.resolution.height==allconfig.projector_height){ if(allconfig.resolution[index].width==allconfig.projector_width&&allconfig.resolution[index].height==allconfig.projector_height){
now_resolution.value=index now_resolution.value=index
} }
} }
}else{ }else{
@ -503,8 +508,11 @@ export default defineComponent({
}); });
get_scenes() get_scenes()
set?.SetBlendingOption("blending_grids_select_ui", "blending") set?.SetBlendingOption("blending_grids_select_ui", "blending")
}, 100);
// setTimeout(() => {
optionsstr.value = "FusionLocale"; optionsstr.value = "FusionLocale";
}, 1000); // }, 1000);
}); });
const save_cover_name = ref("") const save_cover_name = ref("")
const plan_list = [ const plan_list = [