@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
package/src/App.vue CHANGED
@@ -3,7 +3,7 @@
3
3
  <CommonHeader></CommonHeader>
4
4
  <breadcrumb
5
5
  name="频道名称"
6
- slug="slug"
6
+ slug="bps"
7
7
  root="/slug"
8
8
  :publishEnable="true"
9
9
  :feedbackEnable="true"
@@ -13,123 +13,183 @@
13
13
  <template #logo>
14
14
  <img svg-inline src="../assets/img/editor/jx3.svg" />
15
15
  </template>
16
- <template #op-prepend> </template>
16
+ bread info
17
+ <template #op-prepend>
18
+ <AdminDrop :post="community" :isCommunity="true" :user-id="8" :showMove="true" />
19
+ </template>
17
20
  </breadcrumb>
18
- <LeftSidebar :open="true" :uid="8719">
19
- <LeftSideToggle :mobileOnly="true" />
20
- <Author :uid="8719" />
21
+ <LeftSidebar :open="true" :uid="8">
22
+ <Author :uid="8" />
21
23
  </LeftSidebar>
22
24
  <Main :withoutLeft="false" :withoutRight="false">
23
- <versionBy value=""></versionBy>
25
+ <el-tabs v-model="tab" type="card">
26
+ <el-tab-pane label="通用组件" name="widget">
27
+ <h1 class="m-title">UC泛用组件</h1>
28
+ <div class="m-block">
29
+ <el-button @click="userpop = true" style="width: 100px">用户POP</el-button>
30
+ <UserPop title="添加用户" v-model="userpop"></UserPop>
31
+ </div>
32
+
33
+ <h1 class="m-title">切换侧边栏</h1>
34
+ <div class="m-block">
35
+ <LeftSideToggle :mobileOnly="false" />
36
+ <LeftSideToggle :mobileOnly="true" />
37
+ </div>
38
+ </el-tab-pane>
39
+ <el-tab-pane label="文章列表" name="list">
40
+ <h1 class="m-title">筛选</h1>
41
+ <div class="m-block">
42
+ <markBy />
43
+ <menuBy :data="['test1', 'test2']" />
44
+ <zlpBy />
45
+ <topicBy v-model="tag2" :topics="post_topics" />
46
+ <tagBy :data="['PVE', 'PVX']" :type="tag" />
47
+ </div>
48
+
49
+ <h2 class="m-title">客户端</h2>
50
+ <div class="m-block">
51
+ <clientBy type="" />
52
+ <versionBy value="" />
53
+ </div>
54
+
55
+ <h2 class="m-title">排序</h2>
56
+ <div class="m-block">
57
+ <orderBy />
58
+ </div>
59
+ </el-tab-pane>
60
+ <el-tab-pane label="文章详情" name="single">
61
+ <h1 class="m-title">Append</h1>
62
+ <div class="m-block">
63
+ <PostGuide :post="post" />
64
+ </div>
65
+ <h1 class="m-title">Comment</h1>
66
+ <div class="m-block">
67
+ <el-button @click="homeworkVisible = true" style="width: 100px" size="small"
68
+ >作业组件</el-button
69
+ >
70
+ <Homework
71
+ v-model="homeworkVisible"
72
+ post-type="comment"
73
+ :post-id="19382"
74
+ :userId="8719"
75
+ client="std"
76
+ ></Homework>
77
+ </div>
78
+ </el-tab-pane>
79
+ <el-tab-pane label="文章内容" name="content">
80
+ <el-radio-group v-model="post_id">
81
+ <el-radio value="23240">临时测试</el-radio>
82
+ <el-radio label="35605">Markdown</el-radio>
83
+ <el-radio value="32035">仅小册</el-radio>
84
+ <el-radio value="30017">仅联合创作者</el-radio>
85
+ <el-radio value="30582">小册和联合创作者</el-radio>
86
+ <el-radio value="31129">无小册和联合创作者</el-radio>
87
+ </el-radio-group>
88
+ <singlebox :post="post" />
89
+ </el-tab-pane>
90
+ <el-tab-pane label="移动组件" name="mobile">
91
+ <h1 class="m-title">Common</h1>
92
+ <el-switch v-model="showSuspendCommon" active-text="展示移动组件"></el-switch>
93
+ <div class="m-block">
94
+ <SuspendCommon
95
+ v-if="showSuspendCommon"
96
+ :drawerOptions="{
97
+ author: {
98
+ name: '作者名字',
99
+ avatar: 'https://cdn.jx3box.com/upload/avatar/2022/3/2/8_9860765.png',
100
+ author_id: 8,
101
+ },
102
+ subscribeType: 'posts',
103
+ postType: 'macro',
104
+ id: 97147,
105
+ title: '薄嘴唇靓仔!!!',
106
+ }"
107
+ @search="suspendSearch"
108
+ >
109
+ <template #default>
110
+ <div style="display: flex; gap: 1rem">
111
+ <div>切换</div>
112
+ <div>切换</div>
113
+ <div>切换</div>
114
+ </div>
115
+ </template>
116
+ </SuspendCommon>
117
+ </div>
118
+ </el-tab-pane>
119
+ </el-tabs>
24
120
  <el-divider></el-divider>
