@jx3box/jx3box-editor 0.8.0 → 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.
@@ -11,7 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import { get_buff } from '../service/buff.js'
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
- get_buff(val).then(res => {
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.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,16 +1,16 @@
1
1
  import axios from "axios";
2
2
  import { __node, __helperUrl, __iconPath } from "@jx3box/jx3box-common/data/jx3box.json";
3
- const API = __node;
3
+ import { $node } from "@jx3box/jx3box-common/js/https";
4
4
 
5
5
  function loadResource(type, query, params) {
6
6
  switch (type) {
7
- case 'item':
7
+ case "item":
8
8
  return axios
9
9
  .get(`${__helperUrl}api/item/search`, {
10
- params: {keyword: query, page: params.page, limit: params.per},
10
+ params: { keyword: query, page: params.page, limit: params.per },
11
11
  headers: {
12
12
  Accept: "application/prs.helper.v2+json",
13
- 'JX3-Client-Type': params.client == 'origin' ? 2 : 1,
13
+ "JX3-Client-Type": params.client == "origin" ? 2 : 1,
14
14
  },
15
15
  withCredentials: true,
16
16
  })
@@ -56,19 +56,19 @@ function getIcons(query, params) {
56
56
  let data = res.data;
57
57
  let list = [...data.skill, ...data.buff, ...data.item];
58
58
  // 去重
59
- let _set = new Set()
59
+ let _set = new Set();
60
60
  list.forEach((item) => {
61
- _set.add(item.iconID)
62
- })
61
+ _set.add(item.iconID);
62
+ });
63
63
  // 重组
64
- let _list = []
64
+ let _list = [];
65
65
  _set.forEach((item) => {
66
66
  _list.push({
67
67
  iconID: item,
68
68
  isSelected: false,
69
- })
70
- })
71
- list = Array.from(_list)
69
+ });
70
+ });
71
+ list = Array.from(_list);
72
72
  return list;
73
73
  })
74
74
  .catch((err) => {
@@ -76,4 +76,22 @@ function getIcons(query, params) {
76
76
  });
77
77
  }
78
78
 
79
- export { loadResource, loadStat,getIcons };
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
- 'JX3-Client-Type': jx3_client_type,
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 ,get_plan};
26
+ export { get_item, get_plan };
package/src/Buff.vue ADDED
File without changes
@@ -33,7 +33,7 @@
33
33
  </span>
34
34
  <span class="u-uiid fr" v-text="`ID: ${buff.BuffID}`"></span>
35
35
  </div>
36
- <buff-item :buff_id="buff_id"></buff-item>
36
+ <buff-item :buff_id="buff_id" :jx3-client-type="jx3ClientType"></buff-item>
37
37
  </el-popover>
38
38
  </template>
39
39
 
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
- }