fix:修复固件版本号正则错误,新增设备信息固件版本显示字段

This commit is contained in:
23357 2023-11-28 11:14:13 +08:00
parent c02207ba2e
commit 2e8b869700
4 changed files with 18 additions and 6 deletions

View File

@ -449,11 +449,11 @@ export default {
},
methods: {
chenking_otaVersion(rule, value, callback){
const regex = /^(\d{1,3}\.){3}\d{1,3}$/;
const regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
if (!this.form.otaVersion) {
callback(new Error('版本不能为空'))
} else if(!regex.test(this.form.otaVersion)) {
callback(new Error('版本格式不正确: x.x.x.x (如: 0~999.0~999.0~999.0~999)'))
callback(new Error('版本格式不正确: x.x.x.x (如: 0~255.0~255.0~255.0~255)'))
} else {
callback();
}

View File

@ -120,7 +120,11 @@
</div>
<div class="table-row">
<div class="table-row-col" style="flex: 3 1 0%;">
<div class="table-row-col" style="flex: 1">
<div class="title">固件版本</div>
<div class="content">{{ infoData.otaVersion || "--" }}</div>
</div>
<div class="table-row-col" style="flex: 2">
<div class="title">设备图片</div>
<div class="content">--</div>
</div>

View File

@ -193,7 +193,11 @@
</div>
<div class="table-row">
<div class="table-row-col" style="flex: 3 1 0%">
<div class="table-row-col" style="flex: 1">
<div class="title">固件版本</div>
<div class="content">{{ infoData.otaVersion || "--" }}</div>
</div>
<div class="table-row-col" style="flex: 2">
<div class="title">设备图片</div>
<div class="content">--</div>
</div>

View File

@ -14,7 +14,7 @@
<div class="group-list-table">
<div class="table-row">
<div class="table-row-col">
<div class="title">deviceKey</div>
<div class="title">设备Key</div>
<div class="content">
<span class="name">{{infoData.deviceKey}}</span>
<el-button type="text" size="small" @click="copyText(infoData.deviceKey)">复制</el-button>
@ -117,7 +117,11 @@
</div>
<div class="table-row">
<div class="table-row-col" style="flex: 3 1 0%;">
<div class="table-row-col" style="flex: 1">
<div class="title">固件版本</div>
<div class="content">{{ infoData.otaVersion || "--" }}</div>
</div>
<div class="table-row-col" style="flex: 2">
<div class="title">设备图片</div>
<div class="content">--</div>
</div>