@jx3box/jx3box-editor 0.7.8 → 0.8.1
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/components/BuffItem.vue +2 -2
- package/package.json +3 -3
- package/service/database.js +33 -13
- package/service/item.js +7 -7
- package/src/Buff.vue +0 -0
- package/src/BuffSimple.vue +1 -1
- package/src/Item.vue +2 -2
- package/src/Resource.vue +2 -2
- package/src/Skill.vue +0 -0
- package/service/buff.js +0 -18
- package/service/skill.js +0 -18
package/components/BuffItem.vue
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
13
|
<script>
|
|
14
|
-
import {
|
|
14
|
+
import { getBuff } from '../service/database.js'
|
|
15
15
|
export default {
|
|
16
16
|
name: 'BuffItem',
|
|
17
17
|
props: ['buff', 'buff_id'],
|
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// 没有缓存则发起请求获取数据
|
|
43
|
-
|
|
43
|
+
getBuff(val).then(res => {
|
|
44
44
|
const data = res.data
|
|
45
45
|
const [buff] = data.list
|
|
46
46
|
// console.log(data)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "JX3BOX Article & Editor",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@jx3box/jx3box-common": "^6.6.5",
|
|
34
|
-
"@jx3box/jx3box-data": "^1.6.
|
|
35
|
-
"@jx3box/jx3box-emotion": "^1.0.
|
|
34
|
+
"@jx3box/jx3box-data": "^1.6.2",
|
|
35
|
+
"@jx3box/jx3box-emotion": "^1.0.8",
|
|
36
36
|
"@jx3box/jx3box-macro": "^1.0.1",
|
|
37
37
|
"@jx3box/jx3box-talent": "^1.1.0",
|
|
38
38
|
"@tinymce/tinymce-vue": "^3.2.2",
|
package/service/database.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { __node, __helperUrl, __iconPath } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
3
|
-
|
|
3
|
+
import { $node } from "@jx3box/jx3box-common/js/https";
|
|
4
4
|
|
|
5
5
|
function loadResource(type, query, params) {
|
|
6
6
|
switch (type) {
|
|
7
|
-
case
|
|
7
|
+
case "item":
|
|
8
8
|
return axios
|
|
9
9
|
.get(`${__helperUrl}api/item/search`, {
|
|
10
|
-
params: {keyword: query, page: params.page, limit: params.per},
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
params: { keyword: query, page: params.page, limit: params.per },
|
|
11
|
+
headers: {
|
|
12
|
+
Accept: "application/prs.helper.v2+json",
|
|
13
|
+
"JX3-Client-Type": params.client == "origin" ? 2 : 1,
|
|
14
|
+
},
|
|
13
15
|
withCredentials: true,
|
|
14
16
|
})
|
|
15
17
|
.then((res) => {
|
|
@@ -54,19 +56,19 @@ function getIcons(query, params) {
|
|
|
54
56
|
let data = res.data;
|
|
55
57
|
let list = [...data.skill, ...data.buff, ...data.item];
|
|
56
58
|
// 去重
|
|
57
|
-
let _set = new Set()
|
|
59
|
+
let _set = new Set();
|
|
58
60
|
list.forEach((item) => {
|
|
59
|
-
_set.add(item.iconID)
|
|
60
|
-
})
|
|
61
|
+
_set.add(item.iconID);
|
|
62
|
+
});
|
|
61
63
|
// 重组
|
|
62
|
-
let _list = []
|
|
64
|
+
let _list = [];
|
|
63
65
|
_set.forEach((item) => {
|
|
64
66
|
_list.push({
|
|
65
67
|
iconID: item,
|
|
66
68
|
isSelected: false,
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
list = Array.from(_list)
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
list = Array.from(_list);
|
|
70
72
|
return list;
|
|
71
73
|
})
|
|
72
74
|
.catch((err) => {
|
|
@@ -74,4 +76,22 @@ function getIcons(query, params) {
|
|
|
74
76
|
});
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
function getBuff(id, client = "std", level) {
|
|
80
|
+
return $node().get("/buff/id" + id, {
|
|
81
|
+
params: {
|
|
82
|
+
client: client,
|
|
83
|
+
level: level,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getSkill(id, client = "origin", level) {
|
|
89
|
+
return $node().get("/skill/id" + id, {
|
|
90
|
+
params: {
|
|
91
|
+
client: client,
|
|
92
|
+
level: level,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { loadResource, loadStat, getIcons, getBuff, getSkill };
|
package/service/item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import $http from "axios";
|
|
2
|
-
import {__helperUrl} from "@jx3box/jx3box-common/data/jx3box.json";
|
|
2
|
+
import { __helperUrl } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
3
3
|
|
|
4
4
|
// 获取物品
|
|
5
5
|
function get_item(item_id, jx3_client_type = 1) {
|
|
@@ -8,19 +8,19 @@ function get_item(item_id, jx3_client_type = 1) {
|
|
|
8
8
|
url: `${__helperUrl}api/item/${item_id}`,
|
|
9
9
|
headers: {
|
|
10
10
|
Accept: "application/prs.helper.v2+json",
|
|
11
|
-
|
|
11
|
+
"JX3-Client-Type": jx3_client_type,
|
|
12
12
|
},
|
|
13
13
|
withCredentials: true,
|
|
14
|
-
})
|
|
14
|
+
});
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// 获取清单
|
|
18
|
-
function get_plan(plan_id){
|
|
18
|
+
function get_plan(plan_id) {
|
|
19
19
|
return $http({
|
|
20
20
|
url: `${__helperUrl}api/item_plan/${plan_id}`,
|
|
21
|
-
headers: {Accept: "application/prs.helper.v2+json"},
|
|
21
|
+
headers: { Accept: "application/prs.helper.v2+json" },
|
|
22
22
|
withCredentials: true,
|
|
23
|
-
})
|
|
23
|
+
});
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export { get_item
|
|
26
|
+
export { get_item, get_plan };
|
package/src/Buff.vue
ADDED
|
File without changes
|
package/src/BuffSimple.vue
CHANGED
package/src/Item.vue
CHANGED
|
@@ -250,7 +250,7 @@ import color from "../assets/js/item/color.js";
|
|
|
250
250
|
|
|
251
251
|
export default {
|
|
252
252
|
name: "Item",
|
|
253
|
-
props: ["item", "item_id"],
|
|
253
|
+
props: ["item", "item_id","jx3ClientType"],
|
|
254
254
|
data() {
|
|
255
255
|
return {
|
|
256
256
|
source: null,
|
|
@@ -293,7 +293,7 @@ export default {
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
// 没有缓存则发起请求获取
|
|
296
|
-
get_item(this.item_id).then((res) => {
|
|
296
|
+
get_item(this.item_id,this.jx3ClientType).then((res) => {
|
|
297
297
|
let data = res.data;
|
|
298
298
|
if (data.code === 200) {
|
|
299
299
|
let item = data.data.item;
|
package/src/Resource.vue
CHANGED
|
@@ -400,13 +400,13 @@ export default {
|
|
|
400
400
|
selectItem: function (o, i) {
|
|
401
401
|
this.resetItems();
|
|
402
402
|
o.isSelected = true;
|
|
403
|
-
this.html = `<a class="e-jx3-item e-jx3-item-q${o.Quality}" data-id="${o.id}" data-quality="${o.Quality}" target="_blank" href="${o.Link}">[${o.Name}]</a>`;
|
|
403
|
+
this.html = `<a class="e-jx3-item e-jx3-item-q${o.Quality}" data-mode="" data-id="${o.id}" data-quality="${o.Quality}" data-client="${this.client}" data-name="" data-desc="" data-level="${o.Level}" target="_blank" href="${o.Link}">[${o.Name}]</a>`;
|
|
404
404
|
},
|
|
405
405
|
selectIcon: function (o) {
|
|
406
406
|
this.resetItems();
|
|
407
407
|
o.isSelected = true;
|
|
408
408
|
this.html = `<img class="e-jx3-icon" src="${__iconPath}${this.iconDir}/${o.iconID}.png" alt="${o.iconID}"/>`;
|
|
409
|
-
console.log(this.html);
|
|
409
|
+
// console.log(this.html);
|
|
410
410
|
},
|
|
411
411
|
resetItems: function () {
|
|
412
412
|
let data = this[this.type];
|
package/src/Skill.vue
ADDED
|
File without changes
|
package/service/buff.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import $http from 'axios'
|
|
2
|
-
import {__node} from "@jx3box/jx3box-common/data/jx3box.json"
|
|
3
|
-
|
|
4
|
-
// 获取 buff 信息
|
|
5
|
-
const get_buff = (buff_id) => {
|
|
6
|
-
if (!buff_id) return
|
|
7
|
-
return $http({
|
|
8
|
-
method: 'GET',
|
|
9
|
-
// https://node.jx3box.com/buff/id/103?strict=0&per=10&page=1
|
|
10
|
-
url: `${__node}buff/id/${buff_id}`,
|
|
11
|
-
headers: {Accept: "application/prs.helper.v2+json"},
|
|
12
|
-
withCredentials: true,
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
get_buff
|
|
18
|
-
}
|
package/service/skill.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import $http from 'axios'
|
|
2
|
-
import {__node} from "@jx3box/jx3box-common/data/jx3box.json"
|
|
3
|
-
|
|
4
|
-
// 获取 skill 信息
|
|
5
|
-
const get_skill = (skill_id) => {
|
|
6
|
-
if (!skill_id) return
|
|
7
|
-
return $http({
|
|
8
|
-
method: 'GET',
|
|
9
|
-
// https://node.jx3box.com/skill/id/103?strict=0&per=10&page=1
|
|
10
|
-
url: `${__node}skill/id/${skill_id}`,
|
|
11
|
-
headers: {Accept: "application/prs.helper.v2+json"},
|
|
12
|
-
withCredentials: true,
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
get_skill
|
|
18
|
-
}
|