<el-form-item label="随机区间" prop="randowMin" v-if="infoData.type !== 4 && infoData.isRandow === 1">
<div class="input_item">
<div class="input_item_value input_item_value2">
<el-input v-model="infoData.randowMin" placeholder="请输入内容"></el-input>
</div>
<span>-</span>
<div class="input_item_value input_item_value2">
<el-input v-model="infoData.randowMax" placeholder="请输入内容"></el-input>
</div>
</div>
</el-form-item>
data() {
const valTowValue = (rule, value, callback) => {
if (value == "" || value == undefined || value == null) {
callback(new Error("请输入随机区间"));
} else {
if (!this.infoData.randowMax) {
callback(new Error("请输入最大值"));
} else if (!this.infoData.randowMin) {
callback(new Error("请输入最小值"));
} else if (Number(this.infoData.randowMin) >= Number(this.infoData.randowMax)) {
callback(new Error("请输入正确的范围值"));
} else {
callback();
}
}
};
}
rules: {
randowMin: [{ validator: valTowValue, trigger: "blur" }],
},
网友评论