Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
计全科技
jeepay-ui
提交
703d7000
jeepay-ui
项目概览
计全科技
/
jeepay-ui
通知
11
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
jeepay-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
703d7000
编写于
6月 16, 2021
作者:
X
xiaoyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
编辑用户修改密码条件验证通过
上级
b522b151
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
61 addition
and
63 deletion
+61
-63
jeepay-ui-manager/src/views/sysuser/AddOrEdit.vue
jeepay-ui-manager/src/views/sysuser/AddOrEdit.vue
+61
-63
未找到文件。
jeepay-ui-manager/src/views/sysuser/AddOrEdit.vue
浏览文件 @
703d7000
<
template
>
<a-drawer
:title=
" isAdd ? '新增操作员' : '修改操作员' "
placement=
"right"
:closable=
"true"
@
ok=
"handleOkFunc"
:visible=
"isShow"
width=
"600"
@
close=
"onClose"
:maskClosable=
"false"
:title=
" isAdd ? '新增操作员' : '修改操作员' "
placement=
"right"
:closable=
"true"
@
ok=
"handleOkFunc"
:visible=
"isShow"
width=
"600"
@
close=
"onClose"
:maskClosable=
"false"
>
<!--
<a-modal
:confirmLoading=
"confirmLoading"
>
-->
<a-form-model
ref=
"infoFormModel"
:model=
"saveObject"
:label-col=
"
{span: 8}"
:wrapper-col="{span: 12}"
:rules="rules"
style="padding-bottom:50px">
ref=
"infoFormModel"
:model=
"saveObject"
:label-col=
"
{span: 8}"
:wrapper-col="{span: 12}"
:rules="rules"
style="padding-bottom:50px">
<a-form-model-item
label=
"用户登录名:"
prop=
"loginUsername"
>
<a-input
v-model=
"saveObject.loginUsername"
:disabled=
"!isAdd"
/>
...
...
@@ -56,27 +56,22 @@
</a-radio-group>
</a-form-model-item>
<a-divider
orientation=
"left"
>
<a-tag
color=
"#FF4B33"
>
账户安全
</a-tag>
</a-divider>
<a-form-model-item
label=
"重置密码:"
v-if=
"resetIsShow"
>
<a-checkbox
v-model=
"sysPassword.resetPass"
></a-checkbox>
</a-form-model-item>
<div
v-if=
"sysPassword.resetPass"
>
<a-form-model-item
label=
"
使用默认密码重置
:"
>
<a-form-model-item
label=
"
恢复默认密码
:"
>
<a-checkbox
v-model=
"sysPassword.defaultPass"
@
click=
"isResetPass"
></a-checkbox>
</a-form-model-item>
<div>
<!--
<div
v-if=
"sysPassword.defaultPass"
>
<a-form-model-item
label=
"新密码:"
>
<a-input-password
v-model=
"sysPassword.newPwd"
:disabled=
"sysPassword.defaultPass"
/>
</a-form-model-item>
<a-form-model-item
label=
"确认新密码:"
>
<a-input-password
v-model=
"sysPassword.confirmPwd"
:disabled=
"sysPassword.defaultPass"
/>
</a-form-model-item>
</div>
-->
<!--
<div
v-else
>
-->
<div>
<div
v-show=
"!this.sysPassword.defaultPass"
>
<a-form-model-item
label=
"新密码:"
prop=
"newPwd"
>
<a-input-password
autocomplete=
"new-password"
v-model=
"sysPassword.newPwd"
:disabled=
"sysPassword.defaultPass"
/>
</a-form-model-item>
...
...
@@ -86,7 +81,6 @@
</a-form-model-item>
</div>
</div>
</div>
<div
class=
"drawer-btn-center"
>
...
...
@@ -129,15 +123,20 @@ export default {
telphone
:
[{
required
:
true
,
pattern
:
/^
[
1
][
0-9
]{10}
$/
,
message
:
'
请输入正确的手机号码
'
,
trigger
:
'
blur
'
}],
userNo
:
[{
required
:
true
,
message
:
'
请输入编号
'
,
trigger
:
'
blur
'
}],
loginUsername
:
[],
newPwd
:
[{
required
:
false
,
min
:
6
,
max
:
12
,
message
:
'
请输入6-12位新密码
'
,
trigger
:
'
blur
'
},
{
newPwd
:
[{
required
:
false
,
trigger
:
'
blur
'
},
{
validator
:
(
rule
,
value
,
callBack
)
=>
{
this
.
sysPassword
.
defaultPass
===
true
?
callBack
()
:
callBack
(
'
请输入6-12位新密码
'
)
if
(
!
this
.
sysPassword
.
defaultPass
)
{
if
(
this
.
sysPassword
.
newPwd
.
length
<
6
||
this
.
sysPassword
.
newPwd
.
length
>
12
)
{
callBack
(
'
请输入6-12位新密码
'
)
}
}
callBack
()
}
}],
// 新密码
confirmPwd
:
[{
required
:
false
,
message
:
'
请确认输入新密码
'
,
trigger
:
'
blur
'
},
{
confirmPwd
:
[{
required
:
false
,
trigger
:
'
blur
'
},
{
validator
:
(
rule
,
value
,
callBack
)
=>
{
if
(
!
this
.
sysPassword
.
defaultPass
)
{
this
.
sysPassword
.
newPwd
===
value
?
callBack
()
:
callBack
(
'
新密码与确认密码不一致
'
)
this
.
sysPassword
.
newPwd
===
this
.
sysPassword
.
confirmPwd
?
callBack
()
:
callBack
(
'
新密码与确认密码不一致
'
)
}
else
{
callBack
()
}
...
...
@@ -184,38 +183,38 @@ export default {
}
},
handleOkFunc
:
function
()
{
// 点击【确认】按钮事件
const
that
=
this
this
.
$refs
.
infoFormModel
.
validate
(
valid
=>
{
if
(
valid
)
{
// 验证通过
// 请求接口
that
.
loading
=
true
// 打开按钮上的 loading
that
.
confirmLoading
=
true
// 显示loading
if
(
that
.
isAdd
)
{
req
.
add
(
API_URL_SYS_USER_LIST
,
that
.
saveObject
).
then
(
res
=>
{
that
.
$message
.
success
(
'
新增成功
'
)
that
.
isShow
=
false
that
.
loading
=
false
that
.
callbackFunc
()
// 刷新列表
}).
catch
((
res
)
=>
{
that
.
confirmLoading
=
false
})
}
else
{
Object
.
assign
(
that
.
saveObject
,
that
.
sysPassword
)
// 拼接对象
console
.
log
(
that
.
saveObject
)
req
.
updateById
(
API_URL_SYS_USER_LIST
,
that
.
recordId
,
that
.
saveObject
).
then
(
res
=>
{
that
.
$message
.
success
(
'
修改成功
'
)
that
.
isShow
=
false
that
.
callbackFunc
()
// 刷新列表
that
.
resetIsShow
=
false
// 取消展示
that
.
sysPassword
.
resetPass
=
false
}).
catch
(
res
=>
{
that
.
confirmLoading
=
false
that
.
resetIsShow
=
false
// 取消展示
that
.
sysPassword
.
resetPass
=
false
})
}
const
that
=
this
this
.
$refs
.
infoFormModel
.
validate
(
valid
=>
{
if
(
valid
)
{
// 验证通过
// 请求接口
that
.
loading
=
true
// 打开按钮上的 loading
that
.
confirmLoading
=
true
// 显示loading
if
(
that
.
isAdd
)
{
req
.
add
(
API_URL_SYS_USER_LIST
,
that
.
saveObject
).
then
(
res
=>
{
that
.
$message
.
success
(
'
新增成功
'
)
that
.
isShow
=
false
that
.
loading
=
false
that
.
callbackFunc
()
// 刷新列表
}).
catch
((
res
)
=>
{
that
.
confirmLoading
=
false
})
}
else
{
Object
.
assign
(
that
.
saveObject
,
that
.
sysPassword
)
// 拼接对象
console
.
log
(
that
.
saveObject
)
req
.
updateById
(
API_URL_SYS_USER_LIST
,
that
.
recordId
,
that
.
saveObject
).
then
(
res
=>
{
that
.
$message
.
success
(
'
修改成功
'
)
that
.
isShow
=
false
that
.
callbackFunc
()
// 刷新列表
that
.
resetIsShow
=
false
// 取消展示
that
.
sysPassword
.
resetPass
=
false
}).
catch
(
res
=>
{
that
.
confirmLoading
=
false
that
.
resetIsShow
=
false
// 取消展示
that
.
sysPassword
.
resetPass
=
false
})
}
})
}
})
},
// 关闭抽屉
onClose
()
{
...
...
@@ -226,7 +225,6 @@ export default {
// 使用默认密码重置是否为true
isResetPass
()
{
if
(
!
this
.
sysPassword
.
defaultPass
)
{
console
.
log
(
0
)
this
.
sysPassword
.
newPwd
=
''
this
.
sysPassword
.
confirmPwd
=
''
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录