@jx3box/jx3box-ui 2.0.5 → 2.0.6

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.
Files changed (226) hide show
  1. package/.storybook/preview.js +22 -13
  2. package/.storybook/storybookMocks.js +191 -0
  3. package/README.md +6 -19
  4. package/assets/css/bread/admin.less +20 -2
  5. package/assets/css/bread/breadcrumb.less +5 -2
  6. package/assets/css/comment/quick-reply.less +1 -1
  7. package/assets/css/common/left-sidebar.less +1 -1
  8. package/assets/css/interact/like2.less +5 -2
  9. package/assets/css/single/author.less +15 -10
  10. package/assets/css/single/cms-single.less +1 -0
  11. package/assets/css/single/thx.less +34 -11
  12. package/assets/data/nav.json +344 -10
  13. package/assets/img/comment/comment.svg +1 -1
  14. package/assets/img/comment/heart_1.svg +1 -1
  15. package/assets/img/comment/hide.svg +1 -1
  16. package/assets/img/leftsidebar/medal.svg +1 -1
  17. package/assets/img/leftsidebar/post.svg +27 -46
  18. package/i18n/messages/en-US.js +357 -22
  19. package/i18n/messages/vi.js +350 -22
  20. package/i18n/messages/zh-CN.js +469 -20
  21. package/i18n/messages/zh-TW.js +350 -22
  22. package/index.js +19 -7
  23. package/package.json +8 -5
  24. package/service/cms.js +22 -0
  25. package/service/commit-history.js +18 -0
  26. package/service/community.js +60 -0
  27. package/service/fav.js +5 -6
  28. package/src/App.vue +154 -80
  29. package/src/Breadcrumb.vue +24 -11
  30. package/src/CommonFooter.vue +2 -2
  31. package/src/Footer.vue +13 -5
  32. package/src/LeftSideToggle.vue +10 -3
  33. package/src/LeftSidebar.vue +19 -5
  34. package/src/Main.vue +9 -2
  35. package/src/RightSidebar.vue +12 -3
  36. package/src/SuspendCommon.vue +52 -38
  37. package/src/author/AuthorFans.vue +7 -5
  38. package/src/author/AuthorFollow.vue +14 -7
  39. package/src/author/AuthorGift.vue +25 -17
  40. package/src/author/AuthorInfo.vue +46 -19
  41. package/src/author/AuthorLink.vue +3 -1
  42. package/src/author/AuthorMedals.vue +5 -2
  43. package/src/author/AuthorPosts.vue +31 -13
  44. package/src/author/AuthorRss.vue +7 -3
  45. package/src/author/AuthorTeams.vue +3 -1
  46. package/src/author/UserPop.vue +29 -17
  47. package/src/bread/Admin.vue +55 -32
  48. package/src/bread/AdminDirectMessage.vue +15 -8
  49. package/src/bread/AdminDrop.vue +124 -45
  50. package/src/bread/CommunityAdmin.vue +527 -0
  51. package/src/bread/DesignTask.vue +30 -26
  52. package/src/bread/ListAdmin.vue +199 -0
  53. package/src/bread/MigrateCommunity.vue +192 -0
  54. package/src/bread/MoveToCommunityDialog.vue +234 -0
  55. package/src/comment/Avatar.vue +18 -24
  56. package/src/comment/CommentContent.vue +57 -37
  57. package/src/comment/CommentContentSimple.vue +61 -63
  58. package/src/comment/CommentInputForm.vue +45 -34
  59. package/src/comment/CommentWithReply.vue +9 -6
  60. package/src/comment/QuickReply.vue +5 -1
  61. package/src/comment/ReplyForReply.vue +6 -4
  62. package/src/comment/ReplyList.vue +28 -18
  63. package/src/comment/Upload.vue +24 -6
  64. package/src/filters/clientBy.vue +10 -8
  65. package/src/filters/markBy.vue +35 -31
  66. package/src/filters/menuBy.vue +20 -22
  67. package/src/filters/orderBy.vue +17 -11
  68. package/src/filters/tagBy.vue +4 -2
  69. package/src/filters/topicBy.vue +12 -10
  70. package/src/filters/versionBy.vue +5 -3
  71. package/src/filters/zlpBy.vue +29 -25
  72. package/src/footer/copyright.vue +5 -5
  73. package/src/footer/links.vue +2 -2
  74. package/src/footer/official.vue +1 -1
  75. package/src/footer/resource.vue +6 -6
  76. package/src/header/alternate.vue +35 -18
  77. package/src/header/asset.vue +9 -19
  78. package/src/header/box.vue +20 -8
  79. package/src/header/box2.vue +16 -9
  80. package/src/header/client.vue +7 -7
  81. package/src/header/lang.vue +41 -6
  82. package/src/header/logo.vue +2 -3
  83. package/src/header/manage.vue +2 -2
  84. package/src/header/message.vue +3 -3
  85. package/src/header/nav.vue +26 -23
  86. package/src/header/publish.vue +2 -2
  87. package/src/header/search.vue +2 -2
  88. package/src/header/shop.vue +2 -2
  89. package/src/header/user.vue +4 -4
  90. package/src/header/userInfo.vue +22 -24
  91. package/src/header/vip.vue +2 -2
  92. package/src/interact/BoxcoinAdmin.vue +30 -16
  93. package/src/interact/BoxcoinRecords.vue +28 -11
  94. package/src/interact/BoxcoinUser.vue +33 -17
  95. package/src/interact/Fav.vue +5 -1
  96. package/src/interact/Homework.vue +318 -0
  97. package/src/interact/Like.vue +4 -2
  98. package/src/interact/Rss.vue +10 -4
  99. package/src/interact/Share.vue +18 -19
  100. package/src/interact/WatchLater.vue +5 -1
  101. package/src/main.js +1 -0
  102. package/src/single/Author.vue +5 -1
  103. package/src/single/CmsSingle.vue +29 -15
  104. package/src/single/Collection.vue +36 -26
  105. package/src/single/Comment.vue +19 -13
  106. package/src/single/Creators.vue +5 -3
  107. package/src/single/PostCollection.vue +158 -0
  108. package/src/single/PostDirectory.vue +0 -126
  109. package/src/single/PostGuide.vue +93 -0
  110. package/src/single/PostHeader.vue +39 -17
  111. package/src/single/PostTopic.vue +3 -3
  112. package/src/single/PostVersion.vue +219 -0
  113. package/src/single/RightAffix.vue +160 -0
  114. package/src/single/SimpleThx.vue +4 -2
  115. package/src/single/Thx.vue +14 -2
  116. package/src/single/VersionDialog.vue +238 -0
  117. package/src/stories/components/StoryPropsTable.vue +137 -0
  118. package/src/stories/filters/FilterGallery.stories.js +110 -0
  119. package/src/stories/filters/clientBy.stories.js +24 -0
  120. package/src/stories/filters/markBy.stories.js +6 -0
  121. package/src/stories/filters/menuBy.stories.js +6 -0
  122. package/src/stories/filters/orderBy.stories.js +6 -0
  123. package/src/stories/filters/tagBy.stories.js +6 -0
  124. package/src/stories/filters/topicBy.stories.js +6 -0
  125. package/src/stories/filters/versionBy.stories.js +6 -0
  126. package/src/stories/filters/zlpBy.stories.js +6 -0
  127. package/src/stories/layout/BaseShell.stories.js +38 -0
  128. package/src/stories/layout/Breadcrumb.stories.js +40 -0
  129. package/src/stories/layout/CommonFooter.stories.js +1 -1
  130. package/src/stories/layout/CommonHeader.stories.js +1 -1
  131. package/src/stories/layout/LeftSideToggle.stories.js +78 -0
  132. package/src/stories/layout/LeftSidebar.stories.js +40 -0
  133. package/src/stories/layout/Main.stories.js +41 -0
  134. package/src/stories/layout/RightSidebar.stories.js +36 -0
  135. package/src/stories/layout/StorybookShell.vue +271 -0
  136. package/src/stories/layout/SuspendCommon.stories.js +67 -0
  137. package/src/stories/layout/SuspendCommonStage.vue +143 -0
  138. package/src/stories/mockData.js +275 -0
  139. package/src/stories/other/UserPop.stories.js +51 -0
  140. package/src/stories/single/Author.stories.js +19 -0
  141. package/src/stories/single/AuthorStoryStage.vue +103 -0
  142. package/src/stories/single/CmsSingle.stories.js +19 -0
  143. package/src/stories/single/CmsSingleStoryStage.vue +118 -0
  144. package/src/stories/single/Collection.stories.js +34 -0
  145. package/src/stories/single/Comment.stories.js +36 -0
  146. package/src/stories/single/Creators.stories.js +34 -0
  147. package/src/stories/single/PostCollection.stories.js +34 -0
  148. package/src/stories/single/PostDirectory.stories.js +31 -0
  149. package/src/stories/single/PostGuide.stories.js +47 -0
  150. package/src/stories/single/PostHeader.stories.js +39 -0
  151. package/src/stories/single/PostVersion.stories.js +41 -0
  152. package/src/stories/single/RightAffix.stories.js +84 -0
  153. package/src/stories/single/SimpleThx.stories.js +39 -0
  154. package/src/stories/single/SingleGallery.stories.js +207 -0
  155. package/src/stories/single/Thx.stories.js +38 -0
  156. package/vue.config.js +2 -12
  157. package/assets/css/common/bottom.less +0 -25
  158. package/assets/css/editor/article.less +0 -36
  159. package/assets/css/editor/combo.less +0 -362
  160. package/assets/css/editor/resource.less +0 -399
  161. package/assets/css/editor/tinymce.less +0 -100
  162. package/assets/css/editor/upload.less +0 -136
  163. package/assets/css/module/author.less +0 -231
  164. package/assets/css/module/buff.less +0 -88
  165. package/assets/css/module/directory.less +0 -165
  166. package/assets/css/module/icon.less +0 -25
  167. package/assets/css/module/item.less +0 -279
  168. package/assets/css/module/item_simple.less +0 -58
  169. package/assets/css/module/jx3_element.less +0 -5
  170. package/assets/css/module/macro.less +0 -89
  171. package/assets/css/module/npc.less +0 -265
  172. package/assets/css/module/resource.less +0 -93
  173. package/assets/css/module/skill.less +0 -74
  174. package/assets/css/module/talent.less +0 -495
  175. package/assets/js/a.js +0 -46
  176. package/assets/js/code.js +0 -13
  177. package/assets/js/combo.js +0 -40
  178. package/assets/js/directory.js +0 -114
  179. package/assets/js/filter2.js +0 -186
  180. package/assets/js/fold.js +0 -11
  181. package/assets/js/gallery.js +0 -14
  182. package/assets/js/hljs_languages.js +0 -177
  183. package/assets/js/iframe.js +0 -38
  184. package/assets/js/img.js +0 -23
  185. package/assets/js/item/attribute_percent.js +0 -88
  186. package/assets/js/item/bind.js +0 -18
  187. package/assets/js/item/border.js +0 -19
  188. package/assets/js/item/border_quest.js +0 -12
  189. package/assets/js/item/color.js +0 -25
  190. package/assets/js/item/hljs_languages.js +0 -177
  191. package/assets/js/item/icon_url.js +0 -15
  192. package/assets/js/item/second_format.js +0 -19
  193. package/assets/js/jx3_element.js +0 -73
  194. package/assets/js/katex.js +0 -181
  195. package/assets/js/macro.js +0 -16
  196. package/assets/js/nextpage.js +0 -4
  197. package/assets/js/pswp.js +0 -67
  198. package/assets/js/pswp_template.js +0 -66
  199. package/assets/js/pz_iframe.js +0 -30
  200. package/assets/js/qixue.js +0 -28
  201. package/assets/js/renderImgPreview.js +0 -18
  202. package/assets/js/script.js +0 -6
  203. package/assets/js/stat.js +0 -107
  204. package/assets/js/talent2.js +0 -21
  205. package/assets/js/tex-mml-chtml.js +0 -36310
  206. package/assets/js/voice.js +0 -238
  207. package/assets/js/xss.js +0 -130
  208. package/src/editor/Article.vue +0 -230
  209. package/src/editor/BoxResource.vue +0 -441
  210. package/src/editor/Resource.vue +0 -623
  211. package/src/editor/Tinymce.vue +0 -204
  212. package/src/editor/Upload.vue +0 -277
  213. package/src/editor/UploadAlum.vue +0 -176
  214. package/src/editor/UploadBanner.vue +0 -156
  215. package/src/editor/components/Author.vue +0 -322
  216. package/src/editor/components/Avatar.vue +0 -95
  217. package/src/editor/components/Buff.vue +0 -80
  218. package/src/editor/components/Combo.vue +0 -259
  219. package/src/editor/components/Equip.vue +0 -299
  220. package/src/editor/components/GameText.vue +0 -242
  221. package/src/editor/components/Item.vue +0 -325
  222. package/src/editor/components/ItemSimple.vue +0 -134
  223. package/src/editor/components/Medal.vue +0 -43
  224. package/src/editor/components/Npc.vue +0 -215
  225. package/src/editor/components/PostAuthor.vue +0 -102
  226. package/src/editor/components/Skill.vue +0 -71
