Selaa lähdekoodia

查询模板预览-数字输入校验修改

zhongxiaoyu 2 vuotta sitten
vanhempi
commit
c4c1253ad6

+ 8 - 2
src/views/systemSettings/views/queryTemplate/queryTemplatePreview.vue

@@ -112,8 +112,9 @@
                       <el-input
                         v-model="scope.row[col.prop]"
                         placeholder="请输入"
-                        @keydown.native="inputCheck(scope.row[col.prop])"
+                        @keydown.native="inputHold(scope.row[col.prop])"
                         @input="inputLimit(scope.row[col.prop], scope.$index)"
+                        @blur="inputFix(scope.row[col.prop], scope.$index)"
                       />
                     </template>
                     <template v-else-if="col.inputType[scope.$index] === 'date'">
@@ -368,7 +369,7 @@ export default {
         this.paramsForm.params[rowIndex].comparisonOperators = this.tableCols[2].options[rowIndex][0].value
       }
     },
-    inputCheck(value) {
+    inputHold(value) {
       this.checkValue = value
     },
     inputLimit(value, rowIndex) {
@@ -376,6 +377,11 @@ export default {
         this.paramsForm.params[rowIndex].paramValue = this.checkValue
       }
     },
+    inputFix(value, rowIndex) {
+      if (value?.at(-1) === '.') {
+        this.paramsForm.params[rowIndex].paramValue = value.slice(0, -1)
+      }
+    },
     advancedQueryHandler() {
       let bracketsDifference = 0
       try {