Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大佬腿好粗
vue2-manage
提交
134101b4
V
vue2-manage
项目概览
大佬腿好粗
/
vue2-manage
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue2-manage
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
134101b4
编写于
5月 25, 2017
作者:
M
maguohua
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change login, header, ...some pages
上级
a5c368b3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
172 addition
and
22 deletion
+172
-22
README.md
README.md
+2
-4
build/dev-server.js
build/dev-server.js
+1
-1
src/api/getData.js
src/api/getData.js
+24
-1
src/components/headTop.vue
src/components/headTop.vue
+20
-3
src/page/adminList.vue
src/page/adminList.vue
+97
-2
src/page/foodList.vue
src/page/foodList.vue
+3
-4
src/page/login.vue
src/page/login.vue
+22
-3
src/page/shopList.vue
src/page/shopList.vue
+3
-4
未找到文件。
README.md
浏览文件 @
134101b4
...
...
@@ -53,13 +53,11 @@ npm run dev
-
[x] 管理用户
-
[x] 管理商铺
-
[x] 食品管理
-
[
] 权限验证
-
[
] 管理员设置
-
[
x
] 权限验证
-
[
x
] 管理员设置
-
[ ] 图表📈
-
[ ] 上传文件
-
[ ] 系统设置
-
[ ] 富文本编辑器
-
[ ] Markdown编辑器
# 项目截图
...
...
build/dev-server.js
浏览文件 @
134101b4
...
...
@@ -76,7 +76,7 @@ devMiddleware.waitUntilValid(() => {
console
.
log
(
'
> Listening at
'
+
uri
+
'
\n
'
)
// when env is testing, don't need open it
if
(
autoOpenBrowser
&&
process
.
env
.
NODE_ENV
!==
'
testing
'
)
{
//
opn(uri)
opn
(
uri
)
}
_resolve
()
})
...
...
src/api/getData.js
浏览文件 @
134101b4
import
fetch
from
'
@/config/fetch
'
/**
* 登陆
*/
const
login
=
data
=>
fetch
(
'
/admin/login
'
,
data
,
'
POST
'
);
/**
* 退出
*/
const
signout
=
()
=>
fetch
(
'
/admin/singout
'
);
/**
* 超级管理员列表
*/
const
adminList
=
data
=>
fetch
(
'
/admin/all
'
,
data
);
/**
* 超级管理员列表
*/
const
adminCount
=
()
=>
fetch
(
'
/admin/count
'
);
/**
* 获取定位城市
...
...
@@ -153,5 +176,5 @@ const getUserInfo = user_id => fetch('/v1/user/' + user_id);
const
getAddressById
=
address_id
=>
fetch
(
'
/v1/addresse/
'
+
address_id
);
export
{
cityGuess
,
addShop
,
searchplace
,
getCategory
,
addCategory
,
addFood
,
foodCategory
,
getResturants
,
getResturantDetail
,
getResturantsCount
,
updateResturant
,
deleteResturant
,
getFoods
,
getFoodsCount
,
getMenu
,
updateFood
,
getMenuById
,
deleteFood
,
getUserList
,
getUserCount
,
getOrderList
,
getOrderCount
,
getUserInfo
,
getAddressById
}
export
{
login
,
signout
,
adminList
,
adminCount
,
cityGuess
,
addShop
,
searchplace
,
getCategory
,
addCategory
,
addFood
,
foodCategory
,
getResturants
,
getResturantDetail
,
getResturantsCount
,
updateResturant
,
deleteResturant
,
getFoods
,
getFoodsCount
,
getMenu
,
updateFood
,
getMenuById
,
deleteFood
,
getUserList
,
getUserCount
,
getOrderList
,
getOrderCount
,
getUserInfo
,
getAddressById
}
src/components/headTop.vue
浏览文件 @
134101b4
...
...
@@ -16,14 +16,31 @@
</
template
>
<
script
>
import
{
signout
}
from
'
@/api/getData
'
export
default
{
created
(){
},
methods
:
{
handleCommand
(
command
)
{
this
.
$message
(
command
);
}
async
handleCommand
(
command
)
{
if
(
command
==
'
home
'
)
{
this
.
$router
.
push
(
'
/manage
'
);
}
else
if
(
command
==
'
singout
'
){
const
res
=
await
signout
()
if
(
res
.
status
==
1
)
{
this
.
$message
({
type
:
'
success
'
,
message
:
'
退出成功
'
});
this
.
$router
.
push
(
'
/
'
);
}
else
{
this
.
$message
({
type
:
'
error
'
,
message
:
res
.
message
});
}
}
},
}
}
</
script
>
...
...
src/page/adminList.vue
浏览文件 @
134101b4
<
template
>
<div
class=
"fillcontain"
>
adminList
<head-top></head-top>
<div
class=
"table_container"
>
<el-table
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"user_name"
label=
"姓名"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"create_time"
label=
"注册日期"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"admin"
label=
"权限"
>
</el-table-column>
</el-table>
<div
class=
"Pagination"
style=
"text-align: right;margin-top: 10px;"
>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"currentPage"
:page-size=
"20"
layout=
"total, prev, pager, next"
:total=
"count"
>
</el-pagination>
</div>
</div>
</div>
</
template
>
<
script
>
import
headTop
from
'
../components/headTop
'
import
{
adminList
,
adminCount
}
from
'
@/api/getData
'
export
default
{
data
(){
return
{
tableData
:
[],
currentRow
:
null
,
offset
:
0
,
limit
:
20
,
count
:
0
,
currentPage
:
1
,
}
},
components
:
{
headTop
,
},
created
(){
this
.
initData
();
},
methods
:
{
async
initData
(){
try
{
const
countData
=
await
adminCount
();
if
(
countData
.
status
==
1
)
{
this
.
count
=
countData
.
count
;
}
else
{
throw
new
Error
(
'
获取数据失败
'
);
}
this
.
getAdmin
();
}
catch
(
err
){
console
.
log
(
'
获取数据失败
'
,
err
);
}
},
handleSizeChange
(
val
)
{
console
.
log
(
`每页
${
val
}
条`
);
},
handleCurrentChange
(
val
)
{
this
.
currentPage
=
val
;
this
.
offset
=
(
val
-
1
)
*
this
.
limit
;
this
.
getAdmin
()
},
async
getAdmin
(){
try
{
const
res
=
await
adminList
({
offset
:
this
.
offset
,
limit
:
this
.
limit
});
if
(
res
.
status
==
1
)
{
this
.
tableData
=
[];
res
.
data
.
forEach
(
item
=>
{
const
tableItem
=
{
create_time
:
item
.
create_time
,
user_name
:
item
.
user_name
,
admin
:
item
.
admin
,
}
this
.
tableData
.
push
(
tableItem
)
})
}
else
{
throw
new
Error
(
res
.
message
)
}
}
catch
(
err
){
console
.
log
(
'
获取数据失败
'
,
err
);
}
}
},
}
</
script
>
<
style
lang=
"less"
>
@import '../style/mixin';
.table_container{
padding: 20px;
}
</
style
>
src/page/foodList.vue
浏览文件 @
134101b4
...
...
@@ -319,12 +319,12 @@
});
this
.
tableData
.
splice
(
index
,
1
);
}
else
{
throw
new
Error
(
'
删除食品失败
'
)
throw
new
Error
(
res
.
message
)
}
}
catch
(
err
){
this
.
$message
({
type
:
'
error
'
,
message
:
'
删除食品失败
'
message
:
err
.
message
});
console
.
error
(
'
删除食品失败
'
)
}
...
...
@@ -363,9 +363,8 @@
}
else
{
this
.
$message
({
type
:
'
error
'
,
message
:
'
更新食品信息失败
'
message
:
res
.
message
});
throw
new
Error
(
'
更新餐馆信息失败
'
)
}
}
catch
(
err
){
console
.
log
(
'
更新餐馆信息失败
'
,
err
);
...
...
src/page/login.vue
浏览文件 @
134101b4
...
...
@@ -16,12 +16,15 @@
<el-button
type=
"primary"
@
click=
"submitForm('loginForm')"
class=
"submit_btn"
>
登陆
</el-button>
</el-form-item>
</el-form>
<p
class=
"tip"
>
未登录过的新用户,自动注册成为普通管理员
</p>
<p
class=
"tip"
>
已注册过的用户不能重新注册
</p>
</section>
</transition>
</div>
</
template
>
<
script
>
import
{
login
}
from
'
@/api/getData
'
export
default
{
data
(){
return
{
...
...
@@ -44,10 +47,22 @@
this
.
showLogin
=
true
;
},
methods
:
{
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
async
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
this
.
$router
.
push
(
'
manage
'
)
const
res
=
await
login
({
user_name
:
this
.
loginForm
.
username
,
password
:
this
.
loginForm
.
password
})
if
(
res
.
status
==
1
)
{
this
.
$message
({
type
:
'
success
'
,
message
:
'
登录成功
'
});
this
.
$router
.
push
(
'
manage
'
)
}
else
{
this
.
$message
({
type
:
'
error
'
,
message
:
res
.
message
});
}
}
else
{
this
.
$notify
.
error
({
title
:
'
错误
'
,
...
...
@@ -89,6 +104,10 @@
font-size: 16px;
}
}
.tip{
font-size: 12px;
color: #666;
}
.form-fade-enter-active, .form-fade-leave-active {
transition: all 1s;
}
...
...
src/page/shopList.vue
浏览文件 @
134101b4
...
...
@@ -239,12 +239,12 @@
});
this
.
tableData
.
splice
(
index
,
1
);
}
else
{
throw
new
Error
(
'
删除店铺失败
'
)
throw
new
Error
(
res
.
message
)
}
}
catch
(
err
){
this
.
$message
({
type
:
'
error
'
,
message
:
'
删除店铺失败
'
message
:
err
.
message
});
console
.
error
(
'
删除店铺失败
'
)
}
...
...
@@ -303,9 +303,8 @@
}
else
{
this
.
$message
({
type
:
'
error
'
,
message
:
'
更新店铺信息失败
'
message
:
res
.
message
});
throw
new
Error
(
'
更新餐馆信息失败
'
)
}
}
catch
(
err
){
console
.
log
(
'
更新餐馆信息失败
'
,
err
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录