<template>
	<view class="u-m-t-32 inp">
		<input :placeholder="'请输入含' + `${places}` + '位小数点的数值'"  @blur="handleDi" placeholder-style="color: #B3B3B3; magin-top: 10rpx;" type="digit"  v-model="numb_value" />
	</view>
</template>
<script>
	export default {
		props: {
			
			//拍照选项项目巡检id
			scan_id: {
				type: Number
			},
			//小数位数
			places: {
				type: Number
			},
			//最小值
			min: {
				type:Number
			},
			//最大值
			max: {
				type:Number
			}
		},
		data() {
			return {
				numb_value:'',
			
			}
		},
		methods: {
			//处理巡检提交数据
			submit() {
			let item = {
				id: this.scan_id,
				value: this.numb_value
			} //提交数据
			this.$store.state.user.items.push(item)
			// }
			},
			//input修改
			handleDi(e) {
				if(this.min != 0 && this.max != 0) {
					if(e.detail.value > this.max) {
						this.$refs.sacast.show({
							title: "数值超过最大值",
							type: 'info',
						})
					} else if(e.detail.value < this.min) {
						this.$refs.sacast.show({
							title: "数值不得小于最小值",
							type: 'info',
						})
					}
				}
			},
			//重置表单
			reset() {
				this.numb_value = ''
			}
		}
	}
</script>

<style>
	input {
		width: 100%;
		height: 100%;
		 /* text-indent: 20rpx; */
	}
	
	.inp {
		width: 690rpx;
		height: 80rpx;
		padding: 18rpx;
		border: 1rpx solid #BFBFBF;
		border-radius: 6rpx;
	}
	
</style>
