@jx3box/jx3box-editor 2.1.7 → 2.1.9
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.
- package/assets/css/module/skill.less +30 -11
- package/assets/js/jx3_element.js +6 -7
- package/package.json +1 -1
- package/src/Article.vue +1 -1
- package/src/Skill.vue +52 -24
|
@@ -12,20 +12,30 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.w-skill-icon{
|
|
15
|
+
.w-skill-icon {
|
|
16
16
|
.size(48px);
|
|
17
|
-
border:none;
|
|
18
|
-
padding:0;
|
|
19
|
-
margin:0 10px 0 0;
|
|
17
|
+
border: none;
|
|
18
|
+
padding: 0;
|
|
19
|
+
margin: 0 10px 0 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.w-skill-content{
|
|
22
|
+
.w-skill-content {
|
|
23
23
|
font-weight: normal;
|
|
24
24
|
flex-grow: 1;
|
|
25
25
|
text-shadow: 1px 1px 1px #0f2222;
|
|
26
26
|
line-height: 20px;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.w-skill-switch-parse {
|
|
30
|
+
padding: 5px;
|
|
31
|
+
float: right;
|
|
32
|
+
color: #5df9eb;
|
|
33
|
+
transition: all 0.15s ease;
|
|
34
|
+
&:hover {
|
|
35
|
+
color: #ff0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
29
39
|
.w-skill-name {
|
|
30
40
|
color: #ff0;
|
|
31
41
|
.db;
|
|
@@ -34,19 +44,28 @@
|
|
|
34
44
|
|
|
35
45
|
.w-skill-desc {
|
|
36
46
|
color: #ffffff;
|
|
37
|
-
letter-spacing:0.5px;
|
|
47
|
+
letter-spacing: 0.5px;
|
|
38
48
|
.mb(10px);
|
|
39
49
|
.fz(12px,20px);
|
|
50
|
+
white-space: pre-wrap;
|
|
40
51
|
}
|
|
41
52
|
|
|
42
|
-
.w-skill-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
.w-skill-talent {
|
|
54
|
+
color: #04cfb4;
|
|
55
|
+
letter-spacing: 0.5px;
|
|
56
|
+
.mb(10px);
|
|
57
|
+
.fz(12px,20px);
|
|
58
|
+
white-space: pre-wrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.w-skill-meta {
|
|
62
|
+
.db;
|
|
63
|
+
.fz(12px,20px);
|
|
64
|
+
color: #5df9eb;
|
|
45
65
|
}
|
|
46
66
|
}
|
|
47
67
|
|
|
48
68
|
.c-article .e-jx3-skill {
|
|
49
|
-
|
|
50
69
|
// img {
|
|
51
70
|
// border: none;
|
|
52
71
|
// margin: 0 5px 0 0;
|
|
@@ -59,7 +78,7 @@
|
|
|
59
78
|
// }
|
|
60
79
|
|
|
61
80
|
text-decoration: underline;
|
|
62
|
-
&:hover{
|
|
81
|
+
&:hover {
|
|
63
82
|
box-shadow: none !important;
|
|
64
83
|
}
|
|
65
84
|
}
|
package/assets/js/jx3_element.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import $ from "jquery";
|
|
2
2
|
|
|
3
3
|
function renderItem(vm, selector = ".w-jx3-element") {
|
|
4
|
-
|
|
5
4
|
let outer, inner;
|
|
6
|
-
const pop_class =
|
|
5
|
+
const pop_class = ".w-jx3-element-pop";
|
|
7
6
|
|
|
8
7
|
// 触发时
|
|
9
8
|
$(selector).on("mouseenter", function (e) {
|
|
@@ -11,12 +10,12 @@ function renderItem(vm, selector = ".w-jx3-element") {
|
|
|
11
10
|
|
|
12
11
|
// 获取元素数据
|
|
13
12
|
let type = $(e.target).attr("data-type");
|
|
14
|
-
if (type ==
|
|
13
|
+
if (type == "item") {
|
|
15
14
|
vm.item.id = $(e.target).attr("data-id");
|
|
16
|
-
vm.item.client = $(e.target).attr("data-client") ==
|
|
17
|
-
} else if (type ===
|
|
15
|
+
vm.item.client = $(e.target).attr("data-client") == "origin" ? 2 : 1;
|
|
16
|
+
} else if (type === "author") {
|
|
18
17
|
vm.author.id = $(e.target).attr("data-id");
|
|
19
|
-
} else if (type ===
|
|
18
|
+
} else if (type === "emotion") {
|
|
20
19
|
vm.emotion.id = $(e.target).attr("data-id");
|
|
21
20
|
} else {
|
|
22
21
|
vm[type].client = $(e.target).attr("data-client");
|
|
@@ -26,7 +25,7 @@ function renderItem(vm, selector = ".w-jx3-element") {
|
|
|
26
25
|
|
|
27
26
|
// 显示浮层
|
|
28
27
|
$(pop_class).fadeIn();
|
|
29
|
-
vm.jx3_element.type = type
|
|
28
|
+
vm.jx3_element.type = type;
|
|
30
29
|
|
|
31
30
|
// 计算浮层位置
|
|
32
31
|
let self_height = $(pop_class).height();
|
package/package.json
CHANGED
package/src/Article.vue
CHANGED
package/src/Skill.vue
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-skill" v-if="data">
|
|
3
3
|
<div class="w-skill-wrapper">
|
|
4
|
-
<img
|
|
4
|
+
<img
|
|
5
|
+
class="w-skill-icon"
|
|
6
|
+
:src="iconLink(data.IconID || 13)"
|
|
7
|
+
:alt="data.Name"
|
|
8
|
+
/>
|
|
5
9
|
<div class="w-skill-content">
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
<el-button
|
|
11
|
+
type="text"
|
|
12
|
+
class="w-skill-switch-parse"
|
|
13
|
+
@click="show_parse = !show_parse"
|
|
14
|
+
>
|
|
15
|
+
<i class="el-icon-refresh"></i>
|
|
16
|
+
</el-button>
|
|
17
|
+
<span class="w-skill-name">{{ data.Name }}</span>
|
|
18
|
+
<span class="w-skill-desc">{{ desc }}</span>
|
|
19
|
+
<div class="w-skill-talent">{{ talent_desc }}</div>
|
|
20
|
+
<span class="w-skill-meta">ID : {{ data.SkillID }}</span>
|
|
21
|
+
<span class="w-skill-meta">Level : {{ data.Level }}</span>
|
|
10
22
|
<slot></slot>
|
|
11
23
|
</div>
|
|
12
24
|
</div>
|
|
@@ -21,11 +33,25 @@ export default {
|
|
|
21
33
|
props: ["client", "id", "level"],
|
|
22
34
|
data: () => ({
|
|
23
35
|
data: null,
|
|
36
|
+
show_parse: true,
|
|
24
37
|
}),
|
|
25
38
|
computed: {
|
|
26
39
|
params: function () {
|
|
27
40
|
return [this.client, this.id, this.level];
|
|
28
41
|
},
|
|
42
|
+
desc: function () {
|
|
43
|
+
if (this.data.parse && this.show_parse) {
|
|
44
|
+
const result = this.data.parse.desc;
|
|
45
|
+
return result.replace(/\\n/g, "\n");
|
|
46
|
+
}
|
|
47
|
+
return this.data?.Desc;
|
|
48
|
+
},
|
|
49
|
+
talent_desc: function () {
|
|
50
|
+
if (this.data.parse && this.show_parse) {
|
|
51
|
+
return this.data.parse.talent_desc;
|
|
52
|
+
}
|
|
53
|
+
return "";
|
|
54
|
+
},
|
|
29
55
|
},
|
|
30
56
|
watch: {
|
|
31
57
|
params: {
|
|
@@ -39,31 +65,33 @@ export default {
|
|
|
39
65
|
`skill-${client}-${id}-${level}`
|
|
40
66
|
);
|
|
41
67
|
if (cache) {
|
|
42
|
-
|
|
68
|
+
try {
|
|
69
|
+
this.data = JSON.parse(cache);
|
|
70
|
+
return;
|
|
71
|
+
} catch {}
|
|
43
72
|
// 没有缓存则发起请求获取数据
|
|
44
|
-
} else {
|
|
45
|
-
id &&
|
|
46
|
-
getSkill(...this.params).then((res) => {
|
|
47
|
-
let data = res.data?.list?.[0];
|
|
48
|
-
if (!data) data = null;
|
|
49
|
-
this.data = data;
|
|
50
|
-
|
|
51
|
-
// 将数据放入 sessionStorage
|
|
52
|
-
sessionStorage.setItem(
|
|
53
|
-
`skill-${client}-${id}-${level}`,
|
|
54
|
-
JSON.stringify(data)
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
73
|
}
|
|
74
|
+
if (!id) return;
|
|
75
|
+
getSkill(...this.params).then(res => {
|
|
76
|
+
let data = res.data?.list?.[0];
|
|
77
|
+
if (!data) data = null;
|
|
78
|
+
this.data = data;
|
|
79
|
+
|
|
80
|
+
// 将数据放入 sessionStorage
|
|
81
|
+
sessionStorage.setItem(
|
|
82
|
+
`skill-${client}-${id}-${level}`,
|
|
83
|
+
JSON.stringify(data)
|
|
84
|
+
);
|
|
85
|
+
});
|
|
58
86
|
}
|
|
59
87
|
},
|
|
60
88
|
},
|
|
61
89
|
},
|
|
62
|
-
methods
|
|
63
|
-
iconLink
|
|
64
|
-
return iconLink(id,this.client)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
90
|
+
methods: {
|
|
91
|
+
iconLink: function (id) {
|
|
92
|
+
return iconLink(id, this.client);
|
|
93
|
+
},
|
|
94
|
+
},
|
|
67
95
|
};
|
|
68
96
|
</script>
|
|
69
97
|
|