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 68766182
authored
Sep 08, 2018
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
创建用户的提交
1 parent
d24284af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
32 deletions
src/components/UserCreate/src/main.vue
src/views/customer/user/index.vue
src/components/UserCreate/src/main.vue
View file @
6876618
...
...
@@ -37,16 +37,16 @@
<gl-col
:span=
"12"
>
<gl-form-item
label=
"状态"
prop=
"status"
>
<gl-select
v-model=
"userManageForm.status"
placeholder=
"启用"
>
<gl-option
label=
"
禁用"
value=
"jinyong
"
></gl-option>
<gl-option
label=
"
启用"
value=
"qiyong
"
></gl-option>
<gl-option
label=
"
启用"
value=
"启用
"
></gl-option>
<gl-option
label=
"
禁用"
value=
"禁用
"
></gl-option>
</gl-select>
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"管理员"
>
<gl-select
v-model=
"userManageForm.isAdministrator"
placeholder=
"否"
>
<gl-option
label=
"否"
value=
"
fou
"
></gl-option>
<gl-option
label=
"是"
value=
"
shi
"
></gl-option>
<gl-option
label=
"否"
value=
"
否
"
></gl-option>
<gl-option
label=
"是"
value=
"
是
"
></gl-option>
</gl-select>
</gl-form-item>
</gl-col>
...
...
@@ -108,19 +108,10 @@ export default {
roleOptions
:
[],
options
:
[{
value
:
'选项1'
,
label
:
'
黄金糕
'
label
:
'
总经办
'
},
{
value
:
'选项2'
,
label
:
'双皮奶'
},
{
value
:
'选项3'
,
label
:
'蚵仔煎'
},
{
value
:
'选项4'
,
label
:
'龙须面'
},
{
value
:
'选项5'
,
label
:
'北京烤鸭'
label
:
'研发中心-网络软件部'
}]
},
rules
:
{
...
...
@@ -164,11 +155,9 @@ export default {
})
},
submitForm
(
formName
)
{
console
.
log
(
this
.
userManageForm
)
// console.log(this.userManageForm)
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
$emit
(
'userFormData'
,
this
.
userManageForm
)
this
.
$emit
(
'userFormData'
,
this
.
$deep_clone
(
this
.
userManageForm
)
)
this
.
message
(
'创建角色成功'
,
'success'
)
}
else
{
return
false
...
...
src/views/customer/user/index.vue
View file @
6876618
...
...
@@ -10,7 +10,7 @@
<div
class=
"control-tabledata-button"
>
<gl-button
size=
"small"
@
click=
"createUser"
>
新增用户
</gl-button>
<gl-button
size=
"small"
@
click=
"delteSelected"
>
删除选中
</gl-button>
<user-form
:dialogFormVisible=
"dialogFormVisible"
@
userFormData=
"handleUserForm"
></user-form>
<user-form
:dialogFormVisible=
"dialogFormVisible"
@
userFormData=
"handleUserForm
Data
"
></user-form>
</div>
<div
class=
"m-b8"
>
<gl-table
:table=
"userData"
ref=
"multipleTable"
:pagination=
"pagination"
></gl-table>
...
...
@@ -109,23 +109,38 @@ export default {
mounted
()
{
getInfo
.
req
(
'/userList'
).
then
(
res
=>
{
this
.
userData
.
data
=
res
.
userData
console
.
log
(
this
.
userData
.
data
)
})
},
methods
:
{
// 接受子组件传递的值
handleUserForm
(
params
)
{
handleUserForm
Data
(
params
)
{
this
.
dialogFormVisible
=
false
// this.userDataCreate(data)
console
.
log
(
params
)
params
&&
this
.
userDataCreate
(
params
)
},
// 新增按钮
createUser
()
{
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
},
// 新增事件
userDataCreate
(
data
)
{
console
.
log
(
data
)
// const newData = { userId: '10' + data.length, userName: data.userName, actualName: data.actualName, isAdministrator: data.isAdministrator, phoneNumber: data.phoneNumber, status: data.status, }
userDataCreate
(
params
)
{
// this.dateFormat()
const
newData
=
{
userId
:
'100'
+
this
.
userData
.
data
.
length
,
userName
:
params
.
userName
,
actualName
:
params
.
actualName
,
isAdministrator
:
params
.
isAdministrator
,
phoneNumber
:
params
.
phoneNumber
,
status
:
params
.
status
,
userCreateTime
:
this
.
dateFormat
()
}
this
.
userData
.
data
.
push
(
newData
)
},
dateFormat
()
{
const
currentTime
=
new
Date
()
const
year
=
currentTime
.
getFullYear
()
const
month
=
currentTime
.
getMonth
()
+
1
const
day
=
currentTime
.
getDate
()
const
h
=
currentTime
.
getHours
()
const
m
=
currentTime
.
getHours
()
const
s
=
currentTime
.
getSeconds
()
const
createTime
=
year
+
'-'
+
month
+
'-'
+
day
+
' '
+
h
+
':'
+
m
+
':'
+
s
console
.
log
(
createTime
)
// const createDate = currentTime.toLocaleDateString().split('/').forEach((item) => { console.log(item) })
return
createTime
// const date = currentTime.toLocaleDateString().split('/').forEach((item) => { console.log(item) })
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
...
...
@@ -133,13 +148,6 @@ export default {
finduserName
()
{
this
.
userName
=
''
},
message
(
type
,
message
)
{
this
.
$message
({
showClose
:
true
,
type
:
type
,
message
:
message
})
},
delteSelected
()
{
},
confirmDeleteOrNot
(
index
,
rows
)
{
...
...
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