@jx3box/jx3box-editor 1.2.3 → 1.2.4

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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/src/Item.vue +12 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -41,6 +41,7 @@
41
41
  "axios": "^0.19.2",
42
42
  "core-js": "^3.6.5",
43
43
  "csslab": "^4.0.3",
44
+ "dayjs": "^1.10.7",
44
45
  "element-ui": "^2.13.2",
45
46
  "hevue-img-preview": "^5.0.0",
46
47
  "highlight.js": "^11.3.1",
package/src/Item.vue CHANGED
@@ -22,7 +22,7 @@
22
22
  <div
23
23
  v-if="parseInt(source.MaxExistTime) > 0"
24
24
  class="u-max-exist-time"
25
- v-text="'存在时间:' + second_format(source.MaxExistTime)"
25
+ v-text="'限时时间:' + showDuration(source.MaxExistTime)"
26
26
  ></div>
27
27
  <!-- 最大拥有数 -->
28
28
  <div
@@ -242,12 +242,17 @@
242
242
 
243
243
  <script>
244
244
  import { get_item } from "../service/item.js";
245
- import second_format from "../assets/js/item/second_format.js";
245
+
246
246
  import attribute_percent from "../assets/js/item/attribute_percent.js";
247
247
  import bind from "../assets/js/item/bind.js";
248
248
  import color from "../assets/js/item/color.js";
249
249
  import { iconLink } from "@jx3box/jx3box-common/js/utils";
250
250
 
251
+ import second_format from "../assets/js/item/second_format.js";
252
+ import dayjs from 'dayjs';
253
+ import duration from 'dayjs/plugin/duration'
254
+ dayjs.extend(duration);
255
+
251
256
  export default {
252
257
  name: "Item",
253
258
  props: ["item", "item_id", "jx3ClientType","client"],
@@ -280,6 +285,10 @@ export default {
280
285
  return iconLink(id,this.final_client)
281
286
  },
282
287
  second_format,
288
+ showDuration : function (val){
289
+ val = Number(val)
290
+ return val && dayjs.duration(val).asDays().toFixed(0) + '天';
291
+ },
283
292
  attribute_percent,
284
293
  bind,
285
294
  color,
@@ -334,4 +343,4 @@ export default {
334
343
 
335
344
  <style lang="less">
336
345
  @import "../assets/css/module/item.less";
337
- </style>
346
+ </style>