修复键盘监听导致的输入问题
This commit is contained in:
parent
e37999a924
commit
b3cc026b41
|
@ -5,7 +5,7 @@
|
|||
@focus="isactivearray[0] = false" v-model="four[0].x" label="x" lazy-rules />
|
||||
<q-input filled type="number" class="q-pt-xs" :dense="true" @focus="isactivearray[0] = false" v-model="four[0].y"
|
||||
label="y" lazy-rules />
|
||||
<q-btn size="sm" dense color="white" @click="reset(0,false)" text-color="black"
|
||||
<q-btn size="sm" dense color="white" @click="reset(0, false)" text-color="black"
|
||||
:label="$t('reset') + $t('point') + '1'" />
|
||||
</div>
|
||||
<div class="col-8"></div>
|
||||
|
@ -14,7 +14,7 @@
|
|||
label="x" lazy-rules />
|
||||
<q-input filled type="number" class="q-pt-xs" :dense="true" @focus="isactivearray[1] = false" v-model="four[1].y"
|
||||
label="y" lazy-rules />
|
||||
<q-btn size="sm" dense color="white" @click="reset(1,false)" text-color="black"
|
||||
<q-btn size="sm" dense color="white" @click="reset(1, false)" text-color="black"
|
||||
:label="$t('reset') + $t('point') + '2'" />
|
||||
</div>
|
||||
|
||||
|
@ -25,22 +25,22 @@
|
|||
<vue3ResizeDrag style="border: 0;" :class="[now_index == 0 ? 'action' : 'point']" v-if="isshowarray[0]"
|
||||
:isActive="isactivearray[0]" @mousedown="activeMouseDown(0)" @mouseUpHandler="mouseUpHandler(0)" :w="20"
|
||||
:h="20" :x="points[0].x" :y="points[0].y" :isResizable="false" @moveHandler="moveHandler_1">
|
||||
<div >1</div>
|
||||
<div>1</div>
|
||||
</vue3ResizeDrag>
|
||||
<vue3ResizeDrag style="border: 0;" :class="[now_index == 1 ? 'action' : 'point']" v-if="isshowarray[1]"
|
||||
:isActive="isactivearray[1]" @mousedown="activeMouseDown(1)" @mouseUpHandler="mouseUpHandler(1)" :w="20"
|
||||
:h="20" :x="points[1].x" :y="points[1].y" :isResizable="false" @moveHandler="moveHandler_2">
|
||||
<div >2</div>
|
||||
<div>2</div>
|
||||
</vue3ResizeDrag>
|
||||
<vue3ResizeDrag style="border: 0;" :class="[now_index == 2 ? 'action' : 'point']" v-if="isshowarray[2]"
|
||||
:isActive="isactivearray[2]" @mousedown="activeMouseDown(2)" @mouseUpHandler="mouseUpHandler(2)" :w="20"
|
||||
:h="20" :x="points[2].x" :y="points[2].y" :isResizable="false" @moveHandler="moveHandler_3">
|
||||
<div >3</div>
|
||||
<div>3</div>
|
||||
</vue3ResizeDrag>
|
||||
<vue3ResizeDrag style="border: 0;" :class="[now_index == 3 ? 'action' : 'point']" v-if="isshowarray[3]"
|
||||
:isActive="isactivearray[3]" @mousedown="activeMouseDown(3)" @mouseUpHandler="mouseUpHandler(3)" :w="20"
|
||||
:h="20" :x="points[3].x" :y="points[3].y" :isResizable="false" @moveHandler="moveHandler_4">
|
||||
<div >4</div>
|
||||
<div>4</div>
|
||||
</vue3ResizeDrag>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -52,15 +52,15 @@
|
|||
label="x" lazy-rules />
|
||||
<q-input filled type="number" class="q-pt-xs" :dense="true" @focus="isactivearray[2] = false" v-model="four[2].y"
|
||||
label="y" lazy-rules />
|
||||
<q-btn size="sm" dense color="white" @click="reset(2,false)" text-color="black"
|
||||
<q-btn size="sm" dense color="white" @click="reset(2, false)" text-color="black"
|
||||
:label="$t('reset') + $t('point') + '3'" />
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<q-btn size="sm" dense color="white" @click="resetall" text-color="black" :label="$t('resetall')" />
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<q-input filled type="number" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].x"
|
||||
label="x" lazy-rules />
|
||||
<q-input filled type="number" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].x" label="x"
|
||||
lazy-rules />
|
||||
<q-input filled type="number" class="q-pt-md" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].y"
|
||||
label="y" lazy-rules />
|
||||
<q-btn size="sm" dense color="white" @click="reset(3,false)" text-color="black"
|
||||
|
@ -200,7 +200,7 @@ export default defineComponent({
|
|||
};
|
||||
const keyDown = () => {
|
||||
document.onkeydown = (e) => {
|
||||
|
||||
let lock = 0
|
||||
let e1 = e || window.event || arguments.callee.caller.arguments[0]
|
||||
switch (e.code) {
|
||||
case "KeyW":
|
||||
|
@ -220,15 +220,19 @@ export default defineComponent({
|
|||
points[now_index.value].y
|
||||
break;
|
||||
default:
|
||||
lock = 1
|
||||
break;
|
||||
}
|
||||
let tmp = { left: points[now_index.value].x, top: points[now_index.value].y }
|
||||
eval(`moveHandler_${now_index.value+1}(tmp)`);
|
||||
isactivearray.value[now_index.value] = false;
|
||||
isshowarray.value[now_index.value] = false;
|
||||
setTimeout(() => {
|
||||
isshowarray.value[now_index.value] = true;
|
||||
}, 100);
|
||||
if (lock == 0) {
|
||||
let tmp = { left: points[now_index.value].x, top: points[now_index.value].y }
|
||||
eval(`moveHandler_${now_index.value + 1}(tmp)`);
|
||||
isactivearray.value[now_index.value] = false;
|
||||
isshowarray.value[now_index.value] = false;
|
||||
setTimeout(() => {
|
||||
isshowarray.value[now_index.value] = true;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
|
@ -316,6 +320,7 @@ export default defineComponent({
|
|||
let y = Math.ceil((config.height - newVal.y) / Proportion.value.y);
|
||||
points[0].x = x;
|
||||
points[0].y = y;
|
||||
console.log(points[0])
|
||||
isshowarray.value[0] = false;
|
||||
isactivearray.value[0] = false;
|
||||
setTimeout(() => {
|
||||
|
@ -442,7 +447,7 @@ export default defineComponent({
|
|||
{ deep: true }
|
||||
);
|
||||
watch(() => now_index, (newval, oldval) => {
|
||||
if(ste_status.value == 1)return
|
||||
if (ste_status.value == 1) return
|
||||
set?.SetBlendingOption("blending_grids_select_point", `4:${now_index.value + 1}`)
|
||||
}, { deep: true })
|
||||
//为了加载 缓存的配置时 同步点的位置
|
||||
|
@ -484,25 +489,24 @@ export default defineComponent({
|
|||
}, 100);
|
||||
};
|
||||
const reset = (index: number, send: boolean) => {
|
||||
send = send?? true;
|
||||
isactivearray.value[index] = false;
|
||||
send = send ?? true;
|
||||
isactivearray.value[index] = false;
|
||||
fourpostion.value[index].x = defaultfourpostion.value[index].x;
|
||||
fourpostion.value[index].y = defaultfourpostion.value[index].y;
|
||||
|
||||
four[index].x = config.point4[index].def_x;
|
||||
four[index].y = config.point4[index].def_y;
|
||||
|
||||
if (send)
|
||||
{
|
||||
set?.setBlendingCorrection(
|
||||
$store.getters.GetTheCurrentlySelectedCamera[0],
|
||||
$store.getters.GetTheCurrentlySelectedCamera[1],
|
||||
4,
|
||||
index + 1,
|
||||
Number(config.point4[index].def_x),
|
||||
Number(config.point4[index].def_y)
|
||||
);
|
||||
}
|
||||
if (send) {
|
||||
set?.setBlendingCorrection(
|
||||
$store.getters.GetTheCurrentlySelectedCamera[0],
|
||||
$store.getters.GetTheCurrentlySelectedCamera[1],
|
||||
4,
|
||||
index + 1,
|
||||
Number(config.point4[index].def_x),
|
||||
Number(config.point4[index].def_y)
|
||||
);
|
||||
}
|
||||
|
||||
isshowarray.value[index] = false;
|
||||
setTimeout(() => {
|
||||
|
@ -514,7 +518,7 @@ export default defineComponent({
|
|||
for (let index = 0; index < fourpostion.value.length; index++) {
|
||||
reset(index, false);
|
||||
}
|
||||
set?.setBlendingCorrection(
|
||||
set?.setBlendingCorrection(
|
||||
$store.getters.GetTheCurrentlySelectedCamera[0],
|
||||
$store.getters.GetTheCurrentlySelectedCamera[1],
|
||||
4, 0, 0, 0
|
||||
|
|
Loading…
Reference in New Issue