Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
39b078db
Commit
39b078db
authored
Sep 30, 2022
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页根据传值隐藏
parent
fc952a7f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
59 deletions
+89
-59
index.vue
danger-manage-web/src/components/Breadcrumb/index.vue
+36
-24
permission.js
danger-manage-web/src/permission.js
+45
-30
getters.js
danger-manage-web/src/store/getters.js
+2
-1
user.js
danger-manage-web/src/store/modules/user.js
+1
-0
cesiumClass.js
danger-manage-web/src/utils/cesium/cesiumClass.js
+2
-1
index.vue
danger-manage-web/src/views/dangerScale/profile/index.vue
+3
-3
No files found.
danger-manage-web/src/components/Breadcrumb/index.vue
View file @
39b078db
<
template
>
<
template
>
<el-breadcrumb
class=
"app-breadcrumb"
separator=
"/"
>
<el-breadcrumb
class=
"app-breadcrumb"
separator=
"/"
>
<transition-group
name=
"breadcrumb"
>
<transition-group
name=
"breadcrumb"
>
<el-breadcrumb-item
v-for=
"(item,index) in levelList"
:key=
"item.path"
>
<el-breadcrumb-item
v-for=
"(item, index) in levelList"
:key=
"item.path"
>
<span
v-if=
"item.redirect==='noRedirect'||index==levelList.length-1"
class=
"no-redirect"
>
{{
item
.
meta
.
title
}}
</span>
<span
v-if=
"item.redirect === 'noRedirect' || index == levelList.length - 1"
class=
"no-redirect"
>
{{
item
.
meta
.
title
}}
</span
>
<a
v-else
@
click
.
prevent=
"handleLink(item)"
>
{{
item
.
meta
.
title
}}
</a>
<a
v-else
@
click
.
prevent=
"handleLink(item)"
>
{{
item
.
meta
.
title
}}
</a>
</el-breadcrumb-item>
</el-breadcrumb-item>
</transition-group>
</transition-group>
...
@@ -10,53 +14,61 @@
...
@@ -10,53 +14,61 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
store
from
"@/store"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
levelList
:
null
levelList
:
null
,
}
}
;
},
},
watch
:
{
watch
:
{
$route
(
route
)
{
$route
(
route
)
{
// if you go to the redirect page, do not update the breadcrumbs
// if you go to the redirect page, do not update the breadcrumbs
if
(
route
.
path
.
startsWith
(
'/redirect/'
))
{
if
(
route
.
path
.
startsWith
(
"/redirect/"
))
{
return
return
;
}
}
this
.
getBreadcrumb
()
this
.
getBreadcrumb
()
;
}
}
,
},
},
created
()
{
created
()
{
this
.
getBreadcrumb
()
this
.
getBreadcrumb
()
;
},
},
methods
:
{
methods
:
{
getBreadcrumb
()
{
getBreadcrumb
()
{
// only show routes with meta.title
// only show routes with meta.title
let
matched
=
this
.
$route
.
matched
.
filter
(
item
=>
item
.
meta
&&
item
.
meta
.
title
)
let
matched
=
this
.
$route
.
matched
.
filter
(
const
first
=
matched
[
0
]
(
item
)
=>
item
.
meta
&&
item
.
meta
.
title
);
const
first
=
matched
[
0
];
if
(
!
this
.
isDashboard
(
first
))
{
if
(
matched
=
[{
path
:
'/index'
,
meta
:
{
title
:
'首页'
}}].
concat
(
matched
)
!
this
.
isDashboard
(
first
)
&&
store
.
getters
.
systemSetting
.
show_index
===
"1"
)
{
matched
=
[{
path
:
"/index"
,
meta
:
{
title
:
"首页"
}
}].
concat
(
matched
);
}
}
this
.
levelList
=
matched
.
filter
(
item
=>
item
.
meta
&&
item
.
meta
.
title
&&
item
.
meta
.
breadcrumb
!==
false
)
this
.
levelList
=
matched
.
filter
(
(
item
)
=>
item
.
meta
&&
item
.
meta
.
title
&&
item
.
meta
.
breadcrumb
!==
false
);
},
},
isDashboard
(
route
)
{
isDashboard
(
route
)
{
const
name
=
route
&&
route
.
name
const
name
=
route
&&
route
.
name
;
if
(
!
name
)
{
if
(
!
name
)
{
return
false
return
false
;
}
}
return
name
.
trim
()
===
'首页'
return
name
.
trim
()
===
"首页"
;
},
},
handleLink
(
item
)
{
handleLink
(
item
)
{
const
{
redirect
,
path
}
=
item
const
{
redirect
,
path
}
=
item
;
if
(
redirect
)
{
if
(
redirect
)
{
this
.
$router
.
push
(
redirect
)
this
.
$router
.
push
(
redirect
)
;
return
return
;
}
}
this
.
$router
.
push
(
path
)
this
.
$router
.
push
(
path
)
;
}
}
,
}
}
,
}
}
;
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
danger-manage-web/src/permission.js
View file @
39b078db
import
router
from
'./router'
import
router
from
"./router"
;
import
store
from
'./store'
import
store
from
"./store"
;
import
{
Message
}
from
'element-ui'
import
{
Message
}
from
"element-ui"
;
import
NProgress
from
'nprogress'
import
NProgress
from
"nprogress"
;
import
'nprogress/nprogress.css'
import
"nprogress/nprogress.css"
;
import
{
getToken
}
from
'@/utils/auth'
import
{
getToken
}
from
"@/utils/auth"
;
NProgress
.
configure
({
showSpinner
:
false
})
NProgress
.
configure
({
showSpinner
:
false
})
;
const
whiteList
=
[
'/login'
,
'/auth-redirect'
,
'/bind'
,
'/register'
]
const
whiteList
=
[
"/login"
,
"/auth-redirect"
,
"/bind"
,
"/register"
];
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
NProgress
.
start
()
;
if
(
getToken
())
{
if
(
getToken
())
{
/* has token*/
/* has token*/
if
(
to
.
path
===
'/login'
)
{
if
(
to
.
path
===
"/login"
)
{
next
({
path
:
'/'
})
next
({
path
:
"/"
});
NProgress
.
done
()
NProgress
.
done
()
;
}
else
{
}
else
{
if
(
store
.
getters
.
roles
.
length
===
0
)
{
if
(
store
.
getters
.
roles
.
length
===
0
)
{
// 判断当前用户是否已拉取完user_info信息
// 判断当前用户是否已拉取完user_info信息
store
.
dispatch
(
'GetInfo'
).
then
(()
=>
{
store
store
.
dispatch
(
'GenerateRoutes'
).
then
(
accessRoutes
=>
{
.
dispatch
(
"GetInfo"
)
// 根据roles权限生成可访问的路由表
.
then
(()
=>
{
router
.
addRoutes
(
accessRoutes
)
// 动态添加可访问路由表
store
.
dispatch
(
"GenerateRoutes"
).
then
((
accessRoutes
)
=>
{
next
({
...
to
,
replace
:
true
})
// hack方法 确保addRoutes已完成
// 根据roles权限生成可访问的路由表
})
router
.
addRoutes
(
accessRoutes
);
// 动态添加可访问路由表
}).
catch
(
err
=>
{
// 让首页隐藏
store
.
dispatch
(
'LogOut'
).
then
(()
=>
{
console
.
log
(
accessRoutes
);
Message
.
error
(
err
)
// 如果这个值是0,就不展示首页,展示最近的页面
next
({
path
:
'/'
})
if
(
store
.
getters
.
systemSetting
.
show_index
===
"0"
)
{
})
router
.
options
.
routes
[
4
].
children
[
0
].
hidden
=
true
;
if
(
accessRoutes
[
0
].
children
)
{
next
({
...
accessRoutes
[
0
].
children
[
0
]
});
}
}
else
{
next
({
...
to
,
replace
:
true
});
// hack方法 确保addRoutes已完成
}
// console.log("accessRoutes",accessRoutes)
// console.log("to",to)
});
})
})
.
catch
((
err
)
=>
{
store
.
dispatch
(
"LogOut"
).
then
(()
=>
{
Message
.
error
(
err
);
next
({
path
:
"/"
});
});
});
}
else
{
}
else
{
next
()
next
()
;
}
}
}
}
}
else
{
}
else
{
// 没有token
// 没有token
if
(
whiteList
.
indexOf
(
to
.
path
)
!==
-
1
)
{
if
(
whiteList
.
indexOf
(
to
.
path
)
!==
-
1
)
{
// 在免登录白名单,直接进入
// 在免登录白名单,直接进入
next
()
next
()
;
}
else
{
}
else
{
next
(
`/login?redirect=
${
to
.
fullPath
}
`
)
// 否则全部重定向到登录页
next
(
`/login?redirect=
${
to
.
fullPath
}
`
)
;
// 否则全部重定向到登录页
NProgress
.
done
()
NProgress
.
done
()
;
}
}
}
}
})
})
;
router
.
afterEach
(()
=>
{
router
.
afterEach
(()
=>
{
NProgress
.
done
()
NProgress
.
done
()
;
})
})
;
danger-manage-web/src/store/getters.js
View file @
39b078db
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-14 12:25:28
* @Date: 2022-09-14 12:25:28
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-
26 16:03:27
* @LastEditTime: 2022-09-
30 14:57:49
* @FilePath: /danger-manage-web/src/store/getters.js
* @FilePath: /danger-manage-web/src/store/getters.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -19,6 +19,7 @@ const getters = {
...
@@ -19,6 +19,7 @@ const getters = {
roles
:
state
=>
state
.
user
.
roles
,
roles
:
state
=>
state
.
user
.
roles
,
permissions
:
state
=>
state
.
user
.
permissions
,
permissions
:
state
=>
state
.
user
.
permissions
,
permission_routes
:
state
=>
state
.
permission
.
routes
,
permission_routes
:
state
=>
state
.
permission
.
routes
,
systemSetting
:
state
=>
state
.
user
.
systemSetting
,
topbarRouters
:
state
=>
state
.
permission
.
topbarRouters
,
topbarRouters
:
state
=>
state
.
permission
.
topbarRouters
,
defaultRoutes
:
state
=>
state
.
permission
.
defaultRoutes
,
defaultRoutes
:
state
=>
state
.
permission
.
defaultRoutes
,
sidebarRouters
:
state
=>
state
.
permission
.
sidebarRouters
,
sidebarRouters
:
state
=>
state
.
permission
.
sidebarRouters
,
...
...
danger-manage-web/src/store/modules/user.js
View file @
39b078db
...
@@ -35,6 +35,7 @@ const user = {
...
@@ -35,6 +35,7 @@ const user = {
},
},
SET_SYSTEMSETTING
:
(
state
,
systemSetting
)
=>
{
SET_SYSTEMSETTING
:
(
state
,
systemSetting
)
=>
{
state
.
systemSetting
=
systemSetting
state
.
systemSetting
=
systemSetting
console
.
log
(
"systemSetting"
,
systemSetting
)
}
}
},
},
...
...
danger-manage-web/src/utils/cesium/cesiumClass.js
View file @
39b078db
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2021-12-07 14:19:18
* @Date: 2021-12-07 14:19:18
* @LastEditTime: 2022-09-
29 20:08:5
4
* @LastEditTime: 2022-09-
30 13:32:4
4
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /cesium-vue/src/utils/seieumClass.js
* @FilePath: /cesium-vue/src/utils/seieumClass.js
...
@@ -835,6 +835,7 @@ export default class CreateCesium {
...
@@ -835,6 +835,7 @@ export default class CreateCesium {
// alignedAxis: Cesium.Cartesian3.ZERO, // default
// alignedAxis: Cesium.Cartesian3.ZERO, // default
// width: 20, // default: undefined
// width: 20, // default: undefined
// height: 20, // default: undefined
// height: 20, // default: undefined
// sizeInMeters: true, //是否开启屋里大小
},
},
label
:
{
label
:
{
text
:
`
${
title
}
`
,
text
:
`
${
title
}
`
,
...
...
danger-manage-web/src/views/dangerScale/profile/index.vue
View file @
39b078db
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-
29 20:47:06
* @LastEditTime: 2022-09-
30 11:22:07
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
...
@@ -53,8 +53,8 @@ export default {
...
@@ -53,8 +53,8 @@ export default {
},
},
{
{
deviceType
:
1
,
deviceType
:
1
,
longitude
:
114.
14649648472712
,
longitude
:
114.
08582661394571
,
latitude
:
38.
39869677916153
,
latitude
:
38.
249478441102596
,
shortNum
:
16
,
shortNum
:
16
,
title
:
"视频2"
,
title
:
"视频2"
,
},
},
...
...
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