25
- <UploadAlum />
26
- <singlebox :post="post" />
27
- <SimpleThxVue
28
- postType="bbs"
29
- postTitle="bbs23865的标题"
30
- :userId="7"
31
- :adminBoxcoinEnable="true"
32
- :userBoxcoinEnable="true"
33
- :allowGift="true"
34
- :postId="57260"
35
- />
36
- <Thx
37
- postType="bbs"
38
- postTitle="bbs23865的标题"
39
- type="batchReward"
40
- :userId="7"
41
- :adminBoxcoinEnable="true"
42
- :userBoxcoinEnable="true"
43
- :postId="57260"
44
- :allowGift="true"
45
- :showRss="true"
46
- />
47
- <Comment category="post" id="80449"></Comment>
48
- <RightSidebar :show-toggle="true">
121
+ <RightSidebar :show-toggle="true" style="padding: 15px">
49
122
  <PostTopic type="bps" :id="48857"></PostTopic>
50
123
  <div id="directory"></div>
124
+ <PostVersion :post="post"></PostVersion>
125
+ <PostCollection :id="59" />
51
126
  </RightSidebar>
52
-
53
- <SuspendCommon
54
- :drawerOptions="{
55
- author: {
56
- name: '作者名字',
57
- avatar: 'https://cdn.jx3box.com/upload/avatar/2022/3/2/8_9860765.png',
58
- author_id: 8,
59
- },
60
- subscribeType: 'posts',
61
- postType: 'macro',
62
- id: 97147,
63
- title: '薄嘴唇靓仔!!!',
64
- }"
65
- @search="suspendSearch"
66
- >
67
- <template #default>
68
- <div style="display: flex; gap: 1rem">
69
- <div>切换</div>
70
- <div>切换</div>
71
- <div>切换</div>
72
- </div>
73
- </template>
74
- </SuspendCommon>
75
127
  </Main>
76
128
  <CommonFooter> </CommonFooter>
77
129
  </div>
78
130
  </template>
79
131
 
80
132
  <script>
133
+ import { getPost } from "../service/cms";
134
+ import { get_item } from "../service/item";
135
+ import { getTopicDetails } from "../service/community";
136
+ import post_topics from "@jx3box/jx3box-common/data/post_topics.json";
137
+
138
+ // components
81
139
  import singlebox from "./single/CmsSingle.vue";
82
- import UploadAlum from "./editor/UploadAlum.vue";
83
140
  import Author from "./single/Author.vue";
84
- import SimpleThxVue from "./single/SimpleThx.vue";
85
- import Comment from "./single/Comment.vue";
86
- import Thx from "./single/Thx.vue";
87
- import PostHeader from "./single/PostHeader.vue";
88
141
  import PostTopic from "./single/PostTopic.vue";
