Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bigsys
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bigsys
Commits
39920b72
You need to sign in or sign up before continuing.
Commit
39920b72
authored
Sep 07, 2017
by
fangzhipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加user的增删改查
parent
99b21daa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
178 deletions
+9
-178
bigsys-auth/bigsys-auth-project/vue/src/router/index.js
bigsys-auth/bigsys-auth-project/vue/src/router/index.js
+4
-4
bigsys-auth/bigsys-auth-project/vue/src/store/getter.js
bigsys-auth/bigsys-auth-project/vue/src/store/getter.js
+2
-1
bigsys-auth/bigsys-auth-project/vue/src/store/index.js
bigsys-auth/bigsys-auth-project/vue/src/store/index.js
+3
-1
bigsys-auth/bigsys-auth-project/vue/src/views/components/MyTableWithFilter.vue
...th-project/vue/src/views/components/MyTableWithFilter.vue
+0
-96
bigsys-auth/bigsys-auth-project/vue/src/views/components/User.vue
...uth/bigsys-auth-project/vue/src/views/components/User.vue
+0
-76
No files found.
bigsys-auth/bigsys-auth-project/vue/src/router/index.js
View file @
39920b72
...
...
@@ -8,7 +8,7 @@ Vue.use(Router)
import
Layout
from
'
../views/layout/Layout
'
import
Login
from
'
../views/Login
'
import
MyTable
from
'
../views/components/MyTable
'
import
MyTableWithFilter
from
'
../views/components/MyTableWithFilt
er
'
import
user
from
'
../views/pages/us
er
'
/**
* icon : the icon show in the sidebar
...
...
@@ -21,16 +21,16 @@ export const constantRouterMap = [
{
path
:
'
/auth
'
,
component
:
Layout
,
name
:
'
用户
管理
'
,
name
:
'
权限
管理
'
,
children
:
[
{
path
:
'
index
'
,
component
:
MyTable
WithFilter
,
name
:
'
主页1
'
}
{
path
:
'
index
'
,
component
:
MyTable
,
name
:
'
主页1
'
}
]
},
{
path
:
'
/user
'
,
component
:
Layout
,
name
:
'
权限
'
,
children
:
[
{
path
:
'
index
'
,
component
:
MyTable
,
name
:
'
主页2
'
}
{
path
:
'
index
'
,
component
:
user
,
name
:
'
主页2
'
}
]
},
{
path
:
'
/
'
,
...
...
bigsys-auth/bigsys-auth-project/vue/src/store/getter.js
View file @
39920b72
const
getters
=
{
menus
:
state
=>
state
.
sidebar
.
menus
menus
:
state
=>
state
.
sidebar
.
menus
,
users
:
state
=>
state
.
users
.
users
}
export
default
getters
bigsys-auth/bigsys-auth-project/vue/src/store/index.js
View file @
39920b72
import
Vue
from
'
vue
'
import
Vuex
from
'
vuex
'
import
sidebar
from
'
./modules/sidebar
'
import
users
from
'
./modules/users
'
import
getters
from
'
./getter
'
Vue
.
use
(
Vuex
)
const
store
=
new
Vuex
.
Store
({
modules
:
{
sidebar
sidebar
,
users
},
getters
})
...
...
bigsys-auth/bigsys-auth-project/vue/src/views/components/MyTableWithFilter.vue
deleted
100644 → 0
View file @
99b21daa
<
template
>
<div>
<div>
<div
class=
"tb-filter"
>
<el-input
placeholder=
"用户名"
class=
"my-input"
v-model=
"username"
>
<template
slot=
"prepend"
>
用户名:
</
template
>
</el-input>
<el-input
placeholder=
"电话"
class=
"my-input"
v-model=
"username"
>
<
template
slot=
"prepend"
>
电话:
</
template
>
</el-input>
<el-button
type=
"primary"
@
click=
"dialogFormVisible = true"
>
新增
</el-button>
</div>
</div>
<my-table
:thead=
"thead"
:tdata=
"tdata"
></my-table>
<el-dialog
title=
"新增用户"
:visible.sync=
"dialogFormVisible"
>
<el-form
:label-position=
"labelPosition"
label-width=
"80px"
:model=
"formLabelAlign"
>
<el-form-item
label=
"用户名"
>
<el-input
v-model=
"formLabelAlign.name"
></el-input>
</el-form-item>
<el-form-item
label=
"电话"
>
<el-input
v-model=
"formLabelAlign.phone"
></el-input>
</el-form-item>
<el-form-item
label=
"密码"
>
<el-input
v-model=
"formLabelAlign.password"
type=
"password"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"addUser()"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<
style
>
.tb-filter
{
margin-bottom
:
20px
;
}
.my-input
{
width
:
200px
;
}
</
style
>
<
script
>
import
MyTable
from
'
./MyTable
'
import
{
thead
,
inittdata
}
from
'
../../mock/table
'
export
default
{
components
:
{
MyTable
},
data
()
{
return
{
username
:
'
fds
'
,
tdata
:
inittdata
,
dialogFormVisible
:
false
,
labelPosition
:
'
right
'
,
formLabelAlign
:
{
name
:
''
,
region
:
''
,
type
:
''
}
}
},
computed
:
{
thead
()
{
return
thead
}
},
watch
:
{
username
()
{
var
filterdata
=
[]
if
(
!
this
.
username
)
{
this
.
tdata
=
inittdata
return
}
inittdata
.
forEach
((
data
,
index
)
=>
{
if
(
data
.
name
.
indexOf
(
this
.
username
)
!==
-
1
)
{
filterdata
.
push
(
data
)
}
})
this
.
tdata
=
filterdata
}
},
methods
:
{
addUser
:
function
()
{
this
.
dialogFormVisible
=
false
this
.
$store
.
dispatch
(
'
TEST
'
,
this
.
formLabelAlign
).
then
(()
=>
{
alert
(
'
新增成功
'
)
}).
catch
(()
=>
{
alert
(
'
新增失败
'
)
})
}
}
}
</
script
>
bigsys-auth/bigsys-auth-project/vue/src/views/components/User.vue
deleted
100644 → 0
View file @
99b21daa
<
template
>
<div>
<div>
<div
class=
"tb-filter"
>
<el-input
placeholder=
"用户名"
class=
"my-input"
v-model=
"username"
>
<template
slot=
"prepend"
>
用户名:
</
template
>
</el-input>
<el-input
placeholder=
"电话"
class=
"my-input"
v-model=
"username"
>
<
template
slot=
"prepend"
>
电话:
</
template
>
</el-input>
<el-button
type=
"primary"
@
click=
"addUser()"
>
新增
</el-button>
</div>
</div>
<my-table
:thead=
"thead"
:tdata=
"tdata"
></my-table>
</div>
</template>
<
style
>
.tb-filter
{
margin-bottom
:
20px
;
}
.my-input
{
width
:
200px
;
}
</
style
>
<
script
>
import
MyTable
from
'
./MyTable
'
export
default
{
components
:
{
MyTable
},
data
()
{
return
{
username
:
'
测试
'
,
thead
:
[
{
prop
:
'
date
'
,
label
:
'
日期
'
,
width
:
'
180
'
},
{
prop
:
'
name
'
,
label
:
'
名称
'
,
width
:
'
180
'
},
{
prop
:
'
address
'
,
label
:
'
地址
'
}
],
tdata
:
[{
date
:
'
2016-05-04
'
,
name
:
'
王小虎
'
,
address
:
'
上海市普陀区金沙江路 1517 弄
'
},
{
date
:
'
2016-05-04
'
,
name
:
'
王小虎
'
,
address
:
'
上海市普陀区金沙江路 1517 弄
'
},
{
date
:
'
2016-05-01
'
,
name
:
'
王小虎
'
,
address
:
'
上海市普陀区金沙江路 1519 弄
'
},
{
date
:
'
2016-05-03
'
,
name
:
'
王小虎
'
,
address
:
'
上海市普陀区金沙江路 1516 弄
'
}]
}
},
methods
:
{
addUser
:
function
()
{
alert
(
'
添加一个用户
'
)
}
}
}
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment