Skip to content

Commit 6e4f367

Browse files
author
潘卓然Y7000P
committed
【站点】【修复】【修复移动端的适配&补充资源图片】
1 parent 5520e5c commit 6e4f367

12 files changed

Lines changed: 600 additions & 488 deletions

File tree

website/public/docs/cdn/mapgis.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ body.small-header .top-nav {
2828
margin-top : 8px;
2929
}
3030

31-
.image img {
31+
/* .image img {
3232
display: block;
3333
height : auto;
3434
width : fit-content !important;
35-
}
35+
} */
3636

3737
.mapgis-webclient-logo {
38-
margin-left: 79px;
38+
/* margin-left: 79px; */
3939
height : 38px !important;
4040
}
4141

@@ -45,5 +45,5 @@ body.small-header .top-nav {
4545
}
4646

4747
#main>.core {
48-
padding: 30px !important;
48+
padding: 6px !important;
4949
}
55.6 KB
Loading

website/src/views/gallery/Gallery.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template>
22
<el-container class="webclient-gallery-wrapper">
3-
<el-header style="padding:0px;height:72px;">
3+
<el-header
4+
style="padding:0px;"
5+
:height="mobile?'48px':'72px'"
6+
>
47
<Header></Header>
58
</el-header>
69
<el-container>
@@ -255,7 +258,7 @@ export default {
255258
vm.heightChange = true;
256259
if (callback) callback();
257260
});
258-
}
261+
}
259262
},
260263
},
261264
mounted () {

website/src/views/layout/LayoutThree.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<el-container>
3-
<el-header :class="{'webclient-three-header-mobile':mobile}">
3+
<el-header :class="{'webclient-three-header-mobile':mobile, 'webclient-three-header': true}">
44
<Header></Header>
55
</el-header>
66
<el-main class="webclient-three-layout">
@@ -43,7 +43,7 @@ export default {
4343
}
4444
.webclient-three-header {
4545
padding: 0px;
46-
height: 72px !important;
46+
height: 72px;
4747
}
4848
.webclient-three-layout {
4949
padding: 0px;

website/src/views/layout/components/Header/Header.vue

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@
2121
placement="top-start"
2222
trigger="hover"
2323
>
24-
<header-menu :menus="h.menus" :icon="h.icon"/>
24+
<header-menu
25+
:menus="h.menus"
26+
:icon="h.icon"
27+
/>
2528
<el-button
2629
type="text"
2730
slot="reference"
28-
:class="{'active': isActive(h.title)}"
31+
:class="{'active': isActiveMenu(h.title)}"
2932
>
30-
<IconFont :type="h.icon" class="menu-icon"/>
33+
<IconFont
34+
:type="h.icon"
35+
class="menu-icon"
36+
/>
3137
{{h.title}}
3238
</el-button>
3339
</el-popover>
@@ -39,7 +45,7 @@
3945
trigger="hover"
4046
>
4147
<header-sub-menu
42-
:active="activeTab"
48+
:active="activeTabs[h.title]"
4349
:menus="h.menus"
4450
/>
4551
<el-button
@@ -69,38 +75,66 @@ export default {
6975
return {
7076
mobile: isMobile(),
7177
logo: './static/assets/logo/mapgis_blue.png',
72-
activeTab: 'cesium',
78+
activeMenu: '',
79+
activeTabs: {},
7380
headers: Headers,
7481
subheaders: SubHeader,
7582
mobileHeaders: MobileHeaders,
7683
mobileSubheaders: MobileSubHeader,
7784
};
7885
},
86+
created () {
87+
const headers = isMobile() ? MobileSubHeader : SubHeader;
88+
headers.forEach((h) => {
89+
this.activeTabs[h.title] = h.active.toLowerCase();
90+
});
91+
},
92+
mounted () {
93+
this.activeMenu = this.$route.params.mapmode.toLowerCase();
94+
},
7995
watch: {
8096
'$route' (to, from) {
8197
// 对路由变化作出响应...
82-
if (to.params.mapmode !== from.params.mapmode) {
83-
this.activeTab = to.params.mapmode;
98+
let mapmode = to.params.mapmode
99+
if (mapmode !== from.params.mapmode) {
100+
const headers = this.mobile ? MobileSubHeader : SubHeader;
101+
this.activeMenu = mapmode.toLowerCase();
102+
headers.forEach(header => {
103+
header.menus.forEach(m => {
104+
let active = m.title.toLowerCase();
105+
if (active === mapmode) {
106+
this.activeTabs[header.title] = active
107+
}
108+
})
109+
});
84110
}
85111
},
86112
},
87113
methods: {
88-
isActive (title) {
89-
if (title.toLowerCase().indexOf(this.activeTab) >= 0) {
90-
return true;
91-
}
114+
isActiveTab (title) {
115+
title = title.toLowerCase()
116+
Object.keys(this.activeTabs).forEach(key => {
117+
let active = this.activeTabs[key]
118+
if (title.indexOf(active) >= 0) {
119+
return true;
120+
}
121+
})
92122
return false;
123+
},
124+
isActiveMenu (title) {
125+
if (!this.activeMenu || !title) return false
126+
title = title.toLowerCase();
127+
if (title.indexOf(this.activeMenu) >= 0) {
128+
return true
129+
}
130+
return false
93131
}
94-
},
95-
mounted () {
96-
this.activeTab = this.$route.params.mapmode;
97132
}
98133
}
99134
</script>
100135

101136
<style lang="scss">
102137
.mapgis-header-mobile {
103-
padding: 0px;
104138
height: 48px !important;
105139
.mapgis-webclient-logo {
106140
margin-left: 22px !important;
@@ -114,7 +148,7 @@ export default {
114148
margin-right: 22px !important;
115149
}
116150
.mapgis-webclient-menu {
117-
height: 48px !important;
151+
height: 48px !important;
118152
span {
119153
font-size: 13px !important;
120154
}
@@ -123,7 +157,7 @@ export default {
123157
.mapgis-header {
124158
font-family: Microsoft YaHei;
125159
width: 100%;
126-
padding: 0px;
160+
padding: 0px !important;
127161
height: 72px;
128162
background: rgba(37, 45, 69, 1);
129163

website/src/views/layout/components/Header/config.js

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ export const Headers = [
66
{
77
title: "概述",
88
links: [
9-
["核心服务","详细服务", "插件列表", "调用方式", "四大引擎选择", "下载"],
10-
["其他","详细图表","插件标签","提交bug"],
9+
[
10+
"核心服务",
11+
"详细服务",
12+
"插件列表",
13+
"调用方式",
14+
"四大引擎选择",
15+
"下载",
16+
],
17+
["详细图表", "插件标签", "提交bug", "其他"],
1118
],
1219
routes: [
1320
[
@@ -19,10 +26,10 @@ export const Headers = [
1926
"/total/download",
2027
],
2128
[
29+
"/total/detailChart",
30+
"/total/pluginTags",
31+
"/total/bugCommit",
2232
"/total/other",
23-
"/total/detailChart",
24-
"/total/pluginTags",
25-
"/total/bugCommit",
2633
],
2734
],
2835
},
@@ -253,6 +260,7 @@ export const Headers = [
253260
export const SubHeader = [
254261
{
255262
title: "开发指南",
263+
active: 'Cesium',
256264
menus: [
257265
{
258266
title: "Cesium",
@@ -495,7 +503,8 @@ export const SubHeader = [
495503
},
496504
];
497505

498-
export const MobileHeaders = [
506+
export const MobileHeaders = [];
507+
export const MobileHeadersOrigin = [
499508
{
500509
title: "首页",
501510
menus: [
@@ -508,7 +517,7 @@ export const MobileHeaders = [
508517
"/total/plugins",
509518
"/total/use",
510519
"/total/select",
511-
"download",
520+
"/total/download",
512521
],
513522
],
514523
},
@@ -530,7 +539,52 @@ export const MobileHeaders = [
530539

531540
export const MobileSubHeader = [
532541
{
533-
title: "快速访问",
542+
title: "首页",
543+
active: '功能',
544+
menus: [
545+
{
546+
title: "功能",
547+
menus: [
548+
{
549+
title: "概述",
550+
links: [
551+
["核心服务", "详细服务", "调用方式", "四大引擎选择", "下载"],
552+
],
553+
routes: [
554+
[
555+
"/total/core",
556+
"/total/detail",
557+
"/total/use",
558+
"/total/select",
559+
"/total/download",
560+
],
561+
],
562+
},
563+
],
564+
},
565+
{
566+
title: "插件",
567+
menus: [
568+
{
569+
title: "插件详情",
570+
links: [["插件列表", "详细图表", "插件标签", "提交bug", "其他"]],
571+
routes: [
572+
[
573+
"/total/plugins",
574+
"/total/detailChart",
575+
"/total/pluginTags",
576+
"/total/bugCommit",
577+
"/total/other",
578+
],
579+
],
580+
},
581+
],
582+
},
583+
],
584+
},
585+
{
586+
title: "开发指南",
587+
active: "Cesium",
534588
menus: [
535589
{
536590
title: "Cesium",

0 commit comments

Comments
 (0)