89
- import axios from "axios";
90
- import post_topics from "@jx3box/jx3box-common/data/post_topics.json";
91
- import { get_item } from "../service/item";
92
- import AdminDirectMessage from "./bread/AdminDirectMessage.vue";
93
- import Admin from "@/bread/Admin.vue";
94
- import versionBy from "./filters/versionBy.vue";
95
- import SuspendCommon from "./SuspendCommon.vue";
142
+ import PostGuide from "./single/PostGuide.vue";
143
+ import Homework from "./interact/Homework.vue";
144
+ import PostVersion from "./single/PostVersion.vue";
145
+ import PostCollection from "./single/PostCollection.vue";
96
146
  export default {
97
147
  name: "App",
98
148
  components: {
99
- SimpleThxVue,
100
149
  Author,
101
- Comment,
102
- Thx,
103
150
  // PostHeader,
104
151
  PostTopic,
105
- UploadAlum,
106
152
  // AdminDirectMessage,
107
153
  singlebox,
108
- versionBy,
109
- SuspendCommon,
110
154
  // Admin,
155
+ Homework,
156
+ PostGuide,
157
+ PostVersion,
158
+ PostCollection,
111
159
  },
112
160
  data() {
113
161
  return {
114
- post_id: "74662",
162
+ tab: "content",
163
+
164
+ post_id: "23240",
115
165
  post: "",
116
166
  client: location.href.includes("origin") ? "origin" : "std",
117
- tag: "",
118
- // post_topics: post_topics["bps_pve"],
119
- tag2: "",
120
167
  item1: null,
121
168
  item2: null,
122
169
  item3: null,
123
170
  item4: null,
124
171
  item5: null,
125
172
  item6: null,
173
+
174
+ // 列表
175
+ tag: "post",
176
+ post_topics: post_topics["pve"],
177
+ tag2: "",
178
+
179
+ // 通用
180
+ userpop: false,
181
+ homeworkVisible: false,
182
+
183
+ showSuspendCommon: false,
184
+
185
+ community: {},
126
186
  };
127
187
  },
128
188
  watch: {
129
189
  post_id: {
130
190
  immediate: true,
131
191
  handler: function () {
132
- // this.loadPost();
192
+ this.loadPost();
133
193
  },
134
194
  },
135
195
  },
@@ -141,7 +201,7 @@ export default {
141
201
  console.log(data);
142
202
  },
143
203
  loadPost() {
144
- axios.get(`/api/cms/post/${this.post_id}`).then((res) => {
204
+ getPost(this.post_id).then((res) => {
145
205
  this.post = res.data.data;
146
206
  this.$forceUpdate();
147
207
  });
@@ -198,15 +258,29 @@ export default {
198
258
  }
199
259
  });
200
260
  },
261
+ loadCommunity: function () {
262
+ // 72
263
+ getTopicDetails(4339).then((res) => {
264
+ this.community = res.data.data;
265
+ });
266
+ },
201
267
  },
202
268
  mounted() {
203
269
  // this.loadItems();
270
+ this.loadCommunity();
204
271
  },
205
272
  };
206
273
  </script>
207
-
208
274
  <style lang="less">
