@jx3box/jx3box-vue3-ui 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/.env +1 -0
- package/.eslintrc +9 -0
- package/.prettierrc +21 -0
- package/README.md +1 -0
- package/assets/css/admin.less +83 -0
- package/assets/css/author.less +86 -0
- package/assets/css/bottom.less +21 -0
- package/assets/css/box.less +180 -0
- package/assets/css/box2.less +150 -0
- package/assets/css/breadcrumb.less +155 -0
- package/assets/css/client-by.less +33 -0
- package/assets/css/cms-single.less +55 -0
- package/assets/css/crumb.less +17 -0
- package/assets/css/down.less +16 -0
- package/assets/css/footer.less +72 -0
- package/assets/css/github-repo.less +87 -0
- package/assets/css/header.less +532 -0
- package/assets/css/icon.less +10 -0
- package/assets/css/left-sidebar.less +137 -0
- package/assets/css/like.less +80 -0
- package/assets/css/like2.less +19 -0
- package/assets/css/main.less +67 -0
- package/assets/css/mark-by.less +97 -0
- package/assets/css/mark.less +34 -0
- package/assets/css/menu-by.less +9 -0
- package/assets/css/mixin.less +62 -0
- package/assets/css/order-by.less +86 -0
- package/assets/css/print.less +26 -0
- package/assets/css/qrcode.less +70 -0
- package/assets/css/right-msg.less +26 -0
- package/assets/css/right-sidebar.less +106 -0
- package/assets/css/share2.less +99 -0
- package/assets/css/sharing.less +26 -0
- package/assets/css/tag-by.less +86 -0
- package/assets/css/thx.less +213 -0
- package/assets/css/var.less +4 -0
- package/assets/css/wiki-comments.less +150 -0
- package/assets/css/wiki-panel.less +175 -0
- package/assets/css/wiki-revisions.less +62 -0
- package/assets/data/box.json +184 -0
- package/assets/data/box2.json +606 -0
- package/assets/data/game_font.json +242 -0
- package/assets/data/nav.json +12 -0
- package/assets/data/panel.json +27 -0
- package/assets/data/zlp.json +5 -0
- package/assets/img/author/bilibili.png +0 -0
- package/assets/img/author/bilibili.svg +1 -0
- package/assets/img/author/chat.png +0 -0
- package/assets/img/author/douyu.png +0 -0
- package/assets/img/author/douyu.svg +1 -0
- package/assets/img/author/github.svg +1 -0
- package/assets/img/author/huya.png +0 -0
- package/assets/img/author/huya.svg +1 -0
- package/assets/img/author/msg.svg +55 -0
- package/assets/img/author/tuilan.png +0 -0
- package/assets/img/author/weibo.svg +70 -0
- package/assets/img/bread/menu.svg +1 -0
- package/assets/img/footer/china.svg +1 -0
- package/assets/img/header/add.svg +1 -0
- package/assets/img/header/bell.svg +1 -0
- package/assets/img/header/coin.svg +15 -0
- package/assets/img/header/edit.svg +1 -0
- package/assets/img/header/logo.svg +5 -0
- package/assets/img/header/manage.svg +1 -0
- package/assets/img/header/msg.svg +1 -0
- package/assets/img/header/search-key-slash.svg +5 -0
- package/assets/img/header/send.svg +56 -0
- package/assets/img/header/vip.svg +1 -0
- package/assets/img/jx3.svg +11 -0
- package/assets/img/leftsidebar/arrow.svg +64 -0
- package/assets/img/leftsidebar/close.svg +49 -0
- package/assets/img/leftsidebar/fans.svg +1 -0
- package/assets/img/leftsidebar/medal.svg +1 -0
- package/assets/img/leftsidebar/more.svg +50 -0
- package/assets/img/leftsidebar/open.svg +51 -0
- package/assets/img/leftsidebar/post.svg +46 -0
- package/assets/img/leftsidebar/team.svg +1 -0
- package/assets/img/leftsidebar/united.svg +1 -0
- package/assets/img/list/post.svg +1 -0
- package/assets/img/price/jin.png +0 -0
- package/assets/img/price/tong.png +0 -0
- package/assets/img/price/yin.png +0 -0
- package/assets/img/price/zhuan.png +0 -0
- package/assets/img/rightsidebar/ac.svg +1 -0
- package/assets/img/rightsidebar/github.svg +1 -0
- package/assets/img/rightsidebar/repo.svg +1 -0
- package/assets/img/single/author.svg +1 -0
- package/assets/img/single/lock.svg +1 -0
- package/assets/img/single/modate.svg +24 -0
- package/assets/img/single/podate.svg +23 -0
- package/assets/img/widget/admin_gift.svg +10 -0
- package/assets/img/widget/gift.svg +1 -0
- package/assets/img/widget/heart.svg +17 -0
- package/assets/img/widget/heart1.svg +1 -0
- package/assets/img/widget/heart2.svg +11 -0
- package/assets/img/widget/heart3.svg +37 -0
- package/assets/img/widget/like.svg +1 -0
- package/assets/img/widget/like2.svg +1 -0
- package/assets/img/widget/like3.svg +14 -0
- package/assets/img/widget/qq.svg +1 -0
- package/assets/img/widget/qr-code.svg +1 -0
- package/assets/img/widget/qzone.svg +1 -0
- package/assets/img/widget/share-link.png +0 -0
- package/assets/img/widget/share.svg +13 -0
- package/assets/img/widget/share2.svg +19 -0
- package/assets/img/widget/star.svg +9 -0
- package/assets/img/widget/tieba.svg +1 -0
- package/assets/img/widget/unstar.svg +21 -0
- package/assets/img/widget/web_heart_animation.png +0 -0
- package/assets/img/widget/weibo.svg +1 -0
- package/assets/img/widget/weixin.svg +1 -0
- package/assets/js/app.js +7 -0
- package/babel.config.js +3 -0
- package/jsconfig.json +17 -0
- package/package.json +71 -0
- package/public/favicon.ico +0 -0
- package/public/image/box/bbs.svg +87 -0
- package/public/image/box/bbs__.svg +101 -0
- package/public/image/box/bbs_on.svg +88 -0
- package/public/image/box/bps.svg +10 -0
- package/public/image/box/bps_on.svg +10 -0
- package/public/image/box/cj.svg +1 -0
- package/public/image/box/cj_on.svg +1 -0
- package/public/image/box/collection.svg +1 -0
- package/public/image/box/collection_on.svg +1 -0
- package/public/image/box/database.svg +22 -0
- package/public/image/box/database_on.svg +22 -0
- package/public/image/box/dbm.svg +21 -0
- package/public/image/box/dbm_on.svg +21 -0
- package/public/image/box/exam.svg +35 -0
- package/public/image/box/exam_on.svg +35 -0
- package/public/image/box/facedata.svg +21 -0
- package/public/image/box/facedata_on.svg +21 -0
- package/public/image/box/fb.svg +18 -0
- package/public/image/box/fb_on.svg +18 -0
- package/public/image/box/fbdata.svg +15 -0
- package/public/image/box/fbdata_on.svg +15 -0
- package/public/image/box/fbdrop.svg +26 -0
- package/public/image/box/fbdrop_on.svg +26 -0
- package/public/image/box/fbgem.svg +39 -0
- package/public/image/box/fbgem_on.svg +39 -0
- package/public/image/box/flower.svg +28 -0
- package/public/image/box/flower_on.svg +28 -0
- package/public/image/box/furniture.svg +32 -0
- package/public/image/box/furniture_on.svg +32 -0
- package/public/image/box/haste.svg +8 -0
- package/public/image/box/haste_on.svg +8 -0
- package/public/image/box/home.svg +47 -0
- package/public/image/box/home_on.svg +47 -0
- package/public/image/box/house.svg +1 -0
- package/public/image/box/house_on.svg +1 -0
- package/public/image/box/icons.svg +15 -0
- package/public/image/box/icons_on.svg +15 -0
- package/public/image/box/item.svg +1 -0
- package/public/image/box/item_on.svg +1 -0
- package/public/image/box/j3dps.svg +28 -0
- package/public/image/box/j3dps_on.svg +28 -0
- package/public/image/box/j3pz.svg +36 -0
- package/public/image/box/j3pz_on.svg +36 -0
- package/public/image/box/jx3dat.svg +27 -0
- package/public/image/box/jx3dat_on.svg +27 -0
- package/public/image/box/keju.svg +30 -0
- package/public/image/box/keju_on.svg +30 -0
- package/public/image/box/knowledge.svg +52 -0
- package/public/image/box/knowledge_on.svg +52 -0
- package/public/image/box/macro.svg +15 -0
- package/public/image/box/macro_on.svg +18 -0
- package/public/image/box/macroeditor.svg +38 -0
- package/public/image/box/macroeditor_on.svg +38 -0
- package/public/image/box/png/100.png +0 -0
- package/public/image/box/png/bbs.png +0 -0
- package/public/image/box/png/bbs1.png +0 -0
- package/public/image/box/png/bbs2.png +0 -0
- package/public/image/box/png/bps.png +0 -0
- package/public/image/box/png/cj.png +0 -0
- package/public/image/box/png/database.png +0 -0
- package/public/image/box/png/drop.png +0 -0
- package/public/image/box/png/emotion.png +0 -0
- package/public/image/box/png/face.png +0 -0
- package/public/image/box/png/fb.png +0 -0
- package/public/image/box/png/flog.png +0 -0
- package/public/image/box/png/flower.png +0 -0
- package/public/image/box/png/furniture.png +0 -0
- package/public/image/box/png/gem.png +0 -0
- package/public/image/box/png/guishi.png +0 -0
- package/public/image/box/png/home.png +0 -0
- package/public/image/box/png/house.png +0 -0
- package/public/image/box/png/icons.png +0 -0
- package/public/image/box/png/item.png +0 -0
- package/public/image/box/png/j3pz.png +0 -0
- package/public/image/box/png/joker.png +0 -0
- package/public/image/box/png/jx3dat.png +0 -0
- package/public/image/box/png/jx3datbuilder.png +0 -0
- package/public/image/box/png/keju.png +0 -0
- package/public/image/box/png/macro.png +0 -0
- package/public/image/box/png/macroeditor.png +0 -0
- package/public/image/box/png/macroeditor2.png +0 -0
- package/public/image/box/png/minami.png +0 -0
- package/public/image/box/png/mirror.png +0 -0
- package/public/image/box/png/oa.png +0 -0
- package/public/image/box/png/pig.png +0 -0
- package/public/image/box/png/price.png +0 -0
- package/public/image/box/png/qiyu.png +0 -0
- package/public/image/box/png/rank2_on.png +0 -0
- package/public/image/box/png/role.png +0 -0
- package/public/image/box/png/servers.png +0 -0
- package/public/image/box/png/share.png +0 -0
- package/public/image/box/png/shop.png +0 -0
- package/public/image/box/png/skull.png +0 -0
- package/public/image/box/png/speed.png +0 -0
- package/public/image/box/png/talent.png +0 -0
- package/public/image/box/png/team.png +0 -0
- package/public/image/box/png/team_on.png +0 -0
- package/public/image/box/png/tool.png +0 -0
- package/public/image/box/png/translator.png +0 -0
- package/public/image/box/png/trophy.png +0 -0
- package/public/image/box/png/trophy2.png +0 -0
- package/public/image/box/png/wiki.png +0 -0
- package/public/image/box/price.svg +19 -0
- package/public/image/box/price_on.svg +19 -0
- package/public/image/box/qiyu.svg +1 -0
- package/public/image/box/qiyu_on.svg +1 -0
- package/public/image/box/quest.svg +52 -0
- package/public/image/box/quest_on.svg +57 -0
- package/public/image/box/rank.svg +36 -0
- package/public/image/box/rank_on.svg +36 -0
- package/public/image/box/servers.svg +31 -0
- package/public/image/box/servers_on.svg +31 -0
- package/public/image/box/share.svg +24 -0
- package/public/image/box/share_on.svg +24 -0
- package/public/image/box/shop.svg +52 -0
- package/public/image/box/talent.svg +19 -0
- package/public/image/box/talent_on.svg +19 -0
- package/public/image/box/team.svg +15 -0
- package/public/image/box/team_on.svg +18 -0
- package/public/image/box/tool.svg +23 -0
- package/public/image/box/tool_on.svg +31 -0
- package/public/image/box/translator.svg +55 -0
- package/public/image/box/translator_on.svg +55 -0
- package/public/image/box/wbl.png +0 -0
- package/public/image/box/wbl_on.png +0 -0
- package/public/image/box/xls.svg +74 -0
- package/public/image/box/xls_on.svg +74 -0
- package/public/index.html +24 -0
- package/service/admin.js +15 -0
- package/service/author.js +79 -0
- package/service/breadcrumb.js +13 -0
- package/service/cms.js +35 -0
- package/service/fav.js +17 -0
- package/service/follow.js +55 -0
- package/service/github.js +15 -0
- package/service/header.js +31 -0
- package/service/helper.js +7 -0
- package/service/thx.js +60 -0
- package/src/App.vue +52 -0
- package/src/Bottom.vue +23 -0
- package/src/Box.vue +149 -0
- package/src/Breadcrumb.vue +118 -0
- package/src/Footer.vue +45 -0
- package/src/Header.vue +95 -0
- package/src/LeftSideToggle.vue +64 -0
- package/src/LeftSidebar.vue +123 -0
- package/src/Main.vue +48 -0
- package/src/RightSidebar.vue +25 -0
- package/src/bread/Admin.vue +308 -0
- package/src/bread/AdminButton.vue +31 -0
- package/src/bread/Crumb.vue +27 -0
- package/src/header/Asset.vue +180 -0
- package/src/header/ClientSwitch.vue +115 -0
- package/src/header/GameSwitch.vue +210 -0
- package/src/header/Logo.vue +82 -0
- package/src/header/Manage.vue +125 -0
- package/src/header/Message.vue +89 -0
- package/src/header/Nav.vue +287 -0
- package/src/header/Publish.vue +21 -0
- package/src/header/Search.vue +81 -0
- package/src/header/User.vue +141 -0
- package/src/header/UserInfo.vue +175 -0
- package/src/header/Vip.vue +27 -0
- package/src/main.js +30 -0
- package/utils/bus.js +5 -0
- package/utils/index.js +31 -0
- package/vue.config.js +103 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-header-panel c-header-manage" id="c-header-manage">
|
|
3
|
+
<span class="u-post u-manage">
|
|
4
|
+
<img class="u-add" svg-inline src="../../assets/img/header/manage.svg" />
|
|
5
|
+
</span>
|
|
6
|
+
<ul class="u-menu u-pop-content">
|
|
7
|
+
<li v-for="item in finalPanel" :key="item.label">
|
|
8
|
+
<a :href="item.link" target="_blank"
|
|
9
|
+
><el-icon>
|
|
10
|
+
<component :is="item.icon" v-if="item.icon"></component>
|
|
11
|
+
<Present v-else />
|
|
12
|
+
</el-icon>
|
|
13
|
+
{{ item.label }}</a
|
|
14
|
+
>
|
|
15
|
+
</li>
|
|
16
|
+
<hr v-if="finalPanel.length" />
|
|
17
|
+
<li v-if="isEditor">
|
|
18
|
+
<a href="https://os.jx3box.com/admin" target="_blank"
|
|
19
|
+
><el-icon><MessageBox /></el-icon> 管理平台</a
|
|
20
|
+
>
|
|
21
|
+
</li>
|
|
22
|
+
<li v-if="isAdmin">
|
|
23
|
+
<a href="/admin"
|
|
24
|
+
><el-icon><Setting></Setting></el-icon> 站点配置</a
|
|
25
|
+
>
|
|
26
|
+
</li>
|
|
27
|
+
<li v-if="isTeamMember">
|
|
28
|
+
<a href="/dashboard/feedback?tab=pending"
|
|
29
|
+
><el-icon><Message /></el-icon> 反馈处理</a
|
|
30
|
+
>
|
|
31
|
+
</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
38
|
+
import panel from "../../assets/data/panel.json";
|
|
39
|
+
import { getMenu } from "../../service/header";
|
|
40
|
+
import { checkTeamMember } from "../../service/cms";
|
|
41
|
+
export default {
|
|
42
|
+
name: "HeaderManage",
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
panel,
|
|
46
|
+
|
|
47
|
+
isTeamMember: false,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
finalPanel: function () {
|
|
52
|
+
// 只返回前两个
|
|
53
|
+
return this.panel
|
|
54
|
+
.filter((item) => {
|
|
55
|
+
// 只返回有权限的
|
|
56
|
+
if (item.onlyAdmin) {
|
|
57
|
+
return this.isAdmin;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
})
|
|
61
|
+
.slice(0, 2);
|
|
62
|
+
},
|
|
63
|
+
isAdmin() {
|
|
64
|
+
return User.isAdmin();
|
|
65
|
+
},
|
|
66
|
+
isEditor() {
|
|
67
|
+
return User.isEditor();
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
mounted() {
|
|
71
|
+
this.loadPanel();
|
|
72
|
+
this.check();
|
|
73
|
+
},
|
|
74
|
+
methods: {
|
|
75
|
+
loadPanel: function () {
|
|
76
|
+
try {
|
|
77
|
+
const panel = JSON.parse(sessionStorage.getItem("panel"));
|
|
78
|
+
if (panel) {
|
|
79
|
+
this.panel = panel;
|
|
80
|
+
} else {
|
|
81
|
+
getMenu("panel").then((res) => {
|
|
82
|
+
this.panel = res.data?.data?.val;
|
|
83
|
+
sessionStorage.setItem("panel", JSON.stringify(this.panel));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
} catch (e) {
|
|
87
|
+
this.panel = panel;
|
|
88
|
+
console.log("loadPanel error", e);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
check: function () {
|
|
92
|
+
try {
|
|
93
|
+
const isTeamMember = JSON.parse(localStorage.getItem("BoxTeam3"));
|
|
94
|
+
|
|
95
|
+
if (isTeamMember) {
|
|
96
|
+
this.isTeamMember = isTeamMember === "true" || isTeamMember;
|
|
97
|
+
} else {
|
|
98
|
+
checkTeamMember().then((res) => {
|
|
99
|
+
this.isTeamMember = res.data.data;
|
|
100
|
+
localStorage.setItem("BoxTeam3", this.isTeamMember);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.log("check error", e);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style lang="less">
|
|
112
|
+
// 管理菜单
|
|
113
|
+
.c-header-manage {
|
|
114
|
+
height: 100%;
|
|
115
|
+
.u-manage {
|
|
116
|
+
padding: 0 10px 0 8px;
|
|
117
|
+
height: 100%;
|
|
118
|
+
.flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
svg {
|
|
121
|
+
.size(19px);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-header-msg" id="c-header-msg">
|
|
3
|
+
<el-tooltip effect="dark" content="消息中心" placement="bottom" popper-class="c-header-tooltip">
|
|
4
|
+
<a class="u-msg" :href="url">
|
|
5
|
+
<i class="u-icon u-icon-msg">
|
|
6
|
+
<i class="u-pop" style="display: none" v-show="pop"></i>
|
|
7
|
+
<img svg-inline src="../../assets/img/header/bell.svg" />
|
|
8
|
+
</i>
|
|
9
|
+
</a>
|
|
10
|
+
</el-tooltip>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
16
|
+
import { getMsg } from "../../service/header";
|
|
17
|
+
export default {
|
|
18
|
+
name: "HeaderMsg",
|
|
19
|
+
data: function () {
|
|
20
|
+
return {
|
|
21
|
+
url: JX3BOX.__Links.dashboard.msg,
|
|
22
|
+
pop: false,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
mounted() {
|
|
26
|
+
this.checkMSG();
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
// 消息
|
|
30
|
+
checkMSG: function () {
|
|
31
|
+
getMsg().then((res) => {
|
|
32
|
+
this.pop = !!(Math.max(~~res.data.data.letter, 0) + ~~res.data.data.message);
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="less">
|
|
40
|
+
//消息面板
|
|
41
|
+
.c-header-msg {
|
|
42
|
+
position: relative;
|
|
43
|
+
height: 100%;
|
|
44
|
+
|
|
45
|
+
.u-msg {
|
|
46
|
+
.h(100%);
|
|
47
|
+
.flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
|
|
50
|
+
padding: 0 10px;
|
|
51
|
+
&:hover {
|
|
52
|
+
opacity: 0.7;
|
|
53
|
+
}
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
.u-icon-msg {
|
|
57
|
+
// .mt(10px);
|
|
58
|
+
width: 17px;
|
|
59
|
+
height: 17px;
|
|
60
|
+
display: block;
|
|
61
|
+
.pr;
|
|
62
|
+
top: 1px;
|
|
63
|
+
// margin-top: 9px;
|
|
64
|
+
svg {
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
}
|
|
68
|
+
.pr;
|
|
69
|
+
}
|
|
70
|
+
.u-pop {
|
|
71
|
+
width: 10px;
|
|
72
|
+
height: 10px;
|
|
73
|
+
color: #fff;
|
|
74
|
+
background-image: linear-gradient(#54a3ff, #006eed);
|
|
75
|
+
background-clip: padding-box;
|
|
76
|
+
border: 2px solid #24292e;
|
|
77
|
+
border-radius: 50%;
|
|
78
|
+
position: absolute;
|
|
79
|
+
right: -5px;
|
|
80
|
+
top: -6px;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media screen and (max-width: @ipad) {
|
|
85
|
+
.c-header-msg {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav class="c-header-nav" v-if="finalNav">
|
|
3
|
+
<div class="c-header-nav__pc">
|
|
4
|
+
<div class="u-item-box" v-for="item in finalNav" :key="'header-nav-' + item.key">
|
|
5
|
+
<template v-if="item.status && matchedClient(item.client)">
|
|
6
|
+
<template v-if="item.children && item.children.length">
|
|
7
|
+
<el-dropdown class="u-menu" :show-timeout="0" trigger="hover">
|
|
8
|
+
<a
|
|
9
|
+
class="u-item el-dropdown-link"
|
|
10
|
+
:class="{ on: isFocus(item.link) }"
|
|
11
|
+
:href="item.link"
|
|
12
|
+
:target="isSelf(item.link)"
|
|
13
|
+
>{{ item.label }}<el-icon><ArrowDown /></el-icon
|
|
14
|
+
></a>
|
|
15
|
+
<template #dropdown>
|
|
16
|
+
<el-dropdown-menu class="c-header-menu">
|
|
17
|
+
<el-dropdown-item
|
|
18
|
+
v-for="(subitem, subIndex) in item.children"
|
|
19
|
+
:key="'header-nav-drop-' + subitem.key + subIndex"
|
|
20
|
+
class="u-menu-item"
|
|
21
|
+
>
|
|
22
|
+
<a
|
|
23
|
+
:href="subitem.link"
|
|
24
|
+
:target="isSelf(subitem.link)"
|
|
25
|
+
v-if="subitem.status && matchedClient(subitem.client)"
|
|
26
|
+
>{{ subitem.label }} <span v-if="subitem.desc">{{ subitem.desc }}</span></a
|
|
27
|
+
></el-dropdown-item
|
|
28
|
+
>
|
|
29
|
+
</el-dropdown-menu>
|
|
30
|
+
</template>
|
|
31
|
+
</el-dropdown>
|
|
32
|
+
</template>
|
|
33
|
+
<template v-else>
|
|
34
|
+
<a class="u-item" :class="{ on: isFocus(item.link) }" :href="item.link">{{ item.label }}</a>
|
|
35
|
+
</template>
|
|
36
|
+
</template>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="c-header-nav__pad">
|
|
40
|
+
<el-menu mode="horizontal" class="c-quick-menu" v-model="activeIndex" :ellipsis="false">
|
|
41
|
+
<el-sub-menu index="quick-menu" popper-class="c-quick-menu__submenu">
|
|
42
|
+
<template #title>快捷导航</template>
|
|
43
|
+
<el-menu-item v-for="item in finalNav" :key="'header-nav-' + item.key">
|
|
44
|
+
<template v-if="matchedClient(item.client)">
|
|
45
|
+
<el-sub-menu
|
|
46
|
+
:index="item.key"
|
|
47
|
+
class="c-header-menu"
|
|
48
|
+
v-if="item.children && item.children.length"
|
|
49
|
+
>
|
|
50
|
+
<template #title>
|
|
51
|
+
<a
|
|
52
|
+
class="u-menu-item"
|
|
53
|
+
:class="{ on: isFocus(item.link) }"
|
|
54
|
+
:href="item.link"
|
|
55
|
+
:target="isSelf(item.link)"
|
|
56
|
+
>{{ item.label }}</a
|
|
57
|
+
></template
|
|
58
|
+
>
|
|
59
|
+
<template v-for="(subitem, subIndex) in item.children">
|
|
60
|
+
<el-menu-item
|
|
61
|
+
v-if="matchedClient(subitem.client)"
|
|
62
|
+
:key="'header-nav-drop-' + subitem.key + subIndex"
|
|
63
|
+
:index="subitem.key"
|
|
64
|
+
>
|
|
65
|
+
<a class="u-menu-item" :href="subitem.link" :target="isSelf(subitem.link)"
|
|
66
|
+
>{{ subitem.label }} <span v-if="subitem.desc">{{ subitem.desc }}</span>
|
|
67
|
+
</a>
|
|
68
|
+
</el-menu-item>
|
|
69
|
+
</template>
|
|
70
|
+
</el-sub-menu>
|
|
71
|
+
<el-menu-item v-else>
|
|
72
|
+
<a class="u-item" :class="{ on: isFocus(item.link) }" :href="item.link">{{
|
|
73
|
+
item.label
|
|
74
|
+
}}</a>
|
|
75
|
+
</el-menu-item>
|
|
76
|
+
</template>
|
|
77
|
+
</el-menu-item>
|
|
78
|
+
</el-sub-menu>
|
|
79
|
+
</el-menu>
|
|
80
|
+
</div>
|
|
81
|
+
</nav>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script>
|
|
85
|
+
import default_nav from "../../assets/data/nav.json";
|
|
86
|
+
import { getMenu } from "../../service/header";
|
|
87
|
+
export default {
|
|
88
|
+
name: "HeaderNav",
|
|
89
|
+
props: [],
|
|
90
|
+
data: function () {
|
|
91
|
+
return {
|
|
92
|
+
nav: default_nav,
|
|
93
|
+
|
|
94
|
+
activeIndex: "",
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
computed: {
|
|
98
|
+
finalNav: function ({ nav }) {
|
|
99
|
+
// 父节点
|
|
100
|
+
const finalNav = nav.filter((d) => !d.parentKey && d.status);
|
|
101
|
+
// 子节点
|
|
102
|
+
const navChildren = nav.filter((c) => c.parentKey && c.status);
|
|
103
|
+
|
|
104
|
+
navChildren.forEach((child) => {
|
|
105
|
+
const parentKey = child.parentKey;
|
|
106
|
+
// 匹配客户端
|
|
107
|
+
const parent = finalNav.find((n) => n.key === parentKey);
|
|
108
|
+
|
|
109
|
+
if (parent) {
|
|
110
|
+
if (!parent.children) {
|
|
111
|
+
parent.children = [];
|
|
112
|
+
}
|
|
113
|
+
parent.children.push(child);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return finalNav;
|
|
118
|
+
},
|
|
119
|
+
client() {
|
|
120
|
+
return location.href.includes("origin") ? "origin" : "std";
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
methods: {
|
|
124
|
+
isFocus: function (type) {
|
|
125
|
+
return location.pathname.includes(type);
|
|
126
|
+
},
|
|
127
|
+
matchedClient: function (client) {
|
|
128
|
+
return client == "all" ? true : client == this.client;
|
|
129
|
+
},
|
|
130
|
+
isSelf: function (link) {
|
|
131
|
+
return link.startsWith("/") ? "_self" : "_blank";
|
|
132
|
+
},
|
|
133
|
+
loadNav() {
|
|
134
|
+
try {
|
|
135
|
+
const nav = JSON.parse(sessionStorage.getItem("nav"));
|
|
136
|
+
if (nav) {
|
|
137
|
+
this.nav = nav;
|
|
138
|
+
} else {
|
|
139
|
+
getMenu("nav").then((res) => {
|
|
140
|
+
if (res.data) {
|
|
141
|
+
this.nav = res?.data?.data?.val;
|
|
142
|
+
sessionStorage.setItem("nav", JSON.stringify(this.nav));
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
} catch (e) {
|
|
147
|
+
this.nav = default_nav;
|
|
148
|
+
console.log("loadNav error", e);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
created: function () {
|
|
153
|
+
this.loadNav();
|
|
154
|
+
},
|
|
155
|
+
components: {},
|
|
156
|
+
};
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<style lang="less">
|
|
160
|
+
//菜单
|
|
161
|
+
.c-header-nav {
|
|
162
|
+
.fl;
|
|
163
|
+
font-family: Montserrat, "Helvetica Neue", sans-serif;
|
|
164
|
+
.clearfix;
|
|
165
|
+
.u-item-box {
|
|
166
|
+
.fl;
|
|
167
|
+
}
|
|
168
|
+
.u-item {
|
|
169
|
+
.pointer;
|
|
170
|
+
display: block;
|
|
171
|
+
font-size: 14px;
|
|
172
|
+
line-height: @logo-size;
|
|
173
|
+
color: #fff;
|
|
174
|
+
// font-weight:300;
|
|
175
|
+
&:hover {
|
|
176
|
+
background-color: darken(@primary, 10%);
|
|
177
|
+
}
|
|
178
|
+
&.on {
|
|
179
|
+
// background-color: @primary;
|
|
180
|
+
.pr;
|
|
181
|
+
&:after {
|
|
182
|
+
content: "";
|
|
183
|
+
.db;
|
|
184
|
+
border-bottom: 3px solid @primary;
|
|
185
|
+
.pa;
|
|
186
|
+
.lb(0);
|
|
187
|
+
.w(100%);
|
|
188
|
+
}
|
|
189
|
+
&:hover {
|
|
190
|
+
background-color: @primary;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
padding: 16px 15px;
|
|
194
|
+
transition: 0.1s ease-in;
|
|
195
|
+
i {
|
|
196
|
+
.none;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
.u-menu {
|
|
200
|
+
.fl;
|
|
201
|
+
.el-icon-arrow-down {
|
|
202
|
+
.fz(12px);
|
|
203
|
+
color: #8e8e8e;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
.c-header-menu {
|
|
208
|
+
.h(auto) !important;
|
|
209
|
+
.u-menu-item {
|
|
210
|
+
padding: 0;
|
|
211
|
+
a {
|
|
212
|
+
color: @color;
|
|
213
|
+
line-height: 16px;
|
|
214
|
+
padding: 10px 30px;
|
|
215
|
+
.db;
|
|
216
|
+
span {
|
|
217
|
+
.fz(12px);
|
|
218
|
+
color: #999;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
.mt(0px) !important;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.c-header-nav__pad {
|
|
226
|
+
.c-quick-menu {
|
|
227
|
+
background: #24292e;
|
|
228
|
+
}
|
|
229
|
+
.el-sub-menu__title {
|
|
230
|
+
color: #fff !important;
|
|
231
|
+
i {
|
|
232
|
+
color: #fff;
|
|
233
|
+
}
|
|
234
|
+
&:hover {
|
|
235
|
+
background: #0366d6 !important;
|
|
236
|
+
}
|
|
237
|
+
height: 64px !important;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
.c-quick-menu__submenu {
|
|
241
|
+
.el-menu {
|
|
242
|
+
min-width: 150px;
|
|
243
|
+
|
|
244
|
+
.el-menu {
|
|
245
|
+
.el-menu-item {
|
|
246
|
+
padding: 0 20px !important;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
.u-menu-item,
|
|
251
|
+
.u-item {
|
|
252
|
+
display: block;
|
|
253
|
+
color: @color;
|
|
254
|
+
}
|
|
255
|
+
.el-menu-item,
|
|
256
|
+
.el-sub-menu {
|
|
257
|
+
min-width: 150px;
|
|
258
|
+
&:hover {
|
|
259
|
+
background-color: #e6f0fb !important;
|
|
260
|
+
|
|
261
|
+
.el-sub-menu__title {
|
|
262
|
+
background-color: #e6f0fb;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
.c-header-nav__pad {
|
|
268
|
+
.none;
|
|
269
|
+
.c-quick-menu {
|
|
270
|
+
border-bottom: none;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
@media screen and (max-width: @ipad) {
|
|
274
|
+
.c-header-nav__pc {
|
|
275
|
+
display: none;
|
|
276
|
+
}
|
|
277
|
+
.c-header-nav__pad {
|
|
278
|
+
display: block;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
@media screen and (max-width: @ipad-y) {
|
|
283
|
+
.c-header-nav__pad {
|
|
284
|
+
display: none;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-header-panel" id="c-header-panel">
|
|
3
|
+
<el-tooltip effect="dark" content="创作中心" placement="bottom" popper-class="c-header-tooltip">
|
|
4
|
+
<a class="u-post" :href="url">
|
|
5
|
+
<img class="u-add" svg-inline src="../../assets/img/header/edit.svg" />
|
|
6
|
+
</a>
|
|
7
|
+
</el-tooltip>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
13
|
+
export default {
|
|
14
|
+
name: "HeaderPublish",
|
|
15
|
+
data: function () {
|
|
16
|
+
return {
|
|
17
|
+
url: JX3BOX.__Links.dashboard.publish,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-header-search" id="c-header-search">
|
|
3
|
+
<div class="c-search">
|
|
4
|
+
<form class="u-form" :action="url" :target="isPhone ? '_self' : '_blank'">
|
|
5
|
+
<input class="u-text" type="text" autocomplete="off" name="q" placeholder="搜索.." />
|
|
6
|
+
<input type="hidden" name="client" :value="client" />
|
|
7
|
+
<i class="u-btn">
|
|
8
|
+
<img svg-inline src="../../assets/img/header/search-key-slash.svg" />
|
|
9
|
+
</i>
|
|
10
|
+
</form>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
17
|
+
export default {
|
|
18
|
+
name: "HeaderSearch",
|
|
19
|
+
data: function () {
|
|
20
|
+
return {
|
|
21
|
+
isPhone: window.innerWidth < 720 ? true : false,
|
|
22
|
+
url: JX3BOX.__Root + "search",
|
|
23
|
+
client: location.href.includes("origin") ? "origin" : "std",
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="less">
|
|
30
|
+
//搜索
|
|
31
|
+
.c-header-search {
|
|
32
|
+
width: 220px;
|
|
33
|
+
// padding: 16px 0;
|
|
34
|
+
margin: 15px 0;
|
|
35
|
+
|
|
36
|
+
.u-form {
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.u-text {
|
|
41
|
+
background-color: #3a4248;
|
|
42
|
+
border: 2px solid @bg-black;
|
|
43
|
+
// background-color:#636872;
|
|
44
|
+
// border: 0;
|
|
45
|
+
box-shadow: none;
|
|
46
|
+
color: #fff;
|
|
47
|
+
height: @logo-size + 2px;
|
|
48
|
+
line-height: @logo-size + 2px;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
padding: 0.625em 0.4375em;
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
&:focus {
|
|
56
|
+
background-color: #fff;
|
|
57
|
+
color: #1a1a1a;
|
|
58
|
+
outline: 0;
|
|
59
|
+
}
|
|
60
|
+
transition: background-color 0.1s ease-in;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.u-btn {
|
|
64
|
+
border: 0;
|
|
65
|
+
position: absolute;
|
|
66
|
+
right: 8px;
|
|
67
|
+
top: 6px;
|
|
68
|
+
display: block;
|
|
69
|
+
width: 19px;
|
|
70
|
+
height: 20px;
|
|
71
|
+
padding: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
margin-right: 10px;
|
|
75
|
+
}
|
|
76
|
+
@media screen and (max-width: @phone) {
|
|
77
|
+
.c-header-search {
|
|
78
|
+
.none;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|