diff --git a/package-lock.json b/package-lock.json index 2223b3b..ba9d684 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "axios": "^0.21.1", "echarts": "^5.4.2", "element-plus": "^2.3.4", - "js-base64": "^3.7.5", + "js-base64": "^3.7.7", "js-md5": "^0.7.3", "moment": "^2.29.4", "protobufjs": "^7.2.4", @@ -3928,9 +3928,9 @@ } }, "node_modules/js-base64": { - "version": "3.7.5", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", - "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" + "version": "3.7.7", + "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" }, "node_modules/js-md5": { "version": "0.7.3", @@ -9882,9 +9882,9 @@ } }, "js-base64": { - "version": "3.7.5", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", - "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" + "version": "3.7.7", + "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==" }, "js-md5": { "version": "0.7.3", diff --git a/package.json b/package.json index 63738af..0e72368 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "axios": "^0.21.1", "echarts": "^5.4.2", "element-plus": "^2.3.4", - "js-base64": "^3.7.5", + "js-base64": "^3.7.7", "js-md5": "^0.7.3", "moment": "^2.29.4", "protobufjs": "^7.2.4", diff --git a/src/components/AddMb.vue b/src/components/AddMb.vue index 1c548ef..b15f57d 100644 --- a/src/components/AddMb.vue +++ b/src/components/AddMb.vue @@ -36,7 +36,7 @@ export default { addForm: {}, rules: { name: [ - { required: true, message: "请输入模板名称", trigger: "blur" } + { required: true, message: "请输入模板名称", trigger: "blur" }, ], description: [ { required: true, message: "请输入模板描述", trigger: "blur" } diff --git a/src/components/AddPoint.vue b/src/components/AddPoint.vue index bf68c88..47200f1 100644 --- a/src/components/AddPoint.vue +++ b/src/components/AddPoint.vue @@ -5,7 +5,7 @@ - + @@ -48,6 +48,14 @@ export default { props: ["formData", "dialogVisible", "pointData", "type"], emits: ["dialogClose", "dialogSuccess"], setup(props, ctx) { + const checkAddress = (rule, value, callback) => { + let num = Number(value); + if (value && (num >= 0 && num <= 19999) || (num >= 30000 && num <= 49999)) { + callback(); + } else { + callback(new Error("点位地址:0-19999,30000-49999")); + } + }; const ruleFormRef = ref(null); const state = reactive({ addForm: { @@ -141,7 +149,10 @@ export default { ], rules: { name: [{ required: true, message: "请输入点位名称", trigger: "blur" }], - address: [{ required: true, message: "请输入点位地址", trigger: "blur" }], + address: [ + { required: true, message: "请输入点位地址", trigger: "blur" }, + { required: true, validator: checkAddress, trigger: "blur" } + ], type: [{ required: true, message: "请选择点位类型", trigger: "blur" }], byte_order: [{ required: true, message: "请选择字节顺序", trigger: "blur" }], multiplier: [{ required: true, message: "请输入缩放系数", trigger: "blur" }], @@ -174,7 +185,7 @@ export default { address: Number(state.addForm.address), multiplier: Number(state.addForm.multiplier) } - const res = props.type === 'I' ? await infoApi.addP(param): await infoApi.editP(param); + const res = props.type === 'I' ? await infoApi.addP(param) : await infoApi.editP(param); if (res.code == 0) { ElMessage.success(res.message || "请求成功"); ctx.emit("dialogSuccess"); diff --git a/src/components/AddSet copy.vue b/src/components/AddSet copy.vue deleted file mode 100644 index 4f4f5af..0000000 --- a/src/components/AddSet copy.vue +++ /dev/null @@ -1,262 +0,0 @@ - - - diff --git a/src/components/AddSet.vue b/src/components/AddSet.vue index f2a5daf..765d84b 100644 --- a/src/components/AddSet.vue +++ b/src/components/AddSet.vue @@ -1,11 +1,11 @@