Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
1532635456
gin-vue-admin
提交
02bb58a3
G
gin-vue-admin
项目概览
1532635456
/
gin-vue-admin
落后 Fork 源项目 1212 个版本
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
02bb58a3
编写于
12月 12, 2019
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
前端页面布局修改,后台数据库结构变化,需要重新导入数据库才可使用
上级
18fefa62
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
55 addition
and
58 deletion
+55
-58
QMPlusServer/model/dbModel/exa_fileUploadAndDownload.go
QMPlusServer/model/dbModel/exa_fileUploadAndDownload.go
+1
-1
QMPlusServer/model/sysModel/sys_base_menu.go
QMPlusServer/model/sysModel/sys_base_menu.go
+9
-4
QMPlusServer/model/sysModel/sys_menu_authority.go
QMPlusServer/model/sysModel/sys_menu_authority.go
+2
-2
QMPlusVuePage/src/App.vue
QMPlusVuePage/src/App.vue
+7
-11
QMPlusVuePage/src/view/layout/index.vue
QMPlusVuePage/src/view/layout/index.vue
+36
-40
未找到文件。
QMPlusServer/model/dbModel/exa_fileUploadAndDownload.go
浏览文件 @
02bb58a3
...
...
@@ -21,7 +21,7 @@ func (f *ExaFileUploadAndDownload) Upload() error {
}
func
(
f
*
ExaFileUploadAndDownload
)
DeleteFile
()
error
{
err
:=
qmsql
.
DEFAULTDB
.
Where
(
"id = ?"
,
f
.
ID
)
.
Delete
(
f
)
.
Error
err
:=
qmsql
.
DEFAULTDB
.
Where
(
"id = ?"
,
f
.
ID
)
.
Unscoped
()
.
Delete
(
f
)
.
Error
return
err
}
...
...
QMPlusServer/model/sysModel/sys_base_menu.go
浏览文件 @
02bb58a3
...
...
@@ -17,6 +17,7 @@ type SysBaseMenu struct {
Name
string
`json:"name"`
Hidden
bool
`json:"hidden"`
Component
string
`json:"component"`
Sort
string
`json:"sort"`
Meta
`json:"meta"`
NickName
string
`json:"nickName"`
Children
[]
SysBaseMenu
`json:"children"`
...
...
@@ -53,9 +54,10 @@ func (b *SysBaseMenu) UpdataBaseMenu() (err error) {
upDataMap
[
"component"
]
=
b
.
Component
upDataMap
[
"title"
]
=
b
.
Title
upDataMap
[
"icon"
]
=
b
.
Icon
upDataMap
[
"sort"
]
=
b
.
Sort
err
=
qmsql
.
DEFAULTDB
.
Where
(
"id = ?"
,
b
.
ID
)
.
Find
(
&
SysBaseMenu
{})
.
Updates
(
upDataMap
)
.
Error
err1
:=
qmsql
.
DEFAULTDB
.
Where
(
"menu_id = ?"
,
b
.
ID
)
.
Find
(
&
[]
SysMenu
{})
.
Updates
(
upDataMap
)
.
Error
fmt
.
Printf
(
"菜单修改时候,关联菜单err
:%v"
,
err1
)
fmt
.
Printf
(
"菜单修改时候,关联菜单err
1:%v,err:%v"
,
err1
,
err
)
return
err
}
...
...
@@ -71,14 +73,17 @@ func (b *SysBaseMenu) GetInfoList(info modelInterface.PageInfo) (err error, list
return
}
else
{
var
menuList
[]
SysBaseMenu
err
=
db
.
Find
(
&
menuList
)
.
Error
err
=
db
.
Where
(
"parent_id = 0"
)
.
Order
(
"sort"
,
true
)
.
Find
(
&
menuList
)
.
Error
for
i
:=
0
;
i
<
len
(
menuList
);
i
++
{
err
=
getBaseChildrenList
(
&
menuList
[
i
])
}
return
err
,
menuList
,
total
}
}
//获取基础路由树
func
(
m
*
SysBaseMenu
)
GetBaseMenuTree
()
(
err
error
,
menus
[]
SysBaseMenu
)
{
err
=
qmsql
.
DEFAULTDB
.
Where
(
" parent_id = ?"
,
0
)
.
Find
(
&
menus
)
.
Error
err
=
qmsql
.
DEFAULTDB
.
Where
(
" parent_id = ?"
,
0
)
.
Order
(
"sort"
,
true
)
.
Find
(
&
menus
)
.
Error
for
i
:=
0
;
i
<
len
(
menus
);
i
++
{
err
=
getBaseChildrenList
(
&
menus
[
i
])
}
...
...
@@ -86,7 +91,7 @@ func (m *SysBaseMenu) GetBaseMenuTree() (err error, menus []SysBaseMenu) {
}
func
getBaseChildrenList
(
menu
*
SysBaseMenu
)
(
err
error
)
{
err
=
qmsql
.
DEFAULTDB
.
Where
(
"parent_id = ?"
,
menu
.
ID
)
.
Find
(
&
menu
.
Children
)
.
Error
err
=
qmsql
.
DEFAULTDB
.
Where
(
"parent_id = ?"
,
menu
.
ID
)
.
Order
(
"sort"
,
true
)
.
Find
(
&
menu
.
Children
)
.
Error
for
i
:=
0
;
i
<
len
(
menu
.
Children
);
i
++
{
err
=
getBaseChildrenList
(
&
menu
.
Children
[
i
])
}
...
...
QMPlusServer/model/sysModel/sys_menu_authority.go
浏览文件 @
02bb58a3
...
...
@@ -43,7 +43,7 @@ func (m *SysMenu) GetMenuAuthority(authorityId string) (err error, menus []SysMe
//获取动态路由树
func
(
m
*
SysMenu
)
GetMenuTree
(
authorityId
string
)
(
err
error
,
menus
[]
SysMenu
)
{
err
=
qmsql
.
DEFAULTDB
.
Where
(
"authority_id = ? AND parent_id = ?"
,
authorityId
,
0
)
.
Find
(
&
menus
)
.
Error
err
=
qmsql
.
DEFAULTDB
.
Where
(
"authority_id = ? AND parent_id = ?"
,
authorityId
,
0
)
.
Order
(
"sort"
,
true
)
.
Find
(
&
menus
)
.
Error
for
i
:=
0
;
i
<
len
(
menus
);
i
++
{
err
=
getChildrenList
(
&
menus
[
i
])
}
...
...
@@ -51,7 +51,7 @@ func (m *SysMenu) GetMenuTree(authorityId string) (err error, menus []SysMenu) {
}
func
getChildrenList
(
menu
*
SysMenu
)
(
err
error
)
{
err
=
qmsql
.
DEFAULTDB
.
Where
(
"authority_id = ? AND parent_id = ?"
,
menu
.
AuthorityId
,
menu
.
MenuId
)
.
Find
(
&
menu
.
Children
)
.
Error
err
=
qmsql
.
DEFAULTDB
.
Where
(
"authority_id = ? AND parent_id = ?"
,
menu
.
AuthorityId
,
menu
.
MenuId
)
.
Order
(
"sort"
,
true
)
.
Find
(
&
menu
.
Children
)
.
Error
for
i
:=
0
;
i
<
len
(
menu
.
Children
);
i
++
{
err
=
getChildrenList
(
&
menu
.
Children
[
i
])
}
...
...
QMPlusVuePage/src/App.vue
浏览文件 @
02bb58a3
...
...
@@ -5,22 +5,18 @@
</
template
>
<
script
>
export
default
{
name
:
'
app
'
,
components
:
{
},
components
:
{}
}
</
script
>
<
style
lang=
"scss"
>
// 引入初始化样式
@import
'@/style/main.scss'
;
@import
'@/style/base.scss'
;
#app
{
background
:
#eee
;
}
@import
'@/style/main.scss'
;
@import
'@/style/base.scss'
;
#app
{
background
:
#eee
;
height
:
100vh
;
}
</
style
>
QMPlusVuePage/src/view/layout/index.vue
浏览文件 @
02bb58a3
...
...
@@ -2,15 +2,16 @@
<el-container
class=
"layout-cont"
>
<el-container>
<el-aside
class=
"main-cont main-left"
>
<h1
class=
"admin-title"
:class=
"isCollapse&&'collapse'"
>
<img
:src=
"require('@/assets/logo.png')"
height=
"40"
width=
"40"
/>
Gin-Vue-Admin
</h1>
<Aside
class=
"aside"
/>
</el-aside>
<!-- 分块滑动功能 -->
<el-main
class=
"main-cont main-right"
>
<el-header
class=
"header-cont"
>
<div
@
click=
"totalCollapse"
class=
"menu-total"
>
<i
class=
"el-icon-s-unfold"
v-if=
"isCollapse"
></i>
<i
class=
"el-icon-s-fold"
v-else
></i>
</div>
<h1
class=
"admin-title"
>
Gin-Vue-Admin
</h1>
<div
class=
"fl-right right-box"
>
<el-dropdown>
<span
class=
"el-dropdown-link"
>
...
...
@@ -32,15 +33,16 @@
</div>
</el-header>
<!-- 当前面包屑用路由自动生成可根据需求修改 -->
<!--
:to="
{ path: item.path }" 暂时注释不用-->
<el-breadcrumb
class=
"breadcrumb"
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
:key=
"item.path"
:to=
"
{ path: item.path }"
v-for=
"item in matched.slice(1,matched.length)"
>
{{
item
.
meta
.
title
}}
</el-breadcrumb-item>
</el-breadcrumb>
<transition
mode=
"out-in"
name=
"el-fade-in-linear"
>
<router-view></router-view>
<router-view
class=
"admin-box"
></router-view>
</transition>
</el-main>
</el-container>
...
...
@@ -52,9 +54,9 @@ import Aside from '@/view/layout/aside'
import
{
mapGetters
,
mapMutations
}
from
'
vuex
'
export
default
{
name
:
'
Layout
'
,
data
(){
return
{
isCollapse
:
false
data
()
{
return
{
isCollapse
:
false
}
},
components
:
{
...
...
@@ -63,6 +65,7 @@ export default {
methods
:
{
...
mapMutations
(
'
user
'
,
[
'
LoginOut
'
]),
totalCollapse
()
{
this
.
isCollapse
=
!
this
.
isCollapse
this
.
$bus
.
emit
(
'
totalCollapse
'
)
},
toPerson
()
{
...
...
@@ -77,22 +80,13 @@ export default {
matched
()
{
return
this
.
$route
.
matched
}
},
created
(){
this
.
$bus
.
on
(
'
totalCollapse
'
,
()
=>
{
this
.
isCollapse
=
!
this
.
isCollapse
console
.
log
(
this
.
isCollapse
)
})
},
beforeDestroy
()
{
this
.
$bus
.
off
(
'
totalCollapse
'
)
}
}
</
script
>
<
style
lang=
"scss"
>
$headerHigh
:
52px
;
$mainHight
:
calc
(
100vh
-
52px
)
;
$mainHight
:
100vh
;
.el-dropdown-link
{
cursor
:
pointer
;
}
...
...
@@ -122,7 +116,7 @@ $mainHight: calc(100vh - 52px);
.header-cont
{
height
:
$headerHigh
!
important
;
background
:
#fff
;
bo
rder-bottom
:
1px
solid
#ccc
;
bo
x-shadow
:
0
1px
4px
rgba
(
0
,
21
,
41
,
0
.08
)
;
line-height
:
$headerHigh
;
}
.main-cont
{
...
...
@@ -141,16 +135,20 @@ $mainHight: calc(100vh - 52px);
overflow
:
visible
;
position
:
relative
;
.menu-total
{
z-index
:
5
;
position
:
absolute
;
top
:
50%
;
margin-top
:
-10px
;
line-height
:
20px
;
font-size
:
20px
;
border
:
0
solid
#ffffff
;
border-radius
:
50%
;
right
:
-10px
;
background
:
#fff
;
// z-index: 5;
// position: absolute;
// top: 10px;
// right: -35px;
margin-left
:
-10px
;
float
:
left
;
margin-top
:
10px
;
width
:
30px
;
height
:
30px
;
line-height
:
30px
;
font-size
:
30px
;
// border: 0 solid #ffffff;
// border-radius: 50%;
// background: #fff;
}
.aside
{
overflow
:
auto
;
...
...
@@ -161,10 +159,10 @@ $mainHight: calc(100vh - 52px);
}
.el-menu-vertical
{
height
:
calc
(
100vh
-
60px
)
!
important
;
height
:
100vh
!
important
;
visibility
:
auto
;
&
:not
(
.el-menu--collapse
)
{
width
:
2
5
0px
;
width
:
2
2
0px
;
}
}
...
...
@@ -173,19 +171,17 @@ $mainHight: calc(100vh - 52px);
}
&
.main-left
{
width
:
auto
!
important
;
}
&
.main-right
{
.admin-title
{
padding-left
:
10px
;
font-size
:
1
8
px
;
float
:
left
;
font-size
:
1
6
px
;
vertical-align
:
middle
;
width
:
240px
;
background
:
#0F3D5F
;
color
:
#fff
;
margin-left
:
20px
;
img
{
vertical-align
:
middle
;
}
height
:
60px
;
line-height
:
60px
;
&
.collapse
{
&
.collapse
{
width
:
53px
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录