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 a06ceffb
authored
Sep 29, 2018
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
https://github.com/glsx-web/authority
2 parents
82c3190c
935bc948
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
24 deletions
src/components/Tree/src/main.vue
src/components/UserCreate/src/main.vue
src/views/customer/user/index.vue
src/components/Tree/src/main.vue
View file @
a06ceff
...
...
@@ -12,6 +12,9 @@
:check-strictly=
"checkStrictly"
@
check=
'check'
@
node-click=
'nodeClick'
v-loading=
"loading"
gl-loading-text=
"拼命加载中"
gl-loading-icon=
"el-icon-loading"
></gl-tree>
</div>
</
template
>
...
...
@@ -23,6 +26,7 @@ export default {
data
()
{
return
{
data
:
null
,
loading
:
true
,
checkStrictly
:
true
,
props
:
{
label
:
'text'
...
...
@@ -30,7 +34,7 @@ export default {
}
},
props
:
{
keyFresh
:
Boolean
,
keyFresh
:
[
Boolean
,
Array
,
Function
]
,
showCheckbox
:
Boolean
,
value
:
null
,
defaultExpandAll
:
Boolean
,
...
...
@@ -75,11 +79,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 @
a06ceff
...
...
@@ -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/user/index.vue
View file @
a06ceff
...
...
@@ -42,6 +42,7 @@ export default {
isEdit
:
true
,
departList
:
[],
dialogFormVisible
:
false
,
// msg: '',
userManageForm
:
this
.
$deep_clone
(
userForm
),
userDetailVisible
:
false
,
userDetailTitle
:
'用户详情'
,
...
...
@@ -101,7 +102,7 @@ export default {
}
},
console
:
{
//
show: true,
show
:
true
,
label
:
'操作'
,
prop
:
'operation'
,
button
:
[{
...
...
@@ -120,18 +121,26 @@ export default {
},
{
label
:
'禁用'
,
type
:
'text'
,
formatter
(
index
,
column
,
rows
)
{
console
.
log
(
rows
[
index
])
// column.label = rows[index].state < 1 ? '启动' : '禁用'
formatter
(
row
)
{
return
row
.
state
<
1
?
'启动'
:
'禁用'
},
callback
:
(
index
,
rows
)
=>
{
console
.
log
(
rows
[
index
].
state
)
if
(
rows
[
index
].
state
<
1
)
{
this
.
$set
(
rows
[
index
],
'state'
,
'1'
)
}
else
{
this
.
$set
(
rows
[
index
],
'state'
,
'0'
)
}
console
.
log
(
rows
[
index
].
state
)
this
.
$confirm
(
'确定要修改这条数据?'
,
''
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
if
(
rows
[
index
].
state
<
1
)
{
this
.
$set
(
rows
[
index
],
'state'
,
'1'
)
this
.
operatUser
({
id
:
rows
[
index
].
id
,
state
:
1
})
}
else
{
this
.
$set
(
rows
[
index
],
'state'
,
'0'
)
this
.
operatUser
({
id
:
rows
[
index
].
id
,
state
:
0
})
}
this
.
message
(
'修改成功'
,
'success'
)
}).
catch
(()
=>
{
this
.
message
(
'修改失败'
,
'info'
)
})
}
},
{
label
:
'删除'
,
...
...
@@ -202,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'
)
})
}
...
...
@@ -231,11 +242,19 @@ export default {
},
// 接受子组件传递的值
handleUserFormData
(
isEdit
,
params
)
{
this
.
userManageForm
=
{}
!
params
&&
this
.
message
(
'取消操作'
,
'warning'
)
console
.
log
(
this
.
userManageForm
.
roles
)
params
&&
this
.
updateUser_Post
(
params
)
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
console
.
log
(
params
)
// 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
)
{
...
...
@@ -245,6 +264,7 @@ export default {
},
// 编辑按钮
editUser
(
row
)
{
console
.
log
(
row
)
row
.
password
=
''
row
.
roleList
=
this
.
$deep_clone
(
userForm
.
roleList
)
row
.
state
=
row
.
state
+
''
...
...
@@ -259,8 +279,8 @@ export default {
if
(
row
.
roles
&&
typeof
(
row
.
roles
)
===
'string'
)
{
row
.
roles
=
(
row
.
roles
+
''
).
split
(
','
).
map
(
role
=>
+
role
)
}
else
{
console
.
log
(
12312
)
row
.
roles
=
[]
(
typeof
(
row
.
roles
)
===
'object'
)
&&
row
.
roles
!
(
typeof
(
row
.
roles
)
===
'object'
)
&&
[]
}
this
.
userManageForm
=
this
.
$deep_clone
(
row
)
})
...
...
@@ -288,9 +308,10 @@ export default {
}).
catch
(()
=>
{
this
.
message
(
'取消删除'
,
'info'
)
})
}
else
{
this
.
message
(
''
,
'操作失败'
)
}
// else {
// this.message('', '操作失败')
// }
},
// 提示
createOrEditSuccess
()
{
...
...
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