fix: 修复固件版本管理固件版本格式验证
This commit is contained in:
parent
e958c81025
commit
dd2e64efd7
|
@ -28,7 +28,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
close() {
|
||||
console.log('close0--')
|
||||
this.$emit('close')
|
||||
}
|
||||
},
|
||||
|
|
|
@ -429,7 +429,11 @@ export default {
|
|||
},
|
||||
],
|
||||
otaVersion: [
|
||||
{ required: true, message: "版本不能为空", trigger: "blur" },
|
||||
{
|
||||
required: true,
|
||||
validator: this.chenking_otaVersion,
|
||||
trigger: ["change",'blur'],
|
||||
},
|
||||
],
|
||||
otaUrl: [
|
||||
{ required: false, message: " 升级地址不能为空", trigger: "blur" },
|
||||
|
@ -444,6 +448,16 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
chenking_otaVersion(rule, value, callback){
|
||||
const regex = /^\d+(\.\d+)*$/;
|
||||
if (!this.form.otaVersion) {
|
||||
callback(new Error('版本不能为空'))
|
||||
} else if(!regex.test(this.form.otaVersion)) {
|
||||
callback(new Error('版本格式不正确: x.x.x.x (如1.0.05.121)'))
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
console.log('oat-upload-file--', file, file.type === 'application/octet-stream');
|
||||
const isBin = file.type === 'application/octet-stream';
|
||||
|
|
|
@ -44,12 +44,19 @@
|
|||
:stroke-width="24"
|
||||
:percentage="scope.row.upgradeProgress"
|
||||
:status="upgradeStatusType(scope.row, 'upgradeStatus')"></el-progress>
|
||||
|
||||
<el-tag :type="upgradeStatusTagType(scope.row, 'upgradeStatus')">{{upgradeStatusTagTiltle(scope.row, 'upgradeStatus')}}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="升级信息" align="left" prop="upgradeInfo" />
|
||||
<el-table-column label="升级信息" align="left" prop="upgradeInfo" >
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea" :title="scope.row.upgradeInfo">
|
||||
{{ scope.row.upgradeInfo }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
|
|
Loading…
Reference in New Issue