@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
@@ -0,0 +1,527 @@
1
+ <template>
2
+ <el-drawer
3
+ class="c-admin c-community-admin"
4
+ title="管理面板"
5
+ v-model="show"
6
+ :before-close="close"
7
+ :append-to-body="true"
8
+ :modal="false"
9
+ :withHeader="false"
10
+ :close-on-click-modal="true"
11
+ >
12
+ <div class="c-admin-wrapper c-community-wrapper">
13
+ <el-divider content-position="left">信息设置</el-divider>
14
+ <div class="c-admin-extend">
15
+ <el-input
16
+ v-model="form.title"
17
+ placeholder="请输入标题"
18
+ class="input-author drawer-item-content"
19
+ >
20
+ <template #prepend>
21
+ <el-select
22
+ v-model="form.category"
23
+ style="width: 140px"
24
+ filterable
25
+ placeholder="请选择"
26
+
27
+ >
28
+ <el-option
29
+ v-for="item in categoryList"
30
+ :value="item.mark"
31
+ :label="item.name"
32
+ :key="item.name"
33
+ >
34
+ </el-option>
35
+ </el-select>
36
+ </template>
37
+ <template #append>
38
+ <el-button icon="Edit" @click="onEdit"></el-button>
39
+ </template>
40
+ </el-input>
41
+ </div>
42
+ <div class="c-admin-extend m-community-tag">
43
+ <div class="w-select">
44
+ <span class="u-select-label">标签</span>
45
+ <el-select
46
+ v-model="form.tags"
47
+ multiple
48
+ filterable
49
+ allow-create
50
+ default-first-option
51
+ placeholder="请选择"
52
+ clearable
53
+
54
+ @change="onTagChange"
55
+ >
56
+ <el-option v-for="item in tags" :value="item.label" :label="item.label" :key="item.label">
57
+ </el-option>
58
+ </el-select>
59
+ </div>
60
+ <div class="m-community-tag__content">
61
+ <template v-if="finalTags && finalTags.length">
62
+ <div class="m-community-tag__list" v-for="item in finalTags" :key="item.uuid">
63
+ <el-input v-model="item.label" ></el-input>
64
+ <el-color-picker v-model="item.color" :predefine="color_options"></el-color-picker>
65
+ </div>
66
+ </template>
67
+ <el-alert title="暂未设置标签" v-else type="info" show-icon :closable="false"></el-alert>
68
+ </div>
69
+ </div>
70
+ <div class="c-admin-extend">
71
+ <el-input
72
+ v-model="form.user_id"
73
+ placeholder="请输入作者ID"
74
+ class="input-author drawer-item-content"
75
+
76
+ >
77
+ <template #prepend>
78
+ <span class="u-keyword">作者ID</span>
79
+ </template>
80
+ <template #append>
81
+ <a class="m-user" :href="authorLink(userInfo.ID)" target="_blank">
82
+ <el-avatar class="u-avatar" size="small" :src="userInfo.user_avatar" />
83
+ {{ userInfo.display_name || "匿名" }}
84
+ </a>
85
+ </template>
86
+ </el-input>
87
+ </div>
88
+
89
+ <el-divider content-position="left">封面海报</el-divider>
90
+ <div class="c-admin-banner">
91
+ <el-upload
92
+ class="c-admin-upload"
93
+ :action="uploadurl"
94
+ :with-credentials="true"
95
+ :show-file-list="false"
96
+ :on-success="uploadSuccess"
97
+ :on-error="uploadFail"
98
+ >
99
+ <img v-if="post_banner" :src="post_banner" />
100
+ <el-icon><Plus></Plus></el-icon>
101
+ </el-upload>
102
+ <el-input class="u-banner" v-model="post_banner" >
103
+ <template #prepend>海报地址</template>
104
+ <template #append>
105
+ <span class="u-btn" @click="removeBanner">
106
+ <el-icon><CircleClose></CircleClose></el-icon> 移除海报
107
+ </span>
108
+ </template>
109
+ </el-input>
110
+ </div>
111
+
112
+ <el-divider content-position="left">高亮置顶</el-divider>
113
+
114
+ <p class="c-admin-space">
115
+ <span class="c-admin-label">置顶:</span>
116
+ <el-checkbox-group v-model="topStatus" class="c-admin-status">
117
+ <el-checkbox value="is_top">全局置顶</el-checkbox>
118
+ <el-checkbox value="is_category_top">版内置顶</el-checkbox>
119
+ </el-checkbox-group>
120
+ </p>
121
+ <p class="c-admin-space">
122
+ <span class="c-admin-label">精选:</span>
123
+ <el-switch v-model="form.is_star" :active-value="1" :inactive-value="0" />
124
+ </p>
125
+
126
+ <p class="c-admin-space">
127
+ <span class="c-admin-label">高亮:</span>
128
+ <el-switch v-model="form.is_hight" :active-value="1" :inactive-value="0" />
129
+ <span v-show="showColors">
130
+ <el-color-picker
131
+ class="c-admin-highlight-block"
132
+ v-model="form.hight_color"
133
+ :predefine="color_options"
134
+ ></el-color-picker>
135
+ <span class="c-admin-highlight-preview" :style="{ color: color }" style="margin-right: 10px">
136
+ 预览高亮效果
137
+ </span>
138
+ </span>
139
+ </p>
140
+ </div>
141
+ <template #footer>
142
+ <div class="c-community-buttons">
143
+ <div class="c-community-buttons_left">
144
+ <el-button type="danger" class="u-delete" icon="Delete" @click="deleteTopic">删除帖子</el-button>
145
+ <el-button type="warning" class="u-check" icon="RefreshLeft" @click="handleCheck"
146
+ >转为待审核</el-button
147
+ >
148
+ </div>
149
+ <div class="c-community-buttons_right">
150
+ <el-button type="primary" @click="submit" :loading="pushing">提交</el-button>
151
+ <el-button plain @click="close">取消</el-button>
152
+ </div>
153
+ </div>
154
+ </template>
155
+ </el-drawer>
156
+ </template>
157
+
158
+ <script>
159
+ import {
160
+ auditTopic,
161
+ deleteTopic,
162
+ getCommunityTags,
163
+ getTopicBucket,
164
+ getTopicDetails,
165
+ updateTopicItem,
166
+ manageTopicAll,
167
+ } from "../../service/community";
168
+ import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
169
+ import { getUserInfo } from "../../service/author";
170
+ import { debounce } from "lodash";
171
+ import { authorLink } from "@jx3box/jx3box-common/js/utils";
172
+ const { __cms } = JX3BOX;
173
+
174
+ export default {
175
+ name: "CommunityAdmin",
176
+ props: {
177
+ modelValue: {
178
+ type: Boolean,
179
+ default: false,
180
+ },
181
+ postId: {
182
+ type: [Number, String],
183
+ default: 0,
184
+ },
185
+ },
186
+ emits: ["update:modelValue"],
187
+ data() {
188
+ return {
189
+ tags: [],
190
+ topStatus: [],
191
+ post: null,
192
+ pushing: false,
193
+ categoryList: [],
194
+ color: "rgb(255,0,1)",
195
+ color_options: [
196
+ "rgb(255,0,1)",
197
+ "rgb(2,209,248)",
198
+ "rgb(147,217,25)",
199
+ "rgb(255,154,2)",
200
+ "rgb(255,44,142)",
201
+ "rgb(142,46,255)",
202
+ ],
203
+ form: {
204
+ category: "",
205
+ tags: [],
206
+ is_top: 0,
207
+ is_star: 0,
208
+ is_hight: 0,
209
+ is_category_top: 0,
210
+ hight_color: "rgb(255,0,1)",
211
+ user_id: "",
212
+ },
213
+
214
+ finalTags: [],
215
+
216
+ // 海报
217
+ uploadurl: __cms + "api/cms/upload",
218
+ banner_preview: "",
219
+ post_banner: "",
220
+
221
+ userInfo: {},
222
+
223
+ show: false,
224
+ };
225
+ },
226
+ computed: {
227
+ data: function () {
228
+ return {};
229
+ },
230
+ showColors() {
231
+ return this.form.is_hight;
232
+ },
233
+ },
234
+ watch: {
235
+ modelValue: async function (val) {
236
+ if (val) {
237
+ this.show = true;
238
+ await this.getCategoryList();
239
+ await this.getCommunityTags();
240
+ await this.getTopicDetails();
241
+ }
242
+ },
243
+ "form.user_id": debounce(function (id) {
244
+ id &&
245
+ getUserInfo(id).then((res) => {
246
+ this.userInfo = res || {};
247
+ });
248
+ }, 500),
249
+ show(val) {
250
+ this.$emit("update:modelValue", val);
251
+ },
252
+ },
253
+ methods: {
254
+ authorLink,
255
+ handleCheck() {
256
+ const id = this.post.id;
257
+ if (!id) {
258
+ this.$message.error("ID不存在!");
259
+ return;
260
+ }
261
+ this.$confirm(`此操作将该数据转为【待审核】状态, 是否继续?`, "提示", {
262
+ confirmButtonText: "确定",
263
+ cancelButtonText: "取消",
264
+ type: "warning",
265
+ }).then(() => {
266
+ auditTopic(id, "wait").then(() => {
267
+ this.$message({
268
+ type: "success",
269
+ message: "操作成功!",
270
+ });
271
+ this.show = false;
272
+ window.location.href = "/community";
273
+ });
274
+ });
275
+ },
276
+ async submit() {
277
+ const id = this.post.id;
278
+ if (!id) {
279
+ this.$message.error("ID不存在!");
280
+ return;
281
+ }
282
+
283
+ const promises = [];
284
+
285
+ promises.push(
286
+ updateTopicItem(id, {
287
+ ...this.post,
288
+ user_id: Number(this.form.user_id),
289
+ title: this.form.title,
290
+ category: this.form.category,
291
+ banner_img: this.post_banner,
292
+ })
293
+ );
294
+
295
+ promises.push(
296
+ manageTopicAll(id, {
297
+ is_top: this.topStatus.includes("is_top") ? 1 : 0,
298
+ is_category_top: this.topStatus.includes("is_category_top") ? 1 : 0,
299
+ is_star: this.form.is_star,
300
+ is_hight: this.form.is_hight,
301
+ hight_color: this.form.hight_color,
302
+ color_tag: this.finalTags,
303
+ })
304
+ );
305
+
306
+ Promise.all(promises).then(() => {
307
+ this.$message({
308
+ type: "success",
309
+ message: "操作成功!",
310
+ });
311
+ this.show = false;
312
+ location.reload();
313
+ });
314
+ },
315
+ getCommunityTags() {
316
+ getCommunityTags().then((tags) => {
317
+ this.tags = tags;
318
+ });
319
+ },
320
+ // 关闭
321
+ close() {
322
+ this.form = {
323
+ category: "",
324
+ tags: [],
325
+ is_top: 0,
326
+ is_star: 0,
327
+ is_hight: 0,
328
+ };
329
+ this.isTopStatus = [];
330
+ this.$nextTick(() => {
331
+ this.show = false;
332
+ });
333
+ },
334
+ getCategoryList() {
335
+ getTopicBucket({ type: "community" }).then((res) => {
336
+ this.categoryList = res.data.data;
337
+ });
338
+ },
339
+ deleteTopic() {
340
+ const id = this.post.id;
341
+ if (!id) {
342
+ this.$message.error("ID不存在!");
343
+ return;
344
+ }
345
+ this.$confirm("此操作将【删除】该数据, 是否继续?", "提示", {
346
+ confirmButtonText: "确定",
347
+ cancelButtonText: "取消",
348
+ type: "warning",
349
+ }).then(() => {
350
+ deleteTopic(id).then(() => {
351
+ this.$message({
352
+ type: "success",
353
+ message: "删除成功!",
354
+ });
355
+ this.show = false;
356
+ window.location.href = "/community";
357
+ });
358
+ });
359
+ },
360
+ getTopicDetails() {
361
+ getTopicDetails(this.postId).then((res) => {
362
+ this.post = res.data.data;
363
+ this.form = {
364
+ ...this.form,
365
+ is_hight: this.post.is_hight,
366
+ category: this.post.category,
367
+ is_top: this.post.is_top,
368
+ is_star: this.post.is_star,
369
+ is_category_top: this.post.is_category_top,
370
+ user_id: this.post.user_id,
371
+ title: this.post.title,
372
+ hight_color: this.post.hight_color,
373
+ tags: this.post?.color_tag?.map((item) => item.label) || [],
374
+ };
375
+
376
+ this.finalTags = this.post.color_tag;
377
+ this.topStatus = [];
378
+ this.post_banner = this.post.banner_img;
379
+ if (this.post.is_top) {
380
+ this.topStatus.push("is_top");
381
+ }
382
+ if (this.post.is_category_top) {
383
+ this.topStatus.push("is_category_top");
384
+ }
385
+ });
386
+ },
387
+ onTagChange() {
388
+ const tags = this.form.tags.map((item) => {
389
+ const tag = this.tags.find((tag) => tag.label === item);
390
+
391
+ if (tag) {
392
+ return tag;
393
+ }
394
+
395
+ return {
396
+ label: item,
397
+ color: "rgb(255,0,1)",
398
+ };
399
+ });
400
+ this.finalTags = tags;
401
+ },
402
+ // 上传
403
+ uploadSuccess: function (res, file, list) {
404
+ this.banner_preview = URL.createObjectURL(file.raw);
405
+ this.post_banner = res.data[0];
406
+ },
407
+ uploadFail: function (err, file, fileList) {
408
+ this.$message.error("上传失败");
409
+ console.log(err);
410
+ },
411
+ removeBanner: function () {
412
+ this.post_banner = "";
413
+ },
414
+ onEdit() {
415
+ window.open(`/publish/#/community/${this.postId}?from=admin`, "_blank");
416
+ },
417
+ },
418
+ };
419
+ </script>
420
+
421
+ <style lang="less">
422
+ @import "../../assets/css/bread/admin.less";
423
+ .c-community-admin {
424
+ .c-admin-space {
425
+ .flex;
426
+ align-items: center;
427
+ flex-wrap: wrap;
428
+ height: 28px;
429
+ gap: 4px;
430
+ margin: 1em 0;
431
+ }
432
+ .c-admin-label {
433
+ font-size: 14px;
434
+ font-weight: 500;
435
+ }
436
+
437
+ .c-community-wrapper {
438
+ // height: 100%;
439
+ }
440
+ .c-community-buttons {
441
+ .flex;
442
+ justify-content: space-between;
443
+ align-items: center;
444
+ .pa;
445
+ width: calc(100% - 40px);
446
+ bottom: 20px;
447
+ }
448
+ .c-admin-extend {
449
+ margin-top: 10px;
450
+ }
451
+ .el-input-group__prepend {
452
+ text-align: center;
453
+ min-width: 62px;
454
+ box-sizing: border-box;
455
+ }
456
+
457
+ .m-community-tag {
458
+ margin-top: 10px;
459
+
460
+ .u-select-label {
461
+ border-bottom-left-radius: 0;
462
+ height: 32px;
463
+ line-height: 32px;
464
+ }
465
+ .el-select__wrapper {
466
+ border-bottom-right-radius: 0;
467
+ }
468
+ }
469
+
470
+ .m-community-tag__content {
471
+ border: 1px solid #dcdfe6;
472
+ border-top: none;
473
+ padding: 10px;
474
+ }
475
+
476
+ .m-community-tag__list {
477
+ .flex;
478
+ align-items: center;
479
+ gap: 10px;
480
+
481
+ &:not(:last-child) {
482
+ margin-bottom: 10px;
483
+ }
484
+ }
485
+
486
+ .u-title-condition {
487
+ .flex;
488
+ .el-select {
489
+ margin-left: 0 !important;
490
+ top: 10px;
491
+ left: -10px;
492
+ }
493
+ }
494
+ .m-user {
495
+ .flex;
496
+ align-items: center;
497
+ gap: 5px;
498
+ }
499
+
500
+ .u-banner {
501
+ .u-btn {
502
+ .flex;
503
+ align-items: center;
504
+ gap: 4px;
505
+ cursor: pointer;
506
+ }
507
+ }
508
+ }
509
+
510
+ @media screen and (max-width: @phone) {
511
+ .c-community-admin {
512
+ .c-community-buttons {
513
+ width: 100%;
514
+ justify-content: space-between;
515
+ .pr;
516
+ bottom: 0;
517
+ }
518
+
519
+ .u-delete,
520
+ .u-check {
521
+ span {
522
+ display: none !important;
523
+ }
524
+ }
525
+ }
526
+ }
527
+ </style>
@@ -4,54 +4,60 @@
4
4
  :width="isPhone ? '95%' : '600px'"
