|
|
@@ -9,6 +9,7 @@
|
|
|
size="620px"
|
|
|
append-to-body
|
|
|
destroy-on-close
|
|
|
+ class="pd10"
|
|
|
:close-on-click-modal="false"
|
|
|
@close="onClose"
|
|
|
>
|
|
|
@@ -45,6 +46,8 @@
|
|
|
v-model="state.ruleForm.password"
|
|
|
placeholder="密码"
|
|
|
clearable
|
|
|
+ show-password
|
|
|
+ type="password"
|
|
|
class="w100">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -114,7 +117,7 @@ const formRef = ref();
|
|
|
//定义初始变量,重置使用
|
|
|
const initState = () => ({
|
|
|
ruleForm: {
|
|
|
- // id: 0
|
|
|
+ id: 0
|
|
|
},
|
|
|
btnLoading: false,
|
|
|
dialog: {
|
|
|
@@ -125,7 +128,7 @@ const initState = () => ({
|
|
|
},
|
|
|
rules: {
|
|
|
username: [u.validator.required],
|
|
|
- mobilePhone: [u.validator.required],
|
|
|
+ mobilePhone: [u.validator.required,u.validator.mobile],
|
|
|
nickname: [u.validator.required],
|
|
|
status: [u.validator.required],
|
|
|
password: [u.validator.required],
|
|
|
@@ -175,7 +178,11 @@ const onSubmit = () => {
|
|
|
if (valid) {
|
|
|
state.btnLoading = true;
|
|
|
const url = state.ruleForm.id > 0 ? "admin-user/modify" : "admin-user/add"
|
|
|
- $body(url, state.ruleForm).then(() => {
|
|
|
+ $body(url, state.ruleForm).then((id) => {
|
|
|
+ console.log(id)
|
|
|
+ if(id){
|
|
|
+ state.ruleForm.id = id;
|
|
|
+ }
|
|
|
state.btnLoading = false;
|
|
|
Msg.message('操作成功');
|
|
|
console.log('submit!')
|