@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.
Files changed (241) hide show
  1. package/.storybook/preview.js +22 -13
  2. package/.storybook/storybookMocks.js +214 -0
  3. package/README.md +39 -43
  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/interact/qrcode.less +69 -0
  10. package/assets/css/single/author.less +15 -10
  11. package/assets/css/single/cms-single.less +1 -0
  12. package/assets/css/single/thx.less +34 -11
  13. package/assets/css/wiki/wiki-comments.less +176 -0
  14. package/assets/css/wiki/wiki-panel.less +177 -0
  15. package/assets/css/wiki/wiki-revisions.less +62 -0
  16. package/assets/data/nav.json +344 -10
  17. package/assets/img/comment/comment.svg +1 -1
  18. package/assets/img/comment/heart_1.svg +1 -1
  19. package/assets/img/comment/hide.svg +1 -1
  20. package/assets/img/leftsidebar/medal.svg +1 -1
  21. package/assets/img/leftsidebar/post.svg +27 -46
  22. package/i18n/messages/en-US.js +357 -22
  23. package/i18n/messages/vi.js +350 -22
  24. package/i18n/messages/zh-CN.js +469 -20
  25. package/i18n/messages/zh-TW.js +350 -22
  26. package/index.js +19 -7
  27. package/package.json +8 -5
  28. package/service/cms.js +22 -0
  29. package/service/commit-history.js +18 -0
  30. package/service/community.js +60 -0
  31. package/service/fav.js +5 -6
  32. package/src/App.vue +210 -80
  33. package/src/Breadcrumb.vue +24 -11
  34. package/src/CommonFooter.vue +2 -2
  35. package/src/Footer.vue +13 -5
  36. package/src/LeftSideToggle.vue +10 -3
  37. package/src/LeftSidebar.vue +19 -5
  38. package/src/Main.vue +9 -2
  39. package/src/RightSidebar.vue +12 -3
  40. package/src/SuspendCommon.vue +52 -38
  41. package/src/author/AuthorFans.vue +7 -5
  42. package/src/author/AuthorFollow.vue +14 -7
  43. package/src/author/AuthorGift.vue +25 -17
  44. package/src/author/AuthorInfo.vue +46 -19
  45. package/src/author/AuthorLink.vue +3 -1
  46. package/src/author/AuthorMedals.vue +5 -2
  47. package/src/author/AuthorPosts.vue +31 -13
  48. package/src/author/AuthorRss.vue +7 -3
  49. package/src/author/AuthorTeams.vue +3 -1
  50. package/src/author/UserPop.vue +29 -17
  51. package/src/bread/Admin.vue +55 -32
  52. package/src/bread/AdminDirectMessage.vue +15 -8
  53. package/src/bread/AdminDrop.vue +124 -45
  54. package/src/bread/CommunityAdmin.vue +527 -0
  55. package/src/bread/DesignTask.vue +30 -26
  56. package/src/bread/ListAdmin.vue +199 -0
  57. package/src/bread/MigrateCommunity.vue +192 -0
  58. package/src/bread/MoveToCommunityDialog.vue +234 -0
  59. package/src/comment/Avatar.vue +18 -24
  60. package/src/comment/CommentContent.vue +57 -37
  61. package/src/comment/CommentContentSimple.vue +61 -63
  62. package/src/comment/CommentInputForm.vue +45 -34
  63. package/src/comment/CommentWithReply.vue +9 -6
  64. package/src/comment/QuickReply.vue +5 -1
  65. package/src/comment/ReplyForReply.vue +6 -4
  66. package/src/comment/ReplyList.vue +28 -18
  67. package/src/comment/Upload.vue +24 -6
  68. package/src/filters/clientBy.vue +10 -8
  69. package/src/filters/markBy.vue +35 -31
  70. package/src/filters/menuBy.vue +20 -22
  71. package/src/filters/orderBy.vue +17 -11
  72. package/src/filters/tagBy.vue +4 -2
  73. package/src/filters/topicBy.vue +12 -10
  74. package/src/filters/versionBy.vue +5 -3
  75. package/src/filters/zlpBy.vue +29 -25
  76. package/src/footer/copyright.vue +5 -5
  77. package/src/footer/links.vue +2 -2
  78. package/src/footer/official.vue +1 -1
  79. package/src/footer/resource.vue +6 -6
  80. package/src/header/alternate.vue +35 -18
  81. package/src/header/asset.vue +9 -19
  82. package/src/header/box.vue +20 -8
  83. package/src/header/box2.vue +16 -9
  84. package/src/header/client.vue +7 -7
  85. package/src/header/lang.vue +41 -6
  86. package/src/header/logo.vue +2 -3
  87. package/src/header/manage.vue +2 -2
  88. package/src/header/message.vue +3 -3
  89. package/src/header/nav.vue +26 -23
  90. package/src/header/publish.vue +2 -2
  91. package/src/header/search.vue +2 -2
  92. package/src/header/shop.vue +2 -2
  93. package/src/header/user.vue +4 -4
  94. package/src/header/userInfo.vue +22 -24
  95. package/src/header/vip.vue +2 -2
  96. package/src/interact/BoxcoinAdmin.vue +30 -16
  97. package/src/interact/BoxcoinRecords.vue +28 -11
  98. package/src/interact/BoxcoinUser.vue +33 -17
  99. package/src/interact/Fav.vue +5 -1
  100. package/src/interact/Homework.vue +317 -0
  101. package/src/interact/Like.vue +4 -2
  102. package/src/interact/QRcode.vue +104 -0
  103. package/src/interact/Rss.vue +10 -4
  104. package/src/interact/Share.vue +18 -19
  105. package/src/interact/WatchLater.vue +5 -1
  106. package/src/main.js +1 -0
  107. package/src/single/Author.vue +5 -1
  108. package/src/single/CmsSingle.vue +29 -15
  109. package/src/single/Collection.vue +36 -26
  110. package/src/single/Comment.vue +19 -13
  111. package/src/single/Creators.vue +5 -3
  112. package/src/single/PostCollection.vue +158 -0
  113. package/src/single/PostDirectory.vue +0 -126
  114. package/src/single/PostGuide.vue +93 -0
  115. package/src/single/PostHeader.vue +39 -17
  116. package/src/single/PostTopic.vue +3 -3
  117. package/src/single/PostVersion.vue +219 -0
  118. package/src/single/RightAffix.vue +160 -0
  119. package/src/single/SimpleThx.vue +4 -2
  120. package/src/single/Thx.vue +14 -2
  121. package/src/single/VersionDialog.vue +238 -0
  122. package/src/stories/components/StoryPropsTable.vue +137 -0
  123. package/src/stories/filters/FilterGallery.stories.js +110 -0
  124. package/src/stories/filters/clientBy.stories.js +24 -0
  125. package/src/stories/filters/markBy.stories.js +6 -0
  126. package/src/stories/filters/menuBy.stories.js +6 -0
  127. package/src/stories/filters/orderBy.stories.js +6 -0
  128. package/src/stories/filters/tagBy.stories.js +6 -0
  129. package/src/stories/filters/topicBy.stories.js +6 -0
  130. package/src/stories/filters/versionBy.stories.js +6 -0
  131. package/src/stories/filters/zlpBy.stories.js +6 -0
  132. package/src/stories/interact/QRcode.stories.js +59 -0
  133. package/src/stories/layout/BaseShell.stories.js +38 -0
  134. package/src/stories/layout/Breadcrumb.stories.js +40 -0
  135. package/src/stories/layout/CommonFooter.stories.js +1 -1
  136. package/src/stories/layout/CommonHeader.stories.js +1 -1
  137. package/src/stories/layout/LeftSideToggle.stories.js +78 -0
  138. package/src/stories/layout/LeftSidebar.stories.js +40 -0
  139. package/src/stories/layout/Main.stories.js +41 -0
  140. package/src/stories/layout/RightSidebar.stories.js +36 -0
  141. package/src/stories/layout/StorybookShell.vue +271 -0
  142. package/src/stories/layout/SuspendCommon.stories.js +67 -0
  143. package/src/stories/layout/SuspendCommonStage.vue +143 -0
  144. package/src/stories/mockData.js +369 -0
  145. package/src/stories/other/UserPop.stories.js +51 -0
  146. package/src/stories/single/Author.stories.js +19 -0
  147. package/src/stories/single/AuthorStoryStage.vue +103 -0
  148. package/src/stories/single/CmsSingle.stories.js +19 -0
  149. package/src/stories/single/CmsSingleStoryStage.vue +118 -0
  150. package/src/stories/single/Collection.stories.js +34 -0
  151. package/src/stories/single/Comment.stories.js +36 -0
  152. package/src/stories/single/Creators.stories.js +34 -0
  153. package/src/stories/single/PostCollection.stories.js +34 -0
  154. package/src/stories/single/PostDirectory.stories.js +31 -0
  155. package/src/stories/single/PostGuide.stories.js +47 -0
  156. package/src/stories/single/PostHeader.stories.js +39 -0
  157. package/src/stories/single/PostVersion.stories.js +41 -0
  158. package/src/stories/single/RightAffix.stories.js +84 -0
  159. package/src/stories/single/SimpleThx.stories.js +39 -0
  160. package/src/stories/single/SingleGallery.stories.js +207 -0
  161. package/src/stories/single/Thx.stories.js +38 -0
  162. package/src/stories/wiki/GamePrice.stories.js +64 -0
  163. package/src/stories/wiki/WikiComments.stories.js +58 -0
  164. package/src/stories/wiki/WikiPanel.stories.js +69 -0
  165. package/src/stories/wiki/WikiRevisions.stories.js +47 -0
  166. package/src/wiki/GamePrice.vue +107 -0
  167. package/src/wiki/WikiComment.vue +153 -0
  168. package/src/wiki/WikiComments.vue +206 -0
  169. package/src/wiki/WikiPanel.vue +121 -0
  170. package/src/wiki/WikiRevisions.vue +125 -0
  171. package/vue.config.js +2 -12
  172. package/assets/css/common/bottom.less +0 -25
  173. package/assets/css/editor/article.less +0 -36
  174. package/assets/css/editor/combo.less +0 -362
  175. package/assets/css/editor/resource.less +0 -399
  176. package/assets/css/editor/tinymce.less +0 -100
  177. package/assets/css/editor/upload.less +0 -136
  178. package/assets/css/module/author.less +0 -231
  179. package/assets/css/module/buff.less +0 -88
  180. package/assets/css/module/directory.less +0 -165
  181. package/assets/css/module/icon.less +0 -25
  182. package/assets/css/module/item.less +0 -279
  183. package/assets/css/module/item_simple.less +0 -58
  184. package/assets/css/module/jx3_element.less +0 -5
  185. package/assets/css/module/macro.less +0 -89
  186. package/assets/css/module/npc.less +0 -265
  187. package/assets/css/module/resource.less +0 -93
  188. package/assets/css/module/skill.less +0 -74
  189. package/assets/css/module/talent.less +0 -495
  190. package/assets/js/a.js +0 -46
  191. package/assets/js/code.js +0 -13
  192. package/assets/js/combo.js +0 -40
  193. package/assets/js/directory.js +0 -114
  194. package/assets/js/filter2.js +0 -186
  195. package/assets/js/fold.js +0 -11
  196. package/assets/js/gallery.js +0 -14
  197. package/assets/js/hljs_languages.js +0 -177
  198. package/assets/js/iframe.js +0 -38
  199. package/assets/js/img.js +0 -23
  200. package/assets/js/item/attribute_percent.js +0 -88
  201. package/assets/js/item/bind.js +0 -18
  202. package/assets/js/item/border.js +0 -19
  203. package/assets/js/item/border_quest.js +0 -12
  204. package/assets/js/item/color.js +0 -25
  205. package/assets/js/item/hljs_languages.js +0 -177
  206. package/assets/js/item/icon_url.js +0 -15
  207. package/assets/js/item/second_format.js +0 -19
  208. package/assets/js/jx3_element.js +0 -73
  209. package/assets/js/katex.js +0 -181
  210. package/assets/js/macro.js +0 -16
  211. package/assets/js/nextpage.js +0 -4
  212. package/assets/js/pswp.js +0 -67
  213. package/assets/js/pswp_template.js +0 -66
  214. package/assets/js/pz_iframe.js +0 -30
  215. package/assets/js/qixue.js +0 -28
  216. package/assets/js/renderImgPreview.js +0 -18
  217. package/assets/js/script.js +0 -6
  218. package/assets/js/stat.js +0 -107
  219. package/assets/js/talent2.js +0 -21
  220. package/assets/js/tex-mml-chtml.js +0 -36310
  221. package/assets/js/voice.js +0 -238
  222. package/assets/js/xss.js +0 -130
  223. package/src/editor/Article.vue +0 -230
  224. package/src/editor/BoxResource.vue +0 -441
  225. package/src/editor/Resource.vue +0 -623
  226. package/src/editor/Tinymce.vue +0 -204
  227. package/src/editor/Upload.vue +0 -277
  228. package/src/editor/UploadAlum.vue +0 -176
  229. package/src/editor/UploadBanner.vue +0 -156
  230. package/src/editor/components/Author.vue +0 -322
  231. package/src/editor/components/Avatar.vue +0 -95
  232. package/src/editor/components/Buff.vue +0 -80
  233. package/src/editor/components/Combo.vue +0 -259
  234. package/src/editor/components/Equip.vue +0 -299
  235. package/src/editor/components/GameText.vue +0 -242
  236. package/src/editor/components/Item.vue +0 -325
  237. package/src/editor/components/ItemSimple.vue +0 -134
  238. package/src/editor/components/Medal.vue +0 -43
  239. package/src/editor/components/Npc.vue +0 -215
  240. package/src/editor/components/PostAuthor.vue +0 -102
  241. package/src/editor/components/Skill.vue +0 -71