@@ -19,129 +19,3 @@ export default {
19
19
  mounted:function(){},
20
20
  }
21
21
  </script>
22
-
23
- <style lang="less">
24
- .c-article-directory {
25
- h1,
26
- h2,
27
- h3,
28
- h4,
29
- h5,
30
- h6 {
31
- margin: 0;
32
- padding: 0;
33
- cursor: pointer;
34
- font-weight: normal;
35
- white-space: nowrap;
36
- word-wrap: normal;
37
- word-break: keep-all;
38
- text-overflow: ellipsis;
39
- overflow: hidden;
40
- letter-spacing: 0.2px;
41
- line-height: 20px;
42
- padding: 8px 0;
43
- &:hover {
44
- // font-weight: 600;
45
- color: #0366d6;
46
- }
47
- font-size: 12px;
48
- }
49
- a {
50
- color: @color;
51
- }
52
-
53
- h1,
54
- h2,
55
- h3,
56
- h4,
57
- h5,
58
- h6 {
59
- &::before {
60
- content: "\e78b";
61
-
62
- font-family: element-icons !important;
63
- speak: none;
64
- font-style: normal;
65
- font-weight: 400;
66
- font-variant: normal;
67
- text-transform: none;
68
- line-height: 1;
69
- vertical-align: baseline;
70
- display: inline-block;
71
- -webkit-font-smoothing: antialiased;
72
- margin-right: 5px;
73
- font-size: 16px;
74
- }
75
- }
76
-
77
- // .hasChild {
78
- // font-size: 14px;
79
- // &::before {
80
- // content: "\e784";
81
- // }
82
- // }
83
-
84
- // h2,h3,h4,h5,h6{
85
- // margin-left: 20px;
86
- // }
87
- // .hasChild{
88
- // margin-left: 0;
89
- // }
90
-
91
- // h3 + h2,h4 + h3,h5 + h4,h6 + h5{
92
- // margin-left: 0;
93
- // }
94
-
95
- .lv2 {
96
- padding-left: 20px;
97
- }
98
-
99
- .lv3 {
100
- padding-left: 40px;
101
- }
102
-
103
- .lv0 {
104
- display: none;
105
- }
106
- }
107
-
108
- .c-article-directory-title {
109
- margin-bottom: 5px;
110
- .c-article-directory-title-label {
111
- font-weight: 300;
112
- font-size: 20px;
113
- // cursor: pointer;
114
- // &:hover {
115
- // color: #f39;
116
- // }
117
- }
118
- .c-article-directory-title-skip,
119
- .c-article-directory-title-folder {
120
- font-size: 14px;
121
- float: right;
122
- padding: 0 5px;
123
- line-height: 25px;
124
- color: darken(#dcdfe6, 5%);
125
- cursor: pointer;
126
- &:hover {
127
- color: darken(#dcdfe6, 20%);
128
- }
129
- }
130
- }
131
- .c-article-directory-content {
132
- padding: 10px 15px;
133
- }
134
-
135
- @keyframes focusFade {
136
- from {
137
- background-color: #c3fcff;
138
- }
139
- to {
140
- background-color: transparent;
141
- }
142
- }
143
-
144
- .c-article .isScrollFocus {
145
- animation: focusFade 0.5s ease-in-out;
146
- }
147
- </style>
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <div class="w-post-guide" v-if="hasGuide">
3
+ <div class="u-prev">
4
+ <a :href="getPostLink(post?.prev_post)" class="el-button el-button--default el-button--small is-plain" :class="{'is-disabled': !post?.prev_post }">
5
+ <el-icon><ArrowLeft></ArrowLeft></el-icon>
6
+ <span>上一篇</span>
7
+ </a>
8
+ <a :href="getPostLink(post?.prev_post)" class="u-post-title">{{ getPostTitle(post?.prev_post) }}</a>
9
+ </div>
10
+ <div class="u-next">
11
+ <a :href="getPostLink(post?.next_post)" class="el-button el-button--default el-button--small is-plain" :class="{'is-disabled': !post.next_post }">
12
+ <span>下一篇</span>
13
+ <el-icon><ArrowRight></ArrowRight></el-icon>
14
+ </a>
15
+ <a :href="getPostLink(post?.next_post)" class="u-post-title">{{ getPostTitle(post?.next_post) }}</a>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import { getLink } from '@jx3box/jx3box-common/js/utils';
22
+ export default {
23
+ name: "PostGuide",
24
+ props: {
25
+ post: {
26
+ type: Object,
27
+ default: () => ({}),
28
+ },
29
+ },
30
+ computed: {
31
+ hasGuide() {
32
+ const isPrevValid = this.post.prev_post && typeof this.post.prev_post === "object";
33
+ const isNextValid = this.post.next_post && typeof this.post.next_post === "object";
34
+ return isPrevValid || isNextValid;
35
+ }
36
+ },
37
+ methods: {
38
+ getPostLink({ ID: id, post_type }) {
39
+ const link = id ? getLink(post_type, id) : "javascript:;";
40
+ return link;
41
+ },
42
+ getPostTitle(item) {
43
+ return item?.post_title || "";
44
+ }
45
+ },
46
+ };
47
+ </script>
48
+
49
+ <style lang="less">
50
+ .w-post-guide {
51
+ .flex;
52
+ align-items: center;
53
+ justify-content: space-between;
54
+
55
+ .u-post-title {
56
+ margin-left: 10px;
57
+ font-size: 14px;
58
+ // color: #666;
59
+
60
+ &:hover {
61
+ // color: #0366d6;
62
+ // box-shadow: 0 1px 0 #0366d6;
63
+ .underline(var(--el-color-primary));
64
+ color:var(--el-color-primary);
65
+ }
66
+ }
67
+ }
68
+
69
+ @media screen and (max-width: @phone) {
70
+ .w-post-guide {
71
+ flex-wrap: wrap;
72
+
73
+ .u-prev,.u-next {
74
+ width: 100%;
75
+ .nobreak;
76
+ }
77
+
78
+ .u-prev {
79
+ margin-bottom: 10px;
80
+ span{
81
+ margin-left:5px;
82
+ }
83
+ }
84
+
85
+ .u-next {
86
+ margin-left: 0;
87
+ span{
88
+ margin-right:5px;
89
+ }
90
+ }
91
+ }
92
+ }
93
+ </style>
@@ -3,7 +3,7 @@
3
3
  <!-- 标题 -->
4
4
  <div class="m-single-title">
5
5
  <span class="u-title u-sub-block" :href="url" :title="title">
6
- <i class="u-original" v-if="isOriginal">原创</i>
6
+ <i class="u-original" v-if="isOriginal">{{ $jx3boxT("jx3boxUi.postHeader.original", "原创") }}</i>
7
7
  <i class="u-private" v-if="post.post_status != 'publish' || !!~~post.visible">
8
8
  <el-icon
9
9
  v-if="post.post_status == 'draft' || post.post_status == 'pending' || !!~~post.visible"
@@ -16,7 +16,7 @@
16
16
  <template v-if="titleExtra">
17
17
  <span class="u-client" :class="'i-client-' + client">{{ showClientLabel(client) }}</span>
18
18
  <span class="u-client u-zlp" v-if="zlp">{{ zlp }}</span>
19
- <span class="u-client i-client-wujie" v-if="is_wujie">无界</span>
19
+ <span class="u-client i-client-wujie" v-if="is_wujie">{{ $jx3boxT("jx3boxUi.postHeader.wujie", "无界") }}</span>
20
20
  </template>
21
21
  </span>
22
22
  </div>
@@ -29,7 +29,7 @@
29
29
  <img svg-inline src="../../assets/img/single/author.svg" />
30
30
  </i>
31
31
  <a class="u-name" :href="author_link" v-if="!anonymous">{{ author_name }}</a>
32
- <span class="u-name u-anonymous" v-else>神秘侠士</span>
32
+ <span class="u-name u-anonymous" v-else>{{ $jx3boxT("jx3boxUi.postHeader.mysterious", "神秘侠士") }}</span>
33
33
  </div>
34
34
 
35
35
  <!-- 自定义字段 -->
@@ -43,13 +43,16 @@
43
43
 
44
44
  <!-- 客户端 -->
45
45
  <div class="u-meta u-sub-block">
46
- <em class="u-label">适用客户端</em>
46
+ <em class="u-label">{{ $jx3boxT("jx3boxUi.postHeader.client", "适用客户端") }}</em>
47
47
  <span class="u-value u-client" :class="client">{{ showClientLabel(client) }}</span>
48
- <span class="u-value u-client wujie" v-if="is_wujie">无界</span>
48
+ <span class="u-value u-client wujie" v-if="is_wujie">{{ $jx3boxT("jx3boxUi.postHeader.wujie", "无界") }}</span>
49
49
  </div>
50
50
 
51
51
  <!-- 发布日期 -->
52
- <span class="u-podate u-sub-block" :title="'发布日期:' + post_time">
52
+ <span
53
+ class="u-podate u-sub-block"
54
+ :title="$jx3boxT('jx3boxUi.postHeader.publishDateTitle', '发布日期:{time}', { time: post_time })"
55
+ >
53
56
  <i class="u-icon-podate">
54
57
  <img svg-inline src="../../assets/img/single/podate.svg" />
55
58
  </i>
@@ -57,7 +60,10 @@
57
60
  </span>
58
61
 
59
62
  <!-- 最后更新 -->
60
- <span class="u-modate u-sub-block" :title="'最后更新:' + update_time">
63
+ <span
64
+ class="u-modate u-sub-block"
65
+ :title="$jx3boxT('jx3boxUi.postHeader.updateDateTitle', '最后更新:{time}', { time: update_time })"
66
+ >
61
67
  <i class="u-icon-modate">
62
68
  <img svg-inline src="../../assets/img/single/modate.svg" />
63
69
  </i>
@@ -70,7 +76,11 @@
70
76
  {{ views }}
71
77
  </span>
72
78
 
73
- <span class="u-word-count u-sub-block" v-if="wordCount" title="累计字数">
79
+ <span
80
+ class="u-word-count u-sub-block"
81
+ v-if="wordCount"
82
+ :title="$jx3boxT('jx3boxUi.postHeader.wordCount', '累计字数')"
83
+ >
74
84
  <el-icon :size="15"><Sunny /></el-icon>
75
85
  {{ wordCount }}
76
86
  </span>
@@ -78,7 +88,7 @@
78
88
  <!-- 编辑 -->
79
89
  <a class="u-edit u-sub-block" :href="edit_link" v-if="canEdit && !anonymous">
80
90
  <el-icon class="u-icon-edit" :size="16"><Edit /></el-icon>
81
- <span>编辑</span>
91
+ <span>{{ $jx3boxT("jx3boxUi.postHeader.edit", "编辑") }}</span>
82
92
  </a>
83
93
  </div>
84
94
  </header>
@@ -90,10 +100,12 @@ import { showDate, showTime } from "@jx3box/jx3box-common/js/moment";
90
100
  import { editLink, authorLink } from "@jx3box/jx3box-common/js/utils.js";
91
101
  import User from "@jx3box/jx3box-common/js/user.js";
92
102
  import $ from "jquery";
103
+ import i18nMixin from "../../i18n/mixin";
93
104
  const { __clients } = JX3BOX;
94
105
 
95
106
  export default {
96
107
  name: "PostHeader",
108
+ mixins: [i18nMixin],
97
109
  props: {
98
110
  post: {
99
111
  type: Object,
@@ -125,13 +137,13 @@ export default {
125
137
  return !!~~this.post?.original;
126
138
  },
127
139
  title: function () {
128
- return this.post?.post_title || "无标题";
140
+ return this.post?.post_title || this.$jx3boxT("jx3boxUi.postHeader.noTitle", "无标题");
129
141
  },
130
142
  author_link: function () {
131
143
  return authorLink(this.post?.post_author);
132
144
  },
133
145
  author_name: function () {
134
- return this.post?.author_info?.display_name || "匿名";
146
+ return this.post?.author_info?.display_name || this.$jx3boxT("jx3boxUi.postHeader.anonymous", "匿名");
135
147
  },
136
148
  post_date: function () {
137
149
  return showDate(new Date(this.post?.post_date));
@@ -218,8 +230,8 @@ export default {
218
230
  // padding-right: 280px;
219
231
  .pr;
220
232
  .u-sub-block {
221
- .dbi;
222
- .y(top);
233
+ .flex;
234
+ align-items: center;
223
235
  }
224
236
  }
225
237
  @media screen and (max-width: @phone) {
@@ -244,7 +256,7 @@ export default {
244
256
  // }
245
257
  letter-spacing: 0.5px;
246
258
  font-weight: 300;
247
- .db;
259
+ // .db;
248
260
  .nobreak;
249
261
  }
250
262
  .u-author {
@@ -263,9 +275,11 @@ export default {
263
275
  }
264
276
 
265
277
  .u-private {
266
- .y(-4px);
278
+ // .y(-4px);
267
279
  margin-right: 5px;
268
280
  color: #111;
281
+ top:2px;
282
+ .pr;
269
283
  }
270
284
  }
271
285
  @media screen and (max-width: @phone) {
@@ -285,15 +299,20 @@ export default {
285
299
  }
286
300
 
287
301
  .m-single-info {
302
+
303
+
288
304
  margin-top: 10px;
289
305
  .clearfix;
290
306
  .fz(12px, 20px);
291
307
  color: #666;
308
+ .flex;
309
+ align-items: center;
292
310
 
293
311
  @origin: #0eb7ce;
294
312
  @std: #f0b400;
295
313
  @all: #a26ef7;
296
314
  @wujie: #fc79bf;
315
+ --el-color-primary: @primary;
297
316
 
298
317
  .u-client {
299
318
  // .fl;
@@ -343,8 +362,11 @@ export default {
343
362
  }
344
363
 
345
364
  .u-author {
365
+ a {
366
+ color: var(--el-color-primary);
367
+ }
346
368
  a:hover {
347
- box-shadow: 0 1px 0 @color-link;
369
+ .underline(var(--el-color-primary));
348
370
  }
349
371
  i {
350
372
  .pr;
@@ -373,9 +395,9 @@ export default {
373
395
  font-size: 16px;
374
396
  }
375
397
  .pr;
376
- top: 4px;
377
398
  .mr(1px);
378
399
  }
400
+ color: var(--el-color-primary);
379
401
  &:hover {
380
402
  box-shadow: 0 1px 0 @color-link;
381
403
  }
@@ -80,14 +80,14 @@ export default {
80
80
  }
81
81
  </script>
82
82
 
83
- <style lang="less" scoped>
83
+ <style lang="less">
84
84
  .c-post-topic {
85
- margin-bottom: 10px;
85
+ margin-bottom: 20px;
86
86
  }
87
87
  .c-post-topic__banner {
88
88
  position: relative;
89
89
  margin-bottom: 10px;
90
- padding: 10px 10px 0 10px;
90
+ //padding: 10px 10px 0 10px;
91
91
  .c-topic-text {
92
92
  font-size: 12px;
93
93
  font-weight: 700;
@@ -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>