@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,219 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-post-version" v-if="list && list.length">
|
|
3
|
+
<div class="m-title">
|
|
4
|
+
<div class="u-title">
|
|
5
|
+
<el-icon class="u-icon"><Clock /></el-icon>历史版本
|
|
6
|
+
</div>
|
|
7
|
+
<div class="u-op" @click="toggle">
|
|
8
|
+
<el-icon><DCaret></DCaret></el-icon> 折叠
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<transition name="collapse">
|
|
12
|
+
<ul v-show="show" class="u-list">
|
|
13
|
+
<li v-for="(item, i) in list" class="u-item" :key="i" @click="handleContrast(item)">
|
|
14
|
+
<div class="u-version">
|
|
15
|
+
<span>{{ item.version }}</span> - <span>{{ item.created_at }}</span>
|
|
16
|
+
</div>
|
|
17
|
+
<el-button class="u-compare" size="small" type="primary" link
|
|
18
|
+
><el-icon class="u-icon"><Sort></Sort></el-icon>对比</el-button
|
|
19
|
+
>
|
|
20
|
+
</li>
|
|
21
|
+
</ul>
|
|
22
|
+
</transition>
|
|
23
|
+
<version-dialog
|
|
24
|
+
v-model="visible"
|
|
25
|
+
:link_content_meta_id="link_content_meta_id"
|
|
26
|
+
:title="title"
|
|
27
|
+
:content="content"
|
|
28
|
+
:commit_hash="commit_hash"
|
|
29
|
+
:versions="list"
|
|
30
|
+
></version-dialog>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
import { getCommitHistories, commitHistory } from "../../service/commit-history";
|
|
36
|
+
import VersionDialog from "./VersionDialog.vue";
|
|
37
|
+
export default {
|
|
38
|
+
name: "PostVersion",
|
|
39
|
+
props: ["post"],
|
|
40
|
+
components: { VersionDialog },
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
loading: false,
|
|
44
|
+
index: 1,
|
|
45
|
+
pageSize: 10, // 取最新的10个版本即可
|
|
46
|
+
total: 0,
|
|
47
|
+
list: [],
|
|
48
|
+
show: true,
|
|
49
|
+
visible: false,
|
|
50
|
+
commit_hash: "",
|
|
51
|
+
isMobile: window.innerWidth < 768,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
link_content_meta_id() {
|
|
56
|
+
return this.post?.link_content_meta_id || 0;
|
|
57
|
+
},
|
|
58
|
+
content() {
|
|
59
|
+
return this.post?.post_content || "";
|
|
60
|
+
},
|
|
61
|
+
title() {
|
|
62
|
+
return this.post?.post_title || "";
|
|
63
|
+
},
|
|
64
|
+
pageParams() {
|
|
65
|
+
return {
|
|
66
|
+
index: this.index,
|
|
67
|
+
pageSize: this.pageSize,
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
watch: {
|
|
72
|
+
link_content_meta_id: {
|
|
73
|
+
immediate: true,
|
|
74
|
+
handler: function (val) {
|
|
75
|
+
!!val && this.load();
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
page() {
|
|
79
|
+
this.load();
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
methods: {
|
|
83
|
+
onAdd() {
|
|
84
|
+
commitHistory(this.link_content_meta_id, {
|
|
85
|
+
commit: "提交测试4",
|
|
86
|
+
content: `每日机缘4`,
|
|
87
|
+
})
|
|
88
|
+
.then((res) => {
|
|
89
|
+
this.$message.success("创建成功");
|
|
90
|
+
this.load();
|
|
91
|
+
})
|
|
92
|
+
.catch((err) => {
|
|
93
|
+
this.$message.error(err.message);
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
handleContrast(item) {
|
|
97
|
+
if (this.isMobile) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
this.commit_hash = item.commit_hash;
|
|
101
|
+
this.visible = true;
|
|
102
|
+
},
|
|
103
|
+
load() {
|
|
104
|
+
this.loading = true;
|
|
105
|
+
getCommitHistories(this.link_content_meta_id, this.pageParams)
|
|
106
|
+
.then((res) => {
|
|
107
|
+
const list = res.data?.data?.list || [];
|
|
108
|
+
if (list.length) {
|
|
109
|
+
this.list = list.map((item, i) => {
|
|
110
|
+
return {
|
|
111
|
+
...item,
|
|
112
|
+
version: "v" + (list.length - i),
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
this.total = res.data?.data?.page?.total || 0;
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
.finally(() => {
|
|
119
|
+
this.loading = false;
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
toggle() {
|
|
123
|
+
this.show = !this.show;
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
</script>
|
|
128
|
+
<style lang="less">
|
|
129
|
+
.c-post-version {
|
|
130
|
+
.m-title {
|
|
131
|
+
.flex;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
align-items: center;
|
|
134
|
+
//margin-bottom: 5px;
|
|
135
|
+
line-height: 24px;
|
|
136
|
+
.u-op {
|
|
137
|
+
font-size: 13px;
|
|
138
|
+
font-weight: 500;
|
|
139
|
+
line-height: 18px;
|
|
140
|
+
//float: right;
|
|
141
|
+
padding: 0 5px;
|
|
142
|
+
color: #cdd1db;
|
|
143
|
+
cursor: pointer;
|
|
144
|
+
.flex(y);
|
|
145
|
+
&:hover {
|
|
146
|
+
color: #a1a9bb;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
.u-title {
|
|
151
|
+
//font-weight: 400;
|
|
152
|
+
font-weight: normal;
|
|
153
|
+
font-size: 16px;
|
|
154
|
+
line-height: 18px;
|
|
155
|
+
color: #333;
|
|
156
|
+
.flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: 5px;
|
|
159
|
+
.u-icon {
|
|
160
|
+
font-size: 18px;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.u-list {
|
|
164
|
+
list-style: none;
|
|
165
|
+
padding: 10px;
|
|
166
|
+
margin: 0;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
li {
|
|
169
|
+
padding: 0 10px;
|
|
170
|
+
.fz(13px, 36px);
|
|
171
|
+
.flex;
|
|
172
|
+
justify-content: space-between;
|
|
173
|
+
align-items: center;
|
|
174
|
+
transition: 0.15s ease-in-out;
|
|
175
|
+
.nobreak;
|
|
176
|
+
&:hover {
|
|
177
|
+
background-color: #fcfcfc;
|
|
178
|
+
.r(4px);
|
|
179
|
+
|
|
180
|
+
.u-compare {
|
|
181
|
+
.db;
|
|
182
|
+
@media screen and (max-width: @phone) {
|
|
183
|
+
.none;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
.pointer;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.u-compare {
|
|
191
|
+
.none;
|
|
192
|
+
|
|
193
|
+
.u-icon {
|
|
194
|
+
transform: rotate(90deg);
|
|
195
|
+
margin-right: 3px;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.collapse-enter-active,
|
|
201
|
+
.collapse-leave-active {
|
|
202
|
+
transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.collapse-enter-from,
|
|
206
|
+
.collapse-leave-to {
|
|
207
|
+
max-height: 0;
|
|
208
|
+
opacity: 0;
|
|
209
|
+
padding-top: 0;
|
|
210
|
+
padding-bottom: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.collapse-enter-to,
|
|
214
|
+
.collapse-leave-from {
|
|
215
|
+
max-height: 480px;
|
|
216
|
+
opacity: 1;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
</style>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-right-affix" :class="{ 'is-close': !isOpen }">
|
|
3
|
+
<div class="item">
|
|
4
|
+
<fav :postId="postId" :postType="postType" :postTitle="postTitle" :hiddenNum="true" :isOld="true"></fav>
|
|
5
|
+
</div>
|
|
6
|
+
<el-tooltip v-if="showCommentBtn && showComment" effect="dark" content="去评论" placement="left">
|
|
7
|
+
<div class="u-item" @click="toComment">
|
|
8
|
+
<el-icon class="u-icon"><ChatDotSquare></ChatDotSquare></el-icon>
|
|
9
|
+
</div>
|
|
10
|
+
</el-tooltip>
|
|
11
|
+
<el-tooltip effect="dark" content="回到顶部" placement="bottom">
|
|
12
|
+
<div class="u-item" v-show="scrollBtnShow" @click="goTop">
|
|
13
|
+
<div class="u-to-top"></div>
|
|
14
|
+
</div>
|
|
15
|
+
</el-tooltip>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import Fav from "../interact/Fav.vue";
|
|
21
|
+
import Bus from "../../utils/bus";
|
|
22
|
+
export default {
|
|
23
|
+
name: "RightAffix",
|
|
24
|
+
props: {
|
|
25
|
+
postId: {
|
|
26
|
+
type: [String, Number],
|
|
27
|
+
default: "",
|
|
28
|
+
},
|
|
29
|
+
postType: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "",
|
|
32
|
+
},
|
|
33
|
+
postTitle: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "",
|
|
36
|
+
},
|
|
37
|
+
showComment: {
|
|
38
|
+
type: [Boolean, Number],
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
scrollToptimer: null,
|
|
45
|
+
scrollBtnShow: false,
|
|
46
|
+
showCommentBtn: false, // 等待img等元素加载完毕再显示评论按钮
|
|
47
|
+
|
|
48
|
+
isOpen: true,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
components: {
|
|
52
|
+
Fav,
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
goTop() {
|
|
56
|
+
window.scrollTo({
|
|
57
|
+
top: 0,
|
|
58
|
+
behavior: "smooth",
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
toComment() {
|
|
62
|
+
this.$emit("toComment");
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
mounted() {
|
|
66
|
+
//获取页面可视区高度
|
|
67
|
+
var clientHeight = document.documentElement.clientHeight;
|
|
68
|
+
const self = this;
|
|
69
|
+
window.addEventListener("scroll", function () {
|
|
70
|
+
//显示回到顶部按钮
|
|
71
|
+
var osTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
72
|
+
if (osTop >= clientHeight) {
|
|
73
|
+
self.scrollBtnShow = true;
|
|
74
|
+
} else {
|
|
75
|
+
self.scrollBtnShow = false;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
this.showCommentBtn = true;
|
|
81
|
+
}, 1000);
|
|
82
|
+
|
|
83
|
+
Bus.on("toggleRightSide", (data) => {
|
|
84
|
+
this.isOpen = data;
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
beforeUnmount() {
|
|
88
|
+
Bus.off("toggleRightSide");
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style lang="less">
|
|
94
|
+
.closeLeftSidebar() {
|
|
95
|
+
transition: 0.2s ease-in-out;
|
|
96
|
+
transform: translateX(100%);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.openLeftSidebar() {
|
|
100
|
+
transition: 0.2s ease-in-out;
|
|
101
|
+
transform: translateX(0);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.c-right-affix {
|
|
105
|
+
.openLeftSidebar();
|
|
106
|
+
position: fixed;
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
111
|
+
right: @aside-right;
|
|
112
|
+
top: @header-height + @bread-height + 100px;
|
|
113
|
+
background-color: #fafbfc;
|
|
114
|
+
padding: 8px 5px;
|
|
115
|
+
z-index: 200;
|
|
116
|
+
border-top-left-radius: 6px;
|
|
117
|
+
border-bottom-left-radius: 6px;
|
|
118
|
+
.u-item {
|
|
119
|
+
display: flex;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
align-items: center;
|
|
122
|
+
width: 32px;
|
|
123
|
+
height: 32px;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
&:hover {
|
|
126
|
+
background-color: #f6fcff;
|
|
127
|
+
}
|
|
128
|
+
.w-fav2 svg {
|
|
129
|
+
.size(26px);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.u-to-top {
|
|
133
|
+
width: 0;
|
|
134
|
+
height: 0;
|
|
135
|
+
border-left: 10px solid transparent;
|
|
136
|
+
border-right: 10px solid transparent;
|
|
137
|
+
border-bottom: 16px solid #87ceeb;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&.is-close {
|
|
141
|
+
.closeLeftSidebar();
|
|
142
|
+
right: 42px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.u-icon {
|
|
146
|
+
font-size: 20px;
|
|
147
|
+
color: #3871e0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
@media screen and (max-width: @smallpc) {
|
|
151
|
+
.c-right-affix {
|
|
152
|
+
right: 0;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
@media screen and (max-width: @phone) {
|
|
156
|
+
.c-right-affix {
|
|
157
|
+
.none;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
</style>
|
package/src/single/SimpleThx.vue
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
@updateRecord="updateRecord"
|
|
30
30
|
:client="client"
|
|
31
31
|
/>
|
|
32
|
-
<el-tooltip effect="dark" content="打赏记录" placement="top-start">
|
|
32
|
+
<el-tooltip effect="dark" :content="$jx3boxT('jx3boxUi.simpleThx.record', '打赏记录')" placement="top-start">
|
|
33
33
|
<!-- <div class="w-boxcoin-block"> -->
|
|
34
34
|
<img
|
|
35
35
|
src="../../assets/img/widget/records.svg"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</el-tooltip>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
|
-
<el-drawer v-model="showDrawer" title="打赏记录" append-to-body>
|
|
45
|
+
<el-drawer v-model="showDrawer" :title="$jx3boxT('jx3boxUi.simpleThx.record', '打赏记录')" append-to-body>
|
|
46
46
|
<BoxcoinRecords
|
|
47
47
|
:postId="postId"
|
|
48
48
|
:postType="postType"
|
|
@@ -63,9 +63,11 @@ import BoxcoinUser from "../interact/BoxcoinUser.vue";
|
|
|
63
63
|
import BoxcoinRecords from "../interact/BoxcoinRecords.vue";
|
|
64
64
|
import User from "@jx3box/jx3box-common/js/user";
|
|
65
65
|
import { getBoxcoinStatus, getPostBoxcoinConfig } from "../../service/thx";
|
|
66
|
+
import i18nMixin from "../../i18n/mixin";
|
|
66
67
|
|
|
67
68
|
export default {
|
|
68
69
|
name: "SimpleThx",
|
|
70
|
+
mixins: [i18nMixin],
|
|
69
71
|
components: {
|
|
70
72
|
Like,
|
|
71
73
|
Fav,
|
package/src/single/Thx.vue
CHANGED
|
@@ -57,8 +57,18 @@
|
|
|
57
57
|
</div>
|
|
58
58
|
<div class="w-thx-copyright">
|
|
59
59
|
©
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
{{
|
|
61
|
+
$jx3boxT(
|
|
62
|
+
"jx3boxUi.thx.copyright1",
|
|
63
|
+
"所有原创作品,著作权归作者所有,所有未经授权的非署名转载或抄袭将有权追究法律责任,所有法律事务由专聘律师代理。"
|
|
64
|
+
)
|
|
65
|
+
}}<br />
|
|
66
|
+
{{
|
|
67
|
+
$jx3boxT(
|
|
68
|
+
"jx3boxUi.thx.copyright2",
|
|
69
|
+
"签约作者独家特约稿件,及所有魔盒官方评分作品用户一经兑现则视为有偿付费稿件,所有商业稿件的转载引用需同时征得魔盒平台授权。"
|
|
70
|
+
)
|
|
71
|
+
}}
|
|
62
72
|
</div>
|
|
63
73
|
</div>
|
|
64
74
|
</template>
|
|
@@ -76,9 +86,11 @@ import Rss from "../interact/Rss.vue";
|
|
|
76
86
|
import User from "@jx3box/jx3box-common/js/user";
|
|
77
87
|
import { getBoxcoinStatus, getPostBoxcoinConfig } from "../../service/thx";
|
|
78
88
|
import { getConfig, getUserPermission } from "../../service/cms";
|
|
89
|
+
import i18nMixin from "../../i18n/mixin";
|
|
79
90
|
|
|
80
91
|
export default {
|
|
81
92
|
name: "ThxComp",
|
|
93
|
+
mixins: [i18nMixin],
|
|
82
94
|
components: {
|
|
83
95
|
Like,
|
|
84
96
|
Fav,
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
class="m-version-contrast-dialog"
|
|
4
|
+
:title="`版本比对 - ${title}`"
|
|
5
|
+
v-model="visible"
|
|
6
|
+
append-to-body
|
|
7
|
+
width="90%"
|
|
8
|
+
@close="close"
|
|
9
|
+
>
|
|
10
|
+
<div class="m-version-container" v-loading="loading">
|
|
11
|
+
<div class="m-toolbar">
|
|
12
|
+
<el-radio-group v-model="type">
|
|
13
|
+
<el-radio-button :value="item.value" v-for="item in types" :key="item.value">{{
|
|
14
|
+
item.label
|
|
15
|
+
}}</el-radio-button>
|
|
16
|
+
</el-radio-group>
|
|
17
|
+
<div class="m-select">
|
|
18
|
+
<el-select
|
|
19
|
+
class="u-select"
|
|
20
|
+
v-model="version1"
|
|
21
|
+
placeholder="请选择"
|
|
22
|
+
@change="versionChange($event, 1)"
|
|
23
|
+
>
|
|
24
|
+
<el-option
|
|
25
|
+
v-for="item in versions"
|
|
26
|
+
:key="item.id"
|
|
27
|
+
:label="item.version"
|
|
28
|
+
:value="item.commit_hash"
|
|
29
|
+
></el-option>
|
|
30
|
+
<template v-slot:prefix>
|
|
31
|
+
<span class="u-label">版本1</span>
|
|
32
|
+
</template>
|
|
33
|
+
</el-select>
|
|
34
|
+
<el-select
|
|
35
|
+
class="u-select"
|
|
36
|
+
v-model="version2"
|
|
37
|
+
placeholder="请选择"
|
|
38
|
+
@change="versionChange($event, 2)"
|
|
39
|
+
>
|
|
40
|
+
<el-option
|
|
41
|
+
v-for="item in versions"
|
|
42
|
+
:key="item.id"
|
|
43
|
+
:label="item.version"
|
|
44
|
+
:value="item.commit_hash"
|
|
45
|
+
></el-option>
|
|
46
|
+
<template v-slot:prefix> <span class="u-label">版本2</span> </template>
|
|
47
|
+
</el-select>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<div v-if="type === 'view'" class="m-content-container">
|
|
51
|
+
<div class="u-content">
|
|
52
|
+
<Article :content="content1" />
|
|
53
|
+
</div>
|
|
54
|
+
<div class="u-content">
|
|
55
|
+
<Article :content="content2" />
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<div v-if="type === 'code'" class="m-content-container">
|
|
59
|
+
<code-diff
|
|
60
|
+
class="m-content-view"
|
|
61
|
+
:old-string="content1"
|
|
62
|
+
:new-string="content2"
|
|
63
|
+
:context="1024"
|
|
64
|
+
output-format="side-by-side"
|
|
65
|
+
maxHeight="520px"
|
|
66
|
+
:filename="`${content1Len}字`"
|
|
67
|
+
:newFilename="`${content2Len}字`"
|
|
68
|
+
ignoreMatchingLines="data:image/png;base64,"
|
|
69
|
+
></code-diff>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</el-dialog>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script>
|
|
76
|
+
import { getCommitByHash } from "../../service/commit-history";
|
|
77
|
+
import Article from "@jx3box/jx3box-editor/src/Article.vue";
|
|
78
|
+
import { CodeDiff } from "v-code-diff";
|
|
79
|
+
export default {
|
|
80
|
+
name: "VersionDialog",
|
|
81
|
+
components: {
|
|
82
|
+
CodeDiff,
|
|
83
|
+
Article,
|
|
84
|
+
},
|
|
85
|
+
props: {
|
|
86
|
+
modelValue: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: false,
|
|
89
|
+
},
|
|
90
|
+
title: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: "",
|
|
93
|
+
},
|
|
94
|
+
content: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "",
|
|
97
|
+
},
|
|
98
|
+
commit_hash: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "",
|
|
101
|
+
},
|
|
102
|
+
link_content_meta_id: {
|
|
103
|
+
type: [Number, String],
|
|
104
|
+
default: 0,
|
|
105
|
+
},
|
|
106
|
+
versions: {
|
|
107
|
+
type: Array,
|
|
108
|
+
default: () => [],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
emits: ["update:modelValue"],
|
|
112
|
+
data() {
|
|
113
|
+
return {
|
|
114
|
+
loading: false,
|
|
115
|
+
type: "view",
|
|
116
|
+
types: [
|
|
117
|
+
{ label: "可视化", value: "view" },
|
|
118
|
+
{ label: "源码", value: "code" },
|
|
119
|
+
],
|
|
120
|
+
version1: "", // 版本1 默认最新,下拉可指定
|
|
121
|
+
version2: "", // 版本2 默认点击的版本,下拉可指定
|
|
122
|
+
content1: "",
|
|
123
|
+
content2: "",
|
|
124
|
+
|
|
125
|
+
visible: false,
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
computed: {
|
|
129
|
+
content1Len() {
|
|
130
|
+
const content = this.content1 || "";
|
|
131
|
+
return content
|
|
132
|
+
.replace(/(<([^>]+)>)/gi, "")
|
|
133
|
+
.replace(/\n/g, "")
|
|
134
|
+
.replace(/\s/g, "")
|
|
135
|
+
.replaceAll(" ", "").length;
|
|
136
|
+
},
|
|
137
|
+
content2Len() {
|
|
138
|
+
const content = this.content2 || "";
|
|
139
|
+
return content
|
|
140
|
+
.replace(/(<([^>]+)>)/gi, "")
|
|
141
|
+
.replace(/\n/g, "")
|
|
142
|
+
.replace(/\s/g, "")
|
|
143
|
+
.replaceAll(" ", "").length;
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
watch: {
|
|
147
|
+
modelValue: {
|
|
148
|
+
immediate: true,
|
|
149
|
+
handler(val) {
|
|
150
|
+
this.visible = val;
|
|
151
|
+
if (val) {
|
|
152
|
+
this.content1 = this.content;
|
|
153
|
+
this.version2 = this.commit_hash;
|
|
154
|
+
if (this.version2) {
|
|
155
|
+
this.load(this.version2, "content2");
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
visible(val) {
|
|
161
|
+
this.$emit("update:modelValue", val);
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
methods: {
|
|
165
|
+
close() {
|
|
166
|
+
this.visible = false;
|
|
167
|
+
},
|
|
168
|
+
versionChange(val, i) {
|
|
169
|
+
if (val) {
|
|
170
|
+
this[`version${i}`] = val;
|
|
171
|
+
const key = `content${i}`;
|
|
172
|
+
this.load(val, key);
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
load(hash, key) {
|
|
176
|
+
if (!this.link_content_meta_id) return;
|
|
177
|
+
this.loading = true;
|
|
178
|
+
getCommitByHash(this.link_content_meta_id, hash)
|
|
179
|
+
.then((res) => {
|
|
180
|
+
this[key] = res.data?.data?.content;
|
|
181
|
+
})
|
|
182
|
+
.finally(() => {
|
|
183
|
+
this.loading = false;
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
</script>
|
|
189
|
+
|
|
190
|
+
<style lang="less">
|
|
191
|
+
.m-version-contrast-dialog {
|
|
192
|
+
.el-dialog__body {
|
|
193
|
+
padding: 0 20px 20px;
|
|
194
|
+
}
|
|
195
|
+
.m-toolbar {
|
|
196
|
+
display: flex;
|
|
197
|
+
gap: 10px;
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
align-items: center;
|
|
201
|
+
.m-select {
|
|
202
|
+
display: flex;
|
|
203
|
+
gap: 20px;
|
|
204
|
+
width: 100%;
|
|
205
|
+
.u-select {
|
|
206
|
+
flex: 1;
|
|
207
|
+
}
|
|
208
|
+
.el-input--prefix .el-input__inner {
|
|
209
|
+
padding-left: 55px;
|
|
210
|
+
}
|
|
211
|
+
.el-input__prefix {
|
|
212
|
+
left: 10px;
|
|
213
|
+
top: 10px;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
.m-content-container {
|
|
218
|
+
display: flex;
|
|
219
|
+
gap: 20px;
|
|
220
|
+
margin-top: 20px;
|
|
221
|
+
max-height: 520px;
|
|
222
|
+
overflow-x: hidden;
|
|
223
|
+
overflow-y: auto;
|
|
224
|
+
.u-content {
|
|
225
|
+
flex: 1;
|
|
226
|
+
border: 1px solid #ebeef5;
|
|
227
|
+
padding: 20px;
|
|
228
|
+
box-sizing: border-box;
|
|
229
|
+
.r(5px);
|
|
230
|
+
height: 100%;
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
}
|
|
233
|
+
.m-content-view {
|
|
234
|
+
margin: 0;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
</style>
|