修复动态添加的一些错误
This commit is contained in:
parent
dbecb1ff15
commit
12a940a55f
|
@ -67,7 +67,7 @@
|
|||
<div class="col-1 q-pt-md "><q-btn color="white"
|
||||
@click="add_dialog=true" text-color="black"
|
||||
:label="$t('add control points')" /></div>
|
||||
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" text-color="black"
|
||||
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" :disable="value_v_point_amount<=5" text-color="black"
|
||||
:label="$t('reduce control points')" /></div>
|
||||
</div>
|
||||
<div class="row" v-show="now_v_h == 'level'">
|
||||
|
@ -87,7 +87,7 @@
|
|||
<div class="col-1 q-pt-md "><q-btn color="white"
|
||||
@click="add_dialog=true" text-color="black"
|
||||
:label="$t('add control points')" /></div>
|
||||
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" text-color="black"
|
||||
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" :disable="value_h_point_amount<=5" text-color="black"
|
||||
:label="$t('reduce control points')" /></div>
|
||||
</div>
|
||||
<div class="q-pt-md"> <q-btn color="white" @click="resetall" text-color="black" :label="$t('resetall')" /></div>
|
||||
|
@ -150,7 +150,8 @@ import {
|
|||
computed,
|
||||
watch,
|
||||
nextTick,
|
||||
onBeforeUnmount
|
||||
onBeforeUnmount,
|
||||
defineExpose
|
||||
} from "vue";
|
||||
import { useStore } from "src/store";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
@ -208,6 +209,8 @@ export default defineComponent({
|
|||
};
|
||||
|
||||
const use_server_config = () => {
|
||||
value_h_point_amount.value = 5
|
||||
value_v_point_amount.value = 5
|
||||
let a = 5
|
||||
value_h.value = []
|
||||
value_h_point.value = []
|
||||
|
@ -256,8 +259,8 @@ export default defineComponent({
|
|||
value_v_point.value = []
|
||||
deepcopy(value_h.value, tmp.value_h)
|
||||
deepcopy(value_v.value, tmp.value_v)
|
||||
value_h_point_amount.value = Number(tmp.value_h_point_amount)
|
||||
value_v_point_amount.value = Number(tmp.value_v_point_amount)
|
||||
value_h_point_amount.value = tmp.value_h_point_amount
|
||||
value_v_point_amount.value = tmp.value_v_point_amount
|
||||
deepcopy(value_h_point.value, tmp.value_h_point)
|
||||
deepcopy(value_v_point.value, tmp.value_v_point)
|
||||
recalculate_coordinates()
|
||||
|
@ -297,7 +300,7 @@ export default defineComponent({
|
|||
use_server_config();
|
||||
use_set_cache();
|
||||
options_value_h_point_amount.value = Object.keys(config.multi_hor_density)
|
||||
options_value_v_point_amount.value = Object.keys(config.multi_ver_density)
|
||||
options_value_v_point_amount.value = Object.keys(config.multi_ver_density)
|
||||
setTimeout(() => {
|
||||
ste_status.value = 0;
|
||||
}, 100);
|
||||
|
@ -339,6 +342,7 @@ export default defineComponent({
|
|||
} else {
|
||||
set?.SetBlendingOption("blending_grids_select_ui", "ver_density")
|
||||
}
|
||||
save_set_cache()
|
||||
}, { deep: true })
|
||||
watch(() => value_h_point_amount, (newval, oldval) => {
|
||||
set?.SetBlendingOption("blending_grids_control_point_count", `${newval.value}`)
|
||||
|
@ -347,6 +351,7 @@ export default defineComponent({
|
|||
} else {
|
||||
set?.SetBlendingOption("blending_grids_select_ui", "ver_density")
|
||||
}
|
||||
save_set_cache()
|
||||
}, { deep: true })
|
||||
|
||||
watch(() => options_model_h, (newval, oldval) => {
|
||||
|
@ -368,6 +373,7 @@ export default defineComponent({
|
|||
|
||||
const chang_point_amount = (val: number, type: string) => {
|
||||
start_point(val, type)
|
||||
save_set_cache()
|
||||
}
|
||||
|
||||
const dragStartHandle = ($event: any, index: number, type: string) => {
|
||||
|
@ -570,7 +576,7 @@ export default defineComponent({
|
|||
let col = $store.getters.GetTheCurrentlySelectedCamera[1]
|
||||
switch (type) {
|
||||
case 'v':
|
||||
set?.AddBlendingCtrlPoint('ver_density', row, col, amount).then((res) => {
|
||||
set?.AddBlendingCtrlPoint('ver_density', row, col, Number(amount)).then((res) => {
|
||||
if (res == null || typeof (res) == "undefined") return
|
||||
update(res?.config)
|
||||
let tmp = JSON.parse(res?.config);
|
||||
|
@ -615,7 +621,7 @@ export default defineComponent({
|
|||
});
|
||||
break;
|
||||
case 'h':
|
||||
set?.AddBlendingCtrlPoint('hor_density', row, col, amount).then((res) => {
|
||||
set?.AddBlendingCtrlPoint('hor_density', row, col, Number(amount)).then((res) => {
|
||||
if (res == null || typeof (res) == "undefined") return
|
||||
update(res?.config)
|
||||
let tmp = JSON.parse(res?.config);
|
||||
|
@ -700,7 +706,7 @@ export default defineComponent({
|
|||
let col = $store.getters.GetTheCurrentlySelectedCamera[1]
|
||||
switch (type) {
|
||||
case 'v':
|
||||
set?.DelBlendingCtrlPoint('ver_density', row, col, amount).then((res) => {
|
||||
set?.DelBlendingCtrlPoint('ver_density', row, col, Number(amount)).then((res) => {
|
||||
if (res == null || typeof (res) == "undefined") return
|
||||
let tmp = JSON.parse(res?.config);
|
||||
let fortmp = null;
|
||||
|
@ -747,7 +753,7 @@ export default defineComponent({
|
|||
});
|
||||
break;
|
||||
case 'h':
|
||||
set?.DelBlendingCtrlPoint('hor_density', row, col, amount).then((res) => {
|
||||
set?.DelBlendingCtrlPoint('hor_density', row, col, Number(amount)).then((res) => {
|
||||
if (res == null || typeof (res) == "undefined") return
|
||||
let tmp = JSON.parse(res?.config);
|
||||
let fortmp = null;
|
||||
|
@ -830,6 +836,11 @@ export default defineComponent({
|
|||
let tmp = now_v_h.value == "vertical" ? "v" : "h"
|
||||
add_control_points(Number(now_amount.value), tmp);
|
||||
}
|
||||
defineExpose({
|
||||
now_v_h,
|
||||
options_model_v,
|
||||
options_model_h
|
||||
});
|
||||
return {
|
||||
resetall,
|
||||
div,
|
||||
|
@ -860,7 +871,8 @@ export default defineComponent({
|
|||
add,
|
||||
del_dialog,
|
||||
add_dialog,
|
||||
now_amount
|
||||
now_amount,
|
||||
set_cache
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -61,7 +61,8 @@ import {
|
|||
computed,
|
||||
watch,
|
||||
nextTick,
|
||||
onBeforeUnmount
|
||||
onBeforeUnmount,
|
||||
defineExpose
|
||||
} from "vue";
|
||||
import { useStore } from "src/store";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
@ -353,6 +354,9 @@ export default defineComponent({
|
|||
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
options_model,
|
||||
});
|
||||
return {
|
||||
resetall,
|
||||
div,
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<div class="col-4 q-pt-sm">
|
||||
<q-item>
|
||||
<q-item-section avatar class="head_1">
|
||||
{{ $t("center line color") }}
|
||||
{{ $t("center circle color") }}
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-input v-model="color[2]" :rules="['anyColor']">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="row" v-show="false">
|
||||
<div class="col-1"></div>
|
||||
<div class="col-2 q-px-md">
|
||||
<div class="col-2"> <q-select class="q-pt-md" :label="$t('point amount')"
|
||||
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
<div class="col-2">
|
||||
|
||||
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" text-color="black"
|
||||
<div class="col-1 q-pt-md "><q-btn color="white" @click="() => { del_dialog = true }" :disable="value_point_amount<=9" text-color="black"
|
||||
:label="$t('reduce control points')" /></div>
|
||||
|
||||
</div>
|
||||
|
@ -97,7 +97,8 @@ import {
|
|||
computed,
|
||||
watch,
|
||||
nextTick,
|
||||
onBeforeUnmount
|
||||
onBeforeUnmount,
|
||||
defineExpose
|
||||
} from "vue";
|
||||
import { useStore } from "src/store";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
@ -158,6 +159,7 @@ export default defineComponent({
|
|||
};
|
||||
|
||||
const use_server_config = () => {
|
||||
value_point_amount.value=9
|
||||
let a = 9
|
||||
value.value = []
|
||||
value_point.value = []
|
||||
|
@ -241,6 +243,7 @@ export default defineComponent({
|
|||
|
||||
watch(() => value_point_amount, (newval, oldval) => {
|
||||
set?.SetBlendingOption("blending_grids_control_point_count", `${newval.value}`)
|
||||
save_set_cache()
|
||||
}, { deep: true })
|
||||
|
||||
/**
|
||||
|
@ -423,6 +426,7 @@ export default defineComponent({
|
|||
}
|
||||
ste_status.value = 1;
|
||||
tmpconfig = JSON.parse(JSON.stringify(fortmp));
|
||||
config = JSON.parse(JSON.stringify(fortmp));
|
||||
options_value_point_amount.value = []
|
||||
for (let key in tmpconfig.multi_curved_surface) {
|
||||
options_value_point_amount.value.push(key)
|
||||
|
@ -449,6 +453,7 @@ export default defineComponent({
|
|||
});
|
||||
}
|
||||
const del_control_points = (amount: number) => {
|
||||
let tmp=amount
|
||||
if (amount <= 9) return
|
||||
let cardinality = Math.sqrt(amount)
|
||||
amount = (cardinality + -1) ** 2
|
||||
|
@ -456,7 +461,7 @@ export default defineComponent({
|
|||
let row = $store.getters.GetTheCurrentlySelectedCamera[0]
|
||||
let col = $store.getters.GetTheCurrentlySelectedCamera[1]
|
||||
|
||||
set?.DelBlendingCtrlPoint('9', row, col, amount).then((res) => {
|
||||
set?.DelBlendingCtrlPoint('9', row, col, Number(tmp)).then((res) => {
|
||||
if (res == null || typeof (res) == "undefined") return
|
||||
let tmp = JSON.parse(res?.config);
|
||||
let fortmp = null;
|
||||
|
@ -471,12 +476,13 @@ export default defineComponent({
|
|||
}
|
||||
ste_status.value = 1;
|
||||
tmpconfig = JSON.parse(JSON.stringify(fortmp));
|
||||
config = JSON.parse(JSON.stringify(fortmp));
|
||||
options_value_point_amount.value = []
|
||||
for (let key in tmpconfig.multi_curved_surface) {
|
||||
options_value_point_amount.value.push(key)
|
||||
}
|
||||
value_point_amount.value = amount
|
||||
config = tmpconfig
|
||||
value_point_amount.value = 9
|
||||
amount=9
|
||||
$store.commit("setfusion_configuration", res?.config);
|
||||
value.value = []
|
||||
value_point.value = []
|
||||
|
@ -494,8 +500,12 @@ export default defineComponent({
|
|||
}
|
||||
value_point.value.push(tmp_point)
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
defineExpose({
|
||||
options_model,
|
||||
});
|
||||
return {
|
||||
resetall,
|
||||
div,
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
]" />
|
||||
</div>
|
||||
<div style="min-height: 72vh">
|
||||
<component :is="options" />
|
||||
<component ref="child" :is="options" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -233,6 +233,7 @@ export default defineComponent({
|
|||
const send_disable_blending_params = () => {
|
||||
set?.SetBlendingOption(disable_blending_params_id.value, disable_blending_params.value ? "1" : "0");
|
||||
};
|
||||
const child :any = ref(null);
|
||||
const send_show_blending_grids = () => {
|
||||
let tmp = ""
|
||||
switch (optionsstr.value) {
|
||||
|
@ -246,7 +247,12 @@ export default defineComponent({
|
|||
tmp = '9'
|
||||
break;
|
||||
case 'DensityCorrection':
|
||||
tmp = 'density'
|
||||
if(child.value!.now_v_h=='vertical'){
|
||||
tmp = 'ver_density'
|
||||
}else{
|
||||
tmp = 'hor_density'
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -254,6 +260,29 @@ export default defineComponent({
|
|||
set?.SetBlendingOption("blending_grids_select_ui", tmp)
|
||||
set?.SetBlendingOption('blending_grids_select_projector', now_selsect_projector.value);
|
||||
set?.SetBlendingOption(show_blending_grids_id.value, show_blending_grids.value ? "1" : "0");
|
||||
|
||||
switch (optionsstr.value) {
|
||||
case 'FusionLocale':
|
||||
|
||||
break;
|
||||
case 'FourPointCalibration':
|
||||
set?.SetBlendingOption("blending_grids_select_point", `4:${child.value!.options_model+1}`)
|
||||
break;
|
||||
case 'SurfaceCorrection':
|
||||
set?.SetBlendingOption("blending_grids_select_point", `9:${child.value!.options_model+1}`)
|
||||
break;
|
||||
case 'DensityCorrection':
|
||||
console.log(child.value!.now_v_h)
|
||||
if(child.value!.now_v_h=='vertical'){
|
||||
set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_v+1}`)
|
||||
}else{
|
||||
set?.SetBlendingOption("blending_grids_select_point", `${child.value!.options_model_h+1}`)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
const resetall = () => {
|
||||
set?.ResetBlendingConfig().then((res) => {
|
||||
|
@ -490,7 +519,8 @@ export default defineComponent({
|
|||
record_times,
|
||||
saveconfig,
|
||||
isdebug,
|
||||
del_dialog
|
||||
del_dialog,
|
||||
child
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
@ -458,7 +458,7 @@ export default {
|
|||
"vertical point ":"vertical point amount",
|
||||
"point amount":"point amount",
|
||||
"add control points":"add control points",
|
||||
"reduce control points":"reduce control points",
|
||||
"reduce control points":"delete control points",
|
||||
"OK to delete you will lose the data you adjusted now":"OK to delete you will lose the data you adjusted now",
|
||||
"Please enter the points you need to add":"Please enter the points you need to add",
|
||||
"Whether to add control points":"Whether to add control points"
|
||||
|
|
|
@ -727,7 +727,7 @@ export default {
|
|||
"vertical point":"垂直点数量",
|
||||
"point amount":"点数量",
|
||||
"add control points":"增加",
|
||||
"reduce control points":"减少",
|
||||
"reduce control points":"删除",
|
||||
"OK to delete you will lose the data you adjusted now":"确定删除你将失去现在调整的数据",
|
||||
"Please enter the points you need to add":"请输入你所需要添加的点数",
|
||||
"Whether to add control points":"是否添加控制点"
|
||||
|
|
Loading…
Reference in New Issue