@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
@@ -6,7 +6,9 @@
6
6
  <!-- <AuthorFollow style="margin-right: 8px;" :uid="uid" /> -->
7
7
  <AuthorRss :uid="uid" :data="data" />
8
8
  <!-- <AuthorGift :uid="uid" /> -->
9
- <el-button class="u-btn" size="small" @click="onMessage" icon="Message">私信</el-button
9
+ <el-button class="u-btn" size="small" @click="onMessage" icon="Message">{{
10
+ $jx3boxT("jx3boxUi.author.message", "私信")
11
+ }}</el-button
10
12
  >
11
13
  </div>
12
14
  <!-- <AuthorLink class="u-block u-links" :uid="uid" :data="data" /> -->
@@ -29,9 +31,11 @@ import AuthorMedals from "../author/AuthorMedals.vue";
29
31
  // import AuthorTeams from "../author/AuthorTeams.vue";
30
32
  import AuthorPosts from "../author/AuthorPosts.vue";
31
33
  import AuthorRss from "../author/AuthorRss.vue";
34
+ import i18nMixin from "../../i18n/mixin";
32
35
  const jx3box = require("@jx3box/jx3box-common/data/jx3box.json");
33
36
  export default {
34
37
  name: "AuthorComp",
38
+ mixins: [i18nMixin],
35
39
  props: {
36
40
  uid: {
37
41
  type: [Number, String],
@@ -24,8 +24,7 @@
24
24
  <el-divider content-position="left">JX3BOX</el-divider>
25
25
  <div class="m-single-content">
26
26
  <slot></slot>
27
- <!-- <ArticleMarkdown v-if="isMarkdown" :content="post_content" @directoryRendered="updateDirectory" /> -->
28
- <Article :content="post_content" @directoryRendered="updateDirectory" />
27
+ <Article :content="post_content" :post_mode="post_mode" @directoryRendered="updateDirectory" />
29
28
  </div>
30
29
  </div>
31
30
  <div class="m-single-null" v-else>
@@ -48,13 +47,19 @@
48
47
  :authors="authors"
49
48
  :client="post_client"
50
49
  showRss
50
+ v-if="showThx"
51
51
  />
52
52
 
53
53
  <!-- 评论 -->
54
54
  <div ref="commentView" class="m-single-comment">
55
- <el-divider content-position="left">评论</el-divider>
55
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.cmsSingle.comment", "评论") }}</el-divider>
56
56
  <Comment :id="id" category="post" v-if="id && allow_comment" />
57
- <el-alert title="作者没有开启评论功能" type="warning" show-icon v-else></el-alert>
57
+ <el-alert
58
+ :title="$jx3boxT('jx3boxUi.cmsSingle.commentDisabled', '作者没有开启评论功能')"
59
+ type="warning"
60
+ show-icon
61
+ v-else
62
+ ></el-alert>
58
63
  </div>
59
64
  </div>
60
65
 
@@ -63,13 +68,13 @@
63
68
  <slot name="single-footer"></slot>
64
69
  </footer>
65
70
 
66
- <!-- <right-affix
71
+ <right-affix
67
72
  :postId="id"
68
73
  :postType="post_type"
69
74
  :postTitle="post_title"
70
75
  :showComment="id && allow_comment"
71
76
  @toComment="toComment($event)"
72
- ></right-affix> -->
77
+ ></right-affix>
73
78
  </div>
74
79
  </template>
75
80
 
@@ -78,26 +83,24 @@ import PostHeader from "./PostHeader.vue";
78
83
  import Creators from "./Creators.vue";
79
84
  import Collection from "./Collection.vue";
80
85
  import Thx from "./Thx.vue";
81
- // import RightAffix from "./right-affix.vue";
82
- import Article from "../editor/Article.vue";
83
- // import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
84
- import Comment from "./Comment.vue";
86
+ import RightAffix from "./RightAffix.vue";
87
+ import Article from "@jx3box/jx3box-editor/src/Article.vue";
85
88
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
86
89
  import { getAppType } from "@jx3box/jx3box-common/js/utils";
90
+ import i18nMixin from "../../i18n/mixin";
87
91
 
88
92
  const { __visibleMap } = JX3BOX;
89
93
 
90
94
  export default {
91
95
  name: "cms-single",
96
+ mixins: [i18nMixin],
92
97
  components: {
93
98
  PostHeader,
94
99
  Creators,
95
100
  Collection,
96
101
  Thx,
97
102
  Article,
98
- // ArticleMarkdown,
99
- Comment,
100
- // RightAffix,
103
+ RightAffix,
101
104
  },
102
105
  props: {
103
106
  post: {
@@ -108,6 +111,10 @@ export default {
108
111
  type: Object,
109
112
  default: () => ({}),
110
113
  },
114
+ showThx: {
115
+ type: Boolean,
116
+ default: true,
117
+ },
111
118
  },
112
119
  data: function () {
113
120
  return {
@@ -145,7 +152,7 @@ export default {
145
152
  return !!this.post?._check;
146
153
  },
147
154
  null_tip: function () {
148
- let str = "作者设置了【";
155
+ let str = this.$jx3boxT("jx3boxUi.cmsSingle.authorSet", "作者设置了【");
149
156
  str += __visibleMap[this.post?.visible];
150
157
  str += "】";
151
158
  return str;
@@ -185,6 +192,10 @@ export default {
185
192
  }
186
193
  },
187
194
  methods: {
195
+ shouldSkipNavigation: function () {
196
+ if (typeof window === "undefined" || typeof location === "undefined") return false;
197
+ return location.pathname.includes("iframe.html") || !!window.__STORYBOOK_PREVIEW__;
198
+ },
188
199
  updateCollection: function (val) {
189
200
  this.collection_data = val;
190
201
  },
@@ -214,7 +225,7 @@ export default {
214
225
  deep: true,
215
226
  immediate: true,
216
227
  handler: function (val) {
217
- if (location.host.includes("localhost")) {
228
+ if (location.host.includes("localhost") || this.shouldSkipNavigation()) {
218
229
  return;
219
230
  }
220
231
 
@@ -226,6 +237,9 @@ export default {
226
237
  community_id: {
227
238
  immediate: true,
228
239
  handler(val) {
240
+ if (this.shouldSkipNavigation()) {
241
+ return;
242
+ }
229
243
  if (val && val != 0) {
230
244
  // 防止死循环
231
245
  if (location.href.includes(`/community/${val}`)) {
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <div class="w-collection" v-if="list && list.length">
3
3
  <div class="w-collection-title" @click="handleShow" :class="{ on: visible }">
4
- <span> <el-icon><Notebook /></el-icon> 该作品已被收录至作者的剑三小册 </span>
4
+ <el-icon><Notebook /></el-icon>
5
+ {{ $jx3boxT("jx3boxUi.collection.included", "该作品已被收录至作者的剑三小册") }}
5
6
  <a @click.stop :href="collectionLink(id)" target="_blank">《{{ title }}》</a>
6
7
  </div>
7
8
  <transition name="fade">
@@ -9,7 +10,6 @@
9
10
  <ol v-if="list && list.length" class="u-list" :style="{ display: visible ? 'block' : 'none' }">
10
11
  <li v-for="(item, i) in list" :key="i" class="u-item">
11
12
  <a v-if="item" :href="showLink(item)" target="_blank">
12
- <!-- <i class="el-icon-link"></i> -->
13
13
  {{ item.title }}
14
14
  </a>
15
15
  </li>
@@ -23,21 +23,23 @@
23
23
  import * as utilModule from "@jx3box/jx3box-common/js/utils";
24
24
  const { getLink } = utilModule;
25
25
  import { getCollection } from "../../service/cms";
26
+ import i18nMixin from "../../i18n/mixin";
26
27
  export default {
27
28
  name: "SingleCollection",
29
+ mixins: [i18nMixin],
28
30
  props: {
29
31
  id: {
30
32
  type: [Number, String],
31
33
  default: 0,
32
34
  },
33
35
  defaultVisible: {
34
- type: Boolean,
36
+ type: [Boolean, Number],
35
37
  default: false,
36
38
  },
37
39
  },
38
40
  inject: [],
39
41
  components: {},
40
- data: function() {
42
+ data: function () {
41
43
  return {
42
44
  visible: this.defaultVisible || false,
43
45
  data: {
@@ -47,17 +49,17 @@ export default {
47
49
  };
48
50
  },
49
51
  computed: {
50
- title: function() {
52
+ title: function () {
51
53
  return this.data?.title;
52
54
  },
53
- list: function() {
55
+ list: function () {
54
56
  return this.data?.posts;
55
57
  },
56
58
  },
57
59
  watch: {
58
60
  id: {
59
61
  immediate: true,
60
- handler: function(val) {
62
+ handler: function (val) {
61
63
  if (~~val) {
62
64
  this.loadData();
63
65
  } else {
@@ -68,24 +70,24 @@ export default {
68
70
  }
69
71
  },
70
72
  },
71
- defaultVisible: function(val) {
73
+ defaultVisible: function (val) {
72
74
  this.visible = val;
73
75
  },
74
76
  },
75
77
  methods: {
76
- handleShow: function() {
78
+ handleShow: function () {
77
79
  this.visible = !this.visible;
78
80
  },
79
- loadData: function() {
81
+ loadData: function () {
80
82
  getCollection(this.id).then((res) => {
81
83
  this.data = res.data?.data;
82
- this.$emit('collectionUpdate',this.data)
84
+ this.$emit("collectionUpdate", this.data);
83
85
  });
84
86
  },
85
- collectionLink: function(id) {
87
+ collectionLink: function (id) {
86
88
  return getLink("collection", id);
87
89
  },
88
- showLink: function(item) {
90
+ showLink: function (item) {
89
91
  if (item.type == "custom") {
90
92
  return item.url;
91
93
  } else {
@@ -93,20 +95,23 @@ export default {
93
95
  }
94
96
  },
95
97
  },
96
- created: function() {},
97
- mounted: function() {},
98
+ created: function () {},
99
+ mounted: function () {},
98
100
  };
99
101
  </script>
100
102
 
101
103
  <style lang="less">
102
104
  .w-collection {
103
- &-title {
105
+ --el-color-primary: @primary;
106
+
107
+ .w-collection-title {
104
108
  cursor: pointer;
105
109
  position: relative;
106
110
  border: 1px solid #ddd;
107
111
  background-color: #fafbfc;
108
112
  padding: 8px 10px 8px 10px;
109
- display: block;
113
+ // display: block;
114
+ .flex(y);
110
115
  margin-bottom: 0;
111
116
  border-radius: 4px;
112
117
  line-height: 1.6;
@@ -130,17 +135,30 @@ export default {
130
135
  }
131
136
 
132
137
  a {
133
- .underline(@color-link);
138
+ color: var(--el-color-primary);
139
+ &:hover {
140
+ .underline(var(--el-color-primary));
141
+ }
134
142
  }
135
143
  }
136
144
 
137
145
  counter-reset: collection;
146
+
147
+ .u-list {
148
+ padding: 10px 20px;
149
+ margin: 0;
150
+ border: 1px dashed #ddd;
151
+ background: none;
152
+ border-top: none;
153
+ }
154
+
138
155
  .u-item {
139
156
  .fz(13px, 32px);
140
157
  border-bottom: 1px solid #eee;
141
158
  transition: 0.15s ease-in-out;
142
159
  .nobreak;
143
160
  a {
161
+ color: var(--el-color-primary);
144
162
  .db;
145
163
  &:before {
146
164
  counter-increment: collection;
@@ -158,14 +176,6 @@ export default {
158
176
  }
159
177
  }
160
178
 
161
- .u-list {
162
- padding: 10px 20px;
163
- margin: 0;
164
- border: 1px dashed #ddd;
165
- background: none;
166
- border-top: none;
167
- }
168
-
169
179
  .on {
170
180
  &::after {
171
181
  transform: rotate(90deg);
@@ -4,10 +4,10 @@
4
4
  <CommentInputForm @submit="userSubmitInputForm" />
5
5
  <div class="c-comment-panel">
6
6
  <div class="u-order">
7
- <span class="u-label">排序模式:</span>
7
+ <span class="u-label">{{ $jx3boxT("jx3boxUi.comment.sortMode", "排序模式:") }}</span>
8
8
  <el-radio-group v-model="isDesc" @change="changeOrder" size="small">
9
- <el-radio-button value="DESC">最后靠前</el-radio-button>
10
- <el-radio-button value="ASC">最早靠前</el-radio-button>
9
+ <el-radio-button value="DESC">{{ $jx3boxT("jx3boxUi.comment.desc", "最后靠前") }}</el-radio-button>
10
+ <el-radio-button value="ASC">{{ $jx3boxT("jx3boxUi.comment.asc", "最早靠前") }}</el-radio-button>
11
11
  </el-radio-group>
12
12
  </div>
13
13
  <div class="u-op">
@@ -15,7 +15,7 @@
15
15
  class="c-comment-panel-likes"
16
16
  v-model="orderByLikes"
17
17
  @change="changeOrderByLikes"
18
- active-text="获赞靠前"
18
+ :active-text="$jx3boxT('jx3boxUi.comment.likesFirst', '获赞靠前')"
19
19
  >
20
20
  </el-switch>
21
21
  <el-switch
@@ -23,8 +23,8 @@
23
23
  v-model="openWhiteList"
24
24
  @change="changeWhiteList"
25
25
  v-if="commentPower.is_author || commentPower.is_editor"
26
- active-text="开启过滤"
27
- title="开启过滤后,仅设为显示的评论可被其他人所见"
26
+ :active-text="$jx3boxT('jx3boxUi.comment.openWhitelist', '开启过滤')"
27
+ :title="$jx3boxT('jx3boxUi.comment.openWhitelistTip', '开启过滤后,仅设为显示的评论可被其他人所见')"
28
28
  >
29
29
  </el-switch>
30
30
  </div>
@@ -87,8 +87,10 @@ import CommentWithReply from "../comment/CommentWithReply.vue";
87
87
  import { GET, POST, DELETE, PUT, getOrderMode, setOrderMode } from "../../service/comment";
88
88
  import { getConfig } from "../../service/cms";
89
89
  import User from "@jx3box/jx3box-common/js/user";
90
+ import i18nMixin from "../../i18n/mixin";
90
91
  export default {
91
92
  name: "CommentComp",
93
+ mixins: [i18nMixin],
92
94
  props: {
93
95
  id: {
94
96
  type: [Number, String],
@@ -197,7 +199,7 @@ export default {
197
199
  .then(() => {
198
200
  this.$notify({
199
201
  title: "",
200
- message: "删除成功!",
202
+ message: this.$jx3boxT("jx3boxUi.comment.deleteSuccess", "删除成功!"),
201
203
  type: "success",
202
204
  duration: 3000,
203
205
  position: "bottom-right",
@@ -211,7 +213,7 @@ export default {
211
213
  .then(() => {
212
214
  this.$notify({
213
215
  title: "",
214
- message: "操作成功!",
216
+ message: this.$jx3boxT("jx3boxUi.comment.actionSuccess", "操作成功!"),
215
217
  type: "success",
216
218
  duration: 3000,
217
219
  position: "bottom-right",
@@ -245,7 +247,7 @@ export default {
245
247
  .then((responseJSON) => {
246
248
  if (responseJSON && ~~responseJSON.code > 0) {
247
249
  this.$notify({
248
- title: "评论失败",
250
+ title: this.$jx3boxT("jx3boxUi.comment.commentFailed", "评论失败"),
249
251
  message: responseJSON.msg || "",
250
252
  type: "error",
251
253
  duration: 3000,
@@ -255,7 +257,7 @@ export default {
255
257
  }
256
258
  this.$notify({
257
259
  title: "",
258
- message: "评论成功!",
260
+ message: this.$jx3boxT("jx3boxUi.comment.commentSuccess", "评论成功!"),
259
261
  type: "success",
260
262
  duration: 3000,
261
263
  position: "bottom-right",
@@ -371,16 +373,16 @@ export default {
371
373
  cursor: pointer;
372
374
  margin-right: 10px;
373
375
  // margin-left: 10px;
374
- color: #3d454d;
376
+ color: #555;
377
+ .pr;top:-1px;
375
378
 
376
379
  &:hover {
377
- color: #23ade5;
380
+ color: var(--el-color-primary);
378
381
  }
379
382
  }
380
383
  .c-jx3box-emotion {
381
384
  margin: 0;
382
385
  position: relative;
383
- top: 7px;
384
386
  }
385
387
  .c-comment-emotion {
386
388
  overflow: hidden;
@@ -448,6 +450,10 @@ export default {
448
450
  b {
449
451
  color: #0366d6;
450
452
  }
453
+ .u-order{
454
+ .flex;
455
+ align-items: center;
456
+ }
451
457
  }
452
458
  .c-comment-emotion {
453
459
  max-height: 168px;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="w-creators" v-if="visible">
3
- <span class="w-creators-title">联合创作</span>
3
+ <span class="w-creators-title">{{ $jx3boxT("jx3boxUi.creators.title", "联合创作") }}</span>
4
4
  <a
5
5
  class="w-creators-super w-creators-item"
6
6
  v-if="super_author"
@@ -26,7 +26,7 @@
26
26
  </a>
27
27
  </div>
28
28
  <a class="w-creators-edit" :href="editLink" v-if="isCreator">
29
- <el-icon><Edit /></el-icon> 编辑当前作品
29
+ <el-icon><Edit /></el-icon> {{ $jx3boxT("jx3boxUi.creators.editCurrent", "编辑当前作品") }}
30
30
  </a>
31
31
  </div>
32
32
  </template>
@@ -35,8 +35,10 @@
35
35
  import { getPostAuthors } from "../../service/cms";
36
36
  import { showAvatar, authorLink, editLink } from "@jx3box/jx3box-common/js/utils";
37
37
  import User from "@jx3box/jx3box-common/js/user";
38
+ import i18nMixin from "../../i18n/mixin";
38
39
  export default {
39
40
  name: "SingleCreators",
41
+ mixins: [i18nMixin],
40
42
  props: {
41
43
  postId: {
42
44
  type: [Number, String],
@@ -173,7 +175,7 @@ export default {
173
175
  .bold;
174
176
  .db;
175
177
  color: @color;
176
- margin-bottom: 2px;
178
+ // margin-bottom: 2px;
177
179
  .nobreak;
178
180
  max-width: 120px;
179
181
  }
@@ -0,0 +1,158 @@
1
+ <template>
2
+ <div class="c-post-collection" v-if="list && list.length">
3
+ <div class="m-title">
4
+ <div class="c-post-collection-title">
5
+ <el-icon class="u-icon"><Connection>></Connection></el-icon> 关联
6
+ </div>
7
+ <div class="u-op" @click="toggle"><el-icon><DCaret></DCaret></el-icon> 折叠</div>
8
+ </div>
9
+ <transition name="collapse">
10
+ <ul v-show="show" class="c-post-collection-list">
11
+ <li v-for="(item, i) in list" :key="i">
12
+ <el-tooltip class="item" effect="dark" :content="item.title" placement="left">
13
+ <a :href="showLink(item)" target="_blank">
14
+ <el-icon><Link></Link></el-icon>
15
+ {{ item.title }}
16
+ </a>
17
+ </el-tooltip>
18
+ </li>
19
+ </ul>
20
+ </transition>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { getLink, resolveImagePath } from "@jx3box/jx3box-common/js/utils";
26
+ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
27
+ import { getCollection } from "../../service/cms";
28
+ const { __imgPath } = JX3BOX;
29
+ export default {
30
+ name: "PostCollection",
31
+ props: ["id", "store"],
32
+ components: {},
33
+ data: function () {
34
+ return {
35
+ data: {
36
+ title: "",
37
+ posts: [],
38
+ },
39
+ show: true,
40
+ };
41
+ },
42
+ computed: {
43
+ list: function () {
44
+ return this.store?.posts || this.data?.posts;
45
+ },
46
+ },
47
+ watch: {
48
+ id: {
49
+ immediate: true,
50
+ handler: function (val) {
51
+ !!~~val && this.loadData();
52
+ },
53
+ },
54
+ },
55
+ methods: {
56
+ loadData: function () {
57
+ getCollection(this.id).then((res) => {
58
+ this.data = res.data?.data;
59
+ });
60
+ },
61
+ showLink: function (item) {
62
+ if (item.type == "custom") {
63
+ return item.url;
64
+ } else {
65
+ return getLink(item.type, item.id);
66
+ }
67
+ },
68
+ getCover: function (val) {
69
+ return val ? resolveImagePath(val) : `${__imgPath}image/collection/default_cover.png`;
70
+ },
71
+ toggle: function () {
72
+ this.show = !this.show;
73
+ },
74
+ },
75
+ };
76
+ </script>
77
+ <style lang="less">
78
+ .c-post-collection {
79
+ .m-title {
80
+ .flex;
81
+ justify-content: space-between;
82
+ align-items: center;
83
+ line-height: 24px;
84
+ .u-op {
85
+ font-size: 13px;
86
+ font-weight: 500;
87
+ line-height: 18px;
88
+ padding: 0 5px;
89
+ color: #cdd1db;
90
+ cursor: pointer;
91
+ .flex(y);
92
+ &:hover {
93
+ color: #a1a9bb;
94
+ }
95
+ }
96
+ }
97
+ .u-image {
98
+ img {
99
+ .w(100%);
100
+ height: 226px;
101
+ object-fit: cover;
102
+ }
103
+ }
104
+ .c-post-collection-title {
105
+ font-weight: normal;
106
+ font-size: 16px;
107
+ line-height: 18px;
108
+ color: #333;
109
+ .flex;
110
+ align-items: center;
111
+ gap: 5px;
112
+ }
113
+ .u-icon {
114
+ font-size: 18px;
115
+ }
116
+ .c-post-collection-list {
117
+ list-style: none;
118
+ padding: 10px 20px;
119
+ margin: 0;
120
+ overflow: hidden;
121
+ li {
122
+ .fz(13px, 36px);
123
+ }
124
+ a {
125
+ .db;
126
+ color: var(--el-color-primary);
127
+ transition: 0.15s ease-in-out;
128
+ .nobreak;
129
+ &:hover {
130
+ background-color: #e6f0fb;
131
+ }
132
+ }
133
+ i {
134
+ .pr;
135
+ top: 2px;
136
+ }
137
+ }
138
+
139
+ .collapse-enter-active,
140
+ .collapse-leave-active {
141
+ transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
142
+ }
143
+
144
+ .collapse-enter-from,
145
+ .collapse-leave-to {
146
+ max-height: 0;
147
+ opacity: 0;
148
+ padding-top: 0;
149
+ padding-bottom: 0;
150
+ }
151
+
152
+ .collapse-enter-to,
153
+ .collapse-leave-from {
154
+ max-height: 480px;
155
+ opacity: 1;
156
+ }
157
+ }
158
+ </style>