@jx3box/jx3box-editor 1.1.9 → 1.2.3

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.
@@ -14,7 +14,9 @@
14
14
 
15
15
  .w-buff-icon {
16
16
  .size(48px);
17
- .mr(10px);
17
+ border:none;
18
+ padding:0;
19
+ margin:0 10px 0 0;
18
20
  }
19
21
 
20
22
  .w-buff-content {
@@ -85,10 +85,13 @@
85
85
  background-color: rgba(15, 34, 34, 0.88);
86
86
  // background-color: #0f2222;
87
87
  color: #ffffff;
88
- text-shadow: 1px 1px 1px #0f2222;
89
- font-weight: normal;
90
- font-size: 13.6px;
91
- line-height: 1.5em;
88
+
89
+ *{
90
+ font-weight: normal;
91
+ font-size: 13.6px;
92
+ line-height: 1.5em;
93
+ text-shadow: 1px 1px 1px #0f2222;
94
+ }
92
95
 
93
96
  &:before {
94
97
  content: "";
@@ -4,23 +4,19 @@
4
4
  .w-npc-wrapper {
5
5
  @min-width: 200px;
6
6
  min-width: @min-width;
7
- padding: 9px 10px 10px;
8
7
  background-color: rgba(15, 34, 34, 0.88);
9
8
  box-sizing: border-box;
10
9
  display: flex;
11
10
 
12
- div {
13
- margin: 2px 0;
14
- }
15
11
 
16
12
  .w-npc-content {
17
13
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
18
- margin-bottom: 10px;
19
- padding: 10px;
20
14
  .r(4px);
21
15
  .clearfix;
22
16
  .fz(13px);
23
17
  color: #e7e7e7;
18
+ margin:0;
19
+ padding:5px 15px 10px 15px;
24
20
  }
25
21
 
26
22
  .u-icon {
@@ -45,7 +41,7 @@
45
41
 
46
42
  .u-id {
47
43
  .pa;
48
- .rt(22px,28px);
44
+ .rt(15px,10px);
49
45
  .pointer;
50
46
  color: #5df9eb;
51
47
  }
@@ -14,7 +14,9 @@
14
14
 
15
15
  .w-skill-icon{
16
16
  .size(48px);
17
- .mr(10px);
17
+ border:none;
18
+ padding:0;
19
+ margin:0 10px 0 0;
18
20
  }
19
21
 
20
22
  .w-skill-content{
@@ -29,18 +29,19 @@
29
29
 
30
30
  .u-item {
31
31
  .db;
32
- border: 1px solid @border-hr;
32
+ border: 2px solid @border-hr;
33
33
  background: #fafbfc;
34
34
  margin-bottom: 10px;
35
35
  padding: 10px 10px 10px 70px;
36
36
  min-height: 60px;
37
- .r(3px);
37
+ .r(6px);
38
38
  &:hover {
39
39
  background-color: #e7f9ff;
40
40
  }
41
41
  &.on {
42
42
  border-color: #34d058;
43
43
  background-color: #fff;
44
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
44
45
  // &:hover{
45
46
  // border:1px dashed #ddd;
46
47
  // background-color:#eee;
@@ -95,7 +96,7 @@
95
96
  .mb(5px);
96
97
  .db;
97
98
 
98
- .u-map, .u-life, {
99
+ .u-map, .u-life {
99
100
  .mr(20px)
100
101
  }
101
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.1.9",
3
+ "version": "1.2.3",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/item.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { $helper } from "@jx3box/jx3box-common/js/https";
2
2
 
3
3
  // 获取物品
4
- function get_item(item_id, client_id) {
4
+ function get_item(item_id, client) {
5
5
  if (!item_id) return;
6
-
7
6
  let options = {
8
- url: `api/item/${item_id}`,
7
+ url: `/api/item/${item_id}`,
8
+ params : {
9
+ client
10
+ }
9
11
  };
10
-
11
- return $helper({ mute: true,client_id : client_id })(options);
12
+ return $helper({ mute: true })(options);
12
13
  }
13
14
 
14
15
  // 获取清单
package/src/Article.vue CHANGED
@@ -53,6 +53,7 @@
53
53
  :level="skill.level"
54
54
  v-show="jx3_element.type == 'skill'"
55
55
  />
56
+ <jx3-npc :client="npc.client" :id="npc.id" v-show="jx3_element.type === 'npc'" />
56
57
  </div>
57
58
  <!-- <gallery :images="images" :index="gallery_index" @close="index = null"></gallery> -->
58
59
  </div>
@@ -96,6 +97,7 @@ import renderPzIframe from '../assets/js/pz_iframe'
96
97
  import Item from "./Item";
97
98
  import Buff from "./Buff";
98
99
  import Skill from "./Skill";
100
+ import Npc from "./Npc";
99
101
  import renderJx3Element from "../assets/js/jx3_element";
100
102
 
101
103
  export default {
@@ -137,6 +139,12 @@ export default {
137
139
  id: "",
138
140
  level: "",
139
141
  },
142
+ // NPC
143
+ npc : {
144
+ client : 'std',
145
+ id : '',
146
+ },
147
+ // COMMON
140
148
  jx3_element: {
141
149
  style: {
142
150
  top: 0,
@@ -265,6 +273,7 @@ export default {
265
273
  "jx3-item": Item,
266
274
  "jx3-buff": Buff,
267
275
  "jx3-skill": Skill,
276
+ "jx3-npc": Npc,
268
277
  // "gallery":gallery,
269
278
  // VueViewer
270
279
  },
package/src/Item.vue CHANGED
@@ -250,26 +250,34 @@ import { iconLink } from "@jx3box/jx3box-common/js/utils";
250
250
 
251
251
  export default {
252
252
  name: "Item",
253
- props: ["item", "item_id", "jx3ClientType"],
253
+ props: ["item", "item_id", "jx3ClientType","client"],
254
254
  data() {
255
255
  return {
256
256
  source: null,
257
257
  };
258
258
  },
259
259
  computed : {
260
+ // 兼容旧版传值
261
+ env_client_id : function (){
262
+ return location.href.includes('origin') ? 2 : 1
263
+ },
260
264
  client_id : function (){
261
- return this.jx3ClientType || 1
265
+ return this.jx3ClientType || this.env_client_id
266
+ },
267
+ client_by_id : function (){
268
+ return this.client_id == 1 ? 'std' : 'origin'
262
269
  },
263
- client : function (){
264
- return this.client_id == 1 ? 'std' : 'origin'
270
+ // 新版传值
271
+ final_client : function (){
272
+ return this.client || this.client_by_id
265
273
  },
266
274
  cache_key : function (){
267
- return `item-${this.client}-${this.item_id}`
275
+ return `item-${this.final_client}-${this.item_id}`
268
276
  },
269
277
  },
270
278
  methods: {
271
279
  iconLink : function (id){
272
- return iconLink(id,this.client)
280
+ return iconLink(id,this.final_client)
273
281
  },
274
282
  second_format,
275
283
  attribute_percent,
@@ -303,7 +311,7 @@ export default {
303
311
 
304
312
  // 服务端拉取
305
313
  }else{
306
- get_item(this.item_id, this.client_id).then((res) => {
314
+ get_item(this.item_id, this.final_client).then((res) => {
307
315
  let data = res.data;
308
316
  if (data.code === 200) {
309
317
  let item = data.data.item;
package/src/Resource.vue CHANGED
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="c-resource">
3
3
  <!-- 上传触发按钮 -->
4
- <el-button class="u-switch" type="primary" @click="openDialog" :disabled="!enable"> <img class="u-icon" svg-inline src="../assets/img/jx3.svg" />剑三资源 </el-button>
4
+ <el-button class="u-switch" type="primary" @click="openDialog" :disabled="!enable"> <img class="u-icon" svg-inline src="../assets/img/jx3.svg" />插入资源 </el-button>
5
5
 
6
6
  <!-- 弹出界面 -->
7
7
  <el-dialog class="c-large-dialog" title="剑三数据库" :visible.sync="dialogVisible">
@@ -97,15 +97,19 @@
97
97
  <i class="el-icon-s-data"></i> 共找到 <b>{{ item.length }}</b> 条记录
98
98
  </p>
99
99
  <ul class="m-resource-list" v-if="item.length">
100
- <li v-for="(o, i) in item" :key="i" class="u-item" :class="{ on: o.isSelected }" @click="selectItem(o, i)" ref="item">
101
- <span class="u-id">ID:{{ o.id }}</span>
102
- <img class="u-pic" :title="'IconID:' + o.IconID" :src="iconURL(o.IconID)" />
103
- <span class="u-name">{{ o.Name }}</span>
104
- <span class="u-content" v-html="o.DescHtml"></span>
105
- <span class="u-remark">
106
- {{ o.Requirement }}
107
- </span>
108
- </li>
100
+ <el-popover popper-class="m-item-pop" :visible-arrow="false" trigger="hover" placement="left" v-for="(o, i) in item" :key="i">
101
+ <li slot="reference" class="u-item" :class="{ on: o.isSelected }" @click="selectItem(o, i)" ref="item">
102
+ <span class="u-id">ID:{{ o.id }}</span>
103
+ <img class="u-pic" :title="'IconID:' + o.IconID" :src="iconURL(o.IconID)" />
104
+ <span class="u-name">{{ o.Name }}</span>
105
+ <span class="u-content" v-html="o.DescHtml"></span>
106
+ <span class="u-remark">
107
+ {{ o.Requirement }}
108
+ </span>
109
+ </li>
110
+
111
+ <jx3-item :item_id="o.id"></jx3-item>
112
+ </el-popover>
109
113
  </ul>
110
114
  <el-alert v-if="!item.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
111
115
  </el-tab-pane>
@@ -193,12 +197,11 @@
193
197
  </template>
194
198
 
195
199
  <script>
196
- import axios from "axios";
197
200
  import { loadResource, loadStat, getIcons } from "../service/database";
198
201
  import { __ossRoot, __iconPath, __Root, __OriginRoot } from "@jx3box/jx3box-common/data/jx3box.json";
199
202
  import detach_types from "../assets/data/detach_type.json";
200
- import User from "@jx3box/jx3box-common/js/user";
201
- import { iconLink } from "@jx3box/jx3box-common/js/utils";
203
+ import { iconLink,getLink } from "@jx3box/jx3box-common/js/utils";
204
+ import Item from './Item.vue';
202
205
  export default {
203
206
  name: "Resource",
204
207
  props: {
@@ -369,7 +372,7 @@ export default {
369
372
  // <img src="${this.iconURL(
370
373
  // o.IconID
371
374
  // )}">
372
- this.html = `<a data-type="buff" class="e-jx3-buff w-jx3-element ${o.CanCancel == 1 ? "isBuff" : "isDebuff"}" href="${this.getLink(
375
+ this.html = `<a data-type="buff" class="e-jx3-buff w-jx3-element ${o.CanCancel == 1 ? "isBuff" : "isDebuff"}" href="${this.getDbLink(
373
376
  "buff",
374
377
  this.client,
375
378
  o.BuffID,
@@ -383,7 +386,7 @@ export default {
383
386
  this.resetItems();
384
387
  o.isSelected = true;
385
388
  if (this.skill_mode == "simple") {
386
- this.html = `<a data-type="skill" class="e-jx3-skill w-jx3-element" href="${this.getLink("skill", this.client, o.SkillID, o.Level)}" data-client="${this.client}" data-id="${
389
+ this.html = `<a data-type="skill" class="e-jx3-skill w-jx3-element" href="${this.getDbLink("skill", this.client, o.SkillID, o.Level)}" data-client="${this.client}" data-id="${
387
390
  o.SkillID
388
391
  }" data-level="${o.Level}">[${o.Name}]</a>`;
389
392
  } else {
@@ -393,7 +396,7 @@ export default {
393
396
  selectItem: function(o, i) {
394
397
  this.resetItems();
395
398
  o.isSelected = true;
396
- this.html = `<a data-type="item" class="e-jx3-item e-jx3-item-q${o.Quality} w-jx3-element" data-mode="" data-id="${o.id}" data-quality="${o.Quality}" data-client="${this.client}" target="_blank" href="${o.Link}">[${o.Name}]</a>`;
399
+ this.html = `<a data-type="item" class="e-jx3-item e-jx3-item-q${o.Quality} w-jx3-element" data-mode="" data-id="${o.id}" data-quality="${o.Quality}" data-client="${this.client}" target="_blank" href="${this.getLink('item', o.id)}">[${o.Name}]</a>`;
397
400
  },
398
401
  selectIcon: function(o) {
399
402
  this.resetItems();
@@ -403,7 +406,7 @@ export default {
403
406
  selectNpc: function (o, i){
404
407
  this.resetItems()
405
408
  o.isSelected = true
406
- this.html = `<a data-type="npc" class="e-jx3-npc w-jx3-element" data-mode="" data-id="${o.ID}" data-client="${this.client}" target="_blank" href="${this.getLink("npc", this.client, o.ID, '')}">[${o.Name}]</a>`
409
+ this.html = `<a data-type="npc" class="e-jx3-npc w-jx3-element" data-mode="" data-id="${o.ID}" data-client="${this.client}" target="_blank" href="${this.getDbLink("npc", this.client, o.ID, '')}">[${o.Name}]</a>`
407
410
  },
408
411
  resetItems: function() {
409
412
  let data = this[this.type];
@@ -418,10 +421,14 @@ export default {
418
421
  iconURL: function(id) {
419
422
  return iconLink(id, this.client);
420
423
  },
421
- getLink: function(type, client, id, level) {
424
+ getDbLink: function(type, client, id, level) {
422
425
  let domain = client == "origin" ? __OriginRoot : __Root;
423
426
  return domain + "app/database/?type=" + type + `&query=${id}&level=${level}`;
424
427
  },
428
+ getLink : function (type,id){
429
+ let domain = this.client == "origin" ? __OriginRoot : __Root;
430
+ return domain + getLink(type,id).slice(1)
431
+ },
425
432
 
426
433
  // 杂项
427
434
  // ==============================
@@ -450,10 +457,18 @@ export default {
450
457
  created: function() {
451
458
  this.checkUA();
452
459
  },
453
- components: {},
460
+ components: {
461
+ 'jx3-item': Item
462
+ },
454
463
  };
455
464
  </script>
456
465
 
457
466
  <style lang="less">
458
467
  @import "../assets/css/resource.less";
468
+
469
+ .m-item-pop {
470
+ padding: 0 !important;
471
+ background: none !important;
472
+ border: none;
473
+ }
459
474
  </style>