@jx3box/jx3box-editor 2.1.6 → 2.1.8
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/package.json +1 -1
- package/src/Item.vue +7 -10
- 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/package.json
CHANGED
package/src/Item.vue
CHANGED
|
@@ -341,16 +341,13 @@ export default {
|
|
|
341
341
|
// 服务端拉取
|
|
342
342
|
}else{
|
|
343
343
|
get_item(this.item_id, this.final_client).then((res) => {
|
|
344
|
-
let
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}else{
|
|
352
|
-
this.source = null
|
|
353
|
-
}
|
|
344
|
+
let item = res.data;
|
|
345
|
+
let isValidItem = JSON.stringify(item) !== "{}"
|
|
346
|
+
if(isValidItem){
|
|
347
|
+
this.source = item
|
|
348
|
+
sessionStorage.setItem(this.cache_key,JSON.stringify(this.source));
|
|
349
|
+
}else{
|
|
350
|
+
this.source = null
|
|
354
351
|
}
|
|
355
352
|
});
|
|
356
353
|
}
|
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
|
|