1.添加字符串处理工具方法

2.用户编辑页面提交方法添加参数校验
fencang
x_z 3 years ago
parent 2b9edf5537
commit e070d6b578

@ -0,0 +1,7 @@
//封装字符串相关的方法
export function isBlank(value) {
value = value.trim();
if (value === "" || value === null || value === "string") {
return true;
}
}

@ -195,6 +195,7 @@ import {
import store from "../../../store/index";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil";
const formJson = {
id: "",
@ -364,6 +365,20 @@ export default {
}
},
formSubmit() {
if (isBlank(this.formData.userName)) {
this.$message.error("用户账号不能为空");
return;
} else if (isBlank(this.formData.passWord)) {
this.$message.error("密码不能为空")
return;
}else if (isBlank(this.formData.employeeName)) {
this.$message.error("用户名称不能为空");
return;
} else if (this.formData.roles.length === 0) {
this.$message.error("未指定角色!")
return;
}
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.formLoading = true;

Loading…
Cancel
Save