5
5
  :model-value="modelValue"
6
6
  @close="close"
7
- title="快捷推送"
7
+ :title="$jx3boxT('jx3boxUi.designTask.title', '快捷推送')"
8
8
  append-to-body
9
9
  >
10
10
  <el-form :model="form" ref="form" :label-position="isPhone ? 'top' : 'left'" label-width="80px">
11
- <el-form-item label="标题">
12
- <el-input v-model="form.title" placeholder="请输入标题"></el-input>
11
+ <el-form-item :label="$jx3boxT('jx3boxUi.designTask.formTitle', '标题')">
12
+ <el-input v-model="form.title" :placeholder="$jx3boxT('jx3boxUi.designTask.titlePlaceholder', '请输入标题')"></el-input>
13
13
  </el-form-item>
14
- <el-form-item label="类型">
15
- <el-select v-model="form.type" placeholder="请选择类型" style="width: 100%" filterable>
14
+ <el-form-item :label="$jx3boxT('jx3boxUi.designTask.formType', '类型')">
15
+ <el-select v-model="form.type" :placeholder="$jx3boxT('jx3boxUi.designTask.typePlaceholder', '请选择类型')" style="width: 100%" filterable>
16
16
  <el-option v-for="item in config" :key="item.id" :label="item.label" :value="item.name"></el-option>
