fix(测试跟踪): 自定义字段整型及浮点类型精度有误

--bug=1024232 --user=宋昌昌 【测试跟踪】自定义字段整型和浮点型输入、显示有误 https://www.tapd.cn/55049933/s/1348970
This commit is contained in:
song-cc-rock 2023-03-13 18:08:54 +08:00 committed by jianxing
parent bcbbd2563d
commit 4ac4b93d5c
1 changed files with 9 additions and 2 deletions

View File

@ -75,14 +75,15 @@
@click.native="clickPane"
v-model="data[prop]"
:disabled="disabled"
@change="handleChange"/>
@change="handleChange" :precision="0" :step="1"/>
<el-input-number
v-else-if="data.type === 'float'"
@click.native="clickPane"
:disabled="disabled"
@input.native="changeInput($event)"
@change="handleChange"
v-model="data[prop]" :precision="2" :step="0.1"/>
v-model="data[prop]" :step="0.1"/>
<el-date-picker
class="custom-with"
@ -218,6 +219,12 @@ export default {
getTranslateOption(item) {
return item.system ? this.$t(item.text) : item.text;
},
changeInput(e) {
// 10
if (e.target.value.indexOf('.') >= 0) {
e.target.value = e.target.value.substring(0, e.target.value.indexOf('.') + 11);
}
},
handleChange() {
if (this.form) {
this.$set(this.form, this.data.name, this.data[this.prop]);