提交 b1a3481b 编写于 作者: 张平's avatar 张平

Merge branch 'dev-circle-9-1-20210112' into 'release'

Dev circle 9 1 20210112



See merge request !240
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</el-table-column> </el-table-column>
<el-table-column label="序号" width="200"> <el-table-column label="序号" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.seqNo" style="width:60px;" size="small" placeholder="序号"/> <el-input v-model="scope.row.seqNo" style="width:60px;" size="small" @blur="BlurText($event)" @placeholder="序号"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -124,6 +124,14 @@ export default { ...@@ -124,6 +124,14 @@ export default {
this.$message.error("序号不可为空,请检查"); this.$message.error("序号不可为空,请检查");
return; return;
} }
const r = /^\+?[1-9][0-9]*$/; // 正整数
// 如果判断不符合正则,则不是正整数不能提交
if (!r.test(this.settingForm.settingData[i].seqNo)) {
return;
}
if (this.settingForm.settingData[i].seqNo < 1 || this.settingForm.settingData[i].seqNo > 10) {
return;
}
if (this.settingForm.settingData[i].seqNo > this.settingForm.settingData.length) { if (this.settingForm.settingData[i].seqNo > this.settingForm.settingData.length) {
this.$message.error("序号必须从1开始顺序排列,不能有跳序情况,请检查"); this.$message.error("序号必须从1开始顺序排列,不能有跳序情况,请检查");
return; return;
...@@ -162,9 +170,19 @@ export default { ...@@ -162,9 +170,19 @@ export default {
cancle(){ cancle(){
this.$router.go(-1); this.$router.go(-1);
} },
BlurText(e) {
console.log("BlurText() : e = " + e.target.value)
let b = new RegExp("^[1-9][0-9]*$").test(e.target.value)
if (e.target.value >= 10) {
b = false
}
if (!b) {
this.$message.warning('请输入 1~10 的正整数')
e.target.value = ''
}
}
}, },
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册