17
17
  </el-select>
18
18
  </el-form-item>
19
- <el-form-item label="版本">
19
+ <el-form-item :label="$jx3boxT('jx3boxUi.designTask.formVersion', '版本')">
20
20
  <el-radio-group v-model="form.version">
21
21
  <el-radio-button v-for="(label, key) in versions" :key="key" :value="key">{{
22
22
  label
23
23
  }}</el-radio-button>
24
24
  </el-radio-group>
25
25
  </el-form-item>
26
- <el-form-item label="备注">
27
- <el-input v-model="form.remark" placeholder="请输入备注"></el-input>
26
+ <el-form-item :label="$jx3boxT('jx3boxUi.designTask.formRemark', '备注')">
27
+ <el-input v-model="form.remark" :placeholder="$jx3boxT('jx3boxUi.designTask.remarkPlaceholder', '请输入备注')"></el-input>
28
28
  </el-form-item>
29
- <el-form-item label="星级" class="m-star-line">
29
+ <el-form-item :label="$jx3boxT('jx3boxUi.designTask.formStar', '星级')" class="m-star-line">
30
30
  <el-rate v-model="form.star" :colors="colors"></el-rate>
31
31
  </el-form-item>
32
32
  </el-form>
33
33
 
34
- <el-divider content-position="left"> 近期推送 </el-divider>
34
+ <el-divider content-position="left">{{ $jx3boxT("jx3boxUi.designTask.recent", "近期推送") }}</el-divider>
35
35
  <template v-if="logs && logs.length">
