@jx3box/jx3box-ui 2.0.5 → 2.0.7
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/.storybook/preview.js +22 -13
- package/.storybook/storybookMocks.js +214 -0
- package/README.md +39 -43
- package/assets/css/bread/admin.less +20 -2
- package/assets/css/bread/breadcrumb.less +5 -2
- package/assets/css/comment/quick-reply.less +1 -1
- package/assets/css/common/left-sidebar.less +1 -1
- package/assets/css/interact/like2.less +5 -2
- package/assets/css/interact/qrcode.less +69 -0
- package/assets/css/single/author.less +15 -10
- package/assets/css/single/cms-single.less +1 -0
- package/assets/css/single/thx.less +34 -11
- package/assets/css/wiki/wiki-comments.less +176 -0
- package/assets/css/wiki/wiki-panel.less +177 -0
- package/assets/css/wiki/wiki-revisions.less +62 -0
- package/assets/data/nav.json +344 -10
- package/assets/img/comment/comment.svg +1 -1
- package/assets/img/comment/heart_1.svg +1 -1
- package/assets/img/comment/hide.svg +1 -1
- package/assets/img/leftsidebar/medal.svg +1 -1
- package/assets/img/leftsidebar/post.svg +27 -46
- package/i18n/messages/en-US.js +357 -22
- package/i18n/messages/vi.js +350 -22
- package/i18n/messages/zh-CN.js +469 -20
- package/i18n/messages/zh-TW.js +350 -22
- package/index.js +19 -7
- package/package.json +8 -5
- package/service/cms.js +22 -0
- package/service/commit-history.js +18 -0
- package/service/community.js +60 -0
- package/service/fav.js +5 -6
- package/src/App.vue +210 -80
- package/src/Breadcrumb.vue +24 -11
- package/src/CommonFooter.vue +2 -2
- package/src/Footer.vue +13 -5
- package/src/LeftSideToggle.vue +10 -3
- package/src/LeftSidebar.vue +19 -5
- package/src/Main.vue +9 -2
- package/src/RightSidebar.vue +12 -3
- package/src/SuspendCommon.vue +52 -38
- package/src/author/AuthorFans.vue +7 -5
- package/src/author/AuthorFollow.vue +14 -7
- package/src/author/AuthorGift.vue +25 -17
- package/src/author/AuthorInfo.vue +46 -19
- package/src/author/AuthorLink.vue +3 -1
- package/src/author/AuthorMedals.vue +5 -2
- package/src/author/AuthorPosts.vue +31 -13
- package/src/author/AuthorRss.vue +7 -3
- package/src/author/AuthorTeams.vue +3 -1
- package/src/author/UserPop.vue +29 -17
- package/src/bread/Admin.vue +55 -32
- package/src/bread/AdminDirectMessage.vue +15 -8
- package/src/bread/AdminDrop.vue +124 -45
- package/src/bread/CommunityAdmin.vue +527 -0
- package/src/bread/DesignTask.vue +30 -26
- package/src/bread/ListAdmin.vue +199 -0
- package/src/bread/MigrateCommunity.vue +192 -0
- package/src/bread/MoveToCommunityDialog.vue +234 -0
- package/src/comment/Avatar.vue +18 -24
- package/src/comment/CommentContent.vue +57 -37
- package/src/comment/CommentContentSimple.vue +61 -63
- package/src/comment/CommentInputForm.vue +45 -34
- package/src/comment/CommentWithReply.vue +9 -6
- package/src/comment/QuickReply.vue +5 -1
- package/src/comment/ReplyForReply.vue +6 -4
- package/src/comment/ReplyList.vue +28 -18
- package/src/comment/Upload.vue +24 -6
- package/src/filters/clientBy.vue +10 -8
- package/src/filters/markBy.vue +35 -31
- package/src/filters/menuBy.vue +20 -22
- package/src/filters/orderBy.vue +17 -11
- package/src/filters/tagBy.vue +4 -2
- package/src/filters/topicBy.vue +12 -10
- package/src/filters/versionBy.vue +5 -3
- package/src/filters/zlpBy.vue +29 -25
- package/src/footer/copyright.vue +5 -5
- package/src/footer/links.vue +2 -2
- package/src/footer/official.vue +1 -1
- package/src/footer/resource.vue +6 -6
- package/src/header/alternate.vue +35 -18
- package/src/header/asset.vue +9 -19
- package/src/header/box.vue +20 -8
- package/src/header/box2.vue +16 -9
- package/src/header/client.vue +7 -7
- package/src/header/lang.vue +41 -6
- package/src/header/logo.vue +2 -3
- package/src/header/manage.vue +2 -2
- package/src/header/message.vue +3 -3
- package/src/header/nav.vue +26 -23
- package/src/header/publish.vue +2 -2
- package/src/header/search.vue +2 -2
- package/src/header/shop.vue +2 -2
- package/src/header/user.vue +4 -4
- package/src/header/userInfo.vue +22 -24
- package/src/header/vip.vue +2 -2
- package/src/interact/BoxcoinAdmin.vue +30 -16
- package/src/interact/BoxcoinRecords.vue +28 -11
- package/src/interact/BoxcoinUser.vue +33 -17
- package/src/interact/Fav.vue +5 -1
- package/src/interact/Homework.vue +317 -0
- package/src/interact/Like.vue +4 -2
- package/src/interact/QRcode.vue +104 -0
- package/src/interact/Rss.vue +10 -4
- package/src/interact/Share.vue +18 -19
- package/src/interact/WatchLater.vue +5 -1
- package/src/main.js +1 -0
- package/src/single/Author.vue +5 -1
- package/src/single/CmsSingle.vue +29 -15
- package/src/single/Collection.vue +36 -26
- package/src/single/Comment.vue +19 -13
- package/src/single/Creators.vue +5 -3
- package/src/single/PostCollection.vue +158 -0
- package/src/single/PostDirectory.vue +0 -126
- package/src/single/PostGuide.vue +93 -0
- package/src/single/PostHeader.vue +39 -17
- package/src/single/PostTopic.vue +3 -3
- package/src/single/PostVersion.vue +219 -0
- package/src/single/RightAffix.vue +160 -0
- package/src/single/SimpleThx.vue +4 -2
- package/src/single/Thx.vue +14 -2
- package/src/single/VersionDialog.vue +238 -0
- package/src/stories/components/StoryPropsTable.vue +137 -0
- package/src/stories/filters/FilterGallery.stories.js +110 -0
- package/src/stories/filters/clientBy.stories.js +24 -0
- package/src/stories/filters/markBy.stories.js +6 -0
- package/src/stories/filters/menuBy.stories.js +6 -0
- package/src/stories/filters/orderBy.stories.js +6 -0
- package/src/stories/filters/tagBy.stories.js +6 -0
- package/src/stories/filters/topicBy.stories.js +6 -0
- package/src/stories/filters/versionBy.stories.js +6 -0
- package/src/stories/filters/zlpBy.stories.js +6 -0
- package/src/stories/interact/QRcode.stories.js +59 -0
- package/src/stories/layout/BaseShell.stories.js +38 -0
- package/src/stories/layout/Breadcrumb.stories.js +40 -0
- package/src/stories/layout/CommonFooter.stories.js +1 -1
- package/src/stories/layout/CommonHeader.stories.js +1 -1
- package/src/stories/layout/LeftSideToggle.stories.js +78 -0
- package/src/stories/layout/LeftSidebar.stories.js +40 -0
- package/src/stories/layout/Main.stories.js +41 -0
- package/src/stories/layout/RightSidebar.stories.js +36 -0
- package/src/stories/layout/StorybookShell.vue +271 -0
- package/src/stories/layout/SuspendCommon.stories.js +67 -0
- package/src/stories/layout/SuspendCommonStage.vue +143 -0
- package/src/stories/mockData.js +369 -0
- package/src/stories/other/UserPop.stories.js +51 -0
- package/src/stories/single/Author.stories.js +19 -0
- package/src/stories/single/AuthorStoryStage.vue +103 -0
- package/src/stories/single/CmsSingle.stories.js +19 -0
- package/src/stories/single/CmsSingleStoryStage.vue +118 -0
- package/src/stories/single/Collection.stories.js +34 -0
- package/src/stories/single/Comment.stories.js +36 -0
- package/src/stories/single/Creators.stories.js +34 -0
- package/src/stories/single/PostCollection.stories.js +34 -0
- package/src/stories/single/PostDirectory.stories.js +31 -0
- package/src/stories/single/PostGuide.stories.js +47 -0
- package/src/stories/single/PostHeader.stories.js +39 -0
- package/src/stories/single/PostVersion.stories.js +41 -0
- package/src/stories/single/RightAffix.stories.js +84 -0
- package/src/stories/single/SimpleThx.stories.js +39 -0
- package/src/stories/single/SingleGallery.stories.js +207 -0
- package/src/stories/single/Thx.stories.js +38 -0
- package/src/stories/wiki/GamePrice.stories.js +64 -0
- package/src/stories/wiki/WikiComments.stories.js +58 -0
- package/src/stories/wiki/WikiPanel.stories.js +69 -0
- package/src/stories/wiki/WikiRevisions.stories.js +47 -0
- package/src/wiki/GamePrice.vue +107 -0
- package/src/wiki/WikiComment.vue +153 -0
- package/src/wiki/WikiComments.vue +206 -0
- package/src/wiki/WikiPanel.vue +121 -0
- package/src/wiki/WikiRevisions.vue +125 -0
- package/vue.config.js +2 -12
- package/assets/css/common/bottom.less +0 -25
- package/assets/css/editor/article.less +0 -36
- package/assets/css/editor/combo.less +0 -362
- package/assets/css/editor/resource.less +0 -399
- package/assets/css/editor/tinymce.less +0 -100
- package/assets/css/editor/upload.less +0 -136
- package/assets/css/module/author.less +0 -231
- package/assets/css/module/buff.less +0 -88
- package/assets/css/module/directory.less +0 -165
- package/assets/css/module/icon.less +0 -25
- package/assets/css/module/item.less +0 -279
- package/assets/css/module/item_simple.less +0 -58
- package/assets/css/module/jx3_element.less +0 -5
- package/assets/css/module/macro.less +0 -89
- package/assets/css/module/npc.less +0 -265
- package/assets/css/module/resource.less +0 -93
- package/assets/css/module/skill.less +0 -74
- package/assets/css/module/talent.less +0 -495
- package/assets/js/a.js +0 -46
- package/assets/js/code.js +0 -13
- package/assets/js/combo.js +0 -40
- package/assets/js/directory.js +0 -114
- package/assets/js/filter2.js +0 -186
- package/assets/js/fold.js +0 -11
- package/assets/js/gallery.js +0 -14
- package/assets/js/hljs_languages.js +0 -177
- package/assets/js/iframe.js +0 -38
- package/assets/js/img.js +0 -23
- package/assets/js/item/attribute_percent.js +0 -88
- package/assets/js/item/bind.js +0 -18
- package/assets/js/item/border.js +0 -19
- package/assets/js/item/border_quest.js +0 -12
- package/assets/js/item/color.js +0 -25
- package/assets/js/item/hljs_languages.js +0 -177
- package/assets/js/item/icon_url.js +0 -15
- package/assets/js/item/second_format.js +0 -19
- package/assets/js/jx3_element.js +0 -73
- package/assets/js/katex.js +0 -181
- package/assets/js/macro.js +0 -16
- package/assets/js/nextpage.js +0 -4
- package/assets/js/pswp.js +0 -67
- package/assets/js/pswp_template.js +0 -66
- package/assets/js/pz_iframe.js +0 -30
- package/assets/js/qixue.js +0 -28
- package/assets/js/renderImgPreview.js +0 -18
- package/assets/js/script.js +0 -6
- package/assets/js/stat.js +0 -107
- package/assets/js/talent2.js +0 -21
- package/assets/js/tex-mml-chtml.js +0 -36310
- package/assets/js/voice.js +0 -238
- package/assets/js/xss.js +0 -130
- package/src/editor/Article.vue +0 -230
- package/src/editor/BoxResource.vue +0 -441
- package/src/editor/Resource.vue +0 -623
- package/src/editor/Tinymce.vue +0 -204
- package/src/editor/Upload.vue +0 -277
- package/src/editor/UploadAlum.vue +0 -176
- package/src/editor/UploadBanner.vue +0 -156
- package/src/editor/components/Author.vue +0 -322
- package/src/editor/components/Avatar.vue +0 -95
- package/src/editor/components/Buff.vue +0 -80
- package/src/editor/components/Combo.vue +0 -259
- package/src/editor/components/Equip.vue +0 -299
- package/src/editor/components/GameText.vue +0 -242
- package/src/editor/components/Item.vue +0 -325
- package/src/editor/components/ItemSimple.vue +0 -134
- package/src/editor/components/Medal.vue +0 -43
- package/src/editor/components/Npc.vue +0 -215
- package/src/editor/components/PostAuthor.vue +0 -102
- package/src/editor/components/Skill.vue +0 -71
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<WikiPanel class="c-wiki-comments" scene="detail">
|
|
3
|
+
<template #head-title>
|
|
4
|
+
<i class="el-icon-chat-line-round"></i>
|
|
5
|
+
<span>百科评论</span>
|
|
6
|
+
</template>
|
|
7
|
+
<template #body>
|
|
8
|
+
<div class="m-comments-panel" v-loading="loading">
|
|
9
|
+
<div class="u-empty" v-if="!comments || !comments.length">
|
|
10
|
+
<span v-if="comments === null">🎉 数据加载中...</span>
|
|
11
|
+
<span v-if="comments === false">⚠️ 数据加载异常</span>
|
|
12
|
+
<span v-if="comments && !comments.length">💧 暂无评论</span>
|
|
13
|
+
</div>
|
|
14
|
+
<!-- 递归评论组件 -->
|
|
15
|
+
<Comment :comments="comments" :source-id="sourceId" />
|
|
16
|
+
<el-pagination
|
|
17
|
+
class="u-pagination-box"
|
|
18
|
+
background
|
|
19
|
+
hide-on-single-page
|
|
20
|
+
:current-page="page"
|
|
21
|
+
:total="total"
|
|
22
|
+
:page-size="pageSize"
|
|
23
|
+
layout="prev, pager, next, total"
|
|
24
|
+
@current-change="handleCurrentChange"
|
|
25
|
+
></el-pagination>
|
|
26
|
+
<!-- 回复表单 -->
|
|
27
|
+
<div id="m-reply-form" class="m-reply-form">
|
|
28
|
+
<h4 class="u-title">
|
|
29
|
+
<i class="el-icon-chat-dot-round"></i>
|
|
30
|
+
<span>回复</span>
|
|
31
|
+
</h4>
|
|
32
|
+
<textarea class="u-reply-content" v-model="reply_form.content"></textarea>
|
|
33
|
+
<div class="u-author">
|
|
34
|
+
<span>昵称:</span>
|
|
35
|
+
<input v-model="reply_form.user_nickname" type="text" />
|
|
36
|
+
</div>
|
|
37
|
+
<el-button type="primary" class="u-submit" @click="create_comment(reply_form)">
|
|
38
|
+
<i class="el-icon-check"></i>
|
|
39
|
+
<span>提交</span>
|
|
40
|
+
</el-button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
</WikiPanel>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import WikiPanel from "./WikiPanel";
|
|
49
|
+
import Comment from "./WikiComment.vue";
|
|
50
|
+
import { wikiComment } from "@jx3box/jx3box-common/js/wiki";
|
|
51
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
name: "WikiComments",
|
|
55
|
+
props: {
|
|
56
|
+
type: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "",
|
|
59
|
+
},
|
|
60
|
+
sourceId: {
|
|
61
|
+
type: [Number, String],
|
|
62
|
+
default: 0,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
data() {
|
|
66
|
+
return {
|
|
67
|
+
comments: null,
|
|
68
|
+
reply_form: {
|
|
69
|
+
content: "",
|
|
70
|
+
user_nickname: User.getInfo().name,
|
|
71
|
+
},
|
|
72
|
+
page: 1,
|
|
73
|
+
pageSize: 10,
|
|
74
|
+
total: 0,
|
|
75
|
+
loading: false,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
client: function () {
|
|
80
|
+
return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
methods: {
|
|
84
|
+
get_comments() {
|
|
85
|
+
if (!this.type || !this.sourceId) return;
|
|
86
|
+
this.loading = true;
|
|
87
|
+
wikiComment
|
|
88
|
+
.list({ type: this.type, id: this.sourceId }, { client: this.client, page: this.page })
|
|
89
|
+
.then((res) => {
|
|
90
|
+
res = res.data;
|
|
91
|
+
let comments = res.data.list;
|
|
92
|
+
for (let i = 0; i < comments.length; i++) {
|
|
93
|
+
comments[i]["reply_form"] = {
|
|
94
|
+
show: false,
|
|
95
|
+
content: "",
|
|
96
|
+
user_nickname: User.getInfo().name,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
this.page = res.data.page;
|
|
100
|
+
this.total = res.data.total;
|
|
101
|
+
this.comments = filter(comments, 0);
|
|
102
|
+
// this.comments = comments;
|
|
103
|
+
this.loading = false;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
function filter(comments, parent) {
|
|
107
|
+
let outputs = [];
|
|
108
|
+
for (let index in comments) {
|
|
109
|
+
let c = comments[index];
|
|
110
|
+
if (!c) continue;
|
|
111
|
+
if (c.parent_id === parent) {
|
|
112
|
+
// 递归
|
|
113
|
+
let children = filter(c.children, c.id);
|
|
114
|
+
c.children = children.map((item) => {
|
|
115
|
+
item.parent = {
|
|
116
|
+
user_id: c.user_id,
|
|
117
|
+
user_nickname: c.user_nickname,
|
|
118
|
+
id: c.id,
|
|
119
|
+
};
|
|
120
|
+
item.reply_form = {
|
|
121
|
+
show: false,
|
|
122
|
+
content: "",
|
|
123
|
+
user_nickname: User.getInfo().name,
|
|
124
|
+
};
|
|
125
|
+
return item;
|
|
126
|
+
});
|
|
127
|
+
outputs.push(c);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return outputs;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
create_comment(form, parent_id = 0) {
|
|
134
|
+
// 校验评论内容
|
|
135
|
+
if (!form.content) {
|
|
136
|
+
this.$message({
|
|
137
|
+
message: "请先填写评论内容再尝试提交",
|
|
138
|
+
type: "warning",
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const data = {
|
|
143
|
+
type: this.type,
|
|
144
|
+
source_id: this.sourceId,
|
|
145
|
+
parent_id: parent_id,
|
|
146
|
+
user_nickname: form.user_nickname || User.getInfo().name,
|
|
147
|
+
content: form.content,
|
|
148
|
+
client: this.client,
|
|
149
|
+
};
|
|
150
|
+
wikiComment
|
|
151
|
+
.post(data)
|
|
152
|
+
.then((res) => {
|
|
153
|
+
res = res.data;
|
|
154
|
+
form.content = "";
|
|
155
|
+
this.$message({
|
|
156
|
+
message: "提交成功,请等待审核",
|
|
157
|
+
type: "success",
|
|
158
|
+
});
|
|
159
|
+
})
|
|
160
|
+
.finally(() => {
|
|
161
|
+
form.show = false;
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
handleCurrentChange(page) {
|
|
165
|
+
this.page = page;
|
|
166
|
+
this.get_comments();
|
|
167
|
+
},
|
|
168
|
+
star_comment(comment, is_star) {
|
|
169
|
+
wikiComment
|
|
170
|
+
.star(comment.id, {
|
|
171
|
+
is_star,
|
|
172
|
+
})
|
|
173
|
+
.then(() => {
|
|
174
|
+
this.page = 1; // 重置页码
|
|
175
|
+
this.get_comments();
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
top_comment(comment, is_top) {
|
|
179
|
+
wikiComment
|
|
180
|
+
.top(comment.id, {
|
|
181
|
+
is_top,
|
|
182
|
+
})
|
|
183
|
+
.then(() => {
|
|
184
|
+
this.page = 1; // 重置页码
|
|
185
|
+
this.get_comments();
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
components: {
|
|
190
|
+
WikiPanel,
|
|
191
|
+
Comment,
|
|
192
|
+
},
|
|
193
|
+
watch: {
|
|
194
|
+
sourceId: {
|
|
195
|
+
immediate: true,
|
|
196
|
+
handler() {
|
|
197
|
+
this.get_comments();
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
</script>
|
|
203
|
+
|
|
204
|
+
<style lang="less">
|
|
205
|
+
@import "../../assets/css/wiki/wiki-comments.less";
|
|
206
|
+
</style>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="c-wiki-panel"
|
|
4
|
+
:class="{
|
|
5
|
+
'border-none': borderNone,
|
|
6
|
+
'm-detail-scene': wikiPost || scene === 'detail',
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<div class="m-panel-head">
|
|
10
|
+
<slot name="head-before"></slot>
|
|
11
|
+
<div class="m-panel-actions">
|
|
12
|
+
<QRcode v-if="wikiPost && showQR" class="u-qr" />
|
|
13
|
+
<slot name="head-actions"></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="m-panel-title">
|
|
16
|
+
<slot name="head-title"></slot>
|
|
17
|
+
</div>
|
|
18
|
+
<slot name="head-after"></slot>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="m-panel-body">
|
|
21
|
+
<slot name="body-before"></slot>
|
|
22
|
+
<div class="m-wiki-metas" v-if="wikiPost && wikiPost.post">
|
|
23
|
+
<!-- 参与贡献 -->
|
|
24
|
+
<div class="u-meta" v-if="wikiPost.users && wikiPost.users.length">
|
|
25
|
+
<em class="u-label">参与贡献</em>
|
|
26
|
+
<a
|
|
27
|
+
class="u-value u-creator"
|
|
28
|
+
v-for="(user, key) in wikiPost.users"
|
|
29
|
+
:key="key"
|
|
30
|
+
target="_blank"
|
|
31
|
+
:href="user.id ? author_url(user.id) : null"
|
|
32
|
+
>
|
|
33
|
+
<img :src="thumbnail_url(user.avatar)" :alt="user.nickname" :title="user.nickname" />
|
|
34
|
+
</a>
|
|
35
|
+
</div>
|
|
36
|
+
<!-- 综合难度 -->
|
|
37
|
+
<div class="u-meta" v-if="wikiPost.post && wikiPost.post.level">
|
|
38
|
+
<em class="u-label">综合难度</em>
|
|
39
|
+
<span class="u-value">
|
|
40
|
+
<i class="el-icon-star-on" v-for="i in wikiPost.post.level" :key="i"></i>
|
|
41
|
+
</span>
|
|
42
|
+
</div>
|
|
43
|
+
<!-- 热度 -->
|
|
44
|
+
<div class="u-meta" v-if="stat">
|
|
45
|
+
<em class="u-label">热度</em>
|
|
46
|
+
<span class="u-value" v-text="stat.views"></span>
|
|
47
|
+
</div>
|
|
48
|
+
<!-- 更新时间 -->
|
|
49
|
+
<div class="u-meta" v-if="wikiPost.post && wikiPost.post.updated">
|
|
50
|
+
<em class="u-label">更新时间</em>
|
|
51
|
+
<span class="u-value" v-text="ts2str(wikiPost.post.updated)"></span>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<slot name="body"></slot>
|
|
55
|
+
<slot name="body-after"></slot>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import _ from "lodash";
|
|
62
|
+
import QRcode from "../interact/QRcode";
|
|
63
|
+
import { authorLink, ts2str, showAvatar } from "@jx3box/jx3box-common/js/utils";
|
|
64
|
+
import { getStat } from "@jx3box/jx3box-common/js/stat";
|
|
65
|
+
export default {
|
|
66
|
+
name: "WikiPost",
|
|
67
|
+
props: {
|
|
68
|
+
wikiPost: {
|
|
69
|
+
type: Object,
|
|
70
|
+
default: null,
|
|
71
|
+
},
|
|
72
|
+
scene: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "default",
|
|
75
|
+
},
|
|
76
|
+
borderNone: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false,
|
|
79
|
+
},
|
|
80
|
+
showQR: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
data() {
|
|
86
|
+
return {
|
|
87
|
+
stat: null,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
watch: {
|
|
91
|
+
wikiPost: {
|
|
92
|
+
immediate: true,
|
|
93
|
+
handler() {
|
|
94
|
+
if (!this.wikiPost) return;
|
|
95
|
+
// 获取热度信息
|
|
96
|
+
if (this.wikiPost.type && this.wikiPost.source_id) {
|
|
97
|
+
let type = this.wikiPost.type;
|
|
98
|
+
if (type === "achievement") type = "cj";
|
|
99
|
+
getStat(type, this.wikiPost.source_id).then((data) => {
|
|
100
|
+
if (data.status === 200) this.stat = data.data;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
methods: {
|
|
107
|
+
author_url: authorLink,
|
|
108
|
+
ts2str,
|
|
109
|
+
thumbnail_url: function (val) {
|
|
110
|
+
return showAvatar(val);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
components: {
|
|
114
|
+
QRcode,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<style lang="less">
|
|
120
|
+
@import "../../assets/css/wiki/wiki-panel.less";
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<WikiPanel class="c-wiki-revisions" scene="detail">
|
|
3
|
+
<template #head-title>
|
|
4
|
+
<i class="el-icon-time"></i>
|
|
5
|
+
<span>历史版本</span>
|
|
6
|
+
</template>
|
|
7
|
+
<template #body>
|
|
8
|
+
<div class="m-revisions-panel">
|
|
9
|
+
<div class="u-empty" v-if="!versions || !versions.length">
|
|
10
|
+
<span v-if="versions === null">🎉 数据加载中...</span>
|
|
11
|
+
<span v-if="versions === false">⚠️ 数据加载异常</span>
|
|
12
|
+
<span v-if="versions && !versions.length">💧 暂无数据</span>
|
|
13
|
+
</div>
|
|
14
|
+
<table v-if="versions && versions.length" class="m-histories">
|
|
15
|
+
<tr>
|
|
16
|
+
<th>版本</th>
|
|
17
|
+
<th>更新时间</th>
|
|
18
|
+
<th>贡献者</th>
|
|
19
|
+
<th>修订说明</th>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr class="history" v-for="(ver, key) in versions" :key="key">
|
|
22
|
+
<td>
|
|
23
|
+
<a
|
|
24
|
+
:href="link(type, `${ver.source_id}/${ver.id}`)"
|
|
25
|
+
v-text="'v' + (versions.length - key)"
|
|
26
|
+
@click="redirectRevision(ver, $event)"
|
|
27
|
+
></a>
|
|
28
|
+
</td>
|
|
29
|
+
<td v-text="ts2str(ver.updated)"></td>
|
|
30
|
+
<td>
|
|
31
|
+
<a :href="ver.user_id ? author_url(ver.user_id) : null" v-text="ver.user_nickname"></a>
|
|
32
|
+
</td>
|
|
33
|
+
<td v-text="ver.remark"></td>
|
|
34
|
+
</tr>
|
|
35
|
+
</table>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
</WikiPanel>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import WikiPanel from "./WikiPanel";
|
|
43
|
+
import { wiki } from "@jx3box/jx3box-common/js/wiki";
|
|
44
|
+
import { getLink, authorLink, ts2str } from "@jx3box/jx3box-common/js/utils";
|
|
45
|
+
import jx3box from "@jx3box/jx3box-common/data/jx3box.json";
|
|
46
|
+
const { __Root, __OriginRoot } = jx3box;
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: "WikiRevisions",
|
|
50
|
+
props: {
|
|
51
|
+
type: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "",
|
|
54
|
+
},
|
|
55
|
+
sourceId: {
|
|
56
|
+
type: [String, Number],
|
|
57
|
+
default: "",
|
|
58
|
+
},
|
|
59
|
+
isGame: {
|
|
60
|
+
type: [Boolean, Number],
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
data: function () {
|
|
65
|
+
return {
|
|
66
|
+
versions: [],
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
computed: {
|
|
70
|
+
client: function () {
|
|
71
|
+
return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
|
|
72
|
+
},
|
|
73
|
+
baseUrl: function () {
|
|
74
|
+
return this.client == "origin" ? __OriginRoot : __Root;
|
|
75
|
+
},
|
|
76
|
+
prefix: function () {
|
|
77
|
+
if (this.isGame) {
|
|
78
|
+
return this.baseUrl.slice(0, -1);
|
|
79
|
+
} else {
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
link: function (type, id) {
|
|
86
|
+
return this.prefix + getLink(type, id);
|
|
87
|
+
},
|
|
88
|
+
author_url: function (uid) {
|
|
89
|
+
return this.prefix + authorLink(uid);
|
|
90
|
+
},
|
|
91
|
+
ts2str,
|
|
92
|
+
redirectRevision: function (ver, e) {
|
|
93
|
+
if (!this.isGame && this.$router) {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
this.$router.replace({ path: `/view/${ver.source_id}/${ver.id}` });
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
components: {
|
|
100
|
+
WikiPanel,
|
|
101
|
+
},
|
|
102
|
+
watch: {
|
|
103
|
+
sourceId: {
|
|
104
|
+
immediate: true,
|
|
105
|
+
handler() {
|
|
106
|
+
if (this.sourceId) {
|
|
107
|
+
wiki.versions({ type: this.type, id: this.sourceId }, { client: this.client }).then(
|
|
108
|
+
(res) => {
|
|
109
|
+
res = res.data;
|
|
110
|
+
this.versions = res.data || [];
|
|
111
|
+
},
|
|
112
|
+
() => {
|
|
113
|
+
this.versions = [];
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style lang="less">
|
|
124
|
+
@import "../../assets/css/wiki/wiki-revisions.less";
|
|
125
|
+
</style>
|
package/vue.config.js
CHANGED
|
@@ -14,18 +14,6 @@ module.exports = {
|
|
|
14
14
|
filename: "index.html",
|
|
15
15
|
title: "JX3BOX",
|
|
16
16
|
},
|
|
17
|
-
article: {
|
|
18
|
-
title: "Article",
|
|
19
|
-
entry: "demo/A.js",
|
|
20
|
-
template: "public/article.html",
|
|
21
|
-
filename: "article/index.html",
|
|
22
|
-
},
|
|
23
|
-
tinymce: {
|
|
24
|
-
title: "Tinymce",
|
|
25
|
-
entry: "demo/T.js",
|
|
26
|
-
template: "public/tinymce.html",
|
|
27
|
-
filename: "tinymce/index.html",
|
|
28
|
-
},
|
|
29
17
|
},
|
|
30
18
|
|
|
31
19
|
|
|
@@ -138,6 +126,8 @@ function buildEnvProxy() {
|
|
|
138
126
|
target: normalized,
|
|
139
127
|
changeOrigin: true,
|
|
140
128
|
secure: false,
|
|
129
|
+
// API 代理不需要 websocket,避免给 dev server 叠加 upgrade 监听器
|
|
130
|
+
ws: false,
|
|
141
131
|
cookieDomainRewrite: "",
|
|
142
132
|
pathRewrite: (p) => p.replace(contextRe, ""),
|
|
143
133
|
},
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
@gray: #888;
|
|
2
|
-
@space: 20px;
|
|
3
|
-
@pink: #f39;
|
|
4
|
-
|
|
5
|
-
.m-bottom {
|
|
6
|
-
/* assets/css/common/bottom.less */
|
|
7
|
-
font-size: 12px;
|
|
8
|
-
color: @gray;
|
|
9
|
-
margin-top: @space;
|
|
10
|
-
font-family: verdana, "Trebuchet MS", Tahoma;
|
|
11
|
-
|
|
12
|
-
a {
|
|
13
|
-
/* assets/css/common/bottom.less */
|
|
14
|
-
color: @gray;
|
|
15
|
-
&:hover {
|
|
16
|
-
/* assets/css/common/bottom.less */
|
|
17
|
-
color: @pink;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.u-feedback {
|
|
22
|
-
/* assets/css/common/bottom.less */
|
|
23
|
-
float: right;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// tinymce文章样式
|
|
2
|
-
|
|
3
|
-
@import "../tinymce/_.less";
|
|
4
|
-
@import "../tinymce/a.less";
|
|
5
|
-
@import "../tinymce/list.less";
|
|
6
|
-
@import "../tinymce/quote.less";
|
|
7
|
-
@import "../tinymce/hr.less";
|
|
8
|
-
@import "../tinymce/table.less";
|
|
9
|
-
@import "../tinymce/img.less";
|
|
10
|
-
@import "../tinymce/p.less";
|
|
11
|
-
@import "../tinymce/h.less";
|
|
12
|
-
@import "../tinymce/code.less";
|
|
13
|
-
@import "../tinymce/fold.less";
|
|
14
|
-
@import "../tinymce/plugin.less";
|
|
15
|
-
@import "../tinymce/imgpreview.less";
|
|
16
|
-
@import "../tinymce/latex.less";
|
|
17
|
-
@import "../tinymce/nextpage.less";
|
|
18
|
-
|
|
19
|
-
@import "../module/macro.less";
|
|
20
|
-
@import "../module/talent.less";
|
|
21
|
-
|
|
22
|
-
@import "../tinymce/video.less";
|
|
23
|
-
@import "../tinymce/macro.less";
|
|
24
|
-
@import "../tinymce/qixue.less";
|
|
25
|
-
@import "../tinymce/pz.less";
|
|
26
|
-
@import "../tinymce/combo.less";
|
|
27
|
-
|
|
28
|
-
@import "../module/directory.less";
|
|
29
|
-
@import "../module/icon.less";
|
|
30
|
-
@import "../module/resource.less";
|
|
31
|
-
@import "../module/jx3_element.less";
|
|
32
|
-
|
|
33
|
-
@import "../module/buff.less";
|
|
34
|
-
@import "../module/skill.less";
|
|
35
|
-
@import "../module/item.less";
|
|
36
|
-
@import "../module/npc.less";
|