From 6a1f70f967ccb039dd3e0a24b33cef8d267249c4 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Wed, 7 Jun 2023 09:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9D=97=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E8=BF=87=E6=BB=A4=E6=B1=89=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/info.vue | 2 +- .../d-form/components/d-form/d-form.vue | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pages/massif/info.vue b/pages/massif/info.vue index 339c36e..6f113fa 100644 --- a/pages/massif/info.vue +++ b/pages/massif/info.vue @@ -33,7 +33,7 @@ import request from '@/common/request' fields:{ plantBaseInfoName:{label:"基地名称",disabled:true}, plotName:{label:"地块名称"}, - plotNumber:{label:"地块编号"}, + plotNumber:{label:"地块编号",filter:v=>v.replace(/[\u2E80-\u9FFF]/g,'')}, drawArea:{label:"勾画面积(亩)",disabled:true,type:'digit'}, realityArea:{label:"实际面积",type:'digit'}, image:{label:"地块图片",type:"upImg",num:3,value:''}, diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index 5202fcd..4b9e4a2 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -302,7 +302,13 @@ - + {{typeof suffix=='function'?suffix():suffix}} @@ -506,6 +512,10 @@ import {computeArea} from '@/common/utils' type:Function, default:()=>'' }, + filter:{ + type:[Function,Object], + default:null + }, startPlaceholder:"", endPlaceholder:"", }, @@ -663,6 +673,13 @@ import {computeArea} from '@/common/utils' this.$refs.picker.setColumnValues(e.columnIndex+1,e.value[0].children) } }, + inputBlur(e){ + if(/^number$|^digit$/.test(this.type)){ + this.$emit('input', /^[\d\.]+$/.test(e)?parseFloat(e):e) + }else if(this.type=='text'&&typeof this.filter=='function'){ + this.$emit("input",this.filter(e)) + } + }, openMap(){ // uni.navigateTo({url:"/plantPages/massif/mapEditor"})