1.已添加数字校验

master
x_z 3 years ago
parent c54747be55
commit bf2915e60d

@ -189,8 +189,6 @@
this.loading = false; this.loading = false;
this.list = response.data.list || []; this.list = response.data.list || [];
this.total = response.data.total || 0; this.total = response.data.total || 0;
console.log("------------");
console.log(response);
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
@ -228,15 +226,17 @@
} }
}, },
formSubmit() { formSubmit() {
if (!Number.isInteger(parseInt(this.formData.paramValue))) {
this.$message.warning("参数值必须为数字");
return;
}
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (valid) { if (valid) {
this.formLoading = true; this.formLoading = true;
let data = Object.assign({}, this.formData); let data = Object.assign({}, this.formData);
console.log("------2------");
data.paramValue = data.paramValue.trim(); data.paramValue = data.paramValue.trim();
systemParamConfigSave(data, this.formName) systemParamConfigSave(data, this.formName)
.then((response) => { .then((response) => {
console.log(response);
this.formLoading = false; this.formLoading = false;
if (response.code != 20000) { if (response.code != 20000) {
this.$message.error(response.message); this.$message.error(response.message);

Loading…
Cancel
Save