209
- body {
210
- padding-top: @header-height;
275
+ .m-title {
276
+ margin: 20px 0 10px;
277
+ font-size: 16px;
278
+ font-weight: 500;
279
+ }
280
+ .m-block {
281
+ padding: 15px;
282
+ .flex;
283
+ flex-direction: column;
284
+ gap: 20px;
211
285
  }
212
286
  </style>
@@ -13,7 +13,7 @@
13
13
  <!-- 面包屑内容 -->
14
14
  <Crumb :name="slug" v-if="crumbEnable" />
15
15
  <slot></slot>
16
- <slot v-if="show" name="title"></slot>
16
+ <slot v-if="showTitle" name="title"></slot>
17
17
  <div class="u-op">
18
18
  <slot name="op-append"></slot>
19
19
  <a
@@ -22,7 +22,7 @@
22
22
  class="u-publish el-button el-button--primary el-button--medium u-op-public"
23
23
  >
24
24
  <el-icon><Edit /></el-icon>
25
- <span>发布</span>
25
+ <span>{{ $jx3boxT("jx3boxUi.breadcrumb.publish", "发布") }}</span>
26
26
  </a>
27
27
  <a
28
28
  v-if="feedbackEnable"
@@ -32,9 +32,15 @@
32
32
  target="_blank"
33
33
  >
34
34
  <el-icon><InfoFilled /></el-icon>
35
- <span>反馈</span>
35
+ <span>{{ $jx3boxT("jx3boxUi.breadcrumb.feedback", "反馈") }}</span>
36
36
  </a>
37
- <Admin v-if="adminEnable" :marksOptions="adminMarks" :show-extend="showExtend" :app="slug" :subtypeMap="subtypeMap" />
37
+ <Admin
38
+ v-if="adminEnable"
39
+ :marksOptions="adminMarks"
40
+ :show-extend="showExtend"
41
+ :app="slug"
42
+ :subtypeMap="subtypeMap"
43
+ />
38
44
  <slot name="op-prepend"></slot>
39
45
  </div>
40
46
  </div>
@@ -48,9 +54,11 @@ import Admin from "./bread/Admin.vue";
48
54
  import Crumb from "./bread/Crumb.vue";
49
55
  import { isApp } from "../assets/js/app.js";
50
56
  import Bus from "../utils/bus";
57
+ import i18nMixin from "../i18n/mixin";
51
58
 
52
59
  export default {
53
60
  name: "CommonBreadcrumb",
61
+ mixins: [i18nMixin],
54
62
  props: {
55
63
  name: { type: String, default: "" },
56
64
  slug: { type: String, default: "" },
@@ -71,10 +79,10 @@ export default {
71
79
  return {
72
80
  isOpen: true,
73
81
  feedback: "/feedback?refer=" + encodeURIComponent(window.location.href),
74
- isNotAdmin: !User.isEditor(),
82
+ isNotAdmin: !User.isEditor(), // 非管理员都显示反馈链接
75
83
  isOverlay: false,
76
84
  isApp: isApp(),
77
- show: false,
85
+ showTitle: false,
78
86
  };
79
87
  },
80
88
  computed: {
@@ -96,20 +104,25 @@ export default {
96
104
  }
97
105
  let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
98
106
  if (scrollTop > 100) {
99
- this.show = true;
107
+ this.showTitle = true;
100
108
  } else {
101
- this.show = false;
109
+ this.showTitle = false;
102
110
  }
103
- }
111
+ },
104
112
  },
105
113
  beforeUnmount() {
106
114
  document.removeEventListener("scroll", this.onShowTitle);
115
+ if (this.__toggleLeftSideHandler) {
116
+ Bus.off("toggleLeftSide", this.__toggleLeftSideHandler);
117
+ this.__toggleLeftSideHandler = null;
118
+ }
107
119
  },
108
120
  mounted: function () {
109
121
  document.addEventListener("scroll", this.onShowTitle);
110
- Bus.on("toggleLeftSide", (data) => {
122
+ this.__toggleLeftSideHandler = (data) => {
111
123
  this.isOpen = data;
112
- });
124
+ };
125
+ Bus.on("toggleLeftSide", this.__toggleLeftSideHandler);
113
126
 
114
127
  if (window.innerWidth < 1024) {
115
128
  this.isOpen = false;
@@ -8,8 +8,8 @@
8
8
  <span class="text-2xl font-bold tracking-tight text-white">JX3BOX</span>
9
9
  </a>
10
10
  <p class="mt-5 text-sm leading-7 text-gray-400" style="max-width: 20rem">
11
- {{ $jx3boxT("jx3boxUi.footer.slogan1", "一站式剑三工具与资源聚合站。") }}<br />
12
- {{ $jx3boxT("jx3boxUi.footer.slogan2", "江湖路远,幸甚有你。") }}
11
+ {{ $jx3boxT("jx3boxUi.commonFooter.slogan1", "一站式剑三工具与资源聚合站。") }}<br />
12
+ {{ $jx3boxT("jx3boxUi.commonFooter.slogan2", "江湖路远,幸甚有你。") }}
13
13
  </p>
14
14
  <footer-official />
15
15
  </section>
package/src/Footer.vue CHANGED
@@ -3,16 +3,22 @@
3
3
  <div class="c-footer-inner">
4
4
  <div class="c-footer-left">
5
5
  <img class="u-flag" svg-inline src="../assets/img/footer/china.svg" />
6
- <a href="https://beian.miit.gov.cn/" class="u-beian" target="_blank">湘ICP备2021002288号</a>
6
+ <a href="https://beian.miit.gov.cn/" class="u-beian" target="_blank">{{
7
+ $jx3boxT("jx3boxUi.footer.icp", "湘ICP备2021002288号")
8
+ }}</a>
7
9
  </div>
8
10
  <div class="c-footer-right">
9
- <a class="u-about" :href="about" target="_blank">关于我们</a>
11
+ <a class="u-about" :href="about" target="_blank">{{ $jx3boxT("jx3boxUi.footer.about", "关于我们") }}</a>
10
12
  <em>|</em>
11
- <a class="u-doc" href="/help" target="_blank">帮助文档</a>
13
+ <a class="u-doc" href="/help" target="_blank">{{ $jx3boxT("jx3boxUi.footer.doc", "帮助文档") }}</a>
12
14
  <em>|</em>
13
- <a class="u-log" href="https://github.com/JX3BOX" target="_blank">代码仓库</a>
15
+ <a class="u-log" href="https://github.com/JX3BOX" target="_blank">{{
16
+ $jx3boxT("jx3boxUi.footer.repo", "代码仓库")
17
+ }}</a>
14
18
  <em>|</em>
15
- <a class="u-feedback" :href="feedback" target="_blank">反馈建议</a>
19
+ <a class="u-feedback" :href="feedback" target="_blank">{{
20
+ $jx3boxT("jx3boxUi.footer.feedback", "反馈建议")
21
+ }}</a>
16
22
  </div>
17
23
  <slot></slot>
18
24
  </div>
@@ -22,8 +28,10 @@
22
28
  <script>
23
29
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
24
30
  import { isApp } from "../assets/js/app.js";
31
+ import i18nMixin from "../i18n/mixin";
25
32
  export default {
26
33
  name: "CommonFooter",
34
+ mixins: [i18nMixin],
27
35
  props: {
28
36
  darkMode: {
29
37
  type: Boolean,
@@ -26,14 +26,21 @@ export default {
26
26
  },
27
27
  },
28
28
  mounted: function () {
29
- Bus.on("toggleLeftSide", (data) => {
29
+ this.__toggleLeftSideHandler = (data) => {
30
30
  this.isOpen = data;
31
- });
31
+ };
32
+ Bus.on("toggleLeftSide", this.__toggleLeftSideHandler);
32
33
 
33
34
  if (window.innerWidth < 1024) {
34
35
  this.isOpen = false;
35
36
  }
36
37
  },
38
+ beforeUnmount() {
39
+ if (this.__toggleLeftSideHandler) {
40
+ Bus.off("toggleLeftSide", this.__toggleLeftSideHandler);
41
+ this.__toggleLeftSideHandler = null;
42
+ }
43
+ },
37
44
  components: {},
38
45
  };
39
46
  </script>
@@ -52,7 +59,7 @@ export default {
52
59
  }
53
60
  &.on {
54
61
  svg {
55
- fill: @primary;
62
+ fill: var(--el-color-primary);
56
63
  }
57
64
  }
58
65
  }
@@ -16,7 +16,7 @@
16
16
  class="c-sidebar-left-toggle"
17
17
  :class="!isOpen && 'close-sidebar-left'"
18
18
  @click="toggleLeftSide"
19
- :title="isOpen ? '收起侧边栏' : '打开侧边栏'"
19
+ :title="isOpen ? $jx3boxT('jx3boxUi.leftSidebar.collapse', '收起侧边栏') : $jx3boxT('jx3boxUi.leftSidebar.expand', '打开侧边栏')"
20
20
  >
21
21
  <el-icon>
22
22
  <ArrowRight v-if="!isOpen" />
@@ -31,9 +31,11 @@ import Bus from "../utils/bus";
31
31
  import { isApp } from "../assets/js/app.js";
32
32
  import { getDecoration } from "../service/cms";
33
33
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
34
+ import i18nMixin from "../i18n/mixin";
34
35
  const DECORATION_SIDEBAR = "decoration_sidebar";
35
36
  export default {
36
37
  name: "LeftSidebar",
38
+ mixins: [i18nMixin],
37
39
  props: ["open", "withoutBread", "uid"],
38
40
  data: function () {
39
41
  return {
@@ -90,17 +92,29 @@ export default {
90
92
  }
91
93
  },
92
94
  },
95
+ beforeUnmount() {
96
+ if (this.__toggleLeftSideHandler) {
97
+ Bus.off("toggleLeftSide", this.__toggleLeftSideHandler);
98
+ this.__toggleLeftSideHandler = null;
99
+ }
100
+ if (this.__docClickHandler) {
101
+ document.removeEventListener("click", this.__docClickHandler);
102
+ this.__docClickHandler = null;
103
+ }
104
+ },
93
105
  mounted: function () {
94
- Bus.on("toggleLeftSide", (data) => {
106
+ this.__toggleLeftSideHandler = (data) => {
95
107
  this.isOpen = data;
96
- });
108
+ };
109
+ Bus.on("toggleLeftSide", this.__toggleLeftSideHandler);
97
110
 
98
111
  if (window.innerWidth < 1024) {
99
112
  this.isOpen = false;
100
113
 
101
- document.addEventListener("click", function () {
114
+ this.__docClickHandler = () => {
102
115
  Bus.emit("toggleLeftSide", false);
103
- });
116
+ };
117
+ document.addEventListener("click", this.__docClickHandler);
104
118
  }
105
119
  },
106
120
  created: function () {
package/src/Main.vue CHANGED
@@ -33,9 +33,16 @@ export default {
33
33
  },
34
34
  methods: {},
35
35
  mounted: function () {
36
- Bus.on("toggleLeftSide", (data) => {
36
+ this.__toggleLeftSideHandler = (data) => {
37
37
  this.expanding = !data;
38
- });
38
+ };
39
+ Bus.on("toggleLeftSide", this.__toggleLeftSideHandler);
40
+ },
41
+ beforeUnmount() {
42
+ if (this.__toggleLeftSideHandler) {
43
+ Bus.off("toggleLeftSide", this.__toggleLeftSideHandler);
44
+ this.__toggleLeftSideHandler = null;
45
+ }
39
46
  },
40
47
  created: function () {
41
48
  this.expanding = this.withoutLeft === undefined ? false : !!this.withoutLeft;
@@ -9,7 +9,7 @@
9
9
  class="c-sidebar-right-toggle"
10
10
  :class="!isOpen && 'close-sidebar-right'"
11
11
  @click="toggleRightSide"
12
- :title="isOpen ? '收起侧边栏' : '打开侧边栏'"
12
+ :title="isOpen ? $jx3boxT('jx3boxUi.rightSidebar.collapse', '收起侧边栏') : $jx3boxT('jx3boxUi.rightSidebar.expand', '打开侧边栏')"
13
13
  >
14
14
  <el-icon>
15
15
  <ArrowLeft v-show="!isOpen" />
@@ -23,8 +23,10 @@
23
23
  <script>
24
24
  import { isApp } from "../assets/js/app.js";
25
25
  import Bus from "../utils/bus";
26
+ import i18nMixin from "../i18n/mixin";
26
27
  export default {
27
28
  name: "RightSidebar",
29
+ mixins: [i18nMixin],
28
30
  props: {
29
31
  // 展示收起按钮
30
32
  showToggle: {
@@ -45,14 +47,21 @@ export default {
45
47
  },
46
48
  },
47
49
  mounted: function () {
48
- Bus.on("toggleRightSide", (data) => {
50
+ this.__toggleRightSideHandler = (data) => {
49
51
  this.isOpen = data;
50
- });
52
+ };
53
+ Bus.on("toggleRightSide", this.__toggleRightSideHandler);
51
54
 
52
55
  if (window.innerWidth <= 1440) {
53
56
  this.isOpen = false;
54
57
  }
55
58
  },
59
+ beforeUnmount() {
60
+ if (this.__toggleRightSideHandler) {
61
+ Bus.off("toggleRightSide", this.__toggleRightSideHandler);
62
+ this.__toggleRightSideHandler = null;
63
+ }
64
+ },
56
65
  };
57
66
  </script>
58
67