@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
@@ -2,7 +2,7 @@
2
2
  <div class="c-author-medals" v-if="ready">
3
3
  <div class="u-label">
4
4
  <img svg-inline src="../../assets/img/leftsidebar/medal.svg" />
5
- <span>作者荣誉</span>
5
+ <span>{{ $jx3boxT("jx3boxUi.authorMedals.title", "作者荣誉") }}</span>
6
6
  </div>
7
7
  <div class="u-medals" v-if="medals && medals.length">
8
8
  <el-tooltip
@@ -26,10 +26,12 @@ import * as utilModule from "@jx3box/jx3box-common/js/utils";
26
26
  const { getMedalLink } = utilModule;
27
27
  import { getUserMedals } from "../../service/author";
28
28
  import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
29
+ import i18nMixin from "../../i18n/mixin";
29
30
  const { __cdn, __Root } = JX3BOX;
30
31
 
31
32
  export default {
32
33
  name: "AuthorMedals",
34
+ mixins: [i18nMixin],
33
35
  props: ["uid"],
34
36
  components: {},
35
37
  data: function () {
@@ -74,10 +76,11 @@ export default {
74
76
  .u-medals {
75
77
  display: flex;
76
78
  flex-wrap: wrap;
79
+ gap:5px;
80
+ margin-top: 5px;
77
81
  }
78
82
  .u-medal {
79
83
  cursor: pointer;
80
- .mr(2px);
81
84
  .u-medal-img {
82
85
  width: 20px;
83
86
  height: 20px;
@@ -2,7 +2,7 @@
2
2
  <div class="c-author-posts" v-if="ready">
3
3
  <div class="u-label">
4
4
  <img svg-inline src="../../assets/img/leftsidebar/post.svg" />
5
- <span>最新作品</span>
5
+ <span>{{ $jx3boxT("jx3boxUi.authorPosts.latest", "最新作品") }}</span>
6
6
  <a :href="authorLink(uid)" class="u-more" target="_blank"
7
7
  ><img svg-inline src="../../assets/img/leftsidebar/more.svg"
8
8
  /></a>
@@ -11,8 +11,11 @@
11
11
  <ul class="u-list" v-if="data && data.length">
12
12
  <li v-for="(item, i) in data" :key="i">
13
13
  <a class="u-item" :href="url(item.ID, item.post_type)" target="_blank">
14
- <img svg-inline src="../../assets/img/leftsidebar/arrow.svg" class="u-icon" />
15
- <span class="u-title">{{ item.post_title || item.post_type + "/无标题" }}</span>
14
+ <!-- <i class="u-icon">+</i> -->
15
+ <span class="u-title">{{
16
+ item.post_title ||
17
+ $jx3boxT("jx3boxUi.authorPosts.noTitle", "{type}/无标题", { type: item.post_type })
18
+ }}</span>
16
19
  </a>
17
20
  </li>
18
21
  </ul>
@@ -22,8 +25,10 @@
22
25
  <script>
23
26
  import { authorLink, getLink } from "@jx3box/jx3box-common/js/utils";
24
27
  import { getUserPosts } from "../../service/author";
28
+ import i18nMixin from "../../i18n/mixin";
25
29
  export default {
26
30
  name: "AuthorPosts",
31
+ mixins: [i18nMixin],
27
32
  props: ["uid"],
28
33
  data: function () {
29
34
  return {
@@ -66,35 +71,48 @@ export default {
66
71
  ul {
67
72
  list-style: none;
68
73
  margin: 0;
69
- padding: 0;
74
+ padding: 0 0 0 10px;
70
75
  }
71
76
  li {
72
- .db;
77
+ // .db;
78
+ &::marker {
79
+ content: "+";
80
+ font-size: 10px;
81
+ color:#999;
82
+ }
83
+ list-style-position: outside;
73
84
  }
74
85
  .u-item {
75
- .flex;
76
- align-items: center;
86
+ // display: flex;
87
+ // align-items: center;
88
+ display: block;
77
89
  gap: 5px;
78
- padding: 3px 2px;
90
+ padding: 3px 2px 3px 5px;
79
91
  .nobreak;
80
92
  .fz(12px,2);
81
93
  color: #666;
82
- border-bottom: 1px solid transparent;
94
+ // border-bottom: 1px solid transparent;
83
95
  &:hover {
84
- color: @pink;
85
- .u-icon {
86
- transform: translateX(5px);
87
- }
96
+ color: @color;
97
+ .underline(@color);
98
+ font-weight: 500;
99
+ // .u-icon {
100
+ // transform: translateX(5px);
101
+ // }
88
102
  }
89
103
  }
90
104
  .u-icon {
91
105
  .fz(12px);
92
106
  .size(12px);
107
+ .pr;
108
+ top: -1px;
93
109
  // .y;
94
110
  color: #999;
95
111
  flex: 0 0 auto;
96
112
  // .mr(5px);
97
113
  transition: all 0.3s;
114
+ font-style: normal;
115
+ margin-right: 8px;
98
116
  }
99
117
  .u-title {
100
118
  flex: 1 1 auto;
@@ -17,8 +17,10 @@
17
17
  import { getAuthorRss, subscribeAuthor, unsubscribeAuthor } from "@jx3box/jx3box-common/js/rss";
18
18
  import User from "@jx3box/jx3box-common/js/user";
19
19
  const jx3box = require("@jx3box/jx3box-common/data/jx3box.json");
20
+ import i18nMixin from "../../i18n/mixin";
20
21
  export default {
21
22
  name: "AuthorRss",
23
+ mixins: [i18nMixin],
22
24
  props: {
23
25
  uid: {
24
26
  type: Number,
@@ -38,7 +40,9 @@ export default {
38
40
  },
39
41
  computed: {
40
42
  btnText() {
41
- return this.subscribed ? "已关注" : "关注";
43
+ return this.subscribed
44
+ ? this.$jx3boxT("jx3boxUi.authorRss.followed", "已关注")
45
+ : this.$jx3boxT("jx3boxUi.authorRss.follow", "关注");
42
46
  },
43
47
  btnType() {
44
48
  return !this.subscribed ? "info" : "warning";
@@ -82,7 +86,7 @@ export default {
82
86
  subscribeAuthor({ id: this.uid, data: { title: this.data?.display_name } })
83
87
  .then(() => {
84
88
  this.subscribed = true;
85
- this.$message.success("关注成功");
89
+ this.$message.success(this.$jx3boxT("jx3boxUi.authorRss.followSuccess", "关注成功"));
86
90
  })
87
91
  .catch((err) => {
88
92
  console.log(err);
@@ -98,7 +102,7 @@ export default {
98
102
  // }).then(() => {
99
103
  unsubscribeAuthor({ id: this.uid })
100
104
  .then(() => {
101
- this.$message.success("操作成功");
105
+ this.$message.success(this.$jx3boxT("jx3boxUi.authorRss.success", "操作成功"));
102
106
  this.subscribed = false;
103
107
  })
104
108
  .catch((err) => {
@@ -2,7 +2,7 @@
2
2
  <div class="c-author-teams" v-if="ready">
3
3
  <div class="u-label">
4
4
  <img svg-inline src="../../assets/img/leftsidebar/united.svg" />
5
- <span>所在团队</span>
5
+ <span>{{ $jx3boxT("jx3boxUi.authorTeams.title", "所在团队") }}</span>
6
6
  </div>
7
7
  <div class="u-teams">
8
8
  <el-tooltip
@@ -25,9 +25,11 @@
25
25
  <script>
26
26
  import { getLink, getThumbnail } from "@jx3box/jx3box-common/js/utils";
27
27
  import { getUserPublicTeams } from "../../service/author";
28
+ import i18nMixin from "../../i18n/mixin";
28
29
 
29
30
  export default {
30
31
  name: "AuthorTeams",
32
+ mixins: [i18nMixin],
31
33
  props: ["uid"],
32
34
  components: {},
33
35
  data: function () {
@@ -12,14 +12,16 @@
12
12
  <div class="u-input">
13
13
  <el-input
14
14
  v-model.trim.lazy="search"
15
- placeholder="请输入用户 UID 或者昵称进行搜索"
15
+ :placeholder="$jx3boxT('jx3boxUi.userPop.placeholder', '请输入用户 UID 或者昵称进行搜索')"
16
16
  @keydown.enter="onSearch"
17
17
  >
18
18
  <template #prepend>
19
19
  <el-icon><Search /></el-icon>
20
20
  </template>
21
21
  </el-input>
22
- <el-button class="u-search-btn" type="primary" @click="onSearch" :disabled="!search">搜索</el-button>
22
+ <el-button class="u-search-btn" type="primary" @click="onSearch" :disabled="!search">{{
23
+ $jx3boxT("jx3boxUi.userPop.search", "搜索")
24
+ }}</el-button>
23
25
  </div>
24
26
  <div class="u-preview" v-loading="loading">
25
27
  <template v-if="searched && status">
@@ -32,14 +34,18 @@
32
34
  <img class="u-avatar" :src="showAvatar('')" />
33
35
  <span class="u-name">-</span>
34
36
  <div class="u-empty">
35
- <el-icon><Warning /></el-icon>{{ searched ? "未找到匹配项" : "请输入搜索条件" }}
37
+ <el-icon><Warning /></el-icon>{{
38
+ searched
39
+ ? $jx3boxT("jx3boxUi.userPop.notFound", "未找到匹配项")
40
+ : $jx3boxT("jx3boxUi.userPop.empty", "请输入搜索条件")
41
+ }}
36
42
  </div>
37
43
  </template>
38
44
  </div>
39
45
  <template #footer>
40
46
  <div class="dialog-footer">
41
- <el-button @click="cancel">取 消</el-button>
42
- <el-button type="primary" @click="confirm">确 定</el-button>
47
+ <el-button @click="cancel">{{ $jx3boxT("jx3boxUi.common.cancel", "取消") }}</el-button>
48
+ <el-button type="primary" @click="confirm">{{ $jx3boxT("jx3boxUi.common.confirm", "确定") }}</el-button>
43
49
  </div>
44
50
  </template>
45
51
  </el-dialog>
@@ -49,9 +55,20 @@
49
55
  import * as utilModule from "@jx3box/jx3box-common/js/utils";
50
56
  const { showAvatar } = utilModule;
51
57
  import { getUserInfoByUidOrName } from "../../service/author";
58
+ import i18nMixin from "../../i18n/mixin";
52
59
  export default {
53
60
  name: "UserPop",
54
- props: ["title", "show"],
61
+ mixins: [i18nMixin],
62
+ props: {
63
+ title: {
64
+ type: String,
65
+ default: "",
66
+ },
67
+ modelValue: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+ },
55
72
  data: function () {
56
73
  return {
57
74
  visible: false,
@@ -66,16 +83,13 @@ export default {
66
83
  loading: false,
67
84
  };
68
85
  },
69
- model: {
70
- prop: "show",
71
- event: "switchUserPop",
72
- },
86
+ emits: ["update:modelValue", "confirm"],
73
87
  watch: {
74
- show: function (val) {
88
+ modelValue: function (val) {
75
89
  this.visible = val;
76
90
  },
77
91
  visible: function (val) {
78
- this.$emit("switchUserPop", val);
92
+ this.$emit("update:modelValue", val);
79
93
  },
80
94
  },
81
95
  methods: {
@@ -84,8 +98,8 @@ export default {
84
98
  this.visible = false;
85
99
  this.$emit("confirm", this.userdata);
86
100
  } else {
87
- this.$alert("用户不存在 或 UID不正确", "提醒", {
88
- confirmButtonText: "确定",
101
+ this.$alert(this.$jx3boxT("jx3boxUi.userPop.invalid", "用户不存在 或 UID不正确"), this.$jx3boxT("jx3boxUi.userPop.alertTitle", "提醒"), {
102
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
89
103
  });
90
104
  }
91
105
  },
@@ -142,9 +156,7 @@ export default {
142
156
  .el-dialog {
143
157
  min-width: 520px;
144
158
  }
145
- .el-dialog__body {
146
- padding: 0 20px;
147
- }
159
+
148
160
  .u-avatar {
149
161
  .mt(20px);
150
162
  .size(120px);
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <el-drawer
3
3
  class="c-admin"
4
- title="管理面板"
4
+ :title="$jx3boxT('jx3boxUi.admin.title', '管理面板')"
5
5
  v-model="dialog_visible"
6
6
  :before-close="close"
7
7
  append-to-body
@@ -11,40 +11,50 @@
11
11
  >
12
12
  <div class="c-admin-wrapper" ref="adminDrawer">
13
13
  <!-- <template v-if="isAdmin"> -->
14
- <el-divider content-position="left">状态变更</el-divider>
15
- <el-radio-group v-model="post_status" class="c-admin-status">
16
- <el-radio-button v-for="(option, key) in status_options" :value="key" :key="key">{{
17
- option
18
- }}</el-radio-button>
19
- </el-radio-group>
20
- <el-button type="primary" class="u-refresh-btn" @click="onRefreshCache">刷新缓存</el-button>
14
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.admin.status", "状态变更") }}</el-divider>
15
+ <div class="m-status-op">
16
+ <el-radio-group v-model="post_status" class="c-admin-status">
17
+ <el-radio-button v-for="(option, key) in status_options" :value="key" :key="key">{{
18
+ option
19
+ }}</el-radio-button>
20
+ </el-radio-group>
21
+ <el-button type="primary" class="u-refresh-btn" @click="onRefreshCache">{{
22
+ $jx3boxT("jx3boxUi.admin.refreshCache", "刷新缓存")
23
+ }}</el-button>
24
+ </div>
21
25
  <!-- </template> -->
22
26
 
23
- <el-divider content-position="left">可见性变更</el-divider>
27
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.admin.visible", "可见性变更") }}</el-divider>
24
28
  <el-radio-group v-model="visible" class="c-admin-status">
25
29
  <el-radio-button v-for="(option, key) in visible_options" :value="key" :key="key">{{
26
30
  option
27
31
  }}</el-radio-button>
28
32
  </el-radio-group>
29
33
 
30
- <el-divider content-position="left">推荐角标</el-divider>
34
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.admin.mark", "推荐角标") }}</el-divider>
31
35
  <el-checkbox-group v-model="mark" class="c-admin-mark">
32
36
  <el-checkbox v-for="(option, key) in mark_options" :value="key" :key="key">{{ option }}</el-checkbox>
33
37
  </el-checkbox-group>
34
38
 
35
- <el-divider content-position="left">高亮置顶</el-divider>
36
- <el-checkbox class="c-admin-highlight-checkbox" v-model="isSticky">置顶</el-checkbox>
37
- <el-checkbox class="c-admin-highlight-checkbox" v-model="isHighlight">开启高亮</el-checkbox>
39
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.admin.highlight", "高亮置顶") }}</el-divider>
40
+ <el-checkbox class="c-admin-highlight-checkbox" v-model="isSticky">{{
41
+ $jx3boxT("jx3boxUi.admin.sticky", "置顶")
42
+ }}</el-checkbox>
43
+ <el-checkbox class="c-admin-highlight-checkbox" v-model="isHighlight">{{
44
+ $jx3boxT("jx3boxUi.admin.enableHighlight", "开启高亮")
45
+ }}</el-checkbox>
38
46
  <template v-if="isHighlight">
39
47
  <el-color-picker
40
48
  class="c-admin-highlight-block"
41
49
  v-model="color"
42
50
  :predefine="color_options"
43
51
  ></el-color-picker>
44
- <span class="c-admin-highlight-preview" :style="{ color: color }">预览高亮效果</span>
52
+ <span class="c-admin-highlight-preview" :style="{ color: color }">{{
53
+ $jx3boxT("jx3boxUi.admin.previewHighlight", "预览高亮效果")
54
+ }}</span>
45
55
  </template>
46
56
 
47
- <el-divider content-position="left">封面海报</el-divider>
57
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.admin.banner", "封面海报") }}</el-divider>
48
58
  <div class="c-admin-banner">
49
59
  <el-upload
50
60
  class="c-admin-upload el-upload--picture-card"
@@ -59,25 +69,25 @@
59
69
  </el-upload>
60
70
  <el-input class="u-banner" v-model="post_banner">
61
71
  <template #prepend>
62
- <span>海报地址</span>
72
+ <span>{{ $jx3boxT("jx3boxUi.admin.bannerUrl", "海报地址") }}</span>
63
73
  </template>
64
74
  <template #append>
65
75
  <span>
66
76
  <span class="u-btn" @click="removeBanner">
67
- <el-icon><CircleClose /></el-icon> 移除海报
77
+ <el-icon><CircleClose /></el-icon> {{ $jx3boxT("jx3boxUi.admin.removeBanner", "移除海报") }}
68
78
  </span>
69
79
  </span>
70
80
  </template>
71
81
  </el-input>
72
82
  </div>
73
83
 
74
- <el-divider content-position="left">元信息</el-divider>
84
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.admin.meta", "元信息") }}</el-divider>
75
85
  <div class="c-admin-info">
76
86
  <div class="w-select c-admin-type">
77
- <div class="u-select-label">板块</div>
87
+ <div class="u-select-label">{{ $jx3boxT("jx3boxUi.admin.section", "板块") }}</div>
78
88
  <el-select
79
89
  v-model="post_type"
80
- placeholder="请选择板块"
90
+ :placeholder="$jx3boxT('jx3boxUi.admin.sectionPlaceholder', '请选择板块')"
81
91
  style="width: 100%"
82
92
  class="u-select drawer-item-content"
83
93
  :disabled="appDisabled"
@@ -91,17 +101,21 @@
91
101
  </el-select>
92
102
  </div>
93
103
  <div class="c-admin-author">
94
- <el-input v-model="post_author" placeholder="请输入作者ID" class="input-author drawer-item-content">
104
+ <el-input
105
+ v-model="post_author"
106
+ :placeholder="$jx3boxT('jx3boxUi.admin.authorPlaceholder', '请输入作者ID')"
107
+ class="input-author drawer-item-content"
108
+ >
95
109
  <template #prepend>
96
- <span class="u-keyword">作者ID</span>
110
+ <span class="u-keyword">{{ $jx3boxT("jx3boxUi.admin.authorId", "作者ID") }}</span>
97
111
  </template>
98
112
  </el-input>
99
113
  </div>
100
114
  </div>
101
115
 
102
116
  <div class="c-admin-buttons">
103
- <el-button type="primary" @click="submit" :loading="pushing">提交</el-button>
104
- <el-button plain @click="close">取消</el-button>
117
+ <el-button type="primary" @click="submit" :loading="pushing">{{ $jx3boxT("jx3boxUi.admin.submit", "提交") }}</el-button>
118
+ <el-button plain @click="close">{{ $jx3boxT("jx3boxUi.common.cancel", "取消") }}</el-button>
105
119
  </div>
106
120
  </div>
107
121
  </el-drawer>
@@ -117,11 +131,13 @@ import User from "@jx3box/jx3box-common/js/user";
117
131
  import CMS_MARKS from "@jx3box/jx3box-common/data/mark.json";
118
132
  import { getTopicBucket } from "../../service/cms";
119
133
  import emitter from "../../utils/bus";
134
+ import i18nMixin from "../../i18n/mixin";
120
135
 
121
136
  const { cms: marks } = CMS_MARKS;
122
137
  // import { onClickOutside } from "@vueuse/core";
123
138
  export default {
124
139
  name: "BreadAdmin",
140
+ mixins: [i18nMixin],
125
141
  emits: ["update"],
126
142
  props: {
127
143
  marksOptions: {
@@ -176,10 +192,10 @@ export default {
176
192
  // 状态
177
193
  post_status: "publish",
178
194
  status_options: {
179
- publish: "默认",
180
- draft: "草稿",
181
- pending: "待审核",
182
- dustbin: "删除",
195
+ publish: this.$jx3boxT("jx3boxUi.admin.statusDefault", "默认"),
196
+ draft: this.$jx3boxT("jx3boxUi.admin.statusDraft", "草稿"),
197
+ pending: this.$jx3boxT("jx3boxUi.admin.statusPending", "待审核"),
198
+ dustbin: this.$jx3boxT("jx3boxUi.admin.statusDeleted", "删除"),
183
199
  },
184
200
  visible: "0",
185
201
  visible_options: JX3BOX.__visibleMap,
@@ -276,7 +292,7 @@ export default {
276
292
  this.post_banner = res.data[0];
277
293
  },
278
294
  uploadFail: function (err) {
279
- this.$message.error("上传失败");
295
+ this.$message.error(this.$jx3boxT("jx3boxUi.admin.uploadFailed", "上传失败"));
280
296
  console.log(err);
281
297
  },
282
298
  removeBanner: function () {
@@ -340,7 +356,7 @@ export default {
340
356
  data: this.data,
341
357
  });
342
358
  this.$message({
343
- message: "设置成功",
359
+ message: this.$jx3boxT("jx3boxUi.admin.success", "设置成功"),
344
360
  type: "success",
345
361
  });
346
362
  })
@@ -392,7 +408,7 @@ export default {
392
408
  this.checkChannel();
393
409
 
394
410
  // 绑定监听
395
- Bus.on("toggleAdminPanel", () => {
411
+ this.__toggleAdminPanelHandler = () => {
396
412
  this.dialog_visible = !this.dialog_visible;
397
413
  this.checkPostID();
398
414
  // 文章类型的加载
@@ -403,7 +419,14 @@ export default {
403
419
  if (this.showExtend && this.app && this.dialog_visible) {
404
420
  this.loadTopic();
405
421
  }
406
- });
422
+ };
423
+ Bus.on("toggleAdminPanel", this.__toggleAdminPanelHandler);
424
+ },
425
+ beforeUnmount() {
426
+ if (this.__toggleAdminPanelHandler) {
427
+ Bus.off("toggleAdminPanel", this.__toggleAdminPanelHandler);
428
+ this.__toggleAdminPanelHandler = null;
429
+ }
407
430
  },
408
431
  };
409
432
  </script>
@@ -5,15 +5,17 @@
5
5
  v-if="isEditor"
6
6
  >
7
7
  <el-icon><Message></Message></el-icon>
8
- <span>私信</span>
8
+ <span>{{ $jx3boxT("jx3boxUi.adminDirectMessage.button", "私信") }}</span>
9
9
  </a>
10
10
  </template>
11
11
 
12
12
  <script>
13
13
  import { sendMessage } from "../../service/admin";
14
14
  import User from "@jx3box/jx3box-common/js/user";
15
+ import i18nMixin from "../../i18n/mixin";
15
16
  export default {
16
17
  name: "AdminDirectMessage",
18
+ mixins: [i18nMixin],
17
19
  props: {
18
20
  size: {
19
21
  type: String,
@@ -39,13 +41,16 @@ export default {
39
41
  },
40
42
  methods: {
41
43
  onButtonClick() {
42
- this.$prompt("请输入私信内容", "管理私信", {
43
- confirmButtonText: "确定",
44
- cancelButtonText: "取消",
45
- inputPlaceholder: "请输入私信内容",
44
+ this.$prompt(
45
+ this.$jx3boxT("jx3boxUi.adminDirectMessage.input", "请输入私信内容"),
46
+ this.$jx3boxT("jx3boxUi.adminDirectMessage.title", "管理私信"),
47
+ {
48
+ confirmButtonText: this.$jx3boxT("jx3boxUi.common.confirm", "确定"),
49
+ cancelButtonText: this.$jx3boxT("jx3boxUi.common.cancel", "取消"),
50
+ inputPlaceholder: this.$jx3boxT("jx3boxUi.adminDirectMessage.input", "请输入私信内容"),
46
51
  inputValidator: (value) => {
47
52
  if (!value) {
48
- return "请输入私信内容";
53
+ return this.$jx3boxT("jx3boxUi.adminDirectMessage.input", "请输入私信内容");
49
54
  }
50
55
  },
51
56
  beforeClose: (action, instance, done) => {
@@ -54,12 +59,14 @@ export default {
54
59
  source_id: this.sourceId,
55
60
  source_type: this.sourceType,
56
61
  user_id: this.userId,
57
- content: "运营通知:" + instance.inputValue,
62
+ content:
63
+ this.$jx3boxT("jx3boxUi.adminDirectMessage.noticePrefix", "运营通知:") +
64
+ instance.inputValue,
58
65
  type: "system",
59
66
  subtype: "admin_message"
60
67
  };
61
68
  sendMessage(data).then(() => {
62
- this.$message.success("私信成功");
69
+ this.$message.success(this.$jx3boxT("jx3boxUi.adminDirectMessage.success", "私信成功"));
63
70
  done();
64
71
  })
65
72
  } else {