36
36
  <el-table :data="logs" border size="small" max-height="300px">
37
- <el-table-column label="推送时间" prop="push_at" align="center">
37
+ <el-table-column :label="$jx3boxT('jx3boxUi.designTask.pushAt', '推送时间')" prop="push_at" align="center">
38
38
  <template #default="{ row }">
39
39
  {{ formatTime(row.push_at) }}
40
40
  </template>
41
41
  </el-table-column>
42
- <el-table-column label="推送人" prop="pusher.display_name" align="center"></el-table-column>
43
- <el-table-column label="星级" prop="star" align="center">
42
+ <el-table-column :label="$jx3boxT('jx3boxUi.designTask.pusher', '推送人')" prop="pusher.display_name" align="center"></el-table-column>
43
+ <el-table-column :label="$jx3boxT('jx3boxUi.designTask.star', '星级')" prop="star" align="center">
44
44
  <template #default="{ row }">
45
45
  <el-rate v-model="row.star" disabled :colors="colors"></el-rate>
46
46
  </template>
47
47
  </el-table-column>
48
- <el-table-column label="备注" prop="remark" align="center"></el-table-column>
48
+ <el-table-column :label="$jx3boxT('jx3boxUi.designTask.remark', '备注')" prop="remark" align="center"></el-table-column>
49
49
  </el-table>
