Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
authority
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cbebde47
authored
Sep 29, 2018
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
用户名验证。添加loading
1 parent
96c1735d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
10 deletions
src/components/Tree/src/main.vue
src/components/UserCreate/src/main.vue
src/views/customer/role/index.vue
src/views/customer/user/index.vue
src/components/Tree/src/main.vue
View file @
cbebde4
...
...
@@ -11,6 +11,9 @@
:default-checked-keys=
"defaultCheckedKeys"
@
check=
'check'
@
node-click=
'nodeClick'
v-loading=
"loading"
gl-loading-text=
"拼命加载中"
gl-loading-icon=
"el-icon-loading"
></gl-tree>
</div>
</
template
>
...
...
@@ -22,13 +25,14 @@ export default {
data
()
{
return
{
data
:
null
,
loading
:
true
,
props
:
{
label
:
'text'
}
}
},
props
:
{
keyFresh
:
Boolean
,
keyFresh
:
[
Boolean
,
Array
,
Function
]
,
showCheckbox
:
Boolean
,
value
:
null
,
defaultExpandAll
:
Boolean
,
...
...
@@ -69,11 +73,13 @@ export default {
?
findMenuTree
.
req
().
then
(
res
=>
{
// console.log(res)
this
.
data
=
fn
(
res
,
'#'
)
this
.
loading
=
false
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
:
findDepartTree
.
req
().
then
(
res
=>
{
this
.
data
=
fn
(
res
,
'#'
)
this
.
loading
=
false
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
...
...
src/components/UserCreate/src/main.vue
View file @
cbebde4
...
...
@@ -4,6 +4,7 @@
<el-col
:span=
"12"
>
<gl-form-item
label=
"用户名"
prop=
"username"
>
<gl-input
v-model=
"userManageForm.username"
clearable
></gl-input>
<!--
<div
v-show=
"!isEdit"
class=
"err"
>
{{
msg
}}
</div>
-->
</gl-form-item>
</el-col>
<gl-col
:span=
"12"
>
...
...
@@ -20,12 +21,14 @@
</gl-col>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"手机号码"
prop=
"mobile"
>
<gl-input
v-model=
"userManageForm.mobile"
placeholder=
'请输入手机号码'
:prop=
"/1[358]\d
{9}/" clearable>
</gl-input>
<gl-masked
v-model=
"userManageForm.mobile"
:mask=
"[ 1, /[34578]/, /\d/, /\d/, /\d/,/\d/, /\d/, /\d/,/\d/, /\d/, /\d/]"
placeholder=
'请输入手机号码'
clearable
></gl-masked>
<!--
<gl-input
v-model=
"userManageForm.mobile"
placeholder=
'请输入手机号码'
:prop=
"tel"
clearable
></gl-input>
-->
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"注册IP"
prop=
"joinip"
>
<gl-input
v-model=
"userManageForm.joinip"
clearable
></gl-input>
<gl-masked
v-model=
"userManageForm.joinip"
:mask=
"tel"
placeholder=
'请输入手机号码'
clearable
></gl-masked>
<!--
<gl-input
v-model=
"userManageForm.joinip"
clearable
></gl-input>
-->
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
...
...
@@ -89,6 +92,7 @@ export default {
dialogFormVisible
:
Boolean
,
userManageForm
:
Object
,
isEdit
:
Boolean
// msg: String
},
components
:
{
userForm
...
...
@@ -116,7 +120,7 @@ export default {
placeholder
:
''
,
defaultExpandAll
:
true
,
val
:
''
,
tel
:
'[ 1, /[34578]/, /d/{9}]'
,
tel
:
"/\d{1,3}/, '.', /\d{1,3}/, '.', /\d{1,3}/,'.', /\d{1,3}/"
,
rules
:
{
username
:
[
{
required
:
true
,
message
:
'请输入用户名'
,
trigger
:
'blur'
}
...
...
@@ -178,6 +182,14 @@ export default {
return
true
}
},
// isPoneAvailable(pone) {
// this.tel = '/^[1][3,4,5,7,8][0-9]{9}$/'
// if (!this.tel.test(pone)) {
// return false
// } else {
// return true
// }
// },
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
this
.
userData
=
this
.
$deep_clone
(
this
.
userManageForm
)
...
...
src/views/customer/role/index.vue
View file @
cbebde4
...
...
@@ -63,6 +63,7 @@ export default {
data
:
[],
column
:
roleDataColumn
,
console
:
{
show
:
true
,
label
:
'操作'
,
prop
:
'roleOptions'
,
button
:
[{
...
...
src/views/customer/user/index.vue
View file @
cbebde4
...
...
@@ -42,6 +42,7 @@ export default {
isEdit
:
true
,
departList
:
[],
dialogFormVisible
:
false
,
// msg: '',
userManageForm
:
this
.
$deep_clone
(
userForm
),
userDetailVisible
:
false
,
userDetailTitle
:
'用户详情'
,
...
...
@@ -101,6 +102,7 @@ export default {
}
},
console
:
{
show
:
true
,
label
:
'操作'
,
prop
:
'operation'
,
button
:
[{
...
...
@@ -119,8 +121,8 @@ export default {
},
{
label
:
'禁用'
,
type
:
'text'
,
formatter
(
index
,
column
,
rows
)
{
column
.
label
=
rows
[
index
]
.
state
<
1
?
'启动'
:
'禁用'
formatter
(
row
)
{
return
row
.
state
<
1
?
'启动'
:
'禁用'
},
callback
:
(
index
,
rows
)
=>
{
this
.
$confirm
(
'确定要修改这条数据?'
,
''
,
{
...
...
@@ -209,9 +211,11 @@ export default {
console
.
log
(
res
)
this
.
message
(
'操作成功'
,
'success'
)
// this.createOrEditSuccess()
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
this
.
findUserList
()
}).
catch
(
message
=>
{
console
.
log
(
message
)
// this.msg = message
this
.
message
(
message
,
'error'
)
})
}
...
...
@@ -239,10 +243,18 @@ export default {
// 接受子组件传递的值
handleUserFormData
(
isEdit
,
params
)
{
console
.
log
(
params
)
this
.
userManageForm
=
{}
!
params
&&
this
.
message
(
'取消操作'
,
'info'
)
params
&&
this
.
updateUser_Post
(
params
)
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
// this.userManageForm = {}
if
(
params
)
{
this
.
updateUser_Post
(
params
)
}
else
{
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
this
.
message
(
'取消操作'
,
'info'
)
}
// !params && this.message('取消操作', 'info')
// params && this.updateUser_Post(params)
// if (!params) {
// this.dialogFormVisible = !this.dialogFormVisible
// }
},
// 新增按钮
createUser
(
userManageForm
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment