修复用户输入input后点击加减号时变成字符串

This commit is contained in:
shefengchun 2023-03-08 17:13:26 +08:00
parent 49b38635aa
commit eb6cf76f69
1 changed files with 16 additions and 16 deletions

View File

@ -12,7 +12,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input v-show="ispad" dense filled type="number" :autofocus="group == 0" <q-input v-show="ispad" dense filled type="number" :autofocus="group == 0"
:bg-color="group == 0 ? 'cyan-1' : ''" @focus="group = 0" v-model="array[0].value" :bg-color="group == 0 ? 'cyan-1' : ''" @focus="group = 0" v-model.number="array[0].value"
:label="$t('upper fusion zone parameters')" lazy-rules :label="$t('upper fusion zone parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 0 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 0 }"
:readonly="url.indexOf('pad') != -1" :rules="[ :readonly="url.indexOf('pad') != -1" :rules="[
@ -24,7 +24,7 @@
]" /> ]" />
<q-input v-show="!ispad" dense filled type="number" :autofocus="group == 0" <q-input v-show="!ispad" dense filled type="number" :autofocus="group == 0"
:bg-color="group == 0 ? 'cyan-1' : ''" @focus="() => { group = 0; input_focus[0] = true }" :bg-color="group == 0 ? 'cyan-1' : ''" @focus="() => { group = 0; input_focus[0] = true }"
v-model="array[0].value" :label="$t('upper fusion zone parameters')" lazy-rules v-model.number="array[0].value" :label="$t('upper fusion zone parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 0 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 0 }"
:readonly="url.indexOf('pad') != -1" @blur="input_focus[0] = false" :rules="[ :readonly="url.indexOf('pad') != -1" @blur="input_focus[0] = false" :rules="[
(val) => (val) =>
@ -52,7 +52,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input v-show="ispad" dense filled type="number" :autofocus="group == 1" <q-input v-show="ispad" dense filled type="number" :autofocus="group == 1"
:bg-color="group == 1 ? 'cyan-1' : ''" @focus="group = 1" v-model="array[1].value" :bg-color="group == 1 ? 'cyan-1' : ''" @focus="group = 1" v-model.number="array[1].value"
:label="$t('Left fusion Band Parameters')" lazy-rules :label="$t('Left fusion Band Parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 1 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 1 }"
:readonly="url.indexOf('pad') != -1" :rules="[ :readonly="url.indexOf('pad') != -1" :rules="[
@ -64,7 +64,7 @@
]" /> ]" />
<q-input v-show="!ispad" dense filled type="number" :autofocus="group == 1" <q-input v-show="!ispad" dense filled type="number" :autofocus="group == 1"
:bg-color="group == 1 ? 'cyan-1' : ''" @focus="() => { group = 1; input_focus[1] = true }" :bg-color="group == 1 ? 'cyan-1' : ''" @focus="() => { group = 1; input_focus[1] = true }"
v-model="array[1].value" :label="$t('Left fusion Band Parameters')" lazy-rules v-model.number="array[1].value" :label="$t('Left fusion Band Parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 1 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 1 }"
:readonly="url.indexOf('pad') != -1" @blur="input_focus[1] = false" :rules="[ :readonly="url.indexOf('pad') != -1" @blur="input_focus[1] = false" :rules="[
(val) => (val) =>
@ -88,7 +88,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input v-show="ispad" dense filled type="number" :autofocus="group == 2" <q-input v-show="ispad" dense filled type="number" :autofocus="group == 2"
:bg-color="group == 2 ? 'cyan-1' : ''" @focus="group = 2" v-model="array[2].value" :bg-color="group == 2 ? 'cyan-1' : ''" @focus="group = 2" v-model.number="array[2].value"
:label="$t('Right fusion Band Parameters')" lazy-rules :label="$t('Right fusion Band Parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 2 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 2 }"
:readonly="url.indexOf('pad') != -1" :rules="[ :readonly="url.indexOf('pad') != -1" :rules="[
@ -100,7 +100,7 @@
]" /> ]" />
<q-input v-show="!ispad" dense filled type="number" :autofocus="group == 2" <q-input v-show="!ispad" dense filled type="number" :autofocus="group == 2"
:bg-color="group == 2 ? 'cyan-1' : ''" @focus="() => { group = 2; input_focus[2] = true }" :bg-color="group == 2 ? 'cyan-1' : ''" @focus="() => { group = 2; input_focus[2] = true }"
v-model="array[2].value" :label="$t('Right fusion Band Parameters')" lazy-rules v-model.number="array[2].value" :label="$t('Right fusion Band Parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 2 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 2 }"
:readonly="url.indexOf('pad') != -1" @blur="input_focus[2] = false" :rules="[ :readonly="url.indexOf('pad') != -1" @blur="input_focus[2] = false" :rules="[
(val) => (val) =>
@ -130,7 +130,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input v-show="ispad" dense filled type="number" :autofocus="group == 3" <q-input v-show="ispad" dense filled type="number" :autofocus="group == 3"
:bg-color="group == 3 ? 'cyan-1' : ''" @focus="group = 3" v-model="array[3].value" :bg-color="group == 3 ? 'cyan-1' : ''" @focus="group = 3" v-model.number="array[3].value"
:label="$t('Lower fusion Zone Parameters')" lazy-rules :label="$t('Lower fusion Zone Parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 3 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 3 }"
:readonly="url.indexOf('pad') != -1" :rules="[ :readonly="url.indexOf('pad') != -1" :rules="[
@ -142,7 +142,7 @@
]" /> ]" />
<q-input v-show="!ispad" dense filled type="number" :autofocus="group == 3" <q-input v-show="!ispad" dense filled type="number" :autofocus="group == 3"
:bg-color="group == 3 ? 'cyan-1' : ''" @focus="() => { group = 3; input_focus[3] = true }" :bg-color="group == 3 ? 'cyan-1' : ''" @focus="() => { group = 3; input_focus[3] = true }"
v-model="array[3].value" :label="$t('Lower fusion Zone Parameters')" lazy-rules v-model.number="array[3].value" :label="$t('Lower fusion Zone Parameters')" lazy-rules
@click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 3 }" @click="() => { url.indexOf('pad') != -1 ? ipad_chang = true : ''; group = 3 }"
:readonly="url.indexOf('pad') != -1" @blur="input_focus[3] = false" :rules="[ :readonly="url.indexOf('pad') != -1" @blur="input_focus[3] = false" :rules="[
(val) => (val) =>
@ -172,7 +172,7 @@
<div> <q-input v-show="ispad" dense filled hide-bottom-space type="number" max="1" min="0" step="0.1" <div> <q-input v-show="ispad" dense filled hide-bottom-space type="number" max="1" min="0" step="0.1"
@update:model-value="chang('alpha')" @update:model-value="chang('alpha')"
@click="() => { now_apg = 'alpha'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad" @click="() => { now_apg = 'alpha'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad"
v-model="array[group].alpha" lazy-rules :rules="[ v-model.number="array[group].alpha" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || (val !== null && val !== '') ||
$t('Please enter a number'), $t('Please enter a number'),
@ -183,7 +183,7 @@
@update:model-value="chang('alpha')" @update:model-value="chang('alpha')"
@click="() => { now_apg = 'alpha'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad" @click="() => { now_apg = 'alpha'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad"
@focus="input_focus_apg[0]=true" @blur="input_focus_apg[0]=false" @focus="input_focus_apg[0]=true" @blur="input_focus_apg[0]=false"
v-model="array[group].alpha" lazy-rules :rules="[ v-model.number="array[group].alpha" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || (val !== null && val !== '') ||
$t('Please enter a number'), $t('Please enter a number'),
@ -206,7 +206,7 @@
color="green" vertical reverse label-always /> color="green" vertical reverse label-always />
<div> <q-input v-show="ispad" dense filled hide-bottom-space type="number" max="16" min="0" step="0.1" <div> <q-input v-show="ispad" dense filled hide-bottom-space type="number" max="16" min="0" step="0.1"
@update:model-value="chang('p')" @click="() => { now_apg = 'p'; ispad ? ipad_chang_input = true : '' }" @update:model-value="chang('p')" @click="() => { now_apg = 'p'; ispad ? ipad_chang_input = true : '' }"
:readonly="ispad" v-model="array[group].p" lazy-rules :rules="[ :readonly="ispad" v-model.number="array[group].p" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || (val !== null && val !== '') ||
$t('Please enter a number'), $t('Please enter a number'),
@ -216,7 +216,7 @@
<q-input v-show="!ispad" dense filled hide-bottom-space type="number" max="16" min="0" step="0.1" <q-input v-show="!ispad" dense filled hide-bottom-space type="number" max="16" min="0" step="0.1"
@focus="input_focus_apg[1]=true" @blur="input_focus_apg[1]=false" @focus="input_focus_apg[1]=true" @blur="input_focus_apg[1]=false"
@update:model-value="chang('p')" @click="() => { now_apg = 'p'; ispad ? ipad_chang_input = true : '' }" @update:model-value="chang('p')" @click="() => { now_apg = 'p'; ispad ? ipad_chang_input = true : '' }"
:readonly="ispad" v-model="array[group].p" lazy-rules :rules="[ :readonly="ispad" v-model.number="array[group].p" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || (val !== null && val !== '') ||
$t('Please enter a number'), $t('Please enter a number'),
@ -239,10 +239,9 @@
color="green" vertical reverse label-always /> color="green" vertical reverse label-always />
<div> <div>
<q-input v-show="ispad" :dense="true" filled hide-bottom-space type="number" max="16" min="0" step="0.1" <q-input v-show="ispad" :dense="true" filled hide-bottom-space type="number" max="16" min="0" step="0.1"
@focus="input_focus_apg[2]=true" @blur="input_focus_apg[2]=false"
@update:model-value="chang('gamma')" @update:model-value="chang('gamma')"
@click="() => { now_apg = 'gamma'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad" @click="() => { now_apg = 'gamma'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad"
v-model="array[group].gamma" lazy-rules :rules="[ v-model.number="array[group].gamma" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || (val !== null && val !== '') ||
$t('Please enter a number'), $t('Please enter a number'),
@ -251,8 +250,9 @@
]" /> ]" />
<q-input v-show="!ispad" :dense="true" filled hide-bottom-space type="number" max="16" min="0" step="0.1" <q-input v-show="!ispad" :dense="true" filled hide-bottom-space type="number" max="16" min="0" step="0.1"
@update:model-value="chang('gamma')" @update:model-value="chang('gamma')"
@focus="input_focus_apg[2]=true" @blur="input_focus_apg[2]=false"
@click="() => { now_apg = 'gamma'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad" @click="() => { now_apg = 'gamma'; ispad ? ipad_chang_input = true : '' }" :readonly="ispad"
v-model="array[group].gamma" lazy-rules :rules="[ v-model.number="array[group].gamma" lazy-rules :rules="[
(val) => (val) =>
(val !== null && val !== '') || (val !== null && val !== '') ||
$t('Please enter a number'), $t('Please enter a number'),
@ -410,7 +410,7 @@ export default defineComponent({
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
{ alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
// { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 }, { alpha: 0, p: 0, gamma: 0, isshow: false, value: 0 },
]); ]);
const auto_sync = ref(true) const auto_sync = ref(true)
const auxiliary_line = ref(false) const auxiliary_line = ref(false)