50
50
  </template>
51
- <el-alert v-else title="当前文章暂无历史推送" type="info" show-icon :closable="false"></el-alert>
51
+ <el-alert
52
+ v-else
53
+ :title="$jx3boxT('jx3boxUi.designTask.empty', '当前文章暂无历史推送')"
54
+ type="info"
55
+ show-icon
56
+ :closable="false"
57
+ ></el-alert>
52
58
  <template #footer>
53
- <el-button @click="close">取 消</el-button>
54
- <el-button type="primary" @click="onConfirm">确 定</el-button>
59
+ <el-button @click="close">{{ $jx3boxT("jx3boxUi.common.cancel", "取消") }}</el-button>
60
+ <el-button type="primary" @click="onConfirm">{{ $jx3boxT("jx3boxUi.common.confirm", "确定") }}</el-button>
55
61
  </template>
56
62
  </el-dialog>
57
63
  </template>
@@ -61,8 +67,10 @@ import { createDesignTask, getDesignTask, getConfigBannerTypes } from "../../ser
61
67
  import { pick } from "lodash";
62
68
  import dayjs from "dayjs";
63
69
  import User from "@jx3box/jx3box-common/js/user";
70
+ import i18nMixin from "../../i18n/mixin";
64
71
  export default {
65
72
  name: "DesignTask",
73
+ mixins: [i18nMixin],
66
74
  props: {
67
75
  modelValue: {
68
76
  type: Boolean,
@@ -73,10 +81,6 @@ export default {
73
81
  default: () => {},
74
82
  },
75
83
  },
76
- model: {
77
- prop: "modelValue",
78
- event: "update:modelValue",
79
- },
80
84
  emits: ["update:modelValue"],
81
85
  data() {
82
86
  return {
@@ -96,10 +100,10 @@ export default {
96
100
  isEditor: User.isEditor(),
97
101
 
98
102
  versions: {
99
- std: "剑三",
100
- origin: "缘起",
101
- wujie: "无界",
102
- test: "体服",
103
+ std: this.$jx3boxT("jx3boxUi.designTask.std", "剑三"),
104
+ origin: this.$jx3boxT("jx3boxUi.designTask.origin", "缘起"),
105
+ wujie: this.$jx3boxT("jx3boxUi.designTask.wujie", "无界"),
106
+ test: this.$jx3boxT("jx3boxUi.designTask.test", "体服"),
103
107
  },
104
108
  };
105
109
  },
@@ -147,7 +151,7 @@ export default {
147
151
  data.flow = 0;
148
152
 
149
153
  createDesignTask(data).then(() => {
150
- this.$message.success("提交成功");
154
+ this.$message.success(this.$jx3boxT("jx3boxUi.designTask.success", "提交成功"));
151
155
  this.close();
152
156
  });
153
157
  },