From dd2e64efd7d3f3f2b3d8191dcf700c1ffe80e7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=82=E9=BB=8E?= <329261568@qq.com> Date: Mon, 18 Sep 2023 10:01:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BA=E4=BB=B6?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E5=9B=BA=E4=BB=B6=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=A0=BC=E5=BC=8F=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DialogTemplate/index.vue | 1 - src/views/iot/ota/index.vue | 16 +++++++++++++++- .../DeviceDetailsView/BatchUpgradeRate.vue | 9 ++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/components/DialogTemplate/index.vue b/src/components/DialogTemplate/index.vue index 8c061579..34f7e7b3 100644 --- a/src/components/DialogTemplate/index.vue +++ b/src/components/DialogTemplate/index.vue @@ -28,7 +28,6 @@ export default { }, methods: { close() { - console.log('close0--') this.$emit('close') } }, diff --git a/src/views/iot/ota/index.vue b/src/views/iot/ota/index.vue index 9bcbb6e9..54f3a4ef 100644 --- a/src/views/iot/ota/index.vue +++ b/src/views/iot/ota/index.vue @@ -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'; diff --git a/src/views/profile/DeviceDetailsView/BatchUpgradeRate.vue b/src/views/profile/DeviceDetailsView/BatchUpgradeRate.vue index 5a6814e9..1c27740f 100644 --- a/src/views/profile/DeviceDetailsView/BatchUpgradeRate.vue +++ b/src/views/profile/DeviceDetailsView/BatchUpgradeRate.vue @@ -44,12 +44,19 @@ :stroke-width="24" :percentage="scope.row.upgradeProgress" :status="upgradeStatusType(scope.row, 'upgradeStatus')"> + {{upgradeStatusTagTiltle(scope.row, 'upgradeStatus')}} - + + +