@jx3box/jx3box-editor 1.4.6 → 1.4.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.
@@ -10,10 +10,12 @@
10
10
  }
11
11
 
12
12
  .e-jx3-emotion {
13
- .size(80px, 80px);
14
- .mr(10px);
15
- box-shadow: 0 0 1px inset rgba(0, 0, 0, 0.2);
16
- //border: 1px solid #d2d2d2;
13
+
14
+ max-width: 320px;
17
15
  vertical-align: middle;
16
+ &:hover{
17
+ box-shadow:none !important;
18
+ }
19
+ .e-jx3-emotion-img{border:none !important}
18
20
  }
19
21
  }
@@ -72,10 +72,6 @@
72
72
  .db;
73
73
  }
74
74
  }
75
- .e-jx3-emotion {
76
- padding: 0;
77
- border: none;
78
- }
79
75
  }
80
76
  @media print {
81
77
  .e-jx3-resource {
@@ -1,5 +1,5 @@
1
1
  .c-resource {
2
- margin-right:5px;
2
+ margin-right: 5px;
3
3
  .u-switch {
4
4
  .u-icon {
5
5
  .size(14px);
@@ -18,8 +18,9 @@
18
18
  .lh(28px);
19
19
 
20
20
  .pr;
21
- .u-mode{
22
- .pa;.rt(0);
21
+ .u-mode {
22
+ .pa;
23
+ .rt(0);
23
24
  }
24
25
  }
25
26
 
@@ -70,7 +71,7 @@
70
71
  .rt(10px);
71
72
  .x(right);
72
73
  }
73
- .u-detach{
74
+ .u-detach {
74
75
  .mt(4px);
75
76
  .db;
76
77
  }
@@ -97,8 +98,9 @@
97
98
  .mb(5px);
98
99
  .db;
99
100
 
100
- .u-map, .u-life {
101
- .mr(20px)
101
+ .u-map,
102
+ .u-life {
103
+ .mr(20px);
102
104
  }
103
105
  }
104
106
  .u-remark {
@@ -150,7 +152,8 @@
150
152
  }
151
153
  }
152
154
 
153
- .m-resource-iconlist {
155
+ .m-resource-iconlist,
156
+ .m-resource-emotion {
154
157
  list-style: none;
155
158
  padding: 0;
156
159
  margin: 0;
@@ -174,18 +177,24 @@
174
177
  border: 2px solid transparent;
175
178
  &.on {
176
179
  border: 2px solid #49c10f;
177
- float: left;
178
- margin-right: 10px;
179
- margin-bottom: 10px;
180
180
  border-radius: 6px;
181
181
  }
182
+ }
183
+ }
182
184
 
183
- .e-jx3-emotion {
184
- .size(80px, 80px);
185
- .mr(10px);
186
- padding: 0 !important;
187
- box-shadow: 0 0 1px inset rgba(0, 0, 0, 0.2);
188
- vertical-align: middle;
185
+ .m-resource-emotion {
186
+ .u-item {
187
+ .mr(20px);
188
+ .mb(20px);
189
+ }
190
+ .e-jx3-emotion {
191
+ .size(80px, 80px);
192
+ vertical-align: middle;
193
+ .e-jx3-emotion-img {
194
+ border: none !important;
195
+ }
196
+ &:hover {
197
+ box-shadow: none !important;
189
198
  }
190
199
  }
191
200
  }
@@ -219,23 +228,23 @@
219
228
  position: sticky;
220
229
  z-index: 100;
221
230
  top: 0;
222
- padding:10px 20px 10px 20px;
223
- background-color:#fff;
231
+ padding: 10px 20px 10px 20px;
232
+ background-color: #fff;
224
233
  .pr;
225
234
 
226
- .u-client{
235
+ .u-client {
227
236
  // .pa;.lt(20px,10px);
228
- margin-right:15px;
237
+ margin-right: 15px;
229
238
  }
230
- .u-input{
231
- flex:1;
239
+ .u-input {
240
+ flex: 1;
232
241
  }
233
242
  display: flex;
234
243
  }
235
244
 
236
245
  .m-database-tabs {
237
246
  // .mt(10px);
238
- padding:10px 20px 20px 20px;
247
+ padding: 10px 20px 20px 20px;
239
248
  user-select: none;
240
249
  .u-icon {
241
250
  .size(20px);
@@ -305,7 +314,7 @@
305
314
  // 加载更多
306
315
  .m-archive-more {
307
316
  .none;
308
- margin:0 20px 10px 20px;
317
+ margin: 0 20px 10px 20px;
309
318
  box-sizing: border-box;
310
319
  width: calc(100% - 40px);
311
320
  }
@@ -316,7 +325,7 @@
316
325
  // 分页
317
326
  .m-archive-pages {
318
327
  overflow-x: auto;
319
- margin:0 20px;
328
+ margin: 0 20px;
320
329
  .x;
321
330
  }
322
331
  }
@@ -16,6 +16,8 @@ function renderItem(vm, selector = ".w-jx3-element") {
16
16
  vm.item.client = $(e.target).attr("data-client") == 'origin' ? 2 : 1;
17
17
  } else if (type === 'author') {
18
18
  vm.author.id = $(e.target).attr("data-id");
19
+ } else if (type === 'emotion') {
20
+ vm.emotion.id = $(e.target).attr("data-id");
19
21
  } else {
20
22
  vm[type].client = $(e.target).attr("data-client");
21
23
  vm[type].id = $(e.target).attr("data-id");
@@ -6,6 +6,7 @@ function renderImgPreview(vm, selector='.c-article img'){
6
6
  vm.images.push($(ele).attr('src'))
7
7
  // 绑定事件挂钩索引位置
8
8
  $(ele).on('click', (e) => {
9
+ if (e.target.classList.contains('e-jx3-emotion-img')) return
9
10
  vm.$hevueImgPreview({
10
11
  multiple: true,
11
12
  nowImgIndex: i,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/author.js CHANGED
@@ -21,9 +21,14 @@ async function getUserPublicTeams(uid) {
21
21
  return res.data.data;
22
22
  }
23
23
 
24
+ // 获取指定表情
25
+ function getEmotion(id) {
26
+ return $cms().get(`/api/cms/post/emotion/${id}`);
27
+ }
24
28
 
25
29
  export {
26
30
  getUserMedals,
27
31
  getUserInfo,
28
32
  getUserPublicTeams,
33
+ getEmotion
29
34
  }
package/src/Article.vue CHANGED
@@ -55,6 +55,7 @@
55
55
  />
56
56
  <jx3-npc :client="npc.client" :id="npc.id" v-show="jx3_element.type === 'npc'" />
57
57
  <jx3-author :uid="author.id" v-show="jx3_element.type === 'author'" />
58
+ <jx3-emotion-author :id="emotion.id" v-show="jx3_element.type === 'emotion'" />
58
59
  </div>
59
60
  <!-- <gallery :images="images" :index="gallery_index" @close="index = null"></gallery> -->
60
61
  </div>
@@ -99,7 +100,8 @@ import Item from "./Item";
99
100
  import Buff from "./Buff";
100
101
  import Skill from "./Skill";
101
102
  import Npc from "./Npc";
102
- import Author from "./Author";
103
+ import Author from "./components/Author";
104
+ import PostAuthor from './components/PostAuthor.vue'
103
105
  import renderJx3Element from "../assets/js/jx3_element";
104
106
 
105
107
  export default {
@@ -149,6 +151,9 @@ export default {
149
151
  author: {
150
152
  id: '',
151
153
  },
154
+ emotion: {
155
+ id: ''
156
+ },
152
157
  // COMMON
153
158
  jx3_element: {
154
159
  style: {
@@ -280,6 +285,7 @@ export default {
280
285
  "jx3-skill": Skill,
281
286
  "jx3-npc": Npc,
282
287
  "jx3-author": Author,
288
+ 'jx3-emotion-author': PostAuthor,
283
289
  // "gallery":gallery,
284
290
  // VueViewer
285
291
  },
@@ -40,13 +40,13 @@
40
40
  </el-tab-pane>
41
41
  <el-tab-pane label="表情" name="emotions">
42
42
  <span slot="label" class="u-tab-label">
43
- <i class="el-icon-sugar"></i>
43
+ <i class="el-icon-sugar" style="margin-right: 5px;"></i>
44
44
  <b>表情</b>
45
45
  </span>
46
46
  <p v-if="total && done" class="m-resource-count">
47
47
  <i class="el-icon-s-data"></i> 共找到 <b>{{ total }}</b> 条记录
48
48
  </p>
49
- <ul class="m-resource-iconlist">
49
+ <ul class="m-resource-emotion">
50
50
  <li v-for="o in emotions" class="u-item" :key="o.id" :class="{ on: !!o.isSelected }" @click="selectEmotion(o)" ref="emotion">
51
51
  <img class="e-jx3-emotion" :src="resolveImagePath(o.url)" :alt="query" />
52
52
  </li>
@@ -196,7 +196,10 @@ export default {
196
196
 
197
197
  // 图标
198
198
  if (this.type === 'authors') {
199
- if (!this.query) return;
199
+ if (!this.query) {
200
+ this.loading = false;
201
+ return;
202
+ };
200
203
 
201
204
  params = {
202
205
  ...params,
@@ -216,7 +219,7 @@ export default {
216
219
  });
217
220
 
218
221
  } else if (this.type === 'emotions') {
219
- this.per = 30;
222
+ this.per = 24;
220
223
  params = {
221
224
  per: this.per,
222
225
  page: page,
@@ -301,7 +304,7 @@ export default {
301
304
  selectEmotion: function (o){
302
305
  this.resetItems();
303
306
  o.isSelected = true;
304
- this.html = `<img class="e-jx3-emotion" style="width:80px;" src="${resolveImagePath(o.url)}" alt="${o.id}"/>`
307
+ this.html = `<a data-type="emotion" class="e-jx3-emotion w-jx3-element" data-id="${o.id}" target="_blank" href="/emotion/${o.id}"><img class="e-jx3-emotion-img" data-type="emotion" data-id="${o.id}" style="width:80px;" src="${o.url}" alt="${o.id}"/></a>`
305
308
  },
306
309
  resetItems: function() {
307
310
  let data = this[this.type];
@@ -44,12 +44,12 @@
44
44
 
45
45
  <script>
46
46
  import { authorLink, getLink, getThumbnail } from "@jx3box/jx3box-common/js/utils";
47
- import { getUserInfo, getUserMedals, getUserPublicTeams } from "../service/author";
47
+ import { getUserInfo, getUserMedals, getUserPublicTeams } from "../../service/author";
48
48
  import { __server, __imgPath,__userLevelColor } from "@jx3box/jx3box-common/data/jx3box.json";
49
49
  import User from "@jx3box/jx3box-common/js/user";
50
50
  import { __userLevel } from "@jx3box/jx3box-common/data/jx3box.json";
51
- import Avatar from "./components/Avatar.vue"
52
- import medal from "./components/medal.vue"
51
+ import Avatar from "./Avatar.vue"
52
+ import medal from "./medal.vue"
53
53
  export default {
54
54
  name: "Author",
55
55
  components: {
@@ -145,7 +145,7 @@ export default {
145
145
  </script>
146
146
 
147
147
  <style lang="less">
148
- @import "../assets/css/module/author.less";
148
+ @import "../../assets/css/module/author.less";
149
149
  .w-author {
150
150
  .w-author-wrapper {
151
151
  .u-author{
@@ -0,0 +1,101 @@
1
+ <!--
2
+ * @Author: iRuxu
3
+ * @Date: 2022-07-17 00:13:35
4
+ * @LastEditTime: 2022-07-17 00:40:25
5
+ * @Description:
6
+ -->
7
+ <template>
8
+ <div class="w-author w-author__post" v-loading="loading">
9
+ <div class="w-author-wrapper el-popover" v-if="data">
10
+ <div class="u-meta">
11
+ <span class="u-meta-label">作者</span>
12
+ <span class="u-meta-value">
13
+ <a class="u-user" :href="authorLink(data.user_id)" target="_blank">
14
+ <Avatar class="u-user-avatar" :uid="data.user_id" :url="data.user_info.user_avatar" :size="32" />
15
+ <span class="u-user-name">{{ data.user_info.display_name }}</span>
16
+ </a>
17
+ </span>
18
+ </div>
19
+ <div class="u-meta">
20
+ <div class="u-meta-label">更新</div>
21
+ <div class="u-meta-value">
22
+ {{ formatTime(data.created_at) }}
23
+ </div>
24
+ </div>
25
+ <div class="u-meta">
26
+ <div class="u-meta-label">信息</div>
27
+ <div class="u-meta-value">{{ data.desc }}</div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ import { authorLink } from "@jx3box/jx3box-common/js/utils";
35
+ import { getEmotion } from "../../service/author";
36
+ import { __server, __imgPath, __userLevelColor } from "@jx3box/jx3box-common/data/jx3box.json";
37
+ import dayjs from "dayjs";
38
+ import Avatar from "./Avatar.vue";
39
+ export default {
40
+ name: "PostAuthor",
41
+ components: {
42
+ Avatar,
43
+ },
44
+ props: ["id"],
45
+ data: () => ({
46
+ data: null,
47
+ loading: false,
48
+ }),
49
+ computed: {},
50
+ watch: {
51
+ id: {
52
+ immediate: true,
53
+ handler(val) {
54
+ if (val) {
55
+ this.loadData();
56
+ }
57
+ },
58
+ },
59
+ },
60
+ methods: {
61
+ authorLink,
62
+ loadData() {
63
+ this.loading = true;
64
+ getEmotion(this.id).then((res) => {
65
+ this.data = res.data.data;
66
+ this.loading = false;
67
+ });
68
+ },
69
+ formatTime(val) {
70
+ return val && dayjs(val).format("YYYY-MM-DD HH:mm:ss") || "";
71
+ }
72
+ },
73
+ };
74
+ </script>
75
+
76
+ <style scoped lang="less">
77
+ @import "../../assets/css/module/author.less";
78
+ .w-author {
79
+
80
+ .u-meta{
81
+ display: flex;
82
+ align-items: center;
83
+ .fz(12px,24px);
84
+ .h(24px);
85
+ .mb(5px);
86
+ }
87
+ .u-meta-label{
88
+ .mr(10px);
89
+ background-color: @bg-gray;
90
+ padding:0 8px;
91
+ .r(2px);
92
+ }
93
+ .u-meta-value,.u-user{
94
+ display: flex;
95
+ align-items: center;
96
+ }
97
+ .u-user-avatar{
98
+ .size(24px);
99
+ }
100
+ }
101
+ </style>