@@ -17,59 +17,54 @@
17
17
  <div class="u-toolbar u-toolbar--primary">
18
18
  <div class="u-toolbar-left">
19
19
  <el-button
20
- class="u-admin"
21
20
  v-if="!currentUserHadLike"
22
21
  link
23
22
  size="small"
24
23
  @click="doLike(true)"
25
24
  ><img
26
- class="u-up"
25
+ class="u-up" svg-inline
27
26
  src="../../assets/img/comment/heart_1.svg"
28
27
  alt=""
29
- />点赞<span class="u-like-count">{{ likesFormat(hasLikeCount) }}</span></el-button
28
+ />{{ $jx3boxT("jx3boxUi.commentContent.like", "点赞") }}<span class="u-like-count">{{ likesFormat(hasLikeCount) }}</span></el-button
30
29
  >
31
30
  <el-button
32
- class="u-admin"
33
31
  link
34
32
  size="small"
35
33
  v-if="currentUserHadLike"
36
34
  @click="doLike(false)"
37
35
  ><img
38
- class="u-up"
36
+ class="u-up" svg-inline
39
37
  src="../../assets/img/comment/heart_2.svg"
40
38
  alt=""
41
- />已赞<span class="u-like-count">{{
39
+ />{{ $jx3boxT("jx3boxUi.commentContent.liked", "已赞") }}<span class="u-like-count">{{
42
40
  likesFormat(hasLikeCount)
43
41
  }}</span></el-button
44
42
  >
45
43
  <el-button
46
- class="u-admin"
47
44
  link
48
45
  size="small"
49
46
  icon="ChatRound"
50
47
  @click="showForm = !showForm"
51
48
  type="primary"
52
- >回复</el-button
49
+ >{{ $jx3boxT("jx3boxUi.commentContent.reply", "回复") }}</el-button
53
50
  >
54
51
  <el-button
55
- class="u-admin"
56
52
  v-if="canDelete"
57
53
  link
58
54
  icon="Delete"
59
55
  size="small"
60
56
  @click="deleteComment()"
61
57
  type="danger"
62
- >删除</el-button
58
+ >{{ $jx3boxT("jx3boxUi.commentContent.delete", "删除") }}</el-button
63
59
  >
64
60
  <el-button
65
- class="u-admin"
66
61
  link
67
62
  size="small"
68
63
  icon="Delete"
69
64
  v-if="canHide"
70
65
  @click="hideComment()"
71
- title="拉入黑洞后,仅评论者自己独自可见"
72
- >黑洞</el-button
66
+ :title="$jx3boxT('jx3boxUi.commentContent.hideTip', '拉入黑洞后,仅评论者自己独自可见')"
67
+ >{{ $jx3boxT("jx3boxUi.commentContent.hide", "黑洞") }}</el-button
73
68
  >
74
69
  <el-button
75
70
  class="u-admin"
@@ -79,7 +74,7 @@
79
74
  size="small"
80
75
  @click="topComment(true)"
81
76
  type="primary"
82
- >置顶</el-button
77
+ >{{ $jx3boxT("jx3boxUi.commentContent.top", "置顶") }}</el-button
83
78
  >
84
79
  <el-button
85
80
  class="u-admin"
@@ -89,7 +84,7 @@
89
84
  size="small"
90
85
  @click="topComment(false)"
91
86
  type="primary"
92
- >取消置顶</el-button
87
+ >{{ $jx3boxT("jx3boxUi.commentContent.cancelTop", "取消置顶") }}</el-button
93
88
  >
94
89
  <el-button
95
90
  class="u-admin"
@@ -99,7 +94,7 @@
99
94
  size="small"
100
95
  @click="starComment(true)"
101
96
  type="primary"
102
- >加精</el-button
97
+ >{{ $jx3boxT("jx3boxUi.commentContent.star", "加精") }}</el-button
103
98
  >
104
99
  <el-button
105
100
  class="u-admin"
@@ -109,7 +104,7 @@
109
104
  size="small"
110
105
  @click="starComment(false)"
111
106
  type="primary"
112
- >取消加精</el-button
107
+ >{{ $jx3boxT("jx3boxUi.commentContent.cancelStar", "取消加精") }}</el-button
113
108
  >
114
109
  <time class="u-date">
115
110
  <i class="Clock"></i>
@@ -127,9 +122,9 @@
127
122
  <img
128
123
  class="u-icon-filter"
129
124
  src="../../assets/img/editor/view.svg"
130
- alt="显示"
125
+ :alt="$jx3boxT('jx3boxUi.commentContent.show', '显示')"
131
126
  />
132
- 显示</el-button
127
+ {{ $jx3boxT("jx3boxUi.commentContent.show", "显示") }}</el-button
133
128
  >
134
129
  <el-button
135
130
  class="u-admin u-filter"
@@ -140,8 +135,8 @@
140
135
  ><img
141
136
  class="u-icon-filter"
142
137
  src="../../assets/img/comment/hide.svg"
143
- alt="隐藏"
144
- />隐藏</el-button
138
+ :alt="$jx3boxT('jx3boxUi.commentContent.hidden', '隐藏')"
139
+ />{{ $jx3boxT("jx3boxUi.commentContent.hidden", "隐藏") }}</el-button
145
140
  >
146
141
  </div>
147
142
  </div>
@@ -155,7 +150,7 @@
155
150
  <el-input
156
151
  type="textarea"
157
152
  v-model="newComment.content"
158
- placeholder="参与评论..."
153
+ :placeholder="$jx3boxT('jx3boxUi.commentContent.placeholder', '参与评论...')"
159
154
  :id="'id' + inputId"
160
155
  ></el-input>
161
156
  </el-form-item>
@@ -182,10 +177,10 @@
182
177
  type="primary"
183
178
  @click="submit()"
184
179
  :disabled="disableSubmitBtn"
185
- >提交</el-button
180
+ >{{ $jx3boxT("jx3boxUi.commentContent.submit", "提交") }}</el-button
186
181
  >
187
182
  <el-button size="small" link @click="showForm = false" type="primary"
188
- >收起</el-button
183
+ >{{ $jx3boxT("jx3boxUi.commentContent.collapse", "收起") }}</el-button
189
184
  >
190
185
  </el-form-item>
191
186
  </el-form>
@@ -198,11 +193,13 @@ import * as utilModule from "@jx3box/jx3box-common/js/utils";
198
193
  const { resolveImagePath } = utilModule;
199
194
  import { formatContent } from "../../utils/emotion";
200
195
  import Emotion from "@jx3box/jx3box-emotion/src/Emotion2.vue";
196
+ import i18nMixin from "../../i18n/mixin";
201
197
 
202
198
  function fillZero(num) {
203
199
  return num > 9 ? num : `0${num}`;
204
200
  }
205
201
  export default {
202
+ mixins: [i18nMixin],
206
203
  props: {
207
204
  content: {
208
205
  type: String,
@@ -324,22 +321,30 @@ export default {
324
321
  this.$emit("setWhiteComment", white);
325
322
  },
326
323
  deleteComment() {
327
- this.$confirm("确定删除该评论吗?", "提示", {
328
- confirmButtonText: "确定",
329
- cancelButtonText: "取消",
330
- type: "warning",
331
- })
324
+ this.$confirm(
325
+ this.$jx3boxT("jx3boxUi.commentContent.confirmDelete", "确定删除该评论吗?"),
326
+ this.$jx3boxT("jx3boxUi.common.tip", "提示"),
327
+ {
328
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
329
+ cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
330
+ type: "warning",
331
+ }
332
+ )
332
333
  .then(() => {
333
334
  this.$emit("deleteComment");
334
335
  })
335
336
  .catch(() => {});
336
337
  },
337
338
  hideComment() {
338
- this.$confirm("确定隐藏该评论吗?", "提示", {
339
- confirmButtonText: "确定",
340
- cancelButtonText: "取消",
341
- type: "warning",
342
- })
339
+ this.$confirm(
340
+ this.$jx3boxT("jx3boxUi.commentContent.confirmHide", "确定隐藏该评论吗?"),
341
+ this.$jx3boxT("jx3boxUi.common.tip", "提示"),
342
+ {
343
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
344
+ cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
345
+ type: "warning",
346
+ }
347
+ )
343
348
  .then(() => {
344
349
  this.$emit("hide", this.commentId);
345
350
  })
@@ -426,10 +431,25 @@ export default {
426
431
 
427
432
  <style lang="less">
428
433
  .c-comment-cmt {
434
+
435
+ --el-color-primary:@primary;
436
+
429
437
  flex-grow: 1;
430
438
  position: relative;
431
439
  .u-toolbar {
432
440
  font-size: 12px;
441
+ margin-top:5px;
442
+ color:var(--el-color-primary);
443
+ .el-button.is-link {
444
+ color: var(--el-color-primary);
445
+ &:hover{
446
+ color:@pink;
447
+ }
448
+ }
449
+ // .el-button.is-link.u-admin{
450
+ // color:orange;
451
+ // }
452
+
433
453
 
434
454
  .el-button + .el-button {
435
455
  margin-left: 20px;
@@ -462,7 +482,7 @@ export default {
462
482
  }
463
483
  }
464
484
  .u-cmt {
465
- padding: 5px 0 10px 0;
485
+ padding: 10px 0;
466
486
  position: relative;
467
487
  .u-text {
468
488
  line-height: 1.715;
@@ -485,8 +505,8 @@ export default {
485
505
  width: 12px;
486
506
  height: 12px;
487
507
  position: relative;
488
- top: 1px;
489
- margin-right: 5px;
508
+ // top: 1px;
509
+ margin-right: 4px;
490
510
  }
491
511
  .u-like-count {
492
512
  margin-left: 3px;
@@ -2,14 +2,12 @@
2
2
  <div class="u-reply">
3
3
  <div class="u-reply-content">
4
4
  <span class="u-reply-label" v-if="replyForUserId != 0">
5
- 回复
6
- <el-link type="primary" target="_blank" :href="userHref"
7
- >@{{ replyForUsername }}</el-link
8
- >
5
+ {{ $jx3boxT("jx3boxUi.commentContentSimple.reply", "回复") }}
6
+ <el-link type="primary" target="_blank" :href="userHref">@{{ replyForUsername }}</el-link>
9
7
  :
10
8
  </span>
11
9
  <div class="u-reply-text" v-html="renderContent"></div>
12
- <!--<div class="u-reply-text" v-html="content"></div>-->
10
+ <!--<div class="u-reply-text" v-html="content"></div>-->
13
11
  <!-- <p v-for="(p, index) in getPList(content)" :key="index" v-html="formatContent(p)"></p> -->
14
12
  </div>
15
13
  <div class="u-attachements" v-if="attachments.length">
@@ -22,33 +20,15 @@
22
20
  ></el-image>
23
21
  </div>
24
22
  <div class="u-toolbar">
25
- <el-button
26
- class="u-admin"
27
- v-if="!currentUserHadLike"
28
- link
29
- size="small"
30
- @click="doLike(true)"
31
- ><img
32
- class="u-up"
33
- src="../../assets/img/comment/heart_1.svg"
34
- alt=""
35
- />点赞<span class="u-like-count">{{
36
- likesFormat(hasLikeCount)
37
- }}</span></el-button
23
+ <el-button class="u-admin" v-if="!currentUserHadLike" link size="small" @click="doLike(true)"
24
+ ><img class="u-up" svg-inline src="../../assets/img/comment/heart_1.svg" alt=""/>{{
25
+ $jx3boxT("jx3boxUi.commentContentSimple.like", "点赞")
26
+ }}<span class="u-like-count">{{ likesFormat(hasLikeCount) }}</span></el-button
38
27
  >
39
- <el-button
40
- class="u-admin"
41
- link
42
- size="small"
43
- v-if="currentUserHadLike"
44
- @click="doLike(false)"
45
- ><img
46
- class="u-up"
47
- src="../../assets/img/comment/heart_2.svg"
48
- alt=""
49
- />已赞<span class="u-like-count">{{
50
- likesFormat(hasLikeCount)
51
- }}</span></el-button
28
+ <el-button class="u-admin" link size="small" v-if="currentUserHadLike" @click="doLike(false)"
29
+ ><img class="u-up" svg-inline src="../../assets/img/comment/heart_2.svg" alt="" />{{
30
+ $jx3boxT("jx3boxUi.commentContentSimple.liked", "已赞")
31
+ }}<span class="u-like-count">{{ likesFormat(hasLikeCount) }}</span></el-button
52
32
  >
53
33
  <el-button
54
34
  class="u-admin"
@@ -58,7 +38,7 @@
58
38
  size="small"
59
39
  @click="showReplyForReplyInput"
60
40
  type="primary"
61
- >回复</el-button
41
+ >{{ $jx3boxT("jx3boxUi.commentContentSimple.reply", "回复") }}</el-button
62
42
  >
63
43
  <el-button
64
44
  class="u-admin"
@@ -68,7 +48,7 @@
68
48
  size="small"
69
49
  type="danger"
70
50
  @click="deleteComment"
71
- >删除</el-button
51
+ >{{ $jx3boxT("jx3boxUi.commentContentSimple.delete", "删除") }}</el-button
72
52
  >
73
53
  <el-button
74
54
  class="u-admin"
@@ -77,9 +57,9 @@
77
57
  icon="Delete"
78
58
  v-if="canHide"
79
59
  @click="hideComment"
80
- title="拉入黑洞后,仅评论者自己独自可见"
60
+ :title="$jx3boxT('jx3boxUi.commentContentSimple.hideTip', '拉入黑洞后,仅评论者自己独自可见')"
81
61
  >
82
- 黑洞</el-button
62
+ {{ $jx3boxT("jx3boxUi.commentContentSimple.hide", "黑洞") }}</el-button
83
63
  >
84
64
  <time class="u-date">
85
65
  <i class="Clock"></i>
@@ -92,10 +72,12 @@
92
72
  <script>
93
73
  import { resolveImagePath, authorLink } from "@jx3box/jx3box-common/js/utils";
94
74
  import { formatContent } from "../../utils/emotion";
75
+ import i18nMixin from "../../i18n/mixin";
95
76
  function fillZero(num) {
96
77
  return num > 9 ? num : `0${num}`;
97
78
  }
98
79
  export default {
80
+ mixins: [i18nMixin],
99
81
  props: {
100
82
  commentId: {
101
83
  type: [Number, String],
@@ -192,28 +174,34 @@ export default {
192
174
  return;
193
175
  }
194
176
  this.currentUserHadLike = setLike;
195
- this.hasLikeCount = setLike
196
- ? this.hasLikeCount + 1
197
- : this.hasLikeCount - 1;
177
+ this.hasLikeCount = setLike ? this.hasLikeCount + 1 : this.hasLikeCount - 1;
198
178
  this.$emit("setLikeComment", setLike);
199
179
  },
200
180
  deleteComment() {
201
- this.$confirm("确定删除该评论吗?", "提示", {
202
- confirmButtonText: "确定",
203
- cancelButtonText: "取消",
204
- type: "warning",
205
- })
181
+ this.$confirm(
182
+ this.$jx3boxT("jx3boxUi.commentContentSimple.confirmDelete", "确定删除该评论吗?"),
183
+ this.$jx3boxT("jx3boxUi.common.tip", "提示"),
184
+ {
185
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
186
+ cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
187
+ type: "warning",
188
+ }
189
+ )
206
190
  .then(() => {
207
191
  this.$emit("delete", this.commentId);
208
192
  })
209
193
  .catch(() => {});
210
194
  },
211
195
  hideComment() {
212
- this.$confirm("确定隐藏该评论吗?", "提示", {
213
- confirmButtonText: "确定",
214
- cancelButtonText: "取消",
215
- type: "warning",
216
- })
196
+ this.$confirm(
197
+ this.$jx3boxT("jx3boxUi.commentContentSimple.confirmHide", "确定隐藏该评论吗?"),
198
+ this.$jx3boxT("jx3boxUi.common.tip", "提示"),
199
+ {
200
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
201
+ cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
202
+ type: "warning",
203
+ }
204
+ )
217
205
  .then(() => {
218
206
  this.$emit("hide", this.commentId);
219
207
  })
@@ -258,22 +246,32 @@ export default {
258
246
  </script>
259
247
 
260
248
  <style lang="less">
261
- .u-reply-content {
262
- div,
263
- p {
264
- padding: 0;
265
- margin: 0;
266
- line-height: 1.75;
267
- font-size: 14px;
268
- img {
269
- vertical-align: -3px;
249
+ .c-comment-reply {
250
+ .u-reply-content {
251
+ div,
252
+ p {
253
+ padding: 0;
254
+ margin: 0;
255
+ line-height: 1.75;
256
+ font-size: 14px;
257
+ img {
258
+ vertical-align: -3px;
259
+ }
260
+ }
261
+ }
262
+ .u-reply-text {
263
+ white-space: pre-line;
264
+ }
265
+ .u-attachements {
266
+ margin-top: 10px;
267
+ }
268
+ .u-reply-label{
269
+ font-size: 13px;
270
+ margin-right: 5px;
271
+ .el-link {
272
+ font-size: 13px;
273
+ padding: 0;
270
274
  }
271
275
  }
272
- }
273
- .u-reply-text {
274
- white-space: pre-line;
275
- }
276
- .u-attachements {
277
- margin-top: 10px;
278
276
  }
279
277
  </style>
@@ -1,7 +1,11 @@
1
1
  <template>
2
2
  <el-form ref="form" :model="newComment" class="c-comment-box">
3
3
  <div class="u-mask">
4
- 参与评论,需先进行<a href="/dashboard/auth" target="_blank" class="u-link">账号认证</a>。
4
+ {{ $jx3boxT("jx3boxUi.commentInputForm.authMaskPrefix", "参与评论,需先进行")
5
+ }}<a href="/dashboard/auth" target="_blank" class="u-link">{{
6
+ $jx3boxT("jx3boxUi.commentInputForm.authLink", "账号认证")
7
+ }}</a
8
+ >{{ $jx3boxT("jx3boxUi.commentInputForm.authMaskSuffix", "。") }}
5
9
  </div>
6
10
  <el-form-item>
7
11
  <el-input
@@ -10,22 +14,29 @@
10
14
  maxlength="300"
11
15
  show-word-limit
12
16
  v-model="newComment.content"
13
- placeholder="参与讨论..."
17
+ :placeholder="$jx3boxT('jx3boxUi.commentInputForm.placeholder', '参与讨论...')"
14
18
  :id="inputId"
15
19
  ></el-input>
16
20
  <div class="c-comment-tools">
17
21
  <el-icon class="u-upload-icon" @click="showUploader = !showUploader"><Picture /></el-icon>
18
- <Emotion
19
- class="c-comment-emotion"
20
- @selected="handleEmotionSelected"
21
- type="pop"
22
- :max="6">
23
- </Emotion>
22
+ <Emotion class="c-comment-emotion" @selected="handleEmotionSelected" type="pop" :max="6"> </Emotion>
24
23
  <quickReply @reply="onQuickReply"></quickReply>
25
24
  <div class="c-comment-secret">
26
- <el-checkbox class="u-secret" v-model="is_secret" border size="small">悄悄话
27
- <el-tooltip class="item" effect="dark" content="勾选悄悄话后仅作者和你可见,并且不可再变更状态" placement="top">
28
- <el-icon><InfoFilled></InfoFilled></el-icon> </el-tooltip></el-checkbox>
25
+ <el-checkbox class="u-secret" v-model="is_secret" border size="small"
26
+ >{{ $jx3boxT("jx3boxUi.commentInputForm.secret", "悄悄话") }}
27
+ <el-tooltip
28
+ class="item"
29
+ effect="dark"
30
+ :content="
31
+ $jx3boxT(
32
+ 'jx3boxUi.commentInputForm.secretTip',
33
+ '勾选悄悄话后仅作者和你可见,并且不可再变更状态'
34
+ )
35
+ "
36
+ placement="top"
37
+ >
38
+ <el-icon><InfoFilled></InfoFilled></el-icon> </el-tooltip
39
+ ></el-checkbox>
29
40
  </div>
30
41
  </div>
31
42
  <Uploader
@@ -36,13 +47,9 @@
36
47
  v-if="showUploader"
37
48
  />
38
49
  <div class="u-toolbar">
39
- <el-button
40
- type="primary"
41
- @click="onSubmit"
42
- class="u-publish"
43
- :disabled="disableSubmitBtn"
44
- >发表评论</el-button
45
- >
50
+ <el-button type="primary" @click="onSubmit" class="u-publish" :disabled="disableSubmitBtn">{{
51
+ $jx3boxT("jx3boxUi.commentInputForm.publish", "发表评论")
52
+ }}</el-button>
46
53
  </div>
47
54
  </el-form-item>
48
55
  </el-form>
@@ -52,29 +59,31 @@
52
59
  import Uploader from "./Upload.vue";
53
60
  import Emotion from "@jx3box/jx3box-emotion/src/Emotion2.vue";
54
61
  import QuickReply from "./QuickReply.vue";
62
+ import i18nMixin from "../../i18n/mixin";
55
63
 
56
64
  export default {
65
+ mixins: [i18nMixin],
57
66
  components: {
58
67
  Uploader,
59
68
  Emotion,
60
- QuickReply
69
+ QuickReply,
61
70
  },
62
71
  props: {
63
72
  // 用于判定该评论组件是否在底部
64
73
  isBottom: {
65
74
  type: Boolean,
66
- default: false
67
- }
75
+ default: false,
76
+ },
68
77
  },
69
78
  mounted() {
70
79
  if (this.isBottom) this.inputId = "textarea-bottom";
71
80
  },
72
- data: function() {
81
+ data: function () {
73
82
  return {
74
83
  showUploader: false,
75
84
  disableSubmitBtn: false,
76
85
  newComment: {
77
- content: ""
86
+ content: "",
78
87
  },
79
88
  inputId: "textarea-top",
80
89
  is_secret: false,
@@ -100,10 +109,10 @@ export default {
100
109
  attachmentUploadFinish(data) {
101
110
  this.$emit("submit", {
102
111
  content: this.newComment.content,
103
- attachmentList: data
112
+ attachmentList: data,
104
113
  });
105
114
  this.newComment = {
106
- content: ""
115
+ content: "",
107
116
  };
108
117
  this.showUploader = false;
109
118
 
@@ -122,7 +131,7 @@ export default {
122
131
  */
123
132
  async insertVariable(emotionVal) {
124
133
  const myField = document.querySelector(`#${this.inputId}`);
125
- const value = emotionVal.key
134
+ const value = emotionVal.key;
126
135
  if (myField.selectionStart || myField.selectionStart === 0) {
127
136
  let startPos = myField.selectionStart;
128
137
  let endPos = myField.selectionEnd;
@@ -135,15 +144,12 @@ export default {
135
144
  await this.$nextTick();
136
145
 
137
146
  myField.focus();
138
- myField.setSelectionRange(
139
- endPos + value.length,
140
- endPos + value.length
141
- );
147
+ myField.setSelectionRange(endPos + value.length, endPos + value.length);
142
148
  } else {
143
149
  this.newComment.content = value;
144
150
  }
145
- }
146
- }
151
+ },
152
+ },
147
153
  };
148
154
  </script>
149
155
 
@@ -154,8 +160,13 @@ export default {
154
160
  .u-secret {
155
161
  display: flex;
156
162
  align-items: center;
157
- .el-checkbox__inner{
158
- display:block;
163
+ .el-checkbox__inner {
164
+ display: block;
165
+ }
166
+ .el-checkbox__label {
167
+ display: flex;
168
+ align-items: center;
169
+ gap: 3px;
159
170
  }
160
171
  }
161
172
  }
@@ -12,16 +12,16 @@
12
12
  <div class="u-flex-1">
13
13
  <div class="c-comment-cmt__author">
14
14
  <el-link class="u-name" type="primary" target="_blank" :href="userHref">{{
15
- username || "人字榜800线无名小侠"
15
+ username || $jx3boxT("jx3boxUi.commentWithReply.defaultName", "人字榜800线无名小侠")
16
16
  }}</el-link>
17
17
  <span class="u-mark u-top" v-if="item.is_top"
18
- ><el-icon><Download></Download></el-icon>置顶</span
18
+ ><el-icon><Download></Download></el-icon>{{ $jx3boxT("jx3boxUi.commentWithReply.top", "置顶") }}</span
19
19
  >
20
20
  <span class="u-mark u-star" v-if="item.is_star"
21
- ><el-icon><Star></Star></el-icon>精华</span
21
+ ><el-icon><Star></Star></el-icon>{{ $jx3boxT("jx3boxUi.commentWithReply.star", "精华") }}</span
22
22
  >
23
23
  <span class="u-mark u-secret" v-if="item.is_secret"
24
- ><el-icon><Cherry></Cherry></el-icon>悄悄话</span
24
+ ><el-icon><Cherry></Cherry></el-icon>{{ $jx3boxT("jx3boxUi.commentWithReply.secret", "悄悄话") }}</span
25
25
  >
26
26
  </div>
27
27
  <CommentContent
@@ -71,9 +71,11 @@ import { POST, DELETE, GET } from "../../service/comment";
71
71
  import CommentAvatar from "../comment/Avatar.vue";
72
72
  import { getDecoration } from "../../service/cms";
73
73
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
74
+ import i18nMixin from "../../i18n/mixin";
74
75
  const { __imgPath } = JX3BOX;
75
76
  const DECORATION_KEY = "decoration_comment_";
76
77
  export default {
78
+ mixins: [i18nMixin],
77
79
  props: {
78
80
  item: {
79
81
  type: Object,
@@ -195,7 +197,7 @@ export default {
195
197
  .then(() => {
196
198
  this.$notify({
197
199
  title: "",
198
- message: "评论成功!",
200
+ message: this.$jx3boxT("jx3boxUi.commentWithReply.commentSuccess", "评论成功!"),
199
201
  type: "success",
200
202
  duration: 3000,
201
203
  position: "bottom-right",
@@ -210,7 +212,7 @@ export default {
210
212
  .then(() => {
211
213
  this.$notify({
212
214
  title: "",
213
- message: "删除成功!",
215
+ message: this.$jx3boxT("jx3boxUi.commentWithReply.deleteSuccess", "删除成功!"),
214
216
  type: "success",
215
217
  duration: 3000,
216
218
  position: "bottom-right",
@@ -245,6 +247,7 @@ export default {
245
247
  .c-comment-cmt {
246
248
  .u-name {
247
249
  margin-right: 6px;
250
+ font-size: 13px;
248
251
  }
249
252
  .u-mark {
250
253
  font-style: normal;